; LLVM IR from huawei-noah/bolt :: common/uni/src/tensor_transpose.ll (Z24transformNCHWC16ToNCHWC810TensorDescPKvS_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.1 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.2 = 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: 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: inlinehint mustprogress nounwind uwtable
declare dso_local ptr @ee2str(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
define dso_local noundef i32 @_Z24transformNCHWC16ToNCHWC810TensorDescPKvS_Pv(ptr noundef byval(%struct.TensorDesc) align 8 %0, ptr noundef %1, ptr noundef byval(%struct.TensorDesc) align 8 %2, ptr noundef %3) #7 {
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, 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 i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  %22 = alloca %struct.TensorDesc, align 8
  %23 = alloca %struct.TensorDesc, align 8
  %24 = alloca i32, align 4
  %25 = alloca %struct.TensorDesc, align 8
  %26 = alloca i32, align 4
  %27 = alloca %struct.TensorDesc, align 8
  %28 = alloca i32, align 4
  %29 = alloca i32, align 4
  %30 = alloca %struct.TensorDesc, align 8
  %31 = alloca i32, align 4
  %32 = alloca i32, align 4
  %33 = alloca %struct.TensorDesc, align 8
  %34 = alloca i32, align 4
  %35 = alloca i32, align 4
  %36 = alloca %struct.TensorDesc, align 8
  %37 = alloca i32, align 4
  %38 = alloca i32, align 4
  %39 = alloca i32, align 4
  %40 = alloca ptr, align 8
  %41 = alloca ptr, align 8
  %42 = alloca i32, align 4
  %43 = alloca i32, align 4
  %44 = alloca i32, align 4
  %45 = alloca i32, align 4
  %46 = alloca i32, align 4
  %47 = alloca i32, align 4
  %48 = alloca i32, align 4
  %49 = alloca i32, align 4
  store ptr %1, ptr %6, align 8, !tbaa !5
  store ptr %3, ptr %7, align 8, !tbaa !5
  %50 = load ptr, ptr %6, align 8, !tbaa !5
  %51 = icmp eq ptr %50, null
  br i1 %51, label %55, label %52

52:                                               ; preds = %4
  %53 = load ptr, ptr %7, align 8, !tbaa !5
  %54 = icmp eq ptr %53, null
  br i1 %54, label %55, label %71

55:                                               ; preds = %52, %4
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #8
  store i32 1, ptr %8, align 4, !tbaa !9
  %56 = load i32, ptr %8, align 4, !tbaa !9
  %57 = icmp ne i32 %56, 0
  br i1 %57, label %58, label %70

58:                                               ; preds = %55
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #8
  %59 = call i64 (i64, ...) @syscall(i64 noundef 186) #8
  %60 = trunc i64 %59 to i32
  store i32 %60, ptr %9, align 4, !tbaa !11
  %61 = load i32, ptr %9, align 4, !tbaa !11
  %62 = call i32 (ptr, ...) @printf(ptr noundef @.str, i32 noundef %61)
  %63 = load ptr, ptr @stdout, align 8, !tbaa !5
  %64 = call i32 @fflush(ptr noundef %63)
  %65 = load i32, ptr %8, align 4, !tbaa !9
  %66 = call ptr @ee2str(i32 noundef %65)
  %67 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, ptr noundef %66)
  %68 = load ptr, ptr @stdout, align 8, !tbaa !5
  %69 = call i32 @fflush(ptr noundef %68)
  call void @exit(i32 noundef 1) #9
  unreachable

70:                                               ; preds = %55
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #8
  br label %71

71:                                               ; preds = %70, %52
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %22, ptr align 8 %0, i64 92, i1 false), !tbaa.struct !13
  %72 = call noundef zeroext i8 @_Z10tensorIs2d10TensorDesc(ptr noundef byval(%struct.TensorDesc) align 8 %22)
  %73 = icmp ne i8 %72, 0
  br i1 %73, label %74, label %84

74:                                               ; preds = %71
  %75 = load ptr, ptr %6, align 8, !tbaa !5
  %76 = load ptr, ptr %7, align 8, !tbaa !5
  %77 = icmp ne ptr %75, %76
  br i1 %77, label %78, label %83

78:                                               ; preds = %74
  %79 = load ptr, ptr %7, align 8, !tbaa !5
  %80 = load ptr, ptr %6, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %23, ptr align 8 %0, i64 92, i1 false), !tbaa.struct !13
  %81 = call noundef i32 @_Z14tensorNumBytes10TensorDesc(ptr noundef byval(%struct.TensorDesc) align 8 %23)
  %82 = zext i32 %81 to i64
  call void @_Z10UNI_MEMCPYPvPKvm(ptr noundef %79, ptr noundef %80, i64 noundef %82)
  br label %83

83:                                               ; preds = %78, %74
  store i32 0, ptr %5, align 4
  store i32 1, ptr %24, align 4
  br label %329

84:                                               ; preds = %71
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %25, ptr align 8 %0, i64 92, i1 false), !tbaa.struct !13
  %85 = call noundef zeroext i8 @_Z10tensorIs3d10TensorDesc(ptr noundef byval(%struct.TensorDesc) align 8 %25)
  %86 = icmp ne i8 %85, 0
  br i1 %86, label %87, label %120

87:                                               ; preds = %84
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %27, ptr align 8 %0, i64 92, i1 false), !tbaa.struct !13
  %88 = call noundef i32 @_Z11tensor3dGet10TensorDescP8DataTypeP10DataFormatPjS4_S4_(ptr noundef byval(%struct.TensorDesc) align 8 %27, ptr noundef %10, ptr noundef %12, ptr noundef %14, ptr noundef %15, ptr noundef %16)
  store i32 %88, ptr %26, align 4, !tbaa !9
  %89 = load i32, ptr %26, align 4, !tbaa !9
  %90 = icmp ne i32 %89, 0
  br i1 %90, label %91, label %103

91:                                               ; preds = %87
  call void @llvm.lifetime.start.p0(i64 4, ptr %28) #8
  %92 = call i64 (i64, ...) @syscall(i64 noundef 186) #8
  %93 = trunc i64 %92 to i32
  store i32 %93, ptr %28, align 4, !tbaa !11
  %94 = load i32, ptr %28, align 4, !tbaa !11
  %95 = call i32 (ptr, ...) @printf(ptr noundef @.str, i32 noundef %94)
  %96 = load ptr, ptr @stdout, align 8, !tbaa !5
  %97 = call i32 @fflush(ptr noundef %96)
  %98 = load i32, ptr %26, align 4, !tbaa !9
  %99 = call ptr @ee2str(i32 noundef %98)
  %100 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, ptr noundef %99)
  %101 = load ptr, ptr @stdout, align 8, !tbaa !5
  %102 = call i32 @fflush(ptr noundef %101)
  call void @exit(i32 noundef 1) #9
  unreachable

103:                                              ; preds = %87
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %29) #8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %30, ptr align 8 %2, i64 92, i1 false), !tbaa.struct !13
  %104 = call noundef i32 @_Z11tensor3dGet10TensorDescP8DataTypeP10DataFormatPjS4_S4_(ptr noundef byval(%struct.TensorDesc) align 8 %30, ptr noundef %11, ptr noundef %13, ptr noundef %18, ptr noundef %19, ptr noundef %20)
  store i32 %104, ptr %29, align 4, !tbaa !9
  %105 = load i32, ptr %29, align 4, !tbaa !9
  %106 = icmp ne i32 %105, 0
  br i1 %106, label %107, label %119

107:                                              ; preds = %103
  call void @llvm.lifetime.start.p0(i64 4, ptr %31) #8
  %108 = call i64 (i64, ...) @syscall(i64 noundef 186) #8
  %109 = trunc i64 %108 to i32
  store i32 %109, ptr %31, align 4, !tbaa !11
  %110 = load i32, ptr %31, align 4, !tbaa !11
  %111 = call i32 (ptr, ...) @printf(ptr noundef @.str, i32 noundef %110)
  %112 = load ptr, ptr @stdout, align 8, !tbaa !5
  %113 = call i32 @fflush(ptr noundef %112)
  %114 = load i32, ptr %29, align 4, !tbaa !9
  %115 = call ptr @ee2str(i32 noundef %114)
  %116 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, ptr noundef %115)
  %117 = load ptr, ptr @stdout, align 8, !tbaa !5
  %118 = call i32 @fflush(ptr noundef %117)
  call void @exit(i32 noundef 1) #9
  unreachable

119:                                              ; preds = %103
  call void @llvm.lifetime.end.p0(i64 4, ptr %29) #8
  store i32 1, ptr %21, align 4, !tbaa !11
  store i32 1, ptr %17, align 4, !tbaa !11
  br label %153

120:                                              ; preds = %84
  call void @llvm.lifetime.start.p0(i64 4, ptr %32) #8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %33, ptr align 8 %0, i64 92, i1 false), !tbaa.struct !13
  %121 = call noundef i32 @_Z11tensor4dGet10TensorDescP8DataTypeP10DataFormatPjS4_S4_S4_(ptr noundef byval(%struct.TensorDesc) align 8 %33, ptr noundef %10, ptr noundef %12, ptr noundef %14, ptr noundef %15, ptr noundef %16, ptr noundef %17)
  store i32 %121, ptr %32, align 4, !tbaa !9
  %122 = load i32, ptr %32, align 4, !tbaa !9
  %123 = icmp ne i32 %122, 0
  br i1 %123, label %124, label %136

124:                                              ; preds = %120
  call void @llvm.lifetime.start.p0(i64 4, ptr %34) #8
  %125 = call i64 (i64, ...) @syscall(i64 noundef 186) #8
  %126 = trunc i64 %125 to i32
  store i32 %126, ptr %34, align 4, !tbaa !11
  %127 = load i32, ptr %34, align 4, !tbaa !11
  %128 = call i32 (ptr, ...) @printf(ptr noundef @.str, i32 noundef %127)
  %129 = load ptr, ptr @stdout, align 8, !tbaa !5
  %130 = call i32 @fflush(ptr noundef %129)
  %131 = load i32, ptr %32, align 4, !tbaa !9
  %132 = call ptr @ee2str(i32 noundef %131)
  %133 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, ptr noundef %132)
  %134 = load ptr, ptr @stdout, align 8, !tbaa !5
  %135 = call i32 @fflush(ptr noundef %134)
  call void @exit(i32 noundef 1) #9
  unreachable

136:                                              ; preds = %120
  call void @llvm.lifetime.end.p0(i64 4, ptr %32) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %35) #8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %36, ptr align 8 %2, i64 92, i1 false), !tbaa.struct !13
  %137 = call noundef i32 @_Z11tensor4dGet10TensorDescP8DataTypeP10DataFormatPjS4_S4_S4_(ptr noundef byval(%struct.TensorDesc) align 8 %36, ptr noundef %11, ptr noundef %13, ptr noundef %18, ptr noundef %19, ptr noundef %20, ptr noundef %21)
  store i32 %137, ptr %35, align 4, !tbaa !9
  %138 = load i32, ptr %35, align 4, !tbaa !9
  %139 = icmp ne i32 %138, 0
  br i1 %139, label %140, label %152

140:                                              ; preds = %136
  call void @llvm.lifetime.start.p0(i64 4, ptr %37) #8
  %141 = call i64 (i64, ...) @syscall(i64 noundef 186) #8
  %142 = trunc i64 %141 to i32
  store i32 %142, ptr %37, align 4, !tbaa !11
  %143 = load i32, ptr %37, align 4, !tbaa !11
  %144 = call i32 (ptr, ...) @printf(ptr noundef @.str, i32 noundef %143)
  %145 = load ptr, ptr @stdout, align 8, !tbaa !5
  %146 = call i32 @fflush(ptr noundef %145)
  %147 = load i32, ptr %35, align 4, !tbaa !9
  %148 = call ptr @ee2str(i32 noundef %147)
  %149 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, ptr noundef %148)
  %150 = load ptr, ptr @stdout, align 8, !tbaa !5
  %151 = call i32 @fflush(ptr noundef %150)
  call void @exit(i32 noundef 1) #9
  unreachable

152:                                              ; preds = %136
  call void @llvm.lifetime.end.p0(i64 4, ptr %35) #8
  br label %153

153:                                              ; preds = %152, %119
  br label %154

154:                                              ; preds = %153
  %155 = load i32, ptr %14, align 4, !tbaa !11
  %156 = load i32, ptr %18, align 4, !tbaa !11
  %157 = icmp eq i32 %155, %156
  br i1 %157, label %158, label %168

158:                                              ; preds = %154
  %159 = load i32, ptr %12, align 4, !tbaa !16
  %160 = icmp eq i32 %159, 41
  br i1 %160, label %161, label %168

161:                                              ; preds = %158
  %162 = load i32, ptr %13, align 4, !tbaa !16
  %163 = icmp eq i32 %162, 2
  br i1 %163, label %164, label %168

164:                                              ; preds = %161
  %165 = load i32, ptr %10, align 4, !tbaa !14
  %166 = load i32, ptr %11, align 4, !tbaa !14
  %167 = icmp eq i32 %165, %166
  br i1 %167, label %178, label %168

168:                                              ; preds = %164, %161, %158, %154
  call void @llvm.lifetime.start.p0(i64 4, ptr %38) #8
  %169 = call i64 (i64, ...) @syscall(i64 noundef 186) #8
  %170 = trunc i64 %169 to i32
  store i32 %170, ptr %38, align 4, !tbaa !11
  %171 = load i32, ptr %38, align 4, !tbaa !11
  %172 = call i32 (ptr, ...) @printf(ptr noundef @.str, i32 noundef %171)
  %173 = load ptr, ptr @stdout, align 8, !tbaa !5
  %174 = call i32 @fflush(ptr noundef %173)
  %175 = call i32 (ptr, ...) @printf(ptr noundef @.str.1)
  %176 = load ptr, ptr @stdout, align 8, !tbaa !5
  %177 = call i32 @fflush(ptr noundef %176)
  call void @exit(i32 noundef 1) #9
  unreachable

178:                                              ; preds = %164
  call void @llvm.lifetime.start.p0(i64 4, ptr %39) #8
  %179 = load i32, ptr %10, align 4, !tbaa !14
  %180 = call noundef i32 @_Z7bytesOf8DataType(i32 noundef %179)
  store i32 %180, ptr %39, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %40) #8
  %181 = load ptr, ptr %6, align 8, !tbaa !5
  store ptr %181, ptr %40, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %41) #8
  %182 = load ptr, ptr %7, align 8, !tbaa !5
  store ptr %182, ptr %41, align 8, !tbaa !5
  %183 = load i32, ptr %19, align 4, !tbaa !11
  %184 = udiv i32 %183, 8
  store i32 %184, ptr %19, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %42) #8
  store i32 0, ptr %42, align 4, !tbaa !11
  br label %185

185:                                              ; preds = %325, %178
  %186 = load i32, ptr %42, align 4, !tbaa !11
  %187 = load i32, ptr %18, align 4, !tbaa !11
  %188 = icmp ult i32 %186, %187
  br i1 %188, label %189, label %193

189:                                              ; preds = %185
  %190 = load i32, ptr %42, align 4, !tbaa !11
  %191 = load i32, ptr %14, align 4, !tbaa !11
  %192 = icmp ult i32 %190, %191
  br label %193

193:                                              ; preds = %189, %185
  %194 = phi i1 [ false, %185 ], [ %192, %189 ]
  br i1 %194, label %196, label %195

195:                                              ; preds = %193
  store i32 2, ptr %24, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %42) #8
  br label %328

196:                                              ; preds = %193
  call void @llvm.lifetime.start.p0(i64 4, ptr %43) #8
  store i32 0, ptr %43, align 4, !tbaa !11
  br label %197

197:                                              ; preds = %321, %196
  %198 = load i32, ptr %43, align 4, !tbaa !11
  %199 = load i32, ptr %19, align 4, !tbaa !11
  %200 = icmp ult i32 %198, %199
  br i1 %200, label %202, label %201

201:                                              ; preds = %197
  store i32 5, ptr %24, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %43) #8
  br label %324

202:                                              ; preds = %197
  call void @llvm.lifetime.start.p0(i64 4, ptr %44) #8
  %203 = load i32, ptr %43, align 4, !tbaa !11
  %204 = add i32 %203, 2
  %205 = load i32, ptr %19, align 4, !tbaa !11
  %206 = icmp ule i32 %204, %205
  %207 = zext i1 %206 to i64
  %208 = select i1 %206, i32 16, i32 8
  store i32 %208, ptr %44, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %45) #8
  store i32 0, ptr %45, align 4, !tbaa !11
  br label %209

209:                                              ; preds = %317, %202
  %210 = load i32, ptr %45, align 4, !tbaa !11
  %211 = load i32, ptr %20, align 4, !tbaa !11
  %212 = icmp ult i32 %210, %211
  br i1 %212, label %213, label %217

213:                                              ; preds = %209
  %214 = load i32, ptr %45, align 4, !tbaa !11
  %215 = load i32, ptr %16, align 4, !tbaa !11
  %216 = icmp ult i32 %214, %215
  br label %217

217:                                              ; preds = %213, %209
  %218 = phi i1 [ false, %209 ], [ %216, %213 ]
  br i1 %218, label %220, label %219

219:                                              ; preds = %217
  store i32 8, ptr %24, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %45) #8
  br label %320

220:                                              ; preds = %217
  call void @llvm.lifetime.start.p0(i64 4, ptr %46) #8
  store i32 0, ptr %46, align 4, !tbaa !11
  br label %221

221:                                              ; preds = %313, %220
  %222 = load i32, ptr %46, align 4, !tbaa !11
  %223 = load i32, ptr %21, align 4, !tbaa !11
  %224 = icmp ult i32 %222, %223
  br i1 %224, label %225, label %229

225:                                              ; preds = %221
  %226 = load i32, ptr %46, align 4, !tbaa !11
  %227 = load i32, ptr %17, align 4, !tbaa !11
  %228 = icmp ult i32 %226, %227
  br label %229

229:                                              ; preds = %225, %221
  %230 = phi i1 [ false, %221 ], [ %228, %225 ]
  br i1 %230, label %232, label %231

231:                                              ; preds = %229
  store i32 11, ptr %24, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %46) #8
  br label %316

232:                                              ; preds = %229
  call void @llvm.lifetime.start.p0(i64 4, ptr %47) #8
  store i32 0, ptr %47, align 4, !tbaa !11
  br label %233

233:                                              ; preds = %309, %232
  %234 = load i32, ptr %47, align 4, !tbaa !11
  %235 = icmp ult i32 %234, 2
  br i1 %235, label %236, label %242

236:                                              ; preds = %233
  %237 = load i32, ptr %47, align 4, !tbaa !11
  %238 = load i32, ptr %43, align 4, !tbaa !11
  %239 = add i32 %237, %238
  %240 = load i32, ptr %19, align 4, !tbaa !11
  %241 = icmp ult i32 %239, %240
  br label %242

242:                                              ; preds = %236, %233
  %243 = phi i1 [ false, %233 ], [ %241, %236 ]
  br i1 %243, label %245, label %244

244:                                              ; preds = %242
  store i32 14, ptr %24, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %47) #8
  br label %312

245:                                              ; preds = %242
  call void @llvm.lifetime.start.p0(i64 4, ptr %48) #8
  %246 = load i32, ptr %42, align 4, !tbaa !11
  %247 = load i32, ptr %15, align 4, !tbaa !11
  %248 = mul i32 %246, %247
  %249 = load i32, ptr %16, align 4, !tbaa !11
  %250 = mul i32 %248, %249
  %251 = load i32, ptr %17, align 4, !tbaa !11
  %252 = mul i32 %250, %251
  %253 = load i32, ptr %43, align 4, !tbaa !11
  %254 = load i32, ptr %16, align 4, !tbaa !11
  %255 = mul i32 %253, %254
  %256 = load i32, ptr %17, align 4, !tbaa !11
  %257 = mul i32 %255, %256
  %258 = mul i32 %257, 8
  %259 = add i32 %252, %258
  %260 = load i32, ptr %45, align 4, !tbaa !11
  %261 = load i32, ptr %17, align 4, !tbaa !11
  %262 = mul i32 %260, %261
  %263 = load i32, ptr %46, align 4, !tbaa !11
  %264 = add i32 %262, %263
  %265 = load i32, ptr %44, align 4, !tbaa !11
  %266 = mul i32 %264, %265
  %267 = add i32 %259, %266
  %268 = load i32, ptr %47, align 4, !tbaa !11
  %269 = mul i32 %268, 8
  %270 = add i32 %267, %269
  store i32 %270, ptr %48, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %49) #8
  %271 = load i32, ptr %42, align 4, !tbaa !11
  %272 = load i32, ptr %15, align 4, !tbaa !11
  %273 = mul i32 %271, %272
  %274 = load i32, ptr %16, align 4, !tbaa !11
  %275 = mul i32 %273, %274
  %276 = load i32, ptr %17, align 4, !tbaa !11
  %277 = mul i32 %275, %276
  %278 = load i32, ptr %43, align 4, !tbaa !11
  %279 = load i32, ptr %47, align 4, !tbaa !11
  %280 = add i32 %278, %279
  %281 = load i32, ptr %16, align 4, !tbaa !11
  %282 = mul i32 %280, %281
  %283 = load i32, ptr %17, align 4, !tbaa !11
  %284 = mul i32 %282, %283
  %285 = mul i32 %284, 8
  %286 = add i32 %277, %285
  %287 = load i32, ptr %45, align 4, !tbaa !11
  %288 = load i32, ptr %17, align 4, !tbaa !11
  %289 = mul i32 %287, %288
  %290 = load i32, ptr %46, align 4, !tbaa !11
  %291 = add i32 %289, %290
  %292 = mul i32 %291, 8
  %293 = add i32 %286, %292
  store i32 %293, ptr %49, align 4, !tbaa !11
  %294 = load ptr, ptr %41, align 8, !tbaa !5
  %295 = load i32, ptr %49, align 4, !tbaa !11
  %296 = load i32, ptr %39, align 4, !tbaa !11
  %297 = mul i32 %295, %296
  %298 = zext i32 %297 to i64
  %299 = getelementptr inbounds i8, ptr %294, i64 %298
  %300 = load ptr, ptr %40, align 8, !tbaa !5
  %301 = load i32, ptr %48, align 4, !tbaa !11
  %302 = load i32, ptr %39, align 4, !tbaa !11
  %303 = mul i32 %301, %302
  %304 = zext i32 %303 to i64
  %305 = getelementptr inbounds i8, ptr %300, i64 %304
  %306 = load i32, ptr %39, align 4, !tbaa !11
  %307 = mul nsw i32 %306, 8
  %308 = sext i32 %307 to i64
  call void @_Z10UNI_MEMCPYPvPKvm(ptr noundef %299, ptr noundef %305, i64 noundef %308)
  call void @llvm.lifetime.end.p0(i64 4, ptr %49) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %48) #8
  br label %309

309:                                              ; preds = %245
  %310 = load i32, ptr %47, align 4, !tbaa !11
  %311 = add i32 %310, 1
  store i32 %311, ptr %47, align 4, !tbaa !11
  br label %233, !llvm.loop !19

312:                                              ; preds = %244
  br label %313

313:                                              ; preds = %312
  %314 = load i32, ptr %46, align 4, !tbaa !11
  %315 = add i32 %314, 1
  store i32 %315, ptr %46, align 4, !tbaa !11
  br label %221, !llvm.loop !21

316:                                              ; preds = %231
  br label %317

317:                                              ; preds = %316
  %318 = load i32, ptr %45, align 4, !tbaa !11
  %319 = add i32 %318, 1
  store i32 %319, ptr %45, align 4, !tbaa !11
  br label %209, !llvm.loop !22

320:                                              ; preds = %219
  call void @llvm.lifetime.end.p0(i64 4, ptr %44) #8
  br label %321

321:                                              ; preds = %320
  %322 = load i32, ptr %43, align 4, !tbaa !11
  %323 = add i32 %322, 2
  store i32 %323, ptr %43, align 4, !tbaa !11
  br label %197, !llvm.loop !23

324:                                              ; preds = %201
  br label %325

325:                                              ; preds = %324
  %326 = load i32, ptr %42, align 4, !tbaa !11
  %327 = add i32 %326, 1
  store i32 %327, ptr %42, align 4, !tbaa !11
  br label %185, !llvm.loop !24

328:                                              ; preds = %195
  store i32 0, ptr %5, align 4
  store i32 1, ptr %24, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %41) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %40) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %39) #8
  br label %329

329:                                              ; preds = %328, %83
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #8
  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 4, ptr %15) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #8
  %330 = load i32, ptr %5, align 4
  ret i32 %330
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i8 @_Z10tensorIs2d10TensorDesc(ptr noundef byval(%struct.TensorDesc) align 8) #5

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i8 @_Z10tensorIs3d10TensorDesc(ptr noundef byval(%struct.TensorDesc) align 8) #5

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i32 @_Z7bytesOf8DataType(i32 noundef) #1

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 = { 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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #7 = { 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 #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 = !{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 = distinct !{!19, !20}
!20 = !{!"llvm.loop.mustprogress"}
!21 = distinct !{!21, !20}
!22 = distinct !{!22, !20}
!23 = distinct !{!23, !20}
!24 = distinct !{!24, !20}


; 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 [23 x i8], align 1
@.str.2 = 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 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) local_unnamed_addr #1

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_Z24transformNCHWC16ToNCHWC810TensorDescPKvS_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 #6 {
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, 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 i32, align 4
  %16 = alloca i32, align 4
  %17 = icmp eq ptr %1, null
  %18 = icmp eq ptr %3, null
  %or.cond = or i1 %17, %18
  br i1 %or.cond, label %19, label %29

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

29:                                               ; preds = %4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %9) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %10) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %11) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %12) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %13) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %14) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %15) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %16) #7
  %30 = tail call noundef zeroext i8 @_Z10tensorIs2d10TensorDesc(ptr noundef nonnull byval(%struct.TensorDesc) align 8 %0)
  %.not = icmp eq i8 %30, 0
  br i1 %.not, label %35, label %31

31:                                               ; preds = %29
  %.not82 = icmp eq ptr %1, %3
  br i1 %.not82, label %.loopexit87, label %32

32:                                               ; preds = %31
  %33 = tail call noundef i32 @_Z14tensorNumBytes10TensorDesc(ptr noundef nonnull byval(%struct.TensorDesc) align 8 %0)
  %34 = zext i32 %33 to i64
  tail call void @_Z10UNI_MEMCPYPvPKvm(ptr noundef nonnull %3, ptr noundef nonnull %1, i64 noundef %34)
  br label %.loopexit87

35:                                               ; preds = %29
  %36 = tail call noundef zeroext i8 @_Z10tensorIs3d10TensorDesc(ptr noundef nonnull byval(%struct.TensorDesc) align 8 %0)
  %.not76 = icmp eq i8 %36, 0
  br i1 %.not76, label %62, label %37

37:                                               ; preds = %35
  %38 = call noundef i32 @_Z11tensor3dGet10TensorDescP8DataTypeP10DataFormatPjS4_S4_(ptr noundef nonnull byval(%struct.TensorDesc) align 8 %0, ptr noundef nonnull %5, ptr noundef nonnull %7, ptr noundef nonnull %9, ptr noundef nonnull %10, ptr noundef nonnull %11)
  %.not79 = icmp eq i32 %38, 0
  br i1 %.not79, label %49, label %39

39:                                               ; preds = %37
  %40 = call i64 (i64, ...) @syscall(i64 noundef 186) #7
  %41 = trunc i64 %40 to i32
  %42 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %41)
  %43 = load ptr, ptr @stdout, align 8, !tbaa !5
  %44 = call i32 @fflush(ptr noundef %43)
  %45 = call ptr @ee2str(i32 noundef %38)
  %46 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, ptr noundef %45)
  %47 = load ptr, ptr @stdout, align 8, !tbaa !5
  %48 = call i32 @fflush(ptr noundef %47)
  call void @exit(i32 noundef 1) #8
  unreachable

49:                                               ; preds = %37
  %50 = call noundef i32 @_Z11tensor3dGet10TensorDescP8DataTypeP10DataFormatPjS4_S4_(ptr noundef nonnull byval(%struct.TensorDesc) align 8 %2, ptr noundef nonnull %6, ptr noundef nonnull %8, ptr noundef nonnull %13, ptr noundef nonnull %14, ptr noundef nonnull %15)
  %.not80 = icmp eq i32 %50, 0
  br i1 %.not80, label %61, label %51

51:                                               ; preds = %49
  %52 = call i64 (i64, ...) @syscall(i64 noundef 186) #7
  %53 = trunc i64 %52 to i32
  %54 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %53)
  %55 = load ptr, ptr @stdout, align 8, !tbaa !5
  %56 = call i32 @fflush(ptr noundef %55)
  %57 = call ptr @ee2str(i32 noundef %50)
  %58 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, ptr noundef %57)
  %59 = load ptr, ptr @stdout, align 8, !tbaa !5
  %60 = call i32 @fflush(ptr noundef %59)
  call void @exit(i32 noundef 1) #8
  unreachable

61:                                               ; preds = %49
  store i32 1, ptr %16, align 4, !tbaa !9
  store i32 1, ptr %12, align 4, !tbaa !9
  br label %86

62:                                               ; preds = %35
  %63 = call noundef i32 @_Z11tensor4dGet10TensorDescP8DataTypeP10DataFormatPjS4_S4_S4_(ptr noundef nonnull byval(%struct.TensorDesc) align 8 %0, ptr noundef nonnull %5, ptr noundef nonnull %7, ptr noundef nonnull %9, ptr noundef nonnull %10, ptr noundef nonnull %11, ptr noundef nonnull %12)
  %.not77 = icmp eq i32 %63, 0
  br i1 %.not77, label %74, label %64

64:                                               ; preds = %62
  %65 = call i64 (i64, ...) @syscall(i64 noundef 186) #7
  %66 = trunc i64 %65 to i32
  %67 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %66)
  %68 = load ptr, ptr @stdout, align 8, !tbaa !5
  %69 = call i32 @fflush(ptr noundef %68)
  %70 = call ptr @ee2str(i32 noundef %63)
  %71 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, ptr noundef %70)
  %72 = load ptr, ptr @stdout, align 8, !tbaa !5
  %73 = call i32 @fflush(ptr noundef %72)
  call void @exit(i32 noundef 1) #8
  unreachable

74:                                               ; preds = %62
  %75 = call noundef i32 @_Z11tensor4dGet10TensorDescP8DataTypeP10DataFormatPjS4_S4_S4_(ptr noundef nonnull byval(%struct.TensorDesc) align 8 %2, ptr noundef nonnull %6, ptr noundef nonnull %8, ptr noundef nonnull %13, ptr noundef nonnull %14, ptr noundef nonnull %15, ptr noundef nonnull %16)
  %.not78 = icmp eq i32 %75, 0
  br i1 %.not78, label %86, label %76

76:                                               ; preds = %74
  %77 = call i64 (i64, ...) @syscall(i64 noundef 186) #7
  %78 = trunc i64 %77 to i32
  %79 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %78)
  %80 = load ptr, ptr @stdout, align 8, !tbaa !5
  %81 = call i32 @fflush(ptr noundef %80)
  %82 = call ptr @ee2str(i32 noundef %75)
  %83 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, ptr noundef %82)
  %84 = load ptr, ptr @stdout, align 8, !tbaa !5
  %85 = call i32 @fflush(ptr noundef %84)
  call void @exit(i32 noundef 1) #8
  unreachable

86:                                               ; preds = %74, %61
  %87 = load i32, ptr %9, align 4, !tbaa !9
  %88 = load i32, ptr %13, align 4, !tbaa !9
  %89 = icmp eq i32 %87, %88
  %90 = load i32, ptr %7, align 4
  %91 = icmp eq i32 %90, 41
  %or.cond3 = select i1 %89, i1 %91, i1 false
  %92 = load i32, ptr %8, align 4
  %93 = icmp eq i32 %92, 2
  %or.cond5 = select i1 %or.cond3, i1 %93, i1 false
  br i1 %or.cond5, label %94, label %98

94:                                               ; preds = %86
  %95 = load i32, ptr %5, align 4, !tbaa !11
  %96 = load i32, ptr %6, align 4, !tbaa !11
  %97 = icmp eq i32 %95, %96
  br i1 %97, label %107, label %98

98:                                               ; preds = %94, %86
  %99 = call i64 (i64, ...) @syscall(i64 noundef 186) #7
  %100 = trunc i64 %99 to i32
  %101 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %100)
  %102 = load ptr, ptr @stdout, align 8, !tbaa !5
  %103 = call i32 @fflush(ptr noundef %102)
  %104 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1)
  %105 = load ptr, ptr @stdout, align 8, !tbaa !5
  %106 = call i32 @fflush(ptr noundef %105)
  call void @exit(i32 noundef 1) #8
  unreachable

107:                                              ; preds = %94
  %108 = call noundef i32 @_Z7bytesOf8DataType(i32 noundef %95)
  %109 = load i32, ptr %14, align 4, !tbaa !9
  %110 = lshr i32 %109, 3
  store i32 %110, ptr %14, align 4, !tbaa !9
  %111 = load i32, ptr %13, align 4, !tbaa !9
  %112 = icmp ne i32 %111, 0
  %113 = load i32, ptr %9, align 4
  %114 = icmp ne i32 %113, 0
  %115 = select i1 %112, i1 %114, i1 false
  br i1 %115, label %.preheader86.lr.ph, label %.loopexit87

.preheader86.lr.ph:                               ; preds = %107
  %116 = shl nsw i32 %108, 3
  %117 = sext i32 %116 to i64
  %.not94 = icmp ult i32 %109, 8
  br i1 %.not94, label %.loopexit87, label %.preheader86

