// File: /workspace/github_cpp_makefile_star2_O3/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 0x1ffd1(%rip), %rdx     # 0x36b78
jne 0x16bca
testq %rdx, %rdx
je 0x16c66
movq 0x1ffb7(%rip), %rsi     # 0x36b70
movq 0x70(%r14), %rdi
callq 0x51d0
testl %eax, %eax
je 0x16c66
movq %r14, %rdi
callq 0x13d2e
movl $0x68, %edi
callq 0x51b0
movq %rax, %r13
leaq 0x1dcb2(%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
leaq 0x28(%r13), %rdi
leaq 0x50(%r14), %r12
movq %r12, %rsi
callq 0x5100
movq %r13, %rdi
addq $0x48, %rdi
movq %r12, %rsi
callq 0x5100
movq 0x8(%rsp), %rsi
cmpq 0x10(%rsp), %rsi
je 0x16c73
movq %r13, (%rsi)
addq $0x8, 0x8(%rsp)
jmp 0x16c80
movq %r14, %rdi
callq 0x13d2e
jmp 0x16d7e
movq %rsp, %rdi
leaq 0x30(%rsp), %rdx
callq 0x18b80
movq 0x78(%r14), %rdx
cmpq 0x1fe6d(%rip), %rdx     # 0x36af8
jne 0x16d6b
xorl %ebx, %ebx
testq %rdx, %rdx
je 0x16cb0
movq 0x1fe51(%rip), %rsi     # 0x36af0
movq 0x70(%r14), %rdi
callq 0x51d0
testl %eax, %eax
jne 0x16d6b
movq %r14, %rdi
callq 0x13d2e
movq %r14, %rdi
callq 0x13d2e
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 0x16d4d
movq 0x28(%rsp), %rax
movq %rax, (%rsi)
addq $0x8, 0x8(%rsp)
jmp 0x16d5a
movq %rsp, %rdi
leaq 0x28(%rsp), %rdx
callq 0x18b80
movq 0x78(%r14), %rdx
cmpq 0x1fd93(%rip), %rdx     # 0x36af8
je 0x16c93
leaq 0x1fdfe(%rip), %rsi     # 0x36b70
movq %r14, %rdi
callq 0x16224
testb %al, %al
je 0x16d95
movaps (%rsp), %xmm0
movq 0x20(%rsp), %rbx
movups %xmm0, (%rbx)
movq 0x10(%rsp), %rax
movq %rax, 0x10(%rbx)
jmp 0x16dbe
xorps %xmm0, %xmm0
movq 0x20(%rsp), %rbx
movups %xmm0, (%rbx)
movq $0x0, 0x10(%rbx)
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x16dbe
movq 0x10(%rsp), %rsi
subq %rdi, %rsi
callq 0x51c0
movq %rbx, %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x16dd6
jmp 0x16dd6
jmp 0x16dd6
movq %rax, %rbx
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x16def
movq 0x10(%rsp), %rsi
subq %rdi, %rsi
callq 0x51c0
movq %rbx, %rdi
callq 0x5330
nop