// File: /workspace/github_cpp_makefile_star2_O3/CMU-SAFARI[P]optimal-seed-solver/RefDB.cc
// Function: RefDB::loadRefFile(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
void RefDB::loadRefFile(string refName) {
	if (refFile.is_open()) {
		refFile.close();
		refPos.clear();
	}

	refFile.open(refName.c_str());

	if (!refFile.is_open()) {
		cerr << "RefFile open failed" << endl;
		exit(1);
	}

	string refMetaName = "." + refName + ".meta";
	fstream refMetaFile(refMetaName.c_str(), ios_base::in);

	if (refMetaFile.is_open()) {
		unsigned long int tempPos;
		while (refMetaFile >> tempPos) {
			refPos.push_back((streampos) tempPos);
		}

		cout << "refPos.size(): " << refPos.size() << endl;

	} else {

		refMetaFile.open(refMetaName.c_str(), ios_base::out | ios_base::trunc);

		string temp;
		streampos tempRefPos;

		while (refFile.good()) {
			tempRefPos = refFile.tellg();
			getline(refFile, temp);
			if (temp[0] == '>') {
				refPos.push_back(tempRefPos);
				refMetaFile << (unsigned long int) tempRefPos << endl;
			}
		}
	}

	refMetaFile.close();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x268, %rsp            # imm = 0x268
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x78(%rdi), %r15
movq %r15, %rdi
callq 0x2080
testb %al, %al
je 0x2990
movq %rbx, %rdi
callq 0x2060
movq 0x208(%rbx), %rax
cmpq %rax, 0x210(%rbx)
je 0x2990
movq %rax, 0x210(%rbx)
movq (%r14), %rsi
movq %rbx, %rdi
movl $0x8, %edx
callq 0x2120
movq %r15, %rdi
callq 0x2080
testb %al, %al
je 0x2c93
leaq 0x16cc(%rip), %rsi      # 0x4083
leaq 0x58(%rsp), %r15
movq %r15, %rdi
movq %r14, %rdx
callq 0x317a
leaq 0x16b7(%rip), %rsi      # 0x4085
movq %r15, %rdi
callq 0x2360
leaq 0x28(%rsp), %r14
movq %r14, -0x10(%r14)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x29fd
movq %rdx, 0x18(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x28(%rsp)
jmp 0x2a04
movups (%rcx), %xmm0
movups %xmm0, (%r14)
movq 0x8(%rax), %rdx
movq %rdx, 0x20(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x68(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2a37
movq 0x68(%rsp), %rsi
incq %rsi
callq 0x21f0
movq 0x18(%rsp), %rsi
leaq 0x58(%rsp), %rdi
movl $0x8, %edx
callq 0x22a0
leaq 0xd8(%rsp), %rdi
callq 0x2080
testb %al, %al
je 0x2ace
leaq 0x208(%rbx), %r14
leaq 0x58(%rsp), %r15
movq %rsp, %r12
leaq 0x38(%rsp), %r13
movq %r15, %rdi
movq %r12, %rsi
callq 0x2110
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x2bf1
movq (%rsp), %rax
movq %rax, 0x38(%rsp)
movq $0x0, 0x40(%rsp)
movq 0x210(%rbx), %rsi
cmpq 0x218(%rbx), %rsi
je 0x2ac1
movups 0x38(%rsp), %xmm0
movups %xmm0, (%rsi)
addq $0x10, 0x210(%rbx)
jmp 0x2a70
movq %r14, %rdi
movq %r13, %rdx
callq 0x3298
jmp 0x2a70
movq 0x18(%rsp), %rsi
leaq 0x58(%rsp), %rdi
movl $0x30, %edx
callq 0x21a0
leaq 0x48(%rsp), %r13
movq %r13, -0x10(%r13)
movq $0x0, -0x8(%r13)
movb $0x0, (%r13)
xorps %xmm0, %xmm0
movaps %xmm0, (%rsp)
movq (%rbx), %rax
movq -0x18(%rax), %rax
cmpl $0x0, 0x20(%rbx,%rax)
jne 0x2c56
leaq 0x208(%rbx), %r14
leaq 0x68(%rsp), %r15
leaq 0x38(%rsp), %r12
movq %rbx, %rdi
callq 0x2320
movq %rax, (%rsp)
movq %rdx, 0x8(%rsp)
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x21c0
movsbl %al, %edx
movq %rbx, %rdi
movq %r12, %rsi
callq 0x2350
movq 0x38(%rsp), %rax
cmpb $0x3e, (%rax)
jne 0x2bc1
movq 0x210(%rbx), %rsi
cmpq 0x218(%rbx), %rsi
je 0x2b80
movaps (%rsp), %xmm0
movups %xmm0, (%rsi)
addq $0x10, 0x210(%rbx)
jmp 0x2b8b
movq %r14, %rdi
movq %rsp, %rdx
callq 0x33d8
movq (%rsp), %rsi
movq %r15, %rdi
callq 0x2130
movq %rax, %rbp
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbp, %rdi
movl $0xa, %esi
callq 0x21c0
movsbl %al, %esi
movq %rbp, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2140
movq (%rbx), %rax
movq -0x18(%rax), %rax
cmpl $0x0, 0x20(%rbx,%rax)
je 0x2b22
movq 0x38(%rsp), %rdi
cmpq %r13, %rdi
leaq 0x28(%rsp), %r14
je 0x2c56
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x21f0
jmp 0x2c56
movq 0x33d8(%rip), %rdi      # 0x5fd0
leaq 0x148c(%rip), %rsi      # 0x408b
movl $0xf, %edx
callq 0x2240
movq 0x210(%rbx), %rsi
subq 0x208(%rbx), %rsi
sarq $0x4, %rsi
movq 0x33ae(%rip), %rdi      # 0x5fd0
callq 0x2130
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x21c0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2140
leaq 0x28(%rsp), %r14
leaq 0x58(%rsp), %rdi
callq 0x2040
leaq 0x58(%rsp), %rdi
callq 0x2070
movq 0x18(%rsp), %rdi
cmpq %r14, %rdi
je 0x2c81
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x21f0
addq $0x268, %rsp            # imm = 0x268
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x3356(%rip), %rdi      # 0x5ff0
leaq 0x13ce(%rip), %rsi      # 0x406f
callq 0x21d0
movq %rax, %rdi
callq 0x20f0
movl $0x1, %edi
callq 0x2260
movq %rax, %rbx
jmp 0x2d06
movq %rax, %rbx
leaq 0x68(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2d22
movq 0x68(%rsp), %rsi
jmp 0x2d1a
jmp 0x2cdd
jmp 0x2cdd
jmp 0x2cdd
jmp 0x2ce2
movq %rax, %rbx
jmp 0x2cfc
movq %rax, %rbx
movq 0x38(%rsp), %rdi
cmpq %r13, %rdi
je 0x2cfc
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x21f0
leaq 0x58(%rsp), %rdi
callq 0x2070
movq 0x18(%rsp), %rdi
leaq 0x28(%rsp), %rax
cmpq %rax, %rdi
je 0x2d22
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x21f0
movq %rbx, %rdi
callq 0x2330