#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 INFINITY;
scalar_t__ acosh(double volatile);
scalar_t__ asin(double volatile);
scalar_t__ cos(double volatile);
scalar_t__ isnan(scalar_t__);
scalar_t__ log(double volatile);
scalar_t__ pow(double volatile, double volatile);
int printf(char *, ...);
scalar_t__ remainder(double volatile, double volatile);
scalar_t__ sin(double volatile);
scalar_t__ sqrt(double volatile);
int test_errs(void) {
  int errs = 0;
  volatile double x;
  volatile double y;
  printf("Checking well-defined library errors\n");
  x = -3.0;
  y = 4.4;
  errs += isnan(pow(x, y)) ? 0
                           : (printf("ERROR %s(%f) != NaN at %d\n", "pow(x, y)",
                                     (double)pow(x, y), 143),
                              1);
  errs += isnan(log(x)) ? 0
                        : (printf("ERROR %s(%f) != NaN at %d\n", "log(x)",
                                  (double)log(x), 144),
                           1);
  x = -0.001;
  errs += isnan(sqrt(x)) ? 0
                         : (printf("ERROR %s(%f) != NaN at %d\n", "sqrt(x)",
                                   (double)sqrt(x), 146),
                            1);
  x = 1.0001;
  errs += isnan(asin(x)) ? 0
                         : (printf("ERROR %s(%f) != NaN at %d\n", "asin(x)",
                                   (double)asin(x), 148),
                            1);
  x = INFINITY;
  errs += isnan(sin(x)) ? 0
                        : (printf("ERROR %s(%f) != NaN at %d\n", "sin(x)",
                                  (double)sin(x), 150),
                           1);
  errs += isnan(cos(x)) ? 0
                        : (printf("ERROR %s(%f) != NaN at %d\n", "cos(x)",
                                  (double)cos(x), 151),
                           1);
  x = 0.999;
  errs += isnan(acosh(x)) ? 0
                          : (printf("ERROR %s(%f) != NaN at %d\n", "acosh(x)",
                                    (double)acosh(x), 153),
                             1);
  x = 3.3;
  y = 0.0;
  errs += isnan(remainder(x, y))
              ? 0
              : (printf("ERROR %s(%f) != NaN at %d\n", "remainder(x, y)",
                        (double)remainder(x, y), 155),
                 1);
  y = INFINITY;
  errs += isnan(remainder(y, x))
              ? 0
              : (printf("ERROR %s(%f) != NaN at %d\n", "remainder(y, x)",
                        (double)remainder(y, x), 157),
                 1);
  return errs;
}


x86 assembly (clang, -O0):
<test_errs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe7a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movsd  0xe43(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xe2e(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
call   10b0 <pow@plt>
mov    %rax,%rdi
call   1080 <isnan@plt>
cmp    $0x0,%rax
je     1202 <test_errs+0x62>
xor    %eax,%eax
mov    %eax,-0x1c(%rbp)
jmp    1238 <test_errs+0x98>
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
call   10b0 <pow@plt>
cvtsi2sd %rax,%xmm0
lea    0xe39(%rip),%rdi
lea    0xe4d(%rip),%rsi
mov    $0x8f,%edx
mov    $0x1,%al
call   1030 <printf@plt>
mov    $0x1,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
movsd  -0x10(%rbp),%xmm0
call   10a0 <log@plt>
mov    %rax,%rdi
call   1080 <isnan@plt>
cmp    $0x0,%rax
je     1267 <test_errs+0xc7>
xor    %eax,%eax
mov    %eax,-0x20(%rbp)
jmp    1298 <test_errs+0xf8>
movsd  -0x10(%rbp),%xmm0
call   10a0 <log@plt>
cvtsi2sd %rax,%xmm0
lea    0xdd9(%rip),%rdi
lea    0xdf7(%rip),%rsi
mov    $0x90,%edx
mov    $0x1,%al
call   1030 <printf@plt>
mov    $0x1,%eax
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
movsd  0xd67(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
call   10c0 <sqrt@plt>
mov    %rax,%rdi
call   1080 <isnan@plt>
cmp    $0x0,%rax
je     12d4 <test_errs+0x134>
xor    %eax,%eax
mov    %eax,-0x24(%rbp)
jmp    1305 <test_errs+0x165>
movsd  -0x10(%rbp),%xmm0
call   10c0 <sqrt@plt>
cvtsi2sd %rax,%xmm0
lea    0xd6c(%rip),%rdi
lea    0xd91(%rip),%rsi
mov    $0x92,%edx
mov    $0x1,%al
call   1030 <printf@plt>
mov    $0x1,%eax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
movsd  0xd02(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1060 <asin@plt>
mov    %rax,%rdi
call   1080 <isnan@plt>
cmp    $0x0,%rax
je     1341 <test_errs+0x1a1>
xor    %eax,%eax
mov    %eax,-0x28(%rbp)
jmp    1372 <test_errs+0x1d2>
movsd  -0x10(%rbp),%xmm0
call   1060 <asin@plt>
cvtsi2sd %rax,%xmm0
lea    0xcff(%rip),%rdi
lea    0xd2c(%rip),%rsi
mov    $0x94,%edx
mov    $0x1,%al
call   1030 <printf@plt>
mov    $0x1,%eax
mov    %eax,-0x28(%rbp)
mov    -0x28(%rbp),%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    0x2c66(%rip),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1050 <sin@plt>
mov    %rax,%rdi
call   1080 <isnan@plt>
cmp    $0x0,%rax
je     13b1 <test_errs+0x211>
xor    %eax,%eax
mov    %eax,-0x2c(%rbp)
jmp    13e2 <test_errs+0x242>
movsd  -0x10(%rbp),%xmm0
call   1050 <sin@plt>
cvtsi2sd %rax,%xmm0
lea    0xc8f(%rip),%rdi
lea    0xcbd(%rip),%rsi
mov    $0x96,%edx
mov    $0x1,%al
call   1030 <printf@plt>
mov    $0x1,%eax
mov    %eax,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1090 <cos@plt>
mov    %rax,%rdi
call   1080 <isnan@plt>
cmp    $0x0,%rax
je     1411 <test_errs+0x271>
xor    %eax,%eax
mov    %eax,-0x30(%rbp)
jmp    1442 <test_errs+0x2a2>
movsd  -0x10(%rbp),%xmm0
call   1090 <cos@plt>
cvtsi2sd %rax,%xmm0
lea    0xc2f(%rip),%rdi
lea    0xc64(%rip),%rsi
mov    $0x97,%edx
mov    $0x1,%al
call   1030 <printf@plt>
mov    $0x1,%eax
mov    %eax,-0x30(%rbp)
mov    -0x30(%rbp),%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
movsd  0xbcd(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1040 <acosh@plt>
mov    %rax,%rdi
call   1080 <isnan@plt>
cmp    $0x0,%rax
je     147e <test_errs+0x2de>
xor    %eax,%eax
mov    %eax,-0x34(%rbp)
jmp    14af <test_errs+0x30f>
movsd  -0x10(%rbp),%xmm0
call   1040 <acosh@plt>
cvtsi2sd %rax,%xmm0
lea    0xbc2(%rip),%rdi
lea    0xbfe(%rip),%rsi
mov    $0x99,%edx
mov    $0x1,%al
call   1030 <printf@plt>
mov    $0x1,%eax
mov    %eax,-0x34(%rbp)
mov    -0x34(%rbp),%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
movsd  0xb68(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
call   1070 <remainder@plt>
mov    %rax,%rdi
call   1080 <isnan@plt>
cmp    $0x0,%rax
je     14f8 <test_errs+0x358>
xor    %eax,%eax
mov    %eax,-0x38(%rbp)
jmp    152e <test_errs+0x38e>
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
call   1070 <remainder@plt>
cvtsi2sd %rax,%xmm0
lea    0xb43(%rip),%rdi
lea    0xb88(%rip),%rsi
mov    $0x9b,%edx
mov    $0x1,%al
call   1030 <printf@plt>
mov    $0x1,%eax
mov    %eax,-0x38(%rbp)
mov    -0x38(%rbp),%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    0x2aaa(%rip),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1070 <remainder@plt>
mov    %rax,%rdi
call   1080 <isnan@plt>
cmp    $0x0,%rax
je     1572 <test_errs+0x3d2>
xor    %eax,%eax
mov    %eax,-0x3c(%rbp)
jmp    15a8 <test_errs+0x408>
movsd  -0x18(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1070 <remainder@plt>
cvtsi2sd %rax,%xmm0
lea    0xac9(%rip),%rdi
lea    0xb1e(%rip),%rsi
mov    $0x9d,%edx
mov    $0x1,%al
call   1030 <printf@plt>
mov    $0x1,%eax
mov    %eax,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_errs>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
lea    0xea7(%rip),%rdi
call   1030 <puts@plt>
movabs $0xc008000000000000,%rax
mov    %rax,(%rsp)
movabs $0x401199999999999a,%rax
99 11 40
mov    %rax,0x8(%rsp)
movsd  (%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
call   10c0 <pow@plt>
mov    %rax,%rdi
call   1090 <isnan@plt>
xor    %ebx,%ebx
mov    $0x0,%ecx
test   %rax,%rax
jne    1242 <test_errs+0x92>
movsd  (%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
call   10c0 <pow@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
lea    0xdd6(%rip),%rdi
lea    0xdea(%rip),%rsi
mov    $0x8f,%edx
mov    $0x1,%al
call   1040 <printf@plt>
mov    $0x1,%ecx
mov    %ecx,0x14(%rsp)
movsd  (%rsp),%xmm0
call   10b0 <log@plt>
mov    %rax,%rdi
call   1090 <isnan@plt>
test   %rax,%rax
jne    128e <test_errs+0xde>
movsd  (%rsp),%xmm0
call   10b0 <log@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
lea    0xd8a(%rip),%rdi
lea    0xda8(%rip),%rsi
mov    $0x90,%edx
mov    $0x1,%al
call   1040 <printf@plt>
mov    $0x1,%ebx
movabs $0xbf50624dd2f1a9fc,%rax
62 50 bf
mov    %rax,(%rsp)
movsd  (%rsp),%xmm0
call   10d0 <sqrt@plt>
mov    %rax,%rdi
call   1090 <isnan@plt>
xor    %r12d,%r12d
mov    $0x0,%ecx
test   %rax,%rax
jne    12ec <test_errs+0x13c>
movsd  (%rsp),%xmm0
call   10d0 <sqrt@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
lea    0xd2c(%rip),%rdi
lea    0xd51(%rip),%rsi
mov    $0x92,%edx
mov    $0x1,%al
call   1040 <printf@plt>
mov    $0x1,%ecx
mov    %ecx,0x10(%rsp)
movabs $0x3ff00068db8bac71,%rax
mov    %rax,(%rsp)
movsd  (%rsp),%xmm0
call   1070 <asin@plt>
mov    %rax,%rdi
call   1090 <isnan@plt>
test   %rax,%rax
jne    1347 <test_errs+0x197>
movsd  (%rsp),%xmm0
call   1070 <asin@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
lea    0xcd2(%rip),%rdi
lea    0xcff(%rip),%rsi
mov    $0x94,%edx
mov    $0x1,%al
call   1040 <printf@plt>
mov    $0x1,%r12d
mov    0x2c9a(%rip),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,(%rsp)
movsd  (%rsp),%xmm0
call   1060 <sin@plt>
mov    %rax,%rdi
call   1090 <isnan@plt>
xor    %r13d,%r13d
mov    $0x0,%ebp
test   %rax,%rax
jne    13a7 <test_errs+0x1f7>
movsd  (%rsp),%xmm0
call   1060 <sin@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
lea    0xc71(%rip),%rdi
lea    0xc9f(%rip),%rsi
mov    $0x96,%edx
mov    $0x1,%al
call   1040 <printf@plt>
mov    $0x1,%ebp
movsd  (%rsp),%xmm0
call   10a0 <cos@plt>
mov    %rax,%rdi
call   1090 <isnan@plt>
test   %rax,%rax
jne    13f0 <test_errs+0x240>
movsd  (%rsp),%xmm0
call   10a0 <cos@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
lea    0xc29(%rip),%rdi
lea    0xc5e(%rip),%rsi
mov    $0x97,%edx
mov    $0x1,%al
call   1040 <printf@plt>
mov    $0x1,%r13d
movabs $0x3feff7ced916872b,%rax
f7 ef 3f
mov    %rax,(%rsp)
movsd  (%rsp),%xmm0
call   1050 <acosh@plt>
mov    %rax,%rdi
call   1090 <isnan@plt>
xor    %r14d,%r14d
mov    $0x0,%r15d
test   %rax,%rax
jne    1450 <test_errs+0x2a0>
movsd  (%rsp),%xmm0
call   1050 <acosh@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
lea    0xbc9(%rip),%rdi
lea    0xc05(%rip),%rsi
mov    $0x99,%edx
mov    $0x1,%al
call   1040 <printf@plt>
mov    $0x1,%r15d
movabs $0x400a666666666666,%rax
66 0a 40
mov    %rax,(%rsp)
movq   $0x0,0x8(%rsp)
movsd  (%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
call   1080 <remainder@plt>
mov    %rax,%rdi
call   1090 <isnan@plt>
test   %rax,%rax
jne    14bc <test_errs+0x30c>
movsd  (%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
call   1080 <remainder@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
lea    0xb5d(%rip),%rdi
lea    0xba2(%rip),%rsi
mov    $0x9b,%edx
mov    $0x1,%al
call   1040 <printf@plt>
mov    $0x1,%r14d
mov    0x2b25(%rip),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  0x8(%rsp),%xmm0
movsd  (%rsp),%xmm1
call   1080 <remainder@plt>
mov    %rax,%rdi
call   1090 <isnan@plt>
xor    %ecx,%ecx
test   %rax,%rax
jne    1523 <test_errs+0x373>
movsd  0x8(%rsp),%xmm0
movsd  (%rsp),%xmm1
call   1080 <remainder@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
lea    0xaf5(%rip),%rdi
lea    0xb4a(%rip),%rsi
mov    $0x9d,%edx
mov    $0x1,%al
call   1040 <printf@plt>
mov    $0x1,%ecx
add    0x14(%rsp),%ebx
add    0x10(%rsp),%ebx
add    %r12d,%ebx
add    %ebp,%ebx
add    %r13d,%ebx
add    %r15d,%ebx
add    %r14d,%ebx
add    %ecx,%ebx
mov    %ebx,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [38 x i8] c"Checking well-defined library errors\0A\00"
@.str.1 = [27 x i8] c"ERROR %s(%f) != NaN at %d\0A\00"
@.str.2 = [10 x i8] c"pow(x, y)\00"
@.str.3 = [7 x i8] c"log(x)\00"
@.str.4 = [8 x i8] c"sqrt(x)\00"
@.str.5 = [8 x i8] c"asin(x)\00"
@INFINITY = global double 0.000000e+00
@.str.6 = [7 x i8] c"sin(x)\00"
@.str.7 = [7 x i8] c"cos(x)\00"
@.str.8 = [9 x i8] c"acosh(x)\00"
@.str.9 = [16 x i8] c"remainder(x, y)\00"
@.str.10 = [16 x i8] c"remainder(y, x)\00"
define i32 @test_errs() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
store i32 0, i32* %1
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
store volatile double -3.000000e+00, double* %2
store volatile double 4.400000e+00, double* %3
%5 = load volatile double, double* %2
%6 = load volatile double, double* %3
%7 = call i64 @pow(double %5, double %6)
%8 = call i64 @isnan(i64 %7)
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %0
br label %17
11: ; preds = %0
%12 = load volatile double, double* %2
%13 = load volatile double, double* %3
%14 = call i64 @pow(double %12, double %13)
%15 = sitofp i64 %14 to double
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), double %15, i32 143)
br label %17
17: ; preds = %11, %10
%18 = phi i32 [ 0, %10 ], [ 1, %11 ]
%19 = load i32, i32* %1
%20 = add nsw i32 %19, %18
store i32 %20, i32* %1
%21 = load volatile double, double* %2
%22 = call i64 @log(double %21)
%23 = call i64 @isnan(i64 %22)
%24 = icmp ne i64 %23, 0
br i1 %24, label %25, label %26
25: ; preds = %17
br label %31
26: ; preds = %17
%27 = load volatile double, double* %2
%28 = call i64 @log(double %27)
%29 = sitofp i64 %28 to double
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), double %29, i32 144)
br label %31
31: ; preds = %26, %25
%32 = phi i32 [ 0, %25 ], [ 1, %26 ]
%33 = load i32, i32* %1
%34 = add nsw i32 %33, %32
store i32 %34, i32* %1
store volatile double -1.000000e-03, double* %2
%35 = load volatile double, double* %2
%36 = call i64 @sqrt(double %35)
%37 = call i64 @isnan(i64 %36)
%38 = icmp ne i64 %37, 0
br i1 %38, label %39, label %40
39: ; preds = %31
br label %45
40: ; preds = %31
%41 = load volatile double, double* %2
%42 = call i64 @sqrt(double %41)
%43 = sitofp i64 %42 to double
%44 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0), double %43, i32 146)
br label %45
45: ; preds = %40, %39
%46 = phi i32 [ 0, %39 ], [ 1, %40 ]
%47 = load i32, i32* %1
%48 = add nsw i32 %47, %46
store i32 %48, i32* %1
store volatile double 1.000100e+00, double* %2
%49 = load volatile double, double* %2
%50 = call i64 @asin(double %49)
%51 = call i64 @isnan(i64 %50)
%52 = icmp ne i64 %51, 0
br i1 %52, label %53, label %54
53: ; preds = %45
br label %59
54: ; preds = %45
%55 = load volatile double, double* %2
%56 = call i64 @asin(double %55)
%57 = sitofp i64 %56 to double
%58 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0), double %57, i32 148)
br label %59
59: ; preds = %54, %53
%60 = phi i32 [ 0, %53 ], [ 1, %54 ]
%61 = load i32, i32* %1
%62 = add nsw i32 %61, %60
store i32 %62, i32* %1
%63 = load double, double* @INFINITY
store volatile double %63, double* %2
%64 = load volatile double, double* %2
%65 = call i64 @sin(double %64)
%66 = call i64 @isnan(i64 %65)
%67 = icmp ne i64 %66, 0
br i1 %67, label %68, label %69
68: ; preds = %59
br label %74
69: ; preds = %59
%70 = load volatile double, double* %2
%71 = call i64 @sin(double %70)
%72 = sitofp i64 %71 to double
%73 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0), double %72, i32 150)
br label %74
74: ; preds = %69, %68
%75 = phi i32 [ 0, %68 ], [ 1, %69 ]
%76 = load i32, i32* %1
%77 = add nsw i32 %76, %75
store i32 %77, i32* %1
%78 = load volatile double, double* %2
%79 = call i64 @cos(double %78)
%80 = call i64 @isnan(i64 %79)
%81 = icmp ne i64 %80, 0
br i1 %81, label %82, label %83
82: ; preds = %74
br label %88
83: ; preds = %74
%84 = load volatile double, double* %2
%85 = call i64 @cos(double %84)
%86 = sitofp i64 %85 to double
%87 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.7, i64 0, i64 0), double %86, i32 151)
br label %88
88: ; preds = %83, %82
%89 = phi i32 [ 0, %82 ], [ 1, %83 ]
%90 = load i32, i32* %1
%91 = add nsw i32 %90, %89
store i32 %91, i32* %1
store volatile double 0x3FEFF7CED916872B, double* %2
%92 = load volatile double, double* %2
%93 = call i64 @acosh(double %92)
%94 = call i64 @isnan(i64 %93)
%95 = icmp ne i64 %94, 0
br i1 %95, label %96, label %97
96: ; preds = %88
br label %102
97: ; preds = %88
%98 = load volatile double, double* %2
%99 = call i64 @acosh(double %98)
%100 = sitofp i64 %99 to double
%101 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.8, i64 0, i64 0), double %100, i32 153)
br label %102
102: ; preds = %97, %96
%103 = phi i32 [ 0, %96 ], [ 1, %97 ]
%104 = load i32, i32* %1
%105 = add nsw i32 %104, %103
store i32 %105, i32* %1
store volatile double 3.300000e+00, double* %2
store volatile double 0.000000e+00, double* %3
%106 = load volatile double, double* %2
%107 = load volatile double, double* %3
%108 = call i64 @remainder(double %106, double %107)
%109 = call i64 @isnan(i64 %108)
%110 = icmp ne i64 %109, 0
br i1 %110, label %111, label %112
111: ; preds = %102
br label %118
112: ; preds = %102
%113 = load volatile double, double* %2
%114 = load volatile double, double* %3
%115 = call i64 @remainder(double %113, double %114)
%116 = sitofp i64 %115 to double
%117 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.9, i64 0, i64 0), double %116, i32 155)
br label %118
118: ; preds = %112, %111
%119 = phi i32 [ 0, %111 ], [ 1, %112 ]
%120 = load i32, i32* %1
%121 = add nsw i32 %120, %119
store i32 %121, i32* %1
%122 = load double, double* @INFINITY
store volatile double %122, double* %3
%123 = load volatile double, double* %3
%124 = load volatile double, double* %2
%125 = call i64 @remainder(double %123, double %124)
%126 = call i64 @isnan(i64 %125)
%127 = icmp ne i64 %126, 0
br i1 %127, label %128, label %129
128: ; preds = %118
br label %135
129: ; preds = %118
%130 = load volatile double, double* %3
%131 = load volatile double, double* %2
%132 = call i64 @remainder(double %130, double %131)
%133 = sitofp i64 %132 to double
%134 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.10, i64 0, i64 0), double %133, i32 157)
br label %135
135: ; preds = %129, %128
%136 = phi i32 [ 0, %128 ], [ 1, %129 ]
%137 = load i32, i32* %1
%138 = add nsw i32 %137, %136
store i32 %138, i32* %1
%139 = load i32, i32* %1
ret i32 %139
}

LLVM IR (-O2):
@.str.1 = [27 x i8] c"ERROR %s(%f) != NaN at %d\0A\00"
@.str.2 = [10 x i8] c"pow(x, y)\00"
@.str.3 = [7 x i8] c"log(x)\00"
@.str.4 = [8 x i8] c"sqrt(x)\00"
@.str.5 = [8 x i8] c"asin(x)\00"
@INFINITY = global double 0.000000e+00
@.str.6 = [7 x i8] c"sin(x)\00"
@.str.7 = [7 x i8] c"cos(x)\00"
@.str.8 = [9 x i8] c"acosh(x)\00"
@.str.9 = [16 x i8] c"remainder(x, y)\00"
@.str.10 = [16 x i8] c"remainder(y, x)\00"
@str = [37 x i8] c"Checking well-defined library errors\00"
define i32 @test_errs() {
%1 = alloca double
%2 = alloca double
%3 = bitcast double* %1 to i8*
%4 = bitcast double* %2 to i8*
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str, i64 0, i64 0))
store volatile double -3.000000e+00, double* %1
store volatile double 4.400000e+00, double* %2
%6 = load volatile double, double* %1
%7 = load volatile double, double* %2
%8 = tail call i64 @pow(double %6, double %7)
%9 = tail call i64 @isnan(i64 %8)
%10 = icmp eq i64 %9, 0
br i1 %10, label %11, label %17
11: ; preds = %0
%12 = load volatile double, double* %1
%13 = load volatile double, double* %2
%14 = tail call i64 @pow(double %12, double %13)
%15 = sitofp i64 %14 to double
%16 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), double %15, i32 143)
br label %17
17: ; preds = %0, %11
%18 = phi i32 [ 1, %11 ], [ 0, %0 ]
%19 = load volatile double, double* %1
%20 = tail call i64 @log(double %19)
%21 = tail call i64 @isnan(i64 %20)
%22 = icmp eq i64 %21, 0
br i1 %22, label %23, label %28
23: ; preds = %17
%24 = load volatile double, double* %1
%25 = tail call i64 @log(double %24)
%26 = sitofp i64 %25 to double
%27 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), double %26, i32 144)
br label %28
28: ; preds = %17, %23
%29 = phi i32 [ 1, %23 ], [ 0, %17 ]
store volatile double -1.000000e-03, double* %1
%30 = load volatile double, double* %1
%31 = tail call i64 @sqrt(double %30)
%32 = tail call i64 @isnan(i64 %31)
%33 = icmp eq i64 %32, 0
br i1 %33, label %34, label %39
34: ; preds = %28
%35 = load volatile double, double* %1
%36 = tail call i64 @sqrt(double %35)
%37 = sitofp i64 %36 to double
%38 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0), double %37, i32 146)
br label %39
39: ; preds = %28, %34
%40 = phi i32 [ 1, %34 ], [ 0, %28 ]
store volatile double 1.000100e+00, double* %1
%41 = load volatile double, double* %1
%42 = tail call i64 @asin(double %41)
%43 = tail call i64 @isnan(i64 %42)
%44 = icmp eq i64 %43, 0
br i1 %44, label %45, label %50
45: ; preds = %39
%46 = load volatile double, double* %1
%47 = tail call i64 @asin(double %46)
%48 = sitofp i64 %47 to double
%49 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0), double %48, i32 148)
br label %50
50: ; preds = %39, %45
%51 = phi i32 [ 1, %45 ], [ 0, %39 ]
%52 = load double, double* @INFINITY
store volatile double %52, double* %1
%53 = load volatile double, double* %1
%54 = tail call i64 @sin(double %53)
%55 = tail call i64 @isnan(i64 %54)
%56 = icmp eq i64 %55, 0
br i1 %56, label %57, label %62
57: ; preds = %50
%58 = load volatile double, double* %1
%59 = tail call i64 @sin(double %58)
%60 = sitofp i64 %59 to double
%61 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0), double %60, i32 150)
br label %62
62: ; preds = %50, %57
%63 = phi i32 [ 1, %57 ], [ 0, %50 ]
%64 = load volatile double, double* %1
%65 = tail call i64 @cos(double %64)
%66 = tail call i64 @isnan(i64 %65)
%67 = icmp eq i64 %66, 0
br i1 %67, label %68, label %73
68: ; preds = %62
%69 = load volatile double, double* %1
%70 = tail call i64 @cos(double %69)
%71 = sitofp i64 %70 to double
%72 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.7, i64 0, i64 0), double %71, i32 151)
br label %73
73: ; preds = %62, %68
%74 = phi i32 [ 1, %68 ], [ 0, %62 ]
store volatile double 0x3FEFF7CED916872B, double* %1
%75 = load volatile double, double* %1
%76 = tail call i64 @acosh(double %75)
%77 = tail call i64 @isnan(i64 %76)
%78 = icmp eq i64 %77, 0
br i1 %78, label %79, label %84
79: ; preds = %73
%80 = load volatile double, double* %1
%81 = tail call i64 @acosh(double %80)
%82 = sitofp i64 %81 to double
%83 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.8, i64 0, i64 0), double %82, i32 153)
br label %84
84: ; preds = %73, %79
%85 = phi i32 [ 1, %79 ], [ 0, %73 ]
store volatile double 3.300000e+00, double* %1
store volatile double 0.000000e+00, double* %2
%86 = load volatile double, double* %1
%87 = load volatile double, double* %2
%88 = tail call i64 @remainder(double %86, double %87)
%89 = tail call i64 @isnan(i64 %88)
%90 = icmp eq i64 %89, 0
br i1 %90, label %91, label %97
91: ; preds = %84
%92 = load volatile double, double* %1
%93 = load volatile double, double* %2
%94 = tail call i64 @remainder(double %92, double %93)
%95 = sitofp i64 %94 to double
%96 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.9, i64 0, i64 0), double %95, i32 155)
br label %97
97: ; preds = %84, %91
%98 = phi i32 [ 1, %91 ], [ 0, %84 ]
%99 = load double, double* @INFINITY
store volatile double %99, double* %2
%100 = load volatile double, double* %2
%101 = load volatile double, double* %1
%102 = tail call i64 @remainder(double %100, double %101)
%103 = tail call i64 @isnan(i64 %102)
%104 = icmp eq i64 %103, 0
br i1 %104, label %105, label %111
105: ; preds = %97
%106 = load volatile double, double* %2
%107 = load volatile double, double* %1
%108 = tail call i64 @remainder(double %106, double %107)
%109 = sitofp i64 %108 to double
%110 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.10, i64 0, i64 0), double %109, i32 157)
br label %111
111: ; preds = %97, %105
%112 = phi i32 [ 1, %105 ], [ 0, %97 ]
%113 = add nuw nsw i32 %29, %18
%114 = add nuw nsw i32 %113, %40
%115 = add nuw nsw i32 %114, %51
%116 = add nuw nsw i32 %115, %63
%117 = add nuw nsw i32 %116, %74
%118 = add nuw nsw i32 %117, %85
%119 = add nuw nsw i32 %118, %98
%120 = add nuw nsw i32 %119, %112
ret i32 %120
}