// File: /workspace/github_cpp_makefile_star2_O2/ctz[P]openssl-bench/bench.cc
// Function: test_handshake_resume_one(Timings&, Context&, Context&, ssl_session_st*, unsigned long)
static void test_handshake_resume_one(Timings &timings_out, Context &server_ctx,
                                      Context &client_ctx,
                                      SSL_SESSION *client_session,
                                      const size_t handshakes) {
  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");
    client.set_session(client_session);
    assert(SSL_SESSION_is_resumable(client_session));

    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;

    assert(server.accept());
    assert(client.connect());
    assert(server.was_resumed());
    assert(client.was_resumed());
    server.ragged_close();
    client.ragged_close();

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

  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 %r8, %r14
movq %rcx, %r15
movq %rdx, %r12
movq %rsi, %r13
movq %rdi, 0x30(%rsp)
leaq 0x2908(%rip), %rsi      # 0x7502
leaq 0x28(%rsp), %rdi
callq 0x5e4c
leaq 0x28fe(%rip), %rsi      # 0x7509
leaq 0x20(%rsp), %rdi
callq 0x5e4c
leaq 0xa0(%rsp), %rbp
leaq 0x68(%rsp), %rbx
xorpd %xmm0, %xmm0
movsd %xmm0, 0x8(%rsp)
movsd %xmm0, 0x10(%rsp)
subq $0x1, %r14
jb 0x4e1e
movq %r13, %rdi
callq 0x52f6
movq %rbp, %rdi
movq %rax, %rsi
callq 0x52fe
movq %r12, %rdi
callq 0x52f6
movq %rbx, %rdi
movq %rax, %rsi
callq 0x52fe
movq %rbx, %rdi
leaq 0x27d5(%rip), %rsi      # 0x7441
callq 0x5c5e
movq %rbx, %rdi
movq %r15, %rsi
callq 0x628e
movq %r15, %rdi
callq 0x33e0
testl %eax, %eax
je 0x4e66
callq 0x47eb
movsd %xmm0, 0x60(%rsp)
movq %rbx, %rdi
callq 0x5cb4
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x57bc
callq 0x47eb
movsd %xmm0, 0x58(%rsp)
callq 0x47eb
movsd %xmm0, 0x50(%rsp)
movq %rbp, %rdi
callq 0x5c96
movq %rbp, %rdi
movq %rbx, %rsi
callq 0x57bc
callq 0x47eb
movsd %xmm0, 0x48(%rsp)
callq 0x47eb
movsd %xmm0, 0x40(%rsp)
movq %rbx, %rdi
callq 0x5cb4
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x57bc
callq 0x47eb
movsd %xmm0, 0x18(%rsp)
callq 0x47eb
movsd %xmm0, 0x38(%rsp)
movq %rbp, %rdi
callq 0x5c96
movq %rbp, %rdi
movq %rbx, %rsi
callq 0x57bc
callq 0x47eb
movsd %xmm0, (%rsp)
movq %rbp, %rdi
callq 0x5c96
testb %al, %al
je 0x4ee2
movq %rbx, %rdi
callq 0x5cb4
testb %al, %al
je 0x4ec3
movq %rbp, %rdi
callq 0x5f9c
testb %al, %al
je 0x4ea4
movq %rbx, %rdi
callq 0x5f9c
testb %al, %al
je 0x4e85
movq %rbp, %rdi
callq 0x6106
movq %rbx, %rdi
callq 0x6106
movsd 0x58(%rsp), %xmm1
subsd 0x60(%rsp), %xmm1
xorpd %xmm0, %xmm0
addsd %xmm0, %xmm1
movsd 0x48(%rsp), %xmm2
subsd 0x50(%rsp), %xmm2
addsd %xmm0, %xmm2
movsd 0x18(%rsp), %xmm0
subsd 0x40(%rsp), %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0x18(%rsp)
movsd (%rsp), %xmm1
subsd 0x38(%rsp), %xmm1
addsd %xmm2, %xmm1
movsd %xmm1, (%rsp)
leaq 0x28(%rsp), %rdi
callq 0x5f5a
leaq 0x20(%rsp), %rdi
movsd (%rsp), %xmm0
callq 0x5f5a
movsd 0x8(%rsp), %xmm0
addsd 0x18(%rsp), %xmm0
movsd %xmm0, 0x8(%rsp)
movsd 0x10(%rsp), %xmm0
addsd (%rsp), %xmm0
movsd %xmm0, 0x10(%rsp)
movq %rbx, %rdi
callq 0x5420
movq %rbp, %rdi
callq 0x5420
jmp 0x4c32
movq 0x8(%rsp), %xmm0
movq %xmm0, %rax
movq 0x30(%rsp), %rcx
xchgq %rax, (%rcx)
movq 0x10(%rsp), %xmm0
movq %xmm0, %rax
xchgq %rax, 0x8(%rcx)
leaq 0x20(%rsp), %rdi
callq 0x5fae
leaq 0x28(%rsp), %rdi
callq 0x5fae
addq $0xd8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x27fd(%rip), %rdi      # 0x766a
leaq 0x2364(%rip), %rsi      # 0x71d8
leaq 0x2886(%rip), %rcx      # 0x7701
movl $0x255, %edx            # imm = 0x255
callq 0x31d0
leaq 0x2709(%rip), %rdi      # 0x7595
leaq 0x2345(%rip), %rsi      # 0x71d8
leaq 0x2867(%rip), %rcx      # 0x7701
movl $0x270, %edx            # imm = 0x270
callq 0x31d0
leaq 0x26d4(%rip), %rdi      # 0x757f
leaq 0x2326(%rip), %rsi      # 0x71d8
leaq 0x2848(%rip), %rcx      # 0x7701
movl $0x26f, %edx            # imm = 0x26F
callq 0x31d0
leaq 0x26a3(%rip), %rdi      # 0x756d
leaq 0x2307(%rip), %rsi      # 0x71d8
leaq 0x2829(%rip), %rcx      # 0x7701
movl $0x26e, %edx            # imm = 0x26E
callq 0x31d0
leaq 0x2627(%rip), %rdi      # 0x7510
leaq 0x22e8(%rip), %rsi      # 0x71d8
leaq 0x280a(%rip), %rcx      # 0x7701
movl $0x26d, %edx            # imm = 0x26D
callq 0x31d0
movq %rax, %rbx
jmp 0x4f36
movq %rax, %rbx
jmp 0x4f2c
movq %rax, %rbx
jmp 0x4f1f
jmp 0x4f12
movq %rax, %rbx
leaq 0x68(%rsp), %rdi
callq 0x5420
leaq 0xa0(%rsp), %rdi
callq 0x5420
leaq 0x20(%rsp), %rdi
callq 0x5fae
leaq 0x28(%rsp), %rdi
callq 0x5fae
movq %rbx, %rdi
callq 0x34d0