// File: /workspace/github_cpp_makefile_star2_O1/ctz[P]openssl-bench/bench.cc
// Function: test_handshake_one(Timings&, unsigned int, Context&, Context&)
static void test_handshake_one(Timings &timings_out, const unsigned handshakes,
                               Context &server_ctx, Context &client_ctx) {
  double time_client = 0;
  double time_server = 0;

  LatencyOutput client_latency("client");
  LatencyOutput server_latency("server");

  for (size_t i = 0; i < handshakes; i++) {
    Conn server(server_ctx.open());
    Conn client(client_ctx.open());

    client.set_sni("localhost");

    double t, time_client_one = 0, time_server_one = 0;

    t = get_time();
    client.connect();
    client.transfer_to(server);
    time_client_one += get_time() - t;

    t = get_time();
    server.accept();
    server.transfer_to(client);
    time_server_one += get_time() - t;

    t = get_time();
    client.connect();
    client.transfer_to(server);
    time_client_one += get_time() - t;

    t = get_time();
    server.accept();
    server.transfer_to(client);
    time_server_one += get_time() - t;

    client_latency.sample(time_client_one);
    server_latency.sample(time_server_one);
    time_client += time_client_one;
    time_server += time_server_one;

    assert(server.accept());
    assert(client.connect());
    assert(!server.was_resumed());
    assert(!client.was_resumed());
  }

  timings_out.client.store(time_client);
  timings_out.server.store(time_server);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x118, %rsp            # imm = 0x118
movq %rcx, %r14
movq %rdx, %r15
movl %esi, %ebx
movq %rdi, %r12
leaq 0x2885(%rip), %rsi      # 0x74d8
leaq 0x20(%rsp), %rdi
callq 0x633c
leaq 0x287b(%rip), %rsi      # 0x74df
leaq 0x18(%rsp), %rdi
callq 0x633c
testl %ebx, %ebx
je 0x4ffd
movq %r12, 0x48(%rsp)
movl %ebx, %ebp
xorpd %xmm0, %xmm0
movsd %xmm0, 0x38(%rsp)
leaq 0xe0(%rsp), %r12
leaq 0xa8(%rsp), %r13
movq %rsp, %rbx
movsd %xmm0, 0x30(%rsp)
movq (%r15), %rdi
callq 0x32d0
movq %r12, %rdi
movq %rax, %rsi
callq 0x5a48
movq (%r14), %rdi
callq 0x32d0
movq %r13, %rdi
movq %rax, %rsi
callq 0x5a48
movq %r13, %rdi
leaq 0x2771(%rip), %rsi      # 0x7441
callq 0x6210
movq %rbx, %rdi
xorl %esi, %esi
callq 0x3470
xorps %xmm0, %xmm0
cvtsi2sdq (%rsp), %xmm0
movsd %xmm0, 0x98(%rsp)
xorps %xmm0, %xmm0
cvtsi2sdq 0x8(%rsp), %xmm0
divsd 0x2335(%rip), %xmm0     # 0x7038
movsd %xmm0, 0xa0(%rsp)
movq %r13, %rdi
callq 0x6268
movq %r13, %rdi
movq %r12, %rsi
callq 0x5dfe
movq %rbx, %rdi
xorl %esi, %esi
callq 0x3470
xorps %xmm0, %xmm0
cvtsi2sdq (%rsp), %xmm0
movsd %xmm0, 0x80(%rsp)
xorps %xmm0, %xmm0
cvtsi2sdq 0x8(%rsp), %xmm0
movsd %xmm0, 0x90(%rsp)
movq %rbx, %rdi
xorl %esi, %esi
callq 0x3470
xorps %xmm0, %xmm0
cvtsi2sdq (%rsp), %xmm0
movsd %xmm0, 0x78(%rsp)
xorps %xmm0, %xmm0
cvtsi2sdq 0x8(%rsp), %xmm0
movsd %xmm0, 0x88(%rsp)
movq %r12, %rdi
callq 0x624a
movq %r12, %rdi
movq %r13, %rsi
callq 0x5dfe
movq %rbx, %rdi
xorl %esi, %esi
callq 0x3470
xorps %xmm0, %xmm0
cvtsi2sdq (%rsp), %xmm0
movsd %xmm0, 0x68(%rsp)
xorps %xmm0, %xmm0
cvtsi2sdq 0x8(%rsp), %xmm0
movsd %xmm0, 0x10(%rsp)
movq %rbx, %rdi
xorl %esi, %esi
callq 0x3470
xorps %xmm0, %xmm0
cvtsi2sdq (%rsp), %xmm0
movsd %xmm0, 0x60(%rsp)
xorps %xmm0, %xmm0
cvtsi2sdq 0x8(%rsp), %xmm0
movsd %xmm0, 0x70(%rsp)
movq %r13, %rdi
callq 0x6268
movq %r13, %rdi
movq %r12, %rsi
callq 0x5dfe
movq %rbx, %rdi
xorl %esi, %esi
callq 0x3470
xorps %xmm0, %xmm0
cvtsi2sdq (%rsp), %xmm0
movsd %xmm0, 0x50(%rsp)
xorps %xmm0, %xmm0
cvtsi2sdq 0x8(%rsp), %xmm0
movsd %xmm0, 0x28(%rsp)
movq %rbx, %rdi
xorl %esi, %esi
callq 0x3470
xorps %xmm0, %xmm0
cvtsi2sdq (%rsp), %xmm0
movsd %xmm0, 0x58(%rsp)
xorps %xmm0, %xmm0
cvtsi2sdq 0x8(%rsp), %xmm0
movsd %xmm0, 0x40(%rsp)
movq %r12, %rdi
callq 0x624a
movq %r12, %rdi
movq %r13, %rsi
callq 0x5dfe
movsd 0xa0(%rsp), %xmm1
addsd 0x98(%rsp), %xmm1
movsd 0x21c7(%rip), %xmm2     # 0x7038
movsd 0x90(%rsp), %xmm0
divsd %xmm2, %xmm0
addsd 0x80(%rsp), %xmm0
subsd %xmm1, %xmm0
movsd 0x88(%rsp), %xmm1
divsd %xmm2, %xmm1
addsd 0x78(%rsp), %xmm1
movsd 0x10(%rsp), %xmm3
divsd %xmm2, %xmm3
addsd 0x68(%rsp), %xmm3
subsd %xmm1, %xmm3
movsd %xmm3, 0x10(%rsp)
movsd 0x70(%rsp), %xmm1
divsd %xmm2, %xmm1
addsd 0x60(%rsp), %xmm1
movsd 0x28(%rsp), %xmm3
divsd %xmm2, %xmm3
addsd 0x50(%rsp), %xmm3
subsd %xmm1, %xmm3
addsd %xmm0, %xmm3
movsd %xmm3, 0x28(%rsp)
movsd 0x40(%rsp), %xmm0
divsd %xmm2, %xmm0
addsd 0x58(%rsp), %xmm0
movsd %xmm0, 0x40(%rsp)
movq %rbx, %rdi
xorl %esi, %esi
callq 0x3470
xorps %xmm0, %xmm0
cvtsi2sdq (%rsp), %xmm0
xorps %xmm1, %xmm1
cvtsi2sdq 0x8(%rsp), %xmm1
divsd 0x2117(%rip), %xmm1     # 0x7038
addsd %xmm0, %xmm1
subsd 0x40(%rsp), %xmm1
addsd 0x10(%rsp), %xmm1
movsd %xmm1, 0x10(%rsp)
leaq 0x20(%rsp), %rdi
movsd 0x28(%rsp), %xmm0
callq 0x64a4
leaq 0x18(%rsp), %rdi
movsd 0x10(%rsp), %xmm0
callq 0x64a4
movq %r12, %rdi
callq 0x624a
testb %al, %al
je 0x506b
movq %r13, %rdi
callq 0x6268
testb %al, %al
je 0x504c
movq 0xe0(%rsp), %rdi
callq 0x30c0
cmpl $0x1, %eax
je 0x508a
movq 0xa8(%rsp), %rdi
callq 0x30c0
cmpl $0x1, %eax
je 0x50a9
movsd 0x30(%rsp), %xmm0
addsd 0x28(%rsp), %xmm0
movsd %xmm0, 0x30(%rsp)
movsd 0x38(%rsp), %xmm0
addsd 0x10(%rsp), %xmm0
movsd %xmm0, 0x38(%rsp)
movq %r13, %rdi
callq 0x5b4a
movq %r12, %rdi
callq 0x5b4a
decq %rbp
jne 0x4ca0
movq 0x30(%rsp), %xmm0
movq %xmm0, %rax
movq 0x38(%rsp), %xmm0
movq %xmm0, %rcx
movq 0x48(%rsp), %r12
jmp 0x5001
xorl %eax, %eax
xorl %ecx, %ecx
xchgq %rax, (%r12)
xchgq %rcx, 0x8(%r12)
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x5022
callq 0x32a0
movq $0x0, 0x18(%rsp)
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x503a
callq 0x32a0
movq $0x0, 0x20(%rsp)
addq $0x118, %rsp            # imm = 0x118
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x24f0(%rip), %rdi      # 0x7543
leaq 0x217e(%rip), %rsi      # 0x71d8
leaq 0x2495(%rip), %rcx      # 0x74f6
movl $0x220, %edx            # imm = 0x220
callq 0x31d0
leaq 0x2474(%rip), %rdi      # 0x74e6
leaq 0x215f(%rip), %rsi      # 0x71d8
leaq 0x2476(%rip), %rcx      # 0x74f6
movl $0x21f, %edx            # imm = 0x21F
callq 0x31d0
leaq 0x24c3(%rip), %rdi      # 0x7554
leaq 0x2140(%rip), %rsi      # 0x71d8
leaq 0x2457(%rip), %rcx      # 0x74f6
movl $0x221, %edx            # imm = 0x221
callq 0x31d0
leaq 0x24ba(%rip), %rdi      # 0x756a
leaq 0x2121(%rip), %rsi      # 0x71d8
leaq 0x2438(%rip), %rcx      # 0x74f6
movl $0x222, %edx            # imm = 0x222
callq 0x31d0
movq %rax, %rbx
jmp 0x510e
jmp 0x50d9
movq %rax, %rbx
jmp 0x50f6
movq %rax, %rbx
jmp 0x50e9
movq %rax, %rbx
leaq 0xa8(%rsp), %rdi
callq 0x5b4a
leaq 0xe0(%rsp), %rdi
callq 0x5b4a
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x510e
callq 0x32a0
movq $0x0, 0x18(%rsp)
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x5126
callq 0x32a0
movq $0x0, 0x20(%rsp)
movq %rbx, %rdi
callq 0x34c0