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

        auto e_result = applicative_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::Star:
            acc = make<ast::mul_expr_t>(acc, e);
            break;
        case token_t::kind_t::Slash:
            acc = make<ast::div_expr_t>(acc, e);
            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 $0x98, %rsp
movq %rdx, %r12
movq %rsi, %r13
movq %rdi, %rbx
leaq 0x60(%rsp), %r14
movq %r14, %rdi
callq 0x19f1c
cmpb $0x0, 0x30(%r14)
je 0x1a1c1
leaq 0x60(%rsp), %rdi
callq 0x1b196
movq %rsp, %rbp
movq %rbp, %rdi
movq %rax, %rsi
callq 0xbde0
leaq 0x20(%rsp), %r15
leaq 0x10(%rsp), %r14
movq (%r12), %rdx
leaq 0x30(%rsp), %rdi
movq %r13, %rsi
callq 0x1537c
movl 0x30(%rsp), %eax
addl $-0x12, %eax
cmpl $-0x2, %eax
jb 0x1a1d0
movq 0x48(%rsp), %rax
addq 0x38(%rsp), %rax
movq %rax, (%r12)
movq %rbx, %rdi
movq %r13, %rsi
movq %r12, %rdx
callq 0x19f1c
cmpb $0x0, 0x30(%rbx)
je 0x1a1f2
movq %rbx, %rdi
callq 0x1b196
movq %r15, %rdi
movq %rax, %rsi
callq 0xbde0
movl 0x30(%rsp), %eax
cmpl $0x10, %eax
je 0x1a17d
cmpl $0x11, %eax
jne 0x1a225
movq %r14, %rdi
movq %rbp, %rsi
movq %r15, %rdx
callq 0x1e028
movq %rbp, %rdi
movq %r14, %rsi
callq 0x2031c
jmp 0x1a196
movq %r14, %rdi
movq %rbp, %rsi
movq %r15, %rdx
callq 0x1dd9d
movq %rbp, %rdi
movq %r14, %rsi
callq 0x202ee
leaq 0x18(%rsp), %rdi
callq 0xa248
leaq 0x28(%rsp), %rdi
callq 0xa248
movq %rbx, %rdi
callq 0x13e4a
leaq 0x40(%rsp), %rdi
callq 0x9130
jmp 0x1a0f6
leaq 0x60(%rsp), %rsi
movq %rbx, %rdi
callq 0x1b172
jmp 0x1a206
leaq 0x40(%rsp), %rdi
callq 0x9130
movb $0x1, 0x30(%rbx)
movaps (%rsp), %xmm0
andq $0x0, 0x8(%rsp)
movups %xmm0, (%rbx)
andq $0x0, (%rsp)
jmp 0x1a1fc
leaq 0x40(%rsp), %rdi
callq 0x9130
leaq 0x8(%rsp), %rdi
callq 0xa248
leaq 0x60(%rsp), %rdi
callq 0x13e4a
movq %rbx, %rax
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
pushq $0x10
popq %rdi
callq 0x9150
movq %rax, %r15
leaq 0x1f3f9(%rip), %rsi     # 0x39630
movq %rax, %rdi
callq 0x93c0
movq 0x41d8a(%rip), %rsi     # 0x5bfd0
movq 0x41d4b(%rip), %rdx     # 0x5bf98
movq %r15, %rdi
callq 0x94b0
jmp 0x1a257
movq %rax, %r14
jmp 0x1a2a5
jmp 0x1a26d
movq %rax, %r14
movq %r15, %rdi
callq 0x9210
jmp 0x1a270
jmp 0x1a26d
movq %rax, %r14
leaq 0x28(%rsp), %rdi
callq 0xa248
jmp 0x1a27f
movq %rax, %r14
movq %rbx, %rdi
callq 0x13e4a
jmp 0x1a28c
movq %rax, %r14
leaq 0x40(%rsp), %rdi
callq 0x9130
jmp 0x1a29b
movq %rax, %r14
leaq 0x8(%rsp), %rdi
callq 0xa248
leaq 0x60(%rsp), %rdi
callq 0x13e4a
movq %r14, %rdi
callq 0x94d0