#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 */
int /*<<< orphan*/ log(int);
double sqrt(int /*<<< orphan*/);
double xp(float p) {
  double t;
  if (p > (float)0.5)
    p = (float)1. - p;
  t = sqrt(log(1 / (p * p)));
  return t - (2.30753 + 0.27061 * t) / (1 + 0.99229 * t + 0.04481 * t * t);
}


x86 assembly (clang, -O0):
<xp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  0xec6(%rip),%xmm1
ucomiss %xmm1,%xmm0
jbe    1155 <xp+0x35>
movss  0xeb9(%rip),%xmm0
subss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm1
mulss  -0x4(%rbp),%xmm1
movss  0xe9d(%rip),%xmm0
divss  %xmm1,%xmm0
cvttss2si %xmm0,%edi
call   1030 <log@plt>
mov    %eax,%edi
call   1040 <sqrt@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  0xe8e(%rip),%xmm2
mulsd  %xmm2,%xmm1
movsd  0xe8a(%rip),%xmm2
addsd  %xmm2,%xmm1
movsd  -0x10(%rbp),%xmm3
movsd  0xe61(%rip),%xmm2
mulsd  %xmm2,%xmm3
movsd  0xe5d(%rip),%xmm2
addsd  %xmm2,%xmm3
movsd  0xe41(%rip),%xmm2
mulsd  -0x10(%rbp),%xmm2
movsd  -0x10(%rbp),%xmm4
mulsd  %xmm4,%xmm2
addsd  %xmm3,%xmm2
divsd  %xmm2,%xmm1
subsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xp>:
push   %rax
movss  0xed7(%rip),%xmm1
movaps %xmm1,%xmm2
subss  %xmm0,%xmm2
movss  0xecc(%rip),%xmm3
cmpltss %xmm0,%xmm3
andps  %xmm3,%xmm2
andnps %xmm0,%xmm3
orps   %xmm2,%xmm3
mulss  %xmm3,%xmm3
divss  %xmm3,%xmm1
cvttss2si %xmm1,%edi
call   1030 <log@plt>
mov    %eax,%edi
call   1040 <sqrt@plt>
movsd  0xea2(%rip),%xmm1
mulsd  %xmm0,%xmm1
addsd  0xe9e(%rip),%xmm1
movsd  0xe9e(%rip),%xmm2
mulsd  %xmm0,%xmm2
addsd  0xe9a(%rip),%xmm2
movsd  0xe9a(%rip),%xmm3
mulsd  %xmm0,%xmm3
mulsd  %xmm0,%xmm3
addsd  %xmm2,%xmm3
divsd  %xmm3,%xmm1
subsd  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @xp(float %0) {
%2 = alloca float
%3 = alloca double
store float %0, float* %2
%4 = load float, float* %2
%5 = fcmp ogt float %4, 5.000000e-01
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load float, float* %2
%8 = fsub float 1.000000e+00, %7
store float %8, float* %2
br label %9
9: ; preds = %6, %1
%10 = load float, float* %2
%11 = load float, float* %2
%12 = fmul float %10, %11
%13 = fdiv float 1.000000e+00, %12
%14 = fptosi float %13 to i32
%15 = call i32 @log(i32 %14)
%16 = call double @sqrt(i32 %15)
store double %16, double* %3
%17 = load double, double* %3
%18 = load double, double* %3
%19 = call double @llvm.fmuladd.f64(double 2.706100e-01, double %18, double 2.307530e+00)
%20 = load double, double* %3
%21 = call double @llvm.fmuladd.f64(double 9.922900e-01, double %20, double 1.000000e+00)
%22 = load double, double* %3
%23 = fmul double 4.481000e-02, %22
%24 = load double, double* %3
%25 = call double @llvm.fmuladd.f64(double %23, double %24, double %21)
%26 = fdiv double %19, %25
%27 = fsub double %17, %26
ret double %27
}

LLVM IR (-O2):
define double @xp(float %0) {
%2 = fcmp ogt float %0, 5.000000e-01
%3 = fsub float 1.000000e+00, %0
%4 = select i1 %2, float %3, float %0
%5 = fmul float %4, %4
%6 = fdiv float 1.000000e+00, %5
%7 = fptosi float %6 to i32
%8 = tail call i32 @log(i32 %7)
%9 = tail call double @sqrt(i32 %8)
%10 = tail call double @llvm.fmuladd.f64(double %9, double 2.706100e-01, double 2.307530e+00)
%11 = tail call double @llvm.fmuladd.f64(double %9, double 9.922900e-01, double 1.000000e+00)
%12 = fmul double %9, 4.481000e-02
%13 = tail call double @llvm.fmuladd.f64(double %12, double %9, double %11)
%14 = fdiv double %10, %13
%15 = fsub double %9, %14
ret double %15
}