#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 */
int fabs(double);
int /*<<< orphan*/ splinerel(double, double, int /*<<< orphan*/);
void quadratic_spline(double a_1, double b_1, double a_2, double b_2,
                      double a_3, double b_3, double a_4, double b_4) {
  double x_1, y_1, x_4, y_4;
  double x_mid, y_mid;
  x_1 = a_1;
  y_1 = b_1;
  x_4 = a_4;
  y_4 = b_4;
  x_mid = (a_2 + a_3) / 2.0;
  y_mid = (b_2 + b_3) / 2.0;
  if ((fabs(x_1 - x_mid) < 1) && (fabs(y_1 - y_mid) < 1)) {
    splinerel(x_mid, y_mid, 0);
  } else {
    quadratic_spline(x_1, y_1, ((x_1 + a_2) / 2.0), ((y_1 + b_2) / 2.0),
                     ((3.0 * a_2 + a_3) / 4.0), ((3.0 * b_2 + b_3) / 4.0),
                     x_mid, y_mid);
  }
  if ((fabs(x_mid - x_4) < 1) && (fabs(y_mid - y_4) < 1)) {
    splinerel(x_4, y_4, 0);
  } else {
    quadratic_spline(x_mid, y_mid, ((a_2 + 3.0 * a_3) / 4.0),
                     ((b_2 + 3.0 * b_3) / 4.0), ((a_3 + x_4) / 2.0),
                     ((b_3 + y_4) / 2.0), x_4, y_4);
  }
}


x86 assembly (clang, -O0):
<quadratic_spline>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  %xmm4,-0x28(%rbp)
movsd  %xmm5,-0x30(%rbp)
movsd  %xmm6,-0x38(%rbp)
movsd  %xmm7,-0x40(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x18(%rbp),%xmm0
addsd  -0x28(%rbp),%xmm0
movsd  0xe66(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x20(%rbp),%xmm0
addsd  -0x30(%rbp),%xmm0
movsd  0xe4b(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x48(%rbp),%xmm0
subsd  -0x68(%rbp),%xmm0
call   1030 <fabs@plt>
cmp    $0x1,%eax
jge    1204 <quadratic_spline+0xd4>
movsd  -0x50(%rbp),%xmm0
subsd  -0x70(%rbp),%xmm0
call   1030 <fabs@plt>
cmp    $0x1,%eax
jge    1204 <quadratic_spline+0xd4>
movsd  -0x68(%rbp),%xmm0
movsd  -0x70(%rbp),%xmm1
xor    %edi,%edi
call   1050 <splinerel@plt>
jmp    1295 <quadratic_spline+0x165>
movsd  -0x48(%rbp),%xmm0
movsd  -0x50(%rbp),%xmm1
movsd  -0x48(%rbp),%xmm2
addsd  -0x18(%rbp),%xmm2
movsd  0xde0(%rip),%xmm3
divsd  %xmm3,%xmm2
movsd  -0x50(%rbp),%xmm3
addsd  -0x20(%rbp),%xmm3
movsd  0xdca(%rip),%xmm4
divsd  %xmm4,%xmm3
movsd  -0x18(%rbp),%xmm4
movsd  -0x28(%rbp),%xmm5
movsd  0xdc4(%rip),%xmm6
mulsd  %xmm6,%xmm4
addsd  %xmm5,%xmm4
movsd  0xdac(%rip),%xmm5
divsd  %xmm5,%xmm4
movsd  -0x20(%rbp),%xmm5
movsd  -0x30(%rbp),%xmm6
movsd  0xd9e(%rip),%xmm7
mulsd  %xmm7,%xmm5
addsd  %xmm6,%xmm5
movsd  0xd86(%rip),%xmm6
divsd  %xmm6,%xmm5
movsd  -0x68(%rbp),%xmm6
movsd  -0x70(%rbp),%xmm7
call   1040 <quadratic_spline@plt>
movsd  -0x68(%rbp),%xmm0
subsd  -0x58(%rbp),%xmm0
call   1030 <fabs@plt>
cmp    $0x1,%eax
jge    12db <quadratic_spline+0x1ab>
movsd  -0x70(%rbp),%xmm0
subsd  -0x60(%rbp),%xmm0
call   1030 <fabs@plt>
cmp    $0x1,%eax
jge    12db <quadratic_spline+0x1ab>
movsd  -0x58(%rbp),%xmm0
movsd  -0x60(%rbp),%xmm1
xor    %edi,%edi
call   1050 <splinerel@plt>
jmp    136c <quadratic_spline+0x23c>
movsd  -0x68(%rbp),%xmm0
movsd  -0x70(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm3
movsd  -0x28(%rbp),%xmm2
movsd  0xd19(%rip),%xmm4
mulsd  %xmm4,%xmm2
addsd  %xmm3,%xmm2
movsd  0xd01(%rip),%xmm3
divsd  %xmm3,%xmm2
movsd  -0x20(%rbp),%xmm4
movsd  -0x30(%rbp),%xmm3
movsd  0xcf3(%rip),%xmm5
mulsd  %xmm5,%xmm3
addsd  %xmm4,%xmm3
movsd  0xcdb(%rip),%xmm4
divsd  %xmm4,%xmm3
movsd  -0x28(%rbp),%xmm4
addsd  -0x58(%rbp),%xmm4
movsd  0xcbd(%rip),%xmm5
divsd  %xmm5,%xmm4
movsd  -0x30(%rbp),%xmm5
addsd  -0x60(%rbp),%xmm5
movsd  0xca7(%rip),%xmm6
divsd  %xmm6,%xmm5
movsd  -0x58(%rbp),%xmm6
movsd  -0x60(%rbp),%xmm7
call   1040 <quadratic_spline@plt>
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quadratic_spline>:
sub    $0x88,%rsp
unpcklpd %xmm1,%xmm0
unpcklpd %xmm3,%xmm2
unpcklpd %xmm5,%xmm4
movapd %xmm6,0x20(%rsp)
movapd %xmm7,0x10(%rsp)
unpcklpd %xmm7,%xmm6
movapd %xmm6,0x70(%rsp)
movapd 0xe9f(%rip),%xmm1
jmp    11a7 <quadratic_spline+0x77>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movapd 0x60(%rsp),%xmm4
movapd %xmm4,%xmm2
mulpd  0xe8e(%rip),%xmm2
addpd  0x50(%rsp),%xmm2
mulpd  0xe90(%rip),%xmm2
addpd  0x70(%rsp),%xmm4
movapd 0xe62(%rip),%xmm1
mulpd  %xmm1,%xmm4
movapd (%rsp),%xmm0
movapd %xmm2,0x50(%rsp)
movapd %xmm4,0x60(%rsp)
addpd  %xmm4,%xmm2
mulpd  %xmm1,%xmm2
movapd %xmm2,(%rsp)
movapd %xmm0,0x40(%rsp)
subsd  %xmm2,%xmm0
call   1030 <fabs@plt>
movapd (%rsp),%xmm6
movapd %xmm6,%xmm7
unpckhpd %xmm6,%xmm7
test   %eax,%eax
movapd %xmm7,0x30(%rsp)
jg     120c <quadratic_spline+0xdc>
movapd 0x40(%rsp),%xmm0
subpd  %xmm6,%xmm0
unpckhpd %xmm0,%xmm0
call   1030 <fabs@plt>
movapd 0x30(%rsp),%xmm7
movapd (%rsp),%xmm6
test   %eax,%eax
jle    12c9 <quadratic_spline+0x199>
movapd 0x40(%rsp),%xmm10
movapd %xmm10,%xmm2
movapd 0x50(%rsp),%xmm4
addsd  %xmm4,%xmm2
movsd  0xe06(%rip),%xmm0
mulsd  %xmm0,%xmm2
movapd %xmm10,%xmm1
unpckhpd %xmm10,%xmm1
movapd %xmm4,%xmm5
unpckhpd %xmm4,%xmm5
movapd %xmm1,%xmm3
addsd  %xmm5,%xmm3
mulsd  %xmm0,%xmm3
movsd  0xde3(%rip),%xmm8
mulsd  %xmm8,%xmm4
movapd 0x60(%rsp),%xmm11
addsd  %xmm11,%xmm4
movsd  0xdd1(%rip),%xmm9
mulsd  %xmm9,%xmm4
movapd %xmm11,%xmm0
unpckhpd %xmm11,%xmm0
mulsd  %xmm8,%xmm5
addsd  %xmm0,%xmm5
mulsd  %xmm9,%xmm5
movapd %xmm10,%xmm0
call   1040 <quadratic_spline@plt>
movapd (%rsp),%xmm0
subsd  0x20(%rsp),%xmm0
call   1030 <fabs@plt>
test   %eax,%eax
jg     1170 <quadratic_spline+0x40>
movapd 0x30(%rsp),%xmm0
subsd  0x10(%rsp),%xmm0
call   1030 <fabs@plt>
test   %eax,%eax
jg     1170 <quadratic_spline+0x40>
jmp    12da <quadratic_spline+0x1aa>
movapd %xmm6,%xmm0
movapd %xmm7,%xmm1
xor    %edi,%edi
call   1050 <splinerel@plt>
jmp    1296 <quadratic_spline+0x166>
movaps 0x20(%rsp),%xmm0
movaps 0x10(%rsp),%xmm1
xor    %edi,%edi
add    $0x88,%rsp
jmp    1050 <splinerel@plt>

LLVM IR (-O0):
define void @quadratic_spline(double %0, double %1, double %2, double %3, double %4, double %5, double %6, double %7) {
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double
%13 = alloca double
%14 = alloca double
%15 = alloca double
%16 = alloca double
%17 = alloca double
%18 = alloca double
%19 = alloca double
%20 = alloca double
%21 = alloca double
%22 = alloca double
store double %0, double* %9
store double %1, double* %10
store double %2, double* %11
store double %3, double* %12
store double %4, double* %13
store double %5, double* %14
store double %6, double* %15
store double %7, double* %16
%23 = load double, double* %9
store double %23, double* %17
%24 = load double, double* %10
store double %24, double* %18
%25 = load double, double* %15
store double %25, double* %19
%26 = load double, double* %16
store double %26, double* %20
%27 = load double, double* %11
%28 = load double, double* %13
%29 = fadd double %27, %28
%30 = fdiv double %29, 2.000000e+00
store double %30, double* %21
%31 = load double, double* %12
%32 = load double, double* %14
%33 = fadd double %31, %32
%34 = fdiv double %33, 2.000000e+00
store double %34, double* %22
%35 = load double, double* %17
%36 = load double, double* %21
%37 = fsub double %35, %36
%38 = call i32 @fabs(double %37)
%39 = icmp slt i32 %38, 1
br i1 %39, label %40, label %50
40: ; preds = %8
%41 = load double, double* %18
%42 = load double, double* %22
%43 = fsub double %41, %42
%44 = call i32 @fabs(double %43)
%45 = icmp slt i32 %44, 1
br i1 %45, label %46, label %50
46: ; preds = %40
%47 = load double, double* %21
%48 = load double, double* %22
%49 = call i32 @splinerel(double %47, double %48, i32 0)
br label %71
50: ; preds = %40, %8
%51 = load double, double* %17
%52 = load double, double* %18
%53 = load double, double* %17
%54 = load double, double* %11
%55 = fadd double %53, %54
%56 = fdiv double %55, 2.000000e+00
%57 = load double, double* %18
%58 = load double, double* %12
%59 = fadd double %57, %58
%60 = fdiv double %59, 2.000000e+00
%61 = load double, double* %11
%62 = load double, double* %13
%63 = call double @llvm.fmuladd.f64(double 3.000000e+00, double %61, double %62)
%64 = fdiv double %63, 4.000000e+00
%65 = load double, double* %12
%66 = load double, double* %14
%67 = call double @llvm.fmuladd.f64(double 3.000000e+00, double %65, double %66)
%68 = fdiv double %67, 4.000000e+00
%69 = load double, double* %21
%70 = load double, double* %22
br label %71
71: ; preds = %50, %46
%72 = load double, double* %21
%73 = load double, double* %19
%74 = fsub double %72, %73
%75 = call i32 @fabs(double %74)
%76 = icmp slt i32 %75, 1
br i1 %76, label %77, label %87
77: ; preds = %71
%78 = load double, double* %22
%79 = load double, double* %20
%80 = fsub double %78, %79
%81 = call i32 @fabs(double %80)
%82 = icmp slt i32 %81, 1
br i1 %82, label %83, label %87
83: ; preds = %77
%84 = load double, double* %19
%85 = load double, double* %20
%86 = call i32 @splinerel(double %84, double %85, i32 0)
br label %108
87: ; preds = %77, %71
%88 = load double, double* %21
%89 = load double, double* %22
%90 = load double, double* %11
%91 = load double, double* %13
%92 = call double @llvm.fmuladd.f64(double 3.000000e+00, double %91, double %90)
%93 = fdiv double %92, 4.000000e+00
%94 = load double, double* %12
%95 = load double, double* %14
%96 = call double @llvm.fmuladd.f64(double 3.000000e+00, double %95, double %94)
%97 = fdiv double %96, 4.000000e+00
%98 = load double, double* %13
%99 = load double, double* %19
%100 = fadd double %98, %99
%101 = fdiv double %100, 2.000000e+00
%102 = load double, double* %14
%103 = load double, double* %20
%104 = fadd double %102, %103
%105 = fdiv double %104, 2.000000e+00
%106 = load double, double* %19
%107 = load double, double* %20
br label %108
108: ; preds = %87, %83
ret void
}

LLVM IR (-O2):
define void @quadratic_spline(double %0, double %1, double %2, double %3, double %4, double %5, double %6, double %7) {
%9 = insertelement <2 x double> poison, double %0, i64 0
%10 = insertelement <2 x double> %9, double %1, i64 1
%11 = insertelement <2 x double> poison, double %2, i64 0
%12 = insertelement <2 x double> %11, double %3, i64 1
%13 = insertelement <2 x double> poison, double %4, i64 0
%14 = insertelement <2 x double> %13, double %5, i64 1
%15 = insertelement <2 x double> poison, double %6, i64 0
%16 = insertelement <2 x double> %15, double %7, i64 1
br label %17
17: ; preds = %64, %8
%18 = phi <2 x double> [ %10, %8 ], [ %22, %64 ]
%19 = phi <2 x double> [ %12, %8 ], [ %66, %64 ]
%20 = phi <2 x double> [ %14, %8 ], [ %68, %64 ]
%21 = fadd <2 x double> %19, %20
%22 = fmul <2 x double> %21, <double 5.000000e-01, double 5.000000e-01>
%23 = extractelement <2 x double> %18, i64 0
%24 = extractelement <2 x double> %22, i64 0
%25 = fsub <2 x double> %18, %22
%26 = extractelement <2 x double> %25, i64 0
%27 = tail call i32 @fabs(double %26)
%28 = icmp slt i32 %27, 1
br i1 %28, label %29, label %37
29: ; preds = %17
%30 = fsub <2 x double> %18, %22
%31 = extractelement <2 x double> %30, i64 1
%32 = tail call i32 @fabs(double %31)
%33 = icmp slt i32 %32, 1
br i1 %33, label %34, label %37
34: ; preds = %29
%35 = extractelement <2 x double> %22, i64 1
%36 = tail call i32 @splinerel(double %24, double %35, i32 0)
br label %53
37: ; preds = %29, %17
%38 = extractelement <2 x double> %19, i64 0
%39 = fadd <2 x double> %18, %19
%40 = extractelement <2 x double> %39, i64 0
%41 = fmul double %40, 5.000000e-01
%42 = extractelement <2 x double> %18, i64 1
%43 = extractelement <2 x double> %19, i64 1
%44 = fadd double %42, %43
%45 = fmul double %44, 5.000000e-01
%46 = extractelement <2 x double> %20, i64 0
%47 = tail call double @llvm.fmuladd.f64(double %38, double 3.000000e+00, double %46)
%48 = fmul double %47, 2.500000e-01
%49 = extractelement <2 x double> %20, i64 1
%50 = tail call double @llvm.fmuladd.f64(double %43, double 3.000000e+00, double %49)
%51 = fmul double %50, 2.500000e-01
%52 = extractelement <2 x double> %22, i64 1
tail call void @quadratic_spline(double %23, double %42, double %41, double %45, double %48, double %51, double %24, double %52)
br label %53
53: ; preds = %37, %34
%54 = fsub double %24, %6
%55 = tail call i32 @fabs(double %54)
%56 = icmp slt i32 %55, 1
br i1 %56, label %57, label %64
57: ; preds = %53
%58 = extractelement <2 x double> %22, i64 1
%59 = fsub double %58, %7
%60 = tail call i32 @fabs(double %59)
%61 = icmp slt i32 %60, 1
br i1 %61, label %62, label %64
62: ; preds = %57
%63 = tail call i32 @splinerel(double %6, double %7, i32 0)
ret void
64: ; preds = %57, %53
%65 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %20, <2 x double> <double 3.000000e+00, double 3.000000e+00>, <2 x double> %19)
%66 = fmul <2 x double> %65, <double 2.500000e-01, double 2.500000e-01>
%67 = fadd <2 x double> %20, %16
%68 = fmul <2 x double> %67, <double 5.000000e-01, double 5.000000e-01>
br label %17
}