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

int rsaencrypt(uchar *data,int length,RSAKey *key)

{
  int iVar1;
  Bignum_conflict base_in;
  Bignum_conflict bn;
  uchar *puVar2;
  int iVar3;
  
  if (key->bytes <= length + 3) {
    return 0;
  }
  memmove(data + (key->bytes - length),data,length);
  data[0] = '\0';
  data[1] = '\x02';
  iVar1 = key->bytes - length;
  if (3 < iVar1) {
    puVar2 = data;
    do {
      do {
        iVar1 = random_byte();
        puVar2[2] = (uchar)iVar1;
      } while ((uchar)iVar1 == '\0');
      puVar2 = puVar2 + 1;
      iVar1 = key->bytes - length;
    } while ((int)(puVar2 + (2 - (int)data)) < iVar1 + -1);
  }
  data[iVar1 + -1] = '\0';
  base_in = bignum_from_bytes(data,key->bytes);
  bn = modpow(base_in,(Bignum_conflict)key->exponent,(Bignum_conflict)key->modulus);
  iVar1 = key->bytes + -1;
  if (key->bytes != 0) {
    do {
      iVar3 = iVar1 + -1;
      iVar1 = bignum_byte(bn,iVar1);
      *data = (uchar)iVar1;
      data = data + 1;
      iVar1 = iVar3;
    } while (iVar3 != -1);
  }
  freebn(base_in);
  freebn(bn);
  return 1;
}



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

undefined4 FUN_00066c70(undefined2 *param_1,size_t param_2,int param_3)

{
  char cVar1;
  undefined1 uVar2;
  int iVar3;
  undefined4 uVar4;
  undefined4 uVar5;
  undefined2 *puVar6;
  int iVar7;
  
  if (*(int *)(param_3 + 4) <= (int)(param_2 + 3)) {
    return 0;
  }
  memmove((void *)((int)param_1 + (*(int *)(param_3 + 4) - param_2)),param_1,param_2);
  *param_1 = 0x200;
  iVar3 = *(int *)(param_3 + 4) - param_2;
  if (3 < iVar3) {
    puVar6 = param_1;
    do {
      do {
        cVar1 = FUN_00065c80();
        *(char *)(puVar6 + 1) = cVar1;
      } while (cVar1 == '\0');
      puVar6 = (undefined2 *)((int)puVar6 + 1);
      iVar3 = *(int *)(param_3 + 4) - param_2;
    } while ((2 - (int)param_1) + (int)puVar6 < iVar3 + -1);
  }
  *(undefined1 *)((int)param_1 + iVar3 + -1) = 0;
  uVar4 = FUN_00053bf0(param_1,*(undefined4 *)(param_3 + 4));
  uVar5 = FUN_000556a0(uVar4,*(undefined4 *)(param_3 + 0xc),*(undefined4 *)(param_3 + 8));
  iVar3 = *(int *)(param_3 + 4) + -1;
  if (*(int *)(param_3 + 4) != 0) {
    do {
      iVar7 = iVar3 + -1;
      uVar2 = FUN_00053ee0(uVar5,iVar3);
      *(undefined1 *)param_1 = uVar2;
      param_1 = (undefined2 *)((int)param_1 + 1);
      iVar3 = iVar7;
    } while (iVar7 != -1);
  }
  FUN_00053760(uVar4);
  FUN_00053760(uVar5);
  return 1;
}


PUSH EBP
PUSH EDI
PUSH ESI
PUSH EBX
CALL 0x0001c4f0
ADD EBX,0xa9ad7
SUB ESP,0x1c
MOV EDI,dword ptr [ESP + 0x38]
MOV EAX,dword ptr [ESP + 0x34]
MOV ESI,dword ptr [ESP + 0x30]
MOV EDX,dword ptr [EDI + 0x4]
LEA ECX,[EAX + 0x3]
XOR EAX,EAX
CMP ECX,EDX
JL 0x00066ca8
ADD ESP,0x1c
POP EBX
POP ESI
POP EDI
POP EBP
RET
SUB ESP,0x4
PUSH dword ptr [ESP + 0x38]
PUSH ESI
SUB EDX,dword ptr [ESP + 0x40]
LEA EAX,[ESI + EDX*0x1]
PUSH EAX
CALL 0x0001bde0
MOV EAX,0x200
MOV word ptr [ESI],AX
MOV EAX,dword ptr [EDI + 0x4]
SUB EAX,dword ptr [ESP + 0x44]
ADD ESP,0x10
CMP EAX,0x3
JLE 0x00066d0b
MOV EAX,0x2
MOV EBP,ESI
SUB EAX,ESI
MOV dword ptr [ESP + 0xc],EAX
LEA ESI,[ESI]
CALL 0x00065c80
MOV byte ptr [EBP + 0x2],AL
TEST AL,AL
JZ 0x00066ce8
MOV EDX,dword ptr [ESP + 0xc]
MOV EAX,dword ptr [EDI + 0x4]
ADD EBP,0x1
SUB EAX,dword ptr [ESP + 0x34]
LEA ECX,[EAX + -0x1]
ADD EDX,EBP
CMP ECX,EDX
JG 0x00066ce8
SUB ESP,0x8
MOV byte ptr [ESI + EAX*0x1 + -0x1],0x0
PUSH dword ptr [EDI + 0x4]
PUSH ESI
CALL 0x00053bf0
MOV dword ptr [ESP + 0x1c],EAX
ADD ESP,0xc
PUSH dword ptr [EDI + 0x8]
PUSH dword ptr [EDI + 0xc]
PUSH EAX
CALL 0x000556a0
ADD ESP,0x10
MOV EBP,EAX
MOV EAX,dword ptr [EDI + 0x4]
LEA EDI,[EAX + -0x1]
TEST EAX,EAX
JZ 0x00066d5b
NOP
SUB ESP,0x8
ADD ESI,0x1
PUSH EDI
SUB EDI,0x1
PUSH EBP
CALL 0x00053ee0
ADD ESP,0x10
MOV byte ptr [ESI + -0x1],AL
CMP EDI,-0x1
JNZ 0x00066d40
SUB ESP,0xc
PUSH dword ptr [ESP + 0x18]
CALL 0x00053760
MOV dword ptr [ESP],EBP
CALL 0x00053760
ADD ESP,0x10
MOV EAX,0x1
ADD ESP,0x1c
POP EBX
POP ESI
POP EDI
POP EBP
RET
(translation_unit "/* WARNING: Function: __i686.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n\nundefined4 FUN_00066c70(undefined2 *param_1,size_t param_2,int param_3)\n\n{\n  char cVar1;\n  undefined1 uVar2;\n  int iVar3;\n  undefined4 uVar4;\n  undefined4 uVar5;\n  undefined2 *puVar6;\n  int iVar7;\n  \n  if (*(int *)(param_3 + 4) <= (int)(param_2 + 3)) {\n    return 0;\n  }\n  memmove((void *)((int)param_1 + (*(int *)(param_3 + 4) - param_2)),param_1,param_2);\n  *param_1 = 0x200;\n  iVar3 = *(int *)(param_3 + 4) - param_2;\n  if (3 < iVar3) {\n    puVar6 = param_1;\n    do {\n      do {\n        cVar1 = FUN_00065c80();\n        *(char *)(puVar6 + 1) = cVar1;\n      } while (cVar1 == '\0');\n      puVar6 = (undefined2 *)((int)puVar6 + 1);\n      iVar3 = *(int *)(param_3 + 4) - param_2;\n    } while ((2 - (int)param_1) + (int)puVar6 < iVar3 + -1);\n  }\n  *(undefined1 *)((int)param_1 + iVar3 + -1) = 0;\n  uVar4 = FUN_00053bf0(param_1,*(undefined4 *)(param_3 + 4));\n  uVar5 = FUN_000556a0(uVar4,*(undefined4 *)(param_3 + 0xc),*(undefined4 *)(param_3 + 8));\n  iVar3 = *(int *)(param_3 + 4) + -1;\n  if (*(int *)(param_3 + 4) != 0) {\n    do {\n      iVar7 = iVar3 + -1;\n      uVar2 = FUN_00053ee0(uVar5,iVar3);\n      *(undefined1 *)param_1 = uVar2;\n      param_1 = (undefined2 *)((int)param_1 + 1);\n      iVar3 = iVar7;\n    } while (iVar7 != -1);\n  }\n  FUN_00053760(uVar4);\n  FUN_00053760(uVar5);\n  return 1;\n}\n\n" comment (function_definition "undefined4 FUN_00066c70(undefined2 *param_1,size_t param_2,int param_3)\n\n{\n  char cVar1;\n  undefined1 uVar2;\n  int iVar3;\n  undefined4 uVar4;\n  undefined4 uVar5;\n  undefined2 *puVar6;\n  int iVar7;\n  \n  if (*(int *)(param_3 + 4) <= (int)(param_2 + 3)) {\n    return 0;\n  }\n  memmove((void *)((int)param_1 + (*(int *)(param_3 + 4) - param_2)),param_1,param_2);\n  *param_1 = 0x200;\n  iVar3 = *(int *)(param_3 + 4) - param_2;\n  if (3 < iVar3) {\n    puVar6 = param_1;\n    do {\n      do {\n        cVar1 = FUN_00065c80();\n        *(char *)(puVar6 + 1) = cVar1;\n      } while (cVar1 == '\0');\n      puVar6 = (undefined2 *)((int)puVar6 + 1);\n      iVar3 = *(int *)(param_3 + 4) - param_2;\n    } while ((2 - (int)param_1) + (int)puVar6 < iVar3 + -1);\n  }\n  *(undefined1 *)((int)param_1 + iVar3 + -1) = 0;\n  uVar4 = FUN_00053bf0(param_1,*(undefined4 *)(param_3 + 4));\n  uVar5 = FUN_000556a0(uVar4,*(undefined4 *)(param_3 + 0xc),*(undefined4 *)(param_3 + 8));\n  iVar3 = *(int *)(param_3 + 4) + -1;\n  if (*(int *)(param_3 + 4) != 0) {\n    do {\n      iVar7 = iVar3 + -1;\n      uVar2 = FUN_00053ee0(uVar5,iVar3);\n      *(undefined1 *)param_1 = uVar2;\n      param_1 = (undefined2 *)((int)param_1 + 1);\n      iVar3 = iVar7;\n    } while (iVar7 != -1);\n  }\n  FUN_00053760(uVar4);\n  FUN_00053760(uVar5);\n  return 1;\n}" type_identifier (function_declarator "FUN_00066c70(undefined2 *param_1,size_t param_2,int param_3)" identifier (parameter_list "(undefined2 *param_1,size_t param_2,int param_3)" ( (parameter_declaration "undefined2 *param_1" type_identifier (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "size_t param_2" primitive_type identifier) , (parameter_declaration "int param_3" primitive_type identifier) ))) (compound_statement "{\n  char cVar1;\n  undefined1 uVar2;\n  int iVar3;\n  undefined4 uVar4;\n  undefined4 uVar5;\n  undefined2 *puVar6;\n  int iVar7;\n  \n  if (*(int *)(param_3 + 4) <= (int)(param_2 + 3)) {\n    return 0;\n  }\n  memmove((void *)((int)param_1 + (*(int *)(param_3 + 4) - param_2)),param_1,param_2);\n  *param_1 = 0x200;\n  iVar3 = *(int *)(param_3 + 4) - param_2;\n  if (3 < iVar3) {\n    puVar6 = param_1;\n    do {\n      do {\n        cVar1 = FUN_00065c80();\n        *(char *)(puVar6 + 1) = cVar1;\n      } while (cVar1 == '\0');\n      puVar6 = (undefined2 *)((int)puVar6 + 1);\n      iVar3 = *(int *)(param_3 + 4) - param_2;\n    } while ((2 - (int)param_1) + (int)puVar6 < iVar3 + -1);\n  }\n  *(undefined1 *)((int)param_1 + iVar3 + -1) = 0;\n  uVar4 = FUN_00053bf0(param_1,*(undefined4 *)(param_3 + 4));\n  uVar5 = FUN_000556a0(uVar4,*(undefined4 *)(param_3 + 0xc),*(undefined4 *)(param_3 + 8));\n  iVar3 = *(int *)(param_3 + 4) + -1;\n  if (*(int *)(param_3 + 4) != 0) {\n    do {\n      iVar7 = iVar3 + -1;\n      uVar2 = FUN_00053ee0(uVar5,iVar3);\n      *(undefined1 *)param_1 = uVar2;\n      param_1 = (undefined2 *)((int)param_1 + 1);\n      iVar3 = iVar7;\n    } while (iVar7 != -1);\n  }\n  FUN_00053760(uVar4);\n  FUN_00053760(uVar5);\n  return 1;\n}" { (declaration "char cVar1;" primitive_type identifier ;) (declaration "undefined1 uVar2;" type_identifier identifier ;) (declaration "int iVar3;" primitive_type identifier ;) (declaration "undefined4 uVar4;" type_identifier identifier ;) (declaration "undefined4 uVar5;" type_identifier identifier ;) (declaration "undefined2 *puVar6;" type_identifier (pointer_declarator "*puVar6" * identifier) ;) (declaration "int iVar7;" primitive_type identifier ;) (if_statement "if (*(int *)(param_3 + 4) <= (int)(param_2 + 3)) {\n    return 0;\n  }" if (parenthesized_expression "(*(int *)(param_3 + 4) <= (int)(param_2 + 3))" ( (binary_expression "*(int *)(param_3 + 4) <= (int)(param_2 + 3)" (pointer_expression "*(int *)(param_3 + 4)" * (cast_expression "(int *)(param_3 + 4)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_3 + 4)" ( (binary_expression "param_3 + 4" identifier + number_literal) )))) <= (cast_expression "(int)(param_2 + 3)" ( (type_descriptor "int" primitive_type) ) (parenthesized_expression "(param_2 + 3)" ( (binary_expression "param_2 + 3" identifier + number_literal) )))) )) (compound_statement "{\n    return 0;\n  }" { (return_statement "return 0;" return number_literal ;) })) (expression_statement "memmove((void *)((int)param_1 + (*(int *)(param_3 + 4) - param_2)),param_1,param_2);" (call_expression "memmove((void *)((int)param_1 + (*(int *)(param_3 + 4) - param_2)),param_1,param_2)" identifier (argument_list "((void *)((int)param_1 + (*(int *)(param_3 + 4) - param_2)),param_1,param_2)" ( (cast_expression "(void *)((int)param_1 + (*(int *)(param_3 + 4) - param_2))" ( (type_descriptor "void *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((int)param_1 + (*(int *)(param_3 + 4) - param_2))" ( (binary_expression "(int)param_1 + (*(int *)(param_3 + 4) - param_2)" (cast_expression "(int)param_1" ( (type_descriptor "int" primitive_type) ) identifier) + (parenthesized_expression "(*(int *)(param_3 + 4) - param_2)" ( (binary_expression "*(int *)(param_3 + 4) - param_2" (pointer_expression "*(int *)(param_3 + 4)" * (cast_expression "(int *)(param_3 + 4)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_3 + 4)" ( (binary_expression "param_3 + 4" identifier + number_literal) )))) - identifier) ))) ))) , identifier , identifier ))) ;) (expression_statement "*param_1 = 0x200;" (assignment_expression "*param_1 = 0x200" (pointer_expression "*param_1" * identifier) = number_literal) ;) (expression_statement "iVar3 = *(int *)(param_3 + 4) - param_2;" (assignment_expression "iVar3 = *(int *)(param_3 + 4) - param_2" identifier = (binary_expression "*(int *)(param_3 + 4) - param_2" (pointer_expression "*(int *)(param_3 + 4)" * (cast_expression "(int *)(param_3 + 4)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_3 + 4)" ( (binary_expression "param_3 + 4" identifier + number_literal) )))) - identifier)) ;) (if_statement "if (3 < iVar3) {\n    puVar6 = param_1;\n    do {\n      do {\n        cVar1 = FUN_00065c80();\n        *(char *)(puVar6 + 1) = cVar1;\n      } while (cVar1 == '\0');\n      puVar6 = (undefined2 *)((int)puVar6 + 1);\n      iVar3 = *(int *)(param_3 + 4) - param_2;\n    } while ((2 - (int)param_1) + (int)puVar6 < iVar3 + -1);\n  }" if (parenthesized_expression "(3 < iVar3)" ( (binary_expression "3 < iVar3" number_literal < identifier) )) (compound_statement "{\n    puVar6 = param_1;\n    do {\n      do {\n        cVar1 = FUN_00065c80();\n        *(char *)(puVar6 + 1) = cVar1;\n      } while (cVar1 == '\0');\n      puVar6 = (undefined2 *)((int)puVar6 + 1);\n      iVar3 = *(int *)(param_3 + 4) - param_2;\n    } while ((2 - (int)param_1) + (int)puVar6 < iVar3 + -1);\n  }" { (expression_statement "puVar6 = param_1;" (assignment_expression "puVar6 = param_1" identifier = identifier) ;) (do_statement "do {\n      do {\n        cVar1 = FUN_00065c80();\n        *(char *)(puVar6 + 1) = cVar1;\n      } while (cVar1 == '\0');\n      puVar6 = (undefined2 *)((int)puVar6 + 1);\n      iVar3 = *(int *)(param_3 + 4) - param_2;\n    } while ((2 - (int)param_1) + (int)puVar6 < iVar3 + -1);" do (compound_statement "{\n      do {\n        cVar1 = FUN_00065c80();\n        *(char *)(puVar6 + 1) = cVar1;\n      } while (cVar1 == '\0');\n      puVar6 = (undefined2 *)((int)puVar6 + 1);\n      iVar3 = *(int *)(param_3 + 4) - param_2;\n    }" { (do_statement "do {\n        cVar1 = FUN_00065c80();\n        *(char *)(puVar6 + 1) = cVar1;\n      } while (cVar1 == '\0');" do (compound_statement "{\n        cVar1 = FUN_00065c80();\n        *(char *)(puVar6 + 1) = cVar1;\n      }" { (expression_statement "cVar1 = FUN_00065c80();" (assignment_expression "cVar1 = FUN_00065c80()" identifier = (call_expression "FUN_00065c80()" identifier (argument_list "()" ( )))) ;) (expression_statement "*(char *)(puVar6 + 1) = cVar1;" (assignment_expression "*(char *)(puVar6 + 1) = cVar1" (pointer_expression "*(char *)(puVar6 + 1)" * (cast_expression "(char *)(puVar6 + 1)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(puVar6 + 1)" ( (binary_expression "puVar6 + 1" identifier + number_literal) )))) = identifier) ;) }) while (parenthesized_expression "(cVar1 == '\0')" ( (binary_expression "cVar1 == '\0'" identifier == (char_literal "'\0'" ' escape_sequence ')) )) ;) (expression_statement "puVar6 = (undefined2 *)((int)puVar6 + 1);" (assignment_expression "puVar6 = (undefined2 *)((int)puVar6 + 1)" identifier = (cast_expression "(undefined2 *)((int)puVar6 + 1)" ( (type_descriptor "undefined2 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((int)puVar6 + 1)" ( (binary_expression "(int)puVar6 + 1" (cast_expression "(int)puVar6" ( (type_descriptor "int" primitive_type) ) identifier) + number_literal) )))) ;) (expression_statement "iVar3 = *(int *)(param_3 + 4) - param_2;" (assignment_expression "iVar3 = *(int *)(param_3 + 4) - param_2" identifier = (binary_expression "*(int *)(param_3 + 4) - param_2" (pointer_expression "*(int *)(param_3 + 4)" * (cast_expression "(int *)(param_3 + 4)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_3 + 4)" ( (binary_expression "param_3 + 4" identifier + number_literal) )))) - identifier)) ;) }) while (parenthesized_expression "((2 - (int)param_1) + (int)puVar6 < iVar3 + -1)" ( (binary_expression "(2 - (int)param_1) + (int)puVar6 < iVar3 + -1" (binary_expression "(2 - (int)param_1) + (int)puVar6" (parenthesized_expression "(2 - (int)param_1)" ( (binary_expression "2 - (int)param_1" number_literal - (cast_expression "(int)param_1" ( (type_descriptor "int" primitive_type) ) identifier)) )) + (cast_expression "(int)puVar6" ( (type_descriptor "int" primitive_type) ) identifier)) < (binary_expression "iVar3 + -1" identifier + number_literal)) )) ;) })) (expression_statement "*(undefined1 *)((int)param_1 + iVar3 + -1) = 0;" (assignment_expression "*(undefined1 *)((int)param_1 + iVar3 + -1) = 0" (pointer_expression "*(undefined1 *)((int)param_1 + iVar3 + -1)" * (cast_expression "(undefined1 *)((int)param_1 + iVar3 + -1)" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((int)param_1 + iVar3 + -1)" ( (binary_expression "(int)param_1 + iVar3 + -1" (binary_expression "(int)param_1 + iVar3" (cast_expression "(int)param_1" ( (type_descriptor "int" primitive_type) ) identifier) + identifier) + number_literal) )))) = number_literal) ;) (expression_statement "uVar4 = FUN_00053bf0(param_1,*(undefined4 *)(param_3 + 4));" (assignment_expression "uVar4 = FUN_00053bf0(param_1,*(undefined4 *)(param_3 + 4))" identifier = (call_expression "FUN_00053bf0(param_1,*(undefined4 *)(param_3 + 4))" identifier (argument_list "(param_1,*(undefined4 *)(param_3 + 4))" ( identifier , (pointer_expression "*(undefined4 *)(param_3 + 4)" * (cast_expression "(undefined4 *)(param_3 + 4)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_3 + 4)" ( (binary_expression "param_3 + 4" identifier + number_literal) )))) )))) ;) (expression_statement "uVar5 = FUN_000556a0(uVar4,*(undefined4 *)(param_3 + 0xc),*(undefined4 *)(param_3 + 8));" (assignment_expression "uVar5 = FUN_000556a0(uVar4,*(undefined4 *)(param_3 + 0xc),*(undefined4 *)(param_3 + 8))" identifier = (call_expression "FUN_000556a0(uVar4,*(undefined4 *)(param_3 + 0xc),*(undefined4 *)(param_3 + 8))" identifier (argument_list "(uVar4,*(undefined4 *)(param_3 + 0xc),*(undefined4 *)(param_3 + 8))" ( identifier , (pointer_expression "*(undefined4 *)(param_3 + 0xc)" * (cast_expression "(undefined4 *)(param_3 + 0xc)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_3 + 0xc)" ( (binary_expression "param_3 + 0xc" identifier + number_literal) )))) , (pointer_expression "*(undefined4 *)(param_3 + 8)" * (cast_expression "(undefined4 *)(param_3 + 8)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_3 + 8)" ( (binary_expression "param_3 + 8" identifier + number_literal) )))) )))) ;) (expression_statement "iVar3 = *(int *)(param_3 + 4) + -1;" (assignment_expression "iVar3 = *(int *)(param_3 + 4) + -1" identifier = (binary_expression "*(int *)(param_3 + 4) + -1" (pointer_expression "*(int *)(param_3 + 4)" * (cast_expression "(int *)(param_3 + 4)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_3 + 4)" ( (binary_expression "param_3 + 4" identifier + number_literal) )))) + number_literal)) ;) (if_statement "if (*(int *)(param_3 + 4) != 0) {\n    do {\n      iVar7 = iVar3 + -1;\n      uVar2 = FUN_00053ee0(uVar5,iVar3);\n      *(undefined1 *)param_1 = uVar2;\n      param_1 = (undefined2 *)((int)param_1 + 1);\n      iVar3 = iVar7;\n    } while (iVar7 != -1);\n  }" if (parenthesized_expression "(*(int *)(param_3 + 4) != 0)" ( (binary_expression "*(int *)(param_3 + 4) != 0" (pointer_expression "*(int *)(param_3 + 4)" * (cast_expression "(int *)(param_3 + 4)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_3 + 4)" ( (binary_expression "param_3 + 4" identifier + number_literal) )))) != number_literal) )) (compound_statement "{\n    do {\n      iVar7 = iVar3 + -1;\n      uVar2 = FUN_00053ee0(uVar5,iVar3);\n      *(undefined1 *)param_1 = uVar2;\n      param_1 = (undefined2 *)((int)param_1 + 1);\n      iVar3 = iVar7;\n    } while (iVar7 != -1);\n  }" { (do_statement "do {\n      iVar7 = iVar3 + -1;\n      uVar2 = FUN_00053ee0(uVar5,iVar3);\n      *(undefined1 *)param_1 = uVar2;\n      param_1 = (undefined2 *)((int)param_1 + 1);\n      iVar3 = iVar7;\n    } while (iVar7 != -1);" do (compound_statement "{\n      iVar7 = iVar3 + -1;\n      uVar2 = FUN_00053ee0(uVar5,iVar3);\n      *(undefined1 *)param_1 = uVar2;\n      param_1 = (undefined2 *)((int)param_1 + 1);\n      iVar3 = iVar7;\n    }" { (expression_statement "iVar7 = iVar3 + -1;" (assignment_expression "iVar7 = iVar3 + -1" identifier = (binary_expression "iVar3 + -1" identifier + number_literal)) ;) (expression_statement "uVar2 = FUN_00053ee0(uVar5,iVar3);" (assignment_expression "uVar2 = FUN_00053ee0(uVar5,iVar3)" identifier = (call_expression "FUN_00053ee0(uVar5,iVar3)" identifier (argument_list "(uVar5,iVar3)" ( identifier , identifier )))) ;) (expression_statement "*(undefined1 *)param_1 = uVar2;" (assignment_expression "*(undefined1 *)param_1 = uVar2" (pointer_expression "*(undefined1 *)param_1" * (cast_expression "(undefined1 *)param_1" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) = identifier) ;) (expression_statement "param_1 = (undefined2 *)((int)param_1 + 1);" (assignment_expression "param_1 = (undefined2 *)((int)param_1 + 1)" identifier = (cast_expression "(undefined2 *)((int)param_1 + 1)" ( (type_descriptor "undefined2 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((int)param_1 + 1)" ( (binary_expression "(int)param_1 + 1" (cast_expression "(int)param_1" ( (type_descriptor "int" primitive_type) ) identifier) + number_literal) )))) ;) (expression_statement "iVar3 = iVar7;" (assignment_expression "iVar3 = iVar7" identifier = identifier) ;) }) while (parenthesized_expression "(iVar7 != -1)" ( (binary_expression "iVar7 != -1" identifier != number_literal) )) ;) })) (expression_statement "FUN_00053760(uVar4);" (call_expression "FUN_00053760(uVar4)" identifier (argument_list "(uVar4)" ( identifier ))) ;) (expression_statement "FUN_00053760(uVar5);" (call_expression "FUN_00053760(uVar5)" identifier (argument_list "(uVar5)" ( identifier ))) ;) (return_statement "return 1;" return number_literal ;) })))
(translation_unit "/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n/* WARNING: Unknown calling convention */\n\nint rsaencrypt(uchar *data,int length,RSAKey *key)\n\n{\n  int iVar1;\n  Bignum_conflict base_in;\n  Bignum_conflict bn;\n  uchar *puVar2;\n  int iVar3;\n  \n  if (key->bytes <= length + 3) {\n    return 0;\n  }\n  memmove(data + (key->bytes - length),data,length);\n  data[0] = '\0';\n  data[1] = '\x02';\n  iVar1 = key->bytes - length;\n  if (3 < iVar1) {\n    puVar2 = data;\n    do {\n      do {\n        iVar1 = random_byte();\n        puVar2[2] = (uchar)iVar1;\n      } while ((uchar)iVar1 == '\0');\n      puVar2 = puVar2 + 1;\n      iVar1 = key->bytes - length;\n    } while ((int)(puVar2 + (2 - (int)data)) < iVar1 + -1);\n  }\n  data[iVar1 + -1] = '\0';\n  base_in = bignum_from_bytes(data,key->bytes);\n  bn = modpow(base_in,(Bignum_conflict)key->exponent,(Bignum_conflict)key->modulus);\n  iVar1 = key->bytes + -1;\n  if (key->bytes != 0) {\n    do {\n      iVar3 = iVar1 + -1;\n      iVar1 = bignum_byte(bn,iVar1);\n      *data = (uchar)iVar1;\n      data = data + 1;\n      iVar1 = iVar3;\n    } while (iVar3 != -1);\n  }\n  freebn(base_in);\n  freebn(bn);\n  return 1;\n}\n\n" comment comment (function_definition "int rsaencrypt(uchar *data,int length,RSAKey *key)\n\n{\n  int iVar1;\n  Bignum_conflict base_in;\n  Bignum_conflict bn;\n  uchar *puVar2;\n  int iVar3;\n  \n  if (key->bytes <= length + 3) {\n    return 0;\n  }\n  memmove(data + (key->bytes - length),data,length);\n  data[0] = '\0';\n  data[1] = '\x02';\n  iVar1 = key->bytes - length;\n  if (3 < iVar1) {\n    puVar2 = data;\n    do {\n      do {\n        iVar1 = random_byte();\n        puVar2[2] = (uchar)iVar1;\n      } while ((uchar)iVar1 == '\0');\n      puVar2 = puVar2 + 1;\n      iVar1 = key->bytes - length;\n    } while ((int)(puVar2 + (2 - (int)data)) < iVar1 + -1);\n  }\n  data[iVar1 + -1] = '\0';\n  base_in = bignum_from_bytes(data,key->bytes);\n  bn = modpow(base_in,(Bignum_conflict)key->exponent,(Bignum_conflict)key->modulus);\n  iVar1 = key->bytes + -1;\n  if (key->bytes != 0) {\n    do {\n      iVar3 = iVar1 + -1;\n      iVar1 = bignum_byte(bn,iVar1);\n      *data = (uchar)iVar1;\n      data = data + 1;\n      iVar1 = iVar3;\n    } while (iVar3 != -1);\n  }\n  freebn(base_in);\n  freebn(bn);\n  return 1;\n}" primitive_type (function_declarator "rsaencrypt(uchar *data,int length,RSAKey *key)" identifier (parameter_list "(uchar *data,int length,RSAKey *key)" ( (parameter_declaration "uchar *data" type_identifier (pointer_declarator "*data" * identifier)) , (parameter_declaration "int length" primitive_type identifier) , (parameter_declaration "RSAKey *key" type_identifier (pointer_declarator "*key" * identifier)) ))) (compound_statement "{\n  int iVar1;\n  Bignum_conflict base_in;\n  Bignum_conflict bn;\n  uchar *puVar2;\n  int iVar3;\n  \n  if (key->bytes <= length + 3) {\n    return 0;\n  }\n  memmove(data + (key->bytes - length),data,length);\n  data[0] = '\0';\n  data[1] = '\x02';\n  iVar1 = key->bytes - length;\n  if (3 < iVar1) {\n    puVar2 = data;\n    do {\n      do {\n        iVar1 = random_byte();\n        puVar2[2] = (uchar)iVar1;\n      } while ((uchar)iVar1 == '\0');\n      puVar2 = puVar2 + 1;\n      iVar1 = key->bytes - length;\n    } while ((int)(puVar2 + (2 - (int)data)) < iVar1 + -1);\n  }\n  data[iVar1 + -1] = '\0';\n  base_in = bignum_from_bytes(data,key->bytes);\n  bn = modpow(base_in,(Bignum_conflict)key->exponent,(Bignum_conflict)key->modulus);\n  iVar1 = key->bytes + -1;\n  if (key->bytes != 0) {\n    do {\n      iVar3 = iVar1 + -1;\n      iVar1 = bignum_byte(bn,iVar1);\n      *data = (uchar)iVar1;\n      data = data + 1;\n      iVar1 = iVar3;\n    } while (iVar3 != -1);\n  }\n  freebn(base_in);\n  freebn(bn);\n  return 1;\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "Bignum_conflict base_in;" type_identifier identifier ;) (declaration "Bignum_conflict bn;" type_identifier identifier ;) (declaration "uchar *puVar2;" type_identifier (pointer_declarator "*puVar2" * identifier) ;) (declaration "int iVar3;" primitive_type identifier ;) (if_statement "if (key->bytes <= length + 3) {\n    return 0;\n  }" if (parenthesized_expression "(key->bytes <= length + 3)" ( (binary_expression "key->bytes <= length + 3" (field_expression "key->bytes" identifier -> field_identifier) <= (binary_expression "length + 3" identifier + number_literal)) )) (compound_statement "{\n    return 0;\n  }" { (return_statement "return 0;" return number_literal ;) })) (expression_statement "memmove(data + (key->bytes - length),data,length);" (call_expression "memmove(data + (key->bytes - length),data,length)" identifier (argument_list "(data + (key->bytes - length),data,length)" ( (binary_expression "data + (key->bytes - length)" identifier + (parenthesized_expression "(key->bytes - length)" ( (binary_expression "key->bytes - length" (field_expression "key->bytes" identifier -> field_identifier) - identifier) ))) , identifier , identifier ))) ;) (expression_statement "data[0] = '\0';" (assignment_expression "data[0] = '\0'" (subscript_expression "data[0]" identifier [ number_literal ]) = (char_literal "'\0'" ' escape_sequence ')) ;) (expression_statement "data[1] = '\x02';" (assignment_expression "data[1] = '\x02'" (subscript_expression "data[1]" identifier [ number_literal ]) = (char_literal "'\x02'" ' escape_sequence ')) ;) (expression_statement "iVar1 = key->bytes - length;" (assignment_expression "iVar1 = key->bytes - length" identifier = (binary_expression "key->bytes - length" (field_expression "key->bytes" identifier -> field_identifier) - identifier)) ;) (if_statement "if (3 < iVar1) {\n    puVar2 = data;\n    do {\n      do {\n        iVar1 = random_byte();\n        puVar2[2] = (uchar)iVar1;\n      } while ((uchar)iVar1 == '\0');\n      puVar2 = puVar2 + 1;\n      iVar1 = key->bytes - length;\n    } while ((int)(puVar2 + (2 - (int)data)) < iVar1 + -1);\n  }" if (parenthesized_expression "(3 < iVar1)" ( (binary_expression "3 < iVar1" number_literal < identifier) )) (compound_statement "{\n    puVar2 = data;\n    do {\n      do {\n        iVar1 = random_byte();\n        puVar2[2] = (uchar)iVar1;\n      } while ((uchar)iVar1 == '\0');\n      puVar2 = puVar2 + 1;\n      iVar1 = key->bytes - length;\n    } while ((int)(puVar2 + (2 - (int)data)) < iVar1 + -1);\n  }" { (expression_statement "puVar2 = data;" (assignment_expression "puVar2 = data" identifier = identifier) ;) (do_statement "do {\n      do {\n        iVar1 = random_byte();\n        puVar2[2] = (uchar)iVar1;\n      } while ((uchar)iVar1 == '\0');\n      puVar2 = puVar2 + 1;\n      iVar1 = key->bytes - length;\n    } while ((int)(puVar2 + (2 - (int)data)) < iVar1 + -1);" do (compound_statement "{\n      do {\n        iVar1 = random_byte();\n        puVar2[2] = (uchar)iVar1;\n      } while ((uchar)iVar1 == '\0');\n      puVar2 = puVar2 + 1;\n      iVar1 = key->bytes - length;\n    }" { (do_statement "do {\n        iVar1 = random_byte();\n        puVar2[2] = (uchar)iVar1;\n      } while ((uchar)iVar1 == '\0');" do (compound_statement "{\n        iVar1 = random_byte();\n        puVar2[2] = (uchar)iVar1;\n      }" { (expression_statement "iVar1 = random_byte();" (assignment_expression "iVar1 = random_byte()" identifier = (call_expression "random_byte()" identifier (argument_list "()" ( )))) ;) (expression_statement "puVar2[2] = (uchar)iVar1;" (assignment_expression "puVar2[2] = (uchar)iVar1" (subscript_expression "puVar2[2]" identifier [ number_literal ]) = (cast_expression "(uchar)iVar1" ( (type_descriptor "uchar" type_identifier) ) identifier)) ;) }) while (parenthesized_expression "((uchar)iVar1 == '\0')" ( (binary_expression "(uchar)iVar1 == '\0'" (cast_expression "(uchar)iVar1" ( (type_descriptor "uchar" type_identifier) ) identifier) == (char_literal "'\0'" ' escape_sequence ')) )) ;) (expression_statement "puVar2 = puVar2 + 1;" (assignment_expression "puVar2 = puVar2 + 1" identifier = (binary_expression "puVar2 + 1" identifier + number_literal)) ;) (expression_statement "iVar1 = key->bytes - length;" (assignment_expression "iVar1 = key->bytes - length" identifier = (binary_expression "key->bytes - length" (field_expression "key->bytes" identifier -> field_identifier) - identifier)) ;) }) while (parenthesized_expression "((int)(puVar2 + (2 - (int)data)) < iVar1 + -1)" ( (binary_expression "(int)(puVar2 + (2 - (int)data)) < iVar1 + -1" (cast_expression "(int)(puVar2 + (2 - (int)data))" ( (type_descriptor "int" primitive_type) ) (parenthesized_expression "(puVar2 + (2 - (int)data))" ( (binary_expression "puVar2 + (2 - (int)data)" identifier + (parenthesized_expression "(2 - (int)data)" ( (binary_expression "2 - (int)data" number_literal - (cast_expression "(int)data" ( (type_descriptor "int" primitive_type) ) identifier)) ))) ))) < (binary_expression "iVar1 + -1" identifier + number_literal)) )) ;) })) (expression_statement "data[iVar1 + -1] = '\0';" (assignment_expression "data[iVar1 + -1] = '\0'" (subscript_expression "data[iVar1 + -1]" identifier [ (binary_expression "iVar1 + -1" identifier + number_literal) ]) = (char_literal "'\0'" ' escape_sequence ')) ;) (expression_statement "base_in = bignum_from_bytes(data,key->bytes);" (assignment_expression "base_in = bignum_from_bytes(data,key->bytes)" identifier = (call_expression "bignum_from_bytes(data,key->bytes)" identifier (argument_list "(data,key->bytes)" ( identifier , (field_expression "key->bytes" identifier -> field_identifier) )))) ;) (expression_statement "bn = modpow(base_in,(Bignum_conflict)key->exponent,(Bignum_conflict)key->modulus);" (assignment_expression "bn = modpow(base_in,(Bignum_conflict)key->exponent,(Bignum_conflict)key->modulus)" identifier = (call_expression "modpow(base_in,(Bignum_conflict)key->exponent,(Bignum_conflict)key->modulus)" identifier (argument_list "(base_in,(Bignum_conflict)key->exponent,(Bignum_conflict)key->modulus)" ( identifier , (cast_expression "(Bignum_conflict)key->exponent" ( (type_descriptor "Bignum_conflict" type_identifier) ) (field_expression "key->exponent" identifier -> field_identifier)) , (cast_expression "(Bignum_conflict)key->modulus" ( (type_descriptor "Bignum_conflict" type_identifier) ) (field_expression "key->modulus" identifier -> field_identifier)) )))) ;) (expression_statement "iVar1 = key->bytes + -1;" (assignment_expression "iVar1 = key->bytes + -1" identifier = (binary_expression "key->bytes + -1" (field_expression "key->bytes" identifier -> field_identifier) + number_literal)) ;) (if_statement "if (key->bytes != 0) {\n    do {\n      iVar3 = iVar1 + -1;\n      iVar1 = bignum_byte(bn,iVar1);\n      *data = (uchar)iVar1;\n      data = data + 1;\n      iVar1 = iVar3;\n    } while (iVar3 != -1);\n  }" if (parenthesized_expression "(key->bytes != 0)" ( (binary_expression "key->bytes != 0" (field_expression "key->bytes" identifier -> field_identifier) != number_literal) )) (compound_statement "{\n    do {\n      iVar3 = iVar1 + -1;\n      iVar1 = bignum_byte(bn,iVar1);\n      *data = (uchar)iVar1;\n      data = data + 1;\n      iVar1 = iVar3;\n    } while (iVar3 != -1);\n  }" { (do_statement "do {\n      iVar3 = iVar1 + -1;\n      iVar1 = bignum_byte(bn,iVar1);\n      *data = (uchar)iVar1;\n      data = data + 1;\n      iVar1 = iVar3;\n    } while (iVar3 != -1);" do (compound_statement "{\n      iVar3 = iVar1 + -1;\n      iVar1 = bignum_byte(bn,iVar1);\n      *data = (uchar)iVar1;\n      data = data + 1;\n      iVar1 = iVar3;\n    }" { (expression_statement "iVar3 = iVar1 + -1;" (assignment_expression "iVar3 = iVar1 + -1" identifier = (binary_expression "iVar1 + -1" identifier + number_literal)) ;) (expression_statement "iVar1 = bignum_byte(bn,iVar1);" (assignment_expression "iVar1 = bignum_byte(bn,iVar1)" identifier = (call_expression "bignum_byte(bn,iVar1)" identifier (argument_list "(bn,iVar1)" ( identifier , identifier )))) ;) (expression_statement "*data = (uchar)iVar1;" (assignment_expression "*data = (uchar)iVar1" (pointer_expression "*data" * identifier) = (cast_expression "(uchar)iVar1" ( (type_descriptor "uchar" type_identifier) ) identifier)) ;) (expression_statement "data = data + 1;" (assignment_expression "data = data + 1" identifier = (binary_expression "data + 1" identifier + number_literal)) ;) (expression_statement "iVar1 = iVar3;" (assignment_expression "iVar1 = iVar3" identifier = identifier) ;) }) while (parenthesized_expression "(iVar3 != -1)" ( (binary_expression "iVar3 != -1" identifier != number_literal) )) ;) })) (expression_statement "freebn(base_in);" (call_expression "freebn(base_in)" identifier (argument_list "(base_in)" ( identifier ))) ;) (expression_statement "freebn(bn);" (call_expression "freebn(bn)" identifier (argument_list "(bn)" ( identifier ))) ;) (return_statement "return 1;" return number_literal ;) })))
(translation_unit "undefined4 FUN_00066c70(undefined2 *param_1,size_t param_2,int param_3)\n\n{\n  char cVar1;\n  undefined1 uVar2;\n  int iVar3;\n  undefined4 uVar4;\n  undefined4 uVar5;\n  undefined2 *puVar6;\n  int iVar7;\n  \n  if (*(int *)(param_3 + 4) <= (int)(param_2 + 3)) {\n    return 0;\n  }\n  memmove((void *)((int)param_1 + (*(int *)(param_3 + 4) - param_2)),param_1,param_2);\n  *param_1 = 0x200;\n  iVar3 = *(int *)(param_3 + 4) - param_2;\n  if (3 < iVar3) {\n    puVar6 = param_1;\n    do {\n      do {\n        cVar1 = FUN_00065c80();\n        *(char *)(puVar6 + 1) = cVar1;\n      } while (cVar1 == '\0');\n      puVar6 = (undefined2 *)((int)puVar6 + 1);\n      iVar3 = *(int *)(param_3 + 4) - param_2;\n    } while ((2 - (int)param_1) + (int)puVar6 < iVar3 + -1);\n  }\n  *(undefined1 *)((int)param_1 + iVar3 + -1) = 0;\n  uVar4 = FUN_00053bf0(param_1,*(undefined4 *)(param_3 + 4));\n  uVar5 = FUN_000556a0(uVar4,*(undefined4 *)(param_3 + 0xc),*(undefined4 *)(param_3 + 8));\n  iVar3 = *(int *)(param_3 + 4) + -1;\n  if (*(int *)(param_3 + 4) != 0) {\n    do {\n      iVar7 = iVar3 + -1;\n      uVar2 = FUN_00053ee0(uVar5,iVar3);\n      *(undefined1 *)param_1 = uVar2;\n      param_1 = (undefined2 *)((int)param_1 + 1);\n      iVar3 = iVar7;\n    } while (iVar7 != -1);\n  }\n  FUN_00053760(uVar4);\n  FUN_00053760(uVar5);\n  return 1;\n}\n\n" (function_definition "undefined4 FUN_00066c70(undefined2 *param_1,size_t param_2,int param_3)\n\n{\n  char cVar1;\n  undefined1 uVar2;\n  int iVar3;\n  undefined4 uVar4;\n  undefined4 uVar5;\n  undefined2 *puVar6;\n  int iVar7;\n  \n  if (*(int *)(param_3 + 4) <= (int)(param_2 + 3)) {\n    return 0;\n  }\n  memmove((void *)((int)param_1 + (*(int *)(param_3 + 4) - param_2)),param_1,param_2);\n  *param_1 = 0x200;\n  iVar3 = *(int *)(param_3 + 4) - param_2;\n  if (3 < iVar3) {\n    puVar6 = param_1;\n    do {\n      do {\n        cVar1 = FUN_00065c80();\n        *(char *)(puVar6 + 1) = cVar1;\n      } while (cVar1 == '\0');\n      puVar6 = (undefined2 *)((int)puVar6 + 1);\n      iVar3 = *(int *)(param_3 + 4) - param_2;\n    } while ((2 - (int)param_1) + (int)puVar6 < iVar3 + -1);\n  }\n  *(undefined1 *)((int)param_1 + iVar3 + -1) = 0;\n  uVar4 = FUN_00053bf0(param_1,*(undefined4 *)(param_3 + 4));\n  uVar5 = FUN_000556a0(uVar4,*(undefined4 *)(param_3 + 0xc),*(undefined4 *)(param_3 + 8));\n  iVar3 = *(int *)(param_3 + 4) + -1;\n  if (*(int *)(param_3 + 4) != 0) {\n    do {\n      iVar7 = iVar3 + -1;\n      uVar2 = FUN_00053ee0(uVar5,iVar3);\n      *(undefined1 *)param_1 = uVar2;\n      param_1 = (undefined2 *)((int)param_1 + 1);\n      iVar3 = iVar7;\n    } while (iVar7 != -1);\n  }\n  FUN_00053760(uVar4);\n  FUN_00053760(uVar5);\n  return 1;\n}" type_identifier (function_declarator "FUN_00066c70(undefined2 *param_1,size_t param_2,int param_3)" identifier (parameter_list "(undefined2 *param_1,size_t param_2,int param_3)" ( (parameter_declaration "undefined2 *param_1" type_identifier (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "size_t param_2" primitive_type identifier) , (parameter_declaration "int param_3" primitive_type identifier) ))) (compound_statement "{\n  char cVar1;\n  undefined1 uVar2;\n  int iVar3;\n  undefined4 uVar4;\n  undefined4 uVar5;\n  undefined2 *puVar6;\n  int iVar7;\n  \n  if (*(int *)(param_3 + 4) <= (int)(param_2 + 3)) {\n    return 0;\n  }\n  memmove((void *)((int)param_1 + (*(int *)(param_3 + 4) - param_2)),param_1,param_2);\n  *param_1 = 0x200;\n  iVar3 = *(int *)(param_3 + 4) - param_2;\n  if (3 < iVar3) {\n    puVar6 = param_1;\n    do {\n      do {\n        cVar1 = FUN_00065c80();\n        *(char *)(puVar6 + 1) = cVar1;\n      } while (cVar1 == '\0');\n      puVar6 = (undefined2 *)((int)puVar6 + 1);\n      iVar3 = *(int *)(param_3 + 4) - param_2;\n    } while ((2 - (int)param_1) + (int)puVar6 < iVar3 + -1);\n  }\n  *(undefined1 *)((int)param_1 + iVar3 + -1) = 0;\n  uVar4 = FUN_00053bf0(param_1,*(undefined4 *)(param_3 + 4));\n  uVar5 = FUN_000556a0(uVar4,*(undefined4 *)(param_3 + 0xc),*(undefined4 *)(param_3 + 8));\n  iVar3 = *(int *)(param_3 + 4) + -1;\n  if (*(int *)(param_3 + 4) != 0) {\n    do {\n      iVar7 = iVar3 + -1;\n      uVar2 = FUN_00053ee0(uVar5,iVar3);\n      *(undefined1 *)param_1 = uVar2;\n      param_1 = (undefined2 *)((int)param_1 + 1);\n      iVar3 = iVar7;\n    } while (iVar7 != -1);\n  }\n  FUN_00053760(uVar4);\n  FUN_00053760(uVar5);\n  return 1;\n}" { (declaration "char cVar1;" primitive_type identifier ;) (declaration "undefined1 uVar2;" type_identifier identifier ;) (declaration "int iVar3;" primitive_type identifier ;) (declaration "undefined4 uVar4;" type_identifier identifier ;) (declaration "undefined4 uVar5;" type_identifier identifier ;) (declaration "undefined2 *puVar6;" type_identifier (pointer_declarator "*puVar6" * identifier) ;) (declaration "int iVar7;" primitive_type identifier ;) (if_statement "if (*(int *)(param_3 + 4) <= (int)(param_2 + 3)) {\n    return 0;\n  }" if (parenthesized_expression "(*(int *)(param_3 + 4) <= (int)(param_2 + 3))" ( (binary_expression "*(int *)(param_3 + 4) <= (int)(param_2 + 3)" (pointer_expression "*(int *)(param_3 + 4)" * (cast_expression "(int *)(param_3 + 4)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_3 + 4)" ( (binary_expression "param_3 + 4" identifier + number_literal) )))) <= (cast_expression "(int)(param_2 + 3)" ( (type_descriptor "int" primitive_type) ) (parenthesized_expression "(param_2 + 3)" ( (binary_expression "param_2 + 3" identifier + number_literal) )))) )) (compound_statement "{\n    return 0;\n  }" { (return_statement "return 0;" return number_literal ;) })) (expression_statement "memmove((void *)((int)param_1 + (*(int *)(param_3 + 4) - param_2)),param_1,param_2);" (call_expression "memmove((void *)((int)param_1 + (*(int *)(param_3 + 4) - param_2)),param_1,param_2)" identifier (argument_list "((void *)((int)param_1 + (*(int *)(param_3 + 4) - param_2)),param_1,param_2)" ( (cast_expression "(void *)((int)param_1 + (*(int *)(param_3 + 4) - param_2))" ( (type_descriptor "void *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((int)param_1 + (*(int *)(param_3 + 4) - param_2))" ( (binary_expression "(int)param_1 + (*(int *)(param_3 + 4) - param_2)" (cast_expression "(int)param_1" ( (type_descriptor "int" primitive_type) ) identifier) + (parenthesized_expression "(*(int *)(param_3 + 4) - param_2)" ( (binary_expression "*(int *)(param_3 + 4) - param_2" (pointer_expression "*(int *)(param_3 + 4)" * (cast_expression "(int *)(param_3 + 4)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_3 + 4)" ( (binary_expression "param_3 + 4" identifier + number_literal) )))) - identifier) ))) ))) , identifier , identifier ))) ;) (expression_statement "*param_1 = 0x200;" (assignment_expression "*param_1 = 0x200" (pointer_expression "*param_1" * identifier) = number_literal) ;) (expression_statement "iVar3 = *(int *)(param_3 + 4) - param_2;" (assignment_expression "iVar3 = *(int *)(param_3 + 4) - param_2" identifier = (binary_expression "*(int *)(param_3 + 4) - param_2" (pointer_expression "*(int *)(param_3 + 4)" * (cast_expression "(int *)(param_3 + 4)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_3 + 4)" ( (binary_expression "param_3 + 4" identifier + number_literal) )))) - identifier)) ;) (if_statement "if (3 < iVar3) {\n    puVar6 = param_1;\n    do {\n      do {\n        cVar1 = FUN_00065c80();\n        *(char *)(puVar6 + 1) = cVar1;\n      } while (cVar1 == '\0');\n      puVar6 = (undefined2 *)((int)puVar6 + 1);\n      iVar3 = *(int *)(param_3 + 4) - param_2;\n    } while ((2 - (int)param_1) + (int)puVar6 < iVar3 + -1);\n  }" if (parenthesized_expression "(3 < iVar3)" ( (binary_expression "3 < iVar3" number_literal < identifier) )) (compound_statement "{\n    puVar6 = param_1;\n    do {\n      do {\n        cVar1 = FUN_00065c80();\n        *(char *)(puVar6 + 1) = cVar1;\n      } while (cVar1 == '\0');\n      puVar6 = (undefined2 *)((int)puVar6 + 1);\n      iVar3 = *(int *)(param_3 + 4) - param_2;\n    } while ((2 - (int)param_1) + (int)puVar6 < iVar3 + -1);\n  }" { (expression_statement "puVar6 = param_1;" (assignment_expression "puVar6 = param_1" identifier = identifier) ;) (do_statement "do {\n      do {\n        cVar1 = FUN_00065c80();\n        *(char *)(puVar6 + 1) = cVar1;\n      } while (cVar1 == '\0');\n      puVar6 = (undefined2 *)((int)puVar6 + 1);\n      iVar3 = *(int *)(param_3 + 4) - param_2;\n    } while ((2 - (int)param_1) + (int)puVar6 < iVar3 + -1);" do (compound_statement "{\n      do {\n        cVar1 = FUN_00065c80();\n        *(char *)(puVar6 + 1) = cVar1;\n      } while (cVar1 == '\0');\n      puVar6 = (undefined2 *)((int)puVar6 + 1);\n      iVar3 = *(int *)(param_3 + 4) - param_2;\n    }" { (do_statement "do {\n        cVar1 = FUN_00065c80();\n        *(char *)(puVar6 + 1) = cVar1;\n      } while (cVar1 == '\0');" do (compound_statement "{\n        cVar1 = FUN_00065c80();\n        *(char *)(puVar6 + 1) = cVar1;\n      }" { (expression_statement "cVar1 = FUN_00065c80();" (assignment_expression "cVar1 = FUN_00065c80()" identifier = (call_expression "FUN_00065c80()" identifier (argument_list "()" ( )))) ;) (expression_statement "*(char *)(puVar6 + 1) = cVar1;" (assignment_expression "*(char *)(puVar6 + 1) = cVar1" (pointer_expression "*(char *)(puVar6 + 1)" * (cast_expression "(char *)(puVar6 + 1)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(puVar6 + 1)" ( (binary_expression "puVar6 + 1" identifier + number_literal) )))) = identifier) ;) }) while (parenthesized_expression "(cVar1 == '\0')" ( (binary_expression "cVar1 == '\0'" identifier == (char_literal "'\0'" ' escape_sequence ')) )) ;) (expression_statement "puVar6 = (undefined2 *)((int)puVar6 + 1);" (assignment_expression "puVar6 = (undefined2 *)((int)puVar6 + 1)" identifier = (cast_expression "(undefined2 *)((int)puVar6 + 1)" ( (type_descriptor "undefined2 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((int)puVar6 + 1)" ( (binary_expression "(int)puVar6 + 1" (cast_expression "(int)puVar6" ( (type_descriptor "int" primitive_type) ) identifier) + number_literal) )))) ;) (expression_statement "iVar3 = *(int *)(param_3 + 4) - param_2;" (assignment_expression "iVar3 = *(int *)(param_3 + 4) - param_2" identifier = (binary_expression "*(int *)(param_3 + 4) - param_2" (pointer_expression "*(int *)(param_3 + 4)" * (cast_expression "(int *)(param_3 + 4)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_3 + 4)" ( (binary_expression "param_3 + 4" identifier + number_literal) )))) - identifier)) ;) }) while (parenthesized_expression "((2 - (int)param_1) + (int)puVar6 < iVar3 + -1)" ( (binary_expression "(2 - (int)param_1) + (int)puVar6 < iVar3 + -1" (binary_expression "(2 - (int)param_1) + (int)puVar6" (parenthesized_expression "(2 - (int)param_1)" ( (binary_expression "2 - (int)param_1" number_literal - (cast_expression "(int)param_1" ( (type_descriptor "int" primitive_type) ) identifier)) )) + (cast_expression "(int)puVar6" ( (type_descriptor "int" primitive_type) ) identifier)) < (binary_expression "iVar3 + -1" identifier + number_literal)) )) ;) })) (expression_statement "*(undefined1 *)((int)param_1 + iVar3 + -1) = 0;" (assignment_expression "*(undefined1 *)((int)param_1 + iVar3 + -1) = 0" (pointer_expression "*(undefined1 *)((int)param_1 + iVar3 + -1)" * (cast_expression "(undefined1 *)((int)param_1 + iVar3 + -1)" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((int)param_1 + iVar3 + -1)" ( (binary_expression "(int)param_1 + iVar3 + -1" (binary_expression "(int)param_1 + iVar3" (cast_expression "(int)param_1" ( (type_descriptor "int" primitive_type) ) identifier) + identifier) + number_literal) )))) = number_literal) ;) (expression_statement "uVar4 = FUN_00053bf0(param_1,*(undefined4 *)(param_3 + 4));" (assignment_expression "uVar4 = FUN_00053bf0(param_1,*(undefined4 *)(param_3 + 4))" identifier = (call_expression "FUN_00053bf0(param_1,*(undefined4 *)(param_3 + 4))" identifier (argument_list "(param_1,*(undefined4 *)(param_3 + 4))" ( identifier , (pointer_expression "*(undefined4 *)(param_3 + 4)" * (cast_expression "(undefined4 *)(param_3 + 4)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_3 + 4)" ( (binary_expression "param_3 + 4" identifier + number_literal) )))) )))) ;) (expression_statement "uVar5 = FUN_000556a0(uVar4,*(undefined4 *)(param_3 + 0xc),*(undefined4 *)(param_3 + 8));" (assignment_expression "uVar5 = FUN_000556a0(uVar4,*(undefined4 *)(param_3 + 0xc),*(undefined4 *)(param_3 + 8))" identifier = (call_expression "FUN_000556a0(uVar4,*(undefined4 *)(param_3 + 0xc),*(undefined4 *)(param_3 + 8))" identifier (argument_list "(uVar4,*(undefined4 *)(param_3 + 0xc),*(undefined4 *)(param_3 + 8))" ( identifier , (pointer_expression "*(undefined4 *)(param_3 + 0xc)" * (cast_expression "(undefined4 *)(param_3 + 0xc)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_3 + 0xc)" ( (binary_expression "param_3 + 0xc" identifier + number_literal) )))) , (pointer_expression "*(undefined4 *)(param_3 + 8)" * (cast_expression "(undefined4 *)(param_3 + 8)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_3 + 8)" ( (binary_expression "param_3 + 8" identifier + number_literal) )))) )))) ;) (expression_statement "iVar3 = *(int *)(param_3 + 4) + -1;" (assignment_expression "iVar3 = *(int *)(param_3 + 4) + -1" identifier = (binary_expression "*(int *)(param_3 + 4) + -1" (pointer_expression "*(int *)(param_3 + 4)" * (cast_expression "(int *)(param_3 + 4)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_3 + 4)" ( (binary_expression "param_3 + 4" identifier + number_literal) )))) + number_literal)) ;) (if_statement "if (*(int *)(param_3 + 4) != 0) {\n    do {\n      iVar7 = iVar3 + -1;\n      uVar2 = FUN_00053ee0(uVar5,iVar3);\n      *(undefined1 *)param_1 = uVar2;\n      param_1 = (undefined2 *)((int)param_1 + 1);\n      iVar3 = iVar7;\n    } while (iVar7 != -1);\n  }" if (parenthesized_expression "(*(int *)(param_3 + 4) != 0)" ( (binary_expression "*(int *)(param_3 + 4) != 0" (pointer_expression "*(int *)(param_3 + 4)" * (cast_expression "(int *)(param_3 + 4)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_3 + 4)" ( (binary_expression "param_3 + 4" identifier + number_literal) )))) != number_literal) )) (compound_statement "{\n    do {\n      iVar7 = iVar3 + -1;\n      uVar2 = FUN_00053ee0(uVar5,iVar3);\n      *(undefined1 *)param_1 = uVar2;\n      param_1 = (undefined2 *)((int)param_1 + 1);\n      iVar3 = iVar7;\n    } while (iVar7 != -1);\n  }" { (do_statement "do {\n      iVar7 = iVar3 + -1;\n      uVar2 = FUN_00053ee0(uVar5,iVar3);\n      *(undefined1 *)param_1 = uVar2;\n      param_1 = (undefined2 *)((int)param_1 + 1);\n      iVar3 = iVar7;\n    } while (iVar7 != -1);" do (compound_statement "{\n      iVar7 = iVar3 + -1;\n      uVar2 = FUN_00053ee0(uVar5,iVar3);\n      *(undefined1 *)param_1 = uVar2;\n      param_1 = (undefined2 *)((int)param_1 + 1);\n      iVar3 = iVar7;\n    }" { (expression_statement "iVar7 = iVar3 + -1;" (assignment_expression "iVar7 = iVar3 + -1" identifier = (binary_expression "iVar3 + -1" identifier + number_literal)) ;) (expression_statement "uVar2 = FUN_00053ee0(uVar5,iVar3);" (assignment_expression "uVar2 = FUN_00053ee0(uVar5,iVar3)" identifier = (call_expression "FUN_00053ee0(uVar5,iVar3)" identifier (argument_list "(uVar5,iVar3)" ( identifier , identifier )))) ;) (expression_statement "*(undefined1 *)param_1 = uVar2;" (assignment_expression "*(undefined1 *)param_1 = uVar2" (pointer_expression "*(undefined1 *)param_1" * (cast_expression "(undefined1 *)param_1" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) = identifier) ;) (expression_statement "param_1 = (undefined2 *)((int)param_1 + 1);" (assignment_expression "param_1 = (undefined2 *)((int)param_1 + 1)" identifier = (cast_expression "(undefined2 *)((int)param_1 + 1)" ( (type_descriptor "undefined2 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((int)param_1 + 1)" ( (binary_expression "(int)param_1 + 1" (cast_expression "(int)param_1" ( (type_descriptor "int" primitive_type) ) identifier) + number_literal) )))) ;) (expression_statement "iVar3 = iVar7;" (assignment_expression "iVar3 = iVar7" identifier = identifier) ;) }) while (parenthesized_expression "(iVar7 != -1)" ( (binary_expression "iVar7 != -1" identifier != number_literal) )) ;) })) (expression_statement "FUN_00053760(uVar4);" (call_expression "FUN_00053760(uVar4)" identifier (argument_list "(uVar4)" ( identifier ))) ;) (expression_statement "FUN_00053760(uVar5);" (call_expression "FUN_00053760(uVar5)" identifier (argument_list "(uVar5)" ( identifier ))) ;) (return_statement "return 1;" return number_literal ;) })))
(translation_unit (function_definition TYPE (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE (pointer_declarator * IDENT)) , (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE IDENT) ))) (compound_statement { (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE IDENT ;) (if_statement if (parenthesized_expression ( (binary_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) <= (cast_expression ( (type_descriptor TYPE) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) )) (compound_statement { (return_statement return LIT ;) })) (expression_statement (call_expression IDENT (argument_list ( (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression (cast_expression ( (type_descriptor TYPE) ) IDENT) + (parenthesized_expression ( (binary_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) - IDENT) ))) ))) , IDENT , IDENT ))) ;) (expression_statement (assignment_expression (pointer_expression * IDENT) = LIT) ;) (expression_statement (assignment_expression IDENT = (binary_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) - IDENT)) ;) (if_statement if (parenthesized_expression ( (binary_expression LIT < IDENT) )) (compound_statement { (expression_statement (assignment_expression IDENT = IDENT) ;) (do_statement do (compound_statement { (do_statement do (compound_statement { (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( )))) ;) (expression_statement (assignment_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) = IDENT) ;) }) while (parenthesized_expression ( (binary_expression IDENT == (char_literal ' escape_sequence ')) )) ;) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression (cast_expression ( (type_descriptor TYPE) ) IDENT) + LIT) )))) ;) (expression_statement (assignment_expression IDENT = (binary_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) - IDENT)) ;) }) while (parenthesized_expression ( (binary_expression (binary_expression (parenthesized_expression ( (binary_expression LIT - (cast_expression ( (type_descriptor TYPE) ) IDENT)) )) + (cast_expression ( (type_descriptor TYPE) ) IDENT)) < (binary_expression IDENT + LIT)) )) ;) })) (expression_statement (assignment_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression (binary_expression (cast_expression ( (type_descriptor TYPE) ) IDENT) + IDENT) + LIT) )))) = LIT) ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT , (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) )))) ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT , (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) , (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) )))) ;) (expression_statement (assignment_expression IDENT = (binary_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) + LIT)) ;) (if_statement if (parenthesized_expression ( (binary_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) != LIT) )) (compound_statement { (do_statement do (compound_statement { (expression_statement (assignment_expression IDENT = (binary_expression IDENT + LIT)) ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT , IDENT )))) ;) (expression_statement (assignment_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) IDENT)) = IDENT) ;) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression (cast_expression ( (type_descriptor TYPE) ) IDENT) + LIT) )))) ;) (expression_statement (assignment_expression IDENT = IDENT) ;) }) while (parenthesized_expression ( (binary_expression IDENT != LIT) )) ;) })) (expression_statement (call_expression IDENT (argument_list ( IDENT ))) ;) (expression_statement (call_expression IDENT (argument_list ( IDENT ))) ;) (return_statement return LIT ;) })))
(function_definition "undefined4 FUN_00066c70(undefined2 *param_1,size_t param_2,int param_3)\n\n{\n  char cVar1;\n  undefined1 uVar2;\n  int iVar3;\n  undefined4 uVar4;\n  undefined4 uVar5;\n  undefined2 *puVar6;\n  int iVar7;\n  \n  if (*(int *)(param_3 + 4) <= (int)(param_2 + 3)) {\n    return 0;\n  }\n  memmove((void *)((int)param_1 + (*(int *)(param_3 + 4) - param_2)),param_1,param_2);\n  *param_1 = 0x200;\n  iVar3 = *(int *)(param_3 + 4) - param_2;\n  if (3 < iVar3) {\n    puVar6 = param_1;\n    do {\n      do {\n        cVar1 = FUN_00065c80();\n        *(char *)(puVar6 + 1) = cVar1;\n      } while (cVar1 == '\0');\n      puVar6 = (undefined2 *)((int)puVar6 + 1);\n      iVar3 = *(int *)(param_3 + 4) - param_2;\n    } while ((2 - (int)param_1) + (int)puVar6 < iVar3 + -1);\n  }\n  *(undefined1 *)((int)param_1 + iVar3 + -1) = 0;\n  uVar4 = FUN_00053bf0(param_1,*(undefined4 *)(param_3 + 4));\n  uVar5 = FUN_000556a0(uVar4,*(undefined4 *)(param_3 + 0xc),*(undefined4 *)(param_3 + 8));\n  iVar3 = *(int *)(param_3 + 4) + -1;\n  if (*(int *)(param_3 + 4) != 0) {\n    do {\n      iVar7 = iVar3 + -1;\n      uVar2 = FUN_00053ee0(uVar5,iVar3);\n      *(undefined1 *)param_1 = uVar2;\n      param_1 = (undefined2 *)((int)param_1 + 1);\n      iVar3 = iVar7;\n    } while (iVar7 != -1);\n  }\n  FUN_00053760(uVar4);\n  FUN_00053760(uVar5);\n  return 1;\n}" (type_identifier "undefined4") (function_declarator "FUN_00066c70(undefined2 *param_1,size_t param_2,int param_3)" (identifier "FUN_00066c70") (parameter_list "(undefined2 *param_1,size_t param_2,int param_3)" (( "(") (parameter_declaration "undefined2 *param_1" (type_identifier "undefined2") (pointer_declarator "*param_1" (* "*") (identifier "param_1"))) (, ",") (parameter_declaration "size_t param_2" (primitive_type "size_t") (identifier "param_2")) (, ",") (parameter_declaration "int param_3" (primitive_type "int") (identifier "param_3")) () ")"))) (compound_statement "{\n  char cVar1;\n  undefined1 uVar2;\n  int iVar3;\n  undefined4 uVar4;\n  undefined4 uVar5;\n  undefined2 *puVar6;\n  int iVar7;\n  \n  if (*(int *)(param_3 + 4) <= (int)(param_2 + 3)) {\n    return 0;\n  }\n  memmove((void *)((int)param_1 + (*(int *)(param_3 + 4) - param_2)),param_1,param_2);\n  *param_1 = 0x200;\n  iVar3 = *(int *)(param_3 + 4) - param_2;\n  if (3 < iVar3) {\n    puVar6 = param_1;\n    do {\n      do {\n        cVar1 = FUN_00065c80();\n        *(char *)(puVar6 + 1) = cVar1;\n      } while (cVar1 == '\0');\n      puVar6 = (undefined2 *)((int)puVar6 + 1);\n      iVar3 = *(int *)(param_3 + 4) - param_2;\n    } while ((2 - (int)param_1) + (int)puVar6 < iVar3 + -1);\n  }\n  *(undefined1 *)((int)param_1 + iVar3 + -1) = 0;\n  uVar4 = FUN_00053bf0(param_1,*(undefined4 *)(param_3 + 4));\n  uVar5 = FUN_000556a0(uVar4,*(undefined4 *)(param_3 + 0xc),*(undefined4 *)(param_3 + 8));\n  iVar3 = *(int *)(param_3 + 4) + -1;\n  if (*(int *)(param_3 + 4) != 0) {\n    do {\n      iVar7 = iVar3 + -1;\n      uVar2 = FUN_00053ee0(uVar5,iVar3);\n      *(undefined1 *)param_1 = uVar2;\n      param_1 = (undefined2 *)((int)param_1 + 1);\n      iVar3 = iVar7;\n    } while (iVar7 != -1);\n  }\n  FUN_00053760(uVar4);\n  FUN_00053760(uVar5);\n  return 1;\n}" ({ "{") (declaration "char cVar1;" (primitive_type "char") (identifier "cVar1") (; ";")) (declaration "undefined1 uVar2;" (type_identifier "undefined1") (identifier "uVar2") (; ";")) (declaration "int iVar3;" (primitive_type "int") (identifier "iVar3") (; ";")) (declaration "undefined4 uVar4;" (type_identifier "undefined4") (identifier "uVar4") (; ";")) (declaration "undefined4 uVar5;" (type_identifier "undefined4") (identifier "uVar5") (; ";")) (declaration "undefined2 *puVar6;" (type_identifier "undefined2") (pointer_declarator "*puVar6" (* "*") (identifier "puVar6")) (; ";")) (declaration "int iVar7;" (primitive_type "int") (identifier "iVar7") (; ";")) (if_statement "if (*(int *)(param_3 + 4) <= (int)(param_2 + 3)) {\n    return 0;\n  }" (if "if") (parenthesized_expression "(*(int *)(param_3 + 4) <= (int)(param_2 + 3))" (( "(") (binary_expression "*(int *)(param_3 + 4) <= (int)(param_2 + 3)" (pointer_expression "*(int *)(param_3 + 4)" (* "*") (cast_expression "(int *)(param_3 + 4)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_3 + 4)" (( "(") (binary_expression "param_3 + 4" (identifier "param_3") (+ "+") (number_literal "4")) () ")")))) (<= "<=") (cast_expression "(int)(param_2 + 3)" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (parenthesized_expression "(param_2 + 3)" (( "(") (binary_expression "param_2 + 3" (identifier "param_2") (+ "+") (number_literal "3")) () ")")))) () ")")) (compound_statement "{\n    return 0;\n  }" ({ "{") (return_statement "return 0;" (return "return") (number_literal "0") (; ";")) (} "}"))) (expression_statement "memmove((void *)((int)param_1 + (*(int *)(param_3 + 4) - param_2)),param_1,param_2);" (call_expression "memmove((void *)((int)param_1 + (*(int *)(param_3 + 4) - param_2)),param_1,param_2)" (identifier "memmove") (argument_list "((void *)((int)param_1 + (*(int *)(param_3 + 4) - param_2)),param_1,param_2)" (( "(") (cast_expression "(void *)((int)param_1 + (*(int *)(param_3 + 4) - param_2))" (( "(") (type_descriptor "void *" (primitive_type "void") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "((int)param_1 + (*(int *)(param_3 + 4) - param_2))" (( "(") (binary_expression "(int)param_1 + (*(int *)(param_3 + 4) - param_2)" (cast_expression "(int)param_1" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (identifier "param_1")) (+ "+") (parenthesized_expression "(*(int *)(param_3 + 4) - param_2)" (( "(") (binary_expression "*(int *)(param_3 + 4) - param_2" (pointer_expression "*(int *)(param_3 + 4)" (* "*") (cast_expression "(int *)(param_3 + 4)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_3 + 4)" (( "(") (binary_expression "param_3 + 4" (identifier "param_3") (+ "+") (number_literal "4")) () ")")))) (- "-") (identifier "param_2")) () ")"))) () ")"))) (, ",") (identifier "param_1") (, ",") (identifier "param_2") () ")"))) (; ";")) (expression_statement "*param_1 = 0x200;" (assignment_expression "*param_1 = 0x200" (pointer_expression "*param_1" (* "*") (identifier "param_1")) (= "=") (number_literal "0x200")) (; ";")) (expression_statement "iVar3 = *(int *)(param_3 + 4) - param_2;" (assignment_expression "iVar3 = *(int *)(param_3 + 4) - param_2" (identifier "iVar3") (= "=") (binary_expression "*(int *)(param_3 + 4) - param_2" (pointer_expression "*(int *)(param_3 + 4)" (* "*") (cast_expression "(int *)(param_3 + 4)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_3 + 4)" (( "(") (binary_expression "param_3 + 4" (identifier "param_3") (+ "+") (number_literal "4")) () ")")))) (- "-") (identifier "param_2"))) (; ";")) (if_statement "if (3 < iVar3) {\n    puVar6 = param_1;\n    do {\n      do {\n        cVar1 = FUN_00065c80();\n        *(char *)(puVar6 + 1) = cVar1;\n      } while (cVar1 == '\0');\n      puVar6 = (undefined2 *)((int)puVar6 + 1);\n      iVar3 = *(int *)(param_3 + 4) - param_2;\n    } while ((2 - (int)param_1) + (int)puVar6 < iVar3 + -1);\n  }" (if "if") (parenthesized_expression "(3 < iVar3)" (( "(") (binary_expression "3 < iVar3" (number_literal "3") (< "<") (identifier "iVar3")) () ")")) (compound_statement "{\n    puVar6 = param_1;\n    do {\n      do {\n        cVar1 = FUN_00065c80();\n        *(char *)(puVar6 + 1) = cVar1;\n      } while (cVar1 == '\0');\n      puVar6 = (undefined2 *)((int)puVar6 + 1);\n      iVar3 = *(int *)(param_3 + 4) - param_2;\n    } while ((2 - (int)param_1) + (int)puVar6 < iVar3 + -1);\n  }" ({ "{") (expression_statement "puVar6 = param_1;" (assignment_expression "puVar6 = param_1" (identifier "puVar6") (= "=") (identifier "param_1")) (; ";")) (do_statement "do {\n      do {\n        cVar1 = FUN_00065c80();\n        *(char *)(puVar6 + 1) = cVar1;\n      } while (cVar1 == '\0');\n      puVar6 = (undefined2 *)((int)puVar6 + 1);\n      iVar3 = *(int *)(param_3 + 4) - param_2;\n    } while ((2 - (int)param_1) + (int)puVar6 < iVar3 + -1);" (do "do") (compound_statement "{\n      do {\n        cVar1 = FUN_00065c80();\n        *(char *)(puVar6 + 1) = cVar1;\n      } while (cVar1 == '\0');\n      puVar6 = (undefined2 *)((int)puVar6 + 1);\n      iVar3 = *(int *)(param_3 + 4) - param_2;\n    }" ({ "{") (do_statement "do {\n        cVar1 = FUN_00065c80();\n        *(char *)(puVar6 + 1) = cVar1;\n      } while (cVar1 == '\0');" (do "do") (compound_statement "{\n        cVar1 = FUN_00065c80();\n        *(char *)(puVar6 + 1) = cVar1;\n      }" ({ "{") (expression_statement "cVar1 = FUN_00065c80();" (assignment_expression "cVar1 = FUN_00065c80()" (identifier "cVar1") (= "=") (call_expression "FUN_00065c80()" (identifier "FUN_00065c80") (argument_list "()" (( "(") () ")")))) (; ";")) (expression_statement "*(char *)(puVar6 + 1) = cVar1;" (assignment_expression "*(char *)(puVar6 + 1) = cVar1" (pointer_expression "*(char *)(puVar6 + 1)" (* "*") (cast_expression "(char *)(puVar6 + 1)" (( "(") (type_descriptor "char *" (primitive_type "char") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(puVar6 + 1)" (( "(") (binary_expression "puVar6 + 1" (identifier "puVar6") (+ "+") (number_literal "1")) () ")")))) (= "=") (identifier "cVar1")) (; ";")) (} "}")) (while "while") (parenthesized_expression "(cVar1 == '\0')" (( "(") (binary_expression "cVar1 == '\0'" (identifier "cVar1") (== "==") (char_literal "'\0'" (' "'") (escape_sequence "\0") (' "'"))) () ")")) (; ";")) (expression_statement "puVar6 = (undefined2 *)((int)puVar6 + 1);" (assignment_expression "puVar6 = (undefined2 *)((int)puVar6 + 1)" (identifier "puVar6") (= "=") (cast_expression "(undefined2 *)((int)puVar6 + 1)" (( "(") (type_descriptor "undefined2 *" (type_identifier "undefined2") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "((int)puVar6 + 1)" (( "(") (binary_expression "(int)puVar6 + 1" (cast_expression "(int)puVar6" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (identifier "puVar6")) (+ "+") (number_literal "1")) () ")")))) (; ";")) (expression_statement "iVar3 = *(int *)(param_3 + 4) - param_2;" (assignment_expression "iVar3 = *(int *)(param_3 + 4) - param_2" (identifier "iVar3") (= "=") (binary_expression "*(int *)(param_3 + 4) - param_2" (pointer_expression "*(int *)(param_3 + 4)" (* "*") (cast_expression "(int *)(param_3 + 4)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_3 + 4)" (( "(") (binary_expression "param_3 + 4" (identifier "param_3") (+ "+") (number_literal "4")) () ")")))) (- "-") (identifier "param_2"))) (; ";")) (} "}")) (while "while") (parenthesized_expression "((2 - (int)param_1) + (int)puVar6 < iVar3 + -1)" (( "(") (binary_expression "(2 - (int)param_1) + (int)puVar6 < iVar3 + -1" (binary_expression "(2 - (int)param_1) + (int)puVar6" (parenthesized_expression "(2 - (int)param_1)" (( "(") (binary_expression "2 - (int)param_1" (number_literal "2") (- "-") (cast_expression "(int)param_1" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (identifier "param_1"))) () ")")) (+ "+") (cast_expression "(int)puVar6" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (identifier "puVar6"))) (< "<") (binary_expression "iVar3 + -1" (identifier "iVar3") (+ "+") (number_literal "-1"))) () ")")) (; ";")) (} "}"))) (expression_statement "*(undefined1 *)((int)param_1 + iVar3 + -1) = 0;" (assignment_expression "*(undefined1 *)((int)param_1 + iVar3 + -1) = 0" (pointer_expression "*(undefined1 *)((int)param_1 + iVar3 + -1)" (* "*") (cast_expression "(undefined1 *)((int)param_1 + iVar3 + -1)" (( "(") (type_descriptor "undefined1 *" (type_identifier "undefined1") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "((int)param_1 + iVar3 + -1)" (( "(") (binary_expression "(int)param_1 + iVar3 + -1" (binary_expression "(int)param_1 + iVar3" (cast_expression "(int)param_1" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (identifier "param_1")) (+ "+") (identifier "iVar3")) (+ "+") (number_literal "-1")) () ")")))) (= "=") (number_literal "0")) (; ";")) (expression_statement "uVar4 = FUN_00053bf0(param_1,*(undefined4 *)(param_3 + 4));" (assignment_expression "uVar4 = FUN_00053bf0(param_1,*(undefined4 *)(param_3 + 4))" (identifier "uVar4") (= "=") (call_expression "FUN_00053bf0(param_1,*(undefined4 *)(param_3 + 4))" (identifier "FUN_00053bf0") (argument_list "(param_1,*(undefined4 *)(param_3 + 4))" (( "(") (identifier "param_1") (, ",") (pointer_expression "*(undefined4 *)(param_3 + 4)" (* "*") (cast_expression "(undefined4 *)(param_3 + 4)" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_3 + 4)" (( "(") (binary_expression "param_3 + 4" (identifier "param_3") (+ "+") (number_literal "4")) () ")")))) () ")")))) (; ";")) (expression_statement "uVar5 = FUN_000556a0(uVar4,*(undefined4 *)(param_3 + 0xc),*(undefined4 *)(param_3 + 8));" (assignment_expression "uVar5 = FUN_000556a0(uVar4,*(undefined4 *)(param_3 + 0xc),*(undefined4 *)(param_3 + 8))" (identifier "uVar5") (= "=") (call_expression "FUN_000556a0(uVar4,*(undefined4 *)(param_3 + 0xc),*(undefined4 *)(param_3 + 8))" (identifier "FUN_000556a0") (argument_list "(uVar4,*(undefined4 *)(param_3 + 0xc),*(undefined4 *)(param_3 + 8))" (( "(") (identifier "uVar4") (, ",") (pointer_expression "*(undefined4 *)(param_3 + 0xc)" (* "*") (cast_expression "(undefined4 *)(param_3 + 0xc)" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_3 + 0xc)" (( "(") (binary_expression "param_3 + 0xc" (identifier "param_3") (+ "+") (number_literal "0xc")) () ")")))) (, ",") (pointer_expression "*(undefined4 *)(param_3 + 8)" (* "*") (cast_expression "(undefined4 *)(param_3 + 8)" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_3 + 8)" (( "(") (binary_expression "param_3 + 8" (identifier "param_3") (+ "+") (number_literal "8")) () ")")))) () ")")))) (; ";")) (expression_statement "iVar3 = *(int *)(param_3 + 4) + -1;" (assignment_expression "iVar3 = *(int *)(param_3 + 4) + -1" (identifier "iVar3") (= "=") (binary_expression "*(int *)(param_3 + 4) + -1" (pointer_expression "*(int *)(param_3 + 4)" (* "*") (cast_expression "(int *)(param_3 + 4)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_3 + 4)" (( "(") (binary_expression "param_3 + 4" (identifier "param_3") (+ "+") (number_literal "4")) () ")")))) (+ "+") (number_literal "-1"))) (; ";")) (if_statement "if (*(int *)(param_3 + 4) != 0) {\n    do {\n      iVar7 = iVar3 + -1;\n      uVar2 = FUN_00053ee0(uVar5,iVar3);\n      *(undefined1 *)param_1 = uVar2;\n      param_1 = (undefined2 *)((int)param_1 + 1);\n      iVar3 = iVar7;\n    } while (iVar7 != -1);\n  }" (if "if") (parenthesized_expression "(*(int *)(param_3 + 4) != 0)" (( "(") (binary_expression "*(int *)(param_3 + 4) != 0" (pointer_expression "*(int *)(param_3 + 4)" (* "*") (cast_expression "(int *)(param_3 + 4)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_3 + 4)" (( "(") (binary_expression "param_3 + 4" (identifier "param_3") (+ "+") (number_literal "4")) () ")")))) (!= "!=") (number_literal "0")) () ")")) (compound_statement "{\n    do {\n      iVar7 = iVar3 + -1;\n      uVar2 = FUN_00053ee0(uVar5,iVar3);\n      *(undefined1 *)param_1 = uVar2;\n      param_1 = (undefined2 *)((int)param_1 + 1);\n      iVar3 = iVar7;\n    } while (iVar7 != -1);\n  }" ({ "{") (do_statement "do {\n      iVar7 = iVar3 + -1;\n      uVar2 = FUN_00053ee0(uVar5,iVar3);\n      *(undefined1 *)param_1 = uVar2;\n      param_1 = (undefined2 *)((int)param_1 + 1);\n      iVar3 = iVar7;\n    } while (iVar7 != -1);" (do "do") (compound_statement "{\n      iVar7 = iVar3 + -1;\n      uVar2 = FUN_00053ee0(uVar5,iVar3);\n      *(undefined1 *)param_1 = uVar2;\n      param_1 = (undefined2 *)((int)param_1 + 1);\n      iVar3 = iVar7;\n    }" ({ "{") (expression_statement "iVar7 = iVar3 + -1;" (assignment_expression "iVar7 = iVar3 + -1" (identifier "iVar7") (= "=") (binary_expression "iVar3 + -1" (identifier "iVar3") (+ "+") (number_literal "-1"))) (; ";")) (expression_statement "uVar2 = FUN_00053ee0(uVar5,iVar3);" (assignment_expression "uVar2 = FUN_00053ee0(uVar5,iVar3)" (identifier "uVar2") (= "=") (call_expression "FUN_00053ee0(uVar5,iVar3)" (identifier "FUN_00053ee0") (argument_list "(uVar5,iVar3)" (( "(") (identifier "uVar5") (, ",") (identifier "iVar3") () ")")))) (; ";")) (expression_statement "*(undefined1 *)param_1 = uVar2;" (assignment_expression "*(undefined1 *)param_1 = uVar2" (pointer_expression "*(undefined1 *)param_1" (* "*") (cast_expression "(undefined1 *)param_1" (( "(") (type_descriptor "undefined1 *" (type_identifier "undefined1") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "param_1"))) (= "=") (identifier "uVar2")) (; ";")) (expression_statement "param_1 = (undefined2 *)((int)param_1 + 1);" (assignment_expression "param_1 = (undefined2 *)((int)param_1 + 1)" (identifier "param_1") (= "=") (cast_expression "(undefined2 *)((int)param_1 + 1)" (( "(") (type_descriptor "undefined2 *" (type_identifier "undefined2") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "((int)param_1 + 1)" (( "(") (binary_expression "(int)param_1 + 1" (cast_expression "(int)param_1" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (identifier "param_1")) (+ "+") (number_literal "1")) () ")")))) (; ";")) (expression_statement "iVar3 = iVar7;" (assignment_expression "iVar3 = iVar7" (identifier "iVar3") (= "=") (identifier "iVar7")) (; ";")) (} "}")) (while "while") (parenthesized_expression "(iVar7 != -1)" (( "(") (binary_expression "iVar7 != -1" (identifier "iVar7") (!= "!=") (number_literal "-1")) () ")")) (; ";")) (} "}"))) (expression_statement "FUN_00053760(uVar4);" (call_expression "FUN_00053760(uVar4)" (identifier "FUN_00053760") (argument_list "(uVar4)" (( "(") (identifier "uVar4") () ")"))) (; ";")) (expression_statement "FUN_00053760(uVar5);" (call_expression "FUN_00053760(uVar5)" (identifier "FUN_00053760") (argument_list "(uVar5)" (( "(") (identifier "uVar5") () ")"))) (; ";")) (return_statement "return 1;" (return "return") (number_literal "1") (; ";")) (} "}")))

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

int function_1(type_1 *var_3,int var_1,type_2 *key)

{
  int var_4;
  type_3 base_in;
  type_3 bn;
  type_1 *var_6;
  int var_10;
  
  if (key->bytes <= var_1 + 3) {
    return 0;
  }
  var_2(var_3 + (key->bytes - var_1),var_3,var_1);
  var_3[0] = '\0';
  var_3[1] = '\x02';
  var_4 = key->bytes - var_1;
  if (3 < var_4) {
    var_6 = var_3;
    do {
      do {
        var_4 = var_5();
        var_6[2] = (type_1)var_4;
      } while ((type_1)var_4 == '\0');
      var_6 = var_6 + 1;
      var_4 = key->bytes - var_1;
    } while ((int)(var_6 + (2 - (int)var_3)) < var_4 + -1);
  }
  var_3[var_4 + -1] = '\0';
  base_in = var_7(var_3,key->bytes);
  bn = var_8(base_in,(type_3)key->exponent,(type_3)key->modulus);
  var_4 = key->bytes + -1;
  if (key->bytes != 0) {
    do {
      var_10 = var_4 + -1;
      var_4 = var_9(bn,var_4);
      *var_3 = (type_1)var_4;
      var_3 = var_3 + 1;
      var_4 = var_10;
    } while (var_10 != -1);
  }
  var_11(base_in);
  var_11(bn);
  return 1;
}


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

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

undefined4 MASKED(undefined2 *param_1,size_t param_2,int param_3)

{
  char cVar1;
  undefined1 uVar2;
  int iVar3;
  undefined4 uVar4;
  undefined4 uVar5;
  undefined2 *puVar6;
  int iVar7;
  
  if (*(int *)(param_3 + 4) <= (int)(param_2 + 3)) {
    return 0;
  }
  memmove((void *)((int)param_1 + (*(int *)(param_3 + 4) - param_2)),param_1,param_2);
  *param_1 = 0x200;
  iVar3 = *(int *)(param_3 + 4) - param_2;
  if (3 < iVar3) {
    puVar6 = param_1;
    do {
      do {
        cVar1 = FUN_00065c80();
        *(char *)(puVar6 + 1) = cVar1;
      } while (cVar1 == '\0');
      puVar6 = (undefined2 *)((int)puVar6 + 1);
      iVar3 = *(int *)(param_3 + 4) - param_2;
    } while ((2 - (int)param_1) + (int)puVar6 < iVar3 + -1);
  }
  *(undefined1 *)((int)param_1 + iVar3 + -1) = 0;
  uVar4 = FUN_00053bf0(param_1,*(undefined4 *)(param_3 + 4));
  uVar5 = FUN_000556a0(uVar4,*(undefined4 *)(param_3 + 0xc),*(undefined4 *)(param_3 + 8));
  iVar3 = *(int *)(param_3 + 4) + -1;
  if (*(int *)(param_3 + 4) != 0) {
    do {
      iVar7 = iVar3 + -1;
      uVar2 = FUN_00053ee0(uVar5,iVar3);
      *(undefined1 *)param_1 = uVar2;
      param_1 = (undefined2 *)((int)param_1 + 1);
      iVar3 = iVar7;
    } while (iVar7 != -1);
  }
  FUN_00053760(uVar4);
  FUN_00053760(uVar5);
  return 1;
}

