; LLVM IR from huawei-noah/bolt :: compute/tensor/src/pooling.ll (Z31pooling_infer_forward_tmp_bytes6TensorS_PjP8ArchInfo)

; 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.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: nounwind
declare i64 @syscall(i64 noundef, ...) #1

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

declare i32 @fflush(ptr noundef) #2

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

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

; 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
declare dso_local void @_ZN6Tensor8get_descEv(ptr dead_on_unwind noalias writable sret(%struct.TensorDesc) align 4, ptr noundef nonnull align 8 dereferenceable(32)) #5 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_Z17transformDescTo4d10TensorDesc(ptr dead_on_unwind noalias writable sret(%struct.TensorDesc) align 4, ptr noundef byval(%struct.TensorDesc) align 8) #6

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

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_Z31pooling_infer_forward_tmp_bytes6TensorS_PjP8ArchInfo(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3) #5 {
  %5 = alloca ptr, align 8
  %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 %struct.TensorDesc, align 4
  %12 = alloca %struct.TensorDesc, align 8
  %13 = alloca i32, align 4
  %14 = alloca %struct.TensorDesc, align 4
  %15 = alloca %struct.TensorDesc, align 8
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca %struct.TensorDesc, align 8
  %21 = alloca %struct.TensorDesc, align 8
  store ptr %0, ptr %5, align 8, !tbaa !5
  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
  %22 = load ptr, ptr %7, align 8, !tbaa !5
  %23 = icmp eq ptr %22, null
  br i1 %23, label %24, label %40

24:                                               ; preds = %4
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #8
  store i32 1, ptr %9, align 4, !tbaa !9
  %25 = load i32, ptr %9, 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 %10) #8
  %28 = call i64 (i64, ...) @syscall(i64 noundef 186) #8
  %29 = trunc i64 %28 to i32
  store i32 %29, ptr %10, align 4, !tbaa !11
  %30 = load i32, ptr %10, 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 %9, 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) #9
  unreachable

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

40:                                               ; preds = %39, %4
  call void @llvm.lifetime.start.p0(i64 92, ptr %11) #8
  call void @_ZN6Tensor8get_descEv(ptr dead_on_unwind writable sret(%struct.TensorDesc) align 4 %12, ptr noundef nonnull align 8 dereferenceable(32) %0)
  call void @_Z17transformDescTo4d10TensorDesc(ptr dead_on_unwind writable sret(%struct.TensorDesc) align 4 %11, ptr noundef byval(%struct.TensorDesc) align 8 %12)
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #8
  store i32 51, ptr %13, align 4, !tbaa !9
  %41 = load ptr, ptr %8, align 8, !tbaa !5
  %42 = getelementptr inbounds %struct.ArchInfo, ptr %41, i32 0, i32 0
  %43 = load i32, ptr %42, align 8, !tbaa !13
  %44 = icmp eq i32 %43, 2
  br i1 %44, label %50, label %45

45:                                               ; preds = %40
  %46 = load ptr, ptr %8, align 8, !tbaa !5
  %47 = getelementptr inbounds %struct.ArchInfo, ptr %46, i32 0, i32 0
  %48 = load i32, ptr %47, align 8, !tbaa !13
  %49 = icmp eq i32 %48, 7
  br i1 %49, label %50, label %51

50:                                               ; preds = %45, %40
  br label %163

51:                                               ; preds = %45
  %52 = load ptr, ptr %8, align 8, !tbaa !5
  %53 = getelementptr inbounds %struct.ArchInfo, ptr %52, i32 0, i32 0
  %54 = load i32, ptr %53, align 8, !tbaa !13
  %55 = icmp eq i32 %54, 1
  br i1 %55, label %56, label %58

56:                                               ; preds = %51
  %57 = load ptr, ptr %7, align 8, !tbaa !5
  store i32 0, ptr %57, align 4, !tbaa !11
  store i32 0, ptr %13, align 4, !tbaa !9
  br label %162

58:                                               ; preds = %51
  %59 = load ptr, ptr %7, align 8, !tbaa !5
  store i32 0, ptr %59, align 4, !tbaa !11
  store i32 0, ptr %13, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 92, ptr %14) #8
  call void @_ZN6Tensor8get_descEv(ptr dead_on_unwind writable sret(%struct.TensorDesc) align 4 %15, ptr noundef nonnull align 8 dereferenceable(32) %1)
  call void @_Z17transformDescTo4d10TensorDesc(ptr dead_on_unwind writable sret(%struct.TensorDesc) align 4 %14, ptr noundef byval(%struct.TensorDesc) align 8 %15)
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #8
  %60 = getelementptr inbounds %struct.TensorDesc, ptr %14, i32 0, i32 1
  %61 = load i32, ptr %60, align 4, !tbaa !16
  store i32 %61, ptr %16, align 4, !tbaa !20
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #8
  %62 = getelementptr inbounds %struct.TensorDesc, ptr %11, i32 0, i32 2
  %63 = load i32, ptr %62, align 4, !tbaa !21
  %64 = sub i32 %63, 2
  store i32 %64, ptr %17, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #8
  store i32 8, ptr %18, align 4, !tbaa !11
  %65 = load ptr, ptr %8, align 8, !tbaa !5
  %66 = getelementptr inbounds %struct.ArchInfo, ptr %65, i32 0, i32 0
  %67 = load i32, ptr %66, align 8, !tbaa !13
  %68 = icmp eq i32 %67, 8
  br i1 %68, label %89, label %69

69:                                               ; preds = %58
  %70 = load ptr, ptr %8, align 8, !tbaa !5
  %71 = getelementptr inbounds %struct.ArchInfo, ptr %70, i32 0, i32 0
  %72 = load i32, ptr %71, align 8, !tbaa !13
  %73 = icmp eq i32 %72, 9
  br i1 %73, label %89, label %74

74:                                               ; preds = %69
  %75 = load ptr, ptr %8, align 8, !tbaa !5
  %76 = getelementptr inbounds %struct.ArchInfo, ptr %75, i32 0, i32 0
  %77 = load i32, ptr %76, align 8, !tbaa !13
  %78 = icmp eq i32 %77, 10
  br i1 %78, label %89, label %79

79:                                               ; preds = %74
  %80 = load ptr, ptr %8, align 8, !tbaa !5
  %81 = getelementptr inbounds %struct.ArchInfo, ptr %80, i32 0, i32 0
  %82 = load i32, ptr %81, align 8, !tbaa !13
  %83 = icmp eq i32 %82, 9
  br i1 %83, label %89, label %84

84:                                               ; preds = %79
  %85 = load ptr, ptr %8, align 8, !tbaa !5
  %86 = getelementptr inbounds %struct.ArchInfo, ptr %85, i32 0, i32 0
  %87 = load i32, ptr %86, align 8, !tbaa !13
  %88 = icmp eq i32 %87, 10
  br i1 %88, label %89, label %102

89:                                               ; preds = %84, %79, %74, %69, %58
  %90 = load i32, ptr %16, align 4, !tbaa !20
  %91 = icmp eq i32 %90, 0
  br i1 %91, label %95, label %92

92:                                               ; preds = %89
  %93 = load i32, ptr %16, align 4, !tbaa !20
  %94 = icmp eq i32 %93, 15
  br i1 %94, label %95, label %96

95:                                               ; preds = %92, %89
  store i32 1, ptr %18, align 4, !tbaa !11
  br label %96

96:                                               ; preds = %95, %92
  %97 = getelementptr inbounds %struct.TensorDesc, ptr %11, i32 0, i32 0
  %98 = load i32, ptr %97, align 4, !tbaa !22
  %99 = icmp eq i32 %98, 10
  br i1 %99, label %100, label %101

100:                                              ; preds = %96
  store i32 41, ptr %16, align 4, !tbaa !20
  store i32 16, ptr %18, align 4, !tbaa !11
  br label %101

101:                                              ; preds = %100, %96
  br label %103

102:                                              ; preds = %84
  store i32 2, ptr %16, align 4, !tbaa !20
  br label %103

103:                                              ; preds = %102, %101
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #8
  %104 = getelementptr inbounds %struct.TensorDesc, ptr %11, i32 0, i32 3
  %105 = load i32, ptr %17, align 4, !tbaa !11
  %106 = sext i32 %105 to i64
  %107 = getelementptr inbounds [20 x i32], ptr %104, i64 0, i64 %106
  %108 = load i32, ptr %107, align 4, !tbaa !11
  %109 = load i32, ptr %18, align 4, !tbaa !11
  %110 = add i32 %108, %109
  %111 = sub i32 %110, 1
  %112 = load i32, ptr %18, align 4, !tbaa !11
  %113 = udiv i32 %111, %112
  %114 = load i32, ptr %18, align 4, !tbaa !11
  %115 = mul i32 %113, %114
  store i32 %115, ptr %19, align 4, !tbaa !11
  %116 = load i32, ptr %19, align 4, !tbaa !11
  %117 = getelementptr inbounds %struct.TensorDesc, ptr %11, i32 0, i32 3
  %118 = load i32, ptr %17, align 4, !tbaa !11
  %119 = sext i32 %118 to i64
  %120 = getelementptr inbounds [20 x i32], ptr %117, i64 0, i64 %119
  %121 = load i32, ptr %120, align 4, !tbaa !11
  %122 = icmp ne i32 %116, %121
  br i1 %122, label %128, label %123

123:                                              ; preds = %103
  %124 = getelementptr inbounds %struct.TensorDesc, ptr %11, i32 0, i32 1
  %125 = load i32, ptr %124, align 4, !tbaa !16
  %126 = load i32, ptr %16, align 4, !tbaa !20
  %127 = icmp ne i32 %125, %126
  br i1 %127, label %128, label %138

128:                                              ; preds = %123, %103
  %129 = load i32, ptr %19, align 4, !tbaa !11
  %130 = getelementptr inbounds %struct.TensorDesc, ptr %11, i32 0, i32 3
  %131 = load i32, ptr %17, align 4, !tbaa !11
  %132 = sext i32 %131 to i64
  %133 = getelementptr inbounds [20 x i32], ptr %130, i64 0, i64 %132
  store i32 %129, ptr %133, align 4, !tbaa !11
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %20, ptr align 4 %11, i64 92, i1 false), !tbaa.struct !23
  %134 = call noundef i32 @_Z14tensorNumBytes10TensorDesc(ptr noundef byval(%struct.TensorDesc) align 8 %20)
  %135 = load ptr, ptr %7, align 8, !tbaa !5
  %136 = load i32, ptr %135, align 4, !tbaa !11
  %137 = add i32 %136, %134
  store i32 %137, ptr %135, align 4, !tbaa !11
  br label %138

138:                                              ; preds = %128, %123
  %139 = load i32, ptr %19, align 4, !tbaa !11
  %140 = getelementptr inbounds %struct.TensorDesc, ptr %14, i32 0, i32 3
  %141 = load i32, ptr %17, align 4, !tbaa !11
  %142 = sext i32 %141 to i64
  %143 = getelementptr inbounds [20 x i32], ptr %140, i64 0, i64 %142
  %144 = load i32, ptr %143, align 4, !tbaa !11
  %145 = icmp ne i32 %139, %144
  br i1 %145, label %151, label %146

146:                                              ; preds = %138
  %147 = getelementptr inbounds %struct.TensorDesc, ptr %14, i32 0, i32 1
  %148 = load i32, ptr %147, align 4, !tbaa !16
  %149 = load i32, ptr %16, align 4, !tbaa !20
  %150 = icmp ne i32 %148, %149
  br i1 %150, label %151, label %161

151:                                              ; preds = %146, %138
  %152 = load i32, ptr %19, align 4, !tbaa !11
  %153 = getelementptr inbounds %struct.TensorDesc, ptr %14, i32 0, i32 3
  %154 = load i32, ptr %17, align 4, !tbaa !11
  %155 = sext i32 %154 to i64
  %156 = getelementptr inbounds [20 x i32], ptr %153, i64 0, i64 %155
  store i32 %152, ptr %156, align 4, !tbaa !11
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %21, ptr align 4 %14, i64 92, i1 false), !tbaa.struct !23
  %157 = call noundef i32 @_Z14tensorNumBytes10TensorDesc(ptr noundef byval(%struct.TensorDesc) align 8 %21)
  %158 = load ptr, ptr %7, align 8, !tbaa !5
  %159 = load i32, ptr %158, align 4, !tbaa !11
  %160 = add i32 %159, %157
  store i32 %160, ptr %158, align 4, !tbaa !11
  br label %161

161:                                              ; preds = %151, %146
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #8
  call void @llvm.lifetime.end.p0(i64 92, ptr %14) #8
  br label %162

162:                                              ; preds = %161, %56
  br label %163

163:                                              ; preds = %162, %50
  %164 = load i32, ptr %13, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #8
  call void @llvm.lifetime.end.p0(i64 92, ptr %11) #8
  ret i32 %164
}

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i32 @_Z14tensorNumBytes10TensorDesc(ptr noundef byval(%struct.TensorDesc) align 8) #6

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { "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 = { 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 #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 = { 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 #6 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #8 = { nounwind }
attributes #9 = { 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 = !{!14, !15, i64 0}
!14 = !{!"_ZTS8ArchInfo", !15, i64 0, !6, i64 8}
!15 = !{!"_ZTS4Arch", !7, i64 0}
!16 = !{!17, !19, i64 4}
!17 = !{!"_ZTS10TensorDesc", !18, i64 0, !19, i64 4, !12, i64 8, !7, i64 12}
!18 = !{!"_ZTS8DataType", !7, i64 0}
!19 = !{!"_ZTS10DataFormat", !7, i64 0}
!20 = !{!19, !19, i64 0}
!21 = !{!17, !12, i64 8}
!22 = !{!17, !18, i64 0}
!23 = !{i64 0, i64 4, !24, i64 4, i64 4, !20, i64 8, i64 4, !11, i64 12, i64 80, !25}
!24 = !{!18, !18, i64 0}
!25 = !{!7, !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: nounwind
declare i64 @syscall(i64 noundef, ...) local_unnamed_addr #1

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

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

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_Z17transformDescTo4d10TensorDesc(ptr dead_on_unwind noalias writable sret(%struct.TensorDesc) align 4, ptr noundef byval(%struct.TensorDesc) align 8) local_unnamed_addr #6

; Function Attrs: mustprogress uwtable
define dso_local noundef range(i32 0, 52) i32 @_Z31pooling_infer_forward_tmp_bytes6TensorS_PjP8ArchInfo(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr nocapture noundef readonly %3) local_unnamed_addr #5 {
  %5 = alloca %struct.TensorDesc, align 8
  %6 = alloca %struct.TensorDesc, align 8
  %7 = alloca %struct.TensorDesc, align 8
  %8 = alloca %struct.TensorDesc, align 8
  %9 = icmp eq ptr %2, null
  br i1 %9, label %10, label %20

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

20:                                               ; preds = %4
  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 %6, ptr noundef nonnull align 8 dereferenceable(32) %0)
  call void @_Z17transformDescTo4d10TensorDesc(ptr dead_on_unwind nonnull writable sret(%struct.TensorDesc) align 4 %5, ptr noundef nonnull byval(%struct.TensorDesc) align 8 %6)
  %21 = load i32, ptr %3, align 8, !tbaa !9
  switch i32 %21, label %23 [
    i32 2, label %58
    i32 7, label %58
    i32 1, label %22
  ]

22:                                               ; preds = %20
  store i32 0, ptr %2, align 4, !tbaa !12
  br label %58

23:                                               ; preds = %20
  store i32 0, ptr %2, align 4, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 92, ptr nonnull %7) #7
  call void @_ZN6Tensor8get_descEv(ptr dead_on_unwind nonnull writable sret(%struct.TensorDesc) align 4 %8, ptr noundef nonnull align 8 dereferenceable(32) %1)
  call void @_Z17transformDescTo4d10TensorDesc(ptr dead_on_unwind nonnull writable sret(%struct.TensorDesc) align 4 %7, ptr noundef nonnull byval(%struct.TensorDesc) align 8 %8)
  %24 = getelementptr inbounds i8, ptr %7, i64 4
  %25 = getelementptr inbounds i8, ptr %5, i64 8
  %26 = load i32, ptr %25, align 8, !tbaa !14
  %27 = add i32 %26, -2
  %28 = load i32, ptr %3, align 8, !tbaa !9
  %.off = add i32 %28, -8
  %switch = icmp ult i32 %.off, 3
  br i1 %switch, label %29, label %34

29:                                               ; preds = %23
  %30 = load i32, ptr %24, align 4, !tbaa !18
  %switch.selectcmp.case1 = icmp eq i32 %30, 15
  %switch.selectcmp.case2 = icmp eq i32 %30, 0
  %switch.selectcmp = or i1 %switch.selectcmp.case1, %switch.selectcmp.case2
  %31 = select i1 %switch.selectcmp, i32 1, i32 8
  %32 = load i32, ptr %5, align 8, !tbaa !19
  %33 = icmp eq i32 %32, 10
  %spec.select = select i1 %33, i32 41, i32 %30
  %spec.select42 = select i1 %33, i32 16, i32 %31
  br label %34

34:                                               ; preds = %29, %23
  %.034 = phi i32 [ %spec.select, %29 ], [ 2, %23 ]
  %.1 = phi i32 [ %spec.select42, %29 ], [ 8, %23 ]
  %35 = getelementptr inbounds i8, ptr %5, i64 12
  %36 = sext i32 %27 to i64
  %37 = getelementptr inbounds [20 x i32], ptr %35, i64 0, i64 %36
  %38 = load i32, ptr %37, align 4, !tbaa !12
  %.fr = freeze i32 %38
  %39 = add nsw i32 %.1, -1
  %40 = add i32 %39, %.fr
  %.not = sub nsw i32 0, %.1
  %41 = and i32 %40, %.not
  %.not38 = icmp eq i32 %41, %.fr
  %42 = getelementptr inbounds i8, ptr %5, i64 4
  %43 = load i32, ptr %42, align 4
  %.not39 = icmp eq i32 %43, %.034
  %or.cond = select i1 %.not38, i1 %.not39, i1 false
  br i1 %or.cond, label %48, label %44

44:                                               ; preds = %34
  store i32 %41, ptr %37, align 4, !tbaa !12
  %45 = call noundef i32 @_Z14tensorNumBytes10TensorDesc(ptr noundef nonnull byval(%struct.TensorDesc) align 8 %5)
  %46 = load i32, ptr %2, align 4, !tbaa !12
  %47 = add i32 %46, %45
  store i32 %47, ptr %2, align 4, !tbaa !12
  br label %48

48:                                               ; preds = %34, %44
  %49 = getelementptr inbounds i8, ptr %7, i64 12
  %50 = getelementptr inbounds [20 x i32], ptr %49, i64 0, i64 %36
  %51 = load i32, ptr %50, align 4, !tbaa !12
  %.not40 = icmp eq i32 %41, %51
  %52 = load i32, ptr %24, align 4
  %.not41 = icmp eq i32 %52, %.034
  %or.cond44 = select i1 %.not40, i1 %.not41, i1 false
  br i1 %or.cond44, label %57, label %53

53:                                               ; preds = %48
  store i32 %41, ptr %50, align 4, !tbaa !12
  %54 = call noundef i32 @_Z14tensorNumBytes10TensorDesc(ptr noundef nonnull byval(%struct.TensorDesc) align 8 %7)
  %55 = load i32, ptr %2, align 4, !tbaa !12
  %56 = add i32 %55, %54
  store i32 %56, ptr %2, align 4, !tbaa !12
  br label %57

57:                                               ; preds = %48, %53
  call void @llvm.lifetime.end.p0(i64 92, ptr nonnull %7) #7
  br label %58

58:                                               ; preds = %20, %20, %22, %57
  %.0 = phi i32 [ 51, %20 ], [ 0, %22 ], [ 0, %57 ], [ 51, %20 ]
  call void @llvm.lifetime.end.p0(i64 92, ptr nonnull %5) #7
  ret i32 %.0
}

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i32 @_Z14tensorNumBytes10TensorDesc(ptr noundef byval(%struct.TensorDesc) align 8) local_unnamed_addr #6

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { 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 #3 = { 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 #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 = { 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 #6 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #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, !11, i64 0}
!10 = !{!"_ZTS8ArchInfo", !11, i64 0, !6, i64 8}
!11 = !{!"_ZTS4Arch", !7, i64 0}
!12 = !{!13, !13, i64 0}
!13 = !{!"int", !7, i64 0}
!14 = !{!15, !13, i64 8}
!15 = !{!"_ZTS10TensorDesc", !16, i64 0, !17, i64 4, !13, i64 8, !7, i64 12}
!16 = !{!"_ZTS8DataType", !7, i64 0}
!17 = !{!"_ZTS10DataFormat", !7, i64 0}
!18 = !{!15, !17, i64 4}
!19 = !{!15, !16, i64 0}


; Effective O3 passes: DSEPass,EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,MemCpyOptPass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass