// File: /workspace/github_cpp_makefile_star2_O2/Nallantli[P]Rossa/main/rossa/tokenizer/tokenizer.cpp
// Function: lexString(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::filesystem::__cxx11::path const&)
const std::vector<token_t> lexString(const std::string &INPUT, const std::filesystem::path &filename)
{
	std::vector<std::string> LINES;
	std::stringstream ss(INPUT);
	std::string item;

	while (std::getline(ss, item, '\n'))
	{
		LINES.push_back(item);
	}

	std::vector<token_t> tokens;
	size_t INPUT_INDEX = 0;
	size_t LINE_INDEX = 0;
	size_t TOKEN_DIST = 0;
	std::string ID_STRING;

	bool in_sig = false;

	while (true)
	{
		int token = getToken(INPUT, INPUT_INDEX, LINE_INDEX, TOKEN_DIST, ID_STRING);
		if (token == TOK_EOF)
			break;
		if (token == '#')
			continue;
		token_t t = {filename, LINES[LINE_INDEX], LINE_INDEX, TOKEN_DIST, ID_STRING, token};
		if (t.type == TOK_DEF)
		{
			in_sig = true;
			tokens.push_back(t);
		}
		else
		{
			if (in_sig)
			{
				if (t.type == '(' && tokens.back().type == TOK_DEF)
				{
					tokens.back().type = TOK_LAMBDA;
				}
				if (t.type != TOK_IDF && t.valueString == ">>")
				{
					tokens.push_back({t.filename, t.line, t.lineNumber, t.distance, ">", '>'});
					tokens.push_back({t.filename, t.line, t.lineNumber, t.distance, ">", '>'});
				}
				else if (t.type != TOK_IDF && t.valueString == "<<")
				{
					tokens.push_back({t.filename, t.line, t.lineNumber, t.distance, "<", '<'});
					tokens.push_back({t.filename, t.line, t.lineNumber, t.distance, "<", '<'});
				}
				else if (t.type != TOK_IDF && t.valueString == "<>")
				{
					tokens.push_back({t.filename, t.line, t.lineNumber, t.distance, "<", '<'});
					tokens.push_back({t.filename, t.line, t.lineNumber, t.distance, ">", '>'});
				}
				else
				{
					tokens.push_back(t);
				}
				if (tokens.back().type == ')')
				{
					in_sig = false;
				}
			}
			else
			{
				tokens.push_back(t);
			}
		}
	}

	for (auto &t : tokens)
	{
		while (!t.line.empty() && isspace(t.line[0]))
		{
			t.line = t.line.substr(1);
			t.distance--;
		}
	}

	return tokens;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x328, %rsp            # imm = 0x328
movq %rdx, 0xd0(%rsp)
movq %rsi, %r15
movq %rdi, 0x10(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0xb0(%rsp)
andq $0x0, 0xc0(%rsp)
leaq 0x1a0(%rsp), %rdi
pushq $0x18
popq %rdx
callq 0x10610
leaq 0x190(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq 0x1a0(%rsp), %rbx
leaq 0x180(%rsp), %r14
pushq $0xa
popq %rbp
leaq 0xb0(%rsp), %r12
movq %rbx, %rdi
movq %r14, %rsi
movl %ebp, %edx
callq 0x10720
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x21982
movq %r12, %rdi
movq %r14, %rsi
callq 0x1f322
jmp 0x2195a
movq 0x10(%rsp), %rax
andq $0x0, 0x10(%rax)
leaq 0x178(%rsp), %r12
andq $0x0, (%r12)
leaq 0xa8(%rsp), %rcx
andq $0x0, (%rcx)
leaq 0xa0(%rsp), %rcx
andq $0x0, (%rcx)
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
leaq 0x168(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
movl $0x0, 0x1c(%rsp)
leaq 0x158(%rsp), %r14
leaq 0xd8(%rsp), %rbp
movq %r15, %rdi
movq %r12, %rsi
leaq 0xa8(%rsp), %rdx
leaq 0xa0(%rsp), %rcx
movq %r14, %r8
callq 0x2061b
movl %eax, %ebx
cmpl $0x23, %eax
je 0x219e3
cmpl $-0x1, %ebx
je 0x21dde
movq %rbp, %rdi
movq %r12, %r13
movq 0xd0(%rsp), %rsi
callq 0x1d74c
movq 0xa8(%rsp), %r12
movq %r12, %rsi
shlq $0x5, %rsi
addq 0xb0(%rsp), %rsi
leaq 0x100(%rsp), %rdi
callq 0x10550
movq %r12, 0x120(%rsp)
movq 0xa0(%rsp), %rax
movq %rax, 0x128(%rsp)
leaq 0x130(%rsp), %rdi
movq %r14, %rsi
callq 0x10550
movl %ebx, 0x150(%rsp)
cmpl $-0xe, %ebx
movq %r13, %r12
jne 0x21a97
movb $0x1, %al
movl %eax, 0x1c(%rsp)
movq 0x10(%rsp), %rdi
movq %rbp, %rsi
callq 0x21fea
jmp 0x21bf9
testb $0x1, 0x1c(%rsp)
je 0x21bb7
cmpl $0x28, %ebx
jne 0x21ac4
movq 0x10(%rsp), %rax
movq 0x8(%rax), %rax
cmpl $-0xe, -0x8(%rax)
jne 0x21acd
movl $0xffffffca, -0x8(%rax) # imm = 0xFFFFFFCA
movl 0x150(%rsp), %ebx
cmpl $-0x2, %ebx
je 0x21bd8
leaq 0x130(%rsp), %rdi
leaq 0x5455a(%rip), %rsi     # 0x76036
callq 0x1c7a0
testb %al, %al
je 0x21bce
leaq 0x20(%rsp), %rdi
movq %rbp, %rsi
callq 0x1d74c
leaq 0x48(%rsp), %rdi
leaq 0x100(%rsp), %rsi
callq 0x10550
movups 0x120(%rsp), %xmm0
movups %xmm0, 0x68(%rsp)
leaq 0x78(%rsp), %rdi
leaq 0x5484d(%rip), %rsi     # 0x7636e
leaq 0xf(%rsp), %rdx
callq 0x1c814
movl $0x3e, 0x98(%rsp)
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rbx
movq %rbx, %rsi
callq 0x223ae
movq %rbx, %rdi
callq 0x1df38
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x1d74c
leaq 0x48(%rsp), %rdi
leaq 0x100(%rsp), %rsi
callq 0x10550
movups 0x120(%rsp), %xmm0
movups %xmm0, 0x68(%rsp)
leaq 0x78(%rsp), %rdi
leaq 0x547e8(%rip), %rsi     # 0x7636e
leaq 0xf(%rsp), %rdx
callq 0x1c814
movl $0x3e, 0x98(%rsp)
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rbx
movq %rbx, %rsi
callq 0x223ae
movq %rbx, %rdi
callq 0x1df38
jmp 0x21be5
movq 0x10(%rsp), %rdi
movq %rbp, %rsi
callq 0x21fea
movl $0x0, 0x1c(%rsp)
jmp 0x21bf9
cmpl $-0x2, 0x150(%rsp)
jne 0x21c06
movq 0x10(%rsp), %rdi
movq %rbp, %rsi
callq 0x21fea
movq 0x10(%rsp), %rax
movq 0x8(%rax), %rax
cmpl $0x29, -0x8(%rax)
setne %al
movl %eax, 0x1c(%rsp)
movq %rbp, %rdi
callq 0x1df38
jmp 0x219e3
leaq 0x130(%rsp), %rdi
leaq 0x5441e(%rip), %rsi     # 0x76033
callq 0x1c7a0
testb %al, %al
je 0x21ceb
leaq 0x20(%rsp), %rdi
movq %rbp, %rsi
callq 0x1d74c
leaq 0x48(%rsp), %rdi
leaq 0x100(%rsp), %rsi
callq 0x10550
movups 0x120(%rsp), %xmm0
movups %xmm0, 0x68(%rsp)
leaq 0x78(%rsp), %rdi
leaq 0x5474b(%rip), %rsi     # 0x763a5
leaq 0xf(%rsp), %rdx
callq 0x1c814
movl $0x3c, 0x98(%rsp)
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rbx
movq %rbx, %rsi
callq 0x223ae
movq %rbx, %rdi
callq 0x1df38
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x1d74c
leaq 0x48(%rsp), %rdi
leaq 0x100(%rsp), %rsi
callq 0x10550
movups 0x120(%rsp), %xmm0
movups %xmm0, 0x68(%rsp)
leaq 0x78(%rsp), %rdi
leaq 0x546e6(%rip), %rsi     # 0x763a5
leaq 0xf(%rsp), %rdx
callq 0x1c814
movl $0x3c, 0x98(%rsp)
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rbx
movq %rbx, %rsi
callq 0x223ae
jmp 0x21bad
cmpl $-0x2, 0x150(%rsp)
je 0x21bd8
leaq 0x130(%rsp), %rdi
leaq 0x54331(%rip), %rsi     # 0x76039
callq 0x1c7a0
testb %al, %al
je 0x21bd8
leaq 0x20(%rsp), %rdi
movq %rbp, %rsi
callq 0x1d74c
leaq 0x48(%rsp), %rdi
leaq 0x100(%rsp), %rsi
callq 0x10550
movups 0x120(%rsp), %xmm0
movups %xmm0, 0x68(%rsp)
leaq 0x78(%rsp), %rdi
leaq 0x54658(%rip), %rsi     # 0x763a5
leaq 0xf(%rsp), %rdx
callq 0x1c814
movl $0x3c, 0x98(%rsp)
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rbx
movq %rbx, %rsi
callq 0x223ae
movq %rbx, %rdi
callq 0x1df38
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x1d74c
leaq 0x48(%rsp), %rdi
leaq 0x100(%rsp), %rsi
callq 0x10550
movups 0x120(%rsp), %xmm0
movups %xmm0, 0x68(%rsp)
leaq 0x78(%rsp), %rdi
leaq 0x545bc(%rip), %rsi     # 0x7636e
leaq 0xf(%rsp), %rdx
callq 0x1c814
movl $0x3e, 0x98(%rsp)
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rbx
movq %rbx, %rsi
callq 0x223ae
jmp 0x21bad
movq 0x10(%rsp), %rax
movq (%rax), %r13
movq 0x8(%rax), %rbp
leaq 0xd8(%rsp), %rbx
pushq $0x1
popq %r14
pushq $-0x1
popq %r15
cmpq %rbp, %r13
je 0x21e4a
leaq 0x28(%r13), %r12
cmpq $0x0, 0x30(%r13)
je 0x21e44
movq (%r12), %rax
movsbl (%rax), %edi
callq 0x10060
testl %eax, %eax
je 0x21e44
movq %rbx, %rdi
movq %r12, %rsi
movq %r14, %rdx
movq %r15, %rcx
callq 0x10410
movq %r12, %rdi
movq %rbx, %rsi
callq 0x104e0
movq %rbx, %rdi
callq 0x101d0
decq 0x50(%r13)
jmp 0x21e03
subq $-0x80, %r13
jmp 0x21dfa
leaq 0x158(%rsp), %rdi
callq 0x101d0
leaq 0x180(%rsp), %rdi
callq 0x101d0
leaq 0x1a0(%rsp), %rdi
callq 0x102f0
leaq 0xb0(%rsp), %rdi
callq 0x1cea0
movq 0x10(%rsp), %rax
addq $0x328, %rsp            # imm = 0x328
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x21ebd
jmp 0x21ecc
jmp 0x21edb
jmp 0x21eec
jmp 0x21ebd
jmp 0x21ecc
jmp 0x21edb
jmp 0x21eec
jmp 0x21ebd
jmp 0x21ecc
jmp 0x21edb
jmp 0x21eec
jmp 0x21ebd
jmp 0x21ecc
jmp 0x21edb
jmp 0x21eec
jmp 0x21ebd
jmp 0x21ecc
jmp 0x21edb
jmp 0x21eec
movq %rax, %r14
leaq 0x20(%rsp), %rdi
callq 0x1df38
jmp 0x21eef
movq %rax, %r14
leaq 0x48(%rsp), %rdi
callq 0x101d0
jmp 0x21ede
movq %rax, %r14
leaq 0x20(%rsp), %rdi
callq 0x1ca5c
jmp 0x21eef
jmp 0x21eec
movq %rax, %r14
leaq 0xd8(%rsp), %rdi
callq 0x1df38
jmp 0x21f33
movq %rax, %r14
leaq 0x100(%rsp), %rdi
callq 0x101d0
jmp 0x21f13
movq %rax, %r14
leaq 0xd8(%rsp), %rdi
callq 0x1ca5c
jmp 0x21f33
jmp 0x21f30
movq %rax, %r14
jmp 0x21f64
jmp 0x21f30
movq %rax, %r14
jmp 0x21f4a
movq %rax, %r14
leaq 0x158(%rsp), %rdi
callq 0x101d0
movq 0x10(%rsp), %rdi
callq 0x1f142
leaq 0x180(%rsp), %rdi
callq 0x101d0
leaq 0x1a0(%rsp), %rdi
callq 0x102f0
leaq 0xb0(%rsp), %rdi
callq 0x1cea0
movq %r14, %rdi
callq 0x106f0