#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 fabs(double);
double sqrt(double);
Interp(double ym, double y0, double yp, double *xe, double *ye, double *z1,
       double *z2, int *nz) {
  double a, b, c, d, dx;
  *nz = 0;
  a = 0.5 * (ym + yp) - y0;
  b = 0.5 * (yp - ym);
  c = y0;
  *xe = -b / (2.0 * a);
  *ye = (a * (*xe) + b) * (*xe) + c;
  d = b * b - 4.0 * a * c;
  if (d >= 0) {
    dx = 0.5 * sqrt(d) / fabs(a);
    *z1 = *xe - dx;
    *z2 = *xe + dx;
    if (fabs(*z1) <= 1.0)
      *nz += 1;
    if (fabs(*z2) <= 1.0)
      *nz += 1;
    if (*z1 < -1.0)
      *z1 = *z2;
  }
  return (0);
}


x86 assembly (clang, -O0):
<Interp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
mov    %rdi,-0x20(%rbp)
mov    %rsi,-0x28(%rbp)
mov    %rdx,-0x30(%rbp)
mov    %rcx,-0x38(%rbp)
mov    %r8,-0x40(%rbp)
mov    -0x40(%rbp),%rax
movl   $0x0,(%rax)
movsd  -0x8(%rbp),%xmm0
addsd  -0x18(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
movsd  0xe9d(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x18(%rbp),%xmm1
subsd  -0x8(%rbp),%xmm1
movsd  0xe7e(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x50(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  0xe3f(%rip),%xmm1
mulsd  -0x48(%rbp),%xmm1
divsd  %xmm1,%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x48(%rbp),%xmm0
mov    -0x20(%rbp),%rax
movsd  (%rax),%xmm2
movsd  -0x50(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x20(%rbp),%rax
movsd  (%rax),%xmm2
movsd  -0x58(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x28(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x50(%rbp),%xmm0
movsd  -0x50(%rbp),%xmm2
movsd  0xddd(%rip),%xmm1
mulsd  -0x48(%rbp),%xmm1
mulsd  -0x58(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x60(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     134a <Interp+0x23a>
movsd  -0x60(%rbp),%xmm0
call   1030 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  0xd98(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  -0x48(%rbp),%xmm1
movaps 0xda8(%rip),%xmm2
pand   %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
mov    -0x20(%rbp),%rax
movsd  (%rax),%xmm0
subsd  -0x68(%rbp),%xmm0
mov    -0x30(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x20(%rbp),%rax
movsd  (%rax),%xmm0
addsd  -0x68(%rbp),%xmm0
mov    -0x38(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x30(%rbp),%rax
movsd  (%rax),%xmm1
movaps 0xd62(%rip),%xmm0
pand   %xmm0,%xmm1
movsd  0xd3e(%rip),%xmm0
ucomisd %xmm1,%xmm0
jb     12ef <Interp+0x1df>
mov    -0x40(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
mov    -0x38(%rbp),%rax
movsd  (%rax),%xmm1
movaps 0xd32(%rip),%xmm0
pand   %xmm0,%xmm1
movsd  0xd0e(%rip),%xmm0
ucomisd %xmm1,%xmm0
jb     131f <Interp+0x20f>
mov    -0x40(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
mov    -0x30(%rbp),%rax
movsd  0xcf5(%rip),%xmm0
ucomisd (%rax),%xmm0
jbe    1345 <Interp+0x235>
mov    -0x38(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x30(%rbp),%rax
movsd  %xmm0,(%rax)
jmp    134a <Interp+0x23a>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Interp>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x18,%rsp
movl   $0x0,(%r8)
movapd %xmm0,%xmm4
addsd  %xmm2,%xmm4
movsd  0xece(%rip),%xmm3
mulsd  %xmm3,%xmm4
subsd  %xmm1,%xmm4
subsd  %xmm0,%xmm2
mulsd  %xmm3,%xmm2
movapd 0xed6(%rip),%xmm0
xorpd  %xmm2,%xmm0
movapd %xmm4,%xmm3
addsd  %xmm4,%xmm3
divsd  %xmm3,%xmm0
movsd  %xmm0,(%rdi)
movapd %xmm4,%xmm3
mulsd  %xmm0,%xmm3
addsd  %xmm2,%xmm3
mulsd  %xmm0,%xmm3
addsd  %xmm1,%xmm3
movsd  %xmm3,(%rsi)
movsd  0xe8a(%rip),%xmm0
mulsd  %xmm4,%xmm0
mulsd  %xmm1,%xmm0
mulsd  %xmm2,%xmm2
addsd  %xmm0,%xmm2
xorpd  %xmm0,%xmm0
ucomisd %xmm0,%xmm2
jb     123a <Interp+0x12a>
mov    %r8,%r12
mov    %rcx,%r15
mov    %rdx,%r14
mov    %rdi,%rbx
jb     11b3 <Interp+0xa3>
xorps  %xmm0,%xmm0
sqrtsd %xmm2,%xmm0
jmp    11c6 <Interp+0xb6>
movapd %xmm2,%xmm0
movapd %xmm4,(%rsp)
call   1030 <sqrt@plt>
movapd (%rsp),%xmm4
mulsd  0xe32(%rip),%xmm0
movapd 0xe5a(%rip),%xmm3
andpd  %xmm3,%xmm4
divsd  %xmm4,%xmm0
movsd  (%rbx),%xmm1
subsd  %xmm0,%xmm1
movsd  %xmm1,(%r14)
addsd  (%rbx),%xmm0
movsd  %xmm0,(%r15)
movsd  (%r14),%xmm1
andpd  %xmm1,%xmm3
movsd  0xe0b(%rip),%xmm2
ucomisd %xmm3,%xmm2
jb     1210 <Interp+0x100>
addl   $0x1,(%r12)
movapd 0xe18(%rip),%xmm3
andpd  %xmm0,%xmm3
ucomisd %xmm3,%xmm2
jb     1227 <Interp+0x117>
addl   $0x1,(%r12)
movsd  0xde9(%rip),%xmm2
ucomisd %xmm1,%xmm2
jbe    123a <Interp+0x12a>
movsd  %xmm0,(%r14)
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i32 @Interp(double %0, double %1, double %2, double* nocapture %3, double* nocapture writeonly %4, double* nocapture %5, double* nocapture %6, i32* nocapture %7) {
store i32 0, i32* %7
%9 = fadd double %0, %2
%10 = fneg double %1
%11 = tail call double @llvm.fmuladd.f64(double %9, double 5.000000e-01, double %10)
%12 = fsub double %2, %0
%13 = fmul double %12, 5.000000e-01
%14 = fneg double %13
%15 = fmul double %11, 2.000000e+00
%16 = fdiv double %14, %15
store double %16, double* %3
%17 = tail call double @llvm.fmuladd.f64(double %11, double %16, double %13)
%18 = tail call double @llvm.fmuladd.f64(double %17, double %16, double %1)
store double %18, double* %4
%19 = fmul double %11, -4.000000e+00
%20 = fmul double %19, %1
%21 = tail call double @llvm.fmuladd.f64(double %13, double %13, double %20)
%22 = fcmp ult double %21, 0.000000e+00
br i1 %22, label %47, label %23
23: ; preds = %8
%24 = tail call double @sqrt(double %21)
%25 = fmul double %24, 5.000000e-01
%26 = tail call double @llvm.fabs.f64(double %11)
%27 = fdiv double %25, %26
%28 = load double, double* %3
%29 = fsub double %28, %27
store double %29, double* %5
%30 = load double, double* %3
%31 = fadd double %27, %30
store double %31, double* %6
%32 = load double, double* %5
%33 = tail call double @llvm.fabs.f64(double %32)
%34 = fcmp ugt double %33, 1.000000e+00
br i1 %34, label %38, label %35
35: ; preds = %23
%36 = load i32, i32* %7
%37 = add nsw i32 %36, 1
store i32 %37, i32* %7
br label %38
38: ; preds = %35, %23
%39 = tail call double @llvm.fabs.f64(double %31)
%40 = fcmp ugt double %39, 1.000000e+00
br i1 %40, label %44, label %41
41: ; preds = %38
%42 = load i32, i32* %7
%43 = add nsw i32 %42, 1
store i32 %43, i32* %7
br label %44
44: ; preds = %41, %38
%45 = fcmp olt double %32, -1.000000e+00
br i1 %45, label %46, label %47
46: ; preds = %44
store double %31, double* %5
br label %47
47: ; preds = %44, %46, %8
ret i32 0
}