// File: 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
movq %rsp, %rbp
subq $0x40, %rsp
movb %sil, %al
movb %dil, %cl
andb $0x1, %cl
movb %cl, -0x1(%rbp)
andb $0x1, %al
movb %al, -0x2(%rbp)
movl $0x0, -0x8(%rbp)
cmpl $0x10, -0x8(%rbp)
jae 0x22749
imull $0x18, -0x8(%rbp), %eax
imull -0x8(%rbp), %eax
imull $0x24, -0x8(%rbp), %ecx
addl %ecx, %eax
addl $0xd, %eax
movl %eax, -0xc(%rbp)
imull $0x6, -0x8(%rbp), %eax
addl $0x4, %eax
movl %eax, -0x10(%rbp)
movl -0xc(%rbp), %ecx
movl -0x8(%rbp), %eax
movl %eax, %edx
leaq 0x32bf9(%rip), %rax     # 0x54ed0
imulq $0x208, %rdx, %rdx      # imm = 0x208
addq %rdx, %rax
movl %ecx, (%rax)
movl -0x10(%rbp), %ecx
movl -0x8(%rbp), %eax
movl %eax, %edx
leaq 0x32bde(%rip), %rax     # 0x54ed0
imulq $0x208, %rdx, %rdx      # imm = 0x208
addq %rdx, %rax
movl %ecx, 0x4(%rax)
movl -0x8(%rbp), %eax
leaq 0x32bc7(%rip), %rdi     # 0x54ed0
imulq $0x208, %rax, %rax      # imm = 0x208
addq %rax, %rdi
addq $0x8, %rdi
xorl %esi, %esi
movl $0x200, %edx            # imm = 0x200
callq 0x6200
movl $0x1, -0x14(%rbp)
movl -0x14(%rbp), %eax
movl -0x8(%rbp), %ecx
addl $0x1, %ecx
cmpl %ecx, %eax
jae 0x22384
movl -0x8(%rbp), %eax
movl %eax, %ecx
leaq 0x32b8d(%rip), %rax     # 0x54ed0
imulq $0x208, %rcx, %rcx      # imm = 0x208
addq %rcx, %rax
movl -0x14(%rbp), %ecx
subl $0x1, %ecx
movl %ecx, %ecx
movl 0x8(%rax,%rcx,4), %edx
addl $0x1, %edx
movl -0x8(%rbp), %eax
movl %eax, %ecx
leaq 0x32b68(%rip), %rax     # 0x54ed0
imulq $0x208, %rcx, %rcx      # imm = 0x208
addq %rcx, %rax
movl -0x14(%rbp), %ecx
movl %edx, 0x8(%rax,%rcx,4)
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x2232a
movl -0x8(%rbp), %eax
movl %eax, %ecx
leaq 0x32b40(%rip), %rax     # 0x54ed0
imulq $0x208, %rcx, %rcx      # imm = 0x208
addq %rcx, %rax
movl -0x8(%rbp), %ecx
movl 0x8(%rax,%rcx,4), %edx
addl -0x8(%rbp), %edx
addl $0x1, %edx
movl -0x8(%rbp), %eax
movl %eax, %ecx
leaq 0x32b1d(%rip), %rax     # 0x54ed0
imulq $0x208, %rcx, %rcx      # imm = 0x208
addq %rcx, %rax
movl -0x8(%rbp), %ecx
addl $0x1, %ecx
movl %ecx, %ecx
movl %edx, 0x8(%rax,%rcx,4)
movl -0x8(%rbp), %eax
addl $0x2, %eax
movl %eax, -0x14(%rbp)
movl -0x14(%rbp), %eax
movl -0x8(%rbp), %ecx
addl $0x2, %ecx
addl -0x8(%rbp), %ecx
cmpl %ecx, %eax
jae 0x22436
movl -0x8(%rbp), %eax
movl %eax, %ecx
leaq 0x32ae2(%rip), %rax     # 0x54ed0
imulq $0x208, %rcx, %rcx      # imm = 0x208
addq %rcx, %rax
movl -0x14(%rbp), %ecx
subl $0x1, %ecx
movl %ecx, %ecx
movl 0x8(%rax,%rcx,4), %edx
movl -0x8(%rbp), %eax
shll %eax
addl %eax, %edx
addl $0x1, %edx
movl -0x8(%rbp), %eax
movl %eax, %ecx
leaq 0x32ab6(%rip), %rax     # 0x54ed0
imulq $0x208, %rcx, %rcx      # imm = 0x208
addq %rcx, %rax
movl -0x14(%rbp), %ecx
movl %edx, 0x8(%rax,%rcx,4)
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x223d2
movl -0x8(%rbp), %eax
addl $0x2, %eax
addl -0x8(%rbp), %eax
movl %eax, -0x14(%rbp)
movl -0x14(%rbp), %eax
movl -0x8(%rbp), %ecx
addl $0x2, %ecx
addl -0x8(%rbp), %ecx
movl -0x8(%rbp), %edx
shll %edx
addl %edx, %ecx
addl $0x1, %ecx
cmpl %ecx, %eax
jae 0x224b1
movl -0x8(%rbp), %eax
movl %eax, %ecx
leaq 0x32a68(%rip), %rax     # 0x54ed0
imulq $0x208, %rcx, %rcx      # imm = 0x208
addq %rcx, %rax
movl -0x14(%rbp), %ecx
subl $0x1, %ecx
movl %ecx, %ecx
movl 0x8(%rax,%rcx,4), %edx
movl -0x8(%rbp), %eax
shll $0x2, %eax
addl %eax, %edx
addl $0x3, %edx
movl -0x8(%rbp), %eax
movl %eax, %ecx
leaq 0x32a3b(%rip), %rax     # 0x54ed0
imulq $0x208, %rcx, %rcx      # imm = 0x208
addq %rcx, %rax
movl -0x14(%rbp), %ecx
movl %edx, 0x8(%rax,%rcx,4)
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x22442
movl -0x8(%rbp), %eax
addl $0x2, %eax
addl -0x8(%rbp), %eax
movl -0x8(%rbp), %ecx
shll %ecx
addl %ecx, %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
movl -0x14(%rbp), %eax
movl -0x8(%rbp), %ecx
addl $0x2, %ecx
addl -0x8(%rbp), %ecx
movl -0x8(%rbp), %edx
shll %edx
addl %edx, %ecx
addl $0x1, %ecx
addl -0x8(%rbp), %ecx
addl $0x1, %ecx
cmpl %ecx, %eax
jae 0x2253b
movl -0x8(%rbp), %eax
movl %eax, %ecx
leaq 0x329dd(%rip), %rax     # 0x54ed0
imulq $0x208, %rcx, %rcx      # imm = 0x208
addq %rcx, %rax
movl -0x14(%rbp), %ecx
subl $0x1, %ecx
movl %ecx, %ecx
movl 0x8(%rax,%rcx,4), %edx
movl -0x8(%rbp), %eax
shll %eax
addl %eax, %edx
addl $0x2, %edx
movl -0x8(%rbp), %eax
movl %eax, %ecx
leaq 0x329b1(%rip), %rax     # 0x54ed0
imulq $0x208, %rcx, %rcx      # imm = 0x208
addq %rcx, %rax
movl -0x14(%rbp), %ecx
movl %edx, 0x8(%rax,%rcx,4)
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x224c7
movl -0x8(%rbp), %eax
addl $0x2, %eax
addl -0x8(%rbp), %eax
movl -0x8(%rbp), %ecx
shll %ecx
addl %ecx, %eax
addl $0x1, %eax
addl -0x8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
movl -0x14(%rbp), %eax
movl -0x8(%rbp), %ecx
addl $0x2, %ecx
addl -0x8(%rbp), %ecx
movl -0x8(%rbp), %edx
shll %edx
addl %edx, %ecx
addl $0x1, %ecx
addl -0x8(%rbp), %ecx
addl $0x1, %ecx
addl -0x8(%rbp), %ecx
cmpl %ecx, %eax
jae 0x225c7
movl -0x8(%rbp), %eax
movl %eax, %ecx
leaq 0x3294a(%rip), %rax     # 0x54ed0
imulq $0x208, %rcx, %rcx      # imm = 0x208
addq %rcx, %rax
movl -0x14(%rbp), %ecx
subl $0x1, %ecx
movl %ecx, %ecx
movl 0x8(%rax,%rcx,4), %edx
addl $0x1, %edx
movl -0x8(%rbp), %eax
movl %eax, %ecx
leaq 0x32925(%rip), %rax     # 0x54ed0
imulq $0x208, %rcx, %rcx      # imm = 0x208
addq %rcx, %rax
movl -0x14(%rbp), %ecx
movl %edx, 0x8(%rax,%rcx,4)
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x22557
testb $0x1, -0x2(%rbp)
je 0x22739
movl -0xc(%rbp), %eax
movl %eax, %edi
callq 0x6040
movq %rax, -0x20(%rbp)
movl $0x0, -0x24(%rbp)
movl -0x24(%rbp), %eax
cmpl -0x10(%rbp), %eax
jae 0x226b8
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
movl -0x28(%rbp), %eax
cmpl -0x10(%rbp), %eax
jae 0x226a8
movl -0x8(%rbp), %eax
movl %eax, %ecx
leaq 0x328bd(%rip), %rax     # 0x54ed0
imulq $0x208, %rcx, %rcx      # imm = 0x208
addq %rcx, %rax
movl -0x28(%rbp), %ecx
movl 0x8(%rax,%rcx,4), %eax
movl -0x8(%rbp), %ecx
movl %ecx, %edx
leaq 0x328a0(%rip), %rcx     # 0x54ed0
imulq $0x208, %rdx, %rdx      # imm = 0x208
addq %rdx, %rcx
movl -0x24(%rbp), %edx
subl 0x8(%rcx,%rdx,4), %eax
movl %eax, -0x2c(%rbp)
movl -0x8(%rbp), %eax
movl %eax, %ecx
leaq 0x32880(%rip), %rax     # 0x54ed0
imulq $0x208, %rcx, %rcx      # imm = 0x208
addq %rcx, %rax
movl -0x24(%rbp), %ecx
movl 0x8(%rax,%rcx,4), %eax
addl -0xc(%rbp), %eax
movl -0x8(%rbp), %ecx
movl %ecx, %edx
leaq 0x32860(%rip), %rcx     # 0x54ed0
imulq $0x208, %rdx, %rdx      # imm = 0x208
addq %rdx, %rcx
movl -0x28(%rbp), %edx
subl 0x8(%rcx,%rdx,4), %eax
movl %eax, -0x30(%rbp)
movq -0x20(%rbp), %rax
movl -0x2c(%rbp), %ecx
movb $0x1, (%rax,%rcx)
movq -0x20(%rbp), %rax
movl -0x30(%rbp), %ecx
movb $0x1, (%rax,%rcx)
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
jmp 0x225fb
jmp 0x226aa
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x225e6
movl $0x1, -0x34(%rbp)
movl -0x34(%rbp), %eax
cmpl -0xc(%rbp), %eax
jae 0x22720
movq -0x20(%rbp), %rax
movl -0x34(%rbp), %ecx
movb (%rax,%rcx), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
jne 0x22713
movl -0x8(%rbp), %esi
movq 0x2f8c3(%rip), %rdi     # 0x51fa8
callq 0x65f0
movq %rax, %rdi
leaq 0x2250d(%rip), %rsi     # 0x44c01
callq 0x6410
movq %rax, %rdi
movl -0x34(%rbp), %esi
callq 0x65f0
movq %rax, %rdi
movq 0x2f85a(%rip), %rsi     # 0x51f68
callq 0x6470
jmp 0x22715
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x226bf
movq -0x20(%rbp), %rax
movq %rax, -0x40(%rbp)
cmpq $0x0, %rax
je 0x22737
movq -0x40(%rbp), %rdi
callq 0x65b0
jmp 0x22739
jmp 0x2273b
movl -0x8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x8(%rbp)
jmp 0x222a0
movb $0x1, 0x3277c(%rip)     # 0x54ecc
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)