// File: /workspace/github_cpp_makefile_star2_O3/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 0x708c
movl %eax, %ebx
leaq 0x70(%rsp), %rbp
testb %al, %al
je 0x88bb
movq %r12, %rdi
movl $0x107, %esi            # imm = 0x107
callq 0x5c08
testb %al, %al
je 0x874a
movl $0x11f, 0xa8(%rsp) # imm = 0x11F
jmp 0x87cb
movq %r12, %rdi
movl $0x108, %esi            # imm = 0x108
callq 0x5c08
testb %al, %al
je 0x8768
movl $0x120, 0xa8(%rsp) # imm = 0x120
jmp 0x87cb
movq %r12, %rdi
movl $0x109, %esi            # imm = 0x109
callq 0x5c08
testb %al, %al
je 0x8786
movl $0x121, 0xa8(%rsp) # imm = 0x121
jmp 0x87cb
leaq 0x58(%rsp), %r13
movq %r13, -0x10(%r13)
leaq 0x1130e(%rip), %rsi     # 0x19aa4
leaq 0x11340(%rip), %rdx     # 0x19add
leaq 0x48(%rsp), %rdi
callq 0x3c42
leaq 0x48(%rsp), %rsi
movq %r12, %rdi
callq 0x5694
movq 0x48(%rsp), %rdi
cmpq %r13, %rdi
je 0x87cb
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 0x3bac
movq 0x68(%rsp), %rax
leaq 0xb8(%rsp), %r12
movq %rax, -0x8(%r12)
movq %r12, %rdi
movq %rbp, %rsi
callq 0xdfee
leaq 0xd0(%rsp), %rdi
leaq 0xe0(%rsp), %rbp
movq %rbp, -0x10(%rbp)
movq 0x88(%rsp), %rsi
movq 0x90(%rsp), %rdx
addq %rsi, %rdx
callq 0x3bac
movq 0xa8(%rsp), %rax
leaq 0xb0(%rsp), %rdx
movq %rax, 0x40(%rdx)
leaq 0x28(%rsp), %rsi
movq %r13, %rdi
xorl %ecx, %ecx
callq 0xfb86
movq 0xd0(%rsp), %rdi
cmpq %rbp, %rdi
je 0x887c
movq 0xe0(%rsp), %rsi
incq %rsi
callq 0x2200
movq %r12, %rdi
callq 0xdda4
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
leaq 0x18(%rsp), %r13
leaq 0x70(%rsp), %rbp
je 0x88aa
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x2200
addq $0x8, %r15
leaq 0x68(%rsp), %rsi
movq %r15, %rdi
callq 0xdd50
movq 0x8(%rsp), %rdi
cmpq %r13, %rdi
je 0x88d2
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x2200
movq 0x88(%rsp), %rdi
cmpq %r14, %rdi
je 0x88ef
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x2200
movq %rbp, %rdi
callq 0xdda4
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 0x8964
movq 0x58(%rsp), %rsi
jmp 0x8957
jmp 0x8961
movq %rax, %rbx
leaq 0xb0(%rsp), %rdi
callq 0xdd7a
jmp 0x8943
movq %rax, %rbx
movq %r12, %rdi
callq 0xdda4
jmp 0x8943
movq %rax, %rbx
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x8964
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x2200
jmp 0x8964
movq %rax, %rbx
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x8980
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x2200
leaq 0x68(%rsp), %rdi
callq 0xdd7a
movq %rbx, %rdi
callq 0x2330