// File: dustin[P]kvtest/ep.cc
// Function: kvtest::EventuallyPersistentStore::flushSome(std::queue<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::deque<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>>*, kvtest::Callback<bool>&)
void EventuallyPersistentStore::flushSome(std::queue<std::string> *q,
                                             Callback<bool> &cb) {

        std::string key = q->front();
        q->pop();

        int bucket_num = storage.bucket(key);
        LockHolder lh(storage.getMutex(bucket_num));
        StoredValue *v = storage.unlocked_find(key, bucket_num);

        bool found = v != NULL;
        bool isDirty = (found && v->isDirty());
        const char *val = NULL;
        if (isDirty) {
            v->markClean();
            // Copy it for the duration.
            val = strdup(v->getValue());
        }
        lh.unlock();

        if (found && isDirty) {
            underlying->set(key, val, cb);
        } else if (!found) {
            underlying->del(key, cb);
        }

        free((void*)val);
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xa0, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x78(%rbp)
movq -0x10(%rbp), %rdi
callq 0xb840
movq %rax, %rsi
leaq -0x38(%rbp), %rdi
callq 0x30f0
movq -0x10(%rbp), %rdi
callq 0xb860
jmp 0xad3f
movq -0x78(%rbp), %rdi
addq $0x20, %rdi
leaq -0x38(%rbp), %rsi
callq 0xb3b0
movl %eax, -0x7c(%rbp)
jmp 0xad55
movq -0x78(%rbp), %rdi
movl -0x7c(%rbp), %eax
movl %eax, -0x48(%rbp)
addq $0x20, %rdi
movl -0x48(%rbp), %esi
callq 0xb470
movq %rax, -0x88(%rbp)
jmp 0xad74
movq -0x88(%rbp), %rsi
leaq -0x58(%rbp), %rdi
callq 0x7b50
jmp 0xad86
movq -0x78(%rbp), %rdi
addq $0x20, %rdi
movl -0x48(%rbp), %edx
leaq -0x38(%rbp), %rsi
callq 0xb590
movq %rax, -0x90(%rbp)
jmp 0xada3
movq -0x90(%rbp), %rax
movq %rax, -0x60(%rbp)
cmpq $0x0, -0x60(%rbp)
setne %al
andb $0x1, %al
movb %al, -0x61(%rbp)
xorl %eax, %eax
testb $0x1, -0x61(%rbp)
movb %al, -0x91(%rbp)
je 0xade8
movq -0x60(%rbp), %rdi
callq 0xb880
movb %al, -0x92(%rbp)
jmp 0xadda
movb -0x92(%rbp), %al
movb %al, -0x91(%rbp)
jmp 0xade8
movb -0x91(%rbp), %al
andb $0x1, %al
movb %al, -0x62(%rbp)
movq $0x0, -0x70(%rbp)
testb $0x1, -0x62(%rbp)
je 0xae5b
movq -0x60(%rbp), %rdi
callq 0xb8a0
jmp 0xae0c
movq -0x60(%rbp), %rdi
callq 0xb600
movq %rax, -0xa0(%rbp)
jmp 0xae1e
movq -0xa0(%rbp), %rdi
callq 0x34a0
movq %rax, -0x70(%rbp)
jmp 0xae5b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0xaedc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x58(%rbp), %rdi
callq 0x7bf0
jmp 0xaedc
leaq -0x58(%rbp), %rdi
callq 0x7c20
jmp 0xae66
testb $0x1, -0x61(%rbp)
je 0xae93
testb $0x1, -0x62(%rbp)
je 0xae93
movq -0x78(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x70(%rbp), %rdx
movq -0x18(%rbp), %rcx
movq (%rdi), %rax
movq 0x28(%rax), %rax
leaq -0x38(%rbp), %rsi
callq *%rax
jmp 0xae91
jmp 0xaeb8
testb $0x1, -0x61(%rbp)
jne 0xaeb6
movq -0x78(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x18(%rbp), %rdx
movq (%rdi), %rax
movq 0x38(%rax), %rax
leaq -0x38(%rbp), %rsi
callq *%rax
jmp 0xaeb4
jmp 0xaeb6
jmp 0xaeb8
movq -0x70(%rbp), %rdi
callq 0x3340
leaq -0x58(%rbp), %rdi
callq 0x7bf0
leaq -0x38(%rbp), %rdi
callq 0x3160
addq $0xa0, %rsp
popq %rbp
retq
leaq -0x38(%rbp), %rdi
callq 0x3160
movq -0x40(%rbp), %rdi
callq 0x3450
nop