; LLVM IR from NVIDIA/DALI :: dali/operators/math/expressions (broadcasting)

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

@.str.17 = external hidden unnamed_addr constant [93 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [46 x i8], align 1
@__PRETTY_FUNCTION__._ZN4dali4expr22StridesForBroadcastingERKNS_11TensorShapeILin1EEES4_S4_ = external hidden unnamed_addr constant [118 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [42 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [35 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [49 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [17 x i8], align 1

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

declare i32 @__gxx_personality_v0(...)

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4dali4expr22StridesForBroadcastingERKNS_11TensorShapeILin1EEES4_S4_(ptr dead_on_unwind noalias writable sret(%"struct.dali::TensorShape") align 8 %0, ptr noundef nonnull align 8 dereferenceable(56) %1, ptr noundef nonnull align 8 dereferenceable(56) %2, ptr noundef nonnull align 8 dereferenceable(56) %3) #3 personality ptr @__gxx_personality_v0 {
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i1, align 1
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i64, align 8
  %13 = alloca ptr, align 8
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  store ptr %0, ptr %5, align 8
  store ptr %1, ptr %6, align 8, !tbaa !5
  store ptr %2, ptr %7, align 8, !tbaa !5
  store ptr %3, ptr %8, align 8, !tbaa !5
  store i1 false, ptr %9, align 1
  call void @_ZN4dali11TensorShapeILin1EEC2Ev(ptr noundef nonnull align 8 dereferenceable(56) %0)
  %18 = load ptr, ptr %7, align 8, !tbaa !5
  %19 = call noundef i32 @_ZNK4dali15TensorShapeBaseINS_11SmallVectorIlLm6ESaIlEEELin1EE10sample_dimEv(ptr noundef nonnull align 8 dereferenceable(56) %18) #5
  %20 = load ptr, ptr %8, align 8, !tbaa !5
  %21 = call noundef i32 @_ZNK4dali15TensorShapeBaseINS_11SmallVectorIlLm6ESaIlEEELin1EE10sample_dimEv(ptr noundef nonnull align 8 dereferenceable(56) %20) #5
  %22 = icmp eq i32 %19, %21
  br i1 %22, label %23, label %24

23:                                               ; preds = %4
  br label %26

24:                                               ; preds = %4
  call void @__assert_fail(ptr noundef @.str.18, ptr noundef @.str.17, i32 noundef 223, ptr noundef @__PRETTY_FUNCTION__._ZN4dali4expr22StridesForBroadcastingERKNS_11TensorShapeILin1EEES4_S4_) #6
  unreachable

25:                                               ; No predecessors!
  br label %26

26:                                               ; preds = %25, %23
  %27 = load ptr, ptr %7, align 8, !tbaa !5
  %28 = call noundef i32 @_ZNK4dali15TensorShapeBaseINS_11SmallVectorIlLm6ESaIlEEELin1EE10sample_dimEv(ptr noundef nonnull align 8 dereferenceable(56) %27) #5
  %29 = load ptr, ptr %6, align 8, !tbaa !5
  %30 = call noundef i32 @_ZNK4dali15TensorShapeBaseINS_11SmallVectorIlLm6ESaIlEEELin1EE10sample_dimEv(ptr noundef nonnull align 8 dereferenceable(56) %29) #5
  %31 = icmp sle i32 %28, %30
  br i1 %31, label %32, label %33

32:                                               ; preds = %26
  br label %35

33:                                               ; preds = %26
  call void @__assert_fail(ptr noundef @.str.19, ptr noundef @.str.17, i32 noundef 224, ptr noundef @__PRETTY_FUNCTION__._ZN4dali4expr22StridesForBroadcastingERKNS_11TensorShapeILin1EEES4_S4_) #6
  unreachable

34:                                               ; No predecessors!
  br label %35

35:                                               ; preds = %34, %32
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  %36 = load ptr, ptr %6, align 8, !tbaa !5
  %37 = call noundef i32 @_ZNK4dali15TensorShapeBaseINS_11SmallVectorIlLm6ESaIlEEELin1EE10sample_dimEv(ptr noundef nonnull align 8 dereferenceable(56) %36) #5
  store i32 %37, ptr %10, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  %38 = load ptr, ptr %7, align 8, !tbaa !5
  %39 = call noundef i32 @_ZNK4dali15TensorShapeBaseINS_11SmallVectorIlLm6ESaIlEEELin1EE10sample_dimEv(ptr noundef nonnull align 8 dereferenceable(56) %38) #5
  store i32 %39, ptr %11, align 4, !tbaa !9
  %40 = load i32, ptr %11, align 4, !tbaa !9
  %41 = load ptr, ptr %8, align 8, !tbaa !5
  %42 = call noundef i32 @_ZNK4dali15TensorShapeBaseINS_11SmallVectorIlLm6ESaIlEEELin1EE10sample_dimEv(ptr noundef nonnull align 8 dereferenceable(56) %41) #5
  %43 = icmp eq i32 %40, %42
  br i1 %43, label %44, label %45

44:                                               ; preds = %35
  br label %47

45:                                               ; preds = %35
  call void @__assert_fail(ptr noundef @.str.20, ptr noundef @.str.17, i32 noundef 227, ptr noundef @__PRETTY_FUNCTION__._ZN4dali4expr22StridesForBroadcastingERKNS_11TensorShapeILin1EEES4_S4_) #6
  unreachable

46:                                               ; No predecessors!
  br label %47

47:                                               ; preds = %46, %44
  %48 = load i32, ptr %11, align 4, !tbaa !9
  %49 = load i32, ptr %10, align 4, !tbaa !9
  %50 = icmp sle i32 %48, %49
  br i1 %50, label %51, label %52

51:                                               ; preds = %47
  br label %54

52:                                               ; preds = %47
  call void @__assert_fail(ptr noundef @.str.21, ptr noundef @.str.17, i32 noundef 228, ptr noundef @__PRETTY_FUNCTION__._ZN4dali4expr22StridesForBroadcastingERKNS_11TensorShapeILin1EEES4_S4_) #6
  unreachable

53:                                               ; No predecessors!
  br label %54

54:                                               ; preds = %53, %51
  %55 = getelementptr inbounds %"struct.dali::TensorShapeBase", ptr %0, i32 0, i32 0
  %56 = load i32, ptr %10, align 4, !tbaa !9
  %57 = sext i32 %56 to i64
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  store i64 0, ptr %12, align 8, !tbaa !11
  invoke void @_ZN4dali11SmallVectorIlLm6ESaIlEE6resizeEmRKl(ptr noundef nonnull align 8 dereferenceable(56) %55, i64 noundef %57, ptr noundef nonnull align 8 dereferenceable(8) %12)
          to label %58 unwind label %64

58:                                               ; preds = %54
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #5
  store i32 0, ptr %15, align 4, !tbaa !9
  br label %59

59:                                               ; preds = %140, %58
  %60 = load i32, ptr %15, align 4, !tbaa !9
  %61 = load i32, ptr %11, align 4, !tbaa !9
  %62 = icmp slt i32 %60, %61
  br i1 %62, label %68, label %63

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

64:                                               ; preds = %54
  %65 = landingpad { ptr, i32 }
          cleanup
  %66 = extractvalue { ptr, i32 } %65, 0
  store ptr %66, ptr %13, align 8
  %67 = extractvalue { ptr, i32 } %65, 1
  store i32 %67, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  br label %145

68:                                               ; preds = %59
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #5
  %69 = load i32, ptr %11, align 4, !tbaa !9
  %70 = load i32, ptr %15, align 4, !tbaa !9
  %71 = sub nsw i32 %69, %70
  %72 = sub nsw i32 %71, 1
  store i32 %72, ptr %16, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #5
  %73 = load i32, ptr %10, align 4, !tbaa !9
  %74 = load i32, ptr %15, align 4, !tbaa !9
  %75 = sub nsw i32 %73, %74
  %76 = sub nsw i32 %75, 1
  store i32 %76, ptr %17, align 4, !tbaa !9
  %77 = load ptr, ptr %7, align 8, !tbaa !5
  %78 = load i32, ptr %16, align 4, !tbaa !9
  %79 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNK4dali15TensorShapeBaseINS_11SmallVectorIlLm6ESaIlEEELin1EEixEi(ptr noundef nonnull align 8 dereferenceable(56) %77, i32 noundef %78)
          to label %80 unwind label %99

80:                                               ; preds = %68
  %81 = load i64, ptr %79, align 8, !tbaa !11
  %82 = load ptr, ptr %6, align 8, !tbaa !5
  %83 = load i32, ptr %17, align 4, !tbaa !9
  %84 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNK4dali15TensorShapeBaseINS_11SmallVectorIlLm6ESaIlEEELin1EEixEi(ptr noundef nonnull align 8 dereferenceable(56) %82, i32 noundef %83)
          to label %85 unwind label %99

85:                                               ; preds = %80
  %86 = load i64, ptr %84, align 8, !tbaa !11
  %87 = icmp eq i64 %81, %86
  br i1 %87, label %95, label %88

88:                                               ; preds = %85
  %89 = load ptr, ptr %7, align 8, !tbaa !5
  %90 = load i32, ptr %16, align 4, !tbaa !9
  %91 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNK4dali15TensorShapeBaseINS_11SmallVectorIlLm6ESaIlEEELin1EEixEi(ptr noundef nonnull align 8 dereferenceable(56) %89, i32 noundef %90)
          to label %92 unwind label %99

92:                                               ; preds = %88
  %93 = load i64, ptr %91, align 8, !tbaa !11
  %94 = icmp eq i64 %93, 1
  br label %95

95:                                               ; preds = %92, %85
  %96 = phi i1 [ true, %85 ], [ %94, %92 ]
  br i1 %96, label %97, label %98

97:                                               ; preds = %95
  br label %104

98:                                               ; preds = %95
  call void @__assert_fail(ptr noundef @.str.22, ptr noundef @.str.17, i32 noundef 234, ptr noundef @__PRETTY_FUNCTION__._ZN4dali4expr22StridesForBroadcastingERKNS_11TensorShapeILin1EEES4_S4_) #6
  unreachable

99:                                               ; preds = %135, %125, %120, %116, %108, %104, %88, %80, %68
  %100 = landingpad { ptr, i32 }
          cleanup
  %101 = extractvalue { ptr, i32 } %100, 0
  store ptr %101, ptr %13, align 8
  %102 = extractvalue { ptr, i32 } %100, 1
  store i32 %102, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #5
  br label %145

103:                                              ; No predecessors!
  br label %104

104:                                              ; preds = %103, %97
  %105 = load ptr, ptr %7, align 8, !tbaa !5
  %106 = load i32, ptr %16, align 4, !tbaa !9
  %107 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNK4dali15TensorShapeBaseINS_11SmallVectorIlLm6ESaIlEEELin1EEixEi(ptr noundef nonnull align 8 dereferenceable(56) %105, i32 noundef %106)
          to label %108 unwind label %99

108:                                              ; preds = %104
  %109 = load i64, ptr %107, align 8, !tbaa !11
  %110 = load ptr, ptr %6, align 8, !tbaa !5
  %111 = load i32, ptr %17, align 4, !tbaa !9
  %112 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNK4dali15TensorShapeBaseINS_11SmallVectorIlLm6ESaIlEEELin1EEixEi(ptr noundef nonnull align 8 dereferenceable(56) %110, i32 noundef %111)
          to label %113 unwind label %99

113:                                              ; preds = %108
  %114 = load i64, ptr %112, align 8, !tbaa !11
  %115 = icmp eq i64 %109, %114
  br i1 %115, label %116, label %125

116:                                              ; preds = %113
  %117 = load ptr, ptr %8, align 8, !tbaa !5
  %118 = load i32, ptr %16, align 4, !tbaa !9
  %119 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNK4dali15TensorShapeBaseINS_11SmallVectorIlLm6ESaIlEEELin1EEixEi(ptr noundef nonnull align 8 dereferenceable(56) %117, i32 noundef %118)
          to label %120 unwind label %99

120:                                              ; preds = %116
  %121 = load i64, ptr %119, align 8, !tbaa !11
  %122 = load i32, ptr %17, align 4, !tbaa !9
  %123 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN4dali15TensorShapeBaseINS_11SmallVectorIlLm6ESaIlEEELin1EEixEi(ptr noundef nonnull align 8 dereferenceable(56) %0, i32 noundef %122)
          to label %124 unwind label %99

124:                                              ; preds = %120
  store i64 %121, ptr %123, align 8, !tbaa !11
  br label %139

125:                                              ; preds = %113
  %126 = load ptr, ptr %7, align 8, !tbaa !5
  %127 = load i32, ptr %16, align 4, !tbaa !9
  %128 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNK4dali15TensorShapeBaseINS_11SmallVectorIlLm6ESaIlEEELin1EEixEi(ptr noundef nonnull align 8 dereferenceable(56) %126, i32 noundef %127)
          to label %129 unwind label %99

129:                                              ; preds = %125
  %130 = load i64, ptr %128, align 8, !tbaa !11
  %131 = icmp eq i64 %130, 1
  br i1 %131, label %132, label %133

132:                                              ; preds = %129
  br label %135

133:                                              ; preds = %129
  call void @__assert_fail(ptr noundef @.str.23, ptr noundef @.str.17, i32 noundef 238, ptr noundef @__PRETTY_FUNCTION__._ZN4dali4expr22StridesForBroadcastingERKNS_11TensorShapeILin1EEES4_S4_) #6
  unreachable

134:                                              ; No predecessors!
  br label %135

135:                                              ; preds = %134, %132
  %136 = load i32, ptr %17, align 4, !tbaa !9
  %137 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN4dali15TensorShapeBaseINS_11SmallVectorIlLm6ESaIlEEELin1EEixEi(ptr noundef nonnull align 8 dereferenceable(56) %0, i32 noundef %136)
          to label %138 unwind label %99

138:                                              ; preds = %135
  store i64 0, ptr %137, align 8, !tbaa !11
  br label %139

139:                                              ; preds = %138, %124
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #5
  br label %140

140:                                              ; preds = %139
  %141 = load i32, ptr %15, align 4, !tbaa !9
  %142 = add nsw i32 %141, 1
  store i32 %142, ptr %15, align 4, !tbaa !9
  br label %59, !llvm.loop !13

143:                                              ; preds = %63
  store i1 true, ptr %9, align 1
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  %144 = load i1, ptr %9, align 1
  br i1 %144, label %147, label %146

145:                                              ; preds = %99, %64
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  call void @_ZN4dali15TensorShapeBaseINS_11SmallVectorIlLm6ESaIlEEELin1EED2Ev(ptr noundef nonnull align 8 dereferenceable(56) %0) #5
  br label %148

146:                                              ; preds = %143
  call void @_ZN4dali15TensorShapeBaseINS_11SmallVectorIlLm6ESaIlEEELin1EED2Ev(ptr noundef nonnull align 8 dereferenceable(56) %0) #5
  br label %147

147:                                              ; preds = %146, %143
  ret void

148:                                              ; preds = %145
  %149 = load ptr, ptr %13, align 8
  %150 = load i32, ptr %14, align 4
  %151 = insertvalue { ptr, i32 } poison, ptr %149, 0
  %152 = insertvalue { ptr, i32 } %151, i32 %150, 1
  resume { ptr, i32 } %152
}

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

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { 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 #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 = { 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 #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, !12, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"struct.dali::TensorShape" = type { %"struct.dali::TensorShapeBase" }
%"struct.dali::TensorShapeBase" = type { %"class.dali::SmallVector" }
%"class.dali::SmallVector" = type { %union.anon.5, i64 }
%union.anon.5 = type { %struct.anon, [32 x i8] }
%struct.anon = type { ptr, i64 }

@.str.17 = external hidden unnamed_addr constant [93 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [46 x i8], align 1
@__PRETTY_FUNCTION__._ZN4dali4expr22StridesForBroadcastingERKNS_11TensorShapeILin1EEES4_S4_ = external hidden unnamed_addr constant [118 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [42 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [35 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [49 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [17 x i8], align 1

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

declare i32 @__gxx_personality_v0(...)

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4dali4expr22StridesForBroadcastingERKNS_11TensorShapeILin1EEES4_S4_(ptr dead_on_unwind noalias nonnull writable sret(%"struct.dali::TensorShape") align 8 %0, ptr noundef nonnull align 8 dereferenceable(56) %1, ptr noundef nonnull align 8 dereferenceable(56) %2, ptr noundef nonnull align 8 dereferenceable(56) %3) local_unnamed_addr #3 personality ptr @__gxx_personality_v0 {
  %5 = alloca i64, align 8
  tail call void @_ZN4dali11TensorShapeILin1EEC2Ev(ptr noundef nonnull align 8 dereferenceable(56) %0)
  %6 = tail call noundef i32 @_ZNK4dali15TensorShapeBaseINS_11SmallVectorIlLm6ESaIlEEELin1EE10sample_dimEv(ptr noundef nonnull align 8 dereferenceable(56) %2) #5
  %7 = tail call noundef i32 @_ZNK4dali15TensorShapeBaseINS_11SmallVectorIlLm6ESaIlEEELin1EE10sample_dimEv(ptr noundef nonnull align 8 dereferenceable(56) %3) #5
  %8 = icmp eq i32 %6, %7
  br i1 %8, label %10, label %9

9:                                                ; preds = %4
  tail call void @__assert_fail(ptr noundef nonnull @.str.18, ptr noundef nonnull @.str.17, i32 noundef 223, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN4dali4expr22StridesForBroadcastingERKNS_11TensorShapeILin1EEES4_S4_) #6
  unreachable

10:                                               ; preds = %4
  %11 = tail call noundef i32 @_ZNK4dali15TensorShapeBaseINS_11SmallVectorIlLm6ESaIlEEELin1EE10sample_dimEv(ptr noundef nonnull align 8 dereferenceable(56) %2) #5
  %12 = tail call noundef i32 @_ZNK4dali15TensorShapeBaseINS_11SmallVectorIlLm6ESaIlEEELin1EE10sample_dimEv(ptr noundef nonnull align 8 dereferenceable(56) %1) #5
  %.not = icmp sgt i32 %11, %12
  br i1 %.not, label %13, label %14

13:                                               ; preds = %10
  tail call void @__assert_fail(ptr noundef nonnull @.str.19, ptr noundef nonnull @.str.17, i32 noundef 224, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN4dali4expr22StridesForBroadcastingERKNS_11TensorShapeILin1EEES4_S4_) #6
  unreachable

14:                                               ; preds = %10
  %15 = tail call noundef i32 @_ZNK4dali15TensorShapeBaseINS_11SmallVectorIlLm6ESaIlEEELin1EE10sample_dimEv(ptr noundef nonnull align 8 dereferenceable(56) %1) #5
  %16 = tail call noundef i32 @_ZNK4dali15TensorShapeBaseINS_11SmallVectorIlLm6ESaIlEEELin1EE10sample_dimEv(ptr noundef nonnull align 8 dereferenceable(56) %2) #5
  %17 = tail call noundef i32 @_ZNK4dali15TensorShapeBaseINS_11SmallVectorIlLm6ESaIlEEELin1EE10sample_dimEv(ptr noundef nonnull align 8 dereferenceable(56) %3) #5
  %18 = icmp eq i32 %16, %17
  br i1 %18, label %20, label %19

19:                                               ; preds = %14
  tail call void @__assert_fail(ptr noundef nonnull @.str.20, ptr noundef nonnull @.str.17, i32 noundef 227, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN4dali4expr22StridesForBroadcastingERKNS_11TensorShapeILin1EEES4_S4_) #6
  unreachable

20:                                               ; preds = %14
  %.not40 = icmp sgt i32 %16, %15
  br i1 %.not40, label %21, label %22

21:                                               ; preds = %20
  tail call void @__assert_fail(ptr noundef nonnull @.str.21, ptr noundef nonnull @.str.17, i32 noundef 228, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN4dali4expr22StridesForBroadcastingERKNS_11TensorShapeILin1EEES4_S4_) #6
  unreachable

22:                                               ; preds = %20
  %23 = sext i32 %15 to i64
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #5
  store i64 0, ptr %5, align 8, !tbaa !5
  invoke void @_ZN4dali11SmallVectorIlLm6ESaIlEE6resizeEmRKl(ptr noundef nonnull align 8 dereferenceable(56) %0, i64 noundef %23, ptr noundef nonnull align 8 dereferenceable(8) %5)
          to label %24 unwind label %26

24:                                               ; preds = %22
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #5
  %25 = icmp sgt i32 %16, 0
  br i1 %25, label %.lr.ph, label %._crit_edge

26:                                               ; preds = %22
  %27 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #5
  br label %70

.lr.ph:                                           ; preds = %24, %68
  %.03642 = phi i32 [ %69, %68 ], [ 0, %24 ]
  %28 = xor i32 %.03642, -1
  %29 = add nsw i32 %16, %28
  %30 = add i32 %15, %28
  %31 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNK4dali15TensorShapeBaseINS_11SmallVectorIlLm6ESaIlEEELin1EEixEi(ptr noundef nonnull align 8 dereferenceable(56) %2, i32 noundef %29)
          to label %32 unwind label %44

32:                                               ; preds = %.lr.ph
  %33 = load i64, ptr %31, align 8, !tbaa !5
  %34 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNK4dali15TensorShapeBaseINS_11SmallVectorIlLm6ESaIlEEELin1EEixEi(ptr noundef nonnull align 8 dereferenceable(56) %1, i32 noundef %30)
          to label %35 unwind label %44

35:                                               ; preds = %32
  %36 = load i64, ptr %34, align 8, !tbaa !5
  %37 = icmp eq i64 %33, %36
  br i1 %37, label %.critedge, label %38

38:                                               ; preds = %35
  %39 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNK4dali15TensorShapeBaseINS_11SmallVectorIlLm6ESaIlEEELin1EEixEi(ptr noundef nonnull align 8 dereferenceable(56) %2, i32 noundef %29)
          to label %40 unwind label %44

40:                                               ; preds = %38
  %41 = load i64, ptr %39, align 8, !tbaa !5
  %42 = icmp eq i64 %41, 1
  br i1 %42, label %.critedge, label %43

43:                                               ; preds = %40
  call void @__assert_fail(ptr noundef nonnull @.str.22, ptr noundef nonnull @.str.17, i32 noundef 234, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN4dali4expr22StridesForBroadcastingERKNS_11TensorShapeILin1EEES4_S4_) #6
  unreachable

44:                                               ; preds = %65, %59, %55, %53, %47, %.critedge, %38, %32, %.lr.ph
  %45 = landingpad { ptr, i32 }
          cleanup
  br label %70

.critedge:                                        ; preds = %35, %40
  %46 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNK4dali15TensorShapeBaseINS_11SmallVectorIlLm6ESaIlEEELin1EEixEi(ptr noundef nonnull align 8 dereferenceable(56) %2, i32 noundef %29)
          to label %47 unwind label %44

47:                                               ; preds = %.critedge
  %48 = load i64, ptr %46, align 8, !tbaa !5
  %49 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNK4dali15TensorShapeBaseINS_11SmallVectorIlLm6ESaIlEEELin1EEixEi(ptr noundef nonnull align 8 dereferenceable(56) %1, i32 noundef %30)
          to label %50 unwind label %44

50:                                               ; preds = %47
  %51 = load i64, ptr %49, align 8, !tbaa !5
  %52 = icmp eq i64 %48, %51
  br i1 %52, label %53, label %59

53:                                               ; preds = %50
  %54 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNK4dali15TensorShapeBaseINS_11SmallVectorIlLm6ESaIlEEELin1EEixEi(ptr noundef nonnull align 8 dereferenceable(56) %3, i32 noundef %29)
          to label %55 unwind label %44

55:                                               ; preds = %53
  %56 = load i64, ptr %54, align 8, !tbaa !5
  %57 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN4dali15TensorShapeBaseINS_11SmallVectorIlLm6ESaIlEEELin1EEixEi(ptr noundef nonnull align 8 dereferenceable(56) %0, i32 noundef %30)
          to label %58 unwind label %44

58:                                               ; preds = %55
  store i64 %56, ptr %57, align 8, !tbaa !5
  br label %68

59:                                               ; preds = %50
  %60 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNK4dali15TensorShapeBaseINS_11SmallVectorIlLm6ESaIlEEELin1EEixEi(ptr noundef nonnull align 8 dereferenceable(56) %2, i32 noundef %29)
          to label %61 unwind label %44

61:                                               ; preds = %59
  %62 = load i64, ptr %60, align 8, !tbaa !5
  %63 = icmp eq i64 %62, 1
  br i1 %63, label %65, label %64

64:                                               ; preds = %61
  call void @__assert_fail(ptr noundef nonnull @.str.23, ptr noundef nonnull @.str.17, i32 noundef 238, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN4dali4expr22StridesForBroadcastingERKNS_11TensorShapeILin1EEES4_S4_) #6
  unreachable

65:                                               ; preds = %61
  %66 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN4dali15TensorShapeBaseINS_11SmallVectorIlLm6ESaIlEEELin1EEixEi(ptr noundef nonnull align 8 dereferenceable(56) %0, i32 noundef %30)
          to label %67 unwind label %44

67:                                               ; preds = %65
  store i64 0, ptr %66, align 8, !tbaa !5
  br label %68

68:                                               ; preds = %67, %58
  %69 = add nuw nsw i32 %.03642, 1
  %exitcond.not = icmp eq i32 %69, %16
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph, !llvm.loop !9

70:                                               ; preds = %44, %26
  %.pn = phi { ptr, i32 } [ %45, %44 ], [ %27, %26 ]
  call void @_ZN4dali15TensorShapeBaseINS_11SmallVectorIlLm6ESaIlEEELin1EED2Ev(ptr noundef nonnull align 8 dereferenceable(56) %0) #5
  resume { ptr, i32 } %.pn

._crit_edge:                                      ; preds = %68, %24
  ret void
}

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

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { 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 #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 = { 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 #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 = !{!"long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}


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