// File: /workspace/github_cpp_makefile_star2_O1/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 $0x48, %rsp
movq %rdi, %r14
movl $0x80, %edi
callq 0x51b0
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, 0x70(%rax)
movaps %xmm0, 0x60(%rax)
leaq 0x1f843(%rip), %rax     # 0x34788
addq $0x10, %rax
movq %rax, (%rbx)
leaq 0x8(%rbx), %rdi
leaq 0x18(%rbx), %rax
movq %rax, 0x8(%rbx)
xorl %eax, %eax
movq %rax, 0x10(%rbx)
movb %al, 0x18(%rbx)
leaq 0x28(%rbx), %r15
leaq 0x38(%rbx), %rcx
movq %rcx, 0x28(%rbx)
movq %rax, 0x30(%rbx)
movb %al, 0x38(%rbx)
leaq 0x58(%rbx), %rcx
movq %rcx, 0x48(%rbx)
movq %rax, 0x50(%rbx)
movb %al, 0x58(%rbx)
movq %rax, 0x78(%rbx)
movups %xmm0, 0x68(%rbx)
leaq 0x30(%r14), %r12
movq %r12, %rsi
callq 0x5100
leaq 0x50(%r14), %rsi
movq %r15, %rdi
callq 0x5100
leaq 0x21a86(%rip), %rsi     # 0x36a30
movq %r14, %rdi
callq 0x1629e
testb %al, %al
je 0x1518b
movq 0x78(%r14), %r15
cmpq 0x21953(%rip), %r15     # 0x36918
jne 0x14fe3
testq %r15, %r15
je 0x1501e
movq 0x2193d(%rip), %rsi     # 0x36910
movq 0x70(%r14), %rdi
movq %r15, %rdx
callq 0x51d0
testl %eax, %eax
je 0x1501e
cmpq 0x2194e(%rip), %r15     # 0x36938
jne 0x15008
testq %r15, %r15
je 0x1501e
movq 0x21938(%rip), %rsi     # 0x36930
movq 0x70(%r14), %rdi
movq %r15, %rdx
callq 0x51d0
testl %eax, %eax
je 0x1501e
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x20(%rax)
movq %r14, %rdi
callq 0x16742
jmp 0x15194
leaq 0x48(%rbx), %r15
movq %r14, %rdi
callq 0x13d4c
movq %r15, %rdi
movq %r12, %rsi
callq 0x5100
leaq 0x21a14(%rip), %rsi     # 0x36a50
movq %r14, %rdi
callq 0x1629e
testb %al, %al
je 0x1518b
leaq 0x21b3d(%rip), %rsi     # 0x36b90
movq %r14, %rdi
callq 0x1629e
testb %al, %al
je 0x1518b
movq %rbx, %r12
addq $0x68, %r12
leaq 0x28(%rsp), %r13
movq 0x78(%r14), %rdx
cmpq 0x21b3e(%rip), %rdx     # 0x36bb8
jne 0x1509d
testq %rdx, %rdx
je 0x15178
movq 0x21b24(%rip), %rsi     # 0x36bb0
movq 0x70(%r14), %rdi
callq 0x51d0
testl %eax, %eax
je 0x15178
movq %r14, %rdi
callq 0x13d4c
movq %r14, %rdi
xorl %esi, %esi
callq 0x162f0
movq %rax, (%rsp)
movq (%rax), %rcx
movq %r13, %rdi
movq %rax, %rsi
callq *0x30(%rcx)
movq 0x30(%rsp), %rdx
movb $0x1, %bpl
cmpq 0x50(%rbx), %rdx
jne 0x150e9
testq %rdx, %rdx
je 0x150e7
movq (%r15), %rsi
movq 0x28(%rsp), %rdi
callq 0x51d0
testl %eax, %eax
setne %bpl
jmp 0x150e9
xorl %ebp, %ebp
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x15105
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x51c0
testb %bpl, %bpl
jne 0x151a8
movq 0x70(%rbx), %rsi
cmpq 0x78(%rbx), %rsi
je 0x15126
movq (%rsp), %rax
movq %rax, (%rsi)
addq $0x8, 0x70(%rbx)
jmp 0x15131
movq %r12, %rdi
movq %rsp, %rdx
callq 0x19120
movq 0x78(%r14), %rdx
cmpq 0x21a7c(%rip), %rdx     # 0x36bb8
jne 0x1515f
testq %rdx, %rdx
je 0x1506f
movq 0x21a62(%rip), %rsi     # 0x36bb0
movq 0x70(%r14), %rdi
callq 0x51d0
testl %eax, %eax
je 0x1506f
movq %r14, %rdi
leaq 0x21987(%rip), %rsi     # 0x36af0
callq 0x1629e
testb %al, %al
jne 0x1506f
jmp 0x15194
leaq 0x21a31(%rip), %rsi     # 0x36bb0
movq %r14, %rdi
callq 0x1629e
testb %al, %al
jne 0x15196
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x20(%rax)
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x18(%rsp), %r15
movq %r15, -0x10(%r15)
movq 0x48(%rbx), %rsi
movq 0x50(%rbx), %rdx
addq %rsi, %rdx
leaq 0x8(%rsp), %rbx
movq %rbx, %rdi
callq 0xbde8
movq %r14, %rdi
movq %rbx, %rsi
callq 0x16842
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x15194
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x51c0
jmp 0x15194
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x15207
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x51c0
movq %rbx, %rdi
callq 0x5330
nop