; LLVM IR from AsyncAlgoTrading/aat :: aat/cpp/src/core/order_book/collector.ll (ZN3aat4core9Collector6commitEv)

; 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::shared_ptr.195" = type { %"class.std::__shared_ptr.196" }
%"class.std::__shared_ptr.196" = type { ptr, %"class.std::__shared_count" }
%"class.std::__shared_count" = type { ptr }
%"struct.std::_Deque_iterator.194" = type { ptr, ptr, ptr, ptr }
%"class.std::shared_ptr.206" = type { %"class.std::__shared_ptr.207" }
%"class.std::__shared_ptr.207" = type { ptr, %"class.std::__shared_count" }
%"class.aat::core::Collector" = type { %"class.std::function", double, double, %"class.std::deque", %"class.std::shared_ptr", %"class.std::deque.183", %"class.std::deque.189" }
%"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 } }
%"class.std::deque" = type { %"class.std::_Deque_base" }
%"class.std::_Deque_base" = type { %"struct.std::_Deque_base<std::shared_ptr<aat::core::Event>, std::allocator<std::shared_ptr<aat::core::Event>>>::_Deque_impl" }
%"struct.std::_Deque_base<std::shared_ptr<aat::core::Event>, std::allocator<std::shared_ptr<aat::core::Event>>>::_Deque_impl" = type { %"struct.std::_Deque_base<std::shared_ptr<aat::core::Event>, std::allocator<std::shared_ptr<aat::core::Event>>>::_Deque_impl_data" }
%"struct.std::_Deque_base<std::shared_ptr<aat::core::Event>, std::allocator<std::shared_ptr<aat::core::Event>>>::_Deque_impl_data" = type { ptr, i64, %"struct.std::_Deque_iterator", %"struct.std::_Deque_iterator" }
%"struct.std::_Deque_iterator" = type { ptr, ptr, ptr, ptr }
%"class.std::shared_ptr" = type { %"class.std::__shared_ptr" }
%"class.std::__shared_ptr" = type { ptr, %"class.std::__shared_count" }
%"class.std::deque.183" = type { %"class.std::_Deque_base.184" }
%"class.std::_Deque_base.184" = type { %"struct.std::_Deque_base<std::shared_ptr<aat::core::Order>, std::allocator<std::shared_ptr<aat::core::Order>>>::_Deque_impl" }
%"struct.std::_Deque_base<std::shared_ptr<aat::core::Order>, std::allocator<std::shared_ptr<aat::core::Order>>>::_Deque_impl" = type { %"struct.std::_Deque_base<std::shared_ptr<aat::core::Order>, std::allocator<std::shared_ptr<aat::core::Order>>>::_Deque_impl_data" }
%"struct.std::_Deque_base<std::shared_ptr<aat::core::Order>, std::allocator<std::shared_ptr<aat::core::Order>>>::_Deque_impl_data" = type { ptr, i64, %"struct.std::_Deque_iterator.188", %"struct.std::_Deque_iterator.188" }
%"struct.std::_Deque_iterator.188" = type { ptr, ptr, ptr, ptr }
%"class.std::deque.189" = type { %"class.std::_Deque_base.190" }
%"class.std::_Deque_base.190" = type { %"struct.std::_Deque_base<std::shared_ptr<aat::core::PriceLevel>, std::allocator<std::shared_ptr<aat::core::PriceLevel>>>::_Deque_impl" }
%"struct.std::_Deque_base<std::shared_ptr<aat::core::PriceLevel>, std::allocator<std::shared_ptr<aat::core::PriceLevel>>>::_Deque_impl" = type { %"struct.std::_Deque_base<std::shared_ptr<aat::core::PriceLevel>, std::allocator<std::shared_ptr<aat::core::PriceLevel>>>::_Deque_impl_data" }
%"struct.std::_Deque_base<std::shared_ptr<aat::core::PriceLevel>, std::allocator<std::shared_ptr<aat::core::PriceLevel>>>::_Deque_impl_data" = type { ptr, i64, %"struct.std::_Deque_iterator.194", %"struct.std::_Deque_iterator.194" }

; 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: mustprogress nounwind uwtable
declare dso_local void @_ZN3aat4core9Collector5resetEv(ptr noundef nonnull align 8 dereferenceable(304)) #1 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3aat4core9Collector6commitEv(ptr noundef nonnull align 8 dereferenceable(304) %0) #2 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca ptr, align 8
  %3 = alloca %"class.std::shared_ptr.195", align 8
  %4 = alloca %"class.std::shared_ptr.195", align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca %"struct.std::_Deque_iterator.194", align 8
  %9 = alloca %"struct.std::_Deque_iterator.194", align 8
  %10 = alloca %"class.std::shared_ptr.206", align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  %11 = load ptr, ptr %2, align 8
  br label %12

12:                                               ; preds = %29, %1
  %13 = getelementptr inbounds %"class.aat::core::Collector", ptr %11, i32 0, i32 3
  %14 = call noundef i64 @_ZNKSt5dequeISt10shared_ptrIN3aat4core5EventEESaIS4_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(80) %13) #4
  %15 = icmp ne i64 %14, 0
  br i1 %15, label %16, label %30

16:                                               ; preds = %12
  call void @llvm.lifetime.start.p0(i64 16, ptr %3) #4
  %17 = getelementptr inbounds %"class.aat::core::Collector", ptr %11, i32 0, i32 3
  %18 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt5dequeISt10shared_ptrIN3aat4core5EventEESaIS4_EE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) %17) #4
  call void @_ZNSt10shared_ptrIN3aat4core5EventEEC2ERKS3_(ptr noundef nonnull align 8 dereferenceable(16) %3, ptr noundef nonnull align 8 dereferenceable(16) %18) #4
  %19 = getelementptr inbounds %"class.aat::core::Collector", ptr %11, i32 0, i32 3
  call void @_ZNSt5dequeISt10shared_ptrIN3aat4core5EventEESaIS4_EE9pop_frontEv(ptr noundef nonnull align 8 dereferenceable(80) %19) #4
  %20 = getelementptr inbounds %"class.aat::core::Collector", ptr %11, i32 0, i32 0
  %21 = call noundef zeroext i1 @_ZNKSt8functionIFvSt10shared_ptrIN3aat4core5EventEEEEcvbEv(ptr noundef nonnull align 8 dereferenceable(32) %20) #4
  br i1 %21, label %22, label %29

22:                                               ; preds = %16
  %23 = getelementptr inbounds %"class.aat::core::Collector", ptr %11, i32 0, i32 0
  call void @_ZNSt10shared_ptrIN3aat4core5EventEEC2ERKS3_(ptr noundef nonnull align 8 dereferenceable(16) %4, ptr noundef nonnull align 8 dereferenceable(16) %3) #4
  invoke void @_ZNKSt8functionIFvSt10shared_ptrIN3aat4core5EventEEEEclES4_(ptr noundef nonnull align 8 dereferenceable(32) %23, ptr noundef %4)
          to label %24 unwind label %25

24:                                               ; preds = %22
  call void @_ZNSt12__shared_ptrIN3aat4core5EventELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %4) #4
  br label %29

25:                                               ; preds = %22
  %26 = landingpad { ptr, i32 }
          cleanup
  %27 = extractvalue { ptr, i32 } %26, 0
  store ptr %27, ptr %5, align 8
  %28 = extractvalue { ptr, i32 } %26, 1
  store i32 %28, ptr %6, align 4
  call void @_ZNSt12__shared_ptrIN3aat4core5EventELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %4) #4
  call void @_ZNSt12__shared_ptrIN3aat4core5EventELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %3) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr %3) #4
  br label %48

29:                                               ; preds = %24, %16
  call void @_ZNSt12__shared_ptrIN3aat4core5EventELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %3) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr %3) #4
  br label %12, !llvm.loop !9

30:                                               ; preds = %12
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #4
  %31 = getelementptr inbounds %"class.aat::core::Collector", ptr %11, i32 0, i32 6
  store ptr %31, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 32, ptr %8) #4
  %32 = load ptr, ptr %7, align 8, !tbaa !5
  call void @_ZNSt5dequeISt10shared_ptrIN3aat4core10PriceLevelEESaIS4_EE5beginEv(ptr dead_on_unwind writable sret(%"struct.std::_Deque_iterator.194") align 8 %8, ptr noundef nonnull align 8 dereferenceable(80) %32) #4
  call void @llvm.lifetime.start.p0(i64 32, ptr %9) #4
  %33 = load ptr, ptr %7, align 8, !tbaa !5
  call void @_ZNSt5dequeISt10shared_ptrIN3aat4core10PriceLevelEESaIS4_EE3endEv(ptr dead_on_unwind writable sret(%"struct.std::_Deque_iterator.194") align 8 %9, ptr noundef nonnull align 8 dereferenceable(80) %33) #4
  br label %34

34:                                               ; preds = %41, %30
  %35 = call noundef zeroext i1 @_ZStneRKSt15_Deque_iteratorISt10shared_ptrIN3aat4core10PriceLevelEERS4_PS4_ES9_(ptr noundef nonnull align 8 dereferenceable(32) %8, ptr noundef nonnull align 8 dereferenceable(32) %9) #4
  br i1 %35, label %37, label %36

36:                                               ; preds = %34
  call void @llvm.lifetime.end.p0(i64 32, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #4
  br label %47

37:                                               ; preds = %34
  call void @llvm.lifetime.start.p0(i64 16, ptr %10) #4
  %38 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNKSt15_Deque_iteratorISt10shared_ptrIN3aat4core10PriceLevelEERS4_PS4_EdeEv(ptr noundef nonnull align 8 dereferenceable(32) %8) #4
  call void @_ZNSt10shared_ptrIN3aat4core10PriceLevelEEC2ERKS3_(ptr noundef nonnull align 8 dereferenceable(16) %10, ptr noundef nonnull align 8 dereferenceable(16) %38) #4
  %39 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3aat4core10PriceLevelELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %10) #4
  invoke void @_ZN3aat4core10PriceLevel6commitEv(ptr noundef nonnull align 8 dereferenceable(304) %39)
          to label %40 unwind label %43

40:                                               ; preds = %37
  call void @_ZNSt12__shared_ptrIN3aat4core10PriceLevelELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %10) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr %10) #4
  br label %41

41:                                               ; preds = %40
  %42 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt15_Deque_iteratorISt10shared_ptrIN3aat4core10PriceLevelEERS4_PS4_EppEv(ptr noundef nonnull align 8 dereferenceable(32) %8) #4
  br label %34

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

47:                                               ; preds = %36
  call void @_ZN3aat4core9Collector5resetEv(ptr noundef nonnull align 8 dereferenceable(304) %11)
  ret void

48:                                               ; preds = %43, %25
  %49 = load ptr, ptr %5, align 8
  %50 = load i32, ptr %6, align 4
  %51 = insertvalue { ptr, i32 } poison, ptr %49, 0
  %52 = insertvalue { ptr, i32 } %51, i32 %50, 1
  resume { ptr, i32 } %52
}

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

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

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt5dequeISt10shared_ptrIN3aat4core10PriceLevelEESaIS4_EE5beginEv(ptr dead_on_unwind noalias writable sret(%"struct.std::_Deque_iterator.194") align 8, ptr noundef nonnull align 8 dereferenceable(80)) #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt5dequeISt10shared_ptrIN3aat4core10PriceLevelEESaIS4_EE3endEv(ptr dead_on_unwind noalias writable sret(%"struct.std::_Deque_iterator.194") align 8, ptr noundef nonnull align 8 dereferenceable(80)) #1 align 2

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

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

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

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

declare void @_ZN3aat4core10PriceLevel6commitEv(ptr noundef nonnull align 8 dereferenceable(304)) #3

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt15_Deque_iteratorISt10shared_ptrIN3aat4core10PriceLevelEERS4_PS4_EppEv(ptr noundef nonnull align 8 dereferenceable(32)) #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 = { "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 = { 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 = distinct !{!9, !10}
!10 = !{!"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.std::shared_ptr.195" = type { %"class.std::__shared_ptr.196" }
%"class.std::__shared_ptr.196" = type { ptr, %"class.std::__shared_count" }
%"class.std::__shared_count" = type { ptr }
%"struct.std::_Deque_iterator.194" = type { ptr, ptr, ptr, ptr }
%"class.std::shared_ptr.206" = type { %"class.std::__shared_ptr.207" }
%"class.std::__shared_ptr.207" = type { ptr, %"class.std::__shared_count" }

; 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: mustprogress nounwind uwtable
declare dso_local void @_ZN3aat4core9Collector5resetEv(ptr noundef nonnull align 8 dereferenceable(304)) local_unnamed_addr #1 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3aat4core9Collector6commitEv(ptr noundef nonnull align 8 dereferenceable(304) %0) local_unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca %"class.std::shared_ptr.195", align 8
  %3 = alloca %"class.std::shared_ptr.195", align 8
  %4 = alloca %"struct.std::_Deque_iterator.194", align 8
  %5 = alloca %"struct.std::_Deque_iterator.194", align 8
  %6 = alloca %"class.std::shared_ptr.206", align 8
  %7 = getelementptr inbounds i8, ptr %0, i64 48
  %8 = tail call noundef i64 @_ZNKSt5dequeISt10shared_ptrIN3aat4core5EventEESaIS4_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(80) %7) #4
  %.not6 = icmp eq i64 %8, 0
  br i1 %.not6, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %1, %15
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %2) #4
  %9 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt5dequeISt10shared_ptrIN3aat4core5EventEESaIS4_EE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) %7) #4
  call void @_ZNSt10shared_ptrIN3aat4core5EventEEC2ERKS3_(ptr noundef nonnull align 8 dereferenceable(16) %2, ptr noundef nonnull align 8 dereferenceable(16) %9) #4
  call void @_ZNSt5dequeISt10shared_ptrIN3aat4core5EventEESaIS4_EE9pop_frontEv(ptr noundef nonnull align 8 dereferenceable(80) %7) #4
  %10 = call noundef zeroext i1 @_ZNKSt8functionIFvSt10shared_ptrIN3aat4core5EventEEEEcvbEv(ptr noundef nonnull align 8 dereferenceable(32) %0) #4
  br i1 %10, label %11, label %15

11:                                               ; preds = %.lr.ph
  call void @_ZNSt10shared_ptrIN3aat4core5EventEEC2ERKS3_(ptr noundef nonnull align 8 dereferenceable(16) %3, ptr noundef nonnull align 8 dereferenceable(16) %2) #4
  invoke void @_ZNKSt8functionIFvSt10shared_ptrIN3aat4core5EventEEEEclES4_(ptr noundef nonnull align 8 dereferenceable(32) %0, ptr noundef nonnull %3)
          to label %12 unwind label %13

12:                                               ; preds = %11
  call void @_ZNSt12__shared_ptrIN3aat4core5EventELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %3) #4
  br label %15

13:                                               ; preds = %11
  %14 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt12__shared_ptrIN3aat4core5EventELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %3) #4
  call void @_ZNSt12__shared_ptrIN3aat4core5EventELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %2) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %2) #4
  br label %26

15:                                               ; preds = %12, %.lr.ph
  call void @_ZNSt12__shared_ptrIN3aat4core5EventELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %2) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %2) #4
  %16 = call noundef i64 @_ZNKSt5dequeISt10shared_ptrIN3aat4core5EventEESaIS4_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(80) %7) #4
  %.not = icmp eq i64 %16, 0
  br i1 %.not, label %._crit_edge, label %.lr.ph, !llvm.loop !5

._crit_edge:                                      ; preds = %15, %1
  %17 = getelementptr inbounds i8, ptr %0, i64 224
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %4) #4
  call void @_ZNSt5dequeISt10shared_ptrIN3aat4core10PriceLevelEESaIS4_EE5beginEv(ptr dead_on_unwind nonnull writable sret(%"struct.std::_Deque_iterator.194") align 8 %4, ptr noundef nonnull align 8 dereferenceable(80) %17) #4
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %5) #4
  call void @_ZNSt5dequeISt10shared_ptrIN3aat4core10PriceLevelEESaIS4_EE3endEv(ptr dead_on_unwind nonnull writable sret(%"struct.std::_Deque_iterator.194") align 8 %5, ptr noundef nonnull align 8 dereferenceable(80) %17) #4
  %18 = call noundef zeroext i1 @_ZStneRKSt15_Deque_iteratorISt10shared_ptrIN3aat4core10PriceLevelEERS4_PS4_ES9_(ptr noundef nonnull align 8 dereferenceable(32) %4, ptr noundef nonnull align 8 dereferenceable(32) %5) #4
  br i1 %18, label %.lr.ph8, label %._crit_edge9

._crit_edge9:                                     ; preds = %21, %._crit_edge
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %4) #4
  call void @_ZN3aat4core9Collector5resetEv(ptr noundef nonnull align 8 dereferenceable(304) %0)
  ret void

.lr.ph8:                                          ; preds = %._crit_edge, %21
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %6) #4
  %19 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNKSt15_Deque_iteratorISt10shared_ptrIN3aat4core10PriceLevelEERS4_PS4_EdeEv(ptr noundef nonnull align 8 dereferenceable(32) %4) #4
  call void @_ZNSt10shared_ptrIN3aat4core10PriceLevelEEC2ERKS3_(ptr noundef nonnull align 8 dereferenceable(16) %6, ptr noundef nonnull align 8 dereferenceable(16) %19) #4
  %20 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3aat4core10PriceLevelELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %6) #4
  invoke void @_ZN3aat4core10PriceLevel6commitEv(ptr noundef nonnull align 8 dereferenceable(304) %20)
          to label %21 unwind label %24

21:                                               ; preds = %.lr.ph8
  call void @_ZNSt12__shared_ptrIN3aat4core10PriceLevelELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %6) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #4
  %22 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt15_Deque_iteratorISt10shared_ptrIN3aat4core10PriceLevelEERS4_PS4_EppEv(ptr noundef nonnull align 8 dereferenceable(32) %4) #4
  %23 = call noundef zeroext i1 @_ZStneRKSt15_Deque_iteratorISt10shared_ptrIN3aat4core10PriceLevelEERS4_PS4_ES9_(ptr noundef nonnull align 8 dereferenceable(32) %4, ptr noundef nonnull align 8 dereferenceable(32) %5) #4
  br i1 %23, label %.lr.ph8, label %._crit_edge9

24:                                               ; preds = %.lr.ph8
  %25 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt12__shared_ptrIN3aat4core10PriceLevelELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %6) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %4) #4
  br label %26

26:                                               ; preds = %24, %13
  %.pn = phi { ptr, i32 } [ %14, %13 ], [ %25, %24 ]
  resume { ptr, i32 } %.pn
}

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

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

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt5dequeISt10shared_ptrIN3aat4core10PriceLevelEESaIS4_EE5beginEv(ptr dead_on_unwind noalias writable sret(%"struct.std::_Deque_iterator.194") align 8, ptr noundef nonnull align 8 dereferenceable(80)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt5dequeISt10shared_ptrIN3aat4core10PriceLevelEESaIS4_EE3endEv(ptr dead_on_unwind noalias writable sret(%"struct.std::_Deque_iterator.194") align 8, ptr noundef nonnull align 8 dereferenceable(80)) local_unnamed_addr #1 align 2

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

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

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

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

declare void @_ZN3aat4core10PriceLevel6commitEv(ptr noundef nonnull align 8 dereferenceable(304)) local_unnamed_addr #3

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt15_Deque_iteratorISt10shared_ptrIN3aat4core10PriceLevelEERS4_PS4_EppEv(ptr noundef nonnull align 8 dereferenceable(32)) 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 = { "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 = { 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"}


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