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

void ssh_connshare_log(Ssh_conflict ssh,int event,char *logtext,char *ds_err,char *us_err)

{
  char *fmt;
  
  if (event == 0) {
    if (logtext != (char *)0x0) {
      fmt = "Could not set up connection sharing: %s";
LAB_00031160:
      logeventf(ssh,fmt);
      return;
    }
    if (ds_err != (char *)0x0) {
      logeventf(ssh,"Could not set up connection sharing as downstream: %s",ds_err);
    }
    if (us_err != (char *)0x0) {
      logeventf(ssh,"Could not set up connection sharing as upstream: %s");
      return;
    }
  }
  else if (event == 1) {
    logeventf(ssh,"Using existing shared connection at %s",logtext);
    if (((byte)flags & 5) != 0) {
      c_write((Ssh_conflict)&ssh->frontend,"Reusing a shared connection to this server.\r\n",0x2d);
      return;
    }
  }
  else if (event == 2) {
    fmt = "Sharing this connection at %s";
    goto LAB_00031160;
  }
  return;
}



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

void FUN_00031130(undefined4 param_1,int param_2,int param_3,int param_4,int param_5)

{
  if (param_2 == 0) {
    if (param_3 != 0) {
LAB_00031160:
      FUN_0002b2e0();
      return;
    }
    if (param_4 != 0) {
      FUN_0002b2e0(param_1,"Could not set up connection sharing as downstream: %s",param_4);
    }
    if (param_5 != 0) {
      FUN_0002b2e0();
      return;
    }
  }
  else if (param_2 == 1) {
    FUN_0002b2e0(param_1,"Using existing shared connection at %s",param_3);
    if (((byte)DAT_000aab28 & 5) != 0) {
      FUN_0002dbe0();
      return;
    }
  }
  else if (param_2 == 2) goto LAB_00031160;
  return;
}


PUSH EDI
PUSH ESI
PUSH EBX
MOV EDX,dword ptr [ESP + 0x14]
CALL 0x00014970
ADD EBX,0x78c54
MOV ESI,dword ptr [ESP + 0x10]
MOV ECX,dword ptr [ESP + 0x18]
MOV EAX,dword ptr [ESP + 0x1c]
MOV EDI,dword ptr [ESP + 0x20]
TEST EDX,EDX
JNZ 0x000311b0
TEST ECX,ECX
JZ 0x00031170
LEA EAX,[EBX + 0xfffcd8a8]
MOV dword ptr [ESP + 0x14],EAX
POP EBX
POP ESI
POP EDI
JMP 0x0002b2e0
TEST EAX,EAX
JZ 0x00031188
SUB ESP,0x4
PUSH EAX
LEA EAX,[EBX + 0xfffcd8d0]
PUSH EAX
PUSH ESI
CALL 0x0002b2e0
ADD ESP,0x10
TEST EDI,EDI
JZ 0x000311ba
LEA EAX,[EBX + 0xfffcd908]
MOV dword ptr [ESP + 0x18],EDI
MOV dword ptr [ESP + 0x14],EAX
MOV dword ptr [ESP + 0x10],ESI
POP EBX
POP ESI
POP EDI
JMP 0x0002b2e0
CMP EDX,0x1
JZ 0x000311d0
CMP EDX,0x2
JZ 0x000311c0
POP EBX
POP ESI
POP EDI
RET
LEA EAX,[EBX + 0xfffcbfb1]
JMP 0x00031160
SUB ESP,0x4
LEA EAX,[EBX + 0xfffcd93c]
PUSH ECX
PUSH EAX
PUSH ESI
CALL 0x0002b2e0
LEA EAX,[EBX + 0xd98]
ADD ESP,0x10
TEST byte ptr [EAX],0x5
JZ 0x000311ba
LEA EAX,[ESI + 0x110]
LEA EDX,[EBX + 0xfffcd964]
MOV ECX,0x2d
POP EBX
POP ESI
POP EDI
JMP 0x0002dbe0
(translation_unit "/* WARNING: Function: __i686.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n\nvoid FUN_00031130(undefined4 param_1,int param_2,int param_3,int param_4,int param_5)\n\n{\n  if (param_2 == 0) {\n    if (param_3 != 0) {\nLAB_00031160:\n      FUN_0002b2e0();\n      return;\n    }\n    if (param_4 != 0) {\n      FUN_0002b2e0(param_1,"Could not set up connection sharing as downstream: %s",param_4);\n    }\n    if (param_5 != 0) {\n      FUN_0002b2e0();\n      return;\n    }\n  }\n  else if (param_2 == 1) {\n    FUN_0002b2e0(param_1,"Using existing shared connection at %s",param_3);\n    if (((byte)DAT_000aab28 & 5) != 0) {\n      FUN_0002dbe0();\n      return;\n    }\n  }\n  else if (param_2 == 2) goto LAB_00031160;\n  return;\n}\n\n" comment (function_definition "void FUN_00031130(undefined4 param_1,int param_2,int param_3,int param_4,int param_5)\n\n{\n  if (param_2 == 0) {\n    if (param_3 != 0) {\nLAB_00031160:\n      FUN_0002b2e0();\n      return;\n    }\n    if (param_4 != 0) {\n      FUN_0002b2e0(param_1,"Could not set up connection sharing as downstream: %s",param_4);\n    }\n    if (param_5 != 0) {\n      FUN_0002b2e0();\n      return;\n    }\n  }\n  else if (param_2 == 1) {\n    FUN_0002b2e0(param_1,"Using existing shared connection at %s",param_3);\n    if (((byte)DAT_000aab28 & 5) != 0) {\n      FUN_0002dbe0();\n      return;\n    }\n  }\n  else if (param_2 == 2) goto LAB_00031160;\n  return;\n}" primitive_type (function_declarator "FUN_00031130(undefined4 param_1,int param_2,int param_3,int param_4,int param_5)" identifier (parameter_list "(undefined4 param_1,int param_2,int param_3,int param_4,int param_5)" ( (parameter_declaration "undefined4 param_1" type_identifier identifier) , (parameter_declaration "int param_2" primitive_type identifier) , (parameter_declaration "int param_3" primitive_type identifier) , (parameter_declaration "int param_4" primitive_type identifier) , (parameter_declaration "int param_5" primitive_type identifier) ))) (compound_statement "{\n  if (param_2 == 0) {\n    if (param_3 != 0) {\nLAB_00031160:\n      FUN_0002b2e0();\n      return;\n    }\n    if (param_4 != 0) {\n      FUN_0002b2e0(param_1,"Could not set up connection sharing as downstream: %s",param_4);\n    }\n    if (param_5 != 0) {\n      FUN_0002b2e0();\n      return;\n    }\n  }\n  else if (param_2 == 1) {\n    FUN_0002b2e0(param_1,"Using existing shared connection at %s",param_3);\n    if (((byte)DAT_000aab28 & 5) != 0) {\n      FUN_0002dbe0();\n      return;\n    }\n  }\n  else if (param_2 == 2) goto LAB_00031160;\n  return;\n}" { (if_statement "if (param_2 == 0) {\n    if (param_3 != 0) {\nLAB_00031160:\n      FUN_0002b2e0();\n      return;\n    }\n    if (param_4 != 0) {\n      FUN_0002b2e0(param_1,"Could not set up connection sharing as downstream: %s",param_4);\n    }\n    if (param_5 != 0) {\n      FUN_0002b2e0();\n      return;\n    }\n  }\n  else if (param_2 == 1) {\n    FUN_0002b2e0(param_1,"Using existing shared connection at %s",param_3);\n    if (((byte)DAT_000aab28 & 5) != 0) {\n      FUN_0002dbe0();\n      return;\n    }\n  }\n  else if (param_2 == 2) goto LAB_00031160;" if (parenthesized_expression "(param_2 == 0)" ( (binary_expression "param_2 == 0" identifier == number_literal) )) (compound_statement "{\n    if (param_3 != 0) {\nLAB_00031160:\n      FUN_0002b2e0();\n      return;\n    }\n    if (param_4 != 0) {\n      FUN_0002b2e0(param_1,"Could not set up connection sharing as downstream: %s",param_4);\n    }\n    if (param_5 != 0) {\n      FUN_0002b2e0();\n      return;\n    }\n  }" { (if_statement "if (param_3 != 0) {\nLAB_00031160:\n      FUN_0002b2e0();\n      return;\n    }" if (parenthesized_expression "(param_3 != 0)" ( (binary_expression "param_3 != 0" identifier != number_literal) )) (compound_statement "{\nLAB_00031160:\n      FUN_0002b2e0();\n      return;\n    }" { (labeled_statement "LAB_00031160:\n      FUN_0002b2e0();" statement_identifier : (expression_statement "FUN_0002b2e0();" (call_expression "FUN_0002b2e0()" identifier (argument_list "()" ( ))) ;)) (return_statement "return;" return ;) })) (if_statement "if (param_4 != 0) {\n      FUN_0002b2e0(param_1,"Could not set up connection sharing as downstream: %s",param_4);\n    }" if (parenthesized_expression "(param_4 != 0)" ( (binary_expression "param_4 != 0" identifier != number_literal) )) (compound_statement "{\n      FUN_0002b2e0(param_1,"Could not set up connection sharing as downstream: %s",param_4);\n    }" { (expression_statement "FUN_0002b2e0(param_1,"Could not set up connection sharing as downstream: %s",param_4);" (call_expression "FUN_0002b2e0(param_1,"Could not set up connection sharing as downstream: %s",param_4)" identifier (argument_list "(param_1,"Could not set up connection sharing as downstream: %s",param_4)" ( identifier , (string_literal ""Could not set up connection sharing as downstream: %s"" " string_content ") , identifier ))) ;) })) (if_statement "if (param_5 != 0) {\n      FUN_0002b2e0();\n      return;\n    }" if (parenthesized_expression "(param_5 != 0)" ( (binary_expression "param_5 != 0" identifier != number_literal) )) (compound_statement "{\n      FUN_0002b2e0();\n      return;\n    }" { (expression_statement "FUN_0002b2e0();" (call_expression "FUN_0002b2e0()" identifier (argument_list "()" ( ))) ;) (return_statement "return;" return ;) })) }) (else_clause "else if (param_2 == 1) {\n    FUN_0002b2e0(param_1,"Using existing shared connection at %s",param_3);\n    if (((byte)DAT_000aab28 & 5) != 0) {\n      FUN_0002dbe0();\n      return;\n    }\n  }\n  else if (param_2 == 2) goto LAB_00031160;" else (if_statement "if (param_2 == 1) {\n    FUN_0002b2e0(param_1,"Using existing shared connection at %s",param_3);\n    if (((byte)DAT_000aab28 & 5) != 0) {\n      FUN_0002dbe0();\n      return;\n    }\n  }\n  else if (param_2 == 2) goto LAB_00031160;" if (parenthesized_expression "(param_2 == 1)" ( (binary_expression "param_2 == 1" identifier == number_literal) )) (compound_statement "{\n    FUN_0002b2e0(param_1,"Using existing shared connection at %s",param_3);\n    if (((byte)DAT_000aab28 & 5) != 0) {\n      FUN_0002dbe0();\n      return;\n    }\n  }" { (expression_statement "FUN_0002b2e0(param_1,"Using existing shared connection at %s",param_3);" (call_expression "FUN_0002b2e0(param_1,"Using existing shared connection at %s",param_3)" identifier (argument_list "(param_1,"Using existing shared connection at %s",param_3)" ( identifier , (string_literal ""Using existing shared connection at %s"" " string_content ") , identifier ))) ;) (if_statement "if (((byte)DAT_000aab28 & 5) != 0) {\n      FUN_0002dbe0();\n      return;\n    }" if (parenthesized_expression "(((byte)DAT_000aab28 & 5) != 0)" ( (binary_expression "((byte)DAT_000aab28 & 5) != 0" (parenthesized_expression "((byte)DAT_000aab28 & 5)" ( (binary_expression "(byte)DAT_000aab28 & 5" (cast_expression "(byte)DAT_000aab28" ( (type_descriptor "byte" type_identifier) ) identifier) & number_literal) )) != number_literal) )) (compound_statement "{\n      FUN_0002dbe0();\n      return;\n    }" { (expression_statement "FUN_0002dbe0();" (call_expression "FUN_0002dbe0()" identifier (argument_list "()" ( ))) ;) (return_statement "return;" return ;) })) }) (else_clause "else if (param_2 == 2) goto LAB_00031160;" else (if_statement "if (param_2 == 2) goto LAB_00031160;" if (parenthesized_expression "(param_2 == 2)" ( (binary_expression "param_2 == 2" identifier == number_literal) )) (goto_statement "goto LAB_00031160;" goto statement_identifier ;)))))) (return_statement "return;" return ;) })))
(translation_unit "/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n/* WARNING: Enum "anon_enum_32": Some values do not have unique names */\n\nvoid ssh_connshare_log(Ssh_conflict ssh,int event,char *logtext,char *ds_err,char *us_err)\n\n{\n  char *fmt;\n  \n  if (event == 0) {\n    if (logtext != (char *)0x0) {\n      fmt = "Could not set up connection sharing: %s";\nLAB_00031160:\n      logeventf(ssh,fmt);\n      return;\n    }\n    if (ds_err != (char *)0x0) {\n      logeventf(ssh,"Could not set up connection sharing as downstream: %s",ds_err);\n    }\n    if (us_err != (char *)0x0) {\n      logeventf(ssh,"Could not set up connection sharing as upstream: %s");\n      return;\n    }\n  }\n  else if (event == 1) {\n    logeventf(ssh,"Using existing shared connection at %s",logtext);\n    if (((byte)flags & 5) != 0) {\n      c_write((Ssh_conflict)&ssh->frontend,"Reusing a shared connection to this server.\r\n",0x2d);\n      return;\n    }\n  }\n  else if (event == 2) {\n    fmt = "Sharing this connection at %s";\n    goto LAB_00031160;\n  }\n  return;\n}\n\n" comment comment (function_definition "void ssh_connshare_log(Ssh_conflict ssh,int event,char *logtext,char *ds_err,char *us_err)\n\n{\n  char *fmt;\n  \n  if (event == 0) {\n    if (logtext != (char *)0x0) {\n      fmt = "Could not set up connection sharing: %s";\nLAB_00031160:\n      logeventf(ssh,fmt);\n      return;\n    }\n    if (ds_err != (char *)0x0) {\n      logeventf(ssh,"Could not set up connection sharing as downstream: %s",ds_err);\n    }\n    if (us_err != (char *)0x0) {\n      logeventf(ssh,"Could not set up connection sharing as upstream: %s");\n      return;\n    }\n  }\n  else if (event == 1) {\n    logeventf(ssh,"Using existing shared connection at %s",logtext);\n    if (((byte)flags & 5) != 0) {\n      c_write((Ssh_conflict)&ssh->frontend,"Reusing a shared connection to this server.\r\n",0x2d);\n      return;\n    }\n  }\n  else if (event == 2) {\n    fmt = "Sharing this connection at %s";\n    goto LAB_00031160;\n  }\n  return;\n}" primitive_type (function_declarator "ssh_connshare_log(Ssh_conflict ssh,int event,char *logtext,char *ds_err,char *us_err)" identifier (parameter_list "(Ssh_conflict ssh,int event,char *logtext,char *ds_err,char *us_err)" ( (parameter_declaration "Ssh_conflict ssh" type_identifier identifier) , (parameter_declaration "int event" primitive_type identifier) , (parameter_declaration "char *logtext" primitive_type (pointer_declarator "*logtext" * identifier)) , (parameter_declaration "char *ds_err" primitive_type (pointer_declarator "*ds_err" * identifier)) , (parameter_declaration "char *us_err" primitive_type (pointer_declarator "*us_err" * identifier)) ))) (compound_statement "{\n  char *fmt;\n  \n  if (event == 0) {\n    if (logtext != (char *)0x0) {\n      fmt = "Could not set up connection sharing: %s";\nLAB_00031160:\n      logeventf(ssh,fmt);\n      return;\n    }\n    if (ds_err != (char *)0x0) {\n      logeventf(ssh,"Could not set up connection sharing as downstream: %s",ds_err);\n    }\n    if (us_err != (char *)0x0) {\n      logeventf(ssh,"Could not set up connection sharing as upstream: %s");\n      return;\n    }\n  }\n  else if (event == 1) {\n    logeventf(ssh,"Using existing shared connection at %s",logtext);\n    if (((byte)flags & 5) != 0) {\n      c_write((Ssh_conflict)&ssh->frontend,"Reusing a shared connection to this server.\r\n",0x2d);\n      return;\n    }\n  }\n  else if (event == 2) {\n    fmt = "Sharing this connection at %s";\n    goto LAB_00031160;\n  }\n  return;\n}" { (declaration "char *fmt;" primitive_type (pointer_declarator "*fmt" * identifier) ;) (if_statement "if (event == 0) {\n    if (logtext != (char *)0x0) {\n      fmt = "Could not set up connection sharing: %s";\nLAB_00031160:\n      logeventf(ssh,fmt);\n      return;\n    }\n    if (ds_err != (char *)0x0) {\n      logeventf(ssh,"Could not set up connection sharing as downstream: %s",ds_err);\n    }\n    if (us_err != (char *)0x0) {\n      logeventf(ssh,"Could not set up connection sharing as upstream: %s");\n      return;\n    }\n  }\n  else if (event == 1) {\n    logeventf(ssh,"Using existing shared connection at %s",logtext);\n    if (((byte)flags & 5) != 0) {\n      c_write((Ssh_conflict)&ssh->frontend,"Reusing a shared connection to this server.\r\n",0x2d);\n      return;\n    }\n  }\n  else if (event == 2) {\n    fmt = "Sharing this connection at %s";\n    goto LAB_00031160;\n  }" if (parenthesized_expression "(event == 0)" ( (binary_expression "event == 0" identifier == number_literal) )) (compound_statement "{\n    if (logtext != (char *)0x0) {\n      fmt = "Could not set up connection sharing: %s";\nLAB_00031160:\n      logeventf(ssh,fmt);\n      return;\n    }\n    if (ds_err != (char *)0x0) {\n      logeventf(ssh,"Could not set up connection sharing as downstream: %s",ds_err);\n    }\n    if (us_err != (char *)0x0) {\n      logeventf(ssh,"Could not set up connection sharing as upstream: %s");\n      return;\n    }\n  }" { (if_statement "if (logtext != (char *)0x0) {\n      fmt = "Could not set up connection sharing: %s";\nLAB_00031160:\n      logeventf(ssh,fmt);\n      return;\n    }" if (parenthesized_expression "(logtext != (char *)0x0)" ( (binary_expression "logtext != (char *)0x0" identifier != (cast_expression "(char *)0x0" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n      fmt = "Could not set up connection sharing: %s";\nLAB_00031160:\n      logeventf(ssh,fmt);\n      return;\n    }" { (expression_statement "fmt = "Could not set up connection sharing: %s";" (assignment_expression "fmt = "Could not set up connection sharing: %s"" identifier = (string_literal ""Could not set up connection sharing: %s"" " string_content ")) ;) (labeled_statement "LAB_00031160:\n      logeventf(ssh,fmt);" statement_identifier : (expression_statement "logeventf(ssh,fmt);" (call_expression "logeventf(ssh,fmt)" identifier (argument_list "(ssh,fmt)" ( identifier , identifier ))) ;)) (return_statement "return;" return ;) })) (if_statement "if (ds_err != (char *)0x0) {\n      logeventf(ssh,"Could not set up connection sharing as downstream: %s",ds_err);\n    }" if (parenthesized_expression "(ds_err != (char *)0x0)" ( (binary_expression "ds_err != (char *)0x0" identifier != (cast_expression "(char *)0x0" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n      logeventf(ssh,"Could not set up connection sharing as downstream: %s",ds_err);\n    }" { (expression_statement "logeventf(ssh,"Could not set up connection sharing as downstream: %s",ds_err);" (call_expression "logeventf(ssh,"Could not set up connection sharing as downstream: %s",ds_err)" identifier (argument_list "(ssh,"Could not set up connection sharing as downstream: %s",ds_err)" ( identifier , (string_literal ""Could not set up connection sharing as downstream: %s"" " string_content ") , identifier ))) ;) })) (if_statement "if (us_err != (char *)0x0) {\n      logeventf(ssh,"Could not set up connection sharing as upstream: %s");\n      return;\n    }" if (parenthesized_expression "(us_err != (char *)0x0)" ( (binary_expression "us_err != (char *)0x0" identifier != (cast_expression "(char *)0x0" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n      logeventf(ssh,"Could not set up connection sharing as upstream: %s");\n      return;\n    }" { (expression_statement "logeventf(ssh,"Could not set up connection sharing as upstream: %s");" (call_expression "logeventf(ssh,"Could not set up connection sharing as upstream: %s")" identifier (argument_list "(ssh,"Could not set up connection sharing as upstream: %s")" ( identifier , (string_literal ""Could not set up connection sharing as upstream: %s"" " string_content ") ))) ;) (return_statement "return;" return ;) })) }) (else_clause "else if (event == 1) {\n    logeventf(ssh,"Using existing shared connection at %s",logtext);\n    if (((byte)flags & 5) != 0) {\n      c_write((Ssh_conflict)&ssh->frontend,"Reusing a shared connection to this server.\r\n",0x2d);\n      return;\n    }\n  }\n  else if (event == 2) {\n    fmt = "Sharing this connection at %s";\n    goto LAB_00031160;\n  }" else (if_statement "if (event == 1) {\n    logeventf(ssh,"Using existing shared connection at %s",logtext);\n    if (((byte)flags & 5) != 0) {\n      c_write((Ssh_conflict)&ssh->frontend,"Reusing a shared connection to this server.\r\n",0x2d);\n      return;\n    }\n  }\n  else if (event == 2) {\n    fmt = "Sharing this connection at %s";\n    goto LAB_00031160;\n  }" if (parenthesized_expression "(event == 1)" ( (binary_expression "event == 1" identifier == number_literal) )) (compound_statement "{\n    logeventf(ssh,"Using existing shared connection at %s",logtext);\n    if (((byte)flags & 5) != 0) {\n      c_write((Ssh_conflict)&ssh->frontend,"Reusing a shared connection to this server.\r\n",0x2d);\n      return;\n    }\n  }" { (expression_statement "logeventf(ssh,"Using existing shared connection at %s",logtext);" (call_expression "logeventf(ssh,"Using existing shared connection at %s",logtext)" identifier (argument_list "(ssh,"Using existing shared connection at %s",logtext)" ( identifier , (string_literal ""Using existing shared connection at %s"" " string_content ") , identifier ))) ;) (if_statement "if (((byte)flags & 5) != 0) {\n      c_write((Ssh_conflict)&ssh->frontend,"Reusing a shared connection to this server.\r\n",0x2d);\n      return;\n    }" if (parenthesized_expression "(((byte)flags & 5) != 0)" ( (binary_expression "((byte)flags & 5) != 0" (parenthesized_expression "((byte)flags & 5)" ( (binary_expression "(byte)flags & 5" (cast_expression "(byte)flags" ( (type_descriptor "byte" type_identifier) ) identifier) & number_literal) )) != number_literal) )) (compound_statement "{\n      c_write((Ssh_conflict)&ssh->frontend,"Reusing a shared connection to this server.\r\n",0x2d);\n      return;\n    }" { (expression_statement "c_write((Ssh_conflict)&ssh->frontend,"Reusing a shared connection to this server.\r\n",0x2d);" (call_expression "c_write((Ssh_conflict)&ssh->frontend,"Reusing a shared connection to this server.\r\n",0x2d)" identifier (argument_list "((Ssh_conflict)&ssh->frontend,"Reusing a shared connection to this server.\r\n",0x2d)" ( (binary_expression "(Ssh_conflict)&ssh->frontend" (parenthesized_expression "(Ssh_conflict)" ( identifier )) & (field_expression "ssh->frontend" identifier -> field_identifier)) , (string_literal ""Reusing a shared connection to this server.\r\n"" " string_content escape_sequence escape_sequence ") , number_literal ))) ;) (return_statement "return;" return ;) })) }) (else_clause "else if (event == 2) {\n    fmt = "Sharing this connection at %s";\n    goto LAB_00031160;\n  }" else (if_statement "if (event == 2) {\n    fmt = "Sharing this connection at %s";\n    goto LAB_00031160;\n  }" if (parenthesized_expression "(event == 2)" ( (binary_expression "event == 2" identifier == number_literal) )) (compound_statement "{\n    fmt = "Sharing this connection at %s";\n    goto LAB_00031160;\n  }" { (expression_statement "fmt = "Sharing this connection at %s";" (assignment_expression "fmt = "Sharing this connection at %s"" identifier = (string_literal ""Sharing this connection at %s"" " string_content ")) ;) (goto_statement "goto LAB_00031160;" goto statement_identifier ;) })))))) (return_statement "return;" return ;) })))
(translation_unit "void FUN_00031130(undefined4 param_1,int param_2,int param_3,int param_4,int param_5)\n\n{\n  if (param_2 == 0) {\n    if (param_3 != 0) {\nLAB_00031160:\n      FUN_0002b2e0();\n      return;\n    }\n    if (param_4 != 0) {\n      FUN_0002b2e0(param_1,"Could not set up connection sharing as downstream: %s",param_4);\n    }\n    if (param_5 != 0) {\n      FUN_0002b2e0();\n      return;\n    }\n  }\n  else if (param_2 == 1) {\n    FUN_0002b2e0(param_1,"Using existing shared connection at %s",param_3);\n    if (((byte)DAT_000aab28 & 5) != 0) {\n      FUN_0002dbe0();\n      return;\n    }\n  }\n  else if (param_2 == 2) goto LAB_00031160;\n  return;\n}\n\n" (function_definition "void FUN_00031130(undefined4 param_1,int param_2,int param_3,int param_4,int param_5)\n\n{\n  if (param_2 == 0) {\n    if (param_3 != 0) {\nLAB_00031160:\n      FUN_0002b2e0();\n      return;\n    }\n    if (param_4 != 0) {\n      FUN_0002b2e0(param_1,"Could not set up connection sharing as downstream: %s",param_4);\n    }\n    if (param_5 != 0) {\n      FUN_0002b2e0();\n      return;\n    }\n  }\n  else if (param_2 == 1) {\n    FUN_0002b2e0(param_1,"Using existing shared connection at %s",param_3);\n    if (((byte)DAT_000aab28 & 5) != 0) {\n      FUN_0002dbe0();\n      return;\n    }\n  }\n  else if (param_2 == 2) goto LAB_00031160;\n  return;\n}" primitive_type (function_declarator "FUN_00031130(undefined4 param_1,int param_2,int param_3,int param_4,int param_5)" identifier (parameter_list "(undefined4 param_1,int param_2,int param_3,int param_4,int param_5)" ( (parameter_declaration "undefined4 param_1" type_identifier identifier) , (parameter_declaration "int param_2" primitive_type identifier) , (parameter_declaration "int param_3" primitive_type identifier) , (parameter_declaration "int param_4" primitive_type identifier) , (parameter_declaration "int param_5" primitive_type identifier) ))) (compound_statement "{\n  if (param_2 == 0) {\n    if (param_3 != 0) {\nLAB_00031160:\n      FUN_0002b2e0();\n      return;\n    }\n    if (param_4 != 0) {\n      FUN_0002b2e0(param_1,"Could not set up connection sharing as downstream: %s",param_4);\n    }\n    if (param_5 != 0) {\n      FUN_0002b2e0();\n      return;\n    }\n  }\n  else if (param_2 == 1) {\n    FUN_0002b2e0(param_1,"Using existing shared connection at %s",param_3);\n    if (((byte)DAT_000aab28 & 5) != 0) {\n      FUN_0002dbe0();\n      return;\n    }\n  }\n  else if (param_2 == 2) goto LAB_00031160;\n  return;\n}" { (if_statement "if (param_2 == 0) {\n    if (param_3 != 0) {\nLAB_00031160:\n      FUN_0002b2e0();\n      return;\n    }\n    if (param_4 != 0) {\n      FUN_0002b2e0(param_1,"Could not set up connection sharing as downstream: %s",param_4);\n    }\n    if (param_5 != 0) {\n      FUN_0002b2e0();\n      return;\n    }\n  }\n  else if (param_2 == 1) {\n    FUN_0002b2e0(param_1,"Using existing shared connection at %s",param_3);\n    if (((byte)DAT_000aab28 & 5) != 0) {\n      FUN_0002dbe0();\n      return;\n    }\n  }\n  else if (param_2 == 2) goto LAB_00031160;" if (parenthesized_expression "(param_2 == 0)" ( (binary_expression "param_2 == 0" identifier == number_literal) )) (compound_statement "{\n    if (param_3 != 0) {\nLAB_00031160:\n      FUN_0002b2e0();\n      return;\n    }\n    if (param_4 != 0) {\n      FUN_0002b2e0(param_1,"Could not set up connection sharing as downstream: %s",param_4);\n    }\n    if (param_5 != 0) {\n      FUN_0002b2e0();\n      return;\n    }\n  }" { (if_statement "if (param_3 != 0) {\nLAB_00031160:\n      FUN_0002b2e0();\n      return;\n    }" if (parenthesized_expression "(param_3 != 0)" ( (binary_expression "param_3 != 0" identifier != number_literal) )) (compound_statement "{\nLAB_00031160:\n      FUN_0002b2e0();\n      return;\n    }" { (labeled_statement "LAB_00031160:\n      FUN_0002b2e0();" statement_identifier : (expression_statement "FUN_0002b2e0();" (call_expression "FUN_0002b2e0()" identifier (argument_list "()" ( ))) ;)) (return_statement "return;" return ;) })) (if_statement "if (param_4 != 0) {\n      FUN_0002b2e0(param_1,"Could not set up connection sharing as downstream: %s",param_4);\n    }" if (parenthesized_expression "(param_4 != 0)" ( (binary_expression "param_4 != 0" identifier != number_literal) )) (compound_statement "{\n      FUN_0002b2e0(param_1,"Could not set up connection sharing as downstream: %s",param_4);\n    }" { (expression_statement "FUN_0002b2e0(param_1,"Could not set up connection sharing as downstream: %s",param_4);" (call_expression "FUN_0002b2e0(param_1,"Could not set up connection sharing as downstream: %s",param_4)" identifier (argument_list "(param_1,"Could not set up connection sharing as downstream: %s",param_4)" ( identifier , (string_literal ""Could not set up connection sharing as downstream: %s"" " string_content ") , identifier ))) ;) })) (if_statement "if (param_5 != 0) {\n      FUN_0002b2e0();\n      return;\n    }" if (parenthesized_expression "(param_5 != 0)" ( (binary_expression "param_5 != 0" identifier != number_literal) )) (compound_statement "{\n      FUN_0002b2e0();\n      return;\n    }" { (expression_statement "FUN_0002b2e0();" (call_expression "FUN_0002b2e0()" identifier (argument_list "()" ( ))) ;) (return_statement "return;" return ;) })) }) (else_clause "else if (param_2 == 1) {\n    FUN_0002b2e0(param_1,"Using existing shared connection at %s",param_3);\n    if (((byte)DAT_000aab28 & 5) != 0) {\n      FUN_0002dbe0();\n      return;\n    }\n  }\n  else if (param_2 == 2) goto LAB_00031160;" else (if_statement "if (param_2 == 1) {\n    FUN_0002b2e0(param_1,"Using existing shared connection at %s",param_3);\n    if (((byte)DAT_000aab28 & 5) != 0) {\n      FUN_0002dbe0();\n      return;\n    }\n  }\n  else if (param_2 == 2) goto LAB_00031160;" if (parenthesized_expression "(param_2 == 1)" ( (binary_expression "param_2 == 1" identifier == number_literal) )) (compound_statement "{\n    FUN_0002b2e0(param_1,"Using existing shared connection at %s",param_3);\n    if (((byte)DAT_000aab28 & 5) != 0) {\n      FUN_0002dbe0();\n      return;\n    }\n  }" { (expression_statement "FUN_0002b2e0(param_1,"Using existing shared connection at %s",param_3);" (call_expression "FUN_0002b2e0(param_1,"Using existing shared connection at %s",param_3)" identifier (argument_list "(param_1,"Using existing shared connection at %s",param_3)" ( identifier , (string_literal ""Using existing shared connection at %s"" " string_content ") , identifier ))) ;) (if_statement "if (((byte)DAT_000aab28 & 5) != 0) {\n      FUN_0002dbe0();\n      return;\n    }" if (parenthesized_expression "(((byte)DAT_000aab28 & 5) != 0)" ( (binary_expression "((byte)DAT_000aab28 & 5) != 0" (parenthesized_expression "((byte)DAT_000aab28 & 5)" ( (binary_expression "(byte)DAT_000aab28 & 5" (cast_expression "(byte)DAT_000aab28" ( (type_descriptor "byte" type_identifier) ) identifier) & number_literal) )) != number_literal) )) (compound_statement "{\n      FUN_0002dbe0();\n      return;\n    }" { (expression_statement "FUN_0002dbe0();" (call_expression "FUN_0002dbe0()" identifier (argument_list "()" ( ))) ;) (return_statement "return;" return ;) })) }) (else_clause "else if (param_2 == 2) goto LAB_00031160;" else (if_statement "if (param_2 == 2) goto LAB_00031160;" if (parenthesized_expression "(param_2 == 2)" ( (binary_expression "param_2 == 2" identifier == number_literal) )) (goto_statement "goto LAB_00031160;" goto statement_identifier ;)))))) (return_statement "return;" return ;) })))
(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) ))) (compound_statement { (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (if_statement if (parenthesized_expression ( (binary_expression IDENT != LIT) )) (compound_statement { (labeled_statement statement_identifier : (expression_statement (call_expression IDENT (argument_list ( ))) ;)) (return_statement return ;) })) (if_statement if (parenthesized_expression ( (binary_expression IDENT != LIT) )) (compound_statement { (expression_statement (call_expression IDENT (argument_list ( IDENT , (string_literal " string_content ") , IDENT ))) ;) })) (if_statement if (parenthesized_expression ( (binary_expression IDENT != LIT) )) (compound_statement { (expression_statement (call_expression IDENT (argument_list ( ))) ;) (return_statement return ;) })) }) (else_clause else (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (expression_statement (call_expression IDENT (argument_list ( IDENT , (string_literal " string_content ") , IDENT ))) ;) (if_statement if (parenthesized_expression ( (binary_expression (parenthesized_expression ( (binary_expression (cast_expression ( (type_descriptor TYPE) ) IDENT) & LIT) )) != LIT) )) (compound_statement { (expression_statement (call_expression IDENT (argument_list ( ))) ;) (return_statement return ;) })) }) (else_clause else (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (goto_statement goto statement_identifier ;)))))) (return_statement return ;) })))
(function_definition "void FUN_00031130(undefined4 param_1,int param_2,int param_3,int param_4,int param_5)\n\n{\n  if (param_2 == 0) {\n    if (param_3 != 0) {\nLAB_00031160:\n      FUN_0002b2e0();\n      return;\n    }\n    if (param_4 != 0) {\n      FUN_0002b2e0(param_1,"Could not set up connection sharing as downstream: %s",param_4);\n    }\n    if (param_5 != 0) {\n      FUN_0002b2e0();\n      return;\n    }\n  }\n  else if (param_2 == 1) {\n    FUN_0002b2e0(param_1,"Using existing shared connection at %s",param_3);\n    if (((byte)DAT_000aab28 & 5) != 0) {\n      FUN_0002dbe0();\n      return;\n    }\n  }\n  else if (param_2 == 2) goto LAB_00031160;\n  return;\n}" (primitive_type "void") (function_declarator "FUN_00031130(undefined4 param_1,int param_2,int param_3,int param_4,int param_5)" (identifier "FUN_00031130") (parameter_list "(undefined4 param_1,int param_2,int param_3,int param_4,int param_5)" (( "(") (parameter_declaration "undefined4 param_1" (type_identifier "undefined4") (identifier "param_1")) (, ",") (parameter_declaration "int param_2" (primitive_type "int") (identifier "param_2")) (, ",") (parameter_declaration "int param_3" (primitive_type "int") (identifier "param_3")) (, ",") (parameter_declaration "int param_4" (primitive_type "int") (identifier "param_4")) (, ",") (parameter_declaration "int param_5" (primitive_type "int") (identifier "param_5")) () ")"))) (compound_statement "{\n  if (param_2 == 0) {\n    if (param_3 != 0) {\nLAB_00031160:\n      FUN_0002b2e0();\n      return;\n    }\n    if (param_4 != 0) {\n      FUN_0002b2e0(param_1,"Could not set up connection sharing as downstream: %s",param_4);\n    }\n    if (param_5 != 0) {\n      FUN_0002b2e0();\n      return;\n    }\n  }\n  else if (param_2 == 1) {\n    FUN_0002b2e0(param_1,"Using existing shared connection at %s",param_3);\n    if (((byte)DAT_000aab28 & 5) != 0) {\n      FUN_0002dbe0();\n      return;\n    }\n  }\n  else if (param_2 == 2) goto LAB_00031160;\n  return;\n}" ({ "{") (if_statement "if (param_2 == 0) {\n    if (param_3 != 0) {\nLAB_00031160:\n      FUN_0002b2e0();\n      return;\n    }\n    if (param_4 != 0) {\n      FUN_0002b2e0(param_1,"Could not set up connection sharing as downstream: %s",param_4);\n    }\n    if (param_5 != 0) {\n      FUN_0002b2e0();\n      return;\n    }\n  }\n  else if (param_2 == 1) {\n    FUN_0002b2e0(param_1,"Using existing shared connection at %s",param_3);\n    if (((byte)DAT_000aab28 & 5) != 0) {\n      FUN_0002dbe0();\n      return;\n    }\n  }\n  else if (param_2 == 2) goto LAB_00031160;" (if "if") (parenthesized_expression "(param_2 == 0)" (( "(") (binary_expression "param_2 == 0" (identifier "param_2") (== "==") (number_literal "0")) () ")")) (compound_statement "{\n    if (param_3 != 0) {\nLAB_00031160:\n      FUN_0002b2e0();\n      return;\n    }\n    if (param_4 != 0) {\n      FUN_0002b2e0(param_1,"Could not set up connection sharing as downstream: %s",param_4);\n    }\n    if (param_5 != 0) {\n      FUN_0002b2e0();\n      return;\n    }\n  }" ({ "{") (if_statement "if (param_3 != 0) {\nLAB_00031160:\n      FUN_0002b2e0();\n      return;\n    }" (if "if") (parenthesized_expression "(param_3 != 0)" (( "(") (binary_expression "param_3 != 0" (identifier "param_3") (!= "!=") (number_literal "0")) () ")")) (compound_statement "{\nLAB_00031160:\n      FUN_0002b2e0();\n      return;\n    }" ({ "{") (labeled_statement "LAB_00031160:\n      FUN_0002b2e0();" (statement_identifier "LAB_00031160") (: ":") (expression_statement "FUN_0002b2e0();" (call_expression "FUN_0002b2e0()" (identifier "FUN_0002b2e0") (argument_list "()" (( "(") () ")"))) (; ";"))) (return_statement "return;" (return "return") (; ";")) (} "}"))) (if_statement "if (param_4 != 0) {\n      FUN_0002b2e0(param_1,"Could not set up connection sharing as downstream: %s",param_4);\n    }" (if "if") (parenthesized_expression "(param_4 != 0)" (( "(") (binary_expression "param_4 != 0" (identifier "param_4") (!= "!=") (number_literal "0")) () ")")) (compound_statement "{\n      FUN_0002b2e0(param_1,"Could not set up connection sharing as downstream: %s",param_4);\n    }" ({ "{") (expression_statement "FUN_0002b2e0(param_1,"Could not set up connection sharing as downstream: %s",param_4);" (call_expression "FUN_0002b2e0(param_1,"Could not set up connection sharing as downstream: %s",param_4)" (identifier "FUN_0002b2e0") (argument_list "(param_1,"Could not set up connection sharing as downstream: %s",param_4)" (( "(") (identifier "param_1") (, ",") (string_literal ""Could not set up connection sharing as downstream: %s"" (" """) (string_content "Could not set up connection sharing as downstream: %s") (" """)) (, ",") (identifier "param_4") () ")"))) (; ";")) (} "}"))) (if_statement "if (param_5 != 0) {\n      FUN_0002b2e0();\n      return;\n    }" (if "if") (parenthesized_expression "(param_5 != 0)" (( "(") (binary_expression "param_5 != 0" (identifier "param_5") (!= "!=") (number_literal "0")) () ")")) (compound_statement "{\n      FUN_0002b2e0();\n      return;\n    }" ({ "{") (expression_statement "FUN_0002b2e0();" (call_expression "FUN_0002b2e0()" (identifier "FUN_0002b2e0") (argument_list "()" (( "(") () ")"))) (; ";")) (return_statement "return;" (return "return") (; ";")) (} "}"))) (} "}")) (else_clause "else if (param_2 == 1) {\n    FUN_0002b2e0(param_1,"Using existing shared connection at %s",param_3);\n    if (((byte)DAT_000aab28 & 5) != 0) {\n      FUN_0002dbe0();\n      return;\n    }\n  }\n  else if (param_2 == 2) goto LAB_00031160;" (else "else") (if_statement "if (param_2 == 1) {\n    FUN_0002b2e0(param_1,"Using existing shared connection at %s",param_3);\n    if (((byte)DAT_000aab28 & 5) != 0) {\n      FUN_0002dbe0();\n      return;\n    }\n  }\n  else if (param_2 == 2) goto LAB_00031160;" (if "if") (parenthesized_expression "(param_2 == 1)" (( "(") (binary_expression "param_2 == 1" (identifier "param_2") (== "==") (number_literal "1")) () ")")) (compound_statement "{\n    FUN_0002b2e0(param_1,"Using existing shared connection at %s",param_3);\n    if (((byte)DAT_000aab28 & 5) != 0) {\n      FUN_0002dbe0();\n      return;\n    }\n  }" ({ "{") (expression_statement "FUN_0002b2e0(param_1,"Using existing shared connection at %s",param_3);" (call_expression "FUN_0002b2e0(param_1,"Using existing shared connection at %s",param_3)" (identifier "FUN_0002b2e0") (argument_list "(param_1,"Using existing shared connection at %s",param_3)" (( "(") (identifier "param_1") (, ",") (string_literal ""Using existing shared connection at %s"" (" """) (string_content "Using existing shared connection at %s") (" """)) (, ",") (identifier "param_3") () ")"))) (; ";")) (if_statement "if (((byte)DAT_000aab28 & 5) != 0) {\n      FUN_0002dbe0();\n      return;\n    }" (if "if") (parenthesized_expression "(((byte)DAT_000aab28 & 5) != 0)" (( "(") (binary_expression "((byte)DAT_000aab28 & 5) != 0" (parenthesized_expression "((byte)DAT_000aab28 & 5)" (( "(") (binary_expression "(byte)DAT_000aab28 & 5" (cast_expression "(byte)DAT_000aab28" (( "(") (type_descriptor "byte" (type_identifier "byte")) () ")") (identifier "DAT_000aab28")) (& "&") (number_literal "5")) () ")")) (!= "!=") (number_literal "0")) () ")")) (compound_statement "{\n      FUN_0002dbe0();\n      return;\n    }" ({ "{") (expression_statement "FUN_0002dbe0();" (call_expression "FUN_0002dbe0()" (identifier "FUN_0002dbe0") (argument_list "()" (( "(") () ")"))) (; ";")) (return_statement "return;" (return "return") (; ";")) (} "}"))) (} "}")) (else_clause "else if (param_2 == 2) goto LAB_00031160;" (else "else") (if_statement "if (param_2 == 2) goto LAB_00031160;" (if "if") (parenthesized_expression "(param_2 == 2)" (( "(") (binary_expression "param_2 == 2" (identifier "param_2") (== "==") (number_literal "2")) () ")")) (goto_statement "goto LAB_00031160;" (goto "goto") (statement_identifier "LAB_00031160") (; ";"))))))) (return_statement "return;" (return "return") (; ";")) (} "}")))

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

void function_1(type_1 ssh,int var_1,char *var_2,char *var_4,char *var_5)

{
  char *fmt;
  
  if (var_1 == 0) {
    if (var_2 != (char *)0x0) {
      fmt = "Could not set up connection sharing: %s";
LAB_00031160:
      var_3(ssh,fmt);
      return;
    }
    if (var_4 != (char *)0x0) {
      var_3(ssh,"Could not set up connection sharing as downstream: %s",var_4);
    }
    if (var_5 != (char *)0x0) {
      var_3(ssh,"Could not set up connection sharing as upstream: %s");
      return;
    }
  }
  else if (var_1 == 1) {
    var_3(ssh,"Using existing shared connection at %s",var_2);
    if (((type_2)flags & 5) != 0) {
      var_6((type_1)&ssh->frontend,"Reusing a shared connection to this server.\r\n",0x2d);
      return;
    }
  }
  else if (var_1 == 2) {
    fmt = "Sharing this connection at %s";
    goto LAB_00031160;
  }
  return;
}


(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: (primitive_type) declarator: (identifier)) (parameter_declaration type: (primitive_type) declarator: (identifier)) (parameter_declaration type: (primitive_type) declarator: (identifier)))) body: (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: (compound_statement (labeled_statement label: (statement_identifier) (expression_statement (call_expression function: (identifier) arguments: (argument_list)))) (return_statement))) (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) (string_literal (string_content)) (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))) (return_statement)))) alternative: (else_clause (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) (string_literal (string_content)) (identifier)))) (if_statement condition: (parenthesized_expression (binary_expression left: (parenthesized_expression (binary_expression left: (cast_expression type: (type_descriptor type: (type_identifier)) value: (identifier)) right: (number_literal))) right: (number_literal))) consequence: (compound_statement (expression_statement (call_expression function: (identifier) arguments: (argument_list))) (return_statement)))) alternative: (else_clause (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (goto_statement label: (statement_identifier))))))) (return_statement))))

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

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

{
  if (param_2 == 0) {
    if (param_3 != 0) {
LAB_00031160:
      FUN_0002b2e0();
      return;
    }
    if (param_4 != 0) {
      FUN_0002b2e0(param_1,"Could not set up connection sharing as downstream: %s",param_4);
    }
    if (param_5 != 0) {
      FUN_0002b2e0();
      return;
    }
  }
  else if (param_2 == 1) {
    FUN_0002b2e0(param_1,"Using existing shared connection at %s",param_3);
    if (((byte)DAT_000aab28 & 5) != 0) {
      FUN_0002dbe0();
      return;
    }
  }
  else if (param_2 == 2) goto LAB_00031160;
  return;
}

