const int quantize_harmonic(const float dom) {
  int i;
  static float quantbord[63] = {
      15.63f,  40.04f,  44.92f,  48.83f,  50.78f,  52.73f,  54.69f,  57.62f,
      59.57f,  62.50f,  64.45f,  66.41f,  69.34f,  71.29f,  73.24f,  74.22f,
      77.15f,  79.10f,  82.03f,  83.01f,  83.98f,  86.91f,  87.89f,  91.80f,
      93.75f,  97.66f,  98.63f,  99.61f,  103.52f, 105.47f, 109.38f, 110.35f,
      111.33f, 116.21f, 119.14f, 123.05f, 125.00f, 130.86f, 134.77f, 140.63f,
      146.48f, 151.37f, 159.18f, 165.04f, 171.88f, 182.62f, 195.31f, 201.17f,
      218.75f, 228.52f, 247.07f, 262.70f, 291.02f, 310.61f, 333.98f, 372.07f,
      414.06f, 461.91f, 523.44f, 592.77f, 699.22f, 868.16f, 1176.76};
  for (i = 0; i < 63; i++) {
    if (dom < quantbord[i]) {
      return i;
    }
  }
  return 63;
}


x86 assembly (clang, -O0):
<quantize_harmonic>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x3f,-0xc(%rbp)
jge    1156 <quantize_harmonic+0x56>
movss  -0x8(%rbp),%xmm1
movslq -0xc(%rbp),%rcx
lea    0x2f06(%rip),%rax
movss  (%rax,%rcx,4),%xmm0
ucomiss %xmm1,%xmm0
jbe    1143 <quantize_harmonic+0x43>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    115d <quantize_harmonic+0x5d>
jmp    1148 <quantize_harmonic+0x48>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1110 <quantize_harmonic+0x10>
movl   $0x3f,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<quantize_harmonic>:
xor    %eax,%eax
lea    0xef7(%rip),%rcx
nopl   0x0(%rax)
movss  (%rcx,%rax,4),%xmm1
ucomiss %xmm0,%xmm1
ja     1149 <quantize_harmonic+0x49>
movss  0x4(%rcx,%rax,4),%xmm1
ucomiss %xmm0,%xmm1
ja     1140 <quantize_harmonic+0x40>
movss  0x8(%rcx,%rax,4),%xmm1
ucomiss %xmm0,%xmm1
ja     1145 <quantize_harmonic+0x45>
add    $0x3,%rax
cmp    $0x3f,%rax
jne    1110 <quantize_harmonic+0x10>
mov    $0x3f,%eax
ret
add    $0x1,%rax
ret
add    $0x2,%rax
ret

LLVM IR (-O0):
@quantize_harmonic.quantbord = internal global [63 x float] [float 0x402F428F60000000, float 0x4044051EC0000000, float 0x404675C280000000, float 0x40486A3D80000000, float 0x404963D700000000, float 0x404A5D70A0000000, float 0x404B5851E0000000, float 0x404CCF5C20000000, float 0x404DC8F5C0000000, float 6.250000e+01, float 0x40501CCCC0000000, float 0x40509A3D80000000, float 0x405155C280000000, float 0x4051D28F60000000, float 0x40524F5C20000000, float 0x40528E1480000000, float 0x40534999A0000000, float 0x4053C66660000000, float 0x405481EB80000000, float 0x4054C0A3E0000000, float 0x4054FEB860000000, float 0x4055BA3D80000000, float 0x4055F8F5C0000000, float 0x4056F33340000000, float 9.375000e+01, float 0x40586A3D80000000, float 0x4058A851E0000000, float 0x4058E70A40000000, float 0x4059E147A0000000, float 0x405A5E1480000000, float 0x405B5851E0000000, float 0x405B966660000000, float 0x405BD51EC0000000, float 0x405D0D70A0000000, float 0x405DC8F5C0000000, float 0x405EC33340000000, float 1.250000e+02, float 0x40605B8520000000, float 0x4060D8A3E0000000, float 0x4061942900000000, float 0x40624F5C20000000, float 0x4062EBD700000000, float 0x4063E5C280000000, float 0x4064A147A0000000, float 0x40657C2900000000, float 0x4066D3D700000000, float 0x406869EB80000000, float 0x40692570A0000000, float 2.187500e+02, float 0x406C90A3E0000000, float 0x406EE23D80000000, float 0x40706B3340000000, float 0x40723051E0000000, float 0x407369C280000000, float 0x4074DFAE20000000, float 0x4077411EC0000000, float 0x4079E0F5C0000000, float 0x407CDE8F60000000, float 0x40805B8520000000, float 0x4082862900000000, float 0x4085D9C280000000, float 0x408B2147A0000000, float 0x4092630A40000000]
define i32 @quantize_harmonic(float %0) {
%2 = alloca i32
%3 = alloca float
%4 = alloca i32
store float %0, float* %3
store i32 0, i32* %4
br label %5
5: ; preds = %18, %1
%6 = load i32, i32* %4
%7 = icmp slt i32 %6, 63
br i1 %7, label %8, label %21
8: ; preds = %5
%9 = load float, float* %3
%10 = load i32, i32* %4
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds [63 x float], [63 x float]* @quantize_harmonic.quantbord, i64 0, i64 %11
%13 = load float, float* %12
%14 = fcmp olt float %9, %13
br i1 %14, label %15, label %17
15: ; preds = %8
%16 = load i32, i32* %4
store i32 %16, i32* %2
br label %22
17: ; preds = %8
br label %18
18: ; preds = %17
%19 = load i32, i32* %4
%20 = add nsw i32 %19, 1
store i32 %20, i32* %4
br label %5
21: ; preds = %5
store i32 63, i32* %2
br label %22
22: ; preds = %21, %15
%23 = load i32, i32* %2
ret i32 %23
}

LLVM IR (-O2):
@quantize_harmonic.quantbord = internal unnamed_addr constant [63 x float] [float 0x402F428F60000000, float 0x4044051EC0000000, float 0x404675C280000000, float 0x40486A3D80000000, float 0x404963D700000000, float 0x404A5D70A0000000, float 0x404B5851E0000000, float 0x404CCF5C20000000, float 0x404DC8F5C0000000, float 6.250000e+01, float 0x40501CCCC0000000, float 0x40509A3D80000000, float 0x405155C280000000, float 0x4051D28F60000000, float 0x40524F5C20000000, float 0x40528E1480000000, float 0x40534999A0000000, float 0x4053C66660000000, float 0x405481EB80000000, float 0x4054C0A3E0000000, float 0x4054FEB860000000, float 0x4055BA3D80000000, float 0x4055F8F5C0000000, float 0x4056F33340000000, float 9.375000e+01, float 0x40586A3D80000000, float 0x4058A851E0000000, float 0x4058E70A40000000, float 0x4059E147A0000000, float 0x405A5E1480000000, float 0x405B5851E0000000, float 0x405B966660000000, float 0x405BD51EC0000000, float 0x405D0D70A0000000, float 0x405DC8F5C0000000, float 0x405EC33340000000, float 1.250000e+02, float 0x40605B8520000000, float 0x4060D8A3E0000000, float 0x4061942900000000, float 0x40624F5C20000000, float 0x4062EBD700000000, float 0x4063E5C280000000, float 0x4064A147A0000000, float 0x40657C2900000000, float 0x4066D3D700000000, float 0x406869EB80000000, float 0x40692570A0000000, float 2.187500e+02, float 0x406C90A3E0000000, float 0x406EE23D80000000, float 0x40706B3340000000, float 0x40723051E0000000, float 0x407369C280000000, float 0x4074DFAE20000000, float 0x4077411EC0000000, float 0x4079E0F5C0000000, float 0x407CDE8F60000000, float 0x40805B8520000000, float 0x4082862900000000, float 0x4085D9C280000000, float 0x408B2147A0000000, float 0x4092630A40000000]
define i32 @quantize_harmonic(float %0) {
br label %2
2: ; preds = %17, %1
%3 = phi i64 [ 0, %1 ], [ %18, %17 ]
%4 = getelementptr inbounds [63 x float], [63 x float]* @quantize_harmonic.quantbord, i64 0, i64 %3
%5 = load float, float* %4
%6 = fcmp ogt float %5, %0
br i1 %6, label %20, label %7
7: ; preds = %2
%8 = add nuw nsw i64 %3, 1
%9 = getelementptr inbounds [63 x float], [63 x float]* @quantize_harmonic.quantbord, i64 0, i64 %8
%10 = load float, float* %9
%11 = fcmp ogt float %10, %0
br i1 %11, label %20, label %12
12: ; preds = %7
%13 = add nuw nsw i64 %3, 2
%14 = getelementptr inbounds [63 x float], [63 x float]* @quantize_harmonic.quantbord, i64 0, i64 %13
%15 = load float, float* %14
%16 = fcmp ogt float %15, %0
br i1 %16, label %20, label %17
17: ; preds = %12
%18 = add nuw nsw i64 %3, 3
%19 = icmp eq i64 %18, 63
br i1 %19, label %23, label %2
20: ; preds = %12, %7, %2
%21 = phi i64 [ %3, %2 ], [ %8, %7 ], [ %13, %12 ]
%22 = trunc i64 %21 to i32
br label %23
23: ; preds = %17, %20
%24 = phi i32 [ %22, %20 ], [ 63, %17 ]
ret i32 %24
}