#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 */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_4__ {
  int /*<<< orphan*/ s_addr;
};
struct sockaddr_in {
  int /*<<< orphan*/ sin_port;
  TYPE_2__ sin_addr;
  int /*<<< orphan*/ sin_family;
};
struct sockaddr {
  int dummy;
};
struct TYPE_3__ {
  int fd;
};
struct epoll_event {
  int events;
  TYPE_1__ data;
};
typedef int /*<<< orphan*/ sa;
typedef int /*<<< orphan*/ buf;
typedef int /*<<< orphan*/ SSL_METHOD;
typedef int /*<<< orphan*/ SSL_CTX;
typedef int /*<<< orphan*/ SSL;

/* Variables and functions */
int /*<<< orphan*/ AF_INET;
scalar_t__ EINPROGRESS;
int EINTR;
int EPOLLERR;
int EPOLLET;
int EPOLLHUP;
int EPOLLIN;
int EPOLLOUT;
int /*<<< orphan*/ EPOLL_CTL_ADD;
int /*<<< orphan*/ ERR_print_errors_fp(int /*<<< orphan*/);
int /*<<< orphan*/ F_GETFL;
int /*<<< orphan*/ F_SETFL;
int O_NONBLOCK;
int /*<<< orphan*/ OpenSSL_add_ssl_algorithms();
int /*<<< orphan*/ SOCK_STREAM;
int /*<<< orphan*/ *SSL_CTX_new(int /*<<< orphan*/ const *);
int SSL_ERROR_WANT_READ;
int SSL_ERROR_WANT_WRITE;
int SSL_ERROR_WANT_X509_LOOKUP;
int SSL_ERROR_ZERO_RETURN;
int SSL_connect(int /*<<< orphan*/ *);
int /*<<< orphan*/ SSL_free(int /*<<< orphan*/ *);
int SSL_get_error(int /*<<< orphan*/ *, int);
int /*<<< orphan*/ SSL_load_error_strings();
int /*<<< orphan*/ *SSL_new(int /*<<< orphan*/ *);
int SSL_read(int /*<<< orphan*/ *, char *, int);
int /*<<< orphan*/ SSL_set_connect_state(int /*<<< orphan*/ *);
int /*<<< orphan*/ SSL_set_fd(int /*<<< orphan*/ *, int);
int SSL_write(int /*<<< orphan*/ *, char *, int /*<<< orphan*/);
int /*<<< orphan*/ *TLSv1_2_client_method();
struct epoll_event *calloc(int, int);
int /*<<< orphan*/ close(int);
int connect(int, struct sockaddr *, int);
int /*<<< orphan*/ dump_cert_info(int /*<<< orphan*/ *, int);
int epoll_create1(int /*<<< orphan*/);
int epoll_ctl(int, int /*<<< orphan*/, int, struct epoll_event *);
int epoll_wait(int, struct epoll_event *, int, int);
scalar_t__ errno;
int /*<<< orphan*/ exit(int);
int fcntl(int, int /*<<< orphan*/, int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ free(struct epoll_event *);
int /*<<< orphan*/ htons(int);
int /*<<< orphan*/ inet_addr(char *);
char *inet_ntoa(TYPE_2__);
int /*<<< orphan*/ init_ssl_opts(int /*<<< orphan*/ *);
int /*<<< orphan*/ memset(struct sockaddr_in *, char, int);
int ntohs(int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *, ...);
int socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ strlen(char *);
int main(int argc, char *argv[]) {
  const SSL_METHOD *meth;
  SSL_CTX *ctx;
  SSL *ssl;
  int err;
  int sd;
  struct sockaddr_in sa;
  char buf[4096];
  printf("epoll openssl tls client..");
  SSL_load_error_strings();
  OpenSSL_add_ssl_algorithms();
  meth = TLSv1_2_client_method();
  ctx = SSL_CTX_new(meth);
  if ((ctx) == NULL)
    exit(1);
  init_ssl_opts(ctx);
  sd = socket(AF_INET, SOCK_STREAM, 0);
  if ((sd) == -1) {
    perror("socket");
    exit(1);
  };
  int flags = fcntl(sd, F_GETFL, 0);
  if (flags < 0) {
    exit(12);
  }
  fcntl(sd, F_SETFL, flags | O_NONBLOCK);
  memset(&sa, '\0', sizeof(sa));
  sa.sin_family = AF_INET;
  sa.sin_addr.s_addr = inet_addr("127.0.0.1");
  sa.sin_port = htons(1112);
  printf("Connected to server %s, port %u\n", inet_ntoa(sa.sin_addr),
         ntohs(sa.sin_port));
  err = connect(sd, (struct sockaddr *)&sa, sizeof(sa));
  if (err < 0 && errno != EINPROGRESS) {
    perror("connect != EINPROGRESS");
    exit(15);
  }
  int efd = epoll_create1(0);
  if (efd == -1) {
    perror("epoll_create");
    exit(1);
  }
  struct epoll_event event;
  event.data.fd = sd;
  event.events = EPOLLIN | EPOLLOUT | EPOLLET | EPOLLERR | EPOLLHUP;
  int s = epoll_ctl(efd, EPOLL_CTL_ADD, sd, &event);
  if (s == -1) {
    perror("epoll_ctl");
    exit(2);
  }
  ssl = SSL_new(ctx);
  if ((ssl) == NULL)
    exit(1);
  SSL_set_fd(ssl, sd);
  SSL_set_connect_state(ssl);
  for (;;) {
    int success = SSL_connect(ssl);
    if (success < 0) {
      err = SSL_get_error(ssl, success);
      if (err == SSL_ERROR_WANT_READ || err == SSL_ERROR_WANT_WRITE ||
          err == SSL_ERROR_WANT_X509_LOOKUP) {
        continue;
      } else if (err == SSL_ERROR_ZERO_RETURN) {
        printf("SSL_connect: close notify received from peer");
        exit(18);
      } else {
        printf("Error SSL_connect: %d", err);
        perror("perror: ");
        SSL_free(ssl);
        close(sd);
        close(efd);
        exit(16);
      }
    } else {
      dump_cert_info(ssl, false);
      break;
    }
  }
  struct epoll_event *events = calloc(128, sizeof event);
  while (1) {
    int n = epoll_wait(efd, events, 128, -1);
    if (n < 0 && n == EINTR) {
      printf("epoll_wait System call interrupted. Continue..");
      continue;
    }
    int i;
    for (i = 0; i < n; i++) {
      if ((events[i].events & EPOLLERR) || (events[i].events & EPOLLHUP) ||
          (!(events[i].events & (EPOLLIN | EPOLLOUT)))) {
        fprintf(stderr, "epoll error\n");
        close(events[i].data.fd);
        continue;
      } else if (events->events & (EPOLLIN | EPOLLHUP)) {
        err = SSL_read(ssl, buf, sizeof(buf) - 1);
        if ((err) == -1) {
          ERR_print_errors_fp(stderr);
          exit(2);
        };
        buf[err] = '\0';
        printf("Client Received %d chars - '%s'\n", err, buf);
        if (err <= 0) {
          if (err == SSL_ERROR_WANT_READ || err == SSL_ERROR_WANT_WRITE ||
              err == SSL_ERROR_WANT_X509_LOOKUP) {
            printf("Read could not complete. Will be invoked later.");
            break;
          } else if (err == SSL_ERROR_ZERO_RETURN) {
            printf("SSL_read: close notify received from peer");
            return 0;
          } else {
            printf("Error during SSL_read");
            exit(17);
          }
        }
        exit(0);
      } else if (events->events & EPOLLOUT) {
        err = SSL_write(ssl, "PING", strlen("PING"));
        if ((err) == -1) {
          ERR_print_errors_fp(stderr);
          exit(2);
        };
        if (err <= 0) {
          if (err == SSL_ERROR_WANT_READ || err == SSL_ERROR_WANT_WRITE ||
              err == SSL_ERROR_WANT_X509_LOOKUP) {
            printf("Write could not complete. Will be invoked later.");
            break;
          } else if (err == SSL_ERROR_ZERO_RETURN) {
            printf("SSL_write: close notify received from peer");
            return 0;
          } else {
            printf("Error during SSL_write");
            exit(17);
          }
        }
      }
    }
  }
  free(events);
  close(sd);
  close(efd);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1080,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xcd0(%rip),%rdi
mov    $0x0,%al
call   20b0 <printf@plt>
mov    $0x0,%al
call   21b0 <SSL_load_error_strings@plt>
mov    $0x0,%al
call   21d0 <OpenSSL_add_ssl_algorithms@plt>
mov    $0x0,%al
call   2200 <TLSv1_2_client_method@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   2160 <SSL_CTX_new@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    2372 <main+0x62>
mov    $0x1,%edi
call   21e0 <exit@plt>
mov    -0x20(%rbp),%rdi
call   2150 <init_ssl_opts@plt>
mov    0x2c4e(%rip),%rax
mov    (%rax),%edi
mov    0x2bfd(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   2230 <socket@plt>
mov    %eax,-0x30(%rbp)
cmpl   $0xffffffff,-0x30(%rbp)
jne    23b7 <main+0xa7>
lea    0xc73(%rip),%rdi
call   21c0 <perror@plt>
mov    $0x1,%edi
call   21e0 <exit@plt>
mov    -0x30(%rbp),%edi
mov    0x2ba7(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   2060 <fcntl@plt>
mov    %eax,-0x1044(%rbp)
cmpl   $0x0,-0x1044(%rbp)
jge    23e7 <main+0xd7>
mov    $0xc,%edi
call   21e0 <exit@plt>
mov    -0x30(%rbp),%edi
mov    0x2b9f(%rip),%rax
mov    (%rax),%esi
mov    -0x1044(%rbp),%edx
mov    0x2bc8(%rip),%rax
or     (%rax),%edx
call   2060 <fcntl@plt>
lea    -0x40(%rbp),%rdi
xor    %esi,%esi
mov    $0xc,%edx
call   20c0 <memset@plt>
mov    0x2bb2(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x38(%rbp)
lea    0xbf8(%rip),%rdi
call   2120 <inet_addr@plt>
mov    %eax,-0x3c(%rbp)
mov    $0x458,%edi
call   20a0 <htons@plt>
mov    %eax,-0x40(%rbp)
mov    -0x3c(%rbp),%edi
call   2070 <inet_ntoa@plt>
mov    %rax,-0x1070(%rbp)
mov    -0x40(%rbp),%edi
call   2180 <ntohs@plt>
mov    -0x1070(%rbp),%rsi
mov    %eax,%edx
lea    0xbc6(%rip),%rdi
mov    $0x0,%al
call   20b0 <printf@plt>
mov    -0x30(%rbp),%edi
lea    -0x40(%rbp),%rsi
mov    $0xc,%edx
call   21f0 <connect@plt>
mov    %eax,-0x2c(%rbp)
cmpl   $0x0,-0x2c(%rbp)
jge    24bb <main+0x1ab>
mov    0x2ae6(%rip),%rax
mov    (%rax),%rax
mov    0x2b24(%rip),%rcx
cmp    (%rcx),%rax
je     24bb <main+0x1ab>
lea    0xba1(%rip),%rdi
call   21c0 <perror@plt>
mov    $0xf,%edi
call   21e0 <exit@plt>
xor    %edi,%edi
call   2220 <epoll_create1@plt>
mov    %eax,-0x1048(%rbp)
cmpl   $0xffffffff,-0x1048(%rbp)
jne    24eb <main+0x1db>
lea    0xb88(%rip),%rdi
call   21c0 <perror@plt>
mov    $0x1,%edi
call   21e0 <exit@plt>
mov    -0x30(%rbp),%eax
mov    %eax,-0x104c(%rbp)
mov    0x2abd(%rip),%rax
mov    (%rax),%eax
mov    0x2a7c(%rip),%rcx
or     (%rcx),%eax
mov    0x2a4b(%rip),%rcx
or     (%rcx),%eax
mov    0x2a82(%rip),%rcx
or     (%rcx),%eax
mov    0x2a31(%rip),%rcx
or     (%rcx),%eax
mov    %eax,-0x1050(%rbp)
mov    -0x1048(%rbp),%edi
mov    0x2a7c(%rip),%rax
mov    (%rax),%esi
mov    -0x30(%rbp),%edx
lea    -0x1050(%rbp),%rcx
call   20e0 <epoll_ctl@plt>
mov    %eax,-0x1054(%rbp)
cmpl   $0xffffffff,-0x1054(%rbp)
jne    256e <main+0x25e>
lea    0xb12(%rip),%rdi
call   21c0 <perror@plt>
mov    $0x2,%edi
call   21e0 <exit@plt>
mov    -0x20(%rbp),%rdi
call   2100 <SSL_new@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
jne    2590 <main+0x280>
mov    $0x1,%edi
call   21e0 <exit@plt>
mov    -0x28(%rbp),%rdi
mov    -0x30(%rbp),%esi
call   2080 <SSL_set_fd@plt>
mov    -0x28(%rbp),%rdi
call   2130 <SSL_set_connect_state@plt>
mov    -0x28(%rbp),%rdi
call   21a0 <SSL_connect@plt>
mov    %eax,-0x1058(%rbp)
cmpl   $0x0,-0x1058(%rbp)
jge    267b <main+0x36b>
mov    -0x28(%rbp),%rdi
mov    -0x1058(%rbp),%esi
call   2030 <SSL_get_error@plt>
mov    %eax,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
mov    0x2993(%rip),%rcx
cmp    (%rcx),%eax
je     2609 <main+0x2f9>
mov    -0x2c(%rbp),%eax
mov    0x29f9(%rip),%rcx
cmp    (%rcx),%eax
je     2609 <main+0x2f9>
mov    -0x2c(%rbp),%eax
mov    0x29f7(%rip),%rcx
cmp    (%rcx),%eax
jne    260e <main+0x2fe>
jmp    25a5 <main+0x295>
mov    -0x2c(%rbp),%eax
mov    0x29c8(%rip),%rcx
cmp    (%rcx),%eax
jne    2638 <main+0x328>
lea    0xa54(%rip),%rdi
mov    $0x0,%al
call   20b0 <printf@plt>
mov    $0x12,%edi
call   21e0 <exit@plt>
mov    -0x2c(%rbp),%esi
lea    0xa66(%rip),%rdi
mov    $0x0,%al
call   20b0 <printf@plt>
lea    0xa6e(%rip),%rdi
call   21c0 <perror@plt>
mov    -0x28(%rbp),%rdi
call   2050 <SSL_free@plt>
mov    -0x30(%rbp),%edi
call   20d0 <close@plt>
mov    -0x1048(%rbp),%edi
call   20d0 <close@plt>
mov    $0x10,%edi
call   21e0 <exit@plt>
mov    -0x28(%rbp),%rdi
xor    %esi,%esi
call   2170 <dump_cert_info@plt>
mov    $0x80,%edi
mov    $0x8,%esi
call   2110 <calloc@plt>
mov    %rax,-0x1060(%rbp)
mov    -0x1048(%rbp),%edi
mov    -0x1060(%rbp),%rsi
mov    $0x80,%edx
mov    $0xffffffff,%ecx
call   2190 <epoll_wait@plt>
mov    %eax,-0x1064(%rbp)
cmpl   $0x0,-0x1064(%rbp)
jge    26f3 <main+0x3e3>
mov    -0x1064(%rbp),%eax
mov    0x2888(%rip),%rcx
cmp    (%rcx),%eax
jne    26f3 <main+0x3e3>
lea    0x9e0(%rip),%rdi
mov    $0x0,%al
call   20b0 <printf@plt>
jmp    269c <main+0x38c>
movl   $0x0,-0x1068(%rbp)
mov    -0x1068(%rbp),%eax
cmp    -0x1064(%rbp),%eax
jge    2a01 <main+0x6f1>
mov    -0x1060(%rbp),%rax
movslq -0x1068(%rbp),%rcx
mov    (%rax,%rcx,8),%eax
mov    0x2871(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
jne    2783 <main+0x473>
mov    -0x1060(%rbp),%rax
movslq -0x1068(%rbp),%rcx
mov    (%rax,%rcx,8),%eax
mov    0x2806(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
jne    2783 <main+0x473>
mov    -0x1060(%rbp),%rax
movslq -0x1068(%rbp),%rcx
mov    (%rax,%rcx,8),%eax
mov    0x284b(%rip),%rcx
mov    (%rcx),%ecx
mov    0x280a(%rip),%rdx
or     (%rdx),%ecx
and    %ecx,%eax
cmp    $0x0,%eax
jne    27b4 <main+0x4a4>
mov    0x2816(%rip),%rax
mov    (%rax),%edi
lea    0x963(%rip),%rsi
call   2140 <fprintf@plt>
mov    -0x1060(%rbp),%rax
movslq -0x1068(%rbp),%rcx
mov    0x4(%rax,%rcx,8),%edi
call   20d0 <close@plt>
jmp    29ed <main+0x6dd>
mov    -0x1060(%rbp),%rax
mov    (%rax),%eax
mov    0x27f4(%rip),%rcx
mov    (%rcx),%ecx
mov    0x2783(%rip),%rdx
or     (%rdx),%ecx
and    %ecx,%eax
cmp    $0x0,%eax
je     28d6 <main+0x5c6>
mov    -0x28(%rbp),%rdi
lea    -0x1040(%rbp),%rsi
mov    $0xfff,%edx
call   20f0 <SSL_read@plt>
mov    %eax,-0x2c(%rbp)
cmpl   $0xffffffff,-0x2c(%rbp)
jne    2814 <main+0x504>
mov    0x279d(%rip),%rax
mov    (%rax),%edi
call   2210 <ERR_print_errors_fp@plt>
mov    $0x2,%edi
call   21e0 <exit@plt>
movslq -0x2c(%rbp),%rax
movb   $0x0,-0x1040(%rbp,%rax,1)
mov    -0x2c(%rbp),%esi
lea    -0x1040(%rbp),%rdx
lea    0x8d2(%rip),%rdi
mov    $0x0,%al
call   20b0 <printf@plt>
cmpl   $0x0,-0x2c(%rbp)
jg     28cf <main+0x5bf>
mov    -0x2c(%rbp),%eax
mov    0x2724(%rip),%rcx
cmp    (%rcx),%eax
je     2878 <main+0x568>
mov    -0x2c(%rbp),%eax
mov    0x278a(%rip),%rcx
cmp    (%rcx),%eax
je     2878 <main+0x568>
mov    -0x2c(%rbp),%eax
mov    0x2788(%rip),%rcx
cmp    (%rcx),%eax
jne    288b <main+0x57b>
lea    0x8a5(%rip),%rdi
mov    $0x0,%al
call   20b0 <printf@plt>
jmp    2a01 <main+0x6f1>
mov    -0x2c(%rbp),%eax
mov    0x274b(%rip),%rcx
cmp    (%rcx),%eax
jne    28b7 <main+0x5a7>
lea    0x8b0(%rip),%rdi
mov    $0x0,%al
call   20b0 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    2a06 <main+0x6f6>
lea    0x8c0(%rip),%rdi
mov    $0x0,%al
call   20b0 <printf@plt>
mov    $0x11,%edi
call   21e0 <exit@plt>
xor    %edi,%edi
call   21e0 <exit@plt>
mov    -0x1060(%rbp),%rax
mov    (%rax),%eax
mov    0x269a(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     29de <main+0x6ce>
mov    -0x28(%rbp),%rax
mov    %rax,-0x1078(%rbp)
lea    0x891(%rip),%rdi
call   2090 <strlen@plt>
mov    -0x1078(%rbp),%rdi
mov    %eax,%edx
lea    0x87c(%rip),%rsi
call   2040 <SSL_write@plt>
mov    %eax,-0x2c(%rbp)
cmpl   $0xffffffff,-0x2c(%rbp)
jne    2942 <main+0x632>
mov    0x266f(%rip),%rax
mov    (%rax),%edi
call   2210 <ERR_print_errors_fp@plt>
mov    $0x2,%edi
call   21e0 <exit@plt>
cmpl   $0x0,-0x2c(%rbp)
jg     29d9 <main+0x6c9>
mov    -0x2c(%rbp),%eax
mov    0x261a(%rip),%rcx
cmp    (%rcx),%eax
je     2982 <main+0x672>
mov    -0x2c(%rbp),%eax
mov    0x2680(%rip),%rcx
cmp    (%rcx),%eax
je     2982 <main+0x672>
mov    -0x2c(%rbp),%eax
mov    0x267e(%rip),%rcx
cmp    (%rcx),%eax
jne    2995 <main+0x685>
lea    0x810(%rip),%rdi
mov    $0x0,%al
call   20b0 <printf@plt>
jmp    2a01 <main+0x6f1>
mov    -0x2c(%rbp),%eax
mov    0x2641(%rip),%rcx
cmp    (%rcx),%eax
jne    29c1 <main+0x6b1>
lea    0x81c(%rip),%rdi
mov    $0x0,%al
call   20b0 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    2a06 <main+0x6f6>
lea    0x82d(%rip),%rdi
mov    $0x0,%al
call   20b0 <printf@plt>
mov    $0x11,%edi
call   21e0 <exit@plt>
jmp    29de <main+0x6ce>
jmp    29e3 <main+0x6d3>
jmp    29e8 <main+0x6d8>
jmp    29ed <main+0x6dd>
mov    -0x1068(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1068(%rbp)
jmp    26fd <main+0x3ed>
jmp    269c <main+0x38c>
mov    -0x4(%rbp),%eax
add    $0x1080,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x1038,%rsp
lea    0xcd8(%rip),%rdi
xor    %eax,%eax
call   20b0 <printf@plt>
xor    %eax,%eax
call   21b0 <SSL_load_error_strings@plt>
xor    %eax,%eax
call   21d0 <OpenSSL_add_ssl_algorithms@plt>
xor    %eax,%eax
call   2200 <TLSv1_2_client_method@plt>
mov    %rax,%rdi
call   2160 <SSL_CTX_new@plt>
test   %rax,%rax
je     27d7 <main+0x4c7>
mov    %rax,%r12
mov    %rax,%rdi
call   2150 <init_ssl_opts@plt>
mov    0x2c69(%rip),%rbx
mov    (%rbx),%edi
mov    0x2c18(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   2230 <socket@plt>
cmp    $0xffffffff,%eax
je     27e1 <main+0x4d1>
mov    %eax,%r13d
mov    0x2bdc(%rip),%rax
mov    (%rax),%esi
mov    %r13d,%edi
xor    %edx,%edx
call   2060 <fcntl@plt>
test   %eax,%eax
js     27ea <main+0x4da>
mov    0x2be9(%rip),%rcx
mov    (%rcx),%esi
mov    0x2c18(%rip),%rcx
or     (%rcx),%eax
mov    %r13d,%edi
mov    %eax,%edx
call   2060 <fcntl@plt>
lea    0x18(%rsp),%r15
mov    %r15,%rdi
xor    %esi,%esi
mov    $0xc,%edx
call   20c0 <memset@plt>
mov    (%rbx),%eax
mov    %eax,0x20(%rsp)
lea    0xc45(%rip),%rdi
call   2120 <inet_addr@plt>
mov    %eax,0x1c(%rsp)
mov    $0x458,%edi
call   20a0 <htons@plt>
mov    %eax,0x18(%rsp)
mov    0x1c(%rsp),%edi
call   2070 <inet_ntoa@plt>
mov    %rax,%rbx
mov    0x18(%rsp),%edi
call   2180 <ntohs@plt>
lea    0xc1c(%rip),%rdi
mov    %rbx,%rsi
mov    %eax,%edx
xor    %eax,%eax
call   20b0 <printf@plt>
mov    %r13d,%edi
mov    %r15,%rsi
mov    $0xc,%edx
call   21f0 <connect@plt>
test   %eax,%eax
jns    244a <main+0x13a>
mov    0x2b41(%rip),%rax
mov    (%rax),%rax
mov    0x2b7f(%rip),%rcx
cmp    (%rcx),%rax
jne    2829 <main+0x519>
xor    %edi,%edi
call   2220 <epoll_create1@plt>
cmp    $0xffffffff,%eax
je     27f4 <main+0x4e4>
mov    %eax,%ebx
mov    0x2b55(%rip),%rcx
mov    0x2b16(%rip),%rax
mov    (%rax),%eax
or     (%rcx),%eax
mov    0x2ae3(%rip),%rcx
or     (%rcx),%eax
mov    0x2b1a(%rip),%r14
or     (%r14),%eax
mov    0x2ac8(%rip),%rcx
or     (%rcx),%eax
mov    %r13d,0x2c(%rsp)
mov    %eax,0x28(%rsp)
mov    0x2b16(%rip),%rax
mov    (%rax),%esi
lea    0x28(%rsp),%rcx
mov    %ebx,%edi
mov    %r13d,%edx
call   20e0 <epoll_ctl@plt>
cmp    $0xffffffff,%eax
je     280a <main+0x4fa>
mov    %r12,%rdi
call   2100 <SSL_new@plt>
test   %rax,%rax
je     27d7 <main+0x4c7>
mov    %rax,%rbp
mov    %ebx,0xc(%rsp)
mov    %rax,%rdi
mov    %r13d,%esi
call   2080 <SSL_set_fd@plt>
mov    %rbp,%rdi
call   2130 <SSL_set_connect_state@plt>
mov    %rbp,0x10(%rsp)
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %rbp,%rdi
call   21a0 <SSL_connect@plt>
test   %eax,%eax
jns    254e <main+0x23e>
mov    %rbp,%rdi
mov    %eax,%esi
call   2030 <SSL_get_error@plt>
mov    0x2a63(%rip),%rcx
cmp    (%rcx),%eax
je     24f0 <main+0x1e0>
mov    0x2ad0(%rip),%rcx
cmp    (%rcx),%eax
je     24f0 <main+0x1e0>
mov    0x2ad5(%rip),%rcx
cmp    (%rcx),%eax
je     24f0 <main+0x1e0>
mov    0x2ab2(%rip),%rcx
cmp    (%rcx),%eax
jne    2796 <main+0x486>
lea    0xb3e(%rip),%rdi
xor    %eax,%eax
call   20b0 <printf@plt>
mov    $0x12,%edi
call   21e0 <exit@plt>
mov    %rbp,%rdi
xor    %esi,%esi
call   2170 <dump_cert_info@plt>
mov    $0x80,%edi
mov    $0x8,%esi
call   2110 <calloc@plt>
mov    %rax,%rbp
mov    0x2a2f(%rip),%r12
lea    0xb7e(%rip),%r13
jmp    2587 <main+0x277>
nopw   0x0(%rax,%rax,1)
xor    %eax,%eax
call   20b0 <printf@plt>
mov    0xc(%rsp),%edi
mov    %rbp,%rsi
mov    $0x80,%edx
mov    $0xffffffff,%ecx
call   2190 <epoll_wait@plt>
test   %eax,%eax
jns    25b3 <main+0x2a3>
lea    0xb1f(%rip),%rdi
mov    0x29b1(%rip),%rcx
cmp    (%rcx),%eax
je     2580 <main+0x270>
test   %eax,%eax
jle    2587 <main+0x277>
mov    %eax,%ebx
xor    %r15d,%r15d
nopl   0x0(%rax)
mov    0x0(%rbp,%r15,8),%ecx
test   %ecx,(%r14)
jne    25d7 <main+0x2c7>
mov    0x297f(%rip),%rax
mov    (%rax),%eax
test   %ecx,%eax
je     25f8 <main+0x2e8>
mov    (%r12),%edi
mov    %r13,%rsi
call   2140 <fprintf@plt>
mov    0x4(%rbp,%r15,8),%edi
call   20d0 <close@plt>
add    $0x1,%r15
cmp    %r15,%rbx
jne    25c0 <main+0x2b0>
jmp    2587 <main+0x277>
mov    0x29b9(%rip),%rdx
mov    (%rdx),%esi
mov    0x2978(%rip),%rdx
mov    (%rdx),%edx
mov    %edx,%edi
or     %esi,%edi
test   %ecx,%edi
je     25d7 <main+0x2c7>
mov    0x0(%rbp),%ecx
or     %eax,%esi
test   %esi,%ecx
jne    26a2 <main+0x392>
test   %edx,%ecx
je     25ed <main+0x2dd>
mov    %r14,%r12
lea    0xb67(%rip),%r14
mov    %r14,%rdi
call   2090 <strlen@plt>
mov    0x10(%rsp),%rdi
mov    %r14,%rsi
mov    %eax,%edx
call   2040 <SSL_write@plt>
cmp    $0xffffffff,%eax
je     2771 <main+0x461>
test   %eax,%eax
mov    %r12,%r14
mov    0x2947(%rip),%r12
jg     25ed <main+0x2dd>
lea    0xb37(%rip),%rdi
mov    0x2907(%rip),%rcx
cmp    (%rcx),%eax
je     2580 <main+0x270>
lea    0xb21(%rip),%rdi
mov    0x2969(%rip),%rcx
cmp    (%rcx),%eax
je     2580 <main+0x270>
lea    0xb0b(%rip),%rdi
mov    0x2963(%rip),%rcx
cmp    (%rcx),%eax
je     2580 <main+0x270>
jmp    2740 <main+0x430>
mov    0x10(%rsp),%rdi
lea    0x30(%rsp),%r15
mov    %r15,%rsi
mov    $0xfff,%edx
call   20f0 <SSL_read@plt>
cmp    $0xffffffff,%eax
je     2789 <main+0x479>
mov    %eax,%ebx
cltq
movb   $0x0,0x30(%rsp,%rax,1)
lea    0xa31(%rip),%rdi
mov    %ebx,%esi
mov    %r15,%rdx
xor    %eax,%eax
call   20b0 <printf@plt>
test   %ebx,%ebx
jg     278f <main+0x47f>
lea    0xa37(%rip),%rdi
mov    0x287c(%rip),%rax
cmp    (%rax),%ebx
je     2580 <main+0x270>
lea    0xa21(%rip),%rdi
mov    0x28de(%rip),%rax
cmp    (%rax),%ebx
je     2580 <main+0x270>
lea    0xa0b(%rip),%rdi
mov    0x28d8(%rip),%rax
cmp    (%rax),%ebx
je     2580 <main+0x270>
mov    0x28b1(%rip),%rax
cmp    (%rax),%ebx
jne    2820 <main+0x510>
lea    0xa16(%rip),%rdi
jmp    2756 <main+0x446>
mov    0x2899(%rip),%rcx
cmp    (%rcx),%eax
jne    283f <main+0x52f>
lea    0xa74(%rip),%rdi
xor    %eax,%eax
call   20b0 <printf@plt>
xor    %eax,%eax
add    $0x1038,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x2828(%rip),%rax
mov    (%rax),%edi
call   2210 <ERR_print_errors_fp@plt>
mov    $0x2,%edi
call   21e0 <exit@plt>
mov    (%r12),%edi
jmp    277a <main+0x46a>
xor    %edi,%edi
call   21e0 <exit@plt>
lea    0x90b(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   20b0 <printf@plt>
lea    0x911(%rip),%rdi
call   21c0 <perror@plt>
mov    0x10(%rsp),%rdi
call   2050 <SSL_free@plt>
mov    %r13d,%edi
call   20d0 <close@plt>
mov    0xc(%rsp),%edi
call   20d0 <close@plt>
mov    $0x10,%edi
call   21e0 <exit@plt>
mov    $0x1,%edi
call   21e0 <exit@plt>
lea    0x833(%rip),%rdi
jmp    27fb <main+0x4eb>
mov    $0xc,%edi
call   21e0 <exit@plt>
lea    0x869(%rip),%rdi
call   21c0 <perror@plt>
mov    $0x1,%edi
call   21e0 <exit@plt>
lea    0x860(%rip),%rdi
call   21c0 <perror@plt>
mov    $0x2,%edi
call   21e0 <exit@plt>
lea    0x957(%rip),%rdi
jmp    2846 <main+0x536>
lea    0x81d(%rip),%rdi
call   21c0 <perror@plt>
mov    $0xf,%edi
call   21e0 <exit@plt>
lea    0x9af(%rip),%rdi
xor    %eax,%eax
call   20b0 <printf@plt>
mov    $0x11,%edi
call   21e0 <exit@plt>

LLVM IR (-O0):
%struct.sockaddr_in = type { i32, %struct.TYPE_4__, i32 }
%struct.TYPE_4__ = type { i32 }
%struct.epoll_event = type { i32, %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i32 }
%struct.sockaddr = type { i32 }
@.str = [27 x i8] c"epoll openssl tls client..\00"
@AF_INET = global i32 0
@SOCK_STREAM = global i32 0
@.str.1 = [7 x i8] c"socket\00"
@F_GETFL = global i32 0
@F_SETFL = global i32 0
@O_NONBLOCK = global i32 0
@.str.2 = [10 x i8] c"127.0.0.1\00"
@.str.3 = [33 x i8] c"Connected to server %s, port %u\0A\00"
@errno = global i64 0
@EINPROGRESS = global i64 0
@.str.4 = [23 x i8] c"connect != EINPROGRESS\00"
@.str.5 = [13 x i8] c"epoll_create\00"
@EPOLLIN = global i32 0
@EPOLLOUT = global i32 0
@EPOLLET = global i32 0
@EPOLLERR = global i32 0
@EPOLLHUP = global i32 0
@EPOLL_CTL_ADD = global i32 0
@.str.6 = [10 x i8] c"epoll_ctl\00"
@SSL_ERROR_WANT_READ = global i32 0
@SSL_ERROR_WANT_WRITE = global i32 0
@SSL_ERROR_WANT_X509_LOOKUP = global i32 0
@SSL_ERROR_ZERO_RETURN = global i32 0
@.str.7 = [45 x i8] c"SSL_connect: close notify received from peer\00"
@.str.8 = [22 x i8] c"Error SSL_connect: %d\00"
@.str.9 = [9 x i8] c"perror: \00"
@EINTR = global i32 0
@.str.10 = [47 x i8] c"epoll_wait System call interrupted. Continue..\00"
@stderr = global i32 0
@.str.11 = [13 x i8] c"epoll error\0A\00"
@.str.12 = [33 x i8] c"Client Received %d chars - '%s'\0A\00"
@.str.13 = [48 x i8] c"Read could not complete. Will be invoked later.\00"
@.str.14 = [42 x i8] c"SSL_read: close notify received from peer\00"
@.str.15 = [22 x i8] c"Error during SSL_read\00"
@.str.16 = [5 x i8] c"PING\00"
@.str.17 = [49 x i8] c"Write could not complete. Will be invoked later.\00"
@.str.18 = [43 x i8] c"SSL_write: close notify received from peer\00"
@.str.19 = [23 x i8] c"Error during SSL_write\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca i32
%10 = alloca i32
%11 = alloca %struct.sockaddr_in
%12 = alloca [4096 x i8]
%13 = alloca i32
%14 = alloca i32
%15 = alloca %struct.epoll_event
%16 = alloca i32
%17 = alloca i32
%18 = alloca %struct.epoll_event*
%19 = alloca i32
%20 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%22 = call i32 (...) @SSL_load_error_strings()
%23 = call i32 (...) @OpenSSL_add_ssl_algorithms()
%24 = call i32* (...) @TLSv1_2_client_method()
store i32* %24, i32** %6
%25 = load i32*, i32** %6
%26 = call i32* @SSL_CTX_new(i32* %25)
store i32* %26, i32** %7
%27 = load i32*, i32** %7
%28 = icmp eq i32* %27, null
br i1 %28, label %29, label %31
29: ; preds = %2
%30 = call i32 @exit(i32 1)
unreachable
31: ; preds = %2
%32 = load i32*, i32** %7
%33 = call i32 @init_ssl_opts(i32* %32)
%34 = load i32, i32* @AF_INET
%35 = load i32, i32* @SOCK_STREAM
%36 = call i32 @socket(i32 %34, i32 %35, i32 0)
store i32 %36, i32* %10
%37 = load i32, i32* %10
%38 = icmp eq i32 %37, -1
br i1 %38, label %39, label %42
39: ; preds = %31
%40 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%41 = call i32 @exit(i32 1)
unreachable
42: ; preds = %31
%43 = load i32, i32* %10
%44 = load i32, i32* @F_GETFL
%45 = call i32 @fcntl(i32 %43, i32 %44, i32 0)
store i32 %45, i32* %13
%46 = load i32, i32* %13
%47 = icmp slt i32 %46, 0
br i1 %47, label %48, label %50
48: ; preds = %42
%49 = call i32 @exit(i32 12)
unreachable
50: ; preds = %42
%51 = load i32, i32* %10
%52 = load i32, i32* @F_SETFL
%53 = load i32, i32* %13
%54 = load i32, i32* @O_NONBLOCK
%55 = or i32 %53, %54
%56 = call i32 @fcntl(i32 %51, i32 %52, i32 %55)
%57 = call i32 @memset(%struct.sockaddr_in* %11, i8 signext 0, i32 12)
%58 = load i32, i32* @AF_INET
%59 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %11, i32 0, i32 2
store i32 %58, i32* %59
%60 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
%61 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %11, i32 0, i32 1
%62 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %61, i32 0, i32 0
store i32 %60, i32* %62
%63 = call i32 @htons(i32 1112)
%64 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %11, i32 0, i32 0
store i32 %63, i32* %64
%65 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %11, i32 0, i32 1
%66 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %65, i32 0, i32 0
%67 = load i32, i32* %66
%68 = call i8* @inet_ntoa(i32 %67)
%69 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %11, i32 0, i32 0
%70 = load i32, i32* %69
%71 = call i32 @ntohs(i32 %70)
%72 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.3, i64 0, i64 0), i8* %68, i32 %71)
%73 = load i32, i32* %10
%74 = bitcast %struct.sockaddr_in* %11 to %struct.sockaddr*
%75 = call i32 @connect(i32 %73, %struct.sockaddr* %74, i32 12)
store i32 %75, i32* %9
%76 = load i32, i32* %9
%77 = icmp slt i32 %76, 0
br i1 %77, label %78, label %85
78: ; preds = %50
%79 = load i64, i64* @errno
%80 = load i64, i64* @EINPROGRESS
%81 = icmp ne i64 %79, %80
br i1 %81, label %82, label %85
82: ; preds = %78
%83 = call i32 @perror(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.4, i64 0, i64 0))
%84 = call i32 @exit(i32 15)
unreachable
85: ; preds = %78, %50
%86 = call i32 @epoll_create1(i32 0)
store i32 %86, i32* %14
%87 = load i32, i32* %14
%88 = icmp eq i32 %87, -1
br i1 %88, label %89, label %92
89: ; preds = %85
%90 = call i32 @perror(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.5, i64 0, i64 0))
%91 = call i32 @exit(i32 1)
unreachable
92: ; preds = %85
%93 = load i32, i32* %10
%94 = getelementptr inbounds %struct.epoll_event, %struct.epoll_event* %15, i32 0, i32 1
%95 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %94, i32 0, i32 0
store i32 %93, i32* %95
%96 = load i32, i32* @EPOLLIN
%97 = load i32, i32* @EPOLLOUT
%98 = or i32 %96, %97
%99 = load i32, i32* @EPOLLET
%100 = or i32 %98, %99
%101 = load i32, i32* @EPOLLERR
%102 = or i32 %100, %101
%103 = load i32, i32* @EPOLLHUP
%104 = or i32 %102, %103
%105 = getelementptr inbounds %struct.epoll_event, %struct.epoll_event* %15, i32 0, i32 0
store i32 %104, i32* %105
%106 = load i32, i32* %14
%107 = load i32, i32* @EPOLL_CTL_ADD
%108 = load i32, i32* %10
%109 = call i32 @epoll_ctl(i32 %106, i32 %107, i32 %108, %struct.epoll_event* %15)
store i32 %109, i32* %16
%110 = load i32, i32* %16
%111 = icmp eq i32 %110, -1
br i1 %111, label %112, label %115
112: ; preds = %92
%113 = call i32 @perror(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i64 0, i64 0))
%114 = call i32 @exit(i32 2)
unreachable
115: ; preds = %92
%116 = load i32*, i32** %7
%117 = call i32* @SSL_new(i32* %116)
store i32* %117, i32** %8
%118 = load i32*, i32** %8
%119 = icmp eq i32* %118, null
br i1 %119, label %120, label %122
120: ; preds = %115
%121 = call i32 @exit(i32 1)
unreachable
122: ; preds = %115
%123 = load i32*, i32** %8
%124 = load i32, i32* %10
%125 = call i32 @SSL_set_fd(i32* %123, i32 %124)
%126 = load i32*, i32** %8
%127 = call i32 @SSL_set_connect_state(i32* %126)
br label %128
128: ; preds = %148, %122
%129 = load i32*, i32** %8
%130 = call i32 @SSL_connect(i32* %129)
store i32 %130, i32* %17
%131 = load i32, i32* %17
%132 = icmp slt i32 %131, 0
br i1 %132, label %133, label %167
133: ; preds = %128
%134 = load i32*, i32** %8
%135 = load i32, i32* %17
%136 = call i32 @SSL_get_error(i32* %134, i32 %135)
store i32 %136, i32* %9
%137 = load i32, i32* %9
%138 = load i32, i32* @SSL_ERROR_WANT_READ
%139 = icmp eq i32 %137, %138
br i1 %139, label %148, label %140
140: ; preds = %133
%141 = load i32, i32* %9
%142 = load i32, i32* @SSL_ERROR_WANT_WRITE
%143 = icmp eq i32 %141, %142
br i1 %143, label %148, label %144
144: ; preds = %140
%145 = load i32, i32* %9
%146 = load i32, i32* @SSL_ERROR_WANT_X509_LOOKUP
%147 = icmp eq i32 %145, %146
br i1 %147, label %148, label %149
148: ; preds = %144, %140, %133
br label %128
149: ; preds = %144
%150 = load i32, i32* %9
%151 = load i32, i32* @SSL_ERROR_ZERO_RETURN
%152 = icmp eq i32 %150, %151
br i1 %152, label %153, label %156
153: ; preds = %149
%154 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.7, i64 0, i64 0))
%155 = call i32 @exit(i32 18)
unreachable
156: ; preds = %149
%157 = load i32, i32* %9
%158 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.8, i64 0, i64 0), i32 %157)
%159 = call i32 @perror(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.9, i64 0, i64 0))
%160 = load i32*, i32** %8
%161 = call i32 @SSL_free(i32* %160)
%162 = load i32, i32* %10
%163 = call i32 @close(i32 %162)
%164 = load i32, i32* %14
%165 = call i32 @close(i32 %164)
%166 = call i32 @exit(i32 16)
unreachable
167: ; preds = %128
%168 = load i32*, i32** %8
%169 = call i32 @dump_cert_info(i32* %168, i32 0)
br label %170
170: ; preds = %167
%171 = call %struct.epoll_event* @calloc(i32 128, i32 8)
store %struct.epoll_event* %171, %struct.epoll_event** %18
br label %172
172: ; preds = %170, %182, %335
%173 = load i32, i32* %14
%174 = load %struct.epoll_event*, %struct.epoll_event** %18
%175 = call i32 @epoll_wait(i32 %173, %struct.epoll_event* %174, i32 128, i32 -1)
store i32 %175, i32* %19
%176 = load i32, i32* %19
%177 = icmp slt i32 %176, 0
br i1 %177, label %178, label %184
178: ; preds = %172
%179 = load i32, i32* %19
%180 = load i32, i32* @EINTR
%181 = icmp eq i32 %179, %180
br i1 %181, label %182, label %184
182: ; preds = %178
%183 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.10, i64 0, i64 0))
br label %172
184: ; preds = %178, %172
store i32 0, i32* %20
br label %185
185: ; preds = %332, %184
%186 = load i32, i32* %20
%187 = load i32, i32* %19
%188 = icmp slt i32 %186, %187
br i1 %188, label %189, label %335
189: ; preds = %185
%190 = load %struct.epoll_event*, %struct.epoll_event** %18
%191 = load i32, i32* %20
%192 = sext i32 %191 to i64
%193 = getelementptr inbounds %struct.epoll_event, %struct.epoll_event* %190, i64 %192
%194 = getelementptr inbounds %struct.epoll_event, %struct.epoll_event* %193, i32 0, i32 0
%195 = load i32, i32* %194
%196 = load i32, i32* @EPOLLERR
%197 = and i32 %195, %196
%198 = icmp ne i32 %197, 0
br i1 %198, label %221, label %199
199: ; preds = %189
%200 = load %struct.epoll_event*, %struct.epoll_event** %18
%201 = load i32, i32* %20
%202 = sext i32 %201 to i64
%203 = getelementptr inbounds %struct.epoll_event, %struct.epoll_event* %200, i64 %202
%204 = getelementptr inbounds %struct.epoll_event, %struct.epoll_event* %203, i32 0, i32 0
%205 = load i32, i32* %204
%206 = load i32, i32* @EPOLLHUP
%207 = and i32 %205, %206
%208 = icmp ne i32 %207, 0
br i1 %208, label %221, label %209
209: ; preds = %199
%210 = load %struct.epoll_event*, %struct.epoll_event** %18
%211 = load i32, i32* %20
%212 = sext i32 %211 to i64
%213 = getelementptr inbounds %struct.epoll_event, %struct.epoll_event* %210, i64 %212
%214 = getelementptr inbounds %struct.epoll_event, %struct.epoll_event* %213, i32 0, i32 0
%215 = load i32, i32* %214
%216 = load i32, i32* @EPOLLIN
%217 = load i32, i32* @EPOLLOUT
%218 = or i32 %216, %217
%219 = and i32 %215, %218
%220 = icmp ne i32 %219, 0
br i1 %220, label %232, label %221
221: ; preds = %209, %199, %189
%222 = load i32, i32* @stderr
%223 = call i32 @fprintf(i32 %222, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.11, i64 0, i64 0))
%224 = load %struct.epoll_event*, %struct.epoll_event** %18
%225 = load i32, i32* %20
%226 = sext i32 %225 to i64
%227 = getelementptr inbounds %struct.epoll_event, %struct.epoll_event* %224, i64 %226
%228 = getelementptr inbounds %struct.epoll_event, %struct.epoll_event* %227, i32 0, i32 1
%229 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %228, i32 0, i32 0
%230 = load i32, i32* %229
%231 = call i32 @close(i32 %230)
br label %332
232: ; preds = %209
%233 = load %struct.epoll_event*, %struct.epoll_event** %18
%234 = getelementptr inbounds %struct.epoll_event, %struct.epoll_event* %233, i32 0, i32 0
%235 = load i32, i32* %234
%236 = load i32, i32* @EPOLLIN
%237 = load i32, i32* @EPOLLHUP
%238 = or i32 %236, %237
%239 = and i32 %235, %238
%240 = icmp ne i32 %239, 0
br i1 %240, label %241, label %285
241: ; preds = %232
%242 = load i32*, i32** %8
%243 = getelementptr inbounds [4096 x i8], [4096 x i8]* %12, i64 0, i64 0
%244 = call i32 @SSL_read(i32* %242, i8* %243, i32 4095)
store i32 %244, i32* %9
%245 = load i32, i32* %9
%246 = icmp eq i32 %245, -1
br i1 %246, label %247, label %251
247: ; preds = %241
%248 = load i32, i32* @stderr
%249 = call i32 @ERR_print_errors_fp(i32 %248)
%250 = call i32 @exit(i32 2)
unreachable
251: ; preds = %241
%252 = load i32, i32* %9
%253 = sext i32 %252 to i64
%254 = getelementptr inbounds [4096 x i8], [4096 x i8]* %12, i64 0, i64 %253
store i8 0, i8* %254
%255 = load i32, i32* %9
%256 = getelementptr inbounds [4096 x i8], [4096 x i8]* %12, i64 0, i64 0
%257 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.12, i64 0, i64 0), i32 %255, i8* %256)
%258 = load i32, i32* %9
%259 = icmp sle i32 %258, 0
br i1 %259, label %260, label %283
260: ; preds = %251
%261 = load i32, i32* %9
%262 = load i32, i32* @SSL_ERROR_WANT_READ
%263 = icmp eq i32 %261, %262
br i1 %263, label %272, label %264
264: ; preds = %260
%265 = load i32, i32* %9
%266 = load i32, i32* @SSL_ERROR_WANT_WRITE
%267 = icmp eq i32 %265, %266
br i1 %267, label %272, label %268
268: ; preds = %264
%269 = load i32, i32* %9
%270 = load i32, i32* @SSL_ERROR_WANT_X509_LOOKUP
%271 = icmp eq i32 %269, %270
br i1 %271, label %272, label %274
272: ; preds = %268, %264, %260
%273 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.13, i64 0, i64 0))
br label %335
274: ; preds = %268
%275 = load i32, i32* %9
%276 = load i32, i32* @SSL_ERROR_ZERO_RETURN
%277 = icmp eq i32 %275, %276
br i1 %277, label %278, label %280
278: ; preds = %274
%279 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.14, i64 0, i64 0))
store i32 0, i32* %3
br label %336
280: ; preds = %274
%281 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.15, i64 0, i64 0))
%282 = call i32 @exit(i32 17)
unreachable
283: ; preds = %251
%284 = call i32 @exit(i32 0)
unreachable
285: ; preds = %232
%286 = load %struct.epoll_event*, %struct.epoll_event** %18
%287 = getelementptr inbounds %struct.epoll_event, %struct.epoll_event* %286, i32 0, i32 0
%288 = load i32, i32* %287
%289 = load i32, i32* @EPOLLOUT
%290 = and i32 %288, %289
%291 = icmp ne i32 %290, 0
br i1 %291, label %292, label %329
292: ; preds = %285
%293 = load i32*, i32** %8
%294 = call i32 @strlen(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.16, i64 0, i64 0))
%295 = call i32 @SSL_write(i32* %293, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.16, i64 0, i64 0), i32 %294)
store i32 %295, i32* %9
%296 = load i32, i32* %9
%297 = icmp eq i32 %296, -1
br i1 %297, label %298, label %302
298: ; preds = %292
%299 = load i32, i32* @stderr
%300 = call i32 @ERR_print_errors_fp(i32 %299)
%301 = call i32 @exit(i32 2)
unreachable
302: ; preds = %292
%303 = load i32, i32* %9
%304 = icmp sle i32 %303, 0
br i1 %304, label %305, label %328
305: ; preds = %302
%306 = load i32, i32* %9
%307 = load i32, i32* @SSL_ERROR_WANT_READ
%308 = icmp eq i32 %306, %307
br i1 %308, label %317, label %309
309: ; preds = %305
%310 = load i32, i32* %9
%311 = load i32, i32* @SSL_ERROR_WANT_WRITE
%312 = icmp eq i32 %310, %311
br i1 %312, label %317, label %313
313: ; preds = %309
%314 = load i32, i32* %9
%315 = load i32, i32* @SSL_ERROR_WANT_X509_LOOKUP
%316 = icmp eq i32 %314, %315
br i1 %316, label %317, label %319
317: ; preds = %313, %309, %305
%318 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.17, i64 0, i64 0))
br label %335
319: ; preds = %313
%320 = load i32, i32* %9
%321 = load i32, i32* @SSL_ERROR_ZERO_RETURN
%322 = icmp eq i32 %320, %321
br i1 %322, label %323, label %325
323: ; preds = %319
%324 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.18, i64 0, i64 0))
store i32 0, i32* %3
br label %336
325: ; preds = %319
%326 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.19, i64 0, i64 0))
%327 = call i32 @exit(i32 17)
unreachable
328: ; preds = %302
br label %329
329: ; preds = %328, %285
br label %330
330: ; preds = %329
br label %331
331: ; preds = %330
br label %332
332: ; preds = %331, %221
%333 = load i32, i32* %20
%334 = add nsw i32 %333, 1
store i32 %334, i32* %20
br label %185
335: ; preds = %317, %272, %185
br label %172
336: ; preds = %323, %278
%337 = load i32, i32* %3
ret i32 %337
}

LLVM IR (-O2):
%struct.sockaddr_in = type { i32, %struct.TYPE_4__, i32 }
%struct.TYPE_4__ = type { i32 }
%struct.epoll_event = type { i32, %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i32 }
%struct.sockaddr = type { i32 }
@.str = [27 x i8] c"epoll openssl tls client..\00"
@AF_INET = global i32 0
@SOCK_STREAM = global i32 0
@.str.1 = [7 x i8] c"socket\00"
@F_GETFL = global i32 0
@F_SETFL = global i32 0
@O_NONBLOCK = global i32 0
@.str.2 = [10 x i8] c"127.0.0.1\00"
@.str.3 = [33 x i8] c"Connected to server %s, port %u\0A\00"
@errno = global i64 0
@EINPROGRESS = global i64 0
@.str.4 = [23 x i8] c"connect != EINPROGRESS\00"
@.str.5 = [13 x i8] c"epoll_create\00"
@EPOLLIN = global i32 0
@EPOLLOUT = global i32 0
@EPOLLET = global i32 0
@EPOLLERR = global i32 0
@EPOLLHUP = global i32 0
@EPOLL_CTL_ADD = global i32 0
@.str.6 = [10 x i8] c"epoll_ctl\00"
@SSL_ERROR_WANT_READ = global i32 0
@SSL_ERROR_WANT_WRITE = global i32 0
@SSL_ERROR_WANT_X509_LOOKUP = global i32 0
@SSL_ERROR_ZERO_RETURN = global i32 0
@.str.7 = [45 x i8] c"SSL_connect: close notify received from peer\00"
@.str.8 = [22 x i8] c"Error SSL_connect: %d\00"
@.str.9 = [9 x i8] c"perror: \00"
@EINTR = global i32 0
@.str.10 = [47 x i8] c"epoll_wait System call interrupted. Continue..\00"
@stderr = global i32 0
@.str.11 = [13 x i8] c"epoll error\0A\00"
@.str.12 = [33 x i8] c"Client Received %d chars - '%s'\0A\00"
@.str.13 = [48 x i8] c"Read could not complete. Will be invoked later.\00"
@.str.14 = [42 x i8] c"SSL_read: close notify received from peer\00"
@.str.15 = [22 x i8] c"Error during SSL_read\00"
@.str.16 = [5 x i8] c"PING\00"
@.str.17 = [49 x i8] c"Write could not complete. Will be invoked later.\00"
@.str.18 = [43 x i8] c"SSL_write: close notify received from peer\00"
@.str.19 = [23 x i8] c"Error during SSL_write\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca %struct.sockaddr_in
%4 = alloca [4096 x i8]
%5 = alloca %struct.epoll_event
%6 = bitcast %struct.sockaddr_in* %3 to i8*
%7 = getelementptr inbounds [4096 x i8], [4096 x i8]* %4, i64 0, i64 0
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%9 = tail call i32 (...) @SSL_load_error_strings()
%10 = tail call i32 (...) @OpenSSL_add_ssl_algorithms()
%11 = tail call i32* (...) @TLSv1_2_client_method()
%12 = tail call i32* @SSL_CTX_new(i32* %11)
%13 = icmp eq i32* %12, null
br i1 %13, label %14, label %16
14: ; preds = %2
%15 = tail call i32 @exit(i32 1)
unreachable
16: ; preds = %2
%17 = tail call i32 @init_ssl_opts(i32* %12)
%18 = load i32, i32* @AF_INET
%19 = load i32, i32* @SOCK_STREAM
%20 = tail call i32 @socket(i32 %18, i32 %19, i32 0)
%21 = icmp eq i32 %20, -1
br i1 %21, label %22, label %25
22: ; preds = %16
%23 = tail call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%24 = tail call i32 @exit(i32 1)
unreachable
25: ; preds = %16
%26 = load i32, i32* @F_GETFL
%27 = tail call i32 @fcntl(i32 %20, i32 %26, i32 0)
%28 = icmp slt i32 %27, 0
br i1 %28, label %29, label %31
29: ; preds = %25
%30 = tail call i32 @exit(i32 12)
unreachable
31: ; preds = %25
%32 = load i32, i32* @F_SETFL
%33 = load i32, i32* @O_NONBLOCK
%34 = or i32 %33, %27
%35 = tail call i32 @fcntl(i32 %20, i32 %32, i32 %34)
%36 = call i32 @memset(%struct.sockaddr_in* %3, i8 signext 0, i32 12)
%37 = load i32, i32* @AF_INET
%38 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %3, i64 0, i32 2
store i32 %37, i32* %38
%39 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
%40 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %3, i64 0, i32 1, i32 0
store i32 %39, i32* %40
%41 = call i32 @htons(i32 1112)
%42 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %3, i64 0, i32 0
store i32 %41, i32* %42
%43 = load i32, i32* %40
%44 = call i8* @inet_ntoa(i32 %43)
%45 = load i32, i32* %42
%46 = call i32 @ntohs(i32 %45)
%47 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.3, i64 0, i64 0), i8* %44, i32 %46)
%48 = bitcast %struct.sockaddr_in* %3 to %struct.sockaddr*
%49 = call i32 @connect(i32 %20, %struct.sockaddr* %48, i32 12)
%50 = icmp slt i32 %49, 0
br i1 %50, label %51, label %58
51: ; preds = %31
%52 = load i64, i64* @errno
%53 = load i64, i64* @EINPROGRESS
%54 = icmp eq i64 %52, %53
br i1 %54, label %58, label %55
55: ; preds = %51
%56 = call i32 @perror(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.4, i64 0, i64 0))
%57 = call i32 @exit(i32 15)
unreachable
58: ; preds = %51, %31
%59 = call i32 @epoll_create1(i32 0)
%60 = icmp eq i32 %59, -1
br i1 %60, label %61, label %64
61: ; preds = %58
%62 = call i32 @perror(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.5, i64 0, i64 0))
%63 = call i32 @exit(i32 1)
unreachable
64: ; preds = %58
%65 = bitcast %struct.epoll_event* %5 to i8*
%66 = getelementptr inbounds %struct.epoll_event, %struct.epoll_event* %5, i64 0, i32 1, i32 0
store i32 %20, i32* %66
%67 = load i32, i32* @EPOLLIN
%68 = load i32, i32* @EPOLLOUT
%69 = or i32 %68, %67
%70 = load i32, i32* @EPOLLET
%71 = or i32 %69, %70
%72 = load i32, i32* @EPOLLERR
%73 = or i32 %71, %72
%74 = load i32, i32* @EPOLLHUP
%75 = or i32 %73, %74
%76 = getelementptr inbounds %struct.epoll_event, %struct.epoll_event* %5, i64 0, i32 0
store i32 %75, i32* %76
%77 = load i32, i32* @EPOLL_CTL_ADD
%78 = call i32 @epoll_ctl(i32 %59, i32 %77, i32 %20, %struct.epoll_event* %5)
%79 = icmp eq i32 %78, -1
br i1 %79, label %80, label %83
80: ; preds = %64
%81 = call i32 @perror(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i64 0, i64 0))
%82 = call i32 @exit(i32 2)
unreachable
83: ; preds = %64
%84 = call i32* @SSL_new(i32* %12)
%85 = icmp eq i32* %84, null
br i1 %85, label %86, label %88
86: ; preds = %83
%87 = call i32 @exit(i32 1)
unreachable
88: ; preds = %83
%89 = call i32 @SSL_set_fd(i32* %84, i32 %20)
%90 = call i32 @SSL_set_connect_state(i32* %84)
br label %91
91: ; preds = %94, %88
%92 = call i32 @SSL_connect(i32* %84)
%93 = icmp slt i32 %92, 0
br i1 %93, label %94, label %117
94: ; preds = %91
%95 = call i32 @SSL_get_error(i32* %84, i32 %92)
%96 = load i32, i32* @SSL_ERROR_WANT_READ
%97 = icmp eq i32 %95, %96
%98 = load i32, i32* @SSL_ERROR_WANT_WRITE
%99 = icmp eq i32 %95, %98
%100 = select i1 %97, i1 true, i1 %99
%101 = load i32, i32* @SSL_ERROR_WANT_X509_LOOKUP
%102 = icmp eq i32 %95, %101
%103 = select i1 %100, i1 true, i1 %102
br i1 %103, label %91, label %104
104: ; preds = %94
%105 = load i32, i32* @SSL_ERROR_ZERO_RETURN
%106 = icmp eq i32 %95, %105
br i1 %106, label %107, label %110
107: ; preds = %104
%108 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @.str.7, i64 0, i64 0))
%109 = call i32 @exit(i32 18)
unreachable
110: ; preds = %104
%111 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.8, i64 0, i64 0), i32 %95)
%112 = call i32 @perror(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.9, i64 0, i64 0))
%113 = call i32 @SSL_free(i32* %84)
%114 = call i32 @close(i32 %20)
%115 = call i32 @close(i32 %59)
%116 = call i32 @exit(i32 16)
unreachable
117: ; preds = %91
%118 = call i32 @dump_cert_info(i32* %84, i32 0)
%119 = call %struct.epoll_event* @calloc(i32 128, i32 8)
%120 = getelementptr inbounds %struct.epoll_event, %struct.epoll_event* %119, i64 0, i32 0
br label %121
121: ; preds = %222, %117
%122 = call i32 @epoll_wait(i32 %59, %struct.epoll_event* %119, i32 128, i32 -1)
%123 = icmp slt i32 %122, 0
%124 = load i32, i32* @EINTR
%125 = icmp eq i32 %122, %124
%126 = select i1 %123, i1 %125, i1 false
br i1 %126, label %219, label %127
127: ; preds = %121
%128 = icmp sgt i32 %122, 0
br i1 %128, label %129, label %222
129: ; preds = %127
%130 = zext i32 %122 to i64
br label %131
131: ; preds = %129, %216
%132 = phi i64 [ 0, %129 ], [ %217, %216 ]
%133 = getelementptr inbounds %struct.epoll_event, %struct.epoll_event* %119, i64 %132, i32 0
%134 = load i32, i32* %133
%135 = load i32, i32* @EPOLLERR
%136 = and i32 %135, %134
%137 = icmp eq i32 %136, 0
br i1 %137, label %138, label %148
138: ; preds = %131
%139 = load i32, i32* @EPOLLHUP
%140 = and i32 %139, %134
%141 = icmp eq i32 %140, 0
br i1 %141, label %142, label %148
142: ; preds = %138
%143 = load i32, i32* @EPOLLIN
%144 = load i32, i32* @EPOLLOUT
%145 = or i32 %144, %143
%146 = and i32 %145, %134
%147 = icmp eq i32 %146, 0
br i1 %147, label %148, label %154
148: ; preds = %142, %138, %131
%149 = load i32, i32* @stderr
%150 = call i32 @fprintf(i32 %149, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.11, i64 0, i64 0))
%151 = getelementptr inbounds %struct.epoll_event, %struct.epoll_event* %119, i64 %132, i32 1, i32 0
%152 = load i32, i32* %151
%153 = call i32 @close(i32 %152)
br label %216
154: ; preds = %142
%155 = load i32, i32* %120
%156 = or i32 %143, %139
%157 = and i32 %155, %156
%158 = icmp eq i32 %157, 0
br i1 %158, label %188, label %159
159: ; preds = %154
%160 = call i32 @SSL_read(i32* %84, i8* %7, i32 4095)
%161 = icmp eq i32 %160, -1
br i1 %161, label %162, label %166
162: ; preds = %159
%163 = load i32, i32* @stderr
%164 = call i32 @ERR_print_errors_fp(i32 %163)
%165 = call i32 @exit(i32 2)
unreachable
166: ; preds = %159
%167 = sext i32 %160 to i64
%168 = getelementptr inbounds [4096 x i8], [4096 x i8]* %4, i64 0, i64 %167
store i8 0, i8* %168
%169 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.12, i64 0, i64 0), i32 %160, i8* %7)
%170 = icmp slt i32 %160, 1
br i1 %170, label %171, label %186
171: ; preds = %166
%172 = load i32, i32* @SSL_ERROR_WANT_READ
%173 = icmp eq i32 %160, %172
%174 = load i32, i32* @SSL_ERROR_WANT_WRITE
%175 = icmp eq i32 %160, %174
%176 = select i1 %173, i1 true, i1 %175
%177 = load i32, i32* @SSL_ERROR_WANT_X509_LOOKUP
%178 = icmp eq i32 %160, %177
%179 = select i1 %176, i1 true, i1 %178
br i1 %179, label %219, label %180
180: ; preds = %171
%181 = load i32, i32* @SSL_ERROR_ZERO_RETURN
%182 = icmp eq i32 %160, %181
br i1 %182, label %223, label %183
183: ; preds = %180
%184 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.15, i64 0, i64 0))
%185 = call i32 @exit(i32 17)
unreachable
186: ; preds = %166
%187 = call i32 @exit(i32 0)
unreachable
188: ; preds = %154
%189 = and i32 %155, %144
%190 = icmp eq i32 %189, 0
br i1 %190, label %216, label %191
191: ; preds = %188
%192 = call i32 @strlen(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.16, i64 0, i64 0))
%193 = call i32 @SSL_write(i32* %84, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.16, i64 0, i64 0), i32 %192)
%194 = icmp eq i32 %193, -1
br i1 %194, label %195, label %199
195: ; preds = %191
%196 = load i32, i32* @stderr
%197 = call i32 @ERR_print_errors_fp(i32 %196)
%198 = call i32 @exit(i32 2)
unreachable
199: ; preds = %191
%200 = icmp slt i32 %193, 1
br i1 %200, label %201, label %216
201: ; preds = %199
%202 = load i32, i32* @SSL_ERROR_WANT_READ
%203 = icmp eq i32 %193, %202
%204 = load i32, i32* @SSL_ERROR_WANT_WRITE
%205 = icmp eq i32 %193, %204
%206 = select i1 %203, i1 true, i1 %205
%207 = load i32, i32* @SSL_ERROR_WANT_X509_LOOKUP
%208 = icmp eq i32 %193, %207
%209 = select i1 %206, i1 true, i1 %208
br i1 %209, label %219, label %210
210: ; preds = %201
%211 = load i32, i32* @SSL_ERROR_ZERO_RETURN
%212 = icmp eq i32 %193, %211
br i1 %212, label %223, label %213
213: ; preds = %210
%214 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.19, i64 0, i64 0))
%215 = call i32 @exit(i32 17)
unreachable
216: ; preds = %188, %199, %148
%217 = add nuw nsw i64 %132, 1
%218 = icmp eq i64 %217, %130
br i1 %218, label %222, label %131
219: ; preds = %201, %171, %121
%220 = phi i8* [ getelementptr inbounds ([47 x i8], [47 x i8]* @.str.10, i64 0, i64 0), %121 ], [ getelementptr inbounds ([48 x i8], [48 x i8]* @.str.13, i64 0, i64 0), %171 ], [ getelementptr inbounds ([49 x i8], [49 x i8]* @.str.17, i64 0, i64 0), %201 ]
%221 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) %220)
br label %222
222: ; preds = %216, %219, %127
br label %121
223: ; preds = %210, %180
%224 = phi i8* [ getelementptr inbounds ([42 x i8], [42 x i8]* @.str.14, i64 0, i64 0), %180 ], [ getelementptr inbounds ([43 x i8], [43 x i8]* @.str.18, i64 0, i64 0), %210 ]
%225 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) %224)
ret i32 0
}