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

void prompt_set_result(prompt_t *pr,char *newstr)

{
  int iVar1;
  char cVar2;
  int iVar3;
  size_t sVar4;
  int iVar5;
  size_t __size;
  char *__dest;
  size_t __n;
  char *__src;
  int in_GS_OFFSET;
  char str [200];
  
  iVar1 = *(int *)(in_GS_OFFSET + 0x14);
  sVar4 = strlen(newstr);
  __n = pr->resultsize;
  if ((int)(sVar4 + 1) <= (int)__n) {
    __dest = pr->result;
    goto LAB_0001ec78;
  }
  iVar3 = (sVar4 + 1) * 5;
  iVar5 = iVar3 + 3;
  if (-1 < iVar3) {
    iVar5 = iVar3;
  }
  sVar4 = (iVar5 >> 2) + 0x200;
  if ((int)sVar4 < 0) {
LAB_0001ed30:
    builtin_strncpy(str,"Out of memory!",0xf);
    modalfatalbox("%s",str);
    __n = pr->resultsize;
    __dest = (char *)0x0;
  }
  else {
    __size = 1;
    if (sVar4 != 0) {
      __size = sVar4;
    }
    __dest = (char *)malloc(__size);
    if (__dest == (char *)0x0) goto LAB_0001ed30;
  }
  __src = pr->result;
  memcpy(__dest,__src,__n);
  if (__n != 0) {
    memset(__src,0,__n);
    cVar2 = *__src;
    while (cVar2 != '\0') {
      __src = __src + 1;
      cVar2 = *__src;
    }
    __src = pr->result;
    if (__src == (char *)0x0) {
      pr->result = __dest;
      pr->resultsize = sVar4;
      goto LAB_0001ec78;
    }
  }
  free(__src);
  pr->result = __dest;
  pr->resultsize = sVar4;
LAB_0001ec78:
  strcpy(__dest,newstr);
  if (iVar1 == *(int *)(in_GS_OFFSET + 0x14)) {
    return;
  }
                    /* WARNING: Subroutine does not return */
  __stack_chk_fail_local();
}



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

void FUN_0001ec30(int param_1,char *param_2)

{
  char cVar1;
  int iVar2;
  size_t sVar3;
  int iVar4;
  size_t __size;
  char *__dest;
  size_t __n;
  char *__src;
  int in_GS_OFFSET;
  undefined4 local_e8;
  undefined4 local_e4;
  undefined4 local_e0;
  undefined2 local_dc;
  undefined1 local_da;
  int local_20;
  undefined4 uStack_14;
  
  uStack_14 = 0x1ec39;
  local_20 = *(int *)(in_GS_OFFSET + 0x14);
  sVar3 = strlen(param_2);
  __n = *(size_t *)(param_1 + 0xc);
  if ((int)(sVar3 + 1) <= (int)__n) {
    __dest = *(char **)(param_1 + 8);
    goto LAB_0001ec78;
  }
  iVar2 = (sVar3 + 1) * 5;
  iVar4 = iVar2 + 3;
  if (-1 < iVar2) {
    iVar4 = iVar2;
  }
  sVar3 = (iVar4 >> 2) + 0x200;
  if ((int)sVar3 < 0) {
LAB_0001ed30:
    local_e8 = 0x2074754f;
    local_dc = 0x2179;
    local_e4 = 0x6d20666f;
    local_e0 = 0x726f6d65;
    local_da = 0;
    FUN_000812d0("%s",&local_e8);
    __n = *(size_t *)(param_1 + 0xc);
    __dest = (char *)0x0;
  }
  else {
    __size = 1;
    if (sVar3 != 0) {
      __size = sVar3;
    }
    __dest = (char *)malloc(__size);
    if (__dest == (char *)0x0) goto LAB_0001ed30;
  }
  __src = *(char **)(param_1 + 8);
  memcpy(__dest,__src,__n);
  if (__n != 0) {
    memset(__src,0,__n);
    cVar1 = *__src;
    while (cVar1 != '\0') {
      __src = __src + 1;
      cVar1 = *__src;
    }
    __src = *(char **)(param_1 + 8);
    if (__src == (char *)0x0) {
      *(char **)(param_1 + 8) = __dest;
      *(size_t *)(param_1 + 0xc) = sVar3;
      goto LAB_0001ec78;
    }
  }
  free(__src);
  *(char **)(param_1 + 8) = __dest;
  *(size_t *)(param_1 + 0xc) = sVar3;
LAB_0001ec78:
  strcpy(__dest,param_2);
  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {
    return;
  }
                    /* WARNING: Subroutine does not return */
  FUN_00089270();
}


