; 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::Component::BailOutChecker" = type { %"class.juce::WeakReference" }
%"class.juce::WeakReference" = type { %"class.juce::ReferenceCountedObjectPtr" }
%"class.juce::ReferenceCountedObjectPtr" = type { ptr }
%"class.juce::DirectoryContentsDisplayComponent" = type { ptr, ptr, %"class.juce::ListenerList.213" }
%"class.juce::ListenerList.213" = type { %"class.juce::Array.214" }
%"class.juce::Array.214" = type { %"class.juce::ArrayAllocationBase.215", i32, [4 x i8] }
%"class.juce::ArrayAllocationBase.215" = type <{ %"class.juce::HeapBlock.216", i32, [4 x i8] }>
%"class.juce::HeapBlock.216" = type { ptr }

@_ZTIN4juce9ComponentE = external dso_local constant { ptr, ptr, ptr }, align 8
@_ZTIN4juce33DirectoryContentsDisplayComponentE = external dso_local constant { ptr, ptr }, align 8

declare i32 @__gxx_personality_v0(...)

; 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 void @_ZN4juce9Component14BailOutCheckerD2Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #1 align 2

; Function Attrs: nounwind willreturn memory(read)
declare ptr @__dynamic_cast(ptr, ptr, ptr, i64) #2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4juce33DirectoryContentsDisplayComponent21sendMouseClickMessageERKNS_4FileERKNS_10MouseEventE(ptr noundef nonnull align 8 dereferenceable(40) %0, ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef nonnull align 8 dereferenceable(74) %2) #3 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca %"class.juce::Component::BailOutChecker", align 8
  %8 = alloca { i64, i64 }, align 8
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  store ptr %2, ptr %6, align 8, !tbaa !5
  %11 = load ptr, ptr %4, align 8
  %12 = getelementptr inbounds %"class.juce::DirectoryContentsDisplayComponent", ptr %11, i32 0, i32 1
  %13 = load ptr, ptr %12, align 8, !tbaa !9
  %14 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK4juce21DirectoryContentsList12getDirectoryEv(ptr noundef nonnull align 8 dereferenceable(177) %13) #6
  %15 = call noundef zeroext i1 @_ZNK4juce4File6existsEv(ptr noundef nonnull align 8 dereferenceable(8) %14)
  br i1 %15, label %16, label %35

16:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #6
  %17 = icmp eq ptr %11, null
  br i1 %17, label %20, label %18

18:                                               ; preds = %16
  %19 = call ptr @__dynamic_cast(ptr %11, ptr @_ZTIN4juce33DirectoryContentsDisplayComponentE, ptr @_ZTIN4juce9ComponentE, i64 -2) #6
  br label %21

20:                                               ; preds = %16
  br label %21

21:                                               ; preds = %20, %18
  %22 = phi ptr [ %19, %18 ], [ null, %20 ]
  call void @_ZN4juce9Component14BailOutCheckerC1EPS0_(ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef %22)
  %23 = getelementptr inbounds %"class.juce::DirectoryContentsDisplayComponent", ptr %11, i32 0, i32 2
  %24 = load ptr, ptr %5, align 8, !tbaa !5
  %25 = load ptr, ptr %6, align 8, !tbaa !5
  store { i64, i64 } { i64 25, i64 0 }, ptr %8, align 8, !tbaa !16
  %26 = getelementptr inbounds { i64, i64 }, ptr %8, i32 0, i32 0
  %27 = load i64, ptr %26, align 8
  %28 = getelementptr inbounds { i64, i64 }, ptr %8, i32 0, i32 1
  %29 = load i64, ptr %28, align 8
  invoke void @_ZN4juce12ListenerListINS_19FileBrowserListenerENS_5ArrayIPS1_NS_20DummyCriticalSectionELi0EEEE11callCheckedINS_9Component14BailOutCheckerERKNS_4FileERKNS_10MouseEventEEEvRKT_MS1_FvT0_T1_ENS_11TypeHelpers13ParameterTypeISJ_E4typeENSO_ISK_E4typeE(ptr noundef nonnull align 8 dereferenceable(24) %23, ptr noundef nonnull align 8 dereferenceable(8) %7, i64 %27, i64 %29, ptr noundef nonnull align 8 dereferenceable(8) %24, ptr noundef nonnull align 8 dereferenceable(74) %25)
          to label %30 unwind label %31

30:                                               ; preds = %21
  call void @_ZN4juce9Component14BailOutCheckerD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %7) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  br label %35

31:                                               ; preds = %21
  %32 = landingpad { ptr, i32 }
          cleanup
  %33 = extractvalue { ptr, i32 } %32, 0
  store ptr %33, ptr %9, align 8
  %34 = extractvalue { ptr, i32 } %32, 1
  store i32 %34, ptr %10, align 4
  call void @_ZN4juce9Component14BailOutCheckerD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %7) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  br label %36

35:                                               ; preds = %30, %3
  ret void

36:                                               ; preds = %31
  %37 = load ptr, ptr %9, align 8
  %38 = load i32, ptr %10, align 4
  %39 = insertvalue { ptr, i32 } poison, ptr %37, 0
  %40 = insertvalue { ptr, i32 } %39, i32 %38, 1
  resume { ptr, i32 } %40
}

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

declare noundef zeroext i1 @_ZNK4juce4File6existsEv(ptr noundef nonnull align 8 dereferenceable(8)) #5

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4juce12ListenerListINS_19FileBrowserListenerENS_5ArrayIPS1_NS_20DummyCriticalSectionELi0EEEE11callCheckedINS_9Component14BailOutCheckerERKNS_4FileERKNS_10MouseEventEEEvRKT_MS1_FvT0_T1_ENS_11TypeHelpers13ParameterTypeISJ_E4typeENSO_ISK_E4typeE(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(8), i64, i64, ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(74)) #3 align 2

declare void @_ZN4juce9Component14BailOutCheckerC1EPS0_(ptr, ptr)

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 = { nounwind willreturn memory(read) }
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 = { 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 #5 = { "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, !6, i64 8}
!10 = !{!"_ZTSN4juce33DirectoryContentsDisplayComponentE", !6, i64 8, !11, i64 16}
!11 = !{!"_ZTSN4juce12ListenerListINS_19FileBrowserListenerENS_5ArrayIPS1_NS_20DummyCriticalSectionELi0EEEEE", !12, i64 0}
!12 = !{!"_ZTSN4juce5ArrayIPNS_19FileBrowserListenerENS_20DummyCriticalSectionELi0EEE", !13, i64 0, !15, i64 16}
!13 = !{!"_ZTSN4juce19ArrayAllocationBaseIPNS_19FileBrowserListenerENS_20DummyCriticalSectionEEE", !14, i64 0, !15, i64 8}
!14 = !{!"_ZTSN4juce9HeapBlockIPNS_19FileBrowserListenerELb0EEE", !6, i64 0}
!15 = !{!"int", !7, i64 0}
!16 = !{!7, !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::Component::BailOutChecker" = type { %"class.juce::WeakReference" }
%"class.juce::WeakReference" = type { %"class.juce::ReferenceCountedObjectPtr" }
%"class.juce::ReferenceCountedObjectPtr" = type { ptr }

@_ZTIN4juce9ComponentE = external dso_local constant { ptr, ptr, ptr }, align 8
@_ZTIN4juce33DirectoryContentsDisplayComponentE = external dso_local constant { ptr, ptr }, align 8

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress 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 void @_ZN4juce9Component14BailOutCheckerD2Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #1 align 2

; Function Attrs: mustprogress nofree nounwind willreturn memory(read)
declare ptr @__dynamic_cast(ptr, ptr, ptr, i64) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4juce33DirectoryContentsDisplayComponent21sendMouseClickMessageERKNS_4FileERKNS_10MouseEventE(ptr noundef nonnull align 8 dereferenceable(40) %0, ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef nonnull align 8 dereferenceable(74) %2) local_unnamed_addr #3 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca %"class.juce::Component::BailOutChecker", align 8
  %5 = getelementptr inbounds i8, ptr %0, i64 8
  %6 = load ptr, ptr %5, align 8, !tbaa !5
  %7 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK4juce21DirectoryContentsList12getDirectoryEv(ptr noundef nonnull align 8 dereferenceable(177) %6) #6
  %8 = tail call noundef zeroext i1 @_ZNK4juce4File6existsEv(ptr noundef nonnull align 8 dereferenceable(8) %7)
  br i1 %8, label %9, label %15

9:                                                ; preds = %3
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #6
  %10 = tail call ptr @__dynamic_cast(ptr nonnull %0, ptr nonnull @_ZTIN4juce33DirectoryContentsDisplayComponentE, ptr nonnull @_ZTIN4juce9ComponentE, i64 -2) #6
  call void @_ZN4juce9Component14BailOutCheckerC1EPS0_(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef %10)
  %11 = getelementptr inbounds i8, ptr %0, i64 16
  invoke void @_ZN4juce12ListenerListINS_19FileBrowserListenerENS_5ArrayIPS1_NS_20DummyCriticalSectionELi0EEEE11callCheckedINS_9Component14BailOutCheckerERKNS_4FileERKNS_10MouseEventEEEvRKT_MS1_FvT0_T1_ENS_11TypeHelpers13ParameterTypeISJ_E4typeENSO_ISK_E4typeE(ptr noundef nonnull align 8 dereferenceable(24) %11, ptr noundef nonnull align 8 dereferenceable(8) %4, i64 25, i64 0, ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef nonnull align 8 dereferenceable(74) %2)
          to label %12 unwind label %13

12:                                               ; preds = %9
  call void @_ZN4juce9Component14BailOutCheckerD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %4) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #6
  br label %15

13:                                               ; preds = %9
  %14 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN4juce9Component14BailOutCheckerD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %4) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #6
  resume { ptr, i32 } %14

15:                                               ; preds = %12, %3
  ret void
}

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

declare noundef zeroext i1 @_ZNK4juce4File6existsEv(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #5

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4juce12ListenerListINS_19FileBrowserListenerENS_5ArrayIPS1_NS_20DummyCriticalSectionELi0EEEE11callCheckedINS_9Component14BailOutCheckerERKNS_4FileERKNS_10MouseEventEEEvRKT_MS1_FvT0_T1_ENS_11TypeHelpers13ParameterTypeISJ_E4typeENSO_ISK_E4typeE(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(8), i64, i64, ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(74)) local_unnamed_addr #3 align 2

declare void @_ZN4juce9Component14BailOutCheckerC1EPS0_(ptr, ptr) local_unnamed_addr

attributes #0 = { mustprogress 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 = { mustprogress nofree nounwind willreturn memory(read) }
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 = { 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 #5 = { "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, !7, i64 8}
!6 = !{!"_ZTSN4juce33DirectoryContentsDisplayComponentE", !7, i64 8, !10, i64 16}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"_ZTSN4juce12ListenerListINS_19FileBrowserListenerENS_5ArrayIPS1_NS_20DummyCriticalSectionELi0EEEEE", !11, i64 0}
!11 = !{!"_ZTSN4juce5ArrayIPNS_19FileBrowserListenerENS_20DummyCriticalSectionELi0EEE", !12, i64 0, !14, i64 16}
!12 = !{!"_ZTSN4juce19ArrayAllocationBaseIPNS_19FileBrowserListenerENS_20DummyCriticalSectionEEE", !13, i64 0, !14, i64 8}
!13 = !{!"_ZTSN4juce9HeapBlockIPNS_19FileBrowserListenerELb0EEE", !7, i64 0}
!14 = !{!"int", !8, i64 0}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,SROAPass,SimplifyCFGPass,TailCallElimPass