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


x86 assembly (clang, -O0):
<submm>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x10,-0x14(%rbp)
jge    114e <submm+0x4e>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1113 <submm+0x13>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @submm(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 = %21, %2
%7 = load i32, i32* %5
%8 = icmp slt i32 %7, 16
br i1 %8, label %9, label %24
9: ; preds = %6
%10 = load double*, double** %4
%11 = load i32, i32* %5
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds double, double* %10, i64 %12
%14 = load double, double* %13
%15 = load double*, double** %3
%16 = load i32, i32* %5
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds double, double* %15, i64 %17
%19 = load double, double* %18
%20 = fsub double %19, %14
store double %20, double* %18
br label %21
21: ; preds = %9
%22 = load i32, i32* %5
%23 = add nsw i32 %22, 1
store i32 %23, i32* %5
br label %6
24: ; preds = %6
ret void
}

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