#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 */
long double expm1l(long double const);
long double log1pl(long double);
double hsl_sf_hZeta0_zed(const double s, const double q) {
  const long double ld_q = (long double)(q);
  const long double ld_s = (long double)(s);
  const long double ld_log1prq = log1pl(1.0L / ld_q);
  const long double ld_epsilon = expm1l(-ld_s * ld_log1prq);
  const long double ld_z = ld_s + (ld_q + 0.5L * ld_s + 0.5L) * ld_epsilon;
  const double z = (double)(ld_z);
  return (z);
}


x86 assembly (clang, -O0):
<hsl_sf_hZeta0_zed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
fldl   -0x10(%rbp)
fstpt  -0x20(%rbp)
fldl   -0x8(%rbp)
fstpt  -0x30(%rbp)
fldt   -0x20(%rbp)
fld1
fdivp  %st,%st(1)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <log1pl@plt>
fstpt  -0x40(%rbp)
fldt   -0x30(%rbp)
fchs
fldt   -0x40(%rbp)
fmulp  %st,%st(1)
mov    %rsp,%rax
fstpt  (%rax)
call   1040 <expm1l@plt>
fstpt  -0x50(%rbp)
fldt   -0x30(%rbp)
fldt   -0x20(%rbp)
flds   0xe88(%rip)
fld    %st(2)
fmul   %st(1),%st
faddp  %st,%st(2)
faddp  %st,%st(1)
fldt   -0x50(%rbp)
fmulp  %st,%st(1)
faddp  %st,%st(1)
fstpt  -0x60(%rbp)
fldt   -0x60(%rbp)
fstpl  -0x70(%rbp)
movsd  -0x70(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x68(%rbp),%xmm0
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hsl_sf_hZeta0_zed>:
sub    $0x48,%rsp
movsd  %xmm1,0x28(%rsp)
fldl   0x28(%rsp)
fld    %st(0)
fstpt  0x3c(%rsp)
movsd  %xmm0,0x30(%rsp)
fldl   0x30(%rsp)
fstpt  0x14(%rsp)
fld1
fdivp  %st,%st(1)
fstpt  (%rsp)
call   1030 <log1pl@plt>
fldt   0x14(%rsp)
fchs
fmulp  %st,%st(1)
fstpt  (%rsp)
call   1040 <expm1l@plt>
flds   0xe9c(%rip)
fldt   0x14(%rsp)
fld    %st(0)
fmul   %st(2),%st
fldt   0x3c(%rsp)
faddp  %st,%st(1)
faddp  %st,%st(2)
fxch   %st(1)
fmulp  %st,%st(2)
faddp  %st,%st(1)
fstpl  0x20(%rsp)
movsd  0x20(%rsp),%xmm0
add    $0x48,%rsp
ret

LLVM IR (-O0):
define double @hsl_sf_hZeta0_zed(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca x86_fp80
%6 = alloca x86_fp80
%7 = alloca x86_fp80
%8 = alloca x86_fp80
%9 = alloca x86_fp80
%10 = alloca double
store double %0, double* %3
store double %1, double* %4
%11 = load double, double* %4
%12 = fpext double %11 to x86_fp80
store x86_fp80 %12, x86_fp80* %5
%13 = load double, double* %3
%14 = fpext double %13 to x86_fp80
store x86_fp80 %14, x86_fp80* %6
%15 = load x86_fp80, x86_fp80* %5
%16 = fdiv x86_fp80 0xK3FFF8000000000000000, %15
%17 = call x86_fp80 @log1pl(x86_fp80 %16)
store x86_fp80 %17, x86_fp80* %7
%18 = load x86_fp80, x86_fp80* %6
%19 = fneg x86_fp80 %18
%20 = load x86_fp80, x86_fp80* %7
%21 = fmul x86_fp80 %19, %20
%22 = call x86_fp80 @expm1l(x86_fp80 %21)
store x86_fp80 %22, x86_fp80* %8
%23 = load x86_fp80, x86_fp80* %6
%24 = load x86_fp80, x86_fp80* %5
%25 = load x86_fp80, x86_fp80* %6
%26 = call x86_fp80 @llvm.fmuladd.f80(x86_fp80 0xK3FFE8000000000000000, x86_fp80 %25, x86_fp80 %24)
%27 = fadd x86_fp80 %26, 0xK3FFE8000000000000000
%28 = load x86_fp80, x86_fp80* %8
%29 = call x86_fp80 @llvm.fmuladd.f80(x86_fp80 %27, x86_fp80 %28, x86_fp80 %23)
store x86_fp80 %29, x86_fp80* %9
%30 = load x86_fp80, x86_fp80* %9
%31 = fptrunc x86_fp80 %30 to double
store double %31, double* %10
%32 = load double, double* %10
ret double %32
}

LLVM IR (-O2):
define double @hsl_sf_hZeta0_zed(double %0, double %1) {
%3 = fpext double %1 to x86_fp80
%4 = fpext double %0 to x86_fp80
%5 = fdiv x86_fp80 0xK3FFF8000000000000000, %3
%6 = tail call x86_fp80 @log1pl(x86_fp80 %5)
%7 = fneg x86_fp80 %4
%8 = fmul x86_fp80 %6, %7
%9 = tail call x86_fp80 @expm1l(x86_fp80 %8)
%10 = tail call x86_fp80 @llvm.fmuladd.f80(x86_fp80 %4, x86_fp80 0xK3FFE8000000000000000, x86_fp80 %3)
%11 = fadd x86_fp80 %10, 0xK3FFE8000000000000000
%12 = tail call x86_fp80 @llvm.fmuladd.f80(x86_fp80 %11, x86_fp80 %9, x86_fp80 %4)
%13 = fptrunc x86_fp80 %12 to double
ret double %13
}