// File: /workspace/github_c_makefile_star2_O1/MaoKo[P]FGFX/fgfp/src/lr.c
// Function: closure
bitset_t*
closure(cfg_t const* cfg, bitset_t* item_set) {
	if (!cfg || !item_set)
		{ return (NULL_BITSET); }

	vector_t* list_kernel = split_same_derivation(item_set);
	bool is_kernel_disjoint = true;

	size_t size_kernel;
	if ((size_kernel = SIZE_VECTOR(list_kernel))) {
		for (size_t i = 0; i < size_kernel - 1; ++i) {
			kernel_t* crt_kernel = (kernel_t*)AT_VECTOR(list_kernel, i);
			kernel_t* next_kernel = (kernel_t*)AT_VECTOR(list_kernel, i + 1);

			if (!is_disjoint_bitset(crt_kernel->rprefix->first,
								next_kernel->rprefix->first)) {
				is_kernel_disjoint = false;
				break;	
			}
		}

		for (size_t i = 0; i < size_kernel; ++i) {
			kernel_t* crt_kernel = (kernel_t*)AT_VECTOR(list_kernel, i);
			UNION_BITSET(item_set, include_new_item(cfg, crt_kernel));
		}
	}
	
	if (!is_kernel_disjoint)
		{ merge_same_lr0_item(item_set);  }

	del_vector(list_kernel);
	return (item_set);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
testq %rdi, %rdi
sete %al
testq %rsi, %rsi
sete %cl
orb %al, %cl
jne 0x73dd
movq %rsi, %r12
movq %rdi, -0x60(%rbp)
callq 0x243c
movq %rax, %r14
callq 0x2afc
movq %rax, %r15
movq %r12, %rdi
callq 0x28eb
cmpl $-0x1, %eax
movq %r12, -0x30(%rbp)
movq %r15, -0x50(%rbp)
je 0x6f16
movq %r14, -0x48(%rbp)
movq 0x161ae(%rip), %rcx     # 0x1cea0
movq (%rcx), %rcx
cltq
movq (%rcx,%rax,8), %rax
movq 0x8(%rax), %rax
cmpb $0x0, 0x10(%rax)
jne 0x6f05
movq 0x8(%rax), %rax
movq 0x8(%rax), %rbx
cmpl $0x27, 0x8(%rbx)
jne 0x6f05
testq %r14, %r14
je 0x6d45
movq (%rbx), %rax
movl 0x4(%r14), %ecx
cmpq %rcx, %rax
jae 0x6d45
movq 0x8(%r14), %rcx
movq %rax, %rdx
shrq $0x6, %rdx
movq (%rcx,%rdx,8), %rcx
btq %rax, %rcx
jb 0x6f05
movq (%rbx), %rcx
movl 0x4(%r14), %eax
cmpq %rax, %rcx
jae 0x6d67
movl $0x1, %eax
shlq %cl, %rax
movq 0x8(%r14), %rdx
shrq $0x6, %rcx
orq %rax, (%rdx,%rcx,8)
jmp 0x6d72
movq %r14, %rdi
movq %rcx, %rsi
callq 0x2568
movl 0x50(%r12), %r14d
xorl %eax, %eax
cmpb $0x1, 0x54(%r12)
jne 0x6d88
movl 0x4(%r12), %eax
decl %eax
movl %eax, 0x50(%r12)
callq 0x243c
movq %rax, %r13
movq %r12, %rdi
callq 0x28eb
cmpl $-0x1, %eax
je 0x6df3
movq 0x160f7(%rip), %rcx     # 0x1cea0
movq (%rcx), %rdx
movslq %eax, %rcx
movq (%rdx,%rcx,8), %rax
movq 0x8(%rax), %rax
cmpb $0x0, 0x10(%rax)
jne 0x6d95
movq 0x8(%rax), %rax
cmpq %rbx, 0x8(%rax)
jne 0x6d95
movl 0x4(%r13), %eax
cmpq %rax, %rcx
jae 0x6de6
movl $0x1, %eax
shlq %cl, %rax
movq 0x8(%r13), %rdx
shrq $0x6, %rcx
orq %rax, (%rdx,%rcx,8)
jmp 0x6d95
movq %r13, %rdi
movq %rcx, %rsi
callq 0x2568
jmp 0x6d95
movl %r14d, 0x50(%r12)
movq %r13, %rdi
callq 0x78a0
testq %r13, %r13
je 0x6ee7
movq %rax, %r14
leaq 0x1622d(%rip), %r15     # 0x1d040
movq (%r15,%rax,8), %rdi
testq %rdi, %rdi
je 0x6e78
movq %r13, %rsi
leaq 0x14a7(%rip), %rdx      # 0x82cd
callq 0x2d0a
cmpl $-0x1, %eax
je 0x6e86
movq (%r15,%r14,8), %rdi
movq (%rdi), %rcx
cltq
movq (%rcx,%rax,8), %r15
movq %r13, %rsi
leaq 0x1493(%rip), %rdx      # 0x82da
callq 0x2d0a
movl %eax, %r12d
cmpl $-0x1, %eax
sete %al
je 0x6e8b
movq %r13, %rdi
callq 0x248a
leaq 0x161da(%rip), %rax     # 0x1d040
movq (%rax,%r14,8), %rax
movq (%rax), %rax
movslq %r12d, %rcx
movq (%rax,%rcx,8), %r12
xorl %eax, %eax
jmp 0x6e8b
callq 0x2afc
movq %rax, (%r15,%r14,8)
xorl %r15d, %r15d
jmp 0x6e8f
movb $0x1, %al
xorl %r15d, %r15d
testb %al, %al
je 0x6eea
movl $0x28, %edi
callq 0x3b0a
testq %rax, %rax
je 0x6ee7
movq %rax, %r12
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movups %xmm0, 0x10(%rax)
movq $0x0, 0x20(%rax)
movq %r13, (%rax)
movq %rbx, 0x8(%rax)
testq %r15, %r15
je 0x6ece
movq 0x18(%r15), %rax
movq %rax, 0x18(%r12)
movb $0x1, 0x10(%r12)
leaq 0x1616b(%rip), %rax     # 0x1d040
movq (%rax,%r14,8), %rdi
movq 0x10(%rdi), %rsi
movq %r12, %rdx
callq 0x2bf1
jmp 0x6eea
xorl %r12d, %r12d
movq -0x50(%rbp), %r15
movq 0x10(%r15), %rsi
movq %r15, %rdi
movq %r12, %rdx
callq 0x2bf1
movq -0x30(%rbp), %r12
movq -0x48(%rbp), %r14
movq %r12, %rdi
callq 0x28eb
cmpl $-0x1, %eax
jne 0x6ceb
xorl %eax, %eax
cmpb $0x1, 0x54(%r12)
jne 0x6f27
movl 0x4(%r12), %eax
decl %eax
movl %eax, 0x50(%r12)
movq %r14, %rdi
callq 0x248a
movq 0x10(%r15), %rax
testq %rax, %rax
je 0x73fc
movq %rax, %r13
movb $0x1, %al
movl %eax, -0x34(%rbp)
movl $0x1, %ebx
xorl %r14d, %r14d
cmpq %rbx, %r13
je 0x6f8b
movq (%r15), %rax
movq -0x8(%rax,%rbx,8), %rcx
movq (%rax,%rbx,8), %rax
movq 0x8(%rcx), %rcx
movq 0x20(%rcx), %rdi
movq 0x8(%rax), %rax
movq 0x20(%rax), %rsi
callq 0x2a05
movl -0x34(%rbp), %ecx
movzbl %cl, %ecx
incq %rbx
testb %al, %al
cmovel %r14d, %ecx
movl %ecx, -0x34(%rbp)
jne 0x6f51
cmpq $0x1, %r13
adcq $0x0, %r13
movq %r13, -0x70(%rbp)
xorl %ebx, %ebx
movq (%r15), %rax
movq (%rax,%rbx,8), %r13
movq 0x20(%r13), %rdx
testq %rdx, %rdx
jne 0x7291
movq %rbx, -0x58(%rbp)
cmpq $0x0, 0x18(%r13)
movq -0x60(%rbp), %r15
jne 0x70a5
callq 0x243c
movq %rax, %r12
movq 0x8(%r13), %rax
movq 0x30(%rax), %rdx
xorl %edi, %edi
movq %r12, %rsi
callq 0x27c9
movq %r12, %rdi
callq 0x28eb
xorl %ebx, %ebx
cmpl $-0x1, %eax
je 0x703a
movq (%r15), %rcx
movq (%rcx), %rcx
cltq
movq (%rcx,%rax,8), %r14
movq 0x10(%r14), %rax
testq %rax, %rax
je 0x7030
movq 0x8(%rax), %rax
cmpl $0x27, 0x8(%rax)
jne 0x7030
movq 0x30(%rax), %rsi
movq %r12, %rdi
callq 0x298e
testb %al, %al
jne 0x7030
movq 0x10(%r14), %rax
movq 0x8(%rax), %rax
movq 0x30(%rax), %rdx
xorl %edi, %edi
movq %r12, %rsi
callq 0x27c9
movb $0x1, %bl
movq %r12, %rdi
callq 0x28eb
jmp 0x6fe4
testq %r12, %r12
je 0x7055
xorl %eax, %eax
cmpb $0x1, 0x54(%r12)
jne 0x7050
movl 0x4(%r12), %eax
decl %eax
movl %eax, 0x50(%r12)
testb $0x1, %bl
jne 0x6fda
callq 0x2afc
movq %rax, 0x18(%r13)
movq %r12, %rdi
callq 0x28eb
cmpl $-0x1, %eax
je 0x709d
movq (%r15), %rcx
movq (%rcx), %rcx
cltq
movq (%rcx,%rax,8), %rdi
movq 0x18(%r13), %rbx
movq 0x10(%rbx), %r14
movq 0x10(%rdi), %rsi
callq 0x814c
movq %rbx, %rdi
movq %r14, %rsi
movq %rax, %rdx
callq 0x2bf1
jmp 0x7063
movq %r12, %rdi
callq 0x248a
callq 0x2afc
movq %rax, %rdi
movq 0x18(%r13), %rax
movq 0x10(%rax), %rsi
movq %rdi, -0x40(%rbp)
leaq -0x4c84(%rip), %rdx     # 0x243c
callq 0x2db3
callq 0x243c
movq %rax, %r14
movq (%r13), %rdi
callq 0x28eb
cmpl $-0x1, %eax
je 0x7112
movq 0x15dbe(%rip), %rcx     # 0x1cea0
movq (%rcx), %rcx
cltq
movq (%rcx,%rax,8), %rax
movq 0x8(%rax), %rdi
movq 0x10(%rax), %rsi
callq 0x82ed
movq %rax, %rbx
xorl %edi, %edi
movq %r14, %rsi
movq %rax, %rdx
callq 0x27c9
movq %rbx, %rdi
callq 0x248a
jmp 0x70cd
movq (%r13), %rax
testq %rax, %rax
je 0x712b
xorl %ecx, %ecx
cmpb $0x1, 0x54(%rax)
jne 0x7128
movl 0x4(%rax), %ecx
decl %ecx
movl %ecx, 0x50(%rax)
movq 0x8(%r13), %rdx
movq %r13, %rdi
movq -0x40(%rbp), %rsi
movq %r14, -0x68(%rbp)
movq %r14, %rcx
callq 0x834e
movq 0x18(%r13), %rax
cmpq $0x0, 0x10(%rax)
je 0x71d3
xorl %r15d, %r15d
xorl %r12d, %r12d
movq (%rax), %rax
movq (%rax,%r12,8), %rdi
cmpb $0x0, 0x10(%rdi)
jne 0x71bc
movq 0x8(%rdi), %rax
movq 0x8(%rax), %rbx
cmpl $0x27, 0x8(%rbx)
jne 0x71bc
movq %r15, -0x48(%rbp)
movq %r13, %r15
movq -0x40(%rbp), %r13
movq (%r13), %rax
movq (%rax,%r12,8), %rsi
callq 0x82ed
movq %rax, %r14
movq %r15, %rdi
movq %r13, %rsi
movq %r15, %r13
movq -0x48(%rbp), %r15
movq %rbx, %rdx
movq %rax, %rcx
callq 0x834e
movzbl %r15b, %r15d
testb %al, %al
movl $0x1, %eax
cmovnel %eax, %r15d
movq %r14, %rdi
callq 0x248a
incq %r12
movq 0x18(%r13), %rax
cmpq 0x10(%rax), %r12
jb 0x7157
testb $0x1, %r15b
jne 0x7142
movq -0x68(%rbp), %rdi
callq 0x248a
callq 0x243c
movq %rax, 0x20(%r13)
movq (%r13), %rdx
xorl %edi, %edi
movq %rax, %rsi
callq 0x27c9
movq 0x18(%r13), %rax
cmpq $0x0, 0x10(%rax)
movq -0x30(%rbp), %r12
movq -0x50(%rbp), %r15
je 0x726a
xorl %ebx, %ebx
movq -0x40(%rbp), %rcx
movq (%rcx), %rcx
movq (%rcx,%rbx,8), %rsi
movq (%rax), %rax
movq (%rax,%rbx,8), %rdi
callq 0x825f
testq %rax, %rax
je 0x728b
movq %rax, %rdi
callq 0x6a23
cmpl $-0x1, %eax
je 0x725d
movslq %eax, %rsi
movq 0x20(%r13), %rdi
movl 0x4(%rdi), %ecx
cmpq %rcx, %rsi
jae 0x7258
movl $0x1, %edx
movl %eax, %ecx
shlq %cl, %rdx
movq 0x8(%rdi), %rax
shrq $0x6, %rsi
orq %rdx, (%rax,%rsi,8)
jmp 0x725d
callq 0x2568
incq %rbx
movq 0x18(%r13), %rax
cmpq 0x10(%rax), %rbx
jb 0x7208
movq -0x40(%rbp), %rbx
movq %rbx, %rdi
leaq -0x4dee(%rip), %rsi     # 0x248a
callq 0x2d75
movq %rbx, %rdi
callq 0x2b9e
movq 0x20(%r13), %rdx
jmp 0x728d
xorl %edx, %edx
movq -0x58(%rbp), %rbx
xorl %edi, %edi
movq %r12, %rsi
callq 0x27c9
incq %rbx
cmpq -0x70(%rbp), %rbx
jne 0x6f99
testb $0x1, -0x34(%rbp)
jne 0x73fc
movq %r12, %rdi
callq 0x28eb
cmpl $-0x1, %eax
je 0x73e2
movq 0x15bd6(%rip), %rcx     # 0x1cea0
movq (%rcx), %rcx
movslq %eax, %r14
movq (%rcx,%r14,8), %r15
movl 0x50(%r12), %eax
movl %eax, -0x40(%rbp)
movq %r12, %rdi
callq 0x28eb
cmpl $-0x1, %eax
je 0x73cc
movq $-0x2, %rdx
movl %r14d, %ecx
rolq %cl, %rdx
movq %rdx, -0x48(%rbp)
movq %r14, %rbx
shrq $0x6, %rbx
movq 0x15b94(%rip), %rcx     # 0x1cea0
movq (%rcx), %rcx
movslq %eax, %r12
movq (%rcx,%r12,8), %rsi
movq 0x8(%r15), %rax
movq 0x8(%rsi), %rcx
movq (%rax), %rdx
cmpq (%rcx), %rdx
je 0x732b
xorl %r13d, %r13d
jmp 0x7337
movq 0x8(%rax), %rax
cmpq 0x8(%rcx), %rax
sete %r13b
testb %r13b, %r13b
je 0x73ba
movq %r15, %rdi
callq 0x6bf4
movq -0x30(%rbp), %rcx
movl 0x4(%rcx), %edx
cmpq %rdx, %r14
jae 0x7360
movq -0x30(%rbp), %rcx
movq 0x8(%rcx), %rcx
movq -0x48(%rbp), %rsi
andq %rsi, (%rcx,%rbx,8)
cmpq %rdx, %r12
jae 0x7382
movq $-0x2, %rsi
movl %r12d, %ecx
rolq %cl, %rsi
movq -0x30(%rbp), %rcx
movq 0x8(%rcx), %rcx
shrq $0x6, %r12
andq %rsi, (%rcx,%r12,8)
cmpl $-0x1, %eax
je 0x73b5
movslq %eax, %rcx
cmpq %rdx, %rcx
jae 0x73a9
movl $0x1, %eax
shlq %cl, %rax
movq -0x30(%rbp), %rdx
movq 0x8(%rdx), %rdx
shrq $0x6, %rcx
orq %rax, (%rdx,%rcx,8)
jmp 0x73b5
movq -0x30(%rbp), %rdi
movq %rcx, %rsi
callq 0x2568
testb %r13b, %r13b
jne 0x73cc
movq -0x30(%rbp), %rdi
callq 0x28eb
cmpl $-0x1, %eax
jne 0x7305
movq -0x30(%rbp), %r12
movl -0x40(%rbp), %eax
movl %eax, 0x50(%r12)
jmp 0x72b2
xorl %r12d, %r12d
jmp 0x7404
xorl %eax, %eax
cmpb $0x1, 0x54(%r12)
jne 0x73f3
movl 0x4(%r12), %eax
decl %eax
movl %eax, 0x50(%r12)
movq -0x50(%rbp), %r15
movq %r15, %rdi
callq 0x2b9e
movq %r12, %rax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq