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

	int errors = 0;
	if(token != LPAREN_T){
		errors ++;
		token = lex->GetToken();	
	} // end left paren if
	if(token == RPAREN_T){
	  ruleFile << "Using Rule 21" << endl;
	  ruleFile << "Exiting stmt_pair function; current token is: " << lex ->GetTokenName (token) << endl;
	  return errors;

	}
	token = lex->GetToken();
	ruleFile << "Using Rule 20" << endl;
	errors += stmt_pair_body();
	while(token != RPAREN_T){

		errors++;
		ReportError(string("expected a RPAREN_T in stmtpair, but found  " + lex->GetTokenName(token)));
		token = lex->GetToken();
	} // end right paren if 
	//token = lex->GetToken();
	ruleFile << "Exiting stmt_pair function; current token is: " << lex ->GetTokenName (token) << endl;

	return errors;

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x160, %rsp            # imm = 0x160
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rdi
movq %rdi, -0x108(%rbp)
addq $0x420, %rdi            # imm = 0x420
leaq 0x23bc(%rip), %rsi      # 0x10c74
callq 0x3270
movq %rax, %rcx
movq -0x108(%rbp), %rax
movq %rcx, -0x100(%rbp)
movq 0x8(%rax), %rsi
movl 0x10(%rax), %edx
leaq -0x30(%rbp), %rdi
movq %rdi, -0xf8(%rbp)
callq 0x6f40
movq -0x100(%rbp), %rdi
movq -0xf8(%rbp), %rsi
callq 0x3240
movq %rax, -0xf0(%rbp)
jmp 0xe901
movq -0xf0(%rbp), %rdi
leaq 0x1b45(%rip), %rsi      # 0x10454
callq 0x3270
movq %rax, -0x110(%rbp)
jmp 0xe91d
movq -0x108(%rbp), %rax
movq 0x8(%rax), %rsi
leaq -0x60(%rbp), %rdi
callq 0x6f80
jmp 0xe933
movq -0x110(%rbp), %rdi
leaq -0x60(%rbp), %rsi
callq 0x3240
movq %rax, -0x118(%rbp)
jmp 0xe94c
movq -0x118(%rbp), %rdi
movq 0x6666(%rip), %rsi      # 0x14fc0
callq 0x32c0
jmp 0xe961
leaq -0x60(%rbp), %rdi
callq 0x34b8
leaq -0x30(%rbp), %rdi
callq 0x34b8
movq -0x108(%rbp), %rax
movl $0x0, -0x64(%rbp)
cmpl $0x1f, 0x10(%rax)
je 0xe9df
movq -0x108(%rbp), %rax
movl -0x64(%rbp), %ecx
addl $0x1, %ecx
movl %ecx, -0x64(%rbp)
movq 0x8(%rax), %rdi
callq 0x5fd0
movl %eax, %ecx
movq -0x108(%rbp), %rax
movl %ecx, 0x10(%rax)
jmp 0xe9df
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0xe9d1
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 0xec9c
movq -0x108(%rbp), %rax
cmpl $0x20, 0x10(%rax)
jne 0xeac3
movq -0x108(%rbp), %rdi
addq $0x420, %rdi            # imm = 0x420
movq %rdi, -0x138(%rbp)
leaq 0x2298(%rip), %rsi      # 0x10ca4
callq 0x3270
movq %rax, %rdi
movq 0x65a5(%rip), %rsi      # 0x14fc0
callq 0x32c0
movq -0x138(%rbp), %rdi
leaq 0x2284(%rip), %rsi      # 0x10cb2
callq 0x3270
movq %rax, %rcx
movq -0x108(%rbp), %rax
movq %rcx, -0x130(%rbp)
movq 0x8(%rax), %rsi
movl 0x10(%rax), %edx
leaq -0x88(%rbp), %rdi
movq %rdi, -0x128(%rbp)
callq 0x6f40
movq -0x130(%rbp), %rdi
movq -0x128(%rbp), %rsi
callq 0x3240
movq %rax, -0x120(%rbp)
jmp 0xea7a
movq -0x120(%rbp), %rdi
movq 0x6538(%rip), %rsi      # 0x14fc0
callq 0x32c0
jmp 0xea8f
leaq -0x88(%rbp), %rdi
callq 0x34b8
movl -0x64(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0xec90
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x88(%rbp), %rdi
callq 0x34b8
jmp 0xec9c
movq -0x108(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x5fd0
movq -0x108(%rbp), %rdi
movl %eax, 0x10(%rdi)
addq $0x420, %rdi            # imm = 0x420
leaq 0x21f6(%rip), %rsi      # 0x10ce1
callq 0x3270
movq %rax, %rdi
movq 0x64c6(%rip), %rsi      # 0x14fc0
callq 0x32c0
movq -0x108(%rbp), %rdi
callq 0xecb0
addl -0x64(%rbp), %eax
movl %eax, -0x64(%rbp)
movq -0x108(%rbp), %rax
cmpl $0x20, 0x10(%rax)
je 0xebec
movq -0x108(%rbp), %rax
movl -0x64(%rbp), %ecx
incl %ecx
movl %ecx, -0x64(%rbp)
movq 0x8(%rax), %rsi
movl 0x10(%rax), %edx
leaq -0xc8(%rbp), %rdi
movq %rdi, -0x140(%rbp)
callq 0x6f40
movq -0x140(%rbp), %rdx
leaq 0x2196(%rip), %rsi      # 0x10cef
leaq -0xa8(%rbp), %rdi
callq 0xf1b0
jmp 0xeb67
movq -0x108(%rbp), %rdi
leaq -0xa8(%rbp), %rsi
callq 0x91a0
jmp 0xeb7c
leaq -0xa8(%rbp), %rdi
callq 0x34b8
leaq -0xc8(%rbp), %rdi
callq 0x34b8
movq -0x108(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x5fd0
movl %eax, %ecx
movq -0x108(%rbp), %rax
movl %ecx, 0x10(%rax)
jmp 0xeb11
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0xebdb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0xa8(%rbp), %rdi
callq 0x34b8
leaq -0xc8(%rbp), %rdi
callq 0x34b8
jmp 0xec9c
movq -0x108(%rbp), %rdi
addq $0x420, %rdi            # imm = 0x420
leaq 0x20b1(%rip), %rsi      # 0x10cb2
callq 0x3270
movq %rax, %rcx
movq -0x108(%rbp), %rax
movq %rcx, -0x158(%rbp)
movq 0x8(%rax), %rsi
movl 0x10(%rax), %edx
leaq -0xe8(%rbp), %rdi
movq %rdi, -0x150(%rbp)
callq 0x6f40
movq -0x158(%rbp), %rdi
movq -0x150(%rbp), %rsi
callq 0x3240
movq %rax, -0x148(%rbp)
jmp 0xec4d
movq -0x148(%rbp), %rdi
movq 0x6365(%rip), %rsi      # 0x14fc0
callq 0x32c0
jmp 0xec62
leaq -0xe8(%rbp), %rdi
callq 0x34b8
movl -0x64(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0xec90
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0xe8(%rbp), %rdi
callq 0x34b8
jmp 0xec9c
movl -0x4(%rbp), %eax
addq $0x160, %rsp            # imm = 0x160
popq %rbp
retq
movq -0x38(%rbp), %rdi
callq 0x3430
nopw %cs:(%rax,%rax)