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

char * xvasprintf(char *format,va_list args)

{
  size_t argcount;
  int iVar1;
  int *piVar2;
  int in_GS_OFFSET;
  char *result;
  int local_10;
  undefined4 uStack_c;
  
  uStack_c = 0x1c937;
  local_10 = *(int *)(in_GS_OFFSET + 0x14);
  if (*format == '\0') {
    argcount = 0;
LAB_0001c987:
    result = xstrcat(argcount,args);
  }
  else {
    if ((*format == '%') && (format[1] == 's')) {
      argcount = 0;
      do {
        argcount = argcount + 1;
        if (format[argcount * 2] == '\0') goto LAB_0001c987;
      } while ((format[argcount * 2] == '%') && (format[argcount * 2 + 1] == 's'));
    }
    iVar1 = rpl_vasprintf(&result,format,args);
    if (iVar1 < 0) {
      piVar2 = __errno_location();
      if (*piVar2 == 0xc) {
                    /* WARNING: Subroutine does not return */
        xalloc_die();
      }
      result = (char *)0x0;
    }
  }
  if (local_10 == *(int *)(in_GS_OFFSET + 0x14)) {
    return result;
  }
                    /* WARNING: Subroutine does not return */
  __stack_chk_fail_local();
}



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

undefined4 FUN_0001c930(char *param_1,undefined4 param_2)

{
  int iVar1;
  int *piVar2;
  int in_GS_OFFSET;
  undefined4 local_14;
  int local_10;
  undefined4 uStack_c;
  
  uStack_c = 0x1c937;
  local_10 = *(int *)(in_GS_OFFSET + 0x14);
  if (*param_1 == '\0') {
LAB_0001c987:
    local_14 = FUN_0001c830();
  }
  else {
    if ((*param_1 == '%') && (param_1[1] == 's')) {
      iVar1 = 0;
      do {
        iVar1 = iVar1 + 1;
        if (param_1[iVar1 * 2] == '\0') goto LAB_0001c987;
      } while ((param_1[iVar1 * 2] == '%') && (param_1[iVar1 * 2 + 1] == 's'));
    }
    iVar1 = FUN_0001dd40(&local_14,param_1,param_2);
    if (iVar1 < 0) {
      piVar2 = __errno_location();
      if (*piVar2 == 0xc) {
                    /* WARNING: Subroutine does not return */
        FUN_0001baf0();
      }
      local_14 = 0;
    }
  }
  if (local_10 != *(int *)(in_GS_OFFSET + 0x14)) {
                    /* WARNING: Subroutine does not return */
    FUN_000214c0();
  }
  return local_14;
}


PUSH ESI
PUSH EBX
CALL 0x00014850
ADD EBX,0xd6c9
SUB ESP,0x14
MOV EAX,GS:[0x14]
MOV dword ptr [ESP + 0xc],EAX
XOR EAX,EAX
MOV ESI,dword ptr [ESP + 0x20]
MOV EDX,dword ptr [ESP + 0x24]
MOVZX EAX,byte ptr [ESI]
TEST AL,AL
JZ 0x0001c9ca
CMP AL,0x25
JNZ 0x0001c9a0
CMP byte ptr [ESI + 0x1],0x73
JNZ 0x0001c9a0
XOR EAX,EAX
JMP 0x0001c97c
CMP CL,0x25
JNZ 0x0001c9a0
CMP byte ptr [ESI + EAX*0x2 + 0x1],0x73
JNZ 0x0001c9a0
ADD EAX,0x1
MOVZX ECX,byte ptr [ESI + EAX*0x2]
TEST CL,CL
JNZ 0x0001c970
CALL 0x0001c830
MOV EBX,dword ptr [ESP + 0xc]
XOR EBX,dword ptr GS:[0x14]
JNZ 0x0001c9ce
ADD ESP,0x14
POP EBX
POP ESI
RET
SUB ESP,0x4
PUSH EDX
PUSH ESI
LEA EAX,[ESP + 0x14]
PUSH EAX
CALL 0x0001dd40
ADD ESP,0x10
MOV EDX,EAX
MOV EAX,dword ptr [ESP + 0x8]
TEST EDX,EDX
JNS 0x0001c98c
CALL 0x00012350
CMP dword ptr [EAX],0xc
JZ 0x0001c9d3
XOR EAX,EAX
JMP 0x0001c98c
XOR EAX,EAX
JMP 0x0001c987
CALL 0x000214c0
CALL 0x0001baf0
(translation_unit "/* WARNING: Function: __i686.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n\nundefined4 FUN_0001c930(char *param_1,undefined4 param_2)\n\n{\n  int iVar1;\n  int *piVar2;\n  int in_GS_OFFSET;\n  undefined4 local_14;\n  int local_10;\n  undefined4 uStack_c;\n  \n  uStack_c = 0x1c937;\n  local_10 = *(int *)(in_GS_OFFSET + 0x14);\n  if (*param_1 == '\0') {\nLAB_0001c987:\n    local_14 = FUN_0001c830();\n  }\n  else {\n    if ((*param_1 == '%') && (param_1[1] == 's')) {\n      iVar1 = 0;\n      do {\n        iVar1 = iVar1 + 1;\n        if (param_1[iVar1 * 2] == '\0') goto LAB_0001c987;\n      } while ((param_1[iVar1 * 2] == '%') && (param_1[iVar1 * 2 + 1] == 's'));\n    }\n    iVar1 = FUN_0001dd40(&local_14,param_1,param_2);\n    if (iVar1 < 0) {\n      piVar2 = __errno_location();\n      if (*piVar2 == 0xc) {\n                    /* WARNING: Subroutine does not return */\n        FUN_0001baf0();\n      }\n      local_14 = 0;\n    }\n  }\n  if (local_10 != *(int *)(in_GS_OFFSET + 0x14)) {\n                    /* WARNING: Subroutine does not return */\n    FUN_000214c0();\n  }\n  return local_14;\n}\n\n" comment (function_definition "undefined4 FUN_0001c930(char *param_1,undefined4 param_2)\n\n{\n  int iVar1;\n  int *piVar2;\n  int in_GS_OFFSET;\n  undefined4 local_14;\n  int local_10;\n  undefined4 uStack_c;\n  \n  uStack_c = 0x1c937;\n  local_10 = *(int *)(in_GS_OFFSET + 0x14);\n  if (*param_1 == '\0') {\nLAB_0001c987:\n    local_14 = FUN_0001c830();\n  }\n  else {\n    if ((*param_1 == '%') && (param_1[1] == 's')) {\n      iVar1 = 0;\n      do {\n        iVar1 = iVar1 + 1;\n        if (param_1[iVar1 * 2] == '\0') goto LAB_0001c987;\n      } while ((param_1[iVar1 * 2] == '%') && (param_1[iVar1 * 2 + 1] == 's'));\n    }\n    iVar1 = FUN_0001dd40(&local_14,param_1,param_2);\n    if (iVar1 < 0) {\n      piVar2 = __errno_location();\n      if (*piVar2 == 0xc) {\n                    /* WARNING: Subroutine does not return */\n        FUN_0001baf0();\n      }\n      local_14 = 0;\n    }\n  }\n  if (local_10 != *(int *)(in_GS_OFFSET + 0x14)) {\n                    /* WARNING: Subroutine does not return */\n    FUN_000214c0();\n  }\n  return local_14;\n}" type_identifier (function_declarator "FUN_0001c930(char *param_1,undefined4 param_2)" identifier (parameter_list "(char *param_1,undefined4 param_2)" ( (parameter_declaration "char *param_1" primitive_type (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "undefined4 param_2" type_identifier identifier) ))) (compound_statement "{\n  int iVar1;\n  int *piVar2;\n  int in_GS_OFFSET;\n  undefined4 local_14;\n  int local_10;\n  undefined4 uStack_c;\n  \n  uStack_c = 0x1c937;\n  local_10 = *(int *)(in_GS_OFFSET + 0x14);\n  if (*param_1 == '\0') {\nLAB_0001c987:\n    local_14 = FUN_0001c830();\n  }\n  else {\n    if ((*param_1 == '%') && (param_1[1] == 's')) {\n      iVar1 = 0;\n      do {\n        iVar1 = iVar1 + 1;\n        if (param_1[iVar1 * 2] == '\0') goto LAB_0001c987;\n      } while ((param_1[iVar1 * 2] == '%') && (param_1[iVar1 * 2 + 1] == 's'));\n    }\n    iVar1 = FUN_0001dd40(&local_14,param_1,param_2);\n    if (iVar1 < 0) {\n      piVar2 = __errno_location();\n      if (*piVar2 == 0xc) {\n                    /* WARNING: Subroutine does not return */\n        FUN_0001baf0();\n      }\n      local_14 = 0;\n    }\n  }\n  if (local_10 != *(int *)(in_GS_OFFSET + 0x14)) {\n                    /* WARNING: Subroutine does not return */\n    FUN_000214c0();\n  }\n  return local_14;\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "int *piVar2;" primitive_type (pointer_declarator "*piVar2" * identifier) ;) (declaration "int in_GS_OFFSET;" primitive_type identifier ;) (declaration "undefined4 local_14;" type_identifier identifier ;) (declaration "int local_10;" primitive_type identifier ;) (declaration "undefined4 uStack_c;" type_identifier identifier ;) (expression_statement "uStack_c = 0x1c937;" (assignment_expression "uStack_c = 0x1c937" identifier = number_literal) ;) (expression_statement "local_10 = *(int *)(in_GS_OFFSET + 0x14);" (assignment_expression "local_10 = *(int *)(in_GS_OFFSET + 0x14)" identifier = (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" * (cast_expression "(int *)(in_GS_OFFSET + 0x14)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_GS_OFFSET + 0x14)" ( (binary_expression "in_GS_OFFSET + 0x14" identifier + number_literal) ))))) ;) (if_statement "if (*param_1 == '\0') {\nLAB_0001c987:\n    local_14 = FUN_0001c830();\n  }\n  else {\n    if ((*param_1 == '%') && (param_1[1] == 's')) {\n      iVar1 = 0;\n      do {\n        iVar1 = iVar1 + 1;\n        if (param_1[iVar1 * 2] == '\0') goto LAB_0001c987;\n      } while ((param_1[iVar1 * 2] == '%') && (param_1[iVar1 * 2 + 1] == 's'));\n    }\n    iVar1 = FUN_0001dd40(&local_14,param_1,param_2);\n    if (iVar1 < 0) {\n      piVar2 = __errno_location();\n      if (*piVar2 == 0xc) {\n                    /* WARNING: Subroutine does not return */\n        FUN_0001baf0();\n      }\n      local_14 = 0;\n    }\n  }" if (parenthesized_expression "(*param_1 == '\0')" ( (binary_expression "*param_1 == '\0'" (pointer_expression "*param_1" * identifier) == (char_literal "'\0'" ' escape_sequence ')) )) (compound_statement "{\nLAB_0001c987:\n    local_14 = FUN_0001c830();\n  }" { (labeled_statement "LAB_0001c987:\n    local_14 = FUN_0001c830();" statement_identifier : (expression_statement "local_14 = FUN_0001c830();" (assignment_expression "local_14 = FUN_0001c830()" identifier = (call_expression "FUN_0001c830()" identifier (argument_list "()" ( )))) ;)) }) (else_clause "else {\n    if ((*param_1 == '%') && (param_1[1] == 's')) {\n      iVar1 = 0;\n      do {\n        iVar1 = iVar1 + 1;\n        if (param_1[iVar1 * 2] == '\0') goto LAB_0001c987;\n      } while ((param_1[iVar1 * 2] == '%') && (param_1[iVar1 * 2 + 1] == 's'));\n    }\n    iVar1 = FUN_0001dd40(&local_14,param_1,param_2);\n    if (iVar1 < 0) {\n      piVar2 = __errno_location();\n      if (*piVar2 == 0xc) {\n                    /* WARNING: Subroutine does not return */\n        FUN_0001baf0();\n      }\n      local_14 = 0;\n    }\n  }" else (compound_statement "{\n    if ((*param_1 == '%') && (param_1[1] == 's')) {\n      iVar1 = 0;\n      do {\n        iVar1 = iVar1 + 1;\n        if (param_1[iVar1 * 2] == '\0') goto LAB_0001c987;\n      } while ((param_1[iVar1 * 2] == '%') && (param_1[iVar1 * 2 + 1] == 's'));\n    }\n    iVar1 = FUN_0001dd40(&local_14,param_1,param_2);\n    if (iVar1 < 0) {\n      piVar2 = __errno_location();\n      if (*piVar2 == 0xc) {\n                    /* WARNING: Subroutine does not return */\n        FUN_0001baf0();\n      }\n      local_14 = 0;\n    }\n  }" { (if_statement "if ((*param_1 == '%') && (param_1[1] == 's')) {\n      iVar1 = 0;\n      do {\n        iVar1 = iVar1 + 1;\n        if (param_1[iVar1 * 2] == '\0') goto LAB_0001c987;\n      } while ((param_1[iVar1 * 2] == '%') && (param_1[iVar1 * 2 + 1] == 's'));\n    }" if (parenthesized_expression "((*param_1 == '%') && (param_1[1] == 's'))" ( (binary_expression "(*param_1 == '%') && (param_1[1] == 's')" (parenthesized_expression "(*param_1 == '%')" ( (binary_expression "*param_1 == '%'" (pointer_expression "*param_1" * identifier) == (char_literal "'%'" ' character ')) )) && (parenthesized_expression "(param_1[1] == 's')" ( (binary_expression "param_1[1] == 's'" (subscript_expression "param_1[1]" identifier [ number_literal ]) == (char_literal "'s'" ' character ')) ))) )) (compound_statement "{\n      iVar1 = 0;\n      do {\n        iVar1 = iVar1 + 1;\n        if (param_1[iVar1 * 2] == '\0') goto LAB_0001c987;\n      } while ((param_1[iVar1 * 2] == '%') && (param_1[iVar1 * 2 + 1] == 's'));\n    }" { (expression_statement "iVar1 = 0;" (assignment_expression "iVar1 = 0" identifier = number_literal) ;) (do_statement "do {\n        iVar1 = iVar1 + 1;\n        if (param_1[iVar1 * 2] == '\0') goto LAB_0001c987;\n      } while ((param_1[iVar1 * 2] == '%') && (param_1[iVar1 * 2 + 1] == 's'));" do (compound_statement "{\n        iVar1 = iVar1 + 1;\n        if (param_1[iVar1 * 2] == '\0') goto LAB_0001c987;\n      }" { (expression_statement "iVar1 = iVar1 + 1;" (assignment_expression "iVar1 = iVar1 + 1" identifier = (binary_expression "iVar1 + 1" identifier + number_literal)) ;) (if_statement "if (param_1[iVar1 * 2] == '\0') goto LAB_0001c987;" if (parenthesized_expression "(param_1[iVar1 * 2] == '\0')" ( (binary_expression "param_1[iVar1 * 2] == '\0'" (subscript_expression "param_1[iVar1 * 2]" identifier [ (binary_expression "iVar1 * 2" identifier * number_literal) ]) == (char_literal "'\0'" ' escape_sequence ')) )) (goto_statement "goto LAB_0001c987;" goto statement_identifier ;)) }) while (parenthesized_expression "((param_1[iVar1 * 2] == '%') && (param_1[iVar1 * 2 + 1] == 's'))" ( (binary_expression "(param_1[iVar1 * 2] == '%') && (param_1[iVar1 * 2 + 1] == 's')" (parenthesized_expression "(param_1[iVar1 * 2] == '%')" ( (binary_expression "param_1[iVar1 * 2] == '%'" (subscript_expression "param_1[iVar1 * 2]" identifier [ (binary_expression "iVar1 * 2" identifier * number_literal) ]) == (char_literal "'%'" ' character ')) )) && (parenthesized_expression "(param_1[iVar1 * 2 + 1] == 's')" ( (binary_expression "param_1[iVar1 * 2 + 1] == 's'" (subscript_expression "param_1[iVar1 * 2 + 1]" identifier [ (binary_expression "iVar1 * 2 + 1" (binary_expression "iVar1 * 2" identifier * number_literal) + number_literal) ]) == (char_literal "'s'" ' character ')) ))) )) ;) })) (expression_statement "iVar1 = FUN_0001dd40(&local_14,param_1,param_2);" (assignment_expression "iVar1 = FUN_0001dd40(&local_14,param_1,param_2)" identifier = (call_expression "FUN_0001dd40(&local_14,param_1,param_2)" identifier (argument_list "(&local_14,param_1,param_2)" ( (pointer_expression "&local_14" & identifier) , identifier , identifier )))) ;) (if_statement "if (iVar1 < 0) {\n      piVar2 = __errno_location();\n      if (*piVar2 == 0xc) {\n                    /* WARNING: Subroutine does not return */\n        FUN_0001baf0();\n      }\n      local_14 = 0;\n    }" if (parenthesized_expression "(iVar1 < 0)" ( (binary_expression "iVar1 < 0" identifier < number_literal) )) (compound_statement "{\n      piVar2 = __errno_location();\n      if (*piVar2 == 0xc) {\n                    /* WARNING: Subroutine does not return */\n        FUN_0001baf0();\n      }\n      local_14 = 0;\n    }" { (expression_statement "piVar2 = __errno_location();" (assignment_expression "piVar2 = __errno_location()" identifier = (call_expression "__errno_location()" identifier (argument_list "()" ( )))) ;) (if_statement "if (*piVar2 == 0xc) {\n                    /* WARNING: Subroutine does not return */\n        FUN_0001baf0();\n      }" if (parenthesized_expression "(*piVar2 == 0xc)" ( (binary_expression "*piVar2 == 0xc" (pointer_expression "*piVar2" * identifier) == number_literal) )) (compound_statement "{\n                    /* WARNING: Subroutine does not return */\n        FUN_0001baf0();\n      }" { comment (expression_statement "FUN_0001baf0();" (call_expression "FUN_0001baf0()" identifier (argument_list "()" ( ))) ;) })) (expression_statement "local_14 = 0;" (assignment_expression "local_14 = 0" identifier = number_literal) ;) })) }))) (if_statement "if (local_10 != *(int *)(in_GS_OFFSET + 0x14)) {\n                    /* WARNING: Subroutine does not return */\n    FUN_000214c0();\n  }" if (parenthesized_expression "(local_10 != *(int *)(in_GS_OFFSET + 0x14))" ( (binary_expression "local_10 != *(int *)(in_GS_OFFSET + 0x14)" identifier != (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" * (cast_expression "(int *)(in_GS_OFFSET + 0x14)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_GS_OFFSET + 0x14)" ( (binary_expression "in_GS_OFFSET + 0x14" identifier + number_literal) ))))) )) (compound_statement "{\n                    /* WARNING: Subroutine does not return */\n    FUN_000214c0();\n  }" { comment (expression_statement "FUN_000214c0();" (call_expression "FUN_000214c0()" identifier (argument_list "()" ( ))) ;) })) (return_statement "return local_14;" return identifier ;) })))
(translation_unit "/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n/* WARNING: Unknown calling convention */\n\nchar * xvasprintf(char *format,va_list args)\n\n{\n  size_t argcount;\n  int iVar1;\n  int *piVar2;\n  int in_GS_OFFSET;\n  char *result;\n  int local_10;\n  undefined4 uStack_c;\n  \n  uStack_c = 0x1c937;\n  local_10 = *(int *)(in_GS_OFFSET + 0x14);\n  if (*format == '\0') {\n    argcount = 0;\nLAB_0001c987:\n    result = xstrcat(argcount,args);\n  }\n  else {\n    if ((*format == '%') && (format[1] == 's')) {\n      argcount = 0;\n      do {\n        argcount = argcount + 1;\n        if (format[argcount * 2] == '\0') goto LAB_0001c987;\n      } while ((format[argcount * 2] == '%') && (format[argcount * 2 + 1] == 's'));\n    }\n    iVar1 = rpl_vasprintf(&result,format,args);\n    if (iVar1 < 0) {\n      piVar2 = __errno_location();\n      if (*piVar2 == 0xc) {\n                    /* WARNING: Subroutine does not return */\n        xalloc_die();\n      }\n      result = (char *)0x0;\n    }\n  }\n  if (local_10 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return result;\n  }\n                    /* WARNING: Subroutine does not return */\n  __stack_chk_fail_local();\n}\n\n" comment comment (function_definition "char * xvasprintf(char *format,va_list args)\n\n{\n  size_t argcount;\n  int iVar1;\n  int *piVar2;\n  int in_GS_OFFSET;\n  char *result;\n  int local_10;\n  undefined4 uStack_c;\n  \n  uStack_c = 0x1c937;\n  local_10 = *(int *)(in_GS_OFFSET + 0x14);\n  if (*format == '\0') {\n    argcount = 0;\nLAB_0001c987:\n    result = xstrcat(argcount,args);\n  }\n  else {\n    if ((*format == '%') && (format[1] == 's')) {\n      argcount = 0;\n      do {\n        argcount = argcount + 1;\n        if (format[argcount * 2] == '\0') goto LAB_0001c987;\n      } while ((format[argcount * 2] == '%') && (format[argcount * 2 + 1] == 's'));\n    }\n    iVar1 = rpl_vasprintf(&result,format,args);\n    if (iVar1 < 0) {\n      piVar2 = __errno_location();\n      if (*piVar2 == 0xc) {\n                    /* WARNING: Subroutine does not return */\n        xalloc_die();\n      }\n      result = (char *)0x0;\n    }\n  }\n  if (local_10 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return result;\n  }\n                    /* WARNING: Subroutine does not return */\n  __stack_chk_fail_local();\n}" primitive_type (pointer_declarator "* xvasprintf(char *format,va_list args)" * (function_declarator "xvasprintf(char *format,va_list args)" identifier (parameter_list "(char *format,va_list args)" ( (parameter_declaration "char *format" primitive_type (pointer_declarator "*format" * identifier)) , (parameter_declaration "va_list args" type_identifier identifier) )))) (compound_statement "{\n  size_t argcount;\n  int iVar1;\n  int *piVar2;\n  int in_GS_OFFSET;\n  char *result;\n  int local_10;\n  undefined4 uStack_c;\n  \n  uStack_c = 0x1c937;\n  local_10 = *(int *)(in_GS_OFFSET + 0x14);\n  if (*format == '\0') {\n    argcount = 0;\nLAB_0001c987:\n    result = xstrcat(argcount,args);\n  }\n  else {\n    if ((*format == '%') && (format[1] == 's')) {\n      argcount = 0;\n      do {\n        argcount = argcount + 1;\n        if (format[argcount * 2] == '\0') goto LAB_0001c987;\n      } while ((format[argcount * 2] == '%') && (format[argcount * 2 + 1] == 's'));\n    }\n    iVar1 = rpl_vasprintf(&result,format,args);\n    if (iVar1 < 0) {\n      piVar2 = __errno_location();\n      if (*piVar2 == 0xc) {\n                    /* WARNING: Subroutine does not return */\n        xalloc_die();\n      }\n      result = (char *)0x0;\n    }\n  }\n  if (local_10 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return result;\n  }\n                    /* WARNING: Subroutine does not return */\n  __stack_chk_fail_local();\n}" { (declaration "size_t argcount;" primitive_type identifier ;) (declaration "int iVar1;" primitive_type identifier ;) (declaration "int *piVar2;" primitive_type (pointer_declarator "*piVar2" * identifier) ;) (declaration "int in_GS_OFFSET;" primitive_type identifier ;) (declaration "char *result;" primitive_type (pointer_declarator "*result" * identifier) ;) (declaration "int local_10;" primitive_type identifier ;) (declaration "undefined4 uStack_c;" type_identifier identifier ;) (expression_statement "uStack_c = 0x1c937;" (assignment_expression "uStack_c = 0x1c937" identifier = number_literal) ;) (expression_statement "local_10 = *(int *)(in_GS_OFFSET + 0x14);" (assignment_expression "local_10 = *(int *)(in_GS_OFFSET + 0x14)" identifier = (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" * (cast_expression "(int *)(in_GS_OFFSET + 0x14)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_GS_OFFSET + 0x14)" ( (binary_expression "in_GS_OFFSET + 0x14" identifier + number_literal) ))))) ;) (if_statement "if (*format == '\0') {\n    argcount = 0;\nLAB_0001c987:\n    result = xstrcat(argcount,args);\n  }\n  else {\n    if ((*format == '%') && (format[1] == 's')) {\n      argcount = 0;\n      do {\n        argcount = argcount + 1;\n        if (format[argcount * 2] == '\0') goto LAB_0001c987;\n      } while ((format[argcount * 2] == '%') && (format[argcount * 2 + 1] == 's'));\n    }\n    iVar1 = rpl_vasprintf(&result,format,args);\n    if (iVar1 < 0) {\n      piVar2 = __errno_location();\n      if (*piVar2 == 0xc) {\n                    /* WARNING: Subroutine does not return */\n        xalloc_die();\n      }\n      result = (char *)0x0;\n    }\n  }" if (parenthesized_expression "(*format == '\0')" ( (binary_expression "*format == '\0'" (pointer_expression "*format" * identifier) == (char_literal "'\0'" ' escape_sequence ')) )) (compound_statement "{\n    argcount = 0;\nLAB_0001c987:\n    result = xstrcat(argcount,args);\n  }" { (expression_statement "argcount = 0;" (assignment_expression "argcount = 0" identifier = number_literal) ;) (labeled_statement "LAB_0001c987:\n    result = xstrcat(argcount,args);" statement_identifier : (expression_statement "result = xstrcat(argcount,args);" (assignment_expression "result = xstrcat(argcount,args)" identifier = (call_expression "xstrcat(argcount,args)" identifier (argument_list "(argcount,args)" ( identifier , identifier )))) ;)) }) (else_clause "else {\n    if ((*format == '%') && (format[1] == 's')) {\n      argcount = 0;\n      do {\n        argcount = argcount + 1;\n        if (format[argcount * 2] == '\0') goto LAB_0001c987;\n      } while ((format[argcount * 2] == '%') && (format[argcount * 2 + 1] == 's'));\n    }\n    iVar1 = rpl_vasprintf(&result,format,args);\n    if (iVar1 < 0) {\n      piVar2 = __errno_location();\n      if (*piVar2 == 0xc) {\n                    /* WARNING: Subroutine does not return */\n        xalloc_die();\n      }\n      result = (char *)0x0;\n    }\n  }" else (compound_statement "{\n    if ((*format == '%') && (format[1] == 's')) {\n      argcount = 0;\n      do {\n        argcount = argcount + 1;\n        if (format[argcount * 2] == '\0') goto LAB_0001c987;\n      } while ((format[argcount * 2] == '%') && (format[argcount * 2 + 1] == 's'));\n    }\n    iVar1 = rpl_vasprintf(&result,format,args);\n    if (iVar1 < 0) {\n      piVar2 = __errno_location();\n      if (*piVar2 == 0xc) {\n                    /* WARNING: Subroutine does not return */\n        xalloc_die();\n      }\n      result = (char *)0x0;\n    }\n  }" { (if_statement "if ((*format == '%') && (format[1] == 's')) {\n      argcount = 0;\n      do {\n        argcount = argcount + 1;\n        if (format[argcount * 2] == '\0') goto LAB_0001c987;\n      } while ((format[argcount * 2] == '%') && (format[argcount * 2 + 1] == 's'));\n    }" if (parenthesized_expression "((*format == '%') && (format[1] == 's'))" ( (binary_expression "(*format == '%') && (format[1] == 's')" (parenthesized_expression "(*format == '%')" ( (binary_expression "*format == '%'" (pointer_expression "*format" * identifier) == (char_literal "'%'" ' character ')) )) && (parenthesized_expression "(format[1] == 's')" ( (binary_expression "format[1] == 's'" (subscript_expression "format[1]" identifier [ number_literal ]) == (char_literal "'s'" ' character ')) ))) )) (compound_statement "{\n      argcount = 0;\n      do {\n        argcount = argcount + 1;\n        if (format[argcount * 2] == '\0') goto LAB_0001c987;\n      } while ((format[argcount * 2] == '%') && (format[argcount * 2 + 1] == 's'));\n    }" { (expression_statement "argcount = 0;" (assignment_expression "argcount = 0" identifier = number_literal) ;) (do_statement "do {\n        argcount = argcount + 1;\n        if (format[argcount * 2] == '\0') goto LAB_0001c987;\n      } while ((format[argcount * 2] == '%') && (format[argcount * 2 + 1] == 's'));" do (compound_statement "{\n        argcount = argcount + 1;\n        if (format[argcount * 2] == '\0') goto LAB_0001c987;\n      }" { (expression_statement "argcount = argcount + 1;" (assignment_expression "argcount = argcount + 1" identifier = (binary_expression "argcount + 1" identifier + number_literal)) ;) (if_statement "if (format[argcount * 2] == '\0') goto LAB_0001c987;" if (parenthesized_expression "(format[argcount * 2] == '\0')" ( (binary_expression "format[argcount * 2] == '\0'" (subscript_expression "format[argcount * 2]" identifier [ (binary_expression "argcount * 2" identifier * number_literal) ]) == (char_literal "'\0'" ' escape_sequence ')) )) (goto_statement "goto LAB_0001c987;" goto statement_identifier ;)) }) while (parenthesized_expression "((format[argcount * 2] == '%') && (format[argcount * 2 + 1] == 's'))" ( (binary_expression "(format[argcount * 2] == '%') && (format[argcount * 2 + 1] == 's')" (parenthesized_expression "(format[argcount * 2] == '%')" ( (binary_expression "format[argcount * 2] == '%'" (subscript_expression "format[argcount * 2]" identifier [ (binary_expression "argcount * 2" identifier * number_literal) ]) == (char_literal "'%'" ' character ')) )) && (parenthesized_expression "(format[argcount * 2 + 1] == 's')" ( (binary_expression "format[argcount * 2 + 1] == 's'" (subscript_expression "format[argcount * 2 + 1]" identifier [ (binary_expression "argcount * 2 + 1" (binary_expression "argcount * 2" identifier * number_literal) + number_literal) ]) == (char_literal "'s'" ' character ')) ))) )) ;) })) (expression_statement "iVar1 = rpl_vasprintf(&result,format,args);" (assignment_expression "iVar1 = rpl_vasprintf(&result,format,args)" identifier = (call_expression "rpl_vasprintf(&result,format,args)" identifier (argument_list "(&result,format,args)" ( (pointer_expression "&result" & identifier) , identifier , identifier )))) ;) (if_statement "if (iVar1 < 0) {\n      piVar2 = __errno_location();\n      if (*piVar2 == 0xc) {\n                    /* WARNING: Subroutine does not return */\n        xalloc_die();\n      }\n      result = (char *)0x0;\n    }" if (parenthesized_expression "(iVar1 < 0)" ( (binary_expression "iVar1 < 0" identifier < number_literal) )) (compound_statement "{\n      piVar2 = __errno_location();\n      if (*piVar2 == 0xc) {\n                    /* WARNING: Subroutine does not return */\n        xalloc_die();\n      }\n      result = (char *)0x0;\n    }" { (expression_statement "piVar2 = __errno_location();" (assignment_expression "piVar2 = __errno_location()" identifier = (call_expression "__errno_location()" identifier (argument_list "()" ( )))) ;) (if_statement "if (*piVar2 == 0xc) {\n                    /* WARNING: Subroutine does not return */\n        xalloc_die();\n      }" if (parenthesized_expression "(*piVar2 == 0xc)" ( (binary_expression "*piVar2 == 0xc" (pointer_expression "*piVar2" * identifier) == number_literal) )) (compound_statement "{\n                    /* WARNING: Subroutine does not return */\n        xalloc_die();\n      }" { comment (expression_statement "xalloc_die();" (call_expression "xalloc_die()" identifier (argument_list "()" ( ))) ;) })) (expression_statement "result = (char *)0x0;" (assignment_expression "result = (char *)0x0" identifier = (cast_expression "(char *)0x0" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) ;) })) }))) (if_statement "if (local_10 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return result;\n  }" if (parenthesized_expression "(local_10 == *(int *)(in_GS_OFFSET + 0x14))" ( (binary_expression "local_10 == *(int *)(in_GS_OFFSET + 0x14)" identifier == (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" * (cast_expression "(int *)(in_GS_OFFSET + 0x14)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_GS_OFFSET + 0x14)" ( (binary_expression "in_GS_OFFSET + 0x14" identifier + number_literal) ))))) )) (compound_statement "{\n    return result;\n  }" { (return_statement "return result;" return identifier ;) })) comment (expression_statement "__stack_chk_fail_local();" (call_expression "__stack_chk_fail_local()" identifier (argument_list "()" ( ))) ;) })))
(translation_unit "undefined4 FUN_0001c930(char *param_1,undefined4 param_2)\n\n{\n  int iVar1;\n  int *piVar2;\n  int in_GS_OFFSET;\n  undefined4 local_14;\n  int local_10;\n  undefined4 uStack_c;\n  \n  uStack_c = 0x1c937;\n  local_10 = *(int *)(in_GS_OFFSET + 0x14);\n  if (*param_1 == '\0') {\nLAB_0001c987:\n    local_14 = FUN_0001c830();\n  }\n  else {\n    if ((*param_1 == '%') && (param_1[1] == 's')) {\n      iVar1 = 0;\n      do {\n        iVar1 = iVar1 + 1;\n        if (param_1[iVar1 * 2] == '\0') goto LAB_0001c987;\n      } while ((param_1[iVar1 * 2] == '%') && (param_1[iVar1 * 2 + 1] == 's'));\n    }\n    iVar1 = FUN_0001dd40(&local_14,param_1,param_2);\n    if (iVar1 < 0) {\n      piVar2 = __errno_location();\n      if (*piVar2 == 0xc) {\n                    \n        FUN_0001baf0();\n      }\n      local_14 = 0;\n    }\n  }\n  if (local_10 != *(int *)(in_GS_OFFSET + 0x14)) {\n                    \n    FUN_000214c0();\n  }\n  return local_14;\n}\n\n" (function_definition "undefined4 FUN_0001c930(char *param_1,undefined4 param_2)\n\n{\n  int iVar1;\n  int *piVar2;\n  int in_GS_OFFSET;\n  undefined4 local_14;\n  int local_10;\n  undefined4 uStack_c;\n  \n  uStack_c = 0x1c937;\n  local_10 = *(int *)(in_GS_OFFSET + 0x14);\n  if (*param_1 == '\0') {\nLAB_0001c987:\n    local_14 = FUN_0001c830();\n  }\n  else {\n    if ((*param_1 == '%') && (param_1[1] == 's')) {\n      iVar1 = 0;\n      do {\n        iVar1 = iVar1 + 1;\n        if (param_1[iVar1 * 2] == '\0') goto LAB_0001c987;\n      } while ((param_1[iVar1 * 2] == '%') && (param_1[iVar1 * 2 + 1] == 's'));\n    }\n    iVar1 = FUN_0001dd40(&local_14,param_1,param_2);\n    if (iVar1 < 0) {\n      piVar2 = __errno_location();\n      if (*piVar2 == 0xc) {\n                    \n        FUN_0001baf0();\n      }\n      local_14 = 0;\n    }\n  }\n  if (local_10 != *(int *)(in_GS_OFFSET + 0x14)) {\n                    \n    FUN_000214c0();\n  }\n  return local_14;\n}" type_identifier (function_declarator "FUN_0001c930(char *param_1,undefined4 param_2)" identifier (parameter_list "(char *param_1,undefined4 param_2)" ( (parameter_declaration "char *param_1" primitive_type (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "undefined4 param_2" type_identifier identifier) ))) (compound_statement "{\n  int iVar1;\n  int *piVar2;\n  int in_GS_OFFSET;\n  undefined4 local_14;\n  int local_10;\n  undefined4 uStack_c;\n  \n  uStack_c = 0x1c937;\n  local_10 = *(int *)(in_GS_OFFSET + 0x14);\n  if (*param_1 == '\0') {\nLAB_0001c987:\n    local_14 = FUN_0001c830();\n  }\n  else {\n    if ((*param_1 == '%') && (param_1[1] == 's')) {\n      iVar1 = 0;\n      do {\n        iVar1 = iVar1 + 1;\n        if (param_1[iVar1 * 2] == '\0') goto LAB_0001c987;\n      } while ((param_1[iVar1 * 2] == '%') && (param_1[iVar1 * 2 + 1] == 's'));\n    }\n    iVar1 = FUN_0001dd40(&local_14,param_1,param_2);\n    if (iVar1 < 0) {\n      piVar2 = __errno_location();\n      if (*piVar2 == 0xc) {\n                    \n        FUN_0001baf0();\n      }\n      local_14 = 0;\n    }\n  }\n  if (local_10 != *(int *)(in_GS_OFFSET + 0x14)) {\n                    \n    FUN_000214c0();\n  }\n  return local_14;\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "int *piVar2;" primitive_type (pointer_declarator "*piVar2" * identifier) ;) (declaration "int in_GS_OFFSET;" primitive_type identifier ;) (declaration "undefined4 local_14;" type_identifier identifier ;) (declaration "int local_10;" primitive_type identifier ;) (declaration "undefined4 uStack_c;" type_identifier identifier ;) (expression_statement "uStack_c = 0x1c937;" (assignment_expression "uStack_c = 0x1c937" identifier = number_literal) ;) (expression_statement "local_10 = *(int *)(in_GS_OFFSET + 0x14);" (assignment_expression "local_10 = *(int *)(in_GS_OFFSET + 0x14)" identifier = (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" * (cast_expression "(int *)(in_GS_OFFSET + 0x14)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_GS_OFFSET + 0x14)" ( (binary_expression "in_GS_OFFSET + 0x14" identifier + number_literal) ))))) ;) (if_statement "if (*param_1 == '\0') {\nLAB_0001c987:\n    local_14 = FUN_0001c830();\n  }\n  else {\n    if ((*param_1 == '%') && (param_1[1] == 's')) {\n      iVar1 = 0;\n      do {\n        iVar1 = iVar1 + 1;\n        if (param_1[iVar1 * 2] == '\0') goto LAB_0001c987;\n      } while ((param_1[iVar1 * 2] == '%') && (param_1[iVar1 * 2 + 1] == 's'));\n    }\n    iVar1 = FUN_0001dd40(&local_14,param_1,param_2);\n    if (iVar1 < 0) {\n      piVar2 = __errno_location();\n      if (*piVar2 == 0xc) {\n                    \n        FUN_0001baf0();\n      }\n      local_14 = 0;\n    }\n  }" if (parenthesized_expression "(*param_1 == '\0')" ( (binary_expression "*param_1 == '\0'" (pointer_expression "*param_1" * identifier) == (char_literal "'\0'" ' escape_sequence ')) )) (compound_statement "{\nLAB_0001c987:\n    local_14 = FUN_0001c830();\n  }" { (labeled_statement "LAB_0001c987:\n    local_14 = FUN_0001c830();" statement_identifier : (expression_statement "local_14 = FUN_0001c830();" (assignment_expression "local_14 = FUN_0001c830()" identifier = (call_expression "FUN_0001c830()" identifier (argument_list "()" ( )))) ;)) }) (else_clause "else {\n    if ((*param_1 == '%') && (param_1[1] == 's')) {\n      iVar1 = 0;\n      do {\n        iVar1 = iVar1 + 1;\n        if (param_1[iVar1 * 2] == '\0') goto LAB_0001c987;\n      } while ((param_1[iVar1 * 2] == '%') && (param_1[iVar1 * 2 + 1] == 's'));\n    }\n    iVar1 = FUN_0001dd40(&local_14,param_1,param_2);\n    if (iVar1 < 0) {\n      piVar2 = __errno_location();\n      if (*piVar2 == 0xc) {\n                    \n        FUN_0001baf0();\n      }\n      local_14 = 0;\n    }\n  }" else (compound_statement "{\n    if ((*param_1 == '%') && (param_1[1] == 's')) {\n      iVar1 = 0;\n      do {\n        iVar1 = iVar1 + 1;\n        if (param_1[iVar1 * 2] == '\0') goto LAB_0001c987;\n      } while ((param_1[iVar1 * 2] == '%') && (param_1[iVar1 * 2 + 1] == 's'));\n    }\n    iVar1 = FUN_0001dd40(&local_14,param_1,param_2);\n    if (iVar1 < 0) {\n      piVar2 = __errno_location();\n      if (*piVar2 == 0xc) {\n                    \n        FUN_0001baf0();\n      }\n      local_14 = 0;\n    }\n  }" { (if_statement "if ((*param_1 == '%') && (param_1[1] == 's')) {\n      iVar1 = 0;\n      do {\n        iVar1 = iVar1 + 1;\n        if (param_1[iVar1 * 2] == '\0') goto LAB_0001c987;\n      } while ((param_1[iVar1 * 2] == '%') && (param_1[iVar1 * 2 + 1] == 's'));\n    }" if (parenthesized_expression "((*param_1 == '%') && (param_1[1] == 's'))" ( (binary_expression "(*param_1 == '%') && (param_1[1] == 's')" (parenthesized_expression "(*param_1 == '%')" ( (binary_expression "*param_1 == '%'" (pointer_expression "*param_1" * identifier) == (char_literal "'%'" ' character ')) )) && (parenthesized_expression "(param_1[1] == 's')" ( (binary_expression "param_1[1] == 's'" (subscript_expression "param_1[1]" identifier [ number_literal ]) == (char_literal "'s'" ' character ')) ))) )) (compound_statement "{\n      iVar1 = 0;\n      do {\n        iVar1 = iVar1 + 1;\n        if (param_1[iVar1 * 2] == '\0') goto LAB_0001c987;\n      } while ((param_1[iVar1 * 2] == '%') && (param_1[iVar1 * 2 + 1] == 's'));\n    }" { (expression_statement "iVar1 = 0;" (assignment_expression "iVar1 = 0" identifier = number_literal) ;) (do_statement "do {\n        iVar1 = iVar1 + 1;\n        if (param_1[iVar1 * 2] == '\0') goto LAB_0001c987;\n      } while ((param_1[iVar1 * 2] == '%') && (param_1[iVar1 * 2 + 1] == 's'));" do (compound_statement "{\n        iVar1 = iVar1 + 1;\n        if (param_1[iVar1 * 2] == '\0') goto LAB_0001c987;\n      }" { (expression_statement "iVar1 = iVar1 + 1;" (assignment_expression "iVar1 = iVar1 + 1" identifier = (binary_expression "iVar1 + 1" identifier + number_literal)) ;) (if_statement "if (param_1[iVar1 * 2] == '\0') goto LAB_0001c987;" if (parenthesized_expression "(param_1[iVar1 * 2] == '\0')" ( (binary_expression "param_1[iVar1 * 2] == '\0'" (subscript_expression "param_1[iVar1 * 2]" identifier [ (binary_expression "iVar1 * 2" identifier * number_literal) ]) == (char_literal "'\0'" ' escape_sequence ')) )) (goto_statement "goto LAB_0001c987;" goto statement_identifier ;)) }) while (parenthesized_expression "((param_1[iVar1 * 2] == '%') && (param_1[iVar1 * 2 + 1] == 's'))" ( (binary_expression "(param_1[iVar1 * 2] == '%') && (param_1[iVar1 * 2 + 1] == 's')" (parenthesized_expression "(param_1[iVar1 * 2] == '%')" ( (binary_expression "param_1[iVar1 * 2] == '%'" (subscript_expression "param_1[iVar1 * 2]" identifier [ (binary_expression "iVar1 * 2" identifier * number_literal) ]) == (char_literal "'%'" ' character ')) )) && (parenthesized_expression "(param_1[iVar1 * 2 + 1] == 's')" ( (binary_expression "param_1[iVar1 * 2 + 1] == 's'" (subscript_expression "param_1[iVar1 * 2 + 1]" identifier [ (binary_expression "iVar1 * 2 + 1" (binary_expression "iVar1 * 2" identifier * number_literal) + number_literal) ]) == (char_literal "'s'" ' character ')) ))) )) ;) })) (expression_statement "iVar1 = FUN_0001dd40(&local_14,param_1,param_2);" (assignment_expression "iVar1 = FUN_0001dd40(&local_14,param_1,param_2)" identifier = (call_expression "FUN_0001dd40(&local_14,param_1,param_2)" identifier (argument_list "(&local_14,param_1,param_2)" ( (pointer_expression "&local_14" & identifier) , identifier , identifier )))) ;) (if_statement "if (iVar1 < 0) {\n      piVar2 = __errno_location();\n      if (*piVar2 == 0xc) {\n                    \n        FUN_0001baf0();\n      }\n      local_14 = 0;\n    }" if (parenthesized_expression "(iVar1 < 0)" ( (binary_expression "iVar1 < 0" identifier < number_literal) )) (compound_statement "{\n      piVar2 = __errno_location();\n      if (*piVar2 == 0xc) {\n                    \n        FUN_0001baf0();\n      }\n      local_14 = 0;\n    }" { (expression_statement "piVar2 = __errno_location();" (assignment_expression "piVar2 = __errno_location()" identifier = (call_expression "__errno_location()" identifier (argument_list "()" ( )))) ;) (if_statement "if (*piVar2 == 0xc) {\n                    \n        FUN_0001baf0();\n      }" if (parenthesized_expression "(*piVar2 == 0xc)" ( (binary_expression "*piVar2 == 0xc" (pointer_expression "*piVar2" * identifier) == number_literal) )) (compound_statement "{\n                    \n        FUN_0001baf0();\n      }" { (expression_statement "FUN_0001baf0();" (call_expression "FUN_0001baf0()" identifier (argument_list "()" ( ))) ;) })) (expression_statement "local_14 = 0;" (assignment_expression "local_14 = 0" identifier = number_literal) ;) })) }))) (if_statement "if (local_10 != *(int *)(in_GS_OFFSET + 0x14)) {\n                    \n    FUN_000214c0();\n  }" if (parenthesized_expression "(local_10 != *(int *)(in_GS_OFFSET + 0x14))" ( (binary_expression "local_10 != *(int *)(in_GS_OFFSET + 0x14)" identifier != (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" * (cast_expression "(int *)(in_GS_OFFSET + 0x14)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_GS_OFFSET + 0x14)" ( (binary_expression "in_GS_OFFSET + 0x14" identifier + number_literal) ))))) )) (compound_statement "{\n                    \n    FUN_000214c0();\n  }" { (expression_statement "FUN_000214c0();" (call_expression "FUN_000214c0()" identifier (argument_list "()" ( ))) ;) })) (return_statement "return local_14;" return identifier ;) })))
(translation_unit (function_definition TYPE (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE (pointer_declarator * IDENT)) , (parameter_declaration TYPE IDENT) ))) (compound_statement { (declaration TYPE IDENT ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (expression_statement (assignment_expression IDENT = LIT) ;) (expression_statement (assignment_expression IDENT = (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))))) ;) (if_statement if (parenthesized_expression ( (binary_expression (pointer_expression * IDENT) == (char_literal ' escape_sequence ')) )) (compound_statement { (labeled_statement statement_identifier : (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( )))) ;)) }) (else_clause else (compound_statement { (if_statement if (parenthesized_expression ( (binary_expression (parenthesized_expression ( (binary_expression (pointer_expression * IDENT) == (char_literal ' character ')) )) && (parenthesized_expression ( (binary_expression (subscript_expression IDENT [ LIT ]) == (char_literal ' character ')) ))) )) (compound_statement { (expression_statement (assignment_expression IDENT = LIT) ;) (do_statement do (compound_statement { (expression_statement (assignment_expression IDENT = (binary_expression IDENT + LIT)) ;) (if_statement if (parenthesized_expression ( (binary_expression (subscript_expression IDENT [ (binary_expression IDENT * LIT) ]) == (char_literal ' escape_sequence ')) )) (goto_statement goto statement_identifier ;)) }) while (parenthesized_expression ( (binary_expression (parenthesized_expression ( (binary_expression (subscript_expression IDENT [ (binary_expression IDENT * LIT) ]) == (char_literal ' character ')) )) && (parenthesized_expression ( (binary_expression (subscript_expression IDENT [ (binary_expression (binary_expression IDENT * LIT) + LIT) ]) == (char_literal ' character ')) ))) )) ;) })) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( (pointer_expression & IDENT) , IDENT , IDENT )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT < LIT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( )))) ;) (if_statement if (parenthesized_expression ( (binary_expression (pointer_expression * IDENT) == LIT) )) (compound_statement { (expression_statement (call_expression IDENT (argument_list ( ))) ;) })) (expression_statement (assignment_expression IDENT = LIT) ;) })) }))) (if_statement if (parenthesized_expression ( (binary_expression IDENT != (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))))) )) (compound_statement { (expression_statement (call_expression IDENT (argument_list ( ))) ;) })) (return_statement return IDENT ;) })))
(function_definition "undefined4 FUN_0001c930(char *param_1,undefined4 param_2)\n\n{\n  int iVar1;\n  int *piVar2;\n  int in_GS_OFFSET;\n  undefined4 local_14;\n  int local_10;\n  undefined4 uStack_c;\n  \n  uStack_c = 0x1c937;\n  local_10 = *(int *)(in_GS_OFFSET + 0x14);\n  if (*param_1 == '\0') {\nLAB_0001c987:\n    local_14 = FUN_0001c830();\n  }\n  else {\n    if ((*param_1 == '%') && (param_1[1] == 's')) {\n      iVar1 = 0;\n      do {\n        iVar1 = iVar1 + 1;\n        if (param_1[iVar1 * 2] == '\0') goto LAB_0001c987;\n      } while ((param_1[iVar1 * 2] == '%') && (param_1[iVar1 * 2 + 1] == 's'));\n    }\n    iVar1 = FUN_0001dd40(&local_14,param_1,param_2);\n    if (iVar1 < 0) {\n      piVar2 = __errno_location();\n      if (*piVar2 == 0xc) {\n                    \n        FUN_0001baf0();\n      }\n      local_14 = 0;\n    }\n  }\n  if (local_10 != *(int *)(in_GS_OFFSET + 0x14)) {\n                    \n    FUN_000214c0();\n  }\n  return local_14;\n}" (type_identifier "undefined4") (function_declarator "FUN_0001c930(char *param_1,undefined4 param_2)" (identifier "FUN_0001c930") (parameter_list "(char *param_1,undefined4 param_2)" (( "(") (parameter_declaration "char *param_1" (primitive_type "char") (pointer_declarator "*param_1" (* "*") (identifier "param_1"))) (, ",") (parameter_declaration "undefined4 param_2" (type_identifier "undefined4") (identifier "param_2")) () ")"))) (compound_statement "{\n  int iVar1;\n  int *piVar2;\n  int in_GS_OFFSET;\n  undefined4 local_14;\n  int local_10;\n  undefined4 uStack_c;\n  \n  uStack_c = 0x1c937;\n  local_10 = *(int *)(in_GS_OFFSET + 0x14);\n  if (*param_1 == '\0') {\nLAB_0001c987:\n    local_14 = FUN_0001c830();\n  }\n  else {\n    if ((*param_1 == '%') && (param_1[1] == 's')) {\n      iVar1 = 0;\n      do {\n        iVar1 = iVar1 + 1;\n        if (param_1[iVar1 * 2] == '\0') goto LAB_0001c987;\n      } while ((param_1[iVar1 * 2] == '%') && (param_1[iVar1 * 2 + 1] == 's'));\n    }\n    iVar1 = FUN_0001dd40(&local_14,param_1,param_2);\n    if (iVar1 < 0) {\n      piVar2 = __errno_location();\n      if (*piVar2 == 0xc) {\n                    \n        FUN_0001baf0();\n      }\n      local_14 = 0;\n    }\n  }\n  if (local_10 != *(int *)(in_GS_OFFSET + 0x14)) {\n                    \n    FUN_000214c0();\n  }\n  return local_14;\n}" ({ "{") (declaration "int iVar1;" (primitive_type "int") (identifier "iVar1") (; ";")) (declaration "int *piVar2;" (primitive_type "int") (pointer_declarator "*piVar2" (* "*") (identifier "piVar2")) (; ";")) (declaration "int in_GS_OFFSET;" (primitive_type "int") (identifier "in_GS_OFFSET") (; ";")) (declaration "undefined4 local_14;" (type_identifier "undefined4") (identifier "local_14") (; ";")) (declaration "int local_10;" (primitive_type "int") (identifier "local_10") (; ";")) (declaration "undefined4 uStack_c;" (type_identifier "undefined4") (identifier "uStack_c") (; ";")) (expression_statement "uStack_c = 0x1c937;" (assignment_expression "uStack_c = 0x1c937" (identifier "uStack_c") (= "=") (number_literal "0x1c937")) (; ";")) (expression_statement "local_10 = *(int *)(in_GS_OFFSET + 0x14);" (assignment_expression "local_10 = *(int *)(in_GS_OFFSET + 0x14)" (identifier "local_10") (= "=") (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" (* "*") (cast_expression "(int *)(in_GS_OFFSET + 0x14)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(in_GS_OFFSET + 0x14)" (( "(") (binary_expression "in_GS_OFFSET + 0x14" (identifier "in_GS_OFFSET") (+ "+") (number_literal "0x14")) () ")"))))) (; ";")) (if_statement "if (*param_1 == '\0') {\nLAB_0001c987:\n    local_14 = FUN_0001c830();\n  }\n  else {\n    if ((*param_1 == '%') && (param_1[1] == 's')) {\n      iVar1 = 0;\n      do {\n        iVar1 = iVar1 + 1;\n        if (param_1[iVar1 * 2] == '\0') goto LAB_0001c987;\n      } while ((param_1[iVar1 * 2] == '%') && (param_1[iVar1 * 2 + 1] == 's'));\n    }\n    iVar1 = FUN_0001dd40(&local_14,param_1,param_2);\n    if (iVar1 < 0) {\n      piVar2 = __errno_location();\n      if (*piVar2 == 0xc) {\n                    \n        FUN_0001baf0();\n      }\n      local_14 = 0;\n    }\n  }" (if "if") (parenthesized_expression "(*param_1 == '\0')" (( "(") (binary_expression "*param_1 == '\0'" (pointer_expression "*param_1" (* "*") (identifier "param_1")) (== "==") (char_literal "'\0'" (' "'") (escape_sequence "\0") (' "'"))) () ")")) (compound_statement "{\nLAB_0001c987:\n    local_14 = FUN_0001c830();\n  }" ({ "{") (labeled_statement "LAB_0001c987:\n    local_14 = FUN_0001c830();" (statement_identifier "LAB_0001c987") (: ":") (expression_statement "local_14 = FUN_0001c830();" (assignment_expression "local_14 = FUN_0001c830()" (identifier "local_14") (= "=") (call_expression "FUN_0001c830()" (identifier "FUN_0001c830") (argument_list "()" (( "(") () ")")))) (; ";"))) (} "}")) (else_clause "else {\n    if ((*param_1 == '%') && (param_1[1] == 's')) {\n      iVar1 = 0;\n      do {\n        iVar1 = iVar1 + 1;\n        if (param_1[iVar1 * 2] == '\0') goto LAB_0001c987;\n      } while ((param_1[iVar1 * 2] == '%') && (param_1[iVar1 * 2 + 1] == 's'));\n    }\n    iVar1 = FUN_0001dd40(&local_14,param_1,param_2);\n    if (iVar1 < 0) {\n      piVar2 = __errno_location();\n      if (*piVar2 == 0xc) {\n                    \n        FUN_0001baf0();\n      }\n      local_14 = 0;\n    }\n  }" (else "else") (compound_statement "{\n    if ((*param_1 == '%') && (param_1[1] == 's')) {\n      iVar1 = 0;\n      do {\n        iVar1 = iVar1 + 1;\n        if (param_1[iVar1 * 2] == '\0') goto LAB_0001c987;\n      } while ((param_1[iVar1 * 2] == '%') && (param_1[iVar1 * 2 + 1] == 's'));\n    }\n    iVar1 = FUN_0001dd40(&local_14,param_1,param_2);\n    if (iVar1 < 0) {\n      piVar2 = __errno_location();\n      if (*piVar2 == 0xc) {\n                    \n        FUN_0001baf0();\n      }\n      local_14 = 0;\n    }\n  }" ({ "{") (if_statement "if ((*param_1 == '%') && (param_1[1] == 's')) {\n      iVar1 = 0;\n      do {\n        iVar1 = iVar1 + 1;\n        if (param_1[iVar1 * 2] == '\0') goto LAB_0001c987;\n      } while ((param_1[iVar1 * 2] == '%') && (param_1[iVar1 * 2 + 1] == 's'));\n    }" (if "if") (parenthesized_expression "((*param_1 == '%') && (param_1[1] == 's'))" (( "(") (binary_expression "(*param_1 == '%') && (param_1[1] == 's')" (parenthesized_expression "(*param_1 == '%')" (( "(") (binary_expression "*param_1 == '%'" (pointer_expression "*param_1" (* "*") (identifier "param_1")) (== "==") (char_literal "'%'" (' "'") (character "%") (' "'"))) () ")")) (&& "&&") (parenthesized_expression "(param_1[1] == 's')" (( "(") (binary_expression "param_1[1] == 's'" (subscript_expression "param_1[1]" (identifier "param_1") ([ "[") (number_literal "1") (] "]")) (== "==") (char_literal "'s'" (' "'") (character "s") (' "'"))) () ")"))) () ")")) (compound_statement "{\n      iVar1 = 0;\n      do {\n        iVar1 = iVar1 + 1;\n        if (param_1[iVar1 * 2] == '\0') goto LAB_0001c987;\n      } while ((param_1[iVar1 * 2] == '%') && (param_1[iVar1 * 2 + 1] == 's'));\n    }" ({ "{") (expression_statement "iVar1 = 0;" (assignment_expression "iVar1 = 0" (identifier "iVar1") (= "=") (number_literal "0")) (; ";")) (do_statement "do {\n        iVar1 = iVar1 + 1;\n        if (param_1[iVar1 * 2] == '\0') goto LAB_0001c987;\n      } while ((param_1[iVar1 * 2] == '%') && (param_1[iVar1 * 2 + 1] == 's'));" (do "do") (compound_statement "{\n        iVar1 = iVar1 + 1;\n        if (param_1[iVar1 * 2] == '\0') goto LAB_0001c987;\n      }" ({ "{") (expression_statement "iVar1 = iVar1 + 1;" (assignment_expression "iVar1 = iVar1 + 1" (identifier "iVar1") (= "=") (binary_expression "iVar1 + 1" (identifier "iVar1") (+ "+") (number_literal "1"))) (; ";")) (if_statement "if (param_1[iVar1 * 2] == '\0') goto LAB_0001c987;" (if "if") (parenthesized_expression "(param_1[iVar1 * 2] == '\0')" (( "(") (binary_expression "param_1[iVar1 * 2] == '\0'" (subscript_expression "param_1[iVar1 * 2]" (identifier "param_1") ([ "[") (binary_expression "iVar1 * 2" (identifier "iVar1") (* "*") (number_literal "2")) (] "]")) (== "==") (char_literal "'\0'" (' "'") (escape_sequence "\0") (' "'"))) () ")")) (goto_statement "goto LAB_0001c987;" (goto "goto") (statement_identifier "LAB_0001c987") (; ";"))) (} "}")) (while "while") (parenthesized_expression "((param_1[iVar1 * 2] == '%') && (param_1[iVar1 * 2 + 1] == 's'))" (( "(") (binary_expression "(param_1[iVar1 * 2] == '%') && (param_1[iVar1 * 2 + 1] == 's')" (parenthesized_expression "(param_1[iVar1 * 2] == '%')" (( "(") (binary_expression "param_1[iVar1 * 2] == '%'" (subscript_expression "param_1[iVar1 * 2]" (identifier "param_1") ([ "[") (binary_expression "iVar1 * 2" (identifier "iVar1") (* "*") (number_literal "2")) (] "]")) (== "==") (char_literal "'%'" (' "'") (character "%") (' "'"))) () ")")) (&& "&&") (parenthesized_expression "(param_1[iVar1 * 2 + 1] == 's')" (( "(") (binary_expression "param_1[iVar1 * 2 + 1] == 's'" (subscript_expression "param_1[iVar1 * 2 + 1]" (identifier "param_1") ([ "[") (binary_expression "iVar1 * 2 + 1" (binary_expression "iVar1 * 2" (identifier "iVar1") (* "*") (number_literal "2")) (+ "+") (number_literal "1")) (] "]")) (== "==") (char_literal "'s'" (' "'") (character "s") (' "'"))) () ")"))) () ")")) (; ";")) (} "}"))) (expression_statement "iVar1 = FUN_0001dd40(&local_14,param_1,param_2);" (assignment_expression "iVar1 = FUN_0001dd40(&local_14,param_1,param_2)" (identifier "iVar1") (= "=") (call_expression "FUN_0001dd40(&local_14,param_1,param_2)" (identifier "FUN_0001dd40") (argument_list "(&local_14,param_1,param_2)" (( "(") (pointer_expression "&local_14" (& "&") (identifier "local_14")) (, ",") (identifier "param_1") (, ",") (identifier "param_2") () ")")))) (; ";")) (if_statement "if (iVar1 < 0) {\n      piVar2 = __errno_location();\n      if (*piVar2 == 0xc) {\n                    \n        FUN_0001baf0();\n      }\n      local_14 = 0;\n    }" (if "if") (parenthesized_expression "(iVar1 < 0)" (( "(") (binary_expression "iVar1 < 0" (identifier "iVar1") (< "<") (number_literal "0")) () ")")) (compound_statement "{\n      piVar2 = __errno_location();\n      if (*piVar2 == 0xc) {\n                    \n        FUN_0001baf0();\n      }\n      local_14 = 0;\n    }" ({ "{") (expression_statement "piVar2 = __errno_location();" (assignment_expression "piVar2 = __errno_location()" (identifier "piVar2") (= "=") (call_expression "__errno_location()" (identifier "__errno_location") (argument_list "()" (( "(") () ")")))) (; ";")) (if_statement "if (*piVar2 == 0xc) {\n                    \n        FUN_0001baf0();\n      }" (if "if") (parenthesized_expression "(*piVar2 == 0xc)" (( "(") (binary_expression "*piVar2 == 0xc" (pointer_expression "*piVar2" (* "*") (identifier "piVar2")) (== "==") (number_literal "0xc")) () ")")) (compound_statement "{\n                    \n        FUN_0001baf0();\n      }" ({ "{") (expression_statement "FUN_0001baf0();" (call_expression "FUN_0001baf0()" (identifier "FUN_0001baf0") (argument_list "()" (( "(") () ")"))) (; ";")) (} "}"))) (expression_statement "local_14 = 0;" (assignment_expression "local_14 = 0" (identifier "local_14") (= "=") (number_literal "0")) (; ";")) (} "}"))) (} "}")))) (if_statement "if (local_10 != *(int *)(in_GS_OFFSET + 0x14)) {\n                    \n    FUN_000214c0();\n  }" (if "if") (parenthesized_expression "(local_10 != *(int *)(in_GS_OFFSET + 0x14))" (( "(") (binary_expression "local_10 != *(int *)(in_GS_OFFSET + 0x14)" (identifier "local_10") (!= "!=") (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" (* "*") (cast_expression "(int *)(in_GS_OFFSET + 0x14)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(in_GS_OFFSET + 0x14)" (( "(") (binary_expression "in_GS_OFFSET + 0x14" (identifier "in_GS_OFFSET") (+ "+") (number_literal "0x14")) () ")"))))) () ")")) (compound_statement "{\n                    \n    FUN_000214c0();\n  }" ({ "{") (expression_statement "FUN_000214c0();" (call_expression "FUN_000214c0()" (identifier "FUN_000214c0") (argument_list "()" (( "(") () ")"))) (; ";")) (} "}"))) (return_statement "return local_14;" (return "return") (identifier "local_14") (; ";")) (} "}")))

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

char * function_1(char *format,type_1 args)

{
  size_t var_3;
  int var_5;
  int *piVar2;
  int var_1;
  char *result;
  int var_8;
  type_2 uStack_c;
  
  uStack_c = 0x1c937;
  var_8 = *(int *)(var_1 + 0x14);
  if (*format == '\0') {
    var_3 = 0;
LAB_0001c987:
    result = var_2(var_3,args);
  }
  else {
    if ((*format == '%') && (format[1] == 's')) {
      var_3 = 0;
      do {
        var_3 = var_3 + 1;
        if (format[var_3 * 2] == '\0') goto LAB_0001c987;
      } while ((format[var_3 * 2] == '%') && (format[var_3 * 2 + 1] == 's'));
    }
    var_5 = var_4(&result,format,args);
    if (var_5 < 0) {
      piVar2 = var_6();
      if (*piVar2 == 0xc) {
                    /* WARNING: Subroutine does not return */
        var_7();
      }
      result = (char *)0x0;
    }
  }
  if (var_8 == *(int *)(var_1 + 0x14)) {
    return result;
  }
                    /* WARNING: Subroutine does not return */
  var_9();
}


(translation_unit (function_definition type: (type_identifier) declarator: (function_declarator declarator: (identifier) parameters: (parameter_list (parameter_declaration type: (primitive_type) declarator: (pointer_declarator declarator: (identifier))) (parameter_declaration type: (type_identifier) declarator: (identifier)))) body: (compound_statement (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: (identifier)) (declaration type: (primitive_type) declarator: (identifier)) (declaration type: (type_identifier) declarator: (identifier)) (expression_statement (assignment_expression left: (identifier) right: (number_literal))) (expression_statement (assignment_expression left: (identifier) right: (pointer_expression argument: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))))))) (if_statement condition: (parenthesized_expression (binary_expression left: (pointer_expression argument: (identifier)) right: (char_literal (escape_sequence)))) consequence: (compound_statement (labeled_statement label: (statement_identifier) (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list)))))) alternative: (else_clause (compound_statement (if_statement condition: (parenthesized_expression (binary_expression left: (parenthesized_expression (binary_expression left: (pointer_expression argument: (identifier)) right: (char_literal (character)))) right: (parenthesized_expression (binary_expression left: (subscript_expression argument: (identifier) index: (number_literal)) right: (char_literal (character)))))) consequence: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (number_literal))) (do_statement body: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (number_literal)))) (if_statement condition: (parenthesized_expression (binary_expression left: (subscript_expression argument: (identifier) index: (binary_expression left: (identifier) right: (number_literal))) right: (char_literal (escape_sequence)))) consequence: (goto_statement label: (statement_identifier)))) condition: (parenthesized_expression (binary_expression left: (parenthesized_expression (binary_expression left: (subscript_expression argument: (identifier) index: (binary_expression left: (identifier) right: (number_literal))) right: (char_literal (character)))) right: (parenthesized_expression (binary_expression left: (subscript_expression argument: (identifier) index: (binary_expression left: (binary_expression left: (identifier) right: (number_literal)) right: (number_literal))) right: (char_literal (character))))))))) (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (pointer_expression argument: (identifier)) (identifier) (identifier))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list)))) (if_statement condition: (parenthesized_expression (binary_expression left: (pointer_expression argument: (identifier)) right: (number_literal))) consequence: (compound_statement (expression_statement (call_expression function: (identifier) arguments: (argument_list))))) (expression_statement (assignment_expression left: (identifier) right: (number_literal)))))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (pointer_expression argument: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))))))) consequence: (compound_statement (expression_statement (call_expression function: (identifier) arguments: (argument_list))))) (return_statement (identifier)))))

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

undefined4 MASKED(char *param_1,undefined4 param_2)

{
  int iVar1;
  int *piVar2;
  int in_GS_OFFSET;
  undefined4 local_14;
  int local_10;
  undefined4 uStack_c;
  
  uStack_c = 0x1c937;
  local_10 = *(int *)(in_GS_OFFSET + 0x14);
  if (*param_1 == '\0') {
LAB_0001c987:
    local_14 = FUN_0001c830();
  }
  else {
    if ((*param_1 == '%') && (param_1[1] == 's')) {
      iVar1 = 0;
      do {
        iVar1 = iVar1 + 1;
        if (param_1[iVar1 * 2] == '\0') goto LAB_0001c987;
      } while ((param_1[iVar1 * 2] == '%') && (param_1[iVar1 * 2 + 1] == 's'));
    }
    iVar1 = FUN_0001dd40(&local_14,param_1,param_2);
    if (iVar1 < 0) {
      piVar2 = __errno_location();
      if (*piVar2 == 0xc) {
                    /* WARNING: Subroutine does not return */
        FUN_0001baf0();
      }
      local_14 = 0;
    }
  }
  if (local_10 != *(int *)(in_GS_OFFSET + 0x14)) {
                    /* WARNING: Subroutine does not return */
    FUN_000214c0();
  }
  return local_14;
}

