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

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

@.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
@.str.2 = external hidden unnamed_addr constant [23 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: mustprogress uwtable
declare dso_local void @_ZN6Tensor8get_descEv(ptr dead_on_unwind noalias writable sret(%struct.TensorDesc) align 4, ptr noundef nonnull align 8 dereferenceable(32)) #5 align 2

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

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

39:                                               ; preds = %5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #8
  store i32 1, ptr %11, align 4, !tbaa !9
  %40 = load i32, ptr %11, 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 %12) #8
  %43 = call i64 (i64, ...) @syscall(i64 noundef 186) #8
  %44 = trunc i64 %43 to i32
  store i32 %44, ptr %12, align 4, !tbaa !11
  %45 = load i32, ptr %12, 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 %11, 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 %11) #8
  br label %55

55:                                               ; preds = %54, %5
  call void @llvm.lifetime.start.p0(i64 92, ptr %13) #8
  call void @_ZN6Tensor8get_descEv(ptr dead_on_unwind writable sret(%struct.TensorDesc) align 4 %13, ptr noundef nonnull align 8 dereferenceable(32) %0)
  call void @llvm.lifetime.start.p0(i64 92, ptr %14) #8
  call void @_ZN6Tensor8get_descEv(ptr dead_on_unwind writable sret(%struct.TensorDesc) align 4 %14, ptr noundef nonnull align 8 dereferenceable(32) %1)
  call void @llvm.lifetime.start.p0(i64 92, ptr %15) #8
  call void @_ZN6Tensor8get_descEv(ptr dead_on_unwind writable sret(%struct.TensorDesc) align 4 %15, ptr noundef nonnull align 8 dereferenceable(32) %2)
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #8
  store i32 51, ptr %16, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #8
  %56 = load ptr, ptr %10, align 8, !tbaa !5
  %57 = getelementptr inbounds %struct.ArchInfo, ptr %56, i32 0, i32 0
  %58 = load i32, ptr %57, align 8, !tbaa !13
  store i32 %58, ptr %17, align 4, !tbaa !16
  %59 = load i32, ptr %17, align 4, !tbaa !16
  %60 = icmp eq i32 %59, 2
  br i1 %60, label %64, label %61

61:                                               ; preds = %55
  %62 = load i32, ptr %17, align 4, !tbaa !16
  %63 = icmp eq i32 %62, 7
  br i1 %63, label %64, label %65

64:                                               ; preds = %61, %55
  br label %168

65:                                               ; preds = %61
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #8
  %66 = getelementptr inbounds %struct.TensorDesc, ptr %15, i32 0, i32 3
  %67 = getelementptr inbounds [20 x i32], ptr %66, i64 0, i64 0
  %68 = load i32, ptr %67, align 4, !tbaa !11
  store i32 %68, ptr %18, align 4, !tbaa !11
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %19, ptr align 4 %14, i64 92, i1 false), !tbaa.struct !17
  %69 = call noundef zeroext i8 @_Z10tensorIs2d10TensorDesc(ptr noundef byval(%struct.TensorDesc) align 8 %19)
  %70 = icmp ne i8 %69, 0
  br i1 %70, label %81, label %71

71:                                               ; preds = %65
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #8
  %72 = call i64 (i64, ...) @syscall(i64 noundef 186) #8
  %73 = trunc i64 %72 to i32
  store i32 %73, ptr %20, align 4, !tbaa !11
  %74 = load i32, ptr %20, align 4, !tbaa !11
  %75 = call i32 (ptr, ...) @printf(ptr noundef @.str, i32 noundef %74)
  %76 = load ptr, ptr @stdout, align 8, !tbaa !5
  %77 = call i32 @fflush(ptr noundef %76)
  %78 = call i32 (ptr, ...) @printf(ptr noundef @.str.2)
  %79 = load ptr, ptr @stdout, align 8, !tbaa !5
  %80 = call i32 @fflush(ptr noundef %79)
  call void @exit(i32 noundef 1) #9
  unreachable

81:                                               ; preds = %65
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %22, ptr align 4 %14, i64 92, i1 false), !tbaa.struct !17
  %82 = call noundef i32 @_Z17tensorNumElements10TensorDesc(ptr noundef byval(%struct.TensorDesc) align 8 %22)
  %83 = load i32, ptr %18, align 4, !tbaa !11
  %84 = udiv i32 %82, %83
  store i32 %84, ptr %21, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %24, ptr align 4 %13, i64 92, i1 false), !tbaa.struct !17
  %85 = call noundef i32 @_Z17tensorNumElements10TensorDesc(ptr noundef byval(%struct.TensorDesc) align 8 %24)
  %86 = load i32, ptr %21, align 4, !tbaa !11
  %87 = udiv i32 %85, %86
  store i32 %87, ptr %23, align 4, !tbaa !11
  %88 = load i32, ptr %23, align 4, !tbaa !11
  %89 = icmp ne i32 %88, 1
  br i1 %89, label %90, label %98

90:                                               ; preds = %81
  call void @llvm.lifetime.start.p0(i64 92, ptr %25) #8
  %91 = getelementptr inbounds %struct.TensorDesc, ptr %13, i32 0, i32 0
  %92 = load i32, ptr %91, align 4, !tbaa !23
  %93 = load i32, ptr %23, align 4, !tbaa !11
  %94 = load i32, ptr %21, align 4, !tbaa !11
  call void @_Z9tensor2df8DataType10DataFormatjj(ptr dead_on_unwind writable sret(%struct.TensorDesc) align 4 %25, i32 noundef %92, i32 noundef 14, i32 noundef %93, i32 noundef %94)
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %26, ptr align 4 %25, i64 92, i1 false), !tbaa.struct !17
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %27, ptr align 4 %14, i64 92, i1 false), !tbaa.struct !17
  %95 = load ptr, ptr %9, align 8, !tbaa !5
  %96 = load i32, ptr %17, align 4, !tbaa !16
  %97 = call i32 @matrix_matrix_multiply_tmp_bytes(ptr noundef byval(%struct.TensorDesc) align 8 %26, ptr noundef byval(%struct.TensorDesc) align 8 %27, ptr noundef %95, i32 noundef %96)
  store i32 %97, ptr %16, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 92, ptr %25) #8
  br label %105

98:                                               ; preds = %81
  call void @llvm.lifetime.start.p0(i64 92, ptr %28) #8
  %99 = getelementptr inbounds %struct.TensorDesc, ptr %13, i32 0, i32 0
  %100 = load i32, ptr %99, align 4, !tbaa !23
  %101 = load i32, ptr %21, align 4, !tbaa !11
  call void @_Z8tensor1d8DataTypej(ptr dead_on_unwind writable sret(%struct.TensorDesc) align 4 %28, i32 noundef %100, i32 noundef %101)
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %29, ptr align 4 %14, i64 92, i1 false), !tbaa.struct !17
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %30, ptr align 4 %28, i64 92, i1 false), !tbaa.struct !17
  %102 = load ptr, ptr %9, align 8, !tbaa !5
  %103 = load i32, ptr %17, align 4, !tbaa !16
  %104 = call i32 @matrix_vector_multiply_tmp_bytes(ptr noundef byval(%struct.TensorDesc) align 8 %29, ptr noundef byval(%struct.TensorDesc) align 8 %30, ptr noundef %102, i32 noundef %103)
  store i32 %104, ptr %16, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 92, ptr %28) #8
  br label %105

105:                                              ; preds = %98, %90
  %106 = getelementptr inbounds %struct.TensorDesc, ptr %13, i32 0, i32 1
  %107 = load i32, ptr %106, align 4, !tbaa !25
  %108 = icmp eq i32 %107, 2
  br i1 %108, label %109, label %137

109:                                              ; preds = %105
  call void @llvm.lifetime.start.p0(i64 4, ptr %31) #8
  store i32 1, ptr %31, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %32) #8
  %110 = getelementptr inbounds %struct.TensorDesc, ptr %13, i32 0, i32 2
  %111 = load i32, ptr %110, align 4, !tbaa !26
  %112 = sub i32 %111, 3
  store i32 %112, ptr %32, align 4, !tbaa !11
  br label %113

113:                                              ; preds = %125, %109
  %114 = load i32, ptr %32, align 4, !tbaa !11
  %115 = icmp sge i32 %114, 0
  br i1 %115, label %117, label %116

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

117:                                              ; preds = %113
  %118 = getelementptr inbounds %struct.TensorDesc, ptr %13, i32 0, i32 3
  %119 = load i32, ptr %32, align 4, !tbaa !11
  %120 = sext i32 %119 to i64
  %121 = getelementptr inbounds [20 x i32], ptr %118, i64 0, i64 %120
  %122 = load i32, ptr %121, align 4, !tbaa !11
  %123 = load i32, ptr %31, align 4, !tbaa !11
  %124 = mul i32 %123, %122
  store i32 %124, ptr %31, align 4, !tbaa !11
  br label %125

125:                                              ; preds = %117
  %126 = load i32, ptr %32, align 4, !tbaa !11
  %127 = add nsw i32 %126, -1
  store i32 %127, ptr %32, align 4, !tbaa !11
  br label %113, !llvm.loop !27

128:                                              ; preds = %116
  %129 = load i32, ptr %31, align 4, !tbaa !11
  %130 = icmp ugt i32 %129, 1
  br i1 %130, label %131, label %136

131:                                              ; preds = %128
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %33, ptr align 4 %13, i64 92, i1 false), !tbaa.struct !17
  %132 = call noundef i32 @_Z14tensorNumBytes10TensorDesc(ptr noundef byval(%struct.TensorDesc) align 8 %33)
  %133 = load ptr, ptr %9, align 8, !tbaa !5
  %134 = load i32, ptr %133, align 4, !tbaa !11
  %135 = add i32 %134, %132
  store i32 %135, ptr %133, align 4, !tbaa !11
  br label %136

136:                                              ; preds = %131, %128
  call void @llvm.lifetime.end.p0(i64 4, ptr %31) #8
  br label %137

137:                                              ; preds = %136, %105
  %138 = getelementptr inbounds %struct.TensorDesc, ptr %14, i32 0, i32 0
  %139 = load i32, ptr %138, align 4, !tbaa !23
  %140 = icmp eq i32 1, %139
  br i1 %140, label %145, label %141

141:                                              ; preds = %137
  %142 = getelementptr inbounds %struct.TensorDesc, ptr %14, i32 0, i32 0
  %143 = load i32, ptr %142, align 4, !tbaa !23
  %144 = icmp eq i32 9, %143
  br i1 %144, label %145, label %167

145:                                              ; preds = %141, %137
  call void @llvm.lifetime.start.p0(i64 92, ptr %34) #8
  call void @_ZN6Tensor8get_descEv(ptr dead_on_unwind writable sret(%struct.TensorDesc) align 4 %34, ptr noundef nonnull align 8 dereferenceable(32) %0)
  %146 = getelementptr inbounds %struct.TensorDesc, ptr %34, i32 0, i32 0
  %147 = load i32, ptr %146, align 4, !tbaa !23
  %148 = icmp ne i32 1, %147
  call void @llvm.lifetime.end.p0(i64 92, ptr %34) #8
  br i1 %148, label %149, label %154

149:                                              ; preds = %145
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %35, ptr align 4 %13, i64 92, i1 false), !tbaa.struct !17
  %150 = call noundef i32 @_Z14tensorNumBytes10TensorDesc(ptr noundef byval(%struct.TensorDesc) align 8 %35)
  %151 = load ptr, ptr %9, align 8, !tbaa !5
  %152 = load i32, ptr %151, align 4, !tbaa !11
  %153 = add i32 %152, %150
  store i32 %153, ptr %151, align 4, !tbaa !11
  br label %154

154:                                              ; preds = %149, %145
  %155 = load i32, ptr %18, align 4, !tbaa !11
  %156 = call noundef i32 @_Z7bytesOf8DataType(i32 noundef 3)
  %157 = mul i32 %155, %156
  %158 = load ptr, ptr %9, align 8, !tbaa !5
  %159 = load i32, ptr %158, align 4, !tbaa !11
  %160 = add i32 %159, %157
  store i32 %160, ptr %158, align 4, !tbaa !11
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %36, ptr align 4 %15, i64 92, i1 false), !tbaa.struct !17
  %161 = call noundef i32 @_Z17tensorNumElements10TensorDesc(ptr noundef byval(%struct.TensorDesc) align 8 %36)
  %162 = call noundef i32 @_Z7bytesOf8DataType(i32 noundef 3)
  %163 = mul i32 %161, %162
  %164 = load ptr, ptr %9, align 8, !tbaa !5
  %165 = load i32, ptr %164, align 4, !tbaa !11
  %166 = add i32 %165, %163
  store i32 %166, ptr %164, align 4, !tbaa !11
  br label %167

167:                                              ; preds = %154, %141
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #8
  br label %168

168:                                              ; preds = %167, %64
  %169 = load i32, ptr %16, align 4, !tbaa !9
  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 92, ptr %15) #8
  call void @llvm.lifetime.end.p0(i64 92, ptr %14) #8
  call void @llvm.lifetime.end.p0(i64 92, ptr %13) #8
  ret i32 %169
}

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

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

; 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

declare i32 @matrix_matrix_multiply_tmp_bytes(ptr noundef byval(%struct.TensorDesc) align 8, ptr noundef byval(%struct.TensorDesc) align 8, ptr noundef, i32 noundef) #2

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

declare i32 @matrix_vector_multiply_tmp_bytes(ptr noundef byval(%struct.TensorDesc) align 8, ptr noundef byval(%struct.TensorDesc) align 8, ptr noundef, i32 noundef) #2

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

; 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 = { 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 = { 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, !15, i64 0}
!14 = !{!"_ZTS8ArchInfo", !15, i64 0, !6, i64 8}
!15 = !{!"_ZTS4Arch", !7, i64 0}
!16 = !{!15, !15, i64 0}
!17 = !{i64 0, i64 4, !18, i64 4, i64 4, !20, i64 8, i64 4, !11, i64 12, i64 80, !22}
!18 = !{!19, !19, i64 0}
!19 = !{!"_ZTS8DataType", !7, i64 0}
!20 = !{!21, !21, i64 0}
!21 = !{!"_ZTS10DataFormat", !7, i64 0}
!22 = !{!7, !7, i64 0}
!23 = !{!24, !19, i64 0}
!24 = !{!"_ZTS10TensorDesc", !19, i64 0, !21, i64 4, !12, i64 8, !7, i64 12}
!25 = !{!24, !21, i64 4}
!26 = !{!24, !12, i64 8}
!27 = distinct !{!27, !28}
!28 = !{!"llvm.loop.mustprogress"}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%struct.TensorDesc = type { i32, i32, i32, [20 x i32] }

@.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
@.str.2 = external hidden unnamed_addr constant [23 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: mustprogress uwtable
declare dso_local void @_ZN6Tensor8get_descEv(ptr dead_on_unwind noalias writable sret(%struct.TensorDesc) align 4, ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #5 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_Z39fully_connected_infer_forward_tmp_bytes6TensorS_S_PjP8ArchInfo(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3, ptr nocapture noundef readonly %4) local_unnamed_addr #5 {
  %6 = alloca %struct.TensorDesc, align 8
  %7 = alloca %struct.TensorDesc, align 8
  %8 = alloca %struct.TensorDesc, align 8
  %9 = alloca %struct.TensorDesc, align 8
  %10 = alloca %struct.TensorDesc, align 8
  %11 = alloca %struct.TensorDesc, align 4
  %12 = icmp eq ptr %3, null
  br i1 %12, label %13, label %23

13:                                               ; preds = %5
  %14 = tail call i64 (i64, ...) @syscall(i64 noundef 186) #9
  %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) #10
  unreachable

23:                                               ; preds = %5
  call void @llvm.lifetime.start.p0(i64 92, ptr nonnull %6) #9
  call void @_ZN6Tensor8get_descEv(ptr dead_on_unwind nonnull writable sret(%struct.TensorDesc) align 4 %6, ptr noundef nonnull align 8 dereferenceable(32) %0)
  call void @llvm.lifetime.start.p0(i64 92, ptr nonnull %7) #9
  call void @_ZN6Tensor8get_descEv(ptr dead_on_unwind nonnull writable sret(%struct.TensorDesc) align 4 %7, ptr noundef nonnull align 8 dereferenceable(32) %1)
  call void @llvm.lifetime.start.p0(i64 92, ptr nonnull %8) #9
  call void @_ZN6Tensor8get_descEv(ptr dead_on_unwind nonnull writable sret(%struct.TensorDesc) align 4 %8, ptr noundef nonnull align 8 dereferenceable(32) %2)
  %24 = load i32, ptr %4, align 8, !tbaa !9
  switch i32 %24, label %25 [
    i32 7, label %94
    i32 2, label %94
  ]

25:                                               ; preds = %23
  %26 = getelementptr inbounds i8, ptr %8, i64 12
  %27 = load i32, ptr %26, align 4, !tbaa !12
  %28 = call noundef zeroext i8 @_Z10tensorIs2d10TensorDesc(ptr noundef nonnull byval(%struct.TensorDesc) align 8 %7)
  %.not = icmp eq i8 %28, 0
  br i1 %.not, label %29, label %38

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

38:                                               ; preds = %25
  %39 = call noundef i32 @_Z17tensorNumElements10TensorDesc(ptr noundef nonnull byval(%struct.TensorDesc) align 8 %7)
  %40 = udiv i32 %39, %27
  %41 = call noundef i32 @_Z17tensorNumElements10TensorDesc(ptr noundef nonnull byval(%struct.TensorDesc) align 8 %6)
  %42 = udiv i32 %41, %40
  %.not36 = icmp eq i32 %42, 1
  br i1 %.not36, label %46, label %43

43:                                               ; preds = %38
  call void @llvm.lifetime.start.p0(i64 92, ptr nonnull %9) #9
  %44 = load i32, ptr %6, align 8, !tbaa !14
  call void @_Z9tensor2df8DataType10DataFormatjj(ptr dead_on_unwind nonnull writable sret(%struct.TensorDesc) align 4 %9, i32 noundef %44, i32 noundef 14, i32 noundef %42, i32 noundef %40)
  %45 = call i32 @matrix_matrix_multiply_tmp_bytes(ptr noundef nonnull byval(%struct.TensorDesc) align 8 %9, ptr noundef nonnull byval(%struct.TensorDesc) align 8 %7, ptr noundef nonnull %3, i32 noundef %24)
  call void @llvm.lifetime.end.p0(i64 92, ptr nonnull %9) #9
  br label %49

46:                                               ; preds = %38
  call void @llvm.lifetime.start.p0(i64 92, ptr nonnull %10) #9
  %47 = load i32, ptr %6, align 8, !tbaa !14
  call void @_Z8tensor1d8DataTypej(ptr dead_on_unwind nonnull writable sret(%struct.TensorDesc) align 4 %10, i32 noundef %47, i32 noundef %40)
  %48 = call i32 @matrix_vector_multiply_tmp_bytes(ptr noundef nonnull byval(%struct.TensorDesc) align 8 %7, ptr noundef nonnull byval(%struct.TensorDesc) align 8 %10, ptr noundef nonnull %3, i32 noundef %24)
  call void @llvm.lifetime.end.p0(i64 92, ptr nonnull %10) #9
  br label %49

49:                                               ; preds = %46, %43
  %.033 = phi i32 [ %45, %43 ], [ %48, %46 ]
  %50 = getelementptr inbounds i8, ptr %6, i64 4
  %51 = load i32, ptr %50, align 4, !tbaa !18
  %52 = icmp eq i32 %51, 2
  br i1 %52, label %53, label %._crit_edge.thread

53:                                               ; preds = %49
  %54 = getelementptr inbounds i8, ptr %6, i64 8
  %55 = load i32, ptr %54, align 8, !tbaa !19
  %56 = add i32 %55, -3
  %57 = icmp sgt i32 %56, -1
  br i1 %57, label %.lr.ph, label %._crit_edge.thread

.lr.ph:                                           ; preds = %53
  %58 = getelementptr inbounds i8, ptr %6, i64 12
  %59 = zext nneg i32 %56 to i64
  %60 = add nuw nsw i64 %59, 1
  %min.iters.check = icmp ult i32 %56, 7
  br i1 %min.iters.check, label %scalar.ph.preheader, label %vector.ph

scalar.ph.preheader:                              ; preds = %middle.block, %.lr.ph
  %indvars.iv.ph = phi i64 [ %59, %.lr.ph ], [ %ind.end, %middle.block ]
  %.03238.ph = phi i32 [ 1, %.lr.ph ], [ %67, %middle.block ]
  br label %scalar.ph

vector.ph:                                        ; preds = %.lr.ph
  %n.vec = and i64 %60, 4294967288
  %ind.end = sub nsw i64 %59, %n.vec
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %vec.phi = phi <4 x i32> [ <i32 1, i32 1, i32 1, i32 1>, %vector.ph ], [ %64, %vector.body ]
  %vec.phi43 = phi <4 x i32> [ <i32 1, i32 1, i32 1, i32 1>, %vector.ph ], [ %65, %vector.body ]
  %offset.idx = sub i64 %59, %index
  %61 = getelementptr inbounds [20 x i32], ptr %58, i64 0, i64 %offset.idx
  %62 = getelementptr inbounds i8, ptr %61, i64 -12
  %63 = getelementptr inbounds i8, ptr %61, i64 -28
  %wide.load = load <4 x i32>, ptr %62, align 4, !tbaa !12
  %reverse = shufflevector <4 x i32> %wide.load, <4 x i32> poison, <4 x i32> <i32 3, i32 2, i32 1, i32 0>
  %wide.load44 = load <4 x i32>, ptr %63, align 4, !tbaa !12
  %reverse45 = shufflevector <4 x i32> %wide.load44, <4 x i32> poison, <4 x i32> <i32 3, i32 2, i32 1, i32 0>
  %64 = mul <4 x i32> %reverse, %vec.phi
  %65 = mul <4 x i32> %reverse45, %vec.phi43
  %index.next = add nuw i64 %index, 8
  %66 = icmp eq i64 %index.next, %n.vec
  br i1 %66, label %middle.block, label %vector.body, !llvm.loop !20

middle.block:                                     ; preds = %vector.body
  %bin.rdx = mul <4 x i32> %65, %64
  %67 = call i32 @llvm.vector.reduce.mul.v4i32(<4 x i32> %bin.rdx)
  %cmp.n = icmp eq i64 %60, %n.vec
  br i1 %cmp.n, label %._crit_edge, label %scalar.ph.preheader

._crit_edge:                                      ; preds = %scalar.ph, %middle.block
  %.lcssa = phi i32 [ %67, %middle.block ], [ %71, %scalar.ph ]
  %68 = icmp ugt i32 %.lcssa, 1
  br i1 %68, label %72, label %._crit_edge.thread

scalar.ph:                                        ; preds = %scalar.ph.preheader, %scalar.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %scalar.ph ], [ %indvars.iv.ph, %scalar.ph.preheader ]
  %.03238 = phi i32 [ %71, %scalar.ph ], [ %.03238.ph, %scalar.ph.preheader ]
  %69 = getelementptr inbounds [20 x i32], ptr %58, i64 0, i64 %indvars.iv
  %70 = load i32, ptr %69, align 4, !tbaa !12
  %71 = mul i32 %70, %.03238
  %indvars.iv.next = add nsw i64 %indvars.iv, -1
  %.not42 = icmp eq i64 %indvars.iv, 0
  br i1 %.not42, label %._crit_edge, label %scalar.ph, !llvm.loop !24

72:                                               ; preds = %._crit_edge
  %73 = call noundef i32 @_Z14tensorNumBytes10TensorDesc(ptr noundef nonnull byval(%struct.TensorDesc) align 8 %6)
  %74 = load i32, ptr %3, align 4, !tbaa !12
  %75 = add i32 %74, %73
  store i32 %75, ptr %3, align 4, !tbaa !12
  br label %._crit_edge.thread

._crit_edge.thread:                               ; preds = %53, %._crit_edge, %72, %49
  %76 = load i32, ptr %7, align 8
  %77 = and i32 %76, -9
  %or.cond4 = icmp eq i32 %77, 1
  br i1 %or.cond4, label %78, label %94

78:                                               ; preds = %._crit_edge.thread
  call void @llvm.lifetime.start.p0(i64 92, ptr nonnull %11) #9
  call void @_ZN6Tensor8get_descEv(ptr dead_on_unwind nonnull writable sret(%struct.TensorDesc) align 4 %11, ptr noundef nonnull align 8 dereferenceable(32) %0)
  %79 = load i32, ptr %11, align 4, !tbaa !14
  %.not37 = icmp eq i32 %79, 1
  call void @llvm.lifetime.end.p0(i64 92, ptr nonnull %11) #9
  br i1 %.not37, label %84, label %80

80:                                               ; preds = %78
  %81 = call noundef i32 @_Z14tensorNumBytes10TensorDesc(ptr noundef nonnull byval(%struct.TensorDesc) align 8 %6)
  %82 = load i32, ptr %3, align 4, !tbaa !12
  %83 = add i32 %82, %81
  store i32 %83, ptr %3, align 4, !tbaa !12
  br label %84

84:                                               ; preds = %80, %78
  %85 = call noundef i32 @_Z7bytesOf8DataType(i32 noundef 3)
  %86 = mul i32 %85, %27
  %87 = load i32, ptr %3, align 4, !tbaa !12
  %88 = add i32 %87, %86
  store i32 %88, ptr %3, align 4, !tbaa !12
  %89 = call noundef i32 @_Z17tensorNumElements10TensorDesc(ptr noundef nonnull byval(%struct.TensorDesc) align 8 %8)
  %90 = call noundef i32 @_Z7bytesOf8DataType(i32 noundef 3)
  %91 = mul i32 %90, %89
  %92 = load i32, ptr %3, align 4, !tbaa !12
  %93 = add i32 %92, %91
  store i32 %93, ptr %3, align 4, !tbaa !12
  br label %94

94:                                               ; preds = %84, %._crit_edge.thread, %23, %23
  %.1 = phi i32 [ 51, %23 ], [ 51, %23 ], [ %.033, %._crit_edge.thread ], [ %.033, %84 ]
  call void @llvm.lifetime.end.p0(i64 92, ptr nonnull %8) #9
  call void @llvm.lifetime.end.p0(i64 92, ptr nonnull %7) #9
  call void @llvm.lifetime.end.p0(i64 92, ptr nonnull %6) #9
  ret i32 %.1
}

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

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

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

declare i32 @matrix_matrix_multiply_tmp_bytes(ptr noundef byval(%struct.TensorDesc) align 8, ptr noundef byval(%struct.TensorDesc) align 8, ptr noundef, i32 noundef) local_unnamed_addr #7

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

declare i32 @matrix_vector_multiply_tmp_bytes(ptr noundef byval(%struct.TensorDesc) align 8, ptr noundef byval(%struct.TensorDesc) align 8, ptr noundef, i32 noundef) local_unnamed_addr #7

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

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.mul.v4i32(<4 x i32>) #8

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 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #8 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #9 = { nounwind }
attributes #10 = { noreturn nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !11, i64 0}
!10 = !{!"_ZTS8ArchInfo", !11, i64 0, !6, i64 8}
!11 = !{!"_ZTS4Arch", !7, i64 0}
!12 = !{!13, !13, i64 0}
!13 = !{!"int", !7, i64 0}
!14 = !{!15, !16, i64 0}
!15 = !{!"_ZTS10TensorDesc", !16, i64 0, !17, i64 4, !13, i64 8, !7, i64 12}
!16 = !{!"_ZTS8DataType", !7, i64 0}
!17 = !{!"_ZTS10DataFormat", !7, i64 0}
!18 = !{!15, !17, i64 4}
!19 = !{!15, !13, i64 8}
!20 = distinct !{!20, !21, !22, !23}
!21 = !{!"llvm.loop.mustprogress"}
!22 = !{!"llvm.loop.isvectorized", i32 1}
!23 = !{!"llvm.loop.unroll.runtime.disable"}
!24 = distinct !{!24, !21, !23, !22}


; Effective O3 passes: CorrelatedValuePropagationPass,DSEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopLoadEliminationPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,LoopVectorizePass,MemCpyOptPass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass