#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__ stdlib_base_is_nan(double const);
double stdlib_base_pdiff(const double x, const double y) {
  if (stdlib_base_is_nan(x) || stdlib_base_is_nan(y)) {
    return 0.0 / 0.0;
  }
  if (x > y) {
    return x - y;
  }
  return 0.0;
}


x86 assembly (clang, -O0):
<stdlib_base_pdiff>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1030 <stdlib_base_is_nan@plt>
cmp    $0x0,%rax
jne    114a <stdlib_base_pdiff+0x3a>
movsd  -0x18(%rbp),%xmm0
call   1030 <stdlib_base_is_nan@plt>
cmp    $0x0,%rax
je     115c <stdlib_base_pdiff+0x4c>
movsd  0xeae(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1188 <stdlib_base_pdiff+0x78>
movsd  -0x10(%rbp),%xmm0
ucomisd -0x18(%rbp),%xmm0
jbe    1180 <stdlib_base_pdiff+0x70>
movsd  -0x10(%rbp),%xmm0
subsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1188 <stdlib_base_pdiff+0x78>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stdlib_base_pdiff>:
sub    $0x18,%rsp
movsd  %xmm1,0x8(%rsp)
movsd  %xmm0,0x10(%rsp)
call   1030 <stdlib_base_is_nan@plt>
movsd  0xed3(%rip),%xmm1
test   %rax,%rax
jne    1168 <stdlib_base_pdiff+0x58>
movsd  0x8(%rsp),%xmm0
call   1030 <stdlib_base_is_nan@plt>
movsd  0xebb(%rip),%xmm1
test   %rax,%rax
jne    1168 <stdlib_base_pdiff+0x58>
xorpd  %xmm1,%xmm1
movsd  0x10(%rsp),%xmm0
ucomisd 0x8(%rsp),%xmm0
jbe    1168 <stdlib_base_pdiff+0x58>
movsd  0x10(%rsp),%xmm1
subsd  0x8(%rsp),%xmm1
movapd %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @stdlib_base_pdiff(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %4
store double %1, double* %5
%6 = load double, double* %4
%7 = call i64 @stdlib_base_is_nan(double %6)
%8 = icmp ne i64 %7, 0
br i1 %8, label %13, label %9
9: ; preds = %2
%10 = load double, double* %5
%11 = call i64 @stdlib_base_is_nan(double %10)
%12 = icmp ne i64 %11, 0
br i1 %12, label %13, label %14
13: ; preds = %9, %2
store double 0x7FF8000000000000, double* %3
br label %23
14: ; preds = %9
%15 = load double, double* %4
%16 = load double, double* %5
%17 = fcmp ogt double %15, %16
br i1 %17, label %18, label %22
18: ; preds = %14
%19 = load double, double* %4
%20 = load double, double* %5
%21 = fsub double %19, %20
store double %21, double* %3
br label %23
22: ; preds = %14
store double 0.000000e+00, double* %3
br label %23
23: ; preds = %22, %18, %13
%24 = load double, double* %3
ret double %24
}

LLVM IR (-O2):
define double @stdlib_base_pdiff(double %0, double %1) {
%3 = tail call i64 @stdlib_base_is_nan(double %0)
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %12
5: ; preds = %2
%6 = tail call i64 @stdlib_base_is_nan(double %1)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %12
8: ; preds = %5
%9 = fcmp ogt double %0, %1
br i1 %9, label %10, label %12
10: ; preds = %8
%11 = fsub double %0, %1
br label %12
12: ; preds = %8, %2, %5, %10
%13 = phi double [ %11, %10 ], [ 0x7FF8000000000000, %5 ], [ 0x7FF8000000000000, %2 ], [ 0.000000e+00, %8 ]
ret double %13
}