// File: /workspace/github_cpp_makefile_star2_O1/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 %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xb8, %rsp
movq %rdi, %rbx
movl $0x0, 0x8(%rdi)
leaq 0x32090(%rip), %rax     # 0x62708
movq %rax, (%rdi)
leaq 0x38(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x1a645(%rip), %rsi     # 0x4acd0
leaq 0x1a654(%rip), %rdx     # 0x4ace6
leaq 0x28(%rsp), %rdi
callq 0x11866
leaq 0x18(%rsp), %rbp
movq %rbp, -0x10(%rbp)
leaq 0x1a63b(%rip), %rsi     # 0x4ace7
leaq 0x1a643(%rip), %rdx     # 0x4acf6
leaq 0x8(%rsp), %rdi
callq 0x11866
leaq 0x28(%rsp), %rsi
leaq 0x8(%rsp), %rdx
movq %rbx, %rdi
callq 0x35a02
movq 0x8(%rsp), %rdi
cmpq %rbp, %rdi
je 0x306e6
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x92e0
movq 0x28(%rsp), %rdi
cmpq %r15, %rdi
je 0x306fd
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x92e0
movq $0x0, 0x8(%rsp)
movl $0x20, %edi
callq 0x92d0
movabsq $0x100000001, %r14      # imm = 0x100000001
movq %r14, 0x8(%rax)
leaq 0x30283(%rip), %rcx     # 0x609a8
movq %rcx, (%rax)
movq %rax, %rcx
addq $0x10, %rcx
leaq 0x30322(%rip), %rdx     # 0x60a58
movq %rdx, 0x10(%rax)
movb $0x1, 0x18(%rax)
movq %rax, 0x10(%rsp)
movq %rcx, 0x8(%rsp)
movq $0x0, 0x58(%rsp)
movl $0x20, %edi
callq 0x92d0
movq %r14, 0x8(%rax)
leaq 0x3035a(%rip), %r12     # 0x60ac0
movq %r12, (%rax)
movq %rax, %rcx
addq $0x10, %rcx
leaq 0x30399(%rip), %r13     # 0x60b10
movq %r13, 0x10(%rax)
movl $0x2a, 0x18(%rax)
movq %rax, 0x60(%rsp)
movq %rcx, 0x58(%rsp)
movq $0x0, 0x68(%rsp)
movl $0x20, %edi
callq 0x92d0
movq %r14, 0x8(%rax)
movq %r12, (%rax)
movq %rax, %rcx
addq $0x10, %rcx
movq %r13, 0x10(%rax)
movl $0x1, 0x18(%rax)
leaq 0x68(%rsp), %r9
movq %rax, 0x8(%r9)
movq %rcx, (%r9)
leaq 0x30(%rsp), %rdi
movq $0x0, -0x8(%rdi)
leaq 0x28(%rsp), %rsi
leaq 0x48(%rsp), %rdx
leaq 0x8(%rsp), %rcx
leaq 0x58(%rsp), %r8
callq 0x37b48
movups 0x28(%rsp), %xmm0
movups %xmm0, 0xa8(%rsp)
xorps %xmm0, %xmm0
movups %xmm0, 0x28(%rsp)
movl $0x20, %edi
callq 0x92d0
movq %r14, 0x8(%rax)
movq %r12, (%rax)
movq %rax, %rcx
addq $0x10, %rcx
movq %r13, 0x10(%rax)
movl $0x2a, 0x18(%rax)
leaq 0x48(%rsp), %rdx
movq %rcx, (%rdx)
movq %rax, 0x8(%rdx)
leaq 0xa8(%rsp), %rsi
movq %rbx, %rdi
callq 0x35a7c
movq 0x50(%rsp), %rdi
testq %rdi, %rdi
je 0x3084d
callq 0xaa12
movq 0xb0(%rsp), %rdi
testq %rdi, %rdi
je 0x3085f
callq 0xaa12
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x3086e
callq 0xaa12
movq 0x70(%rsp), %rdi
testq %rdi, %rdi
je 0x3087d
callq 0xaa12
movq 0x60(%rsp), %rdi
testq %rdi, %rdi
je 0x3088c
callq 0xaa12
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x3089b
callq 0xaa12
leaq 0x28(%rsp), %rdi
movq %r15, (%rdi)
leaq 0x1a44d(%rip), %rsi     # 0x4acf7
leaq 0x1a46b(%rip), %rdx     # 0x4ad1c
callq 0x11866
leaq 0x8(%rsp), %rdi
movq %rbp, (%rdi)
leaq 0x1a458(%rip), %rsi     # 0x4ad1d
leaq 0x1a46d(%rip), %rdx     # 0x4ad39
callq 0x11866
leaq 0x28(%rsp), %rsi
leaq 0x8(%rsp), %rdx
movq %rbx, %rdi
callq 0x35a02
movq 0x8(%rsp), %rdi
cmpq %rbp, %rdi
je 0x308fa
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x92e0
movq 0x28(%rsp), %rdi
cmpq %r15, %rdi
je 0x30911
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x92e0
movq $0x0, 0x8(%rsp)
movl $0x20, %edi
callq 0x92d0
movq %r14, 0x8(%rax)
leaq 0x30079(%rip), %rcx     # 0x609a8
movq %rcx, (%rax)
movq %rax, %rcx
addq $0x10, %rcx
leaq 0x30118(%rip), %rdx     # 0x60a58
movq %rdx, 0x10(%rax)
movb $0x0, 0x18(%rax)
movq %rax, 0x10(%rsp)
movq %rcx, 0x8(%rsp)
leaq 0x70(%rsp), %rdi
movq $0x0, -0x8(%rdi)
leaq 0x1a3d4(%rip), %rcx     # 0x4ad3a
leaq 0x68(%rsp), %rsi
leaq 0x48(%rsp), %rdx
callq 0x37386
movq $0x0, 0x48(%rsp)
movl $0x20, %edi
callq 0x92d0
movq %r14, 0x8(%rax)
movq %r12, (%rax)
movq %rax, %rcx
addq $0x10, %rcx
movq %r13, 0x10(%rax)
movl $0x1f, 0x18(%rax)
movq %rax, 0x50(%rsp)
movq %rcx, 0x48(%rsp)
movq $0x0, 0x88(%rsp)
movl $0x20, %edi
callq 0x92d0
movq %r14, 0x8(%rax)
movq %r12, (%rax)
movq %rax, %rcx
addq $0x10, %rcx
movq %r13, 0x10(%rax)
movl $0x15, 0x18(%rax)
leaq 0x88(%rsp), %r9
movq %rax, 0x8(%r9)
movq %rcx, (%r9)
leaq 0x60(%rsp), %rdi
movq $0x0, -0x8(%rdi)
leaq 0x58(%rsp), %rsi
leaq 0x78(%rsp), %rdx
leaq 0x68(%rsp), %rcx
leaq 0x48(%rsp), %r8
callq 0x37e0c
leaq 0x30(%rsp), %rdi
movq $0x0, -0x8(%rdi)
leaq 0x1a317(%rip), %rcx     # 0x4ad3a
leaq 0x28(%rsp), %rsi
leaq 0x78(%rsp), %rdx
leaq 0x8(%rsp), %r8
leaq 0x58(%rsp), %r9
callq 0x37c78
movups 0x28(%rsp), %xmm0
movups %xmm0, 0x98(%rsp)
xorps %xmm0, %xmm0
movups %xmm0, 0x28(%rsp)
movl $0x20, %edi
callq 0x92d0
movq %r14, 0x8(%rax)
movq %r12, (%rax)
movq %rax, %rcx
addq $0x10, %rcx
movq %r13, 0x10(%rax)
movl $0x15, 0x18(%rax)
leaq 0x78(%rsp), %rdx
movq %rcx, (%rdx)
movq %rax, 0x8(%rdx)
leaq 0x98(%rsp), %rsi
movq %rbx, %rdi
callq 0x35a7c
movq 0x80(%rsp), %rdi
testq %rdi, %rdi
je 0x30aa2
callq 0xaa12
movq 0xa0(%rsp), %rdi
testq %rdi, %rdi
je 0x30ab4
callq 0xaa12
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x30ac3
callq 0xaa12
movq 0x60(%rsp), %rdi
testq %rdi, %rdi
je 0x30ad2
callq 0xaa12
movq 0x90(%rsp), %rdi
testq %rdi, %rdi
je 0x30ae4
callq 0xaa12
movq 0x50(%rsp), %rdi
testq %rdi, %rdi
je 0x30af3
callq 0xaa12
movq 0x70(%rsp), %rdi
testq %rdi, %rdi
je 0x30b02
callq 0xaa12
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x30b11
callq 0xaa12
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq 0x80(%rsp), %rdi
testq %rdi, %rdi
je 0x30b3d
callq 0xaa12
jmp 0x30b3d
movq %rax, %rbx
movq 0xa0(%rsp), %rdi
testq %rdi, %rdi
je 0x30b4f
callq 0xaa12
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x30b63
callq 0xaa12
jmp 0x30b63
movq %rax, %rbx
movq 0x60(%rsp), %rdi
testq %rdi, %rdi
je 0x30b77
callq 0xaa12
jmp 0x30b77
movq %rax, %rbx
movq 0x90(%rsp), %rdi
testq %rdi, %rdi
je 0x30b8e
callq 0xaa12
jmp 0x30b8e
movq %rax, %rbx
movq 0x50(%rsp), %rdi
testq %rdi, %rdi
je 0x30ba2
callq 0xaa12
jmp 0x30ba2
movq %rax, %rbx
movq 0x70(%rsp), %rdi
jmp 0x30c15
jmp 0x30c21
jmp 0x30c6f
jmp 0x30c37
jmp 0x30c53
jmp 0x30c6f
movq %rax, %rbx
movq 0x50(%rsp), %rdi
testq %rdi, %rdi
je 0x30bd6
callq 0xaa12
jmp 0x30bd6
movq %rax, %rbx
movq 0xb0(%rsp), %rdi
testq %rdi, %rdi
je 0x30be8
callq 0xaa12
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x30bfc
callq 0xaa12
jmp 0x30bfc
movq %rax, %rbx
movq 0x70(%rsp), %rdi
testq %rdi, %rdi
je 0x30c10
callq 0xaa12
jmp 0x30c10
movq %rax, %rbx
movq 0x60(%rsp), %rdi
testq %rdi, %rdi
je 0x30c24
callq 0xaa12
jmp 0x30c24
movq %rax, %rbx
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x30c72
callq 0xaa12
jmp 0x30c72
jmp 0x30c6f
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %rbp, %rdi
je 0x30c56
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x92e0
jmp 0x30c56
movq %rax, %rbx
movq 0x28(%rsp), %rdi
cmpq %r15, %rdi
je 0x30c72
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x92e0
jmp 0x30c72
movq %rax, %rbx
movq %rbx, %rdi
callq 0x94e0