// File: chhylp123[P]hifiasm/rcut.cpp
// Function: mc_svaux_init(mc_g_t const*, unsigned long)
mc_svaux_t *mc_svaux_init(const mc_g_t *mg, uint64_t x)
{
	uint32_t st, i, max_cc = 0;
	mc_match_t *ma = mg->e;
	mc_svaux_t *b;
	CALLOC(b, 1);
	b->x = x;
	for (st = 0, i = 1; i <= ma->n_seq; ++i)
		if (i == ma->n_seq || ma->cc[st]>>32 != ma->cc[i]>>32)
			max_cc = max_cc > i - st? max_cc : i - st, st = i;
	kv_init(b->cc_edge);
	MALLOC(b->cc_node, max_cc);
	///CALLOC(b->s, ma->n_seq);
	b->s = mg->s.a;
	CALLOC(b->s_opt, ma->n_seq);
	MALLOC(b->bfs, ma->n_seq);

	MALLOC(b->bfs_mark, ma->n_seq); 
	memset(b->bfs_mark, -1, ma->n_seq*sizeof(uint32_t));
	
	CALLOC(b->z, ma->n_seq);
	CALLOC(b->z_opt, ma->n_seq);
	CALLOC(b->f, ma->n_seq);
	return b;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl $0x0, -0x1c(%rbp)
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rax
movq %rax, -0x28(%rbp)
movl $0x1, %edi
movl $0x68, %esi
callq 0x2140
movq %rax, -0x30(%rbp)
movq -0x10(%rbp), %rcx
movq -0x30(%rbp), %rax
movq %rcx, (%rax)
movl $0x0, -0x14(%rbp)
movl $0x1, -0x18(%rbp)
movl -0x18(%rbp), %eax
movq -0x28(%rbp), %rcx
cmpl 0x38(%rcx), %eax
ja 0x21baf9
movl -0x18(%rbp), %eax
movq -0x28(%rbp), %rcx
cmpl 0x38(%rcx), %eax
je 0x21bac2
movq -0x28(%rbp), %rax
movq 0x30(%rax), %rax
movl -0x14(%rbp), %ecx
movq (%rax,%rcx,8), %rax
shrq $0x20, %rax
movq -0x28(%rbp), %rcx
movq 0x30(%rcx), %rcx
movl -0x18(%rbp), %edx
movq (%rcx,%rdx,8), %rcx
shrq $0x20, %rcx
cmpq %rcx, %rax
je 0x21baec
movl -0x1c(%rbp), %eax
movl -0x18(%rbp), %ecx
subl -0x14(%rbp), %ecx
cmpl %ecx, %eax
jbe 0x21bad7
movl -0x1c(%rbp), %eax
movl %eax, -0x34(%rbp)
jmp 0x21bae0
movl -0x18(%rbp), %eax
subl -0x14(%rbp), %eax
movl %eax, -0x34(%rbp)
movl -0x34(%rbp), %eax
movl %eax, -0x1c(%rbp)
movl -0x18(%rbp), %eax
movl %eax, -0x14(%rbp)
jmp 0x21baee
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x21ba7f
movq -0x30(%rbp), %rax
movq $0x0, 0x18(%rax)
movq -0x30(%rbp), %rax
movq $0x0, 0x10(%rax)
movq -0x30(%rbp), %rax
movq $0x0, 0x20(%rax)
movl -0x1c(%rbp), %eax
movl %eax, %edi
shlq $0x2, %rdi
callq 0x2270
movq %rax, %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x28(%rax)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x50(%rax)
movq -0x28(%rbp), %rax
movl 0x38(%rax), %eax
movl %eax, %edi
movl $0x1, %esi
callq 0x2140
movq %rax, %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x58(%rax)
movq -0x28(%rbp), %rax
movl 0x38(%rax), %eax
movl %eax, %edi
shlq $0x2, %rdi
callq 0x2270
movq %rax, %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x30(%rax)
movq -0x28(%rbp), %rax
movl 0x38(%rax), %eax
movl %eax, %edi
shlq $0x2, %rdi
callq 0x2270
movq %rax, %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x38(%rax)
movq -0x30(%rbp), %rax
movq 0x38(%rax), %rdi
movq -0x28(%rbp), %rax
movl 0x38(%rax), %eax
movl %eax, %edx
shlq $0x2, %rdx
movl $0xff, %esi
callq 0x2100
movq -0x28(%rbp), %rax
movl 0x38(%rax), %eax
movl %eax, %edi
movl $0x10, %esi
callq 0x2140
movq %rax, %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x40(%rax)
movq -0x28(%rbp), %rax
movl 0x38(%rax), %eax
movl %eax, %edi
movl $0x10, %esi
callq 0x2140
movq %rax, %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x48(%rax)
movq -0x28(%rbp), %rax
movl 0x38(%rax), %eax
movl %eax, %edi
movl $0x1, %esi
callq 0x2140
movq %rax, %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x60(%rax)
movq -0x30(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)