; 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 nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZNK4juce21DirectoryContentsList12getDirectoryEv(ptr noundef nonnull align 8 dereferenceable(177)) #3 align 2

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

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

14:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #6
  %15 = icmp eq ptr %9, null
  br i1 %15, label %18, label %16

16:                                               ; preds = %14
  %17 = call ptr @__dynamic_cast(ptr %9, ptr @_ZTIN4juce33DirectoryContentsDisplayComponentE, ptr @_ZTIN4juce9ComponentE, i64 -2) #6
  br label %19

18:                                               ; preds = %14
  br label %19

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

27:                                               ; preds = %19
  call void @_ZN4juce9Component14BailOutCheckerD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %5) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #6
  br label %32

28:                                               ; preds = %19
  %29 = landingpad { ptr, i32 }
          cleanup
  %30 = extractvalue { ptr, i32 } %29, 0
  store ptr %30, ptr %7, align 8
  %31 = extractvalue { ptr, i32 } %29, 1
  store i32 %31, ptr %8, align 4
  call void @_ZN4juce9Component14BailOutCheckerD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %5) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #6
  br label %33

32:                                               ; preds = %27, %2
  ret void

33:                                               ; preds = %28
  %34 = load ptr, ptr %7, align 8
  %35 = load i32, ptr %8, align 4
  %36 = insertvalue { ptr, i32 } poison, ptr %34, 0
  %37 = insertvalue { ptr, i32 } %36, i32 %35, 1
  resume { ptr, i32 } %37
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4juce12ListenerListINS_19FileBrowserListenerENS_5ArrayIPS1_NS_20DummyCriticalSectionELi0EEEE11callCheckedINS_9Component14BailOutCheckerERKNS_4FileEEEvRKT_MS1_FvT0_ENS_11TypeHelpers13ParameterTypeISG_E4typeE(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(8), i64, i64, ptr noundef nonnull align 8 dereferenceable(8)) #5 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 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 = { "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 = { 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 #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 nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZNK4juce21DirectoryContentsList12getDirectoryEv(ptr noundef nonnull align 8 dereferenceable(177)) local_unnamed_addr #3 align 2

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

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

8:                                                ; preds = %2
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #6
  %9 = 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) %3, ptr noundef %9)
  %10 = getelementptr inbounds i8, ptr %0, i64 16
  invoke void @_ZN4juce12ListenerListINS_19FileBrowserListenerENS_5ArrayIPS1_NS_20DummyCriticalSectionELi0EEEE11callCheckedINS_9Component14BailOutCheckerERKNS_4FileEEEvRKT_MS1_FvT0_ENS_11TypeHelpers13ParameterTypeISG_E4typeE(ptr noundef nonnull align 8 dereferenceable(24) %10, ptr noundef nonnull align 8 dereferenceable(8) %3, i64 33, i64 0, ptr noundef nonnull align 8 dereferenceable(8) %1)
          to label %11 unwind label %12

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

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

14:                                               ; preds = %11, %2
  ret void
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4juce12ListenerListINS_19FileBrowserListenerENS_5ArrayIPS1_NS_20DummyCriticalSectionELi0EEEE11callCheckedINS_9Component14BailOutCheckerERKNS_4FileEEEvRKT_MS1_FvT0_ENS_11TypeHelpers13ParameterTypeISG_E4typeE(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(8), i64, i64, ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #5 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 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 = { "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 = { 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 #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