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

; 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::vector.195" = type { %"struct.std::_Vector_base.196" }
%"struct.std::_Vector_base.196" = type { %"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl" }
%"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl" = type { %"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl_data" }
%"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.aat::core::OrderBook" = type { %"class.aat::core::Collector", ptr, ptr, %"class.std::function", %"class.std::vector.195", %"class.std::vector.195", %"class.std::unordered_map.200", %"class.std::unordered_map.200" }
%"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::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::__shared_count" = type { ptr }
%"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" }
%"struct.std::_Deque_iterator.194" = type { ptr, 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 } }
%"class.std::unordered_map.200" = type { %"class.std::_Hashtable.201" }
%"class.std::_Hashtable.201" = 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 }

; 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 uwtable
declare dso_local noundef nonnull align 8 dereferenceable(16) ptr @_ZNKSt13unordered_mapIdSt10shared_ptrIN3aat4core10PriceLevelEESt4hashIdESt8equal_toIdESaISt4pairIKdS4_EEE2atERSA_(ptr noundef nonnull align 8 dereferenceable(56), ptr noundef nonnull align 8 dereferenceable(8)) #1 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIdSaIdEED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #2 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)) #2 align 2

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

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

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

declare noundef double @_ZNK3aat4core10PriceLevel9getVolumeEv(ptr noundef nonnull align 8 dereferenceable(304)) #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef double @_ZNSt14numeric_limitsIdE8infinityEv() #2 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK3aat4core9OrderBook5levelEm(ptr dead_on_unwind noalias writable sret(%"class.std::vector.195") align 8 %0, ptr noundef nonnull align 8 dereferenceable(512) %1, i64 noundef %2) #1 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i64, align 8
  %7 = alloca i1, align 1
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca double, align 8
  %11 = alloca double, align 8
  %12 = alloca double, align 8
  %13 = alloca double, align 8
  %14 = alloca double, align 8
  %15 = alloca double, align 8
  store ptr %0, ptr %4, align 8
  store ptr %1, ptr %5, align 8, !tbaa !5
  store i64 %2, ptr %6, align 8, !tbaa !9
  %16 = load ptr, ptr %5, align 8
  store i1 false, ptr %7, align 1
  call void @_ZNSt6vectorIdSaIdEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #4
  %17 = getelementptr inbounds %"class.aat::core::OrderBook", ptr %16, i32 0, i32 4
  %18 = call noundef i64 @_ZNKSt6vectorIdSaIdEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %17) #4
  %19 = load i64, ptr %6, align 8, !tbaa !9
  %20 = icmp ugt i64 %18, %19
  br i1 %20, label %21, label %52

21:                                               ; preds = %3
  %22 = getelementptr inbounds %"class.aat::core::OrderBook", ptr %16, i32 0, i32 4
  %23 = getelementptr inbounds %"class.aat::core::OrderBook", ptr %16, i32 0, i32 4
  %24 = call noundef i64 @_ZNKSt6vectorIdSaIdEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %23) #4
  %25 = load i64, ptr %6, align 8, !tbaa !9
  %26 = sub i64 %24, %25
  %27 = sub i64 %26, 1
  %28 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %22, i64 noundef %27) #4
  invoke void @_ZNSt6vectorIdSaIdEE9push_backERKd(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 8 dereferenceable(8) %28)
          to label %29 unwind label %44

29:                                               ; preds = %21
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #4
  %30 = getelementptr inbounds %"class.aat::core::OrderBook", ptr %16, i32 0, i32 6
  %31 = getelementptr inbounds %"class.aat::core::OrderBook", ptr %16, i32 0, i32 4
  %32 = getelementptr inbounds %"class.aat::core::OrderBook", ptr %16, i32 0, i32 4
  %33 = call noundef i64 @_ZNKSt6vectorIdSaIdEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %32) #4
  %34 = load i64, ptr %6, align 8, !tbaa !9
  %35 = sub i64 %33, %34
  %36 = sub i64 %35, 1
  %37 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %31, i64 noundef %36) #4
  %38 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNKSt13unordered_mapIdSt10shared_ptrIN3aat4core10PriceLevelEESt4hashIdESt8equal_toIdESaISt4pairIKdS4_EEE2atERSA_(ptr noundef nonnull align 8 dereferenceable(56) %30, ptr noundef nonnull align 8 dereferenceable(8) %37)
          to label %39 unwind label %48

39:                                               ; preds = %29
  %40 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3aat4core10PriceLevelELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %38) #4
  %41 = invoke noundef double @_ZNK3aat4core10PriceLevel9getVolumeEv(ptr noundef nonnull align 8 dereferenceable(304) %40)
          to label %42 unwind label %48

42:                                               ; preds = %39
  store double %41, ptr %10, align 8, !tbaa !11
  invoke void @_ZNSt6vectorIdSaIdEE9push_backEOd(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 8 dereferenceable(8) %10)
          to label %43 unwind label %48

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

44:                                               ; preds = %68, %21
  %45 = landingpad { ptr, i32 }
          cleanup
  %46 = extractvalue { ptr, i32 } %45, 0
  store ptr %46, ptr %8, align 8
  %47 = extractvalue { ptr, i32 } %45, 1
  store i32 %47, ptr %9, align 4
  br label %103

48:                                               ; preds = %42, %39, %29
  %49 = landingpad { ptr, i32 }
          cleanup
  %50 = extractvalue { ptr, i32 } %49, 0
  store ptr %50, ptr %8, align 8
  %51 = extractvalue { ptr, i32 } %49, 1
  store i32 %51, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #4
  br label %103

52:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #4
  store double 0.000000e+00, ptr %11, align 8, !tbaa !11
  invoke void @_ZNSt6vectorIdSaIdEE9push_backEOd(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 8 dereferenceable(8) %11)
          to label %53 unwind label %55

53:                                               ; preds = %52
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #4
  store double 0.000000e+00, ptr %12, align 8, !tbaa !11
  invoke void @_ZNSt6vectorIdSaIdEE9push_backEOd(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 8 dereferenceable(8) %12)
          to label %54 unwind label %59

54:                                               ; preds = %53
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #4
  br label %63

55:                                               ; preds = %52
  %56 = landingpad { ptr, i32 }
          cleanup
  %57 = extractvalue { ptr, i32 } %56, 0
  store ptr %57, ptr %8, align 8
  %58 = extractvalue { ptr, i32 } %56, 1
  store i32 %58, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #4
  br label %103

59:                                               ; preds = %53
  %60 = landingpad { ptr, i32 }
          cleanup
  %61 = extractvalue { ptr, i32 } %60, 0
  store ptr %61, ptr %8, align 8
  %62 = extractvalue { ptr, i32 } %60, 1
  store i32 %62, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #4
  br label %103

63:                                               ; preds = %54, %43
  %64 = getelementptr inbounds %"class.aat::core::OrderBook", ptr %16, i32 0, i32 5
  %65 = call noundef i64 @_ZNKSt6vectorIdSaIdEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %64) #4
  %66 = load i64, ptr %6, align 8, !tbaa !9
  %67 = icmp ugt i64 %65, %66
  br i1 %67, label %68, label %87

68:                                               ; preds = %63
  %69 = getelementptr inbounds %"class.aat::core::OrderBook", ptr %16, i32 0, i32 5
  %70 = load i64, ptr %6, align 8, !tbaa !9
  %71 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %69, i64 noundef %70) #4
  invoke void @_ZNSt6vectorIdSaIdEE9push_backERKd(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 8 dereferenceable(8) %71)
          to label %72 unwind label %44

72:                                               ; preds = %68
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #4
  %73 = getelementptr inbounds %"class.aat::core::OrderBook", ptr %16, i32 0, i32 7
  %74 = getelementptr inbounds %"class.aat::core::OrderBook", ptr %16, i32 0, i32 5
  %75 = load i64, ptr %6, align 8, !tbaa !9
  %76 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %74, i64 noundef %75) #4
  %77 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNKSt13unordered_mapIdSt10shared_ptrIN3aat4core10PriceLevelEESt4hashIdESt8equal_toIdESaISt4pairIKdS4_EEE2atERSA_(ptr noundef nonnull align 8 dereferenceable(56) %73, ptr noundef nonnull align 8 dereferenceable(8) %76)
          to label %78 unwind label %83

78:                                               ; preds = %72
  %79 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3aat4core10PriceLevelELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %77) #4
  %80 = invoke noundef double @_ZNK3aat4core10PriceLevel9getVolumeEv(ptr noundef nonnull align 8 dereferenceable(304) %79)
          to label %81 unwind label %83

81:                                               ; preds = %78
  store double %80, ptr %13, align 8, !tbaa !11
  invoke void @_ZNSt6vectorIdSaIdEE9push_backEOd(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 8 dereferenceable(8) %13)
          to label %82 unwind label %83

82:                                               ; preds = %81
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #4
  br label %99

83:                                               ; preds = %81, %78, %72
  %84 = landingpad { ptr, i32 }
          cleanup
  %85 = extractvalue { ptr, i32 } %84, 0
  store ptr %85, ptr %8, align 8
  %86 = extractvalue { ptr, i32 } %84, 1
  store i32 %86, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #4
  br label %103

87:                                               ; preds = %63
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #4
  %88 = call noundef double @_ZNSt14numeric_limitsIdE8infinityEv() #4
  store double %88, ptr %14, align 8, !tbaa !11
  invoke void @_ZNSt6vectorIdSaIdEE9push_backEOd(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 8 dereferenceable(8) %14)
          to label %89 unwind label %91

89:                                               ; preds = %87
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #4
  store double 0.000000e+00, ptr %15, align 8, !tbaa !11
  invoke void @_ZNSt6vectorIdSaIdEE9push_backEOd(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 8 dereferenceable(8) %15)
          to label %90 unwind label %95

90:                                               ; preds = %89
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #4
  br label %99

91:                                               ; preds = %87
  %92 = landingpad { ptr, i32 }
          cleanup
  %93 = extractvalue { ptr, i32 } %92, 0
  store ptr %93, ptr %8, align 8
  %94 = extractvalue { ptr, i32 } %92, 1
  store i32 %94, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #4
  br label %103

95:                                               ; preds = %89
  %96 = landingpad { ptr, i32 }
          cleanup
  %97 = extractvalue { ptr, i32 } %96, 0
  store ptr %97, ptr %8, align 8
  %98 = extractvalue { ptr, i32 } %96, 1
  store i32 %98, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #4
  br label %103

99:                                               ; preds = %90, %82
  store i1 true, ptr %7, align 1
  %100 = load i1, ptr %7, align 1
  br i1 %100, label %102, label %101

101:                                              ; preds = %99
  call void @_ZNSt6vectorIdSaIdEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #4
  br label %102

102:                                              ; preds = %101, %99
  ret void

103:                                              ; preds = %95, %91, %83, %59, %55, %48, %44
  call void @_ZNSt6vectorIdSaIdEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #4
  br label %104

104:                                              ; preds = %103
  %105 = load ptr, ptr %8, align 8
  %106 = load i32, ptr %9, align 4
  %107 = insertvalue { ptr, i32 } poison, ptr %105, 0
  %108 = insertvalue { ptr, i32 } %107, i32 %106, 1
  resume { ptr, i32 } %108
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #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 = { "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 = !{!10, !10, i64 0}
!10 = !{!"long", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"double", !7, i64 0}


; 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::vector.195" = type { %"struct.std::_Vector_base.196" }
%"struct.std::_Vector_base.196" = type { %"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl" }
%"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl" = type { %"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl_data" }
%"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl_data" = type { ptr, ptr, ptr }

; 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 uwtable
declare dso_local noundef nonnull align 8 dereferenceable(16) ptr @_ZNKSt13unordered_mapIdSt10shared_ptrIN3aat4core10PriceLevelEESt4hashIdESt8equal_toIdESaISt4pairIKdS4_EEE2atERSA_(ptr noundef nonnull align 8 dereferenceable(56), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #1 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIdSaIdEED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #2 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 #2 align 2

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

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

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

declare noundef double @_ZNK3aat4core10PriceLevel9getVolumeEv(ptr noundef nonnull align 8 dereferenceable(304)) local_unnamed_addr #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef double @_ZNSt14numeric_limitsIdE8infinityEv() local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK3aat4core9OrderBook5levelEm(ptr dead_on_unwind noalias nonnull writable sret(%"class.std::vector.195") align 8 %0, ptr noundef nonnull align 8 dereferenceable(512) %1, i64 noundef %2) local_unnamed_addr #1 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca double, align 8
  %5 = alloca double, align 8
  %6 = alloca double, align 8
  %7 = alloca double, align 8
  %8 = alloca double, align 8
  %9 = alloca double, align 8
  tail call void @_ZNSt6vectorIdSaIdEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #4
  %10 = getelementptr inbounds i8, ptr %1, i64 352
  %11 = tail call noundef i64 @_ZNKSt6vectorIdSaIdEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %10) #4
  %12 = icmp ugt i64 %11, %2
  br i1 %12, label %13, label %33

13:                                               ; preds = %3
  %14 = tail call noundef i64 @_ZNKSt6vectorIdSaIdEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %10) #4
  %15 = xor i64 %2, -1
  %16 = add i64 %14, %15
  %17 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %10, i64 noundef %16) #4
  invoke void @_ZNSt6vectorIdSaIdEE9push_backERKd(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 8 dereferenceable(8) %17)
          to label %18 unwind label %29

18:                                               ; preds = %13
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #4
  %19 = getelementptr inbounds i8, ptr %1, i64 400
  %20 = tail call noundef i64 @_ZNKSt6vectorIdSaIdEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %10) #4
  %21 = add i64 %20, %15
  %22 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %10, i64 noundef %21) #4
  %23 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNKSt13unordered_mapIdSt10shared_ptrIN3aat4core10PriceLevelEESt4hashIdESt8equal_toIdESaISt4pairIKdS4_EEE2atERSA_(ptr noundef nonnull align 8 dereferenceable(56) %19, ptr noundef nonnull align 8 dereferenceable(8) %22)
          to label %24 unwind label %31

24:                                               ; preds = %18
  %25 = tail call noundef ptr @_ZNKSt19__shared_ptr_accessIN3aat4core10PriceLevelELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %23) #4
  %26 = invoke noundef double @_ZNK3aat4core10PriceLevel9getVolumeEv(ptr noundef nonnull align 8 dereferenceable(304) %25)
          to label %27 unwind label %31

27:                                               ; preds = %24
  store double %26, ptr %4, align 8, !tbaa !5
  invoke void @_ZNSt6vectorIdSaIdEE9push_backEOd(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 8 dereferenceable(8) %4)
          to label %28 unwind label %31

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

29:                                               ; preds = %44, %13
  %30 = landingpad { ptr, i32 }
          cleanup
  br label %66

31:                                               ; preds = %27, %24, %18
  %32 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #4
  br label %66

33:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #4
  store double 0.000000e+00, ptr %5, align 8, !tbaa !5
  invoke void @_ZNSt6vectorIdSaIdEE9push_backEOd(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 8 dereferenceable(8) %5)
          to label %34 unwind label %36

34:                                               ; preds = %33
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #4
  store double 0.000000e+00, ptr %6, align 8, !tbaa !5
  invoke void @_ZNSt6vectorIdSaIdEE9push_backEOd(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 8 dereferenceable(8) %6)
          to label %35 unwind label %38

35:                                               ; preds = %34
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #4
  br label %40

36:                                               ; preds = %33
  %37 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #4
  br label %66

38:                                               ; preds = %34
  %39 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #4
  br label %66

40:                                               ; preds = %35, %28
  %41 = getelementptr inbounds i8, ptr %1, i64 376
  %42 = call noundef i64 @_ZNKSt6vectorIdSaIdEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %41) #4
  %43 = icmp ugt i64 %42, %2
  br i1 %43, label %44, label %57

44:                                               ; preds = %40
  %45 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %41, i64 noundef %2) #4
  invoke void @_ZNSt6vectorIdSaIdEE9push_backERKd(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 8 dereferenceable(8) %45)
          to label %46 unwind label %29

46:                                               ; preds = %44
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #4
  %47 = getelementptr inbounds i8, ptr %1, i64 456
  %48 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %41, i64 noundef %2) #4
  %49 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNKSt13unordered_mapIdSt10shared_ptrIN3aat4core10PriceLevelEESt4hashIdESt8equal_toIdESaISt4pairIKdS4_EEE2atERSA_(ptr noundef nonnull align 8 dereferenceable(56) %47, ptr noundef nonnull align 8 dereferenceable(8) %48)
          to label %50 unwind label %55

50:                                               ; preds = %46
  %51 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3aat4core10PriceLevelELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %49) #4
  %52 = invoke noundef double @_ZNK3aat4core10PriceLevel9getVolumeEv(ptr noundef nonnull align 8 dereferenceable(304) %51)
          to label %53 unwind label %55

53:                                               ; preds = %50
  store double %52, ptr %7, align 8, !tbaa !5
  invoke void @_ZNSt6vectorIdSaIdEE9push_backEOd(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 8 dereferenceable(8) %7)
          to label %54 unwind label %55

54:                                               ; preds = %53
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #4
  br label %65

55:                                               ; preds = %53, %50, %46
  %56 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #4
  br label %66

57:                                               ; preds = %40
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #4
  %58 = call noundef double @_ZNSt14numeric_limitsIdE8infinityEv() #4
  store double %58, ptr %8, align 8, !tbaa !5
  invoke void @_ZNSt6vectorIdSaIdEE9push_backEOd(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 8 dereferenceable(8) %8)
          to label %59 unwind label %61

59:                                               ; preds = %57
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #4
  store double 0.000000e+00, ptr %9, align 8, !tbaa !5
  invoke void @_ZNSt6vectorIdSaIdEE9push_backEOd(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 8 dereferenceable(8) %9)
          to label %60 unwind label %63

60:                                               ; preds = %59
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #4
  br label %65

61:                                               ; preds = %57
  %62 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #4
  br label %66

63:                                               ; preds = %59
  %64 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #4
  br label %66

65:                                               ; preds = %54, %60
  ret void

66:                                               ; preds = %63, %61, %55, %38, %36, %31, %29
  %.pn = phi { ptr, i32 } [ %56, %55 ], [ %30, %29 ], [ %64, %63 ], [ %62, %61 ], [ %32, %31 ], [ %39, %38 ], [ %37, %36 ]
  call void @_ZNSt6vectorIdSaIdEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #4
  resume { ptr, i32 } %.pn
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) 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 = { "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 = !{!"double", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}


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