int spread_function(double power, double *psd_bark, int masker_bin, int low_bin,
                    int high_bin, double *spread_effect) {
  int i;
  double masker_bark;
  double maskee_bark;
  double delta_bark;
  masker_bark = psd_bark[masker_bin];
  for (i = low_bin; i <= high_bin; i++) {
    maskee_bark = psd_bark[i];
    delta_bark = maskee_bark - masker_bark;
    if (delta_bark >= -3.5 && delta_bark < -1)
      spread_effect[i] = 17 * delta_bark - 0.4 * power + 11;
    else if (delta_bark >= -1 && delta_bark < 0)
      spread_effect[i] = (0.4 * power + 6.) * delta_bark;
    else if (delta_bark >= 0 && delta_bark < 1)
      spread_effect[i] = -17 * delta_bark;
    else if (delta_bark >= 1 && delta_bark < 8.5)
      spread_effect[i] = (0.15 * power - 17) * delta_bark - 0.15 * power;
    else
      ;
  }
  return 0;
}


x86 assembly (clang, -O0):
<spread_function>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x38(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jg     132e <spread_function+0x22e>
mov    -0x10(%rbp),%rax
movslq -0x2c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x40(%rbp),%xmm0
subsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x48(%rbp),%xmm0
movsd  0xe94(%rip),%xmm1
ucomisd %xmm1,%xmm0
jb     11e0 <spread_function+0xe0>
movsd  0xe8a(%rip),%xmm0
ucomisd -0x48(%rbp),%xmm0
jbe    11e0 <spread_function+0xe0>
movsd  -0x48(%rbp),%xmm0
movsd  0xe9a(%rip),%xmm1
mulsd  -0x8(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
movsd  0xe8e(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  0xe76(%rip),%xmm1
addsd  %xmm1,%xmm0
mov    -0x28(%rbp),%rax
movslq -0x2c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
jmp    131b <spread_function+0x21b>
movsd  -0x48(%rbp),%xmm0
movsd  0xe1b(%rip),%xmm1
ucomisd %xmm1,%xmm0
jb     1239 <spread_function+0x139>
xorps  %xmm0,%xmm0
ucomisd -0x48(%rbp),%xmm0
jbe    1239 <spread_function+0x139>
movsd  -0x8(%rbp),%xmm0
movsd  0xe1e(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe1a(%rip),%xmm1
addsd  %xmm1,%xmm0
mulsd  -0x48(%rbp),%xmm0
mov    -0x28(%rbp),%rax
movslq -0x2c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
jmp    1316 <spread_function+0x216>
movsd  -0x48(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     127d <spread_function+0x17d>
movsd  0xdbd(%rip),%xmm0
ucomisd -0x48(%rbp),%xmm0
jbe    127d <spread_function+0x17d>
movsd  0xdc2(%rip),%xmm0
mulsd  -0x48(%rbp),%xmm0
mov    -0x28(%rbp),%rax
movslq -0x2c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
jmp    1311 <spread_function+0x211>
movsd  -0x48(%rbp),%xmm0
movsd  0xd86(%rip),%xmm1
ucomisd %xmm1,%xmm0
jb     1307 <spread_function+0x207>
movsd  0xd7c(%rip),%xmm0
ucomisd -0x48(%rbp),%xmm0
jbe    1307 <spread_function+0x207>
movsd  -0x8(%rbp),%xmm0
movsd  0xd6c(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xd68(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  -0x48(%rbp),%xmm2
movsd  0xd4f(%rip),%xmm1
mulsd  -0x8(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x28(%rbp),%rax
movslq -0x2c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
jmp    130c <spread_function+0x20c>
jmp    130c <spread_function+0x20c>
jmp    1311 <spread_function+0x211>
jmp    1316 <spread_function+0x216>
jmp    131b <spread_function+0x21b>
jmp    1320 <spread_function+0x220>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    1132 <spread_function+0x32>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<spread_function>:
cmp    %ecx,%edx
jg     1241 <spread_function+0x141>
movslq %esi,%rax
movsd  (%rdi,%rax,8),%xmm1
movsd  0xee7(%rip),%xmm9
mulsd  %xmm0,%xmm9
addsd  0xee1(%rip),%xmm9
movsd  0xee0(%rip),%xmm8
mulsd  %xmm0,%xmm8
movsd  0xedb(%rip),%xmm4
mulsd  %xmm0,%xmm4
addsd  0xed7(%rip),%xmm4
mulsd  0xed7(%rip),%xmm0
movslq %edx,%rsi
lea    (%r8,%rsi,8),%rax
lea    (%rdi,%rsi,8),%rsi
sub    %edx,%ecx
add    $0x1,%ecx
xor    %edx,%edx
movsd  0xec5(%rip),%xmm5
movsd  0xec5(%rip),%xmm6
movsd  0xed4(%rip),%xmm13
movsd  0xed4(%rip),%xmm3
xorpd  %xmm2,%xmm2
movsd  0xeaf(%rip),%xmm10
movsd  0xe6e(%rip),%xmm11
movsd  0xea5(%rip),%xmm12
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movsd  (%rsi,%rdx,8),%xmm7
subsd  %xmm1,%xmm7
ucomisd %xmm5,%xmm7
jb     11e0 <spread_function+0xe0>
ucomisd %xmm7,%xmm6
jbe    11e0 <spread_function+0xe0>
mulsd  %xmm13,%xmm7
addsd  %xmm0,%xmm7
addsd  %xmm3,%xmm7
jmp    1230 <spread_function+0x130>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
ucomisd %xmm6,%xmm7
jb     1200 <spread_function+0x100>
ucomisd %xmm7,%xmm2
jbe    1200 <spread_function+0x100>
mulsd  %xmm4,%xmm7
jmp    1230 <spread_function+0x130>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
ucomisd %xmm2,%xmm7
jb     1214 <spread_function+0x114>
ucomisd %xmm7,%xmm10
jbe    1214 <spread_function+0x114>
mulsd  %xmm11,%xmm7
jmp    1230 <spread_function+0x130>
ucomisd %xmm10,%xmm7
jb     1235 <spread_function+0x135>
ucomisd %xmm7,%xmm12
jbe    1235 <spread_function+0x135>
mulsd  %xmm9,%xmm7
addsd  %xmm8,%xmm7
nopl   0x0(%rax)
movsd  %xmm7,(%rax,%rdx,8)
add    $0x1,%rdx
cmp    %edx,%ecx
jne    11b0 <spread_function+0xb0>
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @spread_function(double %0, double* %1, i32 %2, i32 %3, i32 %4, double* %5) {
%7 = alloca double
%8 = alloca double*
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca double*
%13 = alloca i32
%14 = alloca double
%15 = alloca double
%16 = alloca double
store double %0, double* %7
store double* %1, double** %8
store i32 %2, i32* %9
store i32 %3, i32* %10
store i32 %4, i32* %11
store double* %5, double** %12
%17 = load double*, double** %8
%18 = load i32, i32* %9
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds double, double* %17, i64 %19
%21 = load double, double* %20
store double %21, double* %14
%22 = load i32, i32* %10
store i32 %22, i32* %13
br label %23
23: ; preds = %103, %6
%24 = load i32, i32* %13
%25 = load i32, i32* %11
%26 = icmp sle i32 %24, %25
br i1 %26, label %27, label %106
27: ; preds = %23
%28 = load double*, double** %8
%29 = load i32, i32* %13
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds double, double* %28, i64 %30
%32 = load double, double* %31
store double %32, double* %15
%33 = load double, double* %15
%34 = load double, double* %14
%35 = fsub double %33, %34
store double %35, double* %16
%36 = load double, double* %16
%37 = fcmp oge double %36, -3.500000e+00
br i1 %37, label %38, label %52
38: ; preds = %27
%39 = load double, double* %16
%40 = fcmp olt double %39, -1.000000e+00
br i1 %40, label %41, label %52
41: ; preds = %38
%42 = load double, double* %16
%43 = load double, double* %7
%44 = fmul double 4.000000e-01, %43
%45 = fneg double %44
%46 = call double @llvm.fmuladd.f64(double 1.700000e+01, double %42, double %45)
%47 = fadd double %46, 1.100000e+01
%48 = load double*, double** %12
%49 = load i32, i32* %13
%50 = sext i32 %49 to i64
%51 = getelementptr inbounds double, double* %48, i64 %50
store double %47, double* %51
br label %102
52: ; preds = %38, %27
%53 = load double, double* %16
%54 = fcmp oge double %53, -1.000000e+00
br i1 %54, label %55, label %67
55: ; preds = %52
%56 = load double, double* %16
%57 = fcmp olt double %56, 0.000000e+00
br i1 %57, label %58, label %67
58: ; preds = %55
%59 = load double, double* %7
%60 = call double @llvm.fmuladd.f64(double 4.000000e-01, double %59, double 6.000000e+00)
%61 = load double, double* %16
%62 = fmul double %60, %61
%63 = load double*, double** %12
%64 = load i32, i32* %13
%65 = sext i32 %64 to i64
%66 = getelementptr inbounds double, double* %63, i64 %65
store double %62, double* %66
br label %101
67: ; preds = %55, %52
%68 = load double, double* %16
%69 = fcmp oge double %68, 0.000000e+00
br i1 %69, label %70, label %80
70: ; preds = %67
%71 = load double, double* %16
%72 = fcmp olt double %71, 1.000000e+00
br i1 %72, label %73, label %80
73: ; preds = %70
%74 = load double, double* %16
%75 = fmul double -1.700000e+01, %74
%76 = load double*, double** %12
%77 = load i32, i32* %13
%78 = sext i32 %77 to i64
%79 = getelementptr inbounds double, double* %76, i64 %78
store double %75, double* %79
br label %100
80: ; preds = %70, %67
%81 = load double, double* %16
%82 = fcmp oge double %81, 1.000000e+00
br i1 %82, label %83, label %98
83: ; preds = %80
%84 = load double, double* %16
%85 = fcmp olt double %84, 8.500000e+00
br i1 %85, label %86, label %98
86: ; preds = %83
%87 = load double, double* %7
%88 = call double @llvm.fmuladd.f64(double 1.500000e-01, double %87, double -1.700000e+01)
%89 = load double, double* %16
%90 = load double, double* %7
%91 = fmul double 1.500000e-01, %90
%92 = fneg double %91
%93 = call double @llvm.fmuladd.f64(double %88, double %89, double %92)
%94 = load double*, double** %12
%95 = load i32, i32* %13
%96 = sext i32 %95 to i64
%97 = getelementptr inbounds double, double* %94, i64 %96
store double %93, double* %97
br label %99
98: ; preds = %83, %80
br label %99
99: ; preds = %98, %86
br label %100
100: ; preds = %99, %73
br label %101
101: ; preds = %100, %58
br label %102
102: ; preds = %101, %41
br label %103
103: ; preds = %102
%104 = load i32, i32* %13
%105 = add nsw i32 %104, 1
store i32 %105, i32* %13
br label %23
106: ; preds = %23
ret i32 0
}

LLVM IR (-O2):
define i32 @spread_function(double %0, double* nocapture %1, i32 %2, i32 %3, i32 %4, double* nocapture writeonly %5) {
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds double, double* %1, i64 %7
%9 = load double, double* %8
%10 = icmp sgt i32 %3, %4
br i1 %10, label %54, label %11
11: ; preds = %6
%12 = tail call double @llvm.fmuladd.f64(double %0, double 1.500000e-01, double -1.700000e+01)
%13 = fmul double %0, -1.500000e-01
%14 = tail call double @llvm.fmuladd.f64(double %0, double 4.000000e-01, double 6.000000e+00)
%15 = fmul double %0, -4.000000e-01
%16 = sext i32 %3 to i64
%17 = add i32 %4, 1
br label %18
18: ; preds = %11, %50
%19 = phi i64 [ %16, %11 ], [ %51, %50 ]
%20 = getelementptr inbounds double, double* %1, i64 %19
%21 = load double, double* %20
%22 = fsub double %21, %9
%23 = fcmp oge double %22, -3.500000e+00
%24 = fcmp olt double %22, -1.000000e+00
%25 = and i1 %23, %24
br i1 %25, label %26, label %29
26: ; preds = %18
%27 = tail call double @llvm.fmuladd.f64(double %22, double 1.700000e+01, double %15)
%28 = fadd double %27, 1.100000e+01
br label %47
29: ; preds = %18
%30 = fcmp oge double %22, -1.000000e+00
%31 = fcmp olt double %22, 0.000000e+00
%32 = and i1 %30, %31
br i1 %32, label %33, label %35
33: ; preds = %29
%34 = fmul double %14, %22
br label %47
35: ; preds = %29
%36 = fcmp oge double %22, 0.000000e+00
%37 = fcmp olt double %22, 1.000000e+00
%38 = and i1 %36, %37
br i1 %38, label %39, label %41
39: ; preds = %35
%40 = fmul double %22, -1.700000e+01
br label %47
41: ; preds = %35
%42 = fcmp oge double %22, 1.000000e+00
%43 = fcmp olt double %22, 8.500000e+00
%44 = and i1 %42, %43
br i1 %44, label %45, label %50
45: ; preds = %41
%46 = tail call double @llvm.fmuladd.f64(double %12, double %22, double %13)
br label %47
47: ; preds = %33, %45, %39, %26
%48 = phi double [ %28, %26 ], [ %40, %39 ], [ %46, %45 ], [ %34, %33 ]
%49 = getelementptr inbounds double, double* %5, i64 %19
store double %48, double* %49
br label %50
50: ; preds = %47, %41
%51 = add nsw i64 %19, 1
%52 = trunc i64 %51 to i32
%53 = icmp eq i32 %17, %52
br i1 %53, label %54, label %18
54: ; preds = %50, %6
ret i32 0
}