// File: /workspace/github_cpp_makefile_star2_O3/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 0x2859(%rip), %rsi      # 0x74d8
leaq 0x40(%rsp), %rdi
callq 0x6328
leaq 0x284f(%rip), %rsi      # 0x74df
leaq 0x38(%rsp), %rdi
callq 0x6328
testl %ebx, %ebx
je 0x5029
movq %r12, 0x48(%rsp)
movl %ebx, %ebp
xorpd %xmm0, %xmm0
movsd %xmm0, 0x28(%rsp)
leaq 0xe0(%rsp), %r12
leaq 0xa8(%rsp), %r13
movq %rsp, %rbx
movsd %xmm0, 0x20(%rsp)
movq (%r15), %rdi
callq 0x32d0
movq %r12, %rdi
movq %rax, %rsi
callq 0x5a14
movq (%r14), %rdi
callq 0x32d0
movq %r13, %rdi
movq %rax, %rsi
callq 0x5a14
movq %r13, %rdi
leaq 0x2745(%rip), %rsi      # 0x7441
callq 0x620c
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 0x2309(%rip), %xmm0     # 0x7038
movsd %xmm0, 0xa0(%rsp)
movq %r13, %rdi
callq 0x6264
movq %r13, %rdi
movq %r12, %rsi
callq 0x5dc8
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 0x6246
movq %r12, %rdi
movq %r13, %rsi
callq 0x5dc8
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 0x6264
movq %r13, %rdi
movq %r12, %rsi
callq 0x5dc8
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, 0x18(%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, 0x30(%rsp)
movq %r12, %rdi
callq 0x6246
movq %r12, %rdi
movq %r13, %rsi
callq 0x5dc8
movsd 0xa0(%rsp), %xmm1
addsd 0x98(%rsp), %xmm1
movsd 0x219b(%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 0x18(%rsp), %xmm3
divsd %xmm2, %xmm3
addsd 0x50(%rsp), %xmm3
subsd %xmm1, %xmm3
addsd %xmm0, %xmm3
movsd %xmm3, 0x18(%rsp)
movsd 0x30(%rsp), %xmm0
divsd %xmm2, %xmm0
addsd 0x58(%rsp), %xmm0
movsd %xmm0, 0x30(%rsp)
movq %rbx, %rdi
xorl %esi, %esi
callq 0x3470
xorps %xmm0, %xmm0
cvtsi2sdq (%rsp), %xmm0
xorps %xmm1, %xmm1
cvtsi2sdq 0x8(%rsp), %xmm1
divsd 0x20eb(%rip), %xmm1     # 0x7038
addsd %xmm0, %xmm1
subsd 0x30(%rsp), %xmm1
addsd 0x10(%rsp), %xmm1
movsd %xmm1, 0x10(%rsp)
leaq 0x40(%rsp), %rdi
movsd 0x18(%rsp), %xmm0
callq 0x6490
leaq 0x38(%rsp), %rdi
movsd 0x10(%rsp), %xmm0
callq 0x6490
movq %r12, %rdi
callq 0x6246
testb %al, %al
je 0x5085
movq %r13, %rdi
callq 0x6264
testb %al, %al
je 0x5066
movq 0xe0(%rsp), %rdi
callq 0x30c0
cmpl $0x1, %eax
je 0x50a4
movq 0xa8(%rsp), %rdi
callq 0x30c0
cmpl $0x1, %eax
je 0x50c3
movsd 0x20(%rsp), %xmm0
addsd 0x18(%rsp), %xmm0
movsd %xmm0, 0x20(%rsp)
movsd 0x28(%rsp), %xmm0
addsd 0x10(%rsp), %xmm0
movsd %xmm0, 0x28(%rsp)
movq %r13, %rdi
callq 0x5b16
movq %r12, %rdi
callq 0x5b16
decq %rbp
jne 0x4ccc
movq 0x20(%rsp), %xmm0
movq %xmm0, %rax
movq 0x28(%rsp), %xmm0
movq %xmm0, %rcx
movq 0x48(%rsp), %r12
jmp 0x502d
xorl %eax, %eax
xorl %ecx, %ecx
xchgq %rax, (%r12)
xchgq %rcx, 0x8(%r12)
movq 0x38(%rsp), %rdi
testq %rdi, %rdi
je 0x5045
callq 0x32a0
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0x5054
callq 0x32a0
addq $0x118, %rsp            # imm = 0x118
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x24d6(%rip), %rdi      # 0x7543
leaq 0x2164(%rip), %rsi      # 0x71d8
leaq 0x247b(%rip), %rcx      # 0x74f6
movl $0x220, %edx            # imm = 0x220
callq 0x31d0
leaq 0x245a(%rip), %rdi      # 0x74e6
leaq 0x2145(%rip), %rsi      # 0x71d8
leaq 0x245c(%rip), %rcx      # 0x74f6
movl $0x21f, %edx            # imm = 0x21F
callq 0x31d0
leaq 0x24a9(%rip), %rdi      # 0x7554
leaq 0x2126(%rip), %rsi      # 0x71d8
leaq 0x243d(%rip), %rcx      # 0x74f6
movl $0x221, %edx            # imm = 0x221
callq 0x31d0
leaq 0x24a0(%rip), %rdi      # 0x756a
leaq 0x2107(%rip), %rsi      # 0x71d8
leaq 0x241e(%rip), %rcx      # 0x74f6
movl $0x222, %edx            # imm = 0x222
callq 0x31d0
movq %rax, %rbx
jmp 0x511f
jmp 0x50f3
movq %rax, %rbx
jmp 0x5110
movq %rax, %rbx
jmp 0x5103
movq %rax, %rbx
leaq 0xa8(%rsp), %rdi
callq 0x5b16
leaq 0xe0(%rsp), %rdi
callq 0x5b16
movq 0x38(%rsp), %rdi
testq %rdi, %rdi
je 0x511f
callq 0x32a0
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0x512e
callq 0x32a0
movq %rbx, %rdi
callq 0x34c0