// File: /workspace/github_cpp_makefile_star2_O3/CMU-SAFARI[P]optimal-seed-solver/readGenerator.cc
// Function: main
int main(int argc, char* argv[]) {\
	if (argc != 6) {
		cout << "usage: >readGenerator refFile readFile chromoNum readLen readNum" << endl;
		return 1;
	}
	ofstream readFile(argv[2]);

	RefDB refDB;
	refDB.loadRefFile(argv[1]);
	refDB.loadChromo(atoi(argv[3]) );

	int readLen = atoi(argv[4]);
	int readNum = atoi(argv[5]);

	srand(1);
	string read;
	int location;

	for (int i = 0; i < readNum; i++) {
		do {
			location = rand() % (refDB.getChromoLength() - readLen);
			read = refDB.getRefSeq(location, readLen);
		}
		while (read.find('N') != string::npos);

//		cout << location << " "<< read << endl;
		readFile << location << " "<< read << endl;
	}

	readFile.close();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x4d8, %rsp            # imm = 0x4D8
cmpl $0x6, %edi
jne 0x26f1
movq %rsi, %r14
movq 0x10(%rsi), %rsi
leaq 0x70(%rsp), %rdi
movl $0x10, %edx
callq 0x2210
leaq 0x270(%rsp), %rdi
callq 0x2888
movq 0x8(%r14), %rsi
leaq 0x30(%rsp), %rdi
leaq 0x10(%rsp), %rdx
callq 0x27b2
leaq 0x270(%rsp), %rdi
leaq 0x30(%rsp), %rsi
callq 0x294a
leaq 0x40(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2549
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x21f0
movq 0x18(%r14), %rdi
callq 0x22e0
leaq 0x270(%rsp), %rdi
movl %eax, %esi
callq 0x2d2a
movq 0x20(%r14), %rdi
callq 0x22e0
movl %eax, %ebx
movq 0x28(%r14), %rdi
callq 0x22e0
movl %eax, %ebp
movl $0x1, %edi
callq 0x21b0
leaq 0x20(%rsp), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
movl %ebp, 0xc(%rsp)
testl %ebp, %ebp
jle 0x2688
xorl %ebp, %ebp
leaq 0x270(%rsp), %r14
leaq 0x50(%rsp), %r15
leaq 0x10(%rsp), %r12
callq 0x20a0
movl %eax, %r13d
movq %r14, %rdi
callq 0x2f7a
movl %eax, %ecx
subl %ebx, %ecx
movl %r13d, %eax
xorl %edx, %edx
divl %ecx
movl %edx, %r13d
movq %r15, %rdi
movq %r14, %rsi
movl %ebx, %ecx
callq 0x2fc0
movq %r12, %rdi
movq %r15, %rsi
callq 0x2270
movq 0x50(%rsp), %rdi
leaq 0x60(%rsp), %rax
cmpq %rax, %rdi
je 0x2607
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x21f0
movq %r12, %rdi
movl $0x4e, %esi
xorl %edx, %edx
callq 0x2290
cmpq $-0x1, %rax
jne 0x25b5
leaq 0x70(%rsp), %rdi
movl %r13d, %esi
callq 0x2310
movq %rax, %r13
movl $0x1, %edx
movq %rax, %rdi
leaq 0x1a5e(%rip), %rsi      # 0x4099
callq 0x2240
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %rdx
movq %r13, %rdi
callq 0x2240
movq %rax, %r13
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x21c0
movsbl %al, %esi
movq %r13, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2140
incl %ebp
cmpl 0xc(%rsp), %ebp
jne 0x25b5
leaq 0x70(%rsp), %rdi
callq 0x22b0
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x26ae
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x21f0
leaq 0x270(%rsp), %rdi
callq 0x28e6
movq 0x3906(%rip), %rax      # 0x5fc8
movq (%rax), %rcx
movq 0x18(%rax), %rax
leaq 0x78(%rsp), %rdi
movq %rcx, -0x8(%rdi)
movq -0x18(%rcx), %rcx
movq %rax, 0x70(%rsp,%rcx)
callq 0x2180
leaq 0x168(%rsp), %rdi
callq 0x20c0
xorl %eax, %eax
jmp 0x2738
movq 0x38d8(%rip), %rbx      # 0x5fd0
leaq 0x1905(%rip), %rsi      # 0x4004
movl $0x40, %edx
movq %rbx, %rdi
callq 0x2240
movq (%rbx), %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
movl $0x1, %eax
addq $0x4d8, %rsp            # imm = 0x4D8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x2774
jmp 0x2766
movq %rax, %rbx
leaq 0x40(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2793
movq 0x40(%rsp), %rsi
jmp 0x278b
movq %rax, %rbx
jmp 0x2793
movq %rax, %rbx
jmp 0x27a0
jmp 0x2774
jmp 0x2774
movq %rax, %rbx
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x2793
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x21f0
leaq 0x270(%rsp), %rdi
callq 0x28e6
leaq 0x70(%rsp), %rdi
callq 0x22c0
movq %rbx, %rdi
callq 0x2330