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

; 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.PadParamSpec = type { i32, i32, i32, i32, i32, i32, i32, i32, float, i32 }

@.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 @_Z29padding_infer_output_size_cpu10TensorDesc12PadParamSpecPS_(ptr noundef byval(%struct.TensorDesc) align 8 %0, ptr noundef byval(%struct.PadParamSpec) align 8 %1, ptr noundef %2) #0 {
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %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 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca %struct.TensorDesc, align 8
  %15 = alloca i32, align 4
  %16 = alloca %struct.TensorDesc, align 8
  %17 = alloca i32, align 4
  %18 = alloca %struct.TensorDesc, align 8
  %19 = alloca i32, align 4
  %20 = alloca %struct.TensorDesc, align 8
  %21 = alloca i32, align 4
  %22 = alloca %struct.TensorDesc, align 8
  %23 = alloca i32, align 4
  %24 = alloca %struct.TensorDesc, align 8
  %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
  %30 = alloca i32, align 4
  %31 = alloca %struct.TensorDesc, align 8
  %32 = alloca %struct.TensorDesc, align 4
  %33 = alloca %struct.TensorDesc, align 8
  %34 = alloca %struct.TensorDesc, align 4
  %35 = alloca %struct.TensorDesc, align 8
  %36 = alloca %struct.TensorDesc, align 4
  store ptr %2, ptr %5, align 8, !tbaa !5
  %37 = load ptr, ptr %5, align 8, !tbaa !5
  %38 = icmp eq ptr null, %37
  br i1 %38, label %39, label %55

39:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #8
  store i32 1, ptr %6, align 4, !tbaa !9
  %40 = load i32, ptr %6, align 4, !tbaa !9
  %41 = icmp ne i32 %40, 0
  br i1 %41, label %42, label %54

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

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

55:                                               ; preds = %54, %3
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #8
  store i32 6, ptr %8, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #8
  store i32 0, ptr %9, align 4, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #8
  store i32 0, ptr %10, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #8
  store i32 0, ptr %11, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #8
  store i32 0, ptr %12, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #8
  store i32 0, ptr %13, align 4, !tbaa !11
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %14, ptr align 8 %0, i64 92, i1 false), !tbaa.struct !17
  %56 = call noundef zeroext i8 @_Z10tensorIs2d10TensorDesc(ptr noundef byval(%struct.TensorDesc) align 8 %14)
  %57 = icmp ne i8 %56, 0
  br i1 %57, label %58, label %75

58:                                               ; preds = %55
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %16, ptr align 8 %0, i64 92, i1 false), !tbaa.struct !17
  %59 = call noundef i32 @_Z11tensor2dGet10TensorDescP8DataTypeP10DataFormatPjS4_(ptr noundef byval(%struct.TensorDesc) align 8 %16, ptr noundef %8, ptr noundef %9, ptr noundef %10, ptr noundef %11)
  store i32 %59, ptr %15, align 4, !tbaa !9
  %60 = load i32, ptr %15, align 4, !tbaa !9
  %61 = icmp ne i32 %60, 0
  br i1 %61, label %62, label %74

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

74:                                               ; preds = %58
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #8
  store i32 1, ptr %12, align 4, !tbaa !11
  br label %118

75:                                               ; preds = %55
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %18, ptr align 8 %0, i64 92, i1 false), !tbaa.struct !17
  %76 = call noundef zeroext i8 @_Z10tensorIs3d10TensorDesc(ptr noundef byval(%struct.TensorDesc) align 8 %18)
  %77 = icmp ne i8 %76, 0
  br i1 %77, label %78, label %95

78:                                               ; preds = %75
  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 !17
  %79 = call noundef i32 @_Z11tensor3dGet10TensorDescP8DataTypeP10DataFormatPjS4_S4_(ptr noundef byval(%struct.TensorDesc) align 8 %20, ptr noundef %8, ptr noundef %9, ptr noundef %10, ptr noundef %11, ptr noundef %12)
  store i32 %79, ptr %19, align 4, !tbaa !9
  %80 = load i32, ptr %19, align 4, !tbaa !9
  %81 = icmp ne i32 %80, 0
  br i1 %81, label %82, label %94

82:                                               ; preds = %78
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #8
  %83 = call i64 (i64, ...) @syscall(i64 noundef 186) #8
  %84 = trunc i64 %83 to i32
  store i32 %84, ptr %21, align 4, !tbaa !11
  %85 = load i32, ptr %21, align 4, !tbaa !11
  %86 = call i32 (ptr, ...) @printf(ptr noundef @.str, i32 noundef %85)
  %87 = load ptr, ptr @stdout, align 8, !tbaa !5
  %88 = call i32 @fflush(ptr noundef %87)
  %89 = load i32, ptr %19, align 4, !tbaa !9
  %90 = call ptr @ee2str(i32 noundef %89)
  %91 = call i32 (ptr, ...) @printf(ptr noundef @.str.1, ptr noundef %90)
  %92 = load ptr, ptr @stdout, align 8, !tbaa !5
  %93 = call i32 @fflush(ptr noundef %92)
  call void @exit(i32 noundef 1) #9
  unreachable

94:                                               ; preds = %78
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #8
  store i32 1, ptr %13, align 4, !tbaa !11
  br label %117

95:                                               ; preds = %75
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %22, ptr align 8 %0, i64 92, i1 false), !tbaa.struct !17
  %96 = call noundef zeroext i8 @_Z10tensorIs4d10TensorDesc(ptr noundef byval(%struct.TensorDesc) align 8 %22)
  %97 = icmp ne i8 %96, 0
  br i1 %97, label %98, label %115

98:                                               ; preds = %95
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %24, ptr align 8 %0, i64 92, i1 false), !tbaa.struct !17
  %99 = call noundef i32 @_Z11tensor4dGet10TensorDescP8DataTypeP10DataFormatPjS4_S4_S4_(ptr noundef byval(%struct.TensorDesc) align 8 %24, ptr noundef %8, ptr noundef %9, ptr noundef %10, ptr noundef %11, ptr noundef %12, ptr noundef %13)
  store i32 %99, ptr %23, align 4, !tbaa !9
  %100 = load i32, ptr %23, align 4, !tbaa !9
  %101 = icmp ne i32 %100, 0
  br i1 %101, label %102, label %114

102:                                              ; preds = %98
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #8
  %103 = call i64 (i64, ...) @syscall(i64 noundef 186) #8
  %104 = trunc i64 %103 to i32
  store i32 %104, ptr %25, align 4, !tbaa !11
  %105 = load i32, ptr %25, align 4, !tbaa !11
  %106 = call i32 (ptr, ...) @printf(ptr noundef @.str, i32 noundef %105)
  %107 = load ptr, ptr @stdout, align 8, !tbaa !5
  %108 = call i32 @fflush(ptr noundef %107)
  %109 = load i32, ptr %23, align 4, !tbaa !9
  %110 = call ptr @ee2str(i32 noundef %109)
  %111 = call i32 (ptr, ...) @printf(ptr noundef @.str.1, ptr noundef %110)
  %112 = load ptr, ptr @stdout, align 8, !tbaa !5
  %113 = call i32 @fflush(ptr noundef %112)
  call void @exit(i32 noundef 1) #9
  unreachable

114:                                              ; preds = %98
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #8
  br label %116

115:                                              ; preds = %95
  store i32 51, ptr %4, align 4
  store i32 1, ptr %26, align 4
  br label %173

116:                                              ; preds = %114
  br label %117

117:                                              ; preds = %116, %94
  br label %118

118:                                              ; preds = %117, %74
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #8
  %119 = load i32, ptr %10, align 4, !tbaa !11
  store i32 %119, ptr %27, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %28) #8
  %120 = load i32, ptr %11, align 4, !tbaa !11
  %121 = getelementptr inbounds %struct.PadParamSpec, ptr %1, i32 0, i32 2
  %122 = load i32, ptr %121, align 8, !tbaa !19
  %123 = add i32 %120, %122
  %124 = getelementptr inbounds %struct.PadParamSpec, ptr %1, i32 0, i32 3
  %125 = load i32, ptr %124, align 4, !tbaa !23
  %126 = add i32 %123, %125
  store i32 %126, ptr %28, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %29) #8
  %127 = load i32, ptr %12, align 4, !tbaa !11
  %128 = getelementptr inbounds %struct.PadParamSpec, ptr %1, i32 0, i32 4
  %129 = load i32, ptr %128, align 8, !tbaa !24
  %130 = add i32 %127, %129
  %131 = getelementptr inbounds %struct.PadParamSpec, ptr %1, i32 0, i32 5
  %132 = load i32, ptr %131, align 4, !tbaa !25
  %133 = add i32 %130, %132
  store i32 %133, ptr %29, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %30) #8
  %134 = load i32, ptr %13, align 4, !tbaa !11
  %135 = getelementptr inbounds %struct.PadParamSpec, ptr %1, i32 0, i32 6
  %136 = load i32, ptr %135, align 8, !tbaa !26
  %137 = add i32 %134, %136
  %138 = getelementptr inbounds %struct.PadParamSpec, ptr %1, i32 0, i32 7
  %139 = load i32, ptr %138, align 4, !tbaa !27
  %140 = add i32 %137, %139
  store i32 %140, ptr %30, align 4, !tbaa !11
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %31, ptr align 8 %0, i64 92, i1 false), !tbaa.struct !17
  %141 = call noundef zeroext i8 @_Z10tensorIs2d10TensorDesc(ptr noundef byval(%struct.TensorDesc) align 8 %31)
  %142 = icmp ne i8 %141, 0
  br i1 %142, label %143, label %149

143:                                              ; preds = %118
  call void @llvm.lifetime.start.p0(i64 92, ptr %32) #8
  %144 = load i32, ptr %8, align 4, !tbaa !13
  %145 = load i32, ptr %9, align 4, !tbaa !15
  %146 = load i32, ptr %27, align 4, !tbaa !11
  %147 = load i32, ptr %28, align 4, !tbaa !11
  call void @_Z9tensor2df8DataType10DataFormatjj(ptr dead_on_unwind writable sret(%struct.TensorDesc) align 4 %32, i32 noundef %144, i32 noundef %145, i32 noundef %146, i32 noundef %147)
  %148 = load ptr, ptr %5, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %148, ptr align 4 %32, i64 92, i1 false), !tbaa.struct !17
  call void @llvm.lifetime.end.p0(i64 92, ptr %32) #8
  br label %172

149:                                              ; preds = %118
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %33, ptr align 8 %0, i64 92, i1 false), !tbaa.struct !17
  %150 = call noundef zeroext i8 @_Z10tensorIs3d10TensorDesc(ptr noundef byval(%struct.TensorDesc) align 8 %33)
  %151 = icmp ne i8 %150, 0
  br i1 %151, label %152, label %159

152:                                              ; preds = %149
  call void @llvm.lifetime.start.p0(i64 92, ptr %34) #8
  %153 = load i32, ptr %8, align 4, !tbaa !13
  %154 = load i32, ptr %9, align 4, !tbaa !15
  %155 = load i32, ptr %27, align 4, !tbaa !11
  %156 = load i32, ptr %28, align 4, !tbaa !11
  %157 = load i32, ptr %29, align 4, !tbaa !11
  call void @_Z9tensor3df8DataType10DataFormatjjj(ptr dead_on_unwind writable sret(%struct.TensorDesc) align 4 %34, i32 noundef %153, i32 noundef %154, i32 noundef %155, i32 noundef %156, i32 noundef %157)
  %158 = load ptr, ptr %5, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %158, ptr align 4 %34, i64 92, i1 false), !tbaa.struct !17
  call void @llvm.lifetime.end.p0(i64 92, ptr %34) #8
  br label %171

159:                                              ; preds = %149
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %35, ptr align 8 %0, i64 92, i1 false), !tbaa.struct !17
  %160 = call noundef zeroext i8 @_Z10tensorIs4d10TensorDesc(ptr noundef byval(%struct.TensorDesc) align 8 %35)
  %161 = icmp ne i8 %160, 0
  br i1 %161, label %162, label %170

162:                                              ; preds = %159
  call void @llvm.lifetime.start.p0(i64 92, ptr %36) #8
  %163 = load i32, ptr %8, align 4, !tbaa !13
  %164 = load i32, ptr %9, align 4, !tbaa !15
  %165 = load i32, ptr %27, align 4, !tbaa !11
  %166 = load i32, ptr %28, align 4, !tbaa !11
  %167 = load i32, ptr %29, align 4, !tbaa !11
  %168 = load i32, ptr %30, align 4, !tbaa !11
  call void @_Z9tensor4df8DataType10DataFormatjjjj(ptr dead_on_unwind writable sret(%struct.TensorDesc) align 4 %36, i32 noundef %163, i32 noundef %164, i32 noundef %165, i32 noundef %166, i32 noundef %167, i32 noundef %168)
  %169 = load ptr, ptr %5, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %169, ptr align 4 %36, i64 92, i1 false), !tbaa.struct !17
  call void @llvm.lifetime.end.p0(i64 92, ptr %36) #8
  br label %170

170:                                              ; preds = %162, %159
  br label %171

171:                                              ; preds = %170, %152
  br label %172

172:                                              ; preds = %171, %143
  store i32 0, ptr %4, align 4
  store i32 1, ptr %26, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %30) #8
  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
  br label %173

173:                                              ; preds = %172, %115
  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
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #8
  %174 = load i32, ptr %4, align 4
  ret i32 %174
}

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

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

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

declare i32 @fflush(ptr noundef) #3

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

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

; 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 zeroext i8 @_Z10tensorIs2d10TensorDesc(ptr noundef byval(%struct.TensorDesc) align 8) #4

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

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

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

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_Z9tensor2df8DataType10DataFormatjj(ptr dead_on_unwind noalias writable sret(%struct.TensorDesc) align 4, i32 noundef, i32 noundef, i32 noundef, i32 noundef) #7

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_Z9tensor3df8DataType10DataFormatjjj(ptr dead_on_unwind noalias writable sret(%struct.TensorDesc) align 4, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef) #7

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_Z9tensor4df8DataType10DataFormatjjjj(ptr dead_on_unwind noalias writable sret(%struct.TensorDesc) align 4, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef) #4

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 = { 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 = { "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 = { 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 #5 = { 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 #6 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 = !{!"_ZTS2EE", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"_ZTS8DataType", !7, i64 0}
!15 = !{!16, !16, i64 0}
!16 = !{!"_ZTS10DataFormat", !7, i64 0}
!17 = !{i64 0, i64 4, !13, i64 4, i64 4, !15, i64 8, i64 4, !11, i64 12, i64 80, !18}
!18 = !{!7, !7, i64 0}
!19 = !{!20, !12, i64 8}
!20 = !{!"_ZTS12PadParamSpec", !12, i64 0, !12, i64 4, !12, i64 8, !12, i64 12, !12, i64 16, !12, i64 20, !12, i64 24, !12, i64 28, !21, i64 32, !22, i64 36}
!21 = !{!"float", !7, i64 0}
!22 = !{!"_ZTS7PadMode", !7, i64 0}
!23 = !{!20, !12, i64 12}
!24 = !{!20, !12, i64 16}
!25 = !{!20, !12, i64 20}
!26 = !{!20, !12, i64 24}
!27 = !{!20, !12, i64 28}


; 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.PadParamSpec = type { i32, i32, i32, i32, i32, i32, i32, i32, float, i32 }

@.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, 52) i32 @_Z29padding_infer_output_size_cpu10TensorDesc12PadParamSpecPS_(ptr nocapture noundef readonly byval(%struct.TensorDesc) align 8 %0, ptr nocapture noundef readonly byval(%struct.PadParamSpec) align 8 %1, ptr noundef writeonly %2) local_unnamed_addr #0 {
  %4 = alloca i32, align 4
  %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 %struct.TensorDesc, align 4
  %11 = alloca %struct.TensorDesc, align 4
  %12 = alloca %struct.TensorDesc, align 4
  %13 = icmp eq ptr %2, null
  br i1 %13, label %14, label %24

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

24:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #8
  store i32 6, ptr %4, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #8
  store i32 0, ptr %5, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #8
  store i32 0, ptr %6, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #8
  store i32 0, ptr %7, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #8
  store i32 0, ptr %8, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %9) #8
  store i32 0, ptr %9, align 4, !tbaa !13
  %25 = tail call noundef zeroext i8 @_Z10tensorIs2d10TensorDesc(ptr noundef nonnull byval(%struct.TensorDesc) align 8 %0)
  %.not = icmp eq i8 %25, 0
  br i1 %.not, label %39, label %26

26:                                               ; preds = %24
  %27 = call noundef i32 @_Z11tensor2dGet10TensorDescP8DataTypeP10DataFormatPjS4_(ptr noundef nonnull byval(%struct.TensorDesc) align 8 %0, ptr noundef nonnull %4, ptr noundef nonnull %5, ptr noundef nonnull %6, ptr noundef nonnull %7)
  %.not32 = icmp eq i32 %27, 0
  br i1 %.not32, label %38, label %28

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

38:                                               ; preds = %26
  store i32 1, ptr %8, align 4, !tbaa !13
  br label %68

39:                                               ; preds = %24
  %40 = tail call noundef zeroext i8 @_Z10tensorIs3d10TensorDesc(ptr noundef nonnull byval(%struct.TensorDesc) align 8 %0)
  %.not28 = icmp eq i8 %40, 0
  br i1 %.not28, label %54, label %41

41:                                               ; preds = %39
  %42 = call noundef i32 @_Z11tensor3dGet10TensorDescP8DataTypeP10DataFormatPjS4_S4_(ptr noundef nonnull byval(%struct.TensorDesc) align 8 %0, ptr noundef nonnull %4, ptr noundef nonnull %5, ptr noundef nonnull %6, ptr noundef nonnull %7, ptr noundef nonnull %8)
  %.not31 = icmp eq i32 %42, 0
  br i1 %.not31, label %53, label %43

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

53:                                               ; preds = %41
  store i32 1, ptr %9, align 4, !tbaa !13
  br label %68

54:                                               ; preds = %39
  %55 = tail call noundef zeroext i8 @_Z10tensorIs4d10TensorDesc(ptr noundef nonnull byval(%struct.TensorDesc) align 8 %0)
  %.not29 = icmp eq i8 %55, 0
  br i1 %.not29, label %105, label %56

56:                                               ; preds = %54
  %57 = call noundef i32 @_Z11tensor4dGet10TensorDescP8DataTypeP10DataFormatPjS4_S4_S4_(ptr noundef nonnull byval(%struct.TensorDesc) align 8 %0, ptr noundef nonnull %4, ptr noundef nonnull %5, ptr noundef nonnull %6, ptr noundef nonnull %7, ptr noundef nonnull %8, ptr noundef nonnull %9)
  %.not30 = icmp eq i32 %57, 0
  br i1 %.not30, label %._crit_edge, label %58

._crit_edge:                                      ; preds = %56
  %.pre = load i32, ptr %9, align 4, !tbaa !13
  br label %68

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

68:                                               ; preds = %._crit_edge, %53, %38
  %69 = phi i32 [ %.pre, %._crit_edge ], [ 1, %53 ], [ 0, %38 ]
  %70 = load i32, ptr %6, align 4, !tbaa !13
  %71 = load i32, ptr %7, align 4, !tbaa !13
  %72 = getelementptr inbounds i8, ptr %1, i64 8
  %73 = load i32, ptr %72, align 8, !tbaa !15
  %74 = add i32 %73, %71
  %75 = getelementptr inbounds i8, ptr %1, i64 12
  %76 = load i32, ptr %75, align 4, !tbaa !19
  %77 = add i32 %74, %76
  %78 = load i32, ptr %8, align 4, !tbaa !13
  %79 = getelementptr inbounds i8, ptr %1, i64 16
  %80 = load i32, ptr %79, align 8, !tbaa !20
  %81 = add i32 %80, %78
  %82 = getelementptr inbounds i8, ptr %1, i64 20
  %83 = load i32, ptr %82, align 4, !tbaa !21
  %84 = add i32 %81, %83
  %85 = getelementptr inbounds i8, ptr %1, i64 24
  %86 = load i32, ptr %85, align 8, !tbaa !22
  %87 = add i32 %86, %69
  %88 = getelementptr inbounds i8, ptr %1, i64 28
  %89 = load i32, ptr %88, align 4, !tbaa !23
  %90 = add i32 %87, %89
  %91 = call noundef zeroext i8 @_Z10tensorIs2d10TensorDesc(ptr noundef nonnull byval(%struct.TensorDesc) align 8 %0)
  %.not33 = icmp eq i8 %91, 0
  br i1 %.not33, label %95, label %92

92:                                               ; preds = %68
  call void @llvm.lifetime.start.p0(i64 92, ptr nonnull %10) #8
  %93 = load i32, ptr %4, align 4, !tbaa !9
  %94 = load i32, ptr %5, align 4, !tbaa !11
  call void @_Z9tensor2df8DataType10DataFormatjj(ptr dead_on_unwind nonnull writable sret(%struct.TensorDesc) align 4 %10, i32 noundef %93, i32 noundef %94, i32 noundef %70, i32 noundef %77)
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(92) %2, ptr noundef nonnull align 4 dereferenceable(92) %10, i64 92, i1 false), !tbaa.struct !24
  call void @llvm.lifetime.end.p0(i64 92, ptr nonnull %10) #8
  br label %105

95:                                               ; preds = %68
  %96 = call noundef zeroext i8 @_Z10tensorIs3d10TensorDesc(ptr noundef nonnull byval(%struct.TensorDesc) align 8 %0)
  %.not34 = icmp eq i8 %96, 0
  br i1 %.not34, label %100, label %97

97:                                               ; preds = %95
  call void @llvm.lifetime.start.p0(i64 92, ptr nonnull %11) #8
  %98 = load i32, ptr %4, align 4, !tbaa !9
  %99 = load i32, ptr %5, align 4, !tbaa !11
  call void @_Z9tensor3df8DataType10DataFormatjjj(ptr dead_on_unwind nonnull writable sret(%struct.TensorDesc) align 4 %11, i32 noundef %98, i32 noundef %99, i32 noundef %70, i32 noundef %77, i32 noundef %84)
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(92) %2, ptr noundef nonnull align 4 dereferenceable(92) %11, i64 92, i1 false), !tbaa.struct !24
  call void @llvm.lifetime.end.p0(i64 92, ptr nonnull %11) #8
  br label %105

100:                                              ; preds = %95
  %101 = call noundef zeroext i8 @_Z10tensorIs4d10TensorDesc(ptr noundef nonnull byval(%struct.TensorDesc) align 8 %0)
  %.not35 = icmp eq i8 %101, 0
  br i1 %.not35, label %105, label %102

102:                                              ; preds = %100
  call void @llvm.lifetime.start.p0(i64 92, ptr nonnull %12) #8
  %103 = load i32, ptr %4, align 4, !tbaa !9
  %104 = load i32, ptr %5, align 4, !tbaa !11
  call void @_Z9tensor4df8DataType10DataFormatjjjj(ptr dead_on_unwind nonnull writable sret(%struct.TensorDesc) align 4 %12, i32 noundef %103, i32 noundef %104, i32 noundef %70, i32 noundef %77, i32 noundef %84, i32 noundef %90)
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(92) %2, ptr noundef nonnull align 4 dereferenceable(92) %12, i64 92, i1 false), !tbaa.struct !24
  call void @llvm.lifetime.end.p0(i64 92, ptr nonnull %12) #8
  br label %105

105:                                              ; preds = %92, %100, %102, %97, %54
  %.0 = phi i32 [ 51, %54 ], [ 0, %97 ], [ 0, %102 ], [ 0, %100 ], [ 0, %92 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #8
  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: nounwind
declare i64 @syscall(i64 noundef, ...) local_unnamed_addr #2

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

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

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

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

; 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 zeroext i8 @_Z10tensorIs2d10TensorDesc(ptr noundef byval(%struct.TensorDesc) align 8) local_unnamed_addr #4

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

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

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

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_Z9tensor2df8DataType10DataFormatjj(ptr dead_on_unwind noalias writable sret(%struct.TensorDesc) align 4, i32 noundef, i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #7

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_Z9tensor3df8DataType10DataFormatjjj(ptr dead_on_unwind noalias writable sret(%struct.TensorDesc) align 4, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #7

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_Z9tensor4df8DataType10DataFormatjjjj(ptr dead_on_unwind noalias writable sret(%struct.TensorDesc) align 4, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #4

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 = { 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 = { 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 #4 = { 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 #5 = { 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 #6 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 = !{!"_ZTS8DataType", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"_ZTS10DataFormat", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"int", !7, i64 0}
!15 = !{!16, !14, i64 8}
!16 = !{!"_ZTS12PadParamSpec", !14, i64 0, !14, i64 4, !14, i64 8, !14, i64 12, !14, i64 16, !14, i64 20, !14, i64 24, !14, i64 28, !17, i64 32, !18, i64 36}
!17 = !{!"float", !7, i64 0}
!18 = !{!"_ZTS7PadMode", !7, i64 0}
!19 = !{!16, !14, i64 12}
!20 = !{!16, !14, i64 16}
!21 = !{!16, !14, i64 20}
!22 = !{!16, !14, i64 24}
!23 = !{!16, !14, i64 28}
!24 = !{i64 0, i64 4, !9, i64 4, i64 4, !11, i64 8, i64 4, !13, i64 12, i64 80, !25}
!25 = !{!7, !7, i64 0}


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