// File: /workspace/github_cpp_makefile_star2_O2/pranavmodx[P]modlang/src/parser.cpp
// Function: Parser::parseMinHeapLiteral()
Expression *Parser::parseMinHeapLiteral()
{
	MinHeapLiteral *exp = new MinHeapLiteral();
	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 0x10cd6
leaq 0x30(%r14), %r13
leaq 0x8(%rbx), %rdi
movq %r13, %rsi
callq 0x1073c
leaq 0x1c6b9(%rip), %rsi     # 0x2ba38
movq %r14, %rdi
callq 0xfe72
testb %al, %al
je 0xf4c1
leaq 0x70(%r14), %r15
leaq 0x1c57e(%rip), %rsi     # 0x2b918
movq %r15, %rdi
callq 0x10766
testb %al, %al
je 0xf3cf
leaq 0x1c58b(%rip), %rsi     # 0x2b938
movq %r15, %rdi
callq 0x10766
testb %al, %al
je 0xf3cf
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x20(%rax)
movq %r14, %rdi
callq 0x10130
jmp 0xf4ca
movq %r14, %rdi
callq 0xe52e
leaq 0x48(%rbx), %rdi
movq %rdi, (%rsp)
movq %r13, %rsi
callq 0x5120
leaq 0x1c66a(%rip), %rsi     # 0x2ba58
movq %r14, %rdi
callq 0xfe72
testb %al, %al
je 0xf4c1
leaq 0x1c793(%rip), %rsi     # 0x2bb98
movq %r14, %rdi
callq 0xfe72
testb %al, %al
je 0xf4c1
movq %rbx, %rax
addq $0x68, %rax
movq %rax, 0x8(%rsp)
leaq 0x1c790(%rip), %r12     # 0x2bbb8
leaq 0x38(%rsp), %rbp
movq %r15, %rdi
movq %r12, %rsi
callq 0x10766
testb %al, %al
je 0xf4ae
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 0xf4de
movq 0x8(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x10bb0
movq %r15, %rdi
movq %r12, %rsi
callq 0x10766
testb %al, %al
je 0xf42d
movq %r14, %rdi
leaq 0x1c655(%rip), %rsi     # 0x2baf8
callq 0xfe72
testb %al, %al
jne 0xf42d
jmp 0xf4ca
leaq 0x1c703(%rip), %rsi     # 0x2bbb8
movq %r14, %rdi
callq 0xfe72
testb %al, %al
jne 0xf4cc
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 0xf4ca
movq %rax, %r14
leaq 0x18(%rsp), %rdi
callq 0x5388
jmp 0xf525
movq %rax, %r14
movl $0x80, %esi
movq %rbx, %rdi
callq 0x51e0
movq %r14, %rdi
callq 0x5330
nop