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

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

@d9lgmc_.algmcs = external hidden global [15 x double], align 16
@c__3 = external hidden global i64, align 8
@c__15 = external hidden global i64, align 8
@c__2 = external hidden global i64, align 8
@c__1 = 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 [16 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [27 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local double @d9lgmc_(ptr noundef %0) #0 {
  %2 = alloca double, align 8
  %3 = alloca ptr, align 8
  %4 = alloca float, align 4
  %5 = alloca double, align 8
  %6 = alloca double, align 8
  %7 = alloca double, align 8
  %8 = alloca double, align 8
  %9 = alloca double, align 8
  %10 = alloca i64, align 8
  %11 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #5
  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
  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 = call double @d1mach_(ptr noundef @c__3)
  %13 = fptrunc double %12 to float
  store float %13, ptr %4, align 4, !tbaa !9
  %14 = call i64 @initds_(ptr noundef @d9lgmc_.algmcs, ptr noundef @c__15, ptr noundef %4)
  store i64 %14, ptr %10, align 8, !tbaa !11
  %15 = call double @d1mach_(ptr noundef @c__3)
  %16 = call double @sqrt(double noundef %15) #5
  %17 = fdiv double 1.000000e+00, %16
  store double %17, ptr %8, align 8, !tbaa !13
  %18 = call double @d1mach_(ptr noundef @c__2)
  %19 = fdiv double %18, 1.200000e+01
  %20 = call double @log(double noundef %19) #5
  store double %20, ptr %6, align 8, !tbaa !13
  %21 = call double @d1mach_(ptr noundef @c__1)
  %22 = fmul double %21, 1.200000e+01
  %23 = call double @log(double noundef %22) #5
  %24 = fneg double %23
  store double %24, ptr %7, align 8, !tbaa !13
  %25 = load double, ptr %6, align 8, !tbaa !13
  %26 = load double, ptr %7, align 8, !tbaa !13
  %27 = fcmp ole double %25, %26
  br i1 %27, label %28, label %30

28:                                               ; preds = %1
  %29 = load double, ptr %6, align 8, !tbaa !13
  br label %32

30:                                               ; preds = %1
  %31 = load double, ptr %7, align 8, !tbaa !13
  br label %32

32:                                               ; preds = %30, %28
  %33 = phi double [ %29, %28 ], [ %31, %30 ]
  %34 = call double @exp(double noundef %33) #5
  store double %34, ptr %9, align 8, !tbaa !13
  %35 = load ptr, ptr %3, align 8, !tbaa !5
  %36 = load double, ptr %35, align 8, !tbaa !13
  %37 = fcmp olt double %36, 1.000000e+01
  br i1 %37, label %38, label %40

38:                                               ; preds = %32
  %39 = 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 15)
  br label %40

40:                                               ; preds = %38, %32
  %41 = load ptr, ptr %3, align 8, !tbaa !5
  %42 = load double, ptr %41, align 8, !tbaa !13
  %43 = load double, ptr %9, align 8, !tbaa !13
  %44 = fcmp oge double %42, %43
  br i1 %44, label %45, label %46

45:                                               ; preds = %40
  br label %69

46:                                               ; preds = %40
  %47 = load ptr, ptr %3, align 8, !tbaa !5
  %48 = load double, ptr %47, align 8, !tbaa !13
  %49 = fmul double %48, 1.200000e+01
  %50 = fdiv double 1.000000e+00, %49
  store double %50, ptr %5, align 8, !tbaa !13
  %51 = load ptr, ptr %3, align 8, !tbaa !5
  %52 = load double, ptr %51, align 8, !tbaa !13
  %53 = load double, ptr %8, align 8, !tbaa !13
  %54 = fcmp olt double %52, %53
  br i1 %54, label %55, label %67

55:                                               ; preds = %46
  %56 = load ptr, ptr %3, align 8, !tbaa !5
  %57 = load double, ptr %56, align 8, !tbaa !13
  %58 = fdiv double 1.000000e+01, %57
  store double %58, ptr %7, align 8, !tbaa !13
  %59 = load double, ptr %7, align 8, !tbaa !13
  %60 = load double, ptr %7, align 8, !tbaa !13
  %61 = fmul double %59, %60
  %62 = call double @llvm.fmuladd.f64(double %61, double 2.000000e+00, double -1.000000e+00)
  store double %62, ptr %6, align 8, !tbaa !13
  %63 = call double @dcsevl_(ptr noundef %6, ptr noundef @d9lgmc_.algmcs, ptr noundef %10)
  %64 = load ptr, ptr %3, align 8, !tbaa !5
  %65 = load double, ptr %64, align 8, !tbaa !13
  %66 = fdiv double %63, %65
  store double %66, ptr %5, align 8, !tbaa !13
  br label %67

67:                                               ; preds = %55, %46
  %68 = load double, ptr %5, align 8, !tbaa !13
  store double %68, ptr %2, align 8
  store i32 1, ptr %11, align 4
  br label %72

69:                                               ; preds = %45
  store double 0.000000e+00, ptr %5, align 8, !tbaa !13
  %70 = call i32 @xermsg_(ptr noundef @.str, ptr noundef @.str.1, ptr noundef @.str.3, ptr noundef @c__2, ptr noundef @c__1, i64 noundef 6, i64 noundef 6, i64 noundef 26)
  %71 = load double, ptr %5, align 8, !tbaa !13
  store double %71, ptr %2, align 8
  store i32 1, ptr %11, align 4
  br label %72

72:                                               ; preds = %69, %67
  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
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #5
  %73 = load double, ptr %2, align 8
  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

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

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

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

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

declare double @dcsevl_(ptr noundef, ptr noundef, 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 = !{!"float", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"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"

@d9lgmc_.algmcs = external hidden global [15 x double], align 16
@c__3 = external hidden global i64, align 8
@c__15 = external hidden global i64, align 8
@c__2 = external hidden global i64, align 8
@c__1 = 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 [16 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [27 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local double @d9lgmc_(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
  store float %6, ptr %2, align 4, !tbaa !5
  %7 = call i64 @initds_(ptr noundef nonnull @d9lgmc_.algmcs, ptr noundef nonnull @c__15, ptr noundef nonnull %2) #5
  store i64 %7, ptr %4, align 8, !tbaa !9
  %8 = call double @d1mach_(ptr noundef nonnull @c__3) #5
  %9 = call double @sqrt(double noundef %8) #5
  %10 = fdiv double 1.000000e+00, %9
  %11 = call double @d1mach_(ptr noundef nonnull @c__2) #5
  %12 = fdiv double %11, 1.200000e+01
  %13 = call double @log(double noundef %12) #5
  %14 = call double @d1mach_(ptr noundef nonnull @c__1) #5
  %15 = fmul double %14, 1.200000e+01
  %16 = call double @log(double noundef %15) #5
  %17 = fneg double %16
  %18 = fcmp ole double %13, %17
  %19 = select i1 %18, double %13, double %17
  %20 = call double @exp(double noundef %19) #5
  %21 = load double, ptr %0, align 8, !tbaa !11
  %22 = fcmp olt double %21, 1.000000e+01
  br i1 %22, label %23, label %25

23:                                               ; preds = %1
  %24 = 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 15) #5
  %.pre = load double, ptr %0, align 8, !tbaa !11
  br label %25

25:                                               ; preds = %23, %1
  %26 = phi double [ %.pre, %23 ], [ %21, %1 ]
  %27 = fcmp ult double %26, %20
  br i1 %27, label %28, label %39

28:                                               ; preds = %25
  %29 = fmul double %26, 1.200000e+01
  %30 = fdiv double 1.000000e+00, %29
  %31 = fcmp olt double %26, %10
  br i1 %31, label %32, label %41

32:                                               ; preds = %28
  %33 = fdiv double 1.000000e+01, %26
  %34 = fmul double %33, %33
  %35 = call double @llvm.fmuladd.f64(double %34, double 2.000000e+00, double -1.000000e+00)
  store double %35, ptr %3, align 8, !tbaa !11
  %36 = call double @dcsevl_(ptr noundef nonnull %3, ptr noundef nonnull @d9lgmc_.algmcs, ptr noundef nonnull %4) #5
  %37 = load double, ptr %0, align 8, !tbaa !11
  %38 = fdiv double %36, %37
  br label %41

39:                                               ; preds = %25
  %40 = call i32 @xermsg_(ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, ptr noundef nonnull @.str.3, ptr noundef nonnull @c__2, ptr noundef nonnull @c__1, i64 noundef 6, i64 noundef 6, i64 noundef 26) #5
  br label %41

41:                                               ; preds = %28, %32, %39
  %.0 = phi double [ 0.000000e+00, %39 ], [ %38, %32 ], [ %30, %28 ]
  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 %.0
}

; 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

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

; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @exp(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

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

declare double @dcsevl_(ptr noundef, ptr noundef, 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 = !{!"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: DSEPass,EarlyCSEPass,GVNPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass