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

int compress_finish(z_stream_s *strm,char **next_out,int *avail_out,int *out_size)

{
  Bytef *pBVar1;
  int iVar2;
  
  pBVar1 = (Bytef *)*next_out;
  strm->avail_in = 0;
  strm->next_out = pBVar1;
  strm->avail_out = *avail_out;
  iVar2 = deflate(strm,4);
  *out_size = *avail_out - strm->avail_out;
  *next_out = (char *)strm->next_out;
  *avail_out = strm->avail_out;
  if (iVar2 != 1) {
    return (-(uint)(strm->avail_out == 0) & 2) - 1;
  }
  deflateEnd(strm);
  return 0;
}



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

int FUN_00017560(int param_1,undefined4 *param_2,int *param_3,int *param_4)

{
  undefined4 uVar1;
  int iVar2;
  
  uVar1 = *param_2;
  *(undefined4 *)(param_1 + 4) = 0;
  *(undefined4 *)(param_1 + 0xc) = uVar1;
  *(int *)(param_1 + 0x10) = *param_3;
  iVar2 = deflate(param_1,4);
  *param_4 = *param_3 - *(int *)(param_1 + 0x10);
  *param_2 = *(undefined4 *)(param_1 + 0xc);
  *param_3 = *(int *)(param_1 + 0x10);
  if (iVar2 != 1) {
    return (-(uint)(*(int *)(param_1 + 0x10) == 0) & 2) - 1;
  }
  deflateEnd(param_1);
  return 0;
}


PUSH EBP
PUSH EDI
PUSH ESI
PUSH EBX
CALL 0x00015020
ADD EBX,0x50a97
SUB ESP,0x14
MOV EBP,dword ptr [ESP + 0x2c]
MOV ESI,dword ptr [ESP + 0x28]
MOV EDI,dword ptr [ESP + 0x30]
MOV EAX,dword ptr [EBP]
MOV dword ptr [ESI + 0x4],0x0
MOV dword ptr [ESI + 0xc],EAX
MOV EAX,dword ptr [EDI]
MOV dword ptr [ESI + 0x10],EAX
PUSH 0x4
PUSH ESI
CALL 0x00013250
MOV ECX,dword ptr [ESP + 0x3c]
MOV EDX,dword ptr [EDI]
ADD ESP,0x10
SUB EDX,dword ptr [ESI + 0x10]
MOV dword ptr [ECX],EDX
MOV EDX,dword ptr [ESI + 0xc]
MOV dword ptr [EBP],EDX
MOV EDX,dword ptr [ESI + 0x10]
MOV dword ptr [EDI],EDX
CMP EAX,0x1
JZ 0x000175d0
CMP dword ptr [ESI + 0x10],0x1
SBB EAX,EAX
ADD ESP,0xc
AND EAX,0x2
POP EBX
POP ESI
SUB EAX,0x1
POP EDI
POP EBP
RET
SUB ESP,0xc
PUSH ESI
CALL 0x00013530
ADD ESP,0x10
XOR EAX,EAX
ADD ESP,0xc
POP EBX
POP ESI
POP EDI
POP EBP
RET
(translation_unit "/* WARNING: Function: __i686.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n\nint FUN_00017560(int param_1,undefined4 *param_2,int *param_3,int *param_4)\n\n{\n  undefined4 uVar1;\n  int iVar2;\n  \n  uVar1 = *param_2;\n  *(undefined4 *)(param_1 + 4) = 0;\n  *(undefined4 *)(param_1 + 0xc) = uVar1;\n  *(int *)(param_1 + 0x10) = *param_3;\n  iVar2 = deflate(param_1,4);\n  *param_4 = *param_3 - *(int *)(param_1 + 0x10);\n  *param_2 = *(undefined4 *)(param_1 + 0xc);\n  *param_3 = *(int *)(param_1 + 0x10);\n  if (iVar2 != 1) {\n    return (-(uint)(*(int *)(param_1 + 0x10) == 0) & 2) - 1;\n  }\n  deflateEnd(param_1);\n  return 0;\n}\n\n" comment (function_definition "int FUN_00017560(int param_1,undefined4 *param_2,int *param_3,int *param_4)\n\n{\n  undefined4 uVar1;\n  int iVar2;\n  \n  uVar1 = *param_2;\n  *(undefined4 *)(param_1 + 4) = 0;\n  *(undefined4 *)(param_1 + 0xc) = uVar1;\n  *(int *)(param_1 + 0x10) = *param_3;\n  iVar2 = deflate(param_1,4);\n  *param_4 = *param_3 - *(int *)(param_1 + 0x10);\n  *param_2 = *(undefined4 *)(param_1 + 0xc);\n  *param_3 = *(int *)(param_1 + 0x10);\n  if (iVar2 != 1) {\n    return (-(uint)(*(int *)(param_1 + 0x10) == 0) & 2) - 1;\n  }\n  deflateEnd(param_1);\n  return 0;\n}" primitive_type (function_declarator "FUN_00017560(int param_1,undefined4 *param_2,int *param_3,int *param_4)" identifier (parameter_list "(int param_1,undefined4 *param_2,int *param_3,int *param_4)" ( (parameter_declaration "int param_1" primitive_type identifier) , (parameter_declaration "undefined4 *param_2" type_identifier (pointer_declarator "*param_2" * identifier)) , (parameter_declaration "int *param_3" primitive_type (pointer_declarator "*param_3" * identifier)) , (parameter_declaration "int *param_4" primitive_type (pointer_declarator "*param_4" * identifier)) ))) (compound_statement "{\n  undefined4 uVar1;\n  int iVar2;\n  \n  uVar1 = *param_2;\n  *(undefined4 *)(param_1 + 4) = 0;\n  *(undefined4 *)(param_1 + 0xc) = uVar1;\n  *(int *)(param_1 + 0x10) = *param_3;\n  iVar2 = deflate(param_1,4);\n  *param_4 = *param_3 - *(int *)(param_1 + 0x10);\n  *param_2 = *(undefined4 *)(param_1 + 0xc);\n  *param_3 = *(int *)(param_1 + 0x10);\n  if (iVar2 != 1) {\n    return (-(uint)(*(int *)(param_1 + 0x10) == 0) & 2) - 1;\n  }\n  deflateEnd(param_1);\n  return 0;\n}" { (declaration "undefined4 uVar1;" type_identifier identifier ;) (declaration "int iVar2;" primitive_type identifier ;) (expression_statement "uVar1 = *param_2;" (assignment_expression "uVar1 = *param_2" identifier = (pointer_expression "*param_2" * identifier)) ;) (expression_statement "*(undefined4 *)(param_1 + 4) = 0;" (assignment_expression "*(undefined4 *)(param_1 + 4) = 0" (pointer_expression "*(undefined4 *)(param_1 + 4)" * (cast_expression "(undefined4 *)(param_1 + 4)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 4)" ( (binary_expression "param_1 + 4" identifier + number_literal) )))) = number_literal) ;) (expression_statement "*(undefined4 *)(param_1 + 0xc) = uVar1;" (assignment_expression "*(undefined4 *)(param_1 + 0xc) = uVar1" (pointer_expression "*(undefined4 *)(param_1 + 0xc)" * (cast_expression "(undefined4 *)(param_1 + 0xc)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0xc)" ( (binary_expression "param_1 + 0xc" identifier + number_literal) )))) = identifier) ;) (expression_statement "*(int *)(param_1 + 0x10) = *param_3;" (assignment_expression "*(int *)(param_1 + 0x10) = *param_3" (pointer_expression "*(int *)(param_1 + 0x10)" * (cast_expression "(int *)(param_1 + 0x10)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x10)" ( (binary_expression "param_1 + 0x10" identifier + number_literal) )))) = (pointer_expression "*param_3" * identifier)) ;) (expression_statement "iVar2 = deflate(param_1,4);" (assignment_expression "iVar2 = deflate(param_1,4)" identifier = (call_expression "deflate(param_1,4)" identifier (argument_list "(param_1,4)" ( identifier , number_literal )))) ;) (expression_statement "*param_4 = *param_3 - *(int *)(param_1 + 0x10);" (assignment_expression "*param_4 = *param_3 - *(int *)(param_1 + 0x10)" (pointer_expression "*param_4" * identifier) = (binary_expression "*param_3 - *(int *)(param_1 + 0x10)" (pointer_expression "*param_3" * identifier) - (pointer_expression "*(int *)(param_1 + 0x10)" * (cast_expression "(int *)(param_1 + 0x10)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x10)" ( (binary_expression "param_1 + 0x10" identifier + number_literal) )))))) ;) (expression_statement "*param_2 = *(undefined4 *)(param_1 + 0xc);" (assignment_expression "*param_2 = *(undefined4 *)(param_1 + 0xc)" (pointer_expression "*param_2" * identifier) = (pointer_expression "*(undefined4 *)(param_1 + 0xc)" * (cast_expression "(undefined4 *)(param_1 + 0xc)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0xc)" ( (binary_expression "param_1 + 0xc" identifier + number_literal) ))))) ;) (expression_statement "*param_3 = *(int *)(param_1 + 0x10);" (assignment_expression "*param_3 = *(int *)(param_1 + 0x10)" (pointer_expression "*param_3" * identifier) = (pointer_expression "*(int *)(param_1 + 0x10)" * (cast_expression "(int *)(param_1 + 0x10)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x10)" ( (binary_expression "param_1 + 0x10" identifier + number_literal) ))))) ;) (if_statement "if (iVar2 != 1) {\n    return (-(uint)(*(int *)(param_1 + 0x10) == 0) & 2) - 1;\n  }" if (parenthesized_expression "(iVar2 != 1)" ( (binary_expression "iVar2 != 1" identifier != number_literal) )) (compound_statement "{\n    return (-(uint)(*(int *)(param_1 + 0x10) == 0) & 2) - 1;\n  }" { (return_statement "return (-(uint)(*(int *)(param_1 + 0x10) == 0) & 2) - 1;" return (binary_expression "(-(uint)(*(int *)(param_1 + 0x10) == 0) & 2) - 1" (parenthesized_expression "(-(uint)(*(int *)(param_1 + 0x10) == 0) & 2)" ( (binary_expression "-(uint)(*(int *)(param_1 + 0x10) == 0) & 2" (unary_expression "-(uint)(*(int *)(param_1 + 0x10) == 0)" - (call_expression "(uint)(*(int *)(param_1 + 0x10) == 0)" (parenthesized_expression "(uint)" ( identifier )) (argument_list "(*(int *)(param_1 + 0x10) == 0)" ( (binary_expression "*(int *)(param_1 + 0x10) == 0" (pointer_expression "*(int *)(param_1 + 0x10)" * (cast_expression "(int *)(param_1 + 0x10)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x10)" ( (binary_expression "param_1 + 0x10" identifier + number_literal) )))) == number_literal) )))) & number_literal) )) - number_literal) ;) })) (expression_statement "deflateEnd(param_1);" (call_expression "deflateEnd(param_1)" identifier (argument_list "(param_1)" ( identifier ))) ;) (return_statement "return 0;" return number_literal ;) })))
(translation_unit "/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n/* WARNING: Unknown calling convention */\n\nint compress_finish(z_stream_s *strm,char **next_out,int *avail_out,int *out_size)\n\n{\n  Bytef *pBVar1;\n  int iVar2;\n  \n  pBVar1 = (Bytef *)*next_out;\n  strm->avail_in = 0;\n  strm->next_out = pBVar1;\n  strm->avail_out = *avail_out;\n  iVar2 = deflate(strm,4);\n  *out_size = *avail_out - strm->avail_out;\n  *next_out = (char *)strm->next_out;\n  *avail_out = strm->avail_out;\n  if (iVar2 != 1) {\n    return (-(uint)(strm->avail_out == 0) & 2) - 1;\n  }\n  deflateEnd(strm);\n  return 0;\n}\n\n" comment comment (function_definition "int compress_finish(z_stream_s *strm,char **next_out,int *avail_out,int *out_size)\n\n{\n  Bytef *pBVar1;\n  int iVar2;\n  \n  pBVar1 = (Bytef *)*next_out;\n  strm->avail_in = 0;\n  strm->next_out = pBVar1;\n  strm->avail_out = *avail_out;\n  iVar2 = deflate(strm,4);\n  *out_size = *avail_out - strm->avail_out;\n  *next_out = (char *)strm->next_out;\n  *avail_out = strm->avail_out;\n  if (iVar2 != 1) {\n    return (-(uint)(strm->avail_out == 0) & 2) - 1;\n  }\n  deflateEnd(strm);\n  return 0;\n}" primitive_type (function_declarator "compress_finish(z_stream_s *strm,char **next_out,int *avail_out,int *out_size)" identifier (parameter_list "(z_stream_s *strm,char **next_out,int *avail_out,int *out_size)" ( (parameter_declaration "z_stream_s *strm" type_identifier (pointer_declarator "*strm" * identifier)) , (parameter_declaration "char **next_out" primitive_type (pointer_declarator "**next_out" * (pointer_declarator "*next_out" * identifier))) , (parameter_declaration "int *avail_out" primitive_type (pointer_declarator "*avail_out" * identifier)) , (parameter_declaration "int *out_size" primitive_type (pointer_declarator "*out_size" * identifier)) ))) (compound_statement "{\n  Bytef *pBVar1;\n  int iVar2;\n  \n  pBVar1 = (Bytef *)*next_out;\n  strm->avail_in = 0;\n  strm->next_out = pBVar1;\n  strm->avail_out = *avail_out;\n  iVar2 = deflate(strm,4);\n  *out_size = *avail_out - strm->avail_out;\n  *next_out = (char *)strm->next_out;\n  *avail_out = strm->avail_out;\n  if (iVar2 != 1) {\n    return (-(uint)(strm->avail_out == 0) & 2) - 1;\n  }\n  deflateEnd(strm);\n  return 0;\n}" { (declaration "Bytef *pBVar1;" type_identifier (pointer_declarator "*pBVar1" * identifier) ;) (declaration "int iVar2;" primitive_type identifier ;) (expression_statement "pBVar1 = (Bytef *)*next_out;" (assignment_expression "pBVar1 = (Bytef *)*next_out" identifier = (cast_expression "(Bytef *)*next_out" ( (type_descriptor "Bytef *" type_identifier (abstract_pointer_declarator "*" *)) ) (pointer_expression "*next_out" * identifier))) ;) (expression_statement "strm->avail_in = 0;" (assignment_expression "strm->avail_in = 0" (field_expression "strm->avail_in" identifier -> field_identifier) = number_literal) ;) (expression_statement "strm->next_out = pBVar1;" (assignment_expression "strm->next_out = pBVar1" (field_expression "strm->next_out" identifier -> field_identifier) = identifier) ;) (expression_statement "strm->avail_out = *avail_out;" (assignment_expression "strm->avail_out = *avail_out" (field_expression "strm->avail_out" identifier -> field_identifier) = (pointer_expression "*avail_out" * identifier)) ;) (expression_statement "iVar2 = deflate(strm,4);" (assignment_expression "iVar2 = deflate(strm,4)" identifier = (call_expression "deflate(strm,4)" identifier (argument_list "(strm,4)" ( identifier , number_literal )))) ;) (expression_statement "*out_size = *avail_out - strm->avail_out;" (assignment_expression "*out_size = *avail_out - strm->avail_out" (pointer_expression "*out_size" * identifier) = (binary_expression "*avail_out - strm->avail_out" (pointer_expression "*avail_out" * identifier) - (field_expression "strm->avail_out" identifier -> field_identifier))) ;) (expression_statement "*next_out = (char *)strm->next_out;" (assignment_expression "*next_out = (char *)strm->next_out" (pointer_expression "*next_out" * identifier) = (cast_expression "(char *)strm->next_out" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (field_expression "strm->next_out" identifier -> field_identifier))) ;) (expression_statement "*avail_out = strm->avail_out;" (assignment_expression "*avail_out = strm->avail_out" (pointer_expression "*avail_out" * identifier) = (field_expression "strm->avail_out" identifier -> field_identifier)) ;) (if_statement "if (iVar2 != 1) {\n    return (-(uint)(strm->avail_out == 0) & 2) - 1;\n  }" if (parenthesized_expression "(iVar2 != 1)" ( (binary_expression "iVar2 != 1" identifier != number_literal) )) (compound_statement "{\n    return (-(uint)(strm->avail_out == 0) & 2) - 1;\n  }" { (return_statement "return (-(uint)(strm->avail_out == 0) & 2) - 1;" return (binary_expression "(-(uint)(strm->avail_out == 0) & 2) - 1" (parenthesized_expression "(-(uint)(strm->avail_out == 0) & 2)" ( (binary_expression "-(uint)(strm->avail_out == 0) & 2" (unary_expression "-(uint)(strm->avail_out == 0)" - (call_expression "(uint)(strm->avail_out == 0)" (parenthesized_expression "(uint)" ( identifier )) (argument_list "(strm->avail_out == 0)" ( (binary_expression "strm->avail_out == 0" (field_expression "strm->avail_out" identifier -> field_identifier) == number_literal) )))) & number_literal) )) - number_literal) ;) })) (expression_statement "deflateEnd(strm);" (call_expression "deflateEnd(strm)" identifier (argument_list "(strm)" ( identifier ))) ;) (return_statement "return 0;" return number_literal ;) })))
(translation_unit "int FUN_00017560(int param_1,undefined4 *param_2,int *param_3,int *param_4)\n\n{\n  undefined4 uVar1;\n  int iVar2;\n  \n  uVar1 = *param_2;\n  *(undefined4 *)(param_1 + 4) = 0;\n  *(undefined4 *)(param_1 + 0xc) = uVar1;\n  *(int *)(param_1 + 0x10) = *param_3;\n  iVar2 = deflate(param_1,4);\n  *param_4 = *param_3 - *(int *)(param_1 + 0x10);\n  *param_2 = *(undefined4 *)(param_1 + 0xc);\n  *param_3 = *(int *)(param_1 + 0x10);\n  if (iVar2 != 1) {\n    return (-(uint)(*(int *)(param_1 + 0x10) == 0) & 2) - 1;\n  }\n  deflateEnd(param_1);\n  return 0;\n}\n\n" (function_definition "int FUN_00017560(int param_1,undefined4 *param_2,int *param_3,int *param_4)\n\n{\n  undefined4 uVar1;\n  int iVar2;\n  \n  uVar1 = *param_2;\n  *(undefined4 *)(param_1 + 4) = 0;\n  *(undefined4 *)(param_1 + 0xc) = uVar1;\n  *(int *)(param_1 + 0x10) = *param_3;\n  iVar2 = deflate(param_1,4);\n  *param_4 = *param_3 - *(int *)(param_1 + 0x10);\n  *param_2 = *(undefined4 *)(param_1 + 0xc);\n  *param_3 = *(int *)(param_1 + 0x10);\n  if (iVar2 != 1) {\n    return (-(uint)(*(int *)(param_1 + 0x10) == 0) & 2) - 1;\n  }\n  deflateEnd(param_1);\n  return 0;\n}" primitive_type (function_declarator "FUN_00017560(int param_1,undefined4 *param_2,int *param_3,int *param_4)" identifier (parameter_list "(int param_1,undefined4 *param_2,int *param_3,int *param_4)" ( (parameter_declaration "int param_1" primitive_type identifier) , (parameter_declaration "undefined4 *param_2" type_identifier (pointer_declarator "*param_2" * identifier)) , (parameter_declaration "int *param_3" primitive_type (pointer_declarator "*param_3" * identifier)) , (parameter_declaration "int *param_4" primitive_type (pointer_declarator "*param_4" * identifier)) ))) (compound_statement "{\n  undefined4 uVar1;\n  int iVar2;\n  \n  uVar1 = *param_2;\n  *(undefined4 *)(param_1 + 4) = 0;\n  *(undefined4 *)(param_1 + 0xc) = uVar1;\n  *(int *)(param_1 + 0x10) = *param_3;\n  iVar2 = deflate(param_1,4);\n  *param_4 = *param_3 - *(int *)(param_1 + 0x10);\n  *param_2 = *(undefined4 *)(param_1 + 0xc);\n  *param_3 = *(int *)(param_1 + 0x10);\n  if (iVar2 != 1) {\n    return (-(uint)(*(int *)(param_1 + 0x10) == 0) & 2) - 1;\n  }\n  deflateEnd(param_1);\n  return 0;\n}" { (declaration "undefined4 uVar1;" type_identifier identifier ;) (declaration "int iVar2;" primitive_type identifier ;) (expression_statement "uVar1 = *param_2;" (assignment_expression "uVar1 = *param_2" identifier = (pointer_expression "*param_2" * identifier)) ;) (expression_statement "*(undefined4 *)(param_1 + 4) = 0;" (assignment_expression "*(undefined4 *)(param_1 + 4) = 0" (pointer_expression "*(undefined4 *)(param_1 + 4)" * (cast_expression "(undefined4 *)(param_1 + 4)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 4)" ( (binary_expression "param_1 + 4" identifier + number_literal) )))) = number_literal) ;) (expression_statement "*(undefined4 *)(param_1 + 0xc) = uVar1;" (assignment_expression "*(undefined4 *)(param_1 + 0xc) = uVar1" (pointer_expression "*(undefined4 *)(param_1 + 0xc)" * (cast_expression "(undefined4 *)(param_1 + 0xc)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0xc)" ( (binary_expression "param_1 + 0xc" identifier + number_literal) )))) = identifier) ;) (expression_statement "*(int *)(param_1 + 0x10) = *param_3;" (assignment_expression "*(int *)(param_1 + 0x10) = *param_3" (pointer_expression "*(int *)(param_1 + 0x10)" * (cast_expression "(int *)(param_1 + 0x10)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x10)" ( (binary_expression "param_1 + 0x10" identifier + number_literal) )))) = (pointer_expression "*param_3" * identifier)) ;) (expression_statement "iVar2 = deflate(param_1,4);" (assignment_expression "iVar2 = deflate(param_1,4)" identifier = (call_expression "deflate(param_1,4)" identifier (argument_list "(param_1,4)" ( identifier , number_literal )))) ;) (expression_statement "*param_4 = *param_3 - *(int *)(param_1 + 0x10);" (assignment_expression "*param_4 = *param_3 - *(int *)(param_1 + 0x10)" (pointer_expression "*param_4" * identifier) = (binary_expression "*param_3 - *(int *)(param_1 + 0x10)" (pointer_expression "*param_3" * identifier) - (pointer_expression "*(int *)(param_1 + 0x10)" * (cast_expression "(int *)(param_1 + 0x10)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x10)" ( (binary_expression "param_1 + 0x10" identifier + number_literal) )))))) ;) (expression_statement "*param_2 = *(undefined4 *)(param_1 + 0xc);" (assignment_expression "*param_2 = *(undefined4 *)(param_1 + 0xc)" (pointer_expression "*param_2" * identifier) = (pointer_expression "*(undefined4 *)(param_1 + 0xc)" * (cast_expression "(undefined4 *)(param_1 + 0xc)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0xc)" ( (binary_expression "param_1 + 0xc" identifier + number_literal) ))))) ;) (expression_statement "*param_3 = *(int *)(param_1 + 0x10);" (assignment_expression "*param_3 = *(int *)(param_1 + 0x10)" (pointer_expression "*param_3" * identifier) = (pointer_expression "*(int *)(param_1 + 0x10)" * (cast_expression "(int *)(param_1 + 0x10)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x10)" ( (binary_expression "param_1 + 0x10" identifier + number_literal) ))))) ;) (if_statement "if (iVar2 != 1) {\n    return (-(uint)(*(int *)(param_1 + 0x10) == 0) & 2) - 1;\n  }" if (parenthesized_expression "(iVar2 != 1)" ( (binary_expression "iVar2 != 1" identifier != number_literal) )) (compound_statement "{\n    return (-(uint)(*(int *)(param_1 + 0x10) == 0) & 2) - 1;\n  }" { (return_statement "return (-(uint)(*(int *)(param_1 + 0x10) == 0) & 2) - 1;" return (binary_expression "(-(uint)(*(int *)(param_1 + 0x10) == 0) & 2) - 1" (parenthesized_expression "(-(uint)(*(int *)(param_1 + 0x10) == 0) & 2)" ( (binary_expression "-(uint)(*(int *)(param_1 + 0x10) == 0) & 2" (unary_expression "-(uint)(*(int *)(param_1 + 0x10) == 0)" - (call_expression "(uint)(*(int *)(param_1 + 0x10) == 0)" (parenthesized_expression "(uint)" ( identifier )) (argument_list "(*(int *)(param_1 + 0x10) == 0)" ( (binary_expression "*(int *)(param_1 + 0x10) == 0" (pointer_expression "*(int *)(param_1 + 0x10)" * (cast_expression "(int *)(param_1 + 0x10)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x10)" ( (binary_expression "param_1 + 0x10" identifier + number_literal) )))) == number_literal) )))) & number_literal) )) - number_literal) ;) })) (expression_statement "deflateEnd(param_1);" (call_expression "deflateEnd(param_1)" identifier (argument_list "(param_1)" ( identifier ))) ;) (return_statement "return 0;" return number_literal ;) })))
(translation_unit (function_definition TYPE (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE (pointer_declarator * IDENT)) , (parameter_declaration TYPE (pointer_declarator * IDENT)) , (parameter_declaration TYPE (pointer_declarator * IDENT)) ))) (compound_statement { (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (expression_statement (assignment_expression IDENT = (pointer_expression * IDENT)) ;) (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) )))) = (pointer_expression * IDENT)) ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT , LIT )))) ;) (expression_statement (assignment_expression (pointer_expression * IDENT) = (binary_expression (pointer_expression * IDENT) - (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))))) ;) (expression_statement (assignment_expression (pointer_expression * IDENT) = (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))))) ;) (expression_statement (assignment_expression (pointer_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 { (return_statement return (binary_expression (parenthesized_expression ( (binary_expression (unary_expression - (call_expression (parenthesized_expression ( IDENT )) (argument_list ( (binary_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) == LIT) )))) & LIT) )) - LIT) ;) })) (expression_statement (call_expression IDENT (argument_list ( IDENT ))) ;) (return_statement return LIT ;) })))
(function_definition "int FUN_00017560(int param_1,undefined4 *param_2,int *param_3,int *param_4)\n\n{\n  undefined4 uVar1;\n  int iVar2;\n  \n  uVar1 = *param_2;\n  *(undefined4 *)(param_1 + 4) = 0;\n  *(undefined4 *)(param_1 + 0xc) = uVar1;\n  *(int *)(param_1 + 0x10) = *param_3;\n  iVar2 = deflate(param_1,4);\n  *param_4 = *param_3 - *(int *)(param_1 + 0x10);\n  *param_2 = *(undefined4 *)(param_1 + 0xc);\n  *param_3 = *(int *)(param_1 + 0x10);\n  if (iVar2 != 1) {\n    return (-(uint)(*(int *)(param_1 + 0x10) == 0) & 2) - 1;\n  }\n  deflateEnd(param_1);\n  return 0;\n}" (primitive_type "int") (function_declarator "FUN_00017560(int param_1,undefined4 *param_2,int *param_3,int *param_4)" (identifier "FUN_00017560") (parameter_list "(int param_1,undefined4 *param_2,int *param_3,int *param_4)" (( "(") (parameter_declaration "int param_1" (primitive_type "int") (identifier "param_1")) (, ",") (parameter_declaration "undefined4 *param_2" (type_identifier "undefined4") (pointer_declarator "*param_2" (* "*") (identifier "param_2"))) (, ",") (parameter_declaration "int *param_3" (primitive_type "int") (pointer_declarator "*param_3" (* "*") (identifier "param_3"))) (, ",") (parameter_declaration "int *param_4" (primitive_type "int") (pointer_declarator "*param_4" (* "*") (identifier "param_4"))) () ")"))) (compound_statement "{\n  undefined4 uVar1;\n  int iVar2;\n  \n  uVar1 = *param_2;\n  *(undefined4 *)(param_1 + 4) = 0;\n  *(undefined4 *)(param_1 + 0xc) = uVar1;\n  *(int *)(param_1 + 0x10) = *param_3;\n  iVar2 = deflate(param_1,4);\n  *param_4 = *param_3 - *(int *)(param_1 + 0x10);\n  *param_2 = *(undefined4 *)(param_1 + 0xc);\n  *param_3 = *(int *)(param_1 + 0x10);\n  if (iVar2 != 1) {\n    return (-(uint)(*(int *)(param_1 + 0x10) == 0) & 2) - 1;\n  }\n  deflateEnd(param_1);\n  return 0;\n}" ({ "{") (declaration "undefined4 uVar1;" (type_identifier "undefined4") (identifier "uVar1") (; ";")) (declaration "int iVar2;" (primitive_type "int") (identifier "iVar2") (; ";")) (expression_statement "uVar1 = *param_2;" (assignment_expression "uVar1 = *param_2" (identifier "uVar1") (= "=") (pointer_expression "*param_2" (* "*") (identifier "param_2"))) (; ";")) (expression_statement "*(undefined4 *)(param_1 + 4) = 0;" (assignment_expression "*(undefined4 *)(param_1 + 4) = 0" (pointer_expression "*(undefined4 *)(param_1 + 4)" (* "*") (cast_expression "(undefined4 *)(param_1 + 4)" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 4)" (( "(") (binary_expression "param_1 + 4" (identifier "param_1") (+ "+") (number_literal "4")) () ")")))) (= "=") (number_literal "0")) (; ";")) (expression_statement "*(undefined4 *)(param_1 + 0xc) = uVar1;" (assignment_expression "*(undefined4 *)(param_1 + 0xc) = uVar1" (pointer_expression "*(undefined4 *)(param_1 + 0xc)" (* "*") (cast_expression "(undefined4 *)(param_1 + 0xc)" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 0xc)" (( "(") (binary_expression "param_1 + 0xc" (identifier "param_1") (+ "+") (number_literal "0xc")) () ")")))) (= "=") (identifier "uVar1")) (; ";")) (expression_statement "*(int *)(param_1 + 0x10) = *param_3;" (assignment_expression "*(int *)(param_1 + 0x10) = *param_3" (pointer_expression "*(int *)(param_1 + 0x10)" (* "*") (cast_expression "(int *)(param_1 + 0x10)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 0x10)" (( "(") (binary_expression "param_1 + 0x10" (identifier "param_1") (+ "+") (number_literal "0x10")) () ")")))) (= "=") (pointer_expression "*param_3" (* "*") (identifier "param_3"))) (; ";")) (expression_statement "iVar2 = deflate(param_1,4);" (assignment_expression "iVar2 = deflate(param_1,4)" (identifier "iVar2") (= "=") (call_expression "deflate(param_1,4)" (identifier "deflate") (argument_list "(param_1,4)" (( "(") (identifier "param_1") (, ",") (number_literal "4") () ")")))) (; ";")) (expression_statement "*param_4 = *param_3 - *(int *)(param_1 + 0x10);" (assignment_expression "*param_4 = *param_3 - *(int *)(param_1 + 0x10)" (pointer_expression "*param_4" (* "*") (identifier "param_4")) (= "=") (binary_expression "*param_3 - *(int *)(param_1 + 0x10)" (pointer_expression "*param_3" (* "*") (identifier "param_3")) (- "-") (pointer_expression "*(int *)(param_1 + 0x10)" (* "*") (cast_expression "(int *)(param_1 + 0x10)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 0x10)" (( "(") (binary_expression "param_1 + 0x10" (identifier "param_1") (+ "+") (number_literal "0x10")) () ")")))))) (; ";")) (expression_statement "*param_2 = *(undefined4 *)(param_1 + 0xc);" (assignment_expression "*param_2 = *(undefined4 *)(param_1 + 0xc)" (pointer_expression "*param_2" (* "*") (identifier "param_2")) (= "=") (pointer_expression "*(undefined4 *)(param_1 + 0xc)" (* "*") (cast_expression "(undefined4 *)(param_1 + 0xc)" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 0xc)" (( "(") (binary_expression "param_1 + 0xc" (identifier "param_1") (+ "+") (number_literal "0xc")) () ")"))))) (; ";")) (expression_statement "*param_3 = *(int *)(param_1 + 0x10);" (assignment_expression "*param_3 = *(int *)(param_1 + 0x10)" (pointer_expression "*param_3" (* "*") (identifier "param_3")) (= "=") (pointer_expression "*(int *)(param_1 + 0x10)" (* "*") (cast_expression "(int *)(param_1 + 0x10)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 0x10)" (( "(") (binary_expression "param_1 + 0x10" (identifier "param_1") (+ "+") (number_literal "0x10")) () ")"))))) (; ";")) (if_statement "if (iVar2 != 1) {\n    return (-(uint)(*(int *)(param_1 + 0x10) == 0) & 2) - 1;\n  }" (if "if") (parenthesized_expression "(iVar2 != 1)" (( "(") (binary_expression "iVar2 != 1" (identifier "iVar2") (!= "!=") (number_literal "1")) () ")")) (compound_statement "{\n    return (-(uint)(*(int *)(param_1 + 0x10) == 0) & 2) - 1;\n  }" ({ "{") (return_statement "return (-(uint)(*(int *)(param_1 + 0x10) == 0) & 2) - 1;" (return "return") (binary_expression "(-(uint)(*(int *)(param_1 + 0x10) == 0) & 2) - 1" (parenthesized_expression "(-(uint)(*(int *)(param_1 + 0x10) == 0) & 2)" (( "(") (binary_expression "-(uint)(*(int *)(param_1 + 0x10) == 0) & 2" (unary_expression "-(uint)(*(int *)(param_1 + 0x10) == 0)" (- "-") (call_expression "(uint)(*(int *)(param_1 + 0x10) == 0)" (parenthesized_expression "(uint)" (( "(") (identifier "uint") () ")")) (argument_list "(*(int *)(param_1 + 0x10) == 0)" (( "(") (binary_expression "*(int *)(param_1 + 0x10) == 0" (pointer_expression "*(int *)(param_1 + 0x10)" (* "*") (cast_expression "(int *)(param_1 + 0x10)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 0x10)" (( "(") (binary_expression "param_1 + 0x10" (identifier "param_1") (+ "+") (number_literal "0x10")) () ")")))) (== "==") (number_literal "0")) () ")")))) (& "&") (number_literal "2")) () ")")) (- "-") (number_literal "1")) (; ";")) (} "}"))) (expression_statement "deflateEnd(param_1);" (call_expression "deflateEnd(param_1)" (identifier "deflateEnd") (argument_list "(param_1)" (( "(") (identifier "param_1") () ")"))) (; ";")) (return_statement "return 0;" (return "return") (number_literal "0") (; ";")) (} "}")))

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

int function_1(type_1 *strm,char **next_out,int *avail_out,int *out_size)

{
  type_2 *pBVar1;
  int var_2;
  
  pBVar1 = (type_2 *)*next_out;
  strm->avail_in = 0;
  strm->next_out = pBVar1;
  strm->avail_out = *avail_out;
  var_2 = var_1(strm,4);
  *out_size = *avail_out - strm->avail_out;
  *next_out = (char *)strm->next_out;
  *avail_out = strm->avail_out;
  if (var_2 != 1) {
    return (-(uint)(strm->avail_out == 0) & 2) - 1;
  }
  var_3(strm);
  return 0;
}


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

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

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

{
  undefined4 uVar1;
  int iVar2;
  
  uVar1 = *param_2;
  *(undefined4 *)(param_1 + 4) = 0;
  *(undefined4 *)(param_1 + 0xc) = uVar1;
  *(int *)(param_1 + 0x10) = *param_3;
  iVar2 = deflate(param_1,4);
  *param_4 = *param_3 - *(int *)(param_1 + 0x10);
  *param_2 = *(undefined4 *)(param_1 + 0xc);
  *param_3 = *(int *)(param_1 + 0x10);
  if (iVar2 != 1) {
    return (-(uint)(*(int *)(param_1 + 0x10) == 0) & 2) - 1;
  }
  deflateEnd(param_1);
  return 0;
}

