// File: /workspace/github_cpp_makefile_star2_O2/ksabry[P]bfbrute/src/ProgramSearch.h
// Function: ProgramSearch<ProgramIterator<400ul, 32ul, 12ul, 32ul>, DataCache<32ul, 12ul>>::LoadFindStringProgress()
bool LoadFindStringProgress()
	{
		std::cout << "Attempting to load progress file" << std::endl;

		lock.lock();

		std::string filename = Filename();
		std::ifstream file(filename);

		if (!file.good())
		{
			std::cout << "No progress file found; starting from size " << SIZE_START << std::endl;
			file.close();
			lock.unlock();
			return false;
		}

		int64_t elapsed;

		file >> programSize;
		file >> elapsed;
		sizeStart = std::chrono::system_clock::now() - std::chrono::seconds(elapsed);

		std::cout << "Progress file found; resuming size " << programSize << " (0/" << THREAD_COUNT << " loaded)\r" << std::flush;

		for (uint_fast32_t thread_idx = 0; thread_idx < THREAD_COUNT; thread_idx++)
		{
			if (!iterators[thread_idx].Deserialize(file))
			{
				std::cout << "Failed to load progress file; starting from size " << SIZE_START << std::endl;
				file.close();
				lock.unlock();
				return false;
			}
			std::cout << "Progress file found; resuming size " << programSize << " (" << thread_idx + 1 << "/" << THREAD_COUNT << " loaded)\r" << std::flush;
		}

		std::cout << std::endl;
		file.close();
		lock.unlock();
		return true;
	}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x238, %rsp            # imm = 0x238
movq %rdi, %rbx
movq 0x8aaf(%rip), %rdi      # 0xcfd8
leaq 0x3bea(%rip), %rsi      # 0x811a
callq 0x2210
movq %rax, %rdi
callq 0x20d0
leaq 0x8cd4(%rip), %rdi      # 0xd218
callq 0x48fe
leaq 0x10(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rsi
callq 0x4912
leaq 0x30(%rsp), %rdi
pushq $0x8
popq %rdx
movq %r14, %rsi
callq 0x2330
movq 0x30(%rsp), %rax
movq -0x18(%rax), %rax
cmpl $0x0, 0x50(%rsp,%rax)
je 0x45bc
movq 0x8a58(%rip), %rdi      # 0xcfd8
leaq 0x3bb4(%rip), %rsi      # 0x813b
callq 0x2210
pushq $0x10
popq %rsi
movq %rax, %rdi
callq 0x2380
movq %rax, %rdi
callq 0x20d0
leaq 0x30(%rsp), %rdi
callq 0x2040
leaq 0x8c68(%rip), %rdi      # 0xd218
callq 0x2170
xorl %ebx, %ebx
jmp 0x474e
leaq 0x85a20(%rbx), %r14
leaq 0x30(%rsp), %rdi
movq %r14, %rsi
callq 0x20f0
leaq 0x30(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x2240
callq 0x2030
imulq $-0x3b9aca00, 0x8(%rsp), %rcx # imm = 0xC4653600
addq %rax, %rcx
movq %rcx, 0x85a30(%rbx)
movq 0x89da(%rip), %rdi      # 0xcfd8
leaq 0x3b62(%rip), %rsi      # 0x8167
callq 0x2210
movq (%r14), %rsi
movq %rax, %rdi
callq 0x2140
leaq 0x3b6f(%rip), %rsi      # 0x818b
movq %rax, %rdi
callq 0x2210
pushq $0x10
popq %rsi
movq %rax, %rdi
callq 0x2380
leaq 0x3b5a(%rip), %rsi      # 0x8190
movq %rax, %rdi
callq 0x2210
movq %rax, %rdi
callq 0x2150
addq $0x401f8, %rbx          # imm = 0x401F8
xorl %r15d, %r15d
leaq 0x30(%rsp), %r12
pushq $0x10
popq %r13
leaq 0x3b30(%rip), %rbp      # 0x8190
cmpq $0x10, %r15
je 0x46f1
movq %rbx, %rdi
movq %r12, %rsi
callq 0x4c96
testb %al, %al
je 0x470b
movq 0x8954(%rip), %rdi      # 0xcfd8
leaq 0x3adc(%rip), %rsi      # 0x8167
callq 0x2210
movq (%r14), %rsi
movq %rax, %rdi
callq 0x2140
movq %rax, %rdi
leaq 0x3b27(%rip), %rsi      # 0x81cc
callq 0x2210
incq %r15
movq %rax, %rdi
movq %r15, %rsi
callq 0x2140
movq %rax, %rdi
leaq 0x3acc(%rip), %rsi      # 0x818e
callq 0x2210
movq %rax, %rdi
movl %r13d, %esi
callq 0x2380
movq %rax, %rdi
movq %rbp, %rsi
callq 0x2210
addq $0x4578, %rbx           # imm = 0x4578
movq %rax, %rdi
callq 0x2150
jmp 0x4660
movq 0x88e0(%rip), %rdi      # 0xcfd8
callq 0x20d0
movb $0x1, %bl
leaq 0x30(%rsp), %rdi
callq 0x2040
jmp 0x4742
cmpq $0x10, %r15
setae %bl
movq 0x88bf(%rip), %rdi      # 0xcfd8
leaq 0x3a7a(%rip), %rsi      # 0x819a
callq 0x2210
pushq $0x10
popq %rsi
movq %rax, %rdi
callq 0x2380
movq %rax, %rdi
callq 0x20d0
leaq 0x30(%rsp), %rdi
callq 0x2040
leaq 0x8acf(%rip), %rdi      # 0xd218
callq 0x2170
leaq 0x30(%rsp), %rdi
callq 0x2060
leaq 0x10(%rsp), %rdi
callq 0x20b0
movl %ebx, %eax
addq $0x238, %rsp            # imm = 0x238
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x4781
movq %rax, %rbx
jmp 0x478e
jmp 0x4781
jmp 0x4781
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0x2060
leaq 0x10(%rsp), %rdi
callq 0x20b0
movq %rbx, %rdi
callq 0x2390