
void prompt_ensure_result_size(prompt_t *pr,int newlen)

{
  int iVar1;
  
  if (newlen <= (int)pr->resultsize) {
    return;
  }
  iVar1 = newlen * 5;
  if (iVar1 < 0) {
    iVar1 = iVar1 + 3;
  }
                    /* WARNING: Subroutine does not return */
  safemalloc((iVar1 >> 2) + 0x200,1);
}



void prompt_ensure_result_size(int param_1,int param_2)

{
  undefined4 uVar1;
  int iVar2;
  
  if (param_2 <= *(int *)(param_1 + 0xc)) {
    return;
  }
  param_2 = param_2 * 5;
  if (param_2 < 0) {
    param_2 = param_2 + 3;
  }
  iVar2 = (param_2 >> 2) + 0x200;
  uVar1 = safemalloc(iVar2,1);
  (*(code *)PTR_memcpy_000bccdc)(uVar1,*(undefined4 *)(param_1 + 8),*(undefined4 *)(param_1 + 0xc));
  smemclr(*(undefined4 *)(param_1 + 8),*(undefined4 *)(param_1 + 0xc));
  safefree(*(undefined4 *)(param_1 + 8));
  *(undefined4 *)(param_1 + 8) = uVar1;
  *(int *)(param_1 + 0xc) = iVar2;
  return;
}


lui gp,0xa
addiu gp,gp,0x1dc8
addu gp,gp,t9
lw v0,0xc(a0)
slt v0,v0,a1
bne v0,zero,0x000223ac
_sll v0,a1,0x2
jr ra
_nop
addu a1,v0,a1
bltz a1,0x00022460
_nop
addiu sp,sp,-0x28
sw ra,0x24(sp)
sw s2,0x20(sp)
sw s1,0x1c(sp)
sw s0,0x18(sp)
sw gp,0x10(sp)
or s0,a0,zero
sra a1,a1,0x2
addiu s1,a1,0x200
li a1,0x1
or a0,s1,zero
lw t9,-0x7f9c(gp)
bal 0x00021328
_nop
lw gp,0x10(sp)
or s2,v0,zero
lw a2,0xc(s0)
lw a1,0x8(s0)
or a0,v0,zero
lw t9,-0x7474(gp)
jalr t9
_nop
lw gp,0x10(sp)
lw a1,0xc(s0)
lw a0,0x8(s0)
lw t9,-0x7f6c(gp)
bal 0x00022308
_nop
lw gp,0x10(sp)
lw a0,0x8(s0)
lw t9,-0x7fac(gp)
bal 0x00021e38
_nop
lw gp,0x10(sp)
sw s2,0x8(s0)
sw s1,0xc(s0)
lw ra,0x24(sp)
lw s2,0x20(sp)
lw s1,0x1c(sp)
lw s0,0x18(sp)
jr ra
_addiu sp,sp,0x28
b 0x000223b8
_addiu a1,a1,0x3
(translation_unit "void prompt_ensure_result_size(int param_1,int param_2)\n\n{\n  undefined4 uVar1;\n  int iVar2;\n  \n  if (param_2 <= *(int *)(param_1 + 0xc)) {\n    return;\n  }\n  param_2 = param_2 * 5;\n  if (param_2 < 0) {\n    param_2 = param_2 + 3;\n  }\n  iVar2 = (param_2 >> 2) + 0x200;\n  uVar1 = safemalloc(iVar2,1);\n  (*(code *)PTR_memcpy_000bccdc)(uVar1,*(undefined4 *)(param_1 + 8),*(undefined4 *)(param_1 + 0xc));\n  smemclr(*(undefined4 *)(param_1 + 8),*(undefined4 *)(param_1 + 0xc));\n  safefree(*(undefined4 *)(param_1 + 8));\n  *(undefined4 *)(param_1 + 8) = uVar1;\n  *(int *)(param_1 + 0xc) = iVar2;\n  return;\n}\n\n" (function_definition "void prompt_ensure_result_size(int param_1,int param_2)\n\n{\n  undefined4 uVar1;\n  int iVar2;\n  \n  if (param_2 <= *(int *)(param_1 + 0xc)) {\n    return;\n  }\n  param_2 = param_2 * 5;\n  if (param_2 < 0) {\n    param_2 = param_2 + 3;\n  }\n  iVar2 = (param_2 >> 2) + 0x200;\n  uVar1 = safemalloc(iVar2,1);\n  (*(code *)PTR_memcpy_000bccdc)(uVar1,*(undefined4 *)(param_1 + 8),*(undefined4 *)(param_1 + 0xc));\n  smemclr(*(undefined4 *)(param_1 + 8),*(undefined4 *)(param_1 + 0xc));\n  safefree(*(undefined4 *)(param_1 + 8));\n  *(undefined4 *)(param_1 + 8) = uVar1;\n  *(int *)(param_1 + 0xc) = iVar2;\n  return;\n}" primitive_type (function_declarator "prompt_ensure_result_size(int param_1,int param_2)" identifier (parameter_list "(int param_1,int param_2)" ( (parameter_declaration "int param_1" primitive_type identifier) , (parameter_declaration "int param_2" primitive_type identifier) ))) (compound_statement "{\n  undefined4 uVar1;\n  int iVar2;\n  \n  if (param_2 <= *(int *)(param_1 + 0xc)) {\n    return;\n  }\n  param_2 = param_2 * 5;\n  if (param_2 < 0) {\n    param_2 = param_2 + 3;\n  }\n  iVar2 = (param_2 >> 2) + 0x200;\n  uVar1 = safemalloc(iVar2,1);\n  (*(code *)PTR_memcpy_000bccdc)(uVar1,*(undefined4 *)(param_1 + 8),*(undefined4 *)(param_1 + 0xc));\n  smemclr(*(undefined4 *)(param_1 + 8),*(undefined4 *)(param_1 + 0xc));\n  safefree(*(undefined4 *)(param_1 + 8));\n  *(undefined4 *)(param_1 + 8) = uVar1;\n  *(int *)(param_1 + 0xc) = iVar2;\n  return;\n}" { (declaration "undefined4 uVar1;" type_identifier identifier ;) (declaration "int iVar2;" primitive_type identifier ;) (if_statement "if (param_2 <= *(int *)(param_1 + 0xc)) {\n    return;\n  }" if (parenthesized_expression "(param_2 <= *(int *)(param_1 + 0xc))" ( (binary_expression "param_2 <= *(int *)(param_1 + 0xc)" identifier <= (pointer_expression "*(int *)(param_1 + 0xc)" * (cast_expression "(int *)(param_1 + 0xc)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0xc)" ( (binary_expression "param_1 + 0xc" identifier + number_literal) ))))) )) (compound_statement "{\n    return;\n  }" { (return_statement "return;" return ;) })) (expression_statement "param_2 = param_2 * 5;" (assignment_expression "param_2 = param_2 * 5" identifier = (binary_expression "param_2 * 5" identifier * number_literal)) ;) (if_statement "if (param_2 < 0) {\n    param_2 = param_2 + 3;\n  }" if (parenthesized_expression "(param_2 < 0)" ( (binary_expression "param_2 < 0" identifier < number_literal) )) (compound_statement "{\n    param_2 = param_2 + 3;\n  }" { (expression_statement "param_2 = param_2 + 3;" (assignment_expression "param_2 = param_2 + 3" identifier = (binary_expression "param_2 + 3" identifier + number_literal)) ;) })) (expression_statement "iVar2 = (param_2 >> 2) + 0x200;" (assignment_expression "iVar2 = (param_2 >> 2) + 0x200" identifier = (binary_expression "(param_2 >> 2) + 0x200" (parenthesized_expression "(param_2 >> 2)" ( (binary_expression "param_2 >> 2" identifier >> number_literal) )) + number_literal)) ;) (expression_statement "uVar1 = safemalloc(iVar2,1);" (assignment_expression "uVar1 = safemalloc(iVar2,1)" identifier = (call_expression "safemalloc(iVar2,1)" identifier (argument_list "(iVar2,1)" ( identifier , number_literal )))) ;) (expression_statement "(*(code *)PTR_memcpy_000bccdc)(uVar1,*(undefined4 *)(param_1 + 8),*(undefined4 *)(param_1 + 0xc));" (call_expression "(*(code *)PTR_memcpy_000bccdc)(uVar1,*(undefined4 *)(param_1 + 8),*(undefined4 *)(param_1 + 0xc))" (parenthesized_expression "(*(code *)PTR_memcpy_000bccdc)" ( (pointer_expression "*(code *)PTR_memcpy_000bccdc" * (cast_expression "(code *)PTR_memcpy_000bccdc" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(uVar1,*(undefined4 *)(param_1 + 8),*(undefined4 *)(param_1 + 0xc))" ( identifier , (pointer_expression "*(undefined4 *)(param_1 + 8)" * (cast_expression "(undefined4 *)(param_1 + 8)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 8)" ( (binary_expression "param_1 + 8" identifier + number_literal) )))) , (pointer_expression "*(undefined4 *)(param_1 + 0xc)" * (cast_expression "(undefined4 *)(param_1 + 0xc)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0xc)" ( (binary_expression "param_1 + 0xc" identifier + number_literal) )))) ))) ;) (expression_statement "smemclr(*(undefined4 *)(param_1 + 8),*(undefined4 *)(param_1 + 0xc));" (call_expression "smemclr(*(undefined4 *)(param_1 + 8),*(undefined4 *)(param_1 + 0xc))" identifier (argument_list "(*(undefined4 *)(param_1 + 8),*(undefined4 *)(param_1 + 0xc))" ( (pointer_expression "*(undefined4 *)(param_1 + 8)" * (cast_expression "(undefined4 *)(param_1 + 8)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 8)" ( (binary_expression "param_1 + 8" identifier + number_literal) )))) , (pointer_expression "*(undefined4 *)(param_1 + 0xc)" * (cast_expression "(undefined4 *)(param_1 + 0xc)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0xc)" ( (binary_expression "param_1 + 0xc" identifier + number_literal) )))) ))) ;) (expression_statement "safefree(*(undefined4 *)(param_1 + 8));" (call_expression "safefree(*(undefined4 *)(param_1 + 8))" identifier (argument_list "(*(undefined4 *)(param_1 + 8))" ( (pointer_expression "*(undefined4 *)(param_1 + 8)" * (cast_expression "(undefined4 *)(param_1 + 8)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 8)" ( (binary_expression "param_1 + 8" identifier + number_literal) )))) ))) ;) (expression_statement "*(undefined4 *)(param_1 + 8) = uVar1;" (assignment_expression "*(undefined4 *)(param_1 + 8) = uVar1" (pointer_expression "*(undefined4 *)(param_1 + 8)" * (cast_expression "(undefined4 *)(param_1 + 8)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 8)" ( (binary_expression "param_1 + 8" identifier + number_literal) )))) = identifier) ;) (expression_statement "*(int *)(param_1 + 0xc) = iVar2;" (assignment_expression "*(int *)(param_1 + 0xc) = iVar2" (pointer_expression "*(int *)(param_1 + 0xc)" * (cast_expression "(int *)(param_1 + 0xc)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0xc)" ( (binary_expression "param_1 + 0xc" identifier + number_literal) )))) = identifier) ;) (return_statement "return;" return ;) })))
(translation_unit "void prompt_ensure_result_size(prompt_t *pr,int newlen)\n\n{\n  int iVar1;\n  \n  if (newlen <= (int)pr->resultsize) {\n    return;\n  }\n  iVar1 = newlen * 5;\n  if (iVar1 < 0) {\n    iVar1 = iVar1 + 3;\n  }\n                    /* WARNING: Subroutine does not return */\n  safemalloc((iVar1 >> 2) + 0x200,1);\n}\n\n" (function_definition "void prompt_ensure_result_size(prompt_t *pr,int newlen)\n\n{\n  int iVar1;\n  \n  if (newlen <= (int)pr->resultsize) {\n    return;\n  }\n  iVar1 = newlen * 5;\n  if (iVar1 < 0) {\n    iVar1 = iVar1 + 3;\n  }\n                    /* WARNING: Subroutine does not return */\n  safemalloc((iVar1 >> 2) + 0x200,1);\n}" primitive_type (function_declarator "prompt_ensure_result_size(prompt_t *pr,int newlen)" identifier (parameter_list "(prompt_t *pr,int newlen)" ( (parameter_declaration "prompt_t *pr" type_identifier (pointer_declarator "*pr" * identifier)) , (parameter_declaration "int newlen" primitive_type identifier) ))) (compound_statement "{\n  int iVar1;\n  \n  if (newlen <= (int)pr->resultsize) {\n    return;\n  }\n  iVar1 = newlen * 5;\n  if (iVar1 < 0) {\n    iVar1 = iVar1 + 3;\n  }\n                    /* WARNING: Subroutine does not return */\n  safemalloc((iVar1 >> 2) + 0x200,1);\n}" { (declaration "int iVar1;" primitive_type identifier ;) (if_statement "if (newlen <= (int)pr->resultsize) {\n    return;\n  }" if (parenthesized_expression "(newlen <= (int)pr->resultsize)" ( (binary_expression "newlen <= (int)pr->resultsize" identifier <= (cast_expression "(int)pr->resultsize" ( (type_descriptor "int" primitive_type) ) (field_expression "pr->resultsize" identifier -> field_identifier))) )) (compound_statement "{\n    return;\n  }" { (return_statement "return;" return ;) })) (expression_statement "iVar1 = newlen * 5;" (assignment_expression "iVar1 = newlen * 5" identifier = (binary_expression "newlen * 5" identifier * number_literal)) ;) (if_statement "if (iVar1 < 0) {\n    iVar1 = iVar1 + 3;\n  }" if (parenthesized_expression "(iVar1 < 0)" ( (binary_expression "iVar1 < 0" identifier < number_literal) )) (compound_statement "{\n    iVar1 = iVar1 + 3;\n  }" { (expression_statement "iVar1 = iVar1 + 3;" (assignment_expression "iVar1 = iVar1 + 3" identifier = (binary_expression "iVar1 + 3" identifier + number_literal)) ;) })) comment (expression_statement "safemalloc((iVar1 >> 2) + 0x200,1);" (call_expression "safemalloc((iVar1 >> 2) + 0x200,1)" identifier (argument_list "((iVar1 >> 2) + 0x200,1)" ( (binary_expression "(iVar1 >> 2) + 0x200" (parenthesized_expression "(iVar1 >> 2)" ( (binary_expression "iVar1 >> 2" identifier >> number_literal) )) + number_literal) , number_literal ))) ;) })))
(translation_unit "void prompt_ensure_result_size(int param_1,int param_2)\n\n{\n  undefined4 uVar1;\n  int iVar2;\n  \n  if (param_2 <= *(int *)(param_1 + 0xc)) {\n    return;\n  }\n  param_2 = param_2 * 5;\n  if (param_2 < 0) {\n    param_2 = param_2 + 3;\n  }\n  iVar2 = (param_2 >> 2) + 0x200;\n  uVar1 = safemalloc(iVar2,1);\n  (*(code *)PTR_memcpy_000bccdc)(uVar1,*(undefined4 *)(param_1 + 8),*(undefined4 *)(param_1 + 0xc));\n  smemclr(*(undefined4 *)(param_1 + 8),*(undefined4 *)(param_1 + 0xc));\n  safefree(*(undefined4 *)(param_1 + 8));\n  *(undefined4 *)(param_1 + 8) = uVar1;\n  *(int *)(param_1 + 0xc) = iVar2;\n  return;\n}\n\n" (function_definition "void prompt_ensure_result_size(int param_1,int param_2)\n\n{\n  undefined4 uVar1;\n  int iVar2;\n  \n  if (param_2 <= *(int *)(param_1 + 0xc)) {\n    return;\n  }\n  param_2 = param_2 * 5;\n  if (param_2 < 0) {\n    param_2 = param_2 + 3;\n  }\n  iVar2 = (param_2 >> 2) + 0x200;\n  uVar1 = safemalloc(iVar2,1);\n  (*(code *)PTR_memcpy_000bccdc)(uVar1,*(undefined4 *)(param_1 + 8),*(undefined4 *)(param_1 + 0xc));\n  smemclr(*(undefined4 *)(param_1 + 8),*(undefined4 *)(param_1 + 0xc));\n  safefree(*(undefined4 *)(param_1 + 8));\n  *(undefined4 *)(param_1 + 8) = uVar1;\n  *(int *)(param_1 + 0xc) = iVar2;\n  return;\n}" primitive_type (function_declarator "prompt_ensure_result_size(int param_1,int param_2)" identifier (parameter_list "(int param_1,int param_2)" ( (parameter_declaration "int param_1" primitive_type identifier) , (parameter_declaration "int param_2" primitive_type identifier) ))) (compound_statement "{\n  undefined4 uVar1;\n  int iVar2;\n  \n  if (param_2 <= *(int *)(param_1 + 0xc)) {\n    return;\n  }\n  param_2 = param_2 * 5;\n  if (param_2 < 0) {\n    param_2 = param_2 + 3;\n  }\n  iVar2 = (param_2 >> 2) + 0x200;\n  uVar1 = safemalloc(iVar2,1);\n  (*(code *)PTR_memcpy_000bccdc)(uVar1,*(undefined4 *)(param_1 + 8),*(undefined4 *)(param_1 + 0xc));\n  smemclr(*(undefined4 *)(param_1 + 8),*(undefined4 *)(param_1 + 0xc));\n  safefree(*(undefined4 *)(param_1 + 8));\n  *(undefined4 *)(param_1 + 8) = uVar1;\n  *(int *)(param_1 + 0xc) = iVar2;\n  return;\n}" { (declaration "undefined4 uVar1;" type_identifier identifier ;) (declaration "int iVar2;" primitive_type identifier ;) (if_statement "if (param_2 <= *(int *)(param_1 + 0xc)) {\n    return;\n  }" if (parenthesized_expression "(param_2 <= *(int *)(param_1 + 0xc))" ( (binary_expression "param_2 <= *(int *)(param_1 + 0xc)" identifier <= (pointer_expression "*(int *)(param_1 + 0xc)" * (cast_expression "(int *)(param_1 + 0xc)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0xc)" ( (binary_expression "param_1 + 0xc" identifier + number_literal) ))))) )) (compound_statement "{\n    return;\n  }" { (return_statement "return;" return ;) })) (expression_statement "param_2 = param_2 * 5;" (assignment_expression "param_2 = param_2 * 5" identifier = (binary_expression "param_2 * 5" identifier * number_literal)) ;) (if_statement "if (param_2 < 0) {\n    param_2 = param_2 + 3;\n  }" if (parenthesized_expression "(param_2 < 0)" ( (binary_expression "param_2 < 0" identifier < number_literal) )) (compound_statement "{\n    param_2 = param_2 + 3;\n  }" { (expression_statement "param_2 = param_2 + 3;" (assignment_expression "param_2 = param_2 + 3" identifier = (binary_expression "param_2 + 3" identifier + number_literal)) ;) })) (expression_statement "iVar2 = (param_2 >> 2) + 0x200;" (assignment_expression "iVar2 = (param_2 >> 2) + 0x200" identifier = (binary_expression "(param_2 >> 2) + 0x200" (parenthesized_expression "(param_2 >> 2)" ( (binary_expression "param_2 >> 2" identifier >> number_literal) )) + number_literal)) ;) (expression_statement "uVar1 = safemalloc(iVar2,1);" (assignment_expression "uVar1 = safemalloc(iVar2,1)" identifier = (call_expression "safemalloc(iVar2,1)" identifier (argument_list "(iVar2,1)" ( identifier , number_literal )))) ;) (expression_statement "(*(code *)PTR_memcpy_000bccdc)(uVar1,*(undefined4 *)(param_1 + 8),*(undefined4 *)(param_1 + 0xc));" (call_expression "(*(code *)PTR_memcpy_000bccdc)(uVar1,*(undefined4 *)(param_1 + 8),*(undefined4 *)(param_1 + 0xc))" (parenthesized_expression "(*(code *)PTR_memcpy_000bccdc)" ( (pointer_expression "*(code *)PTR_memcpy_000bccdc" * (cast_expression "(code *)PTR_memcpy_000bccdc" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(uVar1,*(undefined4 *)(param_1 + 8),*(undefined4 *)(param_1 + 0xc))" ( identifier , (pointer_expression "*(undefined4 *)(param_1 + 8)" * (cast_expression "(undefined4 *)(param_1 + 8)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 8)" ( (binary_expression "param_1 + 8" identifier + number_literal) )))) , (pointer_expression "*(undefined4 *)(param_1 + 0xc)" * (cast_expression "(undefined4 *)(param_1 + 0xc)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0xc)" ( (binary_expression "param_1 + 0xc" identifier + number_literal) )))) ))) ;) (expression_statement "smemclr(*(undefined4 *)(param_1 + 8),*(undefined4 *)(param_1 + 0xc));" (call_expression "smemclr(*(undefined4 *)(param_1 + 8),*(undefined4 *)(param_1 + 0xc))" identifier (argument_list "(*(undefined4 *)(param_1 + 8),*(undefined4 *)(param_1 + 0xc))" ( (pointer_expression "*(undefined4 *)(param_1 + 8)" * (cast_expression "(undefined4 *)(param_1 + 8)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 8)" ( (binary_expression "param_1 + 8" identifier + number_literal) )))) , (pointer_expression "*(undefined4 *)(param_1 + 0xc)" * (cast_expression "(undefined4 *)(param_1 + 0xc)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0xc)" ( (binary_expression "param_1 + 0xc" identifier + number_literal) )))) ))) ;) (expression_statement "safefree(*(undefined4 *)(param_1 + 8));" (call_expression "safefree(*(undefined4 *)(param_1 + 8))" identifier (argument_list "(*(undefined4 *)(param_1 + 8))" ( (pointer_expression "*(undefined4 *)(param_1 + 8)" * (cast_expression "(undefined4 *)(param_1 + 8)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 8)" ( (binary_expression "param_1 + 8" identifier + number_literal) )))) ))) ;) (expression_statement "*(undefined4 *)(param_1 + 8) = uVar1;" (assignment_expression "*(undefined4 *)(param_1 + 8) = uVar1" (pointer_expression "*(undefined4 *)(param_1 + 8)" * (cast_expression "(undefined4 *)(param_1 + 8)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 8)" ( (binary_expression "param_1 + 8" identifier + number_literal) )))) = identifier) ;) (expression_statement "*(int *)(param_1 + 0xc) = iVar2;" (assignment_expression "*(int *)(param_1 + 0xc) = iVar2" (pointer_expression "*(int *)(param_1 + 0xc)" * (cast_expression "(int *)(param_1 + 0xc)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0xc)" ( (binary_expression "param_1 + 0xc" identifier + number_literal) )))) = identifier) ;) (return_statement "return;" return ;) })))
(translation_unit (function_definition TYPE (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE IDENT) ))) (compound_statement { (declaration TYPE IDENT ;) (declaration TYPE 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 (assignment_expression IDENT = (binary_expression IDENT * LIT)) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT < LIT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (binary_expression IDENT + LIT)) ;) })) (expression_statement (assignment_expression IDENT = (binary_expression (parenthesized_expression ( (binary_expression IDENT >> LIT) )) + LIT)) ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT , LIT )))) ;) (expression_statement (call_expression (parenthesized_expression ( (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) IDENT)) )) (argument_list ( IDENT , (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) , (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) ))) ;) (expression_statement (call_expression IDENT (argument_list ( (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) , (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) ))) ;) (expression_statement (call_expression IDENT (argument_list ( (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) ))) ;) (expression_statement (assignment_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) = IDENT) ;) (expression_statement (assignment_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) = IDENT) ;) (return_statement return ;) })))
(function_definition "void prompt_ensure_result_size(int param_1,int param_2)\n\n{\n  undefined4 uVar1;\n  int iVar2;\n  \n  if (param_2 <= *(int *)(param_1 + 0xc)) {\n    return;\n  }\n  param_2 = param_2 * 5;\n  if (param_2 < 0) {\n    param_2 = param_2 + 3;\n  }\n  iVar2 = (param_2 >> 2) + 0x200;\n  uVar1 = safemalloc(iVar2,1);\n  (*(code *)PTR_memcpy_000bccdc)(uVar1,*(undefined4 *)(param_1 + 8),*(undefined4 *)(param_1 + 0xc));\n  smemclr(*(undefined4 *)(param_1 + 8),*(undefined4 *)(param_1 + 0xc));\n  safefree(*(undefined4 *)(param_1 + 8));\n  *(undefined4 *)(param_1 + 8) = uVar1;\n  *(int *)(param_1 + 0xc) = iVar2;\n  return;\n}" (primitive_type "void") (function_declarator "prompt_ensure_result_size(int param_1,int param_2)" (identifier "prompt_ensure_result_size") (parameter_list "(int param_1,int param_2)" (( "(") (parameter_declaration "int param_1" (primitive_type "int") (identifier "param_1")) (, ",") (parameter_declaration "int param_2" (primitive_type "int") (identifier "param_2")) () ")"))) (compound_statement "{\n  undefined4 uVar1;\n  int iVar2;\n  \n  if (param_2 <= *(int *)(param_1 + 0xc)) {\n    return;\n  }\n  param_2 = param_2 * 5;\n  if (param_2 < 0) {\n    param_2 = param_2 + 3;\n  }\n  iVar2 = (param_2 >> 2) + 0x200;\n  uVar1 = safemalloc(iVar2,1);\n  (*(code *)PTR_memcpy_000bccdc)(uVar1,*(undefined4 *)(param_1 + 8),*(undefined4 *)(param_1 + 0xc));\n  smemclr(*(undefined4 *)(param_1 + 8),*(undefined4 *)(param_1 + 0xc));\n  safefree(*(undefined4 *)(param_1 + 8));\n  *(undefined4 *)(param_1 + 8) = uVar1;\n  *(int *)(param_1 + 0xc) = iVar2;\n  return;\n}" ({ "{") (declaration "undefined4 uVar1;" (type_identifier "undefined4") (identifier "uVar1") (; ";")) (declaration "int iVar2;" (primitive_type "int") (identifier "iVar2") (; ";")) (if_statement "if (param_2 <= *(int *)(param_1 + 0xc)) {\n    return;\n  }" (if "if") (parenthesized_expression "(param_2 <= *(int *)(param_1 + 0xc))" (( "(") (binary_expression "param_2 <= *(int *)(param_1 + 0xc)" (identifier "param_2") (<= "<=") (pointer_expression "*(int *)(param_1 + 0xc)" (* "*") (cast_expression "(int *)(param_1 + 0xc)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 0xc)" (( "(") (binary_expression "param_1 + 0xc" (identifier "param_1") (+ "+") (number_literal "0xc")) () ")"))))) () ")")) (compound_statement "{\n    return;\n  }" ({ "{") (return_statement "return;" (return "return") (; ";")) (} "}"))) (expression_statement "param_2 = param_2 * 5;" (assignment_expression "param_2 = param_2 * 5" (identifier "param_2") (= "=") (binary_expression "param_2 * 5" (identifier "param_2") (* "*") (number_literal "5"))) (; ";")) (if_statement "if (param_2 < 0) {\n    param_2 = param_2 + 3;\n  }" (if "if") (parenthesized_expression "(param_2 < 0)" (( "(") (binary_expression "param_2 < 0" (identifier "param_2") (< "<") (number_literal "0")) () ")")) (compound_statement "{\n    param_2 = param_2 + 3;\n  }" ({ "{") (expression_statement "param_2 = param_2 + 3;" (assignment_expression "param_2 = param_2 + 3" (identifier "param_2") (= "=") (binary_expression "param_2 + 3" (identifier "param_2") (+ "+") (number_literal "3"))) (; ";")) (} "}"))) (expression_statement "iVar2 = (param_2 >> 2) + 0x200;" (assignment_expression "iVar2 = (param_2 >> 2) + 0x200" (identifier "iVar2") (= "=") (binary_expression "(param_2 >> 2) + 0x200" (parenthesized_expression "(param_2 >> 2)" (( "(") (binary_expression "param_2 >> 2" (identifier "param_2") (>> ">>") (number_literal "2")) () ")")) (+ "+") (number_literal "0x200"))) (; ";")) (expression_statement "uVar1 = safemalloc(iVar2,1);" (assignment_expression "uVar1 = safemalloc(iVar2,1)" (identifier "uVar1") (= "=") (call_expression "safemalloc(iVar2,1)" (identifier "safemalloc") (argument_list "(iVar2,1)" (( "(") (identifier "iVar2") (, ",") (number_literal "1") () ")")))) (; ";")) (expression_statement "(*(code *)PTR_memcpy_000bccdc)(uVar1,*(undefined4 *)(param_1 + 8),*(undefined4 *)(param_1 + 0xc));" (call_expression "(*(code *)PTR_memcpy_000bccdc)(uVar1,*(undefined4 *)(param_1 + 8),*(undefined4 *)(param_1 + 0xc))" (parenthesized_expression "(*(code *)PTR_memcpy_000bccdc)" (( "(") (pointer_expression "*(code *)PTR_memcpy_000bccdc" (* "*") (cast_expression "(code *)PTR_memcpy_000bccdc" (( "(") (type_descriptor "code *" (type_identifier "code") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "PTR_memcpy_000bccdc"))) () ")")) (argument_list "(uVar1,*(undefined4 *)(param_1 + 8),*(undefined4 *)(param_1 + 0xc))" (( "(") (identifier "uVar1") (, ",") (pointer_expression "*(undefined4 *)(param_1 + 8)" (* "*") (cast_expression "(undefined4 *)(param_1 + 8)" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 8)" (( "(") (binary_expression "param_1 + 8" (identifier "param_1") (+ "+") (number_literal "8")) () ")")))) (, ",") (pointer_expression "*(undefined4 *)(param_1 + 0xc)" (* "*") (cast_expression "(undefined4 *)(param_1 + 0xc)" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 0xc)" (( "(") (binary_expression "param_1 + 0xc" (identifier "param_1") (+ "+") (number_literal "0xc")) () ")")))) () ")"))) (; ";")) (expression_statement "smemclr(*(undefined4 *)(param_1 + 8),*(undefined4 *)(param_1 + 0xc));" (call_expression "smemclr(*(undefined4 *)(param_1 + 8),*(undefined4 *)(param_1 + 0xc))" (identifier "smemclr") (argument_list "(*(undefined4 *)(param_1 + 8),*(undefined4 *)(param_1 + 0xc))" (( "(") (pointer_expression "*(undefined4 *)(param_1 + 8)" (* "*") (cast_expression "(undefined4 *)(param_1 + 8)" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 8)" (( "(") (binary_expression "param_1 + 8" (identifier "param_1") (+ "+") (number_literal "8")) () ")")))) (, ",") (pointer_expression "*(undefined4 *)(param_1 + 0xc)" (* "*") (cast_expression "(undefined4 *)(param_1 + 0xc)" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 0xc)" (( "(") (binary_expression "param_1 + 0xc" (identifier "param_1") (+ "+") (number_literal "0xc")) () ")")))) () ")"))) (; ";")) (expression_statement "safefree(*(undefined4 *)(param_1 + 8));" (call_expression "safefree(*(undefined4 *)(param_1 + 8))" (identifier "safefree") (argument_list "(*(undefined4 *)(param_1 + 8))" (( "(") (pointer_expression "*(undefined4 *)(param_1 + 8)" (* "*") (cast_expression "(undefined4 *)(param_1 + 8)" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 8)" (( "(") (binary_expression "param_1 + 8" (identifier "param_1") (+ "+") (number_literal "8")) () ")")))) () ")"))) (; ";")) (expression_statement "*(undefined4 *)(param_1 + 8) = uVar1;" (assignment_expression "*(undefined4 *)(param_1 + 8) = uVar1" (pointer_expression "*(undefined4 *)(param_1 + 8)" (* "*") (cast_expression "(undefined4 *)(param_1 + 8)" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 8)" (( "(") (binary_expression "param_1 + 8" (identifier "param_1") (+ "+") (number_literal "8")) () ")")))) (= "=") (identifier "uVar1")) (; ";")) (expression_statement "*(int *)(param_1 + 0xc) = iVar2;" (assignment_expression "*(int *)(param_1 + 0xc) = iVar2" (pointer_expression "*(int *)(param_1 + 0xc)" (* "*") (cast_expression "(int *)(param_1 + 0xc)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 0xc)" (( "(") (binary_expression "param_1 + 0xc" (identifier "param_1") (+ "+") (number_literal "0xc")) () ")")))) (= "=") (identifier "iVar2")) (; ";")) (return_statement "return;" (return "return") (; ";")) (} "}")))

