#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 cdfStandard(double);
double fabs(double);
double pdfStandard(double);
double idfStandard(double u) {
  double t, x = 0.0;
  do {
    t = x;
    x = t + (u - cdfStandard(t)) / pdfStandard(t);
  } while (fabs(x - t) >= 1.0e-10);
  return (x);
}


x86 assembly (clang, -O0):
<idfStandard>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1030 <cdfStandard@plt>
movaps %xmm0,%xmm1
movsd  -0x30(%rbp),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1040 <pdfStandard@plt>
movsd  -0x28(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x20(%rbp),%xmm0
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
movaps 0xe6d(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  0xe51(%rip),%xmm1
ucomisd %xmm1,%xmm0
jae    1135 <idfStandard+0x15>
movsd  -0x18(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<idfStandard>:
sub    $0x18,%rsp
movsd  %xmm0,0x8(%rsp)
xorpd  %xmm1,%xmm1
xchg   %ax,%ax
movsd  %xmm1,(%rsp)
movapd %xmm1,%xmm0
call   1030 <cdfStandard@plt>
movsd  0x8(%rsp),%xmm1
subsd  %xmm0,%xmm1
movsd  %xmm1,0x10(%rsp)
movsd  (%rsp),%xmm0
call   1040 <pdfStandard@plt>
movsd  0x10(%rsp),%xmm1
divsd  %xmm0,%xmm1
movsd  (%rsp),%xmm2
addsd  %xmm2,%xmm1
movapd %xmm1,%xmm0
subsd  %xmm2,%xmm0
andpd  0xe85(%rip),%xmm0
ucomisd 0xe8d(%rip),%xmm0
jae    1130 <idfStandard+0x10>
movapd %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @idfStandard(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
store double %0, double* %2
store double 0.000000e+00, double* %4
br label %5
5: ; preds = %16, %1
%6 = load double, double* %4
store double %6, double* %3
%7 = load double, double* %3
%8 = load double, double* %2
%9 = load double, double* %3
%10 = call double @cdfStandard(double %9)
%11 = fsub double %8, %10
%12 = load double, double* %3
%13 = call double @pdfStandard(double %12)
%14 = fdiv double %11, %13
%15 = fadd double %7, %14
store double %15, double* %4
br label %16
16: ; preds = %5
%17 = load double, double* %4
%18 = load double, double* %3
%19 = fsub double %17, %18
%20 = call double @llvm.fabs.f64(double %19)
%21 = fcmp oge double %20, 1.000000e-10
br i1 %21, label %5, label %22
22: ; preds = %16
%23 = load double, double* %4
ret double %23
}

LLVM IR (-O2):
define double @idfStandard(double %0) {
br label %2
2: ; preds = %2, %1
%3 = phi double [ 0.000000e+00, %1 ], [ %8, %2 ]
%4 = tail call double @cdfStandard(double %3)
%5 = fsub double %0, %4
%6 = tail call double @pdfStandard(double %3)
%7 = fdiv double %5, %6
%8 = fadd double %3, %7
%9 = fsub double %8, %3
%10 = tail call double @llvm.fabs.f64(double %9)
%11 = fcmp ult double %10, 1.000000e-10
br i1 %11, label %12, label %2
12: ; preds = %2
ret double %8
}