// File: ledbit[P]varint/varint.cpp
// Function: do_codec(codec_descriptor const&, std::vector<unsigned long, std::allocator<unsigned long>> const&)
double do_codec(const codec_descriptor &codec,
                const vector<uint64_t> &numbers) {
  vector<uint64_t> buffer(numbers.size());
  auto encoded = codec.encoder(numbers);

  printf("%s: %.3f bytes/integer.\n", codec.name,
         double(encoded.size()) / numbers.size());
  fflush(stdout);

  double dtime = measure(encoded.data(), buffer, codec.decoder);
  assert(buffer == numbers);

  printf("%s: %.3e secs.\n", codec.name, dtime);

  return dtime;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xc0, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rdi
callq 0x3490
movq %rax, -0x70(%rbp)
leaq -0x29(%rbp), %rdi
movq %rdi, -0x68(%rbp)
callq 0x36a0
movq -0x70(%rbp), %rsi
movq -0x68(%rbp), %rdx
leaq -0x28(%rbp), %rdi
callq 0x36c0
jmp 0x2f00
leaq -0x29(%rbp), %rdi
callq 0x3730
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x10(%rbp), %rsi
leaq -0x58(%rbp), %rdi
callq *%rax
jmp 0x2f1d
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x78(%rbp)
leaq -0x58(%rbp), %rdi
callq 0x1da0
movq %rax, %xmm0
movaps 0x3133(%rip), %xmm1     # 0x6070
movaps %xmm1, -0xa0(%rbp)
punpckldq %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
movapd 0x3130(%rip), %xmm1     # 0x6080
movaps %xmm1, -0x90(%rbp)
subpd %xmm1, %xmm0
movaps %xmm0, %xmm1
unpckhpd %xmm0, %xmm0            # xmm0 = xmm0[1,1]
addsd %xmm1, %xmm0
movsd %xmm0, -0x80(%rbp)
movq -0x10(%rbp), %rdi
callq 0x3490
movaps -0xa0(%rbp), %xmm3
movaps -0x90(%rbp), %xmm2
movsd -0x80(%rbp), %xmm0
movq -0x78(%rbp), %rsi
movq %rax, %xmm1
punpckldq %xmm3, %xmm1    # xmm1 = xmm1[0],xmm3[0],xmm1[1],xmm3[1]
subpd %xmm2, %xmm1
movaps %xmm1, %xmm2
unpckhpd %xmm1, %xmm1            # xmm1 = xmm1[1,1]
addsd %xmm2, %xmm1
divsd %xmm1, %xmm0
leaq 0x30f1(%rip), %rdi      # 0x609f
movb $0x1, %al
callq 0x1030
jmp 0x2fb7
movq 0x7012(%rip), %rax      # 0x9fd0
movq (%rax), %rdi
callq 0x1130
jmp 0x2fc8
leaq -0x58(%rbp), %rdi
callq 0x3750
movq %rax, %rdi
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdx
leaq -0x28(%rbp), %rsi
callq 0x2e00
movsd %xmm0, -0xa8(%rbp)
jmp 0x2fef
movsd -0xa8(%rbp), %xmm0
movsd %xmm0, -0x60(%rbp)
movq -0x10(%rbp), %rsi
leaq -0x28(%rbp), %rdi
callq 0x3770
movb %al, -0xa9(%rbp)
jmp 0x3011
movb -0xa9(%rbp), %al
testb $0x1, %al
jne 0x301d
jmp 0x301f
jmp 0x307a
leaq 0x3092(%rip), %rdi      # 0x60b8
leaq 0x309d(%rip), %rsi      # 0x60ca
movl $0x6d, %edx
leaq 0x309c(%rip), %rcx      # 0x60d5
callq 0x10c0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x29(%rbp), %rdi
callq 0x3730
jmp 0x30cf
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x30c6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x58(%rbp), %rdi
callq 0x15d0
jmp 0x30c6
movq -0x8(%rbp), %rax
movq (%rax), %rsi
movsd -0x60(%rbp), %xmm0
leaq 0x308c(%rip), %rdi      # 0x6119
movb $0x1, %al
callq 0x1030
jmp 0x3096
movsd -0x60(%rbp), %xmm0
movsd %xmm0, -0xb8(%rbp)
leaq -0x58(%rbp), %rdi
callq 0x15d0
leaq -0x28(%rbp), %rdi
callq 0x3510
movsd -0xb8(%rbp), %xmm0
addq $0xc0, %rsp
popq %rbp
retq
leaq -0x28(%rbp), %rdi
callq 0x3510
movq -0x38(%rbp), %rdi
callq 0x1180
nopl (%rax,%rax)