// File: /workspace/github_cpp_makefile_star2_O3/yangwanyuan[P]HLKVDS/tools/Benchmark.cc
// Function: fun_get(void*)
void* fun_get(void *arg) {
    thread_arg *t_args = (thread_arg*) arg;
    KVDS *db = t_args->db;
    int key_start = t_args->key_start;
    int key_end = t_args->key_end;
    vector<string> &key_list = *t_args->key_list;
    uint64_t *latency = t_args->latency;

    string *value = t_args->data;
    int key_len = KEY_SIZE;
    Status s;

    for (int i = key_start; i < key_end + 1; i++) {
        string key = key_list[i];
        string get_data;
        KVTime tv_start;
        s = db->Get(key.c_str() ,key_len, get_data);
        KVTime tv_end;
        latency[i - key_start] = (uint64_t)(tv_end - tv_start);

        if (!s.ok()) {
            cout << "Get key = " << key << "from DB failed!" << endl;
        }
        if (strcmp(get_data.c_str(), value->c_str()) != 0) {
            cout << "Get key=" << key << "Inconsistent! " << endl;
            cout << "Value size = " << get_data.length() << endl;
            cout << "value = " << get_data << endl;
        }
    }
    return NULL;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movslq 0x8(%rdi), %rax
movl 0xc(%rdi), %edx
cmpl %edx, %eax
jg 0xab0e
movq %rdx, %rcx
movq (%rdi), %rdx
movq %rdx, 0x58(%rsp)
movq 0x10(%rdi), %rdx
movq %rdx, 0x60(%rsp)
movq 0x20(%rdi), %rdx
movq %rdx, 0x50(%rsp)
movq 0x18(%rdi), %rdx
movq %rdx, 0x48(%rsp)
movq %rax, %rbx
shlq $0x5, %rbx
subl %eax, %ecx
incl %ecx
movq %rcx, 0x40(%rsp)
xorl %r13d, %r13d
leaq 0x78(%rsp), %r15
leaq 0x68(%rsp), %r12
movq 0x2c70d(%rip), %rbp     # 0x36fd0
movq 0x60(%rsp), %rax
movq (%rax), %rax
leaq 0x30(%rsp), %rcx
movq %rcx, 0x20(%rsp)
movq (%rax,%rbx), %rsi
movq 0x8(%rax,%rbx), %rdx
addq %rsi, %rdx
leaq 0x20(%rsp), %rdi
callq 0xcb08
leaq 0x10(%rsp), %rax
movq %rax, (%rsp)
movq $0x0, 0x8(%rsp)
movb $0x0, 0x10(%rsp)
movq %r15, %rdi
callq 0x22e38
movq 0x20(%rsp), %rdx
movq %r12, %rdi
movq 0x58(%rsp), %rsi
movl $0xa, %ecx
movq %rsp, %r8
callq 0x165ae
movl 0x68(%rsp), %r14d
movq %r12, %rdi
callq 0x22e38
movq %r12, %rdi
movq %r15, %rsi
callq 0x22ea4
movq 0x50(%rsp), %rcx
movq %rax, (%rcx,%r13,8)
testl %r14d, %r14d
je 0xa9ae
movl $0xa, %edx
movq %rbp, %rdi
leaq 0x19967(%rip), %rsi     # 0x242c0
callq 0x6490
movq 0x20(%rsp), %rsi
movq 0x28(%rsp), %rdx
movq %rbp, %rdi
callq 0x6490
movq %rax, %r14
movl $0xf, %edx
movq %rax, %rdi
leaq 0x19949(%rip), %rsi     # 0x242cb
callq 0x6490
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x6440
movsbl %al, %esi
movq %r14, %rdi
callq 0x6050
movq %rax, %rdi
callq 0x62f0
movq (%rsp), %rdi
movq 0x48(%rsp), %rax
movq (%rax), %rsi
callq 0x6580
testl %eax, %eax
je 0xaac5
movl $0x8, %edx
movq %rbp, %rdi
leaq 0x19905(%rip), %rsi     # 0x242db
callq 0x6490
movq 0x20(%rsp), %rsi
movq 0x28(%rsp), %rdx
movq %rbp, %rdi
callq 0x6490
movq %rax, %r14
movl $0xe, %edx
movq %rax, %rdi
leaq 0x198e5(%rip), %rsi     # 0x242e4
callq 0x6490
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x6440
movsbl %al, %esi
movq %r14, %rdi
callq 0x6050
movq %rax, %rdi
callq 0x62f0
movl $0xd, %edx
movq %rbp, %rdi
leaq 0x198b9(%rip), %rsi     # 0x242f3
callq 0x6490
movq 0x8(%rsp), %rsi
movq %rbp, %rdi
callq 0x62e0
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x6440
movsbl %al, %esi
movq %r14, %rdi
callq 0x6050
movq %rax, %rdi
callq 0x62f0
movl $0x8, %edx
movq %rbp, %rdi
leaq 0x1987c(%rip), %rsi     # 0x24301
callq 0x6490
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
movq %rbp, %rdi
callq 0x6490
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x6440
movsbl %al, %esi
movq %r14, %rdi
callq 0x6050
movq %rax, %rdi
callq 0x62f0
movq %r12, %rdi
callq 0x22ebe
movq %r15, %rdi
callq 0x22ebe
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0xaae8
callq 0x6430
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0xaafc
callq 0x6430
incq %r13
addq $0x20, %rbx
cmpl %r13d, 0x40(%rsp)
jne 0xa8c3
xorl %eax, %eax
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0xab45
jmp 0xab29
movq %rax, %rbx
jmp 0xab3b
movq %rax, %rbx
leaq 0x68(%rsp), %rdi
callq 0x22ebe
leaq 0x78(%rsp), %rdi
callq 0x22ebe
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0xab58
callq 0x6430
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0xab6c
callq 0x6430
movq %rbx, %rdi
callq 0x6710