// File: /workspace/github_c_makefile_star2_O3/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, %r15
xorl %r14d, %r14d
xorl %esi, %esi
callq 0xc874
movq 0xefdd(%rip), %rcx      # 0x1bce8
incq %rcx
movq %rcx, 0xefd3(%rip)      # 0x1bce8
movq %rcx, 0x20(%r15)
testq %rax, %rax
je 0xcf09
movq %rax, %rbx
movq %rax, %r15
addq $0x8, %r15
movq %rax, %r14
movq (%r14), %rax
movq 0x8(%rax), %r12
testq %r12, %r12
je 0xcd6e
movq 0x8(%r12), %rdi
cmpq %rcx, 0x20(%rdi)
je 0xcd67
xorl %esi, %esi
callq 0xc874
movq %rax, (%r15)
movq 0xef91(%rip), %rcx      # 0x1bce8
movq 0x8(%r12), %rdx
movq %rcx, 0x20(%rdx)
addq $0x8, %rax
movq %rax, %r15
movq 0x10(%r12), %r12
jmp 0xcd36
movq 0x8(%r14), %r14
testq %r14, %r14
jne 0xcd2f
movq %r13, (%rsp)
movzbl (%r13), %ebp
testl %ebp, %ebp
je 0xce9b
incq %rcx
movq %rcx, 0xef56(%rip)      # 0x1bce8
xorl %r13d, %r13d
movq %rbx, %r12
xorl %r15d, %r15d
movq (%r12), %rax
movq (%rax), %r14
testq %r14, %r14
je 0xcdde
cmpl %ebp, (%r14)
jne 0xcdd8
movq 0x8(%r14), %rdi
movq %r15, %rsi
callq 0xc874
movq %rax, %r15
movq 0xef26(%rip), %rcx      # 0x1bce8
movq 0x8(%r14), %rax
movq %rcx, 0x20(%rax)
movq %r15, %rax
addq $0x8, %rax
testq %r13, %r13
cmoveq %rax, %r13
movq 0x10(%r14), %r14
jmp 0xcda2
movq 0x8(%r12), %r12
testq %r12, %r12
jne 0xcd9b
movq 0xeea9(%rip), %rax      # 0x1bc98
movq 0xeeb2(%rip), %rdx      # 0x1bca8
movq 0xeecb(%rip), %rsi      # 0x1bcc8
movq %rsi, %rdi
movq %rbx, %rsi
movq 0x8(%rbx), %rbx
movq %rdi, 0x8(%rsi)
incq %rdx
addq $0x10, %rax
testq %rbx, %rbx
jne 0xcdfd
movq %rsi, 0xeeaa(%rip)      # 0x1bcc8
movq %rdx, 0xee83(%rip)      # 0x1bca8
movq %rax, 0xee6c(%rip)      # 0x1bc98
testq %r15, %r15
movq (%rsp), %r12
je 0xcf06
incq %r12
movq %r15, %rbx
movq (%rbx), %rax
movq 0x8(%rax), %r14
testq %r14, %r14
je 0xce7c
movq 0x8(%r14), %rdi
cmpq %rcx, 0x20(%rdi)
je 0xce76
xorl %esi, %esi
callq 0xc874
movq %rax, (%r13)
movq 0xee81(%rip), %rcx      # 0x1bce8
movq 0x8(%r14), %rdx
movq %rcx, 0x20(%rdx)
addq $0x8, %rax
movq %rax, %r13
movq 0x10(%r14), %r14
jmp 0xce46
movq 0x8(%rbx), %rbx
testq %rbx, %rbx
jne 0xce3f
movq %r12, (%rsp)
movsbl (%r12), %ebp
movq %r15, %rbx
testl %ebp, %ebp
jne 0xcd88
jmp 0xce9e
movq %rbx, %r15
xorl %r14d, %r14d
movq %r15, %rax
movq (%rax), %rcx
movq 0x10(%rcx), %rcx
testq %rcx, %rcx
je 0xceb7
movq %r14, 0x8(%rcx)
movq %rcx, %r14
movq 0x8(%rax), %rax
testq %rax, %rax
jne 0xcea4
movq 0xedd1(%rip), %rax      # 0x1bc98
movq 0xedda(%rip), %rcx      # 0x1bca8
movq 0xedf3(%rip), %rdx      # 0x1bcc8
movq %rdx, %rsi
movq %r15, %rdx
movq 0x8(%r15), %r15
movq %rsi, 0x8(%rdx)
incq %rcx
addq $0x10, %rax
testq %r15, %r15
jne 0xced5
movq %rdx, 0xedd2(%rip)      # 0x1bcc8
movq %rcx, 0xedab(%rip)      # 0x1bca8
movq %rax, 0xed94(%rip)      # 0x1bc98
jmp 0xcf09
xorl %r14d, %r14d
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq