// File: ssubrandon[P]460Project2/SyntacticalAnalyzer.cpp
// Function: SyntacticalAnalyzer::more_defines()
int SyntacticalAnalyzer::more_defines(){
  //This function more-defines deals with the more_defines rules( 2-3) and will check for syntactical correctness,
  //this function will, depending on the token seen, send the program too define, stmt, or stmt-list for
  //further analyzing.
	ruleFile << "Entering more_defines function; Current token is: " << lex ->GetTokenName(token) << ", lexeme: " << lex->GetLexeme() << endl;

	int errors = 0;
	if(token == IDENT_T){
		ruleFile << "Using Rule 3" << endl;
		token = lex->GetToken();
		errors += stmt_list();
		if(token != RPAREN_T){
			errors++;
			ReportError(string("expected a RPAREN_T in m_d, but found  " + lex->GetTokenName(token)));
		}
		token = lex->GetToken();
		ruleFile << "Exiting more_defines function; Current token is: " << lex ->GetTokenName (token) << endl; 

		return errors; 

	} 

	ruleFile << "Using Rule 2" << endl;
	errors += define();

	if(token != LPAREN_T){
		errors++;
		ReportError(string("expected a LPAREN_T in m_d, but found  " + lex->GetTokenName(token)));
	}
	token = lex->GetToken();

	errors+= more_defines();
	ruleFile << "Exiting more_defines function; current token is: " << lex ->GetTokenName (token) << endl;

	return errors;

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1a0, %rsp            # imm = 0x1A0
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rdi
movq %rdi, -0x148(%rbp)
addq $0x420, %rdi            # imm = 0x420
leaq 0x6bcd(%rip), %rsi      # 0x10525
callq 0x3270
movq %rax, %rcx
movq -0x148(%rbp), %rax
movq %rcx, -0x140(%rbp)
movq 0x8(%rax), %rsi
movl 0x10(%rax), %edx
leaq -0x30(%rbp), %rdi
movq %rdi, -0x138(%rbp)
callq 0x6f40
movq -0x140(%rbp), %rdi
movq -0x138(%rbp), %rsi
callq 0x3240
movq %rax, -0x130(%rbp)
jmp 0x99a1
movq -0x130(%rbp), %rdi
leaq 0x6aa5(%rip), %rsi      # 0x10454
callq 0x3270
movq %rax, -0x150(%rbp)
jmp 0x99bd
movq -0x148(%rbp), %rax
movq 0x8(%rax), %rsi
leaq -0x60(%rbp), %rdi
callq 0x6f80
jmp 0x99d3
movq -0x150(%rbp), %rdi
leaq -0x60(%rbp), %rsi
callq 0x3240
movq %rax, -0x158(%rbp)
jmp 0x99ec
movq -0x158(%rbp), %rdi
movq 0xb5c6(%rip), %rsi      # 0x14fc0
callq 0x32c0
jmp 0x9a01
leaq -0x60(%rbp), %rdi
callq 0x34b8
leaq -0x30(%rbp), %rdi
callq 0x34b8
movq -0x148(%rbp), %rax
movl $0x0, -0x64(%rbp)
cmpl $0x1, 0x10(%rax)
jne 0x9c25
movq -0x148(%rbp), %rdi
addq $0x420, %rdi            # imm = 0x420
leaq 0x6b18(%rip), %rsi      # 0x10558
callq 0x3270
movq %rax, %rdi
movq 0xb571(%rip), %rsi      # 0x14fc0
callq 0x32c0
movq -0x148(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x5fd0
movq -0x148(%rbp), %rdi
movl %eax, 0x10(%rdi)
callq 0x9e00
movl %eax, %ecx
movq -0x148(%rbp), %rax
addl -0x64(%rbp), %ecx
movl %ecx, -0x64(%rbp)
cmpl $0x20, 0x10(%rax)
je 0x9b68
movq -0x148(%rbp), %rax
movl -0x64(%rbp), %ecx
incl %ecx
movl %ecx, -0x64(%rbp)
movq 0x8(%rax), %rsi
movl 0x10(%rax), %edx
leaq -0xa8(%rbp), %rdi
movq %rdi, -0x160(%rbp)
callq 0x6f40
movq -0x160(%rbp), %rdx
leaq 0x6aa2(%rip), %rsi      # 0x10565
leaq -0x88(%rbp), %rdi
callq 0xf1b0
jmp 0x9ad1
movq -0x148(%rbp), %rdi
leaq -0x88(%rbp), %rsi
callq 0x91a0
jmp 0x9ae6
leaq -0x88(%rbp), %rdi
callq 0x34b8
leaq -0xa8(%rbp), %rdi
callq 0x34b8
jmp 0x9b68
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x9b23
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 0x9df7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x9b57
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x88(%rbp), %rdi
callq 0x34b8
leaq -0xa8(%rbp), %rdi
callq 0x34b8
jmp 0x9df7
movq -0x148(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x5fd0
movq -0x148(%rbp), %rdi
movl %eax, 0x10(%rdi)
addq $0x420, %rdi            # imm = 0x420
leaq 0x69fd(%rip), %rsi      # 0x1058d
callq 0x3270
movq %rax, %rcx
movq -0x148(%rbp), %rax
movq %rcx, -0x178(%rbp)
movq 0x8(%rax), %rsi
movl 0x10(%rax), %edx
leaq -0xc8(%rbp), %rdi
movq %rdi, -0x170(%rbp)
callq 0x6f40
movq -0x178(%rbp), %rdi
movq -0x170(%rbp), %rsi
callq 0x3240
movq %rax, -0x168(%rbp)
jmp 0x9bdc
movq -0x168(%rbp), %rdi
movq 0xb3d6(%rip), %rsi      # 0x14fc0
callq 0x32c0
jmp 0x9bf1
leaq -0xc8(%rbp), %rdi
callq 0x34b8
movl -0x64(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x9deb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0xc8(%rbp), %rdi
callq 0x34b8
jmp 0x9df7
movq -0x148(%rbp), %rdi
addq $0x420, %rdi            # imm = 0x420
leaq 0x6985(%rip), %rsi      # 0x105bf
callq 0x3270
movq %rax, %rdi
movq 0xb377(%rip), %rsi      # 0x14fc0
callq 0x32c0
movq -0x148(%rbp), %rdi
callq 0x92e0
movl %eax, %ecx
movq -0x148(%rbp), %rax
addl -0x64(%rbp), %ecx
movl %ecx, -0x64(%rbp)
cmpl $0x1f, 0x10(%rax)
je 0x9d1e
movq -0x148(%rbp), %rax
movl -0x64(%rbp), %ecx
incl %ecx
movl %ecx, -0x64(%rbp)
movq 0x8(%rax), %rsi
movl 0x10(%rax), %edx
leaq -0x108(%rbp), %rdi
movq %rdi, -0x180(%rbp)
callq 0x6f40
movq -0x180(%rbp), %rdx
leaq 0x6922(%rip), %rsi      # 0x105cc
leaq -0xe8(%rbp), %rdi
callq 0xf1b0
jmp 0x9cb8
movq -0x148(%rbp), %rdi
leaq -0xe8(%rbp), %rsi
callq 0x91a0
jmp 0x9ccd
leaq -0xe8(%rbp), %rdi
callq 0x34b8
leaq -0x108(%rbp), %rdi
callq 0x34b8
jmp 0x9d1e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x9d0d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0xe8(%rbp), %rdi
callq 0x34b8
leaq -0x108(%rbp), %rdi
callq 0x34b8
jmp 0x9df7
movq -0x148(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x5fd0
movq -0x148(%rbp), %rdi
movl %eax, 0x10(%rdi)
callq 0x9930
movq -0x148(%rbp), %rdi
movl %eax, %ecx
movl -0x64(%rbp), %eax
addl %ecx, %eax
movl %eax, -0x64(%rbp)
addq $0x420, %rdi            # imm = 0x420
leaq 0x6898(%rip), %rsi      # 0x105f4
callq 0x3270
movq %rax, %rcx
movq -0x148(%rbp), %rax
movq %rcx, -0x198(%rbp)
movq 0x8(%rax), %rsi
movl 0x10(%rax), %edx
leaq -0x128(%rbp), %rdi
movq %rdi, -0x190(%rbp)
callq 0x6f40
movq -0x198(%rbp), %rdi
movq -0x190(%rbp), %rsi
callq 0x3240
movq %rax, -0x188(%rbp)
jmp 0x9da8
movq -0x188(%rbp), %rdi
movq 0xb20a(%rip), %rsi      # 0x14fc0
callq 0x32c0
jmp 0x9dbd
leaq -0x128(%rbp), %rdi
callq 0x34b8
movl -0x64(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x9deb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x128(%rbp), %rdi
callq 0x34b8
jmp 0x9df7
movl -0x4(%rbp), %eax
addq $0x1a0, %rsp            # imm = 0x1A0
popq %rbp
retq
movq -0x38(%rbp), %rdi
callq 0x3430