// File: /workspace/github_c_makefile_star2_O0/MaoKo[P]FGFX/fgfp/src/lr.c
// Function: closure_non_kernel_item
static void
closure_non_kernel_item(cfg_t const* cfg, kernel_t* kernel) {
	if (kernel->non_lr0_kernel_item)
		{ return; }

	bitset_t* prod_lst = new_bitset();
	UNION_BITSET(prod_lst, kernel->rprefix->prod_lst);

	bool add_prod;
	do {
		add_prod = false;
		int i;
		while ((i = IT_NEXT(prod_lst)) != IT_NULL) {
			production_t* prod = (production_t*)AT_VECTOR(cfg->productions, i);
			if (!RHS(prod))
				{ continue; }
			else if (IS_NON_TERMINAL(RHS(prod)->symbol_rhs)) {
				if (is_subset_bitset(prod_lst, RHS(prod)->symbol_rhs->prod_lst))
					{ continue; }
				UNION_BITSET(prod_lst, RHS(prod)->symbol_rhs->prod_lst);
				add_prod = true;
			}
		}
		IT_RESET(prod_lst);
	} while (add_prod);

	kernel->non_lr0_kernel_item = new_vector();
	int i;
	while ((i = IT_NEXT(prod_lst)) != IT_NULL) {
		production_t* prod = (production_t*)AT_VECTOR(cfg->productions, i);
		PUSH_BACK_VECTOR(kernel->non_lr0_kernel_item,
					new_lr0_item(prod, prod->rhs_element));
	}
	del_bitset(prod_lst);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x18(%rax)
je 0xaaa0
jmp 0xac16
callq 0x1290
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rsi
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq 0x30(%rax), %rdx
xorl %edi, %edi
callq 0x1890
movb $0x0, -0x19(%rbp)
movq -0x18(%rbp), %rdi
callq 0x1aa0
movl %eax, -0x20(%rbp)
cmpl $-0x1, %eax
je 0xab51
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq (%rax), %rax
movslq -0x20(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
cmpq $0x0, 0x10(%rax)
jne 0xaaf8
jmp 0xaac4
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rax
movq 0x8(%rax), %rax
cmpl $0x27, 0x8(%rax)
jne 0xab4a
movq -0x18(%rbp), %rdi
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rax
movq 0x8(%rax), %rax
movq 0x30(%rax), %rsi
callq 0x1c00
testb $0x1, %al
jne 0xab29
jmp 0xab2b
jmp 0xaac4
movq -0x18(%rbp), %rsi
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rax
movq 0x8(%rax), %rax
movq 0x30(%rax), %rdx
xorl %edi, %edi
callq 0x1890
movb $0x1, -0x19(%rbp)
jmp 0xab4c
jmp 0xaac4
cmpq $0x0, -0x18(%rbp)
jne 0xab5a
jmp 0xab8d
movq -0x18(%rbp), %rax
testb $0x1, 0x54(%rax)
jne 0xab76
movq -0x18(%rbp), %rax
movl $0x0, 0x50(%rax)
xorl %eax, %eax
movl %eax, -0x3c(%rbp)
jmp 0xab8a
movq -0x18(%rbp), %rax
movl 0x4(%rax), %eax
subl $0x1, %eax
movq -0x18(%rbp), %rcx
movl %eax, 0x50(%rcx)
movl %eax, -0x3c(%rbp)
movl -0x3c(%rbp), %eax
testb $0x1, -0x19(%rbp)
jne 0xaac0
callq 0x1ee0
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x18(%rax)
movq -0x18(%rbp), %rdi
callq 0x1aa0
movl %eax, -0x2c(%rbp)
cmpl $-0x1, %eax
je 0xac0d
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq (%rax), %rax
movslq -0x2c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x38(%rbp)
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x50(%rbp)
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movq 0x10(%rax), %rax
movq %rax, -0x48(%rbp)
movq -0x38(%rbp), %rdi
movq -0x38(%rbp), %rax
movq 0x10(%rax), %rsi
callq 0xa4f0
movq -0x50(%rbp), %rdi
movq -0x48(%rbp), %rsi
movq %rax, %rdx
callq 0x2070
jmp 0xaba7
movq -0x18(%rbp), %rdi
callq 0x1300
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax)