#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 */
double sqrt(double const);
double _FSQRT_(const double x, const double missval1) {
  return (((((x)) != ((x))) || ((missval1) != (missval1))
               ? ((((x)) != ((x))) && ((missval1) != (missval1)) ? 1 : 0)
               : !((x) < missval1 || missval1 < (x))) ||
                  (x) < 0
              ? missval1
              : sqrt(x));
}


x86 assembly (clang, -O0):
<_FSQRT_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
ucomisd -0x8(%rbp),%xmm0
jne    1153 <_FSQRT_+0x43>
jp     1153 <_FSQRT_+0x43>
movsd  -0x10(%rbp),%xmm0
ucomisd -0x10(%rbp),%xmm0
jne    1153 <_FSQRT_+0x43>
jp     1153 <_FSQRT_+0x43>
jmp    11a7 <_FSQRT_+0x97>
movsd  -0x8(%rbp),%xmm0
ucomisd -0x8(%rbp),%xmm0
jne    116e <_FSQRT_+0x5e>
jp     116e <_FSQRT_+0x5e>
jmp    1198 <_FSQRT_+0x88>
movsd  -0x10(%rbp),%xmm0
ucomisd -0x10(%rbp),%xmm0
jne    1189 <_FSQRT_+0x79>
jp     1189 <_FSQRT_+0x79>
jmp    1198 <_FSQRT_+0x88>
mov    $0x1,%al
test   $0x1,%al
jne    11dd <_FSQRT_+0xcd>
jmp    11cf <_FSQRT_+0xbf>
xor    %eax,%eax
test   $0x1,%al
jne    11dd <_FSQRT_+0xcd>
jmp    11cf <_FSQRT_+0xbf>
movsd  -0x8(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
ucomisd %xmm1,%xmm0
ja     11cf <_FSQRT_+0xbf>
movsd  -0x10(%rbp),%xmm1
movsd  -0x8(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    11dd <_FSQRT_+0xcd>
xorps  %xmm0,%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    11ec <_FSQRT_+0xdc>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    11fb <_FSQRT_+0xeb>
movsd  -0x8(%rbp),%xmm0
call   1030 <sqrt@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_FSQRT_>:
ucomisd %xmm1,%xmm0
jp     1141 <_FSQRT_+0x31>
xorpd  %xmm2,%xmm2
ucomisd %xmm0,%xmm2
ja     1137 <_FSQRT_+0x27>
ucomisd %xmm1,%xmm0
je     1137 <_FSQRT_+0x27>
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     113c <_FSQRT_+0x2c>
xorps  %xmm1,%xmm1
sqrtsd %xmm0,%xmm1
movapd %xmm1,%xmm0
ret
jmp    1030 <sqrt@plt>
ucomisd %xmm1,%xmm1
setp   %al
ucomisd %xmm0,%xmm0
setp   %cl
xorpd  %xmm2,%xmm2
ucomisd %xmm0,%xmm2
ja     1137 <_FSQRT_+0x27>
and    %al,%cl
je     1126 <_FSQRT_+0x16>
jmp    1137 <_FSQRT_+0x27>

LLVM IR (-O0):
define double @_FSQRT_(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %3
%7 = fcmp une double %5, %6
br i1 %7, label %12, label %8
8: ; preds = %2
%9 = load double, double* %4
%10 = load double, double* %4
%11 = fcmp une double %9, %10
br i1 %11, label %12, label %22
12: ; preds = %8, %2
%13 = load double, double* %3
%14 = load double, double* %3
%15 = fcmp une double %13, %14
br i1 %15, label %16, label %21
16: ; preds = %12
%17 = load double, double* %4
%18 = load double, double* %4
%19 = fcmp une double %17, %18
br i1 %19, label %20, label %21
20: ; preds = %16
br i1 true, label %33, label %30
21: ; preds = %16, %12
br i1 false, label %33, label %30
22: ; preds = %8
%23 = load double, double* %3
%24 = load double, double* %4
%25 = fcmp olt double %23, %24
br i1 %25, label %30, label %26
26: ; preds = %22
%27 = load double, double* %4
%28 = load double, double* %3
%29 = fcmp olt double %27, %28
br i1 %29, label %30, label %33
30: ; preds = %26, %22, %21, %20
%31 = load double, double* %3
%32 = fcmp olt double %31, 0.000000e+00
br i1 %32, label %33, label %35
33: ; preds = %30, %26, %21, %20
%34 = load double, double* %4
br label %38
35: ; preds = %30
%36 = load double, double* %3
%37 = call double @sqrt(double %36)
br label %38
38: ; preds = %35, %33
%39 = phi double [ %34, %33 ], [ %37, %35 ]
ret double %39
}

LLVM IR (-O2):
define double @_FSQRT_(double %0, double %1) {
%3 = fcmp uno double %0, %1
br i1 %3, label %4, label %10
4: ; preds = %2
%5 = fcmp uno double %1, 0.000000e+00
%6 = fcmp uno double %0, 0.000000e+00
%7 = and i1 %6, %5
%8 = fcmp olt double %0, 0.000000e+00
%9 = or i1 %8, %7
br i1 %9, label %16, label %14
10: ; preds = %2
%11 = fcmp ueq double %0, %1
%12 = fcmp olt double %0, 0.000000e+00
%13 = or i1 %12, %11
br i1 %13, label %16, label %14
14: ; preds = %10, %4
%15 = tail call double @sqrt(double %0)
br label %16
16: ; preds = %4, %10, %14
%17 = phi double [ %15, %14 ], [ %1, %10 ], [ %1, %4 ]
ret double %17
}