// File: /workspace/github_cpp_makefile_star2_O2/pfnet-research[P]pml/src/parser.cpp
// Function: parser::multive_term(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, unsigned long&)
term_result_t multive_term(std::string const& input, size_t& pos) {
    auto head_result = primary_term(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::Star && op_token.kind != token_t::kind_t::Slash)
            break;
        pos = op_token.pos + op_token.lexime.size();

        auto term_result = primary_term(input, pos);
        if (term_result.is_error())
            return term_result;

        switch (op_token.kind) {
        case token_t::kind_t::Star:
            acc = make<logic::mul_term_t>(acc, term_result.ok());
            break;
        case token_t::kind_t::Slash:
            acc = make<logic::div_term_t>(acc, term_result.ok());
            break;
        default:
            throw std::logic_error{"invalid additive op"};
        }
    }
    return acc;

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %rbx
leaq 0x50(%rsp), %r14
movq %r14, %rdi
callq 0x15df6
cmpb $0x0, 0x30(%r14)
je 0x1652a
leaq 0x50(%rsp), %rdi
callq 0x1ad98
movq %rsp, %r13
movq %r13, %rdi
movq %rax, %rsi
callq 0x125ec
leaq 0x20(%rsp), %rbp
leaq 0x10(%rsp), %r14
movq (%r15), %rdx
movq %rbp, %rdi
movq %r12, %rsi
callq 0x1537c
movl 0x20(%rsp), %eax
addl $-0x12, %eax
cmpl $-0x2, %eax
jb 0x16539
movq 0x38(%rsp), %rax
addq 0x28(%rsp), %rax
movq %rax, (%r15)
movq %rbx, %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0x15df6
cmpb $0x0, 0x30(%rbx)
je 0x1655b
movl 0x20(%rsp), %eax
cmpl $0x11, %eax
je 0x164e8
cmpl $0x10, %eax
jne 0x1658e
movq %rbx, %rdi
callq 0x1ad98
movq %r14, %rdi
movq %r13, %rsi
movq %rax, %rdx
callq 0x1b9b2
movq %r13, %rdi
movq %r14, %rsi
callq 0x1fc18
jmp 0x16509
movq %rbx, %rdi
callq 0x1ad98
movq %r14, %rdi
movq %r13, %rsi
movq %rax, %rdx
callq 0x1ba9f
movq %r13, %rdi
movq %r14, %rsi
callq 0x1fc46
leaq 0x18(%rsp), %rdi
callq 0xa248
movq %rbx, %rdi
callq 0x1fb90
leaq 0x30(%rsp), %rdi
callq 0x9130
jmp 0x16470
leaq 0x50(%rsp), %rsi
movq %rbx, %rdi
callq 0x1acd2
jmp 0x1656f
leaq 0x30(%rsp), %rdi
callq 0x9130
movb $0x1, 0x30(%rbx)
movaps (%rsp), %xmm0
andq $0x0, 0x8(%rsp)
movups %xmm0, (%rbx)
andq $0x0, (%rsp)
jmp 0x16565
leaq 0x30(%rsp), %rdi
callq 0x9130
leaq 0x8(%rsp), %rdi
callq 0xa248
leaq 0x50(%rsp), %rdi
callq 0x1fb90
movq %rbx, %rax
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
pushq $0x10
popq %rdi
callq 0x9150
movq %rax, %r15
leaq 0x23090(%rip), %rsi     # 0x39630
movq %rax, %rdi
callq 0x93c0
movq 0x45a21(%rip), %rsi     # 0x5bfd0
movq 0x459e2(%rip), %rdx     # 0x5bf98
movq %r15, %rdi
callq 0x94b0
jmp 0x165c0
movq %rax, %r14
jmp 0x165ff
jmp 0x165d6
movq %rax, %r14
movq %r15, %rdi
callq 0x9210
jmp 0x165d9
jmp 0x165d6
movq %rax, %r14
movq %rbx, %rdi
callq 0x1fb90
jmp 0x165e6
movq %rax, %r14
leaq 0x30(%rsp), %rdi
callq 0x9130
jmp 0x165f5
movq %rax, %r14
leaq 0x8(%rsp), %rdi
callq 0xa248
leaq 0x50(%rsp), %rdi
callq 0x1fb90
movq %r14, %rdi
callq 0x94d0