#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 const);
double fff_gamln(double x) {
  double coeff[] = {76.18009172947146,    -86.50532032941677,
                    24.01409824083091,    -1.231739572450155,
                    .1208650973866179e-2, -.5395239384953e-5};
  const double stp = 2.5066282746310005;
  double y = x;
  double sum = 1.000000000190015;
  double out;
  int i;
  for (i = 0; i < 6; i++) {
    y += 1;
    sum += coeff[i] / y;
  }
  out = x + 5.5;
  out = (x + 0.5) * log(out) - out;
  return out + log(stp * sum / x);
}


x86 assembly (clang, -O0):
<fff_gamln>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movsd  %xmm0,-0x8(%rbp)
lea    -0x40(%rbp),%rdi
xor    %esi,%esi
mov    $0x30,%edx
call   1030 <memset@plt>
movsd  0xef0(%rip),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  0xedb(%rip),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  0xec6(%rip),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  0xeb1(%rip),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  0xe9c(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xe87(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xe72(%rip),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  0xe53(%rip),%xmm0
movsd  %xmm0,-0x58(%rbp)
movl   $0x0,-0x64(%rbp)
cmpl   $0x6,-0x64(%rbp)
jge    11fc <fff_gamln+0xdc>
movsd  0xe85(%rip),%xmm0
addsd  -0x50(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
movslq -0x64(%rbp),%rax
movsd  -0x40(%rbp,%rax,8),%xmm0
divsd  -0x50(%rbp),%xmm0
addsd  -0x58(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
mov    -0x64(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x64(%rbp)
jmp    11b9 <fff_gamln+0x99>
movsd  0xe44(%rip),%xmm0
addsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  0xe2a(%rip),%xmm0
addsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x60(%rbp),%xmm0
call   1040 <log@plt>
movaps %xmm0,%xmm2
movsd  -0x78(%rbp),%xmm0
movsd  -0x60(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x60(%rbp),%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  0xd9b(%rip),%xmm0
mulsd  -0x58(%rbp),%xmm0
divsd  -0x8(%rbp),%xmm0
call   1040 <log@plt>
movaps %xmm0,%xmm1
movsd  -0x70(%rbp),%xmm0
addsd  %xmm1,%xmm0
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fff_gamln>:
sub    $0x38,%rsp
movsd  0xee4(%rip),%xmm5
movapd %xmm0,%xmm1
addsd  %xmm5,%xmm1
movapd %xmm1,%xmm2
addsd  %xmm5,%xmm2
unpcklpd %xmm2,%xmm1
movapd 0xef8(%rip),%xmm3
divpd  %xmm1,%xmm3
movsd  0xec4(%rip),%xmm1
addsd  %xmm3,%xmm1
unpckhpd %xmm3,%xmm3
addsd  %xmm1,%xmm3
addsd  %xmm5,%xmm2
movapd %xmm2,%xmm1
addsd  %xmm5,%xmm1
unpcklpd %xmm1,%xmm2
movapd 0xed8(%rip),%xmm4
divpd  %xmm2,%xmm4
addsd  %xmm4,%xmm3
unpckhpd %xmm4,%xmm4
addsd  %xmm3,%xmm4
addsd  %xmm5,%xmm1
addsd  %xmm1,%xmm5
unpcklpd %xmm5,%xmm1
movapd 0xec4(%rip),%xmm2
divpd  %xmm1,%xmm2
addsd  %xmm2,%xmm4
unpckhpd %xmm2,%xmm2
addsd  %xmm4,%xmm2
movapd %xmm2,0x20(%rsp)
movsd  0xe66(%rip),%xmm1
movsd  %xmm0,0x18(%rsp)
addsd  %xmm0,%xmm1
movsd  %xmm1,0x10(%rsp)
movsd  0xe56(%rip),%xmm2
addsd  %xmm0,%xmm2
movsd  %xmm2,0x8(%rsp)
movapd %xmm1,%xmm0
call   1030 <log@plt>
mulsd  0x8(%rsp),%xmm0
subsd  0x10(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
movapd 0x20(%rsp),%xmm0
mulsd  0xe2b(%rip),%xmm0
divsd  0x18(%rsp),%xmm0
call   1030 <log@plt>
addsd  0x8(%rsp),%xmm0
add    $0x38,%rsp
ret

LLVM IR (-O0):
define double @fff_gamln(double %0) {
%2 = alloca double
%3 = alloca [6 x double]
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca i32
store double %0, double* %2
%9 = bitcast [6 x double]* %3 to i8*
%10 = bitcast i8* %9 to [6 x double]*
%11 = getelementptr inbounds [6 x double], [6 x double]* %10, i32 0, i32 0
store double 0x40530B869F76170A, double* %11
%12 = getelementptr inbounds [6 x double], [6 x double]* %10, i32 0, i32 1
store double 0xC055A0572B143656, double* %12
%13 = getelementptr inbounds [6 x double], [6 x double]* %10, i32 0, i32 2
store double 0x4038039BF13B4CC6, double* %13
%14 = getelementptr inbounds [6 x double], [6 x double]* %10, i32 0, i32 3
store double 0xBFF3B5348DCDCC8C, double* %14
%15 = getelementptr inbounds [6 x double], [6 x double]* %10, i32 0, i32 4
store double 0x3F53CD7319EC12D8, double* %15
%16 = getelementptr inbounds [6 x double], [6 x double]* %10, i32 0, i32 5
store double 0xBED6A1181C0E9888, double* %16
store double 0x40040D931FF62706, double* %4
%17 = load double, double* %2
store double %17, double* %5
store double 0x3FF00000000D0EC7, double* %6
store i32 0, i32* %8
br label %18
18: ; preds = %32, %1
%19 = load i32, i32* %8
%20 = icmp slt i32 %19, 6
br i1 %20, label %21, label %35
21: ; preds = %18
%22 = load double, double* %5
%23 = fadd double %22, 1.000000e+00
store double %23, double* %5
%24 = load i32, i32* %8
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds [6 x double], [6 x double]* %3, i64 0, i64 %25
%27 = load double, double* %26
%28 = load double, double* %5
%29 = fdiv double %27, %28
%30 = load double, double* %6
%31 = fadd double %30, %29
store double %31, double* %6
br label %32
32: ; preds = %21
%33 = load i32, i32* %8
%34 = add nsw i32 %33, 1
store i32 %34, i32* %8
br label %18
35: ; preds = %18
%36 = load double, double* %2
%37 = fadd double %36, 5.500000e+00
store double %37, double* %7
%38 = load double, double* %2
%39 = fadd double %38, 5.000000e-01
%40 = load double, double* %7
%41 = call double @log(double %40)
%42 = load double, double* %7
%43 = fneg double %42
%44 = call double @llvm.fmuladd.f64(double %39, double %41, double %43)
store double %44, double* %7
%45 = load double, double* %7
%46 = load double, double* %6
%47 = fmul double 0x40040D931FF62706, %46
%48 = load double, double* %2
%49 = fdiv double %47, %48
%50 = call double @log(double %49)
%51 = fadd double %45, %50
ret double %51
}

LLVM IR (-O2):
define double @fff_gamln(double %0) {
%2 = fadd double %0, 1.000000e+00
%3 = fadd double %2, 1.000000e+00
%4 = insertelement <2 x double> poison, double %2, i64 0
%5 = insertelement <2 x double> %4, double %3, i64 1
%6 = fdiv <2 x double> <double 0x40530B869F76170A, double 0xC055A0572B143656>, %5
%7 = extractelement <2 x double> %6, i64 0
%8 = fadd double %7, 0x3FF00000000D0EC7
%9 = extractelement <2 x double> %6, i64 1
%10 = fadd double %8, %9
%11 = fadd double %3, 1.000000e+00
%12 = fadd double %11, 1.000000e+00
%13 = insertelement <2 x double> poison, double %11, i64 0
%14 = insertelement <2 x double> %13, double %12, i64 1
%15 = fdiv <2 x double> <double 0x4038039BF13B4CC6, double 0xBFF3B5348DCDCC8C>, %14
%16 = extractelement <2 x double> %15, i64 0
%17 = fadd double %10, %16
%18 = extractelement <2 x double> %15, i64 1
%19 = fadd double %17, %18
%20 = fadd double %12, 1.000000e+00
%21 = fadd double %20, 1.000000e+00
%22 = insertelement <2 x double> poison, double %20, i64 0
%23 = insertelement <2 x double> %22, double %21, i64 1
%24 = fdiv <2 x double> <double 0x3F53CD7319EC12D8, double 0xBED6A1181C0E9888>, %23
%25 = extractelement <2 x double> %24, i64 0
%26 = fadd double %19, %25
%27 = extractelement <2 x double> %24, i64 1
%28 = fadd double %26, %27
%29 = fadd double %0, 5.500000e+00
%30 = fadd double %0, 5.000000e-01
%31 = tail call double @log(double %29)
%32 = fneg double %29
%33 = tail call double @llvm.fmuladd.f64(double %30, double %31, double %32)
%34 = fmul double %28, 0x40040D931FF62706
%35 = fdiv double %34, %0
%36 = tail call double @log(double %35)
%37 = fadd double %33, %36
ret double %37
}