; 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_iq2_xs = type { i16, [32 x i16], [8 x i8] }
%struct.block_q8_K = type { float, [256 x i8], [16 x i16] }

@.str.1 = external hidden unnamed_addr constant [78 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [14 x i8], align 1
@ksigns_iq2xs = external hidden constant [128 x i8], align 16
@kmask_iq2xs = external hidden constant [8 x i8], align 1
@__PRETTY_FUNCTION__.ggml_vec_dot_iq2_xs_q8_K = external hidden unnamed_addr constant [125 x i8], align 1
@iq2xs_grid = external hidden constant [512 x i64], align 16

; 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_iq2_xs_q8_K(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 ptr, align 8
  %18 = alloca ptr, align 8
  %19 = alloca i32, align 4
  %20 = alloca float, align 4
  %21 = alloca i32, align 4
  %22 = alloca i32, align 4
  %23 = alloca float, align 4
  %24 = alloca ptr, align 8
  %25 = alloca ptr, align 8
  %26 = alloca ptr, align 8
  %27 = alloca i32, align 4
  %28 = alloca i32, align 4
  %29 = alloca i16, align 2
  %30 = alloca i16, align 2
  %31 = alloca i32, align 4
  %32 = alloca i32, align 4
  %33 = alloca ptr, align 8
  %34 = alloca i8, align 1
  %35 = alloca i32, align 4
  %36 = alloca i32, align 4
  %37 = alloca ptr, align 8
  %38 = alloca i8, align 1
  %39 = 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
  %40 = load i32, ptr %9, align 4, !tbaa !5
  %41 = srem i32 %40, 256
  %42 = icmp eq i32 %41, 0
  br i1 %42, label %43, label %44

43:                                               ; preds = %8
  br label %45

44:                                               ; preds = %8
  call void @__assert_fail(ptr noundef @.str.6, ptr noundef @.str.1, i32 noundef 9867, ptr noundef @__PRETTY_FUNCTION__.ggml_vec_dot_iq2_xs_q8_K) #5
  unreachable

45:                                               ; preds = %43
  %46 = load i32, ptr %16, align 4, !tbaa !5
  %47 = icmp eq i32 %46, 1
  br i1 %47, label %48, label %49

48:                                               ; preds = %45
  br label %50

49:                                               ; preds = %45
  call void @__assert_fail(ptr noundef @.str.5, ptr noundef @.str.1, i32 noundef 9868, ptr noundef @__PRETTY_FUNCTION__.ggml_vec_dot_iq2_xs_q8_K) #5
  unreachable

50:                                               ; preds = %48
  %51 = load i32, ptr %16, align 4, !tbaa !5
  %52 = load i64, ptr %13, align 8, !tbaa !11
  %53 = load i64, ptr %15, align 8, !tbaa !11
  %54 = load i64, ptr %11, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #6
  %55 = load ptr, ptr %12, align 8, !tbaa !9
  store ptr %55, ptr %17, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #6
  %56 = load ptr, ptr %14, align 8, !tbaa !9
  store ptr %56, ptr %18, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #6
  %57 = load i32, ptr %9, align 4, !tbaa !5
  %58 = sdiv i32 %57, 256
  store i32 %58, 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
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #6
  store i32 0, ptr %21, align 4, !tbaa !5
  br label %59

59:                                               ; preds = %277, %50
  %60 = load i32, ptr %21, align 4, !tbaa !5
  %61 = load i32, ptr %19, align 4, !tbaa !5
  %62 = icmp slt i32 %60, %61
  br i1 %62, label %64, label %63

63:                                               ; preds = %59
  store i32 2, ptr %22, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #6
  br label %280

64:                                               ; preds = %59
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #6
  %65 = load ptr, ptr %17, align 8, !tbaa !9
  %66 = load i32, ptr %21, align 4, !tbaa !5
  %67 = sext i32 %66 to i64
  %68 = getelementptr inbounds %struct.block_iq2_xs, ptr %65, i64 %67
  %69 = getelementptr inbounds %struct.block_iq2_xs, ptr %68, i32 0, i32 0
  %70 = load i16, ptr %69, align 2, !tbaa !15
  %71 = call float @ggml_lookup_fp16_to_fp32(i16 noundef zeroext %70)
  %72 = load ptr, ptr %18, align 8, !tbaa !9
  %73 = load i32, ptr %21, align 4, !tbaa !5
  %74 = sext i32 %73 to i64
  %75 = getelementptr inbounds %struct.block_q8_K, ptr %72, i64 %74
  %76 = getelementptr inbounds %struct.block_q8_K, ptr %75, i32 0, i32 0
  %77 = load float, ptr %76, align 4, !tbaa !18
  %78 = fmul float %71, %77
  store float %78, ptr %23, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #6
  %79 = load ptr, ptr %17, align 8, !tbaa !9
  %80 = load i32, ptr %21, align 4, !tbaa !5
  %81 = sext i32 %80 to i64
  %82 = getelementptr inbounds %struct.block_iq2_xs, ptr %79, i64 %81
  %83 = getelementptr inbounds %struct.block_iq2_xs, ptr %82, i32 0, i32 1
  %84 = getelementptr inbounds [32 x i16], ptr %83, i64 0, i64 0
  store ptr %84, ptr %24, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #6
  %85 = load ptr, ptr %17, align 8, !tbaa !9
  %86 = load i32, ptr %21, align 4, !tbaa !5
  %87 = sext i32 %86 to i64
  %88 = getelementptr inbounds %struct.block_iq2_xs, ptr %85, i64 %87
  %89 = getelementptr inbounds %struct.block_iq2_xs, ptr %88, i32 0, i32 2
  %90 = getelementptr inbounds [8 x i8], ptr %89, i64 0, i64 0
  store ptr %90, ptr %25, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #6
  %91 = load ptr, ptr %18, align 8, !tbaa !9
  %92 = load i32, ptr %21, align 4, !tbaa !5
  %93 = sext i32 %92 to i64
  %94 = getelementptr inbounds %struct.block_q8_K, ptr %91, i64 %93
  %95 = getelementptr inbounds %struct.block_q8_K, ptr %94, i32 0, i32 1
  %96 = getelementptr inbounds [256 x i8], ptr %95, i64 0, i64 0
  store ptr %96, ptr %26, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #6
  store i32 0, ptr %27, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %28) #6
  store i32 0, ptr %28, align 4, !tbaa !5
  br label %97

97:                                               ; preds = %268, %64
  %98 = load i32, ptr %28, align 4, !tbaa !5
  %99 = icmp slt i32 %98, 8
  br i1 %99, label %101, label %100

100:                                              ; preds = %97
  store i32 5, ptr %22, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %28) #6
  br label %271

101:                                              ; preds = %97
  call void @llvm.lifetime.start.p0(i64 2, ptr %29) #6
  %102 = load ptr, ptr %25, align 8, !tbaa !9
  %103 = load i32, ptr %28, align 4, !tbaa !5
  %104 = sext i32 %103 to i64
  %105 = getelementptr inbounds i8, ptr %102, i64 %104
  %106 = load i8, ptr %105, align 1, !tbaa !20
  %107 = zext i8 %106 to i32
  %108 = and i32 %107, 15
  %109 = mul nsw i32 2, %108
  %110 = add nsw i32 %109, 1
  %111 = trunc i32 %110 to i16
  store i16 %111, ptr %29, align 2, !tbaa !21
  call void @llvm.lifetime.start.p0(i64 2, ptr %30) #6
  %112 = load ptr, ptr %25, align 8, !tbaa !9
  %113 = load i32, ptr %28, align 4, !tbaa !5
  %114 = sext i32 %113 to i64
  %115 = getelementptr inbounds i8, ptr %112, i64 %114
  %116 = load i8, ptr %115, align 1, !tbaa !20
  %117 = zext i8 %116 to i32
  %118 = ashr i32 %117, 4
  %119 = mul nsw i32 2, %118
  %120 = add nsw i32 %119, 1
  %121 = trunc i32 %120 to i16
  store i16 %121, ptr %30, align 2, !tbaa !21
  call void @llvm.lifetime.start.p0(i64 4, ptr %31) #6
  store i32 0, ptr %31, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %32) #6
  store i32 0, ptr %32, align 4, !tbaa !5
  br label %122

122:                                              ; preds = %184, %101
  %123 = load i32, ptr %32, align 4, !tbaa !5
  %124 = icmp slt i32 %123, 2
  br i1 %124, label %126, label %125

125:                                              ; preds = %122
  store i32 8, ptr %22, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %32) #6
  br label %187

126:                                              ; preds = %122
  call void @llvm.lifetime.start.p0(i64 8, ptr %33) #6
  %127 = load ptr, ptr %24, align 8, !tbaa !9
  %128 = load i32, ptr %32, align 4, !tbaa !5
  %129 = sext i32 %128 to i64
  %130 = getelementptr inbounds i16, ptr %127, i64 %129
  %131 = load i16, ptr %130, align 2, !tbaa !21
  %132 = zext i16 %131 to i32
  %133 = and i32 %132, 511
  %134 = sext i32 %133 to i64
  %135 = getelementptr inbounds i64, ptr @iq2xs_grid, i64 %134
  store ptr %135, ptr %33, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 1, ptr %34) #6
  %136 = load ptr, ptr %24, align 8, !tbaa !9
  %137 = load i32, ptr %32, align 4, !tbaa !5
  %138 = sext i32 %137 to i64
  %139 = getelementptr inbounds i16, ptr %136, i64 %138
  %140 = load i16, ptr %139, align 2, !tbaa !21
  %141 = zext i16 %140 to i32
  %142 = ashr i32 %141, 9
  %143 = sext i32 %142 to i64
  %144 = getelementptr inbounds [128 x i8], ptr @ksigns_iq2xs, i64 0, i64 %143
  %145 = load i8, ptr %144, align 1, !tbaa !20
  store i8 %145, ptr %34, align 1, !tbaa !20
  call void @llvm.lifetime.start.p0(i64 4, ptr %35) #6
  store i32 0, ptr %35, align 4, !tbaa !5
  br label %146

146:                                              ; preds = %178, %126
  %147 = load i32, ptr %35, align 4, !tbaa !5
  %148 = icmp slt i32 %147, 8
  br i1 %148, label %150, label %149

149:                                              ; preds = %146
  store i32 11, ptr %22, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %35) #6
  br label %181

150:                                              ; preds = %146
  %151 = load ptr, ptr %33, align 8, !tbaa !9
  %152 = load i32, ptr %35, align 4, !tbaa !5
  %153 = sext i32 %152 to i64
  %154 = getelementptr inbounds i8, ptr %151, i64 %153
  %155 = load i8, ptr %154, align 1, !tbaa !20
  %156 = zext i8 %155 to i32
  %157 = load ptr, ptr %26, align 8, !tbaa !9
  %158 = load i32, ptr %35, align 4, !tbaa !5
  %159 = sext i32 %158 to i64
  %160 = getelementptr inbounds i8, ptr %157, i64 %159
  %161 = load i8, ptr %160, align 1, !tbaa !20
  %162 = sext i8 %161 to i32
  %163 = mul nsw i32 %156, %162
  %164 = load i8, ptr %34, align 1, !tbaa !20
  %165 = zext i8 %164 to i32
  %166 = load i32, ptr %35, align 4, !tbaa !5
  %167 = sext i32 %166 to i64
  %168 = getelementptr inbounds [8 x i8], ptr @kmask_iq2xs, i64 0, i64 %167
  %169 = load i8, ptr %168, align 1, !tbaa !20
  %170 = zext i8 %169 to i32
  %171 = and i32 %165, %170
  %172 = icmp ne i32 %171, 0
  %173 = zext i1 %172 to i64
  %174 = select i1 %172, i32 -1, i32 1
  %175 = mul nsw i32 %163, %174
  %176 = load i32, ptr %31, align 4, !tbaa !5
  %177 = add nsw i32 %176, %175
  store i32 %177, ptr %31, align 4, !tbaa !5
  br label %178

178:                                              ; preds = %150
  %179 = load i32, ptr %35, align 4, !tbaa !5
  %180 = add nsw i32 %179, 1
  store i32 %180, ptr %35, align 4, !tbaa !5
  br label %146, !llvm.loop !22

181:                                              ; preds = %149
  %182 = load ptr, ptr %26, align 8, !tbaa !9
  %183 = getelementptr inbounds i8, ptr %182, i64 8
  store ptr %183, ptr %26, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 1, ptr %34) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %33) #6
  br label %184

184:                                              ; preds = %181
  %185 = load i32, ptr %32, align 4, !tbaa !5
  %186 = add nsw i32 %185, 1
  store i32 %186, ptr %32, align 4, !tbaa !5
  br label %122, !llvm.loop !24

187:                                              ; preds = %125
  %188 = load i32, ptr %31, align 4, !tbaa !5
  %189 = load i16, ptr %29, align 2, !tbaa !21
  %190 = zext i16 %189 to i32
  %191 = mul nsw i32 %188, %190
  %192 = load i32, ptr %27, align 4, !tbaa !5
  %193 = add nsw i32 %192, %191
  store i32 %193, ptr %27, align 4, !tbaa !5
  store i32 0, ptr %31, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %36) #6
  store i32 2, ptr %36, align 4, !tbaa !5
  br label %194

194:                                              ; preds = %256, %187
  %195 = load i32, ptr %36, align 4, !tbaa !5
  %196 = icmp slt i32 %195, 4
  br i1 %196, label %198, label %197

197:                                              ; preds = %194
  store i32 14, ptr %22, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %36) #6
  br label %259

198:                                              ; preds = %194
  call void @llvm.lifetime.start.p0(i64 8, ptr %37) #6
  %199 = load ptr, ptr %24, align 8, !tbaa !9
  %200 = load i32, ptr %36, align 4, !tbaa !5
  %201 = sext i32 %200 to i64
  %202 = getelementptr inbounds i16, ptr %199, i64 %201
  %203 = load i16, ptr %202, align 2, !tbaa !21
  %204 = zext i16 %203 to i32
  %205 = and i32 %204, 511
  %206 = sext i32 %205 to i64
  %207 = getelementptr inbounds i64, ptr @iq2xs_grid, i64 %206
  store ptr %207, ptr %37, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 1, ptr %38) #6
  %208 = load ptr, ptr %24, align 8, !tbaa !9
  %209 = load i32, ptr %36, align 4, !tbaa !5
  %210 = sext i32 %209 to i64
  %211 = getelementptr inbounds i16, ptr %208, i64 %210
  %212 = load i16, ptr %211, align 2, !tbaa !21
  %213 = zext i16 %212 to i32
  %214 = ashr i32 %213, 9
  %215 = sext i32 %214 to i64
  %216 = getelementptr inbounds [128 x i8], ptr @ksigns_iq2xs, i64 0, i64 %215
  %217 = load i8, ptr %216, align 1, !tbaa !20
  store i8 %217, ptr %38, align 1, !tbaa !20
  call void @llvm.lifetime.start.p0(i64 4, ptr %39) #6
  store i32 0, ptr %39, align 4, !tbaa !5
  br label %218

218:                                              ; preds = %250, %198
  %219 = load i32, ptr %39, align 4, !tbaa !5
  %220 = icmp slt i32 %219, 8
  br i1 %220, label %222, label %221

221:                                              ; preds = %218
  store i32 17, ptr %22, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %39) #6
  br label %253

222:                                              ; preds = %218
  %223 = load ptr, ptr %37, align 8, !tbaa !9
  %224 = load i32, ptr %39, align 4, !tbaa !5
  %225 = sext i32 %224 to i64
  %226 = getelementptr inbounds i8, ptr %223, i64 %225
  %227 = load i8, ptr %226, align 1, !tbaa !20
  %228 = zext i8 %227 to i32
  %229 = load ptr, ptr %26, align 8, !tbaa !9
  %230 = load i32, ptr %39, align 4, !tbaa !5
  %231 = sext i32 %230 to i64
  %232 = getelementptr inbounds i8, ptr %229, i64 %231
  %233 = load i8, ptr %232, align 1, !tbaa !20
  %234 = sext i8 %233 to i32
  %235 = mul nsw i32 %228, %234
  %236 = load i8, ptr %38, align 1, !tbaa !20
  %237 = zext i8 %236 to i32
  %238 = load i32, ptr %39, align 4, !tbaa !5
  %239 = sext i32 %238 to i64
  %240 = getelementptr inbounds [8 x i8], ptr @kmask_iq2xs, i64 0, i64 %239
  %241 = load i8, ptr %240, align 1, !tbaa !20
  %242 = zext i8 %241 to i32
  %243 = and i32 %237, %242
  %244 = icmp ne i32 %243, 0
  %245 = zext i1 %244 to i64
  %246 = select i1 %244, i32 -1, i32 1
  %247 = mul nsw i32 %235, %246
  %248 = load i32, ptr %31, align 4, !tbaa !5
  %249 = add nsw i32 %248, %247
  store i32 %249, ptr %31, align 4, !tbaa !5
  br label %250

250:                                              ; preds = %222
  %251 = load i32, ptr %39, align 4, !tbaa !5
  %252 = add nsw i32 %251, 1
  store i32 %252, ptr %39, align 4, !tbaa !5
  br label %218, !llvm.loop !25

253:                                              ; preds = %221
  %254 = load ptr, ptr %26, align 8, !tbaa !9
  %255 = getelementptr inbounds i8, ptr %254, i64 8
  store ptr %255, ptr %26, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 1, ptr %38) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %37) #6
  br label %256

256:                                              ; preds = %253
  %257 = load i32, ptr %36, align 4, !tbaa !5
  %258 = add nsw i32 %257, 1
  store i32 %258, ptr %36, align 4, !tbaa !5
  br label %194, !llvm.loop !26

259:                                              ; preds = %197
  %260 = load i32, ptr %31, align 4, !tbaa !5
  %261 = load i16, ptr %30, align 2, !tbaa !21
  %262 = zext i16 %261 to i32
  %263 = mul nsw i32 %260, %262
  %264 = load i32, ptr %27, align 4, !tbaa !5
  %265 = add nsw i32 %264, %263
  store i32 %265, ptr %27, align 4, !tbaa !5
  %266 = load ptr, ptr %24, align 8, !tbaa !9
  %267 = getelementptr inbounds i16, ptr %266, i64 4
  store ptr %267, ptr %24, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %31) #6
  call void @llvm.lifetime.end.p0(i64 2, ptr %30) #6
  call void @llvm.lifetime.end.p0(i64 2, ptr %29) #6
  br label %268

268:                                              ; preds = %259
  %269 = load i32, ptr %28, align 4, !tbaa !5
  %270 = add nsw i32 %269, 1
  store i32 %270, ptr %28, align 4, !tbaa !5
  br label %97, !llvm.loop !27

271:                                              ; preds = %100
  %272 = load float, ptr %23, align 4, !tbaa !13
  %273 = load i32, ptr %27, align 4, !tbaa !5
  %274 = sitofp i32 %273 to float
  %275 = load float, ptr %20, align 4, !tbaa !13
  %276 = call float @llvm.fmuladd.f32(float %272, float %274, float %275)
  store float %276, ptr %20, align 4, !tbaa !13
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #6
  br label %277

277:                                              ; preds = %271
  %278 = load i32, ptr %21, align 4, !tbaa !5
  %279 = add nsw i32 %278, 1
  store i32 %279, ptr %21, align 4, !tbaa !5
  br label %59, !llvm.loop !28

280:                                              ; preds = %63
  %281 = load float, ptr %20, align 4, !tbaa !13
  %282 = fmul float 1.250000e-01, %281
  %283 = load ptr, ptr %10, align 8, !tbaa !9
  store float %282, ptr %283, align 4, !tbaa !13
  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 8, ptr %18) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #6
  ret void
}

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 = { noreturn nounwind }
attributes #6 = { 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 = !{!16, !17, i64 0}
!16 = !{!"", !17, i64 0, !7, i64 2, !7, i64 66}
!17 = !{!"short", !7, i64 0}
!18 = !{!19, !14, i64 0}
!19 = !{!"", !14, i64 0, !7, i64 4, !7, i64 260}
!20 = !{!7, !7, i64 0}
!21 = !{!17, !17, i64 0}
!22 = distinct !{!22, !23}
!23 = !{!"llvm.loop.mustprogress"}
!24 = distinct !{!24, !23}
!25 = distinct !{!25, !23}
!26 = distinct !{!26, !23}
!27 = distinct !{!27, !23}
!28 = distinct !{!28, !23}


; 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_iq2_xs = type { i16, [32 x i16], [8 x i8] }
%struct.block_q8_K = type { float, [256 x i8], [16 x i16] }

@.str.1 = external hidden unnamed_addr constant [78 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [14 x i8], align 1
@ksigns_iq2xs = external hidden local_unnamed_addr constant [128 x i8], align 16
@kmask_iq2xs = external hidden local_unnamed_addr constant [8 x i8], align 1
@__PRETTY_FUNCTION__.ggml_vec_dot_iq2_xs_q8_K = external hidden unnamed_addr constant [125 x i8], align 1
@iq2xs_grid = external hidden local_unnamed_addr constant [512 x i64], align 16

; 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_iq2_xs_q8_K(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 = and i32 %0, 255
  %10 = icmp eq i32 %9, 0
  br i1 %10, label %12, label %11

11:                                               ; preds = %8
  tail call void @__assert_fail(ptr noundef nonnull @.str.6, ptr noundef nonnull @.str.1, i32 noundef 9867, ptr noundef nonnull @__PRETTY_FUNCTION__.ggml_vec_dot_iq2_xs_q8_K) #5
  unreachable

12:                                               ; preds = %8
  %13 = icmp eq i32 %7, 1
  br i1 %13, label %15, label %14

14:                                               ; preds = %12
  tail call void @__assert_fail(ptr noundef nonnull @.str.5, ptr noundef nonnull @.str.1, i32 noundef 9868, ptr noundef nonnull @__PRETTY_FUNCTION__.ggml_vec_dot_iq2_xs_q8_K) #5
  unreachable

15:                                               ; preds = %12
  %16 = ashr exact i32 %0, 8
  %17 = icmp sgt i32 %16, 0
  br i1 %17, label %.lr.ph.preheader, label %._crit_edge

.lr.ph.preheader:                                 ; preds = %15
  %wide.trip.count = zext nneg i32 %16 to i64
  %18 = load <4 x i8>, ptr getelementptr inbounds (i8, ptr @kmask_iq2xs, i64 1), align 1, !tbaa !5
  %.pre120.pre = load i8, ptr getelementptr inbounds (i8, ptr @kmask_iq2xs, i64 5), align 1, !tbaa !5
  %19 = load <2 x i8>, ptr getelementptr inbounds (i8, ptr @kmask_iq2xs, i64 6), align 1
  %20 = load <8 x i8>, ptr @kmask_iq2xs, align 1
  %21 = extractelement <8 x i8> %20, i64 5
  %22 = shufflevector <8 x i8> %20, <8 x i8> poison, <4 x i32> <i32 1, i32 2, i32 3, i32 4>
  %23 = shufflevector <2 x i8> %19, <2 x i8> poison, <8 x i32> <i32 0, i32 1, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison>
  %24 = shufflevector <8 x i8> %20, <8 x i8> %23, <8 x i32> <i32 0, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 8, i32 9>
  %25 = shufflevector <8 x i8> %20, <8 x i8> poison, <16 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7>
  br label %.lr.ph

._crit_edge.loopexit:                             ; preds = %36
  %26 = fmul float %39, 1.250000e-01
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %15
  %.071.lcssa = phi float [ 0.000000e+00, %15 ], [ %26, %._crit_edge.loopexit ]
  store float %.071.lcssa, ptr %1, align 4, !tbaa !8
  ret void

.lr.ph:                                           ; preds = %.lr.ph.preheader, %36
  %.pre120 = phi i8 [ %.pre120.pre, %.lr.ph.preheader ], [ %21, %36 ]
  %indvars.iv113 = phi i64 [ 0, %.lr.ph.preheader ], [ %indvars.iv.next114, %36 ]
  %.07199 = phi float [ 0.000000e+00, %.lr.ph.preheader ], [ %39, %36 ]
  %27 = phi <4 x i8> [ %18, %.lr.ph.preheader ], [ %22, %36 ]
  %28 = getelementptr inbounds %struct.block_iq2_xs, ptr %3, i64 %indvars.iv113
  %29 = load i16, ptr %28, align 2, !tbaa !10
  %30 = tail call float @ggml_lookup_fp16_to_fp32(i16 noundef zeroext %29)
  %31 = getelementptr inbounds %struct.block_q8_K, ptr %5, i64 %indvars.iv113
  %32 = load float, ptr %31, align 4, !tbaa !13
  %33 = getelementptr inbounds i8, ptr %28, i64 2
  %34 = getelementptr inbounds i8, ptr %28, i64 66
  %35 = getelementptr inbounds i8, ptr %31, i64 4
  br label %40

36:                                               ; preds = %40
  %37 = fmul float %30, %32
  %38 = sitofp i32 %136 to float
  %39 = tail call float @llvm.fmuladd.f32(float %37, float %38, float %.07199)
  %indvars.iv.next114 = add nuw nsw i64 %indvars.iv113, 1
  %exitcond116.not = icmp eq i64 %indvars.iv.next114, %wide.trip.count
  br i1 %exitcond116.not, label %._crit_edge.loopexit, label %.lr.ph, !llvm.loop !15

40:                                               ; preds = %.lr.ph, %40
  %41 = phi i8 [ %.pre120, %.lr.ph ], [ %21, %40 ]
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %40 ]
  %.07597 = phi ptr [ %33, %.lr.ph ], [ %137, %40 ]
  %.07896 = phi ptr [ %35, %.lr.ph ], [ %scevgep109, %40 ]
  %.08195 = phi i32 [ 0, %.lr.ph ], [ %136, %40 ]
  %42 = phi <4 x i8> [ %27, %.lr.ph ], [ %22, %40 ]
  %43 = getelementptr inbounds i8, ptr %34, i64 %indvars.iv
  %44 = load i8, ptr %43, align 1, !tbaa !5
  %.tr = zext i8 %44 to i32
  %45 = shl nuw nsw i32 %.tr, 1
  %46 = and i32 %45, 30
  %47 = lshr i8 %44, 3
  %48 = or i8 %47, 1
  %49 = load i16, ptr %.07597, align 2, !tbaa !17
  %50 = zext i16 %49 to i32
  %51 = and i32 %50, 511
  %52 = zext nneg i32 %51 to i64
  %53 = getelementptr inbounds i64, ptr @iq2xs_grid, i64 %52
  %54 = lshr i32 %50, 9
  %55 = zext nneg i32 %54 to i64
  %56 = getelementptr inbounds [128 x i8], ptr @ksigns_iq2xs, i64 0, i64 %55
  %57 = load i8, ptr %56, align 1, !tbaa !5
  %58 = load <8 x i8>, ptr %53, align 8, !tbaa !5
  %59 = zext <8 x i8> %58 to <8 x i32>
  %60 = load <8 x i8>, ptr %.07896, align 1, !tbaa !5
  %61 = sext <8 x i8> %60 to <8 x i32>
  %62 = mul nsw <8 x i32> %61, %59
  %63 = shufflevector <4 x i8> %42, <4 x i8> poison, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 poison, i32 poison, i32 poison, i32 poison>
  %64 = shufflevector <8 x i8> %24, <8 x i8> %63, <8 x i32> <i32 0, i32 8, i32 9, i32 10, i32 11, i32 poison, i32 6, i32 7>
  %65 = insertelement <8 x i8> %64, i8 %41, i64 5
  %66 = insertelement <8 x i8> poison, i8 %57, i64 0
  %67 = shufflevector <8 x i8> %66, <8 x i8> poison, <8 x i32> zeroinitializer
  %68 = and <8 x i8> %65, %67
  %69 = icmp eq <8 x i8> %68, zeroinitializer
  %70 = sub nsw <8 x i32> zeroinitializer, %62
  %71 = select <8 x i1> %69, <8 x i32> %62, <8 x i32> %70
  %72 = getelementptr inbounds i8, ptr %.07896, i64 8
  %73 = getelementptr inbounds i8, ptr %.07597, i64 2
  %74 = load i16, ptr %73, align 2, !tbaa !17
  %75 = zext i16 %74 to i32
  %76 = and i32 %75, 511
  %77 = zext nneg i32 %76 to i64
  %78 = getelementptr inbounds i64, ptr @iq2xs_grid, i64 %77
  %79 = lshr i32 %75, 9
  %80 = zext nneg i32 %79 to i64
  %81 = getelementptr inbounds [128 x i8], ptr @ksigns_iq2xs, i64 0, i64 %80
  %82 = load i8, ptr %81, align 1, !tbaa !5
  %83 = load <8 x i8>, ptr %78, align 8, !tbaa !5
  %84 = zext <8 x i8> %83 to <8 x i32>
  %85 = load <8 x i8>, ptr %72, align 1, !tbaa !5
  %86 = sext <8 x i8> %85 to <8 x i32>
  %87 = mul nsw <8 x i32> %86, %84
  %88 = insertelement <8 x i8> poison, i8 %82, i64 0
  %89 = shufflevector <8 x i8> %88, <8 x i8> poison, <8 x i32> zeroinitializer
  %90 = and <8 x i8> %20, %89
  %91 = icmp eq <8 x i8> %90, zeroinitializer
  %92 = sub nsw <8 x i32> zeroinitializer, %87
  %93 = select <8 x i1> %91, <8 x i32> %87, <8 x i32> %92
  %94 = tail call i32 @llvm.vector.reduce.add.v8i32(<8 x i32> %71)
  %95 = tail call i32 @llvm.vector.reduce.add.v8i32(<8 x i32> %93)
  %op.rdx = add i32 %94, %95
  %96 = or disjoint i32 %46, 1
  %scevgep = getelementptr i8, ptr %.07896, i64 16
  %97 = mul nsw i32 %op.rdx, %96
  %98 = add nsw i32 %97, %.08195
  %99 = getelementptr inbounds i8, ptr %.07597, i64 4
  %100 = load i16, ptr %99, align 2, !tbaa !17
  %101 = zext i16 %100 to i32
  %102 = and i32 %101, 511
  %103 = zext nneg i32 %102 to i64
  %104 = getelementptr inbounds i64, ptr @iq2xs_grid, i64 %103
  %105 = lshr i32 %101, 9
  %106 = zext nneg i32 %105 to i64
  %107 = getelementptr inbounds [128 x i8], ptr @ksigns_iq2xs, i64 0, i64 %106
  %108 = load i8, ptr %107, align 1, !tbaa !5
  %109 = load <8 x i8>, ptr %104, align 8, !tbaa !5
  %110 = getelementptr inbounds i8, ptr %.07597, i64 6
  %111 = load i16, ptr %110, align 2, !tbaa !17
  %112 = zext i16 %111 to i32
  %113 = and i32 %112, 511
  %114 = zext nneg i32 %113 to i64
  %115 = getelementptr inbounds i64, ptr @iq2xs_grid, i64 %114
  %116 = lshr i32 %112, 9
  %117 = zext nneg i32 %116 to i64
  %118 = getelementptr inbounds [128 x i8], ptr @ksigns_iq2xs, i64 0, i64 %117
  %119 = load i8, ptr %118, align 1, !tbaa !5
  %120 = load <8 x i8>, ptr %115, align 8, !tbaa !5
  %121 = shufflevector <8 x i8> %109, <8 x i8> %120, <16 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 10, i32 11, i32 12, i32 13, i32 14, i32 15>
  %122 = zext <16 x i8> %121 to <16 x i32>
  %123 = load <16 x i8>, ptr %scevgep, align 1, !tbaa !5
  %124 = sext <16 x i8> %123 to <16 x i32>
  %125 = mul nsw <16 x i32> %124, %122
  %126 = insertelement <16 x i8> poison, i8 %108, i64 0
  %127 = insertelement <16 x i8> %126, i8 %119, i64 1
  %128 = shufflevector <16 x i8> %127, <16 x i8> poison, <16 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1>
  %129 = and <16 x i8> %25, %128
  %130 = icmp eq <16 x i8> %129, zeroinitializer
  %131 = sub nsw <16 x i32> zeroinitializer, %125
  %132 = select <16 x i1> %130, <16 x i32> %125, <16 x i32> %131
  %133 = tail call i32 @llvm.vector.reduce.add.v16i32(<16 x i32> %132)
  %scevgep109 = getelementptr i8, ptr %.07896, i64 32
  %134 = zext nneg i8 %48 to i32
  %135 = mul nsw i32 %133, %134
  %136 = add nsw i32 %98, %135
  %137 = getelementptr inbounds i8, ptr %.07597, i64 8
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, 8
  br i1 %exitcond.not, label %36, label %40, !llvm.loop !18
}

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.add.v8i32(<8 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, !9, i64 0}
!9 = !{!"float", !6, i64 0}
!10 = !{!11, !12, i64 0}
!11 = !{!"", !12, i64 0, !6, i64 2, !6, i64 66}
!12 = !{!"short", !6, i64 0}
!13 = !{!14, !9, i64 0}
!14 = !{!"", !9, i64 0, !6, i64 4, !6, i64 260}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}
!17 = !{!12, !12, i64 0}
!18 = distinct !{!18, !16}


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