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

%"class.juce::ComponentAnimator" = type <{ %"class.juce::ChangeBroadcaster", %"class.juce::Timer", %"class.juce::OwnedArray", i32, [4 x i8] }>
%"class.juce::ChangeBroadcaster" = type { ptr, %"class.juce::ChangeBroadcaster::ChangeBroadcasterCallback", %"class.juce::ListenerList.39" }
%"class.juce::ChangeBroadcaster::ChangeBroadcasterCallback" = type { %"class.juce::AsyncUpdater", ptr }
%"class.juce::AsyncUpdater" = type { ptr, %"class.juce::ReferenceCountedObjectPtr.15" }
%"class.juce::ReferenceCountedObjectPtr.15" = type { ptr }
%"class.juce::ListenerList.39" = type { %"class.juce::Array.40" }
%"class.juce::Array.40" = type { %"class.juce::ArrayAllocationBase.41", i32, [4 x i8] }
%"class.juce::ArrayAllocationBase.41" = type <{ %"class.juce::HeapBlock.42", i32, [4 x i8] }>
%"class.juce::HeapBlock.42" = type { ptr }
%"class.juce::Timer" = type { ptr, i32, i32, ptr, ptr }
%"class.juce::OwnedArray" = type { %"class.juce::ArrayAllocationBase.45", i32, [4 x i8] }
%"class.juce::ArrayAllocationBase.45" = type <{ %"class.juce::HeapBlock.46", i32, [4 x i8] }>
%"class.juce::HeapBlock.46" = type { ptr }

; 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: nounwind
declare void @_ZN4juce5Timer9stopTimerEv(ptr noundef nonnull align 8 dereferenceable(32)) #1

; Function Attrs: nounwind
declare noundef i32 @_ZN4juce4Time21getMillisecondCounterEv() #1

declare void @_ZN4juce17ChangeBroadcaster17sendChangeMessageEv(ptr noundef nonnull align 8 dereferenceable(56)) #2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK4juce10OwnedArrayINS_17ComponentAnimator13AnimationTaskENS_20DummyCriticalSectionEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(20)) #3 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNK4juce10OwnedArrayINS_17ComponentAnimator13AnimationTaskENS_20DummyCriticalSectionEE12getUncheckedEi(ptr noundef nonnull align 8 dereferenceable(20), i32 noundef) #3 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4juce17ComponentAnimator13timerCallbackEv(ptr noundef nonnull align 8 dereferenceable(116) %0) unnamed_addr #4 align 2 {
  %2 = alloca ptr, align 8
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  %6 = load ptr, ptr %2, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #5
  %7 = call noundef i32 @_ZN4juce4Time21getMillisecondCounterEv() #5
  store i32 %7, ptr %3, align 4, !tbaa !9
  %8 = getelementptr inbounds %"class.juce::ComponentAnimator", ptr %6, i32 0, i32 3
  %9 = load i32, ptr %8, align 8, !tbaa !11
  %10 = icmp eq i32 %9, 0
  br i1 %10, label %16, label %11

11:                                               ; preds = %1
  %12 = getelementptr inbounds %"class.juce::ComponentAnimator", ptr %6, i32 0, i32 3
  %13 = load i32, ptr %12, align 8, !tbaa !11
  %14 = load i32, ptr %3, align 4, !tbaa !9
  %15 = icmp eq i32 %13, %14
  br i1 %15, label %16, label %19

16:                                               ; preds = %11, %1
  %17 = load i32, ptr %3, align 4, !tbaa !9
  %18 = getelementptr inbounds %"class.juce::ComponentAnimator", ptr %6, i32 0, i32 3
  store i32 %17, ptr %18, align 8, !tbaa !11
  br label %19

19:                                               ; preds = %16, %11
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #5
  %20 = load i32, ptr %3, align 4, !tbaa !9
  %21 = getelementptr inbounds %"class.juce::ComponentAnimator", ptr %6, i32 0, i32 3
  %22 = load i32, ptr %21, align 8, !tbaa !11
  %23 = sub i32 %20, %22
  store i32 %23, ptr %4, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #5
  %24 = getelementptr inbounds %"class.juce::ComponentAnimator", ptr %6, i32 0, i32 2
  %25 = call noundef i32 @_ZNK4juce10OwnedArrayINS_17ComponentAnimator13AnimationTaskENS_20DummyCriticalSectionEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(20) %24) #5
  store i32 %25, ptr %5, align 4, !tbaa !9
  br label %26

26:                                               ; preds = %40, %19
  %27 = load i32, ptr %5, align 4, !tbaa !9
  %28 = add nsw i32 %27, -1
  store i32 %28, ptr %5, align 4, !tbaa !9
  %29 = icmp sge i32 %28, 0
  br i1 %29, label %31, label %30

30:                                               ; preds = %26
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  br label %41

31:                                               ; preds = %26
  %32 = getelementptr inbounds %"class.juce::ComponentAnimator", ptr %6, i32 0, i32 2
  %33 = load i32, ptr %5, align 4, !tbaa !9
  %34 = call noundef ptr @_ZNK4juce10OwnedArrayINS_17ComponentAnimator13AnimationTaskENS_20DummyCriticalSectionEE12getUncheckedEi(ptr noundef nonnull align 8 dereferenceable(20) %32, i32 noundef %33) #5
  %35 = load i32, ptr %4, align 4, !tbaa !9
  %36 = call noundef zeroext i1 @_ZN4juce17ComponentAnimator13AnimationTask12useTimesliceEi(ptr noundef nonnull align 8 dereferenceable(122) %34, i32 noundef %35)
  br i1 %36, label %40, label %37

37:                                               ; preds = %31
  %38 = getelementptr inbounds %"class.juce::ComponentAnimator", ptr %6, i32 0, i32 2
  %39 = load i32, ptr %5, align 4, !tbaa !9
  call void @_ZN4juce10OwnedArrayINS_17ComponentAnimator13AnimationTaskENS_20DummyCriticalSectionEE6removeEib(ptr noundef nonnull align 8 dereferenceable(20) %38, i32 noundef %39, i1 noundef zeroext true)
  call void @_ZN4juce17ChangeBroadcaster17sendChangeMessageEv(ptr noundef nonnull align 8 dereferenceable(56) %6)
  br label %40

40:                                               ; preds = %37, %31
  br label %26, !llvm.loop !25

41:                                               ; preds = %30
  %42 = load i32, ptr %3, align 4, !tbaa !9
  %43 = getelementptr inbounds %"class.juce::ComponentAnimator", ptr %6, i32 0, i32 3
  store i32 %42, ptr %43, align 8, !tbaa !11
  %44 = getelementptr inbounds %"class.juce::ComponentAnimator", ptr %6, i32 0, i32 2
  %45 = call noundef i32 @_ZNK4juce10OwnedArrayINS_17ComponentAnimator13AnimationTaskENS_20DummyCriticalSectionEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(20) %44) #5
  %46 = icmp eq i32 %45, 0
  br i1 %46, label %47, label %49

47:                                               ; preds = %41
  %48 = getelementptr inbounds i8, ptr %6, i64 56
  call void @_ZN4juce5Timer9stopTimerEv(ptr noundef nonnull align 8 dereferenceable(32) %48) #5
  br label %49

49:                                               ; preds = %47, %41
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #5
  ret void
}

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN4juce17ComponentAnimator13AnimationTask12useTimesliceEi(ptr noundef nonnull align 8 dereferenceable(122), i32 noundef) #4 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4juce10OwnedArrayINS_17ComponentAnimator13AnimationTaskENS_20DummyCriticalSectionEE6removeEib(ptr noundef nonnull align 8 dereferenceable(20), i32 noundef, i1 noundef zeroext) #4 align 2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { "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 = { 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 #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 }

!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 = !{!"int", !7, i64 0}
!11 = !{!12, !10, i64 112}
!12 = !{!"_ZTSN4juce17ComponentAnimatorE", !13, i64 0, !21, i64 56, !22, i64 88, !10, i64 112}
!13 = !{!"_ZTSN4juce17ChangeBroadcasterE", !14, i64 8, !17, i64 32}
!14 = !{!"_ZTSN4juce17ChangeBroadcaster25ChangeBroadcasterCallbackE", !15, i64 0, !6, i64 16}
!15 = !{!"_ZTSN4juce12AsyncUpdaterE", !16, i64 8}
!16 = !{!"_ZTSN4juce25ReferenceCountedObjectPtrINS_12AsyncUpdater19AsyncUpdaterMessageEEE", !6, i64 0}
!17 = !{!"_ZTSN4juce12ListenerListINS_14ChangeListenerENS_5ArrayIPS1_NS_20DummyCriticalSectionELi0EEEEE", !18, i64 0}
!18 = !{!"_ZTSN4juce5ArrayIPNS_14ChangeListenerENS_20DummyCriticalSectionELi0EEE", !19, i64 0, !10, i64 16}
!19 = !{!"_ZTSN4juce19ArrayAllocationBaseIPNS_14ChangeListenerENS_20DummyCriticalSectionEEE", !20, i64 0, !10, i64 8}
!20 = !{!"_ZTSN4juce9HeapBlockIPNS_14ChangeListenerELb0EEE", !6, i64 0}
!21 = !{!"_ZTSN4juce5TimerE", !10, i64 8, !10, i64 12, !6, i64 16, !6, i64 24}
!22 = !{!"_ZTSN4juce10OwnedArrayINS_17ComponentAnimator13AnimationTaskENS_20DummyCriticalSectionEEE", !23, i64 0, !10, i64 16}
!23 = !{!"_ZTSN4juce19ArrayAllocationBaseIPNS_17ComponentAnimator13AnimationTaskENS_20DummyCriticalSectionEEE", !24, i64 0, !10, i64 8}
!24 = !{!"_ZTSN4juce9HeapBlockIPNS_17ComponentAnimator13AnimationTaskELb0EEE", !6, i64 0}
!25 = distinct !{!25, !26}
!26 = !{!"llvm.loop.mustprogress"}


; 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: nounwind
declare void @_ZN4juce5Timer9stopTimerEv(ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #0

; Function Attrs: nounwind
declare noundef i32 @_ZN4juce4Time21getMillisecondCounterEv() local_unnamed_addr #0

declare void @_ZN4juce17ChangeBroadcaster17sendChangeMessageEv(ptr noundef nonnull align 8 dereferenceable(56)) local_unnamed_addr #1

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK4juce10OwnedArrayINS_17ComponentAnimator13AnimationTaskENS_20DummyCriticalSectionEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(20)) local_unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNK4juce10OwnedArrayINS_17ComponentAnimator13AnimationTaskENS_20DummyCriticalSectionEE12getUncheckedEi(ptr noundef nonnull align 8 dereferenceable(20), i32 noundef) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4juce17ComponentAnimator13timerCallbackEv(ptr noundef nonnull align 8 dereferenceable(116) %0) unnamed_addr #3 align 2 {
  %2 = tail call noundef i32 @_ZN4juce4Time21getMillisecondCounterEv() #4
  %3 = getelementptr inbounds i8, ptr %0, i64 112
  %4 = load i32, ptr %3, align 8, !tbaa !5
  %5 = icmp eq i32 %4, 0
  %6 = icmp eq i32 %4, %2
  %or.cond = or i1 %5, %6
  br i1 %or.cond, label %7, label %8

7:                                                ; preds = %1
  store i32 %2, ptr %3, align 8, !tbaa !5
  br label %8

8:                                                ; preds = %1, %7
  %9 = phi i32 [ %4, %1 ], [ %2, %7 ]
  %10 = sub i32 %2, %9
  %11 = getelementptr inbounds i8, ptr %0, i64 88
  %12 = tail call noundef i32 @_ZNK4juce10OwnedArrayINS_17ComponentAnimator13AnimationTaskENS_20DummyCriticalSectionEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(20) %11) #4
  %13 = icmp sgt i32 %12, 0
  br i1 %13, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %20, %8
  store i32 %2, ptr %3, align 8, !tbaa !5
  %14 = tail call noundef i32 @_ZNK4juce10OwnedArrayINS_17ComponentAnimator13AnimationTaskENS_20DummyCriticalSectionEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(20) %11) #4
  %15 = icmp eq i32 %14, 0
  br i1 %15, label %22, label %24

.lr.ph:                                           ; preds = %8, %20
  %.in = phi i32 [ %16, %20 ], [ %12, %8 ]
  %16 = add nsw i32 %.in, -1
  %17 = tail call noundef ptr @_ZNK4juce10OwnedArrayINS_17ComponentAnimator13AnimationTaskENS_20DummyCriticalSectionEE12getUncheckedEi(ptr noundef nonnull align 8 dereferenceable(20) %11, i32 noundef %16) #4
  %18 = tail call noundef zeroext i1 @_ZN4juce17ComponentAnimator13AnimationTask12useTimesliceEi(ptr noundef nonnull align 8 dereferenceable(122) %17, i32 noundef %10)
  br i1 %18, label %20, label %19

19:                                               ; preds = %.lr.ph
  tail call void @_ZN4juce10OwnedArrayINS_17ComponentAnimator13AnimationTaskENS_20DummyCriticalSectionEE6removeEib(ptr noundef nonnull align 8 dereferenceable(20) %11, i32 noundef %16, i1 noundef zeroext true)
  tail call void @_ZN4juce17ChangeBroadcaster17sendChangeMessageEv(ptr noundef nonnull align 8 dereferenceable(56) %0)
  br label %20

20:                                               ; preds = %19, %.lr.ph
  %21 = icmp ugt i32 %.in, 1
  br i1 %21, label %.lr.ph, label %._crit_edge, !llvm.loop !23

22:                                               ; preds = %._crit_edge
  %23 = getelementptr inbounds i8, ptr %0, i64 56
  tail call void @_ZN4juce5Timer9stopTimerEv(ptr noundef nonnull align 8 dereferenceable(32) %23) #4
  br label %24

24:                                               ; preds = %22, %._crit_edge
  ret void
}

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN4juce17ComponentAnimator13AnimationTask12useTimesliceEi(ptr noundef nonnull align 8 dereferenceable(122), i32 noundef) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4juce10OwnedArrayINS_17ComponentAnimator13AnimationTaskENS_20DummyCriticalSectionEE6removeEib(ptr noundef nonnull align 8 dereferenceable(20), i32 noundef, i1 noundef zeroext) local_unnamed_addr #3 align 2

attributes #0 = { 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 #1 = { "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 = { 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 #3 = { 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 #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)"}
!5 = !{!6, !18, i64 112}
!6 = !{!"_ZTSN4juce17ComponentAnimatorE", !7, i64 0, !19, i64 56, !20, i64 88, !18, i64 112}
!7 = !{!"_ZTSN4juce17ChangeBroadcasterE", !8, i64 8, !14, i64 32}
!8 = !{!"_ZTSN4juce17ChangeBroadcaster25ChangeBroadcasterCallbackE", !9, i64 0, !11, i64 16}
!9 = !{!"_ZTSN4juce12AsyncUpdaterE", !10, i64 8}
!10 = !{!"_ZTSN4juce25ReferenceCountedObjectPtrINS_12AsyncUpdater19AsyncUpdaterMessageEEE", !11, i64 0}
!11 = !{!"any pointer", !12, i64 0}
!12 = !{!"omnipotent char", !13, i64 0}
!13 = !{!"Simple C++ TBAA"}
!14 = !{!"_ZTSN4juce12ListenerListINS_14ChangeListenerENS_5ArrayIPS1_NS_20DummyCriticalSectionELi0EEEEE", !15, i64 0}
!15 = !{!"_ZTSN4juce5ArrayIPNS_14ChangeListenerENS_20DummyCriticalSectionELi0EEE", !16, i64 0, !18, i64 16}
!16 = !{!"_ZTSN4juce19ArrayAllocationBaseIPNS_14ChangeListenerENS_20DummyCriticalSectionEEE", !17, i64 0, !18, i64 8}
!17 = !{!"_ZTSN4juce9HeapBlockIPNS_14ChangeListenerELb0EEE", !11, i64 0}
!18 = !{!"int", !12, i64 0}
!19 = !{!"_ZTSN4juce5TimerE", !18, i64 8, !18, i64 12, !11, i64 16, !11, i64 24}
!20 = !{!"_ZTSN4juce10OwnedArrayINS_17ComponentAnimator13AnimationTaskENS_20DummyCriticalSectionEEE", !21, i64 0, !18, i64 16}
!21 = !{!"_ZTSN4juce19ArrayAllocationBaseIPNS_17ComponentAnimator13AnimationTaskENS_20DummyCriticalSectionEEE", !22, i64 0, !18, i64 8}
!22 = !{!"_ZTSN4juce9HeapBlockIPNS_17ComponentAnimator13AnimationTaskELb0EEE", !11, i64 0}
!23 = distinct !{!23, !24}
!24 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass,TailCallElimPass