void bot_vector_affine_transform_3d(const double A[9], const double b[3],
                                    const double v[3], double result[3]) {
  result[0] = A[0] * v[0] + A[1] * v[1] + A[2] * v[2] + b[0];
  result[1] = A[3] * v[0] + A[4] * v[1] + A[5] * v[2] + b[1];
  result[2] = A[6] * v[0] + A[7] * v[1] + A[8] * v[2] + b[2];
}


x86 assembly (clang, -O0):
<bot_vector_affine_transform_3d>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm2
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x18(%rbp),%rax
mulsd  0x8(%rax),%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm0
mov    -0x18(%rbp),%rax
movsd  0x10(%rax),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
addsd  (%rax),%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
movsd  0x18(%rax),%xmm1
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm2
mov    -0x8(%rbp),%rax
movsd  0x20(%rax),%xmm0
mov    -0x18(%rbp),%rax
mulsd  0x8(%rax),%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
mov    -0x8(%rbp),%rax
movsd  0x28(%rax),%xmm0
mov    -0x18(%rbp),%rax
movsd  0x10(%rax),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
addsd  0x8(%rax),%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,0x8(%rax)
mov    -0x8(%rbp),%rax
movsd  0x30(%rax),%xmm1
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm2
mov    -0x8(%rbp),%rax
movsd  0x38(%rax),%xmm0
mov    -0x18(%rbp),%rax
mulsd  0x8(%rax),%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
mov    -0x8(%rbp),%rax
movsd  0x40(%rax),%xmm0
mov    -0x18(%rbp),%rax
movsd  0x10(%rax),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
addsd  0x10(%rax),%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,0x10(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<bot_vector_affine_transform_3d>:
movsd  (%rdi),%xmm0
movsd  0x8(%rdi),%xmm1
mulsd  0x8(%rdx),%xmm1
mulsd  (%rdx),%xmm0
movsd  0x10(%rdi),%xmm2
mulsd  0x10(%rdx),%xmm2
addsd  %xmm1,%xmm0
addsd  %xmm0,%xmm2
addsd  (%rsi),%xmm2
movsd  %xmm2,(%rcx)
movsd  0x18(%rdi),%xmm0
movsd  0x20(%rdi),%xmm1
mulsd  0x8(%rdx),%xmm1
mulsd  (%rdx),%xmm0
movsd  0x28(%rdi),%xmm2
mulsd  0x10(%rdx),%xmm2
addsd  %xmm1,%xmm0
addsd  %xmm0,%xmm2
addsd  0x8(%rsi),%xmm2
movsd  %xmm2,0x8(%rcx)
movsd  0x30(%rdi),%xmm0
movsd  0x38(%rdi),%xmm1
mulsd  0x8(%rdx),%xmm1
mulsd  (%rdx),%xmm0
addsd  %xmm1,%xmm0
movsd  0x40(%rdi),%xmm1
mulsd  0x10(%rdx),%xmm1
addsd  %xmm0,%xmm1
addsd  0x10(%rsi),%xmm1
movsd  %xmm1,0x10(%rcx)
ret

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

LLVM IR (-O2):
define void @bot_vector_affine_transform_3d(double* nocapture %0, double* nocapture %1, double* nocapture %2, double* nocapture writeonly %3) {
%5 = load double, double* %0
%6 = load double, double* %2
%7 = getelementptr inbounds double, double* %0, i64 1
%8 = load double, double* %7
%9 = getelementptr inbounds double, double* %2, i64 1
%10 = load double, double* %9
%11 = fmul double %8, %10
%12 = tail call double @llvm.fmuladd.f64(double %5, double %6, double %11)
%13 = getelementptr inbounds double, double* %0, i64 2
%14 = load double, double* %13
%15 = getelementptr inbounds double, double* %2, i64 2
%16 = load double, double* %15
%17 = tail call double @llvm.fmuladd.f64(double %14, double %16, double %12)
%18 = load double, double* %1
%19 = fadd double %17, %18
store double %19, double* %3
%20 = getelementptr inbounds double, double* %0, i64 3
%21 = load double, double* %20
%22 = load double, double* %2
%23 = getelementptr inbounds double, double* %0, i64 4
%24 = load double, double* %23
%25 = load double, double* %9
%26 = fmul double %24, %25
%27 = tail call double @llvm.fmuladd.f64(double %21, double %22, double %26)
%28 = getelementptr inbounds double, double* %0, i64 5
%29 = load double, double* %28
%30 = load double, double* %15
%31 = tail call double @llvm.fmuladd.f64(double %29, double %30, double %27)
%32 = getelementptr inbounds double, double* %1, i64 1
%33 = load double, double* %32
%34 = fadd double %31, %33
%35 = getelementptr inbounds double, double* %3, i64 1
store double %34, double* %35
%36 = getelementptr inbounds double, double* %0, i64 6
%37 = load double, double* %36
%38 = load double, double* %2
%39 = getelementptr inbounds double, double* %0, i64 7
%40 = load double, double* %39
%41 = load double, double* %9
%42 = fmul double %40, %41
%43 = tail call double @llvm.fmuladd.f64(double %37, double %38, double %42)
%44 = getelementptr inbounds double, double* %0, i64 8
%45 = load double, double* %44
%46 = load double, double* %15
%47 = tail call double @llvm.fmuladd.f64(double %45, double %46, double %43)
%48 = getelementptr inbounds double, double* %1, i64 2
%49 = load double, double* %48
%50 = fadd double %47, %49
%51 = getelementptr inbounds double, double* %3, i64 2
store double %50, double* %51
ret void
}