
RowSetEntry * rowSetEntryAlloc(RowSet *p)

{
  RowSetEntry *pRVar1;
  RowSetChunk *pRVar2;
  u16 uVar3;
  undefined4 in_stack_fffffff4;
  
  if (p->nFresh == 0) {
    pRVar2 = (RowSetChunk *)sqlite3DbMallocRawNN(p->db,CONCAT44(&_gp,in_stack_fffffff4));
    if (pRVar2 == (RowSetChunk *)0x0) {
      return (RowSetEntry *)0x0;
    }
    pRVar1 = pRVar2->aEntry;
    uVar3 = 0x3e;
    pRVar2->pNextChunk = p->pChunk;
    p->pChunk = pRVar2;
  }
  else {
    uVar3 = p->nFresh - 1;
    pRVar1 = p->pFresh;
  }
  p->nFresh = uVar3;
  p->pFresh = pRVar1 + 1;
  return pRVar1;
}



int * FUN_00038554(int *param_1,undefined4 param_2)

{
  int *piVar1;
  int *piVar2;
  short sVar3;
  
  if (*(short *)(param_1 + 6) == 0) {
    piVar2 = (int *)FUN_00036c00(param_1[1],param_2,0,0x3f8);
    if (piVar2 == (int *)0x0) {
      return (int *)0x0;
    }
    piVar1 = piVar2 + 2;
    sVar3 = 0x3e;
    *piVar2 = *param_1;
    *param_1 = (int)piVar2;
  }
  else {
    sVar3 = *(short *)(param_1 + 6) + -1;
    piVar1 = (int *)param_1[4];
  }
  *(short *)(param_1 + 6) = sVar3;
  param_1[4] = (int)(piVar1 + 4);
  return piVar1;
}


