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

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

        auto e_result = and_expr(input, pos);
        if (e_result.is_error())
            return e_result;
        acc = make<ast::and_expr_t>(acc, e_result.ok());
    }
    return acc;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x100, %rsp            # imm = 0x100
movq %rdi, -0xd8(%rbp)
movq %rdi, %rax
movq %rax, -0xd0(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
leaq -0x50(%rbp), %rdi
movq %rdi, -0xc8(%rbp)
callq 0x3f620
movq -0xc8(%rbp), %rdi
callq 0x41970
movb %al, -0xb9(%rbp)
jmp 0x3f954
movb -0xb9(%rbp), %al
testb $0x1, %al
jne 0x3f960
jmp 0x3f98f
movq -0xd8(%rbp), %rdi
leaq -0x50(%rbp), %rsi
callq 0x41990
jmp 0x3f972
movl $0x1, -0x60(%rbp)
jmp 0x3fb6a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x3fb83
leaq -0x50(%rbp), %rdi
callq 0x419e0
movq %rax, -0xe0(%rbp)
jmp 0x3f9a1
movq -0xe0(%rbp), %rsi
leaq -0x70(%rbp), %rdi
callq 0x13050
jmp 0x3f9b3
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rax
movq (%rax), %rdx
leaq -0xa0(%rbp), %rdi
callq 0x355b0
jmp 0x3f9cc
cmpl $0x21, -0xa0(%rbp)
je 0x3f9f2
movl $0x3, -0x60(%rbp)
jmp 0x3fb00
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x3fb5f
movq -0x98(%rbp), %rax
movq %rax, -0xe8(%rbp)
leaq -0x90(%rbp), %rdi
callq 0xa280
movq -0xe8(%rbp), %rcx
movq -0xd8(%rbp), %rdi
addq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
movb $0x0, -0xa1(%rbp)
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0x3f620
jmp 0x3fa3a
movq -0xd8(%rbp), %rdi
callq 0x41970
movb %al, -0xe9(%rbp)
jmp 0x3fa4e
movb -0xe9(%rbp), %al
testb $0x1, %al
jne 0x3fa5a
jmp 0x3fa98
movb $0x1, -0xa1(%rbp)
movl $0x1, -0x60(%rbp)
jmp 0x3fae9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x3fb2d
movq -0xd8(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
callq 0x2ffa0
jmp 0x3fb2d
movq -0xd8(%rbp), %rdi
callq 0x419e0
movq %rax, -0xf8(%rbp)
jmp 0x3faad
movq -0xf8(%rbp), %rdx
leaq -0xb8(%rbp), %rdi
leaq -0x70(%rbp), %rsi
callq 0x3f8c0
jmp 0x3fac6
leaq -0x70(%rbp), %rdi
leaq -0xb8(%rbp), %rsi
callq 0x422f0
leaq -0xb8(%rbp), %rdi
callq 0x42320
movl $0x0, -0x60(%rbp)
testb $0x1, -0xa1(%rbp)
jne 0x3fafe
movq -0xd8(%rbp), %rdi
callq 0x2ffa0
jmp 0x3fb00
leaq -0xa0(%rbp), %rdi
callq 0x404f0
movl -0x60(%rbp), %eax
movl %eax, -0xfc(%rbp)
testl %eax, %eax
je 0x3fb28
jmp 0x3fb1b
movl -0xfc(%rbp), %eax
subl $0x3, %eax
je 0x3fb3b
jmp 0x3fb54
jmp 0x3f9b1
leaq -0xa0(%rbp), %rdi
callq 0x404f0
jmp 0x3fb5f
movq -0xd8(%rbp), %rdi
leaq -0x70(%rbp), %rsi
callq 0x41f90
jmp 0x3fb4d
movl $0x1, -0x60(%rbp)
leaq -0x70(%rbp), %rdi
callq 0x13080
jmp 0x3fb6a
leaq -0x70(%rbp), %rdi
callq 0x13080
jmp 0x3fb83
leaq -0x50(%rbp), %rdi
callq 0x2ffa0
movq -0xd0(%rbp), %rax
addq $0x100, %rsp            # imm = 0x100
popq %rbp
retq
leaq -0x50(%rbp), %rdi
callq 0x2ffa0
movq -0x58(%rbp), %rdi
callq 0xa650
nopw %cs:(%rax,%rax)