; LLVM IR from NVIDIA/DALI :: dali/operators/sequence (sequence_rearrange)

; 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::CPUBackend" = type { i8 }
%"struct.dali::TensorListShape" = type { %"struct.dali::TensorListShapeBase.base", i32 }
%"struct.dali::TensorListShapeBase.base" = type <{ %"class.std::vector.71", i32 }>
%"class.std::vector.71" = type { %"struct.std::_Vector_base.72" }
%"struct.std::_Vector_base.72" = 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::function.92" = 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, ptr, ptr, ptr, 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 void @_ZN4dali17SequenceRearrangeINS_10CPUBackendEE7RunImplERNS_9WorkspaceE(ptr noundef nonnull align 8 dereferenceable(464) %0, ptr noundef nonnull align 8 dereferenceable(664) %1) unnamed_addr #1 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca %"class.dali::CPUBackend", align 1
  %7 = alloca ptr, align 8
  %8 = alloca %"class.dali::CPUBackend", align 1
  %9 = alloca ptr, align 8
  %10 = alloca %"struct.dali::TensorListShape", align 8
  %11 = alloca i32, align 4
  %12 = alloca ptr, align 8
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca %"class.std::function.92", align 8
  %16 = alloca %class.anon, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %17 = load ptr, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #6
  %18 = load ptr, ptr %4, align 8, !tbaa !5
  %19 = call noundef nonnull align 8 dereferenceable(304) ptr @_ZNK4dali13WorkspaceBaseINS_10TensorListESt10shared_ptrE5InputINS_10CPUBackendEEERKDaiT_(ptr noundef nonnull align 8 dereferenceable(664) %18, i32 noundef 0)
  store ptr %19, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #6
  %20 = load ptr, ptr %4, align 8, !tbaa !5
  %21 = call noundef nonnull align 8 dereferenceable(304) ptr @_ZNK4dali13WorkspaceBaseINS_10TensorListESt10shared_ptrE6OutputINS_10CPUBackendEEERDaiT_(ptr noundef nonnull align 8 dereferenceable(664) %20, i32 noundef 0)
  store ptr %21, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #6
  %22 = load ptr, ptr %4, align 8, !tbaa !5
  %23 = call noundef nonnull align 8 dereferenceable(224) ptr @_ZNK4dali13WorkspaceBaseINS_10TensorListESt10shared_ptrE13GetThreadPoolEv(ptr noundef nonnull align 8 dereferenceable(664) %22)
  store ptr %23, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 32, ptr %10) #6
  %24 = load ptr, ptr %7, align 8, !tbaa !5
  %25 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNKR4dali10TensorListINS_10CPUBackendEE5shapeEv(ptr noundef nonnull align 8 dereferenceable(304) %24)
  call void @_ZN4dali15TensorListShapeILin1EEC2ERKS1_(ptr noundef nonnull align 8 dereferenceable(32) %10, ptr noundef nonnull align 8 dereferenceable(32) %25)
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  %26 = load ptr, ptr %4, align 8, !tbaa !5
  %27 = invoke noundef i32 @_ZNK4dali13WorkspaceBaseINS_10TensorListESt10shared_ptrE17GetInputBatchSizeEi(ptr noundef nonnull align 8 dereferenceable(664) %26, i32 noundef 0)
          to label %28 unwind label %34

28:                                               ; preds = %2
  store i32 %27, ptr %11, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #6
  store i32 0, ptr %14, align 4, !tbaa !9
  br label %29

29:                                               ; preds = %55, %28
  %30 = load i32, ptr %14, align 4, !tbaa !9
  %31 = load i32, ptr %11, align 4, !tbaa !9
  %32 = icmp slt i32 %30, %31
  br i1 %32, label %38, label %33

33:                                               ; preds = %29
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  br label %67

34:                                               ; preds = %73, %69, %67, %2
  %35 = landingpad { ptr, i32 }
          cleanup
  %36 = extractvalue { ptr, i32 } %35, 0
  store ptr %36, ptr %12, align 8
  %37 = extractvalue { ptr, i32 } %35, 1
  store i32 %37, ptr %13, align 4
  br label %75

38:                                               ; preds = %29
  %39 = load ptr, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 40, ptr %16) #6
  %40 = getelementptr inbounds %class.anon, ptr %16, i32 0, i32 0
  store ptr %17, ptr %40, align 8, !tbaa !11
  %41 = getelementptr inbounds %class.anon, ptr %16, i32 0, i32 1
  %42 = load ptr, ptr %4, align 8, !tbaa !5
  store ptr %42, ptr %41, align 8, !tbaa !5
  %43 = getelementptr inbounds %class.anon, ptr %16, i32 0, i32 2
  %44 = load ptr, ptr %5, align 8, !tbaa !5
  store ptr %44, ptr %43, align 8, !tbaa !5
  %45 = getelementptr inbounds %class.anon, ptr %16, i32 0, i32 3
  %46 = load ptr, ptr %7, align 8, !tbaa !5
  store ptr %46, ptr %45, align 8, !tbaa !5
  %47 = getelementptr inbounds %class.anon, ptr %16, i32 0, i32 4
  %48 = load i32, ptr %14, align 4, !tbaa !9
  store i32 %48, ptr %47, align 8, !tbaa !13
  invoke void @"_ZNSt8functionIFviEEC2IZN4dali17SequenceRearrangeINS3_10CPUBackendEE7RunImplERNS3_9WorkspaceEE3$_0vEEOT_"(ptr noundef nonnull align 8 dereferenceable(32) %15, ptr noundef nonnull align 8 dereferenceable(36) %16)
          to label %49 unwind label %58

49:                                               ; preds = %38
  %50 = load i32, ptr %14, align 4, !tbaa !9
  %51 = sext i32 %50 to i64
  %52 = invoke noundef i64 @_ZNK4dali19TensorListShapeBaseINS_15TensorListShapeILin1EEELin1EE11tensor_sizeEl(ptr noundef nonnull align 8 dereferenceable(28) %10, i64 noundef %51)
          to label %53 unwind label %62

53:                                               ; preds = %49
  invoke void @_ZN4dali10ThreadPool7AddWorkESt8functionIFviEElb(ptr noundef nonnull align 8 dereferenceable(224) %39, ptr noundef %15, i64 noundef %52, i1 noundef zeroext false)
          to label %54 unwind label %62

54:                                               ; preds = %53
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %15) #6
  call void @llvm.lifetime.end.p0(i64 40, ptr %16) #6
  br label %55

55:                                               ; preds = %54
  %56 = load i32, ptr %14, align 4, !tbaa !9
  %57 = add nsw i32 %56, 1
  store i32 %57, ptr %14, align 4, !tbaa !9
  br label %29, !llvm.loop !14

58:                                               ; preds = %38
  %59 = landingpad { ptr, i32 }
          cleanup
  %60 = extractvalue { ptr, i32 } %59, 0
  store ptr %60, ptr %12, align 8
  %61 = extractvalue { ptr, i32 } %59, 1
  store i32 %61, ptr %13, align 4
  br label %66

62:                                               ; preds = %53, %49
  %63 = landingpad { ptr, i32 }
          cleanup
  %64 = extractvalue { ptr, i32 } %63, 0
  store ptr %64, ptr %12, align 8
  %65 = extractvalue { ptr, i32 } %63, 1
  store i32 %65, ptr %13, align 4
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %15) #6
  br label %66

66:                                               ; preds = %62, %58
  call void @llvm.lifetime.end.p0(i64 40, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  br label %75

67:                                               ; preds = %33
  %68 = load ptr, ptr %9, align 8, !tbaa !5
  invoke void @_ZN4dali10ThreadPool6RunAllEb(ptr noundef nonnull align 8 dereferenceable(224) %68, i1 noundef zeroext true)
          to label %69 unwind label %34

69:                                               ; preds = %67
  %70 = load ptr, ptr %7, align 8, !tbaa !5
  %71 = load ptr, ptr %5, align 8, !tbaa !5
  %72 = invoke noundef nonnull align 1 dereferenceable(16) ptr @_ZNKR4dali10TensorListINS_10CPUBackendEE9GetLayoutEv(ptr noundef nonnull align 8 dereferenceable(304) %71)
          to label %73 unwind label %34

73:                                               ; preds = %69
  invoke void @_ZN4dali10TensorListINS_10CPUBackendEE9SetLayoutERKNS_12TensorLayoutE(ptr noundef nonnull align 8 dereferenceable(304) %70, ptr noundef nonnull align 1 dereferenceable(16) %72)
          to label %74 unwind label %34

74:                                               ; preds = %73
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  call void @_ZN4dali19TensorListShapeBaseINS_15TensorListShapeILin1EEELin1EED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %10) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #6
  ret void

75:                                               ; preds = %66, %34
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  call void @_ZN4dali19TensorListShapeBaseINS_15TensorListShapeILin1EEELin1EED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %10) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #6
  br label %76

76:                                               ; preds = %75
  %77 = load ptr, ptr %12, align 8
  %78 = load i32, ptr %13, align 4
  %79 = insertvalue { ptr, i32 } poison, ptr %77, 0
  %80 = insertvalue { ptr, i32 } %79, i32 %78, 1
  resume { ptr, i32 } %80
}

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(224) ptr @_ZNK4dali13WorkspaceBaseINS_10TensorListESt10shared_ptrE13GetThreadPoolEv(ptr noundef nonnull align 8 dereferenceable(664)) #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)) #3 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZNK4dali13WorkspaceBaseINS_10TensorListESt10shared_ptrE17GetInputBatchSizeEi(ptr noundef nonnull align 8 dereferenceable(664), i32 noundef) #1 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 @"_ZNSt8functionIFviEEC2IZN4dali17SequenceRearrangeINS3_10CPUBackendEE7RunImplERNS3_9WorkspaceEE3$_0vEEOT_"(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(36)) 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

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

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)) #5 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #3 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 = { "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 = { 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 #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 = !{!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, !6, i64 0}
!12 = !{!"_ZTSZN4dali17SequenceRearrangeINS_10CPUBackendEE7RunImplERNS_9WorkspaceEE3$_0", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !10, i64 32}
!13 = !{!12, !10, i64 32}
!14 = distinct !{!14, !15}
!15 = !{!"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"

%"struct.dali::TensorListShape" = type { %"struct.dali::TensorListShapeBase.base", i32 }
%"struct.dali::TensorListShapeBase.base" = type <{ %"class.std::vector.71", i32 }>
%"class.std::vector.71" = type { %"struct.std::_Vector_base.72" }
%"struct.std::_Vector_base.72" = 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::function.92" = 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, ptr, ptr, ptr, i32, [4 x 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 uwtable
define dso_local void @_ZN4dali17SequenceRearrangeINS_10CPUBackendEE7RunImplERNS_9WorkspaceE(ptr noundef nonnull align 8 dereferenceable(464) %0, ptr noundef nonnull align 8 dereferenceable(664) %1) unnamed_addr #1 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca %"struct.dali::TensorListShape", align 8
  %4 = alloca %"class.std::function.92", align 8
  %5 = alloca %class.anon, align 8
  %6 = tail call noundef nonnull align 8 dereferenceable(304) ptr @_ZNK4dali13WorkspaceBaseINS_10TensorListESt10shared_ptrE5InputINS_10CPUBackendEEERKDaiT_(ptr noundef nonnull align 8 dereferenceable(664) %1, i32 noundef 0)
  %7 = tail call noundef nonnull align 8 dereferenceable(304) ptr @_ZNK4dali13WorkspaceBaseINS_10TensorListESt10shared_ptrE6OutputINS_10CPUBackendEEERDaiT_(ptr noundef nonnull align 8 dereferenceable(664) %1, i32 noundef 0)
  %8 = tail call noundef nonnull align 8 dereferenceable(224) ptr @_ZNK4dali13WorkspaceBaseINS_10TensorListESt10shared_ptrE13GetThreadPoolEv(ptr noundef nonnull align 8 dereferenceable(664) %1)
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %3) #6
  %9 = tail call noundef nonnull align 8 dereferenceable(32) ptr @_ZNKR4dali10TensorListINS_10CPUBackendEE5shapeEv(ptr noundef nonnull align 8 dereferenceable(304) %7)
  call void @_ZN4dali15TensorListShapeILin1EEC2ERKS1_(ptr noundef nonnull align 8 dereferenceable(32) %3, ptr noundef nonnull align 8 dereferenceable(32) %9)
  %10 = invoke noundef i32 @_ZNK4dali13WorkspaceBaseINS_10TensorListESt10shared_ptrE17GetInputBatchSizeEi(ptr noundef nonnull align 8 dereferenceable(664) %1, i32 noundef 0)
          to label %.preheader unwind label %16

.preheader:                                       ; preds = %2
  %11 = icmp sgt i32 %10, 0
  br i1 %11, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %.preheader
  %12 = getelementptr inbounds i8, ptr %5, i64 8
  %13 = getelementptr inbounds i8, ptr %5, i64 16
  %14 = getelementptr inbounds i8, ptr %5, i64 24
  %15 = getelementptr inbounds i8, ptr %5, i64 32
  %wide.trip.count = zext nneg i32 %10 to i64
  br label %18

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

16:                                               ; preds = %29, %._crit_edge, %2
  %17 = landingpad { ptr, i32 }
          cleanup
  br label %32

18:                                               ; preds = %.lr.ph, %23
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %23 ]
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %5) #6
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %12, align 8, !tbaa !11
  store ptr %6, ptr %13, align 8, !tbaa !11
  store ptr %7, ptr %14, align 8, !tbaa !11
  %19 = trunc nuw nsw i64 %indvars.iv to i32
  store i32 %19, ptr %15, align 8, !tbaa !12
  invoke void @"_ZNSt8functionIFviEEC2IZN4dali17SequenceRearrangeINS3_10CPUBackendEE7RunImplERNS3_9WorkspaceEE3$_0vEEOT_"(ptr noundef nonnull align 8 dereferenceable(32) %4, ptr noundef nonnull align 8 dereferenceable(36) %5)
          to label %20 unwind label %24

20:                                               ; preds = %18
  %21 = invoke noundef i64 @_ZNK4dali19TensorListShapeBaseINS_15TensorListShapeILin1EEELin1EE11tensor_sizeEl(ptr noundef nonnull align 8 dereferenceable(28) %3, i64 noundef %indvars.iv)
          to label %22 unwind label %26

22:                                               ; preds = %20
  invoke void @_ZN4dali10ThreadPool7AddWorkESt8functionIFviEElb(ptr noundef nonnull align 8 dereferenceable(224) %8, ptr noundef nonnull %4, i64 noundef %21, i1 noundef zeroext false)
          to label %23 unwind label %26

23:                                               ; preds = %22
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %4) #6
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %5) #6
  %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 %18, !llvm.loop !13

24:                                               ; preds = %18
  %25 = landingpad { ptr, i32 }
          cleanup
  br label %28

26:                                               ; preds = %22, %20
  %27 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %4) #6
  br label %28

28:                                               ; preds = %26, %24
  %.pn = phi { ptr, i32 } [ %27, %26 ], [ %25, %24 ]
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %5) #6
  br label %32

29:                                               ; preds = %._crit_edge
  %30 = call noundef nonnull align 1 dereferenceable(16) ptr @_ZNKR4dali10TensorListINS_10CPUBackendEE9GetLayoutEv(ptr noundef nonnull align 8 dereferenceable(304) %6)
  invoke void @_ZN4dali10TensorListINS_10CPUBackendEE9SetLayoutERKNS_12TensorLayoutE(ptr noundef nonnull align 8 dereferenceable(304) %7, ptr noundef nonnull align 1 dereferenceable(16) %30)
          to label %31 unwind label %16

31:                                               ; preds = %29
  call void @_ZN4dali19TensorListShapeBaseINS_15TensorListShapeILin1EEELin1EED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %3) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %3) #6
  ret void

32:                                               ; preds = %28, %16
  %.pn.pn = phi { ptr, i32 } [ %.pn, %28 ], [ %17, %16 ]
  call void @_ZN4dali19TensorListShapeBaseINS_15TensorListShapeILin1EEELin1EED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %3) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %3) #6
  resume { ptr, i32 } %.pn.pn
}

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(224) ptr @_ZNK4dali13WorkspaceBaseINS_10TensorListESt10shared_ptrE13GetThreadPoolEv(ptr noundef nonnull align 8 dereferenceable(664)) 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 #3 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZNK4dali13WorkspaceBaseINS_10TensorListESt10shared_ptrE17GetInputBatchSizeEi(ptr noundef nonnull align 8 dereferenceable(664), i32 noundef) local_unnamed_addr #1 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 @"_ZNSt8functionIFviEEC2IZN4dali17SequenceRearrangeINS3_10CPUBackendEE7RunImplERNS3_9WorkspaceEE3$_0vEEOT_"(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(36)) 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

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

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 #5 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #3 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 = { "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 = { 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 #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 = !{!6, !7, i64 0}
!6 = !{!"_ZTSZN4dali17SequenceRearrangeINS_10CPUBackendEE7RunImplERNS_9WorkspaceEE3$_0", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !10, i64 32}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!7, !7, i64 0}
!12 = !{!6, !10, i64 32}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}


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