// File: AndrewAlbert[P]Compiler-Theory/SourceCode/codeGenerator.cpp
// Function: codeGenerator::pushArgument(int&, int)
void codeGenerator::pushArgument( int &SPoffset, int paramType){
	if( !ShouldGenerate() ) return;
	savedArgument.paramType = paramType;
	if( savedArgument.paramType == TYPE_PARAM_IN || savedArgument.paramType == TYPE_PARAM_INOUT ){
		argListStack.push( savedArgument );
	}
	else if( savedArgument.paramType == TYPE_PARAM_OUT) argListStack.push( savedArgument );

	if(savedArgument.paramType == TYPE_PARAM_IN || savedArgument.paramType == TYPE_PARAM_INOUT){
		comment("Push argument");
		if( savedArgument.index < 0 ){
			reg2mm(savedArgument.type, savedArgument.type, savedArgument.size, savedArgument.size, SPoffset, savedArgument.isGlobal, false, TYPE_INTEGER, true);
		}
		else{
			reg2mm(savedArgument.type, savedArgument.type, 1, 1, SPoffset, savedArgument.isGlobal, false, TYPE_INTEGER, true);
		}
	}

	if( savedArgument.size > 1 ) SPoffset += savedArgument.size;
	else SPoffset += 1;
	
	resetArgument();
	return;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xd0, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x98(%rbp)
callq 0x19590
testb $0x1, %al
jne 0x1ea0f
jmp 0x1ec4a
movq -0x98(%rbp), %rax
movl -0x14(%rbp), %ecx
movl %ecx, 0x2a0(%rax)
cmpl $0x11f, 0x2a0(%rax)     # imm = 0x11F
je 0x1ea3e
movq -0x98(%rbp), %rax
cmpl $0x121, 0x2a0(%rax)     # imm = 0x121
jne 0x1ea5d
movq -0x98(%rbp), %rsi
movq %rsi, %rdi
addq $0x2b8, %rdi            # imm = 0x2B8
addq $0x2a0, %rsi            # imm = 0x2A0
callq 0x1f4a0
jmp 0x1ea8f
movq -0x98(%rbp), %rax
cmpl $0x120, 0x2a0(%rax)     # imm = 0x120
jne 0x1ea8d
movq -0x98(%rbp), %rsi
movq %rsi, %rdi
addq $0x2b8, %rdi            # imm = 0x2B8
addq $0x2a0, %rsi            # imm = 0x2A0
callq 0x1f4a0
jmp 0x1ea8f
movq -0x98(%rbp), %rax
cmpl $0x11f, 0x2a0(%rax)     # imm = 0x11F
je 0x1eab9
movq -0x98(%rbp), %rax
cmpl $0x121, 0x2a0(%rax)     # imm = 0x121
jne 0x1ec0c
leaq -0x39(%rbp), %rdi
movq %rdi, -0xa0(%rbp)
callq 0x3430
movq -0xa0(%rbp), %rdx
leaq 0x896c(%rip), %rsi      # 0x27443
leaq -0x38(%rbp), %rdi
callq 0x62d0
jmp 0x1eae2
movq -0x98(%rbp), %rdi
leaq -0x38(%rbp), %rsi
xorl %edx, %edx
callq 0x19bb0
leaq -0x38(%rbp), %rdi
callq 0x31a0
leaq -0x39(%rbp), %rdi
callq 0x32e0
movq -0x98(%rbp), %rax
cmpl $0x0, 0x2ac(%rax)
jge 0x1eba1
movq -0x98(%rbp), %rsi
movl 0x2a4(%rsi), %edx
movl 0x2a4(%rsi), %ecx
movl 0x2a8(%rsi), %r8d
movl 0x2a8(%rsi), %r9d
movq -0x10(%rbp), %rax
movl (%rax), %r10d
movb 0x2b5(%rsi), %al
leaq -0x70(%rbp), %rdi
xorl %r11d, %r11d
andb $0x1, %al
movl %r10d, (%rsp)
movzbl %al, %eax
movl %eax, 0x8(%rsp)
movl $0x0, 0x10(%rsp)
movl $0x10a, 0x18(%rsp)      # imm = 0x10A
movl $0x1, 0x20(%rsp)
callq 0x1d2f0
leaq -0x70(%rbp), %rdi
callq 0x31a0
jmp 0x1ec0a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x39(%rbp), %rdi
callq 0x32e0
jmp 0x1ec53
movq -0x98(%rbp), %rsi
movl 0x2a4(%rsi), %edx
movl 0x2a4(%rsi), %ecx
movq -0x10(%rbp), %rax
movl (%rax), %r10d
movb 0x2b5(%rsi), %al
leaq -0x90(%rbp), %rdi
movl $0x1, %r9d
xorl %r8d, %r8d
andb $0x1, %al
movl %r9d, %r8d
movl %r10d, (%rsp)
movzbl %al, %eax
movl %eax, 0x8(%rsp)
movl $0x0, 0x10(%rsp)
movl $0x10a, 0x18(%rsp)      # imm = 0x10A
movl $0x1, 0x20(%rsp)
callq 0x1d2f0
leaq -0x90(%rbp), %rdi
callq 0x31a0
jmp 0x1ec0c
movq -0x98(%rbp), %rax
cmpl $0x1, 0x2a8(%rax)
jle 0x1ec33
movq -0x98(%rbp), %rax
movl 0x2a8(%rax), %ecx
movq -0x10(%rbp), %rax
addl (%rax), %ecx
movl %ecx, (%rax)
jmp 0x1ec3e
movq -0x10(%rbp), %rax
movl (%rax), %ecx
addl $0x1, %ecx
movl %ecx, (%rax)
movq -0x98(%rbp), %rdi
callq 0x1e8c0
addq $0xd0, %rsp
popq %rbp
retq
movq -0x48(%rbp), %rdi
callq 0x3420
nopl (%rax)