; LLVM IR from NVIDIA/DALI :: dali/operators/segmentation (random_object_bbox)

; 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::ConstSampleView" = type { %"class.dali::SampleViewBase.base", [4 x i8] }
%"class.dali::SampleViewBase.base" = type <{ ptr, %"struct.dali::TensorShape", i32 }>
%"struct.dali::TensorShape" = type { %"struct.dali::TensorShapeBase" }
%"struct.dali::TensorShapeBase" = type { %"class.dali::SmallVector.80" }
%"class.dali::SmallVector.80" = type { %union.anon.83, i64 }
%union.anon.83 = type { %struct.anon.84, [32 x i8] }
%struct.anon.84 = type { ptr, i64 }
%class.anon.224 = type { i8 }
%"class.dali::RandomObjectBBox" = type { %"class.dali::rng::OperatorWithRng", %"struct.dali::RandomObjectBBox::ClassInfo", %"struct.dali::RandomObjectBBox::SampleContext", %"struct.dali::RandomObjectBBox::SampleContext.120", %"class.dali::Tensor", %"class.dali::Tensor", i8, i32, i32, [4 x i8], %"class.dali::ArgValue", %"class.dali::ArgValue.137", %"class.dali::ArgValue.145", %"class.dali::ArgValue.159", %"class.dali::ArgValue.137", i32, i8, %"class.std::unordered_map.163" }
%"class.dali::rng::OperatorWithRng" = type { %"class.dali::Operator", %"class.dali::BatchRNG", %"struct.dali::rng::OperatorWithRngFields" }
%"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.33", %"class.std::map.38", %"class.std::vector.43", %"class.std::map.38", %"class.std::map.48", %"class.std::vector.53", %"class.std::vector.53", %"class.std::map.58" }
%"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.33" = type { %"struct.std::_Vector_base.34" }
%"struct.std::_Vector_base.34" = 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.43" = type { %"struct.std::_Vector_base.44" }
%"struct.std::_Vector_base.44" = 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.38" = type { %"class.std::_Rb_tree.39" }
%"class.std::_Rb_tree.39" = 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.48" = type { %"class.std::_Rb_tree.49" }
%"class.std::_Rb_tree.49" = 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.53" = type { %"struct.std::_Vector_base.54" }
%"struct.std::_Vector_base.54" = 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.58" = type { %"class.std::_Rb_tree.59" }
%"class.std::_Rb_tree.59" = 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::BatchRNG" = type { i64, %"class.std::vector.68" }
%"class.std::vector.68" = type { %"struct.std::_Vector_base.69" }
%"struct.std::_Vector_base.69" = type { %"struct.std::_Vector_base<std::mersenne_twister_engine<unsigned long, 64, 312, 156, 31, 13043109905998158313, 29, 6148914691236517205, 17, 8202884508482404352, 37, 18444473444759240704, 43, 6364136223846793005>, std::allocator<std::mersenne_twister_engine<unsigned long, 64, 312, 156, 31, 13043109905998158313, 29, 6148914691236517205, 17, 8202884508482404352, 37, 18444473444759240704, 43, 6364136223846793005>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::mersenne_twister_engine<unsigned long, 64, 312, 156, 31, 13043109905998158313, 29, 6148914691236517205, 17, 8202884508482404352, 37, 18444473444759240704, 43, 6364136223846793005>, std::allocator<std::mersenne_twister_engine<unsigned long, 64, 312, 156, 31, 13043109905998158313, 29, 6148914691236517205, 17, 8202884508482404352, 37, 18444473444759240704, 43, 6364136223846793005>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::mersenne_twister_engine<unsigned long, 64, 312, 156, 31, 13043109905998158313, 29, 6148914691236517205, 17, 8202884508482404352, 37, 18444473444759240704, 43, 6364136223846793005>, std::allocator<std::mersenne_twister_engine<unsigned long, 64, 312, 156, 31, 13043109905998158313, 29, 6148914691236517205, 17, 8202884508482404352, 37, 18444473444759240704, 43, 6364136223846793005>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::mersenne_twister_engine<unsigned long, 64, 312, 156, 31, 13043109905998158313, 29, 6148914691236517205, 17, 8202884508482404352, 37, 18444473444759240704, 43, 6364136223846793005>, std::allocator<std::mersenne_twister_engine<unsigned long, 64, 312, 156, 31, 13043109905998158313, 29, 6148914691236517205, 17, 8202884508482404352, 37, 18444473444759240704, 43, 6364136223846793005>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"struct.dali::rng::OperatorWithRngFields" = type { %"class.std::any" }
%"class.std::any" = type { ptr, %"union.std::any::_Storage" }
%"union.std::any::_Storage" = type { ptr }
%"struct.dali::RandomObjectBBox::ClassInfo" = type <{ %"class.dali::SmallVector", %"class.dali::SmallVector.75", %"class.dali::SmallVector.75", i32, [4 x i8] }>
%"class.dali::SmallVector" = type { %union.anon.73, i64 }
%union.anon.73 = type { %struct.anon.74, [112 x i8] }
%struct.anon.74 = type { ptr, i64 }
%"class.dali::SmallVector.75" = type { %union.anon.78, i64 }
%union.anon.78 = type { %struct.anon.79, [112 x i8] }
%struct.anon.79 = type { ptr, i64 }
%"struct.dali::RandomObjectBBox::SampleContext" = type { ptr, %"struct.dali::TensorView", %"struct.dali::TensorView", %"class.dali::ConstSampleView", i32, i32, i32, %"struct.dali::TensorView.85", %"struct.dali::TensorView", %"class.std::unordered_set", %"class.dali::SmallVector.106", %"class.std::vector.111", %struct.anon.116 }
%"struct.dali::TensorView.85" = type { %"struct.dali::TensorViewBase.86" }
%"struct.dali::TensorViewBase.86" = type { ptr, %"struct.dali::TensorShape" }
%"struct.dali::TensorView" = type { %"struct.dali::TensorViewBase" }
%"struct.dali::TensorViewBase" = type { ptr, %"struct.dali::TensorShape" }
%"class.std::unordered_set" = type { %"class.std::_Hashtable.87" }
%"class.std::_Hashtable.87" = type { ptr, i64, %"struct.std::__detail::_Hash_node_base", i64, %"struct.std::__detail::_Prime_rehash_policy", ptr }
%"class.dali::SmallVector.106" = type { %union.anon.109, i64 }
%union.anon.109 = type { %struct.anon.110, [432 x i8] }
%struct.anon.110 = type { ptr, i64 }
%"class.std::vector.111" = type { %"struct.std::_Vector_base.112" }
%"struct.std::_Vector_base.112" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%struct.anon.116 = type { %"class.dali::SmallVector.117", %"class.dali::SmallVector.117" }
%"class.dali::SmallVector.117" = type { %union.anon.118, i64 }
%union.anon.118 = type { %struct.anon.119, [8 x i8] }
%struct.anon.119 = type { ptr, i64 }
%"struct.dali::RandomObjectBBox::SampleContext.120" = type { ptr, %"struct.dali::TensorView", %"struct.dali::TensorView", %"class.dali::ConstSampleView", i32, i32, i32, %"struct.dali::TensorView.85", %"struct.dali::TensorView.121", %"class.std::unordered_set", %"class.dali::SmallVector.106", %"class.std::vector.111", %struct.anon.123 }
%"struct.dali::TensorView.121" = type { %"struct.dali::TensorViewBase.122" }
%"struct.dali::TensorViewBase.122" = type { ptr, %"struct.dali::TensorShape" }
%struct.anon.123 = type { %"class.dali::SmallVector.117", %"class.dali::SmallVector.117" }
%"class.dali::Tensor" = type { %"class.dali::Buffer.base", %"struct.dali::TensorShape", %"class.dali::DALIMeta", %"class.dali::CUDASharedEvent" }
%"class.dali::Buffer.base" = type <{ ptr, %"class.dali::TypeInfo", %"class.std::shared_ptr", %"class.std::function.124", i64, i64, i32, [4 x i8], %"class.dali::AccessOrder", i8, i8 }>
%"class.dali::TypeInfo" = type { ptr, i32, i64, %"class.std::basic_string_view" }
%"class.std::basic_string_view" = type { i64, ptr }
%"class.std::shared_ptr" = type { %"class.std::__shared_ptr" }
%"class.std::__shared_ptr" = type { ptr, %"class.std::__shared_count" }
%"class.std::__shared_count" = type { ptr }
%"class.std::function.124" = 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.dali::AccessOrder" = type <{ ptr, i32, [4 x i8] }>
%"class.dali::DALIMeta" = type <{ %"class.dali::TensorLayout", %"class.std::__cxx11::basic_string", i8, [7 x i8] }>
%"class.dali::TensorLayout" = type { [16 x i8] }
%"class.dali::CUDASharedEvent" = type { %"class.std::shared_ptr" }
%"class.dali::ArgValue" = type <{ %"class.std::__cxx11::basic_string", %"class.std::vector.111", %"struct.dali::TensorListView", i8, i8, [6 x i8], i64, i8, [7 x i8] }>
%"struct.dali::TensorListView" = type { %"struct.dali::TensorListViewBase" }
%"struct.dali::TensorListViewBase" = type { %"struct.dali::TensorListShape", %"class.std::vector.132" }
%"struct.dali::TensorListShape" = type { %"struct.dali::TensorListShapeBase.base", [4 x i8] }
%"struct.dali::TensorListShapeBase.base" = type <{ %"class.std::vector.127", i32 }>
%"class.std::vector.127" = type { %"struct.std::_Vector_base.128" }
%"struct.std::_Vector_base.128" = 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.std::vector.132" = type { %"struct.std::_Vector_base.133" }
%"struct.std::_Vector_base.133" = type { %"struct.std::_Vector_base<const int *, std::allocator<const int *>>::_Vector_impl" }
%"struct.std::_Vector_base<const int *, std::allocator<const int *>>::_Vector_impl" = type { %"struct.std::_Vector_base<const int *, std::allocator<const int *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<const int *, std::allocator<const int *>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.dali::ArgValue.145" = type <{ %"class.std::__cxx11::basic_string", %"class.std::vector.146", %"struct.dali::TensorListView.151", i8, i8, [6 x i8], i64, i8, [7 x i8] }>
%"class.std::vector.146" = type { %"struct.std::_Vector_base.147" }
%"struct.std::_Vector_base.147" = type { %"struct.std::_Vector_base<float, std::allocator<float>>::_Vector_impl" }
%"struct.std::_Vector_base<float, std::allocator<float>>::_Vector_impl" = type { %"struct.std::_Vector_base<float, std::allocator<float>>::_Vector_impl_data" }
%"struct.std::_Vector_base<float, std::allocator<float>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"struct.dali::TensorListView.151" = type { %"struct.dali::TensorListViewBase.152" }
%"struct.dali::TensorListViewBase.152" = type { %"struct.dali::TensorListShape", %"class.std::vector.153" }
%"class.std::vector.153" = type { %"struct.std::_Vector_base.154" }
%"struct.std::_Vector_base.154" = type { %"struct.std::_Vector_base<const float *, std::allocator<const float *>>::_Vector_impl" }
%"struct.std::_Vector_base<const float *, std::allocator<const float *>>::_Vector_impl" = type { %"struct.std::_Vector_base<const float *, std::allocator<const float *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<const float *, std::allocator<const float *>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.dali::ArgValue.159" = type <{ %"class.std::__cxx11::basic_string", %"class.std::vector.146", %"struct.dali::TensorListView.160", i8, i8, [6 x i8], i64, i8, [7 x i8] }>
%"struct.dali::TensorListView.160" = type { %"struct.dali::TensorListViewBase.161" }
%"struct.dali::TensorListViewBase.161" = type { %"struct.dali::TensorListShape.140", %"class.std::vector.153" }
%"struct.dali::TensorListShape.140" = type { %"struct.dali::TensorListShapeBase.base.142", [4 x i8] }
%"struct.dali::TensorListShapeBase.base.142" = type <{ %"class.std::vector.127", i32 }>
%"class.dali::ArgValue.137" = type <{ %"class.std::__cxx11::basic_string", %"class.std::vector.111", %"struct.dali::TensorListView.138", i8, i8, [6 x i8], i64, i8, [7 x i8] }>
%"struct.dali::TensorListView.138" = type { %"struct.dali::TensorListViewBase.139" }
%"struct.dali::TensorListViewBase.139" = type { %"struct.dali::TensorListShape.140", %"class.std::vector.132" }
%"class.std::unordered_map.163" = type { %"class.std::_Hashtable.164" }
%"class.std::_Hashtable.164" = type { ptr, i64, %"struct.std::__detail::_Hash_node_base", i64, %"struct.std::__detail::_Prime_rehash_policy", 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 nounwind uwtable
declare dso_local noundef i32 @_ZNK4dali10TensorListINS_10CPUBackendEE11num_samplesEv(ptr noundef nonnull align 8 dereferenceable(304)) #1 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4dali16RandomObjectBBox19AllocateTempStorageERKNS_10TensorListINS_10CPUBackendEEE(ptr noundef nonnull align 8 dereferenceable(4072) %0, ptr noundef nonnull align 8 dereferenceable(304) %1) #2 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i64, align 8
  %6 = alloca i64, align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i64, align 8
  %10 = alloca %"class.dali::ConstSampleView", align 8
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i64, align 8
  %15 = alloca %class.anon.224, align 1
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %16 = load ptr, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #5
  store i64 0, ptr %5, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #5
  store i64 0, ptr %6, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  %17 = load ptr, ptr %4, align 8, !tbaa !5
  %18 = call noundef i32 @_ZNK4dali10TensorListINS_10CPUBackendEE11num_samplesEv(ptr noundef nonnull align 8 dereferenceable(304) %17) #5
  store i32 %18, ptr %7, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  store i32 0, ptr %8, align 4, !tbaa !11
  br label %19

19:                                               ; preds = %56, %2
  %20 = load i32, ptr %8, align 4, !tbaa !11
  %21 = load i32, ptr %7, align 4, !tbaa !11
  %22 = icmp slt i32 %20, %21
  br i1 %22, label %24, label %23

23:                                               ; preds = %19
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  br label %59

24:                                               ; preds = %19
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #5
  call void @llvm.lifetime.start.p0(i64 72, ptr %10) #5
  %25 = load ptr, ptr %4, align 8, !tbaa !5
  %26 = load i32, ptr %8, align 4, !tbaa !11
  %27 = sext i32 %26 to i64
  call void @_ZNK4dali10TensorListINS_10CPUBackendEEixEm(ptr dead_on_unwind writable sret(%"class.dali::ConstSampleView") align 8 %10, ptr noundef nonnull align 8 dereferenceable(304) %25, i64 noundef %27)
  %28 = invoke noundef nonnull align 8 dereferenceable(56) ptr @_ZNK4dali14SampleViewBaseINS_10CPUBackendEPKvE5shapeEv(ptr noundef nonnull align 8 dereferenceable(68) %10)
          to label %29 unwind label %45

29:                                               ; preds = %24
  %30 = invoke noundef i64 @_ZNK4dali15TensorShapeBaseINS_11SmallVectorIlLm6ESaIlEEELin1EE12num_elementsEv(ptr noundef nonnull align 8 dereferenceable(56) %28)
          to label %31 unwind label %45

31:                                               ; preds = %29
  call void @_ZN4dali14SampleViewBaseINS_10CPUBackendEPKvED2Ev(ptr noundef nonnull align 8 dereferenceable(68) %10) #5
  call void @llvm.lifetime.end.p0(i64 72, ptr %10) #5
  store i64 %30, ptr %9, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  %32 = load i64, ptr %9, align 8, !tbaa !9
  %33 = icmp sgt i64 %32, 2147483648
  %34 = zext i1 %33 to i64
  %35 = select i1 %33, i32 8, i32 4
  store i32 %35, ptr %13, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #5
  %36 = load i64, ptr %9, align 8, !tbaa !9
  %37 = load i32, ptr %13, align 4, !tbaa !11
  %38 = sext i32 %37 to i64
  %39 = mul nsw i64 %36, %38
  store i64 %39, ptr %14, align 8, !tbaa !9
  %40 = load i64, ptr %14, align 8, !tbaa !9
  %41 = load i64, ptr %5, align 8, !tbaa !9
  %42 = icmp sgt i64 %40, %41
  br i1 %42, label %43, label %49

43:                                               ; preds = %31
  %44 = load i64, ptr %14, align 8, !tbaa !9
  store i64 %44, ptr %5, align 8, !tbaa !9
  br label %49

45:                                               ; preds = %29, %24
  %46 = landingpad { ptr, i32 }
          cleanup
  %47 = extractvalue { ptr, i32 } %46, 0
  store ptr %47, ptr %11, align 8
  %48 = extractvalue { ptr, i32 } %46, 1
  store i32 %48, ptr %12, align 4
  call void @_ZN4dali14SampleViewBaseINS_10CPUBackendEPKvED2Ev(ptr noundef nonnull align 8 dereferenceable(68) %10) #5
  call void @llvm.lifetime.end.p0(i64 72, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #5
  br label %64

49:                                               ; preds = %43, %31
  %50 = load i64, ptr %9, align 8, !tbaa !9
  %51 = load i64, ptr %6, align 8, !tbaa !9
  %52 = icmp sgt i64 %50, %51
  br i1 %52, label %53, label %55

53:                                               ; preds = %49
  %54 = load i64, ptr %9, align 8, !tbaa !9
  store i64 %54, ptr %6, align 8, !tbaa !9
  br label %55

55:                                               ; preds = %53, %49
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  br label %56

56:                                               ; preds = %55
  %57 = load i32, ptr %8, align 4, !tbaa !11
  %58 = add nsw i32 %57, 1
  store i32 %58, ptr %8, align 4, !tbaa !11
  br label %19, !llvm.loop !13

59:                                               ; preds = %23
  call void @llvm.lifetime.start.p0(i64 1, ptr %15) #5
  %60 = getelementptr inbounds %"class.dali::RandomObjectBBox", ptr %16, i32 0, i32 4
  %61 = load i64, ptr %5, align 8, !tbaa !9
  call void @"_ZZN4dali16RandomObjectBBox19AllocateTempStorageERKNS_10TensorListINS_10CPUBackendEEEENK3$_0clERNS_6TensorIS2_EEl"(ptr noundef nonnull align 1 dereferenceable(1) %15, ptr noundef nonnull align 8 dereferenceable(272) %60, i64 noundef %61)
  %62 = getelementptr inbounds %"class.dali::RandomObjectBBox", ptr %16, i32 0, i32 5
  %63 = load i64, ptr %6, align 8, !tbaa !9
  call void @"_ZZN4dali16RandomObjectBBox19AllocateTempStorageERKNS_10TensorListINS_10CPUBackendEEEENK3$_0clERNS_6TensorIS2_EEl"(ptr noundef nonnull align 1 dereferenceable(1) %15, ptr noundef nonnull align 8 dereferenceable(272) %62, i64 noundef %63)
  call void @llvm.lifetime.end.p0(i64 1, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #5
  ret void

64:                                               ; preds = %45
  %65 = load ptr, ptr %11, align 8
  %66 = load i32, ptr %12, align 4
  %67 = insertvalue { ptr, i32 } poison, ptr %65, 0
  %68 = insertvalue { ptr, i32 } %67, i32 %66, 1
  resume { ptr, i32 } %68
}

declare void @_ZNK4dali10TensorListINS_10CPUBackendEEixEm(ptr dead_on_unwind writable sret(%"class.dali::ConstSampleView") align 8, ptr noundef nonnull align 8 dereferenceable(304), i64 noundef) #3

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare hidden void @"_ZZN4dali16RandomObjectBBox19AllocateTempStorageERKNS_10TensorListINS_10CPUBackendEEEENK3$_0clERNS_6TensorIS2_EEl"(ptr noundef nonnull align 1 dereferenceable(1), ptr noundef nonnull align 8 dereferenceable(272), i64 noundef) #4 align 2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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 = !{!"long", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!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::ConstSampleView" = type { %"class.dali::SampleViewBase.base", [4 x i8] }
%"class.dali::SampleViewBase.base" = type <{ ptr, %"struct.dali::TensorShape", i32 }>
%"struct.dali::TensorShape" = type { %"struct.dali::TensorShapeBase" }
%"struct.dali::TensorShapeBase" = type { %"class.dali::SmallVector.80" }
%"class.dali::SmallVector.80" = type { %union.anon.83, i64 }
%union.anon.83 = type { %struct.anon.84, [32 x i8] }
%struct.anon.84 = type { ptr, i64 }
%class.anon.224 = type { i8 }

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4dali16RandomObjectBBox19AllocateTempStorageERKNS_10TensorListINS_10CPUBackendEEE(ptr noundef nonnull align 8 dereferenceable(4072) %0, ptr noundef nonnull align 8 dereferenceable(304) %1) local_unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca %"class.dali::ConstSampleView", align 8
  %4 = alloca %class.anon.224, align 1
  %5 = tail call noundef i32 @_ZNK4dali10TensorListINS_10CPUBackendEE11num_samplesEv(ptr noundef nonnull align 8 dereferenceable(304) %1) #6
  %6 = icmp sgt i32 %5, 0
  br i1 %6, label %.lr.ph.preheader, label %._crit_edge

.lr.ph.preheader:                                 ; preds = %2
  %wide.trip.count = zext nneg i32 %5 to i64
  br label %.lr.ph

._crit_edge:                                      ; preds = %11, %2
  %.019.lcssa = phi i64 [ 0, %2 ], [ %.120, %11 ]
  %.0.lcssa = phi i64 [ 0, %2 ], [ %spec.select, %11 ]
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %4) #6
  %7 = getelementptr inbounds i8, ptr %0, i64 2768
  call void @"_ZZN4dali16RandomObjectBBox19AllocateTempStorageERKNS_10TensorListINS_10CPUBackendEEEENK3$_0clERNS_6TensorIS2_EEl"(ptr noundef nonnull align 1 dereferenceable(1) %4, ptr noundef nonnull align 8 dereferenceable(272) %7, i64 noundef %.0.lcssa)
  %8 = getelementptr inbounds i8, ptr %0, i64 3040
  call void @"_ZZN4dali16RandomObjectBBox19AllocateTempStorageERKNS_10TensorListINS_10CPUBackendEEEENK3$_0clERNS_6TensorIS2_EEl"(ptr noundef nonnull align 1 dereferenceable(1) %4, ptr noundef nonnull align 8 dereferenceable(272) %8, i64 noundef %.019.lcssa)
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %4) #6
  ret void

.lr.ph:                                           ; preds = %.lr.ph.preheader, %11
  %indvars.iv = phi i64 [ 0, %.lr.ph.preheader ], [ %indvars.iv.next, %11 ]
  %.028 = phi i64 [ 0, %.lr.ph.preheader ], [ %spec.select, %11 ]
  %.01927 = phi i64 [ 0, %.lr.ph.preheader ], [ %.120, %11 ]
  call void @llvm.lifetime.start.p0(i64 72, ptr nonnull %3) #6
  call void @_ZNK4dali10TensorListINS_10CPUBackendEEixEm(ptr dead_on_unwind nonnull writable sret(%"class.dali::ConstSampleView") align 8 %3, ptr noundef nonnull align 8 dereferenceable(304) %1, i64 noundef %indvars.iv)
  %9 = call noundef nonnull align 8 dereferenceable(56) ptr @_ZNK4dali14SampleViewBaseINS_10CPUBackendEPKvE5shapeEv(ptr noundef nonnull align 8 dereferenceable(68) %3)
  %10 = invoke noundef i64 @_ZNK4dali15TensorShapeBaseINS_11SmallVectorIlLm6ESaIlEEELin1EE12num_elementsEv(ptr noundef nonnull align 8 dereferenceable(56) %9)
          to label %11 unwind label %15

11:                                               ; preds = %.lr.ph
  call void @_ZN4dali14SampleViewBaseINS_10CPUBackendEPKvED2Ev(ptr noundef nonnull align 8 dereferenceable(68) %3) #6
  call void @llvm.lifetime.end.p0(i64 72, ptr nonnull %3) #6
  %12 = icmp sgt i64 %10, 2147483648
  %13 = select i1 %12, i64 3, i64 2
  %14 = shl i64 %10, %13
  %spec.select = call i64 @llvm.smax.i64(i64 %14, i64 %.028)
  %.120 = call i64 @llvm.smax.i64(i64 %10, i64 %.01927)
  %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 %.lr.ph, !llvm.loop !5

15:                                               ; preds = %.lr.ph
  %16 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN4dali14SampleViewBaseINS_10CPUBackendEPKvED2Ev(ptr noundef nonnull align 8 dereferenceable(68) %3) #6
  call void @llvm.lifetime.end.p0(i64 72, ptr nonnull %3) #6
  resume { ptr, i32 } %16
}

declare void @_ZNK4dali10TensorListINS_10CPUBackendEEixEm(ptr dead_on_unwind writable sret(%"class.dali::ConstSampleView") align 8, ptr noundef nonnull align 8 dereferenceable(304), i64 noundef) local_unnamed_addr #3

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare hidden void @"_ZZN4dali16RandomObjectBBox19AllocateTempStorageERKNS_10TensorListINS_10CPUBackendEEEENK3$_0clERNS_6TensorIS2_EEl"(ptr noundef nonnull align 1 dereferenceable(1), ptr noundef nonnull align 8 dereferenceable(272), i64 noundef) local_unnamed_addr #4 align 2

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smax.i64(i64, i64) #5

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass,TailCallElimPass