// File: cla7aye15I4nd[P]basic_interpreter/./lib/program.hpp
// Function: basic::basic_interpreter::check_expr(__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&)
bool check_expr(const expr_iter& begin,
                        const expr_iter& end) {
            int cnt = 0;
            for (auto ptr = begin; ptr != end; ptr++) {
                if (*ptr == "(") {
                    ++cnt;
                    if (ptr + 1 == end) return false;
                    if (*(ptr + 1) == ")") return false;
                }
                if (*ptr == ")") if (--cnt < 0) return false;
                if (is_element(*ptr) && ptr + 1 != end && *(ptr + 1) != ")") {
                    if (ptr + 2 == end || (!is_element(*(ptr + 2)) && *(ptr + 2) != "("))
                        return false;
                }
            }
      
            return cnt == 0;
        }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movl $0x0, -0x24(%rbp)
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x20(%rbp), %rsi
leaq -0x30(%rbp), %rdi
callq 0x8460
testb $0x1, %al
jne 0xe6af
jmp 0xe8af
leaq -0x30(%rbp), %rdi
callq 0x6e70
movq %rax, %rdi
leaq 0x2a29(%rip), %rsi      # 0x110eb
callq 0x4080
testb $0x1, %al
jne 0xe6cd
jmp 0xe73f
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
leaq -0x30(%rbp), %rdi
movl $0x1, %esi
callq 0x71c0
movq %rax, -0x38(%rbp)
movq -0x20(%rbp), %rsi
leaq -0x38(%rbp), %rdi
callq 0xe8d0
testb $0x1, %al
jne 0xe6fb
jmp 0xe704
movb $0x0, -0x1(%rbp)
jmp 0xe8bb
leaq -0x30(%rbp), %rdi
movl $0x1, %esi
callq 0x71c0
movq %rax, -0x40(%rbp)
leaq -0x40(%rbp), %rdi
callq 0x6e70
movq %rax, %rdi
leaq 0x29f3(%rip), %rsi      # 0x1111c
callq 0x4080
testb $0x1, %al
jne 0xe734
jmp 0xe73d
movb $0x0, -0x1(%rbp)
jmp 0xe8bb
jmp 0xe73f
leaq -0x30(%rbp), %rdi
callq 0x6e70
movq %rax, %rdi
leaq 0x29ca(%rip), %rsi      # 0x1111c
callq 0x4080
testb $0x1, %al
jne 0xe75d
jmp 0xe776
movl -0x24(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x24(%rbp)
cmpl $0x0, %eax
jge 0xe774
movb $0x0, -0x1(%rbp)
jmp 0xe8bb
jmp 0xe776
leaq -0x30(%rbp), %rdi
callq 0x6e70
movq %rax, %rdi
callq 0x3da0
movb %al, %cl
xorl %eax, %eax
testb $0x1, %cl
movb %al, -0x71(%rbp)
jne 0xe795
jmp 0xe7ef
leaq -0x30(%rbp), %rdi
movl $0x1, %esi
callq 0x71c0
movq %rax, -0x48(%rbp)
movq -0x20(%rbp), %rsi
leaq -0x48(%rbp), %rdi
callq 0x8460
movb %al, %cl
xorl %eax, %eax
testb $0x1, %cl
movb %al, -0x71(%rbp)
jne 0xe7c2
jmp 0xe7ef
leaq -0x30(%rbp), %rdi
movl $0x1, %esi
callq 0x71c0
movq %rax, -0x50(%rbp)
leaq -0x50(%rbp), %rdi
callq 0x6e70
movq %rax, %rdi
leaq 0x2935(%rip), %rsi      # 0x1111c
callq 0xe640
movb %al, -0x71(%rbp)
movb -0x71(%rbp), %al
testb $0x1, %al
jne 0xe7fb
jmp 0xe899
leaq -0x30(%rbp), %rdi
movl $0x2, %esi
callq 0x71c0
movq %rax, -0x58(%rbp)
movq -0x20(%rbp), %rsi
leaq -0x58(%rbp), %rdi
callq 0xe8d0
movb %al, %cl
movb $0x1, %al
testb $0x1, %cl
movb %al, -0x72(%rbp)
jne 0xe888
leaq -0x30(%rbp), %rdi
movl $0x2, %esi
callq 0x71c0
movq %rax, -0x60(%rbp)
leaq -0x60(%rbp), %rdi
callq 0x6e70
movq %rax, %rdi
callq 0x3da0
movb %al, %cl
xorl %eax, %eax
testb $0x1, %cl
movb %al, -0x73(%rbp)
jne 0xe882
leaq -0x30(%rbp), %rdi
movl $0x2, %esi
callq 0x71c0
movq %rax, -0x68(%rbp)
leaq -0x68(%rbp), %rdi
callq 0x6e70
movq %rax, %rdi
leaq 0x2871(%rip), %rsi      # 0x110eb
callq 0xe640
movb %al, -0x73(%rbp)
movb -0x73(%rbp), %al
movb %al, -0x72(%rbp)
movb -0x72(%rbp), %al
testb $0x1, %al
jne 0xe891
jmp 0xe897
movb $0x0, -0x1(%rbp)
jmp 0xe8bb
jmp 0xe899
jmp 0xe89b
leaq -0x30(%rbp), %rdi
xorl %esi, %esi
callq 0x8730
movq %rax, -0x70(%rbp)
jmp 0xe699
cmpl $0x0, -0x24(%rbp)
sete %al
andb $0x1, %al
movb %al, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x80, %rsp
popq %rbp
retq
nopl (%rax)