; LLVM IR from jingweizhanghuai/Morn :: src/deep_learning (morn_tensor_mul)

; 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.TensorRegister = type { [32 x i8], ptr, ptr, ptr }
%struct.MLayer = type { [32 x i8], i32, ptr, ptr, ptr, i32 }
%struct.TensorMulPara = type { ptr, ptr, i32, i32 }
%struct.MTensor = type { i32, i32, i32, i32, ptr, i32 }

@.str.1 = external hidden unnamed_addr constant [91 x i8], align 1
@morn_tensor_register = external global [256 x %struct.TensorRegister], align 16
@.str.7 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [19 x i8], align 1
@__FUNCTION__.mTensorMulBackward = external hidden unnamed_addr constant [19 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [56 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

declare void @m_Exception(i32 noundef, i32 noundef, ptr noundef, i32 noundef, ptr noundef, ptr noundef, ...) #1

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

; Function Attrs: nounwind willreturn memory(read)
declare i32 @strcmp(ptr noundef, ptr noundef) #2

; Function Attrs: nounwind uwtable
define dso_local void @mTensorMulBackward(ptr noundef %0) #3 {
  %2 = alloca ptr, align 8
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca float, align 4
  %16 = alloca float, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  br label %17

17:                                               ; preds = %1
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #4
  %18 = load ptr, ptr %2, align 8, !tbaa !5
  %19 = icmp eq ptr %18, null
  br i1 %19, label %24, label %20

20:                                               ; preds = %17
  %21 = load ptr, ptr %2, align 8, !tbaa !5
  %22 = ptrtoint ptr %21 to i64
  %23 = icmp eq i64 %22, -1
  br label %24

24:                                               ; preds = %20, %17
  %25 = phi i1 [ true, %17 ], [ %23, %20 ]
  %26 = zext i1 %25 to i32
  store i32 %26, ptr %3, align 4, !tbaa !9
  %27 = load i32, ptr %3, align 4, !tbaa !9
  %28 = icmp ne i32 %27, 0
  br i1 %28, label %29, label %31

29:                                               ; preds = %24
  %30 = load i32, ptr %3, align 4, !tbaa !9
  call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef %30, i32 noundef -1, ptr noundef @.str.1, i32 noundef 79, ptr noundef @__FUNCTION__.mTensorMulBackward, ptr noundef @.str.7)
  br label %31

31:                                               ; preds = %29, %24
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #4
  br label %32

32:                                               ; preds = %31
  br label %33

33:                                               ; preds = %32
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #4
  %34 = load ptr, ptr %2, align 8, !tbaa !5
  %35 = getelementptr inbounds %struct.MLayer, ptr %34, i32 0, i32 1
  %36 = load i32, ptr %35, align 8, !tbaa !11
  %37 = sext i32 %36 to i64
  %38 = getelementptr inbounds [256 x %struct.TensorRegister], ptr @morn_tensor_register, i64 0, i64 %37
  %39 = getelementptr inbounds %struct.TensorRegister, ptr %38, i32 0, i32 0
  %40 = getelementptr inbounds [32 x i8], ptr %39, i64 0, i64 0
  %41 = call i32 @strcmp(ptr noundef @.str.8, ptr noundef %40) #5
  store i32 %41, ptr %4, align 4, !tbaa !9
  %42 = load i32, ptr %4, align 4, !tbaa !9
  %43 = icmp ne i32 %42, 0
  br i1 %43, label %44, label %46

44:                                               ; preds = %33
  %45 = load i32, ptr %4, align 4, !tbaa !9
  call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef %45, i32 noundef -1, ptr noundef @.str.1, i32 noundef 80, ptr noundef @__FUNCTION__.mTensorMulBackward, ptr noundef @.str.9)
  br label %46

46:                                               ; preds = %44, %33
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #4
  br label %47

47:                                               ; preds = %46
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #4
  %48 = load ptr, ptr %2, align 8, !tbaa !5
  %49 = getelementptr inbounds %struct.MLayer, ptr %48, i32 0, i32 4
  %50 = load ptr, ptr %49, align 8, !tbaa !13
  store ptr %50, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #4
  %51 = load ptr, ptr %5, align 8, !tbaa !5
  %52 = getelementptr inbounds %struct.TensorMulPara, ptr %51, i32 0, i32 0
  %53 = load ptr, ptr %52, align 8, !tbaa !14
  %54 = getelementptr inbounds %struct.MLayer, ptr %53, i32 0, i32 2
  %55 = load ptr, ptr %54, align 8, !tbaa !16
  store ptr %55, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #4
  %56 = load ptr, ptr %5, align 8, !tbaa !5
  %57 = getelementptr inbounds %struct.TensorMulPara, ptr %56, i32 0, i32 1
  %58 = load ptr, ptr %57, align 8, !tbaa !17
  %59 = getelementptr inbounds %struct.MLayer, ptr %58, i32 0, i32 2
  %60 = load ptr, ptr %59, align 8, !tbaa !16
  store ptr %60, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #4
  %61 = load ptr, ptr %5, align 8, !tbaa !5
  %62 = getelementptr inbounds %struct.TensorMulPara, ptr %61, i32 0, i32 0
  %63 = load ptr, ptr %62, align 8, !tbaa !14
  %64 = getelementptr inbounds %struct.MLayer, ptr %63, i32 0, i32 3
  %65 = load ptr, ptr %64, align 8, !tbaa !18
  store ptr %65, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #4
  %66 = load ptr, ptr %5, align 8, !tbaa !5
  %67 = getelementptr inbounds %struct.TensorMulPara, ptr %66, i32 0, i32 1
  %68 = load ptr, ptr %67, align 8, !tbaa !17
  %69 = getelementptr inbounds %struct.MLayer, ptr %68, i32 0, i32 3
  %70 = load ptr, ptr %69, align 8, !tbaa !18
  store ptr %70, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #4
  %71 = load ptr, ptr %2, align 8, !tbaa !5
  %72 = getelementptr inbounds %struct.MLayer, ptr %71, i32 0, i32 3
  %73 = load ptr, ptr %72, align 8, !tbaa !18
  store ptr %73, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #4
  %74 = load ptr, ptr %10, align 8, !tbaa !5
  %75 = getelementptr inbounds %struct.MTensor, ptr %74, i32 0, i32 2
  %76 = load i32, ptr %75, align 8, !tbaa !19
  %77 = load ptr, ptr %10, align 8, !tbaa !5
  %78 = getelementptr inbounds %struct.MTensor, ptr %77, i32 0, i32 3
  %79 = load i32, ptr %78, align 4, !tbaa !21
  %80 = mul nsw i32 %76, %79
  store i32 %80, ptr %11, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #4
  store i32 0, ptr %12, align 4, !tbaa !9
  br label %81

81:                                               ; preds = %274, %47
  %82 = load i32, ptr %12, align 4, !tbaa !9
  %83 = load ptr, ptr %10, align 8, !tbaa !5
  %84 = getelementptr inbounds %struct.MTensor, ptr %83, i32 0, i32 0
  %85 = load i32, ptr %84, align 8, !tbaa !22
  %86 = icmp slt i32 %82, %85
  br i1 %86, label %88, label %87

87:                                               ; preds = %81
  store i32 6, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #4
  br label %277

88:                                               ; preds = %81
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #4
  store i32 0, ptr %14, align 4, !tbaa !9
  br label %89

89:                                               ; preds = %270, %88
  %90 = load i32, ptr %14, align 4, !tbaa !9
  %91 = load i32, ptr %11, align 4, !tbaa !9
  %92 = icmp slt i32 %90, %91
  br i1 %92, label %94, label %93

93:                                               ; preds = %89
  store i32 9, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #4
  br label %273

94:                                               ; preds = %89
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #4
  %95 = load ptr, ptr %10, align 8, !tbaa !5
  %96 = getelementptr inbounds %struct.MTensor, ptr %95, i32 0, i32 4
  %97 = load ptr, ptr %96, align 8, !tbaa !23
  %98 = load i32, ptr %12, align 4, !tbaa !9
  %99 = sext i32 %98 to i64
  %100 = getelementptr inbounds ptr, ptr %97, i64 %99
  %101 = load ptr, ptr %100, align 8, !tbaa !5
  %102 = load i32, ptr %14, align 4, !tbaa !9
  %103 = sext i32 %102 to i64
  %104 = getelementptr inbounds float, ptr %101, i64 %103
  %105 = load float, ptr %104, align 4, !tbaa !24
  %106 = load ptr, ptr %7, align 8, !tbaa !5
  %107 = getelementptr inbounds %struct.MTensor, ptr %106, i32 0, i32 4
  %108 = load ptr, ptr %107, align 8, !tbaa !23
  %109 = load i32, ptr %12, align 4, !tbaa !9
  %110 = sext i32 %109 to i64
  %111 = getelementptr inbounds ptr, ptr %108, i64 %110
  %112 = load ptr, ptr %111, align 8, !tbaa !5
  %113 = load i32, ptr %14, align 4, !tbaa !9
  %114 = sext i32 %113 to i64
  %115 = getelementptr inbounds float, ptr %112, i64 %114
  %116 = load float, ptr %115, align 4, !tbaa !24
  %117 = fmul float %105, %116
  store float %117, ptr %15, align 4, !tbaa !24
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #4
  %118 = load ptr, ptr %10, align 8, !tbaa !5
  %119 = getelementptr inbounds %struct.MTensor, ptr %118, i32 0, i32 4
  %120 = load ptr, ptr %119, align 8, !tbaa !23
  %121 = load i32, ptr %12, align 4, !tbaa !9
  %122 = sext i32 %121 to i64
  %123 = getelementptr inbounds ptr, ptr %120, i64 %122
  %124 = load ptr, ptr %123, align 8, !tbaa !5
  %125 = load i32, ptr %14, align 4, !tbaa !9
  %126 = sext i32 %125 to i64
  %127 = getelementptr inbounds float, ptr %124, i64 %126
  %128 = load float, ptr %127, align 4, !tbaa !24
  %129 = load ptr, ptr %6, align 8, !tbaa !5
  %130 = getelementptr inbounds %struct.MTensor, ptr %129, i32 0, i32 4
  %131 = load ptr, ptr %130, align 8, !tbaa !23
  %132 = load i32, ptr %12, align 4, !tbaa !9
  %133 = sext i32 %132 to i64
  %134 = getelementptr inbounds ptr, ptr %131, i64 %133
  %135 = load ptr, ptr %134, align 8, !tbaa !5
  %136 = load i32, ptr %14, align 4, !tbaa !9
  %137 = sext i32 %136 to i64
  %138 = getelementptr inbounds float, ptr %135, i64 %137
  %139 = load float, ptr %138, align 4, !tbaa !24
  %140 = fmul float %128, %139
  store float %140, ptr %16, align 4, !tbaa !24
  %141 = load i32, ptr %12, align 4, !tbaa !9
  %142 = icmp eq i32 %141, 0
  br i1 %142, label %143, label %191

143:                                              ; preds = %94
  %144 = load i32, ptr %14, align 4, !tbaa !9
  %145 = icmp eq i32 %144, 100
  br i1 %145, label %146, label %191

146:                                              ; preds = %143
  %147 = load ptr, ptr %2, align 8, !tbaa !5
  %148 = getelementptr inbounds %struct.MLayer, ptr %147, i32 0, i32 0
  %149 = getelementptr inbounds [32 x i8], ptr %148, i64 0, i64 0
  %150 = load ptr, ptr %6, align 8, !tbaa !5
  %151 = getelementptr inbounds %struct.MTensor, ptr %150, i32 0, i32 4
  %152 = load ptr, ptr %151, align 8, !tbaa !23
  %153 = load i32, ptr %12, align 4, !tbaa !9
  %154 = sext i32 %153 to i64
  %155 = getelementptr inbounds ptr, ptr %152, i64 %154
  %156 = load ptr, ptr %155, align 8, !tbaa !5
  %157 = load i32, ptr %14, align 4, !tbaa !9
  %158 = sext i32 %157 to i64
  %159 = getelementptr inbounds float, ptr %156, i64 %158
  %160 = load float, ptr %159, align 4, !tbaa !24
  %161 = fpext float %160 to double
  %162 = load ptr, ptr %7, align 8, !tbaa !5
  %163 = getelementptr inbounds %struct.MTensor, ptr %162, i32 0, i32 4
  %164 = load ptr, ptr %163, align 8, !tbaa !23
  %165 = load i32, ptr %12, align 4, !tbaa !9
  %166 = sext i32 %165 to i64
  %167 = getelementptr inbounds ptr, ptr %164, i64 %166
  %168 = load ptr, ptr %167, align 8, !tbaa !5
  %169 = load i32, ptr %14, align 4, !tbaa !9
  %170 = sext i32 %169 to i64
  %171 = getelementptr inbounds float, ptr %168, i64 %170
  %172 = load float, ptr %171, align 4, !tbaa !24
  %173 = fpext float %172 to double
  %174 = load ptr, ptr %10, align 8, !tbaa !5
  %175 = getelementptr inbounds %struct.MTensor, ptr %174, i32 0, i32 4
  %176 = load ptr, ptr %175, align 8, !tbaa !23
  %177 = load i32, ptr %12, align 4, !tbaa !9
  %178 = sext i32 %177 to i64
  %179 = getelementptr inbounds ptr, ptr %176, i64 %178
  %180 = load ptr, ptr %179, align 8, !tbaa !5
  %181 = load i32, ptr %14, align 4, !tbaa !9
  %182 = sext i32 %181 to i64
  %183 = getelementptr inbounds float, ptr %180, i64 %182
  %184 = load float, ptr %183, align 4, !tbaa !24
  %185 = fpext float %184 to double
  %186 = load float, ptr %15, align 4, !tbaa !24
  %187 = fpext float %186 to double
  %188 = load float, ptr %16, align 4, !tbaa !24
  %189 = fpext float %188 to double
  %190 = call i32 (ptr, ...) @printf(ptr noundef @.str.10, ptr noundef %149, double noundef %161, double noundef %173, double noundef %185, double noundef %187, double noundef %189)
  br label %191

191:                                              ; preds = %146, %143, %94
  %192 = load ptr, ptr %5, align 8, !tbaa !5
  %193 = getelementptr inbounds %struct.TensorMulPara, ptr %192, i32 0, i32 2
  %194 = load i32, ptr %193, align 8, !tbaa !26
  %195 = icmp eq i32 %194, 1
  br i1 %195, label %196, label %230

196:                                              ; preds = %191
  %197 = load ptr, ptr %5, align 8, !tbaa !5
  %198 = getelementptr inbounds %struct.TensorMulPara, ptr %197, i32 0, i32 0
  %199 = load ptr, ptr %198, align 8, !tbaa !14
  %200 = getelementptr inbounds %struct.MLayer, ptr %199, i32 0, i32 5
  %201 = load i32, ptr %200, align 8, !tbaa !27
  %202 = icmp eq i32 %201, 0
  br i1 %202, label %203, label %215

203:                                              ; preds = %196
  %204 = load float, ptr %15, align 4, !tbaa !24
  %205 = load ptr, ptr %8, align 8, !tbaa !5
  %206 = getelementptr inbounds %struct.MTensor, ptr %205, i32 0, i32 4
  %207 = load ptr, ptr %206, align 8, !tbaa !23
  %208 = load i32, ptr %12, align 4, !tbaa !9
  %209 = sext i32 %208 to i64
  %210 = getelementptr inbounds ptr, ptr %207, i64 %209
  %211 = load ptr, ptr %210, align 8, !tbaa !5
  %212 = load i32, ptr %14, align 4, !tbaa !9
  %213 = sext i32 %212 to i64
  %214 = getelementptr inbounds float, ptr %211, i64 %213
  store float %204, ptr %214, align 4, !tbaa !24
  br label %229

215:                                              ; preds = %196
  %216 = load float, ptr %15, align 4, !tbaa !24
  %217 = load ptr, ptr %8, align 8, !tbaa !5
  %218 = getelementptr inbounds %struct.MTensor, ptr %217, i32 0, i32 4
  %219 = load ptr, ptr %218, align 8, !tbaa !23
  %220 = load i32, ptr %12, align 4, !tbaa !9
  %221 = sext i32 %220 to i64
  %222 = getelementptr inbounds ptr, ptr %219, i64 %221
  %223 = load ptr, ptr %222, align 8, !tbaa !5
  %224 = load i32, ptr %14, align 4, !tbaa !9
  %225 = sext i32 %224 to i64
  %226 = getelementptr inbounds float, ptr %223, i64 %225
  %227 = load float, ptr %226, align 4, !tbaa !24
  %228 = fadd float %227, %216
  store float %228, ptr %226, align 4, !tbaa !24
  br label %229

229:                                              ; preds = %215, %203
  br label %230

230:                                              ; preds = %229, %191
  %231 = load ptr, ptr %5, align 8, !tbaa !5
  %232 = getelementptr inbounds %struct.TensorMulPara, ptr %231, i32 0, i32 3
  %233 = load i32, ptr %232, align 4, !tbaa !28
  %234 = icmp eq i32 %233, 1
  br i1 %234, label %235, label %269

235:                                              ; preds = %230
  %236 = load ptr, ptr %5, align 8, !tbaa !5
  %237 = getelementptr inbounds %struct.TensorMulPara, ptr %236, i32 0, i32 1
  %238 = load ptr, ptr %237, align 8, !tbaa !17
  %239 = getelementptr inbounds %struct.MLayer, ptr %238, i32 0, i32 5
  %240 = load i32, ptr %239, align 8, !tbaa !27
  %241 = icmp eq i32 %240, 0
  br i1 %241, label %242, label %254

242:                                              ; preds = %235
  %243 = load float, ptr %16, align 4, !tbaa !24
  %244 = load ptr, ptr %9, align 8, !tbaa !5
  %245 = getelementptr inbounds %struct.MTensor, ptr %244, i32 0, i32 4
  %246 = load ptr, ptr %245, align 8, !tbaa !23
  %247 = load i32, ptr %12, align 4, !tbaa !9
  %248 = sext i32 %247 to i64
  %249 = getelementptr inbounds ptr, ptr %246, i64 %248
  %250 = load ptr, ptr %249, align 8, !tbaa !5
  %251 = load i32, ptr %14, align 4, !tbaa !9
  %252 = sext i32 %251 to i64
  %253 = getelementptr inbounds float, ptr %250, i64 %252
  store float %243, ptr %253, align 4, !tbaa !24
  br label %268

254:                                              ; preds = %235
  %255 = load float, ptr %16, align 4, !tbaa !24
  %256 = load ptr, ptr %9, align 8, !tbaa !5
  %257 = getelementptr inbounds %struct.MTensor, ptr %256, i32 0, i32 4
  %258 = load ptr, ptr %257, align 8, !tbaa !23
  %259 = load i32, ptr %12, align 4, !tbaa !9
  %260 = sext i32 %259 to i64
  %261 = getelementptr inbounds ptr, ptr %258, i64 %260
  %262 = load ptr, ptr %261, align 8, !tbaa !5
  %263 = load i32, ptr %14, align 4, !tbaa !9
  %264 = sext i32 %263 to i64
  %265 = getelementptr inbounds float, ptr %262, i64 %264
  %266 = load float, ptr %265, align 4, !tbaa !24
  %267 = fadd float %266, %255
  store float %267, ptr %265, align 4, !tbaa !24
  br label %268

268:                                              ; preds = %254, %242
  br label %269

269:                                              ; preds = %268, %230
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #4
  br label %270

270:                                              ; preds = %269
  %271 = load i32, ptr %14, align 4, !tbaa !9
  %272 = add nsw i32 %271, 1
  store i32 %272, ptr %14, align 4, !tbaa !9
  br label %89, !llvm.loop !29

273:                                              ; preds = %93
  br label %274

274:                                              ; preds = %273
  %275 = load i32, ptr %12, align 4, !tbaa !9
  %276 = add nsw i32 %275, 1
  store i32 %276, ptr %12, align 4, !tbaa !9
  br label %81, !llvm.loop !31

277:                                              ; preds = %87
  %278 = load ptr, ptr %5, align 8, !tbaa !5
  %279 = getelementptr inbounds %struct.TensorMulPara, ptr %278, i32 0, i32 2
  %280 = load i32, ptr %279, align 8, !tbaa !26
  %281 = icmp eq i32 %280, 1
  br i1 %281, label %282, label %287

282:                                              ; preds = %277
  %283 = load ptr, ptr %5, align 8, !tbaa !5
  %284 = getelementptr inbounds %struct.TensorMulPara, ptr %283, i32 0, i32 0
  %285 = load ptr, ptr %284, align 8, !tbaa !14
  %286 = getelementptr inbounds %struct.MLayer, ptr %285, i32 0, i32 5
  store i32 1, ptr %286, align 8, !tbaa !27
  br label %287

287:                                              ; preds = %282, %277
  %288 = load ptr, ptr %5, align 8, !tbaa !5
  %289 = getelementptr inbounds %struct.TensorMulPara, ptr %288, i32 0, i32 3
  %290 = load i32, ptr %289, align 4, !tbaa !28
  %291 = icmp eq i32 %290, 1
  br i1 %291, label %292, label %297

292:                                              ; preds = %287
  %293 = load ptr, ptr %5, align 8, !tbaa !5
  %294 = getelementptr inbounds %struct.TensorMulPara, ptr %293, i32 0, i32 1
  %295 = load ptr, ptr %294, align 8, !tbaa !17
  %296 = getelementptr inbounds %struct.MLayer, ptr %295, i32 0, i32 5
  store i32 1, ptr %296, align 8, !tbaa !27
  br label %297

297:                                              ; preds = %292, %287
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #4
  ret void
}

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "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 willreturn memory(read) "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 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
attributes #5 = { nounwind willreturn memory(read) }

!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/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !10, i64 32}
!12 = !{!"MLayer", !7, i64 0, !10, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !10, i64 64}
!13 = !{!12, !6, i64 56}
!14 = !{!15, !6, i64 0}
!15 = !{!"TensorMulPara", !6, i64 0, !6, i64 8, !10, i64 16, !10, i64 20}
!16 = !{!12, !6, i64 40}
!17 = !{!15, !6, i64 8}
!18 = !{!12, !6, i64 48}
!19 = !{!20, !10, i64 8}
!20 = !{!"MTensor", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !6, i64 16, !10, i64 24}
!21 = !{!20, !10, i64 12}
!22 = !{!20, !10, i64 0}
!23 = !{!20, !6, i64 16}
!24 = !{!25, !25, i64 0}
!25 = !{!"float", !7, i64 0}
!26 = !{!15, !10, i64 16}
!27 = !{!12, !10, i64 64}
!28 = !{!15, !10, i64 20}
!29 = distinct !{!29, !30}
!30 = !{!"llvm.loop.mustprogress"}
!31 = distinct !{!31, !30}


; 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.TensorRegister = type { [32 x i8], ptr, ptr, ptr }

@.str.1 = external hidden unnamed_addr constant [91 x i8], align 1
@morn_tensor_register = external global [256 x %struct.TensorRegister], align 16
@.str.7 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [19 x i8], align 1
@__FUNCTION__.mTensorMulBackward = external hidden unnamed_addr constant [19 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [56 x i8], align 1

declare void @m_Exception(i32 noundef, i32 noundef, ptr noundef, i32 noundef, ptr noundef, ptr noundef, ...) local_unnamed_addr #0

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
define dso_local void @mTensorMulBackward(ptr noundef %0) local_unnamed_addr #2 {
  %magicptr = ptrtoint ptr %0 to i64
  switch i64 %magicptr, label %7 [
    i64 -1, label %2
    i64 0, label %2
  ]

2:                                                ; preds = %1, %1
  %3 = icmp eq ptr %0, null
  %4 = icmp eq ptr %0, inttoptr (i64 -1 to ptr)
  %5 = or i1 %3, %4
  %6 = zext i1 %5 to i32
  tail call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef %6, i32 noundef -1, ptr noundef nonnull @.str.1, i32 noundef 79, ptr noundef nonnull @__FUNCTION__.mTensorMulBackward, ptr noundef nonnull @.str.7) #4
  br label %7

7:                                                ; preds = %1, %2
  %8 = getelementptr inbounds i8, ptr %0, i64 32
  %9 = load i32, ptr %8, align 8, !tbaa !5
  %10 = sext i32 %9 to i64
  %11 = getelementptr inbounds [256 x %struct.TensorRegister], ptr @morn_tensor_register, i64 0, i64 %10
  %12 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) @.str.8, ptr noundef nonnull dereferenceable(1) %11) #5
  %.not = icmp eq i32 %12, 0
  br i1 %.not, label %14, label %13

13:                                               ; preds = %7
  tail call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef %12, i32 noundef -1, ptr noundef nonnull @.str.1, i32 noundef 80, ptr noundef nonnull @__FUNCTION__.mTensorMulBackward, ptr noundef nonnull @.str.9) #4
  br label %14

14:                                               ; preds = %13, %7
  %15 = getelementptr inbounds i8, ptr %0, i64 56
  %16 = load ptr, ptr %15, align 8, !tbaa !11
  %17 = getelementptr inbounds i8, ptr %16, i64 8
  %18 = getelementptr inbounds i8, ptr %0, i64 48
  %19 = load ptr, ptr %18, align 8, !tbaa !12
  %20 = getelementptr inbounds i8, ptr %19, i64 8
  %21 = load i32, ptr %20, align 8, !tbaa !13
  %22 = getelementptr inbounds i8, ptr %19, i64 12
  %23 = load i32, ptr %22, align 4, !tbaa !15
  %24 = mul i32 %23, %21
  %25 = load i32, ptr %19, align 8, !tbaa !16
  %26 = icmp sgt i32 %25, 0
  br i1 %26, label %.preheader.lr.ph, label %._crit_edge75

.preheader.lr.ph:                                 ; preds = %14
  %27 = load ptr, ptr %17, align 8, !tbaa !17
  %28 = getelementptr inbounds i8, ptr %27, i64 48
  %29 = load ptr, ptr %28, align 8, !tbaa !12
  %30 = load ptr, ptr %16, align 8, !tbaa !19
  %31 = getelementptr inbounds i8, ptr %30, i64 48
  %32 = load ptr, ptr %31, align 8, !tbaa !12
  %33 = getelementptr inbounds i8, ptr %27, i64 40
  %34 = load ptr, ptr %33, align 8, !tbaa !20
  %35 = getelementptr inbounds i8, ptr %30, i64 40
  %36 = load ptr, ptr %35, align 8, !tbaa !20
  %37 = icmp sgt i32 %24, 0
  %38 = getelementptr inbounds i8, ptr %19, i64 16
  %39 = getelementptr inbounds i8, ptr %34, i64 16
  %40 = getelementptr inbounds i8, ptr %36, i64 16
  %41 = getelementptr inbounds i8, ptr %16, i64 16
  %42 = getelementptr inbounds i8, ptr %32, i64 16
  %43 = getelementptr inbounds i8, ptr %16, i64 20
  %44 = getelementptr inbounds i8, ptr %29, i64 16
  br i1 %37, label %.preheader.us.preheader, label %._crit_edge75

.preheader.us.preheader:                          ; preds = %.preheader.lr.ph
  %wide.trip.count = zext nneg i32 %24 to i64
  br label %.preheader.us

.preheader.us:                                    ; preds = %.preheader.us.preheader, %._crit_edge.us
  %indvars.iv78 = phi i64 [ 0, %.preheader.us.preheader ], [ %indvars.iv.next79, %._crit_edge.us ]
  %45 = icmp eq i64 %indvars.iv78, 0
  br label %46

46:                                               ; preds = %.preheader.us, %102
  %indvars.iv = phi i64 [ 0, %.preheader.us ], [ %indvars.iv.next, %102 ]
  %47 = load ptr, ptr %38, align 8, !tbaa !21
  %48 = getelementptr inbounds ptr, ptr %47, i64 %indvars.iv78
  %49 = load ptr, ptr %48, align 8, !tbaa !22
  %50 = getelementptr inbounds float, ptr %49, i64 %indvars.iv
  %51 = load float, ptr %50, align 4, !tbaa !23
  %52 = load ptr, ptr %39, align 8, !tbaa !21
  %53 = getelementptr inbounds ptr, ptr %52, i64 %indvars.iv78
  %54 = load ptr, ptr %53, align 8, !tbaa !22
  %55 = getelementptr inbounds float, ptr %54, i64 %indvars.iv
  %56 = load float, ptr %55, align 4, !tbaa !23
  %57 = fmul float %51, %56
  %58 = load ptr, ptr %40, align 8, !tbaa !21
  %59 = getelementptr inbounds ptr, ptr %58, i64 %indvars.iv78
  %60 = load ptr, ptr %59, align 8, !tbaa !22
  %61 = getelementptr inbounds float, ptr %60, i64 %indvars.iv
  %62 = load float, ptr %61, align 4, !tbaa !23
  %63 = fmul float %51, %62
  %64 = icmp eq i64 %indvars.iv, 100
  %or.cond.us = and i1 %45, %64
  br i1 %or.cond.us, label %65, label %72

65:                                               ; preds = %46
  %66 = fpext float %62 to double
  %67 = fpext float %56 to double
  %68 = fpext float %51 to double
  %69 = fpext float %57 to double
  %70 = fpext float %63 to double
  %71 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.10, ptr noundef %0, double noundef %66, double noundef %67, double noundef %68, double noundef %69, double noundef %70)
  br label %72

72:                                               ; preds = %65, %46
  %73 = load i32, ptr %41, align 8, !tbaa !25
  %74 = icmp eq i32 %73, 1
  br i1 %74, label %75, label %87

75:                                               ; preds = %72
  %76 = load ptr, ptr %16, align 8, !tbaa !19
  %77 = getelementptr inbounds i8, ptr %76, i64 64
  %78 = load i32, ptr %77, align 8, !tbaa !26
  %79 = icmp eq i32 %78, 0
  %80 = load ptr, ptr %42, align 8, !tbaa !21
  %81 = getelementptr inbounds ptr, ptr %80, i64 %indvars.iv78
  %82 = load ptr, ptr %81, align 8, !tbaa !22
  %83 = getelementptr inbounds float, ptr %82, i64 %indvars.iv
  br i1 %79, label %.sink.split, label %84

84:                                               ; preds = %75
  %85 = load float, ptr %83, align 4, !tbaa !23
  %86 = fadd float %57, %85
  br label %.sink.split

.sink.split:                                      ; preds = %75, %84
  %.sink = phi float [ %86, %84 ], [ %57, %75 ]
  store float %.sink, ptr %83, align 4, !tbaa !23
  br label %87

87:                                               ; preds = %.sink.split, %72
  %88 = load i32, ptr %43, align 4, !tbaa !27
  %89 = icmp eq i32 %88, 1
  br i1 %89, label %90, label %102

90:                                               ; preds = %87
  %91 = load ptr, ptr %17, align 8, !tbaa !17
  %92 = getelementptr inbounds i8, ptr %91, i64 64
  %93 = load i32, ptr %92, align 8, !tbaa !26
  %94 = icmp eq i32 %93, 0
  %95 = load ptr, ptr %44, align 8, !tbaa !21
  %96 = getelementptr inbounds ptr, ptr %95, i64 %indvars.iv78
  %97 = load ptr, ptr %96, align 8, !tbaa !22
  %98 = getelementptr inbounds float, ptr %97, i64 %indvars.iv
  br i1 %94, label %.sink.split81, label %99

99:                                               ; preds = %90
  %100 = load float, ptr %98, align 4, !tbaa !23
  %101 = fadd float %63, %100
  br label %.sink.split81

.sink.split81:                                    ; preds = %90, %99
  %.sink82 = phi float [ %101, %99 ], [ %63, %90 ]
  store float %.sink82, ptr %98, align 4, !tbaa !23
  br label %102

102:                                              ; preds = %.sink.split81, %87
  %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.us, label %46, !llvm.loop !28

._crit_edge.us:                                   ; preds = %102
  %indvars.iv.next79 = add nuw nsw i64 %indvars.iv78, 1
  %103 = load i32, ptr %19, align 8, !tbaa !16
  %104 = sext i32 %103 to i64
  %105 = icmp slt i64 %indvars.iv.next79, %104
  br i1 %105, label %.preheader.us, label %._crit_edge75, !llvm.loop !30

._crit_edge75:                                    ; preds = %._crit_edge.us, %.preheader.lr.ph, %14
  %106 = getelementptr inbounds i8, ptr %16, i64 16
  %107 = load i32, ptr %106, align 8, !tbaa !25
  %108 = icmp eq i32 %107, 1
  br i1 %108, label %109, label %112

109:                                              ; preds = %._crit_edge75
  %110 = load ptr, ptr %16, align 8, !tbaa !19
  %111 = getelementptr inbounds i8, ptr %110, i64 64
  store i32 1, ptr %111, align 8, !tbaa !26
  br label %112

112:                                              ; preds = %109, %._crit_edge75
  %113 = getelementptr inbounds i8, ptr %16, i64 20
  %114 = load i32, ptr %113, align 4, !tbaa !27
  %115 = icmp eq i32 %114, 1
  br i1 %115, label %116, label %119

116:                                              ; preds = %112
  %117 = load ptr, ptr %17, align 8, !tbaa !17
  %118 = getelementptr inbounds i8, ptr %117, i64 64
  store i32 1, ptr %118, align 8, !tbaa !26
  br label %119

119:                                              ; preds = %116, %112
  ret void
}

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

attributes #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 nofree nounwind willreturn memory(argmem: read) "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 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 #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 = { nounwind }
attributes #5 = { nounwind willreturn memory(read) }

!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, !9, i64 32}
!6 = !{!"MLayer", !7, i64 0, !9, i64 32, !10, i64 40, !10, i64 48, !10, i64 56, !9, i64 64}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!"int", !7, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!6, !10, i64 56}
!12 = !{!6, !10, i64 48}
!13 = !{!14, !9, i64 8}
!14 = !{!"MTensor", !9, i64 0, !9, i64 4, !9, i64 8, !9, i64 12, !10, i64 16, !9, i64 24}
!15 = !{!14, !9, i64 12}
!16 = !{!14, !9, i64 0}
!17 = !{!18, !10, i64 8}
!18 = !{!"TensorMulPara", !10, i64 0, !10, i64 8, !9, i64 16, !9, i64 20}
!19 = !{!18, !10, i64 0}
!20 = !{!6, !10, i64 40}
!21 = !{!14, !10, i64 16}
!22 = !{!10, !10, i64 0}
!23 = !{!24, !24, i64 0}
!24 = !{!"float", !7, i64 0}
!25 = !{!18, !9, i64 16}
!26 = !{!6, !9, i64 64}
!27 = !{!18, !9, i64 20}
!28 = distinct !{!28, !29}
!29 = !{!"llvm.loop.mustprogress"}
!30 = distinct !{!30, !29}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass