void convertIndex(int indx, float *lo, float *hi) {
  switch (indx) {
  case 0:
    *lo = -1.0f;
    *hi = -0.5f;
    break;
  case 1:
    *lo = -1.0f;
    *hi = 1.5f;
    break;
  case 2:
    *lo = 0.5f;
    *hi = 1.5f;
    break;
  case 3:
    *lo = 0.25f;
    *hi = 0.75f;
    break;
  case 4:
    *lo = 0.0f;
    *hi = 1.5f;
    break;
  case 5:
    *lo = -0.5f;
    *hi = 1.0f;
    break;
  case 6:
    *lo = 0.0f;
    *hi = 0.75f;
    break;
  case 7:
    *lo = 0.25f;
    *hi = 1.0f;
    break;
  }
}


x86 assembly (clang, -O0):
<convertIndex>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%eax
mov    %rax,-0x20(%rbp)
sub    $0x7,%rax
ja     124d <convertIndex+0x14d>
mov    -0x20(%rbp),%rax
lea    0xef1(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    -0x10(%rbp),%rax
movss  0xed8(%rip),%xmm0
movss  %xmm0,(%rax)
mov    -0x18(%rbp),%rax
movss  0xebc(%rip),%xmm0
movss  %xmm0,(%rax)
jmp    124d <convertIndex+0x14d>
mov    -0x10(%rbp),%rax
movss  0xeb3(%rip),%xmm0
movss  %xmm0,(%rax)
mov    -0x18(%rbp),%rax
movss  0xe9b(%rip),%xmm0
movss  %xmm0,(%rax)
jmp    124d <convertIndex+0x14d>
mov    -0x10(%rbp),%rax
movss  0xe8a(%rip),%xmm0
movss  %xmm0,(%rax)
mov    -0x18(%rbp),%rax
movss  0xe76(%rip),%xmm0
movss  %xmm0,(%rax)
jmp    124d <convertIndex+0x14d>
mov    -0x10(%rbp),%rax
movss  0xe55(%rip),%xmm0
movss  %xmm0,(%rax)
mov    -0x18(%rbp),%rax
movss  0xe49(%rip),%xmm0
movss  %xmm0,(%rax)
jmp    124d <convertIndex+0x14d>
mov    -0x10(%rbp),%rax
xorps  %xmm0,%xmm0
movss  %xmm0,(%rax)
mov    -0x18(%rbp),%rax
movss  0xe31(%rip),%xmm0
movss  %xmm0,(%rax)
jmp    124d <convertIndex+0x14d>
mov    -0x10(%rbp),%rax
movss  0xe18(%rip),%xmm0
movss  %xmm0,(%rax)
mov    -0x18(%rbp),%rax
movss  0xdfc(%rip),%xmm0
movss  %xmm0,(%rax)
jmp    124d <convertIndex+0x14d>
mov    -0x10(%rbp),%rax
xorps  %xmm0,%xmm0
movss  %xmm0,(%rax)
mov    -0x18(%rbp),%rax
movss  0xde4(%rip),%xmm0
movss  %xmm0,(%rax)
jmp    124d <convertIndex+0x14d>
mov    -0x10(%rbp),%rax
movss  0xdcb(%rip),%xmm0
movss  %xmm0,(%rax)
mov    -0x18(%rbp),%rax
movss  0xdb7(%rip),%xmm0
movss  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<convertIndex>:
cmp    $0x7,%edi
ja     1128 <convertIndex+0x28>
movslq %edi,%rax
lea    0xef1(%rip),%rcx
movss  (%rcx,%rax,4),%xmm0
lea    0xf05(%rip),%rcx
movss  (%rcx,%rax,4),%xmm1
movss  %xmm0,(%rsi)
movss  %xmm1,(%rdx)
ret

LLVM IR (-O0):
define void @convertIndex(i32 %0, float* %1, float* %2) {
%4 = alloca i32
%5 = alloca float*
%6 = alloca float*
store i32 %0, i32* %4
store float* %1, float** %5
store float* %2, float** %6
%7 = load i32, i32* %4
switch i32 %7, label %32 [
i32 0, label %8
i32 1, label %11
i32 2, label %14
i32 3, label %17
i32 4, label %20
i32 5, label %23
i32 6, label %26
i32 7, label %29
]
8: ; preds = %3
%9 = load float*, float** %5
store float -1.000000e+00, float* %9
%10 = load float*, float** %6
store float -5.000000e-01, float* %10
br label %32
11: ; preds = %3
%12 = load float*, float** %5
store float -1.000000e+00, float* %12
%13 = load float*, float** %6
store float 1.500000e+00, float* %13
br label %32
14: ; preds = %3
%15 = load float*, float** %5
store float 5.000000e-01, float* %15
%16 = load float*, float** %6
store float 1.500000e+00, float* %16
br label %32
17: ; preds = %3
%18 = load float*, float** %5
store float 2.500000e-01, float* %18
%19 = load float*, float** %6
store float 7.500000e-01, float* %19
br label %32
20: ; preds = %3
%21 = load float*, float** %5
store float 0.000000e+00, float* %21
%22 = load float*, float** %6
store float 1.500000e+00, float* %22
br label %32
23: ; preds = %3
%24 = load float*, float** %5
store float -5.000000e-01, float* %24
%25 = load float*, float** %6
store float 1.000000e+00, float* %25
br label %32
26: ; preds = %3
%27 = load float*, float** %5
store float 0.000000e+00, float* %27
%28 = load float*, float** %6
store float 7.500000e-01, float* %28
br label %32
29: ; preds = %3
%30 = load float*, float** %5
store float 2.500000e-01, float* %30
%31 = load float*, float** %6
store float 1.000000e+00, float* %31
br label %32
32: ; preds = %3, %29, %26, %23, %20, %17, %14, %11, %8
ret void
}

LLVM IR (-O2):
@switch.table.convertIndex = [8 x float] [float -1.000000e+00, float -1.000000e+00, float 5.000000e-01, float 2.500000e-01, float 0.000000e+00, float -5.000000e-01, float 0.000000e+00, float 2.500000e-01]
@switch.table.convertIndex.1 = [8 x float] [float -5.000000e-01, float 1.500000e+00, float 1.500000e+00, float 7.500000e-01, float 1.500000e+00, float 1.000000e+00, float 7.500000e-01, float 1.000000e+00]
define void @convertIndex(i32 %0, float* nocapture writeonly %1, float* nocapture writeonly %2) {
%4 = icmp ult i32 %0, 8
br i1 %4, label %5, label %12
5: ; preds = %3
%6 = sext i32 %0 to i64
%7 = getelementptr inbounds [8 x float], [8 x float]* @switch.table.convertIndex, i64 0, i64 %6
%8 = load float, float* %7
%9 = sext i32 %0 to i64
%10 = getelementptr inbounds [8 x float], [8 x float]* @switch.table.convertIndex.1, i64 0, i64 %9
%11 = load float, float* %10
store float %8, float* %1
store float %11, float* %2
br label %12
12: ; preds = %3, %5
ret void
}