// File: /workspace/github_cpp_makefile_star2_O1/AndrewAlbert[P]Compiler-Theory/SourceCode/parser.cpp
// Function: Parser::Parameter(scopeValue&)
bool Parser::Parameter(scopeValue &procEntry){
	scopeValue paramEntry;
	string id;
	//get parameter declaration
	if( VariableDeclaration(id, paramEntry) ){
		//determine parameter's input / output type
		if(CheckToken(T_IN)) paramEntry.paramType = TYPE_PARAM_IN;
		else if(CheckToken(T_OUT)) paramEntry.paramType = TYPE_PARAM_OUT;
		else if(CheckToken(T_INOUT)) paramEntry.paramType = TYPE_PARAM_INOUT;
		else ReportError("expected 'in', 'out', or 'inout' in parameter declaration");
		
		//add parameter to current scope after updating the parameter type
		Scopes->addSymbol(id, paramEntry, false);
		
		//add to current procedure declaration's parameter list
		procEntry.arguments.push_back(paramEntry);
		
		return true;
	}
	else return false;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xf8, %rsp
movq %rsi, %r15
movq %rdi, %r12
xorps %xmm0, %xmm0
leaq 0x98(%rsp), %r14
movups %xmm0, -0x28(%r14)
xorl %eax, %eax
movq %rax, -0x18(%r14)
movq %r14, -0x10(%r14)
movq %rax, -0x8(%r14)
movb %al, (%r14)
leaq 0x18(%rsp), %r13
movq %r13, -0x10(%r13)
movq %rax, -0x8(%r13)
movb %al, (%r13)
leaq 0x8(%rsp), %rsi
leaq 0x68(%rsp), %rdx
callq 0x708a
movl %eax, %ebx
leaq 0x70(%rsp), %rbp
testb %al, %al
je 0x896d
movq %r12, %rdi
movl $0x107, %esi            # imm = 0x107
callq 0x5c0a
testb %al, %al
je 0x87fc
movl $0x11f, 0xa8(%rsp) # imm = 0x11F
jmp 0x887d
movq %r12, %rdi
movl $0x108, %esi            # imm = 0x108
callq 0x5c0a
testb %al, %al
je 0x881a
movl $0x120, 0xa8(%rsp) # imm = 0x120
jmp 0x887d
movq %r12, %rdi
movl $0x109, %esi            # imm = 0x109
callq 0x5c0a
testb %al, %al
je 0x8838
movl $0x121, 0xa8(%rsp) # imm = 0x121
jmp 0x887d
leaq 0x58(%rsp), %r13
movq %r13, -0x10(%r13)
leaq 0x1125c(%rip), %rsi     # 0x19aa4
leaq 0x1128e(%rip), %rdx     # 0x19add
leaq 0x48(%rsp), %rdi
callq 0x3c34
leaq 0x48(%rsp), %rsi
movq %r12, %rdi
callq 0x5696
movq 0x48(%rsp), %rdi
cmpq %r13, %rdi
je 0x887d
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x2200
movq 0x90(%r12), %r13
leaq 0x38(%rsp), %rax
movq %rax, -0x10(%rax)
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
addq %rsi, %rdx
leaq 0x28(%rsp), %rdi
callq 0x3ba4
movq 0x68(%rsp), %rax
leaq 0xb8(%rsp), %r12
movq %rax, -0x8(%r12)
movq %r12, %rdi
movq %rbp, %rsi
callq 0xe0e0
leaq 0xd0(%rsp), %rdi
leaq 0xe0(%rsp), %rbp
movq %rbp, -0x10(%rbp)
movq 0x88(%rsp), %rsi
movq 0x90(%rsp), %rdx
addq %rsi, %rdx
callq 0x3ba4
movq 0xa8(%rsp), %rax
leaq 0xb0(%rsp), %rdx
movq %rax, 0x40(%rdx)
leaq 0x28(%rsp), %rsi
movq %r13, %rdi
xorl %ecx, %ecx
callq 0xfc28
movq 0xd0(%rsp), %rdi
cmpq %rbp, %rdi
je 0x892e
movq 0xe0(%rsp), %rsi
incq %rsi
callq 0x2200
movq %r12, %rdi
callq 0xdea4
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
leaq 0x18(%rsp), %r13
leaq 0x70(%rsp), %rbp
je 0x895c
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x2200
addq $0x8, %r15
leaq 0x68(%rsp), %rsi
movq %r15, %rdi
callq 0xde50
movq 0x8(%rsp), %rdi
cmpq %r13, %rdi
je 0x8984
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x2200
movq 0x88(%rsp), %rdi
cmpq %r14, %rdi
je 0x89a1
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x2200
movq %rbp, %rdi
callq 0xdea4
movl %ebx, %eax
addq $0xf8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq 0x48(%rsp), %rdi
cmpq %r13, %rdi
je 0x8a16
movq 0x58(%rsp), %rsi
jmp 0x8a09
jmp 0x8a13
movq %rax, %rbx
leaq 0xb0(%rsp), %rdi
callq 0xde7a
jmp 0x89f5
movq %rax, %rbx
movq %r12, %rdi
callq 0xdea4
jmp 0x89f5
movq %rax, %rbx
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x8a16
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x2200
jmp 0x8a16
movq %rax, %rbx
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x8a32
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x2200
leaq 0x68(%rsp), %rdi
callq 0xde7a
movq %rbx, %rdi
callq 0x2330