
/* WARNING: Function: __x86.get_pc_thunk.bp replaced with injection: get_pc_thunk.bp */

int png_icc_check_length
              (png_const_structrp png_ptr,png_colorspacerp colorspace,png_const_charp name,
              png_uint_32 profile_length)

{
  int iVar1;
  
  if ((profile_length < 0x84) &&
     (iVar1 = png_icc_profile_error(png_ptr,colorspace,name,profile_length,"too short"), iVar1 == 0)
     ) {
    return 0;
  }
  if ((png_ptr->user_chunk_malloc_max != 0) && (png_ptr->user_chunk_malloc_max < profile_length)) {
    iVar1 = png_icc_profile_error
                      (png_ptr,colorspace,name,profile_length,"exceeds application limits");
    return iVar1;
  }
  return 1;
}



undefined4 FUN_00016220(int param_1,undefined4 param_2,undefined4 param_3,uint param_4)

{
  int iVar1;
  undefined4 uVar2;
  int unaff_EBP;
  
  FUN_0001a3d9();
  if ((param_4 < 0x84) && (iVar1 = FUN_00014c20(param_4,unaff_EBP + 0x2e079), iVar1 == 0)) {
    return 0;
  }
  if ((*(uint *)(param_1 + 0x304) != 0) && (*(uint *)(param_1 + 0x304) < param_4)) {
    uVar2 = FUN_00014c20();
    return uVar2;
  }
  return 1;
}


PUSH EBP
CALL 0x0001a3d9
ADD EBP,0x3db5a
PUSH EDI
PUSH ESI
PUSH EBX
SUB ESP,0x1c
MOV EAX,dword ptr [ESP + 0x34]
MOV EBX,dword ptr [ESP + 0x3c]
MOV ESI,dword ptr [ESP + 0x30]
MOV EDI,dword ptr [ESP + 0x38]
MOV dword ptr [ESP + 0xc],EAX
CMP EBX,0x83
JBE 0x00016270
MOV EAX,dword ptr [ESI + 0x304]
TEST EAX,EAX
JZ 0x0001625c
CMP EAX,EBX
JC 0x00016298
MOV EAX,0x1
ADD ESP,0x1c
POP EBX
POP ESI
POP EDI
POP EBP
RET
SUB ESP,0x8
LEA EAX,[EBP + 0xffff051f]
MOV ECX,EDI
PUSH EAX
MOV EAX,ESI
PUSH EBX
MOV EDX,dword ptr [ESP + 0x1c]
CALL 0x00014c20
ADD ESP,0x10
TEST EAX,EAX
JNZ 0x0001624e
JMP 0x00016261
LEA EAX,[EBP + 0xfffec970]
MOV dword ptr [ESP + 0x30],EBX
MOV EDX,dword ptr [ESP + 0xc]
MOV ECX,EDI
MOV dword ptr [ESP + 0x34],EAX
ADD ESP,0x1c
MOV EAX,ESI
POP EBX
POP ESI
POP EDI
POP EBP
JMP 0x00014c20
(translation_unit "undefined4 FUN_00016220(int param_1,undefined4 param_2,undefined4 param_3,uint param_4)\n\n{\n  int iVar1;\n  undefined4 uVar2;\n  int unaff_EBP;\n  \n  FUN_0001a3d9();\n  if ((param_4 < 0x84) && (iVar1 = FUN_00014c20(param_4,unaff_EBP + 0x2e079), iVar1 == 0)) {\n    return 0;\n  }\n  if ((*(uint *)(param_1 + 0x304) != 0) && (*(uint *)(param_1 + 0x304) < param_4)) {\n    uVar2 = FUN_00014c20();\n    return uVar2;\n  }\n  return 1;\n}\n\n" (function_definition "undefined4 FUN_00016220(int param_1,undefined4 param_2,undefined4 param_3,uint param_4)\n\n{\n  int iVar1;\n  undefined4 uVar2;\n  int unaff_EBP;\n  \n  FUN_0001a3d9();\n  if ((param_4 < 0x84) && (iVar1 = FUN_00014c20(param_4,unaff_EBP + 0x2e079), iVar1 == 0)) {\n    return 0;\n  }\n  if ((*(uint *)(param_1 + 0x304) != 0) && (*(uint *)(param_1 + 0x304) < param_4)) {\n    uVar2 = FUN_00014c20();\n    return uVar2;\n  }\n  return 1;\n}" type_identifier (function_declarator "FUN_00016220(int param_1,undefined4 param_2,undefined4 param_3,uint param_4)" identifier (parameter_list "(int param_1,undefined4 param_2,undefined4 param_3,uint param_4)" ( (parameter_declaration "int param_1" primitive_type identifier) , (parameter_declaration "undefined4 param_2" type_identifier identifier) , (parameter_declaration "undefined4 param_3" type_identifier identifier) , (parameter_declaration "uint param_4" type_identifier identifier) ))) (compound_statement "{\n  int iVar1;\n  undefined4 uVar2;\n  int unaff_EBP;\n  \n  FUN_0001a3d9();\n  if ((param_4 < 0x84) && (iVar1 = FUN_00014c20(param_4,unaff_EBP + 0x2e079), iVar1 == 0)) {\n    return 0;\n  }\n  if ((*(uint *)(param_1 + 0x304) != 0) && (*(uint *)(param_1 + 0x304) < param_4)) {\n    uVar2 = FUN_00014c20();\n    return uVar2;\n  }\n  return 1;\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "undefined4 uVar2;" type_identifier identifier ;) (declaration "int unaff_EBP;" primitive_type identifier ;) (expression_statement "FUN_0001a3d9();" (call_expression "FUN_0001a3d9()" identifier (argument_list "()" ( ))) ;) (if_statement "if ((param_4 < 0x84) && (iVar1 = FUN_00014c20(param_4,unaff_EBP + 0x2e079), iVar1 == 0)) {\n    return 0;\n  }" if (parenthesized_expression "((param_4 < 0x84) && (iVar1 = FUN_00014c20(param_4,unaff_EBP + 0x2e079), iVar1 == 0))" ( (binary_expression "(param_4 < 0x84) && (iVar1 = FUN_00014c20(param_4,unaff_EBP + 0x2e079), iVar1 == 0)" (parenthesized_expression "(param_4 < 0x84)" ( (binary_expression "param_4 < 0x84" identifier < number_literal) )) && (parenthesized_expression "(iVar1 = FUN_00014c20(param_4,unaff_EBP + 0x2e079), iVar1 == 0)" ( (comma_expression "iVar1 = FUN_00014c20(param_4,unaff_EBP + 0x2e079), iVar1 == 0" (assignment_expression "iVar1 = FUN_00014c20(param_4,unaff_EBP + 0x2e079)" identifier = (call_expression "FUN_00014c20(param_4,unaff_EBP + 0x2e079)" identifier (argument_list "(param_4,unaff_EBP + 0x2e079)" ( identifier , (binary_expression "unaff_EBP + 0x2e079" identifier + number_literal) )))) , (binary_expression "iVar1 == 0" identifier == number_literal)) ))) )) (compound_statement "{\n    return 0;\n  }" { (return_statement "return 0;" return number_literal ;) })) (if_statement "if ((*(uint *)(param_1 + 0x304) != 0) && (*(uint *)(param_1 + 0x304) < param_4)) {\n    uVar2 = FUN_00014c20();\n    return uVar2;\n  }" if (parenthesized_expression "((*(uint *)(param_1 + 0x304) != 0) && (*(uint *)(param_1 + 0x304) < param_4))" ( (binary_expression "(*(uint *)(param_1 + 0x304) != 0) && (*(uint *)(param_1 + 0x304) < param_4)" (parenthesized_expression "(*(uint *)(param_1 + 0x304) != 0)" ( (binary_expression "*(uint *)(param_1 + 0x304) != 0" (pointer_expression "*(uint *)(param_1 + 0x304)" * (cast_expression "(uint *)(param_1 + 0x304)" ( (type_descriptor "uint *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x304)" ( (binary_expression "param_1 + 0x304" identifier + number_literal) )))) != number_literal) )) && (parenthesized_expression "(*(uint *)(param_1 + 0x304) < param_4)" ( (binary_expression "*(uint *)(param_1 + 0x304) < param_4" (pointer_expression "*(uint *)(param_1 + 0x304)" * (cast_expression "(uint *)(param_1 + 0x304)" ( (type_descriptor "uint *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x304)" ( (binary_expression "param_1 + 0x304" identifier + number_literal) )))) < identifier) ))) )) (compound_statement "{\n    uVar2 = FUN_00014c20();\n    return uVar2;\n  }" { (expression_statement "uVar2 = FUN_00014c20();" (assignment_expression "uVar2 = FUN_00014c20()" identifier = (call_expression "FUN_00014c20()" identifier (argument_list "()" ( )))) ;) (return_statement "return uVar2;" return identifier ;) })) (return_statement "return 1;" return number_literal ;) })))
(translation_unit "/* WARNING: Function: __x86.get_pc_thunk.bp replaced with injection: get_pc_thunk.bp */\n\nint png_icc_check_length\n              (png_const_structrp png_ptr,png_colorspacerp colorspace,png_const_charp name,\n              png_uint_32 profile_length)\n\n{\n  int iVar1;\n  \n  if ((profile_length < 0x84) &&\n     (iVar1 = png_icc_profile_error(png_ptr,colorspace,name,profile_length,"too short"), iVar1 == 0)\n     ) {\n    return 0;\n  }\n  if ((png_ptr->user_chunk_malloc_max != 0) && (png_ptr->user_chunk_malloc_max < profile_length)) {\n    iVar1 = png_icc_profile_error\n                      (png_ptr,colorspace,name,profile_length,"exceeds application limits");\n    return iVar1;\n  }\n  return 1;\n}\n\n" comment (function_definition "int png_icc_check_length\n              (png_const_structrp png_ptr,png_colorspacerp colorspace,png_const_charp name,\n              png_uint_32 profile_length)\n\n{\n  int iVar1;\n  \n  if ((profile_length < 0x84) &&\n     (iVar1 = png_icc_profile_error(png_ptr,colorspace,name,profile_length,"too short"), iVar1 == 0)\n     ) {\n    return 0;\n  }\n  if ((png_ptr->user_chunk_malloc_max != 0) && (png_ptr->user_chunk_malloc_max < profile_length)) {\n    iVar1 = png_icc_profile_error\n                      (png_ptr,colorspace,name,profile_length,"exceeds application limits");\n    return iVar1;\n  }\n  return 1;\n}" primitive_type (function_declarator "png_icc_check_length\n              (png_const_structrp png_ptr,png_colorspacerp colorspace,png_const_charp name,\n              png_uint_32 profile_length)" identifier (parameter_list "(png_const_structrp png_ptr,png_colorspacerp colorspace,png_const_charp name,\n              png_uint_32 profile_length)" ( (parameter_declaration "png_const_structrp png_ptr" type_identifier identifier) , (parameter_declaration "png_colorspacerp colorspace" type_identifier identifier) , (parameter_declaration "png_const_charp name" type_identifier identifier) , (parameter_declaration "png_uint_32 profile_length" type_identifier identifier) ))) (compound_statement "{\n  int iVar1;\n  \n  if ((profile_length < 0x84) &&\n     (iVar1 = png_icc_profile_error(png_ptr,colorspace,name,profile_length,"too short"), iVar1 == 0)\n     ) {\n    return 0;\n  }\n  if ((png_ptr->user_chunk_malloc_max != 0) && (png_ptr->user_chunk_malloc_max < profile_length)) {\n    iVar1 = png_icc_profile_error\n                      (png_ptr,colorspace,name,profile_length,"exceeds application limits");\n    return iVar1;\n  }\n  return 1;\n}" { (declaration "int iVar1;" primitive_type identifier ;) (if_statement "if ((profile_length < 0x84) &&\n     (iVar1 = png_icc_profile_error(png_ptr,colorspace,name,profile_length,"too short"), iVar1 == 0)\n     ) {\n    return 0;\n  }" if (parenthesized_expression "((profile_length < 0x84) &&\n     (iVar1 = png_icc_profile_error(png_ptr,colorspace,name,profile_length,"too short"), iVar1 == 0)\n     )" ( (binary_expression "(profile_length < 0x84) &&\n     (iVar1 = png_icc_profile_error(png_ptr,colorspace,name,profile_length,"too short"), iVar1 == 0)" (parenthesized_expression "(profile_length < 0x84)" ( (binary_expression "profile_length < 0x84" identifier < number_literal) )) && (parenthesized_expression "(iVar1 = png_icc_profile_error(png_ptr,colorspace,name,profile_length,"too short"), iVar1 == 0)" ( (comma_expression "iVar1 = png_icc_profile_error(png_ptr,colorspace,name,profile_length,"too short"), iVar1 == 0" (assignment_expression "iVar1 = png_icc_profile_error(png_ptr,colorspace,name,profile_length,"too short")" identifier = (call_expression "png_icc_profile_error(png_ptr,colorspace,name,profile_length,"too short")" identifier (argument_list "(png_ptr,colorspace,name,profile_length,"too short")" ( identifier , identifier , identifier , identifier , (string_literal ""too short"" " string_content ") )))) , (binary_expression "iVar1 == 0" identifier == number_literal)) ))) )) (compound_statement "{\n    return 0;\n  }" { (return_statement "return 0;" return number_literal ;) })) (if_statement "if ((png_ptr->user_chunk_malloc_max != 0) && (png_ptr->user_chunk_malloc_max < profile_length)) {\n    iVar1 = png_icc_profile_error\n                      (png_ptr,colorspace,name,profile_length,"exceeds application limits");\n    return iVar1;\n  }" if (parenthesized_expression "((png_ptr->user_chunk_malloc_max != 0) && (png_ptr->user_chunk_malloc_max < profile_length))" ( (binary_expression "(png_ptr->user_chunk_malloc_max != 0) && (png_ptr->user_chunk_malloc_max < profile_length)" (parenthesized_expression "(png_ptr->user_chunk_malloc_max != 0)" ( (binary_expression "png_ptr->user_chunk_malloc_max != 0" (field_expression "png_ptr->user_chunk_malloc_max" identifier -> field_identifier) != number_literal) )) && (parenthesized_expression "(png_ptr->user_chunk_malloc_max < profile_length)" ( (binary_expression "png_ptr->user_chunk_malloc_max < profile_length" (field_expression "png_ptr->user_chunk_malloc_max" identifier -> field_identifier) < identifier) ))) )) (compound_statement "{\n    iVar1 = png_icc_profile_error\n                      (png_ptr,colorspace,name,profile_length,"exceeds application limits");\n    return iVar1;\n  }" { (expression_statement "iVar1 = png_icc_profile_error\n                      (png_ptr,colorspace,name,profile_length,"exceeds application limits");" (assignment_expression "iVar1 = png_icc_profile_error\n                      (png_ptr,colorspace,name,profile_length,"exceeds application limits")" identifier = (call_expression "png_icc_profile_error\n                      (png_ptr,colorspace,name,profile_length,"exceeds application limits")" identifier (argument_list "(png_ptr,colorspace,name,profile_length,"exceeds application limits")" ( identifier , identifier , identifier , identifier , (string_literal ""exceeds application limits"" " string_content ") )))) ;) (return_statement "return iVar1;" return identifier ;) })) (return_statement "return 1;" return number_literal ;) })))
(translation_unit "undefined4 FUN_00016220(int param_1,undefined4 param_2,undefined4 param_3,uint param_4)\n\n{\n  int iVar1;\n  undefined4 uVar2;\n  int unaff_EBP;\n  \n  FUN_0001a3d9();\n  if ((param_4 < 0x84) && (iVar1 = FUN_00014c20(param_4,unaff_EBP + 0x2e079), iVar1 == 0)) {\n    return 0;\n  }\n  if ((*(uint *)(param_1 + 0x304) != 0) && (*(uint *)(param_1 + 0x304) < param_4)) {\n    uVar2 = FUN_00014c20();\n    return uVar2;\n  }\n  return 1;\n}\n\n" (function_definition "undefined4 FUN_00016220(int param_1,undefined4 param_2,undefined4 param_3,uint param_4)\n\n{\n  int iVar1;\n  undefined4 uVar2;\n  int unaff_EBP;\n  \n  FUN_0001a3d9();\n  if ((param_4 < 0x84) && (iVar1 = FUN_00014c20(param_4,unaff_EBP + 0x2e079), iVar1 == 0)) {\n    return 0;\n  }\n  if ((*(uint *)(param_1 + 0x304) != 0) && (*(uint *)(param_1 + 0x304) < param_4)) {\n    uVar2 = FUN_00014c20();\n    return uVar2;\n  }\n  return 1;\n}" type_identifier (function_declarator "FUN_00016220(int param_1,undefined4 param_2,undefined4 param_3,uint param_4)" identifier (parameter_list "(int param_1,undefined4 param_2,undefined4 param_3,uint param_4)" ( (parameter_declaration "int param_1" primitive_type identifier) , (parameter_declaration "undefined4 param_2" type_identifier identifier) , (parameter_declaration "undefined4 param_3" type_identifier identifier) , (parameter_declaration "uint param_4" type_identifier identifier) ))) (compound_statement "{\n  int iVar1;\n  undefined4 uVar2;\n  int unaff_EBP;\n  \n  FUN_0001a3d9();\n  if ((param_4 < 0x84) && (iVar1 = FUN_00014c20(param_4,unaff_EBP + 0x2e079), iVar1 == 0)) {\n    return 0;\n  }\n  if ((*(uint *)(param_1 + 0x304) != 0) && (*(uint *)(param_1 + 0x304) < param_4)) {\n    uVar2 = FUN_00014c20();\n    return uVar2;\n  }\n  return 1;\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "undefined4 uVar2;" type_identifier identifier ;) (declaration "int unaff_EBP;" primitive_type identifier ;) (expression_statement "FUN_0001a3d9();" (call_expression "FUN_0001a3d9()" identifier (argument_list "()" ( ))) ;) (if_statement "if ((param_4 < 0x84) && (iVar1 = FUN_00014c20(param_4,unaff_EBP + 0x2e079), iVar1 == 0)) {\n    return 0;\n  }" if (parenthesized_expression "((param_4 < 0x84) && (iVar1 = FUN_00014c20(param_4,unaff_EBP + 0x2e079), iVar1 == 0))" ( (binary_expression "(param_4 < 0x84) && (iVar1 = FUN_00014c20(param_4,unaff_EBP + 0x2e079), iVar1 == 0)" (parenthesized_expression "(param_4 < 0x84)" ( (binary_expression "param_4 < 0x84" identifier < number_literal) )) && (parenthesized_expression "(iVar1 = FUN_00014c20(param_4,unaff_EBP + 0x2e079), iVar1 == 0)" ( (comma_expression "iVar1 = FUN_00014c20(param_4,unaff_EBP + 0x2e079), iVar1 == 0" (assignment_expression "iVar1 = FUN_00014c20(param_4,unaff_EBP + 0x2e079)" identifier = (call_expression "FUN_00014c20(param_4,unaff_EBP + 0x2e079)" identifier (argument_list "(param_4,unaff_EBP + 0x2e079)" ( identifier , (binary_expression "unaff_EBP + 0x2e079" identifier + number_literal) )))) , (binary_expression "iVar1 == 0" identifier == number_literal)) ))) )) (compound_statement "{\n    return 0;\n  }" { (return_statement "return 0;" return number_literal ;) })) (if_statement "if ((*(uint *)(param_1 + 0x304) != 0) && (*(uint *)(param_1 + 0x304) < param_4)) {\n    uVar2 = FUN_00014c20();\n    return uVar2;\n  }" if (parenthesized_expression "((*(uint *)(param_1 + 0x304) != 0) && (*(uint *)(param_1 + 0x304) < param_4))" ( (binary_expression "(*(uint *)(param_1 + 0x304) != 0) && (*(uint *)(param_1 + 0x304) < param_4)" (parenthesized_expression "(*(uint *)(param_1 + 0x304) != 0)" ( (binary_expression "*(uint *)(param_1 + 0x304) != 0" (pointer_expression "*(uint *)(param_1 + 0x304)" * (cast_expression "(uint *)(param_1 + 0x304)" ( (type_descriptor "uint *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x304)" ( (binary_expression "param_1 + 0x304" identifier + number_literal) )))) != number_literal) )) && (parenthesized_expression "(*(uint *)(param_1 + 0x304) < param_4)" ( (binary_expression "*(uint *)(param_1 + 0x304) < param_4" (pointer_expression "*(uint *)(param_1 + 0x304)" * (cast_expression "(uint *)(param_1 + 0x304)" ( (type_descriptor "uint *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x304)" ( (binary_expression "param_1 + 0x304" identifier + number_literal) )))) < identifier) ))) )) (compound_statement "{\n    uVar2 = FUN_00014c20();\n    return uVar2;\n  }" { (expression_statement "uVar2 = FUN_00014c20();" (assignment_expression "uVar2 = FUN_00014c20()" identifier = (call_expression "FUN_00014c20()" identifier (argument_list "()" ( )))) ;) (return_statement "return uVar2;" return identifier ;) })) (return_statement "return 1;" return number_literal ;) })))
(translation_unit (function_definition TYPE (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE IDENT) ))) (compound_statement { (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (expression_statement (call_expression IDENT (argument_list ( ))) ;) (if_statement if (parenthesized_expression ( (binary_expression (parenthesized_expression ( (binary_expression IDENT < LIT) )) && (parenthesized_expression ( (comma_expression (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT , (binary_expression IDENT + LIT) )))) , (binary_expression IDENT == LIT)) ))) )) (compound_statement { (return_statement return LIT ;) })) (if_statement if (parenthesized_expression ( (binary_expression (parenthesized_expression ( (binary_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) != LIT) )) && (parenthesized_expression ( (binary_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) < IDENT) ))) )) (compound_statement { (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( )))) ;) (return_statement return IDENT ;) })) (return_statement return LIT ;) })))
(function_definition "undefined4 FUN_00016220(int param_1,undefined4 param_2,undefined4 param_3,uint param_4)\n\n{\n  int iVar1;\n  undefined4 uVar2;\n  int unaff_EBP;\n  \n  FUN_0001a3d9();\n  if ((param_4 < 0x84) && (iVar1 = FUN_00014c20(param_4,unaff_EBP + 0x2e079), iVar1 == 0)) {\n    return 0;\n  }\n  if ((*(uint *)(param_1 + 0x304) != 0) && (*(uint *)(param_1 + 0x304) < param_4)) {\n    uVar2 = FUN_00014c20();\n    return uVar2;\n  }\n  return 1;\n}" (type_identifier "undefined4") (function_declarator "FUN_00016220(int param_1,undefined4 param_2,undefined4 param_3,uint param_4)" (identifier "FUN_00016220") (parameter_list "(int param_1,undefined4 param_2,undefined4 param_3,uint param_4)" (( "(") (parameter_declaration "int param_1" (primitive_type "int") (identifier "param_1")) (, ",") (parameter_declaration "undefined4 param_2" (type_identifier "undefined4") (identifier "param_2")) (, ",") (parameter_declaration "undefined4 param_3" (type_identifier "undefined4") (identifier "param_3")) (, ",") (parameter_declaration "uint param_4" (type_identifier "uint") (identifier "param_4")) () ")"))) (compound_statement "{\n  int iVar1;\n  undefined4 uVar2;\n  int unaff_EBP;\n  \n  FUN_0001a3d9();\n  if ((param_4 < 0x84) && (iVar1 = FUN_00014c20(param_4,unaff_EBP + 0x2e079), iVar1 == 0)) {\n    return 0;\n  }\n  if ((*(uint *)(param_1 + 0x304) != 0) && (*(uint *)(param_1 + 0x304) < param_4)) {\n    uVar2 = FUN_00014c20();\n    return uVar2;\n  }\n  return 1;\n}" ({ "{") (declaration "int iVar1;" (primitive_type "int") (identifier "iVar1") (; ";")) (declaration "undefined4 uVar2;" (type_identifier "undefined4") (identifier "uVar2") (; ";")) (declaration "int unaff_EBP;" (primitive_type "int") (identifier "unaff_EBP") (; ";")) (expression_statement "FUN_0001a3d9();" (call_expression "FUN_0001a3d9()" (identifier "FUN_0001a3d9") (argument_list "()" (( "(") () ")"))) (; ";")) (if_statement "if ((param_4 < 0x84) && (iVar1 = FUN_00014c20(param_4,unaff_EBP + 0x2e079), iVar1 == 0)) {\n    return 0;\n  }" (if "if") (parenthesized_expression "((param_4 < 0x84) && (iVar1 = FUN_00014c20(param_4,unaff_EBP + 0x2e079), iVar1 == 0))" (( "(") (binary_expression "(param_4 < 0x84) && (iVar1 = FUN_00014c20(param_4,unaff_EBP + 0x2e079), iVar1 == 0)" (parenthesized_expression "(param_4 < 0x84)" (( "(") (binary_expression "param_4 < 0x84" (identifier "param_4") (< "<") (number_literal "0x84")) () ")")) (&& "&&") (parenthesized_expression "(iVar1 = FUN_00014c20(param_4,unaff_EBP + 0x2e079), iVar1 == 0)" (( "(") (comma_expression "iVar1 = FUN_00014c20(param_4,unaff_EBP + 0x2e079), iVar1 == 0" (assignment_expression "iVar1 = FUN_00014c20(param_4,unaff_EBP + 0x2e079)" (identifier "iVar1") (= "=") (call_expression "FUN_00014c20(param_4,unaff_EBP + 0x2e079)" (identifier "FUN_00014c20") (argument_list "(param_4,unaff_EBP + 0x2e079)" (( "(") (identifier "param_4") (, ",") (binary_expression "unaff_EBP + 0x2e079" (identifier "unaff_EBP") (+ "+") (number_literal "0x2e079")) () ")")))) (, ",") (binary_expression "iVar1 == 0" (identifier "iVar1") (== "==") (number_literal "0"))) () ")"))) () ")")) (compound_statement "{\n    return 0;\n  }" ({ "{") (return_statement "return 0;" (return "return") (number_literal "0") (; ";")) (} "}"))) (if_statement "if ((*(uint *)(param_1 + 0x304) != 0) && (*(uint *)(param_1 + 0x304) < param_4)) {\n    uVar2 = FUN_00014c20();\n    return uVar2;\n  }" (if "if") (parenthesized_expression "((*(uint *)(param_1 + 0x304) != 0) && (*(uint *)(param_1 + 0x304) < param_4))" (( "(") (binary_expression "(*(uint *)(param_1 + 0x304) != 0) && (*(uint *)(param_1 + 0x304) < param_4)" (parenthesized_expression "(*(uint *)(param_1 + 0x304) != 0)" (( "(") (binary_expression "*(uint *)(param_1 + 0x304) != 0" (pointer_expression "*(uint *)(param_1 + 0x304)" (* "*") (cast_expression "(uint *)(param_1 + 0x304)" (( "(") (type_descriptor "uint *" (type_identifier "uint") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 0x304)" (( "(") (binary_expression "param_1 + 0x304" (identifier "param_1") (+ "+") (number_literal "0x304")) () ")")))) (!= "!=") (number_literal "0")) () ")")) (&& "&&") (parenthesized_expression "(*(uint *)(param_1 + 0x304) < param_4)" (( "(") (binary_expression "*(uint *)(param_1 + 0x304) < param_4" (pointer_expression "*(uint *)(param_1 + 0x304)" (* "*") (cast_expression "(uint *)(param_1 + 0x304)" (( "(") (type_descriptor "uint *" (type_identifier "uint") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 0x304)" (( "(") (binary_expression "param_1 + 0x304" (identifier "param_1") (+ "+") (number_literal "0x304")) () ")")))) (< "<") (identifier "param_4")) () ")"))) () ")")) (compound_statement "{\n    uVar2 = FUN_00014c20();\n    return uVar2;\n  }" ({ "{") (expression_statement "uVar2 = FUN_00014c20();" (assignment_expression "uVar2 = FUN_00014c20()" (identifier "uVar2") (= "=") (call_expression "FUN_00014c20()" (identifier "FUN_00014c20") (argument_list "()" (( "(") () ")")))) (; ";")) (return_statement "return uVar2;" (return "return") (identifier "uVar2") (; ";")) (} "}"))) (return_statement "return 1;" (return "return") (number_literal "1") (; ";")) (} "}")))

/* WARNING: Function: __x86.get_pc_thunk.bp replaced with injection: get_pc_thunk.bp */

int function_1
              (type_1 png_ptr,type_2 colorspace,type_3 name,
              type_4 var_1)

{
  int var_3;
  
  if ((var_1 < 0x84) &&
     (var_3 = var_2(png_ptr,colorspace,name,var_1,"too short"), var_3 == 0)
     ) {
    return 0;
  }
  if ((png_ptr->user_chunk_malloc_max != 0) && (png_ptr->user_chunk_malloc_max < var_1)) {
    var_3 = var_2
                      (png_ptr,colorspace,name,var_1,"exceeds application limits");
    return var_3;
  }
  return 1;
}


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

undefined4 MASKED(int param_1,undefined4 param_2,undefined4 param_3,uint param_4)

{
  int iVar1;
  undefined4 uVar2;
  int unaff_EBP;
  
  FUN_0001a3d9();
  if ((param_4 < 0x84) && (iVar1 = FUN_00014c20(param_4,unaff_EBP + 0x2e079), iVar1 == 0)) {
    return 0;
  }
  if ((*(uint *)(param_1 + 0x304) != 0) && (*(uint *)(param_1 + 0x304) < param_4)) {
    uVar2 = FUN_00014c20();
    return uVar2;
  }
  return 1;
}

