// File: /workspace/github_c_makefile_star2_O1/theovosse[P]llgen/regexp.c
// Function: MatchNFA
ESet MatchNFA(RegExp regExp, char *line) {
	ESet stateSet;
	ESet sPtr;
	ESet *tail;
	Transition tr;
	ESet oldStateSet;
	ESet answers = NULL;
	int currChar;

	stateSet = AddElement(regExp, NULL);
	/* Take eTransitions */
	lastVisit++;
	regExp->lastVisit = lastVisit;
	for (sPtr = stateSet, tail = &(stateSet->next); sPtr != NULL; sPtr = sPtr->next) {
		for (tr = ((RegExp) (sPtr->element))->eTransitions; tr != NULL; tr = tr->next) {
			if (tr->destination->lastVisit != lastVisit) {
				*tail = AddElement(tr->destination, NULL);
				tr->destination->lastVisit = lastVisit;
				tail = &((*tail)->next);
			}
		}
	}
	for (currChar = (int) *line++ & 0xFF; currChar != '\0' && stateSet != NULL; currChar = *line++) {
		lastVisit++;
		tail = NULL;
		/* Take transitions */
		oldStateSet = stateSet;
		stateSet = NULL;
		for (sPtr = oldStateSet; sPtr != NULL; sPtr = sPtr->next) {
			for (tr = ((RegExp) (sPtr->element))->transitions; tr != NULL; tr = tr->next) {
				if (tr->transitionChar == currChar) {
					stateSet = AddElement(tr->destination, stateSet);
					tr->destination->lastVisit = lastVisit;
					if (tail == NULL) {
						tail = &(stateSet->next);
					}
				}
			}
		}
		RemoveSet(oldStateSet);
		/* Take eTransitions */
		for (sPtr = stateSet; sPtr != NULL; sPtr = sPtr->next) {
			for (tr = ((RegExp) (sPtr->element))->eTransitions; tr != NULL; tr = tr->next) {
				if (tr->destination->lastVisit != lastVisit) {
					*tail = AddElement(tr->destination, NULL);
					tr->destination->lastVisit = lastVisit;
					tail = &((*tail)->next);
				}
			}
		}
	}
	for (sPtr = stateSet; sPtr != NULL; sPtr = sPtr->next) {
		if (((RegExp) (sPtr->element))->info != NULL) {
			((ESet) (((RegExp) sPtr->element)->info))->next = answers;
			answers = (ESet) (((RegExp) (sPtr->element))->info);
		}
	}
	RemoveSet(stateSet);
	return (answers);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r13
movq %rdi, %r14
xorl %esi, %esi
callq 0xcbc4
movq %rax, %r15
movq 0xec8d(%rip), %rax      # 0x1bce8
incq %rax
movq %rax, 0xec83(%rip)      # 0x1bce8
movq %rax, 0x20(%r14)
testq %r15, %r15
je 0xd0c2
leaq 0x8(%r15), %r12
movq %r15, %r14
movq (%r14), %rax
movq 0x8(%rax), %rbx
testq %rbx, %rbx
je 0xd0b9
movq 0x8(%rbx), %rdi
movq 0x20(%rdi), %rax
cmpq 0xec58(%rip), %rax      # 0x1bce8
je 0xd0b3
xorl %esi, %esi
callq 0xcbc4
movq %rax, (%r12)
movq 0xec44(%rip), %rcx      # 0x1bce8
movq 0x8(%rbx), %rdx
movq %rcx, 0x20(%rdx)
addq $0x8, %rax
movq %rax, %r12
movq 0x10(%rbx), %rbx
jmp 0xd07c
movq 0x8(%r14), %r14
testq %r14, %r14
jne 0xd075
movzbl (%r13), %ebp
testl %ebp, %ebp
sete %al
testq %r15, %r15
sete %cl
orb %al, %cl
jne 0xd1f0
movq %r13, (%rsp)
incq 0xec03(%rip)            # 0x1bce8
xorl %r12d, %r12d
movq %r15, %r13
xorl %r14d, %r14d
movq (%r13), %rax
movq (%rax), %rbx
testq %rbx, %rbx
je 0xd130
cmpl %ebp, (%rbx)
jne 0xd12a
movq 0x8(%rbx), %rdi
movq %r14, %rsi
callq 0xcbc4
movq %rax, %r14
movq 0xebd4(%rip), %rax      # 0x1bce8
movq 0x8(%rbx), %rcx
movq %rax, 0x20(%rcx)
movq %r14, %rax
addq $0x8, %rax
testq %r12, %r12
cmoveq %rax, %r12
movq 0x10(%rbx), %rbx
jmp 0xd0f5
movq 0x8(%r13), %r13
testq %r13, %r13
jne 0xd0ee
movq 0xeb58(%rip), %rax      # 0x1bc98
movq 0xeb61(%rip), %rcx      # 0x1bca8
movq 0xeb7a(%rip), %rdx      # 0x1bcc8
movq (%rsp), %r13
movq %rdx, %rsi
movq %r15, %rdx
movq 0x8(%r15), %r15
movq %rsi, 0x8(%rdx)
incq %rcx
addq $0x10, %rax
testq %r15, %r15
jne 0xd152
movq %rdx, 0xeb55(%rip)      # 0x1bcc8
movq %rcx, 0xeb2e(%rip)      # 0x1bca8
movq %rax, 0xeb17(%rip)      # 0x1bc98
testq %r14, %r14
je 0xd1d6
movq %r14, %r15
movq (%r15), %rax
movq 0x8(%rax), %rbx
testq %rbx, %rbx
je 0xd1cd
movq 0x8(%rbx), %rdi
movq 0x20(%rdi), %rax
cmpq 0xeb44(%rip), %rax      # 0x1bce8
je 0xd1c7
xorl %esi, %esi
callq 0xcbc4
movq %rax, (%r12)
movq 0xeb30(%rip), %rcx      # 0x1bce8
movq 0x8(%rbx), %rdx
movq %rcx, 0x20(%rdx)
addq $0x8, %rax
movq %rax, %r12
movq 0x10(%rbx), %rbx
jmp 0xd190
movq 0x8(%r15), %r15
testq %r15, %r15
jne 0xd189
incq %r13
movsbl (%r13), %ebp
testl %ebp, %ebp
je 0xd1f3
movq %r14, %r15
testq %r14, %r14
jne 0xd0da
jmp 0xd1f3
movq %r15, %r14
testq %r14, %r14
je 0xd220
xorl %ecx, %ecx
movq %r14, %rdx
movq (%rdx), %rax
movq 0x10(%rax), %rax
testq %rax, %rax
je 0xd212
movq %rcx, 0x8(%rax)
movq %rax, %rcx
jmp 0xd215
movq %rcx, %rax
movq 0x8(%rdx), %rdx
testq %rdx, %rdx
jne 0xd1fd
jmp 0xd222
xorl %eax, %eax
testq %r14, %r14
je 0xd26b
movq 0xea6a(%rip), %rcx      # 0x1bc98
movq 0xea73(%rip), %rdx      # 0x1bca8
movq 0xea8c(%rip), %rsi      # 0x1bcc8
movq %rsi, %rdi
movq %r14, %rsi
movq 0x8(%r14), %r14
movq %rdi, 0x8(%rsi)
incq %rdx
addq $0x10, %rcx
testq %r14, %r14
jne 0xd23c
movq %rsi, 0xea6b(%rip)      # 0x1bcc8
movq %rdx, 0xea44(%rip)      # 0x1bca8
movq %rcx, 0xea2d(%rip)      # 0x1bc98
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq