// File: /workspace/github_c_makefile_star2_O1/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 $0x218, %rsp            # imm = 0x218
movq %rdi, %rbx
callq 0xcaae
testq %rbx, %rbx
je 0x7279
movl %eax, %ebp
leaq 0x9b0(%rip), %r14       # 0x7ae3
cmpq $0x0, (%rbx)
je 0x726c
callq 0xcaae
testl %eax, %eax
je 0x7157
movl %eax, %edx
addq %rdx, %rdx
leaq 0x10(%rsp), %rdi
xorl %esi, %esi
callq 0x3120
movq (%rbx), %rax
testq %rax, %rax
je 0x7179
movslq (%rax), %rcx
cmpw $0x0, 0x10(%rsp,%rcx,2)
jne 0x7173
decl %ebp
movw $0xffff, 0x10(%rsp,%rcx,2) # imm = 0xFFFF
movq 0x10(%rax), %rax
jmp 0x715a
movq (%rbx), %rax
xorl %r13d, %r13d
testq %rax, %rax
je 0x71b9
movq 0x8(%rax), %rcx
cmpq %r13, %rcx
je 0x71b3
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 0x7192
cmpl %ebp, %edx
cmovgl %edx, %ebp
cmovgq %rcx, %r13
movq 0x10(%rax), %rax
jmp 0x717f
movq %rbx, 0x8(%rsp)
movq (%rbx), %rbx
xorl %r12d, %r12d
testq %rbx, %rbx
je 0x7232
movq 0x8(%rbx), %rdi
cmpq %r13, %rdi
je 0x722c
movq %r12, %rsi
callq 0xcc87
testw %ax, %ax
jne 0x722c
movq 0x8(%rbx), %rdi
movq %r12, %rsi
callq 0xcbc4
movq %rax, %r12
movq %rbx, %r15
movq 0x8(%rbx), %rax
cmpq %rax, 0x8(%r15)
jne 0x7223
movq 0x1294e(%rip), %rdi     # 0x19b50
movq 0x10(%rax), %rsi
movq %r14, %rdx
callq 0xbf59
testq %rax, %rax
je 0x7223
movq %rax, %rdi
callq 0xbec6
movq %rax, %rdi
callq 0x7bc7
movq 0x10(%r15), %r15
testq %r15, %r15
jne 0x71f1
movq 0x10(%rbx), %rbx
jmp 0x71c4
testq %r13, %r13
je 0x725f
movq 0x12912(%rip), %rdi     # 0x19b50
movq 0x10(%r13), %rsi
movq %r14, %rdx
callq 0xbf59
testq %rax, %rax
je 0x725f
movq %rax, %rdi
callq 0xbec6
movq %rax, %rdi
callq 0x7bc7
movq %r12, %rdi
callq 0xcc28
movq 0x8(%rsp), %rbx
movq 0x18(%rbx), %rbx
testq %rbx, %rbx
jne 0x7133
addq $0x218, %rsp            # imm = 0x218
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq