#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*/ SSL_CTX;
typedef int /*<<< orphan*/ SSL_CONF_CTX;
typedef int /*<<< orphan*/ BIO;

/* Variables and functions */
scalar_t__ BIO_do_accept(int /*<<< orphan*/ *);
int /*<<< orphan*/ BIO_free(int /*<<< orphan*/ *);
int /*<<< orphan*/ BIO_free_all(int /*<<< orphan*/ *);
int /*<<< orphan*/ *BIO_new_accept(char *);
int /*<<< orphan*/ *BIO_new_ssl(int /*<<< orphan*/ *, int /*<<< orphan*/);
int /*<<< orphan*/ *BIO_pop(int /*<<< orphan*/ *);
int BIO_read(int /*<<< orphan*/ *, char *, int);
int /*<<< orphan*/ BIO_set_accept_bios(int /*<<< orphan*/ *,
                                       int /*<<< orphan*/ *);
int /*<<< orphan*/ ERR_print_errors_fp(int /*<<< orphan*/);
int /*<<< orphan*/ OpenSSL_add_ssl_algorithms();
int /*<<< orphan*/ SSL_CONF_CTX_finish(int /*<<< orphan*/ *);
int /*<<< orphan*/ *SSL_CONF_CTX_new();
int /*<<< orphan*/ SSL_CONF_CTX_set_flags(int /*<<< orphan*/ *,
                                          int /*<<< orphan*/);
int /*<<< orphan*/ SSL_CONF_CTX_set_ssl_ctx(int /*<<< orphan*/ *,
                                            int /*<<< orphan*/ *);
int /*<<< orphan*/ SSL_CONF_FLAG_CERTIFICATE;
int /*<<< orphan*/ SSL_CONF_FLAG_SERVER;
int SSL_CONF_cmd_argv(int /*<<< orphan*/ *, int *, char ***);
int /*<<< orphan*/ *SSL_CTX_new(int /*<<< orphan*/);
int /*<<< orphan*/ SSL_load_error_strings();
int /*<<< orphan*/ TLS_server_method();
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ fwrite(char *, int, int, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdout;
scalar_t__ strcmp(char *, char *);
int main(int argc, char *argv[]) {
  char *port = "*:4433";
  BIO *ssl_bio, *tmp;
  SSL_CTX *ctx;
  SSL_CONF_CTX *cctx;
  char buf[512];
  BIO *in = NULL;
  int ret = 1, i;
  char **args = argv + 1;
  int nargs = argc - 1;
  SSL_load_error_strings();
  OpenSSL_add_ssl_algorithms();
  ctx = SSL_CTX_new(TLS_server_method());
  cctx = SSL_CONF_CTX_new();
  SSL_CONF_CTX_set_flags(cctx, SSL_CONF_FLAG_SERVER);
  SSL_CONF_CTX_set_flags(cctx, SSL_CONF_FLAG_CERTIFICATE);
  SSL_CONF_CTX_set_ssl_ctx(cctx, ctx);
  while (*args && **args == '-') {
    int rv;
    rv = SSL_CONF_cmd_argv(cctx, &nargs, &args);
    if (rv == -3) {
      fprintf(stderr, "Missing argument for %s\n", *args);
      goto err;
    }
    if (rv < 0) {
      fprintf(stderr, "Error in command %s\n", *args);
      ERR_print_errors_fp(stderr);
      goto err;
    }
    if (rv > 0)
      continue;
    if (strcmp(*args, "-port") == 0) {
      port = args[1];
      if (port == NULL) {
        fprintf(stderr, "Missing -port argument\n");
        goto err;
      }
      args += 2;
      nargs -= 2;
      continue;
    } else {
      fprintf(stderr, "Unknown argument %s\n", *args);
      goto err;
    }
  }
  if (!SSL_CONF_CTX_finish(cctx)) {
    fprintf(stderr, "Finish error\n");
    ERR_print_errors_fp(stderr);
    goto err;
  }
  ssl_bio = BIO_new_ssl(ctx, 0);
  if ((in = BIO_new_accept(port)) == NULL)
    goto err;
  BIO_set_accept_bios(in, ssl_bio);
again:
  if (BIO_do_accept(in) <= 0)
    goto err;
  for (;;) {
    i = BIO_read(in, buf, 512);
    if (i == 0) {
      printf("Done\n");
      tmp = BIO_pop(in);
      BIO_free_all(tmp);
      goto again;
    }
    if (i < 0)
      goto err;
    fwrite(buf, 1, i, stdout);
    fflush(stdout);
  }
  ret = 0;
err:
  if (ret) {
    ERR_print_errors_fp(stderr);
  }
  BIO_free(in);
  exit(ret);
  return (!ret);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x270,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xd60(%rip),%rax
mov    %rax,-0x18(%rbp)
movq   $0x0,-0x248(%rbp)
movl   $0x1,-0x24c(%rbp)
mov    -0x10(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x258(%rbp)
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x25c(%rbp)
mov    $0x0,%al
call   1150 <SSL_load_error_strings@plt>
mov    $0x0,%al
call   1170 <OpenSSL_add_ssl_algorithms@plt>
mov    $0x0,%al
call   1030 <TLS_server_method@plt>
mov    %eax,%edi
call   10f0 <SSL_CTX_new@plt>
mov    %rax,-0x30(%rbp)
mov    $0x0,%al
call   1120 <SSL_CONF_CTX_new@plt>
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rdi
mov    0x2cd6(%rip),%rax
mov    (%rax),%esi
call   1080 <SSL_CONF_CTX_set_flags@plt>
mov    -0x38(%rbp),%rdi
mov    0x2cb4(%rip),%rax
mov    (%rax),%esi
call   1080 <SSL_CONF_CTX_set_flags@plt>
mov    -0x38(%rbp),%rdi
mov    -0x30(%rbp),%rsi
call   1130 <SSL_CONF_CTX_set_ssl_ctx@plt>
mov    -0x258(%rbp),%rcx
xor    %eax,%eax
cmpq   $0x0,(%rcx)
mov    %al,-0x261(%rbp)
je     1362 <main+0xe2>
mov    -0x258(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%eax
cmp    $0x2d,%eax
sete   %al
mov    %al,-0x261(%rbp)
mov    -0x261(%rbp),%al
test   $0x1,%al
jne    1375 <main+0xf5>
jmp    14ba <main+0x23a>
mov    -0x38(%rbp),%rdi
lea    -0x25c(%rbp),%rsi
lea    -0x258(%rbp),%rdx
call   10e0 <SSL_CONF_cmd_argv@plt>
mov    %eax,-0x260(%rbp)
cmpl   $0xfffffffd,-0x260(%rbp)
jne    13c5 <main+0x145>
mov    0x2c32(%rip),%rax
mov    (%rax),%edi
mov    -0x258(%rbp),%rax
mov    (%rax),%rdx
lea    0xc4e(%rip),%rsi
mov    $0x0,%al
call   10d0 <fprintf@plt>
jmp    15ee <main+0x36e>
cmpl   $0x0,-0x260(%rbp)
jge    1406 <main+0x186>
mov    0x2bff(%rip),%rax
mov    (%rax),%edi
mov    -0x258(%rbp),%rax
mov    (%rax),%rdx
lea    0xc34(%rip),%rsi
mov    $0x0,%al
call   10d0 <fprintf@plt>
mov    0x2bde(%rip),%rax
mov    (%rax),%edi
call   11a0 <ERR_print_errors_fp@plt>
jmp    15ee <main+0x36e>
cmpl   $0x0,-0x260(%rbp)
jle    1418 <main+0x198>
jmp    1330 <main+0xb0>
mov    -0x258(%rbp),%rax
mov    (%rax),%rdi
lea    0xc0c(%rip),%rsi
call   10b0 <strcmp@plt>
cmp    $0x0,%rax
jne    1494 <main+0x214>
mov    -0x258(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    146e <main+0x1ee>
mov    0x2b7f(%rip),%rax
mov    (%rax),%edi
lea    0xbd9(%rip),%rsi
mov    $0x0,%al
call   10d0 <fprintf@plt>
jmp    15ee <main+0x36e>
mov    -0x258(%rbp),%rax
add    $0x10,%rax
mov    %rax,-0x258(%rbp)
mov    -0x25c(%rbp),%eax
sub    $0x2,%eax
mov    %eax,-0x25c(%rbp)
jmp    1330 <main+0xb0>
mov    0x2b3d(%rip),%rax
mov    (%rax),%edi
mov    -0x258(%rbp),%rax
mov    (%rax),%rdx
lea    0xba5(%rip),%rsi
mov    $0x0,%al
call   10d0 <fprintf@plt>
jmp    15ee <main+0x36e>
mov    -0x38(%rbp),%rdi
call   1040 <SSL_CONF_CTX_finish@plt>
cmp    $0x0,%eax
jne    14f6 <main+0x276>
mov    0x2b05(%rip),%rax
mov    (%rax),%edi
lea    0xb8c(%rip),%rsi
mov    $0x0,%al
call   10d0 <fprintf@plt>
mov    0x2aee(%rip),%rax
mov    (%rax),%edi
call   11a0 <ERR_print_errors_fp@plt>
jmp    15ee <main+0x36e>
mov    -0x30(%rbp),%rdi
xor    %esi,%esi
call   10a0 <BIO_new_ssl@plt>
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   1050 <BIO_new_accept@plt>
mov    %rax,-0x248(%rbp)
cmp    $0x0,%rax
jne    1524 <main+0x2a4>
jmp    15ee <main+0x36e>
mov    -0x248(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1060 <BIO_set_accept_bios@plt>
mov    -0x248(%rbp),%rdi
call   1140 <BIO_do_accept@plt>
cmp    $0x0,%rax
jg     154f <main+0x2cf>
jmp    15ee <main+0x36e>
jmp    1554 <main+0x2d4>
mov    -0x248(%rbp),%rdi
lea    -0x240(%rbp),%rsi
mov    $0x200,%edx
call   1070 <BIO_read@plt>
mov    %eax,-0x250(%rbp)
cmpl   $0x0,-0x250(%rbp)
jne    15a9 <main+0x329>
lea    0xaf0(%rip),%rdi
call   1090 <printf@plt>
mov    -0x248(%rbp),%rdi
call   10c0 <BIO_pop@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
call   1160 <BIO_free_all@plt>
jmp    1534 <main+0x2b4>
cmpl   $0x0,-0x250(%rbp)
jge    15bb <main+0x33b>
jmp    15ee <main+0x36e>
lea    -0x240(%rbp),%rdi
mov    -0x250(%rbp),%edx
mov    0x29f9(%rip),%rax
mov    (%rax),%ecx
mov    $0x1,%esi
call   1190 <fwrite@plt>
mov    0x29e6(%rip),%rax
mov    (%rax),%edi
call   1100 <fflush@plt>
jmp    1554 <main+0x2d4>
cmpl   $0x0,-0x24c(%rbp)
je     1609 <main+0x389>
mov    0x29d6(%rip),%rax
mov    (%rax),%edi
call   11a0 <ERR_print_errors_fp@plt>
mov    -0x248(%rbp),%rdi
call   1110 <BIO_free@plt>
mov    -0x24c(%rbp),%edi
call   1180 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x218,%rsp
mov    %rsi,%rbx
lea    0x8(%rsi),%rax
mov    %rax,(%rsp)
add    $0xffffffff,%edi
mov    %edi,0xc(%rsp)
xor    %eax,%eax
call   1150 <SSL_load_error_strings@plt>
xor    %eax,%eax
call   1170 <OpenSSL_add_ssl_algorithms@plt>
xor    %eax,%eax
call   1030 <TLS_server_method@plt>
mov    %eax,%edi
call   10f0 <SSL_CTX_new@plt>
mov    %rax,%r14
xor    %eax,%eax
call   1120 <SSL_CONF_CTX_new@plt>
mov    %rax,%r15
mov    0x2d0d(%rip),%rax
mov    (%rax),%esi
mov    %r15,%rdi
call   1090 <SSL_CONF_CTX_set_flags@plt>
mov    0x2cec(%rip),%rax
mov    (%rax),%esi
mov    %r15,%rdi
call   1090 <SSL_CONF_CTX_set_flags@plt>
mov    %r15,%rdi
mov    %r14,%rsi
call   1130 <SSL_CONF_CTX_set_ssl_ctx@plt>
mov    0x8(%rbx),%rax
lea    0xcfc(%rip),%rbx
test   %rax,%rax
jne    1338 <main+0xb8>
mov    %r15,%rdi
call   1040 <SSL_CONF_CTX_finish@plt>
test   %eax,%eax
jne    13b6 <main+0x136>
mov    0x2cb8(%rip),%rbx
mov    (%rbx),%edi
lea    0xd3f(%rip),%rsi
xor    %r14d,%r14d
xor    %eax,%eax
call   10d0 <fprintf@plt>
jmp    14b2 <main+0x232>
lea    0xc(%rsp),%r12
mov    %rsp,%r13
lea    0xcee(%rip),%rbp
jmp    1358 <main+0xd8>
nopl   0x0(%rax)
mov    (%rax),%rax
test   %rax,%rax
je     1309 <main+0x89>
cmpb   $0x2d,(%rax)
jne    1309 <main+0x89>
mov    %r15,%rdi
mov    %r12,%rsi
mov    %r13,%rdx
call   10e0 <SSL_CONF_cmd_argv@plt>
cmp    $0xfffffffd,%eax
je     1478 <main+0x1f8>
test   %eax,%eax
js     1491 <main+0x211>
mov    (%rsp),%rax
jne    1350 <main+0xd0>
mov    (%rax),%rdi
mov    %rbp,%rsi
call   10b0 <strcmp@plt>
test   %rax,%rax
jne    14bb <main+0x23b>
mov    (%rsp),%rax
mov    0x8(%rax),%rbx
test   %rbx,%rbx
je     14de <main+0x25e>
add    $0x10,%rax
mov    %rax,(%rsp)
addl   $0xfffffffe,0xc(%rsp)
jmp    1350 <main+0xd0>
mov    %r14,%rdi
xor    %esi,%esi
call   10a0 <BIO_new_ssl@plt>
mov    %rax,%rbp
mov    %rbx,%rdi
call   1060 <BIO_new_accept@plt>
test   %rax,%rax
jne    13d8 <main+0x158>
xor    %r14d,%r14d
jmp    14f8 <main+0x278>
mov    %rax,%r14
mov    %rax,%rdi
mov    %rbp,%rsi
call   1070 <BIO_set_accept_bios@plt>
mov    %r14,%rdi
call   1140 <BIO_do_accept@plt>
test   %rax,%rax
jle    14f8 <main+0x278>
lea    0x10(%rsp),%rbx
lea    0xc73(%rip),%r15
mov    0x2bbe(%rip),%rbp
jmp    1440 <main+0x1c0>
mov    %r15,%rdi
call   1050 <puts@plt>
mov    %r14,%rdi
call   10c0 <BIO_pop@plt>
mov    %rax,%rdi
call   1160 <BIO_free_all@plt>
mov    %r14,%rdi
call   1140 <BIO_do_accept@plt>
test   %rax,%rax
jle    14f8 <main+0x278>
cs nopw 0x0(%rax,%rax,1)
nop
mov    %r14,%rdi
mov    %rbx,%rsi
mov    $0x200,%edx
call   1080 <BIO_read@plt>
test   %eax,%eax
je     140c <main+0x18c>
test   %eax,%eax
js     14f8 <main+0x278>
mov    0x0(%rbp),%ecx
mov    %rbx,%rdi
mov    $0x1,%esi
mov    %eax,%edx
call   1190 <fwrite@plt>
mov    0x0(%rbp),%edi
call   1100 <fflush@plt>
jmp    1440 <main+0x1c0>
mov    0x2b59(%rip),%rax
mov    (%rax),%edi
mov    (%rsp),%rax
mov    (%rax),%rdx
lea    0xb78(%rip),%rsi
jmp    14d2 <main+0x252>
mov    0x2b40(%rip),%rbx
mov    (%rbx),%edi
mov    (%rsp),%rax
mov    (%rax),%rdx
lea    0xb78(%rip),%rsi
xor    %r14d,%r14d
xor    %eax,%eax
call   10d0 <fprintf@plt>
mov    (%rbx),%edi
call   11a0 <ERR_print_errors_fp@plt>
jmp    14f8 <main+0x278>
mov    0x2b16(%rip),%rax
mov    (%rax),%edi
mov    (%rsp),%rax
mov    (%rax),%rdx
lea    0xb81(%rip),%rsi
xor    %r14d,%r14d
xor    %eax,%eax
call   10d0 <fprintf@plt>
jmp    14f8 <main+0x278>
mov    0x2af3(%rip),%rax
mov    (%rax),%edi
lea    0xb4d(%rip),%rsi
xor    %r14d,%r14d
xor    %eax,%eax
call   10d0 <fprintf@plt>
mov    0x2ad9(%rip),%rax
mov    (%rax),%edi
call   11a0 <ERR_print_errors_fp@plt>
mov    %r14,%rdi
call   1110 <BIO_free@plt>
mov    $0x1,%edi
call   1180 <exit@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"*:4433\00"
@SSL_CONF_FLAG_SERVER = global i32 0
@SSL_CONF_FLAG_CERTIFICATE = global i32 0
@stderr = global i32 0
@.str.1 = [25 x i8] c"Missing argument for %s\0A\00"
@.str.2 = [21 x i8] c"Error in command %s\0A\00"
@.str.3 = [6 x i8] c"-port\00"
@.str.4 = [24 x i8] c"Missing -port argument\0A\00"
@.str.5 = [21 x i8] c"Unknown argument %s\0A\00"
@.str.6 = [14 x i8] c"Finish error\0A\00"
@.str.7 = [6 x i8] c"Done\0A\00"
@stdout = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca i32*
%10 = alloca i32*
%11 = alloca [512 x i8]
%12 = alloca i32*
%13 = alloca i32
%14 = alloca i32
%15 = alloca i8**
%16 = alloca i32
%17 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8** %6
store i32* null, i32** %12
store i32 1, i32* %13
%18 = load i8**, i8*** %5
%19 = getelementptr inbounds i8*, i8** %18, i64 1
store i8** %19, i8*** %15
%20 = load i32, i32* %4
%21 = sub nsw i32 %20, 1
store i32 %21, i32* %16
%22 = call i32 (...) @SSL_load_error_strings()
%23 = call i32 (...) @OpenSSL_add_ssl_algorithms()
%24 = call i32 (...) @TLS_server_method()
%25 = call i32* @SSL_CTX_new(i32 %24)
store i32* %25, i32** %9
%26 = call i32* (...) @SSL_CONF_CTX_new()
store i32* %26, i32** %10
%27 = load i32*, i32** %10
%28 = load i32, i32* @SSL_CONF_FLAG_SERVER
%29 = call i32 @SSL_CONF_CTX_set_flags(i32* %27, i32 %28)
%30 = load i32*, i32** %10
%31 = load i32, i32* @SSL_CONF_FLAG_CERTIFICATE
%32 = call i32 @SSL_CONF_CTX_set_flags(i32* %30, i32 %31)
%33 = load i32*, i32** %10
%34 = load i32*, i32** %9
%35 = call i32 @SSL_CONF_CTX_set_ssl_ctx(i32* %33, i32* %34)
br label %36
36: ; preds = %86, %71, %2
%37 = load i8**, i8*** %15
%38 = load i8*, i8** %37
%39 = icmp ne i8* %38, null
br i1 %39, label %40, label %46
40: ; preds = %36
%41 = load i8**, i8*** %15
%42 = load i8*, i8** %41
%43 = load i8, i8* %42
%44 = sext i8 %43 to i32
%45 = icmp eq i32 %44, 45
br label %46
46: ; preds = %40, %36
%47 = phi i1 [ false, %36 ], [ %45, %40 ]
br i1 %47, label %48, label %96
48: ; preds = %46
%49 = load i32*, i32** %10
%50 = call i32 @SSL_CONF_cmd_argv(i32* %49, i32* %16, i8*** %15)
store i32 %50, i32* %17
%51 = load i32, i32* %17
%52 = icmp eq i32 %51, -3
br i1 %52, label %53, label %58
53: ; preds = %48
%54 = load i32, i32* @stderr
%55 = load i8**, i8*** %15
%56 = load i8*, i8** %55
%57 = call i32 (i32, i8*, ...) @fprintf(i32 %54, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i8* %56)
br label %145
58: ; preds = %48
%59 = load i32, i32* %17
%60 = icmp slt i32 %59, 0
br i1 %60, label %61, label %68
61: ; preds = %58
%62 = load i32, i32* @stderr
%63 = load i8**, i8*** %15
%64 = load i8*, i8** %63
%65 = call i32 (i32, i8*, ...) @fprintf(i32 %62, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0), i8* %64)
%66 = load i32, i32* @stderr
%67 = call i32 @ERR_print_errors_fp(i32 %66)
br label %145
68: ; preds = %58
%69 = load i32, i32* %17
%70 = icmp sgt i32 %69, 0
br i1 %70, label %71, label %72
71: ; preds = %68
br label %36
72: ; preds = %68
%73 = load i8**, i8*** %15
%74 = load i8*, i8** %73
%75 = call i64 @strcmp(i8* %74, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
%76 = icmp eq i64 %75, 0
br i1 %76, label %77, label %91
77: ; preds = %72
%78 = load i8**, i8*** %15
%79 = getelementptr inbounds i8*, i8** %78, i64 1
%80 = load i8*, i8** %79
store i8* %80, i8** %6
%81 = load i8*, i8** %6
%82 = icmp eq i8* %81, null
br i1 %82, label %83, label %86
83: ; preds = %77
%84 = load i32, i32* @stderr
%85 = call i32 (i32, i8*, ...) @fprintf(i32 %84, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.4, i64 0, i64 0))
br label %145
86: ; preds = %77
%87 = load i8**, i8*** %15
%88 = getelementptr inbounds i8*, i8** %87, i64 2
store i8** %88, i8*** %15
%89 = load i32, i32* %16
%90 = sub nsw i32 %89, 2
store i32 %90, i32* %16
br label %36
91: ; preds = %72
%92 = load i32, i32* @stderr
%93 = load i8**, i8*** %15
%94 = load i8*, i8** %93
%95 = call i32 (i32, i8*, ...) @fprintf(i32 %92, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.5, i64 0, i64 0), i8* %94)
br label %145
96: ; preds = %46
%97 = load i32*, i32** %10
%98 = call i32 @SSL_CONF_CTX_finish(i32* %97)
%99 = icmp ne i32 %98, 0
br i1 %99, label %105, label %100
100: ; preds = %96
%101 = load i32, i32* @stderr
%102 = call i32 (i32, i8*, ...) @fprintf(i32 %101, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.6, i64 0, i64 0))
%103 = load i32, i32* @stderr
%104 = call i32 @ERR_print_errors_fp(i32 %103)
br label %145
105: ; preds = %96
%106 = load i32*, i32** %9
%107 = call i32* @BIO_new_ssl(i32* %106, i32 0)
store i32* %107, i32** %7
%108 = load i8*, i8** %6
%109 = call i32* @BIO_new_accept(i8* %108)
store i32* %109, i32** %12
%110 = icmp eq i32* %109, null
br i1 %110, label %111, label %112
111: ; preds = %105
br label %145
112: ; preds = %105
%113 = load i32*, i32** %12
%114 = load i32*, i32** %7
%115 = call i32 @BIO_set_accept_bios(i32* %113, i32* %114)
br label %116
116: ; preds = %128, %112
%117 = load i32*, i32** %12
%118 = call i64 @BIO_do_accept(i32* %117)
%119 = icmp sle i64 %118, 0
br i1 %119, label %120, label %121
120: ; preds = %116
br label %145
121: ; preds = %116
br label %122
122: ; preds = %138, %121
%123 = load i32*, i32** %12
%124 = getelementptr inbounds [512 x i8], [512 x i8]* %11, i64 0, i64 0
%125 = call i32 @BIO_read(i32* %123, i8* %124, i32 512)
store i32 %125, i32* %14
%126 = load i32, i32* %14
%127 = icmp eq i32 %126, 0
br i1 %127, label %128, label %134
128: ; preds = %122
%129 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0))
%130 = load i32*, i32** %12
%131 = call i32* @BIO_pop(i32* %130)
store i32* %131, i32** %8
%132 = load i32*, i32** %8
%133 = call i32 @BIO_free_all(i32* %132)
br label %116
134: ; preds = %122
%135 = load i32, i32* %14
%136 = icmp slt i32 %135, 0
br i1 %136, label %137, label %138
137: ; preds = %134
br label %145
138: ; preds = %134
%139 = getelementptr inbounds [512 x i8], [512 x i8]* %11, i64 0, i64 0
%140 = load i32, i32* %14
%141 = load i32, i32* @stdout
%142 = call i32 @fwrite(i8* %139, i32 1, i32 %140, i32 %141)
%143 = load i32, i32* @stdout
%144 = call i32 @fflush(i32 %143)
br label %122
145: ; preds = %137, %120, %111, %100, %91, %83, %61, %53
%146 = load i32, i32* %13
%147 = icmp ne i32 %146, 0
br i1 %147, label %148, label %151
148: ; preds = %145
%149 = load i32, i32* @stderr
%150 = call i32 @ERR_print_errors_fp(i32 %149)
br label %151
151: ; preds = %148, %145
%152 = load i32*, i32** %12
%153 = call i32 @BIO_free(i32* %152)
%154 = load i32, i32* %13
%155 = call i32 @exit(i32 %154)
unreachable
}

LLVM IR (-O2):
@.str = [7 x i8] c"*:4433\00"
@SSL_CONF_FLAG_SERVER = global i32 0
@SSL_CONF_FLAG_CERTIFICATE = global i32 0
@stderr = global i32 0
@.str.1 = [25 x i8] c"Missing argument for %s\0A\00"
@.str.2 = [21 x i8] c"Error in command %s\0A\00"
@.str.3 = [6 x i8] c"-port\00"
@.str.4 = [24 x i8] c"Missing -port argument\0A\00"
@.str.5 = [21 x i8] c"Unknown argument %s\0A\00"
@.str.6 = [14 x i8] c"Finish error\0A\00"
@stdout = global i32 0
@str = [5 x i8] c"Done\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca [512 x i8]
%4 = alloca i8**
%5 = alloca i32
%6 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 0
%7 = bitcast i8*** %4 to i8*
%8 = getelementptr inbounds i8*, i8** %1, i64 1
store i8** %8, i8*** %4
%9 = bitcast i32* %5 to i8*
%10 = add nsw i32 %0, -1
store i32 %10, i32* %5
%11 = tail call i32 (...) @SSL_load_error_strings()
%12 = tail call i32 (...) @OpenSSL_add_ssl_algorithms()
%13 = tail call i32 (...) @TLS_server_method()
%14 = tail call i32* @SSL_CTX_new(i32 %13)
%15 = tail call i32* (...) @SSL_CONF_CTX_new()
%16 = load i32, i32* @SSL_CONF_FLAG_SERVER
%17 = tail call i32 @SSL_CONF_CTX_set_flags(i32* %15, i32 %16)
%18 = load i32, i32* @SSL_CONF_FLAG_CERTIFICATE
%19 = tail call i32 @SSL_CONF_CTX_set_flags(i32* %15, i32 %18)
%20 = tail call i32 @SSL_CONF_CTX_set_ssl_ctx(i32* %15, i32* %14)
%21 = load i8*, i8** %8
%22 = icmp eq i8* %21, null
br i1 %22, label %74, label %23
23: ; preds = %2, %69
%24 = phi i8* [ %72, %69 ], [ %21, %2 ]
%25 = phi i8* [ %71, %69 ], [ getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), %2 ]
%26 = load i8, i8* %24
%27 = icmp eq i8 %26, 45
br i1 %27, label %28, label %74
28: ; preds = %23
%29 = call i32 @SSL_CONF_cmd_argv(i32* %15, i32* %5, i8*** %4)
%30 = icmp eq i32 %29, -3
br i1 %30, label %31, label %36
31: ; preds = %28
%32 = load i32, i32* @stderr
%33 = load i8**, i8*** %4
%34 = load i8*, i8** %33
%35 = call i32 (i32, i8*, ...) @fprintf(i32 %32, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i8* %34)
br label %110
36: ; preds = %28
%37 = icmp slt i32 %29, 0
br i1 %37, label %38, label %45
38: ; preds = %36
%39 = load i32, i32* @stderr
%40 = load i8**, i8*** %4
%41 = load i8*, i8** %40
%42 = call i32 (i32, i8*, ...) @fprintf(i32 %39, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0), i8* %41)
%43 = load i32, i32* @stderr
%44 = call i32 @ERR_print_errors_fp(i32 %43)
br label %110
45: ; preds = %36
%46 = icmp eq i32 %29, 0
%47 = load i8**, i8*** %4
br i1 %46, label %48, label %69
48: ; preds = %45
%49 = load i8*, i8** %47
%50 = call i64 @strcmp(i8* %49, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
%51 = icmp eq i64 %50, 0
br i1 %51, label %52, label %64
52: ; preds = %48
%53 = load i8**, i8*** %4
%54 = getelementptr inbounds i8*, i8** %53, i64 1
%55 = load i8*, i8** %54
%56 = icmp eq i8* %55, null
br i1 %56, label %57, label %60
57: ; preds = %52
%58 = load i32, i32* @stderr
%59 = call i32 (i32, i8*, ...) @fprintf(i32 %58, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.4, i64 0, i64 0))
br label %110
60: ; preds = %52
%61 = getelementptr inbounds i8*, i8** %53, i64 2
store i8** %61, i8*** %4
%62 = load i32, i32* %5
%63 = add nsw i32 %62, -2
store i32 %63, i32* %5
br label %69
64: ; preds = %48
%65 = load i32, i32* @stderr
%66 = load i8**, i8*** %4
%67 = load i8*, i8** %66
%68 = call i32 (i32, i8*, ...) @fprintf(i32 %65, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.5, i64 0, i64 0), i8* %67)
br label %110
69: ; preds = %45, %60
%70 = phi i8** [ %61, %60 ], [ %47, %45 ]
%71 = phi i8* [ %55, %60 ], [ %25, %45 ]
%72 = load i8*, i8** %70
%73 = icmp eq i8* %72, null
br i1 %73, label %74, label %23
74: ; preds = %23, %69, %2
%75 = phi i8* [ getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), %2 ], [ %71, %69 ], [ %25, %23 ]
%76 = call i32 @SSL_CONF_CTX_finish(i32* %15)
%77 = icmp eq i32 %76, 0
br i1 %77, label %78, label %83
78: ; preds = %74
%79 = load i32, i32* @stderr
%80 = call i32 (i32, i8*, ...) @fprintf(i32 %79, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.6, i64 0, i64 0))
%81 = load i32, i32* @stderr
%82 = call i32 @ERR_print_errors_fp(i32 %81)
br label %110
83: ; preds = %74
%84 = call i32* @BIO_new_ssl(i32* %14, i32 0)
%85 = call i32* @BIO_new_accept(i8* %75)
%86 = icmp eq i32* %85, null
br i1 %86, label %110, label %87
87: ; preds = %83
%88 = call i32 @BIO_set_accept_bios(i32* %85, i32* %84)
%89 = call i64 @BIO_do_accept(i32* %85)
%90 = icmp slt i64 %89, 1
br i1 %90, label %110, label %91
91: ; preds = %87, %94
%92 = call i32 @BIO_read(i32* %85, i8* %6, i32 512)
%93 = icmp eq i32 %92, 0
br i1 %93, label %94, label %100
94: ; preds = %103, %91
%95 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
%96 = call i32* @BIO_pop(i32* %85)
%97 = call i32 @BIO_free_all(i32* %96)
%98 = call i64 @BIO_do_accept(i32* %85)
%99 = icmp slt i64 %98, 1
br i1 %99, label %110, label %91
100: ; preds = %91, %103
%101 = phi i32 [ %108, %103 ], [ %92, %91 ]
%102 = icmp slt i32 %101, 0
br i1 %102, label %110, label %103
103: ; preds = %100
%104 = load i32, i32* @stdout
%105 = call i32 @fwrite(i8* %6, i32 1, i32 %101, i32 %104)
%106 = load i32, i32* @stdout
%107 = call i32 @fflush(i32 %106)
%108 = call i32 @BIO_read(i32* %85, i8* %6, i32 512)
%109 = icmp eq i32 %108, 0
br i1 %109, label %94, label %100
110: ; preds = %94, %100, %87, %64, %57, %38, %31, %78, %83
%111 = phi i32* [ null, %83 ], [ null, %78 ], [ null, %31 ], [ null, %38 ], [ null, %57 ], [ null, %64 ], [ %85, %87 ], [ %85, %100 ], [ %85, %94 ]
%112 = load i32, i32* @stderr
%113 = call i32 @ERR_print_errors_fp(i32 %112)
%114 = call i32 @BIO_free(i32* %111)
%115 = call i32 @exit(i32 1)
unreachable
}