; LLVM IR from InsightSoftwareConsortium/ITK :: Modules/ThirdParty/Netlib/src/netlib/slatec (dlbeta)

; 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"

@dlbeta_.sq2pil = external hidden global double, align 8
@.str = external hidden unnamed_addr constant [7 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [31 x i8], align 1
@c__1 = external hidden global i64, align 8
@c__2 = external hidden global i64, align 8

; Function Attrs: nounwind uwtable
define dso_local double @dlbeta_(ptr noundef %0, ptr noundef %1) #0 {
  %3 = alloca double, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca double, align 8
  %7 = alloca double, align 8
  %8 = alloca double, align 8
  %9 = alloca double, align 8
  %10 = alloca double, align 8
  %11 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #5
  %12 = load ptr, ptr %4, align 8, !tbaa !5
  %13 = load double, ptr %12, align 8, !tbaa !9
  %14 = load ptr, ptr %5, align 8, !tbaa !5
  %15 = load double, ptr %14, align 8, !tbaa !9
  %16 = fcmp ole double %13, %15
  br i1 %16, label %17, label %20

17:                                               ; preds = %2
  %18 = load ptr, ptr %4, align 8, !tbaa !5
  %19 = load double, ptr %18, align 8, !tbaa !9
  br label %23

20:                                               ; preds = %2
  %21 = load ptr, ptr %5, align 8, !tbaa !5
  %22 = load double, ptr %21, align 8, !tbaa !9
  br label %23

23:                                               ; preds = %20, %17
  %24 = phi double [ %19, %17 ], [ %22, %20 ]
  store double %24, ptr %8, align 8, !tbaa !9
  %25 = load ptr, ptr %4, align 8, !tbaa !5
  %26 = load double, ptr %25, align 8, !tbaa !9
  %27 = load ptr, ptr %5, align 8, !tbaa !5
  %28 = load double, ptr %27, align 8, !tbaa !9
  %29 = fcmp oge double %26, %28
  br i1 %29, label %30, label %33

30:                                               ; preds = %23
  %31 = load ptr, ptr %4, align 8, !tbaa !5
  %32 = load double, ptr %31, align 8, !tbaa !9
  br label %36

33:                                               ; preds = %23
  %34 = load ptr, ptr %5, align 8, !tbaa !5
  %35 = load double, ptr %34, align 8, !tbaa !9
  br label %36

36:                                               ; preds = %33, %30
  %37 = phi double [ %32, %30 ], [ %35, %33 ]
  store double %37, ptr %9, align 8, !tbaa !9
  %38 = load double, ptr %8, align 8, !tbaa !9
  %39 = fcmp ole double %38, 0.000000e+00
  br i1 %39, label %40, label %42

40:                                               ; preds = %36
  %41 = call i32 @xermsg_(ptr noundef @.str, ptr noundef @.str.1, ptr noundef @.str.2, ptr noundef @c__1, ptr noundef @c__2, i64 noundef 6, i64 noundef 6, i64 noundef 30)
  br label %42

42:                                               ; preds = %40, %36
  %43 = load double, ptr %8, align 8, !tbaa !9
  %44 = fcmp oge double %43, 1.000000e+01
  br i1 %44, label %45, label %46

45:                                               ; preds = %42
  br label %91

46:                                               ; preds = %42
  %47 = load double, ptr %9, align 8, !tbaa !9
  %48 = fcmp oge double %47, 1.000000e+01
  br i1 %48, label %49, label %50

49:                                               ; preds = %46
  br label %61

50:                                               ; preds = %46
  %51 = load double, ptr %8, align 8, !tbaa !9
  %52 = load double, ptr %9, align 8, !tbaa !9
  %53 = fadd double %51, %52
  store double %53, ptr %7, align 8, !tbaa !9
  %54 = call double @dgamma_(ptr noundef %8)
  %55 = call double @dgamma_(ptr noundef %9)
  %56 = call double @dgamma_(ptr noundef %7)
  %57 = fdiv double %55, %56
  %58 = fmul double %54, %57
  %59 = call double @log(double noundef %58) #5
  store double %59, ptr %6, align 8, !tbaa !9
  %60 = load double, ptr %6, align 8, !tbaa !9
  store double %60, ptr %3, align 8
  store i32 1, ptr %11, align 4
  br label %125

61:                                               ; preds = %49
  %62 = load double, ptr %8, align 8, !tbaa !9
  %63 = load double, ptr %9, align 8, !tbaa !9
  %64 = fadd double %62, %63
  store double %64, ptr %7, align 8, !tbaa !9
  %65 = call double @d9lgmc_(ptr noundef %9)
  %66 = call double @d9lgmc_(ptr noundef %7)
  %67 = fsub double %65, %66
  store double %67, ptr %10, align 8, !tbaa !9
  %68 = load double, ptr %8, align 8, !tbaa !9
  %69 = fneg double %68
  %70 = load double, ptr %8, align 8, !tbaa !9
  %71 = load double, ptr %9, align 8, !tbaa !9
  %72 = fadd double %70, %71
  %73 = fdiv double %69, %72
  store double %73, ptr %7, align 8, !tbaa !9
  %74 = call double @dlngam_(ptr noundef %8)
  %75 = load double, ptr %10, align 8, !tbaa !9
  %76 = fadd double %74, %75
  %77 = load double, ptr %8, align 8, !tbaa !9
  %78 = fadd double %76, %77
  %79 = load double, ptr %8, align 8, !tbaa !9
  %80 = load double, ptr %8, align 8, !tbaa !9
  %81 = load double, ptr %9, align 8, !tbaa !9
  %82 = fadd double %80, %81
  %83 = call double @log(double noundef %82) #5
  %84 = fneg double %79
  %85 = call double @llvm.fmuladd.f64(double %84, double %83, double %78)
  %86 = load double, ptr %9, align 8, !tbaa !9
  %87 = fsub double %86, 5.000000e-01
  %88 = call double @dlnrel_(ptr noundef %7)
  %89 = call double @llvm.fmuladd.f64(double %87, double %88, double %85)
  store double %89, ptr %6, align 8, !tbaa !9
  %90 = load double, ptr %6, align 8, !tbaa !9
  store double %90, ptr %3, align 8
  store i32 1, ptr %11, align 4
  br label %125

91:                                               ; preds = %45
  %92 = load double, ptr %8, align 8, !tbaa !9
  %93 = load double, ptr %9, align 8, !tbaa !9
  %94 = fadd double %92, %93
  store double %94, ptr %7, align 8, !tbaa !9
  %95 = call double @d9lgmc_(ptr noundef %8)
  %96 = call double @d9lgmc_(ptr noundef %9)
  %97 = fadd double %95, %96
  %98 = call double @d9lgmc_(ptr noundef %7)
  %99 = fsub double %97, %98
  store double %99, ptr %10, align 8, !tbaa !9
  %100 = load double, ptr %8, align 8, !tbaa !9
  %101 = fneg double %100
  %102 = load double, ptr %8, align 8, !tbaa !9
  %103 = load double, ptr %9, align 8, !tbaa !9
  %104 = fadd double %102, %103
  %105 = fdiv double %101, %104
  store double %105, ptr %7, align 8, !tbaa !9
  %106 = load double, ptr %9, align 8, !tbaa !9
  %107 = call double @log(double noundef %106) #5
  %108 = load double, ptr @dlbeta_.sq2pil, align 8, !tbaa !9
  %109 = call double @llvm.fmuladd.f64(double %107, double -5.000000e-01, double %108)
  %110 = load double, ptr %10, align 8, !tbaa !9
  %111 = fadd double %109, %110
  %112 = load double, ptr %8, align 8, !tbaa !9
  %113 = fsub double %112, 5.000000e-01
  %114 = load double, ptr %8, align 8, !tbaa !9
  %115 = load double, ptr %8, align 8, !tbaa !9
  %116 = load double, ptr %9, align 8, !tbaa !9
  %117 = fadd double %115, %116
  %118 = fdiv double %114, %117
  %119 = call double @log(double noundef %118) #5
  %120 = call double @llvm.fmuladd.f64(double %113, double %119, double %111)
  %121 = load double, ptr %9, align 8, !tbaa !9
  %122 = call double @dlnrel_(ptr noundef %7)
  %123 = call double @llvm.fmuladd.f64(double %121, double %122, double %120)
  store double %123, ptr %6, align 8, !tbaa !9
  %124 = load double, ptr %6, align 8, !tbaa !9
  store double %124, ptr %3, align 8
  store i32 1, ptr %11, align 4
  br label %125

125:                                              ; preds = %91, %61, %50
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #5
  %126 = load double, ptr %3, align 8
  ret double %126
}

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

declare i32 @xermsg_(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, i64 noundef, i64 noundef, i64 noundef) #2

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

declare double @dgamma_(ptr noundef) #2

declare double @d9lgmc_(ptr noundef) #2

declare double @dlngam_(ptr noundef) #2

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

declare double @dlnrel_(ptr noundef) #2

; 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 = { "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 = { 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 #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { 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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"double", !7, i64 0}


; 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"

@dlbeta_.sq2pil = external hidden local_unnamed_addr global double, align 8
@.str = external hidden unnamed_addr constant [7 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [31 x i8], align 1
@c__1 = external hidden global i64, align 8
@c__2 = external hidden global i64, align 8

; Function Attrs: nounwind uwtable
define dso_local double @dlbeta_(ptr nocapture noundef readonly %0, ptr nocapture noundef readonly %1) local_unnamed_addr #0 {
  %3 = alloca double, align 8
  %4 = alloca double, align 8
  %5 = alloca double, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #5
  %6 = load double, ptr %0, align 8, !tbaa !5
  %7 = load double, ptr %1, align 8, !tbaa !5
  %.inv = fcmp ole double %6, %7
  %. = select i1 %.inv, double %6, double %7
  store double %., ptr %4, align 8, !tbaa !5
  %.inv21 = fcmp oge double %6, %7
  %8 = select i1 %.inv21, double %6, double %7
  store double %8, ptr %5, align 8, !tbaa !5
  %9 = fcmp ugt double %., 0.000000e+00
  br i1 %9, label %12, label %10

10:                                               ; preds = %2
  %11 = tail call i32 @xermsg_(ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, ptr noundef nonnull @.str.2, ptr noundef nonnull @c__1, ptr noundef nonnull @c__2, i64 noundef 6, i64 noundef 6, i64 noundef 30) #5
  br label %12

12:                                               ; preds = %10, %2
  %13 = fcmp ult double %., 1.000000e+01
  br i1 %13, label %14, label %46

14:                                               ; preds = %12
  %15 = fcmp ult double %8, 1.000000e+01
  %16 = fadd double %., %8
  store double %16, ptr %3, align 8, !tbaa !5
  br i1 %15, label %17, label %24

17:                                               ; preds = %14
  %18 = call double @dgamma_(ptr noundef nonnull %4) #5
  %19 = call double @dgamma_(ptr noundef nonnull %5) #5
  %20 = call double @dgamma_(ptr noundef nonnull %3) #5
  %21 = fdiv double %19, %20
  %22 = fmul double %18, %21
  %23 = call double @log(double noundef %22) #5
  br label %72

24:                                               ; preds = %14
  %25 = call double @d9lgmc_(ptr noundef nonnull %5) #5
  %26 = call double @d9lgmc_(ptr noundef nonnull %3) #5
  %27 = fsub double %25, %26
  %28 = load double, ptr %4, align 8, !tbaa !5
  %29 = fneg double %28
  %30 = load double, ptr %5, align 8, !tbaa !5
  %31 = fadd double %28, %30
  %32 = fdiv double %29, %31
  store double %32, ptr %3, align 8, !tbaa !5
  %33 = call double @dlngam_(ptr noundef nonnull %4) #5
  %34 = fadd double %27, %33
  %35 = load double, ptr %4, align 8, !tbaa !5
  %36 = fadd double %34, %35
  %37 = load double, ptr %5, align 8, !tbaa !5
  %38 = fadd double %35, %37
  %39 = call double @log(double noundef %38) #5
  %40 = fneg double %35
  %41 = call double @llvm.fmuladd.f64(double %40, double %39, double %36)
  %42 = load double, ptr %5, align 8, !tbaa !5
  %43 = fadd double %42, -5.000000e-01
  %44 = call double @dlnrel_(ptr noundef nonnull %3) #5
  %45 = call double @llvm.fmuladd.f64(double %43, double %44, double %41)
  br label %72

46:                                               ; preds = %12
  %47 = fadd double %., %8
  store double %47, ptr %3, align 8, !tbaa !5
  %48 = call double @d9lgmc_(ptr noundef nonnull %4) #5
  %49 = call double @d9lgmc_(ptr noundef nonnull %5) #5
  %50 = fadd double %48, %49
  %51 = call double @d9lgmc_(ptr noundef nonnull %3) #5
  %52 = fsub double %50, %51
  %53 = load double, ptr %4, align 8, !tbaa !5
  %54 = fneg double %53
  %55 = load double, ptr %5, align 8, !tbaa !5
  %56 = fadd double %53, %55
  %57 = fdiv double %54, %56
  store double %57, ptr %3, align 8, !tbaa !5
  %58 = call double @log(double noundef %55) #5
  %59 = load double, ptr @dlbeta_.sq2pil, align 8, !tbaa !5
  %60 = call double @llvm.fmuladd.f64(double %58, double -5.000000e-01, double %59)
  %61 = fadd double %52, %60
  %62 = load double, ptr %4, align 8, !tbaa !5
  %63 = fadd double %62, -5.000000e-01
  %64 = load double, ptr %5, align 8, !tbaa !5
  %65 = fadd double %62, %64
  %66 = fdiv double %62, %65
  %67 = call double @log(double noundef %66) #5
  %68 = call double @llvm.fmuladd.f64(double %63, double %67, double %61)
  %69 = load double, ptr %5, align 8, !tbaa !5
  %70 = call double @dlnrel_(ptr noundef nonnull %3) #5
  %71 = call double @llvm.fmuladd.f64(double %69, double %70, double %68)
  br label %72

72:                                               ; preds = %46, %24, %17
  %.0 = phi double [ %71, %46 ], [ %45, %24 ], [ %23, %17 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #5
  ret double %.0
}

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

declare i32 @xermsg_(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, i64 noundef, i64 noundef, i64 noundef) local_unnamed_addr #2

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

declare double @dgamma_(ptr noundef) local_unnamed_addr #2

declare double @d9lgmc_(ptr noundef) local_unnamed_addr #2

declare double @dlngam_(ptr noundef) local_unnamed_addr #2

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

declare double @dlnrel_(ptr noundef) local_unnamed_addr #2

; Function Attrs: mustprogress 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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "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 = { 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 #4 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { 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"}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass