// File: /workspace/github_cpp_makefile_star2_O3/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, 0x50(%rsp)
xorps %xmm0, %xmm0
leaq 0x10(%rsp), %rcx
movaps %xmm0, (%rcx)
xorl %eax, %eax
movq %rax, 0x10(%rcx)
leaq 0x30(%rsp), %rcx
movq %rax, 0x10(%rcx)
movaps %xmm0, (%rcx)
movq (%rsi), %r12
leaq 0x28(%rsp), %r13
movabsq $0xac0000000000, %rbp   # imm = 0xAC0000000000
movq (%r12), %rax
movzbl (%rax), %eax
movb %al, 0xf(%rsp)
cmpq $0x2f, %rax
ja 0x421e
btq %rax, %rbp
jae 0x41d1
leaq 0x30(%rsp), %rdi
leaq 0xf(%rsp), %rsi
callq 0x4536
addq $0x20, %r12
cmpq (%r15), %r12
jne 0x419d
jmp 0x4315
cmpq $0x28, %rax
jne 0x421e
leaq 0x20(%r12), %rax
movq %rax, 0x28(%rsp)
movq %r12, %rdx
subq (%r14), %rdx
sarq $0x2, %rdx
addq (%rbx), %rdx
movq 0x50(%rsp), %rdi
movq %r13, %rsi
movq %r14, %rcx
movq %rbx, %r8
callq 0x4152
movl %eax, 0x4c(%rsp)
movq 0x18(%rsp), %rsi
cmpq 0x20(%rsp), %rsi
je 0x4248
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x18(%rsp)
jmp 0x4257
movq 0x50(%rsp), %rdi
movq %r12, %rsi
callq 0x456a
movl %eax, 0x28(%rsp)
movq 0x18(%rsp), %rsi
cmpq 0x20(%rsp), %rsi
je 0x4267
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x18(%rsp)
jmp 0x4274
leaq 0x10(%rsp), %rdi
leaq 0x4c(%rsp), %rdx
callq 0x46f0
subq (%r14), %r12
movq (%rbx), %rax
sarq $0x2, %r12
movq (%rax,%r12), %r12
jmp 0x4274
leaq 0x10(%rsp), %rdi
movq %r13, %rdx
callq 0x46f0
movq 0x38(%rsp), %rax
cmpq %rax, 0x30(%rsp)
je 0x41c3
movzbl -0x1(%rax), %edx
cmpl $0x2b, %edx
je 0x41c3
cmpl $0x2d, %edx
je 0x41c3
decq %rax
movq %rax, 0x38(%rsp)
movq 0x18(%rsp), %rsi
leaq -0x4(%rsi), %rcx
movl -0x8(%rsi), %eax
movl -0x4(%rsi), %edi
addq $-0x8, %rsi
movq %rsi, 0x18(%rsp)
cmpl $0x2f, %edx
je 0x42e1
cmpl $0x2a, %edx
jne 0x4274
imull %edi, %eax
movl %eax, 0x28(%rsp)
cmpq 0x20(%rsp), %rsi
jne 0x42f7
leaq 0x10(%rsp), %rdi
movq %r13, %rdx
callq 0x46f0
jmp 0x4274
testl %edi, %edi
je 0x4391
cltd
idivl %edi
movl %eax, 0x28(%rsp)
cmpq 0x20(%rsp), %rsi
je 0x4303
movl %eax, (%rsi)
movq %rcx, 0x18(%rsp)
jmp 0x4274
leaq 0x10(%rsp), %rdi
movq %r13, %rdx
callq 0x46f0
jmp 0x4274
movq 0x10(%rsp), %rdi
movq 0x30(%rsp), %rax
movq 0x38(%rsp), %rcx
movl (%rdi), %ebx
subq %rax, %rcx
je 0x4354
cmpq $0x1, %rcx
adcq $0x0, %rcx
xorl %edx, %edx
movl 0x4(%rdi,%rdx,4), %esi
movl %esi, %r8d
negl %r8d
cmpb $0x2b, (%rax,%rdx)
cmovel %esi, %r8d
addl %r8d, %ebx
incq %rdx
cmpq %rdx, %rcx
jne 0x4335
jmp 0x4359
testq %rax, %rax
je 0x4373
movq 0x40(%rsp), %rsi
subq %rax, %rsi
movq %rax, %rdi
callq 0x21b0
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x4380
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 0x49ce(%rip), %rsi      # 0x8d70
movq %rax, %rdi
xorl %edx, %edx
callq 0x2280
jmp 0x43b6
jmp 0x43b6
jmp 0x43b6
jmp 0x43b6
jmp 0x43b6
movq %rax, %rbx
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x43d0
movq 0x40(%rsp), %rsi
subq %rdi, %rsi
callq 0x21b0
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x43e7
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x21b0
movq %rbx, %rdi
callq 0x22a0
nop