; LLVM IR from cpuimage/cpuimagelib :: cpuimage (CPUImageHueFilter)

; 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"

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

; Function Attrs: nounwind
declare float @sqrtf(float noundef) #1

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2

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

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

; Function Attrs: nounwind uwtable
define dso_local void @CPUImageHueFilter(ptr noundef %0, ptr noundef %1, i32 noundef %2, i32 noundef %3, i32 noundef %4, float noundef %5) #3 {
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca float, align 4
  %13 = alloca i32, align 4
  %14 = alloca [65536 x float], align 16
  %15 = alloca [65536 x float], align 16
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca ptr, align 8
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  %21 = alloca ptr, align 8
  %22 = alloca i32, align 4
  %23 = alloca float, align 4
  %24 = alloca i16, align 2
  %25 = alloca i16, align 2
  %26 = alloca i16, align 2
  %27 = alloca i32, align 4
  %28 = alloca ptr, align 8
  %29 = alloca ptr, align 8
  %30 = alloca i32, align 4
  %31 = alloca ptr, align 8
  %32 = alloca ptr, align 8
  %33 = alloca float, align 4
  store ptr %0, ptr %7, align 8, !tbaa !5
  store ptr %1, ptr %8, align 8, !tbaa !5
  store i32 %2, ptr %9, align 4, !tbaa !9
  store i32 %3, ptr %10, align 4, !tbaa !9
  store i32 %4, ptr %11, align 4, !tbaa !9
  store float %5, ptr %12, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #4
  %34 = load i32, ptr %11, align 4, !tbaa !9
  %35 = load i32, ptr %9, align 4, !tbaa !9
  %36 = sdiv i32 %34, %35
  store i32 %36, ptr %13, align 4, !tbaa !9
  %37 = load float, ptr %12, align 4, !tbaa !11
  %38 = call float @fmodf(float noundef %37, float noundef 3.600000e+02) #4
  %39 = fmul float %38, 0x400921FB60000000
  %40 = fdiv float %39, 1.800000e+02
  store float %40, ptr %12, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 262144, ptr %14) #4
  call void @llvm.memset.p0.i64(ptr align 16 %14, i8 0, i64 262144, i1 false)
  call void @llvm.lifetime.start.p0(i64 262144, ptr %15) #4
  call void @llvm.memset.p0.i64(ptr align 16 %15, i8 0, i64 262144, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #4
  store i32 0, ptr %16, align 4, !tbaa !9
  br label %41

41:                                               ; preds = %77, %6
  %42 = load i32, ptr %16, align 4, !tbaa !9
  %43 = icmp slt i32 %42, 256
  br i1 %43, label %45, label %44

44:                                               ; preds = %41
  store i32 2, ptr %17, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #4
  br label %80

45:                                               ; preds = %41
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #4
  %46 = getelementptr inbounds [65536 x float], ptr %15, i64 0, i64 0
  %47 = load i32, ptr %16, align 4, !tbaa !9
  %48 = mul nsw i32 %47, 256
  %49 = sext i32 %48 to i64
  %50 = getelementptr inbounds float, ptr %46, i64 %49
  store ptr %50, ptr %18, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #4
  store i32 0, ptr %19, align 4, !tbaa !9
  br label %51

51:                                               ; preds = %73, %45
  %52 = load i32, ptr %19, align 4, !tbaa !9
  %53 = icmp slt i32 %52, 256
  br i1 %53, label %55, label %54

54:                                               ; preds = %51
  store i32 5, ptr %17, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #4
  br label %76

55:                                               ; preds = %51
  %56 = load i32, ptr %19, align 4, !tbaa !9
  %57 = sub nsw i32 %56, 128
  %58 = load i32, ptr %19, align 4, !tbaa !9
  %59 = sub nsw i32 %58, 128
  %60 = mul nsw i32 %57, %59
  %61 = load i32, ptr %16, align 4, !tbaa !9
  %62 = sub nsw i32 %61, 128
  %63 = load i32, ptr %16, align 4, !tbaa !9
  %64 = sub nsw i32 %63, 128
  %65 = mul nsw i32 %62, %64
  %66 = add nsw i32 %60, %65
  %67 = sitofp i32 %66 to float
  %68 = call float @sqrtf(float noundef %67) #4
  %69 = load ptr, ptr %18, align 8, !tbaa !5
  %70 = getelementptr inbounds float, ptr %69, i64 0
  store float %68, ptr %70, align 4, !tbaa !11
  %71 = load ptr, ptr %18, align 8, !tbaa !5
  %72 = getelementptr inbounds float, ptr %71, i32 1
  store ptr %72, ptr %18, align 8, !tbaa !5
  br label %73

73:                                               ; preds = %55
  %74 = load i32, ptr %19, align 4, !tbaa !9
  %75 = add nsw i32 %74, 1
  store i32 %75, ptr %19, align 4, !tbaa !9
  br label %51, !llvm.loop !13

76:                                               ; preds = %54
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #4
  br label %77

77:                                               ; preds = %76
  %78 = load i32, ptr %16, align 4, !tbaa !9
  %79 = add nsw i32 %78, 1
  store i32 %79, ptr %16, align 4, !tbaa !9
  br label %41, !llvm.loop !15

80:                                               ; preds = %44
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #4
  store i32 0, ptr %20, align 4, !tbaa !9
  br label %81

81:                                               ; preds = %111, %80
  %82 = load i32, ptr %20, align 4, !tbaa !9
  %83 = icmp slt i32 %82, 256
  br i1 %83, label %85, label %84

84:                                               ; preds = %81
  store i32 8, ptr %17, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #4
  br label %114

85:                                               ; preds = %81
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #4
  %86 = getelementptr inbounds [65536 x float], ptr %14, i64 0, i64 0
  %87 = load i32, ptr %20, align 4, !tbaa !9
  %88 = mul nsw i32 %87, 256
  %89 = sext i32 %88 to i64
  %90 = getelementptr inbounds float, ptr %86, i64 %89
  store ptr %90, ptr %21, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #4
  store i32 0, ptr %22, align 4, !tbaa !9
  br label %91

91:                                               ; preds = %107, %85
  %92 = load i32, ptr %22, align 4, !tbaa !9
  %93 = icmp slt i32 %92, 256
  br i1 %93, label %95, label %94

94:                                               ; preds = %91
  store i32 11, ptr %17, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #4
  br label %110

95:                                               ; preds = %91
  %96 = load i32, ptr %20, align 4, !tbaa !9
  %97 = sitofp i32 %96 to float
  %98 = fsub float %97, 1.280000e+02
  %99 = load i32, ptr %22, align 4, !tbaa !9
  %100 = sitofp i32 %99 to float
  %101 = fsub float %100, 1.280000e+02
  %102 = call float @atan2f(float noundef %98, float noundef %101) #4
  %103 = load ptr, ptr %21, align 8, !tbaa !5
  %104 = getelementptr inbounds float, ptr %103, i64 0
  store float %102, ptr %104, align 4, !tbaa !11
  %105 = load ptr, ptr %21, align 8, !tbaa !5
  %106 = getelementptr inbounds float, ptr %105, i32 1
  store ptr %106, ptr %21, align 8, !tbaa !5
  br label %107

107:                                              ; preds = %95
  %108 = load i32, ptr %22, align 4, !tbaa !9
  %109 = add nsw i32 %108, 1
  store i32 %109, ptr %22, align 4, !tbaa !9
  br label %91, !llvm.loop !16

110:                                              ; preds = %94
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #4
  br label %111

111:                                              ; preds = %110
  %112 = load i32, ptr %20, align 4, !tbaa !9
  %113 = add nsw i32 %112, 1
  store i32 %113, ptr %20, align 4, !tbaa !9
  br label %81, !llvm.loop !17

114:                                              ; preds = %84
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #4
  store float 0.000000e+00, ptr %23, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 2, ptr %24) #4
  store i16 0, ptr %24, align 2, !tbaa !18
  call void @llvm.lifetime.start.p0(i64 2, ptr %25) #4
  store i16 0, ptr %25, align 2, !tbaa !18
  call void @llvm.lifetime.start.p0(i64 2, ptr %26) #4
  store i16 0, ptr %26, align 2, !tbaa !18
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #4
  store i32 0, ptr %27, align 4, !tbaa !9
  br label %115

115:                                              ; preds = %205, %114
  %116 = load i32, ptr %27, align 4, !tbaa !9
  %117 = load i32, ptr %10, align 4, !tbaa !9
  %118 = icmp slt i32 %116, %117
  br i1 %118, label %120, label %119

119:                                              ; preds = %115
  store i32 14, ptr %17, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #4
  br label %208

120:                                              ; preds = %115
  call void @llvm.lifetime.start.p0(i64 8, ptr %28) #4
  %121 = load ptr, ptr %8, align 8, !tbaa !5
  %122 = load i32, ptr %27, align 4, !tbaa !9
  %123 = load i32, ptr %11, align 4, !tbaa !9
  %124 = mul nsw i32 %122, %123
  %125 = sext i32 %124 to i64
  %126 = getelementptr inbounds i8, ptr %121, i64 %125
  store ptr %126, ptr %28, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %29) #4
  %127 = load ptr, ptr %7, align 8, !tbaa !5
  %128 = load i32, ptr %27, align 4, !tbaa !9
  %129 = load i32, ptr %11, align 4, !tbaa !9
  %130 = mul nsw i32 %128, %129
  %131 = sext i32 %130 to i64
  %132 = getelementptr inbounds i8, ptr %127, i64 %131
  store ptr %132, ptr %29, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %30) #4
  store i32 0, ptr %30, align 4, !tbaa !9
  br label %133

133:                                              ; preds = %201, %120
  %134 = load i32, ptr %30, align 4, !tbaa !9
  %135 = load i32, ptr %9, align 4, !tbaa !9
  %136 = icmp slt i32 %134, %135
  br i1 %136, label %138, label %137

137:                                              ; preds = %133
  store i32 17, ptr %17, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %30) #4
  br label %204

138:                                              ; preds = %133
  %139 = load ptr, ptr %29, align 8, !tbaa !5
  %140 = getelementptr inbounds i8, ptr %139, i64 0
  %141 = load ptr, ptr %29, align 8, !tbaa !5
  %142 = getelementptr inbounds i8, ptr %141, i64 1
  %143 = load ptr, ptr %29, align 8, !tbaa !5
  %144 = getelementptr inbounds i8, ptr %143, i64 2
  call void @rgb2yiq(ptr noundef %140, ptr noundef %142, ptr noundef %144, ptr noundef %24, ptr noundef %25, ptr noundef %26)
  call void @llvm.lifetime.start.p0(i64 8, ptr %31) #4
  %145 = getelementptr inbounds [65536 x float], ptr %14, i64 0, i64 0
  %146 = load i16, ptr %26, align 2, !tbaa !18
  %147 = sext i16 %146 to i32
  %148 = add nsw i32 %147, 128
  %149 = shl i32 %148, 8
  %150 = sext i32 %149 to i64
  %151 = getelementptr inbounds float, ptr %145, i64 %150
  store ptr %151, ptr %31, align 8, !tbaa !5
  %152 = load ptr, ptr %31, align 8, !tbaa !5
  %153 = load i16, ptr %25, align 2, !tbaa !18
  %154 = sext i16 %153 to i32
  %155 = add nsw i32 %154, 128
  %156 = sext i32 %155 to i64
  %157 = getelementptr inbounds float, ptr %152, i64 %156
  %158 = load float, ptr %157, align 4, !tbaa !11
  store float %158, ptr %23, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %32) #4
  %159 = getelementptr inbounds [65536 x float], ptr %15, i64 0, i64 0
  %160 = load i16, ptr %26, align 2, !tbaa !18
  %161 = sext i16 %160 to i32
  %162 = add nsw i32 %161, 128
  %163 = shl i32 %162, 8
  %164 = sext i32 %163 to i64
  %165 = getelementptr inbounds float, ptr %159, i64 %164
  store ptr %165, ptr %32, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %33) #4
  %166 = load ptr, ptr %32, align 8, !tbaa !5
  %167 = load i16, ptr %25, align 2, !tbaa !18
  %168 = sext i16 %167 to i32
  %169 = add nsw i32 %168, 128
  %170 = sext i32 %169 to i64
  %171 = getelementptr inbounds float, ptr %166, i64 %170
  %172 = load float, ptr %171, align 4, !tbaa !11
  store float %172, ptr %33, align 4, !tbaa !11
  %173 = load float, ptr %12, align 4, !tbaa !11
  %174 = fneg float %173
  %175 = load float, ptr %23, align 4, !tbaa !11
  %176 = fadd float %175, %174
  store float %176, ptr %23, align 4, !tbaa !11
  %177 = load float, ptr %33, align 4, !tbaa !11
  %178 = load float, ptr %23, align 4, !tbaa !11
  %179 = call float @sinf(float noundef %178) #4
  %180 = fmul float %177, %179
  %181 = fptosi float %180 to i16
  store i16 %181, ptr %26, align 2, !tbaa !18
  %182 = load float, ptr %33, align 4, !tbaa !11
  %183 = load float, ptr %23, align 4, !tbaa !11
  %184 = call float @cosf(float noundef %183) #4
  %185 = fmul float %182, %184
  %186 = fptosi float %185 to i16
  store i16 %186, ptr %25, align 2, !tbaa !18
  %187 = load ptr, ptr %28, align 8, !tbaa !5
  %188 = getelementptr inbounds i8, ptr %187, i64 0
  %189 = load ptr, ptr %28, align 8, !tbaa !5
  %190 = getelementptr inbounds i8, ptr %189, i64 1
  %191 = load ptr, ptr %28, align 8, !tbaa !5
  %192 = getelementptr inbounds i8, ptr %191, i64 2
  call void @yiq2rgb(ptr noundef %24, ptr noundef %25, ptr noundef %26, ptr noundef %188, ptr noundef %190, ptr noundef %192)
  %193 = load i32, ptr %13, align 4, !tbaa !9
  %194 = load ptr, ptr %29, align 8, !tbaa !5
  %195 = sext i32 %193 to i64
  %196 = getelementptr inbounds i8, ptr %194, i64 %195
  store ptr %196, ptr %29, align 8, !tbaa !5
  %197 = load i32, ptr %13, align 4, !tbaa !9
  %198 = load ptr, ptr %28, align 8, !tbaa !5
  %199 = sext i32 %197 to i64
  %200 = getelementptr inbounds i8, ptr %198, i64 %199
  store ptr %200, ptr %28, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %33) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %32) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %31) #4
  br label %201

201:                                              ; preds = %138
  %202 = load i32, ptr %30, align 4, !tbaa !9
  %203 = add nsw i32 %202, 1
  store i32 %203, ptr %30, align 4, !tbaa !9
  br label %133, !llvm.loop !20

204:                                              ; preds = %137
  call void @llvm.lifetime.end.p0(i64 8, ptr %29) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #4
  br label %205

205:                                              ; preds = %204
  %206 = load i32, ptr %27, align 4, !tbaa !9
  %207 = add nsw i32 %206, 1
  store i32 %207, ptr %27, align 4, !tbaa !9
  br label %115, !llvm.loop !21

208:                                              ; preds = %119
  call void @llvm.lifetime.end.p0(i64 2, ptr %26) #4
  call void @llvm.lifetime.end.p0(i64 2, ptr %25) #4
  call void @llvm.lifetime.end.p0(i64 2, ptr %24) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #4
  call void @llvm.lifetime.end.p0(i64 262144, ptr %15) #4
  call void @llvm.lifetime.end.p0(i64 262144, ptr %14) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #4
  ret void
}

; Function Attrs: nounwind
declare float @fmodf(float noundef, float noundef) #1

; Function Attrs: nounwind
declare float @atan2f(float noundef, float noundef) #1

; Function Attrs: nounwind
declare float @sinf(float noundef) #1

; Function Attrs: nounwind
declare float @cosf(float noundef) #1

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { nocallback nofree nounwind willreturn memory(argmem: write) }
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 }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"float", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}
!16 = distinct !{!16, !14}
!17 = distinct !{!17, !14}
!18 = !{!19, !19, i64 0}
!19 = !{!"short", !7, i64 0}
!20 = distinct !{!20, !14}
!21 = distinct !{!21, !14}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

; Function Attrs: 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 nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #1

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

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

; Function Attrs: nounwind uwtable
define dso_local void @CPUImageHueFilter(ptr noundef %0, ptr noundef %1, i32 noundef %2, i32 noundef %3, i32 noundef %4, float noundef %5) local_unnamed_addr #2 {
  %7 = alloca [65536 x float], align 16
  %8 = alloca [65536 x float], align 16
  %9 = alloca i16, align 2
  %10 = alloca i16, align 2
  %11 = alloca i16, align 2
  %12 = tail call float @fmodf(float noundef %5, float noundef 3.600000e+02) #5
  call void @llvm.lifetime.start.p0(i64 262144, ptr nonnull %7) #5
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(262144) %7, i8 0, i64 262144, i1 false)
  call void @llvm.lifetime.start.p0(i64 262144, ptr nonnull %8) #5
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(262144) %8, i8 0, i64 262144, i1 false)
  br label %vector.ph

vector.ph:                                        ; preds = %6, %middle.block
  %indvars.iv = phi i64 [ 0, %6 ], [ %indvars.iv.next, %middle.block ]
  %.idx = shl nsw i64 %indvars.iv, 10
  %13 = getelementptr inbounds i8, ptr %8, i64 %.idx
  %14 = add nsw i64 %indvars.iv, -128
  %15 = mul nsw i64 %14, %14
  %16 = trunc nsw i64 %15 to i32
  %broadcast.splatinsert = insertelement <4 x i32> poison, i32 %16, i64 0
  %broadcast.splat = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %vec.ind = phi <4 x i32> [ <i32 0, i32 1, i32 2, i32 3>, %vector.ph ], [ %vec.ind.next, %vector.body ]
  %offset.idx = shl i64 %index, 2
  %next.gep = getelementptr i8, ptr %13, i64 %offset.idx
  %17 = add nsw <4 x i32> %vec.ind, <i32 -128, i32 -128, i32 -128, i32 -128>
  %18 = mul nsw <4 x i32> %17, %17
  %19 = add nuw nsw <4 x i32> %18, %broadcast.splat
  %20 = uitofp <4 x i32> %19 to <4 x float>
  %21 = tail call <4 x float> @llvm.sqrt.v4f32(<4 x float> %20)
  store <4 x float> %21, ptr %next.gep, align 16, !tbaa !5
  %index.next = add nuw i64 %index, 4
  %vec.ind.next = add <4 x i32> %vec.ind, <i32 4, i32 4, i32 4, i32 4>
  %22 = icmp eq i64 %index.next, 256
  br i1 %22, label %middle.block, label %vector.body, !llvm.loop !9

middle.block:                                     ; preds = %vector.body
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond76.not = icmp eq i64 %indvars.iv.next, 256
  br i1 %exitcond76.not, label %.preheader.preheader, label %vector.ph, !llvm.loop !13

.preheader.preheader:                             ; preds = %middle.block
  %23 = sdiv i32 %4, %2
  br label %.preheader

24:                                               ; preds = %67
  call void @llvm.lifetime.start.p0(i64 2, ptr nonnull %9) #5
  store i16 0, ptr %9, align 2, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 2, ptr nonnull %10) #5
  store i16 0, ptr %10, align 2, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 2, ptr nonnull %11) #5
  store i16 0, ptr %11, align 2, !tbaa !14
  %25 = icmp sgt i32 %3, 0
  br i1 %25, label %.lr.ph72, label %._crit_edge73

.lr.ph72:                                         ; preds = %24
  %26 = fmul float %12, 0x400921FB60000000
  %27 = icmp sgt i32 %2, 0
  %28 = fdiv float %26, 1.800000e+02
  %29 = sext i32 %23 to i64
  br i1 %27, label %.lr.ph.us.preheader, label %._crit_edge73

.lr.ph.us.preheader:                              ; preds = %.lr.ph72
  %30 = sext i32 %4 to i64
  %wide.trip.count = zext nneg i32 %3 to i64
  br label %.lr.ph.us

.lr.ph.us:                                        ; preds = %.lr.ph.us.preheader, %._crit_edge.us
  %indvars.iv83 = phi i64 [ 0, %.lr.ph.us.preheader ], [ %indvars.iv.next84, %._crit_edge.us ]
  %31 = mul nsw i64 %indvars.iv83, %30
  %32 = getelementptr inbounds i8, ptr %1, i64 %31
  %33 = getelementptr inbounds i8, ptr %0, i64 %31
  br label %34

34:                                               ; preds = %.lr.ph.us, %34
  %.05269.us = phi i32 [ 0, %.lr.ph.us ], [ %62, %34 ]
  %.05368.us = phi ptr [ %33, %.lr.ph.us ], [ %60, %34 ]
  %.05467.us = phi ptr [ %32, %.lr.ph.us ], [ %61, %34 ]
  %35 = getelementptr inbounds i8, ptr %.05368.us, i64 1
  %36 = getelementptr inbounds i8, ptr %.05368.us, i64 2
  call void @rgb2yiq(ptr noundef %.05368.us, ptr noundef nonnull %35, ptr noundef nonnull %36, ptr noundef nonnull %9, ptr noundef nonnull %10, ptr noundef nonnull %11)
  %37 = load i16, ptr %11, align 2, !tbaa !14
  %38 = sext i16 %37 to i32
  %39 = shl nsw i32 %38, 8
  %40 = add nsw i32 %39, 32768
  %41 = sext i32 %40 to i64
  %42 = getelementptr inbounds float, ptr %7, i64 %41
  %43 = load i16, ptr %10, align 2, !tbaa !14
  %44 = sext i16 %43 to i64
  %45 = add nsw i64 %44, 128
  %46 = getelementptr inbounds float, ptr %42, i64 %45
  %47 = load float, ptr %46, align 4, !tbaa !5
  %48 = getelementptr inbounds float, ptr %8, i64 %41
  %49 = getelementptr inbounds float, ptr %48, i64 %45
  %50 = load float, ptr %49, align 4, !tbaa !5
  %51 = fsub float %47, %28
  %52 = call float @sinf(float noundef %51) #5
  %53 = fmul float %50, %52
  %54 = fptosi float %53 to i16
  store i16 %54, ptr %11, align 2, !tbaa !14
  %55 = call float @cosf(float noundef %51) #5
  %56 = fmul float %50, %55
  %57 = fptosi float %56 to i16
  store i16 %57, ptr %10, align 2, !tbaa !14
  %58 = getelementptr inbounds i8, ptr %.05467.us, i64 1
  %59 = getelementptr inbounds i8, ptr %.05467.us, i64 2
  call void @yiq2rgb(ptr noundef nonnull %9, ptr noundef nonnull %10, ptr noundef nonnull %11, ptr noundef %.05467.us, ptr noundef nonnull %58, ptr noundef nonnull %59)
  %60 = getelementptr inbounds i8, ptr %.05368.us, i64 %29
  %61 = getelementptr inbounds i8, ptr %.05467.us, i64 %29
  %62 = add nuw nsw i32 %.05269.us, 1
  %exitcond82.not = icmp eq i32 %62, %2
  br i1 %exitcond82.not, label %._crit_edge.us, label %34, !llvm.loop !16

._crit_edge.us:                                   ; preds = %34
  %indvars.iv.next84 = add nuw nsw i64 %indvars.iv83, 1
  %exitcond86.not = icmp eq i64 %indvars.iv.next84, %wide.trip.count
  br i1 %exitcond86.not, label %._crit_edge73, label %.lr.ph.us, !llvm.loop !17

.preheader:                                       ; preds = %.preheader.preheader, %67
  %indvars.iv78 = phi i64 [ 0, %.preheader.preheader ], [ %indvars.iv.next79, %67 ]
  %.idx87 = shl nsw i64 %indvars.iv78, 10
  %63 = getelementptr inbounds i8, ptr %7, i64 %.idx87
  %64 = trunc nuw nsw i64 %indvars.iv78 to i32
  %65 = uitofp nneg i32 %64 to float
  %66 = fadd float %65, -1.280000e+02
  br label %68

67:                                               ; preds = %68
  %indvars.iv.next79 = add nuw nsw i64 %indvars.iv78, 1
  %exitcond81.not = icmp eq i64 %indvars.iv.next79, 256
  br i1 %exitcond81.not, label %24, label %.preheader, !llvm.loop !18

68:                                               ; preds = %.preheader, %68
  %.05665 = phi i32 [ 0, %.preheader ], [ %73, %68 ]
  %.05764 = phi ptr [ %63, %.preheader ], [ %72, %68 ]
  %69 = uitofp nneg i32 %.05665 to float
  %70 = fadd float %69, -1.280000e+02
  %71 = tail call float @atan2f(float noundef %66, float noundef %70) #5
  store float %71, ptr %.05764, align 4, !tbaa !5
  %72 = getelementptr inbounds i8, ptr %.05764, i64 4
  %73 = add nuw nsw i32 %.05665, 1
  %exitcond77.not = icmp eq i32 %73, 256
  br i1 %exitcond77.not, label %67, label %68, !llvm.loop !19

._crit_edge73:                                    ; preds = %._crit_edge.us, %.lr.ph72, %24
  call void @llvm.lifetime.end.p0(i64 2, ptr nonnull %11) #5
  call void @llvm.lifetime.end.p0(i64 2, ptr nonnull %10) #5
  call void @llvm.lifetime.end.p0(i64 2, ptr nonnull %9) #5
  call void @llvm.lifetime.end.p0(i64 262144, ptr nonnull %8) #5
  call void @llvm.lifetime.end.p0(i64 262144, ptr nonnull %7) #5
  ret void
}

; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare float @fmodf(float noundef, float noundef) local_unnamed_addr #3

; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare float @atan2f(float noundef, float noundef) local_unnamed_addr #3

; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare float @sinf(float noundef) local_unnamed_addr #3

; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare float @cosf(float noundef) local_unnamed_addr #3

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <4 x float> @llvm.sqrt.v4f32(<4 x float>) #4

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
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 nofree nounwind willreturn memory(write) "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 = { 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 = !{!"float", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10, !11, !12}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.isvectorized", i32 1}
!12 = !{!"llvm.loop.unroll.runtime.disable"}
!13 = distinct !{!13, !10}
!14 = !{!15, !15, i64 0}
!15 = !{!"short", !7, i64 0}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10}
!18 = distinct !{!18, !10}
!19 = distinct !{!19, !10}


; Effective O3 passes: AggressiveInstCombinePass,EarlyCSEPass,GVNPass,GlobalDCEPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopInstSimplifyPass,LoopLoadEliminationPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,LoopVectorizePass,ReassociatePass,SLPVectorizerPass,SROAPass,SimplifyCFGPass,TailCallElimPass