// File: /workspace/github_cpp_makefile_star2_O1/ClauParser[P]ClauParser/./include/clau_parser.h
// Function: clau_parser::InFileReserver::ScanningNew(char*, unsigned long, int, long*&, unsigned long&, bool)
static void ScanningNew(char* text, const size_t length, const int thr_num,
			int64_t*& _token_arr, size_t& _token_arr_size, bool use_simd)
		{
			std::vector<std::thread> thr(thr_num);
			std::vector<size_t> start(thr_num);
			std::vector<size_t> last(thr_num);

			{
				start[0] = 0;

				for (int i = 1; i < thr_num; ++i) {
					start[i] = length / thr_num * i;

					for (size_t x = start[i]; x <= length; ++x) {
						if (Utility::isWhitespace(text[x]) || '\0' == text[x] ||
							LoadDataOption::Left == text[x] || LoadDataOption::Right == text[x] || LoadDataOption::Assignment == text[x]) {
							start[i] = x;
							break;
						}
					}
				}
				for (int i = 0; i < thr_num - 1; ++i) {
					last[i] = start[i + 1];
					for (size_t x = last[i]; x <= length; ++x) {
						if (Utility::isWhitespace(text[x]) || '\0' == text[x] ||
							LoadDataOption::Left == text[x] || LoadDataOption::Right == text[x] || LoadDataOption::Assignment == text[x]) {
							last[i] = x;
							break;
						}
					}
				}
				last[thr_num - 1] = length + 1;
			}
			size_t real_token_arr_count = 0;

			int64_t* tokens = new int64_t[length + 1];


			std::vector<size_t> token_arr_size(thr_num);
			auto a = std::chrono::steady_clock::now();
			for (int i = 0; i < thr_num; ++i) {
				if (use_simd) {
					thr[i] = std::thread(_ScanningWithSimd, text + start[i], start[i], last[i] - start[i], std::ref(tokens), std::ref(token_arr_size[i]));
				}
				else {
					thr[i] = std::thread(_Scanning, text + start[i], start[i], last[i] - start[i], std::ref(tokens), std::ref(token_arr_size[i]));
				}
			}

			for (int i = 0; i < thr_num; ++i) {
				thr[i].join();
			}
			auto b = std::chrono::steady_clock::now();
			int state = 0;
			int new_state = state;

			int64_t qouted_start = -4;
			int64_t slush_start = -5;

			for (size_t t = 0; t < thr_num; ++t) {
				for (size_t j = 0; j < token_arr_size[t]; ++j) {
					const int64_t i = start[t] + j;

					////std::cout << tokens[i] << "\n";
					//Utility::PrintToken(text, tokens[i]);
					//

					const bool isToken2 = Utility::IsToken2(tokens[i]);


					if (!isToken2 && state == 0) {
						tokens[real_token_arr_count] = tokens[i];
						real_token_arr_count++;
					}
					else {
						const char ch = text[Utility::GetIdx(tokens[i])];
						const int64_t idx = Utility::GetIdx(tokens[i]);

						//if (isToken2) {
						new_state = (isToken2 && 0 == state && '\"' == ch) ? 1 : new_state;
						qouted_start = (isToken2 && 0 == state && '\"' == ch) ? i : qouted_start;

						/*if (0 == state && '\"' == ch) {
							state = 1;
							qouted_start = i;
						}
						else
						if (0 == state && LoadDataOption::LineComment == ch) {
							state = 2;
						}
						else if (1 == state && '\\' == ch) {
							state = 3;
							slush_start = idx;
						}
						else if (1 == state && '\"' == ch) {
							state = 0;

							{
								int64_t idx = Utility::GetIdx(tokens[qouted_start]);
								int64_t len = Utility::GetLength(tokens[qouted_start]);

								len = Utility::GetIdx(tokens[i]) - idx + 1;

								tokens[real_token_arr_count] = Utility::Get(idx, len, text[idx]);

								//	Utility::PrintToken(text, tokens[real_token_arr_count]);


								real_token_arr_count++;
							}
						}
						else if (3 == state) {
							if (idx != slush_start + 1) {
								--j; // --i;
							}
							state = 1;
						}
						else if (2 == state && ('\n' == ch || '\0' == ch)) {
							state = 0;
						}}
					else if (0 == state) { //
						tokens[real_token_arr_count] = tokens[i];

						//	Utility::PrintToken(text, tokens[real_token_arr_count]);

						real_token_arr_count++;
					}
						*/
						new_state = (isToken2 && 0 == state && LoadDataOption::LineComment == ch) ? 2 : new_state;

						new_state = (isToken2 && 1 == state && '\\' == ch) ? 3 : new_state;

						slush_start = (isToken2 && 1 == state && '\\' == ch) ? idx : slush_start;

						new_state = (isToken2 && 1 == state && '\"' == ch) ? 0 : new_state;
						{
							int64_t idx = (isToken2 && 1 == state && '\"' == ch) ? Utility::GetIdx(tokens[qouted_start]) : -1;
							int64_t len = (isToken2 && 1 == state && '\"' == ch) ? Utility::GetLength(tokens[qouted_start]) : -1;
							len = (isToken2 && 1 == state && '\"' == ch) ? Utility::GetIdx(tokens[i]) - idx + 1 : -1;

							if (isToken2 && 1 == state && '\"' == ch) {
								tokens[real_token_arr_count] = Utility::Get2(idx, len);
								real_token_arr_count++;
							}
						}
						j = (isToken2 && 3 == state && idx != slush_start + 1) ? j - 1 : j;

						new_state = (isToken2 && 3 == state) ? 1 : new_state;

						new_state = (isToken2 && 2 == state && ('\n' == ch || '\0' == ch)) ? 0 : new_state;
						state = new_state;
					}
				}
			}
			auto c = std::chrono::steady_clock::now();
			auto dur = std::chrono::duration_cast<std::chrono::milliseconds>(b - a);
			auto dur2 = std::chrono::duration_cast<std::chrono::milliseconds>(c - b);

			//std::cout << dur.count() << "ms\n";
			//std::cout << dur2.count() << "ms\n";

			{
				if (0 != state) {
					//std::cout << "[ERROR] state [" << state << "] is not zero \n";
				}
			}


			{
				_token_arr = tokens;
				_token_arr_size = real_token_arr_count;
			}
		}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xc8, %rsp
movl %r9d, 0x10(%rsp)
movq %r8, %r14
movq %rcx, %r15
movl %edx, %r13d
movq %rsi, %rbx
movq %rdi, 0x8(%rsp)
movslq %edx, %r12
leaq 0xb0(%rsp), %rdi
leaq 0x58(%rsp), %rdx
movq %r12, %rsi
callq 0x4fde
leaq 0x58(%rsp), %rdi
leaq 0x40(%rsp), %rdx
movq %r12, %rsi
callq 0x70d0
movq %r15, 0xa0(%rsp)
leaq 0x40(%rsp), %rdi
leaq 0x80(%rsp), %rdx
movq %r12, %rsi
callq 0x70d0
movq 0x58(%rsp), %rcx
movq $0x0, (%rcx)
movl %r13d, %ebp
movabsq $0x2000000100003e01, %rsi # imm = 0x2000000100003E01
cmpl $0x2, %r13d
jl 0x6c27
movq %rbx, %rax
xorl %edx, %edx
divq %r12
movl $0x1, %edx
movq %rax, %rdi
imulq %rdx, %rdi
movq %rdi, (%rcx,%rdx,8)
cmpq %rbx, %rdi
ja 0x6c1f
movq 0x8(%rsp), %r8
movzbl (%r8,%rdi), %r8d
cmpq $0x3d, %r8
ja 0x6c0a
btq %r8, %rsi
jb 0x6c1b
cmpl $0x7d, %r8d
je 0x6c1b
cmpl $0x7b, %r8d
je 0x6c1b
incq %rdi
jmp 0x6bef
movq %rdi, (%rcx,%rdx,8)
incq %rdx
cmpq %rbp, %rdx
jne 0x6be4
leal -0x1(%r13), %eax
cmpl $0x2, %r13d
jl 0x6c7c
movq 0x40(%rsp), %rdx
movl %eax, %edi
xorl %r8d, %r8d
movq 0x8(%rcx,%r8,8), %r9
movq %r9, (%rdx,%r8,8)
cmpq %rbx, %r9
ja 0x6c74
movq 0x8(%rsp), %r10
movzbl (%r10,%r9), %r10d
cmpq $0x3d, %r10
ja 0x6c5f
btq %r10, %rsi
jb 0x6c70
cmpl $0x7d, %r10d
je 0x6c70
cmpl $0x7b, %r10d
je 0x6c70
incq %r9
jmp 0x6c44
movq %r9, (%rdx,%r8,8)
incq %r8
cmpq %rdi, %r8
jne 0x6c3b
leaq 0x1(%rbx), %rcx
cltq
movq 0x40(%rsp), %rdx
movq %rcx, (%rdx,%rax,8)
shrq $0x3d, %rcx
leaq 0x8(,%rbx,8), %rax
xorl %edi, %edi
negq %rcx
sbbq %rdi, %rdi
orq %rax, %rdi
callq 0x2040
movq %r14, 0x98(%rsp)
movq %rax, 0x20(%rsp)
leaq 0x80(%rsp), %rdi
leaq 0x18(%rsp), %rdx
movq %r12, 0xa8(%rsp)
movq %r12, %rsi
callq 0x70d0
callq 0x2240
movq %r13, %r15
testl %r13d, %r13d
jle 0x6df9
leaq (,%rbp,8), %r14
xorl %r13d, %r13d
leaq 0x78(%rsp), %r12
leaq 0x70(%rsp), %rbx
cmpb $0x0, 0x10(%rsp)
je 0x6d68
movq 0x58(%rsp), %rax
leaq (%rax,%r13), %rcx
movq (%rax,%r13), %rdx
addq 0x8(%rsp), %rdx
movq %rdx, 0x38(%rsp)
movq 0x40(%rsp), %rdx
movq (%rdx,%r13), %rdx
subq (%rax,%r13), %rdx
movq %rdx, 0x78(%rsp)
leaq 0x20(%rsp), %rax
movq %rax, 0x70(%rsp)
movq 0x80(%rsp), %rax
addq %r13, %rax
movq %rax, 0x30(%rsp)
leaq 0x30(%rsp), %rax
movq %rax, (%rsp)
leaq 0x18(%rsp), %rdi
leaq 0x404(%rip), %rsi       # 0x715a
leaq 0x38(%rsp), %rdx
movq %r12, %r8
movq %rbx, %r9
callq 0x74d6
jmp 0x6dd0
movq 0x58(%rsp), %rax
leaq (%rax,%r13), %rcx
movq (%rax,%r13), %rdx
addq 0x8(%rsp), %rdx
movq %rdx, 0x38(%rsp)
movq 0x40(%rsp), %rdx
movq (%rdx,%r13), %rdx
subq (%rax,%r13), %rdx
movq %rdx, 0x78(%rsp)
leaq 0x20(%rsp), %rax
movq %rax, 0x70(%rsp)
movq 0x80(%rsp), %rax
addq %r13, %rax
movq %rax, 0x30(%rsp)
leaq 0x30(%rsp), %rax
movq %rax, (%rsp)
leaq 0x18(%rsp), %rdi
leaq 0x7d4(%rip), %rsi       # 0x7594
leaq 0x38(%rsp), %rdx
movq %r12, %r8
movq %rbx, %r9
callq 0x74d6
movq 0xb0(%rsp), %rax
cmpq $0x0, (%rax,%r13)
jne 0x7053
movq 0x18(%rsp), %rcx
movq %rcx, (%rax,%r13)
addq $0x8, %r13
cmpq %r13, %r14
jne 0x6cf7
testl %r15d, %r15d
jle 0x6e1d
shlq $0x3, %rbp
xorl %ebx, %ebx
movq 0xb0(%rsp), %rdi
addq %rbx, %rdi
callq 0x22b0
addq $0x8, %rbx
cmpq %rbx, %rbp
jne 0x6e04
callq 0x2240
testl %r15d, %r15d
je 0x6fc7
movq 0x80(%rsp), %rcx
movq 0x58(%rsp), %rdx
movq $-0x4, 0x10(%rsp)
movq $-0x5, %rdi
movq 0x20(%rsp), %r8
movl $0x1, %esi
xorl %r14d, %r14d
xorl %ebp, %ebp
xorl %eax, %eax
xorl %ebx, %ebx
movq %rcx, 0x28(%rsp)
cmpq $0x0, (%rcx,%r14,8)
je 0x6fae
xorl %r12d, %r12d
movq (%rdx,%r14,8), %r13
addq %r12, %r13
movq (%r8,%r13,8), %r10
testb $0x1, %r10b
jne 0x6e92
testl %eax, %eax
jne 0x6e92
movq %r10, (%r8,%rbx,8)
incq %rbx
xorl %r13d, %r13d
jmp 0x6f9c
movq %rdx, %rcx
testl %eax, %eax
sete %r9b
movq %r10, %r15
shrq $0x20, %r15
movq 0x8(%rsp), %rdx
movb (%rdx,%r15), %r11b
andb %r10b, %r9b
cmpb $0x22, %r11b
sete %dl
testb %dl, %r9b
cmovnel %esi, %ebp
movq %rdi, %rsi
movq 0x10(%rsp), %rdi
cmovneq %r13, %rdi
movq %rdi, 0x10(%rsp)
movq %rsi, %rdi
cmpb $0x23, %r11b
movl %ebp, %r13d
movl $0x2, %esi
cmovel %esi, %r13d
testb %r9b, %r9b
cmovel %ebp, %r13d
cmpl $0x1, %eax
sete %bpl
andb %r10b, %bpl
cmpb $0x5c, %r11b
sete %r9b
testb %r9b, %bpl
movl $0x3, %esi
cmovnel %esi, %r13d
cmovneq %r15, %rdi
andb %dl, %bpl
movl $0x0, %edx
cmovnel %edx, %r13d
movq $-0x1, %r9
cmpb $0x1, %bpl
jne 0x6f2b
movq 0x10(%rsp), %rdx
movl 0x4(%r8,%rdx,8), %r9d
testb %bpl, %bpl
je 0x6f49
movq %r15, %rdx
subq %r9, %rdx
shlq $0x20, %r9
leaq (%r9,%rdx,8), %rdx
addq $0x8, %rdx
movq %rdx, (%r8,%rbx,8)
incq %rbx
movl $0x1, %esi
cmpl $0x3, %eax
sete %dl
andb %r10b, %dl
leaq 0x1(%rdi), %r9
cmpq %r9, %r15
setne %r9b
andb %dl, %r9b
movzbl %r9b, %r9d
subq %r9, %r12
testb %dl, %dl
cmovnel %esi, %r13d
testb $0x1, %r10b
je 0x6f91
cmpl $0x2, %eax
jne 0x6f91
movzbl %r11b, %eax
xorl %ebp, %ebp
testl %eax, %eax
je 0x6f8c
cmpl $0xa, %eax
jne 0x6f91
xorl %r13d, %r13d
jmp 0x6f94
movl %r13d, %ebp
movq %rcx, %rdx
movq 0x28(%rsp), %rcx
incq %r12
movl %r13d, %eax
cmpq (%rcx,%r14,8), %r12
jb 0x6e6e
jmp 0x6fb1
movl %eax, %r13d
incq %r14
movl %r13d, %eax
cmpq 0xa8(%rsp), %r14
jne 0x6e60
jmp 0x6fc9
xorl %ebx, %ebx
callq 0x2240
movq 0x20(%rsp), %rax
movq 0xa0(%rsp), %rcx
movq %rax, (%rcx)
movq 0x98(%rsp), %rax
movq %rbx, (%rax)
movq 0x80(%rsp), %rdi
testq %rdi, %rdi
je 0x7006
movq 0x90(%rsp), %rsi
subq %rdi, %rsi
callq 0x21a0
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0x701d
movq 0x50(%rsp), %rsi
subq %rdi, %rsi
callq 0x21a0
movq 0x58(%rsp), %rdi
testq %rdi, %rdi
je 0x7034
movq 0x68(%rsp), %rsi
subq %rdi, %rsi
callq 0x21a0
leaq 0xb0(%rsp), %rdi
callq 0x6374
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x2070
jmp 0x705a
movq %rax, %rbx
jmp 0x708d
movq %rax, %rbx
jmp 0x70a4
movq %rax, %rbx
jmp 0x70bb
jmp 0x706d
jmp 0x706d
movq %rax, %rbx
movq 0x80(%rsp), %rdi
testq %rdi, %rdi
je 0x708d
movq 0x90(%rsp), %rsi
subq %rdi, %rsi
callq 0x21a0
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0x70a4
movq 0x50(%rsp), %rsi
subq %rdi, %rsi
callq 0x21a0
movq 0x58(%rsp), %rdi
testq %rdi, %rdi
je 0x70bb
movq 0x68(%rsp), %rsi
subq %rdi, %rsi
callq 0x21a0
leaq 0xb0(%rsp), %rdi
callq 0x6374
movq %rbx, %rdi
callq 0x22d0