#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 */
scalar_t__ floor(float);
float checkerboard2(float x, float y) {
  x -= floor(x);
  y -= floor(y);
  return (x < .499999) && (y < .499999);
}


x86 assembly (clang, -O0):
<checkerboard2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <floor@plt>
cvtsi2ss %rax,%xmm1
movss  -0x4(%rbp),%xmm0
subss  %xmm1,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x8(%rbp),%xmm0
call   1030 <floor@plt>
cvtsi2ss %rax,%xmm1
movss  -0x8(%rbp),%xmm0
subss  %xmm1,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
xor    %eax,%eax
movsd  0xe91(%rip),%xmm0
ucomisd %xmm1,%xmm0
mov    %al,-0x9(%rbp)
jbe    1197 <checkerboard2+0x87>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xe73(%rip),%xmm0
ucomisd %xmm1,%xmm0
seta   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
cvtsi2ss %eax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<checkerboard2>:
push   %rax
movss  %xmm1,0x4(%rsp)
movss  %xmm0,(%rsp)
call   1030 <floor@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
movss  (%rsp),%xmm1
subss  %xmm0,%xmm1
movss  %xmm1,(%rsp)
movss  0x4(%rsp),%xmm0
call   1030 <floor@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
movss  (%rsp),%xmm1
cvtss2sd %xmm1,%xmm1
movsd  0xea5(%rip),%xmm2
ucomisd %xmm1,%xmm2
seta   %al
movss  0x4(%rsp),%xmm1
subss  %xmm0,%xmm1
xorps  %xmm0,%xmm0
cvtss2sd %xmm1,%xmm0
ucomisd %xmm0,%xmm2
seta   %cl
and    %al,%cl
movzbl %cl,%eax
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @checkerboard2(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = call i64 @floor(float %5)
%7 = sitofp i64 %6 to float
%8 = load float, float* %3
%9 = fsub float %8, %7
store float %9, float* %3
%10 = load float, float* %4
%11 = call i64 @floor(float %10)
%12 = sitofp i64 %11 to float
%13 = load float, float* %4
%14 = fsub float %13, %12
store float %14, float* %4
%15 = load float, float* %3
%16 = fpext float %15 to double
%17 = fcmp olt double %16, 4.999990e-01
br i1 %17, label %18, label %22
18: ; preds = %2
%19 = load float, float* %4
%20 = fpext float %19 to double
%21 = fcmp olt double %20, 4.999990e-01
br label %22
22: ; preds = %18, %2
%23 = phi i1 [ false, %2 ], [ %21, %18 ]
%24 = zext i1 %23 to i32
%25 = sitofp i32 %24 to float
ret float %25
}

LLVM IR (-O2):
define float @checkerboard2(float %0, float %1) {
%3 = tail call i64 @floor(float %0)
%4 = sitofp i64 %3 to float
%5 = fsub float %0, %4
%6 = tail call i64 @floor(float %1)
%7 = sitofp i64 %6 to float
%8 = fsub float %1, %7
%9 = fpext float %5 to double
%10 = fcmp olt double %9, 4.999990e-01
%11 = fpext float %8 to double
%12 = fcmp olt double %11, 4.999990e-01
%13 = select i1 %10, i1 %12, i1 false
%14 = uitofp i1 %13 to float
ret float %14
}