// File: ctz[P]openssl-bench/bench.cc
// Function: print_results(char const*, char const*, std::vector<Timings, std::allocator<Timings>> const&, double, char const*)
static void print_results(const char *server, const char *client,
                          const std::vector<Timings> &thread_timings,
                          const double thread_work, const char *units) {
  const size_t n_threads = thread_timings.size();
  if (n_threads > 1) {
    printf("%s\tthreads\t%zu\t", server, n_threads);
    double total_server = 0.;

    for (unsigned i = 0; i < n_threads; i++) {
      const double server = thread_work / thread_timings[i].server.load();
      total_server += server;
      printf("%g\t", server);
    }
    printf("total\t%g\tper-thread\t%g\t%s\n", total_server,
           total_server / n_threads, units);
    printf("%s\tthreads\t%zu\t", client, n_threads);
    double total_client = 0.;

    for (unsigned i = 0; i < n_threads; i++) {
      const double client = thread_work / thread_timings[i].client.load();
      total_client += client;
      printf("%g\t", client);
    }
    printf("total\t%g\tper-thread\t%g\t%s\n", total_client,
           total_client / n_threads, units);
  } else {
    printf("%s\t%g\t%s\n", server,
           thread_work / thread_timings[0].server.load(), units);
    printf("%s\t%g\t%s\n", client,
           thread_work / thread_timings[0].client.load(), units);
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x90, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movsd %xmm0, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq -0x18(%rbp), %rdi
callq 0xad20
movq %rax, -0x30(%rbp)
cmpq $0x1, -0x30(%rbp)
jbe 0x527d
movq -0x8(%rbp), %rsi
movq -0x30(%rbp), %rdx
leaq 0x9375(%rip), %rdi      # 0xe44c
movb $0x0, %al
callq 0x3050
xorps %xmm0, %xmm0
movsd %xmm0, -0x38(%rbp)
movl $0x0, -0x3c(%rbp)
movl -0x3c(%rbp), %eax
cmpq -0x30(%rbp), %rax
jae 0x515d
movsd -0x20(%rbp), %xmm0
movsd %xmm0, -0x68(%rbp)
movq -0x18(%rbp), %rdi
movl -0x3c(%rbp), %eax
movl %eax, %esi
callq 0xad40
movq %rax, %rdi
addq $0x8, %rdi
movl $0x5, %esi
callq 0xad60
movaps %xmm0, %xmm1
movsd -0x68(%rbp), %xmm0
divsd %xmm1, %xmm0
movsd %xmm0, -0x48(%rbp)
movsd -0x48(%rbp), %xmm0
addsd -0x38(%rbp), %xmm0
movsd %xmm0, -0x38(%rbp)
movsd -0x48(%rbp), %xmm0
leaq 0x9311(%rip), %rdi      # 0xe45c
movb $0x1, %al
callq 0x3050
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
jmp 0x50ed
movsd -0x38(%rbp), %xmm1
movaps %xmm1, %xmm0
movaps 0x8ea4(%rip), %xmm3     # 0xe010
movq -0x30(%rbp), %xmm2
punpckldq %xmm3, %xmm2    # xmm2 = xmm2[0],xmm3[0],xmm2[1],xmm3[1]
movapd 0x8ea3(%rip), %xmm3     # 0xe020
subpd %xmm3, %xmm2
movaps %xmm2, %xmm3
unpckhpd %xmm2, %xmm2            # xmm2 = xmm2[1,1]
addsd %xmm3, %xmm2
divsd %xmm2, %xmm1
movq -0x28(%rbp), %rsi
leaq 0x92c5(%rip), %rdi      # 0xe460
movb $0x2, %al
callq 0x3050
movq -0x10(%rbp), %rsi
movq -0x30(%rbp), %rdx
leaq 0x929b(%rip), %rdi      # 0xe44c
movb $0x0, %al
callq 0x3050
xorps %xmm0, %xmm0
movsd %xmm0, -0x50(%rbp)
movl $0x0, -0x54(%rbp)
movl -0x54(%rbp), %eax
cmpq -0x30(%rbp), %rax
jae 0x5233
movsd -0x20(%rbp), %xmm0
movsd %xmm0, -0x70(%rbp)
movq -0x18(%rbp), %rdi
movl -0x54(%rbp), %eax
movl %eax, %esi
callq 0xad40
movq %rax, %rdi
movl $0x5, %esi
callq 0xad60
movaps %xmm0, %xmm1
movsd -0x70(%rbp), %xmm0
divsd %xmm1, %xmm0
movsd %xmm0, -0x60(%rbp)
movsd -0x60(%rbp), %xmm0
addsd -0x50(%rbp), %xmm0
movsd %xmm0, -0x50(%rbp)
movsd -0x60(%rbp), %xmm0
leaq 0x923b(%rip), %rdi      # 0xe45c
movb $0x1, %al
callq 0x3050
movl -0x54(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x54(%rbp)
jmp 0x51c7
movsd -0x50(%rbp), %xmm1
movaps %xmm1, %xmm0
movaps 0x8dce(%rip), %xmm3     # 0xe010
movq -0x30(%rbp), %xmm2
punpckldq %xmm3, %xmm2    # xmm2 = xmm2[0],xmm3[0],xmm2[1],xmm3[1]
movapd 0x8dcd(%rip), %xmm3     # 0xe020
subpd %xmm3, %xmm2
movaps %xmm2, %xmm3
unpckhpd %xmm2, %xmm2            # xmm2 = xmm2[1,1]
addsd %xmm3, %xmm2
divsd %xmm2, %xmm1
movq -0x28(%rbp), %rsi
leaq 0x91ef(%rip), %rdi      # 0xe460
movb $0x2, %al
callq 0x3050
jmp 0x5329
movq -0x8(%rbp), %rax
movq %rax, -0x90(%rbp)
movsd -0x20(%rbp), %xmm0
movsd %xmm0, -0x88(%rbp)
movq -0x18(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0xad40
movq %rax, %rdi
addq $0x8, %rdi
movl $0x5, %esi
callq 0xad60
movq -0x90(%rbp), %rsi
movaps %xmm0, %xmm1
movsd -0x88(%rbp), %xmm0
divsd %xmm1, %xmm0
movq -0x28(%rbp), %rdx
leaq 0x91a7(%rip), %rdi      # 0xe47b
movb $0x1, %al
callq 0x3050
movq -0x10(%rbp), %rax
movq %rax, -0x80(%rbp)
movsd -0x20(%rbp), %xmm0
movsd %xmm0, -0x78(%rbp)
movq -0x18(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0xad40
movq %rax, %rdi
movl $0x5, %esi
callq 0xad60
movq -0x80(%rbp), %rsi
movaps %xmm0, %xmm1
movsd -0x78(%rbp), %xmm0
divsd %xmm1, %xmm0
movq -0x28(%rbp), %rdx
leaq 0x9159(%rip), %rdi      # 0xe47b
movb $0x1, %al
callq 0x3050
addq $0x90, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)