; LLVM IR from sejja/3D-Software-Rasterizer :: Rasterizer/Engine/Graphics/Rasterizer (DrawTriangle)

; 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.Point4 = type { %union.anon }
%union.anon = type { [4 x float] }
%struct.anon = type { float, float, float, float }
%"struct.Graphics::Color" = type { float, float, float }

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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: noinline noreturn nounwind uwtable
declare hidden void @__clang_call_terminate(ptr 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 nosync nounwind speculatable willreturn memory(none)
declare float @llvm.floor.f32(float) #2

declare void @_ZN11FrameBuffer8SetPixelEjjfhhh(i32 noundef, i32 noundef, float noundef, i8 noundef zeroext, i8 noundef zeroext, i8 noundef zeroext) #3

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_ZN8Graphics10Rasterizer8DrawLineERK6Point4S3_RKNS_5ColorE(ptr noundef nonnull align 4 dereferenceable(16) %0, ptr noundef nonnull align 4 dereferenceable(16) %1, ptr noundef nonnull align 4 dereferenceable(12) %2) #4 personality ptr @__gxx_personality_v0 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca float, align 4
  %8 = alloca float, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  %22 = alloca i32, align 4
  %23 = alloca i32, align 4
  %24 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  store ptr %2, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  %25 = load ptr, ptr %5, align 8, !tbaa !5
  %26 = getelementptr inbounds %class.Point4, ptr %25, i32 0, i32 0
  %27 = getelementptr inbounds %struct.anon, ptr %26, i32 0, i32 0
  %28 = load float, ptr %27, align 4, !tbaa !9
  %29 = load ptr, ptr %4, align 8, !tbaa !5
  %30 = getelementptr inbounds %class.Point4, ptr %29, i32 0, i32 0
  %31 = getelementptr inbounds %struct.anon, ptr %30, i32 0, i32 0
  %32 = load float, ptr %31, align 4, !tbaa !9
  %33 = fsub float %28, %32
  store float %33, ptr %7, align 4, !tbaa !10
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  %34 = load ptr, ptr %5, align 8, !tbaa !5
  %35 = getelementptr inbounds %class.Point4, ptr %34, i32 0, i32 0
  %36 = getelementptr inbounds %struct.anon, ptr %35, i32 0, i32 1
  %37 = load float, ptr %36, align 4, !tbaa !9
  %38 = load ptr, ptr %4, align 8, !tbaa !5
  %39 = getelementptr inbounds %class.Point4, ptr %38, i32 0, i32 0
  %40 = getelementptr inbounds %struct.anon, ptr %39, i32 0, i32 1
  %41 = load float, ptr %40, align 4, !tbaa !9
  %42 = fsub float %37, %41
  store float %42, ptr %8, align 4, !tbaa !10
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  %43 = load float, ptr %7, align 4, !tbaa !10
  %44 = fcmp ogt float %43, 0.000000e+00
  %45 = zext i1 %44 to i64
  %46 = select i1 %44, i32 1, i32 -1
  store i32 %46, ptr %9, align 4, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  %47 = load float, ptr %8, align 4, !tbaa !10
  %48 = fcmp ogt float %47, 0.000000e+00
  %49 = zext i1 %48 to i64
  %50 = select i1 %48, i32 1, i32 -1
  store i32 %50, ptr %10, align 4, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  %51 = load float, ptr %7, align 4, !tbaa !10
  %52 = call float @llvm.floor.f32(float %51)
  %53 = fptosi float %52 to i32
  %54 = call i32 @llvm.abs.i32(i32 %53, i1 true)
  store i32 %54, ptr %11, align 4, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  %55 = load float, ptr %8, align 4, !tbaa !10
  %56 = call float @llvm.floor.f32(float %55)
  %57 = fptosi float %56 to i32
  %58 = call i32 @llvm.abs.i32(i32 %57, i1 true)
  store i32 %58, ptr %12, align 4, !tbaa !12
  %59 = load float, ptr %8, align 4, !tbaa !10
  %60 = load float, ptr %7, align 4, !tbaa !10
  %61 = fdiv float %59, %60
  %62 = fptosi float %61 to i32
  %63 = call i32 @llvm.abs.i32(i32 %62, i1 true)
  %64 = icmp slt i32 %63, 1
  br i1 %64, label %65, label %134

65:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  %66 = load i32, ptr %12, align 4, !tbaa !12
  %67 = mul nsw i32 2, %66
  %68 = load i32, ptr %11, align 4, !tbaa !12
  %69 = sub nsw i32 %67, %68
  store i32 %69, ptr %13, align 4, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #5
  %70 = load ptr, ptr %5, align 8, !tbaa !5
  %71 = getelementptr inbounds %class.Point4, ptr %70, i32 0, i32 0
  %72 = getelementptr inbounds %struct.anon, ptr %71, i32 0, i32 0
  %73 = load float, ptr %72, align 4, !tbaa !9
  %74 = call float @llvm.floor.f32(float %73)
  %75 = fptosi float %74 to i32
  store i32 %75, ptr %14, align 4, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #5
  %76 = load i32, ptr %12, align 4, !tbaa !12
  %77 = mul nsw i32 2, %76
  store i32 %77, ptr %15, align 4, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #5
  %78 = load i32, ptr %15, align 4, !tbaa !12
  %79 = load i32, ptr %11, align 4, !tbaa !12
  %80 = mul nsw i32 2, %79
  %81 = sub nsw i32 %78, %80
  store i32 %81, ptr %16, align 4, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #5
  %82 = load ptr, ptr %4, align 8, !tbaa !5
  %83 = getelementptr inbounds %class.Point4, ptr %82, i32 0, i32 0
  %84 = getelementptr inbounds %struct.anon, ptr %83, i32 0, i32 0
  %85 = load float, ptr %84, align 4, !tbaa !9
  %86 = call float @llvm.floor.f32(float %85)
  %87 = fptosi float %86 to i32
  store i32 %87, ptr %17, align 4, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #5
  %88 = load ptr, ptr %4, align 8, !tbaa !5
  %89 = getelementptr inbounds %class.Point4, ptr %88, i32 0, i32 0
  %90 = getelementptr inbounds %struct.anon, ptr %89, i32 0, i32 1
  %91 = load float, ptr %90, align 4, !tbaa !9
  %92 = call float @llvm.floor.f32(float %91)
  %93 = fptosi float %92 to i32
  store i32 %93, ptr %18, align 4, !tbaa !12
  br label %94

94:                                               ; preds = %129, %65
  %95 = load i32, ptr %17, align 4, !tbaa !12
  %96 = load i32, ptr %14, align 4, !tbaa !12
  %97 = icmp ne i32 %95, %96
  br i1 %97, label %99, label %98

98:                                               ; preds = %94
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #5
  br label %133

99:                                               ; preds = %94
  %100 = load i32, ptr %17, align 4, !tbaa !12
  %101 = load i32, ptr %18, align 4, !tbaa !12
  %102 = load ptr, ptr %6, align 8, !tbaa !5
  %103 = getelementptr inbounds %"struct.Graphics::Color", ptr %102, i32 0, i32 0
  %104 = load float, ptr %103, align 4, !tbaa !14
  %105 = fptoui float %104 to i8
  %106 = load ptr, ptr %6, align 8, !tbaa !5
  %107 = getelementptr inbounds %"struct.Graphics::Color", ptr %106, i32 0, i32 1
  %108 = load float, ptr %107, align 4, !tbaa !16
  %109 = fptoui float %108 to i8
  %110 = load ptr, ptr %6, align 8, !tbaa !5
  %111 = getelementptr inbounds %"struct.Graphics::Color", ptr %110, i32 0, i32 2
  %112 = load float, ptr %111, align 4, !tbaa !17
  %113 = fptoui float %112 to i8
  invoke void @_ZN11FrameBuffer8SetPixelEjjfhhh(i32 noundef %100, i32 noundef %101, float noundef 0.000000e+00, i8 noundef zeroext %105, i8 noundef zeroext %109, i8 noundef zeroext %113)
          to label %114 unwind label %204

114:                                              ; preds = %99
  %115 = load i32, ptr %13, align 4, !tbaa !12
  %116 = icmp sgt i32 %115, 0
  br i1 %116, label %117, label %124

117:                                              ; preds = %114
  %118 = load i32, ptr %10, align 4, !tbaa !12
  %119 = load i32, ptr %18, align 4, !tbaa !12
  %120 = add nsw i32 %119, %118
  store i32 %120, ptr %18, align 4, !tbaa !12
  %121 = load i32, ptr %16, align 4, !tbaa !12
  %122 = load i32, ptr %13, align 4, !tbaa !12
  %123 = add nsw i32 %122, %121
  store i32 %123, ptr %13, align 4, !tbaa !12
  br label %128

124:                                              ; preds = %114
  %125 = load i32, ptr %15, align 4, !tbaa !12
  %126 = load i32, ptr %13, align 4, !tbaa !12
  %127 = add nsw i32 %126, %125
  store i32 %127, ptr %13, align 4, !tbaa !12
  br label %128

128:                                              ; preds = %124, %117
  br label %129

129:                                              ; preds = %128
  %130 = load i32, ptr %9, align 4, !tbaa !12
  %131 = load i32, ptr %17, align 4, !tbaa !12
  %132 = add nsw i32 %131, %130
  store i32 %132, ptr %17, align 4, !tbaa !12
  br label %94, !llvm.loop !18

133:                                              ; preds = %98
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  br label %203

134:                                              ; preds = %3
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #5
  %135 = load i32, ptr %11, align 4, !tbaa !12
  %136 = mul nsw i32 2, %135
  %137 = load i32, ptr %12, align 4, !tbaa !12
  %138 = sub nsw i32 %136, %137
  store i32 %138, ptr %19, align 4, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #5
  %139 = load ptr, ptr %5, align 8, !tbaa !5
  %140 = getelementptr inbounds %class.Point4, ptr %139, i32 0, i32 0
  %141 = getelementptr inbounds %struct.anon, ptr %140, i32 0, i32 1
  %142 = load float, ptr %141, align 4, !tbaa !9
  %143 = call float @llvm.floor.f32(float %142)
  %144 = fptosi float %143 to i32
  store i32 %144, ptr %20, align 4, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #5
  %145 = load i32, ptr %11, align 4, !tbaa !12
  %146 = mul nsw i32 2, %145
  store i32 %146, ptr %21, align 4, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #5
  %147 = load i32, ptr %21, align 4, !tbaa !12
  %148 = load i32, ptr %12, align 4, !tbaa !12
  %149 = mul nsw i32 2, %148
  %150 = sub i32 %147, %149
  store i32 %150, ptr %22, align 4, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #5
  %151 = load ptr, ptr %4, align 8, !tbaa !5
  %152 = getelementptr inbounds %class.Point4, ptr %151, i32 0, i32 0
  %153 = getelementptr inbounds %struct.anon, ptr %152, i32 0, i32 0
  %154 = load float, ptr %153, align 4, !tbaa !9
  %155 = call float @llvm.floor.f32(float %154)
  %156 = fptosi float %155 to i32
  store i32 %156, ptr %23, align 4, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #5
  %157 = load ptr, ptr %4, align 8, !tbaa !5
  %158 = getelementptr inbounds %class.Point4, ptr %157, i32 0, i32 0
  %159 = getelementptr inbounds %struct.anon, ptr %158, i32 0, i32 1
  %160 = load float, ptr %159, align 4, !tbaa !9
  %161 = call float @llvm.floor.f32(float %160)
  %162 = fptosi float %161 to i32
  store i32 %162, ptr %24, align 4, !tbaa !12
  br label %163

163:                                              ; preds = %198, %134
  %164 = load i32, ptr %24, align 4, !tbaa !12
  %165 = load i32, ptr %20, align 4, !tbaa !12
  %166 = icmp ne i32 %164, %165
  br i1 %166, label %168, label %167

167:                                              ; preds = %163
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #5
  br label %202

168:                                              ; preds = %163
  %169 = load i32, ptr %23, align 4, !tbaa !12
  %170 = load i32, ptr %24, align 4, !tbaa !12
  %171 = load ptr, ptr %6, align 8, !tbaa !5
  %172 = getelementptr inbounds %"struct.Graphics::Color", ptr %171, i32 0, i32 0
  %173 = load float, ptr %172, align 4, !tbaa !14
  %174 = fptoui float %173 to i8
  %175 = load ptr, ptr %6, align 8, !tbaa !5
  %176 = getelementptr inbounds %"struct.Graphics::Color", ptr %175, i32 0, i32 1
  %177 = load float, ptr %176, align 4, !tbaa !16
  %178 = fptoui float %177 to i8
  %179 = load ptr, ptr %6, align 8, !tbaa !5
  %180 = getelementptr inbounds %"struct.Graphics::Color", ptr %179, i32 0, i32 2
  %181 = load float, ptr %180, align 4, !tbaa !17
  %182 = fptoui float %181 to i8
  invoke void @_ZN11FrameBuffer8SetPixelEjjfhhh(i32 noundef %169, i32 noundef %170, float noundef 0.000000e+00, i8 noundef zeroext %174, i8 noundef zeroext %178, i8 noundef zeroext %182)
          to label %183 unwind label %204

183:                                              ; preds = %168
  %184 = load i32, ptr %19, align 4, !tbaa !12
  %185 = icmp sgt i32 %184, 0
  br i1 %185, label %186, label %193

186:                                              ; preds = %183
  %187 = load i32, ptr %9, align 4, !tbaa !12
  %188 = load i32, ptr %23, align 4, !tbaa !12
  %189 = add nsw i32 %188, %187
  store i32 %189, ptr %23, align 4, !tbaa !12
  %190 = load i32, ptr %22, align 4, !tbaa !12
  %191 = load i32, ptr %19, align 4, !tbaa !12
  %192 = add i32 %191, %190
  store i32 %192, ptr %19, align 4, !tbaa !12
  br label %197

193:                                              ; preds = %183
  %194 = load i32, ptr %21, align 4, !tbaa !12
  %195 = load i32, ptr %19, align 4, !tbaa !12
  %196 = add i32 %195, %194
  store i32 %196, ptr %19, align 4, !tbaa !12
  br label %197

197:                                              ; preds = %193, %186
  br label %198

198:                                              ; preds = %197
  %199 = load i32, ptr %10, align 4, !tbaa !12
  %200 = load i32, ptr %24, align 4, !tbaa !12
  %201 = add nsw i32 %200, %199
  store i32 %201, ptr %24, align 4, !tbaa !12
  br label %163, !llvm.loop !20

202:                                              ; preds = %167
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #5
  br label %203

203:                                              ; preds = %202, %133
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  ret void

204:                                              ; preds = %168, %99
  %205 = landingpad { ptr, i32 }
          catch ptr null
  %206 = extractvalue { ptr, i32 } %205, 0
  call void @__clang_call_terminate(ptr %206) #6
  unreachable
}

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.abs.i32(i32, i1 immarg) #2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { noinline noreturn nounwind uwtable "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 = { "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 = { 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 #5 = { nounwind }
attributes #6 = { 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++ TBAA"}
!9 = !{!7, !7, i64 0}
!10 = !{!11, !11, i64 0}
!11 = !{!"float", !7, i64 0}
!12 = !{!13, !13, i64 0}
!13 = !{!"int", !7, i64 0}
!14 = !{!15, !11, i64 0}
!15 = !{!"_ZTSN8Graphics5ColorE", !11, i64 0, !11, i64 4, !11, i64 8}
!16 = !{!15, !11, i64 4}
!17 = !{!15, !11, i64 8}
!18 = distinct !{!18, !19}
!19 = !{!"llvm.loop.mustprogress"}
!20 = distinct !{!20, !19}


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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: noinline noreturn nounwind uwtable
declare hidden void @__clang_call_terminate(ptr noundef) local_unnamed_addr #0

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

declare void @_ZN11FrameBuffer8SetPixelEjjfhhh(i32 noundef, i32 noundef, float noundef, i8 noundef zeroext, i8 noundef zeroext, i8 noundef zeroext) local_unnamed_addr #2

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_ZN8Graphics10Rasterizer8DrawLineERK6Point4S3_RKNS_5ColorE(ptr nocapture noundef nonnull readonly align 4 dereferenceable(16) %0, ptr nocapture noundef nonnull readonly align 4 dereferenceable(16) %1, ptr nocapture noundef nonnull readonly align 4 dereferenceable(12) %2) local_unnamed_addr #3 personality ptr @__gxx_personality_v0 {
  %4 = load <2 x float>, ptr %1, align 4, !tbaa !5
  %5 = load <2 x float>, ptr %0, align 4, !tbaa !5
  %6 = fsub <2 x float> %4, %5
  %7 = extractelement <2 x float> %6, i64 0
  %8 = fcmp ogt float %7, 0.000000e+00
  %9 = select i1 %8, i32 1, i32 -1
  %10 = extractelement <2 x float> %6, i64 1
  %11 = fcmp ogt float %10, 0.000000e+00
  %12 = select i1 %11, i32 1, i32 -1
  %13 = tail call float @llvm.floor.f32(float %7)
  %14 = fptosi float %13 to i32
  %15 = tail call i32 @llvm.abs.i32(i32 %14, i1 true)
  %16 = tail call float @llvm.floor.f32(float %10)
  %17 = fptosi float %16 to i32
  %18 = tail call i32 @llvm.abs.i32(i32 %17, i1 true)
  %19 = fdiv float %10, %7
  %20 = fptosi float %19 to i32
  %21 = icmp eq i32 %20, 0
  br i1 %21, label %22, label %49

22:                                               ; preds = %3
  %23 = shl nuw nsw i32 %18, 1
  %24 = extractelement <2 x float> %4, i64 0
  %25 = tail call float @llvm.floor.f32(float %24)
  %26 = fptosi float %25 to i32
  %27 = sub nsw i32 %18, %15
  %28 = shl nsw i32 %27, 1
  %29 = extractelement <2 x float> %5, i64 0
  %30 = tail call float @llvm.floor.f32(float %29)
  %31 = fptosi float %30 to i32
  %.not6573 = icmp eq i32 %31, %26
  br i1 %.not6573, label %.loopexit, label %.lr.ph77

.lr.ph77:                                         ; preds = %22
  %32 = extractelement <2 x float> %5, i64 1
  %33 = tail call float @llvm.floor.f32(float %32)
  %34 = fptosi float %33 to i32
  %35 = sub nsw i32 %23, %15
  %36 = getelementptr inbounds i8, ptr %2, i64 4
  %37 = getelementptr inbounds i8, ptr %2, i64 8
  br label %38

38:                                               ; preds = %.lr.ph77, %45
  %.05876 = phi i32 [ %35, %.lr.ph77 ], [ %.159, %45 ]
  %.06075 = phi i32 [ %31, %.lr.ph77 ], [ %48, %45 ]
  %.06174 = phi i32 [ %34, %.lr.ph77 ], [ %.162, %45 ]
  %39 = load float, ptr %2, align 4, !tbaa !8
  %40 = fptoui float %39 to i8
  %41 = load float, ptr %36, align 4, !tbaa !11
  %42 = fptoui float %41 to i8
  %43 = load float, ptr %37, align 4, !tbaa !12
  %44 = fptoui float %43 to i8
  invoke void @_ZN11FrameBuffer8SetPixelEjjfhhh(i32 noundef %.06075, i32 noundef %.06174, float noundef 0.000000e+00, i8 noundef zeroext %40, i8 noundef zeroext %42, i8 noundef zeroext %44)
          to label %45 unwind label %.loopexit67

45:                                               ; preds = %38
  %46 = icmp sgt i32 %.05876, 0
  %47 = select i1 %46, i32 %12, i32 0
  %.162 = add nsw i32 %47, %.06174
  %.pn66 = select i1 %46, i32 %28, i32 %23
  %.159 = add nsw i32 %.pn66, %.05876
  %48 = add nsw i32 %.06075, %9
  %.not65 = icmp eq i32 %48, %26
  br i1 %.not65, label %.loopexit, label %38, !llvm.loop !13

49:                                               ; preds = %3
  %50 = shl nuw nsw i32 %15, 1
  %51 = extractelement <2 x float> %4, i64 1
  %52 = tail call float @llvm.floor.f32(float %51)
  %53 = fptosi float %52 to i32
  %54 = sub nsw i32 %15, %18
  %55 = shl nsw i32 %54, 1
  %56 = extractelement <2 x float> %5, i64 1
  %57 = tail call float @llvm.floor.f32(float %56)
  %58 = fptosi float %57 to i32
  %.not69 = icmp eq i32 %58, %53
  br i1 %.not69, label %.loopexit, label %.lr.ph

.lr.ph:                                           ; preds = %49
  %59 = extractelement <2 x float> %5, i64 0
  %60 = tail call float @llvm.floor.f32(float %59)
  %61 = fptosi float %60 to i32
  %62 = sub nsw i32 %50, %18
  %63 = getelementptr inbounds i8, ptr %2, i64 4
  %64 = getelementptr inbounds i8, ptr %2, i64 8
  br label %65

65:                                               ; preds = %.lr.ph, %72
  %.072 = phi i32 [ %58, %.lr.ph ], [ %75, %72 ]
  %.05771 = phi i32 [ %61, %.lr.ph ], [ %.1, %72 ]
  %.06370 = phi i32 [ %62, %.lr.ph ], [ %.164, %72 ]
  %66 = load float, ptr %2, align 4, !tbaa !8
  %67 = fptoui float %66 to i8
  %68 = load float, ptr %63, align 4, !tbaa !11
  %69 = fptoui float %68 to i8
  %70 = load float, ptr %64, align 4, !tbaa !12
  %71 = fptoui float %70 to i8
  invoke void @_ZN11FrameBuffer8SetPixelEjjfhhh(i32 noundef %.05771, i32 noundef %.072, float noundef 0.000000e+00, i8 noundef zeroext %67, i8 noundef zeroext %69, i8 noundef zeroext %71)
          to label %72 unwind label %.loopexit.split-lp

72:                                               ; preds = %65
  %73 = icmp sgt i32 %.06370, 0
  %.pn = select i1 %73, i32 %55, i32 %50
  %74 = select i1 %73, i32 %9, i32 0
  %.1 = add nsw i32 %74, %.05771
  %.164 = add i32 %.pn, %.06370
  %75 = add nsw i32 %.072, %12
  %.not = icmp eq i32 %75, %53
  br i1 %.not, label %.loopexit, label %65, !llvm.loop !15

.loopexit:                                        ; preds = %72, %45, %49, %22
  ret void

.loopexit67:                                      ; preds = %38
  %lpad.loopexit = landingpad { ptr, i32 }
          catch ptr null
  br label %76

.loopexit.split-lp:                               ; preds = %65
  %lpad.loopexit.split-lp = landingpad { ptr, i32 }
          catch ptr null
  br label %76

76:                                               ; preds = %.loopexit.split-lp, %.loopexit67
  %lpad.phi = phi { ptr, i32 } [ %lpad.loopexit, %.loopexit67 ], [ %lpad.loopexit.split-lp, %.loopexit.split-lp ]
  %77 = extractvalue { ptr, i32 } %lpad.phi, 0
  tail call void @__clang_call_terminate(ptr %77) #4
  unreachable
}

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.abs.i32(i32, i1 immarg) #1

attributes #0 = { noinline noreturn nounwind uwtable "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 = { "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 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 = { 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++ TBAA"}
!8 = !{!9, !10, i64 0}
!9 = !{!"_ZTSN8Graphics5ColorE", !10, i64 0, !10, i64 4, !10, i64 8}
!10 = !{!"float", !6, i64 0}
!11 = !{!9, !10, i64 4}
!12 = !{!9, !10, i64 8}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,ReassociatePass,SLPVectorizerPass,SROAPass,SimplifyCFGPass,TailCallElimPass