
/* WARNING: Unknown calling convention */

void jsonArrayFinal(sqlite3_context *ctx)

{
  uint *puVar1;
  u16 *puVar2;
  Mem *pMVar3;
  _func_void_void_ptr *p_Var4;
  int iVar5;
  JsonString *p;
  sqlite3_context *p_1;
  int unaff_EDI;
  int in_stack_ffffffdc;
  u8 in_stack_ffffffe0;
  _func_void_void_ptr *in_stack_ffffffe4;
  uint local_14;
  uint local_10;
  
  __x86_get_pc_thunk_di();
  pMVar3 = ctx->pMem;
  if ((pMVar3->flags & 0x2000) == 0) {
    in_stack_ffffffe0 = 'H';
    p = (JsonString *)createAggContext((sqlite3_context *)&ctx->pFunc,(int)pMVar3,p_1);
  }
  else {
    p = (JsonString *)pMVar3->z;
  }
  if (p == (JsonString *)0x0) {
    p_Var4 = (_func_void_void_ptr *)0x0;
    iVar5 = sqlite3VdbeMemSetStr
                      ((Mem *)&DAT_00000001,(char *)0x0,in_stack_ffffffdc,in_stack_ffffffe0,
                       in_stack_ffffffe4);
    if (iVar5 == 0x12) {
      ctx->isError = 0x12;
      sqlite3VdbeMemSetStr(ctx->pOut,(char *)(unaff_EDI + 0xbbe56),1,'\0',p_Var4);
    }
    goto LAB_000a0ae6;
  }
  local_14 = (uint)p->nUsed;
  local_10 = *(uint *)((int)&p->nUsed + 4);
  p->pCtx = ctx;
  puVar1 = (uint *)((int)&p->nAlloc + 4);
  if (local_10 < *puVar1 || local_10 - *puVar1 < (uint)(local_14 < (uint)p->nAlloc)) {
LAB_000a0a8b:
    *(uint *)&p->nUsed = local_14 + 1;
    *(uint *)((int)&p->nUsed + 4) = local_10 + (0xfffffffe < local_14);
    p->zBuf[local_14] = ']';
  }
  else {
    in_stack_ffffffe0 = '$';
    iVar5 = jsonGrow(p,1);
    if (iVar5 == 0) {
      local_14 = (uint)p->nUsed;
      local_10 = *(uint *)((int)&p->nUsed + 4);
      goto LAB_000a0a8b;
    }
  }
  if (p->bErr == '\0') {
    p_Var4 = (_func_void_void_ptr *)(unaff_EDI + -0x5ca46);
    if (p->bStatic != '\0') {
      p_Var4 = (_func_void_void_ptr *)&DAT_ffffffff;
    }
    iVar5 = sqlite3VdbeMemSetStr
                      ((Mem *)&DAT_00000001,(char *)p_Var4,in_stack_ffffffdc,in_stack_ffffffe0,
                       in_stack_ffffffe4);
    if (iVar5 == 0x12) {
      ctx->isError = 0x12;
      sqlite3VdbeMemSetStr(ctx->pOut,(char *)(unaff_EDI + 0xbbe56),1,'\0',p_Var4);
    }
    p->bStatic = '\x01';
  }
  else if (p->bErr == '\x01') {
    sqlite3_result_error_nomem(ctx);
  }
LAB_000a0ae6:
  pMVar3 = ctx->pOut;
  pMVar3->eSubtype = 'J';
  puVar2 = &pMVar3->flags;
  *puVar2 = *puVar2 | 0x8000;
  return;
}



void FUN_000a0a40(int *param_1)

{
  ushort *puVar1;
  int iVar2;
  undefined4 *puVar3;
  int unaff_EDI;
  uint local_14;
  uint local_10;
  
  FUN_0003a401();
  if ((*(byte *)(param_1[2] + 9) & 0x20) == 0) {
    puVar3 = (undefined4 *)FUN_0004c400();
  }
  else {
    puVar3 = *(undefined4 **)(param_1[2] + 0x10);
  }
  if (puVar3 == (undefined4 *)0x0) {
    iVar2 = FUN_000715f0(1,0);
    if (iVar2 == 0x12) {
      param_1[5] = 0x12;
      FUN_0006f5d0(0);
    }
    goto LAB_000a0ae6;
  }
  local_14 = puVar3[4];
  local_10 = puVar3[5];
  *puVar3 = param_1;
  if (local_10 < (uint)puVar3[3] || local_10 - puVar3[3] < (uint)(local_14 < (uint)puVar3[2])) {
LAB_000a0a8b:
    puVar3[4] = local_14 + 1;
    puVar3[5] = local_10 + (0xfffffffe < local_14);
    *(undefined1 *)(local_14 + puVar3[1]) = 0x5d;
  }
  else {
    iVar2 = FUN_0009f0a0();
    if (iVar2 == 0) {
      local_14 = puVar3[4];
      local_10 = puVar3[5];
      goto LAB_000a0a8b;
    }
  }
  if (*(char *)((int)puVar3 + 0x19) == '\0') {
    iVar2 = unaff_EDI + -0x5ca46;
    if (*(char *)(puVar3 + 6) != '\0') {
      iVar2 = -1;
    }
    iVar2 = FUN_000715f0(1,iVar2);
    if (iVar2 == 0x12) {
      param_1[5] = 0x12;
      FUN_0006f5d0(0);
    }
    *(undefined1 *)(puVar3 + 6) = 1;
  }
  else if (*(char *)((int)puVar3 + 0x19) == '\x01') {
    FUN_0004e320(param_1);
  }
LAB_000a0ae6:
  iVar2 = *param_1;
  *(undefined1 *)(iVar2 + 0xb) = 0x4a;
  puVar1 = (ushort *)(iVar2 + 8);
  *puVar1 = *puVar1 | 0x8000;
  return;
}


