#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 */
int /*<<< orphan*/ rect(int, int, float, float);
void fill(int h, int c, float l, float r) {
  if (r > 1.0) {
    rect(h, c, l, 1.0);
    rect(h, c, 0.0, r - 1.0);
  } else
    rect(h, c, l, r);
}


x86 assembly (clang, -O0):
<fill>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
movss  %xmm1,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xec7(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1187 <fill+0x77>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
movss  -0xc(%rbp),%xmm0
movss  0xeb2(%rip),%xmm1
call   1030 <rect@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
movss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe8e(%rip),%xmm1
subsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm1
xorps  %xmm0,%xmm0
call   1030 <rect@plt>
jmp    119c <fill+0x8c>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
movss  -0xc(%rbp),%xmm0
movss  -0x10(%rbp),%xmm1
call   1030 <rect@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fill>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
ucomiss 0xee2(%rip),%xmm1
jbe    1148 <fill+0x38>
movss  %xmm1,0x4(%rsp)
movss  0xed2(%rip),%xmm1
mov    %ebp,%edi
mov    %ebx,%esi
call   1030 <rect@plt>
movss  0x4(%rsp),%xmm1
addss  0xebf(%rip),%xmm1
xorps  %xmm0,%xmm0
mov    %ebp,%edi
mov    %ebx,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <rect@plt>

LLVM IR (-O0):
define void @fill(i32 %0, i32 %1, float %2, float %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca float
%8 = alloca float
store i32 %0, i32* %5
store i32 %1, i32* %6
store float %2, float* %7
store float %3, float* %8
%9 = load float, float* %8
%10 = fpext float %9 to double
%11 = fcmp ogt double %10, 1.000000e+00
br i1 %11, label %12, label %24
12: ; preds = %4
%13 = load i32, i32* %5
%14 = load i32, i32* %6
%15 = load float, float* %7
%16 = call i32 @rect(i32 %13, i32 %14, float %15, float 1.000000e+00)
%17 = load i32, i32* %5
%18 = load i32, i32* %6
%19 = load float, float* %8
%20 = fpext float %19 to double
%21 = fsub double %20, 1.000000e+00
%22 = fptrunc double %21 to float
%23 = call i32 @rect(i32 %17, i32 %18, float 0.000000e+00, float %22)
br label %30
24: ; preds = %4
%25 = load i32, i32* %5
%26 = load i32, i32* %6
%27 = load float, float* %7
%28 = load float, float* %8
%29 = call i32 @rect(i32 %25, i32 %26, float %27, float %28)
br label %30
30: ; preds = %24, %12
ret void
}

LLVM IR (-O2):
define void @fill(i32 %0, i32 %1, float %2, float %3) {
%5 = fcmp ogt float %3, 1.000000e+00
br i1 %5, label %6, label %10
6: ; preds = %4
%7 = tail call i32 @rect(i32 %0, i32 %1, float %2, float 1.000000e+00)
%8 = fadd float %3, -1.000000e+00
%9 = tail call i32 @rect(i32 %0, i32 %1, float 0.000000e+00, float %8)
br label %12
10: ; preds = %4
%11 = tail call i32 @rect(i32 %0, i32 %1, float %2, float %3)
br label %12
12: ; preds = %10, %6
ret void
}