; LLVM IR from libxsmm/libxsmm :: src (generator_gemm_avx2_microkernel)

; 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.libxsmm_gemm_descriptor = type <{ i32, i32, i32, i32, i32, i32, i32, i8, [3 x i8], i8, i64, i64, i8, i32, i32, i32, i16, i16, i8, i8, i8, i8, i16, i16, i16, i16, i16, i16, i32, i32, i32, i8 }>
%struct.libxsmm_generated_code = type { ptr, i32, i32, i32, i32, i32, i32 }

; Function Attrs: nounwind uwtable
define dso_local void @libxsmm_generator_gemm_avx2_kloop_kernel(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3, i32 noundef %4, i32 noundef %5, i32 noundef %6) #0 {
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca ptr, align 8
  %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
  store ptr %0, ptr %8, align 8, !tbaa !5
  store ptr %1, ptr %9, align 8, !tbaa !5
  store ptr %2, ptr %10, align 8, !tbaa !5
  store ptr %3, ptr %11, align 8, !tbaa !5
  store i32 %4, ptr %12, align 4, !tbaa !9
  store i32 %5, ptr %13, align 4, !tbaa !9
  store i32 %6, ptr %14, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #3
  store i32 0, ptr %15, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #3
  store i32 1, ptr %16, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #3
  %23 = load ptr, ptr %11, align 8, !tbaa !5
  %24 = call i32 @libxsmm_x86_is_Amxfp4_Bfp32_gemm(ptr noundef %23)
  store i32 %24, ptr %18, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #3
  %25 = load ptr, ptr %11, align 8, !tbaa !5
  %26 = call i32 @libxsmm_x86_is_Amxfp4_Bbf16_gemm(ptr noundef %25)
  store i32 %26, ptr %19, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #3
  %27 = load ptr, ptr %11, align 8, !tbaa !5
  %28 = call i32 @libxsmm_x86_is_Amxfp4_Bi8_gemm(ptr noundef %27)
  store i32 %28, ptr %20, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #3
  %29 = load ptr, ptr %11, align 8, !tbaa !5
  %30 = getelementptr inbounds %struct.libxsmm_gemm_descriptor, ptr %29, i32 0, i32 8
  %31 = getelementptr inbounds [3 x i8], ptr %30, i64 0, i64 0
  %32 = call i32 @LIBXSMM_GEMM_GETENUM_AB_COMMON_PREC(ptr noundef %31)
  %33 = icmp eq i32 12, %32
  br i1 %33, label %34, label %62

34:                                               ; preds = %7
  %35 = load ptr, ptr %11, align 8, !tbaa !5
  %36 = getelementptr inbounds %struct.libxsmm_gemm_descriptor, ptr %35, i32 0, i32 6
  %37 = load i32, ptr %36, align 1, !tbaa !11
  %38 = and i32 %37, 256
  %39 = icmp eq i32 %38, 0
  br i1 %39, label %40, label %46

40:                                               ; preds = %34
  %41 = load ptr, ptr %11, align 8, !tbaa !5
  %42 = getelementptr inbounds %struct.libxsmm_gemm_descriptor, ptr %41, i32 0, i32 6
  %43 = load i32, ptr %42, align 1, !tbaa !11
  %44 = and i32 %43, 512
  %45 = icmp eq i32 %44, 0
  br i1 %45, label %60, label %46

46:                                               ; preds = %40, %34
  %47 = load ptr, ptr %11, align 8, !tbaa !5
  %48 = getelementptr inbounds %struct.libxsmm_gemm_descriptor, ptr %47, i32 0, i32 6
  %49 = load i32, ptr %48, align 1, !tbaa !11
  %50 = and i32 %49, 256
  %51 = icmp ugt i32 %50, 0
  br i1 %51, label %52, label %58

52:                                               ; preds = %46
  %53 = load ptr, ptr %11, align 8, !tbaa !5
  %54 = getelementptr inbounds %struct.libxsmm_gemm_descriptor, ptr %53, i32 0, i32 6
  %55 = load i32, ptr %54, align 1, !tbaa !11
  %56 = and i32 %55, 512
  %57 = icmp ugt i32 %56, 0
  br label %58

58:                                               ; preds = %52, %46
  %59 = phi i1 [ false, %46 ], [ %57, %52 ]
  br label %60

60:                                               ; preds = %58, %40
  %61 = phi i1 [ true, %40 ], [ %59, %58 ]
  br label %62

62:                                               ; preds = %60, %7
  %63 = phi i1 [ false, %7 ], [ %61, %60 ]
  %64 = zext i1 %63 to i32
  store i32 %64, ptr %21, align 4, !tbaa !9
  %65 = load i32, ptr %18, align 4, !tbaa !9
  %66 = icmp ugt i32 %65, 0
  br i1 %66, label %73, label %67

67:                                               ; preds = %62
  %68 = load i32, ptr %19, align 4, !tbaa !9
  %69 = icmp ugt i32 %68, 0
  br i1 %69, label %73, label %70

70:                                               ; preds = %67
  %71 = load i32, ptr %20, align 4, !tbaa !9
  %72 = icmp ugt i32 %71, 0
  br i1 %72, label %73, label %81

73:                                               ; preds = %70, %67, %62
  %74 = load ptr, ptr %8, align 8, !tbaa !5
  %75 = load ptr, ptr %9, align 8, !tbaa !5
  %76 = load ptr, ptr %10, align 8, !tbaa !5
  %77 = load ptr, ptr %11, align 8, !tbaa !5
  %78 = load i32, ptr %12, align 4, !tbaa !9
  %79 = load i32, ptr %13, align 4, !tbaa !9
  %80 = load i32, ptr %14, align 4, !tbaa !9
  call void @libxsmm_generator_gemm_avx2_microkernel_Amxfp4(ptr noundef %74, ptr noundef %75, ptr noundef %76, ptr noundef %77, i32 noundef %78, i32 noundef %79, i32 noundef %80)
  store i32 1, ptr %22, align 4
  br label %187

81:                                               ; preds = %70
  %82 = load i32, ptr %21, align 4, !tbaa !9
  %83 = icmp ne i32 %82, 0
  br i1 %83, label %84, label %90

84:                                               ; preds = %81
  %85 = load ptr, ptr %8, align 8, !tbaa !5
  %86 = getelementptr inbounds %struct.libxsmm_generated_code, ptr %85, i32 0, i32 6
  %87 = load i32, ptr %86, align 4, !tbaa !15
  %88 = icmp ult i32 %87, 1008
  br i1 %88, label %89, label %90

89:                                               ; preds = %84
  store ptr @libxsmm_generator_gemm_avx2_microkernel_int8_uu_ss_vnni_emu, ptr %17, align 8, !tbaa !5
  br label %157

90:                                               ; preds = %84, %81
  %91 = load ptr, ptr %11, align 8, !tbaa !5
  %92 = getelementptr inbounds %struct.libxsmm_gemm_descriptor, ptr %91, i32 0, i32 8
  %93 = getelementptr inbounds [3 x i8], ptr %92, i64 0, i64 0
  %94 = call i32 @LIBXSMM_GEMM_GETENUM_AB_COMMON_PREC(ptr noundef %93)
  %95 = icmp eq i32 12, %94
  br i1 %95, label %102, label %96

96:                                               ; preds = %90
  %97 = load ptr, ptr %11, align 8, !tbaa !5
  %98 = getelementptr inbounds %struct.libxsmm_gemm_descriptor, ptr %97, i32 0, i32 8
  %99 = getelementptr inbounds [3 x i8], ptr %98, i64 0, i64 0
  %100 = call i32 @LIBXSMM_GEMM_GETENUM_AB_COMMON_PREC(ptr noundef %99)
  %101 = icmp eq i32 10, %100
  br i1 %101, label %102, label %108

102:                                              ; preds = %96, %90
  %103 = load ptr, ptr %8, align 8, !tbaa !5
  %104 = getelementptr inbounds %struct.libxsmm_generated_code, ptr %103, i32 0, i32 6
  %105 = load i32, ptr %104, align 4, !tbaa !15
  %106 = icmp ult i32 %105, 1007
  br i1 %106, label %107, label %108

107:                                              ; preds = %102
  store ptr @libxsmm_generator_gemm_avx2_microkernel_int8_int16_vnni_emu, ptr %17, align 8, !tbaa !5
  br label %156

108:                                              ; preds = %102, %96
  %109 = load ptr, ptr %11, align 8, !tbaa !5
  %110 = getelementptr inbounds %struct.libxsmm_gemm_descriptor, ptr %109, i32 0, i32 8
  %111 = getelementptr inbounds [3 x i8], ptr %110, i64 0, i64 0
  %112 = call i32 @LIBXSMM_GEMM_GETENUM_AB_COMMON_PREC(ptr noundef %111)
  %113 = icmp eq i32 2, %112
  br i1 %113, label %114, label %126

114:                                              ; preds = %108
  %115 = load ptr, ptr %11, align 8, !tbaa !5
  %116 = getelementptr inbounds %struct.libxsmm_gemm_descriptor, ptr %115, i32 0, i32 6
  %117 = load i32, ptr %116, align 1, !tbaa !11
  %118 = and i32 %117, 2048
  %119 = icmp ugt i32 %118, 0
  br i1 %119, label %120, label %126

120:                                              ; preds = %114
  %121 = load ptr, ptr %8, align 8, !tbaa !5
  %122 = getelementptr inbounds %struct.libxsmm_generated_code, ptr %121, i32 0, i32 6
  %123 = load i32, ptr %122, align 4, !tbaa !15
  %124 = icmp ult i32 %123, 1008
  br i1 %124, label %125, label %126

125:                                              ; preds = %120
  store ptr @libxsmm_generator_gemm_avx2_microkernel_bf16_vnni_emu, ptr %17, align 8, !tbaa !5
  br label %155

126:                                              ; preds = %120, %114, %108
  %127 = load ptr, ptr %11, align 8, !tbaa !5
  %128 = getelementptr inbounds %struct.libxsmm_gemm_descriptor, ptr %127, i32 0, i32 8
  %129 = getelementptr inbounds [3 x i8], ptr %128, i64 0, i64 0
  %130 = call i32 @LIBXSMM_GEMM_GETENUM_AB_COMMON_PREC(ptr noundef %129)
  %131 = icmp eq i32 2, %130
  br i1 %131, label %132, label %139

132:                                              ; preds = %126
  %133 = load ptr, ptr %11, align 8, !tbaa !5
  %134 = getelementptr inbounds %struct.libxsmm_gemm_descriptor, ptr %133, i32 0, i32 6
  %135 = load i32, ptr %134, align 1, !tbaa !11
  %136 = and i32 %135, 2048
  %137 = icmp eq i32 %136, 0
  br i1 %137, label %138, label %139

138:                                              ; preds = %132
  store ptr @libxsmm_generator_gemm_avx2_microkernel_bf16_flat_emu, ptr %17, align 8, !tbaa !5
  br label %154

139:                                              ; preds = %132, %126
  %140 = load ptr, ptr %11, align 8, !tbaa !5
  %141 = getelementptr inbounds %struct.libxsmm_gemm_descriptor, ptr %140, i32 0, i32 8
  %142 = getelementptr inbounds [3 x i8], ptr %141, i64 0, i64 0
  %143 = call i32 @LIBXSMM_GEMM_GETENUM_AB_COMMON_PREC(ptr noundef %142)
  %144 = icmp eq i32 2, %143
  br i1 %144, label %145, label %152

145:                                              ; preds = %139
  %146 = load ptr, ptr %11, align 8, !tbaa !5
  %147 = getelementptr inbounds %struct.libxsmm_gemm_descriptor, ptr %146, i32 0, i32 6
  %148 = load i32, ptr %147, align 1, !tbaa !11
  %149 = and i32 %148, 2048
  %150 = icmp ugt i32 %149, 0
  br i1 %150, label %151, label %152

151:                                              ; preds = %145
  store ptr @libxsmm_generator_gemm_avx2_microkernel_bf16_vnni_srf, ptr %17, align 8, !tbaa !5
  br label %153

152:                                              ; preds = %145, %139
  store ptr @libxsmm_generator_gemm_avx2_microkernel, ptr %17, align 8, !tbaa !5
  br label %153

153:                                              ; preds = %152, %151
  br label %154

154:                                              ; preds = %153, %138
  br label %155

155:                                              ; preds = %154, %125
  br label %156

156:                                              ; preds = %155, %107
  br label %157

157:                                              ; preds = %156, %89
  %158 = load ptr, ptr %11, align 8, !tbaa !5
  %159 = getelementptr inbounds %struct.libxsmm_gemm_descriptor, ptr %158, i32 0, i32 6
  %160 = load i32, ptr %159, align 1, !tbaa !11
  %161 = and i32 %160, 2048
  %162 = icmp eq i32 %161, 2048
  br i1 %162, label %163, label %169

163:                                              ; preds = %157
  %164 = load ptr, ptr %11, align 8, !tbaa !5
  %165 = getelementptr inbounds %struct.libxsmm_gemm_descriptor, ptr %164, i32 0, i32 8
  %166 = getelementptr inbounds [3 x i8], ptr %165, i64 0, i64 0
  %167 = call i32 @LIBXSMM_GEMM_GETENUM_AB_COMMON_PREC(ptr noundef %166)
  %168 = call i32 @libxsmm_cpuid_dot_pack_factor(i32 noundef %167)
  store i32 %168, ptr %16, align 4, !tbaa !9
  br label %169

169:                                              ; preds = %163, %157
  store i32 0, ptr %15, align 4, !tbaa !9
  br label %170

170:                                              ; preds = %182, %169
  %171 = load i32, ptr %15, align 4, !tbaa !9
  %172 = load i32, ptr %14, align 4, !tbaa !9
  %173 = icmp ult i32 %171, %172
  br i1 %173, label %174, label %186

174:                                              ; preds = %170
  %175 = load ptr, ptr %17, align 8, !tbaa !5
  %176 = load ptr, ptr %8, align 8, !tbaa !5
  %177 = load ptr, ptr %9, align 8, !tbaa !5
  %178 = load ptr, ptr %10, align 8, !tbaa !5
  %179 = load ptr, ptr %11, align 8, !tbaa !5
  %180 = load i32, ptr %12, align 4, !tbaa !9
  %181 = load i32, ptr %13, align 4, !tbaa !9
  call void %175(ptr noundef %176, ptr noundef %177, ptr noundef %178, ptr noundef %179, i32 noundef %180, i32 noundef %181)
  br label %182

182:                                              ; preds = %174
  %183 = load i32, ptr %16, align 4, !tbaa !9
  %184 = load i32, ptr %15, align 4, !tbaa !9
  %185 = add i32 %184, %183
  store i32 %185, ptr %15, align 4, !tbaa !9
  br label %170, !llvm.loop !17

186:                                              ; preds = %170
  store i32 0, ptr %22, align 4
  br label %187

187:                                              ; preds = %186, %73
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #3
  %188 = load i32, ptr %22, align 4
  switch i32 %188, label %190 [
    i32 0, label %189
    i32 1, label %189
  ]

189:                                              ; preds = %187, %187
  ret void

190:                                              ; preds = %187
  unreachable
}

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

declare i32 @libxsmm_x86_is_Amxfp4_Bfp32_gemm(ptr noundef) #2

declare i32 @libxsmm_x86_is_Amxfp4_Bbf16_gemm(ptr noundef) #2

declare i32 @libxsmm_x86_is_Amxfp4_Bi8_gemm(ptr noundef) #2

declare i32 @LIBXSMM_GEMM_GETENUM_AB_COMMON_PREC(ptr noundef) #2

; Function Attrs: nounwind uwtable
declare dso_local void @libxsmm_generator_gemm_avx2_microkernel_Amxfp4(ptr noundef, ptr noundef, ptr noundef, ptr noundef, i32 noundef, i32 noundef, i32 noundef) #0

; Function Attrs: nounwind uwtable
declare dso_local void @libxsmm_generator_gemm_avx2_microkernel_int8_uu_ss_vnni_emu(ptr noundef, ptr noundef, ptr noundef, ptr noundef, i32 noundef, i32 noundef) #0

; Function Attrs: nounwind uwtable
declare dso_local void @libxsmm_generator_gemm_avx2_microkernel_int8_int16_vnni_emu(ptr noundef, ptr noundef, ptr noundef, ptr noundef, i32 noundef, i32 noundef) #0

; Function Attrs: nounwind uwtable
declare dso_local void @libxsmm_generator_gemm_avx2_microkernel_bf16_vnni_emu(ptr noundef, ptr noundef, ptr noundef, ptr noundef, i32 noundef, i32 noundef) #0

; Function Attrs: nounwind uwtable
declare dso_local void @libxsmm_generator_gemm_avx2_microkernel_bf16_flat_emu(ptr noundef, ptr noundef, ptr noundef, ptr noundef, i32 noundef, i32 noundef) #0

; Function Attrs: nounwind uwtable
declare dso_local void @libxsmm_generator_gemm_avx2_microkernel_bf16_vnni_srf(ptr noundef, ptr noundef, ptr noundef, ptr noundef, i32 noundef, i32 noundef) #0

; Function Attrs: nounwind uwtable
declare dso_local void @libxsmm_generator_gemm_avx2_microkernel(ptr noundef, ptr noundef, ptr noundef, ptr noundef, i32 noundef, i32 noundef) #0

declare i32 @libxsmm_cpuid_dot_pack_factor(i32 noundef) #2

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

attributes #0 = { 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 #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !10, i64 24}
!12 = !{!"libxsmm_gemm_descriptor", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !10, i64 16, !10, i64 20, !10, i64 24, !7, i64 28, !7, i64 29, !7, i64 32, !13, i64 33, !13, i64 41, !7, i64 49, !10, i64 50, !10, i64 54, !10, i64 58, !14, i64 62, !14, i64 64, !7, i64 66, !7, i64 67, !7, i64 68, !7, i64 69, !14, i64 70, !14, i64 72, !14, i64 74, !14, i64 76, !14, i64 78, !14, i64 80, !10, i64 82, !10, i64 86, !10, i64 90, !7, i64 94}
!13 = !{!"long long", !7, i64 0}
!14 = !{!"short", !7, i64 0}
!15 = !{!16, !10, i64 28}
!16 = !{!"libxsmm_generated_code", !6, i64 0, !10, i64 8, !10, i64 12, !10, i64 16, !10, i64 20, !10, i64 24, !10, i64 28}
!17 = distinct !{!17, !18}
!18 = !{!"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"

; Function Attrs: nounwind uwtable
define dso_local void @libxsmm_generator_gemm_avx2_kloop_kernel(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3, i32 noundef %4, i32 noundef %5, i32 noundef %6) local_unnamed_addr #0 {
  %8 = tail call i32 @libxsmm_x86_is_Amxfp4_Bfp32_gemm(ptr noundef %3) #2
  %9 = tail call i32 @libxsmm_x86_is_Amxfp4_Bbf16_gemm(ptr noundef %3) #2
  %10 = tail call i32 @libxsmm_x86_is_Amxfp4_Bi8_gemm(ptr noundef %3) #2
  %11 = getelementptr inbounds i8, ptr %3, i64 29
  %12 = tail call i32 @LIBXSMM_GEMM_GETENUM_AB_COMMON_PREC(ptr noundef nonnull %11) #2
  %13 = icmp eq i32 %12, 12
  br i1 %13, label %14, label %.thread56

14:                                               ; preds = %7
  %15 = getelementptr inbounds i8, ptr %3, i64 24
  %16 = load i32, ptr %15, align 1, !tbaa !5
  %17 = and i32 %16, 768
  %or.cond51 = icmp eq i32 %17, 0
  %18 = icmp ne i32 %8, 0
  %19 = icmp ne i32 %9, 0
  %or.cond52 = select i1 %18, i1 true, i1 %19
  %20 = icmp ne i32 %10, 0
  %or.cond353 = select i1 %or.cond52, i1 true, i1 %20
  br i1 %or.cond51, label %.thread, label %21

21:                                               ; preds = %14
  br i1 %or.cond353, label %25, label %26

.thread56:                                        ; preds = %7
  %22 = icmp ne i32 %8, 0
  %23 = icmp ne i32 %9, 0
  %or.cond57 = select i1 %22, i1 true, i1 %23
  %24 = icmp ne i32 %10, 0
  %or.cond358 = select i1 %or.cond57, i1 true, i1 %24
  br i1 %or.cond358, label %25, label %.thread59

.thread:                                          ; preds = %14
  br i1 %or.cond353, label %25, label %.thread54

25:                                               ; preds = %.thread56, %.thread, %21
  tail call void @libxsmm_generator_gemm_avx2_microkernel_Amxfp4(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3, i32 noundef %4, i32 noundef %5, i32 noundef %6)
  br label %.loopexit

26:                                               ; preds = %21
  %spec.select = icmp eq i32 %17, 768
  br i1 %spec.select, label %.thread54, label %.thread59

.thread54:                                        ; preds = %.thread, %26
  %27 = getelementptr inbounds i8, ptr %0, i64 28
  %28 = load i32, ptr %27, align 4, !tbaa !12
  %29 = icmp ult i32 %28, 1008
  br i1 %29, label %66, label %.thread59

.thread59:                                        ; preds = %.thread56, %.thread54, %26
  %30 = tail call i32 @LIBXSMM_GEMM_GETENUM_AB_COMMON_PREC(ptr noundef nonnull %11) #2
  %31 = icmp eq i32 %30, 12
  br i1 %31, label %35, label %32

32:                                               ; preds = %.thread59
  %33 = tail call i32 @LIBXSMM_GEMM_GETENUM_AB_COMMON_PREC(ptr noundef nonnull %11) #2
  %34 = icmp eq i32 %33, 10
  br i1 %34, label %35, label %39

35:                                               ; preds = %32, %.thread59
  %36 = getelementptr inbounds i8, ptr %0, i64 28
  %37 = load i32, ptr %36, align 4, !tbaa !12
  %38 = icmp ult i32 %37, 1007
  br i1 %38, label %66, label %39

39:                                               ; preds = %35, %32
  %40 = tail call i32 @LIBXSMM_GEMM_GETENUM_AB_COMMON_PREC(ptr noundef nonnull %11) #2
  %41 = icmp eq i32 %40, 2
  br i1 %41, label %42, label %50

42:                                               ; preds = %39
  %43 = getelementptr inbounds i8, ptr %3, i64 24
  %44 = load i32, ptr %43, align 1, !tbaa !5
  %45 = and i32 %44, 2048
  %.not47 = icmp eq i32 %45, 0
  br i1 %.not47, label %50, label %46

46:                                               ; preds = %42
  %47 = getelementptr inbounds i8, ptr %0, i64 28
  %48 = load i32, ptr %47, align 4, !tbaa !12
  %49 = icmp ult i32 %48, 1008
  br i1 %49, label %66, label %50

50:                                               ; preds = %46, %42, %39
  %51 = tail call i32 @LIBXSMM_GEMM_GETENUM_AB_COMMON_PREC(ptr noundef nonnull %11) #2
  %52 = icmp eq i32 %51, 2
  br i1 %52, label %53, label %58

53:                                               ; preds = %50
  %54 = getelementptr inbounds i8, ptr %3, i64 24
  %55 = load i32, ptr %54, align 1, !tbaa !5
  %56 = and i32 %55, 2048
  %57 = icmp eq i32 %56, 0
  br i1 %57, label %66, label %58

58:                                               ; preds = %53, %50
  %59 = tail call i32 @LIBXSMM_GEMM_GETENUM_AB_COMMON_PREC(ptr noundef nonnull %11) #2
  %60 = icmp eq i32 %59, 2
  br i1 %60, label %61, label %65

61:                                               ; preds = %58
  %62 = getelementptr inbounds i8, ptr %3, i64 24
  %63 = load i32, ptr %62, align 1, !tbaa !5
  %64 = and i32 %63, 2048
  %.not48 = icmp eq i32 %64, 0
  br i1 %.not48, label %65, label %66

65:                                               ; preds = %61, %58
  br label %66

66:                                               ; preds = %61, %53, %46, %35, %.thread54, %65
  %.046 = phi ptr [ @libxsmm_generator_gemm_avx2_microkernel, %65 ], [ @libxsmm_generator_gemm_avx2_microkernel_int8_uu_ss_vnni_emu, %.thread54 ], [ @libxsmm_generator_gemm_avx2_microkernel_int8_int16_vnni_emu, %35 ], [ @libxsmm_generator_gemm_avx2_microkernel_bf16_vnni_emu, %46 ], [ @libxsmm_generator_gemm_avx2_microkernel_bf16_flat_emu, %53 ], [ @libxsmm_generator_gemm_avx2_microkernel_bf16_vnni_srf, %61 ]
  %67 = getelementptr inbounds i8, ptr %3, i64 24
  %68 = load i32, ptr %67, align 1, !tbaa !5
  %69 = and i32 %68, 2048
  %.not49 = icmp eq i32 %69, 0
  br i1 %.not49, label %73, label %70

70:                                               ; preds = %66
  %71 = tail call i32 @LIBXSMM_GEMM_GETENUM_AB_COMMON_PREC(ptr noundef nonnull %11) #2
  %72 = tail call i32 @libxsmm_cpuid_dot_pack_factor(i32 noundef %71) #2
  br label %73

73:                                               ; preds = %70, %66
  %.045 = phi i32 [ %72, %70 ], [ 1, %66 ]
  %.not = icmp eq i32 %6, 0
  br i1 %.not, label %.loopexit, label %.lr.ph

.lr.ph:                                           ; preds = %73, %.lr.ph
  %.055 = phi i32 [ %74, %.lr.ph ], [ 0, %73 ]
  tail call void %.046(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3, i32 noundef %4, i32 noundef %5) #2
  %74 = add i32 %.055, %.045
  %75 = icmp ult i32 %74, %6
  br i1 %75, label %.lr.ph, label %.loopexit, !llvm.loop !15

.loopexit:                                        ; preds = %.lr.ph, %73, %25
  ret void
}

declare i32 @libxsmm_x86_is_Amxfp4_Bfp32_gemm(ptr noundef) local_unnamed_addr #1

declare i32 @libxsmm_x86_is_Amxfp4_Bbf16_gemm(ptr noundef) local_unnamed_addr #1

declare i32 @libxsmm_x86_is_Amxfp4_Bi8_gemm(ptr noundef) local_unnamed_addr #1

declare i32 @LIBXSMM_GEMM_GETENUM_AB_COMMON_PREC(ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare dso_local void @libxsmm_generator_gemm_avx2_microkernel_Amxfp4(ptr noundef, ptr noundef, ptr noundef, ptr noundef, i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local void @libxsmm_generator_gemm_avx2_microkernel_int8_uu_ss_vnni_emu(ptr noundef, ptr noundef, ptr noundef, ptr noundef, i32 noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local void @libxsmm_generator_gemm_avx2_microkernel_int8_int16_vnni_emu(ptr noundef, ptr noundef, ptr noundef, ptr noundef, i32 noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local void @libxsmm_generator_gemm_avx2_microkernel_bf16_vnni_emu(ptr noundef, ptr noundef, ptr noundef, ptr noundef, i32 noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local void @libxsmm_generator_gemm_avx2_microkernel_bf16_flat_emu(ptr noundef, ptr noundef, ptr noundef, ptr noundef, i32 noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local void @libxsmm_generator_gemm_avx2_microkernel_bf16_vnni_srf(ptr noundef, ptr noundef, ptr noundef, ptr noundef, i32 noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local void @libxsmm_generator_gemm_avx2_microkernel(ptr noundef, ptr noundef, ptr noundef, ptr noundef, i32 noundef, i32 noundef) local_unnamed_addr #0

declare i32 @libxsmm_cpuid_dot_pack_factor(i32 noundef) local_unnamed_addr #1

attributes #0 = { 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 #1 = { "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 = { 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, !7, i64 24}
!6 = !{!"libxsmm_gemm_descriptor", !7, i64 0, !7, i64 4, !7, i64 8, !7, i64 12, !7, i64 16, !7, i64 20, !7, i64 24, !8, i64 28, !8, i64 29, !8, i64 32, !10, i64 33, !10, i64 41, !8, i64 49, !7, i64 50, !7, i64 54, !7, i64 58, !11, i64 62, !11, i64 64, !8, i64 66, !8, i64 67, !8, i64 68, !8, i64 69, !11, i64 70, !11, i64 72, !11, i64 74, !11, i64 76, !11, i64 78, !11, i64 80, !7, i64 82, !7, i64 86, !7, i64 90, !8, i64 94}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"long long", !8, i64 0}
!11 = !{!"short", !8, i64 0}
!12 = !{!13, !7, i64 28}
!13 = !{!"libxsmm_generated_code", !14, i64 0, !7, i64 8, !7, i64 12, !7, i64 16, !7, i64 20, !7, i64 24, !7, i64 28}
!14 = !{!"any pointer", !8, i64 0}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass,TailCallElimPass