// File: /workspace/github_cpp_makefile_star2_O3/pfnet-research[P]pml/src/parser.cpp
// Function: parser::equive_expr(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, unsigned long&)
expr_result_t equive_expr(std::string const& input, size_t& pos) {
    auto head_result = additive_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::DoubleEq &&
            op_token.kind != token_t::kind_t::Neq &&
            op_token.kind != token_t::kind_t::Leq &&
            op_token.kind != token_t::kind_t::Geq)
            break;
        pos = op_token.pos + op_token.lexime.size();

        auto e_result = additive_expr(input, pos);
        if (e_result.is_error())
            return e_result;
        auto e = e_result.ok();

        switch (op_token.kind) {
        case token_t::kind_t::DoubleEq:
            acc = make<ast::eq_expr_t>(acc, e);
            break;
        case token_t::kind_t::Neq:
            acc = make<ast::neq_expr_t>(acc, e);
            break;
        case token_t::kind_t::Leq:
            acc = make<ast::leq_expr_t>(acc, e);
            break;
        case token_t::kind_t::Geq:
            acc = make<ast::geq_expr_t>(acc, e);
            break;
        default:
            throw std::logic_error{"invalid formula op"};
        }
    }
    return acc;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa8, %rsp
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
leaq 0x70(%rsp), %r12
movq %r12, %rdi
callq 0x23aa3
movb 0x30(%r12), %al
testb %al, %al
je 0x23e14
leaq 0x70(%rsp), %rdi
callq 0x24dac
movq (%rax), %rcx
movq %rcx, 0x20(%rsp)
movq 0x8(%rax), %rax
movq %rax, 0x28(%rsp)
testq %rax, %rax
je 0x23e80
movq 0x3e1a6(%rip), %rcx     # 0x61fb0
cmpb $0x0, (%rcx)
je 0x23e7c
incl 0x8(%rax)
jmp 0x23e80
movb %al, 0x30(%rbx)
leaq 0x90(%rsp), %rax
movups -0x20(%rax), %xmm0
movups %xmm0, (%rbx)
leaq 0x20(%rbx), %rcx
movq %rcx, 0x10(%rbx)
movq -0x10(%rax), %rdx
cmpq %rax, %rdx
je 0x23e49
movq %rdx, 0x10(%rbx)
movq 0x90(%rsp), %rcx
movq %rcx, 0x20(%rbx)
jmp 0x23e4f
movups (%rax), %xmm0
movups %xmm0, (%rcx)
movq 0x88(%rsp), %rcx
movq %rcx, 0x18(%rbx)
movq %rax, 0x80(%rsp)
movq $0x0, 0x88(%rsp)
movb $0x0, 0x90(%rsp)
jmp 0x24063
lock
incl 0x8(%rax)
leaq 0x40(%rsp), %r13
movl $0xd80000, %r12d        # imm = 0xD80000
movq (%r14), %rdx
movq %r13, %rdi
movq %r15, %rsi
callq 0x1ba35
movl $0x3, %ebp
movl 0x40(%rsp), %eax
cmpl $0x17, %eax
ja 0x2401d
btl %eax, %r12d
jae 0x2401d
movq 0x58(%rsp), %rax
addq 0x48(%rsp), %rax
movq %rax, (%r14)
movq %rbx, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x23aa3
movl $0x1, %ebp
cmpb $0x0, 0x30(%rbx)
je 0x2401d
movq %rbx, %rdi
callq 0x24dac
movq (%rax), %rcx
movq %rcx, 0x30(%rsp)
movq 0x8(%rax), %rax
movq %rax, 0x38(%rsp)
testq %rax, %rax
je 0x23f12
movq 0x3e0ac(%rip), %rcx     # 0x61fb0
cmpb $0x0, (%rcx)
je 0x23f0e
incl 0x8(%rax)
jmp 0x23f12
lock
incl 0x8(%rax)
movl 0x40(%rsp), %eax
addl $-0x13, %eax
cmpl $0x4, %eax
ja 0x24082
leaq 0x242f7(%rip), %rcx     # 0x48220
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq $0x0, 0x10(%rsp)
leaq 0x18(%rsp), %rdi
leaq 0x10(%rsp), %rsi
leaq 0xf(%rsp), %rdx
leaq 0x20(%rsp), %rcx
leaq 0x30(%rsp), %r8
callq 0x26e38
jmp 0x23fd4
movq $0x0, 0x10(%rsp)
leaq 0x18(%rsp), %rdi
leaq 0x10(%rsp), %rsi
leaq 0xf(%rsp), %rdx
leaq 0x20(%rsp), %rcx
leaq 0x30(%rsp), %r8
callq 0x271c8
jmp 0x23fd4
movq $0x0, 0x10(%rsp)
leaq 0x18(%rsp), %rdi
leaq 0x10(%rsp), %rsi
leaq 0xf(%rsp), %rdx
leaq 0x20(%rsp), %rcx
leaq 0x30(%rsp), %r8
callq 0x27390
jmp 0x23fd4
movq $0x0, 0x10(%rsp)
leaq 0x18(%rsp), %rdi
leaq 0x10(%rsp), %rsi
leaq 0xf(%rsp), %rdx
leaq 0x20(%rsp), %rcx
leaq 0x30(%rsp), %r8
callq 0x27000
movaps 0x10(%rsp), %xmm0
xorps %xmm1, %xmm1
movaps %xmm1, 0x10(%rsp)
movq 0x28(%rsp), %rdi
movaps %xmm0, 0x20(%rsp)
testq %rdi, %rdi
je 0x24004
callq 0xa946
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x24004
callq 0xa946
movq 0x38(%rsp), %rdi
testq %rdi, %rdi
je 0x24013
callq 0xa946
movq %rbx, %rdi
callq 0x19f1e
xorl %ebp, %ebp
movq 0x50(%rsp), %rdi
leaq 0x60(%rsp), %rax
cmpq %rax, %rdi
je 0x24039
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x92e0
testl %ebp, %ebp
je 0x23e8b
cmpl $0x3, %ebp
jne 0x24054
movb $0x1, 0x30(%rbx)
movaps 0x20(%rsp), %xmm0
movups %xmm0, (%rbx)
jmp 0x24063
movq 0x28(%rsp), %rdi
testq %rdi, %rdi
je 0x24063
callq 0xa946
leaq 0x70(%rsp), %rdi
callq 0x19f1e
movq %rbx, %rax
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x10, %edi
callq 0x9150
movq %rax, %r15
leaq 0x24341(%rip), %rsi     # 0x483d7
movq %rax, %rdi
callq 0x93c0
movq 0x3df2b(%rip), %rsi     # 0x61fd0
movq 0x3defc(%rip), %rdx     # 0x61fa8
movq %r15, %rdi
callq 0x94b0
jmp 0x240ce
movq %rax, %r14
movq %r15, %rdi
callq 0x9200
jmp 0x240d1
movq %rax, %r14
jmp 0x24122
jmp 0x240ce
jmp 0x240ce
jmp 0x240ce
movq %rax, %r14
movq 0x38(%rsp), %rdi
testq %rdi, %rdi
je 0x240e5
callq 0xa946
jmp 0x240e5
movq %rax, %r14
movq %rbx, %rdi
callq 0x19f1e
jmp 0x240f2
movq %rax, %r14
movq 0x50(%rsp), %rdi
leaq 0x60(%rsp), %rax
cmpq %rax, %rdi
je 0x24113
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x92e0
jmp 0x24113
movq %rax, %r14
movq 0x28(%rsp), %rdi
testq %rdi, %rdi
je 0x24122
callq 0xa946
leaq 0x70(%rsp), %rdi
callq 0x19f1e
movq %r14, %rdi
callq 0x94e0