// File: /workspace/github_cpp_makefile_star2_O3/ctz[P]openssl-bench/bench.cc
// Function: main
int main(int argc, char **argv) {
  Context server_ctx = Context::server();
  Context client_ctx = Context::client();

  argv += 1;
  argc -= 1;

  if (argc < 2) {
    return usage();
  }

  unsigned n_threads = 1;
  if (strcmp(argv[0], "--threads") == 0) {
    n_threads = unsigned(atoi(argv[1]));
    argv += 2;
    argc -= 2;
    if (n_threads == 0) {
      puts("bad --threads count");
      return usage();
    }
  }

  KeyType key_type;
  if (strcmp(argv[0], "--rsa") == 0) {
    key_type = KeyType::RSA2048;
    argv += 1;
    argc -= 1;
  } else if (strcmp(argv[0], "--ecdsa") == 0) {
    key_type = KeyType::ECDSAP256;
    argv += 1;
    argc -= 1;
  } else {
    key_type = KeyType::RSA2048;
  }

  if (argc < 2) {
    return usage();
  }

  server_ctx.set_ciphers(argv[1]);
  client_ctx.set_ciphers(argv[1]);
  server_ctx.load_server_creds(key_type);
  client_ctx.load_client_creds(key_type);

  if (!strcmp(argv[0], "bulk") && argc == 3) {
    test_bulk(n_threads, server_ctx, client_ctx, atoi(argv[2]));
  } else if (!strcmp(argv[0], "handshake")) {
    test_handshake(n_threads, server_ctx, client_ctx);
  } else if (!strcmp(argv[0], "handshake-resume")) {
    test_handshake_resume(n_threads, server_ctx, client_ctx, false);
  } else if (!strcmp(argv[0], "handshake-ticket")) {
    test_handshake_resume(n_threads, server_ctx, client_ctx, true);
  } else if (!strcmp(argv[0], "memory")) {
    test_memory(server_ctx, client_ctx, atoi(argv[2]));
  } else {
    return usage();
  }

  return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x138, %rsp            # imm = 0x138
movq %rsi, %rbx
movl %edi, %ebp
callq 0x3550
movq %rax, %rdi
callq 0x33d0
movq %rax, 0x18(%rsp)
movl $0x40020000, %esi       # imm = 0x40020000
movq %rax, %rdi
callq 0x3520
callq 0x3160
movq %rax, %rdi
callq 0x33d0
movq %rax, 0x10(%rsp)
movl $0x40020000, %esi       # imm = 0x40020000
movq %rax, %rdi
callq 0x3520
cmpl $0x2, %ebp
jle 0x3b11
movq 0x8(%rbx), %r14
leaq 0x3944(%rip), %rsi      # 0x7048
movq %r14, %rdi
callq 0x33a0
testl %eax, %eax
je 0x371e
decl %ebp
addq $0x8, %rbx
movl $0x1, %r12d
jmp 0x373d
movq 0x10(%rbx), %rdi
callq 0x3430
testl %eax, %eax
je 0x3b05
movl %eax, %r12d
addl $-0x3, %ebp
movq 0x18(%rbx), %r14
addq $0x18, %rbx
leaq 0x3922(%rip), %rsi      # 0x7066
movq %r14, %rdi
callq 0x33a0
testl %eax, %eax
je 0x3774
leaq 0x3915(%rip), %rsi      # 0x706c
movq %r14, %rdi
callq 0x33a0
xorl %r13d, %r13d
testl %eax, %eax
jne 0x377d
addq $0x8, %rbx
decl %ebp
movl $0x1, %r13d
jmp 0x377d
addq $0x8, %rbx
decl %ebp
xorl %r13d, %r13d
cmpl $0x1, %ebp
jle 0x3b11
movq 0x8(%rbx), %rsi
leaq 0x18(%rsp), %rdi
callq 0x56ca
movq 0x8(%rbx), %rsi
leaq 0x10(%rsp), %rdi
callq 0x56ca
leaq 0x18(%rsp), %rdi
movl %r13d, %esi
callq 0x57bc
leaq 0x10(%rsp), %rdi
movl %r13d, %esi
callq 0x58a2
movq (%rbx), %r14
leaq 0x38ae(%rip), %rsi      # 0x7074
movq %r14, %rdi
callq 0x33a0
cmpl $0x3, %ebp
jne 0x3a8f
testl %eax, %eax
jne 0x3a8f
movq 0x10(%rbx), %rdi
callq 0x3430
movslq %eax, %rbx
movq %rbx, 0x60(%rsp)
xorpd %xmm0, %xmm0
movapd %xmm0, 0xa0(%rsp)
movq $0x0, 0xb0(%rsp)
movl %r12d, %r15d
leaq 0x88(%rsp), %rdi
leaq 0xc0(%rsp), %rdx
movq %r15, %rsi
callq 0x58ec
cmpl $0x2000, %ebx           # imm = 0x2000
movl $0x4000000, %eax        # imm = 0x4000000
movl $0x40000000, %edi       # imm = 0x40000000
cmovbq %rax, %rdi
callq 0x4b7e
xorl %r14d, %r14d
xorl %edx, %edx
divq %rbx
leaq 0xf8(%rsp), %rcx
movq %rax, (%rcx)
leaq 0xc0(%rsp), %r13
leaq 0x20(%rsp), %r12
leaq 0xa0(%rsp), %rbp
movq %r15, %rbx
leaq 0xede(%rip), %rax       # 0x474d
movq %rax, 0x100(%rsp)
movq 0x88(%rsp), %rax
addq %r14, %rax
movq %rax, 0x68(%rsp)
leaq 0x18(%rsp), %rax
movq %rax, 0x40(%rsp)
leaq 0x10(%rsp), %rax
movq %rax, 0x20(%rsp)
leaq 0x60(%rsp), %rax
movq %rax, (%rsp)
movq %r13, %rdi
leaq 0x100(%rsp), %rsi
leaq 0x68(%rsp), %rdx
leaq 0x40(%rsp), %rcx
movq %r12, %r8
leaq 0xf8(%rsp), %r9
callq 0x5962
movq %rbp, %rdi
movq %r13, %rsi
callq 0x5bae
cmpq $0x0, 0xc0(%rsp)
jne 0x3fb5
addq $0x10, %r14
decq %rbx
jne 0x3868
xorl %ebx, %ebx
movq 0xa0(%rsp), %rdi
addq %rbx, %rdi
callq 0x34b0
addq $0x8, %rbx
decq %r15
jne 0x38f2
movq 0x10(%rsp), %rdi
callq 0x32d0
leaq 0xc0(%rsp), %rdi
movq %rax, %rsi
callq 0x5a14
movq 0x18(%rsp), %rdi
callq 0x32d0
leaq 0x100(%rsp), %rdi
movq %rax, %rsi
callq 0x5a14
leaq 0x3afb(%rip), %rsi      # 0x7441
leaq 0xc0(%rsp), %rdi
callq 0x620c
leaq 0xc0(%rsp), %rbx
leaq 0x100(%rsp), %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x4c0e
testb %al, %al
jne 0x3963
leaq 0x78(%rsp), %r14
movq %r14, -0x10(%r14)
movabsq $0x6e6573096b6c7562, %rax # imm = 0x6E6573096B6C7562
movq %rax, (%r14)
movw $0x964, 0x8(%r14)       # imm = 0x964
movl $0xa, %eax
movq %rax, -0x8(%r14)
xorl %ecx, %ecx
movb %cl, 0xa(%r14)
leaq 0x50(%rsp), %r15
movq %r15, -0x10(%r15)
movabsq $0x636572096b6c7562, %rdx # imm = 0x636572096B6C7562
movq %rdx, (%r15)
movw $0x976, 0x8(%r15)       # imm = 0x976
movq %rax, -0x8(%r15)
movb %cl, 0xa(%r15)
leaq 0x20(%rsp), %rdi
leaq 0xc0(%rsp), %rsi
callq 0x5a8e
movq 0x20(%rsp), %rsi
movq 0x28(%rsp), %rdx
leaq 0x68(%rsp), %rdi
callq 0x3100
leaq 0x30(%rsp), %r12
movq -0x10(%r12), %rdi
cmpq %r12, %rdi
je 0x3a05
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x32c0
leaq 0x20(%rsp), %rdi
leaq 0xc0(%rsp), %rsi
callq 0x5a8e
movq 0x20(%rsp), %rsi
movq 0x28(%rsp), %rdx
leaq 0x40(%rsp), %rdi
callq 0x3100
movq 0x20(%rsp), %rdi
cmpq %r12, %rdi
je 0x3a42
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x32c0
movq 0xf8(%rsp), %rax
imulq 0x60(%rsp), %rax
movq %rax, %xmm1
punpckldq 0x35b3(%rip), %xmm1 # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x35bb(%rip), %xmm1     # 0x7020
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
mulsd 0x35b7(%rip), %xmm0     # 0x7030
movq 0x68(%rsp), %rdi
movq 0x40(%rsp), %rsi
leaq 0x38d7(%rip), %rcx      # 0x7361
jmp 0x3e0a
leaq 0x35e3(%rip), %rsi      # 0x7079
movq %r14, %rdi
callq 0x33a0
testl %eax, %eax
je 0x3b61
leaq 0x35d6(%rip), %rsi      # 0x7083
movq %r14, %rdi
callq 0x33a0
movl %eax, %ebp
testl %eax, %eax
je 0x3b43
leaq 0x35ce(%rip), %rsi      # 0x7094
movq %r14, %rdi
callq 0x33a0
testl %eax, %eax
je 0x3b43
leaq 0x35cc(%rip), %rsi      # 0x70a5
movq %r14, %rdi
callq 0x33a0
testl %eax, %eax
jne 0x3b11
movq 0x10(%rbx), %rdi
callq 0x3430
movslq %eax, %rdx
leaq 0x18(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x456b
jmp 0x3e89
leaq 0x3546(%rip), %rdi      # 0x7052
callq 0x3400
callq 0x3fc4
movl $0x1, %ebx
movq 0x10(%rsp), %rdi
callq 0x3070
movq 0x18(%rsp), %rdi
callq 0x3070
movl %ebx, %eax
addq $0x138, %rsp            # imm = 0x138
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %ecx, %ecx
testl %ebp, %ebp
setne %cl
leaq 0x18(%rsp), %rsi
leaq 0x10(%rsp), %rdx
movl %r12d, %edi
callq 0x3fea
jmp 0x3e89
xorpd %xmm0, %xmm0
movapd %xmm0, 0xa0(%rsp)
movq $0x0, 0xb0(%rsp)
movl %r12d, %ebp
leaq 0x88(%rsp), %rdi
leaq 0xc0(%rsp), %rdx
movq %rbp, %rsi
callq 0x58ec
movl $0x200, %edi            # imm = 0x200
callq 0x4b7e
leaq 0x60(%rsp), %rcx
movq %rax, (%rcx)
xorl %r15d, %r15d
leaq 0xc0(%rsp), %r13
leaq 0x20(%rsp), %r12
leaq 0xa0(%rsp), %r14
movq %rbp, %rbx
leaq 0x1093(%rip), %rax      # 0x4c5c
movq %rax, 0x100(%rsp)
movq 0x88(%rsp), %rax
addq %r15, %rax
movq %rax, 0x68(%rsp)
leaq 0x18(%rsp), %rax
movq %rax, 0x40(%rsp)
leaq 0x10(%rsp), %rax
movq %rax, 0x20(%rsp)
movq %r13, %rdi
leaq 0x100(%rsp), %rsi
leaq 0x68(%rsp), %rdx
leaq 0x60(%rsp), %rcx
leaq 0x40(%rsp), %r8
movq %r12, %r9
callq 0x6282
movq %r14, %rdi
movq %r13, %rsi
callq 0x5bae
cmpq $0x0, 0xc0(%rsp)
jne 0x3fb5
addq $0x10, %r15
decq %rbx
jne 0x3bc2
xorl %ebx, %ebx
movq 0xa0(%rsp), %rdi
addq %rbx, %rdi
callq 0x34b0
addq $0x8, %rbx
decq %rbp
jne 0x3c3c
movq 0x10(%rsp), %rdi
callq 0x32d0
leaq 0xc0(%rsp), %rdi
movq %rax, %rsi
callq 0x5a14
movq 0x18(%rsp), %rdi
callq 0x32d0
leaq 0x100(%rsp), %rdi
movq %rax, %rsi
callq 0x5a14
leaq 0x37b1(%rip), %rsi      # 0x7441
leaq 0xc0(%rsp), %rdi
callq 0x620c
leaq 0xc0(%rsp), %rbx
leaq 0x100(%rsp), %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x4c0e
testb %al, %al
jne 0x3cad
leaq 0x78(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x40(%rsp), %rsi
movq $0x12, (%rsi)
leaq 0x68(%rsp), %rdi
xorl %edx, %edx
callq 0x34d0
movq %rax, 0x68(%rsp)
leaq 0x50(%rsp), %r15
movq -0x10(%r15), %rcx
movq %rcx, 0x78(%rsp)
movupd 0x37ad(%rip), %xmm0     # 0x74a5
movupd %xmm0, (%rax)
movw $0x972, 0x10(%rax)      # imm = 0x972
movq %rcx, 0x70(%rsp)
movq 0x68(%rsp), %rax
movb $0x0, (%rax,%rcx)
movq %r15, -0x10(%r15)
leaq 0x20(%rsp), %rsi
movq $0x12, (%rsi)
leaq 0x40(%rsp), %rdi
xorl %edx, %edx
callq 0x34d0
movq %rax, 0x40(%rsp)
leaq 0x20(%rsp), %rdi
movq (%rdi), %rcx
movq %rcx, 0x50(%rsp)
movupd 0x3772(%rip), %xmm0     # 0x74b8
movupd %xmm0, (%rax)
movw $0x974, 0x10(%rax)      # imm = 0x974
movq %rcx, 0x48(%rsp)
movq 0x40(%rsp), %rax
movb $0x0, (%rax,%rcx)
leaq 0xc0(%rsp), %rsi
callq 0x5a8e
movq 0x20(%rsp), %rsi
movq 0x28(%rsp), %rdx
leaq 0x68(%rsp), %rdi
callq 0x3100
leaq 0x30(%rsp), %r12
movq -0x10(%r12), %rdi
cmpq %r12, %rdi
je 0x3d9b
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x32c0
leaq 0x20(%rsp), %rdi
leaq 0xc0(%rsp), %rsi
callq 0x5a8e
movq 0x20(%rsp), %rsi
movq 0x28(%rsp), %rdx
leaq 0x40(%rsp), %rdi
callq 0x3100
movq 0x20(%rsp), %rdi
cmpq %r12, %rdi
je 0x3dd8
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x32c0
movq 0x68(%rsp), %rdi
movsd 0x60(%rsp), %xmm1
unpcklps 0x3226(%rip), %xmm1     # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x322e(%rip), %xmm1     # 0x7020
movq 0x40(%rsp), %rsi
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
leaq 0x36c1(%rip), %rcx      # 0x74cb
leaq 0x88(%rsp), %rdx
callq 0x49e9
movq 0x40(%rsp), %rdi
cmpq %r15, %rdi
je 0x3e2e
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x32c0
movq 0x68(%rsp), %rdi
cmpq %r14, %rdi
je 0x3e45
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x32c0
leaq 0x100(%rsp), %rdi
callq 0x5b16
leaq 0xc0(%rsp), %rdi
callq 0x5b16
movq 0x88(%rsp), %rdi
testq %rdi, %rdi
je 0x3e7c
movq 0x98(%rsp), %rsi
subq %rdi, %rsi
callq 0x32c0
leaq 0xa0(%rsp), %rdi
callq 0x5b4c
xorl %ebx, %ebx
jmp 0x3b1b
jmp 0x3eb0
jmp 0x3ee1
jmp 0x3ec1
jmp 0x3ee1
movq %rax, %rbx
jmp 0x3efb
jmp 0x3f3e
jmp 0x3f3e
jmp 0x3f16
jmp 0x3f1b
jmp 0x3f6c
movq %rax, %rbx
movq 0x20(%rsp), %rdi
cmpq %r12, %rdi
jne 0x3ed2
jmp 0x3ee4
jmp 0x3ee1
movq %rax, %rbx
leaq 0x30(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x3ee4
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x32c0
jmp 0x3ee4
movq %rax, %rbx
movq 0x40(%rsp), %rdi
cmpq %r15, %rdi
je 0x3efb
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x32c0
movq 0x68(%rsp), %rdi
cmpq %r14, %rdi
je 0x3f41
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x32c0
jmp 0x3f41
jmp 0x3f3e
movq %rax, %rbx
jmp 0x3f8c
movq %rax, %rbx
jmp 0x3f4e
jmp 0x3f6c
movq %rax, %rbx
jmp 0x3f99
jmp 0x3fbc
jmp 0x3fbc
jmp 0x3f3e
jmp 0x3f6c
jmp 0x3f6c
jmp 0x3f61
movq %rax, %rbx
jmp 0x3fa3
movq %rax, %rbx
leaq 0x100(%rsp), %rdi
callq 0x5b16
leaq 0xc0(%rsp), %rdi
callq 0x5b16
jmp 0x3f6f
jmp 0x3f6c
jmp 0x3f6c
cmpq $0x0, 0xc0(%rsp)
jne 0x3fb5
movq %rax, %rbx
movq 0x88(%rsp), %rdi
testq %rdi, %rdi
je 0x3f8c
movq 0x98(%rsp), %rsi
subq %rdi, %rsi
callq 0x32c0
leaq 0xa0(%rsp), %rdi
callq 0x5b4c
movq 0x10(%rsp), %rdi
callq 0x3070
movq 0x18(%rsp), %rdi
callq 0x3070
movq %rbx, %rdi
callq 0x34c0
callq 0x30e0
jmp 0x3fbc
movq %rax, %rdi
callq 0x5b87