// File: /workspace/github_cpp_makefile_star2_O2/prakhar2808[P]DBEngine/dbengine/sstable.cc
// Function: sstable::loadIndexInMemory()
void sstable::loadIndexInMemory() {
  std::ifstream readfd;
  std::string indexFilePath = filePath + ".index";
  readfd.open(indexFilePath);
  readfd >> std::noskipws;
  unsigned char ch;
  long long offset;
  while(readfd.peek() != EOF) {
    // Length of key
    readfd >> ch;
    std::string key((int)ch, '\0');
    // The key
    readfd.read(&key[0], (int)ch);
    std::cout << "Index : Read key " << key;
    // Length of offset
    readfd >> ch;
    offset = 0;
    // The offset
    std::string offsetStr((int)ch, '\0');
    readfd.read(&offsetStr[0], (int)ch);
    // Converting offset to long long from string
    for(int i = 0; i < (int)ch; i++) {
      offset = offset * 10 + (long long)(offsetStr[i] - '0');
    }
    std::cout << " Offset = " << offset << std::endl; 
    index[key] = offset;
  }
  readfd.close();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x278, %rsp            # imm = 0x278
movq %rdi, %rbx
leaq 0x70(%rsp), %rdi
callq 0x5450
movq %rbx, 0x8(%rsp)
leaq 0x38(%rbx), %rsi
leaq 0x3e4f(%rip), %rdx      # 0x18543
leaq 0x50(%rsp), %rdi
callq 0x13497
leaq 0x70(%rsp), %rdi
leaq 0x50(%rsp), %rsi
pushq $0x8
popq %rdx
callq 0x5350
leaq 0x70(%rsp), %r14
movq (%r14), %rax
movq -0x18(%rax), %rax
andl $0xffffefff, 0x88(%rsp,%rax) # imm = 0xFFFFEFFF
leaq 0x7(%rsp), %r15
leaq 0x30(%rsp), %r12
movq 0x10888(%rip), %r13     # 0x24fc0
leaq 0x10(%rsp), %rbp
movq %r14, %rdi
callq 0x5180
cmpl $-0x1, %eax
je 0x14844
movq %r14, %rdi
movq %r15, %rsi
callq 0x5510
movzbl 0x7(%rsp), %esi
leaq 0x40(%rsp), %rax
movq %rax, 0x30(%rsp)
movq %r12, %rdi
xorl %edx, %edx
callq 0x5470
movq 0x30(%rsp), %rsi
movzbl 0x7(%rsp), %edx
movq %r14, %rdi
callq 0x54d0
movq %r13, %rdi
leaq 0x3d67(%rip), %rsi      # 0x184f5
callq 0x53b0
movq %rax, %rdi
movq %r12, %rsi
callq 0x5370
movq %r14, %rdi
movq %r15, %rsi
callq 0x5510
movzbl 0x7(%rsp), %esi
leaq 0x20(%rsp), %rax
movq %rax, 0x10(%rsp)
movq %rbp, %rdi
xorl %edx, %edx
callq 0x5470
movq 0x10(%rsp), %rsi
movzbl 0x7(%rsp), %edx
movq %r14, %rdi
callq 0x54d0
movzbl 0x7(%rsp), %eax
movq 0x10(%rsp), %rcx
xorl %edx, %edx
xorl %ebx, %ebx
cmpq %rdx, %rax
je 0x147fd
imulq $0xa, %rbx, %rsi
movsbq (%rcx,%rdx), %rdi
leaq (%rsi,%rdi), %rbx
addq $-0x30, %rbx
incq %rdx
jmp 0x147e2
movq %r13, %rdi
leaq 0x3d00(%rip), %rsi      # 0x18507
callq 0x53b0
movq %rax, %rdi
movq %rbx, %rsi
callq 0x5150
movq %rax, %rdi
callq 0x5210
movq 0x8(%rsp), %rdi
movq %r12, %rsi
callq 0x1500c
movq %rbx, (%rax)
movq %rbp, %rdi
callq 0x51d0
movq %r12, %rdi
callq 0x51d0
jmp 0x1473d
leaq 0x70(%rsp), %rdi
callq 0x50a0
leaq 0x50(%rsp), %rdi
callq 0x51d0
leaq 0x70(%rsp), %rdi
callq 0x50e0
addq $0x278, %rsp            # imm = 0x278
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x14881
jmp 0x14881
movq %rax, %rbx
jmp 0x148ac
jmp 0x14881
jmp 0x14886
movq %rax, %rbx
jmp 0x148a2
movq %rax, %rbx
jmp 0x14898
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x51d0
leaq 0x30(%rsp), %rdi
callq 0x51d0
leaq 0x50(%rsp), %rdi
callq 0x51d0
leaq 0x70(%rsp), %rdi
callq 0x50e0
movq %rbx, %rdi
callq 0x56c0