// File: /workspace/github_c_makefile_star2_O3/theovosse[P]llgen/regexp.c
// Function: N2DFA
RegExp N2DFA(RegExp nfa) {
	long int mark = ++lastVisit;
	RegExp dfa;
	RegExp currState;
	ESet stateSet;
	RegExp newState;
	int ch;
	Boolean allMarked = false;
	
	dfa = InitRegExp();
	currentAutomaton = dfa;
	dfa->state.set = EClosure(AddElement(nfa, NULL));
	while (!allMarked) {
		 allMarked = true;
		 currState = dfa;
		 while (allMarked && currState != NULL) {
			 if (currState->lastVisit != mark) {
				 allMarked = false;
			 } else {
				 currState = currState->next;
			 }
		 }
		 if (currState != NULL) {
			 currState->lastVisit = mark;
			 for (ch = 0; ch != charSetSize; ch++) {
				 if ((stateSet = CollectTransitions(currState->state.set, ch)) != NULL) {
					 stateSet = EClosure(stateSet);
					 if ((newState = Member(stateSet, dfa)) == NULL) {
						 newState = InitRegExp();
						 newState->state.set = stateSet;
						 newState->info = CollectInfo(stateSet);
						 newState->next = dfa->next;
						 dfa->next = newState;
					 } else {
						 RemoveSet(stateSet);
					 }
					 currState->transitions = MakeTransition(ch, newState, currState->transitions);
				 }
			 }
		 }
	}
	for (currState = dfa; currState != NULL; currState = currState->next) {
		RemoveSet(currState->state.set);
		currState->state.set = NULL;
	}
	RenumberDFA(dfa);
	return (dfa);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %r14
movq 0xe60f(%rip), %r15      # 0x1bce8
incq %r15
movq %r15, 0xe605(%rip)      # 0x1bce8
callq 0xca8f
movq %rax, %rbx
movq %rax, 0xe5ee(%rip)      # 0x1bce0
movq %r14, %rdi
xorl %esi, %esi
callq 0xc874
movq %rax, %r14
movq %rax, %rdi
callq 0xd920
movq %rbx, 0x8(%rsp)
movq %r14, 0x28(%rbx)
movq 0x8(%rsp), %rax
movq %rax, %r13
testq %rax, %rax
je 0xd901
movq 0x20(%r13), %rbx
cmpq %r15, %rbx
jne 0xd738
movq 0x18(%r13), %r13
testq %r13, %r13
jne 0xd721
jmp 0xd896
movq %r15, 0x10(%rsp)
movq %r15, 0x20(%r13)
cmpl $0x0, 0xbb14(%rip)      # 0x1925c
je 0xd888
xorl %ebp, %ebp
movq 0x28(%r13), %r15
testq %r15, %r15
je 0xd87a
xorl %r14d, %r14d
movq (%r15), %rax
movq (%rax), %r12
testq %r12, %r12
je 0xd79e
cmpl %ebp, (%r12)
jne 0xd797
movq 0x8(%r12), %rdi
testq %r14, %r14
je 0xd78c
movq %r14, %rax
cmpq %rdi, (%rax)
je 0xd797
movq 0x8(%rax), %rax
testq %rax, %rax
jne 0xd77e
movq %r14, %rsi
callq 0xc874
movq %rax, %r14
movq 0x10(%r12), %r12
jmp 0xd766
movq 0x8(%r15), %r15
testq %r15, %r15
jne 0xd760
testq %r14, %r14
je 0xd87a
movq %r14, %rdi
callq 0xd920
cmpq $0x0, 0x8(%rsp)
je 0xd7df
movq 0x8(%rsp), %r15
movq 0x28(%r15), %rsi
movq %r14, %rdi
callq 0xc981
testw %ax, %ax
jne 0xd824
movq 0x18(%r15), %r15
testq %r15, %r15
jne 0xd7c5
callq 0xca8f
movq %rax, %r15
movq %r14, 0x28(%rax)
xorl %eax, %eax
movq (%r14), %rcx
movq 0x10(%rcx), %rcx
testq %rcx, %rcx
je 0xd804
movq (%rcx), %rdi
movq %rax, %rsi
callq 0xc874
movq 0x8(%r14), %r14
testq %r14, %r14
jne 0xd7ed
movq %rax, 0x10(%r15)
movq 0x8(%rsp), %rcx
movq 0x18(%rcx), %rax
movq %rax, 0x18(%r15)
movq %r15, 0x18(%rcx)
jmp 0xd868
movq 0xe46d(%rip), %rax      # 0x1bc98
movq 0xe476(%rip), %rcx      # 0x1bca8
movq 0xe48f(%rip), %rdx      # 0x1bcc8
movq %rdx, %rsi
movq %r14, %rdx
movq 0x8(%r14), %r14
movq %rsi, 0x8(%rdx)
incq %rcx
addq $0x10, %rax
testq %r14, %r14
jne 0xd839
movq %rdx, 0xe46e(%rip)      # 0x1bcc8
movq %rcx, 0xe447(%rip)      # 0x1bca8
movq %rax, 0xe430(%rip)      # 0x1bc98
movq (%r13), %rdx
movl %ebp, %edi
movq %r15, %rsi
callq 0xc80e
movq %rax, (%r13)
incl %ebp
cmpl 0xb9da(%rip), %ebp      # 0x1925c
jne 0xd750
movq 0x10(%rsp), %r15
cmpq %r15, %rbx
jne 0xd710
cmpq $0x0, 0x8(%rsp)
je 0xd901
movq 0xe423(%rip), %rcx      # 0x1bcc8
movq 0xe3fc(%rip), %rax      # 0x1bca8
movq 0xe3e5(%rip), %rdx      # 0x1bc98
movq 0x8(%rsp), %rsi
movq 0x28(%rsi), %rdi
testq %rdi, %rdi
je 0xd8f0
movq %rcx, %r8
movq %rdi, %rcx
movq 0x8(%rdi), %rdi
movq %r8, 0x8(%rcx)
incq %rax
addq $0x10, %rdx
testq %rdi, %rdi
jne 0xd8c1
movq %rcx, 0xe3e6(%rip)      # 0x1bcc8
movq %rax, 0xe3bf(%rip)      # 0x1bca8
movq %rdx, 0xe3a8(%rip)      # 0x1bc98
movq $0x0, 0x28(%rsi)
movq 0x18(%rsi), %rsi
testq %rsi, %rsi
jne 0xd8b8
movq 0x8(%rsp), %rbx
movq %rbx, %rdi
callq 0xd9d1
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq