// File: /workspace/github_cpp_makefile_star2_O1/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 0xcdeb
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 0x21b84
leaq 0x216ac(%rip), %rsi     # 0x2dcde
movq %rbx, %rdi
callq 0x46a0
leaq 0x38(%rsp), %rdi
callq 0xcdeb
movl %eax, %ebp
movq 0x38(%rsp), %rdi
cmpq %r13, %rdi
je 0xc65d
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 0x21b84
leaq 0x21660(%rip), %rsi     # 0x2dcde
movq %rbx, %rdi
callq 0x46a0
leaq 0x38(%rsp), %rdi
callq 0xcdeb
testl %eax, %eax
jns 0xc69d
negl %eax
movb $0x1, %r12b
testb $0x4, %al
jne 0xc6a0
xorl %r12d, %r12d
movq 0x38(%rsp), %rdi
cmpq %r13, %rdi
je 0xc6b7
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x4340
xorl %ebx, %ebx
xorl %eax, %eax
cmpl %ebx, 0x2c9ef(%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 0x17c64
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 0xbbd7
cmpb $0x1, 0x2c9ae(%rip)     # 0x390d8
jne 0xc800
movq 0x2a881(%rip), %rdi     # 0x36fb8
leaq 0x215a5(%rip), %rsi     # 0x2dce3
movl $0x5, %edx
callq 0x43b0
leaq 0xf(%rsp), %rsi
movb $0x9, (%rsi)
movq 0x2a861(%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 0x2a818(%rip), %rdi     # 0x36fb8
leaq 0x21542(%rip), %rsi     # 0x2dce9
movl $0xd, %edx
callq 0x43b0
leaq 0xf(%rsp), %rsi
movb $0x9, (%rsi)
movq 0x2a7f8(%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, 0x2c8d1(%rip)     # 0x390d8
jne 0xcaaf
movq 0x2a7a4(%rip), %rdi     # 0x36fb8
leaq 0x214dc(%rip), %rsi     # 0x2dcf7
movl $0x13, %edx
callq 0x43b0
leaq 0xf(%rsp), %rsi
movb $0x9, (%rsi)
movq 0x2a784(%rip), %rdi     # 0x36fb8
movl $0x1, %edx
callq 0x43b0
movq %rax, %r15
leaq 0x21de8(%rip), %r14     # 0x2e630
leaq 0x21da9(%rip), %rbx     # 0x2e5f8
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 0x2a724(%rip), %rdi     # 0x36fb8
leaq 0x21470(%rip), %rsi     # 0x2dd0b
movl $0x13, %edx
callq 0x43b0
leaq 0xf(%rsp), %rsi
movb $0x9, (%rsi)
movq 0x2a704(%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 0x2a6b2(%rip), %rdi     # 0x36fb8
leaq 0x21412(%rip), %rsi     # 0x2dd1f
movl $0x4, %edx
callq 0x43b0
leaq 0xf(%rsp), %rsi
movb $0x9, (%rsi)
movq 0x2a692(%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 0x2a647(%rip), %rdi     # 0x36fb8
leaq 0x213ac(%rip), %rsi     # 0x2dd24
movl $0xf, %edx
callq 0x43b0
leaq 0xf(%rsp), %rsi
movb $0x9, (%rsi)
movq 0x2a627(%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 0x2a5df(%rip), %rdi     # 0x36fb8
leaq 0x21354(%rip), %rsi     # 0x2dd34
movl $0xe, %edx
callq 0x43b0
leaq 0xf(%rsp), %rsi
movb $0x9, (%rsi)
movq 0x2a5bf(%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 0x2a570(%rip), %rdi     # 0x36fb8
leaq 0x212f4(%rip), %rsi     # 0x2dd43
movl $0x14, %edx
callq 0x43b0
leaq 0xf(%rsp), %rsi
movb $0x9, (%rsi)
movq 0x2a550(%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 0x2a502(%rip), %rdi     # 0x36fb8
leaq 0x2129b(%rip), %rsi     # 0x2dd58
movl $0x9, %edx
callq 0x43b0
movq 0x2a4ea(%rip), %rdi     # 0x36fb8
leaq 0x2128d(%rip), %rsi     # 0x2dd62
movl $0x6, %edx
callq 0x43b0
movb 0x16c(%rsp), %cl
movl $0x1, %esi
shll %cl, %esi
movq 0x2a4c4(%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 0x2a48e(%rip), %rdi     # 0x36fb8
leaq 0x21238(%rip), %rsi     # 0x2dd69
movl $0xa, %edx
callq 0x43b0
leaq 0xf(%rsp), %rsi
movb $0x9, (%rsi)
movq 0x2a46e(%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 0x2a421(%rip), %r14     # 0x36fb8
leaq 0xf(%rsp), %r12
leaq 0x18(%rsp), %r13
cmpq 0xb8(%rsp), %r15
jae 0xcc70
movl $0x9, %edx
movq %r14, %rdi
leaq 0x211b6(%rip), %rsi     # 0x2dd74
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 0x18414
movl %eax, %esi
movq %r13, %rdi
callq 0x17b9e
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 0xcba1
cmpb $0x0, 0x2c461(%rip)     # 0x390d8
je 0xcd76
movq 0x2a334(%rip), %rdi     # 0x36fb8
leaq 0x210f3(%rip), %rsi     # 0x2dd7e
movl $0xc, %edx
callq 0x43b0
movq 0x10(%rsp), %rax
cmpq $0x0, 0x418(%rax)
je 0xcd76
movq 0x10(%rsp), %rax
leaq 0x400(%rax), %r14
xorl %r15d, %r15d
leaq 0x22657(%rip), %r12     # 0x2f315
movq %r14, %rdi
movq %r15, %rsi
callq 0x184e4
movq (%rax), %rbx
movq 0x8(%rax), %r13
movzbl 0x10(%rax), %esi
andl $0x1, %esi
movq 0x2a2da(%rip), %rdi     # 0x36fb8
callq 0x4590
movq %rax, %rbp
movl $0x2, %edx
movq %rax, %rdi
leaq 0x21096(%rip), %rsi     # 0x2dd8b
callq 0x43b0
movq %rbp, %rdi
movq %rbx, %rsi
callq 0x41d0
movq %rax, %rbx
movl $0x2, %edx
movq %rax, %rdi
leaq 0x209c0(%rip), %rsi     # 0x2d6d7
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 0xccbe
leaq 0x18(%rsp), %rdi
callq 0x21ddc
leaq 0x38(%rsp), %rdi
callq 0x185ac
addq $0x208, %rsp            # imm = 0x208
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xcde3
jmp 0xcda4
jmp 0xcda4
jmp 0xcda4
movq %rax, %rbx
movq 0x38(%rsp), %rdi
cmpq %r13, %rdi
je 0xcddb
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x4340
jmp 0xcddb
jmp 0xcdc4
jmp 0xcdc4
movq %rax, %rbx
leaq 0x18(%rsp), %rdi
callq 0x21ddc
leaq 0x38(%rsp), %rdi
callq 0x185ac
movq %rbx, %rdi
callq 0x4620
movq %rax, %rdi
callq 0x102f6