// File: /workspace/github_c_makefile_star2_O1/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
subq $0x18, %rsp
movq %rsi, %r14
movq 0xe9d9(%rip), %rbx      # 0x1bd08
movslq 0xe9c2(%rip), %r12      # 0x1bcf8
movl %r12d, %ebp
testq %r12, %r12
je 0xd350
leaq (,%rbp,2), %rdx
movq %rbx, %rdi
xorl %esi, %esi
callq 0x3120
movq 0xe9b9(%rip), %r15      # 0x1bd10
leaq (%r12,%r12), %rdx
movq %r15, %rdi
movq %rbx, %rsi
movq %rdx, (%rsp)
callq 0x3170
movw $0xffff, (%rbx)         # imm = 0xFFFF
movq 0xe97a(%rip), %r13      # 0x1bcf0
testq %rbp, %rbp
je 0xd3f5
xorl %eax, %eax
xorl %ecx, %ecx
movq %r13, %rdx
movq %r15, %rsi
movq %rbx, %rdi
cmpw $0x0, (%rdi)
je 0xd394
cmpw $0x0, (%rsi)
je 0xd3c3
incl %ecx
addq $0x2, %rdi
addq $0x2, %rsi
addq $0x8, %rdx
cmpl %r12d, %ecx
jne 0xd388
testw %ax, %ax
je 0xd3f5
xorl %eax, %eax
movl $0x0, %ecx
movq %r13, %rdx
movq %r15, %rsi
movq %rbx, %rdi
testl %r12d, %r12d
jne 0xd388
jmp 0xd3f5
movw $0xffff, (%rsi)         # imm = 0xFFFF
movq (%rdx), %r8
movq 0x8(%r8), %r8
testq %r8, %r8
je 0xd394
movq 0x8(%r8), %r9
movq 0x28(%r9), %r9
cmpw $0x0, (%rbx,%r9,2)
jne 0xd3ef
movw $0xffff, (%rbx,%r9,2)   # imm = 0xFFFF
movw $0xffff, %ax            # imm = 0xFFFF
movq 0x10(%r8), %r8
jmp 0xd3cf
cmpb $0x0, (%r14)
je 0xd532
leaq (,%rbp,2), %rax
movq %rax, 0x10(%rsp)
movq %r12, 0x8(%rsp)
movq %r15, %rdi
movq %rbx, %rsi
movq (%rsp), %rdx
callq 0x3170
testl %r12d, %r12d
je 0xd566
xorl %r12d, %r12d
movq %rbx, %rdi
xorl %esi, %esi
movq 0x10(%rsp), %rdx
callq 0x3120
xorl %eax, %eax
movq %r13, %rcx
movq %r15, %rdx
cmpw $0x0, (%rdx)
je 0xd475
movq (%rcx), %rsi
movq (%rsi), %rsi
testq %rsi, %rsi
je 0xd475
movzbl (%r14), %edi
cmpl %edi, (%rsi)
jne 0xd46f
movq 0x8(%rsi), %rdi
movq 0x28(%rdi), %rdi
movw $0xffff, (%rbx,%rdi,2)  # imm = 0xFFFF
movw $0xffff, %r12w          # imm = 0xFFFF
movq 0x10(%rsi), %rsi
jmp 0xd44f
incl %eax
addq $0x2, %rdx
addq $0x8, %rcx
cmpl %ebp, %eax
jne 0xd443
testw %r12w, %r12w
je 0xd566
movq %r15, %rdi
movq %rbx, %rsi
movq (%rsp), %rdx
callq 0x3170
movw $0xffff, (%rbx)         # imm = 0xFFFF
testq %rbp, %rbp
movq 0x8(%rsp), %r12
je 0xd523
xorl %eax, %eax
xorl %ecx, %ecx
movq %r13, %rdx
movq %r15, %rsi
movq %rbx, %rdi
cmpw $0x0, (%rdi)
je 0xd4c4
cmpw $0x0, (%rsi)
je 0xd4f1
incl %ecx
addq $0x2, %rdi
addq $0x2, %rsi
addq $0x8, %rdx
cmpl %ebp, %ecx
jne 0xd4b8
testw %ax, %ax
je 0xd523
xorl %eax, %eax
movl $0x0, %ecx
movq %r13, %rdx
movq %r15, %rsi
movq %rbx, %rdi
testl %ebp, %ebp
jne 0xd4b8
jmp 0xd523
movw $0xffff, (%rsi)         # imm = 0xFFFF
movq (%rdx), %r8
movq 0x8(%r8), %r8
testq %r8, %r8
je 0xd4c4
movq 0x8(%r8), %r9
movq 0x28(%r9), %r9
cmpw $0x0, (%rbx,%r9,2)
jne 0xd51d
movw $0xffff, (%rbx,%r9,2)   # imm = 0xFFFF
movw $0xffff, %ax            # imm = 0xFFFF
movq 0x10(%r8), %r8
jmp 0xd4fd
cmpb $0x0, 0x1(%r14)
leaq 0x1(%r14), %r14
jne 0xd411
testq %rbp, %rbp
je 0xd566
xorl %edx, %edx
xorl %eax, %eax
cmpw $0x0, (%rbx,%rdx,2)
je 0xd55d
movq (%r13,%rdx,8), %rcx
movq 0x10(%rcx), %rcx
testq %rcx, %rcx
je 0xd55d
movq %rax, 0x8(%rcx)
movq (%r13,%rdx,8), %rcx
movq 0x10(%rcx), %rax
incq %rdx
cmpl %edx, %ebp
jne 0xd53b
jmp 0xd568
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq