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

int gmp_asprintf_format(gmp_asprintf_t *d,char *fmt,va_list orig_ap)

{
  undefined *puVar1;
  int iVar2;
  char *pcVar3;
  uint uVar4;
  size_t sVar5;
  uint uVar6;
  
  puVar1 = PTR___gmp_reallocate_func_00098d4c;
  iVar2 = 0x100;
LAB_00077c49:
  sVar5 = d->size;
  uVar6 = d->alloc;
  uVar4 = sVar5 + iVar2;
  if (uVar4 < uVar6) goto LAB_00077c76;
  do {
    d->alloc = uVar4 * 2;
    pcVar3 = (char *)(**(code **)puVar1)(d->buf,uVar6,uVar4 * 2);
    uVar6 = d->alloc;
    sVar5 = d->size;
    d->buf = pcVar3;
LAB_00077c76:
    do {
      iVar2 = uVar6 - sVar5;
      uVar4 = __vsnprintf_chk(d->buf + sVar5,iVar2,1,0xffffffff,fmt,orig_ap);
      if (uVar4 == 0xffffffff) {
LAB_00077cb8:
        iVar2 = iVar2 * 2;
        goto LAB_00077c49;
      }
      if (uVar4 < iVar2 - 1U) {
        d->size = d->size + uVar4;
        return uVar4;
      }
      if (uVar4 == iVar2 - 1U) goto LAB_00077cb8;
      sVar5 = d->size;
      uVar6 = d->alloc;
      uVar4 = sVar5 + uVar4 + 2;
    } while (uVar4 < uVar6);
  } while( true );
}



void __regparm2
FUN_00077c20(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4)

{
  undefined4 *puVar1;
  int iVar2;
  undefined4 uVar3;
  uint uVar4;
  int iVar5;
  int unaff_EBX;
  uint uVar6;
  int unaff_retaddr;
  
  iVar2 = entry(param_2,0x77c2e);
  puVar1 = *(undefined4 **)(&DAT_0002111e + unaff_EBX);
LAB_00077c49:
  iVar5 = *(int *)(unaff_retaddr + 8);
  uVar6 = *(uint *)(unaff_retaddr + 0xc);
  uVar4 = iVar5 + iVar2;
  if (uVar4 < uVar6) goto LAB_00077c76;
  do {
    *(uint *)(unaff_retaddr + 0xc) = uVar4 * 2;
    uVar3 = (*(code *)*puVar1)(*(undefined4 *)(unaff_retaddr + 4),uVar6,uVar4 * 2);
    uVar6 = *(uint *)(unaff_retaddr + 0xc);
    iVar5 = *(int *)(unaff_retaddr + 8);
    *(undefined4 *)(unaff_retaddr + 4) = uVar3;
LAB_00077c76:
    do {
      iVar2 = uVar6 - iVar5;
      uVar4 = __vsnprintf_chk(iVar5 + *(int *)(unaff_retaddr + 4),iVar2,1,0xffffffff,param_3,param_4
                             );
      if (uVar4 == 0xffffffff) {
LAB_00077cb8:
        iVar2 = iVar2 * 2;
        goto LAB_00077c49;
      }
      if (uVar4 < iVar2 - 1U) {
        *(int *)(unaff_retaddr + 8) = *(int *)(unaff_retaddr + 8) + uVar4;
        return;
      }
      if (uVar4 == iVar2 - 1U) goto LAB_00077cb8;
      iVar5 = *(int *)(unaff_retaddr + 8);
      uVar6 = *(uint *)(unaff_retaddr + 0xc);
      uVar4 = iVar5 + uVar4 + 2;
    } while (uVar4 < uVar6);
  } while( true );
}


PUSH EBP
MOV EAX,0x100
PUSH EDI
PUSH ESI
PUSH EBX
CALL 0x0001c340
ADD EBX,0x213d2
SUB ESP,0x1c
MOV EDI,dword ptr [ESP + 0x30]
MOV EBP,dword ptr [ESP + 0x34]
MOV EDX,dword ptr [EBX + 0xfffffd4c]
MOV dword ptr [ESP + 0xc],EDX
MOV ECX,dword ptr [EDI + 0x8]
MOV ESI,dword ptr [EDI + 0xc]
LEA EDX,[ECX + EAX*0x1]
CMP ESI,EDX
JA 0x00077c76
SUB ESP,0x4
LEA ECX,[EDX + EDX*0x1]
MOV dword ptr [EDI + 0xc],ECX
PUSH ECX
PUSH ESI
PUSH dword ptr [EDI + 0x4]
MOV EAX,dword ptr [ESP + 0x1c]
CALL dword ptr [EAX]
MOV ESI,dword ptr [EDI + 0xc]
MOV ECX,dword ptr [EDI + 0x8]
MOV dword ptr [EDI + 0x4],EAX
ADD ESP,0x10
SUB ESP,0x8
SUB ESI,ECX
PUSH dword ptr [ESP + 0x40]
PUSH EBP
ADD ECX,dword ptr [EDI + 0x4]
PUSH -0x1
PUSH 0x1
PUSH ESI
PUSH ECX
CALL 0x0001bbf0
LEA EDX,[ESI + -0x1]
ADD ESP,0x20
CMP EAX,-0x1
JZ 0x00077cb8
CMP EAX,EDX
JC 0x00077cc0
JZ 0x00077cb8
MOV ECX,dword ptr [EDI + 0x8]
ADD EAX,0x2
MOV ESI,dword ptr [EDI + 0xc]
LEA EDX,[ECX + EAX*0x1]
CMP ESI,EDX
JA 0x00077c76
JMP 0x00077c56
LEA EAX,[ESI + ESI*0x1]
JMP 0x00077c49
ADD dword ptr [EDI + 0x8],EAX
ADD ESP,0x1c
POP EBX
POP ESI
POP EDI
POP EBP
RET
(translation_unit "void __regparm2\nFUN_00077c20(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4)\n\n{\n  undefined4 *puVar1;\n  int iVar2;\n  undefined4 uVar3;\n  uint uVar4;\n  int iVar5;\n  int unaff_EBX;\n  uint uVar6;\n  int unaff_retaddr;\n  \n  iVar2 = entry(param_2,0x77c2e);\n  puVar1 = *(undefined4 **)(&DAT_0002111e + unaff_EBX);\nLAB_00077c49:\n  iVar5 = *(int *)(unaff_retaddr + 8);\n  uVar6 = *(uint *)(unaff_retaddr + 0xc);\n  uVar4 = iVar5 + iVar2;\n  if (uVar4 < uVar6) goto LAB_00077c76;\n  do {\n    *(uint *)(unaff_retaddr + 0xc) = uVar4 * 2;\n    uVar3 = (*(code *)*puVar1)(*(undefined4 *)(unaff_retaddr + 4),uVar6,uVar4 * 2);\n    uVar6 = *(uint *)(unaff_retaddr + 0xc);\n    iVar5 = *(int *)(unaff_retaddr + 8);\n    *(undefined4 *)(unaff_retaddr + 4) = uVar3;\nLAB_00077c76:\n    do {\n      iVar2 = uVar6 - iVar5;\n      uVar4 = __vsnprintf_chk(iVar5 + *(int *)(unaff_retaddr + 4),iVar2,1,0xffffffff,param_3,param_4\n                             );\n      if (uVar4 == 0xffffffff) {\nLAB_00077cb8:\n        iVar2 = iVar2 * 2;\n        goto LAB_00077c49;\n      }\n      if (uVar4 < iVar2 - 1U) {\n        *(int *)(unaff_retaddr + 8) = *(int *)(unaff_retaddr + 8) + uVar4;\n        return;\n      }\n      if (uVar4 == iVar2 - 1U) goto LAB_00077cb8;\n      iVar5 = *(int *)(unaff_retaddr + 8);\n      uVar6 = *(uint *)(unaff_retaddr + 0xc);\n      uVar4 = iVar5 + uVar4 + 2;\n    } while (uVar4 < uVar6);\n  } while( true );\n}\n\n" (function_definition "void __regparm2\nFUN_00077c20(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4)\n\n{\n  undefined4 *puVar1;\n  int iVar2;\n  undefined4 uVar3;\n  uint uVar4;\n  int iVar5;\n  int unaff_EBX;\n  uint uVar6;\n  int unaff_retaddr;\n  \n  iVar2 = entry(param_2,0x77c2e);\n  puVar1 = *(undefined4 **)(&DAT_0002111e + unaff_EBX);\nLAB_00077c49:\n  iVar5 = *(int *)(unaff_retaddr + 8);\n  uVar6 = *(uint *)(unaff_retaddr + 0xc);\n  uVar4 = iVar5 + iVar2;\n  if (uVar4 < uVar6) goto LAB_00077c76;\n  do {\n    *(uint *)(unaff_retaddr + 0xc) = uVar4 * 2;\n    uVar3 = (*(code *)*puVar1)(*(undefined4 *)(unaff_retaddr + 4),uVar6,uVar4 * 2);\n    uVar6 = *(uint *)(unaff_retaddr + 0xc);\n    iVar5 = *(int *)(unaff_retaddr + 8);\n    *(undefined4 *)(unaff_retaddr + 4) = uVar3;\nLAB_00077c76:\n    do {\n      iVar2 = uVar6 - iVar5;\n      uVar4 = __vsnprintf_chk(iVar5 + *(int *)(unaff_retaddr + 4),iVar2,1,0xffffffff,param_3,param_4\n                             );\n      if (uVar4 == 0xffffffff) {\nLAB_00077cb8:\n        iVar2 = iVar2 * 2;\n        goto LAB_00077c49;\n      }\n      if (uVar4 < iVar2 - 1U) {\n        *(int *)(unaff_retaddr + 8) = *(int *)(unaff_retaddr + 8) + uVar4;\n        return;\n      }\n      if (uVar4 == iVar2 - 1U) goto LAB_00077cb8;\n      iVar5 = *(int *)(unaff_retaddr + 8);\n      uVar6 = *(uint *)(unaff_retaddr + 0xc);\n      uVar4 = iVar5 + uVar4 + 2;\n    } while (uVar4 < uVar6);\n  } while( true );\n}" primitive_type (ERROR "__regparm2" identifier) (function_declarator "FUN_00077c20(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4)" identifier (parameter_list "(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4)" ( (parameter_declaration "undefined4 param_1" type_identifier identifier) , (parameter_declaration "undefined4 param_2" type_identifier identifier) , (parameter_declaration "undefined4 param_3" type_identifier identifier) , (parameter_declaration "undefined4 param_4" type_identifier identifier) ))) (compound_statement "{\n  undefined4 *puVar1;\n  int iVar2;\n  undefined4 uVar3;\n  uint uVar4;\n  int iVar5;\n  int unaff_EBX;\n  uint uVar6;\n  int unaff_retaddr;\n  \n  iVar2 = entry(param_2,0x77c2e);\n  puVar1 = *(undefined4 **)(&DAT_0002111e + unaff_EBX);\nLAB_00077c49:\n  iVar5 = *(int *)(unaff_retaddr + 8);\n  uVar6 = *(uint *)(unaff_retaddr + 0xc);\n  uVar4 = iVar5 + iVar2;\n  if (uVar4 < uVar6) goto LAB_00077c76;\n  do {\n    *(uint *)(unaff_retaddr + 0xc) = uVar4 * 2;\n    uVar3 = (*(code *)*puVar1)(*(undefined4 *)(unaff_retaddr + 4),uVar6,uVar4 * 2);\n    uVar6 = *(uint *)(unaff_retaddr + 0xc);\n    iVar5 = *(int *)(unaff_retaddr + 8);\n    *(undefined4 *)(unaff_retaddr + 4) = uVar3;\nLAB_00077c76:\n    do {\n      iVar2 = uVar6 - iVar5;\n      uVar4 = __vsnprintf_chk(iVar5 + *(int *)(unaff_retaddr + 4),iVar2,1,0xffffffff,param_3,param_4\n                             );\n      if (uVar4 == 0xffffffff) {\nLAB_00077cb8:\n        iVar2 = iVar2 * 2;\n        goto LAB_00077c49;\n      }\n      if (uVar4 < iVar2 - 1U) {\n        *(int *)(unaff_retaddr + 8) = *(int *)(unaff_retaddr + 8) + uVar4;\n        return;\n      }\n      if (uVar4 == iVar2 - 1U) goto LAB_00077cb8;\n      iVar5 = *(int *)(unaff_retaddr + 8);\n      uVar6 = *(uint *)(unaff_retaddr + 0xc);\n      uVar4 = iVar5 + uVar4 + 2;\n    } while (uVar4 < uVar6);\n  } while( true );\n}" { (declaration "undefined4 *puVar1;" type_identifier (pointer_declarator "*puVar1" * identifier) ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "undefined4 uVar3;" type_identifier identifier ;) (declaration "uint uVar4;" type_identifier identifier ;) (declaration "int iVar5;" primitive_type identifier ;) (declaration "int unaff_EBX;" primitive_type identifier ;) (declaration "uint uVar6;" type_identifier identifier ;) (declaration "int unaff_retaddr;" primitive_type identifier ;) (expression_statement "iVar2 = entry(param_2,0x77c2e);" (assignment_expression "iVar2 = entry(param_2,0x77c2e)" identifier = (call_expression "entry(param_2,0x77c2e)" identifier (argument_list "(param_2,0x77c2e)" ( identifier , number_literal )))) ;) (expression_statement "puVar1 = *(undefined4 **)(&DAT_0002111e + unaff_EBX);" (assignment_expression "puVar1 = *(undefined4 **)(&DAT_0002111e + unaff_EBX)" identifier = (pointer_expression "*(undefined4 **)(&DAT_0002111e + unaff_EBX)" * (cast_expression "(undefined4 **)(&DAT_0002111e + unaff_EBX)" ( (type_descriptor "undefined4 **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(&DAT_0002111e + unaff_EBX)" ( (binary_expression "&DAT_0002111e + unaff_EBX" (pointer_expression "&DAT_0002111e" & identifier) + identifier) ))))) ;) (labeled_statement "LAB_00077c49:\n  iVar5 = *(int *)(unaff_retaddr + 8);" statement_identifier : (expression_statement "iVar5 = *(int *)(unaff_retaddr + 8);" (assignment_expression "iVar5 = *(int *)(unaff_retaddr + 8)" identifier = (pointer_expression "*(int *)(unaff_retaddr + 8)" * (cast_expression "(int *)(unaff_retaddr + 8)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(unaff_retaddr + 8)" ( (binary_expression "unaff_retaddr + 8" identifier + number_literal) ))))) ;)) (expression_statement "uVar6 = *(uint *)(unaff_retaddr + 0xc);" (assignment_expression "uVar6 = *(uint *)(unaff_retaddr + 0xc)" identifier = (pointer_expression "*(uint *)(unaff_retaddr + 0xc)" * (cast_expression "(uint *)(unaff_retaddr + 0xc)" ( (type_descriptor "uint *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(unaff_retaddr + 0xc)" ( (binary_expression "unaff_retaddr + 0xc" identifier + number_literal) ))))) ;) (expression_statement "uVar4 = iVar5 + iVar2;" (assignment_expression "uVar4 = iVar5 + iVar2" identifier = (binary_expression "iVar5 + iVar2" identifier + identifier)) ;) (if_statement "if (uVar4 < uVar6) goto LAB_00077c76;" if (parenthesized_expression "(uVar4 < uVar6)" ( (binary_expression "uVar4 < uVar6" identifier < identifier) )) (goto_statement "goto LAB_00077c76;" goto statement_identifier ;)) (do_statement "do {\n    *(uint *)(unaff_retaddr + 0xc) = uVar4 * 2;\n    uVar3 = (*(code *)*puVar1)(*(undefined4 *)(unaff_retaddr + 4),uVar6,uVar4 * 2);\n    uVar6 = *(uint *)(unaff_retaddr + 0xc);\n    iVar5 = *(int *)(unaff_retaddr + 8);\n    *(undefined4 *)(unaff_retaddr + 4) = uVar3;\nLAB_00077c76:\n    do {\n      iVar2 = uVar6 - iVar5;\n      uVar4 = __vsnprintf_chk(iVar5 + *(int *)(unaff_retaddr + 4),iVar2,1,0xffffffff,param_3,param_4\n                             );\n      if (uVar4 == 0xffffffff) {\nLAB_00077cb8:\n        iVar2 = iVar2 * 2;\n        goto LAB_00077c49;\n      }\n      if (uVar4 < iVar2 - 1U) {\n        *(int *)(unaff_retaddr + 8) = *(int *)(unaff_retaddr + 8) + uVar4;\n        return;\n      }\n      if (uVar4 == iVar2 - 1U) goto LAB_00077cb8;\n      iVar5 = *(int *)(unaff_retaddr + 8);\n      uVar6 = *(uint *)(unaff_retaddr + 0xc);\n      uVar4 = iVar5 + uVar4 + 2;\n    } while (uVar4 < uVar6);\n  } while( true );" do (compound_statement "{\n    *(uint *)(unaff_retaddr + 0xc) = uVar4 * 2;\n    uVar3 = (*(code *)*puVar1)(*(undefined4 *)(unaff_retaddr + 4),uVar6,uVar4 * 2);\n    uVar6 = *(uint *)(unaff_retaddr + 0xc);\n    iVar5 = *(int *)(unaff_retaddr + 8);\n    *(undefined4 *)(unaff_retaddr + 4) = uVar3;\nLAB_00077c76:\n    do {\n      iVar2 = uVar6 - iVar5;\n      uVar4 = __vsnprintf_chk(iVar5 + *(int *)(unaff_retaddr + 4),iVar2,1,0xffffffff,param_3,param_4\n                             );\n      if (uVar4 == 0xffffffff) {\nLAB_00077cb8:\n        iVar2 = iVar2 * 2;\n        goto LAB_00077c49;\n      }\n      if (uVar4 < iVar2 - 1U) {\n        *(int *)(unaff_retaddr + 8) = *(int *)(unaff_retaddr + 8) + uVar4;\n        return;\n      }\n      if (uVar4 == iVar2 - 1U) goto LAB_00077cb8;\n      iVar5 = *(int *)(unaff_retaddr + 8);\n      uVar6 = *(uint *)(unaff_retaddr + 0xc);\n      uVar4 = iVar5 + uVar4 + 2;\n    } while (uVar4 < uVar6);\n  }" { (expression_statement "*(uint *)(unaff_retaddr + 0xc) = uVar4 * 2;" (assignment_expression "*(uint *)(unaff_retaddr + 0xc) = uVar4 * 2" (pointer_expression "*(uint *)(unaff_retaddr + 0xc)" * (cast_expression "(uint *)(unaff_retaddr + 0xc)" ( (type_descriptor "uint *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(unaff_retaddr + 0xc)" ( (binary_expression "unaff_retaddr + 0xc" identifier + number_literal) )))) = (binary_expression "uVar4 * 2" identifier * number_literal)) ;) (expression_statement "uVar3 = (*(code *)*puVar1)(*(undefined4 *)(unaff_retaddr + 4),uVar6,uVar4 * 2);" (assignment_expression "uVar3 = (*(code *)*puVar1)(*(undefined4 *)(unaff_retaddr + 4),uVar6,uVar4 * 2)" identifier = (call_expression "(*(code *)*puVar1)(*(undefined4 *)(unaff_retaddr + 4),uVar6,uVar4 * 2)" (parenthesized_expression "(*(code *)*puVar1)" ( (pointer_expression "*(code *)*puVar1" * (cast_expression "(code *)*puVar1" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) (pointer_expression "*puVar1" * identifier))) )) (argument_list "(*(undefined4 *)(unaff_retaddr + 4),uVar6,uVar4 * 2)" ( (pointer_expression "*(undefined4 *)(unaff_retaddr + 4)" * (cast_expression "(undefined4 *)(unaff_retaddr + 4)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(unaff_retaddr + 4)" ( (binary_expression "unaff_retaddr + 4" identifier + number_literal) )))) , identifier , (binary_expression "uVar4 * 2" identifier * number_literal) )))) ;) (expression_statement "uVar6 = *(uint *)(unaff_retaddr + 0xc);" (assignment_expression "uVar6 = *(uint *)(unaff_retaddr + 0xc)" identifier = (pointer_expression "*(uint *)(unaff_retaddr + 0xc)" * (cast_expression "(uint *)(unaff_retaddr + 0xc)" ( (type_descriptor "uint *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(unaff_retaddr + 0xc)" ( (binary_expression "unaff_retaddr + 0xc" identifier + number_literal) ))))) ;) (expression_statement "iVar5 = *(int *)(unaff_retaddr + 8);" (assignment_expression "iVar5 = *(int *)(unaff_retaddr + 8)" identifier = (pointer_expression "*(int *)(unaff_retaddr + 8)" * (cast_expression "(int *)(unaff_retaddr + 8)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(unaff_retaddr + 8)" ( (binary_expression "unaff_retaddr + 8" identifier + number_literal) ))))) ;) (expression_statement "*(undefined4 *)(unaff_retaddr + 4) = uVar3;" (assignment_expression "*(undefined4 *)(unaff_retaddr + 4) = uVar3" (pointer_expression "*(undefined4 *)(unaff_retaddr + 4)" * (cast_expression "(undefined4 *)(unaff_retaddr + 4)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(unaff_retaddr + 4)" ( (binary_expression "unaff_retaddr + 4" identifier + number_literal) )))) = identifier) ;) (labeled_statement "LAB_00077c76:\n    do {\n      iVar2 = uVar6 - iVar5;\n      uVar4 = __vsnprintf_chk(iVar5 + *(int *)(unaff_retaddr + 4),iVar2,1,0xffffffff,param_3,param_4\n                             );\n      if (uVar4 == 0xffffffff) {\nLAB_00077cb8:\n        iVar2 = iVar2 * 2;\n        goto LAB_00077c49;\n      }\n      if (uVar4 < iVar2 - 1U) {\n        *(int *)(unaff_retaddr + 8) = *(int *)(unaff_retaddr + 8) + uVar4;\n        return;\n      }\n      if (uVar4 == iVar2 - 1U) goto LAB_00077cb8;\n      iVar5 = *(int *)(unaff_retaddr + 8);\n      uVar6 = *(uint *)(unaff_retaddr + 0xc);\n      uVar4 = iVar5 + uVar4 + 2;\n    } while (uVar4 < uVar6);" statement_identifier : (do_statement "do {\n      iVar2 = uVar6 - iVar5;\n      uVar4 = __vsnprintf_chk(iVar5 + *(int *)(unaff_retaddr + 4),iVar2,1,0xffffffff,param_3,param_4\n                             );\n      if (uVar4 == 0xffffffff) {\nLAB_00077cb8:\n        iVar2 = iVar2 * 2;\n        goto LAB_00077c49;\n      }\n      if (uVar4 < iVar2 - 1U) {\n        *(int *)(unaff_retaddr + 8) = *(int *)(unaff_retaddr + 8) + uVar4;\n        return;\n      }\n      if (uVar4 == iVar2 - 1U) goto LAB_00077cb8;\n      iVar5 = *(int *)(unaff_retaddr + 8);\n      uVar6 = *(uint *)(unaff_retaddr + 0xc);\n      uVar4 = iVar5 + uVar4 + 2;\n    } while (uVar4 < uVar6);" do (compound_statement "{\n      iVar2 = uVar6 - iVar5;\n      uVar4 = __vsnprintf_chk(iVar5 + *(int *)(unaff_retaddr + 4),iVar2,1,0xffffffff,param_3,param_4\n                             );\n      if (uVar4 == 0xffffffff) {\nLAB_00077cb8:\n        iVar2 = iVar2 * 2;\n        goto LAB_00077c49;\n      }\n      if (uVar4 < iVar2 - 1U) {\n        *(int *)(unaff_retaddr + 8) = *(int *)(unaff_retaddr + 8) + uVar4;\n        return;\n      }\n      if (uVar4 == iVar2 - 1U) goto LAB_00077cb8;\n      iVar5 = *(int *)(unaff_retaddr + 8);\n      uVar6 = *(uint *)(unaff_retaddr + 0xc);\n      uVar4 = iVar5 + uVar4 + 2;\n    }" { (expression_statement "iVar2 = uVar6 - iVar5;" (assignment_expression "iVar2 = uVar6 - iVar5" identifier = (binary_expression "uVar6 - iVar5" identifier - identifier)) ;) (expression_statement "uVar4 = __vsnprintf_chk(iVar5 + *(int *)(unaff_retaddr + 4),iVar2,1,0xffffffff,param_3,param_4\n                             );" (assignment_expression "uVar4 = __vsnprintf_chk(iVar5 + *(int *)(unaff_retaddr + 4),iVar2,1,0xffffffff,param_3,param_4\n                             )" identifier = (call_expression "__vsnprintf_chk(iVar5 + *(int *)(unaff_retaddr + 4),iVar2,1,0xffffffff,param_3,param_4\n                             )" identifier (argument_list "(iVar5 + *(int *)(unaff_retaddr + 4),iVar2,1,0xffffffff,param_3,param_4\n                             )" ( (binary_expression "iVar5 + *(int *)(unaff_retaddr + 4)" identifier + (pointer_expression "*(int *)(unaff_retaddr + 4)" * (cast_expression "(int *)(unaff_retaddr + 4)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(unaff_retaddr + 4)" ( (binary_expression "unaff_retaddr + 4" identifier + number_literal) ))))) , identifier , number_literal , number_literal , identifier , identifier )))) ;) (if_statement "if (uVar4 == 0xffffffff) {\nLAB_00077cb8:\n        iVar2 = iVar2 * 2;\n        goto LAB_00077c49;\n      }" if (parenthesized_expression "(uVar4 == 0xffffffff)" ( (binary_expression "uVar4 == 0xffffffff" identifier == number_literal) )) (compound_statement "{\nLAB_00077cb8:\n        iVar2 = iVar2 * 2;\n        goto LAB_00077c49;\n      }" { (labeled_statement "LAB_00077cb8:\n        iVar2 = iVar2 * 2;" statement_identifier : (expression_statement "iVar2 = iVar2 * 2;" (assignment_expression "iVar2 = iVar2 * 2" identifier = (binary_expression "iVar2 * 2" identifier * number_literal)) ;)) (goto_statement "goto LAB_00077c49;" goto statement_identifier ;) })) (if_statement "if (uVar4 < iVar2 - 1U) {\n        *(int *)(unaff_retaddr + 8) = *(int *)(unaff_retaddr + 8) + uVar4;\n        return;\n      }" if (parenthesized_expression "(uVar4 < iVar2 - 1U)" ( (binary_expression "uVar4 < iVar2 - 1U" identifier < (binary_expression "iVar2 - 1U" identifier - number_literal)) )) (compound_statement "{\n        *(int *)(unaff_retaddr + 8) = *(int *)(unaff_retaddr + 8) + uVar4;\n        return;\n      }" { (expression_statement "*(int *)(unaff_retaddr + 8) = *(int *)(unaff_retaddr + 8) + uVar4;" (assignment_expression "*(int *)(unaff_retaddr + 8) = *(int *)(unaff_retaddr + 8) + uVar4" (pointer_expression "*(int *)(unaff_retaddr + 8)" * (cast_expression "(int *)(unaff_retaddr + 8)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(unaff_retaddr + 8)" ( (binary_expression "unaff_retaddr + 8" identifier + number_literal) )))) = (binary_expression "*(int *)(unaff_retaddr + 8) + uVar4" (pointer_expression "*(int *)(unaff_retaddr + 8)" * (cast_expression "(int *)(unaff_retaddr + 8)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(unaff_retaddr + 8)" ( (binary_expression "unaff_retaddr + 8" identifier + number_literal) )))) + identifier)) ;) (return_statement "return;" return ;) })) (if_statement "if (uVar4 == iVar2 - 1U) goto LAB_00077cb8;" if (parenthesized_expression "(uVar4 == iVar2 - 1U)" ( (binary_expression "uVar4 == iVar2 - 1U" identifier == (binary_expression "iVar2 - 1U" identifier - number_literal)) )) (goto_statement "goto LAB_00077cb8;" goto statement_identifier ;)) (expression_statement "iVar5 = *(int *)(unaff_retaddr + 8);" (assignment_expression "iVar5 = *(int *)(unaff_retaddr + 8)" identifier = (pointer_expression "*(int *)(unaff_retaddr + 8)" * (cast_expression "(int *)(unaff_retaddr + 8)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(unaff_retaddr + 8)" ( (binary_expression "unaff_retaddr + 8" identifier + number_literal) ))))) ;) (expression_statement "uVar6 = *(uint *)(unaff_retaddr + 0xc);" (assignment_expression "uVar6 = *(uint *)(unaff_retaddr + 0xc)" identifier = (pointer_expression "*(uint *)(unaff_retaddr + 0xc)" * (cast_expression "(uint *)(unaff_retaddr + 0xc)" ( (type_descriptor "uint *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(unaff_retaddr + 0xc)" ( (binary_expression "unaff_retaddr + 0xc" identifier + number_literal) ))))) ;) (expression_statement "uVar4 = iVar5 + uVar4 + 2;" (assignment_expression "uVar4 = iVar5 + uVar4 + 2" identifier = (binary_expression "iVar5 + uVar4 + 2" (binary_expression "iVar5 + uVar4" identifier + identifier) + number_literal)) ;) }) while (parenthesized_expression "(uVar4 < uVar6)" ( (binary_expression "uVar4 < uVar6" identifier < identifier) )) ;)) }) while (parenthesized_expression "( true )" ( true )) ;) })))
(translation_unit "/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n/* WARNING: Unknown calling convention */\n\nint gmp_asprintf_format(gmp_asprintf_t *d,char *fmt,va_list orig_ap)\n\n{\n  undefined *puVar1;\n  int iVar2;\n  char *pcVar3;\n  uint uVar4;\n  size_t sVar5;\n  uint uVar6;\n  \n  puVar1 = PTR___gmp_reallocate_func_00098d4c;\n  iVar2 = 0x100;\nLAB_00077c49:\n  sVar5 = d->size;\n  uVar6 = d->alloc;\n  uVar4 = sVar5 + iVar2;\n  if (uVar4 < uVar6) goto LAB_00077c76;\n  do {\n    d->alloc = uVar4 * 2;\n    pcVar3 = (char *)(**(code **)puVar1)(d->buf,uVar6,uVar4 * 2);\n    uVar6 = d->alloc;\n    sVar5 = d->size;\n    d->buf = pcVar3;\nLAB_00077c76:\n    do {\n      iVar2 = uVar6 - sVar5;\n      uVar4 = __vsnprintf_chk(d->buf + sVar5,iVar2,1,0xffffffff,fmt,orig_ap);\n      if (uVar4 == 0xffffffff) {\nLAB_00077cb8:\n        iVar2 = iVar2 * 2;\n        goto LAB_00077c49;\n      }\n      if (uVar4 < iVar2 - 1U) {\n        d->size = d->size + uVar4;\n        return uVar4;\n      }\n      if (uVar4 == iVar2 - 1U) goto LAB_00077cb8;\n      sVar5 = d->size;\n      uVar6 = d->alloc;\n      uVar4 = sVar5 + uVar4 + 2;\n    } while (uVar4 < uVar6);\n  } while( true );\n}\n\n" comment comment (function_definition "int gmp_asprintf_format(gmp_asprintf_t *d,char *fmt,va_list orig_ap)\n\n{\n  undefined *puVar1;\n  int iVar2;\n  char *pcVar3;\n  uint uVar4;\n  size_t sVar5;\n  uint uVar6;\n  \n  puVar1 = PTR___gmp_reallocate_func_00098d4c;\n  iVar2 = 0x100;\nLAB_00077c49:\n  sVar5 = d->size;\n  uVar6 = d->alloc;\n  uVar4 = sVar5 + iVar2;\n  if (uVar4 < uVar6) goto LAB_00077c76;\n  do {\n    d->alloc = uVar4 * 2;\n    pcVar3 = (char *)(**(code **)puVar1)(d->buf,uVar6,uVar4 * 2);\n    uVar6 = d->alloc;\n    sVar5 = d->size;\n    d->buf = pcVar3;\nLAB_00077c76:\n    do {\n      iVar2 = uVar6 - sVar5;\n      uVar4 = __vsnprintf_chk(d->buf + sVar5,iVar2,1,0xffffffff,fmt,orig_ap);\n      if (uVar4 == 0xffffffff) {\nLAB_00077cb8:\n        iVar2 = iVar2 * 2;\n        goto LAB_00077c49;\n      }\n      if (uVar4 < iVar2 - 1U) {\n        d->size = d->size + uVar4;\n        return uVar4;\n      }\n      if (uVar4 == iVar2 - 1U) goto LAB_00077cb8;\n      sVar5 = d->size;\n      uVar6 = d->alloc;\n      uVar4 = sVar5 + uVar4 + 2;\n    } while (uVar4 < uVar6);\n  } while( true );\n}" primitive_type (function_declarator "gmp_asprintf_format(gmp_asprintf_t *d,char *fmt,va_list orig_ap)" identifier (parameter_list "(gmp_asprintf_t *d,char *fmt,va_list orig_ap)" ( (parameter_declaration "gmp_asprintf_t *d" type_identifier (pointer_declarator "*d" * identifier)) , (parameter_declaration "char *fmt" primitive_type (pointer_declarator "*fmt" * identifier)) , (parameter_declaration "va_list orig_ap" type_identifier identifier) ))) (compound_statement "{\n  undefined *puVar1;\n  int iVar2;\n  char *pcVar3;\n  uint uVar4;\n  size_t sVar5;\n  uint uVar6;\n  \n  puVar1 = PTR___gmp_reallocate_func_00098d4c;\n  iVar2 = 0x100;\nLAB_00077c49:\n  sVar5 = d->size;\n  uVar6 = d->alloc;\n  uVar4 = sVar5 + iVar2;\n  if (uVar4 < uVar6) goto LAB_00077c76;\n  do {\n    d->alloc = uVar4 * 2;\n    pcVar3 = (char *)(**(code **)puVar1)(d->buf,uVar6,uVar4 * 2);\n    uVar6 = d->alloc;\n    sVar5 = d->size;\n    d->buf = pcVar3;\nLAB_00077c76:\n    do {\n      iVar2 = uVar6 - sVar5;\n      uVar4 = __vsnprintf_chk(d->buf + sVar5,iVar2,1,0xffffffff,fmt,orig_ap);\n      if (uVar4 == 0xffffffff) {\nLAB_00077cb8:\n        iVar2 = iVar2 * 2;\n        goto LAB_00077c49;\n      }\n      if (uVar4 < iVar2 - 1U) {\n        d->size = d->size + uVar4;\n        return uVar4;\n      }\n      if (uVar4 == iVar2 - 1U) goto LAB_00077cb8;\n      sVar5 = d->size;\n      uVar6 = d->alloc;\n      uVar4 = sVar5 + uVar4 + 2;\n    } while (uVar4 < uVar6);\n  } while( true );\n}" { (declaration "undefined *puVar1;" type_identifier (pointer_declarator "*puVar1" * identifier) ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "char *pcVar3;" primitive_type (pointer_declarator "*pcVar3" * identifier) ;) (declaration "uint uVar4;" type_identifier identifier ;) (declaration "size_t sVar5;" primitive_type identifier ;) (declaration "uint uVar6;" type_identifier identifier ;) (expression_statement "puVar1 = PTR___gmp_reallocate_func_00098d4c;" (assignment_expression "puVar1 = PTR___gmp_reallocate_func_00098d4c" identifier = identifier) ;) (expression_statement "iVar2 = 0x100;" (assignment_expression "iVar2 = 0x100" identifier = number_literal) ;) (labeled_statement "LAB_00077c49:\n  sVar5 = d->size;" statement_identifier : (expression_statement "sVar5 = d->size;" (assignment_expression "sVar5 = d->size" identifier = (field_expression "d->size" identifier -> field_identifier)) ;)) (expression_statement "uVar6 = d->alloc;" (assignment_expression "uVar6 = d->alloc" identifier = (field_expression "d->alloc" identifier -> field_identifier)) ;) (expression_statement "uVar4 = sVar5 + iVar2;" (assignment_expression "uVar4 = sVar5 + iVar2" identifier = (binary_expression "sVar5 + iVar2" identifier + identifier)) ;) (if_statement "if (uVar4 < uVar6) goto LAB_00077c76;" if (parenthesized_expression "(uVar4 < uVar6)" ( (binary_expression "uVar4 < uVar6" identifier < identifier) )) (goto_statement "goto LAB_00077c76;" goto statement_identifier ;)) (do_statement "do {\n    d->alloc = uVar4 * 2;\n    pcVar3 = (char *)(**(code **)puVar1)(d->buf,uVar6,uVar4 * 2);\n    uVar6 = d->alloc;\n    sVar5 = d->size;\n    d->buf = pcVar3;\nLAB_00077c76:\n    do {\n      iVar2 = uVar6 - sVar5;\n      uVar4 = __vsnprintf_chk(d->buf + sVar5,iVar2,1,0xffffffff,fmt,orig_ap);\n      if (uVar4 == 0xffffffff) {\nLAB_00077cb8:\n        iVar2 = iVar2 * 2;\n        goto LAB_00077c49;\n      }\n      if (uVar4 < iVar2 - 1U) {\n        d->size = d->size + uVar4;\n        return uVar4;\n      }\n      if (uVar4 == iVar2 - 1U) goto LAB_00077cb8;\n      sVar5 = d->size;\n      uVar6 = d->alloc;\n      uVar4 = sVar5 + uVar4 + 2;\n    } while (uVar4 < uVar6);\n  } while( true );" do (compound_statement "{\n    d->alloc = uVar4 * 2;\n    pcVar3 = (char *)(**(code **)puVar1)(d->buf,uVar6,uVar4 * 2);\n    uVar6 = d->alloc;\n    sVar5 = d->size;\n    d->buf = pcVar3;\nLAB_00077c76:\n    do {\n      iVar2 = uVar6 - sVar5;\n      uVar4 = __vsnprintf_chk(d->buf + sVar5,iVar2,1,0xffffffff,fmt,orig_ap);\n      if (uVar4 == 0xffffffff) {\nLAB_00077cb8:\n        iVar2 = iVar2 * 2;\n        goto LAB_00077c49;\n      }\n      if (uVar4 < iVar2 - 1U) {\n        d->size = d->size + uVar4;\n        return uVar4;\n      }\n      if (uVar4 == iVar2 - 1U) goto LAB_00077cb8;\n      sVar5 = d->size;\n      uVar6 = d->alloc;\n      uVar4 = sVar5 + uVar4 + 2;\n    } while (uVar4 < uVar6);\n  }" { (expression_statement "d->alloc = uVar4 * 2;" (assignment_expression "d->alloc = uVar4 * 2" (field_expression "d->alloc" identifier -> field_identifier) = (binary_expression "uVar4 * 2" identifier * number_literal)) ;) (expression_statement "pcVar3 = (char *)(**(code **)puVar1)(d->buf,uVar6,uVar4 * 2);" (assignment_expression "pcVar3 = (char *)(**(code **)puVar1)(d->buf,uVar6,uVar4 * 2)" identifier = (cast_expression "(char *)(**(code **)puVar1)(d->buf,uVar6,uVar4 * 2)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "(**(code **)puVar1)(d->buf,uVar6,uVar4 * 2)" (parenthesized_expression "(**(code **)puVar1)" ( (pointer_expression "**(code **)puVar1" * (pointer_expression "*(code **)puVar1" * (cast_expression "(code **)puVar1" ( (type_descriptor "code **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) identifier))) )) (argument_list "(d->buf,uVar6,uVar4 * 2)" ( (field_expression "d->buf" identifier -> field_identifier) , identifier , (binary_expression "uVar4 * 2" identifier * number_literal) ))))) ;) (expression_statement "uVar6 = d->alloc;" (assignment_expression "uVar6 = d->alloc" identifier = (field_expression "d->alloc" identifier -> field_identifier)) ;) (expression_statement "sVar5 = d->size;" (assignment_expression "sVar5 = d->size" identifier = (field_expression "d->size" identifier -> field_identifier)) ;) (expression_statement "d->buf = pcVar3;" (assignment_expression "d->buf = pcVar3" (field_expression "d->buf" identifier -> field_identifier) = identifier) ;) (labeled_statement "LAB_00077c76:\n    do {\n      iVar2 = uVar6 - sVar5;\n      uVar4 = __vsnprintf_chk(d->buf + sVar5,iVar2,1,0xffffffff,fmt,orig_ap);\n      if (uVar4 == 0xffffffff) {\nLAB_00077cb8:\n        iVar2 = iVar2 * 2;\n        goto LAB_00077c49;\n      }\n      if (uVar4 < iVar2 - 1U) {\n        d->size = d->size + uVar4;\n        return uVar4;\n      }\n      if (uVar4 == iVar2 - 1U) goto LAB_00077cb8;\n      sVar5 = d->size;\n      uVar6 = d->alloc;\n      uVar4 = sVar5 + uVar4 + 2;\n    } while (uVar4 < uVar6);" statement_identifier : (do_statement "do {\n      iVar2 = uVar6 - sVar5;\n      uVar4 = __vsnprintf_chk(d->buf + sVar5,iVar2,1,0xffffffff,fmt,orig_ap);\n      if (uVar4 == 0xffffffff) {\nLAB_00077cb8:\n        iVar2 = iVar2 * 2;\n        goto LAB_00077c49;\n      }\n      if (uVar4 < iVar2 - 1U) {\n        d->size = d->size + uVar4;\n        return uVar4;\n      }\n      if (uVar4 == iVar2 - 1U) goto LAB_00077cb8;\n      sVar5 = d->size;\n      uVar6 = d->alloc;\n      uVar4 = sVar5 + uVar4 + 2;\n    } while (uVar4 < uVar6);" do (compound_statement "{\n      iVar2 = uVar6 - sVar5;\n      uVar4 = __vsnprintf_chk(d->buf + sVar5,iVar2,1,0xffffffff,fmt,orig_ap);\n      if (uVar4 == 0xffffffff) {\nLAB_00077cb8:\n        iVar2 = iVar2 * 2;\n        goto LAB_00077c49;\n      }\n      if (uVar4 < iVar2 - 1U) {\n        d->size = d->size + uVar4;\n        return uVar4;\n      }\n      if (uVar4 == iVar2 - 1U) goto LAB_00077cb8;\n      sVar5 = d->size;\n      uVar6 = d->alloc;\n      uVar4 = sVar5 + uVar4 + 2;\n    }" { (expression_statement "iVar2 = uVar6 - sVar5;" (assignment_expression "iVar2 = uVar6 - sVar5" identifier = (binary_expression "uVar6 - sVar5" identifier - identifier)) ;) (expression_statement "uVar4 = __vsnprintf_chk(d->buf + sVar5,iVar2,1,0xffffffff,fmt,orig_ap);" (assignment_expression "uVar4 = __vsnprintf_chk(d->buf + sVar5,iVar2,1,0xffffffff,fmt,orig_ap)" identifier = (call_expression "__vsnprintf_chk(d->buf + sVar5,iVar2,1,0xffffffff,fmt,orig_ap)" identifier (argument_list "(d->buf + sVar5,iVar2,1,0xffffffff,fmt,orig_ap)" ( (binary_expression "d->buf + sVar5" (field_expression "d->buf" identifier -> field_identifier) + identifier) , identifier , number_literal , number_literal , identifier , identifier )))) ;) (if_statement "if (uVar4 == 0xffffffff) {\nLAB_00077cb8:\n        iVar2 = iVar2 * 2;\n        goto LAB_00077c49;\n      }" if (parenthesized_expression "(uVar4 == 0xffffffff)" ( (binary_expression "uVar4 == 0xffffffff" identifier == number_literal) )) (compound_statement "{\nLAB_00077cb8:\n        iVar2 = iVar2 * 2;\n        goto LAB_00077c49;\n      }" { (labeled_statement "LAB_00077cb8:\n        iVar2 = iVar2 * 2;" statement_identifier : (expression_statement "iVar2 = iVar2 * 2;" (assignment_expression "iVar2 = iVar2 * 2" identifier = (binary_expression "iVar2 * 2" identifier * number_literal)) ;)) (goto_statement "goto LAB_00077c49;" goto statement_identifier ;) })) (if_statement "if (uVar4 < iVar2 - 1U) {\n        d->size = d->size + uVar4;\n        return uVar4;\n      }" if (parenthesized_expression "(uVar4 < iVar2 - 1U)" ( (binary_expression "uVar4 < iVar2 - 1U" identifier < (binary_expression "iVar2 - 1U" identifier - number_literal)) )) (compound_statement "{\n        d->size = d->size + uVar4;\n        return uVar4;\n      }" { (expression_statement "d->size = d->size + uVar4;" (assignment_expression "d->size = d->size + uVar4" (field_expression "d->size" identifier -> field_identifier) = (binary_expression "d->size + uVar4" (field_expression "d->size" identifier -> field_identifier) + identifier)) ;) (return_statement "return uVar4;" return identifier ;) })) (if_statement "if (uVar4 == iVar2 - 1U) goto LAB_00077cb8;" if (parenthesized_expression "(uVar4 == iVar2 - 1U)" ( (binary_expression "uVar4 == iVar2 - 1U" identifier == (binary_expression "iVar2 - 1U" identifier - number_literal)) )) (goto_statement "goto LAB_00077cb8;" goto statement_identifier ;)) (expression_statement "sVar5 = d->size;" (assignment_expression "sVar5 = d->size" identifier = (field_expression "d->size" identifier -> field_identifier)) ;) (expression_statement "uVar6 = d->alloc;" (assignment_expression "uVar6 = d->alloc" identifier = (field_expression "d->alloc" identifier -> field_identifier)) ;) (expression_statement "uVar4 = sVar5 + uVar4 + 2;" (assignment_expression "uVar4 = sVar5 + uVar4 + 2" identifier = (binary_expression "sVar5 + uVar4 + 2" (binary_expression "sVar5 + uVar4" identifier + identifier) + number_literal)) ;) }) while (parenthesized_expression "(uVar4 < uVar6)" ( (binary_expression "uVar4 < uVar6" identifier < identifier) )) ;)) }) while (parenthesized_expression "( true )" ( true )) ;) })))
(translation_unit "void __regparm2\nFUN_00077c20(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4)\n\n{\n  undefined4 *puVar1;\n  int iVar2;\n  undefined4 uVar3;\n  uint uVar4;\n  int iVar5;\n  int unaff_EBX;\n  uint uVar6;\n  int unaff_retaddr;\n  \n  iVar2 = entry(param_2,0x77c2e);\n  puVar1 = *(undefined4 **)(&DAT_0002111e + unaff_EBX);\nLAB_00077c49:\n  iVar5 = *(int *)(unaff_retaddr + 8);\n  uVar6 = *(uint *)(unaff_retaddr + 0xc);\n  uVar4 = iVar5 + iVar2;\n  if (uVar4 < uVar6) goto LAB_00077c76;\n  do {\n    *(uint *)(unaff_retaddr + 0xc) = uVar4 * 2;\n    uVar3 = (*(code *)*puVar1)(*(undefined4 *)(unaff_retaddr + 4),uVar6,uVar4 * 2);\n    uVar6 = *(uint *)(unaff_retaddr + 0xc);\n    iVar5 = *(int *)(unaff_retaddr + 8);\n    *(undefined4 *)(unaff_retaddr + 4) = uVar3;\nLAB_00077c76:\n    do {\n      iVar2 = uVar6 - iVar5;\n      uVar4 = __vsnprintf_chk(iVar5 + *(int *)(unaff_retaddr + 4),iVar2,1,0xffffffff,param_3,param_4\n                             );\n      if (uVar4 == 0xffffffff) {\nLAB_00077cb8:\n        iVar2 = iVar2 * 2;\n        goto LAB_00077c49;\n      }\n      if (uVar4 < iVar2 - 1U) {\n        *(int *)(unaff_retaddr + 8) = *(int *)(unaff_retaddr + 8) + uVar4;\n        return;\n      }\n      if (uVar4 == iVar2 - 1U) goto LAB_00077cb8;\n      iVar5 = *(int *)(unaff_retaddr + 8);\n      uVar6 = *(uint *)(unaff_retaddr + 0xc);\n      uVar4 = iVar5 + uVar4 + 2;\n    } while (uVar4 < uVar6);\n  } while( true );\n}\n\n" (function_definition "void __regparm2\nFUN_00077c20(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4)\n\n{\n  undefined4 *puVar1;\n  int iVar2;\n  undefined4 uVar3;\n  uint uVar4;\n  int iVar5;\n  int unaff_EBX;\n  uint uVar6;\n  int unaff_retaddr;\n  \n  iVar2 = entry(param_2,0x77c2e);\n  puVar1 = *(undefined4 **)(&DAT_0002111e + unaff_EBX);\nLAB_00077c49:\n  iVar5 = *(int *)(unaff_retaddr + 8);\n  uVar6 = *(uint *)(unaff_retaddr + 0xc);\n  uVar4 = iVar5 + iVar2;\n  if (uVar4 < uVar6) goto LAB_00077c76;\n  do {\n    *(uint *)(unaff_retaddr + 0xc) = uVar4 * 2;\n    uVar3 = (*(code *)*puVar1)(*(undefined4 *)(unaff_retaddr + 4),uVar6,uVar4 * 2);\n    uVar6 = *(uint *)(unaff_retaddr + 0xc);\n    iVar5 = *(int *)(unaff_retaddr + 8);\n    *(undefined4 *)(unaff_retaddr + 4) = uVar3;\nLAB_00077c76:\n    do {\n      iVar2 = uVar6 - iVar5;\n      uVar4 = __vsnprintf_chk(iVar5 + *(int *)(unaff_retaddr + 4),iVar2,1,0xffffffff,param_3,param_4\n                             );\n      if (uVar4 == 0xffffffff) {\nLAB_00077cb8:\n        iVar2 = iVar2 * 2;\n        goto LAB_00077c49;\n      }\n      if (uVar4 < iVar2 - 1U) {\n        *(int *)(unaff_retaddr + 8) = *(int *)(unaff_retaddr + 8) + uVar4;\n        return;\n      }\n      if (uVar4 == iVar2 - 1U) goto LAB_00077cb8;\n      iVar5 = *(int *)(unaff_retaddr + 8);\n      uVar6 = *(uint *)(unaff_retaddr + 0xc);\n      uVar4 = iVar5 + uVar4 + 2;\n    } while (uVar4 < uVar6);\n  } while( true );\n}" primitive_type (ERROR "__regparm2" identifier) (function_declarator "FUN_00077c20(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4)" identifier (parameter_list "(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4)" ( (parameter_declaration "undefined4 param_1" type_identifier identifier) , (parameter_declaration "undefined4 param_2" type_identifier identifier) , (parameter_declaration "undefined4 param_3" type_identifier identifier) , (parameter_declaration "undefined4 param_4" type_identifier identifier) ))) (compound_statement "{\n  undefined4 *puVar1;\n  int iVar2;\n  undefined4 uVar3;\n  uint uVar4;\n  int iVar5;\n  int unaff_EBX;\n  uint uVar6;\n  int unaff_retaddr;\n  \n  iVar2 = entry(param_2,0x77c2e);\n  puVar1 = *(undefined4 **)(&DAT_0002111e + unaff_EBX);\nLAB_00077c49:\n  iVar5 = *(int *)(unaff_retaddr + 8);\n  uVar6 = *(uint *)(unaff_retaddr + 0xc);\n  uVar4 = iVar5 + iVar2;\n  if (uVar4 < uVar6) goto LAB_00077c76;\n  do {\n    *(uint *)(unaff_retaddr + 0xc) = uVar4 * 2;\n    uVar3 = (*(code *)*puVar1)(*(undefined4 *)(unaff_retaddr + 4),uVar6,uVar4 * 2);\n    uVar6 = *(uint *)(unaff_retaddr + 0xc);\n    iVar5 = *(int *)(unaff_retaddr + 8);\n    *(undefined4 *)(unaff_retaddr + 4) = uVar3;\nLAB_00077c76:\n    do {\n      iVar2 = uVar6 - iVar5;\n      uVar4 = __vsnprintf_chk(iVar5 + *(int *)(unaff_retaddr + 4),iVar2,1,0xffffffff,param_3,param_4\n                             );\n      if (uVar4 == 0xffffffff) {\nLAB_00077cb8:\n        iVar2 = iVar2 * 2;\n        goto LAB_00077c49;\n      }\n      if (uVar4 < iVar2 - 1U) {\n        *(int *)(unaff_retaddr + 8) = *(int *)(unaff_retaddr + 8) + uVar4;\n        return;\n      }\n      if (uVar4 == iVar2 - 1U) goto LAB_00077cb8;\n      iVar5 = *(int *)(unaff_retaddr + 8);\n      uVar6 = *(uint *)(unaff_retaddr + 0xc);\n      uVar4 = iVar5 + uVar4 + 2;\n    } while (uVar4 < uVar6);\n  } while( true );\n}" { (declaration "undefined4 *puVar1;" type_identifier (pointer_declarator "*puVar1" * identifier) ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "undefined4 uVar3;" type_identifier identifier ;) (declaration "uint uVar4;" type_identifier identifier ;) (declaration "int iVar5;" primitive_type identifier ;) (declaration "int unaff_EBX;" primitive_type identifier ;) (declaration "uint uVar6;" type_identifier identifier ;) (declaration "int unaff_retaddr;" primitive_type identifier ;) (expression_statement "iVar2 = entry(param_2,0x77c2e);" (assignment_expression "iVar2 = entry(param_2,0x77c2e)" identifier = (call_expression "entry(param_2,0x77c2e)" identifier (argument_list "(param_2,0x77c2e)" ( identifier , number_literal )))) ;) (expression_statement "puVar1 = *(undefined4 **)(&DAT_0002111e + unaff_EBX);" (assignment_expression "puVar1 = *(undefined4 **)(&DAT_0002111e + unaff_EBX)" identifier = (pointer_expression "*(undefined4 **)(&DAT_0002111e + unaff_EBX)" * (cast_expression "(undefined4 **)(&DAT_0002111e + unaff_EBX)" ( (type_descriptor "undefined4 **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(&DAT_0002111e + unaff_EBX)" ( (binary_expression "&DAT_0002111e + unaff_EBX" (pointer_expression "&DAT_0002111e" & identifier) + identifier) ))))) ;) (labeled_statement "LAB_00077c49:\n  iVar5 = *(int *)(unaff_retaddr + 8);" statement_identifier : (expression_statement "iVar5 = *(int *)(unaff_retaddr + 8);" (assignment_expression "iVar5 = *(int *)(unaff_retaddr + 8)" identifier = (pointer_expression "*(int *)(unaff_retaddr + 8)" * (cast_expression "(int *)(unaff_retaddr + 8)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(unaff_retaddr + 8)" ( (binary_expression "unaff_retaddr + 8" identifier + number_literal) ))))) ;)) (expression_statement "uVar6 = *(uint *)(unaff_retaddr + 0xc);" (assignment_expression "uVar6 = *(uint *)(unaff_retaddr + 0xc)" identifier = (pointer_expression "*(uint *)(unaff_retaddr + 0xc)" * (cast_expression "(uint *)(unaff_retaddr + 0xc)" ( (type_descriptor "uint *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(unaff_retaddr + 0xc)" ( (binary_expression "unaff_retaddr + 0xc" identifier + number_literal) ))))) ;) (expression_statement "uVar4 = iVar5 + iVar2;" (assignment_expression "uVar4 = iVar5 + iVar2" identifier = (binary_expression "iVar5 + iVar2" identifier + identifier)) ;) (if_statement "if (uVar4 < uVar6) goto LAB_00077c76;" if (parenthesized_expression "(uVar4 < uVar6)" ( (binary_expression "uVar4 < uVar6" identifier < identifier) )) (goto_statement "goto LAB_00077c76;" goto statement_identifier ;)) (do_statement "do {\n    *(uint *)(unaff_retaddr + 0xc) = uVar4 * 2;\n    uVar3 = (*(code *)*puVar1)(*(undefined4 *)(unaff_retaddr + 4),uVar6,uVar4 * 2);\n    uVar6 = *(uint *)(unaff_retaddr + 0xc);\n    iVar5 = *(int *)(unaff_retaddr + 8);\n    *(undefined4 *)(unaff_retaddr + 4) = uVar3;\nLAB_00077c76:\n    do {\n      iVar2 = uVar6 - iVar5;\n      uVar4 = __vsnprintf_chk(iVar5 + *(int *)(unaff_retaddr + 4),iVar2,1,0xffffffff,param_3,param_4\n                             );\n      if (uVar4 == 0xffffffff) {\nLAB_00077cb8:\n        iVar2 = iVar2 * 2;\n        goto LAB_00077c49;\n      }\n      if (uVar4 < iVar2 - 1U) {\n        *(int *)(unaff_retaddr + 8) = *(int *)(unaff_retaddr + 8) + uVar4;\n        return;\n      }\n      if (uVar4 == iVar2 - 1U) goto LAB_00077cb8;\n      iVar5 = *(int *)(unaff_retaddr + 8);\n      uVar6 = *(uint *)(unaff_retaddr + 0xc);\n      uVar4 = iVar5 + uVar4 + 2;\n    } while (uVar4 < uVar6);\n  } while( true );" do (compound_statement "{\n    *(uint *)(unaff_retaddr + 0xc) = uVar4 * 2;\n    uVar3 = (*(code *)*puVar1)(*(undefined4 *)(unaff_retaddr + 4),uVar6,uVar4 * 2);\n    uVar6 = *(uint *)(unaff_retaddr + 0xc);\n    iVar5 = *(int *)(unaff_retaddr + 8);\n    *(undefined4 *)(unaff_retaddr + 4) = uVar3;\nLAB_00077c76:\n    do {\n      iVar2 = uVar6 - iVar5;\n      uVar4 = __vsnprintf_chk(iVar5 + *(int *)(unaff_retaddr + 4),iVar2,1,0xffffffff,param_3,param_4\n                             );\n      if (uVar4 == 0xffffffff) {\nLAB_00077cb8:\n        iVar2 = iVar2 * 2;\n        goto LAB_00077c49;\n      }\n      if (uVar4 < iVar2 - 1U) {\n        *(int *)(unaff_retaddr + 8) = *(int *)(unaff_retaddr + 8) + uVar4;\n        return;\n      }\n      if (uVar4 == iVar2 - 1U) goto LAB_00077cb8;\n      iVar5 = *(int *)(unaff_retaddr + 8);\n      uVar6 = *(uint *)(unaff_retaddr + 0xc);\n      uVar4 = iVar5 + uVar4 + 2;\n    } while (uVar4 < uVar6);\n  }" { (expression_statement "*(uint *)(unaff_retaddr + 0xc) = uVar4 * 2;" (assignment_expression "*(uint *)(unaff_retaddr + 0xc) = uVar4 * 2" (pointer_expression "*(uint *)(unaff_retaddr + 0xc)" * (cast_expression "(uint *)(unaff_retaddr + 0xc)" ( (type_descriptor "uint *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(unaff_retaddr + 0xc)" ( (binary_expression "unaff_retaddr + 0xc" identifier + number_literal) )))) = (binary_expression "uVar4 * 2" identifier * number_literal)) ;) (expression_statement "uVar3 = (*(code *)*puVar1)(*(undefined4 *)(unaff_retaddr + 4),uVar6,uVar4 * 2);" (assignment_expression "uVar3 = (*(code *)*puVar1)(*(undefined4 *)(unaff_retaddr + 4),uVar6,uVar4 * 2)" identifier = (call_expression "(*(code *)*puVar1)(*(undefined4 *)(unaff_retaddr + 4),uVar6,uVar4 * 2)" (parenthesized_expression "(*(code *)*puVar1)" ( (pointer_expression "*(code *)*puVar1" * (cast_expression "(code *)*puVar1" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) (pointer_expression "*puVar1" * identifier))) )) (argument_list "(*(undefined4 *)(unaff_retaddr + 4),uVar6,uVar4 * 2)" ( (pointer_expression "*(undefined4 *)(unaff_retaddr + 4)" * (cast_expression "(undefined4 *)(unaff_retaddr + 4)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(unaff_retaddr + 4)" ( (binary_expression "unaff_retaddr + 4" identifier + number_literal) )))) , identifier , (binary_expression "uVar4 * 2" identifier * number_literal) )))) ;) (expression_statement "uVar6 = *(uint *)(unaff_retaddr + 0xc);" (assignment_expression "uVar6 = *(uint *)(unaff_retaddr + 0xc)" identifier = (pointer_expression "*(uint *)(unaff_retaddr + 0xc)" * (cast_expression "(uint *)(unaff_retaddr + 0xc)" ( (type_descriptor "uint *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(unaff_retaddr + 0xc)" ( (binary_expression "unaff_retaddr + 0xc" identifier + number_literal) ))))) ;) (expression_statement "iVar5 = *(int *)(unaff_retaddr + 8);" (assignment_expression "iVar5 = *(int *)(unaff_retaddr + 8)" identifier = (pointer_expression "*(int *)(unaff_retaddr + 8)" * (cast_expression "(int *)(unaff_retaddr + 8)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(unaff_retaddr + 8)" ( (binary_expression "unaff_retaddr + 8" identifier + number_literal) ))))) ;) (expression_statement "*(undefined4 *)(unaff_retaddr + 4) = uVar3;" (assignment_expression "*(undefined4 *)(unaff_retaddr + 4) = uVar3" (pointer_expression "*(undefined4 *)(unaff_retaddr + 4)" * (cast_expression "(undefined4 *)(unaff_retaddr + 4)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(unaff_retaddr + 4)" ( (binary_expression "unaff_retaddr + 4" identifier + number_literal) )))) = identifier) ;) (labeled_statement "LAB_00077c76:\n    do {\n      iVar2 = uVar6 - iVar5;\n      uVar4 = __vsnprintf_chk(iVar5 + *(int *)(unaff_retaddr + 4),iVar2,1,0xffffffff,param_3,param_4\n                             );\n      if (uVar4 == 0xffffffff) {\nLAB_00077cb8:\n        iVar2 = iVar2 * 2;\n        goto LAB_00077c49;\n      }\n      if (uVar4 < iVar2 - 1U) {\n        *(int *)(unaff_retaddr + 8) = *(int *)(unaff_retaddr + 8) + uVar4;\n        return;\n      }\n      if (uVar4 == iVar2 - 1U) goto LAB_00077cb8;\n      iVar5 = *(int *)(unaff_retaddr + 8);\n      uVar6 = *(uint *)(unaff_retaddr + 0xc);\n      uVar4 = iVar5 + uVar4 + 2;\n    } while (uVar4 < uVar6);" statement_identifier : (do_statement "do {\n      iVar2 = uVar6 - iVar5;\n      uVar4 = __vsnprintf_chk(iVar5 + *(int *)(unaff_retaddr + 4),iVar2,1,0xffffffff,param_3,param_4\n                             );\n      if (uVar4 == 0xffffffff) {\nLAB_00077cb8:\n        iVar2 = iVar2 * 2;\n        goto LAB_00077c49;\n      }\n      if (uVar4 < iVar2 - 1U) {\n        *(int *)(unaff_retaddr + 8) = *(int *)(unaff_retaddr + 8) + uVar4;\n        return;\n      }\n      if (uVar4 == iVar2 - 1U) goto LAB_00077cb8;\n      iVar5 = *(int *)(unaff_retaddr + 8);\n      uVar6 = *(uint *)(unaff_retaddr + 0xc);\n      uVar4 = iVar5 + uVar4 + 2;\n    } while (uVar4 < uVar6);" do (compound_statement "{\n      iVar2 = uVar6 - iVar5;\n      uVar4 = __vsnprintf_chk(iVar5 + *(int *)(unaff_retaddr + 4),iVar2,1,0xffffffff,param_3,param_4\n                             );\n      if (uVar4 == 0xffffffff) {\nLAB_00077cb8:\n        iVar2 = iVar2 * 2;\n        goto LAB_00077c49;\n      }\n      if (uVar4 < iVar2 - 1U) {\n        *(int *)(unaff_retaddr + 8) = *(int *)(unaff_retaddr + 8) + uVar4;\n        return;\n      }\n      if (uVar4 == iVar2 - 1U) goto LAB_00077cb8;\n      iVar5 = *(int *)(unaff_retaddr + 8);\n      uVar6 = *(uint *)(unaff_retaddr + 0xc);\n      uVar4 = iVar5 + uVar4 + 2;\n    }" { (expression_statement "iVar2 = uVar6 - iVar5;" (assignment_expression "iVar2 = uVar6 - iVar5" identifier = (binary_expression "uVar6 - iVar5" identifier - identifier)) ;) (expression_statement "uVar4 = __vsnprintf_chk(iVar5 + *(int *)(unaff_retaddr + 4),iVar2,1,0xffffffff,param_3,param_4\n                             );" (assignment_expression "uVar4 = __vsnprintf_chk(iVar5 + *(int *)(unaff_retaddr + 4),iVar2,1,0xffffffff,param_3,param_4\n                             )" identifier = (call_expression "__vsnprintf_chk(iVar5 + *(int *)(unaff_retaddr + 4),iVar2,1,0xffffffff,param_3,param_4\n                             )" identifier (argument_list "(iVar5 + *(int *)(unaff_retaddr + 4),iVar2,1,0xffffffff,param_3,param_4\n                             )" ( (binary_expression "iVar5 + *(int *)(unaff_retaddr + 4)" identifier + (pointer_expression "*(int *)(unaff_retaddr + 4)" * (cast_expression "(int *)(unaff_retaddr + 4)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(unaff_retaddr + 4)" ( (binary_expression "unaff_retaddr + 4" identifier + number_literal) ))))) , identifier , number_literal , number_literal , identifier , identifier )))) ;) (if_statement "if (uVar4 == 0xffffffff) {\nLAB_00077cb8:\n        iVar2 = iVar2 * 2;\n        goto LAB_00077c49;\n      }" if (parenthesized_expression "(uVar4 == 0xffffffff)" ( (binary_expression "uVar4 == 0xffffffff" identifier == number_literal) )) (compound_statement "{\nLAB_00077cb8:\n        iVar2 = iVar2 * 2;\n        goto LAB_00077c49;\n      }" { (labeled_statement "LAB_00077cb8:\n        iVar2 = iVar2 * 2;" statement_identifier : (expression_statement "iVar2 = iVar2 * 2;" (assignment_expression "iVar2 = iVar2 * 2" identifier = (binary_expression "iVar2 * 2" identifier * number_literal)) ;)) (goto_statement "goto LAB_00077c49;" goto statement_identifier ;) })) (if_statement "if (uVar4 < iVar2 - 1U) {\n        *(int *)(unaff_retaddr + 8) = *(int *)(unaff_retaddr + 8) + uVar4;\n        return;\n      }" if (parenthesized_expression "(uVar4 < iVar2 - 1U)" ( (binary_expression "uVar4 < iVar2 - 1U" identifier < (binary_expression "iVar2 - 1U" identifier - number_literal)) )) (compound_statement "{\n        *(int *)(unaff_retaddr + 8) = *(int *)(unaff_retaddr + 8) + uVar4;\n        return;\n      }" { (expression_statement "*(int *)(unaff_retaddr + 8) = *(int *)(unaff_retaddr + 8) + uVar4;" (assignment_expression "*(int *)(unaff_retaddr + 8) = *(int *)(unaff_retaddr + 8) + uVar4" (pointer_expression "*(int *)(unaff_retaddr + 8)" * (cast_expression "(int *)(unaff_retaddr + 8)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(unaff_retaddr + 8)" ( (binary_expression "unaff_retaddr + 8" identifier + number_literal) )))) = (binary_expression "*(int *)(unaff_retaddr + 8) + uVar4" (pointer_expression "*(int *)(unaff_retaddr + 8)" * (cast_expression "(int *)(unaff_retaddr + 8)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(unaff_retaddr + 8)" ( (binary_expression "unaff_retaddr + 8" identifier + number_literal) )))) + identifier)) ;) (return_statement "return;" return ;) })) (if_statement "if (uVar4 == iVar2 - 1U) goto LAB_00077cb8;" if (parenthesized_expression "(uVar4 == iVar2 - 1U)" ( (binary_expression "uVar4 == iVar2 - 1U" identifier == (binary_expression "iVar2 - 1U" identifier - number_literal)) )) (goto_statement "goto LAB_00077cb8;" goto statement_identifier ;)) (expression_statement "iVar5 = *(int *)(unaff_retaddr + 8);" (assignment_expression "iVar5 = *(int *)(unaff_retaddr + 8)" identifier = (pointer_expression "*(int *)(unaff_retaddr + 8)" * (cast_expression "(int *)(unaff_retaddr + 8)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(unaff_retaddr + 8)" ( (binary_expression "unaff_retaddr + 8" identifier + number_literal) ))))) ;) (expression_statement "uVar6 = *(uint *)(unaff_retaddr + 0xc);" (assignment_expression "uVar6 = *(uint *)(unaff_retaddr + 0xc)" identifier = (pointer_expression "*(uint *)(unaff_retaddr + 0xc)" * (cast_expression "(uint *)(unaff_retaddr + 0xc)" ( (type_descriptor "uint *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(unaff_retaddr + 0xc)" ( (binary_expression "unaff_retaddr + 0xc" identifier + number_literal) ))))) ;) (expression_statement "uVar4 = iVar5 + uVar4 + 2;" (assignment_expression "uVar4 = iVar5 + uVar4 + 2" identifier = (binary_expression "iVar5 + uVar4 + 2" (binary_expression "iVar5 + uVar4" identifier + identifier) + number_literal)) ;) }) while (parenthesized_expression "(uVar4 < uVar6)" ( (binary_expression "uVar4 < uVar6" identifier < identifier) )) ;)) }) while (parenthesized_expression "( true )" ( true )) ;) })))
(translation_unit (function_definition TYPE (ERROR IDENT) (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE IDENT) ))) (compound_statement { (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT , LIT )))) ;) (expression_statement (assignment_expression IDENT = (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator * (abstract_pointer_declarator *))) ) (parenthesized_expression ( (binary_expression (pointer_expression & IDENT) + IDENT) ))))) ;) (labeled_statement statement_identifier : (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 *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))))) ;) (expression_statement (assignment_expression IDENT = (binary_expression IDENT + IDENT)) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT < IDENT) )) (goto_statement goto statement_identifier ;)) (do_statement do (compound_statement { (expression_statement (assignment_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) = (binary_expression IDENT * LIT)) ;) (expression_statement (assignment_expression IDENT = (call_expression (parenthesized_expression ( (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (pointer_expression * IDENT))) )) (argument_list ( (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) , IDENT , (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 = (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))))) ;) (expression_statement (assignment_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) = IDENT) ;) (labeled_statement statement_identifier : (do_statement do (compound_statement { (expression_statement (assignment_expression IDENT = (binary_expression IDENT - IDENT)) ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( (binary_expression IDENT + (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))))) , IDENT , LIT , LIT , IDENT , IDENT )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (labeled_statement statement_identifier : (expression_statement (assignment_expression IDENT = (binary_expression IDENT * LIT)) ;)) (goto_statement goto statement_identifier ;) })) (if_statement if (parenthesized_expression ( (binary_expression IDENT < (binary_expression IDENT - LIT)) )) (compound_statement { (expression_statement (assignment_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) = (binary_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) + IDENT)) ;) (return_statement return ;) })) (if_statement if (parenthesized_expression ( (binary_expression IDENT == (binary_expression IDENT - LIT)) )) (goto_statement goto statement_identifier ;)) (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 *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))))) ;) (expression_statement (assignment_expression IDENT = (binary_expression (binary_expression IDENT + IDENT) + LIT)) ;) }) while (parenthesized_expression ( (binary_expression IDENT < IDENT) )) ;)) }) while (parenthesized_expression ( BOOL )) ;) })))
(function_definition "void __regparm2\nFUN_00077c20(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4)\n\n{\n  undefined4 *puVar1;\n  int iVar2;\n  undefined4 uVar3;\n  uint uVar4;\n  int iVar5;\n  int unaff_EBX;\n  uint uVar6;\n  int unaff_retaddr;\n  \n  iVar2 = entry(param_2,0x77c2e);\n  puVar1 = *(undefined4 **)(&DAT_0002111e + unaff_EBX);\nLAB_00077c49:\n  iVar5 = *(int *)(unaff_retaddr + 8);\n  uVar6 = *(uint *)(unaff_retaddr + 0xc);\n  uVar4 = iVar5 + iVar2;\n  if (uVar4 < uVar6) goto LAB_00077c76;\n  do {\n    *(uint *)(unaff_retaddr + 0xc) = uVar4 * 2;\n    uVar3 = (*(code *)*puVar1)(*(undefined4 *)(unaff_retaddr + 4),uVar6,uVar4 * 2);\n    uVar6 = *(uint *)(unaff_retaddr + 0xc);\n    iVar5 = *(int *)(unaff_retaddr + 8);\n    *(undefined4 *)(unaff_retaddr + 4) = uVar3;\nLAB_00077c76:\n    do {\n      iVar2 = uVar6 - iVar5;\n      uVar4 = __vsnprintf_chk(iVar5 + *(int *)(unaff_retaddr + 4),iVar2,1,0xffffffff,param_3,param_4\n                             );\n      if (uVar4 == 0xffffffff) {\nLAB_00077cb8:\n        iVar2 = iVar2 * 2;\n        goto LAB_00077c49;\n      }\n      if (uVar4 < iVar2 - 1U) {\n        *(int *)(unaff_retaddr + 8) = *(int *)(unaff_retaddr + 8) + uVar4;\n        return;\n      }\n      if (uVar4 == iVar2 - 1U) goto LAB_00077cb8;\n      iVar5 = *(int *)(unaff_retaddr + 8);\n      uVar6 = *(uint *)(unaff_retaddr + 0xc);\n      uVar4 = iVar5 + uVar4 + 2;\n    } while (uVar4 < uVar6);\n  } while( true );\n}" (primitive_type "void") (ERROR "__regparm2" (identifier "__regparm2")) (function_declarator "FUN_00077c20(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4)" (identifier "FUN_00077c20") (parameter_list "(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4)" (( "(") (parameter_declaration "undefined4 param_1" (type_identifier "undefined4") (identifier "param_1")) (, ",") (parameter_declaration "undefined4 param_2" (type_identifier "undefined4") (identifier "param_2")) (, ",") (parameter_declaration "undefined4 param_3" (type_identifier "undefined4") (identifier "param_3")) (, ",") (parameter_declaration "undefined4 param_4" (type_identifier "undefined4") (identifier "param_4")) () ")"))) (compound_statement "{\n  undefined4 *puVar1;\n  int iVar2;\n  undefined4 uVar3;\n  uint uVar4;\n  int iVar5;\n  int unaff_EBX;\n  uint uVar6;\n  int unaff_retaddr;\n  \n  iVar2 = entry(param_2,0x77c2e);\n  puVar1 = *(undefined4 **)(&DAT_0002111e + unaff_EBX);\nLAB_00077c49:\n  iVar5 = *(int *)(unaff_retaddr + 8);\n  uVar6 = *(uint *)(unaff_retaddr + 0xc);\n  uVar4 = iVar5 + iVar2;\n  if (uVar4 < uVar6) goto LAB_00077c76;\n  do {\n    *(uint *)(unaff_retaddr + 0xc) = uVar4 * 2;\n    uVar3 = (*(code *)*puVar1)(*(undefined4 *)(unaff_retaddr + 4),uVar6,uVar4 * 2);\n    uVar6 = *(uint *)(unaff_retaddr + 0xc);\n    iVar5 = *(int *)(unaff_retaddr + 8);\n    *(undefined4 *)(unaff_retaddr + 4) = uVar3;\nLAB_00077c76:\n    do {\n      iVar2 = uVar6 - iVar5;\n      uVar4 = __vsnprintf_chk(iVar5 + *(int *)(unaff_retaddr + 4),iVar2,1,0xffffffff,param_3,param_4\n                             );\n      if (uVar4 == 0xffffffff) {\nLAB_00077cb8:\n        iVar2 = iVar2 * 2;\n        goto LAB_00077c49;\n      }\n      if (uVar4 < iVar2 - 1U) {\n        *(int *)(unaff_retaddr + 8) = *(int *)(unaff_retaddr + 8) + uVar4;\n        return;\n      }\n      if (uVar4 == iVar2 - 1U) goto LAB_00077cb8;\n      iVar5 = *(int *)(unaff_retaddr + 8);\n      uVar6 = *(uint *)(unaff_retaddr + 0xc);\n      uVar4 = iVar5 + uVar4 + 2;\n    } while (uVar4 < uVar6);\n  } while( true );\n}" ({ "{") (declaration "undefined4 *puVar1;" (type_identifier "undefined4") (pointer_declarator "*puVar1" (* "*") (identifier "puVar1")) (; ";")) (declaration "int iVar2;" (primitive_type "int") (identifier "iVar2") (; ";")) (declaration "undefined4 uVar3;" (type_identifier "undefined4") (identifier "uVar3") (; ";")) (declaration "uint uVar4;" (type_identifier "uint") (identifier "uVar4") (; ";")) (declaration "int iVar5;" (primitive_type "int") (identifier "iVar5") (; ";")) (declaration "int unaff_EBX;" (primitive_type "int") (identifier "unaff_EBX") (; ";")) (declaration "uint uVar6;" (type_identifier "uint") (identifier "uVar6") (; ";")) (declaration "int unaff_retaddr;" (primitive_type "int") (identifier "unaff_retaddr") (; ";")) (expression_statement "iVar2 = entry(param_2,0x77c2e);" (assignment_expression "iVar2 = entry(param_2,0x77c2e)" (identifier "iVar2") (= "=") (call_expression "entry(param_2,0x77c2e)" (identifier "entry") (argument_list "(param_2,0x77c2e)" (( "(") (identifier "param_2") (, ",") (number_literal "0x77c2e") () ")")))) (; ";")) (expression_statement "puVar1 = *(undefined4 **)(&DAT_0002111e + unaff_EBX);" (assignment_expression "puVar1 = *(undefined4 **)(&DAT_0002111e + unaff_EBX)" (identifier "puVar1") (= "=") (pointer_expression "*(undefined4 **)(&DAT_0002111e + unaff_EBX)" (* "*") (cast_expression "(undefined4 **)(&DAT_0002111e + unaff_EBX)" (( "(") (type_descriptor "undefined4 **" (type_identifier "undefined4") (abstract_pointer_declarator "**" (* "*") (abstract_pointer_declarator "*" (* "*")))) () ")") (parenthesized_expression "(&DAT_0002111e + unaff_EBX)" (( "(") (binary_expression "&DAT_0002111e + unaff_EBX" (pointer_expression "&DAT_0002111e" (& "&") (identifier "DAT_0002111e")) (+ "+") (identifier "unaff_EBX")) () ")"))))) (; ";")) (labeled_statement "LAB_00077c49:\n  iVar5 = *(int *)(unaff_retaddr + 8);" (statement_identifier "LAB_00077c49") (: ":") (expression_statement "iVar5 = *(int *)(unaff_retaddr + 8);" (assignment_expression "iVar5 = *(int *)(unaff_retaddr + 8)" (identifier "iVar5") (= "=") (pointer_expression "*(int *)(unaff_retaddr + 8)" (* "*") (cast_expression "(int *)(unaff_retaddr + 8)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(unaff_retaddr + 8)" (( "(") (binary_expression "unaff_retaddr + 8" (identifier "unaff_retaddr") (+ "+") (number_literal "8")) () ")"))))) (; ";"))) (expression_statement "uVar6 = *(uint *)(unaff_retaddr + 0xc);" (assignment_expression "uVar6 = *(uint *)(unaff_retaddr + 0xc)" (identifier "uVar6") (= "=") (pointer_expression "*(uint *)(unaff_retaddr + 0xc)" (* "*") (cast_expression "(uint *)(unaff_retaddr + 0xc)" (( "(") (type_descriptor "uint *" (type_identifier "uint") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(unaff_retaddr + 0xc)" (( "(") (binary_expression "unaff_retaddr + 0xc" (identifier "unaff_retaddr") (+ "+") (number_literal "0xc")) () ")"))))) (; ";")) (expression_statement "uVar4 = iVar5 + iVar2;" (assignment_expression "uVar4 = iVar5 + iVar2" (identifier "uVar4") (= "=") (binary_expression "iVar5 + iVar2" (identifier "iVar5") (+ "+") (identifier "iVar2"))) (; ";")) (if_statement "if (uVar4 < uVar6) goto LAB_00077c76;" (if "if") (parenthesized_expression "(uVar4 < uVar6)" (( "(") (binary_expression "uVar4 < uVar6" (identifier "uVar4") (< "<") (identifier "uVar6")) () ")")) (goto_statement "goto LAB_00077c76;" (goto "goto") (statement_identifier "LAB_00077c76") (; ";"))) (do_statement "do {\n    *(uint *)(unaff_retaddr + 0xc) = uVar4 * 2;\n    uVar3 = (*(code *)*puVar1)(*(undefined4 *)(unaff_retaddr + 4),uVar6,uVar4 * 2);\n    uVar6 = *(uint *)(unaff_retaddr + 0xc);\n    iVar5 = *(int *)(unaff_retaddr + 8);\n    *(undefined4 *)(unaff_retaddr + 4) = uVar3;\nLAB_00077c76:\n    do {\n      iVar2 = uVar6 - iVar5;\n      uVar4 = __vsnprintf_chk(iVar5 + *(int *)(unaff_retaddr + 4),iVar2,1,0xffffffff,param_3,param_4\n                             );\n      if (uVar4 == 0xffffffff) {\nLAB_00077cb8:\n        iVar2 = iVar2 * 2;\n        goto LAB_00077c49;\n      }\n      if (uVar4 < iVar2 - 1U) {\n        *(int *)(unaff_retaddr + 8) = *(int *)(unaff_retaddr + 8) + uVar4;\n        return;\n      }\n      if (uVar4 == iVar2 - 1U) goto LAB_00077cb8;\n      iVar5 = *(int *)(unaff_retaddr + 8);\n      uVar6 = *(uint *)(unaff_retaddr + 0xc);\n      uVar4 = iVar5 + uVar4 + 2;\n    } while (uVar4 < uVar6);\n  } while( true );" (do "do") (compound_statement "{\n    *(uint *)(unaff_retaddr + 0xc) = uVar4 * 2;\n    uVar3 = (*(code *)*puVar1)(*(undefined4 *)(unaff_retaddr + 4),uVar6,uVar4 * 2);\n    uVar6 = *(uint *)(unaff_retaddr + 0xc);\n    iVar5 = *(int *)(unaff_retaddr + 8);\n    *(undefined4 *)(unaff_retaddr + 4) = uVar3;\nLAB_00077c76:\n    do {\n      iVar2 = uVar6 - iVar5;\n      uVar4 = __vsnprintf_chk(iVar5 + *(int *)(unaff_retaddr + 4),iVar2,1,0xffffffff,param_3,param_4\n                             );\n      if (uVar4 == 0xffffffff) {\nLAB_00077cb8:\n        iVar2 = iVar2 * 2;\n        goto LAB_00077c49;\n      }\n      if (uVar4 < iVar2 - 1U) {\n        *(int *)(unaff_retaddr + 8) = *(int *)(unaff_retaddr + 8) + uVar4;\n        return;\n      }\n      if (uVar4 == iVar2 - 1U) goto LAB_00077cb8;\n      iVar5 = *(int *)(unaff_retaddr + 8);\n      uVar6 = *(uint *)(unaff_retaddr + 0xc);\n      uVar4 = iVar5 + uVar4 + 2;\n    } while (uVar4 < uVar6);\n  }" ({ "{") (expression_statement "*(uint *)(unaff_retaddr + 0xc) = uVar4 * 2;" (assignment_expression "*(uint *)(unaff_retaddr + 0xc) = uVar4 * 2" (pointer_expression "*(uint *)(unaff_retaddr + 0xc)" (* "*") (cast_expression "(uint *)(unaff_retaddr + 0xc)" (( "(") (type_descriptor "uint *" (type_identifier "uint") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(unaff_retaddr + 0xc)" (( "(") (binary_expression "unaff_retaddr + 0xc" (identifier "unaff_retaddr") (+ "+") (number_literal "0xc")) () ")")))) (= "=") (binary_expression "uVar4 * 2" (identifier "uVar4") (* "*") (number_literal "2"))) (; ";")) (expression_statement "uVar3 = (*(code *)*puVar1)(*(undefined4 *)(unaff_retaddr + 4),uVar6,uVar4 * 2);" (assignment_expression "uVar3 = (*(code *)*puVar1)(*(undefined4 *)(unaff_retaddr + 4),uVar6,uVar4 * 2)" (identifier "uVar3") (= "=") (call_expression "(*(code *)*puVar1)(*(undefined4 *)(unaff_retaddr + 4),uVar6,uVar4 * 2)" (parenthesized_expression "(*(code *)*puVar1)" (( "(") (pointer_expression "*(code *)*puVar1" (* "*") (cast_expression "(code *)*puVar1" (( "(") (type_descriptor "code *" (type_identifier "code") (abstract_pointer_declarator "*" (* "*"))) () ")") (pointer_expression "*puVar1" (* "*") (identifier "puVar1")))) () ")")) (argument_list "(*(undefined4 *)(unaff_retaddr + 4),uVar6,uVar4 * 2)" (( "(") (pointer_expression "*(undefined4 *)(unaff_retaddr + 4)" (* "*") (cast_expression "(undefined4 *)(unaff_retaddr + 4)" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(unaff_retaddr + 4)" (( "(") (binary_expression "unaff_retaddr + 4" (identifier "unaff_retaddr") (+ "+") (number_literal "4")) () ")")))) (, ",") (identifier "uVar6") (, ",") (binary_expression "uVar4 * 2" (identifier "uVar4") (* "*") (number_literal "2")) () ")")))) (; ";")) (expression_statement "uVar6 = *(uint *)(unaff_retaddr + 0xc);" (assignment_expression "uVar6 = *(uint *)(unaff_retaddr + 0xc)" (identifier "uVar6") (= "=") (pointer_expression "*(uint *)(unaff_retaddr + 0xc)" (* "*") (cast_expression "(uint *)(unaff_retaddr + 0xc)" (( "(") (type_descriptor "uint *" (type_identifier "uint") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(unaff_retaddr + 0xc)" (( "(") (binary_expression "unaff_retaddr + 0xc" (identifier "unaff_retaddr") (+ "+") (number_literal "0xc")) () ")"))))) (; ";")) (expression_statement "iVar5 = *(int *)(unaff_retaddr + 8);" (assignment_expression "iVar5 = *(int *)(unaff_retaddr + 8)" (identifier "iVar5") (= "=") (pointer_expression "*(int *)(unaff_retaddr + 8)" (* "*") (cast_expression "(int *)(unaff_retaddr + 8)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(unaff_retaddr + 8)" (( "(") (binary_expression "unaff_retaddr + 8" (identifier "unaff_retaddr") (+ "+") (number_literal "8")) () ")"))))) (; ";")) (expression_statement "*(undefined4 *)(unaff_retaddr + 4) = uVar3;" (assignment_expression "*(undefined4 *)(unaff_retaddr + 4) = uVar3" (pointer_expression "*(undefined4 *)(unaff_retaddr + 4)" (* "*") (cast_expression "(undefined4 *)(unaff_retaddr + 4)" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(unaff_retaddr + 4)" (( "(") (binary_expression "unaff_retaddr + 4" (identifier "unaff_retaddr") (+ "+") (number_literal "4")) () ")")))) (= "=") (identifier "uVar3")) (; ";")) (labeled_statement "LAB_00077c76:\n    do {\n      iVar2 = uVar6 - iVar5;\n      uVar4 = __vsnprintf_chk(iVar5 + *(int *)(unaff_retaddr + 4),iVar2,1,0xffffffff,param_3,param_4\n                             );\n      if (uVar4 == 0xffffffff) {\nLAB_00077cb8:\n        iVar2 = iVar2 * 2;\n        goto LAB_00077c49;\n      }\n      if (uVar4 < iVar2 - 1U) {\n        *(int *)(unaff_retaddr + 8) = *(int *)(unaff_retaddr + 8) + uVar4;\n        return;\n      }\n      if (uVar4 == iVar2 - 1U) goto LAB_00077cb8;\n      iVar5 = *(int *)(unaff_retaddr + 8);\n      uVar6 = *(uint *)(unaff_retaddr + 0xc);\n      uVar4 = iVar5 + uVar4 + 2;\n    } while (uVar4 < uVar6);" (statement_identifier "LAB_00077c76") (: ":") (do_statement "do {\n      iVar2 = uVar6 - iVar5;\n      uVar4 = __vsnprintf_chk(iVar5 + *(int *)(unaff_retaddr + 4),iVar2,1,0xffffffff,param_3,param_4\n                             );\n      if (uVar4 == 0xffffffff) {\nLAB_00077cb8:\n        iVar2 = iVar2 * 2;\n        goto LAB_00077c49;\n      }\n      if (uVar4 < iVar2 - 1U) {\n        *(int *)(unaff_retaddr + 8) = *(int *)(unaff_retaddr + 8) + uVar4;\n        return;\n      }\n      if (uVar4 == iVar2 - 1U) goto LAB_00077cb8;\n      iVar5 = *(int *)(unaff_retaddr + 8);\n      uVar6 = *(uint *)(unaff_retaddr + 0xc);\n      uVar4 = iVar5 + uVar4 + 2;\n    } while (uVar4 < uVar6);" (do "do") (compound_statement "{\n      iVar2 = uVar6 - iVar5;\n      uVar4 = __vsnprintf_chk(iVar5 + *(int *)(unaff_retaddr + 4),iVar2,1,0xffffffff,param_3,param_4\n                             );\n      if (uVar4 == 0xffffffff) {\nLAB_00077cb8:\n        iVar2 = iVar2 * 2;\n        goto LAB_00077c49;\n      }\n      if (uVar4 < iVar2 - 1U) {\n        *(int *)(unaff_retaddr + 8) = *(int *)(unaff_retaddr + 8) + uVar4;\n        return;\n      }\n      if (uVar4 == iVar2 - 1U) goto LAB_00077cb8;\n      iVar5 = *(int *)(unaff_retaddr + 8);\n      uVar6 = *(uint *)(unaff_retaddr + 0xc);\n      uVar4 = iVar5 + uVar4 + 2;\n    }" ({ "{") (expression_statement "iVar2 = uVar6 - iVar5;" (assignment_expression "iVar2 = uVar6 - iVar5" (identifier "iVar2") (= "=") (binary_expression "uVar6 - iVar5" (identifier "uVar6") (- "-") (identifier "iVar5"))) (; ";")) (expression_statement "uVar4 = __vsnprintf_chk(iVar5 + *(int *)(unaff_retaddr + 4),iVar2,1,0xffffffff,param_3,param_4\n                             );" (assignment_expression "uVar4 = __vsnprintf_chk(iVar5 + *(int *)(unaff_retaddr + 4),iVar2,1,0xffffffff,param_3,param_4\n                             )" (identifier "uVar4") (= "=") (call_expression "__vsnprintf_chk(iVar5 + *(int *)(unaff_retaddr + 4),iVar2,1,0xffffffff,param_3,param_4\n                             )" (identifier "__vsnprintf_chk") (argument_list "(iVar5 + *(int *)(unaff_retaddr + 4),iVar2,1,0xffffffff,param_3,param_4\n                             )" (( "(") (binary_expression "iVar5 + *(int *)(unaff_retaddr + 4)" (identifier "iVar5") (+ "+") (pointer_expression "*(int *)(unaff_retaddr + 4)" (* "*") (cast_expression "(int *)(unaff_retaddr + 4)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(unaff_retaddr + 4)" (( "(") (binary_expression "unaff_retaddr + 4" (identifier "unaff_retaddr") (+ "+") (number_literal "4")) () ")"))))) (, ",") (identifier "iVar2") (, ",") (number_literal "1") (, ",") (number_literal "0xffffffff") (, ",") (identifier "param_3") (, ",") (identifier "param_4") () ")")))) (; ";")) (if_statement "if (uVar4 == 0xffffffff) {\nLAB_00077cb8:\n        iVar2 = iVar2 * 2;\n        goto LAB_00077c49;\n      }" (if "if") (parenthesized_expression "(uVar4 == 0xffffffff)" (( "(") (binary_expression "uVar4 == 0xffffffff" (identifier "uVar4") (== "==") (number_literal "0xffffffff")) () ")")) (compound_statement "{\nLAB_00077cb8:\n        iVar2 = iVar2 * 2;\n        goto LAB_00077c49;\n      }" ({ "{") (labeled_statement "LAB_00077cb8:\n        iVar2 = iVar2 * 2;" (statement_identifier "LAB_00077cb8") (: ":") (expression_statement "iVar2 = iVar2 * 2;" (assignment_expression "iVar2 = iVar2 * 2" (identifier "iVar2") (= "=") (binary_expression "iVar2 * 2" (identifier "iVar2") (* "*") (number_literal "2"))) (; ";"))) (goto_statement "goto LAB_00077c49;" (goto "goto") (statement_identifier "LAB_00077c49") (; ";")) (} "}"))) (if_statement "if (uVar4 < iVar2 - 1U) {\n        *(int *)(unaff_retaddr + 8) = *(int *)(unaff_retaddr + 8) + uVar4;\n        return;\n      }" (if "if") (parenthesized_expression "(uVar4 < iVar2 - 1U)" (( "(") (binary_expression "uVar4 < iVar2 - 1U" (identifier "uVar4") (< "<") (binary_expression "iVar2 - 1U" (identifier "iVar2") (- "-") (number_literal "1U"))) () ")")) (compound_statement "{\n        *(int *)(unaff_retaddr + 8) = *(int *)(unaff_retaddr + 8) + uVar4;\n        return;\n      }" ({ "{") (expression_statement "*(int *)(unaff_retaddr + 8) = *(int *)(unaff_retaddr + 8) + uVar4;" (assignment_expression "*(int *)(unaff_retaddr + 8) = *(int *)(unaff_retaddr + 8) + uVar4" (pointer_expression "*(int *)(unaff_retaddr + 8)" (* "*") (cast_expression "(int *)(unaff_retaddr + 8)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(unaff_retaddr + 8)" (( "(") (binary_expression "unaff_retaddr + 8" (identifier "unaff_retaddr") (+ "+") (number_literal "8")) () ")")))) (= "=") (binary_expression "*(int *)(unaff_retaddr + 8) + uVar4" (pointer_expression "*(int *)(unaff_retaddr + 8)" (* "*") (cast_expression "(int *)(unaff_retaddr + 8)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(unaff_retaddr + 8)" (( "(") (binary_expression "unaff_retaddr + 8" (identifier "unaff_retaddr") (+ "+") (number_literal "8")) () ")")))) (+ "+") (identifier "uVar4"))) (; ";")) (return_statement "return;" (return "return") (; ";")) (} "}"))) (if_statement "if (uVar4 == iVar2 - 1U) goto LAB_00077cb8;" (if "if") (parenthesized_expression "(uVar4 == iVar2 - 1U)" (( "(") (binary_expression "uVar4 == iVar2 - 1U" (identifier "uVar4") (== "==") (binary_expression "iVar2 - 1U" (identifier "iVar2") (- "-") (number_literal "1U"))) () ")")) (goto_statement "goto LAB_00077cb8;" (goto "goto") (statement_identifier "LAB_00077cb8") (; ";"))) (expression_statement "iVar5 = *(int *)(unaff_retaddr + 8);" (assignment_expression "iVar5 = *(int *)(unaff_retaddr + 8)" (identifier "iVar5") (= "=") (pointer_expression "*(int *)(unaff_retaddr + 8)" (* "*") (cast_expression "(int *)(unaff_retaddr + 8)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(unaff_retaddr + 8)" (( "(") (binary_expression "unaff_retaddr + 8" (identifier "unaff_retaddr") (+ "+") (number_literal "8")) () ")"))))) (; ";")) (expression_statement "uVar6 = *(uint *)(unaff_retaddr + 0xc);" (assignment_expression "uVar6 = *(uint *)(unaff_retaddr + 0xc)" (identifier "uVar6") (= "=") (pointer_expression "*(uint *)(unaff_retaddr + 0xc)" (* "*") (cast_expression "(uint *)(unaff_retaddr + 0xc)" (( "(") (type_descriptor "uint *" (type_identifier "uint") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(unaff_retaddr + 0xc)" (( "(") (binary_expression "unaff_retaddr + 0xc" (identifier "unaff_retaddr") (+ "+") (number_literal "0xc")) () ")"))))) (; ";")) (expression_statement "uVar4 = iVar5 + uVar4 + 2;" (assignment_expression "uVar4 = iVar5 + uVar4 + 2" (identifier "uVar4") (= "=") (binary_expression "iVar5 + uVar4 + 2" (binary_expression "iVar5 + uVar4" (identifier "iVar5") (+ "+") (identifier "uVar4")) (+ "+") (number_literal "2"))) (; ";")) (} "}")) (while "while") (parenthesized_expression "(uVar4 < uVar6)" (( "(") (binary_expression "uVar4 < uVar6" (identifier "uVar4") (< "<") (identifier "uVar6")) () ")")) (; ";"))) (} "}")) (while "while") (parenthesized_expression "( true )" (( "(") (true "true") () ")")) (; ";")) (} "}")))

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

int function_1(type_1 *d,char *fmt,type_2 orig_ap)

{
  type_3 *puVar1;
  int var_2;
  char *pcVar3;
  type_4 var_3;
  size_t var_1;
  type_4 var_4;
  
  puVar1 = PTR___gmp_reallocate_func_00098d4c;
  var_2 = 0x100;
LAB_00077c49:
  var_1 = d->size;
  var_4 = d->alloc;
  var_3 = var_1 + var_2;
  if (var_3 < var_4) goto LAB_00077c76;
  do {
    d->alloc = var_3 * 2;
    pcVar3 = (char *)(**(type_5 **)puVar1)(d->buf,var_4,var_3 * 2);
    var_4 = d->alloc;
    var_1 = d->size;
    d->buf = pcVar3;
LAB_00077c76:
    do {
      var_2 = var_4 - var_1;
      var_3 = var_5(d->buf + var_1,var_2,1,0xffffffff,fmt,orig_ap);
      if (var_3 == 0xffffffff) {
LAB_00077cb8:
        var_2 = var_2 * 2;
        goto LAB_00077c49;
      }
      if (var_3 < var_2 - 1U) {
        d->size = d->size + var_3;
        return var_3;
      }
      if (var_3 == var_2 - 1U) goto LAB_00077cb8;
      var_1 = d->size;
      var_4 = d->alloc;
      var_3 = var_1 + var_3 + 2;
    } while (var_3 < var_4);
  } while( true );
}


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

void __regparm2
MASKED(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4)

{
  undefined4 *puVar1;
  int iVar2;
  undefined4 uVar3;
  uint uVar4;
  int iVar5;
  int unaff_EBX;
  uint uVar6;
  int unaff_retaddr;
  
  iVar2 = entry(param_2,0x77c2e);
  puVar1 = *(undefined4 **)(&DAT_0002111e + unaff_EBX);
LAB_00077c49:
  iVar5 = *(int *)(unaff_retaddr + 8);
  uVar6 = *(uint *)(unaff_retaddr + 0xc);
  uVar4 = iVar5 + iVar2;
  if (uVar4 < uVar6) goto LAB_00077c76;
  do {
    *(uint *)(unaff_retaddr + 0xc) = uVar4 * 2;
    uVar3 = (*(code *)*puVar1)(*(undefined4 *)(unaff_retaddr + 4),uVar6,uVar4 * 2);
    uVar6 = *(uint *)(unaff_retaddr + 0xc);
    iVar5 = *(int *)(unaff_retaddr + 8);
    *(undefined4 *)(unaff_retaddr + 4) = uVar3;
LAB_00077c76:
    do {
      iVar2 = uVar6 - iVar5;
      uVar4 = __vsnprintf_chk(iVar5 + *(int *)(unaff_retaddr + 4),iVar2,1,0xffffffff,param_3,param_4
                             );
      if (uVar4 == 0xffffffff) {
LAB_00077cb8:
        iVar2 = iVar2 * 2;
        goto LAB_00077c49;
      }
      if (uVar4 < iVar2 - 1U) {
        *(int *)(unaff_retaddr + 8) = *(int *)(unaff_retaddr + 8) + uVar4;
        return;
      }
      if (uVar4 == iVar2 - 1U) goto LAB_00077cb8;
      iVar5 = *(int *)(unaff_retaddr + 8);
      uVar6 = *(uint *)(unaff_retaddr + 0xc);
      uVar4 = iVar5 + uVar4 + 2;
    } while (uVar4 < uVar6);
  } while( true );
}

