#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 mean(double *, int);
double pow(double, int);
double qt(double, int);
double residual(double, double, double, double);
double sqrt(double);
void CI_xIntercept(double *x, double *y, int n, double slope, double intercept,
                   double *lower, double *upper, double alpha) {
  double meanX = mean(x, n);
  double m11 = 0;
  double ss = 0;
  for (int i = 0; i < n; i++) {
    m11 += pow(x[i] - meanX, 2);
    ss += pow(residual(x[i], y[i], slope, intercept), 2);
  }
  ss /= (n - 2);
  double tstar = qt(alpha, n - 2);
  double g = (pow(tstar, 2) * ss) / (pow(slope, 2) * m11);
  double xIntercept = -intercept / slope;
  double left = (xIntercept - mean(x, n)) * g;
  double right = (tstar * sqrt(ss) / slope) *
                 sqrt(pow((xIntercept - meanX), 2) / m11 + (1 - g) / n);
  *lower = xIntercept + (left + right) / (1 - g);
  *upper = xIntercept + (left - right) / (1 - g);
}


x86 assembly (clang, -O0):
<CI_xIntercept>:
push   %rbp
mov    %rsp,%rbp
sub    $0xb0,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movsd  %xmm0,-0x20(%rbp)
movsd  %xmm1,-0x28(%rbp)
mov    %rcx,-0x30(%rbp)
mov    %r8,-0x38(%rbp)
movsd  %xmm2,-0x40(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1050 <mean@plt>
movsd  %xmm0,-0x48(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x50(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x58(%rbp)
movl   $0x0,-0x5c(%rbp)
mov    -0x5c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1222 <CI_xIntercept+0xd2>
mov    -0x8(%rbp),%rax
movslq -0x5c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
subsd  -0x48(%rbp),%xmm0
mov    $0x2,%edi
call   1040 <pow@plt>
addsd  -0x50(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x5c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x5c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
movsd  -0x20(%rbp),%xmm2
movsd  -0x28(%rbp),%xmm3
call   1030 <residual@plt>
mov    $0x2,%edi
call   1040 <pow@plt>
addsd  -0x58(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
mov    -0x5c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x5c(%rbp)
jmp    11a5 <CI_xIntercept+0x55>
mov    -0x14(%rbp),%eax
sub    $0x2,%eax
cvtsi2sd %eax,%xmm1
movsd  -0x58(%rbp),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x40(%rbp),%xmm0
mov    -0x14(%rbp),%edi
sub    $0x2,%edi
call   1070 <qt@plt>
movsd  %xmm0,-0x68(%rbp)
movsd  -0x68(%rbp),%xmm0
mov    $0x2,%edi
call   1040 <pow@plt>
mulsd  -0x58(%rbp),%xmm0
movsd  %xmm0,-0xa8(%rbp)
ff
movsd  -0x20(%rbp),%xmm0
mov    $0x2,%edi
call   1040 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0xa8(%rbp),%xmm0
ff
mulsd  -0x50(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x28(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
divsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x78(%rbp),%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1050 <mean@plt>
movaps %xmm0,%xmm1
movsd  -0xa0(%rbp),%xmm0
ff
subsd  %xmm1,%xmm0
mulsd  -0x70(%rbp),%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0x68(%rbp),%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
movsd  -0x58(%rbp),%xmm0
call   1060 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  -0x98(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
divsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
movsd  -0x78(%rbp),%xmm0
subsd  -0x48(%rbp),%xmm0
mov    $0x2,%edi
call   1040 <pow@plt>
divsd  -0x50(%rbp),%xmm0
movsd  0xcc1(%rip),%xmm1
subsd  -0x70(%rbp),%xmm1
cvtsi2sdl -0x14(%rbp),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
call   1060 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  -0x90(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
movsd  -0x78(%rbp),%xmm0
movsd  -0x80(%rbp),%xmm1
addsd  -0x88(%rbp),%xmm1
ff
movsd  0xc79(%rip),%xmm2
subsd  -0x70(%rbp),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
mov    -0x30(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x78(%rbp),%xmm0
movsd  -0x80(%rbp),%xmm1
subsd  -0x88(%rbp),%xmm1
ff
movsd  0xc4a(%rip),%xmm2
subsd  -0x70(%rbp),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
mov    -0x38(%rbp),%rax
movsd  %xmm0,(%rax)
add    $0xb0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CI_xIntercept>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x68,%rsp
movsd  %xmm2,0x10(%rsp)
mov    %r8,0x60(%rsp)
mov    %rcx,%r15
movapd %xmm1,0x40(%rsp)
movsd  %xmm0,0x18(%rsp)
mov    %edx,%r12d
mov    %rsi,%r13
mov    %rdi,%rbx
mov    %edx,%esi
call   1050 <mean@plt>
movapd %xmm0,%xmm2
xorpd  %xmm1,%xmm1
xorpd  %xmm0,%xmm0
movsd  %xmm0,0x8(%rsp)
test   %r12d,%r12d
movsd  %xmm2,0x58(%rsp)
jle    122a <CI_xIntercept+0xda>
mov    %r12d,%ebp
xorpd  %xmm0,%xmm0
movsd  %xmm0,0x8(%rsp)
xor    %r14d,%r14d
xorpd  %xmm1,%xmm1
nopl   (%rax)
movsd  %xmm1,0x20(%rsp)
movsd  (%rbx,%r14,8),%xmm0
subsd  %xmm2,%xmm0
mov    $0x2,%edi
call   1040 <pow@plt>
movsd  0x8(%rsp),%xmm1
addsd  %xmm0,%xmm1
movsd  %xmm1,0x8(%rsp)
movsd  (%rbx,%r14,8),%xmm0
movsd  0x0(%r13,%r14,8),%xmm1
movsd  0x18(%rsp),%xmm2
movaps 0x40(%rsp),%xmm3
call   1030 <residual@plt>
mov    $0x2,%edi
call   1040 <pow@plt>
movsd  0x58(%rsp),%xmm2
movsd  0x20(%rsp),%xmm1
addsd  %xmm0,%xmm1
add    $0x1,%r14
cmp    %r14,%rbp
jne    11c0 <CI_xIntercept+0x70>
lea    -0x2(%r12),%edi
xorps  %xmm0,%xmm0
cvtsi2sd %edi,%xmm0
divsd  %xmm0,%xmm1
movsd  %xmm1,0x20(%rsp)
movsd  0x10(%rsp),%xmm0
call   1070 <qt@plt>
movsd  %xmm0,0x38(%rsp)
mov    $0x2,%edi
call   1040 <pow@plt>
mulsd  0x20(%rsp),%xmm0
movsd  %xmm0,0x10(%rsp)
movsd  0x18(%rsp),%xmm0
mov    $0x2,%edi
call   1040 <pow@plt>
mulsd  0x8(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
divsd  %xmm0,%xmm1
movsd  %xmm1,0x10(%rsp)
movapd 0x40(%rsp),%xmm0
xorpd  0xd65(%rip),%xmm0
divsd  0x18(%rsp),%xmm0
movapd %xmm0,0x40(%rsp)
mov    %rbx,%rdi
mov    %r12d,%esi
call   1050 <mean@plt>
movsd  0x20(%rsp),%xmm2
movapd 0x40(%rsp),%xmm1
movapd %xmm1,%xmm3
subsd  %xmm0,%xmm3
ucomisd 0xd4a(%rip),%xmm2
jb     12d9 <CI_xIntercept+0x189>
xorps  %xmm0,%xmm0
sqrtsd %xmm2,%xmm0
jmp    12f4 <CI_xIntercept+0x1a4>
movapd %xmm2,%xmm0
movapd %xmm3,0x20(%rsp)
call   1060 <sqrt@plt>
movapd 0x20(%rsp),%xmm3
movapd 0x40(%rsp),%xmm1
mulsd  0x10(%rsp),%xmm3
movapd %xmm3,0x20(%rsp)
movsd  0x38(%rsp),%xmm2
mulsd  %xmm0,%xmm2
divsd  0x18(%rsp),%xmm2
movsd  %xmm2,0x38(%rsp)
movapd %xmm1,%xmm0
subsd  0x58(%rsp),%xmm0
mov    $0x2,%edi
call   1040 <pow@plt>
movapd %xmm0,%xmm1
divsd  0x8(%rsp),%xmm1
movsd  0xcd4(%rip),%xmm4
subsd  0x10(%rsp),%xmm4
xorps  %xmm2,%xmm2
cvtsi2sd %r12d,%xmm2
movapd %xmm4,%xmm0
divsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     1366 <CI_xIntercept+0x216>
sqrtsd %xmm0,%xmm0
jmp    1377 <CI_xIntercept+0x227>
movsd  %xmm4,0x8(%rsp)
call   1060 <sqrt@plt>
movsd  0x8(%rsp),%xmm4
movsd  0x38(%rsp),%xmm2
mulsd  %xmm0,%xmm2
movapd 0x20(%rsp),%xmm3
movapd %xmm3,%xmm0
addsd  %xmm2,%xmm0
divsd  %xmm4,%xmm0
movapd 0x40(%rsp),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,(%r15)
subsd  %xmm2,%xmm3
divsd  %xmm4,%xmm3
addsd  %xmm1,%xmm3
mov    0x60(%rsp),%rax
movsd  %xmm3,(%rax)
add    $0x68,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @CI_xIntercept(double* %0, double* %1, i32 %2, double %3, double %4, double* %5, double* %6, double %7) {
%9 = alloca double*
%10 = alloca double*
%11 = alloca i32
%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 i32
%21 = alloca double
%22 = alloca double
%23 = alloca double
%24 = alloca double
%25 = alloca double
store double* %0, double** %9
store double* %1, double** %10
store i32 %2, i32* %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
%26 = load double*, double** %9
%27 = load i32, i32* %11
%28 = call double @mean(double* %26, i32 %27)
store double %28, double* %17
store double 0.000000e+00, double* %18
store double 0.000000e+00, double* %19
store i32 0, i32* %20
br label %29
29: ; preds = %60, %8
%30 = load i32, i32* %20
%31 = load i32, i32* %11
%32 = icmp slt i32 %30, %31
br i1 %32, label %33, label %63
33: ; preds = %29
%34 = load double*, double** %9
%35 = load i32, i32* %20
%36 = sext i32 %35 to i64
%37 = getelementptr inbounds double, double* %34, i64 %36
%38 = load double, double* %37
%39 = load double, double* %17
%40 = fsub double %38, %39
%41 = call double @pow(double %40, i32 2)
%42 = load double, double* %18
%43 = fadd double %42, %41
store double %43, double* %18
%44 = load double*, double** %9
%45 = load i32, i32* %20
%46 = sext i32 %45 to i64
%47 = getelementptr inbounds double, double* %44, i64 %46
%48 = load double, double* %47
%49 = load double*, double** %10
%50 = load i32, i32* %20
%51 = sext i32 %50 to i64
%52 = getelementptr inbounds double, double* %49, i64 %51
%53 = load double, double* %52
%54 = load double, double* %12
%55 = load double, double* %13
%56 = call double @residual(double %48, double %53, double %54, double %55)
%57 = call double @pow(double %56, i32 2)
%58 = load double, double* %19
%59 = fadd double %58, %57
store double %59, double* %19
br label %60
60: ; preds = %33
%61 = load i32, i32* %20
%62 = add nsw i32 %61, 1
store i32 %62, i32* %20
br label %29
63: ; preds = %29
%64 = load i32, i32* %11
%65 = sub nsw i32 %64, 2
%66 = sitofp i32 %65 to double
%67 = load double, double* %19
%68 = fdiv double %67, %66
store double %68, double* %19
%69 = load double, double* %16
%70 = load i32, i32* %11
%71 = sub nsw i32 %70, 2
%72 = call double @qt(double %69, i32 %71)
store double %72, double* %21
%73 = load double, double* %21
%74 = call double @pow(double %73, i32 2)
%75 = load double, double* %19
%76 = fmul double %74, %75
%77 = load double, double* %12
%78 = call double @pow(double %77, i32 2)
%79 = load double, double* %18
%80 = fmul double %78, %79
%81 = fdiv double %76, %80
store double %81, double* %22
%82 = load double, double* %13
%83 = fneg double %82
%84 = load double, double* %12
%85 = fdiv double %83, %84
store double %85, double* %23
%86 = load double, double* %23
%87 = load double*, double** %9
%88 = load i32, i32* %11
%89 = call double @mean(double* %87, i32 %88)
%90 = fsub double %86, %89
%91 = load double, double* %22
%92 = fmul double %90, %91
store double %92, double* %24
%93 = load double, double* %21
%94 = load double, double* %19
%95 = call double @sqrt(double %94)
%96 = fmul double %93, %95
%97 = load double, double* %12
%98 = fdiv double %96, %97
%99 = load double, double* %23
%100 = load double, double* %17
%101 = fsub double %99, %100
%102 = call double @pow(double %101, i32 2)
%103 = load double, double* %18
%104 = fdiv double %102, %103
%105 = load double, double* %22
%106 = fsub double 1.000000e+00, %105
%107 = load i32, i32* %11
%108 = sitofp i32 %107 to double
%109 = fdiv double %106, %108
%110 = fadd double %104, %109
%111 = call double @sqrt(double %110)
%112 = fmul double %98, %111
store double %112, double* %25
%113 = load double, double* %23
%114 = load double, double* %24
%115 = load double, double* %25
%116 = fadd double %114, %115
%117 = load double, double* %22
%118 = fsub double 1.000000e+00, %117
%119 = fdiv double %116, %118
%120 = fadd double %113, %119
%121 = load double*, double** %14
store double %120, double* %121
%122 = load double, double* %23
%123 = load double, double* %24
%124 = load double, double* %25
%125 = fsub double %123, %124
%126 = load double, double* %22
%127 = fsub double 1.000000e+00, %126
%128 = fdiv double %125, %127
%129 = fadd double %122, %128
%130 = load double*, double** %15
store double %129, double* %130
ret void
}

LLVM IR (-O2):
define void @CI_xIntercept(double* %0, double* nocapture %1, i32 %2, double %3, double %4, double* nocapture writeonly %5, double* nocapture writeonly %6, double %7) {
%9 = tail call double @mean(double* %0, i32 %2)
%10 = icmp sgt i32 %2, 0
br i1 %10, label %11, label %13
11: ; preds = %8
%12 = zext i32 %2 to i64
br label %48
13: ; preds = %48, %8
%14 = phi double [ 0.000000e+00, %8 ], [ %62, %48 ]
%15 = phi double [ 0.000000e+00, %8 ], [ %56, %48 ]
%16 = add nsw i32 %2, -2
%17 = sitofp i32 %16 to double
%18 = fdiv double %14, %17
%19 = tail call double @qt(double %7, i32 %16)
%20 = tail call double @pow(double %19, i32 2)
%21 = fmul double %18, %20
%22 = tail call double @pow(double %3, i32 2)
%23 = fmul double %15, %22
%24 = fdiv double %21, %23
%25 = fneg double %4
%26 = fdiv double %25, %3
%27 = tail call double @mean(double* %0, i32 %2)
%28 = fsub double %26, %27
%29 = fmul double %28, %24
%30 = tail call double @sqrt(double %18)
%31 = fmul double %19, %30
%32 = fdiv double %31, %3
%33 = fsub double %26, %9
%34 = tail call double @pow(double %33, i32 2)
%35 = fdiv double %34, %15
%36 = fsub double 1.000000e+00, %24
%37 = sitofp i32 %2 to double
%38 = fdiv double %36, %37
%39 = fadd double %35, %38
%40 = tail call double @sqrt(double %39)
%41 = fmul double %32, %40
%42 = fadd double %29, %41
%43 = fdiv double %42, %36
%44 = fadd double %26, %43
store double %44, double* %5
%45 = fsub double %29, %41
%46 = fdiv double %45, %36
%47 = fadd double %26, %46
store double %47, double* %6
ret void
48: ; preds = %11, %48
%49 = phi i64 [ 0, %11 ], [ %63, %48 ]
%50 = phi double [ 0.000000e+00, %11 ], [ %56, %48 ]
%51 = phi double [ 0.000000e+00, %11 ], [ %62, %48 ]
%52 = getelementptr inbounds double, double* %0, i64 %49
%53 = load double, double* %52
%54 = fsub double %53, %9
%55 = tail call double @pow(double %54, i32 2)
%56 = fadd double %50, %55
%57 = load double, double* %52
%58 = getelementptr inbounds double, double* %1, i64 %49
%59 = load double, double* %58
%60 = tail call double @residual(double %57, double %59, double %3, double %4)
%61 = tail call double @pow(double %60, i32 2)
%62 = fadd double %51, %61
%63 = add nuw nsw i64 %49, 1
%64 = icmp eq i64 %63, %12
br i1 %64, label %13, label %48
}