#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 */

/* Variables and functions */
int EXIT_FAILURE;
int EXIT_SUCCESS;
int /*<<< orphan*/ SSL_library_init();
int /*<<< orphan*/ do_test(char const *, char const *, char const *,
                           char const *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int getopt(int, char **, char *);
char *optarg;
int /*<<< orphan*/ stderr;
int main(int argc, char **argv) {
  int opt;
  const char *cipher = NULL;
  const char *server_cert_file = "server.pem", *server_key_file = "server.key";
  const char *client_ca_file = NULL;
  while ((opt = getopt(argc, argv, "a:C:c:k:")) != -1) {
    switch (opt) {
    case 'a':
      client_ca_file = optarg;
      break;
    case 'C':
      cipher = optarg;
      break;
    case 'c':
      server_cert_file = optarg;
      break;
    case 'k':
      server_key_file = optarg;
      break;
    }
  }
  SSL_library_init();
  if (!do_test(server_cert_file, server_key_file, client_ca_file, cipher)) {
    fprintf(stderr, "sv-test failure\n");
    return EXIT_FAILURE;
  }
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x20(%rbp)
lea    0xe9b(%rip),%rax
mov    %rax,-0x28(%rbp)
lea    0xe9b(%rip),%rax
mov    %rax,-0x30(%rbp)
movq   $0x0,-0x38(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    0xe8c(%rip),%rdx
call   1060 <getopt@plt>
mov    %eax,-0x14(%rbp)
cmp    $0xffffffff,%eax
je     122e <main+0xee>
mov    -0x14(%rbp),%eax
mov    %eax,-0x3c(%rbp)
sub    $0x43,%eax
je     11f5 <main+0xb5>
jmp    11af <main+0x6f>
mov    -0x3c(%rbp),%eax
sub    $0x61,%eax
je     11e2 <main+0xa2>
jmp    11c0 <main+0x80>
mov    -0x3c(%rbp),%eax
sub    $0x63,%eax
je     1208 <main+0xc8>
jmp    11d1 <main+0x91>
mov    -0x3c(%rbp),%eax
sub    $0x6b,%eax
je     121b <main+0xdb>
jmp    1229 <main+0xe9>
mov    0x2e0f(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x38(%rbp)
jmp    1229 <main+0xe9>
mov    0x2dfc(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
jmp    1229 <main+0xe9>
mov    0x2de9(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x28(%rbp)
jmp    1229 <main+0xe9>
mov    0x2dd6(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x30(%rbp)
jmp    117c <main+0x3c>
mov    $0x0,%al
call   1030 <SSL_library_init@plt>
mov    -0x28(%rbp),%rdi
mov    -0x30(%rbp),%rsi
mov    -0x38(%rbp),%rdx
mov    -0x20(%rbp),%rcx
call   1050 <do_test@plt>
cmp    $0x0,%eax
jne    1279 <main+0x139>
mov    0x2d7e(%rip),%rax
mov    (%rax),%edi
lea    0xdbc(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x2d61(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1285 <main+0x145>
mov    0x2d48(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
lea    0xeb4(%rip),%r15
lea    0xea2(%rip),%r12
xor    %eax,%eax
mov    %rax,(%rsp)
lea    0xeab(%rip),%r14
xor    %r13d,%r13d
xchg   %ax,%ax
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1060 <getopt@plt>
cmp    $0x60,%eax
jle    11a0 <main+0x60>
cmp    $0x6b,%eax
je     11ba <main+0x7a>
cmp    $0x63,%eax
je     11c6 <main+0x86>
cmp    $0x61,%eax
jne    1170 <main+0x30>
mov    0x2e60(%rip),%rax
mov    (%rax),%r13
jmp    1170 <main+0x30>
nopl   (%rax)
cmp    $0xffffffff,%eax
je     11d2 <main+0x92>
cmp    $0x43,%eax
jne    1170 <main+0x30>
mov    0x2e47(%rip),%rax
mov    (%rax),%rax
mov    %rax,(%rsp)
jmp    1170 <main+0x30>
mov    0x2e37(%rip),%rax
mov    (%rax),%r15
jmp    1170 <main+0x30>
mov    0x2e2b(%rip),%rax
mov    (%rax),%r12
jmp    1170 <main+0x30>
xor    %eax,%eax
call   1030 <SSL_library_init@plt>
mov    %r12,%rdi
mov    %r15,%rsi
mov    %r13,%rdx
mov    (%rsp),%rcx
call   1050 <do_test@plt>
test   %eax,%eax
je     11f8 <main+0xb8>
mov    0x2dd2(%rip),%rax
jmp    1214 <main+0xd4>
mov    0x2dd9(%rip),%rax
mov    (%rax),%edi
lea    0xe17(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x2dbc(%rip),%rax
mov    (%rax),%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [11 x i8] c"server.pem\00"
@.str.1 = [11 x i8] c"server.key\00"
@.str.2 = [9 x i8] c"a:C:c:k:\00"
@optarg = global i8* null
@stderr = global i32 0
@.str.3 = [17 x i8] c"sv-test failure\0A\00"
@EXIT_FAILURE = global i32 0
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8* null, i8** %7
store i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8** %8
store i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8** %9
store i8* null, i8** %10
br label %11
11: ; preds = %26, %2
%12 = load i32, i32* %4
%13 = load i8**, i8*** %5
%14 = call i32 @getopt(i32 %12, i8** %13, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
store i32 %14, i32* %6
%15 = icmp ne i32 %14, -1
br i1 %15, label %16, label %27
16: ; preds = %11
%17 = load i32, i32* %6
switch i32 %17, label %26 [
i32 97, label %18
i32 67, label %20
i32 99, label %22
i32 107, label %24
]
18: ; preds = %16
%19 = load i8*, i8** @optarg
store i8* %19, i8** %10
br label %26
20: ; preds = %16
%21 = load i8*, i8** @optarg
store i8* %21, i8** %7
br label %26
22: ; preds = %16
%23 = load i8*, i8** @optarg
store i8* %23, i8** %8
br label %26
24: ; preds = %16
%25 = load i8*, i8** @optarg
store i8* %25, i8** %9
br label %26
26: ; preds = %16, %24, %22, %20, %18
br label %11
27: ; preds = %11
%28 = call i32 (...) @SSL_library_init()
%29 = load i8*, i8** %8
%30 = load i8*, i8** %9
%31 = load i8*, i8** %10
%32 = load i8*, i8** %7
%33 = call i32 @do_test(i8* %29, i8* %30, i8* %31, i8* %32)
%34 = icmp ne i32 %33, 0
br i1 %34, label %39, label %35
35: ; preds = %27
%36 = load i32, i32* @stderr
%37 = call i32 @fprintf(i32 %36, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0))
%38 = load i32, i32* @EXIT_FAILURE
store i32 %38, i32* %3
br label %41
39: ; preds = %27
%40 = load i32, i32* @EXIT_SUCCESS
store i32 %40, i32* %3
br label %41
41: ; preds = %39, %35
%42 = load i32, i32* %3
ret i32 %42
}

LLVM IR (-O2):
@.str = [11 x i8] c"server.pem\00"
@.str.1 = [11 x i8] c"server.key\00"
@.str.2 = [9 x i8] c"a:C:c:k:\00"
@optarg = global i8* null
@stderr = global i32 0
@.str.3 = [17 x i8] c"sv-test failure\0A\00"
@EXIT_FAILURE = global i32 0
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
br label %3
3: ; preds = %21, %2
%4 = phi i8* [ %22, %21 ], [ null, %2 ]
%5 = phi i8* [ %9, %21 ], [ getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), %2 ]
%6 = phi i8* [ %13, %21 ], [ getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), %2 ]
%7 = phi i8* [ %16, %21 ], [ null, %2 ]
br label %8
8: ; preds = %3, %23
%9 = phi i8* [ %5, %3 ], [ %24, %23 ]
%10 = phi i8* [ %6, %3 ], [ %13, %23 ]
%11 = phi i8* [ %7, %3 ], [ %16, %23 ]
br label %12
12: ; preds = %8, %25
%13 = phi i8* [ %10, %8 ], [ %26, %25 ]
%14 = phi i8* [ %11, %8 ], [ %16, %25 ]
br label %15
15: ; preds = %12, %19
%16 = phi i8* [ %14, %12 ], [ %20, %19 ]
br label %17
17: ; preds = %15, %17
%18 = tail call i32 @getopt(i32 %0, i8** %1, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
switch i32 %18, label %17 [
i32 -1, label %27
i32 97, label %19
i32 67, label %21
i32 99, label %23
i32 107, label %25
]
19: ; preds = %17
%20 = load i8*, i8** @optarg
br label %15
21: ; preds = %17
%22 = load i8*, i8** @optarg
br label %3
23: ; preds = %17
%24 = load i8*, i8** @optarg
br label %8
25: ; preds = %17
%26 = load i8*, i8** @optarg
br label %12
27: ; preds = %17
%28 = tail call i32 (...) @SSL_library_init()
%29 = tail call i32 @do_test(i8* %9, i8* %13, i8* %16, i8* %4)
%30 = icmp eq i32 %29, 0
br i1 %30, label %31, label %34
31: ; preds = %27
%32 = load i32, i32* @stderr
%33 = tail call i32 @fprintf(i32 %32, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0))
br label %34
34: ; preds = %27, %31
%35 = phi i32* [ @EXIT_FAILURE, %31 ], [ @EXIT_SUCCESS, %27 ]
%36 = load i32, i32* %35
ret i32 %36
}