; LLVM IR from huawei-noah/bolt :: compute/tensor/src/cpu/x86/int8 (convolution_transform)

; 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.TensorDesc = type { i32, i32, i32, [20 x i32] }
%struct.ConvolutionParamSpec = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, %union.ActivationSpec, i32, i32, i32, i32 }
%union.ActivationSpec = type { %struct.ClipParamSpec }
%struct.ClipParamSpec = type { float, float }

@.str = external hidden unnamed_addr constant [20 x i8], align 1
@stdout = external global ptr, align 8
@.str.1 = external hidden unnamed_addr constant [18 x i8], align 1

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_Z33convolution_transform_filter_int810TensorDescPKa20ConvolutionParamSpec27ConvolutionForwardAlgorithmPS_Pa(ptr noundef byval(%struct.TensorDesc) align 8 %0, ptr noundef %1, ptr noundef byval(%struct.ConvolutionParamSpec) align 8 %2, i32 noundef %3, ptr noundef %4, ptr noundef %5) #0 {
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %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 i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca %struct.TensorDesc, align 8
  %21 = alloca i32, align 4
  %22 = alloca i32, align 4
  %23 = alloca i32, align 4
  %24 = alloca i32, align 4
  %25 = alloca i32, align 4
  %26 = alloca %struct.TensorDesc, align 4
  %27 = alloca i32, align 4
  %28 = alloca i32, align 4
  %29 = alloca %struct.TensorDesc, align 8
  %30 = alloca i32, align 4
  %31 = alloca i32, align 4
  %32 = alloca %struct.TensorDesc, align 8
  %33 = alloca i32, align 4
  %34 = alloca i32, align 4
  %35 = alloca %struct.TensorDesc, align 8
  store ptr %1, ptr %8, align 8, !tbaa !5
  store i32 %3, ptr %9, align 4, !tbaa !9
  store ptr %4, ptr %10, align 8, !tbaa !5
  store ptr %5, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %20, ptr align 8 %0, i64 92, i1 false), !tbaa.struct !11
  %36 = call noundef i32 @_Z11tensor4dGet10TensorDescP8DataTypeP10DataFormatPjS4_S4_S4_(ptr noundef byval(%struct.TensorDesc) align 8 %20, ptr noundef %13, ptr noundef %14, ptr noundef %15, ptr noundef %16, ptr noundef %17, ptr noundef %18)
  store i32 %36, ptr %19, align 4, !tbaa !19
  %37 = load i32, ptr %19, align 4, !tbaa !19
  %38 = icmp ne i32 %37, 0
  br i1 %38, label %39, label %51

39:                                               ; preds = %6
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #8
  %40 = call i64 (i64, ...) @syscall(i64 noundef 186) #8
  %41 = trunc i64 %40 to i32
  store i32 %41, ptr %21, align 4, !tbaa !16
  %42 = load i32, ptr %21, align 4, !tbaa !16
  %43 = call i32 (ptr, ...) @printf(ptr noundef @.str, i32 noundef %42)
  %44 = load ptr, ptr @stdout, align 8, !tbaa !5
  %45 = call i32 @fflush(ptr noundef %44)
  %46 = load i32, ptr %19, align 4, !tbaa !19
  %47 = call ptr @ee2str(i32 noundef %46)
  %48 = call i32 (ptr, ...) @printf(ptr noundef @.str.1, ptr noundef %47)
  %49 = load ptr, ptr @stdout, align 8, !tbaa !5
  %50 = call i32 @fflush(ptr noundef %49)
  call void @exit(i32 noundef 1) #9
  unreachable

51:                                               ; preds = %6
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #8
  store i32 0, ptr %22, align 4, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #8
  store i32 0, ptr %23, align 4, !tbaa !16
  %52 = load i32, ptr %15, align 4, !tbaa !16
  %53 = add i32 %52, 7
  %54 = udiv i32 %53, 8
  %55 = mul i32 %54, 8
  %56 = getelementptr inbounds %struct.ConvolutionParamSpec, ptr %2, i32 0, i32 13
  %57 = load i32, ptr %56, align 4, !tbaa !21
  %58 = udiv i32 %55, %57
  store i32 %58, ptr %15, align 4, !tbaa !16
  %59 = load i32, ptr %9, align 4, !tbaa !9
  switch i32 %59, label %61 [
    i32 0, label %60
    i32 1, label %60
  ]

60:                                               ; preds = %51, %51
  store i32 42, ptr %12, align 4, !tbaa !14
  store i32 24, ptr %23, align 4, !tbaa !16
  store i32 8, ptr %22, align 4, !tbaa !16
  br label %62

61:                                               ; preds = %51
  store i32 2, ptr %7, align 4
  store i32 1, ptr %24, align 4
  br label %144

62:                                               ; preds = %60
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #8
  %63 = getelementptr inbounds %struct.TensorDesc, ptr %0, i32 0, i32 2
  %64 = load i32, ptr %63, align 8, !tbaa !26
  %65 = sub i32 %64, 1
  store i32 %65, ptr %25, align 4, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 92, ptr %26) #8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %26, ptr align 8 %0, i64 92, i1 false), !tbaa.struct !11
  %66 = getelementptr inbounds %struct.ConvolutionParamSpec, ptr %2, i32 0, i32 13
  %67 = load i32, ptr %66, align 4, !tbaa !21
  %68 = getelementptr inbounds %struct.TensorDesc, ptr %26, i32 0, i32 3
  %69 = load i32, ptr %25, align 4, !tbaa !16
  %70 = zext i32 %69 to i64
  %71 = getelementptr inbounds [20 x i32], ptr %68, i64 0, i64 %70
  %72 = load i32, ptr %71, align 4, !tbaa !16
  %73 = udiv i32 %72, %67
  store i32 %73, ptr %71, align 4, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #8
  %74 = getelementptr inbounds %struct.TensorDesc, ptr %26, i32 0, i32 3
  %75 = load i32, ptr %25, align 4, !tbaa !16
  %76 = zext i32 %75 to i64
  %77 = getelementptr inbounds [20 x i32], ptr %74, i64 0, i64 %76
  %78 = load i32, ptr %77, align 4, !tbaa !16
  %79 = add i32 %78, 7
  %80 = udiv i32 %79, 8
  %81 = mul i32 %80, 8
  store i32 %81, ptr %27, align 4, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 4, ptr %28) #8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %29, ptr align 4 %26, i64 92, i1 false), !tbaa.struct !11
  %82 = call noundef i32 @_Z17tensorNumElements10TensorDesc(ptr noundef byval(%struct.TensorDesc) align 8 %29)
  store i32 %82, ptr %28, align 4, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 4, ptr %30) #8
  store i32 0, ptr %30, align 4, !tbaa !16
  br label %83

83:                                               ; preds = %130, %62
  %84 = load i32, ptr %30, align 4, !tbaa !16
  %85 = getelementptr inbounds %struct.ConvolutionParamSpec, ptr %2, i32 0, i32 13
  %86 = load i32, ptr %85, align 4, !tbaa !21
  %87 = icmp ult i32 %84, %86
  br i1 %87, label %89, label %88

88:                                               ; preds = %83
  store i32 3, ptr %24, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %30) #8
  br label %133

89:                                               ; preds = %83
  call void @llvm.lifetime.start.p0(i64 4, ptr %31) #8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %32, ptr align 4 %26, i64 92, i1 false), !tbaa.struct !11
  %90 = load ptr, ptr %8, align 8, !tbaa !5
  %91 = load ptr, ptr %10, align 8, !tbaa !5
  %92 = load ptr, ptr %11, align 8, !tbaa !5
  %93 = load i32, ptr %12, align 4, !tbaa !14
  %94 = load i32, ptr %22, align 4, !tbaa !16
  %95 = load i32, ptr %23, align 4, !tbaa !16
  %96 = call noundef i32 @_Z40convolution_transform_filter_kernel_int810TensorDescPKaPS_Pa10DataFormatjj(ptr noundef byval(%struct.TensorDesc) align 8 %32, ptr noundef %90, ptr noundef %91, ptr noundef %92, i32 noundef %93, i32 noundef %94, i32 noundef %95)
  store i32 %96, ptr %31, align 4, !tbaa !19
  %97 = load i32, ptr %31, align 4, !tbaa !19
  %98 = icmp ne i32 %97, 0
  br i1 %98, label %99, label %111

99:                                               ; preds = %89
  call void @llvm.lifetime.start.p0(i64 4, ptr %33) #8
  %100 = call i64 (i64, ...) @syscall(i64 noundef 186) #8
  %101 = trunc i64 %100 to i32
  store i32 %101, ptr %33, align 4, !tbaa !16
  %102 = load i32, ptr %33, align 4, !tbaa !16
  %103 = call i32 (ptr, ...) @printf(ptr noundef @.str, i32 noundef %102)
  %104 = load ptr, ptr @stdout, align 8, !tbaa !5
  %105 = call i32 @fflush(ptr noundef %104)
  %106 = load i32, ptr %31, align 4, !tbaa !19
  %107 = call ptr @ee2str(i32 noundef %106)
  %108 = call i32 (ptr, ...) @printf(ptr noundef @.str.1, ptr noundef %107)
  %109 = load ptr, ptr @stdout, align 8, !tbaa !5
  %110 = call i32 @fflush(ptr noundef %109)
  call void @exit(i32 noundef 1) #9
  unreachable

111:                                              ; preds = %89
  call void @llvm.lifetime.end.p0(i64 4, ptr %31) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %34) #8
  %112 = load ptr, ptr %10, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %35, ptr align 4 %112, i64 92, i1 false), !tbaa.struct !11
  %113 = call noundef i32 @_Z17tensorNumElements10TensorDesc(ptr noundef byval(%struct.TensorDesc) align 8 %35)
  %114 = getelementptr inbounds %struct.TensorDesc, ptr %26, i32 0, i32 3
  %115 = load i32, ptr %25, align 4, !tbaa !16
  %116 = zext i32 %115 to i64
  %117 = getelementptr inbounds [20 x i32], ptr %114, i64 0, i64 %116
  %118 = load i32, ptr %117, align 4, !tbaa !16
  %119 = udiv i32 %113, %118
  %120 = load i32, ptr %27, align 4, !tbaa !16
  %121 = mul i32 %119, %120
  store i32 %121, ptr %34, align 4, !tbaa !16
  %122 = load i32, ptr %28, align 4, !tbaa !16
  %123 = load ptr, ptr %8, align 8, !tbaa !5
  %124 = zext i32 %122 to i64
  %125 = getelementptr inbounds i8, ptr %123, i64 %124
  store ptr %125, ptr %8, align 8, !tbaa !5
  %126 = load i32, ptr %34, align 4, !tbaa !16
  %127 = load ptr, ptr %11, align 8, !tbaa !5
  %128 = zext i32 %126 to i64
  %129 = getelementptr inbounds i8, ptr %127, i64 %128
  store ptr %129, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %34) #8
  br label %130

130:                                              ; preds = %111
  %131 = load i32, ptr %30, align 4, !tbaa !16
  %132 = add i32 %131, 1
  store i32 %132, ptr %30, align 4, !tbaa !16
  br label %83, !llvm.loop !28

133:                                              ; preds = %88
  %134 = getelementptr inbounds %struct.TensorDesc, ptr %0, i32 0, i32 3
  %135 = load i32, ptr %25, align 4, !tbaa !16
  %136 = zext i32 %135 to i64
  %137 = getelementptr inbounds [20 x i32], ptr %134, i64 0, i64 %136
  %138 = load i32, ptr %137, align 4, !tbaa !16
  %139 = load ptr, ptr %10, align 8, !tbaa !5
  %140 = getelementptr inbounds %struct.TensorDesc, ptr %139, i32 0, i32 3
  %141 = load i32, ptr %25, align 4, !tbaa !16
  %142 = zext i32 %141 to i64
  %143 = getelementptr inbounds [20 x i32], ptr %140, i64 0, i64 %142
  store i32 %138, ptr %143, align 4, !tbaa !16
  store i32 0, ptr %7, align 4
  store i32 1, ptr %24, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %28) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #8
  call void @llvm.lifetime.end.p0(i64 92, ptr %26) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #8
  br label %144

144:                                              ; preds = %133, %61
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #8
  %145 = load i32, ptr %7, align 4
  ret i32 %145
}

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z11tensor4dGet10TensorDescP8DataTypeP10DataFormatPjS4_S4_S4_(ptr noundef byval(%struct.TensorDesc) align 8, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) #2

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #3

; Function Attrs: nounwind
declare i64 @syscall(i64 noundef, ...) #4

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

declare i32 @fflush(ptr noundef) #5

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local ptr @ee2str(i32 noundef) #2

; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) #6

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z17tensorNumElements10TensorDesc(ptr noundef byval(%struct.TensorDesc) align 8) #2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i32 @_Z40convolution_transform_filter_kernel_int810TensorDescPKaPS_Pa10DataFormatjj(ptr noundef byval(%struct.TensorDesc) align 8, ptr noundef, ptr noundef, ptr noundef, i32 noundef, i32 noundef, i32 noundef) #7

attributes #0 = { mustprogress 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 #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { inlinehint mustprogress 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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 = { "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 = { noreturn 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 #7 = { inlinehint mustprogress 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 #8 = { nounwind }
attributes #9 = { noreturn nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"_ZTS27ConvolutionForwardAlgorithm", !7, i64 0}
!11 = !{i64 0, i64 4, !12, i64 4, i64 4, !14, i64 8, i64 4, !16, i64 12, i64 80, !18}
!12 = !{!13, !13, i64 0}
!13 = !{!"_ZTS8DataType", !7, i64 0}
!14 = !{!15, !15, i64 0}
!15 = !{!"_ZTS10DataFormat", !7, i64 0}
!16 = !{!17, !17, i64 0}
!17 = !{!"int", !7, i64 0}
!18 = !{!7, !7, i64 0}
!19 = !{!20, !20, i64 0}
!20 = !{!"_ZTS2EE", !7, i64 0}
!21 = !{!22, !17, i64 52}
!22 = !{!"_ZTS20ConvolutionParamSpec", !17, i64 0, !17, i64 4, !17, i64 8, !17, i64 12, !17, i64 16, !17, i64 20, !17, i64 24, !17, i64 28, !17, i64 32, !17, i64 36, !17, i64 40, !17, i64 44, !17, i64 48, !17, i64 52, !17, i64 56, !17, i64 60, !17, i64 64, !17, i64 68, !23, i64 72, !24, i64 76, !24, i64 80, !7, i64 84, !25, i64 92, !17, i64 96, !17, i64 100, !17, i64 104}
!23 = !{!"_ZTS15ConvolutionMode", !7, i64 0}
!24 = !{!"_ZTS14ActivationMode", !7, i64 0}
!25 = !{!"_ZTS9RoundMode", !7, i64 0}
!26 = !{!27, !17, i64 8}
!27 = !{!"_ZTS10TensorDesc", !13, i64 0, !15, i64 4, !17, i64 8, !7, i64 12}
!28 = distinct !{!28, !29}
!29 = !{!"llvm.loop.mustprogress"}


; 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.TensorDesc = type { i32, i32, i32, [20 x i32] }
%struct.ConvolutionParamSpec = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, %union.ActivationSpec, i32, i32, i32, i32 }
%union.ActivationSpec = type { %struct.ClipParamSpec }
%struct.ClipParamSpec = type { float, float }

@.str = external hidden unnamed_addr constant [20 x i8], align 1
@stdout = external local_unnamed_addr global ptr, align 8
@.str.1 = external hidden unnamed_addr constant [18 x i8], align 1

; Function Attrs: mustprogress uwtable
define dso_local noundef range(i32 0, 3) i32 @_Z33convolution_transform_filter_int810TensorDescPKa20ConvolutionParamSpec27ConvolutionForwardAlgorithmPS_Pa(ptr nocapture noundef readonly byval(%struct.TensorDesc) align 8 %0, ptr noundef %1, ptr nocapture noundef readonly byval(%struct.ConvolutionParamSpec) align 8 %2, i32 noundef %3, ptr noundef %4, ptr noundef %5) local_unnamed_addr #0 {
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca %struct.TensorDesc, align 8
  %14 = alloca %struct.TensorDesc, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %9) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %10) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %11) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %12) #9
  %15 = call noundef i32 @_Z11tensor4dGet10TensorDescP8DataTypeP10DataFormatPjS4_S4_S4_(ptr noundef nonnull byval(%struct.TensorDesc) align 8 %0, ptr noundef nonnull %7, ptr noundef nonnull %8, ptr noundef nonnull %9, ptr noundef nonnull %10, ptr noundef nonnull %11, ptr noundef nonnull %12)
  %.not = icmp eq i32 %15, 0
  br i1 %.not, label %26, label %16

16:                                               ; preds = %6
  %17 = call i64 (i64, ...) @syscall(i64 noundef 186) #9
  %18 = trunc i64 %17 to i32
  %19 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %18)
  %20 = load ptr, ptr @stdout, align 8, !tbaa !5
  %21 = call i32 @fflush(ptr noundef %20)
  %22 = call ptr @ee2str(i32 noundef %15)
  %23 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, ptr noundef %22)
  %24 = load ptr, ptr @stdout, align 8, !tbaa !5
  %25 = call i32 @fflush(ptr noundef %24)
  call void @exit(i32 noundef 1) #10
  unreachable

26:                                               ; preds = %6
  %27 = load i32, ptr %9, align 4, !tbaa !9
  %28 = add i32 %27, 7
  %29 = and i32 %28, -8
  %30 = getelementptr inbounds i8, ptr %2, i64 52
  %31 = load i32, ptr %30, align 4, !tbaa !11
  %32 = udiv i32 %29, %31
  store i32 %32, ptr %9, align 4, !tbaa !9
  %switch = icmp ult i32 %3, 2
  br i1 %switch, label %33, label %72

33:                                               ; preds = %26
  %34 = getelementptr inbounds i8, ptr %0, i64 8
  %35 = load i32, ptr %34, align 8, !tbaa !16
  %36 = add i32 %35, -1
  call void @llvm.lifetime.start.p0(i64 92, ptr nonnull %13) #9
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(92) %13, ptr noundef nonnull align 8 dereferenceable(92) %0, i64 92, i1 false), !tbaa.struct !20
  %37 = getelementptr inbounds i8, ptr %13, i64 12
  %38 = zext i32 %36 to i64
  %39 = getelementptr inbounds [20 x i32], ptr %37, i64 0, i64 %38
  %40 = load i32, ptr %39, align 4, !tbaa !9
  %41 = udiv i32 %40, %31
  store i32 %41, ptr %39, align 4, !tbaa !9
  %42 = add i32 %41, 7
  %43 = and i32 %42, -8
  %44 = call noundef i32 @_Z17tensorNumElements10TensorDesc(ptr noundef nonnull byval(%struct.TensorDesc) align 8 %13)
  %45 = zext i32 %44 to i64
  %umax = call i32 @llvm.umax.i32(i32 %31, i32 1)
  br label %52

46:                                               ; preds = %64
  %47 = getelementptr inbounds i8, ptr %0, i64 12
  %48 = getelementptr inbounds [20 x i32], ptr %47, i64 0, i64 %38
  %49 = load i32, ptr %48, align 4, !tbaa !9
  %50 = getelementptr inbounds i8, ptr %4, i64 12
  %51 = getelementptr inbounds [20 x i32], ptr %50, i64 0, i64 %38
  store i32 %49, ptr %51, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 92, ptr nonnull %13) #9
  br label %72

52:                                               ; preds = %33, %64
  %.02735 = phi ptr [ %1, %33 ], [ %68, %64 ]
  %.02834 = phi ptr [ %5, %33 ], [ %70, %64 ]
  %.02933 = phi i32 [ 0, %33 ], [ %71, %64 ]
  %53 = call noundef i32 @_Z40convolution_transform_filter_kernel_int810TensorDescPKaPS_Pa10DataFormatjj(ptr noundef nonnull byval(%struct.TensorDesc) align 8 %13, ptr noundef %.02735, ptr noundef %4, ptr noundef %.02834, i32 noundef 42, i32 noundef 8, i32 noundef 24)
  %.not32 = icmp eq i32 %53, 0
  br i1 %.not32, label %64, label %54

54:                                               ; preds = %52
  %55 = call i64 (i64, ...) @syscall(i64 noundef 186) #9
  %56 = trunc i64 %55 to i32
  %57 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %56)
  %58 = load ptr, ptr @stdout, align 8, !tbaa !5
  %59 = call i32 @fflush(ptr noundef %58)
  %60 = call ptr @ee2str(i32 noundef %53)
  %61 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, ptr noundef %60)
  %62 = load ptr, ptr @stdout, align 8, !tbaa !5
  %63 = call i32 @fflush(ptr noundef %62)
  call void @exit(i32 noundef 1) #10
  unreachable

64:                                               ; preds = %52
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(92) %14, ptr noundef nonnull align 4 dereferenceable(92) %4, i64 92, i1 false), !tbaa.struct !20
  %65 = call noundef i32 @_Z17tensorNumElements10TensorDesc(ptr noundef nonnull byval(%struct.TensorDesc) align 8 %14)
  %66 = udiv i32 %65, %41
  %67 = mul i32 %66, %43
  %68 = getelementptr inbounds i8, ptr %.02735, i64 %45
  %69 = zext i32 %67 to i64
  %70 = getelementptr inbounds i8, ptr %.02834, i64 %69
  %71 = add nuw i32 %.02933, 1
  %exitcond.not = icmp eq i32 %71, %umax
  br i1 %exitcond.not, label %46, label %52, !llvm.loop !24

72:                                               ; preds = %26, %46
  %.0 = phi i32 [ 0, %46 ], [ 2, %26 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %12) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %11) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %10) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #9
  ret i32 %.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: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z11tensor4dGet10TensorDescP8DataTypeP10DataFormatPjS4_S4_S4_(ptr noundef byval(%struct.TensorDesc) align 8, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #3

; Function Attrs: nounwind
declare i64 @syscall(i64 noundef, ...) local_unnamed_addr #4

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

; Function Attrs: nofree nounwind
declare noundef i32 @fflush(ptr nocapture noundef) local_unnamed_addr #5

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local ptr @ee2str(i32 noundef) local_unnamed_addr #2

; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) local_unnamed_addr #6

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z17tensorNumElements10TensorDesc(ptr noundef byval(%struct.TensorDesc) align 8) local_unnamed_addr #2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i32 @_Z40convolution_transform_filter_kernel_int810TensorDescPKaPS_Pa10DataFormatjj(ptr noundef byval(%struct.TensorDesc) align 8, ptr noundef, ptr noundef, ptr noundef, i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #7

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.umax.i32(i32, i32) #8

attributes #0 = { mustprogress 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 #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { inlinehint mustprogress 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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 = { 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 #6 = { noreturn 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 #7 = { inlinehint mustprogress 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 #8 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #9 = { nounwind }
attributes #10 = { noreturn nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !10, i64 52}
!12 = !{!"_ZTS20ConvolutionParamSpec", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !10, i64 16, !10, i64 20, !10, i64 24, !10, i64 28, !10, i64 32, !10, i64 36, !10, i64 40, !10, i64 44, !10, i64 48, !10, i64 52, !10, i64 56, !10, i64 60, !10, i64 64, !10, i64 68, !13, i64 72, !14, i64 76, !14, i64 80, !7, i64 84, !15, i64 92, !10, i64 96, !10, i64 100, !10, i64 104}
!13 = !{!"_ZTS15ConvolutionMode", !7, i64 0}
!14 = !{!"_ZTS14ActivationMode", !7, i64 0}
!15 = !{!"_ZTS9RoundMode", !7, i64 0}
!16 = !{!17, !10, i64 8}
!17 = !{!"_ZTS10TensorDesc", !18, i64 0, !19, i64 4, !10, i64 8, !7, i64 12}
!18 = !{!"_ZTS8DataType", !7, i64 0}
!19 = !{!"_ZTS10DataFormat", !7, i64 0}
!20 = !{i64 0, i64 4, !21, i64 4, i64 4, !22, i64 8, i64 4, !9, i64 12, i64 80, !23}
!21 = !{!18, !18, i64 0}
!22 = !{!19, !19, i64 0}
!23 = !{!7, !7, i64 0}
!24 = distinct !{!24, !25}
!25 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: CorrelatedValuePropagationPass,DSEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,LCSSAPass,LICMPass,LoopRotatePass,LoopUnrollPass,MemCpyOptPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass