// File: /workspace/github_cpp_makefile_star2_O1/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 0x67ca
movq %r15, %rdi
movq %r12, %rsi
callq 0xa2d2
movl %eax, %r15d
movq -0x88(%rbp), %rdi
cmpq %r13, %rdi
je 0x6d8c
movq -0x78(%rbp), %rsi
incq %rsi
callq 0x21e0
testb %r15b, %r15b
je 0x6f62
movl (%rbx), %r15d
cmpl %r14d, %r15d
jne 0x6e4c
movl 0x28(%rbx), %r14d
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 0x67ca
movl %r15d, %edi
movl %r14d, %esi
movq %r12, %rdx
callq 0xb321
leaq 0x8(%rbx), %r14
movq -0x68(%rbp), %rdi
cmpq %r13, %rdi
je 0x6deb
movq -0x58(%rbp), %rsi
incq %rsi
callq 0x21e0
movq 0x30(%rbx), %rsi
leaq -0x200(%rbp), %r15
movq %r15, %rdi
callq 0x9a6e
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 0x6e3a
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 0x534e(%rip), %rsi      # 0xc1b0
movl $0x15, %edx
movq %r15, %rdi
callq 0x2210
movl 0x28(%rbx), %esi
leaq -0x200(%rbp), %rdi
callq 0x2380
leaq 0x5357(%rip), %rsi      # 0xc1dc
leaq -0x200(%rbp), %rdi
movl $0x13, %edx
callq 0x2210
movl (%rbx), %eax
shlq $0x5, %rax
leaq 0x9d95(%rip), %r15      # 0x10c38
movq (%rax,%r15), %rsi
movq 0x8(%rax,%r15), %rdx
leaq -0x200(%rbp), %rdi
callq 0x2210
leaq 0x5331(%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 0x531e(%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 0x90a2(%rip), %rsi      # 0xfff0
movq 0x906b(%rip), %rdx      # 0xffc0
movq %r14, %rdi
callq 0x2370
jmp 0x7005
leaq -0x200(%rbp), %r14
movq %r14, %rdi
callq 0x2290
leaq 0x5238(%rip), %rsi      # 0xc1b0
movl $0x15, %edx
movq %r14, %rdi
callq 0x2210
movl 0x28(%rbx), %esi
leaq -0x200(%rbp), %rdi
callq 0x2380
leaq 0x522b(%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 0x8ffa(%rip), %rsi      # 0xfff0
movq 0x8fc3(%rip), %rdx      # 0xffc0
movq %r14, %rdi
callq 0x2370
jmp 0x7009
jmp 0x7027
movq %rax, %rbx
leaq -0x38(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x702d
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x21e0
jmp 0x702d
movq %rax, %rbx
movb $0x1, %r15b
testb %r15b, %r15b
je 0x7056
movq %r14, %rdi
callq 0x2160
jmp 0x7056
jmp 0x7053
movq %rax, %rbx
movq -0x88(%rbp), %rdi
cmpq %r13, %rdi
je 0x708f
movq -0x78(%rbp), %rsi
jmp 0x7087
movq %rax, %rbx
movq 0x8f6b(%rip), %rsi      # 0xffc8
leaq -0x200(%rbp), %rdi
callq 0x2110
leaq -0x190(%rbp), %rdi
callq 0x20a0
jmp 0x708f
movq %rax, %rbx
movq -0x68(%rbp), %rdi
cmpq %r13, %rdi
je 0x708f
movq -0x58(%rbp), %rsi
incq %rsi
callq 0x21e0
movq %rbx, %rdi
callq 0x2390
nop