; LLVM IR from huawei-noah/bolt :: compute/tensor/src/cpu/arm (depthwise_pointwise_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
@OMP_NUM_THREADS = external global i32, align 4

; 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 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: 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: mustprogress uwtable
define dso_local noundef i32 @_Z59depthwise_pointwise_convolution_infer_forward_tmp_bytes_arm10TensorDescS_S_S_20ConvolutionParamSpec36DepthwiseConvolutionForwardAlgorithmPj(ptr noundef byval(%struct.TensorDesc) align 8 %0, ptr noundef byval(%struct.TensorDesc) align 8 %1, ptr noundef byval(%struct.TensorDesc) align 8 %2, ptr noundef byval(%struct.TensorDesc) align 8 %3, ptr noundef byval(%struct.ConvolutionParamSpec) align 8 %4, i32 noundef %5, ptr noundef %6) #6 {
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  %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 i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  %22 = alloca i32, align 4
  %23 = alloca i32, align 4
  %24 = alloca i32, align 4
  %25 = alloca %struct.TensorDesc, align 8
  %26 = alloca i32, align 4
  %27 = alloca i32, align 4
  %28 = alloca %struct.TensorDesc, align 8
  %29 = alloca i32, align 4
  %30 = alloca i32, align 4
  %31 = alloca i32, align 4
  %32 = alloca i32, align 4
  %33 = alloca i32, align 4
  %34 = alloca i32, align 4
  %35 = alloca i32, align 4
  %36 = alloca i32, align 4
  %37 = alloca %struct.TensorDesc, align 8
  store i32 %5, ptr %8, align 4, !tbaa !5
  store ptr %6, ptr %9, align 8, !tbaa !9
  %38 = load ptr, ptr %9, align 8, !tbaa !9
  %39 = icmp eq ptr null, %38
  br i1 %39, label %40, label %56

40:                                               ; preds = %7
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #8
  store i32 1, ptr %10, align 4, !tbaa !11
  %41 = load i32, ptr %10, align 4, !tbaa !11
  %42 = icmp ne i32 %41, 0
  br i1 %42, label %43, label %55

43:                                               ; preds = %40
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #8
  %44 = call i64 (i64, ...) @syscall(i64 noundef 186) #8
  %45 = trunc i64 %44 to i32
  store i32 %45, ptr %11, align 4, !tbaa !13
  %46 = load i32, ptr %11, align 4, !tbaa !13
  %47 = call i32 (ptr, ...) @printf(ptr noundef @.str, i32 noundef %46)
  %48 = load ptr, ptr @stdout, align 8, !tbaa !9
  %49 = call i32 @fflush(ptr noundef %48)
  %50 = load i32, ptr %10, align 4, !tbaa !11
  %51 = call ptr @ee2str(i32 noundef %50)
  %52 = call i32 (ptr, ...) @printf(ptr noundef @.str.1, ptr noundef %51)
  %53 = load ptr, ptr @stdout, align 8, !tbaa !9
  %54 = call i32 @fflush(ptr noundef %53)
  call void @exit(i32 noundef 1) #9
  unreachable

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

56:                                               ; preds = %55, %7
  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.lifetime.start.p0(i64 4, ptr %20) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %25, ptr align 8 %0, i64 92, i1 false), !tbaa.struct !15
  %57 = call noundef i32 @_Z11tensor4dGet10TensorDescP8DataTypeP10DataFormatPjS4_S4_S4_(ptr noundef byval(%struct.TensorDesc) align 8 %25, ptr noundef %12, ptr noundef %14, ptr noundef %16, ptr noundef %17, ptr noundef %18, ptr noundef %19)
  store i32 %57, ptr %24, align 4, !tbaa !11
  %58 = load i32, ptr %24, align 4, !tbaa !11
  %59 = icmp ne i32 %58, 0
  br i1 %59, label %60, label %72

60:                                               ; preds = %56
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #8
  %61 = call i64 (i64, ...) @syscall(i64 noundef 186) #8
  %62 = trunc i64 %61 to i32
  store i32 %62, ptr %26, align 4, !tbaa !13
  %63 = load i32, ptr %26, align 4, !tbaa !13
  %64 = call i32 (ptr, ...) @printf(ptr noundef @.str, i32 noundef %63)
  %65 = load ptr, ptr @stdout, align 8, !tbaa !9
  %66 = call i32 @fflush(ptr noundef %65)
  %67 = load i32, ptr %24, align 4, !tbaa !11
  %68 = call ptr @ee2str(i32 noundef %67)
  %69 = call i32 (ptr, ...) @printf(ptr noundef @.str.1, ptr noundef %68)
  %70 = load ptr, ptr @stdout, align 8, !tbaa !9
  %71 = call i32 @fflush(ptr noundef %70)
  call void @exit(i32 noundef 1) #9
  unreachable

72:                                               ; preds = %56
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %28, ptr align 8 %3, i64 92, i1 false), !tbaa.struct !15
  %73 = call noundef i32 @_Z11tensor4dGet10TensorDescP8DataTypeP10DataFormatPjS4_S4_S4_(ptr noundef byval(%struct.TensorDesc) align 8 %28, ptr noundef %13, ptr noundef %15, ptr noundef %20, ptr noundef %21, ptr noundef %22, ptr noundef %23)
  store i32 %73, ptr %27, align 4, !tbaa !11
  %74 = load i32, ptr %27, align 4, !tbaa !11
  %75 = icmp ne i32 %74, 0
  br i1 %75, label %76, label %88

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

88:                                               ; preds = %72
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %30) #8
  %89 = getelementptr inbounds %struct.ConvolutionParamSpec, ptr %4, i32 0, i32 9
  %90 = load i32, ptr %89, align 4, !tbaa !21
  store i32 %90, ptr %30, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %31) #8
  %91 = getelementptr inbounds %struct.ConvolutionParamSpec, ptr %4, i32 0, i32 10
  %92 = load i32, ptr %91, align 8, !tbaa !26
  store i32 %92, ptr %31, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %32) #8
  %93 = getelementptr inbounds %struct.ConvolutionParamSpec, ptr %4, i32 0, i32 11
  %94 = load i32, ptr %93, align 4, !tbaa !27
  store i32 %94, ptr %32, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %33) #8
  %95 = getelementptr inbounds %struct.ConvolutionParamSpec, ptr %4, i32 0, i32 12
  %96 = load i32, ptr %95, align 8, !tbaa !28
  store i32 %96, ptr %33, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %34) #8
  %97 = load i32, ptr %18, align 4, !tbaa !13
  %98 = load i32, ptr %30, align 4, !tbaa !13
  %99 = add i32 %97, %98
  %100 = load i32, ptr %31, align 4, !tbaa !13
  %101 = add i32 %99, %100
  store i32 %101, ptr %34, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %35) #8
  %102 = load i32, ptr %19, align 4, !tbaa !13
  %103 = load i32, ptr %32, align 4, !tbaa !13
  %104 = add i32 %102, %103
  %105 = load i32, ptr %33, align 4, !tbaa !13
  %106 = add i32 %104, %105
  store i32 %106, ptr %35, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %36) #8
  store i32 0, ptr %36, align 4, !tbaa !11
  %107 = load i32, ptr %8, align 4, !tbaa !5
  switch i32 %107, label %140 [
    i32 1, label %108
    i32 2, label %121
    i32 3, label %128
  ]

108:                                              ; preds = %88
  %109 = load i32, ptr %17, align 4, !tbaa !13
  %110 = load i32, ptr %34, align 4, !tbaa !13
  %111 = mul i32 %109, %110
  %112 = load i32, ptr %35, align 4, !tbaa !13
  %113 = mul i32 %111, %112
  %114 = load i32, ptr %17, align 4, !tbaa !13
  %115 = load i32, ptr %22, align 4, !tbaa !13
  %116 = mul i32 %114, %115
  %117 = load i32, ptr %23, align 4, !tbaa !13
  %118 = mul i32 %116, %117
  %119 = add i32 %113, %118
  %120 = load ptr, ptr %9, align 8, !tbaa !9
  store i32 %119, ptr %120, align 4, !tbaa !13
  br label %142

121:                                              ; preds = %88
  %122 = load i32, ptr %17, align 4, !tbaa !13
  %123 = load i32, ptr %22, align 4, !tbaa !13
  %124 = mul i32 %122, %123
  %125 = load i32, ptr %23, align 4, !tbaa !13
  %126 = mul i32 %124, %125
  %127 = load ptr, ptr %9, align 8, !tbaa !9
  store i32 %126, ptr %127, align 4, !tbaa !13
  br label %142

128:                                              ; preds = %88
  %129 = load i32, ptr %17, align 4, !tbaa !13
  %130 = load i32, ptr %22, align 4, !tbaa !13
  %131 = mul i32 %129, %130
  %132 = load i32, ptr %23, align 4, !tbaa !13
  %133 = mul i32 %131, %132
  %134 = load i32, ptr %17, align 4, !tbaa !13
  %135 = mul i32 %134, 8
  %136 = load i32, ptr @OMP_NUM_THREADS, align 4, !tbaa !13
  %137 = mul i32 %135, %136
  %138 = add i32 %133, %137
  %139 = load ptr, ptr %9, align 8, !tbaa !9
  store i32 %138, ptr %139, align 4, !tbaa !13
  br label %142

140:                                              ; preds = %88
  store i32 2, ptr %36, align 4, !tbaa !11
  %141 = load ptr, ptr %9, align 8, !tbaa !9
  store i32 0, ptr %141, align 4, !tbaa !13
  br label %142

142:                                              ; preds = %140, %128, %121, %108
  %143 = load i32, ptr %12, align 4, !tbaa !16
  %144 = call noundef i32 @_Z7bytesOf8DataType(i32 noundef %143)
  %145 = load ptr, ptr %9, align 8, !tbaa !9
  %146 = load i32, ptr %145, align 4, !tbaa !13
  %147 = mul i32 %146, %144
  store i32 %147, ptr %145, align 4, !tbaa !13
  %148 = getelementptr inbounds %struct.TensorDesc, ptr %1, i32 0, i32 0
  %149 = load i32, ptr %148, align 8, !tbaa !29
  switch i32 %149, label %150 [
  ]

150:                                              ; preds = %142
  br label %151

151:                                              ; preds = %150
  %152 = load i32, ptr %14, align 4, !tbaa !18
  %153 = icmp ne i32 %152, 2
  br i1 %153, label %154, label %159

154:                                              ; preds = %151
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %37, ptr align 8 %0, i64 92, i1 false), !tbaa.struct !15
  %155 = call noundef i32 @_Z14tensorNumBytes10TensorDesc(ptr noundef byval(%struct.TensorDesc) align 8 %37)
  %156 = load ptr, ptr %9, align 8, !tbaa !9
  %157 = load i32, ptr %156, align 4, !tbaa !13
  %158 = add i32 %157, %155
  store i32 %158, ptr %156, align 4, !tbaa !13
  br label %159

159:                                              ; preds = %154, %151
  %160 = load ptr, ptr %9, align 8, !tbaa !9
  %161 = load i32, ptr %160, align 4, !tbaa !13
  %162 = add i32 %161, 32
  store i32 %162, ptr %160, align 4, !tbaa !13
  %163 = load i32, ptr %36, align 4, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 4, ptr %36) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %35) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %34) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %33) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %32) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %31) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %30) #8
  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 %21) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #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
  ret i32 %163
}

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i32 @_Z14tensorNumBytes10TensorDesc(ptr noundef byval(%struct.TensorDesc) align 8) #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 = !{!"_ZTS36DepthwiseConvolutionForwardAlgorithm", !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, !14, i64 36}
!22 = !{!"_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, !23, i64 72, !24, i64 76, !24, i64 80, !7, i64 84, !25, i64 92, !14, i64 96, !14, i64 100, !14, i64 104}
!23 = !{!"_ZTS15ConvolutionMode", !7, i64 0}
!24 = !{!"_ZTS14ActivationMode", !7, i64 0}
!25 = !{!"_ZTS9RoundMode", !7, i64 0}
!26 = !{!22, !14, i64 40}
!27 = !{!22, !14, i64 44}
!28 = !{!22, !14, i64 48}
!29 = !{!30, !17, i64 0}
!30 = !{!"_ZTS10TensorDesc", !17, i64 0, !19, i64 4, !14, i64 8, !7, i64 12}


; 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
@OMP_NUM_THREADS = external local_unnamed_addr global i32, align 4

; 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 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: mustprogress uwtable
define dso_local noundef range(i32 0, 3) i32 @_Z59depthwise_pointwise_convolution_infer_forward_tmp_bytes_arm10TensorDescS_S_S_20ConvolutionParamSpec36DepthwiseConvolutionForwardAlgorithmPj(ptr nocapture noundef readonly byval(%struct.TensorDesc) align 8 %0, ptr nocapture noundef readnone byval(%struct.TensorDesc) align 8 %1, ptr nocapture noundef readnone byval(%struct.TensorDesc) align 8 %2, ptr nocapture noundef readonly byval(%struct.TensorDesc) align 8 %3, ptr nocapture noundef readonly byval(%struct.ConvolutionParamSpec) align 8 %4, i32 noundef %5, ptr noundef %6) local_unnamed_addr #5 {
  %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 i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = icmp eq ptr %6, null
  br i1 %20, label %21, label %31

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

31:                                               ; preds = %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
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %12) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %13) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %14) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %15) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %16) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %17) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %18) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %19) #7
  %32 = call noundef i32 @_Z11tensor4dGet10TensorDescP8DataTypeP10DataFormatPjS4_S4_S4_(ptr noundef nonnull byval(%struct.TensorDesc) align 8 %0, ptr noundef nonnull %8, ptr noundef nonnull %10, ptr noundef nonnull %12, ptr noundef nonnull %13, ptr noundef nonnull %14, ptr noundef nonnull %15)
  %.not = icmp eq i32 %32, 0
  br i1 %.not, label %43, label %33

33:                                               ; preds = %31
  %34 = call i64 (i64, ...) @syscall(i64 noundef 186) #7
  %35 = trunc i64 %34 to i32
  %36 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %35)
  %37 = load ptr, ptr @stdout, align 8, !tbaa !5
  %38 = call i32 @fflush(ptr noundef %37)
  %39 = call ptr @ee2str(i32 noundef %32)
  %40 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, ptr noundef %39)
  %41 = load ptr, ptr @stdout, align 8, !tbaa !5
  %42 = call i32 @fflush(ptr noundef %41)
  call void @exit(i32 noundef 1) #8
  unreachable

43:                                               ; preds = %31
  %44 = call noundef i32 @_Z11tensor4dGet10TensorDescP8DataTypeP10DataFormatPjS4_S4_S4_(ptr noundef nonnull byval(%struct.TensorDesc) align 8 %3, ptr noundef nonnull %9, ptr noundef nonnull %11, ptr noundef nonnull %16, ptr noundef nonnull %17, ptr noundef nonnull %18, ptr noundef nonnull %19)
  %.not26 = icmp eq i32 %44, 0
  br i1 %.not26, label %55, label %45

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

55:                                               ; preds = %43
  switch i32 %5, label %89 [
    i32 1, label %56
    i32 2, label %76
    i32 3, label %82
  ]

56:                                               ; preds = %55
  %57 = load i32, ptr %15, align 4, !tbaa !9
  %58 = getelementptr inbounds i8, ptr %4, i64 44
  %59 = load i32, ptr %58, align 4, !tbaa !11
  %60 = add i32 %59, %57
  %61 = getelementptr inbounds i8, ptr %4, i64 48
  %62 = load i32, ptr %61, align 8, !tbaa !16
  %63 = add i32 %60, %62
  %64 = load i32, ptr %14, align 4, !tbaa !9
  %65 = getelementptr inbounds i8, ptr %4, i64 36
  %66 = load i32, ptr %65, align 4, !tbaa !17
  %67 = add i32 %66, %64
  %68 = getelementptr inbounds i8, ptr %4, i64 40
  %69 = load i32, ptr %68, align 8, !tbaa !18
  %70 = add i32 %67, %69
  %71 = load i32, ptr %13, align 4, !tbaa !9
  %72 = mul i32 %70, %63
  %73 = load i32, ptr %18, align 4, !tbaa !9
  %74 = load i32, ptr %19, align 4, !tbaa !9
  %75 = mul i32 %74, %73
  %reass.add28 = add i32 %75, %72
  %reass.mul29 = mul i32 %reass.add28, %71
  br label %89

76:                                               ; preds = %55
  %77 = load i32, ptr %13, align 4, !tbaa !9
  %78 = load i32, ptr %18, align 4, !tbaa !9
  %79 = mul i32 %78, %77
  %80 = load i32, ptr %19, align 4, !tbaa !9
  %81 = mul i32 %79, %80
  br label %89

82:                                               ; preds = %55
  %83 = load i32, ptr %13, align 4, !tbaa !9
  %84 = load i32, ptr %18, align 4, !tbaa !9
  %85 = load i32, ptr %19, align 4, !tbaa !9
  %86 = mul i32 %85, %84
  %87 = load i32, ptr @OMP_NUM_THREADS, align 4, !tbaa !9
  %88 = shl i32 %87, 3
  %reass.add = add i32 %88, %86
  %reass.mul = mul i32 %reass.add, %83
  br label %89

89:                                               ; preds = %55, %82, %76, %56
  %.sink = phi i32 [ %reass.mul, %82 ], [ %81, %76 ], [ %reass.mul29, %56 ], [ 0, %55 ]
  %.0 = phi i32 [ 0, %82 ], [ 0, %76 ], [ 0, %56 ], [ 2, %55 ]
  store i32 %.sink, ptr %6, align 4, !tbaa !9
  %90 = load i32, ptr %8, align 4, !tbaa !19
  %91 = call noundef i32 @_Z7bytesOf8DataType(i32 noundef %90)
  %92 = load i32, ptr %6, align 4, !tbaa !9
  %93 = mul i32 %92, %91
  store i32 %93, ptr %6, align 4, !tbaa !9
  %94 = load i32, ptr %10, align 4, !tbaa !21
  %.not27 = icmp eq i32 %94, 2
  br i1 %.not27, label %99, label %95

95:                                               ; preds = %89
  %96 = call noundef i32 @_Z14tensorNumBytes10TensorDesc(ptr noundef nonnull byval(%struct.TensorDesc) align 8 %0)
  %97 = load i32, ptr %6, align 4, !tbaa !9
  %98 = add i32 %97, %96
  br label %99

99:                                               ; preds = %95, %89
  %100 = phi i32 [ %98, %95 ], [ %93, %89 ]
  %101 = add i32 %100, 32
  store i32 %101, ptr %6, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %19) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %18) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %17) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %16) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %15) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %14) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %13) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %12) #7
  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
  ret i32 %.0
}

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i32 @_Z14tensorNumBytes10TensorDesc(ptr noundef byval(%struct.TensorDesc) align 8) 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, !10, i64 44}
!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 = !{!12, !10, i64 48}
!17 = !{!12, !10, i64 36}
!18 = !{!12, !10, i64 40}
!19 = !{!20, !20, i64 0}
!20 = !{!"_ZTS8DataType", !7, i64 0}
!21 = !{!22, !22, i64 0}
!22 = !{!"_ZTS10DataFormat", !7, i64 0}


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