#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 */
typedef int /*<<< orphan*/ b;
typedef int /*<<< orphan*/ a;

/* Variables and functions */
scalar_t__ memcmp(unsigned int *, unsigned int *, int);
int /*<<< orphan*/ memcpy(unsigned int *, float *, int);
int testf(float x, float y) {
  unsigned int a, b;
  memcpy(&a, &x, sizeof(a));
  memcpy(&b, &y, sizeof(b));
  if ((a & 0x7fc00000U) == 0x7fc00000U)
    return (b & 0x7fc00000U) != 0x7fc00000U;
  return memcmp(&a, &b, sizeof(a)) != 0;
}


x86 assembly (clang, -O0):
<testf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
lea    -0x10(%rbp),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x4,%edx
call   1040 <memcpy@plt>
lea    -0x14(%rbp),%rdi
lea    -0xc(%rbp),%rsi
mov    $0x4,%edx
call   1040 <memcpy@plt>
mov    -0x10(%rbp),%eax
and    $0x7fc00000,%eax
cmp    $0x7fc00000,%eax
jne    1186 <testf+0x66>
mov    -0x14(%rbp),%eax
and    $0x7fc00000,%eax
cmp    $0x7fc00000,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
jmp    11a7 <testf+0x87>
lea    -0x10(%rbp),%rdi
lea    -0x14(%rbp),%rsi
mov    $0x4,%edx
call   1030 <memcmp@plt>
cmp    $0x0,%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testf>:
sub    $0x18,%rsp
movss  %xmm0,0x14(%rsp)
movss  %xmm1,0x10(%rsp)
lea    0xc(%rsp),%rdi
lea    0x14(%rsp),%rsi
mov    $0x4,%edx
call   1040 <memcpy@plt>
lea    0x8(%rsp),%rdi
lea    0x10(%rsp),%rsi
mov    $0x4,%edx
call   1040 <memcpy@plt>
mov    0xc(%rsp),%eax
not    %eax
test   $0x7fc00000,%eax
jne    1172 <testf+0x52>
mov    0x8(%rsp),%eax
not    %eax
test   $0x7fc00000,%eax
jmp    1189 <testf+0x69>
lea    0xc(%rsp),%rdi
lea    0x8(%rsp),%rsi
mov    $0x4,%edx
call   1030 <memcmp@plt>
test   %rax,%rax
setne  %al
movzbl %al,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @testf(float %0, float %1) {
%3 = alloca i32
%4 = alloca float
%5 = alloca float
%6 = alloca i32
%7 = alloca i32
store float %0, float* %4
store float %1, float* %5
%8 = call i32 @memcpy(i32* %6, float* %4, i32 4)
%9 = call i32 @memcpy(i32* %7, float* %5, i32 4)
%10 = load i32, i32* %6
%11 = and i32 %10, 2143289344
%12 = icmp eq i32 %11, 2143289344
br i1 %12, label %13, label %18
13: ; preds = %2
%14 = load i32, i32* %7
%15 = and i32 %14, 2143289344
%16 = icmp ne i32 %15, 2143289344
%17 = zext i1 %16 to i32
store i32 %17, i32* %3
br label %22
18: ; preds = %2
%19 = call i64 @memcmp(i32* %6, i32* %7, i32 4)
%20 = icmp ne i64 %19, 0
%21 = zext i1 %20 to i32
store i32 %21, i32* %3
br label %22
22: ; preds = %18, %13
%23 = load i32, i32* %3
ret i32 %23
}

LLVM IR (-O2):
define i32 @testf(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca i32
%6 = alloca i32
store float %0, float* %3
store float %1, float* %4
%7 = bitcast i32* %5 to i8*
%8 = bitcast i32* %6 to i8*
%9 = call i32 @memcpy(i32* %5, float* %3, i32 4)
%10 = call i32 @memcpy(i32* %6, float* %4, i32 4)
%11 = load i32, i32* %5
%12 = and i32 %11, 2143289344
%13 = icmp eq i32 %12, 2143289344
br i1 %13, label %14, label %18
14: ; preds = %2
%15 = load i32, i32* %6
%16 = and i32 %15, 2143289344
%17 = icmp ne i32 %16, 2143289344
br label %21
18: ; preds = %2
%19 = call i64 @memcmp(i32* %5, i32* %6, i32 4)
%20 = icmp ne i64 %19, 0
br label %21
21: ; preds = %18, %14
%22 = phi i1 [ %17, %14 ], [ %20, %18 ]
%23 = zext i1 %22 to i32
ret i32 %23
}