// File: 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
movq %rsp, %rbp
subq $0x360, %rsp            # imm = 0x360
movq %rdi, -0x320(%rbp)
movb %dl, %al
movq %rdi, %rdx
movq %rdx, -0x318(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movb %al, -0x11(%rbp)
movq %rcx, -0x20(%rbp)
movsbl -0x11(%rbp), %edx
leaq 0xf5d5(%rip), %rax      # 0x1637d
leaq 0xf5ca(%rip), %rcx      # 0x16379
cmpl $0x5b, %edx
cmoveq %rcx, %rax
movq %rax, -0x28(%rbp)
leaq -0x1b0(%rbp), %rdi
callq 0x31c0
movq $0x1, -0x1b8(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x1c0(%rbp)
cmpq $0x0, -0x1b8(%rbp)
je 0x719b
movq -0x10(%rbp), %rdi
movq -0x28(%rbp), %rsi
movq -0x1c0(%rbp), %rdx
addq $0x1, %rdx
callq 0x3130
movq %rax, -0x1c0(%rbp)
cmpq $-0x1, %rax
jne 0x6edd
movb $0x1, -0x1ed(%rbp)
movl $0x28, %edi
callq 0x3120
movq %rax, -0x328(%rbp)
movb -0x11(%rbp), %al
subb $0x5b, %al
movl $0x5d, %eax
movl $0x29, %edx
cmovel %eax, %edx
leaq 0xf53c(%rip), %rsi      # 0x16380
xorl %eax, %eax
leaq -0x1e0(%rbp), %rdi
callq 0x4980
jmp 0x6e54
movq -0x328(%rbp), %rdi
leaq -0x1e0(%rbp), %rsi
callq 0xc140
jmp 0x6e69
movq -0x328(%rbp), %rdi
movb $0x0, -0x1ed(%rbp)
leaq 0x1bd2a(%rip), %rsi     # 0x22ba8
leaq 0x532b(%rip), %rdx      # 0xc1b0
callq 0x33f0
jmp 0x73b9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1e8(%rbp)
movl %eax, -0x1ec(%rbp)
jmp 0x6ec1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1e8(%rbp)
movl %eax, -0x1ec(%rbp)
leaq -0x1e0(%rbp), %rdi
callq 0x3180
testb $0x1, -0x1ed(%rbp)
jne 0x6ecc
jmp 0x6ed8
movq -0x328(%rbp), %rdi
callq 0x31e0
jmp 0x73a1
movsbl -0x11(%rbp), %eax
cmpl $0x5b, %eax
jne 0x7160
movq -0x10(%rbp), %rdi
movq -0x1c0(%rbp), %rsi
callq 0x32e0
movsbl (%rax), %eax
cmpl $0x40, %eax
jne 0x7160
leaq -0x1a0(%rbp), %rax
movq %rax, -0x330(%rbp)
movq -0x10(%rbp), %rsi
movq -0x20(%rbp), %rcx
movq %rcx, %rdx
incq %rdx
movq -0x1c0(%rbp), %rax
notq %rcx
addq %rax, %rcx
leaq -0x210(%rbp), %rdi
callq 0x3290
jmp 0x6f3d
movq -0x330(%rbp), %rdi
leaq -0x210(%rbp), %rsi
callq 0x3240
jmp 0x6f52
leaq -0x210(%rbp), %rdi
callq 0x3180
movq -0x10(%rbp), %rdi
movq -0x1c0(%rbp), %rsi
addq $0x1, %rsi
callq 0x32e0
movsbl (%rax), %eax
cmpl $0x28, %eax
jne 0x7103
movq -0x10(%rbp), %rsi
movq -0x1c0(%rbp), %rcx
incq %rcx
leaq -0x248(%rbp), %rdi
movl $0x28, %edx
callq 0x6d70
jmp 0x6f9f
leaq -0x1a0(%rbp), %rax
movq %rax, -0x338(%rbp)
leaq -0x268(%rbp), %rdi
leaq -0x248(%rbp), %rsi
callq 0x4ba0
jmp 0x6fc2
movq -0x338(%rbp), %rdi
leaq -0x268(%rbp), %rsi
callq 0x3240
jmp 0x6fd7
leaq -0x268(%rbp), %rdi
callq 0x3180
movq -0x10(%rbp), %rdi
movq -0x218(%rbp), %rsi
callq 0x32e0
movsbl (%rax), %eax
cmpl $0x5d, %eax
jne 0x7009
cmpq $0x1, -0x1b8(%rbp)
je 0x70a8
leaq -0x1a0(%rbp), %rax
movq %rax, -0x340(%rbp)
movq -0x10(%rbp), %rdi
movq -0x218(%rbp), %rsi
callq 0x32e0
movq -0x340(%rbp), %rdi
movsbl (%rax), %esi
callq 0x3310
jmp 0x7038
jmp 0x70a8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1e8(%rbp)
movl %eax, -0x1ec(%rbp)
jmp 0x73a1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1e8(%rbp)
movl %eax, -0x1ec(%rbp)
leaq -0x210(%rbp), %rdi
callq 0x3180
jmp 0x73a1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1e8(%rbp)
movl %eax, -0x1ec(%rbp)
jmp 0x70f2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1e8(%rbp)
movl %eax, -0x1ec(%rbp)
leaq -0x268(%rbp), %rdi
callq 0x3180
jmp 0x70f2
movq -0x218(%rbp), %rax
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
jbe 0x70cb
movq -0x20(%rbp), %rax
subq $0x1, %rax
movq %rax, -0x348(%rbp)
jmp 0x70d6
xorl %eax, %eax
movq %rax, -0x348(%rbp)
jmp 0x70d6
movq -0x348(%rbp), %rax
movq %rax, -0x1c0(%rbp)
leaq -0x248(%rbp), %rdi
callq 0x10990
jmp 0x715e
leaq -0x248(%rbp), %rdi
callq 0x10990
jmp 0x73a1
jmp 0x7105
leaq -0x1a0(%rbp), %rax
movq %rax, -0x350(%rbp)
movq -0x10(%rbp), %rdi
movq -0x1c0(%rbp), %rsi
incq %rsi
movq %rsi, -0x1c0(%rbp)
movq %rsi, -0x20(%rbp)
callq 0x32e0
movq -0x350(%rbp), %rdi
movsbl (%rax), %esi
callq 0x3310
jmp 0x7142
jmp 0x7144
movq -0x10(%rbp), %rdi
movq -0x1c0(%rbp), %rsi
callq 0x32e0
movsbl (%rax), %eax
cmpl $0x40, %eax
je 0x7105
jmp 0x715e
jmp 0x7196
movq -0x10(%rbp), %rdi
movq -0x1c0(%rbp), %rsi
callq 0x32e0
movsbl (%rax), %edx
movsbl -0x11(%rbp), %esi
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl $0x1, %ecx
cmpl %esi, %edx
cmovel %ecx, %eax
cltq
addq -0x1b8(%rbp), %rax
movq %rax, -0x1b8(%rbp)
jmp 0x6ddc
movq -0x1c0(%rbp), %rax
cmpq -0x20(%rbp), %rax
jbe 0x7225
leaq -0x1a0(%rbp), %rax
movq %rax, -0x358(%rbp)
movq -0x10(%rbp), %rsi
movq -0x20(%rbp), %rcx
movq %rcx, %rdx
incq %rdx
movq -0x1c0(%rbp), %rax
notq %rcx
addq %rax, %rcx
leaq -0x288(%rbp), %rdi
callq 0x3290
jmp 0x71df
movq -0x358(%rbp), %rdi
leaq -0x288(%rbp), %rsi
callq 0x3240
jmp 0x71f4
leaq -0x288(%rbp), %rdi
callq 0x3180
jmp 0x7225
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1e8(%rbp)
movl %eax, -0x1ec(%rbp)
leaq -0x288(%rbp), %rdi
callq 0x3180
jmp 0x73a1
movsbl -0x11(%rbp), %eax
movb $0x0, -0x2d9(%rbp)
movb $0x0, -0x301(%rbp)
cmpl $0x5b, %eax
jne 0x726f
leaq -0x2d8(%rbp), %rdi
leaq -0x1b0(%rbp), %rsi
callq 0x3250
jmp 0x7251
movb $0x1, -0x2d9(%rbp)
leaq -0x2b8(%rbp), %rdi
leaq -0x2d8(%rbp), %rsi
callq 0xd0e0
jmp 0x726d
jmp 0x72a6
leaq -0x300(%rbp), %rdi
leaq -0x1b0(%rbp), %rsi
callq 0x3250
jmp 0x7284
movb $0x1, -0x301(%rbp)
xorl %eax, %eax
movl %eax, %edx
leaq -0x2b8(%rbp), %rdi
leaq -0x300(%rbp), %rsi
callq 0x65e0
jmp 0x72a4
jmp 0x72a6
movq -0x320(%rbp), %rdi
movq -0x1c0(%rbp), %rax
incq %rax
movq %rax, -0x310(%rbp)
leaq -0x2b8(%rbp), %rsi
leaq -0x310(%rbp), %rdx
callq 0x11690
jmp 0x72d3
leaq -0x2b8(%rbp), %rdi
callq 0xc5d0
testb $0x1, -0x301(%rbp)
jne 0x72ea
jmp 0x72f6
leaq -0x300(%rbp), %rdi
callq 0x3180
testb $0x1, -0x2d9(%rbp)
jne 0x7301
jmp 0x730d
leaq -0x2d8(%rbp), %rdi
callq 0x3180
leaq -0x1b0(%rbp), %rdi
callq 0x31f0
movq -0x318(%rbp), %rax
addq $0x360, %rsp            # imm = 0x360
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1e8(%rbp)
movl %eax, -0x1ec(%rbp)
jmp 0x7388
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1e8(%rbp)
movl %eax, -0x1ec(%rbp)
jmp 0x736f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1e8(%rbp)
movl %eax, -0x1ec(%rbp)
leaq -0x2b8(%rbp), %rdi
callq 0xc5d0
testb $0x1, -0x301(%rbp)
jne 0x737a
jmp 0x7386
leaq -0x300(%rbp), %rdi
callq 0x3180
jmp 0x7388
testb $0x1, -0x2d9(%rbp)
jne 0x7393
jmp 0x739f
leaq -0x2d8(%rbp), %rdi
callq 0x3180
jmp 0x73a1
leaq -0x1b0(%rbp), %rdi
callq 0x31f0
movq -0x1e8(%rbp), %rdi
callq 0x3400
nopl (%rax)