// File: /workspace/github_cpp_makefile_star2_O3/AndrewAlbert[P]Compiler-Theory/SourceCode/parser.cpp
// Function: Parser::CheckToken(int)
bool Parser::CheckToken(int type){
	//skip all comment tokens
	while (token->type == T_COMMENT){
		*token = scanner->getToken();
	}

	if(token->line != currentLine ){
		currentLine = token->line;
		textLine = "";
	}
	//check that current token matches input type, if so move to next token
	if(token->type == type){
		textLine.append(" " + token->ascii);
		*token = scanner->getToken();
		return true;
	}
	else if(token->type == T_UNKNOWN){
			ReportError("Found unknown token " + token->ascii);
			*token = scanner->getToken();
		return CheckToken(type);
	}
	else if(token->type == T_EOF){
		return false;
	}
	else return false;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x148, %rsp            # imm = 0x148
movl %esi, %ebp
movq %rdi, %rbx
movq 0x80(%rdi), %rdx
cmpl $0x15c, 0x20(%rdx)      # imm = 0x15C
jne 0x5c99
leaq 0x40(%rsp), %r14
leaq 0x30(%rsp), %r13
leaq 0x20(%rsp), %r15
movq 0x88(%rbx), %rsi
movq %r15, %rdi
callq 0x31f0
movq 0x80(%rbx), %r12
movq %r12, %rdi
movq %r15, %rsi
callq 0x2270
addq $0x20, %r12
movl $0x108, %edx            # imm = 0x108
movq %r12, %rdi
movq %r14, %rsi
callq 0x2190
movq 0x20(%rsp), %rdi
cmpq %r13, %rdi
je 0x5c89
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x2200
movq 0x80(%rbx), %rdx
cmpl $0x15c, 0x20(%rdx)      # imm = 0x15C
je 0x5c3d
movl 0x24(%rdx), %eax
cmpl 0x78(%rbx), %eax
je 0x5cc4
movl %eax, 0x78(%rbx)
leaq 0x58(%rbx), %rdi
movq 0x60(%rbx), %rdx
leaq 0x14caa(%rip), %rcx     # 0x1a95d
xorl %esi, %esi
xorl %r8d, %r8d
callq 0x22e0
movq 0x80(%rbx), %rdx
movl 0x20(%rdx), %eax
cmpl %ebp, %eax
jne 0x5d6d
leaq 0x58(%rbx), %r14
leaq 0x135e2(%rip), %rsi     # 0x192bc
leaq 0x20(%rsp), %r15
movq %r15, %rdi
callq 0xdcc7
movq (%r15), %rsi
movq 0x8(%r15), %rdx
movq %r14, %rdi
callq 0x20c0
leaq 0x30(%rsp), %r15
movq -0x10(%r15), %rdi
cmpq %r15, %rdi
je 0x5d11
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x2200
movq 0x88(%rbx), %rsi
leaq 0x20(%rsp), %r14
movq %r14, %rdi
callq 0x31f0
movq 0x80(%rbx), %rbx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2270
addq $0x20, %rbx
leaq 0x40(%rsp), %r14
movl $0x108, %edx            # imm = 0x108
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2190
movq -0x20(%r14), %rdi
cmpq %r15, %rdi
je 0x5d66
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x2200
movb $0x1, %al
jmp 0x5e18
cmpl $0x15e, %eax            # imm = 0x15E
jne 0x5e16
leaq 0x13565(%rip), %rsi     # 0x192e4
movq %rsp, %r14
movq %r14, %rdi
callq 0xdcc7
movq %rbx, %rdi
movq %r14, %rsi
callq 0x5694
leaq 0x10(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x5db0
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x2200
movq 0x88(%rbx), %rsi
leaq 0x20(%rsp), %r14
movq %r14, %rdi
callq 0x31f0
movq 0x80(%rbx), %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0x2270
addq $0x20, %r15
leaq 0x40(%rsp), %r14
movl $0x108, %edx            # imm = 0x108
movq %r15, %rdi
movq %r14, %rsi
callq 0x2190
movq -0x20(%r14), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0x5e0a
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x2200
movq %rbx, %rdi
movl %ebp, %esi
callq 0x5c08
jmp 0x5e18
xorl %eax, %eax
addq $0x148, %rsp            # imm = 0x148
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x10(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x5e60
movq 0x10(%rsp), %rsi
jmp 0x5e58
movq %rax, %rbx
leaq 0x30(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x5e60
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x2200
movq %rbx, %rdi
callq 0x2330