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

; 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_def = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, double, double, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, float, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i64, i64, ptr, ptr, ptr, ptr, ptr, i32, i32, i32, i32, i32, i32, ptr, ptr }
%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_gemm_ext_param = type { %struct.libxsmm_matrix_op_arg, %struct.libxsmm_matrix_arg, %struct.libxsmm_matrix_arg, %struct.libxsmm_matrix_arg, %struct.libxsmm_matrix_arg, %struct.libxsmm_matrix_arg, %struct.libxsmm_matrix_arg, %struct.libxsmm_matrix_arg }
%struct.libxsmm_matrix_op_arg = type { ptr, ptr, ptr, ptr }
%struct.libxsmm_matrix_arg = type { ptr, ptr, ptr, ptr, ptr, ptr }
%struct.libxsmm_gemm_param = type { %struct.libxsmm_matrix_op_arg, %struct.libxsmm_matrix_arg, %struct.libxsmm_matrix_arg, %struct.libxsmm_matrix_arg }

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

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

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

; Function Attrs: nounwind uwtable
declare dso_local void @libxsmm_ref_allocate_c_scratch(ptr noundef) #2

; Function Attrs: nounwind uwtable
declare dso_local void @libxsmm_ref_allocate_c_vnni_scratch(ptr noundef) #2

; Function Attrs: nounwind uwtable
declare dso_local void @libxsmm_ref_deallocate_c_scratch(ptr noundef) #2

; Function Attrs: nounwind
declare void @free(ptr noundef) #3

; Function Attrs: nounwind uwtable
declare dso_local void @libxsmm_ref_deallocate_c_vnni_scratch(ptr noundef) #2

; Function Attrs: nounwind uwtable
declare dso_local void @libxsmm_ref_apply_preop(ptr noundef, ptr noundef, ptr noundef) #2

; Function Attrs: nounwind uwtable
declare dso_local void @libxsmm_ref_apply_postop(ptr noundef, ptr noundef, ptr noundef) #2

; Function Attrs: nounwind uwtable
declare dso_local void @libxsmm_setup_gemm_def(ptr noundef, ptr noundef, ptr noundef) #2

; Function Attrs: nounwind uwtable
declare dso_local void @libxsmm_ref_matmul(ptr noundef, ptr noundef, ptr noundef, ptr noundef) #2

; Function Attrs: nounwind uwtable
declare dso_local void @libxsmm_ref_apply_c_vnni(ptr noundef, ptr noundef, ptr noundef) #2

; Function Attrs: nounwind uwtable
define dso_local void @libxsmm_reference_gemm(ptr noundef %0, ptr noundef %1) #2 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca %struct.libxsmm_gemm_def, align 8
  %6 = alloca i32, align 4
  %7 = alloca %struct.libxsmm_gemm_descriptor, align 1
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 360, ptr %5) #4
  %10 = load ptr, ptr %4, align 8, !tbaa !5
  %11 = getelementptr inbounds %struct.libxsmm_gemm_descriptor, ptr %10, i32 0, i32 6
  %12 = load i32, ptr %11, align 1, !tbaa !9
  %13 = and i32 %12, 64
  %14 = icmp ugt i32 %13, 0
  br i1 %14, label %15, label %22

15:                                               ; preds = %2
  %16 = load ptr, ptr %4, align 8, !tbaa !5
  %17 = getelementptr inbounds %struct.libxsmm_gemm_descriptor, ptr %16, i32 0, i32 6
  %18 = load i32, ptr %17, align 1, !tbaa !9
  %19 = and i32 %18, 128
  %20 = icmp eq i32 %19, 0
  br i1 %20, label %21, label %22

21:                                               ; preds = %15
  store i32 1, ptr %6, align 4
  br label %101

22:                                               ; preds = %15, %2
  %23 = load ptr, ptr %4, align 8, !tbaa !5
  %24 = getelementptr inbounds %struct.libxsmm_gemm_descriptor, ptr %23, i32 0, i32 6
  %25 = load i32, ptr %24, align 1, !tbaa !9
  %26 = and i32 %25, 64
  %27 = icmp eq i32 %26, 0
  br i1 %27, label %28, label %35

28:                                               ; preds = %22
  %29 = load ptr, ptr %4, align 8, !tbaa !5
  %30 = getelementptr inbounds %struct.libxsmm_gemm_descriptor, ptr %29, i32 0, i32 6
  %31 = load i32, ptr %30, align 1, !tbaa !9
  %32 = and i32 %31, 128
  %33 = icmp ugt i32 %32, 0
  br i1 %33, label %34, label %35

