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

@_ZTIN4juce13ComponentPeerE = external dso_local constant { ptr, ptr }, align 8
@_ZTIN4juce18LinuxComponentPeerE = external dso_local constant { ptr, ptr, ptr }, align 8

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZNK4juce9Component7getPeerEv(ptr noundef nonnull align 8 dereferenceable(197)) #1 align 2

; 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
declare dso_local noundef nonnull align 8 dereferenceable(360) ptr @_ZN4juce7Desktop11getInstanceEv() #1 align 2

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

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

; Function Attrs: nounwind willreturn memory(read)
declare ptr @__dynamic_cast(ptr, ptr, ptr, i64) #3

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

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN4juce20DragAndDropContainer29performExternalDragDropOfTextERKNS_6StringE(ptr noundef nonnull align 8 dereferenceable(8) %0) #1 align 2 {
  %2 = alloca i1, align 1
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  %8 = load ptr, ptr %3, align 8, !tbaa !5
  %9 = call noundef zeroext i1 @_ZNK4juce6String7isEmptyEv(ptr noundef nonnull align 8 dereferenceable(8) %8) #5
  br i1 %9, label %10, label %11

10:                                               ; preds = %1
  store i1 false, ptr %2, align 1
  br label %50

11:                                               ; preds = %1
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #5
  %12 = call noundef nonnull align 8 dereferenceable(360) ptr @_ZN4juce7Desktop11getInstanceEv()
  %13 = call noundef ptr @_ZNK4juce7Desktop22getDraggingMouseSourceEi(ptr noundef nonnull align 8 dereferenceable(360) %12, i32 noundef 0) #5
  store ptr %13, ptr %4, align 8, !tbaa !5
  %14 = load ptr, ptr %4, align 8, !tbaa !5
  %15 = icmp ne ptr %14, null
  br i1 %15, label %16, label %44

16:                                               ; preds = %11
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #5
  %17 = load ptr, ptr %4, align 8, !tbaa !5
  %18 = call noundef ptr @_ZNK4juce16MouseInputSource22getComponentUnderMouseEv(ptr noundef nonnull align 8 dereferenceable(8) %17)
  store ptr %18, ptr %5, align 8, !tbaa !5
  %19 = load ptr, ptr %5, align 8, !tbaa !5
  %20 = icmp ne ptr %19, null
  br i1 %20, label %21, label %40

21:                                               ; preds = %16
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #5
  %22 = load ptr, ptr %5, align 8, !tbaa !5
  %23 = call noundef ptr @_ZNK4juce9Component7getPeerEv(ptr noundef nonnull align 8 dereferenceable(197) %22)
  %24 = icmp eq ptr %23, null
  br i1 %24, label %27, label %25

25:                                               ; preds = %21
  %26 = call ptr @__dynamic_cast(ptr %23, ptr @_ZTIN4juce13ComponentPeerE, ptr @_ZTIN4juce18LinuxComponentPeerE, i64 0) #5
  br label %28

27:                                               ; preds = %21
  br label %28

28:                                               ; preds = %27, %25
  %29 = phi ptr [ %26, %25 ], [ null, %27 ]
  store ptr %29, ptr %6, align 8, !tbaa !5
  %30 = load ptr, ptr %6, align 8, !tbaa !5
  %31 = icmp ne ptr %30, null
  br i1 %31, label %32, label %36

32:                                               ; preds = %28
  %33 = load ptr, ptr %6, align 8, !tbaa !5
  %34 = load ptr, ptr %3, align 8, !tbaa !5
  %35 = call noundef zeroext i1 @_ZN4juce18LinuxComponentPeer20externalDragTextInitERKNS_6StringE(ptr noundef nonnull align 8 dereferenceable(644) %33, ptr noundef nonnull align 8 dereferenceable(8) %34)
  store i1 %35, ptr %2, align 1
  store i32 1, ptr %7, align 4
  br label %37

36:                                               ; preds = %28
  store i32 0, ptr %7, align 4
  br label %37

37:                                               ; preds = %36, %32
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #5
  %38 = load i32, ptr %7, align 4
  switch i32 %38, label %41 [
    i32 0, label %39
  ]

39:                                               ; preds = %37
  br label %40

40:                                               ; preds = %39, %16
  store i32 0, ptr %7, align 4
  br label %41

41:                                               ; preds = %40, %37
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #5
  %42 = load i32, ptr %7, align 4
  switch i32 %42, label %45 [
    i32 0, label %43
  ]

43:                                               ; preds = %41
  br label %44

44:                                               ; preds = %43, %11
  store i32 0, ptr %7, align 4
  br label %45

45:                                               ; preds = %44, %41
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #5
  %46 = load i32, ptr %7, align 4
  switch i32 %46, label %52 [
    i32 0, label %47
    i32 1, label %50
  ]

47:                                               ; preds = %45
  br label %48

48:                                               ; preds = %47
  br label %49

49:                                               ; preds = %48
  store i1 false, ptr %2, align 1
  br label %50

50:                                               ; preds = %49, %45, %10
  %51 = load i1, ptr %2, align 1
  ret i1 %51

52:                                               ; preds = %45
  unreachable
}

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN4juce18LinuxComponentPeer20externalDragTextInitERKNS_6StringE(ptr noundef nonnull align 8 dereferenceable(644), ptr noundef nonnull align 8 dereferenceable(8)) #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 willreturn memory(read) }
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 = { 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"}


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

@_ZTIN4juce13ComponentPeerE = external dso_local constant { ptr, ptr }, align 8
@_ZTIN4juce18LinuxComponentPeerE = external dso_local constant { ptr, ptr, ptr }, align 8

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZNK4juce9Component7getPeerEv(ptr noundef nonnull align 8 dereferenceable(197)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(360) ptr @_ZN4juce7Desktop11getInstanceEv() local_unnamed_addr #0 align 2

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

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

; Function Attrs: mustprogress nofree nounwind willreturn memory(read)
declare ptr @__dynamic_cast(ptr, ptr, ptr, i64) local_unnamed_addr #2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK4juce6String7isEmptyEv(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN4juce20DragAndDropContainer29performExternalDragDropOfTextERKNS_6StringE(ptr noundef nonnull align 8 dereferenceable(8) %0) local_unnamed_addr #0 align 2 {
  %2 = tail call noundef zeroext i1 @_ZNK4juce6String7isEmptyEv(ptr noundef nonnull align 8 dereferenceable(8) %0) #4
  br i1 %2, label %.thread, label %3

3:                                                ; preds = %1
  %4 = tail call noundef nonnull align 8 dereferenceable(360) ptr @_ZN4juce7Desktop11getInstanceEv()
  %5 = tail call noundef ptr @_ZNK4juce7Desktop22getDraggingMouseSourceEi(ptr noundef nonnull align 8 dereferenceable(360) %4, i32 noundef 0) #4
  %.not = icmp eq ptr %5, null
  br i1 %.not, label %.thread, label %6

6:                                                ; preds = %3
  %7 = tail call noundef ptr @_ZNK4juce16MouseInputSource22getComponentUnderMouseEv(ptr noundef nonnull align 8 dereferenceable(8) %5)
  %.not19 = icmp eq ptr %7, null
  br i1 %.not19, label %.thread, label %8

8:                                                ; preds = %6
  %9 = tail call noundef ptr @_ZNK4juce9Component7getPeerEv(ptr noundef nonnull align 8 dereferenceable(197) %7)
  %10 = icmp eq ptr %9, null
  br i1 %10, label %.thread, label %11

11:                                               ; preds = %8
  %12 = tail call ptr @__dynamic_cast(ptr nonnull %9, ptr nonnull @_ZTIN4juce13ComponentPeerE, ptr nonnull @_ZTIN4juce18LinuxComponentPeerE, i64 0) #4
  %.not20 = icmp eq ptr %12, null
  br i1 %.not20, label %.thread, label %13

13:                                               ; preds = %11
  %14 = tail call noundef zeroext i1 @_ZN4juce18LinuxComponentPeer20externalDragTextInitERKNS_6StringE(ptr noundef nonnull align 8 dereferenceable(644) %12, ptr noundef nonnull align 8 dereferenceable(8) %0)
  br label %.thread

.thread:                                          ; preds = %8, %13, %3, %6, %11, %1
  %.5 = phi i1 [ false, %1 ], [ %14, %13 ], [ false, %3 ], [ false, %6 ], [ false, %11 ], [ false, %8 ]
  ret i1 %.5
}

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN4juce18LinuxComponentPeer20externalDragTextInitERKNS_6StringE(ptr noundef nonnull align 8 dereferenceable(644), ptr noundef nonnull align 8 dereferenceable(8)) 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 = { mustprogress nofree nounwind willreturn memory(read) }
attributes #3 = { 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 #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)"}


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