// File: /workspace/github_cpp_makefile_star2_O1/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 0x21b84
leaq 0x80(%rsp), %rdi
callq 0x43a0
movl %ebp, 0x2c(%rsp)
testb %bpl, %bpl
je 0x2ba16
movq 0xb5f0(%rip), %rdi      # 0x36fb8
leaq 0x5a70(%rip), %rsi      # 0x3143f
movl $0x7, %edx
callq 0x43b0
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
movq 0xb5d1(%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 0x21b84
leaq 0x3c0d(%rip), %rsi      # 0x2f647
leaq 0x8(%rsp), %rdi
callq 0x46a0
movq 0xd6c5(%rip), %rsi      # 0x39110
movq 0xd6c6(%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 0x2ba83
movq %rdx, 0x30(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x40(%rsp)
jmp 0x2ba8a
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 0x2bacb
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x4340
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x2bae7
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x4340
testl %r15d, %r15d
jne 0x2baff
leaq 0xd5fd(%rip), %rdi      # 0x390f0
leaq 0xd616(%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 0x21b84
leaq 0x3b25(%rip), %rsi      # 0x2f647
leaq 0x8(%rsp), %rdi
callq 0x46a0
movq 0xd5bd(%rip), %rsi      # 0x390f0
movq 0xd5be(%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 0x2bb67
movq %rdx, 0x30(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x40(%rsp)
jmp 0x2bb6e
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 0x2bbb4
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x4340
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x2bbd0
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x4340
leaq 0xf8(%rsp), %r15
movq %r15, %rdi
callq 0x40b0
testb %al, %al
jne 0x2c25e
cmpb $0x0, 0x2c(%rsp)
je 0x2bc36
movq 0xb3c2(%rip), %r13      # 0x36fb8
leaq 0x584a(%rip), %rsi      # 0x31447
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 0xb38f(%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 0x5800(%rip), %rsi      # 0x31455
movl $0x2, %ecx
movq %rbx, %rdi
movq $-0x1, %rdx
callq 0x46d0
movq 0x8(%rbx), %r9
cmpq $-0x1, %rax
je 0x2bc98
cmpq %rax, %r9
jb 0x2c2f7
movq %rax, 0x8(%rbx)
movq (%rbx), %rcx
movb $0x0, (%rcx,%rax)
leaq 0x57ca(%rip), %rsi      # 0x31458
movq %rbx, %rdi
callq 0x46a0
jmp 0x2bcb2
leaq 0x57ba(%rip), %rcx      # 0x31459
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 0x2bd1d
movq 0xb2e9(%rip), %rdi      # 0x36fb8
leaq 0x5769(%rip), %rsi      # 0x3143f
movl $0x7, %edx
callq 0x43b0
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
movq 0xb2ca(%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 0x21b84
leaq 0x3907(%rip), %rsi      # 0x2f647
leaq 0x8(%rsp), %rdi
callq 0x46a0
movq 0xd39f(%rip), %rsi      # 0x390f0
movq 0xd3a0(%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 0x2bd85
movq %rdx, 0x30(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x40(%rsp)
jmp 0x2bd8c
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 0x2bdd2
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x4340
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x2bdee
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x4340
movq %r15, %rdi
callq 0x40b0
testb %al, %al
jne 0x2c25e
cmpb $0x0, 0x2c(%rsp)
je 0x2be4c
movq 0xb1ac(%rip), %r12      # 0x36fb8
leaq 0x5634(%rip), %rsi      # 0x31447
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 0xb179(%rip), %rdi      # 0x36fb8
callq 0x4040
movq %rax, %rdi
callq 0x41e0
leaq 0x80(%rsp), %rdi
callq 0x4090
leaq 0x5602(%rip), %rdi      # 0x31462
callq 0x43e0
testq %rax, %rax
je 0x2c25e
leaq 0x55ed(%rip), %rdi      # 0x31462
callq 0x43e0
leaq 0x60(%rsp), %rdi
leaq 0x57(%rsp), %rdx
movq %rax, %rsi
callq 0xfb22
leaq 0x55cd(%rip), %rsi      # 0x31460
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 0x2bec5
movq %rdx, 0x8(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x18(%rsp)
jmp 0x2becb
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 0x2bf16
movq %rdx, 0x30(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x40(%rsp)
jmp 0x2bf1d
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 0x2bf5b
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x4340
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x2bf77
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x4340
leaq 0x70(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2bf92
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x4340
cmpb $0x0, 0x2c(%rsp)
je 0x2bfee
movq 0xb018(%rip), %rdi      # 0x36fb8
leaq 0x5498(%rip), %rsi      # 0x3143f
movl $0x7, %edx
callq 0x43b0
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
movq 0xaff9(%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 0x21b84
leaq 0x3636(%rip), %rsi      # 0x2f647
leaq 0x8(%rsp), %rdi
callq 0x46a0
movq 0xd0ee(%rip), %rsi      # 0x39110
movq 0xd0ef(%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 0x2c056
movq %rdx, 0x30(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x40(%rsp)
jmp 0x2c05d
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 0x2c09e
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x4340
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x2c0ba
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x4340
testl %r12d, %r12d
jne 0x2c0d2
leaq 0xd02a(%rip), %rdi      # 0x390f0
leaq 0xd043(%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 0x21b84
leaq 0x3552(%rip), %rsi      # 0x2f647
leaq 0x8(%rsp), %rdi
callq 0x46a0
movq 0xcfea(%rip), %rsi      # 0x390f0
movq 0xcfeb(%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 0x2c13a
movq %rdx, 0x30(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x40(%rsp)
jmp 0x2c141
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 0x2c187
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x4340
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
movl 0x2c(%rsp), %ebp
je 0x2c1a7
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x4340
movq %r15, %rdi
callq 0x40b0
testb %al, %al
je 0x2c205
testb %bpl, %bpl
je 0x2c25e
movq 0xadf5(%rip), %r12      # 0x36fb8
leaq 0x52a7(%rip), %rsi      # 0x31471
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 0xadc2(%rip), %rdi      # 0x36fb8
callq 0x4040
movq %rax, %rdi
callq 0x41e0
jmp 0x2c25e
testb %bpl, %bpl
je 0x2c251
movq 0xada7(%rip), %r12      # 0x36fb8
leaq 0x522f(%rip), %rsi      # 0x31447
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 0xad74(%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 0x2c28c
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 0xad5d(%rip), %rdi      # 0x36ff0
leaq 0x51e0(%rip), %rsi      # 0x3147a
movl $0x3b, %edx
callq 0x43b0
movq (%r14), %rsi
movq 0x8(%r14), %rdx
movq 0xad3e(%rip), %rdi      # 0x36ff0
callq 0x43b0
movq %rax, %r14
leaq 0x1c28(%rip), %rsi      # 0x2dee9
movl $0x1, %edx
movq %rax, %rdi
callq 0x43b0
movq %r14, %rdi
callq 0x4150
movl $0x4, %edi
callq 0x4160
movl $0x1, (%rax)
movq 0xac6b(%rip), %rsi      # 0x36f58
movq %rax, %rdi
xorl %edx, %edx
callq 0x45f0
leaq 0x51cc(%rip), %rdi      # 0x314ca
leaq 0x51b1(%rip), %rsi      # 0x314b6
movq %rax, %rdx
movq %r9, %rcx
xorl %eax, %eax
callq 0x44f0
jmp 0x2c369
jmp 0x2c38b
jmp 0x2c38b
jmp 0x2c3c4
jmp 0x2c38b
jmp 0x2c38b
jmp 0x2c3c4
movq %rax, %r14
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x2c34a
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x4340
jmp 0x2c34a
movq %rax, %r14
leaq 0x70(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2c3c7
movq 0x70(%rsp), %rsi
jmp 0x2c3a2
jmp 0x2c3c4
jmp 0x2c369
jmp 0x2c38b
jmp 0x2c38b
jmp 0x2c3c4
movq %rax, %r14
movq 0x30(%rsp), %rdi
cmpq %rbp, %rdi
je 0x2c38e
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x4340
jmp 0x2c38e
jmp 0x2c38b
jmp 0x2c38b
jmp 0x2c3c4
movq %rax, %r14
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x2c3c7
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x4340
jmp 0x2c3c7
movq %rax, %r14
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
jne 0x2c39d
jmp 0x2c3c7
jmp 0x2c3c4
movq %rax, %r14
jmp 0x2c3d4
jmp 0x2c3c4
movq %rax, %r14
leaq 0x80(%rsp), %rdi
callq 0x40d0
movq (%rbx), %rdi
cmpq 0x58(%rsp), %rdi
je 0x2c3ee
movq 0x58(%rsp), %rax
movq (%rax), %rsi
incq %rsi
callq 0x4340
movq %r14, %rdi
callq 0x4620
nop