// File: /workspace/github_cpp_makefile_star2_O3/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 $0xc8, %rsp
movq %rdi, %rbx
movl $0x0, 0x8(%rdi)
leaq 0x2e1e8(%rip), %rax     # 0x61b30
movq %rax, (%rdi)
leaq 0x2c1e6(%rip), %r13     # 0x5fb38
leaq 0x20(%rsp), %rsi
movq %r13, (%rsi)
movl $0x2a, 0x8(%rsi)
leaq 0x60(%rsp), %rdi
callq 0x2ba98
leaq 0x60(%rsp), %rdi
callq 0x2bbf2
movq (%rax), %rsi
leaq 0x2dbe1(%rip), %rax     # 0x61560
movq %rsp, %rdx
movq %rax, (%rdx)
movq %rbx, %rdi
callq 0x3b2ec
leaq 0x60(%rsp), %rdi
callq 0x19b66
movl $0x20, %edi
callq 0x92d0
movq %rax, %r14
movabsq $0x100000001, %rbp      # imm = 0x100000001
movq %rbp, 0x8(%rax)
leaq 0x2c12f(%rip), %r12     # 0x5fae8
movq %r12, (%rax)
movq %r13, 0x10(%rax)
movl $0x2, 0x18(%rax)
movl $0x20, %edi
callq 0x92d0
movq %rbp, 0x8(%rax)
movq %r12, (%rax)
movq %rax, %rcx
addq $0x10, %rcx
movq %r13, 0x10(%rax)
movl $0x3, 0x18(%rax)
movq %rax, 0x18(%rsp)
movq %rcx, 0x10(%rsp)
movl $0x20, %edi
callq 0x92d0
movq %rbp, 0x8(%rax)
movq %r12, (%rax)
movq %rax, %rcx
addq $0x10, %rcx
movq %r13, 0x10(%rax)
movl $0x4, 0x18(%rax)
leaq 0x50(%rsp), %r8
movq %rax, 0x8(%r8)
movq %rcx, (%r8)
leaq 0x8(%rsp), %rdi
movq $0x0, -0x8(%rdi)
movq %rsp, %rsi
leaq 0x48(%rsp), %rdx
leaq 0x10(%rsp), %rcx
callq 0x36334
movq %r14, %rcx
addq $0x10, %rcx
movq (%rsp), %rax
movq 0x8(%rsp), %r15
xorps %xmm0, %xmm0
movaps %xmm0, (%rsp)
leaq 0x2d4d8(%rip), %rdx     # 0x60f38
movq %rdx, 0x20(%rsp)
movq %rcx, 0x28(%rsp)
movq %r14, 0x30(%rsp)
movq 0x2e53a(%rip), %rcx     # 0x61fb0
cmpb $0x0, (%rcx)
je 0x33a81
incl 0x8(%r14)
jmp 0x33a86
lock
incl 0x8(%r14)
movq %rax, 0x38(%rsp)
movq %r15, 0x40(%rsp)
testq %r15, %r15
je 0x33aa5
cmpb $0x0, (%rcx)
je 0x33aa0
incl 0x8(%r15)
jmp 0x33aa5
lock
incl 0x8(%r15)
leaq 0x2d594(%rip), %rax     # 0x61040
leaq 0x20(%rsp), %rsi
movq %rax, (%rsi)
leaq 0x60(%rsp), %rdi
callq 0x2ba98
leaq 0x60(%rsp), %rdi
callq 0x2bbf2
movq (%rax), %rsi
leaq 0x48(%rsp), %rdx
leaq 0x2da89(%rip), %rax     # 0x61560
movq %rax, (%rdx)
movq %rbx, %rdi
callq 0x3b2ec
leaq 0x60(%rsp), %rdi
callq 0x19b66
leaq 0x2d445(%rip), %rax     # 0x60f38
movq %rax, 0x20(%rsp)
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0x33b07
callq 0xa946
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x33b16
callq 0xa946
testq %r15, %r15
je 0x33b23
movq %r15, %rdi
callq 0xa946
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x33b32
callq 0xa946
movq 0x58(%rsp), %rdi
testq %rdi, %rdi
je 0x33b41
callq 0xa946
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x33b50
callq 0xa946
movq %r14, %rdi
callq 0xa946
movl $0x20, %edi
callq 0x92d0
movq %rax, %r14
movq %rbp, 0x8(%rax)
movq %r12, (%rax)
movq %r13, 0x10(%rax)
movl $0x5, 0x18(%rax)
movl $0x20, %edi
callq 0x92d0
movq %rbp, 0x8(%rax)
movq %r12, (%rax)
movq %rax, %rcx
addq $0x10, %rcx
movq %r13, 0x10(%rax)
movl $0x4, 0x18(%rax)
movq %rax, 0x18(%rsp)
movq %rcx, 0x10(%rsp)
movl $0x20, %edi
callq 0x92d0
movq %rbp, 0x8(%rax)
movq %r12, (%rax)
movq %rax, %rcx
addq $0x10, %rcx
movq %r13, 0x10(%rax)
movl $0x2, 0x18(%rax)
leaq 0x50(%rsp), %r8
movq %rax, 0x8(%r8)
movq %rcx, (%r8)
leaq 0x8(%rsp), %rdi
movq $0x0, -0x8(%rdi)
movq %rsp, %rsi
leaq 0x48(%rsp), %rdx
leaq 0x10(%rsp), %rcx
callq 0x3b4da
movq %r14, %rcx
addq $0x10, %rcx
movq (%rsp), %rax
movq 0x8(%rsp), %r15
xorps %xmm0, %xmm0
movaps %xmm0, (%rsp)
leaq 0x2d328(%rip), %rdx     # 0x60f38
movq %rdx, 0x20(%rsp)
movq %rcx, 0x28(%rsp)
movq %r14, 0x30(%rsp)
movq 0x2e38a(%rip), %rcx     # 0x61fb0
cmpb $0x0, (%rcx)
je 0x33c31
incl 0x8(%r14)
jmp 0x33c36
lock
incl 0x8(%r14)
movq %rax, 0x38(%rsp)
movq %r15, 0x40(%rsp)
testq %r15, %r15
je 0x33c55
cmpb $0x0, (%rcx)
je 0x33c50
incl 0x8(%r15)
jmp 0x33c55
lock
incl 0x8(%r15)
leaq 0x2d474(%rip), %rax     # 0x610d0
leaq 0x20(%rsp), %rsi
movq %rax, (%rsi)
leaq 0x60(%rsp), %rdi
callq 0x2ba98
leaq 0x60(%rsp), %rdi
callq 0x2bbf2
movq (%rax), %rsi
leaq 0x48(%rsp), %rdx
leaq 0x2d8d9(%rip), %rax     # 0x61560
movq %rax, (%rdx)
movq %rbx, %rdi
callq 0x3b2ec
leaq 0x60(%rsp), %rdi
callq 0x19b66
leaq 0x2d295(%rip), %rax     # 0x60f38
movq %rax, 0x20(%rsp)
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0x33cb7
callq 0xa946
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x33cc6
callq 0xa946
testq %r15, %r15
je 0x33cd3
movq %r15, %rdi
callq 0xa946
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x33ce2
callq 0xa946
movq 0x58(%rsp), %rdi
testq %rdi, %rdi
je 0x33cf1
callq 0xa946
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x33d00
callq 0xa946
movq %r14, %rdi
callq 0xa946
movl $0x20, %edi
callq 0x92d0
movq %rbp, 0x8(%rax)
leaq 0x2bceb(%rip), %rcx     # 0x5fa08
movq %rcx, (%rax)
movq %rax, %rcx
addq $0x10, %rcx
leaq 0x2bd52(%rip), %rdx     # 0x5fa80
movq %rdx, 0x10(%rax)
movb $0x1, 0x18(%rax)
movq %rcx, 0xa8(%rsp)
movq %rax, 0xb0(%rsp)
movl $0x20, %edi
callq 0x92d0
movq %rbp, 0x8(%rax)
movq %r12, (%rax)
movq %rax, %rcx
addq $0x10, %rcx
movq %r13, 0x10(%rax)
movl $0x1, 0x18(%rax)
movq %rcx, 0x98(%rsp)
movq %rax, 0xa0(%rsp)
movl $0x20, %edi
callq 0x92d0
movq %rbp, 0x8(%rax)
movq %r12, (%rax)
movq %rax, %rdx
addq $0x10, %rdx
movq %r13, 0x10(%rax)
movl $0x2, 0x18(%rax)
leaq 0xb8(%rsp), %rcx
movq %rdx, (%rcx)
movq %rax, 0x8(%rcx)
leaq 0x60(%rsp), %r14
leaq 0xa8(%rsp), %rsi
leaq 0x98(%rsp), %rdx
movq %r14, %rdi
callq 0x25d54
leaq 0x20(%rsp), %rdi
movq %r14, %rsi
callq 0x2ba98
leaq 0x20(%rsp), %rdi
callq 0x2bbf2
movq (%rax), %rsi
movq %rsp, %rdx
leaq 0x2d774(%rip), %rax     # 0x61560
movq %rax, (%rdx)
movq %rbx, %rdi
callq 0x3b2ec
leaq 0x20(%rsp), %rdi
callq 0x19b66
leaq 0x2ce20(%rip), %rax     # 0x60c28
movq %rax, 0x60(%rsp)
movq 0x90(%rsp), %rdi
testq %rdi, %rdi
je 0x33e1f
callq 0xa946
movq 0x80(%rsp), %rdi
testq %rdi, %rdi
je 0x33e31
callq 0xa946
movq 0x70(%rsp), %rdi
testq %rdi, %rdi
je 0x33e40
callq 0xa946
movq 0xc0(%rsp), %rdi
testq %rdi, %rdi
je 0x33e52
callq 0xa946
movq 0xa0(%rsp), %rdi
testq %rdi, %rdi
je 0x33e64
callq 0xa946
movq 0xb0(%rsp), %rdi
testq %rdi, %rdi
je 0x33e76
callq 0xa946
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x33e8a
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x19b66
jmp 0x33e9c
movq %rax, %rbx
leaq 0x60(%rsp), %rdi
callq 0x25de0
movq 0xc0(%rsp), %rdi
testq %rdi, %rdi
je 0x33ebd
callq 0xa946
jmp 0x33ebd
movq %rax, %rbx
movq 0xa0(%rsp), %rdi
testq %rdi, %rdi
je 0x33ed4
callq 0xa946
jmp 0x33ed4
movq %rax, %rbx
movq 0xb0(%rsp), %rdi
testq %rdi, %rdi
jne 0x33f6a
jmp 0x33f87
jmp 0x33f84
jmp 0x33f02
jmp 0x33f02
jmp 0x33f11
jmp 0x33f3c
jmp 0x33f50
jmp 0x33f64
jmp 0x33f84
jmp 0x33f02
movq %rax, %rbx
leaq 0x60(%rsp), %rdi
callq 0x19b66
jmp 0x33f14
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x276e8
testq %r15, %r15
je 0x33f2b
movq %r15, %rdi
callq 0xa946
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x33f3f
callq 0xa946
jmp 0x33f3f
movq %rax, %rbx
movq 0x58(%rsp), %rdi
testq %rdi, %rdi
je 0x33f53
callq 0xa946
jmp 0x33f53
movq %rax, %rbx
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x33f67
callq 0xa946
jmp 0x33f67
movq %rax, %rbx
movq %r14, %rdi
callq 0xa946
jmp 0x33f87
jmp 0x33f84
jmp 0x33f75
movq %rax, %rbx
leaq 0x60(%rsp), %rdi
callq 0x19b66
jmp 0x33f87
movq %rax, %rbx
movq %rbx, %rdi
callq 0x94e0
nop