; 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 i32 @_ZNK4juce11StringArray4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) #4 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN4juce20DragAndDropContainer30performExternalDragDropOfFilesERKNS_11StringArrayEb(ptr noundef nonnull align 8 dereferenceable(24) %0, i1 noundef zeroext %1) #1 align 2 {
  %3 = alloca i1, align 1
  %4 = alloca ptr, align 8
  %5 = alloca i8, align 1
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  %10 = zext i1 %1 to i8
  store i8 %10, ptr %5, align 1, !tbaa !9
  %11 = load ptr, ptr %4, align 8, !tbaa !5
  %12 = call noundef i32 @_ZNK4juce11StringArray4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %11) #5
  %13 = icmp eq i32 %12, 0
  br i1 %13, label %14, label %15

14:                                               ; preds = %2
  store i1 false, ptr %3, align 1
  br label %56

15:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #5
  %16 = call noundef nonnull align 8 dereferenceable(360) ptr @_ZN4juce7Desktop11getInstanceEv()
  %17 = call noundef ptr @_ZNK4juce7Desktop22getDraggingMouseSourceEi(ptr noundef nonnull align 8 dereferenceable(360) %16, i32 noundef 0) #5
  store ptr %17, ptr %6, align 8, !tbaa !5
  %18 = load ptr, ptr %6, align 8, !tbaa !5
  %19 = icmp ne ptr %18, null
  br i1 %19, label %20, label %50

20:                                               ; preds = %15
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #5
  %21 = load ptr, ptr %6, align 8, !tbaa !5
  %22 = call noundef ptr @_ZNK4juce16MouseInputSource22getComponentUnderMouseEv(ptr noundef nonnull align 8 dereferenceable(8) %21)
  store ptr %22, ptr %7, align 8, !tbaa !5
  %23 = load ptr, ptr %7, align 8, !tbaa !5
  %24 = icmp ne ptr %23, null
  br i1 %24, label %25, label %46

25:                                               ; preds = %20
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #5
  %26 = load ptr, ptr %7, align 8, !tbaa !5
  %27 = call noundef ptr @_ZNK4juce9Component7getPeerEv(ptr noundef nonnull align 8 dereferenceable(197) %26)
  %28 = icmp eq ptr %27, null
  br i1 %28, label %31, label %29

29:                                               ; preds = %25
  %30 = call ptr @__dynamic_cast(ptr %27, ptr @_ZTIN4juce13ComponentPeerE, ptr @_ZTIN4juce18LinuxComponentPeerE, i64 0) #5
  br label %32

31:                                               ; preds = %25
  br label %32

32:                                               ; preds = %31, %29
  %33 = phi ptr [ %30, %29 ], [ null, %31 ]
  store ptr %33, ptr %8, align 8, !tbaa !5
  %34 = load ptr, ptr %8, align 8, !tbaa !5
  %35 = icmp ne ptr %34, null
  br i1 %35, label %36, label %42

36:                                               ; preds = %32
  %37 = load ptr, ptr %8, align 8, !tbaa !5
  %38 = load ptr, ptr %4, align 8, !tbaa !5
  %39 = load i8, ptr %5, align 1, !tbaa !9, !range !11, !noundef !12
  %40 = trunc i8 %39 to i1
  %41 = call noundef zeroext i1 @_ZN4juce18LinuxComponentPeer20externalDragFileInitERKNS_11StringArrayEb(ptr noundef nonnull align 8 dereferenceable(644) %37, ptr noundef nonnull align 8 dereferenceable(24) %38, i1 noundef zeroext %40)
  store i1 %41, ptr %3, align 1
  store i32 1, ptr %9, align 4
  br label %43

42:                                               ; preds = %32
  store i32 0, ptr %9, align 4
  br label %43

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

45:                                               ; preds = %43
  br label %46

46:                                               ; preds = %45, %20
  store i32 0, ptr %9, align 4
  br label %47

47:                                               ; preds = %46, %43
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  %48 = load i32, ptr %9, align 4
  switch i32 %48, label %51 [
    i32 0, label %49
  ]

49:                                               ; preds = %47
  br label %50

50:                                               ; preds = %49, %15
  store i32 0, ptr %9, align 4
  br label %51

51:                                               ; preds = %50, %47
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #5
  %52 = load i32, ptr %9, align 4
  switch i32 %52, label %58 [
    i32 0, label %53
    i32 1, label %56
  ]

53:                                               ; preds = %51
  br label %54

54:                                               ; preds = %53
  br label %55

55:                                               ; preds = %54
  store i1 false, ptr %3, align 1
  br label %56

56:                                               ; preds = %55, %51, %14
  %57 = load i1, ptr %3, align 1
  ret i1 %57

58:                                               ; preds = %51
  unreachable
}

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN4juce18LinuxComponentPeer20externalDragFileInitERKNS_11StringArrayEb(ptr noundef nonnull align 8 dereferenceable(644), ptr noundef nonnull align 8 dereferenceable(24), i1 noundef zeroext) #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"}
!9 = !{!10, !10, i64 0}
!10 = !{!"bool", !7, i64 0}
!11 = !{i8 0, i8 2}
!12 = !{}


; 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 i32 @_ZNK4juce11StringArray4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN4juce20DragAndDropContainer30performExternalDragDropOfFilesERKNS_11StringArrayEb(ptr noundef nonnull align 8 dereferenceable(24) %0, i1 noundef zeroext %1) local_unnamed_addr #0 align 2 {
  %3 = tail call noundef i32 @_ZNK4juce11StringArray4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %0) #4
  %4 = icmp eq i32 %3, 0
  br i1 %4, label %.thread, label %5

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

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

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

13:                                               ; preds = %10
  %14 = tail call ptr @__dynamic_cast(ptr nonnull %11, ptr nonnull @_ZTIN4juce13ComponentPeerE, ptr nonnull @_ZTIN4juce18LinuxComponentPeerE, i64 0) #4
  %.not21 = icmp eq ptr %14, null
  br i1 %.not21, label %.thread, label %15

15:                                               ; preds = %13
  %16 = tail call noundef zeroext i1 @_ZN4juce18LinuxComponentPeer20externalDragFileInitERKNS_11StringArrayEb(ptr noundef nonnull align 8 dereferenceable(644) %14, ptr noundef nonnull align 8 dereferenceable(24) %0, i1 noundef zeroext %1)
  br label %.thread

.thread:                                          ; preds = %10, %15, %5, %8, %13, %2
  %.5 = phi i1 [ false, %2 ], [ %16, %15 ], [ false, %5 ], [ false, %8 ], [ false, %13 ], [ false, %10 ]
  ret i1 %.5
}

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN4juce18LinuxComponentPeer20externalDragFileInitERKNS_11StringArrayEb(ptr noundef nonnull align 8 dereferenceable(644), ptr noundef nonnull align 8 dereferenceable(24), i1 noundef zeroext) 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