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


x86 assembly (clang, -O0):
<glmMax3fs>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movss  %xmm0,-0x14(%rbp)
movq   $0x0,-0x20(%rbp)
cmpq   $0x3,-0x20(%rbp)
jae    1172 <glmMax3fs+0x72>
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm3
movss  -0x14(%rbp),%xmm2
movaps %xmm2,%xmm4
movaps %xmm3,%xmm0
cmpunordss %xmm0,%xmm0
movaps %xmm0,%xmm1
pand   %xmm4,%xmm1
maxss  %xmm3,%xmm2
pandn  %xmm2,%xmm0
por    %xmm1,%xmm0
mov    -0x8(%rbp),%rax
mov    -0x20(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    1119 <glmMax3fs+0x19>
pop    %rbp
ret

x86 assembly (clang, -O2):
<glmMax3fs>:
movss  (%rsi),%xmm1
movaps %xmm0,%xmm2
maxss  %xmm1,%xmm2
cmpunordss %xmm1,%xmm1
movaps %xmm1,%xmm3
andps  %xmm0,%xmm3
andnps %xmm2,%xmm1
orps   %xmm3,%xmm1
movss  %xmm1,(%rdi)
movss  0x4(%rsi),%xmm1
movaps %xmm0,%xmm2
maxss  %xmm1,%xmm2
cmpunordss %xmm1,%xmm1
movaps %xmm1,%xmm3
andps  %xmm0,%xmm3
andnps %xmm2,%xmm1
orps   %xmm3,%xmm1
movss  %xmm1,0x4(%rdi)
movss  0x8(%rsi),%xmm1
movaps %xmm1,%xmm2
cmpunordss %xmm1,%xmm2
movaps %xmm2,%xmm3
andps  %xmm0,%xmm3
maxss  %xmm1,%xmm0
andnps %xmm0,%xmm2
orps   %xmm3,%xmm2
movss  %xmm2,0x8(%rdi)
ret

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

LLVM IR (-O2):
define void @glmMax3fs(float* nocapture writeonly %0, float* nocapture %1, float %2) {
%4 = load float, float* %1
%5 = tail call float @llvm.maxnum.f32(float %4, float %2)
store float %5, float* %0
%6 = getelementptr inbounds float, float* %1, i64 1
%7 = load float, float* %6
%8 = tail call float @llvm.maxnum.f32(float %7, float %2)
%9 = getelementptr inbounds float, float* %0, i64 1
store float %8, float* %9
%10 = getelementptr inbounds float, float* %1, i64 2
%11 = load float, float* %10
%12 = tail call float @llvm.maxnum.f32(float %11, float %2)
%13 = getelementptr inbounds float, float* %0, i64 2
store float %12, float* %13
ret void
}