#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 */
float FLT_MAX;
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, int, int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ stderr;
int main(int argc, char *argv[]) {
  char *me;
  float pinf, qnan;
  int i;
  me = argv[0];
  if (sizeof(float) != sizeof(int)) {
    fprintf(stderr, "%s: MADNESS:  sizeof(float)=%d != sizeof(int)=%d\n", me,
            (int)sizeof(float), (int)sizeof(int));
    return -1;
  }
  pinf = FLT_MAX;
  pinf = pinf * pinf;
  qnan = pinf / pinf;
  i = *(int *)(&qnan);
  printf("-DTEEM_QNANHIBIT=%d\n", (i >> 22) & 1);
  return (int)((i >> 22) & 1);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    0x2eb0(%rip),%rax
movss  (%rax),%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  -0x1c(%rbp),%xmm0
mulss  -0x1c(%rbp),%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  -0x1c(%rbp),%xmm0
divss  -0x1c(%rbp),%xmm0
movss  %xmm0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%esi
sar    $0x16,%esi
and    $0x1,%esi
lea    0xe8b(%rip),%rdi
call   1030 <printf@plt>
mov    -0x24(%rbp),%eax
sar    $0x16,%eax
and    $0x1,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    0x2ed0(%rip),%rax
movss  (%rax),%xmm0
mulss  %xmm0,%xmm0
divss  %xmm0,%xmm0
movd   %xmm0,%ebx
shr    $0x16,%ebx
and    $0x1,%ebx
lea    0xecb(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@FLT_MAX = global float 0.000000e+00
@.str = [21 x i8] c"-DTEEM_QNANHIBIT=%d\0A\00"
@stderr = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca float
%8 = alloca float
%9 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%10 = load i8**, i8*** %5
%11 = getelementptr inbounds i8*, i8** %10, i64 0
%12 = load i8*, i8** %11
store i8* %12, i8** %6
%13 = load float, float* @FLT_MAX
store float %13, float* %7
%14 = load float, float* %7
%15 = load float, float* %7
%16 = fmul float %14, %15
store float %16, float* %7
%17 = load float, float* %7
%18 = load float, float* %7
%19 = fdiv float %17, %18
store float %19, float* %8
%20 = bitcast float* %8 to i32*
%21 = load i32, i32* %20
store i32 %21, i32* %9
%22 = load i32, i32* %9
%23 = ashr i32 %22, 22
%24 = and i32 %23, 1
%25 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %24)
%26 = load i32, i32* %9
%27 = ashr i32 %26, 22
%28 = and i32 %27, 1
ret i32 %28
}

LLVM IR (-O2):
@FLT_MAX = global float 0.000000e+00
@.str = [21 x i8] c"-DTEEM_QNANHIBIT=%d\0A\00"
@stderr = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = load float, float* @FLT_MAX
%4 = fmul float %3, %3
%5 = fdiv float %4, %4
%6 = bitcast float %5 to i32
%7 = lshr i32 %6, 22
%8 = and i32 %7, 1
%9 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %8)
ret i32 %8
}