// File: /workspace/github_cpp_makefile_star2_O2/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, 0x4(%rsp)
movss %xmm0, (%rsp)
movq %r9, 0x8(%rsp)
movq %r8, 0x10(%rsp)
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)
xorl %r14d, %r14d
xorl %r13d, %r13d
movl %r12d, %eax
cmpq %rax, %r13
jae 0xc7b8b
movq (%rbx), %rdi
addq %r14, %rdi
movl %r15d, %esi
callq 0xc795d
incq %r13
movl 0x8(%rbx), %r12d
addq $0xf0, %r14
jmp 0xc7b65
movq %rbp, 0x18(%rbx)
movq 0x10(%rsp), %rdi
movq %rdi, 0x20(%rbx)
movq 0x8(%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 (%rsp), %xmm0
movss %xmm0, 0x50(%rbx)
movl 0x70(%rsp), %eax
movl %eax, 0x54(%rbx)
movl 0x78(%rsp), %eax
movl %eax, 0x58(%rbx)
movss 0x4(%rsp), %xmm0
movss %xmm0, 0x5c(%rbx)
movq 0x80(%rsp), %rax
movq %rax, 0x60(%rbx)
movq 0x88(%rsp), %rax
movq %rax, 0x70(%rbx)
leaq 0x18bb51(%rip), %rax    # 0x253758
cmpl $0x0, 0x148(%rax)
movl 0x144(%rax), %eax
jne 0xc7c2a
testl %eax, %eax
jle 0xc7c40
cvtsi2sd %eax, %xmm0
divsd 0x12003a(%rip), %xmm0   # 0x1e7c60
cvttsd2si %xmm0, %eax
cvtsi2sd %eax, %xmm0
mulsd 0x12396a(%rip), %xmm0   # 0x1eb5a0
cvttsd2si %xmm0, %rcx
testq %rcx, %rcx
jg 0xc7c43
pushq $-0x1
popq %rcx
callq 0xc7a4c
movq %rax, 0x10(%rbx)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq