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

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

%"class.juce::Path" = type <{ %"class.juce::ArrayAllocationBase.123", i64, %"struct.juce::Path::PathBounds", i8, [7 x i8] }>
%"class.juce::ArrayAllocationBase.123" = type <{ %"class.juce::HeapBlock.124", i32, [4 x i8] }>
%"class.juce::HeapBlock.124" = type { ptr }
%"struct.juce::Path::PathBounds" = type { float, float, float, float }

@_ZZN4juce14LookAndFeel_V212getTickShapeEfE13tickShapeData = external hidden constant [217 x i8], align 16

declare i32 @__gxx_personality_v0(...)

declare void @_ZN4juce4PathC1Ev(ptr noundef nonnull align 8 dereferenceable(41)) unnamed_addr #0

; Function Attrs: nounwind
declare void @_ZN4juce4PathD1Ev(ptr noundef nonnull align 8 dereferenceable(41)) unnamed_addr #1

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4juce14LookAndFeel_V212getTickShapeEf(ptr dead_on_unwind noalias writable sret(%"class.juce::Path") align 8 %0, ptr noundef nonnull align 8 dereferenceable(304) %1, float noundef %2) unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca float, align 4
  %7 = alloca i1, align 1
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  store ptr %0, ptr %4, align 8
  store ptr %1, ptr %5, align 8, !tbaa !5
  store float %2, ptr %6, align 4, !tbaa !9
  %10 = load ptr, ptr %5, align 8
  store i1 false, ptr %7, align 1
  call void @_ZN4juce4PathC1Ev(ptr noundef nonnull align 8 dereferenceable(41) %0)
  invoke void @_ZN4juce4Path16loadPathFromDataEPKvm(ptr noundef nonnull align 8 dereferenceable(41) %0, ptr noundef @_ZZN4juce14LookAndFeel_V212getTickShapeEfE13tickShapeData, i64 noundef 217)
          to label %11 unwind label %16

11:                                               ; preds = %3
  %12 = load float, ptr %6, align 4, !tbaa !9
  %13 = fmul float %12, 2.000000e+00
  %14 = load float, ptr %6, align 4, !tbaa !9
  call void @_ZN4juce4Path10scaleToFitEffffb(ptr noundef nonnull align 8 dereferenceable(41) %0, float noundef 0.000000e+00, float noundef 0.000000e+00, float noundef %13, float noundef %14, i1 noundef zeroext true) #3
  store i1 true, ptr %7, align 1
  %15 = load i1, ptr %7, align 1
  br i1 %15, label %21, label %20

16:                                               ; preds = %3
  %17 = landingpad { ptr, i32 }
          cleanup
  %18 = extractvalue { ptr, i32 } %17, 0
  store ptr %18, ptr %8, align 8
  %19 = extractvalue { ptr, i32 } %17, 1
  store i32 %19, ptr %9, align 4
  call void @_ZN4juce4PathD1Ev(ptr noundef nonnull align 8 dereferenceable(41) %0) #3
  br label %22

20:                                               ; preds = %11
  call void @_ZN4juce4PathD1Ev(ptr noundef nonnull align 8 dereferenceable(41) %0) #3
  br label %21

21:                                               ; preds = %20, %11
  ret void

22:                                               ; preds = %16
  %23 = load ptr, ptr %8, align 8
  %24 = load i32, ptr %9, align 4
  %25 = insertvalue { ptr, i32 } poison, ptr %23, 0
  %26 = insertvalue { ptr, i32 } %25, i32 %24, 1
  resume { ptr, i32 } %26
}

declare void @_ZN4juce4Path16loadPathFromDataEPKvm(ptr noundef nonnull align 8 dereferenceable(41), ptr noundef, i64 noundef) #0

; Function Attrs: nounwind
declare void @_ZN4juce4Path10scaleToFitEffffb(ptr noundef nonnull align 8 dereferenceable(41), float noundef, float noundef, float noundef, float noundef, i1 noundef zeroext) #1

attributes #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 = { 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 #2 = { 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 #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)"}
!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 = !{!"float", !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"

%"class.juce::Path" = type <{ %"class.juce::ArrayAllocationBase.123", i64, %"struct.juce::Path::PathBounds", i8, [7 x i8] }>
%"class.juce::ArrayAllocationBase.123" = type <{ %"class.juce::HeapBlock.124", i32, [4 x i8] }>
%"class.juce::HeapBlock.124" = type { ptr }
%"struct.juce::Path::PathBounds" = type { float, float, float, float }

@_ZZN4juce14LookAndFeel_V212getTickShapeEfE13tickShapeData = external hidden constant [217 x i8], align 16

declare i32 @__gxx_personality_v0(...)

declare void @_ZN4juce4PathC1Ev(ptr noundef nonnull align 8 dereferenceable(41)) unnamed_addr #0

; Function Attrs: nounwind
declare void @_ZN4juce4PathD1Ev(ptr noundef nonnull align 8 dereferenceable(41)) unnamed_addr #1

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4juce14LookAndFeel_V212getTickShapeEf(ptr dead_on_unwind noalias nonnull writable sret(%"class.juce::Path") align 8 %0, ptr nocapture noundef nonnull readnone align 8 dereferenceable(304) %1, float noundef %2) unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  tail call void @_ZN4juce4PathC1Ev(ptr noundef nonnull align 8 dereferenceable(41) %0)
  invoke void @_ZN4juce4Path16loadPathFromDataEPKvm(ptr noundef nonnull align 8 dereferenceable(41) %0, ptr noundef nonnull @_ZZN4juce14LookAndFeel_V212getTickShapeEfE13tickShapeData, i64 noundef 217)
          to label %4 unwind label %6

4:                                                ; preds = %3
  %5 = fmul float %2, 2.000000e+00
  tail call void @_ZN4juce4Path10scaleToFitEffffb(ptr noundef nonnull align 8 dereferenceable(41) %0, float noundef 0.000000e+00, float noundef 0.000000e+00, float noundef %5, float noundef %2, i1 noundef zeroext true) #3
  ret void

6:                                                ; preds = %3
  %7 = landingpad { ptr, i32 }
          cleanup
  tail call void @_ZN4juce4PathD1Ev(ptr noundef nonnull align 8 dereferenceable(41) %0) #3
  resume { ptr, i32 } %7
}

declare void @_ZN4juce4Path16loadPathFromDataEPKvm(ptr noundef nonnull align 8 dereferenceable(41), ptr noundef, i64 noundef) local_unnamed_addr #0

; Function Attrs: nounwind
declare void @_ZN4juce4Path10scaleToFitEffffb(ptr noundef nonnull align 8 dereferenceable(41), float noundef, float noundef, float noundef, float noundef, i1 noundef zeroext) local_unnamed_addr #1

attributes #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 = { 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 #2 = { 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 #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: EarlyCSEPass,GlobalOptPass,IPSCCPPass,InstCombinePass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass