void killer(char *combined, int numElements) {
  int i, k;
  char *swap;
  if (numElements % 2 == 1) {
    printf("You can only use the \"-k\" killer data set with an even number of "
           "elements\n");
    exit(-1);
  }
  k = numElements / 2;
  swap = (char *)calloc(numElements, 26 + 1);
  for (i = 1; i <= k; i++) {
    if (i % 2) {
      memcpy(swap + (i - 1) * 26, combined + (i - 1) * 26, 26);
      memcpy(swap + (i)*26, combined + (k + i - 1) * 26, 26);
    }
    memcpy(swap + (k + i - 1) * 26, combined + (2 * i - 1) * 26, 26);
  }
  memcpy(combined, swap, numElements * 26 + 1);
  free(swap);
}


x86 assembly (clang, -O0):
<killer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x1,%edx
jne    118b <killer+0x3b>
lea    0xe86(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0xffffffff,%edi
call   1070 <exit@plt>
mov    -0xc(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x14(%rbp)
movslq -0xc(%rbp),%rdi
mov    $0x1b,%esi
call   1050 <calloc@plt>
mov    %rax,-0x20(%rbp)
movl   $0x1,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x14(%rbp),%eax
jg     12b6 <killer+0x166>
mov    -0x10(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     125c <killer+0x10c>
mov    -0x20(%rbp),%rax
mov    -0x10(%rbp),%ecx
sub    $0x1,%ecx
imul   $0x1a,%ecx,%ecx
movslq %ecx,%rcx
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%esi
sub    $0x1,%esi
imul   $0x1a,%esi,%esi
movslq %esi,%rsi
mov    (%rdx,%rsi,1),%rdi
mov    %rdi,(%rax,%rcx,1)
mov    0x8(%rdx,%rsi,1),%rdi
mov    %rdi,0x8(%rax,%rcx,1)
mov    0x10(%rdx,%rsi,1),%rdi
mov    %rdi,0x10(%rax,%rcx,1)
mov    0x18(%rdx,%rsi,1),%dx
mov    %dx,0x18(%rax,%rcx,1)
mov    -0x20(%rbp),%rax
imul   $0x1a,-0x10(%rbp),%ecx
movslq %ecx,%rcx
mov    -0x8(%rbp),%rdx
mov    -0x14(%rbp),%esi
add    -0x10(%rbp),%esi
sub    $0x1,%esi
imul   $0x1a,%esi,%esi
movslq %esi,%rsi
mov    (%rdx,%rsi,1),%rdi
mov    %rdi,(%rax,%rcx,1)
mov    0x8(%rdx,%rsi,1),%rdi
mov    %rdi,0x8(%rax,%rcx,1)
mov    0x10(%rdx,%rsi,1),%rdi
mov    %rdi,0x10(%rax,%rcx,1)
mov    0x18(%rdx,%rsi,1),%dx
mov    %dx,0x18(%rax,%rcx,1)
mov    -0x20(%rbp),%rax
mov    -0x14(%rbp),%ecx
add    -0x10(%rbp),%ecx
sub    $0x1,%ecx
imul   $0x1a,%ecx,%ecx
movslq %ecx,%rcx
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%esi
shl    $0x1,%esi
sub    $0x1,%esi
imul   $0x1a,%esi,%esi
movslq %esi,%rsi
mov    (%rdx,%rsi,1),%rdi
mov    %rdi,(%rax,%rcx,1)
mov    0x8(%rdx,%rsi,1),%rdi
mov    %rdi,0x8(%rax,%rcx,1)
mov    0x10(%rdx,%rsi,1),%rdi
mov    %rdi,0x10(%rax,%rcx,1)
mov    0x18(%rdx,%rsi,1),%dx
mov    %dx,0x18(%rax,%rcx,1)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    11b2 <killer+0x62>
mov    -0x8(%rbp),%rdi
mov    -0x20(%rbp),%rsi
imul   $0x1a,-0xc(%rbp),%eax
add    $0x1,%eax
movslq %eax,%rdx
call   1060 <memcpy@plt>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<killer>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %esi,%r12d
shr    $0x1f,%r12d
add    %esi,%r12d
mov    %r12d,%eax
and    $0xfffffffe,%eax
mov    %esi,%ecx
sub    %eax,%ecx
cmp    $0x1,%ecx
je     125f <killer+0x10f>
mov    %esi,%r14d
mov    %rdi,%r15
movslq %esi,%rdi
mov    $0x1b,%esi
call   1050 <calloc@plt>
mov    %rax,%rbx
cmp    $0x2,%r14d
jge    11bf <killer+0x6f>
lea    (%r14,%r14,4),%eax
lea    (%rax,%rax,4),%eax
add    %r14d,%eax
or     $0x1,%eax
movslq %eax,%rdx
mov    %r15,%rdi
mov    %rbx,%rsi
call   1060 <memcpy@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <free@plt>
sar    %r12d
lea    0x1(%r12),%r9d
lea    (%r12,%r12,4),%eax
lea    (%rax,%rax,4),%r10d
add    %r12d,%r10d
mov    $0x1,%edx
xor    %esi,%esi
movabs $0x1a00000000,%rdi
movabs $0x3400000000,%r8
jmp    1252 <killer+0x102>
nop
lea    0x1a(%rsi),%ecx
movslq %esi,%rax
movups (%r15,%rax,1),%xmm0
movups 0xa(%r15,%rax,1),%xmm1
movups %xmm1,0xa(%rbx,%rax,1)
movups %xmm0,(%rbx,%rax,1)
lea    (%r10,%rsi,1),%eax
cltq
movups (%r15,%rax,1),%xmm0
movups 0xa(%r15,%rax,1),%xmm1
movups %xmm1,0xa(%rbx,%rcx,1)
movups %xmm0,(%rbx,%rcx,1)
mov    %rdi,%rcx
sar    $0x20,%rcx
movups (%r15,%rcx,1),%xmm0
movups 0xa(%r15,%rcx,1),%xmm1
movups %xmm1,0xa(%rbx,%rax,1)
movups %xmm0,(%rbx,%rax,1)
add    $0x1,%rdx
add    $0x1a,%esi
add    %r8,%rdi
cmp    %rdx,%r9
je     1191 <killer+0x41>
test   $0x1,%dl
jne    11f0 <killer+0xa0>
lea    (%r10,%rsi,1),%eax
cltq
jmp    1224 <killer+0xd4>
lea    0xd9a(%rip),%rdi
call   1040 <puts@plt>
mov    $0xffffffff,%edi
call   1070 <exit@plt>

LLVM IR (-O0):
@.str = [75 x i8] c"You can only use the \22-k\22 killer data set with an even number of elements\0A\00"
define void @killer(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8*
store i8* %0, i8** %3
store i32 %1, i32* %4
%8 = load i32, i32* %4
%9 = srem i32 %8, 2
%10 = icmp eq i32 %9, 1
br i1 %10, label %11, label %13
11: ; preds = %2
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([75 x i8], [75 x i8]* @.str, i64 0, i64 0))
unreachable
13: ; preds = %2
%14 = load i32, i32* %4
%15 = sdiv i32 %14, 2
store i32 %15, i32* %6
%16 = load i32, i32* %4
%17 = sext i32 %16 to i64
%18 = call i8* @calloc(i64 %17, i64 27)
store i8* %18, i8** %7
store i32 1, i32* %5
br label %19
19: ; preds = %69, %13
%20 = load i32, i32* %5
%21 = load i32, i32* %6
%22 = icmp sle i32 %20, %21
br i1 %22, label %23, label %72
23: ; preds = %19
%24 = load i32, i32* %5
%25 = srem i32 %24, 2
%26 = icmp ne i32 %25, 0
br i1 %26, label %27, label %53
27: ; preds = %23
%28 = load i8*, i8** %7
%29 = load i32, i32* %5
%30 = sub nsw i32 %29, 1
%31 = mul nsw i32 %30, 26
%32 = sext i32 %31 to i64
%33 = getelementptr inbounds i8, i8* %28, i64 %32
%34 = load i8*, i8** %3
%35 = load i32, i32* %5
%36 = sub nsw i32 %35, 1
%37 = mul nsw i32 %36, 26
%38 = sext i32 %37 to i64
%39 = getelementptr inbounds i8, i8* %34, i64 %38
%40 = load i8*, i8** %7
%41 = load i32, i32* %5
%42 = mul nsw i32 %41, 26
%43 = sext i32 %42 to i64
%44 = getelementptr inbounds i8, i8* %40, i64 %43
%45 = load i8*, i8** %3
%46 = load i32, i32* %6
%47 = load i32, i32* %5
%48 = add nsw i32 %46, %47
%49 = sub nsw i32 %48, 1
%50 = mul nsw i32 %49, 26
%51 = sext i32 %50 to i64
%52 = getelementptr inbounds i8, i8* %45, i64 %51
br label %53
53: ; preds = %27, %23
%54 = load i8*, i8** %7
%55 = load i32, i32* %6
%56 = load i32, i32* %5
%57 = add nsw i32 %55, %56
%58 = sub nsw i32 %57, 1
%59 = mul nsw i32 %58, 26
%60 = sext i32 %59 to i64
%61 = getelementptr inbounds i8, i8* %54, i64 %60
%62 = load i8*, i8** %3
%63 = load i32, i32* %5
%64 = mul nsw i32 2, %63
%65 = sub nsw i32 %64, 1
%66 = mul nsw i32 %65, 26
%67 = sext i32 %66 to i64
%68 = getelementptr inbounds i8, i8* %62, i64 %67
br label %69
69: ; preds = %53
%70 = load i32, i32* %5
%71 = add nsw i32 %70, 1
store i32 %71, i32* %5
br label %19
72: ; preds = %19
%73 = load i8*, i8** %3
%74 = load i8*, i8** %7
%75 = load i32, i32* %4
%76 = mul nsw i32 %75, 26
%77 = add nsw i32 %76, 1
%78 = sext i32 %77 to i64
%79 = load i8*, i8** %7
ret void
}

LLVM IR (-O2):
@str = [74 x i8] c"You can only use the \22-k\22 killer data set with an even number of elements\00"
define void @killer(i8* nocapture %0, i32 %1) {
%3 = srem i32 %1, 2
%4 = sdiv i32 %1, 2
%5 = icmp eq i32 %3, 1
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([74 x i8], [74 x i8]* @str, i64 0, i64 0))
tail call void @exit(i32 -1)
unreachable
8: ; preds = %2
%9 = sext i32 %1 to i64
%10 = tail call i8* @calloc(i64 %9, i64 27)
%11 = icmp slt i32 %1, 2
br i1 %11, label %49, label %12
12: ; preds = %8
%13 = add nsw i32 %4, 1
%14 = zext i32 %13 to i64
br label %15
15: ; preds = %12, %40
%16 = phi i64 [ 1, %12 ], [ %47, %40 ]
%17 = trunc i64 %16 to i32
%18 = and i32 %17, 1
%19 = icmp eq i32 %18, 0
br i1 %19, label %20, label %26
20: ; preds = %15
%21 = trunc i64 %16 to i32
%22 = add i32 %4, %21
%23 = mul i32 %22, 26
%24 = add i32 %23, -26
%25 = sext i32 %24 to i64
br label %40
26: ; preds = %15
%27 = mul i32 %17, 26
%28 = add i32 %27, -26
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds i8, i8* %10, i64 %29
%31 = getelementptr inbounds i8, i8* %0, i64 %29
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 dereferenceable(26) %30, i8* align 1 dereferenceable(26) %31, i64 26, i1 false)
%32 = zext i32 %27 to i64
%33 = getelementptr inbounds i8, i8* %10, i64 %32
%34 = trunc i64 %16 to i32
%35 = add i32 %4, %34
%36 = mul i32 %35, 26
%37 = add i32 %36, -26
%38 = sext i32 %37 to i64
%39 = getelementptr inbounds i8, i8* %0, i64 %38
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 dereferenceable(26) %33, i8* align 1 dereferenceable(26) %39, i64 26, i1 false)
br label %40
40: ; preds = %20, %26
%41 = phi i64 [ %25, %20 ], [ %38, %26 ]
%42 = getelementptr inbounds i8, i8* %10, i64 %41
%43 = mul i64 %16, 223338299392
%44 = add i64 %43, -111669149696
%45 = ashr exact i64 %44, 32
%46 = getelementptr inbounds i8, i8* %0, i64 %45
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 dereferenceable(26) %42, i8* align 1 dereferenceable(26) %46, i64 26, i1 false)
%47 = add nuw nsw i64 %16, 1
%48 = icmp eq i64 %47, %14
br i1 %48, label %49, label %15
49: ; preds = %40, %8
%50 = mul nsw i32 %1, 26
%51 = or i32 %50, 1
%52 = sext i32 %51 to i64
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 dereferenceable(1) %0, i8* align 1 dereferenceable(1) %10, i64 %52, i1 false)
tail call void @free(i8* %10)
ret void
}