.preheader86:                                     ; preds = %.preheader86.lr.ph, %._crit_edge92
  %118 = phi i32 [ %128, %._crit_edge92 ], [ %113, %.preheader86.lr.ph ]
  %119 = phi i32 [ %129, %._crit_edge92 ], [ %111, %.preheader86.lr.ph ]
  %120 = phi i32 [ %130, %._crit_edge92 ], [ %110, %.preheader86.lr.ph ]
  %121 = phi i32 [ %131, %._crit_edge92 ], [ %110, %.preheader86.lr.ph ]
  %.06693 = phi i32 [ %132, %._crit_edge92 ], [ 0, %.preheader86.lr.ph ]
  %.not95 = icmp eq i32 %121, 0
  br i1 %.not95, label %._crit_edge92, label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %.preheader86
  %.pre = load i32, ptr %15, align 4, !tbaa !9
  %.pre97 = load i32, ptr %11, align 4
  br label %.lr.ph

.loopexit.loopexit:                               ; preds = %._crit_edge
  %.pre104 = load i32, ptr %14, align 4, !tbaa !9
  br label %.loopexit

.loopexit:                                        ; preds = %.loopexit.loopexit, %.lr.ph
  %122 = phi i32 [ %.pre104, %.loopexit.loopexit ], [ %136, %.lr.ph ]
  %123 = phi i32 [ %160, %.loopexit.loopexit ], [ %137, %.lr.ph ]
  %124 = phi i32 [ %161, %.loopexit.loopexit ], [ %138, %.lr.ph ]
  %125 = phi i32 [ %160, %.loopexit.loopexit ], [ %139, %.lr.ph ]
  %126 = phi i32 [ %161, %.loopexit.loopexit ], [ %140, %.lr.ph ]
  %127 = icmp ult i32 %142, %122
  br i1 %127, label %.lr.ph, label %._crit_edge92.loopexit, !llvm.loop !13

._crit_edge92.loopexit:                           ; preds = %.loopexit
  %.pre105 = load i32, ptr %13, align 4, !tbaa !9
  %.pre106 = load i32, ptr %9, align 4
  br label %._crit_edge92

._crit_edge92:                                    ; preds = %._crit_edge92.loopexit, %.preheader86
  %128 = phi i32 [ %.pre106, %._crit_edge92.loopexit ], [ %118, %.preheader86 ]
  %129 = phi i32 [ %.pre105, %._crit_edge92.loopexit ], [ %119, %.preheader86 ]
  %130 = phi i32 [ %122, %._crit_edge92.loopexit ], [ %120, %.preheader86 ]
  %131 = phi i32 [ %122, %._crit_edge92.loopexit ], [ 0, %.preheader86 ]
  %132 = add nuw i32 %.06693, 1
  %133 = icmp ult i32 %132, %129
  %134 = icmp ult i32 %132, %128
  %135 = select i1 %133, i1 %134, i1 false
  br i1 %135, label %.preheader86, label %.loopexit87, !llvm.loop !15

.lr.ph:                                           ; preds = %.lr.ph.preheader, %.loopexit
  %136 = phi i32 [ %122, %.loopexit ], [ %120, %.lr.ph.preheader ]
  %137 = phi i32 [ %123, %.loopexit ], [ %.pre97, %.lr.ph.preheader ]
  %138 = phi i32 [ %124, %.loopexit ], [ %.pre, %.lr.ph.preheader ]
  %139 = phi i32 [ %125, %.loopexit ], [ %.pre97, %.lr.ph.preheader ]
  %140 = phi i32 [ %126, %.loopexit ], [ %.pre, %.lr.ph.preheader ]
  %141 = phi i32 [ %122, %.loopexit ], [ %121, %.lr.ph.preheader ]
  %.06791 = phi i32 [ %142, %.loopexit ], [ 0, %.lr.ph.preheader ]
  %142 = add i32 %.06791, 2
  %143 = icmp ne i32 %140, 0
  %144 = icmp ne i32 %139, 0
  %145 = select i1 %143, i1 %144, i1 false
  br i1 %145, label %.preheader85.lr.ph, label %.loopexit

.preheader85.lr.ph:                               ; preds = %.lr.ph
  %.not81 = icmp ugt i32 %142, %141
  %146 = select i1 %.not81, i32 3, i32 4
  %.pre98 = load i32, ptr %16, align 4, !tbaa !9
  %.pre99 = load i32, ptr %12, align 4
  %147 = or disjoint i32 %.06791, 1
  br label %.preheader85

.preheader85:                                     ; preds = %.preheader85.lr.ph, %._crit_edge
  %148 = phi i32 [ %137, %.preheader85.lr.ph ], [ %160, %._crit_edge ]
  %149 = phi i32 [ %138, %.preheader85.lr.ph ], [ %161, %._crit_edge ]
  %150 = phi i32 [ %.pre99, %.preheader85.lr.ph ], [ %162, %._crit_edge ]
  %151 = phi i32 [ %.pre99, %.preheader85.lr.ph ], [ %163, %._crit_edge ]
  %152 = phi i32 [ %.pre98, %.preheader85.lr.ph ], [ %164, %._crit_edge ]
  %.06590 = phi i32 [ 0, %.preheader85.lr.ph ], [ %165, %._crit_edge ]
  %153 = icmp ne i32 %152, 0
  %154 = icmp ne i32 %151, 0
  %155 = select i1 %153, i1 %154, i1 false
  br i1 %155, label %.preheader, label %._crit_edge

.preheader:                                       ; preds = %.preheader85, %.critedge
  %156 = phi i32 [ %169, %.critedge ], [ %150, %.preheader85 ]
  %157 = phi i32 [ %169, %.critedge ], [ %151, %.preheader85 ]
  %.06489 = phi i32 [ %170, %.critedge ], [ 0, %.preheader85 ]
  %158 = load i32, ptr %14, align 4, !tbaa !9
  %159 = icmp ult i32 %.06791, %158
  br i1 %159, label %175, label %.critedge

._crit_edge.loopexit:                             ; preds = %.critedge
  %.pre102 = load i32, ptr %15, align 4, !tbaa !9
  %.pre103 = load i32, ptr %11, align 4
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %.preheader85
  %160 = phi i32 [ %.pre103, %._crit_edge.loopexit ], [ %148, %.preheader85 ]
  %161 = phi i32 [ %.pre102, %._crit_edge.loopexit ], [ %149, %.preheader85 ]
  %162 = phi i32 [ %169, %._crit_edge.loopexit ], [ %150, %.preheader85 ]
  %163 = phi i32 [ %169, %._crit_edge.loopexit ], [ %151, %.preheader85 ]
  %164 = phi i32 [ %171, %._crit_edge.loopexit ], [ %152, %.preheader85 ]
  %165 = add nuw i32 %.06590, 1
  %166 = icmp ult i32 %165, %161
  %167 = icmp ult i32 %165, %160
  %168 = select i1 %166, i1 %167, i1 false
  br i1 %168, label %.preheader85, label %.loopexit.loopexit, !llvm.loop !17

.critedge:                                        ; preds = %196, %175, %.preheader
  %169 = phi i32 [ %.pre100, %196 ], [ %.pre101, %175 ], [ %156, %.preheader ]
  %170 = add nuw i32 %.06489, 1
  %171 = load i32, ptr %16, align 4, !tbaa !9
  %172 = icmp ult i32 %170, %171
  %173 = icmp ult i32 %170, %169
  %174 = select i1 %172, i1 %173, i1 false
  br i1 %174, label %.preheader, label %._crit_edge.loopexit, !llvm.loop !18

175:                                              ; preds = %.preheader
  %176 = load i32, ptr %10, align 4, !tbaa !9
  %177 = load i32, ptr %11, align 4, !tbaa !9
  %178 = mul i32 %157, %177
  %179 = mul i32 %178, %.06693
  %180 = mul i32 %179, %176
  %181 = mul i32 %178, %.06791
  %182 = mul i32 %157, %.06590
  %183 = add i32 %182, %.06489
  %184 = shl i32 %183, %146
  %reass.mul = shl i32 %181, 3
  %185 = add i32 %184, %180
  %186 = add i32 %185, %reass.mul
  %reass.add83 = add i32 %183, %181
  %reass.mul84 = shl i32 %reass.add83, 3
  %187 = add i32 %reass.mul84, %180
  %188 = mul i32 %187, %108
  %189 = zext i32 %188 to i64
  %190 = getelementptr inbounds i8, ptr %3, i64 %189
  %191 = mul i32 %186, %108
  %192 = zext i32 %191 to i64
  %193 = getelementptr inbounds i8, ptr %1, i64 %192
  call void @_Z10UNI_MEMCPYPvPKvm(ptr noundef %190, ptr noundef %193, i64 noundef %117)
  %194 = load i32, ptr %14, align 4, !tbaa !9
  %195 = icmp ult i32 %147, %194
  %.pre101 = load i32, ptr %12, align 4
  br i1 %195, label %196, label %.critedge

196:                                              ; preds = %175
  %197 = load i32, ptr %10, align 4, !tbaa !9
  %198 = load i32, ptr %11, align 4, !tbaa !9
  %199 = mul i32 %.pre101, %198
  %200 = mul i32 %199, %.06693
  %201 = mul i32 %200, %197
  %202 = mul i32 %199, %.06791
  %203 = mul i32 %.pre101, %.06590
  %204 = add i32 %203, %.06489
  %205 = shl i32 %204, %146
  %reass.add.1 = shl i32 %202, 3
  %reass.mul.1 = or disjoint i32 %reass.add.1, 8
  %206 = add i32 %205, %201
  %207 = add i32 %206, %reass.mul.1
  %208 = mul i32 %199, %147
  %reass.add83.1 = add i32 %204, %208
  %reass.mul84.1 = shl i32 %reass.add83.1, 3
  %209 = add i32 %reass.mul84.1, %201
  %210 = mul i32 %209, %108
  %211 = zext i32 %210 to i64
  %212 = getelementptr inbounds i8, ptr %3, i64 %211
  %213 = mul i32 %207, %108
  %214 = zext i32 %213 to i64
  %215 = getelementptr inbounds i8, ptr %1, i64 %214
  call void @_Z10UNI_MEMCPYPvPKvm(ptr noundef %212, ptr noundef %215, i64 noundef %117)
  %.pre100 = load i32, ptr %12, align 4
  br label %.critedge

.loopexit87:                                      ; preds = %._crit_edge92, %.preheader86.lr.ph, %107, %31, %32
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %16) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %15) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %14) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %13) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %12) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %11) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %10) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #7
  ret i32 0
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i8 @_Z10tensorIs2d10TensorDesc(ptr noundef byval(%struct.TensorDesc) align 8) local_unnamed_addr #5

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i8 @_Z10tensorIs3d10TensorDesc(ptr noundef byval(%struct.TensorDesc) align 8) local_unnamed_addr #5

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i32 @_Z7bytesOf8DataType(i32 noundef) local_unnamed_addr #1

attributes #0 = { mustprogress 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 = { 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 = { 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 = { 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 = { 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, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"_ZTS8DataType", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14, !16}
!16 = !{!"llvm.loop.unswitch.partial.disable"}
!17 = distinct !{!17, !14}
!18 = distinct !{!18, !14}


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