// File: /workspace/github_cpp_makefile_star2_O2/pfnet-research[P]pml/src/parser.cpp
// Function: parser::predicate(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, unsigned long&)
predicate_result_t predicate(std::string const& input, size_t& pos) {
    EXPECT(backslash_token, BackSlash);

    EXPECT(arg_token, Ident);
    auto arg_name = arg_token.lexime;

    EXPECT(colon_token, Colon);

    auto stype_result = simple_type(input, pos);
    if (stype_result.is_error())
        return stype_result.convert<logic::predicate_t>();
    auto stype = stype_result.ok();

    EXPECT(fat_arrow_token, FatArrow);

    auto formula_result = formula(input, pos);
    if (formula_result.is_error())
        return formula_result.convert<logic::predicate_t>();
    auto formula = formula_result.ok();

    return predicate_result_t::ok(logic::predicate_t{arg_name, stype, formula});
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x288, %rsp            # imm = 0x288
movq %rdx, %r13
movq %rsi, %rbp
movq %rdi, %r15
movq (%rdx), %rdx
leaq 0x190(%rsp), %rbx
pushq $0x1a
popq %rcx
movq %rbx, %rdi
callq 0x15bc7
cmpb $0x0, 0x30(%rbx)
je 0x1776c
leaq 0x190(%rsp), %rdi
callq 0x1ac66
leaq 0x258(%rsp), %rdi
movq %rax, %rsi
callq 0x1acbe
leaq 0x268(%rsp), %rbx
movq 0x8(%rbx), %rdx
addq -0x8(%rbx), %rdx
movq %rdx, (%r13)
leaq 0x120(%rsp), %rdi
pushq $0xa
popq %rcx
movq %rbp, %rsi
callq 0x15bc7
cmpb $0x0, 0x150(%rsp)
je 0x17789
leaq 0x120(%rsp), %rdi
callq 0x1ac66
leaq 0x228(%rsp), %rdi
movq %rax, %rsi
callq 0x1acbe
leaq 0x238(%rsp), %r14
movq 0x8(%r14), %rax
addq -0x8(%r14), %rax
movq %rax, (%r13)
leaq 0x20(%rsp), %rdi
movq %r14, %rsi
callq 0x93a0
movq (%r13), %rdx
leaq 0xe8(%rsp), %rdi
pushq $0x1c
popq %rcx
movq %rbp, %rsi
callq 0x15bc7
cmpb $0x0, 0x118(%rsp)
je 0x177a6
leaq 0xe8(%rsp), %rdi
callq 0x1ac66
leaq 0x1f8(%rsp), %rdi
movq %rax, %rsi
callq 0x1acbe
leaq 0x208(%rsp), %r12
movq 0x8(%r12), %rax
addq -0x8(%r12), %rax
movq %rax, (%r13)
leaq 0xb0(%rsp), %rdi
movq %rbp, %rsi
movq %r13, %rdx
callq 0x17412
cmpb $0x0, 0xe0(%rsp)
je 0x177c0
leaq 0xb0(%rsp), %rdi
callq 0x1aee8
movl (%rax), %eax
movl %eax, 0xc(%rsp)
movq (%r13), %rdx
leaq 0x78(%rsp), %rdi
pushq $0xc
popq %rcx
movq %rbp, %rsi
callq 0x15bc7
cmpb $0x0, 0xa8(%rsp)
je 0x177d2
leaq 0x78(%rsp), %rdi
callq 0x1ac66
leaq 0x1c8(%rsp), %rdi
movq %rax, %rsi
callq 0x1acbe
leaq 0x1d8(%rsp), %rcx
movq 0x8(%rcx), %rax
addq -0x8(%rcx), %rax
movq %rax, (%r13)
leaq 0x40(%rsp), %rdi
movq %rbp, %rsi
movq %r13, %rdx
callq 0x172a4
cmpb $0x0, 0x70(%rsp)
je 0x177e9
leaq 0x40(%rsp), %rdi
callq 0x1ad12
leaq 0x10(%rsp), %rdi
movq %rax, %rsi
callq 0xc2b6
leaq 0x158(%rsp), %rdi
leaq 0x20(%rsp), %rsi
callq 0x93a0
leaq 0x180(%rsp), %rdi
movl 0xc(%rsp), %eax
movl %eax, -0x8(%rdi)
leaq 0x10(%rsp), %rsi
callq 0xc2b6
leaq 0x158(%rsp), %rsi
movq %r15, %rdi
callq 0x1af5c
leaq 0x158(%rsp), %rdi
callq 0x1af6e
leaq 0x18(%rsp), %rdi
callq 0xa248
jmp 0x177f6
leaq 0x190(%rsp), %rdi
callq 0x1ac0e
movq %r15, %rdi
movq %rax, %rsi
callq 0x1ae9e
jmp 0x17863
leaq 0x120(%rsp), %rdi
callq 0x1ac0e
movq %r15, %rdi
movq %rax, %rsi
callq 0x1ae9e
jmp 0x1784e
leaq 0xe8(%rsp), %rdi
callq 0x1ac0e
movq %r15, %rdi
movq %rax, %rsi
callq 0x1ae9e
jmp 0x1782f
leaq 0xb0(%rsp), %rsi
movq %r15, %rdi
callq 0x1aecc
jmp 0x1781a
leaq 0x78(%rsp), %rdi
callq 0x1ac0e
movq %r15, %rdi
movq %rax, %rsi
callq 0x1ae9e
jmp 0x1780d
leaq 0x40(%rsp), %rsi
movq %r15, %rdi
callq 0x1af40
leaq 0x40(%rsp), %rdi
callq 0x1fba8
leaq 0x1d8(%rsp), %rdi
callq 0x9130
leaq 0x88(%rsp), %rdi
callq 0x9130
leaq 0xb0(%rsp), %rdi
callq 0x1fde0
movq %r12, %rdi
callq 0x9130
leaq 0xf8(%rsp), %rdi
callq 0x9130
leaq 0x20(%rsp), %rdi
callq 0x9130
movq %r14, %rdi
callq 0x9130
leaq 0x130(%rsp), %rdi
callq 0x9130
movq %rbx, %rdi
callq 0x9130
leaq 0x1a0(%rsp), %rdi
callq 0x9130
movq %r15, %rax
addq $0x288, %rsp            # imm = 0x288
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r15
leaq 0x158(%rsp), %rdi
callq 0x1af6e
jmp 0x1789a
movq %rax, %r15
leaq 0x18(%rsp), %rdi
callq 0xa248
jmp 0x178ab
jmp 0x178a8
movq %rax, %r15
leaq 0x40(%rsp), %rdi
callq 0x1fba8
jmp 0x178ba
movq %rax, %r15
leaq 0x1d8(%rsp), %rdi
callq 0x9130
jmp 0x178ce
jmp 0x178cb
movq %rax, %r15
leaq 0x88(%rsp), %rdi
callq 0x9130
jmp 0x178e4
jmp 0x178e1
jmp 0x178e1
movq %rax, %r15
leaq 0xb0(%rsp), %rdi
callq 0x1fde0
jmp 0x178f6
movq %rax, %r15
movq %r12, %rdi
callq 0x9130
jmp 0x17905
jmp 0x17902
movq %rax, %r15
leaq 0xf8(%rsp), %rdi
callq 0x9130
leaq 0x20(%rsp), %rdi
callq 0x9130
movq %r14, %rdi
callq 0x9130
jmp 0x17935
movq %rax, %r15
jmp 0x17912
movq %rax, %r15
jmp 0x1791c
jmp 0x17932
movq %rax, %r15
leaq 0x130(%rsp), %rdi
callq 0x9130
movq %rbx, %rdi
callq 0x9130
jmp 0x17956
movq %rax, %r15
jmp 0x17942
jmp 0x17953
movq %rax, %r15
leaq 0x1a0(%rsp), %rdi
callq 0x9130
movq %r15, %rdi
callq 0x94d0