; LLVM IR from achilles288/robot-monitor-graphics :: src/base/bitmap.ll (ZNK3rmg6Bitmap11toGrayscaleEv)

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

%"class.rmg::Bitmap" = type { i16, i16, i8, ptr }

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK3rmg6Bitmap11toGrayscaleEv(ptr dead_on_unwind noalias writable sret(%"class.rmg::Bitmap") align 8 %0, ptr noundef nonnull align 8 dereferenceable(16) %1) #1 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i1, align 1
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i64, align 8
  %9 = alloca i64, align 8
  %10 = alloca float, align 4
  %11 = alloca i64, align 8
  %12 = alloca ptr, align 8
  %13 = alloca i32, align 4
  %14 = alloca i64, align 8
  %15 = alloca float, align 4
  %16 = alloca float, align 4
  %17 = alloca float, align 4
  %18 = alloca float, align 4
  store ptr %0, ptr %3, align 8
  store ptr %1, ptr %4, align 8, !tbaa !5
  %19 = load ptr, ptr %4, align 8
  %20 = getelementptr inbounds %"class.rmg::Bitmap", ptr %19, i32 0, i32 2
  %21 = load i8, ptr %20, align 4, !tbaa !9
  %22 = zext i8 %21 to i32
  %23 = icmp eq i32 %22, 1
  br i1 %23, label %24, label %25

24:                                               ; preds = %2
  call void @_ZN3rmg6BitmapC1ERKS0_(ptr noundef nonnull align 8 dereferenceable(16) %0, ptr noundef nonnull align 8 dereferenceable(16) %19)
  br label %199

25:                                               ; preds = %2
  store i1 false, ptr %5, align 1
  %26 = getelementptr inbounds %"class.rmg::Bitmap", ptr %19, i32 0, i32 0
  %27 = load i16, ptr %26, align 8, !tbaa !12
  %28 = getelementptr inbounds %"class.rmg::Bitmap", ptr %19, i32 0, i32 1
  %29 = load i16, ptr %28, align 2, !tbaa !13
  call void @_ZN3rmg6BitmapC1Etth(ptr noundef nonnull align 8 dereferenceable(16) %0, i16 noundef zeroext %27, i16 noundef zeroext %29, i8 noundef zeroext 1)
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #4
  %30 = getelementptr inbounds %"class.rmg::Bitmap", ptr %19, i32 0, i32 3
  %31 = load ptr, ptr %30, align 8, !tbaa !14
  store ptr %31, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #4
  %32 = getelementptr inbounds %"class.rmg::Bitmap", ptr %0, i32 0, i32 3
  %33 = load ptr, ptr %32, align 8, !tbaa !14
  store ptr %33, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #4
  %34 = getelementptr inbounds %"class.rmg::Bitmap", ptr %19, i32 0, i32 0
  %35 = load i16, ptr %34, align 8, !tbaa !12
  %36 = zext i16 %35 to i32
  %37 = getelementptr inbounds %"class.rmg::Bitmap", ptr %19, i32 0, i32 1
  %38 = load i16, ptr %37, align 2, !tbaa !13
  %39 = zext i16 %38 to i32
  %40 = mul nsw i32 %36, %39
  %41 = sext i32 %40 to i64
  store i64 %41, ptr %8, align 8, !tbaa !15
  %42 = getelementptr inbounds %"class.rmg::Bitmap", ptr %19, i32 0, i32 2
  %43 = load i8, ptr %42, align 4, !tbaa !9
  %44 = zext i8 %43 to i32
  %45 = icmp eq i32 %44, 2
  br i1 %45, label %46, label %82

46:                                               ; preds = %25
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #4
  store i64 0, ptr %9, align 8, !tbaa !15
  br label %47

47:                                               ; preds = %78, %46
  %48 = load i64, ptr %9, align 8, !tbaa !15
  %49 = load i64, ptr %8, align 8, !tbaa !15
  %50 = icmp ult i64 %48, %49
  br i1 %50, label %52, label %51

51:                                               ; preds = %47
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #4
  br label %81

52:                                               ; preds = %47
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #4
  %53 = load ptr, ptr %6, align 8, !tbaa !5
  %54 = getelementptr inbounds i8, ptr %53, i64 1
  %55 = load i8, ptr %54, align 1, !tbaa !17
  %56 = zext i8 %55 to i32
  %57 = sitofp i32 %56 to float
  %58 = fdiv float %57, 2.550000e+02
  store float %58, ptr %10, align 4, !tbaa !18
  %59 = load float, ptr %10, align 4, !tbaa !18
  %60 = load ptr, ptr %6, align 8, !tbaa !5
  %61 = getelementptr inbounds i8, ptr %60, i64 0
  %62 = load i8, ptr %61, align 1, !tbaa !17
  %63 = zext i8 %62 to i32
  %64 = sitofp i32 %63 to float
  %65 = call float @llvm.fmuladd.f32(float %59, float %64, float 2.555000e+02)
  %66 = load ptr, ptr %6, align 8, !tbaa !5
  %67 = getelementptr inbounds i8, ptr %66, i64 1
  %68 = load i8, ptr %67, align 1, !tbaa !17
  %69 = zext i8 %68 to i32
  %70 = sitofp i32 %69 to float
  %71 = fsub float %65, %70
  %72 = fptoui float %71 to i8
  %73 = load ptr, ptr %7, align 8, !tbaa !5
  store i8 %72, ptr %73, align 1, !tbaa !17
  %74 = load ptr, ptr %6, align 8, !tbaa !5
  %75 = getelementptr inbounds i8, ptr %74, i64 2
  store ptr %75, ptr %6, align 8, !tbaa !5
  %76 = load ptr, ptr %7, align 8, !tbaa !5
  %77 = getelementptr inbounds i8, ptr %76, i64 1
  store ptr %77, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  br label %78

78:                                               ; preds = %52
  %79 = load i64, ptr %9, align 8, !tbaa !15
  %80 = add i64 %79, 1
  store i64 %80, ptr %9, align 8, !tbaa !15
  br label %47, !llvm.loop !20

81:                                               ; preds = %51
  br label %194

82:                                               ; preds = %25
  %83 = getelementptr inbounds %"class.rmg::Bitmap", ptr %19, i32 0, i32 2
  %84 = load i8, ptr %83, align 4, !tbaa !9
  %85 = zext i8 %84 to i32
  %86 = icmp eq i32 %85, 3
  br i1 %86, label %87, label %119

87:                                               ; preds = %82
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #4
  store i64 0, ptr %11, align 8, !tbaa !15
  br label %88

88:                                               ; preds = %111, %87
  %89 = load i64, ptr %11, align 8, !tbaa !15
  %90 = load i64, ptr %8, align 8, !tbaa !15
  %91 = icmp ult i64 %89, %90
  br i1 %91, label %93, label %92

92:                                               ; preds = %88
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #4
  br label %118

93:                                               ; preds = %88
  %94 = load ptr, ptr %6, align 8, !tbaa !5
  %95 = getelementptr inbounds i8, ptr %94, i64 0
  %96 = load i8, ptr %95, align 1, !tbaa !17
  %97 = load ptr, ptr %6, align 8, !tbaa !5
  %98 = getelementptr inbounds i8, ptr %97, i64 1
  %99 = load i8, ptr %98, align 1, !tbaa !17
  %100 = load ptr, ptr %6, align 8, !tbaa !5
  %101 = getelementptr inbounds i8, ptr %100, i64 2
  %102 = load i8, ptr %101, align 1, !tbaa !17
  %103 = invoke noundef float @_ZN3rmgL12getLuminanceEhhh(i8 noundef zeroext %96, i8 noundef zeroext %99, i8 noundef zeroext %102)
          to label %104 unwind label %114

104:                                              ; preds = %93
  %105 = fptoui float %103 to i8
  %106 = load ptr, ptr %7, align 8, !tbaa !5
  store i8 %105, ptr %106, align 1, !tbaa !17
  %107 = load ptr, ptr %6, align 8, !tbaa !5
  %108 = getelementptr inbounds i8, ptr %107, i64 3
  store ptr %108, ptr %6, align 8, !tbaa !5
  %109 = load ptr, ptr %7, align 8, !tbaa !5
  %110 = getelementptr inbounds i8, ptr %109, i64 1
  store ptr %110, ptr %7, align 8, !tbaa !5
  br label %111

111:                                              ; preds = %104
  %112 = load i64, ptr %11, align 8, !tbaa !15
  %113 = add i64 %112, 1
  store i64 %113, ptr %11, align 8, !tbaa !15
  br label %88, !llvm.loop !22

114:                                              ; preds = %93
  %115 = landingpad { ptr, i32 }
          cleanup
  %116 = extractvalue { ptr, i32 } %115, 0
  store ptr %116, ptr %12, align 8
  %117 = extractvalue { ptr, i32 } %115, 1
  store i32 %117, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #4
  br label %196

118:                                              ; preds = %92
  br label %193

119:                                              ; preds = %82
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #4
  store i64 0, ptr %14, align 8, !tbaa !15
  br label %120

120:                                              ; preds = %185, %119
  %121 = load i64, ptr %14, align 8, !tbaa !15
  %122 = load i64, ptr %8, align 8, !tbaa !15
  %123 = icmp ult i64 %121, %122
  br i1 %123, label %125, label %124

124:                                              ; preds = %120
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #4
  br label %192

125:                                              ; preds = %120
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #4
  %126 = load ptr, ptr %6, align 8, !tbaa !5
  %127 = getelementptr inbounds i8, ptr %126, i64 3
  %128 = load i8, ptr %127, align 1, !tbaa !17
  %129 = zext i8 %128 to i32
  %130 = sitofp i32 %129 to float
  %131 = fdiv float %130, 2.550000e+02
  store float %131, ptr %15, align 4, !tbaa !18
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #4
  %132 = load float, ptr %15, align 4, !tbaa !18
  %133 = load ptr, ptr %6, align 8, !tbaa !5
  %134 = getelementptr inbounds i8, ptr %133, i64 0
  %135 = load i8, ptr %134, align 1, !tbaa !17
  %136 = zext i8 %135 to i32
  %137 = sitofp i32 %136 to float
  %138 = call float @llvm.fmuladd.f32(float %132, float %137, float 2.555000e+02)
  %139 = load ptr, ptr %6, align 8, !tbaa !5
  %140 = getelementptr inbounds i8, ptr %139, i64 3
  %141 = load i8, ptr %140, align 1, !tbaa !17
  %142 = zext i8 %141 to i32
  %143 = sitofp i32 %142 to float
  %144 = fsub float %138, %143
  store float %144, ptr %16, align 4, !tbaa !18
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #4
  %145 = load float, ptr %15, align 4, !tbaa !18
  %146 = load ptr, ptr %6, align 8, !tbaa !5
  %147 = getelementptr inbounds i8, ptr %146, i64 1
  %148 = load i8, ptr %147, align 1, !tbaa !17
  %149 = zext i8 %148 to i32
  %150 = sitofp i32 %149 to float
  %151 = call float @llvm.fmuladd.f32(float %145, float %150, float 2.555000e+02)
  %152 = load ptr, ptr %6, align 8, !tbaa !5
  %153 = getelementptr inbounds i8, ptr %152, i64 3
  %154 = load i8, ptr %153, align 1, !tbaa !17
  %155 = zext i8 %154 to i32
  %156 = sitofp i32 %155 to float
  %157 = fsub float %151, %156
  store float %157, ptr %17, align 4, !tbaa !18
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #4
  %158 = load float, ptr %15, align 4, !tbaa !18
  %159 = load ptr, ptr %6, align 8, !tbaa !5
  %160 = getelementptr inbounds i8, ptr %159, i64 2
  %161 = load i8, ptr %160, align 1, !tbaa !17
  %162 = zext i8 %161 to i32
  %163 = sitofp i32 %162 to float
  %164 = call float @llvm.fmuladd.f32(float %158, float %163, float 2.555000e+02)
  %165 = load ptr, ptr %6, align 8, !tbaa !5
  %166 = getelementptr inbounds i8, ptr %165, i64 3
  %167 = load i8, ptr %166, align 1, !tbaa !17
  %168 = zext i8 %167 to i32
  %169 = sitofp i32 %168 to float
  %170 = fsub float %164, %169
  store float %170, ptr %18, align 4, !tbaa !18
  %171 = load float, ptr %16, align 4, !tbaa !18
  %172 = fptoui float %171 to i8
  %173 = load float, ptr %17, align 4, !tbaa !18
  %174 = fptoui float %173 to i8
  %175 = load float, ptr %18, align 4, !tbaa !18
  %176 = fptoui float %175 to i8
  %177 = invoke noundef float @_ZN3rmgL12getLuminanceEhhh(i8 noundef zeroext %172, i8 noundef zeroext %174, i8 noundef zeroext %176)
          to label %178 unwind label %188

178:                                              ; preds = %125
  %179 = fptoui float %177 to i8
  %180 = load ptr, ptr %7, align 8, !tbaa !5
  store i8 %179, ptr %180, align 1, !tbaa !17
  %181 = load ptr, ptr %6, align 8, !tbaa !5
  %182 = getelementptr inbounds i8, ptr %181, i64 4
  store ptr %182, ptr %6, align 8, !tbaa !5
  %183 = load ptr, ptr %7, align 8, !tbaa !5
  %184 = getelementptr inbounds i8, ptr %183, i64 1
  store ptr %184, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #4
  br label %185

185:                                              ; preds = %178
  %186 = load i64, ptr %14, align 8, !tbaa !15
  %187 = add i64 %186, 1
  store i64 %187, ptr %14, align 8, !tbaa !15
  br label %120, !llvm.loop !23

188:                                              ; preds = %125
  %189 = landingpad { ptr, i32 }
          cleanup
  %190 = extractvalue { ptr, i32 } %189, 0
  store ptr %190, ptr %12, align 8
  %191 = extractvalue { ptr, i32 } %189, 1
  store i32 %191, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #4
  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 8, ptr %14) #4
  br label %196

192:                                              ; preds = %124
  br label %193

193:                                              ; preds = %192, %118
  br label %194

194:                                              ; preds = %193, %81
  store i1 true, ptr %5, align 1
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #4
  %195 = load i1, ptr %5, align 1
  br i1 %195, label %198, label %197

196:                                              ; preds = %188, %114
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #4
  call void @_ZN3rmg6BitmapD1Ev(ptr noundef nonnull align 8 dereferenceable(16) %0) #4
  br label %200

197:                                              ; preds = %194
  call void @_ZN3rmg6BitmapD1Ev(ptr noundef nonnull align 8 dereferenceable(16) %0) #4
  br label %198

198:                                              ; preds = %197, %194
  br label %199

199:                                              ; preds = %198, %24
  ret void

200:                                              ; preds = %196
  %201 = load ptr, ptr %12, align 8
  %202 = load i32, ptr %13, align 4
  %203 = insertvalue { ptr, i32 } poison, ptr %201, 0
  %204 = insertvalue { ptr, i32 } %203, i32 %202, 1
  resume { ptr, i32 } %204
}

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

; Function Attrs: mustprogress nounwind uwtable
declare hidden noundef float @_ZN3rmgL12getLuminanceEhhh(i8 noundef zeroext, i8 noundef zeroext, i8 noundef zeroext) #3

declare i32 @__gxx_personality_v0(...)

declare void @_ZN3rmg6BitmapC1Etth(ptr, i16, i16, i8)

declare void @_ZN3rmg6BitmapD1Ev(ptr)

declare void @_ZN3rmg6BitmapC1ERKS0_(ptr, ptr)

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


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

%"class.rmg::Bitmap" = type { i16, i16, i8, ptr }

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK3rmg6Bitmap11toGrayscaleEv(ptr dead_on_unwind noalias writable sret(%"class.rmg::Bitmap") align 8 %0, ptr noundef nonnull align 8 dereferenceable(16) %1) local_unnamed_addr #0 align 2 personality ptr @__gxx_personality_v0 {
  %3 = getelementptr inbounds i8, ptr %1, i64 4
  %4 = load i8, ptr %3, align 4, !tbaa !5
  %5 = icmp eq i8 %4, 1
  br i1 %5, label %6, label %7

6:                                                ; preds = %2
  tail call void @_ZN3rmg6BitmapC1ERKS0_(ptr noundef nonnull align 8 dereferenceable(16) %0, ptr noundef nonnull align 8 dereferenceable(16) %1)
  br label %.loopexit

7:                                                ; preds = %2
  %8 = load i16, ptr %1, align 8, !tbaa !11
  %9 = getelementptr inbounds i8, ptr %1, i64 2
  %10 = load i16, ptr %9, align 2, !tbaa !12
  tail call void @_ZN3rmg6BitmapC1Etth(ptr noundef nonnull align 8 dereferenceable(16) %0, i16 noundef zeroext %8, i16 noundef zeroext %10, i8 noundef zeroext 1)
  %11 = getelementptr inbounds i8, ptr %1, i64 8
  %12 = load ptr, ptr %11, align 8, !tbaa !13
  %13 = getelementptr inbounds i8, ptr %0, i64 8
  %14 = load ptr, ptr %13, align 8, !tbaa !13
  %15 = load i16, ptr %1, align 8, !tbaa !11
  %16 = zext i16 %15 to i64
  %17 = load i16, ptr %9, align 2, !tbaa !12
  %18 = zext i16 %17 to i64
  %19 = mul nuw nsw i64 %18, %16
  %20 = load i8, ptr %3, align 4, !tbaa !5
  %.not62 = icmp eq i64 %19, 0
  switch i8 %20, label %.preheader [
    i8 2, label %.preheader46
    i8 3, label %.preheader48
  ]

.preheader48:                                     ; preds = %7
  br i1 %.not62, label %.loopexit, label %.lr.ph

.preheader46:                                     ; preds = %7
  br i1 %.not62, label %.loopexit, label %iter.check

iter.check:                                       ; preds = %.preheader46
  %min.iters.check = icmp ult i64 %19, 8
  br i1 %min.iters.check, label %.lr.ph56.preheader, label %vector.memcheck

vector.memcheck:                                  ; preds = %iter.check
  %scevgep = getelementptr i8, ptr %14, i64 %19
  %21 = mul nuw nsw i64 %18, %16
  %22 = shl nuw nsw i64 %21, 1
  %scevgep71 = getelementptr i8, ptr %12, i64 %22
  %bound0 = icmp ult ptr %14, %scevgep71
  %bound1 = icmp ult ptr %12, %scevgep
  %found.conflict = and i1 %bound0, %bound1
  br i1 %found.conflict, label %.lr.ph56.preheader, label %vector.main.loop.iter.check

vector.main.loop.iter.check:                      ; preds = %vector.memcheck
  %min.iters.check72 = icmp ult i64 %19, 16
  br i1 %min.iters.check72, label %vec.epilog.ph, label %vector.ph

vector.ph:                                        ; preds = %vector.main.loop.iter.check
  %n.vec = and i64 %19, 4294967280
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %offset.idx = shl i64 %index, 1
  %23 = or disjoint i64 %offset.idx, 2
  %24 = or disjoint i64 %offset.idx, 4
  %25 = or disjoint i64 %offset.idx, 6
  %26 = or disjoint i64 %offset.idx, 8
  %27 = or disjoint i64 %offset.idx, 10
  %28 = or disjoint i64 %offset.idx, 12
  %29 = or disjoint i64 %offset.idx, 14
  %30 = or disjoint i64 %offset.idx, 16
  %31 = or disjoint i64 %offset.idx, 18
  %32 = or disjoint i64 %offset.idx, 20
  %33 = or disjoint i64 %offset.idx, 22
  %34 = or disjoint i64 %offset.idx, 24
  %35 = or disjoint i64 %offset.idx, 26
  %36 = or disjoint i64 %offset.idx, 28
  %37 = or disjoint i64 %offset.idx, 30
  %next.gep = getelementptr i8, ptr %12, i64 %offset.idx
  %next.gep73 = getelementptr i8, ptr %12, i64 %23
  %next.gep74 = getelementptr i8, ptr %12, i64 %24
  %next.gep75 = getelementptr i8, ptr %12, i64 %25
  %next.gep76 = getelementptr i8, ptr %12, i64 %26
  %next.gep77 = getelementptr i8, ptr %12, i64 %27
  %next.gep78 = getelementptr i8, ptr %12, i64 %28
  %next.gep79 = getelementptr i8, ptr %12, i64 %29
  %next.gep80 = getelementptr i8, ptr %12, i64 %30
  %next.gep81 = getelementptr i8, ptr %12, i64 %31
  %next.gep82 = getelementptr i8, ptr %12, i64 %32
  %next.gep83 = getelementptr i8, ptr %12, i64 %33
  %next.gep84 = getelementptr i8, ptr %12, i64 %34
  %next.gep85 = getelementptr i8, ptr %12, i64 %35
  %next.gep86 = getelementptr i8, ptr %12, i64 %36
  %next.gep87 = getelementptr i8, ptr %12, i64 %37
  %next.gep88 = getelementptr i8, ptr %14, i64 %index
  %38 = getelementptr inbounds i8, ptr %next.gep, i64 1
  %39 = getelementptr inbounds i8, ptr %next.gep73, i64 1
  %40 = getelementptr inbounds i8, ptr %next.gep74, i64 1
  %41 = getelementptr inbounds i8, ptr %next.gep75, i64 1
  %42 = getelementptr inbounds i8, ptr %next.gep76, i64 1
  %43 = getelementptr inbounds i8, ptr %next.gep77, i64 1
  %44 = getelementptr inbounds i8, ptr %next.gep78, i64 1
  %45 = getelementptr inbounds i8, ptr %next.gep79, i64 1
  %46 = getelementptr inbounds i8, ptr %next.gep80, i64 1
  %47 = getelementptr inbounds i8, ptr %next.gep81, i64 1
  %48 = getelementptr inbounds i8, ptr %next.gep82, i64 1
  %49 = getelementptr inbounds i8, ptr %next.gep83, i64 1
  %50 = getelementptr inbounds i8, ptr %next.gep84, i64 1
  %51 = getelementptr inbounds i8, ptr %next.gep85, i64 1
  %52 = getelementptr inbounds i8, ptr %next.gep86, i64 1
  %53 = getelementptr inbounds i8, ptr %next.gep87, i64 1
  %54 = load i8, ptr %38, align 1, !tbaa !14, !alias.scope !15
  %55 = load i8, ptr %39, align 1, !tbaa !14, !alias.scope !15
  %56 = load i8, ptr %40, align 1, !tbaa !14, !alias.scope !15
  %57 = load i8, ptr %41, align 1, !tbaa !14, !alias.scope !15
  %58 = load i8, ptr %42, align 1, !tbaa !14, !alias.scope !15
  %59 = load i8, ptr %43, align 1, !tbaa !14, !alias.scope !15
  %60 = load i8, ptr %44, align 1, !tbaa !14, !alias.scope !15
  %61 = load i8, ptr %45, align 1, !tbaa !14, !alias.scope !15
  %62 = load i8, ptr %46, align 1, !tbaa !14, !alias.scope !15
  %63 = load i8, ptr %47, align 1, !tbaa !14, !alias.scope !15
  %64 = load i8, ptr %48, align 1, !tbaa !14, !alias.scope !15
  %65 = load i8, ptr %49, align 1, !tbaa !14, !alias.scope !15
  %66 = load i8, ptr %50, align 1, !tbaa !14, !alias.scope !15
  %67 = load i8, ptr %51, align 1, !tbaa !14, !alias.scope !15
  %68 = load i8, ptr %52, align 1, !tbaa !14, !alias.scope !15
  %69 = load i8, ptr %53, align 1, !tbaa !14, !alias.scope !15
  %70 = insertelement <16 x i8> poison, i8 %54, i64 0
  %71 = insertelement <16 x i8> %70, i8 %55, i64 1
  %72 = insertelement <16 x i8> %71, i8 %56, i64 2
  %73 = insertelement <16 x i8> %72, i8 %57, i64 3
  %74 = insertelement <16 x i8> %73, i8 %58, i64 4
  %75 = insertelement <16 x i8> %74, i8 %59, i64 5
  %76 = insertelement <16 x i8> %75, i8 %60, i64 6
  %77 = insertelement <16 x i8> %76, i8 %61, i64 7
  %78 = insertelement <16 x i8> %77, i8 %62, i64 8
  %79 = insertelement <16 x i8> %78, i8 %63, i64 9
  %80 = insertelement <16 x i8> %79, i8 %64, i64 10
  %81 = insertelement <16 x i8> %80, i8 %65, i64 11
  %82 = insertelement <16 x i8> %81, i8 %66, i64 12
  %83 = insertelement <16 x i8> %82, i8 %67, i64 13
  %84 = insertelement <16 x i8> %83, i8 %68, i64 14
  %85 = insertelement <16 x i8> %84, i8 %69, i64 15
  %86 = uitofp <16 x i8> %85 to <16 x float>
  %87 = fdiv <16 x float> %86, <float 2.550000e+02, float 2.550000e+02, float 2.550000e+02, float 2.550000e+02, float 2.550000e+02, float 2.550000e+02, float 2.550000e+02, float 2.550000e+02, float 2.550000e+02, float 2.550000e+02, float 2.550000e+02, float 2.550000e+02, float 2.550000e+02, float 2.550000e+02, float 2.550000e+02, float 2.550000e+02>
  %88 = load i8, ptr %next.gep, align 1, !tbaa !14, !alias.scope !15
  %89 = load i8, ptr %next.gep73, align 1, !tbaa !14, !alias.scope !15
  %90 = load i8, ptr %next.gep74, align 1, !tbaa !14, !alias.scope !15
  %91 = load i8, ptr %next.gep75, align 1, !tbaa !14, !alias.scope !15
  %92 = load i8, ptr %next.gep76, align 1, !tbaa !14, !alias.scope !15
  %93 = load i8, ptr %next.gep77, align 1, !tbaa !14, !alias.scope !15
  %94 = load i8, ptr %next.gep78, align 1, !tbaa !14, !alias.scope !15
  %95 = load i8, ptr %next.gep79, align 1, !tbaa !14, !alias.scope !15
  %96 = load i8, ptr %next.gep80, align 1, !tbaa !14, !alias.scope !15
  %97 = load i8, ptr %next.gep81, align 1, !tbaa !14, !alias.scope !15
  %98 = load i8, ptr %next.gep82, align 1, !tbaa !14, !alias.scope !15
  %99 = load i8, ptr %next.gep83, align 1, !tbaa !14, !alias.scope !15
  %100 = load i8, ptr %next.gep84, align 1, !tbaa !14, !alias.scope !15
  %101 = load i8, ptr %next.gep85, align 1, !tbaa !14, !alias.scope !15
  %102 = load i8, ptr %next.gep86, align 1, !tbaa !14, !alias.scope !15
  %103 = load i8, ptr %next.gep87, align 1, !tbaa !14, !alias.scope !15
  %104 = insertelement <16 x i8> poison, i8 %88, i64 0
  %105 = insertelement <16 x i8> %104, i8 %89, i64 1
  %106 = insertelement <16 x i8> %105, i8 %90, i64 2
  %107 = insertelement <16 x i8> %106, i8 %91, i64 3
  %108 = insertelement <16 x i8> %107, i8 %92, i64 4
  %109 = insertelement <16 x i8> %108, i8 %93, i64 5
  %110 = insertelement <16 x i8> %109, i8 %94, i64 6
  %111 = insertelement <16 x i8> %110, i8 %95, i64 7
  %112 = insertelement <16 x i8> %111, i8 %96, i64 8
  %113 = insertelement <16 x i8> %112, i8 %97, i64 9
  %114 = insertelement <16 x i8> %113, i8 %98, i64 10
  %115 = insertelement <16 x i8> %114, i8 %99, i64 11
  %116 = insertelement <16 x i8> %115, i8 %100, i64 12
  %117 = insertelement <16 x i8> %116, i8 %101, i64 13
  %118 = insertelement <16 x i8> %117, i8 %102, i64 14
  %119 = insertelement <16 x i8> %118, i8 %103, i64 15
  %120 = uitofp <16 x i8> %119 to <16 x float>
  %121 = tail call <16 x float> @llvm.fmuladd.v16f32(<16 x float> %87, <16 x float> %120, <16 x float> <float 2.555000e+02, float 2.555000e+02, float 2.555000e+02, float 2.555000e+02, float 2.555000e+02, float 2.555000e+02, float 2.555000e+02, float 2.555000e+02, float 2.555000e+02, float 2.555000e+02, float 2.555000e+02, float 2.555000e+02, float 2.555000e+02, float 2.555000e+02, float 2.555000e+02, float 2.555000e+02>)
  %122 = fsub <16 x float> %121, %86
  %123 = fptoui <16 x float> %122 to <16 x i8>
  store <16 x i8> %123, ptr %next.gep88, align 1, !tbaa !14, !alias.scope !18, !noalias !15
  %index.next = add nuw i64 %index, 16
  %124 = icmp eq i64 %index.next, %n.vec
  br i1 %124, label %middle.block, label %vector.body, !llvm.loop !20

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %19, %n.vec
  br i1 %cmp.n, label %.loopexit, label %vec.epilog.iter.check

vec.epilog.iter.check:                            ; preds = %middle.block
  %ind.end93 = getelementptr i8, ptr %14, i64 %n.vec
  %125 = shl nuw nsw i64 %n.vec, 1
  %ind.end91 = getelementptr i8, ptr %12, i64 %125
  %n.vec.remaining = and i64 %19, 8
  %min.epilog.iters.check.not.not = icmp eq i64 %n.vec.remaining, 0
  br i1 %min.epilog.iters.check.not.not, label %.lr.ph56.preheader, label %vec.epilog.ph

.lr.ph56.preheader:                               ; preds = %vec.epilog.middle.block, %vector.memcheck, %iter.check, %vec.epilog.iter.check
  %.055.ph = phi ptr [ %12, %iter.check ], [ %12, %vector.memcheck ], [ %ind.end91, %vec.epilog.iter.check ], [ %ind.end, %vec.epilog.middle.block ]
  %.03954.ph = phi ptr [ %14, %iter.check ], [ %14, %vector.memcheck ], [ %ind.end93, %vec.epilog.iter.check ], [ %ind.end92, %vec.epilog.middle.block ]
  %.04253.ph = phi i64 [ 0, %iter.check ], [ 0, %vector.memcheck ], [ %n.vec, %vec.epilog.iter.check ], [ %n.vec90, %vec.epilog.middle.block ]
  %.neg = or disjoint i64 %.04253.ph, 1
  %xtraiter = and i64 %19, 1
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.lr.ph56.prol.loopexit, label %.lr.ph56.prol

