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

char * parse_gnu_debugaltlink(dwarf_section *section,void *data)

{
  uint uVar1;
  uint __maxlen;
  uchar *__string;
  int iVar2;
  size_t sVar3;
  uint *puVar4;
  uint uVar5;
  
  __maxlen = (uint)section->size;
  __string = section->start;
  iVar2 = *(int *)((int)&section->size + 4);
  sVar3 = strnlen((char *)__string,__maxlen);
  uVar1 = sVar3 + 1;
  if (iVar2 != 0 || (uint)-iVar2 < (uint)(uVar1 < __maxlen)) {
    uVar5 = iVar2 - (uint)(__maxlen < uVar1);
    if (uVar5 != 0 || -uVar5 < (uint)(0x13 < __maxlen - uVar1)) {
      puVar4 = (uint *)calloc(1,0xc);
      if (puVar4 != (uint *)0x0) {
        *puVar4 = __maxlen - uVar1;
        puVar4[1] = uVar5;
        puVar4[2] = (uint)(__string + uVar1);
        *(uint **)data = puVar4;
        return (char *)__string;
      }
    }
  }
  return (char *)0x0;
}



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

char * FUN_0004cab0(int param_1,undefined4 *param_2)

{
  uint uVar1;
  uint __maxlen;
  char *__string;
  int iVar2;
  size_t sVar3;
  uint *puVar4;
  uint uVar5;
  
  __maxlen = *(uint *)(param_1 + 0x1c);
  __string = *(char **)(param_1 + 0x10);
  iVar2 = *(int *)(param_1 + 0x20);
  sVar3 = strnlen(__string,__maxlen);
  uVar1 = sVar3 + 1;
  if (iVar2 != 0 || (uint)-iVar2 < (uint)(uVar1 < __maxlen)) {
    uVar5 = iVar2 - (uint)(__maxlen < uVar1);
    if (uVar5 != 0 || -uVar5 < (uint)(0x13 < __maxlen - uVar1)) {
      puVar4 = (uint *)calloc(1,0xc);
      if (puVar4 != (uint *)0x0) {
        *puVar4 = __maxlen - uVar1;
        puVar4[1] = uVar5;
        puVar4[2] = (uint)(__string + uVar1);
        *param_2 = puVar4;
        return __string;
      }
    }
  }
  return (char *)0x0;
}


