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


x86 assembly (clang, -O0):
<floatsetbelowtozero>:
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    117c <floatsetbelowtozero+0x7c>
mov    -0x20(%rbp),%rax
movss  (%rax),%xmm1
movss  -0x14(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    116b <floatsetbelowtozero+0x6b>
mov    -0x20(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x20(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,(%rax)
jmp    1177 <floatsetbelowtozero+0x77>
mov    -0x20(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x20(%rbp)
jmp    112c <floatsetbelowtozero+0x2c>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @floatsetbelowtozero(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 = %28, %3
%14 = load float*, float** %7
%15 = load float*, float** %8
%16 = icmp ult float* %14, %15
br i1 %16, label %17, label %29
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 %25
22: ; preds = %17
%23 = load float*, float** %7
%24 = getelementptr inbounds float, float* %23, i32 1
store float* %24, float** %7
store float 0.000000e+00, float* %23
br label %28
25: ; preds = %17
%26 = load float*, float** %7
%27 = getelementptr inbounds float, float* %26, i32 1
store float* %27, float** %7
br label %28
28: ; preds = %25, %22
br label %13
29: ; preds = %13
ret void
}

LLVM IR (-O2):
define void @floatsetbelowtozero(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 0.000000e+00, 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
}