// File: /workspace/github_cpp_makefile_star2_O1/chhylp123[P]hifiasm/inter.cpp
// Function: gen_gl_aln(overlap_region_alloc*, ul_idx_t const*, kv_ul_ov_t*)
void gen_gl_aln(overlap_region_alloc* olist, const ul_idx_t *uref, kv_ul_ov_t *res)
{
	uint64_t k; ul_ov_t *p = NULL;
	res->n = 0; kv_resize(ul_ov_t, *res, olist->length);
	for (k = 0; k < olist->length; k++) {
		// fprintf(stderr, "+++[M::%s::utg%.6dl] q[%d, %d), t[%d, %d), tot::%u, cis::%u, err::%u\n", __func__, 
        // (int32_t)olist->list[k].y_id+1, olist->list[k].x_pos_s, olist->list[k].x_pos_e+1,
		// olist->list[k].y_pos_s, olist->list[k].y_pos_e+1,
		// olist->list[k].overlapLen, olist->list[k].align_length, olist->list[k].non_homopolymer_errors);
		p = &(res->a[res->n++]); assert(olist->list[k].overlapLen >= olist->list[k].align_length);
		p->qn = k; p->qs = olist->list[k].x_pos_s; p->qe = olist->list[k].x_pos_e+1;
		p->tn = olist->list[k].y_id; p->sec = olist->list[k].align_length; 
		p->rev = olist->list[k].y_pos_strand; p->el = (olist->list[k].is_match==1?1:0); 
		if(p->rev) {
			p->ts = uref->ug->u.a[p->tn].len - (olist->list[k].y_pos_e+1); 
			p->te = uref->ug->u.a[p->tn].len - olist->list[k].y_pos_s;
		} else {
			p->ts = olist->list[k].y_pos_s; 
			p->te = olist->list[k].y_pos_e+1;
		}
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movq $0x0, 0x8(%rdx)
movq 0x10(%rdi), %rax
cmpq %rax, 0x10(%rdx)
jae 0x1ab1d2
decq %rax
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, %rcx
shrq $0x10, %rcx
orq %rax, %rcx
leaq 0x1(%rcx), %rax
movq %rax, 0x10(%rbx)
movq (%rbx), %rdi
leaq (%rax,%rax,8), %rax
leaq (%rax,%rax,2), %rax
leaq (%rcx,%rax), %rsi
incq %rsi
callq 0x2370
movq %rax, (%rbx)
cmpq $0x0, 0x10(%r15)
je 0x1ab2f1
xorl %eax, %eax
movl $0x3fffffff, %ecx       # imm = 0x3FFFFFFF
movl $0xc0000000, %edx       # imm = 0xC0000000
movl $0x7fffffff, %esi       # imm = 0x7FFFFFFF
xorl %edi, %edi
movq 0x8(%rbx), %r9
leaq 0x1(%r9), %r8
movq %r8, 0x8(%rbx)
movq (%r15), %r10
movl 0x20(%r10,%rax), %r8d
cmpl 0x28(%r10,%rax), %r8d
jb 0x1ab300
leaq (%r9,%r9,8), %r8
leaq (%r8,%r8,2), %r8
addq %r9, %r8
addq (%rbx), %r8
movl %edi, (%r8)
movl 0x4(%r10,%rax), %r9d
movl %r9d, 0x4(%r8)
movl 0x8(%r10,%rax), %r9d
incl %r9d
movl %r9d, 0x8(%r8)
movl 0x10(%r10,%rax), %r9d
movl %r9d, 0xc(%r8)
movl 0x28(%r10,%rax), %r10d
andl %ecx, %r10d
movl 0x18(%r8), %r11d
andl %edx, %r11d
orl %r10d, %r11d
movl %r11d, 0x18(%r8)
movq (%r15), %r12
movl 0x1c(%r12,%rax), %ebp
movl %ebp, %r12d
shll $0x1f, %r12d
andl $0x7fffffff, %r11d      # imm = 0x7FFFFFFF
orl %r12d, %r11d
movl %r11d, 0x18(%r8)
movq (%r15), %r11
xorl %r13d, %r13d
cmpb $0x1, 0x2c(%r11,%rax)
sete %r13b
shll $0x1e, %r13d
orl %r10d, %r13d
orl %r12d, %r13d
movl %r13d, 0x18(%r8)
testb $0x1, %bpl
jne 0x1ab2ab
movq (%r15), %r9
movl 0x14(%r9,%rax), %r10d
movl %r10d, 0x10(%r8)
movl 0x18(%r9,%rax), %r9d
incl %r9d
jmp 0x1ab2da
movq (%r14), %r10
movq 0x10(%r10), %r10
leaq (%r9,%r9,4), %r9
movl (%r10,%r9,8), %r11d
andl %esi, %r11d
movq (%r15), %r12
movl 0x18(%r12,%rax), %ebp
notl %ebp
addl %r11d, %ebp
movl %ebp, 0x10(%r8)
movl (%r10,%r9,8), %r9d
andl %esi, %r9d
subl 0x14(%r12,%rax), %r9d
movl %r9d, 0x14(%r8)
incq %rdi
addq $0xa8, %rax
cmpq 0x10(%r15), %rdi
jb 0x1ab1f0
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x89b1d(%rip), %rdi     # 0x234e24
leaq 0x8867d(%rip), %rsi     # 0x23398b
leaq 0x89b48(%rip), %rcx     # 0x234e5d
movl $0x1470, %edx           # imm = 0x1470
callq 0x2110