// File: /workspace/github_c_makefile_star2_O2/theovosse[P]llgen/regexp.c
// Function: DumpRegExp2
static void DumpRegExp2(RegExp regExp) {
	Transition tr, tr2;
	ESet transitions;
	int mCount = charSetSize, count;
	RegExp mState = NULL;
	Boolean cSet[256];
	int i, tCount;

	if (regExp->lastVisit != lastVisit) {
		regExp->lastVisit = lastVisit;
		printf("%lx: ", regExp->state.number);
		if (regExp->transitions != NULL) {
			transitions = NULL;
			tCount = charSetSize;
			for (i = 0; i != charSetSize; i++) cSet[i] = false;
			for (tr = regExp->transitions; tr != NULL; tr = tr->next) {
				if (!cSet[tr->transitionChar]) {
					mCount--;
					cSet[tr->transitionChar] = true;
					tCount--;
				}
			}
			/* mCount is nr. of fails, mState == NULL, the fail state */
			for (tr = regExp->transitions; tr != NULL; tr = tr->next) {
				if (tr->destination != mState) /* not the most efficient check, but ok */ {
					for (count = 0, tr2 = tr; tr2 != NULL; tr2 = tr2->next)
						if (tr2->destination == tr->destination) count++;
					if (count > mCount) {
						mCount = count;
						mState = tr->destination;
					}
				}
			}
			/* mCount is max. nr. of transitions to the same state, mState is that state */
			for (tr = regExp->transitions; tr != NULL; tr = tr->next) {
				/* Suppresses \0...\037 en \177...\377 */
				if (' ' <= tr->transitionChar && tr->transitionChar <= '~') {
					if (tr->destination != mState && !SetMember(tr->destination, transitions)) {
						transitions = AddElement(tr->destination, transitions);
						printf("{");
						for (tr2 = tr; tr2 != NULL; tr2 = tr2->next)
							if (tr2->destination == tr->destination && tr2->transitionChar >= ' ')
								fputc(tr2->transitionChar, stdout);
						printf("}->%lx ", tr->destination->state.number);
					}
				}
			}
			if (mState == NULL) {
				printf("otherwise fail ");
			} else {
				if (tCount != 0) {
					printf("{");
					for (i = 0; i != charSetSize; i++) {
						if (!cSet[i]) fputc(i, stdout);
					}
					printf("}->fail ");
				}
				printf("otherwise->%lx ", mState->state.number);
			}
			RemoveSet(transitions);
		}
		if (regExp->eTransitions != NULL) {
			printf("Eps:{");
			for (tr = regExp->eTransitions; tr != NULL; tr = tr->next) {
				printf("%lx", tr->destination->state.number);
				if (tr->next != NULL) putchar(',');
			}
			printf("}");
		}
		if (regExp->info != NULL) {
			ESet set = regExp->info;
			Answer first = set->element;
			while (set != NULL) {
				if (singleAnswer) {
					if (first->number > ((Answer) set->element)->number) {
						first = set->element;
					}
				} else {
					printf(" res='%d.%s'", ((Answer) set->element)->number, (const char*) ((Answer) set->element)->info);
				}
				set = set->next;
			}
			if (singleAnswer) {
				printf(" res='%s'", (const char*) first->info);
			}
		}
		putchar('\n');
		for (tr = regExp->transitions; tr != NULL; tr = tr->next) {
			DumpRegExp2(tr->destination);
		}
		for (tr = regExp->eTransitions; tr != NULL; tr = tr->next) {
			DumpRegExp2(tr->destination);
		}
	}
}

// Assembly:
movq 0xe539(%rip), %rax      # 0x1ace8
cmpq %rax, 0x20(%rdi)
je 0xca8e
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x208, %rsp            # imm = 0x208
movq %rdi, %rbx
movl 0xba88(%rip), %r14d     # 0x1825c
movq %rax, 0x20(%rdi)
movq 0x28(%rdi), %rsi
leaq 0x58d0(%rip), %rdi      # 0x120b3
xorl %eax, %eax
callq 0x30f0
movq (%rbx), %r15
testq %r15, %r15
je 0xc985
movl 0xba60(%rip), %ebp      # 0x1825c
xorl %eax, %eax
cmpq %rax, %rbp
je 0xc80d
andw $0x0, (%rsp,%rax,2)
incq %rax
jmp 0xc7fe
movq %r15, %rax
testq %rax, %rax
je 0xc82f
movslq (%rax), %rcx
cmpw $0x0, (%rsp,%rcx,2)
jne 0xc829
decl %r14d
orw $-0x1, (%rsp,%rcx,2)
decl %ebp
movq 0x10(%rax), %rax
jmp 0xc810
xorl %r13d, %r13d
movq %r15, %rax
testq %rax, %rax
je 0xc870
movq 0x8(%rax), %rcx
cmpq %r13, %rcx
je 0xc86a
xorl %edx, %edx
movq %rax, %rsi
testq %rsi, %rsi
je 0xc85f
xorl %edi, %edi
cmpq %rcx, 0x8(%rsi)
movq 0x10(%rsi), %rsi
sete %dil
addl %edi, %edx
jmp 0xc848
cmpl %r14d, %edx
cmovgl %edx, %r14d
cmovgq %rcx, %r13
movq 0x10(%rax), %rax
jmp 0xc835
xorl %r14d, %r14d
testq %r15, %r15
je 0xc907
movl (%r15), %eax
addl $-0x20, %eax
cmpl $0x5e, %eax
ja 0xc8fe
movq 0x8(%r15), %r12
cmpq %r13, %r12
je 0xc8fe
movq %r12, %rdi
movq %r14, %rsi
callq 0xbf94
testw %ax, %ax
jne 0xc8fe
movq %r12, %rdi
movq %r14, %rsi
callq 0xbec0
movq %rax, %r14
pushq $0x7b
popq %rdi
callq 0x3040
movq %r15, %r12
testq %r12, %r12
je 0xc8e8
movq 0x8(%r12), %rax
cmpq 0x8(%r15), %rax
jne 0xc8e1
movl (%r12), %edi
cmpl $0x20, %edi
jl 0xc8e1
movq 0xb6cf(%rip), %rax      # 0x17fa8
movq (%rax), %rsi
callq 0x3120
movq 0x10(%r12), %r12
jmp 0xc8b9
movq 0x8(%r15), %rax
movq 0x28(%rax), %rsi
leaq 0x57c2(%rip), %rdi      # 0x120b9
xorl %eax, %eax
callq 0x30f0
movq 0x10(%r15), %r15
jmp 0xc873
testq %r13, %r13
je 0xc96f
testl %ebp, %ebp
je 0xc95b
pushq $0x7b
popq %rdi
callq 0x3040
xorl %r15d, %r15d
movl 0xb93b(%rip), %eax      # 0x1825c
movl %eax, %ecx
cmpq %rcx, %r15
je 0xc94d
cmpw $0x0, (%rsp,%r15,2)
jne 0xc948
movq 0xb671(%rip), %rax      # 0x17fa8
movq (%rax), %rsi
movl %r15d, %edi
callq 0x3120
movl 0xb914(%rip), %eax      # 0x1825c
incq %r15
jmp 0xc921
leaq 0x577d(%rip), %rdi      # 0x120d1
xorl %eax, %eax
callq 0x30f0
movq 0x28(%r13), %rsi
leaq 0x5774(%rip), %rdi      # 0x120da
xorl %eax, %eax
callq 0x30f0
jmp 0xc97d
leaq 0x574b(%rip), %rdi      # 0x120c1
xorl %eax, %eax
callq 0x30f0
movq %r14, %rdi
callq 0xbf31
leaq 0x8(%rbx), %r15
cmpq $0x0, 0x8(%rbx)
je 0xc9e2
leaq 0x5753(%rip), %rdi      # 0x120ea
xorl %eax, %eax
callq 0x30f0
leaq 0x574b(%rip), %r14      # 0x120f0
pushq $0x2c
popq %rbp
movq %r15, %r12
movq (%r12), %r13
testq %r13, %r13
je 0xc9da
movq 0x8(%r13), %rax
movq 0x28(%rax), %rsi
movq %r14, %rdi
xorl %eax, %eax
callq 0x30f0
leaq 0x10(%r13), %r12
cmpq $0x0, 0x10(%r13)
je 0xc9ab
movl %ebp, %edi
callq 0x3040
jmp 0xc9ab
pushq $0x7d
popq %rdi
callq 0x3040
movq 0x10(%rbx), %r13
testq %r13, %r13
je 0xca49
movq (%r13), %r12
leaq 0x56fe(%rip), %r14      # 0x120f4
movzwl 0xe2db(%rip), %eax      # 0x1acd8
testq %r13, %r13
je 0xca31
testw %ax, %ax
je 0xca17
movl (%r12), %eax
movq (%r13), %rcx
cmpl (%rcx), %eax
cmovgq %rcx, %r12
jmp 0xca2b
movq (%r13), %rax
movl (%rax), %esi
movq 0x8(%rax), %rdx
movq %r14, %rdi
xorl %eax, %eax
callq 0x30f0
movq 0x8(%r13), %r13
jmp 0xc9f6
testw %ax, %ax
je 0xca49
movq 0x8(%r12), %rsi
leaq 0x56bf(%rip), %rdi      # 0x12101
xorl %eax, %eax
callq 0x30f0
pushq $0xa
popq %rdi
callq 0x3040
movq (%rbx), %rbx
testq %rbx, %rbx
je 0xca75
movq 0x8(%rbx), %rdi
callq 0xc7a8
addq $0x10, %rbx
jmp 0xca51
movq 0x8(%r15), %rdi
callq 0xc7a8
addq $0x10, %r15
movq (%r15), %r15
testq %r15, %r15
jne 0xca68
addq $0x208, %rsp            # imm = 0x208
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq