#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 sqrt(double);
void Plim_Binom(double pH0, int N, double *pinf, double *psup) {
  *pinf = pH0 - 1.64 * sqrt(pH0 * (1 - pH0) / (double)N);
  if (*pinf < 0)
    *pinf = .0;
  *psup = pH0 + 1.64 * sqrt(pH0 * (1 - pH0) / (double)N);
}


x86 assembly (clang, -O0):
<Plim_Binom>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %edi,-0xc(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xec9(%rip),%xmm1
subsd  -0x8(%rbp),%xmm1
mulsd  %xmm1,%xmm0
cvtsi2sdl -0xc(%rbp),%xmm1
divsd  %xmm1,%xmm0
call   1030 <sqrt@plt>
movsd  -0x28(%rbp),%xmm1
movsd  0xe9d(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x18(%rbp),%rax
xorps  %xmm0,%xmm0
ucomisd (%rax),%xmm0
jbe    118f <Plim_Binom+0x7f>
mov    -0x18(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xe62(%rip),%xmm1
subsd  -0x8(%rbp),%xmm1
mulsd  %xmm1,%xmm0
cvtsi2sdl -0xc(%rbp),%xmm1
divsd  %xmm1,%xmm0
call   1030 <sqrt@plt>
movsd  -0x30(%rbp),%xmm1
movsd  0xe46(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,(%rax)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Plim_Binom>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %rdx,%r14
mov    %rsi,%rbx
movapd %xmm0,%xmm1
movsd  0xed7(%rip),%xmm2
subsd  %xmm0,%xmm2
mulsd  %xmm0,%xmm2
xorps  %xmm0,%xmm0
cvtsi2sd %edi,%xmm0
divsd  %xmm0,%xmm2
sqrtsd %xmm2,%xmm3
xorpd  %xmm4,%xmm4
ucomisd %xmm4,%xmm2
movapd %xmm3,%xmm0
movsd  %xmm1,(%rsp)
jae    117d <Plim_Binom+0x6d>
movapd %xmm2,%xmm0
movsd  %xmm2,0x10(%rsp)
movsd  %xmm3,0x8(%rsp)
call   1030 <sqrt@plt>
xorpd  %xmm4,%xmm4
movsd  0x8(%rsp),%xmm3
movsd  0x10(%rsp),%xmm2
movsd  (%rsp),%xmm1
mulsd  0xe83(%rip),%xmm0
addsd  %xmm1,%xmm0
ucomisd %xmm4,%xmm2
maxsd  %xmm0,%xmm4
movsd  %xmm4,(%rbx)
jae    11a9 <Plim_Binom+0x99>
movapd %xmm2,%xmm0
call   1030 <sqrt@plt>
movsd  (%rsp),%xmm1
movapd %xmm0,%xmm3
mulsd  0xe5f(%rip),%xmm3
addsd  %xmm1,%xmm3
movsd  %xmm3,(%r14)
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @Plim_Binom(double %0, i32 %1, double* %2, double* %3) {
%5 = alloca double
%6 = alloca i32
%7 = alloca double*
%8 = alloca double*
store double %0, double* %5
store i32 %1, i32* %6
store double* %2, double** %7
store double* %3, double** %8
%9 = load double, double* %5
%10 = load double, double* %5
%11 = load double, double* %5
%12 = fsub double 1.000000e+00, %11
%13 = fmul double %10, %12
%14 = load i32, i32* %6
%15 = sitofp i32 %14 to double
%16 = fdiv double %13, %15
%17 = call double @sqrt(double %16)
%18 = call double @llvm.fmuladd.f64(double -1.640000e+00, double %17, double %9)
%19 = load double*, double** %7
store double %18, double* %19
%20 = load double*, double** %7
%21 = load double, double* %20
%22 = fcmp olt double %21, 0.000000e+00
br i1 %22, label %23, label %25
23: ; preds = %4
%24 = load double*, double** %7
store double 0.000000e+00, double* %24
br label %25
25: ; preds = %23, %4
%26 = load double, double* %5
%27 = load double, double* %5
%28 = load double, double* %5
%29 = fsub double 1.000000e+00, %28
%30 = fmul double %27, %29
%31 = load i32, i32* %6
%32 = sitofp i32 %31 to double
%33 = fdiv double %30, %32
%34 = call double @sqrt(double %33)
%35 = call double @llvm.fmuladd.f64(double 1.640000e+00, double %34, double %26)
%36 = load double*, double** %8
store double %35, double* %36
ret void
}

LLVM IR (-O2):
define void @Plim_Binom(double %0, i32 %1, double* nocapture writeonly %2, double* nocapture writeonly %3) {
%5 = fsub double 1.000000e+00, %0
%6 = fmul double %5, %0
%7 = sitofp i32 %1 to double
%8 = fdiv double %6, %7
%9 = tail call double @sqrt(double %8)
%10 = tail call double @llvm.fmuladd.f64(double %9, double -1.640000e+00, double %0)
%11 = fcmp olt double %10, 0.000000e+00
%12 = select i1 %11, double 0.000000e+00, double %10
store double %12, double* %2
%13 = tail call double @sqrt(double %8)
%14 = tail call double @llvm.fmuladd.f64(double %13, double 1.640000e+00, double %0)
store double %14, double* %3
ret void
}