// File: /workspace/github_cpp_makefile_star2_O3/BenLangmead[P]bowtie/bowtie_inspect.cpp
// Function: print_index_summary(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::ostream&, BitPairReference const&)
void print_index_summary(
	const string& fname,
	ostream& fout,
	const BitPairReference& refs)
{
	int32_t flags = readFlags(fname);
	int32_t flagsr = readFlags(fname + ".rev");
	bool entireReverse = readEntireReverse(fname + ".rev");
	Ebwt ebwt(
		fname,
		-1,                   // don't require 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?
		//false,                // load SA sample?
		verbose,              // be talkative?
		verbose,              // be talkative at startup?
		false,                // pass up memory exceptions?
		false);               // sanity check?
	EList<string> p_refnames;
	readEbwtRefnames(fname, p_refnames);
	if(extra) {
		cout << "Flags" << '\t' << (-flags) << endl;
		cout << "Reverse flags" << '\t' << (-flagsr) << endl;
	}
	if(extra) {
		cout << "Concat then reverse" << '\t' << (entireReverse ? "1" : "0") << endl;
		cout << "Reverse then concat" << '\t' << (entireReverse ? "0" : "1") << endl;
		cout << "nPat" << '\t' << ebwt.nPat() << endl;
		cout << "refnames.size()" << '\t' << p_refnames.size() << endl;
		cout << "refs.numRefs()" << '\t' << refs.numRefs() << endl;
		cout << "refs.numNonGapRefs()" << '\t' << refs.numNonGapRefs() << endl;
	}
	cout << "SA-Sample" << "\t1 in " << (1 << ebwt.eh().offRate()) << endl;
	cout << "FTab-Chars" << '\t' << ebwt.eh().ftabChars() << endl;
	for(size_t i = 0; i < ebwt.nPat(); i++) {
		cout << "Sequence-" << (i+1)
		     << '\t' << p_refnames[refs.expandIdx((uint32_t)i)]
		     << '\t' << (ebwt.plen()[i])
		     << endl;
	}
	if(extra) {
		cout << "RefRecords:\n";
		for(size_t i = 0; i < refs.refRecords().size(); i++) {
			RefRecord r = refs.refRecords()[i];
			cout << r.first << "\t(" << r.off << ", " << r.len << ")" << endl;
		}
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x208, %rsp            # imm = 0x208
movq %rdx, 0x10(%rsp)
movq %rdi, %r15
callq 0xcc80
movl %eax, %r14d
leaq 0x48(%rsp), %r13
movq %r13, -0x10(%r13)
movq (%r15), %rsi
movq 0x8(%r15), %rdx
addq %rsi, %rdx
leaq 0x38(%rsp), %rbx
movq %rbx, %rdi
callq 0x21612
leaq 0x208a7(%rip), %rsi     # 0x2cd6e
movq %rbx, %rdi
callq 0x46a0
leaq 0x38(%rsp), %rdi
callq 0xcc80
movl %eax, %ebp
movq 0x38(%rsp), %rdi
cmpq %r13, %rdi
je 0xc4f2
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x4340
leaq 0x38(%rsp), %rbx
movq %r13, (%rbx)
movq (%r15), %rsi
movq 0x8(%r15), %rdx
addq %rsi, %rdx
movq %rbx, %rdi
callq 0x21612
leaq 0x2085b(%rip), %rsi     # 0x2cd6e
movq %rbx, %rdi
callq 0x46a0
leaq 0x38(%rsp), %rdi
callq 0xcc80
testl %eax, %eax
jns 0xc532
negl %eax
movb $0x1, %r12b
testb $0x4, %al
jne 0xc535
xorl %r12d, %r12d
movq 0x38(%rsp), %rdi
cmpq %r13, %rdi
je 0xc54c
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x4340
xorl %ebx, %ebx
xorl %eax, %eax
cmpl %ebx, 0x2cb5a(%rip)     # 0x390b0
setne %al
subq $0x8, %rsp
leaq 0x40(%rsp), %rdi
movq %r15, %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movl $0x1, %ecx
movl $0xffffffff, %r8d       # imm = 0xFFFFFFFF
movl $0xffffffff, %r9d       # imm = 0xFFFFFFFF
pushq %rbx
pushq %rbx
pushq %rbx
pushq %rax
pushq %rax
pushq $0x1
pushq %rbx
pushq %rbx
pushq %rbx
callq 0x17a8a
addq $0x50, %rsp
movabsq $-0x100000000, %rax     # imm = 0xFFFFFFFF00000000
leaq 0x18(%rsp), %rsi
movq %rax, (%rsi)
movq %rbx, 0x8(%rsi)
movq $0x80, 0x10(%rsi)
movq %rbx, 0x18(%rsi)
movq %r15, %rdi
callq 0xba6f
cmpb $0x1, 0x2cb19(%rip)     # 0x390d8
jne 0xc944
movq 0x2a9ec(%rip), %rdi     # 0x36fb8
leaq 0x207a0(%rip), %rsi     # 0x2cd73
movl $0x5, %edx
callq 0x43b0
leaq 0xf(%rsp), %rsi
movb $0x9, (%rsi)
movq 0x2a9cc(%rip), %rdi     # 0x36fb8
movl $0x1, %edx
callq 0x43b0
negl %r14d
movq %rax, %rdi
movl %r14d, %esi
callq 0x4610
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x4300
movsbl %al, %esi
movq %rbx, %rdi
callq 0x4040
movq %rax, %rdi
callq 0x41e0
movq 0x2a983(%rip), %rdi     # 0x36fb8
leaq 0x2073d(%rip), %rsi     # 0x2cd79
movl $0xd, %edx
callq 0x43b0
leaq 0xf(%rsp), %rsi
movb $0x9, (%rsi)
movq 0x2a963(%rip), %rdi     # 0x36fb8
movl $0x1, %edx
callq 0x43b0
negl %ebp
movq %rax, %rdi
movl %ebp, %esi
callq 0x4610
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x4300
movsbl %al, %esi
movq %rbx, %rdi
callq 0x4040
movq %rax, %rdi
callq 0x41e0
cmpb $0x1, 0x2ca3c(%rip)     # 0x390d8
jne 0xc944
movq 0x2a90f(%rip), %rdi     # 0x36fb8
leaq 0x206d7(%rip), %rsi     # 0x2cd87
movl $0x13, %edx
callq 0x43b0
leaq 0xf(%rsp), %rsi
movb $0x9, (%rsi)
movq 0x2a8ef(%rip), %rdi     # 0x36fb8
movl $0x1, %edx
callq 0x43b0
movq %rax, %r15
leaq 0x20fe3(%rip), %r14     # 0x2d6c0
leaq 0x20fa4(%rip), %rbx     # 0x2d688
testb %r12b, %r12b
movq %rbx, %rsi
cmovneq %r14, %rsi
movl $0x1, %edx
movq %rax, %rdi
callq 0x43b0
movq (%r15), %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
movq 0x2a88f(%rip), %rdi     # 0x36fb8
leaq 0x2066b(%rip), %rsi     # 0x2cd9b
movl $0x13, %edx
callq 0x43b0
leaq 0xf(%rsp), %rsi
movb $0x9, (%rsi)
movq 0x2a86f(%rip), %rdi     # 0x36fb8
movl $0x1, %edx
callq 0x43b0
movq %rax, %r15
testb %r12b, %r12b
cmovneq %rbx, %r14
movl $0x1, %edx
movq %rax, %rdi
movq %r14, %rsi
callq 0x43b0
movq (%r15), %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
movq 0x2a81d(%rip), %rdi     # 0x36fb8
leaq 0x2060d(%rip), %rsi     # 0x2cdaf
movl $0x4, %edx
callq 0x43b0
leaq 0xf(%rsp), %rsi
movb $0x9, (%rsi)
movq 0x2a7fd(%rip), %rdi     # 0x36fb8
movl $0x1, %edx
callq 0x43b0
movq 0xb8(%rsp), %rsi
movq %rax, %rdi
callq 0x41d0
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x4300
movsbl %al, %esi
movq %rbx, %rdi
callq 0x4040
movq %rax, %rdi
callq 0x41e0
movq 0x2a7b2(%rip), %rdi     # 0x36fb8
leaq 0x205a7(%rip), %rsi     # 0x2cdb4
movl $0xf, %edx
callq 0x43b0
leaq 0xf(%rsp), %rsi
movb $0x9, (%rsi)
movq 0x2a792(%rip), %rdi     # 0x36fb8
movl $0x1, %edx
callq 0x43b0
movq 0x30(%rsp), %rsi
movq %rax, %rdi
callq 0x41d0
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x4300
movsbl %al, %esi
movq %rbx, %rdi
callq 0x4040
movq %rax, %rdi
callq 0x41e0
movq 0x2a74a(%rip), %rdi     # 0x36fb8
leaq 0x2054f(%rip), %rsi     # 0x2cdc4
movl $0xe, %edx
callq 0x43b0
leaq 0xf(%rsp), %rsi
movb $0x9, (%rsi)
movq 0x2a72a(%rip), %rdi     # 0x36fb8
movl $0x1, %edx
callq 0x43b0
movq 0x10(%rsp), %rcx
movq 0x560(%rcx), %rsi
movq %rax, %rdi
callq 0x41d0
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x4300
movsbl %al, %esi
movq %rbx, %rdi
callq 0x4040
movq %rax, %rdi
callq 0x41e0
movq 0x2a6db(%rip), %rdi     # 0x36fb8
leaq 0x204ef(%rip), %rsi     # 0x2cdd3
movl $0x14, %edx
callq 0x43b0
leaq 0xf(%rsp), %rsi
movb $0x9, (%rsi)
movq 0x2a6bb(%rip), %rdi     # 0x36fb8
movl $0x1, %edx
callq 0x43b0
movq 0x10(%rsp), %rcx
movl 0x568(%rcx), %esi
movq %rax, %rdi
callq 0x41d0
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x4300
movsbl %al, %esi
movq %rbx, %rdi
callq 0x4040
movq %rax, %rdi
callq 0x41e0
movq 0x2a66d(%rip), %rdi     # 0x36fb8
leaq 0x20496(%rip), %rsi     # 0x2cde8
movl $0x9, %edx
callq 0x43b0
movq 0x2a655(%rip), %rdi     # 0x36fb8
leaq 0x20488(%rip), %rsi     # 0x2cdf2
movl $0x6, %edx
callq 0x43b0
movb 0x16c(%rsp), %cl
movl $0x1, %esi
shll %cl, %esi
movq 0x2a62f(%rip), %rdi     # 0x36fb8
callq 0x4610
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x4300
movsbl %al, %esi
movq %rbx, %rdi
callq 0x4040
movq %rax, %rdi
callq 0x41e0
movq 0x2a5f9(%rip), %rdi     # 0x36fb8
leaq 0x20433(%rip), %rsi     # 0x2cdf9
movl $0xa, %edx
callq 0x43b0
leaq 0xf(%rsp), %rsi
movb $0x9, (%rsi)
movq 0x2a5d9(%rip), %rdi     # 0x36fb8
movl $0x1, %edx
callq 0x43b0
movl 0x180(%rsp), %esi
movq %rax, %rdi
callq 0x4610
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x4300
movsbl %al, %esi
movq %rbx, %rdi
callq 0x4040
movq %rax, %rdi
callq 0x41e0
xorl %r15d, %r15d
movq 0x2a58c(%rip), %r14     # 0x36fb8
leaq 0xf(%rsp), %r12
leaq 0x18(%rsp), %r13
cmpq 0xb8(%rsp), %r15
jae 0xcb05
movl $0x9, %edx
movq %r14, %rdi
leaq 0x203b1(%rip), %rsi     # 0x2ce04
callq 0x43b0
leaq 0x1(%r15), %rbp
movq %r14, %rdi
movq %rbp, %rsi
callq 0x41d0
movb $0x9, 0xf(%rsp)
movl $0x1, %edx
movq %rax, %rdi
movq %r12, %rsi
callq 0x43b0
movq %rax, %rbx
decq %rbp
movq 0x10(%rsp), %rdi
movl %ebp, %esi
callq 0x17f3c
movl %eax, %esi
movq %r13, %rdi
callq 0x179c4
movq (%rax), %rsi
movq 0x8(%rax), %rdx
movq %rbx, %rdi
callq 0x43b0
movb $0x9, 0xf(%rsp)
movl $0x1, %edx
movq %rax, %rdi
movq %r12, %rsi
callq 0x43b0
movq 0xc8(%rsp), %rcx
movq (%rcx,%r15,8), %rsi
movq %rax, %rdi
callq 0x41d0
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x4300
movsbl %al, %esi
movq %rbx, %rdi
callq 0x4040
incq %rbp
movq %rax, %rdi
callq 0x41e0
movq %rbp, %r15
jmp 0xca36
cmpb $0x0, 0x2c5cc(%rip)     # 0x390d8
je 0xcc0b
movq 0x2a49f(%rip), %rdi     # 0x36fb8
leaq 0x202ee(%rip), %rsi     # 0x2ce0e
movl $0xc, %edx
callq 0x43b0
movq 0x10(%rsp), %rax
cmpq $0x0, 0x418(%rax)
je 0xcc0b
movq 0x10(%rsp), %rax
leaq 0x400(%rax), %r14
xorl %r15d, %r15d
leaq 0x21852(%rip), %r12     # 0x2e3a5
movq %r14, %rdi
movq %r15, %rsi
callq 0x1800c
movq (%rax), %rbx
movq 0x8(%rax), %r13
movzbl 0x10(%rax), %esi
andl $0x1, %esi
movq 0x2a445(%rip), %rdi     # 0x36fb8
callq 0x4590
movq %rax, %rbp
movl $0x2, %edx
movq %rax, %rdi
leaq 0x20291(%rip), %rsi     # 0x2ce1b
callq 0x43b0
movq %rbp, %rdi
movq %rbx, %rsi
callq 0x41d0
movq %rax, %rbx
movl $0x2, %edx
movq %rax, %rdi
leaq 0x1fbbb(%rip), %rsi     # 0x2c767
callq 0x43b0
movq %rbx, %rdi
movq %r13, %rsi
callq 0x41d0
movq %rax, %rbx
movl $0x1, %edx
movq %rax, %rdi
movq %r12, %rsi
callq 0x43b0
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x4300
movsbl %al, %esi
movq %rbx, %rdi
callq 0x4040
movq %rax, %rdi
callq 0x41e0
incq %r15
movq 0x10(%rsp), %rax
cmpq 0x418(%rax), %r15
jb 0xcb53
leaq 0x18(%rsp), %rdi
callq 0x21874
leaq 0x38(%rsp), %rdi
callq 0x180d4
addq $0x208, %rsp            # imm = 0x208
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xcc78
jmp 0xcc39
jmp 0xcc39
jmp 0xcc39
movq %rax, %rbx
movq 0x38(%rsp), %rdi
cmpq %r13, %rdi
je 0xcc70
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x4340
jmp 0xcc70
jmp 0xcc59
jmp 0xcc59
movq %rax, %rbx
leaq 0x18(%rsp), %rdi
callq 0x21874
leaq 0x38(%rsp), %rdi
callq 0x180d4
movq %rbx, %rdi
callq 0x4620
movq %rax, %rdi
callq 0x100de