// File: /workspace/github_cpp_makefile_star2_O1/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 0x8713(%rip), %r14      # 0xcfd8
leaq 0x484e(%rip), %rsi      # 0x911a
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 0x8909(%rip), %rdi      # 0xd210
callq 0x22d0
testl %eax, %eax
jne 0x4c03
leaq 0x10(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rsi
callq 0x4dca
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 0x49b6
movq 0x868b(%rip), %rdi      # 0xcfd8
leaq 0x47e7(%rip), %rsi      # 0x913b
movl $0x2b, %edx
callq 0x2270
movq 0x8673(%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 0x8866(%rip), %rdi      # 0xd210
callq 0x2170
xorl %ebx, %ebx
jmp 0x4bca
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 0x85e0(%rip), %rdi      # 0xcfd8
leaq 0x4768(%rip), %rsi      # 0x9167
movl $0x23, %edx
callq 0x2270
movq (%r14), %rsi
movq 0x85c5(%rip), %rdi      # 0xcfd8
callq 0x2140
movq %rax, %r15
leaq 0x4769(%rip), %rsi      # 0x918b
movl $0x4, %edx
movq %rax, %rdi
callq 0x2270
movq %r15, %rdi
movl $0x10, %esi
callq 0x2390
movq %rax, %r15
leaq 0x474a(%rip), %rsi      # 0x9190
movl $0x9, %edx
movq %rax, %rdi
callq 0x2270
movq %r15, %rdi
callq 0x2150
addq $0x401f8, %rbx          # imm = 0x401F8
xorl %r12d, %r12d
movq 0x856c(%rip), %r15      # 0xcfd8
leaq 0x471d(%rip), %r13      # 0x9190
cmpq $0x10, %r12
je 0x4b21
movq %rbx, %rdi
leaq 0x30(%rsp), %rsi
callq 0x5556
testb %al, %al
je 0x4b5a
movl $0x23, %edx
movq %r15, %rdi
leaq 0x46c6(%rip), %rsi      # 0x9167
callq 0x2270
movq (%r14), %rsi
movq %r15, %rdi
callq 0x2140
movq %rax, %rbp
movl $0x2, %edx
movq %rax, %rdi
leaq 0x4709(%rip), %rsi      # 0x91cc
callq 0x2270
incq %r12
movq %rbp, %rdi
movq %r12, %rsi
callq 0x2140
movq %rax, %rbp
movl $0x1, %edx
movq %rax, %rdi
leaq 0x46a6(%rip), %rsi      # 0x918e
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 0x4a73
movq (%r15), %rax
addq -0x18(%rax), %r15
movq %r15, %rdi
movl $0xa, %esi
callq 0x2210
movsbl %al, %esi
movq 0x8499(%rip), %rdi      # 0xcfd8
callq 0x2030
movq %rax, %rdi
callq 0x2150
movb $0x1, %bl
leaq 0x30(%rsp), %rdi
callq 0x2050
jmp 0x4bbe
cmpq $0x10, %r12
setae %bl
movq 0x8470(%rip), %rdi      # 0xcfd8
leaq 0x462b(%rip), %rsi      # 0x919a
movl $0x31, %edx
callq 0x2270
movq 0x8458(%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 0x864b(%rip), %rdi      # 0xd210
callq 0x2170
leaq 0x30(%rsp), %rdi
callq 0x2060
leaq 0x20(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x4bef
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 0x4c22
jmp 0x4c15
jmp 0x4c15
jmp 0x4c15
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0x2060
leaq 0x20(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x4c3d
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x2230
movq %rbx, %rdi
callq 0x23a0
nop