// File: 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
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xc8, %rsp
movq 0x48(%rbp), %rax
movl 0x40(%rbp), %eax
movl 0x38(%rbp), %eax
movq 0x30(%rbp), %rax
movq 0x28(%rbp), %rax
movq 0x20(%rbp), %rax
movq 0x18(%rbp), %rax
movq 0x10(%rbp), %rax
movq %rdi, -0x30(%rbp)
movq %rsi, -0x38(%rbp)
movq %rdx, -0x40(%rbp)
movq %rcx, -0x48(%rbp)
movq %r8, -0x50(%rbp)
movq %r9, -0x58(%rbp)
movss %xmm0, -0x5c(%rbp)
movss %xmm1, -0x60(%rbp)
movss %xmm2, -0x64(%rbp)
movq $0x0, -0x80(%rbp)
movq $0x0, -0x88(%rbp)
movq $0x0, -0x78(%rbp)
movq $0x0, -0x90(%rbp)
movl $0x1, %edi
movl $0x30, %esi
callq 0x2140
movq %rax, -0x90(%rbp)
movq -0x50(%rbp), %rdi
movq -0x30(%rbp), %rsi
movq -0x38(%rbp), %rdx
movq -0x40(%rbp), %rcx
callq 0x127380
movq %rax, -0x98(%rbp)
movq -0x48(%rbp), %rdi
callq 0x10b830
movq %rax, -0xa0(%rbp)
movq $0x0, -0xa8(%rbp)
movq $0x0, -0x88(%rbp)
movq -0xa0(%rbp), %rsi
movq 0x10(%rbp), %rdx
movq 0x18(%rbp), %rcx
movq -0x58(%rbp), %r8
movq 0x20(%rbp), %r9
movss -0x5c(%rbp), %xmm1
movq 0x28(%rbp), %r12
movq 0x30(%rbp), %r15
movss -0x60(%rbp), %xmm2
movss -0x64(%rbp), %xmm3
movl 0x38(%rbp), %r14d
movl 0x40(%rbp), %ebx
movq 0x48(%rbp), %rax
leaq -0x98(%rbp), %rdi
movss 0x25761d(%rip), %xmm0   # 0x38689c
leaq -0x88(%rbp), %r11
leaq -0xa8(%rbp), %r10
xorl %r13d, %r13d
movq %r12, (%rsp)
movq %r15, 0x8(%rsp)
movl %r14d, 0x10(%rsp)
movl %ebx, 0x18(%rsp)
movq %r11, 0x20(%rsp)
movq %r10, 0x28(%rsp)
movq %rax, 0x30(%rsp)
movl $0x0, 0x38(%rsp)
movl $0x0, 0x40(%rsp)
callq 0x10bde0
movq -0x98(%rbp), %rdi
callq 0xcd6f0
movq -0xa0(%rbp), %rdi
callq 0xcd170
movq -0x78(%rbp), %rdi
callq 0x2210
movq -0xa8(%rbp), %rax
movq 0xa8(%rax), %rax
movq 0x138(%rax), %rcx
movq -0x90(%rbp), %rax
movq %rcx, (%rax)
movq -0xa8(%rbp), %rax
movq 0xa8(%rax), %rax
movq 0x140(%rax), %rcx
movq -0x90(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0xa8(%rbp), %rax
movq 0xa8(%rax), %rax
movq 0x148(%rax), %rcx
movq -0x90(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0xa8(%rbp), %rax
movq 0xa8(%rax), %rax
movq 0x150(%rax), %rcx
movq -0x90(%rbp), %rax
movq %rcx, 0x18(%rax)
movq -0xa8(%rbp), %rax
movq 0xa8(%rax), %rax
movq 0x158(%rax), %rcx
movq -0x90(%rbp), %rax
movq %rcx, 0x20(%rax)
movq -0xa8(%rbp), %rax
movq 0xa8(%rax), %rax
movq 0x160(%rax), %rcx
movq -0x90(%rbp), %rax
movq %rcx, 0x28(%rax)
movq -0xa8(%rbp), %rax
movq 0xa8(%rax), %rax
movq $0x0, 0x140(%rax)
movq -0xa8(%rbp), %rax
movq 0xa8(%rax), %rax
movq $0x0, 0x138(%rax)
movq -0xa8(%rbp), %rax
movq 0xa8(%rax), %rax
movq $0x0, 0x148(%rax)
movq -0xa8(%rbp), %rax
movq 0xa8(%rax), %rax
movq $0x0, 0x158(%rax)
movq -0xa8(%rbp), %rax
movq 0xa8(%rax), %rax
movq $0x0, 0x150(%rax)
movq -0xa8(%rbp), %rax
movq 0xa8(%rax), %rax
movq $0x0, 0x160(%rax)
leaq -0xa8(%rbp), %rdi
callq 0x10c960
movq -0x90(%rbp), %rax
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nopw %cs:(%rax,%rax)