// File: /workspace/github_c_makefile_star2_O0/MaoKo[P]FGFX/fgfp/src/lr.c
// Function: merge_lr1_state
bool
merge_lr1_state(lr1_state_t* st1, lr1_state_t* st2) {
	if (!st1 || !st2)
		{ return (false); }

	if (st1->hash_items != st2->hash_items
			|| cmp_lr0_state(st1->items, st2->items))
		{ return (false); }

	bitset_t* new_item = new_bitset();
	int i;

	while ((i = IT_NEXT(st1->items)) != IT_NULL) {
		lr1_item_t* st1_item = (lr1_item_t*)AT_VECTOR(record_lr1_item, i);
		int j;
		while ((j = IT_NEXT(st2->items)) != IT_NULL) {
			lr1_item_t* st2_item = (lr1_item_t*)AT_VECTOR(record_lr1_item, j);
			if (!cmp_lr0_item(CORE(st1_item), CORE(st2_item))) {
				int index_new_item = merge_lr1_item(st1_item, st2_item);
				if (index_new_item != ERROR)
					{ ADD_BITSET(new_item, (size_t)index_new_item); }
				break;
			}
		}
		IT_RESET(st2->items);
	}
	IT_RESET(st1->items);

	if (eq_bitset(st1->items, new_item)) {
		del_bitset(new_item);
		return (false);
	}

	del_bitset(st1->items);
	st1->items = new_item;

	return (true);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x87ce
cmpq $0x0, -0x18(%rbp)
jne 0x87d7
movb $0x0, -0x1(%rbp)
jmp 0x89c8
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x18(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jne 0x8801
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movq -0x18(%rbp), %rax
movq (%rax), %rsi
callq 0x8350
cmpl $0x0, %eax
je 0x880a
movb $0x0, -0x1(%rbp)
jmp 0x89c8
callq 0x1290
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rdi
callq 0x1aa0
movl %eax, -0x24(%rbp)
cmpl $-0x1, %eax
je 0x893d
movq 0x1757e(%rip), %rax     # 0x1fdb0
movq (%rax), %rax
movslq -0x24(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x30(%rbp)
movq -0x18(%rbp), %rax
movq (%rax), %rdi
callq 0x1aa0
movl %eax, -0x34(%rbp)
cmpl $-0x1, %eax
je 0x88ed
movq 0x17550(%rip), %rax     # 0x1fdb0
movq (%rax), %rax
movslq -0x34(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x40(%rbp)
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x40(%rbp), %rax
movq 0x8(%rax), %rsi
callq 0x89e0
cmpl $0x0, %eax
jne 0x88e8
movq -0x30(%rbp), %rdi
movq -0x40(%rbp), %rsi
callq 0x8a30
movl %eax, -0x44(%rbp)
cmpl $-0x1, -0x44(%rbp)
je 0x88e6
movslq -0x44(%rbp), %rax
movq -0x20(%rbp), %rcx
movl 0x4(%rcx), %ecx
cmpq %rcx, %rax
jb 0x88be
movq -0x20(%rbp), %rdi
movslq -0x44(%rbp), %rsi
callq 0x1420
jmp 0x88e6
movslq -0x44(%rbp), %rcx
andq $0x3f, %rcx
movl $0x1, %edx
shlq %cl, %rdx
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0x44(%rbp), %rcx
shrq $0x6, %rcx
orq (%rax,%rcx,8), %rdx
movq %rdx, (%rax,%rcx,8)
jmp 0x88ed
jmp 0x8841
movq -0x18(%rbp), %rax
cmpq $0x0, (%rax)
jne 0x88f9
jmp 0x8938
movq -0x18(%rbp), %rax
movq (%rax), %rax
testb $0x1, 0x54(%rax)
jne 0x891b
movq -0x18(%rbp), %rax
movq (%rax), %rax
movl $0x0, 0x50(%rax)
xorl %eax, %eax
movl %eax, -0x48(%rbp)
jmp 0x8935
movq -0x18(%rbp), %rax
movq (%rax), %rax
movl 0x4(%rax), %eax
subl $0x1, %eax
movq -0x18(%rbp), %rcx
movq (%rcx), %rcx
movl %eax, 0x50(%rcx)
movl %eax, -0x48(%rbp)
movl -0x48(%rbp), %eax
jmp 0x8813
movq -0x10(%rbp), %rax
cmpq $0x0, (%rax)
jne 0x8949
jmp 0x8988
movq -0x10(%rbp), %rax
movq (%rax), %rax
testb $0x1, 0x54(%rax)
jne 0x896b
movq -0x10(%rbp), %rax
movq (%rax), %rax
movl $0x0, 0x50(%rax)
xorl %eax, %eax
movl %eax, -0x4c(%rbp)
jmp 0x8985
movq -0x10(%rbp), %rax
movq (%rax), %rax
movl 0x4(%rax), %eax
subl $0x1, %eax
movq -0x10(%rbp), %rcx
movq (%rcx), %rcx
movl %eax, 0x50(%rcx)
movl %eax, -0x4c(%rbp)
movl -0x4c(%rbp), %eax
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movq -0x20(%rbp), %rsi
callq 0x1710
testb $0x1, %al
jne 0x899e
jmp 0x89ad
movq -0x20(%rbp), %rdi
callq 0x1300
movb $0x0, -0x1(%rbp)
jmp 0x89c8
movq -0x10(%rbp), %rax
movq (%rax), %rdi
callq 0x1300
movq -0x20(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, (%rax)
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)