// File: /workspace/github_cpp_makefile_star2_O1/pfnet-research[P]pml/src/test.cpp
// Function: typecheck_test::typecheck_test()
PML_TEST(typecheck_test) {
    using namespace typechecker;
    assert_(
        typecheck(ast::let_expr_t{ "a",
            make<ast::rand_expr_t>(0, 1),
            make<ast::typed_expr_t>(
                    make<ast::var_expr_t>("a"),
                    ast::refinement_type_t{
                            "x", logic::domain_kind_t::Int,
                            make<logic::eq_formula_t>(
                                    make<logic::prob_term_t>(
                                        make<logic::eq_formula_t>(
                                            make<logic::var_term_t>("x"),
                                            make<logic::int_term_t>(0))),
                                    make<logic::div_term_t>(
                                        make<logic::int_term_t>(1),
                                        make<logic::int_term_t>(2)))})
        }),
        "can not type `let a = rand(0, 1) in a : {x:int | Prob(x=0) = 1/2}`");
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x188, %rsp            # imm = 0x188
movq %rdi, %rbx
movl $0x0, 0x8(%rdi)
leaq 0x2d98a(%rip), %rax     # 0x62c70
movq %rax, (%rdi)
leaq 0xe8(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x1590f(%rip), %rsi     # 0x4ac0b
leaq 0x15909(%rip), %rdx     # 0x4ac0c
leaq 0xd8(%rsp), %rdi
callq 0x11866
movl $0x20, %edi
callq 0x92d0
movabsq $0x100000001, %r12      # imm = 0x100000001
movq %r12, 0x8(%rax)
leaq 0x2c8f9(%rip), %rcx     # 0x61c28
movq %rcx, (%rax)
movq %rax, %rcx
addq $0x10, %rcx
leaq 0x2c938(%rip), %rdx     # 0x61c78
movq %rdx, 0x10(%rax)
movabsq $0x100000000, %rdx      # imm = 0x100000000
movq %rdx, 0x18(%rax)
movq %rcx, 0xa8(%rsp)
movq %rax, 0xb0(%rsp)
leaq 0xa0(%rsp), %rdi
movq $0x0, -0x8(%rdi)
leaq 0x15892(%rip), %rcx     # 0x4ac0b
leaq 0x98(%rsp), %rsi
leaq 0xf8(%rsp), %rdx
callq 0x37386
leaq 0x108(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x15999(%rip), %rsi     # 0x4ad3a
leaq 0x15993(%rip), %rdx     # 0x4ad3b
leaq 0xf8(%rsp), %rdi
callq 0x11866
movl $0x0, 0x118(%rsp)
leaq 0x70(%rsp), %rdi
movq $0x0, -0x8(%rdi)
leaq 0x15966(%rip), %rcx     # 0x4ad3a
leaq 0x68(%rsp), %rsi
leaq 0x8(%rsp), %rdx
callq 0x3c492
movq $0x0, 0xc8(%rsp)
movl $0x20, %edi
callq 0x92d0
movq %r12, 0x8(%rax)
leaq 0x2c4ac(%rip), %r13     # 0x618b0
movq %r13, (%rax)
movq %rax, %rcx
addq $0x10, %rcx
leaq 0x2c4eb(%rip), %rbp     # 0x61900
movq %rbp, 0x10(%rax)
movl $0x0, 0x18(%rax)
leaq 0xc8(%rsp), %r8
movq %rax, 0x8(%r8)
movq %rcx, (%r8)
leaq 0x80(%rsp), %rdi
movq $0x0, -0x8(%rdi)
leaq 0x78(%rsp), %rsi
leaq 0x8(%rsp), %rdx
leaq 0x68(%rsp), %rcx
callq 0x3c38c
leaq 0x90(%rsp), %rdi
movq $0x0, -0x8(%rdi)
leaq 0x88(%rsp), %rsi
leaq 0x8(%rsp), %rdx
leaq 0x78(%rsp), %rcx
callq 0x3c2ca
movq $0x0, 0x28(%rsp)
movl $0x20, %edi
callq 0x92d0
movq %r12, 0x8(%rax)
movq %r13, (%rax)
movq %rax, %rcx
addq $0x10, %rcx
movq %rbp, 0x10(%rax)
movl $0x1, 0x18(%rax)
movq %rax, 0x30(%rsp)
movq %rcx, 0x28(%rsp)
movq $0x0, 0xb8(%rsp)
movl $0x20, %edi
callq 0x92d0
movq %r12, 0x8(%rax)
movq %r13, (%rax)
movq %rax, %rcx
addq $0x10, %rcx
movq %rbp, 0x10(%rax)
movl $0x2, 0x18(%rax)
leaq 0xb8(%rsp), %r8
movq %rax, 0x8(%r8)
movq %rcx, (%r8)
leaq 0x60(%rsp), %rdi
movq $0x0, -0x8(%rdi)
leaq 0x58(%rsp), %rsi
leaq 0x8(%rsp), %rdx
leaq 0x28(%rsp), %rcx
callq 0x3b942
leaq 0x40(%rsp), %rdi
movq $0x0, -0x8(%rdi)
leaq 0x38(%rsp), %rsi
leaq 0x8(%rsp), %rdx
leaq 0x88(%rsp), %rcx
leaq 0x58(%rsp), %r8
callq 0x3c1c4
movups 0x38(%rsp), %xmm0
leaq 0xf8(%rsp), %r8
movups %xmm0, 0x28(%r8)
xorps %xmm0, %xmm0
movups %xmm0, 0x38(%rsp)
leaq 0x50(%rsp), %rdi
movq $0x0, -0x8(%rdi)
leaq 0x48(%rsp), %rsi
leaq 0x8(%rsp), %rdx
leaq 0x98(%rsp), %rcx
callq 0x3c0e2
movups 0x48(%rsp), %xmm0
leaq 0x130(%rsp), %rcx
movups %xmm0, (%rcx)
xorps %xmm0, %xmm0
movups %xmm0, 0x48(%rsp)
leaq 0x140(%rsp), %rdi
leaq 0xd8(%rsp), %rsi
leaq 0xa8(%rsp), %rdx
callq 0x25862
leaq 0x140(%rsp), %rdi
callq 0x44d9a
movl %eax, %ebp
leaq 0x18(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x15abf(%rip), %rsi     # 0x4b08a
leaq 0x15afa(%rip), %rdx     # 0x4b0cc
leaq 0x8(%rsp), %rdi
callq 0x11866
movzbl %bpl, %esi
leaq 0x8(%rsp), %rdx
movq %rbx, %rdi
callq 0x3607c
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x35604
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x92e0
leaq 0x2c505(%rip), %rax     # 0x61b10
movq %rax, 0x140(%rsp)
movq 0x180(%rsp), %rdi
testq %rdi, %rdi
je 0x35625
callq 0xaa12
movq 0x170(%rsp), %rdi
testq %rdi, %rdi
je 0x35637
callq 0xaa12
leaq 0x158(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x35658
movq 0x158(%rsp), %rsi
incq %rsi
callq 0x92e0
movq 0x138(%rsp), %rdi
testq %rdi, %rdi
je 0x3566a
callq 0xaa12
movq 0x50(%rsp), %rdi
testq %rdi, %rdi
je 0x35679
callq 0xaa12
movq 0x128(%rsp), %rdi
testq %rdi, %rdi
je 0x3568b
callq 0xaa12
movq 0xf8(%rsp), %rdi
cmpq %r15, %rdi
je 0x356a8
movq 0x108(%rsp), %rsi
incq %rsi
callq 0x92e0
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0x356b7
callq 0xaa12
movq 0x60(%rsp), %rdi
testq %rdi, %rdi
je 0x356c6
callq 0xaa12
movq 0xc0(%rsp), %rdi
testq %rdi, %rdi
je 0x356d8
callq 0xaa12
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x356e7
callq 0xaa12
movq 0x90(%rsp), %rdi
testq %rdi, %rdi
je 0x356f9
callq 0xaa12
movq 0x80(%rsp), %rdi
testq %rdi, %rdi
je 0x3570b
callq 0xaa12
movq 0xd0(%rsp), %rdi
testq %rdi, %rdi
je 0x3571d
callq 0xaa12
movq 0x70(%rsp), %rdi
testq %rdi, %rdi
je 0x3572c
callq 0xaa12
movq 0xa0(%rsp), %rdi
testq %rdi, %rdi
je 0x3573e
callq 0xaa12
movq 0xb0(%rsp), %rdi
testq %rdi, %rdi
je 0x35750
callq 0xaa12
movq 0xd8(%rsp), %rdi
cmpq %r14, %rdi
je 0x3576d
movq 0xe8(%rsp), %rsi
incq %rsi
callq 0x92e0
addq $0x188, %rsp            # imm = 0x188
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x357a0
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x92e0
jmp 0x357a0
jmp 0x3579d
movq %rax, %rbx
leaq 0x140(%rsp), %rdi
callq 0x258f4
jmp 0x357b2
movq %rax, %rbx
movq 0x138(%rsp), %rdi
testq %rdi, %rdi
je 0x357c4
callq 0xaa12
movq 0x50(%rsp), %rdi
testq %rdi, %rdi
je 0x357d8
callq 0xaa12
jmp 0x357d8
movq %rax, %rbx
leaq 0xf8(%rsp), %rdi
callq 0x24c5c
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0x357f4
callq 0xaa12
xorl %ebp, %ebp
movq 0x60(%rsp), %rdi
testq %rdi, %rdi
je 0x35815
callq 0xaa12
jmp 0x35815
movq %rax, %rbx
movb $0x1, %bpl
jmp 0x357f6
movq %rax, %rbx
movb $0x1, %bpl
movq 0xc0(%rsp), %rdi
testq %rdi, %rdi
je 0x3582f
callq 0xaa12
jmp 0x3582f
movq %rax, %rbx
movb $0x1, %bpl
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x35846
callq 0xaa12
jmp 0x35846
movq %rax, %rbx
movb $0x1, %bpl
movq 0x90(%rsp), %rdi
testq %rdi, %rdi
je 0x35858
callq 0xaa12
movq 0x80(%rsp), %rdi
testq %rdi, %rdi
je 0x3586a
callq 0xaa12
movq 0xd0(%rsp), %rdi
testq %rdi, %rdi
je 0x3587c
callq 0xaa12
movq 0x70(%rsp), %rdi
testq %rdi, %rdi
je 0x3588b
callq 0xaa12
testb %bpl, %bpl
je 0x358d2
movq 0xf8(%rsp), %rdi
cmpq %r15, %rdi
je 0x358d2
movq 0x108(%rsp), %rsi
incq %rsi
callq 0x92e0
jmp 0x358d2
movq %rax, %rbx
movb $0x1, %bpl
jmp 0x35858
movq %rax, %rbx
movb $0x1, %bpl
jmp 0x3586a
movq %rax, %rbx
movb $0x1, %bpl
jmp 0x3587c
movq %rax, %rbx
movb $0x1, %bpl
jmp 0x3588b
movq %rax, %rbx
movq 0xa0(%rsp), %rdi
testq %rdi, %rdi
je 0x358e4
callq 0xaa12
movq 0xb0(%rsp), %rdi
testq %rdi, %rdi
je 0x358f6
callq 0xaa12
movq 0xd8(%rsp), %rdi
cmpq %r14, %rdi
je 0x35913
movq 0xe8(%rsp), %rsi
incq %rsi
callq 0x92e0
movq %rbx, %rdi
callq 0x94e0
movq %rax, %rbx
jmp 0x358e4
movq %rax, %rbx
jmp 0x358f6
nop