// File: /workspace/github_c_makefile_star2_O3/ToniWestbrook[P]paladin/bwamem_extra.c
// Function: mem_reg2ovlp
void mem_reg2ovlp(const mem_opt_t *opt, const bntseq_t *bns, const uint8_t *pac, bseq1_t *s, mem_alnreg_v *a)
{
	int i;
	kstring_t str = {0,0,0};
	for (i = 0; i < a->n; ++i) {
		const mem_alnreg_t *p = &a->a[i];
		int is_rev, rid, qb = p->qb, qe = p->qe;
		int64_t pos, rb = p->rb, re = p->re;
		pos = bns_depos(bns, rb < bns->l_pac? rb : re - 1, &is_rev);
		rid = bns_pos2rid(bns, pos);
		assert(rid == p->rid);
		pos -= bns->anns[rid].offset;
		kputs(s->name, &str); kputc('\t', &str);
		kputw(s->l_seq, &str); kputc('\t', &str);
		if (is_rev) qb ^= qe, qe ^= qb, qb ^= qe; // swap
		kputw(qb, &str); kputc('\t', &str); kputw(qe, &str); kputc('\t', &str);
		kputs(bns->anns[rid].name, &str); kputc('\t', &str);
		kputw(bns->anns[rid].len, &str); kputc('\t', &str);
		kputw(pos, &str); kputc('\t', &str); kputw(pos + (re - rb), &str); kputc('\t', &str);
		ksprintf(&str, "%.3f", (double)p->truesc / opt->a / (qe - qb > re - rb? qe - qb : re - rb));
		kputc('\n', &str);
	}
	s->sam = str.s;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movq %rcx, 0x28(%rsp)
movq %rdi, 0x60(%rsp)
xorpd %xmm0, %xmm0
movapd %xmm0, (%rsp)
movq $0x0, 0x10(%rsp)
cmpq $0x0, (%r8)
je 0x226bf
movq %rsi, %r13
movl $0x20, %ebx
xorl %esi, %esi
movq %r8, 0x38(%rsp)
movq %r13, 0x20(%rsp)
movq %rsi, 0x48(%rsp)
movq 0x18(%r8), %rbp
movl -0x10(%rbp,%rbx), %eax
movl %eax, 0x34(%rsp)
movl -0xc(%rbp,%rbx), %eax
movl %eax, 0x1c(%rsp)
movq -0x20(%rbp,%rbx), %rcx
movq -0x18(%rbp,%rbx), %rax
movq %rbx, %r12
movq (%r13), %rbx
movq %rax, 0x40(%rsp)
leaq -0x1(%rax), %r15
cmpq %rbx, %rcx
movq %rcx, 0x68(%rsp)
cmovlq %rcx, %r15
cmpq %r15, %rbx
movq %r15, %rax
notq %rax
leaq (%rax,%rbx,2), %r14
cmovgq %r15, %r14
movq %r13, %rdi
movq %r14, %rsi
callq 0x11494
movq %r12, 0x50(%rsp)
movq %rbp, 0x70(%rsp)
cmpl -0x8(%rbp,%r12), %eax
jne 0x226d9
movq 0x10(%r13), %rcx
cltq
leaq (%rax,%rax,4), %rax
movq %rax, 0x58(%rsp)
subq (%rcx,%rax,8), %r14
movq 0x28(%rsp), %rax
movq 0x8(%rax), %r12
movq %r12, %rdi
callq 0x3100
movq (%rsp), %rdi
movslq %eax, %rbp
leaq (%rdi,%rbp), %rax
incq %rax
cmpq 0x8(%rsp), %rax
jae 0x21fa3
movq 0x10(%rsp), %rax
jmp 0x22002
movq %rax, %rcx
shrq %rcx
orq %rax, %rcx
movq %rcx, %rax
shrq $0x2, %rax
orq %rcx, %rax
movq %rax, %rcx
shrq $0x4, %rcx
orq %rax, %rcx
movq %rcx, %rax
shrq $0x8, %rax
orq %rcx, %rax
movq %rax, %rsi
shrq $0x10, %rsi
orq %rax, %rsi
incq %rsi
movq %rsi, 0x8(%rsp)
movq 0x10(%rsp), %rdi
leaq 0x67f4(%rip), %rdx      # 0x287dc
movl $0x25, %ecx
leaq 0x71fc(%rip), %r8       # 0x291f0
callq 0x2324c
movq %rax, 0x10(%rsp)
movq (%rsp), %rdi
addq %rax, %rdi
movq %r12, %rsi
movq %rbp, %rdx
callq 0x3260
addq (%rsp), %rbp
movq %rbp, (%rsp)
movq 0x10(%rsp), %rax
movb $0x0, (%rax,%rbp)
movq (%rsp), %rdx
leaq 0x1(%rdx), %rcx
cmpq 0x8(%rsp), %rcx
jae 0x22037
movq 0x10(%rsp), %rax
jmp 0x2209a
movq %rcx, %rax
shrq %rax
orq %rcx, %rax
movq %rax, %rcx
shrq $0x2, %rcx
orq %rax, %rcx
movq %rcx, %rax
shrq $0x4, %rax
orq %rcx, %rax
movq %rax, %rcx
shrq $0x8, %rcx
orq %rax, %rcx
movq %rcx, %rsi
shrq $0x10, %rsi
orq %rcx, %rsi
incq %rsi
movq %rsi, 0x8(%rsp)
movq 0x10(%rsp), %rdi
leaq 0x6760(%rip), %rdx      # 0x287dc
movl $0x37, %ecx
leaq 0x6766(%rip), %r8       # 0x287ee
callq 0x2324c
movq %rax, 0x10(%rsp)
movq (%rsp), %rdx
leaq 0x1(%rdx), %rcx
movq 0x20(%rsp), %rbp
movq %rcx, (%rsp)
movb $0x9, (%rax,%rdx)
movq (%rsp), %rax
movq 0x10(%rsp), %rcx
movb $0x0, (%rcx,%rax)
movq 0x28(%rsp), %rax
movl (%rax), %edi
movq %rsp, %rsi
callq 0x226f8
movq (%rsp), %rdx
leaq 0x1(%rdx), %rcx
cmpq 0x8(%rsp), %rcx
jae 0x220d9
movq 0x10(%rsp), %rax
jmp 0x2213c
movq %rcx, %rax
shrq %rax
orq %rcx, %rax
movq %rax, %rcx
shrq $0x2, %rcx
orq %rax, %rcx
movq %rcx, %rax
shrq $0x4, %rax
orq %rcx, %rax
movq %rax, %rcx
shrq $0x8, %rcx
orq %rax, %rcx
movq %rcx, %rsi
shrq $0x10, %rsi
orq %rcx, %rsi
incq %rsi
movq %rsi, 0x8(%rsp)
movq 0x10(%rsp), %rdi
leaq 0x66be(%rip), %rdx      # 0x287dc
movl $0x37, %ecx
leaq 0x66c4(%rip), %r8       # 0x287ee
callq 0x2324c
movq %rax, 0x10(%rsp)
movq (%rsp), %rdx
leaq 0x1(%rdx), %rcx
cmpq %r15, %rbx
movq %rcx, (%rsp)
movb $0x9, (%rax,%rdx)
movq (%rsp), %rax
movq 0x10(%rsp), %rcx
movb $0x0, (%rcx,%rax)
movl 0x34(%rsp), %eax
movl %eax, %r12d
movl 0x1c(%rsp), %edi
cmovgl %edi, %r12d
cmovgl %eax, %edi
movl %edi, 0x1c(%rsp)
movq %rsp, %r15
movq %r15, %rsi
callq 0x226f8
movq (%rsp), %rdx
leaq 0x1(%rdx), %rcx
cmpq 0x8(%rsp), %rcx
jae 0x2218b
movq 0x10(%rsp), %rax
jmp 0x221ee
movq %rcx, %rax
shrq %rax
orq %rcx, %rax
movq %rax, %rcx
shrq $0x2, %rcx
orq %rax, %rcx
movq %rcx, %rax
shrq $0x4, %rax
orq %rcx, %rax
movq %rax, %rcx
shrq $0x8, %rcx
orq %rax, %rcx
movq %rcx, %rsi
shrq $0x10, %rsi
orq %rcx, %rsi
incq %rsi
movq %rsi, 0x8(%rsp)
movq 0x10(%rsp), %rdi
leaq 0x660c(%rip), %rdx      # 0x287dc
movl $0x37, %ecx
leaq 0x6612(%rip), %r8       # 0x287ee
callq 0x2324c
movq %rax, 0x10(%rsp)
movq (%rsp), %rdx
leaq 0x1(%rdx), %rcx
movq 0x50(%rsp), %rbx
movq %rcx, (%rsp)
movb $0x9, (%rax,%rdx)
movq (%rsp), %rax
movq 0x10(%rsp), %rcx
movb $0x0, (%rcx,%rax)
movl %r12d, %edi
movq %r15, %rsi
callq 0x226f8
movq (%rsp), %rdx
leaq 0x1(%rdx), %rcx
cmpq 0x8(%rsp), %rcx
jae 0x22229
movq 0x10(%rsp), %rax
jmp 0x2228c
movq %rcx, %rax
shrq %rax
orq %rcx, %rax
movq %rax, %rcx
shrq $0x2, %rcx
orq %rax, %rcx
movq %rcx, %rax
shrq $0x4, %rax
orq %rcx, %rax
movq %rax, %rcx
shrq $0x8, %rcx
orq %rax, %rcx
movq %rcx, %rsi
shrq $0x10, %rsi
orq %rcx, %rsi
incq %rsi
movq %rsi, 0x8(%rsp)
movq 0x10(%rsp), %rdi
leaq 0x656e(%rip), %rdx      # 0x287dc
movl $0x37, %ecx
leaq 0x6574(%rip), %r8       # 0x287ee
callq 0x2324c
movq %rax, 0x10(%rsp)
movq (%rsp), %rdx
leaq 0x1(%rdx), %rcx
movq %rcx, (%rsp)
movb $0x9, (%rax,%rdx)
movq (%rsp), %rax
movq 0x10(%rsp), %rcx
movb $0x0, (%rcx,%rax)
movq 0x10(%rbp), %rax
movq 0x58(%rsp), %rcx
movq 0x18(%rax,%rcx,8), %rbp
movq %rbp, %rdi
callq 0x3100
movq (%rsp), %rdi
movslq %eax, %r13
leaq (%rdi,%r13), %rax
incq %rax
cmpq 0x8(%rsp), %rax
jae 0x222d3
movq 0x10(%rsp), %rax
jmp 0x22332
movq %rax, %rcx
shrq %rcx
orq %rax, %rcx
movq %rcx, %rax
shrq $0x2, %rax
orq %rcx, %rax
movq %rax, %rcx
shrq $0x4, %rcx
orq %rax, %rcx
movq %rcx, %rax
shrq $0x8, %rax
orq %rcx, %rax
movq %rax, %rsi
shrq $0x10, %rsi
orq %rax, %rsi
incq %rsi
movq %rsi, 0x8(%rsp)
movq 0x10(%rsp), %rdi
leaq 0x64c4(%rip), %rdx      # 0x287dc
movl $0x25, %ecx
leaq 0x6ecc(%rip), %r8       # 0x291f0
callq 0x2324c
movq %rax, 0x10(%rsp)
movq (%rsp), %rdi
addq %rax, %rdi
movq %rbp, %rsi
movq %r13, %rdx
callq 0x3260
addq (%rsp), %r13
movq %r13, (%rsp)
movq 0x10(%rsp), %rax
movb $0x0, (%rax,%r13)
movq (%rsp), %rdx
leaq 0x1(%rdx), %rcx
cmpq 0x8(%rsp), %rcx
jae 0x22368
movq 0x10(%rsp), %rax
jmp 0x223cb
movq %rcx, %rax
shrq %rax
orq %rcx, %rax
movq %rax, %rcx
shrq $0x2, %rcx
orq %rax, %rcx
movq %rcx, %rax
shrq $0x4, %rax
orq %rcx, %rax
movq %rax, %rcx
shrq $0x8, %rcx
orq %rax, %rcx
movq %rcx, %rsi
shrq $0x10, %rsi
orq %rcx, %rsi
incq %rsi
movq %rsi, 0x8(%rsp)
movq 0x10(%rsp), %rdi
leaq 0x642f(%rip), %rdx      # 0x287dc
movl $0x37, %ecx
leaq 0x6435(%rip), %r8       # 0x287ee
callq 0x2324c
movq %rax, 0x10(%rsp)
movq (%rsp), %rdx
leaq 0x1(%rdx), %rcx
movq 0x20(%rsp), %rsi
movq 0x40(%rsp), %r13
movq %rcx, (%rsp)
movb $0x9, (%rax,%rdx)
movq (%rsp), %rax
movq 0x10(%rsp), %rcx
movb $0x0, (%rcx,%rax)
movq %rsi, %rbp
movq 0x10(%rsi), %rax
movq 0x58(%rsp), %rcx
movl 0x8(%rax,%rcx,8), %edi
movq %r15, %rsi
callq 0x226f8
movq (%rsp), %rdx
leaq 0x1(%rdx), %rcx
cmpq 0x8(%rsp), %rcx
jae 0x22418
movq 0x10(%rsp), %rax
jmp 0x2247b
movq %rcx, %rax
shrq %rax
orq %rcx, %rax
movq %rax, %rcx
shrq $0x2, %rcx
orq %rax, %rcx
movq %rcx, %rax
shrq $0x4, %rax
orq %rcx, %rax
movq %rax, %rcx
shrq $0x8, %rcx
orq %rax, %rcx
movq %rcx, %rsi
shrq $0x10, %rsi
orq %rcx, %rsi
incq %rsi
movq %rsi, 0x8(%rsp)
movq 0x10(%rsp), %rdi
leaq 0x637f(%rip), %rdx      # 0x287dc
movl $0x37, %ecx
leaq 0x6385(%rip), %r8       # 0x287ee
callq 0x2324c
movq %rax, 0x10(%rsp)
movq (%rsp), %rdx
leaq 0x1(%rdx), %rcx
movq %rcx, (%rsp)
movb $0x9, (%rax,%rdx)
movq (%rsp), %rax
movq 0x10(%rsp), %rcx
movb $0x0, (%rcx,%rax)
movl %r14d, %edi
movq %r15, %rsi
callq 0x226f8
movq (%rsp), %rdx
leaq 0x1(%rdx), %rcx
cmpq 0x8(%rsp), %rcx
jae 0x224b1
movq 0x10(%rsp), %rax
jmp 0x22514
movq %rcx, %rax
shrq %rax
orq %rcx, %rax
movq %rax, %rcx
shrq $0x2, %rcx
orq %rax, %rcx
movq %rcx, %rax
shrq $0x4, %rax
orq %rcx, %rax
movq %rax, %rcx
shrq $0x8, %rcx
orq %rax, %rcx
movq %rcx, %rsi
shrq $0x10, %rsi
orq %rcx, %rsi
incq %rsi
movq %rsi, 0x8(%rsp)
movq 0x10(%rsp), %rdi
leaq 0x62e6(%rip), %rdx      # 0x287dc
movl $0x37, %ecx
leaq 0x62ec(%rip), %r8       # 0x287ee
callq 0x2324c
movq %rax, 0x10(%rsp)
movq (%rsp), %rdx
leaq 0x1(%rdx), %rcx
movq %rcx, (%rsp)
movb $0x9, (%rax,%rdx)
movq (%rsp), %rax
movq 0x10(%rsp), %rcx
movb $0x0, (%rcx,%rax)
subq 0x68(%rsp), %r13
addl %r13d, %r14d
movl %r14d, %edi
movq %r15, %rsi
callq 0x226f8
movq (%rsp), %rdx
leaq 0x1(%rdx), %rcx
cmpq 0x8(%rsp), %rcx
jae 0x22552
movq 0x10(%rsp), %rax
jmp 0x225b5
movq %rcx, %rax
shrq %rax
orq %rcx, %rax
movq %rax, %rcx
shrq $0x2, %rcx
orq %rax, %rcx
movq %rcx, %rax
shrq $0x4, %rax
orq %rcx, %rax
movq %rax, %rcx
shrq $0x8, %rcx
orq %rax, %rcx
movq %rcx, %rsi
shrq $0x10, %rsi
orq %rcx, %rsi
incq %rsi
movq %rsi, 0x8(%rsp)
movq 0x10(%rsp), %rdi
leaq 0x6245(%rip), %rdx      # 0x287dc
movl $0x37, %ecx
leaq 0x624b(%rip), %r8       # 0x287ee
callq 0x2324c
movq %rax, 0x10(%rsp)
movq (%rsp), %rdx
leaq 0x1(%rdx), %rcx
movq %rcx, (%rsp)
movb $0x9, (%rax,%rdx)
movq (%rsp), %rax
movq 0x10(%rsp), %rcx
movb $0x0, (%rcx,%rax)
movq 0x70(%rsp), %rax
cvtsi2sdl (%rax,%rbx), %xmm0
movq 0x60(%rsp), %rax
cvtsi2sdl (%rax), %xmm1
subl 0x1c(%rsp), %r12d
movslq %r12d, %rax
cmpq %rax, %r13
cmovgq %r13, %rax
divsd %xmm1, %xmm0
xorps %xmm1, %xmm1
cvtsi2sd %rax, %xmm1
divsd %xmm1, %xmm0
movq %r15, %rdi
leaq 0x691a(%rip), %rsi      # 0x28f20
movb $0x1, %al
callq 0xebb4
movq (%rsp), %rdx
leaq 0x1(%rdx), %rcx
cmpq 0x8(%rsp), %rcx
jae 0x22623
movq 0x10(%rsp), %rax
jmp 0x22686
movq %rcx, %rax
shrq %rax
orq %rcx, %rax
movq %rax, %rcx
shrq $0x2, %rcx
orq %rax, %rcx
movq %rcx, %rax
shrq $0x4, %rax
orq %rcx, %rax
movq %rax, %rcx
shrq $0x8, %rcx
orq %rax, %rcx
movq %rcx, %rsi
shrq $0x10, %rsi
orq %rcx, %rsi
incq %rsi
movq %rsi, 0x8(%rsp)
movq 0x10(%rsp), %rdi
leaq 0x6174(%rip), %rdx      # 0x287dc
movl $0x37, %ecx
leaq 0x617a(%rip), %r8       # 0x287ee
callq 0x2324c
movq %rax, 0x10(%rsp)
movq (%rsp), %rdx
leaq 0x1(%rdx), %rcx
movq 0x38(%rsp), %r8
movq 0x48(%rsp), %rsi
movq %rbp, %r13
movq %rcx, (%rsp)
movb $0xa, (%rax,%rdx)
movq (%rsp), %rax
movq 0x10(%rsp), %rcx
movb $0x0, (%rcx,%rax)
incq %rsi
addq $0x60, %rbx
cmpq %rsi, (%r8)
ja 0x21ef3
movq 0x10(%rsp), %rax
jmp 0x226c1
xorl %eax, %eax
movq 0x28(%rsp), %rcx
movq %rax, 0x28(%rcx)
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x6f90(%rip), %rdi      # 0x29670
leaq 0x6f61(%rip), %rsi      # 0x29648
leaq 0x6f90(%rip), %rcx      # 0x2967e
movl $0x64, %edx
callq 0x31a0