#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 const fabs(double const);
int /*<<< orphan*/ gsl_test_rel(double const, double const, double const,
                                char *, char const *, char const *);
void box_checksol(const double x[], const double sumsq, const double epsrel,
                  const char *sname, const char *pname) {
  const double sumsq_exact = 0.0;
  const double eps = 1.0e-6;
  gsl_test_rel(sumsq, sumsq_exact, epsrel, "%s/%s sumsq", sname, pname);
  if (fabs(x[2] - 1.0) < eps) {
    gsl_test_rel(x[0], 1.0, epsrel, "%s/%s i=0", sname, pname);
    gsl_test_rel(x[1], 10.0, epsrel, "%s/%s i=1", sname, pname);
    gsl_test_rel(x[2], 1.0, epsrel, "%s/%s i=2", sname, pname);
  } else if (fabs(x[2] + 1.0) < eps) {
    gsl_test_rel(x[0], 10.0, epsrel, "%s/%s i=0", sname, pname);
    gsl_test_rel(x[1], 1.0, epsrel, "%s/%s i=1", sname, pname);
    gsl_test_rel(x[2], -1.0, epsrel, "%s/%s i=2", sname, pname);
  } else {
    gsl_test_rel(x[0], x[1], epsrel, "%s/%s i=0,1", sname, pname);
    gsl_test_rel(x[2], 0.0, epsrel, "%s/%s i=2", sname, pname);
  }
}


x86 assembly (clang, -O0):
<box_checksol>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
mov    %rsi,-0x20(%rbp)
mov    %rdx,-0x28(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  0xeb2(%rip),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm2
mov    -0x20(%rbp),%rsi
mov    -0x28(%rbp),%rdx
xorps  %xmm1,%xmm1
lea    0xeb1(%rip),%rdi
call   1030 <gsl_test_rel@plt>
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm0
movsd  0xe83(%rip),%xmm1
subsd  %xmm1,%xmm0
call   1040 <fabs@plt>
movaps %xmm0,%xmm1
movsd  0xe67(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    1225 <box_checksol+0x105>
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
movsd  -0x18(%rbp),%xmm2
mov    -0x20(%rbp),%rsi
mov    -0x28(%rbp),%rdx
movsd  0xe48(%rip),%xmm1
lea    0xe65(%rip),%rdi
call   1030 <gsl_test_rel@plt>
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
movsd  -0x18(%rbp),%xmm2
mov    -0x20(%rbp),%rsi
mov    -0x28(%rbp),%rdx
movsd  0xe2e(%rip),%xmm1
lea    0xe45(%rip),%rdi
call   1030 <gsl_test_rel@plt>
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm0
movsd  -0x18(%rbp),%xmm2
mov    -0x20(%rbp),%rsi
mov    -0x28(%rbp),%rdx
movsd  0xdf4(%rip),%xmm1
lea    0xe25(%rip),%rdi
call   1030 <gsl_test_rel@plt>
jmp    1326 <box_checksol+0x206>
mov    -0x8(%rbp),%rax
movsd  0xdd7(%rip),%xmm0
addsd  0x10(%rax),%xmm0
call   1040 <fabs@plt>
movaps %xmm0,%xmm1
movsd  0xdba(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    12d2 <box_checksol+0x1b2>
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
movsd  -0x18(%rbp),%xmm2
mov    -0x20(%rbp),%rsi
mov    -0x28(%rbp),%rdx
movsd  0xdab(%rip),%xmm1
lea    0xdb8(%rip),%rdi
call   1030 <gsl_test_rel@plt>
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
movsd  -0x18(%rbp),%xmm2
mov    -0x20(%rbp),%rsi
mov    -0x28(%rbp),%rdx
movsd  0xd71(%rip),%xmm1
lea    0xd98(%rip),%rdi
call   1030 <gsl_test_rel@plt>
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm0
movsd  -0x18(%rbp),%xmm2
mov    -0x20(%rbp),%rsi
mov    -0x28(%rbp),%rdx
movsd  0xd4f(%rip),%xmm1
lea    0xd78(%rip),%rdi
call   1030 <gsl_test_rel@plt>
jmp    1321 <box_checksol+0x201>
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm1
movsd  -0x18(%rbp),%xmm2
mov    -0x20(%rbp),%rsi
mov    -0x28(%rbp),%rdx
lea    0xd53(%rip),%rdi
call   1030 <gsl_test_rel@plt>
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm0
movsd  -0x18(%rbp),%xmm2
mov    -0x20(%rbp),%rsi
mov    -0x28(%rbp),%rdx
xorps  %xmm1,%xmm1
lea    0xd24(%rip),%rdi
call   1030 <gsl_test_rel@plt>
jmp    1326 <box_checksol+0x206>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<box_checksol>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rdx,%r14
mov    %rsi,%r15
movaps %xmm1,%xmm2
mov    %rdi,%rbx
lea    0xf04(%rip),%rdi
xorps  %xmm1,%xmm1
movsd  %xmm2,0x8(%rsp)
call   1030 <gsl_test_rel@plt>
movsd  0x10(%rbx),%xmm0
movsd  0xeb9(%rip),%xmm2
addsd  %xmm0,%xmm2
andpd  0xecd(%rip),%xmm2
movsd  0xead(%rip),%xmm1
ucomisd %xmm2,%xmm1
jbe    11b7 <box_checksol+0xa7>
movsd  (%rbx),%xmm0
lea    0xed0(%rip),%rdi
movsd  0xe9c(%rip),%xmm1
movsd  0x8(%rsp),%xmm2
mov    %r15,%rsi
mov    %r14,%rdx
call   1030 <gsl_test_rel@plt>
movsd  0x8(%rbx),%xmm0
lea    0xeb5(%rip),%rdi
movsd  0xe7f(%rip),%xmm1
movsd  0x8(%rsp),%xmm2
mov    %r15,%rsi
mov    %r14,%rdx
call   1030 <gsl_test_rel@plt>
movsd  0xe5e(%rip),%xmm1
jmp    123a <box_checksol+0x12a>
movsd  0x8(%rsp),%xmm2
addsd  0xe4b(%rip),%xmm0
andpd  0xe53(%rip),%xmm0
ucomisd %xmm0,%xmm1
movsd  (%rbx),%xmm0
jbe    1220 <box_checksol+0x110>
lea    0xe5e(%rip),%rdi
movsd  0xe32(%rip),%xmm1
mov    %r15,%rsi
mov    %r14,%rdx
call   1030 <gsl_test_rel@plt>
movsd  0x8(%rbx),%xmm0
lea    0xe49(%rip),%rdi
movsd  0xe0b(%rip),%xmm1
movsd  0x8(%rsp),%xmm2
mov    %r15,%rsi
mov    %r14,%rdx
call   1030 <gsl_test_rel@plt>
movsd  0xde2(%rip),%xmm1
jmp    123a <box_checksol+0x12a>
movsd  0x8(%rbx),%xmm1
lea    0xe2e(%rip),%rdi
mov    %r15,%rsi
mov    %r14,%rdx
call   1030 <gsl_test_rel@plt>
xorps  %xmm1,%xmm1
movsd  0x10(%rbx),%xmm0
lea    0xe0a(%rip),%rdi
movsd  0x8(%rsp),%xmm2
mov    %r15,%rsi
mov    %r14,%rdx
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <gsl_test_rel@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"%s/%s sumsq\00"
@.str.1 = [10 x i8] c"%s/%s i=0\00"
@.str.2 = [10 x i8] c"%s/%s i=1\00"
@.str.3 = [10 x i8] c"%s/%s i=2\00"
@.str.4 = [12 x i8] c"%s/%s i=0,1\00"
define void @box_checksol(double* %0, double %1, double %2, i8* %3, i8* %4) {
%6 = alloca double*
%7 = alloca double
%8 = alloca double
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca double
%12 = alloca double
store double* %0, double** %6
store double %1, double* %7
store double %2, double* %8
store i8* %3, i8** %9
store i8* %4, i8** %10
store double 0.000000e+00, double* %11
store double 0x3EB0C6F7A0B5ED8D, double* %12
%13 = load double, double* %7
%14 = load double, double* %8
%15 = load i8*, i8** %9
%16 = load i8*, i8** %10
%17 = call i32 @gsl_test_rel(double %13, double 0.000000e+00, double %14, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %15, i8* %16)
%18 = load double*, double** %6
%19 = getelementptr inbounds double, double* %18, i64 2
%20 = load double, double* %19
%21 = fsub double %20, 1.000000e+00
%22 = call double @fabs(double %21)
%23 = fcmp olt double %22, 0x3EB0C6F7A0B5ED8D
br i1 %23, label %24, label %46
24: ; preds = %5
%25 = load double*, double** %6
%26 = getelementptr inbounds double, double* %25, i64 0
%27 = load double, double* %26
%28 = load double, double* %8
%29 = load i8*, i8** %9
%30 = load i8*, i8** %10
%31 = call i32 @gsl_test_rel(double %27, double 1.000000e+00, double %28, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* %29, i8* %30)
%32 = load double*, double** %6
%33 = getelementptr inbounds double, double* %32, i64 1
%34 = load double, double* %33
%35 = load double, double* %8
%36 = load i8*, i8** %9
%37 = load i8*, i8** %10
%38 = call i32 @gsl_test_rel(double %34, double 1.000000e+01, double %35, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i8* %36, i8* %37)
%39 = load double*, double** %6
%40 = getelementptr inbounds double, double* %39, i64 2
%41 = load double, double* %40
%42 = load double, double* %8
%43 = load i8*, i8** %9
%44 = load i8*, i8** %10
%45 = call i32 @gsl_test_rel(double %41, double 1.000000e+00, double %42, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i8* %43, i8* %44)
br label %94
46: ; preds = %5
%47 = load double*, double** %6
%48 = getelementptr inbounds double, double* %47, i64 2
%49 = load double, double* %48
%50 = fadd double %49, 1.000000e+00
%51 = call double @fabs(double %50)
%52 = fcmp olt double %51, 0x3EB0C6F7A0B5ED8D
br i1 %52, label %53, label %75
53: ; preds = %46
%54 = load double*, double** %6
%55 = getelementptr inbounds double, double* %54, i64 0
%56 = load double, double* %55
%57 = load double, double* %8
%58 = load i8*, i8** %9
%59 = load i8*, i8** %10
%60 = call i32 @gsl_test_rel(double %56, double 1.000000e+01, double %57, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* %58, i8* %59)
%61 = load double*, double** %6
%62 = getelementptr inbounds double, double* %61, i64 1
%63 = load double, double* %62
%64 = load double, double* %8
%65 = load i8*, i8** %9
%66 = load i8*, i8** %10
%67 = call i32 @gsl_test_rel(double %63, double 1.000000e+00, double %64, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i8* %65, i8* %66)
%68 = load double*, double** %6
%69 = getelementptr inbounds double, double* %68, i64 2
%70 = load double, double* %69
%71 = load double, double* %8
%72 = load i8*, i8** %9
%73 = load i8*, i8** %10
%74 = call i32 @gsl_test_rel(double %70, double -1.000000e+00, double %71, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i8* %72, i8* %73)
br label %93
75: ; preds = %46
%76 = load double*, double** %6
%77 = getelementptr inbounds double, double* %76, i64 0
%78 = load double, double* %77
%79 = load double*, double** %6
%80 = getelementptr inbounds double, double* %79, i64 1
%81 = load double, double* %80
%82 = load double, double* %8
%83 = load i8*, i8** %9
%84 = load i8*, i8** %10
%85 = call i32 @gsl_test_rel(double %78, double %81, double %82, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.4, i64 0, i64 0), i8* %83, i8* %84)
%86 = load double*, double** %6
%87 = getelementptr inbounds double, double* %86, i64 2
%88 = load double, double* %87
%89 = load double, double* %8
%90 = load i8*, i8** %9
%91 = load i8*, i8** %10
%92 = call i32 @gsl_test_rel(double %88, double 0.000000e+00, double %89, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i8* %90, i8* %91)
br label %93
93: ; preds = %75, %53
br label %94
94: ; preds = %93, %24
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"%s/%s sumsq\00"
@.str.1 = [10 x i8] c"%s/%s i=0\00"
@.str.2 = [10 x i8] c"%s/%s i=1\00"
@.str.3 = [10 x i8] c"%s/%s i=2\00"
@.str.4 = [12 x i8] c"%s/%s i=0,1\00"
define void @box_checksol(double* nocapture %0, double %1, double %2, i8* %3, i8* %4) {
%6 = tail call i32 @gsl_test_rel(double %1, double 0.000000e+00, double %2, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %3, i8* %4)
%7 = getelementptr inbounds double, double* %0, i64 2
%8 = load double, double* %7
%9 = fadd double %8, -1.000000e+00
%10 = tail call double @llvm.fabs.f64(double %9)
%11 = fcmp olt double %10, 0x3EB0C6F7A0B5ED8D
br i1 %11, label %12, label %18
12: ; preds = %5
%13 = load double, double* %0
%14 = tail call i32 @gsl_test_rel(double %13, double 1.000000e+00, double %2, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* %3, i8* %4)
%15 = getelementptr inbounds double, double* %0, i64 1
%16 = load double, double* %15
%17 = tail call i32 @gsl_test_rel(double %16, double 1.000000e+01, double %2, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i8* %3, i8* %4)
br label %32
18: ; preds = %5
%19 = fadd double %8, 1.000000e+00
%20 = tail call double @llvm.fabs.f64(double %19)
%21 = fcmp olt double %20, 0x3EB0C6F7A0B5ED8D
%22 = load double, double* %0
br i1 %21, label %23, label %28
23: ; preds = %18
%24 = tail call i32 @gsl_test_rel(double %22, double 1.000000e+01, double %2, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* %3, i8* %4)
%25 = getelementptr inbounds double, double* %0, i64 1
%26 = load double, double* %25
%27 = tail call i32 @gsl_test_rel(double %26, double 1.000000e+00, double %2, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i8* %3, i8* %4)
br label %32
28: ; preds = %18
%29 = getelementptr inbounds double, double* %0, i64 1
%30 = load double, double* %29
%31 = tail call i32 @gsl_test_rel(double %22, double %30, double %2, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.4, i64 0, i64 0), i8* %3, i8* %4)
br label %32
32: ; preds = %23, %28, %12
%33 = phi double [ -1.000000e+00, %23 ], [ 0.000000e+00, %28 ], [ 1.000000e+00, %12 ]
%34 = load double, double* %7
%35 = tail call i32 @gsl_test_rel(double %34, double %33, double %2, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i8* %3, i8* %4)
ret void
}