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

; 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.ExpandParamSpec = type { [8 x i32], i32 }
%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 [23 x i8], align 1

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_Z24expand_infer_output_sizeP6Tensor15ExpandParamSpecS0_P8ArchInfo(ptr noundef %0, ptr noundef byval(%struct.ExpandParamSpec) align 8 %1, ptr noundef %2, ptr noundef %3) #0 {
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca %struct.TensorDesc, align 4
  %9 = alloca %struct.TensorDesc, align 4
  %10 = alloca i32, align 4
  %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 8
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %2, ptr %6, align 8, !tbaa !5
  store ptr %3, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 92, ptr %8) #6
  %16 = load ptr, ptr %5, align 8, !tbaa !5
  call void @_ZN6Tensor8get_descEv(ptr dead_on_unwind writable sret(%struct.TensorDesc) align 4 %8, ptr noundef nonnull align 8 dereferenceable(32) %16)
  call void @llvm.lifetime.start.p0(i64 92, ptr %9) #6
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %9, ptr align 4 %8, i64 92, i1 false), !tbaa.struct !9
  %17 = getelementptr inbounds %struct.TensorDesc, ptr %8, i32 0, i32 2
  %18 = load i32, ptr %17, align 4, !tbaa !17
  %19 = getelementptr inbounds %struct.ExpandParamSpec, ptr %1, i32 0, i32 1
  %20 = load i32, ptr %19, align 8, !tbaa !19
  %21 = icmp sle i32 %18, %20
  br i1 %21, label %32, label %22

22:                                               ; preds = %4
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  %23 = call i64 (i64, ...) @syscall(i64 noundef 186) #6
  %24 = trunc i64 %23 to i32
  store i32 %24, ptr %10, align 4, !tbaa !14
  %25 = load i32, ptr %10, align 4, !tbaa !14
  %26 = call i32 (ptr, ...) @printf(ptr noundef @.str, i32 noundef %25)
  %27 = load ptr, ptr @stdout, align 8, !tbaa !5
  %28 = call i32 @fflush(ptr noundef %27)
  %29 = call i32 (ptr, ...) @printf(ptr noundef @.str.1)
  %30 = load ptr, ptr @stdout, align 8, !tbaa !5
  %31 = call i32 @fflush(ptr noundef %30)
  call void @exit(i32 noundef 1) #7
  unreachable

32:                                               ; preds = %4
  %33 = getelementptr inbounds %struct.ExpandParamSpec, ptr %1, i32 0, i32 1
  %34 = load i32, ptr %33, align 8, !tbaa !19
  %35 = getelementptr inbounds %struct.TensorDesc, ptr %9, i32 0, i32 2
  store i32 %34, ptr %35, align 4, !tbaa !17
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  %36 = getelementptr inbounds %struct.TensorDesc, ptr %8, i32 0, i32 2
  %37 = load i32, ptr %36, align 4, !tbaa !17
  store i32 %37, ptr %11, align 4, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  store i32 0, ptr %12, align 4, !tbaa !14
  br label %38

38:                                               ; preds = %107, %32
  %39 = load i32, ptr %12, align 4, !tbaa !14
  %40 = getelementptr inbounds %struct.ExpandParamSpec, ptr %1, i32 0, i32 1
  %41 = load i32, ptr %40, align 8, !tbaa !19
  %42 = icmp slt i32 %39, %41
  br i1 %42, label %44, label %43

43:                                               ; preds = %38
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  br label %110

44:                                               ; preds = %38
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  %45 = getelementptr inbounds %struct.ExpandParamSpec, ptr %1, i32 0, i32 1
  %46 = load i32, ptr %45, align 8, !tbaa !19
  %47 = sub nsw i32 %46, 1
  %48 = load i32, ptr %12, align 4, !tbaa !14
  %49 = sub nsw i32 %47, %48
  store i32 %49, ptr %13, align 4, !tbaa !14
  %50 = load i32, ptr %13, align 4, !tbaa !14
  %51 = load i32, ptr %11, align 4, !tbaa !14
  %52 = icmp sge i32 %50, %51
  br i1 %52, label %64, label %53

53:                                               ; preds = %44
  %54 = load i32, ptr %13, align 4, !tbaa !14
  %55 = load i32, ptr %11, align 4, !tbaa !14
  %56 = icmp slt i32 %54, %55
  br i1 %56, label %57, label %74

57:                                               ; preds = %53
  %58 = getelementptr inbounds %struct.TensorDesc, ptr %8, i32 0, i32 3
  %59 = load i32, ptr %13, align 4, !tbaa !14
  %60 = sext i32 %59 to i64
  %61 = getelementptr inbounds [20 x i32], ptr %58, i64 0, i64 %60
  %62 = load i32, ptr %61, align 4, !tbaa !14
  %63 = icmp eq i32 %62, 1
  br i1 %63, label %64, label %74

64:                                               ; preds = %57, %44
  %65 = getelementptr inbounds %struct.ExpandParamSpec, ptr %1, i32 0, i32 0
  %66 = load i32, ptr %12, align 4, !tbaa !14
  %67 = sext i32 %66 to i64
  %68 = getelementptr inbounds [8 x i32], ptr %65, i64 0, i64 %67
  %69 = load i32, ptr %68, align 4, !tbaa !14
  %70 = getelementptr inbounds %struct.TensorDesc, ptr %9, i32 0, i32 3
  %71 = load i32, ptr %13, align 4, !tbaa !14
  %72 = sext i32 %71 to i64
  %73 = getelementptr inbounds [20 x i32], ptr %70, i64 0, i64 %72
  store i32 %69, ptr %73, align 4, !tbaa !14
  br label %106

74:                                               ; preds = %57, %53
  %75 = getelementptr inbounds %struct.ExpandParamSpec, ptr %1, i32 0, i32 0
  %76 = load i32, ptr %12, align 4, !tbaa !14
  %77 = sext i32 %76 to i64
  %78 = getelementptr inbounds [8 x i32], ptr %75, i64 0, i64 %77
  %79 = load i32, ptr %78, align 4, !tbaa !14
  %80 = getelementptr inbounds %struct.TensorDesc, ptr %8, i32 0, i32 3
  %81 = load i32, ptr %13, align 4, !tbaa !14
  %82 = sext i32 %81 to i64
  %83 = getelementptr inbounds [20 x i32], ptr %80, i64 0, i64 %82
  %84 = load i32, ptr %83, align 4, !tbaa !14
  %85 = icmp sle i32 %79, %84
  br i1 %85, label %96, label %86

86:                                               ; preds = %74
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #6
  %87 = call i64 (i64, ...) @syscall(i64 noundef 186) #6
  %88 = trunc i64 %87 to i32
  store i32 %88, ptr %14, align 4, !tbaa !14
  %89 = load i32, ptr %14, align 4, !tbaa !14
  %90 = call i32 (ptr, ...) @printf(ptr noundef @.str, i32 noundef %89)
  %91 = load ptr, ptr @stdout, align 8, !tbaa !5
  %92 = call i32 @fflush(ptr noundef %91)
  %93 = call i32 (ptr, ...) @printf(ptr noundef @.str.1)
  %94 = load ptr, ptr @stdout, align 8, !tbaa !5
  %95 = call i32 @fflush(ptr noundef %94)
  call void @exit(i32 noundef 1) #7
  unreachable

96:                                               ; preds = %74
  %97 = getelementptr inbounds %struct.TensorDesc, ptr %8, i32 0, i32 3
  %98 = load i32, ptr %13, align 4, !tbaa !14
  %99 = sext i32 %98 to i64
  %100 = getelementptr inbounds [20 x i32], ptr %97, i64 0, i64 %99
  %101 = load i32, ptr %100, align 4, !tbaa !14
  %102 = getelementptr inbounds %struct.TensorDesc, ptr %9, i32 0, i32 3
  %103 = load i32, ptr %13, align 4, !tbaa !14
  %104 = sext i32 %103 to i64
  %105 = getelementptr inbounds [20 x i32], ptr %102, i64 0, i64 %104
  store i32 %101, ptr %105, align 4, !tbaa !14
  br label %106

106:                                              ; preds = %96, %64
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  br label %107

107:                                              ; preds = %106
  %108 = load i32, ptr %12, align 4, !tbaa !14
  %109 = add nsw i32 %108, 1
  store i32 %109, ptr %12, align 4, !tbaa !14
  br label %38, !llvm.loop !21

110:                                              ; preds = %43
  %111 = load ptr, ptr %7, align 8, !tbaa !5
  %112 = getelementptr inbounds %struct.ArchInfo, ptr %111, i32 0, i32 0
  %113 = load i32, ptr %112, align 8, !tbaa !23
  %114 = icmp eq i32 %113, 2
  br i1 %114, label %120, label %115

115:                                              ; preds = %110
  %116 = load ptr, ptr %7, align 8, !tbaa !5
  %117 = getelementptr inbounds %struct.ArchInfo, ptr %116, i32 0, i32 0
  %118 = load i32, ptr %117, align 8, !tbaa !23
  %119 = icmp eq i32 %118, 7
  br i1 %119, label %120, label %121

120:                                              ; preds = %115, %110
  br label %121

121:                                              ; preds = %120, %115
  %122 = getelementptr inbounds %struct.TensorDesc, ptr %9, i32 0, i32 0
  %123 = load i32, ptr %122, align 4, !tbaa !26
  %124 = icmp eq i32 %123, 6
  br i1 %124, label %125, label %141

125:                                              ; preds = %121
  %126 = getelementptr inbounds %struct.TensorDesc, ptr %9, i32 0, i32 2
  %127 = load i32, ptr %126, align 4, !tbaa !17
  %128 = icmp eq i32 %127, 4
  br i1 %128, label %129, label %141

129:                                              ; preds = %125
  %130 = getelementptr inbounds %struct.TensorDesc, ptr %9, i32 0, i32 3
  %131 = getelementptr inbounds %struct.TensorDesc, ptr %9, i32 0, i32 2
  %132 = load i32, ptr %131, align 4, !tbaa !17
  %133 = sub i32 %132, 2
  %134 = zext i32 %133 to i64
  %135 = getelementptr inbounds [20 x i32], ptr %130, i64 0, i64 %134
  %136 = load i32, ptr %135, align 4, !tbaa !14
  %137 = urem i32 %136, 8
  %138 = icmp eq i32 %137, 0
  br i1 %138, label %139, label %141

139:                                              ; preds = %129
  %140 = getelementptr inbounds %struct.TensorDesc, ptr %9, i32 0, i32 1
  store i32 2, ptr %140, align 4, !tbaa !27
  br label %141

141:                                              ; preds = %139, %129, %125, %121
  %142 = load ptr, ptr %6, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %15, ptr align 4 %9, i64 92, i1 false), !tbaa.struct !9
  call void @_ZN6Tensor6resizeE10TensorDesc(ptr noundef nonnull align 8 dereferenceable(32) %142, ptr noundef byval(%struct.TensorDesc) align 8 %15)
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 92, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 92, ptr %8) #6
  ret i32 0
}

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

; 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: 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) #2

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

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

declare i32 @fflush(ptr noundef) #4

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

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

; 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 nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nocallback nofree 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 = { 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 #6 = { nounwind }
attributes #7 = { 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, !15, i64 8}
!18 = !{!"_ZTS10TensorDesc", !11, i64 0, !13, i64 4, !15, i64 8, !7, i64 12}
!19 = !{!20, !15, i64 32}
!20 = !{!"_ZTS15ExpandParamSpec", !7, i64 0, !15, i64 32}
!21 = distinct !{!21, !22}
!22 = !{!"llvm.loop.mustprogress"}
!23 = !{!24, !25, i64 0}
!24 = !{!"_ZTS8ArchInfo", !25, i64 0, !6, i64 8}
!25 = !{!"_ZTS4Arch", !7, i64 0}
!26 = !{!18, !11, i64 0}
!27 = !{!18, !13, 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.ExpandParamSpec = type { [8 x i32], i32 }
%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 [23 x i8], align 1

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_Z24expand_infer_output_sizeP6Tensor15ExpandParamSpecS0_P8ArchInfo(ptr noundef nonnull %0, ptr nocapture noundef readonly byval(%struct.ExpandParamSpec) align 8 %1, ptr noundef %2, ptr nocapture noundef readnone %3) local_unnamed_addr #0 {
  %5 = alloca %struct.TensorDesc, align 4
  %6 = alloca %struct.TensorDesc, align 8
  call void @llvm.lifetime.start.p0(i64 92, ptr nonnull %5) #6
  call void @_ZN6Tensor8get_descEv(ptr dead_on_unwind nonnull writable sret(%struct.TensorDesc) align 4 %5, ptr noundef nonnull align 8 dereferenceable(32) %0)
  call void @llvm.lifetime.start.p0(i64 92, ptr nonnull %6) #6
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(92) %6, ptr noundef nonnull align 4 dereferenceable(92) %5, i64 92, i1 false), !tbaa.struct !5
  %7 = getelementptr inbounds i8, ptr %5, i64 8
  %8 = load i32, ptr %7, align 4, !tbaa !15
  %9 = getelementptr inbounds i8, ptr %1, i64 32
  %10 = load i32, ptr %9, align 8, !tbaa !17
  %.not = icmp sgt i32 %8, %10
  br i1 %.not, label %11, label %20

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

20:                                               ; preds = %4
  %21 = getelementptr inbounds i8, ptr %6, i64 8
  store i32 %10, ptr %21, align 8, !tbaa !15
  %22 = icmp sgt i32 %10, 0
  br i1 %22, label %.lr.ph, label %._crit_edge.thread

.lr.ph:                                           ; preds = %20
  %23 = getelementptr inbounds i8, ptr %5, i64 12
  %24 = getelementptr inbounds i8, ptr %6, i64 12
  %25 = zext nneg i32 %10 to i64
  %26 = sext i32 %8 to i64
  %wide.trip.count = zext nneg i32 %10 to i64
  br label %30

._crit_edge:                                      ; preds = %52
  %.pre = load i32, ptr %21, align 8
  %27 = icmp eq i32 %.pre, 4
  %28 = load i32, ptr %6, align 8, !tbaa !21
  %29 = icmp eq i32 %28, 6
  %or.cond = select i1 %29, i1 %27, i1 false
  br i1 %or.cond, label %54, label %._crit_edge.thread

30:                                               ; preds = %.lr.ph, %52
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %52 ]
  %31 = xor i64 %indvars.iv, -1
  %32 = add nsw i64 %25, %31
  %.not25 = icmp slt i64 %32, %26
  br i1 %.not25, label %33, label %37

33:                                               ; preds = %30
  %34 = getelementptr inbounds [20 x i32], ptr %23, i64 0, i64 %32
  %35 = load i32, ptr %34, align 4, !tbaa !12
  %36 = icmp eq i32 %35, 1
  br i1 %36, label %37, label %40

37:                                               ; preds = %33, %30
  %38 = getelementptr inbounds [8 x i32], ptr %1, i64 0, i64 %indvars.iv
  %39 = load i32, ptr %38, align 4, !tbaa !12
  br label %52

40:                                               ; preds = %33
  %41 = getelementptr inbounds [8 x i32], ptr %1, i64 0, i64 %indvars.iv
  %42 = load i32, ptr %41, align 4, !tbaa !12
  %.not26 = icmp sgt i32 %42, %35
  br i1 %.not26, label %43, label %52

43:                                               ; preds = %40
  %44 = call i64 (i64, ...) @syscall(i64 noundef 186) #6
  %45 = trunc i64 %44 to i32
  %46 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %45)
  %47 = load ptr, ptr @stdout, align 8, !tbaa !19
  %48 = call i32 @fflush(ptr noundef %47)
  %49 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1)
  %50 = load ptr, ptr @stdout, align 8, !tbaa !19
  %51 = call i32 @fflush(ptr noundef %50)
  call void @exit(i32 noundef 1) #7
  unreachable

52:                                               ; preds = %40, %37
  %.sink = phi i32 [ %39, %37 ], [ %35, %40 ]
  %53 = getelementptr inbounds [20 x i32], ptr %24, i64 0, i64 %32
  store i32 %.sink, ptr %53, align 4, !tbaa !12
  %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 %30, !llvm.loop !22

54:                                               ; preds = %._crit_edge
  %55 = getelementptr inbounds i8, ptr %6, i64 20
  %56 = load i32, ptr %55, align 4, !tbaa !12
  %57 = and i32 %56, 7
  %58 = icmp eq i32 %57, 0
  br i1 %58, label %59, label %._crit_edge.thread

59:                                               ; preds = %54
  %60 = getelementptr inbounds i8, ptr %6, i64 4
  store i32 2, ptr %60, align 4, !tbaa !24
  br label %._crit_edge.thread

._crit_edge.thread:                               ; preds = %20, %59, %54, %._crit_edge
  call void @_ZN6Tensor6resizeE10TensorDesc(ptr noundef nonnull align 8 dereferenceable(32) %2, ptr noundef nonnull byval(%struct.TensorDesc) align 8 %6)
  call void @llvm.lifetime.end.p0(i64 92, ptr nonnull %6) #6
  call void @llvm.lifetime.end.p0(i64 92, ptr nonnull %5) #6
  ret i32 0
}

; 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 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: 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) #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: noreturn nounwind
declare void @exit(i32 noundef) local_unnamed_addr #5

; 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 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 nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nocallback nofree 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 = { 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 #6 = { nounwind }
attributes #7 = { 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 = !{i64 0, i64 4, !6, i64 4, i64 4, !10, i64 8, i64 4, !12, i64 12, i64 80, !14}
!6 = !{!7, !7, i64 0}
!7 = !{!"_ZTS8DataType", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!11, !11, i64 0}
!11 = !{!"_ZTS10DataFormat", !8, i64 0}
!12 = !{!13, !13, i64 0}
!13 = !{!"int", !8, i64 0}
!14 = !{!8, !8, i64 0}
!15 = !{!16, !13, i64 8}
!16 = !{!"_ZTS10TensorDesc", !7, i64 0, !11, i64 4, !13, i64 8, !8, i64 12}
!17 = !{!18, !13, i64 32}
!18 = !{!"_ZTS15ExpandParamSpec", !8, i64 0, !13, i64 32}
!19 = !{!20, !20, i64 0}
!20 = !{!"any pointer", !8, i64 0}
!21 = !{!16, !7, i64 0}
!22 = distinct !{!22, !23}
!23 = !{!"llvm.loop.mustprogress"}
!24 = !{!16, !11, i64 4}


; Effective O3 passes: DSEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyPass,MemCpyOptPass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass