// File: /workspace/github_cpp_makefile_star2_O3/ctz[P]openssl-bench/bench.cc
// Function: test_memory(Context&, Context&, unsigned long)
static void test_memory(Context &server_ctx, Context &client_ctx,
                        size_t session_count) {
  std::vector<Conn> servers;
  std::vector<Conn> clients;

  session_count /= 2;

  servers.reserve(session_count);
  clients.reserve(session_count);

  for (size_t i = 0; i < session_count; i++) {
    servers.push_back(std::move(server_ctx.open()));
    clients.push_back(std::move(client_ctx.open()));
    clients.back().set_sni("localhost");
  }

  for (size_t s = 0; s < 5; s++) {
    for (size_t i = 0; i < session_count; i++) {
      do_handshake_step(clients[i], servers[i]);
    }
  }

  for (size_t i = 0; i < session_count; i++) {
    uint8_t buf[1024] = {0};
    clients[i].write(buf, sizeof buf);
  }

  for (size_t i = 0; i < session_count; i++) {
    clients[i].transfer_to(servers[i]);
    uint8_t buf[1024];
    servers[i].read(buf, sizeof buf);
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x448, %rsp            # imm = 0x448
movq %rdx, %rbp
movq %rsi, %r15
movq %rdi, %r12
xorps %xmm0, %xmm0
leaq 0x20(%rsp), %rdi
movaps %xmm0, (%rdi)
xorl %eax, %eax
movq %rax, 0x10(%rdi)
movq %rax, 0x10(%rsp)
movaps %xmm0, (%rsp)
movq %rdx, %r14
shrq %r14
movq %r14, %rsi
callq 0x67f8
movq %rsp, %rdi
movq %r14, %rsi
callq 0x67f8
cmpq $0x1, %rbp
jbe 0x462f
leaq 0x40(%rsp), %r13
movq %r14, %rbx
movq (%r12), %rdi
callq 0x32d0
movq %r13, %rdi
movq %rax, %rsi
callq 0x5a14
leaq 0x20(%rsp), %rdi
movq %r13, %rsi
callq 0x6ac2
movq %r13, %rdi
callq 0x5b16
movq (%r15), %rdi
callq 0x32d0
movq %r13, %rdi
movq %rax, %rsi
callq 0x5a14
movq %rsp, %rdi
movq %r13, %rsi
callq 0x6ac2
movq %r13, %rdi
callq 0x5b16
movq 0x8(%rsp), %rdi
addq $-0x38, %rdi
leaq 0x2e1c(%rip), %rsi      # 0x7441
callq 0x620c
decq %rbx
jne 0x45c6
xorl %ebx, %ebx
cmpq $0x2, %rbp
jae 0x4645
incq %rbx
cmpq $0x5, %rbx
jne 0x4631
jmp 0x46ed
xorl %r15d, %r15d
movq %r14, %r12
movq (%rsp), %rdi
addq %r15, %rdi
movq 0x20(%rsp), %rsi
addq %r15, %rsi
callq 0x4c0e
addq $0x38, %r15
decq %r12
jne 0x464b
incq %rbx
cmpq $0x5, %rbx
jne 0x4631
cmpq $0x2, %rbp
jb 0x46ed
xorl %ebx, %ebx
leaq 0x40(%rsp), %r15
movq %r14, %r12
movl $0x400, %edx            # imm = 0x400
movq %r15, %rdi
xorl %esi, %esi
callq 0x31b0
movq (%rsp), %rdi
addq %rbx, %rdi
movl $0x400, %edx            # imm = 0x400
movq %r15, %rsi
callq 0x5daa
addq $0x38, %rbx
decq %r12
jne 0x4681
cmpq $0x2, %rbp
jb 0x46ed
xorl %r15d, %r15d
leaq 0x40(%rsp), %rbx
movq (%rsp), %rdi
addq %r15, %rdi
movq 0x20(%rsp), %rsi
addq %r15, %rsi
callq 0x5dc8
movq 0x20(%rsp), %rdi
addq %r15, %rdi
movl $0x400, %edx            # imm = 0x400
movq %rbx, %rsi
callq 0x5e7e
addq $0x38, %r15
decq %r14
jne 0x46bb
movq %rsp, %rdi
callq 0x68c2
leaq 0x20(%rsp), %rdi
callq 0x68c2
addq $0x448, %rsp            # imm = 0x448
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x4730
jmp 0x4730
jmp 0x4730
jmp 0x4730
jmp 0x471b
movq %rax, %rbx
leaq 0x40(%rsp), %rdi
callq 0x5b16
jmp 0x4733
jmp 0x4730
jmp 0x4730
jmp 0x4730
movq %rax, %rbx
movq %rsp, %rdi
callq 0x68c2
leaq 0x20(%rsp), %rdi
callq 0x68c2
movq %rbx, %rdi
callq 0x34c0