// File: /workspace/github_cpp_makefile_star2_O2/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 $0x1f8, %rsp            # imm = 0x1F8
movq %rdx, (%rsp)
movq %rdi, %r12
callq 0xb402
movl %eax, %r15d
leaq 0x1ddbf(%rip), %rdx     # 0x28d01
leaq 0x28(%rsp), %rbx
movq %rbx, %rdi
movq %r12, %rsi
callq 0xf2e5
movq %rbx, %rdi
callq 0xb402
movl %eax, %r14d
leaq 0x28(%rsp), %rdi
callq 0x46c8
leaq 0x1dd93(%rip), %rdx     # 0x28d01
leaq 0x28(%rsp), %rbx
movq %rbx, %rdi
movq %r12, %rsi
callq 0xf2e5
movq %rbx, %rdi
callq 0xb402
testl %eax, %eax
jns 0xaf93
negl %eax
movb $0x1, %r13b
testb $0x4, %al
jne 0xaf96
xorl %r13d, %r13d
leaq 0x28(%rsp), %rdi
callq 0x46c8
xorl %eax, %eax
cmpl $0x0, 0x2b0f7(%rip)     # 0x360a0
setne %al
subq $0x8, %rsp
leaq 0x30(%rsp), %rdi
pushq $0x1
popq %rbp
pushq $-0x1
popq %rdx
movq %r12, %rsi
movl %ebp, %ecx
movl %edx, %r8d
movl %edx, %r9d
pushq $0x0
pushq $0x0
pushq $0x0
pushq %rax
pushq %rax
pushq $0x1
pushq $0x0
pushq $0x0
pushq $0x0
callq 0x141b0
addq $0x50, %rsp
movabsq $-0x100000000, %rax     # imm = 0xFFFFFFFF00000000
leaq 0x8(%rsp), %rsi
movq %rax, (%rsi)
andq $0x0, 0x8(%rsi)
movq $0x80, 0x10(%rsi)
andq $0x0, 0x18(%rsi)
movq %r12, %rdi
callq 0xa7c4
cmpb $0x1, 0x2b0b6(%rip)     # 0x360c8
jne 0xb1e5
movq 0x28f99(%rip), %rdi     # 0x33fb8
leaq 0x1dce0(%rip), %rsi     # 0x28d06
callq 0x42d0
pushq $0x9
popq %rsi
movq %rax, %rdi
callq 0x4380
negl %r15d
movq %rax, %rdi
movl %r15d, %esi
callq 0x45d0
movq %rax, %rdi
callq 0x4130
movq 0x28f65(%rip), %rdi     # 0x33fb8
leaq 0x1dcb2(%rip), %rsi     # 0x28d0c
callq 0x42d0
pushq $0x9
popq %rsi
movq %rax, %rdi
callq 0x4380
negl %r14d
movq %rax, %rdi
movl %r14d, %esi
callq 0x45d0
movq %rax, %rdi
callq 0x4130
cmpb $0x1, 0x2b041(%rip)     # 0x360c8
jne 0xb1e5
movq 0x28f24(%rip), %rdi     # 0x33fb8
leaq 0x1dc7f(%rip), %rsi     # 0x28d1a
callq 0x42d0
pushq $0x9
popq %rsi
movq %rax, %rdi
callq 0x4380
leaq 0x1e5a1(%rip), %rbx     # 0x29653
leaq 0x1e562(%rip), %r14     # 0x2961b
testb %r13b, %r13b
movq %r14, %rsi
cmovneq %rbx, %rsi
movq %rax, %rdi
callq 0x42d0
movq %rax, %rdi
callq 0x4130
movq 0x28ede(%rip), %rdi     # 0x33fb8
leaq 0x1dc4d(%rip), %rsi     # 0x28d2e
callq 0x42d0
pushq $0x9
popq %rsi
movq %rax, %rdi
callq 0x4380
testb %r13b, %r13b
cmovneq %r14, %rbx
movq %rax, %rdi
movq %rbx, %rsi
callq 0x42d0
movq %rax, %rdi
callq 0x4130
movq 0x28ea6(%rip), %rdi     # 0x33fb8
leaq 0x1dc29(%rip), %rsi     # 0x28d42
callq 0x42d0
pushq $0x9
popq %rsi
movq %rax, %rdi
callq 0x4380
movq 0xa8(%rsp), %rsi
movq %rax, %rdi
callq 0x41a0
movq %rax, %rdi
callq 0x4130
movq 0x28e70(%rip), %rdi     # 0x33fb8
leaq 0x1dbf8(%rip), %rsi     # 0x28d47
callq 0x42d0
pushq $0x9
popq %rsi
movq %rax, %rdi
callq 0x4380
movq 0x20(%rsp), %rsi
movq %rax, %rdi
callq 0x41a0
movq %rax, %rdi
callq 0x4130
movq 0x28e3d(%rip), %rdi     # 0x33fb8
leaq 0x1dbd5(%rip), %rsi     # 0x28d57
callq 0x42d0
pushq $0x9
popq %rsi
movq %rax, %rdi
callq 0x4380
movq (%rsp), %rcx
movq 0x560(%rcx), %rsi
movq %rax, %rdi
callq 0x41a0
movq %rax, %rdi
callq 0x4130
movq 0x28e04(%rip), %rdi     # 0x33fb8
leaq 0x1dbab(%rip), %rsi     # 0x28d66
callq 0x42d0
pushq $0x9
popq %rsi
movq %rax, %rdi
callq 0x4380
movq (%rsp), %rcx
movl 0x568(%rcx), %esi
movq %rax, %rdi
callq 0x41a0
movq %rax, %rdi
callq 0x4130
movq 0x28dcc(%rip), %rdi     # 0x33fb8
leaq 0x1db88(%rip), %rsi     # 0x28d7b
callq 0x42d0
leaq 0x1db86(%rip), %rsi     # 0x28d85
movq %rax, %rdi
callq 0x42d0
movb 0x15c(%rsp), %cl
shll %cl, %ebp
movq %rax, %rdi
movl %ebp, %esi
callq 0x45d0
movq %rax, %rdi
callq 0x4130
movq 0x28d8f(%rip), %rdi     # 0x33fb8
leaq 0x1db5c(%rip), %rsi     # 0x28d8c
callq 0x42d0
pushq $0x9
popq %rsi
movq %rax, %rdi
callq 0x4380
movl 0x170(%rsp), %esi
movq %rax, %rdi
callq 0x45d0
movq %rax, %rdi
callq 0x4130
xorl %r14d, %r14d
leaq 0x1db36(%rip), %r15     # 0x28d97
pushq $0x9
popq %rbp
leaq 0x8(%rsp), %r12
cmpq 0xa8(%rsp), %r14
jae 0xb2f2
movq 0x28d3e(%rip), %rdi     # 0x33fb8
movq %r15, %rsi
callq 0x42d0
leaq 0x1(%r14), %rbx
movq %rax, %rdi
movq %rbx, %rsi
callq 0x41a0
movq %rax, %rdi
movl %ebp, %esi
callq 0x4380
movq %rax, %r13
decq %rbx
movq (%rsp), %rdi
movl %ebx, %esi
callq 0x14708
movl %eax, %esi
movq %r12, %rdi
callq 0x140da
movq %r13, %rdi
movq %rax, %rsi
callq 0x4270
movq %rax, %rdi
movl %ebp, %esi
callq 0x4380
movq 0xb8(%rsp), %rcx
movq (%rcx,%r14,8), %rsi
movq %rax, %rdi
callq 0x41a0
incq %rbx
movq %rax, %rdi
callq 0x4130
movq %rbx, %r14
jmp 0xb269
cmpb $0x0, 0x2adcf(%rip)     # 0x360c8
je 0xb3a8
movq 0x28cb2(%rip), %rdi     # 0x33fb8
leaq 0x1da94(%rip), %rsi     # 0x28da1
callq 0x42d0
movq (%rsp), %rax
leaq 0x400(%rax), %r14
xorl %r15d, %r15d
leaq 0x1d3d3(%rip), %rbp     # 0x286fa
leaq 0x1f0ea(%rip), %rbx     # 0x2a418
movq (%rsp), %rax
cmpq 0x418(%rax), %r15
jae 0xb3a8
movq %r14, %rdi
movq %r15, %rsi
callq 0x147d8
movq (%rax), %r13
movq 0x8(%rax), %r12
movzbl 0x10(%rax), %esi
andl $0x1, %esi
movq 0x28c5d(%rip), %rdi     # 0x33fb8
callq 0x4550
movq %rax, %rdi
leaq 0x1da44(%rip), %rsi     # 0x28dae
callq 0x42d0
movq %rax, %rdi
movq %r13, %rsi
callq 0x41a0
movq %rax, %rdi
movq %rbp, %rsi
callq 0x42d0
movq %rax, %rdi
movq %r12, %rsi
callq 0x41a0
movq %rax, %rdi
movq %rbx, %rsi
callq 0x42d0
movq %rax, %rdi
callq 0x4130
incq %r15
jmp 0xb32e
leaq 0x8(%rsp), %rdi
callq 0x141a0
leaq 0x28(%rsp), %rdi
callq 0x1489c
addq $0x1f8, %rsp            # imm = 0x1F8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xb3d0
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x46c8
jmp 0xb3fa
jmp 0xb3e3
jmp 0xb3e3
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x141a0
leaq 0x28(%rsp), %rdi
callq 0x1489c
movq %rbx, %rdi
callq 0x45e0