// File: /workspace/github_cpp_makefile_star2_O3/ssubrandon[P]460Project2/SyntacticalAnalyzer.cpp
// Function: SyntacticalAnalyzer::program()
int SyntacticalAnalyzer::program(){
  //This is the program function and is also rule one of our language this will check for
  //correct syntax and send the program off to the next rule using recursion.

	ruleFile  << "Entering Program function; current token is: " << lex ->GetTokenName (token) << ", lexeme: " << lex->GetLexeme() <<  endl; 
	int errors = 0;
	ruleFile << "Using Rule 1" << endl;

	if(token != LPAREN_T){
		errors++;
		ReportError(string("expected a LPAREN_T, currently in program, but found  " + lex->GetTokenName(token)));
	}
	token = lex->GetToken();

	errors += define();

	if(token != LPAREN_T){
		errors++;
		ReportError(string("expected a LPAREN_T in program, but found  " + lex->GetTokenName(token)));
	}

	token = lex->GetToken();
	errors += more_defines();
	if (token != EOF_T) {
		errors ++;		
		ReportError(string("expected a EOF_T in program, but found  " + lex->GetTokenName(token)));
	} // end of if EOF
	ruleFile << "Exiting Program 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 0x6742(%rip), %rsi      # 0xb86a
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 0x6736(%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), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x51cf
movq -0x58(%rbp), %rsi
incq %rsi
callq 0x2210
leaq -0x38(%rbp), %r13
movq -0x10(%r13), %rdi
cmpq %r13, %rdi
je 0x51e8
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x2210
leaq 0x66b4(%rip), %rsi      # 0xb8a3
movl $0xc, %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
movl 0x10(%r14), %edx
xorl %r15d, %r15d
cmpl $0x1f, %edx
je 0x52df
movq 0x8(%r14), %rsi
leaq -0x68(%rbp), %r15
movq %r15, %rdi
callq 0x499a
leaq 0x6662(%rip), %rcx      # 0xb8b0
movl $0x36, %r8d
movq %r15, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x2240
movq %r13, -0x48(%rbp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x5280
movq %rdx, -0x48(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x38(%rbp)
jmp 0x5288
movups (%rcx), %xmm0
movups %xmm0, (%r13)
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 %r13, %rdi
je 0x52c0
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x2210
movq -0x68(%rbp), %rdi
leaq -0x58(%rbp), %rax
cmpq %rax, %rdi
je 0x52d9
movq -0x58(%rbp), %rsi
incq %rsi
callq 0x2210
movl $0x1, %r15d
movq 0x8(%r14), %rdi
callq 0x3e8e
movl %eax, 0x10(%r14)
movq %r14, %rdi
callq 0x586a
movl %eax, %r12d
addl %r15d, %r12d
movl 0x10(%r14), %edx
cmpl $0x1f, %edx
je 0x53ac
movq 0x8(%r14), %rsi
leaq -0x68(%rbp), %r15
movq %r15, %rdi
callq 0x499a
leaq 0x65c9(%rip), %rcx      # 0xb8e7
movl $0x2b, %r8d
movq %r15, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x2240
movq %r13, -0x48(%rbp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x5350
movq %rdx, -0x48(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x38(%rbp)
jmp 0x5358
movups (%rcx), %xmm0
movups %xmm0, (%r13)
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 %r13, %rdi
je 0x5390
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x2210
movq -0x68(%rbp), %rdi
leaq -0x58(%rbp), %rax
cmpq %rax, %rdi
je 0x53a9
movq -0x58(%rbp), %rsi
incq %rsi
callq 0x2210
incl %r12d
movq 0x8(%r14), %rdi
callq 0x3e8e
movl %eax, 0x10(%r14)
movq %r14, %rdi
callq 0x5ed8
movl %eax, %r15d
addl %r12d, %r15d
movl 0x10(%r14), %edx
cmpl $0x23, %edx
je 0x5479
movq 0x8(%r14), %rsi
leaq -0x68(%rbp), %r12
movq %r12, %rdi
callq 0x499a
leaq 0x6528(%rip), %rcx      # 0xb913
movl $0x28, %r8d
movq %r12, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x2240
movq %r13, -0x48(%rbp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x541d
movq %rdx, -0x48(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x38(%rbp)
jmp 0x5425
movups (%rcx), %xmm0
movups %xmm0, (%r13)
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 %r13, %rdi
je 0x545d
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x2210
movq -0x68(%rbp), %rdi
leaq -0x58(%rbp), %rax
cmpq %rax, %rdi
je 0x5476
movq -0x58(%rbp), %rsi
incq %rsi
callq 0x2210
incl %r15d
leaq 0x64bc(%rip), %rsi      # 0xb93c
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 %r13, %rdi
je 0x54ef
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
jmp 0x5509
jmp 0x5523
jmp 0x5509
jmp 0x5523
movq %rax, %rbx
movq -0x48(%rbp), %rdi
cmpq %r13, %rdi
je 0x5526
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x2210
jmp 0x5526
movq %rax, %rbx
movq -0x68(%rbp), %rdi
leaq -0x58(%rbp), %rax
cmpq %rax, %rdi
je 0x5583
movq -0x58(%rbp), %rsi
jmp 0x557b
jmp 0x553b
movq %rax, %rbx
jmp 0x556a
movq %rax, %rbx
movq -0x48(%rbp), %rdi
cmpq %r13, %rdi
jne 0x5577
jmp 0x5583
movq %rax, %rbx
leaq -0x58(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x556a
movq -0x58(%rbp), %rsi
incq %rsi
callq 0x2210
leaq -0x38(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x5583
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x2210
movq %rbx, %rdi
callq 0x2340
nop