; LLVM IR from ggml-org/ggml :: src (ggml-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_q4_1 = type { %union.anon, [16 x i8] }
%union.anon = type { i32 }
%struct.anon = type { i16, i16 }

@.str = external hidden unnamed_addr constant [12 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [65 x i8], align 1
@__PRETTY_FUNCTION__.quantize_row_q4_1_ref = external hidden unnamed_addr constant [81 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 zeroext i16 @ggml_compute_fp32_to_fp16(float noundef) #2

; Function Attrs: nounwind uwtable
define dso_local void @quantize_row_q4_1_ref(ptr noalias noundef %0, ptr noalias noundef %1, i64 noundef %2) #3 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i64, align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca float, align 4
  %12 = alloca float, align 4
  %13 = alloca i32, align 4
  %14 = alloca float, align 4
  %15 = alloca float, align 4
  %16 = alloca float, align 4
  %17 = alloca i32, align 4
  %18 = alloca float, align 4
  %19 = alloca float, align 4
  %20 = alloca i8, align 1
  %21 = alloca i8, align 1
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  store i64 %2, ptr %6, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  store i32 32, ptr %7, align 4, !tbaa !11
  %22 = load i64, ptr %6, align 8, !tbaa !9
  %23 = srem i64 %22, 32
  %24 = icmp eq i64 %23, 0
  br i1 %24, label %25, label %26

25:                                               ; preds = %3
  br label %27

26:                                               ; preds = %3
  call void @__assert_fail(ptr noundef @.str, ptr noundef @.str.1, i32 noundef 71, ptr noundef @__PRETTY_FUNCTION__.quantize_row_q4_1_ref) #5
  unreachable

27:                                               ; preds = %25
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #4
  %28 = load i64, ptr %6, align 8, !tbaa !9
  %29 = sdiv i64 %28, 32
  %30 = trunc i64 %29 to i32
  store i32 %30, ptr %8, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #4
  store i32 0, ptr %9, align 4, !tbaa !11
  br label %31

31:                                               ; preds = %181, %27
  %32 = load i32, ptr %9, align 4, !tbaa !11
  %33 = load i32, ptr %8, align 4, !tbaa !11
  %34 = icmp slt i32 %32, %33
  br i1 %34, label %36, label %35

35:                                               ; preds = %31
  store i32 2, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #4
  br label %184

36:                                               ; preds = %31
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #4
  store float 0x47EFFFFFE0000000, ptr %11, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #4
  store float 0xC7EFFFFFE0000000, ptr %12, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #4
  store i32 0, ptr %13, align 4, !tbaa !11
  br label %37

37:                                               ; preds = %62, %36
  %38 = load i32, ptr %13, align 4, !tbaa !11
  %39 = icmp slt i32 %38, 32
  br i1 %39, label %41, label %40

40:                                               ; preds = %37
  store i32 5, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #4
  br label %65

41:                                               ; preds = %37
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #4
  %42 = load ptr, ptr %4, align 8, !tbaa !5
  %43 = load i32, ptr %9, align 4, !tbaa !11
  %44 = mul nsw i32 %43, 32
  %45 = load i32, ptr %13, align 4, !tbaa !11
  %46 = add nsw i32 %44, %45
  %47 = sext i32 %46 to i64
  %48 = getelementptr inbounds float, ptr %42, i64 %47
  %49 = load float, ptr %48, align 4, !tbaa !13
  store float %49, ptr %14, align 4, !tbaa !13
  %50 = load float, ptr %14, align 4, !tbaa !13
  %51 = load float, ptr %11, align 4, !tbaa !13
  %52 = fcmp olt float %50, %51
  br i1 %52, label %53, label %55

53:                                               ; preds = %41
  %54 = load float, ptr %14, align 4, !tbaa !13
  store float %54, ptr %11, align 4, !tbaa !13
  br label %55

55:                                               ; preds = %53, %41
  %56 = load float, ptr %14, align 4, !tbaa !13
  %57 = load float, ptr %12, align 4, !tbaa !13
  %58 = fcmp ogt float %56, %57
  br i1 %58, label %59, label %61

59:                                               ; preds = %55
  %60 = load float, ptr %14, align 4, !tbaa !13
  store float %60, ptr %12, align 4, !tbaa !13
  br label %61

61:                                               ; preds = %59, %55
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #4
  br label %62

62:                                               ; preds = %61
  %63 = load i32, ptr %13, align 4, !tbaa !11
  %64 = add nsw i32 %63, 1
  store i32 %64, ptr %13, align 4, !tbaa !11
  br label %37, !llvm.loop !15

65:                                               ; preds = %40
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #4
  %66 = load float, ptr %12, align 4, !tbaa !13
  %67 = load float, ptr %11, align 4, !tbaa !13
  %68 = fsub float %66, %67
  %69 = fdiv float %68, 1.500000e+01
  store float %69, ptr %15, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #4
  %70 = load float, ptr %15, align 4, !tbaa !13
  %71 = fcmp une float %70, 0.000000e+00
  br i1 %71, label %72, label %75

72:                                               ; preds = %65
  %73 = load float, ptr %15, align 4, !tbaa !13
  %74 = fdiv float 1.000000e+00, %73
  br label %76

75:                                               ; preds = %65
  br label %76

76:                                               ; preds = %75, %72
  %77 = phi float [ %74, %72 ], [ 0.000000e+00, %75 ]
  store float %77, ptr %16, align 4, !tbaa !13
  %78 = load float, ptr %15, align 4, !tbaa !13
  %79 = call zeroext i16 @ggml_compute_fp32_to_fp16(float noundef %78)
  %80 = load ptr, ptr %5, align 8, !tbaa !5
  %81 = load i32, ptr %9, align 4, !tbaa !11
  %82 = sext i32 %81 to i64
  %83 = getelementptr inbounds %struct.block_q4_1, ptr %80, i64 %82
  %84 = getelementptr inbounds %struct.block_q4_1, ptr %83, i32 0, i32 0
  %85 = getelementptr inbounds %struct.anon, ptr %84, i32 0, i32 0
  store i16 %79, ptr %85, align 4, !tbaa !17
  %86 = load float, ptr %11, align 4, !tbaa !13
  %87 = call zeroext i16 @ggml_compute_fp32_to_fp16(float noundef %86)
  %88 = load ptr, ptr %5, align 8, !tbaa !5
  %89 = load i32, ptr %9, align 4, !tbaa !11
  %90 = sext i32 %89 to i64
  %91 = getelementptr inbounds %struct.block_q4_1, ptr %88, i64 %90
  %92 = getelementptr inbounds %struct.block_q4_1, ptr %91, i32 0, i32 0
  %93 = getelementptr inbounds %struct.anon, ptr %92, i32 0, i32 1
  store i16 %87, ptr %93, align 2, !tbaa !17
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #4
  store i32 0, ptr %17, align 4, !tbaa !11
  br label %94

94:                                               ; preds = %177, %76
  %95 = load i32, ptr %17, align 4, !tbaa !11
  %96 = icmp slt i32 %95, 16
  br i1 %96, label %98, label %97

97:                                               ; preds = %94
  store i32 8, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #4
  br label %180

98:                                               ; preds = %94
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #4
  %99 = load ptr, ptr %4, align 8, !tbaa !5
  %100 = load i32, ptr %9, align 4, !tbaa !11
  %101 = mul nsw i32 %100, 32
  %102 = add nsw i32 %101, 0
  %103 = load i32, ptr %17, align 4, !tbaa !11
  %104 = add nsw i32 %102, %103
  %105 = sext i32 %104 to i64
  %106 = getelementptr inbounds float, ptr %99, i64 %105
  %107 = load float, ptr %106, align 4, !tbaa !13
  %108 = load float, ptr %11, align 4, !tbaa !13
  %109 = fsub float %107, %108
  %110 = load float, ptr %16, align 4, !tbaa !13
  %111 = fmul float %109, %110
  store float %111, ptr %18, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #4
  %112 = load ptr, ptr %4, align 8, !tbaa !5
  %113 = load i32, ptr %9, align 4, !tbaa !11
  %114 = mul nsw i32 %113, 32
  %115 = add nsw i32 %114, 16
  %116 = load i32, ptr %17, align 4, !tbaa !11
  %117 = add nsw i32 %115, %116
  %118 = sext i32 %117 to i64
  %119 = getelementptr inbounds float, ptr %112, i64 %118
  %120 = load float, ptr %119, align 4, !tbaa !13
  %121 = load float, ptr %11, align 4, !tbaa !13
  %122 = fsub float %120, %121
  %123 = load float, ptr %16, align 4, !tbaa !13
  %124 = fmul float %122, %123
  store float %124, ptr %19, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 1, ptr %20) #4
  %125 = load float, ptr %18, align 4, !tbaa !13
  %126 = fadd float %125, 5.000000e-01
  %127 = fptosi float %126 to i8
  %128 = sext i8 %127 to i32
  %129 = icmp slt i32 15, %128
  br i1 %129, label %130, label %131

130:                                              ; preds = %98
  br label %136

131:                                              ; preds = %98
  %132 = load float, ptr %18, align 4, !tbaa !13
  %133 = fadd float %132, 5.000000e-01
  %134 = fptosi float %133 to i8
  %135 = sext i8 %134 to i32
  br label %136

136:                                              ; preds = %131, %130
  %137 = phi i32 [ 15, %130 ], [ %135, %131 ]
  %138 = trunc i32 %137 to i8
  store i8 %138, ptr %20, align 1, !tbaa !17
  call void @llvm.lifetime.start.p0(i64 1, ptr %21) #4
  %139 = load float, ptr %19, align 4, !tbaa !13
  %140 = fadd float %139, 5.000000e-01
  %141 = fptosi float %140 to i8
  %142 = sext i8 %141 to i32
  %143 = icmp slt i32 15, %142
  br i1 %143, label %144, label %145

144:                                              ; preds = %136
  br label %150

145:                                              ; preds = %136
  %146 = load float, ptr %19, align 4, !tbaa !13
  %147 = fadd float %146, 5.000000e-01
  %148 = fptosi float %147 to i8
  %149 = sext i8 %148 to i32
  br label %150

150:                                              ; preds = %145, %144
  %151 = phi i32 [ 15, %144 ], [ %149, %145 ]
  %152 = trunc i32 %151 to i8
  store i8 %152, ptr %21, align 1, !tbaa !17
  %153 = load i8, ptr %20, align 1, !tbaa !17
  %154 = load ptr, ptr %5, align 8, !tbaa !5
  %155 = load i32, ptr %9, align 4, !tbaa !11
  %156 = sext i32 %155 to i64
  %157 = getelementptr inbounds %struct.block_q4_1, ptr %154, i64 %156
  %158 = getelementptr inbounds %struct.block_q4_1, ptr %157, i32 0, i32 1
  %159 = load i32, ptr %17, align 4, !tbaa !11
  %160 = sext i32 %159 to i64
  %161 = getelementptr inbounds [16 x i8], ptr %158, i64 0, i64 %160
  store i8 %153, ptr %161, align 1, !tbaa !17
  %162 = load i8, ptr %21, align 1, !tbaa !17
  %163 = zext i8 %162 to i32
  %164 = shl i32 %163, 4
  %165 = load ptr, ptr %5, align 8, !tbaa !5
  %166 = load i32, ptr %9, align 4, !tbaa !11
  %167 = sext i32 %166 to i64
  %168 = getelementptr inbounds %struct.block_q4_1, ptr %165, i64 %167
  %169 = getelementptr inbounds %struct.block_q4_1, ptr %168, i32 0, i32 1
  %170 = load i32, ptr %17, align 4, !tbaa !11
  %171 = sext i32 %170 to i64
  %172 = getelementptr inbounds [16 x i8], ptr %169, i64 0, i64 %171
  %173 = load i8, ptr %172, align 1, !tbaa !17
  %174 = zext i8 %173 to i32
  %175 = or i32 %174, %164
  %176 = trunc i32 %175 to i8
  store i8 %176, ptr %172, align 1, !tbaa !17
  call void @llvm.lifetime.end.p0(i64 1, ptr %21) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr %20) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #4
  br label %177

177:                                              ; preds = %150
  %178 = load i32, ptr %17, align 4, !tbaa !11
  %179 = add nsw i32 %178, 1
  store i32 %179, ptr %17, align 4, !tbaa !11
  br label %94, !llvm.loop !18

180:                                              ; preds = %97
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #4
  br label %181

181:                                              ; preds = %180
  %182 = load i32, ptr %9, align 4, !tbaa !11
  %183 = add nsw i32 %182, 1
  store i32 %183, ptr %9, align 4, !tbaa !11
  br label %31, !llvm.loop !19

184:                                              ; preds = %35
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  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 = { 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 = { nounwind }
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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"float", !7, i64 0}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}
!17 = !{!7, !7, i64 0}
!18 = distinct !{!18, !16}
!19 = distinct !{!19, !16}


; 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_q4_1 = type { %union.anon, [16 x i8] }
%union.anon = type { i32 }

@.str = external hidden unnamed_addr constant [12 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [65 x i8], align 1
@__PRETTY_FUNCTION__.quantize_row_q4_1_ref = external hidden unnamed_addr constant [81 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 zeroext i16 @ggml_compute_fp32_to_fp16(float noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
define dso_local void @quantize_row_q4_1_ref(ptr noalias nocapture noundef readonly %0, ptr noalias nocapture noundef writeonly %1, i64 noundef %2) local_unnamed_addr #2 {
  %4 = and i64 %2, 31
  %5 = icmp eq i64 %4, 0
  br i1 %5, label %7, label %6

6:                                                ; preds = %3
  tail call void @__assert_fail(ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 71, ptr noundef nonnull @__PRETTY_FUNCTION__.quantize_row_q4_1_ref) #4
  unreachable

7:                                                ; preds = %3
  %8 = lshr exact i64 %2, 5
  %9 = trunc i64 %8 to i32
  %10 = icmp sgt i32 %9, 0
  br i1 %10, label %.preheader.preheader, label %._crit_edge

.preheader.preheader:                             ; preds = %7
  %wide.trip.count = and i64 %8, 2147483647
  br label %.preheader

.preheader:                                       ; preds = %.preheader.preheader, %vector.ph
  %indvars.iv66 = phi i64 [ 0, %.preheader.preheader ], [ %indvars.iv.next67, %vector.ph ]
  %11 = shl nsw i64 %indvars.iv66, 5
  %invariant.gep = getelementptr inbounds float, ptr %0, i64 %11
  br label %88

._crit_edge:                                      ; preds = %vector.ph, %7
  ret void

vector.ph:                                        ; preds = %88
  %12 = fsub float %.151.1, %.1.1
  %13 = fdiv float %12, 1.500000e+01
  %14 = tail call zeroext i16 @ggml_compute_fp32_to_fp16(float noundef %13)
  %15 = getelementptr inbounds %struct.block_q4_1, ptr %1, i64 %indvars.iv66
  store i16 %14, ptr %15, align 4, !tbaa !5
  %16 = tail call zeroext i16 @ggml_compute_fp32_to_fp16(float noundef %.1.1)
  %17 = getelementptr inbounds i8, ptr %15, i64 2
  store i16 %16, ptr %17, align 2, !tbaa !5
  %18 = fcmp une float %13, 0.000000e+00
  %19 = fdiv float 1.000000e+00, %13
  %20 = select i1 %18, float %19, float 0.000000e+00
  %broadcast.splatinsert70 = insertelement <4 x float> poison, float %20, i64 0
  %broadcast.splat71 = shufflevector <4 x float> %broadcast.splatinsert70, <4 x float> poison, <4 x i32> zeroinitializer
  %broadcast.splatinsert = insertelement <4 x float> poison, float %.1.1, i64 0
  %broadcast.splat = shufflevector <4 x float> %broadcast.splatinsert, <4 x float> poison, <4 x i32> zeroinitializer
  %21 = getelementptr inbounds i8, ptr %15, i64 4
  %22 = getelementptr inbounds float, ptr %0, i64 %11
  %wide.load = load <4 x float>, ptr %22, align 4, !tbaa !8
  %23 = fsub <4 x float> %wide.load, %broadcast.splat
  %24 = fmul <4 x float> %broadcast.splat71, %23
  %25 = or disjoint i64 %11, 16
  %26 = getelementptr inbounds float, ptr %0, i64 %25
  %wide.load72 = load <4 x float>, ptr %26, align 4, !tbaa !8
  %27 = fsub <4 x float> %wide.load72, %broadcast.splat
  %28 = fmul <4 x float> %broadcast.splat71, %27
  %29 = fadd <4 x float> %24, <float 5.000000e-01, float 5.000000e-01, float 5.000000e-01, float 5.000000e-01>
  %30 = fptosi <4 x float> %29 to <4 x i8>
  %31 = tail call <4 x i8> @llvm.smin.v4i8(<4 x i8> %30, <4 x i8> <i8 15, i8 15, i8 15, i8 15>)
  %32 = fadd <4 x float> %28, <float 5.000000e-01, float 5.000000e-01, float 5.000000e-01, float 5.000000e-01>
  %33 = fptosi <4 x float> %32 to <4 x i8>
  %34 = tail call <4 x i8> @llvm.smin.v4i8(<4 x i8> %33, <4 x i8> <i8 15, i8 15, i8 15, i8 15>)
  %35 = shl <4 x i8> %34, <i8 4, i8 4, i8 4, i8 4>
  %36 = or <4 x i8> %35, %31
  store <4 x i8> %36, ptr %21, align 1, !tbaa !5
  %37 = or disjoint i64 %11, 4
  %38 = getelementptr inbounds float, ptr %0, i64 %37
  %wide.load.1 = load <4 x float>, ptr %38, align 4, !tbaa !8
  %39 = fsub <4 x float> %wide.load.1, %broadcast.splat
  %40 = fmul <4 x float> %broadcast.splat71, %39
  %41 = or disjoint i64 %11, 20
  %42 = getelementptr inbounds float, ptr %0, i64 %41
  %wide.load72.1 = load <4 x float>, ptr %42, align 4, !tbaa !8
  %43 = fsub <4 x float> %wide.load72.1, %broadcast.splat
  %44 = fmul <4 x float> %broadcast.splat71, %43
  %45 = fadd <4 x float> %40, <float 5.000000e-01, float 5.000000e-01, float 5.000000e-01, float 5.000000e-01>
  %46 = fptosi <4 x float> %45 to <4 x i8>
  %47 = tail call <4 x i8> @llvm.smin.v4i8(<4 x i8> %46, <4 x i8> <i8 15, i8 15, i8 15, i8 15>)
  %48 = fadd <4 x float> %44, <float 5.000000e-01, float 5.000000e-01, float 5.000000e-01, float 5.000000e-01>
  %49 = fptosi <4 x float> %48 to <4 x i8>
  %50 = tail call <4 x i8> @llvm.smin.v4i8(<4 x i8> %49, <4 x i8> <i8 15, i8 15, i8 15, i8 15>)
  %51 = getelementptr inbounds i8, ptr %15, i64 8
  %52 = shl <4 x i8> %50, <i8 4, i8 4, i8 4, i8 4>
  %53 = or <4 x i8> %52, %47
  store <4 x i8> %53, ptr %51, align 1, !tbaa !5
  %54 = or disjoint i64 %11, 8
  %55 = getelementptr inbounds float, ptr %0, i64 %54
  %wide.load.2 = load <4 x float>, ptr %55, align 4, !tbaa !8
  %56 = fsub <4 x float> %wide.load.2, %broadcast.splat
  %57 = fmul <4 x float> %broadcast.splat71, %56
  %58 = or disjoint i64 %11, 24
  %59 = getelementptr inbounds float, ptr %0, i64 %58
  %wide.load72.2 = load <4 x float>, ptr %59, align 4, !tbaa !8
  %60 = fsub <4 x float> %wide.load72.2, %broadcast.splat
  %61 = fmul <4 x float> %broadcast.splat71, %60
  %62 = fadd <4 x float> %57, <float 5.000000e-01, float 5.000000e-01, float 5.000000e-01, float 5.000000e-01>
  %63 = fptosi <4 x float> %62 to <4 x i8>
  %64 = tail call <4 x i8> @llvm.smin.v4i8(<4 x i8> %63, <4 x i8> <i8 15, i8 15, i8 15, i8 15>)
  %65 = fadd <4 x float> %61, <float 5.000000e-01, float 5.000000e-01, float 5.000000e-01, float 5.000000e-01>
  %66 = fptosi <4 x float> %65 to <4 x i8>
  %67 = tail call <4 x i8> @llvm.smin.v4i8(<4 x i8> %66, <4 x i8> <i8 15, i8 15, i8 15, i8 15>)
  %68 = getelementptr inbounds i8, ptr %15, i64 12
  %69 = shl <4 x i8> %67, <i8 4, i8 4, i8 4, i8 4>
  %70 = or <4 x i8> %69, %64
  store <4 x i8> %70, ptr %68, align 1, !tbaa !5
  %71 = or disjoint i64 %11, 12
  %72 = getelementptr inbounds float, ptr %0, i64 %71
  %wide.load.3 = load <4 x float>, ptr %72, align 4, !tbaa !8
  %73 = fsub <4 x float> %wide.load.3, %broadcast.splat
  %74 = fmul <4 x float> %broadcast.splat71, %73
  %75 = or disjoint i64 %11, 28
  %76 = getelementptr inbounds float, ptr %0, i64 %75
  %wide.load72.3 = load <4 x float>, ptr %76, align 4, !tbaa !8
  %77 = fsub <4 x float> %wide.load72.3, %broadcast.splat
  %78 = fmul <4 x float> %broadcast.splat71, %77
  %79 = fadd <4 x float> %74, <float 5.000000e-01, float 5.000000e-01, float 5.000000e-01, float 5.000000e-01>
  %80 = fptosi <4 x float> %79 to <4 x i8>
  %81 = tail call <4 x i8> @llvm.smin.v4i8(<4 x i8> %80, <4 x i8> <i8 15, i8 15, i8 15, i8 15>)
  %82 = fadd <4 x float> %78, <float 5.000000e-01, float 5.000000e-01, float 5.000000e-01, float 5.000000e-01>
  %83 = fptosi <4 x float> %82 to <4 x i8>
  %84 = tail call <4 x i8> @llvm.smin.v4i8(<4 x i8> %83, <4 x i8> <i8 15, i8 15, i8 15, i8 15>)
  %85 = getelementptr inbounds i8, ptr %15, i64 16
  %86 = shl <4 x i8> %84, <i8 4, i8 4, i8 4, i8 4>
  %87 = or <4 x i8> %86, %81
  store <4 x i8> %87, ptr %85, align 1, !tbaa !5
  %indvars.iv.next67 = add nuw nsw i64 %indvars.iv66, 1
  %exitcond69.not = icmp eq i64 %indvars.iv.next67, %wide.trip.count
  br i1 %exitcond69.not, label %._crit_edge, label %.preheader, !llvm.loop !10

88:                                               ; preds = %88, %.preheader
  %indvars.iv = phi i64 [ 0, %.preheader ], [ %indvars.iv.next.1, %88 ]
  %.04958 = phi float [ 0x47EFFFFFE0000000, %.preheader ], [ %.1.1, %88 ]
  %.05057 = phi float [ 0xC7EFFFFFE0000000, %.preheader ], [ %.151.1, %88 ]
  %gep = getelementptr inbounds float, ptr %invariant.gep, i64 %indvars.iv
  %89 = load float, ptr %gep, align 4, !tbaa !8
  %90 = fcmp olt float %89, %.04958
  %.1 = select i1 %90, float %89, float %.04958
  %91 = fcmp ogt float %89, %.05057
  %.151 = select i1 %91, float %89, float %.05057
  %indvars.iv.next = or disjoint i64 %indvars.iv, 1
  %gep.1 = getelementptr inbounds float, ptr %invariant.gep, i64 %indvars.iv.next
  %92 = load float, ptr %gep.1, align 4, !tbaa !8
  %93 = fcmp olt float %92, %.1
  %.1.1 = select i1 %93, float %92, float %.1
  %94 = fcmp ogt float %92, %.151
  %.151.1 = select i1 %94, float %92, float %.151
  %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
  %exitcond.not.1 = icmp eq i64 %indvars.iv.next.1, 32
  br i1 %exitcond.not.1, label %vector.ph, label %88, !llvm.loop !12
}

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <4 x i8> @llvm.smin.v4i8(<4 x i8>, <4 x i8>) #3

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 = { 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 = { 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 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
!12 = distinct !{!12, !11}


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