; LLVM IR from Tinker-Twins/3D-LIDAR-Localization :: fast_gicp/thirdparty/nvbio/contrib/htslib (kfunc)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

; Function Attrs: nounwind uwtable
define dso_local double @kf_lgamma(double noundef %0) #0 {
  %2 = alloca double, align 8
  %3 = alloca double, align 8
  store double %0, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #4
  store double 0.000000e+00, ptr %3, align 8, !tbaa !5
  %4 = load double, ptr %2, align 8, !tbaa !5
  %5 = fadd double %4, 7.000000e+00
  %6 = fdiv double 0x3E8645E569E1DBC8, %5
  %7 = load double, ptr %3, align 8, !tbaa !5
  %8 = fadd double %7, %6
  store double %8, ptr %3, align 8, !tbaa !5
  %9 = load double, ptr %2, align 8, !tbaa !5
  %10 = fadd double %9, 6.000000e+00
  %11 = fdiv double 0x3EE4D5C75C187EE3, %10
  %12 = load double, ptr %3, align 8, !tbaa !5
  %13 = fadd double %12, %11
  store double %13, ptr %3, align 8, !tbaa !5
  %14 = load double, ptr %2, align 8, !tbaa !5
  %15 = fadd double %14, 5.000000e+00
  %16 = fdiv double 0x3FC1BCB213BB7E41, %15
  %17 = load double, ptr %3, align 8, !tbaa !5
  %18 = fsub double %17, %16
  store double %18, ptr %3, align 8, !tbaa !5
  %19 = load double, ptr %2, align 8, !tbaa !5
  %20 = fadd double %19, 4.000000e+00
  %21 = fdiv double 0x402903C27E40123E, %20
  %22 = load double, ptr %3, align 8, !tbaa !5
  %23 = fadd double %22, %21
  store double %23, ptr %3, align 8, !tbaa !5
  %24 = load double, ptr %2, align 8, !tbaa !5
  %25 = fadd double %24, 3.000000e+00
  %26 = fdiv double 0x406613AE519C9497, %25
  %27 = load double, ptr %3, align 8, !tbaa !5
  %28 = fsub double %27, %26
  store double %28, ptr %3, align 8, !tbaa !5
  %29 = load double, ptr %2, align 8, !tbaa !5
  %30 = fadd double %29, 2.000000e+00
  %31 = fdiv double 0x40881A9661D3740D, %30
  %32 = load double, ptr %3, align 8, !tbaa !5
  %33 = fadd double %32, %31
  store double %33, ptr %3, align 8, !tbaa !5
  %34 = load double, ptr %2, align 8, !tbaa !5
  %35 = fadd double %34, 1.000000e+00
  %36 = fdiv double 0x4093AC8E8ED41526, %35
  %37 = load double, ptr %3, align 8, !tbaa !5
  %38 = fsub double %37, %36
  store double %38, ptr %3, align 8, !tbaa !5
  %39 = load double, ptr %2, align 8, !tbaa !5
  %40 = fdiv double 0x40852429B6C30AF7, %39
  %41 = load double, ptr %3, align 8, !tbaa !5
  %42 = fadd double %41, %40
  store double %42, ptr %3, align 8, !tbaa !5
  %43 = load double, ptr %3, align 8, !tbaa !5
  %44 = fadd double %43, 0x3FEFFFFFFFFFEF0D
  store double %44, ptr %3, align 8, !tbaa !5
  %45 = load double, ptr %3, align 8, !tbaa !5
  %46 = call double @log(double noundef %45) #4
  %47 = fsub double %46, 0x40165301C6F3682A
  %48 = load double, ptr %2, align 8, !tbaa !5
  %49 = fsub double %47, %48
  %50 = load double, ptr %2, align 8, !tbaa !5
  %51 = fsub double %50, 5.000000e-01
  %52 = load double, ptr %2, align 8, !tbaa !5
  %53 = fadd double %52, 6.500000e+00
  %54 = call double @log(double noundef %53) #4
  %55 = call double @llvm.fmuladd.f64(double %51, double %54, double %49)
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #4
  ret double %55
}

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1

; Function Attrs: nounwind
declare double @log(double noundef) #2

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #3

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1

attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"double", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

; Function Attrs: mustprogress nofree nounwind willreturn memory(write) uwtable
define dso_local double @kf_lgamma(double noundef %0) local_unnamed_addr #0 {
  %2 = insertelement <2 x double> poison, double %0, i64 0
  %3 = shufflevector <2 x double> %2, <2 x double> poison, <2 x i32> zeroinitializer
  %4 = fadd <2 x double> %3, <double 6.000000e+00, double 7.000000e+00>
  %5 = fdiv <2 x double> <double 0x3EE4D5C75C187EE3, double 0x3E8645E569E1DBC8>, %4
  %6 = extractelement <2 x double> %5, i64 1
  %7 = fadd double %6, 0.000000e+00
  %8 = extractelement <2 x double> %5, i64 0
  %9 = fadd double %8, %7
  %10 = fadd <2 x double> %3, <double 4.000000e+00, double 5.000000e+00>
  %11 = fdiv <2 x double> <double 0x402903C27E40123E, double 0x3FC1BCB213BB7E41>, %10
  %12 = extractelement <2 x double> %11, i64 1
  %13 = fsub double %9, %12
  %14 = extractelement <2 x double> %11, i64 0
  %15 = fadd double %14, %13
  %16 = fadd <2 x double> %3, <double 2.000000e+00, double 3.000000e+00>
  %17 = fdiv <2 x double> <double 0x40881A9661D3740D, double 0x406613AE519C9497>, %16
  %18 = extractelement <2 x double> %17, i64 1
  %19 = fsub double %15, %18
  %20 = extractelement <2 x double> %17, i64 0
  %21 = fadd double %20, %19
  %22 = fadd double %0, 1.000000e+00
  %23 = insertelement <2 x double> %2, double %22, i64 1
  %24 = fdiv <2 x double> <double 0x40852429B6C30AF7, double 0x4093AC8E8ED41526>, %23
  %25 = extractelement <2 x double> %24, i64 1
  %26 = fsub double %21, %25
  %27 = extractelement <2 x double> %24, i64 0
  %28 = fadd double %27, %26
  %29 = fadd double %28, 0x3FEFFFFFFFFFEF0D
  %30 = tail call double @log(double noundef %29) #3
  %31 = fadd double %30, 0xC0165301C6F3682A
  %32 = fsub double %31, %0
  %33 = fadd double %0, -5.000000e-01
  %34 = fadd double %0, 6.500000e+00
  %35 = tail call double @log(double noundef %34) #3
  %36 = tail call double @llvm.fmuladd.f64(double %33, double %35, double %32)
  ret double %36
}

; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @log(double noundef) local_unnamed_addr #1

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #2

attributes #0 = { mustprogress nofree nounwind willreturn memory(write) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nofree nounwind willreturn memory(write) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #3 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}


; Effective O3 passes: GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,ReassociatePass,SLPVectorizerPass,SROAPass,TailCallElimPass