#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 dmean(double const *, int);
double *dvector(int);
double qnorm(double, int /*<<< orphan*/, int);
double standard_deviation(double const *, int, double);
double *boot_ci_norm(const double *thetas, int n, double theta_hat,
                     double alpha) {
  double pp = 1.0 - alpha;
  double qlb = (1.0 - pp) / 2.0;
  double qub = (1.0 - pp) / 2.0 + pp;
  double mean = dmean(thetas, n);
  double s = standard_deviation(thetas, n, mean);
  double *ci = dvector(2);
  ci[0] = theta_hat + qnorm(qlb, 0, 1) * s;
  ci[1] = theta_hat + qnorm(qub / 2.0, 0, 1) * s;
  return ci;
}


x86 assembly (clang, -O0):
<boot_ci_norm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movsd  %xmm0,-0x18(%rbp)
movsd  %xmm1,-0x20(%rbp)
movsd  0xea7(%rip),%xmm0
subsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  0xe95(%rip),%xmm0
subsd  -0x28(%rbp),%xmm0
movsd  0xe80(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  0xe77(%rip),%xmm0
subsd  -0x28(%rbp),%xmm0
movsd  0xe62(%rip),%xmm1
divsd  %xmm1,%xmm0
addsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1060 <dmean@plt>
movsd  %xmm0,-0x40(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
movsd  -0x40(%rbp),%xmm0
call   1030 <standard_deviation@plt>
movsd  %xmm0,-0x48(%rbp)
mov    $0x2,%edi
call   1040 <dvector@plt>
mov    %rax,-0x50(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x30(%rbp),%xmm0
xor    %edi,%edi
mov    $0x1,%esi
call   1050 <qnorm@plt>
movsd  -0x60(%rbp),%xmm1
movsd  -0x48(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x50(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x38(%rbp),%xmm0
movsd  0xdd3(%rip),%xmm1
divsd  %xmm1,%xmm0
xor    %edi,%edi
mov    $0x1,%esi
call   1050 <qnorm@plt>
movsd  -0x58(%rbp),%xmm1
movsd  -0x48(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x50(%rbp),%rax
movsd  %xmm0,0x8(%rax)
mov    -0x50(%rbp),%rax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<boot_ci_norm>:
push   %rbp
push   %rbx
sub    $0x28,%rsp
movsd  %xmm0,0x10(%rsp)
mov    %esi,%ebp
mov    %rdi,%rbx
movsd  0xea7(%rip),%xmm2
movapd %xmm2,%xmm0
subsd  %xmm1,%xmm0
subsd  %xmm0,%xmm2
mulsd  0xe9b(%rip),%xmm2
movsd  %xmm2,0x18(%rsp)
addsd  %xmm2,%xmm0
movsd  %xmm0,0x20(%rsp)
call   1060 <dmean@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
call   1030 <standard_deviation@plt>
movsd  %xmm0,0x8(%rsp)
mov    $0x2,%edi
call   1040 <dvector@plt>
mov    %rax,%rbx
movsd  0x18(%rsp),%xmm0
xor    %edi,%edi
mov    $0x1,%esi
call   1050 <qnorm@plt>
mulsd  0x8(%rsp),%xmm0
addsd  0x10(%rsp),%xmm0
movsd  %xmm0,(%rbx)
movsd  0x20(%rsp),%xmm0
mulsd  0xe39(%rip),%xmm0
xor    %edi,%edi
mov    $0x1,%esi
call   1050 <qnorm@plt>
mulsd  0x8(%rsp),%xmm0
addsd  0x10(%rsp),%xmm0
movsd  %xmm0,0x8(%rbx)
mov    %rbx,%rax
add    $0x28,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define double* @boot_ci_norm(double* %0, i32 %1, double %2, double %3) {
%5 = alloca double*
%6 = alloca i32
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double
%13 = alloca double
%14 = alloca double*
store double* %0, double** %5
store i32 %1, i32* %6
store double %2, double* %7
store double %3, double* %8
%15 = load double, double* %8
%16 = fsub double 1.000000e+00, %15
store double %16, double* %9
%17 = load double, double* %9
%18 = fsub double 1.000000e+00, %17
%19 = fdiv double %18, 2.000000e+00
store double %19, double* %10
%20 = load double, double* %9
%21 = fsub double 1.000000e+00, %20
%22 = fdiv double %21, 2.000000e+00
%23 = load double, double* %9
%24 = fadd double %22, %23
store double %24, double* %11
%25 = load double*, double** %5
%26 = load i32, i32* %6
%27 = call double @dmean(double* %25, i32 %26)
store double %27, double* %12
%28 = load double*, double** %5
%29 = load i32, i32* %6
%30 = load double, double* %12
%31 = call double @standard_deviation(double* %28, i32 %29, double %30)
store double %31, double* %13
%32 = call double* @dvector(i32 2)
store double* %32, double** %14
%33 = load double, double* %7
%34 = load double, double* %10
%35 = call double @qnorm(double %34, i32 0, i32 1)
%36 = load double, double* %13
%37 = call double @llvm.fmuladd.f64(double %35, double %36, double %33)
%38 = load double*, double** %14
%39 = getelementptr inbounds double, double* %38, i64 0
store double %37, double* %39
%40 = load double, double* %7
%41 = load double, double* %11
%42 = fdiv double %41, 2.000000e+00
%43 = call double @qnorm(double %42, i32 0, i32 1)
%44 = load double, double* %13
%45 = call double @llvm.fmuladd.f64(double %43, double %44, double %40)
%46 = load double*, double** %14
%47 = getelementptr inbounds double, double* %46, i64 1
store double %45, double* %47
%48 = load double*, double** %14
ret double* %48
}

LLVM IR (-O2):
define double* @boot_ci_norm(double* %0, i32 %1, double %2, double %3) {
%5 = fsub double 1.000000e+00, %3
%6 = fsub double 1.000000e+00, %5
%7 = fmul double %6, 5.000000e-01
%8 = fadd double %5, %7
%9 = tail call double @dmean(double* %0, i32 %1)
%10 = tail call double @standard_deviation(double* %0, i32 %1, double %9)
%11 = tail call double* @dvector(i32 2)
%12 = tail call double @qnorm(double %7, i32 0, i32 1)
%13 = tail call double @llvm.fmuladd.f64(double %12, double %10, double %2)
store double %13, double* %11
%14 = fmul double %8, 5.000000e-01
%15 = tail call double @qnorm(double %14, i32 0, i32 1)
%16 = tail call double @llvm.fmuladd.f64(double %15, double %10, double %2)
%17 = getelementptr inbounds double, double* %11, i64 1
store double %16, double* %17
ret double* %11
}