#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 const floorf(float const);
void glmFract3f(float out[3], const float x[3]) {
  for (size_t i = 0; i < 3; ++i)
    out[i] = x[i] - floorf(x[i]);
}


x86 assembly (clang, -O0):
<glmFract3f>:
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    1181 <glmFract3f+0x71>
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
movss  %xmm0,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
call   1030 <floorf@plt>
movaps %xmm0,%xmm1
movss  -0x1c(%rbp),%xmm0
subss  %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 <glmFract3f+0x18>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<glmFract3f>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
movss  (%rsi),%xmm0
movss  %xmm0,0x4(%rsp)
call   1030 <floorf@plt>
movss  0x4(%rsp),%xmm1
subss  %xmm0,%xmm1
movss  %xmm1,(%r14)
movss  0x4(%rbx),%xmm0
movss  %xmm0,0x4(%rsp)
call   1030 <floorf@plt>
movss  0x4(%rsp),%xmm1
subss  %xmm0,%xmm1
movss  %xmm1,0x4(%r14)
movss  0x8(%rbx),%xmm0
movss  %xmm0,0x4(%rsp)
call   1030 <floorf@plt>
movss  0x4(%rsp),%xmm1
subss  %xmm0,%xmm1
movss  %xmm1,0x8(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @glmFract3f(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 = %23, %2
%7 = load i64, i64* %5
%8 = icmp ult i64 %7, 3
br i1 %8, label %9, label %26
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 = load float*, float** %4
%15 = load i64, i64* %5
%16 = getelementptr inbounds float, float* %14, i64 %15
%17 = load float, float* %16
%18 = call float @floorf(float %17)
%19 = fsub float %13, %18
%20 = load float*, float** %3
%21 = load i64, i64* %5
%22 = getelementptr inbounds float, float* %20, i64 %21
store float %19, float* %22
br label %23
23: ; preds = %9
%24 = load i64, i64* %5
%25 = add i64 %24, 1
store i64 %25, i64* %5
br label %6
26: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @glmFract3f(float* nocapture writeonly %0, float* nocapture %1) {
%3 = load float, float* %1
%4 = tail call float @floorf(float %3)
%5 = fsub float %3, %4
store float %5, float* %0
%6 = getelementptr inbounds float, float* %1, i64 1
%7 = load float, float* %6
%8 = tail call float @floorf(float %7)
%9 = fsub float %7, %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 @floorf(float %12)
%14 = fsub float %12, %13
%15 = getelementptr inbounds float, float* %0, i64 2
store float %14, float* %15
ret void
}