PUSH EDI
CALL 0x0003a401
ADD EDI,0x11a3e2
PUSH ESI
PUSH EBX
SUB ESP,0x10
MOV ESI,dword ptr [ESP + 0x20]
MOV EDX,dword ptr [ESI + 0x8]
TEST byte ptr [EDX + 0x9],0x20
JZ 0x000a0b40
MOV EBX,dword ptr [EDX + 0x10]
TEST EBX,EBX
JZ 0x000a0b52
MOV EAX,dword ptr [EBX + 0x10]
MOV EDX,dword ptr [EBX + 0x14]
MOV dword ptr [EBX],ESI
CMP EAX,dword ptr [EBX + 0x8]
MOV dword ptr [ESP + 0x8],EAX
MOV EAX,EDX
SBB EAX,dword ptr [EBX + 0xc]
MOV dword ptr [ESP + 0xc],EDX
JNC 0x000a0b18
MOV EDX,dword ptr [ESP + 0x8]
MOV ECX,dword ptr [ESP + 0xc]
MOV EAX,dword ptr [ESP + 0x8]
ADD EDX,0x1
ADC ECX,0x0
ADD EAX,dword ptr [EBX + 0x4]
MOV dword ptr [EBX + 0x10],EDX
MOV dword ptr [EBX + 0x14],ECX
MOV byte ptr [EAX],0x5d
MOVZX EAX,byte ptr [EBX + 0x19]
TEST AL,AL
JNZ 0x000a0b00
CMP byte ptr [EBX + 0x18],0x0
MOV EDX,0xffffffff
LEA EAX,[EDI + 0xffe891d8]
MOV ECX,dword ptr [EBX + 0x10]
CMOVNZ EAX,EDX
SUB ESP,0x8
MOV EDX,dword ptr [EBX + 0x4]
PUSH EAX
PUSH 0x1
MOV EAX,dword ptr [ESI]
CALL 0x000715f0
ADD ESP,0x10
CMP EAX,0x12
JZ 0x000a0ba0
MOV byte ptr [EBX + 0x18],0x1
MOV EAX,dword ptr [ESI]
MOV byte ptr [EAX + 0xb],0x4a
OR word ptr [EAX + 0x8],0x8000
ADD ESP,0x10
POP EBX
POP ESI
POP EDI
RET
CMP AL,0x1
JNZ 0x000a0ae6
SUB ESP,0xc
PUSH ESI
CALL 0x0004e320
ADD ESP,0x10
JMP 0x000a0ae6
MOV EDX,0x1
MOV EAX,EBX
CALL 0x0009f0a0
TEST EAX,EAX
JNZ 0x000a0aa9
MOV EAX,dword ptr [EBX + 0x10]
MOV EDX,dword ptr [EBX + 0x14]
MOV dword ptr [ESP + 0x8],EAX
MOV dword ptr [ESP + 0xc],EDX
JMP 0x000a0a8b
LEA EAX,[ESI + 0x4]
CALL 0x0004c400
MOV EBX,EAX
TEST EBX,EBX
JNZ 0x000a0a6d
SUB ESP,0x8
MOV ECX,0x2
LEA EDX,[EDI + 0xfffa21c5]
PUSH 0x0
PUSH 0x1
MOV EAX,dword ptr [ESI]
CALL 0x000715f0
ADD ESP,0x10
CMP EAX,0x12
JNZ 0x000a0ae6
SUB ESP,0xc
MOV dword ptr [ESI + 0x14],0x12
MOV ECX,0x1
LEA EDX,[EDI + 0xfffa1a74]
PUSH 0x0
MOV EAX,dword ptr [ESI]
CALL 0x0006f5d0
ADD ESP,0x10
JMP 0x000a0ae6
SUB ESP,0xc
MOV dword ptr [ESI + 0x14],0x12
MOV ECX,0x1
LEA EDX,[EDI + 0xfffa1a74]
PUSH 0x0
MOV EAX,dword ptr [ESI]
CALL 0x0006f5d0
ADD ESP,0x10
JMP 0x000a0ae2
(translation_unit "void FUN_000a0a40(int *param_1)\n\n{\n  ushort *puVar1;\n  int iVar2;\n  undefined4 *puVar3;\n  int unaff_EDI;\n  uint local_14;\n  uint local_10;\n  \n  FUN_0003a401();\n  if ((*(byte *)(param_1[2] + 9) & 0x20) == 0) {\n    puVar3 = (undefined4 *)FUN_0004c400();\n  }\n  else {\n    puVar3 = *(undefined4 **)(param_1[2] + 0x10);\n  }\n  if (puVar3 == (undefined4 *)0x0) {\n    iVar2 = FUN_000715f0(1,0);\n    if (iVar2 == 0x12) {\n      param_1[5] = 0x12;\n      FUN_0006f5d0(0);\n    }\n    goto LAB_000a0ae6;\n  }\n  local_14 = puVar3[4];\n  local_10 = puVar3[5];\n  *puVar3 = param_1;\n  if (local_10 < (uint)puVar3[3] || local_10 - puVar3[3] < (uint)(local_14 < (uint)puVar3[2])) {\nLAB_000a0a8b:\n    puVar3[4] = local_14 + 1;\n    puVar3[5] = local_10 + (0xfffffffe < local_14);\n    *(undefined1 *)(local_14 + puVar3[1]) = 0x5d;\n  }\n  else {\n    iVar2 = FUN_0009f0a0();\n    if (iVar2 == 0) {\n      local_14 = puVar3[4];\n      local_10 = puVar3[5];\n      goto LAB_000a0a8b;\n    }\n  }\n  if (*(char *)((int)puVar3 + 0x19) == '\0') {\n    iVar2 = unaff_EDI + -0x5ca46;\n    if (*(char *)(puVar3 + 6) != '\0') {\n      iVar2 = -1;\n    }\n    iVar2 = FUN_000715f0(1,iVar2);\n    if (iVar2 == 0x12) {\n      param_1[5] = 0x12;\n      FUN_0006f5d0(0);\n    }\n    *(undefined1 *)(puVar3 + 6) = 1;\n  }\n  else if (*(char *)((int)puVar3 + 0x19) == '\x01') {\n    FUN_0004e320(param_1);\n  }\nLAB_000a0ae6:\n  iVar2 = *param_1;\n  *(undefined1 *)(iVar2 + 0xb) = 0x4a;\n  puVar1 = (ushort *)(iVar2 + 8);\n  *puVar1 = *puVar1 | 0x8000;\n  return;\n}\n\n" (function_definition "void FUN_000a0a40(int *param_1)\n\n{\n  ushort *puVar1;\n  int iVar2;\n  undefined4 *puVar3;\n  int unaff_EDI;\n  uint local_14;\n  uint local_10;\n  \n  FUN_0003a401();\n  if ((*(byte *)(param_1[2] + 9) & 0x20) == 0) {\n    puVar3 = (undefined4 *)FUN_0004c400();\n  }\n  else {\n    puVar3 = *(undefined4 **)(param_1[2] + 0x10);\n  }\n  if (puVar3 == (undefined4 *)0x0) {\n    iVar2 = FUN_000715f0(1,0);\n    if (iVar2 == 0x12) {\n      param_1[5] = 0x12;\n      FUN_0006f5d0(0);\n    }\n    goto LAB_000a0ae6;\n  }\n  local_14 = puVar3[4];\n  local_10 = puVar3[5];\n  *puVar3 = param_1;\n  if (local_10 < (uint)puVar3[3] || local_10 - puVar3[3] < (uint)(local_14 < (uint)puVar3[2])) {\nLAB_000a0a8b:\n    puVar3[4] = local_14 + 1;\n    puVar3[5] = local_10 + (0xfffffffe < local_14);\n    *(undefined1 *)(local_14 + puVar3[1]) = 0x5d;\n  }\n  else {\n    iVar2 = FUN_0009f0a0();\n    if (iVar2 == 0) {\n      local_14 = puVar3[4];\n      local_10 = puVar3[5];\n      goto LAB_000a0a8b;\n    }\n  }\n  if (*(char *)((int)puVar3 + 0x19) == '\0') {\n    iVar2 = unaff_EDI + -0x5ca46;\n    if (*(char *)(puVar3 + 6) != '\0') {\n      iVar2 = -1;\n    }\n    iVar2 = FUN_000715f0(1,iVar2);\n    if (iVar2 == 0x12) {\n      param_1[5] = 0x12;\n      FUN_0006f5d0(0);\n    }\n    *(undefined1 *)(puVar3 + 6) = 1;\n  }\n  else if (*(char *)((int)puVar3 + 0x19) == '\x01') {\n    FUN_0004e320(param_1);\n  }\nLAB_000a0ae6:\n  iVar2 = *param_1;\n  *(undefined1 *)(iVar2 + 0xb) = 0x4a;\n  puVar1 = (ushort *)(iVar2 + 8);\n  *puVar1 = *puVar1 | 0x8000;\n  return;\n}" primitive_type (function_declarator "FUN_000a0a40(int *param_1)" identifier (parameter_list "(int *param_1)" ( (parameter_declaration "int *param_1" primitive_type (pointer_declarator "*param_1" * identifier)) ))) (compound_statement "{\n  ushort *puVar1;\n  int iVar2;\n  undefined4 *puVar3;\n  int unaff_EDI;\n  uint local_14;\n  uint local_10;\n  \n  FUN_0003a401();\n  if ((*(byte *)(param_1[2] + 9) & 0x20) == 0) {\n    puVar3 = (undefined4 *)FUN_0004c400();\n  }\n  else {\n    puVar3 = *(undefined4 **)(param_1[2] + 0x10);\n  }\n  if (puVar3 == (undefined4 *)0x0) {\n    iVar2 = FUN_000715f0(1,0);\n    if (iVar2 == 0x12) {\n      param_1[5] = 0x12;\n      FUN_0006f5d0(0);\n    }\n    goto LAB_000a0ae6;\n  }\n  local_14 = puVar3[4];\n  local_10 = puVar3[5];\n  *puVar3 = param_1;\n  if (local_10 < (uint)puVar3[3] || local_10 - puVar3[3] < (uint)(local_14 < (uint)puVar3[2])) {\nLAB_000a0a8b:\n    puVar3[4] = local_14 + 1;\n    puVar3[5] = local_10 + (0xfffffffe < local_14);\n    *(undefined1 *)(local_14 + puVar3[1]) = 0x5d;\n  }\n  else {\n    iVar2 = FUN_0009f0a0();\n    if (iVar2 == 0) {\n      local_14 = puVar3[4];\n      local_10 = puVar3[5];\n      goto LAB_000a0a8b;\n    }\n  }\n  if (*(char *)((int)puVar3 + 0x19) == '\0') {\n    iVar2 = unaff_EDI + -0x5ca46;\n    if (*(char *)(puVar3 + 6) != '\0') {\n      iVar2 = -1;\n    }\n    iVar2 = FUN_000715f0(1,iVar2);\n    if (iVar2 == 0x12) {\n      param_1[5] = 0x12;\n      FUN_0006f5d0(0);\n    }\n    *(undefined1 *)(puVar3 + 6) = 1;\n  }\n  else if (*(char *)((int)puVar3 + 0x19) == '\x01') {\n    FUN_0004e320(param_1);\n  }\nLAB_000a0ae6:\n  iVar2 = *param_1;\n  *(undefined1 *)(iVar2 + 0xb) = 0x4a;\n  puVar1 = (ushort *)(iVar2 + 8);\n  *puVar1 = *puVar1 | 0x8000;\n  return;\n}" { (declaration "ushort *puVar1;" type_identifier (pointer_declarator "*puVar1" * identifier) ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "undefined4 *puVar3;" type_identifier (pointer_declarator "*puVar3" * identifier) ;) (declaration "int unaff_EDI;" primitive_type identifier ;) (declaration "uint local_14;" type_identifier identifier ;) (declaration "uint local_10;" type_identifier identifier ;) (expression_statement "FUN_0003a401();" (call_expression "FUN_0003a401()" identifier (argument_list "()" ( ))) ;) (if_statement "if ((*(byte *)(param_1[2] + 9) & 0x20) == 0) {\n    puVar3 = (undefined4 *)FUN_0004c400();\n  }\n  else {\n    puVar3 = *(undefined4 **)(param_1[2] + 0x10);\n  }" if (parenthesized_expression "((*(byte *)(param_1[2] + 9) & 0x20) == 0)" ( (binary_expression "(*(byte *)(param_1[2] + 9) & 0x20) == 0" (parenthesized_expression "(*(byte *)(param_1[2] + 9) & 0x20)" ( (binary_expression "*(byte *)(param_1[2] + 9) & 0x20" (pointer_expression "*(byte *)(param_1[2] + 9)" * (cast_expression "(byte *)(param_1[2] + 9)" ( (type_descriptor "byte *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1[2] + 9)" ( (binary_expression "param_1[2] + 9" (subscript_expression "param_1[2]" identifier [ number_literal ]) + number_literal) )))) & number_literal) )) == number_literal) )) (compound_statement "{\n    puVar3 = (undefined4 *)FUN_0004c400();\n  }" { (expression_statement "puVar3 = (undefined4 *)FUN_0004c400();" (assignment_expression "puVar3 = (undefined4 *)FUN_0004c400()" identifier = (cast_expression "(undefined4 *)FUN_0004c400()" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (call_expression "FUN_0004c400()" identifier (argument_list "()" ( ))))) ;) }) (else_clause "else {\n    puVar3 = *(undefined4 **)(param_1[2] + 0x10);\n  }" else (compound_statement "{\n    puVar3 = *(undefined4 **)(param_1[2] + 0x10);\n  }" { (expression_statement "puVar3 = *(undefined4 **)(param_1[2] + 0x10);" (assignment_expression "puVar3 = *(undefined4 **)(param_1[2] + 0x10)" identifier = (pointer_expression "*(undefined4 **)(param_1[2] + 0x10)" * (cast_expression "(undefined4 **)(param_1[2] + 0x10)" ( (type_descriptor "undefined4 **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(param_1[2] + 0x10)" ( (binary_expression "param_1[2] + 0x10" (subscript_expression "param_1[2]" identifier [ number_literal ]) + number_literal) ))))) ;) }))) (if_statement "if (puVar3 == (undefined4 *)0x0) {\n    iVar2 = FUN_000715f0(1,0);\n    if (iVar2 == 0x12) {\n      param_1[5] = 0x12;\n      FUN_0006f5d0(0);\n    }\n    goto LAB_000a0ae6;\n  }" if (parenthesized_expression "(puVar3 == (undefined4 *)0x0)" ( (binary_expression "puVar3 == (undefined4 *)0x0" identifier == (cast_expression "(undefined4 *)0x0" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n    iVar2 = FUN_000715f0(1,0);\n    if (iVar2 == 0x12) {\n      param_1[5] = 0x12;\n      FUN_0006f5d0(0);\n    }\n    goto LAB_000a0ae6;\n  }" { (expression_statement "iVar2 = FUN_000715f0(1,0);" (assignment_expression "iVar2 = FUN_000715f0(1,0)" identifier = (call_expression "FUN_000715f0(1,0)" identifier (argument_list "(1,0)" ( number_literal , number_literal )))) ;) (if_statement "if (iVar2 == 0x12) {\n      param_1[5] = 0x12;\n      FUN_0006f5d0(0);\n    }" if (parenthesized_expression "(iVar2 == 0x12)" ( (binary_expression "iVar2 == 0x12" identifier == number_literal) )) (compound_statement "{\n      param_1[5] = 0x12;\n      FUN_0006f5d0(0);\n    }" { (expression_statement "param_1[5] = 0x12;" (assignment_expression "param_1[5] = 0x12" (subscript_expression "param_1[5]" identifier [ number_literal ]) = number_literal) ;) (expression_statement "FUN_0006f5d0(0);" (call_expression "FUN_0006f5d0(0)" identifier (argument_list "(0)" ( number_literal ))) ;) })) (goto_statement "goto LAB_000a0ae6;" goto statement_identifier ;) })) (expression_statement "local_14 = puVar3[4];" (assignment_expression "local_14 = puVar3[4]" identifier = (subscript_expression "puVar3[4]" identifier [ number_literal ])) ;) (expression_statement "local_10 = puVar3[5];" (assignment_expression "local_10 = puVar3[5]" identifier = (subscript_expression "puVar3[5]" identifier [ number_literal ])) ;) (expression_statement "*puVar3 = param_1;" (assignment_expression "*puVar3 = param_1" (pointer_expression "*puVar3" * identifier) = identifier) ;) (if_statement "if (local_10 < (uint)puVar3[3] || local_10 - puVar3[3] < (uint)(local_14 < (uint)puVar3[2])) {\nLAB_000a0a8b:\n    puVar3[4] = local_14 + 1;\n    puVar3[5] = local_10 + (0xfffffffe < local_14);\n    *(undefined1 *)(local_14 + puVar3[1]) = 0x5d;\n  }\n  else {\n    iVar2 = FUN_0009f0a0();\n    if (iVar2 == 0) {\n      local_14 = puVar3[4];\n      local_10 = puVar3[5];\n      goto LAB_000a0a8b;\n    }\n  }" if (parenthesized_expression "(local_10 < (uint)puVar3[3] || local_10 - puVar3[3] < (uint)(local_14 < (uint)puVar3[2]))" ( (binary_expression "local_10 < (uint)puVar3[3] || local_10 - puVar3[3] < (uint)(local_14 < (uint)puVar3[2])" (binary_expression "local_10 < (uint)puVar3[3]" identifier < (cast_expression "(uint)puVar3[3]" ( (type_descriptor "uint" type_identifier) ) (subscript_expression "puVar3[3]" identifier [ number_literal ]))) || (binary_expression "local_10 - puVar3[3] < (uint)(local_14 < (uint)puVar3[2])" (binary_expression "local_10 - puVar3[3]" identifier - (subscript_expression "puVar3[3]" identifier [ number_literal ])) < (call_expression "(uint)(local_14 < (uint)puVar3[2])" (parenthesized_expression "(uint)" ( identifier )) (argument_list "(local_14 < (uint)puVar3[2])" ( (binary_expression "local_14 < (uint)puVar3[2]" identifier < (cast_expression "(uint)puVar3[2]" ( (type_descriptor "uint" type_identifier) ) (subscript_expression "puVar3[2]" identifier [ number_literal ]))) ))))) )) (compound_statement "{\nLAB_000a0a8b:\n    puVar3[4] = local_14 + 1;\n    puVar3[5] = local_10 + (0xfffffffe < local_14);\n    *(undefined1 *)(local_14 + puVar3[1]) = 0x5d;\n  }" { (labeled_statement "LAB_000a0a8b:\n    puVar3[4] = local_14 + 1;" statement_identifier : (expression_statement "puVar3[4] = local_14 + 1;" (assignment_expression "puVar3[4] = local_14 + 1" (subscript_expression "puVar3[4]" identifier [ number_literal ]) = (binary_expression "local_14 + 1" identifier + number_literal)) ;)) (expression_statement "puVar3[5] = local_10 + (0xfffffffe < local_14);" (assignment_expression "puVar3[5] = local_10 + (0xfffffffe < local_14)" (subscript_expression "puVar3[5]" identifier [ number_literal ]) = (binary_expression "local_10 + (0xfffffffe < local_14)" identifier + (parenthesized_expression "(0xfffffffe < local_14)" ( (binary_expression "0xfffffffe < local_14" number_literal < identifier) )))) ;) (expression_statement "*(undefined1 *)(local_14 + puVar3[1]) = 0x5d;" (assignment_expression "*(undefined1 *)(local_14 + puVar3[1]) = 0x5d" (pointer_expression "*(undefined1 *)(local_14 + puVar3[1])" * (cast_expression "(undefined1 *)(local_14 + puVar3[1])" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(local_14 + puVar3[1])" ( (binary_expression "local_14 + puVar3[1]" identifier + (subscript_expression "puVar3[1]" identifier [ number_literal ])) )))) = number_literal) ;) }) (else_clause "else {\n    iVar2 = FUN_0009f0a0();\n    if (iVar2 == 0) {\n      local_14 = puVar3[4];\n      local_10 = puVar3[5];\n      goto LAB_000a0a8b;\n    }\n  }" else (compound_statement "{\n    iVar2 = FUN_0009f0a0();\n    if (iVar2 == 0) {\n      local_14 = puVar3[4];\n      local_10 = puVar3[5];\n      goto LAB_000a0a8b;\n    }\n  }" { (expression_statement "iVar2 = FUN_0009f0a0();" (assignment_expression "iVar2 = FUN_0009f0a0()" identifier = (call_expression "FUN_0009f0a0()" identifier (argument_list "()" ( )))) ;) (if_statement "if (iVar2 == 0) {\n      local_14 = puVar3[4];\n      local_10 = puVar3[5];\n      goto LAB_000a0a8b;\n    }" if (parenthesized_expression "(iVar2 == 0)" ( (binary_expression "iVar2 == 0" identifier == number_literal) )) (compound_statement "{\n      local_14 = puVar3[4];\n      local_10 = puVar3[5];\n      goto LAB_000a0a8b;\n    }" { (expression_statement "local_14 = puVar3[4];" (assignment_expression "local_14 = puVar3[4]" identifier = (subscript_expression "puVar3[4]" identifier [ number_literal ])) ;) (expression_statement "local_10 = puVar3[5];" (assignment_expression "local_10 = puVar3[5]" identifier = (subscript_expression "puVar3[5]" identifier [ number_literal ])) ;) (goto_statement "goto LAB_000a0a8b;" goto statement_identifier ;) })) }))) (if_statement "if (*(char *)((int)puVar3 + 0x19) == '\0') {\n    iVar2 = unaff_EDI + -0x5ca46;\n    if (*(char *)(puVar3 + 6) != '\0') {\n      iVar2 = -1;\n    }\n    iVar2 = FUN_000715f0(1,iVar2);\n    if (iVar2 == 0x12) {\n      param_1[5] = 0x12;\n      FUN_0006f5d0(0);\n    }\n    *(undefined1 *)(puVar3 + 6) = 1;\n  }\n  else if (*(char *)((int)puVar3 + 0x19) == '\x01') {\n    FUN_0004e320(param_1);\n  }" if (parenthesized_expression "(*(char *)((int)puVar3 + 0x19) == '\0')" ( (binary_expression "*(char *)((int)puVar3 + 0x19) == '\0'" (pointer_expression "*(char *)((int)puVar3 + 0x19)" * (cast_expression "(char *)((int)puVar3 + 0x19)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((int)puVar3 + 0x19)" ( (binary_expression "(int)puVar3 + 0x19" (cast_expression "(int)puVar3" ( (type_descriptor "int" primitive_type) ) identifier) + number_literal) )))) == (char_literal "'\0'" ' escape_sequence ')) )) (compound_statement "{\n    iVar2 = unaff_EDI + -0x5ca46;\n    if (*(char *)(puVar3 + 6) != '\0') {\n      iVar2 = -1;\n    }\n    iVar2 = FUN_000715f0(1,iVar2);\n    if (iVar2 == 0x12) {\n      param_1[5] = 0x12;\n      FUN_0006f5d0(0);\n    }\n    *(undefined1 *)(puVar3 + 6) = 1;\n  }" { (expression_statement "iVar2 = unaff_EDI + -0x5ca46;" (assignment_expression "iVar2 = unaff_EDI + -0x5ca46" identifier = (binary_expression "unaff_EDI + -0x5ca46" identifier + number_literal)) ;) (if_statement "if (*(char *)(puVar3 + 6) != '\0') {\n      iVar2 = -1;\n    }" if (parenthesized_expression "(*(char *)(puVar3 + 6) != '\0')" ( (binary_expression "*(char *)(puVar3 + 6) != '\0'" (pointer_expression "*(char *)(puVar3 + 6)" * (cast_expression "(char *)(puVar3 + 6)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(puVar3 + 6)" ( (binary_expression "puVar3 + 6" identifier + number_literal) )))) != (char_literal "'\0'" ' escape_sequence ')) )) (compound_statement "{\n      iVar2 = -1;\n    }" { (expression_statement "iVar2 = -1;" (assignment_expression "iVar2 = -1" identifier = number_literal) ;) })) (expression_statement "iVar2 = FUN_000715f0(1,iVar2);" (assignment_expression "iVar2 = FUN_000715f0(1,iVar2)" identifier = (call_expression "FUN_000715f0(1,iVar2)" identifier (argument_list "(1,iVar2)" ( number_literal , identifier )))) ;) (if_statement "if (iVar2 == 0x12) {\n      param_1[5] = 0x12;\n      FUN_0006f5d0(0);\n    }" if (parenthesized_expression "(iVar2 == 0x12)" ( (binary_expression "iVar2 == 0x12" identifier == number_literal) )) (compound_statement "{\n      param_1[5] = 0x12;\n      FUN_0006f5d0(0);\n    }" { (expression_statement "param_1[5] = 0x12;" (assignment_expression "param_1[5] = 0x12" (subscript_expression "param_1[5]" identifier [ number_literal ]) = number_literal) ;) (expression_statement "FUN_0006f5d0(0);" (call_expression "FUN_0006f5d0(0)" identifier (argument_list "(0)" ( number_literal ))) ;) })) (expression_statement "*(undefined1 *)(puVar3 + 6) = 1;" (assignment_expression "*(undefined1 *)(puVar3 + 6) = 1" (pointer_expression "*(undefined1 *)(puVar3 + 6)" * (cast_expression "(undefined1 *)(puVar3 + 6)" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(puVar3 + 6)" ( (binary_expression "puVar3 + 6" identifier + number_literal) )))) = number_literal) ;) }) (else_clause "else if (*(char *)((int)puVar3 + 0x19) == '\x01') {\n    FUN_0004e320(param_1);\n  }" else (if_statement "if (*(char *)((int)puVar3 + 0x19) == '\x01') {\n    FUN_0004e320(param_1);\n  }" if (parenthesized_expression "(*(char *)((int)puVar3 + 0x19) == '\x01')" ( (binary_expression "*(char *)((int)puVar3 + 0x19) == '\x01'" (pointer_expression "*(char *)((int)puVar3 + 0x19)" * (cast_expression "(char *)((int)puVar3 + 0x19)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((int)puVar3 + 0x19)" ( (binary_expression "(int)puVar3 + 0x19" (cast_expression "(int)puVar3" ( (type_descriptor "int" primitive_type) ) identifier) + number_literal) )))) == (char_literal "'\x01'" ' escape_sequence ')) )) (compound_statement "{\n    FUN_0004e320(param_1);\n  }" { (expression_statement "FUN_0004e320(param_1);" (call_expression "FUN_0004e320(param_1)" identifier (argument_list "(param_1)" ( identifier ))) ;) })))) (labeled_statement "LAB_000a0ae6:\n  iVar2 = *param_1;" statement_identifier : (expression_statement "iVar2 = *param_1;" (assignment_expression "iVar2 = *param_1" identifier = (pointer_expression "*param_1" * identifier)) ;)) (expression_statement "*(undefined1 *)(iVar2 + 0xb) = 0x4a;" (assignment_expression "*(undefined1 *)(iVar2 + 0xb) = 0x4a" (pointer_expression "*(undefined1 *)(iVar2 + 0xb)" * (cast_expression "(undefined1 *)(iVar2 + 0xb)" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar2 + 0xb)" ( (binary_expression "iVar2 + 0xb" identifier + number_literal) )))) = number_literal) ;) (expression_statement "puVar1 = (ushort *)(iVar2 + 8);" (assignment_expression "puVar1 = (ushort *)(iVar2 + 8)" identifier = (cast_expression "(ushort *)(iVar2 + 8)" ( (type_descriptor "ushort *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar2 + 8)" ( (binary_expression "iVar2 + 8" identifier + number_literal) )))) ;) (expression_statement "*puVar1 = *puVar1 | 0x8000;" (assignment_expression "*puVar1 = *puVar1 | 0x8000" (pointer_expression "*puVar1" * identifier) = (binary_expression "*puVar1 | 0x8000" (pointer_expression "*puVar1" * identifier) | number_literal)) ;) (return_statement "return;" return ;) })))
(translation_unit "/* WARNING: Unknown calling convention */\n\nvoid jsonArrayFinal(sqlite3_context *ctx)\n\n{\n  uint *puVar1;\n  u16 *puVar2;\n  Mem *pMVar3;\n  _func_void_void_ptr *p_Var4;\n  int iVar5;\n  JsonString *p;\n  sqlite3_context *p_1;\n  int unaff_EDI;\n  int in_stack_ffffffdc;\n  u8 in_stack_ffffffe0;\n  _func_void_void_ptr *in_stack_ffffffe4;\n  uint local_14;\n  uint local_10;\n  \n  __x86_get_pc_thunk_di();\n  pMVar3 = ctx->pMem;\n  if ((pMVar3->flags & 0x2000) == 0) {\n    in_stack_ffffffe0 = 'H';\n    p = (JsonString *)createAggContext((sqlite3_context *)&ctx->pFunc,(int)pMVar3,p_1);\n  }\n  else {\n    p = (JsonString *)pMVar3->z;\n  }\n  if (p == (JsonString *)0x0) {\n    p_Var4 = (_func_void_void_ptr *)0x0;\n    iVar5 = sqlite3VdbeMemSetStr\n                      ((Mem *)&DAT_00000001,(char *)0x0,in_stack_ffffffdc,in_stack_ffffffe0,\n                       in_stack_ffffffe4);\n    if (iVar5 == 0x12) {\n      ctx->isError = 0x12;\n      sqlite3VdbeMemSetStr(ctx->pOut,(char *)(unaff_EDI + 0xbbe56),1,'\0',p_Var4);\n    }\n    goto LAB_000a0ae6;\n  }\n  local_14 = (uint)p->nUsed;\n  local_10 = *(uint *)((int)&p->nUsed + 4);\n  p->pCtx = ctx;\n  puVar1 = (uint *)((int)&p->nAlloc + 4);\n  if (local_10 < *puVar1 || local_10 - *puVar1 < (uint)(local_14 < (uint)p->nAlloc)) {\nLAB_000a0a8b:\n    *(uint *)&p->nUsed = local_14 + 1;\n    *(uint *)((int)&p->nUsed + 4) = local_10 + (0xfffffffe < local_14);\n    p->zBuf[local_14] = ']';\n  }\n  else {\n    in_stack_ffffffe0 = '$';\n    iVar5 = jsonGrow(p,1);\n    if (iVar5 == 0) {\n      local_14 = (uint)p->nUsed;\n      local_10 = *(uint *)((int)&p->nUsed + 4);\n      goto LAB_000a0a8b;\n    }\n  }\n  if (p->bErr == '\0') {\n    p_Var4 = (_func_void_void_ptr *)(unaff_EDI + -0x5ca46);\n    if (p->bStatic != '\0') {\n      p_Var4 = (_func_void_void_ptr *)&DAT_ffffffff;\n    }\n    iVar5 = sqlite3VdbeMemSetStr\n                      ((Mem *)&DAT_00000001,(char *)p_Var4,in_stack_ffffffdc,in_stack_ffffffe0,\n                       in_stack_ffffffe4);\n    if (iVar5 == 0x12) {\n      ctx->isError = 0x12;\n      sqlite3VdbeMemSetStr(ctx->pOut,(char *)(unaff_EDI + 0xbbe56),1,'\0',p_Var4);\n    }\n    p->bStatic = '\x01';\n  }\n  else if (p->bErr == '\x01') {\n    sqlite3_result_error_nomem(ctx);\n  }\nLAB_000a0ae6:\n  pMVar3 = ctx->pOut;\n  pMVar3->eSubtype = 'J';\n  puVar2 = &pMVar3->flags;\n  *puVar2 = *puVar2 | 0x8000;\n  return;\n}\n\n" comment (function_definition "void jsonArrayFinal(sqlite3_context *ctx)\n\n{\n  uint *puVar1;\n  u16 *puVar2;\n  Mem *pMVar3;\n  _func_void_void_ptr *p_Var4;\n  int iVar5;\n  JsonString *p;\n  sqlite3_context *p_1;\n  int unaff_EDI;\n  int in_stack_ffffffdc;\n  u8 in_stack_ffffffe0;\n  _func_void_void_ptr *in_stack_ffffffe4;\n  uint local_14;\n  uint local_10;\n  \n  __x86_get_pc_thunk_di();\n  pMVar3 = ctx->pMem;\n  if ((pMVar3->flags & 0x2000) == 0) {\n    in_stack_ffffffe0 = 'H';\n    p = (JsonString *)createAggContext((sqlite3_context *)&ctx->pFunc,(int)pMVar3,p_1);\n  }\n  else {\n    p = (JsonString *)pMVar3->z;\n  }\n  if (p == (JsonString *)0x0) {\n    p_Var4 = (_func_void_void_ptr *)0x0;\n    iVar5 = sqlite3VdbeMemSetStr\n                      ((Mem *)&DAT_00000001,(char *)0x0,in_stack_ffffffdc,in_stack_ffffffe0,\n                       in_stack_ffffffe4);\n    if (iVar5 == 0x12) {\n      ctx->isError = 0x12;\n      sqlite3VdbeMemSetStr(ctx->pOut,(char *)(unaff_EDI + 0xbbe56),1,'\0',p_Var4);\n    }\n    goto LAB_000a0ae6;\n  }\n  local_14 = (uint)p->nUsed;\n  local_10 = *(uint *)((int)&p->nUsed + 4);\n  p->pCtx = ctx;\n  puVar1 = (uint *)((int)&p->nAlloc + 4);\n  if (local_10 < *puVar1 || local_10 - *puVar1 < (uint)(local_14 < (uint)p->nAlloc)) {\nLAB_000a0a8b:\n    *(uint *)&p->nUsed = local_14 + 1;\n    *(uint *)((int)&p->nUsed + 4) = local_10 + (0xfffffffe < local_14);\n    p->zBuf[local_14] = ']';\n  }\n  else {\n    in_stack_ffffffe0 = '$';\n    iVar5 = jsonGrow(p,1);\n    if (iVar5 == 0) {\n      local_14 = (uint)p->nUsed;\n      local_10 = *(uint *)((int)&p->nUsed + 4);\n      goto LAB_000a0a8b;\n    }\n  }\n  if (p->bErr == '\0') {\n    p_Var4 = (_func_void_void_ptr *)(unaff_EDI + -0x5ca46);\n    if (p->bStatic != '\0') {\n      p_Var4 = (_func_void_void_ptr *)&DAT_ffffffff;\n    }\n    iVar5 = sqlite3VdbeMemSetStr\n                      ((Mem *)&DAT_00000001,(char *)p_Var4,in_stack_ffffffdc,in_stack_ffffffe0,\n                       in_stack_ffffffe4);\n    if (iVar5 == 0x12) {\n      ctx->isError = 0x12;\n      sqlite3VdbeMemSetStr(ctx->pOut,(char *)(unaff_EDI + 0xbbe56),1,'\0',p_Var4);\n    }\n    p->bStatic = '\x01';\n  }\n  else if (p->bErr == '\x01') {\n    sqlite3_result_error_nomem(ctx);\n  }\nLAB_000a0ae6:\n  pMVar3 = ctx->pOut;\n  pMVar3->eSubtype = 'J';\n  puVar2 = &pMVar3->flags;\n  *puVar2 = *puVar2 | 0x8000;\n  return;\n}" primitive_type (function_declarator "jsonArrayFinal(sqlite3_context *ctx)" identifier (parameter_list "(sqlite3_context *ctx)" ( (parameter_declaration "sqlite3_context *ctx" type_identifier (pointer_declarator "*ctx" * identifier)) ))) (compound_statement "{\n  uint *puVar1;\n  u16 *puVar2;\n  Mem *pMVar3;\n  _func_void_void_ptr *p_Var4;\n  int iVar5;\n  JsonString *p;\n  sqlite3_context *p_1;\n  int unaff_EDI;\n  int in_stack_ffffffdc;\n  u8 in_stack_ffffffe0;\n  _func_void_void_ptr *in_stack_ffffffe4;\n  uint local_14;\n  uint local_10;\n  \n  __x86_get_pc_thunk_di();\n  pMVar3 = ctx->pMem;\n  if ((pMVar3->flags & 0x2000) == 0) {\n    in_stack_ffffffe0 = 'H';\n    p = (JsonString *)createAggContext((sqlite3_context *)&ctx->pFunc,(int)pMVar3,p_1);\n  }\n  else {\n    p = (JsonString *)pMVar3->z;\n  }\n  if (p == (JsonString *)0x0) {\n    p_Var4 = (_func_void_void_ptr *)0x0;\n    iVar5 = sqlite3VdbeMemSetStr\n                      ((Mem *)&DAT_00000001,(char *)0x0,in_stack_ffffffdc,in_stack_ffffffe0,\n                       in_stack_ffffffe4);\n    if (iVar5 == 0x12) {\n      ctx->isError = 0x12;\n      sqlite3VdbeMemSetStr(ctx->pOut,(char *)(unaff_EDI + 0xbbe56),1,'\0',p_Var4);\n    }\n    goto LAB_000a0ae6;\n  }\n  local_14 = (uint)p->nUsed;\n  local_10 = *(uint *)((int)&p->nUsed + 4);\n  p->pCtx = ctx;\n  puVar1 = (uint *)((int)&p->nAlloc + 4);\n  if (local_10 < *puVar1 || local_10 - *puVar1 < (uint)(local_14 < (uint)p->nAlloc)) {\nLAB_000a0a8b:\n    *(uint *)&p->nUsed = local_14 + 1;\n    *(uint *)((int)&p->nUsed + 4) = local_10 + (0xfffffffe < local_14);\n    p->zBuf[local_14] = ']';\n  }\n  else {\n    in_stack_ffffffe0 = '$';\n    iVar5 = jsonGrow(p,1);\n    if (iVar5 == 0) {\n      local_14 = (uint)p->nUsed;\n      local_10 = *(uint *)((int)&p->nUsed + 4);\n      goto LAB_000a0a8b;\n    }\n  }\n  if (p->bErr == '\0') {\n    p_Var4 = (_func_void_void_ptr *)(unaff_EDI + -0x5ca46);\n    if (p->bStatic != '\0') {\n      p_Var4 = (_func_void_void_ptr *)&DAT_ffffffff;\n    }\n    iVar5 = sqlite3VdbeMemSetStr\n                      ((Mem *)&DAT_00000001,(char *)p_Var4,in_stack_ffffffdc,in_stack_ffffffe0,\n                       in_stack_ffffffe4);\n    if (iVar5 == 0x12) {\n      ctx->isError = 0x12;\n      sqlite3VdbeMemSetStr(ctx->pOut,(char *)(unaff_EDI + 0xbbe56),1,'\0',p_Var4);\n    }\n    p->bStatic = '\x01';\n  }\n  else if (p->bErr == '\x01') {\n    sqlite3_result_error_nomem(ctx);\n  }\nLAB_000a0ae6:\n  pMVar3 = ctx->pOut;\n  pMVar3->eSubtype = 'J';\n  puVar2 = &pMVar3->flags;\n  *puVar2 = *puVar2 | 0x8000;\n  return;\n}" { (declaration "uint *puVar1;" type_identifier (pointer_declarator "*puVar1" * identifier) ;) (declaration "u16 *puVar2;" type_identifier (pointer_declarator "*puVar2" * identifier) ;) (declaration "Mem *pMVar3;" type_identifier (pointer_declarator "*pMVar3" * identifier) ;) (declaration "_func_void_void_ptr *p_Var4;" type_identifier (pointer_declarator "*p_Var4" * identifier) ;) (declaration "int iVar5;" primitive_type identifier ;) (declaration "JsonString *p;" type_identifier (pointer_declarator "*p" * identifier) ;) (declaration "sqlite3_context *p_1;" type_identifier (pointer_declarator "*p_1" * identifier) ;) (declaration "int unaff_EDI;" primitive_type identifier ;) (declaration "int in_stack_ffffffdc;" primitive_type identifier ;) (declaration "u8 in_stack_ffffffe0;" type_identifier identifier ;) (declaration "_func_void_void_ptr *in_stack_ffffffe4;" type_identifier (pointer_declarator "*in_stack_ffffffe4" * identifier) ;) (declaration "uint local_14;" type_identifier identifier ;) (declaration "uint local_10;" type_identifier identifier ;) (expression_statement "__x86_get_pc_thunk_di();" (call_expression "__x86_get_pc_thunk_di()" identifier (argument_list "()" ( ))) ;) (expression_statement "pMVar3 = ctx->pMem;" (assignment_expression "pMVar3 = ctx->pMem" identifier = (field_expression "ctx->pMem" identifier -> field_identifier)) ;) (if_statement "if ((pMVar3->flags & 0x2000) == 0) {\n    in_stack_ffffffe0 = 'H';\n    p = (JsonString *)createAggContext((sqlite3_context *)&ctx->pFunc,(int)pMVar3,p_1);\n  }\n  else {\n    p = (JsonString *)pMVar3->z;\n  }" if (parenthesized_expression "((pMVar3->flags & 0x2000) == 0)" ( (binary_expression "(pMVar3->flags & 0x2000) == 0" (parenthesized_expression "(pMVar3->flags & 0x2000)" ( (binary_expression "pMVar3->flags & 0x2000" (field_expression "pMVar3->flags" identifier -> field_identifier) & number_literal) )) == number_literal) )) (compound_statement "{\n    in_stack_ffffffe0 = 'H';\n    p = (JsonString *)createAggContext((sqlite3_context *)&ctx->pFunc,(int)pMVar3,p_1);\n  }" { (expression_statement "in_stack_ffffffe0 = 'H';" (assignment_expression "in_stack_ffffffe0 = 'H'" identifier = (char_literal "'H'" ' character ')) ;) (expression_statement "p = (JsonString *)createAggContext((sqlite3_context *)&ctx->pFunc,(int)pMVar3,p_1);" (assignment_expression "p = (JsonString *)createAggContext((sqlite3_context *)&ctx->pFunc,(int)pMVar3,p_1)" identifier = (cast_expression "(JsonString *)createAggContext((sqlite3_context *)&ctx->pFunc,(int)pMVar3,p_1)" ( (type_descriptor "JsonString *" type_identifier (abstract_pointer_declarator "*" *)) ) (call_expression "createAggContext((sqlite3_context *)&ctx->pFunc,(int)pMVar3,p_1)" identifier (argument_list "((sqlite3_context *)&ctx->pFunc,(int)pMVar3,p_1)" ( (cast_expression "(sqlite3_context *)&ctx->pFunc" ( (type_descriptor "sqlite3_context *" type_identifier (abstract_pointer_declarator "*" *)) ) (pointer_expression "&ctx->pFunc" & (field_expression "ctx->pFunc" identifier -> field_identifier))) , (cast_expression "(int)pMVar3" ( (type_descriptor "int" primitive_type) ) identifier) , identifier ))))) ;) }) (else_clause "else {\n    p = (JsonString *)pMVar3->z;\n  }" else (compound_statement "{\n    p = (JsonString *)pMVar3->z;\n  }" { (expression_statement "p = (JsonString *)pMVar3->z;" (assignment_expression "p = (JsonString *)pMVar3->z" identifier = (cast_expression "(JsonString *)pMVar3->z" ( (type_descriptor "JsonString *" type_identifier (abstract_pointer_declarator "*" *)) ) (field_expression "pMVar3->z" identifier -> field_identifier))) ;) }))) (if_statement "if (p == (JsonString *)0x0) {\n    p_Var4 = (_func_void_void_ptr *)0x0;\n    iVar5 = sqlite3VdbeMemSetStr\n                      ((Mem *)&DAT_00000001,(char *)0x0,in_stack_ffffffdc,in_stack_ffffffe0,\n                       in_stack_ffffffe4);\n    if (iVar5 == 0x12) {\n      ctx->isError = 0x12;\n      sqlite3VdbeMemSetStr(ctx->pOut,(char *)(unaff_EDI + 0xbbe56),1,'\0',p_Var4);\n    }\n    goto LAB_000a0ae6;\n  }" if (parenthesized_expression "(p == (JsonString *)0x0)" ( (binary_expression "p == (JsonString *)0x0" identifier == (cast_expression "(JsonString *)0x0" ( (type_descriptor "JsonString *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n    p_Var4 = (_func_void_void_ptr *)0x0;\n    iVar5 = sqlite3VdbeMemSetStr\n                      ((Mem *)&DAT_00000001,(char *)0x0,in_stack_ffffffdc,in_stack_ffffffe0,\n                       in_stack_ffffffe4);\n    if (iVar5 == 0x12) {\n      ctx->isError = 0x12;\n      sqlite3VdbeMemSetStr(ctx->pOut,(char *)(unaff_EDI + 0xbbe56),1,'\0',p_Var4);\n    }\n    goto LAB_000a0ae6;\n  }" { (expression_statement "p_Var4 = (_func_void_void_ptr *)0x0;" (assignment_expression "p_Var4 = (_func_void_void_ptr *)0x0" identifier = (cast_expression "(_func_void_void_ptr *)0x0" ( (type_descriptor "_func_void_void_ptr *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) ;) (expression_statement "iVar5 = sqlite3VdbeMemSetStr\n                      ((Mem *)&DAT_00000001,(char *)0x0,in_stack_ffffffdc,in_stack_ffffffe0,\n                       in_stack_ffffffe4);" (assignment_expression "iVar5 = sqlite3VdbeMemSetStr\n                      ((Mem *)&DAT_00000001,(char *)0x0,in_stack_ffffffdc,in_stack_ffffffe0,\n                       in_stack_ffffffe4)" identifier = (call_expression "sqlite3VdbeMemSetStr\n                      ((Mem *)&DAT_00000001,(char *)0x0,in_stack_ffffffdc,in_stack_ffffffe0,\n                       in_stack_ffffffe4)" identifier (argument_list "((Mem *)&DAT_00000001,(char *)0x0,in_stack_ffffffdc,in_stack_ffffffe0,\n                       in_stack_ffffffe4)" ( (cast_expression "(Mem *)&DAT_00000001" ( (type_descriptor "Mem *" type_identifier (abstract_pointer_declarator "*" *)) ) (pointer_expression "&DAT_00000001" & identifier)) , (cast_expression "(char *)0x0" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal) , identifier , identifier , identifier )))) ;) (if_statement "if (iVar5 == 0x12) {\n      ctx->isError = 0x12;\n      sqlite3VdbeMemSetStr(ctx->pOut,(char *)(unaff_EDI + 0xbbe56),1,'\0',p_Var4);\n    }" if (parenthesized_expression "(iVar5 == 0x12)" ( (binary_expression "iVar5 == 0x12" identifier == number_literal) )) (compound_statement "{\n      ctx->isError = 0x12;\n      sqlite3VdbeMemSetStr(ctx->pOut,(char *)(unaff_EDI + 0xbbe56),1,'\0',p_Var4);\n    }" { (expression_statement "ctx->isError = 0x12;" (assignment_expression "ctx->isError = 0x12" (field_expression "ctx->isError" identifier -> field_identifier) = number_literal) ;) (expression_statement "sqlite3VdbeMemSetStr(ctx->pOut,(char *)(unaff_EDI + 0xbbe56),1,'\0',p_Var4);" (call_expression "sqlite3VdbeMemSetStr(ctx->pOut,(char *)(unaff_EDI + 0xbbe56),1,'\0',p_Var4)" identifier (argument_list "(ctx->pOut,(char *)(unaff_EDI + 0xbbe56),1,'\0',p_Var4)" ( (field_expression "ctx->pOut" identifier -> field_identifier) , (cast_expression "(char *)(unaff_EDI + 0xbbe56)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(unaff_EDI + 0xbbe56)" ( (binary_expression "unaff_EDI + 0xbbe56" identifier + number_literal) ))) , number_literal , (char_literal "'\0'" ' escape_sequence ') , identifier ))) ;) })) (goto_statement "goto LAB_000a0ae6;" goto statement_identifier ;) })) (expression_statement "local_14 = (uint)p->nUsed;" (assignment_expression "local_14 = (uint)p->nUsed" identifier = (cast_expression "(uint)p->nUsed" ( (type_descriptor "uint" type_identifier) ) (field_expression "p->nUsed" identifier -> field_identifier))) ;) (expression_statement "local_10 = *(uint *)((int)&p->nUsed + 4);" (assignment_expression "local_10 = *(uint *)((int)&p->nUsed + 4)" identifier = (pointer_expression "*(uint *)((int)&p->nUsed + 4)" * (cast_expression "(uint *)((int)&p->nUsed + 4)" ( (type_descriptor "uint *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((int)&p->nUsed + 4)" ( (binary_expression "(int)&p->nUsed + 4" (cast_expression "(int)&p->nUsed" ( (type_descriptor "int" primitive_type) ) (pointer_expression "&p->nUsed" & (field_expression "p->nUsed" identifier -> field_identifier))) + number_literal) ))))) ;) (expression_statement "p->pCtx = ctx;" (assignment_expression "p->pCtx = ctx" (field_expression "p->pCtx" identifier -> field_identifier) = identifier) ;) (expression_statement "puVar1 = (uint *)((int)&p->nAlloc + 4);" (assignment_expression "puVar1 = (uint *)((int)&p->nAlloc + 4)" identifier = (cast_expression "(uint *)((int)&p->nAlloc + 4)" ( (type_descriptor "uint *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((int)&p->nAlloc + 4)" ( (binary_expression "(int)&p->nAlloc + 4" (cast_expression "(int)&p->nAlloc" ( (type_descriptor "int" primitive_type) ) (pointer_expression "&p->nAlloc" & (field_expression "p->nAlloc" identifier -> field_identifier))) + number_literal) )))) ;) (if_statement "if (local_10 < *puVar1 || local_10 - *puVar1 < (uint)(local_14 < (uint)p->nAlloc)) {\nLAB_000a0a8b:\n    *(uint *)&p->nUsed = local_14 + 1;\n    *(uint *)((int)&p->nUsed + 4) = local_10 + (0xfffffffe < local_14);\n    p->zBuf[local_14] = ']';\n  }\n  else {\n    in_stack_ffffffe0 = '$';\n    iVar5 = jsonGrow(p,1);\n    if (iVar5 == 0) {\n      local_14 = (uint)p->nUsed;\n      local_10 = *(uint *)((int)&p->nUsed + 4);\n      goto LAB_000a0a8b;\n    }\n  }" if (parenthesized_expression "(local_10 < *puVar1 || local_10 - *puVar1 < (uint)(local_14 < (uint)p->nAlloc))" ( (binary_expression "local_10 < *puVar1 || local_10 - *puVar1 < (uint)(local_14 < (uint)p->nAlloc)" (binary_expression "local_10 < *puVar1" identifier < (pointer_expression "*puVar1" * identifier)) || (binary_expression "local_10 - *puVar1 < (uint)(local_14 < (uint)p->nAlloc)" (binary_expression "local_10 - *puVar1" identifier - (pointer_expression "*puVar1" * identifier)) < (call_expression "(uint)(local_14 < (uint)p->nAlloc)" (parenthesized_expression "(uint)" ( identifier )) (argument_list "(local_14 < (uint)p->nAlloc)" ( (binary_expression "local_14 < (uint)p->nAlloc" identifier < (cast_expression "(uint)p->nAlloc" ( (type_descriptor "uint" type_identifier) ) (field_expression "p->nAlloc" identifier -> field_identifier))) ))))) )) (compound_statement "{\nLAB_000a0a8b:\n    *(uint *)&p->nUsed = local_14 + 1;\n    *(uint *)((int)&p->nUsed + 4) = local_10 + (0xfffffffe < local_14);\n    p->zBuf[local_14] = ']';\n  }" { (labeled_statement "LAB_000a0a8b:\n    *(uint *)&p->nUsed = local_14 + 1;" statement_identifier : (expression_statement "*(uint *)&p->nUsed = local_14 + 1;" (assignment_expression "*(uint *)&p->nUsed = local_14 + 1" (pointer_expression "*(uint *)&p->nUsed" * (cast_expression "(uint *)&p->nUsed" ( (type_descriptor "uint *" type_identifier (abstract_pointer_declarator "*" *)) ) (pointer_expression "&p->nUsed" & (field_expression "p->nUsed" identifier -> field_identifier)))) = (binary_expression "local_14 + 1" identifier + number_literal)) ;)) (expression_statement "*(uint *)((int)&p->nUsed + 4) = local_10 + (0xfffffffe < local_14);" (assignment_expression "*(uint *)((int)&p->nUsed + 4) = local_10 + (0xfffffffe < local_14)" (pointer_expression "*(uint *)((int)&p->nUsed + 4)" * (cast_expression "(uint *)((int)&p->nUsed + 4)" ( (type_descriptor "uint *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((int)&p->nUsed + 4)" ( (binary_expression "(int)&p->nUsed + 4" (cast_expression "(int)&p->nUsed" ( (type_descriptor "int" primitive_type) ) (pointer_expression "&p->nUsed" & (field_expression "p->nUsed" identifier -> field_identifier))) + number_literal) )))) = (binary_expression "local_10 + (0xfffffffe < local_14)" identifier + (parenthesized_expression "(0xfffffffe < local_14)" ( (binary_expression "0xfffffffe < local_14" number_literal < identifier) )))) ;) (expression_statement "p->zBuf[local_14] = ']';" (assignment_expression "p->zBuf[local_14] = ']'" (subscript_expression "p->zBuf[local_14]" (field_expression "p->zBuf" identifier -> field_identifier) [ identifier ]) = (char_literal "']'" ' character ')) ;) }) (else_clause "else {\n    in_stack_ffffffe0 = '$';\n    iVar5 = jsonGrow(p,1);\n    if (iVar5 == 0) {\n      local_14 = (uint)p->nUsed;\n      local_10 = *(uint *)((int)&p->nUsed + 4);\n      goto LAB_000a0a8b;\n    }\n  }" else (compound_statement "{\n    in_stack_ffffffe0 = '$';\n    iVar5 = jsonGrow(p,1);\n    if (iVar5 == 0) {\n      local_14 = (uint)p->nUsed;\n      local_10 = *(uint *)((int)&p->nUsed + 4);\n      goto LAB_000a0a8b;\n    }\n  }" { (expression_statement "in_stack_ffffffe0 = '$';" (assignment_expression "in_stack_ffffffe0 = '$'" identifier = (char_literal "'$'" ' character ')) ;) (expression_statement "iVar5 = jsonGrow(p,1);" (assignment_expression "iVar5 = jsonGrow(p,1)" identifier = (call_expression "jsonGrow(p,1)" identifier (argument_list "(p,1)" ( identifier , number_literal )))) ;) (if_statement "if (iVar5 == 0) {\n      local_14 = (uint)p->nUsed;\n      local_10 = *(uint *)((int)&p->nUsed + 4);\n      goto LAB_000a0a8b;\n    }" if (parenthesized_expression "(iVar5 == 0)" ( (binary_expression "iVar5 == 0" identifier == number_literal) )) (compound_statement "{\n      local_14 = (uint)p->nUsed;\n      local_10 = *(uint *)((int)&p->nUsed + 4);\n      goto LAB_000a0a8b;\n    }" { (expression_statement "local_14 = (uint)p->nUsed;" (assignment_expression "local_14 = (uint)p->nUsed" identifier = (cast_expression "(uint)p->nUsed" ( (type_descriptor "uint" type_identifier) ) (field_expression "p->nUsed" identifier -> field_identifier))) ;) (expression_statement "local_10 = *(uint *)((int)&p->nUsed + 4);" (assignment_expression "local_10 = *(uint *)((int)&p->nUsed + 4)" identifier = (pointer_expression "*(uint *)((int)&p->nUsed + 4)" * (cast_expression "(uint *)((int)&p->nUsed + 4)" ( (type_descriptor "uint *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((int)&p->nUsed + 4)" ( (binary_expression "(int)&p->nUsed + 4" (cast_expression "(int)&p->nUsed" ( (type_descriptor "int" primitive_type) ) (pointer_expression "&p->nUsed" & (field_expression "p->nUsed" identifier -> field_identifier))) + number_literal) ))))) ;) (goto_statement "goto LAB_000a0a8b;" goto statement_identifier ;) })) }))) (if_statement "if (p->bErr == '\0') {\n    p_Var4 = (_func_void_void_ptr *)(unaff_EDI + -0x5ca46);\n    if (p->bStatic != '\0') {\n      p_Var4 = (_func_void_void_ptr *)&DAT_ffffffff;\n    }\n    iVar5 = sqlite3VdbeMemSetStr\n                      ((Mem *)&DAT_00000001,(char *)p_Var4,in_stack_ffffffdc,in_stack_ffffffe0,\n                       in_stack_ffffffe4);\n    if (iVar5 == 0x12) {\n      ctx->isError = 0x12;\n      sqlite3VdbeMemSetStr(ctx->pOut,(char *)(unaff_EDI + 0xbbe56),1,'\0',p_Var4);\n    }\n    p->bStatic = '\x01';\n  }\n  else if (p->bErr == '\x01') {\n    sqlite3_result_error_nomem(ctx);\n  }" if (parenthesized_expression "(p->bErr == '\0')" ( (binary_expression "p->bErr == '\0'" (field_expression "p->bErr" identifier -> field_identifier) == (char_literal "'\0'" ' escape_sequence ')) )) (compound_statement "{\n    p_Var4 = (_func_void_void_ptr *)(unaff_EDI + -0x5ca46);\n    if (p->bStatic != '\0') {\n      p_Var4 = (_func_void_void_ptr *)&DAT_ffffffff;\n    }\n    iVar5 = sqlite3VdbeMemSetStr\n                      ((Mem *)&DAT_00000001,(char *)p_Var4,in_stack_ffffffdc,in_stack_ffffffe0,\n                       in_stack_ffffffe4);\n    if (iVar5 == 0x12) {\n      ctx->isError = 0x12;\n      sqlite3VdbeMemSetStr(ctx->pOut,(char *)(unaff_EDI + 0xbbe56),1,'\0',p_Var4);\n    }\n    p->bStatic = '\x01';\n  }" { (expression_statement "p_Var4 = (_func_void_void_ptr *)(unaff_EDI + -0x5ca46);" (assignment_expression "p_Var4 = (_func_void_void_ptr *)(unaff_EDI + -0x5ca46)" identifier = (cast_expression "(_func_void_void_ptr *)(unaff_EDI + -0x5ca46)" ( (type_descriptor "_func_void_void_ptr *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(unaff_EDI + -0x5ca46)" ( (binary_expression "unaff_EDI + -0x5ca46" identifier + number_literal) )))) ;) (if_statement "if (p->bStatic != '\0') {\n      p_Var4 = (_func_void_void_ptr *)&DAT_ffffffff;\n    }" if (parenthesized_expression "(p->bStatic != '\0')" ( (binary_expression "p->bStatic != '\0'" (field_expression "p->bStatic" identifier -> field_identifier) != (char_literal "'\0'" ' escape_sequence ')) )) (compound_statement "{\n      p_Var4 = (_func_void_void_ptr *)&DAT_ffffffff;\n    }" { (expression_statement "p_Var4 = (_func_void_void_ptr *)&DAT_ffffffff;" (assignment_expression "p_Var4 = (_func_void_void_ptr *)&DAT_ffffffff" identifier = (cast_expression "(_func_void_void_ptr *)&DAT_ffffffff" ( (type_descriptor "_func_void_void_ptr *" type_identifier (abstract_pointer_declarator "*" *)) ) (pointer_expression "&DAT_ffffffff" & identifier))) ;) })) (expression_statement "iVar5 = sqlite3VdbeMemSetStr\n                      ((Mem *)&DAT_00000001,(char *)p_Var4,in_stack_ffffffdc,in_stack_ffffffe0,\n                       in_stack_ffffffe4);" (assignment_expression "iVar5 = sqlite3VdbeMemSetStr\n                      ((Mem *)&DAT_00000001,(char *)p_Var4,in_stack_ffffffdc,in_stack_ffffffe0,\n                       in_stack_ffffffe4)" identifier = (call_expression "sqlite3VdbeMemSetStr\n                      ((Mem *)&DAT_00000001,(char *)p_Var4,in_stack_ffffffdc,in_stack_ffffffe0,\n                       in_stack_ffffffe4)" identifier (argument_list "((Mem *)&DAT_00000001,(char *)p_Var4,in_stack_ffffffdc,in_stack_ffffffe0,\n                       in_stack_ffffffe4)" ( (cast_expression "(Mem *)&DAT_00000001" ( (type_descriptor "Mem *" type_identifier (abstract_pointer_declarator "*" *)) ) (pointer_expression "&DAT_00000001" & identifier)) , (cast_expression "(char *)p_Var4" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) identifier) , identifier , identifier , identifier )))) ;) (if_statement "if (iVar5 == 0x12) {\n      ctx->isError = 0x12;\n      sqlite3VdbeMemSetStr(ctx->pOut,(char *)(unaff_EDI + 0xbbe56),1,'\0',p_Var4);\n    }" if (parenthesized_expression "(iVar5 == 0x12)" ( (binary_expression "iVar5 == 0x12" identifier == number_literal) )) (compound_statement "{\n      ctx->isError = 0x12;\n      sqlite3VdbeMemSetStr(ctx->pOut,(char *)(unaff_EDI + 0xbbe56),1,'\0',p_Var4);\n    }" { (expression_statement "ctx->isError = 0x12;" (assignment_expression "ctx->isError = 0x12" (field_expression "ctx->isError" identifier -> field_identifier) = number_literal) ;) (expression_statement "sqlite3VdbeMemSetStr(ctx->pOut,(char *)(unaff_EDI + 0xbbe56),1,'\0',p_Var4);" (call_expression "sqlite3VdbeMemSetStr(ctx->pOut,(char *)(unaff_EDI + 0xbbe56),1,'\0',p_Var4)" identifier (argument_list "(ctx->pOut,(char *)(unaff_EDI + 0xbbe56),1,'\0',p_Var4)" ( (field_expression "ctx->pOut" identifier -> field_identifier) , (cast_expression "(char *)(unaff_EDI + 0xbbe56)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(unaff_EDI + 0xbbe56)" ( (binary_expression "unaff_EDI + 0xbbe56" identifier + number_literal) ))) , number_literal , (char_literal "'\0'" ' escape_sequence ') , identifier ))) ;) })) (expression_statement "p->bStatic = '\x01';" (assignment_expression "p->bStatic = '\x01'" (field_expression "p->bStatic" identifier -> field_identifier) = (char_literal "'\x01'" ' escape_sequence ')) ;) }) (else_clause "else if (p->bErr == '\x01') {\n    sqlite3_result_error_nomem(ctx);\n  }" else (if_statement "if (p->bErr == '\x01') {\n    sqlite3_result_error_nomem(ctx);\n  }" if (parenthesized_expression "(p->bErr == '\x01')" ( (binary_expression "p->bErr == '\x01'" (field_expression "p->bErr" identifier -> field_identifier) == (char_literal "'\x01'" ' escape_sequence ')) )) (compound_statement "{\n    sqlite3_result_error_nomem(ctx);\n  }" { (expression_statement "sqlite3_result_error_nomem(ctx);" (call_expression "sqlite3_result_error_nomem(ctx)" identifier (argument_list "(ctx)" ( identifier ))) ;) })))) (labeled_statement "LAB_000a0ae6:\n  pMVar3 = ctx->pOut;" statement_identifier : (expression_statement "pMVar3 = ctx->pOut;" (assignment_expression "pMVar3 = ctx->pOut" identifier = (field_expression "ctx->pOut" identifier -> field_identifier)) ;)) (expression_statement "pMVar3->eSubtype = 'J';" (assignment_expression "pMVar3->eSubtype = 'J'" (field_expression "pMVar3->eSubtype" identifier -> field_identifier) = (char_literal "'J'" ' character ')) ;) (expression_statement "puVar2 = &pMVar3->flags;" (assignment_expression "puVar2 = &pMVar3->flags" identifier = (pointer_expression "&pMVar3->flags" & (field_expression "pMVar3->flags" identifier -> field_identifier))) ;) (expression_statement "*puVar2 = *puVar2 | 0x8000;" (assignment_expression "*puVar2 = *puVar2 | 0x8000" (pointer_expression "*puVar2" * identifier) = (binary_expression "*puVar2 | 0x8000" (pointer_expression "*puVar2" * identifier) | number_literal)) ;) (return_statement "return;" return ;) })))
(translation_unit "void FUN_000a0a40(int *param_1)\n\n{\n  ushort *puVar1;\n  int iVar2;\n  undefined4 *puVar3;\n  int unaff_EDI;\n  uint local_14;\n  uint local_10;\n  \n  FUN_0003a401();\n  if ((*(byte *)(param_1[2] + 9) & 0x20) == 0) {\n    puVar3 = (undefined4 *)FUN_0004c400();\n  }\n  else {\n    puVar3 = *(undefined4 **)(param_1[2] + 0x10);\n  }\n  if (puVar3 == (undefined4 *)0x0) {\n    iVar2 = FUN_000715f0(1,0);\n    if (iVar2 == 0x12) {\n      param_1[5] = 0x12;\n      FUN_0006f5d0(0);\n    }\n    goto LAB_000a0ae6;\n  }\n  local_14 = puVar3[4];\n  local_10 = puVar3[5];\n  *puVar3 = param_1;\n  if (local_10 < (uint)puVar3[3] || local_10 - puVar3[3] < (uint)(local_14 < (uint)puVar3[2])) {\nLAB_000a0a8b:\n    puVar3[4] = local_14 + 1;\n    puVar3[5] = local_10 + (0xfffffffe < local_14);\n    *(undefined1 *)(local_14 + puVar3[1]) = 0x5d;\n  }\n  else {\n    iVar2 = FUN_0009f0a0();\n    if (iVar2 == 0) {\n      local_14 = puVar3[4];\n      local_10 = puVar3[5];\n      goto LAB_000a0a8b;\n    }\n  }\n  if (*(char *)((int)puVar3 + 0x19) == '\0') {\n    iVar2 = unaff_EDI + -0x5ca46;\n    if (*(char *)(puVar3 + 6) != '\0') {\n      iVar2 = -1;\n    }\n    iVar2 = FUN_000715f0(1,iVar2);\n    if (iVar2 == 0x12) {\n      param_1[5] = 0x12;\n      FUN_0006f5d0(0);\n    }\n    *(undefined1 *)(puVar3 + 6) = 1;\n  }\n  else if (*(char *)((int)puVar3 + 0x19) == '\x01') {\n    FUN_0004e320(param_1);\n  }\nLAB_000a0ae6:\n  iVar2 = *param_1;\n  *(undefined1 *)(iVar2 + 0xb) = 0x4a;\n  puVar1 = (ushort *)(iVar2 + 8);\n  *puVar1 = *puVar1 | 0x8000;\n  return;\n}\n\n" (function_definition "void FUN_000a0a40(int *param_1)\n\n{\n  ushort *puVar1;\n  int iVar2;\n  undefined4 *puVar3;\n  int unaff_EDI;\n  uint local_14;\n  uint local_10;\n  \n  FUN_0003a401();\n  if ((*(byte *)(param_1[2] + 9) & 0x20) == 0) {\n    puVar3 = (undefined4 *)FUN_0004c400();\n  }\n  else {\n    puVar3 = *(undefined4 **)(param_1[2] + 0x10);\n  }\n  if (puVar3 == (undefined4 *)0x0) {\n    iVar2 = FUN_000715f0(1,0);\n    if (iVar2 == 0x12) {\n      param_1[5] = 0x12;\n      FUN_0006f5d0(0);\n    }\n    goto LAB_000a0ae6;\n  }\n  local_14 = puVar3[4];\n  local_10 = puVar3[5];\n  *puVar3 = param_1;\n  if (local_10 < (uint)puVar3[3] || local_10 - puVar3[3] < (uint)(local_14 < (uint)puVar3[2])) {\nLAB_000a0a8b:\n    puVar3[4] = local_14 + 1;\n    puVar3[5] = local_10 + (0xfffffffe < local_14);\n    *(undefined1 *)(local_14 + puVar3[1]) = 0x5d;\n  }\n  else {\n    iVar2 = FUN_0009f0a0();\n    if (iVar2 == 0) {\n      local_14 = puVar3[4];\n      local_10 = puVar3[5];\n      goto LAB_000a0a8b;\n    }\n  }\n  if (*(char *)((int)puVar3 + 0x19) == '\0') {\n    iVar2 = unaff_EDI + -0x5ca46;\n    if (*(char *)(puVar3 + 6) != '\0') {\n      iVar2 = -1;\n    }\n    iVar2 = FUN_000715f0(1,iVar2);\n    if (iVar2 == 0x12) {\n      param_1[5] = 0x12;\n      FUN_0006f5d0(0);\n    }\n    *(undefined1 *)(puVar3 + 6) = 1;\n  }\n  else if (*(char *)((int)puVar3 + 0x19) == '\x01') {\n    FUN_0004e320(param_1);\n  }\nLAB_000a0ae6:\n  iVar2 = *param_1;\n  *(undefined1 *)(iVar2 + 0xb) = 0x4a;\n  puVar1 = (ushort *)(iVar2 + 8);\n  *puVar1 = *puVar1 | 0x8000;\n  return;\n}" primitive_type (function_declarator "FUN_000a0a40(int *param_1)" identifier (parameter_list "(int *param_1)" ( (parameter_declaration "int *param_1" primitive_type (pointer_declarator "*param_1" * identifier)) ))) (compound_statement "{\n  ushort *puVar1;\n  int iVar2;\n  undefined4 *puVar3;\n  int unaff_EDI;\n  uint local_14;\n  uint local_10;\n  \n  FUN_0003a401();\n  if ((*(byte *)(param_1[2] + 9) & 0x20) == 0) {\n    puVar3 = (undefined4 *)FUN_0004c400();\n  }\n  else {\n    puVar3 = *(undefined4 **)(param_1[2] + 0x10);\n  }\n  if (puVar3 == (undefined4 *)0x0) {\n    iVar2 = FUN_000715f0(1,0);\n    if (iVar2 == 0x12) {\n      param_1[5] = 0x12;\n      FUN_0006f5d0(0);\n    }\n    goto LAB_000a0ae6;\n  }\n  local_14 = puVar3[4];\n  local_10 = puVar3[5];\n  *puVar3 = param_1;\n  if (local_10 < (uint)puVar3[3] || local_10 - puVar3[3] < (uint)(local_14 < (uint)puVar3[2])) {\nLAB_000a0a8b:\n    puVar3[4] = local_14 + 1;\n    puVar3[5] = local_10 + (0xfffffffe < local_14);\n    *(undefined1 *)(local_14 + puVar3[1]) = 0x5d;\n  }\n  else {\n    iVar2 = FUN_0009f0a0();\n    if (iVar2 == 0) {\n      local_14 = puVar3[4];\n      local_10 = puVar3[5];\n      goto LAB_000a0a8b;\n    }\n  }\n  if (*(char *)((int)puVar3 + 0x19) == '\0') {\n    iVar2 = unaff_EDI + -0x5ca46;\n    if (*(char *)(puVar3 + 6) != '\0') {\n      iVar2 = -1;\n    }\n    iVar2 = FUN_000715f0(1,iVar2);\n    if (iVar2 == 0x12) {\n      param_1[5] = 0x12;\n      FUN_0006f5d0(0);\n    }\n    *(undefined1 *)(puVar3 + 6) = 1;\n  }\n  else if (*(char *)((int)puVar3 + 0x19) == '\x01') {\n    FUN_0004e320(param_1);\n  }\nLAB_000a0ae6:\n  iVar2 = *param_1;\n  *(undefined1 *)(iVar2 + 0xb) = 0x4a;\n  puVar1 = (ushort *)(iVar2 + 8);\n  *puVar1 = *puVar1 | 0x8000;\n  return;\n}" { (declaration "ushort *puVar1;" type_identifier (pointer_declarator "*puVar1" * identifier) ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "undefined4 *puVar3;" type_identifier (pointer_declarator "*puVar3" * identifier) ;) (declaration "int unaff_EDI;" primitive_type identifier ;) (declaration "uint local_14;" type_identifier identifier ;) (declaration "uint local_10;" type_identifier identifier ;) (expression_statement "FUN_0003a401();" (call_expression "FUN_0003a401()" identifier (argument_list "()" ( ))) ;) (if_statement "if ((*(byte *)(param_1[2] + 9) & 0x20) == 0) {\n    puVar3 = (undefined4 *)FUN_0004c400();\n  }\n  else {\n    puVar3 = *(undefined4 **)(param_1[2] + 0x10);\n  }" if (parenthesized_expression "((*(byte *)(param_1[2] + 9) & 0x20) == 0)" ( (binary_expression "(*(byte *)(param_1[2] + 9) & 0x20) == 0" (parenthesized_expression "(*(byte *)(param_1[2] + 9) & 0x20)" ( (binary_expression "*(byte *)(param_1[2] + 9) & 0x20" (pointer_expression "*(byte *)(param_1[2] + 9)" * (cast_expression "(byte *)(param_1[2] + 9)" ( (type_descriptor "byte *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1[2] + 9)" ( (binary_expression "param_1[2] + 9" (subscript_expression "param_1[2]" identifier [ number_literal ]) + number_literal) )))) & number_literal) )) == number_literal) )) (compound_statement "{\n    puVar3 = (undefined4 *)FUN_0004c400();\n  }" { (expression_statement "puVar3 = (undefined4 *)FUN_0004c400();" (assignment_expression "puVar3 = (undefined4 *)FUN_0004c400()" identifier = (cast_expression "(undefined4 *)FUN_0004c400()" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (call_expression "FUN_0004c400()" identifier (argument_list "()" ( ))))) ;) }) (else_clause "else {\n    puVar3 = *(undefined4 **)(param_1[2] + 0x10);\n  }" else (compound_statement "{\n    puVar3 = *(undefined4 **)(param_1[2] + 0x10);\n  }" { (expression_statement "puVar3 = *(undefined4 **)(param_1[2] + 0x10);" (assignment_expression "puVar3 = *(undefined4 **)(param_1[2] + 0x10)" identifier = (pointer_expression "*(undefined4 **)(param_1[2] + 0x10)" * (cast_expression "(undefined4 **)(param_1[2] + 0x10)" ( (type_descriptor "undefined4 **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(param_1[2] + 0x10)" ( (binary_expression "param_1[2] + 0x10" (subscript_expression "param_1[2]" identifier [ number_literal ]) + number_literal) ))))) ;) }))) (if_statement "if (puVar3 == (undefined4 *)0x0) {\n    iVar2 = FUN_000715f0(1,0);\n    if (iVar2 == 0x12) {\n      param_1[5] = 0x12;\n      FUN_0006f5d0(0);\n    }\n    goto LAB_000a0ae6;\n  }" if (parenthesized_expression "(puVar3 == (undefined4 *)0x0)" ( (binary_expression "puVar3 == (undefined4 *)0x0" identifier == (cast_expression "(undefined4 *)0x0" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n    iVar2 = FUN_000715f0(1,0);\n    if (iVar2 == 0x12) {\n      param_1[5] = 0x12;\n      FUN_0006f5d0(0);\n    }\n    goto LAB_000a0ae6;\n  }" { (expression_statement "iVar2 = FUN_000715f0(1,0);" (assignment_expression "iVar2 = FUN_000715f0(1,0)" identifier = (call_expression "FUN_000715f0(1,0)" identifier (argument_list "(1,0)" ( number_literal , number_literal )))) ;) (if_statement "if (iVar2 == 0x12) {\n      param_1[5] = 0x12;\n      FUN_0006f5d0(0);\n    }" if (parenthesized_expression "(iVar2 == 0x12)" ( (binary_expression "iVar2 == 0x12" identifier == number_literal) )) (compound_statement "{\n      param_1[5] = 0x12;\n      FUN_0006f5d0(0);\n    }" { (expression_statement "param_1[5] = 0x12;" (assignment_expression "param_1[5] = 0x12" (subscript_expression "param_1[5]" identifier [ number_literal ]) = number_literal) ;) (expression_statement "FUN_0006f5d0(0);" (call_expression "FUN_0006f5d0(0)" identifier (argument_list "(0)" ( number_literal ))) ;) })) (goto_statement "goto LAB_000a0ae6;" goto statement_identifier ;) })) (expression_statement "local_14 = puVar3[4];" (assignment_expression "local_14 = puVar3[4]" identifier = (subscript_expression "puVar3[4]" identifier [ number_literal ])) ;) (expression_statement "local_10 = puVar3[5];" (assignment_expression "local_10 = puVar3[5]" identifier = (subscript_expression "puVar3[5]" identifier [ number_literal ])) ;) (expression_statement "*puVar3 = param_1;" (assignment_expression "*puVar3 = param_1" (pointer_expression "*puVar3" * identifier) = identifier) ;) (if_statement "if (local_10 < (uint)puVar3[3] || local_10 - puVar3[3] < (uint)(local_14 < (uint)puVar3[2])) {\nLAB_000a0a8b:\n    puVar3[4] = local_14 + 1;\n    puVar3[5] = local_10 + (0xfffffffe < local_14);\n    *(undefined1 *)(local_14 + puVar3[1]) = 0x5d;\n  }\n  else {\n    iVar2 = FUN_0009f0a0();\n    if (iVar2 == 0) {\n      local_14 = puVar3[4];\n      local_10 = puVar3[5];\n      goto LAB_000a0a8b;\n    }\n  }" if (parenthesized_expression "(local_10 < (uint)puVar3[3] || local_10 - puVar3[3] < (uint)(local_14 < (uint)puVar3[2]))" ( (binary_expression "local_10 < (uint)puVar3[3] || local_10 - puVar3[3] < (uint)(local_14 < (uint)puVar3[2])" (binary_expression "local_10 < (uint)puVar3[3]" identifier < (cast_expression "(uint)puVar3[3]" ( (type_descriptor "uint" type_identifier) ) (subscript_expression "puVar3[3]" identifier [ number_literal ]))) || (binary_expression "local_10 - puVar3[3] < (uint)(local_14 < (uint)puVar3[2])" (binary_expression "local_10 - puVar3[3]" identifier - (subscript_expression "puVar3[3]" identifier [ number_literal ])) < (call_expression "(uint)(local_14 < (uint)puVar3[2])" (parenthesized_expression "(uint)" ( identifier )) (argument_list "(local_14 < (uint)puVar3[2])" ( (binary_expression "local_14 < (uint)puVar3[2]" identifier < (cast_expression "(uint)puVar3[2]" ( (type_descriptor "uint" type_identifier) ) (subscript_expression "puVar3[2]" identifier [ number_literal ]))) ))))) )) (compound_statement "{\nLAB_000a0a8b:\n    puVar3[4] = local_14 + 1;\n    puVar3[5] = local_10 + (0xfffffffe < local_14);\n    *(undefined1 *)(local_14 + puVar3[1]) = 0x5d;\n  }" { (labeled_statement "LAB_000a0a8b:\n    puVar3[4] = local_14 + 1;" statement_identifier : (expression_statement "puVar3[4] = local_14 + 1;" (assignment_expression "puVar3[4] = local_14 + 1" (subscript_expression "puVar3[4]" identifier [ number_literal ]) = (binary_expression "local_14 + 1" identifier + number_literal)) ;)) (expression_statement "puVar3[5] = local_10 + (0xfffffffe < local_14);" (assignment_expression "puVar3[5] = local_10 + (0xfffffffe < local_14)" (subscript_expression "puVar3[5]" identifier [ number_literal ]) = (binary_expression "local_10 + (0xfffffffe < local_14)" identifier + (parenthesized_expression "(0xfffffffe < local_14)" ( (binary_expression "0xfffffffe < local_14" number_literal < identifier) )))) ;) (expression_statement "*(undefined1 *)(local_14 + puVar3[1]) = 0x5d;" (assignment_expression "*(undefined1 *)(local_14 + puVar3[1]) = 0x5d" (pointer_expression "*(undefined1 *)(local_14 + puVar3[1])" * (cast_expression "(undefined1 *)(local_14 + puVar3[1])" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(local_14 + puVar3[1])" ( (binary_expression "local_14 + puVar3[1]" identifier + (subscript_expression "puVar3[1]" identifier [ number_literal ])) )))) = number_literal) ;) }) (else_clause "else {\n    iVar2 = FUN_0009f0a0();\n    if (iVar2 == 0) {\n      local_14 = puVar3[4];\n      local_10 = puVar3[5];\n      goto LAB_000a0a8b;\n    }\n  }" else (compound_statement "{\n    iVar2 = FUN_0009f0a0();\n    if (iVar2 == 0) {\n      local_14 = puVar3[4];\n      local_10 = puVar3[5];\n      goto LAB_000a0a8b;\n    }\n  }" { (expression_statement "iVar2 = FUN_0009f0a0();" (assignment_expression "iVar2 = FUN_0009f0a0()" identifier = (call_expression "FUN_0009f0a0()" identifier (argument_list "()" ( )))) ;) (if_statement "if (iVar2 == 0) {\n      local_14 = puVar3[4];\n      local_10 = puVar3[5];\n      goto LAB_000a0a8b;\n    }" if (parenthesized_expression "(iVar2 == 0)" ( (binary_expression "iVar2 == 0" identifier == number_literal) )) (compound_statement "{\n      local_14 = puVar3[4];\n      local_10 = puVar3[5];\n      goto LAB_000a0a8b;\n    }" { (expression_statement "local_14 = puVar3[4];" (assignment_expression "local_14 = puVar3[4]" identifier = (subscript_expression "puVar3[4]" identifier [ number_literal ])) ;) (expression_statement "local_10 = puVar3[5];" (assignment_expression "local_10 = puVar3[5]" identifier = (subscript_expression "puVar3[5]" identifier [ number_literal ])) ;) (goto_statement "goto LAB_000a0a8b;" goto statement_identifier ;) })) }))) (if_statement "if (*(char *)((int)puVar3 + 0x19) == '\0') {\n    iVar2 = unaff_EDI + -0x5ca46;\n    if (*(char *)(puVar3 + 6) != '\0') {\n      iVar2 = -1;\n    }\n    iVar2 = FUN_000715f0(1,iVar2);\n    if (iVar2 == 0x12) {\n      param_1[5] = 0x12;\n      FUN_0006f5d0(0);\n    }\n    *(undefined1 *)(puVar3 + 6) = 1;\n  }\n  else if (*(char *)((int)puVar3 + 0x19) == '\x01') {\n    FUN_0004e320(param_1);\n  }" if (parenthesized_expression "(*(char *)((int)puVar3 + 0x19) == '\0')" ( (binary_expression "*(char *)((int)puVar3 + 0x19) == '\0'" (pointer_expression "*(char *)((int)puVar3 + 0x19)" * (cast_expression "(char *)((int)puVar3 + 0x19)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((int)puVar3 + 0x19)" ( (binary_expression "(int)puVar3 + 0x19" (cast_expression "(int)puVar3" ( (type_descriptor "int" primitive_type) ) identifier) + number_literal) )))) == (char_literal "'\0'" ' escape_sequence ')) )) (compound_statement "{\n    iVar2 = unaff_EDI + -0x5ca46;\n    if (*(char *)(puVar3 + 6) != '\0') {\n      iVar2 = -1;\n    }\n    iVar2 = FUN_000715f0(1,iVar2);\n    if (iVar2 == 0x12) {\n      param_1[5] = 0x12;\n      FUN_0006f5d0(0);\n    }\n    *(undefined1 *)(puVar3 + 6) = 1;\n  }" { (expression_statement "iVar2 = unaff_EDI + -0x5ca46;" (assignment_expression "iVar2 = unaff_EDI + -0x5ca46" identifier = (binary_expression "unaff_EDI + -0x5ca46" identifier + number_literal)) ;) (if_statement "if (*(char *)(puVar3 + 6) != '\0') {\n      iVar2 = -1;\n    }" if (parenthesized_expression "(*(char *)(puVar3 + 6) != '\0')" ( (binary_expression "*(char *)(puVar3 + 6) != '\0'" (pointer_expression "*(char *)(puVar3 + 6)" * (cast_expression "(char *)(puVar3 + 6)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(puVar3 + 6)" ( (binary_expression "puVar3 + 6" identifier + number_literal) )))) != (char_literal "'\0'" ' escape_sequence ')) )) (compound_statement "{\n      iVar2 = -1;\n    }" { (expression_statement "iVar2 = -1;" (assignment_expression "iVar2 = -1" identifier = number_literal) ;) })) (expression_statement "iVar2 = FUN_000715f0(1,iVar2);" (assignment_expression "iVar2 = FUN_000715f0(1,iVar2)" identifier = (call_expression "FUN_000715f0(1,iVar2)" identifier (argument_list "(1,iVar2)" ( number_literal , identifier )))) ;) (if_statement "if (iVar2 == 0x12) {\n      param_1[5] = 0x12;\n      FUN_0006f5d0(0);\n    }" if (parenthesized_expression "(iVar2 == 0x12)" ( (binary_expression "iVar2 == 0x12" identifier == number_literal) )) (compound_statement "{\n      param_1[5] = 0x12;\n      FUN_0006f5d0(0);\n    }" { (expression_statement "param_1[5] = 0x12;" (assignment_expression "param_1[5] = 0x12" (subscript_expression "param_1[5]" identifier [ number_literal ]) = number_literal) ;) (expression_statement "FUN_0006f5d0(0);" (call_expression "FUN_0006f5d0(0)" identifier (argument_list "(0)" ( number_literal ))) ;) })) (expression_statement "*(undefined1 *)(puVar3 + 6) = 1;" (assignment_expression "*(undefined1 *)(puVar3 + 6) = 1" (pointer_expression "*(undefined1 *)(puVar3 + 6)" * (cast_expression "(undefined1 *)(puVar3 + 6)" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(puVar3 + 6)" ( (binary_expression "puVar3 + 6" identifier + number_literal) )))) = number_literal) ;) }) (else_clause "else if (*(char *)((int)puVar3 + 0x19) == '\x01') {\n    FUN_0004e320(param_1);\n  }" else (if_statement "if (*(char *)((int)puVar3 + 0x19) == '\x01') {\n    FUN_0004e320(param_1);\n  }" if (parenthesized_expression "(*(char *)((int)puVar3 + 0x19) == '\x01')" ( (binary_expression "*(char *)((int)puVar3 + 0x19) == '\x01'" (pointer_expression "*(char *)((int)puVar3 + 0x19)" * (cast_expression "(char *)((int)puVar3 + 0x19)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((int)puVar3 + 0x19)" ( (binary_expression "(int)puVar3 + 0x19" (cast_expression "(int)puVar3" ( (type_descriptor "int" primitive_type) ) identifier) + number_literal) )))) == (char_literal "'\x01'" ' escape_sequence ')) )) (compound_statement "{\n    FUN_0004e320(param_1);\n  }" { (expression_statement "FUN_0004e320(param_1);" (call_expression "FUN_0004e320(param_1)" identifier (argument_list "(param_1)" ( identifier ))) ;) })))) (labeled_statement "LAB_000a0ae6:\n  iVar2 = *param_1;" statement_identifier : (expression_statement "iVar2 = *param_1;" (assignment_expression "iVar2 = *param_1" identifier = (pointer_expression "*param_1" * identifier)) ;)) (expression_statement "*(undefined1 *)(iVar2 + 0xb) = 0x4a;" (assignment_expression "*(undefined1 *)(iVar2 + 0xb) = 0x4a" (pointer_expression "*(undefined1 *)(iVar2 + 0xb)" * (cast_expression "(undefined1 *)(iVar2 + 0xb)" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar2 + 0xb)" ( (binary_expression "iVar2 + 0xb" identifier + number_literal) )))) = number_literal) ;) (expression_statement "puVar1 = (ushort *)(iVar2 + 8);" (assignment_expression "puVar1 = (ushort *)(iVar2 + 8)" identifier = (cast_expression "(ushort *)(iVar2 + 8)" ( (type_descriptor "ushort *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar2 + 8)" ( (binary_expression "iVar2 + 8" identifier + number_literal) )))) ;) (expression_statement "*puVar1 = *puVar1 | 0x8000;" (assignment_expression "*puVar1 = *puVar1 | 0x8000" (pointer_expression "*puVar1" * identifier) = (binary_expression "*puVar1 | 0x8000" (pointer_expression "*puVar1" * identifier) | number_literal)) ;) (return_statement "return;" return ;) })))
(translation_unit (function_definition TYPE (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE (pointer_declarator * IDENT)) ))) (compound_statement { (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE IDENT ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (expression_statement (call_expression IDENT (argument_list ( ))) ;) (if_statement if (parenthesized_expression ( (binary_expression (parenthesized_expression ( (binary_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression (subscript_expression IDENT [ LIT ]) + LIT) )))) & LIT) )) == LIT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (call_expression IDENT (argument_list ( ))))) ;) }) (else_clause else (compound_statement { (expression_statement (assignment_expression IDENT = (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator * (abstract_pointer_declarator *))) ) (parenthesized_expression ( (binary_expression (subscript_expression IDENT [ LIT ]) + LIT) ))))) ;) }))) (if_statement if (parenthesized_expression ( (binary_expression IDENT == (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) LIT)) )) (compound_statement { (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( LIT , LIT )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = LIT) ;) (expression_statement (call_expression IDENT (argument_list ( LIT ))) ;) })) (goto_statement goto statement_identifier ;) })) (expression_statement (assignment_expression IDENT = (subscript_expression IDENT [ LIT ])) ;) (expression_statement (assignment_expression IDENT = (subscript_expression IDENT [ LIT ])) ;) (expression_statement (assignment_expression (pointer_expression * IDENT) = IDENT) ;) (if_statement if (parenthesized_expression ( (binary_expression (binary_expression IDENT < (cast_expression ( (type_descriptor TYPE) ) (subscript_expression IDENT [ LIT ]))) || (binary_expression (binary_expression IDENT - (subscript_expression IDENT [ LIT ])) < (call_expression (parenthesized_expression ( IDENT )) (argument_list ( (binary_expression IDENT < (cast_expression ( (type_descriptor TYPE) ) (subscript_expression IDENT [ LIT ]))) ))))) )) (compound_statement { (labeled_statement statement_identifier : (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = (binary_expression IDENT + LIT)) ;)) (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = (binary_expression IDENT + (parenthesized_expression ( (binary_expression LIT < IDENT) )))) ;) (expression_statement (assignment_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + (subscript_expression IDENT [ LIT ])) )))) = LIT) ;) }) (else_clause else (compound_statement { (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (subscript_expression IDENT [ LIT ])) ;) (expression_statement (assignment_expression IDENT = (subscript_expression IDENT [ LIT ])) ;) (goto_statement goto statement_identifier ;) })) }))) (if_statement if (parenthesized_expression ( (binary_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression (cast_expression ( (type_descriptor TYPE) ) IDENT) + LIT) )))) == (char_literal ' escape_sequence ')) )) (compound_statement { (expression_statement (assignment_expression IDENT = (binary_expression IDENT + LIT)) ;) (if_statement if (parenthesized_expression ( (binary_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) != (char_literal ' escape_sequence ')) )) (compound_statement { (expression_statement (assignment_expression IDENT = LIT) ;) })) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( LIT , IDENT )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = LIT) ;) (expression_statement (call_expression IDENT (argument_list ( LIT ))) ;) })) (expression_statement (assignment_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) = LIT) ;) }) (else_clause else (if_statement if (parenthesized_expression ( (binary_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression (cast_expression ( (type_descriptor TYPE) ) IDENT) + LIT) )))) == (char_literal ' escape_sequence ')) )) (compound_statement { (expression_statement (call_expression IDENT (argument_list ( IDENT ))) ;) })))) (labeled_statement statement_identifier : (expression_statement (assignment_expression IDENT = (pointer_expression * IDENT)) ;)) (expression_statement (assignment_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) = LIT) ;) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) ;) (expression_statement (assignment_expression (pointer_expression * IDENT) = (binary_expression (pointer_expression * IDENT) | LIT)) ;) (return_statement return ;) })))
(function_definition "void FUN_000a0a40(int *param_1)\n\n{\n  ushort *puVar1;\n  int iVar2;\n  undefined4 *puVar3;\n  int unaff_EDI;\n  uint local_14;\n  uint local_10;\n  \n  FUN_0003a401();\n  if ((*(byte *)(param_1[2] + 9) & 0x20) == 0) {\n    puVar3 = (undefined4 *)FUN_0004c400();\n  }\n  else {\n    puVar3 = *(undefined4 **)(param_1[2] + 0x10);\n  }\n  if (puVar3 == (undefined4 *)0x0) {\n    iVar2 = FUN_000715f0(1,0);\n    if (iVar2 == 0x12) {\n      param_1[5] = 0x12;\n      FUN_0006f5d0(0);\n    }\n    goto LAB_000a0ae6;\n  }\n  local_14 = puVar3[4];\n  local_10 = puVar3[5];\n  *puVar3 = param_1;\n  if (local_10 < (uint)puVar3[3] || local_10 - puVar3[3] < (uint)(local_14 < (uint)puVar3[2])) {\nLAB_000a0a8b:\n    puVar3[4] = local_14 + 1;\n    puVar3[5] = local_10 + (0xfffffffe < local_14);\n    *(undefined1 *)(local_14 + puVar3[1]) = 0x5d;\n  }\n  else {\n    iVar2 = FUN_0009f0a0();\n    if (iVar2 == 0) {\n      local_14 = puVar3[4];\n      local_10 = puVar3[5];\n      goto LAB_000a0a8b;\n    }\n  }\n  if (*(char *)((int)puVar3 + 0x19) == '\0') {\n    iVar2 = unaff_EDI + -0x5ca46;\n    if (*(char *)(puVar3 + 6) != '\0') {\n      iVar2 = -1;\n    }\n    iVar2 = FUN_000715f0(1,iVar2);\n    if (iVar2 == 0x12) {\n      param_1[5] = 0x12;\n      FUN_0006f5d0(0);\n    }\n    *(undefined1 *)(puVar3 + 6) = 1;\n  }\n  else if (*(char *)((int)puVar3 + 0x19) == '\x01') {\n    FUN_0004e320(param_1);\n  }\nLAB_000a0ae6:\n  iVar2 = *param_1;\n  *(undefined1 *)(iVar2 + 0xb) = 0x4a;\n  puVar1 = (ushort *)(iVar2 + 8);\n  *puVar1 = *puVar1 | 0x8000;\n  return;\n}" (primitive_type "void") (function_declarator "FUN_000a0a40(int *param_1)" (identifier "FUN_000a0a40") (parameter_list "(int *param_1)" (( "(") (parameter_declaration "int *param_1" (primitive_type "int") (pointer_declarator "*param_1" (* "*") (identifier "param_1"))) () ")"))) (compound_statement "{\n  ushort *puVar1;\n  int iVar2;\n  undefined4 *puVar3;\n  int unaff_EDI;\n  uint local_14;\n  uint local_10;\n  \n  FUN_0003a401();\n  if ((*(byte *)(param_1[2] + 9) & 0x20) == 0) {\n    puVar3 = (undefined4 *)FUN_0004c400();\n  }\n  else {\n    puVar3 = *(undefined4 **)(param_1[2] + 0x10);\n  }\n  if (puVar3 == (undefined4 *)0x0) {\n    iVar2 = FUN_000715f0(1,0);\n    if (iVar2 == 0x12) {\n      param_1[5] = 0x12;\n      FUN_0006f5d0(0);\n    }\n    goto LAB_000a0ae6;\n  }\n  local_14 = puVar3[4];\n  local_10 = puVar3[5];\n  *puVar3 = param_1;\n  if (local_10 < (uint)puVar3[3] || local_10 - puVar3[3] < (uint)(local_14 < (uint)puVar3[2])) {\nLAB_000a0a8b:\n    puVar3[4] = local_14 + 1;\n    puVar3[5] = local_10 + (0xfffffffe < local_14);\n    *(undefined1 *)(local_14 + puVar3[1]) = 0x5d;\n  }\n  else {\n    iVar2 = FUN_0009f0a0();\n    if (iVar2 == 0) {\n      local_14 = puVar3[4];\n      local_10 = puVar3[5];\n      goto LAB_000a0a8b;\n    }\n  }\n  if (*(char *)((int)puVar3 + 0x19) == '\0') {\n    iVar2 = unaff_EDI + -0x5ca46;\n    if (*(char *)(puVar3 + 6) != '\0') {\n      iVar2 = -1;\n    }\n    iVar2 = FUN_000715f0(1,iVar2);\n    if (iVar2 == 0x12) {\n      param_1[5] = 0x12;\n      FUN_0006f5d0(0);\n    }\n    *(undefined1 *)(puVar3 + 6) = 1;\n  }\n  else if (*(char *)((int)puVar3 + 0x19) == '\x01') {\n    FUN_0004e320(param_1);\n  }\nLAB_000a0ae6:\n  iVar2 = *param_1;\n  *(undefined1 *)(iVar2 + 0xb) = 0x4a;\n  puVar1 = (ushort *)(iVar2 + 8);\n  *puVar1 = *puVar1 | 0x8000;\n  return;\n}" ({ "{") (declaration "ushort *puVar1;" (type_identifier "ushort") (pointer_declarator "*puVar1" (* "*") (identifier "puVar1")) (; ";")) (declaration "int iVar2;" (primitive_type "int") (identifier "iVar2") (; ";")) (declaration "undefined4 *puVar3;" (type_identifier "undefined4") (pointer_declarator "*puVar3" (* "*") (identifier "puVar3")) (; ";")) (declaration "int unaff_EDI;" (primitive_type "int") (identifier "unaff_EDI") (; ";")) (declaration "uint local_14;" (type_identifier "uint") (identifier "local_14") (; ";")) (declaration "uint local_10;" (type_identifier "uint") (identifier "local_10") (; ";")) (expression_statement "FUN_0003a401();" (call_expression "FUN_0003a401()" (identifier "FUN_0003a401") (argument_list "()" (( "(") () ")"))) (; ";")) (if_statement "if ((*(byte *)(param_1[2] + 9) & 0x20) == 0) {\n    puVar3 = (undefined4 *)FUN_0004c400();\n  }\n  else {\n    puVar3 = *(undefined4 **)(param_1[2] + 0x10);\n  }" (if "if") (parenthesized_expression "((*(byte *)(param_1[2] + 9) & 0x20) == 0)" (( "(") (binary_expression "(*(byte *)(param_1[2] + 9) & 0x20) == 0" (parenthesized_expression "(*(byte *)(param_1[2] + 9) & 0x20)" (( "(") (binary_expression "*(byte *)(param_1[2] + 9) & 0x20" (pointer_expression "*(byte *)(param_1[2] + 9)" (* "*") (cast_expression "(byte *)(param_1[2] + 9)" (( "(") (type_descriptor "byte *" (type_identifier "byte") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1[2] + 9)" (( "(") (binary_expression "param_1[2] + 9" (subscript_expression "param_1[2]" (identifier "param_1") ([ "[") (number_literal "2") (] "]")) (+ "+") (number_literal "9")) () ")")))) (& "&") (number_literal "0x20")) () ")")) (== "==") (number_literal "0")) () ")")) (compound_statement "{\n    puVar3 = (undefined4 *)FUN_0004c400();\n  }" ({ "{") (expression_statement "puVar3 = (undefined4 *)FUN_0004c400();" (assignment_expression "puVar3 = (undefined4 *)FUN_0004c400()" (identifier "puVar3") (= "=") (cast_expression "(undefined4 *)FUN_0004c400()" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (call_expression "FUN_0004c400()" (identifier "FUN_0004c400") (argument_list "()" (( "(") () ")"))))) (; ";")) (} "}")) (else_clause "else {\n    puVar3 = *(undefined4 **)(param_1[2] + 0x10);\n  }" (else "else") (compound_statement "{\n    puVar3 = *(undefined4 **)(param_1[2] + 0x10);\n  }" ({ "{") (expression_statement "puVar3 = *(undefined4 **)(param_1[2] + 0x10);" (assignment_expression "puVar3 = *(undefined4 **)(param_1[2] + 0x10)" (identifier "puVar3") (= "=") (pointer_expression "*(undefined4 **)(param_1[2] + 0x10)" (* "*") (cast_expression "(undefined4 **)(param_1[2] + 0x10)" (( "(") (type_descriptor "undefined4 **" (type_identifier "undefined4") (abstract_pointer_declarator "**" (* "*") (abstract_pointer_declarator "*" (* "*")))) () ")") (parenthesized_expression "(param_1[2] + 0x10)" (( "(") (binary_expression "param_1[2] + 0x10" (subscript_expression "param_1[2]" (identifier "param_1") ([ "[") (number_literal "2") (] "]")) (+ "+") (number_literal "0x10")) () ")"))))) (; ";")) (} "}")))) (if_statement "if (puVar3 == (undefined4 *)0x0) {\n    iVar2 = FUN_000715f0(1,0);\n    if (iVar2 == 0x12) {\n      param_1[5] = 0x12;\n      FUN_0006f5d0(0);\n    }\n    goto LAB_000a0ae6;\n  }" (if "if") (parenthesized_expression "(puVar3 == (undefined4 *)0x0)" (( "(") (binary_expression "puVar3 == (undefined4 *)0x0" (identifier "puVar3") (== "==") (cast_expression "(undefined4 *)0x0" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0x0"))) () ")")) (compound_statement "{\n    iVar2 = FUN_000715f0(1,0);\n    if (iVar2 == 0x12) {\n      param_1[5] = 0x12;\n      FUN_0006f5d0(0);\n    }\n    goto LAB_000a0ae6;\n  }" ({ "{") (expression_statement "iVar2 = FUN_000715f0(1,0);" (assignment_expression "iVar2 = FUN_000715f0(1,0)" (identifier "iVar2") (= "=") (call_expression "FUN_000715f0(1,0)" (identifier "FUN_000715f0") (argument_list "(1,0)" (( "(") (number_literal "1") (, ",") (number_literal "0") () ")")))) (; ";")) (if_statement "if (iVar2 == 0x12) {\n      param_1[5] = 0x12;\n      FUN_0006f5d0(0);\n    }" (if "if") (parenthesized_expression "(iVar2 == 0x12)" (( "(") (binary_expression "iVar2 == 0x12" (identifier "iVar2") (== "==") (number_literal "0x12")) () ")")) (compound_statement "{\n      param_1[5] = 0x12;\n      FUN_0006f5d0(0);\n    }" ({ "{") (expression_statement "param_1[5] = 0x12;" (assignment_expression "param_1[5] = 0x12" (subscript_expression "param_1[5]" (identifier "param_1") ([ "[") (number_literal "5") (] "]")) (= "=") (number_literal "0x12")) (; ";")) (expression_statement "FUN_0006f5d0(0);" (call_expression "FUN_0006f5d0(0)" (identifier "FUN_0006f5d0") (argument_list "(0)" (( "(") (number_literal "0") () ")"))) (; ";")) (} "}"))) (goto_statement "goto LAB_000a0ae6;" (goto "goto") (statement_identifier "LAB_000a0ae6") (; ";")) (} "}"))) (expression_statement "local_14 = puVar3[4];" (assignment_expression "local_14 = puVar3[4]" (identifier "local_14") (= "=") (subscript_expression "puVar3[4]" (identifier "puVar3") ([ "[") (number_literal "4") (] "]"))) (; ";")) (expression_statement "local_10 = puVar3[5];" (assignment_expression "local_10 = puVar3[5]" (identifier "local_10") (= "=") (subscript_expression "puVar3[5]" (identifier "puVar3") ([ "[") (number_literal "5") (] "]"))) (; ";")) (expression_statement "*puVar3 = param_1;" (assignment_expression "*puVar3 = param_1" (pointer_expression "*puVar3" (* "*") (identifier "puVar3")) (= "=") (identifier "param_1")) (; ";")) (if_statement "if (local_10 < (uint)puVar3[3] || local_10 - puVar3[3] < (uint)(local_14 < (uint)puVar3[2])) {\nLAB_000a0a8b:\n    puVar3[4] = local_14 + 1;\n    puVar3[5] = local_10 + (0xfffffffe < local_14);\n    *(undefined1 *)(local_14 + puVar3[1]) = 0x5d;\n  }\n  else {\n    iVar2 = FUN_0009f0a0();\n    if (iVar2 == 0) {\n      local_14 = puVar3[4];\n      local_10 = puVar3[5];\n      goto LAB_000a0a8b;\n    }\n  }" (if "if") (parenthesized_expression "(local_10 < (uint)puVar3[3] || local_10 - puVar3[3] < (uint)(local_14 < (uint)puVar3[2]))" (( "(") (binary_expression "local_10 < (uint)puVar3[3] || local_10 - puVar3[3] < (uint)(local_14 < (uint)puVar3[2])" (binary_expression "local_10 < (uint)puVar3[3]" (identifier "local_10") (< "<") (cast_expression "(uint)puVar3[3]" (( "(") (type_descriptor "uint" (type_identifier "uint")) () ")") (subscript_expression "puVar3[3]" (identifier "puVar3") ([ "[") (number_literal "3") (] "]")))) (|| "||") (binary_expression "local_10 - puVar3[3] < (uint)(local_14 < (uint)puVar3[2])" (binary_expression "local_10 - puVar3[3]" (identifier "local_10") (- "-") (subscript_expression "puVar3[3]" (identifier "puVar3") ([ "[") (number_literal "3") (] "]"))) (< "<") (call_expression "(uint)(local_14 < (uint)puVar3[2])" (parenthesized_expression "(uint)" (( "(") (identifier "uint") () ")")) (argument_list "(local_14 < (uint)puVar3[2])" (( "(") (binary_expression "local_14 < (uint)puVar3[2]" (identifier "local_14") (< "<") (cast_expression "(uint)puVar3[2]" (( "(") (type_descriptor "uint" (type_identifier "uint")) () ")") (subscript_expression "puVar3[2]" (identifier "puVar3") ([ "[") (number_literal "2") (] "]")))) () ")"))))) () ")")) (compound_statement "{\nLAB_000a0a8b:\n    puVar3[4] = local_14 + 1;\n    puVar3[5] = local_10 + (0xfffffffe < local_14);\n    *(undefined1 *)(local_14 + puVar3[1]) = 0x5d;\n  }" ({ "{") (labeled_statement "LAB_000a0a8b:\n    puVar3[4] = local_14 + 1;" (statement_identifier "LAB_000a0a8b") (: ":") (expression_statement "puVar3[4] = local_14 + 1;" (assignment_expression "puVar3[4] = local_14 + 1" (subscript_expression "puVar3[4]" (identifier "puVar3") ([ "[") (number_literal "4") (] "]")) (= "=") (binary_expression "local_14 + 1" (identifier "local_14") (+ "+") (number_literal "1"))) (; ";"))) (expression_statement "puVar3[5] = local_10 + (0xfffffffe < local_14);" (assignment_expression "puVar3[5] = local_10 + (0xfffffffe < local_14)" (subscript_expression "puVar3[5]" (identifier "puVar3") ([ "[") (number_literal "5") (] "]")) (= "=") (binary_expression "local_10 + (0xfffffffe < local_14)" (identifier "local_10") (+ "+") (parenthesized_expression "(0xfffffffe < local_14)" (( "(") (binary_expression "0xfffffffe < local_14" (number_literal "0xfffffffe") (< "<") (identifier "local_14")) () ")")))) (; ";")) (expression_statement "*(undefined1 *)(local_14 + puVar3[1]) = 0x5d;" (assignment_expression "*(undefined1 *)(local_14 + puVar3[1]) = 0x5d" (pointer_expression "*(undefined1 *)(local_14 + puVar3[1])" (* "*") (cast_expression "(undefined1 *)(local_14 + puVar3[1])" (( "(") (type_descriptor "undefined1 *" (type_identifier "undefined1") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(local_14 + puVar3[1])" (( "(") (binary_expression "local_14 + puVar3[1]" (identifier "local_14") (+ "+") (subscript_expression "puVar3[1]" (identifier "puVar3") ([ "[") (number_literal "1") (] "]"))) () ")")))) (= "=") (number_literal "0x5d")) (; ";")) (} "}")) (else_clause "else {\n    iVar2 = FUN_0009f0a0();\n    if (iVar2 == 0) {\n      local_14 = puVar3[4];\n      local_10 = puVar3[5];\n      goto LAB_000a0a8b;\n    }\n  }" (else "else") (compound_statement "{\n    iVar2 = FUN_0009f0a0();\n    if (iVar2 == 0) {\n      local_14 = puVar3[4];\n      local_10 = puVar3[5];\n      goto LAB_000a0a8b;\n    }\n  }" ({ "{") (expression_statement "iVar2 = FUN_0009f0a0();" (assignment_expression "iVar2 = FUN_0009f0a0()" (identifier "iVar2") (= "=") (call_expression "FUN_0009f0a0()" (identifier "FUN_0009f0a0") (argument_list "()" (( "(") () ")")))) (; ";")) (if_statement "if (iVar2 == 0) {\n      local_14 = puVar3[4];\n      local_10 = puVar3[5];\n      goto LAB_000a0a8b;\n    }" (if "if") (parenthesized_expression "(iVar2 == 0)" (( "(") (binary_expression "iVar2 == 0" (identifier "iVar2") (== "==") (number_literal "0")) () ")")) (compound_statement "{\n      local_14 = puVar3[4];\n      local_10 = puVar3[5];\n      goto LAB_000a0a8b;\n    }" ({ "{") (expression_statement "local_14 = puVar3[4];" (assignment_expression "local_14 = puVar3[4]" (identifier "local_14") (= "=") (subscript_expression "puVar3[4]" (identifier "puVar3") ([ "[") (number_literal "4") (] "]"))) (; ";")) (expression_statement "local_10 = puVar3[5];" (assignment_expression "local_10 = puVar3[5]" (identifier "local_10") (= "=") (subscript_expression "puVar3[5]" (identifier "puVar3") ([ "[") (number_literal "5") (] "]"))) (; ";")) (goto_statement "goto LAB_000a0a8b;" (goto "goto") (statement_identifier "LAB_000a0a8b") (; ";")) (} "}"))) (} "}")))) (if_statement "if (*(char *)((int)puVar3 + 0x19) == '\0') {\n    iVar2 = unaff_EDI + -0x5ca46;\n    if (*(char *)(puVar3 + 6) != '\0') {\n      iVar2 = -1;\n    }\n    iVar2 = FUN_000715f0(1,iVar2);\n    if (iVar2 == 0x12) {\n      param_1[5] = 0x12;\n      FUN_0006f5d0(0);\n    }\n    *(undefined1 *)(puVar3 + 6) = 1;\n  }\n  else if (*(char *)((int)puVar3 + 0x19) == '\x01') {\n    FUN_0004e320(param_1);\n  }" (if "if") (parenthesized_expression "(*(char *)((int)puVar3 + 0x19) == '\0')" (( "(") (binary_expression "*(char *)((int)puVar3 + 0x19) == '\0'" (pointer_expression "*(char *)((int)puVar3 + 0x19)" (* "*") (cast_expression "(char *)((int)puVar3 + 0x19)" (( "(") (type_descriptor "char *" (primitive_type "char") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "((int)puVar3 + 0x19)" (( "(") (binary_expression "(int)puVar3 + 0x19" (cast_expression "(int)puVar3" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (identifier "puVar3")) (+ "+") (number_literal "0x19")) () ")")))) (== "==") (char_literal "'\0'" (' "'") (escape_sequence "\0") (' "'"))) () ")")) (compound_statement "{\n    iVar2 = unaff_EDI + -0x5ca46;\n    if (*(char *)(puVar3 + 6) != '\0') {\n      iVar2 = -1;\n    }\n    iVar2 = FUN_000715f0(1,iVar2);\n    if (iVar2 == 0x12) {\n      param_1[5] = 0x12;\n      FUN_0006f5d0(0);\n    }\n    *(undefined1 *)(puVar3 + 6) = 1;\n  }" ({ "{") (expression_statement "iVar2 = unaff_EDI + -0x5ca46;" (assignment_expression "iVar2 = unaff_EDI + -0x5ca46" (identifier "iVar2") (= "=") (binary_expression "unaff_EDI + -0x5ca46" (identifier "unaff_EDI") (+ "+") (number_literal "-0x5ca46"))) (; ";")) (if_statement "if (*(char *)(puVar3 + 6) != '\0') {\n      iVar2 = -1;\n    }" (if "if") (parenthesized_expression "(*(char *)(puVar3 + 6) != '\0')" (( "(") (binary_expression "*(char *)(puVar3 + 6) != '\0'" (pointer_expression "*(char *)(puVar3 + 6)" (* "*") (cast_expression "(char *)(puVar3 + 6)" (( "(") (type_descriptor "char *" (primitive_type "char") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(puVar3 + 6)" (( "(") (binary_expression "puVar3 + 6" (identifier "puVar3") (+ "+") (number_literal "6")) () ")")))) (!= "!=") (char_literal "'\0'" (' "'") (escape_sequence "\0") (' "'"))) () ")")) (compound_statement "{\n      iVar2 = -1;\n    }" ({ "{") (expression_statement "iVar2 = -1;" (assignment_expression "iVar2 = -1" (identifier "iVar2") (= "=") (number_literal "-1")) (; ";")) (} "}"))) (expression_statement "iVar2 = FUN_000715f0(1,iVar2);" (assignment_expression "iVar2 = FUN_000715f0(1,iVar2)" (identifier "iVar2") (= "=") (call_expression "FUN_000715f0(1,iVar2)" (identifier "FUN_000715f0") (argument_list "(1,iVar2)" (( "(") (number_literal "1") (, ",") (identifier "iVar2") () ")")))) (; ";")) (if_statement "if (iVar2 == 0x12) {\n      param_1[5] = 0x12;\n      FUN_0006f5d0(0);\n    }" (if "if") (parenthesized_expression "(iVar2 == 0x12)" (( "(") (binary_expression "iVar2 == 0x12" (identifier "iVar2") (== "==") (number_literal "0x12")) () ")")) (compound_statement "{\n      param_1[5] = 0x12;\n      FUN_0006f5d0(0);\n    }" ({ "{") (expression_statement "param_1[5] = 0x12;" (assignment_expression "param_1[5] = 0x12" (subscript_expression "param_1[5]" (identifier "param_1") ([ "[") (number_literal "5") (] "]")) (= "=") (number_literal "0x12")) (; ";")) (expression_statement "FUN_0006f5d0(0);" (call_expression "FUN_0006f5d0(0)" (identifier "FUN_0006f5d0") (argument_list "(0)" (( "(") (number_literal "0") () ")"))) (; ";")) (} "}"))) (expression_statement "*(undefined1 *)(puVar3 + 6) = 1;" (assignment_expression "*(undefined1 *)(puVar3 + 6) = 1" (pointer_expression "*(undefined1 *)(puVar3 + 6)" (* "*") (cast_expression "(undefined1 *)(puVar3 + 6)" (( "(") (type_descriptor "undefined1 *" (type_identifier "undefined1") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(puVar3 + 6)" (( "(") (binary_expression "puVar3 + 6" (identifier "puVar3") (+ "+") (number_literal "6")) () ")")))) (= "=") (number_literal "1")) (; ";")) (} "}")) (else_clause "else if (*(char *)((int)puVar3 + 0x19) == '\x01') {\n    FUN_0004e320(param_1);\n  }" (else "else") (if_statement "if (*(char *)((int)puVar3 + 0x19) == '\x01') {\n    FUN_0004e320(param_1);\n  }" (if "if") (parenthesized_expression "(*(char *)((int)puVar3 + 0x19) == '\x01')" (( "(") (binary_expression "*(char *)((int)puVar3 + 0x19) == '\x01'" (pointer_expression "*(char *)((int)puVar3 + 0x19)" (* "*") (cast_expression "(char *)((int)puVar3 + 0x19)" (( "(") (type_descriptor "char *" (primitive_type "char") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "((int)puVar3 + 0x19)" (( "(") (binary_expression "(int)puVar3 + 0x19" (cast_expression "(int)puVar3" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (identifier "puVar3")) (+ "+") (number_literal "0x19")) () ")")))) (== "==") (char_literal "'\x01'" (' "'") (escape_sequence "\x01") (' "'"))) () ")")) (compound_statement "{\n    FUN_0004e320(param_1);\n  }" ({ "{") (expression_statement "FUN_0004e320(param_1);" (call_expression "FUN_0004e320(param_1)" (identifier "FUN_0004e320") (argument_list "(param_1)" (( "(") (identifier "param_1") () ")"))) (; ";")) (} "}"))))) (labeled_statement "LAB_000a0ae6:\n  iVar2 = *param_1;" (statement_identifier "LAB_000a0ae6") (: ":") (expression_statement "iVar2 = *param_1;" (assignment_expression "iVar2 = *param_1" (identifier "iVar2") (= "=") (pointer_expression "*param_1" (* "*") (identifier "param_1"))) (; ";"))) (expression_statement "*(undefined1 *)(iVar2 + 0xb) = 0x4a;" (assignment_expression "*(undefined1 *)(iVar2 + 0xb) = 0x4a" (pointer_expression "*(undefined1 *)(iVar2 + 0xb)" (* "*") (cast_expression "(undefined1 *)(iVar2 + 0xb)" (( "(") (type_descriptor "undefined1 *" (type_identifier "undefined1") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(iVar2 + 0xb)" (( "(") (binary_expression "iVar2 + 0xb" (identifier "iVar2") (+ "+") (number_literal "0xb")) () ")")))) (= "=") (number_literal "0x4a")) (; ";")) (expression_statement "puVar1 = (ushort *)(iVar2 + 8);" (assignment_expression "puVar1 = (ushort *)(iVar2 + 8)" (identifier "puVar1") (= "=") (cast_expression "(ushort *)(iVar2 + 8)" (( "(") (type_descriptor "ushort *" (type_identifier "ushort") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(iVar2 + 8)" (( "(") (binary_expression "iVar2 + 8" (identifier "iVar2") (+ "+") (number_literal "8")) () ")")))) (; ";")) (expression_statement "*puVar1 = *puVar1 | 0x8000;" (assignment_expression "*puVar1 = *puVar1 | 0x8000" (pointer_expression "*puVar1" (* "*") (identifier "puVar1")) (= "=") (binary_expression "*puVar1 | 0x8000" (pointer_expression "*puVar1" (* "*") (identifier "puVar1")) (| "|") (number_literal "0x8000"))) (; ";")) (return_statement "return;" (return "return") (; ";")) (} "}")))

/* WARNING: Unknown calling convention */

void function_1(type_1 *ctx)

{
  type_2 *puVar1;
  type_3 *puVar2;
  type_4 *pMVar3;
  type_5 *p_Var4;
  int var_5;
  type_6 *var_3;
  type_1 *p_1;
  int var_6;
  int in_stack_ffffffdc;
  type_7 in_stack_ffffffe0;
  type_5 *in_stack_ffffffe4;
  type_2 var_8;
  type_2 var_7;
  
  var_1();
  pMVar3 = ctx->pMem;
  if ((pMVar3->flags & 0x2000) == 0) {
    in_stack_ffffffe0 = 'H';
    var_3 = (type_6 *)var_2((type_1 *)&ctx->pFunc,(int)pMVar3,p_1);
  }
  else {
    var_3 = (type_6 *)pMVar3->z;
  }
  if (var_3 == (type_6 *)0x0) {
    p_Var4 = (type_5 *)0x0;
    var_5 = var_4
                      ((type_4 *)&DAT_00000001,(char *)0x0,in_stack_ffffffdc,in_stack_ffffffe0,
                       in_stack_ffffffe4);
    if (var_5 == 0x12) {
      ctx->isError = 0x12;
      var_4(ctx->pOut,(char *)(var_6 + 0xbbe56),1,'\0',p_Var4);
    }
    goto LAB_000a0ae6;
  }
  var_8 = (type_2)var_3->nUsed;
  var_7 = *(type_2 *)((int)&var_3->nUsed + 4);
  var_3->pCtx = ctx;
  puVar1 = (type_2 *)((int)&var_3->nAlloc + 4);
  if (var_7 < *puVar1 || var_7 - *puVar1 < (type_2)(var_8 < (type_2)var_3->nAlloc)) {
LAB_000a0a8b:
    *(type_2 *)&var_3->nUsed = var_8 + 1;
    *(type_2 *)((int)&var_3->nUsed + 4) = var_7 + (0xfffffffe < var_8);
    var_3->zBuf[var_8] = ']';
  }
  else {
    in_stack_ffffffe0 = '$';
    var_5 = var_9(var_3,1);
    if (var_5 == 0) {
      var_8 = (type_2)var_3->nUsed;
      var_7 = *(type_2 *)((int)&var_3->nUsed + 4);
      goto LAB_000a0a8b;
    }
  }
  if (var_3->bErr == '\0') {
    p_Var4 = (type_5 *)(var_6 + -0x5ca46);
    if (var_3->bStatic != '\0') {
      p_Var4 = (type_5 *)&DAT_ffffffff;
    }
    var_5 = var_4
                      ((type_4 *)&DAT_00000001,(char *)p_Var4,in_stack_ffffffdc,in_stack_ffffffe0,
                       in_stack_ffffffe4);
    if (var_5 == 0x12) {
      ctx->isError = 0x12;
      var_4(ctx->pOut,(char *)(var_6 + 0xbbe56),1,'\0',p_Var4);
    }
    var_3->bStatic = '\x01';
  }
  else if (var_3->bErr == '\x01') {
    var_10(ctx);
  }
LAB_000a0ae6:
  pMVar3 = ctx->pOut;
  pMVar3->eSubtype = 'J';
  puVar2 = &pMVar3->flags;
  *puVar2 = *puVar2 | 0x8000;
  return;
}


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

void MASKED(int *param_1)

{
  ushort *puVar1;
  int iVar2;
  undefined4 *puVar3;
  int unaff_EDI;
  uint local_14;
  uint local_10;
  
  FUN_0003a401();
  if ((*(byte *)(param_1[2] + 9) & 0x20) == 0) {
    puVar3 = (undefined4 *)FUN_0004c400();
  }
  else {
    puVar3 = *(undefined4 **)(param_1[2] + 0x10);
  }
  if (puVar3 == (undefined4 *)0x0) {
    iVar2 = FUN_000715f0(1,0);
    if (iVar2 == 0x12) {
      param_1[5] = 0x12;
      FUN_0006f5d0(0);
    }
    goto LAB_000a0ae6;
  }
  local_14 = puVar3[4];
  local_10 = puVar3[5];
  *puVar3 = param_1;
  if (local_10 < (uint)puVar3[3] || local_10 - puVar3[3] < (uint)(local_14 < (uint)puVar3[2])) {
LAB_000a0a8b:
    puVar3[4] = local_14 + 1;
    puVar3[5] = local_10 + (0xfffffffe < local_14);
    *(undefined1 *)(local_14 + puVar3[1]) = 0x5d;
  }
  else {
    iVar2 = FUN_0009f0a0();
    if (iVar2 == 0) {
      local_14 = puVar3[4];
      local_10 = puVar3[5];
      goto LAB_000a0a8b;
    }
  }
  if (*(char *)((int)puVar3 + 0x19) == '\0') {
    iVar2 = unaff_EDI + -0x5ca46;
    if (*(char *)(puVar3 + 6) != '\0') {
      iVar2 = -1;
    }
    iVar2 = FUN_000715f0(1,iVar2);
    if (iVar2 == 0x12) {
      param_1[5] = 0x12;
      FUN_0006f5d0(0);
    }
    *(undefined1 *)(puVar3 + 6) = 1;
  }
  else if (*(char *)((int)puVar3 + 0x19) == '\x01') {
    FUN_0004e320(param_1);
  }
LAB_000a0ae6:
  iVar2 = *param_1;
  *(undefined1 *)(iVar2 + 0xb) = 0x4a;
  puVar1 = (ushort *)(iVar2 + 8);
  *puVar1 = *puVar1 | 0x8000;
  return;
}

