// File: /workspace/github_cpp_makefile_star2_O1/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 0x3d00
movq %rax, %rbx
movq %rax, %rdi
callq 0x403c
leaq 0x2a3f(%rip), %rcx      # 0x8324
cmpl (%rcx), %eax
jne 0x59f5
callq 0x4fe0
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 0x3d54
leaq -0x48(%rbp), %rdi
leaq -0x68(%rbp), %r15
movq %r15, %rsi
callq 0x2200
movq (%r15), %rdi
leaq -0x58(%rbp), %r13
cmpq %r13, %rdi
je 0x5940
movq -0x58(%rbp), %rsi
incq %rsi
callq 0x21a0
leaq 0x317e(%rip), %rsi      # 0x8ac5
leaq -0x48(%rbp), %rdi
callq 0x2090
testl %eax, %eax
jne 0x5a31
movq %rbx, %rdi
callq 0x3e36
movl $0x18, %edi
callq 0x2190
movq %rax, %r15
movq %rax, %rdi
callq 0x5b00
movq %r15, 0x8(%r14)
movq %r15, %rdi
callq 0x5c52
leaq -0x68(%rbp), %rdi
movq %rbx, %rsi
callq 0x3d54
leaq -0x48(%rbp), %rdi
leaq -0x68(%rbp), %r14
movq %r14, %rsi
callq 0x2200
movq (%r14), %rdi
cmpq %r13, %rdi
je 0x59b1
movq -0x58(%rbp), %rsi
incq %rsi
callq 0x21a0
leaq 0x2db4(%rip), %rsi      # 0x876c
leaq -0x48(%rbp), %rdi
callq 0x2090
testl %eax, %eax
jne 0x5a7b
movq %rbx, %rdi
callq 0x3e36
movq -0x48(%rbp), %rdi
cmpq %r12, %rdi
je 0x59e6
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 0x65dc(%rip), %rbx      # 0xbfd8
leaq 0x2bc7(%rip), %rsi      # 0x85ca
movq %rbx, %rdi
callq 0x2180
movq %rax, %rdi
callq 0x20c0
leaq 0x2700(%rip), %rsi      # 0x811a
movq %rbx, %rdi
callq 0x2180
movq %rax, %rdi
callq 0x20c0
xorl %edi, %edi
callq 0x21f0
movq 0x65a0(%rip), %rdi      # 0xbfd8
leaq 0x2baf(%rip), %rsi      # 0x85ee
movl $0x2e, %edx
callq 0x21d0
movq 0x6588(%rip), %rdi      # 0xbfd8
callq 0x20c0
movq 0x657c(%rip), %rdi      # 0xbfd8
leaq 0x26b7(%rip), %rsi      # 0x811a
movl $0x10, %edx
callq 0x21d0
movq 0x6564(%rip), %rdi      # 0xbfd8
callq 0x20c0
jmp 0x5a2a
movq 0x6556(%rip), %rdi      # 0xbfd8
leaq 0x2b94(%rip), %rsi      # 0x861d
movl $0x37, %edx
callq 0x21d0
movq 0x653e(%rip), %rdi      # 0xbfd8
callq 0x20c0
movq 0x6532(%rip), %rdi      # 0xbfd8
leaq 0x266d(%rip), %rsi      # 0x811a
movl $0x10, %edx
callq 0x21d0
movq 0x651a(%rip), %rdi      # 0xbfd8
callq 0x20c0
jmp 0x5a2a
jmp 0x5ade
movq %rax, %rbx
movl $0x18, %esi
movq %r15, %rdi
callq 0x21a0
jmp 0x5ae1
jmp 0x5ade
movq %rax, %rbx
movq -0x48(%rbp), %rdi
cmpq %r12, %rdi
je 0x5af6
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x21a0
movq %rbx, %rdi
callq 0x22b0
nop