// File: /workspace/github_cpp_makefile_star2_O3/Blaze2305[P]Compiler-Design-2021-Assignment/src/Parser/Parser.cpp
// Function: Parser::accept(TokenType)
void Parser::accept(TokenType expected){
	if(expected == Identifier && identifierCheckFlag){
		if(!this->symtab.checkIfSymbolExists(currentToken.Value)){
			std::ostringstream out;
			out << "Syntax error on line ";
			out << currentToken.lineNumber;
			out << "  UNKNOWN IDENTIFIER ";
			out << currentToken.Value;
			throw  std::runtime_error(out.str());
		}
	}
	if(currentToken.tokenType == expected){
		printAcceptedToken(currentToken.tokenType,currentToken.lineNumber,currentToken.Value);
		currentToken =  scanner->getToken();
	}else{
		std::ostringstream out;
		out << "Syntax error on line ";
		out << currentToken.lineNumber;
		out << "  CURRENT TOKEN IS ";
		out << TOKEN_ENUM_TYPE_NAMES[currentToken.tokenType];
		out << "  CURRENT TOKEN NAME IS ";
		out << currentToken.Value;
		out << " BUT EXPECTED TOKEN IS ";
		out << TOKEN_ENUM_TYPE_NAMES[expected];
		throw  std::runtime_error(out.str());
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1d8, %rsp            # imm = 0x1D8
movl %esi, %r14d
movq %rdi, %rbx
testl %esi, %esi
jne 0x6d95
cmpb $0x1, 0x6c(%rbx)
jne 0x6d95
leaq 0x38(%rbx), %r15
leaq -0x78(%rbp), %r13
movq %r13, -0x10(%r13)
movq 0x8(%rbx), %rsi
movq 0x10(%rbx), %rdx
addq %rsi, %rdx
leaq -0x88(%rbp), %r12
movq %r12, %rdi
callq 0x67c4
movq %r15, %rdi
movq %r12, %rsi
callq 0xa270
movl %eax, %r15d
movq -0x88(%rbp), %rdi
cmpq %r13, %rdi
je 0x6d8c
movq -0x78(%rbp), %rsi
incq %rsi
callq 0x21e0
testb %r15b, %r15b
je 0x6f5f
cmpl %r14d, (%rbx)
jne 0x6e49
movl 0x28(%rbx), %r15d
leaq -0x58(%rbp), %r13
movq %r13, -0x10(%r13)
movq 0x8(%rbx), %rsi
movq 0x10(%rbx), %rdx
addq %rsi, %rdx
leaq -0x68(%rbp), %r12
movq %r12, %rdi
callq 0x67c4
movl %r14d, %edi
movl %r15d, %esi
movq %r12, %rdx
callq 0xb2ed
leaq 0x8(%rbx), %r14
movq -0x68(%rbp), %rdi
cmpq %r13, %rdi
je 0x6de8
movq -0x58(%rbp), %rsi
incq %rsi
callq 0x21e0
movq 0x30(%rbx), %rsi
leaq -0x200(%rbp), %r15
movq %r15, %rdi
callq 0x9a32
movl (%r15), %eax
movl %eax, (%rbx)
leaq -0x1f8(%rbp), %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0x2260
movl 0x20(%r15), %eax
movl %eax, 0x28(%rbx)
movq (%r15), %rdi
leaq -0x1e8(%rbp), %rax
cmpq %rax, %rdi
je 0x6e37
movq -0x1e8(%rbp), %rsi
incq %rsi
callq 0x21e0
addq $0x1d8, %rsp            # imm = 0x1D8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq -0x200(%rbp), %r15
movq %r15, %rdi
callq 0x2290
leaq 0x5351(%rip), %rsi      # 0xc1b0
movl $0x15, %edx
movq %r15, %rdi
callq 0x2210
movl 0x28(%rbx), %esi
leaq -0x200(%rbp), %rdi
callq 0x2380
leaq 0x535a(%rip), %rsi      # 0xc1dc
leaq -0x200(%rbp), %rdi
movl $0x13, %edx
callq 0x2210
movl (%rbx), %eax
shlq $0x5, %rax
leaq 0x9d98(%rip), %r15      # 0x10c38
movq (%rax,%r15), %rsi
movq 0x8(%rax,%r15), %rdx
leaq -0x200(%rbp), %rdi
callq 0x2210
leaq 0x5334(%rip), %rsi      # 0xc1f0
leaq -0x200(%rbp), %rdi
movl $0x18, %edx
callq 0x2210
movq 0x8(%rbx), %rsi
movq 0x10(%rbx), %rdx
leaq -0x200(%rbp), %rdi
callq 0x2210
leaq 0x5321(%rip), %rsi      # 0xc209
leaq -0x200(%rbp), %rdi
movl $0x17, %edx
callq 0x2210
movl %r14d, %eax
shlq $0x5, %rax
movq (%rax,%r15), %rsi
movq 0x8(%rax,%r15), %rdx
leaq -0x200(%rbp), %rdi
callq 0x2210
movl $0x10, %edi
callq 0x20f0
movq %rax, %r14
leaq -0x1f8(%rbp), %rsi
leaq -0x48(%rbp), %rdi
callq 0x2310
movb $0x1, %r15b
leaq -0x48(%rbp), %rsi
movq %r14, %rdi
callq 0x2320
xorl %r15d, %r15d
movq 0x90a5(%rip), %rsi      # 0xfff0
movq 0x906e(%rip), %rdx      # 0xffc0
movq %r14, %rdi
callq 0x2370
jmp 0x7002
leaq -0x200(%rbp), %r14
movq %r14, %rdi
callq 0x2290
leaq 0x523b(%rip), %rsi      # 0xc1b0
movl $0x15, %edx
movq %r14, %rdi
callq 0x2210
movl 0x28(%rbx), %esi
leaq -0x200(%rbp), %rdi
callq 0x2380
leaq 0x522e(%rip), %rsi      # 0xc1c6
leaq -0x200(%rbp), %rdi
movl $0x15, %edx
callq 0x2210
movq 0x8(%rbx), %rsi
movq 0x10(%rbx), %rdx
leaq -0x200(%rbp), %rdi
callq 0x2210
movl $0x10, %edi
callq 0x20f0
movq %rax, %r14
leaq -0x1f8(%rbp), %rsi
leaq -0x48(%rbp), %rdi
callq 0x2310
movb $0x1, %r15b
leaq -0x48(%rbp), %rsi
movq %r14, %rdi
callq 0x2320
xorl %r15d, %r15d
movq 0x8ffd(%rip), %rsi      # 0xfff0
movq 0x8fc6(%rip), %rdx      # 0xffc0
movq %r14, %rdi
callq 0x2370
jmp 0x7006
jmp 0x7029
movq %rax, %rbx
leaq -0x38(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x7022
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x21e0
testb %r15b, %r15b
jne 0x702c
jmp 0x7050
movq %rax, %rbx
movq %r14, %rdi
callq 0x2160
jmp 0x7050
jmp 0x704d
movq %rax, %rbx
movq -0x88(%rbp), %rdi
cmpq %r13, %rdi
je 0x7089
movq -0x78(%rbp), %rsi
jmp 0x7081
movq %rax, %rbx
movq 0x8f71(%rip), %rsi      # 0xffc8
leaq -0x200(%rbp), %rdi
callq 0x2110
leaq -0x190(%rbp), %rdi
callq 0x20a0
jmp 0x7089
movq %rax, %rbx
movq -0x68(%rbp), %rdi
cmpq %r13, %rdi
je 0x7089
movq -0x58(%rbp), %rsi
incq %rsi
callq 0x21e0
movq %rbx, %rdi
callq 0x2390
nop