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

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

@dlnrel_.alnrcs = external hidden global [43 x double], align 16
@c__3 = external hidden global i64, align 8
@c__43 = external hidden global i64, align 8
@c__4 = external hidden global i64, 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 [11 x i8], align 1
@c__2 = external hidden global i64, align 8
@.str.3 = external hidden unnamed_addr constant [47 x i8], align 1
@c__1 = external hidden global i64, align 8

; Function Attrs: nounwind uwtable
define dso_local double @dlnrel_(ptr noundef %0) #0 {
  %2 = alloca ptr, align 8
  %3 = alloca float, align 4
  %4 = alloca double, align 8
  %5 = alloca double, align 8
  %6 = alloca double, align 8
  %7 = alloca i64, align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #5
  store double 0.000000e+00, ptr %4, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #5
  %8 = call double @d1mach_(ptr noundef @c__3)
  %9 = fptrunc double %8 to float
  %10 = fmul float %9, 0x3FB99999A0000000
  store float %10, ptr %3, align 4, !tbaa !11
  %11 = call i64 @initds_(ptr noundef @dlnrel_.alnrcs, ptr noundef @c__43, ptr noundef %3)
  store i64 %11, ptr %7, align 8, !tbaa !13
  %12 = call double @d1mach_(ptr noundef @c__4)
  %13 = call double @sqrt(double noundef %12) #5
  %14 = fsub double %13, 1.000000e+00
  store double %14, ptr %6, align 8, !tbaa !9
  %15 = load ptr, ptr %2, align 8, !tbaa !5
  %16 = load double, ptr %15, align 8, !tbaa !9
  %17 = fcmp ole double %16, -1.000000e+00
  br i1 %17, label %18, label %20

18:                                               ; preds = %1
  %19 = call i32 @xermsg_(ptr noundef @.str, ptr noundef @.str.1, ptr noundef @.str.2, ptr noundef @c__2, ptr noundef @c__2, i64 noundef 6, i64 noundef 6, i64 noundef 10)
  br label %20

20:                                               ; preds = %18, %1
  %21 = load ptr, ptr %2, align 8, !tbaa !5
  %22 = load double, ptr %21, align 8, !tbaa !9
  %23 = load double, ptr %6, align 8, !tbaa !9
  %24 = fcmp olt double %22, %23
  br i1 %24, label %25, label %27

25:                                               ; preds = %20
  %26 = call i32 @xermsg_(ptr noundef @.str, ptr noundef @.str.1, ptr noundef @.str.3, ptr noundef @c__1, ptr noundef @c__1, i64 noundef 6, i64 noundef 6, i64 noundef 46)
  br label %27

27:                                               ; preds = %25, %20
  %28 = load ptr, ptr %2, align 8, !tbaa !5
  %29 = load double, ptr %28, align 8, !tbaa !9
  %30 = fcmp oge double %29, 0.000000e+00
  br i1 %30, label %31, label %34

31:                                               ; preds = %27
  %32 = load ptr, ptr %2, align 8, !tbaa !5
  %33 = load double, ptr %32, align 8, !tbaa !9
  br label %38

34:                                               ; preds = %27
  %35 = load ptr, ptr %2, align 8, !tbaa !5
  %36 = load double, ptr %35, align 8, !tbaa !9
  %37 = fneg double %36
  br label %38

38:                                               ; preds = %34, %31
  %39 = phi double [ %33, %31 ], [ %37, %34 ]
  %40 = fcmp ole double %39, 3.750000e-01
  br i1 %40, label %41, label %53

41:                                               ; preds = %38
  %42 = load ptr, ptr %2, align 8, !tbaa !5
  %43 = load double, ptr %42, align 8, !tbaa !9
  %44 = fdiv double %43, 3.750000e-01
  store double %44, ptr %5, align 8, !tbaa !9
  %45 = load ptr, ptr %2, align 8, !tbaa !5
  %46 = load double, ptr %45, align 8, !tbaa !9
  %47 = load ptr, ptr %2, align 8, !tbaa !5
  %48 = load double, ptr %47, align 8, !tbaa !9
  %49 = call double @dcsevl_(ptr noundef %5, ptr noundef @dlnrel_.alnrcs, ptr noundef %7)
  %50 = fneg double %48
  %51 = call double @llvm.fmuladd.f64(double %50, double %49, double 1.000000e+00)
  %52 = fmul double %46, %51
  store double %52, ptr %4, align 8, !tbaa !9
  br label %53

53:                                               ; preds = %41, %38
  %54 = load ptr, ptr %2, align 8, !tbaa !5
  %55 = load double, ptr %54, align 8, !tbaa !9
  %56 = fcmp oge double %55, 0.000000e+00
  br i1 %56, label %57, label %60

57:                                               ; preds = %53
  %58 = load ptr, ptr %2, align 8, !tbaa !5
  %59 = load double, ptr %58, align 8, !tbaa !9
  br label %64

60:                                               ; preds = %53
  %61 = load ptr, ptr %2, align 8, !tbaa !5
  %62 = load double, ptr %61, align 8, !tbaa !9
  %63 = fneg double %62
  br label %64

64:                                               ; preds = %60, %57
  %65 = phi double [ %59, %57 ], [ %63, %60 ]
  %66 = fcmp ogt double %65, 3.750000e-01
  br i1 %66, label %67, label %72

67:                                               ; preds = %64
  %68 = load ptr, ptr %2, align 8, !tbaa !5
  %69 = load double, ptr %68, align 8, !tbaa !9
  %70 = fadd double %69, 1.000000e+00
  %71 = call double @log(double noundef %70) #5
  store double %71, ptr %4, align 8, !tbaa !9
  br label %72

72:                                               ; preds = %67, %64
  %73 = load double, ptr %4, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #5
  ret double %73
}

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

declare double @d1mach_(ptr noundef) #2

declare i64 @initds_(ptr noundef, ptr noundef, ptr noundef) #2

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

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

declare double @dcsevl_(ptr noundef, ptr noundef, ptr noundef) #2

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

; Function Attrs: nounwind
declare double @log(double noundef) #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 = { "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}
!11 = !{!12, !12, i64 0}
!12 = !{!"float", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"long", !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"

@dlnrel_.alnrcs = external hidden global [43 x double], align 16
@c__3 = external hidden global i64, align 8
@c__43 = external hidden global i64, align 8
@c__4 = external hidden global i64, 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 [11 x i8], align 1
@c__2 = external hidden global i64, align 8
@.str.3 = external hidden unnamed_addr constant [47 x i8], align 1
@c__1 = external hidden global i64, align 8

; Function Attrs: nounwind uwtable
define dso_local double @dlnrel_(ptr nocapture noundef readonly %0) local_unnamed_addr #0 {
  %2 = alloca float, align 4
  %3 = alloca double, align 8
  %4 = alloca i64, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #5
  %5 = tail call double @d1mach_(ptr noundef nonnull @c__3) #5
  %6 = fptrunc double %5 to float
  %7 = fmul float %6, 0x3FB99999A0000000
  store float %7, ptr %2, align 4, !tbaa !5
  %8 = call i64 @initds_(ptr noundef nonnull @dlnrel_.alnrcs, ptr noundef nonnull @c__43, ptr noundef nonnull %2) #5
  store i64 %8, ptr %4, align 8, !tbaa !9
  %9 = call double @d1mach_(ptr noundef nonnull @c__4) #5
  %10 = call double @sqrt(double noundef %9) #5
  %11 = fadd double %10, -1.000000e+00
  %12 = load double, ptr %0, align 8, !tbaa !11
  %13 = fcmp ugt double %12, -1.000000e+00
  br i1 %13, label %16, label %14

14:                                               ; preds = %1
  %15 = call i32 @xermsg_(ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, ptr noundef nonnull @.str.2, ptr noundef nonnull @c__2, ptr noundef nonnull @c__2, i64 noundef 6, i64 noundef 6, i64 noundef 10) #5
  %.pre = load double, ptr %0, align 8, !tbaa !11
  br label %16

16:                                               ; preds = %14, %1
  %17 = phi double [ %.pre, %14 ], [ %12, %1 ]
  %18 = fcmp olt double %17, %11
  br i1 %18, label %19, label %21

19:                                               ; preds = %16
  %20 = call i32 @xermsg_(ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, ptr noundef nonnull @.str.3, ptr noundef nonnull @c__1, ptr noundef nonnull @c__1, i64 noundef 6, i64 noundef 6, i64 noundef 46) #5
  %.pre18 = load double, ptr %0, align 8, !tbaa !11
  br label %21

21:                                               ; preds = %19, %16
  %22 = phi double [ %.pre18, %19 ], [ %17, %16 ]
  %23 = fcmp ult double %22, 0.000000e+00
  %24 = fneg double %22
  %25 = select i1 %23, double %24, double %22
  %26 = fcmp ugt double %25, 3.750000e-01
  br i1 %26, label %32, label %27

27:                                               ; preds = %21
  %28 = fdiv double %22, 3.750000e-01
  store double %28, ptr %3, align 8, !tbaa !11
  %29 = call double @dcsevl_(ptr noundef nonnull %3, ptr noundef nonnull @dlnrel_.alnrcs, ptr noundef nonnull %4) #5
  %30 = call double @llvm.fmuladd.f64(double %24, double %29, double 1.000000e+00)
  %31 = fmul double %22, %30
  %.pre19 = load double, ptr %0, align 8, !tbaa !11
  %.pre20 = fneg double %.pre19
  br label %32

32:                                               ; preds = %27, %21
  %.pre-phi = phi double [ %.pre20, %27 ], [ %24, %21 ]
  %33 = phi double [ %.pre19, %27 ], [ %22, %21 ]
  %.0 = phi double [ %31, %27 ], [ 0.000000e+00, %21 ]
  %34 = fcmp ult double %33, 0.000000e+00
  %35 = select i1 %34, double %.pre-phi, double %33
  %36 = fcmp ogt double %35, 3.750000e-01
  br i1 %36, label %37, label %40

37:                                               ; preds = %32
  %38 = fadd double %33, 1.000000e+00
  %39 = call double @log(double noundef %38) #5
  br label %40

40:                                               ; preds = %37, %32
  %.1 = phi double [ %39, %37 ], [ %.0, %32 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #5
  ret double %.1
}

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

declare double @d1mach_(ptr noundef) local_unnamed_addr #2

declare i64 @initds_(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

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

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

declare double @dcsevl_(ptr noundef, ptr noundef, 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

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

; 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 = !{!"float", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"double", !7, i64 0}


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