// File: /workspace/github_c_makefile_star2_O0/theovosse[P]llgen/regexp.c
// Function: MinimizeDFA
void MinimizeDFA(RegExp dfa) {
	RegExp state;
	ESet partition = NULL, nPartition;
	ESet element, element2;
	ESet nSet1, nSet2;
	Boolean changes;
	Transition tr;

	currentAutomaton = dfa;
	push_localadm();
	/* Partitioning: one class for each type final state, plus one for the rest */
	for (state = dfa; state != NULL; state = state->next) {
		for (element = partition; element != NULL; element = element->next) {
			ESet stateSet = element->element;
			if ((singleAnswer? FirstAnswerIdentical(state->info, ((RegExp) (stateSet->element))->info):
							   SetEqual(state->info, ((RegExp) (stateSet->element))->info))) {
				element->element = AddElement(state, element->element);
				state->state.set = element;
				break;
			}
		}
		if (element == NULL) {
			ESet stateSet = AddElement(state, NULL);
			partition = AddElement(stateSet, partition);
			state->state.set = partition;
		}
	}
	/* Refine partitioning */
	do {
		changes = false;
		nPartition = NULL;
		for (element = partition; element != NULL; element = element->next) {
			element2 = element->element;
			nSet1 = AddElement(element2->element, NULL);
			nSet2 = NULL;
			element2 = element2->next;
			/* Check if all other members of this partition have the same destinations as the first element */
			while (element2 != NULL) {
				if (AllDestinationsEqual(nSet1->element, element2->element)) {
					nSet1 = AddElement(element2->element, nSet1);
				} else {
					nSet2 = AddElement(element2->element, nSet2);
				}
				element2 = element2->next;
			}
			nPartition = AddElement(nSet1, nPartition);
			for (element2 = nSet1; element2 != NULL; element2 = element2->next) {
				((RegExp) (element2->element))->state.set = nPartition;
			}
			if (nSet2 != NULL) {
				nPartition = AddElement(nSet2, nPartition);
				changes = true;
				for (element2 = nSet2; element2 != NULL; element2 = element2->next) {
					((RegExp) (element2->element))->state.set = nPartition;
				}
			}
		}
		RemoveSet(partition);
		partition = nPartition;
	}
	while (changes);
	/* Ensure that the first state stays the same when mapping... */
	for (element = partition; element != NULL; element = element->next) {
		if (SetMember(dfa, element->element)) {
			element->element = AddElement(dfa, element->element);
			break;
		}
	}
	/* Map states and transitions: pick first element of each partition */
	for (state = dfa; state != NULL; state = state->next) {
		for (tr = state->transitions; tr != NULL; tr = tr->next) {
			tr->destination = ((ESet) (tr->destination->state.set->element))->element;
		}
	}
	/* Clean up adm */
	pop_localadm();
	/* Remove unreachable states */
	lastVisit++;
	MarkDFA(dfa);
	RemoveUnreachableStates(dfa);
	RenumberDFA(dfa);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movq $0x0, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq %rax, 0xf5a1(%rip)      # 0x22f40
callq 0x11760
movq -0x8(%rbp), %rax
movq %rax, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x13aa2
movq -0x18(%rbp), %rax
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
je 0x13a5a
movq -0x28(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x58(%rbp)
movswl 0xf55c(%rip), %eax      # 0x22f38
cmpl $0x0, %eax
je 0x13a01
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x58(%rbp), %rax
movq (%rax), %rax
movq 0x10(%rax), %rsi
callq 0x13cf0
cwtl
cmpl $0x0, %eax
jne 0x13a1f
jmp 0x13a47
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x58(%rbp), %rax
movq (%rax), %rax
movq 0x10(%rax), %rsi
callq 0x11f20
cwtl
cmpl $0x0, %eax
je 0x13a47
movq -0x10(%rbp), %rdi
movq -0x28(%rbp), %rax
movq (%rax), %rsi
callq 0x11cc0
movq %rax, %rcx
movq -0x28(%rbp), %rax
movq %rcx, (%rax)
movq -0x28(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x28(%rax)
jmp 0x13a5a
jmp 0x13a49
movq -0x28(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x28(%rbp)
jmp 0x139bf
cmpq $0x0, -0x28(%rbp)
jne 0x13a8f
movq -0x10(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x11cc0
movq %rax, -0x60(%rbp)
movq -0x60(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x11cc0
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x28(%rax)
jmp 0x13a91
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x10(%rbp)
jmp 0x139ac
jmp 0x13aa4
movw $0x0, -0x42(%rbp)
movq $0x0, -0x20(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
je 0x13bec
movq -0x28(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
movq (%rax), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x11cc0
movq %rax, -0x38(%rbp)
movq $0x0, -0x40(%rbp)
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
je 0x13b50
movq -0x38(%rbp), %rax
movq (%rax), %rdi
movq -0x30(%rbp), %rax
movq (%rax), %rsi
callq 0x13dd0
cmpw $0x0, %ax
je 0x13b2e
movq -0x30(%rbp), %rax
movq (%rax), %rdi
movq -0x38(%rbp), %rsi
callq 0x11cc0
movq %rax, -0x38(%rbp)
jmp 0x13b42
movq -0x30(%rbp), %rax
movq (%rax), %rdi
movq -0x40(%rbp), %rsi
callq 0x11cc0
movq %rax, -0x40(%rbp)
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x30(%rbp)
jmp 0x13af8
movq -0x38(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x11cc0
movq %rax, -0x20(%rbp)
movq -0x38(%rbp), %rax
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
je 0x13b8d
movq -0x20(%rbp), %rcx
movq -0x30(%rbp), %rax
movq (%rax), %rax
movq %rcx, 0x28(%rax)
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x30(%rbp)
jmp 0x13b69
cmpq $0x0, -0x40(%rbp)
je 0x13bd9
movq -0x40(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x11cc0
movq %rax, -0x20(%rbp)
movw $0xffff, -0x42(%rbp)    # imm = 0xFFFF
movq -0x40(%rbp), %rax
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
je 0x13bd7
movq -0x20(%rbp), %rcx
movq -0x30(%rbp), %rax
movq (%rax), %rax
movq %rcx, 0x28(%rax)
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x30(%rbp)
jmp 0x13bb3
jmp 0x13bd9
jmp 0x13bdb
movq -0x28(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x28(%rbp)
jmp 0x13aba
movq -0x18(%rbp), %rdi
callq 0x11d90
movq -0x20(%rbp), %rax
movq %rax, -0x18(%rbp)
cmpw $0x0, -0x42(%rbp)
jne 0x13aa4
movq -0x18(%rbp), %rax
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
je 0x13c59
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rax
movq (%rax), %rsi
callq 0x11e60
cmpw $0x0, %ax
je 0x13c49
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rax
movq (%rax), %rsi
callq 0x11cc0
movq %rax, %rcx
movq -0x28(%rbp), %rax
movq %rcx, (%rax)
jmp 0x13c59
jmp 0x13c4b
movq -0x28(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x28(%rbp)
jmp 0x13c10
movq -0x8(%rbp), %rax
movq %rax, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x13cb2
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x50(%rbp)
cmpq $0x0, -0x50(%rbp)
je 0x13ca2
movq -0x50(%rbp), %rax
movq 0x8(%rax), %rax
movq 0x28(%rax), %rax
movq (%rax), %rax
movq (%rax), %rcx
movq -0x50(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x50(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x50(%rbp)
jmp 0x13c73
jmp 0x13ca4
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x10(%rbp)
jmp 0x13c61
callq 0x11940
movq 0xf28a(%rip), %rax      # 0x22f48
addq $0x1, %rax
movq %rax, 0xf27f(%rip)      # 0x22f48
movq -0x8(%rbp), %rdi
callq 0x13ef0
movq -0x8(%rbp), %rdi
callq 0x13f60
movq -0x8(%rbp), %rdi
callq 0x13880
addq $0x60, %rsp
popq %rbp
retq
nopw (%rax,%rax)