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

; 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.238" = type { %"struct.std::_Vector_base.239" }
%"struct.std::_Vector_base.239" = type { %"struct.std::_Vector_base<std::shared_ptr<aat::core::PriceLevel>, std::allocator<std::shared_ptr<aat::core::PriceLevel>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::shared_ptr<aat::core::PriceLevel>, std::allocator<std::shared_ptr<aat::core::PriceLevel>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::shared_ptr<aat::core::PriceLevel>, std::allocator<std::shared_ptr<aat::core::PriceLevel>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::shared_ptr<aat::core::PriceLevel>, std::allocator<std::shared_ptr<aat::core::PriceLevel>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.__gnu_cxx::__normal_iterator.234" = type { ptr }
%"class.std::shared_ptr.220" = type { %"class.std::__shared_ptr.221" }
%"class.std::__shared_ptr.221" = type { ptr, %"class.std::__shared_count" }
%"class.std::__shared_count" = type { 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::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::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.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 uwtable
define dso_local void @_ZNK3aat4core9OrderBook5levelEd(ptr dead_on_unwind noalias writable sret(%"class.std::vector.238") align 8 %0, ptr noundef nonnull align 8 dereferenceable(512) %1, double noundef %2) #1 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca double, align 8
  %7 = alloca i1, align 1
  %8 = alloca %"class.__gnu_cxx::__normal_iterator.234", align 8
  %9 = alloca %"class.__gnu_cxx::__normal_iterator.234", align 8
  %10 = alloca %"class.__gnu_cxx::__normal_iterator.234", align 8
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  %13 = alloca %"class.__gnu_cxx::__normal_iterator.234", align 8
  %14 = alloca %"class.std::shared_ptr.220", align 8
  %15 = alloca %"class.__gnu_cxx::__normal_iterator.234", align 8
  %16 = alloca %"class.__gnu_cxx::__normal_iterator.234", align 8
  %17 = alloca %"class.__gnu_cxx::__normal_iterator.234", align 8
  %18 = alloca %"class.__gnu_cxx::__normal_iterator.234", align 8
  %19 = alloca %"class.std::shared_ptr.220", align 8
  store ptr %0, ptr %4, align 8
  store ptr %1, ptr %5, align 8, !tbaa !5
  store double %2, ptr %6, align 8, !tbaa !9
  %20 = load ptr, ptr %5, align 8
  store i1 false, ptr %7, align 1
  call void @_ZNSt6vectorISt10shared_ptrIN3aat4core10PriceLevelEESaIS4_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #5
  %21 = getelementptr inbounds %"class.aat::core::OrderBook", ptr %20, i32 0, i32 4
  %22 = call ptr @_ZNKSt6vectorIdSaIdEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %21) #5
  %23 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.234", ptr %9, i32 0, i32 0
  store ptr %22, ptr %23, align 8
  %24 = getelementptr inbounds %"class.aat::core::OrderBook", ptr %20, i32 0, i32 4
  %25 = call ptr @_ZNKSt6vectorIdSaIdEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %24) #5
  %26 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.234", ptr %10, i32 0, i32 0
  store ptr %25, ptr %26, align 8
  %27 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.234", ptr %9, i32 0, i32 0
  %28 = load ptr, ptr %27, align 8
  %29 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.234", ptr %10, i32 0, i32 0
  %30 = load ptr, ptr %29, align 8
  %31 = invoke ptr @_ZSt4findIN9__gnu_cxx17__normal_iteratorIPKdSt6vectorIdSaIdEEEEdET_S8_S8_RKT0_(ptr %28, ptr %30, ptr noundef nonnull align 8 dereferenceable(8) %6)
          to label %32 unwind label %43

32:                                               ; preds = %3
  %33 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.234", ptr %8, i32 0, i32 0
  store ptr %31, ptr %33, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #5
  %34 = getelementptr inbounds %"class.aat::core::OrderBook", ptr %20, i32 0, i32 4
  %35 = call ptr @_ZNKSt6vectorIdSaIdEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %34) #5
  %36 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.234", ptr %13, i32 0, i32 0
  store ptr %35, ptr %36, align 8
  %37 = call noundef zeroext i1 @_ZN9__gnu_cxxeqIPKdSt6vectorIdSaIdEEEEbRKNS_17__normal_iteratorIT_T0_EESB_(ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull align 8 dereferenceable(8) %13) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  br i1 %37, label %38, label %51

38:                                               ; preds = %32
  %39 = getelementptr inbounds %"class.aat::core::OrderBook", ptr %20, i32 0, i32 6
  %40 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNKSt13unordered_mapIdSt10shared_ptrIN3aat4core10PriceLevelEESt4hashIdESt8equal_toIdESaISt4pairIKdS4_EEE2atERSA_(ptr noundef nonnull align 8 dereferenceable(56) %39, ptr noundef nonnull align 8 dereferenceable(8) %6)
          to label %41 unwind label %47

41:                                               ; preds = %38
  invoke void @_ZNSt6vectorISt10shared_ptrIN3aat4core10PriceLevelEESaIS4_EE9push_backERKS4_(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 8 dereferenceable(16) %40)
          to label %42 unwind label %47

42:                                               ; preds = %41
  br label %57

43:                                               ; preds = %3
  %44 = landingpad { ptr, i32 }
          cleanup
  %45 = extractvalue { ptr, i32 } %44, 0
  store ptr %45, ptr %11, align 8
  %46 = extractvalue { ptr, i32 } %44, 1
  store i32 %46, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  br label %94

47:                                               ; preds = %78, %75, %41, %38
  %48 = landingpad { ptr, i32 }
          cleanup
  %49 = extractvalue { ptr, i32 } %48, 0
  store ptr %49, ptr %11, align 8
  %50 = extractvalue { ptr, i32 } %48, 1
  store i32 %50, ptr %12, align 4
  br label %94

51:                                               ; preds = %32
  call void @llvm.lifetime.start.p0(i64 16, ptr %14) #5
  call void @_ZNSt10shared_ptrIN3aat4core10PriceLevelEEC2EDn(ptr noundef nonnull align 8 dereferenceable(16) %14, ptr null) #5
  invoke void @_ZNSt6vectorISt10shared_ptrIN3aat4core10PriceLevelEESaIS4_EE9push_backEOS4_(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 8 dereferenceable(16) %14)
          to label %52 unwind label %53

52:                                               ; preds = %51
  call void @_ZNSt12__shared_ptrIN3aat4core10PriceLevelELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %14) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %14) #5
  br label %57

53:                                               ; preds = %51
  %54 = landingpad { ptr, i32 }
          cleanup
  %55 = extractvalue { ptr, i32 } %54, 0
  store ptr %55, ptr %11, align 8
  %56 = extractvalue { ptr, i32 } %54, 1
  store i32 %56, ptr %12, align 4
  call void @_ZNSt12__shared_ptrIN3aat4core10PriceLevelELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %14) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %14) #5
  br label %94

57:                                               ; preds = %52, %42
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #5
  %58 = getelementptr inbounds %"class.aat::core::OrderBook", ptr %20, i32 0, i32 5
  %59 = call ptr @_ZNKSt6vectorIdSaIdEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %58) #5
  %60 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.234", ptr %16, i32 0, i32 0
  store ptr %59, ptr %60, align 8
  %61 = getelementptr inbounds %"class.aat::core::OrderBook", ptr %20, i32 0, i32 5
  %62 = call ptr @_ZNKSt6vectorIdSaIdEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %61) #5
  %63 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.234", ptr %17, i32 0, i32 0
  store ptr %62, ptr %63, align 8
  %64 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.234", ptr %16, i32 0, i32 0
  %65 = load ptr, ptr %64, align 8
  %66 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.234", ptr %17, i32 0, i32 0
  %67 = load ptr, ptr %66, align 8
  %68 = invoke ptr @_ZSt4findIN9__gnu_cxx17__normal_iteratorIPKdSt6vectorIdSaIdEEEEdET_S8_S8_RKT0_(ptr %65, ptr %67, ptr noundef nonnull align 8 dereferenceable(8) %6)
          to label %69 unwind label %80

69:                                               ; preds = %57
  %70 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.234", ptr %15, i32 0, i32 0
  store ptr %68, ptr %70, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #5
  %71 = getelementptr inbounds %"class.aat::core::OrderBook", ptr %20, i32 0, i32 5
  %72 = call ptr @_ZNKSt6vectorIdSaIdEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %71) #5
  %73 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.234", ptr %18, i32 0, i32 0
  store ptr %72, ptr %73, align 8
  %74 = call noundef zeroext i1 @_ZN9__gnu_cxxeqIPKdSt6vectorIdSaIdEEEEbRKNS_17__normal_iteratorIT_T0_EESB_(ptr noundef nonnull align 8 dereferenceable(8) %15, ptr noundef nonnull align 8 dereferenceable(8) %18) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  br i1 %74, label %75, label %84

75:                                               ; preds = %69
  %76 = getelementptr inbounds %"class.aat::core::OrderBook", ptr %20, i32 0, i32 7
  %77 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNKSt13unordered_mapIdSt10shared_ptrIN3aat4core10PriceLevelEESt4hashIdESt8equal_toIdESaISt4pairIKdS4_EEE2atERSA_(ptr noundef nonnull align 8 dereferenceable(56) %76, ptr noundef nonnull align 8 dereferenceable(8) %6)
          to label %78 unwind label %47

78:                                               ; preds = %75
  invoke void @_ZNSt6vectorISt10shared_ptrIN3aat4core10PriceLevelEESaIS4_EE9push_backERKS4_(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 8 dereferenceable(16) %77)
          to label %79 unwind label %47

79:                                               ; preds = %78
  br label %90

80:                                               ; preds = %57
  %81 = landingpad { ptr, i32 }
          cleanup
  %82 = extractvalue { ptr, i32 } %81, 0
  store ptr %82, ptr %11, align 8
  %83 = extractvalue { ptr, i32 } %81, 1
  store i32 %83, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  br label %94

84:                                               ; preds = %69
  call void @llvm.lifetime.start.p0(i64 16, ptr %19) #5
  call void @_ZNSt10shared_ptrIN3aat4core10PriceLevelEEC2EDn(ptr noundef nonnull align 8 dereferenceable(16) %19, ptr null) #5
  invoke void @_ZNSt6vectorISt10shared_ptrIN3aat4core10PriceLevelEESaIS4_EE9push_backEOS4_(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 8 dereferenceable(16) %19)
          to label %85 unwind label %86

85:                                               ; preds = %84
  call void @_ZNSt12__shared_ptrIN3aat4core10PriceLevelELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %19) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %19) #5
  br label %90

86:                                               ; preds = %84
  %87 = landingpad { ptr, i32 }
          cleanup
  %88 = extractvalue { ptr, i32 } %87, 0
  store ptr %88, ptr %11, align 8
  %89 = extractvalue { ptr, i32 } %87, 1
  store i32 %89, ptr %12, align 4
  call void @_ZNSt12__shared_ptrIN3aat4core10PriceLevelELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %19) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %19) #5
  br label %94

90:                                               ; preds = %85, %79
  store i1 true, ptr %7, align 1
  %91 = load i1, ptr %7, align 1
  br i1 %91, label %93, label %92

92:                                               ; preds = %90
  call void @_ZNSt6vectorISt10shared_ptrIN3aat4core10PriceLevelEESaIS4_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #5
  br label %93

93:                                               ; preds = %92, %90
  ret void

94:                                               ; preds = %86, %80, %53, %47, %43
  call void @_ZNSt6vectorISt10shared_ptrIN3aat4core10PriceLevelEESaIS4_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #5
  br label %95

95:                                               ; preds = %94
  %96 = load ptr, ptr %11, align 8
  %97 = load i32, ptr %12, align 4
  %98 = insertvalue { ptr, i32 } poison, ptr %96, 0
  %99 = insertvalue { ptr, i32 } %98, i32 %97, 1
  resume { ptr, i32 } %99
}

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local ptr @_ZSt4findIN9__gnu_cxx17__normal_iteratorIPKdSt6vectorIdSaIdEEEEdET_S8_S8_RKT0_(ptr, ptr, ptr noundef nonnull align 8 dereferenceable(8)) #4

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

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

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

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

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

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

; 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 #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 = { 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 #4 = { 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 #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 = !{!"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.238" = type { %"struct.std::_Vector_base.239" }
%"struct.std::_Vector_base.239" = type { %"struct.std::_Vector_base<std::shared_ptr<aat::core::PriceLevel>, std::allocator<std::shared_ptr<aat::core::PriceLevel>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::shared_ptr<aat::core::PriceLevel>, std::allocator<std::shared_ptr<aat::core::PriceLevel>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::shared_ptr<aat::core::PriceLevel>, std::allocator<std::shared_ptr<aat::core::PriceLevel>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::shared_ptr<aat::core::PriceLevel>, std::allocator<std::shared_ptr<aat::core::PriceLevel>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.__gnu_cxx::__normal_iterator.234" = type { ptr }
%"class.std::shared_ptr.220" = type { %"class.std::__shared_ptr.221" }
%"class.std::__shared_ptr.221" = type { ptr, %"class.std::__shared_count" }
%"class.std::__shared_count" = type { 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 uwtable
define dso_local void @_ZNK3aat4core9OrderBook5levelEd(ptr dead_on_unwind noalias nonnull writable sret(%"class.std::vector.238") align 8 %0, ptr noundef nonnull align 8 dereferenceable(512) %1, double noundef %2) local_unnamed_addr #1 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca double, align 8
  %5 = alloca %"class.__gnu_cxx::__normal_iterator.234", align 8
  %6 = alloca %"class.__gnu_cxx::__normal_iterator.234", align 8
  %7 = alloca %"class.std::shared_ptr.220", align 8
  %8 = alloca %"class.__gnu_cxx::__normal_iterator.234", align 8
  %9 = alloca %"class.__gnu_cxx::__normal_iterator.234", align 8
  %10 = alloca %"class.std::shared_ptr.220", align 8
  store double %2, ptr %4, align 8, !tbaa !5
  tail call void @_ZNSt6vectorISt10shared_ptrIN3aat4core10PriceLevelEESaIS4_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #5
  %11 = getelementptr inbounds i8, ptr %1, i64 352
  %12 = tail call ptr @_ZNKSt6vectorIdSaIdEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %11) #5
  %13 = tail call ptr @_ZNKSt6vectorIdSaIdEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %11) #5
  %14 = invoke ptr @_ZSt4findIN9__gnu_cxx17__normal_iteratorIPKdSt6vectorIdSaIdEEEEdET_S8_S8_RKT0_(ptr %12, ptr %13, ptr noundef nonnull align 8 dereferenceable(8) %4)
          to label %15 unwind label %22

15:                                               ; preds = %3
  store ptr %14, ptr %5, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #5
  %16 = call ptr @_ZNKSt6vectorIdSaIdEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %11) #5
  store ptr %16, ptr %6, align 8
  %17 = call noundef zeroext i1 @_ZN9__gnu_cxxeqIPKdSt6vectorIdSaIdEEEEbRKNS_17__normal_iteratorIT_T0_EESB_(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(8) %6) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #5
  br i1 %17, label %18, label %26

18:                                               ; preds = %15
  %19 = getelementptr inbounds i8, ptr %1, i64 400
  %20 = 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) %4)
          to label %21 unwind label %24

21:                                               ; preds = %18
  invoke void @_ZNSt6vectorISt10shared_ptrIN3aat4core10PriceLevelEESaIS4_EE9push_backERKS4_(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 8 dereferenceable(16) %20)
          to label %30 unwind label %24

22:                                               ; preds = %3
  %23 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #5
  br label %49

24:                                               ; preds = %41, %38, %21, %18
  %25 = landingpad { ptr, i32 }
          cleanup
  br label %49

26:                                               ; preds = %15
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %7) #5
  call void @_ZNSt10shared_ptrIN3aat4core10PriceLevelEEC2EDn(ptr noundef nonnull align 8 dereferenceable(16) %7, ptr null) #5
  invoke void @_ZNSt6vectorISt10shared_ptrIN3aat4core10PriceLevelEESaIS4_EE9push_backEOS4_(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 8 dereferenceable(16) %7)
          to label %27 unwind label %28

27:                                               ; preds = %26
  call void @_ZNSt12__shared_ptrIN3aat4core10PriceLevelELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %7) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %7) #5
  br label %30

28:                                               ; preds = %26
  %29 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt12__shared_ptrIN3aat4core10PriceLevelELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %7) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %7) #5
  br label %49

30:                                               ; preds = %21, %27
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #5
  %31 = getelementptr inbounds i8, ptr %1, i64 376
  %32 = call ptr @_ZNKSt6vectorIdSaIdEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %31) #5
  %33 = call ptr @_ZNKSt6vectorIdSaIdEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %31) #5
  %34 = invoke ptr @_ZSt4findIN9__gnu_cxx17__normal_iteratorIPKdSt6vectorIdSaIdEEEEdET_S8_S8_RKT0_(ptr %32, ptr %33, ptr noundef nonnull align 8 dereferenceable(8) %4)
          to label %35 unwind label %42

35:                                               ; preds = %30
  store ptr %34, ptr %8, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #5
  %36 = call ptr @_ZNKSt6vectorIdSaIdEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %31) #5
  store ptr %36, ptr %9, align 8
  %37 = call noundef zeroext i1 @_ZN9__gnu_cxxeqIPKdSt6vectorIdSaIdEEEEbRKNS_17__normal_iteratorIT_T0_EESB_(ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull align 8 dereferenceable(8) %9) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #5
  br i1 %37, label %38, label %44

38:                                               ; preds = %35
  %39 = getelementptr inbounds i8, ptr %1, i64 456
  %40 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNKSt13unordered_mapIdSt10shared_ptrIN3aat4core10PriceLevelEESt4hashIdESt8equal_toIdESaISt4pairIKdS4_EEE2atERSA_(ptr noundef nonnull align 8 dereferenceable(56) %39, ptr noundef nonnull align 8 dereferenceable(8) %4)
          to label %41 unwind label %24

41:                                               ; preds = %38
  invoke void @_ZNSt6vectorISt10shared_ptrIN3aat4core10PriceLevelEESaIS4_EE9push_backERKS4_(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 8 dereferenceable(16) %40)
          to label %48 unwind label %24

42:                                               ; preds = %30
  %43 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #5
  br label %49

44:                                               ; preds = %35
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %10) #5
  call void @_ZNSt10shared_ptrIN3aat4core10PriceLevelEEC2EDn(ptr noundef nonnull align 8 dereferenceable(16) %10, ptr null) #5
  invoke void @_ZNSt6vectorISt10shared_ptrIN3aat4core10PriceLevelEESaIS4_EE9push_backEOS4_(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 8 dereferenceable(16) %10)
          to label %45 unwind label %46

45:                                               ; preds = %44
  call void @_ZNSt12__shared_ptrIN3aat4core10PriceLevelELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %10) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %10) #5
  br label %48

46:                                               ; preds = %44
  %47 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt12__shared_ptrIN3aat4core10PriceLevelELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %10) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %10) #5
  br label %49

48:                                               ; preds = %45, %41
  ret void

49:                                               ; preds = %46, %42, %28, %24, %22
  %.pn = phi { ptr, i32 } [ %25, %24 ], [ %47, %46 ], [ %43, %42 ], [ %29, %28 ], [ %23, %22 ]
  call void @_ZNSt6vectorISt10shared_ptrIN3aat4core10PriceLevelEESaIS4_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #5
  resume { ptr, i32 } %.pn
}

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local ptr @_ZSt4findIN9__gnu_cxx17__normal_iteratorIPKdSt6vectorIdSaIdEEEEdET_S8_S8_RKT0_(ptr, ptr, ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #4

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

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

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

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

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

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

; 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 #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 = { 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 #4 = { 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 #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 = !{!"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