// File: /workspace/github_cpp_makefile_star2_O3/BenLangmead[P]bowtie/./diff_sample.h
// Function: void calcColbournAndLingDCs<unsigned int>(bool, bool)
void calcColbournAndLingDCs(bool verbose = false, bool sanityCheck = false) {
	for(T r = 0; r < 16; r++) {
		T maxv = 24*r*r + 36*r + 13; // Corollary 2.3
		T numsamp = 6*r + 4;
		clDCs[r].maxV = maxv;
		clDCs[r].numSamples = numsamp;
		memset(clDCs[r].samples, 0, 4 * 128);
		T i;
		// clDCs[r].samples[0] = 0;
		// Fill in the 1^r part of the B series
		for(i = 1; i < r+1; i++) {
			clDCs[r].samples[i] = clDCs[r].samples[i-1] + 1;
		}
		// Fill in the (r + 1)^1 part
		clDCs[r].samples[r+1] = clDCs[r].samples[r] + r + 1;
		// Fill in the (2r + 1)^r part
		for(i = r+2; i < r+2+r; i++) {
			clDCs[r].samples[i] = clDCs[r].samples[i-1] + 2*r + 1;
		}
		// Fill in the (4r + 3)^(2r + 1) part
		for(i = r+2+r; i < r+2+r+2*r+1; i++) {
			clDCs[r].samples[i] = clDCs[r].samples[i-1] + 4*r + 3;
		}
		// Fill in the (2r + 2)^(r + 1) part
		for(i = r+2+r+2*r+1; i < r+2+r+2*r+1+r+1; i++) {
			clDCs[r].samples[i] = clDCs[r].samples[i-1] + 2*r + 2;
		}
		// Fill in the last 1^r part
		for(i = r+2+r+2*r+1+r+1; i < r+2+r+2*r+1+r+1+r; i++) {
			clDCs[r].samples[i] = clDCs[r].samples[i-1] + 1;
		}
		assert_eq(i, numsamp);
		assert_lt(i, 128);
		if(sanityCheck) {
			// diffs[] records all the differences observed
			bool *diffs = new bool[maxv];
			for(T i = 0; i < numsamp; i++) {
				for(T j = i+1; j < numsamp; j++) {
					T d1 = (clDCs[r].samples[j] - clDCs[r].samples[i]);
					T d2 = (clDCs[r].samples[i] + maxv - clDCs[r].samples[j]);
					assert_lt(d1, maxv);
					assert_lt(d2, maxv);
					diffs[d1] = true;
					diffs[d2] = true;
				}
			}
			// Should have observed all possible differences (except 0)
			for(T i = 1; i < maxv; i++) {
				if(diffs[i] == false) cout << r << ", " << i << endl;
				assert(diffs[i] == true);
			}
			delete[] diffs;
		}
	}
	clDCs_calced = true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movl $0x4, %edi
movl $0x3, %eax
movq %rax, 0x38(%rsp)
movl $0x3, %r11d
movl $0x1, %r8d
leaq 0x26a58(%rip), %rax     # 0x3ddc0
movl $0x2, %r10d
leaq 0x26a4f(%rip), %rcx     # 0x3ddc4
movq %rcx, 0x48(%rsp)
leaq 0x26a47(%rip), %r9      # 0x3ddc8
leaq 0x26a34(%rip), %rcx     # 0x3ddbc
movq %rcx, 0x30(%rsp)
xorl %ebp, %ebp
movb $0x1, %r12b
movq %rax, 0x50(%rsp)
movq %rax, 0x40(%rsp)
movq %r9, %r15
movl $0x4, %ecx
movl $0x2, %ebx
movl %esi, 0x2c(%rsp)
movq %rcx, 0x68(%rsp)
movq %r9, 0x58(%rsp)
movq %r10, 0x60(%rsp)
movq %r8, 0x20(%rsp)
movl %r11d, 0xc(%rsp)
movq %rdi, 0x18(%rsp)
leaq (,%rbp,2), %rax
addq %rbp, %rax
leaq 0x24(,%rax,8), %r13
imulq %rbp, %r13
addq $0xd, %r13
leaq 0x4(,%rax,2), %r14
movq %rbp, %rax
shlq $0x9, %rax
leaq (%rax,%rbp,8), %rax
leaq 0x269b0(%rip), %rcx     # 0x3ddb0
leaq (%rcx,%rax), %rdi
addq $0x8, %rdi
movl %r13d, -0x8(%rdi)
movl %r14d, -0x4(%rdi)
movl $0x200, %edx            # imm = 0x200
movq %rdi, 0x78(%rsp)
xorl %esi, %esi
callq 0x51b0
movdqa 0x16cd6(%rip), %xmm10   # 0x2e100
pcmpeqd %xmm9, %xmm9
movdqa 0x16cb8(%rip), %xmm8    # 0x2e0f0
movdqa 0x16ca0(%rip), %xmm7    # 0x2e0e0
movdqa 0x16c88(%rip), %xmm6    # 0x2e0d0
testq %rbp, %rbp
movq 0x40(%rsp), %r8
movq %rbp, %r9
je 0x17553
movq 0x38(%rsp), %rax
andq $-0x4, %rax
leaq -0x1(%r9), %rcx
movq %rcx, %xmm0
pshufd $0x44, %xmm0, %xmm0     # xmm0 = xmm0[0,1,0,1]
pxor %xmm8, %xmm0
xorl %ecx, %ecx
movdqa 0x16c41(%rip), %xmm1    # 0x2e0c0
movq %rcx, %xmm2
pshufd $0x44, %xmm2, %xmm3     # xmm3 = xmm2[0,1,0,1]
movdqa %xmm3, %xmm2
por %xmm7, %xmm2
pxor %xmm8, %xmm2
movdqa %xmm2, %xmm4
pcmpgtd %xmm0, %xmm4
pcmpeqd %xmm0, %xmm2
pshufd $0xf5, %xmm2, %xmm2     # xmm2 = xmm2[1,1,3,3]
pand %xmm4, %xmm2
pshufd $0xf5, %xmm4, %xmm4     # xmm4 = xmm4[1,1,3,3]
por %xmm2, %xmm4
movdqa %xmm1, %xmm2
psubd %xmm9, %xmm2
movd %xmm4, %edx
notl %edx
testb $0x1, %dl
je 0x174cf
movd %xmm2, -0xc(%r15,%rcx,4)
pxor %xmm9, %xmm4
pextrw $0x4, %xmm4, %edx
testb $0x1, %dl
je 0x174ea
pshufd $0x55, %xmm2, %xmm4     # xmm4 = xmm2[1,1,1,1]
movd %xmm4, -0x8(%r15,%rcx,4)
por %xmm6, %xmm3
pxor %xmm8, %xmm3
movdqa %xmm3, %xmm4
pcmpgtd %xmm0, %xmm4
pcmpeqd %xmm0, %xmm3
pshufd $0xf5, %xmm3, %xmm5     # xmm5 = xmm3[1,1,3,3]
pand %xmm4, %xmm5
pshufd $0xf5, %xmm4, %xmm3     # xmm3 = xmm4[1,1,3,3]
por %xmm5, %xmm3
pxor %xmm9, %xmm3
pextrw $0x0, %xmm3, %edx
testb $0x1, %dl
je 0x1752c
pshufd $0xee, %xmm2, %xmm4     # xmm4 = xmm2[2,3,2,3]
movd %xmm4, -0x4(%r15,%rcx,4)
pextrw $0x4, %xmm3, %edx
testb $0x1, %dl
je 0x17541
pshufd $0xff, %xmm2, %xmm2     # xmm2 = xmm2[3,3,3,3]
movd %xmm2, (%r15,%rcx,4)
addq $0x4, %rcx
paddd %xmm10, %xmm1
cmpq %rcx, %rax
jne 0x1747f
leaq 0x1(%r9), %rcx
movq 0x78(%rsp), %rbp
movl (%rbp,%r9,4), %eax
movq %rcx, 0x70(%rsp)
addl %ecx, %eax
movl %eax, 0x4(%rbp,%r9,4)
movl %r9d, %eax
leaq (%rax,%r9), %rdx
addq $0x2, %rdx
testq %r9, %r9
movl 0xc(%rsp), %r11d
movq 0x20(%rsp), %r10
je 0x175ba
imulq $0x20c, %r9, %rcx       # imm = 0x20C
leaq (%r9,%r9), %rax
leaq 0x26817(%rip), %rsi     # 0x3ddb0
movl 0xc(%rcx,%rsi), %ecx
addl %r10d, %ecx
xorl %esi, %esi
movl %ecx, (%r8,%rsi,4)
addl %r10d, %ecx
leaq (%rbx,%rsi), %rdi
incq %rdi
incq %rsi
cmpq %rdx, %rdi
jb 0x175a2
jmp 0x175bc
xorl %eax, %eax
imulq $0x21c, %r9, %rcx       # imm = 0x21C
imulq $0x218, %r9, %rsi       # imm = 0x218
imulq $0x210, %r9, %r8        # imm = 0x210
orq $0xc, %r8
leal 0x2(,%r9,2), %edi
addq %rax, %rdx
movq %r9, 0x10(%rsp)
leal (%rdi,%r9,2), %edi
leaq 0x267c0(%rip), %r9      # 0x3ddb0
movl (%r8,%r9), %r8d
addl %r11d, %r8d
movq 0x50(%rsp), %r9
movl %r8d, (%r9)
addl %r11d, %r8d
incq %r10
addq $0x4, %r9
cmpq %rdx, %r10
jb 0x175fc
movq %rbx, 0x80(%rsp)
movl %edi, %edx
movq 0x10(%rsp), %r9
leaq (%rdx,%r9), %r8
incq %r8
leal (%rdi,%r9), %edx
incl %edx
addl $0x2, %eax
leaq 0x2677c(%rip), %rdi     # 0x3ddb0
movl 0x10(%rsi,%rdi), %esi
addl %eax, %esi
movq 0x48(%rsp), %rdi
movq 0x60(%rsp), %r10
movq %r10, %r9
movl %esi, (%rdi)
addl %eax, %esi
incq %r9
addq $0x4, %rdi
cmpq %r8, %r9
jb 0x17647
cmpq $0x0, 0x10(%rsp)
movq 0x18(%rsp), %rdi
movq 0x20(%rsp), %r8
movq 0x58(%rsp), %r9
movq 0x68(%rsp), %rbx
je 0x176a5
movl %edx, %eax
movq 0x10(%rsp), %rdx
addq %rdx, %rax
incq %rax
leaq 0x26729(%rip), %rdx     # 0x3ddb0
movl 0x14(%rcx,%rdx), %ecx
incl %ecx
xorl %edx, %edx
leal (%rcx,%rdx), %esi
movl %esi, (%r9,%rdx,4)
leaq (%rbx,%rdx), %rsi
incq %rsi
incq %rdx
cmpq %rax, %rsi
jb 0x1768f
movl 0x2c(%rsp), %esi
testb %sil, %sil
je 0x177a3
movq %r13, %rdi
callq 0x5030
movq 0x18(%rsp), %r10
movq %rax, %rbx
movl $0x1, %eax
movq 0x30(%rsp), %rcx
xorl %edx, %edx
movq %rdx, %rsi
incq %rdx
cmpq %r14, %rdx
jae 0x17706
movl (%rbp,%rsi,4), %esi
xorl %edi, %edi
movl (%rcx,%rdi,4), %r8d
movl %r13d, %r9d
subl %r8d, %r9d
subl %esi, %r8d
addl %esi, %r9d
movb %r12b, (%rbx,%r8)
movb %r12b, (%rbx,%r9)
leaq (%rax,%rdi), %r8
incq %r8
incq %rdi
cmpq %r14, %r8
jb 0x176df
incq %rax
addq $0x4, %rcx
cmpq %r10, %rdx
jne 0x176ce
movl $0x1, %ebp
cmpb $0x0, (%rbx,%rbp)
jne 0x1777a
movq 0x2387c(%rip), %rdi     # 0x3afa0
movq 0x10(%rsp), %rsi
callq 0x51e0
movq %rax, %r14
movl $0x2, %edx
movq %rax, %rdi
leaq 0x1758e(%rip), %rsi     # 0x2ecce
callq 0x53f0
movq %r14, %rdi
movq %rbp, %rsi
callq 0x51e0
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x5330
movsbl %al, %esi
movq %r14, %rdi
callq 0x5040
movq %rax, %rdi
callq 0x51f0
incq %rbp
cmpq %r13, %rbp
jb 0x17717
movq %rbx, %rdi
callq 0x5440
movq 0x18(%rsp), %rdi
movl 0xc(%rsp), %r11d
movq 0x20(%rsp), %r8
movq 0x60(%rsp), %r10
movq 0x58(%rsp), %r9
movq 0x80(%rsp), %rbx
incq %rbx
movq 0x68(%rsp), %rcx
addq $0x5, %rcx
addq $0x6, %rdi
movl $0x208, %eax            # imm = 0x208
addq %rax, %r15
incq 0x38(%rsp)
addq $0x2, %r8
addq $0x20c, 0x40(%rsp)      # imm = 0x20C
addl $0x4, %r11d
addq $0x210, 0x50(%rsp)      # imm = 0x210
addq $0x4, %r10
addq $0x218, 0x48(%rsp)      # imm = 0x218
addq $0x21c, %r9             # imm = 0x21C
addq %rax, 0x30(%rsp)
movq 0x70(%rsp), %rax
movq %rax, %rbp
cmpq $0x10, %rax
jne 0x173ad
movb $0x1, 0x26598(%rip)     # 0x3ddac
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq