// File: pfnet-research[P]pml/src/parser.cpp
// Function: parser::refty_detail(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, unsigned long&)
refty_result_t refty_detail(std::string const& input, size_t& pos) {
    EXPECT(lbrace_token, LBrace);
    EXPECT(ident_token, Ident);
    EXPECT(colon_token, Colon);
    auto sty_result = simple_type(input, pos);
    if (sty_result.is_error())
        return sty_result.convert<ast::refinement_type_t>();
    EXPECT(bar_token, Bar);
    auto constraint_result = formula(input, pos);
    if (constraint_result.is_error())
        return constraint_result.convert<ast::refinement_type_t>();
    EXPECT(rbrace_token, RBrace);
    return refty_result_t::ok(ast::refinement_type_t {
            ident_token.lexime, sty_result.ok(), constraint_result.ok()
            });
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x3c0, %rsp            # imm = 0x3C0
movq %rdi, -0x2f8(%rbp)
movq %rdi, %rax
movq %rax, -0x2f0(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rax
movq (%rax), %rdx
leaq -0x50(%rbp), %rdi
movq %rdi, -0x2e8(%rbp)
movl $0x1d, %ecx
callq 0x364d0
movq -0x2e8(%rbp), %rdi
callq 0x40510
movb %al, -0x2d9(%rbp)
jmp 0x3a18c
movb -0x2d9(%rbp), %al
testb $0x1, %al
jne 0x3a198
jmp 0x3a1dc
leaq -0x50(%rbp), %rdi
callq 0x405b0
movq %rax, -0x300(%rbp)
jmp 0x3a1aa
movq -0x300(%rbp), %rsi
movq -0x2f8(%rbp), %rdi
callq 0x413a0
jmp 0x3a1bf
movl $0x1, -0x60(%rbp)
jmp 0x3a8ba
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x3a8d3
leaq -0x50(%rbp), %rdi
callq 0x40630
movq %rax, -0x308(%rbp)
jmp 0x3a1ee
movq -0x308(%rbp), %rsi
leaq -0x90(%rbp), %rdi
callq 0x406b0
jmp 0x3a203
movq -0x88(%rbp), %rax
movq %rax, -0x310(%rbp)
leaq -0x80(%rbp), %rdi
callq 0xa280
movq -0x310(%rbp), %rcx
addq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rax
movq (%rax), %rdx
leaq -0xc8(%rbp), %rdi
movl $0xa, %ecx
callq 0x364d0
jmp 0x3a249
leaq -0xc8(%rbp), %rdi
callq 0x40510
movb %al, -0x311(%rbp)
jmp 0x3a25d
movb -0x311(%rbp), %al
testb $0x1, %al
jne 0x3a269
jmp 0x3a2c1
leaq -0xc8(%rbp), %rdi
callq 0x405b0
movq %rax, -0x320(%rbp)
jmp 0x3a27e
movq -0x320(%rbp), %rsi
movq -0x2f8(%rbp), %rdi
callq 0x413a0
jmp 0x3a293
movl $0x1, -0x60(%rbp)
jmp 0x3a886
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x3a8ac
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x3a8a0
leaq -0xc8(%rbp), %rdi
callq 0x40630
movq %rax, -0x328(%rbp)
jmp 0x3a2d6
movq -0x328(%rbp), %rsi
leaq -0xf8(%rbp), %rdi
callq 0x406b0
jmp 0x3a2eb
movq -0xf0(%rbp), %rax
movq %rax, -0x330(%rbp)
leaq -0xe8(%rbp), %rdi
callq 0xa280
movq -0x330(%rbp), %rcx
addq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rax
movq (%rax), %rdx
leaq -0x130(%rbp), %rdi
movl $0x1c, %ecx
callq 0x364d0
jmp 0x3a334
leaq -0x130(%rbp), %rdi
callq 0x40510
movb %al, -0x331(%rbp)
jmp 0x3a348
movb -0x331(%rbp), %al
testb $0x1, %al
jne 0x3a354
jmp 0x3a3ac
leaq -0x130(%rbp), %rdi
callq 0x405b0
movq %rax, -0x340(%rbp)
jmp 0x3a369
movq -0x340(%rbp), %rsi
movq -0x2f8(%rbp), %rdi
callq 0x413a0
jmp 0x3a37e
movl $0x1, -0x60(%rbp)
jmp 0x3a852
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x3a878
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x3a86c
leaq -0x130(%rbp), %rdi
callq 0x40630
movq %rax, -0x348(%rbp)
jmp 0x3a3c1
movq -0x348(%rbp), %rsi
leaq -0x160(%rbp), %rdi
callq 0x406b0
jmp 0x3a3d6
movq -0x158(%rbp), %rax
movq %rax, -0x350(%rbp)
leaq -0x150(%rbp), %rdi
callq 0xa280
movq -0x350(%rbp), %rcx
addq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
leaq -0x198(%rbp), %rdi
callq 0x397e0
jmp 0x3a417
leaq -0x198(%rbp), %rdi
callq 0x411a0
movb %al, -0x351(%rbp)
jmp 0x3a42b
movb -0x351(%rbp), %al
testb $0x1, %al
jne 0x3a437
jmp 0x3a47a
movq -0x2f8(%rbp), %rdi
leaq -0x198(%rbp), %rsi
callq 0x41420
jmp 0x3a44c
movl $0x1, -0x60(%rbp)
jmp 0x3a81e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x3a844
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x3a838
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rax
movq (%rax), %rdx
leaq -0x1d0(%rbp), %rdi
movl $0x1b, %ecx
callq 0x364d0
jmp 0x3a498
leaq -0x1d0(%rbp), %rdi
callq 0x40510
movb %al, -0x352(%rbp)
jmp 0x3a4ac
movb -0x352(%rbp), %al
testb $0x1, %al
jne 0x3a4b8
jmp 0x3a4ff
leaq -0x1d0(%rbp), %rdi
callq 0x405b0
movq %rax, -0x360(%rbp)
jmp 0x3a4cd
movq -0x360(%rbp), %rsi
movq -0x2f8(%rbp), %rdi
callq 0x413a0
jmp 0x3a4e2
movl $0x1, -0x60(%rbp)
jmp 0x3a802
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x3a810
leaq -0x1d0(%rbp), %rdi
callq 0x40630
movq %rax, -0x368(%rbp)
jmp 0x3a514
movq -0x368(%rbp), %rsi
leaq -0x200(%rbp), %rdi
callq 0x406b0
jmp 0x3a529
movq -0x1f8(%rbp), %rax
movq %rax, -0x370(%rbp)
leaq -0x1f0(%rbp), %rdi
callq 0xa280
movq -0x370(%rbp), %rcx
addq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
leaq -0x238(%rbp), %rdi
callq 0x374b0
jmp 0x3a56a
leaq -0x238(%rbp), %rdi
callq 0x40890
movb %al, -0x371(%rbp)
jmp 0x3a57e
movb -0x371(%rbp), %al
testb $0x1, %al
jne 0x3a58a
jmp 0x3a5cd
movq -0x2f8(%rbp), %rdi
leaq -0x238(%rbp), %rsi
callq 0x41460
jmp 0x3a59f
movl $0x1, -0x60(%rbp)
jmp 0x3a7ce
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x3a7f4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x3a7e8
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rax
movq (%rax), %rdx
leaq -0x270(%rbp), %rdi
movl $0x1e, %ecx
callq 0x364d0
jmp 0x3a5eb
leaq -0x270(%rbp), %rdi
callq 0x40510
movb %al, -0x372(%rbp)
jmp 0x3a5ff
movb -0x372(%rbp), %al
testb $0x1, %al
jne 0x3a60b
jmp 0x3a652
leaq -0x270(%rbp), %rdi
callq 0x405b0
movq %rax, -0x380(%rbp)
jmp 0x3a620
movq -0x380(%rbp), %rsi
movq -0x2f8(%rbp), %rdi
callq 0x413a0
jmp 0x3a635
movl $0x1, -0x60(%rbp)
jmp 0x3a7b2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x3a7c0
leaq -0x270(%rbp), %rdi
callq 0x40630
movq %rax, -0x388(%rbp)
jmp 0x3a667
movq -0x388(%rbp), %rsi
leaq -0x2a0(%rbp), %rdi
callq 0x406b0
jmp 0x3a67c
movq -0x298(%rbp), %rax
movq %rax, -0x398(%rbp)
leaq -0x290(%rbp), %rdi
callq 0xa280
movq -0x398(%rbp), %rcx
addq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
leaq -0x2d8(%rbp), %rdi
movq %rdi, -0x390(%rbp)
leaq -0xe8(%rbp), %rsi
callq 0xa190
jmp 0x3a6c3
leaq -0x2b8(%rbp), %rax
movq %rax, -0x3a8(%rbp)
leaq -0x198(%rbp), %rdi
callq 0x41200
movq %rax, -0x3a0(%rbp)
jmp 0x3a6e6
movq -0x3a8(%rbp), %rax
movq -0x3a0(%rbp), %rcx
movl (%rcx), %ecx
movl %ecx, (%rax)
leaq -0x2b0(%rbp), %rax
movq %rax, -0x3b8(%rbp)
leaq -0x238(%rbp), %rdi
callq 0x408f0
movq %rax, -0x3b0(%rbp)
jmp 0x3a71b
movq -0x3b0(%rbp), %rsi
movq -0x3b8(%rbp), %rdi
callq 0x16250
movq -0x2f8(%rbp), %rdi
leaq -0x2d8(%rbp), %rsi
callq 0x414a0
jmp 0x3a743
leaq -0x2d8(%rbp), %rdi
callq 0x16120
movl $0x1, -0x60(%rbp)
leaq -0x2a0(%rbp), %rdi
callq 0x404f0
jmp 0x3a7b2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x3a7a4
movq -0x390(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
callq 0xa240
jmp 0x3a7a4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0x2d8(%rbp), %rdi
callq 0x16120
leaq -0x2a0(%rbp), %rdi
callq 0x404f0
jmp 0x3a7c0
leaq -0x270(%rbp), %rdi
callq 0x407c0
jmp 0x3a7ce
leaq -0x270(%rbp), %rdi
callq 0x407c0
jmp 0x3a7e8
leaq -0x238(%rbp), %rdi
callq 0x40970
leaq -0x200(%rbp), %rdi
callq 0x404f0
jmp 0x3a802
leaq -0x238(%rbp), %rdi
callq 0x40970
leaq -0x200(%rbp), %rdi
callq 0x404f0
jmp 0x3a810
leaq -0x1d0(%rbp), %rdi
callq 0x407c0
jmp 0x3a81e
leaq -0x1d0(%rbp), %rdi
callq 0x407c0
jmp 0x3a838
leaq -0x198(%rbp), %rdi
callq 0x41370
leaq -0x160(%rbp), %rdi
callq 0x404f0
jmp 0x3a852
leaq -0x198(%rbp), %rdi
callq 0x41370
leaq -0x160(%rbp), %rdi
callq 0x404f0
jmp 0x3a86c
leaq -0x130(%rbp), %rdi
callq 0x407c0
leaq -0xf8(%rbp), %rdi
callq 0x404f0
jmp 0x3a886
leaq -0x130(%rbp), %rdi
callq 0x407c0
leaq -0xf8(%rbp), %rdi
callq 0x404f0
jmp 0x3a8a0
leaq -0xc8(%rbp), %rdi
callq 0x407c0
leaq -0x90(%rbp), %rdi
callq 0x404f0
jmp 0x3a8ba
leaq -0xc8(%rbp), %rdi
callq 0x407c0
leaq -0x90(%rbp), %rdi
callq 0x404f0
jmp 0x3a8d3
leaq -0x50(%rbp), %rdi
callq 0x407c0
movq -0x2f0(%rbp), %rax
addq $0x3c0, %rsp            # imm = 0x3C0
popq %rbp
retq
leaq -0x50(%rbp), %rdi
callq 0x407c0
movq -0x58(%rbp), %rdi
callq 0xa650
nopw %cs:(%rax,%rax)