// File: ClauParser[P]ClauParser/./include/clau_parser.h
// Function: clau_parser::InFileReserver::Scan(_IO_FILE*, int, char*&, unsigned long*, long*&, unsigned long*, bool)
static std::pair<bool, int> Scan(FILE* inFile, int thr_num,
			char*& _buffer, size_t* _buffer_len, int64_t*& _token_arr, size_t* _token_arr_len, bool use_simd)
		{
			if (inFile == nullptr) {
				return { false, 0 };
			}

			std::string temp;
			char* buffer = nullptr;
			size_t file_length;

			{
				fseek(inFile, 0, SEEK_END);
				size_t length = ftell(inFile);
				fseek(inFile, 0, SEEK_SET);

				Utility::BomType x = Utility::ReadBom(inFile);

				//	clau_parser::Out << "length " << length << "\n";
				if (x == Utility::BomType::UTF_8) {
					length = length - 3;
				}

				file_length = length;
				buffer = new char[file_length + 1]; // 

				//int a = clock();
				// read data as a block:
				fread(buffer, sizeof(char), file_length, inFile);
				//int b = clock();
				////std::cout << b - a << " " << file_length <<"\n";

				buffer[file_length] = '\0';

				{
					int64_t* token_arr;
					size_t token_arr_size;

					if (thr_num == 1) {
						Scanning(buffer, file_length, token_arr, token_arr_size);
					}
					else {
						ScanningNew(buffer, file_length, thr_num, token_arr, token_arr_size, use_simd);
					}

					_buffer = buffer;
					_token_arr = token_arr;
					*_token_arr_len = token_arr_size;
					*_buffer_len = file_length;
				}
			}

			return{ true, 1 };
		}

// Assembly:
subq $0xc8, %rsp
movb 0xd0(%rsp), %al
movq %rdi, 0xb8(%rsp)
movl %esi, 0xb4(%rsp)
movq %rdx, 0xa8(%rsp)
movq %rcx, 0xa0(%rsp)
movq %r8, 0x98(%rsp)
movq %r9, 0x90(%rsp)
andb $0x1, %al
movb %al, 0x8f(%rsp)
cmpq $0x0, 0xb8(%rsp)
jne 0xca86
movb $0x0, 0x8e(%rsp)
movl $0x0, 0x88(%rsp)
leaq 0xc0(%rsp), %rdi
leaq 0x8e(%rsp), %rsi
leaq 0x88(%rsp), %rdx
callq 0xce60
jmp 0xcc4d
leaq 0x68(%rsp), %rdi
callq 0x3350
movq $0x0, 0x60(%rsp)
movq 0xb8(%rsp), %rdi
xorl %eax, %eax
movl %eax, %esi
movl $0x2, %edx
callq 0x32b0
jmp 0xcab1
movq 0xb8(%rsp), %rdi
callq 0x3030
movq %rax, 0x18(%rsp)
jmp 0xcac5
movq 0x18(%rsp), %rax
movq %rax, 0x40(%rsp)
movq 0xb8(%rsp), %rdi
xorl %edx, %edx
movl %edx, %esi
callq 0x32b0
jmp 0xcae2
movq 0xb8(%rsp), %rdi
callq 0xce90
movl %eax, 0x14(%rsp)
jmp 0xcaf5
movl 0x14(%rsp), %eax
movl %eax, 0x3c(%rsp)
cmpl $0x0, 0x3c(%rsp)
jne 0xcb31
movq 0x40(%rsp), %rax
subq $0x3, %rax
movq %rax, 0x40(%rsp)
jmp 0xcb31
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x50(%rsp)
movl %eax, 0x4c(%rsp)
leaq 0x68(%rsp), %rdi
callq 0x3160
jmp 0xcc5d
movq 0x40(%rsp), %rax
movq %rax, 0x58(%rsp)
movq 0x58(%rsp), %rdi
incq %rdi
callq 0x3040
movq %rax, 0x8(%rsp)
jmp 0xcb4f
movq 0x8(%rsp), %rax
movq %rax, 0x60(%rsp)
movq 0x60(%rsp), %rdi
movq 0x58(%rsp), %rdx
movq 0xb8(%rsp), %rcx
movl $0x1, %esi
callq 0x3370
jmp 0xcb77
movq 0x60(%rsp), %rax
movq 0x58(%rsp), %rcx
movb $0x0, (%rax,%rcx)
cmpl $0x1, 0xb4(%rsp)
jne 0xcbac
movq 0x60(%rsp), %rdi
movq 0x58(%rsp), %rsi
leaq 0x30(%rsp), %rdx
leaq 0x28(%rsp), %rcx
callq 0xcf80
jmp 0xcbaa
jmp 0xcbdd
movq 0x60(%rsp), %rdi
movq 0x58(%rsp), %rsi
movl 0xb4(%rsp), %edx
movzbl 0x8f(%rsp), %r9d
andl $0x1, %r9d
leaq 0x30(%rsp), %rcx
leaq 0x28(%rsp), %r8
callq 0xd630
jmp 0xcbdb
jmp 0xcbdd
movq 0x60(%rsp), %rcx
movq 0xa8(%rsp), %rax
movq %rcx, (%rax)
movq 0x30(%rsp), %rcx
movq 0x98(%rsp), %rax
movq %rcx, (%rax)
movq 0x28(%rsp), %rcx
movq 0x90(%rsp), %rax
movq %rcx, (%rax)
movq 0x58(%rsp), %rcx
movq 0xa0(%rsp), %rax
movq %rcx, (%rax)
movb $0x1, 0x27(%rsp)
movl $0x1, 0x20(%rsp)
leaq 0xc0(%rsp), %rdi
leaq 0x27(%rsp), %rsi
leaq 0x20(%rsp), %rdx
callq 0xce60
jmp 0xcc43
leaq 0x68(%rsp), %rdi
callq 0x3160
movq 0xc0(%rsp), %rax
addq $0xc8, %rsp
retq
movq 0x50(%rsp), %rdi
callq 0x33d0
nopw (%rax,%rax)