; LLVM IR from NVIDIA/DALI :: dali/operators/reader (webdataset_reader_op)

; 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"

%"struct.dali::TensorListShape" = type { %"struct.dali::TensorListShapeBase.base", i32 }
%"struct.dali::TensorListShapeBase.base" = type <{ %"class.std::vector.104", i32 }>
%"class.std::vector.104" = type { %"struct.std::_Vector_base.105" }
%"struct.std::_Vector_base.105" = 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 }
%"struct.dali::OutputDesc" = type { %"struct.dali::TensorListShape", i32, [4 x i8] }

; 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 noundef zeroext i1 @_ZN4dali16WebdatasetReader9SetupImplERSt6vectorINS_10OutputDescESaIS2_EERKNS_9WorkspaceE(ptr noundef nonnull align 8 dereferenceable(664) %0, ptr noundef nonnull align 8 dereferenceable(24) %1, ptr noundef nonnull align 8 dereferenceable(664) %2) unnamed_addr #1 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca %"struct.dali::TensorListShape", align 8
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca ptr, align 8
  %16 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  store ptr %2, ptr %6, align 8, !tbaa !5
  %17 = load ptr, ptr %4, align 8
  %18 = load ptr, ptr %5, align 8, !tbaa !5
  %19 = load ptr, ptr %6, align 8, !tbaa !5
  %20 = call noundef zeroext i1 @_ZN4dali10DataReaderINS_10CPUBackendESt6vectorINS_6TensorIS1_EESaIS4_EES6_Lb1EE9SetupImplERS2_INS_10OutputDescESaIS8_EERKNS_9WorkspaceE(ptr noundef nonnull align 8 dereferenceable(664) %17, ptr noundef nonnull align 8 dereferenceable(24) %18, ptr noundef nonnull align 8 dereferenceable(664) %19)
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  %21 = load ptr, ptr %6, align 8, !tbaa !5
  %22 = call noundef i32 @_ZNK4dali13WorkspaceBaseINS_10TensorListESt10shared_ptrE9NumOutputEv(ptr noundef nonnull align 8 dereferenceable(664) %21)
  store i32 %22, ptr %7, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  %23 = call noundef i32 @_ZNK4dali10DataReaderINS_10CPUBackendESt6vectorINS_6TensorIS1_EESaIS4_EES6_Lb1EE16GetCurrBatchSizeEv(ptr noundef nonnull align 8 dereferenceable(664) %17)
  store i32 %23, ptr %8, align 4, !tbaa !9
  %24 = load ptr, ptr %5, align 8, !tbaa !5
  %25 = load i32, ptr %7, align 4, !tbaa !9
  %26 = sext i32 %25 to i64
  call void @_ZNSt6vectorIN4dali10OutputDescESaIS1_EE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24) %24, i64 noundef %26)
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  store i32 0, ptr %9, align 4, !tbaa !9
  br label %27

27:                                               ; preds = %41, %3
  %28 = load i32, ptr %9, align 4, !tbaa !9
  %29 = load i32, ptr %7, align 4, !tbaa !9
  %30 = icmp slt i32 %28, %29
  br i1 %30, label %32, label %31

31:                                               ; preds = %27
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  br label %48

32:                                               ; preds = %27
  call void @llvm.lifetime.start.p0(i64 32, ptr %10) #5
  %33 = load i32, ptr %8, align 4, !tbaa !9
  call void @_ZN4dali15TensorListShapeILin1EEC2Eii(ptr noundef nonnull align 8 dereferenceable(32) %10, i32 noundef %33, i32 noundef 1)
  %34 = load ptr, ptr %5, align 8, !tbaa !5
  %35 = load i32, ptr %9, align 4, !tbaa !9
  %36 = sext i32 %35 to i64
  %37 = call noundef nonnull align 8 dereferenceable(36) ptr @_ZNSt6vectorIN4dali10OutputDescESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %34, i64 noundef %36) #5
  %38 = getelementptr inbounds %"struct.dali::OutputDesc", ptr %37, i32 0, i32 0
  %39 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZN4dali15TensorListShapeILin1EEaSEOS1_(ptr noundef nonnull align 8 dereferenceable(32) %38, ptr noundef nonnull align 8 dereferenceable(32) %10)
          to label %40 unwind label %44

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

41:                                               ; preds = %40
  %42 = load i32, ptr %9, align 4, !tbaa !9
  %43 = add nsw i32 %42, 1
  store i32 %43, ptr %9, align 4, !tbaa !9
  br label %27, !llvm.loop !11

44:                                               ; preds = %32
  %45 = landingpad { ptr, i32 }
          cleanup
  %46 = extractvalue { ptr, i32 } %45, 0
  store ptr %46, ptr %11, align 8
  %47 = extractvalue { ptr, i32 } %45, 1
  store i32 %47, ptr %12, align 4
  call void @_ZN4dali19TensorListShapeBaseINS_15TensorListShapeILin1EEELin1EED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %10) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 4, 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
  br label %93

48:                                               ; preds = %31
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  store i32 0, ptr %13, align 4, !tbaa !9
  br label %49

49:                                               ; preds = %89, %48
  %50 = load i32, ptr %13, align 4, !tbaa !9
  %51 = load i32, ptr %8, align 4, !tbaa !9
  %52 = icmp slt i32 %50, %51
  br i1 %52, label %54, label %53

53:                                               ; preds = %49
  store i32 5, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  br label %92

54:                                               ; preds = %49
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #5
  %55 = load i32, ptr %13, align 4, !tbaa !9
  %56 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN4dali10DataReaderINS_10CPUBackendESt6vectorINS_6TensorIS1_EESaIS4_EES6_Lb1EE9GetSampleEi(ptr noundef nonnull align 8 dereferenceable(664) %17, i32 noundef %55)
  store ptr %56, ptr %15, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #5
  store i32 0, ptr %16, align 4, !tbaa !9
  br label %57

57:                                               ; preds = %85, %54
  %58 = load i32, ptr %16, align 4, !tbaa !9
  %59 = load i32, ptr %7, align 4, !tbaa !9
  %60 = icmp slt i32 %58, %59
  br i1 %60, label %62, label %61

61:                                               ; preds = %57
  store i32 8, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #5
  br label %88

62:                                               ; preds = %57
  %63 = load ptr, ptr %5, align 8, !tbaa !5
  %64 = load i32, ptr %16, align 4, !tbaa !9
  %65 = sext i32 %64 to i64
  %66 = call noundef nonnull align 8 dereferenceable(36) ptr @_ZNSt6vectorIN4dali10OutputDescESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %63, i64 noundef %65) #5
  %67 = getelementptr inbounds %"struct.dali::OutputDesc", ptr %66, i32 0, i32 0
  %68 = load i32, ptr %13, align 4, !tbaa !9
  %69 = sext i32 %68 to i64
  %70 = load ptr, ptr %15, align 8, !tbaa !5
  %71 = load i32, ptr %16, align 4, !tbaa !9
  %72 = sext i32 %71 to i64
  %73 = call noundef nonnull align 8 dereferenceable(272) ptr @_ZNSt6vectorIN4dali6TensorINS0_10CPUBackendEEESaIS3_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %70, i64 noundef %72) #5
  %74 = call noundef nonnull align 8 dereferenceable(56) ptr @_ZNKR4dali6TensorINS_10CPUBackendEE5shapeEv(ptr noundef nonnull align 8 dereferenceable(272) %73)
  call void @_ZN4dali19TensorListShapeBaseINS_15TensorListShapeILin1EEELin1EE16set_tensor_shapeElRKNS_11TensorShapeILin1EEE(ptr noundef nonnull align 8 dereferenceable(28) %67, i64 noundef %69, ptr noundef nonnull align 8 dereferenceable(56) %74)
  %75 = load ptr, ptr %15, align 8, !tbaa !5
  %76 = load i32, ptr %16, align 4, !tbaa !9
  %77 = sext i32 %76 to i64
  %78 = call noundef nonnull align 8 dereferenceable(272) ptr @_ZNSt6vectorIN4dali6TensorINS0_10CPUBackendEEESaIS3_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %75, i64 noundef %77) #5
  %79 = call noundef i32 @_ZNK4dali6BufferINS_10CPUBackendEE4typeEv(ptr noundef nonnull align 8 dereferenceable(138) %78)
  %80 = load ptr, ptr %5, align 8, !tbaa !5
  %81 = load i32, ptr %16, align 4, !tbaa !9
  %82 = sext i32 %81 to i64
  %83 = call noundef nonnull align 8 dereferenceable(36) ptr @_ZNSt6vectorIN4dali10OutputDescESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %80, i64 noundef %82) #5
  %84 = getelementptr inbounds %"struct.dali::OutputDesc", ptr %83, i32 0, i32 1
  store i32 %79, ptr %84, align 8, !tbaa !13
  br label %85

85:                                               ; preds = %62
  %86 = load i32, ptr %16, align 4, !tbaa !9
  %87 = add nsw i32 %86, 1
  store i32 %87, ptr %16, align 4, !tbaa !9
  br label %57, !llvm.loop !22

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

89:                                               ; preds = %88
  %90 = load i32, ptr %13, align 4, !tbaa !9
  %91 = add nsw i32 %90, 1
  store i32 %91, ptr %13, align 4, !tbaa !9
  br label %49, !llvm.loop !23

92:                                               ; preds = %53
  store i32 1, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  ret i1 true

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN4dali10DataReaderINS_10CPUBackendESt6vectorINS_6TensorIS1_EESaIS4_EES6_Lb1EE9SetupImplERS2_INS_10OutputDescESaIS8_EERKNS_9WorkspaceE(ptr noundef nonnull align 8 dereferenceable(664), ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(664)) unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i32 @_ZNK4dali13WorkspaceBaseINS_10TensorListESt10shared_ptrE9NumOutputEv(ptr noundef nonnull align 8 dereferenceable(664)) #2 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i32 @_ZNK4dali10DataReaderINS_10CPUBackendESt6vectorINS_6TensorIS1_EESaIS4_EES6_Lb1EE16GetCurrBatchSizeEv(ptr noundef nonnull align 8 dereferenceable(664)) #2 align 2

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

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

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(24) ptr @_ZN4dali10DataReaderINS_10CPUBackendESt6vectorINS_6TensorIS1_EESaIS4_EES6_Lb1EE9GetSampleEi(ptr noundef nonnull align 8 dereferenceable(664), i32 noundef) #2 align 2

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(56) ptr @_ZNKR4dali6TensorINS_10CPUBackendEE5shapeEv(ptr noundef nonnull align 8 dereferenceable(272)) #4 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i32 @_ZNK4dali6BufferINS_10CPUBackendEE4typeEv(ptr noundef nonnull align 8 dereferenceable(138)) #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 = { 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 #3 = { 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 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 #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 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!14, !21, i64 32}
!14 = !{!"_ZTSN4dali10OutputDescE", !15, i64 0, !21, i64 32}
!15 = !{!"_ZTSN4dali15TensorListShapeILin1EEE", !16, i64 0, !10, i64 28}
!16 = !{!"_ZTSN4dali19TensorListShapeBaseINS_15TensorListShapeILin1EEELin1EEE", !17, i64 0, !10, i64 24}
!17 = !{!"_ZTSSt6vectorIlSaIlEE", !18, i64 0}
!18 = !{!"_ZTSSt12_Vector_baseIlSaIlEE", !19, i64 0}
!19 = !{!"_ZTSNSt12_Vector_baseIlSaIlEE12_Vector_implE", !20, i64 0}
!20 = !{!"_ZTSNSt12_Vector_baseIlSaIlEE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!21 = !{!"_ZTS13_DALIDataType", !7, i64 0}
!22 = distinct !{!22, !12}
!23 = distinct !{!23, !12}


; 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"

%"struct.dali::TensorListShape" = type { %"struct.dali::TensorListShapeBase.base", i32 }
%"struct.dali::TensorListShapeBase.base" = type <{ %"class.std::vector.104", i32 }>
%"class.std::vector.104" = type { %"struct.std::_Vector_base.105" }
%"struct.std::_Vector_base.105" = 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 }

; 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 noundef zeroext i1 @_ZN4dali16WebdatasetReader9SetupImplERSt6vectorINS_10OutputDescESaIS2_EERKNS_9WorkspaceE(ptr noundef nonnull align 8 dereferenceable(664) %0, ptr noundef nonnull align 8 dereferenceable(24) %1, ptr noundef nonnull align 8 dereferenceable(664) %2) unnamed_addr #1 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca %"struct.dali::TensorListShape", align 8
  %5 = tail call noundef zeroext i1 @_ZN4dali10DataReaderINS_10CPUBackendESt6vectorINS_6TensorIS1_EESaIS4_EES6_Lb1EE9SetupImplERS2_INS_10OutputDescESaIS8_EERKNS_9WorkspaceE(ptr noundef nonnull align 8 dereferenceable(664) %0, ptr noundef nonnull align 8 dereferenceable(24) %1, ptr noundef nonnull align 8 dereferenceable(664) %2)
  %6 = tail call noundef i32 @_ZNK4dali13WorkspaceBaseINS_10TensorListESt10shared_ptrE9NumOutputEv(ptr noundef nonnull align 8 dereferenceable(664) %2)
  %7 = tail call noundef i32 @_ZNK4dali10DataReaderINS_10CPUBackendESt6vectorINS_6TensorIS1_EESaIS4_EES6_Lb1EE16GetCurrBatchSizeEv(ptr noundef nonnull align 8 dereferenceable(664) %0)
  %8 = sext i32 %6 to i64
  tail call void @_ZNSt6vectorIN4dali10OutputDescESaIS1_EE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %8)
  %9 = icmp sgt i32 %6, 0
  br i1 %9, label %.lr.ph.preheader, label %.preheader.thread

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

.preheader:                                       ; preds = %24
  %10 = icmp sgt i32 %7, 0
  br i1 %10, label %.lr.ph36, label %._crit_edge37

.preheader.thread:                                ; preds = %3
  %11 = icmp sgt i32 %7, 0
  br i1 %11, label %.lr.ph36.split.preheader, label %._crit_edge37

.lr.ph36:                                         ; preds = %.preheader
  br i1 %9, label %.lr.ph34.us.preheader, label %.lr.ph36.split.preheader

.lr.ph36.split.preheader:                         ; preds = %.preheader.thread, %.lr.ph36
  br label %.lr.ph36.split

.lr.ph34.us.preheader:                            ; preds = %.lr.ph36
  %wide.trip.count49 = zext nneg i32 %7 to i64
  %wide.trip.count44 = zext nneg i32 %6 to i64
  br label %.lr.ph34.us

.lr.ph34.us:                                      ; preds = %.lr.ph34.us.preheader, %._crit_edge.us
  %indvars.iv46 = phi i64 [ 0, %.lr.ph34.us.preheader ], [ %indvars.iv.next47, %._crit_edge.us ]
  %12 = trunc nuw nsw i64 %indvars.iv46 to i32
  %13 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN4dali10DataReaderINS_10CPUBackendESt6vectorINS_6TensorIS1_EESaIS4_EES6_Lb1EE9GetSampleEi(ptr noundef nonnull align 8 dereferenceable(664) %0, i32 noundef %12)
  br label %14

14:                                               ; preds = %.lr.ph34.us, %14
  %indvars.iv41 = phi i64 [ 0, %.lr.ph34.us ], [ %indvars.iv.next42, %14 ]
  %15 = call noundef nonnull align 8 dereferenceable(36) ptr @_ZNSt6vectorIN4dali10OutputDescESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %indvars.iv41) #5
  %16 = call noundef nonnull align 8 dereferenceable(272) ptr @_ZNSt6vectorIN4dali6TensorINS0_10CPUBackendEEESaIS3_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %13, i64 noundef %indvars.iv41) #5
  %17 = call noundef nonnull align 8 dereferenceable(56) ptr @_ZNKR4dali6TensorINS_10CPUBackendEE5shapeEv(ptr noundef nonnull align 8 dereferenceable(272) %16)
  call void @_ZN4dali19TensorListShapeBaseINS_15TensorListShapeILin1EEELin1EE16set_tensor_shapeElRKNS_11TensorShapeILin1EEE(ptr noundef nonnull align 8 dereferenceable(28) %15, i64 noundef %indvars.iv46, ptr noundef nonnull align 8 dereferenceable(56) %17)
  %18 = call noundef nonnull align 8 dereferenceable(272) ptr @_ZNSt6vectorIN4dali6TensorINS0_10CPUBackendEEESaIS3_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %13, i64 noundef %indvars.iv41) #5
  %19 = call noundef i32 @_ZNK4dali6BufferINS_10CPUBackendEE4typeEv(ptr noundef nonnull align 8 dereferenceable(138) %18)
  %20 = call noundef nonnull align 8 dereferenceable(36) ptr @_ZNSt6vectorIN4dali10OutputDescESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %indvars.iv41) #5
  %21 = getelementptr inbounds i8, ptr %20, i64 32
  store i32 %19, ptr %21, align 8, !tbaa !5
  %indvars.iv.next42 = add nuw nsw i64 %indvars.iv41, 1
  %exitcond45.not = icmp eq i64 %indvars.iv.next42, %wide.trip.count44
  br i1 %exitcond45.not, label %._crit_edge.us, label %14, !llvm.loop !18

._crit_edge.us:                                   ; preds = %14
  %indvars.iv.next47 = add nuw nsw i64 %indvars.iv46, 1
  %exitcond50.not = icmp eq i64 %indvars.iv.next47, %wide.trip.count49
  br i1 %exitcond50.not, label %._crit_edge37, label %.lr.ph34.us, !llvm.loop !20

.lr.ph:                                           ; preds = %.lr.ph.preheader, %24
  %indvars.iv = phi i64 [ 0, %.lr.ph.preheader ], [ %indvars.iv.next, %24 ]
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %4) #5
  call void @_ZN4dali15TensorListShapeILin1EEC2Eii(ptr noundef nonnull align 8 dereferenceable(32) %4, i32 noundef %7, i32 noundef 1)
  %22 = call noundef nonnull align 8 dereferenceable(36) ptr @_ZNSt6vectorIN4dali10OutputDescESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %indvars.iv) #5
  %23 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZN4dali15TensorListShapeILin1EEaSEOS1_(ptr noundef nonnull align 8 dereferenceable(32) %22, ptr noundef nonnull align 8 dereferenceable(32) %4)
          to label %24 unwind label %25

24:                                               ; preds = %.lr.ph
  call void @_ZN4dali19TensorListShapeBaseINS_15TensorListShapeILin1EEELin1EED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %4) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %4) #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 %.preheader, label %.lr.ph, !llvm.loop !21

25:                                               ; preds = %.lr.ph
  %26 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN4dali19TensorListShapeBaseINS_15TensorListShapeILin1EEELin1EED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %4) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %4) #5
  resume { ptr, i32 } %26

._crit_edge37:                                    ; preds = %.lr.ph36.split, %._crit_edge.us, %.preheader.thread, %.preheader
  ret i1 true

.lr.ph36.split:                                   ; preds = %.lr.ph36.split.preheader, %.lr.ph36.split
  %.03035 = phi i32 [ %28, %.lr.ph36.split ], [ 0, %.lr.ph36.split.preheader ]
  %27 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN4dali10DataReaderINS_10CPUBackendESt6vectorINS_6TensorIS1_EESaIS4_EES6_Lb1EE9GetSampleEi(ptr noundef nonnull align 8 dereferenceable(664) %0, i32 noundef %.03035)
  %28 = add nuw nsw i32 %.03035, 1
  %exitcond40.not = icmp eq i32 %28, %7
  br i1 %exitcond40.not, label %._crit_edge37, label %.lr.ph36.split, !llvm.loop !20
}

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN4dali10DataReaderINS_10CPUBackendESt6vectorINS_6TensorIS1_EESaIS4_EES6_Lb1EE9SetupImplERS2_INS_10OutputDescESaIS8_EERKNS_9WorkspaceE(ptr noundef nonnull align 8 dereferenceable(664), ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(664)) unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i32 @_ZNK4dali13WorkspaceBaseINS_10TensorListESt10shared_ptrE9NumOutputEv(ptr noundef nonnull align 8 dereferenceable(664)) local_unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i32 @_ZNK4dali10DataReaderINS_10CPUBackendESt6vectorINS_6TensorIS1_EESaIS4_EES6_Lb1EE16GetCurrBatchSizeEv(ptr noundef nonnull align 8 dereferenceable(664)) local_unnamed_addr #2 align 2

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

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

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(24) ptr @_ZN4dali10DataReaderINS_10CPUBackendESt6vectorINS_6TensorIS1_EESaIS4_EES6_Lb1EE9GetSampleEi(ptr noundef nonnull align 8 dereferenceable(664), i32 noundef) local_unnamed_addr #2 align 2

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(56) ptr @_ZNKR4dali6TensorINS_10CPUBackendEE5shapeEv(ptr noundef nonnull align 8 dereferenceable(272)) local_unnamed_addr #4 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i32 @_ZNK4dali6BufferINS_10CPUBackendEE4typeEv(ptr noundef nonnull align 8 dereferenceable(138)) local_unnamed_addr #2 align 2

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { 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 #3 = { 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 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 #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, !17, i64 32}
!6 = !{!"_ZTSN4dali10OutputDescE", !7, i64 0, !17, i64 32}
!7 = !{!"_ZTSN4dali15TensorListShapeILin1EEE", !8, i64 0, !16, i64 28}
!8 = !{!"_ZTSN4dali19TensorListShapeBaseINS_15TensorListShapeILin1EEELin1EEE", !9, i64 0, !16, i64 24}
!9 = !{!"_ZTSSt6vectorIlSaIlEE", !10, i64 0}
!10 = !{!"_ZTSSt12_Vector_baseIlSaIlEE", !11, i64 0}
!11 = !{!"_ZTSNSt12_Vector_baseIlSaIlEE12_Vector_implE", !12, i64 0}
!12 = !{!"_ZTSNSt12_Vector_baseIlSaIlEE17_Vector_impl_dataE", !13, i64 0, !13, i64 8, !13, i64 16}
!13 = !{!"any pointer", !14, i64 0}
!14 = !{!"omnipotent char", !15, i64 0}
!15 = !{!"Simple C++ TBAA"}
!16 = !{!"int", !14, i64 0}
!17 = !{!"_ZTS13_DALIDataType", !14, i64 0}
!18 = distinct !{!18, !19}
!19 = !{!"llvm.loop.mustprogress"}
!20 = distinct !{!20, !19}
!21 = distinct !{!21, !19}


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