// File: /workspace/github_c_makefile_star2_O0/theovosse[P]llgen/llgen.c
// Function: collectFirst
static Boolean collectFirst(TREE *firsts, TREE follow, Node rule) {
	NodeList rules;
	Boolean empty = true;
	TREE sym;
	Boolean emptyAlternative;

	while (empty && rule != NULL) {
		switch (rule->nodeType) {
			case single:
				if (rule->element.name->nameType == identifier) {
					for (sym = GetFirstNode(rule->element.name->first); sym != NULL; sym = GetNextNode(sym)) {
						Name key = GetKey(sym);
						if (key->nameType == token || key->nameType == string) {
							(void) InsertElement(firsts, key);
						}
					}
					empty = rule->element.name->empty;
				} else if (rule->element.name->nameType == token || rule->element.name->nameType == string) {
					(void) InsertElement(firsts, rule->element.name);
					empty = false;
				}
				break;
			case option:
				(void) collectFirst(firsts, NULL, rule->element.sub);
				break;
			case sequence:
				empty = collectFirst(firsts, NULL, rule->element.sub);
				break;
			case chain:
				empty = collectFirst(firsts, NULL, rule->element.sub->element.sub);
				if (empty) /* Now also inspect the other chain part, but it remains empty */ {
					(void) collectFirst(firsts, NULL, rule->element.sub->next->element.sub);
				}
				break;
			case alternative: /* Try each one... */
				emptyAlternative = false;
				for (rules = rule->element.alternatives; rules != NULL; rules = rules->rest) {
					if (collectFirst(firsts, NULL, rules->first)) {
						emptyAlternative = true;
					}
				}
				if (!emptyAlternative) {
					empty = false;
				}
				break;
			case breakToken:
			case errorMessage:
				break;
			default:
				fprintf(stderr, "collectFirst: unknown nodetype %d\n", rule->nodeType);
				return (empty);
		}
		rule = rule->next;
	}
	if (empty) {
		Unite(firsts, follow);
	}
	return empty;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movw $0xffff, -0x2a(%rbp)    # imm = 0xFFFF
movswl -0x2a(%rbp), %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, -0x49(%rbp)
je 0x5bd3
cmpq $0x0, -0x20(%rbp)
setne %al
movb %al, -0x49(%rbp)
movb -0x49(%rbp), %al
testb $0x1, %al
jne 0x5bdf
jmp 0x5dcf
movq -0x20(%rbp), %rax
movl 0x4(%rax), %eax
movq %rax, -0x58(%rbp)
subq $0x6, %rax
ja 0x5d95
movq -0x58(%rbp), %rax
leaq 0x13475(%rip), %rcx     # 0x19074
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rax
cmpl $0x0, 0x38(%rax)
jne 0x5c83
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rax
movq 0x8(%rax), %rdi
callq 0x10330
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x38(%rbp)
je 0x5c71
movq -0x38(%rbp), %rdi
callq 0x10400
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rax
cmpl $0x4, 0x38(%rax)
je 0x5c53
movq -0x48(%rbp), %rax
cmpl $0x1, 0x38(%rax)
jne 0x5c60
movq -0x10(%rbp), %rdi
movq -0x48(%rbp), %rsi
callq 0x57b0
jmp 0x5c62
movq -0x38(%rbp), %rdi
callq 0x10430
movq %rax, -0x38(%rbp)
jmp 0x5c2b
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rax
movw 0x30(%rax), %ax
movw %ax, -0x2a(%rbp)
jmp 0x5cb8
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rax
cmpl $0x4, 0x38(%rax)
je 0x5c9f
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rax
cmpl $0x1, 0x38(%rax)
jne 0x5cb6
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rsi
callq 0x57b0
movw $0x0, -0x2a(%rbp)
jmp 0x5cb8
jmp 0x5dbe
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rdx
xorl %eax, %eax
movl %eax, %esi
callq 0x5ba0
jmp 0x5dbe
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rdx
xorl %eax, %eax
movl %eax, %esi
callq 0x5ba0
movw %ax, -0x2a(%rbp)
jmp 0x5dbe
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rax
movq 0x18(%rax), %rdx
xorl %eax, %eax
movl %eax, %esi
callq 0x5ba0
movw %ax, -0x2a(%rbp)
cmpw $0x0, -0x2a(%rbp)
je 0x5d36
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rax
movq 0x28(%rax), %rax
movq 0x18(%rax), %rdx
xorl %eax, %eax
movl %eax, %esi
callq 0x5ba0
jmp 0x5dbe
movw $0x0, -0x3a(%rbp)
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
je 0x5d84
movq -0x10(%rbp), %rdi
movq -0x28(%rbp), %rax
movq (%rax), %rdx
xorl %eax, %eax
movl %eax, %esi
callq 0x5ba0
cmpw $0x0, %ax
je 0x5d74
movw $0xffff, -0x3a(%rbp)    # imm = 0xFFFF
jmp 0x5d76
movq -0x28(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x28(%rbp)
jmp 0x5d4d
cmpw $0x0, -0x3a(%rbp)
jne 0x5d91
movw $0x0, -0x2a(%rbp)
jmp 0x5dbe
jmp 0x5dbe
movq 0x1a25c(%rip), %rax     # 0x1fff8
movq (%rax), %rdi
movq -0x20(%rbp), %rax
movl 0x4(%rax), %edx
leaq 0x13634(%rip), %rsi     # 0x193e1
movb $0x0, %al
callq 0x3140
movw -0x2a(%rbp), %ax
movw %ax, -0x2(%rbp)
jmp 0x5deb
movq -0x20(%rbp), %rax
movq 0x28(%rax), %rax
movq %rax, -0x20(%rbp)
jmp 0x5bba
cmpw $0x0, -0x2a(%rbp)
je 0x5de3
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x5e00
movw -0x2a(%rbp), %ax
movw %ax, -0x2(%rbp)
movw -0x2(%rbp), %ax
addq $0x60, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)