int getStartFreq(int fs, int start_freq) {
  int k0_min;
  ;
  ;
  ;
  switch (fs) {
  case 16000:
    k0_min = 24;
    break;
  case 22050:
    k0_min = 17;
    break;
  case 24000:
    k0_min = 16;
    break;
  case 32000:
    k0_min = 16;
    break;
  case 44100:
    k0_min = 12;
    break;
  case 48000:
    k0_min = 11;
    break;
  default:
    k0_min = 11;
  };
  ;
  ;
  ;
  switch (fs) {
  case 16000: {
    int v_offset[] = {-8, -7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7};
    return (k0_min + v_offset[start_freq]);
  } break;
  case 22050: {
    int v_offset[] = {-5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 9, 11, 13};
    return (k0_min + v_offset[start_freq]);
  } break;
  case 24000: {
    int v_offset[] = {-5, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 9, 11, 13, 16};
    return (k0_min + v_offset[start_freq]);
  } break;
  case 32000: {
    int v_offset[] = {-6, -4, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 9, 11, 13, 16};
    return (k0_min + v_offset[start_freq]);
  } break;
  case 44100:
  case 48000: {
    int v_offset[] = {-4, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 9, 11, 13, 16, 20};
    return (k0_min + v_offset[start_freq]);
  } break;
  default: {
    int v_offset[] = {0, 1, 2, 3, 4, 5, 6, 7, 9, 11, 13, 16, 20, 24, 28, 33};
    return (k0_min + v_offset[start_freq]);
  }
  }
}


x86 assembly (clang, -O0):
<getStartFreq>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1a0,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x194(%rbp)
sub    $0x3e80,%eax
je     11a8 <getStartFreq+0x98>
jmp    113a <getStartFreq+0x2a>
mov    -0x194(%rbp),%eax
sub    $0x5622,%eax
je     11b4 <getStartFreq+0xa4>
jmp    1150 <getStartFreq+0x40>
mov    -0x194(%rbp),%eax
sub    $0x5dc0,%eax
je     11c0 <getStartFreq+0xb0>
jmp    1166 <getStartFreq+0x56>
mov    -0x194(%rbp),%eax
sub    $0x7d00,%eax
je     11cc <getStartFreq+0xbc>
jmp    117c <getStartFreq+0x6c>
mov    -0x194(%rbp),%eax
sub    $0xac44,%eax
je     11d8 <getStartFreq+0xc8>
jmp    1192 <getStartFreq+0x82>
mov    -0x194(%rbp),%eax
sub    $0xbb80,%eax
je     11e4 <getStartFreq+0xd4>
jmp    11f0 <getStartFreq+0xe0>
movl   $0x18,-0x10(%rbp)
jmp    11f7 <getStartFreq+0xe7>
movl   $0x11,-0x10(%rbp)
jmp    11f7 <getStartFreq+0xe7>
movl   $0x10,-0x10(%rbp)
jmp    11f7 <getStartFreq+0xe7>
movl   $0x10,-0x10(%rbp)
jmp    11f7 <getStartFreq+0xe7>
movl   $0xc,-0x10(%rbp)
jmp    11f7 <getStartFreq+0xe7>
movl   $0xb,-0x10(%rbp)
jmp    11f7 <getStartFreq+0xe7>
movl   $0xb,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x198(%rbp)
sub    $0x3e80,%eax
je     127e <getStartFreq+0x16e>
jmp    1210 <getStartFreq+0x100>
mov    -0x198(%rbp),%eax
sub    $0x5622,%eax
je     12a6 <getStartFreq+0x196>
jmp    1226 <getStartFreq+0x116>
mov    -0x198(%rbp),%eax
sub    $0x5dc0,%eax
je     12d4 <getStartFreq+0x1c4>
jmp    123c <getStartFreq+0x12c>
mov    -0x198(%rbp),%eax
sub    $0x7d00,%eax
je     1302 <getStartFreq+0x1f2>
jmp    1252 <getStartFreq+0x142>
mov    -0x198(%rbp),%eax
sub    $0xac44,%eax
je     1330 <getStartFreq+0x220>
jmp    1268 <getStartFreq+0x158>
mov    -0x198(%rbp),%eax
sub    $0xbb80,%eax
je     1330 <getStartFreq+0x220>
jmp    135e <getStartFreq+0x24e>
lea    -0x50(%rbp),%rdi
lea    0xd77(%rip),%rsi
mov    $0x40,%edx
call   1030 <memcpy@plt>
mov    -0x10(%rbp),%eax
movslq -0xc(%rbp),%rcx
add    -0x50(%rbp,%rcx,4),%eax
mov    %eax,-0x4(%rbp)
jmp    1387 <getStartFreq+0x277>
lea    -0x90(%rbp),%rdi
lea    0xd8c(%rip),%rsi
mov    $0x40,%edx
call   1030 <memcpy@plt>
mov    -0x10(%rbp),%eax
movslq -0xc(%rbp),%rcx
add    -0x90(%rbp,%rcx,4),%eax
mov    %eax,-0x4(%rbp)
jmp    1387 <getStartFreq+0x277>
lea    -0xd0(%rbp),%rdi
lea    0xd9e(%rip),%rsi
mov    $0x40,%edx
call   1030 <memcpy@plt>
mov    -0x10(%rbp),%eax
movslq -0xc(%rbp),%rcx
add    -0xd0(%rbp,%rcx,4),%eax
mov    %eax,-0x4(%rbp)
jmp    1387 <getStartFreq+0x277>
lea    -0x110(%rbp),%rdi
lea    0xdb0(%rip),%rsi
mov    $0x40,%edx
call   1030 <memcpy@plt>
mov    -0x10(%rbp),%eax
movslq -0xc(%rbp),%rcx
add    -0x110(%rbp,%rcx,4),%eax
mov    %eax,-0x4(%rbp)
jmp    1387 <getStartFreq+0x277>
lea    -0x150(%rbp),%rdi
lea    0xdc2(%rip),%rsi
mov    $0x40,%edx
call   1030 <memcpy@plt>
mov    -0x10(%rbp),%eax
movslq -0xc(%rbp),%rcx
add    -0x150(%rbp,%rcx,4),%eax
mov    %eax,-0x4(%rbp)
jmp    1387 <getStartFreq+0x277>
lea    -0x190(%rbp),%rdi
lea    0xdd4(%rip),%rsi
mov    $0x40,%edx
call   1030 <memcpy@plt>
mov    -0x10(%rbp),%eax
movslq -0xc(%rbp),%rcx
add    -0x190(%rbp,%rcx,4),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1a0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getStartFreq>:
cmp    $0x7cff,%edi
jg     112e <getStartFreq+0x2e>
cmp    $0x3e80,%edi
je     1154 <getStartFreq+0x54>
cmp    $0x5622,%edi
je     1162 <getStartFreq+0x62>
cmp    $0x5dc0,%edi
jne    118c <getStartFreq+0x8c>
mov    $0x10,%eax
lea    0xf54(%rip),%rcx
jmp    1198 <getStartFreq+0x98>
cmp    $0x7d00,%edi
je     1170 <getStartFreq+0x70>
cmp    $0xac44,%edi
je     117e <getStartFreq+0x7e>
cmp    $0xbb80,%edi
jne    118c <getStartFreq+0x8c>
mov    $0xb,%eax
lea    0xfae(%rip),%rcx
jmp    1198 <getStartFreq+0x98>
mov    $0x18,%eax
lea    0xea0(%rip),%rcx
jmp    1198 <getStartFreq+0x98>
mov    $0x11,%eax
lea    0xed2(%rip),%rcx
jmp    1198 <getStartFreq+0x98>
mov    $0x10,%eax
lea    0xf44(%rip),%rcx
jmp    1198 <getStartFreq+0x98>
mov    $0xc,%eax
lea    0xf76(%rip),%rcx
jmp    1198 <getStartFreq+0x98>
mov    $0xb,%eax
lea    0xfa8(%rip),%rcx
movslq %esi,%rdx
add    (%rcx,%rdx,4),%eax
ret

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

LLVM IR (-O2):
@__const.getStartFreq.v_offset = [16 x i32] [i32 -8, i32 -7, i32 -6, i32 -5, i32 -4, i32 -3, i32 -2, i32 -1, i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7]
@__const.getStartFreq.v_offset.1 = [16 x i32] [i32 -5, i32 -4, i32 -3, i32 -2, i32 -1, i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 9, i32 11, i32 13]
@__const.getStartFreq.v_offset.2 = [16 x i32] [i32 -5, i32 -3, i32 -2, i32 -1, i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 9, i32 11, i32 13, i32 16]
@__const.getStartFreq.v_offset.3 = [16 x i32] [i32 -6, i32 -4, i32 -2, i32 -1, i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 9, i32 11, i32 13, i32 16]
@__const.getStartFreq.v_offset.4 = [16 x i32] [i32 -4, i32 -2, i32 -1, i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 9, i32 11, i32 13, i32 16, i32 20]
@__const.getStartFreq.v_offset.5 = [16 x i32] [i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 9, i32 11, i32 13, i32 16, i32 20, i32 24, i32 28, i32 33]
define i32 @getStartFreq(i32 %0, i32 %1) {
switch i32 %0, label %9 [
i32 16000, label %10
i32 22050, label %4
i32 24000, label %5
i32 32000, label %6
i32 44100, label %7
i32 48000, label %3
]
3: ; preds = %2
br label %7
4: ; preds = %2
br label %10
5: ; preds = %2
br label %10
6: ; preds = %2
br label %10
7: ; preds = %2, %3
%8 = phi i32 [ 11, %3 ], [ 12, %2 ]
br label %10
9: ; preds = %2
br label %10
10: ; preds = %2, %9, %7, %6, %5, %4
%11 = phi [16 x i32]* [ @__const.getStartFreq.v_offset.5, %9 ], [ @__const.getStartFreq.v_offset.4, %7 ], [ @__const.getStartFreq.v_offset.3, %6 ], [ @__const.getStartFreq.v_offset.2, %5 ], [ @__const.getStartFreq.v_offset.1, %4 ], [ @__const.getStartFreq.v_offset, %2 ]
%12 = phi i32 [ 11, %9 ], [ %8, %7 ], [ 16, %6 ], [ 16, %5 ], [ 17, %4 ], [ 24, %2 ]
%13 = sext i32 %1 to i64
%14 = getelementptr inbounds [16 x i32], [16 x i32]* %11, i64 0, i64 %13
%15 = load i32, i32* %14
%16 = add nsw i32 %15, %12
ret i32 %16
}