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

	printf("int PMatch(char *str)\n{\n    int pos = 0, lLen = -1;\n\n");
	for (state = dfa; state != NULL; state = state->next) {
		tCount = charSetSize;
		for (i = 0; i != charSetSize; i++) cSet[i] = false;
		for (tr = state->transitions; tr != NULL; tr = tr->next) {
			cSet[tr->transitionChar] = true;
			mCount--;
			tCount--;
		}
		/* mCount is nr. of fails, mState == NULL, the fail state */
		for (tr = state->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 */
		printf("  l%ld:\n", state->state.number);
		if (state->info != NULL) {
			Answer first;
			printf("    lLen = pos;\n");
			for (elt = state->info, first = elt->element; elt != NULL; elt = elt->next) {
				if (singleAnswer) {
					if (first->number > ((Answer) elt->element)->number) {
						first = elt->element;
					}
				} else {
					printf("    Accept(%d, \"%s\");\n", ((Answer) elt->element)->number, (const char*) ((Answer) elt->element)->info);
				}
			}
			if (singleAnswer) {
				printf("    Accept(\"%s\");\n", (const char*) first->info);
			}
		}
		if (state->transitions == NULL) {
			printf("    goto fail;\n");
		} else {
			printf("    if (*str == '\\0') goto fail;\n");
			printf("    pos++;\n    switch (*str++)\n    {\n");
			transitions = NULL;
			for (tr = state->transitions; tr != NULL; tr = tr->next) {
				if (tr->destination != mState && !SetMember(tr->destination, transitions)) {
					transitions = AddElement(tr->destination, transitions);
					for (tr2 = tr; tr2 != NULL; tr2 = tr2->next) {
						if (tr2->destination == tr->destination) {
							printf("        case ");
							if (tr2->transitionChar < ' ' || tr2->transitionChar > '~') {
								printf("\\%03x:\n", tr2->transitionChar);
							} else {
								printf("'%c':\n", tr2->transitionChar);
							}
						}
					}
					printf("            goto l%ld;\n", tr->destination->state.number);
				}
			}
			if (mState == NULL) {
				printf("        default:\n            goto fail;\n");
			} else {
				if (tCount != 0) {
					for (i = 0; i != charSetSize; i++) {
						if (!cSet[i]) {
							printf("        case ");
							if (i < ' ' || i > '~') {
								printf("\\%03x:\n", i);
							} else {
								printf("'%c':\n", i);
							}
						}
					}
					printf("            goto fail;\n");
				}
				printf("        default:\n            goto l%ld;\n", mState->state.number);
			}
			RemoveSet(transitions);
			printf("    }\n");
		}
	}
	printf("  fail:\n    return (lLen);\n}\n");
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x260, %rsp            # imm = 0x260
movq %rdi, -0x8(%rbp)
movl 0xc26f(%rip), %eax      # 0x202a4
movl %eax, -0x2c(%rbp)
movq $0x0, -0x38(%rbp)
leaq 0x704f(%rip), %rdi      # 0x1b096
movb $0x0, %al
callq 0x30e0
movq -0x8(%rbp), %rax
movq %rax, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x14460
movl 0xc23d(%rip), %eax      # 0x202a4
movl %eax, -0x48(%rbp)
movl $0x0, -0x44(%rbp)
movl -0x44(%rbp), %eax
cmpl 0xc22a(%rip), %eax      # 0x202a4
je 0x14095
movslq -0x44(%rbp), %rax
movw $0x0, -0x250(%rbp,%rax,2)
movl -0x44(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x44(%rbp)
jmp 0x14071
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x140d8
movq -0x18(%rbp), %rax
movslq (%rax), %rax
movw $0xffff, -0x250(%rbp,%rax,2) # imm = 0xFFFF
movl -0x2c(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x2c(%rbp)
movl -0x48(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x48(%rbp)
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x18(%rbp)
jmp 0x140a0
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x14168
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
cmpq -0x38(%rbp), %rax
je 0x14155
movl $0x0, -0x30(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0x14139
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x18(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jne 0x14129
movl -0x30(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x30(%rbp)
jmp 0x1412b
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x20(%rbp)
jmp 0x14107
movl -0x30(%rbp), %eax
cmpl -0x2c(%rbp), %eax
jle 0x14153
movl -0x30(%rbp), %eax
movl %eax, -0x2c(%rbp)
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x38(%rbp)
jmp 0x14155
jmp 0x14157
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x18(%rbp)
jmp 0x140e3
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rsi
leaq 0x6f55(%rip), %rdi      # 0x1b0cc
movb $0x0, %al
callq 0x30e0
movq -0x10(%rbp), %rax
cmpq $0x0, 0x10(%rax)
je 0x14241
leaq 0x6f41(%rip), %rdi      # 0x1b0d5
movb $0x0, %al
callq 0x30e0
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x258(%rbp)
cmpq $0x0, -0x40(%rbp)
je 0x1421c
cmpw $0x0, 0xed74(%rip)      # 0x22f38
je 0x141ea
movq -0x258(%rbp), %rax
movl (%rax), %eax
movq -0x40(%rbp), %rcx
movq (%rcx), %rcx
cmpl (%rcx), %eax
jle 0x141e8
movq -0x40(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x258(%rbp)
jmp 0x1420c
movq -0x40(%rbp), %rax
movq (%rax), %rax
movl (%rax), %esi
movq -0x40(%rbp), %rax
movq (%rax), %rax
movq 0x8(%rax), %rdx
leaq 0x6ee1(%rip), %rdi      # 0x1b0e6
movb $0x0, %al
callq 0x30e0
jmp 0x1420e
movq -0x40(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x40(%rbp)
jmp 0x141b5
cmpw $0x0, 0xed14(%rip)      # 0x22f38
je 0x1423f
movq -0x258(%rbp), %rax
movq 0x8(%rax), %rsi
leaq 0x6ec5(%rip), %rdi      # 0x1b0fd
movb $0x0, %al
callq 0x30e0
jmp 0x14241
movq -0x10(%rbp), %rax
cmpq $0x0, (%rax)
jne 0x1425e
leaq 0x6f3c(%rip), %rdi      # 0x1b18e
movb $0x0, %al
callq 0x30e0
jmp 0x1444d
leaq 0x6eab(%rip), %rdi      # 0x1b110
movb $0x0, %al
callq 0x30e0
leaq 0x6ebf(%rip), %rdi      # 0x1b132
movb $0x0, %al
callq 0x30e0
movq $0x0, -0x28(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x14384
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
cmpq -0x38(%rbp), %rax
je 0x14371
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x28(%rbp), %rsi
callq 0x11e60
cmpw $0x0, %ax
jne 0x14371
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x28(%rbp), %rsi
callq 0x11cc0
movq %rax, -0x28(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0x14357
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x18(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jne 0x14347
leaq 0x6e56(%rip), %rdi      # 0x1b158
movb $0x0, %al
callq 0x30e0
movq -0x20(%rbp), %rax
cmpl $0x20, (%rax)
jl 0x1431b
movq -0x20(%rbp), %rax
cmpl $0x7e, (%rax)
jle 0x14331
movq -0x20(%rbp), %rax
movl (%rax), %esi
leaq 0x6e3e(%rip), %rdi      # 0x1b166
movb $0x0, %al
callq 0x30e0
jmp 0x14345
movq -0x20(%rbp), %rax
movl (%rax), %esi
leaq 0x6e30(%rip), %rdi      # 0x1b16e
movb $0x0, %al
callq 0x30e0
jmp 0x14347
jmp 0x14349
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x20(%rbp)
jmp 0x142e2
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movq 0x28(%rax), %rsi
leaq 0x6e45(%rip), %rdi      # 0x1b1af
movb $0x0, %al
callq 0x30e0
jmp 0x14373
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x18(%rbp)
jmp 0x1428d
cmpq $0x0, -0x38(%rbp)
jne 0x1439e
leaq 0x6de3(%rip), %rdi      # 0x1b175
movb $0x0, %al
callq 0x30e0
jmp 0x14436
cmpl $0x0, -0x48(%rbp)
je 0x14420
movl $0x0, -0x44(%rbp)
movl -0x44(%rbp), %eax
cmpl 0xbef0(%rip), %eax      # 0x202a4
je 0x14412
movslq -0x44(%rbp), %rax
cmpw $0x0, -0x250(%rbp,%rax,2)
jne 0x14405
leaq 0x6d8c(%rip), %rdi      # 0x1b158
movb $0x0, %al
callq 0x30e0
cmpl $0x20, -0x44(%rbp)
jl 0x143df
cmpl $0x7e, -0x44(%rbp)
jle 0x143f2
movl -0x44(%rbp), %esi
leaq 0x6d7d(%rip), %rdi      # 0x1b166
movb $0x0, %al
callq 0x30e0
jmp 0x14403
movl -0x44(%rbp), %esi
leaq 0x6d72(%rip), %rdi      # 0x1b16e
movb $0x0, %al
callq 0x30e0
jmp 0x14405
jmp 0x14407
movl -0x44(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x44(%rbp)
jmp 0x143ab
leaq 0x6d6d(%rip), %rdi      # 0x1b186
movb $0x0, %al
callq 0x30e0
movq -0x38(%rbp), %rax
movq 0x28(%rax), %rsi
leaq 0x6d6f(%rip), %rdi      # 0x1b19e
movb $0x0, %al
callq 0x30e0
movq -0x28(%rbp), %rdi
callq 0x11d90
leaq 0x6d81(%rip), %rdi      # 0x1b1c7
movb $0x0, %al
callq 0x30e0
jmp 0x1444f
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x10(%rbp)
jmp 0x14056
leaq 0x6d67(%rip), %rdi      # 0x1b1ce
movb $0x0, %al
callq 0x30e0
addq $0x260, %rsp            # imm = 0x260
popq %rbp
retq
nopw (%rax,%rax)