// File: /workspace/github_cpp_makefile_star2_O1/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 $0x278, %rsp            # imm = 0x278
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
movq (%rdx), %rdx
leaq 0x240(%rsp), %r12
movq %r12, %rdi
movl $0x1a, %ecx
callq 0x1c868
cmpb $0x0, 0x30(%r12)
je 0x1f5ac
leaq 0x240(%rsp), %rdi
callq 0x2494c
movups (%rax), %xmm0
leaq 0x100(%rsp), %rdi
movaps %xmm0, -0x10(%rdi)
leaq 0x110(%rsp), %r12
movq %r12, -0x10(%r12)
movq 0x10(%rax), %rsi
movq 0x18(%rax), %rdx
addq %rsi, %rdx
callq 0xad30
movq 0x108(%rsp), %rdx
addq 0xf8(%rsp), %rdx
movq %rdx, (%r14)
leaq 0x208(%rsp), %rdi
movq %r15, %rsi
movl $0xa, %ecx
callq 0x1c868
cmpb $0x0, 0x238(%rsp)
je 0x1f5c9
leaq 0x208(%rsp), %rdi
callq 0x2494c
movups (%rax), %xmm0
leaq 0x30(%rsp), %rdi
movaps %xmm0, -0x10(%rdi)
leaq 0x40(%rsp), %rcx
movq %rcx, -0x10(%rcx)
movq 0x10(%rax), %rsi
movq 0x18(%rax), %rdx
addq %rsi, %rdx
callq 0xad30
movq 0x38(%rsp), %rdx
movq 0x28(%rsp), %rax
addq %rdx, %rax
movq %rax, (%r14)
leaq 0x10(%rsp), %rbp
movq %rbp, -0x10(%rbp)
movq 0x30(%rsp), %rsi
addq %rsi, %rdx
movq %rsp, %rdi
callq 0xad30
movq (%r14), %rdx
leaq 0x1d0(%rsp), %rdi
movq %r15, %rsi
movl $0x1c, %ecx
callq 0x1c868
cmpb $0x0, 0x200(%rsp)
je 0x1f5e6
leaq 0x1d0(%rsp), %rdi
callq 0x2494c
movups (%rax), %xmm0
leaq 0x90(%rsp), %rdi
movaps %xmm0, -0x10(%rdi)
leaq 0xa0(%rsp), %rcx
movq %rcx, -0x10(%rcx)
movq 0x10(%rax), %rsi
movq 0x18(%rax), %rdx
addq %rsi, %rdx
callq 0xad30
movq 0x98(%rsp), %rax
addq 0x88(%rsp), %rax
movq %rax, (%r14)
leaq 0xb8(%rsp), %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x1f1a8
cmpb $0x0, 0xe8(%rsp)
je 0x1f603
leaq 0xb8(%rsp), %rdi
callq 0x24b88
movl (%rax), %r13d
movq (%r14), %rdx
leaq 0x198(%rsp), %rdi
movq %r15, %rsi
movl $0xc, %ecx
callq 0x1c868
cmpb $0x0, 0x1c8(%rsp)
je 0x1f620
leaq 0x198(%rsp), %rdi
callq 0x2494c
movups (%rax), %xmm0
leaq 0x60(%rsp), %rdi
movaps %xmm0, -0x10(%rdi)
leaq 0x70(%rsp), %rcx
movq %rcx, -0x10(%rcx)
movq 0x10(%rax), %rsi
movq 0x18(%rax), %rdx
addq %rsi, %rdx
callq 0xad30
movq 0x68(%rsp), %rax
addq 0x58(%rsp), %rax
movq %rax, (%r14)
leaq 0x160(%rsp), %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x1ef2d
cmpb $0x0, 0x190(%rsp)
je 0x1f63d
leaq 0x160(%rsp), %rdi
callq 0x249a6
movq (%rax), %r15
movq 0x8(%rax), %r14
testq %r14, %r14
je 0x1f65f
movq 0x43a16(%rip), %rax     # 0x62fb0
cmpb $0x0, (%rax)
je 0x1f65a
incl 0x8(%r14)
jmp 0x1f65f
leaq 0x240(%rsp), %rdi
callq 0x248f2
movq %rbx, %rdi
movq %rax, %rsi
callq 0x24b3a
jmp 0x1f82f
leaq 0x208(%rsp), %rdi
callq 0x248f2
movq %rbx, %rdi
movq %rax, %rsi
callq 0x24b3a
jmp 0x1f805
leaq 0x1d0(%rsp), %rdi
callq 0x248f2
movq %rbx, %rdi
movq %rax, %rsi
callq 0x24b3a
jmp 0x1f7c6
leaq 0xb8(%rsp), %rdi
callq 0x283e6
movq %rbx, %rdi
movq %rax, %rsi
callq 0x24b3a
jmp 0x1f776
leaq 0x198(%rsp), %rdi
callq 0x248f2
movq %rbx, %rdi
movq %rax, %rsi
callq 0x24b3a
jmp 0x1f769
leaq 0x160(%rsp), %rdi
callq 0x28294
movq %rbx, %rdi
movq %rax, %rsi
callq 0x24b3a
jmp 0x1f740
lock
incl 0x8(%r14)
leaq 0x138(%rsp), %rax
movq %rax, -0x10(%rax)
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
addq %rsi, %rdx
leaq 0x128(%rsp), %rdi
callq 0xad30
movl %r13d, 0x148(%rsp)
movq %r15, 0x150(%rsp)
movq %r14, 0x158(%rsp)
testq %r14, %r14
leaq 0x138(%rsp), %rdx
je 0x1f6c0
movq 0x43900(%rip), %rax     # 0x62fb0
cmpb $0x0, (%rax)
je 0x1f6bb
incl 0x8(%r14)
jmp 0x1f6c0
lock
incl 0x8(%r14)
movb $0x1, 0x38(%rbx)
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
movq 0x128(%rsp), %rcx
cmpq %rdx, %rcx
je 0x1f6e9
movq %rcx, (%rbx)
movq 0x138(%rsp), %rax
movq %rax, 0x10(%rbx)
jmp 0x1f6ef
movups (%rdx), %xmm0
movups %xmm0, (%rax)
leaq 0x128(%rsp), %rdi
movq 0x8(%rdi), %rax
movq %rax, 0x8(%rbx)
movq %rdx, (%rdi)
xorl %eax, %eax
movq %rax, 0x8(%rdi)
movb $0x0, 0x10(%rdi)
movl 0x20(%rdi), %ecx
movl %ecx, 0x20(%rbx)
movq 0x28(%rdi), %rcx
movq %rcx, 0x28(%rbx)
movq %rax, 0x30(%rbx)
movq 0x30(%rdi), %rcx
movq %rax, 0x30(%rdi)
movq %rcx, 0x30(%rbx)
movq %rax, 0x28(%rdi)
callq 0x24be2
testq %r14, %r14
je 0x1f740
movq %r14, %rdi
callq 0xaa12
leaq 0x160(%rsp), %rdi
callq 0x28264
movq 0x60(%rsp), %rdi
leaq 0x70(%rsp), %rax
cmpq %rax, %rdi
je 0x1f769
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x92e0
leaq 0x198(%rsp), %rdi
callq 0x28218
cmpb $0x0, 0xe8(%rsp)
jne 0x1f7a1
leaq 0xd8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x1f7a1
movq 0xd8(%rsp), %rsi
incq %rsi
callq 0x92e0
movq 0x90(%rsp), %rdi
leaq 0xa0(%rsp), %rax
cmpq %rax, %rdi
je 0x1f7c6
movq 0xa0(%rsp), %rsi
incq %rsi
callq 0x92e0
leaq 0x1d0(%rsp), %rdi
callq 0x28218
movq (%rsp), %rdi
cmpq %rbp, %rdi
je 0x1f7e9
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x92e0
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
je 0x1f805
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x92e0
leaq 0x208(%rsp), %rdi
callq 0x28218
movq 0x100(%rsp), %rdi
cmpq %r12, %rdi
je 0x1f82f
movq 0x110(%rsp), %rsi
incq %rsi
callq 0x92e0
leaq 0x240(%rsp), %rdi
callq 0x28218
movq %rbx, %rax
addq $0x278, %rsp            # imm = 0x278
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
testq %r14, %r14
je 0x1f868
movq %r14, %rdi
callq 0xaa12
jmp 0x1f868
jmp 0x1f865
movq %rax, %rbx
leaq 0x160(%rsp), %rdi
callq 0x28264
jmp 0x1f87a
movq %rax, %rbx
movq 0x60(%rsp), %rdi
leaq 0x70(%rsp), %rax
cmpq %rax, %rdi
je 0x1f89d
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x92e0
jmp 0x1f89d
jmp 0x1f89a
movq %rax, %rbx
leaq 0x198(%rsp), %rdi
callq 0x28218
jmp 0x1f8b3
jmp 0x1f8b0
jmp 0x1f8b0
movq %rax, %rbx
cmpb $0x0, 0xe8(%rsp)
jne 0x1f8e3
leaq 0xd8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x1f8e3
movq 0xd8(%rsp), %rsi
incq %rsi
callq 0x92e0
jmp 0x1f8e3
movq %rax, %rbx
movq 0x90(%rsp), %rdi
leaq 0xa0(%rsp), %rax
cmpq %rax, %rdi
je 0x1f90f
movq 0xa0(%rsp), %rsi
incq %rsi
callq 0x92e0
jmp 0x1f90f
jmp 0x1f90c
movq %rax, %rbx
leaq 0x1d0(%rsp), %rdi
callq 0x28218
movq (%rsp), %rdi
cmpq %rbp, %rdi
je 0x1f93c
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x92e0
jmp 0x1f93c
movq %rax, %rbx
jmp 0x1f91c
movq %rax, %rbx
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
je 0x1f95f
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x92e0
jmp 0x1f95f
jmp 0x1f95c
movq %rax, %rbx
leaq 0x208(%rsp), %rdi
callq 0x28218
movq 0x100(%rsp), %rdi
cmpq %r12, %rdi
je 0x1f995
movq 0x110(%rsp), %rsi
incq %rsi
callq 0x92e0
jmp 0x1f995
movq %rax, %rbx
jmp 0x1f96c
jmp 0x1f992
movq %rax, %rbx
leaq 0x240(%rsp), %rdi
callq 0x28218
movq %rbx, %rdi
callq 0x94e0