// File: pranavmodx[P]modlang/test/parser_test.cpp
// Function: testLetStatement(LetStatement*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
bool testLetStatement(LetStatement *stmt, std::string expectedName)
{
	if (stmt->tokenLiteral() != "let")
	{
		std::cout << "stmt->tokenLiteral() not 'let'"
				  << ", got " << stmt->tokenLiteral() << std::endl;
		return false;
	}

	if (stmt->name.value != expectedName)
	{
		std::cout << "stmt->name.value not " << expectedName << ", got " << stmt->name.value << std::endl;
		return false;
	}

	if (stmt->name.tokenLiteral() != expectedName)
	{
		std::cout << "stmt->name.tokenLiteral() not " << expectedName << ", got " << stmt->name.tokenLiteral() << std::endl;
		return false;
	}

	return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x100, %rsp            # imm = 0x100
movq %rsi, -0xc0(%rbp)
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rsi
movq (%rsi), %rax
movq (%rax), %rax
leaq -0x38(%rbp), %rdi
movq %rdi, -0xb8(%rbp)
callq *%rax
movq -0xb8(%rbp), %rdi
leaq 0x1885f(%rip), %rsi     # 0x2614e
callq 0xdf90
movb %al, -0xa9(%rbp)
jmp 0xd8fc
leaq -0x38(%rbp), %rdi
callq 0x54d8
movb -0xa9(%rbp), %al
testb $0x1, %al
jne 0xd914
jmp 0xd9cb
movq 0x2a6b5(%rip), %rdi     # 0x37fd0
leaq 0x18830(%rip), %rsi     # 0x26152
callq 0x5260
movq %rax, %rdi
leaq 0x188f9(%rip), %rsi     # 0x2622a
callq 0x5260
movq %rax, -0xd8(%rbp)
movq -0x10(%rbp), %rsi
movq (%rsi), %rax
movq (%rax), %rax
leaq -0x68(%rbp), %rdi
movq %rdi, -0xd0(%rbp)
callq *%rax
movq -0xd8(%rbp), %rdi
movq -0xd0(%rbp), %rsi
callq 0x5230
movq %rax, -0xc8(%rbp)
jmp 0xd970
movq -0xc8(%rbp), %rdi
movq 0x2a62a(%rip), %rsi     # 0x37fa8
callq 0x52a0
jmp 0xd985
leaq -0x68(%rbp), %rdi
callq 0x54d8
movb $0x0, -0x1(%rbp)
jmp 0xdb42
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x54d8
jmp 0xdb50
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x68(%rbp), %rdi
callq 0x54d8
jmp 0xdb50
movq -0xc0(%rbp), %rsi
movq -0x10(%rbp), %rdi
addq $0x48, %rdi
addq $0x48, %rdi
callq 0xdfc0
testb $0x1, %al
jne 0xd9e9
jmp 0xda46
movq 0x2a5e0(%rip), %rdi     # 0x37fd0
leaq 0x1877a(%rip), %rsi     # 0x26171
callq 0x5260
movq -0xc0(%rbp), %rsi
movq %rax, %rdi
callq 0x5230
movq %rax, %rdi
leaq 0x18815(%rip), %rsi     # 0x2622a
callq 0x5260
movq %rax, %rdi
movq -0x10(%rbp), %rsi
addq $0x48, %rsi
addq $0x48, %rsi
callq 0x5230
movq %rax, %rdi
movq 0x2a570(%rip), %rsi     # 0x37fa8
callq 0x52a0
movb $0x0, -0x1(%rbp)
jmp 0xdb42
movq -0x10(%rbp), %rsi
addq $0x48, %rsi
leaq -0x88(%rbp), %rdi
callq 0xdff0
movq -0xc0(%rbp), %rsi
leaq -0x88(%rbp), %rdi
callq 0xdfc0
movb %al, -0xd9(%rbp)
leaq -0x88(%rbp), %rdi
callq 0x54d8
movb -0xd9(%rbp), %al
testb $0x1, %al
jne 0xda8e
jmp 0xdb3e
movq 0x2a53b(%rip), %rdi     # 0x37fd0
leaq 0x186eb(%rip), %rsi     # 0x26187
callq 0x5260
movq -0xc0(%rbp), %rsi
movq %rax, %rdi
callq 0x5230
movq %rax, %rdi
leaq 0x18770(%rip), %rsi     # 0x2622a
callq 0x5260
movq %rax, -0xf8(%rbp)
movq -0x10(%rbp), %rsi
addq $0x48, %rsi
leaq -0xa8(%rbp), %rdi
movq %rdi, -0xf0(%rbp)
callq 0xdff0
movq -0xf8(%rbp), %rdi
movq -0xf0(%rbp), %rsi
callq 0x5230
movq %rax, -0xe8(%rbp)
jmp 0xdafd
movq -0xe8(%rbp), %rdi
movq 0x2a49d(%rip), %rsi     # 0x37fa8
callq 0x52a0
jmp 0xdb12
leaq -0xa8(%rbp), %rdi
callq 0x54d8
movb $0x0, -0x1(%rbp)
jmp 0xdb42
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0xa8(%rbp), %rdi
callq 0x54d8
jmp 0xdb50
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x100, %rsp            # imm = 0x100
popq %rbp
retq
movq -0x40(%rbp), %rdi
callq 0x5460
nopl (%rax)