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

; 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_size_t = type { i32, i32 }
%struct.px_image_t = type { ptr, i32, i32, i32, i32 }

@.str = external hidden unnamed_addr constant [39 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [76 x i8], align 1
@__PRETTY_FUNCTION__.px_resize_nearest = external hidden unnamed_addr constant [62 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [29 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local void @px_resize_nearest(ptr noundef %0, ptr noundef %1, i64 %2) #0 {
  %4 = alloca %struct.px_size_t, align 4
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca double, align 8
  %9 = alloca double, align 8
  %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
  store i64 %2, ptr %4, align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  %20 = load ptr, ptr %5, align 8, !tbaa !5
  %21 = icmp ne ptr %20, null
  br i1 %21, label %22, label %26

22:                                               ; preds = %3
  %23 = load ptr, ptr %6, align 8, !tbaa !5
  %24 = icmp ne ptr %23, null
  br i1 %24, label %25, label %26

25:                                               ; preds = %22
  br label %27

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

27:                                               ; preds = %25
  %28 = load ptr, ptr %6, align 8, !tbaa !5
  %29 = load i64, ptr %4, align 4
  %30 = call zeroext i1 @px_image_size_equal(ptr noundef %28, i64 %29)
  br i1 %30, label %31, label %32

31:                                               ; preds = %27
  br label %33

32:                                               ; preds = %27
  call void @__assert_fail(ptr noundef @.str.2, ptr noundef @.str.1, i32 noundef 9, ptr noundef @__PRETTY_FUNCTION__.px_resize_nearest) #5
  unreachable

33:                                               ; preds = %31
  %34 = load ptr, ptr %5, align 8, !tbaa !5
  %35 = getelementptr inbounds %struct.px_image_t, ptr %34, i32 0, i32 3
  %36 = load i32, ptr %35, align 8, !tbaa !9
  %37 = load ptr, ptr %6, align 8, !tbaa !5
  %38 = getelementptr inbounds %struct.px_image_t, ptr %37, i32 0, i32 3
  %39 = load i32, ptr %38, align 8, !tbaa !9
  %40 = icmp eq i32 %36, %39
  br i1 %40, label %41, label %42

41:                                               ; preds = %33
  br label %43

42:                                               ; preds = %33
  call void @__assert_fail(ptr noundef @.str.3, ptr noundef @.str.1, i32 noundef 10, ptr noundef @__PRETTY_FUNCTION__.px_resize_nearest) #5
  unreachable

43:                                               ; preds = %41
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  %44 = load ptr, ptr %6, align 8, !tbaa !5
  %45 = getelementptr inbounds %struct.px_image_t, ptr %44, i32 0, i32 3
  %46 = load i32, ptr %45, align 8, !tbaa !9
  store i32 %46, ptr %7, align 4, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #6
  %47 = load ptr, ptr %5, 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 = sitofp i32 %49 to double
  %51 = fmul double %50, 1.000000e+00
  %52 = load ptr, ptr %6, align 8, !tbaa !5
  %53 = getelementptr inbounds %struct.px_image_t, ptr %52, i32 0, i32 2
  %54 = load i32, ptr %53, align 4, !tbaa !13
  %55 = sitofp i32 %54 to double
  %56 = fdiv double %51, %55
  store double %56, ptr %8, align 8, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #6
  %57 = load ptr, ptr %5, align 8, !tbaa !5
  %58 = getelementptr inbounds %struct.px_image_t, ptr %57, i32 0, i32 1
  %59 = load i32, ptr %58, align 8, !tbaa !16
  %60 = sitofp i32 %59 to double
  %61 = fmul double %60, 1.000000e+00
  %62 = load ptr, ptr %6, align 8, !tbaa !5
  %63 = getelementptr inbounds %struct.px_image_t, ptr %62, i32 0, i32 1
  %64 = load i32, ptr %63, align 8, !tbaa !16
  %65 = sitofp i32 %64 to double
  %66 = fdiv double %61, %65
  store double %66, ptr %9, align 8, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  store i32 0, ptr %10, align 4, !tbaa !12
  br label %67

67:                                               ; preds = %156, %43
  %68 = load i32, ptr %10, align 4, !tbaa !12
  %69 = load ptr, ptr %6, align 8, !tbaa !5
  %70 = getelementptr inbounds %struct.px_image_t, ptr %69, i32 0, i32 2
  %71 = load i32, ptr %70, align 4, !tbaa !13
  %72 = icmp slt i32 %68, %71
  br i1 %72, label %74, label %73

73:                                               ; preds = %67
  store i32 2, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  br label %159

74:                                               ; preds = %67
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  store i32 0, ptr %12, align 4, !tbaa !12
  br label %75

75:                                               ; preds = %152, %74
  %76 = load i32, ptr %12, align 4, !tbaa !12
  %77 = load ptr, ptr %6, align 8, !tbaa !5
  %78 = getelementptr inbounds %struct.px_image_t, ptr %77, i32 0, i32 1
  %79 = load i32, ptr %78, align 8, !tbaa !16
  %80 = icmp slt i32 %76, %79
  br i1 %80, label %82, label %81

81:                                               ; preds = %75
  store i32 5, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  br label %155

82:                                               ; preds = %75
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  %83 = load i32, ptr %10, align 4, !tbaa !12
  store i32 %83, ptr %13, align 4, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #6
  %84 = load i32, ptr %12, align 4, !tbaa !12
  store i32 %84, ptr %14, align 4, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #6
  %85 = load i32, ptr %13, align 4, !tbaa !12
  %86 = sitofp i32 %85 to double
  %87 = load double, ptr %8, align 8, !tbaa !14
  %88 = call double @llvm.fmuladd.f64(double %86, double %87, double 5.000000e-01)
  %89 = fptosi double %88 to i32
  store i32 %89, ptr %15, align 4, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #6
  %90 = load i32, ptr %14, align 4, !tbaa !12
  %91 = sitofp i32 %90 to double
  %92 = load double, ptr %9, align 8, !tbaa !14
  %93 = call double @llvm.fmuladd.f64(double %91, double %92, double 5.000000e-01)
  %94 = fptosi double %93 to i32
  store i32 %94, ptr %16, align 4, !tbaa !12
  %95 = load i32, ptr %15, align 4, !tbaa !12
  %96 = load ptr, ptr %5, align 8, !tbaa !5
  %97 = getelementptr inbounds %struct.px_image_t, ptr %96, i32 0, i32 2
  %98 = load i32, ptr %97, align 4, !tbaa !13
  %99 = sub nsw i32 %98, 1
  %100 = call i32 @px_clamp(i32 noundef %95, i32 noundef 0, i32 noundef %99)
  store i32 %100, ptr %15, align 4, !tbaa !12
  %101 = load i32, ptr %16, align 4, !tbaa !12
  %102 = load ptr, ptr %5, align 8, !tbaa !5
  %103 = getelementptr inbounds %struct.px_image_t, ptr %102, i32 0, i32 1
  %104 = load i32, ptr %103, align 8, !tbaa !16
  %105 = sub nsw i32 %104, 1
  %106 = call i32 @px_clamp(i32 noundef %101, i32 noundef 0, i32 noundef %105)
  store i32 %106, ptr %16, align 4, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #6
  store i32 0, ptr %17, align 4, !tbaa !12
  br label %107

107:                                              ; preds = %148, %82
  %108 = load i32, ptr %17, align 4, !tbaa !12
  %109 = load i32, ptr %7, align 4, !tbaa !12
  %110 = icmp slt i32 %108, %109
  br i1 %110, label %112, label %111

111:                                              ; preds = %107
  store i32 8, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #6
  br label %151

112:                                              ; preds = %107
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #6
  %113 = load i32, ptr %13, align 4, !tbaa !12
  %114 = load ptr, ptr %6, align 8, !tbaa !5
  %115 = getelementptr inbounds %struct.px_image_t, ptr %114, i32 0, i32 4
  %116 = load i32, ptr %115, align 4, !tbaa !17
  %117 = mul nsw i32 %113, %116
  %118 = load i32, ptr %14, align 4, !tbaa !12
  %119 = load i32, ptr %7, align 4, !tbaa !12
  %120 = mul nsw i32 %118, %119
  %121 = add nsw i32 %117, %120
  %122 = load i32, ptr %17, align 4, !tbaa !12
  %123 = add nsw i32 %121, %122
  store i32 %123, ptr %18, align 4, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #6
  %124 = load i32, ptr %15, align 4, !tbaa !12
  %125 = load ptr, ptr %5, align 8, !tbaa !5
  %126 = getelementptr inbounds %struct.px_image_t, ptr %125, i32 0, i32 4
  %127 = load i32, ptr %126, align 4, !tbaa !17
  %128 = mul nsw i32 %124, %127
  %129 = load i32, ptr %16, align 4, !tbaa !12
  %130 = load i32, ptr %7, align 4, !tbaa !12
  %131 = mul nsw i32 %129, %130
  %132 = add nsw i32 %128, %131
  %133 = load i32, ptr %17, align 4, !tbaa !12
  %134 = add nsw i32 %132, %133
  store i32 %134, ptr %19, align 4, !tbaa !12
  %135 = load ptr, ptr %5, align 8, !tbaa !5
  %136 = getelementptr inbounds %struct.px_image_t, ptr %135, i32 0, i32 0
  %137 = load ptr, ptr %136, align 8, !tbaa !18
  %138 = load i32, ptr %19, align 4, !tbaa !12
  %139 = sext i32 %138 to i64
  %140 = getelementptr inbounds i8, ptr %137, i64 %139
  %141 = load i8, ptr %140, align 1, !tbaa !19
  %142 = load ptr, ptr %6, align 8, !tbaa !5
  %143 = getelementptr inbounds %struct.px_image_t, ptr %142, i32 0, i32 0
  %144 = load ptr, ptr %143, align 8, !tbaa !18
  %145 = load i32, ptr %18, align 4, !tbaa !12
  %146 = sext i32 %145 to i64
  %147 = getelementptr inbounds i8, ptr %144, i64 %146
  store i8 %141, ptr %147, align 1, !tbaa !19
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #6
  br label %148

148:                                              ; preds = %112
  %149 = load i32, ptr %17, align 4, !tbaa !12
  %150 = add nsw i32 %149, 1
  store i32 %150, ptr %17, align 4, !tbaa !12
  br label %107, !llvm.loop !20

151:                                              ; preds = %111
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  br label %152

152:                                              ; preds = %151
  %153 = load i32, ptr %12, align 4, !tbaa !12
  %154 = add nsw i32 %153, 1
  store i32 %154, ptr %12, align 4, !tbaa !12
  br label %75, !llvm.loop !22

155:                                              ; preds = %81
  br label %156

156:                                              ; preds = %155
  %157 = load i32, ptr %10, align 4, !tbaa !12
  %158 = add nsw i32 %157, 1
  store i32 %158, ptr %10, align 4, !tbaa !12
  br label %67, !llvm.loop !23

159:                                              ; preds = %73
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  ret void
}

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #1

declare zeroext i1 @px_image_size_equal(ptr noundef, i64) #2

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #4

declare i32 @px_clamp(i32 noundef, i32 noundef, i32 noundef) #2

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

attributes #0 = { 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 = { noreturn nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { noreturn nounwind }
attributes #6 = { 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, !11, i64 16}
!10 = !{!"px_image_t", !6, i64 0, !11, i64 8, !11, i64 12, !11, i64 16, !11, i64 20}
!11 = !{!"int", !7, i64 0}
!12 = !{!11, !11, i64 0}
!13 = !{!10, !11, i64 12}
!14 = !{!15, !15, i64 0}
!15 = !{!"double", !7, i64 0}
!16 = !{!10, !11, i64 8}
!17 = !{!10, !11, i64 20}
!18 = !{!10, !6, i64 0}
!19 = !{!7, !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"

@.str = external hidden unnamed_addr constant [39 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [76 x i8], align 1
@__PRETTY_FUNCTION__.px_resize_nearest = external hidden unnamed_addr constant [62 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [29 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local void @px_resize_nearest(ptr noundef readonly %0, ptr noundef %1, i64 %2) local_unnamed_addr #0 {
  %4 = icmp ne ptr %0, null
  %5 = icmp ne ptr %1, null
  %or.cond = and i1 %4, %5
  br i1 %or.cond, label %7, label %6

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

7:                                                ; preds = %3
  %8 = tail call zeroext i1 @px_image_size_equal(ptr noundef nonnull %1, i64 %2) #5
  br i1 %8, label %10, label %9

9:                                                ; preds = %7
  tail call void @__assert_fail(ptr noundef nonnull @.str.2, ptr noundef nonnull @.str.1, i32 noundef 9, ptr noundef nonnull @__PRETTY_FUNCTION__.px_resize_nearest) #4
  unreachable

10:                                               ; preds = %7
  %11 = getelementptr inbounds i8, ptr %0, i64 16
  %12 = load i32, ptr %11, align 8, !tbaa !5
  %13 = getelementptr inbounds i8, ptr %1, i64 16
  %14 = load i32, ptr %13, align 8, !tbaa !5
  %.fr54 = freeze i32 %14
  %15 = icmp eq i32 %12, %.fr54
  br i1 %15, label %17, label %16

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

17:                                               ; preds = %10
  %18 = getelementptr inbounds i8, ptr %0, i64 12
  %19 = load i32, ptr %18, align 4, !tbaa !11
  %20 = sitofp i32 %19 to double
  %21 = getelementptr inbounds i8, ptr %1, i64 12
  %22 = load i32, ptr %21, align 4, !tbaa !11
  %23 = sitofp i32 %22 to double
  %24 = fdiv double %20, %23
  %25 = getelementptr inbounds i8, ptr %0, i64 8
  %26 = load i32, ptr %25, align 8, !tbaa !12
  %27 = sitofp i32 %26 to double
  %28 = getelementptr inbounds i8, ptr %1, i64 8
  %29 = load i32, ptr %28, align 8, !tbaa !12
  %30 = sitofp i32 %29 to double
  %31 = fdiv double %27, %30
  %32 = icmp sgt i32 %22, 0
  br i1 %32, label %.preheader.lr.ph, label %._crit_edge

.preheader.lr.ph:                                 ; preds = %17
  %33 = icmp sgt i32 %12, 0
  %34 = getelementptr inbounds i8, ptr %1, i64 20
  %35 = getelementptr inbounds i8, ptr %0, i64 20
  %36 = icmp sgt i32 %29, 0
  br i1 %36, label %.preheader, label %._crit_edge

.preheader:                                       ; preds = %.preheader.lr.ph, %._crit_edge51
  %37 = phi i32 [ %73, %._crit_edge51 ], [ %29, %.preheader.lr.ph ]
  %.052 = phi i32 [ %74, %._crit_edge51 ], [ 0, %.preheader.lr.ph ]
  %38 = icmp sgt i32 %37, 0
  br i1 %38, label %.lr.ph50, label %._crit_edge51

.lr.ph50:                                         ; preds = %.preheader
  %39 = uitofp nneg i32 %.052 to double
  %40 = tail call double @llvm.fmuladd.f64(double %39, double %24, double 5.000000e-01)
  %41 = fptosi double %40 to i32
  br i1 %33, label %.lr.ph.us, label %.lr.ph50.split

.lr.ph.us:                                        ; preds = %.lr.ph50, %._crit_edge.us
  %.04449.us = phi i32 [ %70, %._crit_edge.us ], [ 0, %.lr.ph50 ]
  %42 = uitofp nneg i32 %.04449.us to double
  %43 = tail call double @llvm.fmuladd.f64(double %42, double %31, double 5.000000e-01)
  %44 = fptosi double %43 to i32
  %45 = load i32, ptr %18, align 4, !tbaa !11
  %46 = add nsw i32 %45, -1
  %47 = tail call i32 @px_clamp(i32 noundef %41, i32 noundef 0, i32 noundef %46) #5
  %48 = load i32, ptr %25, align 8, !tbaa !12
  %49 = add nsw i32 %48, -1
  %50 = tail call i32 @px_clamp(i32 noundef %44, i32 noundef 0, i32 noundef %49) #5
  %51 = mul nuw nsw i32 %.04449.us, %12
  %52 = mul nsw i32 %50, %12
  br label %53

53:                                               ; preds = %.lr.ph.us, %53
  %.04348.us = phi i32 [ 0, %.lr.ph.us ], [ %69, %53 ]
  %54 = load i32, ptr %34, align 4, !tbaa !13
  %55 = mul nsw i32 %54, %.052
  %56 = add nuw i32 %.04348.us, %51
  %57 = add i32 %56, %55
  %58 = load i32, ptr %35, align 4, !tbaa !13
  %59 = mul nsw i32 %58, %47
  %60 = add i32 %.04348.us, %52
  %61 = add i32 %60, %59
  %62 = load ptr, ptr %0, align 8, !tbaa !14
  %63 = sext i32 %61 to i64
  %64 = getelementptr inbounds i8, ptr %62, i64 %63
  %65 = load i8, ptr %64, align 1, !tbaa !15
  %66 = load ptr, ptr %1, align 8, !tbaa !14
  %67 = sext i32 %57 to i64
  %68 = getelementptr inbounds i8, ptr %66, i64 %67
  store i8 %65, ptr %68, align 1, !tbaa !15
  %69 = add nuw nsw i32 %.04348.us, 1
  %exitcond.not = icmp eq i32 %69, %12
  br i1 %exitcond.not, label %._crit_edge.us, label %53, !llvm.loop !16

._crit_edge.us:                                   ; preds = %53
  %70 = add nuw nsw i32 %.04449.us, 1
  %71 = load i32, ptr %28, align 8, !tbaa !12
  %72 = icmp slt i32 %70, %71
  br i1 %72, label %.lr.ph.us, label %._crit_edge51, !llvm.loop !18

._crit_edge:                                      ; preds = %._crit_edge51, %.preheader.lr.ph, %17
  ret void

._crit_edge51:                                    ; preds = %.lr.ph50.split, %._crit_edge.us, %.preheader
  %73 = phi i32 [ %37, %.preheader ], [ %71, %._crit_edge.us ], [ %87, %.lr.ph50.split ]
  %74 = add nuw nsw i32 %.052, 1
  %75 = load i32, ptr %21, align 4, !tbaa !11
  %76 = icmp slt i32 %74, %75
  br i1 %76, label %.preheader, label %._crit_edge, !llvm.loop !19

.lr.ph50.split:                                   ; preds = %.lr.ph50, %.lr.ph50.split
  %.04449 = phi i32 [ %86, %.lr.ph50.split ], [ 0, %.lr.ph50 ]
  %77 = uitofp nneg i32 %.04449 to double
  %78 = tail call double @llvm.fmuladd.f64(double %77, double %31, double 5.000000e-01)
  %79 = fptosi double %78 to i32
  %80 = load i32, ptr %18, align 4, !tbaa !11
  %81 = add nsw i32 %80, -1
  %82 = tail call i32 @px_clamp(i32 noundef %41, i32 noundef 0, i32 noundef %81) #5
  %83 = load i32, ptr %25, align 8, !tbaa !12
  %84 = add nsw i32 %83, -1
  %85 = tail call i32 @px_clamp(i32 noundef %79, i32 noundef 0, i32 noundef %84) #5
  %86 = add nuw nsw i32 %.04449, 1
  %87 = load i32, ptr %28, align 8, !tbaa !12
  %88 = icmp slt i32 %86, %87
  br i1 %88, label %.lr.ph50.split, label %._crit_edge51, !llvm.loop !18
}

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #1

declare zeroext i1 @px_image_size_equal(ptr noundef, i64) local_unnamed_addr #2

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #3

declare i32 @px_clamp(i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #2

attributes #0 = { 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 = { noreturn nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #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 nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { noreturn nounwind }
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, !10, i64 16}
!6 = !{!"px_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/C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!6, !10, i64 12}
!12 = !{!6, !10, i64 8}
!13 = !{!6, !10, i64 20}
!14 = !{!6, !7, i64 0}
!15 = !{!8, !8, i64 0}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.mustprogress"}
!18 = distinct !{!18, !17}
!19 = distinct !{!19, !17, !20}
!20 = !{!"llvm.loop.unswitch.partial.disable"}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopInstSimplifyPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimpleLoopUnswitchPass,SimplifyCFGPass,TailCallElimPass