// File: /workspace/github_cpp_makefile_star2_O3/BenLangmead[P]bowtie/ebwt.cpp
// Function: adjustEbwtBase(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)
string adjustEbwtBase(const string& cmdline,
                      const string& ebwtFileBase,
                      bool verbose = false)
{
	string str = ebwtFileBase;
	ifstream in;
	if(verbose) cout << "Trying " << str << endl;
	if (access((str + ".1." + gBt2_ext).c_str(), R_OK) == 0) {
		gEbwt_ext = gBt2_ext;
	}
	in.open((str + ".1." + gEbwt_ext).c_str(), ios_base::in | ios::binary);
	if(!in.is_open()) {
		if(verbose) cout << "  didn't work" << endl;
		in.close();
		str = cmdline;
		size_t st = str.find_last_of("/\\");
		if(st != string::npos) {
			str.erase(st);
			str += "/indexes/";
		} else {
			str = "indexes/";
		}
		str += ebwtFileBase;
		if(verbose) cout << "Trying " << str << endl;
		in.open((str + ".1." + gEbwt_ext).c_str(), ios_base::in | ios::binary);
		if(!in.is_open()) {
			if(verbose) cout << "  didn't work" << endl;
			in.close();
			if(getenv("BOWTIE_INDEXES") != NULL) {
				str = string(getenv("BOWTIE_INDEXES")) + "/" + ebwtFileBase;
				if(verbose) cout << "Trying " << str << endl;
				if (access((str + ".1." + gBt2_ext).c_str(), R_OK) == 0) {
					gEbwt_ext = gBt2_ext;
				}
				in.open((str + ".1." + gEbwt_ext).c_str(), ios_base::in | ios::binary);
				if(!in.is_open()) {
					if(verbose) cout << "  didn't work" << endl;
					in.close();
				} else {
					if(verbose) cout << "  worked" << endl;
				}
			}
		}
	}
	if(!in.is_open()) {
		cerr << "Could not locate a Bowtie index corresponding to basename \"" << ebwtFileBase << "\"" << endl;
		throw 1;
	}
	return str;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x288, %rsp            # imm = 0x288
movl %ecx, %ebp
movq %rdx, %r14
movq %rsi, %r12
movq %rdi, %rbx
leaq 0x10(%rdi), %rax
movq %rax, 0x58(%rsp)
movq %rax, (%rdi)
movq (%rdx), %rsi
movq 0x8(%rdx), %rdx
addq %rsi, %rdx
callq 0x21612
leaq 0x80(%rsp), %rdi
callq 0x43a0
movl %ebp, 0x2c(%rsp)
testb %bpl, %bpl
je 0x2aeae
movq 0xc158(%rip), %rdi      # 0x36fb8
leaq 0x5668(%rip), %rsi      # 0x304cf
movl $0x7, %edx
callq 0x43b0
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
movq 0xc139(%rip), %rdi      # 0x36fb8
callq 0x43b0
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x4300
movsbl %al, %esi
movq %r15, %rdi
callq 0x4040
movq %rax, %rdi
callq 0x41e0
leaq 0x18(%rsp), %r15
movq %r15, -0x10(%r15)
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
addq %rsi, %rdx
leaq 0x8(%rsp), %rdi
callq 0x21612
leaq 0x3805(%rip), %rsi      # 0x2e6d7
leaq 0x8(%rsp), %rdi
callq 0x46a0
movq 0xe22d(%rip), %rsi      # 0x39110
movq 0xe22e(%rip), %rdx      # 0x39118
leaq 0x8(%rsp), %rdi
callq 0x4110
leaq 0x40(%rsp), %rbp
movq %rbp, -0x10(%rbp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x2af1b
movq %rdx, 0x30(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x40(%rsp)
jmp 0x2af22
movups (%rcx), %xmm0
movups %xmm0, (%rbp)
movq 0x8(%rax), %rdx
movq %rdx, 0x38(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0x30(%rsp), %rdi
movl $0x4, %esi
callq 0x45c0
movl %eax, %r15d
movq 0x30(%rsp), %rdi
cmpq %rbp, %rdi
je 0x2af63
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x4340
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x2af7f
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x4340
testl %r15d, %r15d
jne 0x2af97
leaq 0xe165(%rip), %rdi      # 0x390f0
leaq 0xe17e(%rip), %rsi      # 0x39110
callq 0x4180
leaq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
movq %rax, (%rdi)
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
addq %rsi, %rdx
callq 0x21612
leaq 0x371d(%rip), %rsi      # 0x2e6d7
leaq 0x8(%rsp), %rdi
callq 0x46a0
movq 0xe125(%rip), %rsi      # 0x390f0
movq 0xe126(%rip), %rdx      # 0x390f8
leaq 0x8(%rsp), %rdi
callq 0x4110
movq %rbp, 0x30(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x2afff
movq %rdx, 0x30(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x40(%rsp)
jmp 0x2b006
movups (%rcx), %xmm0
movups %xmm0, (%rbp)
movq 0x8(%rax), %rdx
movq %rdx, 0x38(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0x30(%rsp), %rsi
leaq 0x80(%rsp), %rdi
movl $0xc, %edx
callq 0x41b0
movq 0x30(%rsp), %rdi
cmpq %rbp, %rdi
je 0x2b04c
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x4340
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x2b068
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x4340
leaq 0xf8(%rsp), %r15
movq %r15, %rdi
callq 0x40b0
testb %al, %al
jne 0x2b6f6
cmpb $0x0, 0x2c(%rsp)
je 0x2b0ce
movq 0xbf2a(%rip), %r13      # 0x36fb8
leaq 0x5442(%rip), %rsi      # 0x304d7
movl $0xd, %edx
movq %r13, %rdi
callq 0x43b0
movq (%r13), %rax
addq -0x18(%rax), %r13
movq %r13, %rdi
movl $0xa, %esi
callq 0x4300
movsbl %al, %esi
movq 0xbef7(%rip), %rdi      # 0x36fb8
callq 0x4040
movq %rax, %rdi
callq 0x41e0
leaq 0x80(%rsp), %rdi
callq 0x4090
movq %rbx, %rdi
movq %r12, %rsi
callq 0x4180
leaq 0x53f8(%rip), %rsi      # 0x304e5
movl $0x2, %ecx
movq %rbx, %rdi
movq $-0x1, %rdx
callq 0x46d0
movq 0x8(%rbx), %r9
cmpq $-0x1, %rax
je 0x2b130
cmpq %rax, %r9
jb 0x2b78f
movq %rax, 0x8(%rbx)
movq (%rbx), %rcx
movb $0x0, (%rcx,%rax)
leaq 0x53c2(%rip), %rsi      # 0x304e8
movq %rbx, %rdi
callq 0x46a0
jmp 0x2b14a
leaq 0x53b2(%rip), %rcx      # 0x304e9
movl $0x8, %r8d
movq %rbx, %rdi
xorl %esi, %esi
movq %r9, %rdx
callq 0x4530
movq (%r14), %rsi
movq 0x8(%r14), %rdx
movq %rbx, %rdi
callq 0x4110
cmpb $0x0, 0x2c(%rsp)
je 0x2b1b5
movq 0xbe51(%rip), %rdi      # 0x36fb8
leaq 0x5361(%rip), %rsi      # 0x304cf
movl $0x7, %edx
callq 0x43b0
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
movq 0xbe32(%rip), %rdi      # 0x36fb8
callq 0x43b0
movq %rax, %r12
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x4300
movsbl %al, %esi
movq %r12, %rdi
callq 0x4040
movq %rax, %rdi
callq 0x41e0
leaq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
movq %rax, (%rdi)
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
addq %rsi, %rdx
callq 0x21612
leaq 0x34ff(%rip), %rsi      # 0x2e6d7
leaq 0x8(%rsp), %rdi
callq 0x46a0
movq 0xdf07(%rip), %rsi      # 0x390f0
movq 0xdf08(%rip), %rdx      # 0x390f8
leaq 0x8(%rsp), %rdi
callq 0x4110
movq %rbp, 0x30(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x2b21d
movq %rdx, 0x30(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x40(%rsp)
jmp 0x2b224
movups (%rcx), %xmm0
movups %xmm0, (%rbp)
movq 0x8(%rax), %rdx
movq %rdx, 0x38(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0x30(%rsp), %rsi
leaq 0x80(%rsp), %rdi
movl $0xc, %edx
callq 0x41b0
movq 0x30(%rsp), %rdi
cmpq %rbp, %rdi
je 0x2b26a
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x4340
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x2b286
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x4340
movq %r15, %rdi
callq 0x40b0
testb %al, %al
jne 0x2b6f6
cmpb $0x0, 0x2c(%rsp)
je 0x2b2e4
movq 0xbd14(%rip), %r12      # 0x36fb8
leaq 0x522c(%rip), %rsi      # 0x304d7
movl $0xd, %edx
movq %r12, %rdi
callq 0x43b0
movq (%r12), %rax
addq -0x18(%rax), %r12
movq %r12, %rdi
movl $0xa, %esi
callq 0x4300
movsbl %al, %esi
movq 0xbce1(%rip), %rdi      # 0x36fb8
callq 0x4040
movq %rax, %rdi
callq 0x41e0
leaq 0x80(%rsp), %rdi
callq 0x4090
leaq 0x51fa(%rip), %rdi      # 0x304f2
callq 0x43e0
testq %rax, %rax
je 0x2b6f6
leaq 0x51e5(%rip), %rdi      # 0x304f2
callq 0x43e0
leaq 0x60(%rsp), %rdi
leaq 0x57(%rsp), %rdx
movq %rax, %rsi
callq 0xf90a
leaq 0x51c5(%rip), %rsi      # 0x304f0
leaq 0x60(%rsp), %rdi
callq 0x46a0
leaq 0x18(%rsp), %rsi
movq %rsi, 0x8(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x2b35d
movq %rdx, 0x8(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x18(%rsp)
jmp 0x2b363
movups (%rcx), %xmm0
movups %xmm0, (%rsi)
movq 0x8(%rax), %rdx
leaq 0x8(%rsp), %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq (%r14), %rsi
movq 0x8(%r14), %rdx
callq 0x4110
movq %rbp, 0x30(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x2b3ae
movq %rdx, 0x30(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x40(%rsp)
jmp 0x2b3b5
movups (%rcx), %xmm0
movups %xmm0, (%rbp)
movq 0x8(%rax), %rdx
leaq 0x30(%rsp), %r12
movq %rdx, 0x8(%r12)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq %rbx, %rdi
movq %r12, %rsi
callq 0x43f0
movq (%r12), %rdi
cmpq %rbp, %rdi
je 0x2b3f3
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x4340
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x2b40f
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x4340
leaq 0x70(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2b42a
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x4340
cmpb $0x0, 0x2c(%rsp)
je 0x2b486
movq 0xbb80(%rip), %rdi      # 0x36fb8
leaq 0x5090(%rip), %rsi      # 0x304cf
movl $0x7, %edx
callq 0x43b0
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
movq 0xbb61(%rip), %rdi      # 0x36fb8
callq 0x43b0
movq %rax, %r12
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x4300
movsbl %al, %esi
movq %r12, %rdi
callq 0x4040
movq %rax, %rdi
callq 0x41e0
leaq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
movq %rax, (%rdi)
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
addq %rsi, %rdx
callq 0x21612
leaq 0x322e(%rip), %rsi      # 0x2e6d7
leaq 0x8(%rsp), %rdi
callq 0x46a0
movq 0xdc56(%rip), %rsi      # 0x39110
movq 0xdc57(%rip), %rdx      # 0x39118
leaq 0x8(%rsp), %rdi
callq 0x4110
movq %rbp, 0x30(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x2b4ee
movq %rdx, 0x30(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x40(%rsp)
jmp 0x2b4f5
movups (%rcx), %xmm0
movups %xmm0, (%rbp)
movq 0x8(%rax), %rdx
movq %rdx, 0x38(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0x30(%rsp), %rdi
movl $0x4, %esi
callq 0x45c0
movl %eax, %r12d
movq 0x30(%rsp), %rdi
cmpq %rbp, %rdi
je 0x2b536
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x4340
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x2b552
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x4340
testl %r12d, %r12d
jne 0x2b56a
leaq 0xdb92(%rip), %rdi      # 0x390f0
leaq 0xdbab(%rip), %rsi      # 0x39110
callq 0x4180
leaq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
movq %rax, (%rdi)
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
addq %rsi, %rdx
callq 0x21612
leaq 0x314a(%rip), %rsi      # 0x2e6d7
leaq 0x8(%rsp), %rdi
callq 0x46a0
movq 0xdb52(%rip), %rsi      # 0x390f0
movq 0xdb53(%rip), %rdx      # 0x390f8
leaq 0x8(%rsp), %rdi
callq 0x4110
movq %rbp, 0x30(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x2b5d2
movq %rdx, 0x30(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x40(%rsp)
jmp 0x2b5d9
movups (%rcx), %xmm0
movups %xmm0, (%rbp)
movq 0x8(%rax), %rdx
movq %rdx, 0x38(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0x30(%rsp), %rsi
leaq 0x80(%rsp), %rdi
movl $0xc, %edx
callq 0x41b0
movq 0x30(%rsp), %rdi
cmpq %rbp, %rdi
je 0x2b61f
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x4340
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
movl 0x2c(%rsp), %ebp
je 0x2b63f
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x4340
movq %r15, %rdi
callq 0x40b0
testb %al, %al
je 0x2b69d
testb %bpl, %bpl
je 0x2b6f6
movq 0xb95d(%rip), %r12      # 0x36fb8
leaq 0x4e9f(%rip), %rsi      # 0x30501
movl $0x8, %edx
movq %r12, %rdi
callq 0x43b0
movq (%r12), %rax
addq -0x18(%rax), %r12
movq %r12, %rdi
movl $0xa, %esi
callq 0x4300
movsbl %al, %esi
movq 0xb92a(%rip), %rdi      # 0x36fb8
callq 0x4040
movq %rax, %rdi
callq 0x41e0
jmp 0x2b6f6
testb %bpl, %bpl
je 0x2b6e9
movq 0xb90f(%rip), %r12      # 0x36fb8
leaq 0x4e27(%rip), %rsi      # 0x304d7
movl $0xd, %edx
movq %r12, %rdi
callq 0x43b0
movq (%r12), %rax
addq -0x18(%rax), %r12
movq %r12, %rdi
movl $0xa, %esi
callq 0x4300
movsbl %al, %esi
movq 0xb8dc(%rip), %rdi      # 0x36fb8
callq 0x4040
movq %rax, %rdi
callq 0x41e0
leaq 0x80(%rsp), %rdi
callq 0x4090
movq %r15, %rdi
callq 0x40b0
testb %al, %al
je 0x2b724
leaq 0x80(%rsp), %rdi
callq 0x40d0
movq %rbx, %rax
addq $0x288, %rsp            # imm = 0x288
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0xb8c5(%rip), %rdi      # 0x36ff0
leaq 0x4dd8(%rip), %rsi      # 0x3050a
movl $0x3b, %edx
callq 0x43b0
movq (%r14), %rsi
movq 0x8(%r14), %rdx
movq 0xb8a6(%rip), %rdi      # 0x36ff0
callq 0x43b0
movq %rax, %r14
leaq 0x1820(%rip), %rsi      # 0x2cf79
movl $0x1, %edx
movq %rax, %rdi
callq 0x43b0
movq %r14, %rdi
callq 0x4150
movl $0x4, %edi
callq 0x4160
movl $0x1, (%rax)
movq 0xb7d3(%rip), %rsi      # 0x36f58
movq %rax, %rdi
xorl %edx, %edx
callq 0x45f0
leaq 0x4dc4(%rip), %rdi      # 0x3055a
leaq 0x4da9(%rip), %rsi      # 0x30546
movq %rax, %rdx
movq %r9, %rcx
xorl %eax, %eax
callq 0x44f0
jmp 0x2b801
jmp 0x2b823
jmp 0x2b823
jmp 0x2b85c
jmp 0x2b823
jmp 0x2b823
jmp 0x2b85c
movq %rax, %r14
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x2b7e2
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x4340
jmp 0x2b7e2
movq %rax, %r14
leaq 0x70(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2b85f
movq 0x70(%rsp), %rsi
jmp 0x2b83a
jmp 0x2b85c
jmp 0x2b801
jmp 0x2b823
jmp 0x2b823
jmp 0x2b85c
movq %rax, %r14
movq 0x30(%rsp), %rdi
cmpq %rbp, %rdi
je 0x2b826
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x4340
jmp 0x2b826
jmp 0x2b823
jmp 0x2b823
jmp 0x2b85c
movq %rax, %r14
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x2b85f
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x4340
jmp 0x2b85f
movq %rax, %r14
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
jne 0x2b835
jmp 0x2b85f
jmp 0x2b85c
movq %rax, %r14
jmp 0x2b86c
jmp 0x2b85c
movq %rax, %r14
leaq 0x80(%rsp), %rdi
callq 0x40d0
movq (%rbx), %rdi
cmpq 0x58(%rsp), %rdi
je 0x2b886
movq 0x58(%rsp), %rax
movq (%rax), %rsi
incq %rsi
callq 0x4340
movq %r14, %rdi
callq 0x4620
nop