void mulmf(double *result, const double t) {
  int i;
  for (i = 0; i < 16; i++)
    result[i] *= t;
}


x86 assembly (clang, -O0):
<mulmf>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x10,-0x14(%rbp)
jge    1143 <mulmf+0x43>
movsd  -0x10(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mulsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1114 <mulmf+0x14>
pop    %rbp
ret

x86 assembly (clang, -O2):
<mulmf>:
unpcklpd %xmm0,%xmm0
movupd (%rdi),%xmm1
movupd 0x10(%rdi),%xmm2
movupd 0x20(%rdi),%xmm3
movupd 0x30(%rdi),%xmm4
mulpd  %xmm0,%xmm1
movupd %xmm1,(%rdi)
mulpd  %xmm0,%xmm2
movupd %xmm2,0x10(%rdi)
mulpd  %xmm0,%xmm3
movupd %xmm3,0x20(%rdi)
mulpd  %xmm0,%xmm4
movupd %xmm4,0x30(%rdi)
movupd 0x40(%rdi),%xmm1
mulpd  %xmm0,%xmm1
movupd %xmm1,0x40(%rdi)
movupd 0x50(%rdi),%xmm1
mulpd  %xmm0,%xmm1
movupd %xmm1,0x50(%rdi)
movupd 0x60(%rdi),%xmm1
mulpd  %xmm0,%xmm1
movupd %xmm1,0x60(%rdi)
movupd 0x70(%rdi),%xmm1
mulpd  %xmm0,%xmm1
movupd %xmm1,0x70(%rdi)
ret

LLVM IR (-O0):
define void @mulmf(double* %0, double %1) {
%3 = alloca double*
%4 = alloca double
%5 = alloca i32
store double* %0, double** %3
store double %1, double* %4
store i32 0, i32* %5
br label %6
6: ; preds = %17, %2
%7 = load i32, i32* %5
%8 = icmp slt i32 %7, 16
br i1 %8, label %9, label %20
9: ; preds = %6
%10 = load double, double* %4
%11 = load double*, double** %3
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds double, double* %11, i64 %13
%15 = load double, double* %14
%16 = fmul double %15, %10
store double %16, double* %14
br label %17
17: ; preds = %9
%18 = load i32, i32* %5
%19 = add nsw i32 %18, 1
store i32 %19, i32* %5
br label %6
20: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @mulmf(double* nocapture %0, double %1) {
%3 = bitcast double* %0 to <2 x double>*
%4 = load <2 x double>, <2 x double>* %3
%5 = insertelement <2 x double> poison, double %1, i64 0
%6 = shufflevector <2 x double> %5, <2 x double> poison, <2 x i32> zeroinitializer
%7 = fmul <2 x double> %4, %6
%8 = bitcast double* %0 to <2 x double>*
store <2 x double> %7, <2 x double>* %8
%9 = getelementptr inbounds double, double* %0, i64 2
%10 = bitcast double* %9 to <2 x double>*
%11 = load <2 x double>, <2 x double>* %10
%12 = fmul <2 x double> %11, %6
%13 = bitcast double* %9 to <2 x double>*
store <2 x double> %12, <2 x double>* %13
%14 = getelementptr inbounds double, double* %0, i64 4
%15 = bitcast double* %14 to <2 x double>*
%16 = load <2 x double>, <2 x double>* %15
%17 = fmul <2 x double> %16, %6
%18 = bitcast double* %14 to <2 x double>*
store <2 x double> %17, <2 x double>* %18
%19 = getelementptr inbounds double, double* %0, i64 6
%20 = bitcast double* %19 to <2 x double>*
%21 = load <2 x double>, <2 x double>* %20
%22 = fmul <2 x double> %21, %6
%23 = bitcast double* %19 to <2 x double>*
store <2 x double> %22, <2 x double>* %23
%24 = getelementptr inbounds double, double* %0, i64 8
%25 = bitcast double* %24 to <2 x double>*
%26 = load <2 x double>, <2 x double>* %25
%27 = fmul <2 x double> %26, %6
%28 = bitcast double* %24 to <2 x double>*
store <2 x double> %27, <2 x double>* %28
%29 = getelementptr inbounds double, double* %0, i64 10
%30 = bitcast double* %29 to <2 x double>*
%31 = load <2 x double>, <2 x double>* %30
%32 = fmul <2 x double> %31, %6
%33 = bitcast double* %29 to <2 x double>*
store <2 x double> %32, <2 x double>* %33
%34 = getelementptr inbounds double, double* %0, i64 12
%35 = bitcast double* %34 to <2 x double>*
%36 = load <2 x double>, <2 x double>* %35
%37 = fmul <2 x double> %36, %6
%38 = bitcast double* %34 to <2 x double>*
store <2 x double> %37, <2 x double>* %38
%39 = getelementptr inbounds double, double* %0, i64 14
%40 = bitcast double* %39 to <2 x double>*
%41 = load <2 x double>, <2 x double>* %40
%42 = fmul <2 x double> %41, %6
%43 = bitcast double* %39 to <2 x double>*
store <2 x double> %42, <2 x double>* %43
ret void
}