// File: mhe[P]raytracerframework_cpp/yaml/scanner.cpp
// Function: YAML::Scanner::ScanNextToken()
void Scanner::ScanNextToken()
	{
		if(m_endedStream)
			return;

		if(!m_startedStream)
			return StartStream();

		// get rid of whitespace, etc. (in between tokens it should be irrelevent)
		ScanToNextToken();

		// check the latest simple key
		VerifySimpleKey();

		// maybe need to end some blocks
		PopIndentTo(INPUT.column);

		// *****
		// And now branch based on the next few characters!
		// *****

		// end of stream
		if(INPUT.peek() == EOF)
			return EndStream();

		if(INPUT.column == 0 && INPUT.peek() == Keys::Directive)
			return ScanDirective();

		// document token
		if(INPUT.column == 0 && Exp::DocStart.Matches(INPUT))
			return ScanDocStart();

		if(INPUT.column == 0 && Exp::DocEnd.Matches(INPUT))
			return ScanDocEnd();

		// flow start/end/entry
		if(INPUT.peek() == Keys::FlowSeqStart || INPUT.peek() == Keys::FlowMapStart)
			return ScanFlowStart();

		if(INPUT.peek() == Keys::FlowSeqEnd || INPUT.peek() == Keys::FlowMapEnd)
			return ScanFlowEnd();
	
		if(INPUT.peek() == Keys::FlowEntry)
			return ScanFlowEntry();

		// block/map stuff
		if(Exp::BlockEntry.Matches(INPUT))
			return ScanBlockEntry();

		if((m_flowLevel == 0 ? Exp::Key : Exp::KeyInFlow).Matches(INPUT))
			return ScanKey();

		if((m_flowLevel == 0 ? Exp::Value : Exp::ValueInFlow).Matches(INPUT))
			return ScanValue();

		// alias/anchor
		if(INPUT.peek() == Keys::Alias || INPUT.peek() == Keys::Anchor)
			return ScanAnchorOrAlias();

		// tag
		if(INPUT.peek() == Keys::Tag)
			return ScanTag();

		// special scalars
		if(m_flowLevel == 0 && (INPUT.peek() == Keys::LiteralScalar || INPUT.peek() == Keys::FoldedScalar))
			return ScanBlockScalar();

		if(INPUT.peek() == '\'' || INPUT.peek() == '\"')
			return ScanQuotedScalar();

		// plain scalars
		if((m_flowLevel == 0 ? Exp::PlainScalar : Exp::PlainScalarInFlow).Matches(INPUT))
			return ScanPlainScalar();

		// don't know what it is!
		throw ParserException(INPUT.line, INPUT.column, ErrorMsg::UNKNOWN_TOKEN);
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x20(%rbp)
testb $0x1, 0x61(%rax)
je 0x405df
jmp 0x4093d
movq -0x20(%rbp), %rax
testb $0x1, 0x60(%rax)
jne 0x405f7
movq -0x20(%rbp), %rdi
callq 0x40950
jmp 0x4093d
movq -0x20(%rbp), %rdi
callq 0x40990
movq -0x20(%rbp), %rdi
xorl %esi, %esi
callq 0x49ba0
movq -0x20(%rbp), %rdi
movl 0xc(%rdi), %esi
callq 0x40a90
movq -0x20(%rbp), %rdi
callq 0x4a840
movsbl %al, %eax
cmpl $-0x1, %eax
jne 0x40636
movq -0x20(%rbp), %rdi
callq 0x40b80
jmp 0x4093d
movq -0x20(%rbp), %rax
cmpl $0x0, 0xc(%rax)
jne 0x4065f
movq -0x20(%rbp), %rdi
callq 0x4a840
movsbl %al, %eax
cmpl $0x25, %eax
jne 0x4065f
movq -0x20(%rbp), %rdi
callq 0x45300
jmp 0x4093d
movq -0x20(%rbp), %rax
cmpl $0x0, 0xc(%rax)
jne 0x4068d
movq -0x20(%rbp), %rsi
leaq 0x2bd5c(%rip), %rdi     # 0x6c3d0
callq 0x3c550
testb $0x1, %al
jne 0x4067f
jmp 0x4068d
movq -0x20(%rbp), %rdi
callq 0x45640
jmp 0x4093d
movq -0x20(%rbp), %rax
cmpl $0x0, 0xc(%rax)
jne 0x406bb
movq -0x20(%rbp), %rsi
leaq 0x2bd5e(%rip), %rdi     # 0x6c400
callq 0x3c550
testb $0x1, %al
jne 0x406ad
jmp 0x406bb
movq -0x20(%rbp), %rdi
callq 0x456f0
jmp 0x4093d
movq -0x20(%rbp), %rdi
callq 0x4a840
movsbl %al, %eax
cmpl $0x5b, %eax
je 0x406dd
movq -0x20(%rbp), %rdi
callq 0x4a840
movsbl %al, %eax
cmpl $0x7b, %eax
jne 0x406eb
movq -0x20(%rbp), %rdi
callq 0x457a0
jmp 0x4093d
movq -0x20(%rbp), %rdi
callq 0x4a840
movsbl %al, %eax
cmpl $0x5d, %eax
je 0x4070d
movq -0x20(%rbp), %rdi
callq 0x4a840
movsbl %al, %eax
cmpl $0x7d, %eax
jne 0x4071b
movq -0x20(%rbp), %rdi
callq 0x45860
jmp 0x4093d
movq -0x20(%rbp), %rdi
callq 0x4a840
movsbl %al, %eax
cmpl $0x2c, %eax
jne 0x4073a
movq -0x20(%rbp), %rdi
callq 0x45980
jmp 0x4093d
movq -0x20(%rbp), %rsi
leaq 0x2bd1b(%rip), %rdi     # 0x6c460
callq 0x3c550
testb $0x1, %al
jne 0x40750
jmp 0x4075e
movq -0x20(%rbp), %rdi
callq 0x45a20
jmp 0x4093d
movq -0x20(%rbp), %rax
cmpl $0x0, 0x64(%rax)
jne 0x40775
leaq 0x2bd21(%rip), %rax     # 0x6c490
movq %rax, -0x28(%rbp)
jmp 0x40782
leaq 0x2bd44(%rip), %rax     # 0x6c4c0
movq %rax, -0x28(%rbp)
jmp 0x40782
movq -0x20(%rbp), %rsi
movq -0x28(%rbp), %rdi
callq 0x3c550
testb $0x1, %al
jne 0x40795
jmp 0x407a3
movq -0x20(%rbp), %rdi
callq 0x45bb0
jmp 0x4093d
movq -0x20(%rbp), %rax
cmpl $0x0, 0x64(%rax)
jne 0x407ba
leaq 0x2bd3c(%rip), %rax     # 0x6c4f0
movq %rax, -0x30(%rbp)
jmp 0x407c7
leaq 0x2bd5f(%rip), %rax     # 0x6c520
movq %rax, -0x30(%rbp)
jmp 0x407c7
movq -0x20(%rbp), %rsi
movq -0x30(%rbp), %rdi
callq 0x3c550
testb $0x1, %al
jne 0x407da
jmp 0x407e8
movq -0x20(%rbp), %rdi
callq 0x45cf0
jmp 0x4093d
movq -0x20(%rbp), %rdi
callq 0x4a840
movsbl %al, %eax
cmpl $0x2a, %eax
je 0x4080a
movq -0x20(%rbp), %rdi
callq 0x4a840
movsbl %al, %eax
cmpl $0x26, %eax
jne 0x40818
movq -0x20(%rbp), %rdi
callq 0x45e40
jmp 0x4093d
movq -0x20(%rbp), %rdi
callq 0x4a840
movsbl %al, %eax
cmpl $0x21, %eax
jne 0x40837
movq -0x20(%rbp), %rdi
callq 0x46170
jmp 0x4093d
movq -0x20(%rbp), %rax
cmpl $0x0, 0x64(%rax)
jne 0x40871
movq -0x20(%rbp), %rdi
callq 0x4a840
movsbl %al, %eax
cmpl $0x7c, %eax
je 0x40863
movq -0x20(%rbp), %rdi
callq 0x4a840
movsbl %al, %eax
cmpl $0x3e, %eax
jne 0x40871
movq -0x20(%rbp), %rdi
callq 0x46aa0
jmp 0x4093d
movq -0x20(%rbp), %rdi
callq 0x4a840
movsbl %al, %eax
cmpl $0x27, %eax
je 0x40893
movq -0x20(%rbp), %rdi
callq 0x4a840
movsbl %al, %eax
cmpl $0x22, %eax
jne 0x408a1
movq -0x20(%rbp), %rdi
callq 0x46770
jmp 0x4093d
movq -0x20(%rbp), %rax
cmpl $0x0, 0x64(%rax)
jne 0x408b8
leaq 0x2bcfe(%rip), %rax     # 0x6c5b0
movq %rax, -0x38(%rbp)
jmp 0x408c5
leaq 0x2bd21(%rip), %rax     # 0x6c5e0
movq %rax, -0x38(%rbp)
jmp 0x408c5
movq -0x20(%rbp), %rsi
movq -0x38(%rbp), %rdi
callq 0x3c550
testb $0x1, %al
jne 0x408d8
jmp 0x408e3
movq -0x20(%rbp), %rdi
callq 0x464a0
jmp 0x4093d
movl $0x30, %edi
callq 0x51b0
movq %rax, %rdi
movq -0x20(%rbp), %rax
movq %rdi, %rcx
movq %rcx, -0x40(%rbp)
movl 0x8(%rax), %esi
movl 0xc(%rax), %edx
leaq 0x2b738(%rip), %rcx     # 0x6c040
callq 0x340e0
jmp 0x4090f
movq -0x40(%rbp), %rdi
leaq 0x26ce6(%rip), %rsi     # 0x67600
leaq -0xc7f1(%rip), %rdx     # 0x34130
callq 0x5690
movq -0x40(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x10(%rbp)
movl %eax, -0x14(%rbp)
callq 0x52c0
jmp 0x40943
addq $0x40, %rsp
popq %rbp
retq
movq -0x10(%rbp), %rdi
callq 0x56c0
nopl (%rax)