// File: deprekate[P]RepeatFinder/src/repeatfinder.cpp
// Function: find_repeats(char*, std::vector<int, std::allocator<int>> (&) [4194304])
void find_repeats(char *dna, std::vector<int> (&allrepeats)[HASH_LEN])
{
	int dna_len;
	int key, start, keylen = 2 * (REPEAT_LEN - 1);

	dna_len = (int)strlen(dna);
	key = 0;
	for(start = 0;start < REPEAT_LEN; start++){
		key = (key<<2) + converter[(unsigned char)dna[start]];
	}
	allrepeats[key].push_back(0);
	for(start = 1;start < dna_len-REPEAT_LEN+1; start++)
	{
		key = ((key&((1<<keylen)-1))<< 2) + converter[(unsigned char)dna[start+REPEAT_LEN-1]];
		allrepeats[key].push_back(start);
	}
	//find reverse repeat
	key = 0;
	for(start = dna_len-1;start > dna_len-1-REPEAT_LEN; start--)
	{
		key = (key<<2) + converter[complement[(unsigned char)dna[start]]];
	}
	allrepeats[key].push_back((dna_len-1)*(-1));
	
	for(start = dna_len-2;start > REPEAT_LEN-2; start--)
	{
		key = ((key&((1<<keylen)-1))<<2) + converter[complement[(unsigned char)dna[start-REPEAT_LEN+1]]];
		allrepeats[key].push_back(start*(-1));
	}
}

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x30(%rsp)
movq %rsi, 0x28(%rsp)
movl $0x14, 0x18(%rsp)
movq 0x30(%rsp), %rdi
callq 0x4060
movl %eax, 0x24(%rsp)
movl $0x0, 0x20(%rsp)
movl $0x0, 0x1c(%rsp)
cmpl $0xb, 0x1c(%rsp)
jge 0x4f7d
movl 0x20(%rsp), %eax
shll $0x2, %eax
movq 0x30(%rsp), %rcx
movslq 0x1c(%rsp), %rdx
movzbl (%rcx,%rdx), %ecx
movl %ecx, %edx
movq 0x6067(%rip), %rcx      # 0xafd0
addl (%rcx,%rdx,4), %eax
movl %eax, 0x20(%rsp)
movl 0x1c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x1c(%rsp)
jmp 0x4f44
movq 0x28(%rsp), %rdi
movslq 0x20(%rsp), %rax
imulq $0x18, %rax, %rax
addq %rax, %rdi
movl $0x0, 0x14(%rsp)
leaq 0x14(%rsp), %rsi
callq 0x5b20
movl $0x1, 0x1c(%rsp)
movl 0x1c(%rsp), %eax
movl 0x24(%rsp), %ecx
subl $0xb, %ecx
addl $0x1, %ecx
cmpl %ecx, %eax
jge 0x5021
movl 0x20(%rsp), %eax
movl 0x18(%rsp), %ecx
movl $0x1, %edx
shll %cl, %edx
movl %edx, %ecx
subl $0x1, %ecx
andl %ecx, %eax
shll $0x2, %eax
movq 0x30(%rsp), %rcx
movl 0x1c(%rsp), %edx
addl $0xb, %edx
subl $0x1, %edx
movslq %edx, %rdx
movzbl (%rcx,%rdx), %ecx
movl %ecx, %edx
movq 0x5fde(%rip), %rcx      # 0xafd0
addl (%rcx,%rdx,4), %eax
movl %eax, 0x20(%rsp)
movq 0x28(%rsp), %rdi
movslq 0x20(%rsp), %rax
imulq $0x18, %rax, %rax
addq %rax, %rdi
leaq 0x1c(%rsp), %rsi
callq 0x5b50
movl 0x1c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x1c(%rsp)
jmp 0x4fa8
movl $0x0, 0x20(%rsp)
movl 0x24(%rsp), %eax
subl $0x1, %eax
movl %eax, 0x1c(%rsp)
movl 0x1c(%rsp), %eax
movl 0x24(%rsp), %ecx
subl $0x1, %ecx
subl $0xb, %ecx
cmpl %ecx, %eax
jle 0x5083
movl 0x20(%rsp), %eax
shll $0x2, %eax
movq 0x30(%rsp), %rcx
movslq 0x1c(%rsp), %rdx
movzbl (%rcx,%rdx), %ecx
movl %ecx, %edx
movq 0x5f74(%rip), %rcx      # 0xafd8
movslq (%rcx,%rdx,4), %rdx
movq 0x5f61(%rip), %rcx      # 0xafd0
addl (%rcx,%rdx,4), %eax
movl %eax, 0x20(%rsp)
movl 0x1c(%rsp), %eax
addl $-0x1, %eax
movl %eax, 0x1c(%rsp)
jmp 0x5034
movq 0x28(%rsp), %rdi
movslq 0x20(%rsp), %rax
imulq $0x18, %rax, %rax
addq %rax, %rdi
movl 0x24(%rsp), %eax
subl $0x1, %eax
imull $-0x1, %eax, %eax
movl %eax, 0x10(%rsp)
leaq 0x10(%rsp), %rsi
callq 0x5b20
movl 0x24(%rsp), %eax
subl $0x2, %eax
movl %eax, 0x1c(%rsp)
cmpl $0x9, 0x1c(%rsp)
jle 0x513c
movl 0x20(%rsp), %eax
movl 0x18(%rsp), %ecx
movl $0x1, %edx
shll %cl, %edx
movl %edx, %ecx
subl $0x1, %ecx
andl %ecx, %eax
shll $0x2, %eax
movq 0x30(%rsp), %rcx
movl 0x1c(%rsp), %edx
subl $0xb, %edx
addl $0x1, %edx
movslq %edx, %rdx
movzbl (%rcx,%rdx), %ecx
movl %ecx, %edx
movq 0x5ee2(%rip), %rcx      # 0xafd8
movslq (%rcx,%rdx,4), %rdx
movq 0x5ecf(%rip), %rcx      # 0xafd0
addl (%rcx,%rdx,4), %eax
movl %eax, 0x20(%rsp)
movq 0x28(%rsp), %rdi
movslq 0x20(%rsp), %rax
imulq $0x18, %rax, %rax
addq %rax, %rdi
imull $-0x1, 0x1c(%rsp), %eax
movl %eax, 0xc(%rsp)
leaq 0xc(%rsp), %rsi
callq 0x5b20
movl 0x1c(%rsp), %eax
addl $-0x1, %eax
movl %eax, 0x1c(%rsp)
jmp 0x50b7
addq $0x38, %rsp
retq
nopw %cs:(%rax,%rax)