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

int __regparm3 png_cache_unknown_chunk(png_structrp png_ptr,png_uint_32 length)

{
  uint uVar1;
  png_byte *ppVar2;
  
  ppVar2 = (png_ptr->unknown_chunk).data;
  if (ppVar2 != (png_byte *)0x0) {
    png_free(png_ptr,ppVar2);
    (png_ptr->unknown_chunk).data = (png_byte *)0x0;
  }
  if ((png_ptr->user_chunk_malloc_max - 1 < 0xfffffffe) && (png_ptr->user_chunk_malloc_max < length)
     ) {
    ppVar2 = (png_ptr->unknown_chunk).data;
    if (ppVar2 == (png_byte *)0x0) {
      if (length != 0) goto LAB_0002a384;
      goto LAB_0002a33e;
    }
    if (length == 0) goto LAB_0002a33e;
  }
  else {
    uVar1 = png_ptr->chunk_name;
    (png_ptr->unknown_chunk).name[4] = '\0';
    (png_ptr->unknown_chunk).size = length;
    *(uint *)(png_ptr->unknown_chunk).name =
         uVar1 >> 0x18 | (uVar1 & 0xff0000) >> 8 | (uVar1 & 0xff00) << 8 | uVar1 << 0x18;
    (png_ptr->unknown_chunk).location = (png_byte)png_ptr->mode;
    if (length == 0) {
      (png_ptr->unknown_chunk).data = (png_byte *)0x0;
      goto LAB_0002a33e;
    }
    ppVar2 = (png_byte *)png_malloc_warn(png_ptr,length);
    (png_ptr->unknown_chunk).data = ppVar2;
    if (ppVar2 == (png_byte *)0x0) {
LAB_0002a384:
      png_crc_finish(png_ptr,length);
      png_chunk_benign_error(png_ptr,"unknown chunk exceeds memory limits");
      return 0;
    }
  }
  png_crc_read(png_ptr,ppVar2,length);
LAB_0002a33e:
  png_crc_finish(png_ptr,0);
  return 1;
}



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

undefined4 __regparm3 FUN_0002a2b0(int param_1,uint param_2)

{
  uint uVar1;
  int iVar2;
  
  if (*(int *)(param_1 + 0x310) != 0) {
    png_free(param_1,*(int *)(param_1 + 0x310));
    *(undefined4 *)(param_1 + 0x310) = 0;
  }
  if ((*(uint *)(param_1 + 0x304) - 1 < 0xfffffffe) && (*(uint *)(param_1 + 0x304) < param_2)) {
    iVar2 = *(int *)(param_1 + 0x310);
    if (iVar2 == 0) {
      if (param_2 != 0) goto LAB_0002a384;
      goto LAB_0002a33e;
    }
    if (param_2 == 0) goto LAB_0002a33e;
  }
  else {
    uVar1 = *(uint *)(param_1 + 0x178);
    *(undefined1 *)(param_1 + 0x30c) = 0;
    *(uint *)(param_1 + 0x314) = param_2;
    *(uint *)(param_1 + 0x308) =
         uVar1 >> 0x18 | (uVar1 & 0xff0000) >> 8 | (uVar1 & 0xff00) << 8 | uVar1 << 0x18;
    *(char *)(param_1 + 0x318) = (char)*(undefined4 *)(param_1 + 0xd0);
    if (param_2 == 0) {
      *(undefined4 *)(param_1 + 0x310) = 0;
      goto LAB_0002a33e;
    }
    iVar2 = png_malloc_warn(param_1,param_2);
    *(int *)(param_1 + 0x310) = iVar2;
    if (iVar2 == 0) {
LAB_0002a384:
      FUN_0002a1a0(param_1,param_2);
      png_chunk_benign_error(param_1,"unknown chunk exceeds memory limits");
      return 0;
    }
  }
  FUN_0002a080(param_1,iVar2,param_2);
LAB_0002a33e:
  FUN_0002a1a0(param_1,0);
  return 1;
}


PUSH EDI
MOV EDI,EDX
PUSH ESI
MOV ESI,EAX
PUSH EBX
MOV EAX,dword ptr [EAX + 0x310]
CALL 0x00014970
ADD EBX,0x23abe
TEST EAX,EAX
JZ 0x0002a2e3
SUB ESP,0x8
PUSH EAX
PUSH ESI
CALL 0x000147f0
ADD ESP,0x10
MOV dword ptr [ESI + 0x310],0x0
MOV EAX,dword ptr [ESI + 0x304]
LEA EDX,[EAX + -0x1]
CMP EDX,-0x3
JA 0x0002a2f5
CMP EAX,EDI
JC 0x0002a330
MOV EAX,dword ptr [ESI + 0x178]
MOV byte ptr [ESI + 0x30c],0x0
MOV dword ptr [ESI + 0x314],EDI
BSWAP EAX
MOV dword ptr [ESI + 0x308],EAX
MOV EAX,dword ptr [ESI + 0xd0]
MOV byte ptr [ESI + 0x318],AL
TEST EDI,EDI
JNZ 0x0002a358
MOV dword ptr [ESI + 0x310],0x0
JMP 0x0002a33e
MOV EAX,dword ptr [ESI + 0x310]
TEST EAX,EAX
JZ 0x0002a380
TEST EDI,EDI
JNZ 0x0002a36f
SUB ESP,0x8
PUSH 0x0
PUSH ESI
CALL 0x0002a1a0
ADD ESP,0x10
MOV EAX,0x1
POP EBX
POP ESI
POP EDI
RET
SUB ESP,0x8
PUSH EDI
PUSH ESI
CALL 0x00014120
ADD ESP,0x10
MOV dword ptr [ESI + 0x310],EAX
TEST EAX,EAX
JZ 0x0002a384
SUB ESP,0x4
PUSH EDI
PUSH EAX
PUSH ESI
CALL 0x0002a080
ADD ESP,0x10
JMP 0x0002a33e
TEST EDI,EDI
JZ 0x0002a33e
SUB ESP,0x8
PUSH EDI
PUSH ESI
CALL 0x0002a1a0
POP EAX
LEA EAX,[EBX + 0xfffefdbc]
POP EDX
PUSH EAX
PUSH ESI
CALL 0x00014230
ADD ESP,0x10
XOR EAX,EAX
POP EBX
POP ESI
POP EDI
RET
(translation_unit "/* WARNING: Function: __i686.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n\nundefined4 __regparm3 FUN_0002a2b0(int param_1,uint param_2)\n\n{\n  uint uVar1;\n  int iVar2;\n  \n  if (*(int *)(param_1 + 0x310) != 0) {\n    png_free(param_1,*(int *)(param_1 + 0x310));\n    *(undefined4 *)(param_1 + 0x310) = 0;\n  }\n  if ((*(uint *)(param_1 + 0x304) - 1 < 0xfffffffe) && (*(uint *)(param_1 + 0x304) < param_2)) {\n    iVar2 = *(int *)(param_1 + 0x310);\n    if (iVar2 == 0) {\n      if (param_2 != 0) goto LAB_0002a384;\n      goto LAB_0002a33e;\n    }\n    if (param_2 == 0) goto LAB_0002a33e;\n  }\n  else {\n    uVar1 = *(uint *)(param_1 + 0x178);\n    *(undefined1 *)(param_1 + 0x30c) = 0;\n    *(uint *)(param_1 + 0x314) = param_2;\n    *(uint *)(param_1 + 0x308) =\n         uVar1 >> 0x18 | (uVar1 & 0xff0000) >> 8 | (uVar1 & 0xff00) << 8 | uVar1 << 0x18;\n    *(char *)(param_1 + 0x318) = (char)*(undefined4 *)(param_1 + 0xd0);\n    if (param_2 == 0) {\n      *(undefined4 *)(param_1 + 0x310) = 0;\n      goto LAB_0002a33e;\n    }\n    iVar2 = png_malloc_warn(param_1,param_2);\n    *(int *)(param_1 + 0x310) = iVar2;\n    if (iVar2 == 0) {\nLAB_0002a384:\n      FUN_0002a1a0(param_1,param_2);\n      png_chunk_benign_error(param_1,"unknown chunk exceeds memory limits");\n      return 0;\n    }\n  }\n  FUN_0002a080(param_1,iVar2,param_2);\nLAB_0002a33e:\n  FUN_0002a1a0(param_1,0);\n  return 1;\n}\n\n" comment (function_definition "undefined4 __regparm3 FUN_0002a2b0(int param_1,uint param_2)\n\n{\n  uint uVar1;\n  int iVar2;\n  \n  if (*(int *)(param_1 + 0x310) != 0) {\n    png_free(param_1,*(int *)(param_1 + 0x310));\n    *(undefined4 *)(param_1 + 0x310) = 0;\n  }\n  if ((*(uint *)(param_1 + 0x304) - 1 < 0xfffffffe) && (*(uint *)(param_1 + 0x304) < param_2)) {\n    iVar2 = *(int *)(param_1 + 0x310);\n    if (iVar2 == 0) {\n      if (param_2 != 0) goto LAB_0002a384;\n      goto LAB_0002a33e;\n    }\n    if (param_2 == 0) goto LAB_0002a33e;\n  }\n  else {\n    uVar1 = *(uint *)(param_1 + 0x178);\n    *(undefined1 *)(param_1 + 0x30c) = 0;\n    *(uint *)(param_1 + 0x314) = param_2;\n    *(uint *)(param_1 + 0x308) =\n         uVar1 >> 0x18 | (uVar1 & 0xff0000) >> 8 | (uVar1 & 0xff00) << 8 | uVar1 << 0x18;\n    *(char *)(param_1 + 0x318) = (char)*(undefined4 *)(param_1 + 0xd0);\n    if (param_2 == 0) {\n      *(undefined4 *)(param_1 + 0x310) = 0;\n      goto LAB_0002a33e;\n    }\n    iVar2 = png_malloc_warn(param_1,param_2);\n    *(int *)(param_1 + 0x310) = iVar2;\n    if (iVar2 == 0) {\nLAB_0002a384:\n      FUN_0002a1a0(param_1,param_2);\n      png_chunk_benign_error(param_1,"unknown chunk exceeds memory limits");\n      return 0;\n    }\n  }\n  FUN_0002a080(param_1,iVar2,param_2);\nLAB_0002a33e:\n  FUN_0002a1a0(param_1,0);\n  return 1;\n}" type_identifier (ERROR "__regparm3" identifier) (function_declarator "FUN_0002a2b0(int param_1,uint param_2)" identifier (parameter_list "(int param_1,uint param_2)" ( (parameter_declaration "int param_1" primitive_type identifier) , (parameter_declaration "uint param_2" type_identifier identifier) ))) (compound_statement "{\n  uint uVar1;\n  int iVar2;\n  \n  if (*(int *)(param_1 + 0x310) != 0) {\n    png_free(param_1,*(int *)(param_1 + 0x310));\n    *(undefined4 *)(param_1 + 0x310) = 0;\n  }\n  if ((*(uint *)(param_1 + 0x304) - 1 < 0xfffffffe) && (*(uint *)(param_1 + 0x304) < param_2)) {\n    iVar2 = *(int *)(param_1 + 0x310);\n    if (iVar2 == 0) {\n      if (param_2 != 0) goto LAB_0002a384;\n      goto LAB_0002a33e;\n    }\n    if (param_2 == 0) goto LAB_0002a33e;\n  }\n  else {\n    uVar1 = *(uint *)(param_1 + 0x178);\n    *(undefined1 *)(param_1 + 0x30c) = 0;\n    *(uint *)(param_1 + 0x314) = param_2;\n    *(uint *)(param_1 + 0x308) =\n         uVar1 >> 0x18 | (uVar1 & 0xff0000) >> 8 | (uVar1 & 0xff00) << 8 | uVar1 << 0x18;\n    *(char *)(param_1 + 0x318) = (char)*(undefined4 *)(param_1 + 0xd0);\n    if (param_2 == 0) {\n      *(undefined4 *)(param_1 + 0x310) = 0;\n      goto LAB_0002a33e;\n    }\n    iVar2 = png_malloc_warn(param_1,param_2);\n    *(int *)(param_1 + 0x310) = iVar2;\n    if (iVar2 == 0) {\nLAB_0002a384:\n      FUN_0002a1a0(param_1,param_2);\n      png_chunk_benign_error(param_1,"unknown chunk exceeds memory limits");\n      return 0;\n    }\n  }\n  FUN_0002a080(param_1,iVar2,param_2);\nLAB_0002a33e:\n  FUN_0002a1a0(param_1,0);\n  return 1;\n}" { (declaration "uint uVar1;" type_identifier identifier ;) (declaration "int iVar2;" primitive_type identifier ;) (if_statement "if (*(int *)(param_1 + 0x310) != 0) {\n    png_free(param_1,*(int *)(param_1 + 0x310));\n    *(undefined4 *)(param_1 + 0x310) = 0;\n  }" if (parenthesized_expression "(*(int *)(param_1 + 0x310) != 0)" ( (binary_expression "*(int *)(param_1 + 0x310) != 0" (pointer_expression "*(int *)(param_1 + 0x310)" * (cast_expression "(int *)(param_1 + 0x310)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x310)" ( (binary_expression "param_1 + 0x310" identifier + number_literal) )))) != number_literal) )) (compound_statement "{\n    png_free(param_1,*(int *)(param_1 + 0x310));\n    *(undefined4 *)(param_1 + 0x310) = 0;\n  }" { (expression_statement "png_free(param_1,*(int *)(param_1 + 0x310));" (call_expression "png_free(param_1,*(int *)(param_1 + 0x310))" identifier (argument_list "(param_1,*(int *)(param_1 + 0x310))" ( identifier , (pointer_expression "*(int *)(param_1 + 0x310)" * (cast_expression "(int *)(param_1 + 0x310)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x310)" ( (binary_expression "param_1 + 0x310" identifier + number_literal) )))) ))) ;) (expression_statement "*(undefined4 *)(param_1 + 0x310) = 0;" (assignment_expression "*(undefined4 *)(param_1 + 0x310) = 0" (pointer_expression "*(undefined4 *)(param_1 + 0x310)" * (cast_expression "(undefined4 *)(param_1 + 0x310)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x310)" ( (binary_expression "param_1 + 0x310" identifier + number_literal) )))) = number_literal) ;) })) (if_statement "if ((*(uint *)(param_1 + 0x304) - 1 < 0xfffffffe) && (*(uint *)(param_1 + 0x304) < param_2)) {\n    iVar2 = *(int *)(param_1 + 0x310);\n    if (iVar2 == 0) {\n      if (param_2 != 0) goto LAB_0002a384;\n      goto LAB_0002a33e;\n    }\n    if (param_2 == 0) goto LAB_0002a33e;\n  }\n  else {\n    uVar1 = *(uint *)(param_1 + 0x178);\n    *(undefined1 *)(param_1 + 0x30c) = 0;\n    *(uint *)(param_1 + 0x314) = param_2;\n    *(uint *)(param_1 + 0x308) =\n         uVar1 >> 0x18 | (uVar1 & 0xff0000) >> 8 | (uVar1 & 0xff00) << 8 | uVar1 << 0x18;\n    *(char *)(param_1 + 0x318) = (char)*(undefined4 *)(param_1 + 0xd0);\n    if (param_2 == 0) {\n      *(undefined4 *)(param_1 + 0x310) = 0;\n      goto LAB_0002a33e;\n    }\n    iVar2 = png_malloc_warn(param_1,param_2);\n    *(int *)(param_1 + 0x310) = iVar2;\n    if (iVar2 == 0) {\nLAB_0002a384:\n      FUN_0002a1a0(param_1,param_2);\n      png_chunk_benign_error(param_1,"unknown chunk exceeds memory limits");\n      return 0;\n    }\n  }" if (parenthesized_expression "((*(uint *)(param_1 + 0x304) - 1 < 0xfffffffe) && (*(uint *)(param_1 + 0x304) < param_2))" ( (binary_expression "(*(uint *)(param_1 + 0x304) - 1 < 0xfffffffe) && (*(uint *)(param_1 + 0x304) < param_2)" (parenthesized_expression "(*(uint *)(param_1 + 0x304) - 1 < 0xfffffffe)" ( (binary_expression "*(uint *)(param_1 + 0x304) - 1 < 0xfffffffe" (binary_expression "*(uint *)(param_1 + 0x304) - 1" (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) < number_literal) )) && (parenthesized_expression "(*(uint *)(param_1 + 0x304) < param_2)" ( (binary_expression "*(uint *)(param_1 + 0x304) < param_2" (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    iVar2 = *(int *)(param_1 + 0x310);\n    if (iVar2 == 0) {\n      if (param_2 != 0) goto LAB_0002a384;\n      goto LAB_0002a33e;\n    }\n    if (param_2 == 0) goto LAB_0002a33e;\n  }" { (expression_statement "iVar2 = *(int *)(param_1 + 0x310);" (assignment_expression "iVar2 = *(int *)(param_1 + 0x310)" identifier = (pointer_expression "*(int *)(param_1 + 0x310)" * (cast_expression "(int *)(param_1 + 0x310)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x310)" ( (binary_expression "param_1 + 0x310" identifier + number_literal) ))))) ;) (if_statement "if (iVar2 == 0) {\n      if (param_2 != 0) goto LAB_0002a384;\n      goto LAB_0002a33e;\n    }" if (parenthesized_expression "(iVar2 == 0)" ( (binary_expression "iVar2 == 0" identifier == number_literal) )) (compound_statement "{\n      if (param_2 != 0) goto LAB_0002a384;\n      goto LAB_0002a33e;\n    }" { (if_statement "if (param_2 != 0) goto LAB_0002a384;" if (parenthesized_expression "(param_2 != 0)" ( (binary_expression "param_2 != 0" identifier != number_literal) )) (goto_statement "goto LAB_0002a384;" goto statement_identifier ;)) (goto_statement "goto LAB_0002a33e;" goto statement_identifier ;) })) (if_statement "if (param_2 == 0) goto LAB_0002a33e;" if (parenthesized_expression "(param_2 == 0)" ( (binary_expression "param_2 == 0" identifier == number_literal) )) (goto_statement "goto LAB_0002a33e;" goto statement_identifier ;)) }) (else_clause "else {\n    uVar1 = *(uint *)(param_1 + 0x178);\n    *(undefined1 *)(param_1 + 0x30c) = 0;\n    *(uint *)(param_1 + 0x314) = param_2;\n    *(uint *)(param_1 + 0x308) =\n         uVar1 >> 0x18 | (uVar1 & 0xff0000) >> 8 | (uVar1 & 0xff00) << 8 | uVar1 << 0x18;\n    *(char *)(param_1 + 0x318) = (char)*(undefined4 *)(param_1 + 0xd0);\n    if (param_2 == 0) {\n      *(undefined4 *)(param_1 + 0x310) = 0;\n      goto LAB_0002a33e;\n    }\n    iVar2 = png_malloc_warn(param_1,param_2);\n    *(int *)(param_1 + 0x310) = iVar2;\n    if (iVar2 == 0) {\nLAB_0002a384:\n      FUN_0002a1a0(param_1,param_2);\n      png_chunk_benign_error(param_1,"unknown chunk exceeds memory limits");\n      return 0;\n    }\n  }" else (compound_statement "{\n    uVar1 = *(uint *)(param_1 + 0x178);\n    *(undefined1 *)(param_1 + 0x30c) = 0;\n    *(uint *)(param_1 + 0x314) = param_2;\n    *(uint *)(param_1 + 0x308) =\n         uVar1 >> 0x18 | (uVar1 & 0xff0000) >> 8 | (uVar1 & 0xff00) << 8 | uVar1 << 0x18;\n    *(char *)(param_1 + 0x318) = (char)*(undefined4 *)(param_1 + 0xd0);\n    if (param_2 == 0) {\n      *(undefined4 *)(param_1 + 0x310) = 0;\n      goto LAB_0002a33e;\n    }\n    iVar2 = png_malloc_warn(param_1,param_2);\n    *(int *)(param_1 + 0x310) = iVar2;\n    if (iVar2 == 0) {\nLAB_0002a384:\n      FUN_0002a1a0(param_1,param_2);\n      png_chunk_benign_error(param_1,"unknown chunk exceeds memory limits");\n      return 0;\n    }\n  }" { (expression_statement "uVar1 = *(uint *)(param_1 + 0x178);" (assignment_expression "uVar1 = *(uint *)(param_1 + 0x178)" identifier = (pointer_expression "*(uint *)(param_1 + 0x178)" * (cast_expression "(uint *)(param_1 + 0x178)" ( (type_descriptor "uint *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x178)" ( (binary_expression "param_1 + 0x178" identifier + number_literal) ))))) ;) (expression_statement "*(undefined1 *)(param_1 + 0x30c) = 0;" (assignment_expression "*(undefined1 *)(param_1 + 0x30c) = 0" (pointer_expression "*(undefined1 *)(param_1 + 0x30c)" * (cast_expression "(undefined1 *)(param_1 + 0x30c)" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x30c)" ( (binary_expression "param_1 + 0x30c" identifier + number_literal) )))) = number_literal) ;) (expression_statement "*(uint *)(param_1 + 0x314) = param_2;" (assignment_expression "*(uint *)(param_1 + 0x314) = param_2" (pointer_expression "*(uint *)(param_1 + 0x314)" * (cast_expression "(uint *)(param_1 + 0x314)" ( (type_descriptor "uint *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x314)" ( (binary_expression "param_1 + 0x314" identifier + number_literal) )))) = identifier) ;) (expression_statement "*(uint *)(param_1 + 0x308) =\n         uVar1 >> 0x18 | (uVar1 & 0xff0000) >> 8 | (uVar1 & 0xff00) << 8 | uVar1 << 0x18;" (assignment_expression "*(uint *)(param_1 + 0x308) =\n         uVar1 >> 0x18 | (uVar1 & 0xff0000) >> 8 | (uVar1 & 0xff00) << 8 | uVar1 << 0x18" (pointer_expression "*(uint *)(param_1 + 0x308)" * (cast_expression "(uint *)(param_1 + 0x308)" ( (type_descriptor "uint *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x308)" ( (binary_expression "param_1 + 0x308" identifier + number_literal) )))) = (binary_expression "uVar1 >> 0x18 | (uVar1 & 0xff0000) >> 8 | (uVar1 & 0xff00) << 8 | uVar1 << 0x18" (binary_expression "uVar1 >> 0x18 | (uVar1 & 0xff0000) >> 8 | (uVar1 & 0xff00) << 8" (binary_expression "uVar1 >> 0x18 | (uVar1 & 0xff0000) >> 8" (binary_expression "uVar1 >> 0x18" identifier >> number_literal) | (binary_expression "(uVar1 & 0xff0000) >> 8" (parenthesized_expression "(uVar1 & 0xff0000)" ( (binary_expression "uVar1 & 0xff0000" identifier & number_literal) )) >> number_literal)) | (binary_expression "(uVar1 & 0xff00) << 8" (parenthesized_expression "(uVar1 & 0xff00)" ( (binary_expression "uVar1 & 0xff00" identifier & number_literal) )) << number_literal)) | (binary_expression "uVar1 << 0x18" identifier << number_literal))) ;) (expression_statement "*(char *)(param_1 + 0x318) = (char)*(undefined4 *)(param_1 + 0xd0);" (assignment_expression "*(char *)(param_1 + 0x318) = (char)*(undefined4 *)(param_1 + 0xd0)" (pointer_expression "*(char *)(param_1 + 0x318)" * (cast_expression "(char *)(param_1 + 0x318)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x318)" ( (binary_expression "param_1 + 0x318" identifier + number_literal) )))) = (cast_expression "(char)*(undefined4 *)(param_1 + 0xd0)" ( (type_descriptor "char" primitive_type) ) (pointer_expression "*(undefined4 *)(param_1 + 0xd0)" * (cast_expression "(undefined4 *)(param_1 + 0xd0)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0xd0)" ( (binary_expression "param_1 + 0xd0" identifier + number_literal) )))))) ;) (if_statement "if (param_2 == 0) {\n      *(undefined4 *)(param_1 + 0x310) = 0;\n      goto LAB_0002a33e;\n    }" if (parenthesized_expression "(param_2 == 0)" ( (binary_expression "param_2 == 0" identifier == number_literal) )) (compound_statement "{\n      *(undefined4 *)(param_1 + 0x310) = 0;\n      goto LAB_0002a33e;\n    }" { (expression_statement "*(undefined4 *)(param_1 + 0x310) = 0;" (assignment_expression "*(undefined4 *)(param_1 + 0x310) = 0" (pointer_expression "*(undefined4 *)(param_1 + 0x310)" * (cast_expression "(undefined4 *)(param_1 + 0x310)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x310)" ( (binary_expression "param_1 + 0x310" identifier + number_literal) )))) = number_literal) ;) (goto_statement "goto LAB_0002a33e;" goto statement_identifier ;) })) (expression_statement "iVar2 = png_malloc_warn(param_1,param_2);" (assignment_expression "iVar2 = png_malloc_warn(param_1,param_2)" identifier = (call_expression "png_malloc_warn(param_1,param_2)" identifier (argument_list "(param_1,param_2)" ( identifier , identifier )))) ;) (expression_statement "*(int *)(param_1 + 0x310) = iVar2;" (assignment_expression "*(int *)(param_1 + 0x310) = iVar2" (pointer_expression "*(int *)(param_1 + 0x310)" * (cast_expression "(int *)(param_1 + 0x310)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x310)" ( (binary_expression "param_1 + 0x310" identifier + number_literal) )))) = identifier) ;) (if_statement "if (iVar2 == 0) {\nLAB_0002a384:\n      FUN_0002a1a0(param_1,param_2);\n      png_chunk_benign_error(param_1,"unknown chunk exceeds memory limits");\n      return 0;\n    }" if (parenthesized_expression "(iVar2 == 0)" ( (binary_expression "iVar2 == 0" identifier == number_literal) )) (compound_statement "{\nLAB_0002a384:\n      FUN_0002a1a0(param_1,param_2);\n      png_chunk_benign_error(param_1,"unknown chunk exceeds memory limits");\n      return 0;\n    }" { (labeled_statement "LAB_0002a384:\n      FUN_0002a1a0(param_1,param_2);" statement_identifier : (expression_statement "FUN_0002a1a0(param_1,param_2);" (call_expression "FUN_0002a1a0(param_1,param_2)" identifier (argument_list "(param_1,param_2)" ( identifier , identifier ))) ;)) (expression_statement "png_chunk_benign_error(param_1,"unknown chunk exceeds memory limits");" (call_expression "png_chunk_benign_error(param_1,"unknown chunk exceeds memory limits")" identifier (argument_list "(param_1,"unknown chunk exceeds memory limits")" ( identifier , (string_literal ""unknown chunk exceeds memory limits"" " string_content ") ))) ;) (return_statement "return 0;" return number_literal ;) })) }))) (expression_statement "FUN_0002a080(param_1,iVar2,param_2);" (call_expression "FUN_0002a080(param_1,iVar2,param_2)" identifier (argument_list "(param_1,iVar2,param_2)" ( identifier , identifier , identifier ))) ;) (labeled_statement "LAB_0002a33e:\n  FUN_0002a1a0(param_1,0);" statement_identifier : (expression_statement "FUN_0002a1a0(param_1,0);" (call_expression "FUN_0002a1a0(param_1,0)" identifier (argument_list "(param_1,0)" ( identifier , number_literal ))) ;)) (return_statement "return 1;" return number_literal ;) })))
(translation_unit "/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n\nint __regparm3 png_cache_unknown_chunk(png_structrp png_ptr,png_uint_32 length)\n\n{\n  uint uVar1;\n  png_byte *ppVar2;\n  \n  ppVar2 = (png_ptr->unknown_chunk).data;\n  if (ppVar2 != (png_byte *)0x0) {\n    png_free(png_ptr,ppVar2);\n    (png_ptr->unknown_chunk).data = (png_byte *)0x0;\n  }\n  if ((png_ptr->user_chunk_malloc_max - 1 < 0xfffffffe) && (png_ptr->user_chunk_malloc_max < length)\n     ) {\n    ppVar2 = (png_ptr->unknown_chunk).data;\n    if (ppVar2 == (png_byte *)0x0) {\n      if (length != 0) goto LAB_0002a384;\n      goto LAB_0002a33e;\n    }\n    if (length == 0) goto LAB_0002a33e;\n  }\n  else {\n    uVar1 = png_ptr->chunk_name;\n    (png_ptr->unknown_chunk).name[4] = '\0';\n    (png_ptr->unknown_chunk).size = length;\n    *(uint *)(png_ptr->unknown_chunk).name =\n         uVar1 >> 0x18 | (uVar1 & 0xff0000) >> 8 | (uVar1 & 0xff00) << 8 | uVar1 << 0x18;\n    (png_ptr->unknown_chunk).location = (png_byte)png_ptr->mode;\n    if (length == 0) {\n      (png_ptr->unknown_chunk).data = (png_byte *)0x0;\n      goto LAB_0002a33e;\n    }\n    ppVar2 = (png_byte *)png_malloc_warn(png_ptr,length);\n    (png_ptr->unknown_chunk).data = ppVar2;\n    if (ppVar2 == (png_byte *)0x0) {\nLAB_0002a384:\n      png_crc_finish(png_ptr,length);\n      png_chunk_benign_error(png_ptr,"unknown chunk exceeds memory limits");\n      return 0;\n    }\n  }\n  png_crc_read(png_ptr,ppVar2,length);\nLAB_0002a33e:\n  png_crc_finish(png_ptr,0);\n  return 1;\n}\n\n" comment (function_definition "int __regparm3 png_cache_unknown_chunk(png_structrp png_ptr,png_uint_32 length)\n\n{\n  uint uVar1;\n  png_byte *ppVar2;\n  \n  ppVar2 = (png_ptr->unknown_chunk).data;\n  if (ppVar2 != (png_byte *)0x0) {\n    png_free(png_ptr,ppVar2);\n    (png_ptr->unknown_chunk).data = (png_byte *)0x0;\n  }\n  if ((png_ptr->user_chunk_malloc_max - 1 < 0xfffffffe) && (png_ptr->user_chunk_malloc_max < length)\n     ) {\n    ppVar2 = (png_ptr->unknown_chunk).data;\n    if (ppVar2 == (png_byte *)0x0) {\n      if (length != 0) goto LAB_0002a384;\n      goto LAB_0002a33e;\n    }\n    if (length == 0) goto LAB_0002a33e;\n  }\n  else {\n    uVar1 = png_ptr->chunk_name;\n    (png_ptr->unknown_chunk).name[4] = '\0';\n    (png_ptr->unknown_chunk).size = length;\n    *(uint *)(png_ptr->unknown_chunk).name =\n         uVar1 >> 0x18 | (uVar1 & 0xff0000) >> 8 | (uVar1 & 0xff00) << 8 | uVar1 << 0x18;\n    (png_ptr->unknown_chunk).location = (png_byte)png_ptr->mode;\n    if (length == 0) {\n      (png_ptr->unknown_chunk).data = (png_byte *)0x0;\n      goto LAB_0002a33e;\n    }\n    ppVar2 = (png_byte *)png_malloc_warn(png_ptr,length);\n    (png_ptr->unknown_chunk).data = ppVar2;\n    if (ppVar2 == (png_byte *)0x0) {\nLAB_0002a384:\n      png_crc_finish(png_ptr,length);\n      png_chunk_benign_error(png_ptr,"unknown chunk exceeds memory limits");\n      return 0;\n    }\n  }\n  png_crc_read(png_ptr,ppVar2,length);\nLAB_0002a33e:\n  png_crc_finish(png_ptr,0);\n  return 1;\n}" primitive_type (ERROR "__regparm3" identifier) (function_declarator "png_cache_unknown_chunk(png_structrp png_ptr,png_uint_32 length)" identifier (parameter_list "(png_structrp png_ptr,png_uint_32 length)" ( (parameter_declaration "png_structrp png_ptr" type_identifier identifier) , (parameter_declaration "png_uint_32 length" type_identifier identifier) ))) (compound_statement "{\n  uint uVar1;\n  png_byte *ppVar2;\n  \n  ppVar2 = (png_ptr->unknown_chunk).data;\n  if (ppVar2 != (png_byte *)0x0) {\n    png_free(png_ptr,ppVar2);\n    (png_ptr->unknown_chunk).data = (png_byte *)0x0;\n  }\n  if ((png_ptr->user_chunk_malloc_max - 1 < 0xfffffffe) && (png_ptr->user_chunk_malloc_max < length)\n     ) {\n    ppVar2 = (png_ptr->unknown_chunk).data;\n    if (ppVar2 == (png_byte *)0x0) {\n      if (length != 0) goto LAB_0002a384;\n      goto LAB_0002a33e;\n    }\n    if (length == 0) goto LAB_0002a33e;\n  }\n  else {\n    uVar1 = png_ptr->chunk_name;\n    (png_ptr->unknown_chunk).name[4] = '\0';\n    (png_ptr->unknown_chunk).size = length;\n    *(uint *)(png_ptr->unknown_chunk).name =\n         uVar1 >> 0x18 | (uVar1 & 0xff0000) >> 8 | (uVar1 & 0xff00) << 8 | uVar1 << 0x18;\n    (png_ptr->unknown_chunk).location = (png_byte)png_ptr->mode;\n    if (length == 0) {\n      (png_ptr->unknown_chunk).data = (png_byte *)0x0;\n      goto LAB_0002a33e;\n    }\n    ppVar2 = (png_byte *)png_malloc_warn(png_ptr,length);\n    (png_ptr->unknown_chunk).data = ppVar2;\n    if (ppVar2 == (png_byte *)0x0) {\nLAB_0002a384:\n      png_crc_finish(png_ptr,length);\n      png_chunk_benign_error(png_ptr,"unknown chunk exceeds memory limits");\n      return 0;\n    }\n  }\n  png_crc_read(png_ptr,ppVar2,length);\nLAB_0002a33e:\n  png_crc_finish(png_ptr,0);\n  return 1;\n}" { (declaration "uint uVar1;" type_identifier identifier ;) (declaration "png_byte *ppVar2;" type_identifier (pointer_declarator "*ppVar2" * identifier) ;) (expression_statement "ppVar2 = (png_ptr->unknown_chunk).data;" (assignment_expression "ppVar2 = (png_ptr->unknown_chunk).data" identifier = (field_expression "(png_ptr->unknown_chunk).data" (parenthesized_expression "(png_ptr->unknown_chunk)" ( (field_expression "png_ptr->unknown_chunk" identifier -> field_identifier) )) . field_identifier)) ;) (if_statement "if (ppVar2 != (png_byte *)0x0) {\n    png_free(png_ptr,ppVar2);\n    (png_ptr->unknown_chunk).data = (png_byte *)0x0;\n  }" if (parenthesized_expression "(ppVar2 != (png_byte *)0x0)" ( (binary_expression "ppVar2 != (png_byte *)0x0" identifier != (cast_expression "(png_byte *)0x0" ( (type_descriptor "png_byte *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n    png_free(png_ptr,ppVar2);\n    (png_ptr->unknown_chunk).data = (png_byte *)0x0;\n  }" { (expression_statement "png_free(png_ptr,ppVar2);" (call_expression "png_free(png_ptr,ppVar2)" identifier (argument_list "(png_ptr,ppVar2)" ( identifier , identifier ))) ;) (expression_statement "(png_ptr->unknown_chunk).data = (png_byte *)0x0;" (assignment_expression "(png_ptr->unknown_chunk).data = (png_byte *)0x0" (field_expression "(png_ptr->unknown_chunk).data" (parenthesized_expression "(png_ptr->unknown_chunk)" ( (field_expression "png_ptr->unknown_chunk" identifier -> field_identifier) )) . field_identifier) = (cast_expression "(png_byte *)0x0" ( (type_descriptor "png_byte *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) ;) })) (if_statement "if ((png_ptr->user_chunk_malloc_max - 1 < 0xfffffffe) && (png_ptr->user_chunk_malloc_max < length)\n     ) {\n    ppVar2 = (png_ptr->unknown_chunk).data;\n    if (ppVar2 == (png_byte *)0x0) {\n      if (length != 0) goto LAB_0002a384;\n      goto LAB_0002a33e;\n    }\n    if (length == 0) goto LAB_0002a33e;\n  }\n  else {\n    uVar1 = png_ptr->chunk_name;\n    (png_ptr->unknown_chunk).name[4] = '\0';\n    (png_ptr->unknown_chunk).size = length;\n    *(uint *)(png_ptr->unknown_chunk).name =\n         uVar1 >> 0x18 | (uVar1 & 0xff0000) >> 8 | (uVar1 & 0xff00) << 8 | uVar1 << 0x18;\n    (png_ptr->unknown_chunk).location = (png_byte)png_ptr->mode;\n    if (length == 0) {\n      (png_ptr->unknown_chunk).data = (png_byte *)0x0;\n      goto LAB_0002a33e;\n    }\n    ppVar2 = (png_byte *)png_malloc_warn(png_ptr,length);\n    (png_ptr->unknown_chunk).data = ppVar2;\n    if (ppVar2 == (png_byte *)0x0) {\nLAB_0002a384:\n      png_crc_finish(png_ptr,length);\n      png_chunk_benign_error(png_ptr,"unknown chunk exceeds memory limits");\n      return 0;\n    }\n  }" if (parenthesized_expression "((png_ptr->user_chunk_malloc_max - 1 < 0xfffffffe) && (png_ptr->user_chunk_malloc_max < length)\n     )" ( (binary_expression "(png_ptr->user_chunk_malloc_max - 1 < 0xfffffffe) && (png_ptr->user_chunk_malloc_max < length)" (parenthesized_expression "(png_ptr->user_chunk_malloc_max - 1 < 0xfffffffe)" ( (binary_expression "png_ptr->user_chunk_malloc_max - 1 < 0xfffffffe" (binary_expression "png_ptr->user_chunk_malloc_max - 1" (field_expression "png_ptr->user_chunk_malloc_max" identifier -> field_identifier) - number_literal) < number_literal) )) && (parenthesized_expression "(png_ptr->user_chunk_malloc_max < length)" ( (binary_expression "png_ptr->user_chunk_malloc_max < length" (field_expression "png_ptr->user_chunk_malloc_max" identifier -> field_identifier) < identifier) ))) )) (compound_statement "{\n    ppVar2 = (png_ptr->unknown_chunk).data;\n    if (ppVar2 == (png_byte *)0x0) {\n      if (length != 0) goto LAB_0002a384;\n      goto LAB_0002a33e;\n    }\n    if (length == 0) goto LAB_0002a33e;\n  }" { (expression_statement "ppVar2 = (png_ptr->unknown_chunk).data;" (assignment_expression "ppVar2 = (png_ptr->unknown_chunk).data" identifier = (field_expression "(png_ptr->unknown_chunk).data" (parenthesized_expression "(png_ptr->unknown_chunk)" ( (field_expression "png_ptr->unknown_chunk" identifier -> field_identifier) )) . field_identifier)) ;) (if_statement "if (ppVar2 == (png_byte *)0x0) {\n      if (length != 0) goto LAB_0002a384;\n      goto LAB_0002a33e;\n    }" if (parenthesized_expression "(ppVar2 == (png_byte *)0x0)" ( (binary_expression "ppVar2 == (png_byte *)0x0" identifier == (cast_expression "(png_byte *)0x0" ( (type_descriptor "png_byte *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n      if (length != 0) goto LAB_0002a384;\n      goto LAB_0002a33e;\n    }" { (if_statement "if (length != 0) goto LAB_0002a384;" if (parenthesized_expression "(length != 0)" ( (binary_expression "length != 0" identifier != number_literal) )) (goto_statement "goto LAB_0002a384;" goto statement_identifier ;)) (goto_statement "goto LAB_0002a33e;" goto statement_identifier ;) })) (if_statement "if (length == 0) goto LAB_0002a33e;" if (parenthesized_expression "(length == 0)" ( (binary_expression "length == 0" identifier == number_literal) )) (goto_statement "goto LAB_0002a33e;" goto statement_identifier ;)) }) (else_clause "else {\n    uVar1 = png_ptr->chunk_name;\n    (png_ptr->unknown_chunk).name[4] = '\0';\n    (png_ptr->unknown_chunk).size = length;\n    *(uint *)(png_ptr->unknown_chunk).name =\n         uVar1 >> 0x18 | (uVar1 & 0xff0000) >> 8 | (uVar1 & 0xff00) << 8 | uVar1 << 0x18;\n    (png_ptr->unknown_chunk).location = (png_byte)png_ptr->mode;\n    if (length == 0) {\n      (png_ptr->unknown_chunk).data = (png_byte *)0x0;\n      goto LAB_0002a33e;\n    }\n    ppVar2 = (png_byte *)png_malloc_warn(png_ptr,length);\n    (png_ptr->unknown_chunk).data = ppVar2;\n    if (ppVar2 == (png_byte *)0x0) {\nLAB_0002a384:\n      png_crc_finish(png_ptr,length);\n      png_chunk_benign_error(png_ptr,"unknown chunk exceeds memory limits");\n      return 0;\n    }\n  }" else (compound_statement "{\n    uVar1 = png_ptr->chunk_name;\n    (png_ptr->unknown_chunk).name[4] = '\0';\n    (png_ptr->unknown_chunk).size = length;\n    *(uint *)(png_ptr->unknown_chunk).name =\n         uVar1 >> 0x18 | (uVar1 & 0xff0000) >> 8 | (uVar1 & 0xff00) << 8 | uVar1 << 0x18;\n    (png_ptr->unknown_chunk).location = (png_byte)png_ptr->mode;\n    if (length == 0) {\n      (png_ptr->unknown_chunk).data = (png_byte *)0x0;\n      goto LAB_0002a33e;\n    }\n    ppVar2 = (png_byte *)png_malloc_warn(png_ptr,length);\n    (png_ptr->unknown_chunk).data = ppVar2;\n    if (ppVar2 == (png_byte *)0x0) {\nLAB_0002a384:\n      png_crc_finish(png_ptr,length);\n      png_chunk_benign_error(png_ptr,"unknown chunk exceeds memory limits");\n      return 0;\n    }\n  }" { (expression_statement "uVar1 = png_ptr->chunk_name;" (assignment_expression "uVar1 = png_ptr->chunk_name" identifier = (field_expression "png_ptr->chunk_name" identifier -> field_identifier)) ;) (expression_statement "(png_ptr->unknown_chunk).name[4] = '\0';" (assignment_expression "(png_ptr->unknown_chunk).name[4] = '\0'" (subscript_expression "(png_ptr->unknown_chunk).name[4]" (field_expression "(png_ptr->unknown_chunk).name" (parenthesized_expression "(png_ptr->unknown_chunk)" ( (field_expression "png_ptr->unknown_chunk" identifier -> field_identifier) )) . field_identifier) [ number_literal ]) = (char_literal "'\0'" ' escape_sequence ')) ;) (expression_statement "(png_ptr->unknown_chunk).size = length;" (assignment_expression "(png_ptr->unknown_chunk).size = length" (field_expression "(png_ptr->unknown_chunk).size" (parenthesized_expression "(png_ptr->unknown_chunk)" ( (field_expression "png_ptr->unknown_chunk" identifier -> field_identifier) )) . field_identifier) = identifier) ;) (expression_statement "*(uint *)(png_ptr->unknown_chunk).name =\n         uVar1 >> 0x18 | (uVar1 & 0xff0000) >> 8 | (uVar1 & 0xff00) << 8 | uVar1 << 0x18;" (assignment_expression "*(uint *)(png_ptr->unknown_chunk).name =\n         uVar1 >> 0x18 | (uVar1 & 0xff0000) >> 8 | (uVar1 & 0xff00) << 8 | uVar1 << 0x18" (pointer_expression "*(uint *)(png_ptr->unknown_chunk).name" * (cast_expression "(uint *)(png_ptr->unknown_chunk).name" ( (type_descriptor "uint *" type_identifier (abstract_pointer_declarator "*" *)) ) (field_expression "(png_ptr->unknown_chunk).name" (parenthesized_expression "(png_ptr->unknown_chunk)" ( (field_expression "png_ptr->unknown_chunk" identifier -> field_identifier) )) . field_identifier))) = (binary_expression "uVar1 >> 0x18 | (uVar1 & 0xff0000) >> 8 | (uVar1 & 0xff00) << 8 | uVar1 << 0x18" (binary_expression "uVar1 >> 0x18 | (uVar1 & 0xff0000) >> 8 | (uVar1 & 0xff00) << 8" (binary_expression "uVar1 >> 0x18 | (uVar1 & 0xff0000) >> 8" (binary_expression "uVar1 >> 0x18" identifier >> number_literal) | (binary_expression "(uVar1 & 0xff0000) >> 8" (parenthesized_expression "(uVar1 & 0xff0000)" ( (binary_expression "uVar1 & 0xff0000" identifier & number_literal) )) >> number_literal)) | (binary_expression "(uVar1 & 0xff00) << 8" (parenthesized_expression "(uVar1 & 0xff00)" ( (binary_expression "uVar1 & 0xff00" identifier & number_literal) )) << number_literal)) | (binary_expression "uVar1 << 0x18" identifier << number_literal))) ;) (expression_statement "(png_ptr->unknown_chunk).location = (png_byte)png_ptr->mode;" (assignment_expression "(png_ptr->unknown_chunk).location = (png_byte)png_ptr->mode" (field_expression "(png_ptr->unknown_chunk).location" (parenthesized_expression "(png_ptr->unknown_chunk)" ( (field_expression "png_ptr->unknown_chunk" identifier -> field_identifier) )) . field_identifier) = (cast_expression "(png_byte)png_ptr->mode" ( (type_descriptor "png_byte" type_identifier) ) (field_expression "png_ptr->mode" identifier -> field_identifier))) ;) (if_statement "if (length == 0) {\n      (png_ptr->unknown_chunk).data = (png_byte *)0x0;\n      goto LAB_0002a33e;\n    }" if (parenthesized_expression "(length == 0)" ( (binary_expression "length == 0" identifier == number_literal) )) (compound_statement "{\n      (png_ptr->unknown_chunk).data = (png_byte *)0x0;\n      goto LAB_0002a33e;\n    }" { (expression_statement "(png_ptr->unknown_chunk).data = (png_byte *)0x0;" (assignment_expression "(png_ptr->unknown_chunk).data = (png_byte *)0x0" (field_expression "(png_ptr->unknown_chunk).data" (parenthesized_expression "(png_ptr->unknown_chunk)" ( (field_expression "png_ptr->unknown_chunk" identifier -> field_identifier) )) . field_identifier) = (cast_expression "(png_byte *)0x0" ( (type_descriptor "png_byte *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) ;) (goto_statement "goto LAB_0002a33e;" goto statement_identifier ;) })) (expression_statement "ppVar2 = (png_byte *)png_malloc_warn(png_ptr,length);" (assignment_expression "ppVar2 = (png_byte *)png_malloc_warn(png_ptr,length)" identifier = (cast_expression "(png_byte *)png_malloc_warn(png_ptr,length)" ( (type_descriptor "png_byte *" type_identifier (abstract_pointer_declarator "*" *)) ) (call_expression "png_malloc_warn(png_ptr,length)" identifier (argument_list "(png_ptr,length)" ( identifier , identifier ))))) ;) (expression_statement "(png_ptr->unknown_chunk).data = ppVar2;" (assignment_expression "(png_ptr->unknown_chunk).data = ppVar2" (field_expression "(png_ptr->unknown_chunk).data" (parenthesized_expression "(png_ptr->unknown_chunk)" ( (field_expression "png_ptr->unknown_chunk" identifier -> field_identifier) )) . field_identifier) = identifier) ;) (if_statement "if (ppVar2 == (png_byte *)0x0) {\nLAB_0002a384:\n      png_crc_finish(png_ptr,length);\n      png_chunk_benign_error(png_ptr,"unknown chunk exceeds memory limits");\n      return 0;\n    }" if (parenthesized_expression "(ppVar2 == (png_byte *)0x0)" ( (binary_expression "ppVar2 == (png_byte *)0x0" identifier == (cast_expression "(png_byte *)0x0" ( (type_descriptor "png_byte *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\nLAB_0002a384:\n      png_crc_finish(png_ptr,length);\n      png_chunk_benign_error(png_ptr,"unknown chunk exceeds memory limits");\n      return 0;\n    }" { (labeled_statement "LAB_0002a384:\n      png_crc_finish(png_ptr,length);" statement_identifier : (expression_statement "png_crc_finish(png_ptr,length);" (call_expression "png_crc_finish(png_ptr,length)" identifier (argument_list "(png_ptr,length)" ( identifier , identifier ))) ;)) (expression_statement "png_chunk_benign_error(png_ptr,"unknown chunk exceeds memory limits");" (call_expression "png_chunk_benign_error(png_ptr,"unknown chunk exceeds memory limits")" identifier (argument_list "(png_ptr,"unknown chunk exceeds memory limits")" ( identifier , (string_literal ""unknown chunk exceeds memory limits"" " string_content ") ))) ;) (return_statement "return 0;" return number_literal ;) })) }))) (expression_statement "png_crc_read(png_ptr,ppVar2,length);" (call_expression "png_crc_read(png_ptr,ppVar2,length)" identifier (argument_list "(png_ptr,ppVar2,length)" ( identifier , identifier , identifier ))) ;) (labeled_statement "LAB_0002a33e:\n  png_crc_finish(png_ptr,0);" statement_identifier : (expression_statement "png_crc_finish(png_ptr,0);" (call_expression "png_crc_finish(png_ptr,0)" identifier (argument_list "(png_ptr,0)" ( identifier , number_literal ))) ;)) (return_statement "return 1;" return number_literal ;) })))
(translation_unit "undefined4 __regparm3 FUN_0002a2b0(int param_1,uint param_2)\n\n{\n  uint uVar1;\n  int iVar2;\n  \n  if (*(int *)(param_1 + 0x310) != 0) {\n    png_free(param_1,*(int *)(param_1 + 0x310));\n    *(undefined4 *)(param_1 + 0x310) = 0;\n  }\n  if ((*(uint *)(param_1 + 0x304) - 1 < 0xfffffffe) && (*(uint *)(param_1 + 0x304) < param_2)) {\n    iVar2 = *(int *)(param_1 + 0x310);\n    if (iVar2 == 0) {\n      if (param_2 != 0) goto LAB_0002a384;\n      goto LAB_0002a33e;\n    }\n    if (param_2 == 0) goto LAB_0002a33e;\n  }\n  else {\n    uVar1 = *(uint *)(param_1 + 0x178);\n    *(undefined1 *)(param_1 + 0x30c) = 0;\n    *(uint *)(param_1 + 0x314) = param_2;\n    *(uint *)(param_1 + 0x308) =\n         uVar1 >> 0x18 | (uVar1 & 0xff0000) >> 8 | (uVar1 & 0xff00) << 8 | uVar1 << 0x18;\n    *(char *)(param_1 + 0x318) = (char)*(undefined4 *)(param_1 + 0xd0);\n    if (param_2 == 0) {\n      *(undefined4 *)(param_1 + 0x310) = 0;\n      goto LAB_0002a33e;\n    }\n    iVar2 = png_malloc_warn(param_1,param_2);\n    *(int *)(param_1 + 0x310) = iVar2;\n    if (iVar2 == 0) {\nLAB_0002a384:\n      FUN_0002a1a0(param_1,param_2);\n      png_chunk_benign_error(param_1,"unknown chunk exceeds memory limits");\n      return 0;\n    }\n  }\n  FUN_0002a080(param_1,iVar2,param_2);\nLAB_0002a33e:\n  FUN_0002a1a0(param_1,0);\n  return 1;\n}\n\n" (function_definition "undefined4 __regparm3 FUN_0002a2b0(int param_1,uint param_2)\n\n{\n  uint uVar1;\n  int iVar2;\n  \n  if (*(int *)(param_1 + 0x310) != 0) {\n    png_free(param_1,*(int *)(param_1 + 0x310));\n    *(undefined4 *)(param_1 + 0x310) = 0;\n  }\n  if ((*(uint *)(param_1 + 0x304) - 1 < 0xfffffffe) && (*(uint *)(param_1 + 0x304) < param_2)) {\n    iVar2 = *(int *)(param_1 + 0x310);\n    if (iVar2 == 0) {\n      if (param_2 != 0) goto LAB_0002a384;\n      goto LAB_0002a33e;\n    }\n    if (param_2 == 0) goto LAB_0002a33e;\n  }\n  else {\n    uVar1 = *(uint *)(param_1 + 0x178);\n    *(undefined1 *)(param_1 + 0x30c) = 0;\n    *(uint *)(param_1 + 0x314) = param_2;\n    *(uint *)(param_1 + 0x308) =\n         uVar1 >> 0x18 | (uVar1 & 0xff0000) >> 8 | (uVar1 & 0xff00) << 8 | uVar1 << 0x18;\n    *(char *)(param_1 + 0x318) = (char)*(undefined4 *)(param_1 + 0xd0);\n    if (param_2 == 0) {\n      *(undefined4 *)(param_1 + 0x310) = 0;\n      goto LAB_0002a33e;\n    }\n    iVar2 = png_malloc_warn(param_1,param_2);\n    *(int *)(param_1 + 0x310) = iVar2;\n    if (iVar2 == 0) {\nLAB_0002a384:\n      FUN_0002a1a0(param_1,param_2);\n      png_chunk_benign_error(param_1,"unknown chunk exceeds memory limits");\n      return 0;\n    }\n  }\n  FUN_0002a080(param_1,iVar2,param_2);\nLAB_0002a33e:\n  FUN_0002a1a0(param_1,0);\n  return 1;\n}" type_identifier (ERROR "__regparm3" identifier) (function_declarator "FUN_0002a2b0(int param_1,uint param_2)" identifier (parameter_list "(int param_1,uint param_2)" ( (parameter_declaration "int param_1" primitive_type identifier) , (parameter_declaration "uint param_2" type_identifier identifier) ))) (compound_statement "{\n  uint uVar1;\n  int iVar2;\n  \n  if (*(int *)(param_1 + 0x310) != 0) {\n    png_free(param_1,*(int *)(param_1 + 0x310));\n    *(undefined4 *)(param_1 + 0x310) = 0;\n  }\n  if ((*(uint *)(param_1 + 0x304) - 1 < 0xfffffffe) && (*(uint *)(param_1 + 0x304) < param_2)) {\n    iVar2 = *(int *)(param_1 + 0x310);\n    if (iVar2 == 0) {\n      if (param_2 != 0) goto LAB_0002a384;\n      goto LAB_0002a33e;\n    }\n    if (param_2 == 0) goto LAB_0002a33e;\n  }\n  else {\n    uVar1 = *(uint *)(param_1 + 0x178);\n    *(undefined1 *)(param_1 + 0x30c) = 0;\n    *(uint *)(param_1 + 0x314) = param_2;\n    *(uint *)(param_1 + 0x308) =\n         uVar1 >> 0x18 | (uVar1 & 0xff0000) >> 8 | (uVar1 & 0xff00) << 8 | uVar1 << 0x18;\n    *(char *)(param_1 + 0x318) = (char)*(undefined4 *)(param_1 + 0xd0);\n    if (param_2 == 0) {\n      *(undefined4 *)(param_1 + 0x310) = 0;\n      goto LAB_0002a33e;\n    }\n    iVar2 = png_malloc_warn(param_1,param_2);\n    *(int *)(param_1 + 0x310) = iVar2;\n    if (iVar2 == 0) {\nLAB_0002a384:\n      FUN_0002a1a0(param_1,param_2);\n      png_chunk_benign_error(param_1,"unknown chunk exceeds memory limits");\n      return 0;\n    }\n  }\n  FUN_0002a080(param_1,iVar2,param_2);\nLAB_0002a33e:\n  FUN_0002a1a0(param_1,0);\n  return 1;\n}" { (declaration "uint uVar1;" type_identifier identifier ;) (declaration "int iVar2;" primitive_type identifier ;) (if_statement "if (*(int *)(param_1 + 0x310) != 0) {\n    png_free(param_1,*(int *)(param_1 + 0x310));\n    *(undefined4 *)(param_1 + 0x310) = 0;\n  }" if (parenthesized_expression "(*(int *)(param_1 + 0x310) != 0)" ( (binary_expression "*(int *)(param_1 + 0x310) != 0" (pointer_expression "*(int *)(param_1 + 0x310)" * (cast_expression "(int *)(param_1 + 0x310)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x310)" ( (binary_expression "param_1 + 0x310" identifier + number_literal) )))) != number_literal) )) (compound_statement "{\n    png_free(param_1,*(int *)(param_1 + 0x310));\n    *(undefined4 *)(param_1 + 0x310) = 0;\n  }" { (expression_statement "png_free(param_1,*(int *)(param_1 + 0x310));" (call_expression "png_free(param_1,*(int *)(param_1 + 0x310))" identifier (argument_list "(param_1,*(int *)(param_1 + 0x310))" ( identifier , (pointer_expression "*(int *)(param_1 + 0x310)" * (cast_expression "(int *)(param_1 + 0x310)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x310)" ( (binary_expression "param_1 + 0x310" identifier + number_literal) )))) ))) ;) (expression_statement "*(undefined4 *)(param_1 + 0x310) = 0;" (assignment_expression "*(undefined4 *)(param_1 + 0x310) = 0" (pointer_expression "*(undefined4 *)(param_1 + 0x310)" * (cast_expression "(undefined4 *)(param_1 + 0x310)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x310)" ( (binary_expression "param_1 + 0x310" identifier + number_literal) )))) = number_literal) ;) })) (if_statement "if ((*(uint *)(param_1 + 0x304) - 1 < 0xfffffffe) && (*(uint *)(param_1 + 0x304) < param_2)) {\n    iVar2 = *(int *)(param_1 + 0x310);\n    if (iVar2 == 0) {\n      if (param_2 != 0) goto LAB_0002a384;\n      goto LAB_0002a33e;\n    }\n    if (param_2 == 0) goto LAB_0002a33e;\n  }\n  else {\n    uVar1 = *(uint *)(param_1 + 0x178);\n    *(undefined1 *)(param_1 + 0x30c) = 0;\n    *(uint *)(param_1 + 0x314) = param_2;\n    *(uint *)(param_1 + 0x308) =\n         uVar1 >> 0x18 | (uVar1 & 0xff0000) >> 8 | (uVar1 & 0xff00) << 8 | uVar1 << 0x18;\n    *(char *)(param_1 + 0x318) = (char)*(undefined4 *)(param_1 + 0xd0);\n    if (param_2 == 0) {\n      *(undefined4 *)(param_1 + 0x310) = 0;\n      goto LAB_0002a33e;\n    }\n    iVar2 = png_malloc_warn(param_1,param_2);\n    *(int *)(param_1 + 0x310) = iVar2;\n    if (iVar2 == 0) {\nLAB_0002a384:\n      FUN_0002a1a0(param_1,param_2);\n      png_chunk_benign_error(param_1,"unknown chunk exceeds memory limits");\n      return 0;\n    }\n  }" if (parenthesized_expression "((*(uint *)(param_1 + 0x304) - 1 < 0xfffffffe) && (*(uint *)(param_1 + 0x304) < param_2))" ( (binary_expression "(*(uint *)(param_1 + 0x304) - 1 < 0xfffffffe) && (*(uint *)(param_1 + 0x304) < param_2)" (parenthesized_expression "(*(uint *)(param_1 + 0x304) - 1 < 0xfffffffe)" ( (binary_expression "*(uint *)(param_1 + 0x304) - 1 < 0xfffffffe" (binary_expression "*(uint *)(param_1 + 0x304) - 1" (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) < number_literal) )) && (parenthesized_expression "(*(uint *)(param_1 + 0x304) < param_2)" ( (binary_expression "*(uint *)(param_1 + 0x304) < param_2" (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    iVar2 = *(int *)(param_1 + 0x310);\n    if (iVar2 == 0) {\n      if (param_2 != 0) goto LAB_0002a384;\n      goto LAB_0002a33e;\n    }\n    if (param_2 == 0) goto LAB_0002a33e;\n  }" { (expression_statement "iVar2 = *(int *)(param_1 + 0x310);" (assignment_expression "iVar2 = *(int *)(param_1 + 0x310)" identifier = (pointer_expression "*(int *)(param_1 + 0x310)" * (cast_expression "(int *)(param_1 + 0x310)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x310)" ( (binary_expression "param_1 + 0x310" identifier + number_literal) ))))) ;) (if_statement "if (iVar2 == 0) {\n      if (param_2 != 0) goto LAB_0002a384;\n      goto LAB_0002a33e;\n    }" if (parenthesized_expression "(iVar2 == 0)" ( (binary_expression "iVar2 == 0" identifier == number_literal) )) (compound_statement "{\n      if (param_2 != 0) goto LAB_0002a384;\n      goto LAB_0002a33e;\n    }" { (if_statement "if (param_2 != 0) goto LAB_0002a384;" if (parenthesized_expression "(param_2 != 0)" ( (binary_expression "param_2 != 0" identifier != number_literal) )) (goto_statement "goto LAB_0002a384;" goto statement_identifier ;)) (goto_statement "goto LAB_0002a33e;" goto statement_identifier ;) })) (if_statement "if (param_2 == 0) goto LAB_0002a33e;" if (parenthesized_expression "(param_2 == 0)" ( (binary_expression "param_2 == 0" identifier == number_literal) )) (goto_statement "goto LAB_0002a33e;" goto statement_identifier ;)) }) (else_clause "else {\n    uVar1 = *(uint *)(param_1 + 0x178);\n    *(undefined1 *)(param_1 + 0x30c) = 0;\n    *(uint *)(param_1 + 0x314) = param_2;\n    *(uint *)(param_1 + 0x308) =\n         uVar1 >> 0x18 | (uVar1 & 0xff0000) >> 8 | (uVar1 & 0xff00) << 8 | uVar1 << 0x18;\n    *(char *)(param_1 + 0x318) = (char)*(undefined4 *)(param_1 + 0xd0);\n    if (param_2 == 0) {\n      *(undefined4 *)(param_1 + 0x310) = 0;\n      goto LAB_0002a33e;\n    }\n    iVar2 = png_malloc_warn(param_1,param_2);\n    *(int *)(param_1 + 0x310) = iVar2;\n    if (iVar2 == 0) {\nLAB_0002a384:\n      FUN_0002a1a0(param_1,param_2);\n      png_chunk_benign_error(param_1,"unknown chunk exceeds memory limits");\n      return 0;\n    }\n  }" else (compound_statement "{\n    uVar1 = *(uint *)(param_1 + 0x178);\n    *(undefined1 *)(param_1 + 0x30c) = 0;\n    *(uint *)(param_1 + 0x314) = param_2;\n    *(uint *)(param_1 + 0x308) =\n         uVar1 >> 0x18 | (uVar1 & 0xff0000) >> 8 | (uVar1 & 0xff00) << 8 | uVar1 << 0x18;\n    *(char *)(param_1 + 0x318) = (char)*(undefined4 *)(param_1 + 0xd0);\n    if (param_2 == 0) {\n      *(undefined4 *)(param_1 + 0x310) = 0;\n      goto LAB_0002a33e;\n    }\n    iVar2 = png_malloc_warn(param_1,param_2);\n    *(int *)(param_1 + 0x310) = iVar2;\n    if (iVar2 == 0) {\nLAB_0002a384:\n      FUN_0002a1a0(param_1,param_2);\n      png_chunk_benign_error(param_1,"unknown chunk exceeds memory limits");\n      return 0;\n    }\n  }" { (expression_statement "uVar1 = *(uint *)(param_1 + 0x178);" (assignment_expression "uVar1 = *(uint *)(param_1 + 0x178)" identifier = (pointer_expression "*(uint *)(param_1 + 0x178)" * (cast_expression "(uint *)(param_1 + 0x178)" ( (type_descriptor "uint *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x178)" ( (binary_expression "param_1 + 0x178" identifier + number_literal) ))))) ;) (expression_statement "*(undefined1 *)(param_1 + 0x30c) = 0;" (assignment_expression "*(undefined1 *)(param_1 + 0x30c) = 0" (pointer_expression "*(undefined1 *)(param_1 + 0x30c)" * (cast_expression "(undefined1 *)(param_1 + 0x30c)" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x30c)" ( (binary_expression "param_1 + 0x30c" identifier + number_literal) )))) = number_literal) ;) (expression_statement "*(uint *)(param_1 + 0x314) = param_2;" (assignment_expression "*(uint *)(param_1 + 0x314) = param_2" (pointer_expression "*(uint *)(param_1 + 0x314)" * (cast_expression "(uint *)(param_1 + 0x314)" ( (type_descriptor "uint *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x314)" ( (binary_expression "param_1 + 0x314" identifier + number_literal) )))) = identifier) ;) (expression_statement "*(uint *)(param_1 + 0x308) =\n         uVar1 >> 0x18 | (uVar1 & 0xff0000) >> 8 | (uVar1 & 0xff00) << 8 | uVar1 << 0x18;" (assignment_expression "*(uint *)(param_1 + 0x308) =\n         uVar1 >> 0x18 | (uVar1 & 0xff0000) >> 8 | (uVar1 & 0xff00) << 8 | uVar1 << 0x18" (pointer_expression "*(uint *)(param_1 + 0x308)" * (cast_expression "(uint *)(param_1 + 0x308)" ( (type_descriptor "uint *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x308)" ( (binary_expression "param_1 + 0x308" identifier + number_literal) )))) = (binary_expression "uVar1 >> 0x18 | (uVar1 & 0xff0000) >> 8 | (uVar1 & 0xff00) << 8 | uVar1 << 0x18" (binary_expression "uVar1 >> 0x18 | (uVar1 & 0xff0000) >> 8 | (uVar1 & 0xff00) << 8" (binary_expression "uVar1 >> 0x18 | (uVar1 & 0xff0000) >> 8" (binary_expression "uVar1 >> 0x18" identifier >> number_literal) | (binary_expression "(uVar1 & 0xff0000) >> 8" (parenthesized_expression "(uVar1 & 0xff0000)" ( (binary_expression "uVar1 & 0xff0000" identifier & number_literal) )) >> number_literal)) | (binary_expression "(uVar1 & 0xff00) << 8" (parenthesized_expression "(uVar1 & 0xff00)" ( (binary_expression "uVar1 & 0xff00" identifier & number_literal) )) << number_literal)) | (binary_expression "uVar1 << 0x18" identifier << number_literal))) ;) (expression_statement "*(char *)(param_1 + 0x318) = (char)*(undefined4 *)(param_1 + 0xd0);" (assignment_expression "*(char *)(param_1 + 0x318) = (char)*(undefined4 *)(param_1 + 0xd0)" (pointer_expression "*(char *)(param_1 + 0x318)" * (cast_expression "(char *)(param_1 + 0x318)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x318)" ( (binary_expression "param_1 + 0x318" identifier + number_literal) )))) = (cast_expression "(char)*(undefined4 *)(param_1 + 0xd0)" ( (type_descriptor "char" primitive_type) ) (pointer_expression "*(undefined4 *)(param_1 + 0xd0)" * (cast_expression "(undefined4 *)(param_1 + 0xd0)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0xd0)" ( (binary_expression "param_1 + 0xd0" identifier + number_literal) )))))) ;) (if_statement "if (param_2 == 0) {\n      *(undefined4 *)(param_1 + 0x310) = 0;\n      goto LAB_0002a33e;\n    }" if (parenthesized_expression "(param_2 == 0)" ( (binary_expression "param_2 == 0" identifier == number_literal) )) (compound_statement "{\n      *(undefined4 *)(param_1 + 0x310) = 0;\n      goto LAB_0002a33e;\n    }" { (expression_statement "*(undefined4 *)(param_1 + 0x310) = 0;" (assignment_expression "*(undefined4 *)(param_1 + 0x310) = 0" (pointer_expression "*(undefined4 *)(param_1 + 0x310)" * (cast_expression "(undefined4 *)(param_1 + 0x310)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x310)" ( (binary_expression "param_1 + 0x310" identifier + number_literal) )))) = number_literal) ;) (goto_statement "goto LAB_0002a33e;" goto statement_identifier ;) })) (expression_statement "iVar2 = png_malloc_warn(param_1,param_2);" (assignment_expression "iVar2 = png_malloc_warn(param_1,param_2)" identifier = (call_expression "png_malloc_warn(param_1,param_2)" identifier (argument_list "(param_1,param_2)" ( identifier , identifier )))) ;) (expression_statement "*(int *)(param_1 + 0x310) = iVar2;" (assignment_expression "*(int *)(param_1 + 0x310) = iVar2" (pointer_expression "*(int *)(param_1 + 0x310)" * (cast_expression "(int *)(param_1 + 0x310)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x310)" ( (binary_expression "param_1 + 0x310" identifier + number_literal) )))) = identifier) ;) (if_statement "if (iVar2 == 0) {\nLAB_0002a384:\n      FUN_0002a1a0(param_1,param_2);\n      png_chunk_benign_error(param_1,"unknown chunk exceeds memory limits");\n      return 0;\n    }" if (parenthesized_expression "(iVar2 == 0)" ( (binary_expression "iVar2 == 0" identifier == number_literal) )) (compound_statement "{\nLAB_0002a384:\n      FUN_0002a1a0(param_1,param_2);\n      png_chunk_benign_error(param_1,"unknown chunk exceeds memory limits");\n      return 0;\n    }" { (labeled_statement "LAB_0002a384:\n      FUN_0002a1a0(param_1,param_2);" statement_identifier : (expression_statement "FUN_0002a1a0(param_1,param_2);" (call_expression "FUN_0002a1a0(param_1,param_2)" identifier (argument_list "(param_1,param_2)" ( identifier , identifier ))) ;)) (expression_statement "png_chunk_benign_error(param_1,"unknown chunk exceeds memory limits");" (call_expression "png_chunk_benign_error(param_1,"unknown chunk exceeds memory limits")" identifier (argument_list "(param_1,"unknown chunk exceeds memory limits")" ( identifier , (string_literal ""unknown chunk exceeds memory limits"" " string_content ") ))) ;) (return_statement "return 0;" return number_literal ;) })) }))) (expression_statement "FUN_0002a080(param_1,iVar2,param_2);" (call_expression "FUN_0002a080(param_1,iVar2,param_2)" identifier (argument_list "(param_1,iVar2,param_2)" ( identifier , identifier , identifier ))) ;) (labeled_statement "LAB_0002a33e:\n  FUN_0002a1a0(param_1,0);" statement_identifier : (expression_statement "FUN_0002a1a0(param_1,0);" (call_expression "FUN_0002a1a0(param_1,0)" identifier (argument_list "(param_1,0)" ( identifier , number_literal ))) ;)) (return_statement "return 1;" return number_literal ;) })))
(translation_unit (function_definition TYPE (ERROR IDENT) (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 (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) != LIT) )) (compound_statement { (expression_statement (call_expression IDENT (argument_list ( IDENT , (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) ))) ;) (expression_statement (assignment_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) = LIT) ;) })) (if_statement if (parenthesized_expression ( (binary_expression (parenthesized_expression ( (binary_expression (binary_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) - 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 = (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (if_statement if (parenthesized_expression ( (binary_expression IDENT != LIT) )) (goto_statement goto statement_identifier ;)) (goto_statement goto statement_identifier ;) })) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (goto_statement goto statement_identifier ;)) }) (else_clause else (compound_statement { (expression_statement (assignment_expression IDENT = (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))))) ;) (expression_statement (assignment_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) = 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) )))) = (binary_expression (binary_expression (binary_expression (binary_expression IDENT >> LIT) | (binary_expression (parenthesized_expression ( (binary_expression IDENT & LIT) )) >> LIT)) | (binary_expression (parenthesized_expression ( (binary_expression IDENT & LIT) )) << LIT)) | (binary_expression IDENT << LIT))) ;) (expression_statement (assignment_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) = (cast_expression ( (type_descriptor TYPE) ) (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (expression_statement (assignment_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) = LIT) ;) (goto_statement goto statement_identifier ;) })) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT , IDENT )))) ;) (expression_statement (assignment_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) = IDENT) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (labeled_statement statement_identifier : (expression_statement (call_expression IDENT (argument_list ( IDENT , IDENT ))) ;)) (expression_statement (call_expression IDENT (argument_list ( IDENT , (string_literal " string_content ") ))) ;) (return_statement return LIT ;) })) }))) (expression_statement (call_expression IDENT (argument_list ( IDENT , IDENT , IDENT ))) ;) (labeled_statement statement_identifier : (expression_statement (call_expression IDENT (argument_list ( IDENT , LIT ))) ;)) (return_statement return LIT ;) })))
(function_definition "undefined4 __regparm3 FUN_0002a2b0(int param_1,uint param_2)\n\n{\n  uint uVar1;\n  int iVar2;\n  \n  if (*(int *)(param_1 + 0x310) != 0) {\n    png_free(param_1,*(int *)(param_1 + 0x310));\n    *(undefined4 *)(param_1 + 0x310) = 0;\n  }\n  if ((*(uint *)(param_1 + 0x304) - 1 < 0xfffffffe) && (*(uint *)(param_1 + 0x304) < param_2)) {\n    iVar2 = *(int *)(param_1 + 0x310);\n    if (iVar2 == 0) {\n      if (param_2 != 0) goto LAB_0002a384;\n      goto LAB_0002a33e;\n    }\n    if (param_2 == 0) goto LAB_0002a33e;\n  }\n  else {\n    uVar1 = *(uint *)(param_1 + 0x178);\n    *(undefined1 *)(param_1 + 0x30c) = 0;\n    *(uint *)(param_1 + 0x314) = param_2;\n    *(uint *)(param_1 + 0x308) =\n         uVar1 >> 0x18 | (uVar1 & 0xff0000) >> 8 | (uVar1 & 0xff00) << 8 | uVar1 << 0x18;\n    *(char *)(param_1 + 0x318) = (char)*(undefined4 *)(param_1 + 0xd0);\n    if (param_2 == 0) {\n      *(undefined4 *)(param_1 + 0x310) = 0;\n      goto LAB_0002a33e;\n    }\n    iVar2 = png_malloc_warn(param_1,param_2);\n    *(int *)(param_1 + 0x310) = iVar2;\n    if (iVar2 == 0) {\nLAB_0002a384:\n      FUN_0002a1a0(param_1,param_2);\n      png_chunk_benign_error(param_1,"unknown chunk exceeds memory limits");\n      return 0;\n    }\n  }\n  FUN_0002a080(param_1,iVar2,param_2);\nLAB_0002a33e:\n  FUN_0002a1a0(param_1,0);\n  return 1;\n}" (type_identifier "undefined4") (ERROR "__regparm3" (identifier "__regparm3")) (function_declarator "FUN_0002a2b0(int param_1,uint param_2)" (identifier "FUN_0002a2b0") (parameter_list "(int param_1,uint param_2)" (( "(") (parameter_declaration "int param_1" (primitive_type "int") (identifier "param_1")) (, ",") (parameter_declaration "uint param_2" (type_identifier "uint") (identifier "param_2")) () ")"))) (compound_statement "{\n  uint uVar1;\n  int iVar2;\n  \n  if (*(int *)(param_1 + 0x310) != 0) {\n    png_free(param_1,*(int *)(param_1 + 0x310));\n    *(undefined4 *)(param_1 + 0x310) = 0;\n  }\n  if ((*(uint *)(param_1 + 0x304) - 1 < 0xfffffffe) && (*(uint *)(param_1 + 0x304) < param_2)) {\n    iVar2 = *(int *)(param_1 + 0x310);\n    if (iVar2 == 0) {\n      if (param_2 != 0) goto LAB_0002a384;\n      goto LAB_0002a33e;\n    }\n    if (param_2 == 0) goto LAB_0002a33e;\n  }\n  else {\n    uVar1 = *(uint *)(param_1 + 0x178);\n    *(undefined1 *)(param_1 + 0x30c) = 0;\n    *(uint *)(param_1 + 0x314) = param_2;\n    *(uint *)(param_1 + 0x308) =\n         uVar1 >> 0x18 | (uVar1 & 0xff0000) >> 8 | (uVar1 & 0xff00) << 8 | uVar1 << 0x18;\n    *(char *)(param_1 + 0x318) = (char)*(undefined4 *)(param_1 + 0xd0);\n    if (param_2 == 0) {\n      *(undefined4 *)(param_1 + 0x310) = 0;\n      goto LAB_0002a33e;\n    }\n    iVar2 = png_malloc_warn(param_1,param_2);\n    *(int *)(param_1 + 0x310) = iVar2;\n    if (iVar2 == 0) {\nLAB_0002a384:\n      FUN_0002a1a0(param_1,param_2);\n      png_chunk_benign_error(param_1,"unknown chunk exceeds memory limits");\n      return 0;\n    }\n  }\n  FUN_0002a080(param_1,iVar2,param_2);\nLAB_0002a33e:\n  FUN_0002a1a0(param_1,0);\n  return 1;\n}" ({ "{") (declaration "uint uVar1;" (type_identifier "uint") (identifier "uVar1") (; ";")) (declaration "int iVar2;" (primitive_type "int") (identifier "iVar2") (; ";")) (if_statement "if (*(int *)(param_1 + 0x310) != 0) {\n    png_free(param_1,*(int *)(param_1 + 0x310));\n    *(undefined4 *)(param_1 + 0x310) = 0;\n  }" (if "if") (parenthesized_expression "(*(int *)(param_1 + 0x310) != 0)" (( "(") (binary_expression "*(int *)(param_1 + 0x310) != 0" (pointer_expression "*(int *)(param_1 + 0x310)" (* "*") (cast_expression "(int *)(param_1 + 0x310)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 0x310)" (( "(") (binary_expression "param_1 + 0x310" (identifier "param_1") (+ "+") (number_literal "0x310")) () ")")))) (!= "!=") (number_literal "0")) () ")")) (compound_statement "{\n    png_free(param_1,*(int *)(param_1 + 0x310));\n    *(undefined4 *)(param_1 + 0x310) = 0;\n  }" ({ "{") (expression_statement "png_free(param_1,*(int *)(param_1 + 0x310));" (call_expression "png_free(param_1,*(int *)(param_1 + 0x310))" (identifier "png_free") (argument_list "(param_1,*(int *)(param_1 + 0x310))" (( "(") (identifier "param_1") (, ",") (pointer_expression "*(int *)(param_1 + 0x310)" (* "*") (cast_expression "(int *)(param_1 + 0x310)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 0x310)" (( "(") (binary_expression "param_1 + 0x310" (identifier "param_1") (+ "+") (number_literal "0x310")) () ")")))) () ")"))) (; ";")) (expression_statement "*(undefined4 *)(param_1 + 0x310) = 0;" (assignment_expression "*(undefined4 *)(param_1 + 0x310) = 0" (pointer_expression "*(undefined4 *)(param_1 + 0x310)" (* "*") (cast_expression "(undefined4 *)(param_1 + 0x310)" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 0x310)" (( "(") (binary_expression "param_1 + 0x310" (identifier "param_1") (+ "+") (number_literal "0x310")) () ")")))) (= "=") (number_literal "0")) (; ";")) (} "}"))) (if_statement "if ((*(uint *)(param_1 + 0x304) - 1 < 0xfffffffe) && (*(uint *)(param_1 + 0x304) < param_2)) {\n    iVar2 = *(int *)(param_1 + 0x310);\n    if (iVar2 == 0) {\n      if (param_2 != 0) goto LAB_0002a384;\n      goto LAB_0002a33e;\n    }\n    if (param_2 == 0) goto LAB_0002a33e;\n  }\n  else {\n    uVar1 = *(uint *)(param_1 + 0x178);\n    *(undefined1 *)(param_1 + 0x30c) = 0;\n    *(uint *)(param_1 + 0x314) = param_2;\n    *(uint *)(param_1 + 0x308) =\n         uVar1 >> 0x18 | (uVar1 & 0xff0000) >> 8 | (uVar1 & 0xff00) << 8 | uVar1 << 0x18;\n    *(char *)(param_1 + 0x318) = (char)*(undefined4 *)(param_1 + 0xd0);\n    if (param_2 == 0) {\n      *(undefined4 *)(param_1 + 0x310) = 0;\n      goto LAB_0002a33e;\n    }\n    iVar2 = png_malloc_warn(param_1,param_2);\n    *(int *)(param_1 + 0x310) = iVar2;\n    if (iVar2 == 0) {\nLAB_0002a384:\n      FUN_0002a1a0(param_1,param_2);\n      png_chunk_benign_error(param_1,"unknown chunk exceeds memory limits");\n      return 0;\n    }\n  }" (if "if") (parenthesized_expression "((*(uint *)(param_1 + 0x304) - 1 < 0xfffffffe) && (*(uint *)(param_1 + 0x304) < param_2))" (( "(") (binary_expression "(*(uint *)(param_1 + 0x304) - 1 < 0xfffffffe) && (*(uint *)(param_1 + 0x304) < param_2)" (parenthesized_expression "(*(uint *)(param_1 + 0x304) - 1 < 0xfffffffe)" (( "(") (binary_expression "*(uint *)(param_1 + 0x304) - 1 < 0xfffffffe" (binary_expression "*(uint *)(param_1 + 0x304) - 1" (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 "1")) (< "<") (number_literal "0xfffffffe")) () ")")) (&& "&&") (parenthesized_expression "(*(uint *)(param_1 + 0x304) < param_2)" (( "(") (binary_expression "*(uint *)(param_1 + 0x304) < param_2" (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_2")) () ")"))) () ")")) (compound_statement "{\n    iVar2 = *(int *)(param_1 + 0x310);\n    if (iVar2 == 0) {\n      if (param_2 != 0) goto LAB_0002a384;\n      goto LAB_0002a33e;\n    }\n    if (param_2 == 0) goto LAB_0002a33e;\n  }" ({ "{") (expression_statement "iVar2 = *(int *)(param_1 + 0x310);" (assignment_expression "iVar2 = *(int *)(param_1 + 0x310)" (identifier "iVar2") (= "=") (pointer_expression "*(int *)(param_1 + 0x310)" (* "*") (cast_expression "(int *)(param_1 + 0x310)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 0x310)" (( "(") (binary_expression "param_1 + 0x310" (identifier "param_1") (+ "+") (number_literal "0x310")) () ")"))))) (; ";")) (if_statement "if (iVar2 == 0) {\n      if (param_2 != 0) goto LAB_0002a384;\n      goto LAB_0002a33e;\n    }" (if "if") (parenthesized_expression "(iVar2 == 0)" (( "(") (binary_expression "iVar2 == 0" (identifier "iVar2") (== "==") (number_literal "0")) () ")")) (compound_statement "{\n      if (param_2 != 0) goto LAB_0002a384;\n      goto LAB_0002a33e;\n    }" ({ "{") (if_statement "if (param_2 != 0) goto LAB_0002a384;" (if "if") (parenthesized_expression "(param_2 != 0)" (( "(") (binary_expression "param_2 != 0" (identifier "param_2") (!= "!=") (number_literal "0")) () ")")) (goto_statement "goto LAB_0002a384;" (goto "goto") (statement_identifier "LAB_0002a384") (; ";"))) (goto_statement "goto LAB_0002a33e;" (goto "goto") (statement_identifier "LAB_0002a33e") (; ";")) (} "}"))) (if_statement "if (param_2 == 0) goto LAB_0002a33e;" (if "if") (parenthesized_expression "(param_2 == 0)" (( "(") (binary_expression "param_2 == 0" (identifier "param_2") (== "==") (number_literal "0")) () ")")) (goto_statement "goto LAB_0002a33e;" (goto "goto") (statement_identifier "LAB_0002a33e") (; ";"))) (} "}")) (else_clause "else {\n    uVar1 = *(uint *)(param_1 + 0x178);\n    *(undefined1 *)(param_1 + 0x30c) = 0;\n    *(uint *)(param_1 + 0x314) = param_2;\n    *(uint *)(param_1 + 0x308) =\n         uVar1 >> 0x18 | (uVar1 & 0xff0000) >> 8 | (uVar1 & 0xff00) << 8 | uVar1 << 0x18;\n    *(char *)(param_1 + 0x318) = (char)*(undefined4 *)(param_1 + 0xd0);\n    if (param_2 == 0) {\n      *(undefined4 *)(param_1 + 0x310) = 0;\n      goto LAB_0002a33e;\n    }\n    iVar2 = png_malloc_warn(param_1,param_2);\n    *(int *)(param_1 + 0x310) = iVar2;\n    if (iVar2 == 0) {\nLAB_0002a384:\n      FUN_0002a1a0(param_1,param_2);\n      png_chunk_benign_error(param_1,"unknown chunk exceeds memory limits");\n      return 0;\n    }\n  }" (else "else") (compound_statement "{\n    uVar1 = *(uint *)(param_1 + 0x178);\n    *(undefined1 *)(param_1 + 0x30c) = 0;\n    *(uint *)(param_1 + 0x314) = param_2;\n    *(uint *)(param_1 + 0x308) =\n         uVar1 >> 0x18 | (uVar1 & 0xff0000) >> 8 | (uVar1 & 0xff00) << 8 | uVar1 << 0x18;\n    *(char *)(param_1 + 0x318) = (char)*(undefined4 *)(param_1 + 0xd0);\n    if (param_2 == 0) {\n      *(undefined4 *)(param_1 + 0x310) = 0;\n      goto LAB_0002a33e;\n    }\n    iVar2 = png_malloc_warn(param_1,param_2);\n    *(int *)(param_1 + 0x310) = iVar2;\n    if (iVar2 == 0) {\nLAB_0002a384:\n      FUN_0002a1a0(param_1,param_2);\n      png_chunk_benign_error(param_1,"unknown chunk exceeds memory limits");\n      return 0;\n    }\n  }" ({ "{") (expression_statement "uVar1 = *(uint *)(param_1 + 0x178);" (assignment_expression "uVar1 = *(uint *)(param_1 + 0x178)" (identifier "uVar1") (= "=") (pointer_expression "*(uint *)(param_1 + 0x178)" (* "*") (cast_expression "(uint *)(param_1 + 0x178)" (( "(") (type_descriptor "uint *" (type_identifier "uint") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 0x178)" (( "(") (binary_expression "param_1 + 0x178" (identifier "param_1") (+ "+") (number_literal "0x178")) () ")"))))) (; ";")) (expression_statement "*(undefined1 *)(param_1 + 0x30c) = 0;" (assignment_expression "*(undefined1 *)(param_1 + 0x30c) = 0" (pointer_expression "*(undefined1 *)(param_1 + 0x30c)" (* "*") (cast_expression "(undefined1 *)(param_1 + 0x30c)" (( "(") (type_descriptor "undefined1 *" (type_identifier "undefined1") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 0x30c)" (( "(") (binary_expression "param_1 + 0x30c" (identifier "param_1") (+ "+") (number_literal "0x30c")) () ")")))) (= "=") (number_literal "0")) (; ";")) (expression_statement "*(uint *)(param_1 + 0x314) = param_2;" (assignment_expression "*(uint *)(param_1 + 0x314) = param_2" (pointer_expression "*(uint *)(param_1 + 0x314)" (* "*") (cast_expression "(uint *)(param_1 + 0x314)" (( "(") (type_descriptor "uint *" (type_identifier "uint") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 0x314)" (( "(") (binary_expression "param_1 + 0x314" (identifier "param_1") (+ "+") (number_literal "0x314")) () ")")))) (= "=") (identifier "param_2")) (; ";")) (expression_statement "*(uint *)(param_1 + 0x308) =\n         uVar1 >> 0x18 | (uVar1 & 0xff0000) >> 8 | (uVar1 & 0xff00) << 8 | uVar1 << 0x18;" (assignment_expression "*(uint *)(param_1 + 0x308) =\n         uVar1 >> 0x18 | (uVar1 & 0xff0000) >> 8 | (uVar1 & 0xff00) << 8 | uVar1 << 0x18" (pointer_expression "*(uint *)(param_1 + 0x308)" (* "*") (cast_expression "(uint *)(param_1 + 0x308)" (( "(") (type_descriptor "uint *" (type_identifier "uint") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 0x308)" (( "(") (binary_expression "param_1 + 0x308" (identifier "param_1") (+ "+") (number_literal "0x308")) () ")")))) (= "=") (binary_expression "uVar1 >> 0x18 | (uVar1 & 0xff0000) >> 8 | (uVar1 & 0xff00) << 8 | uVar1 << 0x18" (binary_expression "uVar1 >> 0x18 | (uVar1 & 0xff0000) >> 8 | (uVar1 & 0xff00) << 8" (binary_expression "uVar1 >> 0x18 | (uVar1 & 0xff0000) >> 8" (binary_expression "uVar1 >> 0x18" (identifier "uVar1") (>> ">>") (number_literal "0x18")) (| "|") (binary_expression "(uVar1 & 0xff0000) >> 8" (parenthesized_expression "(uVar1 & 0xff0000)" (( "(") (binary_expression "uVar1 & 0xff0000" (identifier "uVar1") (& "&") (number_literal "0xff0000")) () ")")) (>> ">>") (number_literal "8"))) (| "|") (binary_expression "(uVar1 & 0xff00) << 8" (parenthesized_expression "(uVar1 & 0xff00)" (( "(") (binary_expression "uVar1 & 0xff00" (identifier "uVar1") (& "&") (number_literal "0xff00")) () ")")) (<< "<<") (number_literal "8"))) (| "|") (binary_expression "uVar1 << 0x18" (identifier "uVar1") (<< "<<") (number_literal "0x18")))) (; ";")) (expression_statement "*(char *)(param_1 + 0x318) = (char)*(undefined4 *)(param_1 + 0xd0);" (assignment_expression "*(char *)(param_1 + 0x318) = (char)*(undefined4 *)(param_1 + 0xd0)" (pointer_expression "*(char *)(param_1 + 0x318)" (* "*") (cast_expression "(char *)(param_1 + 0x318)" (( "(") (type_descriptor "char *" (primitive_type "char") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 0x318)" (( "(") (binary_expression "param_1 + 0x318" (identifier "param_1") (+ "+") (number_literal "0x318")) () ")")))) (= "=") (cast_expression "(char)*(undefined4 *)(param_1 + 0xd0)" (( "(") (type_descriptor "char" (primitive_type "char")) () ")") (pointer_expression "*(undefined4 *)(param_1 + 0xd0)" (* "*") (cast_expression "(undefined4 *)(param_1 + 0xd0)" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 0xd0)" (( "(") (binary_expression "param_1 + 0xd0" (identifier "param_1") (+ "+") (number_literal "0xd0")) () ")")))))) (; ";")) (if_statement "if (param_2 == 0) {\n      *(undefined4 *)(param_1 + 0x310) = 0;\n      goto LAB_0002a33e;\n    }" (if "if") (parenthesized_expression "(param_2 == 0)" (( "(") (binary_expression "param_2 == 0" (identifier "param_2") (== "==") (number_literal "0")) () ")")) (compound_statement "{\n      *(undefined4 *)(param_1 + 0x310) = 0;\n      goto LAB_0002a33e;\n    }" ({ "{") (expression_statement "*(undefined4 *)(param_1 + 0x310) = 0;" (assignment_expression "*(undefined4 *)(param_1 + 0x310) = 0" (pointer_expression "*(undefined4 *)(param_1 + 0x310)" (* "*") (cast_expression "(undefined4 *)(param_1 + 0x310)" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 0x310)" (( "(") (binary_expression "param_1 + 0x310" (identifier "param_1") (+ "+") (number_literal "0x310")) () ")")))) (= "=") (number_literal "0")) (; ";")) (goto_statement "goto LAB_0002a33e;" (goto "goto") (statement_identifier "LAB_0002a33e") (; ";")) (} "}"))) (expression_statement "iVar2 = png_malloc_warn(param_1,param_2);" (assignment_expression "iVar2 = png_malloc_warn(param_1,param_2)" (identifier "iVar2") (= "=") (call_expression "png_malloc_warn(param_1,param_2)" (identifier "png_malloc_warn") (argument_list "(param_1,param_2)" (( "(") (identifier "param_1") (, ",") (identifier "param_2") () ")")))) (; ";")) (expression_statement "*(int *)(param_1 + 0x310) = iVar2;" (assignment_expression "*(int *)(param_1 + 0x310) = iVar2" (pointer_expression "*(int *)(param_1 + 0x310)" (* "*") (cast_expression "(int *)(param_1 + 0x310)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 0x310)" (( "(") (binary_expression "param_1 + 0x310" (identifier "param_1") (+ "+") (number_literal "0x310")) () ")")))) (= "=") (identifier "iVar2")) (; ";")) (if_statement "if (iVar2 == 0) {\nLAB_0002a384:\n      FUN_0002a1a0(param_1,param_2);\n      png_chunk_benign_error(param_1,"unknown chunk exceeds memory limits");\n      return 0;\n    }" (if "if") (parenthesized_expression "(iVar2 == 0)" (( "(") (binary_expression "iVar2 == 0" (identifier "iVar2") (== "==") (number_literal "0")) () ")")) (compound_statement "{\nLAB_0002a384:\n      FUN_0002a1a0(param_1,param_2);\n      png_chunk_benign_error(param_1,"unknown chunk exceeds memory limits");\n      return 0;\n    }" ({ "{") (labeled_statement "LAB_0002a384:\n      FUN_0002a1a0(param_1,param_2);" (statement_identifier "LAB_0002a384") (: ":") (expression_statement "FUN_0002a1a0(param_1,param_2);" (call_expression "FUN_0002a1a0(param_1,param_2)" (identifier "FUN_0002a1a0") (argument_list "(param_1,param_2)" (( "(") (identifier "param_1") (, ",") (identifier "param_2") () ")"))) (; ";"))) (expression_statement "png_chunk_benign_error(param_1,"unknown chunk exceeds memory limits");" (call_expression "png_chunk_benign_error(param_1,"unknown chunk exceeds memory limits")" (identifier "png_chunk_benign_error") (argument_list "(param_1,"unknown chunk exceeds memory limits")" (( "(") (identifier "param_1") (, ",") (string_literal ""unknown chunk exceeds memory limits"" (" """) (string_content "unknown chunk exceeds memory limits") (" """)) () ")"))) (; ";")) (return_statement "return 0;" (return "return") (number_literal "0") (; ";")) (} "}"))) (} "}")))) (expression_statement "FUN_0002a080(param_1,iVar2,param_2);" (call_expression "FUN_0002a080(param_1,iVar2,param_2)" (identifier "FUN_0002a080") (argument_list "(param_1,iVar2,param_2)" (( "(") (identifier "param_1") (, ",") (identifier "iVar2") (, ",") (identifier "param_2") () ")"))) (; ";")) (labeled_statement "LAB_0002a33e:\n  FUN_0002a1a0(param_1,0);" (statement_identifier "LAB_0002a33e") (: ":") (expression_statement "FUN_0002a1a0(param_1,0);" (call_expression "FUN_0002a1a0(param_1,0)" (identifier "FUN_0002a1a0") (argument_list "(param_1,0)" (( "(") (identifier "param_1") (, ",") (number_literal "0") () ")"))) (; ";"))) (return_statement "return 1;" (return "return") (number_literal "1") (; ";")) (} "}")))

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

int __regparm3 function_1(type_1 png_ptr,type_2 var_3)

{
  type_3 var_4;
  type_4 *var_1;
  
  var_1 = (png_ptr->unknown_chunk).data;
  if (var_1 != (type_4 *)0x0) {
    var_2(png_ptr,var_1);
    (png_ptr->unknown_chunk).data = (type_4 *)0x0;
  }
  if ((png_ptr->user_chunk_malloc_max - 1 < 0xfffffffe) && (png_ptr->user_chunk_malloc_max < var_3)
     ) {
    var_1 = (png_ptr->unknown_chunk).data;
    if (var_1 == (type_4 *)0x0) {
      if (var_3 != 0) goto LAB_0002a384;
      goto LAB_0002a33e;
    }
    if (var_3 == 0) goto LAB_0002a33e;
  }
  else {
    var_4 = png_ptr->chunk_name;
    (png_ptr->unknown_chunk).name[4] = '\0';
    (png_ptr->unknown_chunk).size = var_3;
    *(type_3 *)(png_ptr->unknown_chunk).name =
         var_4 >> 0x18 | (var_4 & 0xff0000) >> 8 | (var_4 & 0xff00) << 8 | var_4 << 0x18;
    (png_ptr->unknown_chunk).location = (type_4)png_ptr->mode;
    if (var_3 == 0) {
      (png_ptr->unknown_chunk).data = (type_4 *)0x0;
      goto LAB_0002a33e;
    }
    var_1 = (type_4 *)var_5(png_ptr,var_3);
    (png_ptr->unknown_chunk).data = var_1;
    if (var_1 == (type_4 *)0x0) {
LAB_0002a384:
      var_6(png_ptr,var_3);
      var_7(png_ptr,"unknown chunk exceeds memory limits");
      return 0;
    }
  }
  var_8(png_ptr,var_1,var_3);
LAB_0002a33e:
  var_6(png_ptr,0);
  return 1;
}


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

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

undefined4 __regparm3 MASKED(int param_1,uint param_2)

{
  uint uVar1;
  int iVar2;
  
  if (*(int *)(param_1 + 0x310) != 0) {
    png_free(param_1,*(int *)(param_1 + 0x310));
    *(undefined4 *)(param_1 + 0x310) = 0;
  }
  if ((*(uint *)(param_1 + 0x304) - 1 < 0xfffffffe) && (*(uint *)(param_1 + 0x304) < param_2)) {
    iVar2 = *(int *)(param_1 + 0x310);
    if (iVar2 == 0) {
      if (param_2 != 0) goto LAB_0002a384;
      goto LAB_0002a33e;
    }
    if (param_2 == 0) goto LAB_0002a33e;
  }
  else {
    uVar1 = *(uint *)(param_1 + 0x178);
    *(undefined1 *)(param_1 + 0x30c) = 0;
    *(uint *)(param_1 + 0x314) = param_2;
    *(uint *)(param_1 + 0x308) =
         uVar1 >> 0x18 | (uVar1 & 0xff0000) >> 8 | (uVar1 & 0xff00) << 8 | uVar1 << 0x18;
    *(char *)(param_1 + 0x318) = (char)*(undefined4 *)(param_1 + 0xd0);
    if (param_2 == 0) {
      *(undefined4 *)(param_1 + 0x310) = 0;
      goto LAB_0002a33e;
    }
    iVar2 = png_malloc_warn(param_1,param_2);
    *(int *)(param_1 + 0x310) = iVar2;
    if (iVar2 == 0) {
LAB_0002a384:
      FUN_0002a1a0(param_1,param_2);
      png_chunk_benign_error(param_1,"unknown chunk exceeds memory limits");
      return 0;
    }
  }
  FUN_0002a080(param_1,iVar2,param_2);
LAB_0002a33e:
  FUN_0002a1a0(param_1,0);
  return 1;
}

