
Pgno finalDbSize(BtShared *pBt,Pgno nOrig,Pgno nFree)

{
  Pgno PVar1;
  Pgno PVar2;
  uint uVar3;
  
  uVar3 = pBt->usableSize / 5;
  PVar1 = ptrmapPageno(pBt,nOrig);
  if (uVar3 == 0) {
    trap(7);
  }
  PVar1 = (nOrig - nFree) - (uVar3 + (nFree - nOrig) + PVar1) / uVar3;
  if (pBt->pageSize == 0) {
    trap(7);
  }
  uVar3 = *(uint *)(PTR_sBegin_ru_stime_tv_sec_0018f948 + -0x1b80) / pBt->pageSize + 1;
  if ((uVar3 < nOrig) && (PVar1 < uVar3)) {
    PVar1 = PVar1 - 1;
  }
  for (; (PVar2 = ptrmapPageno(pBt,PVar1), PVar2 == PVar1 || (uVar3 == PVar1)); PVar1 = PVar1 - 1) {
  }
  return PVar1;
}



uint FUN_00045af0(int param_1,uint param_2,int param_3)

{
  int iVar1;
  uint uVar2;
  uint uVar3;
  uint uVar4;
  
  uVar3 = *(uint *)(param_1 + 0x24) / 5;
  iVar1 = FUN_00045458();
  if (uVar3 == 0) {
    trap(7);
  }
  uVar3 = (param_2 - param_3) - (uVar3 + (param_3 - param_2) + iVar1) / uVar3;
  if (*(uint *)(param_1 + 0x20) == 0) {
    trap(7);
  }
  uVar4 = *(uint *)(PTR_DAT_0018f948 + -0x1b80) / *(uint *)(param_1 + 0x20) + 1;
  if ((uVar4 < param_2) && (uVar3 < uVar4)) {
    uVar3 = uVar3 - 1;
  }
  for (; (uVar2 = FUN_00045458(param_1,uVar3), uVar2 == uVar3 || (uVar4 == uVar3));
      uVar3 = uVar3 - 1) {
  }
  return uVar3;
}


lui gp,0x15
addiu gp,gp,0x1e30
addu gp,gp,t9
addiu sp,sp,-0x30
sw ra,0x2c(sp)
sw s4,0x28(sp)
sw s3,0x24(sp)
sw s2,0x20(sp)
sw s1,0x1c(sp)
sw s0,0x18(sp)
sw gp,0x10(sp)
or s2,a0,zero
or s4,a1,zero
or s3,a2,zero
lw v0,0x24(a0)
lui s0,0xcccc
ori s0,s0,0xcccd
multu v0,s0
mfhi v0
srl s0,v0,0x2
subu s1,a2,a1
lw t9,-0x7dc8(gp)
addiu t9,t9,0x5458
bal 0x00045458
_nop
lw gp,0x10(sp)
subu s3,s4,s3
addu s1,s0,s1
addu v0,s1,v0
teq s0,zero
divu v0,s0
mflo v0
subu s0,s3,v0
lw v0,-0x7fd8(gp)
lw s3,-0x1b80(v0)
lw v0,0x20(s2)
teq v0,zero
divu s3,v0
mflo s3
addiu s3,s3,0x1
sltu s4,s3,s4
beq s4,zero,0x00045ba8
_sltu v0,s0,s3
beq v0,zero,0x00045ba8
_nop
addiu s0,s0,-0x1
lw s1,-0x7dc8(gp)
b 0x00045bb8
_addiu s1,s1,0x5458
addiu s0,s0,-0x1
or a1,s0,zero
or a0,s2,zero
or t9,s1,zero
bal 0x00045458
_nop
lw gp,0x10(sp)
beq v0,s0,0x00045bb4
_nop
beq s3,s0,0x00045bb4
_or v0,s0,zero
lw ra,0x2c(sp)
lw s4,0x28(sp)
lw s3,0x24(sp)
lw s2,0x20(sp)
lw s1,0x1c(sp)
lw s0,0x18(sp)
jr ra
_addiu sp,sp,0x30
(translation_unit "uint FUN_00045af0(int param_1,uint param_2,int param_3)\n\n{\n  int iVar1;\n  uint uVar2;\n  uint uVar3;\n  uint uVar4;\n  \n  uVar3 = *(uint *)(param_1 + 0x24) / 5;\n  iVar1 = FUN_00045458();\n  if (uVar3 == 0) {\n    trap(7);\n  }\n  uVar3 = (param_2 - param_3) - (uVar3 + (param_3 - param_2) + iVar1) / uVar3;\n  if (*(uint *)(param_1 + 0x20) == 0) {\n    trap(7);\n  }\n  uVar4 = *(uint *)(PTR_DAT_0018f948 + -0x1b80) / *(uint *)(param_1 + 0x20) + 1;\n  if ((uVar4 < param_2) && (uVar3 < uVar4)) {\n    uVar3 = uVar3 - 1;\n  }\n  for (; (uVar2 = FUN_00045458(param_1,uVar3), uVar2 == uVar3 || (uVar4 == uVar3));\n      uVar3 = uVar3 - 1) {\n  }\n  return uVar3;\n}\n\n" (function_definition "uint FUN_00045af0(int param_1,uint param_2,int param_3)\n\n{\n  int iVar1;\n  uint uVar2;\n  uint uVar3;\n  uint uVar4;\n  \n  uVar3 = *(uint *)(param_1 + 0x24) / 5;\n  iVar1 = FUN_00045458();\n  if (uVar3 == 0) {\n    trap(7);\n  }\n  uVar3 = (param_2 - param_3) - (uVar3 + (param_3 - param_2) + iVar1) / uVar3;\n  if (*(uint *)(param_1 + 0x20) == 0) {\n    trap(7);\n  }\n  uVar4 = *(uint *)(PTR_DAT_0018f948 + -0x1b80) / *(uint *)(param_1 + 0x20) + 1;\n  if ((uVar4 < param_2) && (uVar3 < uVar4)) {\n    uVar3 = uVar3 - 1;\n  }\n  for (; (uVar2 = FUN_00045458(param_1,uVar3), uVar2 == uVar3 || (uVar4 == uVar3));\n      uVar3 = uVar3 - 1) {\n  }\n  return uVar3;\n}" type_identifier (function_declarator "FUN_00045af0(int param_1,uint param_2,int param_3)" identifier (parameter_list "(int param_1,uint param_2,int param_3)" ( (parameter_declaration "int param_1" primitive_type identifier) , (parameter_declaration "uint param_2" type_identifier identifier) , (parameter_declaration "int param_3" primitive_type identifier) ))) (compound_statement "{\n  int iVar1;\n  uint uVar2;\n  uint uVar3;\n  uint uVar4;\n  \n  uVar3 = *(uint *)(param_1 + 0x24) / 5;\n  iVar1 = FUN_00045458();\n  if (uVar3 == 0) {\n    trap(7);\n  }\n  uVar3 = (param_2 - param_3) - (uVar3 + (param_3 - param_2) + iVar1) / uVar3;\n  if (*(uint *)(param_1 + 0x20) == 0) {\n    trap(7);\n  }\n  uVar4 = *(uint *)(PTR_DAT_0018f948 + -0x1b80) / *(uint *)(param_1 + 0x20) + 1;\n  if ((uVar4 < param_2) && (uVar3 < uVar4)) {\n    uVar3 = uVar3 - 1;\n  }\n  for (; (uVar2 = FUN_00045458(param_1,uVar3), uVar2 == uVar3 || (uVar4 == uVar3));\n      uVar3 = uVar3 - 1) {\n  }\n  return uVar3;\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "uint uVar2;" type_identifier identifier ;) (declaration "uint uVar3;" type_identifier identifier ;) (declaration "uint uVar4;" type_identifier identifier ;) (expression_statement "uVar3 = *(uint *)(param_1 + 0x24) / 5;" (assignment_expression "uVar3 = *(uint *)(param_1 + 0x24) / 5" identifier = (binary_expression "*(uint *)(param_1 + 0x24) / 5" (pointer_expression "*(uint *)(param_1 + 0x24)" * (cast_expression "(uint *)(param_1 + 0x24)" ( (type_descriptor "uint *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x24)" ( (binary_expression "param_1 + 0x24" identifier + number_literal) )))) / number_literal)) ;) (expression_statement "iVar1 = FUN_00045458();" (assignment_expression "iVar1 = FUN_00045458()" identifier = (call_expression "FUN_00045458()" identifier (argument_list "()" ( )))) ;) (if_statement "if (uVar3 == 0) {\n    trap(7);\n  }" if (parenthesized_expression "(uVar3 == 0)" ( (binary_expression "uVar3 == 0" identifier == number_literal) )) (compound_statement "{\n    trap(7);\n  }" { (expression_statement "trap(7);" (call_expression "trap(7)" identifier (argument_list "(7)" ( number_literal ))) ;) })) (expression_statement "uVar3 = (param_2 - param_3) - (uVar3 + (param_3 - param_2) + iVar1) / uVar3;" (assignment_expression "uVar3 = (param_2 - param_3) - (uVar3 + (param_3 - param_2) + iVar1) / uVar3" identifier = (binary_expression "(param_2 - param_3) - (uVar3 + (param_3 - param_2) + iVar1) / uVar3" (parenthesized_expression "(param_2 - param_3)" ( (binary_expression "param_2 - param_3" identifier - identifier) )) - (binary_expression "(uVar3 + (param_3 - param_2) + iVar1) / uVar3" (parenthesized_expression "(uVar3 + (param_3 - param_2) + iVar1)" ( (binary_expression "uVar3 + (param_3 - param_2) + iVar1" (binary_expression "uVar3 + (param_3 - param_2)" identifier + (parenthesized_expression "(param_3 - param_2)" ( (binary_expression "param_3 - param_2" identifier - identifier) ))) + identifier) )) / identifier))) ;) (if_statement "if (*(uint *)(param_1 + 0x20) == 0) {\n    trap(7);\n  }" if (parenthesized_expression "(*(uint *)(param_1 + 0x20) == 0)" ( (binary_expression "*(uint *)(param_1 + 0x20) == 0" (pointer_expression "*(uint *)(param_1 + 0x20)" * (cast_expression "(uint *)(param_1 + 0x20)" ( (type_descriptor "uint *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x20)" ( (binary_expression "param_1 + 0x20" identifier + number_literal) )))) == number_literal) )) (compound_statement "{\n    trap(7);\n  }" { (expression_statement "trap(7);" (call_expression "trap(7)" identifier (argument_list "(7)" ( number_literal ))) ;) })) (expression_statement "uVar4 = *(uint *)(PTR_DAT_0018f948 + -0x1b80) / *(uint *)(param_1 + 0x20) + 1;" (assignment_expression "uVar4 = *(uint *)(PTR_DAT_0018f948 + -0x1b80) / *(uint *)(param_1 + 0x20) + 1" identifier = (binary_expression "*(uint *)(PTR_DAT_0018f948 + -0x1b80) / *(uint *)(param_1 + 0x20) + 1" (binary_expression "*(uint *)(PTR_DAT_0018f948 + -0x1b80) / *(uint *)(param_1 + 0x20)" (pointer_expression "*(uint *)(PTR_DAT_0018f948 + -0x1b80)" * (cast_expression "(uint *)(PTR_DAT_0018f948 + -0x1b80)" ( (type_descriptor "uint *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(PTR_DAT_0018f948 + -0x1b80)" ( (binary_expression "PTR_DAT_0018f948 + -0x1b80" identifier + number_literal) )))) / (pointer_expression "*(uint *)(param_1 + 0x20)" * (cast_expression "(uint *)(param_1 + 0x20)" ( (type_descriptor "uint *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x20)" ( (binary_expression "param_1 + 0x20" identifier + number_literal) ))))) + number_literal)) ;) (if_statement "if ((uVar4 < param_2) && (uVar3 < uVar4)) {\n    uVar3 = uVar3 - 1;\n  }" if (parenthesized_expression "((uVar4 < param_2) && (uVar3 < uVar4))" ( (binary_expression "(uVar4 < param_2) && (uVar3 < uVar4)" (parenthesized_expression "(uVar4 < param_2)" ( (binary_expression "uVar4 < param_2" identifier < identifier) )) && (parenthesized_expression "(uVar3 < uVar4)" ( (binary_expression "uVar3 < uVar4" identifier < identifier) ))) )) (compound_statement "{\n    uVar3 = uVar3 - 1;\n  }" { (expression_statement "uVar3 = uVar3 - 1;" (assignment_expression "uVar3 = uVar3 - 1" identifier = (binary_expression "uVar3 - 1" identifier - number_literal)) ;) })) (for_statement "for (; (uVar2 = FUN_00045458(param_1,uVar3), uVar2 == uVar3 || (uVar4 == uVar3));\n      uVar3 = uVar3 - 1) {\n  }" for ( ; (parenthesized_expression "(uVar2 = FUN_00045458(param_1,uVar3), uVar2 == uVar3 || (uVar4 == uVar3))" ( (comma_expression "uVar2 = FUN_00045458(param_1,uVar3), uVar2 == uVar3 || (uVar4 == uVar3)" (assignment_expression "uVar2 = FUN_00045458(param_1,uVar3)" identifier = (call_expression "FUN_00045458(param_1,uVar3)" identifier (argument_list "(param_1,uVar3)" ( identifier , identifier )))) , (binary_expression "uVar2 == uVar3 || (uVar4 == uVar3)" (binary_expression "uVar2 == uVar3" identifier == identifier) || (parenthesized_expression "(uVar4 == uVar3)" ( (binary_expression "uVar4 == uVar3" identifier == identifier) )))) )) ; (assignment_expression "uVar3 = uVar3 - 1" identifier = (binary_expression "uVar3 - 1" identifier - number_literal)) ) (compound_statement "{\n  }" { })) (return_statement "return uVar3;" return identifier ;) })))
(translation_unit "Pgno finalDbSize(BtShared *pBt,Pgno nOrig,Pgno nFree)\n\n{\n  Pgno PVar1;\n  Pgno PVar2;\n  uint uVar3;\n  \n  uVar3 = pBt->usableSize / 5;\n  PVar1 = ptrmapPageno(pBt,nOrig);\n  if (uVar3 == 0) {\n    trap(7);\n  }\n  PVar1 = (nOrig - nFree) - (uVar3 + (nFree - nOrig) + PVar1) / uVar3;\n  if (pBt->pageSize == 0) {\n    trap(7);\n  }\n  uVar3 = *(uint *)(PTR_sBegin_ru_stime_tv_sec_0018f948 + -0x1b80) / pBt->pageSize + 1;\n  if ((uVar3 < nOrig) && (PVar1 < uVar3)) {\n    PVar1 = PVar1 - 1;\n  }\n  for (; (PVar2 = ptrmapPageno(pBt,PVar1), PVar2 == PVar1 || (uVar3 == PVar1)); PVar1 = PVar1 - 1) {\n  }\n  return PVar1;\n}\n\n" (function_definition "Pgno finalDbSize(BtShared *pBt,Pgno nOrig,Pgno nFree)\n\n{\n  Pgno PVar1;\n  Pgno PVar2;\n  uint uVar3;\n  \n  uVar3 = pBt->usableSize / 5;\n  PVar1 = ptrmapPageno(pBt,nOrig);\n  if (uVar3 == 0) {\n    trap(7);\n  }\n  PVar1 = (nOrig - nFree) - (uVar3 + (nFree - nOrig) + PVar1) / uVar3;\n  if (pBt->pageSize == 0) {\n    trap(7);\n  }\n  uVar3 = *(uint *)(PTR_sBegin_ru_stime_tv_sec_0018f948 + -0x1b80) / pBt->pageSize + 1;\n  if ((uVar3 < nOrig) && (PVar1 < uVar3)) {\n    PVar1 = PVar1 - 1;\n  }\n  for (; (PVar2 = ptrmapPageno(pBt,PVar1), PVar2 == PVar1 || (uVar3 == PVar1)); PVar1 = PVar1 - 1) {\n  }\n  return PVar1;\n}" type_identifier (function_declarator "finalDbSize(BtShared *pBt,Pgno nOrig,Pgno nFree)" identifier (parameter_list "(BtShared *pBt,Pgno nOrig,Pgno nFree)" ( (parameter_declaration "BtShared *pBt" type_identifier (pointer_declarator "*pBt" * identifier)) , (parameter_declaration "Pgno nOrig" type_identifier identifier) , (parameter_declaration "Pgno nFree" type_identifier identifier) ))) (compound_statement "{\n  Pgno PVar1;\n  Pgno PVar2;\n  uint uVar3;\n  \n  uVar3 = pBt->usableSize / 5;\n  PVar1 = ptrmapPageno(pBt,nOrig);\n  if (uVar3 == 0) {\n    trap(7);\n  }\n  PVar1 = (nOrig - nFree) - (uVar3 + (nFree - nOrig) + PVar1) / uVar3;\n  if (pBt->pageSize == 0) {\n    trap(7);\n  }\n  uVar3 = *(uint *)(PTR_sBegin_ru_stime_tv_sec_0018f948 + -0x1b80) / pBt->pageSize + 1;\n  if ((uVar3 < nOrig) && (PVar1 < uVar3)) {\n    PVar1 = PVar1 - 1;\n  }\n  for (; (PVar2 = ptrmapPageno(pBt,PVar1), PVar2 == PVar1 || (uVar3 == PVar1)); PVar1 = PVar1 - 1) {\n  }\n  return PVar1;\n}" { (declaration "Pgno PVar1;" type_identifier identifier ;) (declaration "Pgno PVar2;" type_identifier identifier ;) (declaration "uint uVar3;" type_identifier identifier ;) (expression_statement "uVar3 = pBt->usableSize / 5;" (assignment_expression "uVar3 = pBt->usableSize / 5" identifier = (binary_expression "pBt->usableSize / 5" (field_expression "pBt->usableSize" identifier -> field_identifier) / number_literal)) ;) (expression_statement "PVar1 = ptrmapPageno(pBt,nOrig);" (assignment_expression "PVar1 = ptrmapPageno(pBt,nOrig)" identifier = (call_expression "ptrmapPageno(pBt,nOrig)" identifier (argument_list "(pBt,nOrig)" ( identifier , identifier )))) ;) (if_statement "if (uVar3 == 0) {\n    trap(7);\n  }" if (parenthesized_expression "(uVar3 == 0)" ( (binary_expression "uVar3 == 0" identifier == number_literal) )) (compound_statement "{\n    trap(7);\n  }" { (expression_statement "trap(7);" (call_expression "trap(7)" identifier (argument_list "(7)" ( number_literal ))) ;) })) (expression_statement "PVar1 = (nOrig - nFree) - (uVar3 + (nFree - nOrig) + PVar1) / uVar3;" (assignment_expression "PVar1 = (nOrig - nFree) - (uVar3 + (nFree - nOrig) + PVar1) / uVar3" identifier = (binary_expression "(nOrig - nFree) - (uVar3 + (nFree - nOrig) + PVar1) / uVar3" (parenthesized_expression "(nOrig - nFree)" ( (binary_expression "nOrig - nFree" identifier - identifier) )) - (binary_expression "(uVar3 + (nFree - nOrig) + PVar1) / uVar3" (parenthesized_expression "(uVar3 + (nFree - nOrig) + PVar1)" ( (binary_expression "uVar3 + (nFree - nOrig) + PVar1" (binary_expression "uVar3 + (nFree - nOrig)" identifier + (parenthesized_expression "(nFree - nOrig)" ( (binary_expression "nFree - nOrig" identifier - identifier) ))) + identifier) )) / identifier))) ;) (if_statement "if (pBt->pageSize == 0) {\n    trap(7);\n  }" if (parenthesized_expression "(pBt->pageSize == 0)" ( (binary_expression "pBt->pageSize == 0" (field_expression "pBt->pageSize" identifier -> field_identifier) == number_literal) )) (compound_statement "{\n    trap(7);\n  }" { (expression_statement "trap(7);" (call_expression "trap(7)" identifier (argument_list "(7)" ( number_literal ))) ;) })) (expression_statement "uVar3 = *(uint *)(PTR_sBegin_ru_stime_tv_sec_0018f948 + -0x1b80) / pBt->pageSize + 1;" (assignment_expression "uVar3 = *(uint *)(PTR_sBegin_ru_stime_tv_sec_0018f948 + -0x1b80) / pBt->pageSize + 1" identifier = (binary_expression "*(uint *)(PTR_sBegin_ru_stime_tv_sec_0018f948 + -0x1b80) / pBt->pageSize + 1" (binary_expression "*(uint *)(PTR_sBegin_ru_stime_tv_sec_0018f948 + -0x1b80) / pBt->pageSize" (pointer_expression "*(uint *)(PTR_sBegin_ru_stime_tv_sec_0018f948 + -0x1b80)" * (cast_expression "(uint *)(PTR_sBegin_ru_stime_tv_sec_0018f948 + -0x1b80)" ( (type_descriptor "uint *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(PTR_sBegin_ru_stime_tv_sec_0018f948 + -0x1b80)" ( (binary_expression "PTR_sBegin_ru_stime_tv_sec_0018f948 + -0x1b80" identifier + number_literal) )))) / (field_expression "pBt->pageSize" identifier -> field_identifier)) + number_literal)) ;) (if_statement "if ((uVar3 < nOrig) && (PVar1 < uVar3)) {\n    PVar1 = PVar1 - 1;\n  }" if (parenthesized_expression "((uVar3 < nOrig) && (PVar1 < uVar3))" ( (binary_expression "(uVar3 < nOrig) && (PVar1 < uVar3)" (parenthesized_expression "(uVar3 < nOrig)" ( (binary_expression "uVar3 < nOrig" identifier < identifier) )) && (parenthesized_expression "(PVar1 < uVar3)" ( (binary_expression "PVar1 < uVar3" identifier < identifier) ))) )) (compound_statement "{\n    PVar1 = PVar1 - 1;\n  }" { (expression_statement "PVar1 = PVar1 - 1;" (assignment_expression "PVar1 = PVar1 - 1" identifier = (binary_expression "PVar1 - 1" identifier - number_literal)) ;) })) (for_statement "for (; (PVar2 = ptrmapPageno(pBt,PVar1), PVar2 == PVar1 || (uVar3 == PVar1)); PVar1 = PVar1 - 1) {\n  }" for ( ; (parenthesized_expression "(PVar2 = ptrmapPageno(pBt,PVar1), PVar2 == PVar1 || (uVar3 == PVar1))" ( (comma_expression "PVar2 = ptrmapPageno(pBt,PVar1), PVar2 == PVar1 || (uVar3 == PVar1)" (assignment_expression "PVar2 = ptrmapPageno(pBt,PVar1)" identifier = (call_expression "ptrmapPageno(pBt,PVar1)" identifier (argument_list "(pBt,PVar1)" ( identifier , identifier )))) , (binary_expression "PVar2 == PVar1 || (uVar3 == PVar1)" (binary_expression "PVar2 == PVar1" identifier == identifier) || (parenthesized_expression "(uVar3 == PVar1)" ( (binary_expression "uVar3 == PVar1" identifier == identifier) )))) )) ; (assignment_expression "PVar1 = PVar1 - 1" identifier = (binary_expression "PVar1 - 1" identifier - number_literal)) ) (compound_statement "{\n  }" { })) (return_statement "return PVar1;" return identifier ;) })))
(translation_unit "uint FUN_00045af0(int param_1,uint param_2,int param_3)\n\n{\n  int iVar1;\n  uint uVar2;\n  uint uVar3;\n  uint uVar4;\n  \n  uVar3 = *(uint *)(param_1 + 0x24) / 5;\n  iVar1 = FUN_00045458();\n  if (uVar3 == 0) {\n    trap(7);\n  }\n  uVar3 = (param_2 - param_3) - (uVar3 + (param_3 - param_2) + iVar1) / uVar3;\n  if (*(uint *)(param_1 + 0x20) == 0) {\n    trap(7);\n  }\n  uVar4 = *(uint *)(PTR_DAT_0018f948 + -0x1b80) / *(uint *)(param_1 + 0x20) + 1;\n  if ((uVar4 < param_2) && (uVar3 < uVar4)) {\n    uVar3 = uVar3 - 1;\n  }\n  for (; (uVar2 = FUN_00045458(param_1,uVar3), uVar2 == uVar3 || (uVar4 == uVar3));\n      uVar3 = uVar3 - 1) {\n  }\n  return uVar3;\n}\n\n" (function_definition "uint FUN_00045af0(int param_1,uint param_2,int param_3)\n\n{\n  int iVar1;\n  uint uVar2;\n  uint uVar3;\n  uint uVar4;\n  \n  uVar3 = *(uint *)(param_1 + 0x24) / 5;\n  iVar1 = FUN_00045458();\n  if (uVar3 == 0) {\n    trap(7);\n  }\n  uVar3 = (param_2 - param_3) - (uVar3 + (param_3 - param_2) + iVar1) / uVar3;\n  if (*(uint *)(param_1 + 0x20) == 0) {\n    trap(7);\n  }\n  uVar4 = *(uint *)(PTR_DAT_0018f948 + -0x1b80) / *(uint *)(param_1 + 0x20) + 1;\n  if ((uVar4 < param_2) && (uVar3 < uVar4)) {\n    uVar3 = uVar3 - 1;\n  }\n  for (; (uVar2 = FUN_00045458(param_1,uVar3), uVar2 == uVar3 || (uVar4 == uVar3));\n      uVar3 = uVar3 - 1) {\n  }\n  return uVar3;\n}" type_identifier (function_declarator "FUN_00045af0(int param_1,uint param_2,int param_3)" identifier (parameter_list "(int param_1,uint param_2,int param_3)" ( (parameter_declaration "int param_1" primitive_type identifier) , (parameter_declaration "uint param_2" type_identifier identifier) , (parameter_declaration "int param_3" primitive_type identifier) ))) (compound_statement "{\n  int iVar1;\n  uint uVar2;\n  uint uVar3;\n  uint uVar4;\n  \n  uVar3 = *(uint *)(param_1 + 0x24) / 5;\n  iVar1 = FUN_00045458();\n  if (uVar3 == 0) {\n    trap(7);\n  }\n  uVar3 = (param_2 - param_3) - (uVar3 + (param_3 - param_2) + iVar1) / uVar3;\n  if (*(uint *)(param_1 + 0x20) == 0) {\n    trap(7);\n  }\n  uVar4 = *(uint *)(PTR_DAT_0018f948 + -0x1b80) / *(uint *)(param_1 + 0x20) + 1;\n  if ((uVar4 < param_2) && (uVar3 < uVar4)) {\n    uVar3 = uVar3 - 1;\n  }\n  for (; (uVar2 = FUN_00045458(param_1,uVar3), uVar2 == uVar3 || (uVar4 == uVar3));\n      uVar3 = uVar3 - 1) {\n  }\n  return uVar3;\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "uint uVar2;" type_identifier identifier ;) (declaration "uint uVar3;" type_identifier identifier ;) (declaration "uint uVar4;" type_identifier identifier ;) (expression_statement "uVar3 = *(uint *)(param_1 + 0x24) / 5;" (assignment_expression "uVar3 = *(uint *)(param_1 + 0x24) / 5" identifier = (binary_expression "*(uint *)(param_1 + 0x24) / 5" (pointer_expression "*(uint *)(param_1 + 0x24)" * (cast_expression "(uint *)(param_1 + 0x24)" ( (type_descriptor "uint *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x24)" ( (binary_expression "param_1 + 0x24" identifier + number_literal) )))) / number_literal)) ;) (expression_statement "iVar1 = FUN_00045458();" (assignment_expression "iVar1 = FUN_00045458()" identifier = (call_expression "FUN_00045458()" identifier (argument_list "()" ( )))) ;) (if_statement "if (uVar3 == 0) {\n    trap(7);\n  }" if (parenthesized_expression "(uVar3 == 0)" ( (binary_expression "uVar3 == 0" identifier == number_literal) )) (compound_statement "{\n    trap(7);\n  }" { (expression_statement "trap(7);" (call_expression "trap(7)" identifier (argument_list "(7)" ( number_literal ))) ;) })) (expression_statement "uVar3 = (param_2 - param_3) - (uVar3 + (param_3 - param_2) + iVar1) / uVar3;" (assignment_expression "uVar3 = (param_2 - param_3) - (uVar3 + (param_3 - param_2) + iVar1) / uVar3" identifier = (binary_expression "(param_2 - param_3) - (uVar3 + (param_3 - param_2) + iVar1) / uVar3" (parenthesized_expression "(param_2 - param_3)" ( (binary_expression "param_2 - param_3" identifier - identifier) )) - (binary_expression "(uVar3 + (param_3 - param_2) + iVar1) / uVar3" (parenthesized_expression "(uVar3 + (param_3 - param_2) + iVar1)" ( (binary_expression "uVar3 + (param_3 - param_2) + iVar1" (binary_expression "uVar3 + (param_3 - param_2)" identifier + (parenthesized_expression "(param_3 - param_2)" ( (binary_expression "param_3 - param_2" identifier - identifier) ))) + identifier) )) / identifier))) ;) (if_statement "if (*(uint *)(param_1 + 0x20) == 0) {\n    trap(7);\n  }" if (parenthesized_expression "(*(uint *)(param_1 + 0x20) == 0)" ( (binary_expression "*(uint *)(param_1 + 0x20) == 0" (pointer_expression "*(uint *)(param_1 + 0x20)" * (cast_expression "(uint *)(param_1 + 0x20)" ( (type_descriptor "uint *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x20)" ( (binary_expression "param_1 + 0x20" identifier + number_literal) )))) == number_literal) )) (compound_statement "{\n    trap(7);\n  }" { (expression_statement "trap(7);" (call_expression "trap(7)" identifier (argument_list "(7)" ( number_literal ))) ;) })) (expression_statement "uVar4 = *(uint *)(PTR_DAT_0018f948 + -0x1b80) / *(uint *)(param_1 + 0x20) + 1;" (assignment_expression "uVar4 = *(uint *)(PTR_DAT_0018f948 + -0x1b80) / *(uint *)(param_1 + 0x20) + 1" identifier = (binary_expression "*(uint *)(PTR_DAT_0018f948 + -0x1b80) / *(uint *)(param_1 + 0x20) + 1" (binary_expression "*(uint *)(PTR_DAT_0018f948 + -0x1b80) / *(uint *)(param_1 + 0x20)" (pointer_expression "*(uint *)(PTR_DAT_0018f948 + -0x1b80)" * (cast_expression "(uint *)(PTR_DAT_0018f948 + -0x1b80)" ( (type_descriptor "uint *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(PTR_DAT_0018f948 + -0x1b80)" ( (binary_expression "PTR_DAT_0018f948 + -0x1b80" identifier + number_literal) )))) / (pointer_expression "*(uint *)(param_1 + 0x20)" * (cast_expression "(uint *)(param_1 + 0x20)" ( (type_descriptor "uint *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x20)" ( (binary_expression "param_1 + 0x20" identifier + number_literal) ))))) + number_literal)) ;) (if_statement "if ((uVar4 < param_2) && (uVar3 < uVar4)) {\n    uVar3 = uVar3 - 1;\n  }" if (parenthesized_expression "((uVar4 < param_2) && (uVar3 < uVar4))" ( (binary_expression "(uVar4 < param_2) && (uVar3 < uVar4)" (parenthesized_expression "(uVar4 < param_2)" ( (binary_expression "uVar4 < param_2" identifier < identifier) )) && (parenthesized_expression "(uVar3 < uVar4)" ( (binary_expression "uVar3 < uVar4" identifier < identifier) ))) )) (compound_statement "{\n    uVar3 = uVar3 - 1;\n  }" { (expression_statement "uVar3 = uVar3 - 1;" (assignment_expression "uVar3 = uVar3 - 1" identifier = (binary_expression "uVar3 - 1" identifier - number_literal)) ;) })) (for_statement "for (; (uVar2 = FUN_00045458(param_1,uVar3), uVar2 == uVar3 || (uVar4 == uVar3));\n      uVar3 = uVar3 - 1) {\n  }" for ( ; (parenthesized_expression "(uVar2 = FUN_00045458(param_1,uVar3), uVar2 == uVar3 || (uVar4 == uVar3))" ( (comma_expression "uVar2 = FUN_00045458(param_1,uVar3), uVar2 == uVar3 || (uVar4 == uVar3)" (assignment_expression "uVar2 = FUN_00045458(param_1,uVar3)" identifier = (call_expression "FUN_00045458(param_1,uVar3)" identifier (argument_list "(param_1,uVar3)" ( identifier , identifier )))) , (binary_expression "uVar2 == uVar3 || (uVar4 == uVar3)" (binary_expression "uVar2 == uVar3" identifier == identifier) || (parenthesized_expression "(uVar4 == uVar3)" ( (binary_expression "uVar4 == uVar3" identifier == identifier) )))) )) ; (assignment_expression "uVar3 = uVar3 - 1" identifier = (binary_expression "uVar3 - 1" identifier - number_literal)) ) (compound_statement "{\n  }" { })) (return_statement "return uVar3;" return identifier ;) })))
(translation_unit (function_definition TYPE (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE IDENT) ))) (compound_statement { (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (expression_statement (assignment_expression IDENT = (binary_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) / LIT)) ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (expression_statement (call_expression IDENT (argument_list ( LIT ))) ;) })) (expression_statement (assignment_expression IDENT = (binary_expression (parenthesized_expression ( (binary_expression IDENT - IDENT) )) - (binary_expression (parenthesized_expression ( (binary_expression (binary_expression IDENT + (parenthesized_expression ( (binary_expression IDENT - IDENT) ))) + IDENT) )) / IDENT))) ;) (if_statement if (parenthesized_expression ( (binary_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) == LIT) )) (compound_statement { (expression_statement (call_expression IDENT (argument_list ( LIT ))) ;) })) (expression_statement (assignment_expression IDENT = (binary_expression (binary_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) / (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))))) + LIT)) ;) (if_statement if (parenthesized_expression ( (binary_expression (parenthesized_expression ( (binary_expression IDENT < IDENT) )) && (parenthesized_expression ( (binary_expression IDENT < IDENT) ))) )) (compound_statement { (expression_statement (assignment_expression IDENT = (binary_expression IDENT - LIT)) ;) })) (for_statement for ( ; (parenthesized_expression ( (comma_expression (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT , IDENT )))) , (binary_expression (binary_expression IDENT == IDENT) || (parenthesized_expression ( (binary_expression IDENT == IDENT) )))) )) ; (assignment_expression IDENT = (binary_expression IDENT - LIT)) ) (compound_statement { })) (return_statement return IDENT ;) })))
(function_definition "uint FUN_00045af0(int param_1,uint param_2,int param_3)\n\n{\n  int iVar1;\n  uint uVar2;\n  uint uVar3;\n  uint uVar4;\n  \n  uVar3 = *(uint *)(param_1 + 0x24) / 5;\n  iVar1 = FUN_00045458();\n  if (uVar3 == 0) {\n    trap(7);\n  }\n  uVar3 = (param_2 - param_3) - (uVar3 + (param_3 - param_2) + iVar1) / uVar3;\n  if (*(uint *)(param_1 + 0x20) == 0) {\n    trap(7);\n  }\n  uVar4 = *(uint *)(PTR_DAT_0018f948 + -0x1b80) / *(uint *)(param_1 + 0x20) + 1;\n  if ((uVar4 < param_2) && (uVar3 < uVar4)) {\n    uVar3 = uVar3 - 1;\n  }\n  for (; (uVar2 = FUN_00045458(param_1,uVar3), uVar2 == uVar3 || (uVar4 == uVar3));\n      uVar3 = uVar3 - 1) {\n  }\n  return uVar3;\n}" (type_identifier "uint") (function_declarator "FUN_00045af0(int param_1,uint param_2,int param_3)" (identifier "FUN_00045af0") (parameter_list "(int param_1,uint param_2,int param_3)" (( "(") (parameter_declaration "int param_1" (primitive_type "int") (identifier "param_1")) (, ",") (parameter_declaration "uint param_2" (type_identifier "uint") (identifier "param_2")) (, ",") (parameter_declaration "int param_3" (primitive_type "int") (identifier "param_3")) () ")"))) (compound_statement "{\n  int iVar1;\n  uint uVar2;\n  uint uVar3;\n  uint uVar4;\n  \n  uVar3 = *(uint *)(param_1 + 0x24) / 5;\n  iVar1 = FUN_00045458();\n  if (uVar3 == 0) {\n    trap(7);\n  }\n  uVar3 = (param_2 - param_3) - (uVar3 + (param_3 - param_2) + iVar1) / uVar3;\n  if (*(uint *)(param_1 + 0x20) == 0) {\n    trap(7);\n  }\n  uVar4 = *(uint *)(PTR_DAT_0018f948 + -0x1b80) / *(uint *)(param_1 + 0x20) + 1;\n  if ((uVar4 < param_2) && (uVar3 < uVar4)) {\n    uVar3 = uVar3 - 1;\n  }\n  for (; (uVar2 = FUN_00045458(param_1,uVar3), uVar2 == uVar3 || (uVar4 == uVar3));\n      uVar3 = uVar3 - 1) {\n  }\n  return uVar3;\n}" ({ "{") (declaration "int iVar1;" (primitive_type "int") (identifier "iVar1") (; ";")) (declaration "uint uVar2;" (type_identifier "uint") (identifier "uVar2") (; ";")) (declaration "uint uVar3;" (type_identifier "uint") (identifier "uVar3") (; ";")) (declaration "uint uVar4;" (type_identifier "uint") (identifier "uVar4") (; ";")) (expression_statement "uVar3 = *(uint *)(param_1 + 0x24) / 5;" (assignment_expression "uVar3 = *(uint *)(param_1 + 0x24) / 5" (identifier "uVar3") (= "=") (binary_expression "*(uint *)(param_1 + 0x24) / 5" (pointer_expression "*(uint *)(param_1 + 0x24)" (* "*") (cast_expression "(uint *)(param_1 + 0x24)" (( "(") (type_descriptor "uint *" (type_identifier "uint") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 0x24)" (( "(") (binary_expression "param_1 + 0x24" (identifier "param_1") (+ "+") (number_literal "0x24")) () ")")))) (/ "/") (number_literal "5"))) (; ";")) (expression_statement "iVar1 = FUN_00045458();" (assignment_expression "iVar1 = FUN_00045458()" (identifier "iVar1") (= "=") (call_expression "FUN_00045458()" (identifier "FUN_00045458") (argument_list "()" (( "(") () ")")))) (; ";")) (if_statement "if (uVar3 == 0) {\n    trap(7);\n  }" (if "if") (parenthesized_expression "(uVar3 == 0)" (( "(") (binary_expression "uVar3 == 0" (identifier "uVar3") (== "==") (number_literal "0")) () ")")) (compound_statement "{\n    trap(7);\n  }" ({ "{") (expression_statement "trap(7);" (call_expression "trap(7)" (identifier "trap") (argument_list "(7)" (( "(") (number_literal "7") () ")"))) (; ";")) (} "}"))) (expression_statement "uVar3 = (param_2 - param_3) - (uVar3 + (param_3 - param_2) + iVar1) / uVar3;" (assignment_expression "uVar3 = (param_2 - param_3) - (uVar3 + (param_3 - param_2) + iVar1) / uVar3" (identifier "uVar3") (= "=") (binary_expression "(param_2 - param_3) - (uVar3 + (param_3 - param_2) + iVar1) / uVar3" (parenthesized_expression "(param_2 - param_3)" (( "(") (binary_expression "param_2 - param_3" (identifier "param_2") (- "-") (identifier "param_3")) () ")")) (- "-") (binary_expression "(uVar3 + (param_3 - param_2) + iVar1) / uVar3" (parenthesized_expression "(uVar3 + (param_3 - param_2) + iVar1)" (( "(") (binary_expression "uVar3 + (param_3 - param_2) + iVar1" (binary_expression "uVar3 + (param_3 - param_2)" (identifier "uVar3") (+ "+") (parenthesized_expression "(param_3 - param_2)" (( "(") (binary_expression "param_3 - param_2" (identifier "param_3") (- "-") (identifier "param_2")) () ")"))) (+ "+") (identifier "iVar1")) () ")")) (/ "/") (identifier "uVar3")))) (; ";")) (if_statement "if (*(uint *)(param_1 + 0x20) == 0) {\n    trap(7);\n  }" (if "if") (parenthesized_expression "(*(uint *)(param_1 + 0x20) == 0)" (( "(") (binary_expression "*(uint *)(param_1 + 0x20) == 0" (pointer_expression "*(uint *)(param_1 + 0x20)" (* "*") (cast_expression "(uint *)(param_1 + 0x20)" (( "(") (type_descriptor "uint *" (type_identifier "uint") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 0x20)" (( "(") (binary_expression "param_1 + 0x20" (identifier "param_1") (+ "+") (number_literal "0x20")) () ")")))) (== "==") (number_literal "0")) () ")")) (compound_statement "{\n    trap(7);\n  }" ({ "{") (expression_statement "trap(7);" (call_expression "trap(7)" (identifier "trap") (argument_list "(7)" (( "(") (number_literal "7") () ")"))) (; ";")) (} "}"))) (expression_statement "uVar4 = *(uint *)(PTR_DAT_0018f948 + -0x1b80) / *(uint *)(param_1 + 0x20) + 1;" (assignment_expression "uVar4 = *(uint *)(PTR_DAT_0018f948 + -0x1b80) / *(uint *)(param_1 + 0x20) + 1" (identifier "uVar4") (= "=") (binary_expression "*(uint *)(PTR_DAT_0018f948 + -0x1b80) / *(uint *)(param_1 + 0x20) + 1" (binary_expression "*(uint *)(PTR_DAT_0018f948 + -0x1b80) / *(uint *)(param_1 + 0x20)" (pointer_expression "*(uint *)(PTR_DAT_0018f948 + -0x1b80)" (* "*") (cast_expression "(uint *)(PTR_DAT_0018f948 + -0x1b80)" (( "(") (type_descriptor "uint *" (type_identifier "uint") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(PTR_DAT_0018f948 + -0x1b80)" (( "(") (binary_expression "PTR_DAT_0018f948 + -0x1b80" (identifier "PTR_DAT_0018f948") (+ "+") (number_literal "-0x1b80")) () ")")))) (/ "/") (pointer_expression "*(uint *)(param_1 + 0x20)" (* "*") (cast_expression "(uint *)(param_1 + 0x20)" (( "(") (type_descriptor "uint *" (type_identifier "uint") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 0x20)" (( "(") (binary_expression "param_1 + 0x20" (identifier "param_1") (+ "+") (number_literal "0x20")) () ")"))))) (+ "+") (number_literal "1"))) (; ";")) (if_statement "if ((uVar4 < param_2) && (uVar3 < uVar4)) {\n    uVar3 = uVar3 - 1;\n  }" (if "if") (parenthesized_expression "((uVar4 < param_2) && (uVar3 < uVar4))" (( "(") (binary_expression "(uVar4 < param_2) && (uVar3 < uVar4)" (parenthesized_expression "(uVar4 < param_2)" (( "(") (binary_expression "uVar4 < param_2" (identifier "uVar4") (< "<") (identifier "param_2")) () ")")) (&& "&&") (parenthesized_expression "(uVar3 < uVar4)" (( "(") (binary_expression "uVar3 < uVar4" (identifier "uVar3") (< "<") (identifier "uVar4")) () ")"))) () ")")) (compound_statement "{\n    uVar3 = uVar3 - 1;\n  }" ({ "{") (expression_statement "uVar3 = uVar3 - 1;" (assignment_expression "uVar3 = uVar3 - 1" (identifier "uVar3") (= "=") (binary_expression "uVar3 - 1" (identifier "uVar3") (- "-") (number_literal "1"))) (; ";")) (} "}"))) (for_statement "for (; (uVar2 = FUN_00045458(param_1,uVar3), uVar2 == uVar3 || (uVar4 == uVar3));\n      uVar3 = uVar3 - 1) {\n  }" (for "for") (( "(") (; ";") (parenthesized_expression "(uVar2 = FUN_00045458(param_1,uVar3), uVar2 == uVar3 || (uVar4 == uVar3))" (( "(") (comma_expression "uVar2 = FUN_00045458(param_1,uVar3), uVar2 == uVar3 || (uVar4 == uVar3)" (assignment_expression "uVar2 = FUN_00045458(param_1,uVar3)" (identifier "uVar2") (= "=") (call_expression "FUN_00045458(param_1,uVar3)" (identifier "FUN_00045458") (argument_list "(param_1,uVar3)" (( "(") (identifier "param_1") (, ",") (identifier "uVar3") () ")")))) (, ",") (binary_expression "uVar2 == uVar3 || (uVar4 == uVar3)" (binary_expression "uVar2 == uVar3" (identifier "uVar2") (== "==") (identifier "uVar3")) (|| "||") (parenthesized_expression "(uVar4 == uVar3)" (( "(") (binary_expression "uVar4 == uVar3" (identifier "uVar4") (== "==") (identifier "uVar3")) () ")")))) () ")")) (; ";") (assignment_expression "uVar3 = uVar3 - 1" (identifier "uVar3") (= "=") (binary_expression "uVar3 - 1" (identifier "uVar3") (- "-") (number_literal "1"))) () ")") (compound_statement "{\n  }" ({ "{") (} "}"))) (return_statement "return uVar3;" (return "return") (identifier "uVar3") (; ";")) (} "}")))

type_1 function_1(type_2 *pBt,type_1 var_4,type_1 var_5)

{
  type_1 var_6;
  type_1 var_8;
  type_3 var_2;
  
  var_2 = pBt->usableSize / 5;
  var_6 = var_1(pBt,var_4);
  if (var_2 == 0) {
    var_3(7);
  }
  var_6 = (var_4 - var_5) - (var_2 + (var_5 - var_4) + var_6) / var_2;
  if (pBt->pageSize == 0) {
    var_3(7);
  }
  var_2 = *(type_3 *)(var_7 + -0x1b80) / pBt->pageSize + 1;
  if ((var_2 < var_4) && (var_6 < var_2)) {
    var_6 = var_6 - 1;
  }
  for (; (var_8 = var_1(pBt,var_6), var_8 == var_6 || (var_2 == var_6)); var_6 = var_6 - 1) {
  }
  return var_6;
}


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

uint MASKED(int param_1,uint param_2,int param_3)

{
  int iVar1;
  uint uVar2;
  uint uVar3;
  uint uVar4;
  
  uVar3 = *(uint *)(param_1 + 0x24) / 5;
  iVar1 = FUN_00045458();
  if (uVar3 == 0) {
    trap(7);
  }
  uVar3 = (param_2 - param_3) - (uVar3 + (param_3 - param_2) + iVar1) / uVar3;
  if (*(uint *)(param_1 + 0x20) == 0) {
    trap(7);
  }
  uVar4 = *(uint *)(PTR_DAT_0018f948 + -0x1b80) / *(uint *)(param_1 + 0x20) + 1;
  if ((uVar4 < param_2) && (uVar3 < uVar4)) {
    uVar3 = uVar3 - 1;
  }
  for (; (uVar2 = FUN_00045458(param_1,uVar3), uVar2 == uVar3 || (uVar4 == uVar3));
      uVar3 = uVar3 - 1) {
  }
  return uVar3;
}

