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

	while (regExp != NULL) {
		mState = NULL;
		if (regExp->transitions == NULL) {
			regExp->state.number = -1;
		} else {
			regExp->state.number = sNum;
			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 = 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)
							sNum++;
				}
			}
			if (mState == NULL) {
				sNum++;
			} else {
				if (tCount != 0) {
					for (i = 0; i != CharSetSize(); i++) {
						if (!cSet[i]) sNum++;
					}
				}
				sNum++;
			}
			RemoveSet(transitions);
		}
		regExp = regExp->next;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x240, %rsp            # imm = 0x240
movq %rdi, -0x8(%rbp)
callq 0x11a70
movl %eax, -0x24(%rbp)
movq $0x0, -0x30(%rbp)
movl $0x0, -0x23c(%rbp)
cmpq $0x0, -0x8(%rbp)
je 0x74a5
movq $0x0, -0x30(%rbp)
movq -0x8(%rbp), %rax
cmpq $0x0, (%rax)
jne 0x7207
movq -0x8(%rbp), %rax
movq $-0x1, 0x28(%rax)
jmp 0x7494
movslq -0x23c(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x28(%rax)
movq $0x0, -0x20(%rbp)
callq 0x11a70
movl %eax, -0x238(%rbp)
movl $0x0, -0x234(%rbp)
movl -0x234(%rbp), %eax
cmpl -0x238(%rbp), %eax
je 0x7263
movslq -0x234(%rbp), %rax
movw $0x0, -0x230(%rbp,%rax,2)
movl -0x234(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x234(%rbp)
jmp 0x7233
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x72c0
movq -0x10(%rbp), %rax
movslq (%rax), %rax
cmpw $0x0, -0x230(%rbp,%rax,2)
jne 0x72b0
movl -0x24(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x24(%rbp)
movq -0x10(%rbp), %rax
movslq (%rax), %rax
movw $0xffff, -0x230(%rbp,%rax,2) # imm = 0xFFFF
movl -0x238(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x238(%rbp)
jmp 0x72b2
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x10(%rbp)
jmp 0x726e
movl -0x238(%rbp), %eax
movl %eax, -0x24(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x7359
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
cmpq -0x30(%rbp), %rax
je 0x7346
movl $0x0, -0x28(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x732a
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x10(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jne 0x731a
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
jmp 0x731c
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x18(%rbp)
jmp 0x72f8
movl -0x28(%rbp), %eax
cmpl -0x24(%rbp), %eax
jle 0x7344
movl -0x28(%rbp), %eax
movl %eax, -0x24(%rbp)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x30(%rbp)
jmp 0x7346
jmp 0x7348
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x10(%rbp)
jmp 0x72d4
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x73fe
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
cmpq -0x30(%rbp), %rax
je 0x73eb
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x20(%rbp), %rsi
callq 0x11e60
cmpw $0x0, %ax
jne 0x73eb
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x20(%rbp), %rsi
callq 0x11cc0
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x73e9
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x10(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jne 0x73d9
movl -0x23c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x23c(%rbp)
jmp 0x73db
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x18(%rbp)
jmp 0x73b1
jmp 0x73eb
jmp 0x73ed
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x10(%rbp)
jmp 0x7364
cmpq $0x0, -0x30(%rbp)
jne 0x7416
movl -0x23c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x23c(%rbp)
jmp 0x748b
cmpl $0x0, -0x238(%rbp)
je 0x747c
movl $0x0, -0x234(%rbp)
movl -0x234(%rbp), %eax
movl %eax, -0x240(%rbp)
callq 0x11a70
movl %eax, %ecx
movl -0x240(%rbp), %eax
cmpl %ecx, %eax
je 0x747a
movslq -0x234(%rbp), %rax
cmpw $0x0, -0x230(%rbp,%rax,2)
jne 0x7467
movl -0x23c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x23c(%rbp)
jmp 0x7469
movl -0x234(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x234(%rbp)
jmp 0x7429
jmp 0x747c
movl -0x23c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x23c(%rbp)
movq -0x20(%rbp), %rdi
callq 0x11d90
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x8(%rbp)
jmp 0x71d9
addq $0x240, %rsp            # imm = 0x240
popq %rbp
retq
nop