// File: /workspace/github_cpp_makefile_star2_O3/bsegovia[P]boodew/boodew.cpp
// Function: boodew::expr(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, char, unsigned long)
static pair<value,size_t> expr(const string &s, char c, size_t curr) {
  const char *match = c=='['?"[]@":"()";
  stringstream ss;
  size_t opened = 1, next = curr;
  while (opened) {
    if ((next = s.find_first_of(match,next+1)) == string::npos)
      throw boodew_exception(format("missing %c", c=='['?']':')'));
    if (c == '[' && s[next] == '@') {
      ss << s.substr(curr+1, next-curr-1);
      if (s[next+1] == '(') {
        const auto v = expr(s, '(', next+1);
        ss << vtos(v.first);
        if (s[v.second]!=']'||opened!=1) ss << s[v.second];
        curr = v.second;
        next = curr > 0 ? curr-1 : 0;
      } else
        do ss << s[curr = ++next]; while (s[next] == '@');
    } else
      opened += s[next] == c ? +1 : -1;
  }
  if (next>curr) ss << s.substr(curr+1, next-curr-1);
  return make_pair((c=='[' ? stov(ss.str()) : ex(ss.str())), next+1);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x228, %rsp            # imm = 0x228
movq %rcx, %r14
movq %rsi, %r12
movq %rdi, 0x68(%rsp)
xorl %ebx, %ebx
movl %edx, 0xc(%rsp)
cmpb $0x5b, %dl
sete %bl
leaq 0x44a9(%rip), %rax      # 0xa0d8
leaq 0x44a6(%rip), %rcx      # 0xa0dc
cmoveq %rax, %rcx
movq %rcx, 0x70(%rsp)
leaq 0xa0(%rsp), %rdi
callq 0x3160
orq $0x2, %rbx
movq %rbx, 0x78(%rsp)
leaq 0xb0(%rsp), %r13
movl $0x1, %ebp
leaq 0x30(%rsp), %rbx
movq %r14, %r15
incq %r14
movq %r12, %rdi
movq 0x70(%rsp), %rsi
movq %r14, %rdx
movq 0x78(%rsp), %rcx
callq 0x32b0
cmpq $-0x1, %rax
je 0x5f5a
movq %rax, %r14
movq (%r12), %rax
movb (%rax,%r14), %al
cmpb $0x5b, 0xc(%rsp)
jne 0x5de2
cmpb $0x40, %al
jne 0x5de2
leaq 0x1(%r15), %rdx
notq %r15
addq %r14, %r15
movq %rbx, %rdi
movq %r12, %rsi
movq %r15, %rcx
callq 0x3220
movq 0x30(%rsp), %rsi
movq 0x38(%rsp), %rdx
movq %r13, %rdi
callq 0x3240
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
je 0x5cf0
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x3200
movq (%r12), %rax
cmpb $0x28, 0x1(%rax,%r14)
jne 0x5db1
incq %r14
movq %rbx, %rdi
movq %r12, %rsi
movl $0x28, %edx
movq %r14, %rcx
callq 0x5c00
leaq 0x10(%rsp), %rdi
movq %rbx, %rsi
callq 0x477f
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %rdx
movq %r13, %rdi
callq 0x3240
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x5d51
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x3200
movq 0x60(%rsp), %r15
movq (%r12), %rax
movb (%rax,%r15), %al
cmpq $0x1, %rbp
jne 0x5d68
cmpb $0x5d, %al
je 0x5d83
movb %al, 0x10(%rsp)
movl $0x1, %edx
movq %r13, %rdi
leaq 0x10(%rsp), %rsi
callq 0x3240
movq 0x60(%rsp), %r15
movq %r15, %r14
subq $0x1, %r14
movl $0x0, %eax
cmovbq %rax, %r14
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
je 0x5df0
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x3200
jmp 0x5df0
movb 0x1(%rax,%r14), %al
movb %al, 0x30(%rsp)
movl $0x1, %edx
movq %r13, %rdi
movq %rbx, %rsi
callq 0x3240
movq (%r12), %rax
leaq 0x1(%r14), %r15
cmpb $0x40, 0x1(%rax,%r14)
movq %r15, %r14
je 0x5db1
movq %r15, %r14
jmp 0x5df0
xorl %ecx, %ecx
cmpb 0xc(%rsp), %al
sete %cl
leaq -0x1(%rbp,%rcx,2), %rbp
testq %rbp, %rbp
jne 0x5c6a
cmpq %r15, %r14
leaq 0x40(%rsp), %rbp
jbe 0x5e46
leaq 0x1(%r15), %rdx
notq %r15
addq %r14, %r15
leaq 0x30(%rsp), %rdi
movq %r12, %rsi
movq %r15, %rcx
callq 0x3220
movq 0x30(%rsp), %rsi
movq 0x38(%rsp), %rdx
movq %r13, %rdi
callq 0x3240
movq 0x30(%rsp), %rdi
cmpq %rbp, %rdi
je 0x5e46
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x3200
leaq 0xb8(%rsp), %rsi
cmpb $0x5b, 0xc(%rsp)
jne 0x5e96
leaq 0x10(%rsp), %rdi
callq 0x32d0
movq 0x68(%rsp), %rbx
leaq 0x30(%rsp), %rdi
movq %rbp, (%rdi)
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %rdx
addq %rsi, %rdx
callq 0x7070
movq $0x0, 0x50(%rsp)
movb $0x0, 0x58(%rsp)
movl $0x0, 0x5c(%rsp)
jmp 0x5eb4
leaq 0x10(%rsp), %rdi
callq 0x32d0
movq 0x68(%rsp), %rbx
leaq 0x30(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x542c
incq %r14
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
movq 0x30(%rsp), %rcx
cmpq %rbp, %rcx
je 0x5ed6
movq %rcx, (%rbx)
movq 0x40(%rsp), %rax
movq %rax, 0x10(%rbx)
jmp 0x5edd
movups (%rbp), %xmm0
movups %xmm0, (%rax)
movq 0x38(%rsp), %rax
movq %rax, 0x8(%rbx)
movq %rbp, 0x30(%rsp)
movq $0x0, 0x38(%rsp)
movb $0x0, 0x40(%rsp)
movups 0x50(%rsp), %xmm0
movups %xmm0, 0x20(%rbx)
movq %r14, 0x30(%rbx)
cmpb $0x5b, 0xc(%rsp)
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x5f27
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x3200
movq 0x907a(%rip), %rsi      # 0xefa8
leaq 0xa0(%rsp), %rdi
callq 0x3190
leaq 0x120(%rsp), %rdi
callq 0x30a0
addq $0x228, %rsp            # imm = 0x228
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x28, %edi
callq 0x30f0
movq %rax, %r14
cmpb $0x5b, 0xc(%rsp)
movl $0x5d, %eax
movl $0x29, %edx
cmovel %eax, %edx
leaq 0x415f(%rip), %rsi      # 0xa0df
leaq 0x80(%rsp), %rdi
xorl %eax, %eax
callq 0x45cc
movb $0x1, %bpl
leaq 0x80(%rsp), %rsi
movq %r14, %rdi
callq 0x6e4a
xorl %ebp, %ebp
leaq 0x8c0d(%rip), %rsi      # 0xebb8
leaq 0xee2(%rip), %rdx       # 0x6e94
movq %r14, %rdi
callq 0x32f0
jmp 0x5fbc
movq %rax, %rbx
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x607f
movq 0x20(%rsp), %rsi
jmp 0x603a
jmp 0x607c
jmp 0x607c
movq %rax, %rbx
movq 0x30(%rsp), %rdi
cmpq %rbp, %rdi
jne 0x6035
jmp 0x607f
jmp 0x607c
jmp 0x6023
movq %rax, %rbx
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x6026
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x3200
jmp 0x6026
jmp 0x6023
jmp 0x607c
jmp 0x607c
movq %rax, %rbx
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
je 0x607f
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x3200
jmp 0x607f
movq %rax, %rbx
leaq 0x90(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x6068
movq 0x90(%rsp), %rsi
incq %rsi
callq 0x3200
testb %bpl, %bpl
jne 0x6072
jmp 0x607f
movq %rax, %rbx
movq %r14, %rdi
callq 0x3180
jmp 0x607f
movq %rax, %rbx
movq 0x8f22(%rip), %rsi      # 0xefa8
leaq 0xa0(%rsp), %rdi
callq 0x3190
leaq 0x120(%rsp), %rdi
callq 0x30a0
movq %rbx, %rdi
callq 0x3300