// File: 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
movq %rsp, %rbp
subq $0x120, %rsp            # imm = 0x120
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x100(%rbp)
leaq -0x58(%rbp), %rdi
callq 0x32870
movq -0x100(%rbp), %rax
addq $0x10, %rax
movq %rax, -0x60(%rbp)
movq -0x60(%rbp), %rdi
callq 0x32fd0
movq %rax, -0x68(%rbp)
movq -0x60(%rbp), %rdi
callq 0x33000
movq %rax, -0x70(%rbp)
leaq -0x68(%rbp), %rdi
leaq -0x70(%rbp), %rsi
callq 0x33030
testb $0x1, %al
jne 0x22082
jmp 0x22368
leaq -0x68(%rbp), %rdi
callq 0x33070
movq %rax, %rsi
leaq -0x80(%rbp), %rdi
callq 0x33090
leaq -0x90(%rbp), %rdi
leaq -0x80(%rbp), %rsi
callq 0x32a80
xorl %eax, %eax
movl %eax, %edi
leaq -0x90(%rbp), %rsi
callq 0x33430
testb $0x1, %al
jne 0x220c0
jmp 0x22314
leaq -0x58(%rbp), %rdi
callq 0x32b10
movq %rax, -0x108(%rbp)
jmp 0x220d2
movq -0x108(%rbp), %rsi
leaq -0xa0(%rbp), %rdi
callq 0x33090
leaq -0x58(%rbp), %rdi
callq 0x32be0
jmp 0x220f0
leaq -0x90(%rbp), %rdi
callq 0x32c70
movq %rax, %rdi
callq 0x32590
movb %al, -0x109(%rbp)
jmp 0x2210c
movb -0x109(%rbp), %al
testb $0x1, %al
jne 0x22118
jmp 0x22153
leaq -0x58(%rbp), %rdi
callq 0x32be0
jmp 0x22123
jmp 0x22153
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xa8(%rbp)
movl %eax, -0xac(%rbp)
jmp 0x22348
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xa8(%rbp)
movl %eax, -0xac(%rbp)
jmp 0x22306
leaq -0x90(%rbp), %rdi
callq 0x32c70
movq %rax, %rdi
movb $0x0, -0xd1(%rbp)
callq 0x32570
movb %al, -0x10a(%rbp)
jmp 0x22176
movb -0x10a(%rbp), %cl
xorl %eax, %eax
testb $0x1, %cl
movb %al, -0x10b(%rbp)
jne 0x2218b
jmp 0x221d8
leaq -0x90(%rbp), %rdi
callq 0x32c70
movq %rax, %rsi
leaq -0xd0(%rbp), %rdi
callq 0x33460
jmp 0x221a8
movb $0x1, -0xd1(%rbp)
leaq 0x4d4c0(%rip), %rdi     # 0x6f676
leaq -0xd0(%rbp), %rsi
callq 0xd590
movb %al, -0x10c(%rbp)
jmp 0x221ca
movb -0x10c(%rbp), %al
movb %al, -0x10b(%rbp)
jmp 0x221d8
movb -0x10b(%rbp), %al
movb %al, -0x10d(%rbp)
testb $0x1, -0xd1(%rbp)
jne 0x221ef
jmp 0x221fb
leaq -0xd0(%rbp), %rdi
callq 0x8848
movb -0x10d(%rbp), %al
testb $0x1, %al
jne 0x2220a
jmp 0x222a5
leaq -0xe8(%rbp), %rdi
leaq -0xa0(%rbp), %rsi
callq 0x336b0
xorl %eax, %eax
movl %eax, %edi
leaq -0xe8(%rbp), %rsi
callq 0x33740
testb $0x1, %al
jne 0x22233
jmp 0x22299
leaq -0xe8(%rbp), %rdi
callq 0x33770
movq %rax, %rdi
callq 0x33790
jmp 0x22249
jmp 0x22299
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xa8(%rbp)
movl %eax, -0xac(%rbp)
testb $0x1, -0xd1(%rbp)
jne 0x22268
jmp 0x22274
leaq -0xd0(%rbp), %rdi
callq 0x8848
jmp 0x22306
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xa8(%rbp)
movl %eax, -0xac(%rbp)
leaq -0xe8(%rbp), %rdi
callq 0x337b0
jmp 0x22306
leaq -0xe8(%rbp), %rdi
callq 0x337b0
xorl %eax, %eax
movl %eax, %esi
leaq -0xf8(%rbp), %rdi
movq %rdi, -0x118(%rbp)
callq 0x33560
movq -0x118(%rbp), %rsi
leaq -0x58(%rbp), %rdi
callq 0x32970
jmp 0x222ce
leaq -0xf8(%rbp), %rdi
callq 0x327f0
leaq -0xa0(%rbp), %rdi
callq 0x327f0
jmp 0x22325
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xa8(%rbp)
movl %eax, -0xac(%rbp)
leaq -0xf8(%rbp), %rdi
callq 0x327f0
leaq -0xa0(%rbp), %rdi
callq 0x327f0
jmp 0x22348
leaq -0x58(%rbp), %rdi
leaq -0x80(%rbp), %rsi
callq 0x334e0
jmp 0x22323
jmp 0x22325
leaq -0x90(%rbp), %rdi
callq 0x32b50
leaq -0x80(%rbp), %rdi
callq 0x327f0
leaq -0x68(%rbp), %rdi
callq 0x334c0
jmp 0x2206c
leaq -0x90(%rbp), %rdi
callq 0x32b50
leaq -0x80(%rbp), %rdi
callq 0x327f0
leaq -0x58(%rbp), %rdi
callq 0x32fb0
jmp 0x2237a
leaq -0x58(%rbp), %rdi
callq 0x32fb0
addq $0x120, %rsp            # imm = 0x120
popq %rbp
retq
movq -0xa8(%rbp), %rdi
callq 0x8750
nopw %cs:(%rax,%rax)