lui gp,0xc
addiu gp,gp,0x4d4c
addu gp,gp,t9
addiu sp,sp,-0x20
lhu v0,0x18(a0)
sw gp,0x10(sp)
sw s0,0x18(sp)
or s0,a0,zero
beq v0,zero,0x000385a4
_sw ra,0x1c(sp)
addiu v1,v0,-0x1
lw v0,0x10(a0)
andi v1,v1,0xffff
addiu a0,v0,0x10
sh v1,0x18(s0)
sw a0,0x10(s0)
lw ra,0x1c(sp)
lw s0,0x18(sp)
jr ra
_addiu sp,sp,0x20
lw t9,-0x7fb4(gp)
li a3,0x3f8
lw a0,0x4(a0)
addiu t9,t9,0x6c00
bal 0x00036c00
_or a2,zero,zero
beq v0,zero,0x000385dc
_or a0,v0,zero
lw a1,0x0(s0)
addiu v0,v0,0x8
li v1,0x3e
sw a1,0x0(a0)
b 0x00038588
_sw a0,0x0(s0)
b 0x00038594
_or v0,zero,zero
(translation_unit "int * FUN_00038554(int *param_1,undefined4 param_2)\n\n{\n  int *piVar1;\n  int *piVar2;\n  short sVar3;\n  \n  if (*(short *)(param_1 + 6) == 0) {\n    piVar2 = (int *)FUN_00036c00(param_1[1],param_2,0,0x3f8);\n    if (piVar2 == (int *)0x0) {\n      return (int *)0x0;\n    }\n    piVar1 = piVar2 + 2;\n    sVar3 = 0x3e;\n    *piVar2 = *param_1;\n    *param_1 = (int)piVar2;\n  }\n  else {\n    sVar3 = *(short *)(param_1 + 6) + -1;\n    piVar1 = (int *)param_1[4];\n  }\n  *(short *)(param_1 + 6) = sVar3;\n  param_1[4] = (int)(piVar1 + 4);\n  return piVar1;\n}\n\n" (function_definition "int * FUN_00038554(int *param_1,undefined4 param_2)\n\n{\n  int *piVar1;\n  int *piVar2;\n  short sVar3;\n  \n  if (*(short *)(param_1 + 6) == 0) {\n    piVar2 = (int *)FUN_00036c00(param_1[1],param_2,0,0x3f8);\n    if (piVar2 == (int *)0x0) {\n      return (int *)0x0;\n    }\n    piVar1 = piVar2 + 2;\n    sVar3 = 0x3e;\n    *piVar2 = *param_1;\n    *param_1 = (int)piVar2;\n  }\n  else {\n    sVar3 = *(short *)(param_1 + 6) + -1;\n    piVar1 = (int *)param_1[4];\n  }\n  *(short *)(param_1 + 6) = sVar3;\n  param_1[4] = (int)(piVar1 + 4);\n  return piVar1;\n}" primitive_type (pointer_declarator "* FUN_00038554(int *param_1,undefined4 param_2)" * (function_declarator "FUN_00038554(int *param_1,undefined4 param_2)" identifier (parameter_list "(int *param_1,undefined4 param_2)" ( (parameter_declaration "int *param_1" primitive_type (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "undefined4 param_2" type_identifier identifier) )))) (compound_statement "{\n  int *piVar1;\n  int *piVar2;\n  short sVar3;\n  \n  if (*(short *)(param_1 + 6) == 0) {\n    piVar2 = (int *)FUN_00036c00(param_1[1],param_2,0,0x3f8);\n    if (piVar2 == (int *)0x0) {\n      return (int *)0x0;\n    }\n    piVar1 = piVar2 + 2;\n    sVar3 = 0x3e;\n    *piVar2 = *param_1;\n    *param_1 = (int)piVar2;\n  }\n  else {\n    sVar3 = *(short *)(param_1 + 6) + -1;\n    piVar1 = (int *)param_1[4];\n  }\n  *(short *)(param_1 + 6) = sVar3;\n  param_1[4] = (int)(piVar1 + 4);\n  return piVar1;\n}" { (declaration "int *piVar1;" primitive_type (pointer_declarator "*piVar1" * identifier) ;) (declaration "int *piVar2;" primitive_type (pointer_declarator "*piVar2" * identifier) ;) (declaration "short sVar3;" (sized_type_specifier "short" short) identifier ;) (if_statement "if (*(short *)(param_1 + 6) == 0) {\n    piVar2 = (int *)FUN_00036c00(param_1[1],param_2,0,0x3f8);\n    if (piVar2 == (int *)0x0) {\n      return (int *)0x0;\n    }\n    piVar1 = piVar2 + 2;\n    sVar3 = 0x3e;\n    *piVar2 = *param_1;\n    *param_1 = (int)piVar2;\n  }\n  else {\n    sVar3 = *(short *)(param_1 + 6) + -1;\n    piVar1 = (int *)param_1[4];\n  }" if (parenthesized_expression "(*(short *)(param_1 + 6) == 0)" ( (binary_expression "*(short *)(param_1 + 6) == 0" (pointer_expression "*(short *)(param_1 + 6)" * (cast_expression "(short *)(param_1 + 6)" ( (type_descriptor "short *" (sized_type_specifier "short" short) (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 6)" ( (binary_expression "param_1 + 6" identifier + number_literal) )))) == number_literal) )) (compound_statement "{\n    piVar2 = (int *)FUN_00036c00(param_1[1],param_2,0,0x3f8);\n    if (piVar2 == (int *)0x0) {\n      return (int *)0x0;\n    }\n    piVar1 = piVar2 + 2;\n    sVar3 = 0x3e;\n    *piVar2 = *param_1;\n    *param_1 = (int)piVar2;\n  }" { (expression_statement "piVar2 = (int *)FUN_00036c00(param_1[1],param_2,0,0x3f8);" (assignment_expression "piVar2 = (int *)FUN_00036c00(param_1[1],param_2,0,0x3f8)" identifier = (cast_expression "(int *)FUN_00036c00(param_1[1],param_2,0,0x3f8)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "FUN_00036c00(param_1[1],param_2,0,0x3f8)" identifier (argument_list "(param_1[1],param_2,0,0x3f8)" ( (subscript_expression "param_1[1]" identifier [ number_literal ]) , identifier , number_literal , number_literal ))))) ;) (if_statement "if (piVar2 == (int *)0x0) {\n      return (int *)0x0;\n    }" if (parenthesized_expression "(piVar2 == (int *)0x0)" ( (binary_expression "piVar2 == (int *)0x0" identifier == (cast_expression "(int *)0x0" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n      return (int *)0x0;\n    }" { (return_statement "return (int *)0x0;" return (cast_expression "(int *)0x0" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal) ;) })) (expression_statement "piVar1 = piVar2 + 2;" (assignment_expression "piVar1 = piVar2 + 2" identifier = (binary_expression "piVar2 + 2" identifier + number_literal)) ;) (expression_statement "sVar3 = 0x3e;" (assignment_expression "sVar3 = 0x3e" identifier = number_literal) ;) (expression_statement "*piVar2 = *param_1;" (assignment_expression "*piVar2 = *param_1" (pointer_expression "*piVar2" * identifier) = (pointer_expression "*param_1" * identifier)) ;) (expression_statement "*param_1 = (int)piVar2;" (assignment_expression "*param_1 = (int)piVar2" (pointer_expression "*param_1" * identifier) = (cast_expression "(int)piVar2" ( (type_descriptor "int" primitive_type) ) identifier)) ;) }) (else_clause "else {\n    sVar3 = *(short *)(param_1 + 6) + -1;\n    piVar1 = (int *)param_1[4];\n  }" else (compound_statement "{\n    sVar3 = *(short *)(param_1 + 6) + -1;\n    piVar1 = (int *)param_1[4];\n  }" { (expression_statement "sVar3 = *(short *)(param_1 + 6) + -1;" (assignment_expression "sVar3 = *(short *)(param_1 + 6) + -1" identifier = (binary_expression "*(short *)(param_1 + 6) + -1" (pointer_expression "*(short *)(param_1 + 6)" * (cast_expression "(short *)(param_1 + 6)" ( (type_descriptor "short *" (sized_type_specifier "short" short) (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 6)" ( (binary_expression "param_1 + 6" identifier + number_literal) )))) + number_literal)) ;) (expression_statement "piVar1 = (int *)param_1[4];" (assignment_expression "piVar1 = (int *)param_1[4]" identifier = (cast_expression "(int *)param_1[4]" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (subscript_expression "param_1[4]" identifier [ number_literal ]))) ;) }))) (expression_statement "*(short *)(param_1 + 6) = sVar3;" (assignment_expression "*(short *)(param_1 + 6) = sVar3" (pointer_expression "*(short *)(param_1 + 6)" * (cast_expression "(short *)(param_1 + 6)" ( (type_descriptor "short *" (sized_type_specifier "short" short) (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 6)" ( (binary_expression "param_1 + 6" identifier + number_literal) )))) = identifier) ;) (expression_statement "param_1[4] = (int)(piVar1 + 4);" (assignment_expression "param_1[4] = (int)(piVar1 + 4)" (subscript_expression "param_1[4]" identifier [ number_literal ]) = (cast_expression "(int)(piVar1 + 4)" ( (type_descriptor "int" primitive_type) ) (parenthesized_expression "(piVar1 + 4)" ( (binary_expression "piVar1 + 4" identifier + number_literal) )))) ;) (return_statement "return piVar1;" return identifier ;) })))
(translation_unit "RowSetEntry * rowSetEntryAlloc(RowSet *p)\n\n{\n  RowSetEntry *pRVar1;\n  RowSetChunk *pRVar2;\n  u16 uVar3;\n  undefined4 in_stack_fffffff4;\n  \n  if (p->nFresh == 0) {\n    pRVar2 = (RowSetChunk *)sqlite3DbMallocRawNN(p->db,CONCAT44(&_gp,in_stack_fffffff4));\n    if (pRVar2 == (RowSetChunk *)0x0) {\n      return (RowSetEntry *)0x0;\n    }\n    pRVar1 = pRVar2->aEntry;\n    uVar3 = 0x3e;\n    pRVar2->pNextChunk = p->pChunk;\n    p->pChunk = pRVar2;\n  }\n  else {\n    uVar3 = p->nFresh - 1;\n    pRVar1 = p->pFresh;\n  }\n  p->nFresh = uVar3;\n  p->pFresh = pRVar1 + 1;\n  return pRVar1;\n}\n\n" (function_definition "RowSetEntry * rowSetEntryAlloc(RowSet *p)\n\n{\n  RowSetEntry *pRVar1;\n  RowSetChunk *pRVar2;\n  u16 uVar3;\n  undefined4 in_stack_fffffff4;\n  \n  if (p->nFresh == 0) {\n    pRVar2 = (RowSetChunk *)sqlite3DbMallocRawNN(p->db,CONCAT44(&_gp,in_stack_fffffff4));\n    if (pRVar2 == (RowSetChunk *)0x0) {\n      return (RowSetEntry *)0x0;\n    }\n    pRVar1 = pRVar2->aEntry;\n    uVar3 = 0x3e;\n    pRVar2->pNextChunk = p->pChunk;\n    p->pChunk = pRVar2;\n  }\n  else {\n    uVar3 = p->nFresh - 1;\n    pRVar1 = p->pFresh;\n  }\n  p->nFresh = uVar3;\n  p->pFresh = pRVar1 + 1;\n  return pRVar1;\n}" type_identifier (pointer_declarator "* rowSetEntryAlloc(RowSet *p)" * (function_declarator "rowSetEntryAlloc(RowSet *p)" identifier (parameter_list "(RowSet *p)" ( (parameter_declaration "RowSet *p" type_identifier (pointer_declarator "*p" * identifier)) )))) (compound_statement "{\n  RowSetEntry *pRVar1;\n  RowSetChunk *pRVar2;\n  u16 uVar3;\n  undefined4 in_stack_fffffff4;\n  \n  if (p->nFresh == 0) {\n    pRVar2 = (RowSetChunk *)sqlite3DbMallocRawNN(p->db,CONCAT44(&_gp,in_stack_fffffff4));\n    if (pRVar2 == (RowSetChunk *)0x0) {\n      return (RowSetEntry *)0x0;\n    }\n    pRVar1 = pRVar2->aEntry;\n    uVar3 = 0x3e;\n    pRVar2->pNextChunk = p->pChunk;\n    p->pChunk = pRVar2;\n  }\n  else {\n    uVar3 = p->nFresh - 1;\n    pRVar1 = p->pFresh;\n  }\n  p->nFresh = uVar3;\n  p->pFresh = pRVar1 + 1;\n  return pRVar1;\n}" { (declaration "RowSetEntry *pRVar1;" type_identifier (pointer_declarator "*pRVar1" * identifier) ;) (declaration "RowSetChunk *pRVar2;" type_identifier (pointer_declarator "*pRVar2" * identifier) ;) (declaration "u16 uVar3;" type_identifier identifier ;) (declaration "undefined4 in_stack_fffffff4;" type_identifier identifier ;) (if_statement "if (p->nFresh == 0) {\n    pRVar2 = (RowSetChunk *)sqlite3DbMallocRawNN(p->db,CONCAT44(&_gp,in_stack_fffffff4));\n    if (pRVar2 == (RowSetChunk *)0x0) {\n      return (RowSetEntry *)0x0;\n    }\n    pRVar1 = pRVar2->aEntry;\n    uVar3 = 0x3e;\n    pRVar2->pNextChunk = p->pChunk;\n    p->pChunk = pRVar2;\n  }\n  else {\n    uVar3 = p->nFresh - 1;\n    pRVar1 = p->pFresh;\n  }" if (parenthesized_expression "(p->nFresh == 0)" ( (binary_expression "p->nFresh == 0" (field_expression "p->nFresh" identifier -> field_identifier) == number_literal) )) (compound_statement "{\n    pRVar2 = (RowSetChunk *)sqlite3DbMallocRawNN(p->db,CONCAT44(&_gp,in_stack_fffffff4));\n    if (pRVar2 == (RowSetChunk *)0x0) {\n      return (RowSetEntry *)0x0;\n    }\n    pRVar1 = pRVar2->aEntry;\n    uVar3 = 0x3e;\n    pRVar2->pNextChunk = p->pChunk;\n    p->pChunk = pRVar2;\n  }" { (expression_statement "pRVar2 = (RowSetChunk *)sqlite3DbMallocRawNN(p->db,CONCAT44(&_gp,in_stack_fffffff4));" (assignment_expression "pRVar2 = (RowSetChunk *)sqlite3DbMallocRawNN(p->db,CONCAT44(&_gp,in_stack_fffffff4))" identifier = (cast_expression "(RowSetChunk *)sqlite3DbMallocRawNN(p->db,CONCAT44(&_gp,in_stack_fffffff4))" ( (type_descriptor "RowSetChunk *" type_identifier (abstract_pointer_declarator "*" *)) ) (call_expression "sqlite3DbMallocRawNN(p->db,CONCAT44(&_gp,in_stack_fffffff4))" identifier (argument_list "(p->db,CONCAT44(&_gp,in_stack_fffffff4))" ( (field_expression "p->db" identifier -> field_identifier) , (call_expression "CONCAT44(&_gp,in_stack_fffffff4)" identifier (argument_list "(&_gp,in_stack_fffffff4)" ( (pointer_expression "&_gp" & identifier) , identifier ))) ))))) ;) (if_statement "if (pRVar2 == (RowSetChunk *)0x0) {\n      return (RowSetEntry *)0x0;\n    }" if (parenthesized_expression "(pRVar2 == (RowSetChunk *)0x0)" ( (binary_expression "pRVar2 == (RowSetChunk *)0x0" identifier == (cast_expression "(RowSetChunk *)0x0" ( (type_descriptor "RowSetChunk *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n      return (RowSetEntry *)0x0;\n    }" { (return_statement "return (RowSetEntry *)0x0;" return (cast_expression "(RowSetEntry *)0x0" ( (type_descriptor "RowSetEntry *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal) ;) })) (expression_statement "pRVar1 = pRVar2->aEntry;" (assignment_expression "pRVar1 = pRVar2->aEntry" identifier = (field_expression "pRVar2->aEntry" identifier -> field_identifier)) ;) (expression_statement "uVar3 = 0x3e;" (assignment_expression "uVar3 = 0x3e" identifier = number_literal) ;) (expression_statement "pRVar2->pNextChunk = p->pChunk;" (assignment_expression "pRVar2->pNextChunk = p->pChunk" (field_expression "pRVar2->pNextChunk" identifier -> field_identifier) = (field_expression "p->pChunk" identifier -> field_identifier)) ;) (expression_statement "p->pChunk = pRVar2;" (assignment_expression "p->pChunk = pRVar2" (field_expression "p->pChunk" identifier -> field_identifier) = identifier) ;) }) (else_clause "else {\n    uVar3 = p->nFresh - 1;\n    pRVar1 = p->pFresh;\n  }" else (compound_statement "{\n    uVar3 = p->nFresh - 1;\n    pRVar1 = p->pFresh;\n  }" { (expression_statement "uVar3 = p->nFresh - 1;" (assignment_expression "uVar3 = p->nFresh - 1" identifier = (binary_expression "p->nFresh - 1" (field_expression "p->nFresh" identifier -> field_identifier) - number_literal)) ;) (expression_statement "pRVar1 = p->pFresh;" (assignment_expression "pRVar1 = p->pFresh" identifier = (field_expression "p->pFresh" identifier -> field_identifier)) ;) }))) (expression_statement "p->nFresh = uVar3;" (assignment_expression "p->nFresh = uVar3" (field_expression "p->nFresh" identifier -> field_identifier) = identifier) ;) (expression_statement "p->pFresh = pRVar1 + 1;" (assignment_expression "p->pFresh = pRVar1 + 1" (field_expression "p->pFresh" identifier -> field_identifier) = (binary_expression "pRVar1 + 1" identifier + number_literal)) ;) (return_statement "return pRVar1;" return identifier ;) })))
(translation_unit "int * FUN_00038554(int *param_1,undefined4 param_2)\n\n{\n  int *piVar1;\n  int *piVar2;\n  short sVar3;\n  \n  if (*(short *)(param_1 + 6) == 0) {\n    piVar2 = (int *)FUN_00036c00(param_1[1],param_2,0,0x3f8);\n    if (piVar2 == (int *)0x0) {\n      return (int *)0x0;\n    }\n    piVar1 = piVar2 + 2;\n    sVar3 = 0x3e;\n    *piVar2 = *param_1;\n    *param_1 = (int)piVar2;\n  }\n  else {\n    sVar3 = *(short *)(param_1 + 6) + -1;\n    piVar1 = (int *)param_1[4];\n  }\n  *(short *)(param_1 + 6) = sVar3;\n  param_1[4] = (int)(piVar1 + 4);\n  return piVar1;\n}\n\n" (function_definition "int * FUN_00038554(int *param_1,undefined4 param_2)\n\n{\n  int *piVar1;\n  int *piVar2;\n  short sVar3;\n  \n  if (*(short *)(param_1 + 6) == 0) {\n    piVar2 = (int *)FUN_00036c00(param_1[1],param_2,0,0x3f8);\n    if (piVar2 == (int *)0x0) {\n      return (int *)0x0;\n    }\n    piVar1 = piVar2 + 2;\n    sVar3 = 0x3e;\n    *piVar2 = *param_1;\n    *param_1 = (int)piVar2;\n  }\n  else {\n    sVar3 = *(short *)(param_1 + 6) + -1;\n    piVar1 = (int *)param_1[4];\n  }\n  *(short *)(param_1 + 6) = sVar3;\n  param_1[4] = (int)(piVar1 + 4);\n  return piVar1;\n}" primitive_type (pointer_declarator "* FUN_00038554(int *param_1,undefined4 param_2)" * (function_declarator "FUN_00038554(int *param_1,undefined4 param_2)" identifier (parameter_list "(int *param_1,undefined4 param_2)" ( (parameter_declaration "int *param_1" primitive_type (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "undefined4 param_2" type_identifier identifier) )))) (compound_statement "{\n  int *piVar1;\n  int *piVar2;\n  short sVar3;\n  \n  if (*(short *)(param_1 + 6) == 0) {\n    piVar2 = (int *)FUN_00036c00(param_1[1],param_2,0,0x3f8);\n    if (piVar2 == (int *)0x0) {\n      return (int *)0x0;\n    }\n    piVar1 = piVar2 + 2;\n    sVar3 = 0x3e;\n    *piVar2 = *param_1;\n    *param_1 = (int)piVar2;\n  }\n  else {\n    sVar3 = *(short *)(param_1 + 6) + -1;\n    piVar1 = (int *)param_1[4];\n  }\n  *(short *)(param_1 + 6) = sVar3;\n  param_1[4] = (int)(piVar1 + 4);\n  return piVar1;\n}" { (declaration "int *piVar1;" primitive_type (pointer_declarator "*piVar1" * identifier) ;) (declaration "int *piVar2;" primitive_type (pointer_declarator "*piVar2" * identifier) ;) (declaration "short sVar3;" (sized_type_specifier "short" short) identifier ;) (if_statement "if (*(short *)(param_1 + 6) == 0) {\n    piVar2 = (int *)FUN_00036c00(param_1[1],param_2,0,0x3f8);\n    if (piVar2 == (int *)0x0) {\n      return (int *)0x0;\n    }\n    piVar1 = piVar2 + 2;\n    sVar3 = 0x3e;\n    *piVar2 = *param_1;\n    *param_1 = (int)piVar2;\n  }\n  else {\n    sVar3 = *(short *)(param_1 + 6) + -1;\n    piVar1 = (int *)param_1[4];\n  }" if (parenthesized_expression "(*(short *)(param_1 + 6) == 0)" ( (binary_expression "*(short *)(param_1 + 6) == 0" (pointer_expression "*(short *)(param_1 + 6)" * (cast_expression "(short *)(param_1 + 6)" ( (type_descriptor "short *" (sized_type_specifier "short" short) (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 6)" ( (binary_expression "param_1 + 6" identifier + number_literal) )))) == number_literal) )) (compound_statement "{\n    piVar2 = (int *)FUN_00036c00(param_1[1],param_2,0,0x3f8);\n    if (piVar2 == (int *)0x0) {\n      return (int *)0x0;\n    }\n    piVar1 = piVar2 + 2;\n    sVar3 = 0x3e;\n    *piVar2 = *param_1;\n    *param_1 = (int)piVar2;\n  }" { (expression_statement "piVar2 = (int *)FUN_00036c00(param_1[1],param_2,0,0x3f8);" (assignment_expression "piVar2 = (int *)FUN_00036c00(param_1[1],param_2,0,0x3f8)" identifier = (cast_expression "(int *)FUN_00036c00(param_1[1],param_2,0,0x3f8)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "FUN_00036c00(param_1[1],param_2,0,0x3f8)" identifier (argument_list "(param_1[1],param_2,0,0x3f8)" ( (subscript_expression "param_1[1]" identifier [ number_literal ]) , identifier , number_literal , number_literal ))))) ;) (if_statement "if (piVar2 == (int *)0x0) {\n      return (int *)0x0;\n    }" if (parenthesized_expression "(piVar2 == (int *)0x0)" ( (binary_expression "piVar2 == (int *)0x0" identifier == (cast_expression "(int *)0x0" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n      return (int *)0x0;\n    }" { (return_statement "return (int *)0x0;" return (cast_expression "(int *)0x0" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal) ;) })) (expression_statement "piVar1 = piVar2 + 2;" (assignment_expression "piVar1 = piVar2 + 2" identifier = (binary_expression "piVar2 + 2" identifier + number_literal)) ;) (expression_statement "sVar3 = 0x3e;" (assignment_expression "sVar3 = 0x3e" identifier = number_literal) ;) (expression_statement "*piVar2 = *param_1;" (assignment_expression "*piVar2 = *param_1" (pointer_expression "*piVar2" * identifier) = (pointer_expression "*param_1" * identifier)) ;) (expression_statement "*param_1 = (int)piVar2;" (assignment_expression "*param_1 = (int)piVar2" (pointer_expression "*param_1" * identifier) = (cast_expression "(int)piVar2" ( (type_descriptor "int" primitive_type) ) identifier)) ;) }) (else_clause "else {\n    sVar3 = *(short *)(param_1 + 6) + -1;\n    piVar1 = (int *)param_1[4];\n  }" else (compound_statement "{\n    sVar3 = *(short *)(param_1 + 6) + -1;\n    piVar1 = (int *)param_1[4];\n  }" { (expression_statement "sVar3 = *(short *)(param_1 + 6) + -1;" (assignment_expression "sVar3 = *(short *)(param_1 + 6) + -1" identifier = (binary_expression "*(short *)(param_1 + 6) + -1" (pointer_expression "*(short *)(param_1 + 6)" * (cast_expression "(short *)(param_1 + 6)" ( (type_descriptor "short *" (sized_type_specifier "short" short) (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 6)" ( (binary_expression "param_1 + 6" identifier + number_literal) )))) + number_literal)) ;) (expression_statement "piVar1 = (int *)param_1[4];" (assignment_expression "piVar1 = (int *)param_1[4]" identifier = (cast_expression "(int *)param_1[4]" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (subscript_expression "param_1[4]" identifier [ number_literal ]))) ;) }))) (expression_statement "*(short *)(param_1 + 6) = sVar3;" (assignment_expression "*(short *)(param_1 + 6) = sVar3" (pointer_expression "*(short *)(param_1 + 6)" * (cast_expression "(short *)(param_1 + 6)" ( (type_descriptor "short *" (sized_type_specifier "short" short) (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 6)" ( (binary_expression "param_1 + 6" identifier + number_literal) )))) = identifier) ;) (expression_statement "param_1[4] = (int)(piVar1 + 4);" (assignment_expression "param_1[4] = (int)(piVar1 + 4)" (subscript_expression "param_1[4]" identifier [ number_literal ]) = (cast_expression "(int)(piVar1 + 4)" ( (type_descriptor "int" primitive_type) ) (parenthesized_expression "(piVar1 + 4)" ( (binary_expression "piVar1 + 4" identifier + number_literal) )))) ;) (return_statement "return piVar1;" return identifier ;) })))
(translation_unit (function_definition TYPE (pointer_declarator * (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE (pointer_declarator * IDENT)) , (parameter_declaration TYPE IDENT) )))) (compound_statement { (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration (sized_type_specifier short) IDENT ;) (if_statement if (parenthesized_expression ( (binary_expression (pointer_expression * (cast_expression ( (type_descriptor (sized_type_specifier short) (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) == LIT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (call_expression IDENT (argument_list ( (subscript_expression IDENT [ LIT ]) , IDENT , LIT , LIT ))))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) LIT)) )) (compound_statement { (return_statement return (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) LIT) ;) })) (expression_statement (assignment_expression IDENT = (binary_expression IDENT + LIT)) ;) (expression_statement (assignment_expression IDENT = LIT) ;) (expression_statement (assignment_expression (pointer_expression * IDENT) = (pointer_expression * IDENT)) ;) (expression_statement (assignment_expression (pointer_expression * IDENT) = (cast_expression ( (type_descriptor TYPE) ) IDENT)) ;) }) (else_clause else (compound_statement { (expression_statement (assignment_expression IDENT = (binary_expression (pointer_expression * (cast_expression ( (type_descriptor (sized_type_specifier short) (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) + LIT)) ;) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (subscript_expression IDENT [ LIT ]))) ;) }))) (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 (subscript_expression IDENT [ LIT ]) = (cast_expression ( (type_descriptor TYPE) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) ;) (return_statement return IDENT ;) })))
(function_definition "int * FUN_00038554(int *param_1,undefined4 param_2)\n\n{\n  int *piVar1;\n  int *piVar2;\n  short sVar3;\n  \n  if (*(short *)(param_1 + 6) == 0) {\n    piVar2 = (int *)FUN_00036c00(param_1[1],param_2,0,0x3f8);\n    if (piVar2 == (int *)0x0) {\n      return (int *)0x0;\n    }\n    piVar1 = piVar2 + 2;\n    sVar3 = 0x3e;\n    *piVar2 = *param_1;\n    *param_1 = (int)piVar2;\n  }\n  else {\n    sVar3 = *(short *)(param_1 + 6) + -1;\n    piVar1 = (int *)param_1[4];\n  }\n  *(short *)(param_1 + 6) = sVar3;\n  param_1[4] = (int)(piVar1 + 4);\n  return piVar1;\n}" (primitive_type "int") (pointer_declarator "* FUN_00038554(int *param_1,undefined4 param_2)" (* "*") (function_declarator "FUN_00038554(int *param_1,undefined4 param_2)" (identifier "FUN_00038554") (parameter_list "(int *param_1,undefined4 param_2)" (( "(") (parameter_declaration "int *param_1" (primitive_type "int") (pointer_declarator "*param_1" (* "*") (identifier "param_1"))) (, ",") (parameter_declaration "undefined4 param_2" (type_identifier "undefined4") (identifier "param_2")) () ")")))) (compound_statement "{\n  int *piVar1;\n  int *piVar2;\n  short sVar3;\n  \n  if (*(short *)(param_1 + 6) == 0) {\n    piVar2 = (int *)FUN_00036c00(param_1[1],param_2,0,0x3f8);\n    if (piVar2 == (int *)0x0) {\n      return (int *)0x0;\n    }\n    piVar1 = piVar2 + 2;\n    sVar3 = 0x3e;\n    *piVar2 = *param_1;\n    *param_1 = (int)piVar2;\n  }\n  else {\n    sVar3 = *(short *)(param_1 + 6) + -1;\n    piVar1 = (int *)param_1[4];\n  }\n  *(short *)(param_1 + 6) = sVar3;\n  param_1[4] = (int)(piVar1 + 4);\n  return piVar1;\n}" ({ "{") (declaration "int *piVar1;" (primitive_type "int") (pointer_declarator "*piVar1" (* "*") (identifier "piVar1")) (; ";")) (declaration "int *piVar2;" (primitive_type "int") (pointer_declarator "*piVar2" (* "*") (identifier "piVar2")) (; ";")) (declaration "short sVar3;" (sized_type_specifier "short" (short "short")) (identifier "sVar3") (; ";")) (if_statement "if (*(short *)(param_1 + 6) == 0) {\n    piVar2 = (int *)FUN_00036c00(param_1[1],param_2,0,0x3f8);\n    if (piVar2 == (int *)0x0) {\n      return (int *)0x0;\n    }\n    piVar1 = piVar2 + 2;\n    sVar3 = 0x3e;\n    *piVar2 = *param_1;\n    *param_1 = (int)piVar2;\n  }\n  else {\n    sVar3 = *(short *)(param_1 + 6) + -1;\n    piVar1 = (int *)param_1[4];\n  }" (if "if") (parenthesized_expression "(*(short *)(param_1 + 6) == 0)" (( "(") (binary_expression "*(short *)(param_1 + 6) == 0" (pointer_expression "*(short *)(param_1 + 6)" (* "*") (cast_expression "(short *)(param_1 + 6)" (( "(") (type_descriptor "short *" (sized_type_specifier "short" (short "short")) (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 6)" (( "(") (binary_expression "param_1 + 6" (identifier "param_1") (+ "+") (number_literal "6")) () ")")))) (== "==") (number_literal "0")) () ")")) (compound_statement "{\n    piVar2 = (int *)FUN_00036c00(param_1[1],param_2,0,0x3f8);\n    if (piVar2 == (int *)0x0) {\n      return (int *)0x0;\n    }\n    piVar1 = piVar2 + 2;\n    sVar3 = 0x3e;\n    *piVar2 = *param_1;\n    *param_1 = (int)piVar2;\n  }" ({ "{") (expression_statement "piVar2 = (int *)FUN_00036c00(param_1[1],param_2,0,0x3f8);" (assignment_expression "piVar2 = (int *)FUN_00036c00(param_1[1],param_2,0,0x3f8)" (identifier "piVar2") (= "=") (cast_expression "(int *)FUN_00036c00(param_1[1],param_2,0,0x3f8)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (call_expression "FUN_00036c00(param_1[1],param_2,0,0x3f8)" (identifier "FUN_00036c00") (argument_list "(param_1[1],param_2,0,0x3f8)" (( "(") (subscript_expression "param_1[1]" (identifier "param_1") ([ "[") (number_literal "1") (] "]")) (, ",") (identifier "param_2") (, ",") (number_literal "0") (, ",") (number_literal "0x3f8") () ")"))))) (; ";")) (if_statement "if (piVar2 == (int *)0x0) {\n      return (int *)0x0;\n    }" (if "if") (parenthesized_expression "(piVar2 == (int *)0x0)" (( "(") (binary_expression "piVar2 == (int *)0x0" (identifier "piVar2") (== "==") (cast_expression "(int *)0x0" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0x0"))) () ")")) (compound_statement "{\n      return (int *)0x0;\n    }" ({ "{") (return_statement "return (int *)0x0;" (return "return") (cast_expression "(int *)0x0" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0x0")) (; ";")) (} "}"))) (expression_statement "piVar1 = piVar2 + 2;" (assignment_expression "piVar1 = piVar2 + 2" (identifier "piVar1") (= "=") (binary_expression "piVar2 + 2" (identifier "piVar2") (+ "+") (number_literal "2"))) (; ";")) (expression_statement "sVar3 = 0x3e;" (assignment_expression "sVar3 = 0x3e" (identifier "sVar3") (= "=") (number_literal "0x3e")) (; ";")) (expression_statement "*piVar2 = *param_1;" (assignment_expression "*piVar2 = *param_1" (pointer_expression "*piVar2" (* "*") (identifier "piVar2")) (= "=") (pointer_expression "*param_1" (* "*") (identifier "param_1"))) (; ";")) (expression_statement "*param_1 = (int)piVar2;" (assignment_expression "*param_1 = (int)piVar2" (pointer_expression "*param_1" (* "*") (identifier "param_1")) (= "=") (cast_expression "(int)piVar2" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (identifier "piVar2"))) (; ";")) (} "}")) (else_clause "else {\n    sVar3 = *(short *)(param_1 + 6) + -1;\n    piVar1 = (int *)param_1[4];\n  }" (else "else") (compound_statement "{\n    sVar3 = *(short *)(param_1 + 6) + -1;\n    piVar1 = (int *)param_1[4];\n  }" ({ "{") (expression_statement "sVar3 = *(short *)(param_1 + 6) + -1;" (assignment_expression "sVar3 = *(short *)(param_1 + 6) + -1" (identifier "sVar3") (= "=") (binary_expression "*(short *)(param_1 + 6) + -1" (pointer_expression "*(short *)(param_1 + 6)" (* "*") (cast_expression "(short *)(param_1 + 6)" (( "(") (type_descriptor "short *" (sized_type_specifier "short" (short "short")) (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 6)" (( "(") (binary_expression "param_1 + 6" (identifier "param_1") (+ "+") (number_literal "6")) () ")")))) (+ "+") (number_literal "-1"))) (; ";")) (expression_statement "piVar1 = (int *)param_1[4];" (assignment_expression "piVar1 = (int *)param_1[4]" (identifier "piVar1") (= "=") (cast_expression "(int *)param_1[4]" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (subscript_expression "param_1[4]" (identifier "param_1") ([ "[") (number_literal "4") (] "]")))) (; ";")) (} "}")))) (expression_statement "*(short *)(param_1 + 6) = sVar3;" (assignment_expression "*(short *)(param_1 + 6) = sVar3" (pointer_expression "*(short *)(param_1 + 6)" (* "*") (cast_expression "(short *)(param_1 + 6)" (( "(") (type_descriptor "short *" (sized_type_specifier "short" (short "short")) (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 6)" (( "(") (binary_expression "param_1 + 6" (identifier "param_1") (+ "+") (number_literal "6")) () ")")))) (= "=") (identifier "sVar3")) (; ";")) (expression_statement "param_1[4] = (int)(piVar1 + 4);" (assignment_expression "param_1[4] = (int)(piVar1 + 4)" (subscript_expression "param_1[4]" (identifier "param_1") ([ "[") (number_literal "4") (] "]")) (= "=") (cast_expression "(int)(piVar1 + 4)" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (parenthesized_expression "(piVar1 + 4)" (( "(") (binary_expression "piVar1 + 4" (identifier "piVar1") (+ "+") (number_literal "4")) () ")")))) (; ";")) (return_statement "return piVar1;" (return "return") (identifier "piVar1") (; ";")) (} "}")))

type_1 * function_1(type_2 *p)

{
  type_1 *var_4;
  type_3 *var_3;
  type_4 uVar3;
  type_5 in_stack_fffffff4;
  
  if (p->nFresh == 0) {
    var_3 = (type_3 *)var_1(p->db,var_2(&_gp,in_stack_fffffff4));
    if (var_3 == (type_3 *)0x0) {
      return (type_1 *)0x0;
    }
    var_4 = var_3->aEntry;
    uVar3 = 0x3e;
    var_3->pNextChunk = p->pChunk;
    p->pChunk = var_3;
  }
  else {
    uVar3 = p->nFresh - 1;
    var_4 = p->pFresh;
  }
  p->nFresh = uVar3;
  p->pFresh = var_4 + 1;
  return var_4;
}


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

int * MASKED(int *param_1,undefined4 param_2)

{
  int *piVar1;
  int *piVar2;
  short sVar3;
  
  if (*(short *)(param_1 + 6) == 0) {
    piVar2 = (int *)FUN_00036c00(param_1[1],param_2,0,0x3f8);
    if (piVar2 == (int *)0x0) {
      return (int *)0x0;
    }
    piVar1 = piVar2 + 2;
    sVar3 = 0x3e;
    *piVar2 = *param_1;
    *param_1 = (int)piVar2;
  }
  else {
    sVar3 = *(short *)(param_1 + 6) + -1;
    piVar1 = (int *)param_1[4];
  }
  *(short *)(param_1 + 6) = sVar3;
  param_1[4] = (int)(piVar1 + 4);
  return piVar1;
}

