// File: /workspace/github_cpp_makefile_star2_O3/AndrewAlbert[P]Compiler-Theory/SourceCode/codeGenerator.cpp
// Function: codeGenerator::popStack[abi:cxx11](char, int)
string codeGenerator::popStack( char stackID, int type ){
	if( !ShouldGenerate() ) return "";
	string returnStr;
	switch( stackID ){
		case 'L':
			if(leftStack.size() == 0){
				cout << "LEFT STACK EMPTY!\n";
				return "";
			}
			returnStr = leftStack.top();
			leftStack.pop();
			return returnStr;
		case 'E':
			if(exprStack.size() == 0){
				cout << "EXPR STACK EMPTY!\n";
				return "";
			}
			returnStr = exprStack.top();
			exprStack.pop();
			if( type == TYPE_FLOAT) freg_in_use--;
			else ireg_in_use--;
			return returnStr;
		case 'R':
			if(rightStack.size() == 0){
				cout << "RIGHT STACK EMPTY!\n";
				return "";
			}
			returnStr = rightStack.top();
			rightStack.pop();
			return returnStr;
		default:
			cout << "INVALID STACK ID!\n";
			return "invalid stack id";
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
cmpb $0x0, 0x330(%rsi)
je 0x11b3b
movq %rsi, %r14
leaq 0x18(%rsp), %r15
movq %r15, -0x10(%r15)
movq $0x0, -0x8(%r15)
movb $0x0, (%r15)
movsbl %dl, %eax
cmpl $0x45, %eax
je 0x11be6
cmpl $0x52, %eax
je 0x11b59
cmpl $0x4c, %eax
jne 0x11c75
movq 0x218(%r14), %rax
movq %rax, %rdx
subq 0x1f8(%r14), %rdx
shrq $0x3, %rdx
cmpq $0x1, %rax
adcq $-0x1, %rdx
shlq $0x4, %rdx
movq 0x1f0(%r14), %rdi
movq 0x200(%r14), %rsi
movq 0x208(%r14), %rcx
movq %rsi, %r8
subq %rcx, %r8
sarq $0x5, %r8
addq %rdx, %r8
subq 0x1e0(%r14), %rdi
sarq $0x5, %rdi
addq %r8, %rdi
jne 0x11d11
movq 0x104cc(%rip), %rdi     # 0x21fd8
leaq 0x927f(%rip), %rsi      # 0x1ad92
movl $0x12, %edx
callq 0x2230
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
leaq 0x8e32(%rip), %rdx      # 0x1a95d
movq %rbx, %rdi
movq %rdx, %rsi
callq 0x3c42
jmp 0x11d7e
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
leaq 0x8e14(%rip), %rdx      # 0x1a95d
movq %rbx, %rdi
movq %rdx, %rsi
callq 0x3c42
jmp 0x11d95
movq 0x1c8(%r14), %rax
movq %rax, %rdx
subq 0x1a8(%r14), %rdx
shrq $0x3, %rdx
cmpq $0x1, %rax
adcq $-0x1, %rdx
shlq $0x4, %rdx
movq 0x1a0(%r14), %rdi
movq 0x1b0(%r14), %rsi
movq 0x1b8(%r14), %rcx
movq %rsi, %r8
subq %rcx, %r8
sarq $0x5, %r8
addq %rdx, %r8
subq 0x190(%r14), %rdi
sarq $0x5, %rdi
addq %r8, %rdi
jne 0x11caf
movq 0x10421(%rip), %rdi     # 0x21fd8
leaq 0x91fa(%rip), %rsi      # 0x1adb8
movl $0x13, %edx
callq 0x2230
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
leaq 0x8d87(%rip), %rdx      # 0x1a95d
movq %rbx, %rdi
movq %rdx, %rsi
callq 0x3c42
jmp 0x11d7e
movl %ecx, %ebp
movq 0x178(%r14), %rax
movq %rax, %rdx
subq 0x158(%r14), %rdx
shrq $0x3, %rdx
cmpq $0x1, %rax
adcq $-0x1, %rdx
shlq $0x4, %rdx
movq 0x150(%r14), %rdi
movq 0x160(%r14), %rsi
movq 0x168(%r14), %rcx
movq %rsi, %r8
subq %rcx, %r8
sarq $0x5, %r8
addq %rdx, %r8
subq 0x140(%r14), %rdi
sarq $0x5, %rdi
addq %r8, %rdi
jne 0x11cd4
movq 0x10392(%rip), %rdi     # 0x21fd8
leaq 0x9158(%rip), %rsi      # 0x1ada5
movl $0x12, %edx
callq 0x2230
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
leaq 0x8cf8(%rip), %rdx      # 0x1a95d
movq %rbx, %rdi
movq %rdx, %rsi
callq 0x3c42
jmp 0x11d7e
movq 0x1035c(%rip), %rdi     # 0x21fd8
leaq 0x9149(%rip), %rsi      # 0x1adcc
movl $0x12, %edx
callq 0x2230
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
leaq 0x9144(%rip), %rsi      # 0x1addf
leaq 0x914d(%rip), %rdx      # 0x1adef
movq %rbx, %rdi
callq 0x3c42
jmp 0x11d7e
cmpq %rcx, %rsi
jne 0x11cbd
movl $0x200, %esi            # imm = 0x200
addq -0x8(%rax), %rsi
addq $-0x20, %rsi
leaq 0x8(%rsp), %rdi
callq 0x2120
addq $0x180, %r14            # imm = 0x180
jmp 0x11d34
cmpq %rcx, %rsi
jne 0x11ce2
movl $0x200, %esi            # imm = 0x200
addq -0x8(%rax), %rsi
addq $-0x20, %rsi
leaq 0x8(%rsp), %rdi
callq 0x2120
leaq 0x130(%r14), %rdi
callq 0x1775e
cmpl $0x10b, %ebp            # imm = 0x10B
jne 0x11da3
decl 0x124(%r14)
jmp 0x11d3c
cmpq %rcx, %rsi
jne 0x11d1f
movl $0x200, %esi            # imm = 0x200
addq -0x8(%rax), %rsi
addq $-0x20, %rsi
leaq 0x8(%rsp), %rdi
callq 0x2120
addq $0x1d0, %r14            # imm = 0x1D0
movq %r14, %rdi
callq 0x1775e
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
movq 0x8(%rsp), %rcx
cmpq %r15, %rcx
je 0x11d5b
movq %rcx, (%rbx)
movq 0x18(%rsp), %rax
movq %rax, 0x10(%rbx)
jmp 0x11d62
movups (%r15), %xmm0
movups %xmm0, (%rax)
movq 0x10(%rsp), %rax
movq %rax, 0x8(%rbx)
movq %r15, 0x8(%rsp)
movq $0x0, 0x10(%rsp)
movb $0x0, 0x18(%rsp)
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x11d95
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x2200
movq %rbx, %rax
addq $0x28, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
decl 0x120(%r14)
jmp 0x11d3c
jmp 0x11db4
jmp 0x11db4
jmp 0x11db4
jmp 0x11db4
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x11dce
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x2200
movq %rbx, %rdi
callq 0x2330