; LLVM IR from huawei-noah/bolt :: compute/tensor/src (depth2space)

; 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.Depth2SpaceParamSpec = type { i32, [8 x i8] }
%struct.TensorDesc = type { i32, i32, i32, [20 x i32] }
%struct.ArchInfo = type { i32, ptr }

@.str = external hidden unnamed_addr constant [20 x i8], align 1
@stdout = external global ptr, align 8
@.str.1 = external hidden unnamed_addr constant [18 x i8], align 1

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_Z29depth2space_infer_output_sizeP6Tensor20Depth2SpaceParamSpecS0_P8ArchInfo(ptr noundef %0, i64 %1, i32 %2, ptr noundef %3, ptr noundef %4) #0 {
  %6 = alloca %struct.Depth2SpaceParamSpec, align 4
  %7 = alloca { i64, i32 }, align 4
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca %struct.TensorDesc, align 4
  %16 = alloca %struct.TensorDesc, align 4
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca %struct.TensorDesc, align 8
  %20 = getelementptr inbounds { i64, i32 }, ptr %7, i32 0, i32 0
  store i64 %1, ptr %20, align 4
  %21 = getelementptr inbounds { i64, i32 }, ptr %7, i32 0, i32 1
  store i32 %2, ptr %21, align 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %6, ptr align 4 %7, i64 12, i1 false)
  store ptr %0, ptr %8, align 8, !tbaa !5
  store ptr %3, ptr %9, align 8, !tbaa !5
  store ptr %4, ptr %10, align 8, !tbaa !5
  %22 = load ptr, ptr %8, align 8, !tbaa !5
  %23 = icmp eq ptr %22, null
  br i1 %23, label %24, label %40

24:                                               ; preds = %5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #7
  store i32 1, ptr %11, align 4, !tbaa !9
  %25 = load i32, ptr %11, align 4, !tbaa !9
  %26 = icmp ne i32 %25, 0
  br i1 %26, label %27, label %39

27:                                               ; preds = %24
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #7
  %28 = call i64 (i64, ...) @syscall(i64 noundef 186) #7
  %29 = trunc i64 %28 to i32
  store i32 %29, ptr %12, align 4, !tbaa !11
  %30 = load i32, ptr %12, align 4, !tbaa !11
  %31 = call i32 (ptr, ...) @printf(ptr noundef @.str, i32 noundef %30)
  %32 = load ptr, ptr @stdout, align 8, !tbaa !5
  %33 = call i32 @fflush(ptr noundef %32)
  %34 = load i32, ptr %11, align 4, !tbaa !9
  %35 = call ptr @ee2str(i32 noundef %34)
  %36 = call i32 (ptr, ...) @printf(ptr noundef @.str.1, ptr noundef %35)
  %37 = load ptr, ptr @stdout, align 8, !tbaa !5
  %38 = call i32 @fflush(ptr noundef %37)
  call void @exit(i32 noundef 1) #8
  unreachable

39:                                               ; preds = %24
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #7
  br label %40

40:                                               ; preds = %39, %5
  %41 = load ptr, ptr %9, align 8, !tbaa !5
  %42 = icmp eq ptr %41, null
  br i1 %42, label %43, label %59

43:                                               ; preds = %40
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #7
  store i32 1, ptr %13, align 4, !tbaa !9
  %44 = load i32, ptr %13, align 4, !tbaa !9
  %45 = icmp ne i32 %44, 0
  br i1 %45, label %46, label %58

46:                                               ; preds = %43
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #7
  %47 = call i64 (i64, ...) @syscall(i64 noundef 186) #7
  %48 = trunc i64 %47 to i32
  store i32 %48, ptr %14, align 4, !tbaa !11
  %49 = load i32, ptr %14, align 4, !tbaa !11
  %50 = call i32 (ptr, ...) @printf(ptr noundef @.str, i32 noundef %49)
  %51 = load ptr, ptr @stdout, align 8, !tbaa !5
  %52 = call i32 @fflush(ptr noundef %51)
  %53 = load i32, ptr %13, align 4, !tbaa !9
  %54 = call ptr @ee2str(i32 noundef %53)
  %55 = call i32 (ptr, ...) @printf(ptr noundef @.str.1, ptr noundef %54)
  %56 = load ptr, ptr @stdout, align 8, !tbaa !5
  %57 = call i32 @fflush(ptr noundef %56)
  call void @exit(i32 noundef 1) #8
  unreachable

58:                                               ; preds = %43
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #7
  br label %59

59:                                               ; preds = %58, %40
  call void @llvm.lifetime.start.p0(i64 92, ptr %15) #7
  %60 = load ptr, ptr %8, align 8, !tbaa !5
  call void @_ZN6Tensor8get_descEv(ptr dead_on_unwind writable sret(%struct.TensorDesc) align 4 %15, ptr noundef nonnull align 8 dereferenceable(32) %60)
  call void @llvm.lifetime.start.p0(i64 92, ptr %16) #7
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %16, ptr align 4 %15, i64 92, i1 false), !tbaa.struct !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #7
  store i32 51, ptr %17, align 4, !tbaa !9
  %61 = load ptr, ptr %10, align 8, !tbaa !5
  %62 = getelementptr inbounds %struct.ArchInfo, ptr %61, i32 0, i32 0
  %63 = load i32, ptr %62, align 8, !tbaa !19
  %64 = icmp eq i32 %63, 2
  br i1 %64, label %70, label %65

65:                                               ; preds = %59
  %66 = load ptr, ptr %10, align 8, !tbaa !5
  %67 = getelementptr inbounds %struct.ArchInfo, ptr %66, i32 0, i32 0
  %68 = load i32, ptr %67, align 8, !tbaa !19
  %69 = icmp eq i32 %68, 7
  br i1 %69, label %70, label %71

70:                                               ; preds = %65, %59
  br label %106

71:                                               ; preds = %65
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #7
  store i32 0, ptr %18, align 4, !tbaa !11
  br label %72

72:                                               ; preds = %98, %71
  %73 = load i32, ptr %18, align 4, !tbaa !11
  %74 = getelementptr inbounds %struct.TensorDesc, ptr %16, i32 0, i32 2
  %75 = load i32, ptr %74, align 4, !tbaa !22
  %76 = sub nsw i32 %75, 2
  %77 = icmp slt i32 %73, %76
  br i1 %77, label %79, label %78

78:                                               ; preds = %72
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #7
  br label %101

79:                                               ; preds = %72
  %80 = getelementptr inbounds %struct.Depth2SpaceParamSpec, ptr %6, i32 0, i32 0
  %81 = load i32, ptr %80, align 4, !tbaa !24
  %82 = getelementptr inbounds %struct.TensorDesc, ptr %16, i32 0, i32 3
  %83 = load i32, ptr %18, align 4, !tbaa !11
  %84 = sext i32 %83 to i64
  %85 = getelementptr inbounds [20 x i32], ptr %82, i64 0, i64 %84
  %86 = load i32, ptr %85, align 4, !tbaa !11
  %87 = mul i32 %86, %81
  store i32 %87, ptr %85, align 4, !tbaa !11
  %88 = getelementptr inbounds %struct.Depth2SpaceParamSpec, ptr %6, i32 0, i32 0
  %89 = load i32, ptr %88, align 4, !tbaa !24
  %90 = getelementptr inbounds %struct.TensorDesc, ptr %16, i32 0, i32 3
  %91 = getelementptr inbounds %struct.TensorDesc, ptr %16, i32 0, i32 2
  %92 = load i32, ptr %91, align 4, !tbaa !22
  %93 = sub i32 %92, 2
  %94 = zext i32 %93 to i64
  %95 = getelementptr inbounds [20 x i32], ptr %90, i64 0, i64 %94
  %96 = load i32, ptr %95, align 4, !tbaa !11
  %97 = udiv i32 %96, %89
  store i32 %97, ptr %95, align 4, !tbaa !11
  br label %98

98:                                               ; preds = %79
  %99 = load i32, ptr %18, align 4, !tbaa !11
  %100 = add nsw i32 %99, 1
  store i32 %100, ptr %18, align 4, !tbaa !11
  br label %72, !llvm.loop !26

101:                                              ; preds = %78
  %102 = getelementptr inbounds %struct.TensorDesc, ptr %16, i32 0, i32 2
  %103 = load i32, ptr %102, align 4, !tbaa !22
  %104 = call noundef i32 @_Z26getTensorDefaultDataFormati(i32 noundef %103)
  %105 = getelementptr inbounds %struct.TensorDesc, ptr %16, i32 0, i32 1
  store i32 %104, ptr %105, align 4, !tbaa !28
  store i32 0, ptr %17, align 4, !tbaa !9
  br label %106

106:                                              ; preds = %101, %70
  %107 = load ptr, ptr %9, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %19, ptr align 4 %16, i64 92, i1 false), !tbaa.struct !13
  call void @_ZN6Tensor6resizeE10TensorDesc(ptr noundef nonnull align 8 dereferenceable(32) %107, ptr noundef byval(%struct.TensorDesc) align 8 %19)
  %108 = load i32, ptr %17, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #7
  call void @llvm.lifetime.end.p0(i64 92, ptr %16) #7
  call void @llvm.lifetime.end.p0(i64 92, ptr %15) #7
  ret i32 %108
}

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1

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

; Function Attrs: nounwind
declare i64 @syscall(i64 noundef, ...) #3

declare i32 @printf(ptr noundef, ...) #4

declare i32 @fflush(ptr noundef) #4

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local ptr @ee2str(i32 noundef) #5

; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) #6

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6Tensor8get_descEv(ptr dead_on_unwind noalias writable sret(%struct.TensorDesc) align 4, ptr noundef nonnull align 8 dereferenceable(32)) #0 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z26getTensorDefaultDataFormati(i32 noundef) #5

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6Tensor6resizeE10TensorDesc(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef byval(%struct.TensorDesc) align 8) #0 align 2

attributes #0 = { 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 #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { 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 #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 = { 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 #7 = { nounwind }
attributes #8 = { 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 = !{!"_ZTS2EE", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{i64 0, i64 4, !14, i64 4, i64 4, !16, i64 8, i64 4, !11, i64 12, i64 80, !18}
!14 = !{!15, !15, i64 0}
!15 = !{!"_ZTS8DataType", !7, i64 0}
!16 = !{!17, !17, i64 0}
!17 = !{!"_ZTS10DataFormat", !7, i64 0}
!18 = !{!7, !7, i64 0}
!19 = !{!20, !21, i64 0}
!20 = !{!"_ZTS8ArchInfo", !21, i64 0, !6, i64 8}
!21 = !{!"_ZTS4Arch", !7, i64 0}
!22 = !{!23, !12, i64 8}
!23 = !{!"_ZTS10TensorDesc", !15, i64 0, !17, i64 4, !12, i64 8, !7, i64 12}
!24 = !{!25, !12, i64 0}
!25 = !{!"_ZTS20Depth2SpaceParamSpec", !12, i64 0, !7, i64 4}
!26 = distinct !{!26, !27}
!27 = !{!"llvm.loop.mustprogress"}
!28 = !{!23, !17, i64 4}


; 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.TensorDesc = type { i32, i32, i32, [20 x i32] }

@.str = external hidden unnamed_addr constant [20 x i8], align 1
@stdout = external local_unnamed_addr global ptr, align 8
@.str.1 = external hidden unnamed_addr constant [18 x i8], align 1

; Function Attrs: mustprogress uwtable
define dso_local noundef range(i32 0, 52) i32 @_Z29depth2space_infer_output_sizeP6Tensor20Depth2SpaceParamSpecS0_P8ArchInfo(ptr noundef %0, i64 %1, i32 %2, ptr noundef %3, ptr nocapture noundef readonly %4) local_unnamed_addr #0 {
  %6 = alloca %struct.TensorDesc, align 4
  %7 = alloca %struct.TensorDesc, align 8
  %.sroa.015.0.extract.trunc = trunc i64 %1 to i32
  %8 = icmp eq ptr %0, null
  br i1 %8, label %9, label %19

9:                                                ; preds = %5
  %10 = tail call i64 (i64, ...) @syscall(i64 noundef 186) #7
  %11 = trunc i64 %10 to i32
  %12 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %11)
  %13 = load ptr, ptr @stdout, align 8, !tbaa !5
  %14 = tail call i32 @fflush(ptr noundef %13)
  %15 = tail call ptr @ee2str(i32 noundef 1)
  %16 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, ptr noundef %15)
  %17 = load ptr, ptr @stdout, align 8, !tbaa !5
  %18 = tail call i32 @fflush(ptr noundef %17)
  tail call void @exit(i32 noundef 1) #8
  unreachable

19:                                               ; preds = %5
  %20 = icmp eq ptr %3, null
  br i1 %20, label %21, label %31

21:                                               ; preds = %19
  %22 = tail call i64 (i64, ...) @syscall(i64 noundef 186) #7
  %23 = trunc i64 %22 to i32
  %24 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %23)
  %25 = load ptr, ptr @stdout, align 8, !tbaa !5
  %26 = tail call i32 @fflush(ptr noundef %25)
  %27 = tail call ptr @ee2str(i32 noundef 1)
  %28 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, ptr noundef %27)
  %29 = load ptr, ptr @stdout, align 8, !tbaa !5
  %30 = tail call i32 @fflush(ptr noundef %29)
  tail call void @exit(i32 noundef 1) #8
  unreachable

31:                                               ; preds = %19
  call void @llvm.lifetime.start.p0(i64 92, ptr nonnull %6) #7
  call void @_ZN6Tensor8get_descEv(ptr dead_on_unwind nonnull writable sret(%struct.TensorDesc) align 4 %6, ptr noundef nonnull align 8 dereferenceable(32) %0)
  call void @llvm.lifetime.start.p0(i64 92, ptr nonnull %7) #7
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(92) %7, ptr noundef nonnull align 4 dereferenceable(92) %6, i64 92, i1 false), !tbaa.struct !9
  %32 = load i32, ptr %4, align 8, !tbaa !17
  switch i32 %32, label %.preheader [
    i32 2, label %59
    i32 7, label %59
  ]

.preheader:                                       ; preds = %31
  %33 = getelementptr inbounds i8, ptr %7, i64 8
  %34 = load i32, ptr %33, align 8, !tbaa !20
  %35 = icmp sgt i32 %34, 2
  br i1 %35, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %.preheader
  %36 = add nsw i32 %34, -2
  %37 = getelementptr inbounds i8, ptr %7, i64 12
  %38 = zext nneg i32 %36 to i64
  %39 = getelementptr inbounds [20 x i32], ptr %37, i64 0, i64 %38
  %xtraiter = and i64 %38, 1
  %40 = icmp eq i32 %36, 1
  br i1 %40, label %._crit_edge.loopexit.unr-lcssa, label %.lr.ph.new

.lr.ph.new:                                       ; preds = %.lr.ph
  %unroll_iter = and i64 %38, 2147483646
  br label %48

._crit_edge.loopexit.unr-lcssa:                   ; preds = %48, %.lr.ph
  %indvars.iv.unr = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next.1, %48 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge, label %._crit_edge.loopexit.epilog-lcssa

._crit_edge.loopexit.epilog-lcssa:                ; preds = %._crit_edge.loopexit.unr-lcssa
  %41 = getelementptr inbounds [20 x i32], ptr %37, i64 0, i64 %indvars.iv.unr
  %42 = load i32, ptr %41, align 4, !tbaa !14
  %43 = mul i32 %42, %.sroa.015.0.extract.trunc
  store i32 %43, ptr %41, align 4, !tbaa !14
  %44 = load i32, ptr %39, align 4, !tbaa !14
  %45 = udiv i32 %44, %.sroa.015.0.extract.trunc
  store i32 %45, ptr %39, align 4, !tbaa !14
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit.epilog-lcssa, %._crit_edge.loopexit.unr-lcssa, %.preheader
  %46 = call noundef i32 @_Z26getTensorDefaultDataFormati(i32 noundef %34)
  %47 = getelementptr inbounds i8, ptr %7, i64 4
  store i32 %46, ptr %47, align 4, !tbaa !22
  br label %59

48:                                               ; preds = %48, %.lr.ph.new
  %indvars.iv = phi i64 [ 0, %.lr.ph.new ], [ %indvars.iv.next.1, %48 ]
  %niter = phi i64 [ 0, %.lr.ph.new ], [ %niter.next.1, %48 ]
  %49 = getelementptr inbounds [20 x i32], ptr %37, i64 0, i64 %indvars.iv
  %50 = load i32, ptr %49, align 4, !tbaa !14
  %51 = mul i32 %50, %.sroa.015.0.extract.trunc
  store i32 %51, ptr %49, align 4, !tbaa !14
  %52 = load i32, ptr %39, align 4, !tbaa !14
  %53 = udiv i32 %52, %.sroa.015.0.extract.trunc
  store i32 %53, ptr %39, align 4, !tbaa !14
  %indvars.iv.next = or disjoint i64 %indvars.iv, 1
  %54 = getelementptr inbounds [20 x i32], ptr %37, i64 0, i64 %indvars.iv.next
  %55 = load i32, ptr %54, align 8, !tbaa !14
  %56 = mul i32 %55, %.sroa.015.0.extract.trunc
  store i32 %56, ptr %54, align 8, !tbaa !14
  %57 = load i32, ptr %39, align 4, !tbaa !14
  %58 = udiv i32 %57, %.sroa.015.0.extract.trunc
  store i32 %58, ptr %39, align 4, !tbaa !14
  %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
  %niter.next.1 = add i64 %niter, 2
  %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
  br i1 %niter.ncmp.1, label %._crit_edge.loopexit.unr-lcssa, label %48, !llvm.loop !23

59:                                               ; preds = %31, %31, %._crit_edge
  %.017 = phi i32 [ 51, %31 ], [ 0, %._crit_edge ], [ 51, %31 ]
  call void @_ZN6Tensor6resizeE10TensorDesc(ptr noundef nonnull align 8 dereferenceable(32) %3, ptr noundef nonnull byval(%struct.TensorDesc) align 8 %7)
  call void @llvm.lifetime.end.p0(i64 92, ptr nonnull %7) #7
  call void @llvm.lifetime.end.p0(i64 92, ptr nonnull %6) #7
  ret i32 %.017
}

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1

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

; Function Attrs: nounwind
declare i64 @syscall(i64 noundef, ...) local_unnamed_addr #3

; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4

; Function Attrs: nofree nounwind
declare noundef i32 @fflush(ptr nocapture noundef) local_unnamed_addr #4

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local ptr @ee2str(i32 noundef) local_unnamed_addr #5

; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) local_unnamed_addr #6

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6Tensor8get_descEv(ptr dead_on_unwind noalias writable sret(%struct.TensorDesc) align 4, ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #0 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z26getTensorDefaultDataFormati(i32 noundef) local_unnamed_addr #5

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6Tensor6resizeE10TensorDesc(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef byval(%struct.TensorDesc) align 8) local_unnamed_addr #0 align 2

attributes #0 = { 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 #1 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { 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 #4 = { nofree 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 = { 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 = { 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 #7 = { nounwind }
attributes #8 = { 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 = !{i64 0, i64 4, !10, i64 4, i64 4, !12, i64 8, i64 4, !14, i64 12, i64 80, !16}
!10 = !{!11, !11, i64 0}
!11 = !{!"_ZTS8DataType", !7, i64 0}
!12 = !{!13, !13, i64 0}
!13 = !{!"_ZTS10DataFormat", !7, i64 0}
!14 = !{!15, !15, i64 0}
!15 = !{!"int", !7, i64 0}
!16 = !{!7, !7, i64 0}
!17 = !{!18, !19, i64 0}
!18 = !{!"_ZTS8ArchInfo", !19, i64 0, !6, i64 8}
!19 = !{!"_ZTS4Arch", !7, i64 0}
!20 = !{!21, !15, i64 8}
!21 = !{!"_ZTS10TensorDesc", !11, i64 0, !13, i64 4, !15, i64 8, !7, i64 12}
!22 = !{!21, !13, i64 4}
!23 = distinct !{!23, !24}
!24 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: CorrelatedValuePropagationPass,DSEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,MemCpyOptPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass