// File: zeeev[P]DASVC/bamtools/src/utils/bamtools_fasta.cpp
// Function: BamTools::Fasta::FastaPrivate::Open(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
bool Fasta::FastaPrivate::Open(const string& filename, const string& indexFilename) {
 
    bool success = true;
  
    // open FASTA filename
    Stream = fopen(filename.c_str(), "rb");
    if ( !Stream ) {
        cerr << "FASTA error: Could not open " << filename << " for reading" << endl;
        return false;
    }
    IsOpen = true;
    success &= IsOpen;
    
    // open index file if it exists
    if ( !indexFilename.empty() ) {
        IndexStream = fopen(indexFilename.c_str(), "rb");
        if ( !IndexStream ) {
            cerr << "FASTA error : Could not open " << indexFilename << " for reading." << endl;
            return false;
        }
        IsIndexOpen = true;
        success &= IsIndexOpen;
        
        // attempt to load index data
        HasIndex = LoadIndexData();
        success &= HasIndex;
    }
    
    // return success status
    return success;
}

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x28(%rsp)
movq %rsi, 0x20(%rsp)
movq %rdx, 0x18(%rsp)
movq 0x28(%rsp), %rax
movq %rax, 0x8(%rsp)
movb $0x1, 0x17(%rsp)
movq 0x20(%rsp), %rdi
callq 0x86320
movq %rax, %rdi
leaq 0x23630(%rip), %rsi     # 0x12f4c6
callq 0x86810
movq %rax, %rcx
movq 0x8(%rsp), %rax
movq %rcx, (%rax)
cmpq $0x0, (%rax)
jne 0x10bef4
movq 0x5912d(%rip), %rdi     # 0x164fe0
leaq 0x2811d(%rip), %rsi     # 0x133fd7
callq 0x86700
movq %rax, %rdi
movq 0x20(%rsp), %rsi
callq 0x86640
movq %rax, %rdi
leaq 0x27faa(%rip), %rsi     # 0x133e80
callq 0x86700
movq %rax, %rdi
movq 0x5908b(%rip), %rsi     # 0x164f70
callq 0x86770
movb $0x0, 0x37(%rsp)
jmp 0x10c002
movq 0x8(%rsp), %rax
movb $0x1, 0x8(%rax)
movb 0x8(%rax), %al
andb $0x1, %al
movzbl %al, %ecx
movb 0x17(%rsp), %al
andb $0x1, %al
movzbl %al, %eax
andl %ecx, %eax
cmpl $0x0, %eax
setne %al
andb $0x1, %al
movb %al, 0x17(%rsp)
movq 0x18(%rsp), %rdi
callq 0x86c90
testb $0x1, %al
jne 0x10bff8
movq 0x18(%rsp), %rdi
callq 0x86320
movq %rax, %rdi
leaq 0x23584(%rip), %rsi     # 0x12f4c6
callq 0x86810
movq %rax, %rcx
movq 0x8(%rsp), %rax
movq %rcx, 0x10(%rax)
cmpq $0x0, 0x10(%rax)
jne 0x10bf9f
movq 0x5907f(%rip), %rdi     # 0x164fe0
leaq 0x27edf(%rip), %rsi     # 0x133e47
callq 0x86700
movq %rax, %rdi
movq 0x18(%rsp), %rsi
callq 0x86640
movq %rax, %rdi
leaq 0x2368c(%rip), %rsi     # 0x12f610
callq 0x86700
movq %rax, %rdi
movq 0x58fdd(%rip), %rsi     # 0x164f70
callq 0x86770
movb $0x0, 0x37(%rsp)
jmp 0x10c002
movq 0x8(%rsp), %rdi
movb $0x1, 0x19(%rdi)
movb 0x19(%rdi), %al
andb $0x1, %al
movzbl %al, %ecx
movb 0x17(%rsp), %al
andb $0x1, %al
movzbl %al, %eax
andl %ecx, %eax
cmpl $0x0, %eax
setne %al
andb $0x1, %al
movb %al, 0x17(%rsp)
callq 0x10bb60
movb %al, %cl
movq 0x8(%rsp), %rax
andb $0x1, %cl
movb %cl, 0x18(%rax)
movb 0x18(%rax), %al
andb $0x1, %al
movzbl %al, %ecx
movb 0x17(%rsp), %al
andb $0x1, %al
movzbl %al, %eax
andl %ecx, %eax
cmpl $0x0, %eax
setne %al
andb $0x1, %al
movb %al, 0x17(%rsp)
movb 0x17(%rsp), %al
andb $0x1, %al
movb %al, 0x37(%rsp)
movb 0x37(%rsp), %al
andb $0x1, %al
addq $0x38, %rsp
retq
nopl (%rax)