// File: /workspace/github_cpp_makefile_star2_O1/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 0x2988
movq %rbx, %rdi
callq 0x2060
movq 0x208(%rbx), %rax
cmpq %rax, 0x210(%rbx)
je 0x2988
movq %rax, 0x210(%rbx)
movq (%r14), %rsi
movq %rbx, %rdi
movl $0x8, %edx
callq 0x2120
movq %r15, %rdi
callq 0x2080
testb %al, %al
je 0x2c85
leaq 0x16d4(%rip), %rsi      # 0x4083
leaq 0x58(%rsp), %r15
movq %r15, %rdi
movq %r14, %rdx
callq 0x315e
leaq 0x16bf(%rip), %rsi      # 0x4085
movq %r15, %rdi
callq 0x2360
leaq 0x28(%rsp), %rsi
movq %rsi, -0x10(%rsi)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x29f5
movq %rdx, 0x18(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x28(%rsp)
jmp 0x29fb
movups (%rcx), %xmm0
movups %xmm0, (%rsi)
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 0x2a2e
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 0x2ac5
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 0x2be3
movq (%rsp), %rax
movq %rax, 0x38(%rsp)
movq $0x0, 0x40(%rsp)
movq 0x210(%rbx), %rsi
cmpq 0x218(%rbx), %rsi
je 0x2ab8
movups 0x38(%rsp), %xmm0
movups %xmm0, (%rsi)
addq $0x10, 0x210(%rbx)
jmp 0x2a67
movq %r14, %rdi
movq %r13, %rdx
callq 0x3276
jmp 0x2a67
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 0x2bca
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 0x2bb8
movq 0x210(%rbx), %rsi
cmpq 0x218(%rbx), %rsi
je 0x2b77
movaps (%rsp), %xmm0
movups %xmm0, (%rsi)
addq $0x10, 0x210(%rbx)
jmp 0x2b82
movq %r14, %rdi
movq %rsp, %rdx
callq 0x33b6
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 0x2b19
movq 0x38(%rsp), %rdi
cmpq %r13, %rdi
je 0x2c43
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x21f0
jmp 0x2c43
movq 0x33e6(%rip), %rdi      # 0x5fd0
leaq 0x149a(%rip), %rsi      # 0x408b
movl $0xf, %edx
callq 0x2240
movq 0x210(%rbx), %rsi
subq 0x208(%rbx), %rsi
sarq $0x4, %rsi
movq 0x33bc(%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 0x58(%rsp), %rdi
callq 0x2040
leaq 0x58(%rsp), %rdi
callq 0x2070
movq 0x18(%rsp), %rdi
leaq 0x28(%rsp), %rax
cmpq %rax, %rdi
je 0x2c73
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 0x3364(%rip), %rdi      # 0x5ff0
leaq 0x13dc(%rip), %rsi      # 0x406f
callq 0x21d0
movq %rax, %rdi
callq 0x20f0
movl $0x1, %edi
callq 0x2260
movq %rax, %rbx
jmp 0x2cf8
movq %rax, %rbx
leaq 0x68(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2d14
movq 0x68(%rsp), %rsi
jmp 0x2d0c
jmp 0x2ccf
jmp 0x2ccf
jmp 0x2ccf
jmp 0x2cd4
movq %rax, %rbx
jmp 0x2cee
movq %rax, %rbx
movq 0x38(%rsp), %rdi
cmpq %r13, %rdi
je 0x2cee
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 0x2d14
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x21f0
movq %rbx, %rdi
callq 0x2330