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

SSL * __regparm3 doConnection(SSL *scon,char *host,SSL_CTX *ctx)

{
  int iVar1;
  BIO_METHOD *type;
  BIO *bp;
  int iVar2;
  char *pcVar3;
  SSL *s;
  int in_GS_OFFSET;
  linger no_linger;
  
  iVar1 = *(int *)(in_GS_OFFSET + 0x14);
  type = BIO_s_connect();
  bp = BIO_new(type);
  if (bp != (BIO *)0x0) {
    BIO_ctrl(bp,100,0,host);
    BIO_ctrl(bp,0x9b,0x10,(void *)0x0);
    if (scon == (SSL *)0x0) {
      s = SSL_new((SSL_CTX *)ctx);
    }
    else {
      SSL_set_connect_state((SSL *)scon);
      s = (SSL *)scon;
    }
    SSL_set_bio(s,bp,bp);
    iVar2 = SSL_connect(s);
    if (0 < iVar2) {
      no_linger.l_onoff = 1;
      no_linger.l_linger = 0;
      iVar2 = SSL_get_fd(s);
      if (-1 < iVar2) {
        setsockopt(iVar2,1,0xd,&no_linger,8);
      }
      goto LAB_0005ff5e;
    }
    BIO_printf((BIO *)bio_err,"ERROR\n");
    if (verify_args.error == 0) {
      ERR_print_errors((BIO *)bio_err);
    }
    else {
      pcVar3 = X509_verify_cert_error_string(verify_args.error);
      BIO_printf((BIO *)bio_err,"verify error:%s\n",pcVar3);
    }
    if (scon == (SSL *)0x0) {
      SSL_free(s);
    }
  }
  s = (SSL *)0x0;
LAB_0005ff5e:
  if (iVar1 == *(int *)(in_GS_OFFSET + 0x14)) {
    return (SSL *)s;
  }
                    /* WARNING: Subroutine does not return */
  __stack_chk_fail_local();
}



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

SSL * __regparm3 FUN_0005feb0(SSL *param_1,void *param_2,SSL_CTX *param_3)

{
  BIO_METHOD *type;
  BIO *bp;
  int iVar1;
  char *pcVar2;
  SSL *s;
  int in_GS_OFFSET;
  undefined4 local_28;
  undefined4 local_24;
  int local_20;
  undefined4 uStack_14;
  
  uStack_14 = 0x5febd;
  local_20 = *(int *)(in_GS_OFFSET + 0x14);
  type = BIO_s_connect();
  bp = BIO_new(type);
  if (bp != (BIO *)0x0) {
    BIO_ctrl(bp,100,0,param_2);
    BIO_ctrl(bp,0x9b,0x10,(void *)0x0);
    if (param_1 == (SSL *)0x0) {
      s = SSL_new(param_3);
    }
    else {
      SSL_set_connect_state(param_1);
      s = param_1;
    }
    SSL_set_bio(s,bp,bp);
    iVar1 = SSL_connect(s);
    if (0 < iVar1) {
      local_28 = 1;
      local_24 = 0;
      iVar1 = SSL_get_fd(s);
      if (-1 < iVar1) {
        setsockopt(iVar1,1,0xd,&local_28,8);
      }
      goto LAB_0005ff5e;
    }
    BIO_printf(DAT_000c458c,"ERROR\n");
    if (DAT_000c3f38 == 0) {
      ERR_print_errors(DAT_000c458c);
    }
    else {
      pcVar2 = X509_verify_cert_error_string(DAT_000c3f38);
      BIO_printf(DAT_000c458c,"verify error:%s\n",pcVar2);
    }
    if (param_1 == (SSL *)0x0) {
      SSL_free(s);
    }
  }
  s = (SSL *)0x0;
LAB_0005ff5e:
  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {
    return s;
  }
                    /* WARNING: Subroutine does not return */
  FUN_0007d010();
}


PUSH EBP
PUSH EDI
MOV EDI,EAX
PUSH ESI
MOV ESI,EDX
PUSH EBX
CALL 0x0002c7d0
ADD EBX,0x5cbbb
SUB ESP,0x2c
MOV dword ptr [ESP + 0xc],ECX
MOV EAX,GS:[0x14]
MOV dword ptr [ESP + 0x1c],EAX
XOR EAX,EAX
CALL 0x00028480
SUB ESP,0xc
PUSH EAX
CALL 0x00029060
ADD ESP,0x10
TEST EAX,EAX
JZ 0x00060000
PUSH ESI
MOV EBP,EAX
PUSH 0x0
PUSH 0x64
PUSH EAX
CALL 0x0002b800
PUSH 0x0
PUSH 0x10
PUSH 0x9b
PUSH EBP
CALL 0x0002b800
ADD ESP,0x20
TEST EDI,EDI
JZ 0x00060010
SUB ESP,0xc
MOV ESI,EDI
PUSH EDI
CALL 0x0002b610
ADD ESP,0x10
SUB ESP,0x4
PUSH EBP
PUSH EBP
PUSH ESI
CALL 0x0002aee0
MOV dword ptr [ESP],ESI
CALL 0x00029c50
ADD ESP,0x10
TEST EAX,EAX
JLE 0x0005ffa0
MOV dword ptr [ESP + 0x14],0x1
SUB ESP,0xc
MOV dword ptr [ESP + 0x24],0x0
PUSH ESI
CALL 0x0002bc10
ADD ESP,0x10
TEST EAX,EAX
JNS 0x0005ff80
MOV ECX,dword ptr [ESP + 0x1c]
XOR ECX,dword ptr GS:[0x14]
MOV EAX,ESI
JNZ 0x00060040
ADD ESP,0x2c
POP EBX
POP ESI
POP EDI
POP EBP
RET
SUB ESP,0xc
PUSH 0x8
LEA EDX,[ESP + 0x24]
PUSH EDX
PUSH 0xd
PUSH 0x1
PUSH EAX
CALL 0x0002b370
ADD ESP,0x20
JMP 0x0005ff5e
LEA EBP,[EBX + 0x7b14]
SUB ESP,0x8
LEA EAX,[EBX + 0xfffd04e8]
PUSH EAX
PUSH dword ptr [EBP]
CALL 0x00027240
LEA EAX,[EBX + 0x74b8]
ADD ESP,0x10
MOV EAX,dword ptr [EAX + 0x8]
TEST EAX,EAX
JZ 0x00060030
SUB ESP,0xc
PUSH EAX
CALL 0x0002afd0
ADD ESP,0xc
PUSH EAX
LEA EAX,[EBX + 0xfffd053a]
PUSH EAX
PUSH dword ptr [EBP]
CALL 0x00027240
ADD ESP,0x10
TEST EDI,EDI
JNZ 0x00060000
SUB ESP,0xc
PUSH ESI
CALL 0x0002a220
ADD ESP,0x10
LEA ESI,[ESI]
NOP
XOR ESI,ESI
JMP 0x0005ff5e
SUB ESP,0xc
PUSH dword ptr [ESP + 0x18]
CALL 0x00028d40
ADD ESP,0x10
MOV ESI,EAX
JMP 0x0005ff24
SUB ESP,0xc
PUSH dword ptr [EBP]
CALL 0x0002c0c0
ADD ESP,0x10
JMP 0x0005ffe7
CALL 0x0007d010
(translation_unit "/* WARNING: Function: __i686.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n\nSSL * __regparm3 FUN_0005feb0(SSL *param_1,void *param_2,SSL_CTX *param_3)\n\n{\n  BIO_METHOD *type;\n  BIO *bp;\n  int iVar1;\n  char *pcVar2;\n  SSL *s;\n  int in_GS_OFFSET;\n  undefined4 local_28;\n  undefined4 local_24;\n  int local_20;\n  undefined4 uStack_14;\n  \n  uStack_14 = 0x5febd;\n  local_20 = *(int *)(in_GS_OFFSET + 0x14);\n  type = BIO_s_connect();\n  bp = BIO_new(type);\n  if (bp != (BIO *)0x0) {\n    BIO_ctrl(bp,100,0,param_2);\n    BIO_ctrl(bp,0x9b,0x10,(void *)0x0);\n    if (param_1 == (SSL *)0x0) {\n      s = SSL_new(param_3);\n    }\n    else {\n      SSL_set_connect_state(param_1);\n      s = param_1;\n    }\n    SSL_set_bio(s,bp,bp);\n    iVar1 = SSL_connect(s);\n    if (0 < iVar1) {\n      local_28 = 1;\n      local_24 = 0;\n      iVar1 = SSL_get_fd(s);\n      if (-1 < iVar1) {\n        setsockopt(iVar1,1,0xd,&local_28,8);\n      }\n      goto LAB_0005ff5e;\n    }\n    BIO_printf(DAT_000c458c,"ERROR\n");\n    if (DAT_000c3f38 == 0) {\n      ERR_print_errors(DAT_000c458c);\n    }\n    else {\n      pcVar2 = X509_verify_cert_error_string(DAT_000c3f38);\n      BIO_printf(DAT_000c458c,"verify error:%s\n",pcVar2);\n    }\n    if (param_1 == (SSL *)0x0) {\n      SSL_free(s);\n    }\n  }\n  s = (SSL *)0x0;\nLAB_0005ff5e:\n  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return s;\n  }\n                    /* WARNING: Subroutine does not return */\n  FUN_0007d010();\n}\n\n" comment (ERROR "SSL * __regparm3 FUN_0005feb0(SSL *param_1,void *param_2,SSL_CTX *param_3)" (binary_expression "SSL * __regparm3 FUN_0005feb0(SSL *param_1,void *param_2,SSL_CTX *param_3)" identifier * (ERROR "__regparm3" identifier) (call_expression "FUN_0005feb0(SSL *param_1,void *param_2,SSL_CTX *param_3)" identifier (argument_list "(SSL *param_1,void *param_2,SSL_CTX *param_3)" ( (binary_expression "SSL *param_1" identifier * identifier) , (binary_expression "void *param_2" identifier * identifier) , (binary_expression "SSL_CTX *param_3" identifier * identifier) ))))) (compound_statement "{\n  BIO_METHOD *type;\n  BIO *bp;\n  int iVar1;\n  char *pcVar2;\n  SSL *s;\n  int in_GS_OFFSET;\n  undefined4 local_28;\n  undefined4 local_24;\n  int local_20;\n  undefined4 uStack_14;\n  \n  uStack_14 = 0x5febd;\n  local_20 = *(int *)(in_GS_OFFSET + 0x14);\n  type = BIO_s_connect();\n  bp = BIO_new(type);\n  if (bp != (BIO *)0x0) {\n    BIO_ctrl(bp,100,0,param_2);\n    BIO_ctrl(bp,0x9b,0x10,(void *)0x0);\n    if (param_1 == (SSL *)0x0) {\n      s = SSL_new(param_3);\n    }\n    else {\n      SSL_set_connect_state(param_1);\n      s = param_1;\n    }\n    SSL_set_bio(s,bp,bp);\n    iVar1 = SSL_connect(s);\n    if (0 < iVar1) {\n      local_28 = 1;\n      local_24 = 0;\n      iVar1 = SSL_get_fd(s);\n      if (-1 < iVar1) {\n        setsockopt(iVar1,1,0xd,&local_28,8);\n      }\n      goto LAB_0005ff5e;\n    }\n    BIO_printf(DAT_000c458c,"ERROR\n");\n    if (DAT_000c3f38 == 0) {\n      ERR_print_errors(DAT_000c458c);\n    }\n    else {\n      pcVar2 = X509_verify_cert_error_string(DAT_000c3f38);\n      BIO_printf(DAT_000c458c,"verify error:%s\n",pcVar2);\n    }\n    if (param_1 == (SSL *)0x0) {\n      SSL_free(s);\n    }\n  }\n  s = (SSL *)0x0;\nLAB_0005ff5e:\n  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return s;\n  }\n                    /* WARNING: Subroutine does not return */\n  FUN_0007d010();\n}" { (declaration "BIO_METHOD *type;" type_identifier (pointer_declarator "*type" * identifier) ;) (declaration "BIO *bp;" type_identifier (pointer_declarator "*bp" * identifier) ;) (declaration "int iVar1;" primitive_type identifier ;) (declaration "char *pcVar2;" primitive_type (pointer_declarator "*pcVar2" * identifier) ;) (declaration "SSL *s;" type_identifier (pointer_declarator "*s" * identifier) ;) (declaration "int in_GS_OFFSET;" primitive_type identifier ;) (declaration "undefined4 local_28;" type_identifier identifier ;) (declaration "undefined4 local_24;" type_identifier identifier ;) (declaration "int local_20;" primitive_type identifier ;) (declaration "undefined4 uStack_14;" type_identifier identifier ;) (expression_statement "uStack_14 = 0x5febd;" (assignment_expression "uStack_14 = 0x5febd" 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) ))))) ;) (expression_statement "type = BIO_s_connect();" (assignment_expression "type = BIO_s_connect()" identifier = (call_expression "BIO_s_connect()" identifier (argument_list "()" ( )))) ;) (expression_statement "bp = BIO_new(type);" (assignment_expression "bp = BIO_new(type)" identifier = (call_expression "BIO_new(type)" identifier (argument_list "(type)" ( identifier )))) ;) (if_statement "if (bp != (BIO *)0x0) {\n    BIO_ctrl(bp,100,0,param_2);\n    BIO_ctrl(bp,0x9b,0x10,(void *)0x0);\n    if (param_1 == (SSL *)0x0) {\n      s = SSL_new(param_3);\n    }\n    else {\n      SSL_set_connect_state(param_1);\n      s = param_1;\n    }\n    SSL_set_bio(s,bp,bp);\n    iVar1 = SSL_connect(s);\n    if (0 < iVar1) {\n      local_28 = 1;\n      local_24 = 0;\n      iVar1 = SSL_get_fd(s);\n      if (-1 < iVar1) {\n        setsockopt(iVar1,1,0xd,&local_28,8);\n      }\n      goto LAB_0005ff5e;\n    }\n    BIO_printf(DAT_000c458c,"ERROR\n");\n    if (DAT_000c3f38 == 0) {\n      ERR_print_errors(DAT_000c458c);\n    }\n    else {\n      pcVar2 = X509_verify_cert_error_string(DAT_000c3f38);\n      BIO_printf(DAT_000c458c,"verify error:%s\n",pcVar2);\n    }\n    if (param_1 == (SSL *)0x0) {\n      SSL_free(s);\n    }\n  }" if (parenthesized_expression "(bp != (BIO *)0x0)" ( (binary_expression "bp != (BIO *)0x0" identifier != (cast_expression "(BIO *)0x0" ( (type_descriptor "BIO *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n    BIO_ctrl(bp,100,0,param_2);\n    BIO_ctrl(bp,0x9b,0x10,(void *)0x0);\n    if (param_1 == (SSL *)0x0) {\n      s = SSL_new(param_3);\n    }\n    else {\n      SSL_set_connect_state(param_1);\n      s = param_1;\n    }\n    SSL_set_bio(s,bp,bp);\n    iVar1 = SSL_connect(s);\n    if (0 < iVar1) {\n      local_28 = 1;\n      local_24 = 0;\n      iVar1 = SSL_get_fd(s);\n      if (-1 < iVar1) {\n        setsockopt(iVar1,1,0xd,&local_28,8);\n      }\n      goto LAB_0005ff5e;\n    }\n    BIO_printf(DAT_000c458c,"ERROR\n");\n    if (DAT_000c3f38 == 0) {\n      ERR_print_errors(DAT_000c458c);\n    }\n    else {\n      pcVar2 = X509_verify_cert_error_string(DAT_000c3f38);\n      BIO_printf(DAT_000c458c,"verify error:%s\n",pcVar2);\n    }\n    if (param_1 == (SSL *)0x0) {\n      SSL_free(s);\n    }\n  }" { (expression_statement "BIO_ctrl(bp,100,0,param_2);" (call_expression "BIO_ctrl(bp,100,0,param_2)" identifier (argument_list "(bp,100,0,param_2)" ( identifier , number_literal , number_literal , identifier ))) ;) (expression_statement "BIO_ctrl(bp,0x9b,0x10,(void *)0x0);" (call_expression "BIO_ctrl(bp,0x9b,0x10,(void *)0x0)" identifier (argument_list "(bp,0x9b,0x10,(void *)0x0)" ( identifier , number_literal , number_literal , (cast_expression "(void *)0x0" ( (type_descriptor "void *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal) ))) ;) (if_statement "if (param_1 == (SSL *)0x0) {\n      s = SSL_new(param_3);\n    }\n    else {\n      SSL_set_connect_state(param_1);\n      s = param_1;\n    }" if (parenthesized_expression "(param_1 == (SSL *)0x0)" ( (binary_expression "param_1 == (SSL *)0x0" identifier == (cast_expression "(SSL *)0x0" ( (type_descriptor "SSL *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n      s = SSL_new(param_3);\n    }" { (expression_statement "s = SSL_new(param_3);" (assignment_expression "s = SSL_new(param_3)" identifier = (call_expression "SSL_new(param_3)" identifier (argument_list "(param_3)" ( identifier )))) ;) }) (else_clause "else {\n      SSL_set_connect_state(param_1);\n      s = param_1;\n    }" else (compound_statement "{\n      SSL_set_connect_state(param_1);\n      s = param_1;\n    }" { (expression_statement "SSL_set_connect_state(param_1);" (call_expression "SSL_set_connect_state(param_1)" identifier (argument_list "(param_1)" ( identifier ))) ;) (expression_statement "s = param_1;" (assignment_expression "s = param_1" identifier = identifier) ;) }))) (expression_statement "SSL_set_bio(s,bp,bp);" (call_expression "SSL_set_bio(s,bp,bp)" identifier (argument_list "(s,bp,bp)" ( identifier , identifier , identifier ))) ;) (expression_statement "iVar1 = SSL_connect(s);" (assignment_expression "iVar1 = SSL_connect(s)" identifier = (call_expression "SSL_connect(s)" identifier (argument_list "(s)" ( identifier )))) ;) (if_statement "if (0 < iVar1) {\n      local_28 = 1;\n      local_24 = 0;\n      iVar1 = SSL_get_fd(s);\n      if (-1 < iVar1) {\n        setsockopt(iVar1,1,0xd,&local_28,8);\n      }\n      goto LAB_0005ff5e;\n    }" if (parenthesized_expression "(0 < iVar1)" ( (binary_expression "0 < iVar1" number_literal < identifier) )) (compound_statement "{\n      local_28 = 1;\n      local_24 = 0;\n      iVar1 = SSL_get_fd(s);\n      if (-1 < iVar1) {\n        setsockopt(iVar1,1,0xd,&local_28,8);\n      }\n      goto LAB_0005ff5e;\n    }" { (expression_statement "local_28 = 1;" (assignment_expression "local_28 = 1" identifier = number_literal) ;) (expression_statement "local_24 = 0;" (assignment_expression "local_24 = 0" identifier = number_literal) ;) (expression_statement "iVar1 = SSL_get_fd(s);" (assignment_expression "iVar1 = SSL_get_fd(s)" identifier = (call_expression "SSL_get_fd(s)" identifier (argument_list "(s)" ( identifier )))) ;) (if_statement "if (-1 < iVar1) {\n        setsockopt(iVar1,1,0xd,&local_28,8);\n      }" if (parenthesized_expression "(-1 < iVar1)" ( (binary_expression "-1 < iVar1" number_literal < identifier) )) (compound_statement "{\n        setsockopt(iVar1,1,0xd,&local_28,8);\n      }" { (expression_statement "setsockopt(iVar1,1,0xd,&local_28,8);" (call_expression "setsockopt(iVar1,1,0xd,&local_28,8)" identifier (argument_list "(iVar1,1,0xd,&local_28,8)" ( identifier , number_literal , number_literal , (pointer_expression "&local_28" & identifier) , number_literal ))) ;) })) (goto_statement "goto LAB_0005ff5e;" goto statement_identifier ;) })) (expression_statement "BIO_printf(DAT_000c458c,"ERROR\n");" (call_expression "BIO_printf(DAT_000c458c,"ERROR\n")" identifier (argument_list "(DAT_000c458c,"ERROR\n")" ( identifier , (string_literal ""ERROR\n"" " string_content escape_sequence ") ))) ;) (if_statement "if (DAT_000c3f38 == 0) {\n      ERR_print_errors(DAT_000c458c);\n    }\n    else {\n      pcVar2 = X509_verify_cert_error_string(DAT_000c3f38);\n      BIO_printf(DAT_000c458c,"verify error:%s\n",pcVar2);\n    }" if (parenthesized_expression "(DAT_000c3f38 == 0)" ( (binary_expression "DAT_000c3f38 == 0" identifier == number_literal) )) (compound_statement "{\n      ERR_print_errors(DAT_000c458c);\n    }" { (expression_statement "ERR_print_errors(DAT_000c458c);" (call_expression "ERR_print_errors(DAT_000c458c)" identifier (argument_list "(DAT_000c458c)" ( identifier ))) ;) }) (else_clause "else {\n      pcVar2 = X509_verify_cert_error_string(DAT_000c3f38);\n      BIO_printf(DAT_000c458c,"verify error:%s\n",pcVar2);\n    }" else (compound_statement "{\n      pcVar2 = X509_verify_cert_error_string(DAT_000c3f38);\n      BIO_printf(DAT_000c458c,"verify error:%s\n",pcVar2);\n    }" { (expression_statement "pcVar2 = X509_verify_cert_error_string(DAT_000c3f38);" (assignment_expression "pcVar2 = X509_verify_cert_error_string(DAT_000c3f38)" identifier = (call_expression "X509_verify_cert_error_string(DAT_000c3f38)" identifier (argument_list "(DAT_000c3f38)" ( identifier )))) ;) (expression_statement "BIO_printf(DAT_000c458c,"verify error:%s\n",pcVar2);" (call_expression "BIO_printf(DAT_000c458c,"verify error:%s\n",pcVar2)" identifier (argument_list "(DAT_000c458c,"verify error:%s\n",pcVar2)" ( identifier , (string_literal ""verify error:%s\n"" " string_content escape_sequence ") , identifier ))) ;) }))) (if_statement "if (param_1 == (SSL *)0x0) {\n      SSL_free(s);\n    }" if (parenthesized_expression "(param_1 == (SSL *)0x0)" ( (binary_expression "param_1 == (SSL *)0x0" identifier == (cast_expression "(SSL *)0x0" ( (type_descriptor "SSL *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n      SSL_free(s);\n    }" { (expression_statement "SSL_free(s);" (call_expression "SSL_free(s)" identifier (argument_list "(s)" ( identifier ))) ;) })) })) (expression_statement "s = (SSL *)0x0;" (assignment_expression "s = (SSL *)0x0" identifier = (cast_expression "(SSL *)0x0" ( (type_descriptor "SSL *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) ;) (labeled_statement "LAB_0005ff5e:\n  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return s;\n  }" statement_identifier : (if_statement "if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return s;\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 s;\n  }" { (return_statement "return s;" return identifier ;) }))) comment (expression_statement "FUN_0007d010();" (call_expression "FUN_0007d010()" identifier (argument_list "()" ( ))) ;) }))
(translation_unit "/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n\nSSL * __regparm3 doConnection(SSL *scon,char *host,SSL_CTX *ctx)\n\n{\n  int iVar1;\n  BIO_METHOD *type;\n  BIO *bp;\n  int iVar2;\n  char *pcVar3;\n  SSL *s;\n  int in_GS_OFFSET;\n  linger no_linger;\n  \n  iVar1 = *(int *)(in_GS_OFFSET + 0x14);\n  type = BIO_s_connect();\n  bp = BIO_new(type);\n  if (bp != (BIO *)0x0) {\n    BIO_ctrl(bp,100,0,host);\n    BIO_ctrl(bp,0x9b,0x10,(void *)0x0);\n    if (scon == (SSL *)0x0) {\n      s = SSL_new((SSL_CTX *)ctx);\n    }\n    else {\n      SSL_set_connect_state((SSL *)scon);\n      s = (SSL *)scon;\n    }\n    SSL_set_bio(s,bp,bp);\n    iVar2 = SSL_connect(s);\n    if (0 < iVar2) {\n      no_linger.l_onoff = 1;\n      no_linger.l_linger = 0;\n      iVar2 = SSL_get_fd(s);\n      if (-1 < iVar2) {\n        setsockopt(iVar2,1,0xd,&no_linger,8);\n      }\n      goto LAB_0005ff5e;\n    }\n    BIO_printf((BIO *)bio_err,"ERROR\n");\n    if (verify_args.error == 0) {\n      ERR_print_errors((BIO *)bio_err);\n    }\n    else {\n      pcVar3 = X509_verify_cert_error_string(verify_args.error);\n      BIO_printf((BIO *)bio_err,"verify error:%s\n",pcVar3);\n    }\n    if (scon == (SSL *)0x0) {\n      SSL_free(s);\n    }\n  }\n  s = (SSL *)0x0;\nLAB_0005ff5e:\n  if (iVar1 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return (SSL *)s;\n  }\n                    /* WARNING: Subroutine does not return */\n  __stack_chk_fail_local();\n}\n\n" comment (ERROR "SSL * __regparm3 doConnection(SSL *scon,char *host,SSL_CTX *ctx)" (binary_expression "SSL * __regparm3 doConnection(SSL *scon,char *host,SSL_CTX *ctx)" identifier * (ERROR "__regparm3" identifier) (call_expression "doConnection(SSL *scon,char *host,SSL_CTX *ctx)" identifier (argument_list "(SSL *scon,char *host,SSL_CTX *ctx)" ( (binary_expression "SSL *scon" identifier * identifier) , (binary_expression "char *host" identifier * identifier) , (binary_expression "SSL_CTX *ctx" identifier * identifier) ))))) (compound_statement "{\n  int iVar1;\n  BIO_METHOD *type;\n  BIO *bp;\n  int iVar2;\n  char *pcVar3;\n  SSL *s;\n  int in_GS_OFFSET;\n  linger no_linger;\n  \n  iVar1 = *(int *)(in_GS_OFFSET + 0x14);\n  type = BIO_s_connect();\n  bp = BIO_new(type);\n  if (bp != (BIO *)0x0) {\n    BIO_ctrl(bp,100,0,host);\n    BIO_ctrl(bp,0x9b,0x10,(void *)0x0);\n    if (scon == (SSL *)0x0) {\n      s = SSL_new((SSL_CTX *)ctx);\n    }\n    else {\n      SSL_set_connect_state((SSL *)scon);\n      s = (SSL *)scon;\n    }\n    SSL_set_bio(s,bp,bp);\n    iVar2 = SSL_connect(s);\n    if (0 < iVar2) {\n      no_linger.l_onoff = 1;\n      no_linger.l_linger = 0;\n      iVar2 = SSL_get_fd(s);\n      if (-1 < iVar2) {\n        setsockopt(iVar2,1,0xd,&no_linger,8);\n      }\n      goto LAB_0005ff5e;\n    }\n    BIO_printf((BIO *)bio_err,"ERROR\n");\n    if (verify_args.error == 0) {\n      ERR_print_errors((BIO *)bio_err);\n    }\n    else {\n      pcVar3 = X509_verify_cert_error_string(verify_args.error);\n      BIO_printf((BIO *)bio_err,"verify error:%s\n",pcVar3);\n    }\n    if (scon == (SSL *)0x0) {\n      SSL_free(s);\n    }\n  }\n  s = (SSL *)0x0;\nLAB_0005ff5e:\n  if (iVar1 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return (SSL *)s;\n  }\n                    /* WARNING: Subroutine does not return */\n  __stack_chk_fail_local();\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "BIO_METHOD *type;" type_identifier (pointer_declarator "*type" * identifier) ;) (declaration "BIO *bp;" type_identifier (pointer_declarator "*bp" * identifier) ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "char *pcVar3;" primitive_type (pointer_declarator "*pcVar3" * identifier) ;) (declaration "SSL *s;" type_identifier (pointer_declarator "*s" * identifier) ;) (declaration "int in_GS_OFFSET;" primitive_type identifier ;) (declaration "linger no_linger;" type_identifier identifier ;) (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) ))))) ;) (expression_statement "type = BIO_s_connect();" (assignment_expression "type = BIO_s_connect()" identifier = (call_expression "BIO_s_connect()" identifier (argument_list "()" ( )))) ;) (expression_statement "bp = BIO_new(type);" (assignment_expression "bp = BIO_new(type)" identifier = (call_expression "BIO_new(type)" identifier (argument_list "(type)" ( identifier )))) ;) (if_statement "if (bp != (BIO *)0x0) {\n    BIO_ctrl(bp,100,0,host);\n    BIO_ctrl(bp,0x9b,0x10,(void *)0x0);\n    if (scon == (SSL *)0x0) {\n      s = SSL_new((SSL_CTX *)ctx);\n    }\n    else {\n      SSL_set_connect_state((SSL *)scon);\n      s = (SSL *)scon;\n    }\n    SSL_set_bio(s,bp,bp);\n    iVar2 = SSL_connect(s);\n    if (0 < iVar2) {\n      no_linger.l_onoff = 1;\n      no_linger.l_linger = 0;\n      iVar2 = SSL_get_fd(s);\n      if (-1 < iVar2) {\n        setsockopt(iVar2,1,0xd,&no_linger,8);\n      }\n      goto LAB_0005ff5e;\n    }\n    BIO_printf((BIO *)bio_err,"ERROR\n");\n    if (verify_args.error == 0) {\n      ERR_print_errors((BIO *)bio_err);\n    }\n    else {\n      pcVar3 = X509_verify_cert_error_string(verify_args.error);\n      BIO_printf((BIO *)bio_err,"verify error:%s\n",pcVar3);\n    }\n    if (scon == (SSL *)0x0) {\n      SSL_free(s);\n    }\n  }" if (parenthesized_expression "(bp != (BIO *)0x0)" ( (binary_expression "bp != (BIO *)0x0" identifier != (cast_expression "(BIO *)0x0" ( (type_descriptor "BIO *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n    BIO_ctrl(bp,100,0,host);\n    BIO_ctrl(bp,0x9b,0x10,(void *)0x0);\n    if (scon == (SSL *)0x0) {\n      s = SSL_new((SSL_CTX *)ctx);\n    }\n    else {\n      SSL_set_connect_state((SSL *)scon);\n      s = (SSL *)scon;\n    }\n    SSL_set_bio(s,bp,bp);\n    iVar2 = SSL_connect(s);\n    if (0 < iVar2) {\n      no_linger.l_onoff = 1;\n      no_linger.l_linger = 0;\n      iVar2 = SSL_get_fd(s);\n      if (-1 < iVar2) {\n        setsockopt(iVar2,1,0xd,&no_linger,8);\n      }\n      goto LAB_0005ff5e;\n    }\n    BIO_printf((BIO *)bio_err,"ERROR\n");\n    if (verify_args.error == 0) {\n      ERR_print_errors((BIO *)bio_err);\n    }\n    else {\n      pcVar3 = X509_verify_cert_error_string(verify_args.error);\n      BIO_printf((BIO *)bio_err,"verify error:%s\n",pcVar3);\n    }\n    if (scon == (SSL *)0x0) {\n      SSL_free(s);\n    }\n  }" { (expression_statement "BIO_ctrl(bp,100,0,host);" (call_expression "BIO_ctrl(bp,100,0,host)" identifier (argument_list "(bp,100,0,host)" ( identifier , number_literal , number_literal , identifier ))) ;) (expression_statement "BIO_ctrl(bp,0x9b,0x10,(void *)0x0);" (call_expression "BIO_ctrl(bp,0x9b,0x10,(void *)0x0)" identifier (argument_list "(bp,0x9b,0x10,(void *)0x0)" ( identifier , number_literal , number_literal , (cast_expression "(void *)0x0" ( (type_descriptor "void *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal) ))) ;) (if_statement "if (scon == (SSL *)0x0) {\n      s = SSL_new((SSL_CTX *)ctx);\n    }\n    else {\n      SSL_set_connect_state((SSL *)scon);\n      s = (SSL *)scon;\n    }" if (parenthesized_expression "(scon == (SSL *)0x0)" ( (binary_expression "scon == (SSL *)0x0" identifier == (cast_expression "(SSL *)0x0" ( (type_descriptor "SSL *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n      s = SSL_new((SSL_CTX *)ctx);\n    }" { (expression_statement "s = SSL_new((SSL_CTX *)ctx);" (assignment_expression "s = SSL_new((SSL_CTX *)ctx)" identifier = (call_expression "SSL_new((SSL_CTX *)ctx)" identifier (argument_list "((SSL_CTX *)ctx)" ( (cast_expression "(SSL_CTX *)ctx" ( (type_descriptor "SSL_CTX *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier) )))) ;) }) (else_clause "else {\n      SSL_set_connect_state((SSL *)scon);\n      s = (SSL *)scon;\n    }" else (compound_statement "{\n      SSL_set_connect_state((SSL *)scon);\n      s = (SSL *)scon;\n    }" { (expression_statement "SSL_set_connect_state((SSL *)scon);" (call_expression "SSL_set_connect_state((SSL *)scon)" identifier (argument_list "((SSL *)scon)" ( (cast_expression "(SSL *)scon" ( (type_descriptor "SSL *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier) ))) ;) (expression_statement "s = (SSL *)scon;" (assignment_expression "s = (SSL *)scon" identifier = (cast_expression "(SSL *)scon" ( (type_descriptor "SSL *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) ;) }))) (expression_statement "SSL_set_bio(s,bp,bp);" (call_expression "SSL_set_bio(s,bp,bp)" identifier (argument_list "(s,bp,bp)" ( identifier , identifier , identifier ))) ;) (expression_statement "iVar2 = SSL_connect(s);" (assignment_expression "iVar2 = SSL_connect(s)" identifier = (call_expression "SSL_connect(s)" identifier (argument_list "(s)" ( identifier )))) ;) (if_statement "if (0 < iVar2) {\n      no_linger.l_onoff = 1;\n      no_linger.l_linger = 0;\n      iVar2 = SSL_get_fd(s);\n      if (-1 < iVar2) {\n        setsockopt(iVar2,1,0xd,&no_linger,8);\n      }\n      goto LAB_0005ff5e;\n    }" if (parenthesized_expression "(0 < iVar2)" ( (binary_expression "0 < iVar2" number_literal < identifier) )) (compound_statement "{\n      no_linger.l_onoff = 1;\n      no_linger.l_linger = 0;\n      iVar2 = SSL_get_fd(s);\n      if (-1 < iVar2) {\n        setsockopt(iVar2,1,0xd,&no_linger,8);\n      }\n      goto LAB_0005ff5e;\n    }" { (expression_statement "no_linger.l_onoff = 1;" (assignment_expression "no_linger.l_onoff = 1" (field_expression "no_linger.l_onoff" identifier . field_identifier) = number_literal) ;) (expression_statement "no_linger.l_linger = 0;" (assignment_expression "no_linger.l_linger = 0" (field_expression "no_linger.l_linger" identifier . field_identifier) = number_literal) ;) (expression_statement "iVar2 = SSL_get_fd(s);" (assignment_expression "iVar2 = SSL_get_fd(s)" identifier = (call_expression "SSL_get_fd(s)" identifier (argument_list "(s)" ( identifier )))) ;) (if_statement "if (-1 < iVar2) {\n        setsockopt(iVar2,1,0xd,&no_linger,8);\n      }" if (parenthesized_expression "(-1 < iVar2)" ( (binary_expression "-1 < iVar2" number_literal < identifier) )) (compound_statement "{\n        setsockopt(iVar2,1,0xd,&no_linger,8);\n      }" { (expression_statement "setsockopt(iVar2,1,0xd,&no_linger,8);" (call_expression "setsockopt(iVar2,1,0xd,&no_linger,8)" identifier (argument_list "(iVar2,1,0xd,&no_linger,8)" ( identifier , number_literal , number_literal , (pointer_expression "&no_linger" & identifier) , number_literal ))) ;) })) (goto_statement "goto LAB_0005ff5e;" goto statement_identifier ;) })) (expression_statement "BIO_printf((BIO *)bio_err,"ERROR\n");" (call_expression "BIO_printf((BIO *)bio_err,"ERROR\n")" identifier (argument_list "((BIO *)bio_err,"ERROR\n")" ( (cast_expression "(BIO *)bio_err" ( (type_descriptor "BIO *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier) , (string_literal ""ERROR\n"" " string_content escape_sequence ") ))) ;) (if_statement "if (verify_args.error == 0) {\n      ERR_print_errors((BIO *)bio_err);\n    }\n    else {\n      pcVar3 = X509_verify_cert_error_string(verify_args.error);\n      BIO_printf((BIO *)bio_err,"verify error:%s\n",pcVar3);\n    }" if (parenthesized_expression "(verify_args.error == 0)" ( (binary_expression "verify_args.error == 0" (field_expression "verify_args.error" identifier . field_identifier) == number_literal) )) (compound_statement "{\n      ERR_print_errors((BIO *)bio_err);\n    }" { (expression_statement "ERR_print_errors((BIO *)bio_err);" (call_expression "ERR_print_errors((BIO *)bio_err)" identifier (argument_list "((BIO *)bio_err)" ( (cast_expression "(BIO *)bio_err" ( (type_descriptor "BIO *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier) ))) ;) }) (else_clause "else {\n      pcVar3 = X509_verify_cert_error_string(verify_args.error);\n      BIO_printf((BIO *)bio_err,"verify error:%s\n",pcVar3);\n    }" else (compound_statement "{\n      pcVar3 = X509_verify_cert_error_string(verify_args.error);\n      BIO_printf((BIO *)bio_err,"verify error:%s\n",pcVar3);\n    }" { (expression_statement "pcVar3 = X509_verify_cert_error_string(verify_args.error);" (assignment_expression "pcVar3 = X509_verify_cert_error_string(verify_args.error)" identifier = (call_expression "X509_verify_cert_error_string(verify_args.error)" identifier (argument_list "(verify_args.error)" ( (field_expression "verify_args.error" identifier . field_identifier) )))) ;) (expression_statement "BIO_printf((BIO *)bio_err,"verify error:%s\n",pcVar3);" (call_expression "BIO_printf((BIO *)bio_err,"verify error:%s\n",pcVar3)" identifier (argument_list "((BIO *)bio_err,"verify error:%s\n",pcVar3)" ( (cast_expression "(BIO *)bio_err" ( (type_descriptor "BIO *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier) , (string_literal ""verify error:%s\n"" " string_content escape_sequence ") , identifier ))) ;) }))) (if_statement "if (scon == (SSL *)0x0) {\n      SSL_free(s);\n    }" if (parenthesized_expression "(scon == (SSL *)0x0)" ( (binary_expression "scon == (SSL *)0x0" identifier == (cast_expression "(SSL *)0x0" ( (type_descriptor "SSL *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n      SSL_free(s);\n    }" { (expression_statement "SSL_free(s);" (call_expression "SSL_free(s)" identifier (argument_list "(s)" ( identifier ))) ;) })) })) (expression_statement "s = (SSL *)0x0;" (assignment_expression "s = (SSL *)0x0" identifier = (cast_expression "(SSL *)0x0" ( (type_descriptor "SSL *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) ;) (labeled_statement "LAB_0005ff5e:\n  if (iVar1 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return (SSL *)s;\n  }" statement_identifier : (if_statement "if (iVar1 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return (SSL *)s;\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 (SSL *)s;\n  }" { (return_statement "return (SSL *)s;" return (cast_expression "(SSL *)s" ( (type_descriptor "SSL *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier) ;) }))) comment (expression_statement "__stack_chk_fail_local();" (call_expression "__stack_chk_fail_local()" identifier (argument_list "()" ( ))) ;) }))
(translation_unit "SSL * __regparm3 FUN_0005feb0(SSL *param_1,void *param_2,SSL_CTX *param_3)\n\n{\n  BIO_METHOD *type;\n  BIO *bp;\n  int iVar1;\n  char *pcVar2;\n  SSL *s;\n  int in_GS_OFFSET;\n  undefined4 local_28;\n  undefined4 local_24;\n  int local_20;\n  undefined4 uStack_14;\n  \n  uStack_14 = 0x5febd;\n  local_20 = *(int *)(in_GS_OFFSET + 0x14);\n  type = BIO_s_connect();\n  bp = BIO_new(type);\n  if (bp != (BIO *)0x0) {\n    BIO_ctrl(bp,100,0,param_2);\n    BIO_ctrl(bp,0x9b,0x10,(void *)0x0);\n    if (param_1 == (SSL *)0x0) {\n      s = SSL_new(param_3);\n    }\n    else {\n      SSL_set_connect_state(param_1);\n      s = param_1;\n    }\n    SSL_set_bio(s,bp,bp);\n    iVar1 = SSL_connect(s);\n    if (0 < iVar1) {\n      local_28 = 1;\n      local_24 = 0;\n      iVar1 = SSL_get_fd(s);\n      if (-1 < iVar1) {\n        setsockopt(iVar1,1,0xd,&local_28,8);\n      }\n      goto LAB_0005ff5e;\n    }\n    BIO_printf(DAT_000c458c,"ERROR\n");\n    if (DAT_000c3f38 == 0) {\n      ERR_print_errors(DAT_000c458c);\n    }\n    else {\n      pcVar2 = X509_verify_cert_error_string(DAT_000c3f38);\n      BIO_printf(DAT_000c458c,"verify error:%s\n",pcVar2);\n    }\n    if (param_1 == (SSL *)0x0) {\n      SSL_free(s);\n    }\n  }\n  s = (SSL *)0x0;\nLAB_0005ff5e:\n  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return s;\n  }\n                    \n  FUN_0007d010();\n}\n\n" (ERROR "SSL * __regparm3 FUN_0005feb0(SSL *param_1,void *param_2,SSL_CTX *param_3)" (binary_expression "SSL * __regparm3 FUN_0005feb0(SSL *param_1,void *param_2,SSL_CTX *param_3)" identifier * (ERROR "__regparm3" identifier) (call_expression "FUN_0005feb0(SSL *param_1,void *param_2,SSL_CTX *param_3)" identifier (argument_list "(SSL *param_1,void *param_2,SSL_CTX *param_3)" ( (binary_expression "SSL *param_1" identifier * identifier) , (binary_expression "void *param_2" identifier * identifier) , (binary_expression "SSL_CTX *param_3" identifier * identifier) ))))) (compound_statement "{\n  BIO_METHOD *type;\n  BIO *bp;\n  int iVar1;\n  char *pcVar2;\n  SSL *s;\n  int in_GS_OFFSET;\n  undefined4 local_28;\n  undefined4 local_24;\n  int local_20;\n  undefined4 uStack_14;\n  \n  uStack_14 = 0x5febd;\n  local_20 = *(int *)(in_GS_OFFSET + 0x14);\n  type = BIO_s_connect();\n  bp = BIO_new(type);\n  if (bp != (BIO *)0x0) {\n    BIO_ctrl(bp,100,0,param_2);\n    BIO_ctrl(bp,0x9b,0x10,(void *)0x0);\n    if (param_1 == (SSL *)0x0) {\n      s = SSL_new(param_3);\n    }\n    else {\n      SSL_set_connect_state(param_1);\n      s = param_1;\n    }\n    SSL_set_bio(s,bp,bp);\n    iVar1 = SSL_connect(s);\n    if (0 < iVar1) {\n      local_28 = 1;\n      local_24 = 0;\n      iVar1 = SSL_get_fd(s);\n      if (-1 < iVar1) {\n        setsockopt(iVar1,1,0xd,&local_28,8);\n      }\n      goto LAB_0005ff5e;\n    }\n    BIO_printf(DAT_000c458c,"ERROR\n");\n    if (DAT_000c3f38 == 0) {\n      ERR_print_errors(DAT_000c458c);\n    }\n    else {\n      pcVar2 = X509_verify_cert_error_string(DAT_000c3f38);\n      BIO_printf(DAT_000c458c,"verify error:%s\n",pcVar2);\n    }\n    if (param_1 == (SSL *)0x0) {\n      SSL_free(s);\n    }\n  }\n  s = (SSL *)0x0;\nLAB_0005ff5e:\n  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return s;\n  }\n                    \n  FUN_0007d010();\n}" { (declaration "BIO_METHOD *type;" type_identifier (pointer_declarator "*type" * identifier) ;) (declaration "BIO *bp;" type_identifier (pointer_declarator "*bp" * identifier) ;) (declaration "int iVar1;" primitive_type identifier ;) (declaration "char *pcVar2;" primitive_type (pointer_declarator "*pcVar2" * identifier) ;) (declaration "SSL *s;" type_identifier (pointer_declarator "*s" * identifier) ;) (declaration "int in_GS_OFFSET;" primitive_type identifier ;) (declaration "undefined4 local_28;" type_identifier identifier ;) (declaration "undefined4 local_24;" type_identifier identifier ;) (declaration "int local_20;" primitive_type identifier ;) (declaration "undefined4 uStack_14;" type_identifier identifier ;) (expression_statement "uStack_14 = 0x5febd;" (assignment_expression "uStack_14 = 0x5febd" 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) ))))) ;) (expression_statement "type = BIO_s_connect();" (assignment_expression "type = BIO_s_connect()" identifier = (call_expression "BIO_s_connect()" identifier (argument_list "()" ( )))) ;) (expression_statement "bp = BIO_new(type);" (assignment_expression "bp = BIO_new(type)" identifier = (call_expression "BIO_new(type)" identifier (argument_list "(type)" ( identifier )))) ;) (if_statement "if (bp != (BIO *)0x0) {\n    BIO_ctrl(bp,100,0,param_2);\n    BIO_ctrl(bp,0x9b,0x10,(void *)0x0);\n    if (param_1 == (SSL *)0x0) {\n      s = SSL_new(param_3);\n    }\n    else {\n      SSL_set_connect_state(param_1);\n      s = param_1;\n    }\n    SSL_set_bio(s,bp,bp);\n    iVar1 = SSL_connect(s);\n    if (0 < iVar1) {\n      local_28 = 1;\n      local_24 = 0;\n      iVar1 = SSL_get_fd(s);\n      if (-1 < iVar1) {\n        setsockopt(iVar1,1,0xd,&local_28,8);\n      }\n      goto LAB_0005ff5e;\n    }\n    BIO_printf(DAT_000c458c,"ERROR\n");\n    if (DAT_000c3f38 == 0) {\n      ERR_print_errors(DAT_000c458c);\n    }\n    else {\n      pcVar2 = X509_verify_cert_error_string(DAT_000c3f38);\n      BIO_printf(DAT_000c458c,"verify error:%s\n",pcVar2);\n    }\n    if (param_1 == (SSL *)0x0) {\n      SSL_free(s);\n    }\n  }" if (parenthesized_expression "(bp != (BIO *)0x0)" ( (binary_expression "bp != (BIO *)0x0" identifier != (cast_expression "(BIO *)0x0" ( (type_descriptor "BIO *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n    BIO_ctrl(bp,100,0,param_2);\n    BIO_ctrl(bp,0x9b,0x10,(void *)0x0);\n    if (param_1 == (SSL *)0x0) {\n      s = SSL_new(param_3);\n    }\n    else {\n      SSL_set_connect_state(param_1);\n      s = param_1;\n    }\n    SSL_set_bio(s,bp,bp);\n    iVar1 = SSL_connect(s);\n    if (0 < iVar1) {\n      local_28 = 1;\n      local_24 = 0;\n      iVar1 = SSL_get_fd(s);\n      if (-1 < iVar1) {\n        setsockopt(iVar1,1,0xd,&local_28,8);\n      }\n      goto LAB_0005ff5e;\n    }\n    BIO_printf(DAT_000c458c,"ERROR\n");\n    if (DAT_000c3f38 == 0) {\n      ERR_print_errors(DAT_000c458c);\n    }\n    else {\n      pcVar2 = X509_verify_cert_error_string(DAT_000c3f38);\n      BIO_printf(DAT_000c458c,"verify error:%s\n",pcVar2);\n    }\n    if (param_1 == (SSL *)0x0) {\n      SSL_free(s);\n    }\n  }" { (expression_statement "BIO_ctrl(bp,100,0,param_2);" (call_expression "BIO_ctrl(bp,100,0,param_2)" identifier (argument_list "(bp,100,0,param_2)" ( identifier , number_literal , number_literal , identifier ))) ;) (expression_statement "BIO_ctrl(bp,0x9b,0x10,(void *)0x0);" (call_expression "BIO_ctrl(bp,0x9b,0x10,(void *)0x0)" identifier (argument_list "(bp,0x9b,0x10,(void *)0x0)" ( identifier , number_literal , number_literal , (cast_expression "(void *)0x0" ( (type_descriptor "void *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal) ))) ;) (if_statement "if (param_1 == (SSL *)0x0) {\n      s = SSL_new(param_3);\n    }\n    else {\n      SSL_set_connect_state(param_1);\n      s = param_1;\n    }" if (parenthesized_expression "(param_1 == (SSL *)0x0)" ( (binary_expression "param_1 == (SSL *)0x0" identifier == (cast_expression "(SSL *)0x0" ( (type_descriptor "SSL *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n      s = SSL_new(param_3);\n    }" { (expression_statement "s = SSL_new(param_3);" (assignment_expression "s = SSL_new(param_3)" identifier = (call_expression "SSL_new(param_3)" identifier (argument_list "(param_3)" ( identifier )))) ;) }) (else_clause "else {\n      SSL_set_connect_state(param_1);\n      s = param_1;\n    }" else (compound_statement "{\n      SSL_set_connect_state(param_1);\n      s = param_1;\n    }" { (expression_statement "SSL_set_connect_state(param_1);" (call_expression "SSL_set_connect_state(param_1)" identifier (argument_list "(param_1)" ( identifier ))) ;) (expression_statement "s = param_1;" (assignment_expression "s = param_1" identifier = identifier) ;) }))) (expression_statement "SSL_set_bio(s,bp,bp);" (call_expression "SSL_set_bio(s,bp,bp)" identifier (argument_list "(s,bp,bp)" ( identifier , identifier , identifier ))) ;) (expression_statement "iVar1 = SSL_connect(s);" (assignment_expression "iVar1 = SSL_connect(s)" identifier = (call_expression "SSL_connect(s)" identifier (argument_list "(s)" ( identifier )))) ;) (if_statement "if (0 < iVar1) {\n      local_28 = 1;\n      local_24 = 0;\n      iVar1 = SSL_get_fd(s);\n      if (-1 < iVar1) {\n        setsockopt(iVar1,1,0xd,&local_28,8);\n      }\n      goto LAB_0005ff5e;\n    }" if (parenthesized_expression "(0 < iVar1)" ( (binary_expression "0 < iVar1" number_literal < identifier) )) (compound_statement "{\n      local_28 = 1;\n      local_24 = 0;\n      iVar1 = SSL_get_fd(s);\n      if (-1 < iVar1) {\n        setsockopt(iVar1,1,0xd,&local_28,8);\n      }\n      goto LAB_0005ff5e;\n    }" { (expression_statement "local_28 = 1;" (assignment_expression "local_28 = 1" identifier = number_literal) ;) (expression_statement "local_24 = 0;" (assignment_expression "local_24 = 0" identifier = number_literal) ;) (expression_statement "iVar1 = SSL_get_fd(s);" (assignment_expression "iVar1 = SSL_get_fd(s)" identifier = (call_expression "SSL_get_fd(s)" identifier (argument_list "(s)" ( identifier )))) ;) (if_statement "if (-1 < iVar1) {\n        setsockopt(iVar1,1,0xd,&local_28,8);\n      }" if (parenthesized_expression "(-1 < iVar1)" ( (binary_expression "-1 < iVar1" number_literal < identifier) )) (compound_statement "{\n        setsockopt(iVar1,1,0xd,&local_28,8);\n      }" { (expression_statement "setsockopt(iVar1,1,0xd,&local_28,8);" (call_expression "setsockopt(iVar1,1,0xd,&local_28,8)" identifier (argument_list "(iVar1,1,0xd,&local_28,8)" ( identifier , number_literal , number_literal , (pointer_expression "&local_28" & identifier) , number_literal ))) ;) })) (goto_statement "goto LAB_0005ff5e;" goto statement_identifier ;) })) (expression_statement "BIO_printf(DAT_000c458c,"ERROR\n");" (call_expression "BIO_printf(DAT_000c458c,"ERROR\n")" identifier (argument_list "(DAT_000c458c,"ERROR\n")" ( identifier , (string_literal ""ERROR\n"" " string_content escape_sequence ") ))) ;) (if_statement "if (DAT_000c3f38 == 0) {\n      ERR_print_errors(DAT_000c458c);\n    }\n    else {\n      pcVar2 = X509_verify_cert_error_string(DAT_000c3f38);\n      BIO_printf(DAT_000c458c,"verify error:%s\n",pcVar2);\n    }" if (parenthesized_expression "(DAT_000c3f38 == 0)" ( (binary_expression "DAT_000c3f38 == 0" identifier == number_literal) )) (compound_statement "{\n      ERR_print_errors(DAT_000c458c);\n    }" { (expression_statement "ERR_print_errors(DAT_000c458c);" (call_expression "ERR_print_errors(DAT_000c458c)" identifier (argument_list "(DAT_000c458c)" ( identifier ))) ;) }) (else_clause "else {\n      pcVar2 = X509_verify_cert_error_string(DAT_000c3f38);\n      BIO_printf(DAT_000c458c,"verify error:%s\n",pcVar2);\n    }" else (compound_statement "{\n      pcVar2 = X509_verify_cert_error_string(DAT_000c3f38);\n      BIO_printf(DAT_000c458c,"verify error:%s\n",pcVar2);\n    }" { (expression_statement "pcVar2 = X509_verify_cert_error_string(DAT_000c3f38);" (assignment_expression "pcVar2 = X509_verify_cert_error_string(DAT_000c3f38)" identifier = (call_expression "X509_verify_cert_error_string(DAT_000c3f38)" identifier (argument_list "(DAT_000c3f38)" ( identifier )))) ;) (expression_statement "BIO_printf(DAT_000c458c,"verify error:%s\n",pcVar2);" (call_expression "BIO_printf(DAT_000c458c,"verify error:%s\n",pcVar2)" identifier (argument_list "(DAT_000c458c,"verify error:%s\n",pcVar2)" ( identifier , (string_literal ""verify error:%s\n"" " string_content escape_sequence ") , identifier ))) ;) }))) (if_statement "if (param_1 == (SSL *)0x0) {\n      SSL_free(s);\n    }" if (parenthesized_expression "(param_1 == (SSL *)0x0)" ( (binary_expression "param_1 == (SSL *)0x0" identifier == (cast_expression "(SSL *)0x0" ( (type_descriptor "SSL *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n      SSL_free(s);\n    }" { (expression_statement "SSL_free(s);" (call_expression "SSL_free(s)" identifier (argument_list "(s)" ( identifier ))) ;) })) })) (expression_statement "s = (SSL *)0x0;" (assignment_expression "s = (SSL *)0x0" identifier = (cast_expression "(SSL *)0x0" ( (type_descriptor "SSL *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) ;) (labeled_statement "LAB_0005ff5e:\n  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return s;\n  }" statement_identifier : (if_statement "if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return s;\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 s;\n  }" { (return_statement "return s;" return identifier ;) }))) (expression_statement "FUN_0007d010();" (call_expression "FUN_0007d010()" identifier (argument_list "()" ( ))) ;) }))
(translation_unit (ERROR (binary_expression IDENT * (ERROR IDENT) (call_expression IDENT (argument_list ( (binary_expression IDENT * IDENT) , (binary_expression IDENT * IDENT) , (binary_expression IDENT * IDENT) ))))) (compound_statement { (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE IDENT ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (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) ))))) ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( )))) ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT != (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) LIT)) )) (compound_statement { (expression_statement (call_expression IDENT (argument_list ( IDENT , LIT , LIT , IDENT ))) ;) (expression_statement (call_expression IDENT (argument_list ( IDENT , LIT , LIT , (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) LIT) ))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) LIT)) )) (compound_statement { (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT )))) ;) }) (else_clause else (compound_statement { (expression_statement (call_expression IDENT (argument_list ( IDENT ))) ;) (expression_statement (assignment_expression IDENT = IDENT) ;) }))) (expression_statement (call_expression IDENT (argument_list ( IDENT , IDENT , IDENT ))) ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT )))) ;) (if_statement if (parenthesized_expression ( (binary_expression LIT < IDENT) )) (compound_statement { (expression_statement (assignment_expression IDENT = LIT) ;) (expression_statement (assignment_expression IDENT = LIT) ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT )))) ;) (if_statement if (parenthesized_expression ( (binary_expression LIT < IDENT) )) (compound_statement { (expression_statement (call_expression IDENT (argument_list ( IDENT , LIT , LIT , (pointer_expression & IDENT) , LIT ))) ;) })) (goto_statement goto statement_identifier ;) })) (expression_statement (call_expression IDENT (argument_list ( IDENT , (string_literal " string_content escape_sequence ") ))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (expression_statement (call_expression IDENT (argument_list ( IDENT ))) ;) }) (else_clause else (compound_statement { (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT )))) ;) (expression_statement (call_expression IDENT (argument_list ( IDENT , (string_literal " string_content escape_sequence ") , IDENT ))) ;) }))) (if_statement if (parenthesized_expression ( (binary_expression IDENT == (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) LIT)) )) (compound_statement { (expression_statement (call_expression IDENT (argument_list ( IDENT ))) ;) })) })) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) LIT)) ;) (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 IDENT ;) }))) (expression_statement (call_expression IDENT (argument_list ( ))) ;) }))
(ERROR "SSL * __regparm3 FUN_0005feb0(SSL *param_1,void *param_2,SSL_CTX *param_3)" (binary_expression "SSL * __regparm3 FUN_0005feb0(SSL *param_1,void *param_2,SSL_CTX *param_3)" (identifier "SSL") (* "*") (ERROR "__regparm3" (identifier "__regparm3")) (call_expression "FUN_0005feb0(SSL *param_1,void *param_2,SSL_CTX *param_3)" (identifier "FUN_0005feb0") (argument_list "(SSL *param_1,void *param_2,SSL_CTX *param_3)" (( "(") (binary_expression "SSL *param_1" (identifier "SSL") (* "*") (identifier "param_1")) (, ",") (binary_expression "void *param_2" (identifier "void") (* "*") (identifier "param_2")) (, ",") (binary_expression "SSL_CTX *param_3" (identifier "SSL_CTX") (* "*") (identifier "param_3")) () ")"))))) (compound_statement "{\n  BIO_METHOD *type;\n  BIO *bp;\n  int iVar1;\n  char *pcVar2;\n  SSL *s;\n  int in_GS_OFFSET;\n  undefined4 local_28;\n  undefined4 local_24;\n  int local_20;\n  undefined4 uStack_14;\n  \n  uStack_14 = 0x5febd;\n  local_20 = *(int *)(in_GS_OFFSET + 0x14);\n  type = BIO_s_connect();\n  bp = BIO_new(type);\n  if (bp != (BIO *)0x0) {\n    BIO_ctrl(bp,100,0,param_2);\n    BIO_ctrl(bp,0x9b,0x10,(void *)0x0);\n    if (param_1 == (SSL *)0x0) {\n      s = SSL_new(param_3);\n    }\n    else {\n      SSL_set_connect_state(param_1);\n      s = param_1;\n    }\n    SSL_set_bio(s,bp,bp);\n    iVar1 = SSL_connect(s);\n    if (0 < iVar1) {\n      local_28 = 1;\n      local_24 = 0;\n      iVar1 = SSL_get_fd(s);\n      if (-1 < iVar1) {\n        setsockopt(iVar1,1,0xd,&local_28,8);\n      }\n      goto LAB_0005ff5e;\n    }\n    BIO_printf(DAT_000c458c,"ERROR\n");\n    if (DAT_000c3f38 == 0) {\n      ERR_print_errors(DAT_000c458c);\n    }\n    else {\n      pcVar2 = X509_verify_cert_error_string(DAT_000c3f38);\n      BIO_printf(DAT_000c458c,"verify error:%s\n",pcVar2);\n    }\n    if (param_1 == (SSL *)0x0) {\n      SSL_free(s);\n    }\n  }\n  s = (SSL *)0x0;\nLAB_0005ff5e:\n  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return s;\n  }\n                    \n  FUN_0007d010();\n}" ({ "{") (declaration "BIO_METHOD *type;" (type_identifier "BIO_METHOD") (pointer_declarator "*type" (* "*") (identifier "type")) (; ";")) (declaration "BIO *bp;" (type_identifier "BIO") (pointer_declarator "*bp" (* "*") (identifier "bp")) (; ";")) (declaration "int iVar1;" (primitive_type "int") (identifier "iVar1") (; ";")) (declaration "char *pcVar2;" (primitive_type "char") (pointer_declarator "*pcVar2" (* "*") (identifier "pcVar2")) (; ";")) (declaration "SSL *s;" (type_identifier "SSL") (pointer_declarator "*s" (* "*") (identifier "s")) (; ";")) (declaration "int in_GS_OFFSET;" (primitive_type "int") (identifier "in_GS_OFFSET") (; ";")) (declaration "undefined4 local_28;" (type_identifier "undefined4") (identifier "local_28") (; ";")) (declaration "undefined4 local_24;" (type_identifier "undefined4") (identifier "local_24") (; ";")) (declaration "int local_20;" (primitive_type "int") (identifier "local_20") (; ";")) (declaration "undefined4 uStack_14;" (type_identifier "undefined4") (identifier "uStack_14") (; ";")) (expression_statement "uStack_14 = 0x5febd;" (assignment_expression "uStack_14 = 0x5febd" (identifier "uStack_14") (= "=") (number_literal "0x5febd")) (; ";")) (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")) () ")"))))) (; ";")) (expression_statement "type = BIO_s_connect();" (assignment_expression "type = BIO_s_connect()" (identifier "type") (= "=") (call_expression "BIO_s_connect()" (identifier "BIO_s_connect") (argument_list "()" (( "(") () ")")))) (; ";")) (expression_statement "bp = BIO_new(type);" (assignment_expression "bp = BIO_new(type)" (identifier "bp") (= "=") (call_expression "BIO_new(type)" (identifier "BIO_new") (argument_list "(type)" (( "(") (identifier "type") () ")")))) (; ";")) (if_statement "if (bp != (BIO *)0x0) {\n    BIO_ctrl(bp,100,0,param_2);\n    BIO_ctrl(bp,0x9b,0x10,(void *)0x0);\n    if (param_1 == (SSL *)0x0) {\n      s = SSL_new(param_3);\n    }\n    else {\n      SSL_set_connect_state(param_1);\n      s = param_1;\n    }\n    SSL_set_bio(s,bp,bp);\n    iVar1 = SSL_connect(s);\n    if (0 < iVar1) {\n      local_28 = 1;\n      local_24 = 0;\n      iVar1 = SSL_get_fd(s);\n      if (-1 < iVar1) {\n        setsockopt(iVar1,1,0xd,&local_28,8);\n      }\n      goto LAB_0005ff5e;\n    }\n    BIO_printf(DAT_000c458c,"ERROR\n");\n    if (DAT_000c3f38 == 0) {\n      ERR_print_errors(DAT_000c458c);\n    }\n    else {\n      pcVar2 = X509_verify_cert_error_string(DAT_000c3f38);\n      BIO_printf(DAT_000c458c,"verify error:%s\n",pcVar2);\n    }\n    if (param_1 == (SSL *)0x0) {\n      SSL_free(s);\n    }\n  }" (if "if") (parenthesized_expression "(bp != (BIO *)0x0)" (( "(") (binary_expression "bp != (BIO *)0x0" (identifier "bp") (!= "!=") (cast_expression "(BIO *)0x0" (( "(") (type_descriptor "BIO *" (type_identifier "BIO") (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0x0"))) () ")")) (compound_statement "{\n    BIO_ctrl(bp,100,0,param_2);\n    BIO_ctrl(bp,0x9b,0x10,(void *)0x0);\n    if (param_1 == (SSL *)0x0) {\n      s = SSL_new(param_3);\n    }\n    else {\n      SSL_set_connect_state(param_1);\n      s = param_1;\n    }\n    SSL_set_bio(s,bp,bp);\n    iVar1 = SSL_connect(s);\n    if (0 < iVar1) {\n      local_28 = 1;\n      local_24 = 0;\n      iVar1 = SSL_get_fd(s);\n      if (-1 < iVar1) {\n        setsockopt(iVar1,1,0xd,&local_28,8);\n      }\n      goto LAB_0005ff5e;\n    }\n    BIO_printf(DAT_000c458c,"ERROR\n");\n    if (DAT_000c3f38 == 0) {\n      ERR_print_errors(DAT_000c458c);\n    }\n    else {\n      pcVar2 = X509_verify_cert_error_string(DAT_000c3f38);\n      BIO_printf(DAT_000c458c,"verify error:%s\n",pcVar2);\n    }\n    if (param_1 == (SSL *)0x0) {\n      SSL_free(s);\n    }\n  }" ({ "{") (expression_statement "BIO_ctrl(bp,100,0,param_2);" (call_expression "BIO_ctrl(bp,100,0,param_2)" (identifier "BIO_ctrl") (argument_list "(bp,100,0,param_2)" (( "(") (identifier "bp") (, ",") (number_literal "100") (, ",") (number_literal "0") (, ",") (identifier "param_2") () ")"))) (; ";")) (expression_statement "BIO_ctrl(bp,0x9b,0x10,(void *)0x0);" (call_expression "BIO_ctrl(bp,0x9b,0x10,(void *)0x0)" (identifier "BIO_ctrl") (argument_list "(bp,0x9b,0x10,(void *)0x0)" (( "(") (identifier "bp") (, ",") (number_literal "0x9b") (, ",") (number_literal "0x10") (, ",") (cast_expression "(void *)0x0" (( "(") (type_descriptor "void *" (primitive_type "void") (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0x0")) () ")"))) (; ";")) (if_statement "if (param_1 == (SSL *)0x0) {\n      s = SSL_new(param_3);\n    }\n    else {\n      SSL_set_connect_state(param_1);\n      s = param_1;\n    }" (if "if") (parenthesized_expression "(param_1 == (SSL *)0x0)" (( "(") (binary_expression "param_1 == (SSL *)0x0" (identifier "param_1") (== "==") (cast_expression "(SSL *)0x0" (( "(") (type_descriptor "SSL *" (type_identifier "SSL") (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0x0"))) () ")")) (compound_statement "{\n      s = SSL_new(param_3);\n    }" ({ "{") (expression_statement "s = SSL_new(param_3);" (assignment_expression "s = SSL_new(param_3)" (identifier "s") (= "=") (call_expression "SSL_new(param_3)" (identifier "SSL_new") (argument_list "(param_3)" (( "(") (identifier "param_3") () ")")))) (; ";")) (} "}")) (else_clause "else {\n      SSL_set_connect_state(param_1);\n      s = param_1;\n    }" (else "else") (compound_statement "{\n      SSL_set_connect_state(param_1);\n      s = param_1;\n    }" ({ "{") (expression_statement "SSL_set_connect_state(param_1);" (call_expression "SSL_set_connect_state(param_1)" (identifier "SSL_set_connect_state") (argument_list "(param_1)" (( "(") (identifier "param_1") () ")"))) (; ";")) (expression_statement "s = param_1;" (assignment_expression "s = param_1" (identifier "s") (= "=") (identifier "param_1")) (; ";")) (} "}")))) (expression_statement "SSL_set_bio(s,bp,bp);" (call_expression "SSL_set_bio(s,bp,bp)" (identifier "SSL_set_bio") (argument_list "(s,bp,bp)" (( "(") (identifier "s") (, ",") (identifier "bp") (, ",") (identifier "bp") () ")"))) (; ";")) (expression_statement "iVar1 = SSL_connect(s);" (assignment_expression "iVar1 = SSL_connect(s)" (identifier "iVar1") (= "=") (call_expression "SSL_connect(s)" (identifier "SSL_connect") (argument_list "(s)" (( "(") (identifier "s") () ")")))) (; ";")) (if_statement "if (0 < iVar1) {\n      local_28 = 1;\n      local_24 = 0;\n      iVar1 = SSL_get_fd(s);\n      if (-1 < iVar1) {\n        setsockopt(iVar1,1,0xd,&local_28,8);\n      }\n      goto LAB_0005ff5e;\n    }" (if "if") (parenthesized_expression "(0 < iVar1)" (( "(") (binary_expression "0 < iVar1" (number_literal "0") (< "<") (identifier "iVar1")) () ")")) (compound_statement "{\n      local_28 = 1;\n      local_24 = 0;\n      iVar1 = SSL_get_fd(s);\n      if (-1 < iVar1) {\n        setsockopt(iVar1,1,0xd,&local_28,8);\n      }\n      goto LAB_0005ff5e;\n    }" ({ "{") (expression_statement "local_28 = 1;" (assignment_expression "local_28 = 1" (identifier "local_28") (= "=") (number_literal "1")) (; ";")) (expression_statement "local_24 = 0;" (assignment_expression "local_24 = 0" (identifier "local_24") (= "=") (number_literal "0")) (; ";")) (expression_statement "iVar1 = SSL_get_fd(s);" (assignment_expression "iVar1 = SSL_get_fd(s)" (identifier "iVar1") (= "=") (call_expression "SSL_get_fd(s)" (identifier "SSL_get_fd") (argument_list "(s)" (( "(") (identifier "s") () ")")))) (; ";")) (if_statement "if (-1 < iVar1) {\n        setsockopt(iVar1,1,0xd,&local_28,8);\n      }" (if "if") (parenthesized_expression "(-1 < iVar1)" (( "(") (binary_expression "-1 < iVar1" (number_literal "-1") (< "<") (identifier "iVar1")) () ")")) (compound_statement "{\n        setsockopt(iVar1,1,0xd,&local_28,8);\n      }" ({ "{") (expression_statement "setsockopt(iVar1,1,0xd,&local_28,8);" (call_expression "setsockopt(iVar1,1,0xd,&local_28,8)" (identifier "setsockopt") (argument_list "(iVar1,1,0xd,&local_28,8)" (( "(") (identifier "iVar1") (, ",") (number_literal "1") (, ",") (number_literal "0xd") (, ",") (pointer_expression "&local_28" (& "&") (identifier "local_28")) (, ",") (number_literal "8") () ")"))) (; ";")) (} "}"))) (goto_statement "goto LAB_0005ff5e;" (goto "goto") (statement_identifier "LAB_0005ff5e") (; ";")) (} "}"))) (expression_statement "BIO_printf(DAT_000c458c,"ERROR\n");" (call_expression "BIO_printf(DAT_000c458c,"ERROR\n")" (identifier "BIO_printf") (argument_list "(DAT_000c458c,"ERROR\n")" (( "(") (identifier "DAT_000c458c") (, ",") (string_literal ""ERROR\n"" (" """) (string_content "ERROR") (escape_sequence "\n") (" """)) () ")"))) (; ";")) (if_statement "if (DAT_000c3f38 == 0) {\n      ERR_print_errors(DAT_000c458c);\n    }\n    else {\n      pcVar2 = X509_verify_cert_error_string(DAT_000c3f38);\n      BIO_printf(DAT_000c458c,"verify error:%s\n",pcVar2);\n    }" (if "if") (parenthesized_expression "(DAT_000c3f38 == 0)" (( "(") (binary_expression "DAT_000c3f38 == 0" (identifier "DAT_000c3f38") (== "==") (number_literal "0")) () ")")) (compound_statement "{\n      ERR_print_errors(DAT_000c458c);\n    }" ({ "{") (expression_statement "ERR_print_errors(DAT_000c458c);" (call_expression "ERR_print_errors(DAT_000c458c)" (identifier "ERR_print_errors") (argument_list "(DAT_000c458c)" (( "(") (identifier "DAT_000c458c") () ")"))) (; ";")) (} "}")) (else_clause "else {\n      pcVar2 = X509_verify_cert_error_string(DAT_000c3f38);\n      BIO_printf(DAT_000c458c,"verify error:%s\n",pcVar2);\n    }" (else "else") (compound_statement "{\n      pcVar2 = X509_verify_cert_error_string(DAT_000c3f38);\n      BIO_printf(DAT_000c458c,"verify error:%s\n",pcVar2);\n    }" ({ "{") (expression_statement "pcVar2 = X509_verify_cert_error_string(DAT_000c3f38);" (assignment_expression "pcVar2 = X509_verify_cert_error_string(DAT_000c3f38)" (identifier "pcVar2") (= "=") (call_expression "X509_verify_cert_error_string(DAT_000c3f38)" (identifier "X509_verify_cert_error_string") (argument_list "(DAT_000c3f38)" (( "(") (identifier "DAT_000c3f38") () ")")))) (; ";")) (expression_statement "BIO_printf(DAT_000c458c,"verify error:%s\n",pcVar2);" (call_expression "BIO_printf(DAT_000c458c,"verify error:%s\n",pcVar2)" (identifier "BIO_printf") (argument_list "(DAT_000c458c,"verify error:%s\n",pcVar2)" (( "(") (identifier "DAT_000c458c") (, ",") (string_literal ""verify error:%s\n"" (" """) (string_content "verify error:%s") (escape_sequence "\n") (" """)) (, ",") (identifier "pcVar2") () ")"))) (; ";")) (} "}")))) (if_statement "if (param_1 == (SSL *)0x0) {\n      SSL_free(s);\n    }" (if "if") (parenthesized_expression "(param_1 == (SSL *)0x0)" (( "(") (binary_expression "param_1 == (SSL *)0x0" (identifier "param_1") (== "==") (cast_expression "(SSL *)0x0" (( "(") (type_descriptor "SSL *" (type_identifier "SSL") (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0x0"))) () ")")) (compound_statement "{\n      SSL_free(s);\n    }" ({ "{") (expression_statement "SSL_free(s);" (call_expression "SSL_free(s)" (identifier "SSL_free") (argument_list "(s)" (( "(") (identifier "s") () ")"))) (; ";")) (} "}"))) (} "}"))) (expression_statement "s = (SSL *)0x0;" (assignment_expression "s = (SSL *)0x0" (identifier "s") (= "=") (cast_expression "(SSL *)0x0" (( "(") (type_descriptor "SSL *" (type_identifier "SSL") (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0x0"))) (; ";")) (labeled_statement "LAB_0005ff5e:\n  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return s;\n  }" (statement_identifier "LAB_0005ff5e") (: ":") (if_statement "if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return s;\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 s;\n  }" ({ "{") (return_statement "return s;" (return "return") (identifier "s") (; ";")) (} "}")))) (expression_statement "FUN_0007d010();" (call_expression "FUN_0007d010()" (identifier "FUN_0007d010") (argument_list "()" (( "(") () ")"))) (; ";")) (} "}"))

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

type_3 * __regparm3 doConnection(type_3 *var_6,char *host,type_5 *ctx)

{
  int var_18;
  type_1 *type;
  type_2 *var_4;
  int var_11;
  char *pcVar3;
  type_3 *s;
  int var_1;
  type_4 no_linger;
  
  var_18 = *(int *)(var_1 + 0x14);
  type = var_2();
  var_4 = var_3(type);
  if (var_4 != (type_2 *)0x0) {
    var_5(var_4,100,0,host);
    var_5(var_4,0x9b,0x10,(void *)0x0);
    if (var_6 == (type_3 *)0x0) {
      s = var_7((type_5 *)ctx);
    }
    else {
      var_8((type_3 *)var_6);
      s = (type_3 *)var_6;
    }
    var_9(s,var_4,var_4);
    var_11 = var_10(s);
    if (0 < var_11) {
      no_linger.l_onoff = 1;
      no_linger.l_linger = 0;
      var_11 = var_12(s);
      if (-1 < var_11) {
        var_13(var_11,1,0xd,&no_linger,8);
      }
      goto LAB_0005ff5e;
    }
    var_14((type_2 *)bio_err,"ERROR\n");
    if (verify_args.error == 0) {
      var_15((type_2 *)bio_err);
    }
    else {
      pcVar3 = var_16(verify_args.error);
      var_14((type_2 *)bio_err,"verify error:%s\n",pcVar3);
    }
    if (var_6 == (type_3 *)0x0) {
      var_17(s);
    }
  }
  s = (type_3 *)0x0;
LAB_0005ff5e:
  if (var_18 == *(int *)(var_1 + 0x14)) {
    return (type_3 *)s;
  }
                    /* WARNING: Subroutine does not return */
  var_19();
}


(translation_unit (ERROR (binary_expression left: (identifier) (ERROR (identifier)) right: (call_expression function: (identifier) arguments: (argument_list (binary_expression left: (identifier) right: (identifier)) (binary_expression left: (identifier) right: (identifier)) (binary_expression left: (identifier) right: (identifier)))))) (compound_statement (declaration type: (type_identifier) declarator: (pointer_declarator declarator: (identifier))) (declaration type: (type_identifier) declarator: (pointer_declarator declarator: (identifier))) (declaration type: (primitive_type) declarator: (identifier)) (declaration type: (primitive_type) declarator: (pointer_declarator declarator: (identifier))) (declaration type: (type_identifier) declarator: (pointer_declarator declarator: (identifier))) (declaration type: (primitive_type) declarator: (identifier)) (declaration type: (type_identifier) declarator: (identifier)) (declaration type: (type_identifier) declarator: (identifier)) (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))))))) (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list)))) (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: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (number_literal)))) consequence: (compound_statement (expression_statement (call_expression function: (identifier) arguments: (argument_list (identifier) (number_literal) (number_literal) (identifier)))) (expression_statement (call_expression function: (identifier) arguments: (argument_list (identifier) (number_literal) (number_literal) (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (number_literal))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (number_literal)))) consequence: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (identifier)))))) alternative: (else_clause (compound_statement (expression_statement (call_expression function: (identifier) arguments: (argument_list (identifier)))) (expression_statement (assignment_expression left: (identifier) right: (identifier)))))) (expression_statement (call_expression function: (identifier) arguments: (argument_list (identifier) (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: (number_literal) right: (identifier))) consequence: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (number_literal))) (expression_statement (assignment_expression left: (identifier) right: (number_literal))) (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (identifier))))) (if_statement condition: (parenthesized_expression (binary_expression left: (number_literal) right: (identifier))) consequence: (compound_statement (expression_statement (call_expression function: (identifier) arguments: (argument_list (identifier) (number_literal) (number_literal) (pointer_expression argument: (identifier)) (number_literal)))))) (goto_statement label: (statement_identifier)))) (expression_statement (call_expression function: (identifier) arguments: (argument_list (identifier) (string_literal (string_content) (escape_sequence))))) (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))))) alternative: (else_clause (compound_statement (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (identifier))))) (expression_statement (call_expression function: (identifier) arguments: (argument_list (identifier) (string_literal (string_content) (escape_sequence)) (identifier))))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (number_literal)))) consequence: (compound_statement (expression_statement (call_expression function: (identifier) arguments: (argument_list (identifier)))))))) (expression_statement (assignment_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (number_literal)))) (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 (identifier))))) (expression_statement (call_expression function: (identifier) arguments: (argument_list)))))

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

SSL * __regparm3 MASKED(SSL *param_1,void *param_2,SSL_CTX *param_3)

{
  BIO_METHOD *type;
  BIO *bp;
  int iVar1;
  char *pcVar2;
  SSL *s;
  int in_GS_OFFSET;
  undefined4 local_28;
  undefined4 local_24;
  int local_20;
  undefined4 uStack_14;
  
  uStack_14 = 0x5febd;
  local_20 = *(int *)(in_GS_OFFSET + 0x14);
  type = BIO_s_connect();
  bp = BIO_new(type);
  if (bp != (BIO *)0x0) {
    BIO_ctrl(bp,100,0,param_2);
    BIO_ctrl(bp,0x9b,0x10,(void *)0x0);
    if (param_1 == (SSL *)0x0) {
      s = SSL_new(param_3);
    }
    else {
      SSL_set_connect_state(param_1);
      s = param_1;
    }
    SSL_set_bio(s,bp,bp);
    iVar1 = SSL_connect(s);
    if (0 < iVar1) {
      local_28 = 1;
      local_24 = 0;
      iVar1 = SSL_get_fd(s);
      if (-1 < iVar1) {
        setsockopt(iVar1,1,0xd,&local_28,8);
      }
      goto LAB_0005ff5e;
    }
    BIO_printf(DAT_000c458c,"ERROR\n");
    if (DAT_000c3f38 == 0) {
      ERR_print_errors(DAT_000c458c);
    }
    else {
      pcVar2 = X509_verify_cert_error_string(DAT_000c3f38);
      BIO_printf(DAT_000c458c,"verify error:%s\n",pcVar2);
    }
    if (param_1 == (SSL *)0x0) {
      SSL_free(s);
    }
  }
  s = (SSL *)0x0;
LAB_0005ff5e:
  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {
    return s;
  }
                    /* WARNING: Subroutine does not return */
  FUN_0007d010();
}

