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

; 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.TensorDirConvPara = 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.HandleTensorDirConv = type { ptr, ptr, ptr }
%struct.MMemoryBlock = type { i32, i32, ptr, ptr, ptr, i32 }

@.str.1 = external hidden unnamed_addr constant [93 x i8], align 1
@morn_tensor_register = external global [256 x %struct.TensorRegister], align 16
@__FUNCTION__.mTensorDirConvForward = external hidden unnamed_addr constant [22 x i8], align 1
@.str.29 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.30 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.31 = 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

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

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

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

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

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

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

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

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

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

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

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

25:                                               ; preds = %20
  %26 = load i32, ptr %3, align 4, !tbaa !9
  call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef %26, i32 noundef -1, ptr noundef @.str.1, i32 noundef 546, ptr noundef @__FUNCTION__.mTensorDirConvForward, ptr noundef @.str.29)
  br label %27

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

28:                                               ; preds = %27
  br label %29

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

40:                                               ; preds = %29
  %41 = load i32, ptr %4, align 4, !tbaa !9
  call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef %41, i32 noundef -1, ptr noundef @.str.1, i32 noundef 547, ptr noundef @__FUNCTION__.mTensorDirConvForward, ptr noundef @.str.31)
  br label %42

42:                                               ; preds = %40, %29
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #4
  br label %43

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

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

87:                                               ; preds = %81
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #4
  br label %128

88:                                               ; preds = %81
  %89 = load ptr, ptr %6, align 8, !tbaa !5
  %90 = load i32, ptr %12, align 4, !tbaa !9
  %91 = load ptr, ptr %9, align 8, !tbaa !5
  %92 = getelementptr inbounds %struct.HandleTensorDirConv, ptr %91, i32 0, i32 0
  %93 = load ptr, ptr %92, align 8, !tbaa !26
  %94 = getelementptr inbounds %struct.MMemoryBlock, ptr %93, i32 0, i32 2
  %95 = load ptr, ptr %94, align 8, !tbaa !28
  %96 = load ptr, ptr %5, align 8, !tbaa !5
  %97 = getelementptr inbounds %struct.TensorDirConvPara, ptr %96, i32 0, i32 2
  %98 = load i32, ptr %97, align 4, !tbaa !23
  %99 = load ptr, ptr %5, align 8, !tbaa !5
  %100 = getelementptr inbounds %struct.TensorDirConvPara, ptr %99, i32 0, i32 3
  %101 = load i32, ptr %100, align 8, !tbaa !30
  %102 = load ptr, ptr %5, align 8, !tbaa !5
  %103 = getelementptr inbounds %struct.TensorDirConvPara, ptr %102, i32 0, i32 5
  %104 = load i32, ptr %103, align 8, !tbaa !31
  %105 = load ptr, ptr %5, align 8, !tbaa !5
  %106 = getelementptr inbounds %struct.TensorDirConvPara, ptr %105, i32 0, i32 4
  %107 = load i32, ptr %106, align 4, !tbaa !32
  call void @DirConvTensorToMatData(ptr noundef %89, i32 noundef %90, ptr noundef %95, i32 noundef %98, i32 noundef %101, i32 noundef %104, i32 noundef %107)
  %108 = load ptr, ptr %5, align 8, !tbaa !5
  %109 = getelementptr inbounds %struct.TensorDirConvPara, ptr %108, i32 0, i32 1
  %110 = load i32, ptr %109, align 8, !tbaa !33
  %111 = load i32, ptr %10, align 4, !tbaa !9
  %112 = load i32, ptr %11, align 4, !tbaa !9
  %113 = load ptr, ptr %9, align 8, !tbaa !5
  %114 = getelementptr inbounds %struct.HandleTensorDirConv, ptr %113, i32 0, i32 1
  %115 = load ptr, ptr %114, align 8, !tbaa !34
  %116 = load i32, ptr %11, align 4, !tbaa !9
  %117 = load ptr, ptr %9, align 8, !tbaa !5
  %118 = getelementptr inbounds %struct.HandleTensorDirConv, ptr %117, i32 0, i32 0
  %119 = load ptr, ptr %118, align 8, !tbaa !26
  %120 = load i32, ptr %11, align 4, !tbaa !9
  %121 = load ptr, ptr %7, align 8, !tbaa !5
  %122 = load i32, ptr %12, align 4, !tbaa !9
  %123 = call ptr @mTensorMemory(ptr noundef %121, i32 noundef %122)
  %124 = load i32, ptr %10, align 4, !tbaa !9
  call void @mSgemm(i32 noundef 0, i32 noundef 1, i32 noundef %110, i32 noundef %111, i32 noundef %112, float noundef 1.000000e+00, ptr noundef %115, i32 noundef %116, ptr noundef %119, i32 noundef %120, float noundef 0.000000e+00, ptr noundef %123, i32 noundef %124)
  br label %125

125:                                              ; preds = %88
  %126 = load i32, ptr %12, align 4, !tbaa !9
  %127 = add nsw i32 %126, 1
  store i32 %127, ptr %12, align 4, !tbaa !9
  br label %81, !llvm.loop !35

128:                                              ; preds = %87
  %129 = load ptr, ptr %2, align 8, !tbaa !5
  %130 = getelementptr inbounds %struct.MLayer, ptr %129, i32 0, i32 5
  store i32 0, ptr %130, align 8, !tbaa !37
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #4
  ret void
}

declare 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

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !10, i64 32}
!12 = !{!"MLayer", !7, i64 0, !10, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !10, i64 64}
!13 = !{!12, !6, i64 56}
!14 = !{!15, !6, i64 0}
!15 = !{!"TensorDirConvPara", !6, i64 0, !10, i64 8, !10, i64 12, !10, i64 16, !10, i64 20, !10, i64 24, !10, i64 28, !16, i64 32, !16, i64 36, !16, i64 40}
!16 = !{!"float", !7, i64 0}
!17 = !{!12, !6, i64 40}
!18 = !{!19, !6, i64 16}
!19 = !{!"MHandle", !10, i64 0, !10, i64 4, !6, i64 8, !6, i64 16}
!20 = !{!21, !10, i64 8}
!21 = !{!"MTensor", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !6, i64 16, !10, i64 24}
!22 = !{!21, !10, i64 12}
!23 = !{!15, !10, i64 12}
!24 = !{!21, !10, i64 4}
!25 = !{!21, !10, i64 0}
!26 = !{!27, !6, i64 0}
!27 = !{!"HandleTensorDirConv", !6, i64 0, !6, i64 8, !6, i64 16}
!28 = !{!29, !6, i64 8}
!29 = !{!"MMemoryBlock", !10, i64 0, !10, i64 4, !6, i64 8, !6, i64 16, !6, i64 24, !10, i64 32}
!30 = !{!15, !10, i64 16}
!31 = !{!15, !10, i64 24}
!32 = !{!15, !10, i64 20}
!33 = !{!15, !10, i64 8}
!34 = !{!27, !6, i64 8}
!35 = distinct !{!35, !36}
!36 = !{!"llvm.loop.mustprogress"}
!37 = !{!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 [93 x i8], align 1
@morn_tensor_register = external global [256 x %struct.TensorRegister], align 16
@__FUNCTION__.mTensorDirConvForward = external hidden unnamed_addr constant [22 x i8], align 1
@.str.29 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.30 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.31 = 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

; Function Attrs: nounwind uwtable
declare dso_local void @DirConvTensorToMatData(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 @endTensorDirConv(ptr noundef) #2

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

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

; Function Attrs: nounwind uwtable
define dso_local void @mTensorDirConvForward(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 546, ptr noundef nonnull @__FUNCTION__.mTensorDirConvForward, ptr noundef nonnull @.str.29) #3
  br label %7

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

13:                                               ; preds = %7
  tail call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef %12, i32 noundef -1, ptr noundef nonnull @.str.1, i32 noundef 547, ptr noundef nonnull @__FUNCTION__.mTensorDirConvForward, ptr noundef nonnull @.str.31) #3
  br label %14

14:                                               ; preds = %13, %7
  %15 = getelementptr inbounds i8, ptr %0, i64 56
  %16 = load ptr, ptr %15, align 8, !tbaa !11
  %17 = load ptr, ptr %16, align 8, !tbaa !12
  %18 = getelementptr inbounds i8, ptr %17, i64 40
  %19 = load ptr, ptr %18, align 8, !tbaa !15
  %20 = getelementptr inbounds i8, ptr %0, i64 40
  %21 = load ptr, ptr %20, align 8, !tbaa !15
  tail call void @TensorDirConvSet(ptr noundef nonnull %0)
  %22 = tail call ptr @GetHandle(ptr noundef %21, i32 noundef 24, i32 noundef -1641646925, ptr noundef nonnull @endTensorDirConv) #3
  %23 = getelementptr inbounds i8, ptr %22, i64 16
  %24 = load ptr, ptr %23, align 8, !tbaa !16
  %25 = getelementptr inbounds i8, ptr %21, i64 8
  %26 = load i32, ptr %25, align 8, !tbaa !18
  %27 = getelementptr inbounds i8, ptr %21, i64 12
  %28 = load i32, ptr %27, align 4, !tbaa !20
  %29 = mul nsw i32 %28, %26
  %30 = getelementptr inbounds i8, ptr %16, i64 12
  %31 = load i32, ptr %30, align 4, !tbaa !21
  %32 = shl nsw i32 %31, 1
  %33 = or disjoint i32 %32, 1
  %34 = getelementptr inbounds i8, ptr %19, i64 4
  %35 = load i32, ptr %34, align 4, !tbaa !22
  %36 = mul nsw i32 %33, %35
  %37 = add nsw i32 %36, 1
  %38 = load i32, ptr %19, align 8, !tbaa !23
  %39 = icmp sgt i32 %38, 0
  br i1 %39, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %14
  %40 = getelementptr inbounds i8, ptr %16, i64 16
  %41 = getelementptr inbounds i8, ptr %16, i64 24
  %42 = getelementptr inbounds i8, ptr %16, i64 20
  %43 = getelementptr inbounds i8, ptr %16, i64 8
  %44 = getelementptr inbounds i8, ptr %24, i64 8
  br label %46

._crit_edge:                                      ; preds = %46, %14
  %45 = getelementptr inbounds i8, ptr %0, i64 64
  store i32 0, ptr %45, align 8, !tbaa !24
  ret void

46:                                               ; preds = %.lr.ph, %46
  %.039 = phi i32 [ 0, %.lr.ph ], [ %58, %46 ]
  %47 = load ptr, ptr %24, align 8, !tbaa !25
  %48 = getelementptr inbounds i8, ptr %47, i64 8
  %49 = load ptr, ptr %48, align 8, !tbaa !27
  %50 = load i32, ptr %30, align 4, !tbaa !21
  %51 = load i32, ptr %40, align 8, !tbaa !29
  %52 = load i32, ptr %41, align 8, !tbaa !30
  %53 = load i32, ptr %42, align 4, !tbaa !31
  tail call void @DirConvTensorToMatData(ptr noundef nonnull %19, i32 noundef %.039, ptr noundef %49, i32 noundef %50, i32 noundef %51, i32 noundef %52, i32 noundef %53)
  %54 = load i32, ptr %43, align 8, !tbaa !32
  %55 = load ptr, ptr %44, align 8, !tbaa !33
  %56 = load ptr, ptr %24, align 8, !tbaa !25
  %57 = tail call ptr @mTensorMemory(ptr noundef %21, i32 noundef %.039) #3
  tail call void @mSgemm(i32 noundef 0, i32 noundef 1, i32 noundef %54, i32 noundef %29, i32 noundef %37, float noundef 1.000000e+00, ptr noundef %55, i32 noundef %37, ptr noundef %56, i32 noundef %37, float noundef 0.000000e+00, ptr noundef %57, i32 noundef %29) #3
  %58 = add nuw nsw i32 %.039, 1
  %59 = load i32, ptr %19, align 8, !tbaa !23
  %60 = icmp slt i32 %58, %59
  br i1 %60, label %46, label %._crit_edge, !llvm.loop !34
}

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

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


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