; 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::File" = type { %"class.juce::String" }
%"class.juce::String" = type { %"class.juce::CharPointer_UTF8" }
%"class.juce::CharPointer_UTF8" = 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 }

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: mustprogress nounwind uwtable
declare dso_local void @_ZN4juce4FileD2Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK4juce21DirectoryContentsList7getFileEi(ptr dead_on_unwind noalias writable sret(%"class.juce::File") align 8, ptr noundef nonnull align 8 dereferenceable(177), i32 noundef) #2 align 2

declare noundef zeroext i1 @_ZNK4juce4FileeqERKS0_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #3

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4juce17FileListComponent15setSelectedFileERKNS_4FileE(ptr noundef nonnull align 8 dereferenceable(360) %0, ptr noundef nonnull align 8 dereferenceable(8) %1) unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca %"class.juce::File", align 8
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %10 = load ptr, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #4
  %11 = getelementptr inbounds i8, ptr %10, i64 296
  %12 = getelementptr inbounds %"class.juce::DirectoryContentsDisplayComponent", ptr %11, i32 0, i32 1
  %13 = load ptr, ptr %12, align 8, !tbaa !9
  %14 = call noundef i32 @_ZNK4juce21DirectoryContentsList11getNumFilesEv(ptr noundef nonnull align 8 dereferenceable(177) %13) #4
  store i32 %14, ptr %5, align 4, !tbaa !16
  br label %15

15:                                               ; preds = %34, %2
  %16 = load i32, ptr %5, align 4, !tbaa !16
  %17 = add nsw i32 %16, -1
  store i32 %17, ptr %5, align 4, !tbaa !16
  %18 = icmp sge i32 %17, 0
  br i1 %18, label %20, label %19

19:                                               ; preds = %15
  store i32 2, ptr %6, align 4
  br label %35

20:                                               ; preds = %15
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #4
  %21 = getelementptr inbounds i8, ptr %10, i64 296
  %22 = getelementptr inbounds %"class.juce::DirectoryContentsDisplayComponent", ptr %21, i32 0, i32 1
  %23 = load ptr, ptr %22, align 8, !tbaa !9
  %24 = load i32, ptr %5, align 4, !tbaa !16
  call void @_ZNK4juce21DirectoryContentsList7getFileEi(ptr dead_on_unwind writable sret(%"class.juce::File") align 8 %7, ptr noundef nonnull align 8 dereferenceable(177) %23, i32 noundef %24)
  %25 = load ptr, ptr %4, align 8, !tbaa !5
  %26 = invoke noundef zeroext i1 @_ZNK4juce4FileeqERKS0_(ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef nonnull align 8 dereferenceable(8) %25)
          to label %27 unwind label %30

27:                                               ; preds = %20
  call void @_ZN4juce4FileD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %7) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #4
  br i1 %26, label %28, label %34

28:                                               ; preds = %27
  %29 = load i32, ptr %5, align 4, !tbaa !16
  call void @_ZN4juce7ListBox9selectRowEibb(ptr noundef nonnull align 8 dereferenceable(296) %10, i32 noundef %29, i1 noundef zeroext false, i1 noundef zeroext true)
  store i32 1, ptr %6, align 4
  br label %35

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

34:                                               ; preds = %27
  br label %15, !llvm.loop !17

35:                                               ; preds = %28, %19
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #4
  %36 = load i32, ptr %6, align 4
  switch i32 %36, label %44 [
    i32 2, label %37
    i32 1, label %38
  ]

37:                                               ; preds = %35
  call void @_ZN4juce7ListBox15deselectAllRowsEv(ptr noundef nonnull align 8 dereferenceable(296) %10)
  br label %38

38:                                               ; preds = %37, %35
  ret void

39:                                               ; preds = %30
  %40 = load ptr, ptr %8, align 8
  %41 = load i32, ptr %9, align 4
  %42 = insertvalue { ptr, i32 } poison, ptr %40, 0
  %43 = insertvalue { ptr, i32 } %42, i32 %41, 1
  resume { ptr, i32 } %43

44:                                               ; preds = %35
  unreachable
}

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

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 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 = { "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, !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 = !{!15, !15, i64 0}
!17 = distinct !{!17, !18}
!18 = !{!"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"

%"class.juce::File" = type { %"class.juce::String" }
%"class.juce::String" = type { %"class.juce::CharPointer_UTF8" }
%"class.juce::CharPointer_UTF8" = type { ptr }

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: mustprogress nounwind uwtable
declare dso_local void @_ZN4juce4FileD2Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK4juce21DirectoryContentsList7getFileEi(ptr dead_on_unwind noalias writable sret(%"class.juce::File") align 8, ptr noundef nonnull align 8 dereferenceable(177), i32 noundef) local_unnamed_addr #2 align 2

declare noundef zeroext i1 @_ZNK4juce4FileeqERKS0_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #3

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4juce17FileListComponent15setSelectedFileERKNS_4FileE(ptr noundef nonnull align 8 dereferenceable(360) %0, ptr noundef nonnull align 8 dereferenceable(8) %1) unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca %"class.juce::File", align 8
  %4 = getelementptr inbounds i8, ptr %0, i64 304
  %5 = load ptr, ptr %4, align 8, !tbaa !5
  %6 = tail call noundef i32 @_ZNK4juce21DirectoryContentsList11getNumFilesEv(ptr noundef nonnull align 8 dereferenceable(177) %5) #4
  br label %7

7:                                                ; preds = %13, %2
  %.0 = phi i32 [ %6, %2 ], [ %8, %13 ]
  %8 = add nsw i32 %.0, -1
  %9 = icmp sgt i32 %.0, 0
  br i1 %9, label %10, label %17

10:                                               ; preds = %7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #4
  %11 = load ptr, ptr %4, align 8, !tbaa !5
  call void @_ZNK4juce21DirectoryContentsList7getFileEi(ptr dead_on_unwind nonnull writable sret(%"class.juce::File") align 8 %3, ptr noundef nonnull align 8 dereferenceable(177) %11, i32 noundef %8)
  %12 = invoke noundef zeroext i1 @_ZNK4juce4FileeqERKS0_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %1)
          to label %13 unwind label %14

13:                                               ; preds = %10
  call void @_ZN4juce4FileD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %3) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #4
  br i1 %12, label %16, label %7, !llvm.loop !15

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

16:                                               ; preds = %13
  call void @_ZN4juce7ListBox9selectRowEibb(ptr noundef nonnull align 8 dereferenceable(296) %0, i32 noundef %8, i1 noundef zeroext false, i1 noundef zeroext true)
  br label %18

17:                                               ; preds = %7
  call void @_ZN4juce7ListBox15deselectAllRowsEv(ptr noundef nonnull align 8 dereferenceable(296) %0)
  br label %18

18:                                               ; preds = %16, %17
  ret void
}

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

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 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 = { "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, !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}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LoopUnrollPass,SROAPass,SimplifyCFGPass,TailCallElimPass