// File: yangwanyuan[P]HLKVDS/src/Kvdb_Impl.cc
// Function: hlkvds::KVDS::KVDS(char const*, hlkvds::Options)
KVDS::KVDS(const char* filename, Options opts) :
    paths_(string(filename)), sbMgr_(NULL), idxMgr_(NULL), rdCache_(NULL), metaStor_(NULL), dataStor_(NULL), options_(opts), isOpen_(false) {

    sbMgr_ = new SuperBlockManager(options_);
    idxMgr_ = new IndexManager(sbMgr_, options_);

    if(!options_.disable_cache){
        rdCache_ = new ReadCache(CachePolicy(options_.cache_policy), (size_t) options_.cache_size, options_.slru_partition);
    }

    metaStor_ = new MetaStor(filename, bdVec_, sbMgr_, idxMgr_, options_);
}

// Assembly:
subq $0x78, %rsp
leaq 0x80(%rsp), %rax
movq %rax, 0x28(%rsp)
movq %rdi, 0x70(%rsp)
movq %rsi, 0x68(%rsp)
movq 0x70(%rsp), %rax
movq %rax, 0x30(%rsp)
leaq 0x441bc(%rip), %rcx     # 0x70638
addq $0x10, %rcx
movq %rcx, (%rax)
addq $0x8, %rax
movq %rax, 0x38(%rsp)
movq 0x68(%rsp), %rax
movq %rax, 0x40(%rsp)
leaq 0x67(%rsp), %rdi
movq %rdi, 0x48(%rsp)
callq 0x8830
movq 0x38(%rsp), %rdi
movq 0x40(%rsp), %rsi
movq 0x48(%rsp), %rdx
callq 0x8680
jmp 0x2c4bb
leaq 0x67(%rsp), %rdi
callq 0x8540
movq 0x28(%rsp), %rax
movq 0x30(%rsp), %rdi
movq $0x0, 0x28(%rdi)
movq $0x0, 0x30(%rdi)
movq $0x0, 0x38(%rdi)
movq $0x0, 0x40(%rdi)
movq $0x0, 0x48(%rdi)
movups 0x40(%rax), %xmm0
movups %xmm0, 0x90(%rdi)
movups (%rax), %xmm0
movups 0x10(%rax), %xmm1
movups 0x20(%rax), %xmm2
movups 0x30(%rax), %xmm3
movups %xmm3, 0x80(%rdi)
movups %xmm2, 0x70(%rdi)
movups %xmm1, 0x60(%rdi)
movups %xmm0, 0x50(%rdi)
addq $0xa0, %rdi
movq %rdi, 0x18(%rsp)
callq 0x2d700
movq 0x30(%rsp), %rax
movb $0x0, 0xb8(%rax)
movl $0x78, %edi
callq 0x84f0
movq %rax, 0x20(%rsp)
jmp 0x2c552
movq 0x20(%rsp), %rdi
movq 0x30(%rsp), %rsi
addq $0x50, %rsi
callq 0x49690
jmp 0x2c567
movq 0x30(%rsp), %rax
movq 0x20(%rsp), %rcx
movq %rcx, 0x28(%rax)
movl $0xa0, %edi
callq 0x84f0
movq %rax, 0x10(%rsp)
jmp 0x2c586
movq 0x10(%rsp), %rdi
movq 0x30(%rsp), %rdx
movq 0x28(%rdx), %rsi
addq $0x50, %rdx
callq 0x270f0
jmp 0x2c59f
movq 0x30(%rsp), %rax
movq 0x10(%rsp), %rcx
movq %rcx, 0x30(%rax)
testb $0x1, 0x50(%rax)
jne 0x2c677
movl $0x1a8, %edi            # imm = 0x1A8
callq 0x84f0
movq %rax, 0x8(%rsp)
jmp 0x2c5c8
movq 0x8(%rsp), %rdi
movq 0x30(%rsp), %rax
movslq 0x54(%rax), %rdx
movl 0x58(%rax), %esi
movl 0x5c(%rax), %ecx
callq 0x374e0
jmp 0x2c5e3
movq 0x30(%rsp), %rax
movq 0x8(%rsp), %rcx
movq %rcx, 0x38(%rax)
jmp 0x2c677
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x58(%rsp)
movl %eax, 0x54(%rsp)
leaq 0x67(%rsp), %rdi
callq 0x8540
jmp 0x2c6ef
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x58(%rsp)
movl %eax, 0x54(%rsp)
jmp 0x2c6db
movq 0x20(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x58(%rsp)
movl %eax, 0x54(%rsp)
callq 0x84b0
jmp 0x2c6db
movq 0x10(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x58(%rsp)
movl %eax, 0x54(%rsp)
callq 0x84b0
jmp 0x2c6db
movq 0x8(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x58(%rsp)
movl %eax, 0x54(%rsp)
callq 0x84b0
jmp 0x2c6db
movl $0x50, %edi
callq 0x84f0
movq %rax, (%rsp)
jmp 0x2c687
movq (%rsp), %rdi
movq 0x30(%rsp), %r9
movq 0x68(%rsp), %rsi
movq %r9, %rdx
addq $0xa0, %rdx
movq 0x28(%r9), %rcx
movq 0x30(%r9), %r8
addq $0x50, %r9
callq 0x340d0
jmp 0x2c6b2
movq 0x30(%rsp), %rax
movq (%rsp), %rcx
movq %rcx, 0x40(%rax)
addq $0x78, %rsp
retq
movq (%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x58(%rsp)
movl %eax, 0x54(%rsp)
callq 0x84b0
movq 0x18(%rsp), %rdi
callq 0x2d1a0
movq 0x38(%rsp), %rdi
callq 0x8928
movq 0x58(%rsp), %rdi
callq 0x8820
nopl (%rax)