; LLVM IR from modlfo/AudioEngine :: AudioEngine/JuceLibraryCode (juce_events)

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

%"class.juce::MessageManager" = type { %"class.juce::ScopedPointer.1", i8, i8, ptr, ptr, %"class.juce::CriticalSection" }
%"class.juce::ScopedPointer.1" = type { ptr }
%"class.juce::CriticalSection" = type { %union.pthread_mutex_t }
%union.pthread_mutex_t = type { %struct.__pthread_mutex_s }
%struct.__pthread_mutex_s = type { i32, i32, i32, i32, i32, i16, i16, %struct.__pthread_internal_list }
%struct.__pthread_internal_list = type { ptr, ptr }
%"class.juce::MessageManagerLock" = type <{ %"class.juce::ReferenceCountedObjectPtr.16", i8, [7 x i8] }>
%"class.juce::ReferenceCountedObjectPtr.16" = type { ptr }
%"class.juce::MessageManagerLock::BlockingMessage" = type { %"class.juce::MessageManager::MessageBase", %"class.juce::WaitableEvent", %"class.juce::WaitableEvent" }
%"class.juce::MessageManager::MessageBase" = type { %"class.juce::ReferenceCountedObject" }
%"class.juce::ReferenceCountedObject" = type { ptr, %"class.juce::Atomic" }
%"class.juce::Atomic" = type { i32, [4 x i8] }
%"class.juce::WaitableEvent" = type <{ %union.pthread_cond_t, %union.pthread_mutex_t, i8, i8, [6 x i8] }>
%union.pthread_cond_t = type { %struct.__pthread_cond_s }
%struct.__pthread_cond_s = type { %union.__atomic_wide_counter, %union.__atomic_wide_counter, [2 x i32], [2 x i32], i32, i32, [2 x i32] }
%union.__atomic_wide_counter = type { i64 }

@_ZN4juce14MessageManager8instanceE = external dso_local global 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: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

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

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

declare noundef ptr @_ZN4juce6Thread18getCurrentThreadIdEv() #3

; Function Attrs: nounwind
declare noundef zeroext i1 @_ZNK4juce13WaitableEvent4waitEi(ptr noundef nonnull align 8 dereferenceable(90), i32 noundef) #4

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK4juce14MessageManager36currentThreadHasLockedMessageManagerEv(ptr noundef nonnull align 8 dereferenceable(72)) #5 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN4juce18MessageManagerLock11attemptLockEPNS_6ThreadEPNS_13ThreadPoolJobE(ptr noundef nonnull align 8 dereferenceable(9) %0, ptr noundef %1, ptr noundef %2) #2 align 2 {
  %4 = alloca i1, align 1
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %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
  store ptr %2, ptr %7, align 8, !tbaa !5
  %10 = load ptr, ptr %5, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #6
  %11 = load ptr, ptr @_ZN4juce14MessageManager8instanceE, align 8, !tbaa !5
  store ptr %11, ptr %8, align 8, !tbaa !5
  %12 = load ptr, ptr %8, align 8, !tbaa !5
  %13 = icmp eq ptr %12, null
  br i1 %13, label %14, label %15

14:                                               ; preds = %3
  store i1 false, ptr %4, align 1
  store i32 1, ptr %9, align 4
  br label %94

15:                                               ; preds = %3
  %16 = load ptr, ptr %8, align 8, !tbaa !5
  %17 = call noundef zeroext i1 @_ZNK4juce14MessageManager36currentThreadHasLockedMessageManagerEv(ptr noundef nonnull align 8 dereferenceable(72) %16) #6
  br i1 %17, label %18, label %19

18:                                               ; preds = %15
  store i1 true, ptr %4, align 1
  store i32 1, ptr %9, align 4
  br label %94

19:                                               ; preds = %15
  %20 = load ptr, ptr %6, align 8, !tbaa !5
  %21 = icmp eq ptr %20, null
  br i1 %21, label %22, label %28

22:                                               ; preds = %19
  %23 = load ptr, ptr %7, align 8, !tbaa !5
  %24 = icmp eq ptr %23, null
  br i1 %24, label %25, label %28

25:                                               ; preds = %22
  %26 = load ptr, ptr %8, align 8, !tbaa !5
  %27 = getelementptr inbounds %"class.juce::MessageManager", ptr %26, i32 0, i32 5
  call void @_ZNK4juce15CriticalSection5enterEv(ptr noundef nonnull align 8 dereferenceable(40) %27) #6
  br label %49

28:                                               ; preds = %22, %19
  br label %29

29:                                               ; preds = %47, %28
  %30 = load ptr, ptr %8, align 8, !tbaa !5
  %31 = getelementptr inbounds %"class.juce::MessageManager", ptr %30, i32 0, i32 5
  %32 = call noundef zeroext i1 @_ZNK4juce15CriticalSection8tryEnterEv(ptr noundef nonnull align 8 dereferenceable(40) %31) #6
  %33 = xor i1 %32, true
  br i1 %33, label %34, label %48

34:                                               ; preds = %29
  %35 = load ptr, ptr %6, align 8, !tbaa !5
  %36 = icmp ne ptr %35, null
  br i1 %36, label %37, label %40

37:                                               ; preds = %34
  %38 = load ptr, ptr %6, align 8, !tbaa !5
  %39 = call noundef zeroext i1 @_ZNK4juce6Thread16threadShouldExitEv(ptr noundef nonnull align 8 dereferenceable(285) %38)
  br i1 %39, label %46, label %40

40:                                               ; preds = %37, %34
  %41 = load ptr, ptr %7, align 8, !tbaa !5
  %42 = icmp ne ptr %41, null
  br i1 %42, label %43, label %47

43:                                               ; preds = %40
  %44 = load ptr, ptr %7, align 8, !tbaa !5
  %45 = call noundef zeroext i1 @_ZNK4juce13ThreadPoolJob10shouldExitEv(ptr noundef nonnull align 8 dereferenceable(27) %44) #6
  br i1 %45, label %46, label %47

46:                                               ; preds = %43, %37
  store i1 false, ptr %4, align 1
  store i32 1, ptr %9, align 4
  br label %94

47:                                               ; preds = %43, %40
  call void @_ZN4juce6Thread5yieldEv()
  br label %29, !llvm.loop !9

48:                                               ; preds = %29
  br label %49

49:                                               ; preds = %48, %25
  %50 = call noalias noundef nonnull ptr @_Znwm(i64 noundef 208) #7
  call void @_ZN4juce18MessageManagerLock15BlockingMessageC2Ev(ptr noundef nonnull align 8 dereferenceable(208) %50) #6
  %51 = getelementptr inbounds %"class.juce::MessageManagerLock", ptr %10, i32 0, i32 0
  %52 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN4juce25ReferenceCountedObjectPtrINS_18MessageManagerLock15BlockingMessageEEaSEPS2_(ptr noundef nonnull align 8 dereferenceable(8) %51, ptr noundef %50)
  %53 = getelementptr inbounds %"class.juce::MessageManagerLock", ptr %10, i32 0, i32 0
  %54 = call noundef ptr @_ZNK4juce25ReferenceCountedObjectPtrINS_18MessageManagerLock15BlockingMessageEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %53) #6
  %55 = call noundef zeroext i1 @_ZN4juce14MessageManager11MessageBase4postEv(ptr noundef nonnull align 8 dereferenceable(16) %54)
  br i1 %55, label %59, label %56

56:                                               ; preds = %49
  %57 = getelementptr inbounds %"class.juce::MessageManagerLock", ptr %10, i32 0, i32 0
  %58 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN4juce25ReferenceCountedObjectPtrINS_18MessageManagerLock15BlockingMessageEEaSEPS2_(ptr noundef nonnull align 8 dereferenceable(8) %57, ptr noundef null)
  store i1 false, ptr %4, align 1
  store i32 1, ptr %9, align 4
  br label %94

59:                                               ; preds = %49
  br label %60

