// File: /workspace/github_cpp_makefile_star2_O2/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 $0x48, %rsp
movq %r9, %r14
movq %r8, 0x28(%rsp)
movq %rcx, %r9
movq %rdx, 0x20(%rsp)
movq %rdi, 0x10(%rsp)
movq 0x80(%rsp), %rcx
movq 0x9e482(%rip), %rax     # 0x252fe0
movq (%rax), %rdi
movq %rcx, %rax
shlq $0x5, %rax
leaq (%rsi,%rax), %rdx
movq %rdx, 0x40(%rsp)
movl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
movq %rsi, 0x18(%rsp)
movl 0x18(%rsi,%rax), %r8d
andl %edx, %r8d
leaq 0x43aff(%rip), %rsi     # 0x1f8689
leaq 0x43b46(%rip), %rdx     # 0x1f86d7
xorl %ebx, %ebx
xorl %eax, %eax
pushq 0x88(%rsp)
pushq %r14
callq 0x22b0
addq $0x10, %rsp
testq %r14, %r14
cmovleq %rbx, %r14
xorl %ecx, %ecx
movq %r14, 0x30(%rsp)
cmpq %r14, %rcx
je 0x1b4d4c
movq 0x9e41b(%rip), %rax     # 0x252fe0
movq (%rax), %rdi
movq %rcx, 0x38(%rsp)
imulq $0x28, %rcx, %rbx
movq 0x28(%rsp), %r14
movl (%r14,%rbx), %eax
movl 0x4(%r14,%rbx), %r9d
imulq $0x18, %rax, %rcx
movq 0x20(%rsp), %r15
movq 0x10(%r15,%rcx), %r8
movq %r8, %rcx
shrq $0x21, %rcx
shrq $0x20, %r8
andl $0x1, %r8d
subl %eax, %r9d
leaq 0x43ae5(%rip), %rsi     # 0x1f86eb
leaq 0x43aca(%rip), %rdx     # 0x1f86d7
xorl %eax, %eax
callq 0x22b0
movl (%r14,%rbx), %eax
imulq $0x18, %rax, %rax
movq 0x10(%r15,%rax), %rdx
shrq $0x21, %rdx
movq 0x10(%rsp), %rdi
movq 0x18(%rsp), %rbp
movq %rbp, %rsi
xorl %ecx, %ecx
callq 0x1b426f
movl (%r14,%rbx), %r13d
movl 0x4(%r14,%rbx), %ecx
imulq $0x18, %r13, %rax
leaq (%r15,%rax), %rbx
movq 0x10(%r15,%rax), %rax
shrq $0x1c, %rax
andq $-0x20, %rax
addq %rbp, %rax
addq $0x18, %rax
movq %rax, 0x8(%rsp)
jmp 0x1b4d31
movq %rcx, %r15
movq 0x10(%rbx), %rax
btq $0x20, %rax
jb 0x1b4c7f
movl (%rbx), %ecx
movq 0x8(%rsp), %r9
jmp 0x1b4c94
movq 0x8(%rsp), %r9
movl (%r9), %edx
movl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
andl %ecx, %edx
movl (%rbx), %ecx
notl %ecx
addl %edx, %ecx
movl %eax, %edx
movl %ecx, %r10d
movq 0x40(%rsp), %rax
movq 0x10(%rax), %rax
movq (%rax,%rdx,8), %rax
movl %eax, %ecx
shrl %ecx
movq 0x10(%rsp), %rsi
movq 0x10(%rsi), %rsi
imulq $0x28, %rcx, %rdi
movl (%rsi,%rdi), %r8d
movq -0x8(%r9), %rdi
movq (%rdi,%r10,8), %r14
movl %r14d, %r11d
shrl %r11d
imulq $0x28, %r11, %rdi
movl (%rsi,%rdi), %esi
movq 0x9e309(%rip), %rdi     # 0x252fe0
movq (%rdi), %rdi
incl %ecx
shrl $0x1f, %r8d
leaq 0x319a4(%rip), %rbp     # 0x1e668b
movsbl (%r8,%rbp), %r8d
andl $0x1, %eax
leaq 0x2f52d(%rip), %r12     # 0x1e4223
movsbl (%rax,%r12), %r9d
incl %r11d
shrl $0x1f, %esi
movsbl (%rsi,%rbp), %ebp
andl $0x1, %r14d
movsbl (%r14,%r12), %r14d
leaq 0x439fe(%rip), %rsi     # 0x1f8713
xorl %eax, %eax
pushq %r14
pushq %rbp
pushq %r11
pushq %r10
callq 0x22b0
addq $0x20, %rsp
incq %r13
addq $0x18, %rbx
movq %r15, %rcx
cmpq %rcx, %r13
jb 0x1b4c68
movq 0x38(%rsp), %rcx
incq %rcx
movq 0x30(%rsp), %r14
jmp 0x1b4bb5
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq