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

	int errors = 0;
	if (token == EOF_T) {
		errors++;
		ReportError(string("Reached an EOF_T but expected something else in else part"));
		ruleFile << "Exiting else_part function; current token is: " << lex ->GetTokenName (token) << endl;
		return errors;
	} // end EOF if 
	if (token == RPAREN_T) {
		ruleFile << "Using Rule 19" << endl;
		ruleFile << "Exiting else_part function; current token is: " << lex ->GetTokenName (token) << endl;
		return errors;
	} // end Right paren if  
	ruleFile << "Using Rule 18" << endl;
	errors += stmt();
	ruleFile << "Exiting else_part 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 0x2757(%rip), %rsi      # 0x10bbf
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 0xe4b1
movq -0xf8(%rbp), %rdi
leaq 0x1f95(%rip), %rsi      # 0x10454
callq 0x3270
movq %rax, -0x118(%rbp)
jmp 0xe4cd
movq -0x110(%rbp), %rax
movq 0x8(%rax), %rsi
leaq -0x60(%rbp), %rdi
callq 0x6f80
jmp 0xe4e3
movq -0x118(%rbp), %rdi
leaq -0x60(%rbp), %rsi
callq 0x3240
movq %rax, -0x120(%rbp)
jmp 0xe4fc
movq -0x120(%rbp), %rdi
movq 0x6ab6(%rip), %rsi      # 0x14fc0
callq 0x32c0
jmp 0xe511
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 0xe6b1
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 0x268b(%rip), %rsi      # 0x10bef
leaq -0x88(%rbp), %rdi
callq 0x7040
jmp 0xe572
movq -0x110(%rbp), %rdi
leaq -0x88(%rbp), %rsi
callq 0x91a0
jmp 0xe587
leaq -0x88(%rbp), %rdi
callq 0x34b8
leaq -0x89(%rbp), %rdi
callq 0x32e0
movq -0x110(%rbp), %rdi
addq $0x420, %rdi            # imm = 0x420
leaq 0x2675(%rip), %rsi      # 0x10c29
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 0xe600
movq -0x130(%rbp), %rdi
movq 0x69b2(%rip), %rsi      # 0x14fc0
callq 0x32c0
jmp 0xe615
leaq -0xb0(%rbp), %rdi
callq 0x34b8
movl -0x64(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0xe878
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0xe64f
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 0xe884
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0xe683
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 0xe884
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0xb0(%rbp), %rdi
callq 0x34b8
jmp 0xe884
movq -0x110(%rbp), %rax
cmpl $0x20, 0x10(%rax)
jne 0xe795
movq -0x110(%rbp), %rdi
addq $0x420, %rdi            # imm = 0x420
movq %rdi, -0x160(%rbp)
leaq 0x257a(%rip), %rsi      # 0x10c58
callq 0x3270
movq %rax, %rdi
movq 0x68d3(%rip), %rsi      # 0x14fc0
callq 0x32c0
movq -0x160(%rbp), %rdi
leaq 0x2529(%rip), %rsi      # 0x10c29
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 0xe74c
movq -0x148(%rbp), %rdi
movq 0x6866(%rip), %rsi      # 0x14fc0
callq 0x32c0
jmp 0xe761
leaq -0xd0(%rbp), %rdi
callq 0x34b8
movl -0x64(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0xe878
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0xd0(%rbp), %rdi
callq 0x34b8
jmp 0xe884
movq -0x110(%rbp), %rdi
addq $0x420, %rdi            # imm = 0x420
movq %rdi, -0x180(%rbp)
leaq 0x24b5(%rip), %rsi      # 0x10c66
callq 0x3270
movq %rax, %rdi
movq 0x6800(%rip), %rsi      # 0x14fc0
callq 0x32c0
movq -0x110(%rbp), %rdi
callq 0xa6e0
movq -0x180(%rbp), %rdi
movl %eax, %ecx
movl -0x64(%rbp), %eax
addl %ecx, %eax
movl %eax, -0x64(%rbp)
leaq 0x2440(%rip), %rsi      # 0x10c29
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 0xe835
movq -0x168(%rbp), %rdi
movq 0x677d(%rip), %rsi      # 0x14fc0
callq 0x32c0
jmp 0xe84a
leaq -0xf0(%rbp), %rdi
callq 0x34b8
movl -0x64(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0xe878
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0xf0(%rbp), %rdi
callq 0x34b8
jmp 0xe884
movl -0x4(%rbp), %eax
addq $0x180, %rsp            # imm = 0x180
popq %rbp
retq
movq -0x38(%rbp), %rdi
callq 0x3430
nopl (%rax)