// File: /workspace/github_c_makefile_star2_O1/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, 0x20(%rsp)
movq %rdi, 0x48(%rsp)
xorpd %xmm0, %xmm0
movapd %xmm0, (%rsp)
movq $0x0, 0x10(%rsp)
cmpq $0x0, (%r8)
je 0x2217e
movq %rsi, %r13
movl $0x20, %ebx
xorl %r14d, %r14d
movq %r8, 0x40(%rsp)
movq %rsi, 0x30(%rsp)
movq %r14, 0x68(%rsp)
movq 0x18(%r8), %rbp
movl -0x10(%rbp,%rbx), %eax
movl %eax, 0x2c(%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, 0x60(%rsp)
leaq -0x1(%rax), %r15
cmpq %rbx, %rcx
movq %rcx, 0x50(%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 0x111bc
movq %r12, 0x70(%rsp)
movq %rbp, 0x58(%rsp)
cmpl -0x8(%rbp,%r12), %eax
jne 0x2219b
movq 0x10(%r13), %rcx
cltq
leaq (%rax,%rax,4), %rax
movq %rax, 0x38(%rsp)
subq (%rcx,%rax,8), %r14
movq 0x20(%rsp), %rax
movq 0x8(%rax), %r12
movq %r12, %rdi
callq 0x3100
movq (%rsp), %rcx
movslq %eax, %rbp
leaq (%rcx,%rbp), %rax
incq %rax
cmpq 0x8(%rsp), %rax
jb 0x21ae2
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 0x6c7c(%rip), %rdx      # 0x28748
movl $0x25, %ecx
leaq 0x7628(%rip), %r8       # 0x29100
callq 0x22d64
movq %rax, 0x10(%rsp)
movq 0x10(%rsp), %rdi
addq (%rsp), %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), %rax
incq %rax
cmpq 0x8(%rsp), %rax
jb 0x21b70
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 0x6bee(%rip), %rdx      # 0x28748
movl $0x37, %ecx
leaq 0x6bf4(%rip), %r8       # 0x2875a
callq 0x22d64
movq %rax, 0x10(%rsp)
movq (%rsp), %rax
movq 0x10(%rsp), %rcx
leaq 0x1(%rax), %rdx
movq %rdx, (%rsp)
movb $0x9, (%rcx,%rax)
movq (%rsp), %rax
movq 0x10(%rsp), %rcx
movb $0x0, (%rcx,%rax)
movq 0x20(%rsp), %rax
movl (%rax), %edi
movq %rsp, %rsi
callq 0x221ba
movq (%rsp), %rax
incq %rax
cmpq 0x8(%rsp), %rax
movq 0x30(%rsp), %rbp
jb 0x21c0f
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 0x6b4f(%rip), %rdx      # 0x28748
movl $0x37, %ecx
leaq 0x6b55(%rip), %r8       # 0x2875a
callq 0x22d64
movq %rax, 0x10(%rsp)
movq (%rsp), %rax
movq 0x10(%rsp), %rcx
leaq 0x1(%rax), %rdx
cmpq %r15, %rbx
movq %rdx, (%rsp)
movb $0x9, (%rcx,%rax)
movq (%rsp), %rax
movq 0x10(%rsp), %rcx
movb $0x0, (%rcx,%rax)
movl 0x2c(%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 0x221ba
movq (%rsp), %rax
incq %rax
cmpq 0x8(%rsp), %rax
jb 0x21cbe
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 0x6aa0(%rip), %rdx      # 0x28748
movl $0x37, %ecx
leaq 0x6aa6(%rip), %r8       # 0x2875a
callq 0x22d64
movq %rax, 0x10(%rsp)
movq (%rsp), %rax
movq 0x10(%rsp), %rcx
leaq 0x1(%rax), %rdx
movq %rdx, (%rsp)
movb $0x9, (%rcx,%rax)
movq (%rsp), %rax
movq 0x10(%rsp), %rcx
movb $0x0, (%rcx,%rax)
movl %r12d, %edi
movq %r15, %rsi
callq 0x221ba
movq (%rsp), %rax
incq %rax
cmpq 0x8(%rsp), %rax
movq 0x70(%rsp), %rbx
jb 0x21d59
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 0x6a05(%rip), %rdx      # 0x28748
movl $0x37, %ecx
leaq 0x6a0b(%rip), %r8       # 0x2875a
callq 0x22d64
movq %rax, 0x10(%rsp)
movq (%rsp), %rax
movq 0x10(%rsp), %rcx
leaq 0x1(%rax), %rdx
movq %rdx, (%rsp)
movb $0x9, (%rcx,%rax)
movq (%rsp), %rax
movq 0x10(%rsp), %rcx
movb $0x0, (%rcx,%rax)
movq 0x10(%rbp), %rax
movq 0x38(%rsp), %rcx
movq 0x18(%rax,%rcx,8), %rbp
movq %rbp, %rdi
callq 0x3100
movq (%rsp), %rcx
movslq %eax, %r13
leaq (%rcx,%r13), %rax
incq %rax
cmpq 0x8(%rsp), %rax
jb 0x21e01
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 0x695d(%rip), %rdx      # 0x28748
movl $0x25, %ecx
leaq 0x7309(%rip), %r8       # 0x29100
callq 0x22d64
movq %rax, 0x10(%rsp)
movq 0x10(%rsp), %rdi
addq (%rsp), %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), %rax
incq %rax
cmpq 0x8(%rsp), %rax
jb 0x21e90
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 0x68ce(%rip), %rdx      # 0x28748
movl $0x37, %ecx
leaq 0x68d4(%rip), %r8       # 0x2875a
callq 0x22d64
movq %rax, 0x10(%rsp)
movq (%rsp), %rax
movq 0x10(%rsp), %rcx
leaq 0x1(%rax), %rdx
movq %rdx, (%rsp)
movb $0x9, (%rcx,%rax)
movq (%rsp), %rax
movq 0x10(%rsp), %rcx
movb $0x0, (%rcx,%rax)
movq 0x30(%rsp), %rax
movq %rax, %rbp
movq 0x10(%rax), %rax
movq 0x38(%rsp), %rcx
movl 0x8(%rax,%rcx,8), %edi
movq %r15, %rsi
callq 0x221ba
movq (%rsp), %rax
incq %rax
cmpq 0x8(%rsp), %rax
movq 0x60(%rsp), %r13
jb 0x21f3d
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 0x6821(%rip), %rdx      # 0x28748
movl $0x37, %ecx
leaq 0x6827(%rip), %r8       # 0x2875a
callq 0x22d64
movq %rax, 0x10(%rsp)
movq (%rsp), %rax
movq 0x10(%rsp), %rcx
leaq 0x1(%rax), %rdx
movq %rdx, (%rsp)
movb $0x9, (%rcx,%rax)
movq (%rsp), %rax
movq 0x10(%rsp), %rcx
movb $0x0, (%rcx,%rax)
movl %r14d, %edi
movq %r15, %rsi
callq 0x221ba
movq (%rsp), %rax
incq %rax
cmpq 0x8(%rsp), %rax
jb 0x21fd3
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 0x678b(%rip), %rdx      # 0x28748
movl $0x37, %ecx
leaq 0x6791(%rip), %r8       # 0x2875a
callq 0x22d64
movq %rax, 0x10(%rsp)
movq (%rsp), %rax
movq 0x10(%rsp), %rcx
leaq 0x1(%rax), %rdx
movq %rdx, (%rsp)
movb $0x9, (%rcx,%rax)
movq (%rsp), %rax
movq 0x10(%rsp), %rcx
movb $0x0, (%rcx,%rax)
subq 0x50(%rsp), %r13
addl %r13d, %r14d
movl %r14d, %edi
movq %r15, %rsi
callq 0x221ba
movq (%rsp), %rax
incq %rax
cmpq 0x8(%rsp), %rax
jb 0x22071
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 0x66ed(%rip), %rdx      # 0x28748
movl $0x37, %ecx
leaq 0x66f3(%rip), %r8       # 0x2875a
callq 0x22d64
movq %rax, 0x10(%rsp)
movq (%rsp), %rax
movq 0x10(%rsp), %rcx
leaq 0x1(%rax), %rdx
movq %rdx, (%rsp)
movb $0x9, (%rcx,%rax)
movq (%rsp), %rax
movq 0x10(%rsp), %rcx
movb $0x0, (%rcx,%rax)
movq 0x58(%rsp), %rax
cvtsi2sdl (%rax,%rbx), %xmm0
movq 0x48(%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 0x6d61(%rip), %rsi      # 0x28e30
movb $0x1, %al
callq 0xe91c
movq (%rsp), %rax
incq %rax
cmpq 0x8(%rsp), %rax
movq 0x68(%rsp), %r14
jb 0x22144
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 0x661a(%rip), %rdx      # 0x28748
movl $0x37, %ecx
leaq 0x6620(%rip), %r8       # 0x2875a
callq 0x22d64
movq %rax, 0x10(%rsp)
movq (%rsp), %rax
movq 0x10(%rsp), %rcx
leaq 0x1(%rax), %rdx
movq %rdx, (%rsp)
movb $0xa, (%rcx,%rax)
movq (%rsp), %rax
movq 0x10(%rsp), %rcx
movb $0x0, (%rcx,%rax)
incq %r14
addq $0x60, %rbx
movq 0x40(%rsp), %r8
cmpq %r14, (%r8)
movq %rbp, %r13
ja 0x219de
movq 0x10(%rsp), %rax
movq 0x20(%rsp), %rcx
movq %rax, 0x28(%rcx)
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x739e(%rip), %rdi      # 0x29540
leaq 0x736f(%rip), %rsi      # 0x29518
leaq 0x739e(%rip), %rcx      # 0x2954e
movl $0x64, %edx
callq 0x31a0