; LLVM IR from modlfo/AudioEngine :: AudioEngine/JuceLibraryCode (juce_gui_basics)

; 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: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZSt3absd(double noundef) #1

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef double @_ZNK4juce6Slider13getSkewFactorEv(ptr noundef nonnull align 8 dereferenceable(224)) #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK4juce6Slider15isSymmetricSkewEv(ptr noundef nonnull align 8 dereferenceable(224)) #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef double @_ZNK4juce6Slider10getMaximumEv(ptr noundef nonnull align 8 dereferenceable(224)) #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef double @_ZNK4juce6Slider10getMinimumEv(ptr noundef nonnull align 8 dereferenceable(224)) #3 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef double @_ZN4juce6Slider25proportionOfLengthToValueEd(ptr noundef nonnull align 8 dereferenceable(224) %0, double noundef %1) unnamed_addr #4 align 2 {
  %3 = alloca double, align 8
  %4 = alloca ptr, align 8
  %5 = alloca double, align 8
  %6 = alloca double, align 8
  %7 = alloca i32, align 4
  %8 = alloca double, align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  store double %1, ptr %5, align 8, !tbaa !9
  %9 = load ptr, ptr %4, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #6
  %10 = call noundef double @_ZNK4juce6Slider13getSkewFactorEv(ptr noundef nonnull align 8 dereferenceable(224) %9) #6
  store double %10, ptr %6, align 8, !tbaa !9
  %11 = call noundef zeroext i1 @_ZNK4juce6Slider15isSymmetricSkewEv(ptr noundef nonnull align 8 dereferenceable(224) %9) #6
  br i1 %11, label %31, label %12

12:                                               ; preds = %2
  %13 = load double, ptr %6, align 8, !tbaa !9
  %14 = fcmp une double %13, 1.000000e+00
  br i1 %14, label %15, label %24

15:                                               ; preds = %12
  %16 = load double, ptr %5, align 8, !tbaa !9
  %17 = fcmp ogt double %16, 0.000000e+00
  br i1 %17, label %18, label %24

18:                                               ; preds = %15
  %19 = load double, ptr %5, align 8, !tbaa !9
  %20 = call double @log(double noundef %19) #6
  %21 = load double, ptr %6, align 8, !tbaa !9
  %22 = fdiv double %20, %21
  %23 = call double @exp(double noundef %22) #6
  store double %23, ptr %5, align 8, !tbaa !9
  br label %24

24:                                               ; preds = %18, %15, %12
  %25 = call noundef double @_ZNK4juce6Slider10getMinimumEv(ptr noundef nonnull align 8 dereferenceable(224) %9) #6
  %26 = call noundef double @_ZNK4juce6Slider10getMaximumEv(ptr noundef nonnull align 8 dereferenceable(224) %9) #6
  %27 = call noundef double @_ZNK4juce6Slider10getMinimumEv(ptr noundef nonnull align 8 dereferenceable(224) %9) #6
  %28 = fsub double %26, %27
  %29 = load double, ptr %5, align 8, !tbaa !9
  %30 = call double @llvm.fmuladd.f64(double %28, double %29, double %25)
  store double %30, ptr %3, align 8
  store i32 1, ptr %7, align 4
  br label %61

31:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #6
  %32 = load double, ptr %5, align 8, !tbaa !9
  %33 = call double @llvm.fmuladd.f64(double 2.000000e+00, double %32, double -1.000000e+00)
  store double %33, ptr %8, align 8, !tbaa !9
  %34 = load double, ptr %6, align 8, !tbaa !9
  %35 = fcmp une double %34, 1.000000e+00
  br i1 %35, label %36, label %52

36:                                               ; preds = %31
  %37 = load double, ptr %8, align 8, !tbaa !9
  %38 = fcmp une double %37, 0.000000e+00
  br i1 %38, label %39, label %52

39:                                               ; preds = %36
  %40 = load double, ptr %8, align 8, !tbaa !9
  %41 = call noundef double @_ZSt3absd(double noundef %40)
  %42 = call double @log(double noundef %41) #6
  %43 = load double, ptr %6, align 8, !tbaa !9
  %44 = fdiv double %42, %43
  %45 = call double @exp(double noundef %44) #6
  %46 = load double, ptr %8, align 8, !tbaa !9
  %47 = fcmp olt double %46, 0.000000e+00
  %48 = zext i1 %47 to i64
  %49 = select i1 %47, i32 -1, i32 1
  %50 = sitofp i32 %49 to double
  %51 = fmul double %45, %50
  store double %51, ptr %8, align 8, !tbaa !9
  br label %52

52:                                               ; preds = %39, %36, %31
  %53 = call noundef double @_ZNK4juce6Slider10getMinimumEv(ptr noundef nonnull align 8 dereferenceable(224) %9) #6
  %54 = call noundef double @_ZNK4juce6Slider10getMaximumEv(ptr noundef nonnull align 8 dereferenceable(224) %9) #6
  %55 = call noundef double @_ZNK4juce6Slider10getMinimumEv(ptr noundef nonnull align 8 dereferenceable(224) %9) #6
  %56 = fsub double %54, %55
  %57 = fdiv double %56, 2.000000e+00
  %58 = load double, ptr %8, align 8, !tbaa !9
  %59 = fadd double 1.000000e+00, %58
  %60 = call double @llvm.fmuladd.f64(double %57, double %59, double %53)
  store double %60, ptr %3, align 8
  store i32 1, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  br label %61

61:                                               ; preds = %52, %24
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #6
  %62 = load double, ptr %3, align 8
  ret double %62
}

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

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { inlinehint mustprogress 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 #2 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #3 = { mustprogress 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 #4 = { mustprogress 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 #5 = { 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 #6 = { 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++ 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"

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZSt3absd(double noundef) local_unnamed_addr #0

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef double @_ZNK4juce6Slider13getSkewFactorEv(ptr noundef nonnull align 8 dereferenceable(224)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK4juce6Slider15isSymmetricSkewEv(ptr noundef nonnull align 8 dereferenceable(224)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef double @_ZNK4juce6Slider10getMaximumEv(ptr noundef nonnull align 8 dereferenceable(224)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef double @_ZNK4juce6Slider10getMinimumEv(ptr noundef nonnull align 8 dereferenceable(224)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
define dso_local noundef double @_ZN4juce6Slider25proportionOfLengthToValueEd(ptr noundef nonnull align 8 dereferenceable(224) %0, double noundef %1) unnamed_addr #2 align 2 {
  %3 = tail call noundef double @_ZNK4juce6Slider13getSkewFactorEv(ptr noundef nonnull align 8 dereferenceable(224) %0) #4
  %4 = tail call noundef zeroext i1 @_ZNK4juce6Slider15isSymmetricSkewEv(ptr noundef nonnull align 8 dereferenceable(224) %0) #4
  br i1 %4, label %18, label %5

5:                                                ; preds = %2
  %6 = fcmp une double %3, 1.000000e+00
  %7 = fcmp ogt double %1, 0.000000e+00
  %or.cond = and i1 %7, %6
  br i1 %or.cond, label %8, label %12

8:                                                ; preds = %5
  %9 = tail call double @log(double noundef %1) #4
  %10 = fdiv double %9, %3
  %11 = tail call double @exp(double noundef %10) #4
  br label %12

12:                                               ; preds = %8, %5
  %.018 = phi double [ %11, %8 ], [ %1, %5 ]
  %13 = tail call noundef double @_ZNK4juce6Slider10getMinimumEv(ptr noundef nonnull align 8 dereferenceable(224) %0) #4
  %14 = tail call noundef double @_ZNK4juce6Slider10getMaximumEv(ptr noundef nonnull align 8 dereferenceable(224) %0) #4
  %15 = tail call noundef double @_ZNK4juce6Slider10getMinimumEv(ptr noundef nonnull align 8 dereferenceable(224) %0) #4
  %16 = fsub double %14, %15
  %17 = tail call double @llvm.fmuladd.f64(double %16, double %.018, double %13)
  br label %38

18:                                               ; preds = %2
  %19 = tail call double @llvm.fmuladd.f64(double %1, double 2.000000e+00, double -1.000000e+00)
  %20 = fcmp une double %3, 1.000000e+00
  %21 = fcmp une double %19, 0.000000e+00
  %or.cond3 = and i1 %21, %20
  br i1 %or.cond3, label %22, label %30

22:                                               ; preds = %18
  %23 = tail call noundef double @_ZSt3absd(double noundef %19)
  %24 = tail call double @log(double noundef %23) #4
  %25 = fdiv double %24, %3
  %26 = tail call double @exp(double noundef %25) #4
  %27 = fcmp olt double %19, 0.000000e+00
  %28 = fneg double %26
  %29 = select i1 %27, double %28, double %26
  br label %30

30:                                               ; preds = %22, %18
  %.0 = phi double [ %29, %22 ], [ %19, %18 ]
  %31 = tail call noundef double @_ZNK4juce6Slider10getMinimumEv(ptr noundef nonnull align 8 dereferenceable(224) %0) #4
  %32 = tail call noundef double @_ZNK4juce6Slider10getMaximumEv(ptr noundef nonnull align 8 dereferenceable(224) %0) #4
  %33 = tail call noundef double @_ZNK4juce6Slider10getMinimumEv(ptr noundef nonnull align 8 dereferenceable(224) %0) #4
  %34 = fsub double %32, %33
  %35 = fmul double %34, 5.000000e-01
  %36 = fadd double %.0, 1.000000e+00
  %37 = tail call double @llvm.fmuladd.f64(double %35, double %36, double %31)
  br label %38

38:                                               ; preds = %30, %12
  %.017 = phi double [ %37, %30 ], [ %17, %12 ]
  ret double %.017
}

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

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

attributes #0 = { inlinehint mustprogress 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 speculatable willreturn memory(none) }
attributes #2 = { mustprogress 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 #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 = { 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: EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass