#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 */
float fastlog(float);
float fastlgamma(float x) {
  float logterm = fastlog(x * (1.0f + x) * (2.0f + x));
  float xp3 = 3.0f + x;
  return -2.081061466f - x + 0.0833333f / xp3 - logterm +
         (2.5f + x) * fastlog(xp3);
}


x86 assembly (clang, -O0):
<fastlgamma>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  0xeea(%rip),%xmm1
addss  -0x4(%rbp),%xmm1
mulss  %xmm1,%xmm0
movss  0xed5(%rip),%xmm1
addss  -0x4(%rbp),%xmm1
mulss  %xmm1,%xmm0
call   1030 <fastlog@plt>
movss  %xmm0,-0x8(%rbp)
movss  0xeb6(%rip),%xmm0
addss  -0x4(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  0xea0(%rip),%xmm0
subss  -0x4(%rbp),%xmm0
movss  0xe8f(%rip),%xmm1
divss  -0xc(%rbp),%xmm1
addss  %xmm1,%xmm0
subss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  0xe70(%rip),%xmm0
addss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0xc(%rbp),%xmm0
call   1030 <fastlog@plt>
movss  -0x14(%rbp),%xmm1
movaps %xmm0,%xmm2
movss  -0x10(%rbp),%xmm0
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fastlgamma>:
push   %rax
movaps %xmm0,%xmm2
movss  %xmm0,(%rsp)
movss  0xedf(%rip),%xmm1
addss  %xmm0,%xmm1
mulss  %xmm0,%xmm1
movss  0xed3(%rip),%xmm0
addss  %xmm2,%xmm0
mulss  %xmm1,%xmm0
call   1030 <fastlog@plt>
movss  0xec2(%rip),%xmm1
movss  (%rsp),%xmm3
addss  %xmm3,%xmm1
movss  0xeb5(%rip),%xmm2
subss  %xmm3,%xmm2
movaps %xmm3,%xmm4
movss  0xeaa(%rip),%xmm3
divss  %xmm1,%xmm3
addss  %xmm2,%xmm3
subss  %xmm0,%xmm3
movss  %xmm3,0x4(%rsp)
addss  0xe94(%rip),%xmm4
movss  %xmm4,(%rsp)
movaps %xmm1,%xmm0
call   1030 <fastlog@plt>
mulss  (%rsp),%xmm0
addss  0x4(%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @fastlgamma(float %0) {
%2 = alloca float
%3 = alloca float
%4 = alloca float
store float %0, float* %2
%5 = load float, float* %2
%6 = load float, float* %2
%7 = fadd float 1.000000e+00, %6
%8 = fmul float %5, %7
%9 = load float, float* %2
%10 = fadd float 2.000000e+00, %9
%11 = fmul float %8, %10
%12 = call float @fastlog(float %11)
store float %12, float* %3
%13 = load float, float* %2
%14 = fadd float 3.000000e+00, %13
store float %14, float* %4
%15 = load float, float* %2
%16 = fsub float 0xC000A60380000000, %15
%17 = load float, float* %4
%18 = fdiv float 0x3FB55554C0000000, %17
%19 = fadd float %16, %18
%20 = load float, float* %3
%21 = fsub float %19, %20
%22 = load float, float* %2
%23 = fadd float 2.500000e+00, %22
%24 = load float, float* %4
%25 = call float @fastlog(float %24)
%26 = call float @llvm.fmuladd.f32(float %23, float %25, float %21)
ret float %26
}

LLVM IR (-O2):
define float @fastlgamma(float %0) {
%2 = fadd float %0, 1.000000e+00
%3 = fmul float %2, %0
%4 = fadd float %0, 2.000000e+00
%5 = fmul float %4, %3
%6 = tail call float @fastlog(float %5)
%7 = fadd float %0, 3.000000e+00
%8 = fsub float 0xC000A60380000000, %0
%9 = fdiv float 0x3FB55554C0000000, %7
%10 = fadd float %8, %9
%11 = fsub float %10, %6
%12 = fadd float %0, 2.500000e+00
%13 = tail call float @fastlog(float %7)
%14 = tail call float @llvm.fmuladd.f32(float %12, float %13, float %11)
ret float %14
}