LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/Correct.cpp
// Function: adjust_ext_offset_fixed_t(long*, long*, long*, long*, long, long, long, long, long, long)
void adjust_ext_offset_fixed_t(int64_t *qs, int64_t *qe, int64_t *ts, int64_t *te, 
int64_t qmin, int64_t qmax, int64_t tmin, int64_t tmax, int64_t thre, int64_t mode)
{
    int64_t qoff, toff;
    if(mode == 1) {///forward extension
        qoff = qmax - (*qs); toff = tmax - (*ts);
        if(qoff <= toff) {
            (*qe) = qmax; (*te) = (*ts) + qoff + thre;
        } else {
            (*te) = tmax; (*qe) = (*qs) + toff + thre;
        }
    } else if(mode == 2) {///backward extension
        qoff = (*qe) - qmin; toff = (*te) - tmin;
        if(qoff <= toff) {
            (*qs) = qmin; (*ts) = (*te) - qoff - thre;
        } else {
            (*ts) = tmin; (*qs) = (*qe) - toff - thre;
        }
    }
    if((*qs) < qmin) (*qs) = qmin;
    if((*ts) < tmin) (*ts) = tmin;
    if((*qe) > qmax) (*qe) = qmax;
    if((*te) > tmax) (*te) = tmax;
}

// Assembly:
pushq %r14
pushq %rbx
movq 0x30(%rsp), %rbx
movq 0x28(%rsp), %r11
movq 0x20(%rsp), %rax
movq 0x18(%rsp), %r10
cmpq $0x2, %rbx
je 0x341e4
cmpq $0x1, %rbx
jne 0x34223
movq %r9, %rbx
subq (%rdi), %rbx
movq %rax, %r14
subq (%rdx), %r14
cmpq %r14, %rbx
jle 0x34206
movq %rax, (%rcx)
addq %r11, %r14
addq (%rdi), %r14
movq %r14, (%rsi)
jmp 0x34223
movq (%rsi), %rbx
subq %r8, %rbx
movq (%rcx), %r14
subq %r10, %r14
cmpq %r14, %rbx
jle 0x34214
movq %r10, (%rdx)
movq (%rsi), %rbx
addq %r11, %r14
subq %r14, %rbx
movq %rbx, (%rdi)
jmp 0x34223
movq %r9, (%rsi)
addq %r11, %rbx
addq (%rdx), %rbx
movq %rbx, (%rcx)
jmp 0x34223
movq %r8, (%rdi)
movq (%rcx), %r14
addq %r11, %rbx
subq %rbx, %r14
movq %r14, (%rdx)
cmpq %r8, (%rdi)
jge 0x3422b
movq %r8, (%rdi)
cmpq %r10, (%rdx)
jge 0x34233
movq %r10, (%rdx)
cmpq %r9, (%rsi)
jle 0x3423b
movq %r9, (%rsi)
cmpq %rax, (%rcx)
jle 0x34243
movq %rax, (%rcx)
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/Correct.cpp
// Function: push_unmap_alnw(overlap_region*, int, long, long, long, long)
void push_unmap_alnw(overlap_region *aux_o, int32_t qs, int64_t qe, int64_t ts, int64_t te, int64_t mode)
{
    window_list *p = NULL;
    kv_pushp(window_list, aux_o->w_list, &p);
    p->x_start = qs; p->x_end = qe;
    p->y_start = ts; p->y_end = te;
    p->error_threshold = mode; p->error = INT16_MAX;
    p->extra_begin = p->extra_end = -1;
    p->cidx = p->clen = 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r9, %rbx
movq %r8, %r14
movq %rcx, %r15
movq %rdx, %r12
movl %esi, %ebp
movq %rdi, %r13
movq 0x48(%rdi), %rcx
cmpq 0x50(%rdi), %rcx
jne 0x34aaa
leaq (%rcx,%rcx), %rax
testq %rcx, %rcx
pushq $0x2
popq %rsi
cmovneq %rax, %rsi
movq %rsi, 0x50(%r13)
movq 0x58(%r13), %rdi
shlq $0x5, %rsi
callq 0x2370
movq %rax, 0x58(%r13)
movq 0x48(%r13), %rcx
jmp 0x34aae
movq 0x58(%r13), %rax
leaq 0x1(%rcx), %rdx
movq %rdx, 0x48(%r13)
shlq $0x5, %rcx
movl %ebp, (%rax,%rcx)
movl %r12d, 0x4(%rax,%rcx)
movl %r15d, 0x8(%rax,%rcx)
movl %r14d, 0xc(%rax,%rcx)
movw %bx, 0x16(%rax,%rcx)
movw $0x7fff, 0x14(%rax,%rcx) # imm = 0x7FFF
orl $-0x1, 0x10(%rax,%rcx)
andq $0x0, 0x18(%rax,%rcx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/Correct.cpp
// Function: push_replace_alnw(overlap_region*, int, long, long, long, long)
void push_replace_alnw(overlap_region *aux_o, int32_t qs, int64_t qe, int64_t ts, int64_t te, int64_t mode)
{
    window_list *p = NULL;
    kv_pushp(window_list, aux_o->w_list, &p);
    p->x_start = qs; p->x_end = qe;
    p->y_start = ts; p->y_end = te;
    p->error_threshold = mode; p->error = 0;
    p->extra_begin = p->extra_end = 0;
    p->cidx = p->clen = 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r9, %rbx
movq %r8, %r14
movq %rcx, %r15
movq %rdx, %r12
movl %esi, %ebp
movq %rdi, %r13
movq 0x48(%rdi), %rcx
cmpq 0x50(%rdi), %rcx
jne 0x34b41
leaq (%rcx,%rcx), %rax
testq %rcx, %rcx
pushq $0x2
popq %rsi
cmovneq %rax, %rsi
movq %rsi, 0x50(%r13)
movq 0x58(%r13), %rdi
shlq $0x5, %rsi
callq 0x2370
movq %rax, 0x58(%r13)
movq 0x48(%r13), %rcx
jmp 0x34b45
movq 0x58(%r13), %rax
leaq 0x1(%rcx), %rdx
movq %rdx, 0x48(%r13)
shlq $0x5, %rcx
movl %ebp, (%rax,%rcx)
movl %r12d, 0x4(%rax,%rcx)
movl %r15d, 0x8(%rax,%rcx)
movl %r14d, 0xc(%rax,%rcx)
movw %bx, 0x16(%rax,%rcx)
andw $0x0, 0x14(%rax,%rcx)
andl $0x0, 0x10(%rax,%rcx)
andq $0x0, 0x18(%rax,%rcx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/Correct.cpp
// Function: set_exact_exz(bit_extz_t*, long, long, long, long)
void set_exact_exz(bit_extz_t *exz, int64_t qs, int64_t qe, int64_t ts, int64_t te)
{
    clear_align(*exz); exz->thre = 0; exz->cigar.n = 0;
    exz->err = 0; push_trace(&(exz->cigar), 0, qe - qs);
    exz->pl = te - ts; exz->ps = 0; exz->pe = exz->pl-1;
    exz->tl = qe - qs; exz->ts = 0; exz->te = exz->tl-1;
    exz->ps += ts; exz->pe += ts;
    exz->ts += qs; exz->te += qs;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r8, %rbx
movq %rcx, %r14
movq %rdi, %r15
andq $0x0, 0x28(%rdi)
movq %rdx, %r12
andq $0x0, 0xa8(%rdi)
movq %rsi, %r13
addq $0xa8, %rdi
movl %r12d, %ebp
subl %r13d, %ebp
xorl %esi, %esi
movl %ebp, %edx
callq 0x62885
movl %ebx, %eax
subl %r14d, %eax
movl %eax, 0x18(%r15)
movl %ebp, 0x24(%r15)
movl %r14d, 0x10(%r15)
decl %ebx
movl %ebx, 0x14(%r15)
movl %r13d, 0x1c(%r15)
decl %r12d
movl %r12d, 0x20(%r15)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/Correct.cpp
// Function: prt_k_mer_hit(k_mer_hit*, long)
void prt_k_mer_hit(k_mer_hit *ch_a, int64_t ch_n)
{
    int64_t k;
    for (k = 0; k < ch_n; k++) {
        fprintf(stderr, "[M::%s::k->%ld] q_pos::%u, t_pos::%u, cnt::%u, cov::%u\n", 
        __func__, k, ch_a[k].self_offset, ch_a[k].offset, ch_a[k].cnt, ch_a[k].readID);
    }
    
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
xorl %eax, %eax
testq %rsi, %rsi
cmovleq %rax, %rbx
addq $0xc, %r14
movl $0x7fffffff, %ebp       # imm = 0x7FFFFFFF
leaq 0x1aef20(%rip), %r15    # 0x1e4c75
leaq 0x1aef51(%rip), %r12    # 0x1e4cad
xorl %r13d, %r13d
cmpq %r13, %rbx
je 0x35d9f
movq 0x21d275(%rip), %rax    # 0x252fe0
movq (%rax), %rdi
movl -0x8(%r14), %r9d
movl -0x4(%r14), %r8d
movl (%r14), %r10d
movl -0xc(%r14), %r11d
andl %ebp, %r11d
movq %r15, %rsi
movq %r12, %rdx
movq %r13, %rcx
xorl %eax, %eax
pushq %r11
pushq %r10
callq 0x22b0
popq %rcx
popq %rdx
incq %r13
addq $0x10, %r14
jmp 0x35d5f
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/Correct.cpp
// Function: debug_iter_k_mer_hit(k_mer_hit*, long, unsigned long, unsigned long, long, long)
void debug_iter_k_mer_hit(k_mer_hit *ch_a, int64_t ch_n, uint64_t s, uint64_t e, int64_t ibeg, int64_t iend)
{
    int64_t i, beg = -1, end = -1;
    for (i = 0; i < ch_n; i++) {
        if((ch_a[i].self_offset >= s) && (ch_a[i].self_offset < e)) {
            if(beg == -1) beg = i;
            end = i+1;
        }
    }
    assert(ibeg==beg && iend==end);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
xorl %eax, %eax
testq %rsi, %rsi
cmovleq %rax, %rsi
addq $0x8, %rdi
pushq $-0x1
popq %r10
movq %r10, %r11
cmpq %rax, %rsi
je 0x35dfa
movl (%rdi), %ebx
cmpq %rdx, %rbx
setae %bpl
cmpq %rcx, %rbx
setb %bl
leaq 0x1(%rax), %r14
cmpq $-0x1, %r10
cmovneq %r10, %rax
testb %bl, %bpl
cmovneq %rax, %r10
cmovneq %r14, %r11
addq $0x10, %rdi
movq %r14, %rax
jmp 0x35dc6
cmpq %r8, %r10
jne 0x35e09
cmpq %r9, %r11
jne 0x35e09
popq %rbx
popq %r14
popq %rbp
retq
leaq 0x1aeeab(%rip), %rdi    # 0x1e4cbb
leaq 0x1ad88c(%rip), %rsi    # 0x1e36a3
leaq 0x1aeeb4(%rip), %rcx    # 0x1e4cd2
movl $0x3ff7, %edx           # imm = 0x3FF7
callq 0x2110
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/Correct.cpp
// Function: cigar_gen_by_chain(overlap_region*, Chain_Data*, k_mer_hit*, long, ul_ov_t*, long, unsigned long, ul_idx_t const*, hpc_t*, All_reads*, char*, UC_Read*, bit_extz_t*, double, long, unsigned long)
void cigar_gen_by_chain(overlap_region *z, Chain_Data *dp, k_mer_hit *ch_a, int64_t ch_n, ul_ov_t *ov, int64_t on, uint64_t wl,  
const ul_idx_t *uref, hpc_t *hpc_g, All_reads *rref, char* qstr, UC_Read *tu, bit_extz_t *exz, double e_rate, 
int64_t ql, uint64_t rid)
{
    if(on <= 0) return;
    int64_t i, ch_i, tl, id = z->y_id; uint64_t pe = (uint64_t)-1;
    if(hpc_g) tl = hpc_len(*hpc_g, id);
    else if(uref) tl = uref->ug->u.a[id].len;
    else tl = Get_READ_LENGTH((*rref), id);
    // for (i = 0; i < wn; i++) z->w_list.a[i].clen = 0;///clean cigar
    // if(on > 1) {
    //     fprintf(stderr, "[M::%s::] rid::%lu, on::%ld\n", __func__, rid, on);
    // }
    // if(z->y_id == 126) prt_k_mer_hit(ch_a, ch_n);
    for (i = ch_i = 0; i < on; i++) {
        assert((i<=0)||(ov[i].qs > ov[i-1].qe));
        ch_i = sub_base_aln(z, dp, ch_a, ch_n, pe, ov[i].qs, ov[i].qe, wl, uref, hpc_g, rref, qstr, tu, exz, e_rate, ql, tl, ch_i, rid);
        pe = ov[i].qe;
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movsd %xmm0, 0x20(%rsp)
movq %r8, (%rsp)
movq %rcx, 0x18(%rsp)
movq %rdx, 0x10(%rsp)
movq %rdi, 0x8(%rsp)
testq %r9, %r9
jle 0x3655f
movq %r9, %rbx
movq 0x70(%rsp), %rcx
movq 0x68(%rsp), %rdx
movq 0x8(%rsp), %rax
movl 0x10(%rax), %eax
testq %rcx, %rcx
je 0x364a2
movq %rdx, %r13
movq %rcx, %r12
movq (%rcx), %rcx
movq 0x10(%rcx), %rcx
imulq $0x28, %rax, %rax
movl (%rcx,%rax), %ebp
shrl %ebp
andl $0x3fffffff, %ebp       # imm = 0x3FFFFFFF
jmp 0x364d3
movq %rcx, %r12
testq %rdx, %rdx
je 0x364c3
movq %rdx, %r13
movq (%rdx), %rcx
movq 0x10(%rcx), %rcx
imulq $0x28, %rax, %rax
movl (%rcx,%rax), %ebp
andl $0x7fffffff, %ebp       # imm = 0x7FFFFFFF
jmp 0x364d3
movq %rdx, %r13
movq 0x78(%rsp), %rcx
movq 0x18(%rcx), %rcx
movq (%rcx,%rax,8), %rbp
movq (%rsp), %rax
leaq 0x8(%rax), %r14
xorl %eax, %eax
xorl %r15d, %r15d
cmpq %r15, %rbx
je 0x3655f
testq %r15, %r15
je 0x364f6
movl -0x4(%r14), %ecx
cmpl -0x1c(%r14), %ecx
ja 0x364fd
jmp 0x3656e
movq (%rsp), %rcx
movl 0x4(%rcx), %ecx
movl %ecx, %r9d
movl (%r14), %esi
subq $0x8, %rsp
movq 0x10(%rsp), %rdi
movq 0x18(%rsp), %rdx
movq 0x20(%rsp), %rcx
movsd 0x28(%rsp), %xmm0
pushq %rax
pushq %rbp
pushq 0xb0(%rsp)
pushq 0xb0(%rsp)
pushq 0xb0(%rsp)
pushq 0xb0(%rsp)
pushq 0xb0(%rsp)
pushq %r12
pushq %r13
pushq 0xb0(%rsp)
pushq %rsi
callq 0x3605f
addq $0x60, %rsp
incq %r15
addq $0x1c, %r14
jmp 0x364e0
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1ae261(%rip), %rdi    # 0x1e47d6
leaq 0x1ad127(%rip), %rsi    # 0x1e36a3
leaq 0x1ae899(%rip), %rcx    # 0x1e4e1c
movl $0x409c, %edx           # imm = 0x409C
callq 0x2110
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/Correct.cpp
// Function: fusion_chain_ovlp(overlap_region*, k_mer_hit*, long, ul_ov_t*, long, unsigned long, long, long)
int64_t fusion_chain_ovlp(overlap_region *z, k_mer_hit *ch_a, int64_t ch_n, ul_ov_t *ov, int64_t on, uint64_t wl, int64_t ql, int64_t tl)
{
    int64_t i, srt, ch_i, m, os, oe, ovlp; ul_ov_t *p;
    for (i = ch_i = 0, srt = 1; i < on; i++) {
        // fprintf(stderr, "[M::%s::i->%ld] ovq::[%u, %u)\n", __func__, i, ov->qs, ov->qe);
        ov[i].sec = 6;///do not know the aln type
        ch_i = adjust_base_coordinates(z, ch_a, ch_n, &(ov[i]), wl, ql, tl, ch_i);
        if(i > 0 && ov[i].qs < ov[i-1].qe) srt = 0;
    }
    if(on <= 1) return on;

    if(!srt) radix_sort_uov_srt_qs(ov, ov+on);
    for (i = m = 1; i < on; i++) {
        p = &(ov[m-1]);
        os = MAX(p->qs, ov[i].qs); 
        oe = MIN(p->qe, ov[i].qe);
        ovlp = oe - os;
        if(ovlp >= 0) {//merge
            p->qe = MAX(p->qe, ov[i].qe);
            p->te = MAX(p->te, ov[i].te);
            p->tn = MAX(p->tn, ov[i].tn);
        } else {//new
            ov[m++] = ov[i]; 
        }
    }

    on = m;
    return on;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rcx, %rbp
movq %rdx, %r15
movq %rsi, %r12
testq %r8, %r8
movl $0x0, %r13d
movq %r8, 0x20(%rsp)
cmovgq %r8, %r13
pushq $0x1
popq %rbx
movq %rcx, 0x18(%rsp)
xorl %eax, %eax
xorl %r14d, %r14d
cmpq %r14, %r13
je 0x36754
movl 0x18(%rbp), %ecx
movl $0xc0000000, %edx       # imm = 0xC0000000
andl %edx, %ecx
orl $0x6, %ecx
movl %ecx, 0x18(%rbp)
movq %rax, 0x8(%rsp)
movq %r12, %rsi
movq %r15, %rdx
movq %rbp, %rcx
movq 0x60(%rsp), %r9
callq 0x3658d
testq %r14, %r14
je 0x3674b
movl 0x4(%rbp), %ecx
cmpl -0x14(%rbp), %ecx
movl $0x0, %ecx
cmovbq %rcx, %rbx
incq %r14
addq $0x1c, %rbp
jmp 0x3670a
movq 0x20(%rsp), %r14
cmpq $0x2, %r14
jl 0x36812
testq %rbx, %rbx
movq 0x18(%rsp), %rbx
jne 0x3677c
imulq $0x1c, %r14, %rsi
addq %rbx, %rsi
movq %rbx, %rdi
callq 0x1a05e
leaq 0x30(%rbx), %rcx
pushq $0x1
popq %rax
movq %rax, %rdx
cmpq %r14, %rdx
jge 0x3680f
imulq $0x1c, %rax, %rdi
leaq (%rbx,%rdi), %rsi
movl -0x18(%rbx,%rdi), %r9d
movl -0x14(%rbx,%rdi), %edi
movl -0x10(%rcx), %r10d
movl -0xc(%rcx), %r8d
cmpl %r10d, %r9d
cmoval %r9d, %r10d
cmpl %r8d, %edi
movl %r8d, %r9d
cmovbl %edi, %r9d
cmpl %r10d, %r9d
jae 0x367d5
leaq -0x14(%rcx), %rdi
incq %rax
movups (%rdi), %xmm0
movups 0xc(%rdi), %xmm1
movups %xmm1, 0xc(%rsi)
movups %xmm0, (%rsi)
jmp 0x36803
cmpl %r8d, %edi
cmoval %edi, %r8d
movl %r8d, -0x14(%rsi)
movl -0x8(%rsi), %edi
movl (%rcx), %r8d
cmpl %r8d, %edi
cmoval %edi, %r8d
movl -0x10(%rsi), %edi
movl %r8d, -0x8(%rsi)
movl -0x8(%rcx), %r8d
cmpl %r8d, %edi
cmoval %edi, %r8d
movl %r8d, -0x10(%rsi)
incq %rdx
addq $0x1c, %rcx
jmp 0x36786
movq %rax, %r14
movq %r14, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/Correct.cpp
// Function: debug_k_mer_hit_retrive(k_mer_hit*, hpc_t*, All_reads*, ul_idx_t const*, char*, UC_Read*, long, long)
int64_t debug_k_mer_hit_retrive(k_mer_hit *z, hpc_t *hpc_g, All_reads *rref, const ul_idx_t *uref, 
char* qstr, UC_Read *tu, int64_t id, int64_t rev)
{
    int64_t qs, qe, ts, te; char *q_string, *t_string;
    qe = z->self_offset+1; qs = qe - (z->cnt&(0xffu));
    te = z->offset+1; ts = te - (z->cnt&(0xffu));
    if(qe == qs) return 1;
    q_string = qstr + qs; 
    t_string = retrieve_str_seq_exz(tu, ts, te-ts, -1, -1, rev, uref, hpc_g, rref, id);
    fprintf(stderr, "[M::%s::] q_string::%.*s\n", __func__, (int32_t)(qe-qs), q_string);
    fprintf(stderr, "[M::%s::] t_string::%.*s\n", __func__, (int32_t)(te-ts), t_string);
    if(memcmp(q_string, t_string, qe-qs)) {
        fprintf(stderr, "[M::%s::] qsite::%u, tsite::%u\n", __func__, z->self_offset, z->offset);
        return 0;
    }
    return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movzbl 0xc(%rdi), %r12d
pushq $0x1
popq %rbx
testq %r12, %r12
jne 0x36f77
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r8, %r15
movq %rcx, %rax
movq %rdx, %r11
movq %rsi, %r10
movq %rdi, %r14
movq 0x48(%rsp), %rcx
movl 0x4(%rdi), %esi
movl 0x8(%rdi), %edx
incl %edx
subq %r12, %rdx
incl %esi
subq %r12, %rsi
addq %rdx, %r15
movzbl %cl, %ebp
pushq $-0x1
popq %rcx
movq %r9, %rdi
movq %r12, %rdx
movq %rcx, %r8
movl %ebp, %r9d
pushq 0x40(%rsp)
pushq %r11
pushq %r10
pushq %rax
callq 0x625fc
addq $0x20, %rsp
movq %rax, %r13
movq 0x21c014(%rip), %rbp    # 0x252fe0
movq (%rbp), %rdi
leaq 0x1ae0d7(%rip), %rsi    # 0x1e50ae
leaq 0x1ae0ea(%rip), %rdx    # 0x1e50c8
movl %r12d, %ecx
movq %r15, %r8
xorl %eax, %eax
callq 0x22b0
movq (%rbp), %rdi
leaq 0x1ae0ea(%rip), %rsi    # 0x1e50e0
leaq 0x1ae0cb(%rip), %rdx    # 0x1e50c8
movl %r12d, %ecx
movq %r13, %r8
xorl %eax, %eax
callq 0x22b0
movq %r15, %rdi
movq %r13, %rsi
movq %r12, %rdx
callq 0x21a0
testl %eax, %eax
je 0x36f65
movq 0x21bfb9(%rip), %rax    # 0x252fe0
movq (%rax), %rdi
movl 0x4(%r14), %r8d
movl 0x8(%r14), %ecx
leaq 0x1ae0c1(%rip), %rsi    # 0x1e50fa
leaq 0x1ae088(%rip), %rdx    # 0x1e50c8
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x22b0
jmp 0x36f65
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/Correct.cpp
// Function: retrieve_cigar_err_debug(bit_extz_t*, long, long)
int64_t retrieve_cigar_err_debug(bit_extz_t *ez, int64_t s, int64_t e)
{
    if(!ez->cigar.n) return 0;
    int64_t err = 0, xk = ez->ts; int64_t ws, we, os, oe, ovlp;
    uint32_t ck = 0, cl; uint16_t op;

    os = MAX(s, ez->ts); oe = MIN(e, ez->te+1);
    ovlp = ((oe>os)? (oe-os):0); 
    if(!ovlp) {
        fprintf(stderr, "[M::%s::] s::%ld, e::%ld, ez->ts::%u, ez->te::%u\n", 
        __func__, s, e, ez->ts, ez->te);
    }
    assert(ovlp);

    //some cigar will span s or e
    while (ck < ez->cigar.n && xk < e) {//[s, e)
        ws = xk; 
        ck = pop_trace(&(ez->cigar), ck, &op, &cl);
        if(op!=2) xk += cl;
        we = xk;
        os = MAX(s, ws); oe = MIN(e, we);
        ovlp = ((oe>os)? (oe-os):0);
        if((op==2) && (ws>=s) && (ws<e)) {
            ovlp = cl;
        }
        if((!ovlp) || (!op)) continue;
        err += ovlp;
    }
    return err;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq 0xa8(%rdi), %rcx
testq %rcx, %rcx
je 0x3a025
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movslq 0x1c(%rdi), %r12
cmpq %rsi, %r12
movq %rsi, %rdx
cmovgq %r12, %rdx
movslq 0x20(%rdi), %rax
leaq 0x1(%rax), %rsi
cmpq %rbx, %rsi
cmovgeq %rbx, %rsi
cmpq %rdx, %rsi
jle 0x3a03a
addq $0xa8, %r15
xorl %ebp, %ebp
xorl %r13d, %r13d
xorl %eax, %eax
movl %eax, %edx
cmpq %rdx, %rcx
jbe 0x3a028
cmpq %rbx, %r12
jge 0x3a028
movq %r15, %rdi
movl %eax, %esi
leaq 0x12(%rsp), %rdx
leaq 0x14(%rsp), %rcx
callq 0x53a7d
movzwl 0x12(%rsp), %ecx
movl 0x14(%rsp), %esi
cmpw $0x2, %cx
movq %rsi, %rdx
cmoveq %rbp, %rdx
addq %r12, %rdx
cmpq %r14, %r12
movq %r14, %rdi
cmovgq %r12, %rdi
cmpq %rbx, %rdx
movq %rbx, %r8
cmovlq %rdx, %r8
subq %rdi, %r8
cmovleq %rbp, %r8
cmpq %r14, %r12
cmovlq %r8, %rsi
cmpw $0x2, %cx
cmovneq %r8, %rsi
testw %cx, %cx
movl $0x0, %ecx
cmovneq %rsi, %rcx
testq %rsi, %rsi
cmoveq %rsi, %rcx
addq %rcx, %r13
movq (%r15), %rcx
movq %rdx, %r12
jmp 0x39fa6
xorl %r13d, %r13d
movq %r13, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x218f9f(%rip), %rcx    # 0x252fe0
movq (%rcx), %rdi
movl %eax, (%rsp)
leaq 0x1ab9dd(%rip), %rsi    # 0x1e5a2b
leaq 0x1aba08(%rip), %rdx    # 0x1e5a5d
movq %r14, %rcx
movq %rbx, %r8
movl %r12d, %r9d
xorl %eax, %eax
callq 0x22b0
leaq 0x1be0d8(%rip), %rdi    # 0x1f8144
leaq 0x1a9630(%rip), %rsi    # 0x1e36a3
leaq 0x1ab9fc(%rip), %rcx    # 0x1e5a76
movl $0x4648, %edx           # imm = 0x4648
callq 0x2110
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/Correct.cpp
// Function: retrieve_cigar_err(bit_extz_t*, long, long, long*, long*)
int64_t retrieve_cigar_err(bit_extz_t *ez, int64_t s, int64_t e, int64_t *xk, int64_t *ck)
{
    if(!ez->cigar.n) return 0;
    int64_t cn = ez->cigar.n, op, err = 0; int64_t ws, we, os, oe, ovlp;
    if(((*ck) < 0) || ((*ck) > cn)) {//(*ck) == cn is allowed
        (*ck) = 0; (*xk) = ez->ts; 
    }

    while ((*ck) > 0 && (*xk) > s) {
        --(*ck);
        op = ez->cigar.a[(*ck)]>>14;
        if(op!=2) (*xk) -= (ez->cigar.a[(*ck)]&(0x3fff));
    }

    //some cigar will span s or e
    while ((*ck) < cn && (*xk) < e) {//[s, e)
        ws = (*xk); 
        op = ez->cigar.a[(*ck)]>>14;
        if(op!=2) (*xk) += (ez->cigar.a[(*ck)]&(0x3fff));
        we = (*xk);
        os = MAX(s, ws); oe = MIN(e, we);
        ovlp = ((oe>os)? (oe-os):0);
        if((op==2) && (ws>=s) && (ws<e)) {
            ovlp = (ez->cigar.a[(*ck)]&(0x3fff));
        }

        // if(s == 22694 && e == 38018) {
        //     fprintf(stderr, "[M::%s]\tw::[%ld,\t%ld)\tc::%ld\top::%ld\terr::%ld\n", __func__, ws, we, (*ck), op, err + (op?ovlp:0));
        // } 
        (*ck)++;
        if((!ovlp) || (!op)) continue;
        err += ovlp;
    }

    // int64_t debug_err = retrieve_cigar_err_debug(ez, s, e);
    // if(!(err == debug_err)) {
    //     fprintf(stderr, "[M::%s::] err::%ld, debug_err::%ld, s::%ld, e::%ld, ez->ts::%u, ez->te::%u\n", 
    //     __func__, err, debug_err, s, e, ez->ts, ez->te);
    // }
    // assert(err == debug_err);
    return err;
}

// Assembly:
movq 0xa8(%rdi), %r9
testq %r9, %r9
je 0x3a356
movq (%r8), %rax
testq %rax, %rax
setns %r10b
cmpq %r9, %rax
setle %al
testb %al, %r10b
jne 0x3a281
andq $0x0, (%r8)
movslq 0x1c(%rdi), %rax
movq %rax, (%rcx)
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq (%r8), %r10
testq %r10, %r10
jle 0x3a2c9
cmpq %rsi, (%rcx)
jle 0x3a2c9
leaq -0x1(%r10), %rax
movq %rax, (%r8)
movq 0xb8(%rdi), %rax
movzwl -0x2(%rax,%r10,2), %eax
movl %eax, %r10d
andl $0xc000, %r10d          # imm = 0xC000
cmpl $0x8000, %r10d          # imm = 0x8000
je 0x3a28b
andl $0x3fff, %eax           # imm = 0x3FFF
subq %rax, (%rcx)
jmp 0x3a28b
xorl %r11d, %r11d
xorl %eax, %eax
cmpq %r9, %r10
jge 0x3a34b
movq (%rcx), %r12
cmpq %rdx, %r12
jge 0x3a34b
movq 0xb8(%rdi), %r15
movzwl (%r15,%r10,2), %ebx
movl %ebx, %ebp
shrl $0xe, %ebp
movq %r12, %r14
cmpl $0x2, %ebp
je 0x3a307
movl %ebx, %r14d
andl $0x3fff, %r14d          # imm = 0x3FFF
addq %r12, %r14
movq %r14, (%rcx)
movq (%r8), %r10
cmpq %rsi, %r12
movq %rsi, %r13
cmovgq %r12, %r13
cmpq %rdx, %r14
jl 0x3a319
movq %rdx, %r14
subq %r13, %r14
jg 0x3a321
xorl %r14d, %r14d
cmpq %rsi, %r12
jl 0x3a337
cmpl $0x2, %ebp
jne 0x3a337
movzwl (%r15,%r10,2), %r14d
andl $0x3fff, %r14d          # imm = 0x3FFF
incq %r10
movq %r10, (%r8)
cmpw $0x4000, %bx            # imm = 0x4000
cmovbq %r11, %r14
addq %r14, %rax
jmp 0x3a2ce
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %eax, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/Correct.cpp
// Function: query_gen_gov_idx(asg64_v*, unsigned long, unsigned long)
uint64_t query_gen_gov_idx(asg64_v *ovidx, uint64_t v, uint64_t w)
{
    uint64_t m, s, e;
    if(v > w) {
        m = v; v = w; w = m;
    }
    s = ovidx->a[v]>>32; e = s + (uint32_t)ovidx->a[v];
    for (m = s; m < e; m++) {
        if(ovidx->a[m] == w) return 1;
    }
    return 0;
}

// Assembly:
cmpq %rdx, %rsi
movq %rdx, %rcx
cmovaq %rsi, %rcx
cmovbq %rsi, %rdx
movq 0x10(%rdi), %rsi
movq (%rsi,%rdx,8), %rdi
movl %edi, %edx
shrq $0x20, %rdi
addq %rdi, %rdx
pushq $0x1
popq %rax
cmpq %rdx, %rdi
jae 0x3a69f
leaq 0x1(%rdi), %r8
cmpq %rcx, (%rsi,%rdi,8)
movq %r8, %rdi
jne 0x3a68c
retq
xorl %eax, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/Correct.cpp
// Function: push_sec_aln(overlap_region*, long, long, long)
void push_sec_aln(overlap_region *z, int64_t s, int64_t e, int64_t sec_err)
{
    window_list *p;
    if(z->align_length > 0) {
        p = z->w_list.a + z->w_list.n + z->align_length - 1;
        if((p->x_end == s) && ((!!(p->clen)) == (!!sec_err))) {
            p->x_end = e; p->clen += sec_err;
            return;
        }
    }
    if((z->w_list.n+z->align_length)==z->w_list.m) {
        z->w_list.m = z->w_list.m? z->w_list.m<<1 : 2; 
        z->w_list.a = (window_list*)realloc(z->w_list.a, sizeof(window_list)*z->w_list.m); 
    }
    p = &(z->w_list.a[z->w_list.n+z->align_length]); z->align_length++; memset(p, 0, sizeof((*p)));
    p->x_start = s; p->x_end = e; p->clen += sec_err;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %rbx
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
movl 0x28(%rdi), %edx
testq %rdx, %rdx
je 0x3a706
movq 0x48(%r12), %rcx
movq %rcx, %rax
shlq $0x5, %rax
addq 0x58(%r12), %rax
movq %rdx, %rsi
shlq $0x5, %rsi
movslq -0x1c(%rsi,%rax), %rdi
cmpq %r15, %rdi
jne 0x3a70f
addq %rsi, %rax
movl -0x4(%rax), %edi
testl %edi, %edi
setne %r8b
testq %rbx, %rbx
sete %r9b
movq %rdx, %rsi
cmpb %r8b, %r9b
je 0x3a712
movl %r14d, -0x1c(%rax)
addl %ebx, %edi
movl %edi, -0x4(%rax)
jmp 0x3a782
movq 0x48(%r12), %rcx
xorl %esi, %esi
jmp 0x3a712
movq %rdx, %rsi
leaq (%rcx,%rsi), %rax
cmpq 0x50(%r12), %rax
jne 0x3a751
leaq (%rax,%rax), %rcx
testq %rax, %rax
pushq $0x2
popq %rsi
cmovneq %rcx, %rsi
movq %rsi, 0x50(%r12)
movq 0x58(%r12), %rdi
shlq $0x5, %rsi
callq 0x2370
movq %rax, 0x58(%r12)
movq 0x48(%r12), %rcx
movl 0x28(%r12), %esi
movl %esi, %edx
jmp 0x3a756
movq 0x58(%r12), %rax
shlq $0x5, %rcx
addq %rax, %rcx
shlq $0x5, %rsi
incl %edx
movl %edx, 0x28(%r12)
xorps %xmm0, %xmm0
andl $0x0, 0x18(%rsi,%rcx)
movups %xmm0, 0x8(%rsi,%rcx)
movl %r15d, (%rsi,%rcx)
movl %r14d, 0x4(%rsi,%rcx)
movl %ebx, 0x1c(%rsi,%rcx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/Correct.cpp
// Function: reassign_sec_err(overlap_region*, asg64_v*, asg64_v*, unsigned long)
void reassign_sec_err(overlap_region* ol, asg64_v *ovidx, asg64_v *buf, uint64_t bid0)
{
    uint64_t bn = buf->n, bid = bid0, oid, mid, m, s, e;
    if(buf->a[bid]&id_set) return;
    kv_push(uint64_t, *buf, bid);
    while (buf->n > bn) {
        bid = buf->a[--buf->n];
        if(buf->a[bid]&id_set) continue;
        buf->a[bid]|=id_set;

        oid = id_get(buf->a[bid]);
        s = ovidx->a[oid]>>32; e = (uint32_t)ovidx->a[oid];
        for (m = s; m < e; m++) {
            mid = ol[(uint32_t)ovidx->a[m]].overlapLen;
            if(mid == (uint32_t)-1) continue;
            if(buf->a[mid]&id_set) continue;
            kv_push(uint64_t, *buf, mid);
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq 0x10(%rdx), %rax
cmpq $0x0, (%rax,%rcx,8)
js 0x3a994
movq %rcx, %r12
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movq (%rdx), %r13
pushq $0x2
popq %rcx
cmpq 0x8(%rdx), %r13
jne 0x3a8cf
leaq (,%r13,2), %rsi
testq %r13, %r13
cmoveq %rcx, %rsi
movq %rsi, 0x8(%rbx)
shlq $0x3, %rsi
movq %rax, %rdi
callq 0x2370
movq %rax, 0x10(%rbx)
movq (%rbx), %rcx
jmp 0x3a8d2
movq %r13, %rcx
leaq 0x1(%rcx), %rdx
movq %rdx, (%rbx)
movq %r12, (%rax,%rcx,8)
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
movq %r13, (%rsp)
movq (%rbx), %rcx
cmpq %r13, %rcx
jbe 0x3a994
leaq -0x1(%rcx), %rdx
movq %rdx, (%rbx)
movq -0x8(%rax,%rcx,8), %rdx
movq (%rax,%rdx,8), %rcx
testq %rcx, %rcx
js 0x3a8e6
movq %rcx, %rsi
btsq $0x3f, %rsi
movq %rsi, (%rax,%rdx,8)
movl %ecx, %ecx
movq 0x10(%r14), %rdx
movq (%rdx,%rcx,8), %rbp
movl %ebp, %r13d
shrq $0x20, %rbp
cmpq %r13, %rbp
jae 0x3a98b
movq 0x10(%r14), %rcx
movl (%rcx,%rbp,8), %ecx
imulq $0xa8, %rcx, %rcx
movl 0x20(%r15,%rcx), %r12d
cmpq %rdi, %r12
je 0x3a986
cmpq $0x0, (%rax,%r12,8)
js 0x3a986
movq (%rbx), %rcx
cmpq 0x8(%rbx), %rcx
jne 0x3a97b
leaq (%rcx,%rcx), %rsi
testq %rcx, %rcx
pushq $0x2
popq %rcx
cmoveq %rcx, %rsi
movq %rsi, 0x8(%rbx)
shlq $0x3, %rsi
movq %rax, %rdi
callq 0x2370
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
movq %rax, 0x10(%rbx)
movq (%rbx), %rcx
leaq 0x1(%rcx), %rdx
movq %rdx, (%rbx)
movq %r12, (%rax,%rcx,8)
incq %rbp
jmp 0x3a924
movq (%rsp), %r13
jmp 0x3a8e6
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/Correct.cpp
// Function: is_mask_ov(mask_ul_ov_t*, unsigned long*, unsigned long, unsigned long)
uint64_t is_mask_ov(mask_ul_ov_t *mk, uint64_t *bes_id, uint64_t bes_n, uint64_t sec_id)
{
    uint64_t s = mk->idx.a[sec_id]>>32, e = (uint32_t)(mk->idx.a[sec_id]), bk, si;
    bk = 0; si = s;
    while (bk < bes_n && si < e) {
        if (bes_id[bk] < mk->srt.a[si].tn) {
            bk++;
        } else if(mk->srt.a[si].tn < bes_id[bk]) {
            si++;
        } else {///bes_id[bk] == mk->srt.a[si].tn
            if(!(mk->srt.a[si].qs)) return 1;
            return 0;
        }
    }
    return 0;
}

// Assembly:
pushq %rbx
movq 0x10(%rdi), %rax
movq (%rax,%rcx,8), %r8
movl %r8d, %ecx
shrq $0x20, %r8
xorl %eax, %eax
xorl %r9d, %r9d
imulq $0x1c, %r8, %r10
addq $0xc, %r10
cmpq %rdx, %r9
jae 0x3cc53
cmpq %rcx, %r8
jae 0x3cc53
movq 0x18(%rdi), %r11
movl (%r11,%r10), %ebx
cmpq %rbx, (%rsi,%r9,8)
jb 0x3cc43
jbe 0x3cc48
incq %r8
addq $0x1c, %r10
jmp 0x3cc20
incq %r9
jmp 0x3cc18
xorl %eax, %eax
cmpl $0x0, -0x8(%r11,%r10)
sete %al
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/Correct.cpp
// Function: hc_phase_robust_rr(overlap_region*, All_reads*, haplotype_evdience_alloc*, char*, unsigned long, UC_Read*, unsigned long*, unsigned long, unsigned long, unsigned long, ul_ov_t*, long, unsigned char, unsigned long)
uint64_t hc_phase_robust_rr(overlap_region* ol, All_reads *rref, haplotype_evdience_alloc* hp, char* qstr, uint64_t ql, UC_Read* tu, uint64_t *id_a, uint64_t id_n, uint64_t s, uint64_t e, ul_ov_t *c_idx, int64_t set_f, uint8_t occ_thres, uint64_t hpc_len/**, uint8_t is_dbg**/)
{
    uint64_t k, q[2], rr = 0, os, oe; ul_ov_t *p; overlap_region *z;
    for (k = 0; k < id_n; k++) {
        p = &(c_idx[id_a[k]]); z = &(ol[ovlp_id(*p)]); 
        q[0] = z->w_list.a[ovlp_cur_wid(*p)].x_start+ovlp_bd(*p);
        q[1] = z->w_list.a[ovlp_cur_wid(*p)].x_end+1-ovlp_bd(*p);
        if(q[1] <= e) rr = 1;
        os = MAX(q[0], s); oe = MIN(q[1], e);
        if(oe > os) {
            // if(is_dbg) fprintf(stderr, "[M::%s]\ttn::%u\t%c\to::[%lu,\t%lu)\n", __func__, z->y_id, "+-"[z->y_pos_strand], os, oe);
            extract_sub_cigar_hc(z, rref, hp, qstr, ql, tu, os, oe, p, set_f, hp->flag + os - s, occ_thres, hpc_len/**, is_dbg**/);
        }
    }
    return rr;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %r9, 0x28(%rsp)
movq %rcx, 0x20(%rsp)
movq %rsi, 0x10(%rsp)
movq %rdi, %r12
movq 0x90(%rsp), %rbx
movq 0x88(%rsp), %r11
movq 0x80(%rsp), %r14
movq 0x78(%rsp), %r9
movq 0x70(%rsp), %r13
movq %rdx, 0x18(%rsp)
subq %r14, %rdx
addq $0x18, %rdx
movq %rdx, 0x8(%rsp)
xorl %eax, %eax
xorl %r15d, %r15d
cmpq %r15, %r9
je 0x3d252
imulq $0x1c, (%r13,%r15,8), %rbp
movl (%rbx,%rbp), %ecx
movl 0xc(%rbx,%rbp), %edx
imulq $0xa8, %rdx, %rdi
movq 0x58(%r12,%rdi), %rdx
shlq $0x5, %rcx
movslq (%rdx,%rcx), %r8
movl 0x18(%rbx,%rbp), %esi
andl $0x3fffffff, %esi       # imm = 0x3FFFFFFF
addq %rsi, %r8
movl 0x4(%rdx,%rcx), %ecx
subl %esi, %ecx
incl %ecx
movslq %ecx, %r10
cmpq %r14, %r8
cmovbeq %r14, %r8
cmpq %r11, %r10
pushq $0x1
popq %rcx
cmovbeq %rcx, %rax
cmovaeq %r11, %r10
cmpq %r8, %r10
jbe 0x3d24a
addq %rbx, %rbp
addq %r12, %rdi
movq %r12, %rbx
movq %r11, %r12
movq 0x8(%rsp), %rcx
leaq (%rcx,%r8), %r11
subq $0x8, %rsp
movq 0x18(%rsp), %rsi
movq 0x20(%rsp), %rdx
movq 0x28(%rsp), %rcx
movq %rax, 0x38(%rsp)
movq %r14, %r13
movq %r9, %r14
movq 0x30(%rsp), %r9
pushq 0xb0(%rsp)
pushq $0x0
pushq %r11
pushq 0xb8(%rsp)
pushq %rbp
pushq %r10
pushq %r8
callq 0x3b54b
movq %r12, %r11
movq %rbx, %r12
movq 0xd0(%rsp), %rbx
movq %r14, %r9
movq %r13, %r14
movq 0xb0(%rsp), %r13
movq 0x70(%rsp), %rax
addq $0x40, %rsp
incq %r15
jmp 0x3d175
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/Correct.cpp
// Function: convert_ul_ov_t(ul_ov_t*, overlap_region*, ma_ug_t*)
void convert_ul_ov_t(ul_ov_t *des, overlap_region *src, ma_ug_t *ug)
{
	des->qn = (uint32_t)-1; des->qs = src->x_pos_s; des->qe = src->x_pos_e+1;
    des->tn = src->y_id; des->el = 1; des->rev = src->y_pos_strand;
    des->sec = src->non_homopolymer_errors;
	if(des->rev) {
		des->ts = ug->u.a[des->tn].len - (src->y_pos_e+1); 
		des->te = ug->u.a[des->tn].len - src->y_pos_s;
	} else {
		des->ts = src->y_pos_s; 
		des->te = src->y_pos_e+1;
	}
}

// Assembly:
orl $-0x1, (%rdi)
movl 0x4(%rsi), %eax
movl %eax, 0x4(%rdi)
movl 0x8(%rsi), %eax
incl %eax
movl %eax, 0x8(%rdi)
movl 0x10(%rsi), %eax
movl %eax, 0xc(%rdi)
movl $0x40000000, %ecx       # imm = 0x40000000
movl 0x18(%rdi), %r8d
orl %ecx, %r8d
movl %r8d, 0x18(%rdi)
movl 0x1c(%rsi), %r9d
movl %r9d, %r10d
shll $0x1f, %r10d
andl $0x7fffffff, %r8d       # imm = 0x7FFFFFFF
orl %r10d, %r8d
movl %r8d, 0x18(%rdi)
movl $0x3fffffff, %r8d       # imm = 0x3FFFFFFF
andl 0x30(%rsi), %r8d
orl %r10d, %r8d
orl %ecx, %r8d
movl %r8d, 0x18(%rdi)
testb $0x1, %r9b
jne 0x3d56f
movl 0x14(%rsi), %eax
movl %eax, 0x10(%rdi)
movl 0x18(%rsi), %eax
incl %eax
jmp 0x3d597
movq 0x10(%rdx), %rcx
imulq $0x28, %rax, %rdx
movl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movl (%rcx,%rdx), %r8d
andl %eax, %r8d
movl 0x18(%rsi), %r9d
notl %r9d
addl %r8d, %r9d
movl %r9d, 0x10(%rdi)
andl (%rcx,%rdx), %eax
subl 0x14(%rsi), %eax
movl %eax, 0x14(%rdi)
retq
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/Correct.cpp
// Function: check_connect_ug(ul_idx_t const*, unsigned int, unsigned int, long, double, long)
uint64_t check_connect_ug(const ul_idx_t *uref, uint32_t v, uint32_t w, int64_t bw, double diff_ec_ul, int64_t dq)
{
	const asg_t *g = uref?uref->ug->g:NULL; int64_t dt = -1;
	uint32_t nv = asg_arc_n(g, v), i; asg_arc_t *av = asg_arc_a(g, v);
	for (i = 0; i < nv; i++) {
		if(av[i].del || av[i].v != w) continue;
		dt = av[i].ol; 
		break;
	}
	if(dt < 0) return 0;
	int64_t diff = (dq>dt? dq-dt:dt-dq), mm = MAX(dq, dt);
	mm *= diff_ec_ul; if(mm < bw) mm = bw;
	if(diff <= mm) return 1;
	return 0;
}

// Assembly:
movq (%rdi), %rax
movq 0x18(%rax), %rax
movq 0x8(%rax), %rdi
movq 0x28(%rax), %rax
movl %esi, %esi
movq (%rax,%rsi,8), %rax
movl %eax, %esi
shrq $0x20, %rax
imulq $0x18, %rsi, %rsi
imulq $0x18, %rax, %rax
addq %rax, %rdi
addq $0xc, %rdi
xorl %eax, %eax
xorl %r9d, %r9d
cmpq %r9, %rsi
je 0x3d616
movslq (%rdi,%r9), %r10
testq %r10, %r10
js 0x3d5df
cmpl %edx, -0x4(%rdi,%r9)
je 0x3d5e5
addq $0x18, %r9
jmp 0x3d5ca
movq %r10, %rax
subq %r8, %rax
cmovgq %r10, %r8
movq %rax, %rdx
negq %rdx
cmovsq %rax, %rdx
cvtsi2sd %r8, %xmm1
mulsd %xmm0, %xmm1
cvttsd2si %xmm1, %rax
cmpq %rcx, %rax
cmovgq %rax, %rcx
xorl %eax, %eax
cmpq %rcx, %rdx
setle %al
retq
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/Correct.cpp
// Function: govlp_check(ul_idx_t const*, ug_opt_t const*, long, double, ul_ov_t*, ul_ov_t*)
uint32_t govlp_check(const ul_idx_t *uref, const ug_opt_t *uopt, int64_t bw, double diff_ec_ul, ul_ov_t *li, ul_ov_t *lj)
{
	int64_t qo = infer_rovlp(li, lj, NULL, NULL, /**ridx**/NULL, uref->ug); ///overlap length in query (UL read)
	
	// fprintf(stderr, "+++[M::%s::utg%.6dl->utg%.6dl] qo::%ld\n", __func__, (int32_t)li->tn+1, (int32_t)lj->tn+1, qo);
	if(check_connect_ug(uref, ((li->tn<<1)|li->rev)^1, ((lj->tn<<1)|lj->rev)^1, bw, diff_ec_ul, qo)) return 1;
	// fprintf(stderr, "[M::%s::] check_connect_ug fail\n", __func__);
	if(check_connect_rg(uref, uopt, ((li->tn<<1)|li->rev)^1, ((lj->tn<<1)|lj->rev)^1, bw, diff_ec_ul, qo)) return 1;
	// fprintf(stderr, "[M::%s::] check_connect_rg fail\n", __func__);
	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r8, %r13
movq %rcx, %rbp
movsd %xmm0, (%rsp)
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movq (%rdi), %r9
movq %rcx, %rdi
movq %r8, %rsi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x3d261
movq %rax, %r12
movl 0xc(%rbp), %eax
movl 0x18(%rbp), %ebp
shrdl $0x1f, %eax, %ebp
xorl $0x1, %ebp
movl 0xc(%r13), %eax
movl 0x18(%r13), %r13d
shrdl $0x1f, %eax, %r13d
xorl $0x1, %r13d
movq %r15, %rdi
movl %ebp, %esi
movl %r13d, %edx
movq %rbx, %rcx
movsd (%rsp), %xmm0
movq %r12, %r8
callq 0x3d59b
testq %rax, %rax
je 0x3d91c
pushq $0x1
popq %rax
jmp 0x3d937
movq %r15, %rdi
movq %r14, %rsi
movl %ebp, %edx
movl %r13d, %ecx
movq %rbx, %r8
movsd (%rsp), %xmm0
movq %r12, %r9
callq 0x3d617
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/Correct.cpp
// Function: prt_overlap_region_stat(overlap_region*, long)
void prt_overlap_region_stat(overlap_region *z, int64_t sid)
{
    uint64_t k = 0, aln = 0, ualn = 0, err = 0;
    for (k = 0; k < z->w_list.n; k++) {
        if(is_ualn_win(z->w_list.a[k])) {
            ualn += z->w_list.a[k].x_end+1-z->w_list.a[k].x_start;
        } else {
            aln += z->w_list.a[k].x_end+1-z->w_list.a[k].x_start;
            err += z->w_list.a[k].error;
        }
    }
    fprintf(stderr, "[M::%s::utg%.6dl::%c] sid::%ld, q::[%d, %d), t::[%d, %d), aln::%lu, ualn::%lu, err::%lu\n", 
        __func__, (int32_t)z->y_id+1, "+-"[z->y_pos_strand], sid, z->x_pos_s, z->x_pos_e+1, 
        z->y_pos_s, z->y_pos_e+1, aln, ualn, err);
    
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rsi, %r9
movq 0x48(%rdi), %rax
xorl %ecx, %ecx
xorl %r10d, %r10d
xorl %r11d, %r11d
xorl %ebx, %ebx
subq $0x1, %rax
jb 0x3dd41
movq 0x58(%rdi), %rsi
movswq 0x14(%rsi,%rcx), %rdx
cmpq $0x7fff, %rdx           # imm = 0x7FFF
jne 0x3dd15
cmpl $0x0, 0x1c(%rsi,%rcx)
jne 0x3dd15
cmpw $0x0, 0x12(%rsi,%rcx)
js 0x3dd30
movl 0x4(%rsi,%rcx), %r8d
subl (%rsi,%rcx), %r8d
incl %r8d
movslq %r8d, %rsi
addq %rsi, %r10
addq %rdx, %rbx
addq $0x20, %rcx
jmp 0x3dced
movl 0x4(%rsi,%rcx), %edx
subl (%rsi,%rcx), %edx
incl %edx
movslq %edx, %rdx
addq %rdx, %r11
jmp 0x3dd2a
movq 0x215298(%rip), %rax    # 0x252fe0
movq (%rax), %rax
movl 0x10(%rdi), %ecx
incl %ecx
movl 0x1c(%rdi), %edx
leaq 0x1a64c9(%rip), %rsi    # 0x1e4223
movsbl (%rdx,%rsi), %r8d
movl 0x4(%rdi), %r14d
movl 0x8(%rdi), %r15d
incl %r15d
movl 0x14(%rdi), %r12d
movl 0x18(%rdi), %r13d
incl %r13d
subq $0x8, %rsp
leaq 0x1a8240(%rip), %rsi    # 0x1e5fc0
leaq 0x1a8292(%rip), %rdx    # 0x1e6019
movq %rax, %rdi
xorl %eax, %eax
pushq %rbx
pushq %r11
pushq %r10
pushq %r13
pushq %r12
pushq %r15
pushq %r14
callq 0x22b0
addq $0x40, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/Correct.cpp
// Function: prt_overlap_region_phase_stat(overlap_region*, long)
void prt_overlap_region_phase_stat(overlap_region *z, int64_t sid)
{
    uint64_t k = 0;
    fprintf(stderr, "[M::%s::utg%.6dl::%c] sid::%ld, q::[%d, %d), t::[%d, %d)\n", __func__, 
        (int32_t)z->y_id+1, "+-"[z->y_pos_strand], sid, z->x_pos_s, z->x_pos_e+1, z->y_pos_s, z->y_pos_e+1);
    for (k = 0; k < z->w_list.n; k++) {
        fprintf(stderr, "[k::%lu] sid::%ld, q::[%d, %d), sec::%u\n", k, sid,
        z->w_list.a[k].x_start, z->w_list.a[k].x_end, z->w_list.a[k].clen);
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq 0x21521c(%rip), %r13    # 0x252fe0
movq (%r13), %rdi
movl 0x10(%r14), %ecx
incl %ecx
movl 0x1c(%r14), %eax
leaq 0x1a644a(%rip), %rdx    # 0x1e4223
movsbl (%rax,%rdx), %r8d
movl 0x4(%r14), %r10d
movl 0x8(%r14), %r11d
incl %r11d
movl 0x14(%r14), %r15d
movl 0x18(%r14), %r12d
incl %r12d
leaq 0x1a8236(%rip), %rsi    # 0x1e6031
leaq 0x1a8269(%rip), %rdx    # 0x1e606b
movq %rbx, %r9
xorl %eax, %eax
pushq %r12
pushq %r15
pushq %r11
pushq %r10
callq 0x22b0
addq $0x20, %rsp
leaq 0x1a826a(%rip), %r15    # 0x1e6089
xorl %ebp, %ebp
xorl %r12d, %r12d
cmpq 0x48(%r14), %r12
jae 0x3de61
movq (%r13), %rdi
movq 0x58(%r14), %rax
movl (%rax,%rbp), %r8d
movl 0x4(%rax,%rbp), %r9d
movl 0x1c(%rax,%rbp), %r10d
subq $0x8, %rsp
movq %r15, %rsi
movq %r12, %rdx
movq %rbx, %rcx
xorl %eax, %eax
pushq %r10
callq 0x22b0
popq %rcx
popq %rdx
incq %r12
addq $0x20, %rbp
jmp 0x3de24
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/Correct.cpp
// Function: debug_inter(overlap_region_alloc*, kv_ul_ov_t*, unsigned long*, long, unsigned long*, long, long, long)
void debug_inter(overlap_region_alloc* ol, kv_ul_ov_t *c_idx, uint64_t *idx, int64_t idx_n, uint64_t *res, int64_t res_n, int64_t s, int64_t e)
{
    ul_ov_t *cp; int64_t q[2], a_n = 0, i, k = 0, os, oe; 
    for (i = 0; i < idx_n; i++) {
        cp = &(c_idx->a[(uint32_t)idx[i]]);
        q[0] = ol->list[ovlp_id(*cp)].w_list.a[ovlp_cur_wid(*cp)].x_start+ovlp_bd(*cp);
        q[1] = ol->list[ovlp_id(*cp)].w_list.a[ovlp_cur_wid(*cp)].x_end+1-ovlp_bd(*cp);
        os = MAX(q[0], s); oe = MIN(q[1], e);
        if(oe > os) {
            a_n++; assert(((uint32_t)idx[i]) == res[k++]);
        }
    }
    // if(a_n != res_n) {
    //     fprintf(stderr, "[M::%s] a_n::%ld\tres_n::%ld\ts::%ld\te::%ld\n", __func__, a_n, res_n, s, e);
    // }
    assert(a_n == res_n);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %r9, 0x8(%rsp)
movq %r8, 0x10(%rsp)
movq 0x58(%rsp), %r8
movq 0x50(%rsp), %r10
xorl %r11d, %r11d
testq %rcx, %rcx
cmovleq %r11, %rcx
xorl %r14d, %r14d
xorl %ebx, %ebx
cmpq %r14, %rcx
je 0x3eb1e
movq (%rsi), %r12
movl (%rdx,%r14,8), %r15d
imulq $0x1c, %r15, %r13
movq (%rdi), %rbp
movl (%r12,%r13), %eax
movl 0xc(%r12,%r13), %r9d
imulq $0xa8, %r9, %r9
movq 0x58(%rbp,%r9), %r9
shlq $0x5, %rax
movslq (%r9,%rax), %rbp
movl 0x18(%r12,%r13), %r12d
andl $0x3fffffff, %r12d      # imm = 0x3FFFFFFF
addq %r12, %rbp
movl 0x4(%r9,%rax), %eax
subl %r12d, %eax
incl %eax
cltq
cmpq %r10, %rbp
cmovleq %r10, %rbp
cmpq %r8, %rax
cmovgeq %r8, %rax
cmpq %rbp, %rax
jle 0x3eb19
movq 0x10(%rsp), %rax
cmpq (%rax,%r11,8), %r15
jne 0x3eb34
incq %rbx
incq %r11
incq %r14
jmp 0x3eaaa
cmpq 0x8(%rsp), %rbx
jne 0x3eb53
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1a7612(%rip), %rdi    # 0x1e614d
leaq 0x1a4b61(%rip), %rsi    # 0x1e36a3
leaq 0x1a7623(%rip), %rcx    # 0x1e616c
movl $0x4c5b, %edx           # imm = 0x4C5B
callq 0x2110
leaq 0x1a7685(%rip), %rdi    # 0x1e61df
leaq 0x1a4b42(%rip), %rsi    # 0x1e36a3
leaq 0x1a7604(%rip), %rcx    # 0x1e616c
movl $0x4c61, %edx           # imm = 0x4C61
callq 0x2110
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/Correct.cpp
// Function: debug_snp_site(overlap_region*, All_reads*, UC_Read*, haplotype_evdience*, long)
void debug_snp_site(overlap_region* ol, All_reads *rref, UC_Read *qu, haplotype_evdience *a, int64_t a_n)
{
    int64_t k; char ystr; 
    for (k = 0; k < a_n; k++) {
        recover_UC_Read_sub_region(&ystr, a[k].overlapSite, 1, ol[a[k].overlapID].y_pos_strand, rref, ol[a[k].overlapID].y_id);
        // if(a[k].misBase == ystr) fprintf(stderr, "[M::%s] misBase::%c\tystr::%c\n", __func__, a[k].misBase, ystr);
        assert(a[k].misBase == ystr);
        if(a[k].type == 0) {
            assert(qu->seq[a[k].site] == ystr);
        } else {
            assert(qu->seq[a[k].site] != ystr);
        }
    }
    
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %rbx
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
xorl %r13d, %r13d
testq %r8, %r8
cmovgq %r8, %r13
pushq $0x1
popq %rbp
subq $0x1, %r13
jb 0x3ebeb
movl 0x4(%rbx), %eax
movl 0x8(%rbx), %esi
imulq $0xa8, %rax, %rax
movzbl 0x1c(%r12,%rax), %ecx
movl 0x10(%r12,%rax), %r9d
leaq 0x7(%rsp), %rdi
movq %rbp, %rdx
movq %r15, %r8
callq 0x6c9e
movb 0x14(%rbx), %al
cmpb 0x7(%rsp), %al
jne 0x3ebfa
cmpb $0x0, 0xc(%rbx)
movq (%r14), %rcx
movl (%rbx), %edx
movb (%rcx,%rdx), %cl
je 0x3ebe1
cmpb %al, %cl
jne 0x3ebe5
jmp 0x3ec19
cmpb %al, %cl
jne 0x3ec38
addq $0x18, %rbx
jmp 0x3eb96
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1a75eb(%rip), %rdi    # 0x1e61ec
leaq 0x1a4a9b(%rip), %rsi    # 0x1e36a3
leaq 0x1a75f2(%rip), %rcx    # 0x1e6201
movl $0x4c6a, %edx           # imm = 0x4C6A
callq 0x2110
leaq 0x1a7659(%rip), %rdi    # 0x1e6279
leaq 0x1a4a7c(%rip), %rsi    # 0x1e36a3
leaq 0x1a75d3(%rip), %rcx    # 0x1e6201
movl $0x4c6e, %edx           # imm = 0x4C6E
callq 0x2110
leaq 0x1a761f(%rip), %rdi    # 0x1e625e
leaq 0x1a4a5d(%rip), %rsi    # 0x1e36a3
leaq 0x1a75b4(%rip), %rcx    # 0x1e6201
movl $0x4c6c, %edx           # imm = 0x4C6C
callq 0x2110
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/Correct.cpp
// Function: cal_lindel_dd(ul_ov_t*, ul_ov_t*, double, unsigned long, double, unsigned long)
double cal_lindel_dd(ul_ov_t *a, ul_ov_t *b, double ol_r, uint64_t ol_w, double err_dif, uint64_t c_sz)
{
    if(a->tn == b->tn) return -1;
    uint64_t os, oe, ol; int64_t ea, eb, ed;
    os = MAX(a->qs, b->qs); oe = MIN(a->qe, b->qe);
    if(oe <= os + ol_w) return -1;
    ol = oe - os;
    // if((ol < ((a->qe - a->qs)*ol_r)) || (ol < ((b->qe - b->qs)*ol_r))) return -1;
    if((ol < ((a->qe - a->qs)*ol_r)) && (ol < ((b->qe - b->qs)*ol_r))) return -1;

    ea = a->qn; eb = b->qn;
    ed = ((ea >= eb)?(ea - eb):(eb - ea));
    if((ed > (ea * err_dif)) || (ed > (eb * err_dif))) return -1;

    double sc;
    sc = ((double)(ea - ed + eb - ed))/((double)(ea + eb));
    sc += ((double)(ol + ol)) / ((double)(a->qe - a->qs + b->qe - b->qs));
    return sc;
}

// Assembly:
movapd %xmm0, %xmm2
movl 0xc(%rdi), %eax
movsd 0x1a40db(%rip), %xmm0   # 0x1e3580
cmpl 0xc(%rsi), %eax
je 0x3f5b4
movl 0x4(%rdi), %eax
movl 0x4(%rsi), %ecx
cmpl %ecx, %eax
movl %ecx, %r11d
cmoval %eax, %r11d
movl 0x8(%rdi), %r8d
movl 0x8(%rsi), %r9d
cmpl %r9d, %r8d
movl %r9d, %r10d
cmovbl %r8d, %r10d
addq %r11, %rdx
cmpq %r10, %rdx
jae 0x3f5b4
subq %r11, %r10
movq %r10, %xmm4
punpckldq 0x1a3d85(%rip), %xmm4 # xmm4 = xmm4[0],mem[0],xmm4[1],mem[1]
subpd 0x1a3d8d(%rip), %xmm4   # 0x1e3280
movapd %xmm4, %xmm3
unpckhpd %xmm4, %xmm3            # xmm3 = xmm3[1],xmm4[1]
movl %r8d, %edx
subl %eax, %edx
cvtsi2sd %rdx, %xmm5
addsd %xmm4, %xmm3
mulsd %xmm2, %xmm5
ucomisd %xmm3, %xmm5
jbe 0x3f52b
movl %r9d, %edx
subl %ecx, %edx
cvtsi2sd %rdx, %xmm4
mulsd %xmm2, %xmm4
ucomisd %xmm3, %xmm4
ja 0x3f5b4
movl (%rdi), %edi
movl (%rsi), %edx
movq %rdi, %r11
subq %rdx, %r11
movq %rdx, %rsi
subq %rdi, %rsi
cmpl %edx, %edi
cmovaeq %r11, %rsi
cvtsi2sd %rsi, %xmm2
cvtsi2sd %rdi, %xmm3
mulsd %xmm1, %xmm3
ucomisd %xmm3, %xmm2
ja 0x3f5b4
cvtsi2sd %rdx, %xmm3
mulsd %xmm1, %xmm3
ucomisd %xmm3, %xmm2
ja 0x3f5b4
addq %rdi, %rdx
addq %rsi, %rsi
cvtsi2sd %rdx, %xmm0
subq %rsi, %rdx
cvtsi2sd %rdx, %xmm1
divsd %xmm0, %xmm1
addq %r10, %r10
movq %r10, %xmm2
punpckldq 0x1a3ce5(%rip), %xmm2 # xmm2 = xmm2[0],mem[0],xmm2[1],mem[1]
subpd 0x1a3ced(%rip), %xmm2   # 0x1e3280
movapd %xmm2, %xmm0
unpckhpd %xmm2, %xmm0            # xmm0 = xmm0[1],xmm2[1]
addsd %xmm2, %xmm0
addl %eax, %ecx
subl %ecx, %r8d
addl %r9d, %r8d
cvtsi2sd %r8, %xmm2
divsd %xmm2, %xmm0
addsd %xmm1, %xmm0
retq
// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/Correct.cpp
// Function: gen_aln_ul_ov_t(long, long, overlap_region*, ul_ov_t*)
int64_t gen_aln_ul_ov_t(int64_t in_id, int64_t tl, overlap_region *in, ul_ov_t *ou)
{
    int64_t zwn; memset(ou, 0, sizeof((*ou)));
    zwn = in->w_list.n; if(!zwn) return 0;

    ///in_id -> ovlp id
    ou->qn = in_id; ou->tn = in->y_id; 
    ou->rev = in->y_pos_strand;
    ou->qs = in->w_list.a[0].x_start;
    ou->qe = in->w_list.a[zwn-1].x_end+1;
    
    if(!(ou->rev)) {
        ou->ts = in->w_list.a[0].y_start;
        ou->te = in->w_list.a[zwn-1].y_end+1;
    } else {
        ou->ts = tl-(in->w_list.a[zwn-1].y_end+1);
        ou->te = tl-in->w_list.a[0].y_start;
    }
    return 1;
}

// Assembly:
xorps %xmm0, %xmm0
movups %xmm0, 0xc(%rcx)
movups %xmm0, (%rcx)
movq 0x48(%rdx), %rax
testq %rax, %rax
je 0x4176a
movl %edi, (%rcx)
movl 0x10(%rdx), %edi
movl %edi, 0xc(%rcx)
movl 0x1c(%rdx), %edi
shll $0x1f, %edi
movl %edi, 0x18(%rcx)
movq 0x58(%rdx), %rdx
movl (%rdx), %r8d
movl %r8d, 0x4(%rcx)
decq %rax
shlq $0x5, %rax
movl 0x4(%rdx,%rax), %r8d
incl %r8d
movl %r8d, 0x8(%rcx)
testl %edi, %edi
je 0x4176d
movl 0xc(%rdx,%rax), %eax
notl %eax
addl %esi, %eax
movl %eax, 0x10(%rcx)
subl 0x8(%rdx), %esi
jmp 0x41779
xorl %eax, %eax
retq
movl 0x8(%rdx), %esi
movl %esi, 0x10(%rcx)
movl 0xc(%rdx,%rax), %esi
incl %esi
movl %esi, 0x14(%rcx)
pushq $0x1
popq %rax
retq