// File: /workspace/github_cpp_makefile_star2_O2/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 %r8, %rbx
movq %rcx, %r14
movq %rdx, %r15
movq %rdi, 0x38(%rsp)
leaq 0x40(%rsp), %r13
andq $0x0, 0x10(%r13)
xorps %xmm0, %xmm0
movaps %xmm0, (%r13)
leaq 0x20(%rsp), %rax
movaps %xmm0, (%rax)
andq $0x0, 0x10(%rax)
movq (%rsi), %r12
leaq 0x10(%rsp), %rbp
cmpq (%r15), %r12
je 0x3f41
movq (%r12), %rax
movzbl (%rax), %eax
movb %al, 0xf(%rsp)
cmpq $0x2f, %rax
ja 0x3eb1
movabsq $0xac0000000000, %rcx   # imm = 0xAC0000000000
btq %rax, %rcx
jae 0x3e60
leaq 0x20(%rsp), %rdi
leaq 0xf(%rsp), %rsi
callq 0x41be
addq $0x20, %r12
jmp 0x3e21
cmpq $0x28, %rax
jne 0x3eb1
leaq 0x20(%r12), %rax
movq %rax, 0x10(%rsp)
movq %r12, %rdx
subq (%r14), %rdx
sarq $0x2, %rdx
addq (%rbx), %rdx
movq 0x38(%rsp), %rdi
movq %rbp, %rsi
movq %r14, %rcx
movq %rbx, %r8
callq 0x3dde
movl %eax, 0x1c(%rsp)
movq %r13, %rdi
leaq 0x1c(%rsp), %rsi
callq 0x41f2
subq (%r14), %r12
movq (%rbx), %rax
sarq $0x2, %r12
movq (%rax,%r12), %r12
jmp 0x3ecd
movq 0x38(%rsp), %rdi
movq %r12, %rsi
callq 0x4226
movl %eax, 0x10(%rsp)
movq %r13, %rdi
movq %rbp, %rsi
callq 0x41f2
movq 0x28(%rsp), %rax
cmpq %rax, 0x20(%rsp)
je 0x3e5a
movzbl -0x1(%rax), %edx
cmpl $0x2b, %edx
je 0x3e5a
cmpl $0x2d, %edx
je 0x3e5a
decq %rax
movq %rax, 0x28(%rsp)
movq 0x48(%rsp), %rsi
movl -0x8(%rsi), %eax
movl -0x4(%rsi), %ecx
addq $-0x8, %rsi
movq %rsi, 0x48(%rsp)
cmpl $0x2f, %edx
je 0x3f29
cmpl $0x2a, %edx
jne 0x3ecd
imull %ecx, %eax
movl %eax, 0x10(%rsp)
movq %r13, %rdi
movq %rbp, %rsi
callq 0x41f2
jmp 0x3ecd
testl %ecx, %ecx
je 0x3f9b
cltd
idivl %ecx
movl %eax, 0x10(%rsp)
movq %r13, %rdi
movq %rbp, %rsi
callq 0x41f2
jmp 0x3ecd
movq 0x40(%rsp), %rax
movl (%rax), %ebx
movq 0x20(%rsp), %rcx
movq 0x28(%rsp), %rdx
subq %rcx, %rdx
xorl %esi, %esi
cmpq %rsi, %rdx
je 0x3f76
movl 0x4(%rax,%rsi,4), %edi
movl %edi, %r8d
negl %r8d
cmpb $0x2b, (%rcx,%rsi)
cmovel %edi, %r8d
addl %r8d, %ebx
incq %rsi
jmp 0x3f57
leaq 0x20(%rsp), %rdi
callq 0x4558
leaq 0x40(%rsp), %rdi
callq 0x4572
movl %ebx, %eax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
pushq $0x1
popq %rdi
callq 0x2100
leaq 0x5dc6(%rip), %rsi      # 0x9d70
movq %rax, %rdi
xorl %edx, %edx
callq 0x22b0
jmp 0x3fbe
jmp 0x3fbe
jmp 0x3fbe
jmp 0x3fbe
jmp 0x3fbe
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x4558
leaq 0x40(%rsp), %rdi
callq 0x4572
movq %rbx, %rdi
callq 0x22d0
nop