// File: /workspace/github_cpp_makefile_star2_O3/smallsimple[P]CoreInterpreter-CSE5341/Assign.cpp
// Function: Assign::ParseAssign()
void Assign::ParseAssign(){
  Tokenizer *tokensAssign;
  tokensAssign = Tokenizer::getInstance();
  int tokenType;
  tokenType = tokensAssign->getTokenType();
  if (tokenType != tokensAssign->idNum){
    cout << "Error: Assign: not legal identifier" << endl;
    cout << "program stopped." << endl;
    exit(0);
  }
  id = Id::ParseId();
  string tokenTemp;
  tokenTemp = tokensAssign->getToken();
  if (tokenTemp.compare("=") != 0){
    cout << "Error: Assign: \"=\" not found after identifier." << endl;
    cout << "program stopped." << endl;
    exit(0);
  }
  else {
    tokensAssign->skipToken();
  }
  
  expr = new Expr();
  expr->ParseExpr();
  tokenTemp = tokensAssign->getToken();
  if (tokenTemp.compare(";") != 0){
    cout << "Error; Assign: \";\" not found or not in the right place!" << endl;
    cout << "program stopped." << endl;
    exit(0);
  }
  tokensAssign->skipToken();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rdi, %r14
callq 0x3c70
movq %rax, %rbx
movq %rax, %rdi
callq 0x3fac
leaq 0x2b0b(%rip), %rcx      # 0x8324
cmpl (%rcx), %eax
jne 0x5929
callq 0x4f38
movq %rax, (%r14)
leaq -0x38(%rbp), %r12
movq %r12, -0x10(%r12)
movq $0x0, -0x8(%r12)
movb $0x0, (%r12)
leaq -0x68(%rbp), %rdi
movq %rbx, %rsi
callq 0x3cc4
leaq -0x48(%rbp), %rdi
leaq -0x68(%rbp), %r15
movq %r15, %rsi
callq 0x2200
movq (%r15), %rdi
leaq -0x58(%rbp), %r13
cmpq %r13, %rdi
je 0x5874
movq -0x58(%rbp), %rsi
incq %rsi
callq 0x21a0
leaq 0x3246(%rip), %rsi      # 0x8ac1
leaq -0x48(%rbp), %rdi
callq 0x2090
testl %eax, %eax
jne 0x5965
movq %rbx, %rdi
callq 0x3da6
movl $0x18, %edi
callq 0x2190
movq %rax, %r15
movq %rax, %rdi
callq 0x5a34
movq %r15, 0x8(%r14)
movq %r15, %rdi
callq 0x5b8e
leaq -0x68(%rbp), %rdi
movq %rbx, %rsi
callq 0x3cc4
leaq -0x48(%rbp), %rdi
leaq -0x68(%rbp), %r14
movq %r14, %rsi
callq 0x2200
movq (%r14), %rdi
cmpq %r13, %rdi
je 0x58e5
movq -0x58(%rbp), %rsi
incq %rsi
callq 0x21a0
leaq 0x2e7e(%rip), %rsi      # 0x876a
leaq -0x48(%rbp), %rdi
callq 0x2090
testl %eax, %eax
jne 0x59af
movq %rbx, %rdi
callq 0x3da6
movq -0x48(%rbp), %rdi
cmpq %r12, %rdi
je 0x591a
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x21a0
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x66a8(%rip), %rbx      # 0xbfd8
leaq 0x2c8f(%rip), %rsi      # 0x85c6
movq %rbx, %rdi
callq 0x2180
movq %rax, %rdi
callq 0x20c0
leaq 0x27cc(%rip), %rsi      # 0x811a
movq %rbx, %rdi
callq 0x2180
movq %rax, %rdi
callq 0x20c0
xorl %edi, %edi
callq 0x21f0
movq 0x666c(%rip), %rdi      # 0xbfd8
leaq 0x2c77(%rip), %rsi      # 0x85ea
movl $0x2e, %edx
callq 0x21d0
movq 0x6654(%rip), %rdi      # 0xbfd8
callq 0x20c0
movq 0x6648(%rip), %rdi      # 0xbfd8
leaq 0x2783(%rip), %rsi      # 0x811a
movl $0x10, %edx
callq 0x21d0
movq 0x6630(%rip), %rdi      # 0xbfd8
callq 0x20c0
jmp 0x595e
movq 0x6622(%rip), %rdi      # 0xbfd8
leaq 0x2c5c(%rip), %rsi      # 0x8619
movl $0x37, %edx
callq 0x21d0
movq 0x660a(%rip), %rdi      # 0xbfd8
callq 0x20c0
movq 0x65fe(%rip), %rdi      # 0xbfd8
leaq 0x2739(%rip), %rsi      # 0x811a
movl $0x10, %edx
callq 0x21d0
movq 0x65e6(%rip), %rdi      # 0xbfd8
callq 0x20c0
jmp 0x595e
jmp 0x5a12
movq %rax, %rbx
movl $0x18, %esi
movq %r15, %rdi
callq 0x21a0
jmp 0x5a15
jmp 0x5a12
movq %rax, %rbx
movq -0x48(%rbp), %rdi
cmpq %r12, %rdi
je 0x5a2a
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x21a0
movq %rbx, %rdi
callq 0x22a0
nop