// File: pfnet-research[P]pml/src/test.cpp
// Function: simple_type_let::simple_type_let()
PML_TEST(simple_type_let) {
    // let a = 12 in 42
    assert_eq(
        *simty::simple_typing(ast::let_expr_t {
            "a",
            make<ast::int_expr_t>(12),
            make<ast::int_expr_t>(42)
        }).ok(),
        simty::int_type_t{});

    // let a = 12 in a
    assert_eq(
        *simty::simple_typing(ast::let_expr_t {
            "a",
            make<ast::int_expr_t>(12),
            make<ast::var_expr_t>("a")
        }).ok(),
        simty::int_type_t{});
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x250, %rsp            # imm = 0x250
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x200(%rbp)
callq 0x71f20
movq -0x200(%rbp), %rax
leaq 0x75f5b(%rip), %rcx     # 0xe6bc8
movq %rcx, (%rax)
leaq -0x99(%rbp), %rdi
movq %rdi, -0x1f8(%rbp)
callq 0xa660
movq -0x1f8(%rbp), %rdx
leaq 0x2edce(%rip), %rsi     # 0x9fa5f
leaq -0x98(%rbp), %rdi
callq 0x1dd10
jmp 0x70c9f
movl $0xc, -0xd4(%rbp)
leaq -0xd0(%rbp), %rdi
leaq -0xd4(%rbp), %rsi
callq 0x67db0
jmp 0x70cbe
leaq -0xc0(%rbp), %rdi
leaq -0xd0(%rbp), %rsi
callq 0x12f60
movl $0x2a, -0xfc(%rbp)
leaq -0xf8(%rbp), %rdi
leaq -0xfc(%rbp), %rsi
callq 0x67db0
jmp 0x70cf0
leaq -0xe8(%rbp), %rdi
movq %rdi, -0x208(%rbp)
leaq -0xf8(%rbp), %rsi
callq 0x12f60
movq -0x208(%rbp), %rcx
leaq -0x78(%rbp), %rdi
leaq -0x98(%rbp), %rsi
leaq -0xc0(%rbp), %rdx
callq 0x4a510
jmp 0x70d2a
leaq -0x30(%rbp), %rdi
leaq -0x78(%rbp), %rsi
callq 0x5f1d0
jmp 0x70d39
leaq -0x30(%rbp), %rdi
callq 0x5fc10
movq %rax, -0x210(%rbp)
jmp 0x70d4b
movq -0x210(%rbp), %rdi
callq 0x5f9e0
movq %rax, -0x220(%rbp)
movq $0x0, -0x108(%rbp)
leaq -0x108(%rbp), %rdi
movq %rdi, -0x218(%rbp)
callq 0x5fde0
movq -0x200(%rbp), %rdi
movq -0x220(%rbp), %rsi
movq -0x218(%rbp), %rdx
callq 0x84130
jmp 0x70d98
leaq -0x108(%rbp), %rdi
callq 0x5fe20
leaq -0x30(%rbp), %rdi
callq 0x300e0
leaq -0x78(%rbp), %rdi
callq 0x4a5b0
leaq -0xe8(%rbp), %rdi
callq 0x13080
leaq -0xf8(%rbp), %rdi
callq 0x12f90
leaq -0xc0(%rbp), %rdi
callq 0x13080
leaq -0xd0(%rbp), %rdi
callq 0x12f90
leaq -0x98(%rbp), %rdi
callq 0xa240
leaq -0x99(%rbp), %rdi
callq 0xa420
leaq -0x199(%rbp), %rdi
movq %rdi, -0x228(%rbp)
callq 0xa660
movq -0x228(%rbp), %rdx
leaq 0x2ec40(%rip), %rsi     # 0x9fa5f
leaq -0x198(%rbp), %rdi
callq 0x1dd10
jmp 0x70e2d
movl $0xc, -0x1c4(%rbp)
leaq -0x1c0(%rbp), %rdi
leaq -0x1c4(%rbp), %rsi
callq 0x67db0
jmp 0x70e4c
leaq -0x1b0(%rbp), %rdi
leaq -0x1c0(%rbp), %rsi
callq 0x12f60
leaq 0x2ebf9(%rip), %rsi     # 0x9fa5f
leaq -0x1e8(%rbp), %rdi
callq 0x68140
jmp 0x70e74
leaq -0x1d8(%rbp), %rdi
movq %rdi, -0x230(%rbp)
leaq -0x1e8(%rbp), %rsi
callq 0x41d10
movq -0x230(%rbp), %rcx
leaq -0x178(%rbp), %rdi
leaq -0x198(%rbp), %rsi
leaq -0x1b0(%rbp), %rdx
callq 0x4a510
jmp 0x70eb1
leaq -0x130(%rbp), %rdi
leaq -0x178(%rbp), %rsi
callq 0x5f1d0
jmp 0x70ec6
leaq -0x130(%rbp), %rdi
callq 0x5fc10
movq %rax, -0x238(%rbp)
jmp 0x70edb
movq -0x238(%rbp), %rdi
callq 0x5f9e0
movq %rax, -0x248(%rbp)
movq $0x0, -0x1f0(%rbp)
leaq -0x1f0(%rbp), %rdi
movq %rdi, -0x240(%rbp)
callq 0x5fde0
movq -0x200(%rbp), %rdi
movq -0x248(%rbp), %rsi
movq -0x240(%rbp), %rdx
callq 0x84130
jmp 0x70f28
leaq -0x1f0(%rbp), %rdi
callq 0x5fe20
leaq -0x130(%rbp), %rdi
callq 0x300e0
leaq -0x178(%rbp), %rdi
callq 0x4a5b0
leaq -0x1d8(%rbp), %rdi
callq 0x13080
leaq -0x1e8(%rbp), %rdi
callq 0x41d40
leaq -0x1b0(%rbp), %rdi
callq 0x13080
leaq -0x1c0(%rbp), %rdi
callq 0x12f90
leaq -0x198(%rbp), %rdi
callq 0xa240
leaq -0x199(%rbp), %rdi
callq 0xa420
addq $0x250, %rsp            # imm = 0x250
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xa8(%rbp)
movl %eax, -0xac(%rbp)
jmp 0x7108a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xa8(%rbp)
movl %eax, -0xac(%rbp)
jmp 0x7107e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xa8(%rbp)
movl %eax, -0xac(%rbp)
jmp 0x71066
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xa8(%rbp)
movl %eax, -0xac(%rbp)
jmp 0x7104e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xa8(%rbp)
movl %eax, -0xac(%rbp)
jmp 0x71045
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xa8(%rbp)
movl %eax, -0xac(%rbp)
jmp 0x7103c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xa8(%rbp)
movl %eax, -0xac(%rbp)
leaq -0x108(%rbp), %rdi
callq 0x5fe20
leaq -0x30(%rbp), %rdi
callq 0x300e0
leaq -0x78(%rbp), %rdi
callq 0x4a5b0
leaq -0xe8(%rbp), %rdi
callq 0x13080
leaq -0xf8(%rbp), %rdi
callq 0x12f90
leaq -0xc0(%rbp), %rdi
callq 0x13080
leaq -0xd0(%rbp), %rdi
callq 0x12f90
leaq -0x98(%rbp), %rdi
callq 0xa240
leaq -0x99(%rbp), %rdi
callq 0xa420
jmp 0x7119a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xa8(%rbp)
movl %eax, -0xac(%rbp)
jmp 0x7118e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xa8(%rbp)
movl %eax, -0xac(%rbp)
jmp 0x71182
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xa8(%rbp)
movl %eax, -0xac(%rbp)
jmp 0x7116a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xa8(%rbp)
movl %eax, -0xac(%rbp)
jmp 0x71152
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xa8(%rbp)
movl %eax, -0xac(%rbp)
jmp 0x71146
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xa8(%rbp)
movl %eax, -0xac(%rbp)
jmp 0x7113a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xa8(%rbp)
movl %eax, -0xac(%rbp)
leaq -0x1f0(%rbp), %rdi
callq 0x5fe20
leaq -0x130(%rbp), %rdi
callq 0x300e0
leaq -0x178(%rbp), %rdi
callq 0x4a5b0
leaq -0x1d8(%rbp), %rdi
callq 0x13080
leaq -0x1e8(%rbp), %rdi
callq 0x41d40
leaq -0x1b0(%rbp), %rdi
callq 0x13080
leaq -0x1c0(%rbp), %rdi
callq 0x12f90
leaq -0x198(%rbp), %rdi
callq 0xa240
leaq -0x199(%rbp), %rdi
callq 0xa420
movq -0x200(%rbp), %rdi
callq 0x71f80
movq -0xa8(%rbp), %rdi
callq 0xa650
nopw %cs:(%rax,%rax)
nopl (%rax)