// File: /workspace/github_cpp_makefile_star2_O1/chhylp123[P]hifiasm/Overlaps.cpp
// Function: gen_shallow_ref_trans(bubble_type*, scaf_res_t*, scaf_res_t*, asg_t*, ma_ug_t*, ma_sub_t*, ma_hit_t_alloc*, ma_hit_t_alloc*, long long, float, long long, R_to_U*, float, float, int, int, bub_label_t*)
kv_u_trans_t *gen_shallow_ref_trans(bubble_type *bu, scaf_res_t *cp0, scaf_res_t *cp1, asg_t *sg, ma_ug_t *ref, ma_sub_t* cover, ma_hit_t_alloc* src, ma_hit_t_alloc* rev,
long long tipsLen, float tip_drop_ratio, long long stops_threshold, R_to_U* ruIndex, float chimeric_rate, float drop_ratio, int max_hang, int min_ovlp, bub_label_t* b_mask_t)
{
    kvec_asg_arc_t_warp ne; kv_init(ne.a); kv_u_trans_t *p = NULL; CALLOC(p, 1);
    ma_ug_t *cref = gen_shallow_clean_ug(ref, bu, cp0, cp1);
    asg_t *csg = copy_read_graph(sg); hap_cov_t *cov = NULL; ne.a.n = 0;  

    adjust_utg_by_primary(&cref, csg, TRIO_THRES, src, rev, cover, tipsLen, tip_drop_ratio, stops_threshold, ruIndex, chimeric_rate, drop_ratio, max_hang, min_ovlp, &ne, &cov, b_mask_t, 0, 0);

    ma_ug_destroy(cref); asg_destroy(csg); kv_destroy(ne.a);
    p->n = cov->t_ch->k_trans.n; p->m = cov->t_ch->k_trans.m; p->a = cov->t_ch->k_trans.a; 
    p->idx.n = cov->t_ch->k_trans.idx.n; p->idx.m = cov->t_ch->k_trans.idx.m; p->idx.a = cov->t_ch->k_trans.idx.a;  
    cov->t_ch->k_trans.n = cov->t_ch->k_trans.m = 0; cov->t_ch->k_trans.a = NULL;
    cov->t_ch->k_trans.idx.n = cov->t_ch->k_trans.idx.m = 0; cov->t_ch->k_trans.idx.a = NULL;
    destory_hap_cov_t(&cov);
    return p;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa8, %rsp
movss %xmm2, 0x5c(%rsp)
movss %xmm1, 0x58(%rsp)
movss %xmm0, 0x54(%rsp)
movq %r9, 0x68(%rsp)
movq %r8, %r12
movq %rcx, 0x60(%rsp)
movq %rdx, %r13
movq %rsi, %rbp
movq %rdi, %r14
movl $0x1, %edi
movl $0x30, %esi
callq 0x2120
movq %rax, %rbx
xorps %xmm0, %xmm0
leaq 0x80(%rsp), %rax
movaps %xmm0, (%rax)
xorl %r15d, %r15d
movq %r15, 0x10(%rax)
movq %r12, %rdi
movq %r14, %rsi
movq %rbp, %rdx
movq %r13, %rcx
callq 0xd9f03
leaq 0x78(%rsp), %r13
movq %rax, (%r13)
movq 0x60(%rsp), %rdi
callq 0xc802c
movq %rax, %r12
leaq 0x70(%rsp), %r14
movq %r15, (%r14)
leaq 0x80(%rsp), %rax
movq %r15, (%rax)
movl %r15d, 0x40(%rsp)
movl %r15d, 0x38(%rsp)
movq 0x118(%rsp), %rcx
movq %rcx, 0x30(%rsp)
movq %r14, 0x28(%rsp)
movq %rax, 0x20(%rsp)
movq %rax, %r15
movl 0x110(%rsp), %eax
movl %eax, 0x18(%rsp)
movl 0x108(%rsp), %eax
movl %eax, 0x10(%rsp)
movups 0xf8(%rsp), %xmm0
movups %xmm0, (%rsp)
movq %r13, %rdi
movq %r12, %rsi
movq 0xe0(%rsp), %rdx
movq 0xe8(%rsp), %rcx
movq 0x68(%rsp), %r8
movq 0xf0(%rsp), %r9
movss 0x54(%rsp), %xmm1
movss 0x58(%rsp), %xmm2
movss 0x5c(%rsp), %xmm3
callq 0xc8339
movq (%r13), %rdi
callq 0xa0004
movq %r12, %rdi
callq 0x9fcdb
movq 0x10(%r15), %rdi
callq 0x2220
movq (%r14), %rax
movq 0xa8(%rax), %rax
movq 0x138(%rax), %rcx
movq %rcx, (%rbx)
movq 0x140(%rax), %rcx
movq %rcx, 0x8(%rbx)
movq 0x148(%rax), %rcx
movq %rcx, 0x10(%rbx)
movq 0x150(%rax), %rcx
movq %rcx, 0x18(%rbx)
movq 0x158(%rax), %rcx
movq %rcx, 0x20(%rbx)
movq 0x160(%rax), %rcx
movq %rcx, 0x28(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x158(%rax)
movups %xmm0, 0x148(%rax)
movups %xmm0, 0x138(%rax)
movq %r14, %rdi
callq 0xc8943
movq %rbx, %rax
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq