; LLVM IR from huawei-noah/bolt :: common/uni/src/tensor_transpose.ll (Z15transformFormat10TensorDescPKvS_Pv)

; 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] }

@.str = external hidden unnamed_addr constant [20 x i8], align 1
@stdout = external global ptr, align 8
@.str.4 = external hidden unnamed_addr constant [77 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [58 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: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_Z10UNI_MEMCPYPvPKvm(ptr noundef, ptr noundef, i64 noundef) #1

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

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

declare i32 @fflush(ptr noundef) #3

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z15transformToNCHW10TensorDescPKvS_Pv(ptr noundef byval(%struct.TensorDesc) align 8, ptr noundef, ptr noundef byval(%struct.TensorDesc) align 8, ptr 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 noundef i32 @_Z15transformToNHWC10TensorDescPKvS_Pv(ptr noundef byval(%struct.TensorDesc) align 8, ptr noundef, ptr noundef byval(%struct.TensorDesc) align 8, ptr noundef) #5

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z24transformNCHWC16ToNCHWC810TensorDescPKvS_Pv(ptr noundef byval(%struct.TensorDesc) align 8, ptr noundef, ptr noundef byval(%struct.TensorDesc) align 8, ptr noundef) #5

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z21transformNCHWToNCHWC810TensorDescPKvS_Pv(ptr noundef byval(%struct.TensorDesc) align 8, ptr noundef, ptr noundef byval(%struct.TensorDesc) align 8, ptr noundef) #5

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z21transformNHWCToNCHWC810TensorDescPKvS_Pv(ptr noundef byval(%struct.TensorDesc) align 8, ptr noundef, ptr noundef byval(%struct.TensorDesc) align 8, ptr noundef) #5

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z30transformNCHWC8ToNCHWC8ByGroup10TensorDescPKviS_Pv(ptr noundef byval(%struct.TensorDesc) align 8, ptr noundef, i32 noundef, ptr noundef byval(%struct.TensorDesc) align 8, ptr noundef) #5

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z18transformToNCHWC1610TensorDescPKvS_Pv(ptr noundef byval(%struct.TensorDesc) align 8, ptr noundef, ptr noundef byval(%struct.TensorDesc) align 8, ptr noundef) #5

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_Z15transformFormat10TensorDescPKvS_Pv(ptr noundef byval(%struct.TensorDesc) align 8 %0, ptr noundef %1, ptr noundef byval(%struct.TensorDesc) align 8 %2, ptr noundef %3) #5 {
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca %struct.TensorDesc, align 8
  %9 = alloca %struct.TensorDesc, align 8
  %10 = alloca %struct.TensorDesc, align 8
  %11 = alloca %struct.TensorDesc, align 8
  %12 = alloca %struct.TensorDesc, align 8
  %13 = alloca %struct.TensorDesc, align 8
  %14 = alloca %struct.TensorDesc, align 8
  %15 = alloca %struct.TensorDesc, align 8
  %16 = alloca %struct.TensorDesc, align 8
  %17 = alloca %struct.TensorDesc, align 8
  %18 = alloca %struct.TensorDesc, align 8
  %19 = alloca i32, align 4
  %20 = alloca %struct.TensorDesc, align 8
  %21 = alloca %struct.TensorDesc, align 8
  %22 = alloca %struct.TensorDesc, align 8
  %23 = alloca %struct.TensorDesc, align 8
  %24 = alloca i32, align 4
  store ptr %1, ptr %5, align 8, !tbaa !5
  store ptr %3, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #8
  store i32 51, ptr %7, align 4, !tbaa !9
  %25 = getelementptr inbounds %struct.TensorDesc, ptr %2, i32 0, i32 1
  %26 = load i32, ptr %25, align 4, !tbaa !11
  %27 = icmp eq i32 %26, 0
  br i1 %27, label %36, label %28

28:                                               ; preds = %4
  %29 = getelementptr inbounds %struct.TensorDesc, ptr %2, i32 0, i32 1
  %30 = load i32, ptr %29, align 4, !tbaa !11
  %31 = icmp eq i32 %30, 15
  br i1 %31, label %36, label %32

32:                                               ; preds = %28
  %33 = getelementptr inbounds %struct.TensorDesc, ptr %2, i32 0, i32 1
  %34 = load i32, ptr %33, align 4, !tbaa !11
  %35 = icmp eq i32 %34, 14
  br i1 %35, label %36, label %40

36:                                               ; preds = %32, %28, %4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %8, ptr align 8 %0, i64 92, i1 false), !tbaa.struct !16
  %37 = load ptr, ptr %5, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %9, ptr align 8 %2, i64 92, i1 false), !tbaa.struct !16
  %38 = load ptr, ptr %6, align 8, !tbaa !5
  %39 = call noundef i32 @_Z15transformToNCHW10TensorDescPKvS_Pv(ptr noundef byval(%struct.TensorDesc) align 8 %8, ptr noundef %37, ptr noundef byval(%struct.TensorDesc) align 8 %9, ptr noundef %38)
  store i32 %39, ptr %7, align 4, !tbaa !9
  br label %149

40:                                               ; preds = %32
  %41 = getelementptr inbounds %struct.TensorDesc, ptr %2, i32 0, i32 1
  %42 = load i32, ptr %41, align 4, !tbaa !11
  %43 = icmp eq i32 %42, 2
  br i1 %43, label %44, label %114

44:                                               ; preds = %40
  %45 = getelementptr inbounds %struct.TensorDesc, ptr %0, i32 0, i32 2
  %46 = load i32, ptr %45, align 8, !tbaa !21
  %47 = icmp eq i32 %46, 2
  br i1 %47, label %48, label %53

48:                                               ; preds = %44
  %49 = load ptr, ptr %6, align 8, !tbaa !5
  %50 = load ptr, ptr %5, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %10, ptr align 8 %0, i64 92, i1 false), !tbaa.struct !16
  %51 = call noundef i32 @_Z14tensorNumBytes10TensorDesc(ptr noundef byval(%struct.TensorDesc) align 8 %10)
  %52 = zext i32 %51 to i64
  call void @_Z10UNI_MEMCPYPvPKvm(ptr noundef %49, ptr noundef %50, i64 noundef %52)
  store i32 0, ptr %7, align 4, !tbaa !9
  br label %113

53:                                               ; preds = %44
  %54 = getelementptr inbounds %struct.TensorDesc, ptr %0, i32 0, i32 1
  %55 = load i32, ptr %54, align 4, !tbaa !11
  %56 = icmp eq i32 %55, 0
  br i1 %56, label %65, label %57

57:                                               ; preds = %53
  %58 = getelementptr inbounds %struct.TensorDesc, ptr %0, i32 0, i32 1
  %59 = load i32, ptr %58, align 4, !tbaa !11
  %60 = icmp eq i32 %59, 15
  br i1 %60, label %65, label %61

61:                                               ; preds = %57
  %62 = getelementptr inbounds %struct.TensorDesc, ptr %0, i32 0, i32 1
  %63 = load i32, ptr %62, align 4, !tbaa !11
  %64 = icmp eq i32 %63, 14
  br i1 %64, label %65, label %69

65:                                               ; preds = %61, %57, %53
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %11, ptr align 8 %0, i64 92, i1 false), !tbaa.struct !16
  %66 = load ptr, ptr %5, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %12, ptr align 8 %2, i64 92, i1 false), !tbaa.struct !16
  %67 = load ptr, ptr %6, align 8, !tbaa !5
  %68 = call noundef i32 @_Z21transformNCHWToNCHWC810TensorDescPKvS_Pv(ptr noundef byval(%struct.TensorDesc) align 8 %11, ptr noundef %66, ptr noundef byval(%struct.TensorDesc) align 8 %12, ptr noundef %67)
  store i32 %68, ptr %7, align 4, !tbaa !9
  br label %112

69:                                               ; preds = %61
  %70 = getelementptr inbounds %struct.TensorDesc, ptr %0, i32 0, i32 1
  %71 = load i32, ptr %70, align 4, !tbaa !11
  %72 = icmp eq i32 %71, 24
  br i1 %72, label %73, label %77

73:                                               ; preds = %69
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %13, ptr align 8 %0, i64 92, i1 false), !tbaa.struct !16
  %74 = load ptr, ptr %5, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %14, ptr align 8 %2, i64 92, i1 false), !tbaa.struct !16
  %75 = load ptr, ptr %6, align 8, !tbaa !5
  %76 = call noundef i32 @_Z21transformNHWCToNCHWC810TensorDescPKvS_Pv(ptr noundef byval(%struct.TensorDesc) align 8 %13, ptr noundef %74, ptr noundef byval(%struct.TensorDesc) align 8 %14, ptr noundef %75)
  store i32 %76, ptr %7, align 4, !tbaa !9
  br label %111

77:                                               ; preds = %69
  %78 = getelementptr inbounds %struct.TensorDesc, ptr %0, i32 0, i32 1
  %79 = load i32, ptr %78, align 4, !tbaa !11
  %80 = icmp eq i32 %79, 2
  br i1 %80, label %81, label %85

81:                                               ; preds = %77
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %15, ptr align 8 %0, i64 92, i1 false), !tbaa.struct !16
  %82 = load ptr, ptr %5, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %16, ptr align 8 %2, i64 92, i1 false), !tbaa.struct !16
  %83 = load ptr, ptr %6, align 8, !tbaa !5
  %84 = call noundef i32 @_Z30transformNCHWC8ToNCHWC8ByGroup10TensorDescPKviS_Pv(ptr noundef byval(%struct.TensorDesc) align 8 %15, ptr noundef %82, i32 noundef 1, ptr noundef byval(%struct.TensorDesc) align 8 %16, ptr noundef %83)
  store i32 %84, ptr %7, align 4, !tbaa !9
  br label %110

85:                                               ; preds = %77
  %86 = getelementptr inbounds %struct.TensorDesc, ptr %0, i32 0, i32 1
  %87 = load i32, ptr %86, align 4, !tbaa !11
  %88 = icmp eq i32 %87, 41
  br i1 %88, label %89, label %93

89:                                               ; preds = %85
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %17, ptr align 8 %0, i64 92, i1 false), !tbaa.struct !16
  %90 = load ptr, ptr %5, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %18, ptr align 8 %2, i64 92, i1 false), !tbaa.struct !16
  %91 = load ptr, ptr %6, align 8, !tbaa !5
  %92 = call noundef i32 @_Z24transformNCHWC16ToNCHWC810TensorDescPKvS_Pv(ptr noundef byval(%struct.TensorDesc) align 8 %17, ptr noundef %90, ptr noundef byval(%struct.TensorDesc) align 8 %18, ptr noundef %91)
  store i32 %92, ptr %7, align 4, !tbaa !9
  br label %109

93:                                               ; preds = %85
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #8
  %94 = call i64 (i64, ...) @syscall(i64 noundef 186) #8
  %95 = trunc i64 %94 to i32
  store i32 %95, ptr %19, align 4, !tbaa !19
  %96 = load i32, ptr %19, align 4, !tbaa !19
  %97 = call i32 (ptr, ...) @printf(ptr noundef @.str, i32 noundef %96)
  %98 = load ptr, ptr @stdout, align 8, !tbaa !5
  %99 = call i32 @fflush(ptr noundef %98)
  %100 = call noundef ptr @_Z14DataFormatNamev()
  %101 = getelementptr inbounds %struct.TensorDesc, ptr %0, i32 0, i32 1
  %102 = load i32, ptr %101, align 4, !tbaa !11
  %103 = zext i32 %102 to i64
  %104 = getelementptr inbounds ptr, ptr %100, i64 %103
  %105 = load ptr, ptr %104, align 8, !tbaa !5
  %106 = call i32 (ptr, ...) @printf(ptr noundef @.str.4, ptr noundef %105)
  %107 = load ptr, ptr @stdout, align 8, !tbaa !5
  %108 = call i32 @fflush(ptr noundef %107)
  call void @exit(i32 noundef 1) #9
  unreachable

109:                                              ; preds = %89
  br label %110

110:                                              ; preds = %109, %81
  br label %111

111:                                              ; preds = %110, %73
  br label %112

112:                                              ; preds = %111, %65
  br label %113

113:                                              ; preds = %112, %48
  br label %148

114:                                              ; preds = %40
  %115 = getelementptr inbounds %struct.TensorDesc, ptr %2, i32 0, i32 1
  %116 = load i32, ptr %115, align 4, !tbaa !11
  %117 = icmp eq i32 %116, 41
  br i1 %117, label %118, label %122

118:                                              ; preds = %114
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %20, ptr align 8 %0, i64 92, i1 false), !tbaa.struct !16
  %119 = load ptr, ptr %5, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %21, ptr align 8 %2, i64 92, i1 false), !tbaa.struct !16
  %120 = load ptr, ptr %6, align 8, !tbaa !5
  %121 = call noundef i32 @_Z18transformToNCHWC1610TensorDescPKvS_Pv(ptr noundef byval(%struct.TensorDesc) align 8 %20, ptr noundef %119, ptr noundef byval(%struct.TensorDesc) align 8 %21, ptr noundef %120)
  store i32 %121, ptr %7, align 4, !tbaa !9
  br label %147

122:                                              ; preds = %114
  %123 = getelementptr inbounds %struct.TensorDesc, ptr %2, i32 0, i32 1
  %124 = load i32, ptr %123, align 4, !tbaa !11
  %125 = icmp eq i32 %124, 24
  br i1 %125, label %126, label %130

126:                                              ; preds = %122
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %22, ptr align 8 %0, i64 92, i1 false), !tbaa.struct !16
  %127 = load ptr, ptr %5, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %23, ptr align 8 %2, i64 92, i1 false), !tbaa.struct !16
  %128 = load ptr, ptr %6, align 8, !tbaa !5
  %129 = call noundef i32 @_Z15transformToNHWC10TensorDescPKvS_Pv(ptr noundef byval(%struct.TensorDesc) align 8 %22, ptr noundef %127, ptr noundef byval(%struct.TensorDesc) align 8 %23, ptr noundef %128)
  store i32 %129, ptr %7, align 4, !tbaa !9
  br label %146

130:                                              ; preds = %122
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #8
  %131 = call i64 (i64, ...) @syscall(i64 noundef 186) #8
  %132 = trunc i64 %131 to i32
  store i32 %132, ptr %24, align 4, !tbaa !19
  %133 = load i32, ptr %24, align 4, !tbaa !19
  %134 = call i32 (ptr, ...) @printf(ptr noundef @.str, i32 noundef %133)
  %135 = load ptr, ptr @stdout, align 8, !tbaa !5
  %136 = call i32 @fflush(ptr noundef %135)
  %137 = call noundef ptr @_Z14DataFormatNamev()
  %138 = getelementptr inbounds %struct.TensorDesc, ptr %2, i32 0, i32 1
  %139 = load i32, ptr %138, align 4, !tbaa !11
  %140 = zext i32 %139 to i64
  %141 = getelementptr inbounds ptr, ptr %137, i64 %140
  %142 = load ptr, ptr %141, align 8, !tbaa !5
  %143 = call i32 (ptr, ...) @printf(ptr noundef @.str.5, ptr noundef %142)
  %144 = load ptr, ptr @stdout, align 8, !tbaa !5
  %145 = call i32 @fflush(ptr noundef %144)
  call void @exit(i32 noundef 1) #9
  unreachable

146:                                              ; preds = %126
  br label %147

147:                                              ; preds = %146, %118
  br label %148

148:                                              ; preds = %147, %113
  br label %149

149:                                              ; preds = %148, %36
  %150 = load i32, ptr %7, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #8
  ret i32 %150
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef ptr @_Z14DataFormatNamev() #7

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #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 = { 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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #7 = { 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 #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, !14, i64 4}
!12 = !{!"_ZTS10TensorDesc", !13, i64 0, !14, i64 4, !15, i64 8, !7, i64 12}
!13 = !{!"_ZTS8DataType", !7, i64 0}
!14 = !{!"_ZTS10DataFormat", !7, i64 0}
!15 = !{!"int", !7, i64 0}
!16 = !{i64 0, i64 4, !17, i64 4, i64 4, !18, i64 8, i64 4, !19, i64 12, i64 80, !20}
!17 = !{!13, !13, i64 0}
!18 = !{!14, !14, i64 0}
!19 = !{!15, !15, i64 0}
!20 = !{!7, !7, i64 0}
!21 = !{!12, !15, i64 8}


; 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.4 = external hidden unnamed_addr constant [77 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [58 x i8], align 1

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_Z10UNI_MEMCPYPvPKvm(ptr noundef, ptr noundef, i64 noundef) local_unnamed_addr #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: noreturn nounwind
declare void @exit(i32 noundef) local_unnamed_addr #3

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z15transformToNCHW10TensorDescPKvS_Pv(ptr noundef byval(%struct.TensorDesc) align 8, ptr noundef, ptr noundef byval(%struct.TensorDesc) align 8, ptr noundef) local_unnamed_addr #4

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z15transformToNHWC10TensorDescPKvS_Pv(ptr noundef byval(%struct.TensorDesc) align 8, ptr noundef, ptr noundef byval(%struct.TensorDesc) align 8, ptr noundef) local_unnamed_addr #4

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z24transformNCHWC16ToNCHWC810TensorDescPKvS_Pv(ptr noundef byval(%struct.TensorDesc) align 8, ptr noundef, ptr noundef byval(%struct.TensorDesc) align 8, ptr noundef) local_unnamed_addr #4

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z21transformNCHWToNCHWC810TensorDescPKvS_Pv(ptr noundef byval(%struct.TensorDesc) align 8, ptr noundef, ptr noundef byval(%struct.TensorDesc) align 8, ptr noundef) local_unnamed_addr #4

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z21transformNHWCToNCHWC810TensorDescPKvS_Pv(ptr noundef byval(%struct.TensorDesc) align 8, ptr noundef, ptr noundef byval(%struct.TensorDesc) align 8, ptr noundef) local_unnamed_addr #4

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z30transformNCHWC8ToNCHWC8ByGroup10TensorDescPKviS_Pv(ptr noundef byval(%struct.TensorDesc) align 8, ptr noundef, i32 noundef, ptr noundef byval(%struct.TensorDesc) align 8, ptr noundef) local_unnamed_addr #4

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z18transformToNCHWC1610TensorDescPKvS_Pv(ptr noundef byval(%struct.TensorDesc) align 8, ptr noundef, ptr noundef byval(%struct.TensorDesc) align 8, ptr noundef) local_unnamed_addr #4

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_Z15transformFormat10TensorDescPKvS_Pv(ptr nocapture noundef readonly byval(%struct.TensorDesc) align 8 %0, ptr noundef %1, ptr nocapture noundef readonly byval(%struct.TensorDesc) align 8 %2, ptr noundef %3) local_unnamed_addr #4 {
  %5 = getelementptr inbounds i8, ptr %2, i64 4
  %6 = load i32, ptr %5, align 4
  switch i32 %6, label %44 [
    i32 15, label %7
    i32 14, label %7
    i32 0, label %7
    i32 2, label %9
    i32 41, label %40
    i32 24, label %42
  ]

7:                                                ; preds = %4, %4, %4
  %8 = tail call noundef i32 @_Z15transformToNCHW10TensorDescPKvS_Pv(ptr noundef nonnull byval(%struct.TensorDesc) align 8 %0, ptr noundef %1, ptr noundef nonnull byval(%struct.TensorDesc) align 8 %2, ptr noundef %3)
  br label %57

9:                                                ; preds = %4
  %10 = getelementptr inbounds i8, ptr %0, i64 8
  %11 = load i32, ptr %10, align 8, !tbaa !5
  %12 = icmp eq i32 %11, 2
  br i1 %12, label %13, label %16

13:                                               ; preds = %9
  %14 = tail call noundef i32 @_Z14tensorNumBytes10TensorDesc(ptr noundef nonnull byval(%struct.TensorDesc) align 8 %0)
  %15 = zext i32 %14 to i64
  tail call void @_Z10UNI_MEMCPYPvPKvm(ptr noundef %3, ptr noundef %1, i64 noundef %15)
  br label %57

16:                                               ; preds = %9
  %17 = getelementptr inbounds i8, ptr %0, i64 4
  %18 = load i32, ptr %17, align 4
  switch i32 %18, label %27 [
    i32 15, label %19
    i32 14, label %19
    i32 0, label %19
    i32 24, label %21
    i32 2, label %23
    i32 41, label %25
  ]

19:                                               ; preds = %16, %16, %16
  %20 = tail call noundef i32 @_Z21transformNCHWToNCHWC810TensorDescPKvS_Pv(ptr noundef nonnull byval(%struct.TensorDesc) align 8 %0, ptr noundef %1, ptr noundef nonnull byval(%struct.TensorDesc) align 8 %2, ptr noundef %3)
  br label %57

21:                                               ; preds = %16
  %22 = tail call noundef i32 @_Z21transformNHWCToNCHWC810TensorDescPKvS_Pv(ptr noundef nonnull byval(%struct.TensorDesc) align 8 %0, ptr noundef %1, ptr noundef nonnull byval(%struct.TensorDesc) align 8 %2, ptr noundef %3)
  br label %57

23:                                               ; preds = %16
  %24 = tail call noundef i32 @_Z30transformNCHWC8ToNCHWC8ByGroup10TensorDescPKviS_Pv(ptr noundef nonnull byval(%struct.TensorDesc) align 8 %0, ptr noundef %1, i32 noundef 1, ptr noundef nonnull byval(%struct.TensorDesc) align 8 %2, ptr noundef %3)
  br label %57

25:                                               ; preds = %16
  %26 = tail call noundef i32 @_Z24transformNCHWC16ToNCHWC810TensorDescPKvS_Pv(ptr noundef nonnull byval(%struct.TensorDesc) align 8 %0, ptr noundef %1, ptr noundef nonnull byval(%struct.TensorDesc) align 8 %2, ptr noundef %3)
  br label %57

27:                                               ; preds = %16
  %28 = tail call i64 (i64, ...) @syscall(i64 noundef 186) #6
  %29 = trunc i64 %28 to i32
  %30 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %29)
  %31 = load ptr, ptr @stdout, align 8, !tbaa !12
  %32 = tail call i32 @fflush(ptr noundef %31)
  %33 = tail call noundef ptr @_Z14DataFormatNamev()
  %34 = zext i32 %18 to i64
  %35 = getelementptr inbounds ptr, ptr %33, i64 %34
  %36 = load ptr, ptr %35, align 8, !tbaa !12
  %37 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, ptr noundef %36)
  %38 = load ptr, ptr @stdout, align 8, !tbaa !12
  %39 = tail call i32 @fflush(ptr noundef %38)
  tail call void @exit(i32 noundef 1) #7
  unreachable

40:                                               ; preds = %4
  %41 = tail call noundef i32 @_Z18transformToNCHWC1610TensorDescPKvS_Pv(ptr noundef nonnull byval(%struct.TensorDesc) align 8 %0, ptr noundef %1, ptr noundef nonnull byval(%struct.TensorDesc) align 8 %2, ptr noundef %3)
  br label %57

42:                                               ; preds = %4
  %43 = tail call noundef i32 @_Z15transformToNHWC10TensorDescPKvS_Pv(ptr noundef nonnull byval(%struct.TensorDesc) align 8 %0, ptr noundef %1, ptr noundef nonnull byval(%struct.TensorDesc) align 8 %2, ptr noundef %3)
  br label %57

44:                                               ; preds = %4
  %45 = tail call i64 (i64, ...) @syscall(i64 noundef 186) #6
  %46 = trunc i64 %45 to i32
  %47 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %46)
  %48 = load ptr, ptr @stdout, align 8, !tbaa !12
  %49 = tail call i32 @fflush(ptr noundef %48)
  %50 = tail call noundef ptr @_Z14DataFormatNamev()
  %51 = zext i32 %6 to i64
  %52 = getelementptr inbounds ptr, ptr %50, i64 %51
  %53 = load ptr, ptr %52, align 8, !tbaa !12
  %54 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, ptr noundef %53)
  %55 = load ptr, ptr @stdout, align 8, !tbaa !12
  %56 = tail call i32 @fflush(ptr noundef %55)
  tail call void @exit(i32 noundef 1) #7
  unreachable

57:                                               ; preds = %19, %23, %25, %21, %13, %42, %40, %7
  %.0 = phi i32 [ %8, %7 ], [ 0, %13 ], [ %20, %19 ], [ %22, %21 ], [ %24, %23 ], [ %26, %25 ], [ %41, %40 ], [ %43, %42 ]
  ret i32 %.0
}

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

attributes #0 = { 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 #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 = { 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 #4 = { 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 #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 = { 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, !11, i64 8}
!6 = !{!"_ZTS10TensorDesc", !7, i64 0, !10, i64 4, !11, i64 8, !8, i64 12}
!7 = !{!"_ZTS8DataType", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"_ZTS10DataFormat", !8, i64 0}
!11 = !{!"int", !8, i64 0}
!12 = !{!13, !13, i64 0}
!13 = !{!"any pointer", !8, i64 0}


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