// File: /workspace/github_cpp_makefile_star2_O1/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
movl $0x0, 0x8(%rdi)
leaq 0x2fd18(%rip), %rax     # 0x62a30
movq %rax, (%rdi)
leaq 0x68(%rsp), %r15
leaq 0x18198(%rip), %rsi     # 0x4aebf
leaq 0x1819e(%rip), %rdx     # 0x4aecc
movq %r15, %r14
movq %r15, %rdi
callq 0x39ff8
leaq 0xa8(%rsp), %r14
leaq 0x1822b(%rip), %rsi     # 0x4af73
leaq 0x1818e(%rip), %rdx     # 0x4aedd
movq %r14, %rdi
callq 0x3a076
leaq 0xe8(%rsp), %r14
leaq 0x1824f(%rip), %rsi     # 0x4afb5
leaq 0x18180(%rip), %rdx     # 0x4aeed
movq %r14, %rdi
callq 0x3a0f4
leaq 0x128(%rsp), %r14
leaq 0x1819c(%rip), %rsi     # 0x4af20
leaq 0x18177(%rip), %rdx     # 0x4af02
movq %r14, %rdi
callq 0x3a172
leaq 0x168(%rsp), %r14
leaq 0x18176(%rip), %rsi     # 0x4af18
leaq 0x18123(%rip), %rdx     # 0x4aecc
movq %r14, %rdi
callq 0x3a1f0
leaq 0x1a8(%rsp), %r14
leaq 0x1815e(%rip), %rsi     # 0x4af1e
leaq 0x1815e(%rip), %rdx     # 0x4af25
movq %r14, %rdi
callq 0x3a26e
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 0x3a43c
movq $-0x180, %r14           # imm = 0xFE80
leaq 0x1d8(%rsp), %r15
movq -0x10(%r15), %rdi
cmpq %rdi, %r15
je 0x32e1e
movq (%r15), %rsi
incq %rsi
callq 0x92e0
movq -0x30(%r15), %rdi
leaq -0x20(%r15), %rax
cmpq %rdi, %rax
je 0x32e36
movq (%rax), %rsi
incq %rsi
callq 0x92e0
addq $-0x40, %r15
addq $0x40, %r14
jne 0x32e0a
movq 0x40(%rsp), %r14
testq %r14, %r14
je 0x32ea9
leaq 0x68(%rsp), %r15
leaq 0x10(%rsp), %r12
leaq 0x8(%rsp), %r13
leaq 0x8(%r14), %rbp
movq %r15, %rdi
movq %rbp, %rsi
callq 0x246e3
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 0x3a322
movq %r15, %rdi
callq 0x28440
movq (%r14), %r14
testq %r14, %r14
jne 0x32e59
leaq 0x30(%rsp), %rdi
callq 0x3abcc
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 0x3a2ec
addq $-0x40, %r14
cmpq $-0x40, %r14
jne 0x32ece
jmp 0x32f23
movq %rax, %rbx
cmpq %r14, %r15
je 0x32f23
leaq 0x68(%rsp), %r15
addq $-0x40, %r14
movq %r14, %rdi
callq 0x3a2ec
cmpq %r15, %r14
jne 0x32ef4
jmp 0x32f23
movq %rax, %rbx
jmp 0x32f19
movq %rax, %rbx
leaq 0x68(%rsp), %rdi
callq 0x28440
leaq 0x30(%rsp), %rdi
callq 0x3abcc
movq %rbx, %rdi
callq 0x94e0
nop