void complexitySelector(int compMeter, int pat[], int len) {
  int *BarkerCode;
  int i;
  switch (compMeter) {
  case 1:
    BarkerCode = (int[2]){1, 1};
    toXOR(BarkerCode, pat, len, 2);
    break;
  case 2:
    BarkerCode = (int[3]){1, 1, 0};
    toXOR(BarkerCode, pat, len, 3);
    break;
  case 3:
    BarkerCode = (int[4]){1, 1, 1, 0};
    toXOR(BarkerCode, pat, len, 4);
    break;
  case 4:
    BarkerCode = (int[5]){1, 1, 1, 0, 1};
    toXOR(BarkerCode, pat, len, 5);
    break;
  case 5:
    BarkerCode = (int[7]){1, 1, 1, 0, 0, 1, 0};
    toXOR(BarkerCode, pat, len, 7);
    break;
  case 6:
    BarkerCode = (int[11]){1, 0, 1, 1, 0, 1, 1, 1, 0, 0, 0};
    toXOR(BarkerCode, pat, len, 11);
    break;
  case 7:
    BarkerCode = (int[13]){1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 1, 0, 1};
    toXOR(BarkerCode, pat, len, 13);
    break;
  }
}


x86 assembly (clang, -O0):
<complexitySelector>:
push   %rbp
mov    %rsp,%rbp
sub    $0xe0,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0xe0(%rbp)
sub    $0x6,%eax
ja     1319 <complexitySelector+0x1f9>
mov    -0xe0(%rbp),%rax
lea    0xea5(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x1,-0x2c(%rbp)
movl   $0x1,-0x28(%rbp)
lea    -0x2c(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    $0x2,%ecx
mov    $0x0,%al
call   1030 <toXOR@plt>
jmp    1319 <complexitySelector+0x1f9>
movl   $0x1,-0x38(%rbp)
movl   $0x1,-0x34(%rbp)
movl   $0x0,-0x30(%rbp)
lea    -0x38(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    $0x3,%ecx
mov    $0x0,%al
call   1030 <toXOR@plt>
jmp    1319 <complexitySelector+0x1f9>
movl   $0x1,-0x48(%rbp)
movl   $0x1,-0x44(%rbp)
movl   $0x1,-0x40(%rbp)
movl   $0x0,-0x3c(%rbp)
lea    -0x48(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    $0x4,%ecx
mov    $0x0,%al
call   1030 <toXOR@plt>
jmp    1319 <complexitySelector+0x1f9>
mov    0x2e1a(%rip),%rax
mov    %rax,-0x5c(%rbp)
mov    0x2e17(%rip),%rax
mov    %rax,-0x54(%rbp)
mov    0x2e15(%rip),%eax
mov    %eax,-0x4c(%rbp)
lea    -0x5c(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    $0x5,%ecx
mov    $0x0,%al
call   1030 <toXOR@plt>
jmp    1319 <complexitySelector+0x1f9>
mov    0x2deb(%rip),%rax
mov    %rax,-0x78(%rbp)
mov    0x2de8(%rip),%rax
mov    %rax,-0x70(%rbp)
mov    0x2de5(%rip),%rax
mov    %rax,-0x68(%rbp)
mov    0x2de3(%rip),%eax
mov    %eax,-0x60(%rbp)
lea    -0x78(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    $0x7,%ecx
mov    $0x0,%al
call   1030 <toXOR@plt>
jmp    1319 <complexitySelector+0x1f9>
lea    -0xa4(%rbp),%rdi
lea    0x2db2(%rip),%rsi
mov    $0x2c,%edx
call   1040 <memcpy@plt>
lea    -0xa4(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    $0xb,%ecx
mov    $0x0,%al
call   1030 <toXOR@plt>
jmp    1319 <complexitySelector+0x1f9>
lea    -0xd8(%rbp),%rdi
lea    0x2d9f(%rip),%rsi
mov    $0x34,%edx
call   1040 <memcpy@plt>
lea    -0xd8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    $0xd,%ecx
mov    $0x0,%al
call   1030 <toXOR@plt>
add    $0xe0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<complexitySelector>:
sub    $0xe8,%rsp
add    $0xffffffff,%edi
cmp    $0x6,%edi
ja     125f <complexitySelector+0x14f>
lea    0xee6(%rip),%rax
movslq (%rax,%rdi,4),%rcx
add    %rax,%rcx
jmp    *%rcx
movabs $0x100000001,%rax
mov    %rax,0x18(%rsp)
lea    0x18(%rsp),%rdi
mov    $0x2,%ecx
jmp    1258 <complexitySelector+0x148>
movabs $0x100000001,%rax
mov    %rax,0xc(%rsp)
movl   $0x0,0x14(%rsp)
lea    0xc(%rsp),%rdi
mov    $0x3,%ecx
jmp    1258 <complexitySelector+0x148>
movaps 0xe82(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
lea    0x40(%rsp),%rdi
mov    $0x4,%ecx
jmp    1258 <complexitySelector+0x148>
mov    0xea4(%rip),%eax
mov    %eax,0x30(%rsp)
movups 0xe89(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
lea    0x20(%rsp),%rdi
mov    $0x5,%ecx
jmp    1258 <complexitySelector+0x148>
movups 0xe8e(%rip),%xmm0
movups %xmm0,0x5c(%rsp)
movups 0xe76(%rip),%xmm0
movaps %xmm0,0x50(%rsp)
lea    0x50(%rsp),%rdi
mov    $0x7,%ecx
jmp    1258 <complexitySelector+0x148>
movups 0xe96(%rip),%xmm0
movups %xmm0,0xcc(%rsp)
movups 0xe7b(%rip),%xmm0
movaps %xmm0,0xc0(%rsp)
movups 0xe5c(%rip),%xmm0
movaps %xmm0,0xb0(%rsp)
lea    0xb0(%rsp),%rdi
mov    $0xb,%ecx
jmp    1258 <complexitySelector+0x148>
mov    0xe9b(%rip),%eax
mov    %eax,0xa0(%rsp)
movups 0xe7d(%rip),%xmm0
movaps %xmm0,0x90(%rsp)
movups 0xe5e(%rip),%xmm0
movaps %xmm0,0x80(%rsp)
movups 0xe3f(%rip),%xmm0
movaps %xmm0,0x70(%rsp)
lea    0x70(%rsp),%rdi
mov    $0xd,%ecx
xor    %eax,%eax
call   1030 <toXOR@plt>
add    $0xe8,%rsp
ret

LLVM IR (-O0):
@constinit = private global [5 x i32] [i32 1, i32 1, i32 1, i32 0, i32 1]
@constinit.1 = private global [7 x i32] [i32 1, i32 1, i32 1, i32 0, i32 0, i32 1, i32 0]
@constinit.2 = private global [11 x i32] [i32 1, i32 0, i32 1, i32 1, i32 0, i32 1, i32 1, i32 1, i32 0, i32 0, i32 0]
@constinit.3 = private global [13 x i32] [i32 1, i32 1, i32 1, i32 1, i32 1, i32 0, i32 0, i32 1, i32 1, i32 0, i32 1, i32 0, i32 1]
define void @complexitySelector(i32 %0, i32* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i32*
%8 = alloca i32
%9 = alloca [2 x i32]
%10 = alloca [3 x i32]
%11 = alloca [4 x i32]
%12 = alloca [5 x i32]
%13 = alloca [7 x i32]
%14 = alloca [11 x i32]
%15 = alloca [13 x i32]
store i32 %0, i32* %4
store i32* %1, i32** %5
store i32 %2, i32* %6
%16 = load i32, i32* %4
switch i32 %16, label %76 [
i32 1, label %17
i32 2, label %25
i32 3, label %34
i32 4, label %44
i32 5, label %52
i32 6, label %60
i32 7, label %68
]
17: ; preds = %3
%18 = getelementptr inbounds [2 x i32], [2 x i32]* %9, i64 0, i64 0
store i32 1, i32* %18
%19 = getelementptr inbounds i32, i32* %18, i64 1
store i32 1, i32* %19
%20 = getelementptr inbounds [2 x i32], [2 x i32]* %9, i64 0, i64 0
store i32* %20, i32** %7
%21 = load i32*, i32** %7
%22 = load i32*, i32** %5
%23 = load i32, i32* %6
%24 = call i32 (i32*, i32*, i32, i32, ...) bitcast (i32 (...)* @toXOR to i32 (i32*, i32*, i32, i32, ...)*)(i32* %21, i32* %22, i32 %23, i32 2)
br label %76
25: ; preds = %3
%26 = getelementptr inbounds [3 x i32], [3 x i32]* %10, i64 0, i64 0
store i32 1, i32* %26
%27 = getelementptr inbounds i32, i32* %26, i64 1
store i32 1, i32* %27
%28 = getelementptr inbounds i32, i32* %27, i64 1
store i32 0, i32* %28
%29 = getelementptr inbounds [3 x i32], [3 x i32]* %10, i64 0, i64 0
store i32* %29, i32** %7
%30 = load i32*, i32** %7
%31 = load i32*, i32** %5
%32 = load i32, i32* %6
%33 = call i32 (i32*, i32*, i32, i32, ...) bitcast (i32 (...)* @toXOR to i32 (i32*, i32*, i32, i32, ...)*)(i32* %30, i32* %31, i32 %32, i32 3)
br label %76
34: ; preds = %3
%35 = getelementptr inbounds [4 x i32], [4 x i32]* %11, i64 0, i64 0
store i32 1, i32* %35
%36 = getelementptr inbounds i32, i32* %35, i64 1
store i32 1, i32* %36
%37 = getelementptr inbounds i32, i32* %36, i64 1
store i32 1, i32* %37
%38 = getelementptr inbounds i32, i32* %37, i64 1
store i32 0, i32* %38
%39 = getelementptr inbounds [4 x i32], [4 x i32]* %11, i64 0, i64 0
store i32* %39, i32** %7
%40 = load i32*, i32** %7
%41 = load i32*, i32** %5
%42 = load i32, i32* %6
%43 = call i32 (i32*, i32*, i32, i32, ...) bitcast (i32 (...)* @toXOR to i32 (i32*, i32*, i32, i32, ...)*)(i32* %40, i32* %41, i32 %42, i32 4)
br label %76
44: ; preds = %3
%45 = getelementptr inbounds [5 x i32], [5 x i32]* %12, i64 0, i64 0
%46 = bitcast [5 x i32]* %12 to i8*
%47 = getelementptr inbounds [5 x i32], [5 x i32]* %12, i64 0, i64 0
store i32* %47, i32** %7
%48 = load i32*, i32** %7
%49 = load i32*, i32** %5
%50 = load i32, i32* %6
%51 = call i32 (i32*, i32*, i32, i32, ...) bitcast (i32 (...)* @toXOR to i32 (i32*, i32*, i32, i32, ...)*)(i32* %48, i32* %49, i32 %50, i32 5)
br label %76
52: ; preds = %3
%53 = getelementptr inbounds [7 x i32], [7 x i32]* %13, i64 0, i64 0
%54 = bitcast [7 x i32]* %13 to i8*
%55 = getelementptr inbounds [7 x i32], [7 x i32]* %13, i64 0, i64 0
store i32* %55, i32** %7
%56 = load i32*, i32** %7
%57 = load i32*, i32** %5
%58 = load i32, i32* %6
%59 = call i32 (i32*, i32*, i32, i32, ...) bitcast (i32 (...)* @toXOR to i32 (i32*, i32*, i32, i32, ...)*)(i32* %56, i32* %57, i32 %58, i32 7)
br label %76
60: ; preds = %3
%61 = getelementptr inbounds [11 x i32], [11 x i32]* %14, i64 0, i64 0
%62 = bitcast [11 x i32]* %14 to i8*
%63 = getelementptr inbounds [11 x i32], [11 x i32]* %14, i64 0, i64 0
store i32* %63, i32** %7
%64 = load i32*, i32** %7
%65 = load i32*, i32** %5
%66 = load i32, i32* %6
%67 = call i32 (i32*, i32*, i32, i32, ...) bitcast (i32 (...)* @toXOR to i32 (i32*, i32*, i32, i32, ...)*)(i32* %64, i32* %65, i32 %66, i32 11)
br label %76
68: ; preds = %3
%69 = getelementptr inbounds [13 x i32], [13 x i32]* %15, i64 0, i64 0
%70 = bitcast [13 x i32]* %15 to i8*
%71 = getelementptr inbounds [13 x i32], [13 x i32]* %15, i64 0, i64 0
store i32* %71, i32** %7
%72 = load i32*, i32** %7
%73 = load i32*, i32** %5
%74 = load i32, i32* %6
%75 = call i32 (i32*, i32*, i32, i32, ...) bitcast (i32 (...)* @toXOR to i32 (i32*, i32*, i32, i32, ...)*)(i32* %72, i32* %73, i32 %74, i32 13)
br label %76
76: ; preds = %3, %68, %60, %52, %44, %34, %25, %17
ret void
}

LLVM IR (-O2):
@constinit = [5 x i32] [i32 1, i32 1, i32 1, i32 0, i32 1]
@constinit.1 = [7 x i32] [i32 1, i32 1, i32 1, i32 0, i32 0, i32 1, i32 0]
@constinit.2 = [11 x i32] [i32 1, i32 0, i32 1, i32 1, i32 0, i32 1, i32 1, i32 1, i32 0, i32 0, i32 0]
@constinit.3 = [13 x i32] [i32 1, i32 1, i32 1, i32 1, i32 1, i32 0, i32 0, i32 1, i32 1, i32 0, i32 1, i32 0, i32 1]
define void @complexitySelector(i32 %0, i32* %1, i32 %2) {
%4 = alloca [2 x i32]
%5 = alloca [3 x i32]
%6 = alloca <4 x i32>
%7 = alloca [5 x i32]
%8 = alloca [7 x i32]
%9 = alloca [11 x i32]
%10 = alloca [13 x i32]
switch i32 %0, label %39 [
i32 1, label %11
i32 2, label %15
i32 3, label %20
i32 4, label %23
i32 5, label %27
i32 6, label %31
i32 7, label %35
]
11: ; preds = %3
%12 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 0
store i32 1, i32* %12
%13 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 1
store i32 1, i32* %13
%14 = call i32 (i32*, i32*, i32, i32, ...) bitcast (i32 (...)* @toXOR to i32 (i32*, i32*, i32, i32, ...)*)(i32* %12, i32* %1, i32 %2, i32 2)
br label %39
15: ; preds = %3
%16 = getelementptr inbounds [3 x i32], [3 x i32]* %5, i64 0, i64 0
store i32 1, i32* %16
%17 = getelementptr inbounds [3 x i32], [3 x i32]* %5, i64 0, i64 1
store i32 1, i32* %17
%18 = getelementptr inbounds [3 x i32], [3 x i32]* %5, i64 0, i64 2
store i32 0, i32* %18
%19 = call i32 (i32*, i32*, i32, i32, ...) bitcast (i32 (...)* @toXOR to i32 (i32*, i32*, i32, i32, ...)*)(i32* %16, i32* %1, i32 %2, i32 3)
br label %39
20: ; preds = %3
%21 = getelementptr inbounds <4 x i32>, <4 x i32>* %6, i64 0, i64 0
store <4 x i32> <i32 1, i32 1, i32 1, i32 0>, <4 x i32>* %6
%22 = call i32 (i32*, i32*, i32, i32, ...) bitcast (i32 (...)* @toXOR to i32 (i32*, i32*, i32, i32, ...)*)(i32* %21, i32* %1, i32 %2, i32 4)
br label %39
23: ; preds = %3
%24 = bitcast [5 x i32]* %7 to i8*
%25 = getelementptr inbounds [5 x i32], [5 x i32]* %7, i64 0, i64 0
%26 = call i32 (i32*, i32*, i32, i32, ...) bitcast (i32 (...)* @toXOR to i32 (i32*, i32*, i32, i32, ...)*)(i32* %25, i32* %1, i32 %2, i32 5)
br label %39
27: ; preds = %3
%28 = bitcast [7 x i32]* %8 to i8*
%29 = getelementptr inbounds [7 x i32], [7 x i32]* %8, i64 0, i64 0
%30 = call i32 (i32*, i32*, i32, i32, ...) bitcast (i32 (...)* @toXOR to i32 (i32*, i32*, i32, i32, ...)*)(i32* %29, i32* %1, i32 %2, i32 7)
br label %39
31: ; preds = %3
%32 = bitcast [11 x i32]* %9 to i8*
%33 = getelementptr inbounds [11 x i32], [11 x i32]* %9, i64 0, i64 0
%34 = call i32 (i32*, i32*, i32, i32, ...) bitcast (i32 (...)* @toXOR to i32 (i32*, i32*, i32, i32, ...)*)(i32* %33, i32* %1, i32 %2, i32 11)
br label %39
35: ; preds = %3
%36 = bitcast [13 x i32]* %10 to i8*
%37 = getelementptr inbounds [13 x i32], [13 x i32]* %10, i64 0, i64 0
%38 = call i32 (i32*, i32*, i32, i32, ...) bitcast (i32 (...)* @toXOR to i32 (i32*, i32*, i32, i32, ...)*)(i32* %37, i32* %1, i32 %2, i32 13)
br label %39
39: ; preds = %3, %35, %31, %27, %23, %20, %15, %11
ret void
}