void function_1(type_1 *pr,int var_1)

{
  int var_2;
  
  if (var_1 <= (int)pr->resultsize) {
    return;
  }
  var_2 = var_1 * 5;
  if (var_2 < 0) {
    var_2 = var_2 + 3;
  }
                    /* WARNING: Subroutine does not return */
  var_3((var_2 >> 2) + 0x200,1);
}


(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: (identifier)))) body: (compound_statement (declaration type: (type_identifier) declarator: (identifier)) (declaration type: (primitive_type) declarator: (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 (assignment_expression left: (identifier) right: (binary_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: (binary_expression left: (identifier) right: (number_literal)))))) (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: (call_expression function: (identifier) arguments: (argument_list (identifier) (number_literal))))) (expression_statement (call_expression function: (parenthesized_expression (pointer_expression argument: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (identifier)))) arguments: (argument_list (identifier) (pointer_expression argument: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))))) (pointer_expression argument: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal)))))))) (expression_statement (call_expression function: (identifier) arguments: (argument_list (pointer_expression argument: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))))) (pointer_expression argument: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal)))))))) (expression_statement (call_expression function: (identifier) arguments: (argument_list (pointer_expression argument: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal)))))))) (expression_statement (assignment_expression left: (pointer_expression argument: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))))) right: (identifier))) (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))) (return_statement))))

void MASKED(int param_1,int param_2)

{
  undefined4 uVar1;
  int iVar2;
  
  if (param_2 <= *(int *)(param_1 + 0xc)) {
    return;
  }
  param_2 = param_2 * 5;
  if (param_2 < 0) {
    param_2 = param_2 + 3;
  }
  iVar2 = (param_2 >> 2) + 0x200;
  uVar1 = safemalloc(iVar2,1);
  (*(code *)PTR_memcpy_000bccdc)(uVar1,*(undefined4 *)(param_1 + 8),*(undefined4 *)(param_1 + 0xc));
  smemclr(*(undefined4 *)(param_1 + 8),*(undefined4 *)(param_1 + 0xc));
  safefree(*(undefined4 *)(param_1 + 8));
  *(undefined4 *)(param_1 + 8) = uVar1;
  *(int *)(param_1 + 0xc) = iVar2;
  return;
}

