// File: BenLangmead[P]bowtie/./diff_sample.h
// Function: EList<unsigned int, 128> getDeltaMap<unsigned int>(unsigned int, EList<unsigned int, 128> const&)
static EList<T> getDeltaMap(T v, const EList<T>& dc) {
	// Declare anchor-map-related items
	EList<T> amap;
	size_t amapEnts = 1;
	amap.resizeExact((size_t)v);
	amap.fill(0xffffffff);
	amap[0] = 0;
	// Print out difference cover (and optionally calculate
	// anchor map)
	for(size_t i = 0; i < dc.size(); i++) {
		for(size_t j = i+1; j < dc.size(); j++) {
			assert_gt(dc[j], dc[i]);
			T diffLeft  = dc[j] - dc[i];
			T diffRight = dc[i] + v - dc[j];
			assert_lt(diffLeft, v);
			assert_lt(diffRight, v);
			if(amap[diffLeft] == 0xffffffff) {
				amap[diffLeft] = dc[i];
				amapEnts++;
			}
			if(amap[diffRight] == 0xffffffff) {
				amap[diffRight] = dc[j];
				amapEnts++;
			}
		}
	}
	return amap;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movq %rdi, -0x58(%rbp)
movq %rdi, %rax
movq %rax, -0x60(%rbp)
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
movb $0x0, -0x19(%rbp)
callq 0x1b460
movq -0x58(%rbp), %rdi
movq $0x1, -0x28(%rbp)
movl -0xc(%rbp), %eax
movl %eax, %esi
callq 0x2a3c0
jmp 0x12492
movq -0x58(%rbp), %rdi
movl $0xffffffff, -0x38(%rbp) # imm = 0xFFFFFFFF
leaq -0x38(%rbp), %rsi
callq 0x2a440
jmp 0x124a8
movq -0x58(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x14410
movl $0x0, (%rax)
movq $0x0, -0x40(%rbp)
movq -0x40(%rbp), %rax
movq %rax, -0x68(%rbp)
movq -0x18(%rbp), %rdi
callq 0x14440
movq %rax, %rcx
movq -0x68(%rbp), %rax
cmpq %rcx, %rax
jae 0x12632
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rax
movq %rax, -0x70(%rbp)
movq -0x18(%rbp), %rdi
callq 0x14440
movq %rax, %rcx
movq -0x70(%rbp), %rax
cmpq %rcx, %rax
jae 0x1261f
movq -0x18(%rbp), %rdi
movq -0x48(%rbp), %rsi
callq 0x19d10
movl (%rax), %eax
movl %eax, -0x78(%rbp)
movq -0x18(%rbp), %rdi
movq -0x40(%rbp), %rsi
callq 0x19d10
movq %rax, %rcx
movl -0x78(%rbp), %eax
subl (%rcx), %eax
movl %eax, -0x4c(%rbp)
movq -0x18(%rbp), %rdi
movq -0x40(%rbp), %rsi
callq 0x19d10
movl (%rax), %eax
addl -0xc(%rbp), %eax
movl %eax, -0x74(%rbp)
movq -0x18(%rbp), %rdi
movq -0x48(%rbp), %rsi
callq 0x19d10
movq -0x58(%rbp), %rdi
movq %rax, %rcx
movl -0x74(%rbp), %eax
subl (%rcx), %eax
movl %eax, -0x50(%rbp)
movl -0x4c(%rbp), %eax
movl %eax, %esi
callq 0x14410
cmpl $-0x1, (%rax)
jne 0x125c8
movq -0x18(%rbp), %rdi
movq -0x40(%rbp), %rsi
callq 0x19d10
movq -0x58(%rbp), %rdi
movl (%rax), %eax
movl %eax, -0x7c(%rbp)
movl -0x4c(%rbp), %eax
movl %eax, %esi
callq 0x14410
movl -0x7c(%rbp), %ecx
movl %ecx, (%rax)
movq -0x28(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
jmp 0x125c8
movq -0x58(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
callq 0x1d0c0
jmp 0x12652
movq -0x58(%rbp), %rdi
movl -0x50(%rbp), %eax
movl %eax, %esi
callq 0x14410
cmpl $-0x1, (%rax)
jne 0x1260c
movq -0x18(%rbp), %rdi
movq -0x48(%rbp), %rsi
callq 0x19d10
movq -0x58(%rbp), %rdi
movl (%rax), %eax
movl %eax, -0x80(%rbp)
movl -0x50(%rbp), %eax
movl %eax, %esi
callq 0x14410
movl -0x80(%rbp), %ecx
movl %ecx, (%rax)
movq -0x28(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
jmp 0x1260e
movq -0x48(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x48(%rbp)
jmp 0x124f0
jmp 0x12621
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x40(%rbp)
jmp 0x124c3
movb $0x1, -0x19(%rbp)
testb $0x1, -0x19(%rbp)
jne 0x12645
movq -0x58(%rbp), %rdi
callq 0x1d0c0
movq -0x60(%rbp), %rax
addq $0x80, %rsp
popq %rbp
retq
movq -0x30(%rbp), %rdi
callq 0x6850
nopl (%rax,%rax)