.lr.ph56.prol:                                    ; preds = %.lr.ph56.preheader
  %126 = getelementptr inbounds i8, ptr %.055.ph, i64 1
  %127 = load i8, ptr %126, align 1, !tbaa !14
  %128 = uitofp i8 %127 to float
  %129 = fdiv float %128, 2.550000e+02
  %130 = load i8, ptr %.055.ph, align 1, !tbaa !14
  %131 = uitofp i8 %130 to float
  %132 = tail call float @llvm.fmuladd.f32(float %129, float %131, float 2.555000e+02)
  %133 = fsub float %132, %128
  %134 = fptoui float %133 to i8
  store i8 %134, ptr %.03954.ph, align 1, !tbaa !14
  %135 = getelementptr inbounds i8, ptr %.055.ph, i64 2
  %136 = getelementptr inbounds i8, ptr %.03954.ph, i64 1
  %137 = or disjoint i64 %.04253.ph, 1
  br label %.lr.ph56.prol.loopexit

.lr.ph56.prol.loopexit:                           ; preds = %.lr.ph56.prol, %.lr.ph56.preheader
  %.055.unr = phi ptr [ %.055.ph, %.lr.ph56.preheader ], [ %135, %.lr.ph56.prol ]
  %.03954.unr = phi ptr [ %.03954.ph, %.lr.ph56.preheader ], [ %136, %.lr.ph56.prol ]
  %.04253.unr = phi i64 [ %.04253.ph, %.lr.ph56.preheader ], [ %137, %.lr.ph56.prol ]
  %138 = icmp eq i64 %19, %.neg
  br i1 %138, label %.loopexit, label %.lr.ph56

vec.epilog.ph:                                    ; preds = %vector.main.loop.iter.check, %vec.epilog.iter.check
  %vec.epilog.resume.val = phi i64 [ %n.vec, %vec.epilog.iter.check ], [ 0, %vector.main.loop.iter.check ]
  %n.vec90 = and i64 %19, 4294967288
  %139 = shl nuw nsw i64 %n.vec90, 1
  %ind.end = getelementptr i8, ptr %12, i64 %139
  %ind.end92 = getelementptr i8, ptr %14, i64 %n.vec90
  br label %vec.epilog.vector.body

vec.epilog.vector.body:                           ; preds = %vec.epilog.vector.body, %vec.epilog.ph
  %index96 = phi i64 [ %vec.epilog.resume.val, %vec.epilog.ph ], [ %index.next107, %vec.epilog.vector.body ]
  %offset.idx97 = shl i64 %index96, 1
  %140 = or disjoint i64 %offset.idx97, 2
  %141 = or disjoint i64 %offset.idx97, 4
  %142 = or disjoint i64 %offset.idx97, 6
  %143 = or disjoint i64 %offset.idx97, 8
  %144 = or disjoint i64 %offset.idx97, 10
  %145 = or disjoint i64 %offset.idx97, 12
  %146 = or disjoint i64 %offset.idx97, 14
  %next.gep98 = getelementptr i8, ptr %12, i64 %offset.idx97
  %next.gep99 = getelementptr i8, ptr %12, i64 %140
  %next.gep100 = getelementptr i8, ptr %12, i64 %141
  %next.gep101 = getelementptr i8, ptr %12, i64 %142
  %next.gep102 = getelementptr i8, ptr %12, i64 %143
  %next.gep103 = getelementptr i8, ptr %12, i64 %144
  %next.gep104 = getelementptr i8, ptr %12, i64 %145
  %next.gep105 = getelementptr i8, ptr %12, i64 %146
  %next.gep106 = getelementptr i8, ptr %14, i64 %index96
  %147 = getelementptr inbounds i8, ptr %next.gep98, i64 1
  %148 = getelementptr inbounds i8, ptr %next.gep99, i64 1
  %149 = getelementptr inbounds i8, ptr %next.gep100, i64 1
  %150 = getelementptr inbounds i8, ptr %next.gep101, i64 1
  %151 = getelementptr inbounds i8, ptr %next.gep102, i64 1
  %152 = getelementptr inbounds i8, ptr %next.gep103, i64 1
  %153 = getelementptr inbounds i8, ptr %next.gep104, i64 1
  %154 = getelementptr inbounds i8, ptr %next.gep105, i64 1
  %155 = load i8, ptr %147, align 1, !tbaa !14, !alias.scope !24
  %156 = load i8, ptr %148, align 1, !tbaa !14, !alias.scope !24
  %157 = load i8, ptr %149, align 1, !tbaa !14, !alias.scope !24
  %158 = load i8, ptr %150, align 1, !tbaa !14, !alias.scope !24
  %159 = load i8, ptr %151, align 1, !tbaa !14, !alias.scope !24
  %160 = load i8, ptr %152, align 1, !tbaa !14, !alias.scope !24
  %161 = load i8, ptr %153, align 1, !tbaa !14, !alias.scope !24
  %162 = load i8, ptr %154, align 1, !tbaa !14, !alias.scope !24
  %163 = insertelement <8 x i8> poison, i8 %155, i64 0
  %164 = insertelement <8 x i8> %163, i8 %156, i64 1
  %165 = insertelement <8 x i8> %164, i8 %157, i64 2
  %166 = insertelement <8 x i8> %165, i8 %158, i64 3
  %167 = insertelement <8 x i8> %166, i8 %159, i64 4
  %168 = insertelement <8 x i8> %167, i8 %160, i64 5
  %169 = insertelement <8 x i8> %168, i8 %161, i64 6
  %170 = insertelement <8 x i8> %169, i8 %162, i64 7
  %171 = uitofp <8 x i8> %170 to <8 x float>
  %172 = fdiv <8 x float> %171, <float 2.550000e+02, float 2.550000e+02, float 2.550000e+02, float 2.550000e+02, float 2.550000e+02, float 2.550000e+02, float 2.550000e+02, float 2.550000e+02>
  %173 = load i8, ptr %next.gep98, align 1, !tbaa !14, !alias.scope !24
  %174 = load i8, ptr %next.gep99, align 1, !tbaa !14, !alias.scope !24
  %175 = load i8, ptr %next.gep100, align 1, !tbaa !14, !alias.scope !24
  %176 = load i8, ptr %next.gep101, align 1, !tbaa !14, !alias.scope !24
  %177 = load i8, ptr %next.gep102, align 1, !tbaa !14, !alias.scope !24
  %178 = load i8, ptr %next.gep103, align 1, !tbaa !14, !alias.scope !24
  %179 = load i8, ptr %next.gep104, align 1, !tbaa !14, !alias.scope !24
  %180 = load i8, ptr %next.gep105, align 1, !tbaa !14, !alias.scope !24
  %181 = insertelement <8 x i8> poison, i8 %173, i64 0
  %182 = insertelement <8 x i8> %181, i8 %174, i64 1
  %183 = insertelement <8 x i8> %182, i8 %175, i64 2
  %184 = insertelement <8 x i8> %183, i8 %176, i64 3
  %185 = insertelement <8 x i8> %184, i8 %177, i64 4
  %186 = insertelement <8 x i8> %185, i8 %178, i64 5
  %187 = insertelement <8 x i8> %186, i8 %179, i64 6
  %188 = insertelement <8 x i8> %187, i8 %180, i64 7
  %189 = uitofp <8 x i8> %188 to <8 x float>
  %190 = tail call <8 x float> @llvm.fmuladd.v8f32(<8 x float> %172, <8 x float> %189, <8 x float> <float 2.555000e+02, float 2.555000e+02, float 2.555000e+02, float 2.555000e+02, float 2.555000e+02, float 2.555000e+02, float 2.555000e+02, float 2.555000e+02>)
  %191 = fsub <8 x float> %190, %171
  %192 = fptoui <8 x float> %191 to <8 x i8>
  store <8 x i8> %192, ptr %next.gep106, align 1, !tbaa !14, !alias.scope !27, !noalias !24
  %index.next107 = add nuw i64 %index96, 8
  %193 = icmp eq i64 %index.next107, %n.vec90
  br i1 %193, label %vec.epilog.middle.block, label %vec.epilog.vector.body, !llvm.loop !29

vec.epilog.middle.block:                          ; preds = %vec.epilog.vector.body
  %cmp.n108 = icmp eq i64 %19, %n.vec90
  br i1 %cmp.n108, label %.loopexit, label %.lr.ph56.preheader

.preheader:                                       ; preds = %7
  br i1 %.not62, label %.loopexit, label %.lr.ph60

.lr.ph56:                                         ; preds = %.lr.ph56.prol.loopexit, %.lr.ph56
  %.055 = phi ptr [ %214, %.lr.ph56 ], [ %.055.unr, %.lr.ph56.prol.loopexit ]
  %.03954 = phi ptr [ %215, %.lr.ph56 ], [ %.03954.unr, %.lr.ph56.prol.loopexit ]
  %.04253 = phi i64 [ %216, %.lr.ph56 ], [ %.04253.unr, %.lr.ph56.prol.loopexit ]
  %194 = getelementptr inbounds i8, ptr %.055, i64 1
  %195 = load i8, ptr %194, align 1, !tbaa !14
  %196 = uitofp i8 %195 to float
  %197 = fdiv float %196, 2.550000e+02
  %198 = load i8, ptr %.055, align 1, !tbaa !14
  %199 = uitofp i8 %198 to float
  %200 = tail call float @llvm.fmuladd.f32(float %197, float %199, float 2.555000e+02)
  %201 = fsub float %200, %196
  %202 = fptoui float %201 to i8
  store i8 %202, ptr %.03954, align 1, !tbaa !14
  %203 = getelementptr inbounds i8, ptr %.055, i64 2
  %204 = getelementptr inbounds i8, ptr %.03954, i64 1
  %205 = getelementptr inbounds i8, ptr %.055, i64 3
  %206 = load i8, ptr %205, align 1, !tbaa !14
  %207 = uitofp i8 %206 to float
  %208 = fdiv float %207, 2.550000e+02
  %209 = load i8, ptr %203, align 1, !tbaa !14
  %210 = uitofp i8 %209 to float
  %211 = tail call float @llvm.fmuladd.f32(float %208, float %210, float 2.555000e+02)
  %212 = fsub float %211, %207
  %213 = fptoui float %212 to i8
  store i8 %213, ptr %204, align 1, !tbaa !14
  %214 = getelementptr inbounds i8, ptr %.055, i64 4
  %215 = getelementptr inbounds i8, ptr %.03954, i64 2
  %216 = add nuw nsw i64 %.04253, 2
  %exitcond65.not.1 = icmp eq i64 %216, %19
  br i1 %exitcond65.not.1, label %.loopexit, label %.lr.ph56, !llvm.loop !30

.lr.ph:                                           ; preds = %.preheader48, %.lr.ph
  %.152 = phi ptr [ %224, %.lr.ph ], [ %12, %.preheader48 ]
  %.14051 = phi ptr [ %225, %.lr.ph ], [ %14, %.preheader48 ]
  %.04450 = phi i64 [ %226, %.lr.ph ], [ 0, %.preheader48 ]
  %217 = load i8, ptr %.152, align 1, !tbaa !14
  %218 = getelementptr inbounds i8, ptr %.152, i64 1
  %219 = load i8, ptr %218, align 1, !tbaa !14
  %220 = getelementptr inbounds i8, ptr %.152, i64 2
  %221 = load i8, ptr %220, align 1, !tbaa !14
  %222 = tail call noundef float @_ZN3rmgL12getLuminanceEhhh(i8 noundef zeroext %217, i8 noundef zeroext %219, i8 noundef zeroext %221)
  %223 = fptoui float %222 to i8
  store i8 %223, ptr %.14051, align 1, !tbaa !14
  %224 = getelementptr inbounds i8, ptr %.152, i64 3
  %225 = getelementptr inbounds i8, ptr %.14051, i64 1
  %226 = add nuw nsw i64 %.04450, 1
  %exitcond.not = icmp eq i64 %226, %19
  br i1 %exitcond.not, label %.loopexit, label %.lr.ph, !llvm.loop !31

.lr.ph60:                                         ; preds = %.preheader, %.lr.ph60
  %.259 = phi ptr [ %250, %.lr.ph60 ], [ %12, %.preheader ]
  %.24158 = phi ptr [ %251, %.lr.ph60 ], [ %14, %.preheader ]
  %.04357 = phi i64 [ %252, %.lr.ph60 ], [ 0, %.preheader ]
  %227 = getelementptr inbounds i8, ptr %.259, i64 3
  %228 = load i8, ptr %227, align 1, !tbaa !14
  %229 = uitofp i8 %228 to float
  %230 = fdiv float %229, 2.550000e+02
  %231 = load i8, ptr %.259, align 1, !tbaa !14
  %232 = uitofp i8 %231 to float
  %233 = tail call float @llvm.fmuladd.f32(float %230, float %232, float 2.555000e+02)
  %234 = fsub float %233, %229
  %235 = getelementptr inbounds i8, ptr %.259, i64 1
  %236 = load i8, ptr %235, align 1, !tbaa !14
  %237 = uitofp i8 %236 to float
  %238 = tail call float @llvm.fmuladd.f32(float %230, float %237, float 2.555000e+02)
  %239 = fsub float %238, %229
  %240 = getelementptr inbounds i8, ptr %.259, i64 2
  %241 = load i8, ptr %240, align 1, !tbaa !14
  %242 = uitofp i8 %241 to float
  %243 = tail call float @llvm.fmuladd.f32(float %230, float %242, float 2.555000e+02)
  %244 = fsub float %243, %229
  %245 = fptoui float %234 to i8
  %246 = fptoui float %239 to i8
  %247 = fptoui float %244 to i8
  %248 = tail call noundef float @_ZN3rmgL12getLuminanceEhhh(i8 noundef zeroext %245, i8 noundef zeroext %246, i8 noundef zeroext %247)
  %249 = fptoui float %248 to i8
  store i8 %249, ptr %.24158, align 1, !tbaa !14
  %250 = getelementptr inbounds i8, ptr %.259, i64 4
  %251 = getelementptr inbounds i8, ptr %.24158, i64 1
  %252 = add nuw nsw i64 %.04357, 1
  %exitcond66.not = icmp eq i64 %252, %19
  br i1 %exitcond66.not, label %.loopexit, label %.lr.ph60, !llvm.loop !32

.loopexit:                                        ; preds = %.lr.ph, %.lr.ph56.prol.loopexit, %.lr.ph56, %.lr.ph60, %middle.block, %vec.epilog.middle.block, %.preheader48, %.preheader46, %.preheader, %6
  ret void
}

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

; Function Attrs: mustprogress nounwind uwtable
declare hidden noundef float @_ZN3rmgL12getLuminanceEhhh(i8 noundef zeroext, i8 noundef zeroext, i8 noundef zeroext) local_unnamed_addr #2

declare i32 @__gxx_personality_v0(...)

declare void @_ZN3rmg6BitmapC1Etth(ptr, i16, i16, i8) local_unnamed_addr

declare void @_ZN3rmg6BitmapC1ERKS0_(ptr, ptr) local_unnamed_addr

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <16 x float> @llvm.fmuladd.v16f32(<16 x float>, <16 x float>, <16 x float>) #3

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <8 x float> @llvm.fmuladd.v8f32(<8 x float>, <8 x float>, <8 x float>) #3

attributes #0 = { mustprogress 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 #1 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #2 = { mustprogress 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) }

!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, !8, i64 4}
!6 = !{!"_ZTSN3rmg6BitmapE", !7, i64 0, !7, i64 2, !8, i64 4, !10, i64 8}
!7 = !{!"short", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!6, !7, i64 0}
!12 = !{!6, !7, i64 2}
!13 = !{!6, !10, i64 8}
!14 = !{!8, !8, i64 0}
!15 = !{!16}
!16 = distinct !{!16, !17}
!17 = distinct !{!17, !"LVerDomain"}
!18 = !{!19}
!19 = distinct !{!19, !17}
!20 = distinct !{!20, !21, !22, !23}
!21 = !{!"llvm.loop.mustprogress"}
!22 = !{!"llvm.loop.isvectorized", i32 1}
!23 = !{!"llvm.loop.unroll.runtime.disable"}
!24 = !{!25}
!25 = distinct !{!25, !26}
!26 = distinct !{!26, !"LVerDomain"}
!27 = !{!28}
!28 = distinct !{!28, !26}
!29 = distinct !{!29, !21, !22, !23}
!30 = distinct !{!30, !21, !22}
!31 = distinct !{!31, !21}
!32 = distinct !{!32, !21}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LoopLoadEliminationPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,LoopVectorizePass,ReassociatePass,SCCPPass,SROAPass,SimplifyCFGPass,TailCallElimPass