; 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::TreeViewItem" = type <{ ptr, ptr, ptr, %"class.juce::OwnedArray.338", i32, i32, i32, i32, i32, i32, i8, [7 x i8] }>
%"class.juce::OwnedArray.338" = type { %"class.juce::ArrayAllocationBase.339", i32, [4 x i8] }
%"class.juce::ArrayAllocationBase.339" = type <{ %"class.juce::HeapBlock.340", i32, [4 x i8] }>
%"class.juce::HeapBlock.340" = 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 nounwind uwtable
declare dso_local void @_ZNK4juce12TreeViewItem14treeHasChangedEv(ptr noundef nonnull align 8 dereferenceable(73)) #1 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4juce12TreeViewItem11setOpennessENS0_8OpennessE(ptr noundef nonnull align 8 dereferenceable(73) %0, i32 noundef %1) #2 align 2 {
  %3 = alloca ptr, align 8
  %4 = alloca i32, align 4
  %5 = alloca i8, align 1
  %6 = alloca i8, align 1
  store ptr %0, ptr %3, align 8, !tbaa !5
  store i32 %1, ptr %4, align 4, !tbaa !9
  %7 = load ptr, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 1, ptr %5) #3
  %8 = call noundef zeroext i1 @_ZNK4juce12TreeViewItem6isOpenEv(ptr noundef nonnull align 8 dereferenceable(73) %7) #3
  %9 = zext i1 %8 to i8
  store i8 %9, ptr %5, align 1, !tbaa !11
  %10 = load i32, ptr %4, align 4, !tbaa !9
  %11 = getelementptr inbounds %"class.juce::TreeViewItem", ptr %7, i32 0, i32 10
  %12 = trunc i32 %10 to i8
  %13 = load i8, ptr %11, align 8
  %14 = and i8 %12, 3
  %15 = shl i8 %14, 6
  %16 = and i8 %13, 63
  %17 = or i8 %16, %15
  store i8 %17, ptr %11, align 8
  call void @llvm.lifetime.start.p0(i64 1, ptr %6) #3
  %18 = call noundef zeroext i1 @_ZNK4juce12TreeViewItem6isOpenEv(ptr noundef nonnull align 8 dereferenceable(73) %7) #3
  %19 = zext i1 %18 to i8
  store i8 %19, ptr %6, align 1, !tbaa !11
  %20 = load i8, ptr %6, align 1, !tbaa !11, !range !13, !noundef !14
  %21 = trunc i8 %20 to i1
  %22 = zext i1 %21 to i32
  %23 = load i8, ptr %5, align 1, !tbaa !11, !range !13, !noundef !14
  %24 = trunc i8 %23 to i1
  %25 = zext i1 %24 to i32
  %26 = icmp ne i32 %22, %25
  br i1 %26, label %27, label %33

27:                                               ; preds = %2
  call void @_ZNK4juce12TreeViewItem14treeHasChangedEv(ptr noundef nonnull align 8 dereferenceable(73) %7) #3
  %28 = load i8, ptr %6, align 1, !tbaa !11, !range !13, !noundef !14
  %29 = trunc i8 %28 to i1
  %30 = load ptr, ptr %7, align 8, !tbaa !15
  %31 = getelementptr inbounds ptr, ptr %30, i64 4
  %32 = load ptr, ptr %31, align 8
  call void %32(ptr noundef nonnull align 8 dereferenceable(73) %7, i1 noundef zeroext %29)
  br label %33

33:                                               ; preds = %27, %2
  call void @llvm.lifetime.end.p0(i64 1, ptr %6) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr %5) #3
  ret void
}

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 = { 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 = !{!"_ZTSN4juce12TreeViewItem8OpennessE", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"bool", !7, i64 0}
!13 = !{i8 0, i8 2}
!14 = !{}
!15 = !{!16, !16, i64 0}
!16 = !{!"vtable pointer", !8, 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"

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4juce12TreeViewItem11setOpennessENS0_8OpennessE(ptr noundef nonnull align 8 dereferenceable(73) %0, i32 noundef %1) local_unnamed_addr #1 align 2 {
  %3 = tail call noundef zeroext i1 @_ZNK4juce12TreeViewItem6isOpenEv(ptr noundef nonnull align 8 dereferenceable(73) %0) #2
  %4 = getelementptr inbounds i8, ptr %0, i64 72
  %5 = trunc i32 %1 to i8
  %6 = load i8, ptr %4, align 8
  %7 = shl i8 %5, 6
  %8 = and i8 %6, 63
  %9 = or disjoint i8 %8, %7
  store i8 %9, ptr %4, align 8
  %10 = tail call noundef zeroext i1 @_ZNK4juce12TreeViewItem6isOpenEv(ptr noundef nonnull align 8 dereferenceable(73) %0) #2
  %11 = xor i1 %3, %10
  br i1 %11, label %12, label %16

12:                                               ; preds = %2
  tail call void @_ZNK4juce12TreeViewItem14treeHasChangedEv(ptr noundef nonnull align 8 dereferenceable(73) %0) #2
  %13 = load ptr, ptr %0, align 8, !tbaa !5
  %14 = getelementptr inbounds i8, ptr %13, i64 32
  %15 = load ptr, ptr %14, align 8
  tail call void %15(ptr noundef nonnull align 8 dereferenceable(73) %0, i1 noundef zeroext %10)
  br label %16

16:                                               ; preds = %12, %2
  ret void
}

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 = { 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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}


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