// File: /workspace/github_cpp_makefile_star2_O1/pfnet-research[P]pml/src/parser.cpp
// Function: parser::or_formula(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, unsigned long&)
formula_result_t or_formula(std::string const& input, size_t& pos) {
    auto head_result = and_formula(input, pos);
    if (head_result.is_error())
        return head_result;
    auto acc = head_result.ok();

    while (true) {
        auto or_token = next_token(input, pos);
        if (or_token.kind != token_t::kind_t::Or)
            break;
        pos = or_token.pos + or_token.lexime.size();

        auto formula_result = and_formula(input, pos);
        if (formula_result.is_error())
            return formula_result;
        acc = make<logic::or_formula_t>(acc, formula_result.ok());
    }
    return acc;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
movq %rdx, %r14
movq %rdi, %rbx
leaq 0x60(%rsp), %r12
movq %r12, %rdi
movq %rsi, 0x28(%rsp)
callq 0x1ea37
movb 0x30(%r12), %al
testb %al, %al
je 0x1ed1f
movq %rbx, 0x18(%rsp)
leaq 0x60(%rsp), %rdi
callq 0x249a6
movq (%rax), %rcx
movq %rcx, 0x8(%rsp)
movq 0x8(%rax), %rax
movq %rax, 0x10(%rsp)
testq %rax, %rax
movq 0x18(%rsp), %r12
je 0x1ed88
movq 0x4429b(%rip), %rcx     # 0x62fb0
cmpb $0x0, (%rcx)
je 0x1ed84
incl 0x8(%rax)
jmp 0x1ed88
movb %al, 0x30(%rbx)
leaq 0x80(%rsp), %rax
movups -0x20(%rax), %xmm0
movups %xmm0, (%rbx)
leaq 0x20(%rbx), %rcx
movq %rcx, 0x10(%rbx)
movq -0x10(%rax), %rdx
cmpq %rax, %rdx
movq %rbx, %r12
je 0x1ed59
movq %rdx, 0x10(%r12)
movq 0x80(%rsp), %rcx
movq %rcx, 0x20(%r12)
jmp 0x1ed5f
movups (%rax), %xmm0
movups %xmm0, (%rcx)
movq 0x78(%rsp), %rcx
movq %rcx, 0x18(%r12)
movq %rax, 0x70(%rsp)
movq $0x0, 0x78(%rsp)
movb $0x0, 0x80(%rsp)
jmp 0x1eeba
lock
incl 0x8(%rax)
leaq 0x50(%rsp), %r15
leaq 0x30(%rsp), %rbx
movq %r14, 0x20(%rsp)
movq (%r14), %rdx
movq %rbx, %rdi
movq 0x28(%rsp), %rsi
callq 0x1bcc7
movl $0x3, %ebp
cmpl $0x21, 0x30(%rsp)
jne 0x1ee5d
movq 0x48(%rsp), %rax
addq 0x38(%rsp), %rax
movq %rax, (%r14)
movq %r12, %rdi
movq 0x28(%rsp), %rsi
movq %r14, %rdx
callq 0x1ea37
movb 0x30(%r12), %r14b
movl $0x1, %ebp
testb %r14b, %r14b
je 0x1ee4b
movq %r12, %rdi
callq 0x249a6
movq %rax, %rbp
movl $0x38, %edi
callq 0x92d0
movq %rax, %r13
movabsq $0x100000001, %rax      # imm = 0x100000001
movq %rax, 0x8(%r13)
leaq 0x422f8(%rip), %rax     # 0x61108
movq %rax, (%r13)
movq %r13, %r12
addq $0x10, %r12
movq %r12, %rdi
leaq 0x8(%rsp), %rsi
movq %rbp, %rdx
callq 0x18fc2
movq %r12, 0x8(%rsp)
movq 0x10(%rsp), %rdi
movq %r13, 0x10(%rsp)
xorl %ebp, %ebp
testq %rdi, %rdi
je 0x1ee46
callq 0xaa12
movq 0x18(%rsp), %r12
testb %r14b, %r14b
je 0x1ee58
movq %r12, %rdi
callq 0x28264
movq 0x20(%rsp), %r14
movq 0x40(%rsp), %rdi
cmpq %r15, %rdi
je 0x1ee74
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x92e0
testl %ebp, %ebp
je 0x1ed97
cmpl $0x3, %ebp
jne 0x1eeab
movb $0x1, 0x30(%r12)
movq 0x8(%rsp), %rax
movq %rax, (%r12)
xorl %eax, %eax
movq %rax, 0x8(%r12)
movq 0x10(%rsp), %rcx
movq %rax, 0x10(%rsp)
movq %rcx, 0x8(%r12)
movq %rax, 0x8(%rsp)
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x1eeba
callq 0xaa12
leaq 0x60(%rsp), %rdi
callq 0x28264
movq %r12, %rax
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
jmp 0x1ef1b
movq %rax, %r14
movq 0x18(%rsp), %rdi
callq 0x28264
jmp 0x1eef0
movq %rax, %r14
movq 0x40(%rsp), %rdi
cmpq %r15, %rdi
je 0x1ef0c
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x92e0
jmp 0x1ef0c
movq %rax, %r14
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x1ef1b
callq 0xaa12
leaq 0x60(%rsp), %rdi
callq 0x28264
movq %r14, %rdi
callq 0x94e0