// File: /workspace/github_cpp_makefile_star2_O1/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 %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rdi, %r14
leaq 0x420(%rdi), %rbx
leaq 0x5746(%rip), %rsi      # 0xbb7c
movl $0x2f, %edx
movq %rbx, %rdi
callq 0x2260
movq 0x8(%r14), %rsi
movl 0x10(%r14), %edx
leaq -0x48(%rbp), %r15
movq %r15, %rdi
callq 0x4a1c
movq (%r15), %rsi
movq 0x8(%r15), %rdx
movq %rbx, %rdi
callq 0x2260
movq %rax, %r15
leaq 0x5428(%rip), %rsi      # 0xb898
movl $0xa, %edx
movq %rax, %rdi
callq 0x2260
movq 0x8(%r14), %rsi
leaq -0x68(%rbp), %rdi
callq 0x4a56
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 0x64dd
movq -0x58(%rbp), %rsi
incq %rsi
callq 0x2210
leaq -0x38(%rbp), %r13
movq -0x10(%r13), %rdi
cmpq %r13, %rdi
je 0x64f6
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x2210
movl 0x10(%r14), %eax
cmpl $0x20, %eax
je 0x65c8
cmpl $0x23, %eax
jne 0x6685
leaq -0x48(%rbp), %rdi
movq %r13, (%rdi)
leaq 0x5692(%rip), %rsi      # 0xbbac
leaq 0x56b9(%rip), %rdx      # 0xbbda
callq 0x4c4c
leaq -0x48(%rbp), %rsi
movq %r14, %rdi
callq 0x5778
movq -0x48(%rbp), %rdi
cmpq %r13, %rdi
je 0x6547
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x2210
leaq 0x568d(%rip), %rsi      # 0xbbdb
movl $0x2e, %edx
movq %rbx, %rdi
callq 0x2260
movq 0x8(%r14), %rsi
movl 0x10(%r14), %edx
leaq -0x48(%rbp), %r14
movq %r14, %rdi
callq 0x4a1c
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 0x65bd
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x2210
movl $0x1, %r15d
jmp 0x6753
leaq 0x563b(%rip), %rsi      # 0xbc0a
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
leaq 0x55cd(%rip), %rsi      # 0xbbdb
movl $0x2e, %edx
movq %rbx, %rdi
callq 0x2260
movq 0x8(%r14), %rsi
movl 0x10(%r14), %edx
leaq -0x48(%rbp), %r14
movq %r14, %rdi
callq 0x4a1c
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 0x667d
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x2210
xorl %r15d, %r15d
jmp 0x6753
leaq 0x558b(%rip), %rsi      # 0xbc17
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
movq %r14, %rdi
callq 0x6bfc
movl %eax, %r12d
movq %r14, %rdi
callq 0x6414
movl %eax, %r15d
leaq 0x54fa(%rip), %rsi      # 0xbbdb
movl $0x2e, %edx
movq %rbx, %rdi
callq 0x2260
movq 0x8(%r14), %rsi
movl 0x10(%r14), %edx
leaq -0x48(%rbp), %r14
movq %r14, %rdi
callq 0x4a1c
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 0x6750
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x2210
addl %r12d, %r15d
movl %r15d, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x6772
movq %rax, %rbx
jmp 0x67ba
jmp 0x6780
jmp 0x6772
jmp 0x6772
movq %rax, %rbx
movq -0x48(%rbp), %rdi
cmpq %r13, %rdi
jne 0x67ae
jmp 0x67ba
movq %rax, %rbx
jmp 0x67a1
movq %rax, %rbx
leaq -0x58(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x67a1
movq -0x58(%rbp), %rsi
incq %rsi
callq 0x2210
leaq -0x38(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x67ba
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x2210
movq %rbx, %rdi
callq 0x2340