// File: AndrewAlbert[P]Compiler-Theory/SourceCode/codeGenerator.cpp
// Function: codeGenerator::createEntry(int, int)
void codeGenerator::createEntry( int lPos, int uPos ){
	if( lPos == uPos ){
		fprintf( oFile, "   goto %s;\n", ( branchTable[lPos] ).c_str() );
	}
	else{
		int mPos = ( lPos + uPos )/2;
		int key = mPos;
		string branchTrue = branchTableLabelTrue(mPos, true);
		string branchFalse = branchTableLabelTrue(mPos, false);

		fprintf( oFile, "   iReg[0] = %d;\n", key );
		fprintf( oFile, "   iReg[0] = TP_reg > iReg[0];\n" );
		
		fprintf( oFile, "   if( iReg[0] ) goto %s;\n", branchTrue.c_str() );
		fprintf( oFile, "   goto %s;\n", branchFalse.c_str() );
		
		fprintf( oFile, "\n%s:\n", branchTrue.c_str() );
		createEntry( mPos + 1, uPos );
		
		fprintf( oFile, "\n%s:\n", branchFalse.c_str() );
		createEntry( lPos, mPos );
		return;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xb0, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x70(%rbp)
movl -0xc(%rbp), %eax
cmpl -0x10(%rbp), %eax
jne 0x1ef16
movq -0x70(%rbp), %rdi
movq 0x308(%rdi), %rax
movq %rax, -0x78(%rbp)
addq $0xf0, %rdi
leaq -0xc(%rbp), %rsi
callq 0x1f530
movq %rax, %rdi
callq 0x3120
movq -0x78(%rbp), %rdi
movq %rax, %rdx
leaq 0x8490(%rip), %rsi      # 0x2739a
movb $0x0, %al
callq 0x3380
jmp 0x1f0d1
movq -0x70(%rbp), %rsi
movl -0xc(%rbp), %eax
movl -0x10(%rbp), %ecx
addl %ecx, %eax
movl %eax, %ecx
shrl $0x1f, %ecx
addl %ecx, %eax
sarl %eax
movl %eax, -0x14(%rbp)
movl -0x14(%rbp), %eax
movl %eax, -0x18(%rbp)
movl -0x14(%rbp), %edx
leaq -0x38(%rbp), %rdi
movl $0x1, %ecx
callq 0x1f0f0
movq -0x70(%rbp), %rsi
movl -0x14(%rbp), %edx
leaq -0x58(%rbp), %rdi
xorl %ecx, %ecx
callq 0x1f0f0
jmp 0x1ef59
movq -0x70(%rbp), %rax
movq 0x308(%rax), %rdi
movl -0x18(%rbp), %edx
leaq 0x87c9(%rip), %rsi      # 0x27737
xorl %eax, %eax
movb %al, -0x79(%rbp)
callq 0x3380
movq -0x70(%rbp), %rcx
movb -0x79(%rbp), %al
movq 0x308(%rcx), %rdi
leaq 0x87bc(%rip), %rsi      # 0x27749
callq 0x3380
movq -0x70(%rbp), %rax
movq 0x308(%rax), %rax
movq %rax, -0xa0(%rbp)
leaq -0x38(%rbp), %rdi
movq %rdi, -0x90(%rbp)
callq 0x3120
movq -0xa0(%rbp), %rdi
movq %rax, %rdx
movb -0x79(%rbp), %al
leaq 0x87a1(%rip), %rsi      # 0x27769
callq 0x3380
movq -0x70(%rbp), %rax
movq 0x308(%rax), %rax
movq %rax, -0x98(%rbp)
leaq -0x58(%rbp), %rdi
callq 0x3120
movq -0x98(%rbp), %rdi
movq %rax, %rdx
movb -0x79(%rbp), %al
leaq 0x839e(%rip), %rsi      # 0x2739a
callq 0x3380
movq -0x90(%rbp), %rdi
movq -0x70(%rbp), %rax
movq 0x308(%rax), %rax
movq %rax, -0x88(%rbp)
callq 0x3120
movq -0x88(%rbp), %rdi
movq %rax, %rdx
movb -0x79(%rbp), %al
leaq 0x82ac(%rip), %rsi      # 0x272df
callq 0x3380
movq -0x70(%rbp), %rdi
movl -0x14(%rbp), %esi
incl %esi
movl -0x10(%rbp), %edx
callq 0x1eeb0
jmp 0x1f04b
movq -0x70(%rbp), %rax
movq 0x308(%rax), %rax
movq %rax, -0xa8(%rbp)
leaq -0x58(%rbp), %rdi
callq 0x3120
movq -0xa8(%rbp), %rdi
movq %rax, %rdx
leaq 0x8268(%rip), %rsi      # 0x272df
xorl %eax, %eax
callq 0x3380
movq -0x70(%rbp), %rdi
movl -0xc(%rbp), %esi
movl -0x14(%rbp), %edx
callq 0x1eeb0
jmp 0x1f08f
leaq -0x58(%rbp), %rdi
callq 0x31a0
leaq -0x38(%rbp), %rdi
callq 0x31a0
jmp 0x1f0d1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x1f0c6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x58(%rbp), %rdi
callq 0x31a0
leaq -0x38(%rbp), %rdi
callq 0x31a0
jmp 0x1f0da
addq $0xb0, %rsp
popq %rbp
retq
movq -0x60(%rbp), %rdi
callq 0x3420
nopw %cs:(%rax,%rax)