; LLVM IR from zchrissirhcz/pixel :: src (px_image_drawing)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%struct.px_rect_t = type { i32, i32, i32, i32 }
%struct.px_color_t = type { i8, i8, i8, i8 }
%struct.px_image_t = type { ptr, i32, i32, i32, i32 }

; 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 @px_draw_rectangle(ptr noundef %0, i64 %1, i64 %2, i32 %3, i32 noundef %4) #1 {
  %6 = alloca %struct.px_rect_t, align 4
  %7 = alloca %struct.px_color_t, align 1
  %8 = alloca ptr, align 8
  %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 %struct.px_color_t, align 1
  %17 = alloca %struct.px_color_t, align 1
  %18 = alloca %struct.px_color_t, align 1
  %19 = alloca %struct.px_color_t, align 1
  %20 = getelementptr inbounds { i64, i64 }, ptr %6, i32 0, i32 0
  store i64 %1, ptr %20, align 4
  %21 = getelementptr inbounds { i64, i64 }, ptr %6, i32 0, i32 1
  store i64 %2, ptr %21, align 4
  store i32 %3, ptr %7, align 1
  store ptr %0, ptr %8, align 8, !tbaa !5
  store i32 %4, ptr %9, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #4
  %22 = load i32, ptr %9, align 4, !tbaa !9
  %23 = sdiv i32 %22, 2
  store i32 %23, ptr %14, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #4
  %24 = load i32, ptr %9, align 4, !tbaa !9
  %25 = load i32, ptr %9, align 4, !tbaa !9
  %26 = sdiv i32 %25, 2
  %27 = sub nsw i32 %24, %26
  store i32 %27, ptr %15, align 4, !tbaa !9
  %28 = getelementptr inbounds %struct.px_rect_t, ptr %6, i32 0, i32 1
  %29 = load i32, ptr %28, align 4, !tbaa !11
  %30 = load i32, ptr %14, align 4, !tbaa !9
  %31 = sub nsw i32 %29, %30
  store i32 %31, ptr %12, align 4, !tbaa !9
  %32 = load i32, ptr %12, align 4, !tbaa !9
  %33 = icmp slt i32 %32, 0
  br i1 %33, label %34, label %35

34:                                               ; preds = %5
  store i32 0, ptr %12, align 4, !tbaa !9
  br label %35

35:                                               ; preds = %34, %5
  %36 = getelementptr inbounds %struct.px_rect_t, ptr %6, i32 0, i32 1
  %37 = load i32, ptr %36, align 4, !tbaa !11
  %38 = load i32, ptr %15, align 4, !tbaa !9
  %39 = add nsw i32 %37, %38
  store i32 %39, ptr %13, align 4, !tbaa !9
  %40 = load i32, ptr %13, align 4, !tbaa !9
  %41 = load ptr, ptr %8, align 8, !tbaa !5
  %42 = getelementptr inbounds %struct.px_image_t, ptr %41, i32 0, i32 2
  %43 = load i32, ptr %42, align 4, !tbaa !13
  %44 = sub nsw i32 %43, 1
  %45 = icmp sge i32 %40, %44
  br i1 %45, label %46, label %51

46:                                               ; preds = %35
  %47 = load ptr, ptr %8, align 8, !tbaa !5
  %48 = getelementptr inbounds %struct.px_image_t, ptr %47, i32 0, i32 2
  %49 = load i32, ptr %48, align 4, !tbaa !13
  %50 = sub nsw i32 %49, 1
  store i32 %50, ptr %13, align 4, !tbaa !9
  br label %51

51:                                               ; preds = %46, %35
  %52 = getelementptr inbounds %struct.px_rect_t, ptr %6, i32 0, i32 0
  %53 = load i32, ptr %52, align 4, !tbaa !15
  %54 = load i32, ptr %14, align 4, !tbaa !9
  %55 = sub nsw i32 %53, %54
  store i32 %55, ptr %10, align 4, !tbaa !9
  %56 = load i32, ptr %10, align 4, !tbaa !9
  %57 = icmp slt i32 %56, 0
  br i1 %57, label %58, label %59

58:                                               ; preds = %51
  store i32 0, ptr %10, align 4, !tbaa !9
  br label %59

59:                                               ; preds = %58, %51
  %60 = getelementptr inbounds %struct.px_rect_t, ptr %6, i32 0, i32 2
  %61 = load i32, ptr %60, align 4, !tbaa !16
  %62 = load i32, ptr %15, align 4, !tbaa !9
  %63 = add nsw i32 %61, %62
  store i32 %63, ptr %11, align 4, !tbaa !9
  %64 = load i32, ptr %11, align 4, !tbaa !9
  %65 = load ptr, ptr %8, align 8, !tbaa !5
  %66 = getelementptr inbounds %struct.px_image_t, ptr %65, i32 0, i32 1
  %67 = load i32, ptr %66, align 8, !tbaa !17
  %68 = sub nsw i32 %67, 1
  %69 = icmp sge i32 %64, %68
  br i1 %69, label %70, label %75

70:                                               ; preds = %59
  %71 = load ptr, ptr %8, align 8, !tbaa !5
  %72 = getelementptr inbounds %struct.px_image_t, ptr %71, i32 0, i32 1
  %73 = load i32, ptr %72, align 8, !tbaa !17
  %74 = sub nsw i32 %73, 1
  store i32 %74, ptr %11, align 4, !tbaa !9
  br label %75

75:                                               ; preds = %70, %59
  %76 = load ptr, ptr %8, align 8, !tbaa !5
  %77 = load i32, ptr %10, align 4, !tbaa !9
  %78 = load i32, ptr %12, align 4, !tbaa !9
  %79 = load i32, ptr %11, align 4, !tbaa !9
  %80 = load i32, ptr %13, align 4, !tbaa !9
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %16, ptr align 1 %7, i64 4, i1 false), !tbaa.struct !18
  %81 = load i32, ptr %16, align 1
  call void @_ZL15draw_solid_rectP10px_image_tiiii10px_color_t(ptr noundef %76, i32 noundef %77, i32 noundef %78, i32 noundef %79, i32 noundef %80, i32 %81)
  %82 = getelementptr inbounds %struct.px_rect_t, ptr %6, i32 0, i32 3
  %83 = load i32, ptr %82, align 4, !tbaa !20
  %84 = load i32, ptr %14, align 4, !tbaa !9
  %85 = sub nsw i32 %83, %84
  store i32 %85, ptr %12, align 4, !tbaa !9
  %86 = load i32, ptr %12, align 4, !tbaa !9
  %87 = icmp slt i32 %86, 0
  br i1 %87, label %88, label %89

88:                                               ; preds = %75
  store i32 0, ptr %12, align 4, !tbaa !9
  br label %89

89:                                               ; preds = %88, %75
  %90 = getelementptr inbounds %struct.px_rect_t, ptr %6, i32 0, i32 3
  %91 = load i32, ptr %90, align 4, !tbaa !20
  %92 = load i32, ptr %15, align 4, !tbaa !9
  %93 = add nsw i32 %91, %92
  store i32 %93, ptr %13, align 4, !tbaa !9
  %94 = load i32, ptr %13, align 4, !tbaa !9
  %95 = load ptr, ptr %8, align 8, !tbaa !5
  %96 = getelementptr inbounds %struct.px_image_t, ptr %95, i32 0, i32 2
  %97 = load i32, ptr %96, align 4, !tbaa !13
  %98 = sub nsw i32 %97, 1
  %99 = icmp sge i32 %94, %98
  br i1 %99, label %100, label %105

100:                                              ; preds = %89
  %101 = load ptr, ptr %8, align 8, !tbaa !5
  %102 = getelementptr inbounds %struct.px_image_t, ptr %101, i32 0, i32 2
  %103 = load i32, ptr %102, align 4, !tbaa !13
  %104 = sub nsw i32 %103, 1
  store i32 %104, ptr %13, align 4, !tbaa !9
  br label %105

105:                                              ; preds = %100, %89
  %106 = getelementptr inbounds %struct.px_rect_t, ptr %6, i32 0, i32 0
  %107 = load i32, ptr %106, align 4, !tbaa !15
  %108 = load i32, ptr %14, align 4, !tbaa !9
  %109 = sub nsw i32 %107, %108
  store i32 %109, ptr %10, align 4, !tbaa !9
  %110 = load i32, ptr %10, align 4, !tbaa !9
  %111 = icmp slt i32 %110, 0
  br i1 %111, label %112, label %113

112:                                              ; preds = %105
  store i32 0, ptr %10, align 4, !tbaa !9
  br label %113

113:                                              ; preds = %112, %105
  %114 = getelementptr inbounds %struct.px_rect_t, ptr %6, i32 0, i32 2
  %115 = load i32, ptr %114, align 4, !tbaa !16
  %116 = load i32, ptr %15, align 4, !tbaa !9
  %117 = add nsw i32 %115, %116
  store i32 %117, ptr %11, align 4, !tbaa !9
  %118 = load i32, ptr %11, align 4, !tbaa !9
  %119 = load ptr, ptr %8, align 8, !tbaa !5
  %120 = getelementptr inbounds %struct.px_image_t, ptr %119, i32 0, i32 1
  %121 = load i32, ptr %120, align 8, !tbaa !17
  %122 = sub nsw i32 %121, 1
  %123 = icmp sge i32 %118, %122
  br i1 %123, label %124, label %129

124:                                              ; preds = %113
  %125 = load ptr, ptr %8, align 8, !tbaa !5
  %126 = getelementptr inbounds %struct.px_image_t, ptr %125, i32 0, i32 1
  %127 = load i32, ptr %126, align 8, !tbaa !17
  %128 = sub nsw i32 %127, 1
  store i32 %128, ptr %11, align 4, !tbaa !9
  br label %129

129:                                              ; preds = %124, %113
  %130 = load ptr, ptr %8, align 8, !tbaa !5
  %131 = load i32, ptr %10, align 4, !tbaa !9
  %132 = load i32, ptr %12, align 4, !tbaa !9
  %133 = load i32, ptr %11, align 4, !tbaa !9
  %134 = load i32, ptr %13, align 4, !tbaa !9
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %17, ptr align 1 %7, i64 4, i1 false), !tbaa.struct !18
  %135 = load i32, ptr %17, align 1
  call void @_ZL15draw_solid_rectP10px_image_tiiii10px_color_t(ptr noundef %130, i32 noundef %131, i32 noundef %132, i32 noundef %133, i32 noundef %134, i32 %135)
  %136 = getelementptr inbounds %struct.px_rect_t, ptr %6, i32 0, i32 1
  %137 = load i32, ptr %136, align 4, !tbaa !11
  %138 = load i32, ptr %14, align 4, !tbaa !9
  %139 = sub nsw i32 %137, %138
  store i32 %139, ptr %12, align 4, !tbaa !9
  %140 = load i32, ptr %12, align 4, !tbaa !9
  %141 = icmp slt i32 %140, 0
  br i1 %141, label %142, label %143

142:                                              ; preds = %129
  store i32 0, ptr %12, align 4, !tbaa !9
  br label %143

143:                                              ; preds = %142, %129
  %144 = getelementptr inbounds %struct.px_rect_t, ptr %6, i32 0, i32 3
  %145 = load i32, ptr %144, align 4, !tbaa !20
  %146 = load i32, ptr %15, align 4, !tbaa !9
  %147 = add nsw i32 %145, %146
  store i32 %147, ptr %13, align 4, !tbaa !9
  %148 = load i32, ptr %13, align 4, !tbaa !9
  %149 = load ptr, ptr %8, align 8, !tbaa !5
  %150 = getelementptr inbounds %struct.px_image_t, ptr %149, i32 0, i32 2
  %151 = load i32, ptr %150, align 4, !tbaa !13
  %152 = sub nsw i32 %151, 1
  %153 = icmp sge i32 %148, %152
  br i1 %153, label %154, label %159

154:                                              ; preds = %143
  %155 = load ptr, ptr %8, align 8, !tbaa !5
  %156 = getelementptr inbounds %struct.px_image_t, ptr %155, i32 0, i32 2
  %157 = load i32, ptr %156, align 4, !tbaa !13
  %158 = sub nsw i32 %157, 1
  store i32 %158, ptr %13, align 4, !tbaa !9
  br label %159

159:                                              ; preds = %154, %143
  %160 = getelementptr inbounds %struct.px_rect_t, ptr %6, i32 0, i32 0
  %161 = load i32, ptr %160, align 4, !tbaa !15
  %162 = load i32, ptr %14, align 4, !tbaa !9
  %163 = sub nsw i32 %161, %162
  store i32 %163, ptr %10, align 4, !tbaa !9
  %164 = load i32, ptr %10, align 4, !tbaa !9
  %165 = icmp slt i32 %164, 0
  br i1 %165, label %166, label %167

166:                                              ; preds = %159
  store i32 0, ptr %10, align 4, !tbaa !9
  br label %167

167:                                              ; preds = %166, %159
  %168 = getelementptr inbounds %struct.px_rect_t, ptr %6, i32 0, i32 0
  %169 = load i32, ptr %168, align 4, !tbaa !15
  %170 = load i32, ptr %15, align 4, !tbaa !9
  %171 = add nsw i32 %169, %170
  store i32 %171, ptr %11, align 4, !tbaa !9
  %172 = load i32, ptr %11, align 4, !tbaa !9
  %173 = load ptr, ptr %8, align 8, !tbaa !5
  %174 = getelementptr inbounds %struct.px_image_t, ptr %173, i32 0, i32 1
  %175 = load i32, ptr %174, align 8, !tbaa !17
  %176 = sub nsw i32 %175, 1
  %177 = icmp sge i32 %172, %176
  br i1 %177, label %178, label %183

178:                                              ; preds = %167
  %179 = load ptr, ptr %8, align 8, !tbaa !5
  %180 = getelementptr inbounds %struct.px_image_t, ptr %179, i32 0, i32 1
  %181 = load i32, ptr %180, align 8, !tbaa !17
  %182 = sub nsw i32 %181, 1
  store i32 %182, ptr %11, align 4, !tbaa !9
  br label %183

183:                                              ; preds = %178, %167
  %184 = load ptr, ptr %8, align 8, !tbaa !5
  %185 = load i32, ptr %10, align 4, !tbaa !9
  %186 = load i32, ptr %12, align 4, !tbaa !9
  %187 = load i32, ptr %11, align 4, !tbaa !9
  %188 = load i32, ptr %13, align 4, !tbaa !9
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %18, ptr align 1 %7, i64 4, i1 false), !tbaa.struct !18
  %189 = load i32, ptr %18, align 1
  call void @_ZL15draw_solid_rectP10px_image_tiiii10px_color_t(ptr noundef %184, i32 noundef %185, i32 noundef %186, i32 noundef %187, i32 noundef %188, i32 %189)
  %190 = getelementptr inbounds %struct.px_rect_t, ptr %6, i32 0, i32 1
  %191 = load i32, ptr %190, align 4, !tbaa !11
  %192 = load i32, ptr %14, align 4, !tbaa !9
  %193 = sub nsw i32 %191, %192
  store i32 %193, ptr %12, align 4, !tbaa !9
  %194 = load i32, ptr %12, align 4, !tbaa !9
  %195 = icmp slt i32 %194, 0
  br i1 %195, label %196, label %197

196:                                              ; preds = %183
  store i32 0, ptr %12, align 4, !tbaa !9
  br label %197

197:                                              ; preds = %196, %183
  %198 = getelementptr inbounds %struct.px_rect_t, ptr %6, i32 0, i32 3
  %199 = load i32, ptr %198, align 4, !tbaa !20
  %200 = load i32, ptr %15, align 4, !tbaa !9
  %201 = add nsw i32 %199, %200
  store i32 %201, ptr %13, align 4, !tbaa !9
  %202 = load i32, ptr %13, align 4, !tbaa !9
  %203 = load ptr, ptr %8, align 8, !tbaa !5
  %204 = getelementptr inbounds %struct.px_image_t, ptr %203, i32 0, i32 2
  %205 = load i32, ptr %204, align 4, !tbaa !13
  %206 = sub nsw i32 %205, 1
  %207 = icmp sge i32 %202, %206
  br i1 %207, label %208, label %213

208:                                              ; preds = %197
  %209 = load ptr, ptr %8, align 8, !tbaa !5
  %210 = getelementptr inbounds %struct.px_image_t, ptr %209, i32 0, i32 2
  %211 = load i32, ptr %210, align 4, !tbaa !13
  %212 = sub nsw i32 %211, 1
  store i32 %212, ptr %13, align 4, !tbaa !9
  br label %213

213:                                              ; preds = %208, %197
  %214 = getelementptr inbounds %struct.px_rect_t, ptr %6, i32 0, i32 2
  %215 = load i32, ptr %214, align 4, !tbaa !16
  %216 = load i32, ptr %14, align 4, !tbaa !9
  %217 = sub nsw i32 %215, %216
  store i32 %217, ptr %10, align 4, !tbaa !9
  %218 = load i32, ptr %10, align 4, !tbaa !9
  %219 = icmp slt i32 %218, 0
  br i1 %219, label %220, label %221

220:                                              ; preds = %213
  store i32 0, ptr %10, align 4, !tbaa !9
  br label %221

221:                                              ; preds = %220, %213
  %222 = getelementptr inbounds %struct.px_rect_t, ptr %6, i32 0, i32 2
  %223 = load i32, ptr %222, align 4, !tbaa !16
  %224 = load i32, ptr %15, align 4, !tbaa !9
  %225 = add nsw i32 %223, %224
  store i32 %225, ptr %11, align 4, !tbaa !9
  %226 = load i32, ptr %11, align 4, !tbaa !9
  %227 = load ptr, ptr %8, align 8, !tbaa !5
  %228 = getelementptr inbounds %struct.px_image_t, ptr %227, i32 0, i32 1
  %229 = load i32, ptr %228, align 8, !tbaa !17
  %230 = sub nsw i32 %229, 1
  %231 = icmp sge i32 %226, %230
  br i1 %231, label %232, label %237

232:                                              ; preds = %221
  %233 = load ptr, ptr %8, align 8, !tbaa !5
  %234 = getelementptr inbounds %struct.px_image_t, ptr %233, i32 0, i32 1
  %235 = load i32, ptr %234, align 8, !tbaa !17
  %236 = sub nsw i32 %235, 1
  store i32 %236, ptr %11, align 4, !tbaa !9
  br label %237

237:                                              ; preds = %232, %221
  %238 = load ptr, ptr %8, align 8, !tbaa !5
  %239 = load i32, ptr %10, align 4, !tbaa !9
  %240 = load i32, ptr %12, align 4, !tbaa !9
  %241 = load i32, ptr %11, align 4, !tbaa !9
  %242 = load i32, ptr %13, align 4, !tbaa !9
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %19, ptr align 1 %7, i64 4, i1 false), !tbaa.struct !18
  %243 = load i32, ptr %19, align 1
  call void @_ZL15draw_solid_rectP10px_image_tiiii10px_color_t(ptr noundef %238, i32 noundef %239, i32 noundef %240, i32 noundef %241, i32 noundef %242, i32 %243)
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  ret void
}

; Function Attrs: mustprogress nounwind uwtable
declare hidden void @_ZL15draw_solid_rectP10px_image_tiiii10px_color_t(ptr noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32) #2

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #3

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 = { 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 nounwind willreturn memory(argmem: readwrite) }
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, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !10, i64 4}
!12 = !{!"_ZTS9px_rect_t", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12}
!13 = !{!14, !10, i64 12}
!14 = !{!"_ZTS10px_image_t", !6, i64 0, !10, i64 8, !10, i64 12, !10, i64 16, !10, i64 20}
!15 = !{!12, !10, i64 0}
!16 = !{!12, !10, i64 8}
!17 = !{!14, !10, i64 8}
!18 = !{i64 0, i64 1, !19, i64 1, i64 1, !19, i64 2, i64 1, !19, i64 3, i64 1, !19}
!19 = !{!7, !7, i64 0}
!20 = !{!12, !10, i64 12}


; 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 nounwind uwtable
define dso_local void @px_draw_rectangle(ptr noundef %0, i64 %1, i64 %2, i32 %3, i32 noundef %4) local_unnamed_addr #0 {
  %.sroa.084.0.extract.trunc = trunc i64 %1 to i32
  %.sroa.5.0.extract.shift = lshr i64 %1, 32
  %.sroa.5.0.extract.trunc = trunc nuw i64 %.sroa.5.0.extract.shift to i32
  %.sroa.9.8.extract.trunc = trunc i64 %2 to i32
  %.sroa.14.8.extract.shift = lshr i64 %2, 32
  %.sroa.14.8.extract.trunc = trunc nuw i64 %.sroa.14.8.extract.shift to i32
  %6 = sdiv i32 %4, 2
  %7 = sub nsw i32 %4, %6
  %8 = sub nsw i32 %.sroa.5.0.extract.trunc, %6
  %spec.store.select = tail call i32 @llvm.smax.i32(i32 %8, i32 0)
  %9 = add nsw i32 %7, %.sroa.5.0.extract.trunc
  %10 = getelementptr inbounds i8, ptr %0, i64 12
  %11 = load i32, ptr %10, align 4, !tbaa !5
  %12 = add nsw i32 %11, -1
  %spec.select = tail call i32 @llvm.smin.i32(i32 %9, i32 %12)
  %13 = sub nsw i32 %.sroa.084.0.extract.trunc, %6
  %spec.store.select1 = tail call i32 @llvm.smax.i32(i32 %13, i32 0)
  %14 = add nsw i32 %7, %.sroa.9.8.extract.trunc
  %15 = getelementptr inbounds i8, ptr %0, i64 8
  %16 = load i32, ptr %15, align 8, !tbaa !11
  %17 = add nsw i32 %16, -1
  %.0 = tail call i32 @llvm.smin.i32(i32 %14, i32 %17)
  tail call void @_ZL15draw_solid_rectP10px_image_tiiii10px_color_t(ptr noundef %0, i32 noundef %spec.store.select1, i32 noundef %spec.store.select, i32 noundef %.0, i32 noundef %spec.select, i32 %3)
  %18 = sub nsw i32 %.sroa.14.8.extract.trunc, %6
  %spec.store.select2 = tail call i32 @llvm.smax.i32(i32 %18, i32 0)
  %19 = add nsw i32 %7, %.sroa.14.8.extract.trunc
  %20 = load i32, ptr %10, align 4, !tbaa !5
  %21 = add nsw i32 %20, -1
  %.198 = tail call i32 @llvm.smin.i32(i32 %19, i32 %21)
  %22 = load i32, ptr %15, align 8, !tbaa !11
  %23 = add nsw i32 %22, -1
  %.1 = tail call i32 @llvm.smin.i32(i32 %14, i32 %23)
  tail call void @_ZL15draw_solid_rectP10px_image_tiiii10px_color_t(ptr noundef %0, i32 noundef %spec.store.select1, i32 noundef %spec.store.select2, i32 noundef %.1, i32 noundef %.198, i32 %3)
  %24 = load i32, ptr %10, align 4, !tbaa !5
  %25 = add nsw i32 %24, -1
  %.299 = tail call i32 @llvm.smin.i32(i32 %19, i32 %25)
  %26 = add nsw i32 %7, %.sroa.084.0.extract.trunc
  %27 = load i32, ptr %15, align 8, !tbaa !11
  %28 = add nsw i32 %27, -1
  %.2 = tail call i32 @llvm.smin.i32(i32 %26, i32 %28)
  tail call void @_ZL15draw_solid_rectP10px_image_tiiii10px_color_t(ptr noundef %0, i32 noundef %spec.store.select1, i32 noundef %spec.store.select, i32 noundef %.2, i32 noundef %.299, i32 %3)
  %29 = load i32, ptr %10, align 4, !tbaa !5
  %30 = add nsw i32 %29, -1
  %.3100 = tail call i32 @llvm.smin.i32(i32 %19, i32 %30)
  %31 = load i32, ptr %15, align 8, !tbaa !11
  %32 = add nsw i32 %31, -1
  %.3 = tail call i32 @llvm.smin.i32(i32 %14, i32 %32)
  %33 = sub nsw i32 %.sroa.9.8.extract.trunc, %6
  %spec.store.select7 = tail call i32 @llvm.smax.i32(i32 %33, i32 0)
  tail call void @_ZL15draw_solid_rectP10px_image_tiiii10px_color_t(ptr noundef %0, i32 noundef %spec.store.select7, i32 noundef %spec.store.select, i32 noundef %.3, i32 noundef %.3100, i32 %3)
  ret void
}

; Function Attrs: mustprogress nounwind uwtable
declare hidden void @_ZL15draw_solid_rectP10px_image_tiiii10px_color_t(ptr noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32) local_unnamed_addr #0

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

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

attributes #0 = { 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 #1 = { 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, !10, i64 12}
!6 = !{!"_ZTS10px_image_t", !7, i64 0, !10, i64 8, !10, i64 12, !10, i64 16, !10, i64 20}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!6, !10, i64 8}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass