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

Bignum_conflict bigmod(Bignum_conflict a,Bignum_conflict b)

{
  BignumInt BVar1;
  Bignum_conflict result;
  uint uVar2;
  int in_stack_ffffffe4;
  
  uVar2 = *b;
  if (0x3fffffe < uVar2) {
                    /* WARNING: Subroutine does not return */
    newbn(in_stack_ffffffe4);
  }
  result = (Bignum_conflict)safemalloc(uVar2 + 1,4);
  memset(result,0,(uVar2 + 1) * 4);
  *result = uVar2;
  bigdivmod(a,b,result,(Bignum_conflict)0x0);
  uVar2 = *result;
  if (1 < uVar2) {
    BVar1 = result[uVar2];
    while (BVar1 == 0) {
      uVar2 = uVar2 - 1;
      *result = uVar2;
      if (uVar2 == 1) {
        return result;
      }
      BVar1 = result[uVar2];
    }
  }
  return result;
}



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

uint * FUN_000501a0(undefined4 param_1,uint *param_2)

{
  uint uVar1;
  uint *__s;
  uint uVar2;
  
  uVar2 = *param_2;
  if (0x3fffffe < uVar2) {
                    /* WARNING: Subroutine does not return */
    FUN_0004c070();
  }
  __s = (uint *)FUN_0001fe90(uVar2 + 1,4);
  memset(__s,0,(uVar2 + 1) * 4);
  *__s = uVar2;
  FUN_0004cdc0(0);
  uVar2 = *__s;
  if (1 < uVar2) {
    uVar1 = __s[uVar2];
    while (uVar1 == 0) {
      uVar2 = uVar2 - 1;
      *__s = uVar2;
      if (uVar2 == 1) {
        return __s;
      }
      uVar1 = __s[uVar2];
    }
  }
  return __s;
}


PUSH EBP
PUSH EDI
PUSH ESI
PUSH EBX
CALL 0x00015ff0
ADD EBX,0x76bc7
SUB ESP,0xc
MOV EAX,dword ptr [ESP + 0x24]
MOV EBP,dword ptr [EAX]
CMP EBP,0x3fffffe
JA 0x0005022c
SUB ESP,0x8
LEA EDI,[EBP + 0x1]
PUSH 0x4
PUSH EDI
SHL EDI,0x2
CALL 0x0001fe90
ADD ESP,0xc
PUSH EDI
MOV ESI,EAX
PUSH 0x0
PUSH EAX
CALL 0x000144f0
MOV dword ptr [ESI],EBP
MOV EAX,dword ptr [ESP + 0x30]
MOV ECX,ESI
MOV EDX,dword ptr [ESP + 0x34]
MOV dword ptr [ESP],0x0
CALL 0x0004cdc0
MOV EAX,dword ptr [ESI]
ADD ESP,0x10
CMP EAX,0x1
JBE 0x00050222
MOV ECX,dword ptr [ESI + EAX*0x4]
TEST ECX,ECX
JNZ 0x00050222
SUB EAX,0x1
JMP 0x0005021b
SUB EAX,0x1
MOV EDX,dword ptr [ESI + EAX*0x4 + 0x4]
TEST EDX,EDX
JNZ 0x00050222
MOV dword ptr [ESI],EAX
CMP EAX,0x1
JNZ 0x00050210
ADD ESP,0xc
MOV EAX,ESI
POP EBX
POP ESI
POP EDI
POP EBP
RET
CALL 0x0004c070
(translation_unit "/* WARNING: Function: __i686.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n\nuint * FUN_000501a0(undefined4 param_1,uint *param_2)\n\n{\n  uint uVar1;\n  uint *__s;\n  uint uVar2;\n  \n  uVar2 = *param_2;\n  if (0x3fffffe < uVar2) {\n                    /* WARNING: Subroutine does not return */\n    FUN_0004c070();\n  }\n  __s = (uint *)FUN_0001fe90(uVar2 + 1,4);\n  memset(__s,0,(uVar2 + 1) * 4);\n  *__s = uVar2;\n  FUN_0004cdc0(0);\n  uVar2 = *__s;\n  if (1 < uVar2) {\n    uVar1 = __s[uVar2];\n    while (uVar1 == 0) {\n      uVar2 = uVar2 - 1;\n      *__s = uVar2;\n      if (uVar2 == 1) {\n        return __s;\n      }\n      uVar1 = __s[uVar2];\n    }\n  }\n  return __s;\n}\n\n" comment (function_definition "uint * FUN_000501a0(undefined4 param_1,uint *param_2)\n\n{\n  uint uVar1;\n  uint *__s;\n  uint uVar2;\n  \n  uVar2 = *param_2;\n  if (0x3fffffe < uVar2) {\n                    /* WARNING: Subroutine does not return */\n    FUN_0004c070();\n  }\n  __s = (uint *)FUN_0001fe90(uVar2 + 1,4);\n  memset(__s,0,(uVar2 + 1) * 4);\n  *__s = uVar2;\n  FUN_0004cdc0(0);\n  uVar2 = *__s;\n  if (1 < uVar2) {\n    uVar1 = __s[uVar2];\n    while (uVar1 == 0) {\n      uVar2 = uVar2 - 1;\n      *__s = uVar2;\n      if (uVar2 == 1) {\n        return __s;\n      }\n      uVar1 = __s[uVar2];\n    }\n  }\n  return __s;\n}" type_identifier (pointer_declarator "* FUN_000501a0(undefined4 param_1,uint *param_2)" * (function_declarator "FUN_000501a0(undefined4 param_1,uint *param_2)" identifier (parameter_list "(undefined4 param_1,uint *param_2)" ( (parameter_declaration "undefined4 param_1" type_identifier identifier) , (parameter_declaration "uint *param_2" type_identifier (pointer_declarator "*param_2" * identifier)) )))) (compound_statement "{\n  uint uVar1;\n  uint *__s;\n  uint uVar2;\n  \n  uVar2 = *param_2;\n  if (0x3fffffe < uVar2) {\n                    /* WARNING: Subroutine does not return */\n    FUN_0004c070();\n  }\n  __s = (uint *)FUN_0001fe90(uVar2 + 1,4);\n  memset(__s,0,(uVar2 + 1) * 4);\n  *__s = uVar2;\n  FUN_0004cdc0(0);\n  uVar2 = *__s;\n  if (1 < uVar2) {\n    uVar1 = __s[uVar2];\n    while (uVar1 == 0) {\n      uVar2 = uVar2 - 1;\n      *__s = uVar2;\n      if (uVar2 == 1) {\n        return __s;\n      }\n      uVar1 = __s[uVar2];\n    }\n  }\n  return __s;\n}" { (declaration "uint uVar1;" type_identifier identifier ;) (declaration "uint *__s;" type_identifier (pointer_declarator "*__s" * identifier) ;) (declaration "uint uVar2;" type_identifier identifier ;) (expression_statement "uVar2 = *param_2;" (assignment_expression "uVar2 = *param_2" identifier = (pointer_expression "*param_2" * identifier)) ;) (if_statement "if (0x3fffffe < uVar2) {\n                    /* WARNING: Subroutine does not return */\n    FUN_0004c070();\n  }" if (parenthesized_expression "(0x3fffffe < uVar2)" ( (binary_expression "0x3fffffe < uVar2" number_literal < identifier) )) (compound_statement "{\n                    /* WARNING: Subroutine does not return */\n    FUN_0004c070();\n  }" { comment (expression_statement "FUN_0004c070();" (call_expression "FUN_0004c070()" identifier (argument_list "()" ( ))) ;) })) (expression_statement "__s = (uint *)FUN_0001fe90(uVar2 + 1,4);" (assignment_expression "__s = (uint *)FUN_0001fe90(uVar2 + 1,4)" identifier = (cast_expression "(uint *)FUN_0001fe90(uVar2 + 1,4)" ( (type_descriptor "uint *" type_identifier (abstract_pointer_declarator "*" *)) ) (call_expression "FUN_0001fe90(uVar2 + 1,4)" identifier (argument_list "(uVar2 + 1,4)" ( (binary_expression "uVar2 + 1" identifier + number_literal) , number_literal ))))) ;) (expression_statement "memset(__s,0,(uVar2 + 1) * 4);" (call_expression "memset(__s,0,(uVar2 + 1) * 4)" identifier (argument_list "(__s,0,(uVar2 + 1) * 4)" ( identifier , number_literal , (binary_expression "(uVar2 + 1) * 4" (parenthesized_expression "(uVar2 + 1)" ( (binary_expression "uVar2 + 1" identifier + number_literal) )) * number_literal) ))) ;) (expression_statement "*__s = uVar2;" (assignment_expression "*__s = uVar2" (pointer_expression "*__s" * identifier) = identifier) ;) (expression_statement "FUN_0004cdc0(0);" (call_expression "FUN_0004cdc0(0)" identifier (argument_list "(0)" ( number_literal ))) ;) (expression_statement "uVar2 = *__s;" (assignment_expression "uVar2 = *__s" identifier = (pointer_expression "*__s" * identifier)) ;) (if_statement "if (1 < uVar2) {\n    uVar1 = __s[uVar2];\n    while (uVar1 == 0) {\n      uVar2 = uVar2 - 1;\n      *__s = uVar2;\n      if (uVar2 == 1) {\n        return __s;\n      }\n      uVar1 = __s[uVar2];\n    }\n  }" if (parenthesized_expression "(1 < uVar2)" ( (binary_expression "1 < uVar2" number_literal < identifier) )) (compound_statement "{\n    uVar1 = __s[uVar2];\n    while (uVar1 == 0) {\n      uVar2 = uVar2 - 1;\n      *__s = uVar2;\n      if (uVar2 == 1) {\n        return __s;\n      }\n      uVar1 = __s[uVar2];\n    }\n  }" { (expression_statement "uVar1 = __s[uVar2];" (assignment_expression "uVar1 = __s[uVar2]" identifier = (subscript_expression "__s[uVar2]" identifier [ identifier ])) ;) (while_statement "while (uVar1 == 0) {\n      uVar2 = uVar2 - 1;\n      *__s = uVar2;\n      if (uVar2 == 1) {\n        return __s;\n      }\n      uVar1 = __s[uVar2];\n    }" while (parenthesized_expression "(uVar1 == 0)" ( (binary_expression "uVar1 == 0" identifier == number_literal) )) (compound_statement "{\n      uVar2 = uVar2 - 1;\n      *__s = uVar2;\n      if (uVar2 == 1) {\n        return __s;\n      }\n      uVar1 = __s[uVar2];\n    }" { (expression_statement "uVar2 = uVar2 - 1;" (assignment_expression "uVar2 = uVar2 - 1" identifier = (binary_expression "uVar2 - 1" identifier - number_literal)) ;) (expression_statement "*__s = uVar2;" (assignment_expression "*__s = uVar2" (pointer_expression "*__s" * identifier) = identifier) ;) (if_statement "if (uVar2 == 1) {\n        return __s;\n      }" if (parenthesized_expression "(uVar2 == 1)" ( (binary_expression "uVar2 == 1" identifier == number_literal) )) (compound_statement "{\n        return __s;\n      }" { (return_statement "return __s;" return identifier ;) })) (expression_statement "uVar1 = __s[uVar2];" (assignment_expression "uVar1 = __s[uVar2]" identifier = (subscript_expression "__s[uVar2]" identifier [ identifier ])) ;) })) })) (return_statement "return __s;" return identifier ;) })))
(translation_unit "/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n/* WARNING: Unknown calling convention */\n\nBignum_conflict bigmod(Bignum_conflict a,Bignum_conflict b)\n\n{\n  BignumInt BVar1;\n  Bignum_conflict result;\n  uint uVar2;\n  int in_stack_ffffffe4;\n  \n  uVar2 = *b;\n  if (0x3fffffe < uVar2) {\n                    /* WARNING: Subroutine does not return */\n    newbn(in_stack_ffffffe4);\n  }\n  result = (Bignum_conflict)safemalloc(uVar2 + 1,4);\n  memset(result,0,(uVar2 + 1) * 4);\n  *result = uVar2;\n  bigdivmod(a,b,result,(Bignum_conflict)0x0);\n  uVar2 = *result;\n  if (1 < uVar2) {\n    BVar1 = result[uVar2];\n    while (BVar1 == 0) {\n      uVar2 = uVar2 - 1;\n      *result = uVar2;\n      if (uVar2 == 1) {\n        return result;\n      }\n      BVar1 = result[uVar2];\n    }\n  }\n  return result;\n}\n\n" comment comment (function_definition "Bignum_conflict bigmod(Bignum_conflict a,Bignum_conflict b)\n\n{\n  BignumInt BVar1;\n  Bignum_conflict result;\n  uint uVar2;\n  int in_stack_ffffffe4;\n  \n  uVar2 = *b;\n  if (0x3fffffe < uVar2) {\n                    /* WARNING: Subroutine does not return */\n    newbn(in_stack_ffffffe4);\n  }\n  result = (Bignum_conflict)safemalloc(uVar2 + 1,4);\n  memset(result,0,(uVar2 + 1) * 4);\n  *result = uVar2;\n  bigdivmod(a,b,result,(Bignum_conflict)0x0);\n  uVar2 = *result;\n  if (1 < uVar2) {\n    BVar1 = result[uVar2];\n    while (BVar1 == 0) {\n      uVar2 = uVar2 - 1;\n      *result = uVar2;\n      if (uVar2 == 1) {\n        return result;\n      }\n      BVar1 = result[uVar2];\n    }\n  }\n  return result;\n}" type_identifier (function_declarator "bigmod(Bignum_conflict a,Bignum_conflict b)" identifier (parameter_list "(Bignum_conflict a,Bignum_conflict b)" ( (parameter_declaration "Bignum_conflict a" type_identifier identifier) , (parameter_declaration "Bignum_conflict b" type_identifier identifier) ))) (compound_statement "{\n  BignumInt BVar1;\n  Bignum_conflict result;\n  uint uVar2;\n  int in_stack_ffffffe4;\n  \n  uVar2 = *b;\n  if (0x3fffffe < uVar2) {\n                    /* WARNING: Subroutine does not return */\n    newbn(in_stack_ffffffe4);\n  }\n  result = (Bignum_conflict)safemalloc(uVar2 + 1,4);\n  memset(result,0,(uVar2 + 1) * 4);\n  *result = uVar2;\n  bigdivmod(a,b,result,(Bignum_conflict)0x0);\n  uVar2 = *result;\n  if (1 < uVar2) {\n    BVar1 = result[uVar2];\n    while (BVar1 == 0) {\n      uVar2 = uVar2 - 1;\n      *result = uVar2;\n      if (uVar2 == 1) {\n        return result;\n      }\n      BVar1 = result[uVar2];\n    }\n  }\n  return result;\n}" { (declaration "BignumInt BVar1;" type_identifier identifier ;) (declaration "Bignum_conflict result;" type_identifier identifier ;) (declaration "uint uVar2;" type_identifier identifier ;) (declaration "int in_stack_ffffffe4;" primitive_type identifier ;) (expression_statement "uVar2 = *b;" (assignment_expression "uVar2 = *b" identifier = (pointer_expression "*b" * identifier)) ;) (if_statement "if (0x3fffffe < uVar2) {\n                    /* WARNING: Subroutine does not return */\n    newbn(in_stack_ffffffe4);\n  }" if (parenthesized_expression "(0x3fffffe < uVar2)" ( (binary_expression "0x3fffffe < uVar2" number_literal < identifier) )) (compound_statement "{\n                    /* WARNING: Subroutine does not return */\n    newbn(in_stack_ffffffe4);\n  }" { comment (expression_statement "newbn(in_stack_ffffffe4);" (call_expression "newbn(in_stack_ffffffe4)" identifier (argument_list "(in_stack_ffffffe4)" ( identifier ))) ;) })) (expression_statement "result = (Bignum_conflict)safemalloc(uVar2 + 1,4);" (assignment_expression "result = (Bignum_conflict)safemalloc(uVar2 + 1,4)" identifier = (cast_expression "(Bignum_conflict)safemalloc(uVar2 + 1,4)" ( (type_descriptor "Bignum_conflict" type_identifier) ) (call_expression "safemalloc(uVar2 + 1,4)" identifier (argument_list "(uVar2 + 1,4)" ( (binary_expression "uVar2 + 1" identifier + number_literal) , number_literal ))))) ;) (expression_statement "memset(result,0,(uVar2 + 1) * 4);" (call_expression "memset(result,0,(uVar2 + 1) * 4)" identifier (argument_list "(result,0,(uVar2 + 1) * 4)" ( identifier , number_literal , (binary_expression "(uVar2 + 1) * 4" (parenthesized_expression "(uVar2 + 1)" ( (binary_expression "uVar2 + 1" identifier + number_literal) )) * number_literal) ))) ;) (expression_statement "*result = uVar2;" (assignment_expression "*result = uVar2" (pointer_expression "*result" * identifier) = identifier) ;) (expression_statement "bigdivmod(a,b,result,(Bignum_conflict)0x0);" (call_expression "bigdivmod(a,b,result,(Bignum_conflict)0x0)" identifier (argument_list "(a,b,result,(Bignum_conflict)0x0)" ( identifier , identifier , identifier , (cast_expression "(Bignum_conflict)0x0" ( (type_descriptor "Bignum_conflict" type_identifier) ) number_literal) ))) ;) (expression_statement "uVar2 = *result;" (assignment_expression "uVar2 = *result" identifier = (pointer_expression "*result" * identifier)) ;) (if_statement "if (1 < uVar2) {\n    BVar1 = result[uVar2];\n    while (BVar1 == 0) {\n      uVar2 = uVar2 - 1;\n      *result = uVar2;\n      if (uVar2 == 1) {\n        return result;\n      }\n      BVar1 = result[uVar2];\n    }\n  }" if (parenthesized_expression "(1 < uVar2)" ( (binary_expression "1 < uVar2" number_literal < identifier) )) (compound_statement "{\n    BVar1 = result[uVar2];\n    while (BVar1 == 0) {\n      uVar2 = uVar2 - 1;\n      *result = uVar2;\n      if (uVar2 == 1) {\n        return result;\n      }\n      BVar1 = result[uVar2];\n    }\n  }" { (expression_statement "BVar1 = result[uVar2];" (assignment_expression "BVar1 = result[uVar2]" identifier = (subscript_expression "result[uVar2]" identifier [ identifier ])) ;) (while_statement "while (BVar1 == 0) {\n      uVar2 = uVar2 - 1;\n      *result = uVar2;\n      if (uVar2 == 1) {\n        return result;\n      }\n      BVar1 = result[uVar2];\n    }" while (parenthesized_expression "(BVar1 == 0)" ( (binary_expression "BVar1 == 0" identifier == number_literal) )) (compound_statement "{\n      uVar2 = uVar2 - 1;\n      *result = uVar2;\n      if (uVar2 == 1) {\n        return result;\n      }\n      BVar1 = result[uVar2];\n    }" { (expression_statement "uVar2 = uVar2 - 1;" (assignment_expression "uVar2 = uVar2 - 1" identifier = (binary_expression "uVar2 - 1" identifier - number_literal)) ;) (expression_statement "*result = uVar2;" (assignment_expression "*result = uVar2" (pointer_expression "*result" * identifier) = identifier) ;) (if_statement "if (uVar2 == 1) {\n        return result;\n      }" if (parenthesized_expression "(uVar2 == 1)" ( (binary_expression "uVar2 == 1" identifier == number_literal) )) (compound_statement "{\n        return result;\n      }" { (return_statement "return result;" return identifier ;) })) (expression_statement "BVar1 = result[uVar2];" (assignment_expression "BVar1 = result[uVar2]" identifier = (subscript_expression "result[uVar2]" identifier [ identifier ])) ;) })) })) (return_statement "return result;" return identifier ;) })))
(translation_unit "uint * FUN_000501a0(undefined4 param_1,uint *param_2)\n\n{\n  uint uVar1;\n  uint *__s;\n  uint uVar2;\n  \n  uVar2 = *param_2;\n  if (0x3fffffe < uVar2) {\n                    \n    FUN_0004c070();\n  }\n  __s = (uint *)FUN_0001fe90(uVar2 + 1,4);\n  memset(__s,0,(uVar2 + 1) * 4);\n  *__s = uVar2;\n  FUN_0004cdc0(0);\n  uVar2 = *__s;\n  if (1 < uVar2) {\n    uVar1 = __s[uVar2];\n    while (uVar1 == 0) {\n      uVar2 = uVar2 - 1;\n      *__s = uVar2;\n      if (uVar2 == 1) {\n        return __s;\n      }\n      uVar1 = __s[uVar2];\n    }\n  }\n  return __s;\n}\n\n" (function_definition "uint * FUN_000501a0(undefined4 param_1,uint *param_2)\n\n{\n  uint uVar1;\n  uint *__s;\n  uint uVar2;\n  \n  uVar2 = *param_2;\n  if (0x3fffffe < uVar2) {\n                    \n    FUN_0004c070();\n  }\n  __s = (uint *)FUN_0001fe90(uVar2 + 1,4);\n  memset(__s,0,(uVar2 + 1) * 4);\n  *__s = uVar2;\n  FUN_0004cdc0(0);\n  uVar2 = *__s;\n  if (1 < uVar2) {\n    uVar1 = __s[uVar2];\n    while (uVar1 == 0) {\n      uVar2 = uVar2 - 1;\n      *__s = uVar2;\n      if (uVar2 == 1) {\n        return __s;\n      }\n      uVar1 = __s[uVar2];\n    }\n  }\n  return __s;\n}" type_identifier (pointer_declarator "* FUN_000501a0(undefined4 param_1,uint *param_2)" * (function_declarator "FUN_000501a0(undefined4 param_1,uint *param_2)" identifier (parameter_list "(undefined4 param_1,uint *param_2)" ( (parameter_declaration "undefined4 param_1" type_identifier identifier) , (parameter_declaration "uint *param_2" type_identifier (pointer_declarator "*param_2" * identifier)) )))) (compound_statement "{\n  uint uVar1;\n  uint *__s;\n  uint uVar2;\n  \n  uVar2 = *param_2;\n  if (0x3fffffe < uVar2) {\n                    \n    FUN_0004c070();\n  }\n  __s = (uint *)FUN_0001fe90(uVar2 + 1,4);\n  memset(__s,0,(uVar2 + 1) * 4);\n  *__s = uVar2;\n  FUN_0004cdc0(0);\n  uVar2 = *__s;\n  if (1 < uVar2) {\n    uVar1 = __s[uVar2];\n    while (uVar1 == 0) {\n      uVar2 = uVar2 - 1;\n      *__s = uVar2;\n      if (uVar2 == 1) {\n        return __s;\n      }\n      uVar1 = __s[uVar2];\n    }\n  }\n  return __s;\n}" { (declaration "uint uVar1;" type_identifier identifier ;) (declaration "uint *__s;" type_identifier (pointer_declarator "*__s" * identifier) ;) (declaration "uint uVar2;" type_identifier identifier ;) (expression_statement "uVar2 = *param_2;" (assignment_expression "uVar2 = *param_2" identifier = (pointer_expression "*param_2" * identifier)) ;) (if_statement "if (0x3fffffe < uVar2) {\n                    \n    FUN_0004c070();\n  }" if (parenthesized_expression "(0x3fffffe < uVar2)" ( (binary_expression "0x3fffffe < uVar2" number_literal < identifier) )) (compound_statement "{\n                    \n    FUN_0004c070();\n  }" { (expression_statement "FUN_0004c070();" (call_expression "FUN_0004c070()" identifier (argument_list "()" ( ))) ;) })) (expression_statement "__s = (uint *)FUN_0001fe90(uVar2 + 1,4);" (assignment_expression "__s = (uint *)FUN_0001fe90(uVar2 + 1,4)" identifier = (cast_expression "(uint *)FUN_0001fe90(uVar2 + 1,4)" ( (type_descriptor "uint *" type_identifier (abstract_pointer_declarator "*" *)) ) (call_expression "FUN_0001fe90(uVar2 + 1,4)" identifier (argument_list "(uVar2 + 1,4)" ( (binary_expression "uVar2 + 1" identifier + number_literal) , number_literal ))))) ;) (expression_statement "memset(__s,0,(uVar2 + 1) * 4);" (call_expression "memset(__s,0,(uVar2 + 1) * 4)" identifier (argument_list "(__s,0,(uVar2 + 1) * 4)" ( identifier , number_literal , (binary_expression "(uVar2 + 1) * 4" (parenthesized_expression "(uVar2 + 1)" ( (binary_expression "uVar2 + 1" identifier + number_literal) )) * number_literal) ))) ;) (expression_statement "*__s = uVar2;" (assignment_expression "*__s = uVar2" (pointer_expression "*__s" * identifier) = identifier) ;) (expression_statement "FUN_0004cdc0(0);" (call_expression "FUN_0004cdc0(0)" identifier (argument_list "(0)" ( number_literal ))) ;) (expression_statement "uVar2 = *__s;" (assignment_expression "uVar2 = *__s" identifier = (pointer_expression "*__s" * identifier)) ;) (if_statement "if (1 < uVar2) {\n    uVar1 = __s[uVar2];\n    while (uVar1 == 0) {\n      uVar2 = uVar2 - 1;\n      *__s = uVar2;\n      if (uVar2 == 1) {\n        return __s;\n      }\n      uVar1 = __s[uVar2];\n    }\n  }" if (parenthesized_expression "(1 < uVar2)" ( (binary_expression "1 < uVar2" number_literal < identifier) )) (compound_statement "{\n    uVar1 = __s[uVar2];\n    while (uVar1 == 0) {\n      uVar2 = uVar2 - 1;\n      *__s = uVar2;\n      if (uVar2 == 1) {\n        return __s;\n      }\n      uVar1 = __s[uVar2];\n    }\n  }" { (expression_statement "uVar1 = __s[uVar2];" (assignment_expression "uVar1 = __s[uVar2]" identifier = (subscript_expression "__s[uVar2]" identifier [ identifier ])) ;) (while_statement "while (uVar1 == 0) {\n      uVar2 = uVar2 - 1;\n      *__s = uVar2;\n      if (uVar2 == 1) {\n        return __s;\n      }\n      uVar1 = __s[uVar2];\n    }" while (parenthesized_expression "(uVar1 == 0)" ( (binary_expression "uVar1 == 0" identifier == number_literal) )) (compound_statement "{\n      uVar2 = uVar2 - 1;\n      *__s = uVar2;\n      if (uVar2 == 1) {\n        return __s;\n      }\n      uVar1 = __s[uVar2];\n    }" { (expression_statement "uVar2 = uVar2 - 1;" (assignment_expression "uVar2 = uVar2 - 1" identifier = (binary_expression "uVar2 - 1" identifier - number_literal)) ;) (expression_statement "*__s = uVar2;" (assignment_expression "*__s = uVar2" (pointer_expression "*__s" * identifier) = identifier) ;) (if_statement "if (uVar2 == 1) {\n        return __s;\n      }" if (parenthesized_expression "(uVar2 == 1)" ( (binary_expression "uVar2 == 1" identifier == number_literal) )) (compound_statement "{\n        return __s;\n      }" { (return_statement "return __s;" return identifier ;) })) (expression_statement "uVar1 = __s[uVar2];" (assignment_expression "uVar1 = __s[uVar2]" identifier = (subscript_expression "__s[uVar2]" identifier [ identifier ])) ;) })) })) (return_statement "return __s;" return identifier ;) })))
(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 (pointer_declarator * IDENT) ;) (declaration TYPE IDENT ;) (expression_statement (assignment_expression IDENT = (pointer_expression * IDENT)) ;) (if_statement if (parenthesized_expression ( (binary_expression LIT < IDENT) )) (compound_statement { (expression_statement (call_expression IDENT (argument_list ( ))) ;) })) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (call_expression IDENT (argument_list ( (binary_expression IDENT + LIT) , LIT ))))) ;) (expression_statement (call_expression IDENT (argument_list ( IDENT , LIT , (binary_expression (parenthesized_expression ( (binary_expression IDENT + LIT) )) * LIT) ))) ;) (expression_statement (assignment_expression (pointer_expression * IDENT) = IDENT) ;) (expression_statement (call_expression IDENT (argument_list ( LIT ))) ;) (expression_statement (assignment_expression IDENT = (pointer_expression * IDENT)) ;) (if_statement if (parenthesized_expression ( (binary_expression LIT < IDENT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (subscript_expression IDENT [ IDENT ])) ;) (while_statement while (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (binary_expression IDENT - LIT)) ;) (expression_statement (assignment_expression (pointer_expression * IDENT) = IDENT) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (return_statement return IDENT ;) })) (expression_statement (assignment_expression IDENT = (subscript_expression IDENT [ IDENT ])) ;) })) })) (return_statement return IDENT ;) })))
(function_definition "uint * FUN_000501a0(undefined4 param_1,uint *param_2)\n\n{\n  uint uVar1;\n  uint *__s;\n  uint uVar2;\n  \n  uVar2 = *param_2;\n  if (0x3fffffe < uVar2) {\n                    \n    FUN_0004c070();\n  }\n  __s = (uint *)FUN_0001fe90(uVar2 + 1,4);\n  memset(__s,0,(uVar2 + 1) * 4);\n  *__s = uVar2;\n  FUN_0004cdc0(0);\n  uVar2 = *__s;\n  if (1 < uVar2) {\n    uVar1 = __s[uVar2];\n    while (uVar1 == 0) {\n      uVar2 = uVar2 - 1;\n      *__s = uVar2;\n      if (uVar2 == 1) {\n        return __s;\n      }\n      uVar1 = __s[uVar2];\n    }\n  }\n  return __s;\n}" (type_identifier "uint") (pointer_declarator "* FUN_000501a0(undefined4 param_1,uint *param_2)" (* "*") (function_declarator "FUN_000501a0(undefined4 param_1,uint *param_2)" (identifier "FUN_000501a0") (parameter_list "(undefined4 param_1,uint *param_2)" (( "(") (parameter_declaration "undefined4 param_1" (type_identifier "undefined4") (identifier "param_1")) (, ",") (parameter_declaration "uint *param_2" (type_identifier "uint") (pointer_declarator "*param_2" (* "*") (identifier "param_2"))) () ")")))) (compound_statement "{\n  uint uVar1;\n  uint *__s;\n  uint uVar2;\n  \n  uVar2 = *param_2;\n  if (0x3fffffe < uVar2) {\n                    \n    FUN_0004c070();\n  }\n  __s = (uint *)FUN_0001fe90(uVar2 + 1,4);\n  memset(__s,0,(uVar2 + 1) * 4);\n  *__s = uVar2;\n  FUN_0004cdc0(0);\n  uVar2 = *__s;\n  if (1 < uVar2) {\n    uVar1 = __s[uVar2];\n    while (uVar1 == 0) {\n      uVar2 = uVar2 - 1;\n      *__s = uVar2;\n      if (uVar2 == 1) {\n        return __s;\n      }\n      uVar1 = __s[uVar2];\n    }\n  }\n  return __s;\n}" ({ "{") (declaration "uint uVar1;" (type_identifier "uint") (identifier "uVar1") (; ";")) (declaration "uint *__s;" (type_identifier "uint") (pointer_declarator "*__s" (* "*") (identifier "__s")) (; ";")) (declaration "uint uVar2;" (type_identifier "uint") (identifier "uVar2") (; ";")) (expression_statement "uVar2 = *param_2;" (assignment_expression "uVar2 = *param_2" (identifier "uVar2") (= "=") (pointer_expression "*param_2" (* "*") (identifier "param_2"))) (; ";")) (if_statement "if (0x3fffffe < uVar2) {\n                    \n    FUN_0004c070();\n  }" (if "if") (parenthesized_expression "(0x3fffffe < uVar2)" (( "(") (binary_expression "0x3fffffe < uVar2" (number_literal "0x3fffffe") (< "<") (identifier "uVar2")) () ")")) (compound_statement "{\n                    \n    FUN_0004c070();\n  }" ({ "{") (expression_statement "FUN_0004c070();" (call_expression "FUN_0004c070()" (identifier "FUN_0004c070") (argument_list "()" (( "(") () ")"))) (; ";")) (} "}"))) (expression_statement "__s = (uint *)FUN_0001fe90(uVar2 + 1,4);" (assignment_expression "__s = (uint *)FUN_0001fe90(uVar2 + 1,4)" (identifier "__s") (= "=") (cast_expression "(uint *)FUN_0001fe90(uVar2 + 1,4)" (( "(") (type_descriptor "uint *" (type_identifier "uint") (abstract_pointer_declarator "*" (* "*"))) () ")") (call_expression "FUN_0001fe90(uVar2 + 1,4)" (identifier "FUN_0001fe90") (argument_list "(uVar2 + 1,4)" (( "(") (binary_expression "uVar2 + 1" (identifier "uVar2") (+ "+") (number_literal "1")) (, ",") (number_literal "4") () ")"))))) (; ";")) (expression_statement "memset(__s,0,(uVar2 + 1) * 4);" (call_expression "memset(__s,0,(uVar2 + 1) * 4)" (identifier "memset") (argument_list "(__s,0,(uVar2 + 1) * 4)" (( "(") (identifier "__s") (, ",") (number_literal "0") (, ",") (binary_expression "(uVar2 + 1) * 4" (parenthesized_expression "(uVar2 + 1)" (( "(") (binary_expression "uVar2 + 1" (identifier "uVar2") (+ "+") (number_literal "1")) () ")")) (* "*") (number_literal "4")) () ")"))) (; ";")) (expression_statement "*__s = uVar2;" (assignment_expression "*__s = uVar2" (pointer_expression "*__s" (* "*") (identifier "__s")) (= "=") (identifier "uVar2")) (; ";")) (expression_statement "FUN_0004cdc0(0);" (call_expression "FUN_0004cdc0(0)" (identifier "FUN_0004cdc0") (argument_list "(0)" (( "(") (number_literal "0") () ")"))) (; ";")) (expression_statement "uVar2 = *__s;" (assignment_expression "uVar2 = *__s" (identifier "uVar2") (= "=") (pointer_expression "*__s" (* "*") (identifier "__s"))) (; ";")) (if_statement "if (1 < uVar2) {\n    uVar1 = __s[uVar2];\n    while (uVar1 == 0) {\n      uVar2 = uVar2 - 1;\n      *__s = uVar2;\n      if (uVar2 == 1) {\n        return __s;\n      }\n      uVar1 = __s[uVar2];\n    }\n  }" (if "if") (parenthesized_expression "(1 < uVar2)" (( "(") (binary_expression "1 < uVar2" (number_literal "1") (< "<") (identifier "uVar2")) () ")")) (compound_statement "{\n    uVar1 = __s[uVar2];\n    while (uVar1 == 0) {\n      uVar2 = uVar2 - 1;\n      *__s = uVar2;\n      if (uVar2 == 1) {\n        return __s;\n      }\n      uVar1 = __s[uVar2];\n    }\n  }" ({ "{") (expression_statement "uVar1 = __s[uVar2];" (assignment_expression "uVar1 = __s[uVar2]" (identifier "uVar1") (= "=") (subscript_expression "__s[uVar2]" (identifier "__s") ([ "[") (identifier "uVar2") (] "]"))) (; ";")) (while_statement "while (uVar1 == 0) {\n      uVar2 = uVar2 - 1;\n      *__s = uVar2;\n      if (uVar2 == 1) {\n        return __s;\n      }\n      uVar1 = __s[uVar2];\n    }" (while "while") (parenthesized_expression "(uVar1 == 0)" (( "(") (binary_expression "uVar1 == 0" (identifier "uVar1") (== "==") (number_literal "0")) () ")")) (compound_statement "{\n      uVar2 = uVar2 - 1;\n      *__s = uVar2;\n      if (uVar2 == 1) {\n        return __s;\n      }\n      uVar1 = __s[uVar2];\n    }" ({ "{") (expression_statement "uVar2 = uVar2 - 1;" (assignment_expression "uVar2 = uVar2 - 1" (identifier "uVar2") (= "=") (binary_expression "uVar2 - 1" (identifier "uVar2") (- "-") (number_literal "1"))) (; ";")) (expression_statement "*__s = uVar2;" (assignment_expression "*__s = uVar2" (pointer_expression "*__s" (* "*") (identifier "__s")) (= "=") (identifier "uVar2")) (; ";")) (if_statement "if (uVar2 == 1) {\n        return __s;\n      }" (if "if") (parenthesized_expression "(uVar2 == 1)" (( "(") (binary_expression "uVar2 == 1" (identifier "uVar2") (== "==") (number_literal "1")) () ")")) (compound_statement "{\n        return __s;\n      }" ({ "{") (return_statement "return __s;" (return "return") (identifier "__s") (; ";")) (} "}"))) (expression_statement "uVar1 = __s[uVar2];" (assignment_expression "uVar1 = __s[uVar2]" (identifier "uVar1") (= "=") (subscript_expression "__s[uVar2]" (identifier "__s") ([ "[") (identifier "uVar2") (] "]"))) (; ";")) (} "}"))) (} "}"))) (return_statement "return __s;" (return "return") (identifier "__s") (; ";")) (} "}")))

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

