// File: /workspace/github_cpp_makefile_star2_O2/pfnet-research[P]pml/src/test.cpp
// Function: parsing_reftype_test::parsing_reftype_test()
PML_TEST(parsing_reftype_test) {
    std::unordered_map<std::string, std::string> inputs = {
        {"{x:int|true}", "Ref(x, Int, Top)"},
        {"{x:bool|x}", "Ref(x, Bool, x)"},
        {"int", "Ref(@blah, Int, Top)"},
        {"bool", "Ref(@blah, Bool, Top)"},
        {"x:int", "Ref(x, Int, Top)"},
        {"x:bool", "Ref(x, Bool, Top)"}
    };
    for (auto const& input : inputs) {
        parser::parse_reftype(input.first).case_of(
            ok >> [&](ast::refinement_type_t const& ty) {
                assert_eq(
                    ast::to_debug_string(ty),
                    input.second);
            },
            error >> [&](parser::error_t err) {
                assert_(false, format("parse error at {} : {}",
                        std::to_string(err.pos), err.message));
            });
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1e8, %rsp            # imm = 0x1E8
movq %rdi, %rbx
andl $0x0, 0x8(%rdi)
leaq 0x3434f(%rip), %rax     # 0x5ba20
movq %rax, (%rdi)
leaq 0x14e50(%rip), %rsi     # 0x3c52b
leaq 0x14e56(%rip), %rdx     # 0x3c538
leaq 0x68(%rsp), %r14
movq %r14, %rdi
callq 0x2d9e6
leaq 0xa8(%rsp), %r15
leaq 0x14ee1(%rip), %rsi     # 0x3c5df
leaq 0x14e44(%rip), %rdx     # 0x3c549
movq %r15, %rdi
callq 0x2da26
leaq 0xe8(%rsp), %r15
leaq 0x14f05(%rip), %rsi     # 0x3c621
leaq 0x14e36(%rip), %rdx     # 0x3c559
movq %r15, %rdi
callq 0x2da66
leaq 0x128(%rsp), %r15
leaq 0x14e52(%rip), %rsi     # 0x3c58c
leaq 0x14e2d(%rip), %rdx     # 0x3c56e
movq %r15, %rdi
callq 0x2daa6
leaq 0x168(%rsp), %r15
leaq 0x14e2c(%rip), %rsi     # 0x3c584
leaq 0x14dd9(%rip), %rdx     # 0x3c538
movq %r15, %rdi
callq 0x2dae6
leaq 0x1a8(%rsp), %r15
leaq 0x14e14(%rip), %rsi     # 0x3c58a
leaq 0x14e14(%rip), %rdx     # 0x3c591
movq %r15, %rdi
callq 0x2db26
leaq 0x1e8(%rsp), %rdx
leaq 0x8(%rsp), %rax
movq %rax, (%rsp)
leaq 0x30(%rsp), %rdi
leaq 0x68(%rsp), %rsi
leaq 0x20(%rsp), %r8
leaq 0x10(%rsp), %r9
xorl %ecx, %ecx
callq 0x2dc1c
movl $0x140, %r14d           # imm = 0x140
leaq (%rsp,%r14), %rdi
addq $0x68, %rdi
callq 0x2db66
addq $-0x40, %r14
cmpq $-0x40, %r14
jne 0x277b7
movq 0x40(%rsp), %r14
leaq 0x68(%rsp), %r15
leaq 0x10(%rsp), %r12
leaq 0x8(%rsp), %r13
testq %r14, %r14
je 0x27834
leaq 0x8(%r14), %rbp
movq %r15, %rdi
movq %rbp, %rsi
callq 0x1aa3c
movq %rbx, 0x20(%rsp)
movq %rbp, 0x28(%rsp)
leaq 0x20(%rsp), %rax
movq %rax, 0x10(%rsp)
movq %rbx, 0x18(%rsp)
leaq 0x18(%rsp), %rax
movq %rax, 0x8(%rsp)
movq %r15, %rdi
movq %r12, %rsi
movq %r13, %rdx
callq 0x2db7c
movq %r15, %rdi
callq 0x1fe92
movq (%r14), %r14
jmp 0x277e2
leaq 0x30(%rsp), %rdi
callq 0x2e2a8
addq $0x1e8, %rsp            # imm = 0x1E8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movl $0x140, %r14d           # imm = 0x140
leaq (%rsp,%r14), %rdi
addq $0x68, %rdi
callq 0x2db66
addq $-0x40, %r14
cmpq $-0x40, %r14
jne 0x27859
jmp 0x278a9
movq %rax, %rbx
jmp 0x278a9
movq %rax, %rbx
addq $-0x40, %r15
movq %r15, %rdi
callq 0x2db66
cmpq %r14, %r15
jne 0x2787a
jmp 0x278a9
movq %rax, %rbx
jmp 0x2789f
movq %rax, %rbx
leaq 0x68(%rsp), %rdi
callq 0x1fe92
leaq 0x30(%rsp), %rdi
callq 0x2e2a8
movq %rbx, %rdi
callq 0x94d0
nop