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

	dna_len = (int)strlen(dna);
	key = 0;
	for(i = 0;i < REPEAT_LEN; i++)
		key = (key<<2) + converter[(unsigned char)dna[i]];
	for(j = 0; j < allrepeats[key].size(); j++){
		if(allrepeats[key][j] < 0)
			find_maxlen_rev(dna, R, rep, 0, allrepeats[key][j]);
		else
			find_maxlen(dna, R, rep, 0, allrepeats[key][j]);
	}
	for(i = 1; i < dna_len - REPEAT_LEN + 1; i++){
		key = ((key&((1<<keylen)-1))<< 2) + converter[(unsigned char)dna[i+REPEAT_LEN-1]];
		for(j = 0; j < allrepeats[key].size(); j++)
			if(allrepeats[key][j] < 0)
				find_maxlen_rev(dna, R, rep, i, allrepeats[key][j]);
			else
				find_maxlen(dna, R, rep, i, allrepeats[key][j]);
	}
}

// Assembly:
subq $0xc8, %rsp
movq %rdi, 0xc0(%rsp)
movq %rsi, 0xb8(%rsp)
movq %rdx, 0xb0(%rsp)
movq %rcx, 0xa8(%rsp)
movl $0x14, 0x8c(%rsp)
movq 0xc0(%rsp), %rdi
callq 0x4060
movl %eax, 0xa4(%rsp)
movl $0x0, 0x90(%rsp)
movl $0x0, 0x94(%rsp)
cmpl $0xb, 0x94(%rsp)
jge 0x4baa
movl 0x90(%rsp), %eax
shll $0x2, %eax
movq 0xc0(%rsp), %rcx
movslq 0x94(%rsp), %rdx
movzbl (%rcx,%rdx), %ecx
movl %ecx, %edx
movq 0x6443(%rip), %rcx      # 0xafd0
addl (%rcx,%rdx,4), %eax
movl %eax, 0x90(%rsp)
movl 0x94(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x94(%rsp)
jmp 0x4b5c
movq $0x0, 0x98(%rsp)
movq 0x98(%rsp), %rax
movq %rax, 0x80(%rsp)
movq 0xb8(%rsp), %rdi
movslq 0x90(%rsp), %rax
imulq $0x18, %rax, %rax
addq %rax, %rdi
callq 0x5ae0
movq %rax, %rcx
movq 0x80(%rsp), %rax
cmpq %rcx, %rax
jae 0x4d04
movq 0xb8(%rsp), %rdi
movslq 0x90(%rsp), %rax
imulq $0x18, %rax, %rax
addq %rax, %rdi
movq 0x98(%rsp), %rsi
callq 0x5b00
cmpl $0x0, (%rax)
jge 0x4c85
movq 0xc0(%rsp), %rax
movq %rax, 0x68(%rsp)
movq 0xb0(%rsp), %rax
movq %rax, 0x70(%rsp)
movq 0xa8(%rsp), %rax
movq %rax, 0x78(%rsp)
movq 0xb8(%rsp), %rdi
movslq 0x90(%rsp), %rax
imulq $0x18, %rax, %rax
addq %rax, %rdi
movq 0x98(%rsp), %rsi
callq 0x5b00
movq 0x68(%rsp), %rdi
movq 0x70(%rsp), %rsi
movq 0x78(%rsp), %rdx
movl (%rax), %r8d
xorl %ecx, %ecx
callq 0x4480
jmp 0x4ce9
movq 0xc0(%rsp), %rax
movq %rax, 0x50(%rsp)
movq 0xb0(%rsp), %rax
movq %rax, 0x58(%rsp)
movq 0xa8(%rsp), %rax
movq %rax, 0x60(%rsp)
movq 0xb8(%rsp), %rdi
movslq 0x90(%rsp), %rax
imulq $0x18, %rax, %rax
addq %rax, %rdi
movq 0x98(%rsp), %rsi
callq 0x5b00
movq 0x50(%rsp), %rdi
movq 0x58(%rsp), %rsi
movq 0x60(%rsp), %rdx
movl (%rax), %r8d
xorl %ecx, %ecx
callq 0x4310
jmp 0x4ceb
movq 0x98(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x98(%rsp)
jmp 0x4bb6
movl $0x1, 0x94(%rsp)
movl 0x94(%rsp), %eax
movl 0xa4(%rsp), %ecx
subl $0xb, %ecx
addl $0x1, %ecx
cmpl %ecx, %eax
jge 0x4eff
movl 0x90(%rsp), %eax
movl 0x8c(%rsp), %ecx
movl $0x1, %edx
shll %cl, %edx
movl %edx, %ecx
subl $0x1, %ecx
andl %ecx, %eax
shll $0x2, %eax
movq 0xc0(%rsp), %rcx
movl 0x94(%rsp), %edx
addl $0xb, %edx
subl $0x1, %edx
movslq %edx, %rdx
movzbl (%rcx,%rdx), %ecx
movl %ecx, %edx
movq 0x6261(%rip), %rcx      # 0xafd0
addl (%rcx,%rdx,4), %eax
movl %eax, 0x90(%rsp)
movq $0x0, 0x98(%rsp)
movq 0x98(%rsp), %rax
movq %rax, 0x48(%rsp)
movq 0xb8(%rsp), %rdi
movslq 0x90(%rsp), %rax
imulq $0x18, %rax, %rax
addq %rax, %rdi
callq 0x5ae0
movq %rax, %rcx
movq 0x48(%rsp), %rax
cmpq %rcx, %rax
jae 0x4ee7
movq 0xb8(%rsp), %rdi
movslq 0x90(%rsp), %rax
imulq $0x18, %rax, %rax
addq %rax, %rdi
movq 0x98(%rsp), %rsi
callq 0x5b00
cmpl $0x0, (%rax)
jge 0x4e5b
movq 0xc0(%rsp), %rax
movq %rax, 0x28(%rsp)
movq 0xb0(%rsp), %rax
movq %rax, 0x30(%rsp)
movq 0xa8(%rsp), %rax
movq %rax, 0x38(%rsp)
movl 0x94(%rsp), %eax
movl %eax, 0x44(%rsp)
movq 0xb8(%rsp), %rdi
movslq 0x90(%rsp), %rax
imulq $0x18, %rax, %rax
addq %rax, %rdi
movq 0x98(%rsp), %rsi
callq 0x5b00
movq 0x28(%rsp), %rdi
movq 0x30(%rsp), %rsi
movq 0x38(%rsp), %rdx
movl 0x44(%rsp), %ecx
movl (%rax), %r8d
callq 0x4480
jmp 0x4ecc
movq 0xc0(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0xb0(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0xa8(%rsp), %rax
movq %rax, 0x18(%rsp)
movl 0x94(%rsp), %eax
movl %eax, 0x24(%rsp)
movq 0xb8(%rsp), %rdi
movslq 0x90(%rsp), %rax
imulq $0x18, %rax, %rax
addq %rax, %rdi
movq 0x98(%rsp), %rsi
callq 0x5b00
movq 0x8(%rsp), %rdi
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %rdx
movl 0x24(%rsp), %ecx
movl (%rax), %r8d
callq 0x4310
jmp 0x4ece
movq 0x98(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x98(%rsp)
jmp 0x4d85
jmp 0x4ee9
movl 0x94(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x94(%rsp)
jmp 0x4d0f
addq $0xc8, %rsp
retq
nopw (%rax,%rax)