; LLVM IR from NVIDIA/DALI :: dali/pipeline/operator/builtin (input_operator)

; 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.dali::CachingList<dali::detail::InputQueueItem<dali::CPUBackend>>::Item" = type { %"class.std::__cxx11::list" }
%"class.std::__cxx11::list" = type { %"class.std::__cxx11::_List_base" }
%"class.std::__cxx11::_List_base" = type { %"struct.std::__cxx11::_List_base<dali::detail::InputQueueItem<dali::CPUBackend>, std::allocator<dali::detail::InputQueueItem<dali::CPUBackend>>>::_List_impl" }
%"struct.std::__cxx11::_List_base<dali::detail::InputQueueItem<dali::CPUBackend>, std::allocator<dali::detail::InputQueueItem<dali::CPUBackend>>>::_List_impl" = type { %"struct.std::__detail::_List_node_header" }
%"struct.std::__detail::_List_node_header" = type { %"struct.std::__detail::_List_node_base", i64 }
%"struct.std::__detail::_List_node_base" = type { ptr, ptr }
%"class.std::lock_guard" = type { ptr }
%"struct.std::nullopt_t" = type { i8 }
%"class.std::function.110" = 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.anon = type { ptr, i32, ptr }
%"class.dali::InputOperator" = type { %"class.dali::Operator", i32, i8, i8, i8, %"class.dali::CachingList", %"class.std::mutex", %"class.std::condition_variable", i8, %"class.dali::WorkerThread", %"class.dali::CUDAStreamLease", %"class.dali::AccessOrder", %"class.dali::BatchSizeProvider" }
%"class.dali::Operator" = type { %"class.dali::OperatorBase" }
%"class.dali::OperatorBase" = type { ptr, %"class.dali::OpSpec", i32, i32, %"class.std::unordered_map" }
%"class.dali::OpSpec" = type { %"class.std::__cxx11::basic_string", ptr, %"class.std::vector.31", %"class.std::map.36", %"class.std::vector.41", %"class.std::map.36", %"class.std::map.46", %"class.std::vector.51", %"class.std::vector.51", %"class.std::map.56" }
%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"class.std::vector.31" = type { %"struct.std::_Vector_base.32" }
%"struct.std::_Vector_base.32" = type { %"struct.std::_Vector_base<std::shared_ptr<dali::Argument>, std::allocator<std::shared_ptr<dali::Argument>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::shared_ptr<dali::Argument>, std::allocator<std::shared_ptr<dali::Argument>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::shared_ptr<dali::Argument>, std::allocator<std::shared_ptr<dali::Argument>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::shared_ptr<dali::Argument>, std::allocator<std::shared_ptr<dali::Argument>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.41" = type { %"struct.std::_Vector_base.42" }
%"struct.std::_Vector_base.42" = type { %"struct.std::_Vector_base<std::pair<std::__cxx11::basic_string<char>, int>, std::allocator<std::pair<std::__cxx11::basic_string<char>, int>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::pair<std::__cxx11::basic_string<char>, int>, std::allocator<std::pair<std::__cxx11::basic_string<char>, int>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::pair<std::__cxx11::basic_string<char>, int>, std::allocator<std::pair<std::__cxx11::basic_string<char>, int>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::pair<std::__cxx11::basic_string<char>, int>, std::allocator<std::pair<std::__cxx11::basic_string<char>, int>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::map.36" = type { %"class.std::_Rb_tree.37" }
%"class.std::_Rb_tree.37" = type { %"struct.std::_Rb_tree<std::__cxx11::basic_string<char>, std::pair<const std::__cxx11::basic_string<char>, int>, std::_Select1st<std::pair<const std::__cxx11::basic_string<char>, int>>, std::less<void>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<std::__cxx11::basic_string<char>, std::pair<const std::__cxx11::basic_string<char>, int>, std::_Select1st<std::pair<const std::__cxx11::basic_string<char>, int>>, std::less<void>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::_Rb_tree_header" = type { %"struct.std::_Rb_tree_node_base", i64 }
%"struct.std::_Rb_tree_node_base" = type { i32, ptr, ptr, ptr }
%"class.std::map.46" = type { %"class.std::_Rb_tree.47" }
%"class.std::_Rb_tree.47" = type { %"struct.std::_Rb_tree<std::__cxx11::basic_string<char>, std::pair<const std::__cxx11::basic_string<char>, std::__cxx11::basic_string<char>>, std::_Select1st<std::pair<const std::__cxx11::basic_string<char>, std::__cxx11::basic_string<char>>>, std::less<void>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<std::__cxx11::basic_string<char>, std::pair<const std::__cxx11::basic_string<char>, std::__cxx11::basic_string<char>>, std::_Select1st<std::pair<const std::__cxx11::basic_string<char>, std::__cxx11::basic_string<char>>>, std::less<void>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"class.std::vector.51" = type { %"struct.std::_Vector_base.52" }
%"struct.std::_Vector_base.52" = type { %"struct.std::_Vector_base<dali::OpSpec::InOutDeviceDesc, std::allocator<dali::OpSpec::InOutDeviceDesc>>::_Vector_impl" }
%"struct.std::_Vector_base<dali::OpSpec::InOutDeviceDesc, std::allocator<dali::OpSpec::InOutDeviceDesc>>::_Vector_impl" = type { %"struct.std::_Vector_base<dali::OpSpec::InOutDeviceDesc, std::allocator<dali::OpSpec::InOutDeviceDesc>>::_Vector_impl_data" }
%"struct.std::_Vector_base<dali::OpSpec::InOutDeviceDesc, std::allocator<dali::OpSpec::InOutDeviceDesc>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::map.56" = type { %"class.std::_Rb_tree.57" }
%"class.std::_Rb_tree.57" = type { %"struct.std::_Rb_tree<dali::OpSpec::InOutDeviceDesc, std::pair<const dali::OpSpec::InOutDeviceDesc, int>, std::_Select1st<std::pair<const dali::OpSpec::InOutDeviceDesc, int>>, std::less<void>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<dali::OpSpec::InOutDeviceDesc, std::pair<const dali::OpSpec::InOutDeviceDesc, int>, std::_Select1st<std::pair<const dali::OpSpec::InOutDeviceDesc, int>>, std::less<void>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"class.std::unordered_map" = type { %"class.std::_Hashtable" }
%"class.std::_Hashtable" = type { ptr, i64, %"struct.std::__detail::_Hash_node_base", i64, %"struct.std::__detail::_Prime_rehash_policy", ptr }
%"struct.std::__detail::_Hash_node_base" = type { ptr }
%"struct.std::__detail::_Prime_rehash_policy" = type { float, i64 }
%"class.dali::CachingList" = type { %"class.std::__cxx11::list", %"class.std::__cxx11::list", %"struct.std::_List_iterator" }
%"struct.std::_List_iterator" = type { ptr }
%"class.std::mutex" = type { %"class.std::__mutex_base" }
%"class.std::__mutex_base" = type { %union.pthread_mutex_t }
%union.pthread_mutex_t = type { %struct.__pthread_mutex_s }
%struct.__pthread_mutex_s = type { i32, i32, i32, i32, i32, i16, i16, %struct.__pthread_internal_list }
%struct.__pthread_internal_list = type { ptr, ptr }
%"class.std::condition_variable" = type { %"class.std::__condvar" }
%"class.std::__condvar" = type { %union.pthread_cond_t }
%union.pthread_cond_t = type { %struct.__pthread_cond_s }
%struct.__pthread_cond_s = type { %union.__atomic_wide_counter, %union.__atomic_wide_counter, [2 x i32], [2 x i32], i32, i32, [2 x i32] }
%union.__atomic_wide_counter = type { i64 }
%"class.dali::WorkerThread" = type { i8, i8, %"class.std::queue", %"class.std::thread", %"class.std::mutex", %"class.std::condition_variable", %"class.std::condition_variable", %"class.std::queue.69", %"class.dali::Barrier" }
%"class.std::queue" = type { %"class.std::deque" }
%"class.std::deque" = type { %"class.std::_Deque_base" }
%"class.std::_Deque_base" = type { %"struct.std::_Deque_base<std::function<void ()>, std::allocator<std::function<void ()>>>::_Deque_impl" }
%"struct.std::_Deque_base<std::function<void ()>, std::allocator<std::function<void ()>>>::_Deque_impl" = type { %"struct.std::_Deque_base<std::function<void ()>, std::allocator<std::function<void ()>>>::_Deque_impl_data" }
%"struct.std::_Deque_base<std::function<void ()>, std::allocator<std::function<void ()>>>::_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::thread" = type { %"class.std::thread::id" }
%"class.std::thread::id" = type { i64 }
%"class.std::queue.69" = type { %"class.std::deque.70" }
%"class.std::deque.70" = type { %"class.std::_Deque_base.71" }
%"class.std::_Deque_base.71" = type { %"struct.std::_Deque_base<std::__cxx11::basic_string<char>, std::allocator<std::__cxx11::basic_string<char>>>::_Deque_impl" }
%"struct.std::_Deque_base<std::__cxx11::basic_string<char>, std::allocator<std::__cxx11::basic_string<char>>>::_Deque_impl" = type { %"struct.std::_Deque_base<std::__cxx11::basic_string<char>, std::allocator<std::__cxx11::basic_string<char>>>::_Deque_impl_data" }
%"struct.std::_Deque_base<std::__cxx11::basic_string<char>, std::allocator<std::__cxx11::basic_string<char>>>::_Deque_impl_data" = type { ptr, i64, %"struct.std::_Deque_iterator.72", %"struct.std::_Deque_iterator.72" }
%"struct.std::_Deque_iterator.72" = type { ptr, ptr, ptr, ptr }
%"class.dali::Barrier" = type { %"class.std::mutex", %"class.std::condition_variable", i64, i64 }
%"class.dali::CUDAStreamLease" = type { %"class.dali::CUDAStream", i32, ptr }
%"class.dali::CUDAStream" = type { %"class.dali::UniqueHandle" }
%"class.dali::UniqueHandle" = type { ptr }
%"class.dali::AccessOrder" = type <{ ptr, i32, [4 x i8] }>
%"class.dali::BatchSizeProvider" = type { ptr }
%"struct.dali::detail::InputQueueItem" = type <{ %"class.dali::TensorList", %"class.std::optional.86", %"class.dali::detail::InputQueueItem<dali::CPUBackend>::EventLease", i8, i8, [6 x i8] }>
%"class.dali::TensorList" = type { %"class.dali::Buffer", %"class.std::vector.76", %"class.dali::TensorList<dali::CPUBackend>::State", i8, i32, i32, i32, %"class.dali::TypeInfo", %"struct.dali::TensorListShape", %"class.dali::TensorLayout", %"class.dali::AccessOrder", %"class.dali::CUDASharedEvent" }
%"class.dali::Buffer" = type <{ ptr, %"class.dali::TypeInfo", %"class.std::shared_ptr", %"class.std::function.73", i64, i64, i32, [4 x i8], %"class.dali::AccessOrder", i8, i8, [6 x i8] }>
%"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::function.73" = type { %"class.std::_Function_base", ptr }
%"class.std::vector.76" = type { %"struct.std::_Vector_base.77" }
%"struct.std::_Vector_base.77" = type { %"struct.std::_Vector_base<dali::Tensor<dali::CPUBackend>, std::allocator<dali::Tensor<dali::CPUBackend>>>::_Vector_impl" }
%"struct.std::_Vector_base<dali::Tensor<dali::CPUBackend>, std::allocator<dali::Tensor<dali::CPUBackend>>>::_Vector_impl" = type { %"struct.std::_Vector_base<dali::Tensor<dali::CPUBackend>, std::allocator<dali::Tensor<dali::CPUBackend>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<dali::Tensor<dali::CPUBackend>, std::allocator<dali::Tensor<dali::CPUBackend>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.dali::TensorList<dali::CPUBackend>::State" = type { i8, i8 }
%"class.dali::TypeInfo" = type { ptr, i32, i64, %"class.std::basic_string_view" }
%"class.std::basic_string_view" = type { i64, ptr }
%"struct.dali::TensorListShape" = type { %"struct.dali::TensorListShapeBase.base", i32 }
%"struct.dali::TensorListShapeBase.base" = type <{ %"class.std::vector.81", i32 }>
%"class.std::vector.81" = type { %"struct.std::_Vector_base.82" }
%"struct.std::_Vector_base.82" = type { %"struct.std::_Vector_base<long, std::allocator<long>>::_Vector_impl" }
%"struct.std::_Vector_base<long, std::allocator<long>>::_Vector_impl" = type { %"struct.std::_Vector_base<long, std::allocator<long>>::_Vector_impl_data" }
%"struct.std::_Vector_base<long, std::allocator<long>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.dali::TensorLayout" = type { [16 x i8] }
%"class.dali::CUDASharedEvent" = type { %"class.std::shared_ptr" }
%"class.std::optional.86" = type { %"struct.std::_Optional_base.87" }
%"struct.std::_Optional_base.87" = type { %"struct.std::_Optional_payload.89" }
%"struct.std::_Optional_payload.89" = type { %"struct.std::_Optional_payload.base", [7 x i8] }
%"struct.std::_Optional_payload.base" = type { %"struct.std::_Optional_payload_base.base" }
%"struct.std::_Optional_payload_base.base" = type <{ %"union.std::_Optional_payload_base<std::__cxx11::basic_string<char>>::_Storage", i8 }>
%"union.std::_Optional_payload_base<std::__cxx11::basic_string<char>>::_Storage" = type { %"class.std::__cxx11::basic_string" }
%"class.dali::detail::InputQueueItem<dali::CPUBackend>::EventLease" = type { i32, %"class.dali::CUDAEvent" }
%"class.dali::CUDAEvent" = type { %"class.dali::UniqueHandle.94" }
%"class.dali::UniqueHandle.94" = type { ptr }

; 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
define dso_local void @_ZN4dali13InputOperatorINS_10CPUBackendEE18ForwardCurrentDataERNS_10TensorListIS1_EERSt8optionalINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEERNS_10ThreadPoolE(ptr noundef nonnull align 8 dereferenceable(1016) %0, ptr noundef nonnull align 8 dereferenceable(304) %1, ptr noundef nonnull align 8 dereferenceable(40) %2, ptr noundef nonnull align 8 dereferenceable(224) %3) #1 align 2 personality ptr @__gxx_personality_v0 {
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca %"class.dali::CachingList<dali::detail::InputQueueItem<dali::CPUBackend>>::Item", align 8
  %10 = alloca %"class.std::lock_guard", align 8
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  %13 = alloca %"class.dali::CachingList<dali::detail::InputQueueItem<dali::CPUBackend>>::Item", align 8
  %14 = alloca %"struct.std::nullopt_t", align 1
  %15 = alloca ptr, align 8
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca %"class.std::function.110", align 8
  %19 = alloca %class.anon, align 8
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store ptr %2, ptr %7, align 8, !tbaa !5
  store ptr %3, ptr %8, align 8, !tbaa !5
  %20 = load ptr, ptr %5, align 8
  call void @llvm.lifetime.start.p0(i64 24, ptr %9) #5
  call void @_ZN4dali11CachingListINS_6detail14InputQueueItemINS_10CPUBackendEEEE4ItemC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %9) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #5
  %21 = getelementptr inbounds %"class.dali::InputOperator", ptr %20, i32 0, i32 6
  invoke void @_ZNSt10lock_guardISt5mutexEC2ERS0_(ptr noundef nonnull align 8 dereferenceable(8) %10, ptr noundef nonnull align 8 dereferenceable(40) %21)
          to label %22 unwind label %67

22:                                               ; preds = %4
  call void @llvm.lifetime.start.p0(i64 24, ptr %13) #5
  %23 = getelementptr inbounds %"class.dali::InputOperator", ptr %20, i32 0, i32 5
  invoke void @_ZN4dali11CachingListINS_6detail14InputQueueItemINS_10CPUBackendEEEE8PopFrontEv(ptr dead_on_unwind writable sret(%"class.dali::CachingList<dali::detail::InputQueueItem<dali::CPUBackend>>::Item") align 8 %13, ptr noundef nonnull align 8 dereferenceable(56) %23)
          to label %24 unwind label %71

24:                                               ; preds = %22
  %25 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN4dali11CachingListINS_6detail14InputQueueItemINS_10CPUBackendEEEE4ItemaSEOS6_(ptr noundef nonnull align 8 dereferenceable(24) %9, ptr noundef nonnull align 8 dereferenceable(24) %13) #5
  call void @_ZN4dali11CachingListINS_6detail14InputQueueItemINS_10CPUBackendEEEE4ItemD2Ev(ptr noundef nonnull align 8 dereferenceable(24) %13) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %13) #5
  call void @_ZNSt10lock_guardISt5mutexED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %10) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  %26 = call noundef ptr @_ZNKR4dali11CachingListINS_6detail14InputQueueItemINS_10CPUBackendEEEE4ItemptEv(ptr noundef nonnull align 8 dereferenceable(24) %9) #5
  %27 = getelementptr inbounds %"struct.dali::detail::InputQueueItem", ptr %26, i32 0, i32 1
  %28 = load ptr, ptr %7, align 8, !tbaa !5
  %29 = call noundef nonnull align 8 dereferenceable(40) ptr @_ZNSt8optionalINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEaSEOS6_(ptr noundef nonnull align 8 dereferenceable(40) %28, ptr noundef nonnull align 8 dereferenceable(40) %27) #5
  %30 = call noundef ptr @_ZNKR4dali11CachingListINS_6detail14InputQueueItemINS_10CPUBackendEEEE4ItemptEv(ptr noundef nonnull align 8 dereferenceable(24) %9) #5
  %31 = getelementptr inbounds %"struct.dali::detail::InputQueueItem", ptr %30, i32 0, i32 1
  %32 = call noundef nonnull align 8 dereferenceable(40) ptr @_ZNSt8optionalINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEaSESt9nullopt_t(ptr noundef nonnull align 8 dereferenceable(40) %31) #5
  %33 = load ptr, ptr %6, align 8, !tbaa !5
  %34 = invoke noundef zeroext i1 @_ZNK4dali10TensorListINS_10CPUBackendEE9is_pinnedEv(ptr noundef nonnull align 8 dereferenceable(304) %33)
          to label %35 unwind label %76

35:                                               ; preds = %24
  br i1 %34, label %36, label %119

36:                                               ; preds = %35
  %37 = call noundef ptr @_ZNKR4dali11CachingListINS_6detail14InputQueueItemINS_10CPUBackendEEEE4ItemptEv(ptr noundef nonnull align 8 dereferenceable(24) %9) #5
  %38 = getelementptr inbounds %"struct.dali::detail::InputQueueItem", ptr %37, i32 0, i32 0
  %39 = invoke noundef zeroext i1 @_ZNK4dali10TensorListINS_10CPUBackendEE9is_pinnedEv(ptr noundef nonnull align 8 dereferenceable(304) %38)
          to label %40 unwind label %76

40:                                               ; preds = %36
  br i1 %39, label %119, label %41

41:                                               ; preds = %40
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #5
  %42 = call noundef ptr @_ZNKR4dali11CachingListINS_6detail14InputQueueItemINS_10CPUBackendEEEE4ItemptEv(ptr noundef nonnull align 8 dereferenceable(24) %9) #5
  %43 = getelementptr inbounds %"struct.dali::detail::InputQueueItem", ptr %42, i32 0, i32 0
  %44 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNKR4dali10TensorListINS_10CPUBackendEE5shapeEv(ptr noundef nonnull align 8 dereferenceable(304) %43)
          to label %45 unwind label %80

45:                                               ; preds = %41
  store ptr %44, ptr %15, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #5
  %46 = load ptr, ptr %15, align 8, !tbaa !5
  %47 = invoke noundef i32 @_ZNK4dali19TensorListShapeBaseINS_15TensorListShapeILin1EEELin1EE11num_samplesEv(ptr noundef nonnull align 8 dereferenceable(28) %46)
          to label %48 unwind label %84

48:                                               ; preds = %45
  store i32 %47, ptr %16, align 4, !tbaa !9
  %49 = load ptr, ptr %6, align 8, !tbaa !5
  %50 = load ptr, ptr %15, align 8, !tbaa !5
  %51 = call noundef ptr @_ZNKR4dali11CachingListINS_6detail14InputQueueItemINS_10CPUBackendEEEE4ItemptEv(ptr noundef nonnull align 8 dereferenceable(24) %9) #5
  %52 = getelementptr inbounds %"struct.dali::detail::InputQueueItem", ptr %51, i32 0, i32 0
  %53 = invoke noundef i32 @_ZNK4dali10TensorListINS_10CPUBackendEE4typeEv(ptr noundef nonnull align 8 dereferenceable(304) %52)
          to label %54 unwind label %84

54:                                               ; preds = %48
  invoke void @_ZN4dali10TensorListINS_10CPUBackendEE6ResizeERKNS_15TensorListShapeILin1EEE13_DALIDataTypeNS_15BatchContiguityE(ptr noundef nonnull align 8 dereferenceable(304) %49, ptr noundef nonnull align 8 dereferenceable(32) %50, i32 noundef %53, i32 noundef 0)
          to label %55 unwind label %84

55:                                               ; preds = %54
  %56 = load ptr, ptr %6, align 8, !tbaa !5
  %57 = call noundef ptr @_ZNKR4dali11CachingListINS_6detail14InputQueueItemINS_10CPUBackendEEEE4ItemptEv(ptr noundef nonnull align 8 dereferenceable(24) %9) #5
  %58 = getelementptr inbounds %"struct.dali::detail::InputQueueItem", ptr %57, i32 0, i32 0
  %59 = invoke noundef nonnull align 1 dereferenceable(16) ptr @_ZNKR4dali10TensorListINS_10CPUBackendEE9GetLayoutEv(ptr noundef nonnull align 8 dereferenceable(304) %58)
          to label %60 unwind label %84

60:                                               ; preds = %55
  invoke void @_ZN4dali10TensorListINS_10CPUBackendEE9SetLayoutERKNS_12TensorLayoutE(ptr noundef nonnull align 8 dereferenceable(304) %56, ptr noundef nonnull align 1 dereferenceable(16) %59)
          to label %61 unwind label %84

61:                                               ; preds = %60
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #5
  store i32 0, ptr %17, align 4, !tbaa !9
  br label %62

62:                                               ; preds = %102, %61
  %63 = load i32, ptr %17, align 4, !tbaa !9
  %64 = load i32, ptr %16, align 4, !tbaa !9
  %65 = icmp slt i32 %63, %64
  br i1 %65, label %88, label %66

66:                                               ; preds = %62
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #5
  br label %114

67:                                               ; preds = %4
  %68 = landingpad { ptr, i32 }
          cleanup
  %69 = extractvalue { ptr, i32 } %68, 0
  store ptr %69, ptr %11, align 8
  %70 = extractvalue { ptr, i32 } %68, 1
  store i32 %70, ptr %12, align 4
  br label %75

71:                                               ; preds = %22
  %72 = landingpad { ptr, i32 }
          cleanup
  %73 = extractvalue { ptr, i32 } %72, 0
  store ptr %73, ptr %11, align 8
  %74 = extractvalue { ptr, i32 } %72, 1
  store i32 %74, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 24, ptr %13) #5
  call void @_ZNSt10lock_guardISt5mutexED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %10) #5
  br label %75

75:                                               ; preds = %71, %67
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  br label %125

76:                                               ; preds = %123, %36, %24
  %77 = landingpad { ptr, i32 }
          cleanup
  %78 = extractvalue { ptr, i32 } %77, 0
  store ptr %78, ptr %11, align 8
  %79 = extractvalue { ptr, i32 } %77, 1
  store i32 %79, ptr %12, align 4
  br label %125

80:                                               ; preds = %41
  %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
  br label %118

84:                                               ; preds = %114, %60, %55, %54, %48, %45
  %85 = landingpad { ptr, i32 }
          cleanup
  %86 = extractvalue { ptr, i32 } %85, 0
  store ptr %86, ptr %11, align 8
  %87 = extractvalue { ptr, i32 } %85, 1
  store i32 %87, ptr %12, align 4
  br label %117

88:                                               ; preds = %62
  %89 = load ptr, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 24, ptr %19) #5
  %90 = getelementptr inbounds %class.anon, ptr %19, i32 0, i32 0
  %91 = load ptr, ptr %6, align 8, !tbaa !5
  store ptr %91, ptr %90, align 8, !tbaa !5
  %92 = getelementptr inbounds %class.anon, ptr %19, i32 0, i32 1
  %93 = load i32, ptr %17, align 4, !tbaa !9
  store i32 %93, ptr %92, align 8, !tbaa !11
  %94 = getelementptr inbounds %class.anon, ptr %19, i32 0, i32 2
  store ptr %9, ptr %94, align 8, !tbaa !5
  invoke void @"_ZNSt8functionIFviEEC2IZN4dali13InputOperatorINS3_10CPUBackendEE18ForwardCurrentDataERNS3_10TensorListIS5_EERSt8optionalINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEERNS3_10ThreadPoolEE3$_0vEEOT_"(ptr noundef nonnull align 8 dereferenceable(32) %18, ptr noundef nonnull align 8 dereferenceable(24) %19)
          to label %95 unwind label %105

95:                                               ; preds = %88
  %96 = load ptr, ptr %15, align 8, !tbaa !5
  %97 = load i32, ptr %17, align 4, !tbaa !9
  %98 = sext i32 %97 to i64
  %99 = invoke noundef i64 @_ZNK4dali19TensorListShapeBaseINS_15TensorListShapeILin1EEELin1EE11tensor_sizeEl(ptr noundef nonnull align 8 dereferenceable(28) %96, i64 noundef %98)
          to label %100 unwind label %109

100:                                              ; preds = %95
  invoke void @_ZN4dali10ThreadPool7AddWorkESt8functionIFviEElb(ptr noundef nonnull align 8 dereferenceable(224) %89, ptr noundef %18, i64 noundef %99, i1 noundef zeroext false)
          to label %101 unwind label %109

101:                                              ; preds = %100
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %18) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %19) #5
  br label %102

102:                                              ; preds = %101
  %103 = load i32, ptr %17, align 4, !tbaa !9
  %104 = add nsw i32 %103, 1
  store i32 %104, ptr %17, align 4, !tbaa !9
  br label %62, !llvm.loop !13

105:                                              ; preds = %88
  %106 = landingpad { ptr, i32 }
          cleanup
  %107 = extractvalue { ptr, i32 } %106, 0
  store ptr %107, ptr %11, align 8
  %108 = extractvalue { ptr, i32 } %106, 1
  store i32 %108, ptr %12, align 4
  br label %113

109:                                              ; preds = %100, %95
  %110 = landingpad { ptr, i32 }
          cleanup
  %111 = extractvalue { ptr, i32 } %110, 0
  store ptr %111, ptr %11, align 8
  %112 = extractvalue { ptr, i32 } %110, 1
  store i32 %112, ptr %12, align 4
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %18) #5
  br label %113

113:                                              ; preds = %109, %105
  call void @llvm.lifetime.end.p0(i64 24, ptr %19) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #5
  br label %117

114:                                              ; preds = %66
  %115 = load ptr, ptr %8, align 8, !tbaa !5
  invoke void @_ZN4dali10ThreadPool6RunAllEb(ptr noundef nonnull align 8 dereferenceable(224) %115, i1 noundef zeroext true)
          to label %116 unwind label %84

116:                                              ; preds = %114
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  br label %123

117:                                              ; preds = %113, %84
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #5
  br label %118

118:                                              ; preds = %117, %80
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  br label %125

119:                                              ; preds = %40, %35
  %120 = load ptr, ptr %6, align 8, !tbaa !5
  %121 = call noundef ptr @_ZNKR4dali11CachingListINS_6detail14InputQueueItemINS_10CPUBackendEEEE4ItemptEv(ptr noundef nonnull align 8 dereferenceable(24) %9) #5
  %122 = getelementptr inbounds %"struct.dali::detail::InputQueueItem", ptr %121, i32 0, i32 0
  call void @_ZSt4swapIN4dali10TensorListINS0_10CPUBackendEEEENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS7_ESt18is_move_assignableIS7_EEE5valueEvE4typeERS7_SG_(ptr noundef nonnull align 8 dereferenceable(304) %120, ptr noundef nonnull align 8 dereferenceable(304) %122) #5
  br label %123

123:                                              ; preds = %119, %116
  invoke void @_ZN4dali13InputOperatorINS_10CPUBackendEE13RecycleBufferEONS_11CachingListINS_6detail14InputQueueItemIS1_EEE4ItemE(ptr noundef nonnull align 8 dereferenceable(1016) %20, ptr noundef nonnull align 8 dereferenceable(24) %9)
          to label %124 unwind label %76

124:                                              ; preds = %123
  call void @_ZN4dali11CachingListINS_6detail14InputQueueItemINS_10CPUBackendEEEE4ItemD2Ev(ptr noundef nonnull align 8 dereferenceable(24) %9) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %9) #5
  ret void

125:                                              ; preds = %118, %76, %75
  call void @_ZN4dali11CachingListINS_6detail14InputQueueItemINS_10CPUBackendEEEE4ItemD2Ev(ptr noundef nonnull align 8 dereferenceable(24) %9) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %9) #5
  br label %126

126:                                              ; preds = %125
  %127 = load ptr, ptr %11, align 8
  %128 = load i32, ptr %12, align 4
  %129 = insertvalue { ptr, i32 } poison, ptr %127, 0
  %130 = insertvalue { ptr, i32 } %129, i32 %128, 1
  resume { ptr, i32 } %130
}

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4dali11CachingListINS_6detail14InputQueueItemINS_10CPUBackendEEEE8PopFrontEv(ptr dead_on_unwind noalias writable sret(%"class.dali::CachingList<dali::detail::InputQueueItem<dali::CPUBackend>>::Item") align 8, ptr noundef nonnull align 8 dereferenceable(56)) #1 align 2

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

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(40) ptr @_ZNSt8optionalINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEaSEOS6_(ptr noundef nonnull align 8 dereferenceable(40), ptr noundef nonnull align 8 dereferenceable(40)) #3 align 2

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

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

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

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

declare void @_ZN4dali10TensorListINS_10CPUBackendEE6ResizeERKNS_15TensorListShapeILin1EEE13_DALIDataTypeNS_15BatchContiguityE(ptr noundef nonnull align 8 dereferenceable(304), ptr noundef nonnull align 8 dereferenceable(32), i32 noundef, i32 noundef) #4

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

declare void @_ZN4dali10TensorListINS_10CPUBackendEE9SetLayoutERKNS_12TensorLayoutE(ptr noundef nonnull align 8 dereferenceable(304), ptr noundef nonnull align 1 dereferenceable(16)) #4

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 1 dereferenceable(16) ptr @_ZNKR4dali10TensorListINS_10CPUBackendEE9GetLayoutEv(ptr noundef nonnull align 8 dereferenceable(304)) #3 align 2

declare void @_ZN4dali10ThreadPool7AddWorkESt8functionIFviEElb(ptr noundef nonnull align 8 dereferenceable(224), ptr noundef, i64 noundef, i1 noundef zeroext) #4

; Function Attrs: mustprogress uwtable
declare hidden void @"_ZNSt8functionIFviEEC2IZN4dali13InputOperatorINS3_10CPUBackendEE18ForwardCurrentDataERNS3_10TensorListIS5_EERSt8optionalINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEERNS3_10ThreadPoolEE3$_0vEEOT_"(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #1 align 2

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

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

declare void @_ZN4dali10ThreadPool6RunAllEb(ptr noundef nonnull align 8 dereferenceable(224), i1 noundef zeroext) #4

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZSt4swapIN4dali10TensorListINS0_10CPUBackendEEEENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS7_ESt18is_move_assignableIS7_EEE5valueEvE4typeERS7_SG_(ptr noundef nonnull align 8 dereferenceable(304), ptr noundef nonnull align 8 dereferenceable(304)) #3

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4dali13InputOperatorINS_10CPUBackendEE13RecycleBufferEONS_11CachingListINS_6detail14InputQueueItemIS1_EEE4ItemE(ptr noundef nonnull align 8 dereferenceable(1016), ptr noundef nonnull align 8 dereferenceable(24)) #1 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 = { "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 = !{!"int", !7, i64 0}
!11 = !{!12, !10, i64 8}
!12 = !{!"_ZTSZN4dali13InputOperatorINS_10CPUBackendEE18ForwardCurrentDataERNS_10TensorListIS1_EERSt8optionalINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEERNS_10ThreadPoolEE3$_0", !6, i64 0, !10, i64 8, !6, i64 16}
!13 = distinct !{!13, !14}
!14 = !{!"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.dali::CachingList<dali::detail::InputQueueItem<dali::CPUBackend>>::Item" = type { %"class.std::__cxx11::list" }
%"class.std::__cxx11::list" = type { %"class.std::__cxx11::_List_base" }
%"class.std::__cxx11::_List_base" = type { %"struct.std::__cxx11::_List_base<dali::detail::InputQueueItem<dali::CPUBackend>, std::allocator<dali::detail::InputQueueItem<dali::CPUBackend>>>::_List_impl" }
%"struct.std::__cxx11::_List_base<dali::detail::InputQueueItem<dali::CPUBackend>, std::allocator<dali::detail::InputQueueItem<dali::CPUBackend>>>::_List_impl" = type { %"struct.std::__detail::_List_node_header" }
%"struct.std::__detail::_List_node_header" = type { %"struct.std::__detail::_List_node_base", i64 }
%"struct.std::__detail::_List_node_base" = type { ptr, ptr }
%"class.std::lock_guard" = type { ptr }
%"class.std::function.110" = 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.anon = type { ptr, i32, 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
define dso_local void @_ZN4dali13InputOperatorINS_10CPUBackendEE18ForwardCurrentDataERNS_10TensorListIS1_EERSt8optionalINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEERNS_10ThreadPoolE(ptr noundef nonnull align 8 dereferenceable(1016) %0, ptr noundef nonnull align 8 dereferenceable(304) %1, ptr noundef nonnull align 8 dereferenceable(40) %2, ptr noundef nonnull align 8 dereferenceable(224) %3) local_unnamed_addr #1 align 2 personality ptr @__gxx_personality_v0 {
  %5 = alloca %"class.dali::CachingList<dali::detail::InputQueueItem<dali::CPUBackend>>::Item", align 8
  %6 = alloca %"class.std::lock_guard", align 8
  %7 = alloca %"class.dali::CachingList<dali::detail::InputQueueItem<dali::CPUBackend>>::Item", align 8
  %8 = alloca %"class.std::function.110", align 8
  %9 = alloca %class.anon, align 8
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %5) #5
  call void @_ZN4dali11CachingListINS_6detail14InputQueueItemINS_10CPUBackendEEEE4ItemC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #5
  %10 = getelementptr inbounds i8, ptr %0, i64 464
  invoke void @_ZNSt10lock_guardISt5mutexEC2ERS0_(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(40) %10)
          to label %11 unwind label %39

11:                                               ; preds = %4
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %7) #5
  %12 = getelementptr inbounds i8, ptr %0, i64 408
  invoke void @_ZN4dali11CachingListINS_6detail14InputQueueItemINS_10CPUBackendEEEE8PopFrontEv(ptr dead_on_unwind nonnull writable sret(%"class.dali::CachingList<dali::detail::InputQueueItem<dali::CPUBackend>>::Item") align 8 %7, ptr noundef nonnull align 8 dereferenceable(56) %12)
          to label %13 unwind label %41

13:                                               ; preds = %11
  %14 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN4dali11CachingListINS_6detail14InputQueueItemINS_10CPUBackendEEEE4ItemaSEOS6_(ptr noundef nonnull align 8 dereferenceable(24) %5, ptr noundef nonnull align 8 dereferenceable(24) %7) #5
  call void @_ZN4dali11CachingListINS_6detail14InputQueueItemINS_10CPUBackendEEEE4ItemD2Ev(ptr noundef nonnull align 8 dereferenceable(24) %7) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %7) #5
  call void @_ZNSt10lock_guardISt5mutexED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %6) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #5
  %15 = call noundef ptr @_ZNKR4dali11CachingListINS_6detail14InputQueueItemINS_10CPUBackendEEEE4ItemptEv(ptr noundef nonnull align 8 dereferenceable(24) %5) #5
  %16 = getelementptr inbounds i8, ptr %15, i64 304
  %17 = call noundef nonnull align 8 dereferenceable(40) ptr @_ZNSt8optionalINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEaSEOS6_(ptr noundef nonnull align 8 dereferenceable(40) %2, ptr noundef nonnull align 8 dereferenceable(40) %16) #5
  %18 = call noundef ptr @_ZNKR4dali11CachingListINS_6detail14InputQueueItemINS_10CPUBackendEEEE4ItemptEv(ptr noundef nonnull align 8 dereferenceable(24) %5) #5
  %19 = getelementptr inbounds i8, ptr %18, i64 304
  %20 = call noundef nonnull align 8 dereferenceable(40) ptr @_ZNSt8optionalINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEaSESt9nullopt_t(ptr noundef nonnull align 8 dereferenceable(40) %19) #5
  %21 = call noundef zeroext i1 @_ZNK4dali10TensorListINS_10CPUBackendEE9is_pinnedEv(ptr noundef nonnull align 8 dereferenceable(304) %1)
  br i1 %21, label %22, label %59

22:                                               ; preds = %13
  %23 = call noundef ptr @_ZNKR4dali11CachingListINS_6detail14InputQueueItemINS_10CPUBackendEEEE4ItemptEv(ptr noundef nonnull align 8 dereferenceable(24) %5) #5
  %24 = call noundef zeroext i1 @_ZNK4dali10TensorListINS_10CPUBackendEE9is_pinnedEv(ptr noundef nonnull align 8 dereferenceable(304) %23)
  br i1 %24, label %59, label %25

25:                                               ; preds = %22
  %26 = call noundef ptr @_ZNKR4dali11CachingListINS_6detail14InputQueueItemINS_10CPUBackendEEEE4ItemptEv(ptr noundef nonnull align 8 dereferenceable(24) %5) #5
  %27 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNKR4dali10TensorListINS_10CPUBackendEE5shapeEv(ptr noundef nonnull align 8 dereferenceable(304) %26)
  %28 = invoke noundef i32 @_ZNK4dali19TensorListShapeBaseINS_15TensorListShapeILin1EEELin1EE11num_samplesEv(ptr noundef nonnull align 8 dereferenceable(28) %27)
          to label %29 unwind label %46

29:                                               ; preds = %25
  %30 = call noundef ptr @_ZNKR4dali11CachingListINS_6detail14InputQueueItemINS_10CPUBackendEEEE4ItemptEv(ptr noundef nonnull align 8 dereferenceable(24) %5) #5
  %31 = invoke noundef i32 @_ZNK4dali10TensorListINS_10CPUBackendEE4typeEv(ptr noundef nonnull align 8 dereferenceable(304) %30)
          to label %32 unwind label %46

32:                                               ; preds = %29
  invoke void @_ZN4dali10TensorListINS_10CPUBackendEE6ResizeERKNS_15TensorListShapeILin1EEE13_DALIDataTypeNS_15BatchContiguityE(ptr noundef nonnull align 8 dereferenceable(304) %1, ptr noundef nonnull align 8 dereferenceable(32) %27, i32 noundef %31, i32 noundef 0)
          to label %33 unwind label %46

33:                                               ; preds = %32
  %34 = call noundef ptr @_ZNKR4dali11CachingListINS_6detail14InputQueueItemINS_10CPUBackendEEEE4ItemptEv(ptr noundef nonnull align 8 dereferenceable(24) %5) #5
  %35 = call noundef nonnull align 1 dereferenceable(16) ptr @_ZNKR4dali10TensorListINS_10CPUBackendEE9GetLayoutEv(ptr noundef nonnull align 8 dereferenceable(304) %34)
  invoke void @_ZN4dali10TensorListINS_10CPUBackendEE9SetLayoutERKNS_12TensorLayoutE(ptr noundef nonnull align 8 dereferenceable(304) %1, ptr noundef nonnull align 1 dereferenceable(16) %35)
          to label %.preheader unwind label %46

.preheader:                                       ; preds = %33
  %36 = icmp sgt i32 %28, 0
  br i1 %36, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %.preheader
  %37 = getelementptr inbounds i8, ptr %9, i64 8
  %38 = getelementptr inbounds i8, ptr %9, i64 16
  %wide.trip.count = zext nneg i32 %28 to i64
  br label %48

._crit_edge:                                      ; preds = %53, %.preheader
  invoke void @_ZN4dali10ThreadPool6RunAllEb(ptr noundef nonnull align 8 dereferenceable(224) %3, i1 noundef zeroext true)
          to label %61 unwind label %46

39:                                               ; preds = %4
  %40 = landingpad { ptr, i32 }
          cleanup
  br label %43

41:                                               ; preds = %11
  %42 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %7) #5
  call void @_ZNSt10lock_guardISt5mutexED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %6) #5
  br label %43

43:                                               ; preds = %41, %39
  %.pn = phi { ptr, i32 } [ %42, %41 ], [ %40, %39 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #5
  br label %63

44:                                               ; preds = %61
  %45 = landingpad { ptr, i32 }
          cleanup
  br label %63

46:                                               ; preds = %._crit_edge, %33, %32, %29, %25
  %47 = landingpad { ptr, i32 }
          cleanup
  br label %63

48:                                               ; preds = %.lr.ph, %53
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %53 ]
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %9) #5
  store ptr %1, ptr %9, align 8, !tbaa !5
  %49 = trunc nuw nsw i64 %indvars.iv to i32
  store i32 %49, ptr %37, align 8, !tbaa !9
  store ptr %5, ptr %38, align 8, !tbaa !5
  invoke void @"_ZNSt8functionIFviEEC2IZN4dali13InputOperatorINS3_10CPUBackendEE18ForwardCurrentDataERNS3_10TensorListIS5_EERSt8optionalINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEERNS3_10ThreadPoolEE3$_0vEEOT_"(ptr noundef nonnull align 8 dereferenceable(32) %8, ptr noundef nonnull align 8 dereferenceable(24) %9)
          to label %50 unwind label %54

50:                                               ; preds = %48
  %51 = invoke noundef i64 @_ZNK4dali19TensorListShapeBaseINS_15TensorListShapeILin1EEELin1EE11tensor_sizeEl(ptr noundef nonnull align 8 dereferenceable(28) %27, i64 noundef %indvars.iv)
          to label %52 unwind label %56

52:                                               ; preds = %50
  invoke void @_ZN4dali10ThreadPool7AddWorkESt8functionIFviEElb(ptr noundef nonnull align 8 dereferenceable(224) %3, ptr noundef nonnull %8, i64 noundef %51, i1 noundef zeroext false)
          to label %53 unwind label %56

53:                                               ; preds = %52
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %8) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %9) #5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge, label %48, !llvm.loop !12

54:                                               ; preds = %48
  %55 = landingpad { ptr, i32 }
          cleanup
  br label %58

56:                                               ; preds = %52, %50
  %57 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %8) #5
  br label %58

58:                                               ; preds = %56, %54
  %.pn24 = phi { ptr, i32 } [ %57, %56 ], [ %55, %54 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %9) #5
  br label %63

59:                                               ; preds = %22, %13
  %60 = call noundef ptr @_ZNKR4dali11CachingListINS_6detail14InputQueueItemINS_10CPUBackendEEEE4ItemptEv(ptr noundef nonnull align 8 dereferenceable(24) %5) #5
  call void @_ZSt4swapIN4dali10TensorListINS0_10CPUBackendEEEENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS7_ESt18is_move_assignableIS7_EEE5valueEvE4typeERS7_SG_(ptr noundef nonnull align 8 dereferenceable(304) %1, ptr noundef nonnull align 8 dereferenceable(304) %60) #5
  br label %61

61:                                               ; preds = %._crit_edge, %59
  invoke void @_ZN4dali13InputOperatorINS_10CPUBackendEE13RecycleBufferEONS_11CachingListINS_6detail14InputQueueItemIS1_EEE4ItemE(ptr noundef nonnull align 8 dereferenceable(1016) %0, ptr noundef nonnull align 8 dereferenceable(24) %5)
          to label %62 unwind label %44

62:                                               ; preds = %61
  call void @_ZN4dali11CachingListINS_6detail14InputQueueItemINS_10CPUBackendEEEE4ItemD2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #5
  ret void

63:                                               ; preds = %46, %58, %44, %43
  %.pn27 = phi { ptr, i32 } [ %45, %44 ], [ %.pn, %43 ], [ %.pn24, %58 ], [ %47, %46 ]
  call void @_ZN4dali11CachingListINS_6detail14InputQueueItemINS_10CPUBackendEEEE4ItemD2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #5
  resume { ptr, i32 } %.pn27
}

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4dali11CachingListINS_6detail14InputQueueItemINS_10CPUBackendEEEE8PopFrontEv(ptr dead_on_unwind noalias writable sret(%"class.dali::CachingList<dali::detail::InputQueueItem<dali::CPUBackend>>::Item") align 8, ptr noundef nonnull align 8 dereferenceable(56)) local_unnamed_addr #1 align 2

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

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(40) ptr @_ZNSt8optionalINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEaSEOS6_(ptr noundef nonnull align 8 dereferenceable(40), ptr noundef nonnull align 8 dereferenceable(40)) local_unnamed_addr #3 align 2

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

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

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

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

declare void @_ZN4dali10TensorListINS_10CPUBackendEE6ResizeERKNS_15TensorListShapeILin1EEE13_DALIDataTypeNS_15BatchContiguityE(ptr noundef nonnull align 8 dereferenceable(304), ptr noundef nonnull align 8 dereferenceable(32), i32 noundef, i32 noundef) local_unnamed_addr #4

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

declare void @_ZN4dali10TensorListINS_10CPUBackendEE9SetLayoutERKNS_12TensorLayoutE(ptr noundef nonnull align 8 dereferenceable(304), ptr noundef nonnull align 1 dereferenceable(16)) local_unnamed_addr #4

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 1 dereferenceable(16) ptr @_ZNKR4dali10TensorListINS_10CPUBackendEE9GetLayoutEv(ptr noundef nonnull align 8 dereferenceable(304)) local_unnamed_addr #3 align 2

declare void @_ZN4dali10ThreadPool7AddWorkESt8functionIFviEElb(ptr noundef nonnull align 8 dereferenceable(224), ptr noundef, i64 noundef, i1 noundef zeroext) local_unnamed_addr #4

; Function Attrs: mustprogress uwtable
declare hidden void @"_ZNSt8functionIFviEEC2IZN4dali13InputOperatorINS3_10CPUBackendEE18ForwardCurrentDataERNS3_10TensorListIS5_EERSt8optionalINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEERNS3_10ThreadPoolEE3$_0vEEOT_"(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #1 align 2

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

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

declare void @_ZN4dali10ThreadPool6RunAllEb(ptr noundef nonnull align 8 dereferenceable(224), i1 noundef zeroext) local_unnamed_addr #4

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZSt4swapIN4dali10TensorListINS0_10CPUBackendEEEENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS7_ESt18is_move_assignableIS7_EEE5valueEvE4typeERS7_SG_(ptr noundef nonnull align 8 dereferenceable(304), ptr noundef nonnull align 8 dereferenceable(304)) local_unnamed_addr #3

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress 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 = { "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, !11, i64 8}
!10 = !{!"_ZTSZN4dali13InputOperatorINS_10CPUBackendEE18ForwardCurrentDataERNS_10TensorListIS1_EERSt8optionalINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEERNS_10ThreadPoolEE3$_0", !6, i64 0, !11, i64 8, !6, i64 16}
!11 = !{!"int", !7, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}


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