// File: chhylp123[P]hifiasm/rcut.cpp
// Function: init_mc_clus_t(mc_opt_t const*, mc_g_t*, bubble_type*, unsigned int, mc_svaux_t*, unsigned int)
mc_clus_t *init_mc_clus_t(const mc_opt_t *opt, mc_g_t *mg, bubble_type* bub, uint32_t n_thread, mc_svaux_t *b, uint32_t flp_max)
{
	if((!bub)) return NULL;
	mc_clus_t *p; CALLOC(p, 1); 
	p->bub = bub; p->opt = opt; p->mg = mg; p->n = bub->ug->g->n_seq;
	CALLOC(p->lock, p->n);
	if(n_thread > 64) n_thread = 64; p->n_thread = n_thread;
	CALLOC(p->aux, p->n_thread);
	uint32_t k, ss = (p->n>>3)+(!!(p->n&7));
	for (k = 0; k < p->n_thread; k++) {
		kv_resize(uint8_t, p->aux[k].vis, ss); p->aux[k].vis.n = ss;
	}
	p->baux = b; p->lock_max = ((flp_max<=255)?flp_max:255); if(p->lock_max < 1) p->lock_max = 1;
	return p;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movl %ecx, -0x24(%rbp)
movq %r8, -0x30(%rbp)
movl %r9d, -0x34(%rbp)
cmpq $0x0, -0x20(%rbp)
jne 0x225773
movq $0x0, -0x8(%rbp)
jmp 0x225aa1
movl $0x1, %edi
movl $0x80, %esi
callq 0x2140
movq %rax, -0x40(%rbp)
movq -0x20(%rbp), %rcx
movq -0x40(%rbp), %rax
movq %rcx, 0x30(%rax)
movq -0x10(%rbp), %rcx
movq -0x40(%rbp), %rax
movq %rcx, 0x38(%rax)
movq -0x18(%rbp), %rcx
movq -0x40(%rbp), %rax
movq %rcx, 0x40(%rax)
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rax
movq 0x18(%rax), %rax
movl 0x14(%rax), %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
movq -0x40(%rbp), %rax
movl %ecx, 0x54(%rax)
movq -0x40(%rbp), %rax
movl 0x54(%rax), %eax
movl %eax, %edi
movl $0x1, %esi
callq 0x2140
movq %rax, %rcx
movq -0x40(%rbp), %rax
movq %rcx, 0x48(%rax)
cmpl $0x40, -0x24(%rbp)
jbe 0x2257f1
movl $0x40, -0x24(%rbp)
movl -0x24(%rbp), %ecx
movq -0x40(%rbp), %rax
movl %ecx, 0x58(%rax)
movq -0x40(%rbp), %rax
movl 0x58(%rax), %eax
movl %eax, %edi
movl $0x28, %esi
callq 0x2140
movq %rax, %rcx
movq -0x40(%rbp), %rax
movq %rcx, 0x60(%rax)
movq -0x40(%rbp), %rax
movl 0x54(%rax), %eax
shrl $0x3, %eax
movq -0x40(%rbp), %rcx
movl 0x54(%rcx), %ecx
andl $0x7, %ecx
cmpl $0x0, %ecx
setne %cl
xorb $-0x1, %cl
xorb $-0x1, %cl
andb $0x1, %cl
movzbl %cl, %ecx
addl %ecx, %eax
movl %eax, -0x48(%rbp)
movl $0x0, -0x44(%rbp)
movl -0x44(%rbp), %eax
movq -0x40(%rbp), %rcx
cmpl 0x58(%rcx), %eax
jae 0x225a51
jmp 0x22585d
movq -0x40(%rbp), %rax
movq 0x60(%rax), %rax
movl -0x44(%rbp), %ecx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
movl -0x48(%rbp), %ecx
cmpq %rcx, %rax
jae 0x225a27
movl -0x48(%rbp), %eax
movl %eax, %ecx
movq -0x40(%rbp), %rax
movq 0x60(%rax), %rax
movl -0x44(%rbp), %edx
imulq $0x28, %rdx, %rdx
addq %rdx, %rax
movq %rcx, 0x8(%rax)
movq -0x40(%rbp), %rax
movq 0x60(%rax), %rax
movl -0x44(%rbp), %ecx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rcx
addq $-0x1, %rcx
movq %rcx, 0x8(%rax)
movq -0x40(%rbp), %rax
movq 0x60(%rax), %rax
movl -0x44(%rbp), %ecx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rcx
shrq %rcx
movq -0x40(%rbp), %rax
movq 0x60(%rax), %rax
movl -0x44(%rbp), %edx
imulq $0x28, %rdx, %rdx
addq %rdx, %rax
orq 0x8(%rax), %rcx
movq %rcx, 0x8(%rax)
movq -0x40(%rbp), %rax
movq 0x60(%rax), %rax
movl -0x44(%rbp), %ecx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rcx
shrq $0x2, %rcx
movq -0x40(%rbp), %rax
movq 0x60(%rax), %rax
movl -0x44(%rbp), %edx
imulq $0x28, %rdx, %rdx
addq %rdx, %rax
orq 0x8(%rax), %rcx
movq %rcx, 0x8(%rax)
movq -0x40(%rbp), %rax
movq 0x60(%rax), %rax
movl -0x44(%rbp), %ecx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rcx
shrq $0x4, %rcx
movq -0x40(%rbp), %rax
movq 0x60(%rax), %rax
movl -0x44(%rbp), %edx
imulq $0x28, %rdx, %rdx
addq %rdx, %rax
orq 0x8(%rax), %rcx
movq %rcx, 0x8(%rax)
movq -0x40(%rbp), %rax
movq 0x60(%rax), %rax
movl -0x44(%rbp), %ecx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rcx
shrq $0x8, %rcx
movq -0x40(%rbp), %rax
movq 0x60(%rax), %rax
movl -0x44(%rbp), %edx
imulq $0x28, %rdx, %rdx
addq %rdx, %rax
orq 0x8(%rax), %rcx
movq %rcx, 0x8(%rax)
movq -0x40(%rbp), %rax
movq 0x60(%rax), %rax
movl -0x44(%rbp), %ecx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rcx
shrq $0x10, %rcx
movq -0x40(%rbp), %rax
movq 0x60(%rax), %rax
movl -0x44(%rbp), %edx
imulq $0x28, %rdx, %rdx
addq %rdx, %rax
orq 0x8(%rax), %rcx
movq %rcx, 0x8(%rax)
movq -0x40(%rbp), %rax
movq 0x60(%rax), %rax
movl -0x44(%rbp), %ecx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0x8(%rax)
movq -0x40(%rbp), %rax
movq 0x60(%rax), %rax
movl -0x44(%rbp), %ecx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq 0x10(%rax), %rdi
movq -0x40(%rbp), %rax
movq 0x60(%rax), %rax
movl -0x44(%rbp), %ecx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rsi
shlq $0x0, %rsi
callq 0x2360
movq %rax, %rcx
movq -0x40(%rbp), %rax
movq 0x60(%rax), %rax
movl -0x44(%rbp), %edx
imulq $0x28, %rdx, %rdx
addq %rdx, %rax
movq %rcx, 0x10(%rax)
jmp 0x225a29
movl -0x48(%rbp), %eax
movl %eax, %ecx
movq -0x40(%rbp), %rax
movq 0x60(%rax), %rax
movl -0x44(%rbp), %edx
imulq $0x28, %rdx, %rdx
addq %rdx, %rax
movq %rcx, (%rax)
movl -0x44(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x44(%rbp)
jmp 0x22584b
movq -0x30(%rbp), %rcx
movq -0x40(%rbp), %rax
movq %rcx, 0x68(%rax)
cmpl $0xff, -0x34(%rbp)
ja 0x225a6e
movl -0x34(%rbp), %eax
movl %eax, -0x4c(%rbp)
jmp 0x225a78
movl $0xff, %eax
movl %eax, -0x4c(%rbp)
jmp 0x225a78
movl -0x4c(%rbp), %eax
movb %al, %cl
movq -0x40(%rbp), %rax
movb %cl, 0x50(%rax)
movq -0x40(%rbp), %rax
movzbl 0x50(%rax), %eax
cmpl $0x1, %eax
jge 0x225a99
movq -0x40(%rbp), %rax
movb $0x1, 0x50(%rax)
movq -0x40(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax,%rax)