// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq 0xfb35(%rip), %rax      # 0x22f48
addq $0x1, %rax
movq %rax, 0xfb2a(%rip)      # 0x22f48
movq %rax, -0x10(%rbp)
movw $0x0, -0x36(%rbp)
callq 0x120c0
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq %rax, 0xfb04(%rip)      # 0x22f40
movq -0x8(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x11cc0
movq %rax, %rdi
callq 0x13600
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x28(%rax)
cmpw $0x0, -0x36(%rbp)
setne %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x1346f
jmp 0x135b6
movw $0xffff, -0x36(%rbp)    # imm = 0xFFFF
movq -0x18(%rbp), %rax
movq %rax, -0x20(%rbp)
movswl -0x36(%rbp), %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, -0x37(%rbp)
je 0x13496
cmpq $0x0, -0x20(%rbp)
setne %al
movb %al, -0x37(%rbp)
movb -0x37(%rbp), %al
testb $0x1, %al
jne 0x1349f
jmp 0x134c3
movq -0x20(%rbp), %rax
movq 0x20(%rax), %rax
cmpq -0x10(%rbp), %rax
je 0x134b5
movw $0x0, -0x36(%rbp)
jmp 0x134c1
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x20(%rbp)
jmp 0x1347d
cmpq $0x0, -0x20(%rbp)
je 0x135b1
movq -0x10(%rbp), %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x20(%rax)
movl $0x0, -0x34(%rbp)
movl -0x34(%rbp), %eax
cmpl 0xcdba(%rip), %eax      # 0x202a4
je 0x135af
movq -0x20(%rbp), %rax
movq 0x28(%rax), %rdi
movl -0x34(%rbp), %esi
callq 0x13720
movq %rax, -0x28(%rbp)
cmpq $0x0, %rax
je 0x1359f
movq -0x28(%rbp), %rdi
callq 0x13600
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x137c0
movq %rax, -0x30(%rbp)
cmpq $0x0, %rax
jne 0x13579
callq 0x120c0
movq %rax, -0x30(%rbp)
movq -0x28(%rbp), %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x28(%rax)
movq -0x28(%rbp), %rdi
callq 0x13820
movq %rax, %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x18(%rax)
movq -0x30(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x18(%rax)
jmp 0x13582
movq -0x28(%rbp), %rdi
callq 0x11d90
movl -0x34(%rbp), %edi
movq -0x30(%rbp), %rsi
movq -0x20(%rbp), %rax
movq (%rax), %rdx
callq 0x11be0
movq %rax, %rcx
movq -0x20(%rbp), %rax
movq %rcx, (%rax)
jmp 0x135a1
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x134e1
jmp 0x135b1
jmp 0x1345c
movq -0x18(%rbp), %rax
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0x135ec
movq -0x20(%rbp), %rax
movq 0x28(%rax), %rdi
callq 0x11d90
movq -0x20(%rbp), %rax
movq $0x0, 0x28(%rax)
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x20(%rbp)
jmp 0x135be
movq -0x18(%rbp), %rdi
callq 0x13880
movq -0x18(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
nop