// File: /workspace/github_cpp_makefile_star2_O2/pfnet-research[P]pml/src/test.cpp
// Function: simple_type_arith::simple_type_arith()
PML_TEST(simple_type_arith) {
    assert_eq(
        *simty::simple_typing(ast::int_expr_t{42}).ok(),
        simty::int_type_t{});

    // 2+3*4
    assert_eq(
        *simty::simple_typing(ast::add_expr_t {
            make<ast::int_expr_t>(2),
            make<ast::mul_expr_t>(
                make<ast::int_expr_t>(3),
                make<ast::int_expr_t>(4))}).ok(),
        simty::int_type_t{});

    // 5-4/2
    assert_eq(
        *simty::simple_typing(ast::sub_expr_t {
            make<ast::int_expr_t>(5),
            make<ast::div_expr_t>(
                make<ast::int_expr_t>(4),
                make<ast::int_expr_t>(2))}).ok(),
        simty::int_type_t{});

    // if 1=3 then 1 else 2
    assert_eq(
        *simty::simple_typing(ast::if_expr_t {
            make<ast::bool_expr_t>(true),
            make<ast::int_expr_t>(1),
            make<ast::int_expr_t>(2)}).ok(),
        simty::int_type_t{});
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x148, %rsp            # imm = 0x148
movq %rdi, %rbx
andl $0x0, 0x8(%rdi)
leaq 0x3374b(%rip), %rax     # 0x5bb20
movq %rax, (%rdi)
leaq 0x31749(%rip), %rax     # 0x59b28
leaq 0x70(%rsp), %rsi
movq %rax, (%rsi)
movl $0x2a, 0x8(%rsi)
leaq 0x98(%rsp), %rdi
callq 0x222d4
leaq 0x98(%rsp), %rdi
callq 0x223e4
movq (%rax), %rsi
leaq 0x3313e(%rip), %rax     # 0x5b550
leaq 0x40(%rsp), %rdx
movq %rax, (%rdx)
movq %rbx, %rdi
callq 0x2f09e
leaq 0x98(%rsp), %rdi
callq 0x13c86
leaq 0xc(%rsp), %rsi
movl $0x2, (%rsi)
leaq 0x40(%rsp), %rdi
callq 0xbc7c
leaq 0x138(%rsp), %r15
leaq 0x48(%rsp), %r14
movaps -0x8(%r14), %xmm0
movaps %xmm0, -0x8(%r15)
xorps %xmm0, %xmm0
movaps %xmm0, -0x8(%r14)
leaq 0x8(%rsp), %rsi
movl $0x3, (%rsi)
leaq 0x10(%rsp), %rdi
callq 0xbc7c
leaq 0x3c(%rsp), %rsi
movl $0x4, (%rsi)
leaq 0x28(%rsp), %rdi
callq 0xbc7c
leaq 0x50(%rsp), %rdi
leaq 0x10(%rsp), %rsi
leaq 0x28(%rsp), %rdx
callq 0x2a408
leaq 0x128(%rsp), %r13
leaq 0x58(%rsp), %r12
movaps -0x8(%r12), %xmm0
movaps %xmm0, -0x8(%r13)
xorps %xmm0, %xmm0
movaps %xmm0, -0x8(%r12)
leaq 0x70(%rsp), %rbp
leaq 0x130(%rsp), %rsi
leaq 0x120(%rsp), %rdx
movq %rbp, %rdi
callq 0x1e466
leaq 0x98(%rsp), %rdi
movq %rbp, %rsi
callq 0x222d4
leaq 0x98(%rsp), %rdi
callq 0x223e4
leaq 0x3304d(%rip), %rbp     # 0x5b550
movq (%rax), %rsi
leaq 0x68(%rsp), %rdx
movq %rbp, (%rdx)
movq %rbx, %rdi
callq 0x2f09e
leaq 0x98(%rsp), %rdi
callq 0x13c86
leaq 0x70(%rsp), %rdi
callq 0x1f1c4
movq %r13, %rdi
callq 0xa248
movq %r12, %rdi
callq 0xa248
leaq 0x30(%rsp), %rdi
callq 0xa248
leaq 0x18(%rsp), %rdi
callq 0xa248
movq %r15, %rdi
callq 0xa248
movq %r14, %rdi
callq 0xa248
leaq 0xc(%rsp), %rsi
movl $0x5, (%rsi)
leaq 0x40(%rsp), %rdi
callq 0xbc7c
leaq 0x118(%rsp), %r15
leaq 0x48(%rsp), %r14
movaps -0x8(%r14), %xmm0
movaps %xmm0, -0x8(%r15)
xorps %xmm0, %xmm0
movaps %xmm0, -0x8(%r14)
leaq 0x8(%rsp), %rsi
movl $0x4, (%rsi)
leaq 0x10(%rsp), %rdi
callq 0xbc7c
leaq 0x3c(%rsp), %rsi
movl $0x2, (%rsi)
leaq 0x28(%rsp), %rdi
callq 0xbc7c
leaq 0x50(%rsp), %rdi
leaq 0x10(%rsp), %rsi
leaq 0x28(%rsp), %rdx
callq 0x2f228
leaq 0x108(%rsp), %r13
leaq 0x58(%rsp), %r12
movaps -0x8(%r12), %xmm0
movaps %xmm0, -0x8(%r13)
xorps %xmm0, %xmm0
movaps %xmm0, -0x8(%r12)
leaq 0x70(%rsp), %rdi
leaq 0x110(%rsp), %rsi
leaq 0x100(%rsp), %rdx
callq 0x1e69c
leaq 0x98(%rsp), %rdi
leaq 0x70(%rsp), %rsi
callq 0x222d4
leaq 0x98(%rsp), %rdi
callq 0x223e4
movq (%rax), %rsi
leaq 0x68(%rsp), %rdx
movq %rbp, (%rdx)
movq %rbx, %rdi
callq 0x2f09e
leaq 0x98(%rsp), %rdi
callq 0x13c86
leaq 0x70(%rsp), %rdi
callq 0x1f1c4
movq %r13, %rdi
callq 0xa248
movq %r12, %rdi
callq 0xa248
leaq 0x30(%rsp), %rdi
callq 0xa248
leaq 0x18(%rsp), %rdi
callq 0xa248
movq %r15, %rdi
callq 0xa248
movq %r14, %rdi
callq 0xa248
leaq 0x8(%rsp), %rsi
movb $0x1, (%rsi)
leaq 0x40(%rsp), %rdi
callq 0xbaf2
leaq 0xe8(%rsp), %rax
leaq 0x48(%rsp), %r14
movaps -0x8(%r14), %xmm0
movaps %xmm0, -0x8(%rax)
xorps %xmm0, %xmm0
movaps %xmm0, -0x8(%r14)
leaq 0x68(%rsp), %rsi
movl $0x1, (%rsi)
leaq 0x50(%rsp), %rdi
callq 0xbc7c
leaq 0xd8(%rsp), %rax
leaq 0x58(%rsp), %r12
movaps -0x8(%r12), %xmm0
movaps %xmm0, -0x8(%rax)
xorps %xmm0, %xmm0
movaps %xmm0, -0x8(%r12)
leaq 0xc(%rsp), %rsi
movl $0x2, (%rsi)
leaq 0x10(%rsp), %rdi
callq 0xbc7c
leaq 0xf8(%rsp), %r15
leaq 0x18(%rsp), %rbp
movaps -0x8(%rbp), %xmm0
movaps %xmm0, -0x8(%r15)
xorps %xmm0, %xmm0
movaps %xmm0, -0x8(%rbp)
leaq 0x98(%rsp), %r13
leaq 0xe0(%rsp), %rsi
leaq 0xd0(%rsp), %rdx
leaq 0xf0(%rsp), %rcx
movq %r13, %rdi
callq 0x1d1d2
leaq 0x70(%rsp), %rdi
movq %r13, %rsi
callq 0x222d4
leaq 0x70(%rsp), %rdi
callq 0x223e4
movq (%rax), %rsi
leaq 0x28(%rsp), %rdx
leaq 0x32de0(%rip), %rax     # 0x5b550
movq %rax, (%rdx)
movq %rbx, %rdi
callq 0x2f09e
leaq 0x70(%rsp), %rdi
callq 0x13c86
leaq 0x98(%rsp), %rdi
callq 0x1d218
movq %r15, %rdi
callq 0xa248
movq %rbp, %rdi
callq 0xa248
leaq 0xd8(%rsp), %rdi
callq 0xa248
movq %r12, %rdi
callq 0xa248
leaq 0xe8(%rsp), %rdi
callq 0xa248
movq %r14, %rdi
callq 0xa248
addq $0x148, %rsp            # imm = 0x148
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x287e0
movq %rax, %rbx
leaq 0x70(%rsp), %rdi
callq 0x13c86
jmp 0x287f2
movq %rax, %rbx
leaq 0x98(%rsp), %rdi
callq 0x1d218
movq %r15, %rdi
callq 0xa248
movq %rbp, %rdi
callq 0xa248
jmp 0x28814
movq %rax, %rbx
leaq 0xd8(%rsp), %rdi
callq 0xa248
movq %r12, %rdi
callq 0xa248
jmp 0x2882e
movq %rax, %rbx
leaq 0xe8(%rsp), %rdi
jmp 0x288a0
jmp 0x288d5
jmp 0x28855
jmp 0x28855
jmp 0x28867
movq %rax, %rbx
jmp 0x28874
jmp 0x28886
jmp 0x288b5
jmp 0x288ba
jmp 0x288d5
jmp 0x28855
movq %rax, %rbx
leaq 0x98(%rsp), %rdi
callq 0x13c86
jmp 0x2886a
movq %rax, %rbx
leaq 0x70(%rsp), %rdi
callq 0x1f1c4
movq %r13, %rdi
callq 0xa248
movq %r12, %rdi
callq 0xa248
jmp 0x28889
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0xa248
leaq 0x18(%rsp), %rdi
callq 0xa248
movq %r15, %rdi
callq 0xa248
movq %r14, %rdi
callq 0xa248
movq %rbx, %rdi
callq 0x94d0
movq %rax, %rbx
jmp 0x28893
movq %rax, %rbx
jmp 0x2889d
jmp 0x288d5
jmp 0x288c3
movq %rax, %rbx
leaq 0x98(%rsp), %rdi
callq 0x13c86
jmp 0x288ad
movq %rax, %rbx
jmp 0x288ad