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

; 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.TensorDesc = type { i32, i32, i32, [20 x i32] }
%struct.ArgMaxParamSpec = type { 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: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_Z24argmax_infer_output_sizeP6Tensor15ArgMaxParamSpecS0_P8ArchInfo(ptr noundef %0, i32 %1, ptr noundef %2, ptr noundef %3) #1 {
  %5 = alloca %struct.ArgMaxParamSpec, align 4
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca %struct.TensorDesc, align 4
  %14 = alloca %struct.TensorDesc, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca %struct.TensorDesc, align 8
  %18 = getelementptr inbounds %struct.ArgMaxParamSpec, ptr %5, i32 0, i32 0
  store i32 %1, ptr %18, align 4
  store ptr %0, ptr %6, align 8, !tbaa !5
  store ptr %2, ptr %7, align 8, !tbaa !5
  store ptr %3, ptr %8, align 8, !tbaa !5
  %19 = load ptr, ptr %6, align 8, !tbaa !5
  %20 = icmp eq ptr %19, null
  br i1 %20, label %21, label %37

21:                                               ; preds = %4
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #7
  store i32 1, ptr %9, align 4, !tbaa !9
  %22 = load i32, ptr %9, align 4, !tbaa !9
  %23 = icmp ne i32 %22, 0
  br i1 %23, label %24, label %36

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

36:                                               ; preds = %21
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #7
  br label %37

37:                                               ; preds = %36, %4
  %38 = load ptr, ptr %7, align 8, !tbaa !5
  %39 = icmp eq ptr %38, null
  br i1 %39, label %40, label %56

40:                                               ; preds = %37
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #7
  store i32 1, ptr %11, align 4, !tbaa !9
  %41 = load i32, ptr %11, align 4, !tbaa !9
  %42 = icmp ne i32 %41, 0
  br i1 %42, label %43, label %55

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

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

56:                                               ; preds = %55, %37
  call void @llvm.lifetime.start.p0(i64 92, ptr %13) #7
  %57 = load ptr, ptr %6, align 8, !tbaa !5
  call void @_ZN6Tensor8get_descEv(ptr dead_on_unwind writable sret(%struct.TensorDesc) align 4 %13, ptr noundef nonnull align 8 dereferenceable(32) %57)
  call void @llvm.lifetime.start.p0(i64 92, ptr %14) #7
  %58 = load ptr, ptr %7, align 8, !tbaa !5
  call void @_ZN6Tensor8get_descEv(ptr dead_on_unwind writable sret(%struct.TensorDesc) align 4 %14, ptr noundef nonnull align 8 dereferenceable(32) %58)
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %14, ptr align 4 %13, i64 92, i1 false), !tbaa.struct !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #7
  %59 = getelementptr inbounds %struct.ArgMaxParamSpec, ptr %5, i32 0, i32 0
  %60 = load i32, ptr %59, align 4, !tbaa !19
  store i32 %60, ptr %15, align 4, !tbaa !11
  %61 = load i32, ptr %15, align 4, !tbaa !11
  %62 = icmp slt i32 %61, 0
  br i1 %62, label %63, label %68

63:                                               ; preds = %56
  %64 = getelementptr inbounds %struct.TensorDesc, ptr %13, i32 0, i32 2
  %65 = load i32, ptr %64, align 4, !tbaa !21
  %66 = load i32, ptr %15, align 4, !tbaa !11
  %67 = add i32 %66, %65
  store i32 %67, ptr %15, align 4, !tbaa !11
  br label %68

68:                                               ; preds = %63, %56
  %69 = getelementptr inbounds %struct.TensorDesc, ptr %13, i32 0, i32 2
  %70 = load i32, ptr %69, align 4, !tbaa !21
  %71 = sub i32 %70, 1
  %72 = load i32, ptr %15, align 4, !tbaa !11
  %73 = sub i32 %71, %72
  store i32 %73, ptr %15, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #7
  %74 = load i32, ptr %15, align 4, !tbaa !11
  store i32 %74, ptr %16, align 4, !tbaa !11
  br label %75

75:                                               ; preds = %93, %68
  %76 = load i32, ptr %16, align 4, !tbaa !11
  %77 = getelementptr inbounds %struct.TensorDesc, ptr %13, i32 0, i32 2
  %78 = load i32, ptr %77, align 4, !tbaa !21
  %79 = sub nsw i32 %78, 1
  %80 = icmp slt i32 %76, %79
  br i1 %80, label %82, label %81

81:                                               ; preds = %75
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #7
  br label %96

82:                                               ; preds = %75
  %83 = getelementptr inbounds %struct.TensorDesc, ptr %14, i32 0, i32 3
  %84 = load i32, ptr %16, align 4, !tbaa !11
  %85 = add nsw i32 %84, 1
  %86 = sext i32 %85 to i64
  %87 = getelementptr inbounds [20 x i32], ptr %83, i64 0, i64 %86
  %88 = load i32, ptr %87, align 4, !tbaa !11
  %89 = getelementptr inbounds %struct.TensorDesc, ptr %14, i32 0, i32 3
  %90 = load i32, ptr %16, align 4, !tbaa !11
  %91 = sext i32 %90 to i64
  %92 = getelementptr inbounds [20 x i32], ptr %89, i64 0, i64 %91
  store i32 %88, ptr %92, align 4, !tbaa !11
  br label %93

93:                                               ; preds = %82
  %94 = load i32, ptr %16, align 4, !tbaa !11
  %95 = add nsw i32 %94, 1
  store i32 %95, ptr %16, align 4, !tbaa !11
  br label %75, !llvm.loop !23

96:                                               ; preds = %81
  %97 = getelementptr inbounds %struct.TensorDesc, ptr %13, i32 0, i32 2
  %98 = load i32, ptr %97, align 4, !tbaa !21
  %99 = sub i32 %98, 1
  %100 = getelementptr inbounds %struct.TensorDesc, ptr %14, i32 0, i32 2
  store i32 %99, ptr %100, align 4, !tbaa !21
  %101 = getelementptr inbounds %struct.TensorDesc, ptr %14, i32 0, i32 0
  store i32 3, ptr %101, align 4, !tbaa !25
  %102 = getelementptr inbounds %struct.TensorDesc, ptr %14, i32 0, i32 2
  %103 = load i32, ptr %102, align 4, !tbaa !21
  %104 = icmp eq i32 %103, 2
  br i1 %104, label %105, label %107

105:                                              ; preds = %96
  %106 = getelementptr inbounds %struct.TensorDesc, ptr %14, i32 0, i32 1
  store i32 14, ptr %106, align 4, !tbaa !26
  br label %107

107:                                              ; preds = %105, %96
  %108 = getelementptr inbounds %struct.TensorDesc, ptr %14, i32 0, i32 2
  %109 = load i32, ptr %108, align 4, !tbaa !21
  %110 = icmp eq i32 %109, 3
  br i1 %110, label %111, label %113

111:                                              ; preds = %107
  %112 = getelementptr inbounds %struct.TensorDesc, ptr %14, i32 0, i32 1
  store i32 15, ptr %112, align 4, !tbaa !26
  br label %113

113:                                              ; preds = %111, %107
  %114 = getelementptr inbounds %struct.TensorDesc, ptr %14, i32 0, i32 2
  %115 = load i32, ptr %114, align 4, !tbaa !21
  %116 = icmp uge i32 %115, 4
  br i1 %116, label %117, label %119

117:                                              ; preds = %113
  %118 = getelementptr inbounds %struct.TensorDesc, ptr %14, i32 0, i32 1
  store i32 0, ptr %118, align 4, !tbaa !26
  br label %119

119:                                              ; preds = %117, %113
  %120 = load ptr, ptr %8, align 8, !tbaa !5
  %121 = getelementptr inbounds %struct.ArchInfo, ptr %120, i32 0, i32 0
  %122 = load i32, ptr %121, align 8, !tbaa !27
  %123 = icmp eq i32 %122, 2
  br i1 %123, label %129, label %124

124:                                              ; preds = %119
  %125 = load ptr, ptr %8, align 8, !tbaa !5
  %126 = getelementptr inbounds %struct.ArchInfo, ptr %125, i32 0, i32 0
  %127 = load i32, ptr %126, align 8, !tbaa !27
  %128 = icmp eq i32 %127, 7
  br i1 %128, label %129, label %130

129:                                              ; preds = %124, %119
  br label %130

130:                                              ; preds = %129, %124
  %131 = load ptr, ptr %7, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %17, ptr align 4 %14, i64 92, i1 false), !tbaa.struct !13
  call void @_ZN6Tensor6resizeE10TensorDesc(ptr noundef nonnull align 8 dereferenceable(32) %131, ptr noundef byval(%struct.TensorDesc) align 8 %17)
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #7
  call void @llvm.lifetime.end.p0(i64 92, ptr %14) #7
  call void @llvm.lifetime.end.p0(i64 92, ptr %13) #7
  ret i32 0
}

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

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

declare i32 @fflush(ptr noundef) #3

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

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

; 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) #6

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { 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 = { "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 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 #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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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, !12, i64 0}
!20 = !{!"_ZTS15ArgMaxParamSpec", !12, i64 0}
!21 = !{!22, !12, i64 8}
!22 = !{!"_ZTS10TensorDesc", !15, i64 0, !17, i64 4, !12, i64 8, !7, i64 12}
!23 = distinct !{!23, !24}
!24 = !{!"llvm.loop.mustprogress"}
!25 = !{!22, !15, i64 0}
!26 = !{!22, !17, i64 4}
!27 = !{!28, !29, i64 0}
!28 = !{!"_ZTS8ArchInfo", !29, i64 0, !6, i64 8}
!29 = !{!"_ZTS4Arch", !7, i64 0}


; 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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0

; 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 #1 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_Z24argmax_infer_output_sizeP6Tensor15ArgMaxParamSpecS0_P8ArchInfo(ptr noundef %0, i32 %1, ptr noundef %2, ptr nocapture noundef readnone %3) local_unnamed_addr #1 {
  %5 = alloca %struct.TensorDesc, align 4
  %6 = alloca %struct.TensorDesc, align 8
  %7 = icmp eq ptr %0, null
  br i1 %7, label %8, label %18

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

18:                                               ; preds = %4
  %19 = icmp eq ptr %2, null
  br i1 %19, label %20, label %30

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

30:                                               ; preds = %18
  call void @llvm.lifetime.start.p0(i64 92, ptr nonnull %5) #7
  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) #7
  call void @_ZN6Tensor8get_descEv(ptr dead_on_unwind nonnull writable sret(%struct.TensorDesc) align 4 %6, ptr noundef nonnull align 8 dereferenceable(32) %2)
  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 !9
  %31 = icmp slt i32 %1, 0
  %32 = getelementptr inbounds i8, ptr %5, i64 8
  %33 = load i32, ptr %32, align 4
  %34 = select i1 %31, i32 %33, i32 0
  %.019 = add i32 %34, %1
  %35 = xor i32 %.019, -1
  %36 = add i32 %33, %35
  %37 = add nsw i32 %33, -1
  %38 = icmp slt i32 %36, %37
  br i1 %38, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %30
  %39 = getelementptr inbounds i8, ptr %6, i64 12
  %40 = sext i32 %36 to i64
  %41 = add i32 %34, %1
  %42 = add i32 %41, -1
  %43 = zext i32 %42 to i64
  %44 = add nuw nsw i64 %43, 1
  %min.iters.check = icmp ult i32 %42, 7
  br i1 %min.iters.check, label %scalar.ph.preheader, label %vector.ph

scalar.ph.preheader:                              ; preds = %middle.block, %.lr.ph
  %indvars.iv.ph = phi i64 [ %40, %.lr.ph ], [ %ind.end, %middle.block ]
  br label %scalar.ph

vector.ph:                                        ; preds = %.lr.ph
  %n.vec = and i64 %44, 8589934584
  %ind.end = add nsw i64 %n.vec, %40
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %offset.idx = add i64 %index, %40
  %45 = add nsw i64 %offset.idx, 1
  %46 = getelementptr inbounds [20 x i32], ptr %39, i64 0, i64 %45
  %47 = getelementptr inbounds i8, ptr %46, i64 16
  %wide.load = load <4 x i32>, ptr %46, align 4, !tbaa !14
  %wide.load27 = load <4 x i32>, ptr %47, align 4, !tbaa !14
  %48 = getelementptr inbounds [20 x i32], ptr %39, i64 0, i64 %offset.idx
  %49 = getelementptr inbounds i8, ptr %48, i64 16
  store <4 x i32> %wide.load, ptr %48, align 4, !tbaa !14
  store <4 x i32> %wide.load27, ptr %49, align 4, !tbaa !14
  %index.next = add nuw i64 %index, 8
  %50 = icmp eq i64 %index.next, %n.vec
  br i1 %50, label %middle.block, label %vector.body, !llvm.loop !17

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %44, %n.vec
  br i1 %cmp.n, label %._crit_edge, label %scalar.ph.preheader

._crit_edge:                                      ; preds = %scalar.ph, %middle.block, %30
  %51 = getelementptr inbounds i8, ptr %6, i64 8
  store i32 %37, ptr %51, align 8, !tbaa !21
  store i32 3, ptr %6, align 8, !tbaa !23
  switch i32 %33, label %56 [
    i32 3, label %.thread22.sink.split
    i32 4, label %55
  ]

scalar.ph:                                        ; preds = %scalar.ph.preheader, %scalar.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %scalar.ph ], [ %indvars.iv.ph, %scalar.ph.preheader ]
  %indvars.iv.next = add nsw i64 %indvars.iv, 1
  %52 = getelementptr inbounds [20 x i32], ptr %39, i64 0, i64 %indvars.iv.next
  %53 = load i32, ptr %52, align 4, !tbaa !14
  %54 = getelementptr inbounds [20 x i32], ptr %39, i64 0, i64 %indvars.iv
  store i32 %53, ptr %54, align 4, !tbaa !14
  %lftr.wideiv = trunc i64 %indvars.iv.next to i32
  %exitcond.not = icmp eq i32 %37, %lftr.wideiv
  br i1 %exitcond.not, label %._crit_edge, label %scalar.ph, !llvm.loop !24

55:                                               ; preds = %._crit_edge
  br label %.thread22.sink.split

56:                                               ; preds = %._crit_edge
  %57 = icmp ugt i32 %37, 3
  br i1 %57, label %.thread22.sink.split, label %.thread22

.thread22.sink.split:                             ; preds = %56, %._crit_edge, %55
  %.sink = phi i32 [ 15, %55 ], [ 14, %._crit_edge ], [ 0, %56 ]
  %58 = getelementptr inbounds i8, ptr %6, i64 4
  store i32 %.sink, ptr %58, align 4, !tbaa !25
  br label %.thread22

.thread22:                                        ; preds = %.thread22.sink.split, %56
  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) #7
  call void @llvm.lifetime.end.p0(i64 92, ptr nonnull %5) #7
  ret i32 0
}

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

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

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

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

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

; 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) #6

; 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 #1 align 2

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { 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 = { 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 #4 = { 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 #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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 = distinct !{!17, !18, !19, !20}
!18 = !{!"llvm.loop.mustprogress"}
!19 = !{!"llvm.loop.isvectorized", i32 1}
!20 = !{!"llvm.loop.unroll.runtime.disable"}
!21 = !{!22, !15, i64 8}
!22 = !{!"_ZTS10TensorDesc", !11, i64 0, !13, i64 4, !15, i64 8, !7, i64 12}
!23 = !{!22, !11, i64 0}
!24 = distinct !{!24, !18, !20, !19}
!25 = !{!22, !13, i64 4}


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