// File: /workspace/github_cpp_makefile_star2_O3/ssubrandon[P]460Project2/SyntacticalAnalyzer.cpp
// Function: SyntacticalAnalyzer::literal()
int SyntacticalAnalyzer::literal(){
  //This function deals with the literal rules (10-12) and will check for syntactical correctness,
  //this function will then, depending on the token seen, send the program to quoted lit or return.
	ruleFile << "Entering literal function; Current token is: " << lex ->GetTokenName(token) << ", lexeme: " << lex->GetLexeme() << endl;

	int errors =0;
	
	if (token == NUMLIT_T)
	{ 
		ruleFile << "Using Rule 10" << endl;
		token = lex->GetToken();
		ruleFile << "Exiting literal function; current token is: " << lex ->GetTokenName (token) << endl;
		return errors;
	}

	
	if (token == STRLIT_T)
	{
		ruleFile << "Using Rule 11" << endl;
		token = lex->GetToken();
		ruleFile << "Exiting literal function; current token is: " << lex ->GetTokenName (token) << endl;
		return errors;
	}


	if ( token == SQUOTE_T )
	{
		ruleFile << "Using Rule 12" << endl;
		ruleFile << "literal function complete. Current token is: " << lex->GetTokenName(token) << endl;
		token = lex->GetToken();
		errors += quoted_lit(); 
	}
	else{
	  if ( token != RPAREN_T){
	    errors++;
	    ReportError(string("expected either NUMLIT_T, STRLIT_T, or SQUOTE_T in literal but got: " + lex->GetTokenName(token)));
	  }
	}
	ruleFile << "Exiting literal function; current token is: " << lex ->GetTokenName (token) << endl;
	return errors;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rdi, %r14
leaq 0x420(%rdi), %rbx
leaq 0x3555(%rip), %rsi      # 0xbd35
movl $0x2d, %edx
movq %rbx, %rdi
callq 0x2260
movq 0x8(%r14), %rsi
movl 0x10(%r14), %edx
leaq -0x48(%rbp), %r15
movq %r15, %rdi
callq 0x499a
movq (%r15), %rsi
movq 0x8(%r15), %rdx
movq %rbx, %rdi
callq 0x2260
movq %rax, %r15
leaq 0x307e(%rip), %rsi      # 0xb898
movl $0xa, %edx
movq %rax, %rdi
callq 0x2260
movq 0x8(%r14), %rsi
leaq -0x68(%rbp), %rdi
callq 0x49d4
movq -0x68(%rbp), %rsi
movq -0x60(%rbp), %rdx
movq %r15, %rdi
callq 0x2260
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x21e0
movsbl %al, %esi
movq %r15, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2170
leaq -0x58(%rbp), %r13
movq -0x10(%r13), %rdi
cmpq %r13, %rdi
je 0x8887
movq -0x58(%rbp), %rsi
incq %rsi
callq 0x2210
leaq -0x38(%rbp), %r12
movq -0x10(%r12), %rdi
cmpq %r12, %rdi
je 0x88a1
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x2210
movl 0x10(%r14), %edx
cmpl $0x1f, %edx
jg 0x8972
cmpl $0x2, %edx
je 0x8aa6
cmpl $0x3, %edx
jne 0x8a56
leaq 0x34d7(%rip), %rsi      # 0xbd9e
movl $0xd, %edx
movq %rbx, %rdi
callq 0x2260
movq 0x420(%r14), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x21e0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2170
movq 0x8(%r14), %rdi
callq 0x3e8e
movl %eax, 0x10(%r14)
leaq 0x345e(%rip), %rsi      # 0xbd71
movl $0x2c, %edx
movq %rbx, %rdi
callq 0x2260
movq 0x8(%r14), %rsi
movl 0x10(%r14), %edx
leaq -0x48(%rbp), %r14
movq %r14, %rdi
callq 0x499a
movq (%r14), %rsi
movq 0x8(%r14), %rdx
movq %rbx, %rdi
callq 0x2260
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x21e0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2170
jmp 0x8b53
cmpl $0x20, %edx
je 0x8b70
cmpl $0x21, %edx
jne 0x8a56
leaq 0x3421(%rip), %rsi      # 0xbdac
movl $0xd, %edx
movq %rbx, %rdi
callq 0x2260
movq 0x420(%r14), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x21e0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2170
leaq 0x33f0(%rip), %rsi      # 0xbdba
movl $0x2d, %edx
movq %rbx, %rdi
callq 0x2260
movq 0x8(%r14), %rsi
movl 0x10(%r14), %edx
leaq -0x48(%rbp), %r15
movq %r15, %rdi
callq 0x499a
movq (%r15), %rsi
movq 0x8(%r15), %rdx
movq %rbx, %rdi
callq 0x2260
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x21e0
movsbl %al, %esi
movq %r15, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2170
movq -0x48(%rbp), %rdi
cmpq %r12, %rdi
je 0x8a39
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x2210
movq 0x8(%r14), %rdi
callq 0x3e8e
movl %eax, 0x10(%r14)
movq %r14, %rdi
callq 0x8cdc
movl %eax, %r15d
jmp 0x8bd0
movq 0x8(%r14), %rsi
leaq -0x68(%rbp), %r15
movq %r15, %rdi
callq 0x499a
leaq 0x337b(%rip), %rcx      # 0xbde8
movl $0x44, %r8d
movq %r15, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x2240
movq %r12, -0x48(%rbp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x8b75
movq %rdx, -0x48(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x38(%rbp)
jmp 0x8b7d
leaq 0x32b6(%rip), %rsi      # 0xbd63
movl $0xd, %edx
movq %rbx, %rdi
callq 0x2260
movq 0x420(%r14), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x21e0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2170
movq 0x8(%r14), %rdi
callq 0x3e8e
movl %eax, 0x10(%r14)
leaq 0x3278(%rip), %rsi      # 0xbd71
movl $0x2c, %edx
movq %rbx, %rdi
callq 0x2260
movq 0x8(%r14), %rsi
movl 0x10(%r14), %edx
leaq -0x48(%rbp), %r14
movq %r14, %rdi
callq 0x499a
movq (%r14), %rsi
movq 0x8(%r14), %rdx
movq %rbx, %rdi
callq 0x2260
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x21e0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2170
movq -0x48(%rbp), %rdi
cmpq %r12, %rdi
je 0x8b68
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x2210
xorl %r15d, %r15d
jmp 0x8c46
xorl %r15d, %r15d
jmp 0x8bd0
movups (%rcx), %xmm0
movups %xmm0, (%r12)
movq 0x8(%rax), %rdx
leaq -0x48(%rbp), %rsi
movq %rdx, 0x8(%rsi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq %r14, %rdi
callq 0x56f4
movq -0x48(%rbp), %rdi
cmpq %r12, %rdi
je 0x8bb5
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x2210
movq -0x68(%rbp), %rdi
cmpq %r13, %rdi
je 0x8bca
movq -0x58(%rbp), %rsi
incq %rsi
callq 0x2210
movl $0x1, %r15d
leaq 0x319a(%rip), %rsi      # 0xbd71
movl $0x2c, %edx
movq %rbx, %rdi
callq 0x2260
movq 0x8(%r14), %rsi
movl 0x10(%r14), %edx
leaq -0x48(%rbp), %r14
movq %r14, %rdi
callq 0x499a
movq (%r14), %rsi
movq 0x8(%r14), %rdx
movq %rbx, %rdi
callq 0x2260
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x21e0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2170
movq -0x48(%rbp), %rdi
cmpq %r12, %rdi
je 0x8c46
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x2210
movl %r15d, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq -0x48(%rbp), %rdi
cmpq %r12, %rdi
je 0x8c75
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x2210
jmp 0x8c75
movq %rax, %rbx
movq -0x68(%rbp), %rdi
cmpq %r13, %rdi
je 0x8cd4
movq -0x58(%rbp), %rsi
jmp 0x8ccc
jmp 0x8c91
jmp 0x8c91
jmp 0x8c91
jmp 0x8c8c
movq %rax, %rbx
jmp 0x8cbb
movq %rax, %rbx
movq -0x48(%rbp), %rdi
cmpq %r12, %rdi
jne 0x8cc8
jmp 0x8cd4
movq %rax, %rbx
leaq -0x58(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x8cbb
movq -0x58(%rbp), %rsi
incq %rsi
callq 0x2210
leaq -0x38(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x8cd4
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x2210
movq %rbx, %rdi
callq 0x2340