
Btree * sqlite3DbNameToBtree(sqlite3 *db,char *zDbName)

{
  int iVar1;
  int iVar2;
  
  if (zDbName == (char *)0x0) {
    iVar2 = 0;
  }
  else {
    iVar1 = sqlite3FindDbName(db,zDbName);
    iVar2 = iVar1 << 4;
    if (iVar1 < 0) {
      return (Btree *)0x0;
    }
  }
  return *(Btree **)((int)&db->aDb->pBt + iVar2);
}



undefined4 FUN_0002a000(int param_1,int param_2)

{
  int iVar1;
  int iVar2;
  
  if (param_2 == 0) {
    iVar2 = 0;
  }
  else {
    iVar1 = FUN_00029f3c();
    iVar2 = iVar1 << 4;
    if (iVar1 < 0) {
      return 0;
    }
  }
  return *(undefined4 *)(*(int *)(param_1 + 0x10) + iVar2 + 4);
}


lui gp,0xd
addiu gp,gp,0x32a0
addu gp,gp,t9
addiu sp,sp,-0x20
sw gp,0x10(sp)
sw s0,0x18(sp)
or s0,a0,zero
beq a1,zero,0x0002a058
_sw ra,0x1c(sp)
lw t9,-0x7fb4(gp)
addiu t9,t9,-0x60c4
bal 0x00029f3c
_nop
bltz v0,0x0002a060
_sll v1,v0,0x4
lw v0,0x10(s0)
addu v0,v0,v1
lw v0,0x4(v0)
lw ra,0x1c(sp)
lw s0,0x18(sp)
jr ra
_addiu sp,sp,0x20
b 0x0002a03c
_or v1,zero,zero
b 0x0002a048
_or v0,zero,zero
(translation_unit "undefined4 FUN_0002a000(int param_1,int param_2)\n\n{\n  int iVar1;\n  int iVar2;\n  \n  if (param_2 == 0) {\n    iVar2 = 0;\n  }\n  else {\n    iVar1 = FUN_00029f3c();\n    iVar2 = iVar1 << 4;\n    if (iVar1 < 0) {\n      return 0;\n    }\n  }\n  return *(undefined4 *)(*(int *)(param_1 + 0x10) + iVar2 + 4);\n}\n\n" (function_definition "undefined4 FUN_0002a000(int param_1,int param_2)\n\n{\n  int iVar1;\n  int iVar2;\n  \n  if (param_2 == 0) {\n    iVar2 = 0;\n  }\n  else {\n    iVar1 = FUN_00029f3c();\n    iVar2 = iVar1 << 4;\n    if (iVar1 < 0) {\n      return 0;\n    }\n  }\n  return *(undefined4 *)(*(int *)(param_1 + 0x10) + iVar2 + 4);\n}" type_identifier (function_declarator "FUN_0002a000(int param_1,int param_2)" identifier (parameter_list "(int param_1,int param_2)" ( (parameter_declaration "int param_1" primitive_type identifier) , (parameter_declaration "int param_2" primitive_type identifier) ))) (compound_statement "{\n  int iVar1;\n  int iVar2;\n  \n  if (param_2 == 0) {\n    iVar2 = 0;\n  }\n  else {\n    iVar1 = FUN_00029f3c();\n    iVar2 = iVar1 << 4;\n    if (iVar1 < 0) {\n      return 0;\n    }\n  }\n  return *(undefined4 *)(*(int *)(param_1 + 0x10) + iVar2 + 4);\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "int iVar2;" primitive_type identifier ;) (if_statement "if (param_2 == 0) {\n    iVar2 = 0;\n  }\n  else {\n    iVar1 = FUN_00029f3c();\n    iVar2 = iVar1 << 4;\n    if (iVar1 < 0) {\n      return 0;\n    }\n  }" if (parenthesized_expression "(param_2 == 0)" ( (binary_expression "param_2 == 0" identifier == number_literal) )) (compound_statement "{\n    iVar2 = 0;\n  }" { (expression_statement "iVar2 = 0;" (assignment_expression "iVar2 = 0" identifier = number_literal) ;) }) (else_clause "else {\n    iVar1 = FUN_00029f3c();\n    iVar2 = iVar1 << 4;\n    if (iVar1 < 0) {\n      return 0;\n    }\n  }" else (compound_statement "{\n    iVar1 = FUN_00029f3c();\n    iVar2 = iVar1 << 4;\n    if (iVar1 < 0) {\n      return 0;\n    }\n  }" { (expression_statement "iVar1 = FUN_00029f3c();" (assignment_expression "iVar1 = FUN_00029f3c()" identifier = (call_expression "FUN_00029f3c()" identifier (argument_list "()" ( )))) ;) (expression_statement "iVar2 = iVar1 << 4;" (assignment_expression "iVar2 = iVar1 << 4" identifier = (binary_expression "iVar1 << 4" identifier << number_literal)) ;) (if_statement "if (iVar1 < 0) {\n      return 0;\n    }" if (parenthesized_expression "(iVar1 < 0)" ( (binary_expression "iVar1 < 0" identifier < number_literal) )) (compound_statement "{\n      return 0;\n    }" { (return_statement "return 0;" return number_literal ;) })) }))) (return_statement "return *(undefined4 *)(*(int *)(param_1 + 0x10) + iVar2 + 4);" return (pointer_expression "*(undefined4 *)(*(int *)(param_1 + 0x10) + iVar2 + 4)" * (cast_expression "(undefined4 *)(*(int *)(param_1 + 0x10) + iVar2 + 4)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(*(int *)(param_1 + 0x10) + iVar2 + 4)" ( (binary_expression "*(int *)(param_1 + 0x10) + iVar2 + 4" (binary_expression "*(int *)(param_1 + 0x10) + iVar2" (pointer_expression "*(int *)(param_1 + 0x10)" * (cast_expression "(int *)(param_1 + 0x10)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x10)" ( (binary_expression "param_1 + 0x10" identifier + number_literal) )))) + identifier) + number_literal) )))) ;) })))
(translation_unit "Btree * sqlite3DbNameToBtree(sqlite3 *db,char *zDbName)\n\n{\n  int iVar1;\n  int iVar2;\n  \n  if (zDbName == (char *)0x0) {\n    iVar2 = 0;\n  }\n  else {\n    iVar1 = sqlite3FindDbName(db,zDbName);\n    iVar2 = iVar1 << 4;\n    if (iVar1 < 0) {\n      return (Btree *)0x0;\n    }\n  }\n  return *(Btree **)((int)&db->aDb->pBt + iVar2);\n}\n\n" (function_definition "Btree * sqlite3DbNameToBtree(sqlite3 *db,char *zDbName)\n\n{\n  int iVar1;\n  int iVar2;\n  \n  if (zDbName == (char *)0x0) {\n    iVar2 = 0;\n  }\n  else {\n    iVar1 = sqlite3FindDbName(db,zDbName);\n    iVar2 = iVar1 << 4;\n    if (iVar1 < 0) {\n      return (Btree *)0x0;\n    }\n  }\n  return *(Btree **)((int)&db->aDb->pBt + iVar2);\n}" type_identifier (pointer_declarator "* sqlite3DbNameToBtree(sqlite3 *db,char *zDbName)" * (function_declarator "sqlite3DbNameToBtree(sqlite3 *db,char *zDbName)" identifier (parameter_list "(sqlite3 *db,char *zDbName)" ( (parameter_declaration "sqlite3 *db" type_identifier (pointer_declarator "*db" * identifier)) , (parameter_declaration "char *zDbName" primitive_type (pointer_declarator "*zDbName" * identifier)) )))) (compound_statement "{\n  int iVar1;\n  int iVar2;\n  \n  if (zDbName == (char *)0x0) {\n    iVar2 = 0;\n  }\n  else {\n    iVar1 = sqlite3FindDbName(db,zDbName);\n    iVar2 = iVar1 << 4;\n    if (iVar1 < 0) {\n      return (Btree *)0x0;\n    }\n  }\n  return *(Btree **)((int)&db->aDb->pBt + iVar2);\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "int iVar2;" primitive_type identifier ;) (if_statement "if (zDbName == (char *)0x0) {\n    iVar2 = 0;\n  }\n  else {\n    iVar1 = sqlite3FindDbName(db,zDbName);\n    iVar2 = iVar1 << 4;\n    if (iVar1 < 0) {\n      return (Btree *)0x0;\n    }\n  }" if (parenthesized_expression "(zDbName == (char *)0x0)" ( (binary_expression "zDbName == (char *)0x0" identifier == (cast_expression "(char *)0x0" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n    iVar2 = 0;\n  }" { (expression_statement "iVar2 = 0;" (assignment_expression "iVar2 = 0" identifier = number_literal) ;) }) (else_clause "else {\n    iVar1 = sqlite3FindDbName(db,zDbName);\n    iVar2 = iVar1 << 4;\n    if (iVar1 < 0) {\n      return (Btree *)0x0;\n    }\n  }" else (compound_statement "{\n    iVar1 = sqlite3FindDbName(db,zDbName);\n    iVar2 = iVar1 << 4;\n    if (iVar1 < 0) {\n      return (Btree *)0x0;\n    }\n  }" { (expression_statement "iVar1 = sqlite3FindDbName(db,zDbName);" (assignment_expression "iVar1 = sqlite3FindDbName(db,zDbName)" identifier = (call_expression "sqlite3FindDbName(db,zDbName)" identifier (argument_list "(db,zDbName)" ( identifier , identifier )))) ;) (expression_statement "iVar2 = iVar1 << 4;" (assignment_expression "iVar2 = iVar1 << 4" identifier = (binary_expression "iVar1 << 4" identifier << number_literal)) ;) (if_statement "if (iVar1 < 0) {\n      return (Btree *)0x0;\n    }" if (parenthesized_expression "(iVar1 < 0)" ( (binary_expression "iVar1 < 0" identifier < number_literal) )) (compound_statement "{\n      return (Btree *)0x0;\n    }" { (return_statement "return (Btree *)0x0;" return (cast_expression "(Btree *)0x0" ( (type_descriptor "Btree *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal) ;) })) }))) (return_statement "return *(Btree **)((int)&db->aDb->pBt + iVar2);" return (pointer_expression "*(Btree **)((int)&db->aDb->pBt + iVar2)" * (cast_expression "(Btree **)((int)&db->aDb->pBt + iVar2)" ( (type_descriptor "Btree **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "((int)&db->aDb->pBt + iVar2)" ( (binary_expression "(int)&db->aDb->pBt + iVar2" (cast_expression "(int)&db->aDb->pBt" ( (type_descriptor "int" primitive_type) ) (pointer_expression "&db->aDb->pBt" & (field_expression "db->aDb->pBt" (field_expression "db->aDb" identifier -> field_identifier) -> field_identifier))) + identifier) )))) ;) })))
(translation_unit "undefined4 FUN_0002a000(int param_1,int param_2)\n\n{\n  int iVar1;\n  int iVar2;\n  \n  if (param_2 == 0) {\n    iVar2 = 0;\n  }\n  else {\n    iVar1 = FUN_00029f3c();\n    iVar2 = iVar1 << 4;\n    if (iVar1 < 0) {\n      return 0;\n    }\n  }\n  return *(undefined4 *)(*(int *)(param_1 + 0x10) + iVar2 + 4);\n}\n\n" (function_definition "undefined4 FUN_0002a000(int param_1,int param_2)\n\n{\n  int iVar1;\n  int iVar2;\n  \n  if (param_2 == 0) {\n    iVar2 = 0;\n  }\n  else {\n    iVar1 = FUN_00029f3c();\n    iVar2 = iVar1 << 4;\n    if (iVar1 < 0) {\n      return 0;\n    }\n  }\n  return *(undefined4 *)(*(int *)(param_1 + 0x10) + iVar2 + 4);\n}" type_identifier (function_declarator "FUN_0002a000(int param_1,int param_2)" identifier (parameter_list "(int param_1,int param_2)" ( (parameter_declaration "int param_1" primitive_type identifier) , (parameter_declaration "int param_2" primitive_type identifier) ))) (compound_statement "{\n  int iVar1;\n  int iVar2;\n  \n  if (param_2 == 0) {\n    iVar2 = 0;\n  }\n  else {\n    iVar1 = FUN_00029f3c();\n    iVar2 = iVar1 << 4;\n    if (iVar1 < 0) {\n      return 0;\n    }\n  }\n  return *(undefined4 *)(*(int *)(param_1 + 0x10) + iVar2 + 4);\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "int iVar2;" primitive_type identifier ;) (if_statement "if (param_2 == 0) {\n    iVar2 = 0;\n  }\n  else {\n    iVar1 = FUN_00029f3c();\n    iVar2 = iVar1 << 4;\n    if (iVar1 < 0) {\n      return 0;\n    }\n  }" if (parenthesized_expression "(param_2 == 0)" ( (binary_expression "param_2 == 0" identifier == number_literal) )) (compound_statement "{\n    iVar2 = 0;\n  }" { (expression_statement "iVar2 = 0;" (assignment_expression "iVar2 = 0" identifier = number_literal) ;) }) (else_clause "else {\n    iVar1 = FUN_00029f3c();\n    iVar2 = iVar1 << 4;\n    if (iVar1 < 0) {\n      return 0;\n    }\n  }" else (compound_statement "{\n    iVar1 = FUN_00029f3c();\n    iVar2 = iVar1 << 4;\n    if (iVar1 < 0) {\n      return 0;\n    }\n  }" { (expression_statement "iVar1 = FUN_00029f3c();" (assignment_expression "iVar1 = FUN_00029f3c()" identifier = (call_expression "FUN_00029f3c()" identifier (argument_list "()" ( )))) ;) (expression_statement "iVar2 = iVar1 << 4;" (assignment_expression "iVar2 = iVar1 << 4" identifier = (binary_expression "iVar1 << 4" identifier << number_literal)) ;) (if_statement "if (iVar1 < 0) {\n      return 0;\n    }" if (parenthesized_expression "(iVar1 < 0)" ( (binary_expression "iVar1 < 0" identifier < number_literal) )) (compound_statement "{\n      return 0;\n    }" { (return_statement "return 0;" return number_literal ;) })) }))) (return_statement "return *(undefined4 *)(*(int *)(param_1 + 0x10) + iVar2 + 4);" return (pointer_expression "*(undefined4 *)(*(int *)(param_1 + 0x10) + iVar2 + 4)" * (cast_expression "(undefined4 *)(*(int *)(param_1 + 0x10) + iVar2 + 4)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(*(int *)(param_1 + 0x10) + iVar2 + 4)" ( (binary_expression "*(int *)(param_1 + 0x10) + iVar2 + 4" (binary_expression "*(int *)(param_1 + 0x10) + iVar2" (pointer_expression "*(int *)(param_1 + 0x10)" * (cast_expression "(int *)(param_1 + 0x10)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x10)" ( (binary_expression "param_1 + 0x10" identifier + number_literal) )))) + identifier) + number_literal) )))) ;) })))
(translation_unit (function_definition TYPE (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE IDENT) ))) (compound_statement { (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (expression_statement (assignment_expression IDENT = LIT) ;) }) (else_clause else (compound_statement { (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( )))) ;) (expression_statement (assignment_expression IDENT = (binary_expression IDENT << LIT)) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT < LIT) )) (compound_statement { (return_statement return LIT ;) })) }))) (return_statement return (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression (binary_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) + IDENT) + LIT) )))) ;) })))
(function_definition "undefined4 FUN_0002a000(int param_1,int param_2)\n\n{\n  int iVar1;\n  int iVar2;\n  \n  if (param_2 == 0) {\n    iVar2 = 0;\n  }\n  else {\n    iVar1 = FUN_00029f3c();\n    iVar2 = iVar1 << 4;\n    if (iVar1 < 0) {\n      return 0;\n    }\n  }\n  return *(undefined4 *)(*(int *)(param_1 + 0x10) + iVar2 + 4);\n}" (type_identifier "undefined4") (function_declarator "FUN_0002a000(int param_1,int param_2)" (identifier "FUN_0002a000") (parameter_list "(int param_1,int param_2)" (( "(") (parameter_declaration "int param_1" (primitive_type "int") (identifier "param_1")) (, ",") (parameter_declaration "int param_2" (primitive_type "int") (identifier "param_2")) () ")"))) (compound_statement "{\n  int iVar1;\n  int iVar2;\n  \n  if (param_2 == 0) {\n    iVar2 = 0;\n  }\n  else {\n    iVar1 = FUN_00029f3c();\n    iVar2 = iVar1 << 4;\n    if (iVar1 < 0) {\n      return 0;\n    }\n  }\n  return *(undefined4 *)(*(int *)(param_1 + 0x10) + iVar2 + 4);\n}" ({ "{") (declaration "int iVar1;" (primitive_type "int") (identifier "iVar1") (; ";")) (declaration "int iVar2;" (primitive_type "int") (identifier "iVar2") (; ";")) (if_statement "if (param_2 == 0) {\n    iVar2 = 0;\n  }\n  else {\n    iVar1 = FUN_00029f3c();\n    iVar2 = iVar1 << 4;\n    if (iVar1 < 0) {\n      return 0;\n    }\n  }" (if "if") (parenthesized_expression "(param_2 == 0)" (( "(") (binary_expression "param_2 == 0" (identifier "param_2") (== "==") (number_literal "0")) () ")")) (compound_statement "{\n    iVar2 = 0;\n  }" ({ "{") (expression_statement "iVar2 = 0;" (assignment_expression "iVar2 = 0" (identifier "iVar2") (= "=") (number_literal "0")) (; ";")) (} "}")) (else_clause "else {\n    iVar1 = FUN_00029f3c();\n    iVar2 = iVar1 << 4;\n    if (iVar1 < 0) {\n      return 0;\n    }\n  }" (else "else") (compound_statement "{\n    iVar1 = FUN_00029f3c();\n    iVar2 = iVar1 << 4;\n    if (iVar1 < 0) {\n      return 0;\n    }\n  }" ({ "{") (expression_statement "iVar1 = FUN_00029f3c();" (assignment_expression "iVar1 = FUN_00029f3c()" (identifier "iVar1") (= "=") (call_expression "FUN_00029f3c()" (identifier "FUN_00029f3c") (argument_list "()" (( "(") () ")")))) (; ";")) (expression_statement "iVar2 = iVar1 << 4;" (assignment_expression "iVar2 = iVar1 << 4" (identifier "iVar2") (= "=") (binary_expression "iVar1 << 4" (identifier "iVar1") (<< "<<") (number_literal "4"))) (; ";")) (if_statement "if (iVar1 < 0) {\n      return 0;\n    }" (if "if") (parenthesized_expression "(iVar1 < 0)" (( "(") (binary_expression "iVar1 < 0" (identifier "iVar1") (< "<") (number_literal "0")) () ")")) (compound_statement "{\n      return 0;\n    }" ({ "{") (return_statement "return 0;" (return "return") (number_literal "0") (; ";")) (} "}"))) (} "}")))) (return_statement "return *(undefined4 *)(*(int *)(param_1 + 0x10) + iVar2 + 4);" (return "return") (pointer_expression "*(undefined4 *)(*(int *)(param_1 + 0x10) + iVar2 + 4)" (* "*") (cast_expression "(undefined4 *)(*(int *)(param_1 + 0x10) + iVar2 + 4)" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(*(int *)(param_1 + 0x10) + iVar2 + 4)" (( "(") (binary_expression "*(int *)(param_1 + 0x10) + iVar2 + 4" (binary_expression "*(int *)(param_1 + 0x10) + iVar2" (pointer_expression "*(int *)(param_1 + 0x10)" (* "*") (cast_expression "(int *)(param_1 + 0x10)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 0x10)" (( "(") (binary_expression "param_1 + 0x10" (identifier "param_1") (+ "+") (number_literal "0x10")) () ")")))) (+ "+") (identifier "iVar2")) (+ "+") (number_literal "4")) () ")")))) (; ";")) (} "}")))

type_1 * function_1(type_2 *db,char *var_1)

{
  int var_3;
  int var_4;
  
  if (var_1 == (char *)0x0) {
    var_4 = 0;
  }
  else {
    var_3 = var_2(db,var_1);
    var_4 = var_3 << 4;
    if (var_3 < 0) {
      return (type_1 *)0x0;
    }
  }
  return *(type_1 **)((int)&db->aDb->pBt + var_4);
}


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

undefined4 MASKED(int param_1,int param_2)

{
  int iVar1;
  int iVar2;
  
  if (param_2 == 0) {
    iVar2 = 0;
  }
  else {
    iVar1 = FUN_00029f3c();
    iVar2 = iVar1 << 4;
    if (iVar1 < 0) {
      return 0;
    }
  }
  return *(undefined4 *)(*(int *)(param_1 + 0x10) + iVar2 + 4);
}

