void mu_type1d(long N, double *mom0, double *mom) {
  double m;
  double m2;
  mom[0] = mom0[0];
  m = mom[1] = mom0[1];
  m2 = m * m;
  mom[2] = (mom0[2] - m2);
  mom[3] = (mom0[3] - 3 * m * mom0[2] + 2 * m2 * m);
  mom[4] = (mom0[4] - 4 * m * mom0[3] + 6 * mom0[2] * m2 - 3 * m2 * m2);
}


x86 assembly (clang, -O0):
<mu_type1d>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,0x8(%rax)
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
mulsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    -0x10(%rbp),%rax
movsd  0x10(%rax),%xmm0
subsd  -0x28(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,0x10(%rax)
mov    -0x10(%rbp),%rax
movsd  0x18(%rax),%xmm0
movsd  0xe92(%rip),%xmm1
mulsd  -0x20(%rbp),%xmm1
mov    -0x10(%rbp),%rax
movsd  0x10(%rax),%xmm2
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  0xe75(%rip),%xmm0
mulsd  -0x28(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,0x18(%rax)
mov    -0x10(%rbp),%rax
movsd  0x20(%rax),%xmm1
movsd  0xe41(%rip),%xmm0
mulsd  -0x20(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movsd  0x18(%rax),%xmm2
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
movsd  0xe00(%rip),%xmm1
mulsd  0x10(%rax),%xmm1
movsd  -0x28(%rbp),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  0xdde(%rip),%xmm0
mulsd  -0x28(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm2
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,0x20(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<mu_type1d>:
movsd  (%rsi),%xmm0
movsd  %xmm0,(%rdx)
movsd  0x8(%rsi),%xmm1
movsd  %xmm1,0x8(%rdx)
movapd %xmm1,%xmm0
mulsd  %xmm1,%xmm0
movsd  0x10(%rsi),%xmm2
subsd  %xmm0,%xmm2
movsd  %xmm2,0x10(%rdx)
movsd  0xed0(%rip),%xmm2
movapd %xmm1,%xmm3
mulsd  %xmm2,%xmm3
mulsd  0x10(%rsi),%xmm3
addsd  0x18(%rsi),%xmm3
movapd %xmm0,%xmm4
addsd  %xmm0,%xmm4
mulsd  %xmm1,%xmm4
addsd  %xmm3,%xmm4
movsd  %xmm4,0x18(%rdx)
mulsd  0xea9(%rip),%xmm1
mulsd  0x18(%rsi),%xmm1
addsd  0x20(%rsi),%xmm1
movsd  0x10(%rsi),%xmm3
mulsd  0xe9a(%rip),%xmm3
mulsd  %xmm0,%xmm3
addsd  %xmm1,%xmm3
mulsd  %xmm0,%xmm2
mulsd  %xmm0,%xmm2
addsd  %xmm3,%xmm2
movsd  %xmm2,0x20(%rdx)
ret

LLVM IR (-O0):
define void @mu_type1d(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 = load double*, double** %5
%10 = getelementptr inbounds double, double* %9, i64 0
%11 = load double, double* %10
%12 = load double*, double** %6
%13 = getelementptr inbounds double, double* %12, i64 0
store double %11, double* %13
%14 = load double*, double** %5
%15 = getelementptr inbounds double, double* %14, i64 1
%16 = load double, double* %15
%17 = load double*, double** %6
%18 = getelementptr inbounds double, double* %17, i64 1
store double %16, double* %18
store double %16, double* %7
%19 = load double, double* %7
%20 = load double, double* %7
%21 = fmul double %19, %20
store double %21, double* %8
%22 = load double*, double** %5
%23 = getelementptr inbounds double, double* %22, i64 2
%24 = load double, double* %23
%25 = load double, double* %8
%26 = fsub double %24, %25
%27 = load double*, double** %6
%28 = getelementptr inbounds double, double* %27, i64 2
store double %26, double* %28
%29 = load double*, double** %5
%30 = getelementptr inbounds double, double* %29, i64 3
%31 = load double, double* %30
%32 = load double, double* %7
%33 = fmul double 3.000000e+00, %32
%34 = load double*, double** %5
%35 = getelementptr inbounds double, double* %34, i64 2
%36 = load double, double* %35
%37 = fneg double %33
%38 = call double @llvm.fmuladd.f64(double %37, double %36, double %31)
%39 = load double, double* %8
%40 = fmul double 2.000000e+00, %39
%41 = load double, double* %7
%42 = call double @llvm.fmuladd.f64(double %40, double %41, double %38)
%43 = load double*, double** %6
%44 = getelementptr inbounds double, double* %43, i64 3
store double %42, double* %44
%45 = load double*, double** %5
%46 = getelementptr inbounds double, double* %45, i64 4
%47 = load double, double* %46
%48 = load double, double* %7
%49 = fmul double 4.000000e+00, %48
%50 = load double*, double** %5
%51 = getelementptr inbounds double, double* %50, i64 3
%52 = load double, double* %51
%53 = fneg double %49
%54 = call double @llvm.fmuladd.f64(double %53, double %52, double %47)
%55 = load double*, double** %5
%56 = getelementptr inbounds double, double* %55, i64 2
%57 = load double, double* %56
%58 = fmul double 6.000000e+00, %57
%59 = load double, double* %8
%60 = call double @llvm.fmuladd.f64(double %58, double %59, double %54)
%61 = load double, double* %8
%62 = fmul double 3.000000e+00, %61
%63 = load double, double* %8
%64 = fneg double %62
%65 = call double @llvm.fmuladd.f64(double %64, double %63, double %60)
%66 = load double*, double** %6
%67 = getelementptr inbounds double, double* %66, i64 4
store double %65, double* %67
ret void
}

LLVM IR (-O2):
define void @mu_type1d(i64 %0, double* nocapture %1, double* nocapture writeonly %2) {
%4 = load double, double* %1
store double %4, double* %2
%5 = getelementptr inbounds double, double* %1, i64 1
%6 = load double, double* %5
%7 = getelementptr inbounds double, double* %2, i64 1
store double %6, double* %7
%8 = fmul double %6, %6
%9 = getelementptr inbounds double, double* %1, i64 2
%10 = load double, double* %9
%11 = fsub double %10, %8
%12 = getelementptr inbounds double, double* %2, i64 2
store double %11, double* %12
%13 = getelementptr inbounds double, double* %1, i64 3
%14 = load double, double* %13
%15 = load double, double* %9
%16 = fmul double %6, -3.000000e+00
%17 = tail call double @llvm.fmuladd.f64(double %16, double %15, double %14)
%18 = fmul double %8, 2.000000e+00
%19 = tail call double @llvm.fmuladd.f64(double %18, double %6, double %17)
%20 = getelementptr inbounds double, double* %2, i64 3
store double %19, double* %20
%21 = getelementptr inbounds double, double* %1, i64 4
%22 = load double, double* %21
%23 = load double, double* %13
%24 = fmul double %6, -4.000000e+00
%25 = tail call double @llvm.fmuladd.f64(double %24, double %23, double %22)
%26 = load double, double* %9
%27 = fmul double %26, 6.000000e+00
%28 = tail call double @llvm.fmuladd.f64(double %27, double %8, double %25)
%29 = fmul double %8, -3.000000e+00
%30 = tail call double @llvm.fmuladd.f64(double %29, double %8, double %28)
%31 = getelementptr inbounds double, double* %2, i64 4
store double %30, double* %31
ret void
}