// File: /workspace/github_cpp_makefile_star2_O2/splatlab[P]debgr/debruijn_graph.cc
// Function: kmer_tests()
void kmer_tests(void)
{
	kmer aagt1("AAGT");
	kmer aagt2(A);
	aagt2 = aagt2 + A + G + T;
	assert(aagt1 == aagt2);
	assert(aagt1 + A != aagt1 + C);
	assert((aagt1 << A) == kmer("AGTA"));
	assert(-aagt1 == kmer("ACTT"));
	assert(aagt1 + (-aagt2) == kmer("AAGTACTT"));
	assert(suffix(aagt1, 3) == kmer("AGT"));
	assert(prefix(aagt1, 3) == kmer("AAG"));

	canonical_kmer can_aagt = aagt1;
	assert(can_aagt == kmer("ACTT") || can_aagt == kmer("AAGT"));
	canonical_kmer can_tttt("TTTT"), can_aaaa("AAAA");
	assert(can_tttt == can_aaaa);

	assert(period(kmer("AAAAAAAAAAAAA")) == 1);
	assert(period(kmer("ACACACACACACAC")) == 2);
	assert(period(kmer("ACTACTACTACTACTACT")) == 3);

	string s = "ACTGGTGCGCCCGCCTTTTTGGGGGGTCCGTCC";
	for (uint64_t periodicity = 1; periodicity <=32; periodicity++) {
		string base = s.substr(0, periodicity);
		string k;
		for (uint64_t i = 0; i < 32; i++)
			k += base;
		for (uint64_t len = periodicity; len <=32; len++) {
			kmer kk(k.substr(0,len));
			cout << (string)kk << " "
					 << periodicity << " " << len << " " << period(kk) << endl;
			assert(period(kk) == periodicity);
		}
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x328, %rsp            # imm = 0x328
leaq 0xc214(%rip), %rsi      # 0x112db
leaq 0x2c8(%rsp), %rdi
movq %rsp, %rdx
callq 0x2080
leaq 0x138(%rsp), %rdi
leaq 0x2c8(%rsp), %rsi
callq 0x2690
leaq 0x2c8(%rsp), %rdi
callq 0x20a0
pushq $0x1
popq %rbx
pushq $0x1
popq %rcx
movl %ebx, %edi
movq %rcx, %rsi
movl %ebx, %edx
callq 0x2982
pushq $0x3
popq %rcx
movl %eax, %edi
movq %rdx, %rsi
movl %ebx, %edx
callq 0x2982
pushq $0x2
popq %rcx
movl %eax, %edi
movq %rdx, %rsi
movl %ebx, %edx
callq 0x2982
cmpl %eax, 0x138(%rsp)
jne 0x579f
movq %rdx, %r14
cmpq %rdx, 0x140(%rsp)
jne 0x579f
movl %eax, %ebp
pushq $0x1
popq %rbx
pushq $0x1
popq %rcx
movl %eax, %edi
movq %r14, %rsi
movl %ebx, %edx
callq 0x2982
movl %eax, %r15d
movq %rdx, %r12
movl %ebp, %edi
movq %r14, %rsi
movl %ebx, %edx
xorl %ecx, %ecx
callq 0x2982
cmpl %eax, %r15d
setne %al
cmpq %rdx, %r12
setne %cl
orb %al, %cl
je 0x57be
pushq $0x1
popq %rdx
pushq $0x1
popq %r12
movl %ebp, %edi
movq %r14, %rsi
movq %r12, %rcx
callq 0x28eb
movl %eax, %r15d
movq %rdx, %rbx
leaq 0xc174(%rip), %rsi      # 0x11318
leaq 0x2a8(%rsp), %rdi
movq %rsp, %rdx
callq 0x2080
leaq 0x128(%rsp), %rdi
leaq 0x2a8(%rsp), %rsi
callq 0x2690
cmpl 0x128(%rsp), %r15d
jne 0x57dd
cmpq 0x130(%rsp), %rbx
jne 0x57dd
leaq 0x2a8(%rsp), %rdi
callq 0x20a0
movl %ebp, %edi
movq %r14, %rsi
callq 0x2835
movl %eax, %r15d
movq %rdx, %rbx
leaq 0xc14c(%rip), %rsi      # 0x11355
leaq 0x288(%rsp), %rdi
movq %rsp, %rdx
callq 0x2080
leaq 0x118(%rsp), %rdi
leaq 0x288(%rsp), %rsi
callq 0x2690
cmpl 0x118(%rsp), %r15d
jne 0x57fc
cmpq 0x120(%rsp), %rbx
jne 0x57fc
leaq 0x288(%rsp), %rdi
callq 0x20a0
movl %ebp, %edi
movq %r14, %rsi
callq 0x2835
movq %rdx, %rcx
movl %ebp, %edi
movq %r14, %rsi
movl %eax, %edx
callq 0x2982
movl %eax, %r15d
movq %rdx, %rbx
leaq 0xc0d4(%rip), %rsi      # 0x11351
leaq 0x268(%rsp), %rdi
movq %rsp, %rdx
callq 0x2080
leaq 0x108(%rsp), %rdi
leaq 0x268(%rsp), %rsi
callq 0x2690
cmpl 0x108(%rsp), %r15d
jne 0x581b
cmpq 0x110(%rsp), %rbx
jne 0x581b
leaq 0x268(%rsp), %rdi
callq 0x20a0
pushq $0x3
popq %rdx
movq %r14, %rsi
callq 0x2a02
movl %eax, %r15d
movq %rdx, %rbx
leaq 0xbff9(%rip), %rsi      # 0x112dc
leaq 0x248(%rsp), %rdi
movq %rsp, %rdx
callq 0x2080
leaq 0xf8(%rsp), %rdi
leaq 0x248(%rsp), %rsi
callq 0x2690
cmpl 0xf8(%rsp), %r15d
jne 0x583a
cmpq 0x100(%rsp), %rbx
jne 0x583a
leaq 0x248(%rsp), %rdi
callq 0x20a0
pushq $0x3
popq %rdx
movl %ebp, %edi
movq %r14, %rsi
callq 0x29d6
movl %eax, %r15d
movq %rdx, %rbx
leaq 0xc054(%rip), %rsi      # 0x1139f
leaq 0x228(%rsp), %rdi
movq %rsp, %rdx
callq 0x2080
leaq 0xe8(%rsp), %rdi
leaq 0x228(%rsp), %rsi
callq 0x2690
cmpl 0xe8(%rsp), %r15d
jne 0x5859
cmpq 0xf0(%rsp), %rbx
jne 0x5859
leaq 0x228(%rsp), %rdi
callq 0x20a0
movl %ebp, %edi
movq %r14, %rsi
callq 0x28ad
movl %eax, %ebp
movq %rdx, %rbx
leaq 0xbfa6(%rip), %rsi      # 0x11355
leaq 0x208(%rsp), %rdi
movq %rsp, %rdx
callq 0x2080
leaq 0xd8(%rsp), %rdi
leaq 0x208(%rsp), %rsi
callq 0x2690
cmpl 0xd8(%rsp), %ebp
jne 0x53e7
cmpq 0xe0(%rsp), %rbx
je 0x543d
leaq 0xbeed(%rip), %rsi      # 0x112db
leaq 0x1e8(%rsp), %rdi
leaq 0x58(%rsp), %rdx
callq 0x2080
leaq 0xc8(%rsp), %rdi
leaq 0x1e8(%rsp), %rsi
callq 0x2690
cmpl 0xc8(%rsp), %ebp
jne 0x58f4
cmpq 0xd0(%rsp), %rbx
jne 0x58f4
leaq 0x1e8(%rsp), %rdi
callq 0x20a0
leaq 0x208(%rsp), %rdi
callq 0x20a0
leaq 0xbfa7(%rip), %rsi      # 0x113f8
leaq 0x1c8(%rsp), %rdi
movq %rsp, %rdx
callq 0x2080
leaq 0xb8(%rsp), %rdi
leaq 0x1c8(%rsp), %rsi
callq 0x2b1a
leaq 0x1c8(%rsp), %rdi
callq 0x20a0
leaq 0xbf91(%rip), %rsi      # 0x1141b
leaq 0x1a8(%rsp), %rdi
movq %rsp, %rdx
callq 0x2080
leaq 0xa8(%rsp), %rdi
leaq 0x1a8(%rsp), %rsi
callq 0x2b1a
leaq 0x1a8(%rsp), %rdi
callq 0x20a0
movl 0xb8(%rsp), %eax
cmpl 0xa8(%rsp), %eax
jne 0x5878
movq 0xb0(%rsp), %rax
cmpq %rax, 0xc0(%rsp)
jne 0x5878
leaq 0xbf25(%rip), %rsi      # 0x11412
leaq 0x188(%rsp), %rdi
movq %rsp, %rdx
callq 0x2080
leaq 0x98(%rsp), %rdi
leaq 0x188(%rsp), %rsi
callq 0x2690
movl 0x98(%rsp), %edi
movq 0xa0(%rsp), %rsi
callq 0x2a80
cmpq $0x1, %rax
jne 0x5897
leaq 0x188(%rsp), %rdi
callq 0x20a0
leaq 0xbeff(%rip), %rsi      # 0x11443
leaq 0x168(%rsp), %rdi
movq %rsp, %rdx
callq 0x2080
leaq 0x88(%rsp), %rdi
leaq 0x168(%rsp), %rsi
callq 0x2690
movl 0x88(%rsp), %edi
movq 0x90(%rsp), %rsi
callq 0x2a80
cmpq $0x2, %rax
jne 0x58b6
leaq 0x168(%rsp), %rdi
callq 0x20a0
leaq 0xbedb(%rip), %rsi      # 0x11476
leaq 0x148(%rsp), %rdi
movq %rsp, %rdx
callq 0x2080
leaq 0x78(%rsp), %rdi
leaq 0x148(%rsp), %rsi
callq 0x2690
movl 0x78(%rsp), %edi
movq 0x80(%rsp), %rsi
callq 0x2a80
cmpq $0x3, %rax
jne 0x58d5
leaq 0x148(%rsp), %rdi
callq 0x20a0
leaq 0xbec5(%rip), %rsi      # 0x114b1
movq %rsp, %rdi
leaq 0x58(%rsp), %rdx
callq 0x2080
leaq 0x38(%rsp), %r15
leaq 0x2e8(%rsp), %rbp
cmpq $0x21, %r12
je 0x5766
leaq 0x58(%rsp), %rdi
movq %rsp, %rsi
xorl %edx, %edx
movq %r12, %rcx
callq 0x2230
leaq 0x48(%rsp), %rax
movq %rax, 0x38(%rsp)
andq $0x0, 0x40(%rsp)
movb $0x0, 0x48(%rsp)
pushq $0x20
popq %rbx
subq $0x1, %rbx
jb 0x564f
movq %r15, %rdi
leaq 0x58(%rsp), %rsi
callq 0x2410
jmp 0x563a
movq %r12, %rcx
cmpq $0x21, %rcx
je 0x574c
leaq 0x308(%rsp), %r14
movq %r14, %rdi
movq %r15, %rsi
xorl %edx, %edx
movq %rcx, 0x20(%rsp)
callq 0x2230
leaq 0x28(%rsp), %r13
movq %r13, %rdi
movq %r14, %rsi
callq 0x2690
movq %r14, %rdi
callq 0x20a0
movq %rbp, %rdi
movq %r13, %rsi
callq 0x2758
movq %r15, %r14
movq %r12, %r15
movq 0x1492a(%rip), %rdi     # 0x19fd0
movq %rbp, %rbx
movq %rbp, %rsi
callq 0x21e0
movq %rax, %rdi
leaq 0xc172(%rip), %rsi      # 0x1182d
callq 0x2200
movq %rax, %rdi
movq %r15, %rsi
callq 0x2130
movq %rax, %rdi
leaq 0xc158(%rip), %rsi      # 0x1182d
callq 0x2200
movq %rax, %rdi
movq 0x20(%rsp), %rsi
callq 0x2130
movq %rax, %rdi
leaq 0xc13c(%rip), %rsi      # 0x1182d
callq 0x2200
movq %rax, %r13
movl 0x28(%rsp), %ebp
movq 0x30(%rsp), %r12
movl %ebp, %edi
movq %r12, %rsi
callq 0x2a80
movq %r13, %rdi
movq %rax, %rsi
callq 0x2130
movq %rax, %rdi
callq 0x20b0
movq %rbx, %rdi
callq 0x20a0
movl %ebp, %edi
movq %r12, %rsi
callq 0x2a80
cmpq %r15, %rax
jne 0x5780
movq %r15, %r12
movq 0x20(%rsp), %rcx
incq %rcx
movq %r14, %r15
movq %rbx, %rbp
jmp 0x5652
movq %r15, %rdi
callq 0x20a0
leaq 0x58(%rsp), %rdi
callq 0x20a0
incq %r12
jmp 0x5606
movq %rsp, %rdi
callq 0x20a0
addq $0x328, %rsp            # imm = 0x328
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xbd4c(%rip), %rdi      # 0x114d3
leaq 0xba0e(%rip), %rsi      # 0x1119c
leaq 0xbb5a(%rip), %rcx      # 0x112ef
movl $0x492, %edx            # imm = 0x492
callq 0x2110
leaq 0xbb3a(%rip), %rdi      # 0x112e0
leaq 0xb9ef(%rip), %rsi      # 0x1119c
leaq 0xbb3b(%rip), %rcx      # 0x112ef
movl $0x477, %edx            # imm = 0x477
callq 0x2110
leaq 0xbb3c(%rip), %rdi      # 0x11301
leaq 0xb9d0(%rip), %rsi      # 0x1119c
leaq 0xbb1c(%rip), %rcx      # 0x112ef
movl $0x478, %edx            # imm = 0x478
callq 0x2110
leaq 0xbb39(%rip), %rdi      # 0x1131d
leaq 0xb9b1(%rip), %rsi      # 0x1119c
leaq 0xbafd(%rip), %rcx      # 0x112ef
movl $0x479, %edx            # imm = 0x479
callq 0x2110
leaq 0xbb37(%rip), %rdi      # 0x1133a
leaq 0xb992(%rip), %rsi      # 0x1119c
leaq 0xbade(%rip), %rcx      # 0x112ef
movl $0x47a, %edx            # imm = 0x47A
callq 0x2110
leaq 0xbb38(%rip), %rdi      # 0x1135a
leaq 0xb973(%rip), %rsi      # 0x1119c
leaq 0xbabf(%rip), %rcx      # 0x112ef
movl $0x47b, %edx            # imm = 0x47B
callq 0x2110
leaq 0xbb3e(%rip), %rdi      # 0x1137f
leaq 0xb954(%rip), %rsi      # 0x1119c
leaq 0xbaa0(%rip), %rcx      # 0x112ef
movl $0x47c, %edx            # imm = 0x47C
callq 0x2110
leaq 0xbb43(%rip), %rdi      # 0x113a3
leaq 0xb935(%rip), %rsi      # 0x1119c
leaq 0xba81(%rip), %rcx      # 0x112ef
movl $0x47d, %edx            # imm = 0x47D
callq 0x2110
leaq 0xbb7e(%rip), %rdi      # 0x113fd
leaq 0xb916(%rip), %rsi      # 0x1119c
leaq 0xba62(%rip), %rcx      # 0x112ef
movl $0x482, %edx            # imm = 0x482
callq 0x2110
leaq 0xbb82(%rip), %rdi      # 0x11420
leaq 0xb8f7(%rip), %rsi      # 0x1119c
leaq 0xba43(%rip), %rcx      # 0x112ef
movl $0x484, %edx            # imm = 0x484
callq 0x2110
leaq 0xbb95(%rip), %rdi      # 0x11452
leaq 0xb8d8(%rip), %rsi      # 0x1119c
leaq 0xba24(%rip), %rcx      # 0x112ef
movl $0x485, %edx            # imm = 0x485
callq 0x2110
leaq 0xbbad(%rip), %rdi      # 0x11489
leaq 0xb8b9(%rip), %rsi      # 0x1119c
leaq 0xba05(%rip), %rcx      # 0x112ef
movl $0x486, %edx            # imm = 0x486
callq 0x2110
leaq 0xbac8(%rip), %rdi      # 0x113c3
leaq 0xb89a(%rip), %rsi      # 0x1119c
leaq 0xb9e6(%rip), %rcx      # 0x112ef
movl $0x480, %edx            # imm = 0x480
callq 0x2110
movq %rax, %rbx
leaq 0x1e8(%rsp), %rdi
callq 0x20a0
jmp 0x5995
jmp 0x5992
jmp 0x5a02
movq %rax, %rbx
leaq 0x148(%rsp), %rdi
jmp 0x5a49
jmp 0x5a02
movq %rax, %rbx
leaq 0x168(%rsp), %rdi
jmp 0x5a49
jmp 0x5a02
movq %rax, %rbx
leaq 0x188(%rsp), %rdi
jmp 0x5a49
jmp 0x5a02
movq %rax, %rbx
leaq 0x1a8(%rsp), %rdi
jmp 0x5a49
jmp 0x5a02
movq %rax, %rbx
leaq 0x1c8(%rsp), %rdi
jmp 0x5a49
jmp 0x5a02
movq %rax, %rbx
leaq 0x208(%rsp), %rdi
jmp 0x5a49
jmp 0x5a02
movq %rax, %rbx
leaq 0x228(%rsp), %rdi
jmp 0x5a49
jmp 0x5a02
movq %rax, %rbx
leaq 0x248(%rsp), %rdi
jmp 0x5a49
jmp 0x5a02
movq %rax, %rbx
leaq 0x268(%rsp), %rdi
jmp 0x5a49
jmp 0x5a02
movq %rax, %rbx
leaq 0x288(%rsp), %rdi
jmp 0x5a49
jmp 0x5a02
movq %rax, %rbx
leaq 0x2a8(%rsp), %rdi
jmp 0x5a49
jmp 0x5a02
movq %rax, %rbx
leaq 0x2c8(%rsp), %rdi
jmp 0x5a49
movq %rax, %rbx
jmp 0x5a4e
movq %rax, %rbx
jmp 0x5a46
jmp 0x5a1d
movq %rax, %rbx
leaq 0x308(%rsp), %rdi
jmp 0x5a2d
jmp 0x5a1d
movq %rax, %rbx
jmp 0x5a32
movq %rax, %rbx
leaq 0x2e8(%rsp), %rdi
callq 0x20a0
leaq 0x38(%rsp), %rdi
callq 0x20a0
leaq 0x58(%rsp), %rdi
callq 0x20a0
movq %rsp, %rdi
callq 0x20a0
movq %rbx, %rdi
callq 0x23b0