
char * getstring(void *data,int datalen)

{
  int iVar1;
  char *pcVar2;
  uchar *data_1;
  
  if (datalen < 4) {
    return (char *)0x0;
  }
                    /* WARNING: Load size is inaccurate */
  iVar1 = (*(code *)PTR_toint_000be494)
                    ((uint)*data << 0x18 | (uint)*(byte *)((int)data + 1) << 0x10 |
                     (uint)*(byte *)((int)data + 3) | (uint)*(byte *)((int)data + 2) << 8);
  if ((iVar1 < 0) || (datalen + -3 <= iVar1)) {
    pcVar2 = (char *)0x0;
  }
  else {
    pcVar2 = (char *)(*(code *)PTR_dupprintf_000be3b8)
                               (PTR_s_1_0_000be3a8 + 0xd48,iVar1,(int)data + 4);
  }
  return pcVar2;
}



undefined4 FUN_00081c3c(byte *param_1,int param_2)

{
  int iVar1;
  undefined4 uVar2;
  
  if (param_2 < 4) {
    return 0;
  }
  iVar1 = (*(code *)PTR_toint_000be494)
                    ((uint)*param_1 << 0x18 | (uint)param_1[1] << 0x10 | (uint)param_1[3] |
                     (uint)param_1[2] << 8);
  if ((iVar1 < 0) || (param_2 + -3 <= iVar1)) {
    uVar2 = 0;
  }
  else {
    uVar2 = (*(code *)PTR_dupprintf_000be3b8)(PTR_s_1_0_000be3a8 + 0xd48,iVar1,param_1 + 4);
  }
  return uVar2;
}


lui gp,0x4
addiu gp,gp,0x4734
addu gp,gp,t9
slti v0,a1,0x4
beq v0,zero,0x00081c5c
_or v0,zero,zero
jr ra
_nop
addiu sp,sp,-0x28
sw ra,0x24(sp)
sw s1,0x20(sp)
sw s0,0x1c(sp)
sw gp,0x10(sp)
or s0,a1,zero
or s1,a0,zero
lbu v0,0x0(a0)
sll v0,v0,0x18
lbu a0,0x1(a0)
sll a0,a0,0x10
or v0,v0,a0
lbu a0,0x3(s1)
or v0,v0,a0
lbu a0,0x2(s1)
sll a0,a0,0x8
or a0,v0,a0
lw t9,-0x7edc(gp)
jalr t9
_nop
lw gp,0x10(sp)
bltz v0,0x00081cf4
_addiu s0,s0,-0x3
slt s0,v0,s0
beq s0,zero,0x00081cf4
_addiu a2,s1,0x4
or a1,v0,zero
lw a0,-0x7fc8(gp)
addiu a0,a0,0xd48
lw t9,-0x7fb8(gp)
jalr t9
_nop
lw gp,0x10(sp)
lw ra,0x24(sp)
lw s1,0x20(sp)
lw s0,0x1c(sp)
jr ra
_addiu sp,sp,0x28
b 0x00081ce0
_or v0,zero,zero
(translation_unit "undefined4 FUN_00081c3c(byte *param_1,int param_2)\n\n{\n  int iVar1;\n  undefined4 uVar2;\n  \n  if (param_2 < 4) {\n    return 0;\n  }\n  iVar1 = (*(code *)PTR_toint_000be494)\n                    ((uint)*param_1 << 0x18 | (uint)param_1[1] << 0x10 | (uint)param_1[3] |\n                     (uint)param_1[2] << 8);\n  if ((iVar1 < 0) || (param_2 + -3 <= iVar1)) {\n    uVar2 = 0;\n  }\n  else {\n    uVar2 = (*(code *)PTR_dupprintf_000be3b8)(PTR_s_1_0_000be3a8 + 0xd48,iVar1,param_1 + 4);\n  }\n  return uVar2;\n}\n\n" (function_definition "undefined4 FUN_00081c3c(byte *param_1,int param_2)\n\n{\n  int iVar1;\n  undefined4 uVar2;\n  \n  if (param_2 < 4) {\n    return 0;\n  }\n  iVar1 = (*(code *)PTR_toint_000be494)\n                    ((uint)*param_1 << 0x18 | (uint)param_1[1] << 0x10 | (uint)param_1[3] |\n                     (uint)param_1[2] << 8);\n  if ((iVar1 < 0) || (param_2 + -3 <= iVar1)) {\n    uVar2 = 0;\n  }\n  else {\n    uVar2 = (*(code *)PTR_dupprintf_000be3b8)(PTR_s_1_0_000be3a8 + 0xd48,iVar1,param_1 + 4);\n  }\n  return uVar2;\n}" type_identifier (function_declarator "FUN_00081c3c(byte *param_1,int param_2)" identifier (parameter_list "(byte *param_1,int param_2)" ( (parameter_declaration "byte *param_1" type_identifier (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "int param_2" primitive_type identifier) ))) (compound_statement "{\n  int iVar1;\n  undefined4 uVar2;\n  \n  if (param_2 < 4) {\n    return 0;\n  }\n  iVar1 = (*(code *)PTR_toint_000be494)\n                    ((uint)*param_1 << 0x18 | (uint)param_1[1] << 0x10 | (uint)param_1[3] |\n                     (uint)param_1[2] << 8);\n  if ((iVar1 < 0) || (param_2 + -3 <= iVar1)) {\n    uVar2 = 0;\n  }\n  else {\n    uVar2 = (*(code *)PTR_dupprintf_000be3b8)(PTR_s_1_0_000be3a8 + 0xd48,iVar1,param_1 + 4);\n  }\n  return uVar2;\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "undefined4 uVar2;" type_identifier identifier ;) (if_statement "if (param_2 < 4) {\n    return 0;\n  }" if (parenthesized_expression "(param_2 < 4)" ( (binary_expression "param_2 < 4" identifier < number_literal) )) (compound_statement "{\n    return 0;\n  }" { (return_statement "return 0;" return number_literal ;) })) (expression_statement "iVar1 = (*(code *)PTR_toint_000be494)\n                    ((uint)*param_1 << 0x18 | (uint)param_1[1] << 0x10 | (uint)param_1[3] |\n                     (uint)param_1[2] << 8);" (assignment_expression "iVar1 = (*(code *)PTR_toint_000be494)\n                    ((uint)*param_1 << 0x18 | (uint)param_1[1] << 0x10 | (uint)param_1[3] |\n                     (uint)param_1[2] << 8)" identifier = (call_expression "(*(code *)PTR_toint_000be494)\n                    ((uint)*param_1 << 0x18 | (uint)param_1[1] << 0x10 | (uint)param_1[3] |\n                     (uint)param_1[2] << 8)" (parenthesized_expression "(*(code *)PTR_toint_000be494)" ( (pointer_expression "*(code *)PTR_toint_000be494" * (cast_expression "(code *)PTR_toint_000be494" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "((uint)*param_1 << 0x18 | (uint)param_1[1] << 0x10 | (uint)param_1[3] |\n                     (uint)param_1[2] << 8)" ( (binary_expression "(uint)*param_1 << 0x18 | (uint)param_1[1] << 0x10 | (uint)param_1[3] |\n                     (uint)param_1[2] << 8" (binary_expression "(uint)*param_1 << 0x18 | (uint)param_1[1] << 0x10 | (uint)param_1[3]" (binary_expression "(uint)*param_1 << 0x18 | (uint)param_1[1] << 0x10" (binary_expression "(uint)*param_1 << 0x18" (binary_expression "(uint)*param_1" (parenthesized_expression "(uint)" ( identifier )) * identifier) << number_literal) | (binary_expression "(uint)param_1[1] << 0x10" (cast_expression "(uint)param_1[1]" ( (type_descriptor "uint" type_identifier) ) (subscript_expression "param_1[1]" identifier [ number_literal ])) << number_literal)) | (cast_expression "(uint)param_1[3]" ( (type_descriptor "uint" type_identifier) ) (subscript_expression "param_1[3]" identifier [ number_literal ]))) | (binary_expression "(uint)param_1[2] << 8" (cast_expression "(uint)param_1[2]" ( (type_descriptor "uint" type_identifier) ) (subscript_expression "param_1[2]" identifier [ number_literal ])) << number_literal)) )))) ;) (if_statement "if ((iVar1 < 0) || (param_2 + -3 <= iVar1)) {\n    uVar2 = 0;\n  }\n  else {\n    uVar2 = (*(code *)PTR_dupprintf_000be3b8)(PTR_s_1_0_000be3a8 + 0xd48,iVar1,param_1 + 4);\n  }" if (parenthesized_expression "((iVar1 < 0) || (param_2 + -3 <= iVar1))" ( (binary_expression "(iVar1 < 0) || (param_2 + -3 <= iVar1)" (parenthesized_expression "(iVar1 < 0)" ( (binary_expression "iVar1 < 0" identifier < number_literal) )) || (parenthesized_expression "(param_2 + -3 <= iVar1)" ( (binary_expression "param_2 + -3 <= iVar1" (binary_expression "param_2 + -3" identifier + number_literal) <= identifier) ))) )) (compound_statement "{\n    uVar2 = 0;\n  }" { (expression_statement "uVar2 = 0;" (assignment_expression "uVar2 = 0" identifier = number_literal) ;) }) (else_clause "else {\n    uVar2 = (*(code *)PTR_dupprintf_000be3b8)(PTR_s_1_0_000be3a8 + 0xd48,iVar1,param_1 + 4);\n  }" else (compound_statement "{\n    uVar2 = (*(code *)PTR_dupprintf_000be3b8)(PTR_s_1_0_000be3a8 + 0xd48,iVar1,param_1 + 4);\n  }" { (expression_statement "uVar2 = (*(code *)PTR_dupprintf_000be3b8)(PTR_s_1_0_000be3a8 + 0xd48,iVar1,param_1 + 4);" (assignment_expression "uVar2 = (*(code *)PTR_dupprintf_000be3b8)(PTR_s_1_0_000be3a8 + 0xd48,iVar1,param_1 + 4)" identifier = (call_expression "(*(code *)PTR_dupprintf_000be3b8)(PTR_s_1_0_000be3a8 + 0xd48,iVar1,param_1 + 4)" (parenthesized_expression "(*(code *)PTR_dupprintf_000be3b8)" ( (pointer_expression "*(code *)PTR_dupprintf_000be3b8" * (cast_expression "(code *)PTR_dupprintf_000be3b8" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(PTR_s_1_0_000be3a8 + 0xd48,iVar1,param_1 + 4)" ( (binary_expression "PTR_s_1_0_000be3a8 + 0xd48" identifier + number_literal) , identifier , (binary_expression "param_1 + 4" identifier + number_literal) )))) ;) }))) (return_statement "return uVar2;" return identifier ;) })))
(translation_unit "char * getstring(void *data,int datalen)\n\n{\n  int iVar1;\n  char *pcVar2;\n  uchar *data_1;\n  \n  if (datalen < 4) {\n    return (char *)0x0;\n  }\n                    /* WARNING: Load size is inaccurate */\n  iVar1 = (*(code *)PTR_toint_000be494)\n                    ((uint)*data << 0x18 | (uint)*(byte *)((int)data + 1) << 0x10 |\n                     (uint)*(byte *)((int)data + 3) | (uint)*(byte *)((int)data + 2) << 8);\n  if ((iVar1 < 0) || (datalen + -3 <= iVar1)) {\n    pcVar2 = (char *)0x0;\n  }\n  else {\n    pcVar2 = (char *)(*(code *)PTR_dupprintf_000be3b8)\n                               (PTR_s_1_0_000be3a8 + 0xd48,iVar1,(int)data + 4);\n  }\n  return pcVar2;\n}\n\n" (function_definition "char * getstring(void *data,int datalen)\n\n{\n  int iVar1;\n  char *pcVar2;\n  uchar *data_1;\n  \n  if (datalen < 4) {\n    return (char *)0x0;\n  }\n                    /* WARNING: Load size is inaccurate */\n  iVar1 = (*(code *)PTR_toint_000be494)\n                    ((uint)*data << 0x18 | (uint)*(byte *)((int)data + 1) << 0x10 |\n                     (uint)*(byte *)((int)data + 3) | (uint)*(byte *)((int)data + 2) << 8);\n  if ((iVar1 < 0) || (datalen + -3 <= iVar1)) {\n    pcVar2 = (char *)0x0;\n  }\n  else {\n    pcVar2 = (char *)(*(code *)PTR_dupprintf_000be3b8)\n                               (PTR_s_1_0_000be3a8 + 0xd48,iVar1,(int)data + 4);\n  }\n  return pcVar2;\n}" primitive_type (pointer_declarator "* getstring(void *data,int datalen)" * (function_declarator "getstring(void *data,int datalen)" identifier (parameter_list "(void *data,int datalen)" ( (parameter_declaration "void *data" primitive_type (pointer_declarator "*data" * identifier)) , (parameter_declaration "int datalen" primitive_type identifier) )))) (compound_statement "{\n  int iVar1;\n  char *pcVar2;\n  uchar *data_1;\n  \n  if (datalen < 4) {\n    return (char *)0x0;\n  }\n                    /* WARNING: Load size is inaccurate */\n  iVar1 = (*(code *)PTR_toint_000be494)\n                    ((uint)*data << 0x18 | (uint)*(byte *)((int)data + 1) << 0x10 |\n                     (uint)*(byte *)((int)data + 3) | (uint)*(byte *)((int)data + 2) << 8);\n  if ((iVar1 < 0) || (datalen + -3 <= iVar1)) {\n    pcVar2 = (char *)0x0;\n  }\n  else {\n    pcVar2 = (char *)(*(code *)PTR_dupprintf_000be3b8)\n                               (PTR_s_1_0_000be3a8 + 0xd48,iVar1,(int)data + 4);\n  }\n  return pcVar2;\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "char *pcVar2;" primitive_type (pointer_declarator "*pcVar2" * identifier) ;) (declaration "uchar *data_1;" type_identifier (pointer_declarator "*data_1" * identifier) ;) (if_statement "if (datalen < 4) {\n    return (char *)0x0;\n  }" if (parenthesized_expression "(datalen < 4)" ( (binary_expression "datalen < 4" identifier < number_literal) )) (compound_statement "{\n    return (char *)0x0;\n  }" { (return_statement "return (char *)0x0;" return (cast_expression "(char *)0x0" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal) ;) })) comment (expression_statement "iVar1 = (*(code *)PTR_toint_000be494)\n                    ((uint)*data << 0x18 | (uint)*(byte *)((int)data + 1) << 0x10 |\n                     (uint)*(byte *)((int)data + 3) | (uint)*(byte *)((int)data + 2) << 8);" (assignment_expression "iVar1 = (*(code *)PTR_toint_000be494)\n                    ((uint)*data << 0x18 | (uint)*(byte *)((int)data + 1) << 0x10 |\n                     (uint)*(byte *)((int)data + 3) | (uint)*(byte *)((int)data + 2) << 8)" identifier = (call_expression "(*(code *)PTR_toint_000be494)\n                    ((uint)*data << 0x18 | (uint)*(byte *)((int)data + 1) << 0x10 |\n                     (uint)*(byte *)((int)data + 3) | (uint)*(byte *)((int)data + 2) << 8)" (parenthesized_expression "(*(code *)PTR_toint_000be494)" ( (pointer_expression "*(code *)PTR_toint_000be494" * (cast_expression "(code *)PTR_toint_000be494" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "((uint)*data << 0x18 | (uint)*(byte *)((int)data + 1) << 0x10 |\n                     (uint)*(byte *)((int)data + 3) | (uint)*(byte *)((int)data + 2) << 8)" ( (binary_expression "(uint)*data << 0x18 | (uint)*(byte *)((int)data + 1) << 0x10 |\n                     (uint)*(byte *)((int)data + 3) | (uint)*(byte *)((int)data + 2) << 8" (binary_expression "(uint)*data << 0x18 | (uint)*(byte *)((int)data + 1) << 0x10 |\n                     (uint)*(byte *)((int)data + 3)" (binary_expression "(uint)*data << 0x18 | (uint)*(byte *)((int)data + 1) << 0x10" (binary_expression "(uint)*data << 0x18" (binary_expression "(uint)*data" (parenthesized_expression "(uint)" ( identifier )) * identifier) << number_literal) | (binary_expression "(uint)*(byte *)((int)data + 1) << 0x10" (binary_expression "(uint)*(byte *)((int)data + 1)" (parenthesized_expression "(uint)" ( identifier )) * (cast_expression "(byte *)((int)data + 1)" ( (type_descriptor "byte *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((int)data + 1)" ( (binary_expression "(int)data + 1" (cast_expression "(int)data" ( (type_descriptor "int" primitive_type) ) identifier) + number_literal) )))) << number_literal)) | (binary_expression "(uint)*(byte *)((int)data + 3)" (parenthesized_expression "(uint)" ( identifier )) * (cast_expression "(byte *)((int)data + 3)" ( (type_descriptor "byte *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((int)data + 3)" ( (binary_expression "(int)data + 3" (cast_expression "(int)data" ( (type_descriptor "int" primitive_type) ) identifier) + number_literal) ))))) | (binary_expression "(uint)*(byte *)((int)data + 2) << 8" (binary_expression "(uint)*(byte *)((int)data + 2)" (parenthesized_expression "(uint)" ( identifier )) * (cast_expression "(byte *)((int)data + 2)" ( (type_descriptor "byte *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((int)data + 2)" ( (binary_expression "(int)data + 2" (cast_expression "(int)data" ( (type_descriptor "int" primitive_type) ) identifier) + number_literal) )))) << number_literal)) )))) ;) (if_statement "if ((iVar1 < 0) || (datalen + -3 <= iVar1)) {\n    pcVar2 = (char *)0x0;\n  }\n  else {\n    pcVar2 = (char *)(*(code *)PTR_dupprintf_000be3b8)\n                               (PTR_s_1_0_000be3a8 + 0xd48,iVar1,(int)data + 4);\n  }" if (parenthesized_expression "((iVar1 < 0) || (datalen + -3 <= iVar1))" ( (binary_expression "(iVar1 < 0) || (datalen + -3 <= iVar1)" (parenthesized_expression "(iVar1 < 0)" ( (binary_expression "iVar1 < 0" identifier < number_literal) )) || (parenthesized_expression "(datalen + -3 <= iVar1)" ( (binary_expression "datalen + -3 <= iVar1" (binary_expression "datalen + -3" identifier + number_literal) <= identifier) ))) )) (compound_statement "{\n    pcVar2 = (char *)0x0;\n  }" { (expression_statement "pcVar2 = (char *)0x0;" (assignment_expression "pcVar2 = (char *)0x0" identifier = (cast_expression "(char *)0x0" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) ;) }) (else_clause "else {\n    pcVar2 = (char *)(*(code *)PTR_dupprintf_000be3b8)\n                               (PTR_s_1_0_000be3a8 + 0xd48,iVar1,(int)data + 4);\n  }" else (compound_statement "{\n    pcVar2 = (char *)(*(code *)PTR_dupprintf_000be3b8)\n                               (PTR_s_1_0_000be3a8 + 0xd48,iVar1,(int)data + 4);\n  }" { (expression_statement "pcVar2 = (char *)(*(code *)PTR_dupprintf_000be3b8)\n                               (PTR_s_1_0_000be3a8 + 0xd48,iVar1,(int)data + 4);" (assignment_expression "pcVar2 = (char *)(*(code *)PTR_dupprintf_000be3b8)\n                               (PTR_s_1_0_000be3a8 + 0xd48,iVar1,(int)data + 4)" identifier = (cast_expression "(char *)(*(code *)PTR_dupprintf_000be3b8)\n                               (PTR_s_1_0_000be3a8 + 0xd48,iVar1,(int)data + 4)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "(*(code *)PTR_dupprintf_000be3b8)\n                               (PTR_s_1_0_000be3a8 + 0xd48,iVar1,(int)data + 4)" (parenthesized_expression "(*(code *)PTR_dupprintf_000be3b8)" ( (pointer_expression "*(code *)PTR_dupprintf_000be3b8" * (cast_expression "(code *)PTR_dupprintf_000be3b8" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(PTR_s_1_0_000be3a8 + 0xd48,iVar1,(int)data + 4)" ( (binary_expression "PTR_s_1_0_000be3a8 + 0xd48" identifier + number_literal) , identifier , (binary_expression "(int)data + 4" (cast_expression "(int)data" ( (type_descriptor "int" primitive_type) ) identifier) + number_literal) ))))) ;) }))) (return_statement "return pcVar2;" return identifier ;) })))
(translation_unit "undefined4 FUN_00081c3c(byte *param_1,int param_2)\n\n{\n  int iVar1;\n  undefined4 uVar2;\n  \n  if (param_2 < 4) {\n    return 0;\n  }\n  iVar1 = (*(code *)PTR_toint_000be494)\n                    ((uint)*param_1 << 0x18 | (uint)param_1[1] << 0x10 | (uint)param_1[3] |\n                     (uint)param_1[2] << 8);\n  if ((iVar1 < 0) || (param_2 + -3 <= iVar1)) {\n    uVar2 = 0;\n  }\n  else {\n    uVar2 = (*(code *)PTR_dupprintf_000be3b8)(PTR_s_1_0_000be3a8 + 0xd48,iVar1,param_1 + 4);\n  }\n  return uVar2;\n}\n\n" (function_definition "undefined4 FUN_00081c3c(byte *param_1,int param_2)\n\n{\n  int iVar1;\n  undefined4 uVar2;\n  \n  if (param_2 < 4) {\n    return 0;\n  }\n  iVar1 = (*(code *)PTR_toint_000be494)\n                    ((uint)*param_1 << 0x18 | (uint)param_1[1] << 0x10 | (uint)param_1[3] |\n                     (uint)param_1[2] << 8);\n  if ((iVar1 < 0) || (param_2 + -3 <= iVar1)) {\n    uVar2 = 0;\n  }\n  else {\n    uVar2 = (*(code *)PTR_dupprintf_000be3b8)(PTR_s_1_0_000be3a8 + 0xd48,iVar1,param_1 + 4);\n  }\n  return uVar2;\n}" type_identifier (function_declarator "FUN_00081c3c(byte *param_1,int param_2)" identifier (parameter_list "(byte *param_1,int param_2)" ( (parameter_declaration "byte *param_1" type_identifier (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "int param_2" primitive_type identifier) ))) (compound_statement "{\n  int iVar1;\n  undefined4 uVar2;\n  \n  if (param_2 < 4) {\n    return 0;\n  }\n  iVar1 = (*(code *)PTR_toint_000be494)\n                    ((uint)*param_1 << 0x18 | (uint)param_1[1] << 0x10 | (uint)param_1[3] |\n                     (uint)param_1[2] << 8);\n  if ((iVar1 < 0) || (param_2 + -3 <= iVar1)) {\n    uVar2 = 0;\n  }\n  else {\n    uVar2 = (*(code *)PTR_dupprintf_000be3b8)(PTR_s_1_0_000be3a8 + 0xd48,iVar1,param_1 + 4);\n  }\n  return uVar2;\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "undefined4 uVar2;" type_identifier identifier ;) (if_statement "if (param_2 < 4) {\n    return 0;\n  }" if (parenthesized_expression "(param_2 < 4)" ( (binary_expression "param_2 < 4" identifier < number_literal) )) (compound_statement "{\n    return 0;\n  }" { (return_statement "return 0;" return number_literal ;) })) (expression_statement "iVar1 = (*(code *)PTR_toint_000be494)\n                    ((uint)*param_1 << 0x18 | (uint)param_1[1] << 0x10 | (uint)param_1[3] |\n                     (uint)param_1[2] << 8);" (assignment_expression "iVar1 = (*(code *)PTR_toint_000be494)\n                    ((uint)*param_1 << 0x18 | (uint)param_1[1] << 0x10 | (uint)param_1[3] |\n                     (uint)param_1[2] << 8)" identifier = (call_expression "(*(code *)PTR_toint_000be494)\n                    ((uint)*param_1 << 0x18 | (uint)param_1[1] << 0x10 | (uint)param_1[3] |\n                     (uint)param_1[2] << 8)" (parenthesized_expression "(*(code *)PTR_toint_000be494)" ( (pointer_expression "*(code *)PTR_toint_000be494" * (cast_expression "(code *)PTR_toint_000be494" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "((uint)*param_1 << 0x18 | (uint)param_1[1] << 0x10 | (uint)param_1[3] |\n                     (uint)param_1[2] << 8)" ( (binary_expression "(uint)*param_1 << 0x18 | (uint)param_1[1] << 0x10 | (uint)param_1[3] |\n                     (uint)param_1[2] << 8" (binary_expression "(uint)*param_1 << 0x18 | (uint)param_1[1] << 0x10 | (uint)param_1[3]" (binary_expression "(uint)*param_1 << 0x18 | (uint)param_1[1] << 0x10" (binary_expression "(uint)*param_1 << 0x18" (binary_expression "(uint)*param_1" (parenthesized_expression "(uint)" ( identifier )) * identifier) << number_literal) | (binary_expression "(uint)param_1[1] << 0x10" (cast_expression "(uint)param_1[1]" ( (type_descriptor "uint" type_identifier) ) (subscript_expression "param_1[1]" identifier [ number_literal ])) << number_literal)) | (cast_expression "(uint)param_1[3]" ( (type_descriptor "uint" type_identifier) ) (subscript_expression "param_1[3]" identifier [ number_literal ]))) | (binary_expression "(uint)param_1[2] << 8" (cast_expression "(uint)param_1[2]" ( (type_descriptor "uint" type_identifier) ) (subscript_expression "param_1[2]" identifier [ number_literal ])) << number_literal)) )))) ;) (if_statement "if ((iVar1 < 0) || (param_2 + -3 <= iVar1)) {\n    uVar2 = 0;\n  }\n  else {\n    uVar2 = (*(code *)PTR_dupprintf_000be3b8)(PTR_s_1_0_000be3a8 + 0xd48,iVar1,param_1 + 4);\n  }" if (parenthesized_expression "((iVar1 < 0) || (param_2 + -3 <= iVar1))" ( (binary_expression "(iVar1 < 0) || (param_2 + -3 <= iVar1)" (parenthesized_expression "(iVar1 < 0)" ( (binary_expression "iVar1 < 0" identifier < number_literal) )) || (parenthesized_expression "(param_2 + -3 <= iVar1)" ( (binary_expression "param_2 + -3 <= iVar1" (binary_expression "param_2 + -3" identifier + number_literal) <= identifier) ))) )) (compound_statement "{\n    uVar2 = 0;\n  }" { (expression_statement "uVar2 = 0;" (assignment_expression "uVar2 = 0" identifier = number_literal) ;) }) (else_clause "else {\n    uVar2 = (*(code *)PTR_dupprintf_000be3b8)(PTR_s_1_0_000be3a8 + 0xd48,iVar1,param_1 + 4);\n  }" else (compound_statement "{\n    uVar2 = (*(code *)PTR_dupprintf_000be3b8)(PTR_s_1_0_000be3a8 + 0xd48,iVar1,param_1 + 4);\n  }" { (expression_statement "uVar2 = (*(code *)PTR_dupprintf_000be3b8)(PTR_s_1_0_000be3a8 + 0xd48,iVar1,param_1 + 4);" (assignment_expression "uVar2 = (*(code *)PTR_dupprintf_000be3b8)(PTR_s_1_0_000be3a8 + 0xd48,iVar1,param_1 + 4)" identifier = (call_expression "(*(code *)PTR_dupprintf_000be3b8)(PTR_s_1_0_000be3a8 + 0xd48,iVar1,param_1 + 4)" (parenthesized_expression "(*(code *)PTR_dupprintf_000be3b8)" ( (pointer_expression "*(code *)PTR_dupprintf_000be3b8" * (cast_expression "(code *)PTR_dupprintf_000be3b8" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(PTR_s_1_0_000be3a8 + 0xd48,iVar1,param_1 + 4)" ( (binary_expression "PTR_s_1_0_000be3a8 + 0xd48" identifier + number_literal) , identifier , (binary_expression "param_1 + 4" identifier + number_literal) )))) ;) }))) (return_statement "return uVar2;" return identifier ;) })))
(translation_unit (function_definition TYPE (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE (pointer_declarator * IDENT)) , (parameter_declaration TYPE IDENT) ))) (compound_statement { (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT < LIT) )) (compound_statement { (return_statement return LIT ;) })) (expression_statement (assignment_expression IDENT = (call_expression (parenthesized_expression ( (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) IDENT)) )) (argument_list ( (binary_expression (binary_expression (binary_expression (binary_expression (binary_expression (parenthesized_expression ( IDENT )) * IDENT) << LIT) | (binary_expression (cast_expression ( (type_descriptor TYPE) ) (subscript_expression IDENT [ LIT ])) << LIT)) | (cast_expression ( (type_descriptor TYPE) ) (subscript_expression IDENT [ LIT ]))) | (binary_expression (cast_expression ( (type_descriptor TYPE) ) (subscript_expression IDENT [ LIT ])) << LIT)) )))) ;) (if_statement if (parenthesized_expression ( (binary_expression (parenthesized_expression ( (binary_expression IDENT < LIT) )) || (parenthesized_expression ( (binary_expression (binary_expression IDENT + LIT) <= IDENT) ))) )) (compound_statement { (expression_statement (assignment_expression IDENT = LIT) ;) }) (else_clause else (compound_statement { (expression_statement (assignment_expression IDENT = (call_expression (parenthesized_expression ( (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) IDENT)) )) (argument_list ( (binary_expression IDENT + LIT) , IDENT , (binary_expression IDENT + LIT) )))) ;) }))) (return_statement return IDENT ;) })))
(function_definition "undefined4 FUN_00081c3c(byte *param_1,int param_2)\n\n{\n  int iVar1;\n  undefined4 uVar2;\n  \n  if (param_2 < 4) {\n    return 0;\n  }\n  iVar1 = (*(code *)PTR_toint_000be494)\n                    ((uint)*param_1 << 0x18 | (uint)param_1[1] << 0x10 | (uint)param_1[3] |\n                     (uint)param_1[2] << 8);\n  if ((iVar1 < 0) || (param_2 + -3 <= iVar1)) {\n    uVar2 = 0;\n  }\n  else {\n    uVar2 = (*(code *)PTR_dupprintf_000be3b8)(PTR_s_1_0_000be3a8 + 0xd48,iVar1,param_1 + 4);\n  }\n  return uVar2;\n}" (type_identifier "undefined4") (function_declarator "FUN_00081c3c(byte *param_1,int param_2)" (identifier "FUN_00081c3c") (parameter_list "(byte *param_1,int param_2)" (( "(") (parameter_declaration "byte *param_1" (type_identifier "byte") (pointer_declarator "*param_1" (* "*") (identifier "param_1"))) (, ",") (parameter_declaration "int param_2" (primitive_type "int") (identifier "param_2")) () ")"))) (compound_statement "{\n  int iVar1;\n  undefined4 uVar2;\n  \n  if (param_2 < 4) {\n    return 0;\n  }\n  iVar1 = (*(code *)PTR_toint_000be494)\n                    ((uint)*param_1 << 0x18 | (uint)param_1[1] << 0x10 | (uint)param_1[3] |\n                     (uint)param_1[2] << 8);\n  if ((iVar1 < 0) || (param_2 + -3 <= iVar1)) {\n    uVar2 = 0;\n  }\n  else {\n    uVar2 = (*(code *)PTR_dupprintf_000be3b8)(PTR_s_1_0_000be3a8 + 0xd48,iVar1,param_1 + 4);\n  }\n  return uVar2;\n}" ({ "{") (declaration "int iVar1;" (primitive_type "int") (identifier "iVar1") (; ";")) (declaration "undefined4 uVar2;" (type_identifier "undefined4") (identifier "uVar2") (; ";")) (if_statement "if (param_2 < 4) {\n    return 0;\n  }" (if "if") (parenthesized_expression "(param_2 < 4)" (( "(") (binary_expression "param_2 < 4" (identifier "param_2") (< "<") (number_literal "4")) () ")")) (compound_statement "{\n    return 0;\n  }" ({ "{") (return_statement "return 0;" (return "return") (number_literal "0") (; ";")) (} "}"))) (expression_statement "iVar1 = (*(code *)PTR_toint_000be494)\n                    ((uint)*param_1 << 0x18 | (uint)param_1[1] << 0x10 | (uint)param_1[3] |\n                     (uint)param_1[2] << 8);" (assignment_expression "iVar1 = (*(code *)PTR_toint_000be494)\n                    ((uint)*param_1 << 0x18 | (uint)param_1[1] << 0x10 | (uint)param_1[3] |\n                     (uint)param_1[2] << 8)" (identifier "iVar1") (= "=") (call_expression "(*(code *)PTR_toint_000be494)\n                    ((uint)*param_1 << 0x18 | (uint)param_1[1] << 0x10 | (uint)param_1[3] |\n                     (uint)param_1[2] << 8)" (parenthesized_expression "(*(code *)PTR_toint_000be494)" (( "(") (pointer_expression "*(code *)PTR_toint_000be494" (* "*") (cast_expression "(code *)PTR_toint_000be494" (( "(") (type_descriptor "code *" (type_identifier "code") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "PTR_toint_000be494"))) () ")")) (argument_list "((uint)*param_1 << 0x18 | (uint)param_1[1] << 0x10 | (uint)param_1[3] |\n                     (uint)param_1[2] << 8)" (( "(") (binary_expression "(uint)*param_1 << 0x18 | (uint)param_1[1] << 0x10 | (uint)param_1[3] |\n                     (uint)param_1[2] << 8" (binary_expression "(uint)*param_1 << 0x18 | (uint)param_1[1] << 0x10 | (uint)param_1[3]" (binary_expression "(uint)*param_1 << 0x18 | (uint)param_1[1] << 0x10" (binary_expression "(uint)*param_1 << 0x18" (binary_expression "(uint)*param_1" (parenthesized_expression "(uint)" (( "(") (identifier "uint") () ")")) (* "*") (identifier "param_1")) (<< "<<") (number_literal "0x18")) (| "|") (binary_expression "(uint)param_1[1] << 0x10" (cast_expression "(uint)param_1[1]" (( "(") (type_descriptor "uint" (type_identifier "uint")) () ")") (subscript_expression "param_1[1]" (identifier "param_1") ([ "[") (number_literal "1") (] "]"))) (<< "<<") (number_literal "0x10"))) (| "|") (cast_expression "(uint)param_1[3]" (( "(") (type_descriptor "uint" (type_identifier "uint")) () ")") (subscript_expression "param_1[3]" (identifier "param_1") ([ "[") (number_literal "3") (] "]")))) (| "|") (binary_expression "(uint)param_1[2] << 8" (cast_expression "(uint)param_1[2]" (( "(") (type_descriptor "uint" (type_identifier "uint")) () ")") (subscript_expression "param_1[2]" (identifier "param_1") ([ "[") (number_literal "2") (] "]"))) (<< "<<") (number_literal "8"))) () ")")))) (; ";")) (if_statement "if ((iVar1 < 0) || (param_2 + -3 <= iVar1)) {\n    uVar2 = 0;\n  }\n  else {\n    uVar2 = (*(code *)PTR_dupprintf_000be3b8)(PTR_s_1_0_000be3a8 + 0xd48,iVar1,param_1 + 4);\n  }" (if "if") (parenthesized_expression "((iVar1 < 0) || (param_2 + -3 <= iVar1))" (( "(") (binary_expression "(iVar1 < 0) || (param_2 + -3 <= iVar1)" (parenthesized_expression "(iVar1 < 0)" (( "(") (binary_expression "iVar1 < 0" (identifier "iVar1") (< "<") (number_literal "0")) () ")")) (|| "||") (parenthesized_expression "(param_2 + -3 <= iVar1)" (( "(") (binary_expression "param_2 + -3 <= iVar1" (binary_expression "param_2 + -3" (identifier "param_2") (+ "+") (number_literal "-3")) (<= "<=") (identifier "iVar1")) () ")"))) () ")")) (compound_statement "{\n    uVar2 = 0;\n  }" ({ "{") (expression_statement "uVar2 = 0;" (assignment_expression "uVar2 = 0" (identifier "uVar2") (= "=") (number_literal "0")) (; ";")) (} "}")) (else_clause "else {\n    uVar2 = (*(code *)PTR_dupprintf_000be3b8)(PTR_s_1_0_000be3a8 + 0xd48,iVar1,param_1 + 4);\n  }" (else "else") (compound_statement "{\n    uVar2 = (*(code *)PTR_dupprintf_000be3b8)(PTR_s_1_0_000be3a8 + 0xd48,iVar1,param_1 + 4);\n  }" ({ "{") (expression_statement "uVar2 = (*(code *)PTR_dupprintf_000be3b8)(PTR_s_1_0_000be3a8 + 0xd48,iVar1,param_1 + 4);" (assignment_expression "uVar2 = (*(code *)PTR_dupprintf_000be3b8)(PTR_s_1_0_000be3a8 + 0xd48,iVar1,param_1 + 4)" (identifier "uVar2") (= "=") (call_expression "(*(code *)PTR_dupprintf_000be3b8)(PTR_s_1_0_000be3a8 + 0xd48,iVar1,param_1 + 4)" (parenthesized_expression "(*(code *)PTR_dupprintf_000be3b8)" (( "(") (pointer_expression "*(code *)PTR_dupprintf_000be3b8" (* "*") (cast_expression "(code *)PTR_dupprintf_000be3b8" (( "(") (type_descriptor "code *" (type_identifier "code") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "PTR_dupprintf_000be3b8"))) () ")")) (argument_list "(PTR_s_1_0_000be3a8 + 0xd48,iVar1,param_1 + 4)" (( "(") (binary_expression "PTR_s_1_0_000be3a8 + 0xd48" (identifier "PTR_s_1_0_000be3a8") (+ "+") (number_literal "0xd48")) (, ",") (identifier "iVar1") (, ",") (binary_expression "param_1 + 4" (identifier "param_1") (+ "+") (number_literal "4")) () ")")))) (; ";")) (} "}")))) (return_statement "return uVar2;" (return "return") (identifier "uVar2") (; ";")) (} "}")))

char * function_1(void *var_2,int var_1)

{
  int var_3;
  char *pcVar2;
  type_1 *data_1;
  
  if (var_1 < 4) {
    return (char *)0x0;
  }
                    /* WARNING: Load size is inaccurate */
  var_3 = (*(type_2 *)PTR_toint_000be494)
                    ((uint)*var_2 << 0x18 | (uint)*(type_3 *)((int)var_2 + 1) << 0x10 |
                     (uint)*(type_3 *)((int)var_2 + 3) | (uint)*(type_3 *)((int)var_2 + 2) << 8);
  if ((var_3 < 0) || (var_1 + -3 <= var_3)) {
    pcVar2 = (char *)0x0;
  }
  else {
    pcVar2 = (char *)(*(type_2 *)PTR_dupprintf_000be3b8)
                               (var_4 + 0xd48,var_3,(int)var_2 + 4);
  }
  return pcVar2;
}


(translation_unit (function_definition type: (type_identifier) declarator: (function_declarator declarator: (identifier) parameters: (parameter_list (parameter_declaration type: (type_identifier) declarator: (pointer_declarator declarator: (identifier))) (parameter_declaration type: (primitive_type) declarator: (identifier)))) body: (compound_statement (declaration type: (primitive_type) declarator: (identifier)) (declaration type: (type_identifier) declarator: (identifier)) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (compound_statement (return_statement (number_literal)))) (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (parenthesized_expression (pointer_expression argument: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (identifier)))) arguments: (argument_list (binary_expression left: (binary_expression left: (binary_expression left: (binary_expression left: (binary_expression left: (parenthesized_expression (identifier)) right: (identifier)) right: (number_literal)) right: (binary_expression left: (cast_expression type: (type_descriptor type: (type_identifier)) value: (subscript_expression argument: (identifier) index: (number_literal))) right: (number_literal))) right: (cast_expression type: (type_descriptor type: (type_identifier)) value: (subscript_expression argument: (identifier) index: (number_literal)))) right: (binary_expression left: (cast_expression type: (type_descriptor type: (type_identifier)) value: (subscript_expression argument: (identifier) index: (number_literal))) right: (number_literal))))))) (if_statement condition: (parenthesized_expression (binary_expression left: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) right: (parenthesized_expression (binary_expression left: (binary_expression left: (identifier) right: (number_literal)) right: (identifier))))) consequence: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (number_literal)))) alternative: (else_clause (compound_statement (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (parenthesized_expression (pointer_expression argument: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (identifier)))) arguments: (argument_list (binary_expression left: (identifier) right: (number_literal)) (identifier) (binary_expression left: (identifier) right: (number_literal))))))))) (return_statement (identifier)))))

undefined4 MASKED(byte *param_1,int param_2)

{
  int iVar1;
  undefined4 uVar2;
  
  if (param_2 < 4) {
    return 0;
  }
  iVar1 = (*(code *)PTR_toint_000be494)
                    ((uint)*param_1 << 0x18 | (uint)param_1[1] << 0x10 | (uint)param_1[3] |
                     (uint)param_1[2] << 8);
  if ((iVar1 < 0) || (param_2 + -3 <= iVar1)) {
    uVar2 = 0;
  }
  else {
    uVar2 = (*(code *)PTR_dupprintf_000be3b8)(PTR_s_1_0_000be3a8 + 0xd48,iVar1,param_1 + 4);
  }
  return uVar2;
}

