// File: /workspace/github_cpp_makefile_star2_O1/menhits[P]phplus/src/Lexer.cpp
// Function: lexString(std::shared_ptr<SourceFile>, std::vector<std::shared_ptr<TokenData>, std::allocator<std::shared_ptr<TokenData>>>&)
void lexString(shared_ptr<SourceFile> file, vector<Token>& tokens)
{
	string tokenTxt;
	int line=1;
	int charPos=1;
	
	TokenData::Type type=TokenData::WHITESPACE;
	
	for (int i=0; i<file->size(); i++)
	{
		CharClassifier::Type charType=charClassifier.get(file, i);
		TokenData::Type newType=CharClassifier::getTokenType(charType, type);
		
		if (newType!=type)
		{
			if (!tokenTxt.empty())
			{
				if (type==TokenData::OPERATOR)
				{
					vector<Operator> opMatches;
					ops->get(tokenTxt, opMatches);
					
					for (auto op: opMatches)
					{
						tokens.push_back(makeToken(op->getText(), file, line, charPos-tokenTxt.size(), type, op));
					}
				}
				else if (type==TokenData::LINE_COMMENT || type==TokenData::BLOCK_COMMENT)
				{
					// do nothing
				}
				else
				{
					Token token=makeToken(tokenTxt, file, line, charPos-tokenTxt.size(), type);
					
					if (type==TokenData::UNKNOWN)
					{
						PhplusError("invalid token '"+tokenTxt+"'", SOURCE_ERROR, token).log();
					}
					else
					{
						tokens.push_back(token);
					}
				}
			}
			tokenTxt="";
		}
		
		if (newType!=TokenData::WHITESPACE && newType!=TokenData::LINE_END)
		{
			if (newType==TokenData::STRING_LITERAL && (*file)[i]=='\\')
			{
				i++;
				if ((*file)[i]=='n')
					tokenTxt+='\n';
				else if ((*file)[i]=='"')
					tokenTxt+='"';
				else if ((*file)[i]=='t')
					tokenTxt+='\t';
				else if ((*file)[i]=='\\')
					tokenTxt+='\\';
				else
					throw PhplusError(string()+"invalid escape character '\\"+(*file)[i]+"'", SOURCE_ERROR, makeToken(tokenTxt+(*file)[i], file, line, charPos-tokenTxt.size(), type));
			}
			else
			{
				tokenTxt+=(*file)[i];
			}
		}
		
		type=newType;
		
		if ((*file)[i]=='\n')
		{
			line++;
			charPos=1;
		}
		else
		{
			charPos++;
		}
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x238, %rsp            # imm = 0x238
movq %rsi, 0x68(%rsp)
leaq 0x28(%rsp), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
movq (%rdi), %rsi
cmpl $0x0, 0x28(%rsi)
jle 0x209dd
movq %rdi, %rbx
xorl %r12d, %r12d
movl $0x1, 0x14(%rsp)
movl $0x1, %r14d
xorl %r13d, %r13d
movq %rdi, 0x38(%rsp)
movq %rsi, 0xd0(%rsp)
movq 0x8(%rbx), %rax
movq %rax, 0xd8(%rsp)
testq %rax, %rax
je 0x20452
movq 0x78b64(%rip), %rcx     # 0x98fa8
cmpb $0x0, (%rcx)
je 0x2044e
incl 0x8(%rax)
jmp 0x20452
lock
incl 0x8(%rax)
leaq 0x78ebf(%rip), %rdi     # 0x99318
leaq 0xd0(%rsp), %rsi
movl %r13d, %edx
callq 0x20e5e
movl %eax, %r15d
movq 0xd8(%rsp), %rdi
testq %rdi, %rdi
je 0x2047e
callq 0xdcba
movl %r15d, %edi
movl %r12d, %esi
callq 0x20fde
cmpl %r12d, %eax
je 0x20933
movl %eax, 0x64(%rsp)
movq 0x20(%rsp), %rdx
testq %rdx, %rdx
je 0x20914
cmpl $0x5, %r12d
jne 0x2069f
xorps %xmm0, %xmm0
movaps %xmm0, 0xe0(%rsp)
movq $0x0, 0xf0(%rsp)
leaq 0x78e3c(%rip), %rax     # 0x99308
movq (%rax), %r15
leaq 0x1e0(%rsp), %rax
movq %rax, 0x1d0(%rsp)
movq 0x18(%rsp), %rsi
addq %rsi, %rdx
leaq 0x1d0(%rsp), %rbx
movq %rbx, %rdi
callq 0xdde2
movq %r15, %rdi
movq %rbx, %rsi
leaq 0xe0(%rsp), %rdx
callq 0xd99a
movq %r12, 0x158(%rsp)
movq 0x1d0(%rsp), %rdi
leaq 0x1e0(%rsp), %rax
cmpq %rax, %rdi
je 0x2052c
callq 0xa2b0
movq 0xe0(%rsp), %r12
movq 0xe8(%rsp), %rbx
cmpq %rbx, %r12
je 0x20700
movq (%r12), %rbp
movq 0x8(%r12), %r15
testq %r15, %r15
je 0x2056a
movq 0x78a4e(%rip), %rax     # 0x98fa8
cmpb $0x0, (%rax)
je 0x20565
incl 0x8(%r15)
jmp 0x2056a
lock
incl 0x8(%r15)
leaq 0x1c0(%rsp), %rax
movq %rax, 0x1b0(%rsp)
movq (%rbp), %rsi
movq 0x8(%rbp), %rdx
addq %rsi, %rdx
leaq 0x1b0(%rsp), %rdi
callq 0xdde2
movq 0x38(%rsp), %rcx
movq (%rcx), %rax
movq %rax, 0xc0(%rsp)
movq 0x8(%rcx), %rax
movq %rax, 0xc8(%rsp)
testq %rax, %rax
je 0x205c8
movq 0x789ee(%rip), %rcx     # 0x98fa8
cmpb $0x0, (%rcx)
je 0x205c4
incl 0x8(%rax)
jmp 0x205c8
lock
incl 0x8(%rax)
movl %r14d, %r8d
subl 0x20(%rsp), %r8d
movq %rbp, 0xb0(%rsp)
movq %r15, 0xb8(%rsp)
testq %r15, %r15
je 0x205fc
movq 0x789bc(%rip), %rax     # 0x98fa8
cmpb $0x0, (%rax)
je 0x205f7
incl 0x8(%r15)
jmp 0x205fc
lock
incl 0x8(%r15)
leaq 0xb0(%rsp), %rax
movq %rax, (%rsp)
leaq 0x40(%rsp), %rbp
movq %rbp, %rdi
leaq 0x1b0(%rsp), %rsi
leaq 0xc0(%rsp), %rdx
movl 0x14(%rsp), %ecx
movl $0x5, %r9d
callq 0x52e30
movq 0x68(%rsp), %rdi
movq %rbp, %rsi
callq 0x21626
movq 0x48(%rsp), %rdi
testq %rdi, %rdi
je 0x2064b
callq 0xdcba
movq 0xb8(%rsp), %rdi
testq %rdi, %rdi
je 0x2065d
callq 0xdcba
movq 0xc8(%rsp), %rdi
testq %rdi, %rdi
je 0x2066f
callq 0xdcba
movq 0x1b0(%rsp), %rdi
leaq 0x1c0(%rsp), %rax
cmpq %rax, %rdi
je 0x20689
callq 0xa2b0
testq %r15, %r15
je 0x20696
movq %r15, %rdi
callq 0xdcba
addq $0x10, %r12
jmp 0x2053c
movl %r12d, %eax
andl $-0x2, %eax
cmpl $0x6, %eax
je 0x20914
leaq 0x1a0(%rsp), %rax
movq %rax, 0x190(%rsp)
movq 0x18(%rsp), %rsi
addq %rsi, %rdx
leaq 0x190(%rsp), %rdi
callq 0xdde2
movq (%rbx), %rax
movq %rax, 0xa0(%rsp)
movq 0x8(%rbx), %rax
movq %rax, 0xa8(%rsp)
testq %rax, %rax
je 0x20723
movq 0x788b2(%rip), %rcx     # 0x98fa8
cmpb $0x0, (%rcx)
je 0x2071f
incl 0x8(%rax)
jmp 0x20723
leaq 0xe0(%rsp), %rdi
callq 0x2111e
movq 0x38(%rsp), %rbx
movq 0x158(%rsp), %r12
jmp 0x20914
lock
incl 0x8(%rax)
movl %r14d, %r8d
subl 0x20(%rsp), %r8d
xorps %xmm0, %xmm0
movaps %xmm0, 0x140(%rsp)
leaq 0x140(%rsp), %rax
movq %rax, (%rsp)
leaq 0x120(%rsp), %rdi
leaq 0x190(%rsp), %rsi
leaq 0xa0(%rsp), %rdx
movl 0x14(%rsp), %ecx
movl %r12d, %r9d
callq 0x52e30
movq 0x148(%rsp), %rdi
testq %rdi, %rdi
je 0x20778
callq 0xdcba
movq 0xa8(%rsp), %rdi
testq %rdi, %rdi
je 0x2078a
callq 0xdcba
movq 0x190(%rsp), %rdi
leaq 0x1a0(%rsp), %rax
cmpq %rax, %rdi
je 0x207a4
callq 0xa2b0
cmpl $0xb, %r12d
jne 0x20806
leaq 0x40(%rsp), %r15
movq %r15, %rdi
leaq 0x55dc4(%rip), %rsi     # 0x7657d
leaq 0x18(%rsp), %rdx
callq 0xdbef
movq %r15, %rdi
leaq 0x5aadd(%rip), %rsi     # 0x7b2aa
callq 0xa560
leaq 0x90(%rsp), %rsi
movq %rsi, 0x80(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x2081d
movq %rdx, 0x80(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x90(%rsp)
jmp 0x20823
movq 0x68(%rsp), %rdi
leaq 0x120(%rsp), %rsi
callq 0x2115e
jmp 0x20902
movups (%rcx), %xmm0
movups %xmm0, (%rsi)
movq 0x8(%rax), %rdx
movq %rdx, 0x88(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0x120(%rsp), %rcx
movq 0x128(%rsp), %rax
movq %rcx, 0x70(%rsp)
movq %rax, 0x78(%rsp)
testq %rax, %rax
je 0x20872
movq 0x78744(%rip), %rcx     # 0x98fa8
cmpb $0x0, (%rcx)
je 0x2086e
incl 0x8(%rax)
jmp 0x20872
lock
incl 0x8(%rax)
leaq 0xe0(%rsp), %r15
movq %r15, %rdi
leaq 0x80(%rsp), %rsi
xorl %edx, %edx
leaq 0x70(%rsp), %rcx
callq 0x200e4
movq %r15, %rdi
callq 0x20160
movq 0x110(%rsp), %rdi
testq %rdi, %rdi
je 0x208ab
callq 0xdcba
movq 0xe0(%rsp), %rdi
leaq 0xf0(%rsp), %rax
cmpq %rax, %rdi
je 0x208c5
callq 0xa2b0
movq 0x78(%rsp), %rdi
testq %rdi, %rdi
je 0x208d4
callq 0xdcba
movq 0x80(%rsp), %rdi
leaq 0x90(%rsp), %rax
cmpq %rax, %rdi
je 0x208ee
callq 0xa2b0
movq 0x40(%rsp), %rdi
leaq 0x50(%rsp), %rax
cmpq %rax, %rdi
je 0x20902
callq 0xa2b0
movq 0x128(%rsp), %rdi
testq %rdi, %rdi
je 0x20914
callq 0xdcba
movq 0x20(%rsp), %rdx
leaq 0x18(%rsp), %rdi
xorl %esi, %esi
leaq 0x56128(%rip), %rcx     # 0x76a4f
xorl %r8d, %r8d
callq 0xa470
movl 0x64(%rsp), %eax
cmpl $0x2, %eax
jb 0x209a9
movslq %r13d, %r15
movl %eax, %ebp
cmpl $0x4, %eax
jne 0x2096f
movq (%rbx), %rax
movq 0x20(%rax), %rax
cmpb $0x5c, (%rax,%r15)
jne 0x2096f
movb 0x1(%rax,%r15), %al
incq %r15
movzbl %al, %ecx
cmpl $0x6d, %ecx
jg 0x20989
cmpl $0x22, %ecx
je 0x20997
cmpl $0x5c, %ecx
je 0x20997
jmp 0x20a03
movq (%rbx), %rax
movq 0x20(%rax), %rax
movsbl (%rax,%r15), %esi
leaq 0x18(%rsp), %rdi
callq 0xa290
movl %ebp, %eax
jmp 0x209a9
movb $0xa, %al
cmpl $0x6e, %ecx
je 0x20997
cmpl $0x74, %ecx
jne 0x20a03
movb $0x9, %al
movsbl %al, %esi
leaq 0x18(%rsp), %rdi
callq 0xa290
movl %r15d, %r13d
movl %ebp, %eax
movq (%rbx), %rsi
movslq %r13d, %r13
movq 0x20(%rsi), %rcx
incl %r14d
xorl %edx, %edx
cmpb $0xa, (%rcx,%r13)
sete %dl
movl $0x1, %ecx
cmovel %ecx, %r14d
addl %edx, 0x14(%rsp)
incl %r13d
movl %eax, %r12d
cmpl 0x28(%rsi), %r13d
jl 0x20424
movq 0x18(%rsp), %rdi
leaq 0x28(%rsp), %rax
cmpq %rax, %rdi
je 0x209f1
callq 0xa2b0
addq $0x238, %rsp            # imm = 0x238
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r12, %rbx
movl $0x38, %edi
callq 0xa1b0
movq %rax, %r12
leaq 0x130(%rsp), %r13
movq %r13, -0x10(%r13)
movq $0x0, -0x8(%r13)
movb $0x0, (%r13)
leaq 0x56705(%rip), %rsi     # 0x77138
leaq 0x120(%rsp), %rdi
callq 0xa560
leaq 0x50(%rsp), %rcx
movq %rcx, 0x40(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
jne 0x20a66
movups (%rcx), %xmm0
leaq 0x50(%rsp), %rdx
movups %xmm0, (%rdx)
jmp 0x20a73
movq %rdx, 0x40(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x50(%rsp)
movq 0x8(%rax), %rdx
leaq 0x40(%rsp), %rsi
movq %rdx, 0x8(%rsi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0x38(%rsp), %rax
movq (%rax), %rax
movq 0x20(%rax), %rax
movsbl (%rax,%r15), %edx
leaq 0xe0(%rsp), %rdi
callq 0x2119d
leaq 0x5a7f6(%rip), %rsi     # 0x7b2aa
leaq 0xe0(%rsp), %rdi
callq 0xa560
leaq 0x180(%rsp), %rcx
movq %rcx, -0x10(%rcx)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
jne 0x20aec
movups (%rcx), %xmm0
leaq 0x180(%rsp), %rdx
movups %xmm0, (%rdx)
jmp 0x20aff
movq %rdx, 0x170(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x180(%rsp)
movq 0x8(%rax), %rdx
movq %rdx, 0x178(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0x38(%rsp), %rax
movq (%rax), %rax
movq 0x20(%rax), %rax
movsbl (%rax,%r15), %edx
leaq 0x218(%rsp), %rdi
leaq 0x18(%rsp), %rsi
callq 0x211fe
movq 0x38(%rsp), %rcx
movq (%rcx), %rax
movq %rax, 0x160(%rsp)
movq 0x8(%rcx), %rax
movq %rax, 0x168(%rsp)
testq %rax, %rax
je 0x20b73
movq 0x78443(%rip), %rcx     # 0x98fa8
cmpb $0x0, (%rcx)
jne 0x20b70
lock
incl 0x8(%rax)
jmp 0x20b73
incl 0x8(%rax)
subl 0x20(%rsp), %r14d
xorps %xmm0, %xmm0
leaq 0x200(%rsp), %rax
movaps %xmm0, (%rax)
movq %rax, (%rsp)
leaq 0x1f0(%rsp), %rdi
leaq 0x218(%rsp), %rsi
leaq 0x160(%rsp), %rdx
movl 0x14(%rsp), %ecx
movl %r14d, %r8d
movl %ebx, %r9d
callq 0x52e30
movb $0x1, %bpl
leaq 0x170(%rsp), %rsi
leaq 0x1f0(%rsp), %rcx
movq %r12, %rdi
xorl %edx, %edx
callq 0x200e4
xorl %ebp, %ebp
leaq 0x75a61(%rip), %rsi     # 0x96638
leaq -0xc2e6(%rip), %rdx     # 0x148f8
movq %r12, %rdi
callq 0xa4f0
movq %rax, %rbx
movq 0x1f8(%rsp), %rdi
testq %rdi, %rdi
je 0x20c03
callq 0xdcba
jmp 0x20c03
movq %rax, %rbx
movb $0x1, %bpl
movq 0x208(%rsp), %rdi
testq %rdi, %rdi
je 0x20c15
callq 0xdcba
movq 0x168(%rsp), %rdi
testq %rdi, %rdi
je 0x20c27
callq 0xdcba
leaq 0x228(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x20c45
callq 0xa2b0
jmp 0x20c45
movq %rax, %rbx
movb $0x1, %bpl
movq 0x170(%rsp), %rdi
leaq 0x180(%rsp), %rax
cmpq %rax, %rdi
je 0x20c67
callq 0xa2b0
jmp 0x20c67
movq %rax, %rbx
movb $0x1, %bpl
movq 0xe0(%rsp), %rdi
leaq 0xf0(%rsp), %rax
cmpq %rax, %rdi
je 0x20c89
callq 0xa2b0
jmp 0x20c89
movq %rax, %rbx
movb $0x1, %bpl
movq 0x40(%rsp), %rdi
leaq 0x50(%rsp), %rax
cmpq %rax, %rdi
je 0x20ca5
callq 0xa2b0
jmp 0x20ca5
movq %rax, %rbx
movb $0x1, %bpl
movq 0x120(%rsp), %rdi
cmpq %r13, %rdi
je 0x20cb7
callq 0xa2b0
testb %bpl, %bpl
je 0x20dc0
movq %r12, %rdi
callq 0xa240
jmp 0x20dc0
movq %rax, %rbx
leaq 0xe0(%rsp), %rdi
callq 0x148f8
jmp 0x20ce2
movq %rax, %rbx
movq 0x78(%rsp), %rdi
testq %rdi, %rdi
je 0x20cf1
callq 0xdcba
movq 0x80(%rsp), %rdi
leaq 0x90(%rsp), %rax
cmpq %rax, %rdi
je 0x20d10
callq 0xa2b0
jmp 0x20d10
movq %rax, %rbx
movq 0x40(%rsp), %rdi
leaq 0x50(%rsp), %rax
cmpq %rax, %rdi
je 0x20d2b
callq 0xa2b0
jmp 0x20d2b
jmp 0x20d28
movq %rax, %rbx
movq 0x128(%rsp), %rdi
jmp 0x20db1
movq %rax, %rbx
movq 0x148(%rsp), %rdi
testq %rdi, %rdi
je 0x20d4a
callq 0xdcba
movq 0xa8(%rsp), %rdi
testq %rdi, %rdi
je 0x20d5c
callq 0xdcba
movq 0x190(%rsp), %rdi
leaq 0x1a0(%rsp), %rax
cmpq %rax, %rdi
je 0x20dc0
callq 0xa2b0
jmp 0x20dc0
jmp 0x20dbd
movq %rax, %rbx
jmp 0x20d9c
movq %rax, %rbx
movq 0x1d0(%rsp), %rdi
leaq 0x1e0(%rsp), %rax
cmpq %rax, %rdi
je 0x20d9c
callq 0xa2b0
leaq 0x28(%rsp), %r14
jmp 0x20e33
movq %rax, %rbx
movq 0xd8(%rsp), %rdi
testq %rdi, %rdi
je 0x20dc0
callq 0xdcba
jmp 0x20dc0
movq %rax, %rbx
leaq 0x28(%rsp), %r14
jmp 0x20e40
movq %rax, %rbx
movq 0x48(%rsp), %rdi
testq %rdi, %rdi
je 0x20de3
callq 0xdcba
jmp 0x20de3
movq %rax, %rbx
jmp 0x20e21
movq %rax, %rbx
movq 0xb8(%rsp), %rdi
testq %rdi, %rdi
je 0x20df5
callq 0xdcba
movq 0xc8(%rsp), %rdi
testq %rdi, %rdi
je 0x20e07
callq 0xdcba
movq 0x1b0(%rsp), %rdi
leaq 0x1c0(%rsp), %rax
cmpq %rax, %rdi
je 0x20e21
callq 0xa2b0
leaq 0x28(%rsp), %r14
testq %r15, %r15
je 0x20e33
movq %r15, %rdi
callq 0xdcba
leaq 0xe0(%rsp), %rdi
callq 0x2111e
movq 0x18(%rsp), %rdi
cmpq %r14, %rdi
je 0x20e4f
callq 0xa2b0
movq %rbx, %rdi
callq 0xa510
nop