#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);
long double logl(long double const);
double hsl_sf_hZeta1_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_sm1 = ld_s - 1.0L;
  const long double ld_logq = logl(ld_q);
  const long double ld_log1prq = log1pl(1.0L / ld_q);
  const long double ld_inv_logq = 1.0L / ld_logq;
  const long double ld_logratiom1 = ld_log1prq * ld_inv_logq;
  const long double ld_powratiom1 = expm1l(-ld_s * ld_log1prq);
  const long double ld_varepsilon = expm1l(-ld_sm1 * ld_log1prq);
  const long double ld_epsilon =
      ld_logratiom1 + ld_powratiom1 + ld_logratiom1 * ld_powratiom1;
  const long double ld_z = ld_s + (ld_q + 0.5L * ld_s + 0.5L) * ld_epsilon +
                           ld_q / ld_sm1 * ld_inv_logq * ld_varepsilon;
  const double z = (double)(ld_z);
  return (z);
}


x86 assembly (clang, -O0):
<hsl_sf_hZeta1_zed>:
push   %rbp
mov    %rsp,%rbp
sub    $0xf0,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
fldl   -0x10(%rbp)
fstpt  -0x20(%rbp)
fldl   -0x8(%rbp)
fstpt  -0x30(%rbp)
fldt   -0x30(%rbp)
fld1
fld    %st(0)
fstpt  -0xdc(%rbp)
fsubrp %st,%st(1)
fstpt  -0x40(%rbp)
fldt   -0x20(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <logl@plt>
fldt   -0xdc(%rbp)
fxch   %st(1)
fstpt  -0x50(%rbp)
fldt   -0x20(%rbp)
fdivrp %st,%st(1)
mov    %rsp,%rax
fstpt  (%rax)
call   1040 <log1pl@plt>
fldt   -0xdc(%rbp)
fxch   %st(1)
fstpt  -0x60(%rbp)
fldt   -0x50(%rbp)
fdivrp %st,%st(1)
fstpt  -0x70(%rbp)
fldt   -0x60(%rbp)
fldt   -0x70(%rbp)
fmulp  %st,%st(1)
fstpt  -0x80(%rbp)
fldt   -0x30(%rbp)
fchs
fldt   -0x60(%rbp)
fmulp  %st,%st(1)
mov    %rsp,%rax
fstpt  (%rax)
call   1050 <expm1l@plt>
fstpt  -0x90(%rbp)
fldt   -0x40(%rbp)
fchs
fldt   -0x60(%rbp)
fmulp  %st,%st(1)
mov    %rsp,%rax
fstpt  (%rax)
call   1050 <expm1l@plt>
fstpt  -0xa0(%rbp)
fldt   -0x80(%rbp)
fldt   -0x90(%rbp)
fld    %st(1)
fadd   %st(1),%st
fxch   %st(2)
fmulp  %st,%st(1)
faddp  %st,%st(1)
fstpt  -0xb0(%rbp)
fldt   -0x30(%rbp)
fldt   -0x20(%rbp)
flds   0xdff(%rip)
fld    %st(2)
fmul   %st(1),%st
fadd   %st(2),%st
faddp  %st,%st(1)
fldt   -0xb0(%rbp)
fmulp  %st,%st(1)
faddp  %st,%st(2)
fldt   -0x40(%rbp)
fdivrp %st,%st(1)
fldt   -0x70(%rbp)
fmulp  %st,%st(1)
fldt   -0xa0(%rbp)
fmulp  %st,%st(1)
faddp  %st,%st(1)
fstpt  -0xc0(%rbp)
fldt   -0xc0(%rbp)
fstpl  -0xd0(%rbp)
movsd  -0xd0(%rbp),%xmm0
ff
movsd  %xmm0,-0xc8(%rbp)
ff
movsd  -0xc8(%rbp),%xmm0
ff
add    $0xf0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hsl_sf_hZeta1_zed>:
sub    $0x88,%rsp
movsd  %xmm1,0x60(%rsp)
fldl   0x60(%rsp)
fld    %st(0)
fstpt  0x34(%rsp)
movsd  %xmm0,0x68(%rsp)
fldl   0x68(%rsp)
fld    %st(0)
fstpt  0x40(%rsp)
fld1
fld    %st(0)
fstpt  0x1c(%rsp)
fchs
faddp  %st,%st(1)
fstpt  0x4c(%rsp)
fstpt  (%rsp)
call   1030 <logl@plt>
fstpt  0x28(%rsp)
fldt   0x34(%rsp)
fldt   0x1c(%rsp)
fdivp  %st,%st(1)
fstpt  (%rsp)
call   1040 <log1pl@plt>
fld    %st(0)
fxch   %st(1)
fstpt  0x70(%rsp)
fldt   0x1c(%rsp)
fldt   0x28(%rsp)
fdivrp %st,%st(1)
fld    %st(0)
fstpt  0x1c(%rsp)
fmul   %st(1),%st
fstpt  0x28(%rsp)
fldt   0x40(%rsp)
fchs
fmulp  %st,%st(1)
fstpt  (%rsp)
call   1050 <expm1l@plt>
fstpt  0x7c(%rsp)
fldt   0x4c(%rsp)
fchs
fldt   0x70(%rsp)
fmulp  %st,%st(1)
fstpt  (%rsp)
call   1050 <expm1l@plt>
fldt   0x28(%rsp)
fldt   0x7c(%rsp)
fld    %st(1)
fadd   %st(1),%st
fxch   %st(2)
fmulp  %st,%st(1)
faddp  %st,%st(1)
flds   0xe1d(%rip)
fldt   0x40(%rsp)
fld    %st(0)
fmul   %st(2),%st
fldt   0x34(%rsp)
fadd   %st,%st(1)
fxch   %st(1)
faddp  %st,%st(3)
fxch   %st(2)
fmulp  %st,%st(3)
faddp  %st,%st(2)
fldt   0x4c(%rsp)
fdivrp %st,%st(1)
fldt   0x1c(%rsp)
fmulp  %st,%st(1)
fmulp  %st,%st(2)
faddp  %st,%st(1)
fstpl  0x58(%rsp)
movsd  0x58(%rsp),%xmm0
add    $0x88,%rsp
ret

LLVM IR (-O0):
define double @hsl_sf_hZeta1_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 x86_fp80
%11 = alloca x86_fp80
%12 = alloca x86_fp80
%13 = alloca x86_fp80
%14 = alloca x86_fp80
%15 = alloca x86_fp80
%16 = alloca double
store double %0, double* %3
store double %1, double* %4
%17 = load double, double* %4
%18 = fpext double %17 to x86_fp80
store x86_fp80 %18, x86_fp80* %5
%19 = load double, double* %3
%20 = fpext double %19 to x86_fp80
store x86_fp80 %20, x86_fp80* %6
%21 = load x86_fp80, x86_fp80* %6
%22 = fsub x86_fp80 %21, 0xK3FFF8000000000000000
store x86_fp80 %22, x86_fp80* %7
%23 = load x86_fp80, x86_fp80* %5
%24 = call x86_fp80 @logl(x86_fp80 %23)
store x86_fp80 %24, x86_fp80* %8
%25 = load x86_fp80, x86_fp80* %5
%26 = fdiv x86_fp80 0xK3FFF8000000000000000, %25
%27 = call x86_fp80 @log1pl(x86_fp80 %26)
store x86_fp80 %27, x86_fp80* %9
%28 = load x86_fp80, x86_fp80* %8
%29 = fdiv x86_fp80 0xK3FFF8000000000000000, %28
store x86_fp80 %29, x86_fp80* %10
%30 = load x86_fp80, x86_fp80* %9
%31 = load x86_fp80, x86_fp80* %10
%32 = fmul x86_fp80 %30, %31
store x86_fp80 %32, x86_fp80* %11
%33 = load x86_fp80, x86_fp80* %6
%34 = fneg x86_fp80 %33
%35 = load x86_fp80, x86_fp80* %9
%36 = fmul x86_fp80 %34, %35
%37 = call x86_fp80 @expm1l(x86_fp80 %36)
store x86_fp80 %37, x86_fp80* %12
%38 = load x86_fp80, x86_fp80* %7
%39 = fneg x86_fp80 %38
%40 = load x86_fp80, x86_fp80* %9
%41 = fmul x86_fp80 %39, %40
%42 = call x86_fp80 @expm1l(x86_fp80 %41)
store x86_fp80 %42, x86_fp80* %13
%43 = load x86_fp80, x86_fp80* %11
%44 = load x86_fp80, x86_fp80* %12
%45 = fadd x86_fp80 %43, %44
%46 = load x86_fp80, x86_fp80* %11
%47 = load x86_fp80, x86_fp80* %12
%48 = call x86_fp80 @llvm.fmuladd.f80(x86_fp80 %46, x86_fp80 %47, x86_fp80 %45)
store x86_fp80 %48, x86_fp80* %14
%49 = load x86_fp80, x86_fp80* %6
%50 = load x86_fp80, x86_fp80* %5
%51 = load x86_fp80, x86_fp80* %6
%52 = call x86_fp80 @llvm.fmuladd.f80(x86_fp80 0xK3FFE8000000000000000, x86_fp80 %51, x86_fp80 %50)
%53 = fadd x86_fp80 %52, 0xK3FFE8000000000000000
%54 = load x86_fp80, x86_fp80* %14
%55 = call x86_fp80 @llvm.fmuladd.f80(x86_fp80 %53, x86_fp80 %54, x86_fp80 %49)
%56 = load x86_fp80, x86_fp80* %5
%57 = load x86_fp80, x86_fp80* %7
%58 = fdiv x86_fp80 %56, %57
%59 = load x86_fp80, x86_fp80* %10
%60 = fmul x86_fp80 %58, %59
%61 = load x86_fp80, x86_fp80* %13
%62 = call x86_fp80 @llvm.fmuladd.f80(x86_fp80 %60, x86_fp80 %61, x86_fp80 %55)
store x86_fp80 %62, x86_fp80* %15
%63 = load x86_fp80, x86_fp80* %15
%64 = fptrunc x86_fp80 %63 to double
store double %64, double* %16
%65 = load double, double* %16
ret double %65
}

LLVM IR (-O2):
define double @hsl_sf_hZeta1_zed(double %0, double %1) {
%3 = fpext double %1 to x86_fp80
%4 = fpext double %0 to x86_fp80
%5 = fadd x86_fp80 %4, 0xKBFFF8000000000000000
%6 = tail call x86_fp80 @logl(x86_fp80 %3)
%7 = fdiv x86_fp80 0xK3FFF8000000000000000, %3
%8 = tail call x86_fp80 @log1pl(x86_fp80 %7)
%9 = fdiv x86_fp80 0xK3FFF8000000000000000, %6
%10 = fmul x86_fp80 %8, %9
%11 = fneg x86_fp80 %4
%12 = fmul x86_fp80 %8, %11
%13 = tail call x86_fp80 @expm1l(x86_fp80 %12)
%14 = fneg x86_fp80 %5
%15 = fmul x86_fp80 %8, %14
%16 = tail call x86_fp80 @expm1l(x86_fp80 %15)
%17 = fadd x86_fp80 %10, %13
%18 = tail call x86_fp80 @llvm.fmuladd.f80(x86_fp80 %10, x86_fp80 %13, x86_fp80 %17)
%19 = tail call x86_fp80 @llvm.fmuladd.f80(x86_fp80 %4, x86_fp80 0xK3FFE8000000000000000, x86_fp80 %3)
%20 = fadd x86_fp80 %19, 0xK3FFE8000000000000000
%21 = tail call x86_fp80 @llvm.fmuladd.f80(x86_fp80 %20, x86_fp80 %18, x86_fp80 %4)
%22 = fdiv x86_fp80 %3, %5
%23 = fmul x86_fp80 %22, %9
%24 = tail call x86_fp80 @llvm.fmuladd.f80(x86_fp80 %23, x86_fp80 %16, x86_fp80 %21)
%25 = fptrunc x86_fp80 %24 to double
ret double %25
}