#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
struct addrinfo {
  int /*<<< orphan*/ ai_addrlen;
  int /*<<< orphan*/ ai_addr;
  int /*<<< orphan*/ ai_socktype;
  int /*<<< orphan*/ ai_family;
  struct addrinfo *ai_next;
  int /*<<< orphan*/ ai_protocol;
};
typedef int /*<<< orphan*/ hints;
typedef int /*<<< orphan*/ X509_NAME;
typedef int /*<<< orphan*/ X509;
typedef int /*<<< orphan*/ SSL_METHOD;
typedef int /*<<< orphan*/ SSL_CTX;
typedef int /*<<< orphan*/ SSL;

/* Variables and functions */
int /*<<< orphan*/ AF_UNSPEC;
int /*<<< orphan*/ IPPROTO_TCP;
int /*<<< orphan*/ NID_commonName;
int /*<<< orphan*/ SOCK_STREAM;
int /*<<< orphan*/ SSL_CTX_free(int /*<<< orphan*/ *);
int /*<<< orphan*/ SSL_CTX_load_verify_locations(int /*<<< orphan*/ *,
                                                 char const *,
                                                 int /*<<< orphan*/ *);
int /*<<< orphan*/ *SSL_CTX_new(void *);
int /*<<< orphan*/ SSL_CTX_set_mode(int /*<<< orphan*/ *, int /*<<< orphan*/);
int /*<<< orphan*/ SSL_CTX_set_options(int /*<<< orphan*/ *, int);
int /*<<< orphan*/ SSL_MODE_AUTO_RETRY;
int SSL_OP_NO_SSLv2;
int SSL_OP_NO_SSLv3;
int SSL_connect(int /*<<< orphan*/ *);
int /*<<< orphan*/ SSL_free(int /*<<< orphan*/ *);
int /*<<< orphan*/ *SSL_get_peer_certificate(int /*<<< orphan*/ *);
scalar_t__ SSL_get_verify_result(int /*<<< orphan*/ *);
int /*<<< orphan*/ SSL_library_init();
int /*<<< orphan*/ *SSL_new(int /*<<< orphan*/ *);
int SSL_read(int /*<<< orphan*/ *, int /*<<< orphan*/ *, size_t);
int /*<<< orphan*/ SSL_set_fd(int /*<<< orphan*/ *, int);
int /*<<< orphan*/ SSL_shutdown(int /*<<< orphan*/ *);
int SSL_write(int /*<<< orphan*/ *, int /*<<< orphan*/ const *, int);
int /*<<< orphan*/ *SSLv23_client_method();
int /*<<< orphan*/ X509_NAME_get_text_by_NID(int /*<<< orphan*/ *,
                                             int /*<<< orphan*/, char *, int);
scalar_t__ X509_V_OK;
int /*<<< orphan*/ *X509_get_subject_name(int /*<<< orphan*/ *);
int /*<<< orphan*/ close(int);
scalar_t__ connect(int, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ freeaddrinfo(struct addrinfo *);
int getaddrinfo(char const *, char const *, struct addrinfo *,
                struct addrinfo **);
int /*<<< orphan*/ memset(struct addrinfo *, int /*<<< orphan*/, int);
int socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
scalar_t__ strcasecmp(char *, char const *);
const char *sslreq(const char *host, const char *port, const char *certfile,
                   const uint8_t *req, int reqlen, uint8_t *resp,
                   size_t *resplen) {
  struct addrinfo hints;
  struct addrinfo *res;
  struct addrinfo *r;
  int error;
  int s;
  const SSL_METHOD *meth;
  SSL_CTX *ctx;
  SSL *ssl;
  X509 *cert;
  X509_NAME *name;
  char hostname[256];
  int readlen;
  size_t resppos;
  memset(&hints, 0, sizeof(hints));
  hints.ai_family = AF_UNSPEC;
  hints.ai_socktype = SOCK_STREAM;
  hints.ai_protocol = IPPROTO_TCP;
  if ((error = getaddrinfo(host, port, &hints, &res)) != 0)
    return "DNS lookup failed";
  for (r = res; r != NULL; r = r->ai_next) {
    if ((s = socket(r->ai_family, r->ai_socktype, 0)) == -1)
      continue;
    if (connect(s, r->ai_addr, r->ai_addrlen) == 0)
      break;
    close(s);
  }
  freeaddrinfo(res);
  if (r == NULL)
    return "Could not connect";
  if (!SSL_library_init())
    return "Could not initialize SSL";
  if ((meth = SSLv23_client_method()) == NULL)
    return "Could not obtain SSL method";
  if ((ctx = SSL_CTX_new((void *)(uintptr_t)(const void *)meth)) == NULL)
    return "Could not create SSL context";
  SSL_CTX_set_options(ctx, SSL_OP_NO_SSLv2 | SSL_OP_NO_SSLv3);
  SSL_CTX_set_mode(ctx, SSL_MODE_AUTO_RETRY);
  if (!SSL_CTX_load_verify_locations(ctx, certfile, NULL))
    return "Could not load root certificates";
  if ((ssl = SSL_new(ctx)) == NULL)
    return "Could not create SSL connection";
  if (!SSL_set_fd(ssl, s))
    return "Could not attach SSL to socket";
  if (SSL_connect(ssl) != 1)
    return "SSL handshake failed";
  if (SSL_get_verify_result(ssl) != X509_V_OK)
    return "Could not verify server SSL certificate";
  if ((cert = SSL_get_peer_certificate(ssl)) == NULL)
    return "Could not get server SSL certificate";
  if ((name = X509_get_subject_name(cert)) == NULL)
    return "Could not extract subject name from certificate";
  if (!X509_NAME_get_text_by_NID(name, NID_commonName, hostname, 256))
    return "Could not extract CN from certificate";
  if (strcasecmp(hostname, host) &&
      ((hostname[0] != '*') || (hostname[1] != '.') ||
       strcasecmp(&hostname[2], host)))
    return "Name on SSL certificate does not match server";
  if (SSL_write(ssl, req, reqlen) < reqlen)
    return "Could not write request";
  for (resppos = 0;; resppos += readlen) {
    if ((readlen = SSL_read(ssl, &resp[resppos], *resplen)) <= 0)
      break;
    *resplen -= readlen;
  }
  *resplen = resppos;
  if (readlen == -1)
    return "Could not read response";
  SSL_shutdown(ssl);
  SSL_free(ssl);
  SSL_CTX_free(ctx);
  return (NULL);
}


x86 assembly (clang, -O0):
<sslreq>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1b0,%rsp
mov    0x10(%rbp),%rax
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    %r8d,-0x2c(%rbp)
mov    %r9,-0x38(%rbp)
lea    -0x58(%rbp),%rdi
xor    %esi,%esi
mov    $0x20,%edx
call   10b0 <memset@plt>
mov    0x2d0a(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4c(%rbp)
mov    0x2cd6(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x50(%rbp)
mov    0x2cea(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x40(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
lea    -0x58(%rbp),%rdx
lea    -0x60(%rbp),%rcx
call   1180 <getaddrinfo@plt>
mov    %eax,-0x6c(%rbp)
cmp    $0x0,%eax
je     131c <sslreq+0x8c>
lea    0xced(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    170a <sslreq+0x47a>
mov    -0x60(%rbp),%rax
mov    %rax,-0x68(%rbp)
cmpq   $0x0,-0x68(%rbp)
je     1392 <sslreq+0x102>
mov    -0x68(%rbp),%rax
mov    0xc(%rax),%edi
mov    -0x68(%rbp),%rax
mov    0x8(%rax),%esi
xor    %edx,%edx
call   11b0 <socket@plt>
mov    %eax,-0x70(%rbp)
cmp    $0xffffffff,%eax
jne    1355 <sslreq+0xc5>
jmp    1381 <sslreq+0xf1>
mov    -0x70(%rbp),%edi
mov    -0x68(%rbp),%rax
mov    0x4(%rax),%esi
mov    -0x68(%rbp),%rax
mov    (%rax),%edx
call   1170 <connect@plt>
cmp    $0x0,%rax
jne    1379 <sslreq+0xe9>
jmp    1392 <sslreq+0x102>
mov    -0x70(%rbp),%edi
call   10c0 <close@plt>
mov    -0x68(%rbp),%rax
mov    0x10(%rax),%rax
mov    %rax,-0x68(%rbp)
jmp    1324 <sslreq+0x94>
mov    -0x60(%rbp),%rdi
call   11a0 <freeaddrinfo@plt>
cmpq   $0x0,-0x68(%rbp)
jne    13b6 <sslreq+0x126>
lea    0xc65(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    170a <sslreq+0x47a>
mov    $0x0,%al
call   10d0 <SSL_library_init@plt>
cmp    $0x0,%eax
jne    13d6 <sslreq+0x146>
lea    0xc57(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    170a <sslreq+0x47a>
mov    $0x0,%al
call   1070 <SSLv23_client_method@plt>
mov    %rax,-0x78(%rbp)
cmp    $0x0,%rax
jne    13fb <sslreq+0x16b>
lea    0xc4b(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    170a <sslreq+0x47a>
mov    -0x78(%rbp),%rdi
call   1110 <SSL_CTX_new@plt>
mov    %rax,-0x80(%rbp)
cmp    $0x0,%rax
jne    1422 <sslreq+0x192>
lea    0xc40(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    170a <sslreq+0x47a>
mov    -0x80(%rbp),%rdi
mov    0x2b73(%rip),%rax
mov    (%rax),%esi
mov    0x2b92(%rip),%rax
or     (%rax),%esi
call   1050 <SSL_CTX_set_options@plt>
mov    -0x80(%rbp),%rdi
mov    0x2b98(%rip),%rax
mov    (%rax),%esi
call   1160 <SSL_CTX_set_mode@plt>
mov    -0x80(%rbp),%rdi
mov    -0x20(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1130 <SSL_CTX_load_verify_locations@plt>
cmp    $0x0,%eax
jne    1479 <sslreq+0x1e9>
lea    0xc06(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    170a <sslreq+0x47a>
mov    -0x80(%rbp),%rdi
call   10f0 <SSL_new@plt>
mov    %rax,-0x88(%rbp)
cmp    $0x0,%rax
jne    14a3 <sslreq+0x213>
lea    0xbfd(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    170a <sslreq+0x47a>
mov    -0x88(%rbp),%rdi
mov    -0x70(%rbp),%esi
call   1090 <SSL_set_fd@plt>
cmp    $0x0,%eax
jne    14cb <sslreq+0x23b>
lea    0xbf5(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    170a <sslreq+0x47a>
mov    -0x88(%rbp),%rdi
call   1140 <SSL_connect@plt>
cmp    $0x1,%eax
je     14f0 <sslreq+0x260>
lea    0xbef(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    170a <sslreq+0x47a>
mov    -0x88(%rbp),%rdi
call   1190 <SSL_get_verify_result@plt>
mov    0x2af5(%rip),%rcx
cmp    (%rcx),%rax
je     151c <sslreq+0x28c>
lea    0xbd8(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    170a <sslreq+0x47a>
mov    -0x88(%rbp),%rdi
call   1120 <SSL_get_peer_certificate@plt>
mov    %rax,-0x90(%rbp)
cmp    $0x0,%rax
jne    1549 <sslreq+0x2b9>
lea    0xbd3(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    170a <sslreq+0x47a>
mov    -0x90(%rbp),%rdi
call   10a0 <X509_get_subject_name@plt>
mov    %rax,-0x98(%rbp)
cmp    $0x0,%rax
jne    1576 <sslreq+0x2e6>
lea    0xbcb(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    170a <sslreq+0x47a>
mov    -0x98(%rbp),%rdi
mov    0x2a34(%rip),%rax
mov    (%rax),%esi
lea    -0x1a0(%rbp),%rdx
mov    $0x100,%ecx
call   1030 <X509_NAME_get_text_by_NID@plt>
cmp    $0x0,%eax
jne    15b0 <sslreq+0x320>
lea    0xbc1(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    170a <sslreq+0x47a>
lea    -0x1a0(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <strcasecmp@plt>
cmp    $0x0,%rax
je     1618 <sslreq+0x388>
movsbl -0x1a0(%rbp),%eax
cmp    $0x2a,%eax
jne    1608 <sslreq+0x378>
movsbl -0x19f(%rbp),%eax
cmp    $0x2e,%eax
jne    1608 <sslreq+0x378>
lea    -0x1a0(%rbp),%rdi
add    $0x2,%rdi
mov    -0x10(%rbp),%rsi
call   1040 <strcasecmp@plt>
cmp    $0x0,%rax
je     1618 <sslreq+0x388>
lea    0xb7f(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    170a <sslreq+0x47a>
mov    -0x88(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    -0x2c(%rbp),%edx
call   1060 <SSL_write@plt>
cmp    -0x2c(%rbp),%eax
jge    1644 <sslreq+0x3b4>
lea    0xb81(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    170a <sslreq+0x47a>
movq   $0x0,-0x1b0(%rbp)
mov    -0x88(%rbp),%rdi
mov    -0x38(%rbp),%rsi
mov    -0x1b0(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
mov    0x10(%rbp),%rax
mov    (%rax),%rdx
call   10e0 <SSL_read@plt>
mov    %eax,-0x1a4(%rbp)
cmp    $0x0,%eax
jg     1688 <sslreq+0x3f8>
jmp    16b6 <sslreq+0x426>
movslq -0x1a4(%rbp),%rdx
mov    0x10(%rbp),%rax
mov    (%rax),%rcx
sub    %rdx,%rcx
mov    %rcx,(%rax)
movslq -0x1a4(%rbp),%rax
add    -0x1b0(%rbp),%rax
mov    %rax,-0x1b0(%rbp)
jmp    164f <sslreq+0x3bf>
mov    -0x1b0(%rbp),%rcx
mov    0x10(%rbp),%rax
mov    %rcx,(%rax)
cmpl   $0xffffffff,-0x1a4(%rbp)
jne    16e1 <sslreq+0x451>
lea    0xafc(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    170a <sslreq+0x47a>
mov    -0x88(%rbp),%rdi
call   1100 <SSL_shutdown@plt>
mov    -0x88(%rbp),%rdi
call   1080 <SSL_free@plt>
mov    -0x80(%rbp),%rdi
call   1150 <SSL_CTX_free@plt>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1b0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sslreq>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x148,%rsp
mov    %r9,0x18(%rsp)
mov    %r8d,%r13d
mov    %rcx,%r14
mov    %rdx,%r15
mov    %rsi,%rbx
mov    %rdi,%r12
lea    0x20(%rsp),%rbp
mov    %rbp,%rdi
xor    %esi,%esi
mov    $0x20,%edx
call   10b0 <memset@plt>
mov    0x2d08(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x2c(%rsp)
mov    0x2cd3(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x28(%rsp)
mov    0x2ce6(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x38(%rsp)
mov    %rsp,%rcx
mov    %r12,%rdi
mov    %rbx,%rsi
mov    %rbp,%rdx
call   1180 <getaddrinfo@plt>
test   %eax,%eax
je     130e <sslreq+0x7e>
lea    0xcf4(%rip),%rbx
jmp    1369 <sslreq+0xd9>
mov    %r12,0x10(%rsp)
mov    (%rsp),%rbx
test   %rbx,%rbx
jne    1329 <sslreq+0x99>
xor    %edi,%edi
jmp    135d <sslreq+0xcd>
mov    0x10(%rbx),%rbx
test   %rbx,%rbx
je     1359 <sslreq+0xc9>
mov    0x8(%rbx),%esi
mov    0xc(%rbx),%edi
xor    %edx,%edx
call   11b0 <socket@plt>
cmp    $0xffffffff,%eax
je     1320 <sslreq+0x90>
mov    %eax,%r12d
mov    (%rbx),%edx
mov    0x4(%rbx),%esi
mov    %eax,%edi
call   1170 <connect@plt>
test   %rax,%rax
je     137e <sslreq+0xee>
mov    %r12d,%edi
call   10c0 <close@plt>
jmp    1320 <sslreq+0x90>
mov    (%rsp),%rdi
call   11a0 <freeaddrinfo@plt>
lea    0xca9(%rip),%rbx
mov    %rbx,%rax
add    $0x148,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    (%rsp),%rdi
call   11a0 <freeaddrinfo@plt>
xor    %eax,%eax
call   10d0 <SSL_library_init@plt>
test   %eax,%eax
je     1507 <sslreq+0x277>
xor    %eax,%eax
call   1070 <SSLv23_client_method@plt>
test   %rax,%rax
je     1513 <sslreq+0x283>
mov    %rax,%rdi
call   1110 <SSL_CTX_new@plt>
test   %rax,%rax
je     151f <sslreq+0x28f>
mov    %rax,%rbx
mov    0x2bdf(%rip),%rax
mov    0x2c00(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
mov    %rbx,%rdi
call   1050 <SSL_CTX_set_options@plt>
mov    0x2c05(%rip),%rax
mov    (%rax),%esi
mov    %rbx,%rdi
call   1160 <SSL_CTX_set_mode@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
xor    %edx,%edx
call   1130 <SSL_CTX_load_verify_locations@plt>
test   %eax,%eax
je     152b <sslreq+0x29b>
mov    %rbx,%rdi
call   10f0 <SSL_new@plt>
test   %rax,%rax
je     1537 <sslreq+0x2a7>
mov    %rax,%rbp
mov    %rax,%rdi
mov    %r12d,%esi
call   1090 <SSL_set_fd@plt>
test   %eax,%eax
je     1543 <sslreq+0x2b3>
mov    %rbp,%rdi
call   1140 <SSL_connect@plt>
cmp    $0x1,%eax
jne    154f <sslreq+0x2bf>
mov    %rbp,%rdi
call   1190 <SSL_get_verify_result@plt>
mov    0x2bb7(%rip),%rcx
cmp    (%rcx),%rax
jne    155b <sslreq+0x2cb>
mov    %rbp,%r12
mov    %rbp,%rdi
call   1120 <SSL_get_peer_certificate@plt>
test   %rax,%rax
je     1567 <sslreq+0x2d7>
mov    %rax,%rdi
call   10a0 <X509_get_subject_name@plt>
test   %rax,%rax
je     1573 <sslreq+0x2e3>
mov    0x2b42(%rip),%rcx
mov    (%rcx),%esi
lea    0x40(%rsp),%rdx
mov    %rax,%rdi
mov    $0x100,%ecx
call   1030 <X509_NAME_get_text_by_NID@plt>
test   %eax,%eax
je     157f <sslreq+0x2ef>
mov    %rbx,0x8(%rsp)
lea    0x40(%rsp),%rdi
mov    0x10(%rsp),%rbp
mov    %rbp,%rsi
call   1040 <strcasecmp@plt>
test   %rax,%rax
je     14e1 <sslreq+0x251>
cmpb   $0x2a,0x40(%rsp)
lea    0xcd4(%rip),%rbx
jne    1369 <sslreq+0xd9>
cmpb   $0x2e,0x41(%rsp)
jne    1369 <sslreq+0xd9>
lea    0x42(%rsp),%rdi
mov    %rbp,%rsi
call   1040 <strcasecmp@plt>
test   %rax,%rax
jne    1369 <sslreq+0xd9>
mov    %r12,%rbx
mov    %r12,%rdi
mov    %r14,%rsi
mov    %r13d,%edx
call   1060 <SSL_write@plt>
cmp    %r13d,%eax
jge    158b <sslreq+0x2fb>
lea    0xcba(%rip),%rbx
jmp    1369 <sslreq+0xd9>
lea    0xb16(%rip),%rbx
jmp    1369 <sslreq+0xd9>
lea    0xb23(%rip),%rbx
jmp    1369 <sslreq+0xd9>
lea    0xb33(%rip),%rbx
jmp    1369 <sslreq+0xd9>
lea    0xb44(%rip),%rbx
jmp    1369 <sslreq+0xd9>
lea    0xb59(%rip),%rbx
jmp    1369 <sslreq+0xd9>
lea    0xb6d(%rip),%rbx
jmp    1369 <sslreq+0xd9>
lea    0xb80(%rip),%rbx
jmp    1369 <sslreq+0xd9>
lea    0xb89(%rip),%rbx
jmp    1369 <sslreq+0xd9>
lea    0xba5(%rip),%rbx
jmp    1369 <sslreq+0xd9>
lea    0xbbe(%rip),%rbx
jmp    1369 <sslreq+0xd9>
lea    0xbe2(%rip),%rbx
jmp    1369 <sslreq+0xd9>
mov    0x180(%rsp),%r15
mov    (%r15),%rdx
mov    %rbx,%rdi
mov    0x18(%rsp),%r14
mov    %r14,%rsi
call   10e0 <SSL_read@plt>
xor    %ebx,%ebx
test   %eax,%eax
jle    15cd <sslreq+0x33d>
mov    %r12,%rbp
mov    %eax,%eax
mov    (%r15),%rdx
sub    %rax,%rdx
mov    %rdx,(%r15)
add    %rax,%rbx
lea    (%r14,%rbx,4),%rsi
mov    %rbp,%rdi
call   10e0 <SSL_read@plt>
test   %eax,%eax
jg     15af <sslreq+0x31f>
mov    %rbx,(%r15)
cmp    $0xffffffff,%eax
je     15f6 <sslreq+0x366>
mov    %r12,%rdi
call   1100 <SSL_shutdown@plt>
mov    %r12,%rdi
call   1080 <SSL_free@plt>
mov    0x8(%rsp),%rdi
call   1150 <SSL_CTX_free@plt>
xor    %ebx,%ebx
jmp    1369 <sslreq+0xd9>
lea    0xbd7(%rip),%rbx
jmp    1369 <sslreq+0xd9>

LLVM IR (-O0):
%struct.addrinfo = type { i32, i32, i32, i32, %struct.addrinfo*, i32 }
@AF_UNSPEC = global i32 0
@SOCK_STREAM = global i32 0
@IPPROTO_TCP = global i32 0
@.str = [18 x i8] c"DNS lookup failed\00"
@.str.1 = [18 x i8] c"Could not connect\00"
@.str.2 = [25 x i8] c"Could not initialize SSL\00"
@.str.3 = [28 x i8] c"Could not obtain SSL method\00"
@.str.4 = [29 x i8] c"Could not create SSL context\00"
@SSL_OP_NO_SSLv2 = global i32 0
@SSL_OP_NO_SSLv3 = global i32 0
@SSL_MODE_AUTO_RETRY = global i32 0
@.str.5 = [33 x i8] c"Could not load root certificates\00"
@.str.6 = [32 x i8] c"Could not create SSL connection\00"
@.str.7 = [31 x i8] c"Could not attach SSL to socket\00"
@.str.8 = [21 x i8] c"SSL handshake failed\00"
@X509_V_OK = global i64 0
@.str.9 = [40 x i8] c"Could not verify server SSL certificate\00"
@.str.10 = [37 x i8] c"Could not get server SSL certificate\00"
@.str.11 = [48 x i8] c"Could not extract subject name from certificate\00"
@NID_commonName = global i32 0
@.str.12 = [38 x i8] c"Could not extract CN from certificate\00"
@.str.13 = [46 x i8] c"Name on SSL certificate does not match server\00"
@.str.14 = [24 x i8] c"Could not write request\00"
@.str.15 = [24 x i8] c"Could not read response\00"
define i8* @sslreq(i8* %0, i8* %1, i8* %2, i32* %3, i32 %4, i32* %5, i64* %6) {
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca i8*
%12 = alloca i32*
%13 = alloca i32
%14 = alloca i32*
%15 = alloca i64*
%16 = alloca %struct.addrinfo
%17 = alloca %struct.addrinfo*
%18 = alloca %struct.addrinfo*
%19 = alloca i32
%20 = alloca i32
%21 = alloca i32*
%22 = alloca i32*
%23 = alloca i32*
%24 = alloca i32*
%25 = alloca i32*
%26 = alloca [256 x i8]
%27 = alloca i32
%28 = alloca i64
store i8* %0, i8** %9
store i8* %1, i8** %10
store i8* %2, i8** %11
store i32* %3, i32** %12
store i32 %4, i32* %13
store i32* %5, i32** %14
store i64* %6, i64** %15
%29 = call i32 @memset(%struct.addrinfo* %16, i32 0, i32 32)
%30 = load i32, i32* @AF_UNSPEC
%31 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %16, i32 0, i32 3
store i32 %30, i32* %31
%32 = load i32, i32* @SOCK_STREAM
%33 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %16, i32 0, i32 2
store i32 %32, i32* %33
%34 = load i32, i32* @IPPROTO_TCP
%35 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %16, i32 0, i32 5
store i32 %34, i32* %35
%36 = load i8*, i8** %9
%37 = load i8*, i8** %10
%38 = call i32 @getaddrinfo(i8* %36, i8* %37, %struct.addrinfo* %16, %struct.addrinfo** %17)
store i32 %38, i32* %19
%39 = icmp ne i32 %38, 0
br i1 %39, label %40, label %41
40: ; preds = %7
store i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8** %8
br label %213
41: ; preds = %7
%42 = load %struct.addrinfo*, %struct.addrinfo** %17
store %struct.addrinfo* %42, %struct.addrinfo** %18
br label %43
43: ; preds = %70, %41
%44 = load %struct.addrinfo*, %struct.addrinfo** %18
%45 = icmp ne %struct.addrinfo* %44, null
br i1 %45, label %46, label %74
46: ; preds = %43
%47 = load %struct.addrinfo*, %struct.addrinfo** %18
%48 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %47, i32 0, i32 3
%49 = load i32, i32* %48
%50 = load %struct.addrinfo*, %struct.addrinfo** %18
%51 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %50, i32 0, i32 2
%52 = load i32, i32* %51
%53 = call i32 @socket(i32 %49, i32 %52, i32 0)
store i32 %53, i32* %20
%54 = icmp eq i32 %53, -1
br i1 %54, label %55, label %56
55: ; preds = %46
br label %70
56: ; preds = %46
%57 = load i32, i32* %20
%58 = load %struct.addrinfo*, %struct.addrinfo** %18
%59 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %58, i32 0, i32 1
%60 = load i32, i32* %59
%61 = load %struct.addrinfo*, %struct.addrinfo** %18
%62 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %61, i32 0, i32 0
%63 = load i32, i32* %62
%64 = call i64 @connect(i32 %57, i32 %60, i32 %63)
%65 = icmp eq i64 %64, 0
br i1 %65, label %66, label %67
66: ; preds = %56
br label %74
67: ; preds = %56
%68 = load i32, i32* %20
%69 = call i32 @close(i32 %68)
br label %70
70: ; preds = %67, %55
%71 = load %struct.addrinfo*, %struct.addrinfo** %18
%72 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %71, i32 0, i32 4
%73 = load %struct.addrinfo*, %struct.addrinfo** %72
store %struct.addrinfo* %73, %struct.addrinfo** %18
br label %43
74: ; preds = %66, %43
%75 = load %struct.addrinfo*, %struct.addrinfo** %17
%76 = call i32 @freeaddrinfo(%struct.addrinfo* %75)
%77 = load %struct.addrinfo*, %struct.addrinfo** %18
%78 = icmp eq %struct.addrinfo* %77, null
br i1 %78, label %79, label %80
79: ; preds = %74
store i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i8** %8
br label %213
80: ; preds = %74
%81 = call i32 (...) @SSL_library_init()
%82 = icmp ne i32 %81, 0
br i1 %82, label %84, label %83
83: ; preds = %80
store i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), i8** %8
br label %213
84: ; preds = %80
%85 = call i32* (...) @SSLv23_client_method()
store i32* %85, i32** %21
%86 = icmp eq i32* %85, null
br i1 %86, label %87, label %88
87: ; preds = %84
store i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.3, i64 0, i64 0), i8** %8
br label %213
88: ; preds = %84
%89 = load i32*, i32** %21
%90 = bitcast i32* %89 to i8*
%91 = ptrtoint i8* %90 to i64
%92 = inttoptr i64 %91 to i8*
%93 = call i32* @SSL_CTX_new(i8* %92)
store i32* %93, i32** %22
%94 = icmp eq i32* %93, null
br i1 %94, label %95, label %96
95: ; preds = %88
store i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.4, i64 0, i64 0), i8** %8
br label %213
96: ; preds = %88
%97 = load i32*, i32** %22
%98 = load i32, i32* @SSL_OP_NO_SSLv2
%99 = load i32, i32* @SSL_OP_NO_SSLv3
%100 = or i32 %98, %99
%101 = call i32 @SSL_CTX_set_options(i32* %97, i32 %100)
%102 = load i32*, i32** %22
%103 = load i32, i32* @SSL_MODE_AUTO_RETRY
%104 = call i32 @SSL_CTX_set_mode(i32* %102, i32 %103)
%105 = load i32*, i32** %22
%106 = load i8*, i8** %11
%107 = call i32 @SSL_CTX_load_verify_locations(i32* %105, i8* %106, i32* null)
%108 = icmp ne i32 %107, 0
br i1 %108, label %110, label %109
109: ; preds = %96
store i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.5, i64 0, i64 0), i8** %8
br label %213
110: ; preds = %96
%111 = load i32*, i32** %22
%112 = call i32* @SSL_new(i32* %111)
store i32* %112, i32** %23
%113 = icmp eq i32* %112, null
br i1 %113, label %114, label %115
114: ; preds = %110
store i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.6, i64 0, i64 0), i8** %8
br label %213
115: ; preds = %110
%116 = load i32*, i32** %23
%117 = load i32, i32* %20
%118 = call i32 @SSL_set_fd(i32* %116, i32 %117)
%119 = icmp ne i32 %118, 0
br i1 %119, label %121, label %120
120: ; preds = %115
store i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.7, i64 0, i64 0), i8** %8
br label %213
121: ; preds = %115
%122 = load i32*, i32** %23
%123 = call i32 @SSL_connect(i32* %122)
%124 = icmp ne i32 %123, 1
br i1 %124, label %125, label %126
125: ; preds = %121
store i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.8, i64 0, i64 0), i8** %8
br label %213
126: ; preds = %121
%127 = load i32*, i32** %23
%128 = call i64 @SSL_get_verify_result(i32* %127)
%129 = load i64, i64* @X509_V_OK
%130 = icmp ne i64 %128, %129
br i1 %130, label %131, label %132
131: ; preds = %126
store i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.9, i64 0, i64 0), i8** %8
br label %213
132: ; preds = %126
%133 = load i32*, i32** %23
%134 = call i32* @SSL_get_peer_certificate(i32* %133)
store i32* %134, i32** %24
%135 = icmp eq i32* %134, null
br i1 %135, label %136, label %137
136: ; preds = %132
store i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.10, i64 0, i64 0), i8** %8
br label %213
137: ; preds = %132
%138 = load i32*, i32** %24
%139 = call i32* @X509_get_subject_name(i32* %138)
store i32* %139, i32** %25
%140 = icmp eq i32* %139, null
br i1 %140, label %141, label %142
141: ; preds = %137
store i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.11, i64 0, i64 0), i8** %8
br label %213
142: ; preds = %137
%143 = load i32*, i32** %25
%144 = load i32, i32* @NID_commonName
%145 = getelementptr inbounds [256 x i8], [256 x i8]* %26, i64 0, i64 0
%146 = call i32 @X509_NAME_get_text_by_NID(i32* %143, i32 %144, i8* %145, i32 256)
%147 = icmp ne i32 %146, 0
br i1 %147, label %149, label %148
148: ; preds = %142
store i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.12, i64 0, i64 0), i8** %8
br label %213
149: ; preds = %142
%150 = getelementptr inbounds [256 x i8], [256 x i8]* %26, i64 0, i64 0
%151 = load i8*, i8** %9
%152 = call i64 @strcasecmp(i8* %150, i8* %151)
%153 = icmp ne i64 %152, 0
br i1 %153, label %154, label %170
154: ; preds = %149
%155 = getelementptr inbounds [256 x i8], [256 x i8]* %26, i64 0, i64 0
%156 = load i8, i8* %155
%157 = sext i8 %156 to i32
%158 = icmp ne i32 %157, 42
br i1 %158, label %169, label %159
159: ; preds = %154
%160 = getelementptr inbounds [256 x i8], [256 x i8]* %26, i64 0, i64 1
%161 = load i8, i8* %160
%162 = sext i8 %161 to i32
%163 = icmp ne i32 %162, 46
br i1 %163, label %169, label %164
164: ; preds = %159
%165 = getelementptr inbounds [256 x i8], [256 x i8]* %26, i64 0, i64 2
%166 = load i8*, i8** %9
%167 = call i64 @strcasecmp(i8* %165, i8* %166)
%168 = icmp ne i64 %167, 0
br i1 %168, label %169, label %170
169: ; preds = %164, %159, %154
store i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.13, i64 0, i64 0), i8** %8
br label %213
170: ; preds = %164, %149
%171 = load i32*, i32** %23
%172 = load i32*, i32** %12
%173 = load i32, i32* %13
%174 = call i32 @SSL_write(i32* %171, i32* %172, i32 %173)
%175 = load i32, i32* %13
%176 = icmp slt i32 %174, %175
br i1 %176, label %177, label %178
177: ; preds = %170
store i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.14, i64 0, i64 0), i8** %8
br label %213
178: ; preds = %170
store i64 0, i64* %28
br label %179
179: ; preds = %195, %178
%180 = load i32*, i32** %23
%181 = load i32*, i32** %14
%182 = load i64, i64* %28
%183 = getelementptr inbounds i32, i32* %181, i64 %182
%184 = load i64*, i64** %15
%185 = load i64, i64* %184
%186 = call i32 @SSL_read(i32* %180, i32* %183, i64 %185)
store i32 %186, i32* %27
%187 = icmp sle i32 %186, 0
br i1 %187, label %188, label %189
188: ; preds = %179
br label %200
189: ; preds = %179
%190 = load i32, i32* %27
%191 = sext i32 %190 to i64
%192 = load i64*, i64** %15
%193 = load i64, i64* %192
%194 = sub i64 %193, %191
store i64 %194, i64* %192
br label %195
195: ; preds = %189
%196 = load i32, i32* %27
%197 = sext i32 %196 to i64
%198 = load i64, i64* %28
%199 = add i64 %198, %197
store i64 %199, i64* %28
br label %179
200: ; preds = %188
%201 = load i64, i64* %28
%202 = load i64*, i64** %15
store i64 %201, i64* %202
%203 = load i32, i32* %27
%204 = icmp eq i32 %203, -1
br i1 %204, label %205, label %206
205: ; preds = %200
store i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.15, i64 0, i64 0), i8** %8
br label %213
206: ; preds = %200
%207 = load i32*, i32** %23
%208 = call i32 @SSL_shutdown(i32* %207)
%209 = load i32*, i32** %23
%210 = call i32 @SSL_free(i32* %209)
%211 = load i32*, i32** %22
%212 = call i32 @SSL_CTX_free(i32* %211)
store i8* null, i8** %8
br label %213
213: ; preds = %206, %205, %177, %169, %148, %141, %136, %131, %125, %120, %114, %109, %95, %87, %83, %79, %40
%214 = load i8*, i8** %8
ret i8* %214
}

LLVM IR (-O2):
%struct.addrinfo = type { i32, i32, i32, i32, %struct.addrinfo*, i32 }
@AF_UNSPEC = global i32 0
@SOCK_STREAM = global i32 0
@IPPROTO_TCP = global i32 0
@.str = [18 x i8] c"DNS lookup failed\00"
@.str.1 = [18 x i8] c"Could not connect\00"
@.str.2 = [25 x i8] c"Could not initialize SSL\00"
@.str.3 = [28 x i8] c"Could not obtain SSL method\00"
@.str.4 = [29 x i8] c"Could not create SSL context\00"
@SSL_OP_NO_SSLv2 = global i32 0
@SSL_OP_NO_SSLv3 = global i32 0
@SSL_MODE_AUTO_RETRY = global i32 0
@.str.5 = [33 x i8] c"Could not load root certificates\00"
@.str.6 = [32 x i8] c"Could not create SSL connection\00"
@.str.7 = [31 x i8] c"Could not attach SSL to socket\00"
@.str.8 = [21 x i8] c"SSL handshake failed\00"
@X509_V_OK = global i64 0
@.str.9 = [40 x i8] c"Could not verify server SSL certificate\00"
@.str.10 = [37 x i8] c"Could not get server SSL certificate\00"
@.str.11 = [48 x i8] c"Could not extract subject name from certificate\00"
@NID_commonName = global i32 0
@.str.12 = [38 x i8] c"Could not extract CN from certificate\00"
@.str.13 = [46 x i8] c"Name on SSL certificate does not match server\00"
@.str.14 = [24 x i8] c"Could not write request\00"
@.str.15 = [24 x i8] c"Could not read response\00"
define i8* @sslreq(i8* %0, i8* %1, i8* %2, i32* %3, i32 %4, i32* %5, i64* nocapture %6) {
%8 = alloca %struct.addrinfo
%9 = alloca %struct.addrinfo*
%10 = alloca [256 x i8]
%11 = bitcast %struct.addrinfo* %8 to i8*
%12 = bitcast %struct.addrinfo** %9 to i8*
%13 = getelementptr inbounds [256 x i8], [256 x i8]* %10, i64 0, i64 0
%14 = call i32 @memset(%struct.addrinfo* %8, i32 0, i32 32)
%15 = load i32, i32* @AF_UNSPEC
%16 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %8, i64 0, i32 3
store i32 %15, i32* %16
%17 = load i32, i32* @SOCK_STREAM
%18 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %8, i64 0, i32 2
store i32 %17, i32* %18
%19 = load i32, i32* @IPPROTO_TCP
%20 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %8, i64 0, i32 5
store i32 %19, i32* %20
%21 = call i32 @getaddrinfo(i8* %0, i8* %1, %struct.addrinfo* %8, %struct.addrinfo** %9)
%22 = icmp eq i32 %21, 0
br i1 %22, label %23, label %135
23: ; preds = %7
%24 = load %struct.addrinfo*, %struct.addrinfo** %9
%25 = icmp eq %struct.addrinfo* %24, null
br i1 %25, label %28, label %31
26: ; preds = %48
%27 = load %struct.addrinfo*, %struct.addrinfo** %9
br label %28
28: ; preds = %26, %23
%29 = phi %struct.addrinfo* [ %27, %26 ], [ null, %23 ]
%30 = call i32 @freeaddrinfo(%struct.addrinfo* %29)
br label %135
31: ; preds = %23, %48
%32 = phi %struct.addrinfo* [ %50, %48 ], [ %24, %23 ]
%33 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %32, i64 0, i32 3
%34 = load i32, i32* %33
%35 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %32, i64 0, i32 2
%36 = load i32, i32* %35
%37 = call i32 @socket(i32 %34, i32 %36, i32 0)
%38 = icmp eq i32 %37, -1
br i1 %38, label %48, label %39
39: ; preds = %31
%40 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %32, i64 0, i32 1
%41 = load i32, i32* %40
%42 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %32, i64 0, i32 0
%43 = load i32, i32* %42
%44 = call i64 @connect(i32 %37, i32 %41, i32 %43)
%45 = icmp eq i64 %44, 0
br i1 %45, label %52, label %46
46: ; preds = %39
%47 = call i32 @close(i32 %37)
br label %48
48: ; preds = %31, %46
%49 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %32, i64 0, i32 4
%50 = load %struct.addrinfo*, %struct.addrinfo** %49
%51 = icmp eq %struct.addrinfo* %50, null
br i1 %51, label %26, label %31
52: ; preds = %39
%53 = load %struct.addrinfo*, %struct.addrinfo** %9
%54 = call i32 @freeaddrinfo(%struct.addrinfo* %53)
%55 = call i32 (...) @SSL_library_init()
%56 = icmp eq i32 %55, 0
br i1 %56, label %135, label %57
57: ; preds = %52
%58 = call i32* (...) @SSLv23_client_method()
%59 = icmp eq i32* %58, null
br i1 %59, label %135, label %60
60: ; preds = %57
%61 = bitcast i32* %58 to i8*
%62 = call i32* @SSL_CTX_new(i8* %61)
%63 = icmp eq i32* %62, null
br i1 %63, label %135, label %64
64: ; preds = %60
%65 = load i32, i32* @SSL_OP_NO_SSLv2
%66 = load i32, i32* @SSL_OP_NO_SSLv3
%67 = or i32 %66, %65
%68 = call i32 @SSL_CTX_set_options(i32* %62, i32 %67)
%69 = load i32, i32* @SSL_MODE_AUTO_RETRY
%70 = call i32 @SSL_CTX_set_mode(i32* %62, i32 %69)
%71 = call i32 @SSL_CTX_load_verify_locations(i32* %62, i8* %2, i32* null)
%72 = icmp eq i32 %71, 0
br i1 %72, label %135, label %73
73: ; preds = %64
%74 = call i32* @SSL_new(i32* %62)
%75 = icmp eq i32* %74, null
br i1 %75, label %135, label %76
76: ; preds = %73
%77 = call i32 @SSL_set_fd(i32* %74, i32 %37)
%78 = icmp eq i32 %77, 0
br i1 %78, label %135, label %79
79: ; preds = %76
%80 = call i32 @SSL_connect(i32* %74)
%81 = icmp eq i32 %80, 1
br i1 %81, label %82, label %135
82: ; preds = %79
%83 = call i64 @SSL_get_verify_result(i32* %74)
%84 = load i64, i64* @X509_V_OK
%85 = icmp eq i64 %83, %84
br i1 %85, label %86, label %135
86: ; preds = %82
%87 = call i32* @SSL_get_peer_certificate(i32* %74)
%88 = icmp eq i32* %87, null
br i1 %88, label %135, label %89
89: ; preds = %86
%90 = call i32* @X509_get_subject_name(i32* %87)
%91 = icmp eq i32* %90, null
br i1 %91, label %135, label %92
92: ; preds = %89
%93 = load i32, i32* @NID_commonName
%94 = call i32 @X509_NAME_get_text_by_NID(i32* %90, i32 %93, i8* %13, i32 256)
%95 = icmp eq i32 %94, 0
br i1 %95, label %135, label %96
96: ; preds = %92
%97 = call i64 @strcasecmp(i8* %13, i8* %0)
%98 = icmp eq i64 %97, 0
br i1 %98, label %110, label %99
99: ; preds = %96
%100 = load i8, i8* %13
%101 = icmp ne i8 %100, 42
%102 = getelementptr inbounds [256 x i8], [256 x i8]* %10, i64 0, i64 1
%103 = load i8, i8* %102
%104 = icmp ne i8 %103, 46
%105 = select i1 %101, i1 true, i1 %104
br i1 %105, label %135, label %106
106: ; preds = %99
%107 = getelementptr inbounds [256 x i8], [256 x i8]* %10, i64 0, i64 2
%108 = call i64 @strcasecmp(i8* %107, i8* %0)
%109 = icmp eq i64 %108, 0
br i1 %109, label %110, label %135
110: ; preds = %106, %96
%111 = call i32 @SSL_write(i32* %74, i32* %3, i32 %4)
%112 = icmp slt i32 %111, %4
br i1 %112, label %135, label %113
113: ; preds = %110
%114 = load i64, i64* %6
%115 = call i32 @SSL_read(i32* %74, i32* %5, i64 %114)
%116 = icmp slt i32 %115, 1
br i1 %116, label %127, label %117
117: ; preds = %113, %117
%118 = phi i32 [ %125, %117 ], [ %115, %113 ]
%119 = phi i64 [ %123, %117 ], [ 0, %113 ]
%120 = zext i32 %118 to i64
%121 = load i64, i64* %6
%122 = sub i64 %121, %120
store i64 %122, i64* %6
%123 = add i64 %119, %120
%124 = getelementptr inbounds i32, i32* %5, i64 %123
%125 = call i32 @SSL_read(i32* %74, i32* %124, i64 %122)
%126 = icmp slt i32 %125, 1
br i1 %126, label %127, label %117
127: ; preds = %117, %113
%128 = phi i64 [ 0, %113 ], [ %123, %117 ]
%129 = phi i32 [ %115, %113 ], [ %125, %117 ]
store i64 %128, i64* %6
%130 = icmp eq i32 %129, -1
br i1 %130, label %135, label %131
131: ; preds = %127
%132 = call i32 @SSL_shutdown(i32* %74)
%133 = call i32 @SSL_free(i32* %74)
%134 = call i32 @SSL_CTX_free(i32* %62)
br label %135
135: ; preds = %28, %127, %110, %99, %106, %92, %89, %86, %82, %79, %76, %73, %64, %60, %57, %52, %7, %131
%136 = phi i8* [ null, %131 ], [ getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), %7 ], [ getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), %52 ], [ getelementptr inbounds ([28 x i8], [28 x i8]* @.str.3, i64 0, i64 0), %57 ], [ getelementptr inbounds ([29 x i8], [29 x i8]* @.str.4, i64 0, i64 0), %60 ], [ getelementptr inbounds ([33 x i8], [33 x i8]* @.str.5, i64 0, i64 0), %64 ], [ getelementptr inbounds ([32 x i8], [32 x i8]* @.str.6, i64 0, i64 0), %73 ], [ getelementptr inbounds ([31 x i8], [31 x i8]* @.str.7, i64 0, i64 0), %76 ], [ getelementptr inbounds ([21 x i8], [21 x i8]* @.str.8, i64 0, i64 0), %79 ], [ getelementptr inbounds ([40 x i8], [40 x i8]* @.str.9, i64 0, i64 0), %82 ], [ getelementptr inbounds ([37 x i8], [37 x i8]* @.str.10, i64 0, i64 0), %86 ], [ getelementptr inbounds ([48 x i8], [48 x i8]* @.str.11, i64 0, i64 0), %89 ], [ getelementptr inbounds ([38 x i8], [38 x i8]* @.str.12, i64 0, i64 0), %92 ], [ getelementptr inbounds ([46 x i8], [46 x i8]* @.str.13, i64 0, i64 0), %106 ], [ getelementptr inbounds ([46 x i8], [46 x i8]* @.str.13, i64 0, i64 0), %99 ], [ getelementptr inbounds ([24 x i8], [24 x i8]* @.str.14, i64 0, i64 0), %110 ], [ getelementptr inbounds ([24 x i8], [24 x i8]* @.str.15, i64 0, i64 0), %127 ], [ getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), %28 ]
ret i8* %136
}