// File: /workspace/github_c_makefile_star2_O1/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 0xe6fe(%rip), %rax      # 0x1bce8
cmpq %rax, 0x20(%rdi)
je 0xd932
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x218, %rsp            # imm = 0x218
movq %rdi, %r13
movl 0xbc4e(%rip), %ebp      # 0x1925c
movq %rax, 0x20(%rdi)
movq 0x28(%rdi), %rsi
leaq 0x5ab6(%rip), %rdi      # 0x130d3
xorl %eax, %eax
callq 0x30f0
cmpq $0x0, (%r13)
je 0xd825
movl 0xbc26(%rip), %r12d     # 0x1925c
testq %r12, %r12
je 0xd64b
leaq (%r12,%r12), %rdx
leaq 0x10(%rsp), %rdi
xorl %esi, %esi
callq 0x3120
movq (%r13), %rax
testq %rax, %rax
je 0xd671
movslq (%rax), %rcx
cmpw $0x0, 0x10(%rsp,%rcx,2)
jne 0xd66b
decl %ebp
movw $0xffff, 0x10(%rsp,%rcx,2) # imm = 0xFFFF
decl %r12d
movq 0x10(%rax), %rax
jmp 0xd64f
movq %r13, 0x8(%rsp)
movq (%r13), %rax
xorl %r13d, %r13d
testq %rax, %rax
je 0xd6b7
movq 0x8(%rax), %rcx
cmpq %r13, %rcx
je 0xd6b1
xorl %edx, %edx
movq %rax, %rsi
xorl %edi, %edi
cmpq %rcx, 0x8(%rsi)
movq 0x10(%rsi), %r8
sete %dil
addl %edi, %edx
movq %r8, %rsi
testq %r8, %r8
jne 0xd690
cmpl %ebp, %edx
cmovgl %edx, %ebp
cmovgq %rcx, %r13
movq 0x10(%rax), %rax
jmp 0xd67d
movq 0x8(%rsp), %rax
movq (%rax), %rbx
testq %rbx, %rbx
je 0xd75b
movq 0xb8d9(%rip), %r15      # 0x18fa8
xorl %r14d, %r14d
movl (%rbx), %eax
addl $-0x20, %eax
cmpl $0x5e, %eax
ja 0xd74c
movq 0x8(%rbx), %rdi
cmpq %r13, %rdi
je 0xd74c
testq %r14, %r14
je 0xd6fb
movq %r14, %rax
cmpq %rdi, (%rax)
je 0xd74c
movq 0x8(%rax), %rax
testq %rax, %rax
jne 0xd6ed
movq %r14, %rsi
callq 0xcbc4
movq %rax, %r14
movl $0x7b, %edi
callq 0x3040
movq %rbx, %rbp
movq 0x8(%rbp), %rax
cmpq 0x8(%rbx), %rax
jne 0xd72d
movl (%rbp), %edi
cmpl $0x20, %edi
jl 0xd72d
movq (%r15), %rsi
callq 0x3130
movq 0x10(%rbp), %rbp
testq %rbp, %rbp
jne 0xd713
movq 0x8(%rbx), %rax
movq 0x28(%rax), %rsi
leaq 0x5994(%rip), %rdi      # 0x130d9
xorl %eax, %eax
callq 0x30f0
movq 0x10(%rbx), %rbx
testq %rbx, %rbx
jne 0xd6d2
jmp 0xd75e
xorl %r14d, %r14d
testq %r13, %r13
je 0xd7c9
testl %r12d, %r12d
je 0xd7b5
movl $0x7b, %edi
callq 0x3040
cmpl $0x0, 0xbae3(%rip)      # 0x1925c
je 0xd7a7
xorl %r15d, %r15d
movq 0xb823(%rip), %rbx      # 0x18fa8
cmpw $0x0, 0x10(%rsp,%r15,2)
jne 0xd799
movq (%rbx), %rsi
movl %r15d, %edi
callq 0x3130
incq %r15
movl 0xbaba(%rip), %eax      # 0x1925c
cmpq %rax, %r15
jne 0xd785
leaq 0x5943(%rip), %rdi      # 0x130f1
xorl %eax, %eax
callq 0x30f0
movq 0x28(%r13), %rsi
leaq 0x593a(%rip), %rdi      # 0x130fa
xorl %eax, %eax
callq 0x30f0
jmp 0xd7d7
leaq 0x5911(%rip), %rdi      # 0x130e1
xorl %eax, %eax
callq 0x30f0
testq %r14, %r14
movq 0x8(%rsp), %r13
je 0xd825
movq 0xe4b0(%rip), %rax      # 0x1bc98
movq 0xe4b9(%rip), %rcx      # 0x1bca8
movq 0xe4d2(%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 0xd7f6
movq %rdx, 0xe4b1(%rip)      # 0x1bcc8
movq %rcx, 0xe48a(%rip)      # 0x1bca8
movq %rax, 0xe473(%rip)      # 0x1bc98
cmpq $0x0, 0x8(%r13)
je 0xd880
leaq 0x58d7(%rip), %rdi      # 0x1310a
xorl %eax, %eax
callq 0x30f0
movq 0x8(%r13), %r15
testq %r15, %r15
je 0xd876
leaq 0x58c6(%rip), %r14      # 0x13110
movq 0x8(%r15), %rax
movq 0x28(%rax), %rsi
movq %r14, %rdi
xorl %eax, %eax
callq 0x30f0
cmpq $0x0, 0x10(%r15)
je 0xd86d
movl $0x2c, %edi
callq 0x3040
movq 0x10(%r15), %r15
testq %r15, %r15
jne 0xd84a
movl $0x7d, %edi
callq 0x3040
movq 0x10(%r13), %r12
testq %r12, %r12
je 0xd8e7
movq (%r12), %r15
leaq 0x5880(%rip), %r14      # 0x13114
cmpw $0x0, 0xe43c(%rip)      # 0x1bcd8
je 0xd8ad
movl (%r15), %eax
movq (%r12), %rcx
cmpl (%rcx), %eax
cmovgq %rcx, %r15
jmp 0xd8c1
movq (%r12), %rax
movl (%rax), %esi
movq 0x8(%rax), %rdx
movq %r14, %rdi
xorl %eax, %eax
callq 0x30f0
movq 0x8(%r12), %r12
testq %r12, %r12
jne 0xd894
cmpw $0x0, 0xe405(%rip)      # 0x1bcd8
je 0xd8e7
movq 0x8(%r15), %rsi
leaq 0x5841(%rip), %rdi      # 0x13121
xorl %eax, %eax
callq 0x30f0
movl $0xa, %edi
callq 0x3040
movq (%r13), %rbx
testq %rbx, %rbx
je 0xd909
movq 0x8(%rbx), %rdi
callq 0xd5e3
movq 0x10(%rbx), %rbx
jmp 0xd8f5
movq 0x8(%r13), %rbx
testq %rbx, %rbx
je 0xd921
movq 0x8(%rbx), %rdi
callq 0xd5e3
movq 0x10(%rbx), %rbx
jmp 0xd90d
addq $0x218, %rsp            # imm = 0x218
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq