// File: /workspace/github_cpp_makefile_star2_O1/chhylp123[P]hifiasm/inter.cpp
// Function: init_ug_bin_t(ug_bin_t*, ug_opt_t const*, int, int, int, int, double, double, double, unsigned long, unsigned long, int, int, int, int, ma_ug_t*, asg_t*)
void init_ug_bin_t(ug_bin_t *sl, const ug_opt_t *uopt, int32_t is_HPC, int32_t k, int32_t w, int32_t max_n_chain, 
double bw_thres, double diff_ov, double diff_bin, uint64_t max_diff, uint64_t min_bin_len, int32_t n_thread, 
int32_t mini_cut, int32_t chain_cut, int32_t keep_unsymm_arc, ma_ug_t *ug, asg_t *sg)
{
    int64_t i; 
    memset(sl, 0, sizeof((*sl)));
	sl->uopt = uopt;
    sl->k = k; 
    sl->w = w;
    sl->is_HPC = is_HPC;
    sl->max_n_chain = max_n_chain;
    sl->bw_thres = bw_thres;
    sl->diff_ov = diff_ov;
	sl->diff_bin = diff_bin;
	sl->max_diff = max_diff;
	sl->min_bin_len = min_bin_len;
	sl->mini_cut = mini_cut;
	sl->chain_cut = chain_cut;
	sl->keep_unsymm_arc = keep_unsymm_arc;

    sl->bw = 10000;///2000 in minigraph
    sl->max_gap = 500000;///5000 in minigraph
    sl->ug = ug;
    sl->rg = sg;
    sl->n_thread = ((n_thread>=1)?n_thread:1);

	CALLOC(sl->mk, sl->n_thread);
    CALLOC(sl->hab, sl->n_thread); 
	CALLOC(sl->ll, sl->n_thread);
    for (i = 0; i < sl->n_thread; ++i) sl->hab[i] = ha_ovec_init(0, 0, 1); 

	sl->idx_n.n = sl->idx_n.m = ug->u.n+1;
	MALLOC(sl->idx_n.a, sl->idx_n.n);

	sl->udb.ug = ug;
	// CALLOC(sl->bm, sl->n_thread);
	// for (i = 0; i < sl->n_thread; ++i) {
	// 	sl->bm[i].n = ((sl->udb.ug->g->n_seq<<1)>>3) + (!!((sl->udb.ug->g->n_seq<<1)&((uint32_t)7)));
	// 	CALLOC(sl->bm[i].a, sl->bm[i].n);
	// }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movsd %xmm2, 0x10(%rsp)
movsd %xmm1, 0x8(%rsp)
movsd %xmm0, (%rsp)
movl %r9d, %ebp
movl %r8d, %r14d
movl %ecx, %r15d
movl %edx, %r12d
movq %rsi, %r13
movq %rdi, %rbx
movl $0x100, %edx            # imm = 0x100
xorl %esi, %esi
callq 0x20e0
movq %r13, (%rbx)
movl %r15d, 0x2c(%rbx)
movq 0x80(%rsp), %r15
movl %r14d, 0x28(%rbx)
movl %r12d, 0x98(%rbx)
movl %ebp, 0x58(%rbx)
movsd (%rsp), %xmm0
movsd %xmm0, 0x30(%rbx)
movsd 0x8(%rsp), %xmm0
movsd %xmm0, 0x38(%rbx)
movsd 0x10(%rsp), %xmm0
movsd %xmm0, 0x40(%rbx)
movq 0x50(%rsp), %rax
movq %rax, 0x50(%rbx)
movq 0x58(%rsp), %rax
movq %rax, 0x48(%rbx)
movl 0x68(%rsp), %eax
movl %eax, 0xb4(%rbx)
movl 0x70(%rsp), %eax
movl %eax, 0xb8(%rbx)
movl 0x78(%rsp), %eax
movl %eax, 0xbc(%rbx)
movabsq $0x7a12000002710, %rax  # imm = 0x7A12000002710
movq %rax, 0x9c(%rbx)
movq %r15, 0x8(%rbx)
movq 0x88(%rsp), %rax
movq %rax, 0x10(%rbx)
movl 0x60(%rsp), %eax
cmpl $0x2, %eax
movl $0x1, %r14d
cmovgel %eax, %r14d
movl %r14d, 0xa8(%rbx)
movl $0x30, %esi
movq %r14, %rdi
callq 0x2120
movq %rax, 0xf0(%rbx)
movl $0x8, %esi
movq %r14, %rdi
callq 0x2120
movq %rax, 0x18(%rbx)
movl $0x68, %esi
movq %r14, %rdi
callq 0x2120
movq %rax, 0x20(%rbx)
cmpl $0x0, 0xa8(%rbx)
jle 0x1e0c13
xorl %r14d, %r14d
xorl %edi, %edi
xorl %esi, %esi
movl $0x1, %edx
callq 0x39240
movq 0x18(%rbx), %rcx
movq %rax, (%rcx,%r14,8)
incq %r14
movslq 0xa8(%rbx), %rax
cmpq %rax, %r14
jl 0x1e0bee
movq (%r15), %rax
leaq 0x1(%rax), %rcx
movq %rcx, 0x78(%rbx)
movq %rcx, 0x70(%rbx)
leaq 0x8(,%rax,8), %rdi
callq 0x2280
movq %rax, 0x80(%rbx)
movq %r15, 0xc0(%rbx)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq