; LLVM IR from software-mansion/react-native-audio-api :: packages/react-native-audio-api/common/cpp/audioapi/core/sources/AudioSchedule_1ae33a9d (16BaseAudioContextE)

; 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.audioapi::AudioScheduledSourceNode" = type { %"class.audioapi::AudioNode", i32, %"class.std::function", double, double }
%"class.audioapi::AudioNode" = type { ptr, %"class.std::enable_shared_from_this", ptr, %"class.std::shared_ptr", i32, i32, i32, i32, i32, %"class.std::unordered_set", %"class.std::unordered_set.2", i32, i8, i8, i64, %"class.std::vector" }
%"class.std::enable_shared_from_this" = type { %"class.std::weak_ptr" }
%"class.std::weak_ptr" = type { %"class.std::__weak_ptr" }
%"class.std::__weak_ptr" = type { ptr, %"class.std::__weak_count" }
%"class.std::__weak_count" = 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.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.2" = type { %"class.std::_Hashtable.3" }
%"class.std::_Hashtable.3" = type { ptr, i64, %"struct.std::__detail::_Hash_node_base", i64, %"struct.std::__detail::_Prime_rehash_policy", ptr }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<std::shared_ptr<audioapi::AudioBus>, std::allocator<std::shared_ptr<audioapi::AudioBus>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::shared_ptr<audioapi::AudioBus>, std::allocator<std::shared_ptr<audioapi::AudioBus>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::shared_ptr<audioapi::AudioBus>, std::allocator<std::shared_ptr<audioapi::AudioBus>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::shared_ptr<audioapi::AudioBus>, std::allocator<std::shared_ptr<audioapi::AudioBus>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::function" = type { %"class.std::_Function_base", ptr }
%"class.std::_Function_base" = type { %"union.std::_Any_data", ptr }
%"union.std::_Any_data" = type { %"union.std::_Nocopy_types" }
%"union.std::_Nocopy_types" = type { { i64, i64 } }

@_ZTVN8audioapi24AudioScheduledSourceNodeE = external dso_local unnamed_addr constant { [8 x ptr] }, align 8

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN8audioapi24AudioScheduledSourceNodeC2EPNS_16BaseAudioContextE(ptr noundef nonnull align 8 dereferenceable(280) %0, ptr noundef %1) unnamed_addr #0 align 2 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %5 = load ptr, ptr %3, align 8
  %6 = load ptr, ptr %4, align 8, !tbaa !5
  call void @_ZN8audioapi9AudioNodeC2EPNS_16BaseAudioContextE(ptr noundef nonnull align 8 dereferenceable(224) %5, ptr noundef %6)
  store ptr getelementptr inbounds inrange(-16, 48) ({ [8 x ptr] }, ptr @_ZTVN8audioapi24AudioScheduledSourceNodeE, i32 0, i32 0, i32 2), ptr %5, align 8, !tbaa !9
  %7 = getelementptr inbounds %"class.audioapi::AudioScheduledSourceNode", ptr %5, i32 0, i32 1
  store i32 0, ptr %7, align 8, !tbaa !11
  %8 = getelementptr inbounds %"class.audioapi::AudioScheduledSourceNode", ptr %5, i32 0, i32 2
  call void @_ZNSt8functionIFvdEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %8) #3
  %9 = getelementptr inbounds %"class.audioapi::AudioScheduledSourceNode", ptr %5, i32 0, i32 3
  store double -1.000000e+00, ptr %9, align 8, !tbaa !41
  %10 = getelementptr inbounds %"class.audioapi::AudioScheduledSourceNode", ptr %5, i32 0, i32 4
  store double -1.000000e+00, ptr %10, align 8, !tbaa !42
  %11 = getelementptr inbounds %"class.audioapi::AudioNode", ptr %5, i32 0, i32 4
  store i32 0, ptr %11, align 8, !tbaa !43
  ret void
}

declare void @_ZN8audioapi9AudioNodeC2EPNS_16BaseAudioContextE(ptr noundef nonnull align 8 dereferenceable(224), ptr noundef) unnamed_addr #1

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

attributes #0 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }

!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 = !{!"vtable pointer", !8, i64 0}
!11 = !{!12, !37, i64 224}
!12 = !{!"_ZTSN8audioapi24AudioScheduledSourceNodeE", !13, i64 0, !37, i64 224, !38, i64 232, !40, i64 264, !40, i64 272}
!13 = !{!"_ZTSN8audioapi9AudioNodeE", !14, i64 8, !6, i64 24, !18, i64 32, !21, i64 48, !21, i64 52, !21, i64 56, !22, i64 60, !23, i64 64, !24, i64 72, !30, i64 128, !21, i64 184, !32, i64 188, !32, i64 189, !26, i64 192, !33, i64 200}
!14 = !{!"_ZTSSt23enable_shared_from_thisIN8audioapi9AudioNodeEE", !15, i64 0}
!15 = !{!"_ZTSSt8weak_ptrIN8audioapi9AudioNodeEE", !16, i64 0}
!16 = !{!"_ZTSSt10__weak_ptrIN8audioapi9AudioNodeELN9__gnu_cxx12_Lock_policyE2EE", !6, i64 0, !17, i64 8}
!17 = !{!"_ZTSSt12__weak_countILN9__gnu_cxx12_Lock_policyE2EE", !6, i64 0}
!18 = !{!"_ZTSSt10shared_ptrIN8audioapi8AudioBusEE", !19, i64 0}
!19 = !{!"_ZTSSt12__shared_ptrIN8audioapi8AudioBusELN9__gnu_cxx12_Lock_policyE2EE", !6, i64 0, !20, i64 8}
!20 = !{!"_ZTSSt14__shared_countILN9__gnu_cxx12_Lock_policyE2EE", !6, i64 0}
!21 = !{!"int", !7, i64 0}
!22 = !{!"_ZTSN8audioapi16ChannelCountModeE", !7, i64 0}
!23 = !{!"_ZTSN8audioapi21ChannelInterpretationE", !7, i64 0}
!24 = !{!"_ZTSSt13unordered_setIPN8audioapi9AudioNodeESt4hashIS2_ESt8equal_toIS2_ESaIS2_EE", !25, i64 0}
!25 = !{!"_ZTSSt10_HashtableIPN8audioapi9AudioNodeES2_SaIS2_ENSt8__detail9_IdentityESt8equal_toIS2_ESt4hashIS2_ENS4_18_Mod_range_hashingENS4_20_Default_ranged_hashENS4_20_Prime_rehash_policyENS4_17_Hashtable_traitsILb0ELb1ELb1EEEE", !6, i64 0, !26, i64 8, !27, i64 16, !26, i64 24, !28, i64 32, !6, i64 48}
!26 = !{!"long", !7, i64 0}
!27 = !{!"_ZTSNSt8__detail15_Hash_node_baseE", !6, i64 0}
!28 = !{!"_ZTSNSt8__detail20_Prime_rehash_policyE", !29, i64 0, !26, i64 8}
!29 = !{!"float", !7, i64 0}
!30 = !{!"_ZTSSt13unordered_setISt10shared_ptrIN8audioapi9AudioNodeEESt4hashIS3_ESt8equal_toIS3_ESaIS3_EE", !31, i64 0}
!31 = !{!"_ZTSSt10_HashtableISt10shared_ptrIN8audioapi9AudioNodeEES3_SaIS3_ENSt8__detail9_IdentityESt8equal_toIS3_ESt4hashIS3_ENS5_18_Mod_range_hashingENS5_20_Default_ranged_hashENS5_20_Prime_rehash_policyENS5_17_Hashtable_traitsILb0ELb1ELb1EEEE", !6, i64 0, !26, i64 8, !27, i64 16, !26, i64 24, !28, i64 32, !6, i64 48}
!32 = !{!"bool", !7, i64 0}
!33 = !{!"_ZTSSt6vectorISt10shared_ptrIN8audioapi8AudioBusEESaIS3_EE", !34, i64 0}
!34 = !{!"_ZTSSt12_Vector_baseISt10shared_ptrIN8audioapi8AudioBusEESaIS3_EE", !35, i64 0}
!35 = !{!"_ZTSNSt12_Vector_baseISt10shared_ptrIN8audioapi8AudioBusEESaIS3_EE12_Vector_implE", !36, i64 0}
!36 = !{!"_ZTSNSt12_Vector_baseISt10shared_ptrIN8audioapi8AudioBusEESaIS3_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!37 = !{!"_ZTSN8audioapi24AudioScheduledSourceNode13PlaybackStateE", !7, i64 0}
!38 = !{!"_ZTSSt8functionIFvdEE", !39, i64 0, !6, i64 24}
!39 = !{!"_ZTSSt14_Function_base", !7, i64 0, !6, i64 16}
!40 = !{!"double", !7, i64 0}
!41 = !{!12, !40, i64 264}
!42 = !{!12, !40, i64 272}
!43 = !{!13, !21, i64 48}


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

@_ZTVN8audioapi24AudioScheduledSourceNodeE = external dso_local unnamed_addr constant { [8 x ptr] }, align 8

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN8audioapi24AudioScheduledSourceNodeC2EPNS_16BaseAudioContextE(ptr noundef nonnull align 8 dereferenceable(280) %0, ptr noundef %1) unnamed_addr #0 align 2 {
  tail call void @_ZN8audioapi9AudioNodeC2EPNS_16BaseAudioContextE(ptr noundef nonnull align 8 dereferenceable(224) %0, ptr noundef %1)
  store ptr getelementptr inbounds inrange(-16, 48) (i8, ptr @_ZTVN8audioapi24AudioScheduledSourceNodeE, i64 16), ptr %0, align 8, !tbaa !5
  %3 = getelementptr inbounds i8, ptr %0, i64 224
  store i32 0, ptr %3, align 8, !tbaa !8
  %4 = getelementptr inbounds i8, ptr %0, i64 232
  tail call void @_ZNSt8functionIFvdEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %4) #3
  %5 = getelementptr inbounds i8, ptr %0, i64 264
  store <2 x double> <double -1.000000e+00, double -1.000000e+00>, ptr %5, align 8, !tbaa !40
  %6 = getelementptr inbounds i8, ptr %0, i64 48
  store i32 0, ptr %6, align 8, !tbaa !41
  ret void
}

declare void @_ZN8audioapi9AudioNodeC2EPNS_16BaseAudioContextE(ptr noundef nonnull align 8 dereferenceable(224), ptr noundef) unnamed_addr #1

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

attributes #0 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }

!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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !36, i64 224}
!9 = !{!"_ZTSN8audioapi24AudioScheduledSourceNodeE", !10, i64 0, !36, i64 224, !37, i64 232, !39, i64 264, !39, i64 272}
!10 = !{!"_ZTSN8audioapi9AudioNodeE", !11, i64 8, !14, i64 24, !17, i64 32, !20, i64 48, !20, i64 52, !20, i64 56, !21, i64 60, !22, i64 64, !23, i64 72, !29, i64 128, !20, i64 184, !31, i64 188, !31, i64 189, !25, i64 192, !32, i64 200}
!11 = !{!"_ZTSSt23enable_shared_from_thisIN8audioapi9AudioNodeEE", !12, i64 0}
!12 = !{!"_ZTSSt8weak_ptrIN8audioapi9AudioNodeEE", !13, i64 0}
!13 = !{!"_ZTSSt10__weak_ptrIN8audioapi9AudioNodeELN9__gnu_cxx12_Lock_policyE2EE", !14, i64 0, !16, i64 8}
!14 = !{!"any pointer", !15, i64 0}
!15 = !{!"omnipotent char", !7, i64 0}
!16 = !{!"_ZTSSt12__weak_countILN9__gnu_cxx12_Lock_policyE2EE", !14, i64 0}
!17 = !{!"_ZTSSt10shared_ptrIN8audioapi8AudioBusEE", !18, i64 0}
!18 = !{!"_ZTSSt12__shared_ptrIN8audioapi8AudioBusELN9__gnu_cxx12_Lock_policyE2EE", !14, i64 0, !19, i64 8}
!19 = !{!"_ZTSSt14__shared_countILN9__gnu_cxx12_Lock_policyE2EE", !14, i64 0}
!20 = !{!"int", !15, i64 0}
!21 = !{!"_ZTSN8audioapi16ChannelCountModeE", !15, i64 0}
!22 = !{!"_ZTSN8audioapi21ChannelInterpretationE", !15, i64 0}
!23 = !{!"_ZTSSt13unordered_setIPN8audioapi9AudioNodeESt4hashIS2_ESt8equal_toIS2_ESaIS2_EE", !24, i64 0}
!24 = !{!"_ZTSSt10_HashtableIPN8audioapi9AudioNodeES2_SaIS2_ENSt8__detail9_IdentityESt8equal_toIS2_ESt4hashIS2_ENS4_18_Mod_range_hashingENS4_20_Default_ranged_hashENS4_20_Prime_rehash_policyENS4_17_Hashtable_traitsILb0ELb1ELb1EEEE", !14, i64 0, !25, i64 8, !26, i64 16, !25, i64 24, !27, i64 32, !14, i64 48}
!25 = !{!"long", !15, i64 0}
!26 = !{!"_ZTSNSt8__detail15_Hash_node_baseE", !14, i64 0}
!27 = !{!"_ZTSNSt8__detail20_Prime_rehash_policyE", !28, i64 0, !25, i64 8}
!28 = !{!"float", !15, i64 0}
!29 = !{!"_ZTSSt13unordered_setISt10shared_ptrIN8audioapi9AudioNodeEESt4hashIS3_ESt8equal_toIS3_ESaIS3_EE", !30, i64 0}
!30 = !{!"_ZTSSt10_HashtableISt10shared_ptrIN8audioapi9AudioNodeEES3_SaIS3_ENSt8__detail9_IdentityESt8equal_toIS3_ESt4hashIS3_ENS5_18_Mod_range_hashingENS5_20_Default_ranged_hashENS5_20_Prime_rehash_policyENS5_17_Hashtable_traitsILb0ELb1ELb1EEEE", !14, i64 0, !25, i64 8, !26, i64 16, !25, i64 24, !27, i64 32, !14, i64 48}
!31 = !{!"bool", !15, i64 0}
!32 = !{!"_ZTSSt6vectorISt10shared_ptrIN8audioapi8AudioBusEESaIS3_EE", !33, i64 0}
!33 = !{!"_ZTSSt12_Vector_baseISt10shared_ptrIN8audioapi8AudioBusEESaIS3_EE", !34, i64 0}
!34 = !{!"_ZTSNSt12_Vector_baseISt10shared_ptrIN8audioapi8AudioBusEESaIS3_EE12_Vector_implE", !35, i64 0}
!35 = !{!"_ZTSNSt12_Vector_baseISt10shared_ptrIN8audioapi8AudioBusEESaIS3_EE17_Vector_impl_dataE", !14, i64 0, !14, i64 8, !14, i64 16}
!36 = !{!"_ZTSN8audioapi24AudioScheduledSourceNode13PlaybackStateE", !15, i64 0}
!37 = !{!"_ZTSSt8functionIFvdEE", !38, i64 0, !14, i64 24}
!38 = !{!"_ZTSSt14_Function_base", !15, i64 0, !14, i64 16}
!39 = !{!"double", !15, i64 0}
!40 = !{!39, !39, i64 0}
!41 = !{!10, !20, i64 48}


; Effective O3 passes: InstCombinePass,SLPVectorizerPass,SROAPass,TailCallElimPass