// File: /workspace/github_cpp_makefile_star2_O1/pranavmodx[P]modlang/src/parser.cpp
// Function: Parser::parseFunctionParameters()
std::vector<Identifier *> Parser::parseFunctionParameters()
{
	std::vector<Identifier *> parameters;

	if (peekToken.type == RPAREN)
	{ // no parameters
		nextToken();
		return parameters;
	}

	nextToken(); // pass "," or "("

	Identifier *ident = new Identifier();
	ident->token = curToken;
	ident->value = curToken.literal;
	parameters.push_back(ident);

	while (peekToken.type == COMMA)
	{
		nextToken();
		nextToken();
		Identifier *ident = new Identifier();
		ident->token = curToken;
		ident->value = curToken.literal;
		parameters.push_back(ident);
	}

	if (!expectPeek(RPAREN))
		return std::vector<Identifier *>();

	return parameters;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rsi, %r14
movq %rdi, 0x20(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, (%rsp)
movq $0x0, 0x10(%rsp)
movq 0x78(%rsi), %rdx
cmpq 0x1ff31(%rip), %rdx     # 0x36b78
jne 0x16c6a
testq %rdx, %rdx
je 0x16d10
movq 0x1ff17(%rip), %rsi     # 0x36b70
movq 0x70(%r14), %rdi
callq 0x51d0
testl %eax, %eax
je 0x16d10
movq %r14, %rdi
callq 0x13d4c
movl $0x68, %edi
callq 0x51b0
movq %rax, %r13
leaq 0x1dc12(%rip), %rbp     # 0x34898
movq %rbp, (%rax)
leaq 0x8(%rax), %rdi
addq $0x18, %rax
movq %rax, 0x8(%r13)
xorl %eax, %eax
movq %rax, 0x10(%r13)
movb %al, 0x18(%r13)
leaq 0x38(%r13), %rcx
movq %rcx, 0x28(%r13)
movq %rax, 0x30(%r13)
movb %al, 0x38(%r13)
leaq 0x58(%r13), %rcx
movq %rcx, 0x48(%r13)
movq %rax, 0x50(%r13)
movb %al, 0x58(%r13)
movq %r13, 0x30(%rsp)
leaq 0x30(%r14), %r15
movq %r15, %rsi
callq 0x5100
addq $0x28, %r13
leaq 0x50(%r14), %r12
movq %r13, %rdi
movq %r12, %rsi
callq 0x5100
movq 0x30(%rsp), %rdi
addq $0x48, %rdi
movq %r12, %rsi
callq 0x5100
movq 0x8(%rsp), %rsi
cmpq 0x10(%rsp), %rsi
je 0x16d4b
movq 0x30(%rsp), %rax
movq %rax, (%rsi)
addq $0x8, 0x8(%rsp)
jmp 0x16d58
movq %r14, %rdi
callq 0x13d4c
movq (%rsp), %rax
movq 0x20(%rsp), %rcx
movq %rax, (%rcx)
movq 0x8(%rsp), %rax
movq %rax, 0x8(%rcx)
movq 0x10(%rsp), %rax
movq %rax, 0x10(%rcx)
xorps %xmm0, %xmm0
movaps %xmm0, (%rsp)
movq $0x0, 0x10(%rsp)
jmp 0x16e87
movq %rsp, %rdi
leaq 0x30(%rsp), %rdx
callq 0x18cf8
movq 0x78(%r14), %rdx
cmpq 0x1fd95(%rip), %rdx     # 0x36af8
jne 0x16e43
xorl %ebx, %ebx
testq %rdx, %rdx
je 0x16d88
movq 0x1fd79(%rip), %rsi     # 0x36af0
movq 0x70(%r14), %rdi
callq 0x51d0
testl %eax, %eax
jne 0x16e43
movq %r14, %rdi
callq 0x13d4c
movq %r14, %rdi
callq 0x13d4c
movl $0x68, %edi
callq 0x51b0
movq %rax, %r13
movq %rbp, (%rax)
leaq 0x8(%rax), %rdi
addq $0x18, %rax
movq %rax, 0x8(%r13)
movq %rbx, 0x10(%r13)
movb %bl, 0x18(%r13)
leaq 0x38(%r13), %rax
movq %rax, 0x28(%r13)
movq %rbx, 0x30(%r13)
movb %bl, 0x38(%r13)
leaq 0x58(%r13), %rax
movq %rax, 0x48(%r13)
movq %rbx, 0x50(%r13)
movb %bl, 0x58(%r13)
movq %r13, 0x28(%rsp)
movq %r15, %rsi
callq 0x5100
addq $0x28, %r13
movq %r13, %rdi
movq %r12, %rsi
callq 0x5100
movq 0x28(%rsp), %rdi
addq $0x48, %rdi
movq %r12, %rsi
callq 0x5100
movq 0x8(%rsp), %rsi
cmpq 0x10(%rsp), %rsi
je 0x16e25
movq 0x28(%rsp), %rax
movq %rax, (%rsi)
addq $0x8, 0x8(%rsp)
jmp 0x16e32
movq %rsp, %rdi
leaq 0x28(%rsp), %rdx
callq 0x18cf8
movq 0x78(%r14), %rdx
cmpq 0x1fcbb(%rip), %rdx     # 0x36af8
je 0x16d6b
leaq 0x1fd26(%rip), %rsi     # 0x36b70
movq %r14, %rdi
callq 0x1629e
movq 0x20(%rsp), %rcx
testb %al, %al
je 0x16e79
movq %rsp, %rcx
movq (%rcx), %rax
movq 0x20(%rsp), %rdx
movq %rax, (%rdx)
movq 0x8(%rcx), %rax
movq %rax, 0x8(%rdx)
movq 0x10(%rcx), %rax
movq %rax, 0x10(%rdx)
xorps %xmm0, %xmm0
movups %xmm0, (%rcx)
movq $0x0, 0x10(%rcx)
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x16e9d
movq 0x10(%rsp), %rsi
subq %rdi, %rsi
callq 0x51c0
movq 0x20(%rsp), %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x16eb7
jmp 0x16eb7
jmp 0x16eb7
movq %rax, %rbx
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x16ed0
movq 0x10(%rsp), %rsi
subq %rdi, %rsi
callq 0x51c0
movq %rbx, %rdi
callq 0x5330