; LLVM IR from NVIDIA/DALI :: dali/operators/util/axis_args.ll (ZN4dali8AxisArgs3GetEiiRKNS_12TensorLayoutE)

; 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::SmallVector" = type { %union.anon, i64 }
%union.anon = type { %struct.anon, [8 x i8] }
%struct.anon = type { ptr, i64 }
%"struct.dali::TensorView" = type { %"struct.dali::TensorViewBase" }
%"struct.dali::TensorViewBase" = type { ptr, %"struct.dali::TensorShape" }
%"struct.dali::TensorShape" = type { %"struct.dali::TensorShapeBase" }
%"struct.dali::TensorShapeBase" = type { %"class.dali::DeviceArray" }
%"class.dali::DeviceArray" = type { [1 x i64] }
%"class.dali::AxisArgs" = type { i32, %"class.std::unique_ptr", i8, i8, %"class.dali::TensorLayout", %"class.dali::SmallVector", %"struct.dali::TensorListShape" }
%"class.std::unique_ptr" = type { %"struct.std::__uniq_ptr_data" }
%"struct.std::__uniq_ptr_data" = type { %"class.std::__uniq_ptr_impl" }
%"class.std::__uniq_ptr_impl" = type { %"class.std::tuple" }
%"class.std::tuple" = type { %"struct.std::_Tuple_impl" }
%"struct.std::_Tuple_impl" = type { %"struct.std::_Head_base.1" }
%"struct.std::_Head_base.1" = type { ptr }
%"class.dali::TensorLayout" = type { [16 x i8] }
%"struct.dali::TensorListShape" = type { %"struct.dali::TensorListShapeBase.base", [4 x i8] }
%"struct.dali::TensorListShapeBase.base" = type <{ %"class.std::vector", i32 }>
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = 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 }

@.str.9 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [78 x i8], align 1
@__PRETTY_FUNCTION__._ZN4dali8AxisArgs3GetEiiRKNS_12TensorLayoutE = external hidden unnamed_addr constant [72 x i8], align 1

declare i32 @__gxx_personality_v0(...)

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

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

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

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

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

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4dali8AxisArgs3GetEiiRKNS_12TensorLayoutE(ptr dead_on_unwind noalias writable sret(%"class.dali::SmallVector") align 8 %0, ptr noundef nonnull align 8 dereferenceable(104) %1, i32 noundef %2, i32 noundef %3, ptr noundef nonnull align 1 dereferenceable(16) %4) #3 align 2 personality ptr @__gxx_personality_v0 {
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca ptr, align 8
  %11 = alloca i1, align 1
  %12 = alloca %"struct.dali::TensorView", align 8
  %13 = alloca ptr, align 8
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca %"class.dali::SmallVector", align 8
  store ptr %0, ptr %6, align 8
  store ptr %1, ptr %7, align 8, !tbaa !5
  store i32 %2, ptr %8, align 4, !tbaa !9
  store i32 %3, ptr %9, align 4, !tbaa !9
  store ptr %4, ptr %10, align 8, !tbaa !5
  %18 = load ptr, ptr %7, align 8
  store i1 false, ptr %11, align 1
  call void @_ZN4dali11SmallVectorIiLm6ESaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %0)
  %19 = getelementptr inbounds %"class.dali::AxisArgs", ptr %18, i32 0, i32 3
  %20 = load i8, ptr %19, align 1, !tbaa !11, !range !29, !noundef !30
  %21 = trunc i8 %20 to i1
  br i1 %21, label %22, label %80

22:                                               ; preds = %5
  %23 = getelementptr inbounds %"class.dali::AxisArgs", ptr %18, i32 0, i32 1
  %24 = call noundef zeroext i1 @_ZNKSt10unique_ptrIN4dali8ArgValueIiLi1EEESt14default_deleteIS2_EEcvbEv(ptr noundef nonnull align 8 dereferenceable(8) %23) #5
  br i1 %24, label %25, label %26

25:                                               ; preds = %22
  br label %28

26:                                               ; preds = %22
  call void @__assert_fail(ptr noundef @.str.9, ptr noundef @.str.10, i32 noundef 86, ptr noundef @__PRETTY_FUNCTION__._ZN4dali8AxisArgs3GetEiiRKNS_12TensorLayoutE) #6
  unreachable

27:                                               ; No predecessors!
  br label %28

28:                                               ; preds = %27, %25
  call void @llvm.lifetime.start.p0(i64 16, ptr %12) #5
  %29 = getelementptr inbounds %"class.dali::AxisArgs", ptr %18, i32 0, i32 1
  %30 = call noundef nonnull align 8 dereferenceable(129) ptr @_ZNKSt10unique_ptrIN4dali8ArgValueIiLi1EEESt14default_deleteIS2_EEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %29) #5
  %31 = load i32, ptr %8, align 4, !tbaa !9
  %32 = invoke { ptr, i64 } @_ZNK4dali8ArgValueIiLi1EEixEi(ptr noundef nonnull align 8 dereferenceable(129) %30, i32 noundef %31)
          to label %33 unwind label %51

33:                                               ; preds = %28
  %34 = getelementptr inbounds %"struct.dali::TensorView", ptr %12, i32 0, i32 0
  %35 = getelementptr inbounds { ptr, i64 }, ptr %34, i32 0, i32 0
  %36 = extractvalue { ptr, i64 } %32, 0
  store ptr %36, ptr %35, align 8
  %37 = getelementptr inbounds { ptr, i64 }, ptr %34, i32 0, i32 1
  %38 = extractvalue { ptr, i64 } %32, 1
  store i64 %38, ptr %37, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #5
  %39 = getelementptr inbounds %"struct.dali::TensorViewBase", ptr %12, i32 0, i32 1
  %40 = invoke noundef i64 @_ZNK4dali15TensorShapeBaseINS_11DeviceArrayIlLm1EEELi1EE12num_elementsEv(ptr noundef nonnull align 8 dereferenceable(8) %39)
          to label %41 unwind label %55

41:                                               ; preds = %33
  %42 = trunc i64 %40 to i32
  store i32 %42, ptr %15, align 4, !tbaa !9
  %43 = load i32, ptr %15, align 4, !tbaa !9
  %44 = sext i32 %43 to i64
  invoke void @_ZN4dali11SmallVectorIiLm6ESaIiEE6resizeEm(ptr noundef nonnull align 8 dereferenceable(32) %0, i64 noundef %44)
          to label %45 unwind label %55

45:                                               ; preds = %41
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #5
  store i32 0, ptr %16, align 4, !tbaa !9
  br label %46

46:                                               ; preds = %70, %45
  %47 = load i32, ptr %16, align 4, !tbaa !9
  %48 = load i32, ptr %15, align 4, !tbaa !9
  %49 = icmp slt i32 %47, %48
  br i1 %49, label %59, label %50

50:                                               ; preds = %46
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #5
  br label %77

51:                                               ; preds = %28
  %52 = landingpad { ptr, i32 }
          cleanup
  %53 = extractvalue { ptr, i32 } %52, 0
  store ptr %53, ptr %13, align 8
  %54 = extractvalue { ptr, i32 } %52, 1
  store i32 %54, ptr %14, align 4
  br label %79

55:                                               ; preds = %41, %33
  %56 = landingpad { ptr, i32 }
          cleanup
  %57 = extractvalue { ptr, i32 } %56, 0
  store ptr %57, ptr %13, align 8
  %58 = extractvalue { ptr, i32 } %56, 1
  store i32 %58, ptr %14, align 4
  br label %78

59:                                               ; preds = %46
  %60 = getelementptr inbounds %"struct.dali::TensorViewBase", ptr %12, i32 0, i32 0
  %61 = load ptr, ptr %60, align 8, !tbaa !31
  %62 = load i32, ptr %16, align 4, !tbaa !9
  %63 = sext i32 %62 to i64
  %64 = getelementptr inbounds i32, ptr %61, i64 %63
  %65 = load i32, ptr %64, align 4, !tbaa !9
  %66 = load i32, ptr %16, align 4, !tbaa !9
  %67 = sext i32 %66 to i64
  %68 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZN4dali11SmallVectorIiLm6ESaIiEEixEl(ptr noundef nonnull align 8 dereferenceable(32) %0, i64 noundef %67)
          to label %69 unwind label %73

69:                                               ; preds = %59
  store i32 %65, ptr %68, align 4, !tbaa !9
  br label %70

70:                                               ; preds = %69
  %71 = load i32, ptr %16, align 4, !tbaa !9
  %72 = add nsw i32 %71, 1
  store i32 %72, ptr %16, align 4, !tbaa !9
  br label %46, !llvm.loop !36

73:                                               ; preds = %59
  %74 = landingpad { ptr, i32 }
          cleanup
  %75 = extractvalue { ptr, i32 } %74, 0
  store ptr %75, ptr %13, align 8
  %76 = extractvalue { ptr, i32 } %74, 1
  store i32 %76, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #5
  br label %78

77:                                               ; preds = %50
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %12) #5
  br label %108

78:                                               ; preds = %73, %55
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #5
  br label %79

79:                                               ; preds = %78, %51
  call void @llvm.lifetime.end.p0(i64 16, ptr %12) #5
  br label %114

80:                                               ; preds = %5
  %81 = getelementptr inbounds %"class.dali::AxisArgs", ptr %18, i32 0, i32 2
  %82 = load i8, ptr %81, align 8, !tbaa !38, !range !29, !noundef !30
  %83 = trunc i8 %82 to i1
  br i1 %83, label %84, label %99

84:                                               ; preds = %80
  call void @llvm.lifetime.start.p0(i64 32, ptr %17) #5
  %85 = load ptr, ptr %10, align 8, !tbaa !5
  %86 = getelementptr inbounds %"class.dali::AxisArgs", ptr %18, i32 0, i32 4
  invoke void @_ZN4dali13GetDimIndicesERKNS_12TensorLayoutES2_(ptr dead_on_unwind writable sret(%"class.dali::SmallVector") align 8 %17, ptr noundef nonnull align 1 dereferenceable(16) %85, ptr noundef nonnull align 1 dereferenceable(16) %86)
          to label %87 unwind label %90

87:                                               ; preds = %84
  %88 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZN4dali11SmallVectorIiLm6ESaIiEEaSILm6EEERS2_ONS0_IiXT_ES1_EE(ptr noundef nonnull align 8 dereferenceable(32) %0, ptr noundef nonnull align 8 dereferenceable(32) %17)
          to label %89 unwind label %94

89:                                               ; preds = %87
  call void @_ZN4dali11SmallVectorIiLm6ESaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %17) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %17) #5
  br label %107

90:                                               ; preds = %84
  %91 = landingpad { ptr, i32 }
          cleanup
  %92 = extractvalue { ptr, i32 } %91, 0
  store ptr %92, ptr %13, align 8
  %93 = extractvalue { ptr, i32 } %91, 1
  store i32 %93, ptr %14, align 4
  br label %98

94:                                               ; preds = %87
  %95 = landingpad { ptr, i32 }
          cleanup
  %96 = extractvalue { ptr, i32 } %95, 0
  store ptr %96, ptr %13, align 8
  %97 = extractvalue { ptr, i32 } %95, 1
  store i32 %97, ptr %14, align 4
  call void @_ZN4dali11SmallVectorIiLm6ESaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %17) #5
  br label %98

98:                                               ; preds = %94, %90
  call void @llvm.lifetime.end.p0(i64 32, ptr %17) #5
  br label %114

99:                                               ; preds = %80
  %100 = getelementptr inbounds %"class.dali::AxisArgs", ptr %18, i32 0, i32 5
  %101 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZN4dali11SmallVectorIiLm6ESaIiEEaSERKS2_(ptr noundef nonnull align 8 dereferenceable(32) %0, ptr noundef nonnull align 8 dereferenceable(32) %100)
          to label %102 unwind label %103

102:                                              ; preds = %99
  br label %107

103:                                              ; preds = %108, %99
  %104 = landingpad { ptr, i32 }
          cleanup
  %105 = extractvalue { ptr, i32 } %104, 0
  store ptr %105, ptr %13, align 8
  %106 = extractvalue { ptr, i32 } %104, 1
  store i32 %106, ptr %14, align 4
  br label %114

107:                                              ; preds = %102, %89
  br label %108

108:                                              ; preds = %107, %77
  %109 = load i32, ptr %9, align 4, !tbaa !9
  invoke void @_ZN4dali8AxisArgs7ProcessEiRNS_11SmallVectorIiLm6ESaIiEEE(ptr noundef nonnull align 8 dereferenceable(104) %18, i32 noundef %109, ptr noundef nonnull align 8 dereferenceable(32) %0)
          to label %110 unwind label %103

110:                                              ; preds = %108
  store i1 true, ptr %11, align 1
  %111 = load i1, ptr %11, align 1
  br i1 %111, label %113, label %112

112:                                              ; preds = %110
  call void @_ZN4dali11SmallVectorIiLm6ESaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %0) #5
  br label %113

113:                                              ; preds = %112, %110
  ret void

114:                                              ; preds = %103, %98, %79
  call void @_ZN4dali11SmallVectorIiLm6ESaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %0) #5
  br label %115

115:                                              ; preds = %114
  %116 = load ptr, ptr %13, align 8
  %117 = load i32, ptr %14, align 4
  %118 = insertvalue { ptr, i32 } poison, ptr %116, 0
  %119 = insertvalue { ptr, i32 } %118, i32 %117, 1
  resume { ptr, i32 } %119
}

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

; Function Attrs: mustprogress uwtable
declare dso_local { ptr, i64 } @_ZNK4dali8ArgValueIiLi1EEixEi(ptr noundef nonnull align 8 dereferenceable(129), i32 noundef) #3 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4dali11SmallVectorIiLm6ESaIiEE6resizeEm(ptr noundef nonnull align 8 dereferenceable(32), i64 noundef) #3 align 2

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN4dali13GetDimIndicesERKNS_12TensorLayoutES2_(ptr dead_on_unwind noalias writable sret(%"class.dali::SmallVector") align 8, ptr noundef nonnull align 1 dereferenceable(16), ptr noundef nonnull align 1 dereferenceable(16)) #4

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4dali8AxisArgs7ProcessEiRNS_11SmallVectorIiLm6ESaIiEEE(ptr noundef nonnull align 8 dereferenceable(104), i32 noundef, ptr noundef nonnull align 8 dereferenceable(32)) #3 align 2

attributes #0 = { 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 #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { noreturn nounwind "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 uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind }
attributes #6 = { noreturn 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, !19, i64 17}
!12 = !{!"_ZTSN4dali8AxisArgsE", !10, i64 0, !13, i64 8, !19, i64 16, !19, i64 17, !20, i64 18, !21, i64 40, !23, i64 72}
!13 = !{!"_ZTSSt10unique_ptrIN4dali8ArgValueIiLi1EEESt14default_deleteIS2_EE", !14, i64 0}
!14 = !{!"_ZTSSt15__uniq_ptr_dataIN4dali8ArgValueIiLi1EEESt14default_deleteIS2_ELb1ELb1EE", !15, i64 0}
!15 = !{!"_ZTSSt15__uniq_ptr_implIN4dali8ArgValueIiLi1EEESt14default_deleteIS2_EE", !16, i64 0}
!16 = !{!"_ZTSSt5tupleIJPN4dali8ArgValueIiLi1EEESt14default_deleteIS2_EEE", !17, i64 0}
!17 = !{!"_ZTSSt11_Tuple_implILm0EJPN4dali8ArgValueIiLi1EEESt14default_deleteIS2_EEE", !18, i64 0}
!18 = !{!"_ZTSSt10_Head_baseILm0EPN4dali8ArgValueIiLi1EEELb0EE", !6, i64 0}
!19 = !{!"bool", !7, i64 0}
!20 = !{!"_ZTSN4dali12TensorLayoutE", !7, i64 0}
!21 = !{!"_ZTSN4dali11SmallVectorIiLm6ESaIiEEE", !7, i64 0, !22, i64 24}
!22 = !{!"long", !7, i64 0}
!23 = !{!"_ZTSN4dali15TensorListShapeILi1EEE", !24, i64 0}
!24 = !{!"_ZTSN4dali19TensorListShapeBaseINS_15TensorListShapeILi1EEELi1EEE", !25, i64 0, !10, i64 24}
!25 = !{!"_ZTSSt6vectorIlSaIlEE", !26, i64 0}
!26 = !{!"_ZTSSt12_Vector_baseIlSaIlEE", !27, i64 0}
!27 = !{!"_ZTSNSt12_Vector_baseIlSaIlEE12_Vector_implE", !28, i64 0}
!28 = !{!"_ZTSNSt12_Vector_baseIlSaIlEE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!29 = !{i8 0, i8 2}
!30 = !{}
!31 = !{!32, !6, i64 0}
!32 = !{!"_ZTSN4dali14TensorViewBaseINS_10StorageCPUEKiLi1EEE", !6, i64 0, !33, i64 8}
!33 = !{!"_ZTSN4dali11TensorShapeILi1EEE", !34, i64 0}
!34 = !{!"_ZTSN4dali15TensorShapeBaseINS_11DeviceArrayIlLm1EEELi1EEE", !35, i64 0}
!35 = !{!"_ZTSN4dali11DeviceArrayIlLm1EEE", !7, i64 0}
!36 = distinct !{!36, !37}
!37 = !{!"llvm.loop.mustprogress"}
!38 = !{!12, !19, i64 16}


; 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::SmallVector" = type { %union.anon, i64 }
%union.anon = type { %struct.anon, [8 x i8] }
%struct.anon = type { ptr, i64 }
%"struct.dali::TensorView" = type { %"struct.dali::TensorViewBase" }
%"struct.dali::TensorViewBase" = type { ptr, %"struct.dali::TensorShape" }
%"struct.dali::TensorShape" = type { %"struct.dali::TensorShapeBase" }
%"struct.dali::TensorShapeBase" = type { %"class.dali::DeviceArray" }
%"class.dali::DeviceArray" = type { [1 x i64] }

@.str.9 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [78 x i8], align 1
@__PRETTY_FUNCTION__._ZN4dali8AxisArgs3GetEiiRKNS_12TensorLayoutE = external hidden unnamed_addr constant [72 x i8], align 1

declare i32 @__gxx_personality_v0(...)

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

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

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

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

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

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4dali8AxisArgs3GetEiiRKNS_12TensorLayoutE(ptr dead_on_unwind noalias nonnull writable sret(%"class.dali::SmallVector") align 8 %0, ptr noundef nonnull align 8 dereferenceable(104) %1, i32 noundef %2, i32 noundef %3, ptr noundef nonnull align 1 dereferenceable(16) %4) local_unnamed_addr #3 align 2 personality ptr @__gxx_personality_v0 {
  %6 = alloca %"struct.dali::TensorView", align 8
  %7 = alloca %"class.dali::SmallVector", align 8
  tail call void @_ZN4dali11SmallVectorIiLm6ESaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %0)
  %8 = getelementptr inbounds i8, ptr %1, i64 17
  %9 = load i8, ptr %8, align 1, !tbaa !5, !range !27, !noundef !28
  %10 = trunc nuw i8 %9 to i1
  br i1 %10, label %11, label %39

11:                                               ; preds = %5
  %12 = getelementptr inbounds i8, ptr %1, i64 8
  %13 = tail call noundef zeroext i1 @_ZNKSt10unique_ptrIN4dali8ArgValueIiLi1EEESt14default_deleteIS2_EEcvbEv(ptr noundef nonnull align 8 dereferenceable(8) %12) #5
  br i1 %13, label %15, label %14

14:                                               ; preds = %11
  tail call void @__assert_fail(ptr noundef nonnull @.str.9, ptr noundef nonnull @.str.10, i32 noundef 86, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN4dali8AxisArgs3GetEiiRKNS_12TensorLayoutE) #6
  unreachable

15:                                               ; preds = %11
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %6) #5
  %16 = tail call noundef nonnull align 8 dereferenceable(129) ptr @_ZNKSt10unique_ptrIN4dali8ArgValueIiLi1EEESt14default_deleteIS2_EEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %12) #5
  %17 = invoke { ptr, i64 } @_ZNK4dali8ArgValueIiLi1EEixEi(ptr noundef nonnull align 8 dereferenceable(129) %16, i32 noundef %2)
          to label %18 unwind label %27

18:                                               ; preds = %15
  %19 = extractvalue { ptr, i64 } %17, 0
  store ptr %19, ptr %6, align 8
  %20 = getelementptr inbounds i8, ptr %6, i64 8
  %21 = extractvalue { ptr, i64 } %17, 1
  store i64 %21, ptr %20, align 8
  %22 = invoke noundef i64 @_ZNK4dali15TensorShapeBaseINS_11DeviceArrayIlLm1EEELi1EE12num_elementsEv(ptr noundef nonnull align 8 dereferenceable(8) %20)
          to label %23 unwind label %29

23:                                               ; preds = %18
  %sext = shl i64 %22, 32
  %24 = ashr exact i64 %sext, 32
  invoke void @_ZN4dali11SmallVectorIiLm6ESaIiEE6resizeEm(ptr noundef nonnull align 8 dereferenceable(32) %0, i64 noundef %24)
          to label %.preheader unwind label %29

.preheader:                                       ; preds = %23
  %25 = trunc i64 %22 to i32
  %26 = icmp sgt i32 %25, 0
  br i1 %26, label %.lr.ph.preheader, label %._crit_edge

.lr.ph.preheader:                                 ; preds = %.preheader
  %wide.trip.count = and i64 %22, 2147483647
  br label %.lr.ph

._crit_edge:                                      ; preds = %35, %.preheader
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #5
  br label %58

27:                                               ; preds = %15
  %28 = landingpad { ptr, i32 }
          cleanup
  br label %38

29:                                               ; preds = %23, %18
  %30 = landingpad { ptr, i32 }
          cleanup
  br label %38

.lr.ph:                                           ; preds = %.lr.ph.preheader, %35
  %indvars.iv = phi i64 [ 0, %.lr.ph.preheader ], [ %indvars.iv.next, %35 ]
  %31 = load ptr, ptr %6, align 8, !tbaa !29
  %32 = getelementptr inbounds i32, ptr %31, i64 %indvars.iv
  %33 = load i32, ptr %32, align 4, !tbaa !34
  %34 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZN4dali11SmallVectorIiLm6ESaIiEEixEl(ptr noundef nonnull align 8 dereferenceable(32) %0, i64 noundef %indvars.iv)
          to label %35 unwind label %36

35:                                               ; preds = %.lr.ph
  store i32 %33, ptr %34, align 4, !tbaa !34
  %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 !35

36:                                               ; preds = %.lr.ph
  %37 = landingpad { ptr, i32 }
          cleanup
  br label %38

38:                                               ; preds = %29, %36, %27
  %.pn18.pn = phi { ptr, i32 } [ %28, %27 ], [ %37, %36 ], [ %30, %29 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #5
  br label %60

39:                                               ; preds = %5
  %40 = getelementptr inbounds i8, ptr %1, i64 16
  %41 = load i8, ptr %40, align 8, !tbaa !37, !range !27, !noundef !28
  %42 = trunc nuw i8 %41 to i1
  br i1 %42, label %43, label %53

43:                                               ; preds = %39
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %7) #5
  %44 = getelementptr inbounds i8, ptr %1, i64 18
  invoke void @_ZN4dali13GetDimIndicesERKNS_12TensorLayoutES2_(ptr dead_on_unwind nonnull writable sret(%"class.dali::SmallVector") align 8 %7, ptr noundef nonnull align 1 dereferenceable(16) %4, ptr noundef nonnull align 1 dereferenceable(16) %44)
          to label %45 unwind label %48

45:                                               ; preds = %43
  %46 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZN4dali11SmallVectorIiLm6ESaIiEEaSILm6EEERS2_ONS0_IiXT_ES1_EE(ptr noundef nonnull align 8 dereferenceable(32) %0, ptr noundef nonnull align 8 dereferenceable(32) %7)
          to label %47 unwind label %50

47:                                               ; preds = %45
  call void @_ZN4dali11SmallVectorIiLm6ESaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %7) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %7) #5
  br label %58

48:                                               ; preds = %43
  %49 = landingpad { ptr, i32 }
          cleanup
  br label %52

50:                                               ; preds = %45
  %51 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN4dali11SmallVectorIiLm6ESaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %7) #5
  br label %52

52:                                               ; preds = %50, %48
  %.pn = phi { ptr, i32 } [ %51, %50 ], [ %49, %48 ]
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %7) #5
  br label %60

53:                                               ; preds = %39
  %54 = getelementptr inbounds i8, ptr %1, i64 40
  %55 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZN4dali11SmallVectorIiLm6ESaIiEEaSERKS2_(ptr noundef nonnull align 8 dereferenceable(32) %0, ptr noundef nonnull align 8 dereferenceable(32) %54)
          to label %58 unwind label %56

56:                                               ; preds = %58, %53
  %57 = landingpad { ptr, i32 }
          cleanup
  br label %60

58:                                               ; preds = %47, %53, %._crit_edge
  invoke void @_ZN4dali8AxisArgs7ProcessEiRNS_11SmallVectorIiLm6ESaIiEEE(ptr noundef nonnull align 8 dereferenceable(104) %1, i32 noundef %3, ptr noundef nonnull align 8 dereferenceable(32) %0)
          to label %59 unwind label %56

59:                                               ; preds = %58
  ret void

60:                                               ; preds = %56, %52, %38
  %.pn18.pn.pn = phi { ptr, i32 } [ %.pn18.pn, %38 ], [ %57, %56 ], [ %.pn, %52 ]
  call void @_ZN4dali11SmallVectorIiLm6ESaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %0) #5
  resume { ptr, i32 } %.pn18.pn.pn
}

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

; Function Attrs: mustprogress uwtable
declare dso_local { ptr, i64 } @_ZNK4dali8ArgValueIiLi1EEixEi(ptr noundef nonnull align 8 dereferenceable(129), i32 noundef) local_unnamed_addr #3 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4dali11SmallVectorIiLm6ESaIiEE6resizeEm(ptr noundef nonnull align 8 dereferenceable(32), i64 noundef) local_unnamed_addr #3 align 2

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN4dali13GetDimIndicesERKNS_12TensorLayoutES2_(ptr dead_on_unwind noalias writable sret(%"class.dali::SmallVector") align 8, ptr noundef nonnull align 1 dereferenceable(16), ptr noundef nonnull align 1 dereferenceable(16)) local_unnamed_addr #4

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4dali8AxisArgs7ProcessEiRNS_11SmallVectorIiLm6ESaIiEEE(ptr noundef nonnull align 8 dereferenceable(104), i32 noundef, ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #3 align 2

attributes #0 = { 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 #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { noreturn nounwind "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 uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind }
attributes #6 = { noreturn 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 17}
!6 = !{!"_ZTSN4dali8AxisArgsE", !7, i64 0, !10, i64 8, !17, i64 16, !17, i64 17, !18, i64 18, !19, i64 40, !21, i64 72}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"_ZTSSt10unique_ptrIN4dali8ArgValueIiLi1EEESt14default_deleteIS2_EE", !11, i64 0}
!11 = !{!"_ZTSSt15__uniq_ptr_dataIN4dali8ArgValueIiLi1EEESt14default_deleteIS2_ELb1ELb1EE", !12, i64 0}
!12 = !{!"_ZTSSt15__uniq_ptr_implIN4dali8ArgValueIiLi1EEESt14default_deleteIS2_EE", !13, i64 0}
!13 = !{!"_ZTSSt5tupleIJPN4dali8ArgValueIiLi1EEESt14default_deleteIS2_EEE", !14, i64 0}
!14 = !{!"_ZTSSt11_Tuple_implILm0EJPN4dali8ArgValueIiLi1EEESt14default_deleteIS2_EEE", !15, i64 0}
!15 = !{!"_ZTSSt10_Head_baseILm0EPN4dali8ArgValueIiLi1EEELb0EE", !16, i64 0}
!16 = !{!"any pointer", !8, i64 0}
!17 = !{!"bool", !8, i64 0}
!18 = !{!"_ZTSN4dali12TensorLayoutE", !8, i64 0}
!19 = !{!"_ZTSN4dali11SmallVectorIiLm6ESaIiEEE", !8, i64 0, !20, i64 24}
!20 = !{!"long", !8, i64 0}
!21 = !{!"_ZTSN4dali15TensorListShapeILi1EEE", !22, i64 0}
!22 = !{!"_ZTSN4dali19TensorListShapeBaseINS_15TensorListShapeILi1EEELi1EEE", !23, i64 0, !7, i64 24}
!23 = !{!"_ZTSSt6vectorIlSaIlEE", !24, i64 0}
!24 = !{!"_ZTSSt12_Vector_baseIlSaIlEE", !25, i64 0}
!25 = !{!"_ZTSNSt12_Vector_baseIlSaIlEE12_Vector_implE", !26, i64 0}
!26 = !{!"_ZTSNSt12_Vector_baseIlSaIlEE17_Vector_impl_dataE", !16, i64 0, !16, i64 8, !16, i64 16}
!27 = !{i8 0, i8 2}
!28 = !{}
!29 = !{!30, !16, i64 0}
!30 = !{!"_ZTSN4dali14TensorViewBaseINS_10StorageCPUEKiLi1EEE", !16, i64 0, !31, i64 8}
!31 = !{!"_ZTSN4dali11TensorShapeILi1EEE", !32, i64 0}
!32 = !{!"_ZTSN4dali15TensorShapeBaseINS_11DeviceArrayIlLm1EEELi1EEE", !33, i64 0}
!33 = !{!"_ZTSN4dali11DeviceArrayIlLm1EEE", !8, i64 0}
!34 = !{!7, !7, i64 0}
!35 = distinct !{!35, !36}
!36 = !{!"llvm.loop.mustprogress"}
!37 = !{!6, !17, i64 16}


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