
int sqlite3BtreePutData(BtCursor *pCsr,u32 offset,u32 amt,void *z)

{
  byte bVar2;
  int iVar1;
  
  bVar2 = pCsr->eState;
  if (2 < bVar2) {
    iVar1 = btreeRestoreCursorPosition(pCsr);
    if (iVar1 != 0) {
      return iVar1;
    }
    bVar2 = pCsr->eState;
  }
  if (bVar2 == 0) {
    saveAllCursors((BtShared *)pCsr->pBt->pCursor,pCsr->pgnoRoot,pCsr);
    if ((pCsr->curFlags & 1) != 0) {
      iVar1 = accessPayload(pCsr,offset,amt,(uchar *)z,1);
      return iVar1;
    }
    return 8;
  }
  return 4;
}



int FUN_0008610c(byte *param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4)

{
  byte bVar2;
  int iVar1;
  
  bVar2 = *param_1;
  if (2 < bVar2) {
    iVar1 = FUN_00084890();
    if (iVar1 != 0) {
      return iVar1;
    }
    bVar2 = *param_1;
  }
  if (bVar2 == 0) {
    FUN_00082da0(*(undefined4 *)(*(int *)(param_1 + 0x14) + 8),*(undefined4 *)(param_1 + 0x40),
                 param_1);
    if ((param_1[1] & 1) != 0) {
      iVar1 = FUN_000825f8(param_1,param_2,param_3,param_4,1);
      return iVar1;
    }
    return 8;
  }
  return 4;
}


lui gp,0x7
addiu gp,gp,0x7194
addu gp,gp,t9
addiu sp,sp,-0x38
sw s3,0x30(sp)
or s3,a3,zero
sw s2,0x2c(sp)
or s2,a2,zero
sw s1,0x28(sp)
or s1,a1,zero
sw s0,0x24(sp)
sw gp,0x18(sp)
sw ra,0x34(sp)
lbu v0,0x0(a0)
sltiu v1,v0,0x3
beq v1,zero,0x000861e0
_or s0,a0,zero
bne v0,zero,0x000861c0
_or a2,s0,zero
lw v0,0x14(s0)
lw t9,-0x7fac(gp)
lw a1,0x40(s0)
addiu t9,t9,0x2da0
bal 0x00082da0
_lw a0,0x8(v0)
lbu v0,0x1(s0)
andi v0,v0,0x1
beq v0,zero,0x00086200
_lw gp,0x18(sp)
lw t9,-0x7fac(gp)
li v0,0x1
or a3,s3,zero
sw v0,0x10(sp)
or a2,s2,zero
addiu t9,t9,0x25f8
or a1,s1,zero
bal 0x000825f8
_or a0,s0,zero
lw ra,0x34(sp)
lw s3,0x30(sp)
lw s2,0x2c(sp)
lw s1,0x28(sp)
lw s0,0x24(sp)
jr ra
_addiu sp,sp,0x38
lw ra,0x34(sp)
li v0,0x4
lw s3,0x30(sp)
lw s2,0x2c(sp)
lw s1,0x28(sp)
lw s0,0x24(sp)
jr ra
_addiu sp,sp,0x38
lw t9,-0x7fac(gp)
addiu t9,t9,0x4890
bal 0x00084890
_nop
bne v0,zero,0x000861a4
_lw gp,0x18(sp)
b 0x00086150
_lbu v0,0x0(s0)
lw ra,0x34(sp)
li v0,0x8
lw s3,0x30(sp)
lw s2,0x2c(sp)
lw s1,0x28(sp)
lw s0,0x24(sp)
jr ra
_addiu sp,sp,0x38
(translation_unit "int FUN_0008610c(byte *param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4)\n\n{\n  byte bVar2;\n  int iVar1;\n  \n  bVar2 = *param_1;\n  if (2 < bVar2) {\n    iVar1 = FUN_00084890();\n    if (iVar1 != 0) {\n      return iVar1;\n    }\n    bVar2 = *param_1;\n  }\n  if (bVar2 == 0) {\n    FUN_00082da0(*(undefined4 *)(*(int *)(param_1 + 0x14) + 8),*(undefined4 *)(param_1 + 0x40),\n                 param_1);\n    if ((param_1[1] & 1) != 0) {\n      iVar1 = FUN_000825f8(param_1,param_2,param_3,param_4,1);\n      return iVar1;\n    }\n    return 8;\n  }\n  return 4;\n}\n\n" (function_definition "int FUN_0008610c(byte *param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4)\n\n{\n  byte bVar2;\n  int iVar1;\n  \n  bVar2 = *param_1;\n  if (2 < bVar2) {\n    iVar1 = FUN_00084890();\n    if (iVar1 != 0) {\n      return iVar1;\n    }\n    bVar2 = *param_1;\n  }\n  if (bVar2 == 0) {\n    FUN_00082da0(*(undefined4 *)(*(int *)(param_1 + 0x14) + 8),*(undefined4 *)(param_1 + 0x40),\n                 param_1);\n    if ((param_1[1] & 1) != 0) {\n      iVar1 = FUN_000825f8(param_1,param_2,param_3,param_4,1);\n      return iVar1;\n    }\n    return 8;\n  }\n  return 4;\n}" primitive_type (function_declarator "FUN_0008610c(byte *param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4)" identifier (parameter_list "(byte *param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4)" ( (parameter_declaration "byte *param_1" type_identifier (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "undefined4 param_2" type_identifier identifier) , (parameter_declaration "undefined4 param_3" type_identifier identifier) , (parameter_declaration "undefined4 param_4" type_identifier identifier) ))) (compound_statement "{\n  byte bVar2;\n  int iVar1;\n  \n  bVar2 = *param_1;\n  if (2 < bVar2) {\n    iVar1 = FUN_00084890();\n    if (iVar1 != 0) {\n      return iVar1;\n    }\n    bVar2 = *param_1;\n  }\n  if (bVar2 == 0) {\n    FUN_00082da0(*(undefined4 *)(*(int *)(param_1 + 0x14) + 8),*(undefined4 *)(param_1 + 0x40),\n                 param_1);\n    if ((param_1[1] & 1) != 0) {\n      iVar1 = FUN_000825f8(param_1,param_2,param_3,param_4,1);\n      return iVar1;\n    }\n    return 8;\n  }\n  return 4;\n}" { (declaration "byte bVar2;" type_identifier identifier ;) (declaration "int iVar1;" primitive_type identifier ;) (expression_statement "bVar2 = *param_1;" (assignment_expression "bVar2 = *param_1" identifier = (pointer_expression "*param_1" * identifier)) ;) (if_statement "if (2 < bVar2) {\n    iVar1 = FUN_00084890();\n    if (iVar1 != 0) {\n      return iVar1;\n    }\n    bVar2 = *param_1;\n  }" if (parenthesized_expression "(2 < bVar2)" ( (binary_expression "2 < bVar2" number_literal < identifier) )) (compound_statement "{\n    iVar1 = FUN_00084890();\n    if (iVar1 != 0) {\n      return iVar1;\n    }\n    bVar2 = *param_1;\n  }" { (expression_statement "iVar1 = FUN_00084890();" (assignment_expression "iVar1 = FUN_00084890()" identifier = (call_expression "FUN_00084890()" identifier (argument_list "()" ( )))) ;) (if_statement "if (iVar1 != 0) {\n      return iVar1;\n    }" if (parenthesized_expression "(iVar1 != 0)" ( (binary_expression "iVar1 != 0" identifier != number_literal) )) (compound_statement "{\n      return iVar1;\n    }" { (return_statement "return iVar1;" return identifier ;) })) (expression_statement "bVar2 = *param_1;" (assignment_expression "bVar2 = *param_1" identifier = (pointer_expression "*param_1" * identifier)) ;) })) (if_statement "if (bVar2 == 0) {\n    FUN_00082da0(*(undefined4 *)(*(int *)(param_1 + 0x14) + 8),*(undefined4 *)(param_1 + 0x40),\n                 param_1);\n    if ((param_1[1] & 1) != 0) {\n      iVar1 = FUN_000825f8(param_1,param_2,param_3,param_4,1);\n      return iVar1;\n    }\n    return 8;\n  }" if (parenthesized_expression "(bVar2 == 0)" ( (binary_expression "bVar2 == 0" identifier == number_literal) )) (compound_statement "{\n    FUN_00082da0(*(undefined4 *)(*(int *)(param_1 + 0x14) + 8),*(undefined4 *)(param_1 + 0x40),\n                 param_1);\n    if ((param_1[1] & 1) != 0) {\n      iVar1 = FUN_000825f8(param_1,param_2,param_3,param_4,1);\n      return iVar1;\n    }\n    return 8;\n  }" { (expression_statement "FUN_00082da0(*(undefined4 *)(*(int *)(param_1 + 0x14) + 8),*(undefined4 *)(param_1 + 0x40),\n                 param_1);" (call_expression "FUN_00082da0(*(undefined4 *)(*(int *)(param_1 + 0x14) + 8),*(undefined4 *)(param_1 + 0x40),\n                 param_1)" identifier (argument_list "(*(undefined4 *)(*(int *)(param_1 + 0x14) + 8),*(undefined4 *)(param_1 + 0x40),\n                 param_1)" ( (pointer_expression "*(undefined4 *)(*(int *)(param_1 + 0x14) + 8)" * (cast_expression "(undefined4 *)(*(int *)(param_1 + 0x14) + 8)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(*(int *)(param_1 + 0x14) + 8)" ( (binary_expression "*(int *)(param_1 + 0x14) + 8" (pointer_expression "*(int *)(param_1 + 0x14)" * (cast_expression "(int *)(param_1 + 0x14)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x14)" ( (binary_expression "param_1 + 0x14" identifier + number_literal) )))) + number_literal) )))) , (pointer_expression "*(undefined4 *)(param_1 + 0x40)" * (cast_expression "(undefined4 *)(param_1 + 0x40)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x40)" ( (binary_expression "param_1 + 0x40" identifier + number_literal) )))) , identifier ))) ;) (if_statement "if ((param_1[1] & 1) != 0) {\n      iVar1 = FUN_000825f8(param_1,param_2,param_3,param_4,1);\n      return iVar1;\n    }" if (parenthesized_expression "((param_1[1] & 1) != 0)" ( (binary_expression "(param_1[1] & 1) != 0" (parenthesized_expression "(param_1[1] & 1)" ( (binary_expression "param_1[1] & 1" (subscript_expression "param_1[1]" identifier [ number_literal ]) & number_literal) )) != number_literal) )) (compound_statement "{\n      iVar1 = FUN_000825f8(param_1,param_2,param_3,param_4,1);\n      return iVar1;\n    }" { (expression_statement "iVar1 = FUN_000825f8(param_1,param_2,param_3,param_4,1);" (assignment_expression "iVar1 = FUN_000825f8(param_1,param_2,param_3,param_4,1)" identifier = (call_expression "FUN_000825f8(param_1,param_2,param_3,param_4,1)" identifier (argument_list "(param_1,param_2,param_3,param_4,1)" ( identifier , identifier , identifier , identifier , number_literal )))) ;) (return_statement "return iVar1;" return identifier ;) })) (return_statement "return 8;" return number_literal ;) })) (return_statement "return 4;" return number_literal ;) })))
(translation_unit "int sqlite3BtreePutData(BtCursor *pCsr,u32 offset,u32 amt,void *z)\n\n{\n  byte bVar2;\n  int iVar1;\n  \n  bVar2 = pCsr->eState;\n  if (2 < bVar2) {\n    iVar1 = btreeRestoreCursorPosition(pCsr);\n    if (iVar1 != 0) {\n      return iVar1;\n    }\n    bVar2 = pCsr->eState;\n  }\n  if (bVar2 == 0) {\n    saveAllCursors((BtShared *)pCsr->pBt->pCursor,pCsr->pgnoRoot,pCsr);\n    if ((pCsr->curFlags & 1) != 0) {\n      iVar1 = accessPayload(pCsr,offset,amt,(uchar *)z,1);\n      return iVar1;\n    }\n    return 8;\n  }\n  return 4;\n}\n\n" (function_definition "int sqlite3BtreePutData(BtCursor *pCsr,u32 offset,u32 amt,void *z)\n\n{\n  byte bVar2;\n  int iVar1;\n  \n  bVar2 = pCsr->eState;\n  if (2 < bVar2) {\n    iVar1 = btreeRestoreCursorPosition(pCsr);\n    if (iVar1 != 0) {\n      return iVar1;\n    }\n    bVar2 = pCsr->eState;\n  }\n  if (bVar2 == 0) {\n    saveAllCursors((BtShared *)pCsr->pBt->pCursor,pCsr->pgnoRoot,pCsr);\n    if ((pCsr->curFlags & 1) != 0) {\n      iVar1 = accessPayload(pCsr,offset,amt,(uchar *)z,1);\n      return iVar1;\n    }\n    return 8;\n  }\n  return 4;\n}" primitive_type (function_declarator "sqlite3BtreePutData(BtCursor *pCsr,u32 offset,u32 amt,void *z)" identifier (parameter_list "(BtCursor *pCsr,u32 offset,u32 amt,void *z)" ( (parameter_declaration "BtCursor *pCsr" type_identifier (pointer_declarator "*pCsr" * identifier)) , (parameter_declaration "u32 offset" type_identifier identifier) , (parameter_declaration "u32 amt" type_identifier identifier) , (parameter_declaration "void *z" primitive_type (pointer_declarator "*z" * identifier)) ))) (compound_statement "{\n  byte bVar2;\n  int iVar1;\n  \n  bVar2 = pCsr->eState;\n  if (2 < bVar2) {\n    iVar1 = btreeRestoreCursorPosition(pCsr);\n    if (iVar1 != 0) {\n      return iVar1;\n    }\n    bVar2 = pCsr->eState;\n  }\n  if (bVar2 == 0) {\n    saveAllCursors((BtShared *)pCsr->pBt->pCursor,pCsr->pgnoRoot,pCsr);\n    if ((pCsr->curFlags & 1) != 0) {\n      iVar1 = accessPayload(pCsr,offset,amt,(uchar *)z,1);\n      return iVar1;\n    }\n    return 8;\n  }\n  return 4;\n}" { (declaration "byte bVar2;" type_identifier identifier ;) (declaration "int iVar1;" primitive_type identifier ;) (expression_statement "bVar2 = pCsr->eState;" (assignment_expression "bVar2 = pCsr->eState" identifier = (field_expression "pCsr->eState" identifier -> field_identifier)) ;) (if_statement "if (2 < bVar2) {\n    iVar1 = btreeRestoreCursorPosition(pCsr);\n    if (iVar1 != 0) {\n      return iVar1;\n    }\n    bVar2 = pCsr->eState;\n  }" if (parenthesized_expression "(2 < bVar2)" ( (binary_expression "2 < bVar2" number_literal < identifier) )) (compound_statement "{\n    iVar1 = btreeRestoreCursorPosition(pCsr);\n    if (iVar1 != 0) {\n      return iVar1;\n    }\n    bVar2 = pCsr->eState;\n  }" { (expression_statement "iVar1 = btreeRestoreCursorPosition(pCsr);" (assignment_expression "iVar1 = btreeRestoreCursorPosition(pCsr)" identifier = (call_expression "btreeRestoreCursorPosition(pCsr)" identifier (argument_list "(pCsr)" ( identifier )))) ;) (if_statement "if (iVar1 != 0) {\n      return iVar1;\n    }" if (parenthesized_expression "(iVar1 != 0)" ( (binary_expression "iVar1 != 0" identifier != number_literal) )) (compound_statement "{\n      return iVar1;\n    }" { (return_statement "return iVar1;" return identifier ;) })) (expression_statement "bVar2 = pCsr->eState;" (assignment_expression "bVar2 = pCsr->eState" identifier = (field_expression "pCsr->eState" identifier -> field_identifier)) ;) })) (if_statement "if (bVar2 == 0) {\n    saveAllCursors((BtShared *)pCsr->pBt->pCursor,pCsr->pgnoRoot,pCsr);\n    if ((pCsr->curFlags & 1) != 0) {\n      iVar1 = accessPayload(pCsr,offset,amt,(uchar *)z,1);\n      return iVar1;\n    }\n    return 8;\n  }" if (parenthesized_expression "(bVar2 == 0)" ( (binary_expression "bVar2 == 0" identifier == number_literal) )) (compound_statement "{\n    saveAllCursors((BtShared *)pCsr->pBt->pCursor,pCsr->pgnoRoot,pCsr);\n    if ((pCsr->curFlags & 1) != 0) {\n      iVar1 = accessPayload(pCsr,offset,amt,(uchar *)z,1);\n      return iVar1;\n    }\n    return 8;\n  }" { (expression_statement "saveAllCursors((BtShared *)pCsr->pBt->pCursor,pCsr->pgnoRoot,pCsr);" (call_expression "saveAllCursors((BtShared *)pCsr->pBt->pCursor,pCsr->pgnoRoot,pCsr)" identifier (argument_list "((BtShared *)pCsr->pBt->pCursor,pCsr->pgnoRoot,pCsr)" ( (cast_expression "(BtShared *)pCsr->pBt->pCursor" ( (type_descriptor "BtShared *" type_identifier (abstract_pointer_declarator "*" *)) ) (field_expression "pCsr->pBt->pCursor" (field_expression "pCsr->pBt" identifier -> field_identifier) -> field_identifier)) , (field_expression "pCsr->pgnoRoot" identifier -> field_identifier) , identifier ))) ;) (if_statement "if ((pCsr->curFlags & 1) != 0) {\n      iVar1 = accessPayload(pCsr,offset,amt,(uchar *)z,1);\n      return iVar1;\n    }" if (parenthesized_expression "((pCsr->curFlags & 1) != 0)" ( (binary_expression "(pCsr->curFlags & 1) != 0" (parenthesized_expression "(pCsr->curFlags & 1)" ( (binary_expression "pCsr->curFlags & 1" (field_expression "pCsr->curFlags" identifier -> field_identifier) & number_literal) )) != number_literal) )) (compound_statement "{\n      iVar1 = accessPayload(pCsr,offset,amt,(uchar *)z,1);\n      return iVar1;\n    }" { (expression_statement "iVar1 = accessPayload(pCsr,offset,amt,(uchar *)z,1);" (assignment_expression "iVar1 = accessPayload(pCsr,offset,amt,(uchar *)z,1)" identifier = (call_expression "accessPayload(pCsr,offset,amt,(uchar *)z,1)" identifier (argument_list "(pCsr,offset,amt,(uchar *)z,1)" ( identifier , identifier , identifier , (cast_expression "(uchar *)z" ( (type_descriptor "uchar *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier) , number_literal )))) ;) (return_statement "return iVar1;" return identifier ;) })) (return_statement "return 8;" return number_literal ;) })) (return_statement "return 4;" return number_literal ;) })))
(translation_unit "int FUN_0008610c(byte *param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4)\n\n{\n  byte bVar2;\n  int iVar1;\n  \n  bVar2 = *param_1;\n  if (2 < bVar2) {\n    iVar1 = FUN_00084890();\n    if (iVar1 != 0) {\n      return iVar1;\n    }\n    bVar2 = *param_1;\n  }\n  if (bVar2 == 0) {\n    FUN_00082da0(*(undefined4 *)(*(int *)(param_1 + 0x14) + 8),*(undefined4 *)(param_1 + 0x40),\n                 param_1);\n    if ((param_1[1] & 1) != 0) {\n      iVar1 = FUN_000825f8(param_1,param_2,param_3,param_4,1);\n      return iVar1;\n    }\n    return 8;\n  }\n  return 4;\n}\n\n" (function_definition "int FUN_0008610c(byte *param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4)\n\n{\n  byte bVar2;\n  int iVar1;\n  \n  bVar2 = *param_1;\n  if (2 < bVar2) {\n    iVar1 = FUN_00084890();\n    if (iVar1 != 0) {\n      return iVar1;\n    }\n    bVar2 = *param_1;\n  }\n  if (bVar2 == 0) {\n    FUN_00082da0(*(undefined4 *)(*(int *)(param_1 + 0x14) + 8),*(undefined4 *)(param_1 + 0x40),\n                 param_1);\n    if ((param_1[1] & 1) != 0) {\n      iVar1 = FUN_000825f8(param_1,param_2,param_3,param_4,1);\n      return iVar1;\n    }\n    return 8;\n  }\n  return 4;\n}" primitive_type (function_declarator "FUN_0008610c(byte *param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4)" identifier (parameter_list "(byte *param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4)" ( (parameter_declaration "byte *param_1" type_identifier (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "undefined4 param_2" type_identifier identifier) , (parameter_declaration "undefined4 param_3" type_identifier identifier) , (parameter_declaration "undefined4 param_4" type_identifier identifier) ))) (compound_statement "{\n  byte bVar2;\n  int iVar1;\n  \n  bVar2 = *param_1;\n  if (2 < bVar2) {\n    iVar1 = FUN_00084890();\n    if (iVar1 != 0) {\n      return iVar1;\n    }\n    bVar2 = *param_1;\n  }\n  if (bVar2 == 0) {\n    FUN_00082da0(*(undefined4 *)(*(int *)(param_1 + 0x14) + 8),*(undefined4 *)(param_1 + 0x40),\n                 param_1);\n    if ((param_1[1] & 1) != 0) {\n      iVar1 = FUN_000825f8(param_1,param_2,param_3,param_4,1);\n      return iVar1;\n    }\n    return 8;\n  }\n  return 4;\n}" { (declaration "byte bVar2;" type_identifier identifier ;) (declaration "int iVar1;" primitive_type identifier ;) (expression_statement "bVar2 = *param_1;" (assignment_expression "bVar2 = *param_1" identifier = (pointer_expression "*param_1" * identifier)) ;) (if_statement "if (2 < bVar2) {\n    iVar1 = FUN_00084890();\n    if (iVar1 != 0) {\n      return iVar1;\n    }\n    bVar2 = *param_1;\n  }" if (parenthesized_expression "(2 < bVar2)" ( (binary_expression "2 < bVar2" number_literal < identifier) )) (compound_statement "{\n    iVar1 = FUN_00084890();\n    if (iVar1 != 0) {\n      return iVar1;\n    }\n    bVar2 = *param_1;\n  }" { (expression_statement "iVar1 = FUN_00084890();" (assignment_expression "iVar1 = FUN_00084890()" identifier = (call_expression "FUN_00084890()" identifier (argument_list "()" ( )))) ;) (if_statement "if (iVar1 != 0) {\n      return iVar1;\n    }" if (parenthesized_expression "(iVar1 != 0)" ( (binary_expression "iVar1 != 0" identifier != number_literal) )) (compound_statement "{\n      return iVar1;\n    }" { (return_statement "return iVar1;" return identifier ;) })) (expression_statement "bVar2 = *param_1;" (assignment_expression "bVar2 = *param_1" identifier = (pointer_expression "*param_1" * identifier)) ;) })) (if_statement "if (bVar2 == 0) {\n    FUN_00082da0(*(undefined4 *)(*(int *)(param_1 + 0x14) + 8),*(undefined4 *)(param_1 + 0x40),\n                 param_1);\n    if ((param_1[1] & 1) != 0) {\n      iVar1 = FUN_000825f8(param_1,param_2,param_3,param_4,1);\n      return iVar1;\n    }\n    return 8;\n  }" if (parenthesized_expression "(bVar2 == 0)" ( (binary_expression "bVar2 == 0" identifier == number_literal) )) (compound_statement "{\n    FUN_00082da0(*(undefined4 *)(*(int *)(param_1 + 0x14) + 8),*(undefined4 *)(param_1 + 0x40),\n                 param_1);\n    if ((param_1[1] & 1) != 0) {\n      iVar1 = FUN_000825f8(param_1,param_2,param_3,param_4,1);\n      return iVar1;\n    }\n    return 8;\n  }" { (expression_statement "FUN_00082da0(*(undefined4 *)(*(int *)(param_1 + 0x14) + 8),*(undefined4 *)(param_1 + 0x40),\n                 param_1);" (call_expression "FUN_00082da0(*(undefined4 *)(*(int *)(param_1 + 0x14) + 8),*(undefined4 *)(param_1 + 0x40),\n                 param_1)" identifier (argument_list "(*(undefined4 *)(*(int *)(param_1 + 0x14) + 8),*(undefined4 *)(param_1 + 0x40),\n                 param_1)" ( (pointer_expression "*(undefined4 *)(*(int *)(param_1 + 0x14) + 8)" * (cast_expression "(undefined4 *)(*(int *)(param_1 + 0x14) + 8)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(*(int *)(param_1 + 0x14) + 8)" ( (binary_expression "*(int *)(param_1 + 0x14) + 8" (pointer_expression "*(int *)(param_1 + 0x14)" * (cast_expression "(int *)(param_1 + 0x14)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x14)" ( (binary_expression "param_1 + 0x14" identifier + number_literal) )))) + number_literal) )))) , (pointer_expression "*(undefined4 *)(param_1 + 0x40)" * (cast_expression "(undefined4 *)(param_1 + 0x40)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x40)" ( (binary_expression "param_1 + 0x40" identifier + number_literal) )))) , identifier ))) ;) (if_statement "if ((param_1[1] & 1) != 0) {\n      iVar1 = FUN_000825f8(param_1,param_2,param_3,param_4,1);\n      return iVar1;\n    }" if (parenthesized_expression "((param_1[1] & 1) != 0)" ( (binary_expression "(param_1[1] & 1) != 0" (parenthesized_expression "(param_1[1] & 1)" ( (binary_expression "param_1[1] & 1" (subscript_expression "param_1[1]" identifier [ number_literal ]) & number_literal) )) != number_literal) )) (compound_statement "{\n      iVar1 = FUN_000825f8(param_1,param_2,param_3,param_4,1);\n      return iVar1;\n    }" { (expression_statement "iVar1 = FUN_000825f8(param_1,param_2,param_3,param_4,1);" (assignment_expression "iVar1 = FUN_000825f8(param_1,param_2,param_3,param_4,1)" identifier = (call_expression "FUN_000825f8(param_1,param_2,param_3,param_4,1)" identifier (argument_list "(param_1,param_2,param_3,param_4,1)" ( identifier , identifier , identifier , identifier , number_literal )))) ;) (return_statement "return iVar1;" return identifier ;) })) (return_statement "return 8;" return number_literal ;) })) (return_statement "return 4;" return number_literal ;) })))
(translation_unit (function_definition TYPE (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE (pointer_declarator * IDENT)) , (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE IDENT) ))) (compound_statement { (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (expression_statement (assignment_expression IDENT = (pointer_expression * IDENT)) ;) (if_statement if (parenthesized_expression ( (binary_expression LIT < IDENT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT != LIT) )) (compound_statement { (return_statement return IDENT ;) })) (expression_statement (assignment_expression IDENT = (pointer_expression * IDENT)) ;) })) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (expression_statement (call_expression IDENT (argument_list ( (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) + LIT) )))) , (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) , IDENT ))) ;) (if_statement if (parenthesized_expression ( (binary_expression (parenthesized_expression ( (binary_expression (subscript_expression IDENT [ LIT ]) & LIT) )) != LIT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT , IDENT , IDENT , IDENT , LIT )))) ;) (return_statement return IDENT ;) })) (return_statement return LIT ;) })) (return_statement return LIT ;) })))
(function_definition "int FUN_0008610c(byte *param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4)\n\n{\n  byte bVar2;\n  int iVar1;\n  \n  bVar2 = *param_1;\n  if (2 < bVar2) {\n    iVar1 = FUN_00084890();\n    if (iVar1 != 0) {\n      return iVar1;\n    }\n    bVar2 = *param_1;\n  }\n  if (bVar2 == 0) {\n    FUN_00082da0(*(undefined4 *)(*(int *)(param_1 + 0x14) + 8),*(undefined4 *)(param_1 + 0x40),\n                 param_1);\n    if ((param_1[1] & 1) != 0) {\n      iVar1 = FUN_000825f8(param_1,param_2,param_3,param_4,1);\n      return iVar1;\n    }\n    return 8;\n  }\n  return 4;\n}" (primitive_type "int") (function_declarator "FUN_0008610c(byte *param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4)" (identifier "FUN_0008610c") (parameter_list "(byte *param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4)" (( "(") (parameter_declaration "byte *param_1" (type_identifier "byte") (pointer_declarator "*param_1" (* "*") (identifier "param_1"))) (, ",") (parameter_declaration "undefined4 param_2" (type_identifier "undefined4") (identifier "param_2")) (, ",") (parameter_declaration "undefined4 param_3" (type_identifier "undefined4") (identifier "param_3")) (, ",") (parameter_declaration "undefined4 param_4" (type_identifier "undefined4") (identifier "param_4")) () ")"))) (compound_statement "{\n  byte bVar2;\n  int iVar1;\n  \n  bVar2 = *param_1;\n  if (2 < bVar2) {\n    iVar1 = FUN_00084890();\n    if (iVar1 != 0) {\n      return iVar1;\n    }\n    bVar2 = *param_1;\n  }\n  if (bVar2 == 0) {\n    FUN_00082da0(*(undefined4 *)(*(int *)(param_1 + 0x14) + 8),*(undefined4 *)(param_1 + 0x40),\n                 param_1);\n    if ((param_1[1] & 1) != 0) {\n      iVar1 = FUN_000825f8(param_1,param_2,param_3,param_4,1);\n      return iVar1;\n    }\n    return 8;\n  }\n  return 4;\n}" ({ "{") (declaration "byte bVar2;" (type_identifier "byte") (identifier "bVar2") (; ";")) (declaration "int iVar1;" (primitive_type "int") (identifier "iVar1") (; ";")) (expression_statement "bVar2 = *param_1;" (assignment_expression "bVar2 = *param_1" (identifier "bVar2") (= "=") (pointer_expression "*param_1" (* "*") (identifier "param_1"))) (; ";")) (if_statement "if (2 < bVar2) {\n    iVar1 = FUN_00084890();\n    if (iVar1 != 0) {\n      return iVar1;\n    }\n    bVar2 = *param_1;\n  }" (if "if") (parenthesized_expression "(2 < bVar2)" (( "(") (binary_expression "2 < bVar2" (number_literal "2") (< "<") (identifier "bVar2")) () ")")) (compound_statement "{\n    iVar1 = FUN_00084890();\n    if (iVar1 != 0) {\n      return iVar1;\n    }\n    bVar2 = *param_1;\n  }" ({ "{") (expression_statement "iVar1 = FUN_00084890();" (assignment_expression "iVar1 = FUN_00084890()" (identifier "iVar1") (= "=") (call_expression "FUN_00084890()" (identifier "FUN_00084890") (argument_list "()" (( "(") () ")")))) (; ";")) (if_statement "if (iVar1 != 0) {\n      return iVar1;\n    }" (if "if") (parenthesized_expression "(iVar1 != 0)" (( "(") (binary_expression "iVar1 != 0" (identifier "iVar1") (!= "!=") (number_literal "0")) () ")")) (compound_statement "{\n      return iVar1;\n    }" ({ "{") (return_statement "return iVar1;" (return "return") (identifier "iVar1") (; ";")) (} "}"))) (expression_statement "bVar2 = *param_1;" (assignment_expression "bVar2 = *param_1" (identifier "bVar2") (= "=") (pointer_expression "*param_1" (* "*") (identifier "param_1"))) (; ";")) (} "}"))) (if_statement "if (bVar2 == 0) {\n    FUN_00082da0(*(undefined4 *)(*(int *)(param_1 + 0x14) + 8),*(undefined4 *)(param_1 + 0x40),\n                 param_1);\n    if ((param_1[1] & 1) != 0) {\n      iVar1 = FUN_000825f8(param_1,param_2,param_3,param_4,1);\n      return iVar1;\n    }\n    return 8;\n  }" (if "if") (parenthesized_expression "(bVar2 == 0)" (( "(") (binary_expression "bVar2 == 0" (identifier "bVar2") (== "==") (number_literal "0")) () ")")) (compound_statement "{\n    FUN_00082da0(*(undefined4 *)(*(int *)(param_1 + 0x14) + 8),*(undefined4 *)(param_1 + 0x40),\n                 param_1);\n    if ((param_1[1] & 1) != 0) {\n      iVar1 = FUN_000825f8(param_1,param_2,param_3,param_4,1);\n      return iVar1;\n    }\n    return 8;\n  }" ({ "{") (expression_statement "FUN_00082da0(*(undefined4 *)(*(int *)(param_1 + 0x14) + 8),*(undefined4 *)(param_1 + 0x40),\n                 param_1);" (call_expression "FUN_00082da0(*(undefined4 *)(*(int *)(param_1 + 0x14) + 8),*(undefined4 *)(param_1 + 0x40),\n                 param_1)" (identifier "FUN_00082da0") (argument_list "(*(undefined4 *)(*(int *)(param_1 + 0x14) + 8),*(undefined4 *)(param_1 + 0x40),\n                 param_1)" (( "(") (pointer_expression "*(undefined4 *)(*(int *)(param_1 + 0x14) + 8)" (* "*") (cast_expression "(undefined4 *)(*(int *)(param_1 + 0x14) + 8)" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(*(int *)(param_1 + 0x14) + 8)" (( "(") (binary_expression "*(int *)(param_1 + 0x14) + 8" (pointer_expression "*(int *)(param_1 + 0x14)" (* "*") (cast_expression "(int *)(param_1 + 0x14)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 0x14)" (( "(") (binary_expression "param_1 + 0x14" (identifier "param_1") (+ "+") (number_literal "0x14")) () ")")))) (+ "+") (number_literal "8")) () ")")))) (, ",") (pointer_expression "*(undefined4 *)(param_1 + 0x40)" (* "*") (cast_expression "(undefined4 *)(param_1 + 0x40)" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 0x40)" (( "(") (binary_expression "param_1 + 0x40" (identifier "param_1") (+ "+") (number_literal "0x40")) () ")")))) (, ",") (identifier "param_1") () ")"))) (; ";")) (if_statement "if ((param_1[1] & 1) != 0) {\n      iVar1 = FUN_000825f8(param_1,param_2,param_3,param_4,1);\n      return iVar1;\n    }" (if "if") (parenthesized_expression "((param_1[1] & 1) != 0)" (( "(") (binary_expression "(param_1[1] & 1) != 0" (parenthesized_expression "(param_1[1] & 1)" (( "(") (binary_expression "param_1[1] & 1" (subscript_expression "param_1[1]" (identifier "param_1") ([ "[") (number_literal "1") (] "]")) (& "&") (number_literal "1")) () ")")) (!= "!=") (number_literal "0")) () ")")) (compound_statement "{\n      iVar1 = FUN_000825f8(param_1,param_2,param_3,param_4,1);\n      return iVar1;\n    }" ({ "{") (expression_statement "iVar1 = FUN_000825f8(param_1,param_2,param_3,param_4,1);" (assignment_expression "iVar1 = FUN_000825f8(param_1,param_2,param_3,param_4,1)" (identifier "iVar1") (= "=") (call_expression "FUN_000825f8(param_1,param_2,param_3,param_4,1)" (identifier "FUN_000825f8") (argument_list "(param_1,param_2,param_3,param_4,1)" (( "(") (identifier "param_1") (, ",") (identifier "param_2") (, ",") (identifier "param_3") (, ",") (identifier "param_4") (, ",") (number_literal "1") () ")")))) (; ";")) (return_statement "return iVar1;" (return "return") (identifier "iVar1") (; ";")) (} "}"))) (return_statement "return 8;" (return "return") (number_literal "8") (; ";")) (} "}"))) (return_statement "return 4;" (return "return") (number_literal "4") (; ";")) (} "}")))

int function_1(type_1 *pCsr,type_2 offset,type_2 amt,void *z)

{
  type_3 var_1;
  int var_3;
  
  var_1 = pCsr->eState;
  if (2 < var_1) {
    var_3 = var_2(pCsr);
    if (var_3 != 0) {
      return var_3;
    }
    var_1 = pCsr->eState;
  }
  if (var_1 == 0) {
    var_4((type_4 *)pCsr->pBt->pCursor,pCsr->pgnoRoot,pCsr);
    if ((pCsr->curFlags & 1) != 0) {
      var_3 = var_5(pCsr,offset,amt,(type_5 *)z,1);
      return var_3;
    }
    return 8;
  }
  return 4;
}


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

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

{
  byte bVar2;
  int iVar1;
  
  bVar2 = *param_1;
  if (2 < bVar2) {
    iVar1 = FUN_00084890();
    if (iVar1 != 0) {
      return iVar1;
    }
    bVar2 = *param_1;
  }
  if (bVar2 == 0) {
    FUN_00082da0(*(undefined4 *)(*(int *)(param_1 + 0x14) + 8),*(undefined4 *)(param_1 + 0x40),
                 param_1);
    if ((param_1[1] & 1) != 0) {
      iVar1 = FUN_000825f8(param_1,param_2,param_3,param_4,1);
      return iVar1;
    }
    return 8;
  }
  return 4;
}

