// File: /workspace/github_cpp_makefile_star2_O1/ekg[P]fastahack/Fasta.cpp
// Function: FastaReference::open(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
void FastaReference::open(string reffilename) {
    filename = reffilename;
    if (!(file = fopen(filename.c_str(), "r"))) {
        cerr << "could not open " << filename << endl;
        exit(1);
    }
    index = new FastaIndex();
    struct stat stFileInfo; 
    string indexFileName = filename + index->indexFileExtension(); 
    // if we can find an index file, use it
    if(stat(indexFileName.c_str(), &stFileInfo) == 0) { 
        index->readIndexFile(indexFileName);
    } else { // otherwise, read the reference and generate the index file in the cwd
        cerr << "index file " << indexFileName << " not found, generating..." << endl;
        index->indexReference(filename);
        index->writeIndexFile(indexFileName);
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x138, %rsp            # imm = 0x138
movq %rdi, %rbx
leaq 0x8(%rdi), %r14
movq %r14, %rdi
callq 0x3170
movq 0x8(%rbx), %rdi
leaq 0x489f(%rip), %rsi      # 0x914f
callq 0x3330
movq %rax, 0x28(%rbx)
testq %rax, %rax
je 0x4ae8
movl $0x280, %edi            # imm = 0x280
callq 0x32c0
movq %rax, %r14
movq %rax, %rdi
callq 0x38b8
movq %r14, 0x40(%rbx)
leaq 0x98(%rsp), %r14
movq %r14, -0x10(%r14)
movl $0x6961662e, (%r14)     # imm = 0x6961662E
movq $0x4, -0x8(%r14)
movb $0x0, 0x4(%r14)
movq 0x8(%rbx), %rcx
movq 0x10(%rbx), %r8
leaq 0x88(%rsp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x3300
leaq 0x18(%rsp), %r15
movq %r15, -0x10(%r15)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x493b
movq %rdx, 0x8(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x18(%rsp)
jmp 0x4942
movups (%rcx), %xmm0
movups %xmm0, (%r15)
movq 0x8(%rax), %rdx
movq %rdx, 0x10(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0x88(%rsp), %rdi
cmpq %r14, %rdi
je 0x4977
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x32d0
movq 0x8(%rsp), %rdi
leaq 0xa8(%rsp), %rsi
callq 0x3270
testl %eax, %eax
je 0x4a7c
movq 0x8658(%rip), %rdi      # 0xcff0
leaq 0x4681(%rip), %rsi      # 0x9020
movl $0xb, %edx
callq 0x3320
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
movq 0x8636(%rip), %rdi      # 0xcff0
callq 0x3320
movq %rax, %r14
leaq 0x4798(%rip), %rsi      # 0x9161
movl $0x19, %edx
movq %rax, %rdi
callq 0x3320
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x3290
movsbl %al, %esi
movq %r14, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x31d0
movq 0x40(%rbx), %r14
leaq 0x38(%rsp), %r12
movq %r12, -0x10(%r12)
movq 0x8(%rbx), %rsi
movq 0x10(%rbx), %rdx
addq %rsi, %rdx
leaq 0x28(%rsp), %rdi
callq 0x55ac
leaq 0x28(%rsp), %rsi
movq %r14, %rdi
callq 0x3fdc
movq 0x28(%rsp), %rdi
cmpq %r12, %rdi
je 0x4a44
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x32d0
movq 0x40(%rbx), %rbx
leaq 0x58(%rsp), %r14
movq %r14, -0x10(%r14)
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
addq %rsi, %rdx
leaq 0x48(%rsp), %rdi
callq 0x55ac
leaq 0x48(%rsp), %rsi
movq %rbx, %rdi
callq 0x4692
movq 0x48(%rsp), %rdi
jmp 0x4ab2
movq 0x40(%rbx), %rbx
leaq 0x78(%rsp), %r14
movq %r14, -0x10(%r14)
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
addq %rsi, %rdx
leaq 0x68(%rsp), %rdi
callq 0x55ac
leaq 0x68(%rsp), %rsi
movq %rbx, %rdi
callq 0x392e
movq 0x68(%rsp), %rdi
cmpq %r14, %rdi
je 0x4ac2
movq (%r14), %rsi
incq %rsi
callq 0x32d0
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x4ad9
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x32d0
addq $0x138, %rsp            # imm = 0x138
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq 0x8501(%rip), %rdi      # 0xcff0
leaq 0x465b(%rip), %rsi      # 0x9151
callq 0x32a0
movq %rax, %rdi
movq %r14, %rsi
callq 0x3260
movq %rax, %rdi
callq 0x3150
movl $0x1, %edi
callq 0x3360
movq %rax, %rbx
movq 0x68(%rsp), %rdi
cmpq %r14, %rdi
je 0x4b86
movq 0x78(%rsp), %rsi
jmp 0x4b52
movq %rax, %rbx
movq 0x48(%rsp), %rdi
cmpq %r14, %rdi
je 0x4b86
movq 0x58(%rsp), %rsi
jmp 0x4b52
movq %rax, %rbx
movq 0x28(%rsp), %rdi
cmpq %r12, %rdi
je 0x4b86
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x32d0
jmp 0x4b86
movq %rax, %rbx
movq 0x88(%rsp), %rdi
cmpq %r14, %rdi
je 0x4b9d
movq 0x98(%rsp), %rsi
jmp 0x4b95
movq %rax, %rbx
movl $0x280, %esi            # imm = 0x280
movq %r14, %rdi
jmp 0x4b98
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x4b9d
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x32d0
movq %rbx, %rdi
callq 0x3490
nop