// File: BenLangmead[P]bowtie/bowtie_inspect.cpp
// Function: driver(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&)
static void driver(
	const string& ebwtFileBase,
	const string& query)
{
	// Adjust
	string adjustedEbwtFileBase = adjustEbwtBase(argv0, ebwtFileBase, verbose);
	if (names_only) {
		print_index_sequence_names(adjustedEbwtFileBase, cout);
		return;
	}
	BitPairReference refs(
		adjustedEbwtFileBase,
		false,
		NULL,
		NULL,
		false,
		false, // don't load sequence (yet)
		false,
		false,
		false, // mmSweep
		verbose,
		verbose);
	if(summarize_only) {
		print_index_summary(adjustedEbwtFileBase, cout, refs);
	} else {
		// Initialize Ebwt object
		Ebwt ebwt(
			adjustedEbwtFileBase,
			-1,                   // don't care about entire-reverse
			true,                 // index is for the forward direction
			-1,                   // offrate (-1 = index default)
			-1,
			false,                // use memory-mapped IO
			false,                // use shared memory
			false,                // sweep memory-mapped memory
			true,                 // load names?
			//true,                 // load SA sample?
			verbose,              // be talkative?
			verbose,              // be talkative at startup?
			false,                // pass up memory exceptions?
			false);               // sanity check?
		// Load whole index into memory
		if(refFromEbwt) {
			ebwt.loadIntoMemory(-1, true, false);
			print_index_sequences<BTRefString >(cout, ebwt, refs);
		} else {
			EList<string> refnames;
			readEbwtRefnames(adjustedEbwtFileBase, refnames);
			print_ref_sequences(
				cout,
				refnames,
				ebwt.plen(),
				adjustedEbwtFileBase);
		}
		// Evict any loaded indexes from memory
		if(ebwt.isInMemory()) {
			ebwt.evictFromMemory();
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x840, %rsp            # imm = 0x840
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq 0x3a4f6(%rip), %rax     # 0x4c1c0
movq %rax, -0x7e0(%rbp)
leaq -0x51(%rbp), %rdi
movq %rdi, -0x7d8(%rbp)
callq 0x5780
movq -0x7e0(%rbp), %rsi
movq -0x7d8(%rbp), %rdx
leaq -0x50(%rbp), %rdi
callq 0x17fb0
jmp 0x11cfa
movq -0x8(%rbp), %rdx
movl 0x3a48c(%rip), %eax     # 0x4c190
testl %eax, %eax
setne %al
movzbl %al, %ecx
leaq -0x30(%rbp), %rdi
leaq -0x50(%rbp), %rsi
callq 0x3cea0
jmp 0x11d1b
leaq -0x50(%rbp), %rdi
callq 0x5888
leaq -0x51(%rbp), %rdi
callq 0x53f0
cmpl $0x0, 0x3a498(%rip)     # 0x4c1cc
je 0x11d96
movq 0x38283(%rip), %rsi     # 0x49fc0
leaq -0x30(%rbp), %rdi
callq 0xf870
jmp 0x11d48
movl $0x1, -0x68(%rbp)
jmp 0x11fb3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x11d77
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x50(%rbp), %rdi
callq 0x5888
leaq -0x51(%rbp), %rdi
callq 0x53f0
jmp 0x11fda
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x11fd1
movl 0x3a3f4(%rip), %eax     # 0x4c190
testl %eax, %eax
setne %al
movzbl %al, %ecx
movq %rsp, %rax
movl %ecx, 0x28(%rax)
movl %ecx, 0x20(%rax)
movl $0x0, 0x18(%rax)
movl $0x0, 0x10(%rax)
movl $0x0, 0x8(%rax)
movl $0x0, (%rax)
xorl %r9d, %r9d
movl %r9d, %r8d
leaq -0x5e0(%rbp), %rdi
leaq -0x30(%rbp), %rsi
movl %r9d, %edx
movq %r8, %rcx
callq 0x1e4d0
jmp 0x11de6
cmpl $0x0, 0x3a3e3(%rip)     # 0x4c1d0
je 0x11e1e
movq 0x381ca(%rip), %rsi     # 0x49fc0
leaq -0x30(%rbp), %rdi
leaq -0x5e0(%rbp), %rdx
callq 0xfc50
jmp 0x11e08
jmp 0x11fa0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x11fc5
movl 0x3a36c(%rip), %eax     # 0x4c190
testl %eax, %eax
setne %al
movzbl %al, %ecx
movq %rsp, %rax
movq %rax, -0x7e8(%rbp)
movl %ecx, 0x28(%rax)
movl %ecx, 0x20(%rax)
movl $0x0, 0x40(%rax)
movl $0x0, 0x38(%rax)
movl $0x0, 0x30(%rax)
movl $0x1, 0x18(%rax)
movl $0x0, 0x10(%rax)
movl $0x0, 0x8(%rax)
movl $0x0, (%rax)
leaq -0x7b0(%rbp), %rdi
leaq -0x30(%rbp), %rsi
movl $0x1, %ecx
movl $0xffffffff, %r9d       # imm = 0xFFFFFFFF
movl %r9d, %edx
movl %r9d, %r8d
callq 0x22190
jmp 0x11e8f
testb $0x1, 0x3a334(%rip)     # 0x4c1ca
je 0x11ee4
leaq -0x7b0(%rbp), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
movl $0x1, %edx
xorl %ecx, %ecx
callq 0x2fb70
jmp 0x11eb2
movq 0x38107(%rip), %rdi     # 0x49fc0
leaq -0x7b0(%rbp), %rsi
leaq -0x5e0(%rbp), %rdx
callq 0x2fbc0
jmp 0x11ece
jmp 0x11f54
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x11f92
leaq -0x7d0(%rbp), %rdi
callq 0x22020
jmp 0x11ef2
leaq -0x30(%rbp), %rdi
leaq -0x7d0(%rbp), %rsi
callq 0xf950
jmp 0x11f04
leaq -0x7b0(%rbp), %rdi
callq 0x22cc0
movq %rax, %rdx
movq 0x380a6(%rip), %rdi     # 0x49fc0
leaq -0x7d0(%rbp), %rsi
leaq -0x30(%rbp), %rcx
callq 0xf480
jmp 0x11f2c
leaq -0x7d0(%rbp), %rdi
callq 0x22160
jmp 0x11f54
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x7d0(%rbp), %rdi
callq 0x22160
jmp 0x11f92
leaq -0x7b0(%rbp), %rdi
callq 0x18060
movb %al, -0x7e9(%rbp)
jmp 0x11f68
movb -0x7e9(%rbp), %al
testb $0x1, %al
jne 0x11f74
jmp 0x11f84
leaq -0x7b0(%rbp), %rdi
callq 0x301a0
jmp 0x11f82
jmp 0x11f84
leaq -0x7b0(%rbp), %rdi
callq 0x22e20
jmp 0x11fa0
leaq -0x7b0(%rbp), %rdi
callq 0x22e20
jmp 0x11fc5
leaq -0x5e0(%rbp), %rdi
callq 0x21ef0
movl $0x0, -0x68(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x5888
addq $0x840, %rsp            # imm = 0x840
popq %rbp
retq
leaq -0x5e0(%rbp), %rdi
callq 0x21ef0
leaq -0x30(%rbp), %rdi
callq 0x5888
movq -0x60(%rbp), %rdi
callq 0x5760
nopw %cs:(%rax,%rax)