; LLVM IR from huawei-noah/bolt :: compute/tensor/src/cpu/arm (convolution)

; 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: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0

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

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

declare i32 @fflush(ptr noundef) #2

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i8 @_Z10tensorIs4d10TensorDesc(ptr noundef byval(%struct.TensorDesc) align 8) #3

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i8 @_Z10tensorIs5d10TensorDesc(ptr noundef byval(%struct.TensorDesc) align 8) #3

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

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_Z38convolution_transform_filter_bytes_arm10TensorDesc20ConvolutionParamSpec27ConvolutionForwardAlgorithmPj(ptr noundef byval(%struct.TensorDesc) align 8 %0, ptr noundef byval(%struct.ConvolutionParamSpec) align 8 %1, i32 noundef %2, ptr noundef %3) #6 {
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %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 i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca %struct.TensorDesc, align 8
  %18 = alloca i32, align 4
  %19 = alloca %struct.TensorDesc, align 8
  %20 = alloca i32, align 4
  %21 = alloca %struct.TensorDesc, align 8
  %22 = alloca i32, align 4
  %23 = alloca %struct.TensorDesc, align 8
  %24 = alloca i32, align 4
  %25 = alloca i32, align 4
  %26 = alloca i32, align 4
  %27 = alloca i32, align 4
  %28 = alloca i32, align 4
  %29 = alloca i32, align 4
  store i32 %2, ptr %6, align 4, !tbaa !5
  store ptr %3, ptr %7, align 8, !tbaa !9
  %30 = load ptr, ptr %7, align 8, !tbaa !9
  %31 = icmp eq ptr null, %30
  br i1 %31, label %32, label %48

32:                                               ; preds = %4
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #8
  store i32 1, ptr %8, align 4, !tbaa !11
  %33 = load i32, ptr %8, align 4, !tbaa !11
  %34 = icmp ne i32 %33, 0
  br i1 %34, label %35, label %47

35:                                               ; preds = %32
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #8
  %36 = call i64 (i64, ...) @syscall(i64 noundef 186) #8
  %37 = trunc i64 %36 to i32
  store i32 %37, ptr %9, align 4, !tbaa !13
  %38 = load i32, ptr %9, align 4, !tbaa !13
  %39 = call i32 (ptr, ...) @printf(ptr noundef @.str, i32 noundef %38)
  %40 = load ptr, ptr @stdout, align 8, !tbaa !9
  %41 = call i32 @fflush(ptr noundef %40)
  %42 = load i32, ptr %8, align 4, !tbaa !11
  %43 = call ptr @ee2str(i32 noundef %42)
  %44 = call i32 (ptr, ...) @printf(ptr noundef @.str.1, ptr noundef %43)
  %45 = load ptr, ptr @stdout, align 8, !tbaa !9
  %46 = call i32 @fflush(ptr noundef %45)
  call void @exit(i32 noundef 1) #9
  unreachable

47:                                               ; preds = %32
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #8
  br label %48

48:                                               ; preds = %47, %4
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #8
  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.memcpy.p0.p0.i64(ptr align 4 %17, ptr align 8 %0, i64 92, i1 false), !tbaa.struct !15
  %49 = call noundef zeroext i8 @_Z10tensorIs4d10TensorDesc(ptr noundef byval(%struct.TensorDesc) align 8 %17)
  %50 = icmp ne i8 %49, 0
  br i1 %50, label %51, label %68

51:                                               ; preds = %48
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %19, ptr align 8 %0, i64 92, i1 false), !tbaa.struct !15
  %52 = call noundef i32 @_Z11tensor4dGet10TensorDescP8DataTypeP10DataFormatPjS4_S4_S4_(ptr noundef byval(%struct.TensorDesc) align 8 %19, ptr noundef %10, ptr noundef %11, ptr noundef %12, ptr noundef %13, ptr noundef %15, ptr noundef %16)
  store i32 %52, ptr %18, align 4, !tbaa !11
  %53 = load i32, ptr %18, align 4, !tbaa !11
  %54 = icmp ne i32 %53, 0
  br i1 %54, label %55, label %67

55:                                               ; preds = %51
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #8
  %56 = call i64 (i64, ...) @syscall(i64 noundef 186) #8
  %57 = trunc i64 %56 to i32
  store i32 %57, ptr %20, align 4, !tbaa !13
  %58 = load i32, ptr %20, align 4, !tbaa !13
  %59 = call i32 (ptr, ...) @printf(ptr noundef @.str, i32 noundef %58)
  %60 = load ptr, ptr @stdout, align 8, !tbaa !9
  %61 = call i32 @fflush(ptr noundef %60)
  %62 = load i32, ptr %18, align 4, !tbaa !11
  %63 = call ptr @ee2str(i32 noundef %62)
  %64 = call i32 (ptr, ...) @printf(ptr noundef @.str.1, ptr noundef %63)
  %65 = load ptr, ptr @stdout, align 8, !tbaa !9
  %66 = call i32 @fflush(ptr noundef %65)
  call void @exit(i32 noundef 1) #9
  unreachable

67:                                               ; preds = %51
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #8
  store i32 1, ptr %14, align 4, !tbaa !13
  br label %90

68:                                               ; preds = %48
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %21, ptr align 8 %0, i64 92, i1 false), !tbaa.struct !15
  %69 = call noundef zeroext i8 @_Z10tensorIs5d10TensorDesc(ptr noundef byval(%struct.TensorDesc) align 8 %21)
  %70 = icmp ne i8 %69, 0
  br i1 %70, label %71, label %88

71:                                               ; preds = %68
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %23, ptr align 8 %0, i64 92, i1 false), !tbaa.struct !15
  %72 = call noundef i32 @_Z11tensor5dGet10TensorDescP8DataTypeP10DataFormatPjS4_S4_S4_S4_(ptr noundef byval(%struct.TensorDesc) align 8 %23, ptr noundef %10, ptr noundef %11, ptr noundef %12, ptr noundef %13, ptr noundef %14, ptr noundef %15, ptr noundef %16)
  store i32 %72, ptr %22, align 4, !tbaa !11
  %73 = load i32, ptr %22, align 4, !tbaa !11
  %74 = icmp ne i32 %73, 0
  br i1 %74, label %75, label %87

75:                                               ; preds = %71
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #8
  %76 = call i64 (i64, ...) @syscall(i64 noundef 186) #8
  %77 = trunc i64 %76 to i32
  store i32 %77, ptr %24, align 4, !tbaa !13
  %78 = load i32, ptr %24, align 4, !tbaa !13
  %79 = call i32 (ptr, ...) @printf(ptr noundef @.str, i32 noundef %78)
  %80 = load ptr, ptr @stdout, align 8, !tbaa !9
  %81 = call i32 @fflush(ptr noundef %80)
  %82 = load i32, ptr %22, align 4, !tbaa !11
  %83 = call ptr @ee2str(i32 noundef %82)
  %84 = call i32 (ptr, ...) @printf(ptr noundef @.str.1, ptr noundef %83)
  %85 = load ptr, ptr @stdout, align 8, !tbaa !9
  %86 = call i32 @fflush(ptr noundef %85)
  call void @exit(i32 noundef 1) #9
  unreachable

87:                                               ; preds = %71
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #8
  br label %89

88:                                               ; preds = %68
  store i32 51, ptr %5, align 4
  store i32 1, ptr %25, align 4
  br label %190

89:                                               ; preds = %87
  br label %90

90:                                               ; preds = %89, %67
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #8
  store i32 8, ptr %26, align 4, !tbaa !13
  %91 = getelementptr inbounds %struct.TensorDesc, ptr %0, i32 0, i32 0
  %92 = load i32, ptr %91, align 8, !tbaa !21
  %93 = icmp eq i32 %92, 4
  br i1 %93, label %94, label %95

94:                                               ; preds = %90
  store i32 16, ptr %26, align 4, !tbaa !13
  br label %95

95:                                               ; preds = %94, %90
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #8
  %96 = load i32, ptr %12, align 4, !tbaa !13
  %97 = getelementptr inbounds %struct.ConvolutionParamSpec, ptr %1, i32 0, i32 13
  %98 = load i32, ptr %97, align 4, !tbaa !23
  %99 = udiv i32 %96, %98
  store i32 %99, ptr %27, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %28) #8
  %100 = load i32, ptr %27, align 4, !tbaa !13
  %101 = load i32, ptr %26, align 4, !tbaa !13
  %102 = udiv i32 %100, %101
  %103 = load i32, ptr %27, align 4, !tbaa !13
  %104 = load i32, ptr %26, align 4, !tbaa !13
  %105 = urem i32 %103, %104
  %106 = icmp eq i32 %105, 0
  %107 = zext i1 %106 to i64
  %108 = select i1 %106, i32 0, i32 1
  %109 = add i32 %102, %108
  %110 = load i32, ptr %26, align 4, !tbaa !13
  %111 = mul i32 %109, %110
  %112 = getelementptr inbounds %struct.ConvolutionParamSpec, ptr %1, i32 0, i32 13
  %113 = load i32, ptr %112, align 4, !tbaa !23
  %114 = mul i32 %111, %113
  store i32 %114, ptr %28, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %29) #8
  store i32 0, ptr %29, align 4, !tbaa !11
  %115 = load i32, ptr %6, align 4, !tbaa !5
  switch i32 %115, label %167 [
    i32 5, label %116
    i32 1, label %123
    i32 3, label %134
    i32 4, label %145
    i32 6, label %156
  ]

116:                                              ; preds = %95
  %117 = load i32, ptr %28, align 4, !tbaa !13
  %118 = load i32, ptr %13, align 4, !tbaa !13
  %119 = mul i32 %117, %118
  %120 = mul i32 %119, 6
  %121 = mul i32 %120, 6
  %122 = load ptr, ptr %7, align 8, !tbaa !9
  store i32 %121, ptr %122, align 4, !tbaa !13
  br label %168

123:                                              ; preds = %95
  %124 = load i32, ptr %28, align 4, !tbaa !13
  %125 = load i32, ptr %13, align 4, !tbaa !13
  %126 = mul i32 %124, %125
  %127 = load i32, ptr %14, align 4, !tbaa !13
  %128 = mul i32 %126, %127
  %129 = load i32, ptr %15, align 4, !tbaa !13
  %130 = mul i32 %128, %129
  %131 = load i32, ptr %16, align 4, !tbaa !13
  %132 = mul i32 %130, %131
  %133 = load ptr, ptr %7, align 8, !tbaa !9
  store i32 %132, ptr %133, align 4, !tbaa !13
  br label %168

134:                                              ; preds = %95
  %135 = load i32, ptr %28, align 4, !tbaa !13
  %136 = load i32, ptr %13, align 4, !tbaa !13
  %137 = mul i32 %135, %136
  %138 = load i32, ptr %14, align 4, !tbaa !13
  %139 = mul i32 %137, %138
  %140 = load i32, ptr %15, align 4, !tbaa !13
  %141 = mul i32 %139, %140
  %142 = load i32, ptr %16, align 4, !tbaa !13
  %143 = mul i32 %141, %142
  %144 = load ptr, ptr %7, align 8, !tbaa !9
  store i32 %143, ptr %144, align 4, !tbaa !13
  br label %168

145:                                              ; preds = %95
  %146 = load i32, ptr %28, align 4, !tbaa !13
  %147 = load i32, ptr %13, align 4, !tbaa !13
  %148 = mul i32 %146, %147
  %149 = load i32, ptr %14, align 4, !tbaa !13
  %150 = mul i32 %148, %149
  %151 = load i32, ptr %15, align 4, !tbaa !13
  %152 = mul i32 %150, %151
  %153 = load i32, ptr %16, align 4, !tbaa !13
  %154 = mul i32 %152, %153
  %155 = load ptr, ptr %7, align 8, !tbaa !9
  store i32 %154, ptr %155, align 4, !tbaa !13
  br label %168

156:                                              ; preds = %95
  %157 = load i32, ptr %28, align 4, !tbaa !13
  %158 = load i32, ptr %13, align 4, !tbaa !13
  %159 = mul i32 %157, %158
  %160 = load i32, ptr %14, align 4, !tbaa !13
  %161 = mul i32 %159, %160
  %162 = load i32, ptr %15, align 4, !tbaa !13
  %163 = mul i32 %161, %162
  %164 = load i32, ptr %16, align 4, !tbaa !13
  %165 = mul i32 %163, %164
  %166 = load ptr, ptr %7, align 8, !tbaa !9
  store i32 %165, ptr %166, align 4, !tbaa !13
  br label %168

167:                                              ; preds = %95
  store i32 51, ptr %29, align 4, !tbaa !11
  br label %168

168:                                              ; preds = %167, %156, %145, %134, %123, %116
  %169 = load i32, ptr %10, align 4, !tbaa !16
  %170 = call noundef i32 @_Z7bytesOf8DataType(i32 noundef %169)
  %171 = load ptr, ptr %7, align 8, !tbaa !9
  %172 = load i32, ptr %171, align 4, !tbaa !13
  %173 = mul i32 %172, %170
  store i32 %173, ptr %171, align 4, !tbaa !13
  %174 = getelementptr inbounds %struct.TensorDesc, ptr %0, i32 0, i32 0
  %175 = load i32, ptr %174, align 8, !tbaa !21
  switch i32 %175, label %184 [
    i32 7, label %176
    i32 8, label %180
  ]

176:                                              ; preds = %168
  %177 = load ptr, ptr %7, align 8, !tbaa !9
  %178 = load i32, ptr %177, align 4, !tbaa !13
  %179 = udiv i32 %178, 8
  store i32 %179, ptr %177, align 4, !tbaa !13
  br label %185

180:                                              ; preds = %168
  %181 = load ptr, ptr %7, align 8, !tbaa !9
  %182 = load i32, ptr %181, align 4, !tbaa !13
  %183 = udiv i32 %182, 8
  store i32 %183, ptr %181, align 4, !tbaa !13
  br label %185

184:                                              ; preds = %168
  br label %185

185:                                              ; preds = %184, %180, %176
  %186 = load ptr, ptr %7, align 8, !tbaa !9
  %187 = load i32, ptr %186, align 4, !tbaa !13
  %188 = add i32 %187, 32
  store i32 %188, ptr %186, align 4, !tbaa !13
  %189 = load i32, ptr %29, align 4, !tbaa !11
  store i32 %189, ptr %5, align 4
  store i32 1, ptr %25, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %29) #8
  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 4, ptr %26) #8
  br label %190

190:                                              ; preds = %185, %88
  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
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #8
  %191 = load i32, ptr %5, align 4
  ret i32 %191
}

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i32 @_Z7bytesOf8DataType(i32 noundef) #7

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #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 = { 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 #4 = { 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 #5 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #6 = { 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 #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 = !{!"_ZTS27ConvolutionForwardAlgorithm", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"_ZTS2EE", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"int", !7, i64 0}
!15 = !{i64 0, i64 4, !16, i64 4, i64 4, !18, i64 8, i64 4, !13, i64 12, i64 80, !20}
!16 = !{!17, !17, i64 0}
!17 = !{!"_ZTS8DataType", !7, i64 0}
!18 = !{!19, !19, i64 0}
!19 = !{!"_ZTS10DataFormat", !7, i64 0}
!20 = !{!7, !7, i64 0}
!21 = !{!22, !17, i64 0}
!22 = !{!"_ZTS10TensorDesc", !17, i64 0, !19, i64 4, !14, i64 8, !7, i64 12}
!23 = !{!24, !14, i64 52}
!24 = !{!"_ZTS20ConvolutionParamSpec", !14, i64 0, !14, i64 4, !14, i64 8, !14, i64 12, !14, i64 16, !14, i64 20, !14, i64 24, !14, i64 28, !14, i64 32, !14, i64 36, !14, i64 40, !14, i64 44, !14, i64 48, !14, i64 52, !14, i64 56, !14, i64 60, !14, i64 64, !14, i64 68, !25, i64 72, !26, i64 76, !26, i64 80, !7, i64 84, !27, i64 92, !14, i64 96, !14, i64 100, !14, i64 104}
!25 = !{!"_ZTS15ConvolutionMode", !7, i64 0}
!26 = !{!"_ZTS14ActivationMode", !7, i64 0}
!27 = !{!"_ZTS9RoundMode", !7, i64 0}


; 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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0

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

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

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

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i8 @_Z10tensorIs4d10TensorDesc(ptr noundef byval(%struct.TensorDesc) align 8) local_unnamed_addr #3

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i8 @_Z10tensorIs5d10TensorDesc(ptr noundef byval(%struct.TensorDesc) align 8) local_unnamed_addr #3

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

; Function Attrs: mustprogress uwtable
define dso_local noundef range(i32 0, 52) i32 @_Z38convolution_transform_filter_bytes_arm10TensorDesc20ConvolutionParamSpec27ConvolutionForwardAlgorithmPj(ptr nocapture noundef readonly byval(%struct.TensorDesc) align 8 %0, ptr nocapture noundef readonly byval(%struct.ConvolutionParamSpec) align 8 %1, i32 noundef %2, ptr noundef %3) local_unnamed_addr #5 {
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %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 = icmp eq ptr %3, null
  br i1 %12, label %13, label %23

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

23:                                               ; preds = %4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %9) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %10) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %11) #7
  %24 = tail call noundef zeroext i8 @_Z10tensorIs4d10TensorDesc(ptr noundef nonnull byval(%struct.TensorDesc) align 8 %0)
  %.not = icmp eq i8 %24, 0
  br i1 %.not, label %38, label %25

25:                                               ; preds = %23
  %26 = call noundef i32 @_Z11tensor4dGet10TensorDescP8DataTypeP10DataFormatPjS4_S4_S4_(ptr noundef nonnull byval(%struct.TensorDesc) align 8 %0, ptr noundef nonnull %5, ptr noundef nonnull %6, ptr noundef nonnull %7, ptr noundef nonnull %8, ptr noundef nonnull %10, ptr noundef nonnull %11)
  %.not36 = icmp eq i32 %26, 0
  br i1 %.not36, label %37, label %27

27:                                               ; preds = %25
  %28 = call i64 (i64, ...) @syscall(i64 noundef 186) #7
  %29 = trunc i64 %28 to i32
  %30 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %29)
  %31 = load ptr, ptr @stdout, align 8, !tbaa !5
  %32 = call i32 @fflush(ptr noundef %31)
  %33 = call ptr @ee2str(i32 noundef %26)
  %34 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, ptr noundef %33)
  %35 = load ptr, ptr @stdout, align 8, !tbaa !5
  %36 = call i32 @fflush(ptr noundef %35)
  call void @exit(i32 noundef 1) #8
  unreachable

37:                                               ; preds = %25
  store i32 1, ptr %9, align 4, !tbaa !9
  br label %52

38:                                               ; preds = %23
  %39 = tail call noundef zeroext i8 @_Z10tensorIs5d10TensorDesc(ptr noundef nonnull byval(%struct.TensorDesc) align 8 %0)
  %.not34 = icmp eq i8 %39, 0
  br i1 %.not34, label %120, label %40

40:                                               ; preds = %38
  %41 = call noundef i32 @_Z11tensor5dGet10TensorDescP8DataTypeP10DataFormatPjS4_S4_S4_S4_(ptr noundef nonnull byval(%struct.TensorDesc) align 8 %0, ptr noundef nonnull %5, ptr noundef nonnull %6, ptr noundef nonnull %7, ptr noundef nonnull %8, ptr noundef nonnull %9, ptr noundef nonnull %10, ptr noundef nonnull %11)
  %.not35 = icmp eq i32 %41, 0
  br i1 %.not35, label %52, label %42

42:                                               ; preds = %40
  %43 = call i64 (i64, ...) @syscall(i64 noundef 186) #7
  %44 = trunc i64 %43 to i32
  %45 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %44)
  %46 = load ptr, ptr @stdout, align 8, !tbaa !5
  %47 = call i32 @fflush(ptr noundef %46)
  %48 = call ptr @ee2str(i32 noundef %41)
  %49 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, ptr noundef %48)
  %50 = load ptr, ptr @stdout, align 8, !tbaa !5
  %51 = call i32 @fflush(ptr noundef %50)
  call void @exit(i32 noundef 1) #8
  unreachable

52:                                               ; preds = %40, %37
  %53 = load i32, ptr %0, align 8, !tbaa !11
  %54 = icmp eq i32 %53, 4
  %55 = load i32, ptr %7, align 4, !tbaa !9
  %56 = getelementptr inbounds i8, ptr %1, i64 52
  %57 = load i32, ptr %56, align 4, !tbaa !15
  %58 = udiv i32 %55, %57
  %59 = select i1 %54, i32 4, i32 3
  %60 = lshr i32 %58, %59
  %61 = select i1 %54, i32 15, i32 7
  %62 = and i32 %58, %61
  %63 = icmp ne i32 %62, 0
  %64 = zext i1 %63 to i32
  %65 = add nuw nsw i32 %60, %64
  %66 = shl i32 %65, %59
  %67 = mul i32 %66, %57
  switch i32 %2, label %108 [
    i32 5, label %68
    i32 1, label %72
    i32 3, label %81
    i32 4, label %90
    i32 6, label %99
  ]

68:                                               ; preds = %52
  %69 = load i32, ptr %8, align 4, !tbaa !9
  %70 = mul i32 %67, 36
  %71 = mul i32 %70, %69
  br label %.sink.split

72:                                               ; preds = %52
  %73 = load i32, ptr %8, align 4, !tbaa !9
  %74 = mul i32 %73, %67
  %75 = load i32, ptr %9, align 4, !tbaa !9
  %76 = mul i32 %74, %75
  %77 = load i32, ptr %10, align 4, !tbaa !9
  %78 = mul i32 %76, %77
  %79 = load i32, ptr %11, align 4, !tbaa !9
  %80 = mul i32 %78, %79
  br label %.sink.split

81:                                               ; preds = %52
  %82 = load i32, ptr %8, align 4, !tbaa !9
  %83 = mul i32 %82, %67
  %84 = load i32, ptr %9, align 4, !tbaa !9
  %85 = mul i32 %83, %84
  %86 = load i32, ptr %10, align 4, !tbaa !9
  %87 = mul i32 %85, %86
  %88 = load i32, ptr %11, align 4, !tbaa !9
  %89 = mul i32 %87, %88
  br label %.sink.split

90:                                               ; preds = %52
  %91 = load i32, ptr %8, align 4, !tbaa !9
  %92 = mul i32 %91, %67
  %93 = load i32, ptr %9, align 4, !tbaa !9
  %94 = mul i32 %92, %93
  %95 = load i32, ptr %10, align 4, !tbaa !9
  %96 = mul i32 %94, %95
  %97 = load i32, ptr %11, align 4, !tbaa !9
  %98 = mul i32 %96, %97
  br label %.sink.split

99:                                               ; preds = %52
  %100 = load i32, ptr %8, align 4, !tbaa !9
  %101 = mul i32 %100, %67
  %102 = load i32, ptr %9, align 4, !tbaa !9
  %103 = mul i32 %101, %102
  %104 = load i32, ptr %10, align 4, !tbaa !9
  %105 = mul i32 %103, %104
  %106 = load i32, ptr %11, align 4, !tbaa !9
  %107 = mul i32 %105, %106
  br label %.sink.split

.sink.split:                                      ; preds = %68, %72, %81, %90, %99
  %.sink = phi i32 [ %107, %99 ], [ %98, %90 ], [ %89, %81 ], [ %80, %72 ], [ %71, %68 ]
  store i32 %.sink, ptr %3, align 4, !tbaa !9
  br label %108

108:                                              ; preds = %.sink.split, %52
  %.0 = phi i32 [ 51, %52 ], [ 0, %.sink.split ]
  %109 = load i32, ptr %5, align 4, !tbaa !20
  %110 = call noundef i32 @_Z7bytesOf8DataType(i32 noundef %109)
  %111 = load i32, ptr %3, align 4, !tbaa !9
  %112 = mul i32 %111, %110
  switch i32 %53, label %117 [
    i32 7, label %113
    i32 8, label %115
  ]

113:                                              ; preds = %108
  %114 = lshr i32 %112, 3
  br label %117

115:                                              ; preds = %108
  %116 = lshr i32 %112, 3
  br label %117

117:                                              ; preds = %108, %115, %113
  %118 = phi i32 [ %112, %108 ], [ %116, %115 ], [ %114, %113 ]
  %119 = add i32 %118, 32
  store i32 %119, ptr %3, align 4, !tbaa !9
  br label %120

120:                                              ; preds = %38, %117
  %.031 = phi i32 [ %.0, %117 ], [ 51, %38 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %11) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %10) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #7
  ret i32 %.031
}

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i32 @_Z7bytesOf8DataType(i32 noundef) local_unnamed_addr #6

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { 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 #3 = { 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 #4 = { 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 #5 = { 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 #6 = { 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 #7 = { nounwind }
attributes #8 = { 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, !13, i64 0}
!12 = !{!"_ZTS10TensorDesc", !13, i64 0, !14, i64 4, !10, i64 8, !7, i64 12}
!13 = !{!"_ZTS8DataType", !7, i64 0}
!14 = !{!"_ZTS10DataFormat", !7, i64 0}
!15 = !{!16, !10, i64 52}
!16 = !{!"_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, !17, i64 72, !18, i64 76, !18, i64 80, !7, i64 84, !19, i64 92, !10, i64 96, !10, i64 100, !10, i64 104}
!17 = !{!"_ZTS15ConvolutionMode", !7, i64 0}
!18 = !{!"_ZTS14ActivationMode", !7, i64 0}
!19 = !{!"_ZTS9RoundMode", !7, i64 0}
!20 = !{!13, !13, i64 0}


; Effective O3 passes: DSEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,MemCpyOptPass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass