// File: /workspace/github_cpp_makefile_star2_O3/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 %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x60, %rsp
movq %rdi, %rbx
leaq -0x50(%rbp), %r15
movq %r15, -0x10(%r15)
xorl %eax, %eax
movq %rax, -0x8(%r15)
movb %al, (%r15)
leaq -0x30(%rbp), %r12
movq %r12, -0x10(%r12)
movq %rax, -0x8(%r12)
movb %al, (%r12)
leaq 0x28(%rdi), %rsi
leaq -0x40(%rbp), %rdi
callq 0x5140
leaq -0x60(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0x5140
movl 0x58(%rbx), %ecx
leaq 0x195b(%rip), %rdx      # 0xb8a6
leaq -0x80(%rbp), %rdi
movl $0x1e, %esi
xorl %eax, %eax
callq 0x5430
leaq 0x1791(%rip), %rsi      # 0xb6f3
leaq -0x60(%rbp), %rdi
callq 0x5550
leaq -0x80(%rbp), %rsi
movq %rax, %rdi
callq 0x5550
leaq 0x176e(%rip), %rsi      # 0xb6ec
leaq -0x40(%rbp), %rdi
callq 0x5550
leaq -0x80(%rbp), %rsi
movq %rax, %rdi
callq 0x5550
movl $0x40, %edi
callq 0x5280
movq %rax, %r14
movq -0x60(%rbp), %rsi
movl $0x10000000, %edx       # imm = 0x10000000
movq %rax, %rdi
callq 0x92e4
movq %r14, (%rbx)
movq %r14, %rdi
callq 0x9aea
testb %al, %al
je 0xa06d
movl $0x40, %edi
callq 0x5280
movq %rax, %r14
movq -0x40(%rbp), %rsi
movl $0x10000000, %edx       # imm = 0x10000000
movq %rax, %rdi
callq 0x92e4
movq %r14, 0x8(%rbx)
movq %r14, %rdi
callq 0x9aea
testb %al, %al
je 0xa08b
movq (%rbx), %rdi
movl $0x72, %esi
callq 0x958a
movq 0x8(%rbx), %rdi
movl $0x72, %esi
callq 0x958a
movq (%rbx), %rdi
callq 0x9734
movq %rax, 0x10(%rbx)
movq 0x8(%rbx), %rdi
callq 0x9734
movq %rax, 0x18(%rbx)
movq 0x10(%rbx), %rax
addq $0xa, %rax
movq %rax, 0x20(%rbx)
movq -0x40(%rbp), %rdi
cmpq %r12, %rdi
je 0xa04b
movq -0x30(%rbp), %rsi
incq %rsi
callq 0x5290
movq -0x60(%rbp), %rdi
cmpq %r15, %rdi
je 0xa060
movq -0x50(%rbp), %rsi
incq %rsi
callq 0x5290
addq $0x60, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movl $0x10, %edi
callq 0x5110
movq %rax, %r14
leaq 0x1852(%rip), %rsi      # 0xb8d3
movq %rax, %rdi
callq 0x50d0
jmp 0xa0a7
movl $0x10, %edi
callq 0x5110
movq %rax, %r14
leaq 0x1834(%rip), %rsi      # 0xb8d3
movq %rax, %rdi
callq 0x50d0
movq 0x4f42(%rip), %rsi      # 0xeff0
movq 0x4ef3(%rip), %rdx      # 0xefa8
movq %r14, %rdi
callq 0x54b0
jmp 0xa0bf
movq %rax, %rbx
movq %r14, %rdi
callq 0x51d0
jmp 0xa0e5
jmp 0xa0ce
movq %rax, %rbx
movl $0x40, %esi
movq %r14, %rdi
callq 0x5290
jmp 0xa0e5
jmp 0xa0e2
movq %rax, %rbx
movq -0x40(%rbp), %rdi
cmpq %r12, %rdi
je 0xa0fa
movq -0x30(%rbp), %rsi
incq %rsi
callq 0x5290
movq -0x60(%rbp), %rdi
cmpq %r15, %rdi
je 0xa10f
movq -0x50(%rbp), %rsi
incq %rsi
callq 0x5290
movq %rbx, %rdi
callq 0x54e0
nop