// File: /workspace/github_cpp_makefile_star2_O1/rfotino[P]consolite-compiler/src/syntax.cpp
// Function: ExprToken::_flagNonRegs()
void ExprToken::_flagNonRegs() {
  std::stack<std::shared_ptr<Token>> operands;
  for (auto token : _postfix) {
    auto op = std::dynamic_pointer_cast<OperatorToken>(token);
    if (nullptr != op) {
      std::shared_ptr<Token> rhs = operands.top();
      operands.pop();
      if (op->isBinary()) {
        operands.pop();
      }
      // Check if it is an address-of operation
      if (op->isUnary() && "&" == op->str()) {
        auto var = std::dynamic_pointer_cast<Variable>(rhs);
        if (nullptr != var) {
          var->flagNonReg();
        }
      }
      // Push something back onto the stack.
      operands.push(nullptr);
    } else {
      operands.push(token);
    }
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xb8, %rsp
movq %rdi, %rbx
xorps %xmm0, %xmm0
leaq 0x60(%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 0x18(%rbx), %rax
movq %rax, 0x38(%rsp)
cmpq %rax, %r15
je 0x158ae
leaq 0x60(%rsp), %rbx
movq 0x32926(%rip), %rbp     # 0x47f98
leaq 0x40(%rsp), %r14
movq (%r15), %rax
movq %rax, 0x10(%rsp)
movq 0x8(%r15), %rax
movq %rax, 0x18(%rsp)
testq %rax, %rax
je 0x1569c
cmpb $0x0, (%rbp)
je 0x15698
incl 0x8(%rax)
jmp 0x1569c
lock
incl 0x8(%rax)
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x156c0
leaq 0x3163b(%rip), %rsi     # 0x46ce8
leaq 0x31d3c(%rip), %rdx     # 0x473f0
xorl %ecx, %ecx
callq 0x7330
movq %rax, %r12
jmp 0x156c3
xorl %r12d, %r12d
testq %r12, %r12
je 0x156de
movq 0x18(%rsp), %r13
testq %r13, %r13
je 0x156eb
cmpb $0x0, (%rbp)
je 0x156e6
incl 0x8(%r13)
jmp 0x156eb
xorl %r13d, %r13d
xorl %r12d, %r12d
jmp 0x156eb
lock
incl 0x8(%r13)
testq %r12, %r12
je 0x15733
movq 0x90(%rsp), %rax
cmpq 0x98(%rsp), %rax
jne 0x15716
movq 0xa8(%rsp), %rax
movq -0x8(%rax), %rax
movl $0x200, %ecx            # imm = 0x200
addq %rcx, %rax
movq -0x10(%rax), %rcx
movq %rcx, 0x30(%rsp)
movq -0x8(%rax), %rax
testq %rax, %rax
je 0x15749
cmpb $0x0, (%rbp)
je 0x15745
incl 0x8(%rax)
jmp 0x15749
movq %rbx, %rdi
leaq 0x10(%rsp), %rsi
callq 0x30b42
jmp 0x15883
lock
incl 0x8(%rax)
movq %rax, 0x8(%rsp)
movq %r13, (%rsp)
movq %rbp, %r13
movq %rbx, %rdi
callq 0x307f0
cmpb $0x1, 0x30(%r12)
jne 0x1576d
movq %rbx, %rdi
callq 0x307f0
movq %rbx, %rbp
movb 0x30(%r12), %bl
testb %bl, %bl
je 0x1577e
xorl %r12d, %r12d
jmp 0x157b5
leaq 0x50(%rsp), %rax
movq %rax, 0x40(%rsp)
movq 0x10(%r12), %rsi
movq 0x18(%r12), %rdx
addq %rsi, %rdx
movq %r14, %r12
movq %r14, %rdi
callq 0xc014
movq %r12, %rdi
leaq 0x20e3c(%rip), %rsi     # 0x365e6
callq 0x70c0
testl %eax, %eax
sete %r12b
testb %bl, %bl
movq %rbp, %rbx
movq %r13, %rbp
movq (%rsp), %r13
jne 0x157df
movq 0x40(%rsp), %rdi
leaq 0x50(%rsp), %rax
cmpq %rax, %rdi
je 0x157df
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x72c0
testb %r12b, %r12b
je 0x15850
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x1580a
leaq 0x314f3(%rip), %rsi     # 0x46ce8
leaq 0x31584(%rip), %rdx     # 0x46d80
movq $-0x2, %rcx
callq 0x7330
jmp 0x1580c
xorl %eax, %eax
movq 0x8(%rsp), %rsi
testq %rsi, %rsi
sete %cl
testq %rax, %rax
sete %dl
movq %rsi, %rdi
cmoveq %rax, %rdi
orb %cl, %dl
jne 0x1583a
cmpb $0x0, (%rbp)
je 0x15833
incl 0x8(%rsi)
jmp 0x15837
lock
incl 0x8(%rsi)
movq %rsi, %rdi
testq %rax, %rax
je 0x15846
movb $0x0, 0x80(%rax)
testq %rdi, %rdi
je 0x15850
callq 0x81ea
xorps %xmm0, %xmm0
movaps %xmm0, 0x20(%rsp)
movq %rbx, %rdi
leaq 0x20(%rsp), %rsi
callq 0x30436
movq 0x28(%rsp), %rdi
testq %rdi, %rdi
je 0x15874
callq 0x81ea
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x15883
callq 0x81ea
testq %r13, %r13
je 0x15890
movq %r13, %rdi
callq 0x81ea
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x1589f
callq 0x81ea
addq $0x10, %r15
cmpq 0x38(%rsp), %r15
jne 0x15677
leaq 0x60(%rsp), %rdi
callq 0x22550
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0x158ea
movq %r13, (%rsp)
movq %rax, %rbx
jmp 0x158fc
movq %rax, %rbx
movq 0x28(%rsp), %rdi
testq %rdi, %rdi
je 0x158ea
callq 0x81ea
cmpq $0x0, 0x8(%rsp)
je 0x158fc
movq 0x8(%rsp), %rdi
callq 0x81ea
cmpq $0x0, (%rsp)
je 0x1590c
movq (%rsp), %rdi
callq 0x81ea
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x1591b
callq 0x81ea
leaq 0x60(%rsp), %rdi
callq 0x22550
movq %rbx, %rdi
callq 0x74f0
nop