// File: /workspace/github_cpp_makefile_star2_O2/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
movq (%rdi), %rax
movq %rax, 0x30(%rsp)
movq 0x10(%rdi), %rax
movq %rax, 0x38(%rsp)
movslq 0x8(%rdi), %r13
movslq 0xc(%rdi), %rax
movq %rax, 0x40(%rsp)
movq 0x20(%rdi), %rbp
movq 0x18(%rdi), %rax
movq %rax, 0x28(%rsp)
movq %r13, %rbx
shlq $0x5, %rbx
leaq 0x68(%rsp), %r14
leaq 0x58(%rsp), %r12
cmpq 0x40(%rsp), %r13
jg 0x761d
movq 0x38(%rsp), %rax
movq (%rax), %rsi
addq %rbx, %rsi
movq %r14, %rdi
callq 0x6560
leaq 0x18(%rsp), %rax
movq %rax, 0x8(%rsp)
andq $0x0, 0x10(%rsp)
movb $0x0, 0x18(%rsp)
leaq 0x48(%rsp), %rdi
callq 0x1f856
movq 0x68(%rsp), %rdx
movq %r12, %rdi
movq 0x30(%rsp), %rsi
pushq $0xa
popq %rcx
leaq 0x8(%rsp), %r8
callq 0x132b0
movl 0x58(%rsp), %r15d
movq %r12, %rdi
callq 0x1f856
movq %r12, %rdi
leaq 0x48(%rsp), %rsi
callq 0x1f8c2
movq %rax, (%rbp)
testl %r15d, %r15d
je 0x754a
movq 0x2cab4(%rip), %rdi     # 0x33fd0
leaq 0x18d9f(%rip), %rsi     # 0x202c2
callq 0x6420
movq %rax, %rdi
movq %r14, %rsi
callq 0x63d0
movq %rax, %rdi
leaq 0x18d90(%rip), %rsi     # 0x202cd
callq 0x6420
movq %rax, %rdi
callq 0x61c0
movq 0x8(%rsp), %rdi
movq 0x28(%rsp), %rax
movq (%rax), %rsi
callq 0x6570
testl %eax, %eax
je 0x75e9
movq 0x2ca65(%rip), %rdi     # 0x33fd0
leaq 0x18d6b(%rip), %rsi     # 0x202dd
callq 0x6420
movq %rax, %rdi
movq %r14, %rsi
callq 0x63d0
movq %rax, %rdi
leaq 0x18d5a(%rip), %rsi     # 0x202e6
callq 0x6420
movq %rax, %rdi
callq 0x61c0
movq 0x2ca30(%rip), %rdi     # 0x33fd0
leaq 0x18d4e(%rip), %rsi     # 0x202f5
callq 0x6420
movq 0x10(%rsp), %rsi
movq %rax, %rdi
callq 0x62c0
movq %rax, %rdi
callq 0x61c0
movq 0x2ca08(%rip), %rdi     # 0x33fd0
leaq 0x18d34(%rip), %rsi     # 0x20303
callq 0x6420
movq %rax, %rdi
leaq 0x8(%rsp), %rsi
callq 0x63d0
movq %rax, %rdi
callq 0x61c0
movq %r12, %rdi
callq 0x1f8dc
leaq 0x48(%rsp), %rdi
callq 0x1f8dc
leaq 0x8(%rsp), %rdi
callq 0x67f8
movq %r14, %rdi
callq 0x67f8
incq %r13
addq $0x20, %rbx
addq $0x8, %rbp
jmp 0x749b
xorl %eax, %eax
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0x7654
jmp 0x7638
movq %rax, %rbx
jmp 0x764a
movq %rax, %rbx
leaq 0x58(%rsp), %rdi
callq 0x1f8dc
leaq 0x48(%rsp), %rdi
callq 0x1f8dc
leaq 0x8(%rsp), %rdi
callq 0x67f8
leaq 0x68(%rsp), %rdi
callq 0x67f8
movq %rbx, %rdi
callq 0x66f0