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

; 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.MLayer = type { [32 x i8], i32, ptr, ptr, ptr, i32 }
%struct.TensorConvPara = type { ptr, i32, i32, i32, i32, i32, i32, float, float, float }
%struct.MHandle = type { i32, i32, ptr, ptr }
%struct.MTensor = type { i32, i32, i32, i32, ptr, i32 }
%struct.HandleTensorConv = type { ptr, ptr, ptr }
%struct.MMemoryBlock = type { i32, i32, ptr, ptr, ptr, i32 }

@.str.1 = external hidden unnamed_addr constant [92 x i8], align 1
@morn_network_parafile = external global ptr, align 8
@.str.17 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [14 x i8], align 1
@__FUNCTION__.mTensorConvBackward = external hidden unnamed_addr constant [20 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [19 x i8], align 1
@morn_network_time = external global i32, align 4
@morn_network_save = external global i32, align 4
@morn_network_error = external global float, align 4
@morn_network_error_thresh = external global float, align 4
@morn_network_time_max = external global i32, align 4

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #0

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

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

; Function Attrs: nounwind uwtable
declare dso_local void @ConvTensorToMatData(ptr noundef, i32 noundef, ptr noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef) #2

; Function Attrs: nounwind uwtable
declare dso_local void @ConvMatDataToTensor(ptr noundef, ptr noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef) #2

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

; Function Attrs: nounwind uwtable
declare dso_local void @endTensorConv(ptr noundef) #2

declare ptr @GetHandle(ptr noundef, i32 noundef, i32 noundef, ptr noundef) #3

; Function Attrs: nounwind
declare i32 @sprintf(ptr noundef, ptr noundef, ...) #4

declare i32 @m_Hash(ptr noundef, i32 noundef) #3

declare void @mSgemm(i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, float noundef, ptr noundef, i32 noundef, ptr noundef, i32 noundef, float noundef, ptr noundef, i32 noundef) #3

declare ptr @mTensorMemory(ptr noundef, i32 noundef) #3

; Function Attrs: nounwind uwtable
define dso_local void @mTensorConvBackward(ptr noundef %0) #2 {
  %2 = alloca ptr, align 8
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  %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 i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca [64 x i8], align 16
  %14 = alloca ptr, align 8
  %15 = alloca float, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  br label %18

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

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

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

30:                                               ; preds = %25
  %31 = load i32, ptr %3, align 4, !tbaa !9
  call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef %31, i32 noundef -1, ptr noundef @.str.1, i32 noundef 331, ptr noundef @__FUNCTION__.mTensorConvBackward, ptr noundef @.str.19)
  br label %32

32:                                               ; preds = %30, %25
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #6
  br label %33

33:                                               ; preds = %32
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #6
  %34 = load ptr, ptr %2, align 8, !tbaa !5
  %35 = getelementptr inbounds %struct.MLayer, ptr %34, i32 0, i32 4
  %36 = load ptr, ptr %35, align 8, !tbaa !11
  store ptr %36, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #6
  %37 = load ptr, ptr %4, align 8, !tbaa !5
  %38 = getelementptr inbounds %struct.TensorConvPara, ptr %37, i32 0, i32 0
  %39 = load ptr, ptr %38, align 8, !tbaa !13
  %40 = getelementptr inbounds %struct.MLayer, ptr %39, i32 0, i32 2
  %41 = load ptr, ptr %40, align 8, !tbaa !16
  store ptr %41, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #6
  %42 = load ptr, ptr %4, align 8, !tbaa !5
  %43 = getelementptr inbounds %struct.TensorConvPara, ptr %42, i32 0, i32 0
  %44 = load ptr, ptr %43, align 8, !tbaa !13
  %45 = getelementptr inbounds %struct.MLayer, ptr %44, i32 0, i32 3
  %46 = load ptr, ptr %45, align 8, !tbaa !17
  store ptr %46, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #6
  %47 = load ptr, ptr %2, align 8, !tbaa !5
  %48 = getelementptr inbounds %struct.MLayer, ptr %47, i32 0, i32 3
  %49 = load ptr, ptr %48, align 8, !tbaa !17
  store ptr %49, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #6
  %50 = load ptr, ptr %2, align 8, !tbaa !5
  %51 = getelementptr inbounds %struct.MLayer, ptr %50, i32 0, i32 2
  %52 = load ptr, ptr %51, align 8, !tbaa !16
  %53 = call ptr @GetHandle(ptr noundef %52, i32 noundef 24, i32 noundef -1870146660, ptr noundef @endTensorConv)
  store ptr %53, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #6
  %54 = load ptr, ptr %8, align 8, !tbaa !5
  %55 = getelementptr inbounds %struct.MHandle, ptr %54, i32 0, i32 3
  %56 = load ptr, ptr %55, align 8, !tbaa !18
  store ptr %56, ptr %9, align 8, !tbaa !5
  br label %57

57:                                               ; preds = %33
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  %58 = load ptr, ptr %8, align 8, !tbaa !5
  %59 = getelementptr inbounds %struct.MHandle, ptr %58, i32 0, i32 1
  %60 = load volatile i32, ptr %59, align 4, !tbaa !20
  %61 = icmp eq i32 %60, 0
  %62 = zext i1 %61 to i32
  store i32 %62, ptr %10, align 4, !tbaa !9
  %63 = load i32, ptr %10, align 4, !tbaa !9
  %64 = icmp ne i32 %63, 0
  br i1 %64, label %65, label %67

65:                                               ; preds = %57
  %66 = load i32, ptr %10, align 4, !tbaa !9
  call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef %66, i32 noundef -1, ptr noundef @.str.1, i32 noundef 339, ptr noundef @__FUNCTION__.mTensorConvBackward, ptr noundef @.str.20)
  br label %67

67:                                               ; preds = %65, %57
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  br label %68

68:                                               ; preds = %67
  br label %69

69:                                               ; preds = %68
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  %70 = load ptr, ptr %7, align 8, !tbaa !5
  %71 = getelementptr inbounds %struct.MTensor, ptr %70, i32 0, i32 2
  %72 = load i32, ptr %71, align 8, !tbaa !21
  %73 = load ptr, ptr %7, align 8, !tbaa !5
  %74 = getelementptr inbounds %struct.MTensor, ptr %73, i32 0, i32 3
  %75 = load i32, ptr %74, align 4, !tbaa !23
  %76 = mul nsw i32 %72, %75
  store i32 %76, ptr %11, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  %77 = load ptr, ptr %4, align 8, !tbaa !5
  %78 = getelementptr inbounds %struct.TensorConvPara, ptr %77, i32 0, i32 2
  %79 = load i32, ptr %78, align 4, !tbaa !24
  %80 = load ptr, ptr %4, align 8, !tbaa !5
  %81 = getelementptr inbounds %struct.TensorConvPara, ptr %80, i32 0, i32 3
  %82 = load i32, ptr %81, align 8, !tbaa !25
  %83 = mul nsw i32 %79, %82
  %84 = load ptr, ptr %5, align 8, !tbaa !5
  %85 = getelementptr inbounds %struct.MTensor, ptr %84, i32 0, i32 1
  %86 = load i32, ptr %85, align 4, !tbaa !26
  %87 = mul nsw i32 %83, %86
  %88 = add nsw i32 %87, 1
  store i32 %88, ptr %12, align 4, !tbaa !9
  br label %89

89:                                               ; preds = %69
  %90 = load i32, ptr @morn_network_time, align 4, !tbaa !9
  %91 = load i32, ptr @morn_network_save, align 4, !tbaa !9
  %92 = srem i32 %90, %91
  %93 = icmp eq i32 %92, 0
  br i1 %93, label %94, label %97

94:                                               ; preds = %89
  %95 = load i32, ptr @morn_network_time, align 4, !tbaa !9
  %96 = icmp sgt i32 %95, 0
  br i1 %96, label %106, label %97

97:                                               ; preds = %94, %89
  %98 = load float, ptr @morn_network_error, align 4, !tbaa !27
  %99 = load float, ptr @morn_network_error_thresh, align 4, !tbaa !27
  %100 = fcmp ole float %98, %99
  br i1 %100, label %106, label %101

101:                                              ; preds = %97
  %102 = load float, ptr @morn_network_error, align 4, !tbaa !27
  %103 = load i32, ptr @morn_network_time_max, align 4, !tbaa !9
  %104 = sitofp i32 %103 to float
  %105 = fcmp oeq float %102, %104
  br i1 %105, label %106, label %130

106:                                              ; preds = %101, %97, %94
  call void @llvm.lifetime.start.p0(i64 64, ptr %13) #6
  %107 = getelementptr inbounds [64 x i8], ptr %13, i64 0, i64 0
  %108 = load ptr, ptr %2, align 8, !tbaa !5
  %109 = getelementptr inbounds %struct.MLayer, ptr %108, i32 0, i32 0
  %110 = getelementptr inbounds [32 x i8], ptr %109, i64 0, i64 0
  %111 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef %107, ptr noundef @.str.17, ptr noundef %110, ptr noundef @.str.18) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #6
  %112 = load ptr, ptr %9, align 8, !tbaa !5
  %113 = getelementptr inbounds %struct.HandleTensorConv, ptr %112, i32 0, i32 1
  %114 = load ptr, ptr %113, align 8, !tbaa !28
  %115 = getelementptr inbounds %struct.MMemoryBlock, ptr %114, i32 0, i32 2
  %116 = load ptr, ptr %115, align 8, !tbaa !30
  store ptr %116, ptr %14, align 8, !tbaa !5
  %117 = load ptr, ptr @morn_network_parafile, align 8, !tbaa !5
  %118 = getelementptr inbounds [64 x i8], ptr %13, i64 0, i64 0
  %119 = getelementptr inbounds i8, ptr %118, i64 0
  %120 = call i32 @m_Hash(ptr noundef %119, i32 noundef -1)
  %121 = load ptr, ptr %4, align 8, !tbaa !5
  %122 = getelementptr inbounds %struct.TensorConvPara, ptr %121, i32 0, i32 1
  %123 = load i32, ptr %122, align 8, !tbaa !32
  %124 = load i32, ptr %12, align 4, !tbaa !9
  %125 = mul nsw i32 %123, %124
  %126 = sext i32 %125 to i64
  %127 = mul i64 %126, 4
  %128 = trunc i64 %127 to i32
  %129 = call i32 @mMORNWrite(ptr noundef %117, i32 noundef %120, ptr noundef %14, i32 noundef 1, i32 noundef %128)
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 64, ptr %13) #6
  br label %130

130:                                              ; preds = %106, %101
  br label %131

131:                                              ; preds = %130
  br label %132

132:                                              ; preds = %131
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #6
  %133 = load ptr, ptr %4, align 8, !tbaa !5
  %134 = getelementptr inbounds %struct.TensorConvPara, ptr %133, i32 0, i32 9
  %135 = load float, ptr %134, align 8, !tbaa !33
  store float %135, ptr %15, align 4, !tbaa !27
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #6
  store i32 0, ptr %16, align 4, !tbaa !9
  br label %136

136:                                              ; preds = %181, %132
  %137 = load i32, ptr %16, align 4, !tbaa !9
  %138 = load ptr, ptr %7, align 8, !tbaa !5
  %139 = getelementptr inbounds %struct.MTensor, ptr %138, i32 0, i32 0
  %140 = load i32, ptr %139, align 8, !tbaa !34
  %141 = icmp slt i32 %137, %140
  br i1 %141, label %143, label %142

142:                                              ; preds = %136
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #6
  br label %184

143:                                              ; preds = %136
  %144 = load ptr, ptr %5, align 8, !tbaa !5
  %145 = load i32, ptr %16, align 4, !tbaa !9
  %146 = load ptr, ptr %9, align 8, !tbaa !5
  %147 = getelementptr inbounds %struct.HandleTensorConv, ptr %146, i32 0, i32 0
  %148 = load ptr, ptr %147, align 8, !tbaa !35
  %149 = getelementptr inbounds %struct.MMemoryBlock, ptr %148, i32 0, i32 2
  %150 = load ptr, ptr %149, align 8, !tbaa !30
  %151 = load ptr, ptr %4, align 8, !tbaa !5
  %152 = getelementptr inbounds %struct.TensorConvPara, ptr %151, i32 0, i32 2
  %153 = load i32, ptr %152, align 4, !tbaa !24
  %154 = load ptr, ptr %4, align 8, !tbaa !5
  %155 = getelementptr inbounds %struct.TensorConvPara, ptr %154, i32 0, i32 3
  %156 = load i32, ptr %155, align 8, !tbaa !25
  %157 = load ptr, ptr %4, align 8, !tbaa !5
  %158 = getelementptr inbounds %struct.TensorConvPara, ptr %157, i32 0, i32 5
  %159 = load i32, ptr %158, align 8, !tbaa !36
  %160 = load ptr, ptr %4, align 8, !tbaa !5
  %161 = getelementptr inbounds %struct.TensorConvPara, ptr %160, i32 0, i32 4
  %162 = load i32, ptr %161, align 4, !tbaa !37
  call void @ConvTensorToMatData(ptr noundef %144, i32 noundef %145, ptr noundef %150, i32 noundef %153, i32 noundef %156, i32 noundef %159, i32 noundef %162)
  %163 = load ptr, ptr %4, align 8, !tbaa !5
  %164 = getelementptr inbounds %struct.TensorConvPara, ptr %163, i32 0, i32 1
  %165 = load i32, ptr %164, align 8, !tbaa !32
  %166 = load i32, ptr %12, align 4, !tbaa !9
  %167 = load i32, ptr %11, align 4, !tbaa !9
  %168 = load ptr, ptr %7, align 8, !tbaa !5
  %169 = load i32, ptr %16, align 4, !tbaa !9
  %170 = call ptr @mTensorMemory(ptr noundef %168, i32 noundef %169)
  %171 = load i32, ptr %11, align 4, !tbaa !9
  %172 = load ptr, ptr %9, align 8, !tbaa !5
  %173 = getelementptr inbounds %struct.HandleTensorConv, ptr %172, i32 0, i32 0
  %174 = load ptr, ptr %173, align 8, !tbaa !35
  %175 = load i32, ptr %11, align 4, !tbaa !9
  %176 = load float, ptr %15, align 4, !tbaa !27
  %177 = load ptr, ptr %9, align 8, !tbaa !5
  %178 = getelementptr inbounds %struct.HandleTensorConv, ptr %177, i32 0, i32 2
  %179 = load ptr, ptr %178, align 8, !tbaa !38
  %180 = load i32, ptr %12, align 4, !tbaa !9
  call void @mSgemm(i32 noundef 0, i32 noundef 1, i32 noundef %165, i32 noundef %166, i32 noundef %167, float noundef 1.000000e+00, ptr noundef %170, i32 noundef %171, ptr noundef %174, i32 noundef %175, float noundef %176, ptr noundef %179, i32 noundef %180)
  store float 1.000000e+00, ptr %15, align 4, !tbaa !27
  br label %181

181:                                              ; preds = %143
  %182 = load i32, ptr %16, align 4, !tbaa !9
  %183 = add nsw i32 %182, 1
  store i32 %183, ptr %16, align 4, !tbaa !9
  br label %136, !llvm.loop !39

184:                                              ; preds = %142
  %185 = load ptr, ptr %4, align 8, !tbaa !5
  %186 = getelementptr inbounds %struct.TensorConvPara, ptr %185, i32 0, i32 6
  %187 = load i32, ptr %186, align 4, !tbaa !41
  %188 = icmp ne i32 %187, 0
  br i1 %188, label %189, label %270

189:                                              ; preds = %184
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #6
  store i32 0, ptr %17, align 4, !tbaa !9
  br label %190

190:                                              ; preds = %262, %189
  %191 = load i32, ptr %17, align 4, !tbaa !9
  %192 = load ptr, ptr %5, align 8, !tbaa !5
  %193 = getelementptr inbounds %struct.MTensor, ptr %192, i32 0, i32 0
  %194 = load i32, ptr %193, align 8, !tbaa !34
  %195 = icmp slt i32 %191, %194
  br i1 %195, label %197, label %196

196:                                              ; preds = %190
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #6
  br label %265

197:                                              ; preds = %190
  %198 = load ptr, ptr %4, align 8, !tbaa !5
  %199 = getelementptr inbounds %struct.TensorConvPara, ptr %198, i32 0, i32 0
  %200 = load ptr, ptr %199, align 8, !tbaa !13
  %201 = getelementptr inbounds %struct.MLayer, ptr %200, i32 0, i32 5
  %202 = load i32, ptr %201, align 8, !tbaa !42
  %203 = icmp eq i32 %202, 0
  br i1 %203, label %204, label %225

204:                                              ; preds = %197
  %205 = load ptr, ptr %6, align 8, !tbaa !5
  %206 = getelementptr inbounds %struct.MTensor, ptr %205, i32 0, i32 4
  %207 = load ptr, ptr %206, align 8, !tbaa !43
  %208 = load i32, ptr %17, 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 ptr, ptr %5, align 8, !tbaa !5
  %213 = getelementptr inbounds %struct.MTensor, ptr %212, i32 0, i32 2
  %214 = load i32, ptr %213, align 8, !tbaa !21
  %215 = load ptr, ptr %5, align 8, !tbaa !5
  %216 = getelementptr inbounds %struct.MTensor, ptr %215, i32 0, i32 3
  %217 = load i32, ptr %216, align 4, !tbaa !23
  %218 = mul nsw i32 %214, %217
  %219 = load ptr, ptr %5, align 8, !tbaa !5
  %220 = getelementptr inbounds %struct.MTensor, ptr %219, i32 0, i32 1
  %221 = load i32, ptr %220, align 4, !tbaa !26
  %222 = mul nsw i32 %218, %221
  %223 = sext i32 %222 to i64
  %224 = mul i64 %223, 4
  call void @llvm.memset.p0.i64(ptr align 4 %211, i8 0, i64 %224, i1 false)
  br label %225

225:                                              ; preds = %204, %197
  %226 = load i32, ptr %12, align 4, !tbaa !9
  %227 = load i32, ptr %11, align 4, !tbaa !9
  %228 = load ptr, ptr %4, align 8, !tbaa !5
  %229 = getelementptr inbounds %struct.TensorConvPara, ptr %228, i32 0, i32 1
  %230 = load i32, ptr %229, align 8, !tbaa !32
  %231 = load ptr, ptr %9, align 8, !tbaa !5
  %232 = getelementptr inbounds %struct.HandleTensorConv, ptr %231, i32 0, i32 1
  %233 = load ptr, ptr %232, align 8, !tbaa !28
  %234 = load i32, ptr %12, align 4, !tbaa !9
  %235 = load ptr, ptr %7, align 8, !tbaa !5
  %236 = load i32, ptr %17, align 4, !tbaa !9
  %237 = call ptr @mTensorMemory(ptr noundef %235, i32 noundef %236)
  %238 = load i32, ptr %11, align 4, !tbaa !9
  %239 = load ptr, ptr %9, align 8, !tbaa !5
  %240 = getelementptr inbounds %struct.HandleTensorConv, ptr %239, i32 0, i32 0
  %241 = load ptr, ptr %240, align 8, !tbaa !35
  %242 = load i32, ptr %11, align 4, !tbaa !9
  call void @mSgemm(i32 noundef 1, i32 noundef 0, i32 noundef %226, i32 noundef %227, i32 noundef %230, float noundef 1.000000e+00, ptr noundef %233, i32 noundef %234, ptr noundef %237, i32 noundef %238, float noundef 0.000000e+00, ptr noundef %241, i32 noundef %242)
  %243 = load ptr, ptr %9, align 8, !tbaa !5
  %244 = getelementptr inbounds %struct.HandleTensorConv, ptr %243, i32 0, i32 0
  %245 = load ptr, ptr %244, align 8, !tbaa !35
  %246 = getelementptr inbounds %struct.MMemoryBlock, ptr %245, i32 0, i32 2
  %247 = load ptr, ptr %246, align 8, !tbaa !30
  %248 = load ptr, ptr %6, align 8, !tbaa !5
  %249 = load i32, ptr %17, align 4, !tbaa !9
  %250 = load ptr, ptr %4, align 8, !tbaa !5
  %251 = getelementptr inbounds %struct.TensorConvPara, ptr %250, i32 0, i32 2
  %252 = load i32, ptr %251, align 4, !tbaa !24
  %253 = load ptr, ptr %4, align 8, !tbaa !5
  %254 = getelementptr inbounds %struct.TensorConvPara, ptr %253, i32 0, i32 3
  %255 = load i32, ptr %254, align 8, !tbaa !25
  %256 = load ptr, ptr %4, align 8, !tbaa !5
  %257 = getelementptr inbounds %struct.TensorConvPara, ptr %256, i32 0, i32 5
  %258 = load i32, ptr %257, align 8, !tbaa !36
  %259 = load ptr, ptr %4, align 8, !tbaa !5
  %260 = getelementptr inbounds %struct.TensorConvPara, ptr %259, i32 0, i32 4
  %261 = load i32, ptr %260, align 4, !tbaa !37
  call void @ConvMatDataToTensor(ptr noundef %247, ptr noundef %248, i32 noundef %249, i32 noundef %252, i32 noundef %255, i32 noundef %258, i32 noundef %261)
  br label %262

262:                                              ; preds = %225
  %263 = load i32, ptr %17, align 4, !tbaa !9
  %264 = add nsw i32 %263, 1
  store i32 %264, ptr %17, align 4, !tbaa !9
  br label %190, !llvm.loop !44

265:                                              ; preds = %196
  %266 = load ptr, ptr %4, align 8, !tbaa !5
  %267 = getelementptr inbounds %struct.TensorConvPara, ptr %266, i32 0, i32 0
  %268 = load ptr, ptr %267, align 8, !tbaa !13
  %269 = getelementptr inbounds %struct.MLayer, ptr %268, i32 0, i32 5
  store i32 1, ptr %269, align 8, !tbaa !42
  br label %270

270:                                              ; preds = %265, %184
  %271 = load ptr, ptr %4, align 8, !tbaa !5
  %272 = getelementptr inbounds %struct.TensorConvPara, ptr %271, i32 0, i32 1
  %273 = load i32, ptr %272, align 8, !tbaa !32
  %274 = load i32, ptr %12, align 4, !tbaa !9
  %275 = mul nsw i32 %273, %274
  %276 = load ptr, ptr %4, align 8, !tbaa !5
  %277 = getelementptr inbounds %struct.TensorConvPara, ptr %276, i32 0, i32 7
  %278 = load float, ptr %277, align 8, !tbaa !45
  %279 = load ptr, ptr %5, align 8, !tbaa !5
  %280 = getelementptr inbounds %struct.MTensor, ptr %279, i32 0, i32 0
  %281 = load i32, ptr %280, align 8, !tbaa !34
  %282 = sitofp i32 %281 to float
  %283 = fdiv float %278, %282
  %284 = fsub float 0.000000e+00, %283
  %285 = load ptr, ptr %9, align 8, !tbaa !5
  %286 = getelementptr inbounds %struct.HandleTensorConv, ptr %285, i32 0, i32 2
  %287 = load ptr, ptr %286, align 8, !tbaa !38
  %288 = load ptr, ptr %4, align 8, !tbaa !5
  %289 = getelementptr inbounds %struct.TensorConvPara, ptr %288, i32 0, i32 8
  %290 = load float, ptr %289, align 4, !tbaa !46
  %291 = load ptr, ptr %4, align 8, !tbaa !5
  %292 = getelementptr inbounds %struct.TensorConvPara, ptr %291, i32 0, i32 7
  %293 = load float, ptr %292, align 8, !tbaa !45
  %294 = fneg float %290
  %295 = call float @llvm.fmuladd.f32(float %294, float %293, float 1.000000e+00)
  %296 = load ptr, ptr %9, align 8, !tbaa !5
  %297 = getelementptr inbounds %struct.HandleTensorConv, ptr %296, i32 0, i32 1
  %298 = load ptr, ptr %297, align 8, !tbaa !28
  call void @mSaxpby(i32 noundef %275, float noundef %284, ptr noundef %287, float noundef %295, ptr noundef %298)
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #6
  ret void
}

declare i32 @mMORNWrite(ptr noundef, i32 noundef, ptr noundef, i32 noundef, i32 noundef) #3

declare void @mSaxpby(i32 noundef, float noundef, ptr noundef, float noundef, ptr noundef) #3

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare float @llvm.fmuladd.f32(float, float, float) #5

attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { "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 "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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { 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/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !6, i64 56}
!12 = !{!"MLayer", !7, i64 0, !10, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !10, i64 64}
!13 = !{!14, !6, i64 0}
!14 = !{!"TensorConvPara", !6, i64 0, !10, i64 8, !10, i64 12, !10, i64 16, !10, i64 20, !10, i64 24, !10, i64 28, !15, i64 32, !15, i64 36, !15, i64 40}
!15 = !{!"float", !7, i64 0}
!16 = !{!12, !6, i64 40}
!17 = !{!12, !6, i64 48}
!18 = !{!19, !6, i64 16}
!19 = !{!"MHandle", !10, i64 0, !10, i64 4, !6, i64 8, !6, i64 16}
!20 = !{!19, !10, i64 4}
!21 = !{!22, !10, i64 8}
!22 = !{!"MTensor", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !6, i64 16, !10, i64 24}
!23 = !{!22, !10, i64 12}
!24 = !{!14, !10, i64 12}
!25 = !{!14, !10, i64 16}
!26 = !{!22, !10, i64 4}
!27 = !{!15, !15, i64 0}
!28 = !{!29, !6, i64 8}
!29 = !{!"HandleTensorConv", !6, i64 0, !6, i64 8, !6, i64 16}
!30 = !{!31, !6, i64 8}
!31 = !{!"MMemoryBlock", !10, i64 0, !10, i64 4, !6, i64 8, !6, i64 16, !6, i64 24, !10, i64 32}
!32 = !{!14, !10, i64 8}
!33 = !{!14, !15, i64 40}
!34 = !{!22, !10, i64 0}
!35 = !{!29, !6, i64 0}
!36 = !{!14, !10, i64 24}
!37 = !{!14, !10, i64 20}
!38 = !{!29, !6, i64 16}
!39 = distinct !{!39, !40}
!40 = !{!"llvm.loop.mustprogress"}
!41 = !{!14, !10, i64 28}
!42 = !{!12, !10, i64 64}
!43 = !{!22, !6, i64 16}
!44 = distinct !{!44, !40}
!45 = !{!14, !15, i64 32}
!46 = !{!14, !15, i64 36}


; 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"

@.str.1 = external hidden unnamed_addr constant [92 x i8], align 1
@morn_network_parafile = external local_unnamed_addr global ptr, align 8
@.str.17 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [14 x i8], align 1
@__FUNCTION__.mTensorConvBackward = external hidden unnamed_addr constant [20 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [19 x i8], align 1
@morn_network_time = external local_unnamed_addr global i32, align 4
@morn_network_save = external local_unnamed_addr global i32, align 4
@morn_network_error = external local_unnamed_addr global float, align 4
@morn_network_error_thresh = external local_unnamed_addr global float, align 4
@morn_network_time_max = external local_unnamed_addr global i32, align 4

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #0

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

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

; Function Attrs: nounwind uwtable
declare dso_local void @ConvTensorToMatData(ptr noundef, i32 noundef, ptr noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare dso_local void @ConvMatDataToTensor(ptr noundef, ptr noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #2

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

; Function Attrs: nounwind uwtable
declare dso_local void @endTensorConv(ptr noundef) #2

declare ptr @GetHandle(ptr noundef, i32 noundef, i32 noundef, ptr noundef) local_unnamed_addr #3

; Function Attrs: nofree nounwind
declare noundef i32 @sprintf(ptr noalias nocapture noundef writeonly, ptr nocapture noundef readonly, ...) local_unnamed_addr #4

declare i32 @m_Hash(ptr noundef, i32 noundef) local_unnamed_addr #3

declare void @mSgemm(i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, float noundef, ptr noundef, i32 noundef, ptr noundef, i32 noundef, float noundef, ptr noundef, i32 noundef) local_unnamed_addr #3

declare ptr @mTensorMemory(ptr noundef, i32 noundef) local_unnamed_addr #3

; Function Attrs: nounwind uwtable
define dso_local void @mTensorConvBackward(ptr noundef %0) local_unnamed_addr #2 {
  %2 = alloca [64 x i8], align 16
  %3 = alloca ptr, align 8
  %magicptr = ptrtoint ptr %0 to i64
  switch i64 %magicptr, label %9 [
    i64 -1, label %4
    i64 0, label %4
  ]

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

9:                                                ; preds = %1, %4
  %10 = getelementptr inbounds i8, ptr %0, i64 56
  %11 = load ptr, ptr %10, align 8, !tbaa !5
  %12 = load ptr, ptr %11, align 8, !tbaa !11
  %13 = getelementptr inbounds i8, ptr %12, i64 40
  %14 = load ptr, ptr %13, align 8, !tbaa !14
  %15 = getelementptr inbounds i8, ptr %12, i64 48
  %16 = load ptr, ptr %15, align 8, !tbaa !15
  %17 = getelementptr inbounds i8, ptr %0, i64 48
  %18 = load ptr, ptr %17, align 8, !tbaa !15
  %19 = getelementptr inbounds i8, ptr %0, i64 40
  %20 = load ptr, ptr %19, align 8, !tbaa !14
  %21 = tail call ptr @GetHandle(ptr noundef %20, i32 noundef 24, i32 noundef -1870146660, ptr noundef nonnull @endTensorConv) #6
  %22 = getelementptr inbounds i8, ptr %21, i64 16
  %23 = load ptr, ptr %22, align 8, !tbaa !16
  %24 = getelementptr inbounds i8, ptr %21, i64 4
  %25 = load volatile i32, ptr %24, align 4, !tbaa !18
  %26 = icmp eq i32 %25, 0
  br i1 %26, label %27, label %28

27:                                               ; preds = %9
  tail call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef 1, i32 noundef -1, ptr noundef nonnull @.str.1, i32 noundef 339, ptr noundef nonnull @__FUNCTION__.mTensorConvBackward, ptr noundef nonnull @.str.20) #6
  br label %28

28:                                               ; preds = %27, %9
  %29 = getelementptr inbounds i8, ptr %18, i64 8
  %30 = load i32, ptr %29, align 8, !tbaa !19
  %31 = getelementptr inbounds i8, ptr %18, i64 12
  %32 = load i32, ptr %31, align 4, !tbaa !21
  %33 = mul nsw i32 %32, %30
  %34 = getelementptr inbounds i8, ptr %11, i64 12
  %35 = load i32, ptr %34, align 4, !tbaa !22
  %36 = getelementptr inbounds i8, ptr %11, i64 16
  %37 = load i32, ptr %36, align 8, !tbaa !23
  %38 = mul nsw i32 %37, %35
  %39 = getelementptr inbounds i8, ptr %14, i64 4
  %40 = load i32, ptr %39, align 4, !tbaa !24
  %41 = mul nsw i32 %38, %40
  %42 = add nsw i32 %41, 1
  %43 = load i32, ptr @morn_network_time, align 4
  %44 = load i32, ptr @morn_network_save, align 4, !tbaa !25
  %45 = srem i32 %43, %44
  %46 = icmp eq i32 %45, 0
  %47 = icmp sgt i32 %43, 0
  %or.cond = and i1 %47, %46
  br i1 %or.cond, label %56, label %48

48:                                               ; preds = %28
  %49 = load float, ptr @morn_network_error, align 4, !tbaa !26
  %50 = load float, ptr @morn_network_error_thresh, align 4, !tbaa !26
  %51 = fcmp ugt float %49, %50
  br i1 %51, label %52, label %56

52:                                               ; preds = %48
  %53 = load i32, ptr @morn_network_time_max, align 4, !tbaa !25
  %54 = sitofp i32 %53 to float
  %55 = fcmp oeq float %49, %54
  br i1 %55, label %56, label %69

56:                                               ; preds = %28, %52, %48
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %2) #6
  %57 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef nonnull dereferenceable(1) %2, ptr noundef nonnull dereferenceable(1) @.str.17, ptr noundef nonnull %0, ptr noundef nonnull @.str.18) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #6
  %58 = getelementptr inbounds i8, ptr %23, i64 8
  %59 = load ptr, ptr %58, align 8, !tbaa !27
  %60 = getelementptr inbounds i8, ptr %59, i64 8
  %61 = load ptr, ptr %60, align 8, !tbaa !29
  store ptr %61, ptr %3, align 8, !tbaa !31
  %62 = load ptr, ptr @morn_network_parafile, align 8, !tbaa !31
  %63 = call i32 @m_Hash(ptr noundef nonnull %2, i32 noundef -1) #6
  %64 = getelementptr inbounds i8, ptr %11, i64 8
  %65 = load i32, ptr %64, align 8, !tbaa !32
  %66 = shl i32 %42, 2
  %67 = mul i32 %66, %65
  %68 = call i32 @mMORNWrite(ptr noundef %62, i32 noundef %63, ptr noundef nonnull %3, i32 noundef 1, i32 noundef %67) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #6
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %2) #6
  br label %69

69:                                               ; preds = %56, %52
  %70 = load i32, ptr %18, align 8, !tbaa !33
  %71 = icmp sgt i32 %70, 0
  br i1 %71, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %69
  %72 = getelementptr inbounds i8, ptr %11, i64 40
  %73 = load float, ptr %72, align 8, !tbaa !34
  %74 = getelementptr inbounds i8, ptr %11, i64 24
  %75 = getelementptr inbounds i8, ptr %11, i64 20
  %76 = getelementptr inbounds i8, ptr %11, i64 8
  %77 = getelementptr inbounds i8, ptr %23, i64 16
  %78 = load ptr, ptr %23, align 8, !tbaa !35
  %79 = getelementptr inbounds i8, ptr %78, i64 8
  %80 = load ptr, ptr %79, align 8, !tbaa !29
  %81 = load i32, ptr %34, align 4, !tbaa !22
  %82 = load i32, ptr %36, align 8, !tbaa !23
  %83 = load i32, ptr %74, align 8, !tbaa !36
  %84 = load i32, ptr %75, align 4, !tbaa !37
  call void @ConvTensorToMatData(ptr noundef nonnull %14, i32 noundef 0, ptr noundef %80, i32 noundef %81, i32 noundef %82, i32 noundef %83, i32 noundef %84)
  %85 = load i32, ptr %76, align 8, !tbaa !32
  %86 = call ptr @mTensorMemory(ptr noundef nonnull %18, i32 noundef 0) #6
  %87 = load ptr, ptr %23, align 8, !tbaa !35
  %88 = load ptr, ptr %77, align 8, !tbaa !38
  call void @mSgemm(i32 noundef 0, i32 noundef 1, i32 noundef %85, i32 noundef %42, i32 noundef %33, float noundef 1.000000e+00, ptr noundef %86, i32 noundef %33, ptr noundef %87, i32 noundef %33, float noundef %73, ptr noundef %88, i32 noundef %42) #6
  %89 = load i32, ptr %18, align 8, !tbaa !33
  %90 = icmp sgt i32 %89, 1
  br i1 %90, label %.peel.next, label %._crit_edge

._crit_edge:                                      ; preds = %.peel.next, %.lr.ph, %69
  %91 = getelementptr inbounds i8, ptr %11, i64 28
  %92 = load i32, ptr %91, align 4, !tbaa !39
  %.not = icmp eq i32 %92, 0
  %.pre = load i32, ptr %14, align 8, !tbaa !33
  br i1 %.not, label %150, label %.preheader

.preheader:                                       ; preds = %._crit_edge
  %93 = icmp sgt i32 %.pre, 0
  br i1 %93, label %.lr.ph86, label %._crit_edge87

.lr.ph86:                                         ; preds = %.preheader
  %94 = getelementptr inbounds i8, ptr %16, i64 16
  %95 = getelementptr inbounds i8, ptr %14, i64 8
  %96 = getelementptr inbounds i8, ptr %14, i64 12
  %97 = getelementptr inbounds i8, ptr %11, i64 8
  %98 = getelementptr inbounds i8, ptr %23, i64 8
  %99 = getelementptr inbounds i8, ptr %11, i64 24
  %100 = getelementptr inbounds i8, ptr %11, i64 20
  br label %118

.peel.next:                                       ; preds = %.lr.ph, %.peel.next
  %.08084 = phi i32 [ %112, %.peel.next ], [ 1, %.lr.ph ]
  %101 = load ptr, ptr %23, align 8, !tbaa !35
  %102 = getelementptr inbounds i8, ptr %101, i64 8
  %103 = load ptr, ptr %102, align 8, !tbaa !29
  %104 = load i32, ptr %34, align 4, !tbaa !22
  %105 = load i32, ptr %36, align 8, !tbaa !23
  %106 = load i32, ptr %74, align 8, !tbaa !36
  %107 = load i32, ptr %75, align 4, !tbaa !37
  call void @ConvTensorToMatData(ptr noundef %14, i32 noundef %.08084, ptr noundef %103, i32 noundef %104, i32 noundef %105, i32 noundef %106, i32 noundef %107)
  %108 = load i32, ptr %76, align 8, !tbaa !32
  %109 = call ptr @mTensorMemory(ptr noundef nonnull %18, i32 noundef %.08084) #6
  %110 = load ptr, ptr %23, align 8, !tbaa !35
  %111 = load ptr, ptr %77, align 8, !tbaa !38
  call void @mSgemm(i32 noundef 0, i32 noundef 1, i32 noundef %108, i32 noundef %42, i32 noundef %33, float noundef 1.000000e+00, ptr noundef %109, i32 noundef %33, ptr noundef %110, i32 noundef %33, float noundef 1.000000e+00, ptr noundef %111, i32 noundef %42) #6
  %112 = add nuw nsw i32 %.08084, 1
  %113 = load i32, ptr %18, align 8, !tbaa !33
  %114 = icmp slt i32 %112, %113
  br i1 %114, label %.peel.next, label %._crit_edge, !llvm.loop !40

._crit_edge87:                                    ; preds = %134, %.preheader
  %115 = phi i32 [ %.pre, %.preheader ], [ %147, %134 ]
  %116 = load ptr, ptr %11, align 8, !tbaa !11
  %117 = getelementptr inbounds i8, ptr %116, i64 64
  store i32 1, ptr %117, align 8, !tbaa !43
  br label %150

118:                                              ; preds = %.lr.ph86, %134
  %indvars.iv = phi i64 [ 0, %.lr.ph86 ], [ %indvars.iv.next, %134 ]
  %119 = load ptr, ptr %11, align 8, !tbaa !11
  %120 = getelementptr inbounds i8, ptr %119, i64 64
  %121 = load i32, ptr %120, align 8, !tbaa !43
  %122 = icmp eq i32 %121, 0
  br i1 %122, label %123, label %134

123:                                              ; preds = %118
  %124 = load ptr, ptr %94, align 8, !tbaa !44
  %125 = getelementptr inbounds ptr, ptr %124, i64 %indvars.iv
  %126 = load ptr, ptr %125, align 8, !tbaa !31
  %127 = load i32, ptr %95, align 8, !tbaa !19
  %128 = load i32, ptr %96, align 4, !tbaa !21
  %129 = mul nsw i32 %128, %127
  %130 = load i32, ptr %39, align 4, !tbaa !24
  %131 = mul nsw i32 %129, %130
  %132 = sext i32 %131 to i64
  %133 = shl nsw i64 %132, 2
  call void @llvm.memset.p0.i64(ptr align 4 %126, i8 0, i64 %133, i1 false)
  br label %134

134:                                              ; preds = %123, %118
  %135 = load i32, ptr %97, align 8, !tbaa !32
  %136 = load ptr, ptr %98, align 8, !tbaa !27
  %137 = trunc nuw nsw i64 %indvars.iv to i32
  %138 = call ptr @mTensorMemory(ptr noundef nonnull %18, i32 noundef %137) #6
  %139 = load ptr, ptr %23, align 8, !tbaa !35
  call void @mSgemm(i32 noundef 1, i32 noundef 0, i32 noundef %42, i32 noundef %33, i32 noundef %135, float noundef 1.000000e+00, ptr noundef %136, i32 noundef %42, ptr noundef %138, i32 noundef %33, float noundef 0.000000e+00, ptr noundef %139, i32 noundef %33) #6
  %140 = load ptr, ptr %23, align 8, !tbaa !35
  %141 = getelementptr inbounds i8, ptr %140, i64 8
  %142 = load ptr, ptr %141, align 8, !tbaa !29
  %143 = load i32, ptr %34, align 4, !tbaa !22
  %144 = load i32, ptr %36, align 8, !tbaa !23
  %145 = load i32, ptr %99, align 8, !tbaa !36
  %146 = load i32, ptr %100, align 4, !tbaa !37
  call void @ConvMatDataToTensor(ptr noundef %142, ptr noundef %16, i32 noundef %137, i32 noundef %143, i32 noundef %144, i32 noundef %145, i32 noundef %146)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %147 = load i32, ptr %14, align 8, !tbaa !33
  %148 = sext i32 %147 to i64
  %149 = icmp slt i64 %indvars.iv.next, %148
  br i1 %149, label %118, label %._crit_edge87, !llvm.loop !45

150:                                              ; preds = %._crit_edge87, %._crit_edge
  %151 = phi i32 [ %115, %._crit_edge87 ], [ %.pre, %._crit_edge ]
  %152 = getelementptr inbounds i8, ptr %11, i64 8
  %153 = load i32, ptr %152, align 8, !tbaa !32
  %154 = mul nsw i32 %153, %42
  %155 = getelementptr inbounds i8, ptr %11, i64 32
  %156 = load float, ptr %155, align 8, !tbaa !46
  %157 = sitofp i32 %151 to float
  %158 = fdiv float %156, %157
  %159 = fsub float 0.000000e+00, %158
  %160 = getelementptr inbounds i8, ptr %23, i64 16
  %161 = load ptr, ptr %160, align 8, !tbaa !38
  %162 = getelementptr inbounds i8, ptr %11, i64 36
  %163 = load float, ptr %162, align 4, !tbaa !47
  %164 = fneg float %163
  %165 = call float @llvm.fmuladd.f32(float %164, float %156, float 1.000000e+00)
  %166 = getelementptr inbounds i8, ptr %23, i64 8
  %167 = load ptr, ptr %166, align 8, !tbaa !27
  call void @mSaxpby(i32 noundef %154, float noundef %159, ptr noundef %161, float noundef %165, ptr noundef %167) #6
  ret void
}

declare i32 @mMORNWrite(ptr noundef, i32 noundef, ptr noundef, i32 noundef, i32 noundef) local_unnamed_addr #3

declare void @mSaxpby(i32 noundef, float noundef, ptr noundef, float noundef, ptr noundef) local_unnamed_addr #3

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare float @llvm.fmuladd.f32(float, float, float) #5

attributes #0 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { "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 = { 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 #5 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { 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, !10, i64 56}
!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 = !{!12, !10, i64 0}
!12 = !{!"TensorConvPara", !10, i64 0, !9, i64 8, !9, i64 12, !9, i64 16, !9, i64 20, !9, i64 24, !9, i64 28, !13, i64 32, !13, i64 36, !13, i64 40}
!13 = !{!"float", !7, i64 0}
!14 = !{!6, !10, i64 40}
!15 = !{!6, !10, i64 48}
!16 = !{!17, !10, i64 16}
!17 = !{!"MHandle", !9, i64 0, !9, i64 4, !10, i64 8, !10, i64 16}
!18 = !{!17, !9, i64 4}
!19 = !{!20, !9, i64 8}
!20 = !{!"MTensor", !9, i64 0, !9, i64 4, !9, i64 8, !9, i64 12, !10, i64 16, !9, i64 24}
!21 = !{!20, !9, i64 12}
!22 = !{!12, !9, i64 12}
!23 = !{!12, !9, i64 16}
!24 = !{!20, !9, i64 4}
!25 = !{!9, !9, i64 0}
!26 = !{!13, !13, i64 0}
!27 = !{!28, !10, i64 8}
!28 = !{!"HandleTensorConv", !10, i64 0, !10, i64 8, !10, i64 16}
!29 = !{!30, !10, i64 8}
!30 = !{!"MMemoryBlock", !9, i64 0, !9, i64 4, !10, i64 8, !10, i64 16, !10, i64 24, !9, i64 32}
!31 = !{!10, !10, i64 0}
!32 = !{!12, !9, i64 8}
!33 = !{!20, !9, i64 0}
!34 = !{!12, !13, i64 40}
!35 = !{!28, !10, i64 0}
!36 = !{!12, !9, i64 24}
!37 = !{!12, !9, i64 20}
!38 = !{!28, !10, i64 16}
!39 = !{!12, !9, i64 28}
!40 = distinct !{!40, !41, !42}
!41 = !{!"llvm.loop.mustprogress"}
!42 = !{!"llvm.loop.peeled.count", i32 1}
!43 = !{!6, !9, i64 64}
!44 = !{!20, !10, i64 16}
!45 = distinct !{!45, !41}
!46 = !{!12, !13, i64 32}
!47 = !{!12, !13, i64 36}


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