; 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.TensorRegister = type { [32 x i8], ptr, ptr, ptr }
%struct.MLayer = type { [32 x i8], i32, ptr, ptr, ptr, i32 }
%struct.TensorGroupConvPara = type { ptr, i32, i32, i32, i32, i32, i32, float, float, float, i32, i32 }
%struct.MHandle = type { i32, i32, ptr, ptr }
%struct.MTensor = type { i32, i32, i32, i32, ptr, i32 }
%struct.HandleTensorGroupConv = 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_tensor_register = external global [256 x %struct.TensorRegister], align 16
@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
@.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
@.str.24 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [19 x i8], align 1
@__FUNCTION__.mTensorGroupConvBackward = external hidden unnamed_addr constant [25 x i8], align 1

; 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

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

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

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

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

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

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) #2

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

; Function Attrs: nounwind uwtable
declare dso_local void @mTensorConvBackward(ptr noundef) #5

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

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

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

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

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

; Function Attrs: nounwind uwtable
declare dso_local void @endTensorGroupConv(ptr noundef) #5

; Function Attrs: nounwind uwtable
define dso_local void @mTensorGroupConvBackward(ptr noundef %0) #5 {
  %2 = alloca ptr, align 8
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca [64 x i8], align 16
  %17 = alloca ptr, align 8
  %18 = alloca ptr, align 8
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  br label %22

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

25:                                               ; preds = %22
  %26 = load ptr, ptr %2, align 8, !tbaa !5
  %27 = ptrtoint ptr %26 to i64
  %28 = icmp eq i64 %27, -1
  br label %29

29:                                               ; preds = %25, %22
  %30 = phi i1 [ true, %22 ], [ %28, %25 ]
  %31 = zext i1 %30 to i32
  store i32 %31, ptr %3, align 4, !tbaa !9
  %32 = load i32, ptr %3, align 4, !tbaa !9
  %33 = icmp ne i32 %32, 0
  br i1 %33, label %34, label %36

34:                                               ; preds = %29
  %35 = load i32, ptr %3, align 4, !tbaa !9
  call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef %35, i32 noundef -1, ptr noundef @.str.1, i32 noundef 704, ptr noundef @__FUNCTION__.mTensorGroupConvBackward, ptr noundef @.str.19)
  br label %36

36:                                               ; preds = %34, %29
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #7
  br label %37

37:                                               ; preds = %36
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #7
  %38 = load ptr, ptr %2, align 8, !tbaa !5
  %39 = getelementptr inbounds %struct.MLayer, ptr %38, i32 0, i32 4
  %40 = load ptr, ptr %39, align 8, !tbaa !11
  store ptr %40, ptr %4, align 8, !tbaa !5
  %41 = load ptr, ptr %4, align 8, !tbaa !5
  %42 = getelementptr inbounds %struct.TensorGroupConvPara, ptr %41, i32 0, i32 10
  %43 = load i32, ptr %42, align 4, !tbaa !13
  %44 = icmp sle i32 %43, 0
  br i1 %44, label %45, label %47

45:                                               ; preds = %37
  %46 = load ptr, ptr %2, align 8, !tbaa !5
  call void @mTensorConvBackward(ptr noundef %46)
  store i32 1, ptr %5, align 4
  br label %377

47:                                               ; preds = %37
  br label %48

48:                                               ; preds = %47
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #7
  %49 = load ptr, ptr %2, align 8, !tbaa !5
  %50 = getelementptr inbounds %struct.MLayer, ptr %49, i32 0, i32 1
  %51 = load i32, ptr %50, align 8, !tbaa !16
  %52 = sext i32 %51 to i64
  %53 = getelementptr inbounds [256 x %struct.TensorRegister], ptr @morn_tensor_register, i64 0, i64 %52
  %54 = getelementptr inbounds %struct.TensorRegister, ptr %53, i32 0, i32 0
  %55 = getelementptr inbounds [32 x i8], ptr %54, i64 0, i64 0
  %56 = call i32 @strcmp(ptr noundef @.str.24, ptr noundef %55) #8
  store i32 %56, ptr %6, align 4, !tbaa !9
  %57 = load i32, ptr %6, align 4, !tbaa !9
  %58 = icmp ne i32 %57, 0
  br i1 %58, label %59, label %61

59:                                               ; preds = %48
  %60 = load i32, ptr %6, align 4, !tbaa !9
  call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef %60, i32 noundef -1, ptr noundef @.str.1, i32 noundef 708, ptr noundef @__FUNCTION__.mTensorGroupConvBackward, ptr noundef @.str.25)
  br label %61

61:                                               ; preds = %59, %48
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #7
  br label %62

62:                                               ; preds = %61
  br label %63

63:                                               ; preds = %62
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #7
  %64 = load ptr, ptr %4, align 8, !tbaa !5
  %65 = getelementptr inbounds %struct.TensorGroupConvPara, ptr %64, i32 0, i32 0
  %66 = load ptr, ptr %65, align 8, !tbaa !17
  %67 = getelementptr inbounds %struct.MLayer, ptr %66, i32 0, i32 2
  %68 = load ptr, ptr %67, align 8, !tbaa !18
  store ptr %68, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #7
  %69 = load ptr, ptr %4, align 8, !tbaa !5
  %70 = getelementptr inbounds %struct.TensorGroupConvPara, ptr %69, i32 0, i32 0
  %71 = load ptr, ptr %70, align 8, !tbaa !17
  %72 = getelementptr inbounds %struct.MLayer, ptr %71, i32 0, i32 3
  %73 = load ptr, ptr %72, align 8, !tbaa !19
  store ptr %73, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #7
  %74 = load ptr, ptr %2, align 8, !tbaa !5
  %75 = getelementptr inbounds %struct.MLayer, ptr %74, i32 0, i32 3
  %76 = load ptr, ptr %75, align 8, !tbaa !19
  store ptr %76, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #7
  %77 = load ptr, ptr %2, align 8, !tbaa !5
  %78 = getelementptr inbounds %struct.MLayer, ptr %77, i32 0, i32 2
  %79 = load ptr, ptr %78, align 8, !tbaa !18
  %80 = call ptr @GetHandle(ptr noundef %79, i32 noundef 24, i32 noundef -2105121901, ptr noundef @endTensorGroupConv)
  store ptr %80, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #7
  %81 = load ptr, ptr %10, align 8, !tbaa !5
  %82 = getelementptr inbounds %struct.MHandle, ptr %81, i32 0, i32 3
  %83 = load ptr, ptr %82, align 8, !tbaa !20
  store ptr %83, ptr %11, align 8, !tbaa !5
  br label %84

84:                                               ; preds = %63
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #7
  %85 = load ptr, ptr %10, align 8, !tbaa !5
  %86 = getelementptr inbounds %struct.MHandle, ptr %85, i32 0, i32 1
  %87 = load volatile i32, ptr %86, align 4, !tbaa !22
  %88 = icmp eq i32 %87, 0
  %89 = zext i1 %88 to i32
  store i32 %89, ptr %12, align 4, !tbaa !9
  %90 = load i32, ptr %12, align 4, !tbaa !9
  %91 = icmp ne i32 %90, 0
  br i1 %91, label %92, label %94

92:                                               ; preds = %84
  %93 = load i32, ptr %12, align 4, !tbaa !9
  call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef %93, i32 noundef -1, ptr noundef @.str.1, i32 noundef 716, ptr noundef @__FUNCTION__.mTensorGroupConvBackward, ptr noundef @.str.20)
  br label %94

94:                                               ; preds = %92, %84
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #7
  br label %95

95:                                               ; preds = %94
  br label %96

96:                                               ; preds = %95
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #7
  %97 = load ptr, ptr %7, align 8, !tbaa !5
  %98 = getelementptr inbounds %struct.MTensor, ptr %97, i32 0, i32 1
  %99 = load i32, ptr %98, align 4, !tbaa !23
  %100 = load ptr, ptr %4, align 8, !tbaa !5
  %101 = getelementptr inbounds %struct.TensorGroupConvPara, ptr %100, i32 0, i32 10
  %102 = load i32, ptr %101, align 4, !tbaa !13
  %103 = sdiv i32 %102, 2
  %104 = sub nsw i32 %99, %103
  %105 = add nsw i32 %104, 1
  %106 = load ptr, ptr %4, align 8, !tbaa !5
  %107 = getelementptr inbounds %struct.TensorGroupConvPara, ptr %106, i32 0, i32 11
  %108 = load i32, ptr %107, align 8, !tbaa !25
  %109 = sdiv i32 %105, %108
  store i32 %109, ptr %13, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #7
  %110 = load ptr, ptr %9, align 8, !tbaa !5
  %111 = getelementptr inbounds %struct.MTensor, ptr %110, i32 0, i32 2
  %112 = load i32, ptr %111, align 8, !tbaa !26
  %113 = load ptr, ptr %9, align 8, !tbaa !5
  %114 = getelementptr inbounds %struct.MTensor, ptr %113, i32 0, i32 3
  %115 = load i32, ptr %114, align 4, !tbaa !27
  %116 = mul nsw i32 %112, %115
  %117 = load i32, ptr %13, align 4, !tbaa !9
  %118 = mul nsw i32 %116, %117
  store i32 %118, ptr %14, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #7
  %119 = load ptr, ptr %4, align 8, !tbaa !5
  %120 = getelementptr inbounds %struct.TensorGroupConvPara, ptr %119, i32 0, i32 2
  %121 = load i32, ptr %120, align 4, !tbaa !28
  %122 = load ptr, ptr %4, align 8, !tbaa !5
  %123 = getelementptr inbounds %struct.TensorGroupConvPara, ptr %122, i32 0, i32 3
  %124 = load i32, ptr %123, align 8, !tbaa !29
  %125 = mul nsw i32 %121, %124
  %126 = load ptr, ptr %4, align 8, !tbaa !5
  %127 = getelementptr inbounds %struct.TensorGroupConvPara, ptr %126, i32 0, i32 10
  %128 = load i32, ptr %127, align 4, !tbaa !13
  %129 = mul nsw i32 %125, %128
  %130 = add nsw i32 %129, 1
  store i32 %130, ptr %15, align 4, !tbaa !9
  br label %131

131:                                              ; preds = %96
  %132 = load i32, ptr @morn_network_time, align 4, !tbaa !9
  %133 = load i32, ptr @morn_network_save, align 4, !tbaa !9
  %134 = srem i32 %132, %133
  %135 = icmp eq i32 %134, 0
  br i1 %135, label %136, label %139

136:                                              ; preds = %131
  %137 = load i32, ptr @morn_network_time, align 4, !tbaa !9
  %138 = icmp sgt i32 %137, 0
  br i1 %138, label %148, label %139

139:                                              ; preds = %136, %131
  %140 = load float, ptr @morn_network_error, align 4, !tbaa !30
  %141 = load float, ptr @morn_network_error_thresh, align 4, !tbaa !30
  %142 = fcmp ole float %140, %141
  br i1 %142, label %148, label %143

143:                                              ; preds = %139
  %144 = load float, ptr @morn_network_error, align 4, !tbaa !30
  %145 = load i32, ptr @morn_network_time_max, align 4, !tbaa !9
  %146 = sitofp i32 %145 to float
  %147 = fcmp oeq float %144, %146
  br i1 %147, label %148, label %172

148:                                              ; preds = %143, %139, %136
  call void @llvm.lifetime.start.p0(i64 64, ptr %16) #7
  %149 = getelementptr inbounds [64 x i8], ptr %16, i64 0, i64 0
  %150 = load ptr, ptr %2, align 8, !tbaa !5
  %151 = getelementptr inbounds %struct.MLayer, ptr %150, i32 0, i32 0
  %152 = getelementptr inbounds [32 x i8], ptr %151, i64 0, i64 0
  %153 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef %149, ptr noundef @.str.17, ptr noundef %152, ptr noundef @.str.18) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #7
  %154 = load ptr, ptr %11, align 8, !tbaa !5
  %155 = getelementptr inbounds %struct.HandleTensorGroupConv, ptr %154, i32 0, i32 1
  %156 = load ptr, ptr %155, align 8, !tbaa !31
  %157 = getelementptr inbounds %struct.MMemoryBlock, ptr %156, i32 0, i32 2
  %158 = load ptr, ptr %157, align 8, !tbaa !33
  store ptr %158, ptr %17, align 8, !tbaa !5
  %159 = load ptr, ptr @morn_network_parafile, align 8, !tbaa !5
  %160 = getelementptr inbounds [64 x i8], ptr %16, i64 0, i64 0
  %161 = getelementptr inbounds i8, ptr %160, i64 0
  %162 = call i32 @m_Hash(ptr noundef %161, i32 noundef -1)
  %163 = load ptr, ptr %4, align 8, !tbaa !5
  %164 = getelementptr inbounds %struct.TensorGroupConvPara, ptr %163, i32 0, i32 1
  %165 = load i32, ptr %164, align 8, !tbaa !35
  %166 = load i32, ptr %15, align 4, !tbaa !9
  %167 = mul nsw i32 %165, %166
  %168 = sext i32 %167 to i64
  %169 = mul i64 %168, 4
  %170 = trunc i64 %169 to i32
  %171 = call i32 @mMORNWrite(ptr noundef %159, i32 noundef %162, ptr noundef %17, i32 noundef 1, i32 noundef %170)
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #7
  call void @llvm.lifetime.end.p0(i64 64, ptr %16) #7
  br label %172

172:                                              ; preds = %148, %143
  br label %173

173:                                              ; preds = %172
  br label %174

174:                                              ; preds = %173
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #7
  %175 = load ptr, ptr %11, align 8, !tbaa !5
  %176 = getelementptr inbounds %struct.HandleTensorGroupConv, ptr %175, i32 0, i32 0
  %177 = load ptr, ptr %176, align 8, !tbaa !36
  %178 = getelementptr inbounds %struct.MMemoryBlock, ptr %177, i32 0, i32 2
  %179 = load ptr, ptr %178, align 8, !tbaa !33
  store ptr %179, ptr %18, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #7
  store i32 0, ptr %19, align 4, !tbaa !9
  br label %180

180:                                              ; preds = %240, %174
  %181 = load i32, ptr %19, align 4, !tbaa !9
  %182 = load ptr, ptr %7, align 8, !tbaa !5
  %183 = getelementptr inbounds %struct.MTensor, ptr %182, i32 0, i32 0
  %184 = load i32, ptr %183, align 8, !tbaa !37
  %185 = icmp slt i32 %181, %184
  br i1 %185, label %187, label %186

186:                                              ; preds = %180
  store i32 10, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #7
  br label %243

187:                                              ; preds = %180
  %188 = load ptr, ptr %7, align 8, !tbaa !5
  %189 = load i32, ptr %19, align 4, !tbaa !9
  %190 = load ptr, ptr %18, align 8, !tbaa !5
  %191 = load ptr, ptr %4, align 8, !tbaa !5
  %192 = getelementptr inbounds %struct.TensorGroupConvPara, ptr %191, i32 0, i32 10
  %193 = load i32, ptr %192, align 4, !tbaa !13
  %194 = load ptr, ptr %4, align 8, !tbaa !5
  %195 = getelementptr inbounds %struct.TensorGroupConvPara, ptr %194, i32 0, i32 2
  %196 = load i32, ptr %195, align 4, !tbaa !28
  %197 = load ptr, ptr %4, align 8, !tbaa !5
  %198 = getelementptr inbounds %struct.TensorGroupConvPara, ptr %197, i32 0, i32 3
  %199 = load i32, ptr %198, align 8, !tbaa !29
  %200 = load ptr, ptr %4, align 8, !tbaa !5
  %201 = getelementptr inbounds %struct.TensorGroupConvPara, ptr %200, i32 0, i32 11
  %202 = load i32, ptr %201, align 8, !tbaa !25
  %203 = load ptr, ptr %4, align 8, !tbaa !5
  %204 = getelementptr inbounds %struct.TensorGroupConvPara, ptr %203, i32 0, i32 5
  %205 = load i32, ptr %204, align 8, !tbaa !38
  %206 = load ptr, ptr %4, align 8, !tbaa !5
  %207 = getelementptr inbounds %struct.TensorGroupConvPara, ptr %206, i32 0, i32 4
  %208 = load i32, ptr %207, align 4, !tbaa !39
  call void @GroupConvTensorToMatData(ptr noundef %188, i32 noundef %189, ptr noundef %190, i32 noundef %193, i32 noundef %196, i32 noundef %199, i32 noundef %202, i32 noundef %205, i32 noundef %208)
  %209 = load ptr, ptr %18, align 8, !tbaa !5
  %210 = load i32, ptr %15, align 4, !tbaa !9
  %211 = sub nsw i32 %210, 1
  %212 = sext i32 %211 to i64
  %213 = getelementptr inbounds float, ptr %209, i64 %212
  store float 1.000000e+00, ptr %213, align 4, !tbaa !30
  %214 = load ptr, ptr %4, align 8, !tbaa !5
  %215 = getelementptr inbounds %struct.TensorGroupConvPara, ptr %214, i32 0, i32 1
  %216 = load i32, ptr %215, align 8, !tbaa !35
  %217 = load i32, ptr %15, align 4, !tbaa !9
  %218 = load i32, ptr %14, align 4, !tbaa !9
  %219 = load ptr, ptr %9, align 8, !tbaa !5
  %220 = load i32, ptr %19, align 4, !tbaa !9
  %221 = call ptr @mTensorMemory(ptr noundef %219, i32 noundef %220)
  %222 = load i32, ptr %14, align 4, !tbaa !9
  %223 = load ptr, ptr %11, align 8, !tbaa !5
  %224 = getelementptr inbounds %struct.HandleTensorGroupConv, ptr %223, i32 0, i32 0
  %225 = load ptr, ptr %224, align 8, !tbaa !36
  %226 = load i32, ptr %15, align 4, !tbaa !9
  %227 = load i32, ptr %19, align 4, !tbaa !9
  %228 = icmp eq i32 %227, 0
  br i1 %228, label %229, label %233

229:                                              ; preds = %187
  %230 = load ptr, ptr %4, align 8, !tbaa !5
  %231 = getelementptr inbounds %struct.TensorGroupConvPara, ptr %230, i32 0, i32 9
  %232 = load float, ptr %231, align 8, !tbaa !40
  br label %234

233:                                              ; preds = %187
  br label %234

234:                                              ; preds = %233, %229
  %235 = phi float [ %232, %229 ], [ 1.000000e+00, %233 ]
  %236 = load ptr, ptr %11, align 8, !tbaa !5
  %237 = getelementptr inbounds %struct.HandleTensorGroupConv, ptr %236, i32 0, i32 2
  %238 = load ptr, ptr %237, align 8, !tbaa !41
  %239 = load i32, ptr %15, align 4, !tbaa !9
  call void @mSgemm(i32 noundef 0, i32 noundef 0, i32 noundef %216, i32 noundef %217, i32 noundef %218, float noundef 1.000000e+00, ptr noundef %221, i32 noundef %222, ptr noundef %225, i32 noundef %226, float noundef %235, ptr noundef %238, i32 noundef %239)
  br label %240

240:                                              ; preds = %234
  %241 = load i32, ptr %19, align 4, !tbaa !9
  %242 = add nsw i32 %241, 1
  store i32 %242, ptr %19, align 4, !tbaa !9
  br label %180, !llvm.loop !42

243:                                              ; preds = %186
  %244 = load ptr, ptr %4, align 8, !tbaa !5
  %245 = getelementptr inbounds %struct.TensorGroupConvPara, ptr %244, i32 0, i32 1
  %246 = load i32, ptr %245, align 8, !tbaa !35
  %247 = load i32, ptr %15, align 4, !tbaa !9
  %248 = mul nsw i32 %246, %247
  %249 = load ptr, ptr %4, align 8, !tbaa !5
  %250 = getelementptr inbounds %struct.TensorGroupConvPara, ptr %249, i32 0, i32 7
  %251 = load float, ptr %250, align 8, !tbaa !44
  %252 = load ptr, ptr %7, align 8, !tbaa !5
  %253 = getelementptr inbounds %struct.MTensor, ptr %252, i32 0, i32 0
  %254 = load i32, ptr %253, align 8, !tbaa !37
  %255 = sitofp i32 %254 to float
  %256 = fdiv float %251, %255
  %257 = fsub float 0.000000e+00, %256
  %258 = load ptr, ptr %11, align 8, !tbaa !5
  %259 = getelementptr inbounds %struct.HandleTensorGroupConv, ptr %258, i32 0, i32 2
  %260 = load ptr, ptr %259, align 8, !tbaa !41
  %261 = load ptr, ptr %4, align 8, !tbaa !5
  %262 = getelementptr inbounds %struct.TensorGroupConvPara, ptr %261, i32 0, i32 7
  %263 = load float, ptr %262, align 8, !tbaa !44
  %264 = load ptr, ptr %4, align 8, !tbaa !5
  %265 = getelementptr inbounds %struct.TensorGroupConvPara, ptr %264, i32 0, i32 8
  %266 = load float, ptr %265, align 4, !tbaa !45
  %267 = fneg float %263
  %268 = call float @llvm.fmuladd.f32(float %267, float %266, float 1.000000e+00)
  %269 = load ptr, ptr %11, align 8, !tbaa !5
  %270 = getelementptr inbounds %struct.HandleTensorGroupConv, ptr %269, i32 0, i32 1
  %271 = load ptr, ptr %270, align 8, !tbaa !31
  call void @mSaxpby(i32 noundef %248, float noundef %257, ptr noundef %260, float noundef %268, ptr noundef %271)
  %272 = load ptr, ptr %4, align 8, !tbaa !5
  %273 = getelementptr inbounds %struct.TensorGroupConvPara, ptr %272, i32 0, i32 6
  %274 = load i32, ptr %273, align 4, !tbaa !46
  %275 = icmp eq i32 %274, 0
  br i1 %275, label %276, label %277

276:                                              ; preds = %243
  store i32 1, ptr %5, align 4
  br label %376

277:                                              ; preds = %243
  %278 = load ptr, ptr %4, align 8, !tbaa !5
  %279 = getelementptr inbounds %struct.TensorGroupConvPara, ptr %278, i32 0, i32 0
  %280 = load ptr, ptr %279, align 8, !tbaa !17
  %281 = getelementptr inbounds %struct.MLayer, ptr %280, i32 0, i32 5
  %282 = load i32, ptr %281, align 8, !tbaa !47
  %283 = icmp eq i32 %282, 0
  br i1 %283, label %284, label %321

284:                                              ; preds = %277
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #7
  store i32 0, ptr %20, align 4, !tbaa !9
  br label %285

285:                                              ; preds = %313, %284
  %286 = load i32, ptr %20, align 4, !tbaa !9
  %287 = load ptr, ptr %8, align 8, !tbaa !5
  %288 = getelementptr inbounds %struct.MTensor, ptr %287, i32 0, i32 0
  %289 = load i32, ptr %288, align 8, !tbaa !37
  %290 = icmp slt i32 %286, %289
  br i1 %290, label %292, label %291

291:                                              ; preds = %285
  store i32 13, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #7
  br label %316

292:                                              ; preds = %285
  %293 = load ptr, ptr %8, align 8, !tbaa !5
  %294 = getelementptr inbounds %struct.MTensor, ptr %293, i32 0, i32 4
  %295 = load ptr, ptr %294, align 8, !tbaa !48
  %296 = load i32, ptr %20, align 4, !tbaa !9
  %297 = sext i32 %296 to i64
  %298 = getelementptr inbounds ptr, ptr %295, i64 %297
  %299 = load ptr, ptr %298, align 8, !tbaa !5
  %300 = load ptr, ptr %7, align 8, !tbaa !5
  %301 = getelementptr inbounds %struct.MTensor, ptr %300, i32 0, i32 2
  %302 = load i32, ptr %301, align 8, !tbaa !26
  %303 = load ptr, ptr %7, align 8, !tbaa !5
  %304 = getelementptr inbounds %struct.MTensor, ptr %303, i32 0, i32 3
  %305 = load i32, ptr %304, align 4, !tbaa !27
  %306 = mul nsw i32 %302, %305
  %307 = load ptr, ptr %7, align 8, !tbaa !5
  %308 = getelementptr inbounds %struct.MTensor, ptr %307, i32 0, i32 1
  %309 = load i32, ptr %308, align 4, !tbaa !23
  %310 = mul nsw i32 %306, %309
  %311 = sext i32 %310 to i64
  %312 = mul i64 %311, 4
  call void @llvm.memset.p0.i64(ptr align 4 %299, i8 0, i64 %312, i1 false)
  br label %313

313:                                              ; preds = %292
  %314 = load i32, ptr %20, align 4, !tbaa !9
  %315 = add nsw i32 %314, 1
  store i32 %315, ptr %20, align 4, !tbaa !9
  br label %285, !llvm.loop !49

316:                                              ; preds = %291
  %317 = load ptr, ptr %4, align 8, !tbaa !5
  %318 = getelementptr inbounds %struct.TensorGroupConvPara, ptr %317, i32 0, i32 0
  %319 = load ptr, ptr %318, align 8, !tbaa !17
  %320 = getelementptr inbounds %struct.MLayer, ptr %319, i32 0, i32 5
  store i32 1, ptr %320, align 8, !tbaa !47
  br label %321

321:                                              ; preds = %316, %277
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #7
  store i32 0, ptr %21, align 4, !tbaa !9
  br label %322

322:                                              ; preds = %372, %321
  %323 = load i32, ptr %21, align 4, !tbaa !9
  %324 = load ptr, ptr %7, align 8, !tbaa !5
  %325 = getelementptr inbounds %struct.MTensor, ptr %324, i32 0, i32 0
  %326 = load i32, ptr %325, align 8, !tbaa !37
  %327 = icmp slt i32 %323, %326
  br i1 %327, label %329, label %328

328:                                              ; preds = %322
  store i32 16, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #7
  br label %375

329:                                              ; preds = %322
  %330 = load i32, ptr %14, align 4, !tbaa !9
  %331 = load i32, ptr %15, align 4, !tbaa !9
  %332 = load ptr, ptr %4, align 8, !tbaa !5
  %333 = getelementptr inbounds %struct.TensorGroupConvPara, ptr %332, i32 0, i32 1
  %334 = load i32, ptr %333, align 8, !tbaa !35
  %335 = load ptr, ptr %9, align 8, !tbaa !5
  %336 = load i32, ptr %21, align 4, !tbaa !9
  %337 = call ptr @mTensorMemory(ptr noundef %335, i32 noundef %336)
  %338 = load i32, ptr %14, align 4, !tbaa !9
  %339 = load ptr, ptr %11, align 8, !tbaa !5
  %340 = getelementptr inbounds %struct.HandleTensorGroupConv, ptr %339, i32 0, i32 1
  %341 = load ptr, ptr %340, align 8, !tbaa !31
  %342 = load i32, ptr %15, align 4, !tbaa !9
  %343 = load ptr, ptr %11, align 8, !tbaa !5
  %344 = getelementptr inbounds %struct.HandleTensorGroupConv, ptr %343, i32 0, i32 0
  %345 = load ptr, ptr %344, align 8, !tbaa !36
  %346 = load i32, ptr %15, align 4, !tbaa !9
  call void @mSgemm(i32 noundef 1, i32 noundef 0, i32 noundef %330, i32 noundef %331, i32 noundef %334, float noundef 1.000000e+00, ptr noundef %337, i32 noundef %338, ptr noundef %341, i32 noundef %342, float noundef 0.000000e+00, ptr noundef %345, i32 noundef %346)
  %347 = load ptr, ptr %11, align 8, !tbaa !5
  %348 = getelementptr inbounds %struct.HandleTensorGroupConv, ptr %347, i32 0, i32 0
  %349 = load ptr, ptr %348, align 8, !tbaa !36
  %350 = getelementptr inbounds %struct.MMemoryBlock, ptr %349, i32 0, i32 2
  %351 = load ptr, ptr %350, align 8, !tbaa !33
  %352 = load ptr, ptr %8, align 8, !tbaa !5
  %353 = load i32, ptr %21, align 4, !tbaa !9
  %354 = load ptr, ptr %4, align 8, !tbaa !5
  %355 = getelementptr inbounds %struct.TensorGroupConvPara, ptr %354, i32 0, i32 10
  %356 = load i32, ptr %355, align 4, !tbaa !13
  %357 = load ptr, ptr %4, align 8, !tbaa !5
  %358 = getelementptr inbounds %struct.TensorGroupConvPara, ptr %357, i32 0, i32 2
  %359 = load i32, ptr %358, align 4, !tbaa !28
  %360 = load ptr, ptr %4, align 8, !tbaa !5
  %361 = getelementptr inbounds %struct.TensorGroupConvPara, ptr %360, i32 0, i32 3
  %362 = load i32, ptr %361, align 8, !tbaa !29
  %363 = load ptr, ptr %4, align 8, !tbaa !5
  %364 = getelementptr inbounds %struct.TensorGroupConvPara, ptr %363, i32 0, i32 11
  %365 = load i32, ptr %364, align 8, !tbaa !25
  %366 = load ptr, ptr %4, align 8, !tbaa !5
  %367 = getelementptr inbounds %struct.TensorGroupConvPara, ptr %366, i32 0, i32 5
  %368 = load i32, ptr %367, align 8, !tbaa !38
  %369 = load ptr, ptr %4, align 8, !tbaa !5
  %370 = getelementptr inbounds %struct.TensorGroupConvPara, ptr %369, i32 0, i32 4
  %371 = load i32, ptr %370, align 4, !tbaa !39
  call void @GroupConvMatDataToTensor(ptr noundef %351, ptr noundef %352, i32 noundef %353, i32 noundef %356, i32 noundef %359, i32 noundef %362, i32 noundef %365, i32 noundef %368, i32 noundef %371)
  br label %372

372:                                              ; preds = %329
  %373 = load i32, ptr %21, align 4, !tbaa !9
  %374 = add nsw i32 %373, 1
  store i32 %374, ptr %21, align 4, !tbaa !9
  br label %322, !llvm.loop !50

375:                                              ; preds = %328
  store i32 0, ptr %5, align 4
  br label %376

376:                                              ; preds = %375, %276
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #7
  br label %377

377:                                              ; preds = %376, %45
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #7
  %378 = load i32, ptr %5, align 4
  switch i32 %378, label %380 [
    i32 0, label %379
    i32 1, label %379
  ]

379:                                              ; preds = %377, %377
  ret void

380:                                              ; preds = %377
  unreachable
}

attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "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 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 #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 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #7 = { nounwind }
attributes #8 = { 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, !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, !10, i64 44}
!14 = !{!"TensorGroupConvPara", !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, !10, i64 44, !10, i64 48}
!15 = !{!"float", !7, i64 0}
!16 = !{!12, !10, i64 32}
!17 = !{!14, !6, i64 0}
!18 = !{!12, !6, i64 40}
!19 = !{!12, !6, i64 48}
!20 = !{!21, !6, i64 16}
!21 = !{!"MHandle", !10, i64 0, !10, i64 4, !6, i64 8, !6, i64 16}
!22 = !{!21, !10, i64 4}
!23 = !{!24, !10, i64 4}
!24 = !{!"MTensor", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !6, i64 16, !10, i64 24}
!25 = !{!14, !10, i64 48}
!26 = !{!24, !10, i64 8}
!27 = !{!24, !10, i64 12}
!28 = !{!14, !10, i64 12}
!29 = !{!14, !10, i64 16}
!30 = !{!15, !15, i64 0}
!31 = !{!32, !6, i64 8}
!32 = !{!"HandleTensorGroupConv", !6, i64 0, !6, i64 8, !6, i64 16}
!33 = !{!34, !6, i64 8}
!34 = !{!"MMemoryBlock", !10, i64 0, !10, i64 4, !6, i64 8, !6, i64 16, !6, i64 24, !10, i64 32}
!35 = !{!14, !10, i64 8}
!36 = !{!32, !6, i64 0}
!37 = !{!24, !10, i64 0}
!38 = !{!14, !10, i64 24}
!39 = !{!14, !10, i64 20}
!40 = !{!14, !15, i64 40}
!41 = !{!32, !6, i64 16}
!42 = distinct !{!42, !43}
!43 = !{!"llvm.loop.mustprogress"}
!44 = !{!14, !15, i64 32}
!45 = !{!14, !15, i64 36}
!46 = !{!14, !10, i64 28}
!47 = !{!12, !10, i64 64}
!48 = !{!24, !6, i64 16}
!49 = distinct !{!49, !43}
!50 = distinct !{!50, !43}


; 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 [92 x i8], align 1
@morn_tensor_register = external global [256 x %struct.TensorRegister], align 16
@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
@.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
@.str.24 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [19 x i8], align 1
@__FUNCTION__.mTensorGroupConvBackward = external hidden unnamed_addr constant [25 x i8], align 1

; 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

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

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

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

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

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 #2

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

; Function Attrs: nounwind uwtable
declare dso_local void @mTensorConvBackward(ptr noundef) local_unnamed_addr #5

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

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

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

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

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

; Function Attrs: nounwind uwtable
declare dso_local void @endTensorGroupConv(ptr noundef) #5

; Function Attrs: nounwind uwtable
define dso_local void @mTensorGroupConvBackward(ptr noundef %0) local_unnamed_addr #5 {
  %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 704, ptr noundef nonnull @__FUNCTION__.mTensorGroupConvBackward, ptr noundef nonnull @.str.19) #7
  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 = getelementptr inbounds i8, ptr %11, i64 44
  %13 = load i32, ptr %12, align 4, !tbaa !11
  %14 = icmp slt i32 %13, 1
  br i1 %14, label %15, label %16

15:                                               ; preds = %9
  tail call void @mTensorConvBackward(ptr noundef nonnull %0)
  br label %.loopexit

16:                                               ; preds = %9
  %17 = getelementptr inbounds i8, ptr %0, i64 32
  %18 = load i32, ptr %17, align 8, !tbaa !14
  %19 = sext i32 %18 to i64
  %20 = getelementptr inbounds [256 x %struct.TensorRegister], ptr @morn_tensor_register, i64 0, i64 %19
  %21 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) @.str.24, ptr noundef nonnull dereferenceable(1) %20) #8
  %.not = icmp eq i32 %21, 0
  br i1 %.not, label %23, label %22

22:                                               ; preds = %16
  tail call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef %21, i32 noundef -1, ptr noundef nonnull @.str.1, i32 noundef 708, ptr noundef nonnull @__FUNCTION__.mTensorGroupConvBackward, ptr noundef nonnull @.str.25) #7
  br label %23

23:                                               ; preds = %22, %16
  %24 = load ptr, ptr %11, align 8, !tbaa !15
  %25 = getelementptr inbounds i8, ptr %24, i64 40
  %26 = load ptr, ptr %25, align 8, !tbaa !16
  %27 = getelementptr inbounds i8, ptr %24, i64 48
  %28 = load ptr, ptr %27, align 8, !tbaa !17
  %29 = getelementptr inbounds i8, ptr %0, i64 48
  %30 = load ptr, ptr %29, align 8, !tbaa !17
  %31 = getelementptr inbounds i8, ptr %0, i64 40
  %32 = load ptr, ptr %31, align 8, !tbaa !16
  %33 = tail call ptr @GetHandle(ptr noundef %32, i32 noundef 24, i32 noundef -2105121901, ptr noundef nonnull @endTensorGroupConv) #7
  %34 = getelementptr inbounds i8, ptr %33, i64 16
  %35 = load ptr, ptr %34, align 8, !tbaa !18
  %36 = getelementptr inbounds i8, ptr %33, i64 4
  %37 = load volatile i32, ptr %36, align 4, !tbaa !20
  %38 = icmp eq i32 %37, 0
  br i1 %38, label %39, label %40

39:                                               ; preds = %23
  tail call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef 1, i32 noundef -1, ptr noundef nonnull @.str.1, i32 noundef 716, ptr noundef nonnull @__FUNCTION__.mTensorGroupConvBackward, ptr noundef nonnull @.str.20) #7
  br label %40

40:                                               ; preds = %39, %23
  %41 = getelementptr inbounds i8, ptr %26, i64 4
  %42 = load i32, ptr %41, align 4, !tbaa !21
  %43 = load i32, ptr %12, align 4, !tbaa !11
  %.neg = sdiv i32 %43, -2
  %44 = add i32 %42, 1
  %45 = add i32 %44, %.neg
  %46 = getelementptr inbounds i8, ptr %11, i64 48
  %47 = load i32, ptr %46, align 8, !tbaa !23
  %48 = sdiv i32 %45, %47
  %49 = getelementptr inbounds i8, ptr %30, i64 8
  %50 = load i32, ptr %49, align 8, !tbaa !24
  %51 = getelementptr inbounds i8, ptr %30, i64 12
  %52 = load i32, ptr %51, align 4, !tbaa !25
  %53 = mul i32 %50, %48
  %54 = mul i32 %53, %52
  %55 = getelementptr inbounds i8, ptr %11, i64 12
  %56 = load i32, ptr %55, align 4, !tbaa !26
  %57 = getelementptr inbounds i8, ptr %11, i64 16
  %58 = load i32, ptr %57, align 8, !tbaa !27
  %59 = mul i32 %56, %43
  %60 = mul i32 %59, %58
  %61 = add nsw i32 %60, 1
  %62 = load i32, ptr @morn_network_time, align 4
  %63 = load i32, ptr @morn_network_save, align 4, !tbaa !28
  %64 = srem i32 %62, %63
  %65 = icmp eq i32 %64, 0
  %66 = icmp sgt i32 %62, 0
  %or.cond = and i1 %66, %65
  br i1 %or.cond, label %75, label %67

67:                                               ; preds = %40
  %68 = load float, ptr @morn_network_error, align 4, !tbaa !29
  %69 = load float, ptr @morn_network_error_thresh, align 4, !tbaa !29
  %70 = fcmp ugt float %68, %69
  br i1 %70, label %71, label %75

71:                                               ; preds = %67
  %72 = load i32, ptr @morn_network_time_max, align 4, !tbaa !28
  %73 = sitofp i32 %72 to float
  %74 = fcmp oeq float %68, %73
  br i1 %74, label %75, label %88

75:                                               ; preds = %40, %71, %67
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %2) #7
  %76 = 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) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #7
  %77 = getelementptr inbounds i8, ptr %35, i64 8
  %78 = load ptr, ptr %77, align 8, !tbaa !30
  %79 = getelementptr inbounds i8, ptr %78, i64 8
  %80 = load ptr, ptr %79, align 8, !tbaa !32
  store ptr %80, ptr %3, align 8, !tbaa !34
  %81 = load ptr, ptr @morn_network_parafile, align 8, !tbaa !34
  %82 = call i32 @m_Hash(ptr noundef nonnull %2, i32 noundef -1) #7
  %83 = getelementptr inbounds i8, ptr %11, i64 8
  %84 = load i32, ptr %83, align 8, !tbaa !35
  %85 = shl i32 %61, 2
  %86 = mul i32 %85, %84
  %87 = call i32 @mMORNWrite(ptr noundef %81, i32 noundef %82, ptr noundef nonnull %3, i32 noundef 1, i32 noundef %86) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #7
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %2) #7
  br label %88

88:                                               ; preds = %75, %71
  %89 = load ptr, ptr %35, align 8, !tbaa !36
  %90 = getelementptr inbounds i8, ptr %89, i64 8
  %91 = load ptr, ptr %90, align 8, !tbaa !32
  %92 = load i32, ptr %26, align 8, !tbaa !37
  %93 = icmp sgt i32 %92, 0
  br i1 %93, label %94, label %._crit_edge

94:                                               ; preds = %88
  %95 = getelementptr inbounds i8, ptr %11, i64 24
  %96 = getelementptr inbounds i8, ptr %11, i64 20
  %97 = sext i32 %60 to i64
  %98 = getelementptr inbounds float, ptr %91, i64 %97
  %99 = getelementptr inbounds i8, ptr %11, i64 8
  %100 = getelementptr inbounds i8, ptr %35, i64 16
  %101 = load i32, ptr %12, align 4, !tbaa !11
  %102 = load i32, ptr %55, align 4, !tbaa !26
  %103 = load i32, ptr %57, align 8, !tbaa !27
  %104 = load i32, ptr %46, align 8, !tbaa !23
  %105 = load i32, ptr %95, align 8, !tbaa !38
  %106 = load i32, ptr %96, align 4, !tbaa !39
  call void @GroupConvTensorToMatData(ptr noundef nonnull %26, i32 noundef 0, ptr noundef %91, i32 noundef %101, i32 noundef %102, i32 noundef %103, i32 noundef %104, i32 noundef %105, i32 noundef %106)
  store float 1.000000e+00, ptr %98, align 4, !tbaa !29
  %107 = load i32, ptr %99, align 8, !tbaa !35
  %108 = call ptr @mTensorMemory(ptr noundef nonnull %30, i32 noundef 0) #7
  %109 = load ptr, ptr %35, align 8, !tbaa !36
  %110 = getelementptr inbounds i8, ptr %11, i64 40
  %111 = load float, ptr %110, align 8, !tbaa !40
  %112 = load ptr, ptr %100, align 8, !tbaa !41
  call void @mSgemm(i32 noundef 0, i32 noundef 0, i32 noundef %107, i32 noundef %61, i32 noundef %54, float noundef 1.000000e+00, ptr noundef %108, i32 noundef %54, ptr noundef %109, i32 noundef %61, float noundef %111, ptr noundef %112, i32 noundef %61) #7
  %113 = load i32, ptr %26, align 8, !tbaa !37
  %114 = icmp sgt i32 %113, 1
  br i1 %114, label %.peel.next, label %._crit_edge

._crit_edge:                                      ; preds = %.peel.next, %94, %88
  %.lcssa = phi i32 [ %92, %88 ], [ %113, %94 ], [ %145, %.peel.next ]
  %115 = getelementptr inbounds i8, ptr %11, i64 8
  %116 = load i32, ptr %115, align 8, !tbaa !35
  %117 = mul nsw i32 %116, %61
  %118 = getelementptr inbounds i8, ptr %11, i64 32
  %119 = load float, ptr %118, align 8, !tbaa !42
  %120 = sitofp i32 %.lcssa to float
  %121 = fdiv float %119, %120
  %122 = fsub float 0.000000e+00, %121
  %123 = getelementptr inbounds i8, ptr %35, i64 16
  %124 = load ptr, ptr %123, align 8, !tbaa !41
  %125 = getelementptr inbounds i8, ptr %11, i64 36
  %126 = load float, ptr %125, align 4, !tbaa !43
  %127 = fneg float %119
  %128 = call float @llvm.fmuladd.f32(float %127, float %126, float 1.000000e+00)
  %129 = getelementptr inbounds i8, ptr %35, i64 8
  %130 = load ptr, ptr %129, align 8, !tbaa !30
  call void @mSaxpby(i32 noundef %117, float noundef %122, ptr noundef %124, float noundef %128, ptr noundef %130) #7
  %131 = getelementptr inbounds i8, ptr %11, i64 28
  %132 = load i32, ptr %131, align 4, !tbaa !44
  %133 = icmp eq i32 %132, 0
  br i1 %133, label %.loopexit, label %147

.peel.next:                                       ; preds = %94, %.peel.next
  %.0100104 = phi i32 [ %144, %.peel.next ], [ 1, %94 ]
  %134 = load i32, ptr %12, align 4, !tbaa !11
  %135 = load i32, ptr %55, align 4, !tbaa !26
  %136 = load i32, ptr %57, align 8, !tbaa !27
  %137 = load i32, ptr %46, align 8, !tbaa !23
  %138 = load i32, ptr %95, align 8, !tbaa !38
  %139 = load i32, ptr %96, align 4, !tbaa !39
  call void @GroupConvTensorToMatData(ptr noundef nonnull %26, i32 noundef %.0100104, ptr noundef nonnull %91, i32 noundef %134, i32 noundef %135, i32 noundef %136, i32 noundef %137, i32 noundef %138, i32 noundef %139)
  store float 1.000000e+00, ptr %98, align 4, !tbaa !29
  %140 = load i32, ptr %99, align 8, !tbaa !35
  %141 = call ptr @mTensorMemory(ptr noundef %30, i32 noundef %.0100104) #7
  %142 = load ptr, ptr %35, align 8, !tbaa !36
  %143 = load ptr, ptr %100, align 8, !tbaa !41
  call void @mSgemm(i32 noundef 0, i32 noundef 0, i32 noundef %140, i32 noundef %61, i32 noundef %54, float noundef 1.000000e+00, ptr noundef %141, i32 noundef %54, ptr noundef %142, i32 noundef %61, float noundef 1.000000e+00, ptr noundef %143, i32 noundef %61) #7
  %144 = add nuw nsw i32 %.0100104, 1
  %145 = load i32, ptr %26, align 8, !tbaa !37
  %146 = icmp slt i32 %144, %145
  br i1 %146, label %.peel.next, label %._crit_edge, !llvm.loop !45

147:                                              ; preds = %._crit_edge
  %148 = load ptr, ptr %11, align 8, !tbaa !15
  %149 = getelementptr inbounds i8, ptr %148, i64 64
  %150 = load i32, ptr %149, align 8, !tbaa !48
  %151 = icmp eq i32 %150, 0
  br i1 %151, label %.preheader, label %173

.preheader:                                       ; preds = %147
  %152 = load i32, ptr %28, align 8, !tbaa !37
  %153 = icmp sgt i32 %152, 0
  br i1 %153, label %.lr.ph106, label %._crit_edge107

.lr.ph106:                                        ; preds = %.preheader
  %154 = getelementptr inbounds i8, ptr %28, i64 16
  %155 = getelementptr inbounds i8, ptr %26, i64 8
  %156 = getelementptr inbounds i8, ptr %26, i64 12
  br label %159

._crit_edge107.loopexit:                          ; preds = %159
  %.pre = load ptr, ptr %11, align 8, !tbaa !15
  br label %._crit_edge107

._crit_edge107:                                   ; preds = %._crit_edge107.loopexit, %.preheader
  %157 = phi ptr [ %.pre, %._crit_edge107.loopexit ], [ %148, %.preheader ]
  %158 = getelementptr inbounds i8, ptr %157, i64 64
  store i32 1, ptr %158, align 8, !tbaa !48
  br label %173

159:                                              ; preds = %.lr.ph106, %159
  %indvars.iv = phi i64 [ 0, %.lr.ph106 ], [ %indvars.iv.next, %159 ]
  %160 = load ptr, ptr %154, align 8, !tbaa !49
  %161 = getelementptr inbounds ptr, ptr %160, i64 %indvars.iv
  %162 = load ptr, ptr %161, align 8, !tbaa !34
  %163 = load i32, ptr %155, align 8, !tbaa !24
  %164 = load i32, ptr %156, align 4, !tbaa !25
  %165 = mul nsw i32 %164, %163
  %166 = load i32, ptr %41, align 4, !tbaa !21
  %167 = mul nsw i32 %165, %166
  %168 = sext i32 %167 to i64
  %169 = shl nsw i64 %168, 2
  call void @llvm.memset.p0.i64(ptr align 4 %162, i8 0, i64 %169, i1 false)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %170 = load i32, ptr %28, align 8, !tbaa !37
  %171 = sext i32 %170 to i64
  %172 = icmp slt i64 %indvars.iv.next, %171
  br i1 %172, label %159, label %._crit_edge107.loopexit, !llvm.loop !50

173:                                              ; preds = %._crit_edge107, %147
  %174 = load i32, ptr %26, align 8, !tbaa !37
  %175 = icmp sgt i32 %174, 0
  br i1 %175, label %.lr.ph110, label %.loopexit

.lr.ph110:                                        ; preds = %173
  %176 = getelementptr inbounds i8, ptr %11, i64 24
  %177 = getelementptr inbounds i8, ptr %11, i64 20
  br label %178

178:                                              ; preds = %.lr.ph110, %178
  %.0108 = phi i32 [ 0, %.lr.ph110 ], [ %192, %178 ]
  %179 = load i32, ptr %115, align 8, !tbaa !35
  %180 = call ptr @mTensorMemory(ptr noundef %30, i32 noundef %.0108) #7
  %181 = load ptr, ptr %129, align 8, !tbaa !30
  %182 = load ptr, ptr %35, align 8, !tbaa !36
  call void @mSgemm(i32 noundef 1, i32 noundef 0, i32 noundef %54, i32 noundef %61, i32 noundef %179, float noundef 1.000000e+00, ptr noundef %180, i32 noundef %54, ptr noundef %181, i32 noundef %61, float noundef 0.000000e+00, ptr noundef %182, i32 noundef %61) #7
  %183 = load ptr, ptr %35, align 8, !tbaa !36
  %184 = getelementptr inbounds i8, ptr %183, i64 8
  %185 = load ptr, ptr %184, align 8, !tbaa !32
  %186 = load i32, ptr %12, align 4, !tbaa !11
  %187 = load i32, ptr %55, align 4, !tbaa !26
  %188 = load i32, ptr %57, align 8, !tbaa !27
  %189 = load i32, ptr %46, align 8, !tbaa !23
  %190 = load i32, ptr %176, align 8, !tbaa !38
  %191 = load i32, ptr %177, align 4, !tbaa !39
  call void @GroupConvMatDataToTensor(ptr noundef %185, ptr noundef %28, i32 noundef %.0108, i32 noundef %186, i32 noundef %187, i32 noundef %188, i32 noundef %189, i32 noundef %190, i32 noundef %191)
  %192 = add nuw nsw i32 %.0108, 1
  %193 = load i32, ptr %26, align 8, !tbaa !37
  %194 = icmp slt i32 %192, %193
  br i1 %194, label %178, label %.loopexit, !llvm.loop !51

.loopexit:                                        ; preds = %178, %173, %._crit_edge, %15
  ret void
}

attributes #0 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "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 = { 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 #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 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #7 = { nounwind }
attributes #8 = { 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, !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, !9, i64 44}
!12 = !{!"TensorGroupConvPara", !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, !9, i64 44, !9, i64 48}
!13 = !{!"float", !7, i64 0}
!14 = !{!6, !9, i64 32}
!15 = !{!12, !10, i64 0}
!16 = !{!6, !10, i64 40}
!17 = !{!6, !10, i64 48}
!18 = !{!19, !10, i64 16}
!19 = !{!"MHandle", !9, i64 0, !9, i64 4, !10, i64 8, !10, i64 16}
!20 = !{!19, !9, i64 4}
!21 = !{!22, !9, i64 4}
!22 = !{!"MTensor", !9, i64 0, !9, i64 4, !9, i64 8, !9, i64 12, !10, i64 16, !9, i64 24}
!23 = !{!12, !9, i64 48}
!24 = !{!22, !9, i64 8}
!25 = !{!22, !9, i64 12}
!26 = !{!12, !9, i64 12}
!27 = !{!12, !9, i64 16}
!28 = !{!9, !9, i64 0}
!29 = !{!13, !13, i64 0}
!30 = !{!31, !10, i64 8}
!31 = !{!"HandleTensorGroupConv", !10, i64 0, !10, i64 8, !10, i64 16}
!32 = !{!33, !10, i64 8}
!33 = !{!"MMemoryBlock", !9, i64 0, !9, i64 4, !10, i64 8, !10, i64 16, !10, i64 24, !9, i64 32}
!34 = !{!10, !10, i64 0}
!35 = !{!12, !9, i64 8}
!36 = !{!31, !10, i64 0}
!37 = !{!22, !9, i64 0}
!38 = !{!12, !9, i64 24}
!39 = !{!12, !9, i64 20}
!40 = !{!12, !13, i64 40}
!41 = !{!31, !10, i64 16}
!42 = !{!12, !13, i64 32}
!43 = !{!12, !13, i64 36}
!44 = !{!12, !9, i64 28}
!45 = distinct !{!45, !46, !47}
!46 = !{!"llvm.loop.mustprogress"}
!47 = !{!"llvm.loop.peeled.count", i32 1}
!48 = !{!6, !9, i64 64}
!49 = !{!22, !10, i64 16}
!50 = distinct !{!50, !46}
!51 = distinct !{!51, !46}


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