// File: /workspace/github_cpp_makefile_star2_O2/ssubrandon[P]460Project2/SyntacticalAnalyzer.cpp
// Function: SyntacticalAnalyzer::stmt_list()
int SyntacticalAnalyzer::stmt_list(){
  //This function deals with the stmt_list rules(5-6) and will check for syntactical correctness,
  //this function will then, depending on the token seen, send the program to stmt and stmt list
  // or will return after seeing nothing in the file.
  
  ruleFile << "Entering stmt_list function; Current token is: " << lex ->GetTokenName(token) << ", lexeme: " << lex->GetLexeme() << endl;

	int errors = 0;
	if(token == EOF_T){
		errors++;
		ReportError(string("EOF_T token detected ending function stmt_list"));
		ruleFile << "Exiting stmt_list function; current token is: " << lex ->GetTokenName (token) << endl;
		return errors;

	}

	if(token == RPAREN_T ) {
		ruleFile << "Using Rule 6" << endl;
		ruleFile << "Exiting stmt_list function; current token is: " << lex ->GetTokenName (token) << endl;
		return errors;
	} 
	ruleFile << "Using Rule 5" << endl;
	errors += stmt();
	errors += stmt_list();
	ruleFile << "Exiting stmt_list function; current token is: " << lex ->GetTokenName (token) << endl;

	return errors;

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x40, %rsp
movq %rdi, %rbx
leaq 0x420(%rdi), %r14
leaq 0x3c22(%rip), %rsi      # 0x8bd4
movq %r14, %rdi
callq 0x21f0
movq %rax, %r15
movq 0x8(%rbx), %rsi
movl 0x10(%rbx), %edx
leaq -0x40(%rbp), %r12
movq %r12, %rdi
callq 0x3df8
movq %r15, %rdi
movq %r12, %rsi
callq 0x21d0
leaq 0x390e(%rip), %rsi      # 0x88f0
movq %rax, %rdi
callq 0x21f0
movq %rax, %r15
movq 0x8(%rbx), %rsi
leaq -0x60(%rbp), %rdi
callq 0x3e22
leaq -0x60(%rbp), %rsi
movq %r15, %rdi
callq 0x21d0
movq %rax, %rdi
callq 0x2130
leaq -0x60(%rbp), %rdi
callq 0x2398
leaq -0x40(%rbp), %rdi
callq 0x2398
movl 0x10(%rbx), %eax
cmpl $0x20, %eax
je 0x50a4
cmpl $0x23, %eax
jne 0x5101
leaq 0x3bcc(%rip), %rsi      # 0x8c04
leaq -0x40(%rbp), %rdi
leaq -0x60(%rbp), %rdx
callq 0x3e7a
leaq -0x40(%rbp), %rsi
movq %rbx, %rdi
callq 0x48e6
leaq -0x40(%rbp), %rdi
callq 0x2398
leaq 0x3bd2(%rip), %rsi      # 0x8c33
movq %r14, %rdi
callq 0x21f0
movq %rax, %r14
movq 0x8(%rbx), %rsi
movl 0x10(%rbx), %edx
leaq -0x40(%rbp), %rbx
movq %rbx, %rdi
callq 0x3df8
movq %r14, %rdi
movq %rbx, %rsi
callq 0x21d0
movq %rax, %rdi
callq 0x2130
leaq -0x40(%rbp), %rdi
callq 0x2398
pushq $0x1
popq %r15
jmp 0x5172
leaq 0x3bb7(%rip), %rsi      # 0x8c62
movq %r14, %rdi
callq 0x21f0
movq %rax, %rdi
callq 0x2130
leaq 0x3b71(%rip), %rsi      # 0x8c33
movq %r14, %rdi
callq 0x21f0
movq %rax, %r14
movq 0x8(%rbx), %rsi
movl 0x10(%rbx), %edx
leaq -0x40(%rbp), %rbx
movq %rbx, %rdi
callq 0x3df8
movq %r14, %rdi
movq %rbx, %rsi
callq 0x21d0
movq %rax, %rdi
callq 0x2130
leaq -0x40(%rbp), %rdi
callq 0x2398
xorl %r15d, %r15d
jmp 0x5172
leaq 0x3b67(%rip), %rsi      # 0x8c6f
movq %r14, %rdi
callq 0x21f0
movq %rax, %rdi
callq 0x2130
movq %rbx, %rdi
callq 0x53fe
movl %eax, %r12d
movq %rbx, %rdi
callq 0x4f92
movl %eax, %r15d
leaq 0x3afe(%rip), %rsi      # 0x8c33
movq %r14, %rdi
callq 0x21f0
movq %rax, %r14
movq 0x8(%rbx), %rsi
movl 0x10(%rbx), %edx
leaq -0x40(%rbp), %rbx
movq %rbx, %rdi
callq 0x3df8
movq %r14, %rdi
movq %rbx, %rsi
callq 0x21d0
movq %rax, %rdi
callq 0x2130
addl %r12d, %r15d
leaq -0x40(%rbp), %rdi
callq 0x2398
movl %r15d, %eax
addq $0x40, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
jmp 0x519f
movq %rax, %rbx
jmp 0x51ab
jmp 0x519f
jmp 0x519f
jmp 0x519f
jmp 0x519f
movq %rax, %rbx
leaq -0x60(%rbp), %rdi
callq 0x2398
jmp 0x51a2
movq %rax, %rbx
leaq -0x40(%rbp), %rdi
callq 0x2398
movq %rbx, %rdi
callq 0x2330
nop