void XoVNormalize(x, y, z) float *x, *y, *z;
{
  double len = XoVLength(*x, *y, *z);
  if (len > 0) {
    *x /= len;
    *y /= len;
    *z /= len;
  }
}


x86 assembly (clang, -O0):
<XoVNormalize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
cvtss2sd %xmm0,%xmm0
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm1
cvtss2sd %xmm1,%xmm1
mov    -0x18(%rbp),%rax
movss  (%rax),%xmm2
cvtss2sd %xmm2,%xmm2
mov    $0x3,%al
call   1030 <XoVLength@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    11c1 <XoVNormalize+0xb1>
movsd  -0x20(%rbp),%xmm1
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
cvtss2sd %xmm0,%xmm0
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,(%rax)
movsd  -0x20(%rbp),%xmm1
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
cvtss2sd %xmm0,%xmm0
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,(%rax)
movsd  -0x20(%rbp),%xmm1
mov    -0x18(%rbp),%rax
movss  (%rax),%xmm0
cvtss2sd %xmm0,%xmm0
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<XoVNormalize>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
movss  (%rdi),%xmm0
cvtss2sd %xmm0,%xmm0
movss  (%rsi),%xmm1
cvtss2sd %xmm1,%xmm1
movss  (%rdx),%xmm2
cvtss2sd %xmm2,%xmm2
mov    $0x3,%al
call   1030 <XoVLength@plt>
test   %eax,%eax
jle    118b <XoVNormalize+0x7b>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movss  (%rbx),%xmm1
cvtss2sd %xmm1,%xmm1
divsd  %xmm0,%xmm1
cvtsd2ss %xmm1,%xmm1
movss  %xmm1,(%rbx)
movss  (%r15),%xmm1
cvtss2sd %xmm1,%xmm1
divsd  %xmm0,%xmm1
cvtsd2ss %xmm1,%xmm1
movss  %xmm1,(%r15)
movss  (%r14),%xmm1
cvtss2sd %xmm1,%xmm1
divsd  %xmm0,%xmm1
xorps  %xmm0,%xmm0
cvtsd2ss %xmm1,%xmm0
movss  %xmm0,(%r14)
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @XoVNormalize(float* %0, float* %1, float* %2) {
%4 = alloca float*
%5 = alloca float*
%6 = alloca float*
%7 = alloca double
store float* %0, float** %4
store float* %1, float** %5
store float* %2, float** %6
%8 = load float*, float** %4
%9 = load float, float* %8
%10 = fpext float %9 to double
%11 = load float*, float** %5
%12 = load float, float* %11
%13 = fpext float %12 to double
%14 = load float*, float** %6
%15 = load float, float* %14
%16 = fpext float %15 to double
%17 = call i32 (double, double, double, ...) bitcast (i32 (...)* @XoVLength to i32 (double, double, double, ...)*)(double %10, double %13, double %16)
%18 = sitofp i32 %17 to double
store double %18, double* %7
%19 = load double, double* %7
%20 = fcmp ogt double %19, 0.000000e+00
br i1 %20, label %21, label %40
21: ; preds = %3
%22 = load double, double* %7
%23 = load float*, float** %4
%24 = load float, float* %23
%25 = fpext float %24 to double
%26 = fdiv double %25, %22
%27 = fptrunc double %26 to float
store float %27, float* %23
%28 = load double, double* %7
%29 = load float*, float** %5
%30 = load float, float* %29
%31 = fpext float %30 to double
%32 = fdiv double %31, %28
%33 = fptrunc double %32 to float
store float %33, float* %29
%34 = load double, double* %7
%35 = load float*, float** %6
%36 = load float, float* %35
%37 = fpext float %36 to double
%38 = fdiv double %37, %34
%39 = fptrunc double %38 to float
store float %39, float* %35
br label %40
40: ; preds = %21, %3
ret void
}

LLVM IR (-O2):
define void @XoVNormalize(float* nocapture %0, float* nocapture %1, float* nocapture %2) {
%4 = load float, float* %0
%5 = fpext float %4 to double
%6 = load float, float* %1
%7 = fpext float %6 to double
%8 = load float, float* %2
%9 = fpext float %8 to double
%10 = tail call i32 (double, double, double, ...) bitcast (i32 (...)* @XoVLength to i32 (double, double, double, ...)*)(double %5, double %7, double %9)
%11 = sitofp i32 %10 to double
%12 = icmp sgt i32 %10, 0
br i1 %12, label %13, label %26
13: ; preds = %3
%14 = load float, float* %0
%15 = fpext float %14 to double
%16 = fdiv double %15, %11
%17 = fptrunc double %16 to float
store float %17, float* %0
%18 = load float, float* %1
%19 = fpext float %18 to double
%20 = fdiv double %19, %11
%21 = fptrunc double %20 to float
store float %21, float* %1
%22 = load float, float* %2
%23 = fpext float %22 to double
%24 = fdiv double %23, %11
%25 = fptrunc double %24 to float
store float %25, float* %2
br label %26
26: ; preds = %13, %3
ret void
}