#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__ Float2Int(float);
float INFINITY;
float NAN;
int /*<<< orphan*/ TestMax(float, float, float);
int /*<<< orphan*/ TestMin(float, float, float);
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ printf(char *);
int main() {
  TestMin(-INFINITY, INFINITY, -INFINITY);
  TestMax(-INFINITY, INFINITY, INFINITY);
  TestMin(-INFINITY, 1.f, -INFINITY);
  TestMax(-INFINITY, 1.f, 1.f);
  TestMin(INFINITY, 1.f, 1.f);
  TestMax(INFINITY, 1.f, INFINITY);
  TestMin(-INFINITY, NAN, -INFINITY);
  TestMax(-INFINITY, NAN, -INFINITY);
  assert(Float2Int(0.0f) != Float2Int(-0.0f));
  if (NAN == NAN)
    printf("NAN == NAN\n");
  if (NAN != NAN)
    printf("NAN != NAN\n");
  TestMin(-0.0f, 0.0f, -0.0f);
  TestMax(-0.0f, 0.0f, 0.0f);
  printf("Success!\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2e7a(%rip),%rax
movss  (%rax),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
mov    0x2e62(%rip),%rax
movss  (%rax),%xmm1
mov    0x2e57(%rip),%rax
movss  (%rax),%xmm2
movd   %xmm2,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm2
call   1030 <TestMin@plt>
mov    0x2e3a(%rip),%rax
movss  (%rax),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
mov    0x2e22(%rip),%rax
movss  (%rax),%xmm1
mov    0x2e17(%rip),%rax
movss  (%rax),%xmm2
call   1050 <TestMax@plt>
mov    0x2e07(%rip),%rax
movss  (%rax),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
mov    0x2def(%rip),%rax
movss  (%rax),%xmm1
movd   %xmm1,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm2
movss  0xdfa(%rip),%xmm1
call   1030 <TestMin@plt>
mov    0x2dca(%rip),%rax
movss  (%rax),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
movss  0xdd5(%rip),%xmm2
movaps %xmm2,%xmm1
call   1050 <TestMax@plt>
mov    0x2da2(%rip),%rax
movss  (%rax),%xmm0
movss  0xdba(%rip),%xmm2
movaps %xmm2,%xmm1
call   1030 <TestMin@plt>
mov    0x2d87(%rip),%rax
movss  (%rax),%xmm0
mov    0x2d7c(%rip),%rax
movss  (%rax),%xmm2
movss  0xd94(%rip),%xmm1
call   1050 <TestMax@plt>
mov    0x2d64(%rip),%rax
movss  (%rax),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
mov    0x2d64(%rip),%rax
movss  (%rax),%xmm1
mov    0x2d41(%rip),%rax
movss  (%rax),%xmm2
movd   %xmm2,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm2
call   1030 <TestMin@plt>
mov    0x2d24(%rip),%rax
movss  (%rax),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
mov    0x2d24(%rip),%rax
movss  (%rax),%xmm1
mov    0x2d01(%rip),%rax
movss  (%rax),%xmm2
movd   %xmm2,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm2
call   1050 <TestMax@plt>
xorps  %xmm0,%xmm0
call   1070 <Float2Int@plt>
mov    %rax,-0x10(%rbp)
movss  0xcf7(%rip),%xmm0
call   1070 <Float2Int@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
cmp    %rcx,%rax
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1060 <assert@plt>
mov    0x2ccc(%rip),%rax
movss  (%rax),%xmm0
mov    0x2cc1(%rip),%rax
ucomiss (%rax),%xmm0
jne    1352 <main+0x202>
jp     1352 <main+0x202>
lea    0xcbb(%rip),%rdi
call   1040 <printf@plt>
mov    0x2c9f(%rip),%rax
movss  (%rax),%xmm0
mov    0x2c94(%rip),%rax
ucomiss (%rax),%xmm0
jne    1378 <main+0x228>
jp     1378 <main+0x228>
jmp    1384 <main+0x234>
lea    0xc95(%rip),%rdi
call   1040 <printf@plt>
movss  0xc74(%rip),%xmm2
xorps  %xmm1,%xmm1
movaps %xmm2,%xmm0
call   1030 <TestMin@plt>
movss  0xc61(%rip),%xmm0
xorps  %xmm2,%xmm2
movaps %xmm2,%xmm1
call   1050 <TestMax@plt>
lea    0xc6f(%rip),%rdi
call   1040 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    0x2e85(%rip),%rbx
movss  (%rbx),%xmm1
movss  0xe99(%rip),%xmm2
movaps %xmm1,%xmm0
xorps  %xmm2,%xmm0
movaps %xmm0,%xmm2
call   1040 <TestMin@plt>
movss  (%rbx),%xmm1
movaps %xmm1,%xmm0
movss  0xe7c(%rip),%xmm2
xorps  %xmm2,%xmm0
movaps %xmm1,%xmm2
call   1050 <TestMax@plt>
movss  (%rbx),%xmm0
movss  0xe65(%rip),%xmm1
xorps  %xmm1,%xmm0
movss  0xe5e(%rip),%xmm1
movaps %xmm0,%xmm2
call   1040 <TestMin@plt>
movss  (%rbx),%xmm0
movss  0xe46(%rip),%xmm1
xorps  %xmm1,%xmm0
movss  0xe3f(%rip),%xmm1
movaps %xmm1,%xmm2
call   1050 <TestMax@plt>
movss  (%rbx),%xmm0
movss  0xe2b(%rip),%xmm1
movaps %xmm1,%xmm2
call   1040 <TestMin@plt>
movss  (%rbx),%xmm0
movss  0xe17(%rip),%xmm1
movaps %xmm0,%xmm2
call   1050 <TestMax@plt>
movss  (%rbx),%xmm0
movss  0xdff(%rip),%xmm1
xorps  %xmm1,%xmm0
mov    0x2ded(%rip),%r14
movss  (%r14),%xmm1
movaps %xmm0,%xmm2
call   1040 <TestMin@plt>
movss  (%rbx),%xmm0
movss  0xddc(%rip),%xmm1
xorps  %xmm1,%xmm0
movss  (%r14),%xmm1
movaps %xmm0,%xmm2
call   1050 <TestMax@plt>
xorps  %xmm0,%xmm0
call   1070 <Float2Int@plt>
mov    %rax,%rbx
movss  0xdb9(%rip),%xmm0
call   1070 <Float2Int@plt>
xor    %edi,%edi
cmp    %rax,%rbx
setne  %dil
call   1060 <assert@plt>
movss  (%r14),%xmm0
ucomiss %xmm0,%xmm0
jp     1275 <main+0x125>
lea    0xdb1(%rip),%rdi
call   1030 <puts@plt>
movss  (%r14),%xmm0
ucomiss %xmm0,%xmm0
jp     12b6 <main+0x166>
movss  0xd7e(%rip),%xmm0
xorps  %xmm1,%xmm1
movaps %xmm0,%xmm2
call   1040 <TestMin@plt>
xorps  %xmm1,%xmm1
xorps  %xmm2,%xmm2
movss  0xd65(%rip),%xmm0
call   1050 <TestMax@plt>
lea    0xd61(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
lea    0xd54(%rip),%rdi
call   1030 <puts@plt>
jmp    127a <main+0x12a>

LLVM IR (-O0):
@INFINITY = global float 0.000000e+00
@NAN = global float 0.000000e+00
@.str = [12 x i8] c"NAN == NAN\0A\00"
@.str.1 = [12 x i8] c"NAN != NAN\0A\00"
@.str.2 = [10 x i8] c"Success!\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load float, float* @INFINITY
%3 = fneg float %2
%4 = load float, float* @INFINITY
%5 = load float, float* @INFINITY
%6 = fneg float %5
%7 = call i32 @TestMin(float %3, float %4, float %6)
%8 = load float, float* @INFINITY
%9 = fneg float %8
%10 = load float, float* @INFINITY
%11 = load float, float* @INFINITY
%12 = call i32 @TestMax(float %9, float %10, float %11)
%13 = load float, float* @INFINITY
%14 = fneg float %13
%15 = load float, float* @INFINITY
%16 = fneg float %15
%17 = call i32 @TestMin(float %14, float 1.000000e+00, float %16)
%18 = load float, float* @INFINITY
%19 = fneg float %18
%20 = call i32 @TestMax(float %19, float 1.000000e+00, float 1.000000e+00)
%21 = load float, float* @INFINITY
%22 = call i32 @TestMin(float %21, float 1.000000e+00, float 1.000000e+00)
%23 = load float, float* @INFINITY
%24 = load float, float* @INFINITY
%25 = call i32 @TestMax(float %23, float 1.000000e+00, float %24)
%26 = load float, float* @INFINITY
%27 = fneg float %26
%28 = load float, float* @NAN
%29 = load float, float* @INFINITY
%30 = fneg float %29
%31 = call i32 @TestMin(float %27, float %28, float %30)
%32 = load float, float* @INFINITY
%33 = fneg float %32
%34 = load float, float* @NAN
%35 = load float, float* @INFINITY
%36 = fneg float %35
%37 = call i32 @TestMax(float %33, float %34, float %36)
%38 = call i64 @Float2Int(float 0.000000e+00)
%39 = call i64 @Float2Int(float -0.000000e+00)
%40 = icmp ne i64 %38, %39
%41 = zext i1 %40 to i32
%42 = call i32 @assert(i32 %41)
%43 = load float, float* @NAN
%44 = load float, float* @NAN
%45 = fcmp oeq float %43, %44
br i1 %45, label %46, label %48
46: ; preds = %0
%47 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
br label %48
48: ; preds = %46, %0
%49 = load float, float* @NAN
%50 = load float, float* @NAN
%51 = fcmp une float %49, %50
br i1 %51, label %52, label %54
52: ; preds = %48
%53 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
br label %54
54: ; preds = %52, %48
%55 = call i32 @TestMin(float -0.000000e+00, float 0.000000e+00, float -0.000000e+00)
%56 = call i32 @TestMax(float -0.000000e+00, float 0.000000e+00, float 0.000000e+00)
%57 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
%58 = load i32, i32* %1
ret i32 %58
}

LLVM IR (-O2):
@INFINITY = global float 0.000000e+00
@NAN = global float 0.000000e+00
@str = [9 x i8] c"Success!\00"
@str.3 = [11 x i8] c"NAN != NAN\00"
@str.4 = [11 x i8] c"NAN == NAN\00"
define i32 @main() {
%1 = load float, float* @INFINITY
%2 = fneg float %1
%3 = tail call i32 @TestMin(float %2, float %1, float %2)
%4 = load float, float* @INFINITY
%5 = fneg float %4
%6 = tail call i32 @TestMax(float %5, float %4, float %4)
%7 = load float, float* @INFINITY
%8 = fneg float %7
%9 = tail call i32 @TestMin(float %8, float 1.000000e+00, float %8)
%10 = load float, float* @INFINITY
%11 = fneg float %10
%12 = tail call i32 @TestMax(float %11, float 1.000000e+00, float 1.000000e+00)
%13 = load float, float* @INFINITY
%14 = tail call i32 @TestMin(float %13, float 1.000000e+00, float 1.000000e+00)
%15 = load float, float* @INFINITY
%16 = tail call i32 @TestMax(float %15, float 1.000000e+00, float %15)
%17 = load float, float* @INFINITY
%18 = fneg float %17
%19 = load float, float* @NAN
%20 = tail call i32 @TestMin(float %18, float %19, float %18)
%21 = load float, float* @INFINITY
%22 = fneg float %21
%23 = load float, float* @NAN
%24 = tail call i32 @TestMax(float %22, float %23, float %22)
%25 = tail call i64 @Float2Int(float 0.000000e+00)
%26 = tail call i64 @Float2Int(float -0.000000e+00)
%27 = icmp ne i64 %25, %26
%28 = zext i1 %27 to i32
%29 = tail call i32 @assert(i32 %28)
%30 = load float, float* @NAN
%31 = fcmp ord float %30, 0.000000e+00
br i1 %31, label %32, label %35
32: ; preds = %0
%33 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str.4, i64 0, i64 0))
%34 = load float, float* @NAN
br label %35
35: ; preds = %32, %0
%36 = phi float [ %34, %32 ], [ %30, %0 ]
%37 = fcmp uno float %36, 0.000000e+00
br i1 %37, label %38, label %40
38: ; preds = %35
%39 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str.3, i64 0, i64 0))
br label %40
40: ; preds = %38, %35
%41 = tail call i32 @TestMin(float -0.000000e+00, float 0.000000e+00, float -0.000000e+00)
%42 = tail call i32 @TestMax(float -0.000000e+00, float 0.000000e+00, float 0.000000e+00)
%43 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
ret i32 0
}