// File: /workspace/github_c_makefile_star2_O2/theovosse[P]llgen/regexp.c
// Function: MatchNFA2
ESet MatchNFA2(RegExp regExp, char *line) {
	Boolean *sptr;
	Boolean *optr;
	RegExp *stptr;
	ESet answers = NULL;
	Transition tr;
	int i;
	Boolean changes;

	for (sptr = stateState, i = 0; i != globStateNr; i++) {
		*sptr++ = false;
	}
	/* Take eTransitions */
	memcpy(oStates, stateState, globStateNr * sizeof(Boolean));
	stateState[0] = true;
	do {
		changes = false;
		for (i = 0, sptr = stateState, optr = oStates, stptr = state; i != globStateNr; i++, sptr++, optr++, stptr++) {
			if (*sptr && !*optr) {
				*optr = true;
				for (tr = (*stptr)->eTransitions; tr != NULL; tr = tr->next) {
					if (!stateState[tr->destination->state.number]) {
						changes = true;
						stateState[tr->destination->state.number] = true;
					}
				}
			}
		}
	}
	while (changes);
	while (*line != '\0') {
		/* Take transitions */
		changes = false;
		memcpy(oStates, stateState, globStateNr * sizeof(Boolean));
		for (sptr = stateState, i = 0; i != globStateNr; i++) *sptr++ = false;
		for (i = 0, optr = oStates, stptr = state; i != globStateNr; i++, optr++, stptr++) {
			if (*optr) {
				for (tr = (*stptr)->transitions; tr != NULL; tr = tr->next) {
					if (tr->transitionChar == ((int) *line & 0xFF)) {
						changes = true;
						stateState[tr->destination->state.number] = true;
					}
				}
			}
		}
		if (!changes) {
			return (NULL);
		}
		/* Take eTransitions */
		memcpy(oStates, stateState, globStateNr * sizeof(Boolean));
		stateState[0] = true;
		do {
			changes = false;
			for (i = 0, sptr = stateState, optr = oStates, stptr = state; i != globStateNr; i++, sptr++, optr++, stptr++) {
				if (*sptr && !*optr) {
					*optr = true;
					for (tr = (*stptr)->eTransitions; tr != NULL; tr = tr->next) {
						if (!stateState[tr->destination->state.number]) {
							changes = true;
							stateState[tr->destination->state.number] = true;
						}
					}
				}
			}
		}
		while (changes);
		line++;
	}
	for (sptr = stateState, stptr = state, i = 0; i != globStateNr; i++, stptr++) {
		if (*sptr++ && (*stptr)->info != NULL) {
			((ESet) ((*stptr)->info))->next = answers;
			answers = (ESet) ((*stptr)->info);
		}
	}
	return (answers);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq 0xe7b1(%rip), %rbx      # 0x1ad08
movl 0xe79b(%rip), %ebp      # 0x1acf8
movslq %ebp, %r15
xorl %eax, %eax
cmpl %eax, %ebp
je 0xc570
andw $0x0, (%rbx,%rax,2)
incq %rax
jmp 0xc562
movq 0xe799(%rip), %r12      # 0x1ad10
addq %r15, %r15
movq %r12, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x3160
orw $-0x1, (%rbx)
xorl %eax, %eax
movq 0xe75b(%rip), %r13      # 0x1acf0
movq %rbx, %rcx
movq %r12, %rdx
movq %r13, %rdi
xorl %esi, %esi
cmpl %ebp, %eax
jne 0xc5be
xorl %eax, %eax
movq %rbx, %rcx
movq %r12, %rdx
movq %r13, %rdi
testw %si, %si
movl $0x0, %esi
jne 0xc5a0
jmp 0xc70b
cmpw $0x0, (%rcx)
je 0xc5ca
cmpw $0x0, (%rdx)
je 0xc5da
incl %eax
addq $0x2, %rcx
addq $0x2, %rdx
addq $0x8, %rdi
jmp 0xc5a0
orw $-0x1, (%rdx)
movq (%rdi), %r8
addq $0x8, %r8
movq (%r8), %r8
testq %r8, %r8
je 0xc5ca
movq 0x8(%r8), %r9
movq 0x28(%r9), %r9
cmpw $0x0, (%rbx,%r9,2)
jne 0xc607
orw $-0x1, (%rbx,%r9,2)
movw $0xffff, %si            # imm = 0xFFFF
addq $0x10, %r8
jmp 0xc5e5
movq %r12, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x3160
xorl %eax, %eax
cmpl %eax, %ebp
je 0xc62b
andw $0x0, (%rbx,%rax,2)
incq %rax
jmp 0xc61d
xorl %eax, %eax
movq %r12, %rcx
movq %r13, %rdx
xorl %esi, %esi
cmpl %ebp, %eax
je 0xc676
cmpw $0x0, (%rcx)
je 0xc66a
movq (%rdx), %rdi
movq (%rdi), %rdi
testq %rdi, %rdi
je 0xc66a
movzbl (%r14), %r8d
cmpl %r8d, (%rdi)
jne 0xc664
movq 0x8(%rdi), %rsi
movq 0x28(%rsi), %rsi
orw $-0x1, (%rbx,%rsi,2)
movw $0xffff, %si            # imm = 0xFFFF
addq $0x10, %rdi
jmp 0xc642
incl %eax
addq $0x2, %rcx
addq $0x8, %rdx
jmp 0xc635
testw %si, %si
je 0xc744
movq %r12, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x3160
orw $-0x1, (%rbx)
xorl %eax, %eax
movq %rbx, %rcx
movq %r12, %rdx
movq %r13, %rdi
xorl %esi, %esi
cmpl %ebp, %eax
jne 0xc6b9
xorl %eax, %eax
movq %rbx, %rcx
movq %r12, %rdx
movq %r13, %rdi
testw %si, %si
movl $0x0, %esi
jne 0xc69e
jmp 0xc708
cmpw $0x0, (%rcx)
je 0xc6c5
cmpw $0x0, (%rdx)
je 0xc6d5
incl %eax
addq $0x2, %rcx
addq $0x2, %rdx
addq $0x8, %rdi
jmp 0xc69e
orw $-0x1, (%rdx)
movq (%rdi), %r8
addq $0x8, %r8
movq (%r8), %r8
testq %r8, %r8
je 0xc6c5
movq 0x8(%r8), %r9
movq 0x28(%r9), %r9
cmpw $0x0, (%rbx,%r9,2)
jne 0xc702
orw $-0x1, (%rbx,%r9,2)
movw $0xffff, %si            # imm = 0xFFFF
addq $0x10, %r8
jmp 0xc6e0
incq %r14
cmpb $0x0, (%r14)
jne 0xc60d
xorl %edx, %edx
xorl %eax, %eax
cmpl %edx, %ebp
je 0xc746
cmpw $0x0, (%rbx,%rdx,2)
je 0xc73f
movq (%r13,%rdx,8), %rcx
movq 0x10(%rcx), %rcx
testq %rcx, %rcx
je 0xc73f
movq %rax, 0x8(%rcx)
movq (%r13,%rdx,8), %rcx
movq 0x10(%rcx), %rax
incq %rdx
jmp 0xc719
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq