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


x86 assembly (clang, -O0):
<mulmf>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movsd  %xmm0,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
cmpl   $0x10,-0x1c(%rbp)
jge    114f <mulmf+0x4f>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mulsd  -0x18(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1118 <mulmf+0x18>
pop    %rbp
ret

x86 assembly (clang, -O2):
<mulmf>:
movsd  (%rsi),%xmm1
mulsd  %xmm0,%xmm1
movsd  %xmm1,(%rdi)
movsd  0x8(%rsi),%xmm1
mulsd  %xmm0,%xmm1
movsd  %xmm1,0x8(%rdi)
movsd  0x10(%rsi),%xmm1
mulsd  %xmm0,%xmm1
movsd  %xmm1,0x10(%rdi)
movsd  0x18(%rsi),%xmm1
mulsd  %xmm0,%xmm1
movsd  %xmm1,0x18(%rdi)
movsd  0x20(%rsi),%xmm1
mulsd  %xmm0,%xmm1
movsd  %xmm1,0x20(%rdi)
movsd  0x28(%rsi),%xmm1
mulsd  %xmm0,%xmm1
movsd  %xmm1,0x28(%rdi)
movsd  0x30(%rsi),%xmm1
mulsd  %xmm0,%xmm1
movsd  %xmm1,0x30(%rdi)
movsd  0x38(%rsi),%xmm1
mulsd  %xmm0,%xmm1
movsd  %xmm1,0x38(%rdi)
movsd  0x40(%rsi),%xmm1
mulsd  %xmm0,%xmm1
movsd  %xmm1,0x40(%rdi)
movsd  0x48(%rsi),%xmm1
mulsd  %xmm0,%xmm1
movsd  %xmm1,0x48(%rdi)
movsd  0x50(%rsi),%xmm1
mulsd  %xmm0,%xmm1
movsd  %xmm1,0x50(%rdi)
movsd  0x58(%rsi),%xmm1
mulsd  %xmm0,%xmm1
movsd  %xmm1,0x58(%rdi)
movsd  0x60(%rsi),%xmm1
mulsd  %xmm0,%xmm1
movsd  %xmm1,0x60(%rdi)
movsd  0x68(%rsi),%xmm1
mulsd  %xmm0,%xmm1
movsd  %xmm1,0x68(%rdi)
movsd  0x70(%rsi),%xmm1
mulsd  %xmm0,%xmm1
movsd  %xmm1,0x70(%rdi)
mulsd  0x78(%rsi),%xmm0
movsd  %xmm0,0x78(%rdi)
ret

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

LLVM IR (-O2):
define void @mulmf(double* nocapture writeonly %0, double* nocapture %1, double %2) {
%4 = load double, double* %1
%5 = fmul double %4, %2
store double %5, double* %0
%6 = getelementptr inbounds double, double* %1, i64 1
%7 = load double, double* %6
%8 = fmul double %7, %2
%9 = getelementptr inbounds double, double* %0, i64 1
store double %8, double* %9
%10 = getelementptr inbounds double, double* %1, i64 2
%11 = load double, double* %10
%12 = fmul double %11, %2
%13 = getelementptr inbounds double, double* %0, i64 2
store double %12, double* %13
%14 = getelementptr inbounds double, double* %1, i64 3
%15 = load double, double* %14
%16 = fmul double %15, %2
%17 = getelementptr inbounds double, double* %0, i64 3
store double %16, double* %17
%18 = getelementptr inbounds double, double* %1, i64 4
%19 = load double, double* %18
%20 = fmul double %19, %2
%21 = getelementptr inbounds double, double* %0, i64 4
store double %20, double* %21
%22 = getelementptr inbounds double, double* %1, i64 5
%23 = load double, double* %22
%24 = fmul double %23, %2
%25 = getelementptr inbounds double, double* %0, i64 5
store double %24, double* %25
%26 = getelementptr inbounds double, double* %1, i64 6
%27 = load double, double* %26
%28 = fmul double %27, %2
%29 = getelementptr inbounds double, double* %0, i64 6
store double %28, double* %29
%30 = getelementptr inbounds double, double* %1, i64 7
%31 = load double, double* %30
%32 = fmul double %31, %2
%33 = getelementptr inbounds double, double* %0, i64 7
store double %32, double* %33
%34 = getelementptr inbounds double, double* %1, i64 8
%35 = load double, double* %34
%36 = fmul double %35, %2
%37 = getelementptr inbounds double, double* %0, i64 8
store double %36, double* %37
%38 = getelementptr inbounds double, double* %1, i64 9
%39 = load double, double* %38
%40 = fmul double %39, %2
%41 = getelementptr inbounds double, double* %0, i64 9
store double %40, double* %41
%42 = getelementptr inbounds double, double* %1, i64 10
%43 = load double, double* %42
%44 = fmul double %43, %2
%45 = getelementptr inbounds double, double* %0, i64 10
store double %44, double* %45
%46 = getelementptr inbounds double, double* %1, i64 11
%47 = load double, double* %46
%48 = fmul double %47, %2
%49 = getelementptr inbounds double, double* %0, i64 11
store double %48, double* %49
%50 = getelementptr inbounds double, double* %1, i64 12
%51 = load double, double* %50
%52 = fmul double %51, %2
%53 = getelementptr inbounds double, double* %0, i64 12
store double %52, double* %53
%54 = getelementptr inbounds double, double* %1, i64 13
%55 = load double, double* %54
%56 = fmul double %55, %2
%57 = getelementptr inbounds double, double* %0, i64 13
store double %56, double* %57
%58 = getelementptr inbounds double, double* %1, i64 14
%59 = load double, double* %58
%60 = fmul double %59, %2
%61 = getelementptr inbounds double, double* %0, i64 14
store double %60, double* %61
%62 = getelementptr inbounds double, double* %1, i64 15
%63 = load double, double* %62
%64 = fmul double %63, %2
%65 = getelementptr inbounds double, double* %0, i64 15
store double %64, double* %65
ret void
}