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

; 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
define dso_local noundef ptr @_ZN4juce25ApplicationCommandManager19getTargetForCommandEiRNS_22ApplicationCommandInfoE(ptr noundef nonnull align 8 dereferenceable(88) %0, i32 noundef %1, ptr noundef nonnull align 8 dereferenceable(60) %2) #1 align 2 {
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  store i32 %1, ptr %5, align 4, !tbaa !9
  store ptr %2, ptr %6, align 8, !tbaa !5
  %8 = load ptr, ptr %4, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #3
  %9 = load i32, ptr %5, align 4, !tbaa !9
  %10 = load ptr, ptr %8, align 8, !tbaa !11
  %11 = getelementptr inbounds ptr, ptr %10, i64 3
  %12 = load ptr, ptr %11, align 8
  %13 = call noundef ptr %12(ptr noundef nonnull align 8 dereferenceable(88) %8, i32 noundef %9)
  store ptr %13, ptr %7, align 8, !tbaa !5
  %14 = load ptr, ptr %7, align 8, !tbaa !5
  %15 = icmp eq ptr %14, null
  br i1 %15, label %16, label %23

16:                                               ; preds = %3
  %17 = call noundef ptr @_ZN4juce15JUCEApplication11getInstanceEv() #3
  %18 = icmp eq ptr %17, null
  br i1 %18, label %21, label %19

19:                                               ; preds = %16
  %20 = getelementptr inbounds i8, ptr %17, i64 24
  br label %21

21:                                               ; preds = %19, %16
  %22 = phi ptr [ %20, %19 ], [ null, %16 ]
  store ptr %22, ptr %7, align 8, !tbaa !5
  br label %23

23:                                               ; preds = %21, %3
  %24 = load ptr, ptr %7, align 8, !tbaa !5
  %25 = icmp ne ptr %24, null
  br i1 %25, label %26, label %30

26:                                               ; preds = %23
  %27 = load ptr, ptr %7, align 8, !tbaa !5
  %28 = load i32, ptr %5, align 4, !tbaa !9
  %29 = call noundef ptr @_ZN4juce24ApplicationCommandTarget19getTargetForCommandEi(ptr noundef nonnull align 8 dereferenceable(16) %27, i32 noundef %28)
  store ptr %29, ptr %7, align 8, !tbaa !5
  br label %30

30:                                               ; preds = %26, %23
  %31 = load ptr, ptr %7, align 8, !tbaa !5
  %32 = icmp ne ptr %31, null
  br i1 %32, label %33, label %43

33:                                               ; preds = %30
  %34 = load i32, ptr %5, align 4, !tbaa !9
  %35 = load ptr, ptr %6, align 8, !tbaa !5
  %36 = getelementptr inbounds %"struct.juce::ApplicationCommandInfo", ptr %35, i32 0, i32 0
  store i32 %34, ptr %36, align 8, !tbaa !13
  %37 = load ptr, ptr %7, align 8, !tbaa !5
  %38 = load i32, ptr %5, align 4, !tbaa !9
  %39 = load ptr, ptr %6, align 8, !tbaa !5
  %40 = load ptr, ptr %37, align 8, !tbaa !11
  %41 = getelementptr inbounds ptr, ptr %40, i64 4
  %42 = load ptr, ptr %41, align 8
  call void %42(ptr noundef nonnull align 8 dereferenceable(16) %37, i32 noundef %38, ptr noundef nonnull align 8 dereferenceable(60) %39)
  br label %43

43:                                               ; preds = %33, %30
  %44 = load ptr, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #3
  ret ptr %44
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZN4juce15JUCEApplication11getInstanceEv() #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN4juce24ApplicationCommandTarget19getTargetForCommandEi(ptr noundef nonnull align 8 dereferenceable(16), i32 noundef) #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 = { 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 = { 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 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"vtable pointer", !8, i64 0}
!13 = !{!14, !10, i64 0}
!14 = !{!"_ZTSN4juce22ApplicationCommandInfoE", !10, i64 0, !15, i64 8, !15, i64 16, !15, i64 24, !17, i64 32, !10, i64 56}
!15 = !{!"_ZTSN4juce6StringE", !16, i64 0}
!16 = !{!"_ZTSN4juce16CharPointer_UTF8E", !6, i64 0}
!17 = !{!"_ZTSN4juce5ArrayINS_8KeyPressENS_20DummyCriticalSectionELi0EEE", !18, i64 0, !10, i64 16}
!18 = !{!"_ZTSN4juce19ArrayAllocationBaseINS_8KeyPressENS_20DummyCriticalSectionEEE", !19, i64 0, !10, i64 8}
!19 = !{!"_ZTSN4juce9HeapBlockINS_8KeyPressELb0EEE", !6, 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 uwtable
define dso_local noundef ptr @_ZN4juce25ApplicationCommandManager19getTargetForCommandEiRNS_22ApplicationCommandInfoE(ptr noundef nonnull align 8 dereferenceable(88) %0, i32 noundef %1, ptr noundef nonnull align 8 dereferenceable(60) %2) local_unnamed_addr #0 align 2 {
  %4 = load ptr, ptr %0, align 8, !tbaa !5
  %5 = getelementptr inbounds i8, ptr %4, i64 24
  %6 = load ptr, ptr %5, align 8
  %7 = tail call noundef ptr %6(ptr noundef nonnull align 8 dereferenceable(88) %0, i32 noundef %1)
  %8 = icmp eq ptr %7, null
  br i1 %8, label %9, label %13

9:                                                ; preds = %3
  %10 = tail call noundef ptr @_ZN4juce15JUCEApplication11getInstanceEv() #2
  %11 = icmp eq ptr %10, null
  %12 = getelementptr inbounds i8, ptr %10, i64 24
  br i1 %11, label %.thread17, label %13

13:                                               ; preds = %3, %9
  %.0.ph = phi ptr [ %7, %3 ], [ %12, %9 ]
  %14 = tail call noundef ptr @_ZN4juce24ApplicationCommandTarget19getTargetForCommandEi(ptr noundef nonnull align 8 dereferenceable(16) %.0.ph, i32 noundef %1)
  %.not13 = icmp eq ptr %14, null
  br i1 %.not13, label %.thread17, label %15

15:                                               ; preds = %13
  store i32 %1, ptr %2, align 8, !tbaa !8
  %16 = load ptr, ptr %14, align 8, !tbaa !5
  %17 = getelementptr inbounds i8, ptr %16, i64 32
  %18 = load ptr, ptr %17, align 8
  tail call void %18(ptr noundef nonnull align 8 dereferenceable(16) %14, i32 noundef %1, ptr noundef nonnull align 8 dereferenceable(60) %2)
  br label %.thread17

.thread17:                                        ; preds = %9, %15, %13
  %.120 = phi ptr [ %14, %15 ], [ null, %13 ], [ null, %9 ]
  ret ptr %.120
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZN4juce15JUCEApplication11getInstanceEv() local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN4juce24ApplicationCommandTarget19getTargetForCommandEi(ptr noundef nonnull align 8 dereferenceable(16), i32 noundef) 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 = { 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 = { 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}


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