#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 */
double sqrt(double);
void coef_deriv_f(size_t axis, const double *coef, double *der) {
  const double sqrt3 = sqrt(3.0);
  const double sqrt5 = sqrt(5.0);
  switch (axis) {
  case 0:
    der[0] = 0.0;
    der[1] = sqrt5 * coef[6];
    der[2] = -sqrt5 * coef[8];
    der[3] = coef[4];
    der[4] = -coef[3];
    der[5] = sqrt3 * coef[9];
    der[6] = -3.0 / sqrt5 * coef[1] + 2.0 * coef[8];
    der[7] = -sqrt3 * coef[9];
    der[8] = 3.0 / sqrt5 * coef[2] - 2.0 * coef[6];
    der[9] = 2.0 / sqrt3 * (coef[7] - coef[5]);
    break;
  case 1:
    der[0] = -sqrt5 * coef[4];
    der[1] = 0.0;
    der[2] = sqrt5 * coef[7];
    der[3] = -sqrt3 * coef[9];
    der[4] = 3.0 / sqrt5 * coef[0] - 2.0 * coef[7];
    der[5] = -coef[6];
    der[6] = coef[5];
    der[7] = -3.0 / sqrt5 * coef[2] + 2.0 * coef[4];
    der[8] = sqrt3 * coef[9];
    der[9] = 2.0 / sqrt3 * (coef[3] - coef[8]);
    break;
  case 2:
    der[0] = sqrt5 * coef[3];
    der[1] = -sqrt5 * coef[5];
    der[2] = 0.0;
    der[3] = -3.0 / sqrt5 * coef[0] + 2.0 * coef[5];
    der[4] = sqrt3 * coef[9];
    der[5] = 3.0 / sqrt5 * coef[1] - 2.0 * coef[3];
    der[6] = -sqrt3 * coef[9];
    der[7] = coef[8];
    der[8] = -coef[7];
    der[9] = 2.0 / sqrt3 * (coef[6] - coef[4]);
    break;
  };
}


x86 assembly (clang, -O0):
<coef_deriv_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movsd  0xed4(%rip),%xmm0
call   1030 <sqrt@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  0xeca(%rip),%xmm0
call   1030 <sqrt@plt>
movsd  %xmm0,-0x28(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x30(%rbp)
test   %rax,%rax
je     1184 <coef_deriv_f+0x74>
jmp    115e <coef_deriv_f+0x4e>
mov    -0x30(%rbp),%rax
sub    $0x1,%rax
je     130c <coef_deriv_f+0x1fc>
jmp    1171 <coef_deriv_f+0x61>
mov    -0x30(%rbp),%rax
sub    $0x2,%rax
je     1493 <coef_deriv_f+0x383>
jmp    1615 <coef_deriv_f+0x505>
mov    -0x18(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax)
movsd  -0x28(%rbp),%xmm0
mov    -0x10(%rbp),%rax
mulsd  0x30(%rax),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,0x8(%rax)
movsd  -0x28(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mov    -0x10(%rbp),%rax
mulsd  0x40(%rax),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,0x10(%rax)
mov    -0x10(%rbp),%rax
movsd  0x20(%rax),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,0x18(%rax)
mov    -0x10(%rbp),%rax
movsd  0x18(%rax),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,0x20(%rax)
movsd  -0x20(%rbp),%xmm0
mov    -0x10(%rbp),%rax
mulsd  0x48(%rax),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,0x28(%rax)
movsd  0xdea(%rip),%xmm0
divsd  -0x28(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm2
mov    -0x10(%rbp),%rax
movsd  0xdc8(%rip),%xmm1
mulsd  0x40(%rax),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,0x30(%rax)
movsd  -0x20(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mov    -0x10(%rbp),%rax
mulsd  0x48(%rax),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,0x38(%rax)
movsd  0xd6c(%rip),%xmm0
divsd  -0x28(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movsd  0x10(%rax),%xmm2
mov    -0x10(%rbp),%rax
movsd  0xd62(%rip),%xmm1
mulsd  0x30(%rax),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,0x40(%rax)
movsd  0xd2d(%rip),%xmm0
divsd  -0x20(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movsd  0x38(%rax),%xmm1
mov    -0x10(%rbp),%rax
subsd  0x28(%rax),%xmm1
mulsd  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,0x48(%rax)
jmp    1615 <coef_deriv_f+0x505>
movsd  -0x28(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mov    -0x10(%rbp),%rax
mulsd  0x20(%rax),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x18(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,0x8(%rax)
movsd  -0x28(%rbp),%xmm0
mov    -0x10(%rbp),%rax
mulsd  0x38(%rax),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,0x10(%rax)
movsd  -0x20(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mov    -0x10(%rbp),%rax
mulsd  0x48(%rax),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,0x18(%rax)
movsd  0xc6e(%rip),%xmm0
divsd  -0x28(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm2
mov    -0x10(%rbp),%rax
movsd  0xc65(%rip),%xmm1
mulsd  0x38(%rax),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,0x20(%rax)
mov    -0x10(%rbp),%rax
movsd  0x30(%rax),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,0x28(%rax)
mov    -0x10(%rbp),%rax
movsd  0x28(%rax),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,0x30(%rax)
movsd  0xbfd(%rip),%xmm0
divsd  -0x28(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movsd  0x10(%rax),%xmm2
mov    -0x10(%rbp),%rax
movsd  0xbdb(%rip),%xmm1
mulsd  0x20(%rax),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,0x38(%rax)
movsd  -0x20(%rbp),%xmm0
mov    -0x10(%rbp),%rax
mulsd  0x48(%rax),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,0x40(%rax)
movsd  0xba6(%rip),%xmm0
divsd  -0x20(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movsd  0x18(%rax),%xmm1
mov    -0x10(%rbp),%rax
subsd  0x40(%rax),%xmm1
mulsd  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,0x48(%rax)
jmp    1615 <coef_deriv_f+0x505>
movsd  -0x28(%rbp),%xmm0
mov    -0x10(%rbp),%rax
mulsd  0x18(%rax),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x28(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mov    -0x10(%rbp),%rax
mulsd  0x28(%rax),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,0x8(%rax)
mov    -0x18(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,0x10(%rax)
movsd  0xb2d(%rip),%xmm0
divsd  -0x28(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm2
mov    -0x10(%rbp),%rax
movsd  0xb0c(%rip),%xmm1
mulsd  0x28(%rax),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,0x18(%rax)
movsd  -0x20(%rbp),%xmm0
mov    -0x10(%rbp),%rax
mulsd  0x48(%rax),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,0x20(%rax)
movsd  0xac7(%rip),%xmm0
divsd  -0x28(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm2
mov    -0x10(%rbp),%rax
movsd  0xabd(%rip),%xmm1
mulsd  0x18(%rax),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,0x28(%rax)
movsd  -0x20(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mov    -0x10(%rbp),%rax
mulsd  0x48(%rax),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,0x30(%rax)
mov    -0x10(%rbp),%rax
movsd  0x40(%rax),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,0x38(%rax)
mov    -0x10(%rbp),%rax
movsd  0x38(%rax),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,0x40(%rax)
movsd  0xa1f(%rip),%xmm0
divsd  -0x20(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movsd  0x30(%rax),%xmm1
mov    -0x10(%rbp),%rax
subsd  0x20(%rax),%xmm1
mulsd  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,0x48(%rax)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<coef_deriv_f>:
cmp    $0x2,%rdi
je     11ce <coef_deriv_f+0xce>
cmp    $0x1,%rdi
je     1280 <coef_deriv_f+0x180>
test   %rdi,%rdi
jne    1347 <coef_deriv_f+0x247>
movq   $0x0,(%rdx)
movsd  0x30(%rsi),%xmm0
mulsd  0xecf(%rip),%xmm0
movsd  %xmm0,0x8(%rdx)
movsd  0x40(%rsi),%xmm0
mulsd  0xec5(%rip),%xmm0
movsd  %xmm0,0x10(%rdx)
movsd  0x20(%rsi),%xmm0
movsd  %xmm0,0x18(%rdx)
movsd  0x18(%rsi),%xmm0
xorps  0xee2(%rip),%xmm0
movlps %xmm0,0x20(%rdx)
movsd  0x48(%rsi),%xmm0
mulsd  0xea9(%rip),%xmm0
movsd  %xmm0,0x28(%rdx)
movsd  0x8(%rsi),%xmm0
movsd  0x40(%rsi),%xmm1
addsd  %xmm1,%xmm1
mulsd  0xe86(%rip),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,0x30(%rdx)
movsd  0x48(%rsi),%xmm0
mulsd  0xe88(%rip),%xmm0
movsd  %xmm0,0x38(%rdx)
movsd  0x10(%rsi),%xmm0
movsd  0x30(%rsi),%xmm1
mulsd  0xe69(%rip),%xmm0
addsd  %xmm1,%xmm1
subsd  %xmm1,%xmm0
mov    $0x5,%eax
mov    $0x7,%ecx
jmp    132b <coef_deriv_f+0x22b>
movsd  0x18(%rsi),%xmm0
mulsd  0xe25(%rip),%xmm0
movsd  %xmm0,(%rdx)
movsd  0x28(%rsi),%xmm0
mulsd  0xe1c(%rip),%xmm0
movsd  %xmm0,0x8(%rdx)
movq   $0x0,0x10(%rdx)
movsd  (%rsi),%xmm0
movsd  0x28(%rsi),%xmm1
addsd  %xmm1,%xmm1
mulsd  0xe02(%rip),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,0x18(%rdx)
movsd  0x48(%rsi),%xmm0
mulsd  0xdf4(%rip),%xmm0
movsd  %xmm0,0x20(%rdx)
movsd  0x8(%rsi),%xmm0
movsd  0x18(%rsi),%xmm1
addsd  %xmm1,%xmm1
mulsd  0xde1(%rip),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,0x28(%rdx)
movsd  0x48(%rsi),%xmm0
mulsd  0xdd3(%rip),%xmm0
movsd  %xmm0,0x30(%rdx)
movsd  0x40(%rsi),%xmm0
movsd  %xmm0,0x38(%rdx)
movsd  0x38(%rsi),%xmm0
xorpd  0xdcf(%rip),%xmm0
mov    $0x4,%eax
mov    $0x6,%ecx
jmp    132b <coef_deriv_f+0x22b>
movsd  0x20(%rsi),%xmm0
mulsd  0xd7b(%rip),%xmm0
movsd  %xmm0,(%rdx)
movq   $0x0,0x8(%rdx)
movsd  0x38(%rsi),%xmm0
mulsd  0xd5a(%rip),%xmm0
movsd  %xmm0,0x10(%rdx)
movsd  0x48(%rsi),%xmm0
mulsd  0xd70(%rip),%xmm0
movsd  %xmm0,0x18(%rdx)
movsd  (%rsi),%xmm0
movsd  0x38(%rsi),%xmm1
addsd  %xmm1,%xmm1
mulsd  0xd4e(%rip),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,0x20(%rdx)
movsd  0x30(%rsi),%xmm0
xorps  0xd59(%rip),%xmm0
movlps %xmm0,0x28(%rdx)
movsd  0x28(%rsi),%xmm0
movsd  %xmm0,0x30(%rdx)
movsd  0x10(%rsi),%xmm0
movsd  0x20(%rsi),%xmm1
mulsd  0xd09(%rip),%xmm0
addsd  %xmm1,%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,0x38(%rdx)
movsd  0x48(%rsi),%xmm0
mulsd  0xcf7(%rip),%xmm0
mov    $0x8,%eax
mov    $0x3,%ecx
movsd  %xmm0,0x40(%rdx)
movsd  (%rsi,%rcx,8),%xmm0
subsd  (%rsi,%rax,8),%xmm0
mulsd  0xcee(%rip),%xmm0
movsd  %xmm0,0x48(%rdx)
ret

LLVM IR (-O0):
define void @coef_deriv_f(i64 %0, double* %1, double* %2) {
%4 = alloca i64
%5 = alloca double*
%6 = alloca double*
%7 = alloca double
%8 = alloca double
store i64 %0, i64* %4
store double* %1, double** %5
store double* %2, double** %6
%9 = call double @sqrt(double 3.000000e+00)
store double %9, double* %7
%10 = call double @sqrt(double 5.000000e+00)
store double %10, double* %8
%11 = load i64, i64* %4
switch i64 %11, label %255 [
i64 0, label %12
i64 1, label %93
i64 2, label %174
]
12: ; preds = %3
%13 = load double*, double** %6
%14 = getelementptr inbounds double, double* %13, i64 0
store double 0.000000e+00, double* %14
%15 = load double, double* %8
%16 = load double*, double** %5
%17 = getelementptr inbounds double, double* %16, i64 6
%18 = load double, double* %17
%19 = fmul double %15, %18
%20 = load double*, double** %6
%21 = getelementptr inbounds double, double* %20, i64 1
store double %19, double* %21
%22 = load double, double* %8
%23 = fneg double %22
%24 = load double*, double** %5
%25 = getelementptr inbounds double, double* %24, i64 8
%26 = load double, double* %25
%27 = fmul double %23, %26
%28 = load double*, double** %6
%29 = getelementptr inbounds double, double* %28, i64 2
store double %27, double* %29
%30 = load double*, double** %5
%31 = getelementptr inbounds double, double* %30, i64 4
%32 = load double, double* %31
%33 = load double*, double** %6
%34 = getelementptr inbounds double, double* %33, i64 3
store double %32, double* %34
%35 = load double*, double** %5
%36 = getelementptr inbounds double, double* %35, i64 3
%37 = load double, double* %36
%38 = fneg double %37
%39 = load double*, double** %6
%40 = getelementptr inbounds double, double* %39, i64 4
store double %38, double* %40
%41 = load double, double* %7
%42 = load double*, double** %5
%43 = getelementptr inbounds double, double* %42, i64 9
%44 = load double, double* %43
%45 = fmul double %41, %44
%46 = load double*, double** %6
%47 = getelementptr inbounds double, double* %46, i64 5
store double %45, double* %47
%48 = load double, double* %8
%49 = fdiv double -3.000000e+00, %48
%50 = load double*, double** %5
%51 = getelementptr inbounds double, double* %50, i64 1
%52 = load double, double* %51
%53 = load double*, double** %5
%54 = getelementptr inbounds double, double* %53, i64 8
%55 = load double, double* %54
%56 = fmul double 2.000000e+00, %55
%57 = call double @llvm.fmuladd.f64(double %49, double %52, double %56)
%58 = load double*, double** %6
%59 = getelementptr inbounds double, double* %58, i64 6
store double %57, double* %59
%60 = load double, double* %7
%61 = fneg double %60
%62 = load double*, double** %5
%63 = getelementptr inbounds double, double* %62, i64 9
%64 = load double, double* %63
%65 = fmul double %61, %64
%66 = load double*, double** %6
%67 = getelementptr inbounds double, double* %66, i64 7
store double %65, double* %67
%68 = load double, double* %8
%69 = fdiv double 3.000000e+00, %68
%70 = load double*, double** %5
%71 = getelementptr inbounds double, double* %70, i64 2
%72 = load double, double* %71
%73 = load double*, double** %5
%74 = getelementptr inbounds double, double* %73, i64 6
%75 = load double, double* %74
%76 = fmul double 2.000000e+00, %75
%77 = fneg double %76
%78 = call double @llvm.fmuladd.f64(double %69, double %72, double %77)
%79 = load double*, double** %6
%80 = getelementptr inbounds double, double* %79, i64 8
store double %78, double* %80
%81 = load double, double* %7
%82 = fdiv double 2.000000e+00, %81
%83 = load double*, double** %5
%84 = getelementptr inbounds double, double* %83, i64 7
%85 = load double, double* %84
%86 = load double*, double** %5
%87 = getelementptr inbounds double, double* %86, i64 5
%88 = load double, double* %87
%89 = fsub double %85, %88
%90 = fmul double %82, %89
%91 = load double*, double** %6
%92 = getelementptr inbounds double, double* %91, i64 9
store double %90, double* %92
br label %255
93: ; preds = %3
%94 = load double, double* %8
%95 = fneg double %94
%96 = load double*, double** %5
%97 = getelementptr inbounds double, double* %96, i64 4
%98 = load double, double* %97
%99 = fmul double %95, %98
%100 = load double*, double** %6
%101 = getelementptr inbounds double, double* %100, i64 0
store double %99, double* %101
%102 = load double*, double** %6
%103 = getelementptr inbounds double, double* %102, i64 1
store double 0.000000e+00, double* %103
%104 = load double, double* %8
%105 = load double*, double** %5
%106 = getelementptr inbounds double, double* %105, i64 7
%107 = load double, double* %106
%108 = fmul double %104, %107
%109 = load double*, double** %6
%110 = getelementptr inbounds double, double* %109, i64 2
store double %108, double* %110
%111 = load double, double* %7
%112 = fneg double %111
%113 = load double*, double** %5
%114 = getelementptr inbounds double, double* %113, i64 9
%115 = load double, double* %114
%116 = fmul double %112, %115
%117 = load double*, double** %6
%118 = getelementptr inbounds double, double* %117, i64 3
store double %116, double* %118
%119 = load double, double* %8
%120 = fdiv double 3.000000e+00, %119
%121 = load double*, double** %5
%122 = getelementptr inbounds double, double* %121, i64 0
%123 = load double, double* %122
%124 = load double*, double** %5
%125 = getelementptr inbounds double, double* %124, i64 7
%126 = load double, double* %125
%127 = fmul double 2.000000e+00, %126
%128 = fneg double %127
%129 = call double @llvm.fmuladd.f64(double %120, double %123, double %128)
%130 = load double*, double** %6
%131 = getelementptr inbounds double, double* %130, i64 4
store double %129, double* %131
%132 = load double*, double** %5
%133 = getelementptr inbounds double, double* %132, i64 6
%134 = load double, double* %133
%135 = fneg double %134
%136 = load double*, double** %6
%137 = getelementptr inbounds double, double* %136, i64 5
store double %135, double* %137
%138 = load double*, double** %5
%139 = getelementptr inbounds double, double* %138, i64 5
%140 = load double, double* %139
%141 = load double*, double** %6
%142 = getelementptr inbounds double, double* %141, i64 6
store double %140, double* %142
%143 = load double, double* %8
%144 = fdiv double -3.000000e+00, %143
%145 = load double*, double** %5
%146 = getelementptr inbounds double, double* %145, i64 2
%147 = load double, double* %146
%148 = load double*, double** %5
%149 = getelementptr inbounds double, double* %148, i64 4
%150 = load double, double* %149
%151 = fmul double 2.000000e+00, %150
%152 = call double @llvm.fmuladd.f64(double %144, double %147, double %151)
%153 = load double*, double** %6
%154 = getelementptr inbounds double, double* %153, i64 7
store double %152, double* %154
%155 = load double, double* %7
%156 = load double*, double** %5
%157 = getelementptr inbounds double, double* %156, i64 9
%158 = load double, double* %157
%159 = fmul double %155, %158
%160 = load double*, double** %6
%161 = getelementptr inbounds double, double* %160, i64 8
store double %159, double* %161
%162 = load double, double* %7
%163 = fdiv double 2.000000e+00, %162
%164 = load double*, double** %5
%165 = getelementptr inbounds double, double* %164, i64 3
%166 = load double, double* %165
%167 = load double*, double** %5
%168 = getelementptr inbounds double, double* %167, i64 8
%169 = load double, double* %168
%170 = fsub double %166, %169
%171 = fmul double %163, %170
%172 = load double*, double** %6
%173 = getelementptr inbounds double, double* %172, i64 9
store double %171, double* %173
br label %255
174: ; preds = %3
%175 = load double, double* %8
%176 = load double*, double** %5
%177 = getelementptr inbounds double, double* %176, i64 3
%178 = load double, double* %177
%179 = fmul double %175, %178
%180 = load double*, double** %6
%181 = getelementptr inbounds double, double* %180, i64 0
store double %179, double* %181
%182 = load double, double* %8
%183 = fneg double %182
%184 = load double*, double** %5
%185 = getelementptr inbounds double, double* %184, i64 5
%186 = load double, double* %185
%187 = fmul double %183, %186
%188 = load double*, double** %6
%189 = getelementptr inbounds double, double* %188, i64 1
store double %187, double* %189
%190 = load double*, double** %6
%191 = getelementptr inbounds double, double* %190, i64 2
store double 0.000000e+00, double* %191
%192 = load double, double* %8
%193 = fdiv double -3.000000e+00, %192
%194 = load double*, double** %5
%195 = getelementptr inbounds double, double* %194, i64 0
%196 = load double, double* %195
%197 = load double*, double** %5
%198 = getelementptr inbounds double, double* %197, i64 5
%199 = load double, double* %198
%200 = fmul double 2.000000e+00, %199
%201 = call double @llvm.fmuladd.f64(double %193, double %196, double %200)
%202 = load double*, double** %6
%203 = getelementptr inbounds double, double* %202, i64 3
store double %201, double* %203
%204 = load double, double* %7
%205 = load double*, double** %5
%206 = getelementptr inbounds double, double* %205, i64 9
%207 = load double, double* %206
%208 = fmul double %204, %207
%209 = load double*, double** %6
%210 = getelementptr inbounds double, double* %209, i64 4
store double %208, double* %210
%211 = load double, double* %8
%212 = fdiv double 3.000000e+00, %211
%213 = load double*, double** %5
%214 = getelementptr inbounds double, double* %213, i64 1
%215 = load double, double* %214
%216 = load double*, double** %5
%217 = getelementptr inbounds double, double* %216, i64 3
%218 = load double, double* %217
%219 = fmul double 2.000000e+00, %218
%220 = fneg double %219
%221 = call double @llvm.fmuladd.f64(double %212, double %215, double %220)
%222 = load double*, double** %6
%223 = getelementptr inbounds double, double* %222, i64 5
store double %221, double* %223
%224 = load double, double* %7
%225 = fneg double %224
%226 = load double*, double** %5
%227 = getelementptr inbounds double, double* %226, i64 9
%228 = load double, double* %227
%229 = fmul double %225, %228
%230 = load double*, double** %6
%231 = getelementptr inbounds double, double* %230, i64 6
store double %229, double* %231
%232 = load double*, double** %5
%233 = getelementptr inbounds double, double* %232, i64 8
%234 = load double, double* %233
%235 = load double*, double** %6
%236 = getelementptr inbounds double, double* %235, i64 7
store double %234, double* %236
%237 = load double*, double** %5
%238 = getelementptr inbounds double, double* %237, i64 7
%239 = load double, double* %238
%240 = fneg double %239
%241 = load double*, double** %6
%242 = getelementptr inbounds double, double* %241, i64 8
store double %240, double* %242
%243 = load double, double* %7
%244 = fdiv double 2.000000e+00, %243
%245 = load double*, double** %5
%246 = getelementptr inbounds double, double* %245, i64 6
%247 = load double, double* %246
%248 = load double*, double** %5
%249 = getelementptr inbounds double, double* %248, i64 4
%250 = load double, double* %249
%251 = fsub double %247, %250
%252 = fmul double %244, %251
%253 = load double*, double** %6
%254 = getelementptr inbounds double, double* %253, i64 9
store double %252, double* %254
br label %255
255: ; preds = %3, %174, %93, %12
ret void
}

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