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

; 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::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 }

@.str.9 = external hidden unnamed_addr constant [144 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [20 x i8], align 1
@__PRETTY_FUNCTION__._ZN8audioapi9AudioNode18isAlreadyProcessedEv = external hidden unnamed_addr constant [47 x i8], align 1

; 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 noundef zeroext i1 @_ZN8audioapi9AudioNode18isAlreadyProcessedEv(ptr noundef nonnull align 8 dereferenceable(224) %0) #1 align 2 {
  %2 = alloca i1, align 1
  %3 = alloca ptr, align 8
  %4 = alloca i64, align 8
  %5 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  %6 = load ptr, ptr %3, align 8
  %7 = getelementptr inbounds %"class.audioapi::AudioNode", ptr %6, i32 0, i32 2
  %8 = load ptr, ptr %7, align 8, !tbaa !9
  %9 = icmp ne ptr %8, null
  br i1 %9, label %10, label %11

10:                                               ; preds = %1
  br label %13

11:                                               ; preds = %1
  call void @__assert_fail(ptr noundef @.str.10, ptr noundef @.str.9, i32 noundef 141, ptr noundef @__PRETTY_FUNCTION__._ZN8audioapi9AudioNode18isAlreadyProcessedEv) #4
  unreachable

12:                                               ; No predecessors!
  br label %13

13:                                               ; preds = %12, %10
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #5
  %14 = getelementptr inbounds %"class.audioapi::AudioNode", ptr %6, i32 0, i32 2
  %15 = load ptr, ptr %14, align 8, !tbaa !9
  %16 = call noundef i64 @_ZNK8audioapi16BaseAudioContext21getCurrentSampleFrameEv(ptr noundef nonnull align 8 dereferenceable(128) %15)
  store i64 %16, ptr %4, align 8, !tbaa !34
  %17 = load i64, ptr %4, align 8, !tbaa !34
  %18 = getelementptr inbounds %"class.audioapi::AudioNode", ptr %6, i32 0, i32 14
  %19 = load i64, ptr %18, align 8, !tbaa !35
  %20 = icmp eq i64 %17, %19
  br i1 %20, label %21, label %22

21:                                               ; preds = %13
  store i1 true, ptr %2, align 1
  store i32 1, ptr %5, align 4
  br label %25

22:                                               ; preds = %13
  %23 = load i64, ptr %4, align 8, !tbaa !34
  %24 = getelementptr inbounds %"class.audioapi::AudioNode", ptr %6, i32 0, i32 14
  store i64 %23, ptr %24, align 8, !tbaa !35
  store i1 false, ptr %2, align 1
  store i32 1, ptr %5, align 4
  br label %25

25:                                               ; preds = %22, %21
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #5
  %26 = load i1, ptr %2, align 1
  ret i1 %26
}

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

declare noundef i64 @_ZNK8audioapi16BaseAudioContext21getCurrentSampleFrameEv(ptr noundef nonnull align 8 dereferenceable(128)) #3

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 = { 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 #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 = { noreturn nounwind }
attributes #5 = { 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, !6, i64 24}
!10 = !{!"_ZTSN8audioapi9AudioNodeE", !11, i64 8, !6, i64 24, !15, i64 32, !18, i64 48, !18, i64 52, !18, i64 56, !19, i64 60, !20, i64 64, !21, i64 72, !27, i64 128, !18, i64 184, !29, i64 188, !29, i64 189, !23, i64 192, !30, i64 200}
!11 = !{!"_ZTSSt23enable_shared_from_thisIN8audioapi9AudioNodeEE", !12, i64 0}
!12 = !{!"_ZTSSt8weak_ptrIN8audioapi9AudioNodeEE", !13, i64 0}
!13 = !{!"_ZTSSt10__weak_ptrIN8audioapi9AudioNodeELN9__gnu_cxx12_Lock_policyE2EE", !6, i64 0, !14, i64 8}
!14 = !{!"_ZTSSt12__weak_countILN9__gnu_cxx12_Lock_policyE2EE", !6, i64 0}
!15 = !{!"_ZTSSt10shared_ptrIN8audioapi8AudioBusEE", !16, i64 0}
!16 = !{!"_ZTSSt12__shared_ptrIN8audioapi8AudioBusELN9__gnu_cxx12_Lock_policyE2EE", !6, i64 0, !17, i64 8}
!17 = !{!"_ZTSSt14__shared_countILN9__gnu_cxx12_Lock_policyE2EE", !6, i64 0}
!18 = !{!"int", !7, i64 0}
!19 = !{!"_ZTSN8audioapi16ChannelCountModeE", !7, i64 0}
!20 = !{!"_ZTSN8audioapi21ChannelInterpretationE", !7, i64 0}
!21 = !{!"_ZTSSt13unordered_setIPN8audioapi9AudioNodeESt4hashIS2_ESt8equal_toIS2_ESaIS2_EE", !22, i64 0}
!22 = !{!"_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, !23, i64 8, !24, i64 16, !23, i64 24, !25, i64 32, !6, i64 48}
!23 = !{!"long", !7, i64 0}
!24 = !{!"_ZTSNSt8__detail15_Hash_node_baseE", !6, i64 0}
!25 = !{!"_ZTSNSt8__detail20_Prime_rehash_policyE", !26, i64 0, !23, i64 8}
!26 = !{!"float", !7, i64 0}
!27 = !{!"_ZTSSt13unordered_setISt10shared_ptrIN8audioapi9AudioNodeEESt4hashIS3_ESt8equal_toIS3_ESaIS3_EE", !28, i64 0}
!28 = !{!"_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, !23, i64 8, !24, i64 16, !23, i64 24, !25, i64 32, !6, i64 48}
!29 = !{!"bool", !7, i64 0}
!30 = !{!"_ZTSSt6vectorISt10shared_ptrIN8audioapi8AudioBusEESaIS3_EE", !31, i64 0}
!31 = !{!"_ZTSSt12_Vector_baseISt10shared_ptrIN8audioapi8AudioBusEESaIS3_EE", !32, i64 0}
!32 = !{!"_ZTSNSt12_Vector_baseISt10shared_ptrIN8audioapi8AudioBusEESaIS3_EE12_Vector_implE", !33, i64 0}
!33 = !{!"_ZTSNSt12_Vector_baseISt10shared_ptrIN8audioapi8AudioBusEESaIS3_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!34 = !{!23, !23, i64 0}
!35 = !{!10, !23, i64 192}


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

@.str.9 = external hidden unnamed_addr constant [144 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [20 x i8], align 1
@__PRETTY_FUNCTION__._ZN8audioapi9AudioNode18isAlreadyProcessedEv = external hidden unnamed_addr constant [47 x i8], align 1

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN8audioapi9AudioNode18isAlreadyProcessedEv(ptr nocapture noundef nonnull align 8 dereferenceable(224) %0) local_unnamed_addr #0 align 2 {
  %2 = getelementptr inbounds i8, ptr %0, i64 24
  %3 = load ptr, ptr %2, align 8, !tbaa !5
  %.not = icmp eq ptr %3, null
  br i1 %.not, label %4, label %5

4:                                                ; preds = %1
  tail call void @__assert_fail(ptr noundef nonnull @.str.10, ptr noundef nonnull @.str.9, i32 noundef 141, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN8audioapi9AudioNode18isAlreadyProcessedEv) #3
  unreachable

5:                                                ; preds = %1
  %6 = tail call noundef i64 @_ZNK8audioapi16BaseAudioContext21getCurrentSampleFrameEv(ptr noundef nonnull align 8 dereferenceable(128) %3)
  %7 = getelementptr inbounds i8, ptr %0, i64 192
  %8 = load i64, ptr %7, align 8, !tbaa !33
  %9 = icmp eq i64 %6, %8
  br i1 %9, label %11, label %10

10:                                               ; preds = %5
  store i64 %6, ptr %7, align 8, !tbaa !33
  br label %11

11:                                               ; preds = %5, %10
  ret i1 %9
}

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

declare noundef i64 @_ZNK8audioapi16BaseAudioContext21getCurrentSampleFrameEv(ptr noundef nonnull align 8 dereferenceable(128)) local_unnamed_addr #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 = { 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 #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 = { 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, !10, i64 24}
!6 = !{!"_ZTSN8audioapi9AudioNodeE", !7, i64 8, !10, i64 24, !14, i64 32, !17, i64 48, !17, i64 52, !17, i64 56, !18, i64 60, !19, i64 64, !20, i64 72, !26, i64 128, !17, i64 184, !28, i64 188, !28, i64 189, !22, i64 192, !29, i64 200}
!7 = !{!"_ZTSSt23enable_shared_from_thisIN8audioapi9AudioNodeEE", !8, i64 0}
!8 = !{!"_ZTSSt8weak_ptrIN8audioapi9AudioNodeEE", !9, i64 0}
!9 = !{!"_ZTSSt10__weak_ptrIN8audioapi9AudioNodeELN9__gnu_cxx12_Lock_policyE2EE", !10, i64 0, !13, i64 8}
!10 = !{!"any pointer", !11, i64 0}
!11 = !{!"omnipotent char", !12, i64 0}
!12 = !{!"Simple C++ TBAA"}
!13 = !{!"_ZTSSt12__weak_countILN9__gnu_cxx12_Lock_policyE2EE", !10, i64 0}
!14 = !{!"_ZTSSt10shared_ptrIN8audioapi8AudioBusEE", !15, i64 0}
!15 = !{!"_ZTSSt12__shared_ptrIN8audioapi8AudioBusELN9__gnu_cxx12_Lock_policyE2EE", !10, i64 0, !16, i64 8}
!16 = !{!"_ZTSSt14__shared_countILN9__gnu_cxx12_Lock_policyE2EE", !10, i64 0}
!17 = !{!"int", !11, i64 0}
!18 = !{!"_ZTSN8audioapi16ChannelCountModeE", !11, i64 0}
!19 = !{!"_ZTSN8audioapi21ChannelInterpretationE", !11, i64 0}
!20 = !{!"_ZTSSt13unordered_setIPN8audioapi9AudioNodeESt4hashIS2_ESt8equal_toIS2_ESaIS2_EE", !21, i64 0}
!21 = !{!"_ZTSSt10_HashtableIPN8audioapi9AudioNodeES2_SaIS2_ENSt8__detail9_IdentityESt8equal_toIS2_ESt4hashIS2_ENS4_18_Mod_range_hashingENS4_20_Default_ranged_hashENS4_20_Prime_rehash_policyENS4_17_Hashtable_traitsILb0ELb1ELb1EEEE", !10, i64 0, !22, i64 8, !23, i64 16, !22, i64 24, !24, i64 32, !10, i64 48}
!22 = !{!"long", !11, i64 0}
!23 = !{!"_ZTSNSt8__detail15_Hash_node_baseE", !10, i64 0}
!24 = !{!"_ZTSNSt8__detail20_Prime_rehash_policyE", !25, i64 0, !22, i64 8}
!25 = !{!"float", !11, i64 0}
!26 = !{!"_ZTSSt13unordered_setISt10shared_ptrIN8audioapi9AudioNodeEESt4hashIS3_ESt8equal_toIS3_ESaIS3_EE", !27, i64 0}
!27 = !{!"_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", !10, i64 0, !22, i64 8, !23, i64 16, !22, i64 24, !24, i64 32, !10, i64 48}
!28 = !{!"bool", !11, i64 0}
!29 = !{!"_ZTSSt6vectorISt10shared_ptrIN8audioapi8AudioBusEESaIS3_EE", !30, i64 0}
!30 = !{!"_ZTSSt12_Vector_baseISt10shared_ptrIN8audioapi8AudioBusEESaIS3_EE", !31, i64 0}
!31 = !{!"_ZTSNSt12_Vector_baseISt10shared_ptrIN8audioapi8AudioBusEESaIS3_EE12_Vector_implE", !32, i64 0}
!32 = !{!"_ZTSNSt12_Vector_baseISt10shared_ptrIN8audioapi8AudioBusEESaIS3_EE17_Vector_impl_dataE", !10, i64 0, !10, i64 8, !10, i64 16}
!33 = !{!6, !22, i64 192}


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