// File: /workspace/github_cpp_makefile_star2_O3/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 0x8773(%rip), %r14      # 0xcfd8
leaq 0x48ce(%rip), %rsi      # 0x913a
movl $0x20, %edx
movq %r14, %rdi
callq 0x2270
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x2210
movsbl %al, %esi
movq %r14, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2150
leaq 0x8969(%rip), %rdi      # 0xd210
callq 0x22d0
testl %eax, %eax
jne 0x4ba3
leaq 0x10(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rsi
callq 0x4d6a
leaq 0x30(%rsp), %rdi
movq %r14, %rsi
movl $0x8, %edx
callq 0x2330
movq 0x30(%rsp), %rax
movq -0x18(%rax), %rax
cmpl $0x0, 0x50(%rsp,%rax)
je 0x4956
movq 0x86eb(%rip), %rdi      # 0xcfd8
leaq 0x4867(%rip), %rsi      # 0x915b
movl $0x2b, %edx
callq 0x2270
movq 0x86d3(%rip), %rdi      # 0xcfd8
movl $0x10, %esi
callq 0x2390
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2210
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2150
leaq 0x30(%rsp), %rdi
callq 0x2050
leaq 0x88c6(%rip), %rdi      # 0xd210
callq 0x2170
xorl %ebx, %ebx
jmp 0x4b6a
leaq 0x85a20(%rbx), %r14
leaq 0x30(%rsp), %rdi
movq %r14, %rsi
callq 0x20f0
leaq 0x30(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x2240
callq 0x2040
imulq $-0x3b9aca00, 0x8(%rsp), %rcx # imm = 0xC4653600
addq %rax, %rcx
movq %rcx, 0x85a30(%rbx)
movq 0x8640(%rip), %rdi      # 0xcfd8
leaq 0x47e8(%rip), %rsi      # 0x9187
movl $0x23, %edx
callq 0x2270
movq (%r14), %rsi
movq 0x8625(%rip), %rdi      # 0xcfd8
callq 0x2140
movq %rax, %r15
leaq 0x47e9(%rip), %rsi      # 0x91ab
movl $0x4, %edx
movq %rax, %rdi
callq 0x2270
movq %r15, %rdi
movl $0x10, %esi
callq 0x2390
movq %rax, %r15
leaq 0x47ca(%rip), %rsi      # 0x91b0
movl $0x9, %edx
movq %rax, %rdi
callq 0x2270
movq %r15, %rdi
callq 0x2150
addq $0x401f8, %rbx          # imm = 0x401F8
xorl %r12d, %r12d
movq 0x85cc(%rip), %r15      # 0xcfd8
leaq 0x479d(%rip), %r13      # 0x91b0
cmpq $0x10, %r12
je 0x4ac1
movq %rbx, %rdi
leaq 0x30(%rsp), %rsi
callq 0x54ee
testb %al, %al
je 0x4afa
movl $0x23, %edx
movq %r15, %rdi
leaq 0x4746(%rip), %rsi      # 0x9187
callq 0x2270
movq (%r14), %rsi
movq %r15, %rdi
callq 0x2140
movq %rax, %rbp
movl $0x2, %edx
movq %rax, %rdi
leaq 0x4789(%rip), %rsi      # 0x91ec
callq 0x2270
incq %r12
movq %rbp, %rdi
movq %r12, %rsi
callq 0x2140
movq %rax, %rbp
movl $0x1, %edx
movq %rax, %rdi
leaq 0x4726(%rip), %rsi      # 0x91ae
callq 0x2270
movq %rbp, %rdi
movl $0x10, %esi
callq 0x2390
movq %rax, %rbp
movl $0x9, %edx
movq %rax, %rdi
movq %r13, %rsi
callq 0x2270
addq $0x4578, %rbx           # imm = 0x4578
movq %rbp, %rdi
callq 0x2150
jmp 0x4a13
movq (%r15), %rax
addq -0x18(%rax), %r15
movq %r15, %rdi
movl $0xa, %esi
callq 0x2210
movsbl %al, %esi
movq 0x84f9(%rip), %rdi      # 0xcfd8
callq 0x2030
movq %rax, %rdi
callq 0x2150
movb $0x1, %bl
leaq 0x30(%rsp), %rdi
callq 0x2050
jmp 0x4b5e
cmpq $0x10, %r12
setae %bl
movq 0x84d0(%rip), %rdi      # 0xcfd8
leaq 0x46ab(%rip), %rsi      # 0x91ba
movl $0x31, %edx
callq 0x2270
movq 0x84b8(%rip), %rdi      # 0xcfd8
movl $0x10, %esi
callq 0x2390
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x2210
movsbl %al, %esi
movq %r14, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2150
leaq 0x30(%rsp), %rdi
callq 0x2050
leaq 0x86ab(%rip), %rdi      # 0xd210
callq 0x2170
leaq 0x30(%rsp), %rdi
callq 0x2060
leaq 0x20(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x4b8f
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x2230
movl %ebx, %eax
addq $0x238, %rsp            # imm = 0x238
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl %eax, %edi
callq 0x2130
movq %rax, %rbx
jmp 0x4bc2
jmp 0x4bb5
jmp 0x4bb5
jmp 0x4bb5
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0x2060
leaq 0x20(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x4bdd
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x2230
movq %rbx, %rdi
callq 0x23a0
nop