// File: /workspace/github_cpp_makefile_star2_O2/pranavmodx[P]modlang/src/parser.cpp
// Function: Parser::parseMaxHeapLiteral()
Expression *Parser::parseMaxHeapLiteral()
{
	MaxHeapLiteral *exp = new MaxHeapLiteral();
	exp->token = curToken;

	if (!expectPeek(LT))
	{
		delete exp;
		return nullptr;
	}

	if (peekToken.type != INTEGER && peekToken.type != STRING) {
		delete exp;
		peekTypeError();
		return nullptr;
	}

	nextToken();

	exp->type = curToken.type;

	if (!expectPeek(GT))
	{
		delete exp;
		return nullptr;
	}

	if (!expectPeek(LBRACE))
	{
		delete exp;
		return nullptr;
	}

	while (peekToken.type != RBRACE)
	{
		nextToken();

		Expression *value = parseExpression(LOWEST);

		if (value->getTokenType() != exp->type) {
			curTypeError(exp->type);
			return nullptr;
		}

		exp->elements.push_back(value);

		if (peekToken.type != RBRACE && !expectPeek(COMMA))
			return nullptr;
	}

	if (!expectPeek(RBRACE))
	{
		delete exp;
		return nullptr;
	}

	return exp;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rdi, %r14
movl $0x80, %edi
callq 0x51d0
movq %rax, %rbx
xorps %xmm0, %xmm0
movaps %xmm0, (%rax)
movaps %xmm0, 0x10(%rax)
movaps %xmm0, 0x20(%rax)
movaps %xmm0, 0x30(%rax)
movaps %xmm0, 0x40(%rax)
movaps %xmm0, 0x50(%rax)
movaps %xmm0, 0x60(%rax)
movaps %xmm0, 0x70(%rax)
movq %rax, %rdi
callq 0x10c88
leaq 0x30(%r14), %r13
leaq 0x8(%rbx), %rdi
movq %r13, %rsi
callq 0x1073c
leaq 0x1c8c7(%rip), %rsi     # 0x2ba38
movq %r14, %rdi
callq 0xfe72
testb %al, %al
je 0xf2b3
leaq 0x70(%r14), %r15
leaq 0x1c78c(%rip), %rsi     # 0x2b918
movq %r15, %rdi
callq 0x10766
testb %al, %al
je 0xf1c1
leaq 0x1c799(%rip), %rsi     # 0x2b938
movq %r15, %rdi
callq 0x10766
testb %al, %al
je 0xf1c1
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x20(%rax)
movq %r14, %rdi
callq 0x10130
jmp 0xf2bc
movq %r14, %rdi
callq 0xe52e
leaq 0x48(%rbx), %rdi
movq %rdi, (%rsp)
movq %r13, %rsi
callq 0x5120
leaq 0x1c878(%rip), %rsi     # 0x2ba58
movq %r14, %rdi
callq 0xfe72
testb %al, %al
je 0xf2b3
leaq 0x1c9a1(%rip), %rsi     # 0x2bb98
movq %r14, %rdi
callq 0xfe72
testb %al, %al
je 0xf2b3
movq %rbx, %rax
addq $0x68, %rax
movq %rax, 0x8(%rsp)
leaq 0x1c99e(%rip), %r12     # 0x2bbb8
leaq 0x38(%rsp), %rbp
movq %r15, %rdi
movq %r12, %rsi
callq 0x10766
testb %al, %al
je 0xf2a0
movq %r14, %rdi
callq 0xe52e
movq %r14, %rdi
xorl %esi, %esi
callq 0xfea6
movq %rax, 0x10(%rsp)
movq (%rax), %rcx
movq %rbp, %rdi
movq %rax, %rsi
callq *0x30(%rcx)
movq %rbp, %rdi
movq (%rsp), %rsi
callq 0x10766
movl %eax, %r13d
movq %rbp, %rdi
callq 0x5388
testb %r13b, %r13b
jne 0xf2d0
movq 0x8(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x10bb0
movq %r15, %rdi
movq %r12, %rsi
callq 0x10766
testb %al, %al
je 0xf21f
movq %r14, %rdi
leaq 0x1c863(%rip), %rsi     # 0x2baf8
callq 0xfe72
testb %al, %al
jne 0xf21f
jmp 0xf2bc
leaq 0x1c911(%rip), %rsi     # 0x2bbb8
movq %r14, %rdi
callq 0xfe72
testb %al, %al
jne 0xf2be
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x20(%rax)
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x18(%rsp), %rbx
movq %rbx, %rdi
movq (%rsp), %rsi
callq 0x5260
movq %r14, %rdi
movq %rbx, %rsi
callq 0x101b6
leaq 0x18(%rsp), %rdi
callq 0x5388
jmp 0xf2bc
movq %rax, %r14
leaq 0x18(%rsp), %rdi
callq 0x5388
jmp 0xf317
movq %rax, %r14
movl $0x80, %esi
movq %rbx, %rdi
callq 0x51e0
movq %r14, %rdi
callq 0x5330
nop