// File: /workspace/github_cpp_makefile_star2_O1/BenLangmead[P]bowtie/ref_read.cpp
// Function: reverseRefRecords(EList<RefRecord, 128> const&, EList<RefRecord, 128>&, bool, bool)
void reverseRefRecords(const EList<RefRecord>& src,
					   EList<RefRecord>& dst,
					   bool recursive,
					   bool verbose)
{
	dst.clear();
	{
		EList<RefRecord> cur;
		for(int64_t i = (int64_t)src.size()-1; i >= 0; i--) {
			bool first = (i == (int)src.size()-1 || src[i+1].first);
			if(src[i].len) {
				cur.push_back(RefRecord(0, src[i].len, first));
				first = false;
			}
			if(src[i].off) cur.push_back(RefRecord(src[i].off, 0, first));
		}
		for(int64_t i = 0; i < (int64_t)cur.size(); i++) {
			assert(cur[i].off == 0 || cur[i].len == 0);
			if(i < (int64_t)cur.size()-1 && cur[i].off != 0 && !cur[i+1].first) {
				dst.push_back(RefRecord(cur[i].off, cur[i+1].len, cur[i].first));
				i++;
			} else {
				dst.push_back(cur[i]);
			}
		}
	}
	if(verbose) {
		cout << "Source: " << endl;
		printRecords(cout, src);
		cout << "Dest: " << endl;
		printRecords(cout, dst);
	}
#ifndef NDEBUG
	if(!recursive) {
		EList<RefRecord> tmp;
		reverseRefRecords(dst, tmp, true);
		assert_eq(tmp.size(), src.size());
		for(size_t i = 0; i < src.size(); i++) {
			assert_eq(src[i].len, tmp[i].len);
			assert_eq(src[i].off, tmp[i].off);
			assert_eq(src[i].first, tmp[i].first);
		}
	}
#endif
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movl %ecx, 0x2c(%rsp)
movl %edx, %ebx
movq %rsi, %r14
xorl %eax, %eax
movq %rax, 0x18(%rsi)
movabsq $-0x100000000, %rcx     # imm = 0xFFFFFFFF00000000
movq %rcx, 0x8(%rsp)
movq %rax, 0x10(%rsp)
movq $0x80, 0x18(%rsp)
movq %rax, 0x20(%rsp)
movq %rdi, (%rsp)
movq 0x18(%rdi), %rsi
testq %rsi, %rsi
jle 0x2a672
leaq 0x8(%rsp), %r12
leaq 0x30(%rsp), %r13
leaq -0x1(%rsi), %rbp
movq (%rsp), %rdi
movl 0x18(%rdi), %eax
decl %eax
cltq
movb $0x1, %r15b
cmpq %rax, %rbp
je 0x2a5e0
callq 0x184e4
movb 0x10(%rax), %r15b
movq (%rsp), %rdi
movq %rbp, %rsi
callq 0x184e4
cmpq $0x0, 0x8(%rax)
je 0x2a620
movq (%rsp), %rdi
movq %rbp, %rsi
callq 0x184e4
movq 0x8(%rax), %rax
movq $0x0, 0x30(%rsp)
movq %rax, 0x38(%rsp)
movb %r15b, 0x40(%rsp)
movq %r12, %rdi
movq %r13, %rsi
callq 0x1f2a0
xorl %r15d, %r15d
movq (%rsp), %rdi
movq %rbp, %rsi
callq 0x184e4
cmpq $0x0, (%rax)
je 0x2a65f
movq (%rsp), %rdi
movq %rbp, %rsi
callq 0x184e4
movq (%rax), %rax
movq %rax, 0x30(%rsp)
movq $0x0, 0x38(%rsp)
movb %r15b, 0x40(%rsp)
movq %r12, %rdi
movq %r13, %rsi
callq 0x1f2a0
movq %rbp, %rax
incq %rax
movq %rbp, %rsi
cmpq $0x1, %rax
jg 0x2a5bc
movl %ebx, 0x28(%rsp)
cmpq $0x0, 0x20(%rsp)
movq (%rsp), %rbx
jle 0x2a75e
xorl %ebp, %ebp
leaq 0x8(%rsp), %r12
movq %r12, %rdi
movq %rbp, %rsi
callq 0x1f3ee
cmpq $0x0, (%rax)
je 0x2a6b4
movq %r12, %rdi
movq %rbp, %rsi
callq 0x1f3ee
cmpq $0x0, 0x8(%rax)
jne 0x2a8e4
movq 0x20(%rsp), %rax
decq %rax
cmpq %rax, %rbp
jge 0x2a6e7
movq %r12, %rdi
movq %rbp, %rsi
callq 0x1f3ee
cmpq $0x0, (%rax)
je 0x2a6e7
leaq 0x1(%rbp), %r15
movq %r12, %rdi
movq %r15, %rsi
callq 0x1f3ee
cmpb $0x0, 0x10(%rax)
je 0x2a709
movq %r12, %rdi
movq %rbp, %rsi
callq 0x1f3ee
movq %r14, %rdi
movq %rax, %rsi
callq 0x1f2a0
incq %rbp
cmpq 0x20(%rsp), %rbp
jl 0x2a68d
jmp 0x2a75e
movq %r14, %rbx
movq %r12, %rdi
movq %rbp, %rsi
callq 0x1f3ee
movq (%rax), %r13
movq %r12, %rdi
movq %r15, %rsi
callq 0x1f3ee
movq 0x8(%rax), %r14
movq %r12, %rdi
movq %rbp, %rsi
callq 0x1f3ee
movb 0x10(%rax), %al
movq %r13, 0x30(%rsp)
movq %r14, 0x38(%rsp)
movb %al, 0x40(%rsp)
movq %rbx, %rdi
leaq 0x30(%rsp), %rsi
callq 0x1f2a0
movq %r15, %rbp
movq %rbx, %r14
movq (%rsp), %rbx
jmp 0x2a6fd
leaq 0x8(%rsp), %rdi
callq 0x1fb80
cmpb $0x0, 0x2c(%rsp)
je 0x2a800
movq 0xc83e(%rip), %r15      # 0x36fb8
leaq 0x6ab5(%rip), %rsi      # 0x31236
movl $0x8, %edx
movq %r15, %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 %rbx, %rdi
callq 0x2af91
leaq 0x6a7b(%rip), %rsi      # 0x3123f
movl $0x6, %edx
movq %r15, %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 %r14, %rdi
callq 0x2af91
cmpb $0x0, 0x28(%rsp)
jne 0x2a8d5
leaq 0x8(%rsp), %rsi
movabsq $-0x100000000, %rax     # imm = 0xFFFFFFFF00000000
movq %rax, (%rsi)
xorl %eax, %eax
movq %rax, 0x8(%rsi)
movq $0x80, 0x10(%rsi)
movq %rax, 0x18(%rsi)
movq %r14, %rdi
movl $0x1, %edx
xorl %ecx, %ecx
callq 0x2a562
movq 0x20(%rsp), %rax
cmpq 0x18(%rbx), %rax
jne 0x2addf
cmpq $0x0, 0x18(%rbx)
je 0x2a8cb
xorl %r14d, %r14d
leaq 0x8(%rsp), %r15
movq %rbx, %rdi
movq %r14, %rsi
callq 0x184e4
movq 0x8(%rax), %r12
movq %r15, %rdi
movq %r14, %rsi
callq 0x1f3ee
cmpq 0x8(%rax), %r12
jne 0x2ac3f
movq %rbx, %rdi
movq %r14, %rsi
callq 0x184e4
movq (%rax), %r12
movq %r15, %rdi
movq %r14, %rsi
callq 0x1f3ee
cmpq (%rax), %r12
jne 0x2aaa3
movq %rbx, %rdi
movq %r14, %rsi
callq 0x184e4
movb 0x10(%rax), %bpl
movq %r15, %rdi
movq %r14, %rsi
callq 0x1f3ee
cmpb 0x10(%rax), %bpl
jne 0x2a903
incq %r14
cmpq 0x18(%rbx), %r14
jb 0x2a85c
leaq 0x8(%rsp), %rdi
callq 0x1fb80
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x68d7(%rip), %rdi      # 0x311c2
leaq 0x675c(%rip), %rsi      # 0x3104e
leaq 0x68ec(%rip), %rcx      # 0x311e5
movl $0xab, %edx
callq 0x41c0
movq 0xc6ae(%rip), %rdi      # 0x36fb8
leaq 0x2825(%rip), %rsi      # 0x2d136
movl $0x15, %edx
callq 0x43b0
movq (%rsp), %rdi
movq %r14, %rsi
callq 0x184e4
movzbl 0x10(%rax), %esi
movq 0xc686(%rip), %rdi      # 0x36fb8
callq 0x4590
movq %rax, %r15
leaq 0x280b(%rip), %rsi      # 0x2d14c
movl $0x4, %edx
movq %rax, %rdi
callq 0x43b0
movq (%r15), %rax
movq -0x18(%rax), %rax
movl 0x18(%r15,%rax), %ecx
andl $-0x4b, %ecx
orl $0x8, %ecx
movl %ecx, 0x18(%r15,%rax)
movq (%rsp), %rdi
movq %r14, %rsi
callq 0x184e4
movzbl 0x10(%rax), %esi
movq %r15, %rdi
callq 0x4590
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rax
movl 0x18(%rbx,%rax), %ecx
andl $-0x4b, %ecx
orl $0x2, %ecx
movl %ecx, 0x18(%rbx,%rax)
leaq 0x27b5(%rip), %rsi      # 0x2d151
movl $0x7, %edx
movq %rbx, %rdi
callq 0x43b0
leaq 0x8(%rsp), %rdi
movq %r14, %rsi
callq 0x1f3ee
movzbl 0x10(%rax), %esi
movq %rbx, %rdi
callq 0x4590
movq %rax, %rbx
leaq 0x2780(%rip), %rsi      # 0x2d14c
movl $0x4, %edx
movq %rax, %rdi
callq 0x43b0
movq (%rbx), %rax
movq -0x18(%rax), %rax
movl 0x18(%rbx,%rax), %ecx
andl $-0x4b, %ecx
orl $0x8, %ecx
movl %ecx, 0x18(%rbx,%rax)
leaq 0x8(%rsp), %rdi
movq %r14, %rsi
callq 0x1f3ee
movzbl 0x10(%rax), %esi
movq %rbx, %rdi
callq 0x4590
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rax
movl 0x18(%rbx,%rax), %ecx
andl $-0x4b, %ecx
orl $0x2, %ecx
movl %ecx, 0x18(%rbx,%rax)
leaq 0x48ef(%rip), %rsi      # 0x2f315
movl $0x1, %edx
movq %rbx, %rdi
callq 0x43b0
movq %rbx, %rdi
callq 0x4150
movq 0xc576(%rip), %rdi      # 0x36fb8
leaq 0x6605(%rip), %rsi      # 0x3104e
movl $0xc, %edx
callq 0x43b0
movq 0xc55e(%rip), %rdi      # 0x36fb8
leaq 0x3cb7(%rip), %rsi      # 0x2e718
movl $0x1, %edx
callq 0x43b0
movq 0xc546(%rip), %rdi      # 0x36fb8
movl $0xc2, %esi
callq 0x4610
movq %rax, %rdi
callq 0x4150
leaq 0x3b6d(%rip), %rdi      # 0x2e5f8
leaq 0x65bc(%rip), %rsi      # 0x3104e
leaq 0x674c(%rip), %rcx      # 0x311e5
movl $0xc2, %edx
callq 0x41c0
movq 0xc50e(%rip), %rdi      # 0x36fb8
leaq 0x2685(%rip), %rsi      # 0x2d136
movl $0x15, %edx
callq 0x43b0
movq (%rsp), %rdi
movq %r14, %rsi
callq 0x184e4
movq (%rax), %rsi
movq 0xc4e7(%rip), %rdi      # 0x36fb8
callq 0x41d0
movq %rax, %r15
leaq 0x266c(%rip), %rsi      # 0x2d14c
movl $0x4, %edx
movq %rax, %rdi
callq 0x43b0
movq (%r15), %rax
movq -0x18(%rax), %rax
movl 0x18(%r15,%rax), %ecx
andl $-0x4b, %ecx
orl $0x8, %ecx
movl %ecx, 0x18(%r15,%rax)
movq (%rsp), %rdi
movq %r14, %rsi
callq 0x184e4
movq (%rax), %rsi
movq %r15, %rdi
callq 0x41d0
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rax
movl 0x18(%rbx,%rax), %ecx
andl $-0x4b, %ecx
orl $0x2, %ecx
movl %ecx, 0x18(%rbx,%rax)
leaq 0x2617(%rip), %rsi      # 0x2d151
movl $0x7, %edx
movq %rbx, %rdi
callq 0x43b0
leaq 0x8(%rsp), %rdi
movq %r14, %rsi
callq 0x1f3ee
movq (%rax), %rsi
movq %rbx, %rdi
callq 0x41d0
movq %rax, %rbx
leaq 0x25e3(%rip), %rsi      # 0x2d14c
movl $0x4, %edx
movq %rax, %rdi
callq 0x43b0
movq (%rbx), %rax
movq -0x18(%rax), %rax
movl 0x18(%rbx,%rax), %ecx
andl $-0x4b, %ecx
orl $0x8, %ecx
movl %ecx, 0x18(%rbx,%rax)
leaq 0x8(%rsp), %rdi
movq %r14, %rsi
callq 0x1f3ee
movq (%rax), %rsi
movq %rbx, %rdi
callq 0x41d0
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rax
movl 0x18(%rbx,%rax), %ecx
andl $-0x4b, %ecx
orl $0x2, %ecx
movl %ecx, 0x18(%rbx,%rax)
leaq 0x4753(%rip), %rsi      # 0x2f315
movl $0x1, %edx
movq %rbx, %rdi
callq 0x43b0
movq %rbx, %rdi
callq 0x4150
movq 0xc3da(%rip), %rdi      # 0x36fb8
leaq 0x6469(%rip), %rsi      # 0x3104e
movl $0xc, %edx
callq 0x43b0
movq 0xc3c2(%rip), %rdi      # 0x36fb8
leaq 0x3b1b(%rip), %rsi      # 0x2e718
movl $0x1, %edx
callq 0x43b0
movq 0xc3aa(%rip), %rdi      # 0x36fb8
movl $0xc1, %esi
callq 0x4610
movq %rax, %rdi
callq 0x4150
leaq 0x39d1(%rip), %rdi      # 0x2e5f8
leaq 0x6420(%rip), %rsi      # 0x3104e
leaq 0x65b0(%rip), %rcx      # 0x311e5
movl $0xc1, %edx
callq 0x41c0
movq 0xc372(%rip), %rdi      # 0x36fb8
leaq 0x24e9(%rip), %rsi      # 0x2d136
movl $0x15, %edx
callq 0x43b0
movq (%rsp), %rdi
movq %r14, %rsi
callq 0x184e4
movq 0x8(%rax), %rsi
movq 0xc34a(%rip), %rdi      # 0x36fb8
callq 0x41d0
movq %rax, %r15
leaq 0x24cf(%rip), %rsi      # 0x2d14c
movl $0x4, %edx
movq %rax, %rdi
callq 0x43b0
movq (%r15), %rax
movq -0x18(%rax), %rax
movl 0x18(%r15,%rax), %ecx
andl $-0x4b, %ecx
orl $0x8, %ecx
movl %ecx, 0x18(%r15,%rax)
movq (%rsp), %rdi
movq %r14, %rsi
callq 0x184e4
movq 0x8(%rax), %rsi
movq %r15, %rdi
callq 0x41d0
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rax
movl 0x18(%rbx,%rax), %ecx
andl $-0x4b, %ecx
orl $0x2, %ecx
movl %ecx, 0x18(%rbx,%rax)
leaq 0x2479(%rip), %rsi      # 0x2d151
movl $0x7, %edx
movq %rbx, %rdi
callq 0x43b0
leaq 0x8(%rsp), %rdi
movq %r14, %rsi
callq 0x1f3ee
movq 0x8(%rax), %rsi
movq %rbx, %rdi
callq 0x41d0
movq %rax, %rbx
leaq 0x2444(%rip), %rsi      # 0x2d14c
movl $0x4, %edx
movq %rax, %rdi
callq 0x43b0
movq (%rbx), %rax
movq -0x18(%rax), %rax
movl 0x18(%rbx,%rax), %ecx
andl $-0x4b, %ecx
orl $0x8, %ecx
movl %ecx, 0x18(%rbx,%rax)
leaq 0x8(%rsp), %rdi
movq %r14, %rsi
callq 0x1f3ee
movq 0x8(%rax), %rsi
movq %rbx, %rdi
callq 0x41d0
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rax
movl 0x18(%rbx,%rax), %ecx
andl $-0x4b, %ecx
orl $0x2, %ecx
movl %ecx, 0x18(%rbx,%rax)
leaq 0x45b3(%rip), %rsi      # 0x2f315
movl $0x1, %edx
movq %rbx, %rdi
callq 0x43b0
movq %rbx, %rdi
callq 0x4150
movq 0xc23a(%rip), %rdi      # 0x36fb8
leaq 0x62c9(%rip), %rsi      # 0x3104e
movl $0xc, %edx
callq 0x43b0
movq 0xc222(%rip), %rdi      # 0x36fb8
leaq 0x397b(%rip), %rsi      # 0x2e718
movl $0x1, %edx
callq 0x43b0
movq 0xc20a(%rip), %rdi      # 0x36fb8
movl $0xc0, %esi
callq 0x4610
movq %rax, %rdi
callq 0x4150
leaq 0x3831(%rip), %rdi      # 0x2e5f8
leaq 0x6280(%rip), %rsi      # 0x3104e
leaq 0x6410(%rip), %rcx      # 0x311e5
movl $0xc0, %edx
callq 0x41c0
movq 0xc1d2(%rip), %rdi      # 0x36fb8
leaq 0x2349(%rip), %rsi      # 0x2d136
movl $0x15, %edx
callq 0x43b0
movq 0x20(%rsp), %rsi
movq 0xc1b5(%rip), %rdi      # 0x36fb8
callq 0x41d0
movq %rax, %r14
leaq 0x233a(%rip), %rsi      # 0x2d14c
movl $0x4, %edx
movq %rax, %rdi
callq 0x43b0
movq (%r14), %rax
movq -0x18(%rax), %rax
movl 0x18(%r14,%rax), %ecx
andl $-0x4b, %ecx
orl $0x8, %ecx
movl %ecx, 0x18(%r14,%rax)
movq 0x20(%rsp), %rsi
movq %r14, %rdi
callq 0x41d0
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rax
movl 0x18(%r14,%rax), %ecx
andl $-0x4b, %ecx
orl $0x2, %ecx
movl %ecx, 0x18(%r14,%rax)
leaq 0x22ed(%rip), %rsi      # 0x2d151
movl $0x7, %edx
movq %r14, %rdi
callq 0x43b0
movq 0x18(%rbx), %rsi
movq %r14, %rdi
callq 0x41d0
movq %rax, %r14
leaq 0x22c5(%rip), %rsi      # 0x2d14c
movl $0x4, %edx
movq %rax, %rdi
callq 0x43b0
movq (%r14), %rax
movq -0x18(%rax), %rax
movl 0x18(%r14,%rax), %ecx
andl $-0x4b, %ecx
orl $0x8, %ecx
movl %ecx, 0x18(%r14,%rax)
movq 0x18(%rbx), %rsi
movq %r14, %rdi
callq 0x41d0
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rax
movl 0x18(%rbx,%rax), %ecx
andl $-0x4b, %ecx
orl $0x2, %ecx
movl %ecx, 0x18(%rbx,%rax)
leaq 0x443f(%rip), %rsi      # 0x2f315
movl $0x1, %edx
movq %rbx, %rdi
callq 0x43b0
movq %rbx, %rdi
callq 0x4150
movq 0xc0c6(%rip), %rdi      # 0x36fb8
leaq 0x6155(%rip), %rsi      # 0x3104e
movl $0xc, %edx
callq 0x43b0
movq 0xc0ae(%rip), %rdi      # 0x36fb8
leaq 0x3807(%rip), %rsi      # 0x2e718
movl $0x1, %edx
callq 0x43b0
movq 0xc096(%rip), %rdi      # 0x36fb8
movl $0xbe, %esi
callq 0x4610
movq %rax, %rdi
callq 0x4150
leaq 0x36bd(%rip), %rdi      # 0x2e5f8
leaq 0x610c(%rip), %rsi      # 0x3104e
leaq 0x629c(%rip), %rcx      # 0x311e5
movl $0xbe, %edx
callq 0x41c0
jmp 0x2af89
jmp 0x2af63
jmp 0x2af89
jmp 0x2af74
jmp 0x2af74
jmp 0x2af74
jmp 0x2af63
jmp 0x2af74
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x1fb80
jmp 0x2af81
jmp 0x2af89
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x1fb80
movq %rbx, %rdi
callq 0x4620
movq %rax, %rdi
callq 0x102f6