void lonlatpv2cv_with_base(polar_vec, polar_base, cart_vec) double *polar_vec;
double *polar_base;
double *cart_vec;
{
  int i;
  for (i = 0; i < 3; i++) {
    cart_vec[i] = polar_base[i] * polar_vec[0];
    cart_vec[i] += polar_base[3 + i] * polar_vec[1];
    cart_vec[i] += polar_base[6 + i] * polar_vec[2];
  }
}


x86 assembly (clang, -O0):
<lonlatpv2cv_with_base>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
cmpl   $0x3,-0x1c(%rbp)
jge    11bb <lonlatpv2cv_with_base+0xbb>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x8(%rbp),%rax
mulsd  (%rax),%xmm0
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x10(%rbp),%rax
mov    -0x1c(%rbp),%ecx
add    $0x3,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm2
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x10(%rbp),%rax
mov    -0x1c(%rbp),%ecx
add    $0x6,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm2
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1117 <lonlatpv2cv_with_base+0x17>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @lonlatpv2cv_with_base(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 = %55, %3
%9 = load i32, i32* %7
%10 = icmp slt i32 %9, 3
br i1 %10, label %11, label %58
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** %4
%18 = getelementptr inbounds double, double* %17, i64 0
%19 = load double, double* %18
%20 = fmul double %16, %19
%21 = load double*, double** %6
%22 = load i32, i32* %7
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds double, double* %21, i64 %23
store double %20, double* %24
%25 = load double*, double** %5
%26 = load i32, i32* %7
%27 = add nsw i32 3, %26
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds double, double* %25, i64 %28
%30 = load double, double* %29
%31 = load double*, double** %4
%32 = getelementptr inbounds double, double* %31, i64 1
%33 = load double, double* %32
%34 = load double*, double** %6
%35 = load i32, i32* %7
%36 = sext i32 %35 to i64
%37 = getelementptr inbounds double, double* %34, i64 %36
%38 = load double, double* %37
%39 = call double @llvm.fmuladd.f64(double %30, double %33, double %38)
store double %39, double* %37
%40 = load double*, double** %5
%41 = load i32, i32* %7
%42 = add nsw i32 6, %41
%43 = sext i32 %42 to i64
%44 = getelementptr inbounds double, double* %40, i64 %43
%45 = load double, double* %44
%46 = load double*, double** %4
%47 = getelementptr inbounds double, double* %46, i64 2
%48 = load double, double* %47
%49 = load double*, double** %6
%50 = load i32, i32* %7
%51 = sext i32 %50 to i64
%52 = getelementptr inbounds double, double* %49, i64 %51
%53 = load double, double* %52
%54 = call double @llvm.fmuladd.f64(double %45, double %48, double %53)
store double %54, double* %52
br label %55
55: ; preds = %11
%56 = load i32, i32* %7
%57 = add nsw i32 %56, 1
store i32 %57, i32* %7
br label %8
58: ; preds = %8
ret void
}

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