// File: /workspace/github_cpp_makefile_star2_O2/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 %r12
pushq %rbx
subq $0x30, %rsp
movq %rdi, %rbx
cmpb $0x0, 0x330(%rsi)
je 0xc9be
movq %rsi, %r14
leaq 0x20(%rsp), %r12
movq %r12, -0x10(%r12)
andq $0x0, -0x8(%r12)
movb $0x0, (%r12)
movsbl %dl, %eax
cmpl $0x45, %eax
je 0xca4b
cmpl $0x52, %eax
je 0xc9d7
cmpl $0x4c, %eax
jne 0xcab3
leaq 0x1d0(%r14), %r15
movq %r15, %rdi
callq 0x9f44
testq %rax, %rax
je 0xcb69
movq 0x200(%r14), %rsi
cmpq 0x208(%r14), %rsi
jne 0xc9ae
movq 0x218(%r14), %rax
movl $0x200, %esi            # imm = 0x200
addq -0x8(%rax), %rsi
addq $-0x20, %rsi
leaq 0x10(%rsp), %rdi
callq 0x2120
jmp 0xca1d
leaq 0x5f78(%rip), %rsi      # 0x1293d
leaq 0x10(%rsp), %rdx
movq %rbx, %rdi
callq 0x36b8
jmp 0xcb07
leaq 0x180(%r14), %r15
movq %r15, %rdi
callq 0x9f44
testq %rax, %rax
je 0xcb17
movq 0x1b0(%r14), %rsi
cmpq 0x1b8(%r14), %rsi
jne 0xca0f
movq 0x1c8(%r14), %rax
movl $0x200, %esi            # imm = 0x200
addq -0x8(%rax), %rsi
addq $-0x20, %rsi
leaq 0x10(%rsp), %rdi
callq 0x2120
movq %r15, %rdi
callq 0xfca4
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
movq 0x10(%rsp), %rcx
cmpq %r12, %rcx
je 0xcadc
movq %rcx, (%rbx)
movq 0x20(%rsp), %rax
movq %rax, 0x10(%rbx)
jmp 0xcae4
movl %ecx, %ebp
leaq 0x130(%r14), %r15
movq %r15, %rdi
callq 0x9f44
testq %rax, %rax
je 0xcb40
movq 0x160(%r14), %rsi
cmpq 0x168(%r14), %rsi
jne 0xca85
movq 0x178(%r14), %rax
movl $0x200, %esi            # imm = 0x200
addq -0x8(%rax), %rsi
addq $-0x20, %rsi
leaq 0x10(%rsp), %rdi
callq 0x2120
movq %r15, %rdi
callq 0xfca4
cmpl $0x10b, %ebp            # imm = 0x10B
jne 0xcb95
decl 0x124(%r14)
jmp 0xca25
movq 0xe516(%rip), %rdi      # 0x1afd0
leaq 0x62eb(%rip), %rsi      # 0x12dac
callq 0x21c0
leaq 0x62f2(%rip), %rsi      # 0x12dbf
leaq 0xf(%rsp), %rdx
movq %rbx, %rdi
callq 0x36b8
jmp 0xcafd
movups (%r12), %xmm0
movups %xmm0, (%rax)
movq 0x18(%rsp), %rax
movq %rax, 0x8(%rbx)
movq %r12, 0x10(%rsp)
andq $0x0, 0x18(%rsp)
movb $0x0, 0x20(%rsp)
leaq 0x10(%rsp), %rdi
callq 0x20f0
movq %rbx, %rax
addq $0x30, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq 0xe4b2(%rip), %rdi      # 0x1afd0
leaq 0x6273(%rip), %rsi      # 0x12d98
callq 0x21c0
leaq 0x5e0c(%rip), %rsi      # 0x1293d
leaq 0xf(%rsp), %rdx
movq %rbx, %rdi
callq 0x36b8
jmp 0xcafd
movq 0xe489(%rip), %rdi      # 0x1afd0
leaq 0x6237(%rip), %rsi      # 0x12d85
callq 0x21c0
leaq 0x5de3(%rip), %rsi      # 0x1293d
leaq 0xf(%rsp), %rdx
movq %rbx, %rdi
callq 0x36b8
jmp 0xcafd
movq 0xe460(%rip), %rdi      # 0x1afd0
leaq 0x61fb(%rip), %rsi      # 0x12d72
callq 0x21c0
leaq 0x5dba(%rip), %rsi      # 0x1293d
leaq 0xf(%rsp), %rdx
movq %rbx, %rdi
callq 0x36b8
jmp 0xcafd
decl 0x120(%r14)
jmp 0xca25
jmp 0xcba9
jmp 0xcba9
jmp 0xcba9
jmp 0xcba9
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x20f0
movq %rbx, %rdi
callq 0x2310