; 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::MouseInputSource" = type { ptr }

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK4juce9Component10isParentOfEPKS0_(ptr noundef nonnull align 8 dereferenceable(197), ptr noundef) #0 align 2

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(360) ptr @_ZN4juce7Desktop11getInstanceEv() #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(20) ptr @_ZNK4juce7Desktop15getMouseSourcesEv(ptr noundef nonnull align 8 dereferenceable(360)) #0 align 2

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNK4juce16MouseInputSource22getComponentUnderMouseEv(ptr noundef nonnull align 8 dereferenceable(8)) #0 align 2

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZNK4juce9Component21isMouseOverOrDraggingEb(ptr noundef nonnull align 8 dereferenceable(197) %0, i1 noundef zeroext %1) #2 align 2 {
  %3 = alloca i1, align 1
  %4 = alloca ptr, align 8
  %5 = alloca i8, align 1
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca ptr, align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  %11 = zext i1 %1 to i8
  store i8 %11, ptr %5, align 1, !tbaa !9
  %12 = load ptr, ptr %4, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #4
  %13 = call noundef nonnull align 8 dereferenceable(360) ptr @_ZN4juce7Desktop11getInstanceEv()
  %14 = call noundef nonnull align 8 dereferenceable(20) ptr @_ZNK4juce7Desktop15getMouseSourcesEv(ptr noundef nonnull align 8 dereferenceable(360) %13) #4
  store ptr %14, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #4
  %15 = load ptr, ptr %6, align 8, !tbaa !5
  %16 = call noundef ptr @_ZNK4juce5ArrayINS_16MouseInputSourceENS_20DummyCriticalSectionELi0EE5beginEv(ptr noundef nonnull align 8 dereferenceable(20) %15) #4
  store ptr %16, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #4
  %17 = load ptr, ptr %6, align 8, !tbaa !5
  %18 = call noundef ptr @_ZNK4juce5ArrayINS_16MouseInputSourceENS_20DummyCriticalSectionELi0EE3endEv(ptr noundef nonnull align 8 dereferenceable(20) %17) #4
  store ptr %18, ptr %8, align 8, !tbaa !5
  br label %19

19:                                               ; preds = %46, %2
  %20 = load ptr, ptr %7, align 8, !tbaa !5
  %21 = load ptr, ptr %8, align 8, !tbaa !5
  %22 = icmp ne ptr %20, %21
  br i1 %22, label %24, label %23

23:                                               ; preds = %19
  store i32 2, ptr %9, align 4
  br label %49

24:                                               ; preds = %19
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #4
  %25 = load ptr, ptr %7, align 8, !tbaa !5
  %26 = call noundef ptr @_ZNK4juce16MouseInputSource22getComponentUnderMouseEv(ptr noundef nonnull align 8 dereferenceable(8) %25)
  store ptr %26, ptr %10, align 8, !tbaa !5
  %27 = load ptr, ptr %10, align 8, !tbaa !5
  %28 = icmp eq ptr %27, %12
  br i1 %28, label %35, label %29

29:                                               ; preds = %24
  %30 = load i8, ptr %5, align 1, !tbaa !9, !range !11, !noundef !12
  %31 = trunc i8 %30 to i1
  br i1 %31, label %32, label %42

32:                                               ; preds = %29
  %33 = load ptr, ptr %10, align 8, !tbaa !5
  %34 = call noundef zeroext i1 @_ZNK4juce9Component10isParentOfEPKS0_(ptr noundef nonnull align 8 dereferenceable(197) %12, ptr noundef %33) #4
  br i1 %34, label %35, label %42

35:                                               ; preds = %32, %24
  %36 = load ptr, ptr %7, align 8, !tbaa !5
  %37 = call noundef zeroext i1 @_ZNK4juce16MouseInputSource7isMouseEv(ptr noundef nonnull align 8 dereferenceable(8) %36) #4
  br i1 %37, label %41, label %38

38:                                               ; preds = %35
  %39 = load ptr, ptr %7, align 8, !tbaa !5
  %40 = call noundef zeroext i1 @_ZNK4juce16MouseInputSource10isDraggingEv(ptr noundef nonnull align 8 dereferenceable(8) %39) #4
  br i1 %40, label %41, label %42

41:                                               ; preds = %38, %35
  store i1 true, ptr %3, align 1
  store i32 1, ptr %9, align 4
  br label %43

42:                                               ; preds = %38, %32, %29
  store i32 0, ptr %9, align 4
  br label %43

43:                                               ; preds = %42, %41
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #4
  %44 = load i32, ptr %9, align 4
  switch i32 %44, label %49 [
    i32 0, label %45
  ]

45:                                               ; preds = %43
  br label %46

46:                                               ; preds = %45
  %47 = load ptr, ptr %7, align 8, !tbaa !5
  %48 = getelementptr inbounds %"class.juce::MouseInputSource", ptr %47, i32 1
  store ptr %48, ptr %7, align 8, !tbaa !5
  br label %19, !llvm.loop !13

49:                                               ; preds = %43, %23
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #4
  %50 = load i32, ptr %9, align 4
  switch i32 %50, label %52 [
    i32 2, label %51
  ]

51:                                               ; preds = %49
  store i1 false, ptr %3, align 1
  store i32 1, ptr %9, align 4
  br label %52

52:                                               ; preds = %51, %49
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #4
  %53 = load i1, ptr %3, align 1
  ret i1 %53
}

attributes #0 = { 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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 = { 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 = !{!"bool", !7, i64 0}
!11 = !{i8 0, i8 2}
!12 = !{}
!13 = distinct !{!13, !14}
!14 = !{!"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: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK4juce9Component10isParentOfEPKS0_(ptr noundef nonnull align 8 dereferenceable(197), ptr noundef) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(360) ptr @_ZN4juce7Desktop11getInstanceEv() local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(20) ptr @_ZNK4juce7Desktop15getMouseSourcesEv(ptr noundef nonnull align 8 dereferenceable(360)) local_unnamed_addr #0 align 2

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

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZNK4juce9Component21isMouseOverOrDraggingEb(ptr noundef nonnull align 8 dereferenceable(197) %0, i1 noundef zeroext %1) local_unnamed_addr #1 align 2 {
  %3 = tail call noundef nonnull align 8 dereferenceable(360) ptr @_ZN4juce7Desktop11getInstanceEv()
  %4 = tail call noundef nonnull align 8 dereferenceable(20) ptr @_ZNK4juce7Desktop15getMouseSourcesEv(ptr noundef nonnull align 8 dereferenceable(360) %3) #3
  %5 = tail call noundef ptr @_ZNK4juce5ArrayINS_16MouseInputSourceENS_20DummyCriticalSectionELi0EE5beginEv(ptr noundef nonnull align 8 dereferenceable(20) %4) #3
  %6 = tail call noundef ptr @_ZNK4juce5ArrayINS_16MouseInputSourceENS_20DummyCriticalSectionELi0EE3endEv(ptr noundef nonnull align 8 dereferenceable(20) %4) #3
  %.not22.not = icmp eq ptr %5, %6
  br i1 %.not22.not, label %.critedge21, label %.lr.ph

.lr.ph:                                           ; preds = %2
  br i1 %1, label %.lr.ph.split.us, label %.lr.ph.split

.lr.ph.split.us:                                  ; preds = %.lr.ph, %.critedge.us
  %.01723.us = phi ptr [ %15, %.critedge.us ], [ %5, %.lr.ph ]
  %7 = tail call noundef ptr @_ZNK4juce16MouseInputSource22getComponentUnderMouseEv(ptr noundef nonnull align 8 dereferenceable(8) %.01723.us)
  %8 = icmp eq ptr %7, %0
  br i1 %8, label %11, label %9

9:                                                ; preds = %.lr.ph.split.us
  %10 = tail call noundef zeroext i1 @_ZNK4juce9Component10isParentOfEPKS0_(ptr noundef nonnull align 8 dereferenceable(197) %0, ptr noundef %7) #3
  br i1 %10, label %11, label %.critedge.us

11:                                               ; preds = %9, %.lr.ph.split.us
  %12 = tail call noundef zeroext i1 @_ZNK4juce16MouseInputSource7isMouseEv(ptr noundef nonnull align 8 dereferenceable(8) %.01723.us) #3
  br i1 %12, label %.critedge21, label %13

13:                                               ; preds = %11
  %14 = tail call noundef zeroext i1 @_ZNK4juce16MouseInputSource10isDraggingEv(ptr noundef nonnull align 8 dereferenceable(8) %.01723.us) #3
  br i1 %14, label %.critedge21, label %.critedge.us

.critedge.us:                                     ; preds = %13, %9
  %15 = getelementptr inbounds i8, ptr %.01723.us, i64 8
  %.not.us.not = icmp eq ptr %15, %6
  br i1 %.not.us.not, label %.critedge21, label %.lr.ph.split.us, !llvm.loop !5

.lr.ph.split:                                     ; preds = %.lr.ph, %.critedge
  %.01723 = phi ptr [ %22, %.critedge ], [ %5, %.lr.ph ]
  %16 = tail call noundef ptr @_ZNK4juce16MouseInputSource22getComponentUnderMouseEv(ptr noundef nonnull align 8 dereferenceable(8) %.01723)
  %17 = icmp eq ptr %16, %0
  br i1 %17, label %18, label %.critedge

18:                                               ; preds = %.lr.ph.split
  %19 = tail call noundef zeroext i1 @_ZNK4juce16MouseInputSource7isMouseEv(ptr noundef nonnull align 8 dereferenceable(8) %.01723) #3
  br i1 %19, label %.critedge21, label %20

20:                                               ; preds = %18
  %21 = tail call noundef zeroext i1 @_ZNK4juce16MouseInputSource10isDraggingEv(ptr noundef nonnull align 8 dereferenceable(8) %.01723) #3
  br i1 %21, label %.critedge21, label %.critedge

.critedge:                                        ; preds = %.lr.ph.split, %20
  %22 = getelementptr inbounds i8, ptr %.01723, i64 8
  %.not.not = icmp eq ptr %22, %6
  br i1 %.not.not, label %.critedge21, label %.lr.ph.split, !llvm.loop !5

.critedge21:                                      ; preds = %20, %18, %.critedge, %13, %11, %.critedge.us, %2
  %.not.lcssa = phi i1 [ false, %2 ], [ false, %.critedge.us ], [ true, %11 ], [ true, %13 ], [ false, %.critedge ], [ true, %18 ], [ true, %20 ]
  ret i1 %.not.lcssa
}

attributes #0 = { 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 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 = { 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 = { 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 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}


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