; 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::ApplicationCommandTarget::InvocationInfo" = type <{ i32, i32, i32, [4 x i8], ptr, %"class.juce::KeyPress", i8, [3 x i8], i32, [4 x i8] }>
%"class.juce::KeyPress" = type { i32, %"class.juce::ModifierKeys", i32 }
%"class.juce::ModifierKeys" = type { i32 }

declare i32 @__gxx_personality_v0(...)

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

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

declare noundef zeroext i1 @_ZN4juce14MessageManager11MessageBase4postEv(ptr noundef nonnull align 8 dereferenceable(16)) #2

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN4juce24ApplicationCommandTarget11tryToInvokeERKNS0_14InvocationInfoEb(ptr noundef nonnull align 8 dereferenceable(16) %0, ptr noundef nonnull align 8 dereferenceable(44) %1, i1 noundef zeroext %2) #3 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca i1, align 1
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i8, align 1
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  %10 = zext i1 %2 to i8
  store i8 %10, ptr %7, align 1, !tbaa !9
  %11 = load ptr, ptr %5, align 8
  %12 = load ptr, ptr %6, align 8, !tbaa !5
  %13 = getelementptr inbounds %"struct.juce::ApplicationCommandTarget::InvocationInfo", ptr %12, i32 0, i32 0
  %14 = load i32, ptr %13, align 8, !tbaa !11
  %15 = call noundef zeroext i1 @_ZN4juce24ApplicationCommandTarget15isCommandActiveEi(ptr noundef nonnull align 8 dereferenceable(16) %11, i32 noundef %14)
  br i1 %15, label %16, label %38

16:                                               ; preds = %3
  %17 = load i8, ptr %7, align 1, !tbaa !9, !range !18, !noundef !19
  %18 = trunc i8 %17 to i1
  br i1 %18, label %19, label %28

19:                                               ; preds = %16
  %20 = call noalias noundef nonnull ptr @_Znwm(i64 noundef 72) #4
  %21 = load ptr, ptr %6, align 8, !tbaa !5
  invoke void @_ZN4juce24ApplicationCommandTarget14CommandMessageC2EPS0_RKNS0_14InvocationInfoE(ptr noundef nonnull align 8 dereferenceable(72) %20, ptr noundef %11, ptr noundef nonnull align 8 dereferenceable(44) %21)
          to label %22 unwind label %24

22:                                               ; preds = %19
  %23 = call noundef zeroext i1 @_ZN4juce14MessageManager11MessageBase4postEv(ptr noundef nonnull align 8 dereferenceable(16) %20)
  store i1 true, ptr %4, align 1
  br label %39

24:                                               ; preds = %19
  %25 = landingpad { ptr, i32 }
          cleanup
  %26 = extractvalue { ptr, i32 } %25, 0
  store ptr %26, ptr %8, align 8
  %27 = extractvalue { ptr, i32 } %25, 1
  store i32 %27, ptr %9, align 4
  call void @_ZdlPvm(ptr noundef %20, i64 noundef 72) #5
  br label %41

28:                                               ; preds = %16
  %29 = load ptr, ptr %6, align 8, !tbaa !5
  %30 = load ptr, ptr %11, align 8, !tbaa !20
  %31 = getelementptr inbounds ptr, ptr %30, i64 5
  %32 = load ptr, ptr %31, align 8
  %33 = call noundef zeroext i1 %32(ptr noundef nonnull align 8 dereferenceable(16) %11, ptr noundef nonnull align 8 dereferenceable(44) %29)
  br i1 %33, label %34, label %35

34:                                               ; preds = %28
  store i1 true, ptr %4, align 1
  br label %39

35:                                               ; preds = %28
  br label %36

36:                                               ; preds = %35
  br label %37

37:                                               ; preds = %36
  br label %38

38:                                               ; preds = %37, %3
  store i1 false, ptr %4, align 1
  br label %39

39:                                               ; preds = %38, %34, %22
  %40 = load i1, ptr %4, align 1
  ret i1 %40

41:                                               ; preds = %24
  %42 = load ptr, ptr %8, align 8
  %43 = load i32, ptr %9, align 4
  %44 = insertvalue { ptr, i32 } poison, ptr %42, 0
  %45 = insertvalue { ptr, i32 } %44, i32 %43, 1
  resume { ptr, i32 } %45
}

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN4juce24ApplicationCommandTarget15isCommandActiveEi(ptr noundef nonnull align 8 dereferenceable(16), i32 noundef) #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4juce24ApplicationCommandTarget14CommandMessageC2EPS0_RKNS0_14InvocationInfoE(ptr noundef nonnull align 8 dereferenceable(72), ptr noundef, ptr noundef nonnull align 8 dereferenceable(44)) unnamed_addr #3 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 = { 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 = { builtin allocsize(0) }
attributes #5 = { 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, !10, i64 0}
!10 = !{!"bool", !7, i64 0}
!11 = !{!12, !13, i64 0}
!12 = !{!"_ZTSN4juce24ApplicationCommandTarget14InvocationInfoE", !13, i64 0, !13, i64 4, !14, i64 8, !6, i64 16, !15, i64 24, !10, i64 36, !13, i64 40}
!13 = !{!"int", !7, i64 0}
!14 = !{!"_ZTSN4juce24ApplicationCommandTarget14InvocationInfo16InvocationMethodE", !7, i64 0}
!15 = !{!"_ZTSN4juce8KeyPressE", !13, i64 0, !16, i64 4, !17, i64 8}
!16 = !{!"_ZTSN4juce12ModifierKeysE", !13, i64 0}
!17 = !{!"wchar_t", !7, i64 0}
!18 = !{i8 0, i8 2}
!19 = !{}
!20 = !{!21, !21, i64 0}
!21 = !{!"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"

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 noundef zeroext i1 @_ZN4juce14MessageManager11MessageBase4postEv(ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN4juce24ApplicationCommandTarget11tryToInvokeERKNS0_14InvocationInfoEb(ptr noundef nonnull align 8 dereferenceable(16) %0, ptr noundef nonnull align 8 dereferenceable(44) %1, i1 noundef zeroext %2) local_unnamed_addr #3 align 2 personality ptr @__gxx_personality_v0 {
  %4 = load i32, ptr %1, align 8, !tbaa !5
  %5 = tail call noundef zeroext i1 @_ZN4juce24ApplicationCommandTarget15isCommandActiveEi(ptr noundef nonnull align 8 dereferenceable(16) %0, i32 noundef %4)
  br i1 %5, label %6, label %18

6:                                                ; preds = %3
  br i1 %2, label %7, label %13

7:                                                ; preds = %6
  %8 = tail call noalias noundef nonnull dereferenceable(72) ptr @_Znwm(i64 noundef 72) #4
  invoke void @_ZN4juce24ApplicationCommandTarget14CommandMessageC2EPS0_RKNS0_14InvocationInfoE(ptr noundef nonnull align 8 dereferenceable(72) %8, ptr noundef nonnull %0, ptr noundef nonnull align 8 dereferenceable(44) %1)
          to label %9 unwind label %11

9:                                                ; preds = %7
  %10 = tail call noundef zeroext i1 @_ZN4juce14MessageManager11MessageBase4postEv(ptr noundef nonnull align 8 dereferenceable(16) %8)
  br label %19

11:                                               ; preds = %7
  %12 = landingpad { ptr, i32 }
          cleanup
  tail call void @_ZdlPvm(ptr noundef nonnull %8, i64 noundef 72) #5
  resume { ptr, i32 } %12

13:                                               ; preds = %6
  %14 = load ptr, ptr %0, align 8, !tbaa !16
  %15 = getelementptr inbounds i8, ptr %14, i64 40
  %16 = load ptr, ptr %15, align 8
  %17 = tail call noundef zeroext i1 %16(ptr noundef nonnull align 8 dereferenceable(16) %0, ptr noundef nonnull align 8 dereferenceable(44) %1)
  br i1 %17, label %19, label %18

18:                                               ; preds = %13, %3
  br label %19

19:                                               ; preds = %13, %18, %9
  %.0 = phi i1 [ true, %9 ], [ false, %18 ], [ true, %13 ]
  ret i1 %.0
}

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4juce24ApplicationCommandTarget14CommandMessageC2EPS0_RKNS0_14InvocationInfoE(ptr noundef nonnull align 8 dereferenceable(72), ptr noundef, ptr noundef nonnull align 8 dereferenceable(44)) unnamed_addr #3 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 = { 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 = { builtin allocsize(0) }
attributes #5 = { 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 = !{!"_ZTSN4juce24ApplicationCommandTarget14InvocationInfoE", !7, i64 0, !7, i64 4, !10, i64 8, !11, i64 16, !12, i64 24, !15, i64 36, !7, i64 40}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"_ZTSN4juce24ApplicationCommandTarget14InvocationInfo16InvocationMethodE", !8, i64 0}
!11 = !{!"any pointer", !8, i64 0}
!12 = !{!"_ZTSN4juce8KeyPressE", !7, i64 0, !13, i64 4, !14, i64 8}
!13 = !{!"_ZTSN4juce12ModifierKeysE", !7, i64 0}
!14 = !{!"wchar_t", !8, i64 0}
!15 = !{!"bool", !8, i64 0}
!16 = !{!17, !17, i64 0}
!17 = !{!"vtable pointer", !9, i64 0}


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