
/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */
/* WARNING: Unknown calling convention */

size_t rpl_regerror(int errcode,regex_t *preg,char *errbuf,size_t errbuf_size)

{
  uint uVar1;
  char *__s;
  size_t sVar2;
  
  if ((uint)errcode < 0x11) {
    __s = (char *)dcgettext(0,"Success" + __re_error_msgid_idx[errcode],5);
    sVar2 = strlen(__s);
    uVar1 = sVar2 + 1;
    if (errbuf_size != 0) {
      sVar2 = uVar1;
      if (errbuf_size < uVar1) {
        sVar2 = errbuf_size - 1;
        errbuf[errbuf_size - 1] = '\0';
      }
      memcpy(errbuf,__s,sVar2);
    }
    return uVar1;
  }
                    /* WARNING: Subroutine does not return */
  abort();
}



/* WARNING: Function: __i686.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */

uint FUN_00058d00(uint param_1,undefined4 param_2,void *param_3,uint param_4)

{
  uint uVar1;
  char *__s;
  size_t sVar2;
  
  if (param_1 < 0x11) {
    __s = (char *)dcgettext(0,"Success" + *(int *)(&DAT_00062020 + param_1 * 4),5);
    sVar2 = strlen(__s);
    uVar1 = sVar2 + 1;
    if (param_4 != 0) {
      sVar2 = uVar1;
      if (param_4 < uVar1) {
        sVar2 = param_4 - 1;
        *(undefined1 *)((int)param_3 + (param_4 - 1)) = 0;
      }
      memcpy(param_3,__s,sVar2);
    }
    return uVar1;
  }
                    /* WARNING: Subroutine does not return */
  abort();
}


PUSH EBP
PUSH EDI
PUSH ESI
PUSH EBX
CALL 0x00015680
ADD EBX,0x21ec7
SUB ESP,0xc
MOV EAX,dword ptr [ESP + 0x20]
MOV EDI,dword ptr [ESP + 0x2c]
CMP EAX,0x10
JA 0x00013ba7
MOV EAX,dword ptr [EBX + EAX*0x4 + 0xfffe7450]
SUB ESP,0x4
PUSH 0x5
LEA EAX,[EBX + EAX*0x1 + 0xfffe74b0]
PUSH EAX
PUSH 0x0
CALL 0x000132e0
MOV dword ptr [ESP],EAX
MOV EBP,EAX
CALL 0x00013630
ADD ESP,0x10
LEA ESI,[EAX + 0x1]
TEST EDI,EDI
JZ 0x00058d69
MOV EAX,ESI
CMP ESI,EDI
JA 0x00058d78
SUB ESP,0x4
PUSH EAX
PUSH EBP
PUSH dword ptr [ESP + 0x34]
CALL 0x00013230
ADD ESP,0x10
ADD ESP,0xc
MOV EAX,ESI
POP EBX
POP ESI
POP EDI
POP EBP
RET
MOV EDX,dword ptr [ESP + 0x28]
LEA EAX,[EDI + -0x1]
MOV byte ptr [EDX + EDI*0x1 + -0x1],0x0
JMP 0x00058d58
(translation_unit "/* WARNING: Function: __i686.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n\nuint FUN_00058d00(uint param_1,undefined4 param_2,void *param_3,uint param_4)\n\n{\n  uint uVar1;\n  char *__s;\n  size_t sVar2;\n  \n  if (param_1 < 0x11) {\n    __s = (char *)dcgettext(0,"Success" + *(int *)(&DAT_00062020 + param_1 * 4),5);\n    sVar2 = strlen(__s);\n    uVar1 = sVar2 + 1;\n    if (param_4 != 0) {\n      sVar2 = uVar1;\n      if (param_4 < uVar1) {\n        sVar2 = param_4 - 1;\n        *(undefined1 *)((int)param_3 + (param_4 - 1)) = 0;\n      }\n      memcpy(param_3,__s,sVar2);\n    }\n    return uVar1;\n  }\n                    /* WARNING: Subroutine does not return */\n  abort();\n}\n\n" comment (function_definition "uint FUN_00058d00(uint param_1,undefined4 param_2,void *param_3,uint param_4)\n\n{\n  uint uVar1;\n  char *__s;\n  size_t sVar2;\n  \n  if (param_1 < 0x11) {\n    __s = (char *)dcgettext(0,"Success" + *(int *)(&DAT_00062020 + param_1 * 4),5);\n    sVar2 = strlen(__s);\n    uVar1 = sVar2 + 1;\n    if (param_4 != 0) {\n      sVar2 = uVar1;\n      if (param_4 < uVar1) {\n        sVar2 = param_4 - 1;\n        *(undefined1 *)((int)param_3 + (param_4 - 1)) = 0;\n      }\n      memcpy(param_3,__s,sVar2);\n    }\n    return uVar1;\n  }\n                    /* WARNING: Subroutine does not return */\n  abort();\n}" type_identifier (function_declarator "FUN_00058d00(uint param_1,undefined4 param_2,void *param_3,uint param_4)" identifier (parameter_list "(uint param_1,undefined4 param_2,void *param_3,uint param_4)" ( (parameter_declaration "uint param_1" type_identifier identifier) , (parameter_declaration "undefined4 param_2" type_identifier identifier) , (parameter_declaration "void *param_3" primitive_type (pointer_declarator "*param_3" * identifier)) , (parameter_declaration "uint param_4" type_identifier identifier) ))) (compound_statement "{\n  uint uVar1;\n  char *__s;\n  size_t sVar2;\n  \n  if (param_1 < 0x11) {\n    __s = (char *)dcgettext(0,"Success" + *(int *)(&DAT_00062020 + param_1 * 4),5);\n    sVar2 = strlen(__s);\n    uVar1 = sVar2 + 1;\n    if (param_4 != 0) {\n      sVar2 = uVar1;\n      if (param_4 < uVar1) {\n        sVar2 = param_4 - 1;\n        *(undefined1 *)((int)param_3 + (param_4 - 1)) = 0;\n      }\n      memcpy(param_3,__s,sVar2);\n    }\n    return uVar1;\n  }\n                    /* WARNING: Subroutine does not return */\n  abort();\n}" { (declaration "uint uVar1;" type_identifier identifier ;) (declaration "char *__s;" primitive_type (pointer_declarator "*__s" * identifier) ;) (declaration "size_t sVar2;" primitive_type identifier ;) (if_statement "if (param_1 < 0x11) {\n    __s = (char *)dcgettext(0,"Success" + *(int *)(&DAT_00062020 + param_1 * 4),5);\n    sVar2 = strlen(__s);\n    uVar1 = sVar2 + 1;\n    if (param_4 != 0) {\n      sVar2 = uVar1;\n      if (param_4 < uVar1) {\n        sVar2 = param_4 - 1;\n        *(undefined1 *)((int)param_3 + (param_4 - 1)) = 0;\n      }\n      memcpy(param_3,__s,sVar2);\n    }\n    return uVar1;\n  }" if (parenthesized_expression "(param_1 < 0x11)" ( (binary_expression "param_1 < 0x11" identifier < number_literal) )) (compound_statement "{\n    __s = (char *)dcgettext(0,"Success" + *(int *)(&DAT_00062020 + param_1 * 4),5);\n    sVar2 = strlen(__s);\n    uVar1 = sVar2 + 1;\n    if (param_4 != 0) {\n      sVar2 = uVar1;\n      if (param_4 < uVar1) {\n        sVar2 = param_4 - 1;\n        *(undefined1 *)((int)param_3 + (param_4 - 1)) = 0;\n      }\n      memcpy(param_3,__s,sVar2);\n    }\n    return uVar1;\n  }" { (expression_statement "__s = (char *)dcgettext(0,"Success" + *(int *)(&DAT_00062020 + param_1 * 4),5);" (assignment_expression "__s = (char *)dcgettext(0,"Success" + *(int *)(&DAT_00062020 + param_1 * 4),5)" identifier = (cast_expression "(char *)dcgettext(0,"Success" + *(int *)(&DAT_00062020 + param_1 * 4),5)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "dcgettext(0,"Success" + *(int *)(&DAT_00062020 + param_1 * 4),5)" identifier (argument_list "(0,"Success" + *(int *)(&DAT_00062020 + param_1 * 4),5)" ( number_literal , (binary_expression ""Success" + *(int *)(&DAT_00062020 + param_1 * 4)" (string_literal ""Success"" " string_content ") + (pointer_expression "*(int *)(&DAT_00062020 + param_1 * 4)" * (cast_expression "(int *)(&DAT_00062020 + param_1 * 4)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(&DAT_00062020 + param_1 * 4)" ( (binary_expression "&DAT_00062020 + param_1 * 4" (pointer_expression "&DAT_00062020" & identifier) + (binary_expression "param_1 * 4" identifier * number_literal)) ))))) , number_literal ))))) ;) (expression_statement "sVar2 = strlen(__s);" (assignment_expression "sVar2 = strlen(__s)" identifier = (call_expression "strlen(__s)" identifier (argument_list "(__s)" ( identifier )))) ;) (expression_statement "uVar1 = sVar2 + 1;" (assignment_expression "uVar1 = sVar2 + 1" identifier = (binary_expression "sVar2 + 1" identifier + number_literal)) ;) (if_statement "if (param_4 != 0) {\n      sVar2 = uVar1;\n      if (param_4 < uVar1) {\n        sVar2 = param_4 - 1;\n        *(undefined1 *)((int)param_3 + (param_4 - 1)) = 0;\n      }\n      memcpy(param_3,__s,sVar2);\n    }" if (parenthesized_expression "(param_4 != 0)" ( (binary_expression "param_4 != 0" identifier != number_literal) )) (compound_statement "{\n      sVar2 = uVar1;\n      if (param_4 < uVar1) {\n        sVar2 = param_4 - 1;\n        *(undefined1 *)((int)param_3 + (param_4 - 1)) = 0;\n      }\n      memcpy(param_3,__s,sVar2);\n    }" { (expression_statement "sVar2 = uVar1;" (assignment_expression "sVar2 = uVar1" identifier = identifier) ;) (if_statement "if (param_4 < uVar1) {\n        sVar2 = param_4 - 1;\n        *(undefined1 *)((int)param_3 + (param_4 - 1)) = 0;\n      }" if (parenthesized_expression "(param_4 < uVar1)" ( (binary_expression "param_4 < uVar1" identifier < identifier) )) (compound_statement "{\n        sVar2 = param_4 - 1;\n        *(undefined1 *)((int)param_3 + (param_4 - 1)) = 0;\n      }" { (expression_statement "sVar2 = param_4 - 1;" (assignment_expression "sVar2 = param_4 - 1" identifier = (binary_expression "param_4 - 1" identifier - number_literal)) ;) (expression_statement "*(undefined1 *)((int)param_3 + (param_4 - 1)) = 0;" (assignment_expression "*(undefined1 *)((int)param_3 + (param_4 - 1)) = 0" (pointer_expression "*(undefined1 *)((int)param_3 + (param_4 - 1))" * (cast_expression "(undefined1 *)((int)param_3 + (param_4 - 1))" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((int)param_3 + (param_4 - 1))" ( (binary_expression "(int)param_3 + (param_4 - 1)" (cast_expression "(int)param_3" ( (type_descriptor "int" primitive_type) ) identifier) + (parenthesized_expression "(param_4 - 1)" ( (binary_expression "param_4 - 1" identifier - number_literal) ))) )))) = number_literal) ;) })) (expression_statement "memcpy(param_3,__s,sVar2);" (call_expression "memcpy(param_3,__s,sVar2)" identifier (argument_list "(param_3,__s,sVar2)" ( identifier , identifier , identifier ))) ;) })) (return_statement "return uVar1;" return identifier ;) })) comment (expression_statement "abort();" (call_expression "abort()" identifier (argument_list "()" ( ))) ;) })))
(translation_unit "/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n/* WARNING: Unknown calling convention */\n\nsize_t rpl_regerror(int errcode,regex_t *preg,char *errbuf,size_t errbuf_size)\n\n{\n  uint uVar1;\n  char *__s;\n  size_t sVar2;\n  \n  if ((uint)errcode < 0x11) {\n    __s = (char *)dcgettext(0,"Success" + __re_error_msgid_idx[errcode],5);\n    sVar2 = strlen(__s);\n    uVar1 = sVar2 + 1;\n    if (errbuf_size != 0) {\n      sVar2 = uVar1;\n      if (errbuf_size < uVar1) {\n        sVar2 = errbuf_size - 1;\n        errbuf[errbuf_size - 1] = '\0';\n      }\n      memcpy(errbuf,__s,sVar2);\n    }\n    return uVar1;\n  }\n                    /* WARNING: Subroutine does not return */\n  abort();\n}\n\n" comment comment (function_definition "size_t rpl_regerror(int errcode,regex_t *preg,char *errbuf,size_t errbuf_size)\n\n{\n  uint uVar1;\n  char *__s;\n  size_t sVar2;\n  \n  if ((uint)errcode < 0x11) {\n    __s = (char *)dcgettext(0,"Success" + __re_error_msgid_idx[errcode],5);\n    sVar2 = strlen(__s);\n    uVar1 = sVar2 + 1;\n    if (errbuf_size != 0) {\n      sVar2 = uVar1;\n      if (errbuf_size < uVar1) {\n        sVar2 = errbuf_size - 1;\n        errbuf[errbuf_size - 1] = '\0';\n      }\n      memcpy(errbuf,__s,sVar2);\n    }\n    return uVar1;\n  }\n                    /* WARNING: Subroutine does not return */\n  abort();\n}" primitive_type (function_declarator "rpl_regerror(int errcode,regex_t *preg,char *errbuf,size_t errbuf_size)" identifier (parameter_list "(int errcode,regex_t *preg,char *errbuf,size_t errbuf_size)" ( (parameter_declaration "int errcode" primitive_type identifier) , (parameter_declaration "regex_t *preg" type_identifier (pointer_declarator "*preg" * identifier)) , (parameter_declaration "char *errbuf" primitive_type (pointer_declarator "*errbuf" * identifier)) , (parameter_declaration "size_t errbuf_size" primitive_type identifier) ))) (compound_statement "{\n  uint uVar1;\n  char *__s;\n  size_t sVar2;\n  \n  if ((uint)errcode < 0x11) {\n    __s = (char *)dcgettext(0,"Success" + __re_error_msgid_idx[errcode],5);\n    sVar2 = strlen(__s);\n    uVar1 = sVar2 + 1;\n    if (errbuf_size != 0) {\n      sVar2 = uVar1;\n      if (errbuf_size < uVar1) {\n        sVar2 = errbuf_size - 1;\n        errbuf[errbuf_size - 1] = '\0';\n      }\n      memcpy(errbuf,__s,sVar2);\n    }\n    return uVar1;\n  }\n                    /* WARNING: Subroutine does not return */\n  abort();\n}" { (declaration "uint uVar1;" type_identifier identifier ;) (declaration "char *__s;" primitive_type (pointer_declarator "*__s" * identifier) ;) (declaration "size_t sVar2;" primitive_type identifier ;) (if_statement "if ((uint)errcode < 0x11) {\n    __s = (char *)dcgettext(0,"Success" + __re_error_msgid_idx[errcode],5);\n    sVar2 = strlen(__s);\n    uVar1 = sVar2 + 1;\n    if (errbuf_size != 0) {\n      sVar2 = uVar1;\n      if (errbuf_size < uVar1) {\n        sVar2 = errbuf_size - 1;\n        errbuf[errbuf_size - 1] = '\0';\n      }\n      memcpy(errbuf,__s,sVar2);\n    }\n    return uVar1;\n  }" if (parenthesized_expression "((uint)errcode < 0x11)" ( (binary_expression "(uint)errcode < 0x11" (cast_expression "(uint)errcode" ( (type_descriptor "uint" type_identifier) ) identifier) < number_literal) )) (compound_statement "{\n    __s = (char *)dcgettext(0,"Success" + __re_error_msgid_idx[errcode],5);\n    sVar2 = strlen(__s);\n    uVar1 = sVar2 + 1;\n    if (errbuf_size != 0) {\n      sVar2 = uVar1;\n      if (errbuf_size < uVar1) {\n        sVar2 = errbuf_size - 1;\n        errbuf[errbuf_size - 1] = '\0';\n      }\n      memcpy(errbuf,__s,sVar2);\n    }\n    return uVar1;\n  }" { (expression_statement "__s = (char *)dcgettext(0,"Success" + __re_error_msgid_idx[errcode],5);" (assignment_expression "__s = (char *)dcgettext(0,"Success" + __re_error_msgid_idx[errcode],5)" identifier = (cast_expression "(char *)dcgettext(0,"Success" + __re_error_msgid_idx[errcode],5)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "dcgettext(0,"Success" + __re_error_msgid_idx[errcode],5)" identifier (argument_list "(0,"Success" + __re_error_msgid_idx[errcode],5)" ( number_literal , (binary_expression ""Success" + __re_error_msgid_idx[errcode]" (string_literal ""Success"" " string_content ") + (subscript_expression "__re_error_msgid_idx[errcode]" identifier [ identifier ])) , number_literal ))))) ;) (expression_statement "sVar2 = strlen(__s);" (assignment_expression "sVar2 = strlen(__s)" identifier = (call_expression "strlen(__s)" identifier (argument_list "(__s)" ( identifier )))) ;) (expression_statement "uVar1 = sVar2 + 1;" (assignment_expression "uVar1 = sVar2 + 1" identifier = (binary_expression "sVar2 + 1" identifier + number_literal)) ;) (if_statement "if (errbuf_size != 0) {\n      sVar2 = uVar1;\n      if (errbuf_size < uVar1) {\n        sVar2 = errbuf_size - 1;\n        errbuf[errbuf_size - 1] = '\0';\n      }\n      memcpy(errbuf,__s,sVar2);\n    }" if (parenthesized_expression "(errbuf_size != 0)" ( (binary_expression "errbuf_size != 0" identifier != number_literal) )) (compound_statement "{\n      sVar2 = uVar1;\n      if (errbuf_size < uVar1) {\n        sVar2 = errbuf_size - 1;\n        errbuf[errbuf_size - 1] = '\0';\n      }\n      memcpy(errbuf,__s,sVar2);\n    }" { (expression_statement "sVar2 = uVar1;" (assignment_expression "sVar2 = uVar1" identifier = identifier) ;) (if_statement "if (errbuf_size < uVar1) {\n        sVar2 = errbuf_size - 1;\n        errbuf[errbuf_size - 1] = '\0';\n      }" if (parenthesized_expression "(errbuf_size < uVar1)" ( (binary_expression "errbuf_size < uVar1" identifier < identifier) )) (compound_statement "{\n        sVar2 = errbuf_size - 1;\n        errbuf[errbuf_size - 1] = '\0';\n      }" { (expression_statement "sVar2 = errbuf_size - 1;" (assignment_expression "sVar2 = errbuf_size - 1" identifier = (binary_expression "errbuf_size - 1" identifier - number_literal)) ;) (expression_statement "errbuf[errbuf_size - 1] = '\0';" (assignment_expression "errbuf[errbuf_size - 1] = '\0'" (subscript_expression "errbuf[errbuf_size - 1]" identifier [ (binary_expression "errbuf_size - 1" identifier - number_literal) ]) = (char_literal "'\0'" ' escape_sequence ')) ;) })) (expression_statement "memcpy(errbuf,__s,sVar2);" (call_expression "memcpy(errbuf,__s,sVar2)" identifier (argument_list "(errbuf,__s,sVar2)" ( identifier , identifier , identifier ))) ;) })) (return_statement "return uVar1;" return identifier ;) })) comment (expression_statement "abort();" (call_expression "abort()" identifier (argument_list "()" ( ))) ;) })))
(translation_unit "uint FUN_00058d00(uint param_1,undefined4 param_2,void *param_3,uint param_4)\n\n{\n  uint uVar1;\n  char *__s;\n  size_t sVar2;\n  \n  if (param_1 < 0x11) {\n    __s = (char *)dcgettext(0,"Success" + *(int *)(&DAT_00062020 + param_1 * 4),5);\n    sVar2 = strlen(__s);\n    uVar1 = sVar2 + 1;\n    if (param_4 != 0) {\n      sVar2 = uVar1;\n      if (param_4 < uVar1) {\n        sVar2 = param_4 - 1;\n        *(undefined1 *)((int)param_3 + (param_4 - 1)) = 0;\n      }\n      memcpy(param_3,__s,sVar2);\n    }\n    return uVar1;\n  }\n                    \n  abort();\n}\n\n" (function_definition "uint FUN_00058d00(uint param_1,undefined4 param_2,void *param_3,uint param_4)\n\n{\n  uint uVar1;\n  char *__s;\n  size_t sVar2;\n  \n  if (param_1 < 0x11) {\n    __s = (char *)dcgettext(0,"Success" + *(int *)(&DAT_00062020 + param_1 * 4),5);\n    sVar2 = strlen(__s);\n    uVar1 = sVar2 + 1;\n    if (param_4 != 0) {\n      sVar2 = uVar1;\n      if (param_4 < uVar1) {\n        sVar2 = param_4 - 1;\n        *(undefined1 *)((int)param_3 + (param_4 - 1)) = 0;\n      }\n      memcpy(param_3,__s,sVar2);\n    }\n    return uVar1;\n  }\n                    \n  abort();\n}" type_identifier (function_declarator "FUN_00058d00(uint param_1,undefined4 param_2,void *param_3,uint param_4)" identifier (parameter_list "(uint param_1,undefined4 param_2,void *param_3,uint param_4)" ( (parameter_declaration "uint param_1" type_identifier identifier) , (parameter_declaration "undefined4 param_2" type_identifier identifier) , (parameter_declaration "void *param_3" primitive_type (pointer_declarator "*param_3" * identifier)) , (parameter_declaration "uint param_4" type_identifier identifier) ))) (compound_statement "{\n  uint uVar1;\n  char *__s;\n  size_t sVar2;\n  \n  if (param_1 < 0x11) {\n    __s = (char *)dcgettext(0,"Success" + *(int *)(&DAT_00062020 + param_1 * 4),5);\n    sVar2 = strlen(__s);\n    uVar1 = sVar2 + 1;\n    if (param_4 != 0) {\n      sVar2 = uVar1;\n      if (param_4 < uVar1) {\n        sVar2 = param_4 - 1;\n        *(undefined1 *)((int)param_3 + (param_4 - 1)) = 0;\n      }\n      memcpy(param_3,__s,sVar2);\n    }\n    return uVar1;\n  }\n                    \n  abort();\n}" { (declaration "uint uVar1;" type_identifier identifier ;) (declaration "char *__s;" primitive_type (pointer_declarator "*__s" * identifier) ;) (declaration "size_t sVar2;" primitive_type identifier ;) (if_statement "if (param_1 < 0x11) {\n    __s = (char *)dcgettext(0,"Success" + *(int *)(&DAT_00062020 + param_1 * 4),5);\n    sVar2 = strlen(__s);\n    uVar1 = sVar2 + 1;\n    if (param_4 != 0) {\n      sVar2 = uVar1;\n      if (param_4 < uVar1) {\n        sVar2 = param_4 - 1;\n        *(undefined1 *)((int)param_3 + (param_4 - 1)) = 0;\n      }\n      memcpy(param_3,__s,sVar2);\n    }\n    return uVar1;\n  }" if (parenthesized_expression "(param_1 < 0x11)" ( (binary_expression "param_1 < 0x11" identifier < number_literal) )) (compound_statement "{\n    __s = (char *)dcgettext(0,"Success" + *(int *)(&DAT_00062020 + param_1 * 4),5);\n    sVar2 = strlen(__s);\n    uVar1 = sVar2 + 1;\n    if (param_4 != 0) {\n      sVar2 = uVar1;\n      if (param_4 < uVar1) {\n        sVar2 = param_4 - 1;\n        *(undefined1 *)((int)param_3 + (param_4 - 1)) = 0;\n      }\n      memcpy(param_3,__s,sVar2);\n    }\n    return uVar1;\n  }" { (expression_statement "__s = (char *)dcgettext(0,"Success" + *(int *)(&DAT_00062020 + param_1 * 4),5);" (assignment_expression "__s = (char *)dcgettext(0,"Success" + *(int *)(&DAT_00062020 + param_1 * 4),5)" identifier = (cast_expression "(char *)dcgettext(0,"Success" + *(int *)(&DAT_00062020 + param_1 * 4),5)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "dcgettext(0,"Success" + *(int *)(&DAT_00062020 + param_1 * 4),5)" identifier (argument_list "(0,"Success" + *(int *)(&DAT_00062020 + param_1 * 4),5)" ( number_literal , (binary_expression ""Success" + *(int *)(&DAT_00062020 + param_1 * 4)" (string_literal ""Success"" " string_content ") + (pointer_expression "*(int *)(&DAT_00062020 + param_1 * 4)" * (cast_expression "(int *)(&DAT_00062020 + param_1 * 4)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(&DAT_00062020 + param_1 * 4)" ( (binary_expression "&DAT_00062020 + param_1 * 4" (pointer_expression "&DAT_00062020" & identifier) + (binary_expression "param_1 * 4" identifier * number_literal)) ))))) , number_literal ))))) ;) (expression_statement "sVar2 = strlen(__s);" (assignment_expression "sVar2 = strlen(__s)" identifier = (call_expression "strlen(__s)" identifier (argument_list "(__s)" ( identifier )))) ;) (expression_statement "uVar1 = sVar2 + 1;" (assignment_expression "uVar1 = sVar2 + 1" identifier = (binary_expression "sVar2 + 1" identifier + number_literal)) ;) (if_statement "if (param_4 != 0) {\n      sVar2 = uVar1;\n      if (param_4 < uVar1) {\n        sVar2 = param_4 - 1;\n        *(undefined1 *)((int)param_3 + (param_4 - 1)) = 0;\n      }\n      memcpy(param_3,__s,sVar2);\n    }" if (parenthesized_expression "(param_4 != 0)" ( (binary_expression "param_4 != 0" identifier != number_literal) )) (compound_statement "{\n      sVar2 = uVar1;\n      if (param_4 < uVar1) {\n        sVar2 = param_4 - 1;\n        *(undefined1 *)((int)param_3 + (param_4 - 1)) = 0;\n      }\n      memcpy(param_3,__s,sVar2);\n    }" { (expression_statement "sVar2 = uVar1;" (assignment_expression "sVar2 = uVar1" identifier = identifier) ;) (if_statement "if (param_4 < uVar1) {\n        sVar2 = param_4 - 1;\n        *(undefined1 *)((int)param_3 + (param_4 - 1)) = 0;\n      }" if (parenthesized_expression "(param_4 < uVar1)" ( (binary_expression "param_4 < uVar1" identifier < identifier) )) (compound_statement "{\n        sVar2 = param_4 - 1;\n        *(undefined1 *)((int)param_3 + (param_4 - 1)) = 0;\n      }" { (expression_statement "sVar2 = param_4 - 1;" (assignment_expression "sVar2 = param_4 - 1" identifier = (binary_expression "param_4 - 1" identifier - number_literal)) ;) (expression_statement "*(undefined1 *)((int)param_3 + (param_4 - 1)) = 0;" (assignment_expression "*(undefined1 *)((int)param_3 + (param_4 - 1)) = 0" (pointer_expression "*(undefined1 *)((int)param_3 + (param_4 - 1))" * (cast_expression "(undefined1 *)((int)param_3 + (param_4 - 1))" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((int)param_3 + (param_4 - 1))" ( (binary_expression "(int)param_3 + (param_4 - 1)" (cast_expression "(int)param_3" ( (type_descriptor "int" primitive_type) ) identifier) + (parenthesized_expression "(param_4 - 1)" ( (binary_expression "param_4 - 1" identifier - number_literal) ))) )))) = number_literal) ;) })) (expression_statement "memcpy(param_3,__s,sVar2);" (call_expression "memcpy(param_3,__s,sVar2)" identifier (argument_list "(param_3,__s,sVar2)" ( identifier , identifier , identifier ))) ;) })) (return_statement "return uVar1;" return identifier ;) })) (expression_statement "abort();" (call_expression "abort()" identifier (argument_list "()" ( ))) ;) })))
(translation_unit (function_definition TYPE (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE (pointer_declarator * IDENT)) , (parameter_declaration TYPE IDENT) ))) (compound_statement { (declaration TYPE IDENT ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE IDENT ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT < LIT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (call_expression IDENT (argument_list ( LIT , (binary_expression (string_literal " string_content ") + (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression (pointer_expression & IDENT) + (binary_expression IDENT * LIT)) ))))) , LIT ))))) ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT )))) ;) (expression_statement (assignment_expression IDENT = (binary_expression IDENT + LIT)) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT != LIT) )) (compound_statement { (expression_statement (assignment_expression IDENT = IDENT) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT < IDENT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (binary_expression IDENT - LIT)) ;) (expression_statement (assignment_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression (cast_expression ( (type_descriptor TYPE) ) IDENT) + (parenthesized_expression ( (binary_expression IDENT - LIT) ))) )))) = LIT) ;) })) (expression_statement (call_expression IDENT (argument_list ( IDENT , IDENT , IDENT ))) ;) })) (return_statement return IDENT ;) })) (expression_statement (call_expression IDENT (argument_list ( ))) ;) })))
(function_definition "uint FUN_00058d00(uint param_1,undefined4 param_2,void *param_3,uint param_4)\n\n{\n  uint uVar1;\n  char *__s;\n  size_t sVar2;\n  \n  if (param_1 < 0x11) {\n    __s = (char *)dcgettext(0,"Success" + *(int *)(&DAT_00062020 + param_1 * 4),5);\n    sVar2 = strlen(__s);\n    uVar1 = sVar2 + 1;\n    if (param_4 != 0) {\n      sVar2 = uVar1;\n      if (param_4 < uVar1) {\n        sVar2 = param_4 - 1;\n        *(undefined1 *)((int)param_3 + (param_4 - 1)) = 0;\n      }\n      memcpy(param_3,__s,sVar2);\n    }\n    return uVar1;\n  }\n                    \n  abort();\n}" (type_identifier "uint") (function_declarator "FUN_00058d00(uint param_1,undefined4 param_2,void *param_3,uint param_4)" (identifier "FUN_00058d00") (parameter_list "(uint param_1,undefined4 param_2,void *param_3,uint param_4)" (( "(") (parameter_declaration "uint param_1" (type_identifier "uint") (identifier "param_1")) (, ",") (parameter_declaration "undefined4 param_2" (type_identifier "undefined4") (identifier "param_2")) (, ",") (parameter_declaration "void *param_3" (primitive_type "void") (pointer_declarator "*param_3" (* "*") (identifier "param_3"))) (, ",") (parameter_declaration "uint param_4" (type_identifier "uint") (identifier "param_4")) () ")"))) (compound_statement "{\n  uint uVar1;\n  char *__s;\n  size_t sVar2;\n  \n  if (param_1 < 0x11) {\n    __s = (char *)dcgettext(0,"Success" + *(int *)(&DAT_00062020 + param_1 * 4),5);\n    sVar2 = strlen(__s);\n    uVar1 = sVar2 + 1;\n    if (param_4 != 0) {\n      sVar2 = uVar1;\n      if (param_4 < uVar1) {\n        sVar2 = param_4 - 1;\n        *(undefined1 *)((int)param_3 + (param_4 - 1)) = 0;\n      }\n      memcpy(param_3,__s,sVar2);\n    }\n    return uVar1;\n  }\n                    \n  abort();\n}" ({ "{") (declaration "uint uVar1;" (type_identifier "uint") (identifier "uVar1") (; ";")) (declaration "char *__s;" (primitive_type "char") (pointer_declarator "*__s" (* "*") (identifier "__s")) (; ";")) (declaration "size_t sVar2;" (primitive_type "size_t") (identifier "sVar2") (; ";")) (if_statement "if (param_1 < 0x11) {\n    __s = (char *)dcgettext(0,"Success" + *(int *)(&DAT_00062020 + param_1 * 4),5);\n    sVar2 = strlen(__s);\n    uVar1 = sVar2 + 1;\n    if (param_4 != 0) {\n      sVar2 = uVar1;\n      if (param_4 < uVar1) {\n        sVar2 = param_4 - 1;\n        *(undefined1 *)((int)param_3 + (param_4 - 1)) = 0;\n      }\n      memcpy(param_3,__s,sVar2);\n    }\n    return uVar1;\n  }" (if "if") (parenthesized_expression "(param_1 < 0x11)" (( "(") (binary_expression "param_1 < 0x11" (identifier "param_1") (< "<") (number_literal "0x11")) () ")")) (compound_statement "{\n    __s = (char *)dcgettext(0,"Success" + *(int *)(&DAT_00062020 + param_1 * 4),5);\n    sVar2 = strlen(__s);\n    uVar1 = sVar2 + 1;\n    if (param_4 != 0) {\n      sVar2 = uVar1;\n      if (param_4 < uVar1) {\n        sVar2 = param_4 - 1;\n        *(undefined1 *)((int)param_3 + (param_4 - 1)) = 0;\n      }\n      memcpy(param_3,__s,sVar2);\n    }\n    return uVar1;\n  }" ({ "{") (expression_statement "__s = (char *)dcgettext(0,"Success" + *(int *)(&DAT_00062020 + param_1 * 4),5);" (assignment_expression "__s = (char *)dcgettext(0,"Success" + *(int *)(&DAT_00062020 + param_1 * 4),5)" (identifier "__s") (= "=") (cast_expression "(char *)dcgettext(0,"Success" + *(int *)(&DAT_00062020 + param_1 * 4),5)" (( "(") (type_descriptor "char *" (primitive_type "char") (abstract_pointer_declarator "*" (* "*"))) () ")") (call_expression "dcgettext(0,"Success" + *(int *)(&DAT_00062020 + param_1 * 4),5)" (identifier "dcgettext") (argument_list "(0,"Success" + *(int *)(&DAT_00062020 + param_1 * 4),5)" (( "(") (number_literal "0") (, ",") (binary_expression ""Success" + *(int *)(&DAT_00062020 + param_1 * 4)" (string_literal ""Success"" (" """) (string_content "Success") (" """)) (+ "+") (pointer_expression "*(int *)(&DAT_00062020 + param_1 * 4)" (* "*") (cast_expression "(int *)(&DAT_00062020 + param_1 * 4)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(&DAT_00062020 + param_1 * 4)" (( "(") (binary_expression "&DAT_00062020 + param_1 * 4" (pointer_expression "&DAT_00062020" (& "&") (identifier "DAT_00062020")) (+ "+") (binary_expression "param_1 * 4" (identifier "param_1") (* "*") (number_literal "4"))) () ")"))))) (, ",") (number_literal "5") () ")"))))) (; ";")) (expression_statement "sVar2 = strlen(__s);" (assignment_expression "sVar2 = strlen(__s)" (identifier "sVar2") (= "=") (call_expression "strlen(__s)" (identifier "strlen") (argument_list "(__s)" (( "(") (identifier "__s") () ")")))) (; ";")) (expression_statement "uVar1 = sVar2 + 1;" (assignment_expression "uVar1 = sVar2 + 1" (identifier "uVar1") (= "=") (binary_expression "sVar2 + 1" (identifier "sVar2") (+ "+") (number_literal "1"))) (; ";")) (if_statement "if (param_4 != 0) {\n      sVar2 = uVar1;\n      if (param_4 < uVar1) {\n        sVar2 = param_4 - 1;\n        *(undefined1 *)((int)param_3 + (param_4 - 1)) = 0;\n      }\n      memcpy(param_3,__s,sVar2);\n    }" (if "if") (parenthesized_expression "(param_4 != 0)" (( "(") (binary_expression "param_4 != 0" (identifier "param_4") (!= "!=") (number_literal "0")) () ")")) (compound_statement "{\n      sVar2 = uVar1;\n      if (param_4 < uVar1) {\n        sVar2 = param_4 - 1;\n        *(undefined1 *)((int)param_3 + (param_4 - 1)) = 0;\n      }\n      memcpy(param_3,__s,sVar2);\n    }" ({ "{") (expression_statement "sVar2 = uVar1;" (assignment_expression "sVar2 = uVar1" (identifier "sVar2") (= "=") (identifier "uVar1")) (; ";")) (if_statement "if (param_4 < uVar1) {\n        sVar2 = param_4 - 1;\n        *(undefined1 *)((int)param_3 + (param_4 - 1)) = 0;\n      }" (if "if") (parenthesized_expression "(param_4 < uVar1)" (( "(") (binary_expression "param_4 < uVar1" (identifier "param_4") (< "<") (identifier "uVar1")) () ")")) (compound_statement "{\n        sVar2 = param_4 - 1;\n        *(undefined1 *)((int)param_3 + (param_4 - 1)) = 0;\n      }" ({ "{") (expression_statement "sVar2 = param_4 - 1;" (assignment_expression "sVar2 = param_4 - 1" (identifier "sVar2") (= "=") (binary_expression "param_4 - 1" (identifier "param_4") (- "-") (number_literal "1"))) (; ";")) (expression_statement "*(undefined1 *)((int)param_3 + (param_4 - 1)) = 0;" (assignment_expression "*(undefined1 *)((int)param_3 + (param_4 - 1)) = 0" (pointer_expression "*(undefined1 *)((int)param_3 + (param_4 - 1))" (* "*") (cast_expression "(undefined1 *)((int)param_3 + (param_4 - 1))" (( "(") (type_descriptor "undefined1 *" (type_identifier "undefined1") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "((int)param_3 + (param_4 - 1))" (( "(") (binary_expression "(int)param_3 + (param_4 - 1)" (cast_expression "(int)param_3" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (identifier "param_3")) (+ "+") (parenthesized_expression "(param_4 - 1)" (( "(") (binary_expression "param_4 - 1" (identifier "param_4") (- "-") (number_literal "1")) () ")"))) () ")")))) (= "=") (number_literal "0")) (; ";")) (} "}"))) (expression_statement "memcpy(param_3,__s,sVar2);" (call_expression "memcpy(param_3,__s,sVar2)" (identifier "memcpy") (argument_list "(param_3,__s,sVar2)" (( "(") (identifier "param_3") (, ",") (identifier "__s") (, ",") (identifier "sVar2") () ")"))) (; ";")) (} "}"))) (return_statement "return uVar1;" (return "return") (identifier "uVar1") (; ";")) (} "}"))) (expression_statement "abort();" (call_expression "abort()" (identifier "abort") (argument_list "()" (( "(") () ")"))) (; ";")) (} "}")))

/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */
/* WARNING: Unknown calling convention */

size_t function_1(int errcode,type_1 *preg,char *errbuf,size_t var_4)

{
  type_2 var_5;
  char *__s;
  size_t var_3;
  
  if ((type_2)errcode < 0x11) {
    __s = (char *)var_1(0,"Success" + __re_error_msgid_idx[errcode],5);
    var_3 = var_2(__s);
    var_5 = var_3 + 1;
    if (var_4 != 0) {
      var_3 = var_5;
      if (var_4 < var_5) {
        var_3 = var_4 - 1;
        errbuf[var_4 - 1] = '\0';
      }
      var_6(errbuf,__s,var_3);
    }
    return var_5;
  }
                    /* WARNING: Subroutine does not return */
  var_7();
}


(translation_unit (function_definition type: (type_identifier) declarator: (function_declarator declarator: (identifier) parameters: (parameter_list (parameter_declaration type: (type_identifier) declarator: (identifier)) (parameter_declaration type: (type_identifier) declarator: (identifier)) (parameter_declaration type: (primitive_type) declarator: (pointer_declarator declarator: (identifier))) (parameter_declaration type: (type_identifier) declarator: (identifier)))) body: (compound_statement (declaration type: (type_identifier) declarator: (identifier)) (declaration type: (primitive_type) declarator: (pointer_declarator declarator: (identifier))) (declaration type: (primitive_type) declarator: (identifier)) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (call_expression function: (identifier) arguments: (argument_list (number_literal) (binary_expression left: (string_literal (string_content)) right: (pointer_expression argument: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (pointer_expression argument: (identifier)) right: (binary_expression left: (identifier) right: (number_literal))))))) (number_literal)))))) (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (identifier))))) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (number_literal)))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (identifier))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) consequence: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (number_literal)))) (expression_statement (assignment_expression left: (pointer_expression argument: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (cast_expression type: (type_descriptor type: (primitive_type)) value: (identifier)) right: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))))))) right: (number_literal))))) (expression_statement (call_expression function: (identifier) arguments: (argument_list (identifier) (identifier) (identifier)))))) (return_statement (identifier)))) (expression_statement (call_expression function: (identifier) arguments: (argument_list))))))

/* WARNING: Function: __i686.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */

uint MASKED(uint param_1,undefined4 param_2,void *param_3,uint param_4)

{
  uint uVar1;
  char *__s;
  size_t sVar2;
  
  if (param_1 < 0x11) {
    __s = (char *)dcgettext(0,"Success" + *(int *)(&DAT_00062020 + param_1 * 4),5);
    sVar2 = strlen(__s);
    uVar1 = sVar2 + 1;
    if (param_4 != 0) {
      sVar2 = uVar1;
      if (param_4 < uVar1) {
        sVar2 = param_4 - 1;
        *(undefined1 *)((int)param_3 + (param_4 - 1)) = 0;
      }
      memcpy(param_3,__s,sVar2);
    }
    return uVar1;
  }
                    /* WARNING: Subroutine does not return */
  abort();
}

