// File: dustin[P]kvtest/tests.cc
// Function: TestTest::run(kvtest::KVStore*)
bool TestTest::run(KVStore *tut) {
    string testKey("some key");
    string testValue("some value");

    RememberingCallback<bool> cb;
    assertFalse(cb.fired, "Expected callback to not have fired");
    tut->set(testKey, testValue, cb);
    cb.waitForValue();
    assertTrue(cb.fired, "Expected callback to have fired.");
    assertTrue(cb.val, string("Failed to set value."));

    RememberingCallback<GetValue> getCb;
    assertFalse(getCb.fired, "Expected callback to not have fired");
    tut->get(testKey, getCb);
    getCb.waitForValue();
    assertTrue(getCb.val.success, "Expected success getting initial value");
    assertEquals(getCb.val.value, testValue);

    RememberingCallback<bool> delCb1;
    tut->del(testKey, delCb1);
    delCb1.waitForValue();
    assertTrue(delCb1.val,  string("Failed to delete value."));

    RememberingCallback<bool> delCb2;
    tut->del(testKey, delCb2);
    delCb2.waitForValue();
    assertFalse(delCb2.val, string("Doubly deleted value"));

    RememberingCallback<GetValue> getCb2;
    tut->get(testKey, getCb2);
    getCb2.waitForValue();
    assertFalse(getCb2.val.success, "Expected failure getting final value.");

    return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x4e0, %rsp            # imm = 0x4E0
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x458(%rbp)
leaq -0x31(%rbp), %rdi
movq %rdi, -0x450(%rbp)
callq 0x3460
movq -0x450(%rbp), %rdx
leaq 0x83d6(%rip), %rsi      # 0xe052
leaq -0x30(%rbp), %rdi
callq 0x5140
jmp 0x5c87
leaq -0x31(%rbp), %rdi
callq 0x32e0
leaq -0x69(%rbp), %rdi
movq %rdi, -0x460(%rbp)
callq 0x3460
movq -0x460(%rbp), %rdx
leaq 0x83ad(%rip), %rsi      # 0xe05b
leaq -0x68(%rbp), %rdi
callq 0x5140
jmp 0x5cb9
leaq -0x69(%rbp), %rdi
callq 0x32e0
leaq -0xd8(%rbp), %rdi
callq 0x6d50
jmp 0x5cd0
movb -0xcf(%rbp), %al
movb %al, -0x469(%rbp)
leaq -0xf9(%rbp), %rdi
movq %rdi, -0x468(%rbp)
callq 0x3460
movq -0x468(%rbp), %rdx
leaq 0x8369(%rip), %rsi      # 0xe066
leaq -0xf8(%rbp), %rdi
callq 0x5140
jmp 0x5d0b
movq -0x458(%rbp), %rdi
movb -0x469(%rbp), %al
movzbl %al, %esi
andl $0x1, %esi
leaq -0xf8(%rbp), %rdx
callq 0x6e80
jmp 0x5d2c
leaq -0xf8(%rbp), %rdi
callq 0x3160
leaq -0xf9(%rbp), %rdi
callq 0x32e0
movq -0x10(%rbp), %rdi
movq (%rdi), %rax
movq 0x20(%rax), %rax
leaq -0x30(%rbp), %rsi
leaq -0x68(%rbp), %rdx
leaq -0xd8(%rbp), %rcx
callq *%rax
jmp 0x5d62
leaq -0xd8(%rbp), %rdi
callq 0x6f10
jmp 0x5d70
movb -0xcf(%rbp), %al
movb %al, -0x479(%rbp)
leaq -0x121(%rbp), %rdi
movq %rdi, -0x478(%rbp)
callq 0x3460
movq -0x478(%rbp), %rdx
leaq 0x82ed(%rip), %rsi      # 0xe08a
leaq -0x120(%rbp), %rdi
callq 0x5140
jmp 0x5dab
movq -0x458(%rbp), %rdi
movb -0x479(%rbp), %al
movzbl %al, %esi
andl $0x1, %esi
leaq -0x120(%rbp), %rdx
callq 0x7010
jmp 0x5dcc
leaq -0x120(%rbp), %rdi
callq 0x3160
leaq -0x121(%rbp), %rdi
callq 0x32e0
movb -0xd0(%rbp), %al
movb %al, -0x489(%rbp)
leaq -0x149(%rbp), %rdi
movq %rdi, -0x488(%rbp)
callq 0x3460
movq -0x488(%rbp), %rdx
leaq 0x829a(%rip), %rsi      # 0xe0ab
leaq -0x148(%rbp), %rdi
callq 0x5140
jmp 0x5e1f
movq -0x458(%rbp), %rdi
movb -0x489(%rbp), %al
movzbl %al, %esi
andl $0x1, %esi
leaq -0x148(%rbp), %rdx
callq 0x7010
jmp 0x5e40
leaq -0x148(%rbp), %rdi
callq 0x3160
leaq -0x149(%rbp), %rdi
callq 0x32e0
leaq -0x1e0(%rbp), %rdi
callq 0x70d0
jmp 0x5e66
movb -0x1b0(%rbp), %al
movb %al, -0x499(%rbp)
leaq -0x201(%rbp), %rdi
movq %rdi, -0x498(%rbp)
callq 0x3460
movq -0x498(%rbp), %rdx
leaq 0x81d3(%rip), %rsi      # 0xe066
leaq -0x200(%rbp), %rdi
callq 0x5140
jmp 0x5ea1
movq -0x458(%rbp), %rdi
movb -0x499(%rbp), %al
movzbl %al, %esi
andl $0x1, %esi
leaq -0x200(%rbp), %rdx
callq 0x6e80
jmp 0x5ec2
leaq -0x200(%rbp), %rdi
callq 0x3160
leaq -0x201(%rbp), %rdi
callq 0x32e0
movq -0x10(%rbp), %rdi
movq (%rdi), %rax
movq 0x30(%rax), %rax
leaq -0x30(%rbp), %rsi
leaq -0x1e0(%rbp), %rdx
callq *%rax
jmp 0x5ef4
leaq -0x1e0(%rbp), %rdi
callq 0x7230
jmp 0x5f02
movb -0x1b8(%rbp), %al
movb %al, -0x4a9(%rbp)
leaq -0x229(%rbp), %rdi
movq %rdi, -0x4a8(%rbp)
callq 0x3460
movq -0x4a8(%rbp), %rdx
leaq 0x8191(%rip), %rsi      # 0xe0c0
leaq -0x228(%rbp), %rdi
callq 0x5140
jmp 0x5f3d
movq -0x458(%rbp), %rdi
movb -0x4a9(%rbp), %al
movzbl %al, %esi
andl $0x1, %esi
leaq -0x228(%rbp), %rdx
callq 0x7010
jmp 0x5f5e
leaq -0x228(%rbp), %rdi
callq 0x3160
leaq -0x229(%rbp), %rdi
callq 0x32e0
leaq -0x1d8(%rbp), %rsi
leaq -0x250(%rbp), %rdi
callq 0x30f0
jmp 0x5f8b
leaq -0x270(%rbp), %rdi
leaq -0x68(%rbp), %rsi
callq 0x30f0
jmp 0x5f9d
movq -0x458(%rbp), %rdi
leaq -0x250(%rbp), %rsi
leaq -0x270(%rbp), %rdx
callq 0x7330
jmp 0x5fb9
leaq -0x270(%rbp), %rdi
callq 0x3160
leaq -0x250(%rbp), %rdi
callq 0x3160
leaq -0x2d8(%rbp), %rdi
callq 0x6d50
jmp 0x5fdf
movq -0x10(%rbp), %rdi
movq (%rdi), %rax
movq 0x38(%rax), %rax
leaq -0x30(%rbp), %rsi
leaq -0x2d8(%rbp), %rdx
callq *%rax
jmp 0x5ff9
leaq -0x2d8(%rbp), %rdi
callq 0x6f10
jmp 0x6007
movb -0x2d0(%rbp), %al
movb %al, -0x4b9(%rbp)
leaq -0x2f9(%rbp), %rdi
movq %rdi, -0x4b8(%rbp)
callq 0x3460
movq -0x4b8(%rbp), %rdx
leaq 0x80b3(%rip), %rsi      # 0xe0e7
leaq -0x2f8(%rbp), %rdi
callq 0x5140
jmp 0x6042
movq -0x458(%rbp), %rdi
movb -0x4b9(%rbp), %al
movzbl %al, %esi
andl $0x1, %esi
leaq -0x2f8(%rbp), %rdx
callq 0x7010
jmp 0x6063
leaq -0x2f8(%rbp), %rdi
callq 0x3160
leaq -0x2f9(%rbp), %rdi
callq 0x32e0
leaq -0x368(%rbp), %rdi
callq 0x6d50
jmp 0x6089
movq -0x10(%rbp), %rdi
movq (%rdi), %rax
movq 0x38(%rax), %rax
leaq -0x30(%rbp), %rsi
leaq -0x368(%rbp), %rdx
callq *%rax
jmp 0x60a3
leaq -0x368(%rbp), %rdi
callq 0x6f10
jmp 0x60b1
movb -0x360(%rbp), %al
movb %al, -0x4c9(%rbp)
leaq -0x389(%rbp), %rdi
movq %rdi, -0x4c8(%rbp)
callq 0x3460
movq -0x4c8(%rbp), %rdx
leaq 0x8021(%rip), %rsi      # 0xe0ff
leaq -0x388(%rbp), %rdi
callq 0x5140
jmp 0x60ec
movq -0x458(%rbp), %rdi
movb -0x4c9(%rbp), %al
movzbl %al, %esi
andl $0x1, %esi
leaq -0x388(%rbp), %rdx
callq 0x6e80
jmp 0x610d
leaq -0x388(%rbp), %rdi
callq 0x3160
leaq -0x389(%rbp), %rdi
callq 0x32e0
leaq -0x420(%rbp), %rdi
callq 0x70d0
jmp 0x6133
movq -0x10(%rbp), %rdi
movq (%rdi), %rax
movq 0x30(%rax), %rax
leaq -0x30(%rbp), %rsi
leaq -0x420(%rbp), %rdx
callq *%rax
jmp 0x614d
leaq -0x420(%rbp), %rdi
callq 0x7230
jmp 0x615b
movb -0x3f8(%rbp), %al
movb %al, -0x4d9(%rbp)
leaq -0x441(%rbp), %rdi
movq %rdi, -0x4d8(%rbp)
callq 0x3460
movq -0x4d8(%rbp), %rdx
leaq 0x7f8c(%rip), %rsi      # 0xe114
leaq -0x440(%rbp), %rdi
callq 0x5140
jmp 0x6196
movq -0x458(%rbp), %rdi
movb -0x4d9(%rbp), %al
movzbl %al, %esi
andl $0x1, %esi
leaq -0x440(%rbp), %rdx
callq 0x6e80
jmp 0x61b7
leaq -0x440(%rbp), %rdi
callq 0x3160
leaq -0x441(%rbp), %rdi
callq 0x32e0
leaq -0x420(%rbp), %rdi
callq 0x7400
leaq -0x368(%rbp), %rdi
callq 0x7460
leaq -0x2d8(%rbp), %rdi
callq 0x7460
leaq -0x1e0(%rbp), %rdi
callq 0x7400
leaq -0xd8(%rbp), %rdi
callq 0x7460
leaq -0x68(%rbp), %rdi
callq 0x3160
leaq -0x30(%rbp), %rdi
callq 0x3160
movb $0x1, %al
andb $0x1, %al
addq $0x4e0, %rsp            # imm = 0x4E0
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x31(%rbp), %rdi
callq 0x32e0
jmp 0x64f6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x69(%rbp), %rdi
callq 0x32e0
jmp 0x64ed
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x64e4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x6295
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0xf8(%rbp), %rdi
callq 0x3160
leaq -0xf9(%rbp), %rdi
callq 0x32e0
jmp 0x64d8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x64d8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x62dd
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x120(%rbp), %rdi
callq 0x3160
leaq -0x121(%rbp), %rdi
callq 0x32e0
jmp 0x64d8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x6314
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x148(%rbp), %rdi
callq 0x3160
leaq -0x149(%rbp), %rdi
callq 0x32e0
jmp 0x64d8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x634b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x200(%rbp), %rdi
callq 0x3160
leaq -0x201(%rbp), %rdi
callq 0x32e0
jmp 0x64cc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x64cc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x6393
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x228(%rbp), %rdi
callq 0x3160
leaq -0x229(%rbp), %rdi
callq 0x32e0
jmp 0x64cc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x63ca
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x270(%rbp), %rdi
callq 0x3160
leaq -0x250(%rbp), %rdi
callq 0x3160
jmp 0x64cc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x64c0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x6412
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x2f8(%rbp), %rdi
callq 0x3160
leaq -0x2f9(%rbp), %rdi
callq 0x32e0
jmp 0x64c0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x64b4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x645a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x388(%rbp), %rdi
callq 0x3160
leaq -0x389(%rbp), %rdi
callq 0x32e0
jmp 0x64b4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x64a8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x649c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x440(%rbp), %rdi
callq 0x3160
leaq -0x441(%rbp), %rdi
callq 0x32e0
leaq -0x420(%rbp), %rdi
callq 0x7400
leaq -0x368(%rbp), %rdi
callq 0x7460
leaq -0x2d8(%rbp), %rdi
callq 0x7460
leaq -0x1e0(%rbp), %rdi
callq 0x7400
leaq -0xd8(%rbp), %rdi
callq 0x7460
leaq -0x68(%rbp), %rdi
callq 0x3160
leaq -0x30(%rbp), %rdi
callq 0x3160
movq -0x40(%rbp), %rdi
callq 0x3450
nop