void jitter_sphere3f(struct anon$18 *rngh, float *dir) {
  float dx;
  float dy;
  float dz;
  float len;
  float invlen;
  do {
    float return_value_rng_frand$1;
    return_value_rng_frand$1 = rng_frand(rngh);
    dx = return_value_rng_frand$1 - 5.000000e-1f;
    float return_value_rng_frand$2;
    return_value_rng_frand$2 = rng_frand(rngh);
    dy = return_value_rng_frand$2 - 5.000000e-1f;
    float return_value_rng_frand$3;
    return_value_rng_frand$3 = rng_frand(rngh);
    dz = return_value_rng_frand$3 - 5.000000e-1f;
    len = dx * dx + dy * dy + dz * dz;
  } while (len > 2.500000e-1f);
  double return_value_sqrt$4;
  return_value_sqrt$4 = sqrt((double)len);
  invlen = (float)((double)1.000000f / return_value_sqrt$4);
  dir[(signed long int)0] = dx * invlen;
  dir[(signed long int)1] = dy * invlen;
  dir[(signed long int)2] = dz * invlen;
}


x86 assembly (clang, -O0):
<jitter_sphere3f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1030 <rng_frand@plt>
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0x28(%rbp)
movss  -0x28(%rbp),%xmm0
movss  0xeaf(%rip),%xmm1
subss  %xmm1,%xmm0
movss  %xmm0,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1030 <rng_frand@plt>
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0x2c(%rbp)
movss  -0x2c(%rbp),%xmm0
movss  0xe85(%rip),%xmm1
subss  %xmm1,%xmm0
movss  %xmm0,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1030 <rng_frand@plt>
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0x30(%rbp)
movss  -0x30(%rbp),%xmm0
movss  0xe5b(%rip),%xmm1
subss  %xmm1,%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  -0x14(%rbp),%xmm1
movss  -0x14(%rbp),%xmm2
movss  -0x18(%rbp),%xmm0
mulss  -0x18(%rbp),%xmm0
mulss  %xmm2,%xmm1
addss  %xmm0,%xmm1
movss  -0x1c(%rbp),%xmm0
movss  -0x1c(%rbp),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x20(%rbp)
movss  -0x20(%rbp),%xmm0
movss  0xe16(%rip),%xmm1
ucomiss %xmm1,%xmm0
ja     1130 <jitter_sphere3f+0x10>
movss  -0x20(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
call   1040 <sqrt@plt>
movsd  %xmm0,-0x38(%rbp)
movsd  0xdf6(%rip),%xmm0
divsd  -0x38(%rbp),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x24(%rbp)
movss  -0x14(%rbp),%xmm0
mulss  -0x24(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movss  %xmm0,(%rax)
movss  -0x18(%rbp),%xmm0
mulss  -0x24(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movss  %xmm0,0x4(%rax)
movss  -0x1c(%rbp),%xmm0
mulss  -0x24(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movss  %xmm0,0x8(%rax)
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<jitter_sphere3f>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
nopl   (%rax)
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <rng_frand@plt>
xorps  %xmm1,%xmm1
cvtsi2ss %eax,%xmm1
movss  0xeb7(%rip),%xmm0
addss  %xmm0,%xmm1
movss  %xmm1,0x10(%rsp)
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <rng_frand@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
addss  0xe94(%rip),%xmm0
movss  %xmm0,0xc(%rsp)
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <rng_frand@plt>
movss  0xc(%rsp),%xmm3
movss  0x10(%rsp),%xmm2
xorps  %xmm4,%xmm4
cvtsi2ss %eax,%xmm4
addss  0xe69(%rip),%xmm4
movaps %xmm3,%xmm0
mulss  %xmm3,%xmm0
movaps %xmm2,%xmm1
mulss  %xmm2,%xmm1
addss  %xmm0,%xmm1
movaps %xmm4,%xmm0
mulss  %xmm4,%xmm0
addss  %xmm1,%xmm0
ucomiss 0xe49(%rip),%xmm0
ja     1130 <jitter_sphere3f+0x10>
cvtss2sd %xmm0,%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     11d4 <jitter_sphere3f+0xb4>
sqrtsd %xmm0,%xmm0
jmp    11f1 <jitter_sphere3f+0xd1>
movss  %xmm4,0x14(%rsp)
call   1040 <sqrt@plt>
movss  0x14(%rsp),%xmm4
movss  0xc(%rsp),%xmm3
movss  0x10(%rsp),%xmm2
movsd  0xe0f(%rip),%xmm1
divsd  %xmm0,%xmm1
xorps  %xmm0,%xmm0
cvtsd2ss %xmm1,%xmm0
mulss  %xmm0,%xmm2
movss  %xmm2,(%r14)
mulss  %xmm0,%xmm3
movss  %xmm3,0x4(%r14)
mulss  %xmm0,%xmm4
movss  %xmm4,0x8(%r14)
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%"struct.anon$18" = type opaque
define void @jitter_sphere3f(%"struct.anon$18"* %0, float* %1) {
%3 = alloca %"struct.anon$18"*
%4 = alloca float*
%5 = alloca float
%6 = alloca float
%7 = alloca float
%8 = alloca float
%9 = alloca float
%10 = alloca float
%11 = alloca float
%12 = alloca float
%13 = alloca double
store %"struct.anon$18"* %0, %"struct.anon$18"** %3
store float* %1, float** %4
br label %14
14: ; preds = %39, %2
%15 = load %"struct.anon$18"*, %"struct.anon$18"** %3
%16 = call i32 (%"struct.anon$18"*, ...) bitcast (i32 (...)* @rng_frand to i32 (%"struct.anon$18"*, ...)*)(%"struct.anon$18"* %15)
%17 = sitofp i32 %16 to float
store float %17, float* %10
%18 = load float, float* %10
%19 = fsub float %18, 5.000000e-01
store float %19, float* %5
%20 = load %"struct.anon$18"*, %"struct.anon$18"** %3
%21 = call i32 (%"struct.anon$18"*, ...) bitcast (i32 (...)* @rng_frand to i32 (%"struct.anon$18"*, ...)*)(%"struct.anon$18"* %20)
%22 = sitofp i32 %21 to float
store float %22, float* %11
%23 = load float, float* %11
%24 = fsub float %23, 5.000000e-01
store float %24, float* %6
%25 = load %"struct.anon$18"*, %"struct.anon$18"** %3
%26 = call i32 (%"struct.anon$18"*, ...) bitcast (i32 (...)* @rng_frand to i32 (%"struct.anon$18"*, ...)*)(%"struct.anon$18"* %25)
%27 = sitofp i32 %26 to float
store float %27, float* %12
%28 = load float, float* %12
%29 = fsub float %28, 5.000000e-01
store float %29, float* %7
%30 = load float, float* %5
%31 = load float, float* %5
%32 = load float, float* %6
%33 = load float, float* %6
%34 = fmul float %32, %33
%35 = call float @llvm.fmuladd.f32(float %30, float %31, float %34)
%36 = load float, float* %7
%37 = load float, float* %7
%38 = call float @llvm.fmuladd.f32(float %36, float %37, float %35)
store float %38, float* %8
br label %39
39: ; preds = %14
%40 = load float, float* %8
%41 = fcmp ogt float %40, 2.500000e-01
br i1 %41, label %14, label %42
42: ; preds = %39
%43 = load float, float* %8
%44 = fpext float %43 to double
%45 = call double @sqrt(double %44)
store double %45, double* %13
%46 = load double, double* %13
%47 = fdiv double 1.000000e+00, %46
%48 = fptrunc double %47 to float
store float %48, float* %9
%49 = load float, float* %5
%50 = load float, float* %9
%51 = fmul float %49, %50
%52 = load float*, float** %4
%53 = getelementptr inbounds float, float* %52, i64 0
store float %51, float* %53
%54 = load float, float* %6
%55 = load float, float* %9
%56 = fmul float %54, %55
%57 = load float*, float** %4
%58 = getelementptr inbounds float, float* %57, i64 1
store float %56, float* %58
%59 = load float, float* %7
%60 = load float, float* %9
%61 = fmul float %59, %60
%62 = load float*, float** %4
%63 = getelementptr inbounds float, float* %62, i64 2
store float %61, float* %63
ret void
}

LLVM IR (-O2):
%"struct.anon$18" = type opaque
define void @jitter_sphere3f(%"struct.anon$18"* %0, float* nocapture writeonly %1) {
br label %3
3: ; preds = %3, %2
%4 = tail call i32 (%"struct.anon$18"*, ...) bitcast (i32 (...)* @rng_frand to i32 (%"struct.anon$18"*, ...)*)(%"struct.anon$18"* %0)
%5 = sitofp i32 %4 to float
%6 = fadd float %5, -5.000000e-01
%7 = tail call i32 (%"struct.anon$18"*, ...) bitcast (i32 (...)* @rng_frand to i32 (%"struct.anon$18"*, ...)*)(%"struct.anon$18"* %0)
%8 = sitofp i32 %7 to float
%9 = fadd float %8, -5.000000e-01
%10 = tail call i32 (%"struct.anon$18"*, ...) bitcast (i32 (...)* @rng_frand to i32 (%"struct.anon$18"*, ...)*)(%"struct.anon$18"* %0)
%11 = sitofp i32 %10 to float
%12 = fadd float %11, -5.000000e-01
%13 = fmul float %9, %9
%14 = tail call float @llvm.fmuladd.f32(float %6, float %6, float %13)
%15 = tail call float @llvm.fmuladd.f32(float %12, float %12, float %14)
%16 = fcmp ogt float %15, 2.500000e-01
br i1 %16, label %3, label %17
17: ; preds = %3
%18 = fpext float %15 to double
%19 = tail call double @sqrt(double %18)
%20 = fdiv double 1.000000e+00, %19
%21 = fptrunc double %20 to float
%22 = fmul float %6, %21
store float %22, float* %1
%23 = fmul float %9, %21
%24 = getelementptr inbounds float, float* %1, i64 1
store float %23, float* %24
%25 = fmul float %12, %21
%26 = getelementptr inbounds float, float* %1, i64 2
store float %25, float* %26
ret void
}