// File: /workspace/github_cpp_makefile_star2_O2/MITRECND[P]snugglefish/src/indexSet.cpp
// Function: snugglefish::indexSet::open()
void indexSet::open(){
    string indexFileName, nGramFileName;
    indexFileName = nGramFileName = this->fileBase;
    char number_string[FILE_NUM_BUFFER_SIZE];
    snprintf(number_string, FILE_NUM_BUFFER_SIZE, FILE_NUM_SPRINTF_STRING, this->count);

    indexFileName.append(INDEX_FILE_EXTENSION).append(number_string);
    nGramFileName.append(NGRAM_FILE_EXTENSION).append(number_string);

    indexFile = new file(indexFileName.c_str());

    if(!indexFile->exists()){
        throw runtime_error("index file does not exist");
    }

    nGramFile = new file(nGramFileName.c_str());

    if (!nGramFile->exists()){
        throw runtime_error("index file does not exist");
    }

    indexFile->open('r');
    nGramFile->open('r');

    indexMap = indexFile->mmap();
    nGramMap = nGramFile->mmap();

    indexEntries = indexMap + INDEX_HEADER_SIZE;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x60, %rsp
movq %rdi, %rbx
leaq -0x40(%rbp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
leaq -0x20(%rbp), %rcx
movq %rcx, -0x10(%rcx)
andq $0x0, -0x8(%rcx)
xorl %edx, %edx
movb %dl, (%rax)
movb %dl, (%rcx)
leaq 0x28(%rdi), %rsi
leaq -0x30(%rbp), %rdi
callq 0x6150
leaq -0x50(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x6150
movl 0x58(%rbx), %ecx
leaq 0x1514(%rip), %rdx      # 0xb8a6
leaq -0x70(%rbp), %rdi
pushq $0x1e
popq %rsi
xorl %eax, %eax
callq 0x6400
leaq 0x134c(%rip), %rsi      # 0xb6f3
leaq -0x50(%rbp), %rdi
callq 0x6510
leaq -0x70(%rbp), %rsi
movq %rax, %rdi
callq 0x6510
leaq 0x1329(%rip), %rsi      # 0xb6ec
leaq -0x30(%rbp), %rdi
callq 0x6510
leaq -0x70(%rbp), %rsi
movq %rax, %rdi
callq 0x6510
pushq $0x40
popq %rdi
callq 0x6280
movq %rax, %r14
movq -0x50(%rbp), %rsi
movl $0x10000000, %edx       # imm = 0x10000000
movq %rax, %rdi
callq 0x9820
movq %r14, (%rbx)
movq %r14, %rdi
callq 0x9fb4
testb %al, %al
je 0xa48a
pushq $0x40
popq %rdi
callq 0x6280
movq %rax, %r14
movq -0x30(%rbp), %rsi
movl $0x10000000, %edx       # imm = 0x10000000
movq %rax, %rdi
callq 0x9820
movq %r14, 0x8(%rbx)
movq %r14, %rdi
callq 0x9fb4
testb %al, %al
je 0xa4a6
movq (%rbx), %rdi
pushq $0x72
popq %rsi
callq 0x9a9a
movq 0x8(%rbx), %rdi
pushq $0x72
popq %rsi
callq 0x9a9a
movq (%rbx), %rdi
callq 0x9c30
movq %rax, 0x10(%rbx)
movq 0x8(%rbx), %rdi
callq 0x9c30
movq %rax, 0x18(%rbx)
movq 0x10(%rbx), %rax
addq $0xa, %rax
movq %rax, 0x20(%rbx)
leaq -0x30(%rbp), %rdi
callq 0x60f0
leaq -0x50(%rbp), %rdi
callq 0x60f0
addq $0x60, %rsp
popq %rbx
popq %r14
popq %rbp
retq
pushq $0x10
popq %rdi
callq 0x6120
movq %rax, %r14
leaq 0x1437(%rip), %rsi      # 0xb8d3
movq %rax, %rdi
callq 0x60c0
jmp 0xa4c0
pushq $0x10
popq %rdi
callq 0x6120
movq %rax, %r14
leaq 0x141b(%rip), %rsi      # 0xb8d3
movq %rax, %rdi
callq 0x60c0
movq 0x4b29(%rip), %rsi      # 0xeff0
movq 0x4ada(%rip), %rdx      # 0xefa8
movq %r14, %rdi
callq 0x6480
jmp 0xa4d8
movq %rax, %rbx
movq %r14, %rdi
callq 0x61d0
jmp 0xa4fc
jmp 0xa4e7
movq %rax, %rbx
pushq $0x40
popq %rsi
movq %r14, %rdi
callq 0x6290
jmp 0xa4fc
jmp 0xa4f9
movq %rax, %rbx
leaq -0x30(%rbp), %rdi
callq 0x60f0
leaq -0x50(%rbp), %rdi
callq 0x60f0
movq %rbx, %rdi
callq 0x64b0