void u_line(double s, double xc[3], double udir[3], double pnt[3]) {
  int i;
  for (i = 0; i < 3; i++)
    pnt[i] = xc[i] + s * udir[i];
}


x86 assembly (clang, -O0):
<u_line>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
cmpl   $0x3,-0x24(%rbp)
jge    1168 <u_line+0x68>
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
movsd  -0x8(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movslq -0x24(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x20(%rbp),%rax
movslq -0x24(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    111c <u_line+0x1c>
pop    %rbp
ret

x86 assembly (clang, -O2):
<u_line>:
movsd  (%rsi),%xmm1
mulsd  %xmm0,%xmm1
addsd  (%rdi),%xmm1
movsd  %xmm1,(%rdx)
movsd  0x8(%rsi),%xmm1
mulsd  %xmm0,%xmm1
addsd  0x8(%rdi),%xmm1
movsd  %xmm1,0x8(%rdx)
mulsd  0x10(%rsi),%xmm0
addsd  0x10(%rdi),%xmm0
movsd  %xmm0,0x10(%rdx)
ret

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

LLVM IR (-O2):
define void @u_line(double %0, double* nocapture %1, double* nocapture %2, double* nocapture writeonly %3) {
%5 = load double, double* %1
%6 = load double, double* %2
%7 = tail call double @llvm.fmuladd.f64(double %0, double %6, double %5)
store double %7, double* %3
%8 = getelementptr inbounds double, double* %1, i64 1
%9 = load double, double* %8
%10 = getelementptr inbounds double, double* %2, i64 1
%11 = load double, double* %10
%12 = tail call double @llvm.fmuladd.f64(double %0, double %11, double %9)
%13 = getelementptr inbounds double, double* %3, i64 1
store double %12, double* %13
%14 = getelementptr inbounds double, double* %1, i64 2
%15 = load double, double* %14
%16 = getelementptr inbounds double, double* %2, i64 2
%17 = load double, double* %16
%18 = tail call double @llvm.fmuladd.f64(double %0, double %17, double %15)
%19 = getelementptr inbounds double, double* %3, i64 2
store double %18, double* %19
ret void
}