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

	for (regExp = dfa; regExp != NULL; regExp = regExp->next) {
		if (regExp->transitions != NULL) {
			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]) {
					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) {
				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) {
							TREE node = FindNode(tokenSets, tr->destination->info, TokenSetCmp);
							if (node != NULL) {
								VerifyTokenOverlap(GetKey(node));
							}
						}
					}
				}
			}
			if (mState != NULL) {
				TREE node = FindNode(tokenSets, mState->info, TokenSetCmp);
				if (node != NULL) {
					VerifyTokenOverlap(GetKey(node));
				}
			}
			RemoveSet(transitions);
		}
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x208, %rsp            # imm = 0x208
movq %rdi, %rbx
callq 0xc75e
testq %rbx, %rbx
je 0x7150
movl %eax, %ebp
cmpq $0x0, (%rbx)
je 0x7143
callq 0xc75e
testl %eax, %eax
je 0x701f
movl %eax, %edx
addq %rdx, %rdx
movq %rsp, %rdi
xorl %esi, %esi
callq 0x3120
movq (%rbx), %r14
testq %r14, %r14
je 0x7105
movq %r14, %rax
movslq (%rax), %rcx
cmpw $0x0, (%rsp,%rcx,2)
jne 0x7040
decl %ebp
movw $0xffff, (%rsp,%rcx,2)  # imm = 0xFFFF
movq 0x10(%rax), %rax
testq %rax, %rax
jne 0x702e
testq %r14, %r14
je 0x7105
movq %r14, %rax
xorl %r15d, %r15d
movq 0x8(%rax), %rcx
cmpq %r15, %rcx
je 0x7087
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 0x7066
cmpl %ebp, %edx
cmovgl %edx, %ebp
cmovgq %rcx, %r15
movq 0x10(%rax), %rax
testq %rax, %rax
jne 0x7058
xorl %r12d, %r12d
testq %r14, %r14
je 0x710a
movq 0x8(%r14), %rdi
cmpq %r15, %rdi
je 0x70ff
movq %r12, %rsi
callq 0xc937
testw %ax, %ax
jne 0x70ff
movq 0x8(%r14), %rdi
movq %r12, %rsi
callq 0xc874
movq %rax, %r12
movq %r14, %r13
movq 0x8(%r14), %rax
cmpq %rax, 0x8(%r13)
jne 0x70f6
movq 0x12a7f(%rip), %rdi     # 0x19b50
movq 0x10(%rax), %rsi
leaq 0x884(%rip), %rdx       # 0x7960
callq 0xbca0
testq %rax, %rax
je 0x70f6
movq %rax, %rdi
callq 0xbc07
movq %rax, %rdi
callq 0x7a51
movq 0x10(%r13), %r13
testq %r13, %r13
jne 0x70c0
movq 0x10(%r14), %r14
jmp 0x7093
xorl %r12d, %r12d
jmp 0x713b
testq %r15, %r15
je 0x713b
movq 0x12a3a(%rip), %rdi     # 0x19b50
movq 0x10(%r15), %rsi
leaq 0x83f(%rip), %rdx       # 0x7960
callq 0xbca0
testq %rax, %rax
je 0x713b
movq %rax, %rdi
callq 0xbc07
movq %rax, %rdi
callq 0x7a51
movq %r12, %rdi
callq 0xc8d8
movq 0x18(%rbx), %rbx
testq %rbx, %rbx
jne 0x6ffd
addq $0x208, %rsp            # imm = 0x208
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq