// File: 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
movq %rsp, %rbp
subq $0x4f0, %rsp            # imm = 0x4F0
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rdi
callq 0x10640
movl %eax, -0x1c(%rbp)
movq -0x8(%rbp), %rsi
leaq 0x3009a(%rip), %rdx     # 0x3fd18
leaq -0x40(%rbp), %rdi
movq %rdi, -0x2a0(%rbp)
callq 0x1a930
movq -0x2a0(%rbp), %rdi
callq 0x10640
movl %eax, -0x294(%rbp)
jmp 0xfca2
leaq -0x40(%rbp), %rdi
callq 0x5888
movl -0x294(%rbp), %eax
movl %eax, -0x20(%rbp)
movq -0x8(%rbp), %rsi
leaq 0x30059(%rip), %rdx     # 0x3fd18
leaq -0x70(%rbp), %rdi
movq %rdi, -0x2b0(%rbp)
callq 0x1a930
movq -0x2b0(%rbp), %rdi
callq 0x10e20
movb %al, -0x2a1(%rbp)
jmp 0xfce3
leaq -0x70(%rbp), %rdi
callq 0x5888
movb -0x2a1(%rbp), %al
andb $0x1, %al
movb %al, -0x4d(%rbp)
movq -0x8(%rbp), %rsi
movl 0x3c48f(%rip), %eax     # 0x4c190
testl %eax, %eax
setne %al
movzbl %al, %ecx
movq %rsp, %rax
movq %rax, -0x2b8(%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 -0x240(%rbp), %rdi
movl $0x1, %ecx
movl $0xffffffff, %r9d       # imm = 0xFFFFFFFF
movl %r9d, %edx
movl %r9d, %r8d
callq 0x22190
leaq -0x260(%rbp), %rdi
callq 0x22020
jmp 0xfd74
movq -0x8(%rbp), %rdi
leaq -0x260(%rbp), %rsi
callq 0xf950
jmp 0xfd86
testb $0x1, 0x3c42b(%rip)     # 0x4c1b8
je 0xfec1
movq 0x3a226(%rip), %rdi     # 0x49fc0
leaq 0x2ff7c(%rip), %rsi     # 0x3fd1d
callq 0x5360
movq %rax, -0x2c0(%rbp)
jmp 0xfdaf
movq -0x2c0(%rbp), %rdi
movl $0x9, %esi
callq 0x54a0
movq %rax, -0x2c8(%rbp)
jmp 0xfdc9
movq -0x2c8(%rbp), %rdi
movl -0x1c(%rbp), %esi
negl %esi
callq 0x5750
movq %rax, -0x2d0(%rbp)
jmp 0xfde3
movq -0x2d0(%rbp), %rdi
movq 0x3a18f(%rip), %rsi     # 0x49f80
callq 0x53c0
jmp 0xfdf8
movq 0x3a1c1(%rip), %rdi     # 0x49fc0
leaq 0x2ff1d(%rip), %rsi     # 0x3fd23
callq 0x5360
movq %rax, -0x2d8(%rbp)
jmp 0xfe14
movq -0x2d8(%rbp), %rdi
movl $0x9, %esi
callq 0x54a0
movq %rax, -0x2e0(%rbp)
jmp 0xfe2e
movq -0x2e0(%rbp), %rdi
movl -0x20(%rbp), %esi
negl %esi
callq 0x5750
movq %rax, -0x2e8(%rbp)
jmp 0xfe48
movq -0x2e8(%rbp), %rdi
movq 0x3a12a(%rip), %rsi     # 0x49f80
callq 0x53c0
jmp 0xfe5d
jmp 0xfec1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x40(%rbp), %rdi
callq 0x5888
jmp 0x10636
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x70(%rbp), %rdi
callq 0x5888
jmp 0x10636
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x1062a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x260(%rbp), %rdi
callq 0x22160
jmp 0x1062a
testb $0x1, 0x3c2f0(%rip)     # 0x4c1b8
je 0x101d2
movq 0x3a0eb(%rip), %rdi     # 0x49fc0
leaq 0x2fe55(%rip), %rsi     # 0x3fd31
callq 0x5360
movq %rax, -0x2f0(%rbp)
jmp 0xfeea
movq -0x2f0(%rbp), %rdi
movl $0x9, %esi
callq 0x54a0
movq %rax, -0x2f8(%rbp)
jmp 0xff04
testb $0x1, -0x4d(%rbp)
je 0xff1a
leaq 0x30791(%rip), %rax     # 0x406a2
movq %rax, -0x300(%rbp)
jmp 0xff2a
leaq 0x30749(%rip), %rax     # 0x4066a
movq %rax, -0x300(%rbp)
jmp 0xff2a
movq -0x2f8(%rbp), %rdi
movq -0x300(%rbp), %rsi
callq 0x5360
movq %rax, -0x308(%rbp)
jmp 0xff46
movq -0x308(%rbp), %rdi
movq 0x3a02c(%rip), %rsi     # 0x49f80
callq 0x53c0
jmp 0xff5b
movq 0x3a05e(%rip), %rdi     # 0x49fc0
leaq 0x2fddc(%rip), %rsi     # 0x3fd45
callq 0x5360
movq %rax, -0x310(%rbp)
jmp 0xff77
movq -0x310(%rbp), %rdi
movl $0x9, %esi
callq 0x54a0
movq %rax, -0x318(%rbp)
jmp 0xff91
testb $0x1, -0x4d(%rbp)
je 0xffa7
leaq 0x306cc(%rip), %rax     # 0x4066a
movq %rax, -0x320(%rbp)
jmp 0xffb7
leaq 0x306f4(%rip), %rax     # 0x406a2
movq %rax, -0x320(%rbp)
jmp 0xffb7
movq -0x318(%rbp), %rdi
movq -0x320(%rbp), %rsi
callq 0x5360
movq %rax, -0x328(%rbp)
jmp 0xffd3
movq -0x328(%rbp), %rdi
movq 0x39f9f(%rip), %rsi     # 0x49f80
callq 0x53c0
jmp 0xffe8
movq 0x39fd1(%rip), %rdi     # 0x49fc0
leaq 0x2fd63(%rip), %rsi     # 0x3fd59
callq 0x5360
movq %rax, -0x330(%rbp)
jmp 0x10004
movq -0x330(%rbp), %rdi
movl $0x9, %esi
callq 0x54a0
movq %rax, -0x338(%rbp)
jmp 0x1001e
leaq -0x240(%rbp), %rdi
callq 0x22b00
movq %rax, -0x340(%rbp)
jmp 0x10033
movq -0x340(%rbp), %rsi
movq -0x338(%rbp), %rdi
callq 0x50c0
movq %rax, -0x348(%rbp)
jmp 0x1004f
movq -0x348(%rbp), %rdi
movq 0x39f23(%rip), %rsi     # 0x49f80
callq 0x53c0
jmp 0x10064
movq 0x39f55(%rip), %rdi     # 0x49fc0
leaq 0x2fcec(%rip), %rsi     # 0x3fd5e
callq 0x5360
movq %rax, -0x350(%rbp)
jmp 0x10080
movq -0x350(%rbp), %rdi
movl $0x9, %esi
callq 0x54a0
movq %rax, -0x358(%rbp)
jmp 0x1009a
leaq -0x260(%rbp), %rdi
callq 0x1aaa0
movq %rax, -0x360(%rbp)
jmp 0x100af
movq -0x360(%rbp), %rsi
movq -0x358(%rbp), %rdi
callq 0x50c0
movq %rax, -0x368(%rbp)
jmp 0x100cb
movq -0x368(%rbp), %rdi
movq 0x39ea7(%rip), %rsi     # 0x49f80
callq 0x53c0
jmp 0x100e0
movq 0x39ed9(%rip), %rdi     # 0x49fc0
leaq 0x2fc80(%rip), %rsi     # 0x3fd6e
callq 0x5360
movq %rax, -0x370(%rbp)
jmp 0x100fc
movq -0x370(%rbp), %rdi
movl $0x9, %esi
callq 0x54a0
movq %rax, -0x378(%rbp)
jmp 0x10116
movq -0x18(%rbp), %rdi
callq 0x22b20
movq %rax, -0x380(%rbp)
jmp 0x10128
movq -0x380(%rbp), %rsi
movq -0x378(%rbp), %rdi
callq 0x50c0
movq %rax, -0x388(%rbp)
jmp 0x10144
movq -0x388(%rbp), %rdi
movq 0x39e2e(%rip), %rsi     # 0x49f80
callq 0x53c0
jmp 0x10159
movq 0x39e60(%rip), %rdi     # 0x49fc0
leaq 0x2fc16(%rip), %rsi     # 0x3fd7d
callq 0x5360
movq %rax, -0x390(%rbp)
jmp 0x10175
movq -0x390(%rbp), %rdi
movl $0x9, %esi
callq 0x54a0
movq %rax, -0x398(%rbp)
jmp 0x1018f
movq -0x18(%rbp), %rdi
callq 0x21dd0
movl %eax, -0x39c(%rbp)
jmp 0x101a0
movl -0x39c(%rbp), %esi
movq -0x398(%rbp), %rdi
callq 0x5530
movq %rax, -0x3a8(%rbp)
jmp 0x101bb
movq -0x3a8(%rbp), %rdi
movq 0x39db7(%rip), %rsi     # 0x49f80
callq 0x53c0
jmp 0x101d0
jmp 0x101d2
movq 0x39de7(%rip), %rdi     # 0x49fc0
leaq 0x2fbb2(%rip), %rsi     # 0x3fd92
callq 0x5360
movq %rax, -0x3b0(%rbp)
jmp 0x101ee
movq -0x3b0(%rbp), %rdi
leaq 0x2fba0(%rip), %rsi     # 0x3fd9c
callq 0x5360
movq %rax, -0x3b8(%rbp)
jmp 0x1020a
leaq -0x240(%rbp), %rdi
callq 0x22b40
movq %rax, -0x3c0(%rbp)
jmp 0x1021f
movq -0x3c0(%rbp), %rdi
callq 0x22b60
movl %eax, -0x3c4(%rbp)
jmp 0x10233
movq -0x3b8(%rbp), %rdi
movl -0x3c4(%rbp), %eax
movb %al, %cl
movl $0x1, %esi
shll %cl, %esi
callq 0x5750
movq %rax, -0x3d0(%rbp)
jmp 0x10257
movq -0x3d0(%rbp), %rdi
movq 0x39d1b(%rip), %rsi     # 0x49f80
callq 0x53c0
jmp 0x1026c
movq 0x39d4d(%rip), %rdi     # 0x49fc0
leaq 0x2fb29(%rip), %rsi     # 0x3fda3
callq 0x5360
movq %rax, -0x3d8(%rbp)
jmp 0x10288
movq -0x3d8(%rbp), %rdi
movl $0x9, %esi
callq 0x54a0
movq %rax, -0x3e0(%rbp)
jmp 0x102a2
leaq -0x240(%rbp), %rdi
callq 0x22b40
movq %rax, -0x3e8(%rbp)
jmp 0x102b7
movq -0x3e8(%rbp), %rdi
callq 0x22b80
movl %eax, -0x3ec(%rbp)
jmp 0x102cb
movl -0x3ec(%rbp), %esi
movq -0x3e0(%rbp), %rdi
callq 0x5750
movq %rax, -0x3f8(%rbp)
jmp 0x102e6
movq -0x3f8(%rbp), %rdi
movq 0x39c8c(%rip), %rsi     # 0x49f80
callq 0x53c0
jmp 0x102fb
movq $0x0, -0x268(%rbp)
movq -0x268(%rbp), %rax
movq %rax, -0x408(%rbp)
leaq -0x240(%rbp), %rdi
callq 0x22b00
movq %rax, -0x400(%rbp)
jmp 0x10329
movq -0x408(%rbp), %rax
movq -0x400(%rbp), %rcx
cmpq %rcx, %rax
jae 0x1046b
movq 0x39c79(%rip), %rdi     # 0x49fc0
leaq 0x2fa60(%rip), %rsi     # 0x3fdae
callq 0x5360
movq %rax, -0x410(%rbp)
jmp 0x1035c
movq -0x410(%rbp), %rdi
movq -0x268(%rbp), %rsi
incq %rsi
callq 0x50c0
movq %rax, -0x418(%rbp)
jmp 0x1037b
movq -0x418(%rbp), %rdi
movl $0x9, %esi
callq 0x54a0
movq %rax, -0x420(%rbp)
jmp 0x10395
movq -0x18(%rbp), %rdi
movl -0x268(%rbp), %esi
callq 0x22ba0
movl %eax, -0x424(%rbp)
jmp 0x103ac
movl -0x424(%rbp), %eax
movl %eax, %eax
movl %eax, %esi
leaq -0x260(%rbp), %rdi
callq 0x22060
movq %rax, -0x430(%rbp)
jmp 0x103cb
movq -0x430(%rbp), %rsi
movq -0x420(%rbp), %rdi
callq 0x52f0
movq %rax, -0x438(%rbp)
jmp 0x103e7
movq -0x438(%rbp), %rdi
movl $0x9, %esi
callq 0x54a0
movq %rax, -0x440(%rbp)
jmp 0x10401
leaq -0x240(%rbp), %rdi
callq 0x22cc0
movq %rax, -0x448(%rbp)
jmp 0x10416
movq -0x440(%rbp), %rdi
movq -0x448(%rbp), %rax
movq -0x268(%rbp), %rcx
movq (%rax,%rcx,8), %rsi
callq 0x50c0
movq %rax, -0x450(%rbp)
jmp 0x1043d
movq -0x450(%rbp), %rdi
movq 0x39b35(%rip), %rsi     # 0x49f80
callq 0x53c0
jmp 0x10452
jmp 0x10454
movq -0x268(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x268(%rbp)
jmp 0x10306
testb $0x1, 0x3bd46(%rip)     # 0x4c1b8
je 0x10609
movq 0x39b41(%rip), %rdi     # 0x49fc0
leaq 0x2f932(%rip), %rsi     # 0x3fdb8
callq 0x5360
jmp 0x1048d
movq $0x0, -0x270(%rbp)
movq -0x270(%rbp), %rax
movq %rax, -0x460(%rbp)
movq -0x18(%rbp), %rdi
callq 0x22ce0
movq %rax, -0x458(%rbp)
jmp 0x104b8
movq -0x458(%rbp), %rdi
callq 0x22d00
movq %rax, -0x468(%rbp)
jmp 0x104cd
movq -0x460(%rbp), %rax
movq -0x468(%rbp), %rcx
cmpq %rcx, %rax
jae 0x10607
movq -0x18(%rbp), %rdi
callq 0x22ce0
movq %rax, -0x470(%rbp)
jmp 0x104f6
movq -0x470(%rbp), %rdi
movq -0x270(%rbp), %rsi
callq 0x22d20
movq %rax, -0x478(%rbp)
jmp 0x10512
movq -0x478(%rbp), %rax
movq 0x10(%rax), %rcx
movq %rcx, -0x280(%rbp)
movups (%rax), %xmm0
movaps %xmm0, -0x290(%rbp)
movzbl -0x280(%rbp), %esi
andl $0x1, %esi
movq 0x39a81(%rip), %rdi     # 0x49fc0
callq 0x5790
movq %rax, -0x480(%rbp)
jmp 0x1054d
movq -0x480(%rbp), %rdi
leaq 0x2f86a(%rip), %rsi     # 0x3fdc5
callq 0x5360
movq %rax, -0x488(%rbp)
jmp 0x10569
movq -0x488(%rbp), %rdi
movq -0x290(%rbp), %rsi
callq 0x50c0
movq %rax, -0x490(%rbp)
jmp 0x10585
movq -0x490(%rbp), %rdi
leaq 0x2f127(%rip), %rsi     # 0x3f6ba
callq 0x5360
movq %rax, -0x498(%rbp)
jmp 0x105a1
movq -0x498(%rbp), %rdi
movq -0x288(%rbp), %rsi
callq 0x50c0
movq %rax, -0x4a0(%rbp)
jmp 0x105bd
movq -0x4a0(%rbp), %rdi
leaq 0x30fed(%rip), %rsi     # 0x415b8
callq 0x5360
movq %rax, -0x4a8(%rbp)
jmp 0x105d9
movq -0x4a8(%rbp), %rdi
movq 0x39999(%rip), %rsi     # 0x49f80
callq 0x53c0
jmp 0x105ee
jmp 0x105f0
movq -0x270(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x270(%rbp)
jmp 0x10498
jmp 0x10609
leaq -0x260(%rbp), %rdi
callq 0x22160
leaq -0x240(%rbp), %rdi
callq 0x22e20
addq $0x4f0, %rsp            # imm = 0x4F0
popq %rbp
retq
leaq -0x240(%rbp), %rdi
callq 0x22e20
movq -0x48(%rbp), %rdi
callq 0x5760
nop