
char * sqlite3_vsnprintf(int n,char *zBuf,char *zFormat,__va_list_tag *ap)

{
  long lVar1;
  long in_FS_OFFSET;
  StrAccum acc;
  
  lVar1 = *(long *)(in_FS_OFFSET + 0x28);
  if (0 < n) {
    acc.db = (sqlite3 *)0x0;
    acc.mxAlloc = 0;
    acc.nChar = 0;
    acc.accError = '\0';
    acc.printfFlags = '\0';
    acc.zText = zBuf;
    acc.nAlloc = n;
    sqlite3_str_vappendf(&acc,zFormat,ap);
    zBuf[acc.nChar] = '\0';
  }
  if (lVar1 == *(long *)(in_FS_OFFSET + 0x28)) {
    return zBuf;
  }
                    /* WARNING: Subroutine does not return */
  __stack_chk_fail();
}



long FUN_00156538(int param_1,long param_2,undefined8 param_3,undefined8 param_4)

{
  long in_FS_OFFSET;
  undefined8 local_38;
  long local_30;
  int local_28;
  undefined4 local_24;
  uint local_20;
  undefined1 local_1c;
  undefined1 local_1b;
  long local_10;
  
  local_10 = *(long *)(in_FS_OFFSET + 0x28);
  if (0 < param_1) {
    local_38 = 0;
    local_24 = 0;
    local_20 = 0;
    local_1c = 0;
    local_1b = 0;
    local_30 = param_2;
    local_28 = param_1;
    FUN_00154b45(&local_38,param_3,param_4);
    *(undefined1 *)(param_2 + (ulong)local_20) = 0;
  }
  if (local_10 == *(long *)(in_FS_OFFSET + 0x28)) {
    return param_2;
  }
                    /* WARNING: Subroutine does not return */
  __stack_chk_fail();
}


