; 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::InterprocessConnection" = type { ptr, %"class.juce::WeakReference<juce::InterprocessConnection>::Master", %"class.juce::CriticalSection", %"class.juce::ScopedPointer.29", %"class.juce::ScopedPointer.30", i8, i8, i32, i32, %"class.juce::ScopedPointer.31" }
%"class.juce::WeakReference<juce::InterprocessConnection>::Master" = type { %"class.juce::ReferenceCountedObjectPtr.28" }
%"class.juce::ReferenceCountedObjectPtr.28" = 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::ScopedPointer.29" = type { ptr }
%"class.juce::ScopedPointer.30" = type { ptr }
%"class.juce::ScopedPointer.31" = type { ptr }

declare i32 @__gxx_personality_v0(...)

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4juce22InterprocessConnection14deliverDataIntERKNS_11MemoryBlockE(ptr noundef nonnull align 8 dereferenceable(96) %0, ptr noundef nonnull align 8 dereferenceable(16) %1) #2 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %7 = load ptr, ptr %3, align 8
  br label %8

8:                                                ; preds = %2
  br label %9

9:                                                ; preds = %8
  %10 = getelementptr inbounds %"class.juce::InterprocessConnection", ptr %7, i32 0, i32 6
  %11 = load i8, ptr %10, align 1, !tbaa !9, !range !19, !noundef !20
  %12 = trunc i8 %11 to i1
  br i1 %12, label %13, label %22

13:                                               ; preds = %9
  %14 = call noalias noundef nonnull ptr @_Znwm(i64 noundef 48) #3
  %15 = load ptr, ptr %4, align 8, !tbaa !5
  invoke void @_ZN4juce19DataDeliveryMessageC2EPNS_22InterprocessConnectionERKNS_11MemoryBlockE(ptr noundef nonnull align 8 dereferenceable(48) %14, ptr noundef %7, ptr noundef nonnull align 8 dereferenceable(16) %15)
          to label %16 unwind label %18

16:                                               ; preds = %13
  %17 = call noundef zeroext i1 @_ZN4juce14MessageManager11MessageBase4postEv(ptr noundef nonnull align 8 dereferenceable(16) %14)
  br label %27

18:                                               ; preds = %13
  %19 = landingpad { ptr, i32 }
          cleanup
  %20 = extractvalue { ptr, i32 } %19, 0
  store ptr %20, ptr %5, align 8
  %21 = extractvalue { ptr, i32 } %19, 1
  store i32 %21, ptr %6, align 4
  call void @_ZdlPvm(ptr noundef %14, i64 noundef 48) #4
  br label %28

22:                                               ; preds = %9
  %23 = load ptr, ptr %4, align 8, !tbaa !5
  %24 = load ptr, ptr %7, align 8, !tbaa !21
  %25 = getelementptr inbounds ptr, ptr %24, i64 4
  %26 = load ptr, ptr %25, align 8
  call void %26(ptr noundef nonnull align 8 dereferenceable(96) %7, ptr noundef nonnull align 8 dereferenceable(16) %23)
  br label %27

27:                                               ; preds = %22, %16
  ret void

28:                                               ; preds = %18
  %29 = load ptr, ptr %5, align 8
  %30 = load i32, ptr %6, align 4
  %31 = insertvalue { ptr, i32 } poison, ptr %29, 0
  %32 = insertvalue { ptr, i32 } %31, i32 %30, 1
  resume { ptr, i32 } %32
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4juce19DataDeliveryMessageC2EPNS_22InterprocessConnectionERKNS_11MemoryBlockE(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef, ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #2 align 2

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 = { 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 #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 = { builtin allocsize(0) }
attributes #4 = { 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, !16, i64 73}
!10 = !{!"_ZTSN4juce22InterprocessConnectionE", !11, i64 8, !13, i64 16, !14, i64 56, !15, i64 64, !16, i64 72, !16, i64 73, !17, i64 76, !17, i64 80, !18, i64 88}
!11 = !{!"_ZTSN4juce13WeakReferenceINS_22InterprocessConnectionENS_22ReferenceCountedObjectEE6MasterE", !12, i64 0}
!12 = !{!"_ZTSN4juce25ReferenceCountedObjectPtrINS_13WeakReferenceINS_22InterprocessConnectionENS_22ReferenceCountedObjectEE13SharedPointerEEE", !6, i64 0}
!13 = !{!"_ZTSN4juce15CriticalSectionE", !7, i64 0}
!14 = !{!"_ZTSN4juce13ScopedPointerINS_15StreamingSocketEEE", !6, i64 0}
!15 = !{!"_ZTSN4juce13ScopedPointerINS_9NamedPipeEEE", !6, i64 0}
!16 = !{!"bool", !7, i64 0}
!17 = !{!"int", !7, i64 0}
!18 = !{!"_ZTSN4juce13ScopedPointerINS_22InterprocessConnection16ConnectionThreadEEE", !6, i64 0}
!19 = !{i8 0, i8 2}
!20 = !{}
!21 = !{!22, !22, i64 0}
!22 = !{!"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 allocsize(0)
declare noundef nonnull ptr @_Znwm(i64 noundef) local_unnamed_addr #0

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4juce22InterprocessConnection14deliverDataIntERKNS_11MemoryBlockE(ptr noundef nonnull align 8 dereferenceable(96) %0, ptr noundef nonnull align 8 dereferenceable(16) %1) local_unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %3 = getelementptr inbounds i8, ptr %0, i64 73
  %4 = load i8, ptr %3, align 1, !tbaa !5, !range !18, !noundef !19
  %5 = trunc nuw i8 %4 to i1
  br i1 %5, label %6, label %12

6:                                                ; preds = %2
  %7 = tail call noalias noundef nonnull dereferenceable(48) ptr @_Znwm(i64 noundef 48) #3
  invoke void @_ZN4juce19DataDeliveryMessageC2EPNS_22InterprocessConnectionERKNS_11MemoryBlockE(ptr noundef nonnull align 8 dereferenceable(48) %7, ptr noundef nonnull %0, ptr noundef nonnull align 8 dereferenceable(16) %1)
          to label %8 unwind label %10

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

10:                                               ; preds = %6
  %11 = landingpad { ptr, i32 }
          cleanup
  tail call void @_ZdlPvm(ptr noundef nonnull %7, i64 noundef 48) #4
  resume { ptr, i32 } %11

12:                                               ; preds = %2
  %13 = load ptr, ptr %0, align 8, !tbaa !20
  %14 = getelementptr inbounds i8, ptr %13, i64 32
  %15 = load ptr, ptr %14, align 8
  tail call void %15(ptr noundef nonnull align 8 dereferenceable(96) %0, ptr noundef nonnull align 8 dereferenceable(16) %1)
  br label %16

16:                                               ; preds = %12, %8
  ret void
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4juce19DataDeliveryMessageC2EPNS_22InterprocessConnectionERKNS_11MemoryBlockE(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef, ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #2 align 2

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 = { 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 #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 = { builtin allocsize(0) }
attributes #4 = { 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, !15, i64 73}
!6 = !{!"_ZTSN4juce22InterprocessConnectionE", !7, i64 8, !12, i64 16, !13, i64 56, !14, i64 64, !15, i64 72, !15, i64 73, !16, i64 76, !16, i64 80, !17, i64 88}
!7 = !{!"_ZTSN4juce13WeakReferenceINS_22InterprocessConnectionENS_22ReferenceCountedObjectEE6MasterE", !8, i64 0}
!8 = !{!"_ZTSN4juce25ReferenceCountedObjectPtrINS_13WeakReferenceINS_22InterprocessConnectionENS_22ReferenceCountedObjectEE13SharedPointerEEE", !9, i64 0}
!9 = !{!"any pointer", !10, i64 0}
!10 = !{!"omnipotent char", !11, i64 0}
!11 = !{!"Simple C++ TBAA"}
!12 = !{!"_ZTSN4juce15CriticalSectionE", !10, i64 0}
!13 = !{!"_ZTSN4juce13ScopedPointerINS_15StreamingSocketEEE", !9, i64 0}
!14 = !{!"_ZTSN4juce13ScopedPointerINS_9NamedPipeEEE", !9, i64 0}
!15 = !{!"bool", !10, i64 0}
!16 = !{!"int", !10, i64 0}
!17 = !{!"_ZTSN4juce13ScopedPointerINS_22InterprocessConnection16ConnectionThreadEEE", !9, i64 0}
!18 = !{i8 0, i8 2}
!19 = !{}
!20 = !{!21, !21, i64 0}
!21 = !{!"vtable pointer", !11, i64 0}


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