; 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::Array.288" = type { %"class.juce::ArrayAllocationBase.289", i32, [4 x i8] }
%"class.juce::ArrayAllocationBase.289" = type <{ %"class.juce::HeapBlock.290", i32, [4 x i8] }>
%"class.juce::HeapBlock.290" = type { ptr }
%"struct.juce::ApplicationCommandInfo" = type <{ i32, [4 x i8], %"class.juce::String", %"class.juce::String", %"class.juce::String", %"class.juce::Array.104", i32, [4 x i8] }>
%"class.juce::String" = type { %"class.juce::CharPointer_UTF8" }
%"class.juce::CharPointer_UTF8" = type { ptr }
%"class.juce::Array.104" = type { %"class.juce::ArrayAllocationBase.105", i32, [4 x i8] }
%"class.juce::ArrayAllocationBase.105" = type <{ %"class.juce::HeapBlock.106", i32, [4 x i8] }>
%"class.juce::HeapBlock.106" = 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: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN4juce22ApplicationCommandInfoD2Ev(ptr noundef nonnull align 8 dereferenceable(60)) unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN4juce5ArrayIiNS_20DummyCriticalSectionELi0EEC2Ev(ptr noundef nonnull align 8 dereferenceable(20)) unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN4juce5ArrayIiNS_20DummyCriticalSectionELi0EED2Ev(ptr noundef nonnull align 8 dereferenceable(20)) unnamed_addr #2 align 2

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK4juce5ArrayIiNS_20DummyCriticalSectionELi0EE12getUncheckedEi(ptr noundef nonnull align 8 dereferenceable(20), i32 noundef) #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4juce25ApplicationCommandManager15registerCommandERKNS_22ApplicationCommandInfoE(ptr noundef nonnull align 8 dereferenceable(88), ptr noundef nonnull align 8 dereferenceable(60)) #3 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4juce25ApplicationCommandManager28registerAllCommandsForTargetEPNS_24ApplicationCommandTargetE(ptr noundef nonnull align 8 dereferenceable(88) %0, ptr noundef %1) #3 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca %"class.juce::Array.288", align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca %"struct.juce::ApplicationCommandInfo", align 8
  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
  %11 = load ptr, ptr %4, align 8, !tbaa !5
  %12 = icmp ne ptr %11, null
  br i1 %12, label %13, label %54

13:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 24, ptr %5) #4
  call void @_ZN4juce5ArrayIiNS_20DummyCriticalSectionELi0EEC2Ev(ptr noundef nonnull align 8 dereferenceable(20) %5) #4
  %14 = load ptr, ptr %4, align 8, !tbaa !5
  %15 = load ptr, ptr %14, align 8, !tbaa !9
  %16 = getelementptr inbounds ptr, ptr %15, i64 3
  %17 = load ptr, ptr %16, align 8
  invoke void %17(ptr noundef nonnull align 8 dereferenceable(16) %14, ptr noundef nonnull align 8 dereferenceable(20) %5)
          to label %18 unwind label %24

18:                                               ; preds = %13
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #4
  store i32 0, ptr %8, align 4, !tbaa !11
  br label %19

19:                                               ; preds = %40, %18
  %20 = load i32, ptr %8, align 4, !tbaa !11
  %21 = call noundef i32 @_ZNK4juce5ArrayIiNS_20DummyCriticalSectionELi0EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(20) %5) #4
  %22 = icmp slt i32 %20, %21
  br i1 %22, label %28, label %23

23:                                               ; preds = %19
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  br label %52

24:                                               ; preds = %13
  %25 = landingpad { ptr, i32 }
          cleanup
  %26 = extractvalue { ptr, i32 } %25, 0
  store ptr %26, ptr %6, align 8
  %27 = extractvalue { ptr, i32 } %25, 1
  store i32 %27, ptr %7, align 4
  br label %53

28:                                               ; preds = %19
  call void @llvm.lifetime.start.p0(i64 64, ptr %9) #4
  %29 = load i32, ptr %8, align 4, !tbaa !11
  %30 = invoke noundef i32 @_ZNK4juce5ArrayIiNS_20DummyCriticalSectionELi0EE12getUncheckedEi(ptr noundef nonnull align 8 dereferenceable(20) %5, i32 noundef %29)
          to label %31 unwind label %43

31:                                               ; preds = %28
  call void @_ZN4juce22ApplicationCommandInfoC1Ei(ptr noundef nonnull align 8 dereferenceable(60) %9, i32 noundef %30) #4
  %32 = load ptr, ptr %4, align 8, !tbaa !5
  %33 = getelementptr inbounds %"struct.juce::ApplicationCommandInfo", ptr %9, i32 0, i32 0
  %34 = load i32, ptr %33, align 8, !tbaa !13
  %35 = load ptr, ptr %32, align 8, !tbaa !9
  %36 = getelementptr inbounds ptr, ptr %35, i64 4
  %37 = load ptr, ptr %36, align 8
  invoke void %37(ptr noundef nonnull align 8 dereferenceable(16) %32, i32 noundef %34, ptr noundef nonnull align 8 dereferenceable(60) %9)
          to label %38 unwind label %47

38:                                               ; preds = %31
  invoke void @_ZN4juce25ApplicationCommandManager15registerCommandERKNS_22ApplicationCommandInfoE(ptr noundef nonnull align 8 dereferenceable(88) %10, ptr noundef nonnull align 8 dereferenceable(60) %9)
          to label %39 unwind label %47

39:                                               ; preds = %38
  call void @_ZN4juce22ApplicationCommandInfoD2Ev(ptr noundef nonnull align 8 dereferenceable(60) %9) #4
  call void @llvm.lifetime.end.p0(i64 64, ptr %9) #4
  br label %40

40:                                               ; preds = %39
  %41 = load i32, ptr %8, align 4, !tbaa !11
  %42 = add nsw i32 %41, 1
  store i32 %42, ptr %8, align 4, !tbaa !11
  br label %19, !llvm.loop !20

43:                                               ; preds = %28
  %44 = landingpad { ptr, i32 }
          cleanup
  %45 = extractvalue { ptr, i32 } %44, 0
  store ptr %45, ptr %6, align 8
  %46 = extractvalue { ptr, i32 } %44, 1
  store i32 %46, ptr %7, align 4
  br label %51

47:                                               ; preds = %38, %31
  %48 = landingpad { ptr, i32 }
          cleanup
  %49 = extractvalue { ptr, i32 } %48, 0
  store ptr %49, ptr %6, align 8
  %50 = extractvalue { ptr, i32 } %48, 1
  store i32 %50, ptr %7, align 4
  call void @_ZN4juce22ApplicationCommandInfoD2Ev(ptr noundef nonnull align 8 dereferenceable(60) %9) #4
  br label %51

51:                                               ; preds = %47, %43
  call void @llvm.lifetime.end.p0(i64 64, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  br label %53

52:                                               ; preds = %23
  call void @_ZN4juce5ArrayIiNS_20DummyCriticalSectionELi0EED2Ev(ptr noundef nonnull align 8 dereferenceable(20) %5) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr %5) #4
  br label %54

53:                                               ; preds = %51, %24
  call void @_ZN4juce5ArrayIiNS_20DummyCriticalSectionELi0EED2Ev(ptr noundef nonnull align 8 dereferenceable(20) %5) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr %5) #4
  br label %55

54:                                               ; preds = %52, %2
  ret void

55:                                               ; preds = %53
  %56 = load ptr, ptr %6, align 8
  %57 = load i32, ptr %7, align 4
  %58 = insertvalue { ptr, i32 } poison, ptr %56, 0
  %59 = insertvalue { ptr, i32 } %58, i32 %57, 1
  resume { ptr, i32 } %59
}

declare void @_ZN4juce22ApplicationCommandInfoC1Ei(ptr, i32)

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 = { 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 #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 = { 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 = !{!"vtable pointer", !8, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!14, !12, i64 0}
!14 = !{!"_ZTSN4juce22ApplicationCommandInfoE", !12, i64 0, !15, i64 8, !15, i64 16, !15, i64 24, !17, i64 32, !12, i64 56}
!15 = !{!"_ZTSN4juce6StringE", !16, i64 0}
!16 = !{!"_ZTSN4juce16CharPointer_UTF8E", !6, i64 0}
!17 = !{!"_ZTSN4juce5ArrayINS_8KeyPressENS_20DummyCriticalSectionELi0EEE", !18, i64 0, !12, i64 16}
!18 = !{!"_ZTSN4juce19ArrayAllocationBaseINS_8KeyPressENS_20DummyCriticalSectionEEE", !19, i64 0, !12, i64 8}
!19 = !{!"_ZTSN4juce9HeapBlockINS_8KeyPressELb0EEE", !6, i64 0}
!20 = distinct !{!20, !21}
!21 = !{!"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::Array.288" = type { %"class.juce::ArrayAllocationBase.289", i32, [4 x i8] }
%"class.juce::ArrayAllocationBase.289" = type <{ %"class.juce::HeapBlock.290", i32, [4 x i8] }>
%"class.juce::HeapBlock.290" = type { ptr }
%"struct.juce::ApplicationCommandInfo" = type <{ i32, [4 x i8], %"class.juce::String", %"class.juce::String", %"class.juce::String", %"class.juce::Array.104", i32, [4 x i8] }>
%"class.juce::String" = type { %"class.juce::CharPointer_UTF8" }
%"class.juce::CharPointer_UTF8" = type { ptr }
%"class.juce::Array.104" = type { %"class.juce::ArrayAllocationBase.105", i32, [4 x i8] }
%"class.juce::ArrayAllocationBase.105" = type <{ %"class.juce::HeapBlock.106", i32, [4 x i8] }>
%"class.juce::HeapBlock.106" = 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: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN4juce22ApplicationCommandInfoD2Ev(ptr noundef nonnull align 8 dereferenceable(60)) unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN4juce5ArrayIiNS_20DummyCriticalSectionELi0EEC2Ev(ptr noundef nonnull align 8 dereferenceable(20)) unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN4juce5ArrayIiNS_20DummyCriticalSectionELi0EED2Ev(ptr noundef nonnull align 8 dereferenceable(20)) unnamed_addr #2 align 2

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK4juce5ArrayIiNS_20DummyCriticalSectionELi0EE12getUncheckedEi(ptr noundef nonnull align 8 dereferenceable(20), i32 noundef) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4juce25ApplicationCommandManager15registerCommandERKNS_22ApplicationCommandInfoE(ptr noundef nonnull align 8 dereferenceable(88), ptr noundef nonnull align 8 dereferenceable(60)) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4juce25ApplicationCommandManager28registerAllCommandsForTargetEPNS_24ApplicationCommandTargetE(ptr noundef nonnull align 8 dereferenceable(88) %0, ptr noundef %1) local_unnamed_addr #3 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca %"class.juce::Array.288", align 8
  %4 = alloca %"struct.juce::ApplicationCommandInfo", align 8
  %.not = icmp eq ptr %1, null
  br i1 %.not, label %26, label %5

5:                                                ; preds = %2
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %3) #4
  call void @_ZN4juce5ArrayIiNS_20DummyCriticalSectionELi0EEC2Ev(ptr noundef nonnull align 8 dereferenceable(20) %3) #4
  %6 = load ptr, ptr %1, align 8, !tbaa !5
  %7 = getelementptr inbounds i8, ptr %6, i64 24
  %8 = load ptr, ptr %7, align 8
  invoke void %8(ptr noundef nonnull align 8 dereferenceable(16) %1, ptr noundef nonnull align 8 dereferenceable(20) %3)
          to label %.preheader unwind label %11

.preheader:                                       ; preds = %5
  %9 = call noundef i32 @_ZNK4juce5ArrayIiNS_20DummyCriticalSectionELi0EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(20) %3) #4
  %10 = icmp sgt i32 %9, 0
  br i1 %10, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %19, %.preheader
  call void @_ZN4juce5ArrayIiNS_20DummyCriticalSectionELi0EED2Ev(ptr noundef nonnull align 8 dereferenceable(20) %3) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %3) #4
  br label %26

11:                                               ; preds = %5
  %12 = landingpad { ptr, i32 }
          cleanup
  br label %25

.lr.ph:                                           ; preds = %.preheader, %19
  %.012 = phi i32 [ %20, %19 ], [ 0, %.preheader ]
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %4) #4
  %13 = call noundef i32 @_ZNK4juce5ArrayIiNS_20DummyCriticalSectionELi0EE12getUncheckedEi(ptr noundef nonnull align 8 dereferenceable(20) %3, i32 noundef %.012)
  call void @_ZN4juce22ApplicationCommandInfoC1Ei(ptr noundef nonnull align 8 dereferenceable(60) %4, i32 noundef %13) #4
  %14 = load i32, ptr %4, align 8, !tbaa !8
  %15 = load ptr, ptr %1, align 8, !tbaa !5
  %16 = getelementptr inbounds i8, ptr %15, i64 32
  %17 = load ptr, ptr %16, align 8
  invoke void %17(ptr noundef nonnull align 8 dereferenceable(16) %1, i32 noundef %14, ptr noundef nonnull align 8 dereferenceable(60) %4)
          to label %18 unwind label %23

18:                                               ; preds = %.lr.ph
  invoke void @_ZN4juce25ApplicationCommandManager15registerCommandERKNS_22ApplicationCommandInfoE(ptr noundef nonnull align 8 dereferenceable(88) %0, ptr noundef nonnull align 8 dereferenceable(60) %4)
          to label %19 unwind label %23

19:                                               ; preds = %18
  call void @_ZN4juce22ApplicationCommandInfoD2Ev(ptr noundef nonnull align 8 dereferenceable(60) %4) #4
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %4) #4
  %20 = add nuw nsw i32 %.012, 1
  %21 = call noundef i32 @_ZNK4juce5ArrayIiNS_20DummyCriticalSectionELi0EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(20) %3) #4
  %22 = icmp slt i32 %20, %21
  br i1 %22, label %.lr.ph, label %._crit_edge, !llvm.loop !18

23:                                               ; preds = %18, %.lr.ph
  %24 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN4juce22ApplicationCommandInfoD2Ev(ptr noundef nonnull align 8 dereferenceable(60) %4) #4
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %4) #4
  br label %25

25:                                               ; preds = %23, %11
  %.pn = phi { ptr, i32 } [ %24, %23 ], [ %12, %11 ]
  call void @_ZN4juce5ArrayIiNS_20DummyCriticalSectionELi0EED2Ev(ptr noundef nonnull align 8 dereferenceable(20) %3) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %3) #4
  resume { ptr, i32 } %.pn

26:                                               ; preds = %._crit_edge, %2
  ret void
}

declare void @_ZN4juce22ApplicationCommandInfoC1Ei(ptr, i32) 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 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 #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 = { 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"}
!8 = !{!9, !10, i64 0}
!9 = !{!"_ZTSN4juce22ApplicationCommandInfoE", !10, i64 0, !12, i64 8, !12, i64 16, !12, i64 24, !15, i64 32, !10, i64 56}
!10 = !{!"int", !11, i64 0}
!11 = !{!"omnipotent char", !7, i64 0}
!12 = !{!"_ZTSN4juce6StringE", !13, i64 0}
!13 = !{!"_ZTSN4juce16CharPointer_UTF8E", !14, i64 0}
!14 = !{!"any pointer", !11, i64 0}
!15 = !{!"_ZTSN4juce5ArrayINS_8KeyPressENS_20DummyCriticalSectionELi0EEE", !16, i64 0, !10, i64 16}
!16 = !{!"_ZTSN4juce19ArrayAllocationBaseINS_8KeyPressENS_20DummyCriticalSectionEEE", !17, i64 0, !10, i64 8}
!17 = !{!"_ZTSN4juce9HeapBlockINS_8KeyPressELb0EEE", !14, i64 0}
!18 = distinct !{!18, !19}
!19 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass