// File: chhylp123[P]hifiasm/Correct.cpp
// Function: remove_reads(haplotype_evdience_alloc*, unsigned int*, long long, overlap_region_alloc*)
void remove_reads(haplotype_evdience_alloc* hap, uint32_t* SNPs, long long SNPsLen, overlap_region_alloc* overlap_list)
{
    long long i, j, snpID, vectorID, overlapLen;
    int8_t *vector;

    for (i = 0; i < SNPsLen; i++)
    {
        snpID = SNPs[i];
        vectorID = hap->snp_stat.a[snpID].id;
        vector = Get_SNP_Vector((*hap), vectorID);
        ///hap->snp_stat[snpID].site;

        for (j = 0; j < Get_SNP_Vector_Length((*hap)); j++)
        {
            
            if(vector[j] == 1 && overlap_list->list[j].is_match == 1)
            {
                //overlap_list->list[j].is_match = 0;
                overlap_list->list[j].is_match = 2;
                overlapLen = overlap_list->list[j].x_pos_e - overlap_list->list[j].x_pos_s + 1;
                ///overlap_list->mapped_overlaps--;
                overlap_list->mapped_overlaps_length -= overlapLen;
            }

            /****************************may have bugs********************************/
            if( hap->snp_stat.a[snpID].site >= overlap_list->list[j].x_pos_s
                &&
                hap->snp_stat.a[snpID].site <= overlap_list->list[j].x_pos_e)
              {
                  overlap_list->list[j].strong = 1;
              }
            /****************************may have bugs********************************/

        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq $0x0, -0x28(%rbp)
movq -0x28(%rbp), %rax
cmpq -0x18(%rbp), %rax
jge 0x3f320
movq -0x10(%rbp), %rax
movq -0x28(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movq %rax, -0x38(%rbp)
movq -0x8(%rbp), %rax
movq 0x218(%rax), %rax
imulq $0x28, -0x38(%rbp), %rcx
addq %rcx, %rax
movl (%rax), %eax
movq %rax, -0x40(%rbp)
movq -0x8(%rbp), %rax
movq 0x1d0(%rax), %rax
movq -0x8(%rbp), %rcx
movl 0x1c8(%rcx), %ecx
imulq -0x40(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x50(%rbp)
movq $0x0, -0x30(%rbp)
movq -0x30(%rbp), %rax
movq -0x8(%rbp), %rcx
movl 0x1c8(%rcx), %ecx
cmpq %rcx, %rax
jge 0x3f30d
movq -0x50(%rbp), %rax
movq -0x30(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x1, %eax
jne 0x3f28a
movq -0x20(%rbp), %rax
movq (%rax), %rax
imulq $0xa8, -0x30(%rbp), %rcx
addq %rcx, %rax
movzbl 0x2c(%rax), %eax
cmpl $0x1, %eax
jne 0x3f28a
movq -0x20(%rbp), %rax
movq (%rax), %rax
imulq $0xa8, -0x30(%rbp), %rcx
addq %rcx, %rax
movb $0x2, 0x2c(%rax)
movq -0x20(%rbp), %rax
movq (%rax), %rax
imulq $0xa8, -0x30(%rbp), %rcx
addq %rcx, %rax
movl 0x8(%rax), %eax
movq -0x20(%rbp), %rcx
movq (%rcx), %rcx
imulq $0xa8, -0x30(%rbp), %rdx
addq %rdx, %rcx
subl 0x4(%rcx), %eax
addl $0x1, %eax
movl %eax, %eax
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rdx
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rcx
subq %rdx, %rcx
movq %rcx, 0x18(%rax)
movq -0x8(%rbp), %rax
movq 0x218(%rax), %rax
imulq $0x28, -0x38(%rbp), %rcx
addq %rcx, %rax
movl 0x20(%rax), %eax
movq -0x20(%rbp), %rcx
movq (%rcx), %rcx
imulq $0xa8, -0x30(%rbp), %rdx
addq %rdx, %rcx
cmpl 0x4(%rcx), %eax
jb 0x3f2fa
movq -0x8(%rbp), %rax
movq 0x218(%rax), %rax
imulq $0x28, -0x38(%rbp), %rcx
addq %rcx, %rax
movl 0x20(%rax), %eax
movq -0x20(%rbp), %rcx
movq (%rcx), %rcx
imulq $0xa8, -0x30(%rbp), %rdx
addq %rdx, %rcx
cmpl 0x8(%rcx), %eax
ja 0x3f2fa
movq -0x20(%rbp), %rax
movq (%rax), %rax
imulq $0xa8, -0x30(%rbp), %rcx
addq %rcx, %rax
movb $0x1, 0x2e(%rax)
jmp 0x3f2fc
movq -0x30(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x30(%rbp)
jmp 0x3f1eb
jmp 0x3f30f
movq -0x28(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
jmp 0x3f18c
popq %rbp
retq
nopw %cs:(%rax,%rax)