// File: /workspace/github_c_makefile_star2_O2/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, %rbx
movq %rdi, %r15
xorl %esi, %esi
callq 0xbec0
movq %rax, %r14
movq 0xe9cd(%rip), %rcx      # 0x1ace8
incq %rcx
movq %rcx, 0xe9c3(%rip)      # 0x1ace8
movq %rcx, 0x20(%r15)
movq %rax, %r12
addq $0x8, %r12
movq %rax, %r15
testq %r15, %r15
je 0xc37f
movq (%r15), %r13
addq $0x8, %r13
movq (%r13), %r13
testq %r13, %r13
je 0xc379
movq 0x8(%r13), %rdi
cmpq %rcx, 0x20(%rdi)
je 0xc373
xorl %esi, %esi
callq 0xbec0
movq %rax, (%r12)
movq 0xe984(%rip), %rcx      # 0x1ace8
movq 0x8(%r13), %rdx
movq %rcx, 0x20(%rdx)
addq $0x8, %rax
movq %rax, %r12
addq $0x10, %r13
jmp 0xc33f
movq 0x8(%r15), %r15
jmp 0xc333
movzbl (%rbx), %ebp
testl %ebp, %ebp
je 0xc463
testq %r14, %r14
je 0xc463
incq 0xe94e(%rip)            # 0x1ace8
incq %rbx
movq %rbx, (%rsp)
xorl %r15d, %r15d
movq %r14, %r13
xorl %r12d, %r12d
testq %r13, %r13
je 0xc3f7
movq (%r13), %rbx
movq (%rbx), %rbx
testq %rbx, %rbx
je 0xc3f1
cmpl %ebp, (%rbx)
jne 0xc3eb
movq 0x8(%rbx), %rdi
movq %r15, %rsi
callq 0xbec0
movq %rax, %r15
movq 0xe913(%rip), %rax      # 0x1ace8
movq 0x8(%rbx), %rcx
movq %rax, 0x20(%rcx)
movq %r15, %rax
addq $0x8, %rax
testq %r12, %r12
cmoveq %rax, %r12
addq $0x10, %rbx
jmp 0xc3b3
movq 0x8(%r13), %r13
jmp 0xc3aa
movq %r14, %rdi
callq 0xbf31
movq %r15, %r14
testq %r14, %r14
je 0xc454
movq (%r14), %rbx
addq $0x8, %rbx
movq (%rbx), %rbx
testq %rbx, %rbx
je 0xc44e
movq 0x8(%rbx), %rdi
movq 0x20(%rdi), %rax
cmpq 0xe8c3(%rip), %rax      # 0x1ace8
je 0xc448
xorl %esi, %esi
callq 0xbec0
movq %rax, (%r12)
movq 0xe8af(%rip), %rcx      # 0x1ace8
movq 0x8(%rbx), %rdx
movq %rcx, 0x20(%rdx)
addq $0x8, %rax
movq %rax, %r12
addq $0x10, %rbx
jmp 0xc40e
movq 0x8(%r14), %r14
jmp 0xc402
movq (%rsp), %rbx
movsbl (%rbx), %ebp
movq %r15, %r14
jmp 0xc382
xorl %ebx, %ebx
movq %r14, %rax
testq %rax, %rax
je 0xc486
movq (%rax), %rcx
movq 0x10(%rcx), %rcx
testq %rcx, %rcx
je 0xc480
movq %rbx, 0x8(%rcx)
movq %rcx, %rbx
movq 0x8(%rax), %rax
jmp 0xc468
movq %r14, %rdi
callq 0xbf31
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq