// File: menhits[P]phplus/src/Lexer.cpp
// Function: CharClassifier::get(std::shared_ptr<SourceFile>, int)
inline CharClassifier::Type CharClassifier::get(shared_ptr<SourceFile> file, int index)
{
	//	set up the first time this function is called
	if (!hasSetUp)
		setUp();
	
	//	chack fo multi line comments in a special way, because they are multi character
	
	switch ((*file)[index])
	{
	case '/':
		if (index<int(file->size())-1 && (*file)[index+1]=='/')
			return MULTI_LINE_COMMENT_START;
		break;
		
	case '\\':
		if (index>0 && (*file)[index-1]=='\\')
			return MULTI_LINE_COMMENT_END;
		break;
		
	case '.': // allow a . to be a digit character only if it is followed by a digit
		if (index<int(file->size())-1)
		{
			auto i=hm.find((*file)[index+1]);
		
			if (i!=hm.end() && i->second==DIGIT)
				return DIGIT;
		}
		break;
	}
	
	//	handle all other cases using the hashmap
	char c=(*file)[index];
	
	auto i=hm.find(c);
	
	if (i==hm.end())
		return UNKNOWN;
	else
		return i->second;
}

// Assembly:
subq $0x78, %rsp
movq %rsi, 0x18(%rsp)
movq %rdi, 0x68(%rsp)
movq %rsi, 0x60(%rsp)
movl %edx, 0x5c(%rsp)
movq 0x68(%rsp), %rax
movq %rax, 0x20(%rsp)
testb $0x1, 0x38(%rax)
jne 0x36a21
movq 0x20(%rsp), %rdi
callq 0x358a0
movq 0x18(%rsp), %rdi
callq 0x36fe0
movq %rax, %rdi
movl 0x5c(%rsp), %esi
callq 0x37010
movsbl %al, %eax
movl %eax, 0x14(%rsp)
subl $0x2e, %eax
je 0x36af6
jmp 0x36a49
movl 0x14(%rsp), %eax
subl $0x2f, %eax
je 0x36a62
jmp 0x36a54
movl 0x14(%rsp), %eax
subl $0x5c, %eax
je 0x36abc
jmp 0x36bac
movq 0x18(%rsp), %rdi
movl 0x5c(%rsp), %eax
movl %eax, 0x10(%rsp)
callq 0x35780
movq %rax, %rdi
callq 0x369d0
movl %eax, %ecx
movl 0x10(%rsp), %eax
subl $0x1, %ecx
cmpl %ecx, %eax
jge 0x36ab7
movq 0x18(%rsp), %rdi
callq 0x36fe0
movq %rax, %rdi
movl 0x5c(%rsp), %esi
addl $0x1, %esi
callq 0x37010
movsbl %al, %eax
cmpl $0x2f, %eax
jne 0x36ab7
movl $0x8, 0x74(%rsp)
jmp 0x36c19
jmp 0x36bac
cmpl $0x0, 0x5c(%rsp)
jle 0x36af1
movq 0x18(%rsp), %rdi
callq 0x36fe0
movq %rax, %rdi
movl 0x5c(%rsp), %esi
subl $0x1, %esi
callq 0x37010
movsbl %al, %eax
cmpl $0x5c, %eax
jne 0x36af1
movl $0x9, 0x74(%rsp)
jmp 0x36c19
jmp 0x36bac
movq 0x18(%rsp), %rdi
movl 0x5c(%rsp), %eax
movl %eax, 0xc(%rsp)
callq 0x35780
movq %rax, %rdi
callq 0x369d0
movl %eax, %ecx
movl 0xc(%rsp), %eax
subl $0x1, %ecx
cmpl %ecx, %eax
jge 0x36baa
movq 0x18(%rsp), %rdi
callq 0x36fe0
movq %rax, %rdi
movl 0x5c(%rsp), %esi
addl $0x1, %esi
callq 0x37010
movq 0x20(%rsp), %rdi
movb %al, 0x4f(%rsp)
leaq 0x4f(%rsp), %rsi
callq 0x376c0
movq 0x20(%rsp), %rdi
movq %rax, 0x50(%rsp)
callq 0x37710
movq %rax, 0x40(%rsp)
leaq 0x50(%rsp), %rdi
leaq 0x40(%rsp), %rsi
callq 0x376f0
movb %al, %cl
xorl %eax, %eax
testb $0x1, %cl
movb %al, 0xb(%rsp)
jne 0x36b7f
jmp 0x36b94
leaq 0x50(%rsp), %rdi
callq 0x37740
cmpl $0x4, 0x4(%rax)
sete %al
movb %al, 0xb(%rsp)
movb 0xb(%rsp), %al
testb $0x1, %al
jne 0x36b9e
jmp 0x36ba8
movl $0x4, 0x74(%rsp)
jmp 0x36c19
jmp 0x36baa
jmp 0x36bac
movq 0x18(%rsp), %rdi
callq 0x36fe0
movq %rax, %rdi
movl 0x5c(%rsp), %esi
callq 0x37010
movq 0x20(%rsp), %rdi
movb %al, 0x3f(%rsp)
leaq 0x3f(%rsp), %rsi
callq 0x376c0
movq 0x20(%rsp), %rdi
movq %rax, 0x30(%rsp)
callq 0x37710
movq %rax, 0x28(%rsp)
leaq 0x30(%rsp), %rdi
leaq 0x28(%rsp), %rsi
callq 0x37760
testb $0x1, %al
jne 0x36bfe
jmp 0x36c08
movl $0xa, 0x74(%rsp)
jmp 0x36c19
leaq 0x30(%rsp), %rdi
callq 0x37740
movl 0x4(%rax), %eax
movl %eax, 0x74(%rsp)
movl 0x74(%rsp), %eax
addq $0x78, %rsp
retq
nopw %cs:(%rax,%rax)
nopl (%rax)