#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 */
void floatsetbelowtomin(float *in, size_t size, float min) {
  float *fpt, *lfpt;
  fpt = in;
  lfpt = in + size;
  while (fpt < lfpt) {
    if (*fpt < min)
      *(fpt++) = min;
    else
      fpt++;
  }
}


x86 assembly (clang, -O0):
<floatsetbelowtomin>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movss  %xmm0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
shl    $0x2,%rcx
add    %rcx,%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x28(%rbp),%rax
jae    117e <floatsetbelowtomin+0x7e>
mov    -0x20(%rbp),%rax
movss  (%rax),%xmm1
movss  -0x14(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    116d <floatsetbelowtomin+0x6d>
movss  -0x14(%rbp),%xmm0
mov    -0x20(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x20(%rbp)
movss  %xmm0,(%rax)
jmp    1179 <floatsetbelowtomin+0x79>
mov    -0x20(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x20(%rbp)
jmp    112c <floatsetbelowtomin+0x2c>
pop    %rbp
ret

x86 assembly (clang, -O2):
<floatsetbelowtomin>:
test   %rsi,%rsi
jle    1124 <floatsetbelowtomin+0x24>
lea    (%rdi,%rsi,4),%rax
jmp    1119 <floatsetbelowtomin+0x19>
nopl   0x0(%rax,%rax,1)
add    $0x4,%rdi
cmp    %rax,%rdi
jae    1124 <floatsetbelowtomin+0x24>
ucomiss (%rdi),%xmm0
jbe    1110 <floatsetbelowtomin+0x10>
movss  %xmm0,(%rdi)
jmp    1110 <floatsetbelowtomin+0x10>
ret

LLVM IR (-O0):
define void @floatsetbelowtomin(float* %0, i64 %1, float %2) {
%4 = alloca float*
%5 = alloca i64
%6 = alloca float
%7 = alloca float*
%8 = alloca float*
store float* %0, float** %4
store i64 %1, i64* %5
store float %2, float* %6
%9 = load float*, float** %4
store float* %9, float** %7
%10 = load float*, float** %4
%11 = load i64, i64* %5
%12 = getelementptr inbounds float, float* %10, i64 %11
store float* %12, float** %8
br label %13
13: ; preds = %29, %3
%14 = load float*, float** %7
%15 = load float*, float** %8
%16 = icmp ult float* %14, %15
br i1 %16, label %17, label %30
17: ; preds = %13
%18 = load float*, float** %7
%19 = load float, float* %18
%20 = load float, float* %6
%21 = fcmp olt float %19, %20
br i1 %21, label %22, label %26
22: ; preds = %17
%23 = load float, float* %6
%24 = load float*, float** %7
%25 = getelementptr inbounds float, float* %24, i32 1
store float* %25, float** %7
store float %23, float* %24
br label %29
26: ; preds = %17
%27 = load float*, float** %7
%28 = getelementptr inbounds float, float* %27, i32 1
store float* %28, float** %7
br label %29
29: ; preds = %26, %22
br label %13
30: ; preds = %13
ret void
}

LLVM IR (-O2):
define void @floatsetbelowtomin(float* %0, i64 %1, float %2) {
%4 = getelementptr inbounds float, float* %0, i64 %1
%5 = icmp sgt i64 %1, 0
br i1 %5, label %6, label %14
6: ; preds = %3, %11
%7 = phi float* [ %12, %11 ], [ %0, %3 ]
%8 = load float, float* %7
%9 = fcmp olt float %8, %2
br i1 %9, label %10, label %11
10: ; preds = %6
store float %2, float* %7
br label %11
11: ; preds = %6, %10
%12 = getelementptr inbounds float, float* %7, i64 1
%13 = icmp ult float* %12, %4
br i1 %13, label %6, label %14
14: ; preds = %11, %3
ret void
}