// File: /workspace/github_cpp_makefile_star2_O1/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 0x2ec3c(%rip), %rax     # 0x62b30
movq %rax, (%rdi)
leaq 0x2cc12(%rip), %r13     # 0x60b10
leaq 0x20(%rsp), %rsi
movq %r13, (%rsi)
movl $0x2a, 0x8(%rsi)
leaq 0x60(%rsp), %rdi
callq 0x2bc40
leaq 0x60(%rsp), %rdi
callq 0x2bd94
movq (%rax), %rsi
leaq 0x2e60d(%rip), %rax     # 0x62538
movq %rsp, %rdx
movq %rax, (%rdx)
movq %rbx, %rdi
callq 0x3bb0a
leaq 0x60(%rsp), %rdi
callq 0x19d96
movl $0x20, %edi
callq 0x92d0
movq %rax, %r14
movabsq $0x100000001, %rbp      # imm = 0x100000001
movq %rbp, 0x8(%rax)
leaq 0x2cb5b(%rip), %r12     # 0x60ac0
movq %r12, (%rax)
movq %r13, 0x10(%rax)
movl $0x2, 0x18(%rax)
movq $0x0, 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 $0x3, 0x18(%rax)
movq %rax, 0x18(%rsp)
movq %rcx, 0x10(%rsp)
movq $0x0, 0x50(%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 0x3694a
movq %r14, %rcx
addq $0x10, %rcx
movq (%rsp), %rax
movq 0x8(%rsp), %r15
xorps %xmm0, %xmm0
movaps %xmm0, (%rsp)
leaq 0x2def2(%rip), %rdx     # 0x61f10
movq %rdx, 0x20(%rsp)
movq %rcx, 0x28(%rsp)
movq %r14, 0x30(%rsp)
movq 0x2ef7c(%rip), %rcx     # 0x62fb0
cmpb $0x0, (%rcx)
je 0x3403f
incl 0x8(%r14)
jmp 0x34044
lock
incl 0x8(%r14)
movq %rax, 0x38(%rsp)
movq %r15, 0x40(%rsp)
testq %r15, %r15
je 0x34063
cmpb $0x0, (%rcx)
je 0x3405e
incl 0x8(%r15)
jmp 0x34063
lock
incl 0x8(%r15)
leaq 0x2dfae(%rip), %rax     # 0x62018
leaq 0x20(%rsp), %rsi
movq %rax, (%rsi)
leaq 0x60(%rsp), %rdi
callq 0x2bc40
leaq 0x60(%rsp), %rdi
callq 0x2bd94
movq (%rax), %rsi
leaq 0x48(%rsp), %rdx
leaq 0x2e4a3(%rip), %rax     # 0x62538
movq %rax, (%rdx)
movq %rbx, %rdi
callq 0x3bb0a
leaq 0x60(%rsp), %rdi
callq 0x19d96
leaq 0x2de5f(%rip), %rax     # 0x61f10
movq %rax, 0x20(%rsp)
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0x340c5
callq 0xaa12
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x340d4
callq 0xaa12
testq %r15, %r15
je 0x340e1
movq %r15, %rdi
callq 0xaa12
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x340f0
callq 0xaa12
movq 0x58(%rsp), %rdi
testq %rdi, %rdi
je 0x340ff
callq 0xaa12
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x3410e
callq 0xaa12
movq %r14, %rdi
callq 0xaa12
movl $0x20, %edi
callq 0x92d0
movq %rax, %r14
movq %rbp, 0x8(%rax)
movq %r12, (%rax)
movq %r13, 0x10(%rax)
movl $0x5, 0x18(%rax)
movq $0x0, 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)
movq %rax, 0x18(%rsp)
movq %rcx, 0x10(%rsp)
movq $0x0, 0x50(%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 0x3bcfa
movq %r14, %rcx
addq $0x10, %rcx
movq (%rsp), %rax
movq 0x8(%rsp), %r15
xorps %xmm0, %xmm0
movaps %xmm0, (%rsp)
leaq 0x2dd30(%rip), %rdx     # 0x61f10
movq %rdx, 0x20(%rsp)
movq %rcx, 0x28(%rsp)
movq %r14, 0x30(%rsp)
movq 0x2edba(%rip), %rcx     # 0x62fb0
cmpb $0x0, (%rcx)
je 0x34201
incl 0x8(%r14)
jmp 0x34206
lock
incl 0x8(%r14)
movq %rax, 0x38(%rsp)
movq %r15, 0x40(%rsp)
testq %r15, %r15
je 0x34225
cmpb $0x0, (%rcx)
je 0x34220
incl 0x8(%r15)
jmp 0x34225
lock
incl 0x8(%r15)
leaq 0x2de7c(%rip), %rax     # 0x620a8
leaq 0x20(%rsp), %rsi
movq %rax, (%rsi)
leaq 0x60(%rsp), %rdi
callq 0x2bc40
leaq 0x60(%rsp), %rdi
callq 0x2bd94
movq (%rax), %rsi
leaq 0x48(%rsp), %rdx
leaq 0x2e2e1(%rip), %rax     # 0x62538
movq %rax, (%rdx)
movq %rbx, %rdi
callq 0x3bb0a
leaq 0x60(%rsp), %rdi
callq 0x19d96
leaq 0x2dc9d(%rip), %rax     # 0x61f10
movq %rax, 0x20(%rsp)
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0x34287
callq 0xaa12
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x34296
callq 0xaa12
testq %r15, %r15
je 0x342a3
movq %r15, %rdi
callq 0xaa12
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x342b2
callq 0xaa12
movq 0x58(%rsp), %rdi
testq %rdi, %rdi
je 0x342c1
callq 0xaa12
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x342d0
callq 0xaa12
movq %r14, %rdi
callq 0xaa12
movl $0x20, %edi
callq 0x92d0
movq %rbp, 0x8(%rax)
leaq 0x2c6bb(%rip), %rcx     # 0x609a8
movq %rcx, (%rax)
movq %rax, %rcx
addq $0x10, %rcx
leaq 0x2c75a(%rip), %rdx     # 0x60a58
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 0x25eae
leaq 0x20(%rsp), %rdi
movq %r14, %rsi
callq 0x2bc40
leaq 0x20(%rsp), %rdi
callq 0x2bd94
movq (%rax), %rsi
movq %rsp, %rdx
leaq 0x2e17c(%rip), %rax     # 0x62538
movq %rax, (%rdx)
movq %rbx, %rdi
callq 0x3bb0a
leaq 0x20(%rsp), %rdi
callq 0x19d96
leaq 0x2d828(%rip), %rax     # 0x61c00
movq %rax, 0x60(%rsp)
movq 0x90(%rsp), %rdi
testq %rdi, %rdi
je 0x343ef
callq 0xaa12
movq 0x80(%rsp), %rdi
testq %rdi, %rdi
je 0x34401
callq 0xaa12
movq 0x70(%rsp), %rdi
testq %rdi, %rdi
je 0x34410
callq 0xaa12
movq 0xc0(%rsp), %rdi
testq %rdi, %rdi
je 0x34422
callq 0xaa12
movq 0xa0(%rsp), %rdi
testq %rdi, %rdi
je 0x34434
callq 0xaa12
movq 0xb0(%rsp), %rdi
testq %rdi, %rdi
je 0x34446
callq 0xaa12
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x3445a
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x19d96
jmp 0x3446c
movq %rax, %rbx
leaq 0x60(%rsp), %rdi
callq 0x25f3a
movq 0xc0(%rsp), %rdi
testq %rdi, %rdi
je 0x3448d
callq 0xaa12
jmp 0x3448d
movq %rax, %rbx
movq 0xa0(%rsp), %rdi
testq %rdi, %rdi
je 0x344a4
callq 0xaa12
jmp 0x344a4
movq %rax, %rbx
movq 0xb0(%rsp), %rdi
testq %rdi, %rdi
jne 0x3453a
jmp 0x34557
jmp 0x34554
jmp 0x344d2
jmp 0x344d2
jmp 0x344e1
jmp 0x3450c
jmp 0x34520
jmp 0x34534
jmp 0x34554
jmp 0x344d2
movq %rax, %rbx
leaq 0x60(%rsp), %rdi
callq 0x19d96
jmp 0x344e4
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x27888
testq %r15, %r15
je 0x344fb
movq %r15, %rdi
callq 0xaa12
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x3450f
callq 0xaa12
jmp 0x3450f
movq %rax, %rbx
movq 0x58(%rsp), %rdi
testq %rdi, %rdi
je 0x34523
callq 0xaa12
jmp 0x34523
movq %rax, %rbx
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x34537
callq 0xaa12
jmp 0x34537
movq %rax, %rbx
movq %r14, %rdi
callq 0xaa12
jmp 0x34557
jmp 0x34554
jmp 0x34545
movq %rax, %rbx
leaq 0x60(%rsp), %rdi
callq 0x19d96
jmp 0x34557
movq %rax, %rbx
movq %rbx, %rdi
callq 0x94e0
nop