void glmGenerateInertiaMatrixForSphere3f(float m[9], float r, float mass) {
  mass *= 2.0f / 5.0f;
  m[0] = mass * r * r;
  m[3] = 0;
  m[6] = 0;
  m[1] = 0;
  m[4] = mass * r * r;
  m[7] = 0;
  m[2] = 0;
  m[5] = 0;
  m[8] = mass * r * r;
}


x86 assembly (clang, -O0):
<glmGenerateInertiaMatrixForSphere3f>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
movss  %xmm1,-0x10(%rbp)
movss  0xee6(%rip),%xmm0
mulss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
mulss  -0xc(%rbp),%xmm0
mulss  -0xc(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
movss  %xmm0,0xc(%rax)
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
movss  %xmm0,0x18(%rax)
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
movss  %xmm0,0x4(%rax)
movss  -0x10(%rbp),%xmm0
mulss  -0xc(%rbp),%xmm0
mulss  -0xc(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x10(%rax)
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
movss  %xmm0,0x1c(%rax)
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
movss  %xmm0,0x8(%rax)
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
movss  %xmm0,0x14(%rax)
movss  -0x10(%rbp),%xmm0
mulss  -0xc(%rbp),%xmm0
mulss  -0xc(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x20(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<glmGenerateInertiaMatrixForSphere3f>:
mulss  0xef8(%rip),%xmm1
mulss  %xmm0,%xmm1
mulss  %xmm0,%xmm1
movss  %xmm1,(%rdi)
movl   $0x0,0xc(%rdi)
movq   $0x0,0x4(%rdi)
movss  %xmm1,0x10(%rdi)
movl   $0x0,0x1c(%rdi)
movq   $0x0,0x14(%rdi)
movss  %xmm1,0x20(%rdi)
ret

LLVM IR (-O0):
define void @glmGenerateInertiaMatrixForSphere3f(float* %0, float %1, float %2) {
%4 = alloca float*
%5 = alloca float
%6 = alloca float
store float* %0, float** %4
store float %1, float* %5
store float %2, float* %6
%7 = load float, float* %6
%8 = fmul float %7, 0x3FD99999A0000000
store float %8, float* %6
%9 = load float, float* %6
%10 = load float, float* %5
%11 = fmul float %9, %10
%12 = load float, float* %5
%13 = fmul float %11, %12
%14 = load float*, float** %4
%15 = getelementptr inbounds float, float* %14, i64 0
store float %13, float* %15
%16 = load float*, float** %4
%17 = getelementptr inbounds float, float* %16, i64 3
store float 0.000000e+00, float* %17
%18 = load float*, float** %4
%19 = getelementptr inbounds float, float* %18, i64 6
store float 0.000000e+00, float* %19
%20 = load float*, float** %4
%21 = getelementptr inbounds float, float* %20, i64 1
store float 0.000000e+00, float* %21
%22 = load float, float* %6
%23 = load float, float* %5
%24 = fmul float %22, %23
%25 = load float, float* %5
%26 = fmul float %24, %25
%27 = load float*, float** %4
%28 = getelementptr inbounds float, float* %27, i64 4
store float %26, float* %28
%29 = load float*, float** %4
%30 = getelementptr inbounds float, float* %29, i64 7
store float 0.000000e+00, float* %30
%31 = load float*, float** %4
%32 = getelementptr inbounds float, float* %31, i64 2
store float 0.000000e+00, float* %32
%33 = load float*, float** %4
%34 = getelementptr inbounds float, float* %33, i64 5
store float 0.000000e+00, float* %34
%35 = load float, float* %6
%36 = load float, float* %5
%37 = fmul float %35, %36
%38 = load float, float* %5
%39 = fmul float %37, %38
%40 = load float*, float** %4
%41 = getelementptr inbounds float, float* %40, i64 8
store float %39, float* %41
ret void
}

LLVM IR (-O2):
define void @glmGenerateInertiaMatrixForSphere3f(float* nocapture writeonly %0, float %1, float %2) {
%4 = fmul float %2, 0x3FD99999A0000000
%5 = fmul float %4, %1
%6 = fmul float %5, %1
store float %6, float* %0
%7 = getelementptr inbounds float, float* %0, i64 3
store float 0.000000e+00, float* %7
%8 = getelementptr inbounds float, float* %0, i64 6
store float 0.000000e+00, float* %8
%9 = getelementptr inbounds float, float* %0, i64 1
store float 0.000000e+00, float* %9
%10 = getelementptr inbounds float, float* %0, i64 4
store float %6, float* %10
%11 = getelementptr inbounds float, float* %0, i64 7
store float 0.000000e+00, float* %11
%12 = getelementptr inbounds float, float* %0, i64 2
store float 0.000000e+00, float* %12
%13 = getelementptr inbounds float, float* %0, i64 5
store float 0.000000e+00, float* %13
%14 = getelementptr inbounds float, float* %0, i64 8
store float %6, float* %14
ret void
}