; 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"

%"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 }
%"class.juce::ApplicationCommandManager" = type { %"class.juce::AsyncUpdater", %"class.juce::FocusChangeListener", %"class.juce::OwnedArray.126", %"class.juce::ListenerList.131", %"class.juce::ScopedPointer.137", ptr }
%"class.juce::AsyncUpdater" = type { ptr, %"class.juce::ReferenceCountedObjectPtr.15" }
%"class.juce::ReferenceCountedObjectPtr.15" = type { ptr }
%"class.juce::FocusChangeListener" = type { ptr }
%"class.juce::OwnedArray.126" = type { %"class.juce::ArrayAllocationBase.127", i32, [4 x i8] }
%"class.juce::ArrayAllocationBase.127" = type <{ %"class.juce::HeapBlock.128", i32, [4 x i8] }>
%"class.juce::HeapBlock.128" = type { ptr }
%"class.juce::ListenerList.131" = type { %"class.juce::Array.132" }
%"class.juce::Array.132" = type { %"class.juce::ArrayAllocationBase.133", i32, [4 x i8] }
%"class.juce::ArrayAllocationBase.133" = type <{ %"class.juce::HeapBlock.134", i32, [4 x i8] }>
%"class.juce::HeapBlock.134" = type { ptr }
%"class.juce::ScopedPointer.137" = type { ptr }

declare i32 @__gxx_personality_v0(...)

; Function Attrs: nobuiltin nounwind
declare void @_ZdlPvm(ptr noundef, i64 noundef) #0

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znwm(i64 noundef) #2

declare void @_ZN4juce12AsyncUpdater18triggerAsyncUpdateEv(ptr noundef nonnull align 8 dereferenceable(16)) #3

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN4juce22ApplicationCommandInfoC2ERKS0_(ptr noundef nonnull align 8 dereferenceable(60), ptr noundef nonnull align 8 dereferenceable(60)) unnamed_addr #4 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNK4juce13ScopedPointerINS_18KeyPressMappingSetEEptEv(ptr noundef nonnull align 8 dereferenceable(8)) #5 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4juce25ApplicationCommandManager15registerCommandERKNS_22ApplicationCommandInfoE(ptr noundef nonnull align 8 dereferenceable(88) %0, ptr noundef nonnull align 8 dereferenceable(60) %1) #6 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, 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
  br label %10

10:                                               ; preds = %2
  br label %11

11:                                               ; preds = %10
  br label %12

12:                                               ; preds = %11
  br label %13

13:                                               ; preds = %12
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #8
  %14 = load ptr, ptr %4, align 8, !tbaa !5
  %15 = getelementptr inbounds %"struct.juce::ApplicationCommandInfo", ptr %14, i32 0, i32 0
  %16 = load i32, ptr %15, align 8, !tbaa !9
  %17 = call noundef ptr @_ZNK4juce25ApplicationCommandManager22getMutableCommandForIDEi(ptr noundef nonnull align 8 dereferenceable(88) %9, i32 noundef %16) #8
  store ptr %17, ptr %5, align 8, !tbaa !5
  %18 = load ptr, ptr %5, align 8, !tbaa !5
  %19 = icmp ne ptr %18, null
  br i1 %19, label %20, label %27

20:                                               ; preds = %13
  br label %21

21:                                               ; preds = %20
  br label %22

22:                                               ; preds = %21
  br label %23

23:                                               ; preds = %22
  %24 = load ptr, ptr %4, align 8, !tbaa !5
  %25 = load ptr, ptr %5, align 8, !tbaa !5
  %26 = call noundef nonnull align 8 dereferenceable(60) ptr @_ZN4juce22ApplicationCommandInfoaSERKS0_(ptr noundef nonnull align 8 dereferenceable(60) %25, ptr noundef nonnull align 8 dereferenceable(60) %24)
  br label %47

27:                                               ; preds = %13
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #8
  %28 = call noalias noundef nonnull ptr @_Znwm(i64 noundef 64) #9
  %29 = load ptr, ptr %4, align 8, !tbaa !5
  invoke void @_ZN4juce22ApplicationCommandInfoC2ERKS0_(ptr noundef nonnull align 8 dereferenceable(60) %28, ptr noundef nonnull align 8 dereferenceable(60) %29)
          to label %30 unwind label %43

30:                                               ; preds = %27
  store ptr %28, ptr %6, align 8, !tbaa !5
  %31 = load ptr, ptr %6, align 8, !tbaa !5
  %32 = getelementptr inbounds %"struct.juce::ApplicationCommandInfo", ptr %31, i32 0, i32 6
  %33 = load i32, ptr %32, align 8, !tbaa !17
  %34 = and i32 %33, -3
  store i32 %34, ptr %32, align 8, !tbaa !17
  %35 = getelementptr inbounds %"class.juce::ApplicationCommandManager", ptr %9, i32 0, i32 2
  %36 = load ptr, ptr %6, align 8, !tbaa !5
  %37 = call noundef ptr @_ZN4juce10OwnedArrayINS_22ApplicationCommandInfoENS_20DummyCriticalSectionEE3addEPS1_(ptr noundef nonnull align 8 dereferenceable(20) %35, ptr noundef %36) #8
  %38 = getelementptr inbounds %"class.juce::ApplicationCommandManager", ptr %9, i32 0, i32 4
  %39 = call noundef ptr @_ZNK4juce13ScopedPointerINS_18KeyPressMappingSetEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %38) #8
  %40 = load ptr, ptr %4, align 8, !tbaa !5
  %41 = getelementptr inbounds %"struct.juce::ApplicationCommandInfo", ptr %40, i32 0, i32 0
  %42 = load i32, ptr %41, align 8, !tbaa !9
  call void @_ZN4juce18KeyPressMappingSet21resetToDefaultMappingEi(ptr noundef nonnull align 8 dereferenceable(128) %39, i32 noundef %42)
  call void @_ZN4juce12AsyncUpdater18triggerAsyncUpdateEv(ptr noundef nonnull align 8 dereferenceable(16) %9)
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #8
  br label %47

43:                                               ; preds = %27
  %44 = landingpad { ptr, i32 }
          cleanup
  %45 = extractvalue { ptr, i32 } %44, 0
  store ptr %45, ptr %7, align 8
  %46 = extractvalue { ptr, i32 } %44, 1
  store i32 %46, ptr %8, align 4
  call void @_ZdlPvm(ptr noundef %28, i64 noundef 64) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #8
  br label %48

47:                                               ; preds = %30, %23
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #8
  ret void

48:                                               ; preds = %43
  %49 = load ptr, ptr %7, align 8
  %50 = load i32, ptr %8, align 4
  %51 = insertvalue { ptr, i32 } poison, ptr %49, 0
  %52 = insertvalue { ptr, i32 } %51, i32 %50, 1
  resume { ptr, i32 } %52
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNK4juce25ApplicationCommandManager22getMutableCommandForIDEi(ptr noundef nonnull align 8 dereferenceable(88), i32 noundef) #7 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(60) ptr @_ZN4juce22ApplicationCommandInfoaSERKS0_(ptr noundef nonnull align 8 dereferenceable(60), ptr noundef nonnull align 8 dereferenceable(60)) #4 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZN4juce10OwnedArrayINS_22ApplicationCommandInfoENS_20DummyCriticalSectionEE3addEPS1_(ptr noundef nonnull align 8 dereferenceable(20), ptr noundef) #7 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4juce18KeyPressMappingSet21resetToDefaultMappingEi(ptr noundef nonnull align 8 dereferenceable(128), i32 noundef) #6 align 2

attributes #0 = { nobuiltin nounwind "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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nobuiltin allocsize(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 = { inlinehint 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 #5 = { 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 #6 = { 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 #7 = { 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 #8 = { nounwind }
attributes #9 = { builtin allocsize(0) }
attributes #10 = { builtin 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, !11, i64 0}
!10 = !{!"_ZTSN4juce22ApplicationCommandInfoE", !11, i64 0, !12, i64 8, !12, i64 16, !12, i64 24, !14, i64 32, !11, i64 56}
!11 = !{!"int", !7, i64 0}
!12 = !{!"_ZTSN4juce6StringE", !13, i64 0}
!13 = !{!"_ZTSN4juce16CharPointer_UTF8E", !6, i64 0}
!14 = !{!"_ZTSN4juce5ArrayINS_8KeyPressENS_20DummyCriticalSectionELi0EEE", !15, i64 0, !11, i64 16}
!15 = !{!"_ZTSN4juce19ArrayAllocationBaseINS_8KeyPressENS_20DummyCriticalSectionEEE", !16, i64 0, !11, i64 8}
!16 = !{!"_ZTSN4juce9HeapBlockINS_8KeyPressELb0EEE", !6, i64 0}
!17 = !{!10, !11, i64 56}


; 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"

declare i32 @__gxx_personality_v0(...)

; Function Attrs: nobuiltin nounwind
declare void @_ZdlPvm(ptr noundef, i64 noundef) local_unnamed_addr #0

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znwm(i64 noundef) local_unnamed_addr #1

declare void @_ZN4juce12AsyncUpdater18triggerAsyncUpdateEv(ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #2

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNK4juce13ScopedPointerINS_18KeyPressMappingSetEEptEv(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #4 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4juce25ApplicationCommandManager15registerCommandERKNS_22ApplicationCommandInfoE(ptr noundef nonnull align 8 dereferenceable(88) %0, ptr noundef nonnull align 8 dereferenceable(60) %1) local_unnamed_addr #5 align 2 personality ptr @__gxx_personality_v0 {
  %3 = load i32, ptr %1, align 8, !tbaa !5
  %4 = tail call noundef ptr @_ZNK4juce25ApplicationCommandManager22getMutableCommandForIDEi(ptr noundef nonnull align 8 dereferenceable(88) %0, i32 noundef %3) #7
  %.not = icmp eq ptr %4, null
  br i1 %.not, label %7, label %5

5:                                                ; preds = %2
  %6 = tail call noundef nonnull align 8 dereferenceable(60) ptr @_ZN4juce22ApplicationCommandInfoaSERKS0_(ptr noundef nonnull align 8 dereferenceable(60) %4, ptr noundef nonnull align 8 dereferenceable(60) %1)
  br label %20

7:                                                ; preds = %2
  %8 = tail call noalias noundef nonnull dereferenceable(64) ptr @_Znwm(i64 noundef 64) #8
  invoke void @_ZN4juce22ApplicationCommandInfoC2ERKS0_(ptr noundef nonnull align 8 dereferenceable(60) %8, ptr noundef nonnull align 8 dereferenceable(60) %1)
          to label %9 unwind label %18

9:                                                ; preds = %7
  %10 = getelementptr inbounds i8, ptr %8, i64 56
  %11 = load i32, ptr %10, align 8, !tbaa !16
  %12 = and i32 %11, -3
  store i32 %12, ptr %10, align 8, !tbaa !16
  %13 = getelementptr inbounds i8, ptr %0, i64 24
  %14 = tail call noundef ptr @_ZN4juce10OwnedArrayINS_22ApplicationCommandInfoENS_20DummyCriticalSectionEE3addEPS1_(ptr noundef nonnull align 8 dereferenceable(20) %13, ptr noundef nonnull %8) #7
  %15 = getelementptr inbounds i8, ptr %0, i64 72
  %16 = tail call noundef ptr @_ZNK4juce13ScopedPointerINS_18KeyPressMappingSetEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %15) #7
  %17 = load i32, ptr %1, align 8, !tbaa !5
  tail call void @_ZN4juce18KeyPressMappingSet21resetToDefaultMappingEi(ptr noundef nonnull align 8 dereferenceable(128) %16, i32 noundef %17)
  tail call void @_ZN4juce12AsyncUpdater18triggerAsyncUpdateEv(ptr noundef nonnull align 8 dereferenceable(16) %0)
  br label %20

18:                                               ; preds = %7
  %19 = landingpad { ptr, i32 }
          cleanup
  tail call void @_ZdlPvm(ptr noundef nonnull %8, i64 noundef 64) #9
  resume { ptr, i32 } %19

20:                                               ; preds = %9, %5
  ret void
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNK4juce25ApplicationCommandManager22getMutableCommandForIDEi(ptr noundef nonnull align 8 dereferenceable(88), i32 noundef) local_unnamed_addr #6 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZN4juce10OwnedArrayINS_22ApplicationCommandInfoENS_20DummyCriticalSectionEE3addEPS1_(ptr noundef nonnull align 8 dereferenceable(20), ptr noundef) local_unnamed_addr #6 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4juce18KeyPressMappingSet21resetToDefaultMappingEi(ptr noundef nonnull align 8 dereferenceable(128), i32 noundef) local_unnamed_addr #5 align 2

attributes #0 = { nobuiltin nounwind "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 = { nobuiltin allocsize(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 = { inlinehint 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 = { 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 #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 = { 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 #7 = { nounwind }
attributes #8 = { builtin allocsize(0) }
attributes #9 = { builtin 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 0}
!6 = !{!"_ZTSN4juce22ApplicationCommandInfoE", !7, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !13, i64 32, !7, i64 56}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"_ZTSN4juce6StringE", !11, i64 0}
!11 = !{!"_ZTSN4juce16CharPointer_UTF8E", !12, i64 0}
!12 = !{!"any pointer", !8, i64 0}
!13 = !{!"_ZTSN4juce5ArrayINS_8KeyPressENS_20DummyCriticalSectionELi0EEE", !14, i64 0, !7, i64 16}
!14 = !{!"_ZTSN4juce19ArrayAllocationBaseINS_8KeyPressENS_20DummyCriticalSectionEEE", !15, i64 0, !7, i64 8}
!15 = !{!"_ZTSN4juce9HeapBlockINS_8KeyPressELb0EEE", !12, i64 0}
!16 = !{!6, !7, i64 56}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,SROAPass,SimplifyCFGPass,TailCallElimPass