
/* DWARF original prototype: void btreeParseCellAdjustSizeForOverflow(MemPage * pPage, u8 * pCell,
   CellInfo * pInfo, MemPage * pPage, MemPage * pPage) */

void btreeParseCellAdjustSizeForOverflow
               (MemPage *pPage,u8 *pCell,CellInfo *pInfo,MemPage *pPage_1,MemPage *pPage_2)

{
  uint uVar1;
  undefined4 uVar2;
  u16 uVar4;
  undefined4 uVar3;
  
  uVar1 = *(int *)&pInfo[1].nLocal - 4;
  if (uVar1 == 0) {
    trap(7);
  }
  if ((int)pPage < (int)(pCell + (uint)(*(int *)&pPage_2->nOverflow - (int)pCell) % uVar1)) {
    uVar2._0_1_ = pPage_2->leaf;
    uVar2._1_1_ = pPage_2->hdrOffset;
    uVar2._2_1_ = pPage_2->childPtrSize;
    uVar2._3_1_ = pPage_2->max1bytePayload;
    pPage_2->minLocal = (u16)pCell;
    pPage_2->cellOffset = (((short)uVar2 + (u16)pCell) - (short)pPage_1) + 4;
    return;
  }
  uVar4 = (u16)(pCell + (uint)(*(int *)&pPage_2->nOverflow - (int)pCell) % uVar1);
  pPage_2->minLocal = uVar4;
  uVar3._0_1_ = pPage_2->leaf;
  uVar3._1_1_ = pPage_2->hdrOffset;
  uVar3._2_1_ = pPage_2->childPtrSize;
  uVar3._3_1_ = pPage_2->max1bytePayload;
  pPage_2->cellOffset = (((short)uVar3 + uVar4) - (short)pPage_1) + 4;
  return;
}



void FUN_0002d618(int param_1,int param_2,int param_3,short param_4,int param_5)

{
  uint uVar1;
  int iVar2;
  short sVar3;
  
  uVar1 = *(int *)(param_3 + 0x28) - 4;
  if (uVar1 == 0) {
    trap(7);
  }
  iVar2 = (uint)(*(int *)(param_5 + 0xc) - param_2) % uVar1 + param_2;
  if (param_1 < iVar2) {
    *(short *)(param_5 + 0x10) = (short)param_2;
    *(short *)(param_5 + 0x12) =
         (((short)*(undefined4 *)(param_5 + 8) + (short)param_2) - param_4) + 4;
    return;
  }
  sVar3 = (short)iVar2;
  *(short *)(param_5 + 0x10) = sVar3;
  *(short *)(param_5 + 0x12) = (((short)*(undefined4 *)(param_5 + 8) + sVar3) - param_4) + 4;
  return;
}


lw t0,0x10(sp)
lw v0,0x28(a2)
lw v1,0xc(t0)
addiu v0,v0,-0x4
subu v1,v1,a1
teq v0,zero
divu v1,v0
mfhi v0
addu v0,v0,a1
slt a0,a0,v0
beq a0,zero,0x0002d664
_nop
lw v0,0x8(t0)
sh a1,0x10(t0)
addu a1,v0,a1
subu a3,a1,a3
addiu a3,a3,0x4
jr ra
_sh a3,0x12(t0)
sh v0,0x10(t0)
andi a1,v0,0xffff
lw v0,0x8(t0)
addu a1,v0,a1
subu a3,a1,a3
addiu a3,a3,0x4
jr ra
_sh a3,0x12(t0)
(translation_unit "void FUN_0002d618(int param_1,int param_2,int param_3,short param_4,int param_5)\n\n{\n  uint uVar1;\n  int iVar2;\n  short sVar3;\n  \n  uVar1 = *(int *)(param_3 + 0x28) - 4;\n  if (uVar1 == 0) {\n    trap(7);\n  }\n  iVar2 = (uint)(*(int *)(param_5 + 0xc) - param_2) % uVar1 + param_2;\n  if (param_1 < iVar2) {\n    *(short *)(param_5 + 0x10) = (short)param_2;\n    *(short *)(param_5 + 0x12) =\n         (((short)*(undefined4 *)(param_5 + 8) + (short)param_2) - param_4) + 4;\n    return;\n  }\n  sVar3 = (short)iVar2;\n  *(short *)(param_5 + 0x10) = sVar3;\n  *(short *)(param_5 + 0x12) = (((short)*(undefined4 *)(param_5 + 8) + sVar3) - param_4) + 4;\n  return;\n}\n\n" (function_definition "void FUN_0002d618(int param_1,int param_2,int param_3,short param_4,int param_5)\n\n{\n  uint uVar1;\n  int iVar2;\n  short sVar3;\n  \n  uVar1 = *(int *)(param_3 + 0x28) - 4;\n  if (uVar1 == 0) {\n    trap(7);\n  }\n  iVar2 = (uint)(*(int *)(param_5 + 0xc) - param_2) % uVar1 + param_2;\n  if (param_1 < iVar2) {\n    *(short *)(param_5 + 0x10) = (short)param_2;\n    *(short *)(param_5 + 0x12) =\n         (((short)*(undefined4 *)(param_5 + 8) + (short)param_2) - param_4) + 4;\n    return;\n  }\n  sVar3 = (short)iVar2;\n  *(short *)(param_5 + 0x10) = sVar3;\n  *(short *)(param_5 + 0x12) = (((short)*(undefined4 *)(param_5 + 8) + sVar3) - param_4) + 4;\n  return;\n}" primitive_type (function_declarator "FUN_0002d618(int param_1,int param_2,int param_3,short param_4,int param_5)" identifier (parameter_list "(int param_1,int param_2,int param_3,short param_4,int param_5)" ( (parameter_declaration "int param_1" primitive_type identifier) , (parameter_declaration "int param_2" primitive_type identifier) , (parameter_declaration "int param_3" primitive_type identifier) , (parameter_declaration "short param_4" (sized_type_specifier "short" short) identifier) , (parameter_declaration "int param_5" primitive_type identifier) ))) (compound_statement "{\n  uint uVar1;\n  int iVar2;\n  short sVar3;\n  \n  uVar1 = *(int *)(param_3 + 0x28) - 4;\n  if (uVar1 == 0) {\n    trap(7);\n  }\n  iVar2 = (uint)(*(int *)(param_5 + 0xc) - param_2) % uVar1 + param_2;\n  if (param_1 < iVar2) {\n    *(short *)(param_5 + 0x10) = (short)param_2;\n    *(short *)(param_5 + 0x12) =\n         (((short)*(undefined4 *)(param_5 + 8) + (short)param_2) - param_4) + 4;\n    return;\n  }\n  sVar3 = (short)iVar2;\n  *(short *)(param_5 + 0x10) = sVar3;\n  *(short *)(param_5 + 0x12) = (((short)*(undefined4 *)(param_5 + 8) + sVar3) - param_4) + 4;\n  return;\n}" { (declaration "uint uVar1;" type_identifier identifier ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "short sVar3;" (sized_type_specifier "short" short) identifier ;) (expression_statement "uVar1 = *(int *)(param_3 + 0x28) - 4;" (assignment_expression "uVar1 = *(int *)(param_3 + 0x28) - 4" identifier = (binary_expression "*(int *)(param_3 + 0x28) - 4" (pointer_expression "*(int *)(param_3 + 0x28)" * (cast_expression "(int *)(param_3 + 0x28)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_3 + 0x28)" ( (binary_expression "param_3 + 0x28" identifier + number_literal) )))) - number_literal)) ;) (if_statement "if (uVar1 == 0) {\n    trap(7);\n  }" if (parenthesized_expression "(uVar1 == 0)" ( (binary_expression "uVar1 == 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 "iVar2 = (uint)(*(int *)(param_5 + 0xc) - param_2) % uVar1 + param_2;" (assignment_expression "iVar2 = (uint)(*(int *)(param_5 + 0xc) - param_2) % uVar1 + param_2" identifier = (binary_expression "(uint)(*(int *)(param_5 + 0xc) - param_2) % uVar1 + param_2" (binary_expression "(uint)(*(int *)(param_5 + 0xc) - param_2) % uVar1" (call_expression "(uint)(*(int *)(param_5 + 0xc) - param_2)" (parenthesized_expression "(uint)" ( identifier )) (argument_list "(*(int *)(param_5 + 0xc) - param_2)" ( (binary_expression "*(int *)(param_5 + 0xc) - param_2" (pointer_expression "*(int *)(param_5 + 0xc)" * (cast_expression "(int *)(param_5 + 0xc)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_5 + 0xc)" ( (binary_expression "param_5 + 0xc" identifier + number_literal) )))) - identifier) ))) % identifier) + identifier)) ;) (if_statement "if (param_1 < iVar2) {\n    *(short *)(param_5 + 0x10) = (short)param_2;\n    *(short *)(param_5 + 0x12) =\n         (((short)*(undefined4 *)(param_5 + 8) + (short)param_2) - param_4) + 4;\n    return;\n  }" if (parenthesized_expression "(param_1 < iVar2)" ( (binary_expression "param_1 < iVar2" identifier < identifier) )) (compound_statement "{\n    *(short *)(param_5 + 0x10) = (short)param_2;\n    *(short *)(param_5 + 0x12) =\n         (((short)*(undefined4 *)(param_5 + 8) + (short)param_2) - param_4) + 4;\n    return;\n  }" { (expression_statement "*(short *)(param_5 + 0x10) = (short)param_2;" (assignment_expression "*(short *)(param_5 + 0x10) = (short)param_2" (pointer_expression "*(short *)(param_5 + 0x10)" * (cast_expression "(short *)(param_5 + 0x10)" ( (type_descriptor "short *" (sized_type_specifier "short" short) (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_5 + 0x10)" ( (binary_expression "param_5 + 0x10" identifier + number_literal) )))) = (cast_expression "(short)param_2" ( (type_descriptor "short" (sized_type_specifier "short" short)) ) identifier)) ;) (expression_statement "*(short *)(param_5 + 0x12) =\n         (((short)*(undefined4 *)(param_5 + 8) + (short)param_2) - param_4) + 4;" (assignment_expression "*(short *)(param_5 + 0x12) =\n         (((short)*(undefined4 *)(param_5 + 8) + (short)param_2) - param_4) + 4" (pointer_expression "*(short *)(param_5 + 0x12)" * (cast_expression "(short *)(param_5 + 0x12)" ( (type_descriptor "short *" (sized_type_specifier "short" short) (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_5 + 0x12)" ( (binary_expression "param_5 + 0x12" identifier + number_literal) )))) = (binary_expression "(((short)*(undefined4 *)(param_5 + 8) + (short)param_2) - param_4) + 4" (parenthesized_expression "(((short)*(undefined4 *)(param_5 + 8) + (short)param_2) - param_4)" ( (binary_expression "((short)*(undefined4 *)(param_5 + 8) + (short)param_2) - param_4" (parenthesized_expression "((short)*(undefined4 *)(param_5 + 8) + (short)param_2)" ( (binary_expression "(short)*(undefined4 *)(param_5 + 8) + (short)param_2" (cast_expression "(short)*(undefined4 *)(param_5 + 8)" ( (type_descriptor "short" (sized_type_specifier "short" short)) ) (pointer_expression "*(undefined4 *)(param_5 + 8)" * (cast_expression "(undefined4 *)(param_5 + 8)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_5 + 8)" ( (binary_expression "param_5 + 8" identifier + number_literal) ))))) + (cast_expression "(short)param_2" ( (type_descriptor "short" (sized_type_specifier "short" short)) ) identifier)) )) - identifier) )) + number_literal)) ;) (return_statement "return;" return ;) })) (expression_statement "sVar3 = (short)iVar2;" (assignment_expression "sVar3 = (short)iVar2" identifier = (cast_expression "(short)iVar2" ( (type_descriptor "short" (sized_type_specifier "short" short)) ) identifier)) ;) (expression_statement "*(short *)(param_5 + 0x10) = sVar3;" (assignment_expression "*(short *)(param_5 + 0x10) = sVar3" (pointer_expression "*(short *)(param_5 + 0x10)" * (cast_expression "(short *)(param_5 + 0x10)" ( (type_descriptor "short *" (sized_type_specifier "short" short) (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_5 + 0x10)" ( (binary_expression "param_5 + 0x10" identifier + number_literal) )))) = identifier) ;) (expression_statement "*(short *)(param_5 + 0x12) = (((short)*(undefined4 *)(param_5 + 8) + sVar3) - param_4) + 4;" (assignment_expression "*(short *)(param_5 + 0x12) = (((short)*(undefined4 *)(param_5 + 8) + sVar3) - param_4) + 4" (pointer_expression "*(short *)(param_5 + 0x12)" * (cast_expression "(short *)(param_5 + 0x12)" ( (type_descriptor "short *" (sized_type_specifier "short" short) (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_5 + 0x12)" ( (binary_expression "param_5 + 0x12" identifier + number_literal) )))) = (binary_expression "(((short)*(undefined4 *)(param_5 + 8) + sVar3) - param_4) + 4" (parenthesized_expression "(((short)*(undefined4 *)(param_5 + 8) + sVar3) - param_4)" ( (binary_expression "((short)*(undefined4 *)(param_5 + 8) + sVar3) - param_4" (parenthesized_expression "((short)*(undefined4 *)(param_5 + 8) + sVar3)" ( (binary_expression "(short)*(undefined4 *)(param_5 + 8) + sVar3" (cast_expression "(short)*(undefined4 *)(param_5 + 8)" ( (type_descriptor "short" (sized_type_specifier "short" short)) ) (pointer_expression "*(undefined4 *)(param_5 + 8)" * (cast_expression "(undefined4 *)(param_5 + 8)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_5 + 8)" ( (binary_expression "param_5 + 8" identifier + number_literal) ))))) + identifier) )) - identifier) )) + number_literal)) ;) (return_statement "return;" return ;) })))
(translation_unit "/* DWARF original prototype: void btreeParseCellAdjustSizeForOverflow(MemPage * pPage, u8 * pCell,\n   CellInfo * pInfo, MemPage * pPage, MemPage * pPage) */\n\nvoid btreeParseCellAdjustSizeForOverflow\n               (MemPage *pPage,u8 *pCell,CellInfo *pInfo,MemPage *pPage_1,MemPage *pPage_2)\n\n{\n  uint uVar1;\n  undefined4 uVar2;\n  u16 uVar4;\n  undefined4 uVar3;\n  \n  uVar1 = *(int *)&pInfo[1].nLocal - 4;\n  if (uVar1 == 0) {\n    trap(7);\n  }\n  if ((int)pPage < (int)(pCell + (uint)(*(int *)&pPage_2->nOverflow - (int)pCell) % uVar1)) {\n    uVar2._0_1_ = pPage_2->leaf;\n    uVar2._1_1_ = pPage_2->hdrOffset;\n    uVar2._2_1_ = pPage_2->childPtrSize;\n    uVar2._3_1_ = pPage_2->max1bytePayload;\n    pPage_2->minLocal = (u16)pCell;\n    pPage_2->cellOffset = (((short)uVar2 + (u16)pCell) - (short)pPage_1) + 4;\n    return;\n  }\n  uVar4 = (u16)(pCell + (uint)(*(int *)&pPage_2->nOverflow - (int)pCell) % uVar1);\n  pPage_2->minLocal = uVar4;\n  uVar3._0_1_ = pPage_2->leaf;\n  uVar3._1_1_ = pPage_2->hdrOffset;\n  uVar3._2_1_ = pPage_2->childPtrSize;\n  uVar3._3_1_ = pPage_2->max1bytePayload;\n  pPage_2->cellOffset = (((short)uVar3 + uVar4) - (short)pPage_1) + 4;\n  return;\n}\n\n" comment (function_definition "void btreeParseCellAdjustSizeForOverflow\n               (MemPage *pPage,u8 *pCell,CellInfo *pInfo,MemPage *pPage_1,MemPage *pPage_2)\n\n{\n  uint uVar1;\n  undefined4 uVar2;\n  u16 uVar4;\n  undefined4 uVar3;\n  \n  uVar1 = *(int *)&pInfo[1].nLocal - 4;\n  if (uVar1 == 0) {\n    trap(7);\n  }\n  if ((int)pPage < (int)(pCell + (uint)(*(int *)&pPage_2->nOverflow - (int)pCell) % uVar1)) {\n    uVar2._0_1_ = pPage_2->leaf;\n    uVar2._1_1_ = pPage_2->hdrOffset;\n    uVar2._2_1_ = pPage_2->childPtrSize;\n    uVar2._3_1_ = pPage_2->max1bytePayload;\n    pPage_2->minLocal = (u16)pCell;\n    pPage_2->cellOffset = (((short)uVar2 + (u16)pCell) - (short)pPage_1) + 4;\n    return;\n  }\n  uVar4 = (u16)(pCell + (uint)(*(int *)&pPage_2->nOverflow - (int)pCell) % uVar1);\n  pPage_2->minLocal = uVar4;\n  uVar3._0_1_ = pPage_2->leaf;\n  uVar3._1_1_ = pPage_2->hdrOffset;\n  uVar3._2_1_ = pPage_2->childPtrSize;\n  uVar3._3_1_ = pPage_2->max1bytePayload;\n  pPage_2->cellOffset = (((short)uVar3 + uVar4) - (short)pPage_1) + 4;\n  return;\n}" primitive_type (function_declarator "btreeParseCellAdjustSizeForOverflow\n               (MemPage *pPage,u8 *pCell,CellInfo *pInfo,MemPage *pPage_1,MemPage *pPage_2)" identifier (parameter_list "(MemPage *pPage,u8 *pCell,CellInfo *pInfo,MemPage *pPage_1,MemPage *pPage_2)" ( (parameter_declaration "MemPage *pPage" type_identifier (pointer_declarator "*pPage" * identifier)) , (parameter_declaration "u8 *pCell" type_identifier (pointer_declarator "*pCell" * identifier)) , (parameter_declaration "CellInfo *pInfo" type_identifier (pointer_declarator "*pInfo" * identifier)) , (parameter_declaration "MemPage *pPage_1" type_identifier (pointer_declarator "*pPage_1" * identifier)) , (parameter_declaration "MemPage *pPage_2" type_identifier (pointer_declarator "*pPage_2" * identifier)) ))) (compound_statement "{\n  uint uVar1;\n  undefined4 uVar2;\n  u16 uVar4;\n  undefined4 uVar3;\n  \n  uVar1 = *(int *)&pInfo[1].nLocal - 4;\n  if (uVar1 == 0) {\n    trap(7);\n  }\n  if ((int)pPage < (int)(pCell + (uint)(*(int *)&pPage_2->nOverflow - (int)pCell) % uVar1)) {\n    uVar2._0_1_ = pPage_2->leaf;\n    uVar2._1_1_ = pPage_2->hdrOffset;\n    uVar2._2_1_ = pPage_2->childPtrSize;\n    uVar2._3_1_ = pPage_2->max1bytePayload;\n    pPage_2->minLocal = (u16)pCell;\n    pPage_2->cellOffset = (((short)uVar2 + (u16)pCell) - (short)pPage_1) + 4;\n    return;\n  }\n  uVar4 = (u16)(pCell + (uint)(*(int *)&pPage_2->nOverflow - (int)pCell) % uVar1);\n  pPage_2->minLocal = uVar4;\n  uVar3._0_1_ = pPage_2->leaf;\n  uVar3._1_1_ = pPage_2->hdrOffset;\n  uVar3._2_1_ = pPage_2->childPtrSize;\n  uVar3._3_1_ = pPage_2->max1bytePayload;\n  pPage_2->cellOffset = (((short)uVar3 + uVar4) - (short)pPage_1) + 4;\n  return;\n}" { (declaration "uint uVar1;" type_identifier identifier ;) (declaration "undefined4 uVar2;" type_identifier identifier ;) (declaration "u16 uVar4;" type_identifier identifier ;) (declaration "undefined4 uVar3;" type_identifier identifier ;) (expression_statement "uVar1 = *(int *)&pInfo[1].nLocal - 4;" (assignment_expression "uVar1 = *(int *)&pInfo[1].nLocal - 4" identifier = (binary_expression "*(int *)&pInfo[1].nLocal - 4" (pointer_expression "*(int *)&pInfo[1].nLocal" * (cast_expression "(int *)&pInfo[1].nLocal" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (pointer_expression "&pInfo[1].nLocal" & (field_expression "pInfo[1].nLocal" (subscript_expression "pInfo[1]" identifier [ number_literal ]) . field_identifier)))) - number_literal)) ;) (if_statement "if (uVar1 == 0) {\n    trap(7);\n  }" if (parenthesized_expression "(uVar1 == 0)" ( (binary_expression "uVar1 == 0" identifier == number_literal) )) (compound_statement "{\n    trap(7);\n  }" { (expression_statement "trap(7);" (call_expression "trap(7)" identifier (argument_list "(7)" ( number_literal ))) ;) })) (if_statement "if ((int)pPage < (int)(pCell + (uint)(*(int *)&pPage_2->nOverflow - (int)pCell) % uVar1)) {\n    uVar2._0_1_ = pPage_2->leaf;\n    uVar2._1_1_ = pPage_2->hdrOffset;\n    uVar2._2_1_ = pPage_2->childPtrSize;\n    uVar2._3_1_ = pPage_2->max1bytePayload;\n    pPage_2->minLocal = (u16)pCell;\n    pPage_2->cellOffset = (((short)uVar2 + (u16)pCell) - (short)pPage_1) + 4;\n    return;\n  }" if (parenthesized_expression "((int)pPage < (int)(pCell + (uint)(*(int *)&pPage_2->nOverflow - (int)pCell) % uVar1))" ( (binary_expression "(int)pPage < (int)(pCell + (uint)(*(int *)&pPage_2->nOverflow - (int)pCell) % uVar1)" (cast_expression "(int)pPage" ( (type_descriptor "int" primitive_type) ) identifier) < (cast_expression "(int)(pCell + (uint)(*(int *)&pPage_2->nOverflow - (int)pCell) % uVar1)" ( (type_descriptor "int" primitive_type) ) (parenthesized_expression "(pCell + (uint)(*(int *)&pPage_2->nOverflow - (int)pCell) % uVar1)" ( (binary_expression "pCell + (uint)(*(int *)&pPage_2->nOverflow - (int)pCell) % uVar1" identifier + (binary_expression "(uint)(*(int *)&pPage_2->nOverflow - (int)pCell) % uVar1" (call_expression "(uint)(*(int *)&pPage_2->nOverflow - (int)pCell)" (parenthesized_expression "(uint)" ( identifier )) (argument_list "(*(int *)&pPage_2->nOverflow - (int)pCell)" ( (binary_expression "*(int *)&pPage_2->nOverflow - (int)pCell" (pointer_expression "*(int *)&pPage_2->nOverflow" * (cast_expression "(int *)&pPage_2->nOverflow" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (pointer_expression "&pPage_2->nOverflow" & (field_expression "pPage_2->nOverflow" identifier -> field_identifier)))) - (cast_expression "(int)pCell" ( (type_descriptor "int" primitive_type) ) identifier)) ))) % identifier)) )))) )) (compound_statement "{\n    uVar2._0_1_ = pPage_2->leaf;\n    uVar2._1_1_ = pPage_2->hdrOffset;\n    uVar2._2_1_ = pPage_2->childPtrSize;\n    uVar2._3_1_ = pPage_2->max1bytePayload;\n    pPage_2->minLocal = (u16)pCell;\n    pPage_2->cellOffset = (((short)uVar2 + (u16)pCell) - (short)pPage_1) + 4;\n    return;\n  }" { (expression_statement "uVar2._0_1_ = pPage_2->leaf;" (assignment_expression "uVar2._0_1_ = pPage_2->leaf" (field_expression "uVar2._0_1_" identifier . field_identifier) = (field_expression "pPage_2->leaf" identifier -> field_identifier)) ;) (expression_statement "uVar2._1_1_ = pPage_2->hdrOffset;" (assignment_expression "uVar2._1_1_ = pPage_2->hdrOffset" (field_expression "uVar2._1_1_" identifier . field_identifier) = (field_expression "pPage_2->hdrOffset" identifier -> field_identifier)) ;) (expression_statement "uVar2._2_1_ = pPage_2->childPtrSize;" (assignment_expression "uVar2._2_1_ = pPage_2->childPtrSize" (field_expression "uVar2._2_1_" identifier . field_identifier) = (field_expression "pPage_2->childPtrSize" identifier -> field_identifier)) ;) (expression_statement "uVar2._3_1_ = pPage_2->max1bytePayload;" (assignment_expression "uVar2._3_1_ = pPage_2->max1bytePayload" (field_expression "uVar2._3_1_" identifier . field_identifier) = (field_expression "pPage_2->max1bytePayload" identifier -> field_identifier)) ;) (expression_statement "pPage_2->minLocal = (u16)pCell;" (assignment_expression "pPage_2->minLocal = (u16)pCell" (field_expression "pPage_2->minLocal" identifier -> field_identifier) = (cast_expression "(u16)pCell" ( (type_descriptor "u16" type_identifier) ) identifier)) ;) (expression_statement "pPage_2->cellOffset = (((short)uVar2 + (u16)pCell) - (short)pPage_1) + 4;" (assignment_expression "pPage_2->cellOffset = (((short)uVar2 + (u16)pCell) - (short)pPage_1) + 4" (field_expression "pPage_2->cellOffset" identifier -> field_identifier) = (binary_expression "(((short)uVar2 + (u16)pCell) - (short)pPage_1) + 4" (parenthesized_expression "(((short)uVar2 + (u16)pCell) - (short)pPage_1)" ( (binary_expression "((short)uVar2 + (u16)pCell) - (short)pPage_1" (parenthesized_expression "((short)uVar2 + (u16)pCell)" ( (binary_expression "(short)uVar2 + (u16)pCell" (cast_expression "(short)uVar2" ( (type_descriptor "short" (sized_type_specifier "short" short)) ) identifier) + (cast_expression "(u16)pCell" ( (type_descriptor "u16" type_identifier) ) identifier)) )) - (cast_expression "(short)pPage_1" ( (type_descriptor "short" (sized_type_specifier "short" short)) ) identifier)) )) + number_literal)) ;) (return_statement "return;" return ;) })) (expression_statement "uVar4 = (u16)(pCell + (uint)(*(int *)&pPage_2->nOverflow - (int)pCell) % uVar1);" (assignment_expression "uVar4 = (u16)(pCell + (uint)(*(int *)&pPage_2->nOverflow - (int)pCell) % uVar1)" identifier = (call_expression "(u16)(pCell + (uint)(*(int *)&pPage_2->nOverflow - (int)pCell) % uVar1)" (parenthesized_expression "(u16)" ( identifier )) (argument_list "(pCell + (uint)(*(int *)&pPage_2->nOverflow - (int)pCell) % uVar1)" ( (binary_expression "pCell + (uint)(*(int *)&pPage_2->nOverflow - (int)pCell) % uVar1" identifier + (binary_expression "(uint)(*(int *)&pPage_2->nOverflow - (int)pCell) % uVar1" (call_expression "(uint)(*(int *)&pPage_2->nOverflow - (int)pCell)" (parenthesized_expression "(uint)" ( identifier )) (argument_list "(*(int *)&pPage_2->nOverflow - (int)pCell)" ( (binary_expression "*(int *)&pPage_2->nOverflow - (int)pCell" (pointer_expression "*(int *)&pPage_2->nOverflow" * (cast_expression "(int *)&pPage_2->nOverflow" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (pointer_expression "&pPage_2->nOverflow" & (field_expression "pPage_2->nOverflow" identifier -> field_identifier)))) - (cast_expression "(int)pCell" ( (type_descriptor "int" primitive_type) ) identifier)) ))) % identifier)) )))) ;) (expression_statement "pPage_2->minLocal = uVar4;" (assignment_expression "pPage_2->minLocal = uVar4" (field_expression "pPage_2->minLocal" identifier -> field_identifier) = identifier) ;) (expression_statement "uVar3._0_1_ = pPage_2->leaf;" (assignment_expression "uVar3._0_1_ = pPage_2->leaf" (field_expression "uVar3._0_1_" identifier . field_identifier) = (field_expression "pPage_2->leaf" identifier -> field_identifier)) ;) (expression_statement "uVar3._1_1_ = pPage_2->hdrOffset;" (assignment_expression "uVar3._1_1_ = pPage_2->hdrOffset" (field_expression "uVar3._1_1_" identifier . field_identifier) = (field_expression "pPage_2->hdrOffset" identifier -> field_identifier)) ;) (expression_statement "uVar3._2_1_ = pPage_2->childPtrSize;" (assignment_expression "uVar3._2_1_ = pPage_2->childPtrSize" (field_expression "uVar3._2_1_" identifier . field_identifier) = (field_expression "pPage_2->childPtrSize" identifier -> field_identifier)) ;) (expression_statement "uVar3._3_1_ = pPage_2->max1bytePayload;" (assignment_expression "uVar3._3_1_ = pPage_2->max1bytePayload" (field_expression "uVar3._3_1_" identifier . field_identifier) = (field_expression "pPage_2->max1bytePayload" identifier -> field_identifier)) ;) (expression_statement "pPage_2->cellOffset = (((short)uVar3 + uVar4) - (short)pPage_1) + 4;" (assignment_expression "pPage_2->cellOffset = (((short)uVar3 + uVar4) - (short)pPage_1) + 4" (field_expression "pPage_2->cellOffset" identifier -> field_identifier) = (binary_expression "(((short)uVar3 + uVar4) - (short)pPage_1) + 4" (parenthesized_expression "(((short)uVar3 + uVar4) - (short)pPage_1)" ( (binary_expression "((short)uVar3 + uVar4) - (short)pPage_1" (parenthesized_expression "((short)uVar3 + uVar4)" ( (binary_expression "(short)uVar3 + uVar4" (cast_expression "(short)uVar3" ( (type_descriptor "short" (sized_type_specifier "short" short)) ) identifier) + identifier) )) - (cast_expression "(short)pPage_1" ( (type_descriptor "short" (sized_type_specifier "short" short)) ) identifier)) )) + number_literal)) ;) (return_statement "return;" return ;) })))
(translation_unit "void FUN_0002d618(int param_1,int param_2,int param_3,short param_4,int param_5)\n\n{\n  uint uVar1;\n  int iVar2;\n  short sVar3;\n  \n  uVar1 = *(int *)(param_3 + 0x28) - 4;\n  if (uVar1 == 0) {\n    trap(7);\n  }\n  iVar2 = (uint)(*(int *)(param_5 + 0xc) - param_2) % uVar1 + param_2;\n  if (param_1 < iVar2) {\n    *(short *)(param_5 + 0x10) = (short)param_2;\n    *(short *)(param_5 + 0x12) =\n         (((short)*(undefined4 *)(param_5 + 8) + (short)param_2) - param_4) + 4;\n    return;\n  }\n  sVar3 = (short)iVar2;\n  *(short *)(param_5 + 0x10) = sVar3;\n  *(short *)(param_5 + 0x12) = (((short)*(undefined4 *)(param_5 + 8) + sVar3) - param_4) + 4;\n  return;\n}\n\n" (function_definition "void FUN_0002d618(int param_1,int param_2,int param_3,short param_4,int param_5)\n\n{\n  uint uVar1;\n  int iVar2;\n  short sVar3;\n  \n  uVar1 = *(int *)(param_3 + 0x28) - 4;\n  if (uVar1 == 0) {\n    trap(7);\n  }\n  iVar2 = (uint)(*(int *)(param_5 + 0xc) - param_2) % uVar1 + param_2;\n  if (param_1 < iVar2) {\n    *(short *)(param_5 + 0x10) = (short)param_2;\n    *(short *)(param_5 + 0x12) =\n         (((short)*(undefined4 *)(param_5 + 8) + (short)param_2) - param_4) + 4;\n    return;\n  }\n  sVar3 = (short)iVar2;\n  *(short *)(param_5 + 0x10) = sVar3;\n  *(short *)(param_5 + 0x12) = (((short)*(undefined4 *)(param_5 + 8) + sVar3) - param_4) + 4;\n  return;\n}" primitive_type (function_declarator "FUN_0002d618(int param_1,int param_2,int param_3,short param_4,int param_5)" identifier (parameter_list "(int param_1,int param_2,int param_3,short param_4,int param_5)" ( (parameter_declaration "int param_1" primitive_type identifier) , (parameter_declaration "int param_2" primitive_type identifier) , (parameter_declaration "int param_3" primitive_type identifier) , (parameter_declaration "short param_4" (sized_type_specifier "short" short) identifier) , (parameter_declaration "int param_5" primitive_type identifier) ))) (compound_statement "{\n  uint uVar1;\n  int iVar2;\n  short sVar3;\n  \n  uVar1 = *(int *)(param_3 + 0x28) - 4;\n  if (uVar1 == 0) {\n    trap(7);\n  }\n  iVar2 = (uint)(*(int *)(param_5 + 0xc) - param_2) % uVar1 + param_2;\n  if (param_1 < iVar2) {\n    *(short *)(param_5 + 0x10) = (short)param_2;\n    *(short *)(param_5 + 0x12) =\n         (((short)*(undefined4 *)(param_5 + 8) + (short)param_2) - param_4) + 4;\n    return;\n  }\n  sVar3 = (short)iVar2;\n  *(short *)(param_5 + 0x10) = sVar3;\n  *(short *)(param_5 + 0x12) = (((short)*(undefined4 *)(param_5 + 8) + sVar3) - param_4) + 4;\n  return;\n}" { (declaration "uint uVar1;" type_identifier identifier ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "short sVar3;" (sized_type_specifier "short" short) identifier ;) (expression_statement "uVar1 = *(int *)(param_3 + 0x28) - 4;" (assignment_expression "uVar1 = *(int *)(param_3 + 0x28) - 4" identifier = (binary_expression "*(int *)(param_3 + 0x28) - 4" (pointer_expression "*(int *)(param_3 + 0x28)" * (cast_expression "(int *)(param_3 + 0x28)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_3 + 0x28)" ( (binary_expression "param_3 + 0x28" identifier + number_literal) )))) - number_literal)) ;) (if_statement "if (uVar1 == 0) {\n    trap(7);\n  }" if (parenthesized_expression "(uVar1 == 0)" ( (binary_expression "uVar1 == 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 "iVar2 = (uint)(*(int *)(param_5 + 0xc) - param_2) % uVar1 + param_2;" (assignment_expression "iVar2 = (uint)(*(int *)(param_5 + 0xc) - param_2) % uVar1 + param_2" identifier = (binary_expression "(uint)(*(int *)(param_5 + 0xc) - param_2) % uVar1 + param_2" (binary_expression "(uint)(*(int *)(param_5 + 0xc) - param_2) % uVar1" (call_expression "(uint)(*(int *)(param_5 + 0xc) - param_2)" (parenthesized_expression "(uint)" ( identifier )) (argument_list "(*(int *)(param_5 + 0xc) - param_2)" ( (binary_expression "*(int *)(param_5 + 0xc) - param_2" (pointer_expression "*(int *)(param_5 + 0xc)" * (cast_expression "(int *)(param_5 + 0xc)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_5 + 0xc)" ( (binary_expression "param_5 + 0xc" identifier + number_literal) )))) - identifier) ))) % identifier) + identifier)) ;) (if_statement "if (param_1 < iVar2) {\n    *(short *)(param_5 + 0x10) = (short)param_2;\n    *(short *)(param_5 + 0x12) =\n         (((short)*(undefined4 *)(param_5 + 8) + (short)param_2) - param_4) + 4;\n    return;\n  }" if (parenthesized_expression "(param_1 < iVar2)" ( (binary_expression "param_1 < iVar2" identifier < identifier) )) (compound_statement "{\n    *(short *)(param_5 + 0x10) = (short)param_2;\n    *(short *)(param_5 + 0x12) =\n         (((short)*(undefined4 *)(param_5 + 8) + (short)param_2) - param_4) + 4;\n    return;\n  }" { (expression_statement "*(short *)(param_5 + 0x10) = (short)param_2;" (assignment_expression "*(short *)(param_5 + 0x10) = (short)param_2" (pointer_expression "*(short *)(param_5 + 0x10)" * (cast_expression "(short *)(param_5 + 0x10)" ( (type_descriptor "short *" (sized_type_specifier "short" short) (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_5 + 0x10)" ( (binary_expression "param_5 + 0x10" identifier + number_literal) )))) = (cast_expression "(short)param_2" ( (type_descriptor "short" (sized_type_specifier "short" short)) ) identifier)) ;) (expression_statement "*(short *)(param_5 + 0x12) =\n         (((short)*(undefined4 *)(param_5 + 8) + (short)param_2) - param_4) + 4;" (assignment_expression "*(short *)(param_5 + 0x12) =\n         (((short)*(undefined4 *)(param_5 + 8) + (short)param_2) - param_4) + 4" (pointer_expression "*(short *)(param_5 + 0x12)" * (cast_expression "(short *)(param_5 + 0x12)" ( (type_descriptor "short *" (sized_type_specifier "short" short) (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_5 + 0x12)" ( (binary_expression "param_5 + 0x12" identifier + number_literal) )))) = (binary_expression "(((short)*(undefined4 *)(param_5 + 8) + (short)param_2) - param_4) + 4" (parenthesized_expression "(((short)*(undefined4 *)(param_5 + 8) + (short)param_2) - param_4)" ( (binary_expression "((short)*(undefined4 *)(param_5 + 8) + (short)param_2) - param_4" (parenthesized_expression "((short)*(undefined4 *)(param_5 + 8) + (short)param_2)" ( (binary_expression "(short)*(undefined4 *)(param_5 + 8) + (short)param_2" (cast_expression "(short)*(undefined4 *)(param_5 + 8)" ( (type_descriptor "short" (sized_type_specifier "short" short)) ) (pointer_expression "*(undefined4 *)(param_5 + 8)" * (cast_expression "(undefined4 *)(param_5 + 8)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_5 + 8)" ( (binary_expression "param_5 + 8" identifier + number_literal) ))))) + (cast_expression "(short)param_2" ( (type_descriptor "short" (sized_type_specifier "short" short)) ) identifier)) )) - identifier) )) + number_literal)) ;) (return_statement "return;" return ;) })) (expression_statement "sVar3 = (short)iVar2;" (assignment_expression "sVar3 = (short)iVar2" identifier = (cast_expression "(short)iVar2" ( (type_descriptor "short" (sized_type_specifier "short" short)) ) identifier)) ;) (expression_statement "*(short *)(param_5 + 0x10) = sVar3;" (assignment_expression "*(short *)(param_5 + 0x10) = sVar3" (pointer_expression "*(short *)(param_5 + 0x10)" * (cast_expression "(short *)(param_5 + 0x10)" ( (type_descriptor "short *" (sized_type_specifier "short" short) (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_5 + 0x10)" ( (binary_expression "param_5 + 0x10" identifier + number_literal) )))) = identifier) ;) (expression_statement "*(short *)(param_5 + 0x12) = (((short)*(undefined4 *)(param_5 + 8) + sVar3) - param_4) + 4;" (assignment_expression "*(short *)(param_5 + 0x12) = (((short)*(undefined4 *)(param_5 + 8) + sVar3) - param_4) + 4" (pointer_expression "*(short *)(param_5 + 0x12)" * (cast_expression "(short *)(param_5 + 0x12)" ( (type_descriptor "short *" (sized_type_specifier "short" short) (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_5 + 0x12)" ( (binary_expression "param_5 + 0x12" identifier + number_literal) )))) = (binary_expression "(((short)*(undefined4 *)(param_5 + 8) + sVar3) - param_4) + 4" (parenthesized_expression "(((short)*(undefined4 *)(param_5 + 8) + sVar3) - param_4)" ( (binary_expression "((short)*(undefined4 *)(param_5 + 8) + sVar3) - param_4" (parenthesized_expression "((short)*(undefined4 *)(param_5 + 8) + sVar3)" ( (binary_expression "(short)*(undefined4 *)(param_5 + 8) + sVar3" (cast_expression "(short)*(undefined4 *)(param_5 + 8)" ( (type_descriptor "short" (sized_type_specifier "short" short)) ) (pointer_expression "*(undefined4 *)(param_5 + 8)" * (cast_expression "(undefined4 *)(param_5 + 8)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_5 + 8)" ( (binary_expression "param_5 + 8" identifier + number_literal) ))))) + identifier) )) - identifier) )) + number_literal)) ;) (return_statement "return;" return ;) })))
(translation_unit (function_definition TYPE (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE IDENT) , (parameter_declaration (sized_type_specifier short) IDENT) , (parameter_declaration TYPE IDENT) ))) (compound_statement { (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration (sized_type_specifier short) 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)) ;) (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 (binary_expression (call_expression (parenthesized_expression ( IDENT )) (argument_list ( (binary_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) - IDENT) ))) % IDENT) + IDENT)) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT < IDENT) )) (compound_statement { (expression_statement (assignment_expression (pointer_expression * (cast_expression ( (type_descriptor (sized_type_specifier short) (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) = (cast_expression ( (type_descriptor (sized_type_specifier short)) ) IDENT)) ;) (expression_statement (assignment_expression (pointer_expression * (cast_expression ( (type_descriptor (sized_type_specifier short) (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) = (binary_expression (parenthesized_expression ( (binary_expression (parenthesized_expression ( (binary_expression (cast_expression ( (type_descriptor (sized_type_specifier short)) ) (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))))) + (cast_expression ( (type_descriptor (sized_type_specifier short)) ) IDENT)) )) - IDENT) )) + LIT)) ;) (return_statement return ;) })) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor (sized_type_specifier short)) ) IDENT)) ;) (expression_statement (assignment_expression (pointer_expression * (cast_expression ( (type_descriptor (sized_type_specifier short) (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) = IDENT) ;) (expression_statement (assignment_expression (pointer_expression * (cast_expression ( (type_descriptor (sized_type_specifier short) (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) = (binary_expression (parenthesized_expression ( (binary_expression (parenthesized_expression ( (binary_expression (cast_expression ( (type_descriptor (sized_type_specifier short)) ) (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))))) + IDENT) )) - IDENT) )) + LIT)) ;) (return_statement return ;) })))
(function_definition "void FUN_0002d618(int param_1,int param_2,int param_3,short param_4,int param_5)\n\n{\n  uint uVar1;\n  int iVar2;\n  short sVar3;\n  \n  uVar1 = *(int *)(param_3 + 0x28) - 4;\n  if (uVar1 == 0) {\n    trap(7);\n  }\n  iVar2 = (uint)(*(int *)(param_5 + 0xc) - param_2) % uVar1 + param_2;\n  if (param_1 < iVar2) {\n    *(short *)(param_5 + 0x10) = (short)param_2;\n    *(short *)(param_5 + 0x12) =\n         (((short)*(undefined4 *)(param_5 + 8) + (short)param_2) - param_4) + 4;\n    return;\n  }\n  sVar3 = (short)iVar2;\n  *(short *)(param_5 + 0x10) = sVar3;\n  *(short *)(param_5 + 0x12) = (((short)*(undefined4 *)(param_5 + 8) + sVar3) - param_4) + 4;\n  return;\n}" (primitive_type "void") (function_declarator "FUN_0002d618(int param_1,int param_2,int param_3,short param_4,int param_5)" (identifier "FUN_0002d618") (parameter_list "(int param_1,int param_2,int param_3,short param_4,int param_5)" (( "(") (parameter_declaration "int param_1" (primitive_type "int") (identifier "param_1")) (, ",") (parameter_declaration "int param_2" (primitive_type "int") (identifier "param_2")) (, ",") (parameter_declaration "int param_3" (primitive_type "int") (identifier "param_3")) (, ",") (parameter_declaration "short param_4" (sized_type_specifier "short" (short "short")) (identifier "param_4")) (, ",") (parameter_declaration "int param_5" (primitive_type "int") (identifier "param_5")) () ")"))) (compound_statement "{\n  uint uVar1;\n  int iVar2;\n  short sVar3;\n  \n  uVar1 = *(int *)(param_3 + 0x28) - 4;\n  if (uVar1 == 0) {\n    trap(7);\n  }\n  iVar2 = (uint)(*(int *)(param_5 + 0xc) - param_2) % uVar1 + param_2;\n  if (param_1 < iVar2) {\n    *(short *)(param_5 + 0x10) = (short)param_2;\n    *(short *)(param_5 + 0x12) =\n         (((short)*(undefined4 *)(param_5 + 8) + (short)param_2) - param_4) + 4;\n    return;\n  }\n  sVar3 = (short)iVar2;\n  *(short *)(param_5 + 0x10) = sVar3;\n  *(short *)(param_5 + 0x12) = (((short)*(undefined4 *)(param_5 + 8) + sVar3) - param_4) + 4;\n  return;\n}" ({ "{") (declaration "uint uVar1;" (type_identifier "uint") (identifier "uVar1") (; ";")) (declaration "int iVar2;" (primitive_type "int") (identifier "iVar2") (; ";")) (declaration "short sVar3;" (sized_type_specifier "short" (short "short")) (identifier "sVar3") (; ";")) (expression_statement "uVar1 = *(int *)(param_3 + 0x28) - 4;" (assignment_expression "uVar1 = *(int *)(param_3 + 0x28) - 4" (identifier "uVar1") (= "=") (binary_expression "*(int *)(param_3 + 0x28) - 4" (pointer_expression "*(int *)(param_3 + 0x28)" (* "*") (cast_expression "(int *)(param_3 + 0x28)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_3 + 0x28)" (( "(") (binary_expression "param_3 + 0x28" (identifier "param_3") (+ "+") (number_literal "0x28")) () ")")))) (- "-") (number_literal "4"))) (; ";")) (if_statement "if (uVar1 == 0) {\n    trap(7);\n  }" (if "if") (parenthesized_expression "(uVar1 == 0)" (( "(") (binary_expression "uVar1 == 0" (identifier "uVar1") (== "==") (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 "iVar2 = (uint)(*(int *)(param_5 + 0xc) - param_2) % uVar1 + param_2;" (assignment_expression "iVar2 = (uint)(*(int *)(param_5 + 0xc) - param_2) % uVar1 + param_2" (identifier "iVar2") (= "=") (binary_expression "(uint)(*(int *)(param_5 + 0xc) - param_2) % uVar1 + param_2" (binary_expression "(uint)(*(int *)(param_5 + 0xc) - param_2) % uVar1" (call_expression "(uint)(*(int *)(param_5 + 0xc) - param_2)" (parenthesized_expression "(uint)" (( "(") (identifier "uint") () ")")) (argument_list "(*(int *)(param_5 + 0xc) - param_2)" (( "(") (binary_expression "*(int *)(param_5 + 0xc) - param_2" (pointer_expression "*(int *)(param_5 + 0xc)" (* "*") (cast_expression "(int *)(param_5 + 0xc)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_5 + 0xc)" (( "(") (binary_expression "param_5 + 0xc" (identifier "param_5") (+ "+") (number_literal "0xc")) () ")")))) (- "-") (identifier "param_2")) () ")"))) (% "%") (identifier "uVar1")) (+ "+") (identifier "param_2"))) (; ";")) (if_statement "if (param_1 < iVar2) {\n    *(short *)(param_5 + 0x10) = (short)param_2;\n    *(short *)(param_5 + 0x12) =\n         (((short)*(undefined4 *)(param_5 + 8) + (short)param_2) - param_4) + 4;\n    return;\n  }" (if "if") (parenthesized_expression "(param_1 < iVar2)" (( "(") (binary_expression "param_1 < iVar2" (identifier "param_1") (< "<") (identifier "iVar2")) () ")")) (compound_statement "{\n    *(short *)(param_5 + 0x10) = (short)param_2;\n    *(short *)(param_5 + 0x12) =\n         (((short)*(undefined4 *)(param_5 + 8) + (short)param_2) - param_4) + 4;\n    return;\n  }" ({ "{") (expression_statement "*(short *)(param_5 + 0x10) = (short)param_2;" (assignment_expression "*(short *)(param_5 + 0x10) = (short)param_2" (pointer_expression "*(short *)(param_5 + 0x10)" (* "*") (cast_expression "(short *)(param_5 + 0x10)" (( "(") (type_descriptor "short *" (sized_type_specifier "short" (short "short")) (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_5 + 0x10)" (( "(") (binary_expression "param_5 + 0x10" (identifier "param_5") (+ "+") (number_literal "0x10")) () ")")))) (= "=") (cast_expression "(short)param_2" (( "(") (type_descriptor "short" (sized_type_specifier "short" (short "short"))) () ")") (identifier "param_2"))) (; ";")) (expression_statement "*(short *)(param_5 + 0x12) =\n         (((short)*(undefined4 *)(param_5 + 8) + (short)param_2) - param_4) + 4;" (assignment_expression "*(short *)(param_5 + 0x12) =\n         (((short)*(undefined4 *)(param_5 + 8) + (short)param_2) - param_4) + 4" (pointer_expression "*(short *)(param_5 + 0x12)" (* "*") (cast_expression "(short *)(param_5 + 0x12)" (( "(") (type_descriptor "short *" (sized_type_specifier "short" (short "short")) (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_5 + 0x12)" (( "(") (binary_expression "param_5 + 0x12" (identifier "param_5") (+ "+") (number_literal "0x12")) () ")")))) (= "=") (binary_expression "(((short)*(undefined4 *)(param_5 + 8) + (short)param_2) - param_4) + 4" (parenthesized_expression "(((short)*(undefined4 *)(param_5 + 8) + (short)param_2) - param_4)" (( "(") (binary_expression "((short)*(undefined4 *)(param_5 + 8) + (short)param_2) - param_4" (parenthesized_expression "((short)*(undefined4 *)(param_5 + 8) + (short)param_2)" (( "(") (binary_expression "(short)*(undefined4 *)(param_5 + 8) + (short)param_2" (cast_expression "(short)*(undefined4 *)(param_5 + 8)" (( "(") (type_descriptor "short" (sized_type_specifier "short" (short "short"))) () ")") (pointer_expression "*(undefined4 *)(param_5 + 8)" (* "*") (cast_expression "(undefined4 *)(param_5 + 8)" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_5 + 8)" (( "(") (binary_expression "param_5 + 8" (identifier "param_5") (+ "+") (number_literal "8")) () ")"))))) (+ "+") (cast_expression "(short)param_2" (( "(") (type_descriptor "short" (sized_type_specifier "short" (short "short"))) () ")") (identifier "param_2"))) () ")")) (- "-") (identifier "param_4")) () ")")) (+ "+") (number_literal "4"))) (; ";")) (return_statement "return;" (return "return") (; ";")) (} "}"))) (expression_statement "sVar3 = (short)iVar2;" (assignment_expression "sVar3 = (short)iVar2" (identifier "sVar3") (= "=") (cast_expression "(short)iVar2" (( "(") (type_descriptor "short" (sized_type_specifier "short" (short "short"))) () ")") (identifier "iVar2"))) (; ";")) (expression_statement "*(short *)(param_5 + 0x10) = sVar3;" (assignment_expression "*(short *)(param_5 + 0x10) = sVar3" (pointer_expression "*(short *)(param_5 + 0x10)" (* "*") (cast_expression "(short *)(param_5 + 0x10)" (( "(") (type_descriptor "short *" (sized_type_specifier "short" (short "short")) (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_5 + 0x10)" (( "(") (binary_expression "param_5 + 0x10" (identifier "param_5") (+ "+") (number_literal "0x10")) () ")")))) (= "=") (identifier "sVar3")) (; ";")) (expression_statement "*(short *)(param_5 + 0x12) = (((short)*(undefined4 *)(param_5 + 8) + sVar3) - param_4) + 4;" (assignment_expression "*(short *)(param_5 + 0x12) = (((short)*(undefined4 *)(param_5 + 8) + sVar3) - param_4) + 4" (pointer_expression "*(short *)(param_5 + 0x12)" (* "*") (cast_expression "(short *)(param_5 + 0x12)" (( "(") (type_descriptor "short *" (sized_type_specifier "short" (short "short")) (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_5 + 0x12)" (( "(") (binary_expression "param_5 + 0x12" (identifier "param_5") (+ "+") (number_literal "0x12")) () ")")))) (= "=") (binary_expression "(((short)*(undefined4 *)(param_5 + 8) + sVar3) - param_4) + 4" (parenthesized_expression "(((short)*(undefined4 *)(param_5 + 8) + sVar3) - param_4)" (( "(") (binary_expression "((short)*(undefined4 *)(param_5 + 8) + sVar3) - param_4" (parenthesized_expression "((short)*(undefined4 *)(param_5 + 8) + sVar3)" (( "(") (binary_expression "(short)*(undefined4 *)(param_5 + 8) + sVar3" (cast_expression "(short)*(undefined4 *)(param_5 + 8)" (( "(") (type_descriptor "short" (sized_type_specifier "short" (short "short"))) () ")") (pointer_expression "*(undefined4 *)(param_5 + 8)" (* "*") (cast_expression "(undefined4 *)(param_5 + 8)" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_5 + 8)" (( "(") (binary_expression "param_5 + 8" (identifier "param_5") (+ "+") (number_literal "8")) () ")"))))) (+ "+") (identifier "sVar3")) () ")")) (- "-") (identifier "param_4")) () ")")) (+ "+") (number_literal "4"))) (; ";")) (return_statement "return;" (return "return") (; ";")) (} "}")))

/* DWARF original prototype: void btreeParseCellAdjustSizeForOverflow(MemPage * pPage, u8 * pCell,
   CellInfo * pInfo, MemPage * pPage, MemPage * pPage) */

void function_1
               (type_1 *pPage,type_2 *var_3,type_3 *pInfo,type_1 *pPage_1,type_1 *pPage_2)

{
  type_4 var_1;
  type_5 uVar2;
  type_6 var_4;
  type_5 uVar3;
  
  var_1 = *(int *)&pInfo[1].nLocal - 4;
  if (var_1 == 0) {
    var_2(7);
  }
  if ((int)pPage < (int)(var_3 + (type_4)(*(int *)&pPage_2->nOverflow - (int)var_3) % var_1)) {
    uVar2._0_1_ = pPage_2->leaf;
    uVar2._1_1_ = pPage_2->hdrOffset;
    uVar2._2_1_ = pPage_2->childPtrSize;
    uVar2._3_1_ = pPage_2->max1bytePayload;
    pPage_2->minLocal = (type_6)var_3;
    pPage_2->cellOffset = (((short)uVar2 + (type_6)var_3) - (short)pPage_1) + 4;
    return;
  }
  var_4 = (type_6)(var_3 + (type_4)(*(int *)&pPage_2->nOverflow - (int)var_3) % var_1);
  pPage_2->minLocal = var_4;
  uVar3._0_1_ = pPage_2->leaf;
  uVar3._1_1_ = pPage_2->hdrOffset;
  uVar3._2_1_ = pPage_2->childPtrSize;
  uVar3._3_1_ = pPage_2->max1bytePayload;
  pPage_2->cellOffset = (((short)uVar3 + var_4) - (short)pPage_1) + 4;
  return;
}


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

void MASKED(int param_1,int param_2,int param_3,short param_4,int param_5)

{
  uint uVar1;
  int iVar2;
  short sVar3;
  
  uVar1 = *(int *)(param_3 + 0x28) - 4;
  if (uVar1 == 0) {
    trap(7);
  }
  iVar2 = (uint)(*(int *)(param_5 + 0xc) - param_2) % uVar1 + param_2;
  if (param_1 < iVar2) {
    *(short *)(param_5 + 0x10) = (short)param_2;
    *(short *)(param_5 + 0x12) =
         (((short)*(undefined4 *)(param_5 + 8) + (short)param_2) - param_4) + 4;
    return;
  }
  sVar3 = (short)iVar2;
  *(short *)(param_5 + 0x10) = sVar3;
  *(short *)(param_5 + 0x12) = (((short)*(undefined4 *)(param_5 + 8) + sVar3) - param_4) + 4;
  return;
}

