; LLVM IR from glaretechnologies/substrata :: resonance-audio/resonance_audio/utils (lockless_task_queue)

; 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.std::reverse_iterator" = type { %"class.__gnu_cxx::__normal_iterator" }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }
%"class.vraudio::LocklessTaskQueue" = type { %"struct.std::atomic", %"struct.std::atomic", %"class.std::vector", %"class.std::vector.0" }
%"struct.std::atomic" = type { %"struct.std::__atomic_base" }
%"struct.std::__atomic_base" = type { i64 }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<vraudio::LocklessTaskQueue::Node, std::allocator<vraudio::LocklessTaskQueue::Node>>::_Vector_impl" }
%"struct.std::_Vector_base<vraudio::LocklessTaskQueue::Node, std::allocator<vraudio::LocklessTaskQueue::Node>>::_Vector_impl" = type { %"struct.std::_Vector_base<vraudio::LocklessTaskQueue::Node, std::allocator<vraudio::LocklessTaskQueue::Node>>::_Vector_impl_data" }
%"struct.std::_Vector_base<vraudio::LocklessTaskQueue::Node, std::allocator<vraudio::LocklessTaskQueue::Node>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.0" = type { %"struct.std::_Vector_base.1" }
%"struct.std::_Vector_base.1" = type { %"struct.std::_Vector_base<std::function<void ()>, std::allocator<std::function<void ()>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::function<void ()>, std::allocator<std::function<void ()>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::function<void ()>, std::allocator<std::function<void ()>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::function<void ()>, std::allocator<std::function<void ()>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"struct.vraudio::LocklessTaskQueue::Node" = type { %"class.std::function", %"struct.std::atomic" }
%"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 } }

; 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 nounwind uwtable
declare dso_local noundef i64 @_ZN7vraudio17LocklessTaskQueue8GetIndexEm(ptr noundef nonnull align 8 dereferenceable(64), i64 noundef) #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(40) ptr @_ZNSt6vectorIN7vraudio17LocklessTaskQueue4NodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7vraudio17LocklessTaskQueue14PushNodeToListEPSt6atomicImEm(ptr noundef nonnull align 8 dereferenceable(64), ptr noundef, i64 noundef) #2 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN7vraudio17LocklessTaskQueue15ProcessTaskListEmb(ptr noundef nonnull align 8 dereferenceable(64) %0, i64 noundef %1, i1 noundef zeroext %2) #2 align 2 {
  %4 = alloca ptr, align 8
  %5 = alloca i64, align 8
  %6 = alloca i8, align 1
  %7 = alloca i64, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i64, align 8
  %10 = alloca %"class.std::reverse_iterator", align 8
  %11 = alloca %"class.std::reverse_iterator", align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  store i64 %1, ptr %5, align 8, !tbaa !9
  %12 = zext i1 %2 to i8
  store i8 %12, ptr %6, align 1, !tbaa !11
  %13 = load ptr, ptr %4, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #5
  %14 = load i64, ptr %5, align 8, !tbaa !9
  store i64 %14, ptr %7, align 8, !tbaa !9
  br label %15

15:                                               ; preds = %19, %3
  %16 = load i64, ptr %7, align 8, !tbaa !9
  %17 = call noundef i64 @_ZN7vraudio17LocklessTaskQueue8GetIndexEm(ptr noundef nonnull align 8 dereferenceable(64) %13, i64 noundef %16)
  %18 = icmp ne i64 %17, 4294967295
  br i1 %18, label %19, label %37

19:                                               ; preds = %15
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #5
  %20 = getelementptr inbounds %"class.vraudio::LocklessTaskQueue", ptr %13, i32 0, i32 2
  %21 = load i64, ptr %7, align 8, !tbaa !9
  %22 = call noundef i64 @_ZN7vraudio17LocklessTaskQueue8GetIndexEm(ptr noundef nonnull align 8 dereferenceable(64) %13, i64 noundef %21)
  %23 = call noundef nonnull align 8 dereferenceable(40) ptr @_ZNSt6vectorIN7vraudio17LocklessTaskQueue4NodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %20, i64 noundef %22) #5
  store ptr %23, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #5
  %24 = load ptr, ptr %8, align 8, !tbaa !5
  %25 = getelementptr inbounds %"struct.vraudio::LocklessTaskQueue::Node", ptr %24, i32 0, i32 1
  %26 = call noundef i64 @_ZNKSt13__atomic_baseImEcvmEv(ptr noundef nonnull align 8 dereferenceable(8) %25) #5
  store i64 %26, ptr %9, align 8, !tbaa !9
  %27 = getelementptr inbounds %"class.vraudio::LocklessTaskQueue", ptr %13, i32 0, i32 3
  %28 = load ptr, ptr %8, align 8, !tbaa !5
  %29 = getelementptr inbounds %"struct.vraudio::LocklessTaskQueue::Node", ptr %28, i32 0, i32 0
  %30 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt6vectorISt8functionIFvvEESaIS2_EE12emplace_backIJS2_EEERS2_DpOT_(ptr noundef nonnull align 8 dereferenceable(24) %27, ptr noundef nonnull align 8 dereferenceable(32) %29)
  %31 = load ptr, ptr %8, align 8, !tbaa !5
  %32 = getelementptr inbounds %"struct.vraudio::LocklessTaskQueue::Node", ptr %31, i32 0, i32 0
  %33 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt8functionIFvvEEaSEDn(ptr noundef nonnull align 8 dereferenceable(32) %32, ptr null) #5
  %34 = getelementptr inbounds %"class.vraudio::LocklessTaskQueue", ptr %13, i32 0, i32 0
  %35 = load i64, ptr %7, align 8, !tbaa !9
  call void @_ZN7vraudio17LocklessTaskQueue14PushNodeToListEPSt6atomicImEm(ptr noundef nonnull align 8 dereferenceable(64) %13, ptr noundef %34, i64 noundef %35)
  %36 = load i64, ptr %9, align 8, !tbaa !9
  store i64 %36, ptr %7, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  br label %15, !llvm.loop !13

37:                                               ; preds = %15
  %38 = load i8, ptr %6, align 1, !tbaa !11, !range !15, !noundef !16
  %39 = trunc i8 %38 to i1
  br i1 %39, label %40, label %55

40:                                               ; preds = %37
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #5
  %41 = getelementptr inbounds %"class.vraudio::LocklessTaskQueue", ptr %13, i32 0, i32 3
  call void @_ZNSt6vectorISt8functionIFvvEESaIS2_EE6rbeginEv(ptr dead_on_unwind writable sret(%"class.std::reverse_iterator") align 8 %10, ptr noundef nonnull align 8 dereferenceable(24) %41) #5
  br label %42

42:                                               ; preds = %52, %40
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  %43 = getelementptr inbounds %"class.vraudio::LocklessTaskQueue", ptr %13, i32 0, i32 3
  call void @_ZNSt6vectorISt8functionIFvvEESaIS2_EE4rendEv(ptr dead_on_unwind writable sret(%"class.std::reverse_iterator") align 8 %11, ptr noundef nonnull align 8 dereferenceable(24) %43) #5
  %44 = call noundef zeroext i1 @_ZStneIN9__gnu_cxx17__normal_iteratorIPSt8functionIFvvEESt6vectorIS4_SaIS4_EEEEEbRKSt16reverse_iteratorIT_ESE_(ptr noundef nonnull align 8 dereferenceable(8) %10, ptr noundef nonnull align 8 dereferenceable(8) %11)
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  br i1 %44, label %46, label %45

45:                                               ; preds = %42
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  br label %54

46:                                               ; preds = %42
  %47 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNKSt16reverse_iteratorIN9__gnu_cxx17__normal_iteratorIPSt8functionIFvvEESt6vectorIS4_SaIS4_EEEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %10)
  %48 = call noundef zeroext i1 @_ZStneIvJEEbRKSt8functionIFT_DpT0_EEDn(ptr noundef nonnull align 8 dereferenceable(32) %47, ptr null) #5
  br i1 %48, label %49, label %51

49:                                               ; preds = %46
  %50 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNKSt16reverse_iteratorIN9__gnu_cxx17__normal_iteratorIPSt8functionIFvvEESt6vectorIS4_SaIS4_EEEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %10)
  call void @_ZNKSt8functionIFvvEEclEv(ptr noundef nonnull align 8 dereferenceable(32) %50)
  br label %51

51:                                               ; preds = %49, %46
  br label %52

52:                                               ; preds = %51
  %53 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt16reverse_iteratorIN9__gnu_cxx17__normal_iteratorIPSt8functionIFvvEESt6vectorIS4_SaIS4_EEEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %10)
  br label %42, !llvm.loop !17

54:                                               ; preds = %45
  br label %55

55:                                               ; preds = %54, %37
  %56 = getelementptr inbounds %"class.vraudio::LocklessTaskQueue", ptr %13, i32 0, i32 3
  call void @_ZNSt6vectorISt8functionIFvvEESaIS2_EE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) %56) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  ret void
}

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorISt8functionIFvvEESaIS2_EE6rbeginEv(ptr dead_on_unwind noalias writable sret(%"class.std::reverse_iterator") align 8, ptr noundef nonnull align 8 dereferenceable(24)) #1 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorISt8functionIFvvEESaIS2_EE4rendEv(ptr dead_on_unwind noalias writable sret(%"class.std::reverse_iterator") align 8, ptr noundef nonnull align 8 dereferenceable(24)) #1 align 2

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

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

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

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

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #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 = { inlinehint 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 #4 = { 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 #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, !10, i64 0}
!10 = !{!"long", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"bool", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = !{i8 0, i8 2}
!16 = !{}
!17 = distinct !{!17, !14}


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

; 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 nounwind uwtable
declare dso_local noundef i64 @_ZN7vraudio17LocklessTaskQueue8GetIndexEm(ptr noundef nonnull align 8 dereferenceable(64), i64 noundef) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(40) ptr @_ZNSt6vectorIN7vraudio17LocklessTaskQueue4NodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7vraudio17LocklessTaskQueue14PushNodeToListEPSt6atomicImEm(ptr noundef nonnull align 8 dereferenceable(64), ptr noundef, i64 noundef) local_unnamed_addr #2 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN7vraudio17LocklessTaskQueue15ProcessTaskListEmb(ptr noundef nonnull align 8 dereferenceable(64) %0, i64 noundef %1, i1 noundef zeroext %2) local_unnamed_addr #2 align 2 {
  %4 = alloca %"class.std::reverse_iterator", align 8
  %5 = alloca %"class.std::reverse_iterator", align 8
  %6 = tail call noundef i64 @_ZN7vraudio17LocklessTaskQueue8GetIndexEm(ptr noundef nonnull align 8 dereferenceable(64) %0, i64 noundef %1)
  %.not9 = icmp eq i64 %6, 4294967295
  br i1 %.not9, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %3
  %7 = getelementptr inbounds i8, ptr %0, i64 16
  %8 = getelementptr inbounds i8, ptr %0, i64 40
  br label %9

9:                                                ; preds = %.lr.ph, %9
  %.010 = phi i64 [ %1, %.lr.ph ], [ %13, %9 ]
  %10 = tail call noundef i64 @_ZN7vraudio17LocklessTaskQueue8GetIndexEm(ptr noundef nonnull align 8 dereferenceable(64) %0, i64 noundef %.010)
  %11 = tail call noundef nonnull align 8 dereferenceable(40) ptr @_ZNSt6vectorIN7vraudio17LocklessTaskQueue4NodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %7, i64 noundef %10) #5
  %12 = getelementptr inbounds i8, ptr %11, i64 32
  %13 = tail call noundef i64 @_ZNKSt13__atomic_baseImEcvmEv(ptr noundef nonnull align 8 dereferenceable(8) %12) #5
  %14 = tail call noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt6vectorISt8functionIFvvEESaIS2_EE12emplace_backIJS2_EEERS2_DpOT_(ptr noundef nonnull align 8 dereferenceable(24) %8, ptr noundef nonnull align 8 dereferenceable(32) %11)
  %15 = tail call noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt8functionIFvvEEaSEDn(ptr noundef nonnull align 8 dereferenceable(32) %11, ptr null) #5
  tail call void @_ZN7vraudio17LocklessTaskQueue14PushNodeToListEPSt6atomicImEm(ptr noundef nonnull align 8 dereferenceable(64) %0, ptr noundef nonnull %0, i64 noundef %.010)
  %16 = tail call noundef i64 @_ZN7vraudio17LocklessTaskQueue8GetIndexEm(ptr noundef nonnull align 8 dereferenceable(64) %0, i64 noundef %13)
  %.not = icmp eq i64 %16, 4294967295
  br i1 %.not, label %._crit_edge, label %9, !llvm.loop !5

._crit_edge:                                      ; preds = %9, %3
  br i1 %2, label %17, label %27

17:                                               ; preds = %._crit_edge
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #5
  %18 = getelementptr inbounds i8, ptr %0, i64 40
  call void @_ZNSt6vectorISt8functionIFvvEESaIS2_EE6rbeginEv(ptr dead_on_unwind nonnull writable sret(%"class.std::reverse_iterator") align 8 %4, ptr noundef nonnull align 8 dereferenceable(24) %18) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #5
  call void @_ZNSt6vectorISt8functionIFvvEESaIS2_EE4rendEv(ptr dead_on_unwind nonnull writable sret(%"class.std::reverse_iterator") align 8 %5, ptr noundef nonnull align 8 dereferenceable(24) %18) #5
  %19 = call noundef zeroext i1 @_ZStneIN9__gnu_cxx17__normal_iteratorIPSt8functionIFvvEESt6vectorIS4_SaIS4_EEEEEbRKSt16reverse_iteratorIT_ESE_(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(8) %5)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #5
  br i1 %19, label %.lr.ph12, label %._crit_edge13

._crit_edge13:                                    ; preds = %24, %17
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #5
  br label %27

.lr.ph12:                                         ; preds = %17, %24
  %20 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNKSt16reverse_iteratorIN9__gnu_cxx17__normal_iteratorIPSt8functionIFvvEESt6vectorIS4_SaIS4_EEEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %4)
  %21 = call noundef zeroext i1 @_ZStneIvJEEbRKSt8functionIFT_DpT0_EEDn(ptr noundef nonnull align 8 dereferenceable(32) %20, ptr null) #5
  br i1 %21, label %22, label %24

22:                                               ; preds = %.lr.ph12
  %23 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNKSt16reverse_iteratorIN9__gnu_cxx17__normal_iteratorIPSt8functionIFvvEESt6vectorIS4_SaIS4_EEEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %4)
  call void @_ZNKSt8functionIFvvEEclEv(ptr noundef nonnull align 8 dereferenceable(32) %23)
  br label %24

24:                                               ; preds = %.lr.ph12, %22
  %25 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt16reverse_iteratorIN9__gnu_cxx17__normal_iteratorIPSt8functionIFvvEESt6vectorIS4_SaIS4_EEEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %4)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #5
  call void @_ZNSt6vectorISt8functionIFvvEESaIS2_EE4rendEv(ptr dead_on_unwind nonnull writable sret(%"class.std::reverse_iterator") align 8 %5, ptr noundef nonnull align 8 dereferenceable(24) %18) #5
  %26 = call noundef zeroext i1 @_ZStneIN9__gnu_cxx17__normal_iteratorIPSt8functionIFvvEESt6vectorIS4_SaIS4_EEEEEbRKSt16reverse_iteratorIT_ESE_(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(8) %5)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #5
  br i1 %26, label %.lr.ph12, label %._crit_edge13, !llvm.loop !7

27:                                               ; preds = %._crit_edge13, %._crit_edge
  %28 = getelementptr inbounds i8, ptr %0, i64 40
  call void @_ZNSt6vectorISt8functionIFvvEESaIS2_EE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) %28) #5
  ret void
}

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorISt8functionIFvvEESaIS2_EE6rbeginEv(ptr dead_on_unwind noalias writable sret(%"class.std::reverse_iterator") align 8, ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZStneIN9__gnu_cxx17__normal_iteratorIPSt8functionIFvvEESt6vectorIS4_SaIS4_EEEEEbRKSt16reverse_iteratorIT_ESE_(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 void @_ZNSt6vectorISt8functionIFvvEESaIS2_EE4rendEv(ptr dead_on_unwind noalias writable sret(%"class.std::reverse_iterator") align 8, ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #1 align 2

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

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

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

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

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #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 = { inlinehint 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 #4 = { 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 #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 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}
!7 = distinct !{!7, !6}


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