type_1 function_1(type_1 a,type_1 b)

{
  type_2 var_6;
  type_1 result;
  type_3 var_1;
  int in_stack_ffffffe4;
  
  var_1 = *b;
  if (0x3fffffe < var_1) {
                    /* WARNING: Subroutine does not return */
    var_2(in_stack_ffffffe4);
  }
  result = (type_1)var_3(var_1 + 1,4);
  var_4(result,0,(var_1 + 1) * 4);
  *result = var_1;
  var_5(a,b,result,(type_1)0x0);
  var_1 = *result;
  if (1 < var_1) {
    var_6 = result[var_1];
    while (var_6 == 0) {
      var_1 = var_1 - 1;
      *result = var_1;
      if (var_1 == 1) {
        return result;
      }
      var_6 = result[var_1];
    }
  }
  return result;
}


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

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

uint * MASKED(undefined4 param_1,uint *param_2)

{
  uint uVar1;
  uint *__s;
  uint uVar2;
  
  uVar2 = *param_2;
  if (0x3fffffe < uVar2) {
                    /* WARNING: Subroutine does not return */
    FUN_0004c070();
  }
  __s = (uint *)FUN_0001fe90(uVar2 + 1,4);
  memset(__s,0,(uVar2 + 1) * 4);
  *__s = uVar2;
  FUN_0004cdc0(0);
  uVar2 = *__s;
  if (1 < uVar2) {
    uVar1 = __s[uVar2];
    while (uVar1 == 0) {
      uVar2 = uVar2 - 1;
      *__s = uVar2;
      if (uVar2 == 1) {
        return __s;
      }
      uVar1 = __s[uVar2];
    }
  }
  return __s;
}