34:                                               ; preds = %28
  store i32 1, ptr %6, align 4
  br label %101

35:                                               ; preds = %28, %22
  %36 = load ptr, ptr %4, align 8, !tbaa !5
  %37 = getelementptr inbounds %struct.libxsmm_gemm_descriptor, ptr %36, i32 0, i32 6
  %38 = load i32, ptr %37, align 1, !tbaa !9
  %39 = and i32 %38, 32768
  %40 = icmp ugt i32 %39, 0
  br i1 %40, label %41, label %67

41:                                               ; preds = %35
  call void @llvm.lifetime.start.p0(i64 95, ptr %7) #4
  %42 = load ptr, ptr %4, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %7, ptr align 1 %42, i64 95, i1 false), !tbaa.struct !14
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #4
  %43 = load ptr, ptr %3, align 8, !tbaa !5
  store ptr %43, ptr %8, align 8, !tbaa !5
  %44 = load ptr, ptr %3, align 8, !tbaa !5
  call void @libxsmm_setup_gemm_def(ptr noundef %5, ptr noundef %44, ptr noundef %7)
  %45 = load ptr, ptr %8, align 8, !tbaa !5
  %46 = getelementptr inbounds %struct.libxsmm_gemm_ext_param, ptr %45, i32 0, i32 3
  %47 = getelementptr inbounds %struct.libxsmm_matrix_arg, ptr %46, i32 0, i32 0
  %48 = load ptr, ptr %47, align 8, !tbaa !19
  %49 = getelementptr inbounds %struct.libxsmm_gemm_def, ptr %5, i32 0, i32 66
  store ptr %48, ptr %49, align 8, !tbaa !23
  call void @libxsmm_ref_allocate_c_scratch(ptr noundef %5)
  call void @libxsmm_ref_allocate_c_vnni_scratch(ptr noundef %5)
  %50 = load ptr, ptr %8, align 8, !tbaa !5
  call void @libxsmm_ref_apply_preop(ptr noundef %5, ptr noundef %50, ptr noundef %7)
  %51 = load ptr, ptr %8, align 8, !tbaa !5
  %52 = getelementptr inbounds %struct.libxsmm_gemm_ext_param, ptr %51, i32 0, i32 1
  %53 = getelementptr inbounds %struct.libxsmm_matrix_arg, ptr %52, i32 0, i32 0
  %54 = load ptr, ptr %53, align 8, !tbaa !27
  %55 = load ptr, ptr %8, align 8, !tbaa !5
  %56 = getelementptr inbounds %struct.libxsmm_gemm_ext_param, ptr %55, i32 0, i32 2
  %57 = getelementptr inbounds %struct.libxsmm_matrix_arg, ptr %56, i32 0, i32 0
  %58 = load ptr, ptr %57, align 8, !tbaa !28
  %59 = getelementptr inbounds %struct.libxsmm_gemm_def, ptr %5, i32 0, i32 66
  %60 = load ptr, ptr %59, align 8, !tbaa !23
  call void @libxsmm_ref_matmul(ptr noundef %5, ptr noundef %54, ptr noundef %58, ptr noundef %60)
  %61 = load ptr, ptr %8, align 8, !tbaa !5
  call void @libxsmm_ref_apply_postop(ptr noundef %5, ptr noundef %61, ptr noundef %7)
  %62 = load ptr, ptr %8, align 8, !tbaa !5
  %63 = getelementptr inbounds %struct.libxsmm_gemm_ext_param, ptr %62, i32 0, i32 3
  %64 = getelementptr inbounds %struct.libxsmm_matrix_arg, ptr %63, i32 0, i32 0
  %65 = load ptr, ptr %64, align 8, !tbaa !19
  %66 = load ptr, ptr %4, align 8, !tbaa !5
  call void @libxsmm_ref_apply_c_vnni(ptr noundef %5, ptr noundef %65, ptr noundef %66)
  call void @libxsmm_ref_deallocate_c_scratch(ptr noundef %5)
  call void @libxsmm_ref_deallocate_c_vnni_scratch(ptr noundef %5)
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 95, ptr %7) #4
  br label %88

67:                                               ; preds = %35
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #4
  %68 = load ptr, ptr %3, align 8, !tbaa !5
  store ptr %68, ptr %9, align 8, !tbaa !5
  %69 = load ptr, ptr %3, align 8, !tbaa !5
  %70 = load ptr, ptr %4, align 8, !tbaa !5
  call void @libxsmm_setup_gemm_def(ptr noundef %5, ptr noundef %69, ptr noundef %70)
  call void @libxsmm_ref_allocate_c_vnni_scratch(ptr noundef %5)
  %71 = load ptr, ptr %9, align 8, !tbaa !5
  %72 = getelementptr inbounds %struct.libxsmm_gemm_param, ptr %71, i32 0, i32 1
  %73 = getelementptr inbounds %struct.libxsmm_matrix_arg, ptr %72, i32 0, i32 0
  %74 = load ptr, ptr %73, align 8, !tbaa !29
  %75 = load ptr, ptr %9, align 8, !tbaa !5
  %76 = getelementptr inbounds %struct.libxsmm_gemm_param, ptr %75, i32 0, i32 2
  %77 = getelementptr inbounds %struct.libxsmm_matrix_arg, ptr %76, i32 0, i32 0
  %78 = load ptr, ptr %77, align 8, !tbaa !31
  %79 = load ptr, ptr %9, align 8, !tbaa !5
  %80 = getelementptr inbounds %struct.libxsmm_gemm_param, ptr %79, i32 0, i32 3
  %81 = getelementptr inbounds %struct.libxsmm_matrix_arg, ptr %80, i32 0, i32 0
  %82 = load ptr, ptr %81, align 8, !tbaa !32
  call void @libxsmm_ref_matmul(ptr noundef %5, ptr noundef %74, ptr noundef %78, ptr noundef %82)
  %83 = load ptr, ptr %9, align 8, !tbaa !5
  %84 = getelementptr inbounds %struct.libxsmm_gemm_param, ptr %83, i32 0, i32 3
  %85 = getelementptr inbounds %struct.libxsmm_matrix_arg, ptr %84, i32 0, i32 0
  %86 = load ptr, ptr %85, align 8, !tbaa !32
  %87 = load ptr, ptr %4, align 8, !tbaa !5
  call void @libxsmm_ref_apply_c_vnni(ptr noundef %5, ptr noundef %86, ptr noundef %87)
  call void @libxsmm_ref_deallocate_c_vnni_scratch(ptr noundef %5)
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #4
  br label %88

88:                                               ; preds = %67, %41
  %89 = getelementptr inbounds %struct.libxsmm_gemm_def, ptr %5, i32 0, i32 51
  %90 = load i32, ptr %89, align 4, !tbaa !33
  %91 = icmp ugt i32 %90, 0
  br i1 %91, label %92, label %100

92:                                               ; preds = %88
  %93 = getelementptr inbounds %struct.libxsmm_gemm_def, ptr %5, i32 0, i32 66
  %94 = load ptr, ptr %93, align 8, !tbaa !23
  %95 = icmp ne ptr %94, null
  br i1 %95, label %96, label %99

96:                                               ; preds = %92
  %97 = getelementptr inbounds %struct.libxsmm_gemm_def, ptr %5, i32 0, i32 66
  %98 = load ptr, ptr %97, align 8, !tbaa !23
  call void @free(ptr noundef %98) #4
  br label %99

99:                                               ; preds = %96, %92
  br label %100

100:                                              ; preds = %99, %88
  store i32 0, ptr %6, align 4
  br label %101

101:                                              ; preds = %100, %34, %21
  call void @llvm.lifetime.end.p0(i64 360, ptr %5) #4
  %102 = load i32, ptr %6, align 4
  switch i32 %102, label %104 [
    i32 0, label %103
    i32 1, label %103
  ]

103:                                              ; preds = %101, %101
  ret void

104:                                              ; preds = %101
  unreachable
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { 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 = { 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, !11, i64 24}
!10 = !{!"libxsmm_gemm_descriptor", !11, i64 0, !11, i64 4, !11, i64 8, !11, i64 12, !11, i64 16, !11, i64 20, !11, i64 24, !7, i64 28, !7, i64 29, !7, i64 32, !12, i64 33, !12, i64 41, !7, i64 49, !11, i64 50, !11, i64 54, !11, i64 58, !13, i64 62, !13, i64 64, !7, i64 66, !7, i64 67, !7, i64 68, !7, i64 69, !13, i64 70, !13, i64 72, !13, i64 74, !13, i64 76, !13, i64 78, !13, i64 80, !11, i64 82, !11, i64 86, !11, i64 90, !7, i64 94}
!11 = !{!"int", !7, i64 0}
!12 = !{!"long long", !7, i64 0}
!13 = !{!"short", !7, i64 0}
!14 = !{i64 0, i64 4, !15, i64 4, i64 4, !15, i64 8, i64 4, !15, i64 12, i64 4, !15, i64 16, i64 4, !15, i64 20, i64 4, !15, i64 24, i64 4, !15, i64 28, i64 1, !16, i64 29, i64 3, !16, i64 32, i64 1, !16, i64 33, i64 8, !17, i64 41, i64 8, !17, i64 49, i64 1, !16, i64 50, i64 4, !15, i64 54, i64 4, !15, i64 58, i64 4, !15, i64 62, i64 2, !18, i64 64, i64 2, !18, i64 66, i64 1, !16, i64 67, i64 1, !16, i64 68, i64 1, !16, i64 69, i64 1, !16, i64 70, i64 2, !18, i64 72, i64 2, !18, i64 74, i64 2, !18, i64 76, i64 2, !18, i64 78, i64 2, !18, i64 80, i64 2, !18, i64 82, i64 4, !15, i64 86, i64 4, !15, i64 90, i64 4, !15, i64 94, i64 1, !16}
!15 = !{!11, !11, i64 0}
!16 = !{!7, !7, i64 0}
!17 = !{!12, !12, i64 0}
!18 = !{!13, !13, i64 0}
!19 = !{!20, !6, i64 128}
!20 = !{!"libxsmm_gemm_ext_param", !21, i64 0, !22, i64 32, !22, i64 80, !22, i64 128, !22, i64 176, !22, i64 224, !22, i64 272, !22, i64 320}
!21 = !{!"libxsmm_matrix_op_arg", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!22 = !{!"libxsmm_matrix_arg", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40}
!23 = !{!24, !6, i64 344}
!24 = !{!"libxsmm_gemm_def", !11, i64 0, !11, i64 4, !11, i64 8, !11, i64 12, !11, i64 16, !11, i64 20, !11, i64 24, !11, i64 28, !11, i64 32, !11, i64 36, !11, i64 40, !11, i64 44, !25, i64 48, !25, i64 56, !11, i64 64, !11, i64 68, !11, i64 72, !11, i64 76, !11, i64 80, !11, i64 84, !11, i64 88, !11, i64 92, !11, i64 96, !11, i64 100, !11, i64 104, !11, i64 108, !11, i64 112, !11, i64 116, !11, i64 120, !26, i64 124, !6, i64 128, !6, i64 136, !6, i64 144, !6, i64 152, !6, i64 160, !6, i64 168, !6, i64 176, !6, i64 184, !6, i64 192, !6, i64 200, !11, i64 208, !11, i64 212, !11, i64 216, !11, i64 220, !11, i64 224, !11, i64 228, !11, i64 232, !11, i64 236, !11, i64 240, !11, i64 244, !11, i64 248, !11, i64 252, !11, i64 256, !12, i64 264, !12, i64 272, !6, i64 280, !6, i64 288, !6, i64 296, !6, i64 304, !6, i64 312, !11, i64 320, !11, i64 324, !11, i64 328, !11, i64 332, !11, i64 336, !11, i64 340, !6, i64 344, !6, i64 352}
!25 = !{!"double", !7, i64 0}
!26 = !{!"float", !7, i64 0}
!27 = !{!20, !6, i64 32}
!28 = !{!20, !6, i64 80}
!29 = !{!30, !6, i64 32}
!30 = !{!"libxsmm_gemm_param", !21, i64 0, !22, i64 32, !22, i64 80, !22, i64 128}
!31 = !{!30, !6, i64 80}
!32 = !{!30, !6, i64 128}
!33 = !{!24, !11, i64 252}


; 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.libxsmm_gemm_def = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, double, double, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, float, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i64, i64, ptr, ptr, ptr, ptr, ptr, i32, i32, i32, i32, i32, i32, ptr, ptr }
%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 }>

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

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

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

; Function Attrs: nounwind uwtable
declare dso_local void @libxsmm_ref_allocate_c_scratch(ptr noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare dso_local void @libxsmm_ref_allocate_c_vnni_scratch(ptr noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare dso_local void @libxsmm_ref_deallocate_c_scratch(ptr noundef) local_unnamed_addr #2

; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #3

; Function Attrs: nounwind uwtable
declare dso_local void @libxsmm_ref_deallocate_c_vnni_scratch(ptr noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare dso_local void @libxsmm_ref_apply_preop(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare dso_local void @libxsmm_ref_apply_postop(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare dso_local void @libxsmm_setup_gemm_def(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare dso_local void @libxsmm_ref_matmul(ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare dso_local void @libxsmm_ref_apply_c_vnni(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
define dso_local void @libxsmm_reference_gemm(ptr noundef %0, ptr noundef %1) local_unnamed_addr #2 {
  %3 = alloca %struct.libxsmm_gemm_def, align 8
  %4 = alloca %struct.libxsmm_gemm_descriptor, align 1
  call void @llvm.lifetime.start.p0(i64 360, ptr nonnull %3) #4
  %5 = getelementptr inbounds i8, ptr %1, i64 24
  %6 = load i32, ptr %5, align 1, !tbaa !5
  %7 = trunc i32 %6 to i8
  %trunc = and i8 %7, -64
  switch i8 %trunc, label %8 [
    i8 -128, label %36
    i8 64, label %36
  ]

8:                                                ; preds = %2
  %9 = and i32 %6, 32768
  %.not26 = icmp eq i32 %9, 0
  br i1 %.not26, label %20, label %10

10:                                               ; preds = %8
  call void @llvm.lifetime.start.p0(i64 95, ptr nonnull %4) #4
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(95) %4, ptr noundef nonnull align 1 dereferenceable(95) %1, i64 95, i1 false), !tbaa.struct !12
  call void @libxsmm_setup_gemm_def(ptr noundef nonnull %3, ptr noundef %0, ptr noundef nonnull %4)
  %11 = getelementptr inbounds i8, ptr %0, i64 128
  %12 = load ptr, ptr %11, align 8, !tbaa !17
  %13 = getelementptr inbounds i8, ptr %3, i64 344
  store ptr %12, ptr %13, align 8, !tbaa !22
  call void @libxsmm_ref_allocate_c_scratch(ptr noundef nonnull %3)
  call void @libxsmm_ref_allocate_c_vnni_scratch(ptr noundef nonnull %3)
  call void @libxsmm_ref_apply_preop(ptr noundef nonnull %3, ptr noundef %0, ptr noundef nonnull %4)
  %14 = getelementptr inbounds i8, ptr %0, i64 32
  %15 = load ptr, ptr %14, align 8, !tbaa !26
  %16 = getelementptr inbounds i8, ptr %0, i64 80
  %17 = load ptr, ptr %16, align 8, !tbaa !27
  %18 = load ptr, ptr %13, align 8, !tbaa !22
  call void @libxsmm_ref_matmul(ptr noundef nonnull %3, ptr noundef %15, ptr noundef %17, ptr noundef %18)
  call void @libxsmm_ref_apply_postop(ptr noundef nonnull %3, ptr noundef %0, ptr noundef nonnull %4)
  %19 = load ptr, ptr %11, align 8, !tbaa !17
  call void @libxsmm_ref_apply_c_vnni(ptr noundef nonnull %3, ptr noundef %19, ptr noundef nonnull %1)
  call void @libxsmm_ref_deallocate_c_scratch(ptr noundef nonnull %3)
  call void @libxsmm_ref_deallocate_c_vnni_scratch(ptr noundef nonnull %3)
  call void @llvm.lifetime.end.p0(i64 95, ptr nonnull %4) #4
  br label %28

20:                                               ; preds = %8
  call void @libxsmm_setup_gemm_def(ptr noundef nonnull %3, ptr noundef %0, ptr noundef nonnull %1)
  call void @libxsmm_ref_allocate_c_vnni_scratch(ptr noundef nonnull %3)
  %21 = getelementptr inbounds i8, ptr %0, i64 32
  %22 = load ptr, ptr %21, align 8, !tbaa !28
  %23 = getelementptr inbounds i8, ptr %0, i64 80
  %24 = load ptr, ptr %23, align 8, !tbaa !30
  %25 = getelementptr inbounds i8, ptr %0, i64 128
  %26 = load ptr, ptr %25, align 8, !tbaa !31
  call void @libxsmm_ref_matmul(ptr noundef nonnull %3, ptr noundef %22, ptr noundef %24, ptr noundef %26)
  %27 = load ptr, ptr %25, align 8, !tbaa !31
  call void @libxsmm_ref_apply_c_vnni(ptr noundef nonnull %3, ptr noundef %27, ptr noundef nonnull %1)
  call void @libxsmm_ref_deallocate_c_vnni_scratch(ptr noundef nonnull %3)
  br label %28

28:                                               ; preds = %20, %10
  %29 = getelementptr inbounds i8, ptr %3, i64 252
  %30 = load i32, ptr %29, align 4, !tbaa !32
  %31 = icmp ne i32 %30, 0
  %32 = getelementptr inbounds i8, ptr %3, i64 344
  %33 = load ptr, ptr %32, align 8
  %34 = icmp ne ptr %33, null
  %or.cond = select i1 %31, i1 %34, i1 false
  br i1 %or.cond, label %35, label %36

35:                                               ; preds = %28
  call void @free(ptr noundef nonnull %33) #4
  br label %36

36:                                               ; preds = %2, %2, %28, %35
  call void @llvm.lifetime.end.p0(i64 360, ptr nonnull %3) #4
  ret void
}

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "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 = { 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 = !{i64 0, i64 4, !13, i64 4, i64 4, !13, i64 8, i64 4, !13, i64 12, i64 4, !13, i64 16, i64 4, !13, i64 20, i64 4, !13, i64 24, i64 4, !13, i64 28, i64 1, !14, i64 29, i64 3, !14, i64 32, i64 1, !14, i64 33, i64 8, !15, i64 41, i64 8, !15, i64 49, i64 1, !14, i64 50, i64 4, !13, i64 54, i64 4, !13, i64 58, i64 4, !13, i64 62, i64 2, !16, i64 64, i64 2, !16, i64 66, i64 1, !14, i64 67, i64 1, !14, i64 68, i64 1, !14, i64 69, i64 1, !14, i64 70, i64 2, !16, i64 72, i64 2, !16, i64 74, i64 2, !16, i64 76, i64 2, !16, i64 78, i64 2, !16, i64 80, i64 2, !16, i64 82, i64 4, !13, i64 86, i64 4, !13, i64 90, i64 4, !13, i64 94, i64 1, !14}
!13 = !{!7, !7, i64 0}
!14 = !{!8, !8, i64 0}
!15 = !{!10, !10, i64 0}
!16 = !{!11, !11, i64 0}
!17 = !{!18, !20, i64 128}
!18 = !{!"libxsmm_gemm_ext_param", !19, i64 0, !21, i64 32, !21, i64 80, !21, i64 128, !21, i64 176, !21, i64 224, !21, i64 272, !21, i64 320}
!19 = !{!"libxsmm_matrix_op_arg", !20, i64 0, !20, i64 8, !20, i64 16, !20, i64 24}
!20 = !{!"any pointer", !8, i64 0}
!21 = !{!"libxsmm_matrix_arg", !20, i64 0, !20, i64 8, !20, i64 16, !20, i64 24, !20, i64 32, !20, i64 40}
!22 = !{!23, !20, i64 344}
!23 = !{!"libxsmm_gemm_def", !7, i64 0, !7, i64 4, !7, i64 8, !7, i64 12, !7, i64 16, !7, i64 20, !7, i64 24, !7, i64 28, !7, i64 32, !7, i64 36, !7, i64 40, !7, i64 44, !24, i64 48, !24, i64 56, !7, i64 64, !7, i64 68, !7, i64 72, !7, i64 76, !7, i64 80, !7, i64 84, !7, i64 88, !7, i64 92, !7, i64 96, !7, i64 100, !7, i64 104, !7, i64 108, !7, i64 112, !7, i64 116, !7, i64 120, !25, i64 124, !20, i64 128, !20, i64 136, !20, i64 144, !20, i64 152, !20, i64 160, !20, i64 168, !20, i64 176, !20, i64 184, !20, i64 192, !20, i64 200, !7, i64 208, !7, i64 212, !7, i64 216, !7, i64 220, !7, i64 224, !7, i64 228, !7, i64 232, !7, i64 236, !7, i64 240, !7, i64 244, !7, i64 248, !7, i64 252, !7, i64 256, !10, i64 264, !10, i64 272, !20, i64 280, !20, i64 288, !20, i64 296, !20, i64 304, !20, i64 312, !7, i64 320, !7, i64 324, !7, i64 328, !7, i64 332, !7, i64 336, !7, i64 340, !20, i64 344, !20, i64 352}
!24 = !{!"double", !8, i64 0}
!25 = !{!"float", !8, i64 0}
!26 = !{!18, !20, i64 32}
!27 = !{!18, !20, i64 80}
!28 = !{!29, !20, i64 32}
!29 = !{!"libxsmm_gemm_param", !19, i64 0, !21, i64 32, !21, i64 80, !21, i64 128}
!30 = !{!29, !20, i64 80}
!31 = !{!29, !20, i64 128}
!32 = !{!23, !7, i64 252}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,SROAPass,SimplifyCFGPass