// File: /workspace/github_c_makefile_star2_O0/MaoKo[P]FGFX/fgfp/src/lr.c
// Function: propagate_look_lr1
static vector_t*
propagate_look_lr1(kernel_t* kernel) {
	vector_t* vect_look = new_vector();
	init_vector(vect_look, SIZE_VECTOR(kernel->non_lr0_kernel_item),
				(void*(*)(void))&new_bitset);

	bitset_t* kernel_look = new_bitset();

	int i;
	while ((i = IT_NEXT(kernel->kernel_item)) != IT_NULL) {
		lr1_item_t* item = (lr1_item_t*)AT_VECTOR(record_lr1_item, i);
		bitset_t* target_first = compute_look(CORE(item), item->lookahead);
		UNION_BITSET(kernel_look, target_first);
		del_bitset(target_first);
	}
	IT_RESET(kernel->kernel_item);

	propagate_look_lr1_symbol(kernel, vect_look, kernel->rprefix, kernel_look);
	bool repeat;
	do {
		repeat = false;
		for (size_t i = 0; i < SIZE_VECTOR(kernel->non_lr0_kernel_item); ++i) {
			bitset_t* crt_look = (bitset_t*)AT_VECTOR(vect_look, i);
			lr0_item_t const* crt_item = (lr0_item_t const*)
							AT_VECTOR(kernel->non_lr0_kernel_item, i);

			if (crt_item->is_final)
				{ continue; }

			symbol_t* leftmost = DOT(crt_item)->symbol_rhs;
			if (IS_NON_TERMINAL(leftmost)) {
				bitset_t* new_look = compute_look(crt_item, crt_look);
				if (propagate_look_lr1_symbol(kernel, vect_look,
													leftmost, new_look))
					{ repeat = true; }
				del_bitset(new_look);
			}
		}
	} while (repeat);

	del_bitset(kernel_look);
	return (vect_look);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x8(%rbp)
callq 0x1ee0
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq 0x10(%rax), %rsi
leaq -0x99bc(%rip), %rdx     # 0x1290
callq 0x2400
callq 0x1290
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rdi
callq 0x1aa0
movl %eax, -0x1c(%rbp)
cmpl $-0x1, %eax
je 0xacb7
movq 0x1513b(%rip), %rax     # 0x1fdb0
movq (%rax), %rax
movslq -0x1c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rsi
callq 0xae00
movq %rax, -0x30(%rbp)
movq -0x18(%rbp), %rsi
movq -0x30(%rbp), %rdx
xorl %edi, %edi
callq 0x1890
movq -0x30(%rbp), %rdi
callq 0x1300
jmp 0xac5a
movq -0x8(%rbp), %rax
cmpq $0x0, (%rax)
jne 0xacc3
jmp 0xad02
movq -0x8(%rbp), %rax
movq (%rax), %rax
testb $0x1, 0x54(%rax)
jne 0xace5
movq -0x8(%rbp), %rax
movq (%rax), %rax
movl $0x0, 0x50(%rax)
xorl %eax, %eax
movl %eax, -0x64(%rbp)
jmp 0xacff
movq -0x8(%rbp), %rax
movq (%rax), %rax
movl 0x4(%rax), %eax
subl $0x1, %eax
movq -0x8(%rbp), %rcx
movq (%rcx), %rcx
movl %eax, 0x50(%rcx)
movl %eax, -0x64(%rbp)
movl -0x64(%rbp), %eax
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rdx
movq -0x18(%rbp), %rcx
callq 0xae70
movb $0x0, -0x31(%rbp)
movq $0x0, -0x40(%rbp)
movq -0x40(%rbp), %rax
movq -0x8(%rbp), %rcx
movq 0x18(%rcx), %rcx
cmpq 0x10(%rcx), %rax
jae 0xadd9
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq -0x40(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x48(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq (%rax), %rax
movq -0x40(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rax
testb $0x1, 0x10(%rax)
je 0xad73
jmp 0xadc8
movq -0x50(%rbp), %rax
movq 0x8(%rax), %rax
movq 0x8(%rax), %rax
movq %rax, -0x58(%rbp)
movq -0x58(%rbp), %rax
cmpl $0x27, 0x8(%rax)
jne 0xadc6
movq -0x50(%rbp), %rdi
movq -0x48(%rbp), %rsi
callq 0xae00
movq %rax, -0x60(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x58(%rbp), %rdx
movq -0x60(%rbp), %rcx
callq 0xae70
testb $0x1, %al
jne 0xadb9
jmp 0xadbd
movb $0x1, -0x31(%rbp)
movq -0x60(%rbp), %rdi
callq 0x1300
jmp 0xadc8
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x40(%rbp)
jmp 0xad27
jmp 0xaddb
testb $0x1, -0x31(%rbp)
jne 0xad1b
movq -0x18(%rbp), %rdi
callq 0x1300
movq -0x10(%rbp), %rax
addq $0x70, %rsp
popq %rbp
retq
nopl (%rax,%rax)