#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int /*<<< orphan*/ fn_make_cubic_poles(double *, double, double, double, double,
                                       int const);
void fn_make_poles(double *p, const int pole_step, int power, int bias) {
  const int pole_step_minor = pole_step / 3;
  switch (power) {
  case 1:
    p[pole_step_minor * 1] = (2 * p[pole_step * 0] + 1 * p[pole_step * 1]) / 3;
    p[pole_step_minor * 2] = (1 * p[pole_step * 0] + 2 * p[pole_step * 1]) / 3;
    break;
  case 2:
    fn_make_cubic_poles(p + pole_step * bias, p[pole_step * 0],
                        p[pole_step * bias], p[pole_step * (1 + bias)],
                        p[pole_step * 2], pole_step_minor);
    break;
  case 3:
    fn_make_cubic_poles(p + pole_step * bias, p[pole_step * 0],
                        p[pole_step * 1], p[pole_step * 2], p[pole_step * 3],
                        pole_step_minor);
    break;
  default:
    do {
    } while (0);
  }
}


x86 assembly (clang, -O0):
<fn_make_poles>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
movslq -0xc(%rbp),%rax
imul   $0x55555556,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
shr    $0x20,%rax
add    %ecx,%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x1c(%rbp)
sub    $0x1,%eax
je     1176 <fn_make_poles+0x66>
jmp    1154 <fn_make_poles+0x44>
mov    -0x1c(%rbp),%eax
sub    $0x2,%eax
je     1217 <fn_make_poles+0x107>
jmp    1165 <fn_make_poles+0x55>
mov    -0x1c(%rbp),%eax
sub    $0x3,%eax
je     1285 <fn_make_poles+0x175>
jmp    12ea <fn_make_poles+0x1da>
mov    -0x8(%rbp),%rax
imul   $0x0,-0xc(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
shl    $0x0,%ecx
movslq %ecx,%rcx
movsd  0xe75(%rip),%xmm1
mulsd  (%rax,%rcx,8),%xmm1
addsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
movsd  0xe50(%rip),%xmm1
divsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%ecx
shl    $0x0,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x8(%rbp),%rax
imul   $0x0,-0xc(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
shl    $0x0,%ecx
movslq %ecx,%rcx
movsd  0xe1d(%rip),%xmm1
mulsd  (%rax,%rcx,8),%xmm1
addsd  %xmm1,%xmm0
movsd  0xe04(%rip),%xmm1
divsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%ecx
shl    $0x1,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
jmp    12f9 <fn_make_poles+0x1e9>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%eax
imul   -0x14(%rbp),%eax
cltq
shl    $0x3,%rax
add    %rax,%rdi
mov    -0x8(%rbp),%rax
imul   $0x0,-0xc(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
imul   -0x14(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
mov    -0x14(%rbp),%edx
add    $0x1,%edx
imul   %edx,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm2
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
shl    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm3
mov    -0x18(%rbp),%esi
call   1030 <fn_make_cubic_poles@plt>
jmp    12f9 <fn_make_poles+0x1e9>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%eax
imul   -0x14(%rbp),%eax
cltq
shl    $0x3,%rax
add    %rax,%rdi
mov    -0x8(%rbp),%rax
imul   $0x0,-0xc(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
shl    $0x0,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
shl    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm2
mov    -0x8(%rbp),%rax
imul   $0x3,-0xc(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm3
mov    -0x18(%rbp),%esi
call   1030 <fn_make_cubic_poles@plt>
jmp    12f9 <fn_make_poles+0x1e9>
jmp    12ef <fn_make_poles+0x1df>
jmp    12f4 <fn_make_poles+0x1e4>
jmp    12f9 <fn_make_poles+0x1e9>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn_make_poles>:
mov    %esi,%r9d
movslq %esi,%r8
imul   $0x55555556,%r8,%rsi
mov    %rsi,%rax
shr    $0x3f,%rax
shr    $0x20,%rsi
add    %eax,%esi
cmp    $0x3,%edx
je     1178 <fn_make_poles+0x68>
cmp    $0x2,%edx
je     11ad <fn_make_poles+0x9d>
cmp    $0x1,%edx
jne    1177 <fn_make_poles+0x67>
movsd  (%rdi),%xmm0
addsd  %xmm0,%xmm0
addsd  (%rdi,%r8,8),%xmm0
movsd  0xeb1(%rip),%xmm1
divsd  %xmm1,%xmm0
movslq %esi,%rax
movsd  %xmm0,(%rdi,%rax,8)
movsd  (%rdi,%r8,8),%xmm0
addsd  %xmm0,%xmm0
addsd  (%rdi),%xmm0
divsd  %xmm1,%xmm0
add    %esi,%esi
movslq %esi,%rax
movsd  %xmm0,(%rdi,%rax,8)
ret
imul   %r9d,%ecx
movslq %ecx,%rax
lea    (%rdi,%rax,8),%rax
movsd  (%rdi),%xmm0
movsd  (%rdi,%r8,8),%xmm1
lea    (%r8,%r8,1),%ecx
movslq %ecx,%rcx
movsd  (%rdi,%rcx,8),%xmm2
lea    (%r8,%r8,2),%ecx
movslq %ecx,%rcx
movsd  (%rdi,%rcx,8),%xmm3
mov    %rax,%rdi
jmp    1030 <fn_make_cubic_poles@plt>
mov    %ecx,%eax
imul   %r9d,%eax
cltq
lea    (%rdi,%rax,8),%rdx
movsd  (%rdi),%xmm0
movsd  (%rdi,%rax,8),%xmm1
add    $0x1,%ecx
imul   %r9d,%ecx
movslq %ecx,%rax
movsd  (%rdi,%rax,8),%xmm2
add    %r9d,%r9d
movslq %r9d,%rax
movsd  (%rdi,%rax,8),%xmm3
mov    %rdx,%rdi
jmp    1030 <fn_make_cubic_poles@plt>

LLVM IR (-O0):
define void @fn_make_poles(double* %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca double*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store double* %0, double** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%10 = load i32, i32* %6
%11 = sdiv i32 %10, 3
store i32 %11, i32* %9
%12 = load i32, i32* %7
switch i32 %12, label %123 [
i32 1, label %13
i32 2, label %54
i32 3, label %90
]
13: ; preds = %4
%14 = load double*, double** %5
%15 = load i32, i32* %6
%16 = mul nsw i32 %15, 0
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds double, double* %14, i64 %17
%19 = load double, double* %18
%20 = load double*, double** %5
%21 = load i32, i32* %6
%22 = mul nsw i32 %21, 1
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds double, double* %20, i64 %23
%25 = load double, double* %24
%26 = fmul double 1.000000e+00, %25
%27 = call double @llvm.fmuladd.f64(double 2.000000e+00, double %19, double %26)
%28 = fdiv double %27, 3.000000e+00
%29 = load double*, double** %5
%30 = load i32, i32* %9
%31 = mul nsw i32 %30, 1
%32 = sext i32 %31 to i64
%33 = getelementptr inbounds double, double* %29, i64 %32
store double %28, double* %33
%34 = load double*, double** %5
%35 = load i32, i32* %6
%36 = mul nsw i32 %35, 0
%37 = sext i32 %36 to i64
%38 = getelementptr inbounds double, double* %34, i64 %37
%39 = load double, double* %38
%40 = load double*, double** %5
%41 = load i32, i32* %6
%42 = mul nsw i32 %41, 1
%43 = sext i32 %42 to i64
%44 = getelementptr inbounds double, double* %40, i64 %43
%45 = load double, double* %44
%46 = fmul double 2.000000e+00, %45
%47 = call double @llvm.fmuladd.f64(double 1.000000e+00, double %39, double %46)
%48 = fdiv double %47, 3.000000e+00
%49 = load double*, double** %5
%50 = load i32, i32* %9
%51 = mul nsw i32 %50, 2
%52 = sext i32 %51 to i64
%53 = getelementptr inbounds double, double* %49, i64 %52
store double %48, double* %53
br label %126
54: ; preds = %4
%55 = load double*, double** %5
%56 = load i32, i32* %6
%57 = load i32, i32* %8
%58 = mul nsw i32 %56, %57
%59 = sext i32 %58 to i64
%60 = getelementptr inbounds double, double* %55, i64 %59
%61 = load double*, double** %5
%62 = load i32, i32* %6
%63 = mul nsw i32 %62, 0
%64 = sext i32 %63 to i64
%65 = getelementptr inbounds double, double* %61, i64 %64
%66 = load double, double* %65
%67 = load double*, double** %5
%68 = load i32, i32* %6
%69 = load i32, i32* %8
%70 = mul nsw i32 %68, %69
%71 = sext i32 %70 to i64
%72 = getelementptr inbounds double, double* %67, i64 %71
%73 = load double, double* %72
%74 = load double*, double** %5
%75 = load i32, i32* %6
%76 = load i32, i32* %8
%77 = add nsw i32 1, %76
%78 = mul nsw i32 %75, %77
%79 = sext i32 %78 to i64
%80 = getelementptr inbounds double, double* %74, i64 %79
%81 = load double, double* %80
%82 = load double*, double** %5
%83 = load i32, i32* %6
%84 = mul nsw i32 %83, 2
%85 = sext i32 %84 to i64
%86 = getelementptr inbounds double, double* %82, i64 %85
%87 = load double, double* %86
%88 = load i32, i32* %9
%89 = call i32 @fn_make_cubic_poles(double* %60, double %66, double %73, double %81, double %87, i32 %88)
br label %126
90: ; preds = %4
%91 = load double*, double** %5
%92 = load i32, i32* %6
%93 = load i32, i32* %8
%94 = mul nsw i32 %92, %93
%95 = sext i32 %94 to i64
%96 = getelementptr inbounds double, double* %91, i64 %95
%97 = load double*, double** %5
%98 = load i32, i32* %6
%99 = mul nsw i32 %98, 0
%100 = sext i32 %99 to i64
%101 = getelementptr inbounds double, double* %97, i64 %100
%102 = load double, double* %101
%103 = load double*, double** %5
%104 = load i32, i32* %6
%105 = mul nsw i32 %104, 1
%106 = sext i32 %105 to i64
%107 = getelementptr inbounds double, double* %103, i64 %106
%108 = load double, double* %107
%109 = load double*, double** %5
%110 = load i32, i32* %6
%111 = mul nsw i32 %110, 2
%112 = sext i32 %111 to i64
%113 = getelementptr inbounds double, double* %109, i64 %112
%114 = load double, double* %113
%115 = load double*, double** %5
%116 = load i32, i32* %6
%117 = mul nsw i32 %116, 3
%118 = sext i32 %117 to i64
%119 = getelementptr inbounds double, double* %115, i64 %118
%120 = load double, double* %119
%121 = load i32, i32* %9
%122 = call i32 @fn_make_cubic_poles(double* %96, double %102, double %108, double %114, double %120, i32 %121)
br label %126
123: ; preds = %4
br label %124
124: ; preds = %123
br label %125
125: ; preds = %124
br label %126
126: ; preds = %125, %90, %54, %13
ret void
}

LLVM IR (-O2):
define void @fn_make_poles(double* %0, i32 %1, i32 %2, i32 %3) {
%5 = sdiv i32 %1, 3
switch i32 %2, label %56 [
i32 1, label %6
i32 2, label %23
i32 3, label %39
]
6: ; preds = %4
%7 = load double, double* %0
%8 = sext i32 %1 to i64
%9 = getelementptr inbounds double, double* %0, i64 %8
%10 = load double, double* %9
%11 = tail call double @llvm.fmuladd.f64(double %7, double 2.000000e+00, double %10)
%12 = fdiv double %11, 3.000000e+00
%13 = sext i32 %5 to i64
%14 = getelementptr inbounds double, double* %0, i64 %13
store double %12, double* %14
%15 = load double, double* %0
%16 = load double, double* %9
%17 = fmul double %16, 2.000000e+00
%18 = fadd double %15, %17
%19 = fdiv double %18, 3.000000e+00
%20 = shl nsw i32 %5, 1
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds double, double* %0, i64 %21
store double %19, double* %22
br label %56
23: ; preds = %4
%24 = mul nsw i32 %3, %1
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds double, double* %0, i64 %25
%27 = load double, double* %0
%28 = load double, double* %26
%29 = add nsw i32 %3, 1
%30 = mul nsw i32 %29, %1
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds double, double* %0, i64 %31
%33 = load double, double* %32
%34 = shl nsw i32 %1, 1
%35 = sext i32 %34 to i64
%36 = getelementptr inbounds double, double* %0, i64 %35
%37 = load double, double* %36
%38 = tail call i32 @fn_make_cubic_poles(double* %26, double %27, double %28, double %33, double %37, i32 %5)
br label %56
39: ; preds = %4
%40 = mul nsw i32 %3, %1
%41 = sext i32 %40 to i64
%42 = getelementptr inbounds double, double* %0, i64 %41
%43 = load double, double* %0
%44 = sext i32 %1 to i64
%45 = getelementptr inbounds double, double* %0, i64 %44
%46 = load double, double* %45
%47 = shl nsw i32 %1, 1
%48 = sext i32 %47 to i64
%49 = getelementptr inbounds double, double* %0, i64 %48
%50 = load double, double* %49
%51 = mul nsw i32 %1, 3
%52 = sext i32 %51 to i64
%53 = getelementptr inbounds double, double* %0, i64 %52
%54 = load double, double* %53
%55 = tail call i32 @fn_make_cubic_poles(double* %42, double %43, double %46, double %50, double %54, i32 %5)
br label %56
56: ; preds = %4, %39, %23, %6
ret void
}