// File: BenLangmead[P]bowtie/bowtie_inspect.cpp
// Function: print_ref_sequence(std::ostream&, BitPairReference&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, unsigned long, unsigned long)
void print_ref_sequence(
	ostream& fout,
	BitPairReference& ref,
	const string& name,
	size_t refi,
	size_t len)
{
	bool newlines = across > 0;
	int myacross = across > 0 ? across : 60;
	size_t incr = myacross * 1000;
	uint32_t *buf = new uint32_t[(incr + 128)/4];
	fout << ">" << name << "\n";
	for(size_t i = 0; i < len; i += incr) {
		size_t amt = min(incr, len-i);
		assert_leq(amt, incr);
		int off = ref.getStretch(buf, refi, i, amt);
		uint8_t *cb = ((uint8_t*)buf) + off;
		for(size_t j = 0; j < amt; j++) {
			if(newlines && j > 0 && (j % myacross) == 0) fout << "\n";
			assert_range(0, 4, (int)cb[j]);
			fout << "ACGTN"[(int)cb[j]];
		}
		fout << "\n";
	}
	delete[] buf;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x90, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
cmpl $0x0, 0x3b3aa(%rip)     # 0x4a450
setg %al
andb $0x1, %al
movb %al, -0x29(%rbp)
cmpl $0x0, 0x3b39b(%rip)     # 0x4a450
jle 0xf0c2
movl 0x3b393(%rip), %eax     # 0x4a450
movl %eax, -0x80(%rbp)
jmp 0xf0cc
movl $0x3c, %eax
movl %eax, -0x80(%rbp)
jmp 0xf0cc
movl -0x80(%rbp), %eax
movl %eax, -0x30(%rbp)
imull $0x3e8, -0x30(%rbp), %eax # imm = 0x3E8
cltq
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
addq $0x80, %rax
shrq $0x2, %rax
movl $0x4, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
callq 0x5030
movq %rax, -0x40(%rbp)
movq -0x8(%rbp), %rdi
leaq 0x327b2(%rip), %rsi     # 0x418cf
callq 0x5360
movq %rax, %rdi
movq -0x18(%rbp), %rsi
callq 0x52f0
movq %rax, %rdi
leaq 0x30c8b(%rip), %rsi     # 0x3fdc3
callq 0x5360
movq $0x0, -0x48(%rbp)
movq -0x48(%rbp), %rax
cmpq -0x28(%rbp), %rax
jae 0xf337
movq -0x28(%rbp), %rax
subq -0x48(%rbp), %rax
movq %rax, -0x58(%rbp)
leaq -0x38(%rbp), %rdi
leaq -0x58(%rbp), %rsi
callq 0x1b390
movq (%rax), %rax
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rax
cmpq -0x38(%rbp), %rax
jbe 0xf236
movq 0x3ae38(%rip), %rdi     # 0x49fc0
leaq 0x30014(%rip), %rsi     # 0x3f1a3
callq 0x5360
movq %rax, %rdi
movq -0x50(%rbp), %rsi
callq 0x50c0
movq %rax, %rdi
leaq 0x30010(%rip), %rsi     # 0x3f1ba
callq 0x5360
movq %rax, %rdi
movq -0x38(%rbp), %rsi
callq 0x50c0
movq %rax, %rdi
leaq 0x323f3(%rip), %rsi     # 0x415b8
callq 0x5360
movq %rax, %rdi
movq 0x3adac(%rip), %rsi     # 0x49f80
callq 0x53c0
movq 0x3ade0(%rip), %rdi     # 0x49fc0
leaq 0x30a62(%rip), %rsi     # 0x3fc49
callq 0x5360
movq %rax, %rdi
leaq 0x31594(%rip), %rsi     # 0x4078a
callq 0x5360
movq %rax, %rdi
movl $0xca, %esi
callq 0x5750
movq %rax, %rdi
movq 0x3ad6e(%rip), %rsi     # 0x49f80
callq 0x53c0
leaq 0x3144c(%rip), %rdi     # 0x4066a
leaq 0x30a24(%rip), %rsi     # 0x3fc49
movl $0xca, %edx
leaq 0x30a2b(%rip), %rcx     # 0x3fc5c
callq 0x51e0
movq -0x10(%rbp), %rdi
movq -0x40(%rbp), %rsi
movq -0x20(%rbp), %rdx
movq -0x48(%rbp), %rcx
movq -0x50(%rbp), %r8
callq 0x1c8a0
movl %eax, -0x5c(%rbp)
movq -0x40(%rbp), %rax
movslq -0x5c(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x68(%rbp)
movq $0x0, -0x70(%rbp)
movq -0x70(%rbp), %rax
cmpq -0x50(%rbp), %rax
jae 0xf316
testb $0x1, -0x29(%rbp)
je 0xf2a7
cmpq $0x0, -0x70(%rbp)
jbe 0xf2a7
movq -0x70(%rbp), %rax
movslq -0x30(%rbp), %rcx
xorl %edx, %edx
divq %rcx
cmpq $0x0, %rdx
jne 0xf2a7
movq -0x8(%rbp), %rdi
leaq 0x30b21(%rip), %rsi     # 0x3fdc3
callq 0x5360
movl $0x0, -0x74(%rbp)
movl $0x4, -0x78(%rbp)
movq -0x68(%rbp), %rax
movq -0x70(%rbp), %rcx
movzbl (%rax,%rcx), %eax
movl %eax, -0x7c(%rbp)
leaq -0x74(%rbp), %rdi
leaq -0x78(%rbp), %rsi
leaq -0x7c(%rbp), %rdx
leaq 0x30972(%rip), %rcx     # 0x3fc49
movl $0xcf, %r8d
callq 0xf360
movq -0x8(%rbp), %rdi
movq -0x68(%rbp), %rax
movq -0x70(%rbp), %rcx
movzbl (%rax,%rcx), %eax
movslq %eax, %rcx
leaq 0x309b7(%rip), %rax     # 0x3fcb3
movsbl (%rax,%rcx), %esi
callq 0x54a0
movq -0x70(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x70(%rbp)
jmp 0xf269
movq -0x8(%rbp), %rdi
leaq 0x30aa2(%rip), %rsi     # 0x3fdc3
callq 0x5360
movq -0x38(%rbp), %rax
addq -0x48(%rbp), %rax
movq %rax, -0x48(%rbp)
jmp 0xf145
movq -0x40(%rbp), %rax
movq %rax, -0x88(%rbp)
cmpq $0x0, %rax
je 0xf354
movq -0x88(%rbp), %rdi
callq 0x5510
addq $0x90, %rsp
popq %rbp
retq
nopl (%rax)