60:                                               ; preds = %86, %59
  %61 = getelementptr inbounds %"class.juce::MessageManagerLock", ptr %10, i32 0, i32 0
  %62 = call noundef ptr @_ZNK4juce25ReferenceCountedObjectPtrINS_18MessageManagerLock15BlockingMessageEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %61) #6
  %63 = getelementptr inbounds %"class.juce::MessageManagerLock::BlockingMessage", ptr %62, i32 0, i32 1
  %64 = call noundef zeroext i1 @_ZNK4juce13WaitableEvent4waitEi(ptr noundef nonnull align 8 dereferenceable(90) %63, i32 noundef 20) #6
  %65 = xor i1 %64, true
  br i1 %65, label %66, label %87

66:                                               ; preds = %60
  %67 = load ptr, ptr %6, align 8, !tbaa !5
  %68 = icmp ne ptr %67, null
  br i1 %68, label %69, label %72

69:                                               ; preds = %66
  %70 = load ptr, ptr %6, align 8, !tbaa !5
  %71 = call noundef zeroext i1 @_ZNK4juce6Thread16threadShouldExitEv(ptr noundef nonnull align 8 dereferenceable(285) %70)
  br i1 %71, label %78, label %72

72:                                               ; preds = %69, %66
  %73 = load ptr, ptr %7, align 8, !tbaa !5
  %74 = icmp ne ptr %73, null
  br i1 %74, label %75, label %86

75:                                               ; preds = %72
  %76 = load ptr, ptr %7, align 8, !tbaa !5
  %77 = call noundef zeroext i1 @_ZNK4juce13ThreadPoolJob10shouldExitEv(ptr noundef nonnull align 8 dereferenceable(27) %76) #6
  br i1 %77, label %78, label %86

78:                                               ; preds = %75, %69
  %79 = getelementptr inbounds %"class.juce::MessageManagerLock", ptr %10, i32 0, i32 0
  %80 = call noundef ptr @_ZNK4juce25ReferenceCountedObjectPtrINS_18MessageManagerLock15BlockingMessageEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %79) #6
  %81 = getelementptr inbounds %"class.juce::MessageManagerLock::BlockingMessage", ptr %80, i32 0, i32 2
  call void @_ZNK4juce13WaitableEvent6signalEv(ptr noundef nonnull align 8 dereferenceable(90) %81) #6
  %82 = getelementptr inbounds %"class.juce::MessageManagerLock", ptr %10, i32 0, i32 0
  %83 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN4juce25ReferenceCountedObjectPtrINS_18MessageManagerLock15BlockingMessageEEaSEPS2_(ptr noundef nonnull align 8 dereferenceable(8) %82, ptr noundef null)
  %84 = load ptr, ptr %8, align 8, !tbaa !5
  %85 = getelementptr inbounds %"class.juce::MessageManager", ptr %84, i32 0, i32 5
  call void @_ZNK4juce15CriticalSection4exitEv(ptr noundef nonnull align 8 dereferenceable(40) %85) #6
  store i1 false, ptr %4, align 1
  store i32 1, ptr %9, align 4
  br label %94

86:                                               ; preds = %75, %72
  br label %60, !llvm.loop !11

87:                                               ; preds = %60
  br label %88

88:                                               ; preds = %87
  br label %89

89:                                               ; preds = %88
  br label %90

90:                                               ; preds = %89
  %91 = call noundef ptr @_ZN4juce6Thread18getCurrentThreadIdEv()
  %92 = load ptr, ptr %8, align 8, !tbaa !5
  %93 = getelementptr inbounds %"class.juce::MessageManager", ptr %92, i32 0, i32 4
  store volatile ptr %91, ptr %93, align 8, !tbaa !12
  store i1 true, ptr %4, align 1
  store i32 1, ptr %9, align 4
  br label %94

94:                                               ; preds = %90, %78, %56, %46, %18, %14
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  %95 = load i1, ptr %4, align 1
  ret i1 %95
}

; Function Attrs: nounwind
declare void @_ZNK4juce15CriticalSection5enterEv(ptr noundef nonnull align 8 dereferenceable(40)) #4

; Function Attrs: nounwind
declare noundef zeroext i1 @_ZNK4juce15CriticalSection8tryEnterEv(ptr noundef nonnull align 8 dereferenceable(40)) #4

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK4juce6Thread16threadShouldExitEv(ptr noundef nonnull align 8 dereferenceable(285)) #5 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK4juce13ThreadPoolJob10shouldExitEv(ptr noundef nonnull align 8 dereferenceable(27)) #5 align 2

declare void @_ZN4juce6Thread5yieldEv() #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN4juce18MessageManagerLock15BlockingMessageC2Ev(ptr noundef nonnull align 8 dereferenceable(208)) unnamed_addr #5 align 2

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

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

; Function Attrs: nounwind
declare void @_ZNK4juce13WaitableEvent6signalEv(ptr noundef nonnull align 8 dereferenceable(90)) #4

; Function Attrs: nounwind
declare void @_ZNK4juce15CriticalSection4exitEv(ptr noundef nonnull align 8 dereferenceable(40)) #4

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 #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 = { 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 #5 = { 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 = { nounwind }
attributes #7 = { builtin allocsize(0) }

!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 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = !{!13, !6, i64 24}
!13 = !{!"_ZTSN4juce14MessageManagerE", !14, i64 0, !15, i64 8, !15, i64 9, !6, i64 16, !6, i64 24, !16, i64 32}
!14 = !{!"_ZTSN4juce13ScopedPointerINS_17ActionBroadcasterEEE", !6, i64 0}
!15 = !{!"bool", !7, i64 0}
!16 = !{!"_ZTSN4juce15CriticalSectionE", !7, 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"

@_ZN4juce14MessageManager8instanceE = external dso_local local_unnamed_addr global ptr, align 8

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN4juce14MessageManager11MessageBase4postEv(ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #1 align 2

declare noundef ptr @_ZN4juce6Thread18getCurrentThreadIdEv() local_unnamed_addr #2

; Function Attrs: nounwind
declare noundef zeroext i1 @_ZNK4juce13WaitableEvent4waitEi(ptr noundef nonnull align 8 dereferenceable(90), i32 noundef) local_unnamed_addr #3

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

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN4juce18MessageManagerLock11attemptLockEPNS_6ThreadEPNS_13ThreadPoolJobE(ptr noundef nonnull align 8 dereferenceable(9) %0, ptr noundef %1, ptr noundef %2) local_unnamed_addr #1 align 2 {
  %4 = load ptr, ptr @_ZN4juce14MessageManager8instanceE, align 8, !tbaa !5
  %5 = icmp eq ptr %4, null
  br i1 %5, label %.loopexit27, label %6

6:                                                ; preds = %3
  %7 = tail call noundef zeroext i1 @_ZNK4juce14MessageManager36currentThreadHasLockedMessageManagerEv(ptr noundef nonnull align 8 dereferenceable(72) %4) #5
  br i1 %7, label %.loopexit27, label %8

8:                                                ; preds = %6
  %9 = icmp eq ptr %1, null
  %10 = icmp eq ptr %2, null
  %or.cond = and i1 %9, %10
  %11 = getelementptr inbounds i8, ptr %4, i64 32
  br i1 %or.cond, label %20, label %.preheader26

.preheader26:                                     ; preds = %8
  %12 = tail call noundef zeroext i1 @_ZNK4juce15CriticalSection8tryEnterEv(ptr noundef nonnull align 8 dereferenceable(40) %11) #5
  br i1 %12, label %.loopexit, label %.lr.ph

.lr.ph:                                           ; preds = %.preheader26
  br i1 %9, label %.lr.ph.split.us, label %.lr.ph.split

.lr.ph.split.us:                                  ; preds = %.lr.ph
  br i1 %10, label %.lr.ph.split.us.split.us, label %.lr.ph.split.us.split

.lr.ph.split.us.split.us:                         ; preds = %.lr.ph.split.us, %.lr.ph.split.us.split.us
  tail call void @_ZN4juce6Thread5yieldEv()
  %13 = tail call noundef zeroext i1 @_ZNK4juce15CriticalSection8tryEnterEv(ptr noundef nonnull align 8 dereferenceable(40) %11) #5
  br i1 %13, label %.loopexit, label %.lr.ph.split.us.split.us, !llvm.loop !9

.lr.ph.split.us.split:                            ; preds = %.lr.ph.split.us, %15
  %14 = tail call noundef zeroext i1 @_ZNK4juce13ThreadPoolJob10shouldExitEv(ptr noundef nonnull align 8 dereferenceable(27) %2) #5
  br i1 %14, label %.loopexit27, label %15

15:                                               ; preds = %.lr.ph.split.us.split
  tail call void @_ZN4juce6Thread5yieldEv()
  %16 = tail call noundef zeroext i1 @_ZNK4juce15CriticalSection8tryEnterEv(ptr noundef nonnull align 8 dereferenceable(40) %11) #5
  br i1 %16, label %.loopexit, label %.lr.ph.split.us.split, !llvm.loop !9

.lr.ph.split:                                     ; preds = %.lr.ph
  br i1 %10, label %.lr.ph.split.split.us, label %.lr.ph.split.split

.lr.ph.split.split.us:                            ; preds = %.lr.ph.split, %18
  %17 = tail call noundef zeroext i1 @_ZNK4juce6Thread16threadShouldExitEv(ptr noundef nonnull align 8 dereferenceable(285) %1)
  br i1 %17, label %.loopexit27, label %18

18:                                               ; preds = %.lr.ph.split.split.us
  tail call void @_ZN4juce6Thread5yieldEv()
  %19 = tail call noundef zeroext i1 @_ZNK4juce15CriticalSection8tryEnterEv(ptr noundef nonnull align 8 dereferenceable(40) %11) #5
  br i1 %19, label %.loopexit, label %.lr.ph.split.split.us, !llvm.loop !9

20:                                               ; preds = %8
  tail call void @_ZNK4juce15CriticalSection5enterEv(ptr noundef nonnull align 8 dereferenceable(40) %11) #5
  br label %.loopexit

.lr.ph.split.split:                               ; preds = %.lr.ph.split, %24
  %21 = tail call noundef zeroext i1 @_ZNK4juce6Thread16threadShouldExitEv(ptr noundef nonnull align 8 dereferenceable(285) %1)
  br i1 %21, label %.loopexit27, label %22

22:                                               ; preds = %.lr.ph.split.split
  %23 = tail call noundef zeroext i1 @_ZNK4juce13ThreadPoolJob10shouldExitEv(ptr noundef nonnull align 8 dereferenceable(27) %2) #5
  br i1 %23, label %.loopexit27, label %24

24:                                               ; preds = %22
  tail call void @_ZN4juce6Thread5yieldEv()
  %25 = tail call noundef zeroext i1 @_ZNK4juce15CriticalSection8tryEnterEv(ptr noundef nonnull align 8 dereferenceable(40) %11) #5
  br i1 %25, label %.loopexit, label %.lr.ph.split.split, !llvm.loop !9

.loopexit:                                        ; preds = %24, %18, %15, %.lr.ph.split.us.split.us, %.preheader26, %20
  %26 = tail call noalias noundef nonnull dereferenceable(208) ptr @_Znwm(i64 noundef 208) #6
  tail call void @_ZN4juce18MessageManagerLock15BlockingMessageC2Ev(ptr noundef nonnull align 8 dereferenceable(208) %26) #5
  %27 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZN4juce25ReferenceCountedObjectPtrINS_18MessageManagerLock15BlockingMessageEEaSEPS2_(ptr noundef nonnull align 8 dereferenceable(8) %0, ptr noundef nonnull %26)
  %28 = tail call noundef ptr @_ZNK4juce25ReferenceCountedObjectPtrINS_18MessageManagerLock15BlockingMessageEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %0) #5
  %29 = tail call noundef zeroext i1 @_ZN4juce14MessageManager11MessageBase4postEv(ptr noundef nonnull align 8 dereferenceable(16) %28)
  br i1 %29, label %.preheader, label %46

.preheader:                                       ; preds = %.loopexit
  %30 = tail call noundef ptr @_ZNK4juce25ReferenceCountedObjectPtrINS_18MessageManagerLock15BlockingMessageEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %0) #5
  %31 = getelementptr inbounds i8, ptr %30, i64 16
  %32 = tail call noundef zeroext i1 @_ZNK4juce13WaitableEvent4waitEi(ptr noundef nonnull align 8 dereferenceable(90) %31, i32 noundef 20) #5
  br i1 %32, label %._crit_edge, label %.lr.ph28

.lr.ph28:                                         ; preds = %.preheader
  br i1 %9, label %.lr.ph28.split.us, label %.lr.ph28.split

.lr.ph28.split.us:                                ; preds = %.lr.ph28
  br i1 %10, label %.lr.ph28.split.us.split.us, label %.lr.ph28.split.us.split

.lr.ph28.split.us.split.us:                       ; preds = %.lr.ph28.split.us, %.lr.ph28.split.us.split.us
  %33 = tail call noundef ptr @_ZNK4juce25ReferenceCountedObjectPtrINS_18MessageManagerLock15BlockingMessageEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %0) #5
  %34 = getelementptr inbounds i8, ptr %33, i64 16
  %35 = tail call noundef zeroext i1 @_ZNK4juce13WaitableEvent4waitEi(ptr noundef nonnull align 8 dereferenceable(90) %34, i32 noundef 20) #5
  br i1 %35, label %._crit_edge, label %.lr.ph28.split.us.split.us, !llvm.loop !11

.lr.ph28.split.us.split:                          ; preds = %.lr.ph28.split.us, %37
  %36 = tail call noundef zeroext i1 @_ZNK4juce13ThreadPoolJob10shouldExitEv(ptr noundef nonnull align 8 dereferenceable(27) %2) #5
  br i1 %36, label %.split.us, label %37

37:                                               ; preds = %.lr.ph28.split.us.split
  %38 = tail call noundef ptr @_ZNK4juce25ReferenceCountedObjectPtrINS_18MessageManagerLock15BlockingMessageEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %0) #5
  %39 = getelementptr inbounds i8, ptr %38, i64 16
  %40 = tail call noundef zeroext i1 @_ZNK4juce13WaitableEvent4waitEi(ptr noundef nonnull align 8 dereferenceable(90) %39, i32 noundef 20) #5
  br i1 %40, label %._crit_edge, label %.lr.ph28.split.us.split, !llvm.loop !11

.lr.ph28.split:                                   ; preds = %.lr.ph28
  br i1 %10, label %.lr.ph28.split.split.us, label %.lr.ph28.split.split

.lr.ph28.split.split.us:                          ; preds = %.lr.ph28.split, %42
  %41 = tail call noundef zeroext i1 @_ZNK4juce6Thread16threadShouldExitEv(ptr noundef nonnull align 8 dereferenceable(285) %1)
  br i1 %41, label %.split.us, label %42

42:                                               ; preds = %.lr.ph28.split.split.us
  %43 = tail call noundef ptr @_ZNK4juce25ReferenceCountedObjectPtrINS_18MessageManagerLock15BlockingMessageEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %0) #5
  %44 = getelementptr inbounds i8, ptr %43, i64 16
  %45 = tail call noundef zeroext i1 @_ZNK4juce13WaitableEvent4waitEi(ptr noundef nonnull align 8 dereferenceable(90) %44, i32 noundef 20) #5
  br i1 %45, label %._crit_edge, label %.lr.ph28.split.split.us, !llvm.loop !11

46:                                               ; preds = %.loopexit
  %47 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZN4juce25ReferenceCountedObjectPtrINS_18MessageManagerLock15BlockingMessageEEaSEPS2_(ptr noundef nonnull align 8 dereferenceable(8) %0, ptr noundef null)
  br label %.loopexit27

.lr.ph28.split.split:                             ; preds = %.lr.ph28.split, %55
  %48 = tail call noundef zeroext i1 @_ZNK4juce6Thread16threadShouldExitEv(ptr noundef nonnull align 8 dereferenceable(285) %1)
  br i1 %48, label %.split.us, label %49

49:                                               ; preds = %.lr.ph28.split.split
  %50 = tail call noundef zeroext i1 @_ZNK4juce13ThreadPoolJob10shouldExitEv(ptr noundef nonnull align 8 dereferenceable(27) %2) #5
  br i1 %50, label %.split.us, label %55

.split.us:                                        ; preds = %49, %.lr.ph28.split.split, %.lr.ph28.split.split.us, %.lr.ph28.split.us.split
  %51 = tail call noundef ptr @_ZNK4juce25ReferenceCountedObjectPtrINS_18MessageManagerLock15BlockingMessageEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %0) #5
  %52 = getelementptr inbounds i8, ptr %51, i64 112
  tail call void @_ZNK4juce13WaitableEvent6signalEv(ptr noundef nonnull align 8 dereferenceable(90) %52) #5
  %53 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZN4juce25ReferenceCountedObjectPtrINS_18MessageManagerLock15BlockingMessageEEaSEPS2_(ptr noundef nonnull align 8 dereferenceable(8) %0, ptr noundef null)
  %54 = getelementptr inbounds i8, ptr %4, i64 32
  tail call void @_ZNK4juce15CriticalSection4exitEv(ptr noundef nonnull align 8 dereferenceable(40) %54) #5
  br label %.loopexit27

55:                                               ; preds = %49
  %56 = tail call noundef ptr @_ZNK4juce25ReferenceCountedObjectPtrINS_18MessageManagerLock15BlockingMessageEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %0) #5
  %57 = getelementptr inbounds i8, ptr %56, i64 16
  %58 = tail call noundef zeroext i1 @_ZNK4juce13WaitableEvent4waitEi(ptr noundef nonnull align 8 dereferenceable(90) %57, i32 noundef 20) #5
  br i1 %58, label %._crit_edge, label %.lr.ph28.split.split, !llvm.loop !11

._crit_edge:                                      ; preds = %55, %42, %37, %.lr.ph28.split.us.split.us, %.preheader
  %59 = tail call noundef ptr @_ZN4juce6Thread18getCurrentThreadIdEv()
  %60 = getelementptr inbounds i8, ptr %4, i64 24
  store volatile ptr %59, ptr %60, align 8, !tbaa !12
  br label %.loopexit27

.loopexit27:                                      ; preds = %.lr.ph.split.split, %22, %.lr.ph.split.split.us, %.lr.ph.split.us.split, %6, %3, %._crit_edge, %.split.us, %46
  %.0 = phi i1 [ false, %.split.us ], [ true, %._crit_edge ], [ false, %46 ], [ false, %3 ], [ true, %6 ], [ false, %.lr.ph.split.us.split ], [ false, %.lr.ph.split.split.us ], [ false, %22 ], [ false, %.lr.ph.split.split ]
  ret i1 %.0
}

; Function Attrs: nounwind
declare void @_ZNK4juce15CriticalSection5enterEv(ptr noundef nonnull align 8 dereferenceable(40)) local_unnamed_addr #3

; Function Attrs: nounwind
declare noundef zeroext i1 @_ZNK4juce15CriticalSection8tryEnterEv(ptr noundef nonnull align 8 dereferenceable(40)) local_unnamed_addr #3

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

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

declare void @_ZN4juce6Thread5yieldEv() local_unnamed_addr #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN4juce18MessageManagerLock15BlockingMessageC2Ev(ptr noundef nonnull align 8 dereferenceable(208)) unnamed_addr #4 align 2

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

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

; Function Attrs: nounwind
declare void @_ZNK4juce13WaitableEvent6signalEv(ptr noundef nonnull align 8 dereferenceable(90)) local_unnamed_addr #3

; Function Attrs: nounwind
declare void @_ZNK4juce15CriticalSection4exitEv(ptr noundef nonnull align 8 dereferenceable(40)) local_unnamed_addr #3

attributes #0 = { 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 #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 = { "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 "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 = { 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 }
attributes #6 = { builtin allocsize(0) }

!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 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = !{!13, !6, i64 24}
!13 = !{!"_ZTSN4juce14MessageManagerE", !14, i64 0, !15, i64 8, !15, i64 9, !6, i64 16, !6, i64 24, !16, i64 32}
!14 = !{!"_ZTSN4juce13ScopedPointerINS_17ActionBroadcasterEEE", !6, i64 0}
!15 = !{!"bool", !7, i64 0}
!16 = !{!"_ZTSN4juce15CriticalSectionE", !7, i64 0}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass,TailCallElimPass