; 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::DirectoryContentsList" = type <{ %"class.juce::ChangeBroadcaster", %"class.juce::TimeSliceClient", %"class.juce::File", ptr, ptr, i32, [4 x i8], %"class.juce::CriticalSection", %"class.juce::OwnedArray.219", %"class.juce::ScopedPointer.224", i8, [7 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::TimeSliceClient" = type { ptr, %"class.juce::Time" }
%"class.juce::Time" = type { i64 }
%"class.juce::File" = type { %"class.juce::String" }
%"class.juce::String" = type { %"class.juce::CharPointer_UTF8" }
%"class.juce::CharPointer_UTF8" = type { ptr }
%"class.juce::CriticalSection" = type { %union.pthread_mutex_t }
%union.pthread_mutex_t = type { %struct.__pthread_mutex_s }
%struct.__pthread_mutex_s = type { i32, i32, i32, i32, i32, i16, i16, %struct.__pthread_internal_list }
%struct.__pthread_internal_list = type { ptr, ptr }
%"class.juce::OwnedArray.219" = type { %"class.juce::ArrayAllocationBase.220", i32, [4 x i8] }
%"class.juce::ArrayAllocationBase.220" = type <{ %"class.juce::HeapBlock.221", i32, [4 x i8] }>
%"class.juce::HeapBlock.221" = type { ptr }
%"class.juce::ScopedPointer.224" = 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: mustprogress uwtable
declare dso_local void @_ZN4juce21DirectoryContentsList12setTypeFlagsEi(ptr noundef nonnull align 8 dereferenceable(177), i32 noundef) #1 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4juce21DirectoryContentsList12setDirectoryERKNS_4FileEbb(ptr noundef nonnull align 8 dereferenceable(177) %0, ptr noundef nonnull align 8 dereferenceable(8) %1, i1 noundef zeroext %2, i1 noundef zeroext %3) #1 align 2 {
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i8, align 1
  %8 = alloca i8, align 1
  %9 = alloca i32, align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  %10 = zext i1 %2 to i8
  store i8 %10, ptr %7, align 1, !tbaa !9
  %11 = zext i1 %3 to i8
  store i8 %11, ptr %8, align 1, !tbaa !9
  %12 = load ptr, ptr %5, align 8
  br label %13

13:                                               ; preds = %4
  br label %14

14:                                               ; preds = %13
  %15 = load ptr, ptr %6, align 8, !tbaa !5
  %16 = getelementptr inbounds %"class.juce::DirectoryContentsList", ptr %12, i32 0, i32 2
  %17 = call noundef zeroext i1 @_ZNK4juce4FileneERKS0_(ptr noundef nonnull align 8 dereferenceable(8) %15, ptr noundef nonnull align 8 dereferenceable(8) %16)
  br i1 %17, label %18, label %25

18:                                               ; preds = %14
  call void @_ZN4juce21DirectoryContentsList5clearEv(ptr noundef nonnull align 8 dereferenceable(177) %12)
  %19 = load ptr, ptr %6, align 8, !tbaa !5
  %20 = getelementptr inbounds %"class.juce::DirectoryContentsList", ptr %12, i32 0, i32 2
  %21 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN4juce4FileaSERKS0_(ptr noundef nonnull align 8 dereferenceable(8) %20, ptr noundef nonnull align 8 dereferenceable(8) %19)
  call void @_ZN4juce21DirectoryContentsList7changedEv(ptr noundef nonnull align 8 dereferenceable(177) %12)
  %22 = getelementptr inbounds %"class.juce::DirectoryContentsList", ptr %12, i32 0, i32 5
  %23 = load i32, ptr %22, align 8, !tbaa !11
  %24 = and i32 %23, -4
  store i32 %24, ptr %22, align 8, !tbaa !11
  br label %25

25:                                               ; preds = %18, %14
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #3
  %26 = getelementptr inbounds %"class.juce::DirectoryContentsList", ptr %12, i32 0, i32 5
  %27 = load i32, ptr %26, align 8, !tbaa !11
  store i32 %27, ptr %9, align 4, !tbaa !33
  %28 = load i8, ptr %7, align 1, !tbaa !9, !range !34, !noundef !35
  %29 = trunc i8 %28 to i1
  br i1 %29, label %30, label %33

30:                                               ; preds = %25
  %31 = load i32, ptr %9, align 4, !tbaa !33
  %32 = or i32 %31, 1
  store i32 %32, ptr %9, align 4, !tbaa !33
  br label %36

33:                                               ; preds = %25
  %34 = load i32, ptr %9, align 4, !tbaa !33
  %35 = and i32 %34, -2
  store i32 %35, ptr %9, align 4, !tbaa !33
  br label %36

36:                                               ; preds = %33, %30
  %37 = load i8, ptr %8, align 1, !tbaa !9, !range !34, !noundef !35
  %38 = trunc i8 %37 to i1
  br i1 %38, label %39, label %42

39:                                               ; preds = %36
  %40 = load i32, ptr %9, align 4, !tbaa !33
  %41 = or i32 %40, 2
  store i32 %41, ptr %9, align 4, !tbaa !33
  br label %45

42:                                               ; preds = %36
  %43 = load i32, ptr %9, align 4, !tbaa !33
  %44 = and i32 %43, -3
  store i32 %44, ptr %9, align 4, !tbaa !33
  br label %45

45:                                               ; preds = %42, %39
  %46 = load i32, ptr %9, align 4, !tbaa !33
  call void @_ZN4juce21DirectoryContentsList12setTypeFlagsEi(ptr noundef nonnull align 8 dereferenceable(177) %12, i32 noundef %46)
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #3
  ret void
}

declare noundef zeroext i1 @_ZNK4juce4FileneERKS0_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4juce21DirectoryContentsList5clearEv(ptr noundef nonnull align 8 dereferenceable(177)) #1 align 2

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZN4juce4FileaSERKS0_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4juce21DirectoryContentsList7changedEv(ptr noundef nonnull align 8 dereferenceable(177)) #1 align 2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { "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 = !{!"bool", !7, i64 0}
!11 = !{!12, !21, i64 96}
!12 = !{!"_ZTSN4juce21DirectoryContentsListE", !13, i64 0, !22, i64 56, !25, i64 72, !6, i64 80, !6, i64 88, !21, i64 96, !28, i64 104, !29, i64 144, !32, i64 168, !10, i64 176}
!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, !21, i64 16}
!19 = !{!"_ZTSN4juce19ArrayAllocationBaseIPNS_14ChangeListenerENS_20DummyCriticalSectionEEE", !20, i64 0, !21, i64 8}
!20 = !{!"_ZTSN4juce9HeapBlockIPNS_14ChangeListenerELb0EEE", !6, i64 0}
!21 = !{!"int", !7, i64 0}
!22 = !{!"_ZTSN4juce15TimeSliceClientE", !23, i64 8}
!23 = !{!"_ZTSN4juce4TimeE", !24, i64 0}
!24 = !{!"long long", !7, i64 0}
!25 = !{!"_ZTSN4juce4FileE", !26, i64 0}
!26 = !{!"_ZTSN4juce6StringE", !27, i64 0}
!27 = !{!"_ZTSN4juce16CharPointer_UTF8E", !6, i64 0}
!28 = !{!"_ZTSN4juce15CriticalSectionE", !7, i64 0}
!29 = !{!"_ZTSN4juce10OwnedArrayINS_21DirectoryContentsList8FileInfoENS_20DummyCriticalSectionEEE", !30, i64 0, !21, i64 16}
!30 = !{!"_ZTSN4juce19ArrayAllocationBaseIPNS_21DirectoryContentsList8FileInfoENS_20DummyCriticalSectionEEE", !31, i64 0, !21, i64 8}
!31 = !{!"_ZTSN4juce9HeapBlockIPNS_21DirectoryContentsList8FileInfoELb0EEE", !6, i64 0}
!32 = !{!"_ZTSN4juce13ScopedPointerINS_17DirectoryIteratorEEE", !6, i64 0}
!33 = !{!21, !21, i64 0}
!34 = !{i8 0, i8 2}
!35 = !{}


; 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 uwtable
declare dso_local void @_ZN4juce21DirectoryContentsList12setTypeFlagsEi(ptr noundef nonnull align 8 dereferenceable(177), i32 noundef) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4juce21DirectoryContentsList12setDirectoryERKNS_4FileEbb(ptr noundef nonnull align 8 dereferenceable(177) %0, ptr noundef nonnull align 8 dereferenceable(8) %1, i1 noundef zeroext %2, i1 noundef zeroext %3) local_unnamed_addr #0 align 2 {
  %5 = getelementptr inbounds i8, ptr %0, i64 72
  %6 = tail call noundef zeroext i1 @_ZNK4juce4FileneERKS0_(ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef nonnull align 8 dereferenceable(8) %5)
  br i1 %6, label %8, label %._crit_edge

._crit_edge:                                      ; preds = %4
  %.phi.trans.insert = getelementptr inbounds i8, ptr %0, i64 96
  %.pre = load i32, ptr %.phi.trans.insert, align 8, !tbaa !5
  %7 = and i32 %.pre, -4
  br label %13

8:                                                ; preds = %4
  tail call void @_ZN4juce21DirectoryContentsList5clearEv(ptr noundef nonnull align 8 dereferenceable(177) %0)
  %9 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZN4juce4FileaSERKS0_(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(8) %1)
  tail call void @_ZN4juce21DirectoryContentsList7changedEv(ptr noundef nonnull align 8 dereferenceable(177) %0)
  %10 = getelementptr inbounds i8, ptr %0, i64 96
  %11 = load i32, ptr %10, align 8, !tbaa !5
  %12 = and i32 %11, -4
  store i32 %12, ptr %10, align 8, !tbaa !5
  br label %13

13:                                               ; preds = %._crit_edge, %8
  %14 = phi i32 [ %7, %._crit_edge ], [ %12, %8 ]
  %masksel = zext i1 %2 to i32
  %masksel9 = select i1 %3, i32 2, i32 0
  %.0 = or disjoint i32 %masksel9, %masksel
  %.1 = or disjoint i32 %.0, %14
  tail call void @_ZN4juce21DirectoryContentsList12setTypeFlagsEi(ptr noundef nonnull align 8 dereferenceable(177) %0, i32 noundef %.1)
  ret void
}

declare noundef zeroext i1 @_ZNK4juce4FileneERKS0_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #1

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

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZN4juce4FileaSERKS0_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #1

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

attributes #0 = { 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 #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" }

!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 96}
!6 = !{!"_ZTSN4juce21DirectoryContentsListE", !7, i64 0, !19, i64 56, !22, i64 72, !11, i64 80, !11, i64 88, !18, i64 96, !25, i64 104, !26, i64 144, !29, i64 168, !30, i64 176}
!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 = !{!"_ZTSN4juce15TimeSliceClientE", !20, i64 8}
!20 = !{!"_ZTSN4juce4TimeE", !21, i64 0}
!21 = !{!"long long", !12, i64 0}
!22 = !{!"_ZTSN4juce4FileE", !23, i64 0}
!23 = !{!"_ZTSN4juce6StringE", !24, i64 0}
!24 = !{!"_ZTSN4juce16CharPointer_UTF8E", !11, i64 0}
!25 = !{!"_ZTSN4juce15CriticalSectionE", !12, i64 0}
!26 = !{!"_ZTSN4juce10OwnedArrayINS_21DirectoryContentsList8FileInfoENS_20DummyCriticalSectionEEE", !27, i64 0, !18, i64 16}
!27 = !{!"_ZTSN4juce19ArrayAllocationBaseIPNS_21DirectoryContentsList8FileInfoENS_20DummyCriticalSectionEEE", !28, i64 0, !18, i64 8}
!28 = !{!"_ZTSN4juce9HeapBlockIPNS_21DirectoryContentsList8FileInfoELb0EEE", !11, i64 0}
!29 = !{!"_ZTSN4juce13ScopedPointerINS_17DirectoryIteratorEEE", !11, i64 0}
!30 = !{!"bool", !12, i64 0}


; Effective O3 passes: BDCEPass,EarlyCSEPass,GVNPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass