#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*/ y;
typedef int /*<<< orphan*/ x;

/* Variables and functions */
scalar_t__ __isnan(float);
scalar_t__ __isnanf(float);
scalar_t__ __isnanl(float);
scalar_t__ __signbit(float);
scalar_t__ __signbitf(float);
scalar_t__ __signbitl(float);
float fmaxf(float x, float y) {
  if (((sizeof(x) == sizeof(float))    ? __isnanf(x)
       : (sizeof(x) == sizeof(double)) ? __isnan(x)
                                       : __isnanl(x)))
    return (y);
  if (((sizeof(y) == sizeof(float))    ? __isnanf(y)
       : (sizeof(y) == sizeof(double)) ? __isnan(y)
                                       : __isnanl(y)))
    return (x);
  if (((sizeof(x) == sizeof(float))    ? __signbitf(x)
       : (sizeof(x) == sizeof(double)) ? __signbit(x)
                                       : __signbitl(x)) !=
      ((sizeof(y) == sizeof(float))    ? __signbitf(y)
       : (sizeof(y) == sizeof(double)) ? __signbit(y)
                                       : __signbitl(y)))
    if (((sizeof(x) == sizeof(float))    ? __signbitf(x)
         : (sizeof(x) == sizeof(double)) ? __signbit(x)
                                         : __signbitl(x)))
      return (y);
    else
      return (x);
  return (x > y ? x : y);
}


x86 assembly (clang, -O0):
<fmaxf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
mov    $0x1,%al
test   $0x1,%al
jne    1181 <fmaxf+0x21>
jmp    119a <fmaxf+0x3a>
movss  -0x8(%rbp),%xmm0
call   1060 <__isnanf@plt>
cmp    $0x0,%rax
jne    11d6 <fmaxf+0x76>
jmp    11e5 <fmaxf+0x85>
xor    %eax,%eax
test   $0x1,%al
jne    11a9 <fmaxf+0x49>
jmp    11c2 <fmaxf+0x62>
movss  -0x8(%rbp),%xmm0
call   1030 <__isnan@plt>
cmp    $0x0,%rax
jne    11d6 <fmaxf+0x76>
jmp    11e5 <fmaxf+0x85>
movss  -0x8(%rbp),%xmm0
call   1050 <__isnanl@plt>
cmp    $0x0,%rax
je     11e5 <fmaxf+0x85>
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1334 <fmaxf+0x1d4>
mov    $0x1,%al
test   $0x1,%al
jne    11f4 <fmaxf+0x94>
jmp    120d <fmaxf+0xad>
movss  -0xc(%rbp),%xmm0
call   1060 <__isnanf@plt>
cmp    $0x0,%rax
jne    1249 <fmaxf+0xe9>
jmp    1258 <fmaxf+0xf8>
xor    %eax,%eax
test   $0x1,%al
jne    121c <fmaxf+0xbc>
jmp    1235 <fmaxf+0xd5>
movss  -0xc(%rbp),%xmm0
call   1030 <__isnan@plt>
cmp    $0x0,%rax
jne    1249 <fmaxf+0xe9>
jmp    1258 <fmaxf+0xf8>
movss  -0xc(%rbp),%xmm0
call   1050 <__isnanl@plt>
cmp    $0x0,%rax
je     1258 <fmaxf+0xf8>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1334 <fmaxf+0x1d4>
movss  -0x8(%rbp),%xmm0
call   1080 <__signbitf@plt>
mov    %rax,-0x18(%rbp)
movss  -0xc(%rbp),%xmm0
call   1080 <__signbitf@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
cmp    %rcx,%rax
je     1302 <fmaxf+0x1a2>
mov    $0x1,%al
test   $0x1,%al
jne    128f <fmaxf+0x12f>
jmp    12a8 <fmaxf+0x148>
movss  -0x8(%rbp),%xmm0
call   1080 <__signbitf@plt>
cmp    $0x0,%rax
jne    12e4 <fmaxf+0x184>
jmp    12f3 <fmaxf+0x193>
xor    %eax,%eax
test   $0x1,%al
jne    12b7 <fmaxf+0x157>
jmp    12d0 <fmaxf+0x170>
movss  -0x8(%rbp),%xmm0
call   1070 <__signbit@plt>
cmp    $0x0,%rax
jne    12e4 <fmaxf+0x184>
jmp    12f3 <fmaxf+0x193>
movss  -0x8(%rbp),%xmm0
call   1040 <__signbitl@plt>
cmp    $0x0,%rax
je     12f3 <fmaxf+0x193>
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1334 <fmaxf+0x1d4>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1334 <fmaxf+0x1d4>
movss  -0x8(%rbp),%xmm0
ucomiss -0xc(%rbp),%xmm0
jbe    1320 <fmaxf+0x1c0>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x1c(%rbp)
jmp    132a <fmaxf+0x1ca>
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  -0x1c(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fmaxf>:
push   %rbx
sub    $0x10,%rsp
movss  %xmm1,0xc(%rsp)
movss  %xmm0,0x8(%rsp)
call   1030 <__isnanf@plt>
test   %rax,%rax
je     1143 <fmaxf+0x23>
movss  0xc(%rsp),%xmm0
jmp    119d <fmaxf+0x7d>
movss  0xc(%rsp),%xmm0
call   1030 <__isnanf@plt>
test   %rax,%rax
je     115b <fmaxf+0x3b>
movss  0x8(%rsp),%xmm0
jmp    119d <fmaxf+0x7d>
movss  0x8(%rsp),%xmm0
call   1040 <__signbitf@plt>
mov    %rax,%rbx
movss  0xc(%rsp),%xmm0
call   1040 <__signbitf@plt>
cmp    %rax,%rbx
jne    1187 <fmaxf+0x67>
movss  0x8(%rsp),%xmm0
maxss  0xc(%rsp),%xmm0
jmp    119d <fmaxf+0x7d>
movss  0x8(%rsp),%xmm0
call   1040 <__signbitf@plt>
test   %rax,%rax
movss  0x8(%rsp),%xmm0
jne    113b <fmaxf+0x1b>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define float @fmaxf(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
store float %0, float* %4
store float %1, float* %5
br i1 true, label %6, label %10
6: ; preds = %2
%7 = load float, float* %4
%8 = call i64 @__isnanf(float %7)
%9 = icmp ne i64 %8, 0
br i1 %9, label %19, label %21
10: ; preds = %2
br i1 false, label %11, label %15
11: ; preds = %10
%12 = load float, float* %4
%13 = call i64 @__isnan(float %12)
%14 = icmp ne i64 %13, 0
br i1 %14, label %19, label %21
15: ; preds = %10
%16 = load float, float* %4
%17 = call i64 @__isnanl(float %16)
%18 = icmp ne i64 %17, 0
br i1 %18, label %19, label %21
19: ; preds = %15, %11, %6
%20 = load float, float* %5
store float %20, float* %3
br label %71
21: ; preds = %15, %11, %6
br i1 true, label %22, label %26
22: ; preds = %21
%23 = load float, float* %5
%24 = call i64 @__isnanf(float %23)
%25 = icmp ne i64 %24, 0
br i1 %25, label %35, label %37
26: ; preds = %21
br i1 false, label %27, label %31
27: ; preds = %26
%28 = load float, float* %5
%29 = call i64 @__isnan(float %28)
%30 = icmp ne i64 %29, 0
br i1 %30, label %35, label %37
31: ; preds = %26
%32 = load float, float* %5
%33 = call i64 @__isnanl(float %32)
%34 = icmp ne i64 %33, 0
br i1 %34, label %35, label %37
35: ; preds = %31, %27, %22
%36 = load float, float* %4
store float %36, float* %3
br label %71
37: ; preds = %31, %27, %22
%38 = load float, float* %4
%39 = call i64 @__signbitf(float %38)
%40 = load float, float* %5
%41 = call i64 @__signbitf(float %40)
%42 = icmp ne i64 %39, %41
br i1 %42, label %43, label %61
43: ; preds = %37
br i1 true, label %44, label %48
44: ; preds = %43
%45 = load float, float* %4
%46 = call i64 @__signbitf(float %45)
%47 = icmp ne i64 %46, 0
br i1 %47, label %57, label %59
48: ; preds = %43
br i1 false, label %49, label %53
49: ; preds = %48
%50 = load float, float* %4
%51 = call i64 @__signbit(float %50)
%52 = icmp ne i64 %51, 0
br i1 %52, label %57, label %59
53: ; preds = %48
%54 = load float, float* %4
%55 = call i64 @__signbitl(float %54)
%56 = icmp ne i64 %55, 0
br i1 %56, label %57, label %59
57: ; preds = %53, %49, %44
%58 = load float, float* %5
store float %58, float* %3
br label %71
59: ; preds = %53, %49, %44
%60 = load float, float* %4
store float %60, float* %3
br label %71
61: ; preds = %37
%62 = load float, float* %4
%63 = load float, float* %5
%64 = fcmp ogt float %62, %63
br i1 %64, label %65, label %67
65: ; preds = %61
%66 = load float, float* %4
br label %69
67: ; preds = %61
%68 = load float, float* %5
br label %69
69: ; preds = %67, %65
%70 = phi float [ %66, %65 ], [ %68, %67 ]
store float %70, float* %3
br label %71
71: ; preds = %69, %59, %57, %35, %19
%72 = load float, float* %3
ret float %72
}

LLVM IR (-O2):
define float @fmaxf(float %0, float %1) {
%3 = tail call i64 @__isnanf(float %0)
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %19
5: ; preds = %2
%6 = tail call i64 @__isnanf(float %1)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %19
8: ; preds = %5
%9 = tail call i64 @__signbitf(float %0)
%10 = tail call i64 @__signbitf(float %1)
%11 = icmp eq i64 %9, %10
br i1 %11, label %16, label %12
12: ; preds = %8
%13 = tail call i64 @__signbitf(float %0)
%14 = icmp eq i64 %13, 0
%15 = select i1 %14, float %0, float %1
br label %19
16: ; preds = %8
%17 = fcmp ogt float %0, %1
%18 = select i1 %17, float %0, float %1
br label %19
19: ; preds = %12, %5, %2, %16
%20 = phi float [ %18, %16 ], [ %1, %2 ], [ %0, %5 ], [ %15, %12 ]
ret float %20
}