
/* WARNING: Function: __x86.get_pc_thunk.dx replaced with injection: get_pc_thunk_dx */
/* WARNING: Unknown calling convention */

int png_muldiv(png_fixed_point_p res,png_fixed_point a,png_int_32 times,png_int_32 divisor)

{
  float fVar1;
  
  if (divisor != 0) {
    if ((a == 0) || (times == 0)) {
      *res = 0;
      return 1;
    }
    fVar1 = ROUND(((float)times * (float)a) / (float)divisor + DAT_0003c4e8);
    if (((float)DAT_0003c518 < fVar1) || (fVar1 < DAT_0003c4f4)) {
      return 0;
    }
    *res = (int)ROUND(fVar1);
    divisor = 1;
  }
  return divisor;
}



/* WARNING: Function: __i686.get_pc_thunk.dx replaced with injection: get_pc_thunk_dx */

int FUN_000176f0(int *param_1,int param_2,int param_3,int param_4)

{
  float fVar1;
  
  if (param_4 != 0) {
    if ((param_2 == 0) || (param_3 == 0)) {
      *param_1 = 0;
      return 1;
    }
    fVar1 = ROUND(((float)param_3 * (float)param_2) / (float)param_4 + DAT_0003c4e8);
    if (((float)DAT_0003c518 < fVar1) || (fVar1 < DAT_0003c4f4)) {
      return 0;
    }
    *param_1 = (int)ROUND(fVar1);
    param_4 = 1;
  }
  return param_4;
}


CALL 0x00014aa5
ADD EDX,0x3668b
SUB ESP,0x14
MOV EAX,dword ptr [ESP + 0x24]
TEST EAX,EAX
JZ 0x00017793
MOV ECX,dword ptr [ESP + 0x1c]
TEST ECX,ECX
JZ 0x000177b0
MOV ECX,dword ptr [ESP + 0x20]
TEST ECX,ECX
JZ 0x000177b0
FNSTCW word ptr [ESP + 0xe]
FILD dword ptr [ESP + 0x1c]
FILD dword ptr [ESP + 0x20]
MOV dword ptr [ESP],EAX
MOVZX EAX,word ptr [ESP + 0xe]
FMULP
FILD dword ptr [ESP]
AND AH,0xf3
OR AH,0x4
FDIVP
MOV word ptr [ESP + 0xa],AX
FADD dword ptr [EDX + 0xfffee768]
FLDCW word ptr [ESP + 0xa]
FRNDINT
FLDCW word ptr [ESP + 0xe]
FLD qword ptr [EDX + 0xfffee798]
FST qword ptr [ESP]
FCOMIP ST0,ST1
JC 0x000177a0
FLD dword ptr [EDX + 0xfffee774]
FXCH
FCOMI ST0,ST1
FSTP ST1
JC 0x000177a8
MOVZX EAX,word ptr [ESP + 0xe]
OR AH,0xc
MOV word ptr [ESP + 0xc],AX
MOV EAX,dword ptr [ESP + 0x18]
FLDCW word ptr [ESP + 0xc]
FISTP dword ptr [EAX]
FLDCW word ptr [ESP + 0xe]
MOV EAX,0x1
ADD ESP,0x14
RET
FSTP ST0
JMP 0x000177aa
FSTP ST0
XOR EAX,EAX
ADD ESP,0x14
RET
MOV EAX,dword ptr [ESP + 0x18]
MOV dword ptr [EAX],0x0
MOV EAX,0x1
ADD ESP,0x14
RET
(translation_unit "/* WARNING: Function: __i686.get_pc_thunk.dx replaced with injection: get_pc_thunk_dx */\n\nint FUN_000176f0(int *param_1,int param_2,int param_3,int param_4)\n\n{\n  float fVar1;\n  \n  if (param_4 != 0) {\n    if ((param_2 == 0) || (param_3 == 0)) {\n      *param_1 = 0;\n      return 1;\n    }\n    fVar1 = ROUND(((float)param_3 * (float)param_2) / (float)param_4 + DAT_0003c4e8);\n    if (((float)DAT_0003c518 < fVar1) || (fVar1 < DAT_0003c4f4)) {\n      return 0;\n    }\n    *param_1 = (int)ROUND(fVar1);\n    param_4 = 1;\n  }\n  return param_4;\n}\n\n" comment (function_definition "int FUN_000176f0(int *param_1,int param_2,int param_3,int param_4)\n\n{\n  float fVar1;\n  \n  if (param_4 != 0) {\n    if ((param_2 == 0) || (param_3 == 0)) {\n      *param_1 = 0;\n      return 1;\n    }\n    fVar1 = ROUND(((float)param_3 * (float)param_2) / (float)param_4 + DAT_0003c4e8);\n    if (((float)DAT_0003c518 < fVar1) || (fVar1 < DAT_0003c4f4)) {\n      return 0;\n    }\n    *param_1 = (int)ROUND(fVar1);\n    param_4 = 1;\n  }\n  return param_4;\n}" primitive_type (function_declarator "FUN_000176f0(int *param_1,int param_2,int param_3,int param_4)" identifier (parameter_list "(int *param_1,int param_2,int param_3,int param_4)" ( (parameter_declaration "int *param_1" primitive_type (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "int param_2" primitive_type identifier) , (parameter_declaration "int param_3" primitive_type identifier) , (parameter_declaration "int param_4" primitive_type identifier) ))) (compound_statement "{\n  float fVar1;\n  \n  if (param_4 != 0) {\n    if ((param_2 == 0) || (param_3 == 0)) {\n      *param_1 = 0;\n      return 1;\n    }\n    fVar1 = ROUND(((float)param_3 * (float)param_2) / (float)param_4 + DAT_0003c4e8);\n    if (((float)DAT_0003c518 < fVar1) || (fVar1 < DAT_0003c4f4)) {\n      return 0;\n    }\n    *param_1 = (int)ROUND(fVar1);\n    param_4 = 1;\n  }\n  return param_4;\n}" { (declaration "float fVar1;" primitive_type identifier ;) (if_statement "if (param_4 != 0) {\n    if ((param_2 == 0) || (param_3 == 0)) {\n      *param_1 = 0;\n      return 1;\n    }\n    fVar1 = ROUND(((float)param_3 * (float)param_2) / (float)param_4 + DAT_0003c4e8);\n    if (((float)DAT_0003c518 < fVar1) || (fVar1 < DAT_0003c4f4)) {\n      return 0;\n    }\n    *param_1 = (int)ROUND(fVar1);\n    param_4 = 1;\n  }" if (parenthesized_expression "(param_4 != 0)" ( (binary_expression "param_4 != 0" identifier != number_literal) )) (compound_statement "{\n    if ((param_2 == 0) || (param_3 == 0)) {\n      *param_1 = 0;\n      return 1;\n    }\n    fVar1 = ROUND(((float)param_3 * (float)param_2) / (float)param_4 + DAT_0003c4e8);\n    if (((float)DAT_0003c518 < fVar1) || (fVar1 < DAT_0003c4f4)) {\n      return 0;\n    }\n    *param_1 = (int)ROUND(fVar1);\n    param_4 = 1;\n  }" { (if_statement "if ((param_2 == 0) || (param_3 == 0)) {\n      *param_1 = 0;\n      return 1;\n    }" if (parenthesized_expression "((param_2 == 0) || (param_3 == 0))" ( (binary_expression "(param_2 == 0) || (param_3 == 0)" (parenthesized_expression "(param_2 == 0)" ( (binary_expression "param_2 == 0" identifier == number_literal) )) || (parenthesized_expression "(param_3 == 0)" ( (binary_expression "param_3 == 0" identifier == number_literal) ))) )) (compound_statement "{\n      *param_1 = 0;\n      return 1;\n    }" { (expression_statement "*param_1 = 0;" (assignment_expression "*param_1 = 0" (pointer_expression "*param_1" * identifier) = number_literal) ;) (return_statement "return 1;" return number_literal ;) })) (expression_statement "fVar1 = ROUND(((float)param_3 * (float)param_2) / (float)param_4 + DAT_0003c4e8);" (assignment_expression "fVar1 = ROUND(((float)param_3 * (float)param_2) / (float)param_4 + DAT_0003c4e8)" identifier = (call_expression "ROUND(((float)param_3 * (float)param_2) / (float)param_4 + DAT_0003c4e8)" identifier (argument_list "(((float)param_3 * (float)param_2) / (float)param_4 + DAT_0003c4e8)" ( (binary_expression "((float)param_3 * (float)param_2) / (float)param_4 + DAT_0003c4e8" (binary_expression "((float)param_3 * (float)param_2) / (float)param_4" (parenthesized_expression "((float)param_3 * (float)param_2)" ( (binary_expression "(float)param_3 * (float)param_2" (cast_expression "(float)param_3" ( (type_descriptor "float" primitive_type) ) identifier) * (cast_expression "(float)param_2" ( (type_descriptor "float" primitive_type) ) identifier)) )) / (cast_expression "(float)param_4" ( (type_descriptor "float" primitive_type) ) identifier)) + identifier) )))) ;) (if_statement "if (((float)DAT_0003c518 < fVar1) || (fVar1 < DAT_0003c4f4)) {\n      return 0;\n    }" if (parenthesized_expression "(((float)DAT_0003c518 < fVar1) || (fVar1 < DAT_0003c4f4))" ( (binary_expression "((float)DAT_0003c518 < fVar1) || (fVar1 < DAT_0003c4f4)" (parenthesized_expression "((float)DAT_0003c518 < fVar1)" ( (binary_expression "(float)DAT_0003c518 < fVar1" (cast_expression "(float)DAT_0003c518" ( (type_descriptor "float" primitive_type) ) identifier) < identifier) )) || (parenthesized_expression "(fVar1 < DAT_0003c4f4)" ( (binary_expression "fVar1 < DAT_0003c4f4" identifier < identifier) ))) )) (compound_statement "{\n      return 0;\n    }" { (return_statement "return 0;" return number_literal ;) })) (expression_statement "*param_1 = (int)ROUND(fVar1);" (assignment_expression "*param_1 = (int)ROUND(fVar1)" (pointer_expression "*param_1" * identifier) = (cast_expression "(int)ROUND(fVar1)" ( (type_descriptor "int" primitive_type) ) (call_expression "ROUND(fVar1)" identifier (argument_list "(fVar1)" ( identifier ))))) ;) (expression_statement "param_4 = 1;" (assignment_expression "param_4 = 1" identifier = number_literal) ;) })) (return_statement "return param_4;" return identifier ;) })))
(translation_unit "/* WARNING: Function: __x86.get_pc_thunk.dx replaced with injection: get_pc_thunk_dx */\n/* WARNING: Unknown calling convention */\n\nint png_muldiv(png_fixed_point_p res,png_fixed_point a,png_int_32 times,png_int_32 divisor)\n\n{\n  float fVar1;\n  \n  if (divisor != 0) {\n    if ((a == 0) || (times == 0)) {\n      *res = 0;\n      return 1;\n    }\n    fVar1 = ROUND(((float)times * (float)a) / (float)divisor + DAT_0003c4e8);\n    if (((float)DAT_0003c518 < fVar1) || (fVar1 < DAT_0003c4f4)) {\n      return 0;\n    }\n    *res = (int)ROUND(fVar1);\n    divisor = 1;\n  }\n  return divisor;\n}\n\n" comment comment (function_definition "int png_muldiv(png_fixed_point_p res,png_fixed_point a,png_int_32 times,png_int_32 divisor)\n\n{\n  float fVar1;\n  \n  if (divisor != 0) {\n    if ((a == 0) || (times == 0)) {\n      *res = 0;\n      return 1;\n    }\n    fVar1 = ROUND(((float)times * (float)a) / (float)divisor + DAT_0003c4e8);\n    if (((float)DAT_0003c518 < fVar1) || (fVar1 < DAT_0003c4f4)) {\n      return 0;\n    }\n    *res = (int)ROUND(fVar1);\n    divisor = 1;\n  }\n  return divisor;\n}" primitive_type (function_declarator "png_muldiv(png_fixed_point_p res,png_fixed_point a,png_int_32 times,png_int_32 divisor)" identifier (parameter_list "(png_fixed_point_p res,png_fixed_point a,png_int_32 times,png_int_32 divisor)" ( (parameter_declaration "png_fixed_point_p res" type_identifier identifier) , (parameter_declaration "png_fixed_point a" type_identifier identifier) , (parameter_declaration "png_int_32 times" type_identifier identifier) , (parameter_declaration "png_int_32 divisor" type_identifier identifier) ))) (compound_statement "{\n  float fVar1;\n  \n  if (divisor != 0) {\n    if ((a == 0) || (times == 0)) {\n      *res = 0;\n      return 1;\n    }\n    fVar1 = ROUND(((float)times * (float)a) / (float)divisor + DAT_0003c4e8);\n    if (((float)DAT_0003c518 < fVar1) || (fVar1 < DAT_0003c4f4)) {\n      return 0;\n    }\n    *res = (int)ROUND(fVar1);\n    divisor = 1;\n  }\n  return divisor;\n}" { (declaration "float fVar1;" primitive_type identifier ;) (if_statement "if (divisor != 0) {\n    if ((a == 0) || (times == 0)) {\n      *res = 0;\n      return 1;\n    }\n    fVar1 = ROUND(((float)times * (float)a) / (float)divisor + DAT_0003c4e8);\n    if (((float)DAT_0003c518 < fVar1) || (fVar1 < DAT_0003c4f4)) {\n      return 0;\n    }\n    *res = (int)ROUND(fVar1);\n    divisor = 1;\n  }" if (parenthesized_expression "(divisor != 0)" ( (binary_expression "divisor != 0" identifier != number_literal) )) (compound_statement "{\n    if ((a == 0) || (times == 0)) {\n      *res = 0;\n      return 1;\n    }\n    fVar1 = ROUND(((float)times * (float)a) / (float)divisor + DAT_0003c4e8);\n    if (((float)DAT_0003c518 < fVar1) || (fVar1 < DAT_0003c4f4)) {\n      return 0;\n    }\n    *res = (int)ROUND(fVar1);\n    divisor = 1;\n  }" { (if_statement "if ((a == 0) || (times == 0)) {\n      *res = 0;\n      return 1;\n    }" if (parenthesized_expression "((a == 0) || (times == 0))" ( (binary_expression "(a == 0) || (times == 0)" (parenthesized_expression "(a == 0)" ( (binary_expression "a == 0" identifier == number_literal) )) || (parenthesized_expression "(times == 0)" ( (binary_expression "times == 0" identifier == number_literal) ))) )) (compound_statement "{\n      *res = 0;\n      return 1;\n    }" { (expression_statement "*res = 0;" (assignment_expression "*res = 0" (pointer_expression "*res" * identifier) = number_literal) ;) (return_statement "return 1;" return number_literal ;) })) (expression_statement "fVar1 = ROUND(((float)times * (float)a) / (float)divisor + DAT_0003c4e8);" (assignment_expression "fVar1 = ROUND(((float)times * (float)a) / (float)divisor + DAT_0003c4e8)" identifier = (call_expression "ROUND(((float)times * (float)a) / (float)divisor + DAT_0003c4e8)" identifier (argument_list "(((float)times * (float)a) / (float)divisor + DAT_0003c4e8)" ( (binary_expression "((float)times * (float)a) / (float)divisor + DAT_0003c4e8" (binary_expression "((float)times * (float)a) / (float)divisor" (parenthesized_expression "((float)times * (float)a)" ( (binary_expression "(float)times * (float)a" (cast_expression "(float)times" ( (type_descriptor "float" primitive_type) ) identifier) * (cast_expression "(float)a" ( (type_descriptor "float" primitive_type) ) identifier)) )) / (cast_expression "(float)divisor" ( (type_descriptor "float" primitive_type) ) identifier)) + identifier) )))) ;) (if_statement "if (((float)DAT_0003c518 < fVar1) || (fVar1 < DAT_0003c4f4)) {\n      return 0;\n    }" if (parenthesized_expression "(((float)DAT_0003c518 < fVar1) || (fVar1 < DAT_0003c4f4))" ( (binary_expression "((float)DAT_0003c518 < fVar1) || (fVar1 < DAT_0003c4f4)" (parenthesized_expression "((float)DAT_0003c518 < fVar1)" ( (binary_expression "(float)DAT_0003c518 < fVar1" (cast_expression "(float)DAT_0003c518" ( (type_descriptor "float" primitive_type) ) identifier) < identifier) )) || (parenthesized_expression "(fVar1 < DAT_0003c4f4)" ( (binary_expression "fVar1 < DAT_0003c4f4" identifier < identifier) ))) )) (compound_statement "{\n      return 0;\n    }" { (return_statement "return 0;" return number_literal ;) })) (expression_statement "*res = (int)ROUND(fVar1);" (assignment_expression "*res = (int)ROUND(fVar1)" (pointer_expression "*res" * identifier) = (cast_expression "(int)ROUND(fVar1)" ( (type_descriptor "int" primitive_type) ) (call_expression "ROUND(fVar1)" identifier (argument_list "(fVar1)" ( identifier ))))) ;) (expression_statement "divisor = 1;" (assignment_expression "divisor = 1" identifier = number_literal) ;) })) (return_statement "return divisor;" return identifier ;) })))
(translation_unit "int FUN_000176f0(int *param_1,int param_2,int param_3,int param_4)\n\n{\n  float fVar1;\n  \n  if (param_4 != 0) {\n    if ((param_2 == 0) || (param_3 == 0)) {\n      *param_1 = 0;\n      return 1;\n    }\n    fVar1 = ROUND(((float)param_3 * (float)param_2) / (float)param_4 + DAT_0003c4e8);\n    if (((float)DAT_0003c518 < fVar1) || (fVar1 < DAT_0003c4f4)) {\n      return 0;\n    }\n    *param_1 = (int)ROUND(fVar1);\n    param_4 = 1;\n  }\n  return param_4;\n}\n\n" (function_definition "int FUN_000176f0(int *param_1,int param_2,int param_3,int param_4)\n\n{\n  float fVar1;\n  \n  if (param_4 != 0) {\n    if ((param_2 == 0) || (param_3 == 0)) {\n      *param_1 = 0;\n      return 1;\n    }\n    fVar1 = ROUND(((float)param_3 * (float)param_2) / (float)param_4 + DAT_0003c4e8);\n    if (((float)DAT_0003c518 < fVar1) || (fVar1 < DAT_0003c4f4)) {\n      return 0;\n    }\n    *param_1 = (int)ROUND(fVar1);\n    param_4 = 1;\n  }\n  return param_4;\n}" primitive_type (function_declarator "FUN_000176f0(int *param_1,int param_2,int param_3,int param_4)" identifier (parameter_list "(int *param_1,int param_2,int param_3,int param_4)" ( (parameter_declaration "int *param_1" primitive_type (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "int param_2" primitive_type identifier) , (parameter_declaration "int param_3" primitive_type identifier) , (parameter_declaration "int param_4" primitive_type identifier) ))) (compound_statement "{\n  float fVar1;\n  \n  if (param_4 != 0) {\n    if ((param_2 == 0) || (param_3 == 0)) {\n      *param_1 = 0;\n      return 1;\n    }\n    fVar1 = ROUND(((float)param_3 * (float)param_2) / (float)param_4 + DAT_0003c4e8);\n    if (((float)DAT_0003c518 < fVar1) || (fVar1 < DAT_0003c4f4)) {\n      return 0;\n    }\n    *param_1 = (int)ROUND(fVar1);\n    param_4 = 1;\n  }\n  return param_4;\n}" { (declaration "float fVar1;" primitive_type identifier ;) (if_statement "if (param_4 != 0) {\n    if ((param_2 == 0) || (param_3 == 0)) {\n      *param_1 = 0;\n      return 1;\n    }\n    fVar1 = ROUND(((float)param_3 * (float)param_2) / (float)param_4 + DAT_0003c4e8);\n    if (((float)DAT_0003c518 < fVar1) || (fVar1 < DAT_0003c4f4)) {\n      return 0;\n    }\n    *param_1 = (int)ROUND(fVar1);\n    param_4 = 1;\n  }" if (parenthesized_expression "(param_4 != 0)" ( (binary_expression "param_4 != 0" identifier != number_literal) )) (compound_statement "{\n    if ((param_2 == 0) || (param_3 == 0)) {\n      *param_1 = 0;\n      return 1;\n    }\n    fVar1 = ROUND(((float)param_3 * (float)param_2) / (float)param_4 + DAT_0003c4e8);\n    if (((float)DAT_0003c518 < fVar1) || (fVar1 < DAT_0003c4f4)) {\n      return 0;\n    }\n    *param_1 = (int)ROUND(fVar1);\n    param_4 = 1;\n  }" { (if_statement "if ((param_2 == 0) || (param_3 == 0)) {\n      *param_1 = 0;\n      return 1;\n    }" if (parenthesized_expression "((param_2 == 0) || (param_3 == 0))" ( (binary_expression "(param_2 == 0) || (param_3 == 0)" (parenthesized_expression "(param_2 == 0)" ( (binary_expression "param_2 == 0" identifier == number_literal) )) || (parenthesized_expression "(param_3 == 0)" ( (binary_expression "param_3 == 0" identifier == number_literal) ))) )) (compound_statement "{\n      *param_1 = 0;\n      return 1;\n    }" { (expression_statement "*param_1 = 0;" (assignment_expression "*param_1 = 0" (pointer_expression "*param_1" * identifier) = number_literal) ;) (return_statement "return 1;" return number_literal ;) })) (expression_statement "fVar1 = ROUND(((float)param_3 * (float)param_2) / (float)param_4 + DAT_0003c4e8);" (assignment_expression "fVar1 = ROUND(((float)param_3 * (float)param_2) / (float)param_4 + DAT_0003c4e8)" identifier = (call_expression "ROUND(((float)param_3 * (float)param_2) / (float)param_4 + DAT_0003c4e8)" identifier (argument_list "(((float)param_3 * (float)param_2) / (float)param_4 + DAT_0003c4e8)" ( (binary_expression "((float)param_3 * (float)param_2) / (float)param_4 + DAT_0003c4e8" (binary_expression "((float)param_3 * (float)param_2) / (float)param_4" (parenthesized_expression "((float)param_3 * (float)param_2)" ( (binary_expression "(float)param_3 * (float)param_2" (cast_expression "(float)param_3" ( (type_descriptor "float" primitive_type) ) identifier) * (cast_expression "(float)param_2" ( (type_descriptor "float" primitive_type) ) identifier)) )) / (cast_expression "(float)param_4" ( (type_descriptor "float" primitive_type) ) identifier)) + identifier) )))) ;) (if_statement "if (((float)DAT_0003c518 < fVar1) || (fVar1 < DAT_0003c4f4)) {\n      return 0;\n    }" if (parenthesized_expression "(((float)DAT_0003c518 < fVar1) || (fVar1 < DAT_0003c4f4))" ( (binary_expression "((float)DAT_0003c518 < fVar1) || (fVar1 < DAT_0003c4f4)" (parenthesized_expression "((float)DAT_0003c518 < fVar1)" ( (binary_expression "(float)DAT_0003c518 < fVar1" (cast_expression "(float)DAT_0003c518" ( (type_descriptor "float" primitive_type) ) identifier) < identifier) )) || (parenthesized_expression "(fVar1 < DAT_0003c4f4)" ( (binary_expression "fVar1 < DAT_0003c4f4" identifier < identifier) ))) )) (compound_statement "{\n      return 0;\n    }" { (return_statement "return 0;" return number_literal ;) })) (expression_statement "*param_1 = (int)ROUND(fVar1);" (assignment_expression "*param_1 = (int)ROUND(fVar1)" (pointer_expression "*param_1" * identifier) = (cast_expression "(int)ROUND(fVar1)" ( (type_descriptor "int" primitive_type) ) (call_expression "ROUND(fVar1)" identifier (argument_list "(fVar1)" ( identifier ))))) ;) (expression_statement "param_4 = 1;" (assignment_expression "param_4 = 1" identifier = number_literal) ;) })) (return_statement "return param_4;" return identifier ;) })))
(translation_unit (function_definition TYPE (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE (pointer_declarator * IDENT)) , (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE IDENT) ))) (compound_statement { (declaration TYPE IDENT ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT != LIT) )) (compound_statement { (if_statement if (parenthesized_expression ( (binary_expression (parenthesized_expression ( (binary_expression IDENT == LIT) )) || (parenthesized_expression ( (binary_expression IDENT == LIT) ))) )) (compound_statement { (expression_statement (assignment_expression (pointer_expression * IDENT) = LIT) ;) (return_statement return LIT ;) })) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( (binary_expression (binary_expression (parenthesized_expression ( (binary_expression (cast_expression ( (type_descriptor TYPE) ) IDENT) * (cast_expression ( (type_descriptor TYPE) ) IDENT)) )) / (cast_expression ( (type_descriptor TYPE) ) IDENT)) + IDENT) )))) ;) (if_statement if (parenthesized_expression ( (binary_expression (parenthesized_expression ( (binary_expression (cast_expression ( (type_descriptor TYPE) ) IDENT) < IDENT) )) || (parenthesized_expression ( (binary_expression IDENT < IDENT) ))) )) (compound_statement { (return_statement return LIT ;) })) (expression_statement (assignment_expression (pointer_expression * IDENT) = (cast_expression ( (type_descriptor TYPE) ) (call_expression IDENT (argument_list ( IDENT ))))) ;) (expression_statement (assignment_expression IDENT = LIT) ;) })) (return_statement return IDENT ;) })))
(function_definition "int FUN_000176f0(int *param_1,int param_2,int param_3,int param_4)\n\n{\n  float fVar1;\n  \n  if (param_4 != 0) {\n    if ((param_2 == 0) || (param_3 == 0)) {\n      *param_1 = 0;\n      return 1;\n    }\n    fVar1 = ROUND(((float)param_3 * (float)param_2) / (float)param_4 + DAT_0003c4e8);\n    if (((float)DAT_0003c518 < fVar1) || (fVar1 < DAT_0003c4f4)) {\n      return 0;\n    }\n    *param_1 = (int)ROUND(fVar1);\n    param_4 = 1;\n  }\n  return param_4;\n}" (primitive_type "int") (function_declarator "FUN_000176f0(int *param_1,int param_2,int param_3,int param_4)" (identifier "FUN_000176f0") (parameter_list "(int *param_1,int param_2,int param_3,int param_4)" (( "(") (parameter_declaration "int *param_1" (primitive_type "int") (pointer_declarator "*param_1" (* "*") (identifier "param_1"))) (, ",") (parameter_declaration "int param_2" (primitive_type "int") (identifier "param_2")) (, ",") (parameter_declaration "int param_3" (primitive_type "int") (identifier "param_3")) (, ",") (parameter_declaration "int param_4" (primitive_type "int") (identifier "param_4")) () ")"))) (compound_statement "{\n  float fVar1;\n  \n  if (param_4 != 0) {\n    if ((param_2 == 0) || (param_3 == 0)) {\n      *param_1 = 0;\n      return 1;\n    }\n    fVar1 = ROUND(((float)param_3 * (float)param_2) / (float)param_4 + DAT_0003c4e8);\n    if (((float)DAT_0003c518 < fVar1) || (fVar1 < DAT_0003c4f4)) {\n      return 0;\n    }\n    *param_1 = (int)ROUND(fVar1);\n    param_4 = 1;\n  }\n  return param_4;\n}" ({ "{") (declaration "float fVar1;" (primitive_type "float") (identifier "fVar1") (; ";")) (if_statement "if (param_4 != 0) {\n    if ((param_2 == 0) || (param_3 == 0)) {\n      *param_1 = 0;\n      return 1;\n    }\n    fVar1 = ROUND(((float)param_3 * (float)param_2) / (float)param_4 + DAT_0003c4e8);\n    if (((float)DAT_0003c518 < fVar1) || (fVar1 < DAT_0003c4f4)) {\n      return 0;\n    }\n    *param_1 = (int)ROUND(fVar1);\n    param_4 = 1;\n  }" (if "if") (parenthesized_expression "(param_4 != 0)" (( "(") (binary_expression "param_4 != 0" (identifier "param_4") (!= "!=") (number_literal "0")) () ")")) (compound_statement "{\n    if ((param_2 == 0) || (param_3 == 0)) {\n      *param_1 = 0;\n      return 1;\n    }\n    fVar1 = ROUND(((float)param_3 * (float)param_2) / (float)param_4 + DAT_0003c4e8);\n    if (((float)DAT_0003c518 < fVar1) || (fVar1 < DAT_0003c4f4)) {\n      return 0;\n    }\n    *param_1 = (int)ROUND(fVar1);\n    param_4 = 1;\n  }" ({ "{") (if_statement "if ((param_2 == 0) || (param_3 == 0)) {\n      *param_1 = 0;\n      return 1;\n    }" (if "if") (parenthesized_expression "((param_2 == 0) || (param_3 == 0))" (( "(") (binary_expression "(param_2 == 0) || (param_3 == 0)" (parenthesized_expression "(param_2 == 0)" (( "(") (binary_expression "param_2 == 0" (identifier "param_2") (== "==") (number_literal "0")) () ")")) (|| "||") (parenthesized_expression "(param_3 == 0)" (( "(") (binary_expression "param_3 == 0" (identifier "param_3") (== "==") (number_literal "0")) () ")"))) () ")")) (compound_statement "{\n      *param_1 = 0;\n      return 1;\n    }" ({ "{") (expression_statement "*param_1 = 0;" (assignment_expression "*param_1 = 0" (pointer_expression "*param_1" (* "*") (identifier "param_1")) (= "=") (number_literal "0")) (; ";")) (return_statement "return 1;" (return "return") (number_literal "1") (; ";")) (} "}"))) (expression_statement "fVar1 = ROUND(((float)param_3 * (float)param_2) / (float)param_4 + DAT_0003c4e8);" (assignment_expression "fVar1 = ROUND(((float)param_3 * (float)param_2) / (float)param_4 + DAT_0003c4e8)" (identifier "fVar1") (= "=") (call_expression "ROUND(((float)param_3 * (float)param_2) / (float)param_4 + DAT_0003c4e8)" (identifier "ROUND") (argument_list "(((float)param_3 * (float)param_2) / (float)param_4 + DAT_0003c4e8)" (( "(") (binary_expression "((float)param_3 * (float)param_2) / (float)param_4 + DAT_0003c4e8" (binary_expression "((float)param_3 * (float)param_2) / (float)param_4" (parenthesized_expression "((float)param_3 * (float)param_2)" (( "(") (binary_expression "(float)param_3 * (float)param_2" (cast_expression "(float)param_3" (( "(") (type_descriptor "float" (primitive_type "float")) () ")") (identifier "param_3")) (* "*") (cast_expression "(float)param_2" (( "(") (type_descriptor "float" (primitive_type "float")) () ")") (identifier "param_2"))) () ")")) (/ "/") (cast_expression "(float)param_4" (( "(") (type_descriptor "float" (primitive_type "float")) () ")") (identifier "param_4"))) (+ "+") (identifier "DAT_0003c4e8")) () ")")))) (; ";")) (if_statement "if (((float)DAT_0003c518 < fVar1) || (fVar1 < DAT_0003c4f4)) {\n      return 0;\n    }" (if "if") (parenthesized_expression "(((float)DAT_0003c518 < fVar1) || (fVar1 < DAT_0003c4f4))" (( "(") (binary_expression "((float)DAT_0003c518 < fVar1) || (fVar1 < DAT_0003c4f4)" (parenthesized_expression "((float)DAT_0003c518 < fVar1)" (( "(") (binary_expression "(float)DAT_0003c518 < fVar1" (cast_expression "(float)DAT_0003c518" (( "(") (type_descriptor "float" (primitive_type "float")) () ")") (identifier "DAT_0003c518")) (< "<") (identifier "fVar1")) () ")")) (|| "||") (parenthesized_expression "(fVar1 < DAT_0003c4f4)" (( "(") (binary_expression "fVar1 < DAT_0003c4f4" (identifier "fVar1") (< "<") (identifier "DAT_0003c4f4")) () ")"))) () ")")) (compound_statement "{\n      return 0;\n    }" ({ "{") (return_statement "return 0;" (return "return") (number_literal "0") (; ";")) (} "}"))) (expression_statement "*param_1 = (int)ROUND(fVar1);" (assignment_expression "*param_1 = (int)ROUND(fVar1)" (pointer_expression "*param_1" (* "*") (identifier "param_1")) (= "=") (cast_expression "(int)ROUND(fVar1)" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (call_expression "ROUND(fVar1)" (identifier "ROUND") (argument_list "(fVar1)" (( "(") (identifier "fVar1") () ")"))))) (; ";")) (expression_statement "param_4 = 1;" (assignment_expression "param_4 = 1" (identifier "param_4") (= "=") (number_literal "1")) (; ";")) (} "}"))) (return_statement "return param_4;" (return "return") (identifier "param_4") (; ";")) (} "}")))

/* WARNING: Function: __x86.get_pc_thunk.dx replaced with injection: get_pc_thunk_dx */
/* WARNING: Unknown calling convention */

int function_1(type_1 res,type_2 var_2,type_3 var_3,type_3 var_1)

{
  float var_6;
  
  if (var_1 != 0) {
    if ((var_2 == 0) || (var_3 == 0)) {
      *res = 0;
      return 1;
    }
    var_6 = var_4(((float)var_3 * (float)var_2) / (float)var_1 + var_5);
    if (((float)DAT_0003c518 < var_6) || (var_6 < var_7)) {
      return 0;
    }
    *res = (int)var_4(var_6);
    var_1 = 1;
  }
  return var_1;
}


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

/* WARNING: Function: __i686.get_pc_thunk.dx replaced with injection: get_pc_thunk_dx */

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

{
  float fVar1;
  
  if (param_4 != 0) {
    if ((param_2 == 0) || (param_3 == 0)) {
      *param_1 = 0;
      return 1;
    }
    fVar1 = ROUND(((float)param_3 * (float)param_2) / (float)param_4 + DAT_0003c4e8);
    if (((float)DAT_0003c518 < fVar1) || (fVar1 < DAT_0003c4f4)) {
      return 0;
    }
    *param_1 = (int)ROUND(fVar1);
    param_4 = 1;
  }
  return param_4;
}

