// File: /workspace/github_cpp_makefile_star2_O1/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 0xa988
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 0x2c893(%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 0xc9b2
leaq 0x10(%rsp), %rax
movq %rax, (%rsp)
movq $0x0, 0x8(%rsp)
movb $0x0, 0x10(%rsp)
movq %r15, %rdi
callq 0x22ee8
movq 0x20(%rsp), %rdx
movq %r12, %rdi
movq 0x58(%rsp), %rsi
movl $0xa, %ecx
movq %rsp, %r8
callq 0x164fe
movl 0x68(%rsp), %r14d
movq %r12, %rdi
callq 0x22ee8
movq %r12, %rdi
movq %r15, %rsi
callq 0x22f54
movq 0x50(%rsp), %rcx
movq %rax, (%rcx,%r13,8)
testl %r14d, %r14d
je 0xa828
movl $0xa, %edx
movq %rbp, %rdi
leaq 0x19aed(%rip), %rsi     # 0x242c0
callq 0x64a0
movq 0x20(%rsp), %rsi
movq 0x28(%rsp), %rdx
movq %rbp, %rdi
callq 0x64a0
movq %rax, %r14
movl $0xf, %edx
movq %rax, %rdi
leaq 0x19acf(%rip), %rsi     # 0x242cb
callq 0x64a0
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x6450
movsbl %al, %esi
movq %r14, %rdi
callq 0x6050
movq %rax, %rdi
callq 0x6300
movq (%rsp), %rdi
movq 0x48(%rsp), %rax
movq (%rax), %rsi
callq 0x6590
testl %eax, %eax
je 0xa93f
movl $0x8, %edx
movq %rbp, %rdi
leaq 0x19a8b(%rip), %rsi     # 0x242db
callq 0x64a0
movq 0x20(%rsp), %rsi
movq 0x28(%rsp), %rdx
movq %rbp, %rdi
callq 0x64a0
movq %rax, %r14
movl $0xe, %edx
movq %rax, %rdi
leaq 0x19a6b(%rip), %rsi     # 0x242e4
callq 0x64a0
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x6450
movsbl %al, %esi
movq %r14, %rdi
callq 0x6050
movq %rax, %rdi
callq 0x6300
movl $0xd, %edx
movq %rbp, %rdi
leaq 0x19a3f(%rip), %rsi     # 0x242f3
callq 0x64a0
movq 0x8(%rsp), %rsi
movq %rbp, %rdi
callq 0x62f0
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x6450
movsbl %al, %esi
movq %r14, %rdi
callq 0x6050
movq %rax, %rdi
callq 0x6300
movl $0x8, %edx
movq %rbp, %rdi
leaq 0x19a02(%rip), %rsi     # 0x24301
callq 0x64a0
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
movq %rbp, %rdi
callq 0x64a0
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x6450
movsbl %al, %esi
movq %r14, %rdi
callq 0x6050
movq %rax, %rdi
callq 0x6300
movq %r12, %rdi
callq 0x22f6e
movq %r15, %rdi
callq 0x22f6e
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0xa962
callq 0x6440
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0xa976
callq 0x6440
incq %r13
addq $0x20, %rbx
cmpl %r13d, 0x40(%rsp)
jne 0xa73d
xorl %eax, %eax
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0xa9bf
jmp 0xa9a3
movq %rax, %rbx
jmp 0xa9b5
movq %rax, %rbx
leaq 0x68(%rsp), %rdi
callq 0x22f6e
leaq 0x78(%rsp), %rdi
callq 0x22f6e
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0xa9d2
callq 0x6440
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0xa9e6
callq 0x6440
movq %rbx, %rdi
callq 0x6720