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

void __regparm3
GetMontageGeometry(char *geometry,size_t number_images,ssize_t *x_offset,ssize_t *y_offset,
                  size_t *tiles_per_column,size_t *tiles_per_row)

{
  int iVar1;
  double __x;
  uint uVar2;
  int in_GS_OFFSET;
  ulonglong local_4c;
  uint local_44;
  ushort __cw;
  ushort __cwtmp;
  
  iVar1 = *(int *)(in_GS_OFFSET + 0x14);
  *tiles_per_column = 0;
  *tiles_per_row = 0;
  GetGeometry(geometry,x_offset,y_offset,tiles_per_row,tiles_per_column);
  if (*tiles_per_column == 0) {
    uVar2 = *tiles_per_row;
    if (uVar2 == 0) {
      __x = (double)number_images;
      if (__x < 0.0) {
        sqrt(__x);
      }
      local_44 = (uint)(longlong)ROUND(SQRT(__x));
      *tiles_per_column = local_44;
      if (local_44 != 0) {
        if (*tiles_per_row != 0) goto LAB_000fc178;
        goto LAB_000fc1ac;
      }
      uVar2 = *tiles_per_row;
      if (uVar2 == 0) goto LAB_000fc178;
    }
    local_4c = (ulonglong)uVar2;
    local_44 = (uint)(longlong)ROUND(ROUND((double)number_images / (double)local_4c));
    *tiles_per_column = local_44;
    if ((*tiles_per_row != 0) || (local_44 == 0)) goto LAB_000fc178;
  }
  else {
    if (*tiles_per_row != 0) goto LAB_000fc178;
    local_44 = *tiles_per_column;
  }
LAB_000fc1ac:
  local_44 = (uint)(longlong)ROUND(ROUND((double)number_images / (double)local_44));
  *tiles_per_row = local_44;
LAB_000fc178:
  if (iVar1 != *(int *)(in_GS_OFFSET + 0x14)) {
                    /* WARNING: Subroutine does not return */
    __stack_chk_fail_local();
  }
  return;
}



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

void __regparm3
FUN_000fc0a0(undefined4 param_1,uint param_2,undefined4 param_3,undefined4 param_4,uint *param_5,
            uint *param_6)

{
  int iVar1;
  double __x;
  uint uVar2;
  int in_GS_OFFSET;
  ulonglong local_4c;
  uint local_44;
  
  iVar1 = *(int *)(in_GS_OFFSET + 0x14);
  *param_5 = 0;
  *param_6 = 0;
  GetGeometry(param_1,param_3,param_4,param_6,param_5);
  if (*param_5 == 0) {
    uVar2 = *param_6;
    if (uVar2 == 0) {
      __x = (double)param_2;
      if (__x < 0.0) {
        sqrt(__x);
      }
      local_44 = (uint)(longlong)ROUND(SQRT(__x));
      *param_5 = local_44;
      if (local_44 != 0) {
        if (*param_6 != 0) goto LAB_000fc178;
        goto LAB_000fc1ac;
      }
      uVar2 = *param_6;
      if (uVar2 == 0) goto LAB_000fc178;
    }
    local_4c = (ulonglong)uVar2;
    local_44 = (uint)(longlong)ROUND(ROUND((double)param_2 / (double)local_4c));
    *param_5 = local_44;
    if ((*param_6 != 0) || (local_44 == 0)) goto LAB_000fc178;
  }
  else {
    if (*param_6 != 0) goto LAB_000fc178;
    local_44 = *param_5;
  }
LAB_000fc1ac:
  local_44 = (uint)(longlong)ROUND(ROUND((double)param_2 / (double)local_44));
  *param_6 = local_44;
LAB_000fc178:
  if (iVar1 != *(int *)(in_GS_OFFSET + 0x14)) {
                    /* WARNING: Subroutine does not return */
    FUN_0029eab0();
  }
  return;
}


PUSH EBP
MOV EBP,EDX
PUSH EDI
PUSH ESI
PUSH EBX
CALL 0x00038830
ADD EBX,0x2dcf55
SUB ESP,0x58
MOV EDX,dword ptr GS:[0x14]
MOV dword ptr [ESP + 0x48],EDX
XOR EDX,EDX
MOV EDI,dword ptr [ESP + 0x70]
MOV ESI,dword ptr [ESP + 0x74]
MOV dword ptr [EDI],0x0
MOV dword ptr [ESI],0x0
PUSH EDI
PUSH ESI
PUSH dword ptr [ESP + 0x74]
PUSH ECX
PUSH EAX
CALL 0x00030810
MOV ECX,dword ptr [EDI]
ADD ESP,0x20
TEST ECX,ECX
JNZ 0x000fc198
MOV EAX,dword ptr [ESI]
MOV dword ptr [ESP + 0x8],EBP
MOV dword ptr [ESP + 0xc],0x0
TEST EAX,EAX
JZ 0x000fc218
FILD qword ptr [ESP + 0x8]
MOV dword ptr [ESP + 0x10],EAX
MOV dword ptr [ESP + 0x14],0x0
FILD qword ptr [ESP + 0x10]
FDIVP
FNSTCW word ptr [ESP + 0x38]
MOVZX EAX,word ptr [ESP + 0x38]
AND EAX,0xf3ff
OR EAX,0x800
MOV word ptr [ESP + 0x3a],AX
FLDCW word ptr [ESP + 0x3a]
FRNDINT
FLDCW word ptr [ESP + 0x38]
FNSTCW word ptr [ESP + 0x26]
FSTP qword ptr [ESP + 0x28]
FLD qword ptr [ESP + 0x28]
MOVZX EAX,word ptr [ESP + 0x26]
OR AH,0xc
MOV word ptr [ESP + 0x24],AX
FLDCW word ptr [ESP + 0x24]
FISTP qword ptr [ESP + 0x18]
FLDCW word ptr [ESP + 0x26]
MOV EAX,dword ptr [ESP + 0x18]
MOV dword ptr [EDI],EAX
MOV EDX,dword ptr [ESI]
TEST EDX,EDX
JZ 0x000fc260
LEA ESI,[ESI]
MOV EAX,dword ptr [ESP + 0x3c]
XOR EAX,dword ptr GS:[0x14]
JNZ 0x000fc287
ADD ESP,0x4c
POP EBX
POP ESI
POP EDI
POP EBP
RET
MOV EAX,dword ptr [ESI]
TEST EAX,EAX
JNZ 0x000fc178
MOV EAX,dword ptr [EDI]
MOV dword ptr [ESP + 0x8],EBP
MOV dword ptr [ESP + 0xc],0x0
FILD qword ptr [ESP + 0x8]
MOV dword ptr [ESP + 0x8],EAX
MOV dword ptr [ESP + 0xc],0x0
FILD qword ptr [ESP + 0x8]
FDIVP
FNSTCW word ptr [ESP + 0x38]
MOVZX EAX,word ptr [ESP + 0x38]
AND EAX,0xf3ff
OR EAX,0x800
MOV word ptr [ESP + 0x3a],AX
FLDCW word ptr [ESP + 0x3a]
FRNDINT
FLDCW word ptr [ESP + 0x38]
FNSTCW word ptr [ESP + 0x26]
FSTP qword ptr [ESP + 0x28]
FLD qword ptr [ESP + 0x28]
MOVZX EAX,word ptr [ESP + 0x26]
OR AH,0xc
MOV word ptr [ESP + 0x24],AX
FLDCW word ptr [ESP + 0x24]
FISTP qword ptr [ESP + 0x18]
FLDCW word ptr [ESP + 0x26]
MOV EAX,dword ptr [ESP + 0x18]
MOV dword ptr [ESI],EAX
JMP 0x000fc178
FILD qword ptr [ESP + 0x8]
FLD ST0
FSQRT
FLDZ
FUCOMIP ST0,ST2
JA 0x000fc26d
FSTP ST1
FNSTCW word ptr [ESP + 0x26]
MOVZX EAX,word ptr [ESP + 0x26]
OR AH,0xc
MOV word ptr [ESP + 0x24],AX
FLDCW word ptr [ESP + 0x24]
FISTP qword ptr [ESP + 0x18]
FLDCW word ptr [ESP + 0x26]
MOV ECX,dword ptr [ESP + 0x18]
MOV EAX,ECX
MOV dword ptr [EDI],ECX
TEST ECX,ECX
JNZ 0x000fc28c
MOV EAX,dword ptr [ESI]
TEST EAX,EAX
JZ 0x000fc178
JMP 0x000fc105
TEST EAX,EAX
JNZ 0x000fc1ac
JMP 0x000fc178
FSTP qword ptr [ESP + 0x10]
SUB ESP,0x10
FSTP qword ptr [ESP]
CALL 0x000319a0
FSTP ST0
ADD ESP,0x10
FLD qword ptr [ESP + 0x10]
JMP 0x000fc228
CALL 0x0029eab0
CMP dword ptr [ESI],0x0
JNZ 0x000fc178
JMP 0x000fc1ac
(translation_unit "/* WARNING: Function: __i686.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n\nvoid __regparm3\nFUN_000fc0a0(undefined4 param_1,uint param_2,undefined4 param_3,undefined4 param_4,uint *param_5,\n            uint *param_6)\n\n{\n  int iVar1;\n  double __x;\n  uint uVar2;\n  int in_GS_OFFSET;\n  ulonglong local_4c;\n  uint local_44;\n  \n  iVar1 = *(int *)(in_GS_OFFSET + 0x14);\n  *param_5 = 0;\n  *param_6 = 0;\n  GetGeometry(param_1,param_3,param_4,param_6,param_5);\n  if (*param_5 == 0) {\n    uVar2 = *param_6;\n    if (uVar2 == 0) {\n      __x = (double)param_2;\n      if (__x < 0.0) {\n        sqrt(__x);\n      }\n      local_44 = (uint)(longlong)ROUND(SQRT(__x));\n      *param_5 = local_44;\n      if (local_44 != 0) {\n        if (*param_6 != 0) goto LAB_000fc178;\n        goto LAB_000fc1ac;\n      }\n      uVar2 = *param_6;\n      if (uVar2 == 0) goto LAB_000fc178;\n    }\n    local_4c = (ulonglong)uVar2;\n    local_44 = (uint)(longlong)ROUND(ROUND((double)param_2 / (double)local_4c));\n    *param_5 = local_44;\n    if ((*param_6 != 0) || (local_44 == 0)) goto LAB_000fc178;\n  }\n  else {\n    if (*param_6 != 0) goto LAB_000fc178;\n    local_44 = *param_5;\n  }\nLAB_000fc1ac:\n  local_44 = (uint)(longlong)ROUND(ROUND((double)param_2 / (double)local_44));\n  *param_6 = local_44;\nLAB_000fc178:\n  if (iVar1 != *(int *)(in_GS_OFFSET + 0x14)) {\n                    /* WARNING: Subroutine does not return */\n    FUN_0029eab0();\n  }\n  return;\n}\n\n" comment (function_definition "void __regparm3\nFUN_000fc0a0(undefined4 param_1,uint param_2,undefined4 param_3,undefined4 param_4,uint *param_5,\n            uint *param_6)\n\n{\n  int iVar1;\n  double __x;\n  uint uVar2;\n  int in_GS_OFFSET;\n  ulonglong local_4c;\n  uint local_44;\n  \n  iVar1 = *(int *)(in_GS_OFFSET + 0x14);\n  *param_5 = 0;\n  *param_6 = 0;\n  GetGeometry(param_1,param_3,param_4,param_6,param_5);\n  if (*param_5 == 0) {\n    uVar2 = *param_6;\n    if (uVar2 == 0) {\n      __x = (double)param_2;\n      if (__x < 0.0) {\n        sqrt(__x);\n      }\n      local_44 = (uint)(longlong)ROUND(SQRT(__x));\n      *param_5 = local_44;\n      if (local_44 != 0) {\n        if (*param_6 != 0) goto LAB_000fc178;\n        goto LAB_000fc1ac;\n      }\n      uVar2 = *param_6;\n      if (uVar2 == 0) goto LAB_000fc178;\n    }\n    local_4c = (ulonglong)uVar2;\n    local_44 = (uint)(longlong)ROUND(ROUND((double)param_2 / (double)local_4c));\n    *param_5 = local_44;\n    if ((*param_6 != 0) || (local_44 == 0)) goto LAB_000fc178;\n  }\n  else {\n    if (*param_6 != 0) goto LAB_000fc178;\n    local_44 = *param_5;\n  }\nLAB_000fc1ac:\n  local_44 = (uint)(longlong)ROUND(ROUND((double)param_2 / (double)local_44));\n  *param_6 = local_44;\nLAB_000fc178:\n  if (iVar1 != *(int *)(in_GS_OFFSET + 0x14)) {\n                    /* WARNING: Subroutine does not return */\n    FUN_0029eab0();\n  }\n  return;\n}" primitive_type (ERROR "__regparm3" identifier) (function_declarator "FUN_000fc0a0(undefined4 param_1,uint param_2,undefined4 param_3,undefined4 param_4,uint *param_5,\n            uint *param_6)" identifier (parameter_list "(undefined4 param_1,uint param_2,undefined4 param_3,undefined4 param_4,uint *param_5,\n            uint *param_6)" ( (parameter_declaration "undefined4 param_1" type_identifier identifier) , (parameter_declaration "uint param_2" type_identifier identifier) , (parameter_declaration "undefined4 param_3" type_identifier identifier) , (parameter_declaration "undefined4 param_4" type_identifier identifier) , (parameter_declaration "uint *param_5" type_identifier (pointer_declarator "*param_5" * identifier)) , (parameter_declaration "uint *param_6" type_identifier (pointer_declarator "*param_6" * identifier)) ))) (compound_statement "{\n  int iVar1;\n  double __x;\n  uint uVar2;\n  int in_GS_OFFSET;\n  ulonglong local_4c;\n  uint local_44;\n  \n  iVar1 = *(int *)(in_GS_OFFSET + 0x14);\n  *param_5 = 0;\n  *param_6 = 0;\n  GetGeometry(param_1,param_3,param_4,param_6,param_5);\n  if (*param_5 == 0) {\n    uVar2 = *param_6;\n    if (uVar2 == 0) {\n      __x = (double)param_2;\n      if (__x < 0.0) {\n        sqrt(__x);\n      }\n      local_44 = (uint)(longlong)ROUND(SQRT(__x));\n      *param_5 = local_44;\n      if (local_44 != 0) {\n        if (*param_6 != 0) goto LAB_000fc178;\n        goto LAB_000fc1ac;\n      }\n      uVar2 = *param_6;\n      if (uVar2 == 0) goto LAB_000fc178;\n    }\n    local_4c = (ulonglong)uVar2;\n    local_44 = (uint)(longlong)ROUND(ROUND((double)param_2 / (double)local_4c));\n    *param_5 = local_44;\n    if ((*param_6 != 0) || (local_44 == 0)) goto LAB_000fc178;\n  }\n  else {\n    if (*param_6 != 0) goto LAB_000fc178;\n    local_44 = *param_5;\n  }\nLAB_000fc1ac:\n  local_44 = (uint)(longlong)ROUND(ROUND((double)param_2 / (double)local_44));\n  *param_6 = local_44;\nLAB_000fc178:\n  if (iVar1 != *(int *)(in_GS_OFFSET + 0x14)) {\n                    /* WARNING: Subroutine does not return */\n    FUN_0029eab0();\n  }\n  return;\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "double __x;" primitive_type identifier ;) (declaration "uint uVar2;" type_identifier identifier ;) (declaration "int in_GS_OFFSET;" primitive_type identifier ;) (declaration "ulonglong local_4c;" type_identifier identifier ;) (declaration "uint local_44;" type_identifier identifier ;) (expression_statement "iVar1 = *(int *)(in_GS_OFFSET + 0x14);" (assignment_expression "iVar1 = *(int *)(in_GS_OFFSET + 0x14)" identifier = (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" * (cast_expression "(int *)(in_GS_OFFSET + 0x14)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_GS_OFFSET + 0x14)" ( (binary_expression "in_GS_OFFSET + 0x14" identifier + number_literal) ))))) ;) (expression_statement "*param_5 = 0;" (assignment_expression "*param_5 = 0" (pointer_expression "*param_5" * identifier) = number_literal) ;) (expression_statement "*param_6 = 0;" (assignment_expression "*param_6 = 0" (pointer_expression "*param_6" * identifier) = number_literal) ;) (expression_statement "GetGeometry(param_1,param_3,param_4,param_6,param_5);" (call_expression "GetGeometry(param_1,param_3,param_4,param_6,param_5)" identifier (argument_list "(param_1,param_3,param_4,param_6,param_5)" ( identifier , identifier , identifier , identifier , identifier ))) ;) (if_statement "if (*param_5 == 0) {\n    uVar2 = *param_6;\n    if (uVar2 == 0) {\n      __x = (double)param_2;\n      if (__x < 0.0) {\n        sqrt(__x);\n      }\n      local_44 = (uint)(longlong)ROUND(SQRT(__x));\n      *param_5 = local_44;\n      if (local_44 != 0) {\n        if (*param_6 != 0) goto LAB_000fc178;\n        goto LAB_000fc1ac;\n      }\n      uVar2 = *param_6;\n      if (uVar2 == 0) goto LAB_000fc178;\n    }\n    local_4c = (ulonglong)uVar2;\n    local_44 = (uint)(longlong)ROUND(ROUND((double)param_2 / (double)local_4c));\n    *param_5 = local_44;\n    if ((*param_6 != 0) || (local_44 == 0)) goto LAB_000fc178;\n  }\n  else {\n    if (*param_6 != 0) goto LAB_000fc178;\n    local_44 = *param_5;\n  }" if (parenthesized_expression "(*param_5 == 0)" ( (binary_expression "*param_5 == 0" (pointer_expression "*param_5" * identifier) == number_literal) )) (compound_statement "{\n    uVar2 = *param_6;\n    if (uVar2 == 0) {\n      __x = (double)param_2;\n      if (__x < 0.0) {\n        sqrt(__x);\n      }\n      local_44 = (uint)(longlong)ROUND(SQRT(__x));\n      *param_5 = local_44;\n      if (local_44 != 0) {\n        if (*param_6 != 0) goto LAB_000fc178;\n        goto LAB_000fc1ac;\n      }\n      uVar2 = *param_6;\n      if (uVar2 == 0) goto LAB_000fc178;\n    }\n    local_4c = (ulonglong)uVar2;\n    local_44 = (uint)(longlong)ROUND(ROUND((double)param_2 / (double)local_4c));\n    *param_5 = local_44;\n    if ((*param_6 != 0) || (local_44 == 0)) goto LAB_000fc178;\n  }" { (expression_statement "uVar2 = *param_6;" (assignment_expression "uVar2 = *param_6" identifier = (pointer_expression "*param_6" * identifier)) ;) (if_statement "if (uVar2 == 0) {\n      __x = (double)param_2;\n      if (__x < 0.0) {\n        sqrt(__x);\n      }\n      local_44 = (uint)(longlong)ROUND(SQRT(__x));\n      *param_5 = local_44;\n      if (local_44 != 0) {\n        if (*param_6 != 0) goto LAB_000fc178;\n        goto LAB_000fc1ac;\n      }\n      uVar2 = *param_6;\n      if (uVar2 == 0) goto LAB_000fc178;\n    }" if (parenthesized_expression "(uVar2 == 0)" ( (binary_expression "uVar2 == 0" identifier == number_literal) )) (compound_statement "{\n      __x = (double)param_2;\n      if (__x < 0.0) {\n        sqrt(__x);\n      }\n      local_44 = (uint)(longlong)ROUND(SQRT(__x));\n      *param_5 = local_44;\n      if (local_44 != 0) {\n        if (*param_6 != 0) goto LAB_000fc178;\n        goto LAB_000fc1ac;\n      }\n      uVar2 = *param_6;\n      if (uVar2 == 0) goto LAB_000fc178;\n    }" { (expression_statement "__x = (double)param_2;" (assignment_expression "__x = (double)param_2" identifier = (cast_expression "(double)param_2" ( (type_descriptor "double" primitive_type) ) identifier)) ;) (if_statement "if (__x < 0.0) {\n        sqrt(__x);\n      }" if (parenthesized_expression "(__x < 0.0)" ( (binary_expression "__x < 0.0" identifier < number_literal) )) (compound_statement "{\n        sqrt(__x);\n      }" { (expression_statement "sqrt(__x);" (call_expression "sqrt(__x)" identifier (argument_list "(__x)" ( identifier ))) ;) })) (expression_statement "local_44 = (uint)(longlong)ROUND(SQRT(__x));" (assignment_expression "local_44 = (uint)(longlong)ROUND(SQRT(__x))" identifier = (cast_expression "(uint)(longlong)ROUND(SQRT(__x))" ( (type_descriptor "uint" type_identifier) ) (cast_expression "(longlong)ROUND(SQRT(__x))" ( (type_descriptor "longlong" type_identifier) ) (call_expression "ROUND(SQRT(__x))" identifier (argument_list "(SQRT(__x))" ( (call_expression "SQRT(__x)" identifier (argument_list "(__x)" ( identifier ))) )))))) ;) (expression_statement "*param_5 = local_44;" (assignment_expression "*param_5 = local_44" (pointer_expression "*param_5" * identifier) = identifier) ;) (if_statement "if (local_44 != 0) {\n        if (*param_6 != 0) goto LAB_000fc178;\n        goto LAB_000fc1ac;\n      }" if (parenthesized_expression "(local_44 != 0)" ( (binary_expression "local_44 != 0" identifier != number_literal) )) (compound_statement "{\n        if (*param_6 != 0) goto LAB_000fc178;\n        goto LAB_000fc1ac;\n      }" { (if_statement "if (*param_6 != 0) goto LAB_000fc178;" if (parenthesized_expression "(*param_6 != 0)" ( (binary_expression "*param_6 != 0" (pointer_expression "*param_6" * identifier) != number_literal) )) (goto_statement "goto LAB_000fc178;" goto statement_identifier ;)) (goto_statement "goto LAB_000fc1ac;" goto statement_identifier ;) })) (expression_statement "uVar2 = *param_6;" (assignment_expression "uVar2 = *param_6" identifier = (pointer_expression "*param_6" * identifier)) ;) (if_statement "if (uVar2 == 0) goto LAB_000fc178;" if (parenthesized_expression "(uVar2 == 0)" ( (binary_expression "uVar2 == 0" identifier == number_literal) )) (goto_statement "goto LAB_000fc178;" goto statement_identifier ;)) })) (expression_statement "local_4c = (ulonglong)uVar2;" (assignment_expression "local_4c = (ulonglong)uVar2" identifier = (cast_expression "(ulonglong)uVar2" ( (type_descriptor "ulonglong" type_identifier) ) identifier)) ;) (expression_statement "local_44 = (uint)(longlong)ROUND(ROUND((double)param_2 / (double)local_4c));" (assignment_expression "local_44 = (uint)(longlong)ROUND(ROUND((double)param_2 / (double)local_4c))" identifier = (cast_expression "(uint)(longlong)ROUND(ROUND((double)param_2 / (double)local_4c))" ( (type_descriptor "uint" type_identifier) ) (cast_expression "(longlong)ROUND(ROUND((double)param_2 / (double)local_4c))" ( (type_descriptor "longlong" type_identifier) ) (call_expression "ROUND(ROUND((double)param_2 / (double)local_4c))" identifier (argument_list "(ROUND((double)param_2 / (double)local_4c))" ( (call_expression "ROUND((double)param_2 / (double)local_4c)" identifier (argument_list "((double)param_2 / (double)local_4c)" ( (binary_expression "(double)param_2 / (double)local_4c" (cast_expression "(double)param_2" ( (type_descriptor "double" primitive_type) ) identifier) / (cast_expression "(double)local_4c" ( (type_descriptor "double" primitive_type) ) identifier)) ))) )))))) ;) (expression_statement "*param_5 = local_44;" (assignment_expression "*param_5 = local_44" (pointer_expression "*param_5" * identifier) = identifier) ;) (if_statement "if ((*param_6 != 0) || (local_44 == 0)) goto LAB_000fc178;" if (parenthesized_expression "((*param_6 != 0) || (local_44 == 0))" ( (binary_expression "(*param_6 != 0) || (local_44 == 0)" (parenthesized_expression "(*param_6 != 0)" ( (binary_expression "*param_6 != 0" (pointer_expression "*param_6" * identifier) != number_literal) )) || (parenthesized_expression "(local_44 == 0)" ( (binary_expression "local_44 == 0" identifier == number_literal) ))) )) (goto_statement "goto LAB_000fc178;" goto statement_identifier ;)) }) (else_clause "else {\n    if (*param_6 != 0) goto LAB_000fc178;\n    local_44 = *param_5;\n  }" else (compound_statement "{\n    if (*param_6 != 0) goto LAB_000fc178;\n    local_44 = *param_5;\n  }" { (if_statement "if (*param_6 != 0) goto LAB_000fc178;" if (parenthesized_expression "(*param_6 != 0)" ( (binary_expression "*param_6 != 0" (pointer_expression "*param_6" * identifier) != number_literal) )) (goto_statement "goto LAB_000fc178;" goto statement_identifier ;)) (expression_statement "local_44 = *param_5;" (assignment_expression "local_44 = *param_5" identifier = (pointer_expression "*param_5" * identifier)) ;) }))) (labeled_statement "LAB_000fc1ac:\n  local_44 = (uint)(longlong)ROUND(ROUND((double)param_2 / (double)local_44));" statement_identifier : (expression_statement "local_44 = (uint)(longlong)ROUND(ROUND((double)param_2 / (double)local_44));" (assignment_expression "local_44 = (uint)(longlong)ROUND(ROUND((double)param_2 / (double)local_44))" identifier = (cast_expression "(uint)(longlong)ROUND(ROUND((double)param_2 / (double)local_44))" ( (type_descriptor "uint" type_identifier) ) (cast_expression "(longlong)ROUND(ROUND((double)param_2 / (double)local_44))" ( (type_descriptor "longlong" type_identifier) ) (call_expression "ROUND(ROUND((double)param_2 / (double)local_44))" identifier (argument_list "(ROUND((double)param_2 / (double)local_44))" ( (call_expression "ROUND((double)param_2 / (double)local_44)" identifier (argument_list "((double)param_2 / (double)local_44)" ( (binary_expression "(double)param_2 / (double)local_44" (cast_expression "(double)param_2" ( (type_descriptor "double" primitive_type) ) identifier) / (cast_expression "(double)local_44" ( (type_descriptor "double" primitive_type) ) identifier)) ))) )))))) ;)) (expression_statement "*param_6 = local_44;" (assignment_expression "*param_6 = local_44" (pointer_expression "*param_6" * identifier) = identifier) ;) (labeled_statement "LAB_000fc178:\n  if (iVar1 != *(int *)(in_GS_OFFSET + 0x14)) {\n                    /* WARNING: Subroutine does not return */\n    FUN_0029eab0();\n  }" statement_identifier : (if_statement "if (iVar1 != *(int *)(in_GS_OFFSET + 0x14)) {\n                    /* WARNING: Subroutine does not return */\n    FUN_0029eab0();\n  }" if (parenthesized_expression "(iVar1 != *(int *)(in_GS_OFFSET + 0x14))" ( (binary_expression "iVar1 != *(int *)(in_GS_OFFSET + 0x14)" identifier != (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" * (cast_expression "(int *)(in_GS_OFFSET + 0x14)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_GS_OFFSET + 0x14)" ( (binary_expression "in_GS_OFFSET + 0x14" identifier + number_literal) ))))) )) (compound_statement "{\n                    /* WARNING: Subroutine does not return */\n    FUN_0029eab0();\n  }" { comment (expression_statement "FUN_0029eab0();" (call_expression "FUN_0029eab0()" identifier (argument_list "()" ( ))) ;) }))) (return_statement "return;" return ;) })))
(translation_unit "/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n\nvoid __regparm3\nGetMontageGeometry(char *geometry,size_t number_images,ssize_t *x_offset,ssize_t *y_offset,\n                  size_t *tiles_per_column,size_t *tiles_per_row)\n\n{\n  int iVar1;\n  double __x;\n  uint uVar2;\n  int in_GS_OFFSET;\n  ulonglong local_4c;\n  uint local_44;\n  ushort __cw;\n  ushort __cwtmp;\n  \n  iVar1 = *(int *)(in_GS_OFFSET + 0x14);\n  *tiles_per_column = 0;\n  *tiles_per_row = 0;\n  GetGeometry(geometry,x_offset,y_offset,tiles_per_row,tiles_per_column);\n  if (*tiles_per_column == 0) {\n    uVar2 = *tiles_per_row;\n    if (uVar2 == 0) {\n      __x = (double)number_images;\n      if (__x < 0.0) {\n        sqrt(__x);\n      }\n      local_44 = (uint)(longlong)ROUND(SQRT(__x));\n      *tiles_per_column = local_44;\n      if (local_44 != 0) {\n        if (*tiles_per_row != 0) goto LAB_000fc178;\n        goto LAB_000fc1ac;\n      }\n      uVar2 = *tiles_per_row;\n      if (uVar2 == 0) goto LAB_000fc178;\n    }\n    local_4c = (ulonglong)uVar2;\n    local_44 = (uint)(longlong)ROUND(ROUND((double)number_images / (double)local_4c));\n    *tiles_per_column = local_44;\n    if ((*tiles_per_row != 0) || (local_44 == 0)) goto LAB_000fc178;\n  }\n  else {\n    if (*tiles_per_row != 0) goto LAB_000fc178;\n    local_44 = *tiles_per_column;\n  }\nLAB_000fc1ac:\n  local_44 = (uint)(longlong)ROUND(ROUND((double)number_images / (double)local_44));\n  *tiles_per_row = local_44;\nLAB_000fc178:\n  if (iVar1 != *(int *)(in_GS_OFFSET + 0x14)) {\n                    /* WARNING: Subroutine does not return */\n    __stack_chk_fail_local();\n  }\n  return;\n}\n\n" comment (function_definition "void __regparm3\nGetMontageGeometry(char *geometry,size_t number_images,ssize_t *x_offset,ssize_t *y_offset,\n                  size_t *tiles_per_column,size_t *tiles_per_row)\n\n{\n  int iVar1;\n  double __x;\n  uint uVar2;\n  int in_GS_OFFSET;\n  ulonglong local_4c;\n  uint local_44;\n  ushort __cw;\n  ushort __cwtmp;\n  \n  iVar1 = *(int *)(in_GS_OFFSET + 0x14);\n  *tiles_per_column = 0;\n  *tiles_per_row = 0;\n  GetGeometry(geometry,x_offset,y_offset,tiles_per_row,tiles_per_column);\n  if (*tiles_per_column == 0) {\n    uVar2 = *tiles_per_row;\n    if (uVar2 == 0) {\n      __x = (double)number_images;\n      if (__x < 0.0) {\n        sqrt(__x);\n      }\n      local_44 = (uint)(longlong)ROUND(SQRT(__x));\n      *tiles_per_column = local_44;\n      if (local_44 != 0) {\n        if (*tiles_per_row != 0) goto LAB_000fc178;\n        goto LAB_000fc1ac;\n      }\n      uVar2 = *tiles_per_row;\n      if (uVar2 == 0) goto LAB_000fc178;\n    }\n    local_4c = (ulonglong)uVar2;\n    local_44 = (uint)(longlong)ROUND(ROUND((double)number_images / (double)local_4c));\n    *tiles_per_column = local_44;\n    if ((*tiles_per_row != 0) || (local_44 == 0)) goto LAB_000fc178;\n  }\n  else {\n    if (*tiles_per_row != 0) goto LAB_000fc178;\n    local_44 = *tiles_per_column;\n  }\nLAB_000fc1ac:\n  local_44 = (uint)(longlong)ROUND(ROUND((double)number_images / (double)local_44));\n  *tiles_per_row = local_44;\nLAB_000fc178:\n  if (iVar1 != *(int *)(in_GS_OFFSET + 0x14)) {\n                    /* WARNING: Subroutine does not return */\n    __stack_chk_fail_local();\n  }\n  return;\n}" primitive_type (ERROR "__regparm3" identifier) (function_declarator "GetMontageGeometry(char *geometry,size_t number_images,ssize_t *x_offset,ssize_t *y_offset,\n                  size_t *tiles_per_column,size_t *tiles_per_row)" identifier (parameter_list "(char *geometry,size_t number_images,ssize_t *x_offset,ssize_t *y_offset,\n                  size_t *tiles_per_column,size_t *tiles_per_row)" ( (parameter_declaration "char *geometry" primitive_type (pointer_declarator "*geometry" * identifier)) , (parameter_declaration "size_t number_images" primitive_type identifier) , (parameter_declaration "ssize_t *x_offset" primitive_type (pointer_declarator "*x_offset" * identifier)) , (parameter_declaration "ssize_t *y_offset" primitive_type (pointer_declarator "*y_offset" * identifier)) , (parameter_declaration "size_t *tiles_per_column" primitive_type (pointer_declarator "*tiles_per_column" * identifier)) , (parameter_declaration "size_t *tiles_per_row" primitive_type (pointer_declarator "*tiles_per_row" * identifier)) ))) (compound_statement "{\n  int iVar1;\n  double __x;\n  uint uVar2;\n  int in_GS_OFFSET;\n  ulonglong local_4c;\n  uint local_44;\n  ushort __cw;\n  ushort __cwtmp;\n  \n  iVar1 = *(int *)(in_GS_OFFSET + 0x14);\n  *tiles_per_column = 0;\n  *tiles_per_row = 0;\n  GetGeometry(geometry,x_offset,y_offset,tiles_per_row,tiles_per_column);\n  if (*tiles_per_column == 0) {\n    uVar2 = *tiles_per_row;\n    if (uVar2 == 0) {\n      __x = (double)number_images;\n      if (__x < 0.0) {\n        sqrt(__x);\n      }\n      local_44 = (uint)(longlong)ROUND(SQRT(__x));\n      *tiles_per_column = local_44;\n      if (local_44 != 0) {\n        if (*tiles_per_row != 0) goto LAB_000fc178;\n        goto LAB_000fc1ac;\n      }\n      uVar2 = *tiles_per_row;\n      if (uVar2 == 0) goto LAB_000fc178;\n    }\n    local_4c = (ulonglong)uVar2;\n    local_44 = (uint)(longlong)ROUND(ROUND((double)number_images / (double)local_4c));\n    *tiles_per_column = local_44;\n    if ((*tiles_per_row != 0) || (local_44 == 0)) goto LAB_000fc178;\n  }\n  else {\n    if (*tiles_per_row != 0) goto LAB_000fc178;\n    local_44 = *tiles_per_column;\n  }\nLAB_000fc1ac:\n  local_44 = (uint)(longlong)ROUND(ROUND((double)number_images / (double)local_44));\n  *tiles_per_row = local_44;\nLAB_000fc178:\n  if (iVar1 != *(int *)(in_GS_OFFSET + 0x14)) {\n                    /* WARNING: Subroutine does not return */\n    __stack_chk_fail_local();\n  }\n  return;\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "double __x;" primitive_type identifier ;) (declaration "uint uVar2;" type_identifier identifier ;) (declaration "int in_GS_OFFSET;" primitive_type identifier ;) (declaration "ulonglong local_4c;" type_identifier identifier ;) (declaration "uint local_44;" type_identifier identifier ;) (declaration "ushort __cw;" type_identifier identifier ;) (declaration "ushort __cwtmp;" type_identifier identifier ;) (expression_statement "iVar1 = *(int *)(in_GS_OFFSET + 0x14);" (assignment_expression "iVar1 = *(int *)(in_GS_OFFSET + 0x14)" identifier = (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" * (cast_expression "(int *)(in_GS_OFFSET + 0x14)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_GS_OFFSET + 0x14)" ( (binary_expression "in_GS_OFFSET + 0x14" identifier + number_literal) ))))) ;) (expression_statement "*tiles_per_column = 0;" (assignment_expression "*tiles_per_column = 0" (pointer_expression "*tiles_per_column" * identifier) = number_literal) ;) (expression_statement "*tiles_per_row = 0;" (assignment_expression "*tiles_per_row = 0" (pointer_expression "*tiles_per_row" * identifier) = number_literal) ;) (expression_statement "GetGeometry(geometry,x_offset,y_offset,tiles_per_row,tiles_per_column);" (call_expression "GetGeometry(geometry,x_offset,y_offset,tiles_per_row,tiles_per_column)" identifier (argument_list "(geometry,x_offset,y_offset,tiles_per_row,tiles_per_column)" ( identifier , identifier , identifier , identifier , identifier ))) ;) (if_statement "if (*tiles_per_column == 0) {\n    uVar2 = *tiles_per_row;\n    if (uVar2 == 0) {\n      __x = (double)number_images;\n      if (__x < 0.0) {\n        sqrt(__x);\n      }\n      local_44 = (uint)(longlong)ROUND(SQRT(__x));\n      *tiles_per_column = local_44;\n      if (local_44 != 0) {\n        if (*tiles_per_row != 0) goto LAB_000fc178;\n        goto LAB_000fc1ac;\n      }\n      uVar2 = *tiles_per_row;\n      if (uVar2 == 0) goto LAB_000fc178;\n    }\n    local_4c = (ulonglong)uVar2;\n    local_44 = (uint)(longlong)ROUND(ROUND((double)number_images / (double)local_4c));\n    *tiles_per_column = local_44;\n    if ((*tiles_per_row != 0) || (local_44 == 0)) goto LAB_000fc178;\n  }\n  else {\n    if (*tiles_per_row != 0) goto LAB_000fc178;\n    local_44 = *tiles_per_column;\n  }" if (parenthesized_expression "(*tiles_per_column == 0)" ( (binary_expression "*tiles_per_column == 0" (pointer_expression "*tiles_per_column" * identifier) == number_literal) )) (compound_statement "{\n    uVar2 = *tiles_per_row;\n    if (uVar2 == 0) {\n      __x = (double)number_images;\n      if (__x < 0.0) {\n        sqrt(__x);\n      }\n      local_44 = (uint)(longlong)ROUND(SQRT(__x));\n      *tiles_per_column = local_44;\n      if (local_44 != 0) {\n        if (*tiles_per_row != 0) goto LAB_000fc178;\n        goto LAB_000fc1ac;\n      }\n      uVar2 = *tiles_per_row;\n      if (uVar2 == 0) goto LAB_000fc178;\n    }\n    local_4c = (ulonglong)uVar2;\n    local_44 = (uint)(longlong)ROUND(ROUND((double)number_images / (double)local_4c));\n    *tiles_per_column = local_44;\n    if ((*tiles_per_row != 0) || (local_44 == 0)) goto LAB_000fc178;\n  }" { (expression_statement "uVar2 = *tiles_per_row;" (assignment_expression "uVar2 = *tiles_per_row" identifier = (pointer_expression "*tiles_per_row" * identifier)) ;) (if_statement "if (uVar2 == 0) {\n      __x = (double)number_images;\n      if (__x < 0.0) {\n        sqrt(__x);\n      }\n      local_44 = (uint)(longlong)ROUND(SQRT(__x));\n      *tiles_per_column = local_44;\n      if (local_44 != 0) {\n        if (*tiles_per_row != 0) goto LAB_000fc178;\n        goto LAB_000fc1ac;\n      }\n      uVar2 = *tiles_per_row;\n      if (uVar2 == 0) goto LAB_000fc178;\n    }" if (parenthesized_expression "(uVar2 == 0)" ( (binary_expression "uVar2 == 0" identifier == number_literal) )) (compound_statement "{\n      __x = (double)number_images;\n      if (__x < 0.0) {\n        sqrt(__x);\n      }\n      local_44 = (uint)(longlong)ROUND(SQRT(__x));\n      *tiles_per_column = local_44;\n      if (local_44 != 0) {\n        if (*tiles_per_row != 0) goto LAB_000fc178;\n        goto LAB_000fc1ac;\n      }\n      uVar2 = *tiles_per_row;\n      if (uVar2 == 0) goto LAB_000fc178;\n    }" { (expression_statement "__x = (double)number_images;" (assignment_expression "__x = (double)number_images" identifier = (cast_expression "(double)number_images" ( (type_descriptor "double" primitive_type) ) identifier)) ;) (if_statement "if (__x < 0.0) {\n        sqrt(__x);\n      }" if (parenthesized_expression "(__x < 0.0)" ( (binary_expression "__x < 0.0" identifier < number_literal) )) (compound_statement "{\n        sqrt(__x);\n      }" { (expression_statement "sqrt(__x);" (call_expression "sqrt(__x)" identifier (argument_list "(__x)" ( identifier ))) ;) })) (expression_statement "local_44 = (uint)(longlong)ROUND(SQRT(__x));" (assignment_expression "local_44 = (uint)(longlong)ROUND(SQRT(__x))" identifier = (cast_expression "(uint)(longlong)ROUND(SQRT(__x))" ( (type_descriptor "uint" type_identifier) ) (cast_expression "(longlong)ROUND(SQRT(__x))" ( (type_descriptor "longlong" type_identifier) ) (call_expression "ROUND(SQRT(__x))" identifier (argument_list "(SQRT(__x))" ( (call_expression "SQRT(__x)" identifier (argument_list "(__x)" ( identifier ))) )))))) ;) (expression_statement "*tiles_per_column = local_44;" (assignment_expression "*tiles_per_column = local_44" (pointer_expression "*tiles_per_column" * identifier) = identifier) ;) (if_statement "if (local_44 != 0) {\n        if (*tiles_per_row != 0) goto LAB_000fc178;\n        goto LAB_000fc1ac;\n      }" if (parenthesized_expression "(local_44 != 0)" ( (binary_expression "local_44 != 0" identifier != number_literal) )) (compound_statement "{\n        if (*tiles_per_row != 0) goto LAB_000fc178;\n        goto LAB_000fc1ac;\n      }" { (if_statement "if (*tiles_per_row != 0) goto LAB_000fc178;" if (parenthesized_expression "(*tiles_per_row != 0)" ( (binary_expression "*tiles_per_row != 0" (pointer_expression "*tiles_per_row" * identifier) != number_literal) )) (goto_statement "goto LAB_000fc178;" goto statement_identifier ;)) (goto_statement "goto LAB_000fc1ac;" goto statement_identifier ;) })) (expression_statement "uVar2 = *tiles_per_row;" (assignment_expression "uVar2 = *tiles_per_row" identifier = (pointer_expression "*tiles_per_row" * identifier)) ;) (if_statement "if (uVar2 == 0) goto LAB_000fc178;" if (parenthesized_expression "(uVar2 == 0)" ( (binary_expression "uVar2 == 0" identifier == number_literal) )) (goto_statement "goto LAB_000fc178;" goto statement_identifier ;)) })) (expression_statement "local_4c = (ulonglong)uVar2;" (assignment_expression "local_4c = (ulonglong)uVar2" identifier = (cast_expression "(ulonglong)uVar2" ( (type_descriptor "ulonglong" type_identifier) ) identifier)) ;) (expression_statement "local_44 = (uint)(longlong)ROUND(ROUND((double)number_images / (double)local_4c));" (assignment_expression "local_44 = (uint)(longlong)ROUND(ROUND((double)number_images / (double)local_4c))" identifier = (cast_expression "(uint)(longlong)ROUND(ROUND((double)number_images / (double)local_4c))" ( (type_descriptor "uint" type_identifier) ) (cast_expression "(longlong)ROUND(ROUND((double)number_images / (double)local_4c))" ( (type_descriptor "longlong" type_identifier) ) (call_expression "ROUND(ROUND((double)number_images / (double)local_4c))" identifier (argument_list "(ROUND((double)number_images / (double)local_4c))" ( (call_expression "ROUND((double)number_images / (double)local_4c)" identifier (argument_list "((double)number_images / (double)local_4c)" ( (binary_expression "(double)number_images / (double)local_4c" (cast_expression "(double)number_images" ( (type_descriptor "double" primitive_type) ) identifier) / (cast_expression "(double)local_4c" ( (type_descriptor "double" primitive_type) ) identifier)) ))) )))))) ;) (expression_statement "*tiles_per_column = local_44;" (assignment_expression "*tiles_per_column = local_44" (pointer_expression "*tiles_per_column" * identifier) = identifier) ;) (if_statement "if ((*tiles_per_row != 0) || (local_44 == 0)) goto LAB_000fc178;" if (parenthesized_expression "((*tiles_per_row != 0) || (local_44 == 0))" ( (binary_expression "(*tiles_per_row != 0) || (local_44 == 0)" (parenthesized_expression "(*tiles_per_row != 0)" ( (binary_expression "*tiles_per_row != 0" (pointer_expression "*tiles_per_row" * identifier) != number_literal) )) || (parenthesized_expression "(local_44 == 0)" ( (binary_expression "local_44 == 0" identifier == number_literal) ))) )) (goto_statement "goto LAB_000fc178;" goto statement_identifier ;)) }) (else_clause "else {\n    if (*tiles_per_row != 0) goto LAB_000fc178;\n    local_44 = *tiles_per_column;\n  }" else (compound_statement "{\n    if (*tiles_per_row != 0) goto LAB_000fc178;\n    local_44 = *tiles_per_column;\n  }" { (if_statement "if (*tiles_per_row != 0) goto LAB_000fc178;" if (parenthesized_expression "(*tiles_per_row != 0)" ( (binary_expression "*tiles_per_row != 0" (pointer_expression "*tiles_per_row" * identifier) != number_literal) )) (goto_statement "goto LAB_000fc178;" goto statement_identifier ;)) (expression_statement "local_44 = *tiles_per_column;" (assignment_expression "local_44 = *tiles_per_column" identifier = (pointer_expression "*tiles_per_column" * identifier)) ;) }))) (labeled_statement "LAB_000fc1ac:\n  local_44 = (uint)(longlong)ROUND(ROUND((double)number_images / (double)local_44));" statement_identifier : (expression_statement "local_44 = (uint)(longlong)ROUND(ROUND((double)number_images / (double)local_44));" (assignment_expression "local_44 = (uint)(longlong)ROUND(ROUND((double)number_images / (double)local_44))" identifier = (cast_expression "(uint)(longlong)ROUND(ROUND((double)number_images / (double)local_44))" ( (type_descriptor "uint" type_identifier) ) (cast_expression "(longlong)ROUND(ROUND((double)number_images / (double)local_44))" ( (type_descriptor "longlong" type_identifier) ) (call_expression "ROUND(ROUND((double)number_images / (double)local_44))" identifier (argument_list "(ROUND((double)number_images / (double)local_44))" ( (call_expression "ROUND((double)number_images / (double)local_44)" identifier (argument_list "((double)number_images / (double)local_44)" ( (binary_expression "(double)number_images / (double)local_44" (cast_expression "(double)number_images" ( (type_descriptor "double" primitive_type) ) identifier) / (cast_expression "(double)local_44" ( (type_descriptor "double" primitive_type) ) identifier)) ))) )))))) ;)) (expression_statement "*tiles_per_row = local_44;" (assignment_expression "*tiles_per_row = local_44" (pointer_expression "*tiles_per_row" * identifier) = identifier) ;) (labeled_statement "LAB_000fc178:\n  if (iVar1 != *(int *)(in_GS_OFFSET + 0x14)) {\n                    /* WARNING: Subroutine does not return */\n    __stack_chk_fail_local();\n  }" statement_identifier : (if_statement "if (iVar1 != *(int *)(in_GS_OFFSET + 0x14)) {\n                    /* WARNING: Subroutine does not return */\n    __stack_chk_fail_local();\n  }" if (parenthesized_expression "(iVar1 != *(int *)(in_GS_OFFSET + 0x14))" ( (binary_expression "iVar1 != *(int *)(in_GS_OFFSET + 0x14)" identifier != (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" * (cast_expression "(int *)(in_GS_OFFSET + 0x14)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_GS_OFFSET + 0x14)" ( (binary_expression "in_GS_OFFSET + 0x14" identifier + number_literal) ))))) )) (compound_statement "{\n                    /* WARNING: Subroutine does not return */\n    __stack_chk_fail_local();\n  }" { comment (expression_statement "__stack_chk_fail_local();" (call_expression "__stack_chk_fail_local()" identifier (argument_list "()" ( ))) ;) }))) (return_statement "return;" return ;) })))
(translation_unit "void __regparm3\nFUN_000fc0a0(undefined4 param_1,uint param_2,undefined4 param_3,undefined4 param_4,uint *param_5,\n            uint *param_6)\n\n{\n  int iVar1;\n  double __x;\n  uint uVar2;\n  int in_GS_OFFSET;\n  ulonglong local_4c;\n  uint local_44;\n  \n  iVar1 = *(int *)(in_GS_OFFSET + 0x14);\n  *param_5 = 0;\n  *param_6 = 0;\n  GetGeometry(param_1,param_3,param_4,param_6,param_5);\n  if (*param_5 == 0) {\n    uVar2 = *param_6;\n    if (uVar2 == 0) {\n      __x = (double)param_2;\n      if (__x < 0.0) {\n        sqrt(__x);\n      }\n      local_44 = (uint)(longlong)ROUND(SQRT(__x));\n      *param_5 = local_44;\n      if (local_44 != 0) {\n        if (*param_6 != 0) goto LAB_000fc178;\n        goto LAB_000fc1ac;\n      }\n      uVar2 = *param_6;\n      if (uVar2 == 0) goto LAB_000fc178;\n    }\n    local_4c = (ulonglong)uVar2;\n    local_44 = (uint)(longlong)ROUND(ROUND((double)param_2 / (double)local_4c));\n    *param_5 = local_44;\n    if ((*param_6 != 0) || (local_44 == 0)) goto LAB_000fc178;\n  }\n  else {\n    if (*param_6 != 0) goto LAB_000fc178;\n    local_44 = *param_5;\n  }\nLAB_000fc1ac:\n  local_44 = (uint)(longlong)ROUND(ROUND((double)param_2 / (double)local_44));\n  *param_6 = local_44;\nLAB_000fc178:\n  if (iVar1 != *(int *)(in_GS_OFFSET + 0x14)) {\n                    \n    FUN_0029eab0();\n  }\n  return;\n}\n\n" (function_definition "void __regparm3\nFUN_000fc0a0(undefined4 param_1,uint param_2,undefined4 param_3,undefined4 param_4,uint *param_5,\n            uint *param_6)\n\n{\n  int iVar1;\n  double __x;\n  uint uVar2;\n  int in_GS_OFFSET;\n  ulonglong local_4c;\n  uint local_44;\n  \n  iVar1 = *(int *)(in_GS_OFFSET + 0x14);\n  *param_5 = 0;\n  *param_6 = 0;\n  GetGeometry(param_1,param_3,param_4,param_6,param_5);\n  if (*param_5 == 0) {\n    uVar2 = *param_6;\n    if (uVar2 == 0) {\n      __x = (double)param_2;\n      if (__x < 0.0) {\n        sqrt(__x);\n      }\n      local_44 = (uint)(longlong)ROUND(SQRT(__x));\n      *param_5 = local_44;\n      if (local_44 != 0) {\n        if (*param_6 != 0) goto LAB_000fc178;\n        goto LAB_000fc1ac;\n      }\n      uVar2 = *param_6;\n      if (uVar2 == 0) goto LAB_000fc178;\n    }\n    local_4c = (ulonglong)uVar2;\n    local_44 = (uint)(longlong)ROUND(ROUND((double)param_2 / (double)local_4c));\n    *param_5 = local_44;\n    if ((*param_6 != 0) || (local_44 == 0)) goto LAB_000fc178;\n  }\n  else {\n    if (*param_6 != 0) goto LAB_000fc178;\n    local_44 = *param_5;\n  }\nLAB_000fc1ac:\n  local_44 = (uint)(longlong)ROUND(ROUND((double)param_2 / (double)local_44));\n  *param_6 = local_44;\nLAB_000fc178:\n  if (iVar1 != *(int *)(in_GS_OFFSET + 0x14)) {\n                    \n    FUN_0029eab0();\n  }\n  return;\n}" primitive_type (ERROR "__regparm3" identifier) (function_declarator "FUN_000fc0a0(undefined4 param_1,uint param_2,undefined4 param_3,undefined4 param_4,uint *param_5,\n            uint *param_6)" identifier (parameter_list "(undefined4 param_1,uint param_2,undefined4 param_3,undefined4 param_4,uint *param_5,\n            uint *param_6)" ( (parameter_declaration "undefined4 param_1" type_identifier identifier) , (parameter_declaration "uint param_2" type_identifier identifier) , (parameter_declaration "undefined4 param_3" type_identifier identifier) , (parameter_declaration "undefined4 param_4" type_identifier identifier) , (parameter_declaration "uint *param_5" type_identifier (pointer_declarator "*param_5" * identifier)) , (parameter_declaration "uint *param_6" type_identifier (pointer_declarator "*param_6" * identifier)) ))) (compound_statement "{\n  int iVar1;\n  double __x;\n  uint uVar2;\n  int in_GS_OFFSET;\n  ulonglong local_4c;\n  uint local_44;\n  \n  iVar1 = *(int *)(in_GS_OFFSET + 0x14);\n  *param_5 = 0;\n  *param_6 = 0;\n  GetGeometry(param_1,param_3,param_4,param_6,param_5);\n  if (*param_5 == 0) {\n    uVar2 = *param_6;\n    if (uVar2 == 0) {\n      __x = (double)param_2;\n      if (__x < 0.0) {\n        sqrt(__x);\n      }\n      local_44 = (uint)(longlong)ROUND(SQRT(__x));\n      *param_5 = local_44;\n      if (local_44 != 0) {\n        if (*param_6 != 0) goto LAB_000fc178;\n        goto LAB_000fc1ac;\n      }\n      uVar2 = *param_6;\n      if (uVar2 == 0) goto LAB_000fc178;\n    }\n    local_4c = (ulonglong)uVar2;\n    local_44 = (uint)(longlong)ROUND(ROUND((double)param_2 / (double)local_4c));\n    *param_5 = local_44;\n    if ((*param_6 != 0) || (local_44 == 0)) goto LAB_000fc178;\n  }\n  else {\n    if (*param_6 != 0) goto LAB_000fc178;\n    local_44 = *param_5;\n  }\nLAB_000fc1ac:\n  local_44 = (uint)(longlong)ROUND(ROUND((double)param_2 / (double)local_44));\n  *param_6 = local_44;\nLAB_000fc178:\n  if (iVar1 != *(int *)(in_GS_OFFSET + 0x14)) {\n                    \n    FUN_0029eab0();\n  }\n  return;\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "double __x;" primitive_type identifier ;) (declaration "uint uVar2;" type_identifier identifier ;) (declaration "int in_GS_OFFSET;" primitive_type identifier ;) (declaration "ulonglong local_4c;" type_identifier identifier ;) (declaration "uint local_44;" type_identifier identifier ;) (expression_statement "iVar1 = *(int *)(in_GS_OFFSET + 0x14);" (assignment_expression "iVar1 = *(int *)(in_GS_OFFSET + 0x14)" identifier = (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" * (cast_expression "(int *)(in_GS_OFFSET + 0x14)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_GS_OFFSET + 0x14)" ( (binary_expression "in_GS_OFFSET + 0x14" identifier + number_literal) ))))) ;) (expression_statement "*param_5 = 0;" (assignment_expression "*param_5 = 0" (pointer_expression "*param_5" * identifier) = number_literal) ;) (expression_statement "*param_6 = 0;" (assignment_expression "*param_6 = 0" (pointer_expression "*param_6" * identifier) = number_literal) ;) (expression_statement "GetGeometry(param_1,param_3,param_4,param_6,param_5);" (call_expression "GetGeometry(param_1,param_3,param_4,param_6,param_5)" identifier (argument_list "(param_1,param_3,param_4,param_6,param_5)" ( identifier , identifier , identifier , identifier , identifier ))) ;) (if_statement "if (*param_5 == 0) {\n    uVar2 = *param_6;\n    if (uVar2 == 0) {\n      __x = (double)param_2;\n      if (__x < 0.0) {\n        sqrt(__x);\n      }\n      local_44 = (uint)(longlong)ROUND(SQRT(__x));\n      *param_5 = local_44;\n      if (local_44 != 0) {\n        if (*param_6 != 0) goto LAB_000fc178;\n        goto LAB_000fc1ac;\n      }\n      uVar2 = *param_6;\n      if (uVar2 == 0) goto LAB_000fc178;\n    }\n    local_4c = (ulonglong)uVar2;\n    local_44 = (uint)(longlong)ROUND(ROUND((double)param_2 / (double)local_4c));\n    *param_5 = local_44;\n    if ((*param_6 != 0) || (local_44 == 0)) goto LAB_000fc178;\n  }\n  else {\n    if (*param_6 != 0) goto LAB_000fc178;\n    local_44 = *param_5;\n  }" if (parenthesized_expression "(*param_5 == 0)" ( (binary_expression "*param_5 == 0" (pointer_expression "*param_5" * identifier) == number_literal) )) (compound_statement "{\n    uVar2 = *param_6;\n    if (uVar2 == 0) {\n      __x = (double)param_2;\n      if (__x < 0.0) {\n        sqrt(__x);\n      }\n      local_44 = (uint)(longlong)ROUND(SQRT(__x));\n      *param_5 = local_44;\n      if (local_44 != 0) {\n        if (*param_6 != 0) goto LAB_000fc178;\n        goto LAB_000fc1ac;\n      }\n      uVar2 = *param_6;\n      if (uVar2 == 0) goto LAB_000fc178;\n    }\n    local_4c = (ulonglong)uVar2;\n    local_44 = (uint)(longlong)ROUND(ROUND((double)param_2 / (double)local_4c));\n    *param_5 = local_44;\n    if ((*param_6 != 0) || (local_44 == 0)) goto LAB_000fc178;\n  }" { (expression_statement "uVar2 = *param_6;" (assignment_expression "uVar2 = *param_6" identifier = (pointer_expression "*param_6" * identifier)) ;) (if_statement "if (uVar2 == 0) {\n      __x = (double)param_2;\n      if (__x < 0.0) {\n        sqrt(__x);\n      }\n      local_44 = (uint)(longlong)ROUND(SQRT(__x));\n      *param_5 = local_44;\n      if (local_44 != 0) {\n        if (*param_6 != 0) goto LAB_000fc178;\n        goto LAB_000fc1ac;\n      }\n      uVar2 = *param_6;\n      if (uVar2 == 0) goto LAB_000fc178;\n    }" if (parenthesized_expression "(uVar2 == 0)" ( (binary_expression "uVar2 == 0" identifier == number_literal) )) (compound_statement "{\n      __x = (double)param_2;\n      if (__x < 0.0) {\n        sqrt(__x);\n      }\n      local_44 = (uint)(longlong)ROUND(SQRT(__x));\n      *param_5 = local_44;\n      if (local_44 != 0) {\n        if (*param_6 != 0) goto LAB_000fc178;\n        goto LAB_000fc1ac;\n      }\n      uVar2 = *param_6;\n      if (uVar2 == 0) goto LAB_000fc178;\n    }" { (expression_statement "__x = (double)param_2;" (assignment_expression "__x = (double)param_2" identifier = (cast_expression "(double)param_2" ( (type_descriptor "double" primitive_type) ) identifier)) ;) (if_statement "if (__x < 0.0) {\n        sqrt(__x);\n      }" if (parenthesized_expression "(__x < 0.0)" ( (binary_expression "__x < 0.0" identifier < number_literal) )) (compound_statement "{\n        sqrt(__x);\n      }" { (expression_statement "sqrt(__x);" (call_expression "sqrt(__x)" identifier (argument_list "(__x)" ( identifier ))) ;) })) (expression_statement "local_44 = (uint)(longlong)ROUND(SQRT(__x));" (assignment_expression "local_44 = (uint)(longlong)ROUND(SQRT(__x))" identifier = (cast_expression "(uint)(longlong)ROUND(SQRT(__x))" ( (type_descriptor "uint" type_identifier) ) (cast_expression "(longlong)ROUND(SQRT(__x))" ( (type_descriptor "longlong" type_identifier) ) (call_expression "ROUND(SQRT(__x))" identifier (argument_list "(SQRT(__x))" ( (call_expression "SQRT(__x)" identifier (argument_list "(__x)" ( identifier ))) )))))) ;) (expression_statement "*param_5 = local_44;" (assignment_expression "*param_5 = local_44" (pointer_expression "*param_5" * identifier) = identifier) ;) (if_statement "if (local_44 != 0) {\n        if (*param_6 != 0) goto LAB_000fc178;\n        goto LAB_000fc1ac;\n      }" if (parenthesized_expression "(local_44 != 0)" ( (binary_expression "local_44 != 0" identifier != number_literal) )) (compound_statement "{\n        if (*param_6 != 0) goto LAB_000fc178;\n        goto LAB_000fc1ac;\n      }" { (if_statement "if (*param_6 != 0) goto LAB_000fc178;" if (parenthesized_expression "(*param_6 != 0)" ( (binary_expression "*param_6 != 0" (pointer_expression "*param_6" * identifier) != number_literal) )) (goto_statement "goto LAB_000fc178;" goto statement_identifier ;)) (goto_statement "goto LAB_000fc1ac;" goto statement_identifier ;) })) (expression_statement "uVar2 = *param_6;" (assignment_expression "uVar2 = *param_6" identifier = (pointer_expression "*param_6" * identifier)) ;) (if_statement "if (uVar2 == 0) goto LAB_000fc178;" if (parenthesized_expression "(uVar2 == 0)" ( (binary_expression "uVar2 == 0" identifier == number_literal) )) (goto_statement "goto LAB_000fc178;" goto statement_identifier ;)) })) (expression_statement "local_4c = (ulonglong)uVar2;" (assignment_expression "local_4c = (ulonglong)uVar2" identifier = (cast_expression "(ulonglong)uVar2" ( (type_descriptor "ulonglong" type_identifier) ) identifier)) ;) (expression_statement "local_44 = (uint)(longlong)ROUND(ROUND((double)param_2 / (double)local_4c));" (assignment_expression "local_44 = (uint)(longlong)ROUND(ROUND((double)param_2 / (double)local_4c))" identifier = (cast_expression "(uint)(longlong)ROUND(ROUND((double)param_2 / (double)local_4c))" ( (type_descriptor "uint" type_identifier) ) (cast_expression "(longlong)ROUND(ROUND((double)param_2 / (double)local_4c))" ( (type_descriptor "longlong" type_identifier) ) (call_expression "ROUND(ROUND((double)param_2 / (double)local_4c))" identifier (argument_list "(ROUND((double)param_2 / (double)local_4c))" ( (call_expression "ROUND((double)param_2 / (double)local_4c)" identifier (argument_list "((double)param_2 / (double)local_4c)" ( (binary_expression "(double)param_2 / (double)local_4c" (cast_expression "(double)param_2" ( (type_descriptor "double" primitive_type) ) identifier) / (cast_expression "(double)local_4c" ( (type_descriptor "double" primitive_type) ) identifier)) ))) )))))) ;) (expression_statement "*param_5 = local_44;" (assignment_expression "*param_5 = local_44" (pointer_expression "*param_5" * identifier) = identifier) ;) (if_statement "if ((*param_6 != 0) || (local_44 == 0)) goto LAB_000fc178;" if (parenthesized_expression "((*param_6 != 0) || (local_44 == 0))" ( (binary_expression "(*param_6 != 0) || (local_44 == 0)" (parenthesized_expression "(*param_6 != 0)" ( (binary_expression "*param_6 != 0" (pointer_expression "*param_6" * identifier) != number_literal) )) || (parenthesized_expression "(local_44 == 0)" ( (binary_expression "local_44 == 0" identifier == number_literal) ))) )) (goto_statement "goto LAB_000fc178;" goto statement_identifier ;)) }) (else_clause "else {\n    if (*param_6 != 0) goto LAB_000fc178;\n    local_44 = *param_5;\n  }" else (compound_statement "{\n    if (*param_6 != 0) goto LAB_000fc178;\n    local_44 = *param_5;\n  }" { (if_statement "if (*param_6 != 0) goto LAB_000fc178;" if (parenthesized_expression "(*param_6 != 0)" ( (binary_expression "*param_6 != 0" (pointer_expression "*param_6" * identifier) != number_literal) )) (goto_statement "goto LAB_000fc178;" goto statement_identifier ;)) (expression_statement "local_44 = *param_5;" (assignment_expression "local_44 = *param_5" identifier = (pointer_expression "*param_5" * identifier)) ;) }))) (labeled_statement "LAB_000fc1ac:\n  local_44 = (uint)(longlong)ROUND(ROUND((double)param_2 / (double)local_44));" statement_identifier : (expression_statement "local_44 = (uint)(longlong)ROUND(ROUND((double)param_2 / (double)local_44));" (assignment_expression "local_44 = (uint)(longlong)ROUND(ROUND((double)param_2 / (double)local_44))" identifier = (cast_expression "(uint)(longlong)ROUND(ROUND((double)param_2 / (double)local_44))" ( (type_descriptor "uint" type_identifier) ) (cast_expression "(longlong)ROUND(ROUND((double)param_2 / (double)local_44))" ( (type_descriptor "longlong" type_identifier) ) (call_expression "ROUND(ROUND((double)param_2 / (double)local_44))" identifier (argument_list "(ROUND((double)param_2 / (double)local_44))" ( (call_expression "ROUND((double)param_2 / (double)local_44)" identifier (argument_list "((double)param_2 / (double)local_44)" ( (binary_expression "(double)param_2 / (double)local_44" (cast_expression "(double)param_2" ( (type_descriptor "double" primitive_type) ) identifier) / (cast_expression "(double)local_44" ( (type_descriptor "double" primitive_type) ) identifier)) ))) )))))) ;)) (expression_statement "*param_6 = local_44;" (assignment_expression "*param_6 = local_44" (pointer_expression "*param_6" * identifier) = identifier) ;) (labeled_statement "LAB_000fc178:\n  if (iVar1 != *(int *)(in_GS_OFFSET + 0x14)) {\n                    \n    FUN_0029eab0();\n  }" statement_identifier : (if_statement "if (iVar1 != *(int *)(in_GS_OFFSET + 0x14)) {\n                    \n    FUN_0029eab0();\n  }" if (parenthesized_expression "(iVar1 != *(int *)(in_GS_OFFSET + 0x14))" ( (binary_expression "iVar1 != *(int *)(in_GS_OFFSET + 0x14)" identifier != (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" * (cast_expression "(int *)(in_GS_OFFSET + 0x14)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_GS_OFFSET + 0x14)" ( (binary_expression "in_GS_OFFSET + 0x14" identifier + number_literal) ))))) )) (compound_statement "{\n                    \n    FUN_0029eab0();\n  }" { (expression_statement "FUN_0029eab0();" (call_expression "FUN_0029eab0()" identifier (argument_list "()" ( ))) ;) }))) (return_statement "return;" return ;) })))
(translation_unit (function_definition TYPE (ERROR IDENT) (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE (pointer_declarator * IDENT)) , (parameter_declaration TYPE (pointer_declarator * IDENT)) ))) (compound_statement { (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (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 * IDENT) = LIT) ;) (expression_statement (assignment_expression (pointer_expression * IDENT) = LIT) ;) (expression_statement (call_expression IDENT (argument_list ( IDENT , IDENT , IDENT , IDENT , IDENT ))) ;) (if_statement if (parenthesized_expression ( (binary_expression (pointer_expression * IDENT) == LIT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (pointer_expression * IDENT)) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE) ) IDENT)) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT < LIT) )) (compound_statement { (expression_statement (call_expression IDENT (argument_list ( IDENT ))) ;) })) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE) ) (cast_expression ( (type_descriptor TYPE) ) (call_expression IDENT (argument_list ( (call_expression IDENT (argument_list ( IDENT ))) )))))) ;) (expression_statement (assignment_expression (pointer_expression * IDENT) = IDENT) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT != LIT) )) (compound_statement { (if_statement if (parenthesized_expression ( (binary_expression (pointer_expression * IDENT) != LIT) )) (goto_statement goto statement_identifier ;)) (goto_statement goto statement_identifier ;) })) (expression_statement (assignment_expression IDENT = (pointer_expression * IDENT)) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (goto_statement goto statement_identifier ;)) })) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE) ) IDENT)) ;) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE) ) (cast_expression ( (type_descriptor TYPE) ) (call_expression IDENT (argument_list ( (call_expression IDENT (argument_list ( (binary_expression (cast_expression ( (type_descriptor TYPE) ) IDENT) / (cast_expression ( (type_descriptor TYPE) ) IDENT)) ))) )))))) ;) (expression_statement (assignment_expression (pointer_expression * IDENT) = IDENT) ;) (if_statement if (parenthesized_expression ( (binary_expression (parenthesized_expression ( (binary_expression (pointer_expression * IDENT) != LIT) )) || (parenthesized_expression ( (binary_expression IDENT == LIT) ))) )) (goto_statement goto statement_identifier ;)) }) (else_clause else (compound_statement { (if_statement if (parenthesized_expression ( (binary_expression (pointer_expression * IDENT) != LIT) )) (goto_statement goto statement_identifier ;)) (expression_statement (assignment_expression IDENT = (pointer_expression * IDENT)) ;) }))) (labeled_statement statement_identifier : (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE) ) (cast_expression ( (type_descriptor TYPE) ) (call_expression IDENT (argument_list ( (call_expression IDENT (argument_list ( (binary_expression (cast_expression ( (type_descriptor TYPE) ) IDENT) / (cast_expression ( (type_descriptor TYPE) ) IDENT)) ))) )))))) ;)) (expression_statement (assignment_expression (pointer_expression * IDENT) = IDENT) ;) (labeled_statement statement_identifier : (if_statement if (parenthesized_expression ( (binary_expression IDENT != (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))))) )) (compound_statement { (expression_statement (call_expression IDENT (argument_list ( ))) ;) }))) (return_statement return ;) })))
(function_definition "void __regparm3\nFUN_000fc0a0(undefined4 param_1,uint param_2,undefined4 param_3,undefined4 param_4,uint *param_5,\n            uint *param_6)\n\n{\n  int iVar1;\n  double __x;\n  uint uVar2;\n  int in_GS_OFFSET;\n  ulonglong local_4c;\n  uint local_44;\n  \n  iVar1 = *(int *)(in_GS_OFFSET + 0x14);\n  *param_5 = 0;\n  *param_6 = 0;\n  GetGeometry(param_1,param_3,param_4,param_6,param_5);\n  if (*param_5 == 0) {\n    uVar2 = *param_6;\n    if (uVar2 == 0) {\n      __x = (double)param_2;\n      if (__x < 0.0) {\n        sqrt(__x);\n      }\n      local_44 = (uint)(longlong)ROUND(SQRT(__x));\n      *param_5 = local_44;\n      if (local_44 != 0) {\n        if (*param_6 != 0) goto LAB_000fc178;\n        goto LAB_000fc1ac;\n      }\n      uVar2 = *param_6;\n      if (uVar2 == 0) goto LAB_000fc178;\n    }\n    local_4c = (ulonglong)uVar2;\n    local_44 = (uint)(longlong)ROUND(ROUND((double)param_2 / (double)local_4c));\n    *param_5 = local_44;\n    if ((*param_6 != 0) || (local_44 == 0)) goto LAB_000fc178;\n  }\n  else {\n    if (*param_6 != 0) goto LAB_000fc178;\n    local_44 = *param_5;\n  }\nLAB_000fc1ac:\n  local_44 = (uint)(longlong)ROUND(ROUND((double)param_2 / (double)local_44));\n  *param_6 = local_44;\nLAB_000fc178:\n  if (iVar1 != *(int *)(in_GS_OFFSET + 0x14)) {\n                    \n    FUN_0029eab0();\n  }\n  return;\n}" (primitive_type "void") (ERROR "__regparm3" (identifier "__regparm3")) (function_declarator "FUN_000fc0a0(undefined4 param_1,uint param_2,undefined4 param_3,undefined4 param_4,uint *param_5,\n            uint *param_6)" (identifier "FUN_000fc0a0") (parameter_list "(undefined4 param_1,uint param_2,undefined4 param_3,undefined4 param_4,uint *param_5,\n            uint *param_6)" (( "(") (parameter_declaration "undefined4 param_1" (type_identifier "undefined4") (identifier "param_1")) (, ",") (parameter_declaration "uint param_2" (type_identifier "uint") (identifier "param_2")) (, ",") (parameter_declaration "undefined4 param_3" (type_identifier "undefined4") (identifier "param_3")) (, ",") (parameter_declaration "undefined4 param_4" (type_identifier "undefined4") (identifier "param_4")) (, ",") (parameter_declaration "uint *param_5" (type_identifier "uint") (pointer_declarator "*param_5" (* "*") (identifier "param_5"))) (, ",") (parameter_declaration "uint *param_6" (type_identifier "uint") (pointer_declarator "*param_6" (* "*") (identifier "param_6"))) () ")"))) (compound_statement "{\n  int iVar1;\n  double __x;\n  uint uVar2;\n  int in_GS_OFFSET;\n  ulonglong local_4c;\n  uint local_44;\n  \n  iVar1 = *(int *)(in_GS_OFFSET + 0x14);\n  *param_5 = 0;\n  *param_6 = 0;\n  GetGeometry(param_1,param_3,param_4,param_6,param_5);\n  if (*param_5 == 0) {\n    uVar2 = *param_6;\n    if (uVar2 == 0) {\n      __x = (double)param_2;\n      if (__x < 0.0) {\n        sqrt(__x);\n      }\n      local_44 = (uint)(longlong)ROUND(SQRT(__x));\n      *param_5 = local_44;\n      if (local_44 != 0) {\n        if (*param_6 != 0) goto LAB_000fc178;\n        goto LAB_000fc1ac;\n      }\n      uVar2 = *param_6;\n      if (uVar2 == 0) goto LAB_000fc178;\n    }\n    local_4c = (ulonglong)uVar2;\n    local_44 = (uint)(longlong)ROUND(ROUND((double)param_2 / (double)local_4c));\n    *param_5 = local_44;\n    if ((*param_6 != 0) || (local_44 == 0)) goto LAB_000fc178;\n  }\n  else {\n    if (*param_6 != 0) goto LAB_000fc178;\n    local_44 = *param_5;\n  }\nLAB_000fc1ac:\n  local_44 = (uint)(longlong)ROUND(ROUND((double)param_2 / (double)local_44));\n  *param_6 = local_44;\nLAB_000fc178:\n  if (iVar1 != *(int *)(in_GS_OFFSET + 0x14)) {\n                    \n    FUN_0029eab0();\n  }\n  return;\n}" ({ "{") (declaration "int iVar1;" (primitive_type "int") (identifier "iVar1") (; ";")) (declaration "double __x;" (primitive_type "double") (identifier "__x") (; ";")) (declaration "uint uVar2;" (type_identifier "uint") (identifier "uVar2") (; ";")) (declaration "int in_GS_OFFSET;" (primitive_type "int") (identifier "in_GS_OFFSET") (; ";")) (declaration "ulonglong local_4c;" (type_identifier "ulonglong") (identifier "local_4c") (; ";")) (declaration "uint local_44;" (type_identifier "uint") (identifier "local_44") (; ";")) (expression_statement "iVar1 = *(int *)(in_GS_OFFSET + 0x14);" (assignment_expression "iVar1 = *(int *)(in_GS_OFFSET + 0x14)" (identifier "iVar1") (= "=") (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" (* "*") (cast_expression "(int *)(in_GS_OFFSET + 0x14)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(in_GS_OFFSET + 0x14)" (( "(") (binary_expression "in_GS_OFFSET + 0x14" (identifier "in_GS_OFFSET") (+ "+") (number_literal "0x14")) () ")"))))) (; ";")) (expression_statement "*param_5 = 0;" (assignment_expression "*param_5 = 0" (pointer_expression "*param_5" (* "*") (identifier "param_5")) (= "=") (number_literal "0")) (; ";")) (expression_statement "*param_6 = 0;" (assignment_expression "*param_6 = 0" (pointer_expression "*param_6" (* "*") (identifier "param_6")) (= "=") (number_literal "0")) (; ";")) (expression_statement "GetGeometry(param_1,param_3,param_4,param_6,param_5);" (call_expression "GetGeometry(param_1,param_3,param_4,param_6,param_5)" (identifier "GetGeometry") (argument_list "(param_1,param_3,param_4,param_6,param_5)" (( "(") (identifier "param_1") (, ",") (identifier "param_3") (, ",") (identifier "param_4") (, ",") (identifier "param_6") (, ",") (identifier "param_5") () ")"))) (; ";")) (if_statement "if (*param_5 == 0) {\n    uVar2 = *param_6;\n    if (uVar2 == 0) {\n      __x = (double)param_2;\n      if (__x < 0.0) {\n        sqrt(__x);\n      }\n      local_44 = (uint)(longlong)ROUND(SQRT(__x));\n      *param_5 = local_44;\n      if (local_44 != 0) {\n        if (*param_6 != 0) goto LAB_000fc178;\n        goto LAB_000fc1ac;\n      }\n      uVar2 = *param_6;\n      if (uVar2 == 0) goto LAB_000fc178;\n    }\n    local_4c = (ulonglong)uVar2;\n    local_44 = (uint)(longlong)ROUND(ROUND((double)param_2 / (double)local_4c));\n    *param_5 = local_44;\n    if ((*param_6 != 0) || (local_44 == 0)) goto LAB_000fc178;\n  }\n  else {\n    if (*param_6 != 0) goto LAB_000fc178;\n    local_44 = *param_5;\n  }" (if "if") (parenthesized_expression "(*param_5 == 0)" (( "(") (binary_expression "*param_5 == 0" (pointer_expression "*param_5" (* "*") (identifier "param_5")) (== "==") (number_literal "0")) () ")")) (compound_statement "{\n    uVar2 = *param_6;\n    if (uVar2 == 0) {\n      __x = (double)param_2;\n      if (__x < 0.0) {\n        sqrt(__x);\n      }\n      local_44 = (uint)(longlong)ROUND(SQRT(__x));\n      *param_5 = local_44;\n      if (local_44 != 0) {\n        if (*param_6 != 0) goto LAB_000fc178;\n        goto LAB_000fc1ac;\n      }\n      uVar2 = *param_6;\n      if (uVar2 == 0) goto LAB_000fc178;\n    }\n    local_4c = (ulonglong)uVar2;\n    local_44 = (uint)(longlong)ROUND(ROUND((double)param_2 / (double)local_4c));\n    *param_5 = local_44;\n    if ((*param_6 != 0) || (local_44 == 0)) goto LAB_000fc178;\n  }" ({ "{") (expression_statement "uVar2 = *param_6;" (assignment_expression "uVar2 = *param_6" (identifier "uVar2") (= "=") (pointer_expression "*param_6" (* "*") (identifier "param_6"))) (; ";")) (if_statement "if (uVar2 == 0) {\n      __x = (double)param_2;\n      if (__x < 0.0) {\n        sqrt(__x);\n      }\n      local_44 = (uint)(longlong)ROUND(SQRT(__x));\n      *param_5 = local_44;\n      if (local_44 != 0) {\n        if (*param_6 != 0) goto LAB_000fc178;\n        goto LAB_000fc1ac;\n      }\n      uVar2 = *param_6;\n      if (uVar2 == 0) goto LAB_000fc178;\n    }" (if "if") (parenthesized_expression "(uVar2 == 0)" (( "(") (binary_expression "uVar2 == 0" (identifier "uVar2") (== "==") (number_literal "0")) () ")")) (compound_statement "{\n      __x = (double)param_2;\n      if (__x < 0.0) {\n        sqrt(__x);\n      }\n      local_44 = (uint)(longlong)ROUND(SQRT(__x));\n      *param_5 = local_44;\n      if (local_44 != 0) {\n        if (*param_6 != 0) goto LAB_000fc178;\n        goto LAB_000fc1ac;\n      }\n      uVar2 = *param_6;\n      if (uVar2 == 0) goto LAB_000fc178;\n    }" ({ "{") (expression_statement "__x = (double)param_2;" (assignment_expression "__x = (double)param_2" (identifier "__x") (= "=") (cast_expression "(double)param_2" (( "(") (type_descriptor "double" (primitive_type "double")) () ")") (identifier "param_2"))) (; ";")) (if_statement "if (__x < 0.0) {\n        sqrt(__x);\n      }" (if "if") (parenthesized_expression "(__x < 0.0)" (( "(") (binary_expression "__x < 0.0" (identifier "__x") (< "<") (number_literal "0.0")) () ")")) (compound_statement "{\n        sqrt(__x);\n      }" ({ "{") (expression_statement "sqrt(__x);" (call_expression "sqrt(__x)" (identifier "sqrt") (argument_list "(__x)" (( "(") (identifier "__x") () ")"))) (; ";")) (} "}"))) (expression_statement "local_44 = (uint)(longlong)ROUND(SQRT(__x));" (assignment_expression "local_44 = (uint)(longlong)ROUND(SQRT(__x))" (identifier "local_44") (= "=") (cast_expression "(uint)(longlong)ROUND(SQRT(__x))" (( "(") (type_descriptor "uint" (type_identifier "uint")) () ")") (cast_expression "(longlong)ROUND(SQRT(__x))" (( "(") (type_descriptor "longlong" (type_identifier "longlong")) () ")") (call_expression "ROUND(SQRT(__x))" (identifier "ROUND") (argument_list "(SQRT(__x))" (( "(") (call_expression "SQRT(__x)" (identifier "SQRT") (argument_list "(__x)" (( "(") (identifier "__x") () ")"))) () ")")))))) (; ";")) (expression_statement "*param_5 = local_44;" (assignment_expression "*param_5 = local_44" (pointer_expression "*param_5" (* "*") (identifier "param_5")) (= "=") (identifier "local_44")) (; ";")) (if_statement "if (local_44 != 0) {\n        if (*param_6 != 0) goto LAB_000fc178;\n        goto LAB_000fc1ac;\n      }" (if "if") (parenthesized_expression "(local_44 != 0)" (( "(") (binary_expression "local_44 != 0" (identifier "local_44") (!= "!=") (number_literal "0")) () ")")) (compound_statement "{\n        if (*param_6 != 0) goto LAB_000fc178;\n        goto LAB_000fc1ac;\n      }" ({ "{") (if_statement "if (*param_6 != 0) goto LAB_000fc178;" (if "if") (parenthesized_expression "(*param_6 != 0)" (( "(") (binary_expression "*param_6 != 0" (pointer_expression "*param_6" (* "*") (identifier "param_6")) (!= "!=") (number_literal "0")) () ")")) (goto_statement "goto LAB_000fc178;" (goto "goto") (statement_identifier "LAB_000fc178") (; ";"))) (goto_statement "goto LAB_000fc1ac;" (goto "goto") (statement_identifier "LAB_000fc1ac") (; ";")) (} "}"))) (expression_statement "uVar2 = *param_6;" (assignment_expression "uVar2 = *param_6" (identifier "uVar2") (= "=") (pointer_expression "*param_6" (* "*") (identifier "param_6"))) (; ";")) (if_statement "if (uVar2 == 0) goto LAB_000fc178;" (if "if") (parenthesized_expression "(uVar2 == 0)" (( "(") (binary_expression "uVar2 == 0" (identifier "uVar2") (== "==") (number_literal "0")) () ")")) (goto_statement "goto LAB_000fc178;" (goto "goto") (statement_identifier "LAB_000fc178") (; ";"))) (} "}"))) (expression_statement "local_4c = (ulonglong)uVar2;" (assignment_expression "local_4c = (ulonglong)uVar2" (identifier "local_4c") (= "=") (cast_expression "(ulonglong)uVar2" (( "(") (type_descriptor "ulonglong" (type_identifier "ulonglong")) () ")") (identifier "uVar2"))) (; ";")) (expression_statement "local_44 = (uint)(longlong)ROUND(ROUND((double)param_2 / (double)local_4c));" (assignment_expression "local_44 = (uint)(longlong)ROUND(ROUND((double)param_2 / (double)local_4c))" (identifier "local_44") (= "=") (cast_expression "(uint)(longlong)ROUND(ROUND((double)param_2 / (double)local_4c))" (( "(") (type_descriptor "uint" (type_identifier "uint")) () ")") (cast_expression "(longlong)ROUND(ROUND((double)param_2 / (double)local_4c))" (( "(") (type_descriptor "longlong" (type_identifier "longlong")) () ")") (call_expression "ROUND(ROUND((double)param_2 / (double)local_4c))" (identifier "ROUND") (argument_list "(ROUND((double)param_2 / (double)local_4c))" (( "(") (call_expression "ROUND((double)param_2 / (double)local_4c)" (identifier "ROUND") (argument_list "((double)param_2 / (double)local_4c)" (( "(") (binary_expression "(double)param_2 / (double)local_4c" (cast_expression "(double)param_2" (( "(") (type_descriptor "double" (primitive_type "double")) () ")") (identifier "param_2")) (/ "/") (cast_expression "(double)local_4c" (( "(") (type_descriptor "double" (primitive_type "double")) () ")") (identifier "local_4c"))) () ")"))) () ")")))))) (; ";")) (expression_statement "*param_5 = local_44;" (assignment_expression "*param_5 = local_44" (pointer_expression "*param_5" (* "*") (identifier "param_5")) (= "=") (identifier "local_44")) (; ";")) (if_statement "if ((*param_6 != 0) || (local_44 == 0)) goto LAB_000fc178;" (if "if") (parenthesized_expression "((*param_6 != 0) || (local_44 == 0))" (( "(") (binary_expression "(*param_6 != 0) || (local_44 == 0)" (parenthesized_expression "(*param_6 != 0)" (( "(") (binary_expression "*param_6 != 0" (pointer_expression "*param_6" (* "*") (identifier "param_6")) (!= "!=") (number_literal "0")) () ")")) (|| "||") (parenthesized_expression "(local_44 == 0)" (( "(") (binary_expression "local_44 == 0" (identifier "local_44") (== "==") (number_literal "0")) () ")"))) () ")")) (goto_statement "goto LAB_000fc178;" (goto "goto") (statement_identifier "LAB_000fc178") (; ";"))) (} "}")) (else_clause "else {\n    if (*param_6 != 0) goto LAB_000fc178;\n    local_44 = *param_5;\n  }" (else "else") (compound_statement "{\n    if (*param_6 != 0) goto LAB_000fc178;\n    local_44 = *param_5;\n  }" ({ "{") (if_statement "if (*param_6 != 0) goto LAB_000fc178;" (if "if") (parenthesized_expression "(*param_6 != 0)" (( "(") (binary_expression "*param_6 != 0" (pointer_expression "*param_6" (* "*") (identifier "param_6")) (!= "!=") (number_literal "0")) () ")")) (goto_statement "goto LAB_000fc178;" (goto "goto") (statement_identifier "LAB_000fc178") (; ";"))) (expression_statement "local_44 = *param_5;" (assignment_expression "local_44 = *param_5" (identifier "local_44") (= "=") (pointer_expression "*param_5" (* "*") (identifier "param_5"))) (; ";")) (} "}")))) (labeled_statement "LAB_000fc1ac:\n  local_44 = (uint)(longlong)ROUND(ROUND((double)param_2 / (double)local_44));" (statement_identifier "LAB_000fc1ac") (: ":") (expression_statement "local_44 = (uint)(longlong)ROUND(ROUND((double)param_2 / (double)local_44));" (assignment_expression "local_44 = (uint)(longlong)ROUND(ROUND((double)param_2 / (double)local_44))" (identifier "local_44") (= "=") (cast_expression "(uint)(longlong)ROUND(ROUND((double)param_2 / (double)local_44))" (( "(") (type_descriptor "uint" (type_identifier "uint")) () ")") (cast_expression "(longlong)ROUND(ROUND((double)param_2 / (double)local_44))" (( "(") (type_descriptor "longlong" (type_identifier "longlong")) () ")") (call_expression "ROUND(ROUND((double)param_2 / (double)local_44))" (identifier "ROUND") (argument_list "(ROUND((double)param_2 / (double)local_44))" (( "(") (call_expression "ROUND((double)param_2 / (double)local_44)" (identifier "ROUND") (argument_list "((double)param_2 / (double)local_44)" (( "(") (binary_expression "(double)param_2 / (double)local_44" (cast_expression "(double)param_2" (( "(") (type_descriptor "double" (primitive_type "double")) () ")") (identifier "param_2")) (/ "/") (cast_expression "(double)local_44" (( "(") (type_descriptor "double" (primitive_type "double")) () ")") (identifier "local_44"))) () ")"))) () ")")))))) (; ";"))) (expression_statement "*param_6 = local_44;" (assignment_expression "*param_6 = local_44" (pointer_expression "*param_6" (* "*") (identifier "param_6")) (= "=") (identifier "local_44")) (; ";")) (labeled_statement "LAB_000fc178:\n  if (iVar1 != *(int *)(in_GS_OFFSET + 0x14)) {\n                    \n    FUN_0029eab0();\n  }" (statement_identifier "LAB_000fc178") (: ":") (if_statement "if (iVar1 != *(int *)(in_GS_OFFSET + 0x14)) {\n                    \n    FUN_0029eab0();\n  }" (if "if") (parenthesized_expression "(iVar1 != *(int *)(in_GS_OFFSET + 0x14))" (( "(") (binary_expression "iVar1 != *(int *)(in_GS_OFFSET + 0x14)" (identifier "iVar1") (!= "!=") (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" (* "*") (cast_expression "(int *)(in_GS_OFFSET + 0x14)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(in_GS_OFFSET + 0x14)" (( "(") (binary_expression "in_GS_OFFSET + 0x14" (identifier "in_GS_OFFSET") (+ "+") (number_literal "0x14")) () ")"))))) () ")")) (compound_statement "{\n                    \n    FUN_0029eab0();\n  }" ({ "{") (expression_statement "FUN_0029eab0();" (call_expression "FUN_0029eab0()" (identifier "FUN_0029eab0") (argument_list "()" (( "(") () ")"))) (; ";")) (} "}")))) (return_statement "return;" (return "return") (; ";")) (} "}")))

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

void __regparm3
function_1(char *geometry,size_t number_images,ssize_t *x_offset,ssize_t *y_offset,
                  size_t *tiles_per_column,size_t *tiles_per_row)

{
  int var_9;
  double var_4;
  type_1 var_3;
  int var_1;
  type_2 local_4c;
  type_1 var_8;
  type_3 __cw;
  type_3 __cwtmp;
  
  var_9 = *(int *)(var_1 + 0x14);
  *tiles_per_column = 0;
  *tiles_per_row = 0;
  var_2(geometry,x_offset,y_offset,tiles_per_row,tiles_per_column);
  if (*tiles_per_column == 0) {
    var_3 = *tiles_per_row;
    if (var_3 == 0) {
      var_4 = (double)number_images;
      if (var_4 < 0.0) {
        var_5(var_4);
      }
      var_8 = (type_1)(type_4)var_6(var_7(var_4));
      *tiles_per_column = var_8;
      if (var_8 != 0) {
        if (*tiles_per_row != 0) goto LAB_000fc178;
        goto LAB_000fc1ac;
      }
      var_3 = *tiles_per_row;
      if (var_3 == 0) goto LAB_000fc178;
    }
    local_4c = (type_2)var_3;
    var_8 = (type_1)(type_4)var_6(var_6((double)number_images / (double)local_4c));
    *tiles_per_column = var_8;
    if ((*tiles_per_row != 0) || (var_8 == 0)) goto LAB_000fc178;
  }
  else {
    if (*tiles_per_row != 0) goto LAB_000fc178;
    var_8 = *tiles_per_column;
  }
LAB_000fc1ac:
  var_8 = (type_1)(type_4)var_6(var_6((double)number_images / (double)var_8));
  *tiles_per_row = var_8;
LAB_000fc178:
  if (var_9 != *(int *)(var_1 + 0x14)) {
                    /* WARNING: Subroutine does not return */
    var_10();
  }
  return;
}


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

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

void __regparm3
MASKED(undefined4 param_1,uint param_2,undefined4 param_3,undefined4 param_4,uint *param_5,
            uint *param_6)

{
  int iVar1;
  double __x;
  uint uVar2;
  int in_GS_OFFSET;
  ulonglong local_4c;
  uint local_44;
  
  iVar1 = *(int *)(in_GS_OFFSET + 0x14);
  *param_5 = 0;
  *param_6 = 0;
  GetGeometry(param_1,param_3,param_4,param_6,param_5);
  if (*param_5 == 0) {
    uVar2 = *param_6;
    if (uVar2 == 0) {
      __x = (double)param_2;
      if (__x < 0.0) {
        sqrt(__x);
      }
      local_44 = (uint)(longlong)ROUND(SQRT(__x));
      *param_5 = local_44;
      if (local_44 != 0) {
        if (*param_6 != 0) goto LAB_000fc178;
        goto LAB_000fc1ac;
      }
      uVar2 = *param_6;
      if (uVar2 == 0) goto LAB_000fc178;
    }
    local_4c = (ulonglong)uVar2;
    local_44 = (uint)(longlong)ROUND(ROUND((double)param_2 / (double)local_4c));
    *param_5 = local_44;
    if ((*param_6 != 0) || (local_44 == 0)) goto LAB_000fc178;
  }
  else {
    if (*param_6 != 0) goto LAB_000fc178;
    local_44 = *param_5;
  }
LAB_000fc1ac:
  local_44 = (uint)(longlong)ROUND(ROUND((double)param_2 / (double)local_44));
  *param_6 = local_44;
LAB_000fc178:
  if (iVar1 != *(int *)(in_GS_OFFSET + 0x14)) {
                    /* WARNING: Subroutine does not return */
    FUN_0029eab0();
  }
  return;
}

