// File: chhylp123[P]hifiasm/ecovlp.cpp
// Function: worker_hap_dc_ec_chemical_arc_mark(void*, long, int)
static void worker_hap_dc_ec_chemical_arc_mark(void *data, long i, int tid)
{
    ec_ovec_buf_t0 *b = &(((ec_ovec_buf_t*)data)->a[tid]);
    ma_hit_t_alloc *paf = &(R_INF.paf[i]), *rev; uint64_t k, z; int64_t cov, msk_cut = asm_opt.chemical_cov;
    uint8_t *msk = ((ec_ovec_buf_t*)data)->cr;

    if(b->cnt[1] == 0) {
        msk[i] = (uint8_t)-1;
        cov = cal_chemical_r_adv(&(R_INF.paf[i]), &b->v64, Get_READ_LENGTH((R_INF), i), asm_opt.chemical_flank, 0.02, 1);
        if(cov <= msk_cut) msk[i] = cov;
        if(cov <= msk_cut/**FORCE_CUT**/) {
            // fprintf(stderr, "-um-[M::%s]\tqn::%u::%.*s\n\n", __func__, (uint32_t)(i), (int)Get_NAME_LENGTH(R_INF, i), Get_NAME((R_INF), i));   
            for (k = 0; k < paf->length; k++) paf->buffer[k].del = 1; b->cnt[0]++;
        }
    } else if(b->cnt[1] == 1) {
        for (k = 0; k < paf->length; k++) {
            if((Get_qn(paf->buffer[k])) > (Get_tn(paf->buffer[k]))) continue;
            rev = &(R_INF.paf[paf->buffer[k].tn]);
            for (z = 0; z < rev->length; z++) {
                if((rev->buffer[z].tn == (Get_qn(paf->buffer[k])))) {
                    if((paf->buffer[k].del != rev->buffer[z].del) || (msk[Get_qn(paf->buffer[k])] <= msk_cut/**FORCE_CUT**/) || (msk[Get_tn(paf->buffer[k])] <= msk_cut/**FORCE_CUT**/)) {
                        paf->buffer[k].del = rev->buffer[z].del = 1;
                    }
                }
            }
        }
    }

   refresh_ec_ovec_buf_t0(b, REFRESH_N);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movslq -0x14(%rbp), %rcx
imulq $0x5c0, %rcx, %rcx      # imm = 0x5C0
addq %rcx, %rax
movq %rax, -0x20(%rbp)
leaq 0x15992d(%rip), %rax    # 0x3c52d0
movq 0x78(%rax), %rax
imulq $0x18, -0x10(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x28(%rbp)
leaq 0x158e3e(%rip), %rax    # 0x3c47f8
movq 0x2b8(%rax), %rax
movq %rax, -0x50(%rbp)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x58(%rbp)
movq -0x20(%rbp), %rax
cmpq $0x0, 0xc8(%rax)
jne 0x26bad9
movq -0x58(%rbp), %rax
movq -0x10(%rbp), %rcx
movb $-0x1, (%rax,%rcx)
leaq 0x1598da(%rip), %rax    # 0x3c52d0
movq 0x78(%rax), %rdi
imulq $0x18, -0x10(%rbp), %rax
addq %rax, %rdi
movq -0x20(%rbp), %rsi
addq $0x4d0, %rsi            # imm = 0x4D0
leaq 0x1598bc(%rip), %rax    # 0x3c52d0
movq 0x18(%rax), %rax
movq -0x10(%rbp), %rcx
movq (%rax,%rcx,8), %rdx
leaq 0x158dd1(%rip), %rax    # 0x3c47f8
movq 0x2c0(%rax), %rcx
movsd 0x113612(%rip), %xmm0   # 0x37f048
movl $0x1, %r8d
callq 0x25bbf0
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rax
cmpq -0x50(%rbp), %rax
jg 0x26ba60
movq -0x48(%rbp), %rax
movb %al, %dl
movq -0x58(%rbp), %rax
movq -0x10(%rbp), %rcx
movb %dl, (%rax,%rcx)
movq -0x48(%rbp), %rax
cmpq -0x50(%rbp), %rax
jg 0x26bad4
movq $0x0, -0x38(%rbp)
movq -0x38(%rbp), %rax
movq -0x28(%rbp), %rcx
movl 0xc(%rcx), %ecx
cmpq %rcx, %rax
jae 0x26babe
movq -0x28(%rbp), %rax
movq (%rax), %rax
imulq $0x28, -0x38(%rbp), %rcx
addq %rcx, %rax
movabsq $0x7fffffffffffffff, %rcx # imm = 0x7FFFFFFFFFFFFFFF
andq 0x18(%rax), %rcx
movabsq $-0x8000000000000000, %rdx # imm = 0x8000000000000000
orq %rdx, %rcx
movq %rcx, 0x18(%rax)
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
jmp 0x26ba72
movq -0x20(%rbp), %rax
movq 0xc0(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0xc0(%rax)
jmp 0x26bcaa
movq -0x20(%rbp), %rax
cmpq $0x1, 0xc8(%rax)
jne 0x26bca8
movq $0x0, -0x38(%rbp)
movq -0x38(%rbp), %rax
movq -0x28(%rbp), %rcx
movl 0xc(%rcx), %ecx
cmpq %rcx, %rax
jae 0x26bca6
movq -0x28(%rbp), %rax
movq (%rax), %rax
imulq $0x28, -0x38(%rbp), %rcx
addq %rcx, %rax
movq (%rax), %rax
shrq $0x20, %rax
movq -0x28(%rbp), %rcx
movq (%rcx), %rcx
imulq $0x28, -0x38(%rbp), %rdx
addq %rdx, %rcx
cmpl 0xc(%rcx), %eax
jbe 0x26bb36
jmp 0x26bc95
leaq 0x159793(%rip), %rax    # 0x3c52d0
movq 0x78(%rax), %rax
movq -0x28(%rbp), %rcx
movq (%rcx), %rcx
imulq $0x28, -0x38(%rbp), %rdx
addq %rdx, %rcx
movl 0xc(%rcx), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x30(%rbp)
movq $0x0, -0x40(%rbp)
movq -0x40(%rbp), %rax
movq -0x30(%rbp), %rcx
movl 0xc(%rcx), %ecx
cmpq %rcx, %rax
jae 0x26bc93
movq -0x30(%rbp), %rax
movq (%rax), %rax
imulq $0x28, -0x40(%rbp), %rcx
addq %rcx, %rax
movl 0xc(%rax), %eax
movq -0x28(%rbp), %rcx
movq (%rcx), %rcx
imulq $0x28, -0x38(%rbp), %rdx
addq %rdx, %rcx
movq (%rcx), %rcx
shrq $0x20, %rcx
cmpl %ecx, %eax
jne 0x26bc80
movq -0x28(%rbp), %rax
movq (%rax), %rax
imulq $0x28, -0x38(%rbp), %rcx
addq %rcx, %rax
movq 0x18(%rax), %rax
shrq $0x3f, %rax
movq -0x30(%rbp), %rcx
movq (%rcx), %rcx
imulq $0x28, -0x40(%rbp), %rdx
addq %rdx, %rcx
movq 0x18(%rcx), %rcx
shrq $0x3f, %rcx
cmpl %ecx, %eax
jne 0x26bc22
movq -0x58(%rbp), %rax
movq -0x28(%rbp), %rcx
movq (%rcx), %rcx
imulq $0x28, -0x38(%rbp), %rdx
addq %rdx, %rcx
movq (%rcx), %rcx
shrq $0x20, %rcx
movl %ecx, %ecx
movzbl (%rax,%rcx), %eax
cmpq -0x50(%rbp), %rax
jle 0x26bc22
movq -0x58(%rbp), %rax
movq -0x28(%rbp), %rcx
movq (%rcx), %rcx
imulq $0x28, -0x38(%rbp), %rdx
addq %rdx, %rcx
movl 0xc(%rcx), %ecx
movzbl (%rax,%rcx), %eax
cmpq -0x50(%rbp), %rax
jg 0x26bc7e
movq -0x30(%rbp), %rax
movq (%rax), %rax
imulq $0x28, -0x40(%rbp), %rcx
addq %rcx, %rax
movabsq $0x7fffffffffffffff, %rcx # imm = 0x7FFFFFFFFFFFFFFF
andq 0x18(%rax), %rcx
movabsq $-0x8000000000000000, %rdx # imm = 0x8000000000000000
orq %rdx, %rcx
movq %rcx, 0x18(%rax)
movq -0x28(%rbp), %rax
movq (%rax), %rax
imulq $0x28, -0x38(%rbp), %rcx
addq %rcx, %rax
movabsq $0x7fffffffffffffff, %rcx # imm = 0x7FFFFFFFFFFFFFFF
andq 0x18(%rax), %rcx
movabsq $-0x8000000000000000, %rdx # imm = 0x8000000000000000
orq %rdx, %rcx
movq %rcx, 0x18(%rax)
jmp 0x26bc80
jmp 0x26bc82
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x40(%rbp)
jmp 0x26bb66
jmp 0x26bc95
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
jmp 0x26baf3
jmp 0x26bca8
jmp 0x26bcaa
movq -0x20(%rbp), %rdi
movl $0x80, %esi
callq 0x26e2d0
addq $0x60, %rsp
popq %rbp
retq
nop