// File: /workspace/github_cpp_makefile_star2_O1/rfotino[P]consolite-compiler/src/syntax.cpp
// Function: ExprToken::_evaluate()
void ExprToken::_evaluate() {
  // Evaluate the postfix expression
  std::stack<std::shared_ptr<Token>> operands;
  for (auto token : _postfix) {
    auto op = std::dynamic_pointer_cast<OperatorToken>(token);
    if (std::dynamic_pointer_cast<LiteralToken>(token) ||
        std::dynamic_pointer_cast<GlobalVarToken>(token)) {
      operands.push(token);
    } else if (std::dynamic_pointer_cast<ParamToken>(token) ||
               std::dynamic_pointer_cast<LocalVarToken>(token) ||
               std::dynamic_pointer_cast<FunctionCallToken>(token)) {
      // We don't know parameter or local variable values at
      // compile time, nor do we know the output of functions,
      // so this expression can't be constant.
      _const = false;
      return;
    } else if (nullptr != op) {
      std::shared_ptr<Token> rhs = operands.top();
      operands.pop();
      std::shared_ptr<Token> lhs;
      if (op->isBinary()) {
        lhs = operands.top();
        operands.pop();
      } else {
        lhs = nullptr;
      }
      uint16_t result;
      // If using assignment, dereferencing, or address-of, this
      // expression is not considered constant.
      if (("=" == op->str() && op->isBinary()) ||
          (("&" == op->str() || "*" == op->str()) && op->isUnary())) {
        _const = false;
        return;
      } else if ("[" == op->str() && op->isBinary()) {
        auto global = std::dynamic_pointer_cast<GlobalVarToken>(lhs);
        if (nullptr == global) {
          _const = false;
          return;
        }
        if (!global->isArray()) {
          _const = false;
          return;
        } else if (global->arraySize() <= rhs->val()) {
          _warn("Array index out of bounds in expression.", _lineNum);
          _const = false;
          return;
        }
        result = global->arrayVal(rhs->val());
      } else {
        result = op->operate(lhs ? lhs->val() : 0, rhs->val());
      }
      operands.push(std::shared_ptr<Token>(new LiteralToken(result)));
    } else {
      _const = false;
      return;
    }
  }
  _value = operands.top()->val();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x128, %rsp            # imm = 0x128
movq %rdi, %rbx
xorps %xmm0, %xmm0
leaq 0xb0(%rsp), %rdi
movaps %xmm0, 0x40(%rdi)
movaps %xmm0, 0x30(%rdi)
movaps %xmm0, 0x20(%rdi)
movaps %xmm0, 0x10(%rdi)
movaps %xmm0, (%rdi)
xorl %esi, %esi
callq 0x2fe60
movq 0x10(%rbx), %r15
movq %rbx, 0x10(%rsp)
movq 0x18(%rbx), %rax
movq %rax, 0xa8(%rsp)
cmpq %rax, %r15
je 0x154b9
movq (%r15), %rax
movq %rax, 0x18(%rsp)
movq 0x8(%r15), %rax
movq %rax, 0x20(%rsp)
testq %rax, %rax
je 0x14cd8
movq 0x332ce(%rip), %rcx     # 0x47f98
cmpb $0x0, (%rcx)
je 0x14cd4
incl 0x8(%rax)
jmp 0x14cd8
lock
incl 0x8(%rax)
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x14cfc
leaq 0x31fff(%rip), %rsi     # 0x46ce8
leaq 0x32700(%rip), %rdx     # 0x473f0
xorl %ecx, %ecx
callq 0x7330
movq %rax, %r14
jmp 0x14cff
xorl %r14d, %r14d
testq %r14, %r14
je 0x14d1f
movq 0x20(%rsp), %rbx
testq %rbx, %rbx
je 0x14d2a
movq 0x33283(%rip), %rax     # 0x47f98
cmpb $0x0, (%rax)
je 0x14d26
incl 0x8(%rbx)
jmp 0x14d2a
xorl %ebx, %ebx
xorl %r14d, %r14d
jmp 0x14d2a
lock
incl 0x8(%rbx)
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x14d52
leaq 0x31fad(%rip), %rsi     # 0x46ce8
leaq 0x3267e(%rip), %rdx     # 0x473c0
xorl %ecx, %ecx
callq 0x7330
testq %rax, %rax
setne %r12b
jmp 0x14d55
xorl %r12d, %r12d
testb %r12b, %r12b
je 0x14d79
movq 0x20(%rsp), %rbp
testq %rbp, %rbp
je 0x14d7b
movq 0x3322d(%rip), %rax     # 0x47f98
cmpb $0x0, (%rax)
je 0x14eac
incl 0x8(%rbp)
jmp 0x14d7b
xorl %ebp, %ebp
movb $0x1, %r13b
testb %r12b, %r12b
jne 0x14de5
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x14dab
leaq 0x31f54(%rip), %rsi     # 0x46ce8
leaq 0x320ad(%rip), %rdx     # 0x46e48
xorl %ecx, %ecx
callq 0x7330
testq %rax, %rax
setne %r13b
jmp 0x14dae
xorl %r13d, %r13d
testb %r13b, %r13b
je 0x14ddc
movq 0x20(%rsp), %rcx
movq %rcx, 0x58(%rsp)
testq %rcx, %rcx
je 0x14de5
movq 0x331cf(%rip), %rax     # 0x47f98
cmpb $0x0, (%rax)
je 0x14eeb
movq 0x58(%rsp), %rax
incl 0x8(%rax)
jmp 0x14de5
movq $0x0, 0x58(%rsp)
cmpq $0x0, 0x58(%rsp)
sete %al
orb %al, %r12b
jne 0x14dfd
movq 0x58(%rsp), %rdi
callq 0x81ea
testq %rbp, %rbp
je 0x14e0a
movq %rbp, %rdi
callq 0x81ea
testb %r13b, %r13b
je 0x14e29
movb $0x1, %bpl
leaq 0xb0(%rsp), %rdi
leaq 0x18(%rsp), %rsi
callq 0x30b42
jmp 0x15350
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x14e51
leaq 0x31eae(%rip), %rsi     # 0x46ce8
leaq 0x31f57(%rip), %rdx     # 0x46d98
xorl %ecx, %ecx
callq 0x7330
testq %rax, %rax
setne %r12b
jmp 0x14e54
xorl %r12d, %r12d
testb %r12b, %r12b
je 0x14e78
movq 0x20(%rsp), %rbp
testq %rbp, %rbp
je 0x14e7a
movq 0x3312e(%rip), %rax     # 0x47f98
cmpb $0x0, (%rax)
je 0x14ef9
incl 0x8(%rbp)
jmp 0x14e7a
xorl %ebp, %ebp
movb $0x1, %al
testb %r12b, %r12b
jne 0x14f39
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x14eb5
leaq 0x31e52(%rip), %rsi     # 0x46ce8
leaq 0x32433(%rip), %rdx     # 0x472d0
xorl %ecx, %ecx
callq 0x7330
testq %rax, %rax
sete %cl
jmp 0x14eb7
lock
incl 0x8(%rbp)
jmp 0x14d7b
movb $0x1, %cl
testb %cl, %cl
je 0x14ec6
movq $0x0, 0x50(%rsp)
jmp 0x14f0b
movq 0x20(%rsp), %rdx
movq %rdx, 0x50(%rsp)
testq %rdx, %rdx
je 0x14f0b
movq 0x330bc(%rip), %rax     # 0x47f98
cmpb $0x0, (%rax)
je 0x14f02
movq 0x50(%rsp), %rax
incl 0x8(%rax)
jmp 0x14f0b
movq 0x58(%rsp), %rax
lock
incl 0x8(%rax)
jmp 0x14de5
lock
incl 0x8(%rbp)
jmp 0x14e7a
movq 0x50(%rsp), %rax
lock
incl 0x8(%rax)
movb $0x1, %al
testb %cl, %cl
je 0x14f39
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x14f3e
leaq 0x31dc6(%rip), %rsi     # 0x46ce8
leaq 0x324f7(%rip), %rdx     # 0x47420
xorl %ecx, %ecx
callq 0x7330
testq %rax, %rax
setne %r13b
jmp 0x14f41
movb $0x1, %r13b
jmp 0x14f7a
xorl %r13d, %r13d
testb %r13b, %r13b
je 0x14f6f
movq 0x20(%rsp), %rcx
movq %rcx, 0x48(%rsp)
testq %rcx, %rcx
je 0x14f78
movq 0x3303c(%rip), %rax     # 0x47f98
cmpb $0x0, (%rax)
je 0x1538c
movq 0x48(%rsp), %rax
incl 0x8(%rax)
jmp 0x14f78
movq $0x0, 0x48(%rsp)
xorl %eax, %eax
cmpq $0x0, 0x48(%rsp)
sete %cl
orb %al, %cl
jne 0x14f91
movq 0x48(%rsp), %rdi
callq 0x81ea
cmpq $0x0, 0x50(%rsp)
sete %al
orb %al, %r12b
jne 0x14fa9
movq 0x50(%rsp), %rdi
callq 0x81ea
testq %rbp, %rbp
je 0x14fb6
movq %rbp, %rdi
callq 0x81ea
testb %r13b, %r13b
jne 0x1501e
testq %r14, %r14
leaq 0x28(%rsp), %r12
je 0x1501e
movq 0xe0(%rsp), %rax
cmpq 0xe8(%rsp), %rax
jne 0x14feb
movq 0xf8(%rsp), %rax
movq -0x8(%rax), %rax
movl $0x200, %ecx            # imm = 0x200
addq %rcx, %rax
movq -0x10(%rax), %rcx
movq %rcx, 0x78(%rsp)
movq -0x8(%rax), %rcx
testq %rcx, %rcx
leaq 0x88(%rsp), %r13
leaq 0x108(%rsp), %rbp
je 0x15032
movq 0x32f84(%rip), %rax     # 0x47f98
cmpb $0x0, (%rax)
je 0x1502e
incl 0x8(%rcx)
jmp 0x15032
movq 0x10(%rsp), %rax
movb $0x0, 0xc(%rax)
xorl %ebp, %ebp
jmp 0x15350
lock
incl 0x8(%rcx)
movq %rcx, 0x80(%rsp)
leaq 0xb0(%rsp), %rdi
callq 0x307f0
xorps %xmm0, %xmm0
movaps %xmm0, 0x60(%rsp)
cmpb $0x1, 0x30(%r14)
jne 0x150a2
movq 0xe0(%rsp), %rsi
cmpq 0xe8(%rsp), %rsi
jne 0x1507c
movq 0xf8(%rsp), %rax
movq -0x8(%rax), %rsi
movl $0x200, %eax            # imm = 0x200
addq %rax, %rsi
movq -0x10(%rsi), %rax
movq %rax, 0x60(%rsp)
addq $-0x8, %rsi
leaq 0x68(%rsp), %rdi
callq 0x226e2
leaq 0xb0(%rsp), %rdi
callq 0x307f0
jmp 0x150b6
movq 0x68(%rsp), %rdi
movaps %xmm0, 0x60(%rsp)
testq %rdi, %rdi
je 0x150b6
callq 0x81ea
leaq 0x38(%rsp), %rax
movq %rax, 0x28(%rsp)
movq 0x10(%r14), %rsi
movq 0x18(%r14), %rdx
addq %rsi, %rdx
movq %r12, %rdi
callq 0xc014
movq %r12, %rdi
leaq 0x21515(%rip), %rsi     # 0x365f2
callq 0x70c0
testl %eax, %eax
jne 0x150fb
cmpb $0x0, 0x30(%r14)
je 0x150fb
movb $0x1, %bpl
xorl %r13d, %r13d
xorl %r12d, %r12d
jmp 0x15180
leaq 0x98(%rsp), %rax
movq %rax, 0x88(%rsp)
movq 0x10(%r14), %rsi
movq 0x18(%r14), %rdx
addq %rsi, %rdx
movq %r13, %rdi
callq 0xc014
movq %r13, %rdi
leaq 0x214be(%rip), %rsi     # 0x365e6
callq 0x70c0
testl %eax, %eax
setne %r12b
je 0x15175
leaq 0x118(%rsp), %rax
movq %rax, 0x108(%rsp)
movq 0x10(%r14), %rsi
movq 0x18(%r14), %rdx
addq %rsi, %rdx
movq %rbp, %rdi
callq 0xc014
movq %rbp, %rdi
leaq 0x21474(%rip), %rsi     # 0x365d6
callq 0x70c0
testl %eax, %eax
je 0x15175
movb $0x1, %r13b
xorl %ebp, %ebp
movb $0x1, %r12b
jmp 0x15180
movb 0x30(%r14), %bpl
xorb $0x1, %bpl
movb $0x1, %r13b
testb %r12b, %r12b
je 0x151aa
movq 0x108(%rsp), %rdi
leaq 0x118(%rsp), %rax
cmpq %rax, %rdi
je 0x151aa
movq 0x118(%rsp), %rsi
incq %rsi
callq 0x72c0
testb %r13b, %r13b
leaq 0x28(%rsp), %r12
je 0x151d9
movq 0x88(%rsp), %rdi
leaq 0x98(%rsp), %rax
cmpq %rax, %rdi
je 0x151d9
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x72c0
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x151f5
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x72c0
testb %bpl, %bpl
je 0x1520a
movq 0x10(%rsp), %rax
movb $0x0, 0xc(%rax)
xorl %ebp, %ebp
jmp 0x1532f
leaq 0x38(%rsp), %rax
movq %rax, 0x28(%rsp)
movq 0x10(%r14), %rsi
movq 0x18(%r14), %rdx
addq %rsi, %rdx
movq %r12, %rdi
callq 0xc014
movq %r12, %rdi
leaq 0x213c3(%rip), %rsi     # 0x365f4
callq 0x70c0
testl %eax, %eax
je 0x15258
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x152a8
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x72c0
jmp 0x152a8
movb 0x30(%r14), %bpl
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x15278
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x72c0
testb %bpl, %bpl
je 0x152a8
movq 0x60(%rsp), %rdi
testq %rdi, %rdi
je 0x1539a
leaq 0x31a56(%rip), %rsi     # 0x46ce8
leaq 0x31baf(%rip), %rdx     # 0x46e48
xorl %ecx, %ecx
callq 0x7330
movq %rax, %rbp
jmp 0x1539c
movq 0x60(%rsp), %rdi
testq %rdi, %rdi
je 0x152bb
movq (%rdi), %rax
callq *(%rax)
movl %eax, %ebp
jmp 0x152bd
xorl %ebp, %ebp
movq 0x78(%rsp), %rdi
movq (%rdi), %rax
callq *(%rax)
movzwl %bp, %esi
movzwl %ax, %edx
movq %r14, %rdi
callq 0xe72a
movl %eax, %ebp
movl $0x10, %edi
callq 0x72b0
movl $0xffffffff, 0x8(%rax)  # imm = 0xFFFFFFFF
leaq 0x320c9(%rip), %rcx     # 0x473b8
movq %rcx, (%rax)
movw %bp, 0xc(%rax)
movq %rax, 0x28(%rsp)
leaq 0x30(%rsp), %rdi
movq %rax, %rsi
callq 0x2fbf0
leaq 0xb0(%rsp), %rdi
movq %r12, %rsi
callq 0x30436
movw %bp, 0xe(%rsp)
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x1532c
callq 0x81ea
movb $0x1, %bpl
movq 0x68(%rsp), %rdi
testq %rdi, %rdi
je 0x1533e
callq 0x81ea
movq 0x80(%rsp), %rdi
testq %rdi, %rdi
je 0x15350
callq 0x81ea
testq %rbx, %rbx
je 0x1535d
movq %rbx, %rdi
callq 0x81ea
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x1536c
callq 0x81ea
testb %bpl, %bpl
je 0x154ee
addq $0x10, %r15
cmpq 0xa8(%rsp), %r15
jne 0x14cad
jmp 0x154b9
movq 0x48(%rsp), %rax
lock
incl 0x8(%rax)
jmp 0x14f78
xorl %ebp, %ebp
testq %rbp, %rbp
je 0x153bd
movq 0x68(%rsp), %r14
testq %r14, %r14
je 0x153c9
movq 0x32be6(%rip), %rax     # 0x47f98
cmpb $0x0, (%rax)
je 0x153c4
incl 0x8(%r14)
jmp 0x153c9
xorl %ebp, %ebp
xorl %r14d, %r14d
jmp 0x153c9
lock
incl 0x8(%r14)
testq %rbp, %rbp
je 0x1548e
cmpb $0x0, 0x68(%rbp)
je 0x1548e
movq 0x98(%rbp), %r13
movq 0xa0(%rbp), %r12
movq 0x78(%rsp), %rdi
movq (%rdi), %rax
callq *(%rax)
subl %r13d, %r12d
shrl %r12d
cmpw %r12w, %ax
jae 0x1543d
movq 0x78(%rsp), %rdi
movq (%rdi), %rax
callq *(%rax)
movzwl %ax, %esi
movq 0x98(%rbp), %rax
movq 0xa0(%rbp), %rdx
subq %rax, %rdx
sarq %rdx
cmpq %rsi, %rdx
jbe 0x1550d
movzwl (%rax,%rsi,2), %eax
movw %ax, 0xe(%rsp)
movb $0x1, %bpl
leaq 0x28(%rsp), %r12
jmp 0x15499
leaq 0x38(%rsp), %rax
movq %rax, 0x28(%rsp)
leaq 0x28(%rsp), %r12
movq %r12, %rdi
leaq 0x21532(%rip), %rsi     # 0x36988
leaq 0x21553(%rip), %rdx     # 0x369b0
callq 0xc0a4
movq 0x10(%rsp), %rax
movl 0x8(%rax), %esi
movq %r12, %rdi
callq 0x348b0
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x1548e
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x72c0
movq 0x10(%rsp), %rax
movb $0x0, 0xc(%rax)
xorl %ebp, %ebp
testq %r14, %r14
je 0x154a6
movq %r14, %rdi
callq 0x81ea
testb %bpl, %bpl
je 0x15203
movzwl 0xe(%rsp), %ebp
jmp 0x152d7
movq 0xe0(%rsp), %rax
cmpq 0xe8(%rsp), %rax
jne 0x154dc
movq 0xf8(%rsp), %rcx
movl $0x200, %eax            # imm = 0x200
addq -0x8(%rcx), %rax
movq -0x10(%rax), %rdi
movq (%rdi), %rax
callq *(%rax)
movq 0x10(%rsp), %rcx
movw %ax, 0xe(%rcx)
leaq 0xb0(%rsp), %rdi
callq 0x22550
addq $0x128, %rsp            # imm = 0x128
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x21b2b(%rip), %rdi     # 0x3703f
xorl %eax, %eax
callq 0x7430
jmp 0x15540
movq %rax, %r15
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x15543
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x72c0
jmp 0x15543
jmp 0x15540
movq %rax, %r15
testq %r14, %r14
je 0x155bd
movq %r14, %rdi
jmp 0x15562
movq %rax, %r15
jmp 0x15605
movq %rax, %r15
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x155bd
callq 0x81ea
jmp 0x155bd
jmp 0x155ba
movq %rax, %r15
movq 0x88(%rsp), %rdi
leaq 0x98(%rsp), %rax
cmpq %rax, %rdi
je 0x15598
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x72c0
jmp 0x15598
movq %rax, %r15
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x155bd
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x72c0
jmp 0x155bd
jmp 0x155ba
jmp 0x155ba
movq %rax, %r15
movq 0x68(%rsp), %rdi
testq %rdi, %rdi
je 0x155cc
callq 0x81ea
cmpq $0x0, 0x80(%rsp)
je 0x155e9
movq 0x80(%rsp), %rdi
callq 0x81ea
jmp 0x155e9
movq %rax, %r15
testq %rbx, %rbx
je 0x155f6
movq %rbx, %rdi
callq 0x81ea
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x15605
callq 0x81ea
leaq 0xb0(%rsp), %rdi
callq 0x22550
movq %r15, %rdi
callq 0x74f0