// File: ctz[P]openssl-bench/bench.cc
// Function: test_bulk_one(Timings&, Context&, Context&, unsigned long, unsigned long)
static void test_bulk_one(Timings &timings_out, Context &server_ctx,
                          Context &client_ctx, const size_t rounds,
                          const size_t plaintext_size) {
  Conn server(server_ctx.open());
  Conn client(client_ctx.open());

  do_handshake(client, server);

  std::vector<uint8_t> plaintext(plaintext_size, 0);
  double time_send = 0;
  double time_recv = 0;

  for (size_t i = 0; i < rounds; i++) {
    double t = get_time();
    server.write(&plaintext[0], plaintext.size());
    time_send += get_time() - t;

    server.transfer_to(client);
    t = get_time();
    client.read(&plaintext[0], plaintext.size());
    time_recv += get_time() - t;
  }

  timings_out.server.store(time_send);
  timings_out.client.store(time_recv);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x140, %rsp            # imm = 0x140
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq -0x10(%rbp), %rdi
callq 0x6500
movq %rax, %rsi
leaq -0x60(%rbp), %rdi
callq 0x6520
movq -0x18(%rbp), %rdi
callq 0x6500
movq %rax, -0xf0(%rbp)
jmp 0x4d66
movq -0xf0(%rbp), %rsi
leaq -0x98(%rbp), %rdi
callq 0x6520
jmp 0x4d7b
leaq -0x98(%rbp), %rdi
leaq -0x60(%rbp), %rsi
callq 0x5050
jmp 0x4d8d
movq -0x28(%rbp), %rax
movq %rax, -0x100(%rbp)
movb $0x0, -0xc1(%rbp)
leaq -0xc2(%rbp), %rdi
movq %rdi, -0xf8(%rbp)
callq 0x7a30
movq -0x100(%rbp), %rsi
movq -0xf8(%rbp), %rcx
leaq -0xc0(%rbp), %rdi
leaq -0xc1(%rbp), %rdx
callq 0x7a50
jmp 0x4dd5
leaq -0xc2(%rbp), %rdi
callq 0x7ad0
xorps %xmm0, %xmm0
movsd %xmm0, -0xd0(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0xd8(%rbp)
movq $0x0, -0xe0(%rbp)
movq -0xe0(%rbp), %rax
cmpq -0x20(%rbp), %rax
jae 0x4fcf
callq 0x53f0
movsd %xmm0, -0x108(%rbp)
jmp 0x4e22
movsd -0x108(%rbp), %xmm0
movsd %xmm0, -0xe8(%rbp)
xorl %eax, %eax
movl %eax, %esi
leaq -0xc0(%rbp), %rdi
movq %rdi, -0x118(%rbp)
callq 0x7b40
movq -0x118(%rbp), %rdi
movq %rax, -0x110(%rbp)
callq 0x7b60
movq -0x110(%rbp), %rsi
movq %rax, %rdx
leaq -0x60(%rbp), %rdi
callq 0x7af0
jmp 0x4e71
callq 0x53f0
movsd %xmm0, -0x120(%rbp)
jmp 0x4e80
movsd -0x120(%rbp), %xmm1
movsd -0xe8(%rbp), %xmm0
subsd %xmm0, %xmm1
movsd -0xd0(%rbp), %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0xd0(%rbp)
leaq -0x60(%rbp), %rdi
leaq -0x98(%rbp), %rsi
callq 0x7b80
jmp 0x4eba
callq 0x53f0
movsd %xmm0, -0x128(%rbp)
jmp 0x4ec9
movsd -0x128(%rbp), %xmm0
movsd %xmm0, -0xe8(%rbp)
xorl %eax, %eax
movl %eax, %esi
leaq -0xc0(%rbp), %rdi
movq %rdi, -0x138(%rbp)
callq 0x7b40
movq -0x138(%rbp), %rdi
movq %rax, -0x130(%rbp)
callq 0x7b60
movq -0x130(%rbp), %rsi
movq %rax, %rdx
leaq -0x98(%rbp), %rdi
callq 0x7cb0
jmp 0x4f1b
callq 0x53f0
movsd %xmm0, -0x140(%rbp)
jmp 0x4f2a
movsd -0x140(%rbp), %xmm0
subsd -0xe8(%rbp), %xmm0
addsd -0xd8(%rbp), %xmm0
movsd %xmm0, -0xd8(%rbp)
movq -0xe0(%rbp), %rax
addq $0x1, %rax
movq %rax, -0xe0(%rbp)
jmp 0x4e02
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xa0(%rbp)
movl %eax, -0xa4(%rbp)
jmp 0x5035
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xa0(%rbp)
movl %eax, -0xa4(%rbp)
jmp 0x5029
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xa0(%rbp)
movl %eax, -0xa4(%rbp)
leaq -0xc2(%rbp), %rdi
callq 0x7ad0
jmp 0x5029
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xa0(%rbp)
movl %eax, -0xa4(%rbp)
leaq -0xc0(%rbp), %rdi
callq 0x7da0
jmp 0x5029
movq -0x8(%rbp), %rdi
addq $0x8, %rdi
movsd -0xd0(%rbp), %xmm0
movl $0x5, %esi
callq 0x7d40
movq -0x8(%rbp), %rdi
movsd -0xd8(%rbp), %xmm0
movl $0x5, %esi
callq 0x7d40
leaq -0xc0(%rbp), %rdi
callq 0x7da0
leaq -0x98(%rbp), %rdi
callq 0x6770
leaq -0x60(%rbp), %rdi
callq 0x6770
addq $0x140, %rsp            # imm = 0x140
popq %rbp
retq
leaq -0x98(%rbp), %rdi
callq 0x6770
leaq -0x60(%rbp), %rdi
callq 0x6770
movq -0xa0(%rbp), %rdi
callq 0x3590
nopw (%rax,%rax)