PUSH EBP
PUSH EDI
PUSH ESI
PUSH EBX
CALL 0x00015ff0
ADD EBX,0xa8137
SUB ESP,0xf8
MOV EAX,GS:[0x14]
MOV dword ptr [ESP + 0xe8],EAX
XOR EAX,EAX
MOV EBP,dword ptr [ESP + 0x110]
MOV EDI,dword ptr [ESP + 0x10c]
PUSH EBP
CALL 0x00014440
MOV ECX,dword ptr [EDI + 0xc]
ADD ESP,0x10
ADD EAX,0x1
CMP EAX,ECX
JG 0x0001eca8
MOV EDX,dword ptr [EDI + 0x8]
SUB ESP,0x8
PUSH EBP
PUSH EDX
CALL 0x000142f0
ADD ESP,0x10
MOV EAX,dword ptr [ESP + 0xdc]
XOR EAX,dword ptr GS:[0x14]
JNZ 0x0001edc4
ADD ESP,0xec
POP EBX
POP ESI
POP EDI
POP EBP
RET
LEA EDX,[EAX + EAX*0x4]
TEST EDX,EDX
LEA EAX,[EDX + 0x3]
CMOVNS EAX,EDX
SAR EAX,0x2
ADD EAX,0x200
MOV dword ptr [ESP + 0x4],EAX
JS 0x0001ed30
MOV EAX,0x1
CMOVNZ EAX,dword ptr [ESP + 0x4]
MOV dword ptr [ESP + 0x8],ECX
SUB ESP,0xc
PUSH EAX
CALL 0x00014360
ADD ESP,0x10
MOV ECX,dword ptr [ESP + 0x8]
TEST EAX,EAX
MOV EDX,EAX
JZ 0x0001ed30
SUB ESP,0x4
MOV ESI,dword ptr [EDI + 0x8]
PUSH ECX
MOV dword ptr [ESP + 0x14],ECX
PUSH ESI
PUSH EDX
MOV dword ptr [ESP + 0x18],EDX
CALL 0x00014140
ADD ESP,0x10
MOV ECX,dword ptr [ESP + 0xc]
MOV EDX,dword ptr [ESP + 0x8]
TEST ECX,ECX
JNZ 0x0001ed80
MOV dword ptr [ESP + 0x8],EDX
SUB ESP,0xc
PUSH ESI
CALL 0x00014130
ADD ESP,0x10
MOV EDX,dword ptr [ESP + 0x8]
MOV EAX,dword ptr [ESP + 0x4]
MOV dword ptr [EDI + 0x8],EDX
MOV dword ptr [EDI + 0xc],EAX
JMP 0x0001ec78
MOV EDX,0x2179
MOV dword ptr [ESP + 0x14],0x2074754f
LEA EAX,[ESP + 0x14]
SUB ESP,0x8
MOV word ptr [ESP + 0x28],DX
MOV dword ptr [ESP + 0x20],0x6d20666f
MOV dword ptr [ESP + 0x24],0x726f6d65
MOV byte ptr [ESP + 0x2a],0x0
PUSH EAX
LEA EAX,[EBX + 0xfffd29a9]
PUSH EAX
CALL 0x000812d0
MOV ECX,dword ptr [EDI + 0xc]
ADD ESP,0x10
XOR EDX,EDX
JMP 0x0001ece5
SUB ESP,0x4
PUSH ECX
PUSH 0x0
PUSH ESI
CALL 0x000144f0
MOVZX EAX,byte ptr [ESI]
ADD ESP,0x10
MOV EDX,dword ptr [ESP + 0x8]
TEST AL,AL
JZ 0x0001edaa
LEA ESI,[ESI]
ADD ESI,0x1
MOVZX EAX,byte ptr [ESI]
TEST AL,AL
JNZ 0x0001eda0
MOV ESI,dword ptr [EDI + 0x8]
TEST ESI,ESI
JNZ 0x0001ed0a
MOV EAX,dword ptr [ESP + 0x4]
MOV dword ptr [EDI + 0x8],EDX
MOV dword ptr [EDI + 0xc],EAX
JMP 0x0001ec78
CALL 0x00089270
(translation_unit "/* WARNING: Function: __i686.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n\nvoid FUN_0001ec30(int param_1,char *param_2)\n\n{\n  char cVar1;\n  int iVar2;\n  size_t sVar3;\n  int iVar4;\n  size_t __size;\n  char *__dest;\n  size_t __n;\n  char *__src;\n  int in_GS_OFFSET;\n  undefined4 local_e8;\n  undefined4 local_e4;\n  undefined4 local_e0;\n  undefined2 local_dc;\n  undefined1 local_da;\n  int local_20;\n  undefined4 uStack_14;\n  \n  uStack_14 = 0x1ec39;\n  local_20 = *(int *)(in_GS_OFFSET + 0x14);\n  sVar3 = strlen(param_2);\n  __n = *(size_t *)(param_1 + 0xc);\n  if ((int)(sVar3 + 1) <= (int)__n) {\n    __dest = *(char **)(param_1 + 8);\n    goto LAB_0001ec78;\n  }\n  iVar2 = (sVar3 + 1) * 5;\n  iVar4 = iVar2 + 3;\n  if (-1 < iVar2) {\n    iVar4 = iVar2;\n  }\n  sVar3 = (iVar4 >> 2) + 0x200;\n  if ((int)sVar3 < 0) {\nLAB_0001ed30:\n    local_e8 = 0x2074754f;\n    local_dc = 0x2179;\n    local_e4 = 0x6d20666f;\n    local_e0 = 0x726f6d65;\n    local_da = 0;\n    FUN_000812d0("%s",&local_e8);\n    __n = *(size_t *)(param_1 + 0xc);\n    __dest = (char *)0x0;\n  }\n  else {\n    __size = 1;\n    if (sVar3 != 0) {\n      __size = sVar3;\n    }\n    __dest = (char *)malloc(__size);\n    if (__dest == (char *)0x0) goto LAB_0001ed30;\n  }\n  __src = *(char **)(param_1 + 8);\n  memcpy(__dest,__src,__n);\n  if (__n != 0) {\n    memset(__src,0,__n);\n    cVar1 = *__src;\n    while (cVar1 != '\0') {\n      __src = __src + 1;\n      cVar1 = *__src;\n    }\n    __src = *(char **)(param_1 + 8);\n    if (__src == (char *)0x0) {\n      *(char **)(param_1 + 8) = __dest;\n      *(size_t *)(param_1 + 0xc) = sVar3;\n      goto LAB_0001ec78;\n    }\n  }\n  free(__src);\n  *(char **)(param_1 + 8) = __dest;\n  *(size_t *)(param_1 + 0xc) = sVar3;\nLAB_0001ec78:\n  strcpy(__dest,param_2);\n  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return;\n  }\n                    /* WARNING: Subroutine does not return */\n  FUN_00089270();\n}\n\n" comment (function_definition "void FUN_0001ec30(int param_1,char *param_2)\n\n{\n  char cVar1;\n  int iVar2;\n  size_t sVar3;\n  int iVar4;\n  size_t __size;\n  char *__dest;\n  size_t __n;\n  char *__src;\n  int in_GS_OFFSET;\n  undefined4 local_e8;\n  undefined4 local_e4;\n  undefined4 local_e0;\n  undefined2 local_dc;\n  undefined1 local_da;\n  int local_20;\n  undefined4 uStack_14;\n  \n  uStack_14 = 0x1ec39;\n  local_20 = *(int *)(in_GS_OFFSET + 0x14);\n  sVar3 = strlen(param_2);\n  __n = *(size_t *)(param_1 + 0xc);\n  if ((int)(sVar3 + 1) <= (int)__n) {\n    __dest = *(char **)(param_1 + 8);\n    goto LAB_0001ec78;\n  }\n  iVar2 = (sVar3 + 1) * 5;\n  iVar4 = iVar2 + 3;\n  if (-1 < iVar2) {\n    iVar4 = iVar2;\n  }\n  sVar3 = (iVar4 >> 2) + 0x200;\n  if ((int)sVar3 < 0) {\nLAB_0001ed30:\n    local_e8 = 0x2074754f;\n    local_dc = 0x2179;\n    local_e4 = 0x6d20666f;\n    local_e0 = 0x726f6d65;\n    local_da = 0;\n    FUN_000812d0("%s",&local_e8);\n    __n = *(size_t *)(param_1 + 0xc);\n    __dest = (char *)0x0;\n  }\n  else {\n    __size = 1;\n    if (sVar3 != 0) {\n      __size = sVar3;\n    }\n    __dest = (char *)malloc(__size);\n    if (__dest == (char *)0x0) goto LAB_0001ed30;\n  }\n  __src = *(char **)(param_1 + 8);\n  memcpy(__dest,__src,__n);\n  if (__n != 0) {\n    memset(__src,0,__n);\n    cVar1 = *__src;\n    while (cVar1 != '\0') {\n      __src = __src + 1;\n      cVar1 = *__src;\n    }\n    __src = *(char **)(param_1 + 8);\n    if (__src == (char *)0x0) {\n      *(char **)(param_1 + 8) = __dest;\n      *(size_t *)(param_1 + 0xc) = sVar3;\n      goto LAB_0001ec78;\n    }\n  }\n  free(__src);\n  *(char **)(param_1 + 8) = __dest;\n  *(size_t *)(param_1 + 0xc) = sVar3;\nLAB_0001ec78:\n  strcpy(__dest,param_2);\n  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return;\n  }\n                    /* WARNING: Subroutine does not return */\n  FUN_00089270();\n}" primitive_type (function_declarator "FUN_0001ec30(int param_1,char *param_2)" identifier (parameter_list "(int param_1,char *param_2)" ( (parameter_declaration "int param_1" primitive_type identifier) , (parameter_declaration "char *param_2" primitive_type (pointer_declarator "*param_2" * identifier)) ))) (compound_statement "{\n  char cVar1;\n  int iVar2;\n  size_t sVar3;\n  int iVar4;\n  size_t __size;\n  char *__dest;\n  size_t __n;\n  char *__src;\n  int in_GS_OFFSET;\n  undefined4 local_e8;\n  undefined4 local_e4;\n  undefined4 local_e0;\n  undefined2 local_dc;\n  undefined1 local_da;\n  int local_20;\n  undefined4 uStack_14;\n  \n  uStack_14 = 0x1ec39;\n  local_20 = *(int *)(in_GS_OFFSET + 0x14);\n  sVar3 = strlen(param_2);\n  __n = *(size_t *)(param_1 + 0xc);\n  if ((int)(sVar3 + 1) <= (int)__n) {\n    __dest = *(char **)(param_1 + 8);\n    goto LAB_0001ec78;\n  }\n  iVar2 = (sVar3 + 1) * 5;\n  iVar4 = iVar2 + 3;\n  if (-1 < iVar2) {\n    iVar4 = iVar2;\n  }\n  sVar3 = (iVar4 >> 2) + 0x200;\n  if ((int)sVar3 < 0) {\nLAB_0001ed30:\n    local_e8 = 0x2074754f;\n    local_dc = 0x2179;\n    local_e4 = 0x6d20666f;\n    local_e0 = 0x726f6d65;\n    local_da = 0;\n    FUN_000812d0("%s",&local_e8);\n    __n = *(size_t *)(param_1 + 0xc);\n    __dest = (char *)0x0;\n  }\n  else {\n    __size = 1;\n    if (sVar3 != 0) {\n      __size = sVar3;\n    }\n    __dest = (char *)malloc(__size);\n    if (__dest == (char *)0x0) goto LAB_0001ed30;\n  }\n  __src = *(char **)(param_1 + 8);\n  memcpy(__dest,__src,__n);\n  if (__n != 0) {\n    memset(__src,0,__n);\n    cVar1 = *__src;\n    while (cVar1 != '\0') {\n      __src = __src + 1;\n      cVar1 = *__src;\n    }\n    __src = *(char **)(param_1 + 8);\n    if (__src == (char *)0x0) {\n      *(char **)(param_1 + 8) = __dest;\n      *(size_t *)(param_1 + 0xc) = sVar3;\n      goto LAB_0001ec78;\n    }\n  }\n  free(__src);\n  *(char **)(param_1 + 8) = __dest;\n  *(size_t *)(param_1 + 0xc) = sVar3;\nLAB_0001ec78:\n  strcpy(__dest,param_2);\n  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return;\n  }\n                    /* WARNING: Subroutine does not return */\n  FUN_00089270();\n}" { (declaration "char cVar1;" primitive_type identifier ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "size_t sVar3;" primitive_type identifier ;) (declaration "int iVar4;" primitive_type identifier ;) (declaration "size_t __size;" primitive_type identifier ;) (declaration "char *__dest;" primitive_type (pointer_declarator "*__dest" * identifier) ;) (declaration "size_t __n;" primitive_type identifier ;) (declaration "char *__src;" primitive_type (pointer_declarator "*__src" * identifier) ;) (declaration "int in_GS_OFFSET;" primitive_type identifier ;) (declaration "undefined4 local_e8;" type_identifier identifier ;) (declaration "undefined4 local_e4;" type_identifier identifier ;) (declaration "undefined4 local_e0;" type_identifier identifier ;) (declaration "undefined2 local_dc;" type_identifier identifier ;) (declaration "undefined1 local_da;" type_identifier identifier ;) (declaration "int local_20;" primitive_type identifier ;) (declaration "undefined4 uStack_14;" type_identifier identifier ;) (expression_statement "uStack_14 = 0x1ec39;" (assignment_expression "uStack_14 = 0x1ec39" identifier = number_literal) ;) (expression_statement "local_20 = *(int *)(in_GS_OFFSET + 0x14);" (assignment_expression "local_20 = *(int *)(in_GS_OFFSET + 0x14)" identifier = (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" * (cast_expression "(int *)(in_GS_OFFSET + 0x14)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_GS_OFFSET + 0x14)" ( (binary_expression "in_GS_OFFSET + 0x14" identifier + number_literal) ))))) ;) (expression_statement "sVar3 = strlen(param_2);" (assignment_expression "sVar3 = strlen(param_2)" identifier = (call_expression "strlen(param_2)" identifier (argument_list "(param_2)" ( identifier )))) ;) (expression_statement "__n = *(size_t *)(param_1 + 0xc);" (assignment_expression "__n = *(size_t *)(param_1 + 0xc)" identifier = (pointer_expression "*(size_t *)(param_1 + 0xc)" * (cast_expression "(size_t *)(param_1 + 0xc)" ( (type_descriptor "size_t *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0xc)" ( (binary_expression "param_1 + 0xc" identifier + number_literal) ))))) ;) (if_statement "if ((int)(sVar3 + 1) <= (int)__n) {\n    __dest = *(char **)(param_1 + 8);\n    goto LAB_0001ec78;\n  }" if (parenthesized_expression "((int)(sVar3 + 1) <= (int)__n)" ( (binary_expression "(int)(sVar3 + 1) <= (int)__n" (cast_expression "(int)(sVar3 + 1)" ( (type_descriptor "int" primitive_type) ) (parenthesized_expression "(sVar3 + 1)" ( (binary_expression "sVar3 + 1" identifier + number_literal) ))) <= (cast_expression "(int)__n" ( (type_descriptor "int" primitive_type) ) identifier)) )) (compound_statement "{\n    __dest = *(char **)(param_1 + 8);\n    goto LAB_0001ec78;\n  }" { (expression_statement "__dest = *(char **)(param_1 + 8);" (assignment_expression "__dest = *(char **)(param_1 + 8)" identifier = (pointer_expression "*(char **)(param_1 + 8)" * (cast_expression "(char **)(param_1 + 8)" ( (type_descriptor "char **" primitive_type (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(param_1 + 8)" ( (binary_expression "param_1 + 8" identifier + number_literal) ))))) ;) (goto_statement "goto LAB_0001ec78;" goto statement_identifier ;) })) (expression_statement "iVar2 = (sVar3 + 1) * 5;" (assignment_expression "iVar2 = (sVar3 + 1) * 5" identifier = (binary_expression "(sVar3 + 1) * 5" (parenthesized_expression "(sVar3 + 1)" ( (binary_expression "sVar3 + 1" identifier + number_literal) )) * number_literal)) ;) (expression_statement "iVar4 = iVar2 + 3;" (assignment_expression "iVar4 = iVar2 + 3" identifier = (binary_expression "iVar2 + 3" identifier + number_literal)) ;) (if_statement "if (-1 < iVar2) {\n    iVar4 = iVar2;\n  }" if (parenthesized_expression "(-1 < iVar2)" ( (binary_expression "-1 < iVar2" number_literal < identifier) )) (compound_statement "{\n    iVar4 = iVar2;\n  }" { (expression_statement "iVar4 = iVar2;" (assignment_expression "iVar4 = iVar2" identifier = identifier) ;) })) (expression_statement "sVar3 = (iVar4 >> 2) + 0x200;" (assignment_expression "sVar3 = (iVar4 >> 2) + 0x200" identifier = (binary_expression "(iVar4 >> 2) + 0x200" (parenthesized_expression "(iVar4 >> 2)" ( (binary_expression "iVar4 >> 2" identifier >> number_literal) )) + number_literal)) ;) (if_statement "if ((int)sVar3 < 0) {\nLAB_0001ed30:\n    local_e8 = 0x2074754f;\n    local_dc = 0x2179;\n    local_e4 = 0x6d20666f;\n    local_e0 = 0x726f6d65;\n    local_da = 0;\n    FUN_000812d0("%s",&local_e8);\n    __n = *(size_t *)(param_1 + 0xc);\n    __dest = (char *)0x0;\n  }\n  else {\n    __size = 1;\n    if (sVar3 != 0) {\n      __size = sVar3;\n    }\n    __dest = (char *)malloc(__size);\n    if (__dest == (char *)0x0) goto LAB_0001ed30;\n  }" if (parenthesized_expression "((int)sVar3 < 0)" ( (binary_expression "(int)sVar3 < 0" (cast_expression "(int)sVar3" ( (type_descriptor "int" primitive_type) ) identifier) < number_literal) )) (compound_statement "{\nLAB_0001ed30:\n    local_e8 = 0x2074754f;\n    local_dc = 0x2179;\n    local_e4 = 0x6d20666f;\n    local_e0 = 0x726f6d65;\n    local_da = 0;\n    FUN_000812d0("%s",&local_e8);\n    __n = *(size_t *)(param_1 + 0xc);\n    __dest = (char *)0x0;\n  }" { (labeled_statement "LAB_0001ed30:\n    local_e8 = 0x2074754f;" statement_identifier : (expression_statement "local_e8 = 0x2074754f;" (assignment_expression "local_e8 = 0x2074754f" identifier = number_literal) ;)) (expression_statement "local_dc = 0x2179;" (assignment_expression "local_dc = 0x2179" identifier = number_literal) ;) (expression_statement "local_e4 = 0x6d20666f;" (assignment_expression "local_e4 = 0x6d20666f" identifier = number_literal) ;) (expression_statement "local_e0 = 0x726f6d65;" (assignment_expression "local_e0 = 0x726f6d65" identifier = number_literal) ;) (expression_statement "local_da = 0;" (assignment_expression "local_da = 0" identifier = number_literal) ;) (expression_statement "FUN_000812d0("%s",&local_e8);" (call_expression "FUN_000812d0("%s",&local_e8)" identifier (argument_list "("%s",&local_e8)" ( (string_literal ""%s"" " string_content ") , (pointer_expression "&local_e8" & identifier) ))) ;) (expression_statement "__n = *(size_t *)(param_1 + 0xc);" (assignment_expression "__n = *(size_t *)(param_1 + 0xc)" identifier = (pointer_expression "*(size_t *)(param_1 + 0xc)" * (cast_expression "(size_t *)(param_1 + 0xc)" ( (type_descriptor "size_t *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0xc)" ( (binary_expression "param_1 + 0xc" identifier + number_literal) ))))) ;) (expression_statement "__dest = (char *)0x0;" (assignment_expression "__dest = (char *)0x0" identifier = (cast_expression "(char *)0x0" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) ;) }) (else_clause "else {\n    __size = 1;\n    if (sVar3 != 0) {\n      __size = sVar3;\n    }\n    __dest = (char *)malloc(__size);\n    if (__dest == (char *)0x0) goto LAB_0001ed30;\n  }" else (compound_statement "{\n    __size = 1;\n    if (sVar3 != 0) {\n      __size = sVar3;\n    }\n    __dest = (char *)malloc(__size);\n    if (__dest == (char *)0x0) goto LAB_0001ed30;\n  }" { (expression_statement "__size = 1;" (assignment_expression "__size = 1" identifier = number_literal) ;) (if_statement "if (sVar3 != 0) {\n      __size = sVar3;\n    }" if (parenthesized_expression "(sVar3 != 0)" ( (binary_expression "sVar3 != 0" identifier != number_literal) )) (compound_statement "{\n      __size = sVar3;\n    }" { (expression_statement "__size = sVar3;" (assignment_expression "__size = sVar3" identifier = identifier) ;) })) (expression_statement "__dest = (char *)malloc(__size);" (assignment_expression "__dest = (char *)malloc(__size)" identifier = (cast_expression "(char *)malloc(__size)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "malloc(__size)" identifier (argument_list "(__size)" ( identifier ))))) ;) (if_statement "if (__dest == (char *)0x0) goto LAB_0001ed30;" if (parenthesized_expression "(__dest == (char *)0x0)" ( (binary_expression "__dest == (char *)0x0" identifier == (cast_expression "(char *)0x0" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) )) (goto_statement "goto LAB_0001ed30;" goto statement_identifier ;)) }))) (expression_statement "__src = *(char **)(param_1 + 8);" (assignment_expression "__src = *(char **)(param_1 + 8)" identifier = (pointer_expression "*(char **)(param_1 + 8)" * (cast_expression "(char **)(param_1 + 8)" ( (type_descriptor "char **" primitive_type (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(param_1 + 8)" ( (binary_expression "param_1 + 8" identifier + number_literal) ))))) ;) (expression_statement "memcpy(__dest,__src,__n);" (call_expression "memcpy(__dest,__src,__n)" identifier (argument_list "(__dest,__src,__n)" ( identifier , identifier , identifier ))) ;) (if_statement "if (__n != 0) {\n    memset(__src,0,__n);\n    cVar1 = *__src;\n    while (cVar1 != '\0') {\n      __src = __src + 1;\n      cVar1 = *__src;\n    }\n    __src = *(char **)(param_1 + 8);\n    if (__src == (char *)0x0) {\n      *(char **)(param_1 + 8) = __dest;\n      *(size_t *)(param_1 + 0xc) = sVar3;\n      goto LAB_0001ec78;\n    }\n  }" if (parenthesized_expression "(__n != 0)" ( (binary_expression "__n != 0" identifier != number_literal) )) (compound_statement "{\n    memset(__src,0,__n);\n    cVar1 = *__src;\n    while (cVar1 != '\0') {\n      __src = __src + 1;\n      cVar1 = *__src;\n    }\n    __src = *(char **)(param_1 + 8);\n    if (__src == (char *)0x0) {\n      *(char **)(param_1 + 8) = __dest;\n      *(size_t *)(param_1 + 0xc) = sVar3;\n      goto LAB_0001ec78;\n    }\n  }" { (expression_statement "memset(__src,0,__n);" (call_expression "memset(__src,0,__n)" identifier (argument_list "(__src,0,__n)" ( identifier , number_literal , identifier ))) ;) (expression_statement "cVar1 = *__src;" (assignment_expression "cVar1 = *__src" identifier = (pointer_expression "*__src" * identifier)) ;) (while_statement "while (cVar1 != '\0') {\n      __src = __src + 1;\n      cVar1 = *__src;\n    }" while (parenthesized_expression "(cVar1 != '\0')" ( (binary_expression "cVar1 != '\0'" identifier != (char_literal "'\0'" ' escape_sequence ')) )) (compound_statement "{\n      __src = __src + 1;\n      cVar1 = *__src;\n    }" { (expression_statement "__src = __src + 1;" (assignment_expression "__src = __src + 1" identifier = (binary_expression "__src + 1" identifier + number_literal)) ;) (expression_statement "cVar1 = *__src;" (assignment_expression "cVar1 = *__src" identifier = (pointer_expression "*__src" * identifier)) ;) })) (expression_statement "__src = *(char **)(param_1 + 8);" (assignment_expression "__src = *(char **)(param_1 + 8)" identifier = (pointer_expression "*(char **)(param_1 + 8)" * (cast_expression "(char **)(param_1 + 8)" ( (type_descriptor "char **" primitive_type (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(param_1 + 8)" ( (binary_expression "param_1 + 8" identifier + number_literal) ))))) ;) (if_statement "if (__src == (char *)0x0) {\n      *(char **)(param_1 + 8) = __dest;\n      *(size_t *)(param_1 + 0xc) = sVar3;\n      goto LAB_0001ec78;\n    }" if (parenthesized_expression "(__src == (char *)0x0)" ( (binary_expression "__src == (char *)0x0" identifier == (cast_expression "(char *)0x0" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n      *(char **)(param_1 + 8) = __dest;\n      *(size_t *)(param_1 + 0xc) = sVar3;\n      goto LAB_0001ec78;\n    }" { (expression_statement "*(char **)(param_1 + 8) = __dest;" (assignment_expression "*(char **)(param_1 + 8) = __dest" (pointer_expression "*(char **)(param_1 + 8)" * (cast_expression "(char **)(param_1 + 8)" ( (type_descriptor "char **" primitive_type (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(param_1 + 8)" ( (binary_expression "param_1 + 8" identifier + number_literal) )))) = identifier) ;) (expression_statement "*(size_t *)(param_1 + 0xc) = sVar3;" (assignment_expression "*(size_t *)(param_1 + 0xc) = sVar3" (pointer_expression "*(size_t *)(param_1 + 0xc)" * (cast_expression "(size_t *)(param_1 + 0xc)" ( (type_descriptor "size_t *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0xc)" ( (binary_expression "param_1 + 0xc" identifier + number_literal) )))) = identifier) ;) (goto_statement "goto LAB_0001ec78;" goto statement_identifier ;) })) })) (expression_statement "free(__src);" (call_expression "free(__src)" identifier (argument_list "(__src)" ( identifier ))) ;) (expression_statement "*(char **)(param_1 + 8) = __dest;" (assignment_expression "*(char **)(param_1 + 8) = __dest" (pointer_expression "*(char **)(param_1 + 8)" * (cast_expression "(char **)(param_1 + 8)" ( (type_descriptor "char **" primitive_type (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(param_1 + 8)" ( (binary_expression "param_1 + 8" identifier + number_literal) )))) = identifier) ;) (expression_statement "*(size_t *)(param_1 + 0xc) = sVar3;" (assignment_expression "*(size_t *)(param_1 + 0xc) = sVar3" (pointer_expression "*(size_t *)(param_1 + 0xc)" * (cast_expression "(size_t *)(param_1 + 0xc)" ( (type_descriptor "size_t *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0xc)" ( (binary_expression "param_1 + 0xc" identifier + number_literal) )))) = identifier) ;) (labeled_statement "LAB_0001ec78:\n  strcpy(__dest,param_2);" statement_identifier : (expression_statement "strcpy(__dest,param_2);" (call_expression "strcpy(__dest,param_2)" identifier (argument_list "(__dest,param_2)" ( identifier , identifier ))) ;)) (if_statement "if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return;\n  }" if (parenthesized_expression "(local_20 == *(int *)(in_GS_OFFSET + 0x14))" ( (binary_expression "local_20 == *(int *)(in_GS_OFFSET + 0x14)" identifier == (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" * (cast_expression "(int *)(in_GS_OFFSET + 0x14)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_GS_OFFSET + 0x14)" ( (binary_expression "in_GS_OFFSET + 0x14" identifier + number_literal) ))))) )) (compound_statement "{\n    return;\n  }" { (return_statement "return;" return ;) })) comment (expression_statement "FUN_00089270();" (call_expression "FUN_00089270()" identifier (argument_list "()" ( ))) ;) })))
(translation_unit "/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n/* WARNING: Unknown calling convention */\n\nvoid prompt_set_result(prompt_t *pr,char *newstr)\n\n{\n  int iVar1;\n  char cVar2;\n  int iVar3;\n  size_t sVar4;\n  int iVar5;\n  size_t __size;\n  char *__dest;\n  size_t __n;\n  char *__src;\n  int in_GS_OFFSET;\n  char str [200];\n  \n  iVar1 = *(int *)(in_GS_OFFSET + 0x14);\n  sVar4 = strlen(newstr);\n  __n = pr->resultsize;\n  if ((int)(sVar4 + 1) <= (int)__n) {\n    __dest = pr->result;\n    goto LAB_0001ec78;\n  }\n  iVar3 = (sVar4 + 1) * 5;\n  iVar5 = iVar3 + 3;\n  if (-1 < iVar3) {\n    iVar5 = iVar3;\n  }\n  sVar4 = (iVar5 >> 2) + 0x200;\n  if ((int)sVar4 < 0) {\nLAB_0001ed30:\n    builtin_strncpy(str,"Out of memory!",0xf);\n    modalfatalbox("%s",str);\n    __n = pr->resultsize;\n    __dest = (char *)0x0;\n  }\n  else {\n    __size = 1;\n    if (sVar4 != 0) {\n      __size = sVar4;\n    }\n    __dest = (char *)malloc(__size);\n    if (__dest == (char *)0x0) goto LAB_0001ed30;\n  }\n  __src = pr->result;\n  memcpy(__dest,__src,__n);\n  if (__n != 0) {\n    memset(__src,0,__n);\n    cVar2 = *__src;\n    while (cVar2 != '\0') {\n      __src = __src + 1;\n      cVar2 = *__src;\n    }\n    __src = pr->result;\n    if (__src == (char *)0x0) {\n      pr->result = __dest;\n      pr->resultsize = sVar4;\n      goto LAB_0001ec78;\n    }\n  }\n  free(__src);\n  pr->result = __dest;\n  pr->resultsize = sVar4;\nLAB_0001ec78:\n  strcpy(__dest,newstr);\n  if (iVar1 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return;\n  }\n                    /* WARNING: Subroutine does not return */\n  __stack_chk_fail_local();\n}\n\n" comment comment (function_definition "void prompt_set_result(prompt_t *pr,char *newstr)\n\n{\n  int iVar1;\n  char cVar2;\n  int iVar3;\n  size_t sVar4;\n  int iVar5;\n  size_t __size;\n  char *__dest;\n  size_t __n;\n  char *__src;\n  int in_GS_OFFSET;\n  char str [200];\n  \n  iVar1 = *(int *)(in_GS_OFFSET + 0x14);\n  sVar4 = strlen(newstr);\n  __n = pr->resultsize;\n  if ((int)(sVar4 + 1) <= (int)__n) {\n    __dest = pr->result;\n    goto LAB_0001ec78;\n  }\n  iVar3 = (sVar4 + 1) * 5;\n  iVar5 = iVar3 + 3;\n  if (-1 < iVar3) {\n    iVar5 = iVar3;\n  }\n  sVar4 = (iVar5 >> 2) + 0x200;\n  if ((int)sVar4 < 0) {\nLAB_0001ed30:\n    builtin_strncpy(str,"Out of memory!",0xf);\n    modalfatalbox("%s",str);\n    __n = pr->resultsize;\n    __dest = (char *)0x0;\n  }\n  else {\n    __size = 1;\n    if (sVar4 != 0) {\n      __size = sVar4;\n    }\n    __dest = (char *)malloc(__size);\n    if (__dest == (char *)0x0) goto LAB_0001ed30;\n  }\n  __src = pr->result;\n  memcpy(__dest,__src,__n);\n  if (__n != 0) {\n    memset(__src,0,__n);\n    cVar2 = *__src;\n    while (cVar2 != '\0') {\n      __src = __src + 1;\n      cVar2 = *__src;\n    }\n    __src = pr->result;\n    if (__src == (char *)0x0) {\n      pr->result = __dest;\n      pr->resultsize = sVar4;\n      goto LAB_0001ec78;\n    }\n  }\n  free(__src);\n  pr->result = __dest;\n  pr->resultsize = sVar4;\nLAB_0001ec78:\n  strcpy(__dest,newstr);\n  if (iVar1 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return;\n  }\n                    /* WARNING: Subroutine does not return */\n  __stack_chk_fail_local();\n}" primitive_type (function_declarator "prompt_set_result(prompt_t *pr,char *newstr)" identifier (parameter_list "(prompt_t *pr,char *newstr)" ( (parameter_declaration "prompt_t *pr" type_identifier (pointer_declarator "*pr" * identifier)) , (parameter_declaration "char *newstr" primitive_type (pointer_declarator "*newstr" * identifier)) ))) (compound_statement "{\n  int iVar1;\n  char cVar2;\n  int iVar3;\n  size_t sVar4;\n  int iVar5;\n  size_t __size;\n  char *__dest;\n  size_t __n;\n  char *__src;\n  int in_GS_OFFSET;\n  char str [200];\n  \n  iVar1 = *(int *)(in_GS_OFFSET + 0x14);\n  sVar4 = strlen(newstr);\n  __n = pr->resultsize;\n  if ((int)(sVar4 + 1) <= (int)__n) {\n    __dest = pr->result;\n    goto LAB_0001ec78;\n  }\n  iVar3 = (sVar4 + 1) * 5;\n  iVar5 = iVar3 + 3;\n  if (-1 < iVar3) {\n    iVar5 = iVar3;\n  }\n  sVar4 = (iVar5 >> 2) + 0x200;\n  if ((int)sVar4 < 0) {\nLAB_0001ed30:\n    builtin_strncpy(str,"Out of memory!",0xf);\n    modalfatalbox("%s",str);\n    __n = pr->resultsize;\n    __dest = (char *)0x0;\n  }\n  else {\n    __size = 1;\n    if (sVar4 != 0) {\n      __size = sVar4;\n    }\n    __dest = (char *)malloc(__size);\n    if (__dest == (char *)0x0) goto LAB_0001ed30;\n  }\n  __src = pr->result;\n  memcpy(__dest,__src,__n);\n  if (__n != 0) {\n    memset(__src,0,__n);\n    cVar2 = *__src;\n    while (cVar2 != '\0') {\n      __src = __src + 1;\n      cVar2 = *__src;\n    }\n    __src = pr->result;\n    if (__src == (char *)0x0) {\n      pr->result = __dest;\n      pr->resultsize = sVar4;\n      goto LAB_0001ec78;\n    }\n  }\n  free(__src);\n  pr->result = __dest;\n  pr->resultsize = sVar4;\nLAB_0001ec78:\n  strcpy(__dest,newstr);\n  if (iVar1 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return;\n  }\n                    /* WARNING: Subroutine does not return */\n  __stack_chk_fail_local();\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "char cVar2;" primitive_type identifier ;) (declaration "int iVar3;" primitive_type identifier ;) (declaration "size_t sVar4;" primitive_type identifier ;) (declaration "int iVar5;" primitive_type identifier ;) (declaration "size_t __size;" primitive_type identifier ;) (declaration "char *__dest;" primitive_type (pointer_declarator "*__dest" * identifier) ;) (declaration "size_t __n;" primitive_type identifier ;) (declaration "char *__src;" primitive_type (pointer_declarator "*__src" * identifier) ;) (declaration "int in_GS_OFFSET;" primitive_type identifier ;) (declaration "char str [200];" primitive_type (array_declarator "str [200]" identifier [ number_literal ]) ;) (expression_statement "iVar1 = *(int *)(in_GS_OFFSET + 0x14);" (assignment_expression "iVar1 = *(int *)(in_GS_OFFSET + 0x14)" identifier = (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" * (cast_expression "(int *)(in_GS_OFFSET + 0x14)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_GS_OFFSET + 0x14)" ( (binary_expression "in_GS_OFFSET + 0x14" identifier + number_literal) ))))) ;) (expression_statement "sVar4 = strlen(newstr);" (assignment_expression "sVar4 = strlen(newstr)" identifier = (call_expression "strlen(newstr)" identifier (argument_list "(newstr)" ( identifier )))) ;) (expression_statement "__n = pr->resultsize;" (assignment_expression "__n = pr->resultsize" identifier = (field_expression "pr->resultsize" identifier -> field_identifier)) ;) (if_statement "if ((int)(sVar4 + 1) <= (int)__n) {\n    __dest = pr->result;\n    goto LAB_0001ec78;\n  }" if (parenthesized_expression "((int)(sVar4 + 1) <= (int)__n)" ( (binary_expression "(int)(sVar4 + 1) <= (int)__n" (cast_expression "(int)(sVar4 + 1)" ( (type_descriptor "int" primitive_type) ) (parenthesized_expression "(sVar4 + 1)" ( (binary_expression "sVar4 + 1" identifier + number_literal) ))) <= (cast_expression "(int)__n" ( (type_descriptor "int" primitive_type) ) identifier)) )) (compound_statement "{\n    __dest = pr->result;\n    goto LAB_0001ec78;\n  }" { (expression_statement "__dest = pr->result;" (assignment_expression "__dest = pr->result" identifier = (field_expression "pr->result" identifier -> field_identifier)) ;) (goto_statement "goto LAB_0001ec78;" goto statement_identifier ;) })) (expression_statement "iVar3 = (sVar4 + 1) * 5;" (assignment_expression "iVar3 = (sVar4 + 1) * 5" identifier = (binary_expression "(sVar4 + 1) * 5" (parenthesized_expression "(sVar4 + 1)" ( (binary_expression "sVar4 + 1" identifier + number_literal) )) * number_literal)) ;) (expression_statement "iVar5 = iVar3 + 3;" (assignment_expression "iVar5 = iVar3 + 3" identifier = (binary_expression "iVar3 + 3" identifier + number_literal)) ;) (if_statement "if (-1 < iVar3) {\n    iVar5 = iVar3;\n  }" if (parenthesized_expression "(-1 < iVar3)" ( (binary_expression "-1 < iVar3" number_literal < identifier) )) (compound_statement "{\n    iVar5 = iVar3;\n  }" { (expression_statement "iVar5 = iVar3;" (assignment_expression "iVar5 = iVar3" identifier = identifier) ;) })) (expression_statement "sVar4 = (iVar5 >> 2) + 0x200;" (assignment_expression "sVar4 = (iVar5 >> 2) + 0x200" identifier = (binary_expression "(iVar5 >> 2) + 0x200" (parenthesized_expression "(iVar5 >> 2)" ( (binary_expression "iVar5 >> 2" identifier >> number_literal) )) + number_literal)) ;) (if_statement "if ((int)sVar4 < 0) {\nLAB_0001ed30:\n    builtin_strncpy(str,"Out of memory!",0xf);\n    modalfatalbox("%s",str);\n    __n = pr->resultsize;\n    __dest = (char *)0x0;\n  }\n  else {\n    __size = 1;\n    if (sVar4 != 0) {\n      __size = sVar4;\n    }\n    __dest = (char *)malloc(__size);\n    if (__dest == (char *)0x0) goto LAB_0001ed30;\n  }" if (parenthesized_expression "((int)sVar4 < 0)" ( (binary_expression "(int)sVar4 < 0" (cast_expression "(int)sVar4" ( (type_descriptor "int" primitive_type) ) identifier) < number_literal) )) (compound_statement "{\nLAB_0001ed30:\n    builtin_strncpy(str,"Out of memory!",0xf);\n    modalfatalbox("%s",str);\n    __n = pr->resultsize;\n    __dest = (char *)0x0;\n  }" { (labeled_statement "LAB_0001ed30:\n    builtin_strncpy(str,"Out of memory!",0xf);" statement_identifier : (expression_statement "builtin_strncpy(str,"Out of memory!",0xf);" (call_expression "builtin_strncpy(str,"Out of memory!",0xf)" identifier (argument_list "(str,"Out of memory!",0xf)" ( identifier , (string_literal ""Out of memory!"" " string_content ") , number_literal ))) ;)) (expression_statement "modalfatalbox("%s",str);" (call_expression "modalfatalbox("%s",str)" identifier (argument_list "("%s",str)" ( (string_literal ""%s"" " string_content ") , identifier ))) ;) (expression_statement "__n = pr->resultsize;" (assignment_expression "__n = pr->resultsize" identifier = (field_expression "pr->resultsize" identifier -> field_identifier)) ;) (expression_statement "__dest = (char *)0x0;" (assignment_expression "__dest = (char *)0x0" identifier = (cast_expression "(char *)0x0" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) ;) }) (else_clause "else {\n    __size = 1;\n    if (sVar4 != 0) {\n      __size = sVar4;\n    }\n    __dest = (char *)malloc(__size);\n    if (__dest == (char *)0x0) goto LAB_0001ed30;\n  }" else (compound_statement "{\n    __size = 1;\n    if (sVar4 != 0) {\n      __size = sVar4;\n    }\n    __dest = (char *)malloc(__size);\n    if (__dest == (char *)0x0) goto LAB_0001ed30;\n  }" { (expression_statement "__size = 1;" (assignment_expression "__size = 1" identifier = number_literal) ;) (if_statement "if (sVar4 != 0) {\n      __size = sVar4;\n    }" if (parenthesized_expression "(sVar4 != 0)" ( (binary_expression "sVar4 != 0" identifier != number_literal) )) (compound_statement "{\n      __size = sVar4;\n    }" { (expression_statement "__size = sVar4;" (assignment_expression "__size = sVar4" identifier = identifier) ;) })) (expression_statement "__dest = (char *)malloc(__size);" (assignment_expression "__dest = (char *)malloc(__size)" identifier = (cast_expression "(char *)malloc(__size)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "malloc(__size)" identifier (argument_list "(__size)" ( identifier ))))) ;) (if_statement "if (__dest == (char *)0x0) goto LAB_0001ed30;" if (parenthesized_expression "(__dest == (char *)0x0)" ( (binary_expression "__dest == (char *)0x0" identifier == (cast_expression "(char *)0x0" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) )) (goto_statement "goto LAB_0001ed30;" goto statement_identifier ;)) }))) (expression_statement "__src = pr->result;" (assignment_expression "__src = pr->result" identifier = (field_expression "pr->result" identifier -> field_identifier)) ;) (expression_statement "memcpy(__dest,__src,__n);" (call_expression "memcpy(__dest,__src,__n)" identifier (argument_list "(__dest,__src,__n)" ( identifier , identifier , identifier ))) ;) (if_statement "if (__n != 0) {\n    memset(__src,0,__n);\n    cVar2 = *__src;\n    while (cVar2 != '\0') {\n      __src = __src + 1;\n      cVar2 = *__src;\n    }\n    __src = pr->result;\n    if (__src == (char *)0x0) {\n      pr->result = __dest;\n      pr->resultsize = sVar4;\n      goto LAB_0001ec78;\n    }\n  }" if (parenthesized_expression "(__n != 0)" ( (binary_expression "__n != 0" identifier != number_literal) )) (compound_statement "{\n    memset(__src,0,__n);\n    cVar2 = *__src;\n    while (cVar2 != '\0') {\n      __src = __src + 1;\n      cVar2 = *__src;\n    }\n    __src = pr->result;\n    if (__src == (char *)0x0) {\n      pr->result = __dest;\n      pr->resultsize = sVar4;\n      goto LAB_0001ec78;\n    }\n  }" { (expression_statement "memset(__src,0,__n);" (call_expression "memset(__src,0,__n)" identifier (argument_list "(__src,0,__n)" ( identifier , number_literal , identifier ))) ;) (expression_statement "cVar2 = *__src;" (assignment_expression "cVar2 = *__src" identifier = (pointer_expression "*__src" * identifier)) ;) (while_statement "while (cVar2 != '\0') {\n      __src = __src + 1;\n      cVar2 = *__src;\n    }" while (parenthesized_expression "(cVar2 != '\0')" ( (binary_expression "cVar2 != '\0'" identifier != (char_literal "'\0'" ' escape_sequence ')) )) (compound_statement "{\n      __src = __src + 1;\n      cVar2 = *__src;\n    }" { (expression_statement "__src = __src + 1;" (assignment_expression "__src = __src + 1" identifier = (binary_expression "__src + 1" identifier + number_literal)) ;) (expression_statement "cVar2 = *__src;" (assignment_expression "cVar2 = *__src" identifier = (pointer_expression "*__src" * identifier)) ;) })) (expression_statement "__src = pr->result;" (assignment_expression "__src = pr->result" identifier = (field_expression "pr->result" identifier -> field_identifier)) ;) (if_statement "if (__src == (char *)0x0) {\n      pr->result = __dest;\n      pr->resultsize = sVar4;\n      goto LAB_0001ec78;\n    }" if (parenthesized_expression "(__src == (char *)0x0)" ( (binary_expression "__src == (char *)0x0" identifier == (cast_expression "(char *)0x0" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n      pr->result = __dest;\n      pr->resultsize = sVar4;\n      goto LAB_0001ec78;\n    }" { (expression_statement "pr->result = __dest;" (assignment_expression "pr->result = __dest" (field_expression "pr->result" identifier -> field_identifier) = identifier) ;) (expression_statement "pr->resultsize = sVar4;" (assignment_expression "pr->resultsize = sVar4" (field_expression "pr->resultsize" identifier -> field_identifier) = identifier) ;) (goto_statement "goto LAB_0001ec78;" goto statement_identifier ;) })) })) (expression_statement "free(__src);" (call_expression "free(__src)" identifier (argument_list "(__src)" ( identifier ))) ;) (expression_statement "pr->result = __dest;" (assignment_expression "pr->result = __dest" (field_expression "pr->result" identifier -> field_identifier) = identifier) ;) (expression_statement "pr->resultsize = sVar4;" (assignment_expression "pr->resultsize = sVar4" (field_expression "pr->resultsize" identifier -> field_identifier) = identifier) ;) (labeled_statement "LAB_0001ec78:\n  strcpy(__dest,newstr);" statement_identifier : (expression_statement "strcpy(__dest,newstr);" (call_expression "strcpy(__dest,newstr)" identifier (argument_list "(__dest,newstr)" ( identifier , identifier ))) ;)) (if_statement "if (iVar1 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return;\n  }" if (parenthesized_expression "(iVar1 == *(int *)(in_GS_OFFSET + 0x14))" ( (binary_expression "iVar1 == *(int *)(in_GS_OFFSET + 0x14)" identifier == (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" * (cast_expression "(int *)(in_GS_OFFSET + 0x14)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_GS_OFFSET + 0x14)" ( (binary_expression "in_GS_OFFSET + 0x14" identifier + number_literal) ))))) )) (compound_statement "{\n    return;\n  }" { (return_statement "return;" return ;) })) comment (expression_statement "__stack_chk_fail_local();" (call_expression "__stack_chk_fail_local()" identifier (argument_list "()" ( ))) ;) })))
(translation_unit "void FUN_0001ec30(int param_1,char *param_2)\n\n{\n  char cVar1;\n  int iVar2;\n  size_t sVar3;\n  int iVar4;\n  size_t __size;\n  char *__dest;\n  size_t __n;\n  char *__src;\n  int in_GS_OFFSET;\n  undefined4 local_e8;\n  undefined4 local_e4;\n  undefined4 local_e0;\n  undefined2 local_dc;\n  undefined1 local_da;\n  int local_20;\n  undefined4 uStack_14;\n  \n  uStack_14 = 0x1ec39;\n  local_20 = *(int *)(in_GS_OFFSET + 0x14);\n  sVar3 = strlen(param_2);\n  __n = *(size_t *)(param_1 + 0xc);\n  if ((int)(sVar3 + 1) <= (int)__n) {\n    __dest = *(char **)(param_1 + 8);\n    goto LAB_0001ec78;\n  }\n  iVar2 = (sVar3 + 1) * 5;\n  iVar4 = iVar2 + 3;\n  if (-1 < iVar2) {\n    iVar4 = iVar2;\n  }\n  sVar3 = (iVar4 >> 2) + 0x200;\n  if ((int)sVar3 < 0) {\nLAB_0001ed30:\n    local_e8 = 0x2074754f;\n    local_dc = 0x2179;\n    local_e4 = 0x6d20666f;\n    local_e0 = 0x726f6d65;\n    local_da = 0;\n    FUN_000812d0("%s",&local_e8);\n    __n = *(size_t *)(param_1 + 0xc);\n    __dest = (char *)0x0;\n  }\n  else {\n    __size = 1;\n    if (sVar3 != 0) {\n      __size = sVar3;\n    }\n    __dest = (char *)malloc(__size);\n    if (__dest == (char *)0x0) goto LAB_0001ed30;\n  }\n  __src = *(char **)(param_1 + 8);\n  memcpy(__dest,__src,__n);\n  if (__n != 0) {\n    memset(__src,0,__n);\n    cVar1 = *__src;\n    while (cVar1 != '\0') {\n      __src = __src + 1;\n      cVar1 = *__src;\n    }\n    __src = *(char **)(param_1 + 8);\n    if (__src == (char *)0x0) {\n      *(char **)(param_1 + 8) = __dest;\n      *(size_t *)(param_1 + 0xc) = sVar3;\n      goto LAB_0001ec78;\n    }\n  }\n  free(__src);\n  *(char **)(param_1 + 8) = __dest;\n  *(size_t *)(param_1 + 0xc) = sVar3;\nLAB_0001ec78:\n  strcpy(__dest,param_2);\n  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return;\n  }\n                    \n  FUN_00089270();\n}\n\n" (function_definition "void FUN_0001ec30(int param_1,char *param_2)\n\n{\n  char cVar1;\n  int iVar2;\n  size_t sVar3;\n  int iVar4;\n  size_t __size;\n  char *__dest;\n  size_t __n;\n  char *__src;\n  int in_GS_OFFSET;\n  undefined4 local_e8;\n  undefined4 local_e4;\n  undefined4 local_e0;\n  undefined2 local_dc;\n  undefined1 local_da;\n  int local_20;\n  undefined4 uStack_14;\n  \n  uStack_14 = 0x1ec39;\n  local_20 = *(int *)(in_GS_OFFSET + 0x14);\n  sVar3 = strlen(param_2);\n  __n = *(size_t *)(param_1 + 0xc);\n  if ((int)(sVar3 + 1) <= (int)__n) {\n    __dest = *(char **)(param_1 + 8);\n    goto LAB_0001ec78;\n  }\n  iVar2 = (sVar3 + 1) * 5;\n  iVar4 = iVar2 + 3;\n  if (-1 < iVar2) {\n    iVar4 = iVar2;\n  }\n  sVar3 = (iVar4 >> 2) + 0x200;\n  if ((int)sVar3 < 0) {\nLAB_0001ed30:\n    local_e8 = 0x2074754f;\n    local_dc = 0x2179;\n    local_e4 = 0x6d20666f;\n    local_e0 = 0x726f6d65;\n    local_da = 0;\n    FUN_000812d0("%s",&local_e8);\n    __n = *(size_t *)(param_1 + 0xc);\n    __dest = (char *)0x0;\n  }\n  else {\n    __size = 1;\n    if (sVar3 != 0) {\n      __size = sVar3;\n    }\n    __dest = (char *)malloc(__size);\n    if (__dest == (char *)0x0) goto LAB_0001ed30;\n  }\n  __src = *(char **)(param_1 + 8);\n  memcpy(__dest,__src,__n);\n  if (__n != 0) {\n    memset(__src,0,__n);\n    cVar1 = *__src;\n    while (cVar1 != '\0') {\n      __src = __src + 1;\n      cVar1 = *__src;\n    }\n    __src = *(char **)(param_1 + 8);\n    if (__src == (char *)0x0) {\n      *(char **)(param_1 + 8) = __dest;\n      *(size_t *)(param_1 + 0xc) = sVar3;\n      goto LAB_0001ec78;\n    }\n  }\n  free(__src);\n  *(char **)(param_1 + 8) = __dest;\n  *(size_t *)(param_1 + 0xc) = sVar3;\nLAB_0001ec78:\n  strcpy(__dest,param_2);\n  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return;\n  }\n                    \n  FUN_00089270();\n}" primitive_type (function_declarator "FUN_0001ec30(int param_1,char *param_2)" identifier (parameter_list "(int param_1,char *param_2)" ( (parameter_declaration "int param_1" primitive_type identifier) , (parameter_declaration "char *param_2" primitive_type (pointer_declarator "*param_2" * identifier)) ))) (compound_statement "{\n  char cVar1;\n  int iVar2;\n  size_t sVar3;\n  int iVar4;\n  size_t __size;\n  char *__dest;\n  size_t __n;\n  char *__src;\n  int in_GS_OFFSET;\n  undefined4 local_e8;\n  undefined4 local_e4;\n  undefined4 local_e0;\n  undefined2 local_dc;\n  undefined1 local_da;\n  int local_20;\n  undefined4 uStack_14;\n  \n  uStack_14 = 0x1ec39;\n  local_20 = *(int *)(in_GS_OFFSET + 0x14);\n  sVar3 = strlen(param_2);\n  __n = *(size_t *)(param_1 + 0xc);\n  if ((int)(sVar3 + 1) <= (int)__n) {\n    __dest = *(char **)(param_1 + 8);\n    goto LAB_0001ec78;\n  }\n  iVar2 = (sVar3 + 1) * 5;\n  iVar4 = iVar2 + 3;\n  if (-1 < iVar2) {\n    iVar4 = iVar2;\n  }\n  sVar3 = (iVar4 >> 2) + 0x200;\n  if ((int)sVar3 < 0) {\nLAB_0001ed30:\n    local_e8 = 0x2074754f;\n    local_dc = 0x2179;\n    local_e4 = 0x6d20666f;\n    local_e0 = 0x726f6d65;\n    local_da = 0;\n    FUN_000812d0("%s",&local_e8);\n    __n = *(size_t *)(param_1 + 0xc);\n    __dest = (char *)0x0;\n  }\n  else {\n    __size = 1;\n    if (sVar3 != 0) {\n      __size = sVar3;\n    }\n    __dest = (char *)malloc(__size);\n    if (__dest == (char *)0x0) goto LAB_0001ed30;\n  }\n  __src = *(char **)(param_1 + 8);\n  memcpy(__dest,__src,__n);\n  if (__n != 0) {\n    memset(__src,0,__n);\n    cVar1 = *__src;\n    while (cVar1 != '\0') {\n      __src = __src + 1;\n      cVar1 = *__src;\n    }\n    __src = *(char **)(param_1 + 8);\n    if (__src == (char *)0x0) {\n      *(char **)(param_1 + 8) = __dest;\n      *(size_t *)(param_1 + 0xc) = sVar3;\n      goto LAB_0001ec78;\n    }\n  }\n  free(__src);\n  *(char **)(param_1 + 8) = __dest;\n  *(size_t *)(param_1 + 0xc) = sVar3;\nLAB_0001ec78:\n  strcpy(__dest,param_2);\n  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return;\n  }\n                    \n  FUN_00089270();\n}" { (declaration "char cVar1;" primitive_type identifier ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "size_t sVar3;" primitive_type identifier ;) (declaration "int iVar4;" primitive_type identifier ;) (declaration "size_t __size;" primitive_type identifier ;) (declaration "char *__dest;" primitive_type (pointer_declarator "*__dest" * identifier) ;) (declaration "size_t __n;" primitive_type identifier ;) (declaration "char *__src;" primitive_type (pointer_declarator "*__src" * identifier) ;) (declaration "int in_GS_OFFSET;" primitive_type identifier ;) (declaration "undefined4 local_e8;" type_identifier identifier ;) (declaration "undefined4 local_e4;" type_identifier identifier ;) (declaration "undefined4 local_e0;" type_identifier identifier ;) (declaration "undefined2 local_dc;" type_identifier identifier ;) (declaration "undefined1 local_da;" type_identifier identifier ;) (declaration "int local_20;" primitive_type identifier ;) (declaration "undefined4 uStack_14;" type_identifier identifier ;) (expression_statement "uStack_14 = 0x1ec39;" (assignment_expression "uStack_14 = 0x1ec39" identifier = number_literal) ;) (expression_statement "local_20 = *(int *)(in_GS_OFFSET + 0x14);" (assignment_expression "local_20 = *(int *)(in_GS_OFFSET + 0x14)" identifier = (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" * (cast_expression "(int *)(in_GS_OFFSET + 0x14)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_GS_OFFSET + 0x14)" ( (binary_expression "in_GS_OFFSET + 0x14" identifier + number_literal) ))))) ;) (expression_statement "sVar3 = strlen(param_2);" (assignment_expression "sVar3 = strlen(param_2)" identifier = (call_expression "strlen(param_2)" identifier (argument_list "(param_2)" ( identifier )))) ;) (expression_statement "__n = *(size_t *)(param_1 + 0xc);" (assignment_expression "__n = *(size_t *)(param_1 + 0xc)" identifier = (pointer_expression "*(size_t *)(param_1 + 0xc)" * (cast_expression "(size_t *)(param_1 + 0xc)" ( (type_descriptor "size_t *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0xc)" ( (binary_expression "param_1 + 0xc" identifier + number_literal) ))))) ;) (if_statement "if ((int)(sVar3 + 1) <= (int)__n) {\n    __dest = *(char **)(param_1 + 8);\n    goto LAB_0001ec78;\n  }" if (parenthesized_expression "((int)(sVar3 + 1) <= (int)__n)" ( (binary_expression "(int)(sVar3 + 1) <= (int)__n" (cast_expression "(int)(sVar3 + 1)" ( (type_descriptor "int" primitive_type) ) (parenthesized_expression "(sVar3 + 1)" ( (binary_expression "sVar3 + 1" identifier + number_literal) ))) <= (cast_expression "(int)__n" ( (type_descriptor "int" primitive_type) ) identifier)) )) (compound_statement "{\n    __dest = *(char **)(param_1 + 8);\n    goto LAB_0001ec78;\n  }" { (expression_statement "__dest = *(char **)(param_1 + 8);" (assignment_expression "__dest = *(char **)(param_1 + 8)" identifier = (pointer_expression "*(char **)(param_1 + 8)" * (cast_expression "(char **)(param_1 + 8)" ( (type_descriptor "char **" primitive_type (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(param_1 + 8)" ( (binary_expression "param_1 + 8" identifier + number_literal) ))))) ;) (goto_statement "goto LAB_0001ec78;" goto statement_identifier ;) })) (expression_statement "iVar2 = (sVar3 + 1) * 5;" (assignment_expression "iVar2 = (sVar3 + 1) * 5" identifier = (binary_expression "(sVar3 + 1) * 5" (parenthesized_expression "(sVar3 + 1)" ( (binary_expression "sVar3 + 1" identifier + number_literal) )) * number_literal)) ;) (expression_statement "iVar4 = iVar2 + 3;" (assignment_expression "iVar4 = iVar2 + 3" identifier = (binary_expression "iVar2 + 3" identifier + number_literal)) ;) (if_statement "if (-1 < iVar2) {\n    iVar4 = iVar2;\n  }" if (parenthesized_expression "(-1 < iVar2)" ( (binary_expression "-1 < iVar2" number_literal < identifier) )) (compound_statement "{\n    iVar4 = iVar2;\n  }" { (expression_statement "iVar4 = iVar2;" (assignment_expression "iVar4 = iVar2" identifier = identifier) ;) })) (expression_statement "sVar3 = (iVar4 >> 2) + 0x200;" (assignment_expression "sVar3 = (iVar4 >> 2) + 0x200" identifier = (binary_expression "(iVar4 >> 2) + 0x200" (parenthesized_expression "(iVar4 >> 2)" ( (binary_expression "iVar4 >> 2" identifier >> number_literal) )) + number_literal)) ;) (if_statement "if ((int)sVar3 < 0) {\nLAB_0001ed30:\n    local_e8 = 0x2074754f;\n    local_dc = 0x2179;\n    local_e4 = 0x6d20666f;\n    local_e0 = 0x726f6d65;\n    local_da = 0;\n    FUN_000812d0("%s",&local_e8);\n    __n = *(size_t *)(param_1 + 0xc);\n    __dest = (char *)0x0;\n  }\n  else {\n    __size = 1;\n    if (sVar3 != 0) {\n      __size = sVar3;\n    }\n    __dest = (char *)malloc(__size);\n    if (__dest == (char *)0x0) goto LAB_0001ed30;\n  }" if (parenthesized_expression "((int)sVar3 < 0)" ( (binary_expression "(int)sVar3 < 0" (cast_expression "(int)sVar3" ( (type_descriptor "int" primitive_type) ) identifier) < number_literal) )) (compound_statement "{\nLAB_0001ed30:\n    local_e8 = 0x2074754f;\n    local_dc = 0x2179;\n    local_e4 = 0x6d20666f;\n    local_e0 = 0x726f6d65;\n    local_da = 0;\n    FUN_000812d0("%s",&local_e8);\n    __n = *(size_t *)(param_1 + 0xc);\n    __dest = (char *)0x0;\n  }" { (labeled_statement "LAB_0001ed30:\n    local_e8 = 0x2074754f;" statement_identifier : (expression_statement "local_e8 = 0x2074754f;" (assignment_expression "local_e8 = 0x2074754f" identifier = number_literal) ;)) (expression_statement "local_dc = 0x2179;" (assignment_expression "local_dc = 0x2179" identifier = number_literal) ;) (expression_statement "local_e4 = 0x6d20666f;" (assignment_expression "local_e4 = 0x6d20666f" identifier = number_literal) ;) (expression_statement "local_e0 = 0x726f6d65;" (assignment_expression "local_e0 = 0x726f6d65" identifier = number_literal) ;) (expression_statement "local_da = 0;" (assignment_expression "local_da = 0" identifier = number_literal) ;) (expression_statement "FUN_000812d0("%s",&local_e8);" (call_expression "FUN_000812d0("%s",&local_e8)" identifier (argument_list "("%s",&local_e8)" ( (string_literal ""%s"" " string_content ") , (pointer_expression "&local_e8" & identifier) ))) ;) (expression_statement "__n = *(size_t *)(param_1 + 0xc);" (assignment_expression "__n = *(size_t *)(param_1 + 0xc)" identifier = (pointer_expression "*(size_t *)(param_1 + 0xc)" * (cast_expression "(size_t *)(param_1 + 0xc)" ( (type_descriptor "size_t *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0xc)" ( (binary_expression "param_1 + 0xc" identifier + number_literal) ))))) ;) (expression_statement "__dest = (char *)0x0;" (assignment_expression "__dest = (char *)0x0" identifier = (cast_expression "(char *)0x0" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) ;) }) (else_clause "else {\n    __size = 1;\n    if (sVar3 != 0) {\n      __size = sVar3;\n    }\n    __dest = (char *)malloc(__size);\n    if (__dest == (char *)0x0) goto LAB_0001ed30;\n  }" else (compound_statement "{\n    __size = 1;\n    if (sVar3 != 0) {\n      __size = sVar3;\n    }\n    __dest = (char *)malloc(__size);\n    if (__dest == (char *)0x0) goto LAB_0001ed30;\n  }" { (expression_statement "__size = 1;" (assignment_expression "__size = 1" identifier = number_literal) ;) (if_statement "if (sVar3 != 0) {\n      __size = sVar3;\n    }" if (parenthesized_expression "(sVar3 != 0)" ( (binary_expression "sVar3 != 0" identifier != number_literal) )) (compound_statement "{\n      __size = sVar3;\n    }" { (expression_statement "__size = sVar3;" (assignment_expression "__size = sVar3" identifier = identifier) ;) })) (expression_statement "__dest = (char *)malloc(__size);" (assignment_expression "__dest = (char *)malloc(__size)" identifier = (cast_expression "(char *)malloc(__size)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "malloc(__size)" identifier (argument_list "(__size)" ( identifier ))))) ;) (if_statement "if (__dest == (char *)0x0) goto LAB_0001ed30;" if (parenthesized_expression "(__dest == (char *)0x0)" ( (binary_expression "__dest == (char *)0x0" identifier == (cast_expression "(char *)0x0" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) )) (goto_statement "goto LAB_0001ed30;" goto statement_identifier ;)) }))) (expression_statement "__src = *(char **)(param_1 + 8);" (assignment_expression "__src = *(char **)(param_1 + 8)" identifier = (pointer_expression "*(char **)(param_1 + 8)" * (cast_expression "(char **)(param_1 + 8)" ( (type_descriptor "char **" primitive_type (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(param_1 + 8)" ( (binary_expression "param_1 + 8" identifier + number_literal) ))))) ;) (expression_statement "memcpy(__dest,__src,__n);" (call_expression "memcpy(__dest,__src,__n)" identifier (argument_list "(__dest,__src,__n)" ( identifier , identifier , identifier ))) ;) (if_statement "if (__n != 0) {\n    memset(__src,0,__n);\n    cVar1 = *__src;\n    while (cVar1 != '\0') {\n      __src = __src + 1;\n      cVar1 = *__src;\n    }\n    __src = *(char **)(param_1 + 8);\n    if (__src == (char *)0x0) {\n      *(char **)(param_1 + 8) = __dest;\n      *(size_t *)(param_1 + 0xc) = sVar3;\n      goto LAB_0001ec78;\n    }\n  }" if (parenthesized_expression "(__n != 0)" ( (binary_expression "__n != 0" identifier != number_literal) )) (compound_statement "{\n    memset(__src,0,__n);\n    cVar1 = *__src;\n    while (cVar1 != '\0') {\n      __src = __src + 1;\n      cVar1 = *__src;\n    }\n    __src = *(char **)(param_1 + 8);\n    if (__src == (char *)0x0) {\n      *(char **)(param_1 + 8) = __dest;\n      *(size_t *)(param_1 + 0xc) = sVar3;\n      goto LAB_0001ec78;\n    }\n  }" { (expression_statement "memset(__src,0,__n);" (call_expression "memset(__src,0,__n)" identifier (argument_list "(__src,0,__n)" ( identifier , number_literal , identifier ))) ;) (expression_statement "cVar1 = *__src;" (assignment_expression "cVar1 = *__src" identifier = (pointer_expression "*__src" * identifier)) ;) (while_statement "while (cVar1 != '\0') {\n      __src = __src + 1;\n      cVar1 = *__src;\n    }" while (parenthesized_expression "(cVar1 != '\0')" ( (binary_expression "cVar1 != '\0'" identifier != (char_literal "'\0'" ' escape_sequence ')) )) (compound_statement "{\n      __src = __src + 1;\n      cVar1 = *__src;\n    }" { (expression_statement "__src = __src + 1;" (assignment_expression "__src = __src + 1" identifier = (binary_expression "__src + 1" identifier + number_literal)) ;) (expression_statement "cVar1 = *__src;" (assignment_expression "cVar1 = *__src" identifier = (pointer_expression "*__src" * identifier)) ;) })) (expression_statement "__src = *(char **)(param_1 + 8);" (assignment_expression "__src = *(char **)(param_1 + 8)" identifier = (pointer_expression "*(char **)(param_1 + 8)" * (cast_expression "(char **)(param_1 + 8)" ( (type_descriptor "char **" primitive_type (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(param_1 + 8)" ( (binary_expression "param_1 + 8" identifier + number_literal) ))))) ;) (if_statement "if (__src == (char *)0x0) {\n      *(char **)(param_1 + 8) = __dest;\n      *(size_t *)(param_1 + 0xc) = sVar3;\n      goto LAB_0001ec78;\n    }" if (parenthesized_expression "(__src == (char *)0x0)" ( (binary_expression "__src == (char *)0x0" identifier == (cast_expression "(char *)0x0" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n      *(char **)(param_1 + 8) = __dest;\n      *(size_t *)(param_1 + 0xc) = sVar3;\n      goto LAB_0001ec78;\n    }" { (expression_statement "*(char **)(param_1 + 8) = __dest;" (assignment_expression "*(char **)(param_1 + 8) = __dest" (pointer_expression "*(char **)(param_1 + 8)" * (cast_expression "(char **)(param_1 + 8)" ( (type_descriptor "char **" primitive_type (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(param_1 + 8)" ( (binary_expression "param_1 + 8" identifier + number_literal) )))) = identifier) ;) (expression_statement "*(size_t *)(param_1 + 0xc) = sVar3;" (assignment_expression "*(size_t *)(param_1 + 0xc) = sVar3" (pointer_expression "*(size_t *)(param_1 + 0xc)" * (cast_expression "(size_t *)(param_1 + 0xc)" ( (type_descriptor "size_t *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0xc)" ( (binary_expression "param_1 + 0xc" identifier + number_literal) )))) = identifier) ;) (goto_statement "goto LAB_0001ec78;" goto statement_identifier ;) })) })) (expression_statement "free(__src);" (call_expression "free(__src)" identifier (argument_list "(__src)" ( identifier ))) ;) (expression_statement "*(char **)(param_1 + 8) = __dest;" (assignment_expression "*(char **)(param_1 + 8) = __dest" (pointer_expression "*(char **)(param_1 + 8)" * (cast_expression "(char **)(param_1 + 8)" ( (type_descriptor "char **" primitive_type (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(param_1 + 8)" ( (binary_expression "param_1 + 8" identifier + number_literal) )))) = identifier) ;) (expression_statement "*(size_t *)(param_1 + 0xc) = sVar3;" (assignment_expression "*(size_t *)(param_1 + 0xc) = sVar3" (pointer_expression "*(size_t *)(param_1 + 0xc)" * (cast_expression "(size_t *)(param_1 + 0xc)" ( (type_descriptor "size_t *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0xc)" ( (binary_expression "param_1 + 0xc" identifier + number_literal) )))) = identifier) ;) (labeled_statement "LAB_0001ec78:\n  strcpy(__dest,param_2);" statement_identifier : (expression_statement "strcpy(__dest,param_2);" (call_expression "strcpy(__dest,param_2)" identifier (argument_list "(__dest,param_2)" ( identifier , identifier ))) ;)) (if_statement "if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return;\n  }" if (parenthesized_expression "(local_20 == *(int *)(in_GS_OFFSET + 0x14))" ( (binary_expression "local_20 == *(int *)(in_GS_OFFSET + 0x14)" identifier == (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" * (cast_expression "(int *)(in_GS_OFFSET + 0x14)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_GS_OFFSET + 0x14)" ( (binary_expression "in_GS_OFFSET + 0x14" identifier + number_literal) ))))) )) (compound_statement "{\n    return;\n  }" { (return_statement "return;" return ;) })) (expression_statement "FUN_00089270();" (call_expression "FUN_00089270()" identifier (argument_list "()" ( ))) ;) })))
(translation_unit (function_definition TYPE (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE (pointer_declarator * IDENT)) ))) (compound_statement { (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE IDENT ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (expression_statement (assignment_expression IDENT = LIT) ;) (expression_statement (assignment_expression IDENT = (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))))) ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT )))) ;) (expression_statement (assignment_expression IDENT = (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))))) ;) (if_statement if (parenthesized_expression ( (binary_expression (cast_expression ( (type_descriptor TYPE) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))) <= (cast_expression ( (type_descriptor TYPE) ) IDENT)) )) (compound_statement { (expression_statement (assignment_expression IDENT = (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator * (abstract_pointer_declarator *))) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))))) ;) (goto_statement goto statement_identifier ;) })) (expression_statement (assignment_expression IDENT = (binary_expression (parenthesized_expression ( (binary_expression IDENT + LIT) )) * LIT)) ;) (expression_statement (assignment_expression IDENT = (binary_expression IDENT + LIT)) ;) (if_statement if (parenthesized_expression ( (binary_expression LIT < IDENT) )) (compound_statement { (expression_statement (assignment_expression IDENT = IDENT) ;) })) (expression_statement (assignment_expression IDENT = (binary_expression (parenthesized_expression ( (binary_expression IDENT >> LIT) )) + LIT)) ;) (if_statement if (parenthesized_expression ( (binary_expression (cast_expression ( (type_descriptor TYPE) ) IDENT) < LIT) )) (compound_statement { (labeled_statement statement_identifier : (expression_statement (assignment_expression IDENT = LIT) ;)) (expression_statement (assignment_expression IDENT = LIT) ;) (expression_statement (assignment_expression IDENT = LIT) ;) (expression_statement (assignment_expression IDENT = LIT) ;) (expression_statement (assignment_expression IDENT = LIT) ;) (expression_statement (call_expression IDENT (argument_list ( (string_literal " string_content ") , (pointer_expression & IDENT) ))) ;) (expression_statement (assignment_expression IDENT = (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))))) ;) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) LIT)) ;) }) (else_clause else (compound_statement { (expression_statement (assignment_expression IDENT = LIT) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT != LIT) )) (compound_statement { (expression_statement (assignment_expression IDENT = IDENT) ;) })) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (call_expression IDENT (argument_list ( IDENT ))))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) LIT)) )) (goto_statement goto statement_identifier ;)) }))) (expression_statement (assignment_expression IDENT = (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator * (abstract_pointer_declarator *))) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))))) ;) (expression_statement (call_expression IDENT (argument_list ( IDENT , IDENT , IDENT ))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT != LIT) )) (compound_statement { (expression_statement (call_expression IDENT (argument_list ( IDENT , LIT , IDENT ))) ;) (expression_statement (assignment_expression IDENT = (pointer_expression * IDENT)) ;) (while_statement while (parenthesized_expression ( (binary_expression IDENT != (char_literal ' escape_sequence ')) )) (compound_statement { (expression_statement (assignment_expression IDENT = (binary_expression IDENT + LIT)) ;) (expression_statement (assignment_expression IDENT = (pointer_expression * IDENT)) ;) })) (expression_statement (assignment_expression IDENT = (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator * (abstract_pointer_declarator *))) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) LIT)) )) (compound_statement { (expression_statement (assignment_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator * (abstract_pointer_declarator *))) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) = IDENT) ;) (expression_statement (assignment_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) = IDENT) ;) (goto_statement goto statement_identifier ;) })) })) (expression_statement (call_expression IDENT (argument_list ( IDENT ))) ;) (expression_statement (assignment_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator * (abstract_pointer_declarator *))) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) = IDENT) ;) (expression_statement (assignment_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) = IDENT) ;) (labeled_statement statement_identifier : (expression_statement (call_expression IDENT (argument_list ( IDENT , IDENT ))) ;)) (if_statement if (parenthesized_expression ( (binary_expression IDENT == (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))))) )) (compound_statement { (return_statement return ;) })) (expression_statement (call_expression IDENT (argument_list ( ))) ;) })))
(function_definition "void FUN_0001ec30(int param_1,char *param_2)\n\n{\n  char cVar1;\n  int iVar2;\n  size_t sVar3;\n  int iVar4;\n  size_t __size;\n  char *__dest;\n  size_t __n;\n  char *__src;\n  int in_GS_OFFSET;\n  undefined4 local_e8;\n  undefined4 local_e4;\n  undefined4 local_e0;\n  undefined2 local_dc;\n  undefined1 local_da;\n  int local_20;\n  undefined4 uStack_14;\n  \n  uStack_14 = 0x1ec39;\n  local_20 = *(int *)(in_GS_OFFSET + 0x14);\n  sVar3 = strlen(param_2);\n  __n = *(size_t *)(param_1 + 0xc);\n  if ((int)(sVar3 + 1) <= (int)__n) {\n    __dest = *(char **)(param_1 + 8);\n    goto LAB_0001ec78;\n  }\n  iVar2 = (sVar3 + 1) * 5;\n  iVar4 = iVar2 + 3;\n  if (-1 < iVar2) {\n    iVar4 = iVar2;\n  }\n  sVar3 = (iVar4 >> 2) + 0x200;\n  if ((int)sVar3 < 0) {\nLAB_0001ed30:\n    local_e8 = 0x2074754f;\n    local_dc = 0x2179;\n    local_e4 = 0x6d20666f;\n    local_e0 = 0x726f6d65;\n    local_da = 0;\n    FUN_000812d0("%s",&local_e8);\n    __n = *(size_t *)(param_1 + 0xc);\n    __dest = (char *)0x0;\n  }\n  else {\n    __size = 1;\n    if (sVar3 != 0) {\n      __size = sVar3;\n    }\n    __dest = (char *)malloc(__size);\n    if (__dest == (char *)0x0) goto LAB_0001ed30;\n  }\n  __src = *(char **)(param_1 + 8);\n  memcpy(__dest,__src,__n);\n  if (__n != 0) {\n    memset(__src,0,__n);\n    cVar1 = *__src;\n    while (cVar1 != '\0') {\n      __src = __src + 1;\n      cVar1 = *__src;\n    }\n    __src = *(char **)(param_1 + 8);\n    if (__src == (char *)0x0) {\n      *(char **)(param_1 + 8) = __dest;\n      *(size_t *)(param_1 + 0xc) = sVar3;\n      goto LAB_0001ec78;\n    }\n  }\n  free(__src);\n  *(char **)(param_1 + 8) = __dest;\n  *(size_t *)(param_1 + 0xc) = sVar3;\nLAB_0001ec78:\n  strcpy(__dest,param_2);\n  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return;\n  }\n                    \n  FUN_00089270();\n}" (primitive_type "void") (function_declarator "FUN_0001ec30(int param_1,char *param_2)" (identifier "FUN_0001ec30") (parameter_list "(int param_1,char *param_2)" (( "(") (parameter_declaration "int param_1" (primitive_type "int") (identifier "param_1")) (, ",") (parameter_declaration "char *param_2" (primitive_type "char") (pointer_declarator "*param_2" (* "*") (identifier "param_2"))) () ")"))) (compound_statement "{\n  char cVar1;\n  int iVar2;\n  size_t sVar3;\n  int iVar4;\n  size_t __size;\n  char *__dest;\n  size_t __n;\n  char *__src;\n  int in_GS_OFFSET;\n  undefined4 local_e8;\n  undefined4 local_e4;\n  undefined4 local_e0;\n  undefined2 local_dc;\n  undefined1 local_da;\n  int local_20;\n  undefined4 uStack_14;\n  \n  uStack_14 = 0x1ec39;\n  local_20 = *(int *)(in_GS_OFFSET + 0x14);\n  sVar3 = strlen(param_2);\n  __n = *(size_t *)(param_1 + 0xc);\n  if ((int)(sVar3 + 1) <= (int)__n) {\n    __dest = *(char **)(param_1 + 8);\n    goto LAB_0001ec78;\n  }\n  iVar2 = (sVar3 + 1) * 5;\n  iVar4 = iVar2 + 3;\n  if (-1 < iVar2) {\n    iVar4 = iVar2;\n  }\n  sVar3 = (iVar4 >> 2) + 0x200;\n  if ((int)sVar3 < 0) {\nLAB_0001ed30:\n    local_e8 = 0x2074754f;\n    local_dc = 0x2179;\n    local_e4 = 0x6d20666f;\n    local_e0 = 0x726f6d65;\n    local_da = 0;\n    FUN_000812d0("%s",&local_e8);\n    __n = *(size_t *)(param_1 + 0xc);\n    __dest = (char *)0x0;\n  }\n  else {\n    __size = 1;\n    if (sVar3 != 0) {\n      __size = sVar3;\n    }\n    __dest = (char *)malloc(__size);\n    if (__dest == (char *)0x0) goto LAB_0001ed30;\n  }\n  __src = *(char **)(param_1 + 8);\n  memcpy(__dest,__src,__n);\n  if (__n != 0) {\n    memset(__src,0,__n);\n    cVar1 = *__src;\n    while (cVar1 != '\0') {\n      __src = __src + 1;\n      cVar1 = *__src;\n    }\n    __src = *(char **)(param_1 + 8);\n    if (__src == (char *)0x0) {\n      *(char **)(param_1 + 8) = __dest;\n      *(size_t *)(param_1 + 0xc) = sVar3;\n      goto LAB_0001ec78;\n    }\n  }\n  free(__src);\n  *(char **)(param_1 + 8) = __dest;\n  *(size_t *)(param_1 + 0xc) = sVar3;\nLAB_0001ec78:\n  strcpy(__dest,param_2);\n  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return;\n  }\n                    \n  FUN_00089270();\n}" ({ "{") (declaration "char cVar1;" (primitive_type "char") (identifier "cVar1") (; ";")) (declaration "int iVar2;" (primitive_type "int") (identifier "iVar2") (; ";")) (declaration "size_t sVar3;" (primitive_type "size_t") (identifier "sVar3") (; ";")) (declaration "int iVar4;" (primitive_type "int") (identifier "iVar4") (; ";")) (declaration "size_t __size;" (primitive_type "size_t") (identifier "__size") (; ";")) (declaration "char *__dest;" (primitive_type "char") (pointer_declarator "*__dest" (* "*") (identifier "__dest")) (; ";")) (declaration "size_t __n;" (primitive_type "size_t") (identifier "__n") (; ";")) (declaration "char *__src;" (primitive_type "char") (pointer_declarator "*__src" (* "*") (identifier "__src")) (; ";")) (declaration "int in_GS_OFFSET;" (primitive_type "int") (identifier "in_GS_OFFSET") (; ";")) (declaration "undefined4 local_e8;" (type_identifier "undefined4") (identifier "local_e8") (; ";")) (declaration "undefined4 local_e4;" (type_identifier "undefined4") (identifier "local_e4") (; ";")) (declaration "undefined4 local_e0;" (type_identifier "undefined4") (identifier "local_e0") (; ";")) (declaration "undefined2 local_dc;" (type_identifier "undefined2") (identifier "local_dc") (; ";")) (declaration "undefined1 local_da;" (type_identifier "undefined1") (identifier "local_da") (; ";")) (declaration "int local_20;" (primitive_type "int") (identifier "local_20") (; ";")) (declaration "undefined4 uStack_14;" (type_identifier "undefined4") (identifier "uStack_14") (; ";")) (expression_statement "uStack_14 = 0x1ec39;" (assignment_expression "uStack_14 = 0x1ec39" (identifier "uStack_14") (= "=") (number_literal "0x1ec39")) (; ";")) (expression_statement "local_20 = *(int *)(in_GS_OFFSET + 0x14);" (assignment_expression "local_20 = *(int *)(in_GS_OFFSET + 0x14)" (identifier "local_20") (= "=") (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" (* "*") (cast_expression "(int *)(in_GS_OFFSET + 0x14)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(in_GS_OFFSET + 0x14)" (( "(") (binary_expression "in_GS_OFFSET + 0x14" (identifier "in_GS_OFFSET") (+ "+") (number_literal "0x14")) () ")"))))) (; ";")) (expression_statement "sVar3 = strlen(param_2);" (assignment_expression "sVar3 = strlen(param_2)" (identifier "sVar3") (= "=") (call_expression "strlen(param_2)" (identifier "strlen") (argument_list "(param_2)" (( "(") (identifier "param_2") () ")")))) (; ";")) (expression_statement "__n = *(size_t *)(param_1 + 0xc);" (assignment_expression "__n = *(size_t *)(param_1 + 0xc)" (identifier "__n") (= "=") (pointer_expression "*(size_t *)(param_1 + 0xc)" (* "*") (cast_expression "(size_t *)(param_1 + 0xc)" (( "(") (type_descriptor "size_t *" (primitive_type "size_t") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 0xc)" (( "(") (binary_expression "param_1 + 0xc" (identifier "param_1") (+ "+") (number_literal "0xc")) () ")"))))) (; ";")) (if_statement "if ((int)(sVar3 + 1) <= (int)__n) {\n    __dest = *(char **)(param_1 + 8);\n    goto LAB_0001ec78;\n  }" (if "if") (parenthesized_expression "((int)(sVar3 + 1) <= (int)__n)" (( "(") (binary_expression "(int)(sVar3 + 1) <= (int)__n" (cast_expression "(int)(sVar3 + 1)" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (parenthesized_expression "(sVar3 + 1)" (( "(") (binary_expression "sVar3 + 1" (identifier "sVar3") (+ "+") (number_literal "1")) () ")"))) (<= "<=") (cast_expression "(int)__n" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (identifier "__n"))) () ")")) (compound_statement "{\n    __dest = *(char **)(param_1 + 8);\n    goto LAB_0001ec78;\n  }" ({ "{") (expression_statement "__dest = *(char **)(param_1 + 8);" (assignment_expression "__dest = *(char **)(param_1 + 8)" (identifier "__dest") (= "=") (pointer_expression "*(char **)(param_1 + 8)" (* "*") (cast_expression "(char **)(param_1 + 8)" (( "(") (type_descriptor "char **" (primitive_type "char") (abstract_pointer_declarator "**" (* "*") (abstract_pointer_declarator "*" (* "*")))) () ")") (parenthesized_expression "(param_1 + 8)" (( "(") (binary_expression "param_1 + 8" (identifier "param_1") (+ "+") (number_literal "8")) () ")"))))) (; ";")) (goto_statement "goto LAB_0001ec78;" (goto "goto") (statement_identifier "LAB_0001ec78") (; ";")) (} "}"))) (expression_statement "iVar2 = (sVar3 + 1) * 5;" (assignment_expression "iVar2 = (sVar3 + 1) * 5" (identifier "iVar2") (= "=") (binary_expression "(sVar3 + 1) * 5" (parenthesized_expression "(sVar3 + 1)" (( "(") (binary_expression "sVar3 + 1" (identifier "sVar3") (+ "+") (number_literal "1")) () ")")) (* "*") (number_literal "5"))) (; ";")) (expression_statement "iVar4 = iVar2 + 3;" (assignment_expression "iVar4 = iVar2 + 3" (identifier "iVar4") (= "=") (binary_expression "iVar2 + 3" (identifier "iVar2") (+ "+") (number_literal "3"))) (; ";")) (if_statement "if (-1 < iVar2) {\n    iVar4 = iVar2;\n  }" (if "if") (parenthesized_expression "(-1 < iVar2)" (( "(") (binary_expression "-1 < iVar2" (number_literal "-1") (< "<") (identifier "iVar2")) () ")")) (compound_statement "{\n    iVar4 = iVar2;\n  }" ({ "{") (expression_statement "iVar4 = iVar2;" (assignment_expression "iVar4 = iVar2" (identifier "iVar4") (= "=") (identifier "iVar2")) (; ";")) (} "}"))) (expression_statement "sVar3 = (iVar4 >> 2) + 0x200;" (assignment_expression "sVar3 = (iVar4 >> 2) + 0x200" (identifier "sVar3") (= "=") (binary_expression "(iVar4 >> 2) + 0x200" (parenthesized_expression "(iVar4 >> 2)" (( "(") (binary_expression "iVar4 >> 2" (identifier "iVar4") (>> ">>") (number_literal "2")) () ")")) (+ "+") (number_literal "0x200"))) (; ";")) (if_statement "if ((int)sVar3 < 0) {\nLAB_0001ed30:\n    local_e8 = 0x2074754f;\n    local_dc = 0x2179;\n    local_e4 = 0x6d20666f;\n    local_e0 = 0x726f6d65;\n    local_da = 0;\n    FUN_000812d0("%s",&local_e8);\n    __n = *(size_t *)(param_1 + 0xc);\n    __dest = (char *)0x0;\n  }\n  else {\n    __size = 1;\n    if (sVar3 != 0) {\n      __size = sVar3;\n    }\n    __dest = (char *)malloc(__size);\n    if (__dest == (char *)0x0) goto LAB_0001ed30;\n  }" (if "if") (parenthesized_expression "((int)sVar3 < 0)" (( "(") (binary_expression "(int)sVar3 < 0" (cast_expression "(int)sVar3" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (identifier "sVar3")) (< "<") (number_literal "0")) () ")")) (compound_statement "{\nLAB_0001ed30:\n    local_e8 = 0x2074754f;\n    local_dc = 0x2179;\n    local_e4 = 0x6d20666f;\n    local_e0 = 0x726f6d65;\n    local_da = 0;\n    FUN_000812d0("%s",&local_e8);\n    __n = *(size_t *)(param_1 + 0xc);\n    __dest = (char *)0x0;\n  }" ({ "{") (labeled_statement "LAB_0001ed30:\n    local_e8 = 0x2074754f;" (statement_identifier "LAB_0001ed30") (: ":") (expression_statement "local_e8 = 0x2074754f;" (assignment_expression "local_e8 = 0x2074754f" (identifier "local_e8") (= "=") (number_literal "0x2074754f")) (; ";"))) (expression_statement "local_dc = 0x2179;" (assignment_expression "local_dc = 0x2179" (identifier "local_dc") (= "=") (number_literal "0x2179")) (; ";")) (expression_statement "local_e4 = 0x6d20666f;" (assignment_expression "local_e4 = 0x6d20666f" (identifier "local_e4") (= "=") (number_literal "0x6d20666f")) (; ";")) (expression_statement "local_e0 = 0x726f6d65;" (assignment_expression "local_e0 = 0x726f6d65" (identifier "local_e0") (= "=") (number_literal "0x726f6d65")) (; ";")) (expression_statement "local_da = 0;" (assignment_expression "local_da = 0" (identifier "local_da") (= "=") (number_literal "0")) (; ";")) (expression_statement "FUN_000812d0("%s",&local_e8);" (call_expression "FUN_000812d0("%s",&local_e8)" (identifier "FUN_000812d0") (argument_list "("%s",&local_e8)" (( "(") (string_literal ""%s"" (" """) (string_content "%s") (" """)) (, ",") (pointer_expression "&local_e8" (& "&") (identifier "local_e8")) () ")"))) (; ";")) (expression_statement "__n = *(size_t *)(param_1 + 0xc);" (assignment_expression "__n = *(size_t *)(param_1 + 0xc)" (identifier "__n") (= "=") (pointer_expression "*(size_t *)(param_1 + 0xc)" (* "*") (cast_expression "(size_t *)(param_1 + 0xc)" (( "(") (type_descriptor "size_t *" (primitive_type "size_t") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 0xc)" (( "(") (binary_expression "param_1 + 0xc" (identifier "param_1") (+ "+") (number_literal "0xc")) () ")"))))) (; ";")) (expression_statement "__dest = (char *)0x0;" (assignment_expression "__dest = (char *)0x0" (identifier "__dest") (= "=") (cast_expression "(char *)0x0" (( "(") (type_descriptor "char *" (primitive_type "char") (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0x0"))) (; ";")) (} "}")) (else_clause "else {\n    __size = 1;\n    if (sVar3 != 0) {\n      __size = sVar3;\n    }\n    __dest = (char *)malloc(__size);\n    if (__dest == (char *)0x0) goto LAB_0001ed30;\n  }" (else "else") (compound_statement "{\n    __size = 1;\n    if (sVar3 != 0) {\n      __size = sVar3;\n    }\n    __dest = (char *)malloc(__size);\n    if (__dest == (char *)0x0) goto LAB_0001ed30;\n  }" ({ "{") (expression_statement "__size = 1;" (assignment_expression "__size = 1" (identifier "__size") (= "=") (number_literal "1")) (; ";")) (if_statement "if (sVar3 != 0) {\n      __size = sVar3;\n    }" (if "if") (parenthesized_expression "(sVar3 != 0)" (( "(") (binary_expression "sVar3 != 0" (identifier "sVar3") (!= "!=") (number_literal "0")) () ")")) (compound_statement "{\n      __size = sVar3;\n    }" ({ "{") (expression_statement "__size = sVar3;" (assignment_expression "__size = sVar3" (identifier "__size") (= "=") (identifier "sVar3")) (; ";")) (} "}"))) (expression_statement "__dest = (char *)malloc(__size);" (assignment_expression "__dest = (char *)malloc(__size)" (identifier "__dest") (= "=") (cast_expression "(char *)malloc(__size)" (( "(") (type_descriptor "char *" (primitive_type "char") (abstract_pointer_declarator "*" (* "*"))) () ")") (call_expression "malloc(__size)" (identifier "malloc") (argument_list "(__size)" (( "(") (identifier "__size") () ")"))))) (; ";")) (if_statement "if (__dest == (char *)0x0) goto LAB_0001ed30;" (if "if") (parenthesized_expression "(__dest == (char *)0x0)" (( "(") (binary_expression "__dest == (char *)0x0" (identifier "__dest") (== "==") (cast_expression "(char *)0x0" (( "(") (type_descriptor "char *" (primitive_type "char") (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0x0"))) () ")")) (goto_statement "goto LAB_0001ed30;" (goto "goto") (statement_identifier "LAB_0001ed30") (; ";"))) (} "}")))) (expression_statement "__src = *(char **)(param_1 + 8);" (assignment_expression "__src = *(char **)(param_1 + 8)" (identifier "__src") (= "=") (pointer_expression "*(char **)(param_1 + 8)" (* "*") (cast_expression "(char **)(param_1 + 8)" (( "(") (type_descriptor "char **" (primitive_type "char") (abstract_pointer_declarator "**" (* "*") (abstract_pointer_declarator "*" (* "*")))) () ")") (parenthesized_expression "(param_1 + 8)" (( "(") (binary_expression "param_1 + 8" (identifier "param_1") (+ "+") (number_literal "8")) () ")"))))) (; ";")) (expression_statement "memcpy(__dest,__src,__n);" (call_expression "memcpy(__dest,__src,__n)" (identifier "memcpy") (argument_list "(__dest,__src,__n)" (( "(") (identifier "__dest") (, ",") (identifier "__src") (, ",") (identifier "__n") () ")"))) (; ";")) (if_statement "if (__n != 0) {\n    memset(__src,0,__n);\n    cVar1 = *__src;\n    while (cVar1 != '\0') {\n      __src = __src + 1;\n      cVar1 = *__src;\n    }\n    __src = *(char **)(param_1 + 8);\n    if (__src == (char *)0x0) {\n      *(char **)(param_1 + 8) = __dest;\n      *(size_t *)(param_1 + 0xc) = sVar3;\n      goto LAB_0001ec78;\n    }\n  }" (if "if") (parenthesized_expression "(__n != 0)" (( "(") (binary_expression "__n != 0" (identifier "__n") (!= "!=") (number_literal "0")) () ")")) (compound_statement "{\n    memset(__src,0,__n);\n    cVar1 = *__src;\n    while (cVar1 != '\0') {\n      __src = __src + 1;\n      cVar1 = *__src;\n    }\n    __src = *(char **)(param_1 + 8);\n    if (__src == (char *)0x0) {\n      *(char **)(param_1 + 8) = __dest;\n      *(size_t *)(param_1 + 0xc) = sVar3;\n      goto LAB_0001ec78;\n    }\n  }" ({ "{") (expression_statement "memset(__src,0,__n);" (call_expression "memset(__src,0,__n)" (identifier "memset") (argument_list "(__src,0,__n)" (( "(") (identifier "__src") (, ",") (number_literal "0") (, ",") (identifier "__n") () ")"))) (; ";")) (expression_statement "cVar1 = *__src;" (assignment_expression "cVar1 = *__src" (identifier "cVar1") (= "=") (pointer_expression "*__src" (* "*") (identifier "__src"))) (; ";")) (while_statement "while (cVar1 != '\0') {\n      __src = __src + 1;\n      cVar1 = *__src;\n    }" (while "while") (parenthesized_expression "(cVar1 != '\0')" (( "(") (binary_expression "cVar1 != '\0'" (identifier "cVar1") (!= "!=") (char_literal "'\0'" (' "'") (escape_sequence "\0") (' "'"))) () ")")) (compound_statement "{\n      __src = __src + 1;\n      cVar1 = *__src;\n    }" ({ "{") (expression_statement "__src = __src + 1;" (assignment_expression "__src = __src + 1" (identifier "__src") (= "=") (binary_expression "__src + 1" (identifier "__src") (+ "+") (number_literal "1"))) (; ";")) (expression_statement "cVar1 = *__src;" (assignment_expression "cVar1 = *__src" (identifier "cVar1") (= "=") (pointer_expression "*__src" (* "*") (identifier "__src"))) (; ";")) (} "}"))) (expression_statement "__src = *(char **)(param_1 + 8);" (assignment_expression "__src = *(char **)(param_1 + 8)" (identifier "__src") (= "=") (pointer_expression "*(char **)(param_1 + 8)" (* "*") (cast_expression "(char **)(param_1 + 8)" (( "(") (type_descriptor "char **" (primitive_type "char") (abstract_pointer_declarator "**" (* "*") (abstract_pointer_declarator "*" (* "*")))) () ")") (parenthesized_expression "(param_1 + 8)" (( "(") (binary_expression "param_1 + 8" (identifier "param_1") (+ "+") (number_literal "8")) () ")"))))) (; ";")) (if_statement "if (__src == (char *)0x0) {\n      *(char **)(param_1 + 8) = __dest;\n      *(size_t *)(param_1 + 0xc) = sVar3;\n      goto LAB_0001ec78;\n    }" (if "if") (parenthesized_expression "(__src == (char *)0x0)" (( "(") (binary_expression "__src == (char *)0x0" (identifier "__src") (== "==") (cast_expression "(char *)0x0" (( "(") (type_descriptor "char *" (primitive_type "char") (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0x0"))) () ")")) (compound_statement "{\n      *(char **)(param_1 + 8) = __dest;\n      *(size_t *)(param_1 + 0xc) = sVar3;\n      goto LAB_0001ec78;\n    }" ({ "{") (expression_statement "*(char **)(param_1 + 8) = __dest;" (assignment_expression "*(char **)(param_1 + 8) = __dest" (pointer_expression "*(char **)(param_1 + 8)" (* "*") (cast_expression "(char **)(param_1 + 8)" (( "(") (type_descriptor "char **" (primitive_type "char") (abstract_pointer_declarator "**" (* "*") (abstract_pointer_declarator "*" (* "*")))) () ")") (parenthesized_expression "(param_1 + 8)" (( "(") (binary_expression "param_1 + 8" (identifier "param_1") (+ "+") (number_literal "8")) () ")")))) (= "=") (identifier "__dest")) (; ";")) (expression_statement "*(size_t *)(param_1 + 0xc) = sVar3;" (assignment_expression "*(size_t *)(param_1 + 0xc) = sVar3" (pointer_expression "*(size_t *)(param_1 + 0xc)" (* "*") (cast_expression "(size_t *)(param_1 + 0xc)" (( "(") (type_descriptor "size_t *" (primitive_type "size_t") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 0xc)" (( "(") (binary_expression "param_1 + 0xc" (identifier "param_1") (+ "+") (number_literal "0xc")) () ")")))) (= "=") (identifier "sVar3")) (; ";")) (goto_statement "goto LAB_0001ec78;" (goto "goto") (statement_identifier "LAB_0001ec78") (; ";")) (} "}"))) (} "}"))) (expression_statement "free(__src);" (call_expression "free(__src)" (identifier "free") (argument_list "(__src)" (( "(") (identifier "__src") () ")"))) (; ";")) (expression_statement "*(char **)(param_1 + 8) = __dest;" (assignment_expression "*(char **)(param_1 + 8) = __dest" (pointer_expression "*(char **)(param_1 + 8)" (* "*") (cast_expression "(char **)(param_1 + 8)" (( "(") (type_descriptor "char **" (primitive_type "char") (abstract_pointer_declarator "**" (* "*") (abstract_pointer_declarator "*" (* "*")))) () ")") (parenthesized_expression "(param_1 + 8)" (( "(") (binary_expression "param_1 + 8" (identifier "param_1") (+ "+") (number_literal "8")) () ")")))) (= "=") (identifier "__dest")) (; ";")) (expression_statement "*(size_t *)(param_1 + 0xc) = sVar3;" (assignment_expression "*(size_t *)(param_1 + 0xc) = sVar3" (pointer_expression "*(size_t *)(param_1 + 0xc)" (* "*") (cast_expression "(size_t *)(param_1 + 0xc)" (( "(") (type_descriptor "size_t *" (primitive_type "size_t") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 0xc)" (( "(") (binary_expression "param_1 + 0xc" (identifier "param_1") (+ "+") (number_literal "0xc")) () ")")))) (= "=") (identifier "sVar3")) (; ";")) (labeled_statement "LAB_0001ec78:\n  strcpy(__dest,param_2);" (statement_identifier "LAB_0001ec78") (: ":") (expression_statement "strcpy(__dest,param_2);" (call_expression "strcpy(__dest,param_2)" (identifier "strcpy") (argument_list "(__dest,param_2)" (( "(") (identifier "__dest") (, ",") (identifier "param_2") () ")"))) (; ";"))) (if_statement "if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return;\n  }" (if "if") (parenthesized_expression "(local_20 == *(int *)(in_GS_OFFSET + 0x14))" (( "(") (binary_expression "local_20 == *(int *)(in_GS_OFFSET + 0x14)" (identifier "local_20") (== "==") (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" (* "*") (cast_expression "(int *)(in_GS_OFFSET + 0x14)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(in_GS_OFFSET + 0x14)" (( "(") (binary_expression "in_GS_OFFSET + 0x14" (identifier "in_GS_OFFSET") (+ "+") (number_literal "0x14")) () ")"))))) () ")")) (compound_statement "{\n    return;\n  }" ({ "{") (return_statement "return;" (return "return") (; ";")) (} "}"))) (expression_statement "FUN_00089270();" (call_expression "FUN_00089270()" (identifier "FUN_00089270") (argument_list "()" (( "(") () ")"))) (; ";")) (} "}")))

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

void function_1(type_1 *pr,char *newstr)

{
  int var_17;
  char var_13;
  int var_4;
  size_t var_3;
  int var_5;
  size_t __size;
  char *var_9;
  size_t var_11;
  char *var_14;
  int var_1;
  char str [200];
  
  var_17 = *(int *)(var_1 + 0x14);
  var_3 = var_2(newstr);
  var_11 = pr->resultsize;
  if ((int)(var_3 + 1) <= (int)var_11) {
    var_9 = pr->result;
    goto LAB_0001ec78;
  }
  var_4 = (var_3 + 1) * 5;
  var_5 = var_4 + 3;
  if (-1 < var_4) {
    var_5 = var_4;
  }
  var_3 = (var_5 >> 2) + 0x200;
  if ((int)var_3 < 0) {
LAB_0001ed30:
    var_6(str,"Out of memory!",0xf);
    var_7("%s",str);
    var_11 = pr->resultsize;
    var_9 = (char *)0x0;
  }
  else {
    __size = 1;
    if (var_3 != 0) {
      __size = var_3;
    }
    var_9 = (char *)var_8(__size);
    if (var_9 == (char *)0x0) goto LAB_0001ed30;
  }
  var_14 = pr->result;
  var_10(var_9,var_14,var_11);
  if (var_11 != 0) {
    var_12(var_14,0,var_11);
    var_13 = *var_14;
    while (var_13 != '\0') {
      var_14 = var_14 + 1;
      var_13 = *var_14;
    }
    var_14 = pr->result;
    if (var_14 == (char *)0x0) {
      pr->result = var_9;
      pr->resultsize = var_3;
      goto LAB_0001ec78;
    }
  }
  var_15(var_14);
  pr->result = var_9;
  pr->resultsize = var_3;
LAB_0001ec78:
  var_16(var_9,newstr);
  if (var_17 == *(int *)(var_1 + 0x14)) {
    return;
  }
                    /* WARNING: Subroutine does not return */
  var_18();
}


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

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

void MASKED(int param_1,char *param_2)

{
  char cVar1;
  int iVar2;
  size_t sVar3;
  int iVar4;
  size_t __size;
  char *__dest;
  size_t __n;
  char *__src;
  int in_GS_OFFSET;
  undefined4 local_e8;
  undefined4 local_e4;
  undefined4 local_e0;
  undefined2 local_dc;
  undefined1 local_da;
  int local_20;
  undefined4 uStack_14;
  
  uStack_14 = 0x1ec39;
  local_20 = *(int *)(in_GS_OFFSET + 0x14);
  sVar3 = strlen(param_2);
  __n = *(size_t *)(param_1 + 0xc);
  if ((int)(sVar3 + 1) <= (int)__n) {
    __dest = *(char **)(param_1 + 8);
    goto LAB_0001ec78;
  }
  iVar2 = (sVar3 + 1) * 5;
  iVar4 = iVar2 + 3;
  if (-1 < iVar2) {
    iVar4 = iVar2;
  }
  sVar3 = (iVar4 >> 2) + 0x200;
  if ((int)sVar3 < 0) {
LAB_0001ed30:
    local_e8 = 0x2074754f;
    local_dc = 0x2179;
    local_e4 = 0x6d20666f;
    local_e0 = 0x726f6d65;
    local_da = 0;
    FUN_000812d0("%s",&local_e8);
    __n = *(size_t *)(param_1 + 0xc);
    __dest = (char *)0x0;
  }
  else {
    __size = 1;
    if (sVar3 != 0) {
      __size = sVar3;
    }
    __dest = (char *)malloc(__size);
    if (__dest == (char *)0x0) goto LAB_0001ed30;
  }
  __src = *(char **)(param_1 + 8);
  memcpy(__dest,__src,__n);
  if (__n != 0) {
    memset(__src,0,__n);
    cVar1 = *__src;
    while (cVar1 != '\0') {
      __src = __src + 1;
      cVar1 = *__src;
    }
    __src = *(char **)(param_1 + 8);
    if (__src == (char *)0x0) {
      *(char **)(param_1 + 8) = __dest;
      *(size_t *)(param_1 + 0xc) = sVar3;
      goto LAB_0001ec78;
    }
  }
  free(__src);
  *(char **)(param_1 + 8) = __dest;
  *(size_t *)(param_1 + 0xc) = sVar3;
LAB_0001ec78:
  strcpy(__dest,param_2);
  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {
    return;
  }
                    /* WARNING: Subroutine does not return */
  FUN_00089270();
}

