// File: /workspace/github_cpp_makefile_star2_O3/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 0x10a2da
xorl %r12d, %r12d
xorl %r14d, %r14d
movq (%rbx), %rdi
addq %r12, %rdi
movl %r15d, %esi
callq 0x10a0b3
incq %r14
movl 0x8(%rbx), %eax
addq $0xf0, %r12
cmpq %rax, %r14
jb 0x10a2ba
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 0x18b406(%rip), %rax    # 0x295758
cmpl $0x0, 0x148(%rax)
movl 0x144(%rax), %eax
jne 0x10a378
testl %eax, %eax
jle 0x10a391
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
divsd 0x12b9ec(%rip), %xmm0   # 0x235d60
cvttsd2si %xmm0, %eax
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
mulsd 0x12f339(%rip), %xmm0   # 0x2396c0
cvttsd2si %xmm0, %rcx
testq %rcx, %rcx
jg 0x10a398
movq $-0x1, %rcx
movq %r13, %rdi
callq 0x10a19e
movq %rax, 0x10(%rbx)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq