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

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

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

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movq %rdx, %r14
movq %rdi, %r15
leaq 0x50(%rsp), %r12
movq %r12, %rdi
movq %rsi, 0x18(%rsp)
callq 0x1e572
movb 0x30(%r12), %al
testb %al, %al
je 0x1e72d
leaq 0x50(%rsp), %rdi
callq 0x2486e
movq (%rax), %rcx
movq %rcx, (%rsp)
movq 0x8(%rax), %rax
movq %rax, 0x8(%rsp)
testq %rax, %rax
je 0x1e789
movq 0x4388d(%rip), %rcx     # 0x61fb0
cmpb $0x0, (%rcx)
je 0x1e785
incl 0x8(%rax)
jmp 0x1e789
movb %al, 0x30(%r15)
leaq 0x70(%rsp), %rax
movups -0x20(%rax), %xmm0
movups %xmm0, (%r15)
leaq 0x20(%r15), %rcx
movq %rcx, 0x10(%r15)
movq -0x10(%rax), %rdx
cmpq %rax, %rdx
je 0x1e75e
movq %rdx, 0x10(%r15)
movq 0x70(%rsp), %rcx
movq %rcx, 0x20(%r15)
jmp 0x1e764
movups (%rax), %xmm0
movups %xmm0, (%rcx)
movq 0x68(%rsp), %rcx
movq %rcx, 0x18(%r15)
movq %rax, 0x60(%rsp)
movq $0x0, 0x68(%rsp)
movb $0x0, 0x70(%rsp)
jmp 0x1e889
lock
incl 0x8(%rax)
leaq 0x40(%rsp), %r12
movq (%r14), %rdx
leaq 0x20(%rsp), %rdi
movq 0x18(%rsp), %rsi
callq 0x1ba35
movl $0x3, %ebp
cmpl $0x22, 0x20(%rsp)
jne 0x1e847
movq 0x38(%rsp), %rax
addq 0x28(%rsp), %rax
movq %rax, (%r14)
movq %r15, %rdi
movq 0x18(%rsp), %rsi
movq %r14, %rdx
callq 0x1e572
movl $0x1, %ebp
cmpb $0x0, 0x30(%r15)
je 0x1e847
movq %r15, %rdi
movq %r12, %rbx
callq 0x2486e
movq %rax, %rbp
movl $0x38, %edi
callq 0x92d0
movq %rax, %r13
movabsq $0x100000001, %rax      # imm = 0x100000001
movq %rax, 0x8(%r13)
leaq 0x41897(%rip), %rax     # 0x600a0
movq %rax, (%r13)
movq %r13, %r12
addq $0x10, %r12
movq %r12, %rdi
movq %rsp, %rsi
movq %rbp, %rdx
callq 0x18c84
movq %r12, (%rsp)
movq 0x8(%rsp), %rdi
movq %r13, 0x8(%rsp)
testq %rdi, %rdi
je 0x1e83a
callq 0xa946
movq %r15, %rdi
callq 0x280cc
xorl %ebp, %ebp
movq %rbx, %r12
movq 0x30(%rsp), %rdi
cmpq %r12, %rdi
je 0x1e85e
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x92e0
testl %ebp, %ebp
je 0x1e78e
cmpl $0x3, %ebp
jne 0x1e87a
movb $0x1, 0x30(%r15)
movaps (%rsp), %xmm0
movups %xmm0, (%r15)
jmp 0x1e889
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x1e889
callq 0xa946
leaq 0x50(%rsp), %rdi
callq 0x280cc
movq %r15, %rax
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
jmp 0x1e8eb
movq %rax, %r14
movq %r15, %rdi
callq 0x280cc
jmp 0x1e8c0
movq %r12, %rbx
movq %rax, %r14
movq 0x30(%rsp), %rdi
cmpq %rbx, %rdi
je 0x1e8dc
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x92e0
jmp 0x1e8dc
movq %rax, %r14
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x1e8eb
callq 0xa946
leaq 0x50(%rsp), %rdi
callq 0x280cc
movq %r14, %rdi
callq 0x94e0