; 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::GenericScopedLock.17" = type { ptr }
%"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 }

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

declare i32 @__gxx_personality_v0(...)

; 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: nobuiltin nounwind
declare void @_ZdlPvm(ptr noundef, i64 noundef) #2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN4juce17GenericScopedLockINS_15CriticalSectionEEC2ERKS1_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(40)) unnamed_addr #3 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN4juce17GenericScopedLockINS_15CriticalSectionEED2Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4juce22InterprocessConnection10disconnectEv(ptr noundef nonnull align 8 dereferenceable(96)) #4 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN4juce22InterprocessConnection15connectToSocketERKNS_6StringEii(ptr noundef nonnull align 8 dereferenceable(96) %0, ptr noundef nonnull align 8 dereferenceable(8) %1, i32 noundef %2, i32 noundef %3) #4 align 2 personality ptr @__gxx_personality_v0 {
  %5 = alloca i1, align 1
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca %"class.juce::GenericScopedLock.17", align 8
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  store ptr %0, ptr %6, align 8, !tbaa !5
  store ptr %1, ptr %7, align 8, !tbaa !5
  store i32 %2, ptr %8, align 4, !tbaa !9
  store i32 %3, ptr %9, align 4, !tbaa !9
  %14 = load ptr, ptr %6, align 8
  call void @_ZN4juce22InterprocessConnection10disconnectEv(ptr noundef nonnull align 8 dereferenceable(96) %14)
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #7
  %15 = getelementptr inbounds %"class.juce::InterprocessConnection", ptr %14, i32 0, i32 2
  call void @_ZN4juce17GenericScopedLockINS_15CriticalSectionEEC2ERKS1_(ptr noundef nonnull align 8 dereferenceable(8) %10, ptr noundef nonnull align 8 dereferenceable(40) %15) #7
  %16 = invoke noalias noundef nonnull ptr @_Znwm(i64 noundef 64) #8
          to label %17 unwind label %34

17:                                               ; preds = %4
  invoke void @_ZN4juce15StreamingSocketC1Ev(ptr noundef nonnull align 8 dereferenceable(64) %16)
          to label %18 unwind label %38

18:                                               ; preds = %17
  %19 = getelementptr inbounds %"class.juce::InterprocessConnection", ptr %14, i32 0, i32 3
  %20 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN4juce13ScopedPointerINS_15StreamingSocketEEaSEPS1_(ptr noundef nonnull align 8 dereferenceable(8) %19, ptr noundef %16)
          to label %21 unwind label %34

21:                                               ; preds = %18
  %22 = getelementptr inbounds %"class.juce::InterprocessConnection", ptr %14, i32 0, i32 3
  %23 = call noundef ptr @_ZNK4juce13ScopedPointerINS_15StreamingSocketEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %22) #7
  %24 = load ptr, ptr %7, align 8, !tbaa !5
  %25 = load i32, ptr %8, align 4, !tbaa !9
  %26 = load i32, ptr %9, align 4, !tbaa !9
  %27 = invoke noundef zeroext i1 @_ZN4juce15StreamingSocket7connectERKNS_6StringEii(ptr noundef nonnull align 8 dereferenceable(64) %23, ptr noundef nonnull align 8 dereferenceable(8) %24, i32 noundef %25, i32 noundef %26)
          to label %28 unwind label %34

28:                                               ; preds = %21
  br i1 %27, label %29, label %42

29:                                               ; preds = %28
  invoke void @_ZN4juce22InterprocessConnection17connectionMadeIntEv(ptr noundef nonnull align 8 dereferenceable(96) %14)
          to label %30 unwind label %34

30:                                               ; preds = %29
  %31 = getelementptr inbounds %"class.juce::InterprocessConnection", ptr %14, i32 0, i32 9
  %32 = call noundef ptr @_ZNK4juce13ScopedPointerINS_22InterprocessConnection16ConnectionThreadEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %31) #7
  invoke void @_ZN4juce6Thread11startThreadEv(ptr noundef nonnull align 8 dereferenceable(285) %32)
          to label %33 unwind label %34

33:                                               ; preds = %30
  store i1 true, ptr %5, align 1
  store i32 1, ptr %13, align 4
  br label %46

34:                                               ; preds = %42, %30, %29, %21, %18, %4
  %35 = landingpad { ptr, i32 }
          cleanup
  %36 = extractvalue { ptr, i32 } %35, 0
  store ptr %36, ptr %11, align 8
  %37 = extractvalue { ptr, i32 } %35, 1
  store i32 %37, ptr %12, align 4
  br label %48

38:                                               ; preds = %17
  %39 = landingpad { ptr, i32 }
          cleanup
  %40 = extractvalue { ptr, i32 } %39, 0
  store ptr %40, ptr %11, align 8
  %41 = extractvalue { ptr, i32 } %39, 1
  store i32 %41, ptr %12, align 4
  call void @_ZdlPvm(ptr noundef %16, i64 noundef 64) #9
  br label %48

42:                                               ; preds = %28
  %43 = getelementptr inbounds %"class.juce::InterprocessConnection", ptr %14, i32 0, i32 3
  %44 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN4juce13ScopedPointerINS_15StreamingSocketEEaSEPS1_(ptr noundef nonnull align 8 dereferenceable(8) %43, ptr noundef null)
          to label %45 unwind label %34

45:                                               ; preds = %42
  store i1 false, ptr %5, align 1
  store i32 1, ptr %13, align 4
  br label %46

46:                                               ; preds = %45, %33
  call void @_ZN4juce17GenericScopedLockINS_15CriticalSectionEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %10) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #7
  %47 = load i1, ptr %5, align 1
  ret i1 %47

48:                                               ; preds = %38, %34
  call void @_ZN4juce17GenericScopedLockINS_15CriticalSectionEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %10) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #7
  br label %49

49:                                               ; preds = %48
  %50 = load ptr, ptr %11, align 8
  %51 = load i32, ptr %12, align 4
  %52 = insertvalue { ptr, i32 } poison, ptr %50, 0
  %53 = insertvalue { ptr, i32 } %52, i32 %51, 1
  resume { ptr, i32 } %53
}

declare void @_ZN4juce15StreamingSocketC1Ev(ptr noundef nonnull align 8 dereferenceable(64)) unnamed_addr #5

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

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

declare noundef zeroext i1 @_ZN4juce15StreamingSocket7connectERKNS_6StringEii(ptr noundef nonnull align 8 dereferenceable(64), ptr noundef nonnull align 8 dereferenceable(8), i32 noundef, i32 noundef) #5

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4juce22InterprocessConnection17connectionMadeIntEv(ptr noundef nonnull align 8 dereferenceable(96)) #4 align 2

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

declare void @_ZN4juce6Thread11startThreadEv(ptr noundef nonnull align 8 dereferenceable(285)) #5

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 = { 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 #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 = { 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 #5 = { "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 = { 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 #7 = { nounwind }
attributes #8 = { builtin allocsize(0) }
attributes #9 = { 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 = !{!"int", !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"

%"class.juce::GenericScopedLock.17" = type { ptr }

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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress 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) local_unnamed_addr #1

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN4juce17GenericScopedLockINS_15CriticalSectionEEC2ERKS1_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(40)) unnamed_addr #3 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN4juce17GenericScopedLockINS_15CriticalSectionEED2Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #3 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN4juce22InterprocessConnection15connectToSocketERKNS_6StringEii(ptr noundef nonnull align 8 dereferenceable(96) %0, ptr noundef nonnull align 8 dereferenceable(8) %1, i32 noundef %2, i32 noundef %3) local_unnamed_addr #4 align 2 personality ptr @__gxx_personality_v0 {
  %5 = alloca %"class.juce::GenericScopedLock.17", align 8
  tail call void @_ZN4juce22InterprocessConnection10disconnectEv(ptr noundef nonnull align 8 dereferenceable(96) %0)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #7
  %6 = getelementptr inbounds i8, ptr %0, i64 16
  call void @_ZN4juce17GenericScopedLockINS_15CriticalSectionEEC2ERKS1_(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(40) %6) #7
  %7 = invoke noalias noundef nonnull dereferenceable(64) ptr @_Znwm(i64 noundef 64) #8
          to label %8 unwind label %19

8:                                                ; preds = %4
  invoke void @_ZN4juce15StreamingSocketC1Ev(ptr noundef nonnull align 8 dereferenceable(64) %7)
          to label %9 unwind label %21

9:                                                ; preds = %8
  %10 = getelementptr inbounds i8, ptr %0, i64 56
  %11 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN4juce13ScopedPointerINS_15StreamingSocketEEaSEPS1_(ptr noundef nonnull align 8 dereferenceable(8) %10, ptr noundef nonnull %7)
  %12 = call noundef ptr @_ZNK4juce13ScopedPointerINS_15StreamingSocketEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %10) #7
  %13 = invoke noundef zeroext i1 @_ZN4juce15StreamingSocket7connectERKNS_6StringEii(ptr noundef nonnull align 8 dereferenceable(64) %12, ptr noundef nonnull align 8 dereferenceable(8) %1, i32 noundef %2, i32 noundef %3)
          to label %14 unwind label %19

14:                                               ; preds = %9
  br i1 %13, label %15, label %23

15:                                               ; preds = %14
  invoke void @_ZN4juce22InterprocessConnection17connectionMadeIntEv(ptr noundef nonnull align 8 dereferenceable(96) %0)
          to label %16 unwind label %19

16:                                               ; preds = %15
  %17 = getelementptr inbounds i8, ptr %0, i64 88
  %18 = call noundef ptr @_ZNK4juce13ScopedPointerINS_22InterprocessConnection16ConnectionThreadEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %17) #7
  invoke void @_ZN4juce6Thread11startThreadEv(ptr noundef nonnull align 8 dereferenceable(285) %18)
          to label %25 unwind label %19

19:                                               ; preds = %16, %15, %9, %4
  %20 = landingpad { ptr, i32 }
          cleanup
  br label %26

21:                                               ; preds = %8
  %22 = landingpad { ptr, i32 }
          cleanup
  call void @_ZdlPvm(ptr noundef nonnull %7, i64 noundef 64) #9
  br label %26

23:                                               ; preds = %14
  %24 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN4juce13ScopedPointerINS_15StreamingSocketEEaSEPS1_(ptr noundef nonnull align 8 dereferenceable(8) %10, ptr noundef null)
  br label %25

25:                                               ; preds = %16, %23
  call void @_ZN4juce17GenericScopedLockINS_15CriticalSectionEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %5) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #7
  ret i1 %13

26:                                               ; preds = %21, %19
  %.pn = phi { ptr, i32 } [ %20, %19 ], [ %22, %21 ]
  call void @_ZN4juce17GenericScopedLockINS_15CriticalSectionEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %5) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #7
  resume { ptr, i32 } %.pn
}

declare void @_ZN4juce15StreamingSocketC1Ev(ptr noundef nonnull align 8 dereferenceable(64)) unnamed_addr #5

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

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

declare noundef zeroext i1 @_ZN4juce15StreamingSocket7connectERKNS_6StringEii(ptr noundef nonnull align 8 dereferenceable(64), ptr noundef nonnull align 8 dereferenceable(8), i32 noundef, i32 noundef) local_unnamed_addr #5

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

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

declare void @_ZN4juce6Thread11startThreadEv(ptr noundef nonnull align 8 dereferenceable(285)) local_unnamed_addr #5

attributes #0 = { mustprogress 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 = { 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 #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 = { 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 #5 = { "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 = { 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 #7 = { nounwind }
attributes #8 = { builtin allocsize(0) }
attributes #9 = { 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)"}


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