// File: chhylp123[P]hifiasm/Overlaps.cpp
// Function: get_hic_polyploid_trans_chain(ma_ug_t*, asg_t*, ma_sub_t*, ma_hit_t_alloc*, ma_hit_t_alloc*, int, int, R_to_U*, bub_label_t*)
trans_chain* get_hic_polyploid_trans_chain(ma_ug_t *ug, asg_t *sg, ma_sub_t* coverage_cut, ma_hit_t_alloc* sources, ma_hit_t_alloc* reverse_sources, 
int max_hang, int min_ovlp, R_to_U* ruIndex, bub_label_t* b_mask_t)
{
    uint32_t k;
    trans_chain* p = NULL; CALLOC(p, 1);
    p->r_num = sg->n_seq; p->u_num = ug->u.n;
    kv_malloc(p->bed, p->u_num); p->bed.n = p->u_num;
    for (k = 0; k < p->bed.n; k++) kv_init(p->bed.a[k]);
    CALLOC(p->ir_het, p->r_num);
    kv_u_trans_t *ta = get_utg_ovlp(&ug, sg, sources, reverse_sources, coverage_cut, ruIndex, max_hang, min_ovlp, NULL, b_mask_t, p->ir_het);
    p->k_trans = *ta; free(ta);
    return p;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x70, %rsp
movq 0x20(%rbp), %rax
movq 0x18(%rbp), %rax
movl 0x10(%rbp), %eax
movq %rdi, -0x18(%rbp)
movq %rsi, -0x20(%rbp)
movq %rdx, -0x28(%rbp)
movq %rcx, -0x30(%rbp)
movq %r8, -0x38(%rbp)
movl %r9d, -0x3c(%rbp)
movq $0x0, -0x48(%rbp)
movl $0x1, %edi
movl $0x1d0, %esi            # imm = 0x1D0
callq 0x2140
movq %rax, -0x48(%rbp)
movq -0x20(%rbp), %rax
movl 0x14(%rax), %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
movq -0x48(%rbp), %rax
movl %ecx, 0x18(%rax)
movq -0x18(%rbp), %rax
movq (%rax), %rax
movl %eax, %ecx
movq -0x48(%rbp), %rax
movl %ecx, 0x1c(%rax)
movq -0x48(%rbp), %rax
movq $0x0, 0x20(%rax)
movq -0x48(%rbp), %rax
movl 0x1c(%rax), %eax
movl %eax, %ecx
movq -0x48(%rbp), %rax
movq %rcx, 0x28(%rax)
movq -0x48(%rbp), %rax
movl 0x1c(%rax), %eax
imulq $0x18, %rax, %rdi
callq 0x2270
movq %rax, %rcx
movq -0x48(%rbp), %rax
movq %rcx, 0x30(%rax)
movq -0x48(%rbp), %rax
movl 0x1c(%rax), %eax
movl %eax, %ecx
movq -0x48(%rbp), %rax
movq %rcx, 0x20(%rax)
movl $0x0, -0x40(%rbp)
movl -0x40(%rbp), %eax
movq -0x48(%rbp), %rcx
cmpq 0x20(%rcx), %rax
jae 0x10ecd2
movq -0x48(%rbp), %rax
movq 0x30(%rax), %rax
movl -0x40(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq $0x0, 0x8(%rax)
movq -0x48(%rbp), %rax
movq 0x30(%rax), %rax
movl -0x40(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq $0x0, (%rax)
movq -0x48(%rbp), %rax
movq 0x30(%rax), %rax
movl -0x40(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq $0x0, 0x10(%rax)
movl -0x40(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x40(%rbp)
jmp 0x10ec6d
movq -0x48(%rbp), %rax
movl 0x18(%rax), %eax
movl %eax, %edi
movl $0x1, %esi
callq 0x2140
movq %rax, %rcx
movq -0x48(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x20(%rbp), %rsi
movq -0x30(%rbp), %rdx
movq -0x38(%rbp), %rcx
movq -0x28(%rbp), %r8
movq 0x18(%rbp), %r9
movl -0x3c(%rbp), %ebx
movl 0x10(%rbp), %r11d
movq 0x20(%rbp), %r10
movq -0x48(%rbp), %rax
movq 0x10(%rax), %rax
leaq -0x18(%rbp), %rdi
xorl %r14d, %r14d
movl %ebx, (%rsp)
movl %r11d, 0x8(%rsp)
movq $0x0, 0x10(%rsp)
movq %r10, 0x18(%rsp)
movq %rax, 0x20(%rsp)
callq 0x10ed80
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rsi
movq -0x48(%rbp), %rdi
addq $0x138, %rdi            # imm = 0x138
movl $0x30, %edx
callq 0x2180
movq -0x50(%rbp), %rdi
callq 0x2210
movq -0x48(%rbp), %rax
addq $0x70, %rsp
popq %rbx
popq %r14
popq %rbp
retq
nopw %cs:(%rax,%rax)