// File: /workspace/github_cpp_makefile_star2_O3/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, %rbp
movq %rdi, 0x18(%rsp)
leaq 0x70e(%rip), %rax       # 0x535c
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, 0x75d7(%rip)      # 0xc253
movl $0x5, %edi
callq 0x3420
leaq 0x60(%rsp), %rdi
callq 0x58d4
xorl %edi, %edi
callq 0x3230
movq %rax, 0x10(%rsp)
cmpb $0x0, 0x75b0(%rip)      # 0xc253
jne 0x4ded
movq %r14, %rdi
movl $0x80, %eax
leaq 0x220(%rsp), %rcx
addq %rax, %rcx
movq %rcx, (%rsp)
addq %r14, %rax
movq %rax, 0x8(%rsp)
xorl %ebx, %ebx
leaq 0x40(%rsp), %r14
leaq 0x20(%rsp), %r15
movq 0x72c5(%rip), %r13      # 0xbfa0
movq %rdi, %r12
callq 0x31a0
leaq 0x220(%rsp), %rdi
callq 0x31a0
movl $0x7, %edx
leaq 0xa8(%rsp), %rdi
leaq 0x3436(%rip), %rsi      # 0x813a
callq 0x32a0
leaq 0xa8(%rsp), %rdi
movl %ebx, %esi
callq 0x33d0
movl $0x9, %edx
leaq 0x230(%rsp), %rdi
leaq 0x3416(%rip), %rsi      # 0x8142
callq 0x32a0
leaq 0x230(%rsp), %rdi
movl %ebx, %esi
callq 0x33d0
movq %r14, %rdi
leaq 0xb0(%rsp), %rsi
callq 0x3380
movq %r15, %rdi
leaq 0x238(%rsp), %rsi
callq 0x3380
movq (%rbp), %rax
movq %rbp, %rdi
movq %r14, %rsi
movq %r15, %rdx
leaq 0x60(%rsp), %rcx
callq *0x20(%rax)
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0x4d91
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x3280
movq 0x40(%rsp), %rdi
leaq 0x50(%rsp), %rax
cmpq %rax, %rdi
je 0x4dad
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x3280
leaq 0x220(%rsp), %rdi
movq %r13, %rsi
callq 0x31d0
movq (%rsp), %rdi
callq 0x3090
movq %r12, %rdi
movq %r13, %rsi
callq 0x31d0
movq 0x8(%rsp), %rdi
callq 0x3090
movq %r12, %rdi
incl %ebx
cmpb $0x0, 0x746c(%rip)      # 0xc253
je 0x4cdb
leaq 0x98(%rsp), %rdi
callq 0x5364
movq (%rbp), %rax
leaq 0x98(%rsp), %rsi
movq %rbp, %rdi
callq *0x18(%rax)
leaq 0x98(%rsp), %rdi
callq 0x54fe
xorl %edi, %edi
callq 0x3230
movq %rax, %r14
leaq 0x60(%rsp), %rdi
callq 0x5ace
movq 0x18(%rsp), %rdi
movl %ebx, %esi
movl %eax, %edx
callq 0x5946
movq 0x7186(%rip), %rdi      # 0xbfc8
leaq 0x3303(%rip), %rsi      # 0x814c
movl $0x4, %edx
callq 0x32a0
movq 0x716e(%rip), %rdi      # 0xbfc8
movl %ebx, %esi
callq 0x33d0
movq %rax, %r15
leaq 0x32e6(%rip), %rsi      # 0x8151
movl $0xf, %edx
movq %rax, %rdi
callq 0x32a0
subl 0x10(%rsp), %r14d
movq %r15, %rdi
movl %r14d, %esi
callq 0x33d0
movq %rax, %r15
leaq 0x32cf(%rip), %rsi      # 0x8161
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 0x32ac(%rip), %rsi      # 0x8165
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 0x6d8c(%rip), %rax      # 0xbc80
leaq 0xa8(%rsp), %rdi
movq %rax, -0x10(%rdi)
callq 0x32c0
leaq 0xd0(%rsp), %rdi
callq 0x3430
leaq 0x6d17(%rip), %rax      # 0xbc30
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 0x4f6e
jmp 0x4f41
jmp 0x4f41
movq %rax, %rbx
leaq 0x6d35(%rip), %rax      # 0xbc80
leaq 0xa8(%rsp), %rdi
movq %rax, -0x10(%rdi)
callq 0x32c0
leaq 0xd0(%rsp), %rdi
callq 0x3430
jmp 0x4ffd
movq %rax, %rbx
jmp 0x4ffd
movq %rax, %rbx
jmp 0x4fdf
jmp 0x4fbf
movq %rax, %rbx
jmp 0x4fa1
movq %rax, %rbx
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0x4fa1
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x3280
movq 0x40(%rsp), %rdi
leaq 0x50(%rsp), %rax
cmpq %rax, %rdi
je 0x4fc2
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x3280
jmp 0x4fc2
movq %rax, %rbx
movq 0x6fd7(%rip), %rsi      # 0xbfa0
leaq 0x220(%rsp), %rdi
callq 0x31d0
movq (%rsp), %rdi
callq 0x3090
movq 0x6fba(%rip), %rsi      # 0xbfa0
leaq 0x98(%rsp), %rdi
callq 0x31d0
movq 0x8(%rsp), %rdi
callq 0x3090
leaq 0x6c2c(%rip), %rax      # 0xbc30
leaq 0x70(%rsp), %rdi
movq %rax, -0x10(%rdi)
callq 0x32c0
movq %rbx, %rdi
callq 0x33e0