#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
float sqrtf(float const);
void glmInverseSqrt3f(float out[3], const float x[3]) {
  for (size_t i = 0; i < 3; ++i)
    out[i] = 1.0f / sqrtf(x[i]);
}


x86 assembly (clang, -O0):
<glmInverseSqrt3f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
cmpq   $0x3,-0x18(%rbp)
jae    1172 <glmInverseSqrt3f+0x62>
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
call   1030 <sqrtf@plt>
movaps %xmm0,%xmm1
movss  0xeb0(%rip),%xmm0
divss  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1128 <glmInverseSqrt3f+0x18>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<glmInverseSqrt3f>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
movss  (%rsi),%xmm0
xorps  %xmm3,%xmm3
ucomiss %xmm3,%xmm0
jb     112c <glmInverseSqrt3f+0x1c>
sqrtss %xmm0,%xmm0
jmp    1134 <glmInverseSqrt3f+0x24>
call   1030 <sqrtf@plt>
xorps  %xmm3,%xmm3
movss  0xec4(%rip),%xmm2
movaps %xmm2,%xmm1
divss  %xmm0,%xmm1
movss  %xmm1,(%r14)
movss  0x4(%rbx),%xmm0
ucomiss %xmm3,%xmm0
jb     1158 <glmInverseSqrt3f+0x48>
sqrtss %xmm0,%xmm0
jmp    1165 <glmInverseSqrt3f+0x55>
call   1030 <sqrtf@plt>
movss  0xe9b(%rip),%xmm2
movaps %xmm2,%xmm1
divss  %xmm0,%xmm1
movss  %xmm1,0x4(%r14)
movss  0x8(%rbx),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jb     1185 <glmInverseSqrt3f+0x75>
sqrtss %xmm0,%xmm0
jmp    1192 <glmInverseSqrt3f+0x82>
call   1030 <sqrtf@plt>
movss  0xe6e(%rip),%xmm2
divss  %xmm0,%xmm2
movss  %xmm2,0x8(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @glmInverseSqrt3f(float* %0, float* %1) {
%3 = alloca float*
%4 = alloca float*
%5 = alloca i64
store float* %0, float** %3
store float* %1, float** %4
store i64 0, i64* %5
br label %6
6: ; preds = %19, %2
%7 = load i64, i64* %5
%8 = icmp ult i64 %7, 3
br i1 %8, label %9, label %22
9: ; preds = %6
%10 = load float*, float** %4
%11 = load i64, i64* %5
%12 = getelementptr inbounds float, float* %10, i64 %11
%13 = load float, float* %12
%14 = call float @sqrtf(float %13)
%15 = fdiv float 1.000000e+00, %14
%16 = load float*, float** %3
%17 = load i64, i64* %5
%18 = getelementptr inbounds float, float* %16, i64 %17
store float %15, float* %18
br label %19
19: ; preds = %9
%20 = load i64, i64* %5
%21 = add i64 %20, 1
store i64 %21, i64* %5
br label %6
22: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @glmInverseSqrt3f(float* nocapture writeonly %0, float* nocapture %1) {
%3 = load float, float* %1
%4 = tail call float @sqrtf(float %3)
%5 = fdiv float 1.000000e+00, %4
store float %5, float* %0
%6 = getelementptr inbounds float, float* %1, i64 1
%7 = load float, float* %6
%8 = tail call float @sqrtf(float %7)
%9 = fdiv float 1.000000e+00, %8
%10 = getelementptr inbounds float, float* %0, i64 1
store float %9, float* %10
%11 = getelementptr inbounds float, float* %1, i64 2
%12 = load float, float* %11
%13 = tail call float @sqrtf(float %12)
%14 = fdiv float 1.000000e+00, %13
%15 = getelementptr inbounds float, float* %0, i64 2
store float %14, float* %15
ret void
}