PUSH EBP
PUSH EDI
PUSH ESI
PUSH EBX
CALL 0x00013f70
ADD EBX,0x67547
SUB ESP,0x24
MOV EAX,dword ptr [ESP + 0x38]
MOV ESI,dword ptr [EAX + 0x1c]
MOV EBP,dword ptr [EAX + 0x10]
MOV dword ptr [ESP + 0x10],EBX
MOV EDI,dword ptr [EAX + 0x20]
PUSH ESI
PUSH EBP
CALL 0x00013310
XOR EBX,EBX
ADD ESP,0x10
LEA EDX,[EAX + 0x1]
MOV EAX,EBX
CMP EDX,ESI
SBB EAX,EDI
JNC 0x0004cb40
SUB ESI,EDX
MOV EAX,0x13
MOV dword ptr [ESP + 0xc],EDX
SBB EDI,EBX
CMP EAX,ESI
MOV EAX,0x0
SBB EAX,EDI
JNC 0x0004cb40
SUB ESP,0x8
PUSH 0xc
PUSH 0x1
MOV EBX,dword ptr [ESP + 0x18]
CALL 0x00013430
ADD ESP,0x10
TEST EAX,EAX
JZ 0x0004cb40
MOV EDX,dword ptr [ESP + 0xc]
MOV dword ptr [EAX],ESI
MOV dword ptr [EAX + 0x4],EDI
ADD EDX,EBP
MOV dword ptr [EAX + 0x8],EDX
MOV EDX,dword ptr [ESP + 0x34]
MOV dword ptr [EDX],EAX
ADD ESP,0x1c
MOV EAX,EBP
POP EBX
POP ESI
POP EDI
POP EBP
RET
ADD ESP,0x1c
XOR EBP,EBP
POP EBX
MOV EAX,EBP
POP ESI
POP EDI
POP EBP
RET
(translation_unit "/* WARNING: Function: __i686.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n\nchar * FUN_0004cab0(int param_1,undefined4 *param_2)\n\n{\n  uint uVar1;\n  uint __maxlen;\n  char *__string;\n  int iVar2;\n  size_t sVar3;\n  uint *puVar4;\n  uint uVar5;\n  \n  __maxlen = *(uint *)(param_1 + 0x1c);\n  __string = *(char **)(param_1 + 0x10);\n  iVar2 = *(int *)(param_1 + 0x20);\n  sVar3 = strnlen(__string,__maxlen);\n  uVar1 = sVar3 + 1;\n  if (iVar2 != 0 || (uint)-iVar2 < (uint)(uVar1 < __maxlen)) {\n    uVar5 = iVar2 - (uint)(__maxlen < uVar1);\n    if (uVar5 != 0 || -uVar5 < (uint)(0x13 < __maxlen - uVar1)) {\n      puVar4 = (uint *)calloc(1,0xc);\n      if (puVar4 != (uint *)0x0) {\n        *puVar4 = __maxlen - uVar1;\n        puVar4[1] = uVar5;\n        puVar4[2] = (uint)(__string + uVar1);\n        *param_2 = puVar4;\n        return __string;\n      }\n    }\n  }\n  return (char *)0x0;\n}\n\n" comment (function_definition "char * FUN_0004cab0(int param_1,undefined4 *param_2)\n\n{\n  uint uVar1;\n  uint __maxlen;\n  char *__string;\n  int iVar2;\n  size_t sVar3;\n  uint *puVar4;\n  uint uVar5;\n  \n  __maxlen = *(uint *)(param_1 + 0x1c);\n  __string = *(char **)(param_1 + 0x10);\n  iVar2 = *(int *)(param_1 + 0x20);\n  sVar3 = strnlen(__string,__maxlen);\n  uVar1 = sVar3 + 1;\n  if (iVar2 != 0 || (uint)-iVar2 < (uint)(uVar1 < __maxlen)) {\n    uVar5 = iVar2 - (uint)(__maxlen < uVar1);\n    if (uVar5 != 0 || -uVar5 < (uint)(0x13 < __maxlen - uVar1)) {\n      puVar4 = (uint *)calloc(1,0xc);\n      if (puVar4 != (uint *)0x0) {\n        *puVar4 = __maxlen - uVar1;\n        puVar4[1] = uVar5;\n        puVar4[2] = (uint)(__string + uVar1);\n        *param_2 = puVar4;\n        return __string;\n      }\n    }\n  }\n  return (char *)0x0;\n}" primitive_type (pointer_declarator "* FUN_0004cab0(int param_1,undefined4 *param_2)" * (function_declarator "FUN_0004cab0(int param_1,undefined4 *param_2)" identifier (parameter_list "(int param_1,undefined4 *param_2)" ( (parameter_declaration "int param_1" primitive_type identifier) , (parameter_declaration "undefined4 *param_2" type_identifier (pointer_declarator "*param_2" * identifier)) )))) (compound_statement "{\n  uint uVar1;\n  uint __maxlen;\n  char *__string;\n  int iVar2;\n  size_t sVar3;\n  uint *puVar4;\n  uint uVar5;\n  \n  __maxlen = *(uint *)(param_1 + 0x1c);\n  __string = *(char **)(param_1 + 0x10);\n  iVar2 = *(int *)(param_1 + 0x20);\n  sVar3 = strnlen(__string,__maxlen);\n  uVar1 = sVar3 + 1;\n  if (iVar2 != 0 || (uint)-iVar2 < (uint)(uVar1 < __maxlen)) {\n    uVar5 = iVar2 - (uint)(__maxlen < uVar1);\n    if (uVar5 != 0 || -uVar5 < (uint)(0x13 < __maxlen - uVar1)) {\n      puVar4 = (uint *)calloc(1,0xc);\n      if (puVar4 != (uint *)0x0) {\n        *puVar4 = __maxlen - uVar1;\n        puVar4[1] = uVar5;\n        puVar4[2] = (uint)(__string + uVar1);\n        *param_2 = puVar4;\n        return __string;\n      }\n    }\n  }\n  return (char *)0x0;\n}" { (declaration "uint uVar1;" type_identifier identifier ;) (declaration "uint __maxlen;" type_identifier identifier ;) (declaration "char *__string;" primitive_type (pointer_declarator "*__string" * identifier) ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "size_t sVar3;" primitive_type identifier ;) (declaration "uint *puVar4;" type_identifier (pointer_declarator "*puVar4" * identifier) ;) (declaration "uint uVar5;" type_identifier identifier ;) (expression_statement "__maxlen = *(uint *)(param_1 + 0x1c);" (assignment_expression "__maxlen = *(uint *)(param_1 + 0x1c)" identifier = (pointer_expression "*(uint *)(param_1 + 0x1c)" * (cast_expression "(uint *)(param_1 + 0x1c)" ( (type_descriptor "uint *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x1c)" ( (binary_expression "param_1 + 0x1c" identifier + number_literal) ))))) ;) (expression_statement "__string = *(char **)(param_1 + 0x10);" (assignment_expression "__string = *(char **)(param_1 + 0x10)" identifier = (pointer_expression "*(char **)(param_1 + 0x10)" * (cast_expression "(char **)(param_1 + 0x10)" ( (type_descriptor "char **" primitive_type (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(param_1 + 0x10)" ( (binary_expression "param_1 + 0x10" identifier + number_literal) ))))) ;) (expression_statement "iVar2 = *(int *)(param_1 + 0x20);" (assignment_expression "iVar2 = *(int *)(param_1 + 0x20)" identifier = (pointer_expression "*(int *)(param_1 + 0x20)" * (cast_expression "(int *)(param_1 + 0x20)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x20)" ( (binary_expression "param_1 + 0x20" identifier + number_literal) ))))) ;) (expression_statement "sVar3 = strnlen(__string,__maxlen);" (assignment_expression "sVar3 = strnlen(__string,__maxlen)" identifier = (call_expression "strnlen(__string,__maxlen)" identifier (argument_list "(__string,__maxlen)" ( identifier , identifier )))) ;) (expression_statement "uVar1 = sVar3 + 1;" (assignment_expression "uVar1 = sVar3 + 1" identifier = (binary_expression "sVar3 + 1" identifier + number_literal)) ;) (if_statement "if (iVar2 != 0 || (uint)-iVar2 < (uint)(uVar1 < __maxlen)) {\n    uVar5 = iVar2 - (uint)(__maxlen < uVar1);\n    if (uVar5 != 0 || -uVar5 < (uint)(0x13 < __maxlen - uVar1)) {\n      puVar4 = (uint *)calloc(1,0xc);\n      if (puVar4 != (uint *)0x0) {\n        *puVar4 = __maxlen - uVar1;\n        puVar4[1] = uVar5;\n        puVar4[2] = (uint)(__string + uVar1);\n        *param_2 = puVar4;\n        return __string;\n      }\n    }\n  }" if (parenthesized_expression "(iVar2 != 0 || (uint)-iVar2 < (uint)(uVar1 < __maxlen))" ( (binary_expression "iVar2 != 0 || (uint)-iVar2 < (uint)(uVar1 < __maxlen)" (binary_expression "iVar2 != 0" identifier != number_literal) || (binary_expression "(uint)-iVar2 < (uint)(uVar1 < __maxlen)" (binary_expression "(uint)-iVar2" (parenthesized_expression "(uint)" ( identifier )) - identifier) < (call_expression "(uint)(uVar1 < __maxlen)" (parenthesized_expression "(uint)" ( identifier )) (argument_list "(uVar1 < __maxlen)" ( (binary_expression "uVar1 < __maxlen" identifier < identifier) ))))) )) (compound_statement "{\n    uVar5 = iVar2 - (uint)(__maxlen < uVar1);\n    if (uVar5 != 0 || -uVar5 < (uint)(0x13 < __maxlen - uVar1)) {\n      puVar4 = (uint *)calloc(1,0xc);\n      if (puVar4 != (uint *)0x0) {\n        *puVar4 = __maxlen - uVar1;\n        puVar4[1] = uVar5;\n        puVar4[2] = (uint)(__string + uVar1);\n        *param_2 = puVar4;\n        return __string;\n      }\n    }\n  }" { (expression_statement "uVar5 = iVar2 - (uint)(__maxlen < uVar1);" (assignment_expression "uVar5 = iVar2 - (uint)(__maxlen < uVar1)" identifier = (binary_expression "iVar2 - (uint)(__maxlen < uVar1)" identifier - (call_expression "(uint)(__maxlen < uVar1)" (parenthesized_expression "(uint)" ( identifier )) (argument_list "(__maxlen < uVar1)" ( (binary_expression "__maxlen < uVar1" identifier < identifier) ))))) ;) (if_statement "if (uVar5 != 0 || -uVar5 < (uint)(0x13 < __maxlen - uVar1)) {\n      puVar4 = (uint *)calloc(1,0xc);\n      if (puVar4 != (uint *)0x0) {\n        *puVar4 = __maxlen - uVar1;\n        puVar4[1] = uVar5;\n        puVar4[2] = (uint)(__string + uVar1);\n        *param_2 = puVar4;\n        return __string;\n      }\n    }" if (parenthesized_expression "(uVar5 != 0 || -uVar5 < (uint)(0x13 < __maxlen - uVar1))" ( (binary_expression "uVar5 != 0 || -uVar5 < (uint)(0x13 < __maxlen - uVar1)" (binary_expression "uVar5 != 0" identifier != number_literal) || (binary_expression "-uVar5 < (uint)(0x13 < __maxlen - uVar1)" (unary_expression "-uVar5" - identifier) < (call_expression "(uint)(0x13 < __maxlen - uVar1)" (parenthesized_expression "(uint)" ( identifier )) (argument_list "(0x13 < __maxlen - uVar1)" ( (binary_expression "0x13 < __maxlen - uVar1" number_literal < (binary_expression "__maxlen - uVar1" identifier - identifier)) ))))) )) (compound_statement "{\n      puVar4 = (uint *)calloc(1,0xc);\n      if (puVar4 != (uint *)0x0) {\n        *puVar4 = __maxlen - uVar1;\n        puVar4[1] = uVar5;\n        puVar4[2] = (uint)(__string + uVar1);\n        *param_2 = puVar4;\n        return __string;\n      }\n    }" { (expression_statement "puVar4 = (uint *)calloc(1,0xc);" (assignment_expression "puVar4 = (uint *)calloc(1,0xc)" identifier = (cast_expression "(uint *)calloc(1,0xc)" ( (type_descriptor "uint *" type_identifier (abstract_pointer_declarator "*" *)) ) (call_expression "calloc(1,0xc)" identifier (argument_list "(1,0xc)" ( number_literal , number_literal ))))) ;) (if_statement "if (puVar4 != (uint *)0x0) {\n        *puVar4 = __maxlen - uVar1;\n        puVar4[1] = uVar5;\n        puVar4[2] = (uint)(__string + uVar1);\n        *param_2 = puVar4;\n        return __string;\n      }" if (parenthesized_expression "(puVar4 != (uint *)0x0)" ( (binary_expression "puVar4 != (uint *)0x0" identifier != (cast_expression "(uint *)0x0" ( (type_descriptor "uint *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n        *puVar4 = __maxlen - uVar1;\n        puVar4[1] = uVar5;\n        puVar4[2] = (uint)(__string + uVar1);\n        *param_2 = puVar4;\n        return __string;\n      }" { (expression_statement "*puVar4 = __maxlen - uVar1;" (assignment_expression "*puVar4 = __maxlen - uVar1" (pointer_expression "*puVar4" * identifier) = (binary_expression "__maxlen - uVar1" identifier - identifier)) ;) (expression_statement "puVar4[1] = uVar5;" (assignment_expression "puVar4[1] = uVar5" (subscript_expression "puVar4[1]" identifier [ number_literal ]) = identifier) ;) (expression_statement "puVar4[2] = (uint)(__string + uVar1);" (assignment_expression "puVar4[2] = (uint)(__string + uVar1)" (subscript_expression "puVar4[2]" identifier [ number_literal ]) = (call_expression "(uint)(__string + uVar1)" (parenthesized_expression "(uint)" ( identifier )) (argument_list "(__string + uVar1)" ( (binary_expression "__string + uVar1" identifier + identifier) )))) ;) (expression_statement "*param_2 = puVar4;" (assignment_expression "*param_2 = puVar4" (pointer_expression "*param_2" * identifier) = identifier) ;) (return_statement "return __string;" return identifier ;) })) })) })) (return_statement "return (char *)0x0;" return (cast_expression "(char *)0x0" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal) ;) })))
(translation_unit "/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n/* WARNING: Unknown calling convention */\n\nchar * parse_gnu_debugaltlink(dwarf_section *section,void *data)\n\n{\n  uint uVar1;\n  uint __maxlen;\n  uchar *__string;\n  int iVar2;\n  size_t sVar3;\n  uint *puVar4;\n  uint uVar5;\n  \n  __maxlen = (uint)section->size;\n  __string = section->start;\n  iVar2 = *(int *)((int)&section->size + 4);\n  sVar3 = strnlen((char *)__string,__maxlen);\n  uVar1 = sVar3 + 1;\n  if (iVar2 != 0 || (uint)-iVar2 < (uint)(uVar1 < __maxlen)) {\n    uVar5 = iVar2 - (uint)(__maxlen < uVar1);\n    if (uVar5 != 0 || -uVar5 < (uint)(0x13 < __maxlen - uVar1)) {\n      puVar4 = (uint *)calloc(1,0xc);\n      if (puVar4 != (uint *)0x0) {\n        *puVar4 = __maxlen - uVar1;\n        puVar4[1] = uVar5;\n        puVar4[2] = (uint)(__string + uVar1);\n        *(uint **)data = puVar4;\n        return (char *)__string;\n      }\n    }\n  }\n  return (char *)0x0;\n}\n\n" comment comment (function_definition "char * parse_gnu_debugaltlink(dwarf_section *section,void *data)\n\n{\n  uint uVar1;\n  uint __maxlen;\n  uchar *__string;\n  int iVar2;\n  size_t sVar3;\n  uint *puVar4;\n  uint uVar5;\n  \n  __maxlen = (uint)section->size;\n  __string = section->start;\n  iVar2 = *(int *)((int)&section->size + 4);\n  sVar3 = strnlen((char *)__string,__maxlen);\n  uVar1 = sVar3 + 1;\n  if (iVar2 != 0 || (uint)-iVar2 < (uint)(uVar1 < __maxlen)) {\n    uVar5 = iVar2 - (uint)(__maxlen < uVar1);\n    if (uVar5 != 0 || -uVar5 < (uint)(0x13 < __maxlen - uVar1)) {\n      puVar4 = (uint *)calloc(1,0xc);\n      if (puVar4 != (uint *)0x0) {\n        *puVar4 = __maxlen - uVar1;\n        puVar4[1] = uVar5;\n        puVar4[2] = (uint)(__string + uVar1);\n        *(uint **)data = puVar4;\n        return (char *)__string;\n      }\n    }\n  }\n  return (char *)0x0;\n}" primitive_type (pointer_declarator "* parse_gnu_debugaltlink(dwarf_section *section,void *data)" * (function_declarator "parse_gnu_debugaltlink(dwarf_section *section,void *data)" identifier (parameter_list "(dwarf_section *section,void *data)" ( (parameter_declaration "dwarf_section *section" type_identifier (pointer_declarator "*section" * identifier)) , (parameter_declaration "void *data" primitive_type (pointer_declarator "*data" * identifier)) )))) (compound_statement "{\n  uint uVar1;\n  uint __maxlen;\n  uchar *__string;\n  int iVar2;\n  size_t sVar3;\n  uint *puVar4;\n  uint uVar5;\n  \n  __maxlen = (uint)section->size;\n  __string = section->start;\n  iVar2 = *(int *)((int)&section->size + 4);\n  sVar3 = strnlen((char *)__string,__maxlen);\n  uVar1 = sVar3 + 1;\n  if (iVar2 != 0 || (uint)-iVar2 < (uint)(uVar1 < __maxlen)) {\n    uVar5 = iVar2 - (uint)(__maxlen < uVar1);\n    if (uVar5 != 0 || -uVar5 < (uint)(0x13 < __maxlen - uVar1)) {\n      puVar4 = (uint *)calloc(1,0xc);\n      if (puVar4 != (uint *)0x0) {\n        *puVar4 = __maxlen - uVar1;\n        puVar4[1] = uVar5;\n        puVar4[2] = (uint)(__string + uVar1);\n        *(uint **)data = puVar4;\n        return (char *)__string;\n      }\n    }\n  }\n  return (char *)0x0;\n}" { (declaration "uint uVar1;" type_identifier identifier ;) (declaration "uint __maxlen;" type_identifier identifier ;) (declaration "uchar *__string;" type_identifier (pointer_declarator "*__string" * identifier) ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "size_t sVar3;" primitive_type identifier ;) (declaration "uint *puVar4;" type_identifier (pointer_declarator "*puVar4" * identifier) ;) (declaration "uint uVar5;" type_identifier identifier ;) (expression_statement "__maxlen = (uint)section->size;" (assignment_expression "__maxlen = (uint)section->size" identifier = (cast_expression "(uint)section->size" ( (type_descriptor "uint" type_identifier) ) (field_expression "section->size" identifier -> field_identifier))) ;) (expression_statement "__string = section->start;" (assignment_expression "__string = section->start" identifier = (field_expression "section->start" identifier -> field_identifier)) ;) (expression_statement "iVar2 = *(int *)((int)&section->size + 4);" (assignment_expression "iVar2 = *(int *)((int)&section->size + 4)" identifier = (pointer_expression "*(int *)((int)&section->size + 4)" * (cast_expression "(int *)((int)&section->size + 4)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((int)&section->size + 4)" ( (binary_expression "(int)&section->size + 4" (cast_expression "(int)&section->size" ( (type_descriptor "int" primitive_type) ) (pointer_expression "&section->size" & (field_expression "section->size" identifier -> field_identifier))) + number_literal) ))))) ;) (expression_statement "sVar3 = strnlen((char *)__string,__maxlen);" (assignment_expression "sVar3 = strnlen((char *)__string,__maxlen)" identifier = (call_expression "strnlen((char *)__string,__maxlen)" identifier (argument_list "((char *)__string,__maxlen)" ( (cast_expression "(char *)__string" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) identifier) , identifier )))) ;) (expression_statement "uVar1 = sVar3 + 1;" (assignment_expression "uVar1 = sVar3 + 1" identifier = (binary_expression "sVar3 + 1" identifier + number_literal)) ;) (if_statement "if (iVar2 != 0 || (uint)-iVar2 < (uint)(uVar1 < __maxlen)) {\n    uVar5 = iVar2 - (uint)(__maxlen < uVar1);\n    if (uVar5 != 0 || -uVar5 < (uint)(0x13 < __maxlen - uVar1)) {\n      puVar4 = (uint *)calloc(1,0xc);\n      if (puVar4 != (uint *)0x0) {\n        *puVar4 = __maxlen - uVar1;\n        puVar4[1] = uVar5;\n        puVar4[2] = (uint)(__string + uVar1);\n        *(uint **)data = puVar4;\n        return (char *)__string;\n      }\n    }\n  }" if (parenthesized_expression "(iVar2 != 0 || (uint)-iVar2 < (uint)(uVar1 < __maxlen))" ( (binary_expression "iVar2 != 0 || (uint)-iVar2 < (uint)(uVar1 < __maxlen)" (binary_expression "iVar2 != 0" identifier != number_literal) || (binary_expression "(uint)-iVar2 < (uint)(uVar1 < __maxlen)" (binary_expression "(uint)-iVar2" (parenthesized_expression "(uint)" ( identifier )) - identifier) < (call_expression "(uint)(uVar1 < __maxlen)" (parenthesized_expression "(uint)" ( identifier )) (argument_list "(uVar1 < __maxlen)" ( (binary_expression "uVar1 < __maxlen" identifier < identifier) ))))) )) (compound_statement "{\n    uVar5 = iVar2 - (uint)(__maxlen < uVar1);\n    if (uVar5 != 0 || -uVar5 < (uint)(0x13 < __maxlen - uVar1)) {\n      puVar4 = (uint *)calloc(1,0xc);\n      if (puVar4 != (uint *)0x0) {\n        *puVar4 = __maxlen - uVar1;\n        puVar4[1] = uVar5;\n        puVar4[2] = (uint)(__string + uVar1);\n        *(uint **)data = puVar4;\n        return (char *)__string;\n      }\n    }\n  }" { (expression_statement "uVar5 = iVar2 - (uint)(__maxlen < uVar1);" (assignment_expression "uVar5 = iVar2 - (uint)(__maxlen < uVar1)" identifier = (binary_expression "iVar2 - (uint)(__maxlen < uVar1)" identifier - (call_expression "(uint)(__maxlen < uVar1)" (parenthesized_expression "(uint)" ( identifier )) (argument_list "(__maxlen < uVar1)" ( (binary_expression "__maxlen < uVar1" identifier < identifier) ))))) ;) (if_statement "if (uVar5 != 0 || -uVar5 < (uint)(0x13 < __maxlen - uVar1)) {\n      puVar4 = (uint *)calloc(1,0xc);\n      if (puVar4 != (uint *)0x0) {\n        *puVar4 = __maxlen - uVar1;\n        puVar4[1] = uVar5;\n        puVar4[2] = (uint)(__string + uVar1);\n        *(uint **)data = puVar4;\n        return (char *)__string;\n      }\n    }" if (parenthesized_expression "(uVar5 != 0 || -uVar5 < (uint)(0x13 < __maxlen - uVar1))" ( (binary_expression "uVar5 != 0 || -uVar5 < (uint)(0x13 < __maxlen - uVar1)" (binary_expression "uVar5 != 0" identifier != number_literal) || (binary_expression "-uVar5 < (uint)(0x13 < __maxlen - uVar1)" (unary_expression "-uVar5" - identifier) < (call_expression "(uint)(0x13 < __maxlen - uVar1)" (parenthesized_expression "(uint)" ( identifier )) (argument_list "(0x13 < __maxlen - uVar1)" ( (binary_expression "0x13 < __maxlen - uVar1" number_literal < (binary_expression "__maxlen - uVar1" identifier - identifier)) ))))) )) (compound_statement "{\n      puVar4 = (uint *)calloc(1,0xc);\n      if (puVar4 != (uint *)0x0) {\n        *puVar4 = __maxlen - uVar1;\n        puVar4[1] = uVar5;\n        puVar4[2] = (uint)(__string + uVar1);\n        *(uint **)data = puVar4;\n        return (char *)__string;\n      }\n    }" { (expression_statement "puVar4 = (uint *)calloc(1,0xc);" (assignment_expression "puVar4 = (uint *)calloc(1,0xc)" identifier = (cast_expression "(uint *)calloc(1,0xc)" ( (type_descriptor "uint *" type_identifier (abstract_pointer_declarator "*" *)) ) (call_expression "calloc(1,0xc)" identifier (argument_list "(1,0xc)" ( number_literal , number_literal ))))) ;) (if_statement "if (puVar4 != (uint *)0x0) {\n        *puVar4 = __maxlen - uVar1;\n        puVar4[1] = uVar5;\n        puVar4[2] = (uint)(__string + uVar1);\n        *(uint **)data = puVar4;\n        return (char *)__string;\n      }" if (parenthesized_expression "(puVar4 != (uint *)0x0)" ( (binary_expression "puVar4 != (uint *)0x0" identifier != (cast_expression "(uint *)0x0" ( (type_descriptor "uint *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n        *puVar4 = __maxlen - uVar1;\n        puVar4[1] = uVar5;\n        puVar4[2] = (uint)(__string + uVar1);\n        *(uint **)data = puVar4;\n        return (char *)__string;\n      }" { (expression_statement "*puVar4 = __maxlen - uVar1;" (assignment_expression "*puVar4 = __maxlen - uVar1" (pointer_expression "*puVar4" * identifier) = (binary_expression "__maxlen - uVar1" identifier - identifier)) ;) (expression_statement "puVar4[1] = uVar5;" (assignment_expression "puVar4[1] = uVar5" (subscript_expression "puVar4[1]" identifier [ number_literal ]) = identifier) ;) (expression_statement "puVar4[2] = (uint)(__string + uVar1);" (assignment_expression "puVar4[2] = (uint)(__string + uVar1)" (subscript_expression "puVar4[2]" identifier [ number_literal ]) = (call_expression "(uint)(__string + uVar1)" (parenthesized_expression "(uint)" ( identifier )) (argument_list "(__string + uVar1)" ( (binary_expression "__string + uVar1" identifier + identifier) )))) ;) (expression_statement "*(uint **)data = puVar4;" (assignment_expression "*(uint **)data = puVar4" (pointer_expression "*(uint **)data" * (cast_expression "(uint **)data" ( (type_descriptor "uint **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) identifier)) = identifier) ;) (return_statement "return (char *)__string;" return (cast_expression "(char *)__string" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) identifier) ;) })) })) })) (return_statement "return (char *)0x0;" return (cast_expression "(char *)0x0" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal) ;) })))
(translation_unit "char * FUN_0004cab0(int param_1,undefined4 *param_2)\n\n{\n  uint uVar1;\n  uint __maxlen;\n  char *__string;\n  int iVar2;\n  size_t sVar3;\n  uint *puVar4;\n  uint uVar5;\n  \n  __maxlen = *(uint *)(param_1 + 0x1c);\n  __string = *(char **)(param_1 + 0x10);\n  iVar2 = *(int *)(param_1 + 0x20);\n  sVar3 = strnlen(__string,__maxlen);\n  uVar1 = sVar3 + 1;\n  if (iVar2 != 0 || (uint)-iVar2 < (uint)(uVar1 < __maxlen)) {\n    uVar5 = iVar2 - (uint)(__maxlen < uVar1);\n    if (uVar5 != 0 || -uVar5 < (uint)(0x13 < __maxlen - uVar1)) {\n      puVar4 = (uint *)calloc(1,0xc);\n      if (puVar4 != (uint *)0x0) {\n        *puVar4 = __maxlen - uVar1;\n        puVar4[1] = uVar5;\n        puVar4[2] = (uint)(__string + uVar1);\n        *param_2 = puVar4;\n        return __string;\n      }\n    }\n  }\n  return (char *)0x0;\n}\n\n" (function_definition "char * FUN_0004cab0(int param_1,undefined4 *param_2)\n\n{\n  uint uVar1;\n  uint __maxlen;\n  char *__string;\n  int iVar2;\n  size_t sVar3;\n  uint *puVar4;\n  uint uVar5;\n  \n  __maxlen = *(uint *)(param_1 + 0x1c);\n  __string = *(char **)(param_1 + 0x10);\n  iVar2 = *(int *)(param_1 + 0x20);\n  sVar3 = strnlen(__string,__maxlen);\n  uVar1 = sVar3 + 1;\n  if (iVar2 != 0 || (uint)-iVar2 < (uint)(uVar1 < __maxlen)) {\n    uVar5 = iVar2 - (uint)(__maxlen < uVar1);\n    if (uVar5 != 0 || -uVar5 < (uint)(0x13 < __maxlen - uVar1)) {\n      puVar4 = (uint *)calloc(1,0xc);\n      if (puVar4 != (uint *)0x0) {\n        *puVar4 = __maxlen - uVar1;\n        puVar4[1] = uVar5;\n        puVar4[2] = (uint)(__string + uVar1);\n        *param_2 = puVar4;\n        return __string;\n      }\n    }\n  }\n  return (char *)0x0;\n}" primitive_type (pointer_declarator "* FUN_0004cab0(int param_1,undefined4 *param_2)" * (function_declarator "FUN_0004cab0(int param_1,undefined4 *param_2)" identifier (parameter_list "(int param_1,undefined4 *param_2)" ( (parameter_declaration "int param_1" primitive_type identifier) , (parameter_declaration "undefined4 *param_2" type_identifier (pointer_declarator "*param_2" * identifier)) )))) (compound_statement "{\n  uint uVar1;\n  uint __maxlen;\n  char *__string;\n  int iVar2;\n  size_t sVar3;\n  uint *puVar4;\n  uint uVar5;\n  \n  __maxlen = *(uint *)(param_1 + 0x1c);\n  __string = *(char **)(param_1 + 0x10);\n  iVar2 = *(int *)(param_1 + 0x20);\n  sVar3 = strnlen(__string,__maxlen);\n  uVar1 = sVar3 + 1;\n  if (iVar2 != 0 || (uint)-iVar2 < (uint)(uVar1 < __maxlen)) {\n    uVar5 = iVar2 - (uint)(__maxlen < uVar1);\n    if (uVar5 != 0 || -uVar5 < (uint)(0x13 < __maxlen - uVar1)) {\n      puVar4 = (uint *)calloc(1,0xc);\n      if (puVar4 != (uint *)0x0) {\n        *puVar4 = __maxlen - uVar1;\n        puVar4[1] = uVar5;\n        puVar4[2] = (uint)(__string + uVar1);\n        *param_2 = puVar4;\n        return __string;\n      }\n    }\n  }\n  return (char *)0x0;\n}" { (declaration "uint uVar1;" type_identifier identifier ;) (declaration "uint __maxlen;" type_identifier identifier ;) (declaration "char *__string;" primitive_type (pointer_declarator "*__string" * identifier) ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "size_t sVar3;" primitive_type identifier ;) (declaration "uint *puVar4;" type_identifier (pointer_declarator "*puVar4" * identifier) ;) (declaration "uint uVar5;" type_identifier identifier ;) (expression_statement "__maxlen = *(uint *)(param_1 + 0x1c);" (assignment_expression "__maxlen = *(uint *)(param_1 + 0x1c)" identifier = (pointer_expression "*(uint *)(param_1 + 0x1c)" * (cast_expression "(uint *)(param_1 + 0x1c)" ( (type_descriptor "uint *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x1c)" ( (binary_expression "param_1 + 0x1c" identifier + number_literal) ))))) ;) (expression_statement "__string = *(char **)(param_1 + 0x10);" (assignment_expression "__string = *(char **)(param_1 + 0x10)" identifier = (pointer_expression "*(char **)(param_1 + 0x10)" * (cast_expression "(char **)(param_1 + 0x10)" ( (type_descriptor "char **" primitive_type (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(param_1 + 0x10)" ( (binary_expression "param_1 + 0x10" identifier + number_literal) ))))) ;) (expression_statement "iVar2 = *(int *)(param_1 + 0x20);" (assignment_expression "iVar2 = *(int *)(param_1 + 0x20)" identifier = (pointer_expression "*(int *)(param_1 + 0x20)" * (cast_expression "(int *)(param_1 + 0x20)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x20)" ( (binary_expression "param_1 + 0x20" identifier + number_literal) ))))) ;) (expression_statement "sVar3 = strnlen(__string,__maxlen);" (assignment_expression "sVar3 = strnlen(__string,__maxlen)" identifier = (call_expression "strnlen(__string,__maxlen)" identifier (argument_list "(__string,__maxlen)" ( identifier , identifier )))) ;) (expression_statement "uVar1 = sVar3 + 1;" (assignment_expression "uVar1 = sVar3 + 1" identifier = (binary_expression "sVar3 + 1" identifier + number_literal)) ;) (if_statement "if (iVar2 != 0 || (uint)-iVar2 < (uint)(uVar1 < __maxlen)) {\n    uVar5 = iVar2 - (uint)(__maxlen < uVar1);\n    if (uVar5 != 0 || -uVar5 < (uint)(0x13 < __maxlen - uVar1)) {\n      puVar4 = (uint *)calloc(1,0xc);\n      if (puVar4 != (uint *)0x0) {\n        *puVar4 = __maxlen - uVar1;\n        puVar4[1] = uVar5;\n        puVar4[2] = (uint)(__string + uVar1);\n        *param_2 = puVar4;\n        return __string;\n      }\n    }\n  }" if (parenthesized_expression "(iVar2 != 0 || (uint)-iVar2 < (uint)(uVar1 < __maxlen))" ( (binary_expression "iVar2 != 0 || (uint)-iVar2 < (uint)(uVar1 < __maxlen)" (binary_expression "iVar2 != 0" identifier != number_literal) || (binary_expression "(uint)-iVar2 < (uint)(uVar1 < __maxlen)" (binary_expression "(uint)-iVar2" (parenthesized_expression "(uint)" ( identifier )) - identifier) < (call_expression "(uint)(uVar1 < __maxlen)" (parenthesized_expression "(uint)" ( identifier )) (argument_list "(uVar1 < __maxlen)" ( (binary_expression "uVar1 < __maxlen" identifier < identifier) ))))) )) (compound_statement "{\n    uVar5 = iVar2 - (uint)(__maxlen < uVar1);\n    if (uVar5 != 0 || -uVar5 < (uint)(0x13 < __maxlen - uVar1)) {\n      puVar4 = (uint *)calloc(1,0xc);\n      if (puVar4 != (uint *)0x0) {\n        *puVar4 = __maxlen - uVar1;\n        puVar4[1] = uVar5;\n        puVar4[2] = (uint)(__string + uVar1);\n        *param_2 = puVar4;\n        return __string;\n      }\n    }\n  }" { (expression_statement "uVar5 = iVar2 - (uint)(__maxlen < uVar1);" (assignment_expression "uVar5 = iVar2 - (uint)(__maxlen < uVar1)" identifier = (binary_expression "iVar2 - (uint)(__maxlen < uVar1)" identifier - (call_expression "(uint)(__maxlen < uVar1)" (parenthesized_expression "(uint)" ( identifier )) (argument_list "(__maxlen < uVar1)" ( (binary_expression "__maxlen < uVar1" identifier < identifier) ))))) ;) (if_statement "if (uVar5 != 0 || -uVar5 < (uint)(0x13 < __maxlen - uVar1)) {\n      puVar4 = (uint *)calloc(1,0xc);\n      if (puVar4 != (uint *)0x0) {\n        *puVar4 = __maxlen - uVar1;\n        puVar4[1] = uVar5;\n        puVar4[2] = (uint)(__string + uVar1);\n        *param_2 = puVar4;\n        return __string;\n      }\n    }" if (parenthesized_expression "(uVar5 != 0 || -uVar5 < (uint)(0x13 < __maxlen - uVar1))" ( (binary_expression "uVar5 != 0 || -uVar5 < (uint)(0x13 < __maxlen - uVar1)" (binary_expression "uVar5 != 0" identifier != number_literal) || (binary_expression "-uVar5 < (uint)(0x13 < __maxlen - uVar1)" (unary_expression "-uVar5" - identifier) < (call_expression "(uint)(0x13 < __maxlen - uVar1)" (parenthesized_expression "(uint)" ( identifier )) (argument_list "(0x13 < __maxlen - uVar1)" ( (binary_expression "0x13 < __maxlen - uVar1" number_literal < (binary_expression "__maxlen - uVar1" identifier - identifier)) ))))) )) (compound_statement "{\n      puVar4 = (uint *)calloc(1,0xc);\n      if (puVar4 != (uint *)0x0) {\n        *puVar4 = __maxlen - uVar1;\n        puVar4[1] = uVar5;\n        puVar4[2] = (uint)(__string + uVar1);\n        *param_2 = puVar4;\n        return __string;\n      }\n    }" { (expression_statement "puVar4 = (uint *)calloc(1,0xc);" (assignment_expression "puVar4 = (uint *)calloc(1,0xc)" identifier = (cast_expression "(uint *)calloc(1,0xc)" ( (type_descriptor "uint *" type_identifier (abstract_pointer_declarator "*" *)) ) (call_expression "calloc(1,0xc)" identifier (argument_list "(1,0xc)" ( number_literal , number_literal ))))) ;) (if_statement "if (puVar4 != (uint *)0x0) {\n        *puVar4 = __maxlen - uVar1;\n        puVar4[1] = uVar5;\n        puVar4[2] = (uint)(__string + uVar1);\n        *param_2 = puVar4;\n        return __string;\n      }" if (parenthesized_expression "(puVar4 != (uint *)0x0)" ( (binary_expression "puVar4 != (uint *)0x0" identifier != (cast_expression "(uint *)0x0" ( (type_descriptor "uint *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n        *puVar4 = __maxlen - uVar1;\n        puVar4[1] = uVar5;\n        puVar4[2] = (uint)(__string + uVar1);\n        *param_2 = puVar4;\n        return __string;\n      }" { (expression_statement "*puVar4 = __maxlen - uVar1;" (assignment_expression "*puVar4 = __maxlen - uVar1" (pointer_expression "*puVar4" * identifier) = (binary_expression "__maxlen - uVar1" identifier - identifier)) ;) (expression_statement "puVar4[1] = uVar5;" (assignment_expression "puVar4[1] = uVar5" (subscript_expression "puVar4[1]" identifier [ number_literal ]) = identifier) ;) (expression_statement "puVar4[2] = (uint)(__string + uVar1);" (assignment_expression "puVar4[2] = (uint)(__string + uVar1)" (subscript_expression "puVar4[2]" identifier [ number_literal ]) = (call_expression "(uint)(__string + uVar1)" (parenthesized_expression "(uint)" ( identifier )) (argument_list "(__string + uVar1)" ( (binary_expression "__string + uVar1" identifier + identifier) )))) ;) (expression_statement "*param_2 = puVar4;" (assignment_expression "*param_2 = puVar4" (pointer_expression "*param_2" * identifier) = identifier) ;) (return_statement "return __string;" return identifier ;) })) })) })) (return_statement "return (char *)0x0;" return (cast_expression "(char *)0x0" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal) ;) })))
(translation_unit (function_definition TYPE (pointer_declarator * (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE (pointer_declarator * IDENT)) )))) (compound_statement { (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE IDENT ;) (expression_statement (assignment_expression IDENT = (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))))) ;) (expression_statement (assignment_expression IDENT = (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator * (abstract_pointer_declarator *))) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))))) ;) (expression_statement (assignment_expression IDENT = (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))))) ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT , IDENT )))) ;) (expression_statement (assignment_expression IDENT = (binary_expression IDENT + LIT)) ;) (if_statement if (parenthesized_expression ( (binary_expression (binary_expression IDENT != LIT) || (binary_expression (binary_expression (parenthesized_expression ( IDENT )) - IDENT) < (call_expression (parenthesized_expression ( IDENT )) (argument_list ( (binary_expression IDENT < IDENT) ))))) )) (compound_statement { (expression_statement (assignment_expression IDENT = (binary_expression IDENT - (call_expression (parenthesized_expression ( IDENT )) (argument_list ( (binary_expression IDENT < IDENT) ))))) ;) (if_statement if (parenthesized_expression ( (binary_expression (binary_expression IDENT != LIT) || (binary_expression (unary_expression - IDENT) < (call_expression (parenthesized_expression ( IDENT )) (argument_list ( (binary_expression LIT < (binary_expression IDENT - IDENT)) ))))) )) (compound_statement { (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (call_expression IDENT (argument_list ( LIT , LIT ))))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT != (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) LIT)) )) (compound_statement { (expression_statement (assignment_expression (pointer_expression * IDENT) = (binary_expression IDENT - IDENT)) ;) (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = IDENT) ;) (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = (call_expression (parenthesized_expression ( IDENT )) (argument_list ( (binary_expression IDENT + IDENT) )))) ;) (expression_statement (assignment_expression (pointer_expression * IDENT) = IDENT) ;) (return_statement return IDENT ;) })) })) })) (return_statement return (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) LIT) ;) })))
(function_definition "char * FUN_0004cab0(int param_1,undefined4 *param_2)\n\n{\n  uint uVar1;\n  uint __maxlen;\n  char *__string;\n  int iVar2;\n  size_t sVar3;\n  uint *puVar4;\n  uint uVar5;\n  \n  __maxlen = *(uint *)(param_1 + 0x1c);\n  __string = *(char **)(param_1 + 0x10);\n  iVar2 = *(int *)(param_1 + 0x20);\n  sVar3 = strnlen(__string,__maxlen);\n  uVar1 = sVar3 + 1;\n  if (iVar2 != 0 || (uint)-iVar2 < (uint)(uVar1 < __maxlen)) {\n    uVar5 = iVar2 - (uint)(__maxlen < uVar1);\n    if (uVar5 != 0 || -uVar5 < (uint)(0x13 < __maxlen - uVar1)) {\n      puVar4 = (uint *)calloc(1,0xc);\n      if (puVar4 != (uint *)0x0) {\n        *puVar4 = __maxlen - uVar1;\n        puVar4[1] = uVar5;\n        puVar4[2] = (uint)(__string + uVar1);\n        *param_2 = puVar4;\n        return __string;\n      }\n    }\n  }\n  return (char *)0x0;\n}" (primitive_type "char") (pointer_declarator "* FUN_0004cab0(int param_1,undefined4 *param_2)" (* "*") (function_declarator "FUN_0004cab0(int param_1,undefined4 *param_2)" (identifier "FUN_0004cab0") (parameter_list "(int param_1,undefined4 *param_2)" (( "(") (parameter_declaration "int param_1" (primitive_type "int") (identifier "param_1")) (, ",") (parameter_declaration "undefined4 *param_2" (type_identifier "undefined4") (pointer_declarator "*param_2" (* "*") (identifier "param_2"))) () ")")))) (compound_statement "{\n  uint uVar1;\n  uint __maxlen;\n  char *__string;\n  int iVar2;\n  size_t sVar3;\n  uint *puVar4;\n  uint uVar5;\n  \n  __maxlen = *(uint *)(param_1 + 0x1c);\n  __string = *(char **)(param_1 + 0x10);\n  iVar2 = *(int *)(param_1 + 0x20);\n  sVar3 = strnlen(__string,__maxlen);\n  uVar1 = sVar3 + 1;\n  if (iVar2 != 0 || (uint)-iVar2 < (uint)(uVar1 < __maxlen)) {\n    uVar5 = iVar2 - (uint)(__maxlen < uVar1);\n    if (uVar5 != 0 || -uVar5 < (uint)(0x13 < __maxlen - uVar1)) {\n      puVar4 = (uint *)calloc(1,0xc);\n      if (puVar4 != (uint *)0x0) {\n        *puVar4 = __maxlen - uVar1;\n        puVar4[1] = uVar5;\n        puVar4[2] = (uint)(__string + uVar1);\n        *param_2 = puVar4;\n        return __string;\n      }\n    }\n  }\n  return (char *)0x0;\n}" ({ "{") (declaration "uint uVar1;" (type_identifier "uint") (identifier "uVar1") (; ";")) (declaration "uint __maxlen;" (type_identifier "uint") (identifier "__maxlen") (; ";")) (declaration "char *__string;" (primitive_type "char") (pointer_declarator "*__string" (* "*") (identifier "__string")) (; ";")) (declaration "int iVar2;" (primitive_type "int") (identifier "iVar2") (; ";")) (declaration "size_t sVar3;" (primitive_type "size_t") (identifier "sVar3") (; ";")) (declaration "uint *puVar4;" (type_identifier "uint") (pointer_declarator "*puVar4" (* "*") (identifier "puVar4")) (; ";")) (declaration "uint uVar5;" (type_identifier "uint") (identifier "uVar5") (; ";")) (expression_statement "__maxlen = *(uint *)(param_1 + 0x1c);" (assignment_expression "__maxlen = *(uint *)(param_1 + 0x1c)" (identifier "__maxlen") (= "=") (pointer_expression "*(uint *)(param_1 + 0x1c)" (* "*") (cast_expression "(uint *)(param_1 + 0x1c)" (( "(") (type_descriptor "uint *" (type_identifier "uint") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 0x1c)" (( "(") (binary_expression "param_1 + 0x1c" (identifier "param_1") (+ "+") (number_literal "0x1c")) () ")"))))) (; ";")) (expression_statement "__string = *(char **)(param_1 + 0x10);" (assignment_expression "__string = *(char **)(param_1 + 0x10)" (identifier "__string") (= "=") (pointer_expression "*(char **)(param_1 + 0x10)" (* "*") (cast_expression "(char **)(param_1 + 0x10)" (( "(") (type_descriptor "char **" (primitive_type "char") (abstract_pointer_declarator "**" (* "*") (abstract_pointer_declarator "*" (* "*")))) () ")") (parenthesized_expression "(param_1 + 0x10)" (( "(") (binary_expression "param_1 + 0x10" (identifier "param_1") (+ "+") (number_literal "0x10")) () ")"))))) (; ";")) (expression_statement "iVar2 = *(int *)(param_1 + 0x20);" (assignment_expression "iVar2 = *(int *)(param_1 + 0x20)" (identifier "iVar2") (= "=") (pointer_expression "*(int *)(param_1 + 0x20)" (* "*") (cast_expression "(int *)(param_1 + 0x20)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 0x20)" (( "(") (binary_expression "param_1 + 0x20" (identifier "param_1") (+ "+") (number_literal "0x20")) () ")"))))) (; ";")) (expression_statement "sVar3 = strnlen(__string,__maxlen);" (assignment_expression "sVar3 = strnlen(__string,__maxlen)" (identifier "sVar3") (= "=") (call_expression "strnlen(__string,__maxlen)" (identifier "strnlen") (argument_list "(__string,__maxlen)" (( "(") (identifier "__string") (, ",") (identifier "__maxlen") () ")")))) (; ";")) (expression_statement "uVar1 = sVar3 + 1;" (assignment_expression "uVar1 = sVar3 + 1" (identifier "uVar1") (= "=") (binary_expression "sVar3 + 1" (identifier "sVar3") (+ "+") (number_literal "1"))) (; ";")) (if_statement "if (iVar2 != 0 || (uint)-iVar2 < (uint)(uVar1 < __maxlen)) {\n    uVar5 = iVar2 - (uint)(__maxlen < uVar1);\n    if (uVar5 != 0 || -uVar5 < (uint)(0x13 < __maxlen - uVar1)) {\n      puVar4 = (uint *)calloc(1,0xc);\n      if (puVar4 != (uint *)0x0) {\n        *puVar4 = __maxlen - uVar1;\n        puVar4[1] = uVar5;\n        puVar4[2] = (uint)(__string + uVar1);\n        *param_2 = puVar4;\n        return __string;\n      }\n    }\n  }" (if "if") (parenthesized_expression "(iVar2 != 0 || (uint)-iVar2 < (uint)(uVar1 < __maxlen))" (( "(") (binary_expression "iVar2 != 0 || (uint)-iVar2 < (uint)(uVar1 < __maxlen)" (binary_expression "iVar2 != 0" (identifier "iVar2") (!= "!=") (number_literal "0")) (|| "||") (binary_expression "(uint)-iVar2 < (uint)(uVar1 < __maxlen)" (binary_expression "(uint)-iVar2" (parenthesized_expression "(uint)" (( "(") (identifier "uint") () ")")) (- "-") (identifier "iVar2")) (< "<") (call_expression "(uint)(uVar1 < __maxlen)" (parenthesized_expression "(uint)" (( "(") (identifier "uint") () ")")) (argument_list "(uVar1 < __maxlen)" (( "(") (binary_expression "uVar1 < __maxlen" (identifier "uVar1") (< "<") (identifier "__maxlen")) () ")"))))) () ")")) (compound_statement "{\n    uVar5 = iVar2 - (uint)(__maxlen < uVar1);\n    if (uVar5 != 0 || -uVar5 < (uint)(0x13 < __maxlen - uVar1)) {\n      puVar4 = (uint *)calloc(1,0xc);\n      if (puVar4 != (uint *)0x0) {\n        *puVar4 = __maxlen - uVar1;\n        puVar4[1] = uVar5;\n        puVar4[2] = (uint)(__string + uVar1);\n        *param_2 = puVar4;\n        return __string;\n      }\n    }\n  }" ({ "{") (expression_statement "uVar5 = iVar2 - (uint)(__maxlen < uVar1);" (assignment_expression "uVar5 = iVar2 - (uint)(__maxlen < uVar1)" (identifier "uVar5") (= "=") (binary_expression "iVar2 - (uint)(__maxlen < uVar1)" (identifier "iVar2") (- "-") (call_expression "(uint)(__maxlen < uVar1)" (parenthesized_expression "(uint)" (( "(") (identifier "uint") () ")")) (argument_list "(__maxlen < uVar1)" (( "(") (binary_expression "__maxlen < uVar1" (identifier "__maxlen") (< "<") (identifier "uVar1")) () ")"))))) (; ";")) (if_statement "if (uVar5 != 0 || -uVar5 < (uint)(0x13 < __maxlen - uVar1)) {\n      puVar4 = (uint *)calloc(1,0xc);\n      if (puVar4 != (uint *)0x0) {\n        *puVar4 = __maxlen - uVar1;\n        puVar4[1] = uVar5;\n        puVar4[2] = (uint)(__string + uVar1);\n        *param_2 = puVar4;\n        return __string;\n      }\n    }" (if "if") (parenthesized_expression "(uVar5 != 0 || -uVar5 < (uint)(0x13 < __maxlen - uVar1))" (( "(") (binary_expression "uVar5 != 0 || -uVar5 < (uint)(0x13 < __maxlen - uVar1)" (binary_expression "uVar5 != 0" (identifier "uVar5") (!= "!=") (number_literal "0")) (|| "||") (binary_expression "-uVar5 < (uint)(0x13 < __maxlen - uVar1)" (unary_expression "-uVar5" (- "-") (identifier "uVar5")) (< "<") (call_expression "(uint)(0x13 < __maxlen - uVar1)" (parenthesized_expression "(uint)" (( "(") (identifier "uint") () ")")) (argument_list "(0x13 < __maxlen - uVar1)" (( "(") (binary_expression "0x13 < __maxlen - uVar1" (number_literal "0x13") (< "<") (binary_expression "__maxlen - uVar1" (identifier "__maxlen") (- "-") (identifier "uVar1"))) () ")"))))) () ")")) (compound_statement "{\n      puVar4 = (uint *)calloc(1,0xc);\n      if (puVar4 != (uint *)0x0) {\n        *puVar4 = __maxlen - uVar1;\n        puVar4[1] = uVar5;\n        puVar4[2] = (uint)(__string + uVar1);\n        *param_2 = puVar4;\n        return __string;\n      }\n    }" ({ "{") (expression_statement "puVar4 = (uint *)calloc(1,0xc);" (assignment_expression "puVar4 = (uint *)calloc(1,0xc)" (identifier "puVar4") (= "=") (cast_expression "(uint *)calloc(1,0xc)" (( "(") (type_descriptor "uint *" (type_identifier "uint") (abstract_pointer_declarator "*" (* "*"))) () ")") (call_expression "calloc(1,0xc)" (identifier "calloc") (argument_list "(1,0xc)" (( "(") (number_literal "1") (, ",") (number_literal "0xc") () ")"))))) (; ";")) (if_statement "if (puVar4 != (uint *)0x0) {\n        *puVar4 = __maxlen - uVar1;\n        puVar4[1] = uVar5;\n        puVar4[2] = (uint)(__string + uVar1);\n        *param_2 = puVar4;\n        return __string;\n      }" (if "if") (parenthesized_expression "(puVar4 != (uint *)0x0)" (( "(") (binary_expression "puVar4 != (uint *)0x0" (identifier "puVar4") (!= "!=") (cast_expression "(uint *)0x0" (( "(") (type_descriptor "uint *" (type_identifier "uint") (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0x0"))) () ")")) (compound_statement "{\n        *puVar4 = __maxlen - uVar1;\n        puVar4[1] = uVar5;\n        puVar4[2] = (uint)(__string + uVar1);\n        *param_2 = puVar4;\n        return __string;\n      }" ({ "{") (expression_statement "*puVar4 = __maxlen - uVar1;" (assignment_expression "*puVar4 = __maxlen - uVar1" (pointer_expression "*puVar4" (* "*") (identifier "puVar4")) (= "=") (binary_expression "__maxlen - uVar1" (identifier "__maxlen") (- "-") (identifier "uVar1"))) (; ";")) (expression_statement "puVar4[1] = uVar5;" (assignment_expression "puVar4[1] = uVar5" (subscript_expression "puVar4[1]" (identifier "puVar4") ([ "[") (number_literal "1") (] "]")) (= "=") (identifier "uVar5")) (; ";")) (expression_statement "puVar4[2] = (uint)(__string + uVar1);" (assignment_expression "puVar4[2] = (uint)(__string + uVar1)" (subscript_expression "puVar4[2]" (identifier "puVar4") ([ "[") (number_literal "2") (] "]")) (= "=") (call_expression "(uint)(__string + uVar1)" (parenthesized_expression "(uint)" (( "(") (identifier "uint") () ")")) (argument_list "(__string + uVar1)" (( "(") (binary_expression "__string + uVar1" (identifier "__string") (+ "+") (identifier "uVar1")) () ")")))) (; ";")) (expression_statement "*param_2 = puVar4;" (assignment_expression "*param_2 = puVar4" (pointer_expression "*param_2" (* "*") (identifier "param_2")) (= "=") (identifier "puVar4")) (; ";")) (return_statement "return __string;" (return "return") (identifier "__string") (; ";")) (} "}"))) (} "}"))) (} "}"))) (return_statement "return (char *)0x0;" (return "return") (cast_expression "(char *)0x0" (( "(") (type_descriptor "char *" (primitive_type "char") (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0x0")) (; ";")) (} "}")))

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

char * function_1(type_1 *section,void *data)

{
  type_2 var_4;
  type_2 var_5;
  type_3 *var_9;
  int var_3;
  size_t var_2;
  type_2 *var_8;
  type_2 var_6;
  
  var_5 = (type_2)section->size;
  var_9 = section->start;
  var_3 = *(int *)((int)&section->size + 4);
  var_2 = var_1((char *)var_9,var_5);
  var_4 = var_2 + 1;
  if (var_3 != 0 || (type_2)-var_3 < (type_2)(var_4 < var_5)) {
    var_6 = var_3 - (type_2)(var_5 < var_4);
    if (var_6 != 0 || -var_6 < (type_2)(0x13 < var_5 - var_4)) {
      var_8 = (type_2 *)var_7(1,0xc);
      if (var_8 != (type_2 *)0x0) {
        *var_8 = var_5 - var_4;
        var_8[1] = var_6;
        var_8[2] = (type_2)(var_9 + var_4);
        *(type_2 **)data = var_8;
        return (char *)var_9;
      }
    }
  }
  return (char *)0x0;
}


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

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

char * MASKED(int param_1,undefined4 *param_2)

{
  uint uVar1;
  uint __maxlen;
  char *__string;
  int iVar2;
  size_t sVar3;
  uint *puVar4;
  uint uVar5;
  
  __maxlen = *(uint *)(param_1 + 0x1c);
  __string = *(char **)(param_1 + 0x10);
  iVar2 = *(int *)(param_1 + 0x20);
  sVar3 = strnlen(__string,__maxlen);
  uVar1 = sVar3 + 1;
  if (iVar2 != 0 || (uint)-iVar2 < (uint)(uVar1 < __maxlen)) {
    uVar5 = iVar2 - (uint)(__maxlen < uVar1);
    if (uVar5 != 0 || -uVar5 < (uint)(0x13 < __maxlen - uVar1)) {
      puVar4 = (uint *)calloc(1,0xc);
      if (puVar4 != (uint *)0x0) {
        *puVar4 = __maxlen - uVar1;
        puVar4[1] = uVar5;
        puVar4[2] = (uint)(__string + uVar1);
        *param_2 = puVar4;
        return __string;
      }
    }
  }
  return (char *)0x0;
}

