// File: /workspace/github_cpp_makefile_star2_O1/dustin[P]kvtest/tests.cc
// Function: WriteTest::run(kvtest::KVStore*)
bool WriteTest::run(KVStore *tut) {
    int i = 0;
    setup_alarm(5);
    CountingCallback cb;
    time_t start = time(NULL);

    for(i = 0 ; !alarmed; i++) {
        std::stringstream kStream;
        std::stringstream vStream;
        kStream << "testKey" << i;
        vStream << "testValue" << i;

        std::string key = kStream.str();
        std::string value = vStream.str();

        tut->set(key, value, cb);
    }

    // Last one to wait for a commit.
    RememberingCallback<bool> cbLast;
    tut->noop(cbLast);
    cbLast.waitForValue();
    time_t end = time(NULL);

    assertEquals(i, cb.num_calls());

    int delta = (int)(end - start);
    std::cout << "Ran " << i << " operations in "
              << delta << "s ("
              << (i/delta) << " ops/s)"
              << std::endl;
    return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x3a8, %rsp            # imm = 0x3A8
movq %rsi, %r12
movq %rdi, 0x10(%rsp)
leaq 0x710(%rip), %rax       # 0x5382
leaq 0x98(%rsp), %r14
movq %rax, (%r14)
movl $0x0, 0x88(%r14)
xorl %ebx, %ebx
movl $0xe, %edi
movq %r14, %rsi
xorl %edx, %edx
callq 0x3310
movb $0x0, 0x85b3(%rip)      # 0xd253
movl $0x5, %edi
callq 0x3420
leaq 0x60(%rsp), %rdi
callq 0x5910
xorl %edi, %edi
callq 0x3230
movq %rax, 0x8(%rsp)
cmpb $0x0, 0x858c(%rip)      # 0xd253
jne 0x4e0c
movq %r14, %rdi
movl $0x80, %r15d
leaq 0x220(%rsp), %rax
addq %r15, %rax
movq %rax, 0x18(%rsp)
addq %r14, %r15
xorl %ebx, %ebx
leaq 0x40(%rsp), %r13
movq 0x82a9(%rip), %rbp      # 0xcfa0
movq %rdi, %r14
callq 0x31a0
leaq 0x220(%rsp), %rdi
callq 0x31a0
movl $0x7, %edx
leaq 0xa8(%rsp), %rdi
leaq 0x441a(%rip), %rsi      # 0x913a
callq 0x32a0
leaq 0xa8(%rsp), %rdi
movl %ebx, %esi
callq 0x33d0
movl $0x9, %edx
leaq 0x230(%rsp), %rdi
leaq 0x43fa(%rip), %rsi      # 0x9142
callq 0x32a0
leaq 0x230(%rsp), %rdi
movl %ebx, %esi
callq 0x33d0
leaq 0x20(%rsp), %rdi
leaq 0xb0(%rsp), %rsi
callq 0x3380
movq %r13, %rdi
leaq 0x238(%rsp), %rsi
callq 0x3380
movq (%r12), %rax
movq %r12, %rdi
leaq 0x20(%rsp), %rsi
movq %r13, %rdx
leaq 0x60(%rsp), %rcx
callq *0x20(%rax)
movq 0x40(%rsp), %rdi
leaq 0x50(%rsp), %rax
cmpq %rax, %rdi
je 0x4db1
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x3280
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0x4dcd
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x3280
leaq 0x220(%rsp), %rdi
movq %rbp, %rsi
callq 0x31d0
movq 0x18(%rsp), %rdi
callq 0x3090
movq %r14, %rdi
movq %rbp, %rsi
callq 0x31d0
movq %r15, %rdi
callq 0x3090
movq %r14, %rdi
incl %ebx
cmpb $0x0, 0x844d(%rip)      # 0xd253
je 0x4cf7
leaq 0x98(%rsp), %rdi
callq 0x538a
movq (%r12), %rax
leaq 0x98(%rsp), %rsi
movq %r12, %rdi
callq *0x18(%rax)
leaq 0x98(%rsp), %rdi
callq 0x5526
xorl %edi, %edi
callq 0x3230
movq %rax, %r14
leaq 0x60(%rsp), %rdi
callq 0x5b0c
movq 0x10(%rsp), %rdi
movl %ebx, %esi
movl %eax, %edx
callq 0x5982
movq 0x8167(%rip), %rdi      # 0xcfc8
leaq 0x42e4(%rip), %rsi      # 0x914c
movl $0x4, %edx
callq 0x32a0
movq 0x814f(%rip), %rdi      # 0xcfc8
movl %ebx, %esi
callq 0x33d0
movq %rax, %r15
leaq 0x42c7(%rip), %rsi      # 0x9151
movl $0xf, %edx
movq %rax, %rdi
callq 0x32a0
subl 0x8(%rsp), %r14d
movq %r15, %rdi
movl %r14d, %esi
callq 0x33d0
movq %rax, %r15
leaq 0x42b0(%rip), %rsi      # 0x9161
movl $0x3, %edx
movq %rax, %rdi
callq 0x32a0
movl %ebx, %eax
cltd
idivl %r14d
movq %r15, %rdi
movl %eax, %esi
callq 0x33d0
movq %rax, %rbx
leaq 0x428d(%rip), %rsi      # 0x9165
movl $0x7, %edx
movq %rax, %rdi
callq 0x32a0
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x3250
movsbl %al, %esi
movq %rbx, %rdi
callq 0x3040
movq %rax, %rdi
callq 0x3180
leaq 0x7d6d(%rip), %rax      # 0xcc80
leaq 0xa8(%rsp), %rdi
movq %rax, -0x10(%rdi)
callq 0x32c0
leaq 0xd0(%rsp), %rdi
callq 0x3430
leaq 0x7cf8(%rip), %rax      # 0xcc30
leaq 0x70(%rsp), %rdi
movq %rax, -0x10(%rdi)
callq 0x32c0
movb $0x1, %al
addq $0x3a8, %rsp            # imm = 0x3A8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x4f8d
jmp 0x4f60
jmp 0x4f60
movq %rax, %rbx
leaq 0x7d16(%rip), %rax      # 0xcc80
leaq 0xa8(%rsp), %rdi
movq %rax, -0x10(%rdi)
callq 0x32c0
leaq 0xd0(%rsp), %rdi
callq 0x3430
jmp 0x5023
movq %rax, %rbx
jmp 0x5023
movq %rax, %rbx
jmp 0x5002
jmp 0x4fde
movq %rax, %rbx
jmp 0x4fc0
movq %rax, %rbx
movq 0x40(%rsp), %rdi
leaq 0x50(%rsp), %rax
cmpq %rax, %rdi
je 0x4fc0
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x3280
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0x4fe1
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x3280
jmp 0x4fe1
movq %rax, %rbx
movq 0x7fb8(%rip), %rsi      # 0xcfa0
leaq 0x220(%rsp), %rdi
callq 0x31d0
leaq 0x2a0(%rsp), %rdi
callq 0x3090
movq 0x7f97(%rip), %rsi      # 0xcfa0
leaq 0x98(%rsp), %rdi
callq 0x31d0
leaq 0x118(%rsp), %rdi
callq 0x3090
leaq 0x7c06(%rip), %rax      # 0xcc30
leaq 0x70(%rsp), %rdi
movq %rax, -0x10(%rdi)
callq 0x32c0
movq %rbx, %rdi
callq 0x33e0