// File: 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
subq $0x180, %rsp            # imm = 0x180
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rdi
movq %rdi, -0x110(%rbp)
addq $0x420, %rdi            # imm = 0x420
leaq 0x6910(%rip), %rsi      # 0x10738
callq 0x3270
movq %rax, %rcx
movq -0x110(%rbp), %rax
movq %rcx, -0x108(%rbp)
movq 0x8(%rax), %rsi
movl 0x10(%rax), %edx
leaq -0x30(%rbp), %rdi
movq %rdi, -0x100(%rbp)
callq 0x6f40
movq -0x108(%rbp), %rdi
movq -0x100(%rbp), %rsi
callq 0x3240
movq %rax, -0xf8(%rbp)
jmp 0x9e71
movq -0xf8(%rbp), %rdi
leaq 0x65d5(%rip), %rsi      # 0x10454
callq 0x3270
movq %rax, -0x118(%rbp)
jmp 0x9e8d
movq -0x110(%rbp), %rax
movq 0x8(%rax), %rsi
leaq -0x60(%rbp), %rdi
callq 0x6f80
jmp 0x9ea3
movq -0x118(%rbp), %rdi
leaq -0x60(%rbp), %rsi
callq 0x3240
movq %rax, -0x120(%rbp)
jmp 0x9ebc
movq -0x120(%rbp), %rdi
movq 0xb0f6(%rip), %rsi      # 0x14fc0
callq 0x32c0
jmp 0x9ed1
leaq -0x60(%rbp), %rdi
callq 0x34b8
leaq -0x30(%rbp), %rdi
callq 0x34b8
movq -0x110(%rbp), %rax
movl $0x0, -0x64(%rbp)
cmpl $0x23, 0x10(%rax)
jne 0xa071
movl -0x64(%rbp), %eax
incl %eax
movl %eax, -0x64(%rbp)
leaq -0x89(%rbp), %rdi
movq %rdi, -0x128(%rbp)
callq 0x3440
movq -0x128(%rbp), %rdx
leaq 0x6844(%rip), %rsi      # 0x10768
leaq -0x88(%rbp), %rdi
callq 0x7040
jmp 0x9f32
movq -0x110(%rbp), %rdi
leaq -0x88(%rbp), %rsi
callq 0x91a0
jmp 0x9f47
leaq -0x88(%rbp), %rdi
callq 0x34b8
leaq -0x89(%rbp), %rdi
callq 0x32e0
movq -0x110(%rbp), %rdi
addq $0x420, %rdi            # imm = 0x420
leaq 0x6823(%rip), %rsi      # 0x10797
callq 0x3270
movq %rax, %rcx
movq -0x110(%rbp), %rax
movq %rcx, -0x140(%rbp)
movq 0x8(%rax), %rsi
movl 0x10(%rax), %edx
leaq -0xb0(%rbp), %rdi
movq %rdi, -0x138(%rbp)
callq 0x6f40
movq -0x140(%rbp), %rdi
movq -0x138(%rbp), %rsi
callq 0x3240
movq %rax, -0x130(%rbp)
jmp 0x9fc0
movq -0x130(%rbp), %rdi
movq 0xaff2(%rip), %rsi      # 0x14fc0
callq 0x32c0
jmp 0x9fd5
leaq -0xb0(%rbp), %rdi
callq 0x34b8
movl -0x64(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0xa24e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0xa00f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x60(%rbp), %rdi
callq 0x34b8
leaq -0x30(%rbp), %rdi
callq 0x34b8
jmp 0xa25a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0xa043
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x88(%rbp), %rdi
callq 0x34b8
leaq -0x89(%rbp), %rdi
callq 0x32e0
jmp 0xa25a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0xb0(%rbp), %rdi
callq 0x34b8
jmp 0xa25a
movq -0x110(%rbp), %rax
cmpl $0x20, 0x10(%rax)
jne 0xa155
movq -0x110(%rbp), %rdi
addq $0x420, %rdi            # imm = 0x420
movq %rdi, -0x160(%rbp)
leaq 0x6728(%rip), %rsi      # 0x107c6
callq 0x3270
movq %rax, %rdi
movq 0xaf13(%rip), %rsi      # 0x14fc0
callq 0x32c0
movq -0x160(%rbp), %rdi
leaq 0x66d7(%rip), %rsi      # 0x10797
callq 0x3270
movq %rax, %rcx
movq -0x110(%rbp), %rax
movq %rcx, -0x158(%rbp)
movq 0x8(%rax), %rsi
movl 0x10(%rax), %edx
leaq -0xd0(%rbp), %rdi
movq %rdi, -0x150(%rbp)
callq 0x6f40
movq -0x158(%rbp), %rdi
movq -0x150(%rbp), %rsi
callq 0x3240
movq %rax, -0x148(%rbp)
jmp 0xa10c
movq -0x148(%rbp), %rdi
movq 0xaea6(%rip), %rsi      # 0x14fc0
callq 0x32c0
jmp 0xa121
leaq -0xd0(%rbp), %rdi
callq 0x34b8
movl -0x64(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0xa24e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0xd0(%rbp), %rdi
callq 0x34b8
jmp 0xa25a
movq -0x110(%rbp), %rdi
addq $0x420, %rdi            # imm = 0x420
movq %rdi, -0x180(%rbp)
leaq 0x6662(%rip), %rsi      # 0x107d3
callq 0x3270
movq %rax, %rdi
movq 0xae40(%rip), %rsi      # 0x14fc0
callq 0x32c0
movq -0x110(%rbp), %rdi
callq 0xa6e0
movq -0x110(%rbp), %rdi
movl %eax, %ecx
movl -0x64(%rbp), %eax
addl %ecx, %eax
movl %eax, -0x64(%rbp)
callq 0x9e00
movq -0x180(%rbp), %rdi
movl %eax, %ecx
movl -0x64(%rbp), %eax
addl %ecx, %eax
movl %eax, -0x64(%rbp)
leaq 0x65d8(%rip), %rsi      # 0x10797
callq 0x3270
movq %rax, %rcx
movq -0x110(%rbp), %rax
movq %rcx, -0x178(%rbp)
movq 0x8(%rax), %rsi
movl 0x10(%rax), %edx
leaq -0xf0(%rbp), %rdi
movq %rdi, -0x170(%rbp)
callq 0x6f40
movq -0x178(%rbp), %rdi
movq -0x170(%rbp), %rsi
callq 0x3240
movq %rax, -0x168(%rbp)
jmp 0xa20b
movq -0x168(%rbp), %rdi
movq 0xada7(%rip), %rsi      # 0x14fc0
callq 0x32c0
jmp 0xa220
leaq -0xf0(%rbp), %rdi
callq 0x34b8
movl -0x64(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0xa24e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0xf0(%rbp), %rdi
callq 0x34b8
jmp 0xa25a
movl -0x4(%rbp), %eax
addq $0x180, %rsp            # imm = 0x180
popq %rbp
retq
movq -0x38(%rbp), %rdi
callq 0x3430
nopw %cs:(%rax,%rax)