// File: snuke[P]a/src/interpreter.cc
// Function: Interpreter::Operate(__gnu_cxx::__normal_iterator<char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>&)
Interpreter::Data Interpreter::Operate(State& cur) {
  char sign = *cur; ++cur;
  Data x = Expr(cur);
  if (sign == '!') return NewInt(!x.Int());
  if (sign == '~') {
    if (x.type == INT) return NewInt(~x.Int());
    else if (x.type == STR) sort(x.Str().begin(), x.Str().end());
    else sort(x.Array().begin(), x.Array().end());
    return x;
  }
  if (sign == '-') {
    if (x.type == INT) return NewInt(-x.Int());
    else if (x.type == FLOAT)  return NewFloat(-x.Float());
    else if (x.type == STR) reverse(x.Str().begin(), x.Str().end());
    else reverse(x.Array().begin(), x.Array().end());
    return x;
  }
  Data y = Expr(cur);
  if (sign == '+') {
    if (x.type == INT) {
      if (y.type == INT) return NewInt(x.Int() + y.Int());
      else return NewInt(x.Int() + y.Float());
    } else if (x.type == FLOAT) {
      if (y.type == INT) return NewFloat(x.Float() + y.Int());
      else return NewFloat(x.Float() + y.Float());
    } else if (x.type == STR) x.Str() += y.Str();
    else x.Array().insert(x.Array().end(), y.Array().begin(), y.Array().end());
    return x;
  }
  if (sign == '*') {
    if (x.type == INT) {
      if (y.type == INT) return NewInt(x.Int() * y.Int());
      else return NewInt(x.Int() * y.Float());
    } else {
      if (y.type == INT) return NewFloat(x.Float() * y.Int());
      else return NewFloat(x.Float() * y.Float());
    }
  }
  if (sign == '/') {
    if (x.type == INT) {
      if (y.type == INT) return NewInt(x.Int() / y.Int());
      else return NewInt(x.Int() / y.Float());
    } else {
      if (y.type == INT) return NewFloat(x.Float() / y.Int());
      else return NewFloat(x.Float() / y.Float());
    }
  }
  if (sign == '%') return NewInt(x.Int() % y.Int());
  if (sign == '&') return NewInt(x.Int() & y.Int());
  if (sign == '|') return NewInt(x.Int() | y.Int());
  if (sign == '^') return NewInt(x.Int() ^ y.Int());
  if (sign == '{') return NewInt(x.Int() << y.Int());
  if (sign == '}') return NewInt(x.Int() >> y.Int());
  if (sign == '<') return NewInt(x < y);
  if (sign == '>') return NewInt(y < x);
  if (sign == '=') return NewInt(x == y);
  if (sign == '#') return NewInt(!(x == y));
  return x;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x140, %rsp            # imm = 0x140
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0xa0(%rbp)
movq -0x18(%rbp), %rdi
callq 0x66b0
movb (%rax), %al
movb %al, -0x19(%rbp)
movq -0x18(%rbp), %rdi
callq 0x7090
movq -0xa0(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x4360
movq %rax, -0x24(%rbp)
movsbl -0x19(%rbp), %eax
cmpl $0x21, %eax
jne 0x5770
leaq -0x24(%rbp), %rdi
callq 0x6430
movq -0xa0(%rbp), %rdi
cmpq $0x0, (%rax)
setne %al
xorb $-0x1, %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, %esi
callq 0x4440
movq %rax, -0x8(%rbp)
jmp 0x5ffe
movsbl -0x19(%rbp), %eax
cmpl $0x7e, %eax
jne 0x582d
cmpl $0x2, -0x24(%rbp)
jne 0x57a8
leaq -0x24(%rbp), %rdi
callq 0x6430
movq -0xa0(%rbp), %rdi
movq (%rax), %rsi
xorq $-0x1, %rsi
callq 0x4440
movq %rax, -0x8(%rbp)
jmp 0x5ffe
cmpl $0x4, -0x24(%rbp)
jne 0x57e7
leaq -0x24(%rbp), %rdi
callq 0x6570
movq %rax, %rdi
callq 0x31d0
movq %rax, -0x30(%rbp)
leaq -0x24(%rbp), %rdi
callq 0x6570
movq %rax, %rdi
callq 0x3120
movq %rax, -0x38(%rbp)
movq -0x30(%rbp), %rdi
movq -0x38(%rbp), %rsi
callq 0x71a0
jmp 0x581e
leaq -0x24(%rbp), %rdi
callq 0x6500
movq %rax, %rdi
callq 0x7220
movq %rax, -0x40(%rbp)
leaq -0x24(%rbp), %rdi
callq 0x6500
movq %rax, %rdi
callq 0x7250
movq %rax, -0x48(%rbp)
movq -0x40(%rbp), %rdi
movq -0x48(%rbp), %rsi
callq 0x71e0
jmp 0x5820
movq -0x24(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x5ffe
movsbl -0x19(%rbp), %eax
cmpl $0x2d, %eax
jne 0x592b
cmpl $0x2, -0x24(%rbp)
jne 0x5865
leaq -0x24(%rbp), %rdi
callq 0x6430
movq -0xa0(%rbp), %rdi
xorl %ecx, %ecx
movl %ecx, %esi
subq (%rax), %rsi
callq 0x4440
movq %rax, -0x8(%rbp)
jmp 0x5ffe
cmpl $0x3, -0x24(%rbp)
jne 0x58a4
leaq -0x24(%rbp), %rdi
callq 0x6460
movq -0xa0(%rbp), %rdi
movsd (%rax), %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
callq 0x4490
movq %rax, -0x8(%rbp)
jmp 0x5ffe
cmpl $0x4, -0x24(%rbp)
jne 0x58e3
leaq -0x24(%rbp), %rdi
callq 0x6570
movq %rax, %rdi
callq 0x31d0
movq %rax, -0x50(%rbp)
leaq -0x24(%rbp), %rdi
callq 0x6570
movq %rax, %rdi
callq 0x3120
movq %rax, -0x58(%rbp)
movq -0x50(%rbp), %rdi
movq -0x58(%rbp), %rsi
callq 0x7280
jmp 0x591a
leaq -0x24(%rbp), %rdi
callq 0x6500
movq %rax, %rdi
callq 0x7220
movq %rax, -0x60(%rbp)
leaq -0x24(%rbp), %rdi
callq 0x6500
movq %rax, %rdi
callq 0x7250
movq %rax, -0x68(%rbp)
movq -0x60(%rbp), %rdi
movq -0x68(%rbp), %rsi
callq 0x72c0
jmp 0x591c
jmp 0x591e
movq -0x24(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x5ffe
movq -0xa0(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x4360
movq %rax, -0x70(%rbp)
movsbl -0x19(%rbp), %eax
cmpl $0x2b, %eax
jne 0x5b3a
cmpl $0x2, -0x24(%rbp)
jne 0x59dc
cmpl $0x2, -0x70(%rbp)
jne 0x5997
leaq -0x24(%rbp), %rdi
callq 0x6430
movq (%rax), %rax
movq %rax, -0xa8(%rbp)
leaq -0x70(%rbp), %rdi
callq 0x6430
movq -0xa8(%rbp), %rsi
movq -0xa0(%rbp), %rdi
addq (%rax), %rsi
callq 0x4440
movq %rax, -0x8(%rbp)
jmp 0x5ffe
leaq -0x24(%rbp), %rdi
callq 0x6430
cvtsi2sdq (%rax), %xmm0
movsd %xmm0, -0xb0(%rbp)
leaq -0x70(%rbp), %rdi
callq 0x6460
movsd -0xb0(%rbp), %xmm0
movq -0xa0(%rbp), %rdi
addsd (%rax), %xmm0
cvttsd2si %xmm0, %rsi
callq 0x4440
movq %rax, -0x8(%rbp)
jmp 0x5ffe
cmpl $0x3, -0x24(%rbp)
jne 0x5a6f
cmpl $0x2, -0x70(%rbp)
jne 0x5a30
leaq -0x24(%rbp), %rdi
callq 0x6460
movsd (%rax), %xmm0
movsd %xmm0, -0xb8(%rbp)
leaq -0x70(%rbp), %rdi
callq 0x6430
movsd -0xb8(%rbp), %xmm0
movq -0xa0(%rbp), %rdi
cvtsi2sdq (%rax), %xmm1
addsd %xmm1, %xmm0
callq 0x4490
movq %rax, -0x8(%rbp)
jmp 0x5ffe
leaq -0x24(%rbp), %rdi
callq 0x6460
movsd (%rax), %xmm0
movsd %xmm0, -0xc0(%rbp)
leaq -0x70(%rbp), %rdi
callq 0x6460
movsd -0xc0(%rbp), %xmm0
movq -0xa0(%rbp), %rdi
addsd (%rax), %xmm0
callq 0x4490
movq %rax, -0x8(%rbp)
jmp 0x5ffe
cmpl $0x4, -0x24(%rbp)
jne 0x5aa2
leaq -0x70(%rbp), %rdi
callq 0x6570
movq %rax, -0xc8(%rbp)
leaq -0x24(%rbp), %rdi
callq 0x6570
movq -0xc8(%rbp), %rsi
movq %rax, %rdi
callq 0x3320
jmp 0x5b29
leaq -0x24(%rbp), %rdi
callq 0x6500
movq %rax, -0xd0(%rbp)
leaq -0x24(%rbp), %rdi
callq 0x6500
movq %rax, %rdi
callq 0x7250
movq %rax, -0x80(%rbp)
leaq -0x78(%rbp), %rdi
leaq -0x80(%rbp), %rsi
callq 0x73b0
leaq -0x70(%rbp), %rdi
callq 0x6500
movq %rax, %rdi
callq 0x7220
movq %rax, -0x88(%rbp)
leaq -0x70(%rbp), %rdi
callq 0x6500
movq %rax, %rdi
callq 0x7250
movq -0xd0(%rbp), %rdi
movq %rax, -0x90(%rbp)
movq -0x78(%rbp), %rsi
movq -0x88(%rbp), %rdx
movq -0x90(%rbp), %rcx
callq 0x7300
movq %rax, -0x98(%rbp)
jmp 0x5b2b
jmp 0x5b2d
movq -0x24(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x5ffe
movsbl -0x19(%rbp), %eax
cmpl $0x2a, %eax
jne 0x5c61
cmpl $0x2, -0x24(%rbp)
jne 0x5bd8
cmpl $0x2, -0x70(%rbp)
jne 0x5b93
leaq -0x24(%rbp), %rdi
callq 0x6430
movq (%rax), %rax
movq %rax, -0xd8(%rbp)
leaq -0x70(%rbp), %rdi
callq 0x6430
movq -0xd8(%rbp), %rsi
movq -0xa0(%rbp), %rdi
imulq (%rax), %rsi
callq 0x4440
movq %rax, -0x8(%rbp)
jmp 0x5ffe
leaq -0x24(%rbp), %rdi
callq 0x6430
cvtsi2sdq (%rax), %xmm0
movsd %xmm0, -0xe0(%rbp)
leaq -0x70(%rbp), %rdi
callq 0x6460
movsd -0xe0(%rbp), %xmm0
movq -0xa0(%rbp), %rdi
mulsd (%rax), %xmm0
cvttsd2si %xmm0, %rsi
callq 0x4440
movq %rax, -0x8(%rbp)
jmp 0x5ffe
cmpl $0x2, -0x70(%rbp)
jne 0x5c22
leaq -0x24(%rbp), %rdi
callq 0x6460
movsd (%rax), %xmm0
movsd %xmm0, -0xe8(%rbp)
leaq -0x70(%rbp), %rdi
callq 0x6430
movsd -0xe8(%rbp), %xmm0
movq -0xa0(%rbp), %rdi
cvtsi2sdq (%rax), %xmm1
mulsd %xmm1, %xmm0
callq 0x4490
movq %rax, -0x8(%rbp)
jmp 0x5ffe
leaq -0x24(%rbp), %rdi
callq 0x6460
movsd (%rax), %xmm0
movsd %xmm0, -0xf0(%rbp)
leaq -0x70(%rbp), %rdi
callq 0x6460
movsd -0xf0(%rbp), %xmm0
movq -0xa0(%rbp), %rdi
mulsd (%rax), %xmm0
callq 0x4490
movq %rax, -0x8(%rbp)
jmp 0x5ffe
movsbl -0x19(%rbp), %eax
cmpl $0x2f, %eax
jne 0x5d8f
cmpl $0x2, -0x24(%rbp)
jne 0x5d06
cmpl $0x2, -0x70(%rbp)
jne 0x5cc1
leaq -0x24(%rbp), %rdi
callq 0x6430
movq (%rax), %rax
movq %rax, -0xf8(%rbp)
leaq -0x70(%rbp), %rdi
callq 0x6430
movq -0xa0(%rbp), %rdi
movq %rax, %rcx
movq -0xf8(%rbp), %rax
cqto
idivq (%rcx)
movq %rax, %rsi
callq 0x4440
movq %rax, -0x8(%rbp)
jmp 0x5ffe
leaq -0x24(%rbp), %rdi
callq 0x6430
cvtsi2sdq (%rax), %xmm0
movsd %xmm0, -0x100(%rbp)
leaq -0x70(%rbp), %rdi
callq 0x6460
movsd -0x100(%rbp), %xmm0
movq -0xa0(%rbp), %rdi
divsd (%rax), %xmm0
cvttsd2si %xmm0, %rsi
callq 0x4440
movq %rax, -0x8(%rbp)
jmp 0x5ffe
cmpl $0x2, -0x70(%rbp)
jne 0x5d50
leaq -0x24(%rbp), %rdi
callq 0x6460
movsd (%rax), %xmm0
movsd %xmm0, -0x108(%rbp)
leaq -0x70(%rbp), %rdi
callq 0x6430
movsd -0x108(%rbp), %xmm0
movq -0xa0(%rbp), %rdi
cvtsi2sdq (%rax), %xmm1
divsd %xmm1, %xmm0
callq 0x4490
movq %rax, -0x8(%rbp)
jmp 0x5ffe
leaq -0x24(%rbp), %rdi
callq 0x6460
movsd (%rax), %xmm0
movsd %xmm0, -0x110(%rbp)
leaq -0x70(%rbp), %rdi
callq 0x6460
movsd -0x110(%rbp), %xmm0
movq -0xa0(%rbp), %rdi
divsd (%rax), %xmm0
callq 0x4490
movq %rax, -0x8(%rbp)
jmp 0x5ffe
movsbl -0x19(%rbp), %eax
cmpl $0x25, %eax
jne 0x5ddb
leaq -0x24(%rbp), %rdi
callq 0x6430
movq (%rax), %rax
movq %rax, -0x118(%rbp)
leaq -0x70(%rbp), %rdi
callq 0x6430
movq -0xa0(%rbp), %rdi
movq %rax, %rcx
movq -0x118(%rbp), %rax
cqto
idivq (%rcx)
movq %rdx, %rsi
callq 0x4440
movq %rax, -0x8(%rbp)
jmp 0x5ffe
movsbl -0x19(%rbp), %eax
cmpl $0x26, %eax
jne 0x5e1f
leaq -0x24(%rbp), %rdi
callq 0x6430
movq (%rax), %rax
movq %rax, -0x120(%rbp)
leaq -0x70(%rbp), %rdi
callq 0x6430
movq -0x120(%rbp), %rsi
movq -0xa0(%rbp), %rdi
andq (%rax), %rsi
callq 0x4440
movq %rax, -0x8(%rbp)
jmp 0x5ffe
movsbl -0x19(%rbp), %eax
cmpl $0x7c, %eax
jne 0x5e63
leaq -0x24(%rbp), %rdi
callq 0x6430
movq (%rax), %rax
movq %rax, -0x128(%rbp)
leaq -0x70(%rbp), %rdi
callq 0x6430
movq -0x128(%rbp), %rsi
movq -0xa0(%rbp), %rdi
orq (%rax), %rsi
callq 0x4440
movq %rax, -0x8(%rbp)
jmp 0x5ffe
movsbl -0x19(%rbp), %eax
cmpl $0x5e, %eax
jne 0x5ea7
leaq -0x24(%rbp), %rdi
callq 0x6430
movq (%rax), %rax
movq %rax, -0x130(%rbp)
leaq -0x70(%rbp), %rdi
callq 0x6430
movq -0x130(%rbp), %rsi
movq -0xa0(%rbp), %rdi
xorq (%rax), %rsi
callq 0x4440
movq %rax, -0x8(%rbp)
jmp 0x5ffe
movsbl -0x19(%rbp), %eax
cmpl $0x7b, %eax
jne 0x5eee
leaq -0x24(%rbp), %rdi
callq 0x6430
movq (%rax), %rax
movq %rax, -0x138(%rbp)
leaq -0x70(%rbp), %rdi
callq 0x6430
movq -0x138(%rbp), %rsi
movq -0xa0(%rbp), %rdi
movq (%rax), %rcx
shlq %cl, %rsi
callq 0x4440
movq %rax, -0x8(%rbp)
jmp 0x5ffe
movsbl -0x19(%rbp), %eax
cmpl $0x7d, %eax
jne 0x5f35
leaq -0x24(%rbp), %rdi
callq 0x6430
movq (%rax), %rax
movq %rax, -0x140(%rbp)
leaq -0x70(%rbp), %rdi
callq 0x6430
movq -0x140(%rbp), %rsi
movq -0xa0(%rbp), %rdi
movq (%rax), %rcx
sarq %cl, %rsi
callq 0x4440
movq %rax, -0x8(%rbp)
jmp 0x5ffe
movsbl -0x19(%rbp), %eax
cmpl $0x3c, %eax
jne 0x5f67
leaq -0x24(%rbp), %rdi
leaq -0x70(%rbp), %rsi
callq 0x3d80
movq -0xa0(%rbp), %rdi
andb $0x1, %al
movzbl %al, %eax
movl %eax, %esi
callq 0x4440
movq %rax, -0x8(%rbp)
jmp 0x5ffe
movsbl -0x19(%rbp), %eax
cmpl $0x3e, %eax
jne 0x5f96
leaq -0x70(%rbp), %rdi
leaq -0x24(%rbp), %rsi
callq 0x3d80
movq -0xa0(%rbp), %rdi
andb $0x1, %al
movzbl %al, %eax
movl %eax, %esi
callq 0x4440
movq %rax, -0x8(%rbp)
jmp 0x5ffe
movsbl -0x19(%rbp), %eax
cmpl $0x3d, %eax
jne 0x5fc5
leaq -0x24(%rbp), %rdi
leaq -0x70(%rbp), %rsi
callq 0x3f30
movq -0xa0(%rbp), %rdi
andb $0x1, %al
movzbl %al, %eax
movl %eax, %esi
callq 0x4440
movq %rax, -0x8(%rbp)
jmp 0x5ffe
movsbl -0x19(%rbp), %eax
cmpl $0x23, %eax
jne 0x5ff6
leaq -0x24(%rbp), %rdi
leaq -0x70(%rbp), %rsi
callq 0x3f30
movq -0xa0(%rbp), %rdi
xorb $-0x1, %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, %esi
callq 0x4440
movq %rax, -0x8(%rbp)
jmp 0x5ffe
movq -0x24(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x140, %rsp            # imm = 0x140
popq %rbp
retq
nopl (%rax,%rax)