
/* WARNING: Enum "anon_enum_32": Some values do not have unique names */

void logwrite(LogContext *ctx,void *data,int len)

{
  size_t sVar1;
  
  if (ctx->state == ADDRTYPE_UNSPEC) {
    logfopen(ctx);
  }
  if (ctx->state == ABOUT_TO) {
    bufchain_add(&ctx->queue,data,len);
  }
  else if (ctx->state == ADDRTYPE_IPV6) {
    if ((FILE *)ctx->lgfp == (FILE *)0x0) {
                    /* WARNING: Subroutine does not return */
      __assert_fail("ctx->lgfp","logging.c",0x2f,"logwrite");
    }
    sVar1 = fwrite(data,1,(long)len,(FILE *)ctx->lgfp);
    if (sVar1 < (ulong)(long)len) {
      logfclose(ctx);
      ctx->state = ADDRTYPE_NAME;
      logevent(ctx->frontend,"Disabled writing session log due to error while writing");
    }
  }
  return;
}



void FUN_0011e17e(undefined8 *param_1,void *param_2,int param_3)

{
  size_t sVar1;
  
  if (*(int *)(param_1 + 1) == 0) {
    FUN_0011e58d();
  }
  if (*(int *)(param_1 + 1) == 1) {
    FUN_00121236(param_1 + 2,param_2,param_3);
  }
  else if (*(int *)(param_1 + 1) == 2) {
    if ((FILE *)*param_1 == (FILE *)0x0) {
                    /* WARNING: Subroutine does not return */
      __assert_fail("ctx->lgfp","logging.c",0x2f,"logwrite");
    }
    sVar1 = fwrite(param_2,1,(long)param_3,(FILE *)*param_1);
    if (sVar1 < (ulong)(long)param_3) {
      FUN_0011e15d(param_1);
      *(undefined4 *)(param_1 + 1) = 3;
      FUN_0014413d(param_1[6],"Disabled writing session log due to error while writing");
    }
  }
  return;
}


PUSH R12
PUSH RBP
PUSH RBX
MOV RBX,RDI
MOV R12,RSI
MOV EBP,EDX
CMP dword ptr [RDI + 0x8],0x0
JZ 0x0011e1a2
MOV EAX,dword ptr [RBX + 0x8]
CMP EAX,0x1
JZ 0x0011e1a9
CMP EAX,0x2
JZ 0x0011e1b9
POP RBX
POP RBP
POP R12
RET
CALL 0x0011e58d
JMP 0x0011e190
LEA RDI,[RBX + 0x10]
MOV EDX,EBP
MOV RSI,R12
CALL 0x00121236
JMP 0x0011e19d
MOV RCX,qword ptr [RBX]
TEST RCX,RCX
JZ 0x0011e1fa
MOVSXD RBP,EBP
MOV RDX,RBP
MOV ESI,0x1
MOV RDI,R12
CALL 0x00110e90
CMP RBP,RAX
JBE 0x0011e19d
MOV RDI,RBX
CALL 0x0011e15d
MOV dword ptr [RBX + 0x8],0x3
MOV RDI,qword ptr [RBX + 0x30]
LEA RSI,[0x170ce0]
CALL 0x0014413d
JMP 0x0011e19d
LEA RCX,[0x170dd8]
MOV EDX,0x2f
LEA RSI,[0x170b83]
LEA RDI,[0x170b8d]
CALL 0x0010f990
(translation_unit "void FUN_0011e17e(undefined8 *param_1,void *param_2,int param_3)\n\n{\n  size_t sVar1;\n  \n  if (*(int *)(param_1 + 1) == 0) {\n    FUN_0011e58d();\n  }\n  if (*(int *)(param_1 + 1) == 1) {\n    FUN_00121236(param_1 + 2,param_2,param_3);\n  }\n  else if (*(int *)(param_1 + 1) == 2) {\n    if ((FILE *)*param_1 == (FILE *)0x0) {\n                    /* WARNING: Subroutine does not return */\n      __assert_fail("ctx->lgfp","logging.c",0x2f,"logwrite");\n    }\n    sVar1 = fwrite(param_2,1,(long)param_3,(FILE *)*param_1);\n    if (sVar1 < (ulong)(long)param_3) {\n      FUN_0011e15d(param_1);\n      *(undefined4 *)(param_1 + 1) = 3;\n      FUN_0014413d(param_1[6],"Disabled writing session log due to error while writing");\n    }\n  }\n  return;\n}\n\n" (function_definition "void FUN_0011e17e(undefined8 *param_1,void *param_2,int param_3)\n\n{\n  size_t sVar1;\n  \n  if (*(int *)(param_1 + 1) == 0) {\n    FUN_0011e58d();\n  }\n  if (*(int *)(param_1 + 1) == 1) {\n    FUN_00121236(param_1 + 2,param_2,param_3);\n  }\n  else if (*(int *)(param_1 + 1) == 2) {\n    if ((FILE *)*param_1 == (FILE *)0x0) {\n                    /* WARNING: Subroutine does not return */\n      __assert_fail("ctx->lgfp","logging.c",0x2f,"logwrite");\n    }\n    sVar1 = fwrite(param_2,1,(long)param_3,(FILE *)*param_1);\n    if (sVar1 < (ulong)(long)param_3) {\n      FUN_0011e15d(param_1);\n      *(undefined4 *)(param_1 + 1) = 3;\n      FUN_0014413d(param_1[6],"Disabled writing session log due to error while writing");\n    }\n  }\n  return;\n}" primitive_type (function_declarator "FUN_0011e17e(undefined8 *param_1,void *param_2,int param_3)" identifier (parameter_list "(undefined8 *param_1,void *param_2,int param_3)" ( (parameter_declaration "undefined8 *param_1" type_identifier (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "void *param_2" primitive_type (pointer_declarator "*param_2" * identifier)) , (parameter_declaration "int param_3" primitive_type identifier) ))) (compound_statement "{\n  size_t sVar1;\n  \n  if (*(int *)(param_1 + 1) == 0) {\n    FUN_0011e58d();\n  }\n  if (*(int *)(param_1 + 1) == 1) {\n    FUN_00121236(param_1 + 2,param_2,param_3);\n  }\n  else if (*(int *)(param_1 + 1) == 2) {\n    if ((FILE *)*param_1 == (FILE *)0x0) {\n                    /* WARNING: Subroutine does not return */\n      __assert_fail("ctx->lgfp","logging.c",0x2f,"logwrite");\n    }\n    sVar1 = fwrite(param_2,1,(long)param_3,(FILE *)*param_1);\n    if (sVar1 < (ulong)(long)param_3) {\n      FUN_0011e15d(param_1);\n      *(undefined4 *)(param_1 + 1) = 3;\n      FUN_0014413d(param_1[6],"Disabled writing session log due to error while writing");\n    }\n  }\n  return;\n}" { (declaration "size_t sVar1;" primitive_type identifier ;) (if_statement "if (*(int *)(param_1 + 1) == 0) {\n    FUN_0011e58d();\n  }" if (parenthesized_expression "(*(int *)(param_1 + 1) == 0)" ( (binary_expression "*(int *)(param_1 + 1) == 0" (pointer_expression "*(int *)(param_1 + 1)" * (cast_expression "(int *)(param_1 + 1)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 1)" ( (binary_expression "param_1 + 1" identifier + number_literal) )))) == number_literal) )) (compound_statement "{\n    FUN_0011e58d();\n  }" { (expression_statement "FUN_0011e58d();" (call_expression "FUN_0011e58d()" identifier (argument_list "()" ( ))) ;) })) (if_statement "if (*(int *)(param_1 + 1) == 1) {\n    FUN_00121236(param_1 + 2,param_2,param_3);\n  }\n  else if (*(int *)(param_1 + 1) == 2) {\n    if ((FILE *)*param_1 == (FILE *)0x0) {\n                    /* WARNING: Subroutine does not return */\n      __assert_fail("ctx->lgfp","logging.c",0x2f,"logwrite");\n    }\n    sVar1 = fwrite(param_2,1,(long)param_3,(FILE *)*param_1);\n    if (sVar1 < (ulong)(long)param_3) {\n      FUN_0011e15d(param_1);\n      *(undefined4 *)(param_1 + 1) = 3;\n      FUN_0014413d(param_1[6],"Disabled writing session log due to error while writing");\n    }\n  }" if (parenthesized_expression "(*(int *)(param_1 + 1) == 1)" ( (binary_expression "*(int *)(param_1 + 1) == 1" (pointer_expression "*(int *)(param_1 + 1)" * (cast_expression "(int *)(param_1 + 1)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 1)" ( (binary_expression "param_1 + 1" identifier + number_literal) )))) == number_literal) )) (compound_statement "{\n    FUN_00121236(param_1 + 2,param_2,param_3);\n  }" { (expression_statement "FUN_00121236(param_1 + 2,param_2,param_3);" (call_expression "FUN_00121236(param_1 + 2,param_2,param_3)" identifier (argument_list "(param_1 + 2,param_2,param_3)" ( (binary_expression "param_1 + 2" identifier + number_literal) , identifier , identifier ))) ;) }) (else_clause "else if (*(int *)(param_1 + 1) == 2) {\n    if ((FILE *)*param_1 == (FILE *)0x0) {\n                    /* WARNING: Subroutine does not return */\n      __assert_fail("ctx->lgfp","logging.c",0x2f,"logwrite");\n    }\n    sVar1 = fwrite(param_2,1,(long)param_3,(FILE *)*param_1);\n    if (sVar1 < (ulong)(long)param_3) {\n      FUN_0011e15d(param_1);\n      *(undefined4 *)(param_1 + 1) = 3;\n      FUN_0014413d(param_1[6],"Disabled writing session log due to error while writing");\n    }\n  }" else (if_statement "if (*(int *)(param_1 + 1) == 2) {\n    if ((FILE *)*param_1 == (FILE *)0x0) {\n                    /* WARNING: Subroutine does not return */\n      __assert_fail("ctx->lgfp","logging.c",0x2f,"logwrite");\n    }\n    sVar1 = fwrite(param_2,1,(long)param_3,(FILE *)*param_1);\n    if (sVar1 < (ulong)(long)param_3) {\n      FUN_0011e15d(param_1);\n      *(undefined4 *)(param_1 + 1) = 3;\n      FUN_0014413d(param_1[6],"Disabled writing session log due to error while writing");\n    }\n  }" if (parenthesized_expression "(*(int *)(param_1 + 1) == 2)" ( (binary_expression "*(int *)(param_1 + 1) == 2" (pointer_expression "*(int *)(param_1 + 1)" * (cast_expression "(int *)(param_1 + 1)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 1)" ( (binary_expression "param_1 + 1" identifier + number_literal) )))) == number_literal) )) (compound_statement "{\n    if ((FILE *)*param_1 == (FILE *)0x0) {\n                    /* WARNING: Subroutine does not return */\n      __assert_fail("ctx->lgfp","logging.c",0x2f,"logwrite");\n    }\n    sVar1 = fwrite(param_2,1,(long)param_3,(FILE *)*param_1);\n    if (sVar1 < (ulong)(long)param_3) {\n      FUN_0011e15d(param_1);\n      *(undefined4 *)(param_1 + 1) = 3;\n      FUN_0014413d(param_1[6],"Disabled writing session log due to error while writing");\n    }\n  }" { (if_statement "if ((FILE *)*param_1 == (FILE *)0x0) {\n                    /* WARNING: Subroutine does not return */\n      __assert_fail("ctx->lgfp","logging.c",0x2f,"logwrite");\n    }" if (parenthesized_expression "((FILE *)*param_1 == (FILE *)0x0)" ( (binary_expression "(FILE *)*param_1 == (FILE *)0x0" (cast_expression "(FILE *)*param_1" ( (type_descriptor "FILE *" type_identifier (abstract_pointer_declarator "*" *)) ) (pointer_expression "*param_1" * identifier)) == (cast_expression "(FILE *)0x0" ( (type_descriptor "FILE *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n                    /* WARNING: Subroutine does not return */\n      __assert_fail("ctx->lgfp","logging.c",0x2f,"logwrite");\n    }" { comment (expression_statement "__assert_fail("ctx->lgfp","logging.c",0x2f,"logwrite");" (call_expression "__assert_fail("ctx->lgfp","logging.c",0x2f,"logwrite")" identifier (argument_list "("ctx->lgfp","logging.c",0x2f,"logwrite")" ( (string_literal ""ctx->lgfp"" " string_content ") , (string_literal ""logging.c"" " string_content ") , number_literal , (string_literal ""logwrite"" " string_content ") ))) ;) })) (expression_statement "sVar1 = fwrite(param_2,1,(long)param_3,(FILE *)*param_1);" (assignment_expression "sVar1 = fwrite(param_2,1,(long)param_3,(FILE *)*param_1)" identifier = (call_expression "fwrite(param_2,1,(long)param_3,(FILE *)*param_1)" identifier (argument_list "(param_2,1,(long)param_3,(FILE *)*param_1)" ( identifier , number_literal , (cast_expression "(long)param_3" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier) , (cast_expression "(FILE *)*param_1" ( (type_descriptor "FILE *" type_identifier (abstract_pointer_declarator "*" *)) ) (pointer_expression "*param_1" * identifier)) )))) ;) (if_statement "if (sVar1 < (ulong)(long)param_3) {\n      FUN_0011e15d(param_1);\n      *(undefined4 *)(param_1 + 1) = 3;\n      FUN_0014413d(param_1[6],"Disabled writing session log due to error while writing");\n    }" if (parenthesized_expression "(sVar1 < (ulong)(long)param_3)" ( (binary_expression "sVar1 < (ulong)(long)param_3" identifier < (cast_expression "(ulong)(long)param_3" ( (type_descriptor "ulong" type_identifier) ) (cast_expression "(long)param_3" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier))) )) (compound_statement "{\n      FUN_0011e15d(param_1);\n      *(undefined4 *)(param_1 + 1) = 3;\n      FUN_0014413d(param_1[6],"Disabled writing session log due to error while writing");\n    }" { (expression_statement "FUN_0011e15d(param_1);" (call_expression "FUN_0011e15d(param_1)" identifier (argument_list "(param_1)" ( identifier ))) ;) (expression_statement "*(undefined4 *)(param_1 + 1) = 3;" (assignment_expression "*(undefined4 *)(param_1 + 1) = 3" (pointer_expression "*(undefined4 *)(param_1 + 1)" * (cast_expression "(undefined4 *)(param_1 + 1)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 1)" ( (binary_expression "param_1 + 1" identifier + number_literal) )))) = number_literal) ;) (expression_statement "FUN_0014413d(param_1[6],"Disabled writing session log due to error while writing");" (call_expression "FUN_0014413d(param_1[6],"Disabled writing session log due to error while writing")" identifier (argument_list "(param_1[6],"Disabled writing session log due to error while writing")" ( (subscript_expression "param_1[6]" identifier [ number_literal ]) , (string_literal ""Disabled writing session log due to error while writing"" " string_content ") ))) ;) })) })))) (return_statement "return;" return ;) })))
(translation_unit "/* WARNING: Enum "anon_enum_32": Some values do not have unique names */\n\nvoid logwrite(LogContext *ctx,void *data,int len)\n\n{\n  size_t sVar1;\n  \n  if (ctx->state == ADDRTYPE_UNSPEC) {\n    logfopen(ctx);\n  }\n  if (ctx->state == ABOUT_TO) {\n    bufchain_add(&ctx->queue,data,len);\n  }\n  else if (ctx->state == ADDRTYPE_IPV6) {\n    if ((FILE *)ctx->lgfp == (FILE *)0x0) {\n                    /* WARNING: Subroutine does not return */\n      __assert_fail("ctx->lgfp","logging.c",0x2f,"logwrite");\n    }\n    sVar1 = fwrite(data,1,(long)len,(FILE *)ctx->lgfp);\n    if (sVar1 < (ulong)(long)len) {\n      logfclose(ctx);\n      ctx->state = ADDRTYPE_NAME;\n      logevent(ctx->frontend,"Disabled writing session log due to error while writing");\n    }\n  }\n  return;\n}\n\n" comment (function_definition "void logwrite(LogContext *ctx,void *data,int len)\n\n{\n  size_t sVar1;\n  \n  if (ctx->state == ADDRTYPE_UNSPEC) {\n    logfopen(ctx);\n  }\n  if (ctx->state == ABOUT_TO) {\n    bufchain_add(&ctx->queue,data,len);\n  }\n  else if (ctx->state == ADDRTYPE_IPV6) {\n    if ((FILE *)ctx->lgfp == (FILE *)0x0) {\n                    /* WARNING: Subroutine does not return */\n      __assert_fail("ctx->lgfp","logging.c",0x2f,"logwrite");\n    }\n    sVar1 = fwrite(data,1,(long)len,(FILE *)ctx->lgfp);\n    if (sVar1 < (ulong)(long)len) {\n      logfclose(ctx);\n      ctx->state = ADDRTYPE_NAME;\n      logevent(ctx->frontend,"Disabled writing session log due to error while writing");\n    }\n  }\n  return;\n}" primitive_type (function_declarator "logwrite(LogContext *ctx,void *data,int len)" identifier (parameter_list "(LogContext *ctx,void *data,int len)" ( (parameter_declaration "LogContext *ctx" type_identifier (pointer_declarator "*ctx" * identifier)) , (parameter_declaration "void *data" primitive_type (pointer_declarator "*data" * identifier)) , (parameter_declaration "int len" primitive_type identifier) ))) (compound_statement "{\n  size_t sVar1;\n  \n  if (ctx->state == ADDRTYPE_UNSPEC) {\n    logfopen(ctx);\n  }\n  if (ctx->state == ABOUT_TO) {\n    bufchain_add(&ctx->queue,data,len);\n  }\n  else if (ctx->state == ADDRTYPE_IPV6) {\n    if ((FILE *)ctx->lgfp == (FILE *)0x0) {\n                    /* WARNING: Subroutine does not return */\n      __assert_fail("ctx->lgfp","logging.c",0x2f,"logwrite");\n    }\n    sVar1 = fwrite(data,1,(long)len,(FILE *)ctx->lgfp);\n    if (sVar1 < (ulong)(long)len) {\n      logfclose(ctx);\n      ctx->state = ADDRTYPE_NAME;\n      logevent(ctx->frontend,"Disabled writing session log due to error while writing");\n    }\n  }\n  return;\n}" { (declaration "size_t sVar1;" primitive_type identifier ;) (if_statement "if (ctx->state == ADDRTYPE_UNSPEC) {\n    logfopen(ctx);\n  }" if (parenthesized_expression "(ctx->state == ADDRTYPE_UNSPEC)" ( (binary_expression "ctx->state == ADDRTYPE_UNSPEC" (field_expression "ctx->state" identifier -> field_identifier) == identifier) )) (compound_statement "{\n    logfopen(ctx);\n  }" { (expression_statement "logfopen(ctx);" (call_expression "logfopen(ctx)" identifier (argument_list "(ctx)" ( identifier ))) ;) })) (if_statement "if (ctx->state == ABOUT_TO) {\n    bufchain_add(&ctx->queue,data,len);\n  }\n  else if (ctx->state == ADDRTYPE_IPV6) {\n    if ((FILE *)ctx->lgfp == (FILE *)0x0) {\n                    /* WARNING: Subroutine does not return */\n      __assert_fail("ctx->lgfp","logging.c",0x2f,"logwrite");\n    }\n    sVar1 = fwrite(data,1,(long)len,(FILE *)ctx->lgfp);\n    if (sVar1 < (ulong)(long)len) {\n      logfclose(ctx);\n      ctx->state = ADDRTYPE_NAME;\n      logevent(ctx->frontend,"Disabled writing session log due to error while writing");\n    }\n  }" if (parenthesized_expression "(ctx->state == ABOUT_TO)" ( (binary_expression "ctx->state == ABOUT_TO" (field_expression "ctx->state" identifier -> field_identifier) == identifier) )) (compound_statement "{\n    bufchain_add(&ctx->queue,data,len);\n  }" { (expression_statement "bufchain_add(&ctx->queue,data,len);" (call_expression "bufchain_add(&ctx->queue,data,len)" identifier (argument_list "(&ctx->queue,data,len)" ( (pointer_expression "&ctx->queue" & (field_expression "ctx->queue" identifier -> field_identifier)) , identifier , identifier ))) ;) }) (else_clause "else if (ctx->state == ADDRTYPE_IPV6) {\n    if ((FILE *)ctx->lgfp == (FILE *)0x0) {\n                    /* WARNING: Subroutine does not return */\n      __assert_fail("ctx->lgfp","logging.c",0x2f,"logwrite");\n    }\n    sVar1 = fwrite(data,1,(long)len,(FILE *)ctx->lgfp);\n    if (sVar1 < (ulong)(long)len) {\n      logfclose(ctx);\n      ctx->state = ADDRTYPE_NAME;\n      logevent(ctx->frontend,"Disabled writing session log due to error while writing");\n    }\n  }" else (if_statement "if (ctx->state == ADDRTYPE_IPV6) {\n    if ((FILE *)ctx->lgfp == (FILE *)0x0) {\n                    /* WARNING: Subroutine does not return */\n      __assert_fail("ctx->lgfp","logging.c",0x2f,"logwrite");\n    }\n    sVar1 = fwrite(data,1,(long)len,(FILE *)ctx->lgfp);\n    if (sVar1 < (ulong)(long)len) {\n      logfclose(ctx);\n      ctx->state = ADDRTYPE_NAME;\n      logevent(ctx->frontend,"Disabled writing session log due to error while writing");\n    }\n  }" if (parenthesized_expression "(ctx->state == ADDRTYPE_IPV6)" ( (binary_expression "ctx->state == ADDRTYPE_IPV6" (field_expression "ctx->state" identifier -> field_identifier) == identifier) )) (compound_statement "{\n    if ((FILE *)ctx->lgfp == (FILE *)0x0) {\n                    /* WARNING: Subroutine does not return */\n      __assert_fail("ctx->lgfp","logging.c",0x2f,"logwrite");\n    }\n    sVar1 = fwrite(data,1,(long)len,(FILE *)ctx->lgfp);\n    if (sVar1 < (ulong)(long)len) {\n      logfclose(ctx);\n      ctx->state = ADDRTYPE_NAME;\n      logevent(ctx->frontend,"Disabled writing session log due to error while writing");\n    }\n  }" { (if_statement "if ((FILE *)ctx->lgfp == (FILE *)0x0) {\n                    /* WARNING: Subroutine does not return */\n      __assert_fail("ctx->lgfp","logging.c",0x2f,"logwrite");\n    }" if (parenthesized_expression "((FILE *)ctx->lgfp == (FILE *)0x0)" ( (binary_expression "(FILE *)ctx->lgfp == (FILE *)0x0" (cast_expression "(FILE *)ctx->lgfp" ( (type_descriptor "FILE *" type_identifier (abstract_pointer_declarator "*" *)) ) (field_expression "ctx->lgfp" identifier -> field_identifier)) == (cast_expression "(FILE *)0x0" ( (type_descriptor "FILE *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n                    /* WARNING: Subroutine does not return */\n      __assert_fail("ctx->lgfp","logging.c",0x2f,"logwrite");\n    }" { comment (expression_statement "__assert_fail("ctx->lgfp","logging.c",0x2f,"logwrite");" (call_expression "__assert_fail("ctx->lgfp","logging.c",0x2f,"logwrite")" identifier (argument_list "("ctx->lgfp","logging.c",0x2f,"logwrite")" ( (string_literal ""ctx->lgfp"" " string_content ") , (string_literal ""logging.c"" " string_content ") , number_literal , (string_literal ""logwrite"" " string_content ") ))) ;) })) (expression_statement "sVar1 = fwrite(data,1,(long)len,(FILE *)ctx->lgfp);" (assignment_expression "sVar1 = fwrite(data,1,(long)len,(FILE *)ctx->lgfp)" identifier = (call_expression "fwrite(data,1,(long)len,(FILE *)ctx->lgfp)" identifier (argument_list "(data,1,(long)len,(FILE *)ctx->lgfp)" ( identifier , number_literal , (cast_expression "(long)len" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier) , (cast_expression "(FILE *)ctx->lgfp" ( (type_descriptor "FILE *" type_identifier (abstract_pointer_declarator "*" *)) ) (field_expression "ctx->lgfp" identifier -> field_identifier)) )))) ;) (if_statement "if (sVar1 < (ulong)(long)len) {\n      logfclose(ctx);\n      ctx->state = ADDRTYPE_NAME;\n      logevent(ctx->frontend,"Disabled writing session log due to error while writing");\n    }" if (parenthesized_expression "(sVar1 < (ulong)(long)len)" ( (binary_expression "sVar1 < (ulong)(long)len" identifier < (cast_expression "(ulong)(long)len" ( (type_descriptor "ulong" type_identifier) ) (cast_expression "(long)len" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier))) )) (compound_statement "{\n      logfclose(ctx);\n      ctx->state = ADDRTYPE_NAME;\n      logevent(ctx->frontend,"Disabled writing session log due to error while writing");\n    }" { (expression_statement "logfclose(ctx);" (call_expression "logfclose(ctx)" identifier (argument_list "(ctx)" ( identifier ))) ;) (expression_statement "ctx->state = ADDRTYPE_NAME;" (assignment_expression "ctx->state = ADDRTYPE_NAME" (field_expression "ctx->state" identifier -> field_identifier) = identifier) ;) (expression_statement "logevent(ctx->frontend,"Disabled writing session log due to error while writing");" (call_expression "logevent(ctx->frontend,"Disabled writing session log due to error while writing")" identifier (argument_list "(ctx->frontend,"Disabled writing session log due to error while writing")" ( (field_expression "ctx->frontend" identifier -> field_identifier) , (string_literal ""Disabled writing session log due to error while writing"" " string_content ") ))) ;) })) })))) (return_statement "return;" return ;) })))
(translation_unit "void FUN_0011e17e(undefined8 *param_1,void *param_2,int param_3)\n\n{\n  size_t sVar1;\n  \n  if (*(int *)(param_1 + 1) == 0) {\n    FUN_0011e58d();\n  }\n  if (*(int *)(param_1 + 1) == 1) {\n    FUN_00121236(param_1 + 2,param_2,param_3);\n  }\n  else if (*(int *)(param_1 + 1) == 2) {\n    if ((FILE *)*param_1 == (FILE *)0x0) {\n                    \n      __assert_fail("ctx->lgfp","logging.c",0x2f,"logwrite");\n    }\n    sVar1 = fwrite(param_2,1,(long)param_3,(FILE *)*param_1);\n    if (sVar1 < (ulong)(long)param_3) {\n      FUN_0011e15d(param_1);\n      *(undefined4 *)(param_1 + 1) = 3;\n      FUN_0014413d(param_1[6],"Disabled writing session log due to error while writing");\n    }\n  }\n  return;\n}\n\n" (function_definition "void FUN_0011e17e(undefined8 *param_1,void *param_2,int param_3)\n\n{\n  size_t sVar1;\n  \n  if (*(int *)(param_1 + 1) == 0) {\n    FUN_0011e58d();\n  }\n  if (*(int *)(param_1 + 1) == 1) {\n    FUN_00121236(param_1 + 2,param_2,param_3);\n  }\n  else if (*(int *)(param_1 + 1) == 2) {\n    if ((FILE *)*param_1 == (FILE *)0x0) {\n                    \n      __assert_fail("ctx->lgfp","logging.c",0x2f,"logwrite");\n    }\n    sVar1 = fwrite(param_2,1,(long)param_3,(FILE *)*param_1);\n    if (sVar1 < (ulong)(long)param_3) {\n      FUN_0011e15d(param_1);\n      *(undefined4 *)(param_1 + 1) = 3;\n      FUN_0014413d(param_1[6],"Disabled writing session log due to error while writing");\n    }\n  }\n  return;\n}" primitive_type (function_declarator "FUN_0011e17e(undefined8 *param_1,void *param_2,int param_3)" identifier (parameter_list "(undefined8 *param_1,void *param_2,int param_3)" ( (parameter_declaration "undefined8 *param_1" type_identifier (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "void *param_2" primitive_type (pointer_declarator "*param_2" * identifier)) , (parameter_declaration "int param_3" primitive_type identifier) ))) (compound_statement "{\n  size_t sVar1;\n  \n  if (*(int *)(param_1 + 1) == 0) {\n    FUN_0011e58d();\n  }\n  if (*(int *)(param_1 + 1) == 1) {\n    FUN_00121236(param_1 + 2,param_2,param_3);\n  }\n  else if (*(int *)(param_1 + 1) == 2) {\n    if ((FILE *)*param_1 == (FILE *)0x0) {\n                    \n      __assert_fail("ctx->lgfp","logging.c",0x2f,"logwrite");\n    }\n    sVar1 = fwrite(param_2,1,(long)param_3,(FILE *)*param_1);\n    if (sVar1 < (ulong)(long)param_3) {\n      FUN_0011e15d(param_1);\n      *(undefined4 *)(param_1 + 1) = 3;\n      FUN_0014413d(param_1[6],"Disabled writing session log due to error while writing");\n    }\n  }\n  return;\n}" { (declaration "size_t sVar1;" primitive_type identifier ;) (if_statement "if (*(int *)(param_1 + 1) == 0) {\n    FUN_0011e58d();\n  }" if (parenthesized_expression "(*(int *)(param_1 + 1) == 0)" ( (binary_expression "*(int *)(param_1 + 1) == 0" (pointer_expression "*(int *)(param_1 + 1)" * (cast_expression "(int *)(param_1 + 1)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 1)" ( (binary_expression "param_1 + 1" identifier + number_literal) )))) == number_literal) )) (compound_statement "{\n    FUN_0011e58d();\n  }" { (expression_statement "FUN_0011e58d();" (call_expression "FUN_0011e58d()" identifier (argument_list "()" ( ))) ;) })) (if_statement "if (*(int *)(param_1 + 1) == 1) {\n    FUN_00121236(param_1 + 2,param_2,param_3);\n  }\n  else if (*(int *)(param_1 + 1) == 2) {\n    if ((FILE *)*param_1 == (FILE *)0x0) {\n                    \n      __assert_fail("ctx->lgfp","logging.c",0x2f,"logwrite");\n    }\n    sVar1 = fwrite(param_2,1,(long)param_3,(FILE *)*param_1);\n    if (sVar1 < (ulong)(long)param_3) {\n      FUN_0011e15d(param_1);\n      *(undefined4 *)(param_1 + 1) = 3;\n      FUN_0014413d(param_1[6],"Disabled writing session log due to error while writing");\n    }\n  }" if (parenthesized_expression "(*(int *)(param_1 + 1) == 1)" ( (binary_expression "*(int *)(param_1 + 1) == 1" (pointer_expression "*(int *)(param_1 + 1)" * (cast_expression "(int *)(param_1 + 1)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 1)" ( (binary_expression "param_1 + 1" identifier + number_literal) )))) == number_literal) )) (compound_statement "{\n    FUN_00121236(param_1 + 2,param_2,param_3);\n  }" { (expression_statement "FUN_00121236(param_1 + 2,param_2,param_3);" (call_expression "FUN_00121236(param_1 + 2,param_2,param_3)" identifier (argument_list "(param_1 + 2,param_2,param_3)" ( (binary_expression "param_1 + 2" identifier + number_literal) , identifier , identifier ))) ;) }) (else_clause "else if (*(int *)(param_1 + 1) == 2) {\n    if ((FILE *)*param_1 == (FILE *)0x0) {\n                    \n      __assert_fail("ctx->lgfp","logging.c",0x2f,"logwrite");\n    }\n    sVar1 = fwrite(param_2,1,(long)param_3,(FILE *)*param_1);\n    if (sVar1 < (ulong)(long)param_3) {\n      FUN_0011e15d(param_1);\n      *(undefined4 *)(param_1 + 1) = 3;\n      FUN_0014413d(param_1[6],"Disabled writing session log due to error while writing");\n    }\n  }" else (if_statement "if (*(int *)(param_1 + 1) == 2) {\n    if ((FILE *)*param_1 == (FILE *)0x0) {\n                    \n      __assert_fail("ctx->lgfp","logging.c",0x2f,"logwrite");\n    }\n    sVar1 = fwrite(param_2,1,(long)param_3,(FILE *)*param_1);\n    if (sVar1 < (ulong)(long)param_3) {\n      FUN_0011e15d(param_1);\n      *(undefined4 *)(param_1 + 1) = 3;\n      FUN_0014413d(param_1[6],"Disabled writing session log due to error while writing");\n    }\n  }" if (parenthesized_expression "(*(int *)(param_1 + 1) == 2)" ( (binary_expression "*(int *)(param_1 + 1) == 2" (pointer_expression "*(int *)(param_1 + 1)" * (cast_expression "(int *)(param_1 + 1)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 1)" ( (binary_expression "param_1 + 1" identifier + number_literal) )))) == number_literal) )) (compound_statement "{\n    if ((FILE *)*param_1 == (FILE *)0x0) {\n                    \n      __assert_fail("ctx->lgfp","logging.c",0x2f,"logwrite");\n    }\n    sVar1 = fwrite(param_2,1,(long)param_3,(FILE *)*param_1);\n    if (sVar1 < (ulong)(long)param_3) {\n      FUN_0011e15d(param_1);\n      *(undefined4 *)(param_1 + 1) = 3;\n      FUN_0014413d(param_1[6],"Disabled writing session log due to error while writing");\n    }\n  }" { (if_statement "if ((FILE *)*param_1 == (FILE *)0x0) {\n                    \n      __assert_fail("ctx->lgfp","logging.c",0x2f,"logwrite");\n    }" if (parenthesized_expression "((FILE *)*param_1 == (FILE *)0x0)" ( (binary_expression "(FILE *)*param_1 == (FILE *)0x0" (cast_expression "(FILE *)*param_1" ( (type_descriptor "FILE *" type_identifier (abstract_pointer_declarator "*" *)) ) (pointer_expression "*param_1" * identifier)) == (cast_expression "(FILE *)0x0" ( (type_descriptor "FILE *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n                    \n      __assert_fail("ctx->lgfp","logging.c",0x2f,"logwrite");\n    }" { (expression_statement "__assert_fail("ctx->lgfp","logging.c",0x2f,"logwrite");" (call_expression "__assert_fail("ctx->lgfp","logging.c",0x2f,"logwrite")" identifier (argument_list "("ctx->lgfp","logging.c",0x2f,"logwrite")" ( (string_literal ""ctx->lgfp"" " string_content ") , (string_literal ""logging.c"" " string_content ") , number_literal , (string_literal ""logwrite"" " string_content ") ))) ;) })) (expression_statement "sVar1 = fwrite(param_2,1,(long)param_3,(FILE *)*param_1);" (assignment_expression "sVar1 = fwrite(param_2,1,(long)param_3,(FILE *)*param_1)" identifier = (call_expression "fwrite(param_2,1,(long)param_3,(FILE *)*param_1)" identifier (argument_list "(param_2,1,(long)param_3,(FILE *)*param_1)" ( identifier , number_literal , (cast_expression "(long)param_3" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier) , (cast_expression "(FILE *)*param_1" ( (type_descriptor "FILE *" type_identifier (abstract_pointer_declarator "*" *)) ) (pointer_expression "*param_1" * identifier)) )))) ;) (if_statement "if (sVar1 < (ulong)(long)param_3) {\n      FUN_0011e15d(param_1);\n      *(undefined4 *)(param_1 + 1) = 3;\n      FUN_0014413d(param_1[6],"Disabled writing session log due to error while writing");\n    }" if (parenthesized_expression "(sVar1 < (ulong)(long)param_3)" ( (binary_expression "sVar1 < (ulong)(long)param_3" identifier < (cast_expression "(ulong)(long)param_3" ( (type_descriptor "ulong" type_identifier) ) (cast_expression "(long)param_3" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier))) )) (compound_statement "{\n      FUN_0011e15d(param_1);\n      *(undefined4 *)(param_1 + 1) = 3;\n      FUN_0014413d(param_1[6],"Disabled writing session log due to error while writing");\n    }" { (expression_statement "FUN_0011e15d(param_1);" (call_expression "FUN_0011e15d(param_1)" identifier (argument_list "(param_1)" ( identifier ))) ;) (expression_statement "*(undefined4 *)(param_1 + 1) = 3;" (assignment_expression "*(undefined4 *)(param_1 + 1) = 3" (pointer_expression "*(undefined4 *)(param_1 + 1)" * (cast_expression "(undefined4 *)(param_1 + 1)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 1)" ( (binary_expression "param_1 + 1" identifier + number_literal) )))) = number_literal) ;) (expression_statement "FUN_0014413d(param_1[6],"Disabled writing session log due to error while writing");" (call_expression "FUN_0014413d(param_1[6],"Disabled writing session log due to error while writing")" identifier (argument_list "(param_1[6],"Disabled writing session log due to error while writing")" ( (subscript_expression "param_1[6]" identifier [ number_literal ]) , (string_literal ""Disabled writing session log due to error while writing"" " string_content ") ))) ;) })) })))) (return_statement "return;" return ;) })))
(translation_unit (function_definition TYPE (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE (pointer_declarator * IDENT)) , (parameter_declaration TYPE (pointer_declarator * IDENT)) , (parameter_declaration TYPE IDENT) ))) (compound_statement { (declaration TYPE IDENT ;) (if_statement if (parenthesized_expression ( (binary_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) == LIT) )) (compound_statement { (expression_statement (call_expression IDENT (argument_list ( ))) ;) })) (if_statement if (parenthesized_expression ( (binary_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) == LIT) )) (compound_statement { (expression_statement (call_expression IDENT (argument_list ( (binary_expression IDENT + LIT) , IDENT , IDENT ))) ;) }) (else_clause else (if_statement if (parenthesized_expression ( (binary_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) == LIT) )) (compound_statement { (if_statement if (parenthesized_expression ( (binary_expression (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (pointer_expression * IDENT)) == (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) LIT)) )) (compound_statement { (expression_statement (call_expression IDENT (argument_list ( (string_literal " string_content ") , (string_literal " string_content ") , LIT , (string_literal " string_content ") ))) ;) })) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT , LIT , (cast_expression ( (type_descriptor (sized_type_specifier long)) ) IDENT) , (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (pointer_expression * IDENT)) )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT < (cast_expression ( (type_descriptor TYPE) ) (cast_expression ( (type_descriptor (sized_type_specifier long)) ) IDENT))) )) (compound_statement { (expression_statement (call_expression IDENT (argument_list ( IDENT ))) ;) (expression_statement (assignment_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) = LIT) ;) (expression_statement (call_expression IDENT (argument_list ( (subscript_expression IDENT [ LIT ]) , (string_literal " string_content ") ))) ;) })) })))) (return_statement return ;) })))
(function_definition "void FUN_0011e17e(undefined8 *param_1,void *param_2,int param_3)\n\n{\n  size_t sVar1;\n  \n  if (*(int *)(param_1 + 1) == 0) {\n    FUN_0011e58d();\n  }\n  if (*(int *)(param_1 + 1) == 1) {\n    FUN_00121236(param_1 + 2,param_2,param_3);\n  }\n  else if (*(int *)(param_1 + 1) == 2) {\n    if ((FILE *)*param_1 == (FILE *)0x0) {\n                    \n      __assert_fail("ctx->lgfp","logging.c",0x2f,"logwrite");\n    }\n    sVar1 = fwrite(param_2,1,(long)param_3,(FILE *)*param_1);\n    if (sVar1 < (ulong)(long)param_3) {\n      FUN_0011e15d(param_1);\n      *(undefined4 *)(param_1 + 1) = 3;\n      FUN_0014413d(param_1[6],"Disabled writing session log due to error while writing");\n    }\n  }\n  return;\n}" (primitive_type "void") (function_declarator "FUN_0011e17e(undefined8 *param_1,void *param_2,int param_3)" (identifier "FUN_0011e17e") (parameter_list "(undefined8 *param_1,void *param_2,int param_3)" (( "(") (parameter_declaration "undefined8 *param_1" (type_identifier "undefined8") (pointer_declarator "*param_1" (* "*") (identifier "param_1"))) (, ",") (parameter_declaration "void *param_2" (primitive_type "void") (pointer_declarator "*param_2" (* "*") (identifier "param_2"))) (, ",") (parameter_declaration "int param_3" (primitive_type "int") (identifier "param_3")) () ")"))) (compound_statement "{\n  size_t sVar1;\n  \n  if (*(int *)(param_1 + 1) == 0) {\n    FUN_0011e58d();\n  }\n  if (*(int *)(param_1 + 1) == 1) {\n    FUN_00121236(param_1 + 2,param_2,param_3);\n  }\n  else if (*(int *)(param_1 + 1) == 2) {\n    if ((FILE *)*param_1 == (FILE *)0x0) {\n                    \n      __assert_fail("ctx->lgfp","logging.c",0x2f,"logwrite");\n    }\n    sVar1 = fwrite(param_2,1,(long)param_3,(FILE *)*param_1);\n    if (sVar1 < (ulong)(long)param_3) {\n      FUN_0011e15d(param_1);\n      *(undefined4 *)(param_1 + 1) = 3;\n      FUN_0014413d(param_1[6],"Disabled writing session log due to error while writing");\n    }\n  }\n  return;\n}" ({ "{") (declaration "size_t sVar1;" (primitive_type "size_t") (identifier "sVar1") (; ";")) (if_statement "if (*(int *)(param_1 + 1) == 0) {\n    FUN_0011e58d();\n  }" (if "if") (parenthesized_expression "(*(int *)(param_1 + 1) == 0)" (( "(") (binary_expression "*(int *)(param_1 + 1) == 0" (pointer_expression "*(int *)(param_1 + 1)" (* "*") (cast_expression "(int *)(param_1 + 1)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 1)" (( "(") (binary_expression "param_1 + 1" (identifier "param_1") (+ "+") (number_literal "1")) () ")")))) (== "==") (number_literal "0")) () ")")) (compound_statement "{\n    FUN_0011e58d();\n  }" ({ "{") (expression_statement "FUN_0011e58d();" (call_expression "FUN_0011e58d()" (identifier "FUN_0011e58d") (argument_list "()" (( "(") () ")"))) (; ";")) (} "}"))) (if_statement "if (*(int *)(param_1 + 1) == 1) {\n    FUN_00121236(param_1 + 2,param_2,param_3);\n  }\n  else if (*(int *)(param_1 + 1) == 2) {\n    if ((FILE *)*param_1 == (FILE *)0x0) {\n                    \n      __assert_fail("ctx->lgfp","logging.c",0x2f,"logwrite");\n    }\n    sVar1 = fwrite(param_2,1,(long)param_3,(FILE *)*param_1);\n    if (sVar1 < (ulong)(long)param_3) {\n      FUN_0011e15d(param_1);\n      *(undefined4 *)(param_1 + 1) = 3;\n      FUN_0014413d(param_1[6],"Disabled writing session log due to error while writing");\n    }\n  }" (if "if") (parenthesized_expression "(*(int *)(param_1 + 1) == 1)" (( "(") (binary_expression "*(int *)(param_1 + 1) == 1" (pointer_expression "*(int *)(param_1 + 1)" (* "*") (cast_expression "(int *)(param_1 + 1)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 1)" (( "(") (binary_expression "param_1 + 1" (identifier "param_1") (+ "+") (number_literal "1")) () ")")))) (== "==") (number_literal "1")) () ")")) (compound_statement "{\n    FUN_00121236(param_1 + 2,param_2,param_3);\n  }" ({ "{") (expression_statement "FUN_00121236(param_1 + 2,param_2,param_3);" (call_expression "FUN_00121236(param_1 + 2,param_2,param_3)" (identifier "FUN_00121236") (argument_list "(param_1 + 2,param_2,param_3)" (( "(") (binary_expression "param_1 + 2" (identifier "param_1") (+ "+") (number_literal "2")) (, ",") (identifier "param_2") (, ",") (identifier "param_3") () ")"))) (; ";")) (} "}")) (else_clause "else if (*(int *)(param_1 + 1) == 2) {\n    if ((FILE *)*param_1 == (FILE *)0x0) {\n                    \n      __assert_fail("ctx->lgfp","logging.c",0x2f,"logwrite");\n    }\n    sVar1 = fwrite(param_2,1,(long)param_3,(FILE *)*param_1);\n    if (sVar1 < (ulong)(long)param_3) {\n      FUN_0011e15d(param_1);\n      *(undefined4 *)(param_1 + 1) = 3;\n      FUN_0014413d(param_1[6],"Disabled writing session log due to error while writing");\n    }\n  }" (else "else") (if_statement "if (*(int *)(param_1 + 1) == 2) {\n    if ((FILE *)*param_1 == (FILE *)0x0) {\n                    \n      __assert_fail("ctx->lgfp","logging.c",0x2f,"logwrite");\n    }\n    sVar1 = fwrite(param_2,1,(long)param_3,(FILE *)*param_1);\n    if (sVar1 < (ulong)(long)param_3) {\n      FUN_0011e15d(param_1);\n      *(undefined4 *)(param_1 + 1) = 3;\n      FUN_0014413d(param_1[6],"Disabled writing session log due to error while writing");\n    }\n  }" (if "if") (parenthesized_expression "(*(int *)(param_1 + 1) == 2)" (( "(") (binary_expression "*(int *)(param_1 + 1) == 2" (pointer_expression "*(int *)(param_1 + 1)" (* "*") (cast_expression "(int *)(param_1 + 1)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 1)" (( "(") (binary_expression "param_1 + 1" (identifier "param_1") (+ "+") (number_literal "1")) () ")")))) (== "==") (number_literal "2")) () ")")) (compound_statement "{\n    if ((FILE *)*param_1 == (FILE *)0x0) {\n                    \n      __assert_fail("ctx->lgfp","logging.c",0x2f,"logwrite");\n    }\n    sVar1 = fwrite(param_2,1,(long)param_3,(FILE *)*param_1);\n    if (sVar1 < (ulong)(long)param_3) {\n      FUN_0011e15d(param_1);\n      *(undefined4 *)(param_1 + 1) = 3;\n      FUN_0014413d(param_1[6],"Disabled writing session log due to error while writing");\n    }\n  }" ({ "{") (if_statement "if ((FILE *)*param_1 == (FILE *)0x0) {\n                    \n      __assert_fail("ctx->lgfp","logging.c",0x2f,"logwrite");\n    }" (if "if") (parenthesized_expression "((FILE *)*param_1 == (FILE *)0x0)" (( "(") (binary_expression "(FILE *)*param_1 == (FILE *)0x0" (cast_expression "(FILE *)*param_1" (( "(") (type_descriptor "FILE *" (type_identifier "FILE") (abstract_pointer_declarator "*" (* "*"))) () ")") (pointer_expression "*param_1" (* "*") (identifier "param_1"))) (== "==") (cast_expression "(FILE *)0x0" (( "(") (type_descriptor "FILE *" (type_identifier "FILE") (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0x0"))) () ")")) (compound_statement "{\n                    \n      __assert_fail("ctx->lgfp","logging.c",0x2f,"logwrite");\n    }" ({ "{") (expression_statement "__assert_fail("ctx->lgfp","logging.c",0x2f,"logwrite");" (call_expression "__assert_fail("ctx->lgfp","logging.c",0x2f,"logwrite")" (identifier "__assert_fail") (argument_list "("ctx->lgfp","logging.c",0x2f,"logwrite")" (( "(") (string_literal ""ctx->lgfp"" (" """) (string_content "ctx->lgfp") (" """)) (, ",") (string_literal ""logging.c"" (" """) (string_content "logging.c") (" """)) (, ",") (number_literal "0x2f") (, ",") (string_literal ""logwrite"" (" """) (string_content "logwrite") (" """)) () ")"))) (; ";")) (} "}"))) (expression_statement "sVar1 = fwrite(param_2,1,(long)param_3,(FILE *)*param_1);" (assignment_expression "sVar1 = fwrite(param_2,1,(long)param_3,(FILE *)*param_1)" (identifier "sVar1") (= "=") (call_expression "fwrite(param_2,1,(long)param_3,(FILE *)*param_1)" (identifier "fwrite") (argument_list "(param_2,1,(long)param_3,(FILE *)*param_1)" (( "(") (identifier "param_2") (, ",") (number_literal "1") (, ",") (cast_expression "(long)param_3" (( "(") (type_descriptor "long" (sized_type_specifier "long" (long "long"))) () ")") (identifier "param_3")) (, ",") (cast_expression "(FILE *)*param_1" (( "(") (type_descriptor "FILE *" (type_identifier "FILE") (abstract_pointer_declarator "*" (* "*"))) () ")") (pointer_expression "*param_1" (* "*") (identifier "param_1"))) () ")")))) (; ";")) (if_statement "if (sVar1 < (ulong)(long)param_3) {\n      FUN_0011e15d(param_1);\n      *(undefined4 *)(param_1 + 1) = 3;\n      FUN_0014413d(param_1[6],"Disabled writing session log due to error while writing");\n    }" (if "if") (parenthesized_expression "(sVar1 < (ulong)(long)param_3)" (( "(") (binary_expression "sVar1 < (ulong)(long)param_3" (identifier "sVar1") (< "<") (cast_expression "(ulong)(long)param_3" (( "(") (type_descriptor "ulong" (type_identifier "ulong")) () ")") (cast_expression "(long)param_3" (( "(") (type_descriptor "long" (sized_type_specifier "long" (long "long"))) () ")") (identifier "param_3")))) () ")")) (compound_statement "{\n      FUN_0011e15d(param_1);\n      *(undefined4 *)(param_1 + 1) = 3;\n      FUN_0014413d(param_1[6],"Disabled writing session log due to error while writing");\n    }" ({ "{") (expression_statement "FUN_0011e15d(param_1);" (call_expression "FUN_0011e15d(param_1)" (identifier "FUN_0011e15d") (argument_list "(param_1)" (( "(") (identifier "param_1") () ")"))) (; ";")) (expression_statement "*(undefined4 *)(param_1 + 1) = 3;" (assignment_expression "*(undefined4 *)(param_1 + 1) = 3" (pointer_expression "*(undefined4 *)(param_1 + 1)" (* "*") (cast_expression "(undefined4 *)(param_1 + 1)" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 1)" (( "(") (binary_expression "param_1 + 1" (identifier "param_1") (+ "+") (number_literal "1")) () ")")))) (= "=") (number_literal "3")) (; ";")) (expression_statement "FUN_0014413d(param_1[6],"Disabled writing session log due to error while writing");" (call_expression "FUN_0014413d(param_1[6],"Disabled writing session log due to error while writing")" (identifier "FUN_0014413d") (argument_list "(param_1[6],"Disabled writing session log due to error while writing")" (( "(") (subscript_expression "param_1[6]" (identifier "param_1") ([ "[") (number_literal "6") (] "]")) (, ",") (string_literal ""Disabled writing session log due to error while writing"" (" """) (string_content "Disabled writing session log due to error while writing") (" """)) () ")"))) (; ";")) (} "}"))) (} "}"))))) (return_statement "return;" (return "return") (; ";")) (} "}")))

/* WARNING: Enum "anon_enum_32": Some values do not have unique names */

void function_1(type_1 *ctx,void *data,int len)

{
  size_t var_8;
  
  if (ctx->state == var_1) {
    var_2(ctx);
  }
  if (ctx->state == var_3) {
    var_4(&ctx->queue,data,len);
  }
  else if (ctx->state == var_5) {
    if ((type_2 *)ctx->lgfp == (type_2 *)0x0) {
                    /* WARNING: Subroutine does not return */
      var_6("ctx->lgfp","logging.c",0x2f,"logwrite");
    }
    var_8 = var_7(data,1,(long)len,(type_2 *)ctx->lgfp);
    if (var_8 < (type_3)(long)len) {
      var_9(ctx);
      ctx->state = ADDRTYPE_NAME;
      var_10(ctx->frontend,"Disabled writing session log due to error while writing");
    }
  }
  return;
}


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

void MASKED(undefined8 *param_1,void *param_2,int param_3)

{
  size_t sVar1;
  
  if (*(int *)(param_1 + 1) == 0) {
    FUN_0011e58d();
  }
  if (*(int *)(param_1 + 1) == 1) {
    FUN_00121236(param_1 + 2,param_2,param_3);
  }
  else if (*(int *)(param_1 + 1) == 2) {
    if ((FILE *)*param_1 == (FILE *)0x0) {
                    /* WARNING: Subroutine does not return */
      __assert_fail("ctx->lgfp","logging.c",0x2f,"logwrite");
    }
    sVar1 = fwrite(param_2,1,(long)param_3,(FILE *)*param_1);
    if (sVar1 < (ulong)(long)param_3) {
      FUN_0011e15d(param_1);
      *(undefined4 *)(param_1 + 1) = 3;
      FUN_0014413d(param_1[6],"Disabled writing session log due to error while writing");
    }
  }
  return;
}

