// File: chhylp123[P]hifiasm/Correct.cpp
// Function: merge_SNP_Vectors(haplotype_evdience_alloc*, unsigned int*, long long)
void merge_SNP_Vectors(haplotype_evdience_alloc* hap, uint32_t* SNPs, long long SNPLen)
{
    
    int8_t* vector = Get_Result_SNP_Vector((*hap));
    memset(vector, -1, Get_SNP_Vector_Length((*hap)));
    hap->result_stat.occ_0 = 0;
    hap->result_stat.occ_1 = 0;
    hap->result_stat.occ_2 = 0;
    hap->result_stat.score = SNPLen;
    hap->result_stat.homopolymer_num = 0;
    hap->result_stat.non_homopolymer_num = 0;

    long long snpID1;
    long long j = 0;
    int flag, vectorID;
    for (j = 0; j < SNPLen; j++)
    {
        snpID1 = SNPs[j];
        vectorID = hap->snp_stat.a[snpID1].id;
        vector = Get_SNP_Vector((*hap), vectorID);
        if(hap->snp_stat.a[snpID1].is_homopolymer)
        {
            hap->result_stat.homopolymer_num++;
        }
        else
        {
            hap->result_stat.non_homopolymer_num++;
        }

        if((flag = debug_add_to_result_snp_vector(hap, vector, Get_SNP_Vector_Length((*hap))))!= -1)
        {
            fprintf(stderr, "incompatible snp vector....\n");
            exit(0);
        }
    }
    hap->result_stat.overlap_num = hap->result_stat.occ_0 + hap->result_stat.occ_1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq 0x1e0(%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rdi
movq -0x8(%rbp), %rax
movl 0x1c8(%rax), %eax
movl %eax, %edx
movl $0xff, %esi
callq 0x2100
movq -0x8(%rbp), %rax
movl $0x0, 0x1f4(%rax)
movq -0x8(%rbp), %rax
movl $0x0, 0x1f8(%rax)
movq -0x8(%rbp), %rax
movl $0x0, 0x1fc(%rax)
movq -0x18(%rbp), %rax
movl %eax, %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x208(%rax)
movq -0x8(%rbp), %rax
movl $0x0, 0x200(%rax)
movq -0x8(%rbp), %rax
movl $0x0, 0x204(%rax)
movq $0x0, -0x30(%rbp)
movq $0x0, -0x30(%rbp)
movq -0x30(%rbp), %rax
cmpq -0x18(%rbp), %rax
jge 0x3f14c
movq -0x10(%rbp), %rax
movq -0x30(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rax
movq 0x218(%rax), %rax
imulq $0x28, -0x28(%rbp), %rcx
addq %rcx, %rax
movl (%rax), %eax
movl %eax, -0x38(%rbp)
movq -0x8(%rbp), %rax
movq 0x1d0(%rax), %rax
movq -0x8(%rbp), %rcx
movl 0x1c8(%rcx), %ecx
imull -0x38(%rbp), %ecx
movl %ecx, %ecx
addq %rcx, %rax
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq 0x218(%rax), %rax
imulq $0x28, -0x28(%rbp), %rcx
addq %rcx, %rax
cmpb $0x0, 0x24(%rax)
je 0x3f0e8
movq -0x8(%rbp), %rax
movl 0x200(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x200(%rax)
jmp 0x3f0fb
movq -0x8(%rbp), %rax
movl 0x204(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x204(%rax)
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x8(%rbp), %rax
movl 0x1c8(%rax), %edx
callq 0x3e280
movl %eax, -0x34(%rbp)
cmpl $-0x1, %eax
je 0x3f139
movq 0x384ebf(%rip), %rax    # 0x3c3fe0
movq (%rax), %rdi
leaq 0x343687(%rip), %rsi    # 0x3827b2
movb $0x0, %al
callq 0x22a0
xorl %edi, %edi
callq 0x2240
jmp 0x3f13b
movq -0x30(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x30(%rbp)
jmp 0x3f063
movq -0x8(%rbp), %rax
movl 0x1f4(%rax), %ecx
movq -0x8(%rbp), %rax
addl 0x1f8(%rax), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x1f0(%rax)
addq $0x40, %rsp
popq %rbp
retq