// File: /workspace/github_cpp_makefile_star2_O2/pfnet-research[P]pml/src/test.cpp
// Function: if_test::if_test()
PML_CUSTOM_TEST(if_test, lang_feature_test) {
    using namespace ast;
    parse_test("if true then 42 else 1", "If(true, 42, 1)");
    eval_test(
            make<if_expr_t>(
                make<bool_expr_t>(true),
                make<int_expr_t>(42),
                make<int_expr_t>(1)),
            make<int_expr_t>(42));

    parse_test("let x = false in if x then 31 else 21", "Let(x, false, If(x, 31, 21))");
    eval_test(
            make<let_expr_t>("x",
                make<bool_expr_t>(false),
                make<if_expr_t>(
                    make<var_expr_t>("x"),
                    make<int_expr_t>(31),
                    make<int_expr_t>(21))),
            make<int_expr_t>(21));
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xe0, %rsp
movq %rdi, %rbx
andl $0x0, 0x8(%rdi)
leaq 0x35a42(%rip), %rax     # 0x5b6f8
movq %rax, (%rdi)
leaq 0x1667c(%rip), %rsi     # 0x3c33c
leaq 0x70(%rsp), %rdi
leaq 0x18(%rsp), %rdx
callq 0xeb2e
leaq 0x1667d(%rip), %rsi     # 0x3c353
leaq 0x28(%rsp), %rdi
leaq 0x8(%rsp), %rdx
callq 0xeb2e
leaq 0x70(%rsp), %rsi
leaq 0x28(%rsp), %rdx
movq %rbx, %rdi
callq 0x2983a
leaq 0x28(%rsp), %rdi
callq 0x9130
leaq 0x70(%rsp), %rdi
callq 0x9130
leaq 0x48(%rsp), %rsi
movb $0x1, (%rsi)
leaq 0x28(%rsp), %rdi
callq 0xbaf2
leaq 0xb0(%rsp), %rsi
movl $0x2a, (%rsi)
leaq 0x18(%rsp), %rdi
callq 0xbc7c
leaq 0xa0(%rsp), %rsi
movl $0x1, (%rsi)
leaq 0x8(%rsp), %rdi
callq 0xbc7c
leaq 0x70(%rsp), %rdi
leaq 0x28(%rsp), %rsi
leaq 0x18(%rsp), %rdx
leaq 0x8(%rsp), %rcx
callq 0x2b87c
leaq 0xd8(%rsp), %r15
leaq 0x78(%rsp), %r14
movaps -0x8(%r14), %xmm0
movaps %xmm0, -0x8(%r15)
xorps %xmm0, %xmm0
movaps %xmm0, -0x8(%r14)
leaq 0x4c(%rsp), %rsi
movl $0x2a, (%rsi)
leaq 0x50(%rsp), %rdi
callq 0xbc7c
leaq 0x68(%rsp), %r13
leaq 0x58(%rsp), %r12
movaps -0x8(%r12), %xmm0
movaps %xmm0, -0x8(%r13)
xorps %xmm0, %xmm0
movaps %xmm0, -0x8(%r12)
leaq 0xd0(%rsp), %rsi
leaq 0x60(%rsp), %rdx
movq %rbx, %rdi
callq 0x298b4
movq %r13, %rdi
callq 0xa248
movq %r12, %rdi
callq 0xa248
movq %r15, %rdi
callq 0xa248
movq %r14, %rdi
callq 0xa248
leaq 0x10(%rsp), %rdi
callq 0xa248
leaq 0x20(%rsp), %rdi
callq 0xa248
leaq 0x30(%rsp), %rdi
callq 0xa248
leaq 0x16551(%rip), %rsi     # 0x3c363
leaq 0x70(%rsp), %rdi
leaq 0x18(%rsp), %rdx
callq 0xeb2e
leaq 0x16561(%rip), %rsi     # 0x3c389
leaq 0x28(%rsp), %rdi
leaq 0x8(%rsp), %rdx
callq 0xeb2e
leaq 0x70(%rsp), %rsi
leaq 0x28(%rsp), %rdx
movq %rbx, %rdi
callq 0x2983a
leaq 0x28(%rsp), %rdi
callq 0x9130
leaq 0x70(%rsp), %rdi
callq 0x9130
leaq 0x7(%rsp), %rsi
movb $0x0, (%rsi)
leaq 0x28(%rsp), %rdi
callq 0xbaf2
leaq 0x16530(%rip), %rsi     # 0x3c3a6
leaq 0x8(%rsp), %rdi
callq 0x2b094
leaq 0x4c(%rsp), %rsi
movl $0x1f, (%rsi)
leaq 0x60(%rsp), %rdi
callq 0xbc7c
leaq 0x48(%rsp), %rsi
movl $0x15, (%rsi)
leaq 0x50(%rsp), %rdi
callq 0xbc7c
leaq 0x18(%rsp), %rdi
leaq 0x8(%rsp), %rsi
leaq 0x60(%rsp), %rdx
leaq 0x50(%rsp), %rcx
callq 0x2bbbb
leaq 0x164dc(%rip), %rsi     # 0x3c3a6
leaq 0x70(%rsp), %rdi
leaq 0x28(%rsp), %rdx
leaq 0x18(%rsp), %rcx
callq 0x2b9fe
leaq 0xc8(%rsp), %r15
leaq 0x78(%rsp), %r14
movaps -0x8(%r14), %xmm0
movaps %xmm0, -0x8(%r15)
xorps %xmm0, %xmm0
movaps %xmm0, -0x8(%r14)
leaq 0x9c(%rsp), %rsi
movl $0x15, (%rsi)
leaq 0xa0(%rsp), %rdi
callq 0xbc7c
leaq 0xb8(%rsp), %r13
leaq 0xa8(%rsp), %r12
movaps -0x8(%r12), %xmm0
movaps %xmm0, -0x8(%r13)
xorps %xmm0, %xmm0
movaps %xmm0, -0x8(%r12)
leaq 0xc0(%rsp), %rsi
leaq 0xb0(%rsp), %rdx
movq %rbx, %rdi
callq 0x298b4
movq %r13, %rdi
callq 0xa248
movq %r12, %rdi
callq 0xa248
movq %r15, %rdi
callq 0xa248
movq %r14, %rdi
callq 0xa248
leaq 0x20(%rsp), %rdi
callq 0xa248
leaq 0x58(%rsp), %rdi
callq 0xa248
leaq 0x68(%rsp), %rdi
callq 0xa248
leaq 0x10(%rsp), %rdi
callq 0xa248
leaq 0x30(%rsp), %rdi
callq 0xa248
addq $0xe0, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq %rax, %rbx
movq %r13, %rdi
callq 0xa248
movq %r12, %rdi
callq 0xa248
jmp 0x25fcf
movq %rax, %rbx
movq %r15, %rdi
callq 0xa248
movq %r14, %rdi
callq 0xa248
jmp 0x25fe4
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0xa248
jmp 0x25ff3
movq %rax, %rbx
leaq 0x58(%rsp), %rdi
callq 0xa248
jmp 0x26002
movq %rax, %rbx
leaq 0x68(%rsp), %rdi
callq 0xa248
leaq 0x10(%rsp), %rdi
jmp 0x26063
movq %rax, %rbx
jmp 0x2600c
jmp 0x26074
jmp 0x26099
jmp 0x2607b
jmp 0x2608a
jmp 0x26099
movq %rax, %rbx
movq %r13, %rdi
callq 0xa248
movq %r12, %rdi
callq 0xa248
jmp 0x2603a
movq %rax, %rbx
movq %r15, %rdi
callq 0xa248
movq %r14, %rdi
callq 0xa248
jmp 0x2604f
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0xa248
jmp 0x2605e
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0xa248
leaq 0x30(%rsp), %rdi
callq 0xa248
jmp 0x2609c
movq %rax, %rbx
jmp 0x26068
jmp 0x26099
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x9130
jmp 0x2608d
movq %rax, %rbx
leaq 0x70(%rsp), %rdi
callq 0x9130
jmp 0x2609c
movq %rax, %rbx
movq %rbx, %rdi
callq 0x94d0