// File: /workspace/github_c_makefile_star2_O0/theovosse[P]llgen/llgen.c
// Function: FormatRegExp
static void FormatRegExp(FILE *f, RegExp dfa) {
	Transition tr, tr2;
	ESet transitions;
	int mCount = CharSetSize(), count;
	RegExp mState = NULL;
	Boolean cSet[256];
	int i, tCount;
	Boolean prntd = false;
	RegExp regExp;
	int sNum = 0;

	for (regExp = dfa; regExp != NULL; regExp = regExp->next) {
		if (prntd) fputs("\n", f);
		if (regExp->transitions != NULL) {
            PrintStateTransitionStart(f, regExp->state.number);
			prntd = true;
			mState = NULL;
			transitions = NULL;
			tCount = CharSetSize();
			for (i = 0; i != tCount; i++) cSet[i] = false;
			for (tr = regExp->transitions; tr != NULL; tr = tr->next) {
				if (!cSet[tr->transitionChar]) {
					cSet[tr->transitionChar] = true;
					tCount--;
				}
			}
			mCount = 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) {
				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) {
							if (prntd) prntd = false;
							else fputs("		  ", f);
                            PrintStateTransition(f, tr2->transitionChar, tr->destination->state.number, TokenSetName(tr->destination));
							sNum++;
						}
					}
				}
			}
			if (mState == NULL) {
				if (prntd) prntd = false;
				else fputs("		  ", f);
                PrintStateTransition(f, -1, -1, targetLanguage->nullValue);
				sNum++;
			} else {
				if (tCount != 0) {
					for (i = 0; i != CharSetSize(); i++) {
						if (!cSet[i]) {
							if (prntd) prntd = false;
							else fputs("		  ", f);
                            PrintStateTransition(f, i, -1, targetLanguage->nullValue);
							sNum++;
						}
					}
				}
				if (prntd) prntd = false;
				else fputs("		  ", f);
                PrintStateTransition(f, -1, mState->state.number, TokenSetName(mState));
				sNum++;
			}
			RemoveSet(transitions);
            PrintStateTransitionEnd(f);
		} else {
            PrintEmptyTransition(f, regExp->state.number);
        }
	}
	if (prntd) fputs("\n", f);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x290, %rsp            # imm = 0x290
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
callq 0x11a70
movl %eax, -0x2c(%rbp)
movq $0x0, -0x38(%rbp)
movw $0x0, -0x24a(%rbp)
movl $0x0, -0x25c(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x258(%rbp)
cmpq $0x0, -0x258(%rbp)
je 0x7988
cmpw $0x0, -0x24a(%rbp)
je 0x7519
movq -0x8(%rbp), %rsi
leaq 0x13bb6(%rip), %rdi     # 0x1b0ca
callq 0x3100
movq -0x258(%rbp), %rax
cmpq $0x0, (%rax)
je 0x795b
movq -0x8(%rbp), %rdi
movq -0x258(%rbp), %rax
movq 0x28(%rax), %rsi
callq 0x8a50
movw $0xffff, -0x24a(%rbp)   # imm = 0xFFFF
movq $0x0, -0x38(%rbp)
movq $0x0, -0x28(%rbp)
callq 0x11a70
movl %eax, -0x248(%rbp)
movl $0x0, -0x244(%rbp)
movl -0x244(%rbp), %eax
cmpl -0x248(%rbp), %eax
je 0x759c
movslq -0x244(%rbp), %rax
movw $0x0, -0x240(%rbp,%rax,2)
movl -0x244(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x244(%rbp)
jmp 0x756c
movq -0x258(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x75f3
movq -0x18(%rbp), %rax
movslq (%rax), %rax
cmpw $0x0, -0x240(%rbp,%rax,2)
jne 0x75e3
movq -0x18(%rbp), %rax
movslq (%rax), %rax
movw $0xffff, -0x240(%rbp,%rax,2) # imm = 0xFFFF
movl -0x248(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x248(%rbp)
jmp 0x75e5
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x18(%rbp)
jmp 0x75aa
movl -0x248(%rbp), %eax
movl %eax, -0x2c(%rbp)
movq -0x258(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x768f
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
cmpq -0x38(%rbp), %rax
je 0x767c
movl $0x0, -0x30(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0x7660
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x18(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jne 0x7650
movl -0x30(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x30(%rbp)
jmp 0x7652
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x20(%rbp)
jmp 0x762e
movl -0x30(%rbp), %eax
cmpl -0x2c(%rbp), %eax
jle 0x767a
movl -0x30(%rbp), %eax
movl %eax, -0x2c(%rbp)
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x38(%rbp)
jmp 0x767c
jmp 0x767e
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x18(%rbp)
jmp 0x760a
movq -0x258(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x77c2
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
cmpq -0x38(%rbp), %rax
je 0x77af
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x28(%rbp), %rsi
callq 0x11e60
cmpw $0x0, %ax
jne 0x77af
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 0x77ad
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x18(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jne 0x779a
cmpw $0x0, -0x24a(%rbp)
je 0x7728
movw $0x0, -0x24a(%rbp)
jmp 0x7738
movq -0x8(%rbp), %rsi
leaq 0x12018(%rip), %rdi     # 0x1974b
callq 0x3100
movq -0x8(%rbp), %rax
movq %rax, -0x278(%rbp)
movq -0x20(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x26c(%rbp)
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movq 0x28(%rax), %rax
movq %rax, -0x268(%rbp)
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x8ac0
movq -0x278(%rbp), %rdi
movl -0x26c(%rbp), %esi
movq -0x268(%rbp), %rdx
movq %rax, %rcx
callq 0x8a80
movl -0x25c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x25c(%rbp)
jmp 0x779c
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x20(%rbp)
jmp 0x76f2
jmp 0x77af
jmp 0x77b1
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x18(%rbp)
jmp 0x769d
cmpq $0x0, -0x38(%rbp)
jne 0x7822
cmpw $0x0, -0x24a(%rbp)
je 0x77de
movw $0x0, -0x24a(%rbp)
jmp 0x77ee
movq -0x8(%rbp), %rsi
leaq 0x11f62(%rip), %rdi     # 0x1974b
callq 0x3100
movq -0x8(%rbp), %rdi
movq 0x18977(%rip), %rax     # 0x20170
movq 0x40(%rax), %rcx
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
movq $-0x1, %rdx
callq 0x8a80
movl -0x25c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x25c(%rbp)
jmp 0x7947
cmpl $0x0, -0x248(%rbp)
je 0x78d5
movl $0x0, -0x244(%rbp)
movl -0x244(%rbp), %eax
movl %eax, -0x27c(%rbp)
callq 0x11a70
movl %eax, %ecx
movl -0x27c(%rbp), %eax
cmpl %ecx, %eax
je 0x78d3
movslq -0x244(%rbp), %rax
cmpw $0x0, -0x240(%rbp,%rax,2)
jne 0x78bd
cmpw $0x0, -0x24a(%rbp)
je 0x787d
movw $0x0, -0x24a(%rbp)
jmp 0x788d
movq -0x8(%rbp), %rsi
leaq 0x11ec3(%rip), %rdi     # 0x1974b
callq 0x3100
movq -0x8(%rbp), %rdi
movl -0x244(%rbp), %esi
movq 0x188d2(%rip), %rax     # 0x20170
movq 0x40(%rax), %rcx
movq $-0x1, %rdx
callq 0x8a80
movl -0x25c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x25c(%rbp)
jmp 0x78bf
movl -0x244(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x244(%rbp)
jmp 0x7839
jmp 0x78d5
cmpw $0x0, -0x24a(%rbp)
je 0x78ea
movw $0x0, -0x24a(%rbp)
jmp 0x78fa
movq -0x8(%rbp), %rsi
leaq 0x11e56(%rip), %rdi     # 0x1974b
callq 0x3100
movq -0x8(%rbp), %rax
movq %rax, -0x290(%rbp)
movq -0x38(%rbp), %rax
movq 0x28(%rax), %rax
movq %rax, -0x288(%rbp)
movq -0x38(%rbp), %rdi
callq 0x8ac0
movq -0x290(%rbp), %rdi
movq -0x288(%rbp), %rdx
movq %rax, %rcx
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x8a80
movl -0x25c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x25c(%rbp)
movq -0x28(%rbp), %rdi
callq 0x11d90
movq -0x8(%rbp), %rdi
callq 0x8b50
jmp 0x796f
movq -0x8(%rbp), %rdi
movq -0x258(%rbp), %rax
movq 0x28(%rax), %rsi
callq 0x8b80
jmp 0x7971
movq -0x258(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x258(%rbp)
jmp 0x74f1
cmpw $0x0, -0x24a(%rbp)
je 0x79a2
movq -0x8(%rbp), %rsi
leaq 0x1372d(%rip), %rdi     # 0x1b0ca
callq 0x3100
addq $0x290, %rsp            # imm = 0x290
popq %rbp
retq
nopl (%rax,%rax)