// File: /workspace/github_cpp_makefile_star2_O1/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 $0x68, %rsp
movl %esi, 0x1c(%rsp)
movl $0x4, %r10d
leaq 0x26813(%rip), %r11     # 0x3ddcc
movl $0x3, %ebx
movl $0x1, %eax
movq %rax, 0x40(%rsp)
leaq 0x26801(%rip), %rax     # 0x3ddd0
movl $0x2, %r9d
movl $0x2, %ecx
movq %rcx, 0x30(%rsp)
leaq 0x267ee(%rip), %rcx     # 0x3ddd4
movq %rcx, 0x28(%rsp)
leaq 0x267e6(%rip), %rdi     # 0x3ddd8
xorl %r12d, %r12d
movb $0x1, %r15b
movq %rax, 0x38(%rsp)
movl $0x4, %r8d
movl $0x2, %ecx
movq %rcx, 0x20(%rsp)
movq %r8, 0x48(%rsp)
movq %rax, 0x58(%rsp)
movq %rdi, 0x50(%rsp)
movl %r9d, (%rsp)
movl %ebx, 0x4(%rsp)
movq %r11, 0x8(%rsp)
movq %r10, 0x10(%rsp)
leaq (%r12,%r12,2), %rax
leaq 0x24(,%rax,8), %r13
imulq %r12, %r13
addq $0xd, %r13
leaq 0x4(,%rax,2), %r14
movq %r12, %rax
shlq $0x9, %rax
leaq (%rax,%r12,8), %rbx
leaq 0x26764(%rip), %rax     # 0x3ddc0
leaq (%rax,%rbx), %rbp
addq $0x8, %rbp
movl %r13d, -0x8(%rbp)
movl %r14d, -0x4(%rbp)
movl $0x200, %edx            # imm = 0x200
movq %rbp, %rdi
xorl %esi, %esi
callq 0x51b0
movq 0x8(%rsp), %r11
testq %r12, %r12
je 0x176a3
leaq 0x26734(%rip), %rax     # 0x3ddc0
movl 0x8(%rax,%rbx), %eax
incl %eax
xorl %ecx, %ecx
leal (%rax,%rcx), %edx
movl %edx, (%r11,%rcx,4)
incq %rcx
cmpq %rcx, %r12
jne 0x17694
leaq 0x1(%r12), %rcx
movl (%rbp,%r12,4), %eax
movq %rcx, 0x60(%rsp)
addl %ecx, %eax
movl %eax, 0x4(%rbp,%r12,4)
movl %r12d, %eax
leaq (%rax,%r12), %rdx
addq $0x2, %rdx
testq %r12, %r12
movq 0x40(%rsp), %r9
movq 0x58(%rsp), %rdi
movq 0x20(%rsp), %r8
je 0x17704
imulq $0x20c, %r12, %rax      # imm = 0x20C
leaq 0x266da(%rip), %rcx     # 0x3ddc0
movl 0xc(%rax,%rcx), %eax
addl %r9d, %eax
xorl %ecx, %ecx
movl %eax, (%rdi,%rcx,4)
addl %r9d, %eax
leaq (%r8,%rcx), %rsi
incq %rsi
incq %rcx
cmpq %rdx, %rsi
jb 0x176ef
imulq $0x21c, %r12, %rax      # imm = 0x21C
imulq $0x218, %r12, %rcx      # imm = 0x218
imulq $0x210, %r12, %rdi      # imm = 0x210
orq $0xc, %rdi
leal 0x2(,%r12,2), %r8d
leaq (%rdx,%r12,2), %rsi
leal (%r8,%r12,2), %edx
leaq 0x2668c(%rip), %r8      # 0x3ddc0
movl (%rdi,%r8), %edi
movl 0x4(%rsp), %ebx
addl %ebx, %edi
movq 0x38(%rsp), %r8
movq 0x10(%rsp), %r10
movl %edi, (%r8)
addl %ebx, %edi
incq %r9
addq $0x4, %r8
cmpq %rsi, %r9
jb 0x17748
movl %edx, %esi
addq %r12, %rsi
incq %rsi
leal 0x1(%rdx,%r12), %edx
leaq 0x26653(%rip), %rdi     # 0x3ddc0
movl 0x10(%rcx,%rdi), %ecx
movl (%rsp), %r9d
addl %r9d, %ecx
movq 0x28(%rsp), %rdi
movq 0x30(%rsp), %r8
movl %ecx, (%rdi)
addl %r9d, %ecx
incq %r8
addq $0x4, %rdi
cmpq %rsi, %r8
jb 0x17782
testq %r12, %r12
movq 0x50(%rsp), %rdi
movq 0x48(%rsp), %r8
je 0x177ce
movl %edx, %ecx
addq %r12, %rcx
incq %rcx
leaq 0x2660f(%rip), %rdx     # 0x3ddc0
movl 0x14(%rax,%rdx), %eax
incl %eax
xorl %edx, %edx
leal (%rax,%rdx), %esi
movl %esi, (%rdi,%rdx,4)
leaq (%r8,%rdx), %rsi
incq %rsi
incq %rdx
cmpq %rcx, %rsi
jb 0x177b9
cmpb $0x0, 0x1c(%rsp)
je 0x178cb
movq %r13, %rdi
callq 0x5030
movq 0x10(%rsp), %r10
movq %rax, %rbx
movl $0x1, %eax
movq 0x8(%rsp), %rcx
xorl %edx, %edx
movq %rdx, %rsi
incq %rdx
cmpq %r14, %rdx
jae 0x1782d
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 %r15b, (%rbx,%r8)
movb %r15b, (%rbx,%r9)
leaq (%rax,%rdi), %r8
incq %r8
incq %rdi
cmpq %r14, %r8
jb 0x17806
incq %rax
addq $0x4, %rcx
cmpq %r10, %rdx
jne 0x177f5
movl $0x1, %ebp
cmpb $0x0, (%rbx,%rbp)
jne 0x1789f
movq 0x23755(%rip), %rdi     # 0x3afa0
movq %r12, %rsi
callq 0x51e0
movq %rax, %r14
movl $0x2, %edx
movq %rax, %rdi
leaq 0x17419(%rip), %rsi     # 0x2ec7e
callq 0x5400
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 0x5340
movsbl %al, %esi
movq %r14, %rdi
callq 0x5040
movq %rax, %rdi
callq 0x51f0
incq %rbp
cmpq %r13, %rbp
jb 0x1783e
movq %rbx, %rdi
callq 0x5450
movq 0x10(%rsp), %r10
movq 0x8(%rsp), %r11
movl 0x4(%rsp), %ebx
movl (%rsp), %r9d
movq 0x50(%rsp), %rdi
movq 0x48(%rsp), %r8
incq 0x20(%rsp)
addq $0x5, %r8
addq $0x6, %r10
addq $0x208, %r11            # imm = 0x208
addq $0x2, 0x40(%rsp)
movq 0x58(%rsp), %rax
addq $0x20c, %rax            # imm = 0x20C
addl $0x4, %ebx
addq $0x210, 0x38(%rsp)      # imm = 0x210
addl $0x2, %r9d
addq $0x4, 0x30(%rsp)
addq $0x218, 0x28(%rsp)      # imm = 0x218
addq $0x21c, %rdi            # imm = 0x21C
movq 0x60(%rsp), %rcx
movq %rcx, %r12
cmpq $0x10, %rcx
jne 0x1760d
movb $0x1, 0x2648d(%rip)     # 0x3ddbc
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq