// File: /workspace/github_cpp_makefile_star2_O1/AndrewAlbert[P]Compiler-Theory/SourceCode/codeGenerator.cpp
// Function: codeGenerator::popArguments(int)
void codeGenerator::popArguments(int SPoffset){
	if( !ShouldGenerate() ) return;
	
	while( argListStack.size() != 0 ){
		
		savedArgument = argListStack.top();
		argListStack.pop();
		
		if( savedArgument.index < 0 && savedArgument.size > 1 && !savedArgument.indirect ){
			SPoffset -= savedArgument.size;
		}
		else{
			SPoffset -= 1;
		}

		if( savedArgument.paramType == TYPE_PARAM_OUT || savedArgument.paramType == TYPE_PARAM_INOUT ){
			comment("Pop argument.");
			mm2reg(savedArgument.type, savedArgument.size, SPoffset, false, savedArgument.index, false, TYPE_INTEGER, true );
			reg2mm(savedArgument.type, savedArgument.type, savedArgument.size, savedArgument.size, savedArgument.offset, savedArgument.isGlobal);
		}
	}
	return;
}

// Assembly:
cmpb $0x1, 0x330(%rdi)
jne 0x16d0d
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movl %esi, %ebx
movq %rdi, %r14
leaq 0x2b8(%rdi), %r15
leaq 0x2a0(%rdi), %r12
movabsq $-0x5555555555555555, %rbp # imm = 0xAAAAAAAAAAAAAAAB
movabsq $0x5555555555555555, %r13 # imm = 0x5555555555555555
movq %r15, (%rsp)
movq 0x300(%r14), %rax
movq %rax, %rcx
subq 0x2e0(%r14), %rcx
sarq $0x3, %rcx
cmpq $0x1, %rax
adcq $-0x1, %rcx
leaq (%rcx,%rcx,4), %rdx
leaq (%rcx,%rdx,4), %rsi
movq 0x2d8(%r14), %rdi
movq 0x2e8(%r14), %rcx
movq 0x2f0(%r14), %rdx
movq %rcx, %r8
subq %rdx, %r8
sarq $0x3, %r8
imulq %rbp, %r8
subq 0x2c8(%r14), %rdi
addq %rsi, %r8
sarq $0x3, %rdi
imulq %r13, %rdi
cmpq %rdi, %r8
je 0x16cff
cmpq %rdx, %rcx
jne 0x16b86
movq -0x8(%rax), %rcx
movl $0x1f8, %eax            # imm = 0x1F8
addq %rax, %rcx
movq -0x8(%rcx), %rax
movq %rax, 0x10(%r12)
movups -0x18(%rcx), %xmm0
movups %xmm0, (%r12)
movq %r15, %rdi
callq 0x17e36
cmpl $0x0, 0x2ac(%r14)
jns 0x16bc4
movl 0x2a8(%r14), %eax
cmpl $0x2, %eax
jl 0x16bc4
cmpb $0x0, 0x2b4(%r14)
je 0x16cf8
decl %ebx
movl (%r12), %eax
andl $-0x2, %eax
cmpl $0x120, %eax            # imm = 0x120
jne 0x16b12
movq %r13, %r15
movq %rbp, %r13
leaq 0x18(%rsp), %rbp
movq %rbp, 0x8(%rsp)
leaq 0x8(%rsp), %rdi
leaq 0x4555(%rip), %rsi      # 0x1b149
leaq 0x455b(%rip), %rdx      # 0x1b156
callq 0x3c34
movq 0x308(%r14), %rdi
movq 0x8(%rsp), %rdx
leaq 0x3e0c(%rip), %rsi      # 0x1aa1f
xorl %eax, %eax
callq 0x22a0
movq 0x8(%rsp), %rdi
cmpq %rbp, %rdi
je 0x16c31
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x2200
movl 0x2a4(%r14), %edx
movl 0x2a8(%r14), %ecx
movl 0x2ac(%r14), %eax
leaq 0x48(%rsp), %rdi
movq %r14, %rsi
movl %ebx, %r8d
xorl %r9d, %r9d
pushq $0x1
pushq $0x10a                  # imm = 0x10A
pushq $0x0
pushq %rax
callq 0x139f8
addq $0x20, %rsp
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0x16c83
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x2200
movl 0x2a4(%r14), %ecx
movl 0x2a8(%r14), %r8d
movl 0x2b0(%r14), %eax
movzbl 0x2b5(%r14), %r10d
subq $0x8, %rsp
leaq 0x30(%rsp), %rdi
movq %r14, %rsi
movl %ecx, %edx
movl %r8d, %r9d
xorl %r11d, %r11d
pushq %r11
pushq $0x10a                  # imm = 0x10A
pushq %r11
pushq %r10
pushq %rax
callq 0x14bfc
addq $0x30, %rsp
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
movq %r13, %rbp
movq %r15, %r13
movq (%rsp), %r15
je 0x16b12
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x2200
jmp 0x16b12
subl %eax, %ebx
jmp 0x16bc6
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq