; 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
@.str.19 = external hidden unnamed_addr constant [14 x i8], align 1
@__FUNCTION__.mTensorGroupConvForward = external hidden unnamed_addr constant [24 x i8], align 1
@.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 Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0

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

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

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

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

; Function Attrs: nounwind uwtable
declare dso_local void @mTensorConvForward(ptr 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) #1

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

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

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

; Function Attrs: nounwind uwtable
declare dso_local void @TensorGroupConvSet(ptr noundef) #3

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

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

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

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

28:                                               ; preds = %23
  %29 = load i32, ptr %3, align 4, !tbaa !9
  call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef %29, i32 noundef -1, ptr noundef @.str.1, i32 noundef 668, ptr noundef @__FUNCTION__.mTensorGroupConvForward, ptr noundef @.str.19)
  br label %30

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

31:                                               ; preds = %30
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #4
  %32 = load ptr, ptr %2, align 8, !tbaa !5
  %33 = getelementptr inbounds %struct.MLayer, ptr %32, i32 0, i32 4
  %34 = load ptr, ptr %33, align 8, !tbaa !11
  store ptr %34, ptr %4, align 8, !tbaa !5
  %35 = load ptr, ptr %4, align 8, !tbaa !5
  %36 = getelementptr inbounds %struct.TensorGroupConvPara, ptr %35, i32 0, i32 10
  %37 = load i32, ptr %36, align 4, !tbaa !13
  %38 = icmp sle i32 %37, 0
  br i1 %38, label %39, label %41

39:                                               ; preds = %31
  %40 = load ptr, ptr %2, align 8, !tbaa !5
  call void @mTensorConvForward(ptr noundef %40)
  store i32 1, ptr %5, align 4
  br label %168

41:                                               ; preds = %31
  br label %42

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

53:                                               ; preds = %42
  %54 = load i32, ptr %6, align 4, !tbaa !9
  call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef %54, i32 noundef -1, ptr noundef @.str.1, i32 noundef 672, ptr noundef @__FUNCTION__.mTensorGroupConvForward, ptr noundef @.str.25)
  br label %55

55:                                               ; preds = %53, %42
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  br label %56

56:                                               ; preds = %55
  br label %57

57:                                               ; preds = %56
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #4
  %58 = load ptr, ptr %4, align 8, !tbaa !5
  %59 = getelementptr inbounds %struct.TensorGroupConvPara, ptr %58, i32 0, i32 0
  %60 = load ptr, ptr %59, align 8, !tbaa !17
  %61 = getelementptr inbounds %struct.MLayer, ptr %60, i32 0, i32 2
  %62 = load ptr, ptr %61, align 8, !tbaa !18
  store ptr %62, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #4
  %63 = load ptr, ptr %2, align 8, !tbaa !5
  %64 = getelementptr inbounds %struct.MLayer, ptr %63, i32 0, i32 2
  %65 = load ptr, ptr %64, align 8, !tbaa !18
  store ptr %65, ptr %8, align 8, !tbaa !5
  %66 = load ptr, ptr %2, align 8, !tbaa !5
  call void @TensorGroupConvSet(ptr noundef %66)
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #4
  %67 = load ptr, ptr %8, align 8, !tbaa !5
  %68 = call ptr @GetHandle(ptr noundef %67, i32 noundef 24, i32 noundef -2105121901, ptr noundef @endTensorGroupConv)
  store ptr %68, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #4
  %69 = load ptr, ptr %9, align 8, !tbaa !5
  %70 = getelementptr inbounds %struct.MHandle, ptr %69, i32 0, i32 3
  %71 = load ptr, ptr %70, align 8, !tbaa !19
  store ptr %71, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #4
  %72 = load ptr, ptr %7, align 8, !tbaa !5
  %73 = getelementptr inbounds %struct.MTensor, ptr %72, i32 0, i32 1
  %74 = load i32, ptr %73, align 4, !tbaa !21
  %75 = load ptr, ptr %4, align 8, !tbaa !5
  %76 = getelementptr inbounds %struct.TensorGroupConvPara, ptr %75, i32 0, i32 10
  %77 = load i32, ptr %76, align 4, !tbaa !13
  %78 = sdiv i32 %77, 2
  %79 = sub nsw i32 %74, %78
  %80 = add nsw i32 %79, 1
  %81 = load ptr, ptr %4, align 8, !tbaa !5
  %82 = getelementptr inbounds %struct.TensorGroupConvPara, ptr %81, i32 0, i32 11
  %83 = load i32, ptr %82, align 8, !tbaa !23
  %84 = sdiv i32 %80, %83
  store i32 %84, ptr %11, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #4
  %85 = load ptr, ptr %8, align 8, !tbaa !5
  %86 = getelementptr inbounds %struct.MTensor, ptr %85, i32 0, i32 2
  %87 = load i32, ptr %86, align 8, !tbaa !24
  %88 = load ptr, ptr %8, align 8, !tbaa !5
  %89 = getelementptr inbounds %struct.MTensor, ptr %88, i32 0, i32 3
  %90 = load i32, ptr %89, align 4, !tbaa !25
  %91 = mul nsw i32 %87, %90
  %92 = load i32, ptr %11, align 4, !tbaa !9
  %93 = mul nsw i32 %91, %92
  store i32 %93, ptr %12, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #4
  %94 = load ptr, ptr %4, align 8, !tbaa !5
  %95 = getelementptr inbounds %struct.TensorGroupConvPara, ptr %94, i32 0, i32 2
  %96 = load i32, ptr %95, align 4, !tbaa !26
  %97 = load ptr, ptr %4, align 8, !tbaa !5
  %98 = getelementptr inbounds %struct.TensorGroupConvPara, ptr %97, i32 0, i32 3
  %99 = load i32, ptr %98, align 8, !tbaa !27
  %100 = mul nsw i32 %96, %99
  %101 = load ptr, ptr %4, align 8, !tbaa !5
  %102 = getelementptr inbounds %struct.TensorGroupConvPara, ptr %101, i32 0, i32 10
  %103 = load i32, ptr %102, align 4, !tbaa !13
  %104 = mul nsw i32 %100, %103
  %105 = add nsw i32 %104, 1
  store i32 %105, ptr %13, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #4
  %106 = load ptr, ptr %10, align 8, !tbaa !5
  %107 = getelementptr inbounds %struct.HandleTensorGroupConv, ptr %106, i32 0, i32 0
  %108 = load ptr, ptr %107, align 8, !tbaa !28
  %109 = getelementptr inbounds %struct.MMemoryBlock, ptr %108, i32 0, i32 2
  %110 = load ptr, ptr %109, align 8, !tbaa !30
  store ptr %110, ptr %14, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #4
  store i32 0, ptr %15, align 4, !tbaa !9
  br label %111

111:                                              ; preds = %162, %57
  %112 = load i32, ptr %15, align 4, !tbaa !9
  %113 = load ptr, ptr %7, align 8, !tbaa !5
  %114 = getelementptr inbounds %struct.MTensor, ptr %113, i32 0, i32 0
  %115 = load i32, ptr %114, align 8, !tbaa !32
  %116 = icmp slt i32 %112, %115
  br i1 %116, label %118, label %117

117:                                              ; preds = %111
  store i32 6, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #4
  br label %165

118:                                              ; preds = %111
  %119 = load ptr, ptr %7, align 8, !tbaa !5
  %120 = load i32, ptr %15, align 4, !tbaa !9
  %121 = load ptr, ptr %14, align 8, !tbaa !5
  %122 = load ptr, ptr %4, align 8, !tbaa !5
  %123 = getelementptr inbounds %struct.TensorGroupConvPara, ptr %122, i32 0, i32 10
  %124 = load i32, ptr %123, align 4, !tbaa !13
  %125 = load ptr, ptr %4, align 8, !tbaa !5
  %126 = getelementptr inbounds %struct.TensorGroupConvPara, ptr %125, i32 0, i32 2
  %127 = load i32, ptr %126, align 4, !tbaa !26
  %128 = load ptr, ptr %4, align 8, !tbaa !5
  %129 = getelementptr inbounds %struct.TensorGroupConvPara, ptr %128, i32 0, i32 3
  %130 = load i32, ptr %129, align 8, !tbaa !27
  %131 = load ptr, ptr %4, align 8, !tbaa !5
  %132 = getelementptr inbounds %struct.TensorGroupConvPara, ptr %131, i32 0, i32 11
  %133 = load i32, ptr %132, align 8, !tbaa !23
  %134 = load ptr, ptr %4, align 8, !tbaa !5
  %135 = getelementptr inbounds %struct.TensorGroupConvPara, ptr %134, i32 0, i32 5
  %136 = load i32, ptr %135, align 8, !tbaa !33
  %137 = load ptr, ptr %4, align 8, !tbaa !5
  %138 = getelementptr inbounds %struct.TensorGroupConvPara, ptr %137, i32 0, i32 4
  %139 = load i32, ptr %138, align 4, !tbaa !34
  call void @GroupConvTensorToMatData(ptr noundef %119, i32 noundef %120, ptr noundef %121, i32 noundef %124, i32 noundef %127, i32 noundef %130, i32 noundef %133, i32 noundef %136, i32 noundef %139)
  %140 = load ptr, ptr %14, align 8, !tbaa !5
  %141 = load i32, ptr %13, align 4, !tbaa !9
  %142 = sub nsw i32 %141, 1
  %143 = sext i32 %142 to i64
  %144 = getelementptr inbounds float, ptr %140, i64 %143
  store float 1.000000e+00, ptr %144, align 4, !tbaa !35
  %145 = load ptr, ptr %4, align 8, !tbaa !5
  %146 = getelementptr inbounds %struct.TensorGroupConvPara, ptr %145, i32 0, i32 1
  %147 = load i32, ptr %146, align 8, !tbaa !36
  %148 = load i32, ptr %12, align 4, !tbaa !9
  %149 = load i32, ptr %13, align 4, !tbaa !9
  %150 = load ptr, ptr %10, align 8, !tbaa !5
  %151 = getelementptr inbounds %struct.HandleTensorGroupConv, ptr %150, i32 0, i32 1
  %152 = load ptr, ptr %151, align 8, !tbaa !37
  %153 = load i32, ptr %13, align 4, !tbaa !9
  %154 = load ptr, ptr %10, align 8, !tbaa !5
  %155 = getelementptr inbounds %struct.HandleTensorGroupConv, ptr %154, i32 0, i32 0
  %156 = load ptr, ptr %155, align 8, !tbaa !28
  %157 = load i32, ptr %13, align 4, !tbaa !9
  %158 = load ptr, ptr %8, align 8, !tbaa !5
  %159 = load i32, ptr %15, align 4, !tbaa !9
  %160 = call ptr @mTensorMemory(ptr noundef %158, i32 noundef %159)
  %161 = load i32, ptr %12, align 4, !tbaa !9
  call void @mSgemm(i32 noundef 0, i32 noundef 1, i32 noundef %147, i32 noundef %148, i32 noundef %149, float noundef 1.000000e+00, ptr noundef %152, i32 noundef %153, ptr noundef %156, i32 noundef %157, float noundef 0.000000e+00, ptr noundef %160, i32 noundef %161)
  br label %162

162:                                              ; preds = %118
  %163 = load i32, ptr %15, align 4, !tbaa !9
  %164 = add nsw i32 %163, 1
  store i32 %164, ptr %15, align 4, !tbaa !9
  br label %111, !llvm.loop !38

165:                                              ; preds = %117
  %166 = load ptr, ptr %2, align 8, !tbaa !5
  %167 = getelementptr inbounds %struct.MLayer, ptr %166, i32 0, i32 5
  store i32 0, ptr %167, align 8, !tbaa !40
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #4
  store i32 0, ptr %5, align 4
  br label %168

168:                                              ; preds = %165, %39
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #4
  %169 = load i32, ptr %5, align 4
  switch i32 %169, label %171 [
    i32 0, label %170
    i32 1, label %170
  ]

170:                                              ; preds = %168, %168
  ret void

171:                                              ; preds = %168
  unreachable
}

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

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !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 = !{!20, !6, i64 16}
!20 = !{!"MHandle", !10, i64 0, !10, i64 4, !6, i64 8, !6, i64 16}
!21 = !{!22, !10, i64 4}
!22 = !{!"MTensor", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !6, i64 16, !10, i64 24}
!23 = !{!14, !10, i64 48}
!24 = !{!22, !10, i64 8}
!25 = !{!22, !10, i64 12}
!26 = !{!14, !10, i64 12}
!27 = !{!14, !10, i64 16}
!28 = !{!29, !6, i64 0}
!29 = !{!"HandleTensorGroupConv", !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 = !{!22, !10, i64 0}
!33 = !{!14, !10, i64 24}
!34 = !{!14, !10, i64 20}
!35 = !{!15, !15, i64 0}
!36 = !{!14, !10, i64 8}
!37 = !{!29, !6, i64 8}
!38 = distinct !{!38, !39}
!39 = !{!"llvm.loop.mustprogress"}
!40 = !{!12, !10, i64 64}


; 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
@.str.19 = external hidden unnamed_addr constant [14 x i8], align 1
@__FUNCTION__.mTensorGroupConvForward = external hidden unnamed_addr constant [24 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [19 x i8], align 1

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

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

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

; Function Attrs: nounwind uwtable
declare dso_local void @mTensorConvForward(ptr 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 #0

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

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

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

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

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

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

7:                                                ; preds = %1, %2
  %8 = getelementptr inbounds i8, ptr %0, i64 56
  %9 = load ptr, ptr %8, align 8, !tbaa !5
  %10 = getelementptr inbounds i8, ptr %9, i64 44
  %11 = load i32, ptr %10, align 4, !tbaa !11
  %12 = icmp slt i32 %11, 1
  br i1 %12, label %13, label %14

13:                                               ; preds = %7
  tail call void @mTensorConvForward(ptr noundef nonnull %0)
  br label %77

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

20:                                               ; preds = %14
  tail call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef %19, i32 noundef -1, ptr noundef nonnull @.str.1, i32 noundef 672, ptr noundef nonnull @__FUNCTION__.mTensorGroupConvForward, ptr noundef nonnull @.str.25) #3
  br label %21

21:                                               ; preds = %20, %14
  %22 = load ptr, ptr %9, align 8, !tbaa !15
  %23 = getelementptr inbounds i8, ptr %22, i64 40
  %24 = load ptr, ptr %23, align 8, !tbaa !16
  %25 = getelementptr inbounds i8, ptr %0, i64 40
  %26 = load ptr, ptr %25, align 8, !tbaa !16
  tail call void @TensorGroupConvSet(ptr noundef nonnull %0)
  %27 = tail call ptr @GetHandle(ptr noundef %26, i32 noundef 24, i32 noundef -2105121901, ptr noundef nonnull @endTensorGroupConv) #3
  %28 = getelementptr inbounds i8, ptr %27, i64 16
  %29 = load ptr, ptr %28, align 8, !tbaa !17
  %30 = getelementptr inbounds i8, ptr %24, i64 4
  %31 = load i32, ptr %30, align 4, !tbaa !19
  %32 = load i32, ptr %10, align 4, !tbaa !11
  %.neg = sdiv i32 %32, -2
  %33 = add i32 %31, 1
  %34 = add i32 %33, %.neg
  %35 = getelementptr inbounds i8, ptr %9, i64 48
  %36 = load i32, ptr %35, align 8, !tbaa !21
  %37 = sdiv i32 %34, %36
  %38 = getelementptr inbounds i8, ptr %26, i64 8
  %39 = load i32, ptr %38, align 8, !tbaa !22
  %40 = getelementptr inbounds i8, ptr %26, i64 12
  %41 = load i32, ptr %40, align 4, !tbaa !23
  %42 = mul i32 %39, %37
  %43 = mul i32 %42, %41
  %44 = getelementptr inbounds i8, ptr %9, i64 12
  %45 = load i32, ptr %44, align 4, !tbaa !24
  %46 = getelementptr inbounds i8, ptr %9, i64 16
  %47 = load i32, ptr %46, align 8, !tbaa !25
  %48 = mul i32 %45, %32
  %49 = mul i32 %48, %47
  %50 = add nsw i32 %49, 1
  %51 = load ptr, ptr %29, align 8, !tbaa !26
  %52 = getelementptr inbounds i8, ptr %51, i64 8
  %53 = load ptr, ptr %52, align 8, !tbaa !28
  %54 = load i32, ptr %24, align 8, !tbaa !30
  %55 = icmp sgt i32 %54, 0
  br i1 %55, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %21
  %56 = getelementptr inbounds i8, ptr %9, i64 24
  %57 = getelementptr inbounds i8, ptr %9, i64 20
  %58 = sext i32 %49 to i64
  %59 = getelementptr inbounds float, ptr %53, i64 %58
  %60 = getelementptr inbounds i8, ptr %9, i64 8
  %61 = getelementptr inbounds i8, ptr %29, i64 8
  br label %63

._crit_edge:                                      ; preds = %63, %21
  %62 = getelementptr inbounds i8, ptr %0, i64 64
  store i32 0, ptr %62, align 8, !tbaa !31
  br label %77

63:                                               ; preds = %.lr.ph, %63
  %.050 = phi i32 [ 0, %.lr.ph ], [ %74, %63 ]
  %64 = load i32, ptr %10, align 4, !tbaa !11
  %65 = load i32, ptr %44, align 4, !tbaa !24
  %66 = load i32, ptr %46, align 8, !tbaa !25
  %67 = load i32, ptr %35, align 8, !tbaa !21
  %68 = load i32, ptr %56, align 8, !tbaa !32
  %69 = load i32, ptr %57, align 4, !tbaa !33
  tail call void @GroupConvTensorToMatData(ptr noundef nonnull %24, i32 noundef %.050, ptr noundef %53, i32 noundef %64, i32 noundef %65, i32 noundef %66, i32 noundef %67, i32 noundef %68, i32 noundef %69)
  store float 1.000000e+00, ptr %59, align 4, !tbaa !34
  %70 = load i32, ptr %60, align 8, !tbaa !35
  %71 = load ptr, ptr %61, align 8, !tbaa !36
  %72 = load ptr, ptr %29, align 8, !tbaa !26
  %73 = tail call ptr @mTensorMemory(ptr noundef %26, i32 noundef %.050) #3
  tail call void @mSgemm(i32 noundef 0, i32 noundef 1, i32 noundef %70, i32 noundef %43, i32 noundef %50, float noundef 1.000000e+00, ptr noundef %71, i32 noundef %50, ptr noundef %72, i32 noundef %50, float noundef 0.000000e+00, ptr noundef %73, i32 noundef %43) #3
  %74 = add nuw nsw i32 %.050, 1
  %75 = load i32, ptr %24, align 8, !tbaa !30
  %76 = icmp slt i32 %74, %75
  br i1 %76, label %63, label %._crit_edge, !llvm.loop !37

77:                                               ; preds = %._crit_edge, %13
  ret void
}

attributes #0 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
attributes #4 = { 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 = !{!18, !10, i64 16}
!18 = !{!"MHandle", !9, i64 0, !9, i64 4, !10, i64 8, !10, i64 16}
!19 = !{!20, !9, i64 4}
!20 = !{!"MTensor", !9, i64 0, !9, i64 4, !9, i64 8, !9, i64 12, !10, i64 16, !9, i64 24}
!21 = !{!12, !9, i64 48}
!22 = !{!20, !9, i64 8}
!23 = !{!20, !9, i64 12}
!24 = !{!12, !9, i64 12}
!25 = !{!12, !9, i64 16}
!26 = !{!27, !10, i64 0}
!27 = !{!"HandleTensorGroupConv", !10, i64 0, !10, i64 8, !10, i64 16}
!28 = !{!29, !10, i64 8}
!29 = !{!"MMemoryBlock", !9, i64 0, !9, i64 4, !10, i64 8, !10, i64 16, !10, i64 24, !9, i64 32}
!30 = !{!20, !9, i64 0}
!31 = !{!6, !9, i64 64}
!32 = !{!12, !9, i64 24}
!33 = !{!12, !9, i64 20}
!34 = !{!13, !13, i64 0}
!35 = !{!12, !9, i64 8}
!36 = !{!27, !10, i64 8}
!37 = distinct !{!37, !38}
!38 = !{!"llvm.loop.mustprogress"}


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