// File: /workspace/github_cpp_makefile_star2_O1/chhylp123[P]hifiasm/gfa_ut.cpp
// Function: print_integer_ovlps(ma_ug_t*, ul_str_t*, integer_aln_t*, long, ul_chain_t*, long, long, long)
void print_integer_ovlps(ma_ug_t *ug, ul_str_t *str, integer_aln_t *aln, int64_t aln_occ, ul_chain_t *idx, int64_t idx_n, int64_t qid, int64_t consenus_occ)
{
    fprintf(stderr, "\n[M::%s::qid->%ld] qstr->cn::%u, aln_occ::%ld, idx_n::%ld, consenus_occ::%ld\n", 
                                __func__, qid, str[qid].cn, aln_occ, idx_n, consenus_occ);
    // print_integer_seq(ug, str, qid, 0);
    int64_t k, z, z_n, qk, tk, is_rev, tid; //uint64_t z;
    for (k = 0; k < idx_n; k++) {
        fprintf(stderr, "\n[M::%s::tid->%lu] rev->%lu, aln_n->%u\n", __func__, aln[idx[k].s].tn_rev_qk>>33, (aln[idx[k].s].tn_rev_qk>>32)&1, idx[k].e - idx[k].s);
        print_integer_seq(ug, str, aln[idx[k].s].tn_rev_qk>>33, 0);
        z = idx[k].s; z_n = idx[k].e; tid = aln[idx[k].s].tn_rev_qk>>33;
        for (; z < z_n; z++) {
            qk = (uint32_t)aln[z].tn_rev_qk; is_rev = ((aln[z].tn_rev_qk>>32)&1);
            tk = ((is_rev == 0)? (aln[z].tk):(str[tid].cn - aln[z].tk - 1));
            fprintf(stderr, "[qk::%ld]utg%.6d%c(%c) <---> [tk::%ld]utg%.6d%c(%c)\n", 
            qk, (((uint32_t)str[qid].a[qk])>>1)+1, "lc"[ug->u.a[(((uint32_t)str[qid].a[qk])>>1)].circ], "+-"[(((uint32_t)str[qid].a[qk])&1)], 
            tk, (((uint32_t)str[tid].a[tk])>>1)+1, "lc"[ug->u.a[(((uint32_t)str[tid].a[tk])>>1)].circ], "+-"[(((uint32_t)str[tid].a[tk])&1)]);
        }
        
        // for (z = idx[k].s; z < idx[k].e; z++) {
        //     aln[z].tn_rev_qk
        // }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %r9, %rbx
movq %r8, 0x20(%rsp)
movq %rcx, %r9
movq %rdx, 0x8(%rsp)
movq %rsi, %rbp
movq %rdi, 0x18(%rsp)
movq 0x70(%rsp), %rcx
movq 0x25e254(%rip), %rax    # 0x289fe0
movq (%rax), %rdi
movq %rcx, %rax
shlq $0x5, %rax
movl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
movq %rax, 0x10(%rsp)
movl 0x18(%rsi,%rax), %r8d
andl %edx, %r8d
leaq 0x20e69a(%rip), %rsi    # 0x23a449
leaq 0x20e6e1(%rip), %rdx    # 0x23a497
xorl %eax, %eax
pushq 0x78(%rsp)
pushq %rbx
callq 0x22b0
addq $0x10, %rsp
movq %rbx, 0x28(%rsp)
testq %rbx, %rbx
jle 0x2bf6a
addq %rbp, 0x10(%rsp)
xorl %ebx, %ebx
movq %rbp, 0x30(%rsp)
movq 0x25e1f9(%rip), %rax    # 0x289fe0
movq (%rax), %rdi
imulq $0x28, %rbx, %r15
movq 0x20(%rsp), %r14
movl (%r14,%r15), %eax
movl 0x4(%r14,%r15), %r9d
imulq $0x18, %rax, %rcx
movq 0x8(%rsp), %r12
movq 0x10(%r12,%rcx), %r8
movq %r8, %rcx
shrq $0x21, %rcx
shrq $0x20, %r8
andl $0x1, %r8d
subl %eax, %r9d
leaq 0x20e688(%rip), %rsi    # 0x23a4ab
leaq 0x20e66d(%rip), %rdx    # 0x23a497
xorl %eax, %eax
callq 0x22b0
movl (%r14,%r15), %eax
imulq $0x18, %rax, %rax
movq 0x10(%r12,%rax), %rdx
shrq $0x21, %rdx
movq 0x18(%rsp), %rdi
movq %rbp, %rsi
xorl %ecx, %ecx
callq 0x1f4f7f
movl (%r14,%r15), %eax
movl 0x4(%r14,%r15), %r12d
cmpl %r12d, %eax
jae 0x2bf5c
imulq $0x18, %rax, %rcx
movq 0x8(%rsp), %rdx
leaq (%rdx,%rcx), %r13
movq 0x10(%rdx,%rcx), %rcx
shrq $0x1c, %rcx
andq $-0x20, %rcx
addq %rbp, %rcx
addq $0x18, %rcx
movq %rcx, (%rsp)
subq %rax, %r12
movq 0x10(%r13), %rax
btq $0x20, %rax
jb 0x2bea0
movl (%r13), %ecx
movq (%rsp), %r9
jmp 0x2beb6
movq (%rsp), %r9
movl (%r9), %edx
movl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
andl %ecx, %edx
movl (%r13), %ecx
notl %ecx
addl %edx, %ecx
movl %eax, %edx
movl %ecx, %r10d
movq 0x10(%rsp), %rax
movq 0x10(%rax), %rax
movq (%rax,%rdx,8), %rax
movl %eax, %ecx
shrl %ecx
movq 0x18(%rsp), %rsi
movq 0x10(%rsi), %rsi
imulq $0x28, %rcx, %rdi
movl (%rsi,%rdi), %r8d
movq -0x8(%r9), %rdi
movq (%rdi,%r10,8), %rbp
movl %ebp, %r11d
shrl %r11d
imulq $0x28, %r11, %rdi
movl (%rsi,%rdi), %esi
movq 0x25e0e7(%rip), %rdi    # 0x289fe0
movq (%rdi), %rdi
incl %ecx
shrl $0x1f, %r8d
leaq 0x1fc722(%rip), %r15    # 0x22862b
movsbl (%r8,%r15), %r8d
andl $0x1, %eax
leaq 0x1fa2ab(%rip), %r14    # 0x2261c3
movsbl (%rax,%r14), %r9d
incl %r11d
shrl $0x1f, %esi
movsbl (%rsi,%r15), %r15d
andl $0x1, %ebp
movsbl (%rbp,%r14), %ebp
leaq 0x20e59b(%rip), %rsi    # 0x23a4d3
xorl %eax, %eax
pushq %rbp
pushq %r15
pushq %r11
pushq %r10
callq 0x22b0
addq $0x20, %rsp
addq $0x18, %r13
decq %r12
movq 0x30(%rsp), %rbp
jne 0x2be8b
incq %rbx
cmpq 0x28(%rsp), %rbx
jne 0x2bde0
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq