// File: /workspace/github_cpp_makefile_star2_O3/rfotino[P]consolite-compiler/src/syntax.cpp
// Function: ExprToken::_validate()
bool ExprToken::_validate() {
  std::stack<std::string> operands;
  for (auto token : _postfix) {
    auto op = std::dynamic_pointer_cast<OperatorToken>(token);
    if (std::dynamic_pointer_cast<LiteralToken>(token) ||
        std::dynamic_pointer_cast<FunctionCallToken>(token)) {
      operands.push("rvalue");
    } else if (std::dynamic_pointer_cast<GlobalVarToken>(token) ||
               std::dynamic_pointer_cast<ParamToken>(token) ||
               std::dynamic_pointer_cast<LocalVarToken>(token)) {
      operands.push("lvalue");
    } else if (nullptr != op) {
      std::string rhs = operands.top();
      operands.pop();
      std::string lhs;
      if (op->isBinary()) {
        lhs = operands.top();
        operands.pop();
      }
      std::string result;
      if ("=" == op->str()) {
        if ("rvalue" == lhs) {
          _error("Can't assign to an rvalue in expression.", op->line());
          return false;
        }
        result = "rvalue";
      } else if ("*" == op->str() && op->isUnary()) {
        result = "lvalue";
      } else if ("&" == op->str() && op->isUnary()) {
        if ("lvalue" != rhs) {
          _error("Can't get address of an rvalue in expression.",
                 op->line());
          return false;
        }
        result = "rvalue";
      } else if ("[" == op->str()) {
        result = "lvalue";
      } else {
        result = "rvalue";
      }
      operands.push(result);
    }
  }
  return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xe8, %rsp
movq %rdi, %rbx
xorps %xmm0, %xmm0
leaq 0x90(%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 0xb9be
movq 0x10(%rbx), %rbp
movq 0x18(%rbx), %r15
movb $0x1, %bl
cmpq %r15, %rbp
je 0x146d3
leaq 0x31c9f(%rip), %r14     # 0x45d18
movq (%rbp), %r12
movq 0x8(%rbp), %rbx
testq %rbx, %rbx
je 0x1409b
movq 0x32f0b(%rip), %rax     # 0x46f98
cmpb $0x0, (%rax)
je 0x14097
incl 0x8(%rbx)
jmp 0x1409b
lock
incl 0x8(%rbx)
testq %r12, %r12
je 0x142b3
movq %r12, %rdi
movq %r14, %rsi
leaq 0x32337(%rip), %rdx     # 0x463e8
xorl %ecx, %ecx
callq 0x7330
movq %rax, %r13
movl $0x0, %eax
testq %r13, %r13
je 0x141c9
testq %rbx, %rbx
je 0x140e6
movq 0x32ec3(%rip), %rax     # 0x46f98
cmpb $0x0, (%rax)
je 0x141c2
incl 0x8(%rbx)
jmp 0x141c6
movq %r12, %rdi
leaq 0x31c28(%rip), %rsi     # 0x45d18
leaq 0x322c1(%rip), %rdx     # 0x463b8
xorl %ecx, %ecx
callq 0x7330
movl $0x0, %ecx
movq %rcx, 0x8(%rsp)
testq %rax, %rax
jne 0x1424c
movq %r12, %rdi
leaq 0x31bfd(%rip), %rsi     # 0x45d18
leaq 0x322f6(%rip), %rdx     # 0x46418
xorl %ecx, %ecx
callq 0x7330
movl $0x0, %ecx
movq %rcx, 0x8(%rsp)
testq %rax, %rax
jne 0x1424c
movq %r12, %rdi
leaq 0x31bd2(%rip), %rsi     # 0x45d18
leaq 0x31d2b(%rip), %rdx     # 0x45e78
xorl %ecx, %ecx
callq 0x7330
movl $0x0, %ecx
movq %rcx, 0x8(%rsp)
testq %rax, %rax
jne 0x1435b
movq %r12, %rdi
leaq 0x31ba7(%rip), %rsi     # 0x45d18
leaq 0x31c50(%rip), %rdx     # 0x45dc8
xorl %ecx, %ecx
callq 0x7330
movl $0x0, %ecx
movq %rcx, 0x8(%rsp)
testq %rax, %rax
jne 0x1435b
movq %r12, %rdi
leaq 0x31b7c(%rip), %rsi     # 0x45d18
leaq 0x32125(%rip), %rdx     # 0x462c8
xorl %ecx, %ecx
callq 0x7330
movl $0x0, %ecx
movq %rcx, 0x8(%rsp)
testq %rax, %rax
jne 0x1435b
jmp 0x143a1
lock
incl 0x8(%rbx)
movq %rbx, %rax
movq %r15, %r14
movq %rax, 0x8(%rsp)
movq %r12, %rdi
leaq 0x31b3d(%rip), %r15     # 0x45d18
movq %r15, %rsi
leaq 0x321d3(%rip), %rdx     # 0x463b8
xorl %ecx, %ecx
callq 0x7330
testq %rax, %rax
je 0x1420a
testq %rbx, %rbx
je 0x14249
movq 0x32d9b(%rip), %rax     # 0x46f98
cmpb $0x0, (%rax)
movq %r14, %r15
je 0x1423b
incl 0x8(%rbx)
jmp 0x1423f
movq %r12, %rdi
movq %r15, %rsi
leaq 0x32201(%rip), %rdx     # 0x46418
xorl %ecx, %ecx
callq 0x7330
testq %rax, %rax
je 0x142d2
testq %rbx, %rbx
movq %r14, %r15
je 0x1424c
movq 0x32d62(%rip), %rax     # 0x46f98
cmpb $0x0, (%rax)
jne 0x14205
lock
incl 0x8(%rbx)
movq %rbx, %rdi
callq 0x8036
jmp 0x1424c
movq %r14, %r15
leaq 0x40(%rsp), %rax
movq %rax, 0x30(%rsp)
leaq 0x30(%rsp), %r14
movq %r14, %rdi
leaq 0x216be(%rip), %rsi     # 0x35923
leaq 0x216bd(%rip), %rdx     # 0x35929
callq 0xbdee
leaq 0x90(%rsp), %rdi
movq %r14, %rsi
callq 0x2f9b6
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
je 0x1429d
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x72c0
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
leaq 0x31a6c(%rip), %r14     # 0x45d18
je 0x142b3
callq 0x8036
testq %rbx, %rbx
je 0x142c0
movq %rbx, %rdi
callq 0x8036
addq $0x10, %rbp
cmpq %r15, %rbp
jne 0x14079
jmp 0x146d1
movq %r12, %rdi
movq %r15, %rsi
leaq 0x31b99(%rip), %rdx     # 0x45e78
xorl %ecx, %ecx
callq 0x7330
testq %rax, %rax
je 0x14304
testq %rbx, %rbx
je 0x14358
movq 0x32ca1(%rip), %rax     # 0x46f98
cmpb $0x0, (%rax)
movq %r14, %r15
je 0x1434a
incl 0x8(%rbx)
jmp 0x1434e
movq %r12, %rdi
movq %r15, %rsi
leaq 0x31ab7(%rip), %rdx     # 0x45dc8
xorl %ecx, %ecx
callq 0x7330
testq %rax, %rax
jne 0x14336
movq %r12, %rdi
movq %r15, %rsi
leaq 0x31f9e(%rip), %rdx     # 0x462c8
xorl %ecx, %ecx
callq 0x7330
testq %rax, %rax
je 0x14395
testq %rbx, %rbx
movq %r14, %r15
je 0x1435b
movq 0x32c53(%rip), %rax     # 0x46f98
cmpb $0x0, (%rax)
jne 0x142ff
lock
incl 0x8(%rbx)
movq %rbx, %rdi
callq 0x8036
jmp 0x1435b
movq %r14, %r15
leaq 0x40(%rsp), %rax
movq %rax, 0x30(%rsp)
leaq 0x30(%rsp), %r14
movq %r14, %rdi
leaq 0x215b6(%rip), %rsi     # 0x3592a
leaq 0x215b5(%rip), %rdx     # 0x35930
callq 0xbdee
leaq 0x90(%rsp), %rdi
movq %r14, %rsi
callq 0x2f9b6
jmp 0x14281
testq %r13, %r13
movq %r14, %r15
je 0x1429d
movq 0xc0(%rsp), %rax
cmpq 0xc8(%rsp), %rax
jne 0x143c7
movq 0xd8(%rsp), %rax
movq -0x8(%rax), %rax
movl $0x200, %ecx            # imm = 0x200
addq %rcx, %rax
leaq 0x40(%rsp), %rcx
movq %rcx, 0x30(%rsp)
movq -0x20(%rax), %rsi
movq -0x18(%rax), %rdx
addq %rsi, %rdx
leaq 0x30(%rsp), %rdi
callq 0xbd58
leaq 0x20(%rsp), %r12
leaq 0x10(%rsp), %r14
leaq 0x90(%rsp), %rdi
callq 0x30170
leaq 0x80(%rsp), %rax
movq %rax, 0x70(%rsp)
movq $0x0, 0x78(%rsp)
movb $0x0, 0x80(%rsp)
cmpb $0x1, 0x30(%r13)
jne 0x14463
movq 0xc0(%rsp), %rsi
cmpq 0xc8(%rsp), %rsi
jne 0x14448
movq 0xd8(%rsp), %rax
movq -0x8(%rax), %rsi
movl $0x200, %eax            # imm = 0x200
addq %rax, %rsi
addq $-0x20, %rsi
leaq 0x70(%rsp), %rdi
callq 0x71a0
leaq 0x90(%rsp), %rdi
callq 0x30170
leaq 0x60(%rsp), %rax
movq %rax, 0x50(%rsp)
movq $0x0, 0x58(%rsp)
movb $0x0, 0x60(%rsp)
movq %r12, 0x10(%rsp)
movq 0x10(%r13), %rsi
movq 0x18(%r13), %rdx
addq %rsi, %rdx
movq %r14, %rdi
callq 0xbd58
movq %r14, %rdi
leaq 0x21155(%rip), %rsi     # 0x355f2
callq 0x70c0
movq 0x10(%rsp), %rdi
cmpq %r12, %rdi
je 0x144bf
movq 0x20(%rsp), %rsi
incq %rsi
movl %eax, %r12d
callq 0x72c0
movl %r12d, %eax
testl %eax, %eax
je 0x1450c
leaq 0x20(%rsp), %r12
movq %r12, 0x10(%rsp)
movq 0x10(%r13), %rsi
movq 0x18(%r13), %rdx
addq %rsi, %rdx
movq %r14, %rdi
callq 0xbd58
movq %r14, %rdi
leaq 0x210ec(%rip), %rsi     # 0x355d6
callq 0x70c0
testl %eax, %eax
je 0x1453a
movq 0x10(%rsp), %rdi
cmpq %r12, %rdi
je 0x14566
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x72c0
jmp 0x14566
leaq 0x70(%rsp), %rdi
leaq 0x2140b(%rip), %r14     # 0x35923
movq %r14, %rsi
callq 0x70c0
testl %eax, %eax
leaq 0x20(%rsp), %r12
je 0x146f4
movq 0x58(%rsp), %rdx
movq %r14, %rcx
jmp 0x14665
movq %r12, %rax
movb 0x30(%r13), %r12b
movq 0x10(%rsp), %rdi
cmpq %rax, %rdi
je 0x14558
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x72c0
testb %r12b, %r12b
leaq 0x20(%rsp), %r12
je 0x14632
movq %r12, 0x10(%rsp)
movq 0x10(%r13), %rsi
movq 0x18(%r13), %rdx
addq %rsi, %rdx
movq %r14, %rdi
callq 0xbd58
movq %r14, %rdi
leaq 0x2105e(%rip), %rsi     # 0x355e6
callq 0x70c0
testl %eax, %eax
je 0x145aa
movq 0x10(%rsp), %rdi
cmpq %r12, %rdi
je 0x145d2
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x72c0
jmp 0x145d2
movq %r12, %rax
movb 0x30(%r13), %r12b
movq 0x10(%rsp), %rdi
cmpq %rax, %rdi
je 0x145c8
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x72c0
testb %r12b, %r12b
leaq 0x20(%rsp), %r12
je 0x14640
movq %r12, 0x10(%rsp)
movq 0x10(%r13), %rsi
movq 0x18(%r13), %rdx
addq %rsi, %rdx
movq %r14, %rdi
callq 0xbd58
movq %r12, %r13
movq %r14, %rdi
leaq 0x20ffd(%rip), %rsi     # 0x355f4
callq 0x70c0
movl %eax, %r12d
movq 0x10(%rsp), %rdi
cmpq %r13, %rdi
je 0x14616
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x72c0
testl %r12d, %r12d
movq 0x58(%rsp), %rdx
leaq 0x212fe(%rip), %rcx     # 0x35923
leaq 0x212fe(%rip), %rax     # 0x3592a
cmoveq %rax, %rcx
jmp 0x14665
movq 0x58(%rsp), %rdx
leaq 0x212ec(%rip), %rcx     # 0x3592a
jmp 0x14665
leaq 0x30(%rsp), %rdi
leaq 0x212de(%rip), %rsi     # 0x3592a
callq 0x70c0
testl %eax, %eax
jne 0x1471f
movq 0x58(%rsp), %rdx
leaq 0x212be(%rip), %rcx     # 0x35923
leaq 0x50(%rsp), %r14
movl $0x6, %r8d
movq %r14, %rdi
xorl %esi, %esi
callq 0x7450
leaq 0x90(%rsp), %rdi
movq %r14, %rsi
callq 0x3030c
movq 0x50(%rsp), %rdi
leaq 0x60(%rsp), %rax
cmpq %rax, %rdi
je 0x146a6
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x72c0
movq 0x70(%rsp), %rdi
leaq 0x80(%rsp), %rax
cmpq %rax, %rdi
je 0x14281
movq 0x80(%rsp), %rsi
incq %rsi
callq 0x72c0
jmp 0x14281
movb $0x1, %bl
leaq 0x90(%rsp), %rdi
callq 0xbb36
movl %ebx, %eax
addq $0xe8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x10(%rsp), %rdi
movq %r12, (%rdi)
leaq 0x2122e(%rip), %rsi     # 0x35931
leaq 0x2124f(%rip), %rdx     # 0x35959
callq 0xbdee
movl 0x8(%r13), %esi
leaq 0x10(%rsp), %rdi
callq 0x34178
jmp 0x14748
leaq 0x10(%rsp), %rdi
movq %r12, (%rdi)
leaq 0x2122c(%rip), %rsi     # 0x3595a
leaq 0x21252(%rip), %rdx     # 0x35987
callq 0xbdee
movl 0x8(%r13), %esi
leaq 0x10(%rsp), %rdi
callq 0x34178
movq 0x10(%rsp), %rdi
cmpq %r12, %rdi
je 0x1475f
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x72c0
movq 0x50(%rsp), %rdi
leaq 0x60(%rsp), %rax
cmpq %rax, %rdi
je 0x1477b
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x72c0
movq 0x70(%rsp), %rdi
leaq 0x80(%rsp), %rax
cmpq %rax, %rdi
je 0x1479d
movq 0x80(%rsp), %rsi
incq %rsi
callq 0x72c0
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
je 0x147b9
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x72c0
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x147c8
callq 0x8036
testq %rbx, %rbx
je 0x147d5
movq %rbx, %rdi
callq 0x8036
xorl %ebx, %ebx
jmp 0x146d3
jmp 0x147e0
jmp 0x1480d
movq %rax, %r15
movq 0x10(%rsp), %rdi
cmpq %r12, %rdi
je 0x14810
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x72c0
jmp 0x14810
jmp 0x1480d
jmp 0x1480d
movq %rax, %r15
jmp 0x1482c
jmp 0x1480d
jmp 0x1480d
jmp 0x1480d
jmp 0x14875
movq %rax, %r15
movq 0x50(%rsp), %rdi
leaq 0x60(%rsp), %rax
cmpq %rax, %rdi
je 0x1482c
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x72c0
movq 0x70(%rsp), %rdi
leaq 0x80(%rsp), %rax
cmpq %rax, %rdi
je 0x14857
movq 0x80(%rsp), %rsi
incq %rsi
callq 0x72c0
jmp 0x14857
jmp 0x14854
jmp 0x14875
movq %rax, %r15
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
je 0x14878
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x72c0
jmp 0x14878
movq %rax, %r15
cmpq $0x0, 0x8(%rsp)
je 0x1488a
movq 0x8(%rsp), %rdi
callq 0x8036
testq %rbx, %rbx
je 0x14897
movq %rbx, %rdi
callq 0x8036
leaq 0x90(%rsp), %rdi
callq 0xbb36
movq %r15, %rdi
callq 0x74f0