; LLVM IR from software-mansion/react-native-audio-api :: packages/react-native-audio-api/common/cpp/audioapi/core/utils/AudioNodeManage_d6918baa (ZN8audioapi16AudioNodeManager24settlePendingConnectionsEv)

; 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.__gnu_cxx::__normal_iterator" = type { ptr }
%"class.std::shared_ptr" = type { %"class.std::__shared_ptr" }
%"class.std::__shared_ptr" = type { ptr, %"class.std::__shared_count" }
%"class.std::__shared_count" = type { ptr }
%"class.audioapi::AudioNodeManager" = type { %"class.std::mutex", %"class.audioapi::AudioNodeDestructor", %"class.std::unordered_set", %"class.std::unordered_set.5", %"class.std::vector.25" }
%"class.std::mutex" = type { %"class.std::__mutex_base" }
%"class.std::__mutex_base" = 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.audioapi::AudioNodeDestructor" = type <{ %"class.std::mutex", %"class.std::thread", %"class.std::condition_variable", %"class.std::vector", %"struct.std::atomic", [7 x i8] }>
%"class.std::thread" = type { %"class.std::thread::id" }
%"class.std::thread::id" = type { i64 }
%"class.std::condition_variable" = type { %"class.std::__condvar" }
%"class.std::__condvar" = type { %union.pthread_cond_t }
%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 }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<std::shared_ptr<audioapi::AudioNode>, std::allocator<std::shared_ptr<audioapi::AudioNode>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::shared_ptr<audioapi::AudioNode>, std::allocator<std::shared_ptr<audioapi::AudioNode>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::shared_ptr<audioapi::AudioNode>, std::allocator<std::shared_ptr<audioapi::AudioNode>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::shared_ptr<audioapi::AudioNode>, std::allocator<std::shared_ptr<audioapi::AudioNode>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"struct.std::atomic" = type { %"struct.std::__atomic_base" }
%"struct.std::__atomic_base" = type { i8 }
%"class.std::unordered_set" = type { %"class.std::_Hashtable" }
%"class.std::_Hashtable" = type { ptr, i64, %"struct.std::__detail::_Hash_node_base", i64, %"struct.std::__detail::_Prime_rehash_policy", ptr }
%"struct.std::__detail::_Hash_node_base" = type { ptr }
%"struct.std::__detail::_Prime_rehash_policy" = type { float, i64 }
%"class.std::unordered_set.5" = type { %"class.std::_Hashtable.6" }
%"class.std::_Hashtable.6" = type { ptr, i64, %"struct.std::__detail::_Hash_node_base", i64, %"struct.std::__detail::_Prime_rehash_policy", ptr }
%"class.std::vector.25" = type { %"struct.std::_Vector_base.26" }
%"struct.std::_Vector_base.26" = type { %"struct.std::_Vector_base<std::tuple<std::shared_ptr<audioapi::AudioNode>, std::shared_ptr<audioapi::AudioNode>, audioapi::AudioNodeManager::ConnectionType>, std::allocator<std::tuple<std::shared_ptr<audioapi::AudioNode>, std::shared_ptr<audioapi::AudioNode>, audioapi::AudioNodeManager::ConnectionType>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::tuple<std::shared_ptr<audioapi::AudioNode>, std::shared_ptr<audioapi::AudioNode>, audioapi::AudioNodeManager::ConnectionType>, std::allocator<std::tuple<std::shared_ptr<audioapi::AudioNode>, std::shared_ptr<audioapi::AudioNode>, audioapi::AudioNodeManager::ConnectionType>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::tuple<std::shared_ptr<audioapi::AudioNode>, std::shared_ptr<audioapi::AudioNode>, audioapi::AudioNodeManager::ConnectionType>, std::allocator<std::tuple<std::shared_ptr<audioapi::AudioNode>, std::shared_ptr<audioapi::AudioNode>, audioapi::AudioNodeManager::ConnectionType>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::tuple<std::shared_ptr<audioapi::AudioNode>, std::shared_ptr<audioapi::AudioNode>, audioapi::AudioNodeManager::ConnectionType>, std::allocator<std::tuple<std::shared_ptr<audioapi::AudioNode>, std::shared_ptr<audioapi::AudioNode>, audioapi::AudioNodeManager::ConnectionType>>>::_Vector_impl_data" = type { ptr, ptr, ptr }

@.str = external hidden unnamed_addr constant [16 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [157 x i8], align 1
@__PRETTY_FUNCTION__._ZN8audioapi16AudioNodeManager24settlePendingConnectionsEv = external hidden unnamed_addr constant [60 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [14 x i8], align 1

declare i32 @__gxx_personality_v0(...)

; 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: mustprogress uwtable
define dso_local void @_ZN8audioapi16AudioNodeManager24settlePendingConnectionsEv(ptr noundef nonnull align 8 dereferenceable(304) %0) #1 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca ptr, align 8
  %3 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %4 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %5 = alloca %"class.std::shared_ptr", align 8
  %6 = alloca %"class.std::shared_ptr", align 8
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  %10 = load ptr, ptr %2, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #6
  %11 = getelementptr inbounds %"class.audioapi::AudioNodeManager", ptr %10, i32 0, i32 4
  %12 = call ptr @_ZNSt6vectorISt5tupleIJSt10shared_ptrIN8audioapi9AudioNodeEES4_NS2_16AudioNodeManager14ConnectionTypeEEESaIS7_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %11) #6
  %13 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %3, i32 0, i32 0
  store ptr %12, ptr %13, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #6
  %14 = getelementptr inbounds %"class.audioapi::AudioNodeManager", ptr %10, i32 0, i32 4
  %15 = call ptr @_ZNSt6vectorISt5tupleIJSt10shared_ptrIN8audioapi9AudioNodeEES4_NS2_16AudioNodeManager14ConnectionTypeEEESaIS7_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %14) #6
  %16 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %4, i32 0, i32 0
  store ptr %15, ptr %16, align 8
  br label %17

17:                                               ; preds = %51, %1
  %18 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt5tupleIJSt10shared_ptrIN8audioapi9AudioNodeEES5_NS3_16AudioNodeManager14ConnectionTypeEEESt6vectorIS8_SaIS8_EEEEbRKNS_17__normal_iteratorIT_T0_EESI_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %4) #6
  br i1 %18, label %20, label %19

19:                                               ; preds = %17
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #6
  br label %53

20:                                               ; preds = %17
  call void @llvm.lifetime.start.p0(i64 16, ptr %5) #6
  %21 = call noundef nonnull align 8 dereferenceable(40) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt5tupleIJSt10shared_ptrIN8audioapi9AudioNodeEES5_NS3_16AudioNodeManager14ConnectionTypeEEESt6vectorIS8_SaIS8_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #6
  %22 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZSt3getILm0EJSt10shared_ptrIN8audioapi9AudioNodeEES3_NS1_16AudioNodeManager14ConnectionTypeEEERNSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4typeERSA_(ptr noundef nonnull align 8 dereferenceable(40) %21) #6
  call void @_ZNSt10shared_ptrIN8audioapi9AudioNodeEEC2ERKS2_(ptr noundef nonnull align 8 dereferenceable(16) %5, ptr noundef nonnull align 8 dereferenceable(16) %22) #6
  call void @llvm.lifetime.start.p0(i64 16, ptr %6) #6
  %23 = call noundef nonnull align 8 dereferenceable(40) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt5tupleIJSt10shared_ptrIN8audioapi9AudioNodeEES5_NS3_16AudioNodeManager14ConnectionTypeEEESt6vectorIS8_SaIS8_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #6
  %24 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZSt3getILm1EJSt10shared_ptrIN8audioapi9AudioNodeEES3_NS1_16AudioNodeManager14ConnectionTypeEEERNSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4typeERSA_(ptr noundef nonnull align 8 dereferenceable(40) %23) #6
  call void @_ZNSt10shared_ptrIN8audioapi9AudioNodeEEC2ERKS2_(ptr noundef nonnull align 8 dereferenceable(16) %6, ptr noundef nonnull align 8 dereferenceable(16) %24) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  %25 = call noundef nonnull align 8 dereferenceable(40) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt5tupleIJSt10shared_ptrIN8audioapi9AudioNodeEES5_NS3_16AudioNodeManager14ConnectionTypeEEESt6vectorIS8_SaIS8_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #6
  %26 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3getILm2EJSt10shared_ptrIN8audioapi9AudioNodeEES3_NS1_16AudioNodeManager14ConnectionTypeEEERNSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4typeERSA_(ptr noundef nonnull align 8 dereferenceable(40) %25) #6
  %27 = load i32, ptr %26, align 4, !tbaa !9
  store i32 %27, ptr %7, align 4, !tbaa !9
  %28 = call noundef zeroext i1 @_ZStneIN8audioapi9AudioNodeEEbRKSt10shared_ptrIT_EDn(ptr noundef nonnull align 8 dereferenceable(16) %5, ptr null) #6
  br i1 %28, label %29, label %30

29:                                               ; preds = %20
  br label %32

30:                                               ; preds = %20
  call void @__assert_fail(ptr noundef @.str, ptr noundef @.str.3, i32 noundef 52, ptr noundef @__PRETTY_FUNCTION__._ZN8audioapi16AudioNodeManager24settlePendingConnectionsEv) #7
  unreachable

31:                                               ; No predecessors!
  br label %32

32:                                               ; preds = %31, %29
  %33 = call noundef zeroext i1 @_ZStneIN8audioapi9AudioNodeEEbRKSt10shared_ptrIT_EDn(ptr noundef nonnull align 8 dereferenceable(16) %6, ptr null) #6
  br i1 %33, label %34, label %35

34:                                               ; preds = %32
  br label %37

35:                                               ; preds = %32
  call void @__assert_fail(ptr noundef @.str.4, ptr noundef @.str.3, i32 noundef 53, ptr noundef @__PRETTY_FUNCTION__._ZN8audioapi16AudioNodeManager24settlePendingConnectionsEv) #7
  unreachable

36:                                               ; No predecessors!
  br label %37

37:                                               ; preds = %36, %34
  %38 = load i32, ptr %7, align 4, !tbaa !9
  %39 = icmp eq i32 %38, 0
  br i1 %39, label %40, label %47

40:                                               ; preds = %37
  %41 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN8audioapi9AudioNodeELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %5) #6
  invoke void @_ZN8audioapi9AudioNode11connectNodeERKSt10shared_ptrIS0_E(ptr noundef nonnull align 8 dereferenceable(224) %41, ptr noundef nonnull align 8 dereferenceable(16) %6)
          to label %42 unwind label %43

42:                                               ; preds = %40
  br label %50

43:                                               ; preds = %47, %40
  %44 = landingpad { ptr, i32 }
          cleanup
  %45 = extractvalue { ptr, i32 } %44, 0
  store ptr %45, ptr %8, align 8
  %46 = extractvalue { ptr, i32 } %44, 1
  store i32 %46, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  call void @_ZNSt12__shared_ptrIN8audioapi9AudioNodeELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %6) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %6) #6
  call void @_ZNSt12__shared_ptrIN8audioapi9AudioNodeELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %5) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #6
  br label %55

47:                                               ; preds = %37
  %48 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN8audioapi9AudioNodeELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %5) #6
  invoke void @_ZN8audioapi9AudioNode14disconnectNodeERKSt10shared_ptrIS0_E(ptr noundef nonnull align 8 dereferenceable(224) %48, ptr noundef nonnull align 8 dereferenceable(16) %6)
          to label %49 unwind label %43

49:                                               ; preds = %47
  br label %50

50:                                               ; preds = %49, %42
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  call void @_ZNSt12__shared_ptrIN8audioapi9AudioNodeELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %6) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %6) #6
  call void @_ZNSt12__shared_ptrIN8audioapi9AudioNodeELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %5) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %5) #6
  br label %51

51:                                               ; preds = %50
  %52 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPSt5tupleIJSt10shared_ptrIN8audioapi9AudioNodeEES5_NS3_16AudioNodeManager14ConnectionTypeEEESt6vectorIS8_SaIS8_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #6
  br label %17, !llvm.loop !11

53:                                               ; preds = %19
  %54 = getelementptr inbounds %"class.audioapi::AudioNodeManager", ptr %10, i32 0, i32 4
  call void @_ZNSt6vectorISt5tupleIJSt10shared_ptrIN8audioapi9AudioNodeEES4_NS2_16AudioNodeManager14ConnectionTypeEEESaIS7_EE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) %54) #6
  ret void

55:                                               ; preds = %43
  %56 = load ptr, ptr %8, align 8
  %57 = load i32, ptr %9, align 4
  %58 = insertvalue { ptr, i32 } poison, ptr %56, 0
  %59 = insertvalue { ptr, i32 } %58, i32 %57, 1
  resume { ptr, i32 } %59
}

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

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

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

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

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

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZStneIN8audioapi9AudioNodeEEbRKSt10shared_ptrIT_EDn(ptr noundef nonnull align 8 dereferenceable(16), ptr) #3

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #4

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

declare void @_ZN8audioapi9AudioNode11connectNodeERKSt10shared_ptrIS0_E(ptr noundef nonnull align 8 dereferenceable(224), ptr noundef nonnull align 8 dereferenceable(16)) #5

declare void @_ZN8audioapi9AudioNode14disconnectNodeERKSt10shared_ptrIS0_E(ptr noundef nonnull align 8 dereferenceable(224), ptr noundef nonnull align 8 dereferenceable(16)) #5

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorISt5tupleIJSt10shared_ptrIN8audioapi9AudioNodeEES4_NS2_16AudioNodeManager14ConnectionTypeEEESaIS7_EE5clearEv(ptr noundef nonnull align 8 dereferenceable(24)) #2 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 = { 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 = { noreturn 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 = { "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 = { noreturn 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 = !{!"_ZTSN8audioapi16AudioNodeManager14ConnectionTypeE", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}


; 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.__gnu_cxx::__normal_iterator" = type { ptr }
%"class.std::shared_ptr" = type { %"class.std::__shared_ptr" }
%"class.std::__shared_ptr" = type { ptr, %"class.std::__shared_count" }
%"class.std::__shared_count" = type { ptr }

@.str = external hidden unnamed_addr constant [16 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [157 x i8], align 1
@__PRETTY_FUNCTION__._ZN8audioapi16AudioNodeManager24settlePendingConnectionsEv = external hidden unnamed_addr constant [60 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [14 x i8], align 1

declare i32 @__gxx_personality_v0(...)

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN8audioapi16AudioNodeManager24settlePendingConnectionsEv(ptr noundef nonnull align 8 dereferenceable(304) %0) local_unnamed_addr #1 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %3 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %4 = alloca %"class.std::shared_ptr", align 8
  %5 = alloca %"class.std::shared_ptr", align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #6
  %6 = getelementptr inbounds i8, ptr %0, i64 280
  %7 = tail call ptr @_ZNSt6vectorISt5tupleIJSt10shared_ptrIN8audioapi9AudioNodeEES4_NS2_16AudioNodeManager14ConnectionTypeEEESaIS7_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %6) #6
  store ptr %7, ptr %2, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #6
  %8 = tail call ptr @_ZNSt6vectorISt5tupleIJSt10shared_ptrIN8audioapi9AudioNodeEES4_NS2_16AudioNodeManager14ConnectionTypeEEESaIS7_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %6) #6
  store ptr %8, ptr %3, align 8
  %9 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt5tupleIJSt10shared_ptrIN8audioapi9AudioNodeEES5_NS3_16AudioNodeManager14ConnectionTypeEEESt6vectorIS8_SaIS8_EEEEbRKNS_17__normal_iteratorIT_T0_EESI_(ptr noundef nonnull align 8 dereferenceable(8) %2, ptr noundef nonnull align 8 dereferenceable(8) %3) #6
  br i1 %9, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %29, %1
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #6
  call void @_ZNSt6vectorISt5tupleIJSt10shared_ptrIN8audioapi9AudioNodeEES4_NS2_16AudioNodeManager14ConnectionTypeEEESaIS7_EE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) %6) #6
  ret void

.lr.ph:                                           ; preds = %1, %29
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %4) #6
  %10 = call noundef nonnull align 8 dereferenceable(40) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt5tupleIJSt10shared_ptrIN8audioapi9AudioNodeEES5_NS3_16AudioNodeManager14ConnectionTypeEEESt6vectorIS8_SaIS8_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %2) #6
  %11 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZSt3getILm0EJSt10shared_ptrIN8audioapi9AudioNodeEES3_NS1_16AudioNodeManager14ConnectionTypeEEERNSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4typeERSA_(ptr noundef nonnull align 8 dereferenceable(40) %10) #6
  call void @_ZNSt10shared_ptrIN8audioapi9AudioNodeEEC2ERKS2_(ptr noundef nonnull align 8 dereferenceable(16) %4, ptr noundef nonnull align 8 dereferenceable(16) %11) #6
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %5) #6
  %12 = call noundef nonnull align 8 dereferenceable(40) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt5tupleIJSt10shared_ptrIN8audioapi9AudioNodeEES5_NS3_16AudioNodeManager14ConnectionTypeEEESt6vectorIS8_SaIS8_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %2) #6
  %13 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZSt3getILm1EJSt10shared_ptrIN8audioapi9AudioNodeEES3_NS1_16AudioNodeManager14ConnectionTypeEEERNSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4typeERSA_(ptr noundef nonnull align 8 dereferenceable(40) %12) #6
  call void @_ZNSt10shared_ptrIN8audioapi9AudioNodeEEC2ERKS2_(ptr noundef nonnull align 8 dereferenceable(16) %5, ptr noundef nonnull align 8 dereferenceable(16) %13) #6
  %14 = call noundef nonnull align 8 dereferenceable(40) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt5tupleIJSt10shared_ptrIN8audioapi9AudioNodeEES5_NS3_16AudioNodeManager14ConnectionTypeEEESt6vectorIS8_SaIS8_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %2) #6
  %15 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3getILm2EJSt10shared_ptrIN8audioapi9AudioNodeEES3_NS1_16AudioNodeManager14ConnectionTypeEEERNSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4typeERSA_(ptr noundef nonnull align 8 dereferenceable(40) %14) #6
  %16 = load i32, ptr %15, align 4, !tbaa !5
  %17 = call noundef zeroext i1 @_ZStneIN8audioapi9AudioNodeEEbRKSt10shared_ptrIT_EDn(ptr noundef nonnull align 8 dereferenceable(16) %4, ptr null) #6
  br i1 %17, label %19, label %18

18:                                               ; preds = %.lr.ph
  call void @__assert_fail(ptr noundef nonnull @.str, ptr noundef nonnull @.str.3, i32 noundef 52, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN8audioapi16AudioNodeManager24settlePendingConnectionsEv) #7
  unreachable

19:                                               ; preds = %.lr.ph
  %20 = call noundef zeroext i1 @_ZStneIN8audioapi9AudioNodeEEbRKSt10shared_ptrIT_EDn(ptr noundef nonnull align 8 dereferenceable(16) %5, ptr null) #6
  br i1 %20, label %22, label %21

21:                                               ; preds = %19
  call void @__assert_fail(ptr noundef nonnull @.str.4, ptr noundef nonnull @.str.3, i32 noundef 53, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN8audioapi16AudioNodeManager24settlePendingConnectionsEv) #7
  unreachable

22:                                               ; preds = %19
  %23 = icmp eq i32 %16, 0
  %24 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN8audioapi9AudioNodeELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %4) #6
  br i1 %23, label %25, label %28

25:                                               ; preds = %22
  invoke void @_ZN8audioapi9AudioNode11connectNodeERKSt10shared_ptrIS0_E(ptr noundef nonnull align 8 dereferenceable(224) %24, ptr noundef nonnull align 8 dereferenceable(16) %5)
          to label %29 unwind label %26

26:                                               ; preds = %28, %25
  %27 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt12__shared_ptrIN8audioapi9AudioNodeELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %5) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #6
  call void @_ZNSt12__shared_ptrIN8audioapi9AudioNodeELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %4) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #6
  resume { ptr, i32 } %27

28:                                               ; preds = %22
  invoke void @_ZN8audioapi9AudioNode14disconnectNodeERKSt10shared_ptrIS0_E(ptr noundef nonnull align 8 dereferenceable(224) %24, ptr noundef nonnull align 8 dereferenceable(16) %5)
          to label %29 unwind label %26

29:                                               ; preds = %28, %25
  call void @_ZNSt12__shared_ptrIN8audioapi9AudioNodeELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %5) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #6
  call void @_ZNSt12__shared_ptrIN8audioapi9AudioNodeELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %4) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #6
  %30 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPSt5tupleIJSt10shared_ptrIN8audioapi9AudioNodeEES5_NS3_16AudioNodeManager14ConnectionTypeEEESt6vectorIS8_SaIS8_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %2) #6
  %31 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt5tupleIJSt10shared_ptrIN8audioapi9AudioNodeEES5_NS3_16AudioNodeManager14ConnectionTypeEEESt6vectorIS8_SaIS8_EEEEbRKNS_17__normal_iteratorIT_T0_EESI_(ptr noundef nonnull align 8 dereferenceable(8) %2, ptr noundef nonnull align 8 dereferenceable(8) %3) #6
  br i1 %31, label %.lr.ph, label %._crit_edge, !llvm.loop !9
}

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

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

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

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

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

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

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

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

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

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #4

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

declare void @_ZN8audioapi9AudioNode11connectNodeERKSt10shared_ptrIS0_E(ptr noundef nonnull align 8 dereferenceable(224), ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #5

declare void @_ZN8audioapi9AudioNode14disconnectNodeERKSt10shared_ptrIS0_E(ptr noundef nonnull align 8 dereferenceable(224), ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #5

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

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

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

attributes #0 = { mustprogress 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 = { 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 = { noreturn 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 = { "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 = { noreturn 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 = !{!"_ZTSN8audioapi16AudioNodeManager14ConnectionTypeE", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}


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