// File: pfnet-research[P]pml/src/test.cpp
// Function: let_test::let_test()
PML_CUSTOM_TEST(let_test, lang_feature_test) {
    using namespace ast;
    parse_test("let a = 1+2 in a + 3", "Let(a, Add(1, 2), Add(a, 3))");
    eval_test(
            make<let_expr_t>("a",
                make<add_expr_t>(
                    make<int_expr_t>(1),
                    make<int_expr_t>(2)),
                make<add_expr_t>(
                    make<var_expr_t>("a"),
                    make<int_expr_t>(3))),
            make<int_expr_t>(6));
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x150, %rsp            # imm = 0x150
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x138(%rbp)
callq 0x71b80
movq -0x138(%rbp), %rax
leaq 0x7bf7b(%rip), %rcx     # 0xe6638
movq %rcx, (%rax)
leaq -0x29(%rbp), %rdi
movq %rdi, -0x130(%rbp)
callq 0xa660
movq -0x130(%rbp), %rdx
leaq 0x3534f(%rip), %rsi     # 0x9fa2d
leaq -0x28(%rbp), %rdi
callq 0x1dd10
jmp 0x6a6e9
leaq -0x61(%rbp), %rdi
movq %rdi, -0x140(%rbp)
callq 0xa660
movq -0x140(%rbp), %rdx
leaq 0x3533b(%rip), %rsi     # 0x9fa42
leaq -0x60(%rbp), %rdi
callq 0x1dd10
jmp 0x6a712
movq -0x138(%rbp), %rdi
leaq -0x28(%rbp), %rsi
leaq -0x60(%rbp), %rdx
callq 0x71bc0
jmp 0x6a728
leaq -0x60(%rbp), %rdi
callq 0xa240
leaq -0x61(%rbp), %rdi
callq 0xa420
leaq -0x28(%rbp), %rdi
callq 0xa240
leaq -0x29(%rbp), %rdi
callq 0xa420
movl $0x1, -0xac(%rbp)
leaq -0xa8(%rbp), %rdi
leaq -0xac(%rbp), %rsi
callq 0x67db0
jmp 0x6a76b
movl $0x2, -0xc4(%rbp)
leaq -0xc0(%rbp), %rdi
leaq -0xc4(%rbp), %rsi
callq 0x67db0
jmp 0x6a78a
leaq -0x98(%rbp), %rdi
leaq -0xa8(%rbp), %rsi
leaq -0xc0(%rbp), %rdx
callq 0x67f90
jmp 0x6a7a6
leaq 0x352b2(%rip), %rsi     # 0x9fa5f
leaq -0xe8(%rbp), %rdi
callq 0x68140
jmp 0x6a7bb
movl $0x3, -0xfc(%rbp)
leaq -0xf8(%rbp), %rdi
leaq -0xfc(%rbp), %rsi
callq 0x67db0
jmp 0x6a7da
leaq -0xd8(%rbp), %rdi
leaq -0xe8(%rbp), %rsi
leaq -0xf8(%rbp), %rdx
callq 0x68100
jmp 0x6a7f6
leaq 0x35262(%rip), %rsi     # 0x9fa5f
leaq -0x88(%rbp), %rdi
leaq -0x98(%rbp), %rdx
leaq -0xd8(%rbp), %rcx
callq 0x680c0
jmp 0x6a819
leaq -0x78(%rbp), %rdi
leaq -0x88(%rbp), %rsi
callq 0x41ac0
movl $0x6, -0x124(%rbp)
leaq -0x120(%rbp), %rdi
leaq -0x124(%rbp), %rsi
callq 0x67db0
jmp 0x6a848
leaq -0x110(%rbp), %rdi
movq %rdi, -0x148(%rbp)
leaq -0x120(%rbp), %rsi
callq 0x12f60
movq -0x138(%rbp), %rdi
movq -0x148(%rbp), %rdx
leaq -0x78(%rbp), %rsi
callq 0x71cb0
jmp 0x6a87b
leaq -0x110(%rbp), %rdi
callq 0x13080
leaq -0x120(%rbp), %rdi
callq 0x12f90
leaq -0x78(%rbp), %rdi
callq 0x13080
leaq -0x88(%rbp), %rdi
callq 0x41af0
leaq -0xd8(%rbp), %rdi
callq 0x42140
leaq -0xf8(%rbp), %rdi
callq 0x12f90
leaq -0xe8(%rbp), %rdi
callq 0x41d40
leaq -0x98(%rbp), %rdi
callq 0x42140
leaq -0xc0(%rbp), %rdi
callq 0x12f90
leaq -0xa8(%rbp), %rdi
callq 0x12f90
addq $0x150, %rsp            # imm = 0x150
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x6a93c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x6a92a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x60(%rbp), %rdi
callq 0xa240
leaq -0x61(%rbp), %rdi
callq 0xa420
leaq -0x28(%rbp), %rdi
callq 0xa240
leaq -0x29(%rbp), %rdi
callq 0xa420
jmp 0x6aa47
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x6aa47
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x6aa3b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x6aa2f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x6aa23
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x6aa17
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x6aa0b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x6a9ff
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x6a9ea
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x110(%rbp), %rdi
callq 0x13080
leaq -0x120(%rbp), %rdi
callq 0x12f90
leaq -0x78(%rbp), %rdi
callq 0x13080
leaq -0x88(%rbp), %rdi
callq 0x41af0
leaq -0xd8(%rbp), %rdi
callq 0x42140
leaq -0xf8(%rbp), %rdi
callq 0x12f90
leaq -0xe8(%rbp), %rdi
callq 0x41d40
leaq -0x98(%rbp), %rdi
callq 0x42140
leaq -0xc0(%rbp), %rdi
callq 0x12f90
leaq -0xa8(%rbp), %rdi
callq 0x12f90
movq -0x138(%rbp), %rdi
callq 0x71f50
movq -0x38(%rbp), %rdi
callq 0xa650
nopl (%rax)