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

void gz_error(gz_statep state,int err,char *msg)

{
  char *__s;
  size_t sVar1;
  size_t sVar2;
  char *pcVar3;
  
  if (state->msg != (char *)0x0) {
    if (state->err != -4) {
      free(state->msg);
    }
    state->msg = (char *)0x0;
  }
  if ((err != 0) && (err != -5)) {
    (state->x).have = 0;
  }
  state->err = err;
  if ((err != -4) && (msg != (char *)0x0)) {
    __s = state->path;
    sVar1 = strlen(__s);
    sVar2 = strlen(msg);
    pcVar3 = (char *)malloc(sVar1 + 3 + sVar2);
    state->msg = pcVar3;
    if (pcVar3 == (char *)0x0) {
      state->err = -4;
      return;
    }
    sVar1 = strlen(__s);
    sVar2 = strlen(msg);
    __snprintf_chk(pcVar3,sVar1 + 3 + sVar2,1,0xffffffff,&DAT_00028afd,__s,&DAT_00028afa,msg);
  }
  return;
}



void __regparm2 FUN_000216a0(undefined4 param_1,undefined4 param_2,int param_3,char *param_4)

{
  char *__s;
  size_t sVar1;
  size_t sVar2;
  void *pvVar3;
  int unaff_EBX;
  undefined4 *unaff_retaddr;
  
  entry(param_2,0x216a9);
  if ((void *)unaff_retaddr[0x17] != (void *)0x0) {
    if (unaff_retaddr[0x16] != -4) {
      free((void *)unaff_retaddr[0x17]);
    }
    unaff_retaddr[0x17] = 0;
  }
  if ((param_3 != 0) && (param_3 != -5)) {
    *unaff_retaddr = 0;
  }
  unaff_retaddr[0x16] = param_3;
  if ((param_3 != -4) && (param_4 != (char *)0x0)) {
    __s = (char *)unaff_retaddr[6];
    sVar1 = strlen(__s);
    sVar2 = strlen(param_4);
    pvVar3 = malloc(sVar1 + 3 + sVar2);
    unaff_retaddr[0x17] = pvVar3;
    if (pvVar3 == (void *)0x0) {
      unaff_retaddr[0x16] = 0xfffffffc;
      return;
    }
    sVar1 = strlen(__s);
    sVar2 = strlen(param_4);
    __snprintf_chk(pvVar3,sVar1 + 3 + sVar2,1,0xffffffff,unaff_EBX + 0x7454,__s,unaff_EBX + 0x7451,
                   param_4);
  }
  return;
}


PUSH EBP
PUSH EDI
PUSH ESI
PUSH EBX
CALL 0x00011aa0
ADD EBX,0xc957
SUB ESP,0xc
MOV ESI,dword ptr [ESP + 0x20]
MOV EDI,dword ptr [ESP + 0x24]
MOV EAX,dword ptr [ESI + 0x5c]
TEST EAX,EAX
JZ 0x000216d2
CMP dword ptr [ESI + 0x58],-0x4
JNZ 0x00021770
MOV dword ptr [ESI + 0x5c],0x0
TEST EDI,EDI
JZ 0x000216e1
CMP EDI,-0x5
JZ 0x000216e1
MOV dword ptr [ESI],0x0
CMP EDI,-0x4
MOV dword ptr [ESI + 0x58],EDI
JZ 0x0002175e
MOV EDI,dword ptr [ESP + 0x28]
TEST EDI,EDI
JZ 0x0002175e
MOV EBP,dword ptr [ESI + 0x18]
SUB ESP,0xc
PUSH EBP
CALL 0x00011940
POP ECX
PUSH dword ptr [ESP + 0x34]
MOV EDI,EAX
CALL 0x00011940
LEA EAX,[EDI + EAX*0x1 + 0x3]
MOV dword ptr [ESP],EAX
CALL 0x000118e0
ADD ESP,0x10
TEST EAX,EAX
MOV EDI,EAX
MOV dword ptr [ESI + 0x5c],EAX
JZ 0x00021788
SUB ESP,0xc
PUSH EBP
CALL 0x00011940
POP EDX
PUSH dword ptr [ESP + 0x34]
MOV ESI,EAX
CALL 0x00011940
LEA ECX,[EBX + 0xffffaafa]
LEA EDX,[EBX + 0xffffaafd]
LEA EAX,[ESI + EAX*0x1 + 0x3]
ADD ESP,0x10
PUSH dword ptr [ESP + 0x28]
PUSH ECX
PUSH EBP
PUSH EDX
PUSH -0x1
PUSH 0x1
PUSH EAX
PUSH EDI
CALL 0x000117e0
ADD ESP,0x20
ADD ESP,0xc
POP EBX
POP ESI
POP EDI
POP EBP
RET
SUB ESP,0xc
PUSH EAX
CALL 0x00011830
ADD ESP,0x10
JMP 0x000216cb
MOV dword ptr [ESI + 0x58],0xfffffffc
ADD ESP,0xc
POP EBX
POP ESI
POP EDI
POP EBP
RET
(translation_unit "void __regparm2 FUN_000216a0(undefined4 param_1,undefined4 param_2,int param_3,char *param_4)\n\n{\n  char *__s;\n  size_t sVar1;\n  size_t sVar2;\n  void *pvVar3;\n  int unaff_EBX;\n  undefined4 *unaff_retaddr;\n  \n  entry(param_2,0x216a9);\n  if ((void *)unaff_retaddr[0x17] != (void *)0x0) {\n    if (unaff_retaddr[0x16] != -4) {\n      free((void *)unaff_retaddr[0x17]);\n    }\n    unaff_retaddr[0x17] = 0;\n  }\n  if ((param_3 != 0) && (param_3 != -5)) {\n    *unaff_retaddr = 0;\n  }\n  unaff_retaddr[0x16] = param_3;\n  if ((param_3 != -4) && (param_4 != (char *)0x0)) {\n    __s = (char *)unaff_retaddr[6];\n    sVar1 = strlen(__s);\n    sVar2 = strlen(param_4);\n    pvVar3 = malloc(sVar1 + 3 + sVar2);\n    unaff_retaddr[0x17] = pvVar3;\n    if (pvVar3 == (void *)0x0) {\n      unaff_retaddr[0x16] = 0xfffffffc;\n      return;\n    }\n    sVar1 = strlen(__s);\n    sVar2 = strlen(param_4);\n    __snprintf_chk(pvVar3,sVar1 + 3 + sVar2,1,0xffffffff,unaff_EBX + 0x7454,__s,unaff_EBX + 0x7451,\n                   param_4);\n  }\n  return;\n}\n\n" (function_definition "void __regparm2 FUN_000216a0(undefined4 param_1,undefined4 param_2,int param_3,char *param_4)\n\n{\n  char *__s;\n  size_t sVar1;\n  size_t sVar2;\n  void *pvVar3;\n  int unaff_EBX;\n  undefined4 *unaff_retaddr;\n  \n  entry(param_2,0x216a9);\n  if ((void *)unaff_retaddr[0x17] != (void *)0x0) {\n    if (unaff_retaddr[0x16] != -4) {\n      free((void *)unaff_retaddr[0x17]);\n    }\n    unaff_retaddr[0x17] = 0;\n  }\n  if ((param_3 != 0) && (param_3 != -5)) {\n    *unaff_retaddr = 0;\n  }\n  unaff_retaddr[0x16] = param_3;\n  if ((param_3 != -4) && (param_4 != (char *)0x0)) {\n    __s = (char *)unaff_retaddr[6];\n    sVar1 = strlen(__s);\n    sVar2 = strlen(param_4);\n    pvVar3 = malloc(sVar1 + 3 + sVar2);\n    unaff_retaddr[0x17] = pvVar3;\n    if (pvVar3 == (void *)0x0) {\n      unaff_retaddr[0x16] = 0xfffffffc;\n      return;\n    }\n    sVar1 = strlen(__s);\n    sVar2 = strlen(param_4);\n    __snprintf_chk(pvVar3,sVar1 + 3 + sVar2,1,0xffffffff,unaff_EBX + 0x7454,__s,unaff_EBX + 0x7451,\n                   param_4);\n  }\n  return;\n}" primitive_type (ERROR "__regparm2" identifier) (function_declarator "FUN_000216a0(undefined4 param_1,undefined4 param_2,int param_3,char *param_4)" identifier (parameter_list "(undefined4 param_1,undefined4 param_2,int param_3,char *param_4)" ( (parameter_declaration "undefined4 param_1" type_identifier identifier) , (parameter_declaration "undefined4 param_2" type_identifier identifier) , (parameter_declaration "int param_3" primitive_type identifier) , (parameter_declaration "char *param_4" primitive_type (pointer_declarator "*param_4" * identifier)) ))) (compound_statement "{\n  char *__s;\n  size_t sVar1;\n  size_t sVar2;\n  void *pvVar3;\n  int unaff_EBX;\n  undefined4 *unaff_retaddr;\n  \n  entry(param_2,0x216a9);\n  if ((void *)unaff_retaddr[0x17] != (void *)0x0) {\n    if (unaff_retaddr[0x16] != -4) {\n      free((void *)unaff_retaddr[0x17]);\n    }\n    unaff_retaddr[0x17] = 0;\n  }\n  if ((param_3 != 0) && (param_3 != -5)) {\n    *unaff_retaddr = 0;\n  }\n  unaff_retaddr[0x16] = param_3;\n  if ((param_3 != -4) && (param_4 != (char *)0x0)) {\n    __s = (char *)unaff_retaddr[6];\n    sVar1 = strlen(__s);\n    sVar2 = strlen(param_4);\n    pvVar3 = malloc(sVar1 + 3 + sVar2);\n    unaff_retaddr[0x17] = pvVar3;\n    if (pvVar3 == (void *)0x0) {\n      unaff_retaddr[0x16] = 0xfffffffc;\n      return;\n    }\n    sVar1 = strlen(__s);\n    sVar2 = strlen(param_4);\n    __snprintf_chk(pvVar3,sVar1 + 3 + sVar2,1,0xffffffff,unaff_EBX + 0x7454,__s,unaff_EBX + 0x7451,\n                   param_4);\n  }\n  return;\n}" { (declaration "char *__s;" primitive_type (pointer_declarator "*__s" * identifier) ;) (declaration "size_t sVar1;" primitive_type identifier ;) (declaration "size_t sVar2;" primitive_type identifier ;) (declaration "void *pvVar3;" primitive_type (pointer_declarator "*pvVar3" * identifier) ;) (declaration "int unaff_EBX;" primitive_type identifier ;) (declaration "undefined4 *unaff_retaddr;" type_identifier (pointer_declarator "*unaff_retaddr" * identifier) ;) (expression_statement "entry(param_2,0x216a9);" (call_expression "entry(param_2,0x216a9)" identifier (argument_list "(param_2,0x216a9)" ( identifier , number_literal ))) ;) (if_statement "if ((void *)unaff_retaddr[0x17] != (void *)0x0) {\n    if (unaff_retaddr[0x16] != -4) {\n      free((void *)unaff_retaddr[0x17]);\n    }\n    unaff_retaddr[0x17] = 0;\n  }" if (parenthesized_expression "((void *)unaff_retaddr[0x17] != (void *)0x0)" ( (binary_expression "(void *)unaff_retaddr[0x17] != (void *)0x0" (cast_expression "(void *)unaff_retaddr[0x17]" ( (type_descriptor "void *" primitive_type (abstract_pointer_declarator "*" *)) ) (subscript_expression "unaff_retaddr[0x17]" identifier [ number_literal ])) != (cast_expression "(void *)0x0" ( (type_descriptor "void *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n    if (unaff_retaddr[0x16] != -4) {\n      free((void *)unaff_retaddr[0x17]);\n    }\n    unaff_retaddr[0x17] = 0;\n  }" { (if_statement "if (unaff_retaddr[0x16] != -4) {\n      free((void *)unaff_retaddr[0x17]);\n    }" if (parenthesized_expression "(unaff_retaddr[0x16] != -4)" ( (binary_expression "unaff_retaddr[0x16] != -4" (subscript_expression "unaff_retaddr[0x16]" identifier [ number_literal ]) != number_literal) )) (compound_statement "{\n      free((void *)unaff_retaddr[0x17]);\n    }" { (expression_statement "free((void *)unaff_retaddr[0x17]);" (call_expression "free((void *)unaff_retaddr[0x17])" identifier (argument_list "((void *)unaff_retaddr[0x17])" ( (cast_expression "(void *)unaff_retaddr[0x17]" ( (type_descriptor "void *" primitive_type (abstract_pointer_declarator "*" *)) ) (subscript_expression "unaff_retaddr[0x17]" identifier [ number_literal ])) ))) ;) })) (expression_statement "unaff_retaddr[0x17] = 0;" (assignment_expression "unaff_retaddr[0x17] = 0" (subscript_expression "unaff_retaddr[0x17]" identifier [ number_literal ]) = number_literal) ;) })) (if_statement "if ((param_3 != 0) && (param_3 != -5)) {\n    *unaff_retaddr = 0;\n  }" if (parenthesized_expression "((param_3 != 0) && (param_3 != -5))" ( (binary_expression "(param_3 != 0) && (param_3 != -5)" (parenthesized_expression "(param_3 != 0)" ( (binary_expression "param_3 != 0" identifier != number_literal) )) && (parenthesized_expression "(param_3 != -5)" ( (binary_expression "param_3 != -5" identifier != number_literal) ))) )) (compound_statement "{\n    *unaff_retaddr = 0;\n  }" { (expression_statement "*unaff_retaddr = 0;" (assignment_expression "*unaff_retaddr = 0" (pointer_expression "*unaff_retaddr" * identifier) = number_literal) ;) })) (expression_statement "unaff_retaddr[0x16] = param_3;" (assignment_expression "unaff_retaddr[0x16] = param_3" (subscript_expression "unaff_retaddr[0x16]" identifier [ number_literal ]) = identifier) ;) (if_statement "if ((param_3 != -4) && (param_4 != (char *)0x0)) {\n    __s = (char *)unaff_retaddr[6];\n    sVar1 = strlen(__s);\n    sVar2 = strlen(param_4);\n    pvVar3 = malloc(sVar1 + 3 + sVar2);\n    unaff_retaddr[0x17] = pvVar3;\n    if (pvVar3 == (void *)0x0) {\n      unaff_retaddr[0x16] = 0xfffffffc;\n      return;\n    }\n    sVar1 = strlen(__s);\n    sVar2 = strlen(param_4);\n    __snprintf_chk(pvVar3,sVar1 + 3 + sVar2,1,0xffffffff,unaff_EBX + 0x7454,__s,unaff_EBX + 0x7451,\n                   param_4);\n  }" if (parenthesized_expression "((param_3 != -4) && (param_4 != (char *)0x0))" ( (binary_expression "(param_3 != -4) && (param_4 != (char *)0x0)" (parenthesized_expression "(param_3 != -4)" ( (binary_expression "param_3 != -4" identifier != number_literal) )) && (parenthesized_expression "(param_4 != (char *)0x0)" ( (binary_expression "param_4 != (char *)0x0" identifier != (cast_expression "(char *)0x0" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) ))) )) (compound_statement "{\n    __s = (char *)unaff_retaddr[6];\n    sVar1 = strlen(__s);\n    sVar2 = strlen(param_4);\n    pvVar3 = malloc(sVar1 + 3 + sVar2);\n    unaff_retaddr[0x17] = pvVar3;\n    if (pvVar3 == (void *)0x0) {\n      unaff_retaddr[0x16] = 0xfffffffc;\n      return;\n    }\n    sVar1 = strlen(__s);\n    sVar2 = strlen(param_4);\n    __snprintf_chk(pvVar3,sVar1 + 3 + sVar2,1,0xffffffff,unaff_EBX + 0x7454,__s,unaff_EBX + 0x7451,\n                   param_4);\n  }" { (expression_statement "__s = (char *)unaff_retaddr[6];" (assignment_expression "__s = (char *)unaff_retaddr[6]" identifier = (cast_expression "(char *)unaff_retaddr[6]" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (subscript_expression "unaff_retaddr[6]" identifier [ number_literal ]))) ;) (expression_statement "sVar1 = strlen(__s);" (assignment_expression "sVar1 = strlen(__s)" identifier = (call_expression "strlen(__s)" identifier (argument_list "(__s)" ( identifier )))) ;) (expression_statement "sVar2 = strlen(param_4);" (assignment_expression "sVar2 = strlen(param_4)" identifier = (call_expression "strlen(param_4)" identifier (argument_list "(param_4)" ( identifier )))) ;) (expression_statement "pvVar3 = malloc(sVar1 + 3 + sVar2);" (assignment_expression "pvVar3 = malloc(sVar1 + 3 + sVar2)" identifier = (call_expression "malloc(sVar1 + 3 + sVar2)" identifier (argument_list "(sVar1 + 3 + sVar2)" ( (binary_expression "sVar1 + 3 + sVar2" (binary_expression "sVar1 + 3" identifier + number_literal) + identifier) )))) ;) (expression_statement "unaff_retaddr[0x17] = pvVar3;" (assignment_expression "unaff_retaddr[0x17] = pvVar3" (subscript_expression "unaff_retaddr[0x17]" identifier [ number_literal ]) = identifier) ;) (if_statement "if (pvVar3 == (void *)0x0) {\n      unaff_retaddr[0x16] = 0xfffffffc;\n      return;\n    }" if (parenthesized_expression "(pvVar3 == (void *)0x0)" ( (binary_expression "pvVar3 == (void *)0x0" identifier == (cast_expression "(void *)0x0" ( (type_descriptor "void *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n      unaff_retaddr[0x16] = 0xfffffffc;\n      return;\n    }" { (expression_statement "unaff_retaddr[0x16] = 0xfffffffc;" (assignment_expression "unaff_retaddr[0x16] = 0xfffffffc" (subscript_expression "unaff_retaddr[0x16]" identifier [ number_literal ]) = number_literal) ;) (return_statement "return;" return ;) })) (expression_statement "sVar1 = strlen(__s);" (assignment_expression "sVar1 = strlen(__s)" identifier = (call_expression "strlen(__s)" identifier (argument_list "(__s)" ( identifier )))) ;) (expression_statement "sVar2 = strlen(param_4);" (assignment_expression "sVar2 = strlen(param_4)" identifier = (call_expression "strlen(param_4)" identifier (argument_list "(param_4)" ( identifier )))) ;) (expression_statement "__snprintf_chk(pvVar3,sVar1 + 3 + sVar2,1,0xffffffff,unaff_EBX + 0x7454,__s,unaff_EBX + 0x7451,\n                   param_4);" (call_expression "__snprintf_chk(pvVar3,sVar1 + 3 + sVar2,1,0xffffffff,unaff_EBX + 0x7454,__s,unaff_EBX + 0x7451,\n                   param_4)" identifier (argument_list "(pvVar3,sVar1 + 3 + sVar2,1,0xffffffff,unaff_EBX + 0x7454,__s,unaff_EBX + 0x7451,\n                   param_4)" ( identifier , (binary_expression "sVar1 + 3 + sVar2" (binary_expression "sVar1 + 3" identifier + number_literal) + identifier) , number_literal , number_literal , (binary_expression "unaff_EBX + 0x7454" identifier + number_literal) , identifier , (binary_expression "unaff_EBX + 0x7451" identifier + number_literal) , identifier ))) ;) })) (return_statement "return;" return ;) })))
(translation_unit "/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n/* WARNING: Unknown calling convention */\n\nvoid gz_error(gz_statep state,int err,char *msg)\n\n{\n  char *__s;\n  size_t sVar1;\n  size_t sVar2;\n  char *pcVar3;\n  \n  if (state->msg != (char *)0x0) {\n    if (state->err != -4) {\n      free(state->msg);\n    }\n    state->msg = (char *)0x0;\n  }\n  if ((err != 0) && (err != -5)) {\n    (state->x).have = 0;\n  }\n  state->err = err;\n  if ((err != -4) && (msg != (char *)0x0)) {\n    __s = state->path;\n    sVar1 = strlen(__s);\n    sVar2 = strlen(msg);\n    pcVar3 = (char *)malloc(sVar1 + 3 + sVar2);\n    state->msg = pcVar3;\n    if (pcVar3 == (char *)0x0) {\n      state->err = -4;\n      return;\n    }\n    sVar1 = strlen(__s);\n    sVar2 = strlen(msg);\n    __snprintf_chk(pcVar3,sVar1 + 3 + sVar2,1,0xffffffff,&DAT_00028afd,__s,&DAT_00028afa,msg);\n  }\n  return;\n}\n\n" comment comment (function_definition "void gz_error(gz_statep state,int err,char *msg)\n\n{\n  char *__s;\n  size_t sVar1;\n  size_t sVar2;\n  char *pcVar3;\n  \n  if (state->msg != (char *)0x0) {\n    if (state->err != -4) {\n      free(state->msg);\n    }\n    state->msg = (char *)0x0;\n  }\n  if ((err != 0) && (err != -5)) {\n    (state->x).have = 0;\n  }\n  state->err = err;\n  if ((err != -4) && (msg != (char *)0x0)) {\n    __s = state->path;\n    sVar1 = strlen(__s);\n    sVar2 = strlen(msg);\n    pcVar3 = (char *)malloc(sVar1 + 3 + sVar2);\n    state->msg = pcVar3;\n    if (pcVar3 == (char *)0x0) {\n      state->err = -4;\n      return;\n    }\n    sVar1 = strlen(__s);\n    sVar2 = strlen(msg);\n    __snprintf_chk(pcVar3,sVar1 + 3 + sVar2,1,0xffffffff,&DAT_00028afd,__s,&DAT_00028afa,msg);\n  }\n  return;\n}" primitive_type (function_declarator "gz_error(gz_statep state,int err,char *msg)" identifier (parameter_list "(gz_statep state,int err,char *msg)" ( (parameter_declaration "gz_statep state" type_identifier identifier) , (parameter_declaration "int err" primitive_type identifier) , (parameter_declaration "char *msg" primitive_type (pointer_declarator "*msg" * identifier)) ))) (compound_statement "{\n  char *__s;\n  size_t sVar1;\n  size_t sVar2;\n  char *pcVar3;\n  \n  if (state->msg != (char *)0x0) {\n    if (state->err != -4) {\n      free(state->msg);\n    }\n    state->msg = (char *)0x0;\n  }\n  if ((err != 0) && (err != -5)) {\n    (state->x).have = 0;\n  }\n  state->err = err;\n  if ((err != -4) && (msg != (char *)0x0)) {\n    __s = state->path;\n    sVar1 = strlen(__s);\n    sVar2 = strlen(msg);\n    pcVar3 = (char *)malloc(sVar1 + 3 + sVar2);\n    state->msg = pcVar3;\n    if (pcVar3 == (char *)0x0) {\n      state->err = -4;\n      return;\n    }\n    sVar1 = strlen(__s);\n    sVar2 = strlen(msg);\n    __snprintf_chk(pcVar3,sVar1 + 3 + sVar2,1,0xffffffff,&DAT_00028afd,__s,&DAT_00028afa,msg);\n  }\n  return;\n}" { (declaration "char *__s;" primitive_type (pointer_declarator "*__s" * identifier) ;) (declaration "size_t sVar1;" primitive_type identifier ;) (declaration "size_t sVar2;" primitive_type identifier ;) (declaration "char *pcVar3;" primitive_type (pointer_declarator "*pcVar3" * identifier) ;) (if_statement "if (state->msg != (char *)0x0) {\n    if (state->err != -4) {\n      free(state->msg);\n    }\n    state->msg = (char *)0x0;\n  }" if (parenthesized_expression "(state->msg != (char *)0x0)" ( (binary_expression "state->msg != (char *)0x0" (field_expression "state->msg" identifier -> field_identifier) != (cast_expression "(char *)0x0" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n    if (state->err != -4) {\n      free(state->msg);\n    }\n    state->msg = (char *)0x0;\n  }" { (if_statement "if (state->err != -4) {\n      free(state->msg);\n    }" if (parenthesized_expression "(state->err != -4)" ( (binary_expression "state->err != -4" (field_expression "state->err" identifier -> field_identifier) != number_literal) )) (compound_statement "{\n      free(state->msg);\n    }" { (expression_statement "free(state->msg);" (call_expression "free(state->msg)" identifier (argument_list "(state->msg)" ( (field_expression "state->msg" identifier -> field_identifier) ))) ;) })) (expression_statement "state->msg = (char *)0x0;" (assignment_expression "state->msg = (char *)0x0" (field_expression "state->msg" identifier -> field_identifier) = (cast_expression "(char *)0x0" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) ;) })) (if_statement "if ((err != 0) && (err != -5)) {\n    (state->x).have = 0;\n  }" if (parenthesized_expression "((err != 0) && (err != -5))" ( (binary_expression "(err != 0) && (err != -5)" (parenthesized_expression "(err != 0)" ( (binary_expression "err != 0" identifier != number_literal) )) && (parenthesized_expression "(err != -5)" ( (binary_expression "err != -5" identifier != number_literal) ))) )) (compound_statement "{\n    (state->x).have = 0;\n  }" { (expression_statement "(state->x).have = 0;" (assignment_expression "(state->x).have = 0" (field_expression "(state->x).have" (parenthesized_expression "(state->x)" ( (field_expression "state->x" identifier -> field_identifier) )) . field_identifier) = number_literal) ;) })) (expression_statement "state->err = err;" (assignment_expression "state->err = err" (field_expression "state->err" identifier -> field_identifier) = identifier) ;) (if_statement "if ((err != -4) && (msg != (char *)0x0)) {\n    __s = state->path;\n    sVar1 = strlen(__s);\n    sVar2 = strlen(msg);\n    pcVar3 = (char *)malloc(sVar1 + 3 + sVar2);\n    state->msg = pcVar3;\n    if (pcVar3 == (char *)0x0) {\n      state->err = -4;\n      return;\n    }\n    sVar1 = strlen(__s);\n    sVar2 = strlen(msg);\n    __snprintf_chk(pcVar3,sVar1 + 3 + sVar2,1,0xffffffff,&DAT_00028afd,__s,&DAT_00028afa,msg);\n  }" if (parenthesized_expression "((err != -4) && (msg != (char *)0x0))" ( (binary_expression "(err != -4) && (msg != (char *)0x0)" (parenthesized_expression "(err != -4)" ( (binary_expression "err != -4" identifier != number_literal) )) && (parenthesized_expression "(msg != (char *)0x0)" ( (binary_expression "msg != (char *)0x0" identifier != (cast_expression "(char *)0x0" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) ))) )) (compound_statement "{\n    __s = state->path;\n    sVar1 = strlen(__s);\n    sVar2 = strlen(msg);\n    pcVar3 = (char *)malloc(sVar1 + 3 + sVar2);\n    state->msg = pcVar3;\n    if (pcVar3 == (char *)0x0) {\n      state->err = -4;\n      return;\n    }\n    sVar1 = strlen(__s);\n    sVar2 = strlen(msg);\n    __snprintf_chk(pcVar3,sVar1 + 3 + sVar2,1,0xffffffff,&DAT_00028afd,__s,&DAT_00028afa,msg);\n  }" { (expression_statement "__s = state->path;" (assignment_expression "__s = state->path" identifier = (field_expression "state->path" identifier -> field_identifier)) ;) (expression_statement "sVar1 = strlen(__s);" (assignment_expression "sVar1 = strlen(__s)" identifier = (call_expression "strlen(__s)" identifier (argument_list "(__s)" ( identifier )))) ;) (expression_statement "sVar2 = strlen(msg);" (assignment_expression "sVar2 = strlen(msg)" identifier = (call_expression "strlen(msg)" identifier (argument_list "(msg)" ( identifier )))) ;) (expression_statement "pcVar3 = (char *)malloc(sVar1 + 3 + sVar2);" (assignment_expression "pcVar3 = (char *)malloc(sVar1 + 3 + sVar2)" identifier = (cast_expression "(char *)malloc(sVar1 + 3 + sVar2)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "malloc(sVar1 + 3 + sVar2)" identifier (argument_list "(sVar1 + 3 + sVar2)" ( (binary_expression "sVar1 + 3 + sVar2" (binary_expression "sVar1 + 3" identifier + number_literal) + identifier) ))))) ;) (expression_statement "state->msg = pcVar3;" (assignment_expression "state->msg = pcVar3" (field_expression "state->msg" identifier -> field_identifier) = identifier) ;) (if_statement "if (pcVar3 == (char *)0x0) {\n      state->err = -4;\n      return;\n    }" if (parenthesized_expression "(pcVar3 == (char *)0x0)" ( (binary_expression "pcVar3 == (char *)0x0" identifier == (cast_expression "(char *)0x0" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n      state->err = -4;\n      return;\n    }" { (expression_statement "state->err = -4;" (assignment_expression "state->err = -4" (field_expression "state->err" identifier -> field_identifier) = number_literal) ;) (return_statement "return;" return ;) })) (expression_statement "sVar1 = strlen(__s);" (assignment_expression "sVar1 = strlen(__s)" identifier = (call_expression "strlen(__s)" identifier (argument_list "(__s)" ( identifier )))) ;) (expression_statement "sVar2 = strlen(msg);" (assignment_expression "sVar2 = strlen(msg)" identifier = (call_expression "strlen(msg)" identifier (argument_list "(msg)" ( identifier )))) ;) (expression_statement "__snprintf_chk(pcVar3,sVar1 + 3 + sVar2,1,0xffffffff,&DAT_00028afd,__s,&DAT_00028afa,msg);" (call_expression "__snprintf_chk(pcVar3,sVar1 + 3 + sVar2,1,0xffffffff,&DAT_00028afd,__s,&DAT_00028afa,msg)" identifier (argument_list "(pcVar3,sVar1 + 3 + sVar2,1,0xffffffff,&DAT_00028afd,__s,&DAT_00028afa,msg)" ( identifier , (binary_expression "sVar1 + 3 + sVar2" (binary_expression "sVar1 + 3" identifier + number_literal) + identifier) , number_literal , number_literal , (pointer_expression "&DAT_00028afd" & identifier) , identifier , (pointer_expression "&DAT_00028afa" & identifier) , identifier ))) ;) })) (return_statement "return;" return ;) })))
(translation_unit "void __regparm2 FUN_000216a0(undefined4 param_1,undefined4 param_2,int param_3,char *param_4)\n\n{\n  char *__s;\n  size_t sVar1;\n  size_t sVar2;\n  void *pvVar3;\n  int unaff_EBX;\n  undefined4 *unaff_retaddr;\n  \n  entry(param_2,0x216a9);\n  if ((void *)unaff_retaddr[0x17] != (void *)0x0) {\n    if (unaff_retaddr[0x16] != -4) {\n      free((void *)unaff_retaddr[0x17]);\n    }\n    unaff_retaddr[0x17] = 0;\n  }\n  if ((param_3 != 0) && (param_3 != -5)) {\n    *unaff_retaddr = 0;\n  }\n  unaff_retaddr[0x16] = param_3;\n  if ((param_3 != -4) && (param_4 != (char *)0x0)) {\n    __s = (char *)unaff_retaddr[6];\n    sVar1 = strlen(__s);\n    sVar2 = strlen(param_4);\n    pvVar3 = malloc(sVar1 + 3 + sVar2);\n    unaff_retaddr[0x17] = pvVar3;\n    if (pvVar3 == (void *)0x0) {\n      unaff_retaddr[0x16] = 0xfffffffc;\n      return;\n    }\n    sVar1 = strlen(__s);\n    sVar2 = strlen(param_4);\n    __snprintf_chk(pvVar3,sVar1 + 3 + sVar2,1,0xffffffff,unaff_EBX + 0x7454,__s,unaff_EBX + 0x7451,\n                   param_4);\n  }\n  return;\n}\n\n" (function_definition "void __regparm2 FUN_000216a0(undefined4 param_1,undefined4 param_2,int param_3,char *param_4)\n\n{\n  char *__s;\n  size_t sVar1;\n  size_t sVar2;\n  void *pvVar3;\n  int unaff_EBX;\n  undefined4 *unaff_retaddr;\n  \n  entry(param_2,0x216a9);\n  if ((void *)unaff_retaddr[0x17] != (void *)0x0) {\n    if (unaff_retaddr[0x16] != -4) {\n      free((void *)unaff_retaddr[0x17]);\n    }\n    unaff_retaddr[0x17] = 0;\n  }\n  if ((param_3 != 0) && (param_3 != -5)) {\n    *unaff_retaddr = 0;\n  }\n  unaff_retaddr[0x16] = param_3;\n  if ((param_3 != -4) && (param_4 != (char *)0x0)) {\n    __s = (char *)unaff_retaddr[6];\n    sVar1 = strlen(__s);\n    sVar2 = strlen(param_4);\n    pvVar3 = malloc(sVar1 + 3 + sVar2);\n    unaff_retaddr[0x17] = pvVar3;\n    if (pvVar3 == (void *)0x0) {\n      unaff_retaddr[0x16] = 0xfffffffc;\n      return;\n    }\n    sVar1 = strlen(__s);\n    sVar2 = strlen(param_4);\n    __snprintf_chk(pvVar3,sVar1 + 3 + sVar2,1,0xffffffff,unaff_EBX + 0x7454,__s,unaff_EBX + 0x7451,\n                   param_4);\n  }\n  return;\n}" primitive_type (ERROR "__regparm2" identifier) (function_declarator "FUN_000216a0(undefined4 param_1,undefined4 param_2,int param_3,char *param_4)" identifier (parameter_list "(undefined4 param_1,undefined4 param_2,int param_3,char *param_4)" ( (parameter_declaration "undefined4 param_1" type_identifier identifier) , (parameter_declaration "undefined4 param_2" type_identifier identifier) , (parameter_declaration "int param_3" primitive_type identifier) , (parameter_declaration "char *param_4" primitive_type (pointer_declarator "*param_4" * identifier)) ))) (compound_statement "{\n  char *__s;\n  size_t sVar1;\n  size_t sVar2;\n  void *pvVar3;\n  int unaff_EBX;\n  undefined4 *unaff_retaddr;\n  \n  entry(param_2,0x216a9);\n  if ((void *)unaff_retaddr[0x17] != (void *)0x0) {\n    if (unaff_retaddr[0x16] != -4) {\n      free((void *)unaff_retaddr[0x17]);\n    }\n    unaff_retaddr[0x17] = 0;\n  }\n  if ((param_3 != 0) && (param_3 != -5)) {\n    *unaff_retaddr = 0;\n  }\n  unaff_retaddr[0x16] = param_3;\n  if ((param_3 != -4) && (param_4 != (char *)0x0)) {\n    __s = (char *)unaff_retaddr[6];\n    sVar1 = strlen(__s);\n    sVar2 = strlen(param_4);\n    pvVar3 = malloc(sVar1 + 3 + sVar2);\n    unaff_retaddr[0x17] = pvVar3;\n    if (pvVar3 == (void *)0x0) {\n      unaff_retaddr[0x16] = 0xfffffffc;\n      return;\n    }\n    sVar1 = strlen(__s);\n    sVar2 = strlen(param_4);\n    __snprintf_chk(pvVar3,sVar1 + 3 + sVar2,1,0xffffffff,unaff_EBX + 0x7454,__s,unaff_EBX + 0x7451,\n                   param_4);\n  }\n  return;\n}" { (declaration "char *__s;" primitive_type (pointer_declarator "*__s" * identifier) ;) (declaration "size_t sVar1;" primitive_type identifier ;) (declaration "size_t sVar2;" primitive_type identifier ;) (declaration "void *pvVar3;" primitive_type (pointer_declarator "*pvVar3" * identifier) ;) (declaration "int unaff_EBX;" primitive_type identifier ;) (declaration "undefined4 *unaff_retaddr;" type_identifier (pointer_declarator "*unaff_retaddr" * identifier) ;) (expression_statement "entry(param_2,0x216a9);" (call_expression "entry(param_2,0x216a9)" identifier (argument_list "(param_2,0x216a9)" ( identifier , number_literal ))) ;) (if_statement "if ((void *)unaff_retaddr[0x17] != (void *)0x0) {\n    if (unaff_retaddr[0x16] != -4) {\n      free((void *)unaff_retaddr[0x17]);\n    }\n    unaff_retaddr[0x17] = 0;\n  }" if (parenthesized_expression "((void *)unaff_retaddr[0x17] != (void *)0x0)" ( (binary_expression "(void *)unaff_retaddr[0x17] != (void *)0x0" (cast_expression "(void *)unaff_retaddr[0x17]" ( (type_descriptor "void *" primitive_type (abstract_pointer_declarator "*" *)) ) (subscript_expression "unaff_retaddr[0x17]" identifier [ number_literal ])) != (cast_expression "(void *)0x0" ( (type_descriptor "void *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n    if (unaff_retaddr[0x16] != -4) {\n      free((void *)unaff_retaddr[0x17]);\n    }\n    unaff_retaddr[0x17] = 0;\n  }" { (if_statement "if (unaff_retaddr[0x16] != -4) {\n      free((void *)unaff_retaddr[0x17]);\n    }" if (parenthesized_expression "(unaff_retaddr[0x16] != -4)" ( (binary_expression "unaff_retaddr[0x16] != -4" (subscript_expression "unaff_retaddr[0x16]" identifier [ number_literal ]) != number_literal) )) (compound_statement "{\n      free((void *)unaff_retaddr[0x17]);\n    }" { (expression_statement "free((void *)unaff_retaddr[0x17]);" (call_expression "free((void *)unaff_retaddr[0x17])" identifier (argument_list "((void *)unaff_retaddr[0x17])" ( (cast_expression "(void *)unaff_retaddr[0x17]" ( (type_descriptor "void *" primitive_type (abstract_pointer_declarator "*" *)) ) (subscript_expression "unaff_retaddr[0x17]" identifier [ number_literal ])) ))) ;) })) (expression_statement "unaff_retaddr[0x17] = 0;" (assignment_expression "unaff_retaddr[0x17] = 0" (subscript_expression "unaff_retaddr[0x17]" identifier [ number_literal ]) = number_literal) ;) })) (if_statement "if ((param_3 != 0) && (param_3 != -5)) {\n    *unaff_retaddr = 0;\n  }" if (parenthesized_expression "((param_3 != 0) && (param_3 != -5))" ( (binary_expression "(param_3 != 0) && (param_3 != -5)" (parenthesized_expression "(param_3 != 0)" ( (binary_expression "param_3 != 0" identifier != number_literal) )) && (parenthesized_expression "(param_3 != -5)" ( (binary_expression "param_3 != -5" identifier != number_literal) ))) )) (compound_statement "{\n    *unaff_retaddr = 0;\n  }" { (expression_statement "*unaff_retaddr = 0;" (assignment_expression "*unaff_retaddr = 0" (pointer_expression "*unaff_retaddr" * identifier) = number_literal) ;) })) (expression_statement "unaff_retaddr[0x16] = param_3;" (assignment_expression "unaff_retaddr[0x16] = param_3" (subscript_expression "unaff_retaddr[0x16]" identifier [ number_literal ]) = identifier) ;) (if_statement "if ((param_3 != -4) && (param_4 != (char *)0x0)) {\n    __s = (char *)unaff_retaddr[6];\n    sVar1 = strlen(__s);\n    sVar2 = strlen(param_4);\n    pvVar3 = malloc(sVar1 + 3 + sVar2);\n    unaff_retaddr[0x17] = pvVar3;\n    if (pvVar3 == (void *)0x0) {\n      unaff_retaddr[0x16] = 0xfffffffc;\n      return;\n    }\n    sVar1 = strlen(__s);\n    sVar2 = strlen(param_4);\n    __snprintf_chk(pvVar3,sVar1 + 3 + sVar2,1,0xffffffff,unaff_EBX + 0x7454,__s,unaff_EBX + 0x7451,\n                   param_4);\n  }" if (parenthesized_expression "((param_3 != -4) && (param_4 != (char *)0x0))" ( (binary_expression "(param_3 != -4) && (param_4 != (char *)0x0)" (parenthesized_expression "(param_3 != -4)" ( (binary_expression "param_3 != -4" identifier != number_literal) )) && (parenthesized_expression "(param_4 != (char *)0x0)" ( (binary_expression "param_4 != (char *)0x0" identifier != (cast_expression "(char *)0x0" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) ))) )) (compound_statement "{\n    __s = (char *)unaff_retaddr[6];\n    sVar1 = strlen(__s);\n    sVar2 = strlen(param_4);\n    pvVar3 = malloc(sVar1 + 3 + sVar2);\n    unaff_retaddr[0x17] = pvVar3;\n    if (pvVar3 == (void *)0x0) {\n      unaff_retaddr[0x16] = 0xfffffffc;\n      return;\n    }\n    sVar1 = strlen(__s);\n    sVar2 = strlen(param_4);\n    __snprintf_chk(pvVar3,sVar1 + 3 + sVar2,1,0xffffffff,unaff_EBX + 0x7454,__s,unaff_EBX + 0x7451,\n                   param_4);\n  }" { (expression_statement "__s = (char *)unaff_retaddr[6];" (assignment_expression "__s = (char *)unaff_retaddr[6]" identifier = (cast_expression "(char *)unaff_retaddr[6]" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (subscript_expression "unaff_retaddr[6]" identifier [ number_literal ]))) ;) (expression_statement "sVar1 = strlen(__s);" (assignment_expression "sVar1 = strlen(__s)" identifier = (call_expression "strlen(__s)" identifier (argument_list "(__s)" ( identifier )))) ;) (expression_statement "sVar2 = strlen(param_4);" (assignment_expression "sVar2 = strlen(param_4)" identifier = (call_expression "strlen(param_4)" identifier (argument_list "(param_4)" ( identifier )))) ;) (expression_statement "pvVar3 = malloc(sVar1 + 3 + sVar2);" (assignment_expression "pvVar3 = malloc(sVar1 + 3 + sVar2)" identifier = (call_expression "malloc(sVar1 + 3 + sVar2)" identifier (argument_list "(sVar1 + 3 + sVar2)" ( (binary_expression "sVar1 + 3 + sVar2" (binary_expression "sVar1 + 3" identifier + number_literal) + identifier) )))) ;) (expression_statement "unaff_retaddr[0x17] = pvVar3;" (assignment_expression "unaff_retaddr[0x17] = pvVar3" (subscript_expression "unaff_retaddr[0x17]" identifier [ number_literal ]) = identifier) ;) (if_statement "if (pvVar3 == (void *)0x0) {\n      unaff_retaddr[0x16] = 0xfffffffc;\n      return;\n    }" if (parenthesized_expression "(pvVar3 == (void *)0x0)" ( (binary_expression "pvVar3 == (void *)0x0" identifier == (cast_expression "(void *)0x0" ( (type_descriptor "void *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n      unaff_retaddr[0x16] = 0xfffffffc;\n      return;\n    }" { (expression_statement "unaff_retaddr[0x16] = 0xfffffffc;" (assignment_expression "unaff_retaddr[0x16] = 0xfffffffc" (subscript_expression "unaff_retaddr[0x16]" identifier [ number_literal ]) = number_literal) ;) (return_statement "return;" return ;) })) (expression_statement "sVar1 = strlen(__s);" (assignment_expression "sVar1 = strlen(__s)" identifier = (call_expression "strlen(__s)" identifier (argument_list "(__s)" ( identifier )))) ;) (expression_statement "sVar2 = strlen(param_4);" (assignment_expression "sVar2 = strlen(param_4)" identifier = (call_expression "strlen(param_4)" identifier (argument_list "(param_4)" ( identifier )))) ;) (expression_statement "__snprintf_chk(pvVar3,sVar1 + 3 + sVar2,1,0xffffffff,unaff_EBX + 0x7454,__s,unaff_EBX + 0x7451,\n                   param_4);" (call_expression "__snprintf_chk(pvVar3,sVar1 + 3 + sVar2,1,0xffffffff,unaff_EBX + 0x7454,__s,unaff_EBX + 0x7451,\n                   param_4)" identifier (argument_list "(pvVar3,sVar1 + 3 + sVar2,1,0xffffffff,unaff_EBX + 0x7454,__s,unaff_EBX + 0x7451,\n                   param_4)" ( identifier , (binary_expression "sVar1 + 3 + sVar2" (binary_expression "sVar1 + 3" identifier + number_literal) + identifier) , number_literal , number_literal , (binary_expression "unaff_EBX + 0x7454" identifier + number_literal) , identifier , (binary_expression "unaff_EBX + 0x7451" identifier + number_literal) , identifier ))) ;) })) (return_statement "return;" return ;) })))
(translation_unit (function_definition TYPE (ERROR IDENT) (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE (pointer_declarator * IDENT)) ))) (compound_statement { (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE IDENT ;) (declaration TYPE (pointer_declarator * IDENT) ;) (expression_statement (call_expression IDENT (argument_list ( IDENT , LIT ))) ;) (if_statement if (parenthesized_expression ( (binary_expression (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (subscript_expression IDENT [ LIT ])) != (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) LIT)) )) (compound_statement { (if_statement if (parenthesized_expression ( (binary_expression (subscript_expression IDENT [ LIT ]) != LIT) )) (compound_statement { (expression_statement (call_expression IDENT (argument_list ( (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (subscript_expression IDENT [ LIT ])) ))) ;) })) (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = LIT) ;) })) (if_statement if (parenthesized_expression ( (binary_expression (parenthesized_expression ( (binary_expression IDENT != LIT) )) && (parenthesized_expression ( (binary_expression IDENT != LIT) ))) )) (compound_statement { (expression_statement (assignment_expression (pointer_expression * IDENT) = LIT) ;) })) (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = IDENT) ;) (if_statement if (parenthesized_expression ( (binary_expression (parenthesized_expression ( (binary_expression IDENT != LIT) )) && (parenthesized_expression ( (binary_expression IDENT != (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) LIT)) ))) )) (compound_statement { (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (subscript_expression IDENT [ LIT ]))) ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT )))) ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT )))) ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( (binary_expression (binary_expression IDENT + LIT) + IDENT) )))) ;) (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = IDENT) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) LIT)) )) (compound_statement { (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = LIT) ;) (return_statement return ;) })) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT )))) ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT )))) ;) (expression_statement (call_expression IDENT (argument_list ( IDENT , (binary_expression (binary_expression IDENT + LIT) + IDENT) , LIT , LIT , (binary_expression IDENT + LIT) , IDENT , (binary_expression IDENT + LIT) , IDENT ))) ;) })) (return_statement return ;) })))
(function_definition "void __regparm2 FUN_000216a0(undefined4 param_1,undefined4 param_2,int param_3,char *param_4)\n\n{\n  char *__s;\n  size_t sVar1;\n  size_t sVar2;\n  void *pvVar3;\n  int unaff_EBX;\n  undefined4 *unaff_retaddr;\n  \n  entry(param_2,0x216a9);\n  if ((void *)unaff_retaddr[0x17] != (void *)0x0) {\n    if (unaff_retaddr[0x16] != -4) {\n      free((void *)unaff_retaddr[0x17]);\n    }\n    unaff_retaddr[0x17] = 0;\n  }\n  if ((param_3 != 0) && (param_3 != -5)) {\n    *unaff_retaddr = 0;\n  }\n  unaff_retaddr[0x16] = param_3;\n  if ((param_3 != -4) && (param_4 != (char *)0x0)) {\n    __s = (char *)unaff_retaddr[6];\n    sVar1 = strlen(__s);\n    sVar2 = strlen(param_4);\n    pvVar3 = malloc(sVar1 + 3 + sVar2);\n    unaff_retaddr[0x17] = pvVar3;\n    if (pvVar3 == (void *)0x0) {\n      unaff_retaddr[0x16] = 0xfffffffc;\n      return;\n    }\n    sVar1 = strlen(__s);\n    sVar2 = strlen(param_4);\n    __snprintf_chk(pvVar3,sVar1 + 3 + sVar2,1,0xffffffff,unaff_EBX + 0x7454,__s,unaff_EBX + 0x7451,\n                   param_4);\n  }\n  return;\n}" (primitive_type "void") (ERROR "__regparm2" (identifier "__regparm2")) (function_declarator "FUN_000216a0(undefined4 param_1,undefined4 param_2,int param_3,char *param_4)" (identifier "FUN_000216a0") (parameter_list "(undefined4 param_1,undefined4 param_2,int param_3,char *param_4)" (( "(") (parameter_declaration "undefined4 param_1" (type_identifier "undefined4") (identifier "param_1")) (, ",") (parameter_declaration "undefined4 param_2" (type_identifier "undefined4") (identifier "param_2")) (, ",") (parameter_declaration "int param_3" (primitive_type "int") (identifier "param_3")) (, ",") (parameter_declaration "char *param_4" (primitive_type "char") (pointer_declarator "*param_4" (* "*") (identifier "param_4"))) () ")"))) (compound_statement "{\n  char *__s;\n  size_t sVar1;\n  size_t sVar2;\n  void *pvVar3;\n  int unaff_EBX;\n  undefined4 *unaff_retaddr;\n  \n  entry(param_2,0x216a9);\n  if ((void *)unaff_retaddr[0x17] != (void *)0x0) {\n    if (unaff_retaddr[0x16] != -4) {\n      free((void *)unaff_retaddr[0x17]);\n    }\n    unaff_retaddr[0x17] = 0;\n  }\n  if ((param_3 != 0) && (param_3 != -5)) {\n    *unaff_retaddr = 0;\n  }\n  unaff_retaddr[0x16] = param_3;\n  if ((param_3 != -4) && (param_4 != (char *)0x0)) {\n    __s = (char *)unaff_retaddr[6];\n    sVar1 = strlen(__s);\n    sVar2 = strlen(param_4);\n    pvVar3 = malloc(sVar1 + 3 + sVar2);\n    unaff_retaddr[0x17] = pvVar3;\n    if (pvVar3 == (void *)0x0) {\n      unaff_retaddr[0x16] = 0xfffffffc;\n      return;\n    }\n    sVar1 = strlen(__s);\n    sVar2 = strlen(param_4);\n    __snprintf_chk(pvVar3,sVar1 + 3 + sVar2,1,0xffffffff,unaff_EBX + 0x7454,__s,unaff_EBX + 0x7451,\n                   param_4);\n  }\n  return;\n}" ({ "{") (declaration "char *__s;" (primitive_type "char") (pointer_declarator "*__s" (* "*") (identifier "__s")) (; ";")) (declaration "size_t sVar1;" (primitive_type "size_t") (identifier "sVar1") (; ";")) (declaration "size_t sVar2;" (primitive_type "size_t") (identifier "sVar2") (; ";")) (declaration "void *pvVar3;" (primitive_type "void") (pointer_declarator "*pvVar3" (* "*") (identifier "pvVar3")) (; ";")) (declaration "int unaff_EBX;" (primitive_type "int") (identifier "unaff_EBX") (; ";")) (declaration "undefined4 *unaff_retaddr;" (type_identifier "undefined4") (pointer_declarator "*unaff_retaddr" (* "*") (identifier "unaff_retaddr")) (; ";")) (expression_statement "entry(param_2,0x216a9);" (call_expression "entry(param_2,0x216a9)" (identifier "entry") (argument_list "(param_2,0x216a9)" (( "(") (identifier "param_2") (, ",") (number_literal "0x216a9") () ")"))) (; ";")) (if_statement "if ((void *)unaff_retaddr[0x17] != (void *)0x0) {\n    if (unaff_retaddr[0x16] != -4) {\n      free((void *)unaff_retaddr[0x17]);\n    }\n    unaff_retaddr[0x17] = 0;\n  }" (if "if") (parenthesized_expression "((void *)unaff_retaddr[0x17] != (void *)0x0)" (( "(") (binary_expression "(void *)unaff_retaddr[0x17] != (void *)0x0" (cast_expression "(void *)unaff_retaddr[0x17]" (( "(") (type_descriptor "void *" (primitive_type "void") (abstract_pointer_declarator "*" (* "*"))) () ")") (subscript_expression "unaff_retaddr[0x17]" (identifier "unaff_retaddr") ([ "[") (number_literal "0x17") (] "]"))) (!= "!=") (cast_expression "(void *)0x0" (( "(") (type_descriptor "void *" (primitive_type "void") (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0x0"))) () ")")) (compound_statement "{\n    if (unaff_retaddr[0x16] != -4) {\n      free((void *)unaff_retaddr[0x17]);\n    }\n    unaff_retaddr[0x17] = 0;\n  }" ({ "{") (if_statement "if (unaff_retaddr[0x16] != -4) {\n      free((void *)unaff_retaddr[0x17]);\n    }" (if "if") (parenthesized_expression "(unaff_retaddr[0x16] != -4)" (( "(") (binary_expression "unaff_retaddr[0x16] != -4" (subscript_expression "unaff_retaddr[0x16]" (identifier "unaff_retaddr") ([ "[") (number_literal "0x16") (] "]")) (!= "!=") (number_literal "-4")) () ")")) (compound_statement "{\n      free((void *)unaff_retaddr[0x17]);\n    }" ({ "{") (expression_statement "free((void *)unaff_retaddr[0x17]);" (call_expression "free((void *)unaff_retaddr[0x17])" (identifier "free") (argument_list "((void *)unaff_retaddr[0x17])" (( "(") (cast_expression "(void *)unaff_retaddr[0x17]" (( "(") (type_descriptor "void *" (primitive_type "void") (abstract_pointer_declarator "*" (* "*"))) () ")") (subscript_expression "unaff_retaddr[0x17]" (identifier "unaff_retaddr") ([ "[") (number_literal "0x17") (] "]"))) () ")"))) (; ";")) (} "}"))) (expression_statement "unaff_retaddr[0x17] = 0;" (assignment_expression "unaff_retaddr[0x17] = 0" (subscript_expression "unaff_retaddr[0x17]" (identifier "unaff_retaddr") ([ "[") (number_literal "0x17") (] "]")) (= "=") (number_literal "0")) (; ";")) (} "}"))) (if_statement "if ((param_3 != 0) && (param_3 != -5)) {\n    *unaff_retaddr = 0;\n  }" (if "if") (parenthesized_expression "((param_3 != 0) && (param_3 != -5))" (( "(") (binary_expression "(param_3 != 0) && (param_3 != -5)" (parenthesized_expression "(param_3 != 0)" (( "(") (binary_expression "param_3 != 0" (identifier "param_3") (!= "!=") (number_literal "0")) () ")")) (&& "&&") (parenthesized_expression "(param_3 != -5)" (( "(") (binary_expression "param_3 != -5" (identifier "param_3") (!= "!=") (number_literal "-5")) () ")"))) () ")")) (compound_statement "{\n    *unaff_retaddr = 0;\n  }" ({ "{") (expression_statement "*unaff_retaddr = 0;" (assignment_expression "*unaff_retaddr = 0" (pointer_expression "*unaff_retaddr" (* "*") (identifier "unaff_retaddr")) (= "=") (number_literal "0")) (; ";")) (} "}"))) (expression_statement "unaff_retaddr[0x16] = param_3;" (assignment_expression "unaff_retaddr[0x16] = param_3" (subscript_expression "unaff_retaddr[0x16]" (identifier "unaff_retaddr") ([ "[") (number_literal "0x16") (] "]")) (= "=") (identifier "param_3")) (; ";")) (if_statement "if ((param_3 != -4) && (param_4 != (char *)0x0)) {\n    __s = (char *)unaff_retaddr[6];\n    sVar1 = strlen(__s);\n    sVar2 = strlen(param_4);\n    pvVar3 = malloc(sVar1 + 3 + sVar2);\n    unaff_retaddr[0x17] = pvVar3;\n    if (pvVar3 == (void *)0x0) {\n      unaff_retaddr[0x16] = 0xfffffffc;\n      return;\n    }\n    sVar1 = strlen(__s);\n    sVar2 = strlen(param_4);\n    __snprintf_chk(pvVar3,sVar1 + 3 + sVar2,1,0xffffffff,unaff_EBX + 0x7454,__s,unaff_EBX + 0x7451,\n                   param_4);\n  }" (if "if") (parenthesized_expression "((param_3 != -4) && (param_4 != (char *)0x0))" (( "(") (binary_expression "(param_3 != -4) && (param_4 != (char *)0x0)" (parenthesized_expression "(param_3 != -4)" (( "(") (binary_expression "param_3 != -4" (identifier "param_3") (!= "!=") (number_literal "-4")) () ")")) (&& "&&") (parenthesized_expression "(param_4 != (char *)0x0)" (( "(") (binary_expression "param_4 != (char *)0x0" (identifier "param_4") (!= "!=") (cast_expression "(char *)0x0" (( "(") (type_descriptor "char *" (primitive_type "char") (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0x0"))) () ")"))) () ")")) (compound_statement "{\n    __s = (char *)unaff_retaddr[6];\n    sVar1 = strlen(__s);\n    sVar2 = strlen(param_4);\n    pvVar3 = malloc(sVar1 + 3 + sVar2);\n    unaff_retaddr[0x17] = pvVar3;\n    if (pvVar3 == (void *)0x0) {\n      unaff_retaddr[0x16] = 0xfffffffc;\n      return;\n    }\n    sVar1 = strlen(__s);\n    sVar2 = strlen(param_4);\n    __snprintf_chk(pvVar3,sVar1 + 3 + sVar2,1,0xffffffff,unaff_EBX + 0x7454,__s,unaff_EBX + 0x7451,\n                   param_4);\n  }" ({ "{") (expression_statement "__s = (char *)unaff_retaddr[6];" (assignment_expression "__s = (char *)unaff_retaddr[6]" (identifier "__s") (= "=") (cast_expression "(char *)unaff_retaddr[6]" (( "(") (type_descriptor "char *" (primitive_type "char") (abstract_pointer_declarator "*" (* "*"))) () ")") (subscript_expression "unaff_retaddr[6]" (identifier "unaff_retaddr") ([ "[") (number_literal "6") (] "]")))) (; ";")) (expression_statement "sVar1 = strlen(__s);" (assignment_expression "sVar1 = strlen(__s)" (identifier "sVar1") (= "=") (call_expression "strlen(__s)" (identifier "strlen") (argument_list "(__s)" (( "(") (identifier "__s") () ")")))) (; ";")) (expression_statement "sVar2 = strlen(param_4);" (assignment_expression "sVar2 = strlen(param_4)" (identifier "sVar2") (= "=") (call_expression "strlen(param_4)" (identifier "strlen") (argument_list "(param_4)" (( "(") (identifier "param_4") () ")")))) (; ";")) (expression_statement "pvVar3 = malloc(sVar1 + 3 + sVar2);" (assignment_expression "pvVar3 = malloc(sVar1 + 3 + sVar2)" (identifier "pvVar3") (= "=") (call_expression "malloc(sVar1 + 3 + sVar2)" (identifier "malloc") (argument_list "(sVar1 + 3 + sVar2)" (( "(") (binary_expression "sVar1 + 3 + sVar2" (binary_expression "sVar1 + 3" (identifier "sVar1") (+ "+") (number_literal "3")) (+ "+") (identifier "sVar2")) () ")")))) (; ";")) (expression_statement "unaff_retaddr[0x17] = pvVar3;" (assignment_expression "unaff_retaddr[0x17] = pvVar3" (subscript_expression "unaff_retaddr[0x17]" (identifier "unaff_retaddr") ([ "[") (number_literal "0x17") (] "]")) (= "=") (identifier "pvVar3")) (; ";")) (if_statement "if (pvVar3 == (void *)0x0) {\n      unaff_retaddr[0x16] = 0xfffffffc;\n      return;\n    }" (if "if") (parenthesized_expression "(pvVar3 == (void *)0x0)" (( "(") (binary_expression "pvVar3 == (void *)0x0" (identifier "pvVar3") (== "==") (cast_expression "(void *)0x0" (( "(") (type_descriptor "void *" (primitive_type "void") (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0x0"))) () ")")) (compound_statement "{\n      unaff_retaddr[0x16] = 0xfffffffc;\n      return;\n    }" ({ "{") (expression_statement "unaff_retaddr[0x16] = 0xfffffffc;" (assignment_expression "unaff_retaddr[0x16] = 0xfffffffc" (subscript_expression "unaff_retaddr[0x16]" (identifier "unaff_retaddr") ([ "[") (number_literal "0x16") (] "]")) (= "=") (number_literal "0xfffffffc")) (; ";")) (return_statement "return;" (return "return") (; ";")) (} "}"))) (expression_statement "sVar1 = strlen(__s);" (assignment_expression "sVar1 = strlen(__s)" (identifier "sVar1") (= "=") (call_expression "strlen(__s)" (identifier "strlen") (argument_list "(__s)" (( "(") (identifier "__s") () ")")))) (; ";")) (expression_statement "sVar2 = strlen(param_4);" (assignment_expression "sVar2 = strlen(param_4)" (identifier "sVar2") (= "=") (call_expression "strlen(param_4)" (identifier "strlen") (argument_list "(param_4)" (( "(") (identifier "param_4") () ")")))) (; ";")) (expression_statement "__snprintf_chk(pvVar3,sVar1 + 3 + sVar2,1,0xffffffff,unaff_EBX + 0x7454,__s,unaff_EBX + 0x7451,\n                   param_4);" (call_expression "__snprintf_chk(pvVar3,sVar1 + 3 + sVar2,1,0xffffffff,unaff_EBX + 0x7454,__s,unaff_EBX + 0x7451,\n                   param_4)" (identifier "__snprintf_chk") (argument_list "(pvVar3,sVar1 + 3 + sVar2,1,0xffffffff,unaff_EBX + 0x7454,__s,unaff_EBX + 0x7451,\n                   param_4)" (( "(") (identifier "pvVar3") (, ",") (binary_expression "sVar1 + 3 + sVar2" (binary_expression "sVar1 + 3" (identifier "sVar1") (+ "+") (number_literal "3")) (+ "+") (identifier "sVar2")) (, ",") (number_literal "1") (, ",") (number_literal "0xffffffff") (, ",") (binary_expression "unaff_EBX + 0x7454" (identifier "unaff_EBX") (+ "+") (number_literal "0x7454")) (, ",") (identifier "__s") (, ",") (binary_expression "unaff_EBX + 0x7451" (identifier "unaff_EBX") (+ "+") (number_literal "0x7451")) (, ",") (identifier "param_4") () ")"))) (; ";")) (} "}"))) (return_statement "return;" (return "return") (; ";")) (} "}")))

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

void function_1(type_1 state,int var_2,char *var_3)

{
  char *__s;
  size_t var_6;
  size_t var_7;
  char *var_8;
  
  if (state->var_3 != (char *)0x0) {
    if (state->var_2 != -4) {
      var_1(state->var_3);
    }
    state->var_3 = (char *)0x0;
  }
  if ((var_2 != 0) && (var_2 != -5)) {
    (state->x).have = 0;
  }
  state->var_2 = var_2;
  if ((var_2 != -4) && (var_3 != (char *)0x0)) {
    __s = state->path;
    var_6 = var_4(__s);
    var_7 = var_4(var_3);
    var_8 = (char *)var_5(var_6 + 3 + var_7);
    state->var_3 = var_8;
    if (var_8 == (char *)0x0) {
      state->var_2 = -4;
      return;
    }
    var_6 = var_4(__s);
    var_7 = var_4(var_3);
    var_9(var_8,var_6 + 3 + var_7,1,0xffffffff,&DAT_00028afd,__s,&DAT_00028afa,var_3);
  }
  return;
}


(translation_unit (function_definition type: (primitive_type) (ERROR (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: (identifier)) (parameter_declaration type: (primitive_type) declarator: (pointer_declarator declarator: (identifier))))) body: (compound_statement (declaration type: (primitive_type) declarator: (pointer_declarator declarator: (identifier))) (declaration type: (primitive_type) declarator: (identifier)) (declaration type: (primitive_type) declarator: (identifier)) (declaration type: (primitive_type) declarator: (pointer_declarator declarator: (identifier))) (declaration type: (primitive_type) declarator: (identifier)) (declaration type: (type_identifier) declarator: (pointer_declarator declarator: (identifier))) (expression_statement (call_expression function: (identifier) arguments: (argument_list (identifier) (number_literal)))) (if_statement condition: (parenthesized_expression (binary_expression left: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (subscript_expression argument: (identifier) index: (number_literal))) right: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (number_literal)))) consequence: (compound_statement (if_statement condition: (parenthesized_expression (binary_expression left: (subscript_expression argument: (identifier) index: (number_literal)) right: (number_literal))) consequence: (compound_statement (expression_statement (call_expression function: (identifier) arguments: (argument_list (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (subscript_expression argument: (identifier) index: (number_literal)))))))) (expression_statement (assignment_expression left: (subscript_expression argument: (identifier) index: (number_literal)) right: (number_literal))))) (if_statement condition: (parenthesized_expression (binary_expression left: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) right: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))))) consequence: (compound_statement (expression_statement (assignment_expression left: (pointer_expression argument: (identifier)) right: (number_literal))))) (expression_statement (assignment_expression left: (subscript_expression argument: (identifier) index: (number_literal)) right: (identifier))) (if_statement condition: (parenthesized_expression (binary_expression left: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) right: (parenthesized_expression (binary_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (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: (subscript_expression argument: (identifier) index: (number_literal))))) (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (identifier))))) (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (identifier))))) (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (binary_expression left: (binary_expression left: (identifier) right: (number_literal)) right: (identifier)))))) (expression_statement (assignment_expression left: (subscript_expression argument: (identifier) index: (number_literal)) right: (identifier))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (number_literal)))) consequence: (compound_statement (expression_statement (assignment_expression left: (subscript_expression argument: (identifier) index: (number_literal)) right: (number_literal))) (return_statement))) (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (identifier))))) (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (identifier))))) (expression_statement (call_expression function: (identifier) arguments: (argument_list (identifier) (binary_expression left: (binary_expression left: (identifier) right: (number_literal)) right: (identifier)) (number_literal) (number_literal) (binary_expression left: (identifier) right: (number_literal)) (identifier) (binary_expression left: (identifier) right: (number_literal)) (identifier)))))) (return_statement))))

void __regparm2 MASKED(undefined4 param_1,undefined4 param_2,int param_3,char *param_4)

{
  char *__s;
  size_t sVar1;
  size_t sVar2;
  void *pvVar3;
  int unaff_EBX;
  undefined4 *unaff_retaddr;
  
  entry(param_2,0x216a9);
  if ((void *)unaff_retaddr[0x17] != (void *)0x0) {
    if (unaff_retaddr[0x16] != -4) {
      free((void *)unaff_retaddr[0x17]);
    }
    unaff_retaddr[0x17] = 0;
  }
  if ((param_3 != 0) && (param_3 != -5)) {
    *unaff_retaddr = 0;
  }
  unaff_retaddr[0x16] = param_3;
  if ((param_3 != -4) && (param_4 != (char *)0x0)) {
    __s = (char *)unaff_retaddr[6];
    sVar1 = strlen(__s);
    sVar2 = strlen(param_4);
    pvVar3 = malloc(sVar1 + 3 + sVar2);
    unaff_retaddr[0x17] = pvVar3;
    if (pvVar3 == (void *)0x0) {
      unaff_retaddr[0x16] = 0xfffffffc;
      return;
    }
    sVar1 = strlen(__s);
    sVar2 = strlen(param_4);
    __snprintf_chk(pvVar3,sVar1 + 3 + sVar2,1,0xffffffff,unaff_EBX + 0x7454,__s,unaff_EBX + 0x7451,
                   param_4);
  }
  return;
}

