; LLVM IR from huawei-noah/bolt :: compute/tensor/src/cpu/reshape.ll (Z11reshape_cpu10TensorDescPvS_S0_)

; 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 [18 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [23 x i8], align 1

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_Z11reshape_cpu10TensorDescPvS_S0_(ptr noundef byval(%struct.TensorDesc) align 8 %0, ptr noundef %1, ptr noundef byval(%struct.TensorDesc) align 8 %2, ptr noundef %3) #0 {
  %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 %struct.TensorDesc, align 8
  %11 = alloca %struct.TensorDesc, align 8
  %12 = alloca i32, align 4
  %13 = alloca %struct.TensorDesc, align 8
  %14 = alloca %struct.TensorDesc, align 8
  %15 = alloca i32, align 4
  %16 = alloca i8, align 1
  %17 = alloca i32, align 4
  %18 = alloca %struct.TensorDesc, align 8
  %19 = alloca %struct.TensorDesc, align 8
  %20 = alloca %struct.TensorDesc, align 8
  %21 = alloca i32, align 4
  %22 = alloca i32, align 4
  %23 = alloca i32, align 4
  %24 = alloca i32, align 4
  %25 = alloca i32, align 4
  %26 = alloca i32, align 4
  %27 = alloca i32, align 4
  %28 = alloca %struct.TensorDesc, align 8
  %29 = alloca i32, align 4
  %30 = alloca %struct.TensorDesc, align 8
  %31 = alloca i32, align 4
  %32 = alloca %struct.TensorDesc, align 8
  %33 = alloca i32, align 4
  %34 = alloca %struct.TensorDesc, align 8
  %35 = alloca i32, align 4
  %36 = alloca i32, align 4
  %37 = alloca i32, align 4
  %38 = alloca i32, align 4
  store ptr %1, ptr %6, align 8, !tbaa !5
  store ptr %3, ptr %7, align 8, !tbaa !5
  %39 = load ptr, ptr %6, align 8, !tbaa !5
  %40 = icmp eq ptr null, %39
  br i1 %40, label %44, label %41

41:                                               ; preds = %4
  %42 = load ptr, ptr %7, align 8, !tbaa !5
  %43 = icmp eq ptr null, %42
  br i1 %43, label %44, label %60

44:                                               ; preds = %41, %4
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #8
  store i32 1, ptr %8, align 4, !tbaa !9
  %45 = load i32, ptr %8, align 4, !tbaa !9
  %46 = icmp ne i32 %45, 0
  br i1 %46, label %47, label %59

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

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

60:                                               ; preds = %59, %41
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %10, ptr align 8 %0, i64 92, i1 false), !tbaa.struct !13
  %61 = call noundef i32 @_Z17tensorNumElements10TensorDesc(ptr noundef byval(%struct.TensorDesc) align 8 %10)
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %11, ptr align 8 %2, i64 92, i1 false), !tbaa.struct !13
  %62 = call noundef i32 @_Z17tensorNumElements10TensorDesc(ptr noundef byval(%struct.TensorDesc) align 8 %11)
  %63 = icmp ne i32 %61, %62
  br i1 %63, label %64, label %94

64:                                               ; preds = %60
  %65 = getelementptr inbounds %struct.TensorDesc, ptr %0, i32 0, i32 1
  %66 = load i32, ptr %65, align 4, !tbaa !19
  %67 = icmp eq i32 2, %66
  br i1 %67, label %78, label %68

68:                                               ; preds = %64
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #8
  %69 = call i64 (i64, ...) @syscall(i64 noundef 186) #8
  %70 = trunc i64 %69 to i32
  store i32 %70, ptr %12, align 4, !tbaa !11
  %71 = load i32, ptr %12, align 4, !tbaa !11
  %72 = call i32 (ptr, ...) @printf(ptr noundef @.str, i32 noundef %71)
  %73 = load ptr, ptr @stdout, align 8, !tbaa !5
  %74 = call i32 @fflush(ptr noundef %73)
  %75 = call i32 (ptr, ...) @printf(ptr noundef @.str.2)
  %76 = load ptr, ptr @stdout, align 8, !tbaa !5
  %77 = call i32 @fflush(ptr noundef %76)
  call void @exit(i32 noundef 1) #9
  unreachable

78:                                               ; preds = %64
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %13, ptr align 8 %0, i64 92, i1 false), !tbaa.struct !13
  %79 = call noundef i32 @_Z17tensorNumElements10TensorDesc(ptr noundef byval(%struct.TensorDesc) align 8 %13)
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %14, ptr align 8 %2, i64 92, i1 false), !tbaa.struct !13
  %80 = call noundef i32 @_Z17tensorNumElements10TensorDesc(ptr noundef byval(%struct.TensorDesc) align 8 %14)
  %81 = icmp uge i32 %79, %80
  br i1 %81, label %92, label %82

82:                                               ; preds = %78
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #8
  %83 = call i64 (i64, ...) @syscall(i64 noundef 186) #8
  %84 = trunc i64 %83 to i32
  store i32 %84, ptr %15, align 4, !tbaa !11
  %85 = load i32, ptr %15, align 4, !tbaa !11
  %86 = call i32 (ptr, ...) @printf(ptr noundef @.str, i32 noundef %85)
  %87 = load ptr, ptr @stdout, align 8, !tbaa !5
  %88 = call i32 @fflush(ptr noundef %87)
  %89 = call i32 (ptr, ...) @printf(ptr noundef @.str.2)
  %90 = load ptr, ptr @stdout, align 8, !tbaa !5
  %91 = call i32 @fflush(ptr noundef %90)
  call void @exit(i32 noundef 1) #9
  unreachable

92:                                               ; preds = %78
  %93 = getelementptr inbounds %struct.TensorDesc, ptr %0, i32 0, i32 1
  store i32 0, ptr %93, align 4, !tbaa !19
  br label %94

94:                                               ; preds = %92, %60
  call void @llvm.lifetime.start.p0(i64 1, ptr %16) #8
  %95 = getelementptr inbounds %struct.TensorDesc, ptr %2, i32 0, i32 2
  %96 = load i32, ptr %95, align 8, !tbaa !21
  %97 = getelementptr inbounds %struct.TensorDesc, ptr %0, i32 0, i32 2
  %98 = load i32, ptr %97, align 8, !tbaa !21
  %99 = icmp eq i32 %96, %98
  %100 = zext i1 %99 to i8
  store i8 %100, ptr %16, align 1, !tbaa !22
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #8
  store i32 0, ptr %17, align 4, !tbaa !11
  br label %101

101:                                              ; preds = %121, %94
  %102 = load i32, ptr %17, align 4, !tbaa !11
  %103 = getelementptr inbounds %struct.TensorDesc, ptr %0, i32 0, i32 2
  %104 = load i32, ptr %103, align 8, !tbaa !21
  %105 = icmp ult i32 %102, %104
  br i1 %105, label %107, label %106

106:                                              ; preds = %101
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #8
  br label %124

107:                                              ; preds = %101
  %108 = getelementptr inbounds %struct.TensorDesc, ptr %2, i32 0, i32 3
  %109 = load i32, ptr %17, align 4, !tbaa !11
  %110 = zext i32 %109 to i64
  %111 = getelementptr inbounds [20 x i32], ptr %108, i64 0, i64 %110
  %112 = load i32, ptr %111, align 4, !tbaa !11
  %113 = getelementptr inbounds %struct.TensorDesc, ptr %0, i32 0, i32 3
  %114 = load i32, ptr %17, align 4, !tbaa !11
  %115 = zext i32 %114 to i64
  %116 = getelementptr inbounds [20 x i32], ptr %113, i64 0, i64 %115
  %117 = load i32, ptr %116, align 4, !tbaa !11
  %118 = icmp ne i32 %112, %117
  br i1 %118, label %119, label %120

119:                                              ; preds = %107
  store i8 0, ptr %16, align 1, !tbaa !22
  br label %120

120:                                              ; preds = %119, %107
  br label %121

121:                                              ; preds = %120
  %122 = load i32, ptr %17, align 4, !tbaa !11
  %123 = add i32 %122, 1
  store i32 %123, ptr %17, align 4, !tbaa !11
  br label %101, !llvm.loop !24

124:                                              ; preds = %106
  %125 = load i8, ptr %16, align 1, !tbaa !22, !range !26, !noundef !27
  %126 = trunc i8 %125 to i1
  br i1 %126, label %138, label %127

127:                                              ; preds = %124
  %128 = getelementptr inbounds %struct.TensorDesc, ptr %0, i32 0, i32 1
  %129 = load i32, ptr %128, align 4, !tbaa !19
  %130 = icmp eq i32 %129, 2
  br i1 %130, label %135, label %131

131:                                              ; preds = %127
  %132 = getelementptr inbounds %struct.TensorDesc, ptr %0, i32 0, i32 1
  %133 = load i32, ptr %132, align 4, !tbaa !19
  %134 = icmp eq i32 %133, 41
  br i1 %134, label %135, label %138

135:                                              ; preds = %131, %127
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %18, ptr align 8 %0, i64 92, i1 false), !tbaa.struct !13
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %19, ptr align 8 %2, i64 92, i1 false), !tbaa.struct !13
  %136 = call noundef zeroext i1 @_Z14isC8HasSameDim10TensorDescS_(ptr noundef byval(%struct.TensorDesc) align 8 %18, ptr noundef byval(%struct.TensorDesc) align 8 %19)
  %137 = zext i1 %136 to i8
  store i8 %137, ptr %16, align 1, !tbaa !22
  br label %138

138:                                              ; preds = %135, %131, %124
  %139 = getelementptr inbounds %struct.TensorDesc, ptr %0, i32 0, i32 1
  %140 = load i32, ptr %139, align 4, !tbaa !19
  %141 = icmp ne i32 2, %140
  br i1 %141, label %142, label %146

142:                                              ; preds = %138
  %143 = getelementptr inbounds %struct.TensorDesc, ptr %0, i32 0, i32 1
  %144 = load i32, ptr %143, align 4, !tbaa !19
  %145 = icmp ne i32 41, %144
  br i1 %145, label %149, label %146

146:                                              ; preds = %142, %138
  %147 = load i8, ptr %16, align 1, !tbaa !22, !range !26, !noundef !27
  %148 = trunc i8 %147 to i1
  br i1 %148, label %149, label %159

149:                                              ; preds = %146, %142
  %150 = load ptr, ptr %7, align 8, !tbaa !5
  %151 = load ptr, ptr %6, align 8, !tbaa !5
  %152 = icmp ne ptr %150, %151
  br i1 %152, label %153, label %158

153:                                              ; preds = %149
  %154 = load ptr, ptr %7, align 8, !tbaa !5
  %155 = load ptr, ptr %6, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %20, ptr align 8 %2, i64 92, i1 false), !tbaa.struct !13
  %156 = call noundef i32 @_Z14tensorNumBytes10TensorDesc(ptr noundef byval(%struct.TensorDesc) align 8 %20)
  %157 = zext i32 %156 to i64
  call void @_Z10UNI_MEMCPYPvPKvm(ptr noundef %154, ptr noundef %155, i64 noundef %157)
  br label %158

158:                                              ; preds = %153, %149
  br label %249

159:                                              ; preds = %146
  %160 = load ptr, ptr %6, align 8, !tbaa !5
  %161 = load ptr, ptr %7, align 8, !tbaa !5
  %162 = icmp ne ptr %160, %161
  br i1 %162, label %173, label %163

163:                                              ; preds = %159
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #8
  %164 = call i64 (i64, ...) @syscall(i64 noundef 186) #8
  %165 = trunc i64 %164 to i32
  store i32 %165, ptr %21, align 4, !tbaa !11
  %166 = load i32, ptr %21, align 4, !tbaa !11
  %167 = call i32 (ptr, ...) @printf(ptr noundef @.str, i32 noundef %166)
  %168 = load ptr, ptr @stdout, align 8, !tbaa !5
  %169 = call i32 @fflush(ptr noundef %168)
  %170 = call i32 (ptr, ...) @printf(ptr noundef @.str.2)
  %171 = load ptr, ptr @stdout, align 8, !tbaa !5
  %172 = call i32 @fflush(ptr noundef %171)
  call void @exit(i32 noundef 1) #9
  unreachable

173:                                              ; preds = %159
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %28, ptr align 8 %0, i64 92, i1 false), !tbaa.struct !13
  %174 = call noundef zeroext i8 @_Z10tensorIs4d10TensorDesc(ptr noundef byval(%struct.TensorDesc) align 8 %28)
  %175 = icmp ne i8 %174, 0
  br i1 %175, label %176, label %193

176:                                              ; preds = %173
  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 %0, i64 92, i1 false), !tbaa.struct !13
  %177 = call noundef i32 @_Z11tensor4dGet10TensorDescP8DataTypeP10DataFormatPjS4_S4_S4_(ptr noundef byval(%struct.TensorDesc) align 8 %30, ptr noundef %22, ptr noundef %23, ptr noundef %24, ptr noundef %25, ptr noundef %26, ptr noundef %27)
  store i32 %177, ptr %29, align 4, !tbaa !9
  %178 = load i32, ptr %29, align 4, !tbaa !9
  %179 = icmp ne i32 %178, 0
  br i1 %179, label %180, label %192

180:                                              ; preds = %176
  call void @llvm.lifetime.start.p0(i64 4, ptr %31) #8
  %181 = call i64 (i64, ...) @syscall(i64 noundef 186) #8
  %182 = trunc i64 %181 to i32
  store i32 %182, ptr %31, align 4, !tbaa !11
  %183 = load i32, ptr %31, align 4, !tbaa !11
  %184 = call i32 (ptr, ...) @printf(ptr noundef @.str, i32 noundef %183)
  %185 = load ptr, ptr @stdout, align 8, !tbaa !5
  %186 = call i32 @fflush(ptr noundef %185)
  %187 = load i32, ptr %29, align 4, !tbaa !9
  %188 = call ptr @ee2str(i32 noundef %187)
  %189 = call i32 (ptr, ...) @printf(ptr noundef @.str.1, ptr noundef %188)
  %190 = load ptr, ptr @stdout, align 8, !tbaa !5
  %191 = call i32 @fflush(ptr noundef %190)
  call void @exit(i32 noundef 1) #9
  unreachable

192:                                              ; preds = %176
  call void @llvm.lifetime.end.p0(i64 4, ptr %29) #8
  br label %215

193:                                              ; preds = %173
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %32, ptr align 8 %0, i64 92, i1 false), !tbaa.struct !13
  %194 = call noundef zeroext i8 @_Z10tensorIs3d10TensorDesc(ptr noundef byval(%struct.TensorDesc) align 8 %32)
  %195 = icmp ne i8 %194, 0
  br i1 %195, label %196, label %213

196:                                              ; preds = %193
  call void @llvm.lifetime.start.p0(i64 4, ptr %33) #8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %34, ptr align 8 %0, i64 92, i1 false), !tbaa.struct !13
  %197 = call noundef i32 @_Z11tensor3dGet10TensorDescP8DataTypeP10DataFormatPjS4_S4_(ptr noundef byval(%struct.TensorDesc) align 8 %34, ptr noundef %22, ptr noundef %23, ptr noundef %24, ptr noundef %25, ptr noundef %26)
  store i32 %197, ptr %33, align 4, !tbaa !9
  %198 = load i32, ptr %33, align 4, !tbaa !9
  %199 = icmp ne i32 %198, 0
  br i1 %199, label %200, label %212

200:                                              ; preds = %196
  call void @llvm.lifetime.start.p0(i64 4, ptr %35) #8
  %201 = call i64 (i64, ...) @syscall(i64 noundef 186) #8
  %202 = trunc i64 %201 to i32
  store i32 %202, ptr %35, align 4, !tbaa !11
  %203 = load i32, ptr %35, align 4, !tbaa !11
  %204 = call i32 (ptr, ...) @printf(ptr noundef @.str, i32 noundef %203)
  %205 = load ptr, ptr @stdout, align 8, !tbaa !5
  %206 = call i32 @fflush(ptr noundef %205)
  %207 = load i32, ptr %33, align 4, !tbaa !9
  %208 = call ptr @ee2str(i32 noundef %207)
  %209 = call i32 (ptr, ...) @printf(ptr noundef @.str.1, ptr noundef %208)
  %210 = load ptr, ptr @stdout, align 8, !tbaa !5
  %211 = call i32 @fflush(ptr noundef %210)
  call void @exit(i32 noundef 1) #9
  unreachable

212:                                              ; preds = %196
  call void @llvm.lifetime.end.p0(i64 4, ptr %33) #8
  store i32 1, ptr %27, align 4, !tbaa !11
  br label %214

213:                                              ; preds = %193
  store i32 51, ptr %5, align 4
  store i32 1, ptr %36, align 4
  br label %246

214:                                              ; preds = %212
  br label %215

215:                                              ; preds = %214, %192
  call void @llvm.lifetime.start.p0(i64 4, ptr %37) #8
  %216 = getelementptr inbounds %struct.TensorDesc, ptr %0, i32 0, i32 1
  %217 = load i32, ptr %216, align 4, !tbaa !19
  %218 = icmp eq i32 2, %217
  %219 = zext i1 %218 to i64
  %220 = select i1 %218, i32 8, i32 16
  store i32 %220, ptr %37, align 4, !tbaa !11
  %221 = load i32, ptr %37, align 4, !tbaa !11
  %222 = load i32, ptr %25, align 4, !tbaa !11
  %223 = udiv i32 %222, %221
  store i32 %223, ptr %25, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %38) #8
  %224 = load i32, ptr %26, align 4, !tbaa !11
  %225 = load i32, ptr %27, align 4, !tbaa !11
  %226 = mul i32 %224, %225
  store i32 %226, ptr %38, align 4, !tbaa !11
  %227 = getelementptr inbounds %struct.TensorDesc, ptr %0, i32 0, i32 0
  %228 = load i32, ptr %227, align 8, !tbaa !28
  switch i32 %228, label %243 [
    i32 3, label %229
    i32 6, label %229
    i32 0, label %236
    i32 10, label %236
    i32 1, label %236
  ]

229:                                              ; preds = %215, %215
  %230 = load ptr, ptr %6, align 8, !tbaa !5
  %231 = load ptr, ptr %7, align 8, !tbaa !5
  %232 = load i32, ptr %24, align 4, !tbaa !11
  %233 = load i32, ptr %25, align 4, !tbaa !11
  %234 = load i32, ptr %38, align 4, !tbaa !11
  %235 = load i32, ptr %37, align 4, !tbaa !11
  call void @_Z5transIfEvPT_S1_jjjj(ptr noundef %230, ptr noundef %231, i32 noundef %232, i32 noundef %233, i32 noundef %234, i32 noundef %235)
  br label %244

236:                                              ; preds = %215, %215, %215
  %237 = load ptr, ptr %6, align 8, !tbaa !5
  %238 = load ptr, ptr %7, align 8, !tbaa !5
  %239 = load i32, ptr %24, align 4, !tbaa !11
  %240 = load i32, ptr %25, align 4, !tbaa !11
  %241 = load i32, ptr %38, align 4, !tbaa !11
  %242 = load i32, ptr %37, align 4, !tbaa !11
  call void @_Z5transIaEvPT_S1_jjjj(ptr noundef %237, ptr noundef %238, i32 noundef %239, i32 noundef %240, i32 noundef %241, i32 noundef %242)
  br label %244

243:                                              ; preds = %215
  store i32 51, ptr %5, align 4
  store i32 1, ptr %36, align 4
  br label %245

244:                                              ; preds = %236, %229
  store i32 0, ptr %36, align 4
  br label %245

245:                                              ; preds = %244, %243
  call void @llvm.lifetime.end.p0(i64 4, ptr %38) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %37) #8
  br label %246

246:                                              ; preds = %245, %213
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #8
  %247 = load i32, ptr %36, align 4
  switch i32 %247, label %250 [
    i32 0, label %248
  ]

248:                                              ; preds = %246
  br label %249

249:                                              ; preds = %248, %158
  store i32 0, ptr %5, align 4
  store i32 1, ptr %36, align 4
  br label %250

250:                                              ; preds = %249, %246
  call void @llvm.lifetime.end.p0(i64 1, ptr %16) #8
  %251 = load i32, ptr %5, align 4
  ret i32 %251
}

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

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

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

declare i32 @fflush(ptr noundef) #3

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

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

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

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

; 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: inlinehint mustprogress uwtable
declare dso_local noundef zeroext i1 @_Z14isC8HasSameDim10TensorDescS_(ptr noundef byval(%struct.TensorDesc) align 8, ptr noundef byval(%struct.TensorDesc) align 8) #7

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

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

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

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef range(i32 0, 52) i32 @_Z11reshape_cpu10TensorDescPvS_S0_(ptr nocapture noundef 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 #0 {
  %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 = icmp eq ptr %1, null
  %12 = icmp eq ptr %3, null
  %or.cond = or i1 %11, %12
  br i1 %or.cond, label %13, label %23

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

23:                                               ; preds = %4
  %24 = tail call noundef i32 @_Z17tensorNumElements10TensorDesc(ptr noundef nonnull byval(%struct.TensorDesc) align 8 %0)
  %25 = tail call noundef i32 @_Z17tensorNumElements10TensorDesc(ptr noundef nonnull byval(%struct.TensorDesc) align 8 %2)
  %.not = icmp eq i32 %24, %25
  br i1 %.not, label %52, label %26

26:                                               ; preds = %23
  %27 = getelementptr inbounds i8, ptr %0, i64 4
  %28 = load i32, ptr %27, align 4, !tbaa !9
  %29 = icmp eq i32 %28, 2
  br i1 %29, label %39, label %30

30:                                               ; preds = %26
  %31 = tail call i64 (i64, ...) @syscall(i64 noundef 186) #7
  %32 = trunc i64 %31 to i32
  %33 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %32)
  %34 = load ptr, ptr @stdout, align 8, !tbaa !5
  %35 = tail call i32 @fflush(ptr noundef %34)
  %36 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2)
  %37 = load ptr, ptr @stdout, align 8, !tbaa !5
  %38 = tail call i32 @fflush(ptr noundef %37)
  tail call void @exit(i32 noundef 1) #8
  unreachable

39:                                               ; preds = %26
  %40 = tail call noundef i32 @_Z17tensorNumElements10TensorDesc(ptr noundef nonnull byval(%struct.TensorDesc) align 8 %0)
  %41 = tail call noundef i32 @_Z17tensorNumElements10TensorDesc(ptr noundef nonnull byval(%struct.TensorDesc) align 8 %2)
  %.not53 = icmp ult i32 %40, %41
  br i1 %.not53, label %42, label %51

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

51:                                               ; preds = %39
  store i32 0, ptr %27, align 4, !tbaa !9
  br label %52

52:                                               ; preds = %51, %23
  %53 = getelementptr inbounds i8, ptr %2, i64 8
  %54 = load i32, ptr %53, align 8, !tbaa !14
  %55 = getelementptr inbounds i8, ptr %0, i64 8
  %56 = load i32, ptr %55, align 8, !tbaa !14
  %57 = icmp eq i32 %54, %56
  %58 = zext i1 %57 to i8
  %.not63 = icmp eq i32 %56, 0
  br i1 %.not63, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %52
  %59 = getelementptr inbounds i8, ptr %2, i64 12
  %60 = getelementptr inbounds i8, ptr %0, i64 12
  %wide.trip.count = zext i32 %56 to i64
  %min.iters.check = icmp ult i32 %56, 8
  br i1 %min.iters.check, label %scalar.ph.preheader, label %vector.ph

scalar.ph.preheader:                              ; preds = %middle.block, %.lr.ph
  %indvars.iv.ph = phi i64 [ 0, %.lr.ph ], [ %n.vec, %middle.block ]
  %.04362.ph = phi i8 [ %58, %.lr.ph ], [ %rdx.select, %middle.block ]
  br label %scalar.ph

vector.ph:                                        ; preds = %.lr.ph
  %n.vec = and i64 %wide.trip.count, 4294967288
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %vec.phi = phi <4 x i1> [ zeroinitializer, %vector.ph ], [ %67, %vector.body ]
  %vec.phi66 = phi <4 x i1> [ zeroinitializer, %vector.ph ], [ %68, %vector.body ]
  %61 = getelementptr inbounds [20 x i32], ptr %59, i64 0, i64 %index
  %62 = getelementptr inbounds i8, ptr %61, i64 16
  %wide.load = load <4 x i32>, ptr %61, align 4, !tbaa !15
  %wide.load67 = load <4 x i32>, ptr %62, align 4, !tbaa !15
  %63 = getelementptr inbounds [20 x i32], ptr %60, i64 0, i64 %index
  %64 = getelementptr inbounds i8, ptr %63, i64 16
  %wide.load68 = load <4 x i32>, ptr %63, align 4, !tbaa !15
  %wide.load69 = load <4 x i32>, ptr %64, align 4, !tbaa !15
  %65 = icmp ne <4 x i32> %wide.load, %wide.load68
  %66 = icmp ne <4 x i32> %wide.load67, %wide.load69
  %67 = or <4 x i1> %vec.phi, %65
  %68 = or <4 x i1> %vec.phi66, %66
  %index.next = add nuw i64 %index, 8
  %69 = icmp eq i64 %index.next, %n.vec
  br i1 %69, label %middle.block, label %vector.body, !llvm.loop !16

middle.block:                                     ; preds = %vector.body
  %bin.rdx = or <4 x i1> %68, %67
  %bin.rdx.fr = freeze <4 x i1> %bin.rdx
  %70 = bitcast <4 x i1> %bin.rdx.fr to i4
  %.not70 = icmp eq i4 %70, 0
  %rdx.select = select i1 %.not70, i8 %58, i8 0
  %cmp.n = icmp eq i64 %n.vec, %wide.trip.count
  br i1 %cmp.n, label %._crit_edge, label %scalar.ph.preheader

._crit_edge:                                      ; preds = %scalar.ph, %middle.block, %52
  %.043.lcssa = phi i8 [ %58, %52 ], [ %rdx.select, %middle.block ], [ %spec.select, %scalar.ph ]
  %71 = trunc nuw i8 %.043.lcssa to i1
  %.phi.trans.insert = getelementptr inbounds i8, ptr %0, i64 4
  %.pre = load i32, ptr %.phi.trans.insert, align 4
  br i1 %71, label %._crit_edge._crit_edge, label %76

scalar.ph:                                        ; preds = %scalar.ph.preheader, %scalar.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %scalar.ph ], [ %indvars.iv.ph, %scalar.ph.preheader ]
  %.04362 = phi i8 [ %spec.select, %scalar.ph ], [ %.04362.ph, %scalar.ph.preheader ]
  %72 = getelementptr inbounds [20 x i32], ptr %59, i64 0, i64 %indvars.iv
  %73 = load i32, ptr %72, align 4, !tbaa !15
  %74 = getelementptr inbounds [20 x i32], ptr %60, i64 0, i64 %indvars.iv
  %75 = load i32, ptr %74, align 4, !tbaa !15
  %.not60 = icmp eq i32 %73, %75
  %spec.select = select i1 %.not60, i8 %.04362, i8 0
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge, label %scalar.ph, !llvm.loop !20

76:                                               ; preds = %._crit_edge
  switch i32 %.pre, label %._crit_edge._crit_edge [
    i32 41, label %77
    i32 2, label %77
  ]

77:                                               ; preds = %76, %76
  %78 = tail call noundef zeroext i1 @_Z14isC8HasSameDim10TensorDescS_(ptr noundef nonnull byval(%struct.TensorDesc) align 8 %0, ptr noundef nonnull byval(%struct.TensorDesc) align 8 %2)
  %79 = zext i1 %78 to i8
  br label %._crit_edge._crit_edge

._crit_edge._crit_edge:                           ; preds = %._crit_edge, %76, %77
  %.245 = phi i8 [ %79, %77 ], [ %.043.lcssa, %76 ], [ %.043.lcssa, %._crit_edge ]
  switch i32 %.pre, label %82 [
    i32 41, label %80
    i32 2, label %80
  ]

80:                                               ; preds = %._crit_edge._crit_edge, %._crit_edge._crit_edge
  %81 = trunc nuw i8 %.245 to i1
  br i1 %81, label %82, label %86

82:                                               ; preds = %._crit_edge._crit_edge, %80
  %.not59 = icmp eq ptr %3, %1
  br i1 %.not59, label %140, label %83

83:                                               ; preds = %82
  %84 = tail call noundef i32 @_Z14tensorNumBytes10TensorDesc(ptr noundef nonnull byval(%struct.TensorDesc) align 8 %2)
  %85 = zext i32 %84 to i64
  tail call void @_Z10UNI_MEMCPYPvPKvm(ptr noundef %3, ptr noundef %1, i64 noundef %85)
  br label %140

86:                                               ; preds = %80
  %.not54 = icmp eq ptr %1, %3
  br i1 %.not54, label %87, label %96

87:                                               ; preds = %86
  %88 = tail call i64 (i64, ...) @syscall(i64 noundef 186) #7
  %89 = trunc i64 %88 to i32
  %90 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %89)
  %91 = load ptr, ptr @stdout, align 8, !tbaa !5
  %92 = tail call i32 @fflush(ptr noundef %91)
  %93 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2)
  %94 = load ptr, ptr @stdout, align 8, !tbaa !5
  %95 = tail call i32 @fflush(ptr noundef %94)
  tail call void @exit(i32 noundef 1) #8
  unreachable

96:                                               ; preds = %86
  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
  %97 = tail call noundef zeroext i8 @_Z10tensorIs4d10TensorDesc(ptr noundef nonnull byval(%struct.TensorDesc) align 8 %0)
  %.not55 = icmp eq i8 %97, 0
  br i1 %.not55, label %110, label %98

98:                                               ; preds = %96
  %99 = call noundef i32 @_Z11tensor4dGet10TensorDescP8DataTypeP10DataFormatPjS4_S4_S4_(ptr noundef nonnull byval(%struct.TensorDesc) align 8 %0, ptr noundef nonnull %5, ptr noundef nonnull %6, ptr noundef nonnull %7, ptr noundef nonnull %8, ptr noundef nonnull %9, ptr noundef nonnull %10)
  %.not58 = icmp eq i32 %99, 0
  br i1 %.not58, label %._crit_edge64, label %100

._crit_edge64:                                    ; preds = %98
  %.pre65 = load i32, ptr %10, align 4, !tbaa !15
  br label %125

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

110:                                              ; preds = %96
  %111 = tail call noundef zeroext i8 @_Z10tensorIs3d10TensorDesc(ptr noundef nonnull byval(%struct.TensorDesc) align 8 %0)
  %.not56 = icmp eq i8 %111, 0
  br i1 %.not56, label %.critedge, label %112

112:                                              ; preds = %110
  %113 = call noundef i32 @_Z11tensor3dGet10TensorDescP8DataTypeP10DataFormatPjS4_S4_(ptr noundef nonnull byval(%struct.TensorDesc) align 8 %0, ptr noundef nonnull %5, ptr noundef nonnull %6, ptr noundef nonnull %7, ptr noundef nonnull %8, ptr noundef nonnull %9)
  %.not57 = icmp eq i32 %113, 0
  br i1 %.not57, label %124, label %114

114:                                              ; preds = %112
  %115 = call i64 (i64, ...) @syscall(i64 noundef 186) #7
  %116 = trunc i64 %115 to i32
  %117 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %116)
  %118 = load ptr, ptr @stdout, align 8, !tbaa !5
  %119 = call i32 @fflush(ptr noundef %118)
  %120 = call ptr @ee2str(i32 noundef %113)
  %121 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, ptr noundef %120)
  %122 = load ptr, ptr @stdout, align 8, !tbaa !5
  %123 = call i32 @fflush(ptr noundef %122)
  call void @exit(i32 noundef 1) #8
  unreachable

124:                                              ; preds = %112
  store i32 1, ptr %10, align 4, !tbaa !15
  br label %125

125:                                              ; preds = %._crit_edge64, %124
  %126 = phi i32 [ %.pre65, %._crit_edge64 ], [ 1, %124 ]
  %127 = icmp eq i32 %.pre, 2
  %128 = select i1 %127, i32 8, i32 16
  %129 = load i32, ptr %8, align 4, !tbaa !15
  %130 = select i1 %127, i32 3, i32 4
  %131 = lshr i32 %129, %130
  store i32 %131, ptr %8, align 4, !tbaa !15
  %132 = load i32, ptr %9, align 4, !tbaa !15
  %133 = mul i32 %126, %132
  %134 = load i32, ptr %0, align 8, !tbaa !21
  switch i32 %134, label %.critedge [
    i32 3, label %135
    i32 6, label %135
    i32 0, label %137
    i32 10, label %137
    i32 1, label %137
  ]

135:                                              ; preds = %125, %125
  %136 = load i32, ptr %7, align 4, !tbaa !15
  call void @_Z5transIfEvPT_S1_jjjj(ptr noundef %1, ptr noundef %3, i32 noundef %136, i32 noundef %131, i32 noundef %133, i32 noundef %128)
  br label %139

137:                                              ; preds = %125, %125, %125
  %138 = load i32, ptr %7, align 4, !tbaa !15
  call void @_Z5transIaEvPT_S1_jjjj(ptr noundef %1, ptr noundef %3, i32 noundef %138, i32 noundef %131, i32 noundef %133, i32 noundef %128)
  br label %139

139:                                              ; preds = %137, %135
  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
  br label %140

.critedge:                                        ; preds = %125, %110
  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
  br label %140

140:                                              ; preds = %83, %82, %139, %.critedge
  %.2 = phi i32 [ 51, %.critedge ], [ 0, %139 ], [ 0, %82 ], [ 0, %83 ]
  ret i32 %.2
}

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #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: inlinehint mustprogress nounwind uwtable
declare dso_local ptr @ee2str(i32 noundef) local_unnamed_addr #4

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

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

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

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

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

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

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

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

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

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

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

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

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


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