#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 log(double);
double sqrt(double);
double psi_h_unstable(double zeta, double zeta0) {
  const double y = sqrt(1.0 - 9.0 * zeta);
  const double y0 = sqrt(1.0 - 9.0 * zeta0);
  double psi_h = 2.0 * log((1.0 + y) / (1.0 + y0));
  return psi_h;
}


x86 assembly (clang, -O0):
<psi_h_unstable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xed1(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xebd(%rip),%xmm1
addsd  %xmm1,%xmm0
call   1040 <sqrt@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xeaa(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe96(%rip),%xmm1
addsd  %xmm1,%xmm0
call   1040 <sqrt@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  0xe80(%rip),%xmm0
addsd  -0x18(%rbp),%xmm0
movsd  0xe73(%rip),%xmm1
addsd  -0x20(%rbp),%xmm1
divsd  %xmm1,%xmm0
call   1030 <log@plt>
movaps %xmm0,%xmm1
movsd  0xe52(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<psi_h_unstable>:
push   %rax
mulsd  0xed7(%rip),%xmm0
addsd  0xed7(%rip),%xmm0
xorpd  %xmm3,%xmm3
ucomisd %xmm3,%xmm0
jb     1141 <psi_h_unstable+0x21>
sqrtsd %xmm0,%xmm2
jmp    1158 <psi_h_unstable+0x38>
movsd  %xmm1,(%rsp)
call   1040 <sqrt@plt>
xorpd  %xmm3,%xmm3
movsd  (%rsp),%xmm1
movapd %xmm0,%xmm2
mulsd  0xea0(%rip),%xmm1
addsd  0xea0(%rip),%xmm1
ucomisd %xmm3,%xmm1
jb     1177 <psi_h_unstable+0x57>
xorps  %xmm0,%xmm0
sqrtsd %xmm1,%xmm0
jmp    118a <psi_h_unstable+0x6a>
movapd %xmm1,%xmm0
movsd  %xmm2,(%rsp)
call   1040 <sqrt@plt>
movsd  (%rsp),%xmm2
movsd  0xe76(%rip),%xmm1
addsd  %xmm1,%xmm2
addsd  %xmm1,%xmm0
divsd  %xmm0,%xmm2
movapd %xmm2,%xmm0
call   1030 <log@plt>
addsd  %xmm0,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @psi_h_unstable(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
store double %0, double* %3
store double %1, double* %4
%8 = load double, double* %3
%9 = call double @llvm.fmuladd.f64(double -9.000000e+00, double %8, double 1.000000e+00)
%10 = call double @sqrt(double %9)
store double %10, double* %5
%11 = load double, double* %4
%12 = call double @llvm.fmuladd.f64(double -9.000000e+00, double %11, double 1.000000e+00)
%13 = call double @sqrt(double %12)
store double %13, double* %6
%14 = load double, double* %5
%15 = fadd double 1.000000e+00, %14
%16 = load double, double* %6
%17 = fadd double 1.000000e+00, %16
%18 = fdiv double %15, %17
%19 = call double @log(double %18)
%20 = fmul double 2.000000e+00, %19
store double %20, double* %7
%21 = load double, double* %7
ret double %21
}

LLVM IR (-O2):
define double @psi_h_unstable(double %0, double %1) {
%3 = tail call double @llvm.fmuladd.f64(double %0, double -9.000000e+00, double 1.000000e+00)
%4 = tail call double @sqrt(double %3)
%5 = tail call double @llvm.fmuladd.f64(double %1, double -9.000000e+00, double 1.000000e+00)
%6 = tail call double @sqrt(double %5)
%7 = fadd double %4, 1.000000e+00
%8 = fadd double %6, 1.000000e+00
%9 = fdiv double %7, %8
%10 = tail call double @log(double %9)
%11 = fmul double %10, 2.000000e+00
ret double %11
}