
/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */
/* WARNING: Unknown calling convention */
/* WARNING: Enum "anon_enum_32": Some values do not have unique names */

void backend_socket_log(void *frontend,int type,SockAddr addr,int port,char *error_msg,
                       int error_code,Conf *conf,int session_started)

{
  int iVar1;
  int iVar2;
  char *__s;
  size_t datalen;
  uint uVar3;
  int in_GS_OFFSET;
  char addrbuf [256];
  
  iVar1 = *(int *)(in_GS_OFFSET + 0x14);
  if (type == 1) {
    sk_getaddr(addr,addrbuf,0x100);
    __s = dupprintf("Failed to connect to %s: %s",addrbuf,error_msg);
LAB_00015581:
    if (__s == (char *)0x0) goto LAB_0001552a;
  }
  else {
    if (type != 2) {
      if (type != 0) goto LAB_0001552a;
      sk_getaddr(addr,addrbuf,0x100);
      iVar2 = sk_addr_needs_port(addr);
      if (iVar2 == 0) {
        __s = dupprintf("Connecting to %s",addrbuf);
      }
      else {
        __s = dupprintf("Connecting to %s port %d",addrbuf,port);
      }
      goto LAB_00015581;
    }
    __s = dupprintf("%s\r\n",error_msg);
    datalen = strlen(__s);
    if (datalen < 2) {
                    /* WARNING: Subroutine does not return */
      __assert_fail("len >= 2","be_misc.c",0x28,"backend_socket_log");
    }
    uVar3 = conf_get_int(conf,0x13);
    if (uVar3 == 2) {
      uVar3 = (uint)(session_started != 0);
    }
    if (uVar3 == 0) {
      from_backend(frontend,1,__s,datalen);
    }
    __s[datalen - 2] = '\0';
  }
  logevent(frontend,__s);
  safefree(__s);
LAB_0001552a:
  if (iVar1 == *(int *)(in_GS_OFFSET + 0x14)) {
    return;
  }
                    /* WARNING: Subroutine does not return */
  __stack_chk_fail_local();
}



/* WARNING: Function: __i686.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */

void FUN_000154d0(undefined4 param_1,int param_2,undefined4 param_3,undefined4 param_4,
                 undefined4 param_5,undefined4 param_6,undefined4 param_7,int param_8)

{
  int iVar1;
  char *__s;
  size_t sVar2;
  uint uVar3;
  int in_GS_OFFSET;
  undefined1 local_120 [256];
  int local_20;
  undefined4 uStack_14;
  
  uStack_14 = 0x154d9;
  local_20 = *(int *)(in_GS_OFFSET + 0x14);
  if (param_2 == 1) {
    FUN_00053230(param_3,local_120,0x100);
    __s = (char *)FUN_0001b990("Failed to connect to %s: %s",local_120,param_5);
LAB_00015581:
    if (__s == (char *)0x0) goto LAB_0001552a;
  }
  else {
    if (param_2 != 2) {
      if (param_2 != 0) goto LAB_0001552a;
      FUN_00053230(param_3,local_120,0x100);
      iVar1 = FUN_000532c0(param_3);
      if (iVar1 == 0) {
        __s = (char *)FUN_0001b990("Connecting to %s",local_120);
      }
      else {
        __s = (char *)FUN_0001b990("Connecting to %s port %d",local_120,param_4);
      }
      goto LAB_00015581;
    }
    __s = (char *)FUN_0001b990(&DAT_0005d07a,param_5);
    sVar2 = strlen(__s);
    if (sVar2 < 2) {
                    /* WARNING: Subroutine does not return */
      __assert_fail("len >= 2","be_misc.c",0x28,"backend_socket_log");
    }
    uVar3 = FUN_00019350(param_7,0x13);
    if (uVar3 == 2) {
      uVar3 = (uint)(param_8 != 0);
    }
    if (uVar3 == 0) {
      FUN_000556e0(param_1,1,__s,sVar2);
    }
    __s[sVar2 - 2] = '\0';
  }
  FUN_000513d0(param_1,__s);
  FUN_0001c820(__s);
LAB_0001552a:
  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {
    return;
  }
                    /* WARNING: Subroutine does not return */
  FUN_0005c110();
}


PUSH EBP
PUSH EDI
PUSH ESI
PUSH EBX
CALL 0x00015340
ADD EBX,0x6f80f
SUB ESP,0x12c
MOV EAX,dword ptr [ESP + 0x144]
MOV ESI,dword ptr [ESP + 0x140]
MOV ECX,dword ptr GS:[0x14]
MOV dword ptr [ESP + 0x11c],ECX
XOR ECX,ECX
MOV EDI,dword ptr [ESP + 0x148]
MOV EDX,dword ptr [ESP + 0x150]
MOV EBP,dword ptr [ESP + 0x158]
CMP EAX,0x1
JZ 0x00015550
CMP EAX,0x2
JZ 0x000155e0
TEST EAX,EAX
JZ 0x000155a0
MOV EAX,dword ptr [ESP + 0x11c]
XOR EAX,dword ptr GS:[0x14]
JNZ 0x00015677
ADD ESP,0x12c
POP EBX
POP ESI
POP EDI
POP EBP
RET
MOV dword ptr [ESP + 0xc],EDX
SUB ESP,0x4
PUSH 0x100
LEA EBP,[ESP + 0x24]
PUSH EBP
PUSH EDI
CALL 0x00053230
ADD ESP,0xc
MOV EDX,dword ptr [ESP + 0x10]
LEA EAX,[EBX + 0xfffd8376]
PUSH EDX
PUSH EBP
PUSH EAX
CALL 0x0001b990
ADD ESP,0x10
MOV EDI,EAX
TEST EDI,EDI
JZ 0x0001552a
SUB ESP,0x8
PUSH EDI
PUSH ESI
CALL 0x000513d0
MOV dword ptr [ESP],EDI
CALL 0x0001c820
ADD ESP,0x10
JMP 0x0001552a
SUB ESP,0x4
PUSH 0x100
LEA EBP,[ESP + 0x24]
PUSH EBP
PUSH EDI
CALL 0x00053230
MOV dword ptr [ESP],EDI
CALL 0x000532c0
ADD ESP,0x10
TEST EAX,EAX
JZ 0x00015630
SUB ESP,0x4
LEA EAX,[EBX + 0xfffd834c]
PUSH dword ptr [ESP + 0x150]
PUSH EBP
PUSH EAX
CALL 0x0001b990
ADD ESP,0x10
MOV EDI,EAX
JMP 0x00015581
SUB ESP,0x8
LEA EAX,[EBX + 0xfffd8392]
PUSH EDX
PUSH EAX
CALL 0x0001b990
MOV dword ptr [ESP],EAX
MOV EDI,EAX
CALL 0x00014300
ADD ESP,0x10
CMP EAX,0x1
JBE 0x0001567c
MOV dword ptr [ESP + 0xc],EAX
SUB ESP,0x8
PUSH 0x13
PUSH EBP
CALL 0x00019350
ADD ESP,0x10
MOV EDX,dword ptr [ESP + 0xc]
CMP EAX,0x2
JZ 0x00015650
TEST EAX,EAX
JZ 0x00015660
MOV byte ptr [EDI + EDX*0x1 + -0x2],0x0
JMP 0x00015585
SUB ESP,0x8
LEA EAX,[EBX + 0xfffd8365]
PUSH EBP
PUSH EAX
CALL 0x0001b990
ADD ESP,0x10
MOV EDI,EAX
JMP 0x00015581
MOV ECX,dword ptr [ESP + 0x15c]
XOR EAX,EAX
TEST ECX,ECX
SETNZ AL
JMP 0x0001561d
PUSH EDX
MOV dword ptr [ESP + 0x10],EDX
PUSH EDI
PUSH 0x1
PUSH ESI
CALL 0x000556e0
ADD ESP,0x10
MOV EDX,dword ptr [ESP + 0xc]
JMP 0x00015621
CALL 0x0005c110
LEA EAX,[EBX + 0xfffd83b4]
PUSH EAX
LEA EAX,[EBX + 0xfffd8397]
PUSH 0x28
PUSH EAX
LEA EAX,[EBX + 0xfffd83a1]
PUSH EAX
CALL 0x00014ad0
(translation_unit "/* WARNING: Function: __i686.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n\nvoid FUN_000154d0(undefined4 param_1,int param_2,undefined4 param_3,undefined4 param_4,\n                 undefined4 param_5,undefined4 param_6,undefined4 param_7,int param_8)\n\n{\n  int iVar1;\n  char *__s;\n  size_t sVar2;\n  uint uVar3;\n  int in_GS_OFFSET;\n  undefined1 local_120 [256];\n  int local_20;\n  undefined4 uStack_14;\n  \n  uStack_14 = 0x154d9;\n  local_20 = *(int *)(in_GS_OFFSET + 0x14);\n  if (param_2 == 1) {\n    FUN_00053230(param_3,local_120,0x100);\n    __s = (char *)FUN_0001b990("Failed to connect to %s: %s",local_120,param_5);\nLAB_00015581:\n    if (__s == (char *)0x0) goto LAB_0001552a;\n  }\n  else {\n    if (param_2 != 2) {\n      if (param_2 != 0) goto LAB_0001552a;\n      FUN_00053230(param_3,local_120,0x100);\n      iVar1 = FUN_000532c0(param_3);\n      if (iVar1 == 0) {\n        __s = (char *)FUN_0001b990("Connecting to %s",local_120);\n      }\n      else {\n        __s = (char *)FUN_0001b990("Connecting to %s port %d",local_120,param_4);\n      }\n      goto LAB_00015581;\n    }\n    __s = (char *)FUN_0001b990(&DAT_0005d07a,param_5);\n    sVar2 = strlen(__s);\n    if (sVar2 < 2) {\n                    /* WARNING: Subroutine does not return */\n      __assert_fail("len >= 2","be_misc.c",0x28,"backend_socket_log");\n    }\n    uVar3 = FUN_00019350(param_7,0x13);\n    if (uVar3 == 2) {\n      uVar3 = (uint)(param_8 != 0);\n    }\n    if (uVar3 == 0) {\n      FUN_000556e0(param_1,1,__s,sVar2);\n    }\n    __s[sVar2 - 2] = '\0';\n  }\n  FUN_000513d0(param_1,__s);\n  FUN_0001c820(__s);\nLAB_0001552a:\n  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return;\n  }\n                    /* WARNING: Subroutine does not return */\n  FUN_0005c110();\n}\n\n" comment (function_definition "void FUN_000154d0(undefined4 param_1,int param_2,undefined4 param_3,undefined4 param_4,\n                 undefined4 param_5,undefined4 param_6,undefined4 param_7,int param_8)\n\n{\n  int iVar1;\n  char *__s;\n  size_t sVar2;\n  uint uVar3;\n  int in_GS_OFFSET;\n  undefined1 local_120 [256];\n  int local_20;\n  undefined4 uStack_14;\n  \n  uStack_14 = 0x154d9;\n  local_20 = *(int *)(in_GS_OFFSET + 0x14);\n  if (param_2 == 1) {\n    FUN_00053230(param_3,local_120,0x100);\n    __s = (char *)FUN_0001b990("Failed to connect to %s: %s",local_120,param_5);\nLAB_00015581:\n    if (__s == (char *)0x0) goto LAB_0001552a;\n  }\n  else {\n    if (param_2 != 2) {\n      if (param_2 != 0) goto LAB_0001552a;\n      FUN_00053230(param_3,local_120,0x100);\n      iVar1 = FUN_000532c0(param_3);\n      if (iVar1 == 0) {\n        __s = (char *)FUN_0001b990("Connecting to %s",local_120);\n      }\n      else {\n        __s = (char *)FUN_0001b990("Connecting to %s port %d",local_120,param_4);\n      }\n      goto LAB_00015581;\n    }\n    __s = (char *)FUN_0001b990(&DAT_0005d07a,param_5);\n    sVar2 = strlen(__s);\n    if (sVar2 < 2) {\n                    /* WARNING: Subroutine does not return */\n      __assert_fail("len >= 2","be_misc.c",0x28,"backend_socket_log");\n    }\n    uVar3 = FUN_00019350(param_7,0x13);\n    if (uVar3 == 2) {\n      uVar3 = (uint)(param_8 != 0);\n    }\n    if (uVar3 == 0) {\n      FUN_000556e0(param_1,1,__s,sVar2);\n    }\n    __s[sVar2 - 2] = '\0';\n  }\n  FUN_000513d0(param_1,__s);\n  FUN_0001c820(__s);\nLAB_0001552a:\n  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return;\n  }\n                    /* WARNING: Subroutine does not return */\n  FUN_0005c110();\n}" primitive_type (function_declarator "FUN_000154d0(undefined4 param_1,int param_2,undefined4 param_3,undefined4 param_4,\n                 undefined4 param_5,undefined4 param_6,undefined4 param_7,int param_8)" identifier (parameter_list "(undefined4 param_1,int param_2,undefined4 param_3,undefined4 param_4,\n                 undefined4 param_5,undefined4 param_6,undefined4 param_7,int param_8)" ( (parameter_declaration "undefined4 param_1" type_identifier identifier) , (parameter_declaration "int param_2" primitive_type identifier) , (parameter_declaration "undefined4 param_3" type_identifier identifier) , (parameter_declaration "undefined4 param_4" type_identifier identifier) , (parameter_declaration "undefined4 param_5" type_identifier identifier) , (parameter_declaration "undefined4 param_6" type_identifier identifier) , (parameter_declaration "undefined4 param_7" type_identifier identifier) , (parameter_declaration "int param_8" primitive_type identifier) ))) (compound_statement "{\n  int iVar1;\n  char *__s;\n  size_t sVar2;\n  uint uVar3;\n  int in_GS_OFFSET;\n  undefined1 local_120 [256];\n  int local_20;\n  undefined4 uStack_14;\n  \n  uStack_14 = 0x154d9;\n  local_20 = *(int *)(in_GS_OFFSET + 0x14);\n  if (param_2 == 1) {\n    FUN_00053230(param_3,local_120,0x100);\n    __s = (char *)FUN_0001b990("Failed to connect to %s: %s",local_120,param_5);\nLAB_00015581:\n    if (__s == (char *)0x0) goto LAB_0001552a;\n  }\n  else {\n    if (param_2 != 2) {\n      if (param_2 != 0) goto LAB_0001552a;\n      FUN_00053230(param_3,local_120,0x100);\n      iVar1 = FUN_000532c0(param_3);\n      if (iVar1 == 0) {\n        __s = (char *)FUN_0001b990("Connecting to %s",local_120);\n      }\n      else {\n        __s = (char *)FUN_0001b990("Connecting to %s port %d",local_120,param_4);\n      }\n      goto LAB_00015581;\n    }\n    __s = (char *)FUN_0001b990(&DAT_0005d07a,param_5);\n    sVar2 = strlen(__s);\n    if (sVar2 < 2) {\n                    /* WARNING: Subroutine does not return */\n      __assert_fail("len >= 2","be_misc.c",0x28,"backend_socket_log");\n    }\n    uVar3 = FUN_00019350(param_7,0x13);\n    if (uVar3 == 2) {\n      uVar3 = (uint)(param_8 != 0);\n    }\n    if (uVar3 == 0) {\n      FUN_000556e0(param_1,1,__s,sVar2);\n    }\n    __s[sVar2 - 2] = '\0';\n  }\n  FUN_000513d0(param_1,__s);\n  FUN_0001c820(__s);\nLAB_0001552a:\n  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return;\n  }\n                    /* WARNING: Subroutine does not return */\n  FUN_0005c110();\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "char *__s;" primitive_type (pointer_declarator "*__s" * identifier) ;) (declaration "size_t sVar2;" primitive_type identifier ;) (declaration "uint uVar3;" type_identifier identifier ;) (declaration "int in_GS_OFFSET;" primitive_type identifier ;) (declaration "undefined1 local_120 [256];" type_identifier (array_declarator "local_120 [256]" identifier [ number_literal ]) ;) (declaration "int local_20;" primitive_type identifier ;) (declaration "undefined4 uStack_14;" type_identifier identifier ;) (expression_statement "uStack_14 = 0x154d9;" (assignment_expression "uStack_14 = 0x154d9" identifier = number_literal) ;) (expression_statement "local_20 = *(int *)(in_GS_OFFSET + 0x14);" (assignment_expression "local_20 = *(int *)(in_GS_OFFSET + 0x14)" identifier = (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" * (cast_expression "(int *)(in_GS_OFFSET + 0x14)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_GS_OFFSET + 0x14)" ( (binary_expression "in_GS_OFFSET + 0x14" identifier + number_literal) ))))) ;) (if_statement "if (param_2 == 1) {\n    FUN_00053230(param_3,local_120,0x100);\n    __s = (char *)FUN_0001b990("Failed to connect to %s: %s",local_120,param_5);\nLAB_00015581:\n    if (__s == (char *)0x0) goto LAB_0001552a;\n  }\n  else {\n    if (param_2 != 2) {\n      if (param_2 != 0) goto LAB_0001552a;\n      FUN_00053230(param_3,local_120,0x100);\n      iVar1 = FUN_000532c0(param_3);\n      if (iVar1 == 0) {\n        __s = (char *)FUN_0001b990("Connecting to %s",local_120);\n      }\n      else {\n        __s = (char *)FUN_0001b990("Connecting to %s port %d",local_120,param_4);\n      }\n      goto LAB_00015581;\n    }\n    __s = (char *)FUN_0001b990(&DAT_0005d07a,param_5);\n    sVar2 = strlen(__s);\n    if (sVar2 < 2) {\n                    /* WARNING: Subroutine does not return */\n      __assert_fail("len >= 2","be_misc.c",0x28,"backend_socket_log");\n    }\n    uVar3 = FUN_00019350(param_7,0x13);\n    if (uVar3 == 2) {\n      uVar3 = (uint)(param_8 != 0);\n    }\n    if (uVar3 == 0) {\n      FUN_000556e0(param_1,1,__s,sVar2);\n    }\n    __s[sVar2 - 2] = '\0';\n  }" if (parenthesized_expression "(param_2 == 1)" ( (binary_expression "param_2 == 1" identifier == number_literal) )) (compound_statement "{\n    FUN_00053230(param_3,local_120,0x100);\n    __s = (char *)FUN_0001b990("Failed to connect to %s: %s",local_120,param_5);\nLAB_00015581:\n    if (__s == (char *)0x0) goto LAB_0001552a;\n  }" { (expression_statement "FUN_00053230(param_3,local_120,0x100);" (call_expression "FUN_00053230(param_3,local_120,0x100)" identifier (argument_list "(param_3,local_120,0x100)" ( identifier , identifier , number_literal ))) ;) (expression_statement "__s = (char *)FUN_0001b990("Failed to connect to %s: %s",local_120,param_5);" (assignment_expression "__s = (char *)FUN_0001b990("Failed to connect to %s: %s",local_120,param_5)" identifier = (cast_expression "(char *)FUN_0001b990("Failed to connect to %s: %s",local_120,param_5)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "FUN_0001b990("Failed to connect to %s: %s",local_120,param_5)" identifier (argument_list "("Failed to connect to %s: %s",local_120,param_5)" ( (string_literal ""Failed to connect to %s: %s"" " string_content ") , identifier , identifier ))))) ;) (labeled_statement "LAB_00015581:\n    if (__s == (char *)0x0) goto LAB_0001552a;" statement_identifier : (if_statement "if (__s == (char *)0x0) goto LAB_0001552a;" if (parenthesized_expression "(__s == (char *)0x0)" ( (binary_expression "__s == (char *)0x0" identifier == (cast_expression "(char *)0x0" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) )) (goto_statement "goto LAB_0001552a;" goto statement_identifier ;))) }) (else_clause "else {\n    if (param_2 != 2) {\n      if (param_2 != 0) goto LAB_0001552a;\n      FUN_00053230(param_3,local_120,0x100);\n      iVar1 = FUN_000532c0(param_3);\n      if (iVar1 == 0) {\n        __s = (char *)FUN_0001b990("Connecting to %s",local_120);\n      }\n      else {\n        __s = (char *)FUN_0001b990("Connecting to %s port %d",local_120,param_4);\n      }\n      goto LAB_00015581;\n    }\n    __s = (char *)FUN_0001b990(&DAT_0005d07a,param_5);\n    sVar2 = strlen(__s);\n    if (sVar2 < 2) {\n                    /* WARNING: Subroutine does not return */\n      __assert_fail("len >= 2","be_misc.c",0x28,"backend_socket_log");\n    }\n    uVar3 = FUN_00019350(param_7,0x13);\n    if (uVar3 == 2) {\n      uVar3 = (uint)(param_8 != 0);\n    }\n    if (uVar3 == 0) {\n      FUN_000556e0(param_1,1,__s,sVar2);\n    }\n    __s[sVar2 - 2] = '\0';\n  }" else (compound_statement "{\n    if (param_2 != 2) {\n      if (param_2 != 0) goto LAB_0001552a;\n      FUN_00053230(param_3,local_120,0x100);\n      iVar1 = FUN_000532c0(param_3);\n      if (iVar1 == 0) {\n        __s = (char *)FUN_0001b990("Connecting to %s",local_120);\n      }\n      else {\n        __s = (char *)FUN_0001b990("Connecting to %s port %d",local_120,param_4);\n      }\n      goto LAB_00015581;\n    }\n    __s = (char *)FUN_0001b990(&DAT_0005d07a,param_5);\n    sVar2 = strlen(__s);\n    if (sVar2 < 2) {\n                    /* WARNING: Subroutine does not return */\n      __assert_fail("len >= 2","be_misc.c",0x28,"backend_socket_log");\n    }\n    uVar3 = FUN_00019350(param_7,0x13);\n    if (uVar3 == 2) {\n      uVar3 = (uint)(param_8 != 0);\n    }\n    if (uVar3 == 0) {\n      FUN_000556e0(param_1,1,__s,sVar2);\n    }\n    __s[sVar2 - 2] = '\0';\n  }" { (if_statement "if (param_2 != 2) {\n      if (param_2 != 0) goto LAB_0001552a;\n      FUN_00053230(param_3,local_120,0x100);\n      iVar1 = FUN_000532c0(param_3);\n      if (iVar1 == 0) {\n        __s = (char *)FUN_0001b990("Connecting to %s",local_120);\n      }\n      else {\n        __s = (char *)FUN_0001b990("Connecting to %s port %d",local_120,param_4);\n      }\n      goto LAB_00015581;\n    }" if (parenthesized_expression "(param_2 != 2)" ( (binary_expression "param_2 != 2" identifier != number_literal) )) (compound_statement "{\n      if (param_2 != 0) goto LAB_0001552a;\n      FUN_00053230(param_3,local_120,0x100);\n      iVar1 = FUN_000532c0(param_3);\n      if (iVar1 == 0) {\n        __s = (char *)FUN_0001b990("Connecting to %s",local_120);\n      }\n      else {\n        __s = (char *)FUN_0001b990("Connecting to %s port %d",local_120,param_4);\n      }\n      goto LAB_00015581;\n    }" { (if_statement "if (param_2 != 0) goto LAB_0001552a;" if (parenthesized_expression "(param_2 != 0)" ( (binary_expression "param_2 != 0" identifier != number_literal) )) (goto_statement "goto LAB_0001552a;" goto statement_identifier ;)) (expression_statement "FUN_00053230(param_3,local_120,0x100);" (call_expression "FUN_00053230(param_3,local_120,0x100)" identifier (argument_list "(param_3,local_120,0x100)" ( identifier , identifier , number_literal ))) ;) (expression_statement "iVar1 = FUN_000532c0(param_3);" (assignment_expression "iVar1 = FUN_000532c0(param_3)" identifier = (call_expression "FUN_000532c0(param_3)" identifier (argument_list "(param_3)" ( identifier )))) ;) (if_statement "if (iVar1 == 0) {\n        __s = (char *)FUN_0001b990("Connecting to %s",local_120);\n      }\n      else {\n        __s = (char *)FUN_0001b990("Connecting to %s port %d",local_120,param_4);\n      }" if (parenthesized_expression "(iVar1 == 0)" ( (binary_expression "iVar1 == 0" identifier == number_literal) )) (compound_statement "{\n        __s = (char *)FUN_0001b990("Connecting to %s",local_120);\n      }" { (expression_statement "__s = (char *)FUN_0001b990("Connecting to %s",local_120);" (assignment_expression "__s = (char *)FUN_0001b990("Connecting to %s",local_120)" identifier = (cast_expression "(char *)FUN_0001b990("Connecting to %s",local_120)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "FUN_0001b990("Connecting to %s",local_120)" identifier (argument_list "("Connecting to %s",local_120)" ( (string_literal ""Connecting to %s"" " string_content ") , identifier ))))) ;) }) (else_clause "else {\n        __s = (char *)FUN_0001b990("Connecting to %s port %d",local_120,param_4);\n      }" else (compound_statement "{\n        __s = (char *)FUN_0001b990("Connecting to %s port %d",local_120,param_4);\n      }" { (expression_statement "__s = (char *)FUN_0001b990("Connecting to %s port %d",local_120,param_4);" (assignment_expression "__s = (char *)FUN_0001b990("Connecting to %s port %d",local_120,param_4)" identifier = (cast_expression "(char *)FUN_0001b990("Connecting to %s port %d",local_120,param_4)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "FUN_0001b990("Connecting to %s port %d",local_120,param_4)" identifier (argument_list "("Connecting to %s port %d",local_120,param_4)" ( (string_literal ""Connecting to %s port %d"" " string_content ") , identifier , identifier ))))) ;) }))) (goto_statement "goto LAB_00015581;" goto statement_identifier ;) })) (expression_statement "__s = (char *)FUN_0001b990(&DAT_0005d07a,param_5);" (assignment_expression "__s = (char *)FUN_0001b990(&DAT_0005d07a,param_5)" identifier = (cast_expression "(char *)FUN_0001b990(&DAT_0005d07a,param_5)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "FUN_0001b990(&DAT_0005d07a,param_5)" identifier (argument_list "(&DAT_0005d07a,param_5)" ( (pointer_expression "&DAT_0005d07a" & identifier) , identifier ))))) ;) (expression_statement "sVar2 = strlen(__s);" (assignment_expression "sVar2 = strlen(__s)" identifier = (call_expression "strlen(__s)" identifier (argument_list "(__s)" ( identifier )))) ;) (if_statement "if (sVar2 < 2) {\n                    /* WARNING: Subroutine does not return */\n      __assert_fail("len >= 2","be_misc.c",0x28,"backend_socket_log");\n    }" if (parenthesized_expression "(sVar2 < 2)" ( (binary_expression "sVar2 < 2" identifier < number_literal) )) (compound_statement "{\n                    /* WARNING: Subroutine does not return */\n      __assert_fail("len >= 2","be_misc.c",0x28,"backend_socket_log");\n    }" { comment (expression_statement "__assert_fail("len >= 2","be_misc.c",0x28,"backend_socket_log");" (call_expression "__assert_fail("len >= 2","be_misc.c",0x28,"backend_socket_log")" identifier (argument_list "("len >= 2","be_misc.c",0x28,"backend_socket_log")" ( (string_literal ""len >= 2"" " string_content ") , (string_literal ""be_misc.c"" " string_content ") , number_literal , (string_literal ""backend_socket_log"" " string_content ") ))) ;) })) (expression_statement "uVar3 = FUN_00019350(param_7,0x13);" (assignment_expression "uVar3 = FUN_00019350(param_7,0x13)" identifier = (call_expression "FUN_00019350(param_7,0x13)" identifier (argument_list "(param_7,0x13)" ( identifier , number_literal )))) ;) (if_statement "if (uVar3 == 2) {\n      uVar3 = (uint)(param_8 != 0);\n    }" if (parenthesized_expression "(uVar3 == 2)" ( (binary_expression "uVar3 == 2" identifier == number_literal) )) (compound_statement "{\n      uVar3 = (uint)(param_8 != 0);\n    }" { (expression_statement "uVar3 = (uint)(param_8 != 0);" (assignment_expression "uVar3 = (uint)(param_8 != 0)" identifier = (call_expression "(uint)(param_8 != 0)" (parenthesized_expression "(uint)" ( identifier )) (argument_list "(param_8 != 0)" ( (binary_expression "param_8 != 0" identifier != number_literal) )))) ;) })) (if_statement "if (uVar3 == 0) {\n      FUN_000556e0(param_1,1,__s,sVar2);\n    }" if (parenthesized_expression "(uVar3 == 0)" ( (binary_expression "uVar3 == 0" identifier == number_literal) )) (compound_statement "{\n      FUN_000556e0(param_1,1,__s,sVar2);\n    }" { (expression_statement "FUN_000556e0(param_1,1,__s,sVar2);" (call_expression "FUN_000556e0(param_1,1,__s,sVar2)" identifier (argument_list "(param_1,1,__s,sVar2)" ( identifier , number_literal , identifier , identifier ))) ;) })) (expression_statement "__s[sVar2 - 2] = '\0';" (assignment_expression "__s[sVar2 - 2] = '\0'" (subscript_expression "__s[sVar2 - 2]" identifier [ (binary_expression "sVar2 - 2" identifier - number_literal) ]) = (char_literal "'\0'" ' escape_sequence ')) ;) }))) (expression_statement "FUN_000513d0(param_1,__s);" (call_expression "FUN_000513d0(param_1,__s)" identifier (argument_list "(param_1,__s)" ( identifier , identifier ))) ;) (expression_statement "FUN_0001c820(__s);" (call_expression "FUN_0001c820(__s)" identifier (argument_list "(__s)" ( identifier ))) ;) (labeled_statement "LAB_0001552a:\n  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return;\n  }" statement_identifier : (if_statement "if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return;\n  }" if (parenthesized_expression "(local_20 == *(int *)(in_GS_OFFSET + 0x14))" ( (binary_expression "local_20 == *(int *)(in_GS_OFFSET + 0x14)" identifier == (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" * (cast_expression "(int *)(in_GS_OFFSET + 0x14)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_GS_OFFSET + 0x14)" ( (binary_expression "in_GS_OFFSET + 0x14" identifier + number_literal) ))))) )) (compound_statement "{\n    return;\n  }" { (return_statement "return;" return ;) }))) comment (expression_statement "FUN_0005c110();" (call_expression "FUN_0005c110()" identifier (argument_list "()" ( ))) ;) })))
(translation_unit "/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n/* WARNING: Unknown calling convention */\n/* WARNING: Enum "anon_enum_32": Some values do not have unique names */\n\nvoid backend_socket_log(void *frontend,int type,SockAddr addr,int port,char *error_msg,\n                       int error_code,Conf *conf,int session_started)\n\n{\n  int iVar1;\n  int iVar2;\n  char *__s;\n  size_t datalen;\n  uint uVar3;\n  int in_GS_OFFSET;\n  char addrbuf [256];\n  \n  iVar1 = *(int *)(in_GS_OFFSET + 0x14);\n  if (type == 1) {\n    sk_getaddr(addr,addrbuf,0x100);\n    __s = dupprintf("Failed to connect to %s: %s",addrbuf,error_msg);\nLAB_00015581:\n    if (__s == (char *)0x0) goto LAB_0001552a;\n  }\n  else {\n    if (type != 2) {\n      if (type != 0) goto LAB_0001552a;\n      sk_getaddr(addr,addrbuf,0x100);\n      iVar2 = sk_addr_needs_port(addr);\n      if (iVar2 == 0) {\n        __s = dupprintf("Connecting to %s",addrbuf);\n      }\n      else {\n        __s = dupprintf("Connecting to %s port %d",addrbuf,port);\n      }\n      goto LAB_00015581;\n    }\n    __s = dupprintf("%s\r\n",error_msg);\n    datalen = strlen(__s);\n    if (datalen < 2) {\n                    /* WARNING: Subroutine does not return */\n      __assert_fail("len >= 2","be_misc.c",0x28,"backend_socket_log");\n    }\n    uVar3 = conf_get_int(conf,0x13);\n    if (uVar3 == 2) {\n      uVar3 = (uint)(session_started != 0);\n    }\n    if (uVar3 == 0) {\n      from_backend(frontend,1,__s,datalen);\n    }\n    __s[datalen - 2] = '\0';\n  }\n  logevent(frontend,__s);\n  safefree(__s);\nLAB_0001552a:\n  if (iVar1 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return;\n  }\n                    /* WARNING: Subroutine does not return */\n  __stack_chk_fail_local();\n}\n\n" comment comment comment (function_definition "void backend_socket_log(void *frontend,int type,SockAddr addr,int port,char *error_msg,\n                       int error_code,Conf *conf,int session_started)\n\n{\n  int iVar1;\n  int iVar2;\n  char *__s;\n  size_t datalen;\n  uint uVar3;\n  int in_GS_OFFSET;\n  char addrbuf [256];\n  \n  iVar1 = *(int *)(in_GS_OFFSET + 0x14);\n  if (type == 1) {\n    sk_getaddr(addr,addrbuf,0x100);\n    __s = dupprintf("Failed to connect to %s: %s",addrbuf,error_msg);\nLAB_00015581:\n    if (__s == (char *)0x0) goto LAB_0001552a;\n  }\n  else {\n    if (type != 2) {\n      if (type != 0) goto LAB_0001552a;\n      sk_getaddr(addr,addrbuf,0x100);\n      iVar2 = sk_addr_needs_port(addr);\n      if (iVar2 == 0) {\n        __s = dupprintf("Connecting to %s",addrbuf);\n      }\n      else {\n        __s = dupprintf("Connecting to %s port %d",addrbuf,port);\n      }\n      goto LAB_00015581;\n    }\n    __s = dupprintf("%s\r\n",error_msg);\n    datalen = strlen(__s);\n    if (datalen < 2) {\n                    /* WARNING: Subroutine does not return */\n      __assert_fail("len >= 2","be_misc.c",0x28,"backend_socket_log");\n    }\n    uVar3 = conf_get_int(conf,0x13);\n    if (uVar3 == 2) {\n      uVar3 = (uint)(session_started != 0);\n    }\n    if (uVar3 == 0) {\n      from_backend(frontend,1,__s,datalen);\n    }\n    __s[datalen - 2] = '\0';\n  }\n  logevent(frontend,__s);\n  safefree(__s);\nLAB_0001552a:\n  if (iVar1 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return;\n  }\n                    /* WARNING: Subroutine does not return */\n  __stack_chk_fail_local();\n}" primitive_type (function_declarator "backend_socket_log(void *frontend,int type,SockAddr addr,int port,char *error_msg,\n                       int error_code,Conf *conf,int session_started)" identifier (parameter_list "(void *frontend,int type,SockAddr addr,int port,char *error_msg,\n                       int error_code,Conf *conf,int session_started)" ( (parameter_declaration "void *frontend" primitive_type (pointer_declarator "*frontend" * identifier)) , (parameter_declaration "int type" primitive_type identifier) , (parameter_declaration "SockAddr addr" type_identifier identifier) , (parameter_declaration "int port" primitive_type identifier) , (parameter_declaration "char *error_msg" primitive_type (pointer_declarator "*error_msg" * identifier)) , (parameter_declaration "int error_code" primitive_type identifier) , (parameter_declaration "Conf *conf" type_identifier (pointer_declarator "*conf" * identifier)) , (parameter_declaration "int session_started" primitive_type identifier) ))) (compound_statement "{\n  int iVar1;\n  int iVar2;\n  char *__s;\n  size_t datalen;\n  uint uVar3;\n  int in_GS_OFFSET;\n  char addrbuf [256];\n  \n  iVar1 = *(int *)(in_GS_OFFSET + 0x14);\n  if (type == 1) {\n    sk_getaddr(addr,addrbuf,0x100);\n    __s = dupprintf("Failed to connect to %s: %s",addrbuf,error_msg);\nLAB_00015581:\n    if (__s == (char *)0x0) goto LAB_0001552a;\n  }\n  else {\n    if (type != 2) {\n      if (type != 0) goto LAB_0001552a;\n      sk_getaddr(addr,addrbuf,0x100);\n      iVar2 = sk_addr_needs_port(addr);\n      if (iVar2 == 0) {\n        __s = dupprintf("Connecting to %s",addrbuf);\n      }\n      else {\n        __s = dupprintf("Connecting to %s port %d",addrbuf,port);\n      }\n      goto LAB_00015581;\n    }\n    __s = dupprintf("%s\r\n",error_msg);\n    datalen = strlen(__s);\n    if (datalen < 2) {\n                    /* WARNING: Subroutine does not return */\n      __assert_fail("len >= 2","be_misc.c",0x28,"backend_socket_log");\n    }\n    uVar3 = conf_get_int(conf,0x13);\n    if (uVar3 == 2) {\n      uVar3 = (uint)(session_started != 0);\n    }\n    if (uVar3 == 0) {\n      from_backend(frontend,1,__s,datalen);\n    }\n    __s[datalen - 2] = '\0';\n  }\n  logevent(frontend,__s);\n  safefree(__s);\nLAB_0001552a:\n  if (iVar1 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return;\n  }\n                    /* WARNING: Subroutine does not return */\n  __stack_chk_fail_local();\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "char *__s;" primitive_type (pointer_declarator "*__s" * identifier) ;) (declaration "size_t datalen;" primitive_type identifier ;) (declaration "uint uVar3;" type_identifier identifier ;) (declaration "int in_GS_OFFSET;" primitive_type identifier ;) (declaration "char addrbuf [256];" primitive_type (array_declarator "addrbuf [256]" identifier [ number_literal ]) ;) (expression_statement "iVar1 = *(int *)(in_GS_OFFSET + 0x14);" (assignment_expression "iVar1 = *(int *)(in_GS_OFFSET + 0x14)" identifier = (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" * (cast_expression "(int *)(in_GS_OFFSET + 0x14)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_GS_OFFSET + 0x14)" ( (binary_expression "in_GS_OFFSET + 0x14" identifier + number_literal) ))))) ;) (if_statement "if (type == 1) {\n    sk_getaddr(addr,addrbuf,0x100);\n    __s = dupprintf("Failed to connect to %s: %s",addrbuf,error_msg);\nLAB_00015581:\n    if (__s == (char *)0x0) goto LAB_0001552a;\n  }\n  else {\n    if (type != 2) {\n      if (type != 0) goto LAB_0001552a;\n      sk_getaddr(addr,addrbuf,0x100);\n      iVar2 = sk_addr_needs_port(addr);\n      if (iVar2 == 0) {\n        __s = dupprintf("Connecting to %s",addrbuf);\n      }\n      else {\n        __s = dupprintf("Connecting to %s port %d",addrbuf,port);\n      }\n      goto LAB_00015581;\n    }\n    __s = dupprintf("%s\r\n",error_msg);\n    datalen = strlen(__s);\n    if (datalen < 2) {\n                    /* WARNING: Subroutine does not return */\n      __assert_fail("len >= 2","be_misc.c",0x28,"backend_socket_log");\n    }\n    uVar3 = conf_get_int(conf,0x13);\n    if (uVar3 == 2) {\n      uVar3 = (uint)(session_started != 0);\n    }\n    if (uVar3 == 0) {\n      from_backend(frontend,1,__s,datalen);\n    }\n    __s[datalen - 2] = '\0';\n  }" if (parenthesized_expression "(type == 1)" ( (binary_expression "type == 1" identifier == number_literal) )) (compound_statement "{\n    sk_getaddr(addr,addrbuf,0x100);\n    __s = dupprintf("Failed to connect to %s: %s",addrbuf,error_msg);\nLAB_00015581:\n    if (__s == (char *)0x0) goto LAB_0001552a;\n  }" { (expression_statement "sk_getaddr(addr,addrbuf,0x100);" (call_expression "sk_getaddr(addr,addrbuf,0x100)" identifier (argument_list "(addr,addrbuf,0x100)" ( identifier , identifier , number_literal ))) ;) (expression_statement "__s = dupprintf("Failed to connect to %s: %s",addrbuf,error_msg);" (assignment_expression "__s = dupprintf("Failed to connect to %s: %s",addrbuf,error_msg)" identifier = (call_expression "dupprintf("Failed to connect to %s: %s",addrbuf,error_msg)" identifier (argument_list "("Failed to connect to %s: %s",addrbuf,error_msg)" ( (string_literal ""Failed to connect to %s: %s"" " string_content ") , identifier , identifier )))) ;) (labeled_statement "LAB_00015581:\n    if (__s == (char *)0x0) goto LAB_0001552a;" statement_identifier : (if_statement "if (__s == (char *)0x0) goto LAB_0001552a;" if (parenthesized_expression "(__s == (char *)0x0)" ( (binary_expression "__s == (char *)0x0" identifier == (cast_expression "(char *)0x0" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) )) (goto_statement "goto LAB_0001552a;" goto statement_identifier ;))) }) (else_clause "else {\n    if (type != 2) {\n      if (type != 0) goto LAB_0001552a;\n      sk_getaddr(addr,addrbuf,0x100);\n      iVar2 = sk_addr_needs_port(addr);\n      if (iVar2 == 0) {\n        __s = dupprintf("Connecting to %s",addrbuf);\n      }\n      else {\n        __s = dupprintf("Connecting to %s port %d",addrbuf,port);\n      }\n      goto LAB_00015581;\n    }\n    __s = dupprintf("%s\r\n",error_msg);\n    datalen = strlen(__s);\n    if (datalen < 2) {\n                    /* WARNING: Subroutine does not return */\n      __assert_fail("len >= 2","be_misc.c",0x28,"backend_socket_log");\n    }\n    uVar3 = conf_get_int(conf,0x13);\n    if (uVar3 == 2) {\n      uVar3 = (uint)(session_started != 0);\n    }\n    if (uVar3 == 0) {\n      from_backend(frontend,1,__s,datalen);\n    }\n    __s[datalen - 2] = '\0';\n  }" else (compound_statement "{\n    if (type != 2) {\n      if (type != 0) goto LAB_0001552a;\n      sk_getaddr(addr,addrbuf,0x100);\n      iVar2 = sk_addr_needs_port(addr);\n      if (iVar2 == 0) {\n        __s = dupprintf("Connecting to %s",addrbuf);\n      }\n      else {\n        __s = dupprintf("Connecting to %s port %d",addrbuf,port);\n      }\n      goto LAB_00015581;\n    }\n    __s = dupprintf("%s\r\n",error_msg);\n    datalen = strlen(__s);\n    if (datalen < 2) {\n                    /* WARNING: Subroutine does not return */\n      __assert_fail("len >= 2","be_misc.c",0x28,"backend_socket_log");\n    }\n    uVar3 = conf_get_int(conf,0x13);\n    if (uVar3 == 2) {\n      uVar3 = (uint)(session_started != 0);\n    }\n    if (uVar3 == 0) {\n      from_backend(frontend,1,__s,datalen);\n    }\n    __s[datalen - 2] = '\0';\n  }" { (if_statement "if (type != 2) {\n      if (type != 0) goto LAB_0001552a;\n      sk_getaddr(addr,addrbuf,0x100);\n      iVar2 = sk_addr_needs_port(addr);\n      if (iVar2 == 0) {\n        __s = dupprintf("Connecting to %s",addrbuf);\n      }\n      else {\n        __s = dupprintf("Connecting to %s port %d",addrbuf,port);\n      }\n      goto LAB_00015581;\n    }" if (parenthesized_expression "(type != 2)" ( (binary_expression "type != 2" identifier != number_literal) )) (compound_statement "{\n      if (type != 0) goto LAB_0001552a;\n      sk_getaddr(addr,addrbuf,0x100);\n      iVar2 = sk_addr_needs_port(addr);\n      if (iVar2 == 0) {\n        __s = dupprintf("Connecting to %s",addrbuf);\n      }\n      else {\n        __s = dupprintf("Connecting to %s port %d",addrbuf,port);\n      }\n      goto LAB_00015581;\n    }" { (if_statement "if (type != 0) goto LAB_0001552a;" if (parenthesized_expression "(type != 0)" ( (binary_expression "type != 0" identifier != number_literal) )) (goto_statement "goto LAB_0001552a;" goto statement_identifier ;)) (expression_statement "sk_getaddr(addr,addrbuf,0x100);" (call_expression "sk_getaddr(addr,addrbuf,0x100)" identifier (argument_list "(addr,addrbuf,0x100)" ( identifier , identifier , number_literal ))) ;) (expression_statement "iVar2 = sk_addr_needs_port(addr);" (assignment_expression "iVar2 = sk_addr_needs_port(addr)" identifier = (call_expression "sk_addr_needs_port(addr)" identifier (argument_list "(addr)" ( identifier )))) ;) (if_statement "if (iVar2 == 0) {\n        __s = dupprintf("Connecting to %s",addrbuf);\n      }\n      else {\n        __s = dupprintf("Connecting to %s port %d",addrbuf,port);\n      }" if (parenthesized_expression "(iVar2 == 0)" ( (binary_expression "iVar2 == 0" identifier == number_literal) )) (compound_statement "{\n        __s = dupprintf("Connecting to %s",addrbuf);\n      }" { (expression_statement "__s = dupprintf("Connecting to %s",addrbuf);" (assignment_expression "__s = dupprintf("Connecting to %s",addrbuf)" identifier = (call_expression "dupprintf("Connecting to %s",addrbuf)" identifier (argument_list "("Connecting to %s",addrbuf)" ( (string_literal ""Connecting to %s"" " string_content ") , identifier )))) ;) }) (else_clause "else {\n        __s = dupprintf("Connecting to %s port %d",addrbuf,port);\n      }" else (compound_statement "{\n        __s = dupprintf("Connecting to %s port %d",addrbuf,port);\n      }" { (expression_statement "__s = dupprintf("Connecting to %s port %d",addrbuf,port);" (assignment_expression "__s = dupprintf("Connecting to %s port %d",addrbuf,port)" identifier = (call_expression "dupprintf("Connecting to %s port %d",addrbuf,port)" identifier (argument_list "("Connecting to %s port %d",addrbuf,port)" ( (string_literal ""Connecting to %s port %d"" " string_content ") , identifier , identifier )))) ;) }))) (goto_statement "goto LAB_00015581;" goto statement_identifier ;) })) (expression_statement "__s = dupprintf("%s\r\n",error_msg);" (assignment_expression "__s = dupprintf("%s\r\n",error_msg)" identifier = (call_expression "dupprintf("%s\r\n",error_msg)" identifier (argument_list "("%s\r\n",error_msg)" ( (string_literal ""%s\r\n"" " string_content escape_sequence escape_sequence ") , identifier )))) ;) (expression_statement "datalen = strlen(__s);" (assignment_expression "datalen = strlen(__s)" identifier = (call_expression "strlen(__s)" identifier (argument_list "(__s)" ( identifier )))) ;) (if_statement "if (datalen < 2) {\n                    /* WARNING: Subroutine does not return */\n      __assert_fail("len >= 2","be_misc.c",0x28,"backend_socket_log");\n    }" if (parenthesized_expression "(datalen < 2)" ( (binary_expression "datalen < 2" identifier < number_literal) )) (compound_statement "{\n                    /* WARNING: Subroutine does not return */\n      __assert_fail("len >= 2","be_misc.c",0x28,"backend_socket_log");\n    }" { comment (expression_statement "__assert_fail("len >= 2","be_misc.c",0x28,"backend_socket_log");" (call_expression "__assert_fail("len >= 2","be_misc.c",0x28,"backend_socket_log")" identifier (argument_list "("len >= 2","be_misc.c",0x28,"backend_socket_log")" ( (string_literal ""len >= 2"" " string_content ") , (string_literal ""be_misc.c"" " string_content ") , number_literal , (string_literal ""backend_socket_log"" " string_content ") ))) ;) })) (expression_statement "uVar3 = conf_get_int(conf,0x13);" (assignment_expression "uVar3 = conf_get_int(conf,0x13)" identifier = (call_expression "conf_get_int(conf,0x13)" identifier (argument_list "(conf,0x13)" ( identifier , number_literal )))) ;) (if_statement "if (uVar3 == 2) {\n      uVar3 = (uint)(session_started != 0);\n    }" if (parenthesized_expression "(uVar3 == 2)" ( (binary_expression "uVar3 == 2" identifier == number_literal) )) (compound_statement "{\n      uVar3 = (uint)(session_started != 0);\n    }" { (expression_statement "uVar3 = (uint)(session_started != 0);" (assignment_expression "uVar3 = (uint)(session_started != 0)" identifier = (call_expression "(uint)(session_started != 0)" (parenthesized_expression "(uint)" ( identifier )) (argument_list "(session_started != 0)" ( (binary_expression "session_started != 0" identifier != number_literal) )))) ;) })) (if_statement "if (uVar3 == 0) {\n      from_backend(frontend,1,__s,datalen);\n    }" if (parenthesized_expression "(uVar3 == 0)" ( (binary_expression "uVar3 == 0" identifier == number_literal) )) (compound_statement "{\n      from_backend(frontend,1,__s,datalen);\n    }" { (expression_statement "from_backend(frontend,1,__s,datalen);" (call_expression "from_backend(frontend,1,__s,datalen)" identifier (argument_list "(frontend,1,__s,datalen)" ( identifier , number_literal , identifier , identifier ))) ;) })) (expression_statement "__s[datalen - 2] = '\0';" (assignment_expression "__s[datalen - 2] = '\0'" (subscript_expression "__s[datalen - 2]" identifier [ (binary_expression "datalen - 2" identifier - number_literal) ]) = (char_literal "'\0'" ' escape_sequence ')) ;) }))) (expression_statement "logevent(frontend,__s);" (call_expression "logevent(frontend,__s)" identifier (argument_list "(frontend,__s)" ( identifier , identifier ))) ;) (expression_statement "safefree(__s);" (call_expression "safefree(__s)" identifier (argument_list "(__s)" ( identifier ))) ;) (labeled_statement "LAB_0001552a:\n  if (iVar1 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return;\n  }" statement_identifier : (if_statement "if (iVar1 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return;\n  }" if (parenthesized_expression "(iVar1 == *(int *)(in_GS_OFFSET + 0x14))" ( (binary_expression "iVar1 == *(int *)(in_GS_OFFSET + 0x14)" identifier == (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" * (cast_expression "(int *)(in_GS_OFFSET + 0x14)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_GS_OFFSET + 0x14)" ( (binary_expression "in_GS_OFFSET + 0x14" identifier + number_literal) ))))) )) (compound_statement "{\n    return;\n  }" { (return_statement "return;" return ;) }))) comment (expression_statement "__stack_chk_fail_local();" (call_expression "__stack_chk_fail_local()" identifier (argument_list "()" ( ))) ;) })))
(translation_unit "void FUN_000154d0(undefined4 param_1,int param_2,undefined4 param_3,undefined4 param_4,\n                 undefined4 param_5,undefined4 param_6,undefined4 param_7,int param_8)\n\n{\n  int iVar1;\n  char *__s;\n  size_t sVar2;\n  uint uVar3;\n  int in_GS_OFFSET;\n  undefined1 local_120 [256];\n  int local_20;\n  undefined4 uStack_14;\n  \n  uStack_14 = 0x154d9;\n  local_20 = *(int *)(in_GS_OFFSET + 0x14);\n  if (param_2 == 1) {\n    FUN_00053230(param_3,local_120,0x100);\n    __s = (char *)FUN_0001b990("Failed to connect to %s: %s",local_120,param_5);\nLAB_00015581:\n    if (__s == (char *)0x0) goto LAB_0001552a;\n  }\n  else {\n    if (param_2 != 2) {\n      if (param_2 != 0) goto LAB_0001552a;\n      FUN_00053230(param_3,local_120,0x100);\n      iVar1 = FUN_000532c0(param_3);\n      if (iVar1 == 0) {\n        __s = (char *)FUN_0001b990("Connecting to %s",local_120);\n      }\n      else {\n        __s = (char *)FUN_0001b990("Connecting to %s port %d",local_120,param_4);\n      }\n      goto LAB_00015581;\n    }\n    __s = (char *)FUN_0001b990(&DAT_0005d07a,param_5);\n    sVar2 = strlen(__s);\n    if (sVar2 < 2) {\n                    \n      __assert_fail("len >= 2","be_misc.c",0x28,"backend_socket_log");\n    }\n    uVar3 = FUN_00019350(param_7,0x13);\n    if (uVar3 == 2) {\n      uVar3 = (uint)(param_8 != 0);\n    }\n    if (uVar3 == 0) {\n      FUN_000556e0(param_1,1,__s,sVar2);\n    }\n    __s[sVar2 - 2] = '\0';\n  }\n  FUN_000513d0(param_1,__s);\n  FUN_0001c820(__s);\nLAB_0001552a:\n  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return;\n  }\n                    \n  FUN_0005c110();\n}\n\n" (function_definition "void FUN_000154d0(undefined4 param_1,int param_2,undefined4 param_3,undefined4 param_4,\n                 undefined4 param_5,undefined4 param_6,undefined4 param_7,int param_8)\n\n{\n  int iVar1;\n  char *__s;\n  size_t sVar2;\n  uint uVar3;\n  int in_GS_OFFSET;\n  undefined1 local_120 [256];\n  int local_20;\n  undefined4 uStack_14;\n  \n  uStack_14 = 0x154d9;\n  local_20 = *(int *)(in_GS_OFFSET + 0x14);\n  if (param_2 == 1) {\n    FUN_00053230(param_3,local_120,0x100);\n    __s = (char *)FUN_0001b990("Failed to connect to %s: %s",local_120,param_5);\nLAB_00015581:\n    if (__s == (char *)0x0) goto LAB_0001552a;\n  }\n  else {\n    if (param_2 != 2) {\n      if (param_2 != 0) goto LAB_0001552a;\n      FUN_00053230(param_3,local_120,0x100);\n      iVar1 = FUN_000532c0(param_3);\n      if (iVar1 == 0) {\n        __s = (char *)FUN_0001b990("Connecting to %s",local_120);\n      }\n      else {\n        __s = (char *)FUN_0001b990("Connecting to %s port %d",local_120,param_4);\n      }\n      goto LAB_00015581;\n    }\n    __s = (char *)FUN_0001b990(&DAT_0005d07a,param_5);\n    sVar2 = strlen(__s);\n    if (sVar2 < 2) {\n                    \n      __assert_fail("len >= 2","be_misc.c",0x28,"backend_socket_log");\n    }\n    uVar3 = FUN_00019350(param_7,0x13);\n    if (uVar3 == 2) {\n      uVar3 = (uint)(param_8 != 0);\n    }\n    if (uVar3 == 0) {\n      FUN_000556e0(param_1,1,__s,sVar2);\n    }\n    __s[sVar2 - 2] = '\0';\n  }\n  FUN_000513d0(param_1,__s);\n  FUN_0001c820(__s);\nLAB_0001552a:\n  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return;\n  }\n                    \n  FUN_0005c110();\n}" primitive_type (function_declarator "FUN_000154d0(undefined4 param_1,int param_2,undefined4 param_3,undefined4 param_4,\n                 undefined4 param_5,undefined4 param_6,undefined4 param_7,int param_8)" identifier (parameter_list "(undefined4 param_1,int param_2,undefined4 param_3,undefined4 param_4,\n                 undefined4 param_5,undefined4 param_6,undefined4 param_7,int param_8)" ( (parameter_declaration "undefined4 param_1" type_identifier identifier) , (parameter_declaration "int param_2" primitive_type identifier) , (parameter_declaration "undefined4 param_3" type_identifier identifier) , (parameter_declaration "undefined4 param_4" type_identifier identifier) , (parameter_declaration "undefined4 param_5" type_identifier identifier) , (parameter_declaration "undefined4 param_6" type_identifier identifier) , (parameter_declaration "undefined4 param_7" type_identifier identifier) , (parameter_declaration "int param_8" primitive_type identifier) ))) (compound_statement "{\n  int iVar1;\n  char *__s;\n  size_t sVar2;\n  uint uVar3;\n  int in_GS_OFFSET;\n  undefined1 local_120 [256];\n  int local_20;\n  undefined4 uStack_14;\n  \n  uStack_14 = 0x154d9;\n  local_20 = *(int *)(in_GS_OFFSET + 0x14);\n  if (param_2 == 1) {\n    FUN_00053230(param_3,local_120,0x100);\n    __s = (char *)FUN_0001b990("Failed to connect to %s: %s",local_120,param_5);\nLAB_00015581:\n    if (__s == (char *)0x0) goto LAB_0001552a;\n  }\n  else {\n    if (param_2 != 2) {\n      if (param_2 != 0) goto LAB_0001552a;\n      FUN_00053230(param_3,local_120,0x100);\n      iVar1 = FUN_000532c0(param_3);\n      if (iVar1 == 0) {\n        __s = (char *)FUN_0001b990("Connecting to %s",local_120);\n      }\n      else {\n        __s = (char *)FUN_0001b990("Connecting to %s port %d",local_120,param_4);\n      }\n      goto LAB_00015581;\n    }\n    __s = (char *)FUN_0001b990(&DAT_0005d07a,param_5);\n    sVar2 = strlen(__s);\n    if (sVar2 < 2) {\n                    \n      __assert_fail("len >= 2","be_misc.c",0x28,"backend_socket_log");\n    }\n    uVar3 = FUN_00019350(param_7,0x13);\n    if (uVar3 == 2) {\n      uVar3 = (uint)(param_8 != 0);\n    }\n    if (uVar3 == 0) {\n      FUN_000556e0(param_1,1,__s,sVar2);\n    }\n    __s[sVar2 - 2] = '\0';\n  }\n  FUN_000513d0(param_1,__s);\n  FUN_0001c820(__s);\nLAB_0001552a:\n  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return;\n  }\n                    \n  FUN_0005c110();\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "char *__s;" primitive_type (pointer_declarator "*__s" * identifier) ;) (declaration "size_t sVar2;" primitive_type identifier ;) (declaration "uint uVar3;" type_identifier identifier ;) (declaration "int in_GS_OFFSET;" primitive_type identifier ;) (declaration "undefined1 local_120 [256];" type_identifier (array_declarator "local_120 [256]" identifier [ number_literal ]) ;) (declaration "int local_20;" primitive_type identifier ;) (declaration "undefined4 uStack_14;" type_identifier identifier ;) (expression_statement "uStack_14 = 0x154d9;" (assignment_expression "uStack_14 = 0x154d9" identifier = number_literal) ;) (expression_statement "local_20 = *(int *)(in_GS_OFFSET + 0x14);" (assignment_expression "local_20 = *(int *)(in_GS_OFFSET + 0x14)" identifier = (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" * (cast_expression "(int *)(in_GS_OFFSET + 0x14)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_GS_OFFSET + 0x14)" ( (binary_expression "in_GS_OFFSET + 0x14" identifier + number_literal) ))))) ;) (if_statement "if (param_2 == 1) {\n    FUN_00053230(param_3,local_120,0x100);\n    __s = (char *)FUN_0001b990("Failed to connect to %s: %s",local_120,param_5);\nLAB_00015581:\n    if (__s == (char *)0x0) goto LAB_0001552a;\n  }\n  else {\n    if (param_2 != 2) {\n      if (param_2 != 0) goto LAB_0001552a;\n      FUN_00053230(param_3,local_120,0x100);\n      iVar1 = FUN_000532c0(param_3);\n      if (iVar1 == 0) {\n        __s = (char *)FUN_0001b990("Connecting to %s",local_120);\n      }\n      else {\n        __s = (char *)FUN_0001b990("Connecting to %s port %d",local_120,param_4);\n      }\n      goto LAB_00015581;\n    }\n    __s = (char *)FUN_0001b990(&DAT_0005d07a,param_5);\n    sVar2 = strlen(__s);\n    if (sVar2 < 2) {\n                    \n      __assert_fail("len >= 2","be_misc.c",0x28,"backend_socket_log");\n    }\n    uVar3 = FUN_00019350(param_7,0x13);\n    if (uVar3 == 2) {\n      uVar3 = (uint)(param_8 != 0);\n    }\n    if (uVar3 == 0) {\n      FUN_000556e0(param_1,1,__s,sVar2);\n    }\n    __s[sVar2 - 2] = '\0';\n  }" if (parenthesized_expression "(param_2 == 1)" ( (binary_expression "param_2 == 1" identifier == number_literal) )) (compound_statement "{\n    FUN_00053230(param_3,local_120,0x100);\n    __s = (char *)FUN_0001b990("Failed to connect to %s: %s",local_120,param_5);\nLAB_00015581:\n    if (__s == (char *)0x0) goto LAB_0001552a;\n  }" { (expression_statement "FUN_00053230(param_3,local_120,0x100);" (call_expression "FUN_00053230(param_3,local_120,0x100)" identifier (argument_list "(param_3,local_120,0x100)" ( identifier , identifier , number_literal ))) ;) (expression_statement "__s = (char *)FUN_0001b990("Failed to connect to %s: %s",local_120,param_5);" (assignment_expression "__s = (char *)FUN_0001b990("Failed to connect to %s: %s",local_120,param_5)" identifier = (cast_expression "(char *)FUN_0001b990("Failed to connect to %s: %s",local_120,param_5)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "FUN_0001b990("Failed to connect to %s: %s",local_120,param_5)" identifier (argument_list "("Failed to connect to %s: %s",local_120,param_5)" ( (string_literal ""Failed to connect to %s: %s"" " string_content ") , identifier , identifier ))))) ;) (labeled_statement "LAB_00015581:\n    if (__s == (char *)0x0) goto LAB_0001552a;" statement_identifier : (if_statement "if (__s == (char *)0x0) goto LAB_0001552a;" if (parenthesized_expression "(__s == (char *)0x0)" ( (binary_expression "__s == (char *)0x0" identifier == (cast_expression "(char *)0x0" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) )) (goto_statement "goto LAB_0001552a;" goto statement_identifier ;))) }) (else_clause "else {\n    if (param_2 != 2) {\n      if (param_2 != 0) goto LAB_0001552a;\n      FUN_00053230(param_3,local_120,0x100);\n      iVar1 = FUN_000532c0(param_3);\n      if (iVar1 == 0) {\n        __s = (char *)FUN_0001b990("Connecting to %s",local_120);\n      }\n      else {\n        __s = (char *)FUN_0001b990("Connecting to %s port %d",local_120,param_4);\n      }\n      goto LAB_00015581;\n    }\n    __s = (char *)FUN_0001b990(&DAT_0005d07a,param_5);\n    sVar2 = strlen(__s);\n    if (sVar2 < 2) {\n                    \n      __assert_fail("len >= 2","be_misc.c",0x28,"backend_socket_log");\n    }\n    uVar3 = FUN_00019350(param_7,0x13);\n    if (uVar3 == 2) {\n      uVar3 = (uint)(param_8 != 0);\n    }\n    if (uVar3 == 0) {\n      FUN_000556e0(param_1,1,__s,sVar2);\n    }\n    __s[sVar2 - 2] = '\0';\n  }" else (compound_statement "{\n    if (param_2 != 2) {\n      if (param_2 != 0) goto LAB_0001552a;\n      FUN_00053230(param_3,local_120,0x100);\n      iVar1 = FUN_000532c0(param_3);\n      if (iVar1 == 0) {\n        __s = (char *)FUN_0001b990("Connecting to %s",local_120);\n      }\n      else {\n        __s = (char *)FUN_0001b990("Connecting to %s port %d",local_120,param_4);\n      }\n      goto LAB_00015581;\n    }\n    __s = (char *)FUN_0001b990(&DAT_0005d07a,param_5);\n    sVar2 = strlen(__s);\n    if (sVar2 < 2) {\n                    \n      __assert_fail("len >= 2","be_misc.c",0x28,"backend_socket_log");\n    }\n    uVar3 = FUN_00019350(param_7,0x13);\n    if (uVar3 == 2) {\n      uVar3 = (uint)(param_8 != 0);\n    }\n    if (uVar3 == 0) {\n      FUN_000556e0(param_1,1,__s,sVar2);\n    }\n    __s[sVar2 - 2] = '\0';\n  }" { (if_statement "if (param_2 != 2) {\n      if (param_2 != 0) goto LAB_0001552a;\n      FUN_00053230(param_3,local_120,0x100);\n      iVar1 = FUN_000532c0(param_3);\n      if (iVar1 == 0) {\n        __s = (char *)FUN_0001b990("Connecting to %s",local_120);\n      }\n      else {\n        __s = (char *)FUN_0001b990("Connecting to %s port %d",local_120,param_4);\n      }\n      goto LAB_00015581;\n    }" if (parenthesized_expression "(param_2 != 2)" ( (binary_expression "param_2 != 2" identifier != number_literal) )) (compound_statement "{\n      if (param_2 != 0) goto LAB_0001552a;\n      FUN_00053230(param_3,local_120,0x100);\n      iVar1 = FUN_000532c0(param_3);\n      if (iVar1 == 0) {\n        __s = (char *)FUN_0001b990("Connecting to %s",local_120);\n      }\n      else {\n        __s = (char *)FUN_0001b990("Connecting to %s port %d",local_120,param_4);\n      }\n      goto LAB_00015581;\n    }" { (if_statement "if (param_2 != 0) goto LAB_0001552a;" if (parenthesized_expression "(param_2 != 0)" ( (binary_expression "param_2 != 0" identifier != number_literal) )) (goto_statement "goto LAB_0001552a;" goto statement_identifier ;)) (expression_statement "FUN_00053230(param_3,local_120,0x100);" (call_expression "FUN_00053230(param_3,local_120,0x100)" identifier (argument_list "(param_3,local_120,0x100)" ( identifier , identifier , number_literal ))) ;) (expression_statement "iVar1 = FUN_000532c0(param_3);" (assignment_expression "iVar1 = FUN_000532c0(param_3)" identifier = (call_expression "FUN_000532c0(param_3)" identifier (argument_list "(param_3)" ( identifier )))) ;) (if_statement "if (iVar1 == 0) {\n        __s = (char *)FUN_0001b990("Connecting to %s",local_120);\n      }\n      else {\n        __s = (char *)FUN_0001b990("Connecting to %s port %d",local_120,param_4);\n      }" if (parenthesized_expression "(iVar1 == 0)" ( (binary_expression "iVar1 == 0" identifier == number_literal) )) (compound_statement "{\n        __s = (char *)FUN_0001b990("Connecting to %s",local_120);\n      }" { (expression_statement "__s = (char *)FUN_0001b990("Connecting to %s",local_120);" (assignment_expression "__s = (char *)FUN_0001b990("Connecting to %s",local_120)" identifier = (cast_expression "(char *)FUN_0001b990("Connecting to %s",local_120)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "FUN_0001b990("Connecting to %s",local_120)" identifier (argument_list "("Connecting to %s",local_120)" ( (string_literal ""Connecting to %s"" " string_content ") , identifier ))))) ;) }) (else_clause "else {\n        __s = (char *)FUN_0001b990("Connecting to %s port %d",local_120,param_4);\n      }" else (compound_statement "{\n        __s = (char *)FUN_0001b990("Connecting to %s port %d",local_120,param_4);\n      }" { (expression_statement "__s = (char *)FUN_0001b990("Connecting to %s port %d",local_120,param_4);" (assignment_expression "__s = (char *)FUN_0001b990("Connecting to %s port %d",local_120,param_4)" identifier = (cast_expression "(char *)FUN_0001b990("Connecting to %s port %d",local_120,param_4)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "FUN_0001b990("Connecting to %s port %d",local_120,param_4)" identifier (argument_list "("Connecting to %s port %d",local_120,param_4)" ( (string_literal ""Connecting to %s port %d"" " string_content ") , identifier , identifier ))))) ;) }))) (goto_statement "goto LAB_00015581;" goto statement_identifier ;) })) (expression_statement "__s = (char *)FUN_0001b990(&DAT_0005d07a,param_5);" (assignment_expression "__s = (char *)FUN_0001b990(&DAT_0005d07a,param_5)" identifier = (cast_expression "(char *)FUN_0001b990(&DAT_0005d07a,param_5)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "FUN_0001b990(&DAT_0005d07a,param_5)" identifier (argument_list "(&DAT_0005d07a,param_5)" ( (pointer_expression "&DAT_0005d07a" & identifier) , identifier ))))) ;) (expression_statement "sVar2 = strlen(__s);" (assignment_expression "sVar2 = strlen(__s)" identifier = (call_expression "strlen(__s)" identifier (argument_list "(__s)" ( identifier )))) ;) (if_statement "if (sVar2 < 2) {\n                    \n      __assert_fail("len >= 2","be_misc.c",0x28,"backend_socket_log");\n    }" if (parenthesized_expression "(sVar2 < 2)" ( (binary_expression "sVar2 < 2" identifier < number_literal) )) (compound_statement "{\n                    \n      __assert_fail("len >= 2","be_misc.c",0x28,"backend_socket_log");\n    }" { (expression_statement "__assert_fail("len >= 2","be_misc.c",0x28,"backend_socket_log");" (call_expression "__assert_fail("len >= 2","be_misc.c",0x28,"backend_socket_log")" identifier (argument_list "("len >= 2","be_misc.c",0x28,"backend_socket_log")" ( (string_literal ""len >= 2"" " string_content ") , (string_literal ""be_misc.c"" " string_content ") , number_literal , (string_literal ""backend_socket_log"" " string_content ") ))) ;) })) (expression_statement "uVar3 = FUN_00019350(param_7,0x13);" (assignment_expression "uVar3 = FUN_00019350(param_7,0x13)" identifier = (call_expression "FUN_00019350(param_7,0x13)" identifier (argument_list "(param_7,0x13)" ( identifier , number_literal )))) ;) (if_statement "if (uVar3 == 2) {\n      uVar3 = (uint)(param_8 != 0);\n    }" if (parenthesized_expression "(uVar3 == 2)" ( (binary_expression "uVar3 == 2" identifier == number_literal) )) (compound_statement "{\n      uVar3 = (uint)(param_8 != 0);\n    }" { (expression_statement "uVar3 = (uint)(param_8 != 0);" (assignment_expression "uVar3 = (uint)(param_8 != 0)" identifier = (call_expression "(uint)(param_8 != 0)" (parenthesized_expression "(uint)" ( identifier )) (argument_list "(param_8 != 0)" ( (binary_expression "param_8 != 0" identifier != number_literal) )))) ;) })) (if_statement "if (uVar3 == 0) {\n      FUN_000556e0(param_1,1,__s,sVar2);\n    }" if (parenthesized_expression "(uVar3 == 0)" ( (binary_expression "uVar3 == 0" identifier == number_literal) )) (compound_statement "{\n      FUN_000556e0(param_1,1,__s,sVar2);\n    }" { (expression_statement "FUN_000556e0(param_1,1,__s,sVar2);" (call_expression "FUN_000556e0(param_1,1,__s,sVar2)" identifier (argument_list "(param_1,1,__s,sVar2)" ( identifier , number_literal , identifier , identifier ))) ;) })) (expression_statement "__s[sVar2 - 2] = '\0';" (assignment_expression "__s[sVar2 - 2] = '\0'" (subscript_expression "__s[sVar2 - 2]" identifier [ (binary_expression "sVar2 - 2" identifier - number_literal) ]) = (char_literal "'\0'" ' escape_sequence ')) ;) }))) (expression_statement "FUN_000513d0(param_1,__s);" (call_expression "FUN_000513d0(param_1,__s)" identifier (argument_list "(param_1,__s)" ( identifier , identifier ))) ;) (expression_statement "FUN_0001c820(__s);" (call_expression "FUN_0001c820(__s)" identifier (argument_list "(__s)" ( identifier ))) ;) (labeled_statement "LAB_0001552a:\n  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return;\n  }" statement_identifier : (if_statement "if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return;\n  }" if (parenthesized_expression "(local_20 == *(int *)(in_GS_OFFSET + 0x14))" ( (binary_expression "local_20 == *(int *)(in_GS_OFFSET + 0x14)" identifier == (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" * (cast_expression "(int *)(in_GS_OFFSET + 0x14)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_GS_OFFSET + 0x14)" ( (binary_expression "in_GS_OFFSET + 0x14" identifier + number_literal) ))))) )) (compound_statement "{\n    return;\n  }" { (return_statement "return;" return ;) }))) (expression_statement "FUN_0005c110();" (call_expression "FUN_0005c110()" identifier (argument_list "()" ( ))) ;) })))
(translation_unit (function_definition TYPE (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE IDENT) ))) (compound_statement { (declaration TYPE IDENT ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE (array_declarator IDENT [ LIT ]) ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (expression_statement (assignment_expression IDENT = LIT) ;) (expression_statement (assignment_expression IDENT = (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (expression_statement (call_expression IDENT (argument_list ( IDENT , IDENT , LIT ))) ;) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (call_expression IDENT (argument_list ( (string_literal " string_content ") , IDENT , IDENT ))))) ;) (labeled_statement statement_identifier : (if_statement if (parenthesized_expression ( (binary_expression IDENT == (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) LIT)) )) (goto_statement goto statement_identifier ;))) }) (else_clause else (compound_statement { (if_statement if (parenthesized_expression ( (binary_expression IDENT != LIT) )) (compound_statement { (if_statement if (parenthesized_expression ( (binary_expression IDENT != LIT) )) (goto_statement goto statement_identifier ;)) (expression_statement (call_expression IDENT (argument_list ( IDENT , IDENT , LIT ))) ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (call_expression IDENT (argument_list ( (string_literal " string_content ") , IDENT ))))) ;) }) (else_clause else (compound_statement { (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (call_expression IDENT (argument_list ( (string_literal " string_content ") , IDENT , IDENT ))))) ;) }))) (goto_statement goto statement_identifier ;) })) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (call_expression IDENT (argument_list ( (pointer_expression & IDENT) , IDENT ))))) ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT < 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 )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (call_expression (parenthesized_expression ( IDENT )) (argument_list ( (binary_expression IDENT != LIT) )))) ;) })) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (expression_statement (call_expression IDENT (argument_list ( IDENT , LIT , IDENT , IDENT ))) ;) })) (expression_statement (assignment_expression (subscript_expression IDENT [ (binary_expression IDENT - LIT) ]) = (char_literal ' escape_sequence ')) ;) }))) (expression_statement (call_expression IDENT (argument_list ( IDENT , IDENT ))) ;) (expression_statement (call_expression IDENT (argument_list ( IDENT ))) ;) (labeled_statement statement_identifier : (if_statement if (parenthesized_expression ( (binary_expression IDENT == (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))))) )) (compound_statement { (return_statement return ;) }))) (expression_statement (call_expression IDENT (argument_list ( ))) ;) })))
(function_definition "void FUN_000154d0(undefined4 param_1,int param_2,undefined4 param_3,undefined4 param_4,\n                 undefined4 param_5,undefined4 param_6,undefined4 param_7,int param_8)\n\n{\n  int iVar1;\n  char *__s;\n  size_t sVar2;\n  uint uVar3;\n  int in_GS_OFFSET;\n  undefined1 local_120 [256];\n  int local_20;\n  undefined4 uStack_14;\n  \n  uStack_14 = 0x154d9;\n  local_20 = *(int *)(in_GS_OFFSET + 0x14);\n  if (param_2 == 1) {\n    FUN_00053230(param_3,local_120,0x100);\n    __s = (char *)FUN_0001b990("Failed to connect to %s: %s",local_120,param_5);\nLAB_00015581:\n    if (__s == (char *)0x0) goto LAB_0001552a;\n  }\n  else {\n    if (param_2 != 2) {\n      if (param_2 != 0) goto LAB_0001552a;\n      FUN_00053230(param_3,local_120,0x100);\n      iVar1 = FUN_000532c0(param_3);\n      if (iVar1 == 0) {\n        __s = (char *)FUN_0001b990("Connecting to %s",local_120);\n      }\n      else {\n        __s = (char *)FUN_0001b990("Connecting to %s port %d",local_120,param_4);\n      }\n      goto LAB_00015581;\n    }\n    __s = (char *)FUN_0001b990(&DAT_0005d07a,param_5);\n    sVar2 = strlen(__s);\n    if (sVar2 < 2) {\n                    \n      __assert_fail("len >= 2","be_misc.c",0x28,"backend_socket_log");\n    }\n    uVar3 = FUN_00019350(param_7,0x13);\n    if (uVar3 == 2) {\n      uVar3 = (uint)(param_8 != 0);\n    }\n    if (uVar3 == 0) {\n      FUN_000556e0(param_1,1,__s,sVar2);\n    }\n    __s[sVar2 - 2] = '\0';\n  }\n  FUN_000513d0(param_1,__s);\n  FUN_0001c820(__s);\nLAB_0001552a:\n  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return;\n  }\n                    \n  FUN_0005c110();\n}" (primitive_type "void") (function_declarator "FUN_000154d0(undefined4 param_1,int param_2,undefined4 param_3,undefined4 param_4,\n                 undefined4 param_5,undefined4 param_6,undefined4 param_7,int param_8)" (identifier "FUN_000154d0") (parameter_list "(undefined4 param_1,int param_2,undefined4 param_3,undefined4 param_4,\n                 undefined4 param_5,undefined4 param_6,undefined4 param_7,int param_8)" (( "(") (parameter_declaration "undefined4 param_1" (type_identifier "undefined4") (identifier "param_1")) (, ",") (parameter_declaration "int param_2" (primitive_type "int") (identifier "param_2")) (, ",") (parameter_declaration "undefined4 param_3" (type_identifier "undefined4") (identifier "param_3")) (, ",") (parameter_declaration "undefined4 param_4" (type_identifier "undefined4") (identifier "param_4")) (, ",") (parameter_declaration "undefined4 param_5" (type_identifier "undefined4") (identifier "param_5")) (, ",") (parameter_declaration "undefined4 param_6" (type_identifier "undefined4") (identifier "param_6")) (, ",") (parameter_declaration "undefined4 param_7" (type_identifier "undefined4") (identifier "param_7")) (, ",") (parameter_declaration "int param_8" (primitive_type "int") (identifier "param_8")) () ")"))) (compound_statement "{\n  int iVar1;\n  char *__s;\n  size_t sVar2;\n  uint uVar3;\n  int in_GS_OFFSET;\n  undefined1 local_120 [256];\n  int local_20;\n  undefined4 uStack_14;\n  \n  uStack_14 = 0x154d9;\n  local_20 = *(int *)(in_GS_OFFSET + 0x14);\n  if (param_2 == 1) {\n    FUN_00053230(param_3,local_120,0x100);\n    __s = (char *)FUN_0001b990("Failed to connect to %s: %s",local_120,param_5);\nLAB_00015581:\n    if (__s == (char *)0x0) goto LAB_0001552a;\n  }\n  else {\n    if (param_2 != 2) {\n      if (param_2 != 0) goto LAB_0001552a;\n      FUN_00053230(param_3,local_120,0x100);\n      iVar1 = FUN_000532c0(param_3);\n      if (iVar1 == 0) {\n        __s = (char *)FUN_0001b990("Connecting to %s",local_120);\n      }\n      else {\n        __s = (char *)FUN_0001b990("Connecting to %s port %d",local_120,param_4);\n      }\n      goto LAB_00015581;\n    }\n    __s = (char *)FUN_0001b990(&DAT_0005d07a,param_5);\n    sVar2 = strlen(__s);\n    if (sVar2 < 2) {\n                    \n      __assert_fail("len >= 2","be_misc.c",0x28,"backend_socket_log");\n    }\n    uVar3 = FUN_00019350(param_7,0x13);\n    if (uVar3 == 2) {\n      uVar3 = (uint)(param_8 != 0);\n    }\n    if (uVar3 == 0) {\n      FUN_000556e0(param_1,1,__s,sVar2);\n    }\n    __s[sVar2 - 2] = '\0';\n  }\n  FUN_000513d0(param_1,__s);\n  FUN_0001c820(__s);\nLAB_0001552a:\n  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return;\n  }\n                    \n  FUN_0005c110();\n}" ({ "{") (declaration "int iVar1;" (primitive_type "int") (identifier "iVar1") (; ";")) (declaration "char *__s;" (primitive_type "char") (pointer_declarator "*__s" (* "*") (identifier "__s")) (; ";")) (declaration "size_t sVar2;" (primitive_type "size_t") (identifier "sVar2") (; ";")) (declaration "uint uVar3;" (type_identifier "uint") (identifier "uVar3") (; ";")) (declaration "int in_GS_OFFSET;" (primitive_type "int") (identifier "in_GS_OFFSET") (; ";")) (declaration "undefined1 local_120 [256];" (type_identifier "undefined1") (array_declarator "local_120 [256]" (identifier "local_120") ([ "[") (number_literal "256") (] "]")) (; ";")) (declaration "int local_20;" (primitive_type "int") (identifier "local_20") (; ";")) (declaration "undefined4 uStack_14;" (type_identifier "undefined4") (identifier "uStack_14") (; ";")) (expression_statement "uStack_14 = 0x154d9;" (assignment_expression "uStack_14 = 0x154d9" (identifier "uStack_14") (= "=") (number_literal "0x154d9")) (; ";")) (expression_statement "local_20 = *(int *)(in_GS_OFFSET + 0x14);" (assignment_expression "local_20 = *(int *)(in_GS_OFFSET + 0x14)" (identifier "local_20") (= "=") (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" (* "*") (cast_expression "(int *)(in_GS_OFFSET + 0x14)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(in_GS_OFFSET + 0x14)" (( "(") (binary_expression "in_GS_OFFSET + 0x14" (identifier "in_GS_OFFSET") (+ "+") (number_literal "0x14")) () ")"))))) (; ";")) (if_statement "if (param_2 == 1) {\n    FUN_00053230(param_3,local_120,0x100);\n    __s = (char *)FUN_0001b990("Failed to connect to %s: %s",local_120,param_5);\nLAB_00015581:\n    if (__s == (char *)0x0) goto LAB_0001552a;\n  }\n  else {\n    if (param_2 != 2) {\n      if (param_2 != 0) goto LAB_0001552a;\n      FUN_00053230(param_3,local_120,0x100);\n      iVar1 = FUN_000532c0(param_3);\n      if (iVar1 == 0) {\n        __s = (char *)FUN_0001b990("Connecting to %s",local_120);\n      }\n      else {\n        __s = (char *)FUN_0001b990("Connecting to %s port %d",local_120,param_4);\n      }\n      goto LAB_00015581;\n    }\n    __s = (char *)FUN_0001b990(&DAT_0005d07a,param_5);\n    sVar2 = strlen(__s);\n    if (sVar2 < 2) {\n                    \n      __assert_fail("len >= 2","be_misc.c",0x28,"backend_socket_log");\n    }\n    uVar3 = FUN_00019350(param_7,0x13);\n    if (uVar3 == 2) {\n      uVar3 = (uint)(param_8 != 0);\n    }\n    if (uVar3 == 0) {\n      FUN_000556e0(param_1,1,__s,sVar2);\n    }\n    __s[sVar2 - 2] = '\0';\n  }" (if "if") (parenthesized_expression "(param_2 == 1)" (( "(") (binary_expression "param_2 == 1" (identifier "param_2") (== "==") (number_literal "1")) () ")")) (compound_statement "{\n    FUN_00053230(param_3,local_120,0x100);\n    __s = (char *)FUN_0001b990("Failed to connect to %s: %s",local_120,param_5);\nLAB_00015581:\n    if (__s == (char *)0x0) goto LAB_0001552a;\n  }" ({ "{") (expression_statement "FUN_00053230(param_3,local_120,0x100);" (call_expression "FUN_00053230(param_3,local_120,0x100)" (identifier "FUN_00053230") (argument_list "(param_3,local_120,0x100)" (( "(") (identifier "param_3") (, ",") (identifier "local_120") (, ",") (number_literal "0x100") () ")"))) (; ";")) (expression_statement "__s = (char *)FUN_0001b990("Failed to connect to %s: %s",local_120,param_5);" (assignment_expression "__s = (char *)FUN_0001b990("Failed to connect to %s: %s",local_120,param_5)" (identifier "__s") (= "=") (cast_expression "(char *)FUN_0001b990("Failed to connect to %s: %s",local_120,param_5)" (( "(") (type_descriptor "char *" (primitive_type "char") (abstract_pointer_declarator "*" (* "*"))) () ")") (call_expression "FUN_0001b990("Failed to connect to %s: %s",local_120,param_5)" (identifier "FUN_0001b990") (argument_list "("Failed to connect to %s: %s",local_120,param_5)" (( "(") (string_literal ""Failed to connect to %s: %s"" (" """) (string_content "Failed to connect to %s: %s") (" """)) (, ",") (identifier "local_120") (, ",") (identifier "param_5") () ")"))))) (; ";")) (labeled_statement "LAB_00015581:\n    if (__s == (char *)0x0) goto LAB_0001552a;" (statement_identifier "LAB_00015581") (: ":") (if_statement "if (__s == (char *)0x0) goto LAB_0001552a;" (if "if") (parenthesized_expression "(__s == (char *)0x0)" (( "(") (binary_expression "__s == (char *)0x0" (identifier "__s") (== "==") (cast_expression "(char *)0x0" (( "(") (type_descriptor "char *" (primitive_type "char") (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0x0"))) () ")")) (goto_statement "goto LAB_0001552a;" (goto "goto") (statement_identifier "LAB_0001552a") (; ";")))) (} "}")) (else_clause "else {\n    if (param_2 != 2) {\n      if (param_2 != 0) goto LAB_0001552a;\n      FUN_00053230(param_3,local_120,0x100);\n      iVar1 = FUN_000532c0(param_3);\n      if (iVar1 == 0) {\n        __s = (char *)FUN_0001b990("Connecting to %s",local_120);\n      }\n      else {\n        __s = (char *)FUN_0001b990("Connecting to %s port %d",local_120,param_4);\n      }\n      goto LAB_00015581;\n    }\n    __s = (char *)FUN_0001b990(&DAT_0005d07a,param_5);\n    sVar2 = strlen(__s);\n    if (sVar2 < 2) {\n                    \n      __assert_fail("len >= 2","be_misc.c",0x28,"backend_socket_log");\n    }\n    uVar3 = FUN_00019350(param_7,0x13);\n    if (uVar3 == 2) {\n      uVar3 = (uint)(param_8 != 0);\n    }\n    if (uVar3 == 0) {\n      FUN_000556e0(param_1,1,__s,sVar2);\n    }\n    __s[sVar2 - 2] = '\0';\n  }" (else "else") (compound_statement "{\n    if (param_2 != 2) {\n      if (param_2 != 0) goto LAB_0001552a;\n      FUN_00053230(param_3,local_120,0x100);\n      iVar1 = FUN_000532c0(param_3);\n      if (iVar1 == 0) {\n        __s = (char *)FUN_0001b990("Connecting to %s",local_120);\n      }\n      else {\n        __s = (char *)FUN_0001b990("Connecting to %s port %d",local_120,param_4);\n      }\n      goto LAB_00015581;\n    }\n    __s = (char *)FUN_0001b990(&DAT_0005d07a,param_5);\n    sVar2 = strlen(__s);\n    if (sVar2 < 2) {\n                    \n      __assert_fail("len >= 2","be_misc.c",0x28,"backend_socket_log");\n    }\n    uVar3 = FUN_00019350(param_7,0x13);\n    if (uVar3 == 2) {\n      uVar3 = (uint)(param_8 != 0);\n    }\n    if (uVar3 == 0) {\n      FUN_000556e0(param_1,1,__s,sVar2);\n    }\n    __s[sVar2 - 2] = '\0';\n  }" ({ "{") (if_statement "if (param_2 != 2) {\n      if (param_2 != 0) goto LAB_0001552a;\n      FUN_00053230(param_3,local_120,0x100);\n      iVar1 = FUN_000532c0(param_3);\n      if (iVar1 == 0) {\n        __s = (char *)FUN_0001b990("Connecting to %s",local_120);\n      }\n      else {\n        __s = (char *)FUN_0001b990("Connecting to %s port %d",local_120,param_4);\n      }\n      goto LAB_00015581;\n    }" (if "if") (parenthesized_expression "(param_2 != 2)" (( "(") (binary_expression "param_2 != 2" (identifier "param_2") (!= "!=") (number_literal "2")) () ")")) (compound_statement "{\n      if (param_2 != 0) goto LAB_0001552a;\n      FUN_00053230(param_3,local_120,0x100);\n      iVar1 = FUN_000532c0(param_3);\n      if (iVar1 == 0) {\n        __s = (char *)FUN_0001b990("Connecting to %s",local_120);\n      }\n      else {\n        __s = (char *)FUN_0001b990("Connecting to %s port %d",local_120,param_4);\n      }\n      goto LAB_00015581;\n    }" ({ "{") (if_statement "if (param_2 != 0) goto LAB_0001552a;" (if "if") (parenthesized_expression "(param_2 != 0)" (( "(") (binary_expression "param_2 != 0" (identifier "param_2") (!= "!=") (number_literal "0")) () ")")) (goto_statement "goto LAB_0001552a;" (goto "goto") (statement_identifier "LAB_0001552a") (; ";"))) (expression_statement "FUN_00053230(param_3,local_120,0x100);" (call_expression "FUN_00053230(param_3,local_120,0x100)" (identifier "FUN_00053230") (argument_list "(param_3,local_120,0x100)" (( "(") (identifier "param_3") (, ",") (identifier "local_120") (, ",") (number_literal "0x100") () ")"))) (; ";")) (expression_statement "iVar1 = FUN_000532c0(param_3);" (assignment_expression "iVar1 = FUN_000532c0(param_3)" (identifier "iVar1") (= "=") (call_expression "FUN_000532c0(param_3)" (identifier "FUN_000532c0") (argument_list "(param_3)" (( "(") (identifier "param_3") () ")")))) (; ";")) (if_statement "if (iVar1 == 0) {\n        __s = (char *)FUN_0001b990("Connecting to %s",local_120);\n      }\n      else {\n        __s = (char *)FUN_0001b990("Connecting to %s port %d",local_120,param_4);\n      }" (if "if") (parenthesized_expression "(iVar1 == 0)" (( "(") (binary_expression "iVar1 == 0" (identifier "iVar1") (== "==") (number_literal "0")) () ")")) (compound_statement "{\n        __s = (char *)FUN_0001b990("Connecting to %s",local_120);\n      }" ({ "{") (expression_statement "__s = (char *)FUN_0001b990("Connecting to %s",local_120);" (assignment_expression "__s = (char *)FUN_0001b990("Connecting to %s",local_120)" (identifier "__s") (= "=") (cast_expression "(char *)FUN_0001b990("Connecting to %s",local_120)" (( "(") (type_descriptor "char *" (primitive_type "char") (abstract_pointer_declarator "*" (* "*"))) () ")") (call_expression "FUN_0001b990("Connecting to %s",local_120)" (identifier "FUN_0001b990") (argument_list "("Connecting to %s",local_120)" (( "(") (string_literal ""Connecting to %s"" (" """) (string_content "Connecting to %s") (" """)) (, ",") (identifier "local_120") () ")"))))) (; ";")) (} "}")) (else_clause "else {\n        __s = (char *)FUN_0001b990("Connecting to %s port %d",local_120,param_4);\n      }" (else "else") (compound_statement "{\n        __s = (char *)FUN_0001b990("Connecting to %s port %d",local_120,param_4);\n      }" ({ "{") (expression_statement "__s = (char *)FUN_0001b990("Connecting to %s port %d",local_120,param_4);" (assignment_expression "__s = (char *)FUN_0001b990("Connecting to %s port %d",local_120,param_4)" (identifier "__s") (= "=") (cast_expression "(char *)FUN_0001b990("Connecting to %s port %d",local_120,param_4)" (( "(") (type_descriptor "char *" (primitive_type "char") (abstract_pointer_declarator "*" (* "*"))) () ")") (call_expression "FUN_0001b990("Connecting to %s port %d",local_120,param_4)" (identifier "FUN_0001b990") (argument_list "("Connecting to %s port %d",local_120,param_4)" (( "(") (string_literal ""Connecting to %s port %d"" (" """) (string_content "Connecting to %s port %d") (" """)) (, ",") (identifier "local_120") (, ",") (identifier "param_4") () ")"))))) (; ";")) (} "}")))) (goto_statement "goto LAB_00015581;" (goto "goto") (statement_identifier "LAB_00015581") (; ";")) (} "}"))) (expression_statement "__s = (char *)FUN_0001b990(&DAT_0005d07a,param_5);" (assignment_expression "__s = (char *)FUN_0001b990(&DAT_0005d07a,param_5)" (identifier "__s") (= "=") (cast_expression "(char *)FUN_0001b990(&DAT_0005d07a,param_5)" (( "(") (type_descriptor "char *" (primitive_type "char") (abstract_pointer_declarator "*" (* "*"))) () ")") (call_expression "FUN_0001b990(&DAT_0005d07a,param_5)" (identifier "FUN_0001b990") (argument_list "(&DAT_0005d07a,param_5)" (( "(") (pointer_expression "&DAT_0005d07a" (& "&") (identifier "DAT_0005d07a")) (, ",") (identifier "param_5") () ")"))))) (; ";")) (expression_statement "sVar2 = strlen(__s);" (assignment_expression "sVar2 = strlen(__s)" (identifier "sVar2") (= "=") (call_expression "strlen(__s)" (identifier "strlen") (argument_list "(__s)" (( "(") (identifier "__s") () ")")))) (; ";")) (if_statement "if (sVar2 < 2) {\n                    \n      __assert_fail("len >= 2","be_misc.c",0x28,"backend_socket_log");\n    }" (if "if") (parenthesized_expression "(sVar2 < 2)" (( "(") (binary_expression "sVar2 < 2" (identifier "sVar2") (< "<") (number_literal "2")) () ")")) (compound_statement "{\n                    \n      __assert_fail("len >= 2","be_misc.c",0x28,"backend_socket_log");\n    }" ({ "{") (expression_statement "__assert_fail("len >= 2","be_misc.c",0x28,"backend_socket_log");" (call_expression "__assert_fail("len >= 2","be_misc.c",0x28,"backend_socket_log")" (identifier "__assert_fail") (argument_list "("len >= 2","be_misc.c",0x28,"backend_socket_log")" (( "(") (string_literal ""len >= 2"" (" """) (string_content "len >= 2") (" """)) (, ",") (string_literal ""be_misc.c"" (" """) (string_content "be_misc.c") (" """)) (, ",") (number_literal "0x28") (, ",") (string_literal ""backend_socket_log"" (" """) (string_content "backend_socket_log") (" """)) () ")"))) (; ";")) (} "}"))) (expression_statement "uVar3 = FUN_00019350(param_7,0x13);" (assignment_expression "uVar3 = FUN_00019350(param_7,0x13)" (identifier "uVar3") (= "=") (call_expression "FUN_00019350(param_7,0x13)" (identifier "FUN_00019350") (argument_list "(param_7,0x13)" (( "(") (identifier "param_7") (, ",") (number_literal "0x13") () ")")))) (; ";")) (if_statement "if (uVar3 == 2) {\n      uVar3 = (uint)(param_8 != 0);\n    }" (if "if") (parenthesized_expression "(uVar3 == 2)" (( "(") (binary_expression "uVar3 == 2" (identifier "uVar3") (== "==") (number_literal "2")) () ")")) (compound_statement "{\n      uVar3 = (uint)(param_8 != 0);\n    }" ({ "{") (expression_statement "uVar3 = (uint)(param_8 != 0);" (assignment_expression "uVar3 = (uint)(param_8 != 0)" (identifier "uVar3") (= "=") (call_expression "(uint)(param_8 != 0)" (parenthesized_expression "(uint)" (( "(") (identifier "uint") () ")")) (argument_list "(param_8 != 0)" (( "(") (binary_expression "param_8 != 0" (identifier "param_8") (!= "!=") (number_literal "0")) () ")")))) (; ";")) (} "}"))) (if_statement "if (uVar3 == 0) {\n      FUN_000556e0(param_1,1,__s,sVar2);\n    }" (if "if") (parenthesized_expression "(uVar3 == 0)" (( "(") (binary_expression "uVar3 == 0" (identifier "uVar3") (== "==") (number_literal "0")) () ")")) (compound_statement "{\n      FUN_000556e0(param_1,1,__s,sVar2);\n    }" ({ "{") (expression_statement "FUN_000556e0(param_1,1,__s,sVar2);" (call_expression "FUN_000556e0(param_1,1,__s,sVar2)" (identifier "FUN_000556e0") (argument_list "(param_1,1,__s,sVar2)" (( "(") (identifier "param_1") (, ",") (number_literal "1") (, ",") (identifier "__s") (, ",") (identifier "sVar2") () ")"))) (; ";")) (} "}"))) (expression_statement "__s[sVar2 - 2] = '\0';" (assignment_expression "__s[sVar2 - 2] = '\0'" (subscript_expression "__s[sVar2 - 2]" (identifier "__s") ([ "[") (binary_expression "sVar2 - 2" (identifier "sVar2") (- "-") (number_literal "2")) (] "]")) (= "=") (char_literal "'\0'" (' "'") (escape_sequence "\0") (' "'"))) (; ";")) (} "}")))) (expression_statement "FUN_000513d0(param_1,__s);" (call_expression "FUN_000513d0(param_1,__s)" (identifier "FUN_000513d0") (argument_list "(param_1,__s)" (( "(") (identifier "param_1") (, ",") (identifier "__s") () ")"))) (; ";")) (expression_statement "FUN_0001c820(__s);" (call_expression "FUN_0001c820(__s)" (identifier "FUN_0001c820") (argument_list "(__s)" (( "(") (identifier "__s") () ")"))) (; ";")) (labeled_statement "LAB_0001552a:\n  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return;\n  }" (statement_identifier "LAB_0001552a") (: ":") (if_statement "if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return;\n  }" (if "if") (parenthesized_expression "(local_20 == *(int *)(in_GS_OFFSET + 0x14))" (( "(") (binary_expression "local_20 == *(int *)(in_GS_OFFSET + 0x14)" (identifier "local_20") (== "==") (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" (* "*") (cast_expression "(int *)(in_GS_OFFSET + 0x14)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(in_GS_OFFSET + 0x14)" (( "(") (binary_expression "in_GS_OFFSET + 0x14" (identifier "in_GS_OFFSET") (+ "+") (number_literal "0x14")) () ")"))))) () ")")) (compound_statement "{\n    return;\n  }" ({ "{") (return_statement "return;" (return "return") (; ";")) (} "}")))) (expression_statement "FUN_0005c110();" (call_expression "FUN_0005c110()" (identifier "FUN_0005c110") (argument_list "()" (( "(") () ")"))) (; ";")) (} "}")))

/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */
/* WARNING: Unknown calling convention */
/* WARNING: Enum "anon_enum_32": Some values do not have unique names */

void function_1(void *frontend,int var_2,type_1 addr,int port,char *error_msg,
                       int error_code,type_2 *conf,int var_13)

{
  int var_17;
  int var_7;
  char *var_5;
  size_t var_9;
  type_3 var_12;
  int var_1;
  char addrbuf [256];
  
  var_17 = *(int *)(var_1 + 0x14);
  if (var_2 == 1) {
    var_3(addr,addrbuf,0x100);
    var_5 = var_4("Failed to connect to %s: %s",addrbuf,error_msg);
LAB_00015581:
    if (var_5 == (char *)0x0) goto LAB_0001552a;
  }
  else {
    if (var_2 != 2) {
      if (var_2 != 0) goto LAB_0001552a;
      var_3(addr,addrbuf,0x100);
      var_7 = var_6(addr);
      if (var_7 == 0) {
        var_5 = var_4("Connecting to %s",addrbuf);
      }
      else {
        var_5 = var_4("Connecting to %s port %d",addrbuf,port);
      }
      goto LAB_00015581;
    }
    var_5 = var_4("%s\r\n",error_msg);
    var_9 = var_8(var_5);
    if (var_9 < 2) {
                    /* WARNING: Subroutine does not return */
      var_10("len >= 2","be_misc.c",0x28,"backend_socket_log");
    }
    var_12 = var_11(conf,0x13);
    if (var_12 == 2) {
      var_12 = (type_3)(var_13 != 0);
    }
    if (var_12 == 0) {
      var_14(frontend,1,var_5,var_9);
    }
    var_5[var_9 - 2] = '\0';
  }
  var_15(frontend,var_5);
  var_16(var_5);
LAB_0001552a:
  if (var_17 == *(int *)(var_1 + 0x14)) {
    return;
  }
                    /* WARNING: Subroutine does not return */
  var_18();
}


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

/* WARNING: Function: __i686.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */

void MASKED(undefined4 param_1,int param_2,undefined4 param_3,undefined4 param_4,
                 undefined4 param_5,undefined4 param_6,undefined4 param_7,int param_8)

{
  int iVar1;
  char *__s;
  size_t sVar2;
  uint uVar3;
  int in_GS_OFFSET;
  undefined1 local_120 [256];
  int local_20;
  undefined4 uStack_14;
  
  uStack_14 = 0x154d9;
  local_20 = *(int *)(in_GS_OFFSET + 0x14);
  if (param_2 == 1) {
    FUN_00053230(param_3,local_120,0x100);
    __s = (char *)FUN_0001b990("Failed to connect to %s: %s",local_120,param_5);
LAB_00015581:
    if (__s == (char *)0x0) goto LAB_0001552a;
  }
  else {
    if (param_2 != 2) {
      if (param_2 != 0) goto LAB_0001552a;
      FUN_00053230(param_3,local_120,0x100);
      iVar1 = FUN_000532c0(param_3);
      if (iVar1 == 0) {
        __s = (char *)FUN_0001b990("Connecting to %s",local_120);
      }
      else {
        __s = (char *)FUN_0001b990("Connecting to %s port %d",local_120,param_4);
      }
      goto LAB_00015581;
    }
    __s = (char *)FUN_0001b990(&DAT_0005d07a,param_5);
    sVar2 = strlen(__s);
    if (sVar2 < 2) {
                    /* WARNING: Subroutine does not return */
      __assert_fail("len >= 2","be_misc.c",0x28,"backend_socket_log");
    }
    uVar3 = FUN_00019350(param_7,0x13);
    if (uVar3 == 2) {
      uVar3 = (uint)(param_8 != 0);
    }
    if (uVar3 == 0) {
      FUN_000556e0(param_1,1,__s,sVar2);
    }
    __s[sVar2 - 2] = '\0';
  }
  FUN_000513d0(param_1,__s);
  FUN_0001c820(__s);
LAB_0001552a:
  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {
    return;
  }
                    /* WARNING: Subroutine does not return */
  FUN_0005c110();
}