PUSH RBX
SUB RSP,0x30
MOV RBX,RSI
MOV RAX,qword ptr FS:[0x28]
MOV qword ptr [RSP + 0x28],RAX
XOR EAX,EAX
TEST EDI,EDI
JLE 0x00156595
MOV RSI,RDX
MOV qword ptr [RSP + 0x8],RBX
MOV qword ptr [RSP],0x0
MOV dword ptr [RSP + 0x10],EDI
MOV dword ptr [RSP + 0x14],0x0
MOV dword ptr [RSP + 0x18],0x0
MOV byte ptr [RSP + 0x1c],0x0
MOV byte ptr [RSP + 0x1d],0x0
MOV RDI,RSP
MOV RDX,RCX
CALL 0x00154b45
MOV EAX,dword ptr [RSP + 0x18]
MOV byte ptr [RBX + RAX*0x1],0x0
MOV RAX,RBX
MOV RDX,qword ptr [RSP + 0x28]
XOR RDX,qword ptr FS:[0x28]
JNZ 0x001565ae
ADD RSP,0x30
POP RBX
RET
CALL 0x0010e4d0
(translation_unit "long FUN_00156538(int param_1,long param_2,undefined8 param_3,undefined8 param_4)\n\n{\n  long in_FS_OFFSET;\n  undefined8 local_38;\n  long local_30;\n  int local_28;\n  undefined4 local_24;\n  uint local_20;\n  undefined1 local_1c;\n  undefined1 local_1b;\n  long local_10;\n  \n  local_10 = *(long *)(in_FS_OFFSET + 0x28);\n  if (0 < param_1) {\n    local_38 = 0;\n    local_24 = 0;\n    local_20 = 0;\n    local_1c = 0;\n    local_1b = 0;\n    local_30 = param_2;\n    local_28 = param_1;\n    FUN_00154b45(&local_38,param_3,param_4);\n    *(undefined1 *)(param_2 + (ulong)local_20) = 0;\n  }\n  if (local_10 == *(long *)(in_FS_OFFSET + 0x28)) {\n    return param_2;\n  }\n                    /* WARNING: Subroutine does not return */\n  __stack_chk_fail();\n}\n\n" (function_definition "long FUN_00156538(int param_1,long param_2,undefined8 param_3,undefined8 param_4)\n\n{\n  long in_FS_OFFSET;\n  undefined8 local_38;\n  long local_30;\n  int local_28;\n  undefined4 local_24;\n  uint local_20;\n  undefined1 local_1c;\n  undefined1 local_1b;\n  long local_10;\n  \n  local_10 = *(long *)(in_FS_OFFSET + 0x28);\n  if (0 < param_1) {\n    local_38 = 0;\n    local_24 = 0;\n    local_20 = 0;\n    local_1c = 0;\n    local_1b = 0;\n    local_30 = param_2;\n    local_28 = param_1;\n    FUN_00154b45(&local_38,param_3,param_4);\n    *(undefined1 *)(param_2 + (ulong)local_20) = 0;\n  }\n  if (local_10 == *(long *)(in_FS_OFFSET + 0x28)) {\n    return param_2;\n  }\n                    /* WARNING: Subroutine does not return */\n  __stack_chk_fail();\n}" (sized_type_specifier "long" long) (function_declarator "FUN_00156538(int param_1,long param_2,undefined8 param_3,undefined8 param_4)" identifier (parameter_list "(int param_1,long param_2,undefined8 param_3,undefined8 param_4)" ( (parameter_declaration "int param_1" primitive_type identifier) , (parameter_declaration "long param_2" (sized_type_specifier "long" long) identifier) , (parameter_declaration "undefined8 param_3" type_identifier identifier) , (parameter_declaration "undefined8 param_4" type_identifier identifier) ))) (compound_statement "{\n  long in_FS_OFFSET;\n  undefined8 local_38;\n  long local_30;\n  int local_28;\n  undefined4 local_24;\n  uint local_20;\n  undefined1 local_1c;\n  undefined1 local_1b;\n  long local_10;\n  \n  local_10 = *(long *)(in_FS_OFFSET + 0x28);\n  if (0 < param_1) {\n    local_38 = 0;\n    local_24 = 0;\n    local_20 = 0;\n    local_1c = 0;\n    local_1b = 0;\n    local_30 = param_2;\n    local_28 = param_1;\n    FUN_00154b45(&local_38,param_3,param_4);\n    *(undefined1 *)(param_2 + (ulong)local_20) = 0;\n  }\n  if (local_10 == *(long *)(in_FS_OFFSET + 0x28)) {\n    return param_2;\n  }\n                    /* WARNING: Subroutine does not return */\n  __stack_chk_fail();\n}" { (declaration "long in_FS_OFFSET;" (sized_type_specifier "long" long) identifier ;) (declaration "undefined8 local_38;" type_identifier identifier ;) (declaration "long local_30;" (sized_type_specifier "long" long) identifier ;) (declaration "int local_28;" primitive_type identifier ;) (declaration "undefined4 local_24;" type_identifier identifier ;) (declaration "uint local_20;" type_identifier identifier ;) (declaration "undefined1 local_1c;" type_identifier identifier ;) (declaration "undefined1 local_1b;" type_identifier identifier ;) (declaration "long local_10;" (sized_type_specifier "long" long) identifier ;) (expression_statement "local_10 = *(long *)(in_FS_OFFSET + 0x28);" (assignment_expression "local_10 = *(long *)(in_FS_OFFSET + 0x28)" identifier = (pointer_expression "*(long *)(in_FS_OFFSET + 0x28)" * (cast_expression "(long *)(in_FS_OFFSET + 0x28)" ( (type_descriptor "long *" (sized_type_specifier "long" long) (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_FS_OFFSET + 0x28)" ( (binary_expression "in_FS_OFFSET + 0x28" identifier + number_literal) ))))) ;) (if_statement "if (0 < param_1) {\n    local_38 = 0;\n    local_24 = 0;\n    local_20 = 0;\n    local_1c = 0;\n    local_1b = 0;\n    local_30 = param_2;\n    local_28 = param_1;\n    FUN_00154b45(&local_38,param_3,param_4);\n    *(undefined1 *)(param_2 + (ulong)local_20) = 0;\n  }" if (parenthesized_expression "(0 < param_1)" ( (binary_expression "0 < param_1" number_literal < identifier) )) (compound_statement "{\n    local_38 = 0;\n    local_24 = 0;\n    local_20 = 0;\n    local_1c = 0;\n    local_1b = 0;\n    local_30 = param_2;\n    local_28 = param_1;\n    FUN_00154b45(&local_38,param_3,param_4);\n    *(undefined1 *)(param_2 + (ulong)local_20) = 0;\n  }" { (expression_statement "local_38 = 0;" (assignment_expression "local_38 = 0" identifier = number_literal) ;) (expression_statement "local_24 = 0;" (assignment_expression "local_24 = 0" identifier = number_literal) ;) (expression_statement "local_20 = 0;" (assignment_expression "local_20 = 0" identifier = number_literal) ;) (expression_statement "local_1c = 0;" (assignment_expression "local_1c = 0" identifier = number_literal) ;) (expression_statement "local_1b = 0;" (assignment_expression "local_1b = 0" identifier = number_literal) ;) (expression_statement "local_30 = param_2;" (assignment_expression "local_30 = param_2" identifier = identifier) ;) (expression_statement "local_28 = param_1;" (assignment_expression "local_28 = param_1" identifier = identifier) ;) (expression_statement "FUN_00154b45(&local_38,param_3,param_4);" (call_expression "FUN_00154b45(&local_38,param_3,param_4)" identifier (argument_list "(&local_38,param_3,param_4)" ( (pointer_expression "&local_38" & identifier) , identifier , identifier ))) ;) (expression_statement "*(undefined1 *)(param_2 + (ulong)local_20) = 0;" (assignment_expression "*(undefined1 *)(param_2 + (ulong)local_20) = 0" (pointer_expression "*(undefined1 *)(param_2 + (ulong)local_20)" * (cast_expression "(undefined1 *)(param_2 + (ulong)local_20)" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_2 + (ulong)local_20)" ( (binary_expression "param_2 + (ulong)local_20" identifier + (cast_expression "(ulong)local_20" ( (type_descriptor "ulong" type_identifier) ) identifier)) )))) = number_literal) ;) })) (if_statement "if (local_10 == *(long *)(in_FS_OFFSET + 0x28)) {\n    return param_2;\n  }" if (parenthesized_expression "(local_10 == *(long *)(in_FS_OFFSET + 0x28))" ( (binary_expression "local_10 == *(long *)(in_FS_OFFSET + 0x28)" identifier == (pointer_expression "*(long *)(in_FS_OFFSET + 0x28)" * (cast_expression "(long *)(in_FS_OFFSET + 0x28)" ( (type_descriptor "long *" (sized_type_specifier "long" long) (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_FS_OFFSET + 0x28)" ( (binary_expression "in_FS_OFFSET + 0x28" identifier + number_literal) ))))) )) (compound_statement "{\n    return param_2;\n  }" { (return_statement "return param_2;" return identifier ;) })) comment (expression_statement "__stack_chk_fail();" (call_expression "__stack_chk_fail()" identifier (argument_list "()" ( ))) ;) })))
(translation_unit "char * sqlite3_vsnprintf(int n,char *zBuf,char *zFormat,__va_list_tag *ap)\n\n{\n  long lVar1;\n  long in_FS_OFFSET;\n  StrAccum acc;\n  \n  lVar1 = *(long *)(in_FS_OFFSET + 0x28);\n  if (0 < n) {\n    acc.db = (sqlite3 *)0x0;\n    acc.mxAlloc = 0;\n    acc.nChar = 0;\n    acc.accError = '\0';\n    acc.printfFlags = '\0';\n    acc.zText = zBuf;\n    acc.nAlloc = n;\n    sqlite3_str_vappendf(&acc,zFormat,ap);\n    zBuf[acc.nChar] = '\0';\n  }\n  if (lVar1 == *(long *)(in_FS_OFFSET + 0x28)) {\n    return zBuf;\n  }\n                    /* WARNING: Subroutine does not return */\n  __stack_chk_fail();\n}\n\n" (function_definition "char * sqlite3_vsnprintf(int n,char *zBuf,char *zFormat,__va_list_tag *ap)\n\n{\n  long lVar1;\n  long in_FS_OFFSET;\n  StrAccum acc;\n  \n  lVar1 = *(long *)(in_FS_OFFSET + 0x28);\n  if (0 < n) {\n    acc.db = (sqlite3 *)0x0;\n    acc.mxAlloc = 0;\n    acc.nChar = 0;\n    acc.accError = '\0';\n    acc.printfFlags = '\0';\n    acc.zText = zBuf;\n    acc.nAlloc = n;\n    sqlite3_str_vappendf(&acc,zFormat,ap);\n    zBuf[acc.nChar] = '\0';\n  }\n  if (lVar1 == *(long *)(in_FS_OFFSET + 0x28)) {\n    return zBuf;\n  }\n                    /* WARNING: Subroutine does not return */\n  __stack_chk_fail();\n}" primitive_type (pointer_declarator "* sqlite3_vsnprintf(int n,char *zBuf,char *zFormat,__va_list_tag *ap)" * (function_declarator "sqlite3_vsnprintf(int n,char *zBuf,char *zFormat,__va_list_tag *ap)" identifier (parameter_list "(int n,char *zBuf,char *zFormat,__va_list_tag *ap)" ( (parameter_declaration "int n" primitive_type identifier) , (parameter_declaration "char *zBuf" primitive_type (pointer_declarator "*zBuf" * identifier)) , (parameter_declaration "char *zFormat" primitive_type (pointer_declarator "*zFormat" * identifier)) , (parameter_declaration "__va_list_tag *ap" type_identifier (pointer_declarator "*ap" * identifier)) )))) (compound_statement "{\n  long lVar1;\n  long in_FS_OFFSET;\n  StrAccum acc;\n  \n  lVar1 = *(long *)(in_FS_OFFSET + 0x28);\n  if (0 < n) {\n    acc.db = (sqlite3 *)0x0;\n    acc.mxAlloc = 0;\n    acc.nChar = 0;\n    acc.accError = '\0';\n    acc.printfFlags = '\0';\n    acc.zText = zBuf;\n    acc.nAlloc = n;\n    sqlite3_str_vappendf(&acc,zFormat,ap);\n    zBuf[acc.nChar] = '\0';\n  }\n  if (lVar1 == *(long *)(in_FS_OFFSET + 0x28)) {\n    return zBuf;\n  }\n                    /* WARNING: Subroutine does not return */\n  __stack_chk_fail();\n}" { (declaration "long lVar1;" (sized_type_specifier "long" long) identifier ;) (declaration "long in_FS_OFFSET;" (sized_type_specifier "long" long) identifier ;) (declaration "StrAccum acc;" type_identifier identifier ;) (expression_statement "lVar1 = *(long *)(in_FS_OFFSET + 0x28);" (assignment_expression "lVar1 = *(long *)(in_FS_OFFSET + 0x28)" identifier = (pointer_expression "*(long *)(in_FS_OFFSET + 0x28)" * (cast_expression "(long *)(in_FS_OFFSET + 0x28)" ( (type_descriptor "long *" (sized_type_specifier "long" long) (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_FS_OFFSET + 0x28)" ( (binary_expression "in_FS_OFFSET + 0x28" identifier + number_literal) ))))) ;) (if_statement "if (0 < n) {\n    acc.db = (sqlite3 *)0x0;\n    acc.mxAlloc = 0;\n    acc.nChar = 0;\n    acc.accError = '\0';\n    acc.printfFlags = '\0';\n    acc.zText = zBuf;\n    acc.nAlloc = n;\n    sqlite3_str_vappendf(&acc,zFormat,ap);\n    zBuf[acc.nChar] = '\0';\n  }" if (parenthesized_expression "(0 < n)" ( (binary_expression "0 < n" number_literal < identifier) )) (compound_statement "{\n    acc.db = (sqlite3 *)0x0;\n    acc.mxAlloc = 0;\n    acc.nChar = 0;\n    acc.accError = '\0';\n    acc.printfFlags = '\0';\n    acc.zText = zBuf;\n    acc.nAlloc = n;\n    sqlite3_str_vappendf(&acc,zFormat,ap);\n    zBuf[acc.nChar] = '\0';\n  }" { (expression_statement "acc.db = (sqlite3 *)0x0;" (assignment_expression "acc.db = (sqlite3 *)0x0" (field_expression "acc.db" identifier . field_identifier) = (cast_expression "(sqlite3 *)0x0" ( (type_descriptor "sqlite3 *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) ;) (expression_statement "acc.mxAlloc = 0;" (assignment_expression "acc.mxAlloc = 0" (field_expression "acc.mxAlloc" identifier . field_identifier) = number_literal) ;) (expression_statement "acc.nChar = 0;" (assignment_expression "acc.nChar = 0" (field_expression "acc.nChar" identifier . field_identifier) = number_literal) ;) (expression_statement "acc.accError = '\0';" (assignment_expression "acc.accError = '\0'" (field_expression "acc.accError" identifier . field_identifier) = (char_literal "'\0'" ' escape_sequence ')) ;) (expression_statement "acc.printfFlags = '\0';" (assignment_expression "acc.printfFlags = '\0'" (field_expression "acc.printfFlags" identifier . field_identifier) = (char_literal "'\0'" ' escape_sequence ')) ;) (expression_statement "acc.zText = zBuf;" (assignment_expression "acc.zText = zBuf" (field_expression "acc.zText" identifier . field_identifier) = identifier) ;) (expression_statement "acc.nAlloc = n;" (assignment_expression "acc.nAlloc = n" (field_expression "acc.nAlloc" identifier . field_identifier) = identifier) ;) (expression_statement "sqlite3_str_vappendf(&acc,zFormat,ap);" (call_expression "sqlite3_str_vappendf(&acc,zFormat,ap)" identifier (argument_list "(&acc,zFormat,ap)" ( (pointer_expression "&acc" & identifier) , identifier , identifier ))) ;) (expression_statement "zBuf[acc.nChar] = '\0';" (assignment_expression "zBuf[acc.nChar] = '\0'" (subscript_expression "zBuf[acc.nChar]" identifier [ (field_expression "acc.nChar" identifier . field_identifier) ]) = (char_literal "'\0'" ' escape_sequence ')) ;) })) (if_statement "if (lVar1 == *(long *)(in_FS_OFFSET + 0x28)) {\n    return zBuf;\n  }" if (parenthesized_expression "(lVar1 == *(long *)(in_FS_OFFSET + 0x28))" ( (binary_expression "lVar1 == *(long *)(in_FS_OFFSET + 0x28)" identifier == (pointer_expression "*(long *)(in_FS_OFFSET + 0x28)" * (cast_expression "(long *)(in_FS_OFFSET + 0x28)" ( (type_descriptor "long *" (sized_type_specifier "long" long) (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_FS_OFFSET + 0x28)" ( (binary_expression "in_FS_OFFSET + 0x28" identifier + number_literal) ))))) )) (compound_statement "{\n    return zBuf;\n  }" { (return_statement "return zBuf;" return identifier ;) })) comment (expression_statement "__stack_chk_fail();" (call_expression "__stack_chk_fail()" identifier (argument_list "()" ( ))) ;) })))
(translation_unit "long FUN_00156538(int param_1,long param_2,undefined8 param_3,undefined8 param_4)\n\n{\n  long in_FS_OFFSET;\n  undefined8 local_38;\n  long local_30;\n  int local_28;\n  undefined4 local_24;\n  uint local_20;\n  undefined1 local_1c;\n  undefined1 local_1b;\n  long local_10;\n  \n  local_10 = *(long *)(in_FS_OFFSET + 0x28);\n  if (0 < param_1) {\n    local_38 = 0;\n    local_24 = 0;\n    local_20 = 0;\n    local_1c = 0;\n    local_1b = 0;\n    local_30 = param_2;\n    local_28 = param_1;\n    FUN_00154b45(&local_38,param_3,param_4);\n    *(undefined1 *)(param_2 + (ulong)local_20) = 0;\n  }\n  if (local_10 == *(long *)(in_FS_OFFSET + 0x28)) {\n    return param_2;\n  }\n                    \n  __stack_chk_fail();\n}\n\n" (function_definition "long FUN_00156538(int param_1,long param_2,undefined8 param_3,undefined8 param_4)\n\n{\n  long in_FS_OFFSET;\n  undefined8 local_38;\n  long local_30;\n  int local_28;\n  undefined4 local_24;\n  uint local_20;\n  undefined1 local_1c;\n  undefined1 local_1b;\n  long local_10;\n  \n  local_10 = *(long *)(in_FS_OFFSET + 0x28);\n  if (0 < param_1) {\n    local_38 = 0;\n    local_24 = 0;\n    local_20 = 0;\n    local_1c = 0;\n    local_1b = 0;\n    local_30 = param_2;\n    local_28 = param_1;\n    FUN_00154b45(&local_38,param_3,param_4);\n    *(undefined1 *)(param_2 + (ulong)local_20) = 0;\n  }\n  if (local_10 == *(long *)(in_FS_OFFSET + 0x28)) {\n    return param_2;\n  }\n                    \n  __stack_chk_fail();\n}" (sized_type_specifier "long" long) (function_declarator "FUN_00156538(int param_1,long param_2,undefined8 param_3,undefined8 param_4)" identifier (parameter_list "(int param_1,long param_2,undefined8 param_3,undefined8 param_4)" ( (parameter_declaration "int param_1" primitive_type identifier) , (parameter_declaration "long param_2" (sized_type_specifier "long" long) identifier) , (parameter_declaration "undefined8 param_3" type_identifier identifier) , (parameter_declaration "undefined8 param_4" type_identifier identifier) ))) (compound_statement "{\n  long in_FS_OFFSET;\n  undefined8 local_38;\n  long local_30;\n  int local_28;\n  undefined4 local_24;\n  uint local_20;\n  undefined1 local_1c;\n  undefined1 local_1b;\n  long local_10;\n  \n  local_10 = *(long *)(in_FS_OFFSET + 0x28);\n  if (0 < param_1) {\n    local_38 = 0;\n    local_24 = 0;\n    local_20 = 0;\n    local_1c = 0;\n    local_1b = 0;\n    local_30 = param_2;\n    local_28 = param_1;\n    FUN_00154b45(&local_38,param_3,param_4);\n    *(undefined1 *)(param_2 + (ulong)local_20) = 0;\n  }\n  if (local_10 == *(long *)(in_FS_OFFSET + 0x28)) {\n    return param_2;\n  }\n                    \n  __stack_chk_fail();\n}" { (declaration "long in_FS_OFFSET;" (sized_type_specifier "long" long) identifier ;) (declaration "undefined8 local_38;" type_identifier identifier ;) (declaration "long local_30;" (sized_type_specifier "long" long) identifier ;) (declaration "int local_28;" primitive_type identifier ;) (declaration "undefined4 local_24;" type_identifier identifier ;) (declaration "uint local_20;" type_identifier identifier ;) (declaration "undefined1 local_1c;" type_identifier identifier ;) (declaration "undefined1 local_1b;" type_identifier identifier ;) (declaration "long local_10;" (sized_type_specifier "long" long) identifier ;) (expression_statement "local_10 = *(long *)(in_FS_OFFSET + 0x28);" (assignment_expression "local_10 = *(long *)(in_FS_OFFSET + 0x28)" identifier = (pointer_expression "*(long *)(in_FS_OFFSET + 0x28)" * (cast_expression "(long *)(in_FS_OFFSET + 0x28)" ( (type_descriptor "long *" (sized_type_specifier "long" long) (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_FS_OFFSET + 0x28)" ( (binary_expression "in_FS_OFFSET + 0x28" identifier + number_literal) ))))) ;) (if_statement "if (0 < param_1) {\n    local_38 = 0;\n    local_24 = 0;\n    local_20 = 0;\n    local_1c = 0;\n    local_1b = 0;\n    local_30 = param_2;\n    local_28 = param_1;\n    FUN_00154b45(&local_38,param_3,param_4);\n    *(undefined1 *)(param_2 + (ulong)local_20) = 0;\n  }" if (parenthesized_expression "(0 < param_1)" ( (binary_expression "0 < param_1" number_literal < identifier) )) (compound_statement "{\n    local_38 = 0;\n    local_24 = 0;\n    local_20 = 0;\n    local_1c = 0;\n    local_1b = 0;\n    local_30 = param_2;\n    local_28 = param_1;\n    FUN_00154b45(&local_38,param_3,param_4);\n    *(undefined1 *)(param_2 + (ulong)local_20) = 0;\n  }" { (expression_statement "local_38 = 0;" (assignment_expression "local_38 = 0" identifier = number_literal) ;) (expression_statement "local_24 = 0;" (assignment_expression "local_24 = 0" identifier = number_literal) ;) (expression_statement "local_20 = 0;" (assignment_expression "local_20 = 0" identifier = number_literal) ;) (expression_statement "local_1c = 0;" (assignment_expression "local_1c = 0" identifier = number_literal) ;) (expression_statement "local_1b = 0;" (assignment_expression "local_1b = 0" identifier = number_literal) ;) (expression_statement "local_30 = param_2;" (assignment_expression "local_30 = param_2" identifier = identifier) ;) (expression_statement "local_28 = param_1;" (assignment_expression "local_28 = param_1" identifier = identifier) ;) (expression_statement "FUN_00154b45(&local_38,param_3,param_4);" (call_expression "FUN_00154b45(&local_38,param_3,param_4)" identifier (argument_list "(&local_38,param_3,param_4)" ( (pointer_expression "&local_38" & identifier) , identifier , identifier ))) ;) (expression_statement "*(undefined1 *)(param_2 + (ulong)local_20) = 0;" (assignment_expression "*(undefined1 *)(param_2 + (ulong)local_20) = 0" (pointer_expression "*(undefined1 *)(param_2 + (ulong)local_20)" * (cast_expression "(undefined1 *)(param_2 + (ulong)local_20)" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_2 + (ulong)local_20)" ( (binary_expression "param_2 + (ulong)local_20" identifier + (cast_expression "(ulong)local_20" ( (type_descriptor "ulong" type_identifier) ) identifier)) )))) = number_literal) ;) })) (if_statement "if (local_10 == *(long *)(in_FS_OFFSET + 0x28)) {\n    return param_2;\n  }" if (parenthesized_expression "(local_10 == *(long *)(in_FS_OFFSET + 0x28))" ( (binary_expression "local_10 == *(long *)(in_FS_OFFSET + 0x28)" identifier == (pointer_expression "*(long *)(in_FS_OFFSET + 0x28)" * (cast_expression "(long *)(in_FS_OFFSET + 0x28)" ( (type_descriptor "long *" (sized_type_specifier "long" long) (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_FS_OFFSET + 0x28)" ( (binary_expression "in_FS_OFFSET + 0x28" identifier + number_literal) ))))) )) (compound_statement "{\n    return param_2;\n  }" { (return_statement "return param_2;" return identifier ;) })) (expression_statement "__stack_chk_fail();" (call_expression "__stack_chk_fail()" identifier (argument_list "()" ( ))) ;) })))
(translation_unit (function_definition (sized_type_specifier long) (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE IDENT) , (parameter_declaration (sized_type_specifier long) IDENT) , (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE IDENT) ))) (compound_statement { (declaration (sized_type_specifier long) IDENT ;) (declaration TYPE IDENT ;) (declaration (sized_type_specifier long) IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration (sized_type_specifier long) IDENT ;) (expression_statement (assignment_expression IDENT = (pointer_expression * (cast_expression ( (type_descriptor (sized_type_specifier long) (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))))) ;) (if_statement if (parenthesized_expression ( (binary_expression LIT < IDENT) )) (compound_statement { (expression_statement (assignment_expression IDENT = LIT) ;) (expression_statement (assignment_expression IDENT = LIT) ;) (expression_statement (assignment_expression IDENT = LIT) ;) (expression_statement (assignment_expression IDENT = LIT) ;) (expression_statement (assignment_expression IDENT = LIT) ;) (expression_statement (assignment_expression IDENT = IDENT) ;) (expression_statement (assignment_expression IDENT = IDENT) ;) (expression_statement (call_expression IDENT (argument_list ( (pointer_expression & IDENT) , IDENT , IDENT ))) ;) (expression_statement (assignment_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + (cast_expression ( (type_descriptor TYPE) ) IDENT)) )))) = LIT) ;) })) (if_statement if (parenthesized_expression ( (binary_expression IDENT == (pointer_expression * (cast_expression ( (type_descriptor (sized_type_specifier long) (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))))) )) (compound_statement { (return_statement return IDENT ;) })) (expression_statement (call_expression IDENT (argument_list ( ))) ;) })))
(function_definition "long FUN_00156538(int param_1,long param_2,undefined8 param_3,undefined8 param_4)\n\n{\n  long in_FS_OFFSET;\n  undefined8 local_38;\n  long local_30;\n  int local_28;\n  undefined4 local_24;\n  uint local_20;\n  undefined1 local_1c;\n  undefined1 local_1b;\n  long local_10;\n  \n  local_10 = *(long *)(in_FS_OFFSET + 0x28);\n  if (0 < param_1) {\n    local_38 = 0;\n    local_24 = 0;\n    local_20 = 0;\n    local_1c = 0;\n    local_1b = 0;\n    local_30 = param_2;\n    local_28 = param_1;\n    FUN_00154b45(&local_38,param_3,param_4);\n    *(undefined1 *)(param_2 + (ulong)local_20) = 0;\n  }\n  if (local_10 == *(long *)(in_FS_OFFSET + 0x28)) {\n    return param_2;\n  }\n                    \n  __stack_chk_fail();\n}" (sized_type_specifier "long" (long "long")) (function_declarator "FUN_00156538(int param_1,long param_2,undefined8 param_3,undefined8 param_4)" (identifier "FUN_00156538") (parameter_list "(int param_1,long param_2,undefined8 param_3,undefined8 param_4)" (( "(") (parameter_declaration "int param_1" (primitive_type "int") (identifier "param_1")) (, ",") (parameter_declaration "long param_2" (sized_type_specifier "long" (long "long")) (identifier "param_2")) (, ",") (parameter_declaration "undefined8 param_3" (type_identifier "undefined8") (identifier "param_3")) (, ",") (parameter_declaration "undefined8 param_4" (type_identifier "undefined8") (identifier "param_4")) () ")"))) (compound_statement "{\n  long in_FS_OFFSET;\n  undefined8 local_38;\n  long local_30;\n  int local_28;\n  undefined4 local_24;\n  uint local_20;\n  undefined1 local_1c;\n  undefined1 local_1b;\n  long local_10;\n  \n  local_10 = *(long *)(in_FS_OFFSET + 0x28);\n  if (0 < param_1) {\n    local_38 = 0;\n    local_24 = 0;\n    local_20 = 0;\n    local_1c = 0;\n    local_1b = 0;\n    local_30 = param_2;\n    local_28 = param_1;\n    FUN_00154b45(&local_38,param_3,param_4);\n    *(undefined1 *)(param_2 + (ulong)local_20) = 0;\n  }\n  if (local_10 == *(long *)(in_FS_OFFSET + 0x28)) {\n    return param_2;\n  }\n                    \n  __stack_chk_fail();\n}" ({ "{") (declaration "long in_FS_OFFSET;" (sized_type_specifier "long" (long "long")) (identifier "in_FS_OFFSET") (; ";")) (declaration "undefined8 local_38;" (type_identifier "undefined8") (identifier "local_38") (; ";")) (declaration "long local_30;" (sized_type_specifier "long" (long "long")) (identifier "local_30") (; ";")) (declaration "int local_28;" (primitive_type "int") (identifier "local_28") (; ";")) (declaration "undefined4 local_24;" (type_identifier "undefined4") (identifier "local_24") (; ";")) (declaration "uint local_20;" (type_identifier "uint") (identifier "local_20") (; ";")) (declaration "undefined1 local_1c;" (type_identifier "undefined1") (identifier "local_1c") (; ";")) (declaration "undefined1 local_1b;" (type_identifier "undefined1") (identifier "local_1b") (; ";")) (declaration "long local_10;" (sized_type_specifier "long" (long "long")) (identifier "local_10") (; ";")) (expression_statement "local_10 = *(long *)(in_FS_OFFSET + 0x28);" (assignment_expression "local_10 = *(long *)(in_FS_OFFSET + 0x28)" (identifier "local_10") (= "=") (pointer_expression "*(long *)(in_FS_OFFSET + 0x28)" (* "*") (cast_expression "(long *)(in_FS_OFFSET + 0x28)" (( "(") (type_descriptor "long *" (sized_type_specifier "long" (long "long")) (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(in_FS_OFFSET + 0x28)" (( "(") (binary_expression "in_FS_OFFSET + 0x28" (identifier "in_FS_OFFSET") (+ "+") (number_literal "0x28")) () ")"))))) (; ";")) (if_statement "if (0 < param_1) {\n    local_38 = 0;\n    local_24 = 0;\n    local_20 = 0;\n    local_1c = 0;\n    local_1b = 0;\n    local_30 = param_2;\n    local_28 = param_1;\n    FUN_00154b45(&local_38,param_3,param_4);\n    *(undefined1 *)(param_2 + (ulong)local_20) = 0;\n  }" (if "if") (parenthesized_expression "(0 < param_1)" (( "(") (binary_expression "0 < param_1" (number_literal "0") (< "<") (identifier "param_1")) () ")")) (compound_statement "{\n    local_38 = 0;\n    local_24 = 0;\n    local_20 = 0;\n    local_1c = 0;\n    local_1b = 0;\n    local_30 = param_2;\n    local_28 = param_1;\n    FUN_00154b45(&local_38,param_3,param_4);\n    *(undefined1 *)(param_2 + (ulong)local_20) = 0;\n  }" ({ "{") (expression_statement "local_38 = 0;" (assignment_expression "local_38 = 0" (identifier "local_38") (= "=") (number_literal "0")) (; ";")) (expression_statement "local_24 = 0;" (assignment_expression "local_24 = 0" (identifier "local_24") (= "=") (number_literal "0")) (; ";")) (expression_statement "local_20 = 0;" (assignment_expression "local_20 = 0" (identifier "local_20") (= "=") (number_literal "0")) (; ";")) (expression_statement "local_1c = 0;" (assignment_expression "local_1c = 0" (identifier "local_1c") (= "=") (number_literal "0")) (; ";")) (expression_statement "local_1b = 0;" (assignment_expression "local_1b = 0" (identifier "local_1b") (= "=") (number_literal "0")) (; ";")) (expression_statement "local_30 = param_2;" (assignment_expression "local_30 = param_2" (identifier "local_30") (= "=") (identifier "param_2")) (; ";")) (expression_statement "local_28 = param_1;" (assignment_expression "local_28 = param_1" (identifier "local_28") (= "=") (identifier "param_1")) (; ";")) (expression_statement "FUN_00154b45(&local_38,param_3,param_4);" (call_expression "FUN_00154b45(&local_38,param_3,param_4)" (identifier "FUN_00154b45") (argument_list "(&local_38,param_3,param_4)" (( "(") (pointer_expression "&local_38" (& "&") (identifier "local_38")) (, ",") (identifier "param_3") (, ",") (identifier "param_4") () ")"))) (; ";")) (expression_statement "*(undefined1 *)(param_2 + (ulong)local_20) = 0;" (assignment_expression "*(undefined1 *)(param_2 + (ulong)local_20) = 0" (pointer_expression "*(undefined1 *)(param_2 + (ulong)local_20)" (* "*") (cast_expression "(undefined1 *)(param_2 + (ulong)local_20)" (( "(") (type_descriptor "undefined1 *" (type_identifier "undefined1") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_2 + (ulong)local_20)" (( "(") (binary_expression "param_2 + (ulong)local_20" (identifier "param_2") (+ "+") (cast_expression "(ulong)local_20" (( "(") (type_descriptor "ulong" (type_identifier "ulong")) () ")") (identifier "local_20"))) () ")")))) (= "=") (number_literal "0")) (; ";")) (} "}"))) (if_statement "if (local_10 == *(long *)(in_FS_OFFSET + 0x28)) {\n    return param_2;\n  }" (if "if") (parenthesized_expression "(local_10 == *(long *)(in_FS_OFFSET + 0x28))" (( "(") (binary_expression "local_10 == *(long *)(in_FS_OFFSET + 0x28)" (identifier "local_10") (== "==") (pointer_expression "*(long *)(in_FS_OFFSET + 0x28)" (* "*") (cast_expression "(long *)(in_FS_OFFSET + 0x28)" (( "(") (type_descriptor "long *" (sized_type_specifier "long" (long "long")) (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(in_FS_OFFSET + 0x28)" (( "(") (binary_expression "in_FS_OFFSET + 0x28" (identifier "in_FS_OFFSET") (+ "+") (number_literal "0x28")) () ")"))))) () ")")) (compound_statement "{\n    return param_2;\n  }" ({ "{") (return_statement "return param_2;" (return "return") (identifier "param_2") (; ";")) (} "}"))) (expression_statement "__stack_chk_fail();" (call_expression "__stack_chk_fail()" (identifier "__stack_chk_fail") (argument_list "()" (( "(") () ")"))) (; ";")) (} "}")))

char * function_1(int var_2,char *zBuf,char *zFormat,type_1 *ap)

{
  long var_4;
  long var_1;
  type_2 acc;
  
  var_4 = *(long *)(var_1 + 0x28);
  if (0 < var_2) {
    acc.db = (type_3 *)0x0;
    acc.mxAlloc = 0;
    acc.nChar = 0;
    acc.accError = '\0';
    acc.printfFlags = '\0';
    acc.zText = zBuf;
    acc.nAlloc = var_2;
    var_3(&acc,zFormat,ap);
    zBuf[acc.nChar] = '\0';
  }
  if (var_4 == *(long *)(var_1 + 0x28)) {
    return zBuf;
  }
                    /* WARNING: Subroutine does not return */
  var_5();
}


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

long MASKED(int param_1,long param_2,undefined8 param_3,undefined8 param_4)

{
  long in_FS_OFFSET;
  undefined8 local_38;
  long local_30;
  int local_28;
  undefined4 local_24;
  uint local_20;
  undefined1 local_1c;
  undefined1 local_1b;
  long local_10;
  
  local_10 = *(long *)(in_FS_OFFSET + 0x28);
  if (0 < param_1) {
    local_38 = 0;
    local_24 = 0;
    local_20 = 0;
    local_1c = 0;
    local_1b = 0;
    local_30 = param_2;
    local_28 = param_1;
    FUN_00154b45(&local_38,param_3,param_4);
    *(undefined1 *)(param_2 + (ulong)local_20) = 0;
  }
  if (local_10 == *(long *)(in_FS_OFFSET + 0x28)) {
    return param_2;
  }
                    /* WARNING: Subroutine does not return */
  __stack_chk_fail();
}

