// File: /workspace/github_cpp_makefile_star2_O1/chhylp123[P]hifiasm/Purge_Dups.cpp
// Function: init_hap_alignment_struct_pip(hap_alignment_struct_pip*, unsigned int, unsigned int, ma_ug_t*, asg_t*, ma_hit_t_alloc*, ma_hit_t_alloc*, R_to_U*, ma_sub_t*, unsigned long*, float, int, int, float, hap_overlaps_list*, hap_cov_t*)
void init_hap_alignment_struct_pip(hap_alignment_struct_pip* x, uint32_t num_threads, uint32_t n_seq,
ma_ug_t *ug, asg_t *read_g,  ma_hit_t_alloc* sources, ma_hit_t_alloc* reverse_sources, R_to_U* ruIndex, ma_sub_t *coverage_cut, 
uint64_t* position_index, float Hap_rate, int max_hang, int min_ovlp, float chain_rate, hap_overlaps_list* all_ovlp, hap_cov_t *cov)
{
    uint32_t i;
    x->num_threads = num_threads;
    x->buf = (hap_alignment_struct*)malloc(sizeof(hap_alignment_struct)*x->num_threads);
    for (i = 0; i < x->num_threads; i++)
    {
        init_hap_alignment_struct(&(x->buf[i]), n_seq);
    }

    x->ug = ug;
    x->read_g = read_g;
    x->sources = sources;
    x->reverse_sources = reverse_sources;
    x->ruIndex = ruIndex;
    x->coverage_cut = coverage_cut;
    x->position_index = position_index;
    x->Hap_rate = Hap_rate;
    x->max_hang = max_hang;
    x->min_ovlp = min_ovlp;
    x->chain_rate = chain_rate;
    x->all_ovlp = all_ovlp;
    x->cov = cov;
    long long sc = -1;
    if(asm_opt.hom_global_coverage_set) {
        sc = asm_opt.hom_global_coverage*1.75;
    }
    else {
        if(asm_opt.hom_global_coverage > 0){
            sc = ((int)(((double)asm_opt.hom_global_coverage)/((double)HOM_PEAK_RATE)))*1.75;
        }
    }
    if(sc <= 0) sc = -1;
    x->hh = init_pip_hh(read_g, reverse_sources, coverage_cut, sc);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movss %xmm1, 0xc(%rsp)
movss %xmm0, 0x8(%rsp)
movq %r9, 0x10(%rsp)
movq %r8, %r13
movq %rcx, %rbp
movl %edx, %r15d
movl %esi, %r12d
movq %rdi, %rbx
movl %esi, 0x8(%rdi)
movl %esi, %eax
imulq $0xf0, %rax, %rdi
callq 0x2280
movq %rax, (%rbx)
testl %r12d, %r12d
je 0x105b26
xorl %r12d, %r12d
xorl %r14d, %r14d
movq (%rbx), %rdi
addq %r12, %rdi
movl %r15d, %esi
callq 0x1058de
incq %r14
movl 0x8(%rbx), %eax
addq $0xf0, %r12
cmpq %rax, %r14
jb 0x105b06
movq %rbp, 0x18(%rbx)
movq %r13, 0x20(%rbx)
movq 0x10(%rsp), %rax
movq %rax, 0x28(%rbx)
movq 0x50(%rsp), %rsi
movq %rsi, 0x30(%rbx)
movq 0x58(%rsp), %rax
movq %rax, 0x38(%rbx)
movq 0x60(%rsp), %rdx
movq %rdx, 0x40(%rbx)
movq 0x68(%rsp), %rax
movq %rax, 0x48(%rbx)
movss 0x8(%rsp), %xmm0
movss %xmm0, 0x50(%rbx)
movl 0x70(%rsp), %eax
movl %eax, 0x54(%rbx)
movl 0x78(%rsp), %eax
movl %eax, 0x58(%rbx)
movss 0xc(%rsp), %xmm0
movss %xmm0, 0x5c(%rbx)
movq 0x80(%rsp), %rax
movq %rax, 0x60(%rbx)
movq 0x88(%rsp), %rax
movq %rax, 0x70(%rbx)
leaq 0x184bba(%rip), %rax    # 0x28a758
cmpl $0x0, 0x148(%rax)
movl 0x144(%rax), %eax
je 0x105bb6
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
jmp 0x105bd1
testl %eax, %eax
jle 0x105c07
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
divsd 0x123f9f(%rip), %xmm0   # 0x229b68
cvttpd2dq %xmm0, %xmm0
cvtdq2pd %xmm0, %xmm0
mulsd 0x1278d7(%rip), %xmm0   # 0x22d4b0
cvttsd2si %xmm0, %rax
testq %rax, %rax
movq $-0x1, %rcx
cmovgq %rax, %rcx
movq %r13, %rdi
callq 0x1059e5
movq %rax, 0x10(%rbx)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq $-0x1, %rax
jmp 0x105bde