// File: /workspace/github_cpp_makefile_star2_O2/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 $0xd8, %rsp
movq %rcx, %r14
movq %rdx, %r15
movl %esi, %ebx
movq %rdi, 0x38(%rsp)
leaq 0x2c41(%rip), %rsi      # 0x7502
leaq 0x30(%rsp), %rdi
callq 0x5e4c
leaq 0x2c37(%rip), %rsi      # 0x7509
leaq 0x28(%rsp), %rdi
callq 0x5e4c
movl %ebx, %ebx
leaq 0xa0(%rsp), %r12
leaq 0x68(%rsp), %r13
leaq 0x28(%rsp), %rbp
xorpd %xmm0, %xmm0
movsd %xmm0, 0x18(%rsp)
movsd %xmm0, 0x20(%rsp)
subq $0x1, %rbx
jb 0x4ac6
movq %r15, %rdi
callq 0x52f6
movq %r12, %rdi
movq %rax, %rsi
callq 0x52fe
movq %r14, %rdi
callq 0x52f6
movq %r13, %rdi
movq %rax, %rsi
callq 0x52fe
movq %r13, %rdi
leaq 0x2b07(%rip), %rsi      # 0x7441
callq 0x5c5e
callq 0x47eb
movsd %xmm0, 0x60(%rsp)
movq %r13, %rdi
callq 0x5cb4
movq %r13, %rdi
movq %r12, %rsi
callq 0x57bc
callq 0x47eb
movsd %xmm0, 0x58(%rsp)
callq 0x47eb
movsd %xmm0, 0x50(%rsp)
movq %r12, %rdi
callq 0x5c96
movq %r12, %rdi
movq %r13, %rsi
callq 0x57bc
callq 0x47eb
movsd %xmm0, 0x8(%rsp)
callq 0x47eb
movsd %xmm0, 0x48(%rsp)
movq %r13, %rdi
callq 0x5cb4
movq %r13, %rdi
movq %r12, %rsi
callq 0x57bc
callq 0x47eb
movsd %xmm0, 0x10(%rsp)
callq 0x47eb
movsd %xmm0, 0x40(%rsp)
movq %r12, %rdi
callq 0x5c96
movq %r12, %rdi
movq %r13, %rsi
callq 0x57bc
movsd 0x58(%rsp), %xmm1
subsd 0x60(%rsp), %xmm1
xorpd %xmm0, %xmm0
addsd %xmm0, %xmm1
movsd 0x8(%rsp), %xmm2
subsd 0x50(%rsp), %xmm2
addsd %xmm0, %xmm2
movsd %xmm2, 0x8(%rsp)
movsd 0x10(%rsp), %xmm0
subsd 0x48(%rsp), %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0x10(%rsp)
callq 0x47eb
subsd 0x40(%rsp), %xmm0
addsd 0x8(%rsp), %xmm0
movsd %xmm0, 0x8(%rsp)
leaq 0x30(%rsp), %rdi
movsd 0x10(%rsp), %xmm0
callq 0x5f5a
movq %rbp, %rdi
movsd 0x8(%rsp), %xmm0
callq 0x5f5a
movq %r12, %rdi
callq 0x5c96
testb %al, %al
je 0x4b2d
movq %r13, %rdi
callq 0x5cb4
testb %al, %al
je 0x4b0e
movq %r12, %rdi
callq 0x5f9c
testb %al, %al
jne 0x4b4c
movq %r13, %rdi
callq 0x5f9c
testb %al, %al
jne 0x4b6b
movsd 0x18(%rsp), %xmm0
addsd 0x10(%rsp), %xmm0
movsd %xmm0, 0x18(%rsp)
movsd 0x20(%rsp), %xmm0
addsd 0x8(%rsp), %xmm0
movsd %xmm0, 0x20(%rsp)
movq %r13, %rdi
callq 0x5420
movq %r12, %rdi
callq 0x5420
jmp 0x4900
movq 0x18(%rsp), %xmm0
movq %xmm0, %rax
movq 0x38(%rsp), %rcx
xchgq %rax, (%rcx)
movq 0x20(%rsp), %xmm0
movq %xmm0, %rax
xchgq %rax, 0x8(%rcx)
leaq 0x28(%rsp), %rdi
callq 0x5fae
leaq 0x30(%rsp), %rdi
callq 0x5fae
addq $0xd8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x2a58(%rip), %rdi      # 0x756d
leaq 0x26bc(%rip), %rsi      # 0x71d8
leaq 0x29fd(%rip), %rcx      # 0x7520
movl $0x220, %edx            # imm = 0x220
callq 0x31d0
leaq 0x29dc(%rip), %rdi      # 0x7510
leaq 0x269d(%rip), %rsi      # 0x71d8
leaq 0x29de(%rip), %rcx      # 0x7520
movl $0x21f, %edx            # imm = 0x21F
callq 0x31d0
leaq 0x2a2b(%rip), %rdi      # 0x757e
leaq 0x267e(%rip), %rsi      # 0x71d8
leaq 0x29bf(%rip), %rcx      # 0x7520
movl $0x221, %edx            # imm = 0x221
callq 0x31d0
leaq 0x2a22(%rip), %rdi      # 0x7594
leaq 0x265f(%rip), %rsi      # 0x71d8
leaq 0x29a0(%rip), %rcx      # 0x7520
movl $0x222, %edx            # imm = 0x222
callq 0x31d0
movq %rax, %rbx
jmp 0x4bbf
jmp 0x4b9b
movq %rax, %rbx
jmp 0x4bb5
movq %rax, %rbx
jmp 0x4ba8
movq %rax, %rbx
leaq 0x68(%rsp), %rdi
callq 0x5420
leaq 0xa0(%rsp), %rdi
callq 0x5420
leaq 0x28(%rsp), %rdi
callq 0x5fae
leaq 0x30(%rsp), %rdi
callq 0x5fae
movq %rbx, %rdi
callq 0x34d0