// File: /workspace/github_cpp_makefile_star2_O1/cla7aye15I4nd[P]basic_interpreter/./lib/program.hpp
// Function: basic::basic_interpreter::eval(__gnu_cxx::__normal_iterator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>> const&, __gnu_cxx::__normal_iterator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>> const&, __gnu_cxx::__normal_iterator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>> const&, std::vector<__gnu_cxx::__normal_iterator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>>, std::allocator<__gnu_cxx::__normal_iterator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>>>> const&)
int eval(const expr_iter& begin,
                 const expr_iter& end,
                 const expr_iter& start,
                 const std::vector<expr_iter>& match) {
            std::vector<int> atom;
            std::vector<char> oper;
            for (auto ptr = begin; ptr != end; ptr++) {
                char c = (*ptr)[0];
                if (c == '+' || c == '-' || c == '*' || c == '/')
                    oper.emplace_back(c);
                else {
                    if (c == '(') {
                        atom.emplace_back(eval(ptr + 1, match[ptr - start], start, match));
                        ptr = match[ptr - start];
                    } else {
                        atom.emplace_back(eval(*ptr));
                    }
                    while (!oper.empty() && oper.back() != '+' && oper.back() != '-') {
                        char op = oper.back(); oper.pop_back();
                        int y = atom.back(); atom.pop_back();
                        int x = atom.back(); atom.pop_back();
                        if (op == '*')
                            atom.emplace_back(x * y);
                        else if (op == '/') {
                            ASSERT(y, DIVIDE_BY_ZERO);
                            atom.emplace_back(x / y);
                        }
                    }
                }
            }

            int result = *atom.begin();
            for (size_t p = 0; p < oper.size(); ++p) {
                if (oper[p] == '+') result += atom[p + 1];
                else result -= atom[p + 1];
            }
            return result;
        }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rdi, 0x50(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
xorl %eax, %eax
movq %rax, 0x20(%rsp)
movq %rax, 0x40(%rsp)
movaps %xmm0, 0x30(%rsp)
movq (%rsi), %r13
cmpq %r13, (%rdx)
je 0x4331
movq %r8, %rbx
movq %rcx, %r14
movq %rdx, %r15
leaq 0x28(%rsp), %rbp
movabsq $0xac0000000000, %r12   # imm = 0xAC0000000000
movq (%r13), %rax
movzbl (%rax), %eax
movb %al, 0xf(%rsp)
cmpq $0x2f, %rax
ja 0x4230
btq %rax, %r12
jae 0x41e4
leaq 0x30(%rsp), %rdi
leaq 0xf(%rsp), %rsi
callq 0x4548
addq $0x20, %r13
cmpq (%r15), %r13
jne 0x41b0
jmp 0x4331
cmpq $0x28, %rax
jne 0x4230
leaq 0x20(%r13), %rax
movq %rax, 0x28(%rsp)
movq %r13, %rdx
subq (%r14), %rdx
sarq $0x2, %rdx
addq (%rbx), %rdx
movq 0x50(%rsp), %rdi
movq %rbp, %rsi
movq %r14, %rcx
movq %rbx, %r8
callq 0x4160
movl %eax, 0x4c(%rsp)
movq 0x18(%rsp), %rsi
cmpq 0x20(%rsp), %rsi
je 0x425a
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x18(%rsp)
jmp 0x4269
movq 0x50(%rsp), %rdi
movq %r13, %rsi
callq 0x4574
movl %eax, 0x28(%rsp)
movq 0x18(%rsp), %rsi
cmpq 0x20(%rsp), %rsi
je 0x4279
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x18(%rsp)
jmp 0x4286
leaq 0x10(%rsp), %rdi
leaq 0x4c(%rsp), %rdx
callq 0x46fa
subq (%r14), %r13
movq (%rbx), %rax
sarq $0x2, %r13
movq (%rax,%r13), %r13
jmp 0x4286
leaq 0x10(%rsp), %rdi
movq %rbp, %rdx
callq 0x46fa
movq 0x38(%rsp), %rax
cmpq %rax, 0x30(%rsp)
je 0x41d6
movzbl -0x1(%rax), %edx
cmpl $0x2b, %edx
je 0x41d6
cmpl $0x2d, %edx
je 0x41d6
decq %rax
movq %rax, 0x38(%rsp)
movq 0x18(%rsp), %rdi
leaq -0x4(%rdi), %rcx
movl -0x4(%rdi), %r8d
movq %rcx, 0x18(%rsp)
leaq -0x8(%rdi), %rsi
movl -0x8(%rdi), %eax
movq %rsi, 0x18(%rsp)
cmpl $0x2f, %edx
je 0x42fa
cmpl $0x2a, %edx
jne 0x4286
imull %r8d, %eax
movl %eax, 0x28(%rsp)
cmpq 0x20(%rsp), %rsi
jne 0x4312
leaq 0x10(%rsp), %rdi
movq %rbp, %rdx
callq 0x46fa
jmp 0x4286
testl %r8d, %r8d
je 0x43a3
cltd
idivl %r8d
movl %eax, 0x28(%rsp)
cmpq 0x20(%rsp), %rsi
je 0x431f
movl %eax, -0x8(%rdi)
movq %rcx, 0x18(%rsp)
jmp 0x4286
leaq 0x10(%rsp), %rdi
movq %rbp, %rdx
callq 0x46fa
jmp 0x4286
movq 0x10(%rsp), %rax
movl (%rax), %ebx
movq 0x30(%rsp), %rdi
movq 0x38(%rsp), %rcx
subq %rdi, %rcx
je 0x4369
cmpq $0x1, %rcx
adcq $0x0, %rcx
xorl %edx, %edx
cmpb $0x2b, (%rdi,%rdx)
jne 0x435d
addl 0x4(%rax,%rdx,4), %ebx
jmp 0x4361
subl 0x4(%rax,%rdx,4), %ebx
incq %rdx
cmpq %rdx, %rcx
jne 0x4351
testq %rdi, %rdi
je 0x437b
movq 0x40(%rsp), %rsi
subq %rdi, %rsi
callq 0x21b0
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x4392
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x21b0
movl %ebx, %eax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x1, %edi
callq 0x20d0
leaq 0x49bc(%rip), %rsi      # 0x8d70
movq %rax, %rdi
xorl %edx, %edx
callq 0x2280
jmp 0x43c8
jmp 0x43c8
jmp 0x43c8
jmp 0x43c8
jmp 0x43c8
movq %rax, %rbx
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x43e2
movq 0x40(%rsp), %rsi
subq %rdi, %rsi
callq 0x21b0
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x43f9
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x21b0
movq %rbx, %rdi
callq 0x22a0
nop