; LLVM IR from ggml-org/ggml :: src/ggml-cpu (ggml-cpu-quants)

; 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.block_q5_0 = type { i16, [4 x i8], [16 x i8] }
%struct.block_q8_0 = type { i16, [32 x i8] }

@.str.1 = external hidden unnamed_addr constant [78 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [9 x i8], align 1
@__PRETTY_FUNCTION__.ggml_vec_dot_q5_0_q8_0 = external hidden unnamed_addr constant [123 x i8], align 1

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #0

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

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

; Function Attrs: inlinehint nounwind uwtable
declare hidden float @ggml_lookup_fp16_to_fp32(i16 noundef zeroext) #2

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare float @llvm.fmuladd.f32(float, float, float) #3

; Function Attrs: nounwind uwtable
define dso_local void @ggml_vec_dot_q5_0_q8_0(i32 noundef %0, ptr noalias noundef %1, i64 noundef %2, ptr noalias noundef %3, i64 noundef %4, ptr noalias noundef %5, i64 noundef %6, i32 noundef %7) #4 {
  %9 = alloca i32, align 4
  %10 = alloca ptr, align 8
  %11 = alloca i64, align 8
  %12 = alloca ptr, align 8
  %13 = alloca i64, align 8
  %14 = alloca ptr, align 8
  %15 = alloca i64, align 8
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca float, align 4
  %21 = alloca ptr, align 8
  %22 = alloca ptr, align 8
  %23 = alloca i32, align 4
  %24 = alloca i32, align 4
  %25 = alloca i32, align 4
  %26 = alloca i32, align 4
  %27 = alloca i8, align 1
  %28 = alloca i8, align 1
  %29 = alloca i32, align 4
  %30 = alloca i32, align 4
  %31 = alloca i32, align 4
  store i32 %0, ptr %9, align 4, !tbaa !5
  store ptr %1, ptr %10, align 8, !tbaa !9
  store i64 %2, ptr %11, align 8, !tbaa !11
  store ptr %3, ptr %12, align 8, !tbaa !9
  store i64 %4, ptr %13, align 8, !tbaa !11
  store ptr %5, ptr %14, align 8, !tbaa !9
  store i64 %6, ptr %15, align 8, !tbaa !11
  store i32 %7, ptr %16, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #6
  store i32 32, ptr %17, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #6
  %32 = load i32, ptr %9, align 4, !tbaa !5
  %33 = sdiv i32 %32, 32
  store i32 %33, ptr %18, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #6
  store i32 0, ptr %19, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #6
  store float 0.000000e+00, ptr %20, align 4, !tbaa !13
  %34 = load i32, ptr %9, align 4, !tbaa !5
  %35 = srem i32 %34, 32
  %36 = icmp eq i32 %35, 0
  br i1 %36, label %37, label %38

37:                                               ; preds = %8
  br label %39

38:                                               ; preds = %8
  call void @__assert_fail(ptr noundef @.str.4, ptr noundef @.str.1, i32 noundef 2937, ptr noundef @__PRETTY_FUNCTION__.ggml_vec_dot_q5_0_q8_0) #7
  unreachable

39:                                               ; preds = %37
  %40 = load i32, ptr %16, align 4, !tbaa !5
  %41 = icmp eq i32 %40, 1
  br i1 %41, label %42, label %43

42:                                               ; preds = %39
  br label %44

43:                                               ; preds = %39
  call void @__assert_fail(ptr noundef @.str.5, ptr noundef @.str.1, i32 noundef 2939, ptr noundef @__PRETTY_FUNCTION__.ggml_vec_dot_q5_0_q8_0) #7
  unreachable

44:                                               ; preds = %42
  %45 = load i32, ptr %16, align 4, !tbaa !5
  %46 = load i64, ptr %13, align 8, !tbaa !11
  %47 = load i64, ptr %15, align 8, !tbaa !11
  %48 = load i64, ptr %11, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #6
  %49 = load ptr, ptr %12, align 8, !tbaa !9
  store ptr %49, ptr %21, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #6
  %50 = load ptr, ptr %14, align 8, !tbaa !9
  store ptr %50, ptr %22, align 8, !tbaa !9
  br label %51

51:                                               ; preds = %175, %44
  %52 = load i32, ptr %19, align 4, !tbaa !5
  %53 = load i32, ptr %18, align 4, !tbaa !5
  %54 = icmp slt i32 %52, %53
  br i1 %54, label %55, label %178

55:                                               ; preds = %51
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #6
  %56 = load ptr, ptr %21, align 8, !tbaa !9
  %57 = load i32, ptr %19, align 4, !tbaa !5
  %58 = sext i32 %57 to i64
  %59 = getelementptr inbounds %struct.block_q5_0, ptr %56, i64 %58
  %60 = getelementptr inbounds %struct.block_q5_0, ptr %59, i32 0, i32 1
  %61 = getelementptr inbounds [4 x i8], ptr %60, i64 0, i64 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %23, ptr align 2 %61, i64 4, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #6
  store i32 0, ptr %24, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #6
  store i32 0, ptr %25, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #6
  store i32 0, ptr %26, align 4, !tbaa !5
  br label %62

62:                                               ; preds = %149, %55
  %63 = load i32, ptr %26, align 4, !tbaa !5
  %64 = icmp slt i32 %63, 16
  br i1 %64, label %66, label %65

65:                                               ; preds = %62
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #6
  br label %152

66:                                               ; preds = %62
  call void @llvm.lifetime.start.p0(i64 1, ptr %27) #6
  %67 = load i32, ptr %23, align 4, !tbaa !5
  %68 = load i32, ptr %26, align 4, !tbaa !5
  %69 = add nsw i32 %68, 0
  %70 = shl i32 1, %69
  %71 = and i32 %67, %70
  %72 = load i32, ptr %26, align 4, !tbaa !5
  %73 = add nsw i32 %72, 0
  %74 = lshr i32 %71, %73
  %75 = shl i32 %74, 4
  %76 = trunc i32 %75 to i8
  store i8 %76, ptr %27, align 1, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 1, ptr %28) #6
  %77 = load i32, ptr %23, align 4, !tbaa !5
  %78 = load i32, ptr %26, align 4, !tbaa !5
  %79 = add nsw i32 %78, 16
  %80 = shl i32 1, %79
  %81 = and i32 %77, %80
  %82 = load i32, ptr %26, align 4, !tbaa !5
  %83 = add nsw i32 %82, 12
  %84 = lshr i32 %81, %83
  %85 = trunc i32 %84 to i8
  store i8 %85, ptr %28, align 1, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 4, ptr %29) #6
  %86 = load ptr, ptr %21, align 8, !tbaa !9
  %87 = load i32, ptr %19, align 4, !tbaa !5
  %88 = sext i32 %87 to i64
  %89 = getelementptr inbounds %struct.block_q5_0, ptr %86, i64 %88
  %90 = getelementptr inbounds %struct.block_q5_0, ptr %89, i32 0, i32 2
  %91 = load i32, ptr %26, align 4, !tbaa !5
  %92 = sext i32 %91 to i64
  %93 = getelementptr inbounds [16 x i8], ptr %90, i64 0, i64 %92
  %94 = load i8, ptr %93, align 1, !tbaa !15
  %95 = zext i8 %94 to i32
  %96 = and i32 %95, 15
  %97 = load i8, ptr %27, align 1, !tbaa !15
  %98 = zext i8 %97 to i32
  %99 = or i32 %96, %98
  %100 = sub nsw i32 %99, 16
  %101 = trunc i32 %100 to i8
  %102 = sext i8 %101 to i32
  store i32 %102, ptr %29, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %30) #6
  %103 = load ptr, ptr %21, align 8, !tbaa !9
  %104 = load i32, ptr %19, align 4, !tbaa !5
  %105 = sext i32 %104 to i64
  %106 = getelementptr inbounds %struct.block_q5_0, ptr %103, i64 %105
  %107 = getelementptr inbounds %struct.block_q5_0, ptr %106, i32 0, i32 2
  %108 = load i32, ptr %26, align 4, !tbaa !5
  %109 = sext i32 %108 to i64
  %110 = getelementptr inbounds [16 x i8], ptr %107, i64 0, i64 %109
  %111 = load i8, ptr %110, align 1, !tbaa !15
  %112 = zext i8 %111 to i32
  %113 = ashr i32 %112, 4
  %114 = load i8, ptr %28, align 1, !tbaa !15
  %115 = zext i8 %114 to i32
  %116 = or i32 %113, %115
  %117 = sub nsw i32 %116, 16
  %118 = trunc i32 %117 to i8
  %119 = sext i8 %118 to i32
  store i32 %119, ptr %30, align 4, !tbaa !5
  %120 = load i32, ptr %29, align 4, !tbaa !5
  %121 = load ptr, ptr %22, align 8, !tbaa !9
  %122 = load i32, ptr %19, align 4, !tbaa !5
  %123 = sext i32 %122 to i64
  %124 = getelementptr inbounds %struct.block_q8_0, ptr %121, i64 %123
  %125 = getelementptr inbounds %struct.block_q8_0, ptr %124, i32 0, i32 1
  %126 = load i32, ptr %26, align 4, !tbaa !5
  %127 = sext i32 %126 to i64
  %128 = getelementptr inbounds [32 x i8], ptr %125, i64 0, i64 %127
  %129 = load i8, ptr %128, align 1, !tbaa !15
  %130 = sext i8 %129 to i32
  %131 = mul nsw i32 %120, %130
  %132 = load i32, ptr %24, align 4, !tbaa !5
  %133 = add nsw i32 %132, %131
  store i32 %133, ptr %24, align 4, !tbaa !5
  %134 = load i32, ptr %30, align 4, !tbaa !5
  %135 = load ptr, ptr %22, align 8, !tbaa !9
  %136 = load i32, ptr %19, align 4, !tbaa !5
  %137 = sext i32 %136 to i64
  %138 = getelementptr inbounds %struct.block_q8_0, ptr %135, i64 %137
  %139 = getelementptr inbounds %struct.block_q8_0, ptr %138, i32 0, i32 1
  %140 = load i32, ptr %26, align 4, !tbaa !5
  %141 = add nsw i32 %140, 16
  %142 = sext i32 %141 to i64
  %143 = getelementptr inbounds [32 x i8], ptr %139, i64 0, i64 %142
  %144 = load i8, ptr %143, align 1, !tbaa !15
  %145 = sext i8 %144 to i32
  %146 = mul nsw i32 %134, %145
  %147 = load i32, ptr %25, align 4, !tbaa !5
  %148 = add nsw i32 %147, %146
  store i32 %148, ptr %25, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %30) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %29) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %28) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %27) #6
  br label %149

149:                                              ; preds = %66
  %150 = load i32, ptr %26, align 4, !tbaa !5
  %151 = add nsw i32 %150, 1
  store i32 %151, ptr %26, align 4, !tbaa !5
  br label %62, !llvm.loop !16

152:                                              ; preds = %65
  call void @llvm.lifetime.start.p0(i64 4, ptr %31) #6
  %153 = load i32, ptr %24, align 4, !tbaa !5
  %154 = load i32, ptr %25, align 4, !tbaa !5
  %155 = add nsw i32 %153, %154
  store i32 %155, ptr %31, align 4, !tbaa !5
  %156 = load ptr, ptr %21, align 8, !tbaa !9
  %157 = load i32, ptr %19, align 4, !tbaa !5
  %158 = sext i32 %157 to i64
  %159 = getelementptr inbounds %struct.block_q5_0, ptr %156, i64 %158
  %160 = getelementptr inbounds %struct.block_q5_0, ptr %159, i32 0, i32 0
  %161 = load i16, ptr %160, align 2, !tbaa !18
  %162 = call float @ggml_lookup_fp16_to_fp32(i16 noundef zeroext %161)
  %163 = load ptr, ptr %22, align 8, !tbaa !9
  %164 = load i32, ptr %19, align 4, !tbaa !5
  %165 = sext i32 %164 to i64
  %166 = getelementptr inbounds %struct.block_q8_0, ptr %163, i64 %165
  %167 = getelementptr inbounds %struct.block_q8_0, ptr %166, i32 0, i32 0
  %168 = load i16, ptr %167, align 2, !tbaa !21
  %169 = call float @ggml_lookup_fp16_to_fp32(i16 noundef zeroext %168)
  %170 = fmul float %162, %169
  %171 = load i32, ptr %31, align 4, !tbaa !5
  %172 = sitofp i32 %171 to float
  %173 = load float, ptr %20, align 4, !tbaa !13
  %174 = call float @llvm.fmuladd.f32(float %170, float %172, float %173)
  store float %174, ptr %20, align 4, !tbaa !13
  call void @llvm.lifetime.end.p0(i64 4, ptr %31) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #6
  br label %175

175:                                              ; preds = %152
  %176 = load i32, ptr %19, align 4, !tbaa !5
  %177 = add nsw i32 %176, 1
  store i32 %177, ptr %19, align 4, !tbaa !5
  br label %51, !llvm.loop !23

178:                                              ; preds = %51
  %179 = load float, ptr %20, align 4, !tbaa !13
  %180 = load ptr, ptr %10, align 8, !tbaa !9
  store float %179, ptr %180, align 4, !tbaa !13
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #6
  ret void
}

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

attributes #0 = { 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 #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { inlinehint 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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { 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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #6 = { nounwind }
attributes #7 = { 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"float", !7, i64 0}
!15 = !{!7, !7, i64 0}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.mustprogress"}
!18 = !{!19, !20, i64 0}
!19 = !{!"", !20, i64 0, !7, i64 2, !7, i64 6}
!20 = !{!"short", !7, i64 0}
!21 = !{!22, !20, i64 0}
!22 = !{!"", !20, i64 0, !7, i64 2}
!23 = distinct !{!23, !17}


; 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.block_q5_0 = type { i16, [4 x i8], [16 x i8] }
%struct.block_q8_0 = type { i16, [32 x i8] }

@.str.1 = external hidden unnamed_addr constant [78 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [9 x i8], align 1
@__PRETTY_FUNCTION__.ggml_vec_dot_q5_0_q8_0 = external hidden unnamed_addr constant [123 x i8], align 1

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: inlinehint nounwind uwtable
declare hidden float @ggml_lookup_fp16_to_fp32(i16 noundef zeroext) local_unnamed_addr #1

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare float @llvm.fmuladd.f32(float, float, float) #2

; Function Attrs: nounwind uwtable
define dso_local void @ggml_vec_dot_q5_0_q8_0(i32 noundef %0, ptr noalias nocapture noundef writeonly %1, i64 noundef %2, ptr noalias nocapture noundef readonly %3, i64 noundef %4, ptr noalias nocapture noundef readonly %5, i64 noundef %6, i32 noundef %7) local_unnamed_addr #3 {
  %9 = sdiv i32 %0, 32
  %10 = and i32 %0, 31
  %11 = icmp eq i32 %10, 0
  br i1 %11, label %13, label %12

12:                                               ; preds = %8
  tail call void @__assert_fail(ptr noundef nonnull @.str.4, ptr noundef nonnull @.str.1, i32 noundef 2937, ptr noundef nonnull @__PRETTY_FUNCTION__.ggml_vec_dot_q5_0_q8_0) #5
  unreachable

13:                                               ; preds = %8
  %14 = icmp eq i32 %7, 1
  br i1 %14, label %.preheader, label %16

.preheader:                                       ; preds = %13
  %15 = icmp sgt i32 %0, 31
  br i1 %15, label %.lr.ph.preheader, label %._crit_edge

.lr.ph.preheader:                                 ; preds = %.preheader
  %wide.trip.count = zext nneg i32 %9 to i64
  br label %.lr.ph

16:                                               ; preds = %13
  tail call void @__assert_fail(ptr noundef nonnull @.str.5, ptr noundef nonnull @.str.1, i32 noundef 2939, ptr noundef nonnull @__PRETTY_FUNCTION__.ggml_vec_dot_q5_0_q8_0) #5
  unreachable

.lr.ph:                                           ; preds = %.lr.ph.preheader, %.lr.ph
  %indvars.iv61 = phi i64 [ 0, %.lr.ph.preheader ], [ %indvars.iv.next62, %.lr.ph ]
  %.04956 = phi float [ 0.000000e+00, %.lr.ph.preheader ], [ %117, %.lr.ph ]
  %17 = getelementptr inbounds %struct.block_q5_0, ptr %3, i64 %indvars.iv61
  %18 = getelementptr inbounds i8, ptr %17, i64 2
  %.0.copyload = load i32, ptr %18, align 2
  %broadcast.splatinsert = insertelement <4 x i32> poison, i32 %.0.copyload, i64 0
  %broadcast.splat = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
  %19 = getelementptr inbounds i8, ptr %17, i64 6
  %20 = lshr <4 x i32> %broadcast.splat, <i32 0, i32 1, i32 2, i32 3>
  %21 = lshr <4 x i32> %broadcast.splat, <i32 4, i32 5, i32 6, i32 7>
  %22 = shl <4 x i32> %20, <i32 4, i32 4, i32 4, i32 4>
  %23 = shl nuw <4 x i32> %21, <i32 4, i32 4, i32 4, i32 4>
  %24 = and <4 x i32> %22, <i32 16, i32 16, i32 16, i32 16>
  %25 = and <4 x i32> %23, <i32 16, i32 16, i32 16, i32 16>
  %26 = and <4 x i32> %broadcast.splat, <i32 65536, i32 131072, i32 262144, i32 524288>
  %27 = and <4 x i32> %broadcast.splat, <i32 1048576, i32 2097152, i32 4194304, i32 8388608>
  %28 = lshr exact <4 x i32> %26, <i32 12, i32 13, i32 14, i32 15>
  %29 = lshr exact <4 x i32> %27, <i32 16, i32 17, i32 18, i32 19>
  %30 = getelementptr inbounds i8, ptr %17, i64 10
  %wide.load = load <4 x i8>, ptr %19, align 1, !tbaa !5
  %wide.load77 = load <4 x i8>, ptr %30, align 1, !tbaa !5
  %31 = zext <4 x i8> %wide.load to <4 x i32>
  %32 = zext <4 x i8> %wide.load77 to <4 x i32>
  %33 = and <4 x i32> %31, <i32 15, i32 15, i32 15, i32 15>
  %34 = and <4 x i32> %32, <i32 15, i32 15, i32 15, i32 15>
  %35 = add nsw <4 x i32> %24, <i32 -16, i32 -16, i32 -16, i32 -16>
  %36 = add nsw <4 x i32> %25, <i32 -16, i32 -16, i32 -16, i32 -16>
  %37 = or disjoint <4 x i32> %35, %33
  %38 = or disjoint <4 x i32> %36, %34
  %39 = lshr <4 x i32> %31, <i32 4, i32 4, i32 4, i32 4>
  %40 = lshr <4 x i32> %32, <i32 4, i32 4, i32 4, i32 4>
  %41 = or <4 x i32> %39, %28
  %42 = or <4 x i32> %40, %29
  %43 = shl nuw <4 x i32> %41, <i32 24, i32 24, i32 24, i32 24>
  %44 = shl nuw <4 x i32> %42, <i32 24, i32 24, i32 24, i32 24>
  %45 = add <4 x i32> %43, <i32 -268435456, i32 -268435456, i32 -268435456, i32 -268435456>
  %46 = add <4 x i32> %44, <i32 -268435456, i32 -268435456, i32 -268435456, i32 -268435456>
  %47 = ashr exact <4 x i32> %45, <i32 24, i32 24, i32 24, i32 24>
  %48 = ashr exact <4 x i32> %46, <i32 24, i32 24, i32 24, i32 24>
  %49 = getelementptr inbounds %struct.block_q8_0, ptr %5, i64 %indvars.iv61, i32 1, i64 0
  %50 = getelementptr inbounds %struct.block_q8_0, ptr %5, i64 %indvars.iv61, i32 1, i64 4
  %wide.load78 = load <4 x i8>, ptr %49, align 1, !tbaa !5
  %wide.load79 = load <4 x i8>, ptr %50, align 1, !tbaa !5
  %51 = sext <4 x i8> %wide.load78 to <4 x i32>
  %52 = sext <4 x i8> %wide.load79 to <4 x i32>
  %53 = mul nsw <4 x i32> %37, %51
  %54 = mul nsw <4 x i32> %38, %52
  %55 = getelementptr inbounds %struct.block_q8_0, ptr %5, i64 %indvars.iv61, i32 1, i64 16
  %56 = getelementptr inbounds %struct.block_q8_0, ptr %5, i64 %indvars.iv61, i32 1, i64 20
  %wide.load80 = load <4 x i8>, ptr %55, align 1, !tbaa !5
  %wide.load81 = load <4 x i8>, ptr %56, align 1, !tbaa !5
  %57 = sext <4 x i8> %wide.load80 to <4 x i32>
  %58 = sext <4 x i8> %wide.load81 to <4 x i32>
  %59 = mul nsw <4 x i32> %47, %57
  %60 = mul nsw <4 x i32> %48, %58
  %61 = lshr <4 x i32> %broadcast.splat, <i32 8, i32 9, i32 10, i32 11>
  %62 = lshr <4 x i32> %broadcast.splat, <i32 12, i32 13, i32 14, i32 15>
  %63 = shl nuw nsw <4 x i32> %61, <i32 4, i32 4, i32 4, i32 4>
  %64 = shl nuw nsw <4 x i32> %62, <i32 4, i32 4, i32 4, i32 4>
  %65 = and <4 x i32> %63, <i32 16, i32 16, i32 16, i32 16>
  %66 = and <4 x i32> %64, <i32 16, i32 16, i32 16, i32 16>
  %67 = and <4 x i32> %broadcast.splat, <i32 16777216, i32 33554432, i32 67108864, i32 134217728>
  %68 = and <4 x i32> %broadcast.splat, <i32 268435456, i32 536870912, i32 1073741824, i32 -2147483648>
  %69 = lshr exact <4 x i32> %67, <i32 20, i32 21, i32 22, i32 23>
  %70 = lshr exact <4 x i32> %68, <i32 24, i32 25, i32 26, i32 27>
  %71 = getelementptr inbounds i8, ptr %17, i64 14
  %72 = getelementptr inbounds i8, ptr %17, i64 18
  %wide.load.1 = load <4 x i8>, ptr %71, align 1, !tbaa !5
  %wide.load77.1 = load <4 x i8>, ptr %72, align 1, !tbaa !5
  %73 = zext <4 x i8> %wide.load.1 to <4 x i32>
  %74 = zext <4 x i8> %wide.load77.1 to <4 x i32>
  %75 = and <4 x i32> %73, <i32 15, i32 15, i32 15, i32 15>
  %76 = and <4 x i32> %74, <i32 15, i32 15, i32 15, i32 15>
  %77 = add nsw <4 x i32> %65, <i32 -16, i32 -16, i32 -16, i32 -16>
  %78 = add nsw <4 x i32> %66, <i32 -16, i32 -16, i32 -16, i32 -16>
  %79 = or disjoint <4 x i32> %77, %75
  %80 = or disjoint <4 x i32> %78, %76
  %81 = lshr <4 x i32> %73, <i32 4, i32 4, i32 4, i32 4>
  %82 = lshr <4 x i32> %74, <i32 4, i32 4, i32 4, i32 4>
  %83 = or <4 x i32> %81, %69
  %84 = or <4 x i32> %82, %70
  %85 = shl nuw <4 x i32> %83, <i32 24, i32 24, i32 24, i32 24>
  %86 = shl nuw <4 x i32> %84, <i32 24, i32 24, i32 24, i32 24>
  %87 = add <4 x i32> %85, <i32 -268435456, i32 -268435456, i32 -268435456, i32 -268435456>
  %88 = add <4 x i32> %86, <i32 -268435456, i32 -268435456, i32 -268435456, i32 -268435456>
  %89 = ashr exact <4 x i32> %87, <i32 24, i32 24, i32 24, i32 24>
  %90 = ashr exact <4 x i32> %88, <i32 24, i32 24, i32 24, i32 24>
  %91 = getelementptr inbounds %struct.block_q8_0, ptr %5, i64 %indvars.iv61, i32 1, i64 8
  %92 = getelementptr inbounds %struct.block_q8_0, ptr %5, i64 %indvars.iv61, i32 1, i64 12
  %wide.load78.1 = load <4 x i8>, ptr %91, align 1, !tbaa !5
  %wide.load79.1 = load <4 x i8>, ptr %92, align 1, !tbaa !5
  %93 = sext <4 x i8> %wide.load78.1 to <4 x i32>
  %94 = sext <4 x i8> %wide.load79.1 to <4 x i32>
  %95 = mul nsw <4 x i32> %79, %93
  %96 = mul nsw <4 x i32> %80, %94
  %97 = add nsw <4 x i32> %95, %53
  %98 = add nsw <4 x i32> %96, %54
  %99 = getelementptr inbounds %struct.block_q8_0, ptr %5, i64 %indvars.iv61, i32 1, i64 24
  %100 = getelementptr inbounds %struct.block_q8_0, ptr %5, i64 %indvars.iv61, i32 1, i64 28
  %wide.load80.1 = load <4 x i8>, ptr %99, align 1, !tbaa !5
  %wide.load81.1 = load <4 x i8>, ptr %100, align 1, !tbaa !5
  %101 = sext <4 x i8> %wide.load80.1 to <4 x i32>
  %102 = sext <4 x i8> %wide.load81.1 to <4 x i32>
  %103 = mul nsw <4 x i32> %89, %101
  %104 = mul nsw <4 x i32> %90, %102
  %105 = add nsw <4 x i32> %103, %59
  %106 = add nsw <4 x i32> %104, %60
  %bin.rdx = add nsw <4 x i32> %98, %97
  %107 = tail call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
  %bin.rdx82 = add nsw <4 x i32> %106, %105
  %108 = tail call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx82)
  %109 = add nsw i32 %107, %108
  %110 = load i16, ptr %17, align 2, !tbaa !8
  %111 = tail call float @ggml_lookup_fp16_to_fp32(i16 noundef zeroext %110)
  %112 = getelementptr inbounds %struct.block_q8_0, ptr %5, i64 %indvars.iv61
  %113 = load i16, ptr %112, align 2, !tbaa !11
  %114 = tail call float @ggml_lookup_fp16_to_fp32(i16 noundef zeroext %113)
  %115 = fmul float %111, %114
  %116 = sitofp i32 %109 to float
  %117 = tail call float @llvm.fmuladd.f32(float %115, float %116, float %.04956)
  %indvars.iv.next62 = add nuw nsw i64 %indvars.iv61, 1
  %exitcond64.not = icmp eq i64 %indvars.iv.next62, %wide.trip.count
  br i1 %exitcond64.not, label %._crit_edge, label %.lr.ph, !llvm.loop !13

._crit_edge:                                      ; preds = %.lr.ph, %.preheader
  %.049.lcssa = phi float [ 0.000000e+00, %.preheader ], [ %117, %.lr.ph ]
  store float %.049.lcssa, ptr %1, align 4, !tbaa !15
  ret void
}

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

attributes #0 = { 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 #1 = { inlinehint 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 #2 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #3 = { 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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { 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 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = !{!9, !10, i64 0}
!9 = !{!"", !10, i64 0, !6, i64 2, !6, i64 6}
!10 = !{!"short", !6, i64 0}
!11 = !{!12, !10, i64 0}
!12 = !{!"", !10, i64 0, !6, i64 2}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = !{!16, !16, i64 0}
!16 = !{!"float", !6, i64 0}


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