// File: /workspace/github_c_makefile_star2_O1/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 0xe28f(%rip), %r12      # 0x1bce8
incq %r12
movq %r12, 0xe285(%rip)      # 0x1bce8
callq 0xcde8
movq %rax, %rbx
movq %rax, 0xe26e(%rip)      # 0x1bce0
movq %r14, %rdi
xorl %esi, %esi
callq 0xcbc4
movq %rax, %r14
movq %rax, %rdi
callq 0xdcb1
movq %r14, 0x28(%rbx)
testq %rbx, %rbx
setne 0xb(%rsp)
movq %rbx, 0x10(%rsp)
testq %rbx, %rbx
je 0xdacb
movw $0xffff, %ax            # imm = 0xFFFF
cmpq %r12, 0x20(%rbx)
jne 0xdaad
movq 0x18(%rbx), %rbx
jmp 0xdaaf
xorl %eax, %eax
testq %rbx, %rbx
setne %cl
testw %ax, %ax
je 0xdabf
testq %rbx, %rbx
jne 0xdaa1
testw %ax, %ax
sete %al
movl %eax, 0xc(%rsp)
jmp 0xdad7
movl $0x0, 0xc(%rsp)
movb 0xb(%rsp), %cl
testb %cl, %cl
je 0xdc21
movq %r12, 0x20(%rbx)
cmpl $0x0, 0xb772(%rip)      # 0x1925c
je 0xdc21
xorl %ebp, %ebp
movq 0x28(%rbx), %r15
xorl %r14d, %r14d
testq %r15, %r15
je 0xdb40
movq (%r15), %rax
movq (%rax), %r13
testq %r13, %r13
je 0xdb3a
cmpl %ebp, (%r13)
jne 0xdb34
movq 0x8(%r13), %rdi
testq %r14, %r14
je 0xdb29
movq %r14, %rax
cmpq %rdi, (%rax)
je 0xdb34
movq 0x8(%rax), %rax
testq %rax, %rax
jne 0xdb1b
movq %r14, %rsi
callq 0xcbc4
movq %rax, %r14
movq 0x10(%r13), %r13
jmp 0xdb04
movq 0x8(%r15), %r15
jmp 0xdaf9
testq %r14, %r14
je 0xdc13
movq %r14, %rdi
callq 0xdcb1
movq 0x10(%rsp), %r15
testq %r15, %r15
je 0xdb72
movq 0x28(%r15), %rsi
movq %r14, %rdi
callq 0xccd1
testw %ax, %ax
jne 0xdb75
movq 0x18(%r15), %r15
jmp 0xdb56
xorl %r15d, %r15d
testq %r15, %r15
je 0xdbc0
movq 0xe117(%rip), %rax      # 0x1bc98
movq 0xe120(%rip), %rcx      # 0x1bca8
movq 0xe139(%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 0xdb8f
movq %rdx, 0xe118(%rip)      # 0x1bcc8
movq %rcx, 0xe0f1(%rip)      # 0x1bca8
movq %rax, 0xe0da(%rip)      # 0x1bc98
jmp 0xdc03
callq 0xcde8
movq %rax, %r15
movq %r14, 0x28(%rax)
xorl %eax, %eax
movq (%r14), %rcx
movq 0x10(%rcx), %rcx
testq %rcx, %rcx
je 0xdbe5
movq (%rcx), %rdi
movq %rax, %rsi
callq 0xcbc4
movq 0x8(%r14), %r14
testq %r14, %r14
jne 0xdbce
movq %rax, 0x10(%r15)
movq 0x10(%rsp), %rcx
movq 0x18(%rcx), %rax
movq %rax, 0x18(%r15)
movq %r15, 0x18(%rcx)
movq (%rbx), %rdx
movl %ebp, %edi
movq %r15, %rsi
callq 0xcb5e
movq %rax, (%rbx)
incl %ebp
cmpl 0xb641(%rip), %ebp      # 0x1925c
jne 0xdaf2
cmpb $0x0, 0xc(%rsp)
movq 0x10(%rsp), %rbx
jne 0xda98
testq %rbx, %rbx
je 0xdc97
movq 0xe08b(%rip), %rcx      # 0x1bcc8
movq 0xe064(%rip), %rax      # 0x1bca8
movq 0xe04d(%rip), %rdx      # 0x1bc98
movq %rbx, %rsi
movq 0x28(%rsi), %rdi
testq %rdi, %rdi
je 0xdc86
movq %rcx, %r8
movq %rdi, %rcx
movq 0x8(%rdi), %rdi
movq %r8, 0x8(%rcx)
incq %rax
addq $0x10, %rdx
testq %rdi, %rdi
jne 0xdc57
movq %rcx, 0xe050(%rip)      # 0x1bcc8
movq %rax, 0xe029(%rip)      # 0x1bca8
movq %rdx, 0xe012(%rip)      # 0x1bc98
movq $0x0, 0x28(%rsi)
movq 0x18(%rsi), %rsi
testq %rsi, %rsi
jne 0xdc4e
movq %rbx, %rdi
callq 0xdd63
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq