#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);
scalar_t__ asin(double);
scalar_t__ cos(double);
scalar_t__ isnan(scalar_t__);
scalar_t__ log(double);
scalar_t__ pow(double, double);
int printf(char *, ...);
scalar_t__ remainder(double, double);
scalar_t__ sin(double);
scalar_t__ sqrt(double);
int test_errs() {
  int errs = 0;
  printf("Checking well-defined library errors\n");
  errs += isnan(pow(-3.0, 4.4))
              ? 0
              : (printf("ERROR %s(%f) != NaN at %d\n", "pow(-3.0, 4.4)",
                        (double)pow(-3.0, 4.4), 109),
                 1);
  errs += isnan(log(-3.0)) ? 0
                           : (printf("ERROR %s(%f) != NaN at %d\n", "log(-3.0)",
                                     (double)log(-3.0), 110),
                              1);
  errs += isnan(sqrt(-0.001))
              ? 0
              : (printf("ERROR %s(%f) != NaN at %d\n", "sqrt(-0.001)",
                        (double)sqrt(-0.001), 111),
                 1);
  errs += isnan(asin(1.0001))
              ? 0
              : (printf("ERROR %s(%f) != NaN at %d\n", "asin(1.0001)",
                        (double)asin(1.0001), 112),
                 1);
  errs += isnan(sin(INFINITY))
              ? 0
              : (printf("ERROR %s(%f) != NaN at %d\n", "sin(INFINITY)",
                        (double)sin(INFINITY), 113),
                 1);
  errs += isnan(cos(INFINITY))
              ? 0
              : (printf("ERROR %s(%f) != NaN at %d\n", "cos(INFINITY)",
                        (double)cos(INFINITY), 114),
                 1);
  errs += isnan(acosh(0.999))
              ? 0
              : (printf("ERROR %s(%f) != NaN at %d\n", "acosh(0.999)",
                        (double)acosh(0.999), 115),
                 1);
  errs += isnan(remainder(3.3, 0.0))
              ? 0
              : (printf("ERROR %s(%f) != NaN at %d\n", "remainder(3.3, 0.0)",
                        (double)remainder(3.3, 0.0), 116),
                 1);
  errs +=
      isnan(remainder(INFINITY, 3.3))
          ? 0
          : (printf("ERROR %s(%f) != NaN at %d\n", "remainder(INFINITY, 3.3)",
                    (double)remainder(INFINITY, 3.3), 117),
             1);
  return errs;
}


x86 assembly (clang, -O0):
<test_errs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe7a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movsd  0xe3b(%rip),%xmm0
movsd  0xe3b(%rip),%xmm1
call   10b0 <pow@plt>
mov    %rax,%rdi
call   1080 <isnan@plt>
cmp    $0x0,%rax
je     11ee <test_errs+0x4e>
xor    %eax,%eax
mov    %eax,-0x8(%rbp)
jmp    122a <test_errs+0x8a>
movsd  0xe0a(%rip),%xmm0
movsd  0xe0a(%rip),%xmm1
call   10b0 <pow@plt>
cvtsi2sd %rax,%xmm0
lea    0xe47(%rip),%rdi
lea    0xe5b(%rip),%rsi
mov    $0x6d,%edx
mov    $0x1,%al
call   1030 <printf@plt>
mov    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
movsd  0xdc5(%rip),%xmm0
call   10a0 <log@plt>
mov    %rax,%rdi
call   1080 <isnan@plt>
cmp    $0x0,%rax
je     125c <test_errs+0xbc>
xor    %eax,%eax
mov    %eax,-0xc(%rbp)
jmp    1290 <test_errs+0xf0>
movsd  0xd9c(%rip),%xmm0
call   10a0 <log@plt>
cvtsi2sd %rax,%xmm0
lea    0xde1(%rip),%rdi
lea    0xe04(%rip),%rsi
mov    $0x6e,%edx
mov    $0x1,%al
call   1030 <printf@plt>
mov    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
movsd  0xd6f(%rip),%xmm0
call   10c0 <sqrt@plt>
mov    %rax,%rdi
call   1080 <isnan@plt>
cmp    $0x0,%rax
je     12c2 <test_errs+0x122>
xor    %eax,%eax
mov    %eax,-0x10(%rbp)
jmp    12f6 <test_errs+0x156>
movsd  0xd46(%rip),%xmm0
call   10c0 <sqrt@plt>
cvtsi2sd %rax,%xmm0
lea    0xd7b(%rip),%rdi
lea    0xda8(%rip),%rsi
mov    $0x6f,%edx
mov    $0x1,%al
call   1030 <printf@plt>
mov    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
movsd  0xd11(%rip),%xmm0
call   1060 <asin@plt>
mov    %rax,%rdi
call   1080 <isnan@plt>
cmp    $0x0,%rax
je     1328 <test_errs+0x188>
xor    %eax,%eax
mov    %eax,-0x14(%rbp)
jmp    135c <test_errs+0x1bc>
movsd  0xce8(%rip),%xmm0
call   1060 <asin@plt>
cvtsi2sd %rax,%xmm0
lea    0xd15(%rip),%rdi
lea    0xd4f(%rip),%rsi
mov    $0x70,%edx
mov    $0x1,%al
call   1030 <printf@plt>
mov    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    0x2c7c(%rip),%rax
movsd  (%rax),%xmm0
call   1050 <sin@plt>
mov    %rax,%rdi
call   1080 <isnan@plt>
cmp    $0x0,%rax
je     1391 <test_errs+0x1f1>
xor    %eax,%eax
mov    %eax,-0x18(%rbp)
jmp    13c8 <test_errs+0x228>
mov    0x2c50(%rip),%rax
movsd  (%rax),%xmm0
call   1050 <sin@plt>
cvtsi2sd %rax,%xmm0
lea    0xca9(%rip),%rdi
lea    0xcf0(%rip),%rsi
mov    $0x71,%edx
mov    $0x1,%al
call   1030 <printf@plt>
mov    $0x1,%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    0x2c10(%rip),%rax
movsd  (%rax),%xmm0
call   1090 <cos@plt>
mov    %rax,%rdi
call   1080 <isnan@plt>
cmp    $0x0,%rax
je     13fd <test_errs+0x25d>
xor    %eax,%eax
mov    %eax,-0x1c(%rbp)
jmp    1434 <test_errs+0x294>
mov    0x2be4(%rip),%rax
movsd  (%rax),%xmm0
call   1090 <cos@plt>
cvtsi2sd %rax,%xmm0
lea    0xc3d(%rip),%rdi
lea    0xc92(%rip),%rsi
mov    $0x72,%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  0xbdb(%rip),%xmm0
call   1040 <acosh@plt>
mov    %rax,%rdi
call   1080 <isnan@plt>
cmp    $0x0,%rax
je     1466 <test_errs+0x2c6>
xor    %eax,%eax
mov    %eax,-0x20(%rbp)
jmp    149a <test_errs+0x2fa>
movsd  0xbb2(%rip),%xmm0
call   1040 <acosh@plt>
cvtsi2sd %rax,%xmm0
lea    0xbd7(%rip),%rdi
lea    0xc3a(%rip),%rsi
mov    $0x73,%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  0xb7d(%rip),%xmm0
xorps  %xmm1,%xmm1
call   1070 <remainder@plt>
mov    %rax,%rdi
call   1080 <isnan@plt>
cmp    $0x0,%rax
je     14cf <test_errs+0x32f>
xor    %eax,%eax
mov    %eax,-0x24(%rbp)
jmp    1506 <test_errs+0x366>
movsd  0xb51(%rip),%xmm0
xorps  %xmm1,%xmm1
call   1070 <remainder@plt>
cvtsi2sd %rax,%xmm0
lea    0xb6b(%rip),%rdi
lea    0xbdb(%rip),%rsi
mov    $0x74,%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)
mov    0x2ad2(%rip),%rax
movsd  (%rax),%xmm0
movsd  0xb06(%rip),%xmm1
call   1070 <remainder@plt>
mov    %rax,%rdi
call   1080 <isnan@plt>
cmp    $0x0,%rax
je     1543 <test_errs+0x3a3>
xor    %eax,%eax
mov    %eax,-0x28(%rbp)
jmp    1582 <test_errs+0x3e2>
mov    0x2a9e(%rip),%rax
movsd  (%rax),%xmm0
movsd  0xad2(%rip),%xmm1
call   1070 <remainder@plt>
cvtsi2sd %rax,%xmm0
lea    0xaef(%rip),%rdi
lea    0xb73(%rip),%rsi
mov    $0x75,%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    -0x4(%rbp),%eax
add    $0x30,%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    0xf0f(%rip),%rdi
call   1030 <puts@plt>
movsd  0xe2e(%rip),%xmm0
movsd  0xe2e(%rip),%xmm1
call   10c0 <pow@plt>
mov    %rax,%rdi
call   1090 <isnan@plt>
xor    %ebx,%ebx
mov    $0x0,%ecx
test   %rax,%rax
jne    122f <test_errs+0x7f>
movsd  0xe05(%rip),%xmm0
movsd  0xe05(%rip),%xmm1
call   10c0 <pow@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
lea    0xe19(%rip),%rdi
lea    0xe2d(%rip),%rsi
mov    $0x6d,%edx
mov    $0x1,%al
call   1040 <printf@plt>
mov    $0x1,%ecx
mov    %ecx,0x14(%rsp)
movsd  0xdc5(%rip),%xmm0
call   10b0 <log@plt>
mov    %rax,%rdi
call   1090 <isnan@plt>
test   %rax,%rax
jne    1281 <test_errs+0xd1>
movsd  0xdab(%rip),%xmm0
call   10b0 <log@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
lea    0xdc7(%rip),%rdi
lea    0xdea(%rip),%rsi
mov    $0x6e,%edx
mov    $0x1,%al
call   1040 <printf@plt>
mov    $0x1,%ebx
movsd  0xd87(%rip),%xmm0
call   10d0 <sqrt@plt>
mov    %rax,%rdi
call   1090 <isnan@plt>
xor    %ebp,%ebp
mov    $0x0,%ecx
test   %rax,%rax
jne    12d6 <test_errs+0x126>
movsd  0xd66(%rip),%xmm0
call   10d0 <sqrt@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
lea    0xd72(%rip),%rdi
lea    0xd9f(%rip),%rsi
mov    $0x6f,%edx
mov    $0x1,%al
call   1040 <printf@plt>
mov    $0x1,%ecx
mov    %ecx,0xc(%rsp)
movsd  0xd36(%rip),%xmm0
call   1070 <asin@plt>
mov    %rax,%rdi
call   1090 <isnan@plt>
test   %rax,%rax
jne    1328 <test_errs+0x178>
movsd  0xd1c(%rip),%xmm0
call   1070 <asin@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
lea    0xd20(%rip),%rdi
lea    0xd5a(%rip),%rsi
mov    $0x70,%edx
mov    $0x1,%al
call   1040 <printf@plt>
mov    $0x1,%ebp
mov    %ebp,0x10(%rsp)
mov    0x2cb5(%rip),%rbp
movsd  0x0(%rbp),%xmm0
call   1060 <sin@plt>
mov    %rax,%rdi
call   1090 <isnan@plt>
xor    %r13d,%r13d
mov    $0x0,%r14d
test   %rax,%rax
jne    1385 <test_errs+0x1d5>
movsd  0x0(%rbp),%xmm0
call   1060 <sin@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
lea    0xcc4(%rip),%rdi
lea    0xd0b(%rip),%rsi
mov    $0x71,%edx
mov    $0x1,%al
call   1040 <printf@plt>
mov    $0x1,%r14d
movsd  0x0(%rbp),%xmm0
call   10a0 <cos@plt>
mov    %rax,%rdi
call   1090 <isnan@plt>
test   %rax,%rax
jne    13ce <test_errs+0x21e>
movsd  0x0(%rbp),%xmm0
call   10a0 <cos@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
lea    0xc7b(%rip),%rdi
lea    0xcd0(%rip),%rsi
mov    $0x72,%edx
mov    $0x1,%al
call   1040 <printf@plt>
mov    $0x1,%r13d
movsd  0xc4a(%rip),%xmm0
call   1050 <acosh@plt>
mov    %rax,%rdi
call   1090 <isnan@plt>
xor    %r15d,%r15d
mov    $0x0,%r12d
test   %rax,%rax
jne    1426 <test_errs+0x276>
movsd  0xc27(%rip),%xmm0
call   1050 <acosh@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
lea    0xc23(%rip),%rdi
lea    0xc86(%rip),%rsi
mov    $0x73,%edx
mov    $0x1,%al
call   1040 <printf@plt>
mov    $0x1,%r12d
movsd  0xbfa(%rip),%xmm0
xorps  %xmm1,%xmm1
call   1080 <remainder@plt>
mov    %rax,%rdi
call   1090 <isnan@plt>
test   %rax,%rax
jne    147b <test_errs+0x2cb>
movsd  0xbdd(%rip),%xmm0
xorps  %xmm1,%xmm1
call   1080 <remainder@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
lea    0xbce(%rip),%rdi
lea    0xc3e(%rip),%rsi
mov    $0x74,%edx
mov    $0x1,%al
call   1040 <printf@plt>
mov    $0x1,%r15d
movsd  0x0(%rbp),%xmm0
movsd  0xba0(%rip),%xmm1
call   1080 <remainder@plt>
mov    %rax,%rdi
call   1090 <isnan@plt>
xor    %ecx,%ecx
test   %rax,%rax
jne    14d5 <test_errs+0x325>
movsd  0x0(%rbp),%xmm0
movsd  0xb7f(%rip),%xmm1
call   1080 <remainder@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
lea    0xb73(%rip),%rdi
lea    0xbf7(%rip),%rsi
mov    $0x75,%edx
mov    $0x1,%al
call   1040 <printf@plt>
mov    $0x1,%ecx
add    0x14(%rsp),%ebx
add    0xc(%rsp),%ebx
add    0x10(%rsp),%ebx
add    %r14d,%ebx
add    %r13d,%ebx
add    %r12d,%ebx
add    %r15d,%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 = [15 x i8] c"pow(-3.0, 4.4)\00"
@.str.3 = [10 x i8] c"log(-3.0)\00"
@.str.4 = [13 x i8] c"sqrt(-0.001)\00"
@.str.5 = [13 x i8] c"asin(1.0001)\00"
@INFINITY = global double 0.000000e+00
@.str.6 = [14 x i8] c"sin(INFINITY)\00"
@.str.7 = [14 x i8] c"cos(INFINITY)\00"
@.str.8 = [13 x i8] c"acosh(0.999)\00"
@.str.9 = [20 x i8] c"remainder(3.3, 0.0)\00"
@.str.10 = [25 x i8] c"remainder(INFINITY, 3.3)\00"
define i32 @test_errs() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
%3 = call i64 @pow(double -3.000000e+00, double 4.400000e+00)
%4 = call i64 @isnan(i64 %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %0
br label %11
7: ; preds = %0
%8 = call i64 @pow(double -3.000000e+00, double 4.400000e+00)
%9 = sitofp i64 %8 to double
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), double %9, i32 109)
br label %11
11: ; preds = %7, %6
%12 = phi i32 [ 0, %6 ], [ 1, %7 ]
%13 = load i32, i32* %1
%14 = add nsw i32 %13, %12
store i32 %14, i32* %1
%15 = call i64 @log(double -3.000000e+00)
%16 = call i64 @isnan(i64 %15)
%17 = icmp ne i64 %16, 0
br i1 %17, label %18, label %19
18: ; preds = %11
br label %23
19: ; preds = %11
%20 = call i64 @log(double -3.000000e+00)
%21 = sitofp i64 %20 to double
%22 = 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.3, i64 0, i64 0), double %21, i32 110)
br label %23
23: ; preds = %19, %18
%24 = phi i32 [ 0, %18 ], [ 1, %19 ]
%25 = load i32, i32* %1
%26 = add nsw i32 %25, %24
store i32 %26, i32* %1
%27 = call i64 @sqrt(double -1.000000e-03)
%28 = call i64 @isnan(i64 %27)
%29 = icmp ne i64 %28, 0
br i1 %29, label %30, label %31
30: ; preds = %23
br label %35
31: ; preds = %23
%32 = call i64 @sqrt(double -1.000000e-03)
%33 = sitofp i64 %32 to double
%34 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0), double %33, i32 111)
br label %35
35: ; preds = %31, %30
%36 = phi i32 [ 0, %30 ], [ 1, %31 ]
%37 = load i32, i32* %1
%38 = add nsw i32 %37, %36
store i32 %38, i32* %1
%39 = call i64 @asin(double 1.000100e+00)
%40 = call i64 @isnan(i64 %39)
%41 = icmp ne i64 %40, 0
br i1 %41, label %42, label %43
42: ; preds = %35
br label %47
43: ; preds = %35
%44 = call i64 @asin(double 1.000100e+00)
%45 = sitofp i64 %44 to double
%46 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.5, i64 0, i64 0), double %45, i32 112)
br label %47
47: ; preds = %43, %42
%48 = phi i32 [ 0, %42 ], [ 1, %43 ]
%49 = load i32, i32* %1
%50 = add nsw i32 %49, %48
store i32 %50, i32* %1
%51 = load double, double* @INFINITY
%52 = call i64 @sin(double %51)
%53 = call i64 @isnan(i64 %52)
%54 = icmp ne i64 %53, 0
br i1 %54, label %55, label %56
55: ; preds = %47
br label %61
56: ; preds = %47
%57 = load double, double* @INFINITY
%58 = call i64 @sin(double %57)
%59 = sitofp i64 %58 to double
%60 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.6, i64 0, i64 0), double %59, i32 113)
br label %61
61: ; preds = %56, %55
%62 = phi i32 [ 0, %55 ], [ 1, %56 ]
%63 = load i32, i32* %1
%64 = add nsw i32 %63, %62
store i32 %64, i32* %1
%65 = load double, double* @INFINITY
%66 = call i64 @cos(double %65)
%67 = call i64 @isnan(i64 %66)
%68 = icmp ne i64 %67, 0
br i1 %68, label %69, label %70
69: ; preds = %61
br label %75
70: ; preds = %61
%71 = load double, double* @INFINITY
%72 = call i64 @cos(double %71)
%73 = sitofp i64 %72 to double
%74 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.7, i64 0, i64 0), double %73, i32 114)
br label %75
75: ; preds = %70, %69
%76 = phi i32 [ 0, %69 ], [ 1, %70 ]
%77 = load i32, i32* %1
%78 = add nsw i32 %77, %76
store i32 %78, i32* %1
%79 = call i64 @acosh(double 0x3FEFF7CED916872B)
%80 = call i64 @isnan(i64 %79)
%81 = icmp ne i64 %80, 0
br i1 %81, label %82, label %83
82: ; preds = %75
br label %87
83: ; preds = %75
%84 = call i64 @acosh(double 0x3FEFF7CED916872B)
%85 = sitofp i64 %84 to double
%86 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.8, i64 0, i64 0), double %85, i32 115)
br label %87
87: ; preds = %83, %82
%88 = phi i32 [ 0, %82 ], [ 1, %83 ]
%89 = load i32, i32* %1
%90 = add nsw i32 %89, %88
store i32 %90, i32* %1
%91 = call i64 @remainder(double 3.300000e+00, double 0.000000e+00)
%92 = call i64 @isnan(i64 %91)
%93 = icmp ne i64 %92, 0
br i1 %93, label %94, label %95
94: ; preds = %87
br label %99
95: ; preds = %87
%96 = call i64 @remainder(double 3.300000e+00, double 0.000000e+00)
%97 = sitofp i64 %96 to double
%98 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.9, i64 0, i64 0), double %97, i32 116)
br label %99
99: ; preds = %95, %94
%100 = phi i32 [ 0, %94 ], [ 1, %95 ]
%101 = load i32, i32* %1
%102 = add nsw i32 %101, %100
store i32 %102, i32* %1
%103 = load double, double* @INFINITY
%104 = call i64 @remainder(double %103, double 3.300000e+00)
%105 = call i64 @isnan(i64 %104)
%106 = icmp ne i64 %105, 0
br i1 %106, label %107, label %108
107: ; preds = %99
br label %113
108: ; preds = %99
%109 = load double, double* @INFINITY
%110 = call i64 @remainder(double %109, double 3.300000e+00)
%111 = sitofp i64 %110 to double
%112 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.10, i64 0, i64 0), double %111, i32 117)
br label %113
113: ; preds = %108, %107
%114 = phi i32 [ 0, %107 ], [ 1, %108 ]
%115 = load i32, i32* %1
%116 = add nsw i32 %115, %114
store i32 %116, i32* %1
%117 = load i32, i32* %1
ret i32 %117
}

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