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

	int errors = 0;
	if (token == ELSE_T){
		//rule 23
	   ruleFile << "Using Rule 23" << endl;
		token = lex->GetToken();
		errors += stmt();
		if (token != RPAREN_T){
			errors++;
			ReportError(string("expected a RPAREN_T in stmt_pair_body, but found  " + lex->GetTokenName(token)));
		}
		else
		   token = lex->GetToken();
	}

	if(token == NUMLIT_T || token == STRLIT_T || token == SQUOTE_T ||token == IDENT_T || token== LPAREN_T) {
		//rule 22
	   ruleFile << "Using Rule 22" << endl;
		errors += stmt();
		errors += stmt();
		if (token != RPAREN_T){
			errors++;
			ReportError(string("expected a RPAREN_T in stmt_pair_body, but found  " + lex->GetTokenName(token)));
		}
		token = lex->GetToken();
		errors += stmt_pair();
	}

	ruleFile << "Exiting Stmt_Pair_Body function; current token is: " << lex->GetTokenName(token) << endl;

	return errors;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x160, %rsp            # imm = 0x160
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x120(%rbp)
addq $0x420, %rdi            # imm = 0x420
leaq 0x2044(%rip), %rsi      # 0x10d1c
callq 0x3270
movq %rax, %rcx
movq -0x120(%rbp), %rax
movq %rcx, -0x118(%rbp)
movq 0x8(%rax), %rsi
movl 0x10(%rax), %edx
leaq -0x28(%rbp), %rdi
movq %rdi, -0x110(%rbp)
callq 0x6f40
movq -0x118(%rbp), %rdi
movq -0x110(%rbp), %rsi
callq 0x3240
movq %rax, -0x108(%rbp)
jmp 0xed21
movq -0x108(%rbp), %rdi
leaq 0x1725(%rip), %rsi      # 0x10454
callq 0x3270
movq %rax, -0x128(%rbp)
jmp 0xed3d
movq -0x120(%rbp), %rax
movq 0x8(%rax), %rsi
leaq -0x58(%rbp), %rdi
callq 0x6f80
jmp 0xed53
movq -0x128(%rbp), %rdi
leaq -0x58(%rbp), %rsi
callq 0x3240
movq %rax, -0x130(%rbp)
jmp 0xed6c
movq -0x130(%rbp), %rdi
movq 0x6246(%rip), %rsi      # 0x14fc0
callq 0x32c0
jmp 0xed81
leaq -0x58(%rbp), %rdi
callq 0x34b8
leaq -0x28(%rbp), %rdi
callq 0x34b8
movq -0x120(%rbp), %rax
movl $0x0, -0x5c(%rbp)
cmpl $0x15, 0x10(%rax)
jne 0xeefd
movq -0x120(%rbp), %rdi
addq $0x420, %rdi            # imm = 0x420
leaq 0x1f91(%rip), %rsi      # 0x10d51
callq 0x3270
movq %rax, %rdi
movq 0x61f1(%rip), %rsi      # 0x14fc0
callq 0x32c0
movq -0x120(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x5fd0
movq -0x120(%rbp), %rdi
movl %eax, 0x10(%rdi)
callq 0xa6e0
movl %eax, %ecx
movq -0x120(%rbp), %rax
addl -0x5c(%rbp), %ecx
movl %ecx, -0x5c(%rbp)
cmpl $0x20, 0x10(%rax)
je 0xeedf
movq -0x120(%rbp), %rax
movl -0x5c(%rbp), %ecx
incl %ecx
movl %ecx, -0x5c(%rbp)
movq 0x8(%rax), %rsi
movl 0x10(%rax), %edx
leaq -0xa0(%rbp), %rdi
movq %rdi, -0x138(%rbp)
callq 0x6f40
movq -0x138(%rbp), %rdx
leaq 0x1f1c(%rip), %rsi      # 0x10d5f
leaq -0x80(%rbp), %rdi
callq 0xf1b0
jmp 0xee4e
movq -0x120(%rbp), %rdi
leaq -0x80(%rbp), %rsi
callq 0x91a0
jmp 0xee60
leaq -0x80(%rbp), %rdi
callq 0x34b8
leaq -0xa0(%rbp), %rdi
callq 0x34b8
jmp 0xeefb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
jmp 0xee9d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x58(%rbp), %rdi
callq 0x34b8
leaq -0x28(%rbp), %rdi
callq 0x34b8
jmp 0xf118
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
jmp 0xeece
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x80(%rbp), %rdi
callq 0x34b8
leaq -0xa0(%rbp), %rdi
callq 0x34b8
jmp 0xf118
movq -0x120(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x5fd0
movl %eax, %ecx
movq -0x120(%rbp), %rax
movl %ecx, 0x10(%rax)
jmp 0xeefd
movq -0x120(%rbp), %rax
cmpl $0x2, 0x10(%rax)
je 0xef42
movq -0x120(%rbp), %rax
cmpl $0x3, 0x10(%rax)
je 0xef42
movq -0x120(%rbp), %rax
cmpl $0x21, 0x10(%rax)
je 0xef42
movq -0x120(%rbp), %rax
cmpl $0x1, 0x10(%rax)
je 0xef42
movq -0x120(%rbp), %rax
cmpl $0x1f, 0x10(%rax)
jne 0xf072
movq -0x120(%rbp), %rdi
addq $0x420, %rdi            # imm = 0x420
leaq 0x1e3b(%rip), %rsi      # 0x10d92
callq 0x3270
movq %rax, %rdi
movq 0x605a(%rip), %rsi      # 0x14fc0
callq 0x32c0
movq -0x120(%rbp), %rdi
callq 0xa6e0
movq -0x120(%rbp), %rdi
addl -0x5c(%rbp), %eax
movl %eax, -0x5c(%rbp)
callq 0xa6e0
movl %eax, %ecx
movq -0x120(%rbp), %rax
addl -0x5c(%rbp), %ecx
movl %ecx, -0x5c(%rbp)
cmpl $0x20, 0x10(%rax)
je 0xf04d
movq -0x120(%rbp), %rax
movl -0x5c(%rbp), %ecx
incl %ecx
movl %ecx, -0x5c(%rbp)
movq 0x8(%rax), %rsi
movl 0x10(%rax), %edx
leaq -0xe0(%rbp), %rdi
movq %rdi, -0x140(%rbp)
callq 0x6f40
movq -0x140(%rbp), %rdx
leaq 0x1d86(%rip), %rsi      # 0x10d5f
leaq -0xc0(%rbp), %rdi
callq 0xf1b0
jmp 0xefe7
movq -0x120(%rbp), %rdi
leaq -0xc0(%rbp), %rsi
callq 0x91a0
jmp 0xeffc
leaq -0xc0(%rbp), %rdi
callq 0x34b8
leaq -0xe0(%rbp), %rdi
callq 0x34b8
jmp 0xf04d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
jmp 0xf03c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0xc0(%rbp), %rdi
callq 0x34b8
leaq -0xe0(%rbp), %rdi
callq 0x34b8
jmp 0xf118
movq -0x120(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x5fd0
movq -0x120(%rbp), %rdi
movl %eax, 0x10(%rdi)
callq 0xe890
addl -0x5c(%rbp), %eax
movl %eax, -0x5c(%rbp)
movq -0x120(%rbp), %rdi
addq $0x420, %rdi            # imm = 0x420
leaq 0x1d19(%rip), %rsi      # 0x10da0
callq 0x3270
movq %rax, %rcx
movq -0x120(%rbp), %rax
movq %rcx, -0x158(%rbp)
movq 0x8(%rax), %rsi
movl 0x10(%rax), %edx
leaq -0x100(%rbp), %rdi
movq %rdi, -0x150(%rbp)
callq 0x6f40
movq -0x158(%rbp), %rdi
movq -0x150(%rbp), %rsi
callq 0x3240
movq %rax, -0x148(%rbp)
jmp 0xf0d3
movq -0x148(%rbp), %rdi
movq 0x5edf(%rip), %rsi      # 0x14fc0
callq 0x32c0
jmp 0xf0e8
leaq -0x100(%rbp), %rdi
callq 0x34b8
movl -0x5c(%rbp), %eax
addq $0x160, %rsp            # imm = 0x160
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x100(%rbp), %rdi
callq 0x34b8
movq -0x30(%rbp), %rdi
callq 0x3430
nopw %cs:(%rax,%rax)
nopl (%rax,%rax)