
/* WARNING: Function: __x86.get_pc_thunk.cx replaced with injection: get_pc_thunk_cx */
/* WARNING: Unknown calling convention */

i64 doubleToInt64(double r)

{
  longlong lVar1;
  
  if (r <= (double)DAT_00131a80) {
    lVar1 = -0x8000000000000000;
  }
  else {
    lVar1 = 0x7fffffffffffffff;
    if (r < (double)DAT_00131a84) {
      lVar1 = (longlong)ROUND(r);
    }
  }
  return lVar1;
}



/* WARNING: Function: __i686.get_pc_thunk.cx replaced with injection: get_pc_thunk_cx */

longlong FUN_00038d60(double param_1)

{
  longlong lVar1;
  
  if (param_1 <= (double)DAT_00131a80) {
    lVar1 = -0x8000000000000000;
  }
  else {
    lVar1 = 0x7fffffffffffffff;
    if (param_1 < (double)DAT_00131a84) {
      lVar1 = (longlong)ROUND(param_1);
    }
  }
  return lVar1;
}


CALL 0x00036ac1
ADD ECX,0x1430c3
SUB ESP,0x14
FLD qword ptr [ESP + 0x18]
FLD dword ptr [ECX + 0xfffb5c58]
FCOMIP ST0,ST1
JNC 0x00038dd0
FLD dword ptr [ECX + 0xfffb5c5c]
FXCH
MOV EAX,0xffffffff
MOV EDX,0x7fffffff
FCOMI ST0,ST1
FSTP ST1
JNC 0x00038dc0
FNSTCW word ptr [ESP + 0xe]
MOVZX EAX,word ptr [ESP + 0xe]
OR AH,0xc
MOV word ptr [ESP + 0xc],AX
FLDCW word ptr [ESP + 0xc]
FISTP qword ptr [ESP]
FLDCW word ptr [ESP + 0xe]
MOV EAX,dword ptr [ESP]
MOV EDX,dword ptr [ESP + 0x4]
JMP 0x00038dc2
FSTP ST0
ADD ESP,0x14
RET
FSTP ST0
XOR EAX,EAX
MOV EDX,0x80000000
JMP 0x00038dc2
(translation_unit "/* WARNING: Function: __i686.get_pc_thunk.cx replaced with injection: get_pc_thunk_cx */\n\nlonglong FUN_00038d60(double param_1)\n\n{\n  longlong lVar1;\n  \n  if (param_1 <= (double)DAT_00131a80) {\n    lVar1 = -0x8000000000000000;\n  }\n  else {\n    lVar1 = 0x7fffffffffffffff;\n    if (param_1 < (double)DAT_00131a84) {\n      lVar1 = (longlong)ROUND(param_1);\n    }\n  }\n  return lVar1;\n}\n\n" comment (function_definition "longlong FUN_00038d60(double param_1)\n\n{\n  longlong lVar1;\n  \n  if (param_1 <= (double)DAT_00131a80) {\n    lVar1 = -0x8000000000000000;\n  }\n  else {\n    lVar1 = 0x7fffffffffffffff;\n    if (param_1 < (double)DAT_00131a84) {\n      lVar1 = (longlong)ROUND(param_1);\n    }\n  }\n  return lVar1;\n}" type_identifier (function_declarator "FUN_00038d60(double param_1)" identifier (parameter_list "(double param_1)" ( (parameter_declaration "double param_1" primitive_type identifier) ))) (compound_statement "{\n  longlong lVar1;\n  \n  if (param_1 <= (double)DAT_00131a80) {\n    lVar1 = -0x8000000000000000;\n  }\n  else {\n    lVar1 = 0x7fffffffffffffff;\n    if (param_1 < (double)DAT_00131a84) {\n      lVar1 = (longlong)ROUND(param_1);\n    }\n  }\n  return lVar1;\n}" { (declaration "longlong lVar1;" type_identifier identifier ;) (if_statement "if (param_1 <= (double)DAT_00131a80) {\n    lVar1 = -0x8000000000000000;\n  }\n  else {\n    lVar1 = 0x7fffffffffffffff;\n    if (param_1 < (double)DAT_00131a84) {\n      lVar1 = (longlong)ROUND(param_1);\n    }\n  }" if (parenthesized_expression "(param_1 <= (double)DAT_00131a80)" ( (binary_expression "param_1 <= (double)DAT_00131a80" identifier <= (cast_expression "(double)DAT_00131a80" ( (type_descriptor "double" primitive_type) ) identifier)) )) (compound_statement "{\n    lVar1 = -0x8000000000000000;\n  }" { (expression_statement "lVar1 = -0x8000000000000000;" (assignment_expression "lVar1 = -0x8000000000000000" identifier = number_literal) ;) }) (else_clause "else {\n    lVar1 = 0x7fffffffffffffff;\n    if (param_1 < (double)DAT_00131a84) {\n      lVar1 = (longlong)ROUND(param_1);\n    }\n  }" else (compound_statement "{\n    lVar1 = 0x7fffffffffffffff;\n    if (param_1 < (double)DAT_00131a84) {\n      lVar1 = (longlong)ROUND(param_1);\n    }\n  }" { (expression_statement "lVar1 = 0x7fffffffffffffff;" (assignment_expression "lVar1 = 0x7fffffffffffffff" identifier = number_literal) ;) (if_statement "if (param_1 < (double)DAT_00131a84) {\n      lVar1 = (longlong)ROUND(param_1);\n    }" if (parenthesized_expression "(param_1 < (double)DAT_00131a84)" ( (binary_expression "param_1 < (double)DAT_00131a84" identifier < (cast_expression "(double)DAT_00131a84" ( (type_descriptor "double" primitive_type) ) identifier)) )) (compound_statement "{\n      lVar1 = (longlong)ROUND(param_1);\n    }" { (expression_statement "lVar1 = (longlong)ROUND(param_1);" (assignment_expression "lVar1 = (longlong)ROUND(param_1)" identifier = (cast_expression "(longlong)ROUND(param_1)" ( (type_descriptor "longlong" type_identifier) ) (call_expression "ROUND(param_1)" identifier (argument_list "(param_1)" ( identifier ))))) ;) })) }))) (return_statement "return lVar1;" return identifier ;) })))
(translation_unit "/* WARNING: Function: __x86.get_pc_thunk.cx replaced with injection: get_pc_thunk_cx */\n/* WARNING: Unknown calling convention */\n\ni64 doubleToInt64(double r)\n\n{\n  longlong lVar1;\n  \n  if (r <= (double)DAT_00131a80) {\n    lVar1 = -0x8000000000000000;\n  }\n  else {\n    lVar1 = 0x7fffffffffffffff;\n    if (r < (double)DAT_00131a84) {\n      lVar1 = (longlong)ROUND(r);\n    }\n  }\n  return lVar1;\n}\n\n" comment comment (function_definition "i64 doubleToInt64(double r)\n\n{\n  longlong lVar1;\n  \n  if (r <= (double)DAT_00131a80) {\n    lVar1 = -0x8000000000000000;\n  }\n  else {\n    lVar1 = 0x7fffffffffffffff;\n    if (r < (double)DAT_00131a84) {\n      lVar1 = (longlong)ROUND(r);\n    }\n  }\n  return lVar1;\n}" type_identifier (function_declarator "doubleToInt64(double r)" identifier (parameter_list "(double r)" ( (parameter_declaration "double r" primitive_type identifier) ))) (compound_statement "{\n  longlong lVar1;\n  \n  if (r <= (double)DAT_00131a80) {\n    lVar1 = -0x8000000000000000;\n  }\n  else {\n    lVar1 = 0x7fffffffffffffff;\n    if (r < (double)DAT_00131a84) {\n      lVar1 = (longlong)ROUND(r);\n    }\n  }\n  return lVar1;\n}" { (declaration "longlong lVar1;" type_identifier identifier ;) (if_statement "if (r <= (double)DAT_00131a80) {\n    lVar1 = -0x8000000000000000;\n  }\n  else {\n    lVar1 = 0x7fffffffffffffff;\n    if (r < (double)DAT_00131a84) {\n      lVar1 = (longlong)ROUND(r);\n    }\n  }" if (parenthesized_expression "(r <= (double)DAT_00131a80)" ( (binary_expression "r <= (double)DAT_00131a80" identifier <= (cast_expression "(double)DAT_00131a80" ( (type_descriptor "double" primitive_type) ) identifier)) )) (compound_statement "{\n    lVar1 = -0x8000000000000000;\n  }" { (expression_statement "lVar1 = -0x8000000000000000;" (assignment_expression "lVar1 = -0x8000000000000000" identifier = number_literal) ;) }) (else_clause "else {\n    lVar1 = 0x7fffffffffffffff;\n    if (r < (double)DAT_00131a84) {\n      lVar1 = (longlong)ROUND(r);\n    }\n  }" else (compound_statement "{\n    lVar1 = 0x7fffffffffffffff;\n    if (r < (double)DAT_00131a84) {\n      lVar1 = (longlong)ROUND(r);\n    }\n  }" { (expression_statement "lVar1 = 0x7fffffffffffffff;" (assignment_expression "lVar1 = 0x7fffffffffffffff" identifier = number_literal) ;) (if_statement "if (r < (double)DAT_00131a84) {\n      lVar1 = (longlong)ROUND(r);\n    }" if (parenthesized_expression "(r < (double)DAT_00131a84)" ( (binary_expression "r < (double)DAT_00131a84" identifier < (cast_expression "(double)DAT_00131a84" ( (type_descriptor "double" primitive_type) ) identifier)) )) (compound_statement "{\n      lVar1 = (longlong)ROUND(r);\n    }" { (expression_statement "lVar1 = (longlong)ROUND(r);" (assignment_expression "lVar1 = (longlong)ROUND(r)" identifier = (cast_expression "(longlong)ROUND(r)" ( (type_descriptor "longlong" type_identifier) ) (call_expression "ROUND(r)" identifier (argument_list "(r)" ( identifier ))))) ;) })) }))) (return_statement "return lVar1;" return identifier ;) })))
(translation_unit "longlong FUN_00038d60(double param_1)\n\n{\n  longlong lVar1;\n  \n  if (param_1 <= (double)DAT_00131a80) {\n    lVar1 = -0x8000000000000000;\n  }\n  else {\n    lVar1 = 0x7fffffffffffffff;\n    if (param_1 < (double)DAT_00131a84) {\n      lVar1 = (longlong)ROUND(param_1);\n    }\n  }\n  return lVar1;\n}\n\n" (function_definition "longlong FUN_00038d60(double param_1)\n\n{\n  longlong lVar1;\n  \n  if (param_1 <= (double)DAT_00131a80) {\n    lVar1 = -0x8000000000000000;\n  }\n  else {\n    lVar1 = 0x7fffffffffffffff;\n    if (param_1 < (double)DAT_00131a84) {\n      lVar1 = (longlong)ROUND(param_1);\n    }\n  }\n  return lVar1;\n}" type_identifier (function_declarator "FUN_00038d60(double param_1)" identifier (parameter_list "(double param_1)" ( (parameter_declaration "double param_1" primitive_type identifier) ))) (compound_statement "{\n  longlong lVar1;\n  \n  if (param_1 <= (double)DAT_00131a80) {\n    lVar1 = -0x8000000000000000;\n  }\n  else {\n    lVar1 = 0x7fffffffffffffff;\n    if (param_1 < (double)DAT_00131a84) {\n      lVar1 = (longlong)ROUND(param_1);\n    }\n  }\n  return lVar1;\n}" { (declaration "longlong lVar1;" type_identifier identifier ;) (if_statement "if (param_1 <= (double)DAT_00131a80) {\n    lVar1 = -0x8000000000000000;\n  }\n  else {\n    lVar1 = 0x7fffffffffffffff;\n    if (param_1 < (double)DAT_00131a84) {\n      lVar1 = (longlong)ROUND(param_1);\n    }\n  }" if (parenthesized_expression "(param_1 <= (double)DAT_00131a80)" ( (binary_expression "param_1 <= (double)DAT_00131a80" identifier <= (cast_expression "(double)DAT_00131a80" ( (type_descriptor "double" primitive_type) ) identifier)) )) (compound_statement "{\n    lVar1 = -0x8000000000000000;\n  }" { (expression_statement "lVar1 = -0x8000000000000000;" (assignment_expression "lVar1 = -0x8000000000000000" identifier = number_literal) ;) }) (else_clause "else {\n    lVar1 = 0x7fffffffffffffff;\n    if (param_1 < (double)DAT_00131a84) {\n      lVar1 = (longlong)ROUND(param_1);\n    }\n  }" else (compound_statement "{\n    lVar1 = 0x7fffffffffffffff;\n    if (param_1 < (double)DAT_00131a84) {\n      lVar1 = (longlong)ROUND(param_1);\n    }\n  }" { (expression_statement "lVar1 = 0x7fffffffffffffff;" (assignment_expression "lVar1 = 0x7fffffffffffffff" identifier = number_literal) ;) (if_statement "if (param_1 < (double)DAT_00131a84) {\n      lVar1 = (longlong)ROUND(param_1);\n    }" if (parenthesized_expression "(param_1 < (double)DAT_00131a84)" ( (binary_expression "param_1 < (double)DAT_00131a84" identifier < (cast_expression "(double)DAT_00131a84" ( (type_descriptor "double" primitive_type) ) identifier)) )) (compound_statement "{\n      lVar1 = (longlong)ROUND(param_1);\n    }" { (expression_statement "lVar1 = (longlong)ROUND(param_1);" (assignment_expression "lVar1 = (longlong)ROUND(param_1)" identifier = (cast_expression "(longlong)ROUND(param_1)" ( (type_descriptor "longlong" type_identifier) ) (call_expression "ROUND(param_1)" identifier (argument_list "(param_1)" ( identifier ))))) ;) })) }))) (return_statement "return lVar1;" return identifier ;) })))
(translation_unit (function_definition TYPE (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE IDENT) ))) (compound_statement { (declaration TYPE IDENT ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT <= (cast_expression ( (type_descriptor TYPE) ) IDENT)) )) (compound_statement { (expression_statement (assignment_expression IDENT = LIT) ;) }) (else_clause else (compound_statement { (expression_statement (assignment_expression IDENT = LIT) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT < (cast_expression ( (type_descriptor TYPE) ) IDENT)) )) (compound_statement { (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE) ) (call_expression IDENT (argument_list ( IDENT ))))) ;) })) }))) (return_statement return IDENT ;) })))
(function_definition "longlong FUN_00038d60(double param_1)\n\n{\n  longlong lVar1;\n  \n  if (param_1 <= (double)DAT_00131a80) {\n    lVar1 = -0x8000000000000000;\n  }\n  else {\n    lVar1 = 0x7fffffffffffffff;\n    if (param_1 < (double)DAT_00131a84) {\n      lVar1 = (longlong)ROUND(param_1);\n    }\n  }\n  return lVar1;\n}" (type_identifier "longlong") (function_declarator "FUN_00038d60(double param_1)" (identifier "FUN_00038d60") (parameter_list "(double param_1)" (( "(") (parameter_declaration "double param_1" (primitive_type "double") (identifier "param_1")) () ")"))) (compound_statement "{\n  longlong lVar1;\n  \n  if (param_1 <= (double)DAT_00131a80) {\n    lVar1 = -0x8000000000000000;\n  }\n  else {\n    lVar1 = 0x7fffffffffffffff;\n    if (param_1 < (double)DAT_00131a84) {\n      lVar1 = (longlong)ROUND(param_1);\n    }\n  }\n  return lVar1;\n}" ({ "{") (declaration "longlong lVar1;" (type_identifier "longlong") (identifier "lVar1") (; ";")) (if_statement "if (param_1 <= (double)DAT_00131a80) {\n    lVar1 = -0x8000000000000000;\n  }\n  else {\n    lVar1 = 0x7fffffffffffffff;\n    if (param_1 < (double)DAT_00131a84) {\n      lVar1 = (longlong)ROUND(param_1);\n    }\n  }" (if "if") (parenthesized_expression "(param_1 <= (double)DAT_00131a80)" (( "(") (binary_expression "param_1 <= (double)DAT_00131a80" (identifier "param_1") (<= "<=") (cast_expression "(double)DAT_00131a80" (( "(") (type_descriptor "double" (primitive_type "double")) () ")") (identifier "DAT_00131a80"))) () ")")) (compound_statement "{\n    lVar1 = -0x8000000000000000;\n  }" ({ "{") (expression_statement "lVar1 = -0x8000000000000000;" (assignment_expression "lVar1 = -0x8000000000000000" (identifier "lVar1") (= "=") (number_literal "-0x8000000000000000")) (; ";")) (} "}")) (else_clause "else {\n    lVar1 = 0x7fffffffffffffff;\n    if (param_1 < (double)DAT_00131a84) {\n      lVar1 = (longlong)ROUND(param_1);\n    }\n  }" (else "else") (compound_statement "{\n    lVar1 = 0x7fffffffffffffff;\n    if (param_1 < (double)DAT_00131a84) {\n      lVar1 = (longlong)ROUND(param_1);\n    }\n  }" ({ "{") (expression_statement "lVar1 = 0x7fffffffffffffff;" (assignment_expression "lVar1 = 0x7fffffffffffffff" (identifier "lVar1") (= "=") (number_literal "0x7fffffffffffffff")) (; ";")) (if_statement "if (param_1 < (double)DAT_00131a84) {\n      lVar1 = (longlong)ROUND(param_1);\n    }" (if "if") (parenthesized_expression "(param_1 < (double)DAT_00131a84)" (( "(") (binary_expression "param_1 < (double)DAT_00131a84" (identifier "param_1") (< "<") (cast_expression "(double)DAT_00131a84" (( "(") (type_descriptor "double" (primitive_type "double")) () ")") (identifier "DAT_00131a84"))) () ")")) (compound_statement "{\n      lVar1 = (longlong)ROUND(param_1);\n    }" ({ "{") (expression_statement "lVar1 = (longlong)ROUND(param_1);" (assignment_expression "lVar1 = (longlong)ROUND(param_1)" (identifier "lVar1") (= "=") (cast_expression "(longlong)ROUND(param_1)" (( "(") (type_descriptor "longlong" (type_identifier "longlong")) () ")") (call_expression "ROUND(param_1)" (identifier "ROUND") (argument_list "(param_1)" (( "(") (identifier "param_1") () ")"))))) (; ";")) (} "}"))) (} "}")))) (return_statement "return lVar1;" (return "return") (identifier "lVar1") (; ";")) (} "}")))

/* WARNING: Function: __x86.get_pc_thunk.cx replaced with injection: get_pc_thunk_cx */
/* WARNING: Unknown calling convention */

type_1 function_1(double var_1)

{
  type_2 lVar1;
  
  if (var_1 <= (double)DAT_00131a80) {
    lVar1 = -0x8000000000000000;
  }
  else {
    lVar1 = 0x7fffffffffffffff;
    if (var_1 < (double)DAT_00131a84) {
      lVar1 = (type_2)var_2(var_1);
    }
  }
  return lVar1;
}


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

/* WARNING: Function: __i686.get_pc_thunk.cx replaced with injection: get_pc_thunk_cx */

longlong MASKED(double param_1)

{
  longlong lVar1;
  
  if (param_1 <= (double)DAT_00131a80) {
    lVar1 = -0x8000000000000000;
  }
  else {
    lVar1 = 0x7fffffffffffffff;
    if (param_1 < (double)DAT_00131a84) {
      lVar1 = (longlong)ROUND(param_1);
    }
  }
  return lVar1;
}

