#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 */
typedef int l;

/* Variables and functions */
long double gammaq(int);
double log1p(double);
void casimir_lnab0(int l, double *a0, int *sign_a0, double *b0, int *sign_b0) {
  *sign_a0 = (1 - 2 * ((l)&1));
  *sign_b0 = (1 - 2 * ((l + 1) & 1));
  *b0 = 1.14472988584940017414342735135305871164729L - (gammaq(l + 0.5)) -
        (gammaq(l + 1.5));
  *a0 = *b0 + log1p(1.0 / l);
}


x86 assembly (clang, -O0):
<casimir_lnab0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x4(%rbp),%eax
and    $0x1,%eax
add    %eax,%eax
mov    $0x1,%ecx
mov    %ecx,%edx
sub    %eax,%edx
mov    -0x18(%rbp),%rax
mov    %edx,(%rax)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
and    $0x1,%eax
add    %eax,%eax
sub    %eax,%ecx
mov    -0x28(%rbp),%rax
mov    %ecx,(%rax)
cvtsi2sdl -0x4(%rbp),%xmm0
movsd  0xe96(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1030 <gammaq@plt>
fldt   0xe9b(%rip)
fsubp  %st,%st(1)
fstpt  -0x44(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm0
movsd  0xe79(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1030 <gammaq@plt>
fldt   -0x44(%rbp)
fsubp  %st,%st(1)
fstpl  -0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x20(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x38(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm1
movsd  0xe2d(%rip),%xmm0
divsd  %xmm1,%xmm0
call   1040 <log1p@plt>
movaps %xmm0,%xmm1
movsd  -0x38(%rbp),%xmm0
addsd  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<casimir_lnab0>:
push   %r14
push   %rbx
sub    $0x28,%rsp
mov    %rcx,%rbx
mov    %rsi,%r14
lea    (%rdi,%rdi,1),%eax
mov    %eax,%ecx
and    $0x2,%ecx
mov    $0x1,%esi
sub    %ecx,%esi
mov    %esi,(%rdx)
or     $0xfffffffd,%eax
add    $0x2,%eax
mov    %eax,(%r8)
cvtsi2sd %edi,%xmm1
movsd  %xmm1,0x18(%rsp)
movsd  0xea7(%rip),%xmm0
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1030 <gammaq@plt>
fldt   0xeb4(%rip)
fsubp  %st,%st(1)
fstpt  0x8(%rsp)
movsd  0xe8e(%rip),%xmm0
addsd  0x18(%rsp),%xmm0
cvttsd2si %xmm0,%edi
call   1030 <gammaq@plt>
fldt   0x8(%rsp)
fsubp  %st,%st(1)
fstpl  0x20(%rsp)
movsd  0x20(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  %xmm0,(%rbx)
movsd  0xe65(%rip),%xmm0
divsd  0x18(%rsp),%xmm0
call   1040 <log1p@plt>
addsd  0x8(%rsp),%xmm0
movsd  %xmm0,(%r14)
add    $0x28,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @casimir_lnab0(i32 %0, double* %1, i32* %2, double* %3, i32* %4) {
%6 = alloca i32
%7 = alloca double*
%8 = alloca i32*
%9 = alloca double*
%10 = alloca i32*
store i32 %0, i32* %6
store double* %1, double** %7
store i32* %2, i32** %8
store double* %3, double** %9
store i32* %4, i32** %10
%11 = load i32, i32* %6
%12 = and i32 %11, 1
%13 = mul nsw i32 2, %12
%14 = sub nsw i32 1, %13
%15 = load i32*, i32** %8
store i32 %14, i32* %15
%16 = load i32, i32* %6
%17 = add nsw i32 %16, 1
%18 = and i32 %17, 1
%19 = mul nsw i32 2, %18
%20 = sub nsw i32 1, %19
%21 = load i32*, i32** %10
store i32 %20, i32* %21
%22 = load i32, i32* %6
%23 = sitofp i32 %22 to double
%24 = fadd double %23, 5.000000e-01
%25 = fptosi double %24 to i32
%26 = call x86_fp80 @gammaq(i32 %25)
%27 = fsub x86_fp80 0xK3FFF928682473D0DE85F, %26
%28 = load i32, i32* %6
%29 = sitofp i32 %28 to double
%30 = fadd double %29, 1.500000e+00
%31 = fptosi double %30 to i32
%32 = call x86_fp80 @gammaq(i32 %31)
%33 = fsub x86_fp80 %27, %32
%34 = fptrunc x86_fp80 %33 to double
%35 = load double*, double** %9
store double %34, double* %35
%36 = load double*, double** %9
%37 = load double, double* %36
%38 = load i32, i32* %6
%39 = sitofp i32 %38 to double
%40 = fdiv double 1.000000e+00, %39
%41 = call double @log1p(double %40)
%42 = fadd double %37, %41
%43 = load double*, double** %7
store double %42, double* %43
ret void
}

LLVM IR (-O2):
define void @casimir_lnab0(i32 %0, double* nocapture writeonly %1, i32* nocapture writeonly %2, double* nocapture writeonly %3, i32* nocapture writeonly %4) {
%6 = shl i32 %0, 1
%7 = and i32 %6, 2
%8 = sub nsw i32 1, %7
store i32 %8, i32* %2
%9 = or i32 %6, -3
%10 = add nsw i32 %9, 2
store i32 %10, i32* %4
%11 = sitofp i32 %0 to double
%12 = fadd double %11, 5.000000e-01
%13 = fptosi double %12 to i32
%14 = tail call x86_fp80 @gammaq(i32 %13)
%15 = fsub x86_fp80 0xK3FFF928682473D0DE85F, %14
%16 = fadd double %11, 1.500000e+00
%17 = fptosi double %16 to i32
%18 = tail call x86_fp80 @gammaq(i32 %17)
%19 = fsub x86_fp80 %15, %18
%20 = fptrunc x86_fp80 %19 to double
store double %20, double* %3
%21 = fdiv double 1.000000e+00, %11
%22 = tail call double @log1p(double %21)
%23 = fadd double %22, %20
store double %23, double* %1
ret void
}