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

; 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_image_t = type { ptr, i32, i32, i32, i32 }

@.str = external hidden unnamed_addr constant [29 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [71 x i8], align 1
@__PRETTY_FUNCTION__.px_threshold = external hidden unnamed_addr constant [73 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [37 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local void @px_threshold(ptr noundef %0, ptr noundef %1, i8 noundef zeroext %2, i8 noundef zeroext %3, i8 noundef zeroext %4) #0 {
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i8, align 1
  %9 = alloca i8, align 1
  %10 = alloca i8, align 1
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca ptr, align 8
  %16 = alloca ptr, align 8
  %17 = alloca i32, align 4
  store ptr %0, ptr %6, align 8, !tbaa !5
  store ptr %1, ptr %7, align 8, !tbaa !5
  store i8 %2, ptr %8, align 1, !tbaa !9
  store i8 %3, ptr %9, align 1, !tbaa !9
  store i8 %4, ptr %10, align 1, !tbaa !9
  %18 = load ptr, ptr %6, align 8, !tbaa !5
  %19 = call zeroext i1 @px_is_valid_gray_image(ptr noundef %18)
  br i1 %19, label %20, label %21

20:                                               ; preds = %5
  br label %22

21:                                               ; preds = %5
  call void @__assert_fail(ptr noundef @.str, ptr noundef @.str.1, i32 noundef 7, ptr noundef @__PRETTY_FUNCTION__.px_threshold) #4
  unreachable

22:                                               ; preds = %20
  %23 = load ptr, ptr %7, align 8, !tbaa !5
  %24 = call zeroext i1 @px_is_valid_gray_image(ptr noundef %23)
  br i1 %24, label %25, label %26

25:                                               ; preds = %22
  br label %27

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

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

31:                                               ; preds = %27
  br label %33

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

33:                                               ; preds = %31
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  %34 = load ptr, ptr %6, align 8, !tbaa !5
  %35 = getelementptr inbounds %struct.px_image_t, ptr %34, i32 0, i32 2
  %36 = load i32, ptr %35, align 4, !tbaa !10
  store i32 %36, ptr %11, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  %37 = load ptr, ptr %6, align 8, !tbaa !5
  %38 = getelementptr inbounds %struct.px_image_t, ptr %37, i32 0, i32 1
  %39 = load i32, ptr %38, align 8, !tbaa !14
  store i32 %39, ptr %12, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  store i32 0, ptr %13, align 4, !tbaa !13
  br label %40

40:                                               ; preds = %98, %33
  %41 = load i32, ptr %13, align 4, !tbaa !13
  %42 = load i32, ptr %11, align 4, !tbaa !13
  %43 = icmp slt i32 %41, %42
  br i1 %43, label %45, label %44

44:                                               ; preds = %40
  store i32 2, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  br label %101

45:                                               ; preds = %40
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #5
  %46 = load ptr, ptr %6, align 8, !tbaa !5
  %47 = getelementptr inbounds %struct.px_image_t, ptr %46, i32 0, i32 0
  %48 = load ptr, ptr %47, align 8, !tbaa !15
  %49 = load i32, ptr %13, align 4, !tbaa !13
  %50 = load ptr, ptr %6, align 8, !tbaa !5
  %51 = getelementptr inbounds %struct.px_image_t, ptr %50, i32 0, i32 4
  %52 = load i32, ptr %51, align 4, !tbaa !16
  %53 = mul nsw i32 %49, %52
  %54 = sext i32 %53 to i64
  %55 = getelementptr inbounds i8, ptr %48, i64 %54
  store ptr %55, ptr %15, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #5
  %56 = load ptr, ptr %7, align 8, !tbaa !5
  %57 = getelementptr inbounds %struct.px_image_t, ptr %56, i32 0, i32 0
  %58 = load ptr, ptr %57, align 8, !tbaa !15
  %59 = load i32, ptr %13, align 4, !tbaa !13
  %60 = load ptr, ptr %7, align 8, !tbaa !5
  %61 = getelementptr inbounds %struct.px_image_t, ptr %60, i32 0, i32 4
  %62 = load i32, ptr %61, align 4, !tbaa !16
  %63 = mul nsw i32 %59, %62
  %64 = sext i32 %63 to i64
  %65 = getelementptr inbounds i8, ptr %58, i64 %64
  store ptr %65, ptr %16, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #5
  store i32 0, ptr %17, align 4, !tbaa !13
  br label %66

66:                                               ; preds = %94, %45
  %67 = load i32, ptr %17, align 4, !tbaa !13
  %68 = load i32, ptr %12, align 4, !tbaa !13
  %69 = icmp slt i32 %67, %68
  br i1 %69, label %71, label %70

70:                                               ; preds = %66
  store i32 5, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #5
  br label %97

71:                                               ; preds = %66
  %72 = load ptr, ptr %15, align 8, !tbaa !5
  %73 = load i32, ptr %17, align 4, !tbaa !13
  %74 = sext i32 %73 to i64
  %75 = getelementptr inbounds i8, ptr %72, i64 %74
  %76 = load i8, ptr %75, align 1, !tbaa !9
  %77 = zext i8 %76 to i32
  %78 = load i8, ptr %8, align 1, !tbaa !9
  %79 = zext i8 %78 to i32
  %80 = icmp sgt i32 %77, %79
  br i1 %80, label %81, label %87

81:                                               ; preds = %71
  %82 = load i8, ptr %10, align 1, !tbaa !9
  %83 = load ptr, ptr %16, align 8, !tbaa !5
  %84 = load i32, ptr %17, align 4, !tbaa !13
  %85 = sext i32 %84 to i64
  %86 = getelementptr inbounds i8, ptr %83, i64 %85
  store i8 %82, ptr %86, align 1, !tbaa !9
  br label %93

87:                                               ; preds = %71
  %88 = load i8, ptr %9, align 1, !tbaa !9
  %89 = load ptr, ptr %16, align 8, !tbaa !5
  %90 = load i32, ptr %17, align 4, !tbaa !13
  %91 = sext i32 %90 to i64
  %92 = getelementptr inbounds i8, ptr %89, i64 %91
  store i8 %88, ptr %92, align 1, !tbaa !9
  br label %93

93:                                               ; preds = %87, %81
  br label %94

94:                                               ; preds = %93
  %95 = load i32, ptr %17, align 4, !tbaa !13
  %96 = add nsw i32 %95, 1
  store i32 %96, ptr %17, align 4, !tbaa !13
  br label %66, !llvm.loop !17

97:                                               ; preds = %70
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  br label %98

98:                                               ; preds = %97
  %99 = load i32, ptr %13, align 4, !tbaa !13
  %100 = add nsw i32 %99, 1
  store i32 %100, ptr %13, align 4, !tbaa !13
  br label %40, !llvm.loop !19

101:                                              ; preds = %44
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  ret void
}

declare zeroext i1 @px_is_valid_gray_image(ptr noundef) #1

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

declare zeroext i1 @px_image_equal_in_size(ptr noundef, ptr noundef) #1

; 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 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 = { "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 = { 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 #3 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!7, !7, i64 0}
!10 = !{!11, !12, i64 12}
!11 = !{!"px_image_t", !6, i64 0, !12, i64 8, !12, i64 12, !12, i64 16, !12, i64 20}
!12 = !{!"int", !7, i64 0}
!13 = !{!12, !12, i64 0}
!14 = !{!11, !12, i64 8}
!15 = !{!11, !6, i64 0}
!16 = !{!11, !12, i64 20}
!17 = distinct !{!17, !18}
!18 = !{!"llvm.loop.mustprogress"}
!19 = distinct !{!19, !18}


; 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 [29 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [71 x i8], align 1
@__PRETTY_FUNCTION__.px_threshold = external hidden unnamed_addr constant [73 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [37 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local void @px_threshold(ptr noundef %0, ptr noundef %1, i8 noundef zeroext %2, i8 noundef zeroext %3, i8 noundef zeroext %4) local_unnamed_addr #0 {
  %6 = tail call zeroext i1 @px_is_valid_gray_image(ptr noundef %0) #3
  br i1 %6, label %8, label %7

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

8:                                                ; preds = %5
  %9 = tail call zeroext i1 @px_is_valid_gray_image(ptr noundef %1) #3
  br i1 %9, label %11, label %10

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

11:                                               ; preds = %8
  %12 = tail call zeroext i1 @px_image_equal_in_size(ptr noundef %0, ptr noundef %1) #3
  br i1 %12, label %14, label %13

13:                                               ; preds = %11
  tail call void @__assert_fail(ptr noundef nonnull @.str.3, ptr noundef nonnull @.str.1, i32 noundef 9, ptr noundef nonnull @__PRETTY_FUNCTION__.px_threshold) #4
  unreachable

14:                                               ; preds = %11
  %15 = getelementptr inbounds i8, ptr %0, i64 12
  %16 = load i32, ptr %15, align 4, !tbaa !5
  %17 = getelementptr inbounds i8, ptr %0, i64 8
  %18 = load i32, ptr %17, align 8, !tbaa !11
  %19 = icmp sgt i32 %16, 0
  br i1 %19, label %.lr.ph30, label %._crit_edge31

.lr.ph30:                                         ; preds = %14
  %20 = getelementptr inbounds i8, ptr %0, i64 20
  %21 = getelementptr inbounds i8, ptr %1, i64 20
  %22 = icmp sgt i32 %18, 0
  br i1 %22, label %.lr.ph.us.preheader, label %._crit_edge31

.lr.ph.us.preheader:                              ; preds = %.lr.ph30
  %wide.trip.count = zext nneg i32 %18 to i64
  %min.iters.check = icmp ult i32 %18, 8
  %min.iters.check35 = icmp ult i32 %18, 32
  %n.vec = and i64 %wide.trip.count, 2147483616
  %broadcast.splatinsert = insertelement <16 x i8> poison, i8 %2, i64 0
  %broadcast.splat = shufflevector <16 x i8> %broadcast.splatinsert, <16 x i8> poison, <16 x i32> zeroinitializer
  %broadcast.splatinsert37 = insertelement <16 x i8> poison, i8 %4, i64 0
  %broadcast.splat38 = shufflevector <16 x i8> %broadcast.splatinsert37, <16 x i8> poison, <16 x i32> zeroinitializer
  %broadcast.splatinsert39 = insertelement <16 x i8> poison, i8 %3, i64 0
  %broadcast.splat40 = shufflevector <16 x i8> %broadcast.splatinsert39, <16 x i8> poison, <16 x i32> zeroinitializer
  %cmp.n = icmp eq i64 %n.vec, %wide.trip.count
  %n.vec.remaining = and i64 %wide.trip.count, 24
  %min.epilog.iters.check = icmp eq i64 %n.vec.remaining, 0
  %n.vec42 = and i64 %wide.trip.count, 2147483640
  %broadcast.splatinsert45 = insertelement <8 x i8> poison, i8 %2, i64 0
  %broadcast.splat46 = shufflevector <8 x i8> %broadcast.splatinsert45, <8 x i8> poison, <8 x i32> zeroinitializer
  %broadcast.splatinsert47 = insertelement <8 x i8> poison, i8 %4, i64 0
  %broadcast.splat48 = shufflevector <8 x i8> %broadcast.splatinsert47, <8 x i8> poison, <8 x i32> zeroinitializer
  %broadcast.splatinsert49 = insertelement <8 x i8> poison, i8 %3, i64 0
  %broadcast.splat50 = shufflevector <8 x i8> %broadcast.splatinsert49, <8 x i8> poison, <8 x i32> zeroinitializer
  %cmp.n52 = icmp eq i64 %n.vec42, %wide.trip.count
  %xtraiter = and i64 %wide.trip.count, 3
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br label %iter.check

iter.check:                                       ; preds = %.lr.ph.us.preheader, %._crit_edge.us
  %.02628.us = phi i32 [ %74, %._crit_edge.us ], [ 0, %.lr.ph.us.preheader ]
  %23 = load ptr, ptr %0, align 8, !tbaa !12
  %24 = load i32, ptr %20, align 4, !tbaa !13
  %25 = mul nsw i32 %24, %.02628.us
  %26 = sext i32 %25 to i64
  %27 = getelementptr inbounds i8, ptr %23, i64 %26
  %28 = load ptr, ptr %1, align 8, !tbaa !12
  %29 = load i32, ptr %21, align 4, !tbaa !13
  %30 = mul nsw i32 %29, %.02628.us
  %31 = sext i32 %30 to i64
  %32 = getelementptr inbounds i8, ptr %28, i64 %31
  br i1 %min.iters.check, label %vec.epilog.scalar.ph.preheader, label %vector.memcheck

vector.memcheck:                                  ; preds = %iter.check
  %33 = ptrtoint ptr %28 to i64
  %34 = ptrtoint ptr %23 to i64
  %35 = add i64 %33, %31
  %36 = add i64 %34, %26
  %37 = sub i64 %35, %36
  %diff.check = icmp ult i64 %37, 32
  br i1 %diff.check, label %vec.epilog.scalar.ph.preheader, label %vector.main.loop.iter.check

vector.main.loop.iter.check:                      ; preds = %vector.memcheck
  br i1 %min.iters.check35, label %vec.epilog.ph, label %vector.body

vector.body:                                      ; preds = %vector.main.loop.iter.check, %vector.body
  %index = phi i64 [ %index.next, %vector.body ], [ 0, %vector.main.loop.iter.check ]
  %38 = getelementptr inbounds i8, ptr %27, i64 %index
  %39 = getelementptr inbounds i8, ptr %38, i64 16
  %wide.load = load <16 x i8>, ptr %38, align 1, !tbaa !14
  %wide.load36 = load <16 x i8>, ptr %39, align 1, !tbaa !14
  %40 = icmp ugt <16 x i8> %wide.load, %broadcast.splat
  %41 = icmp ugt <16 x i8> %wide.load36, %broadcast.splat
  %42 = select <16 x i1> %40, <16 x i8> %broadcast.splat38, <16 x i8> %broadcast.splat40
  %43 = select <16 x i1> %41, <16 x i8> %broadcast.splat38, <16 x i8> %broadcast.splat40
  %44 = getelementptr inbounds i8, ptr %32, i64 %index
  %45 = getelementptr inbounds i8, ptr %44, i64 16
  store <16 x i8> %42, ptr %44, align 1
  store <16 x i8> %43, ptr %45, align 1
  %index.next = add nuw i64 %index, 32
  %46 = icmp eq i64 %index.next, %n.vec
  br i1 %46, label %middle.block, label %vector.body, !llvm.loop !15

middle.block:                                     ; preds = %vector.body
  br i1 %cmp.n, label %._crit_edge.us, label %vec.epilog.iter.check

vec.epilog.iter.check:                            ; preds = %middle.block
  br i1 %min.epilog.iters.check, label %vec.epilog.scalar.ph.preheader, label %vec.epilog.ph

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 ]
  br label %vec.epilog.vector.body

vec.epilog.vector.body:                           ; preds = %vec.epilog.vector.body, %vec.epilog.ph
  %index43 = phi i64 [ %vec.epilog.resume.val, %vec.epilog.ph ], [ %index.next51, %vec.epilog.vector.body ]
  %47 = getelementptr inbounds i8, ptr %27, i64 %index43
  %wide.load44 = load <8 x i8>, ptr %47, align 1, !tbaa !14
  %48 = icmp ugt <8 x i8> %wide.load44, %broadcast.splat46
  %49 = select <8 x i1> %48, <8 x i8> %broadcast.splat48, <8 x i8> %broadcast.splat50
  %50 = getelementptr inbounds i8, ptr %32, i64 %index43
  store <8 x i8> %49, ptr %50, align 1
  %index.next51 = add nuw i64 %index43, 8
  %51 = icmp eq i64 %index.next51, %n.vec42
  br i1 %51, label %vec.epilog.middle.block, label %vec.epilog.vector.body, !llvm.loop !19

vec.epilog.middle.block:                          ; preds = %vec.epilog.vector.body
  br i1 %cmp.n52, label %._crit_edge.us, label %vec.epilog.scalar.ph.preheader

vec.epilog.scalar.ph.preheader:                   ; preds = %vec.epilog.middle.block, %vector.memcheck, %iter.check, %vec.epilog.iter.check
  %indvars.iv.ph = phi i64 [ 0, %iter.check ], [ 0, %vector.memcheck ], [ %n.vec, %vec.epilog.iter.check ], [ %n.vec42, %vec.epilog.middle.block ]
  br i1 %lcmp.mod.not, label %vec.epilog.scalar.ph.prol.loopexit, label %vec.epilog.scalar.ph.prol

vec.epilog.scalar.ph.prol:                        ; preds = %vec.epilog.scalar.ph.preheader, %vec.epilog.scalar.ph.prol
  %indvars.iv.prol = phi i64 [ %indvars.iv.next.prol, %vec.epilog.scalar.ph.prol ], [ %indvars.iv.ph, %vec.epilog.scalar.ph.preheader ]
  %prol.iter = phi i64 [ %prol.iter.next, %vec.epilog.scalar.ph.prol ], [ 0, %vec.epilog.scalar.ph.preheader ]
  %52 = getelementptr inbounds i8, ptr %27, i64 %indvars.iv.prol
  %53 = load i8, ptr %52, align 1, !tbaa !14
  %54 = icmp ugt i8 %53, %2
  %spec.select.prol = select i1 %54, i8 %4, i8 %3
  %55 = getelementptr inbounds i8, ptr %32, i64 %indvars.iv.prol
  store i8 %spec.select.prol, ptr %55, align 1
  %indvars.iv.next.prol = add nuw nsw i64 %indvars.iv.prol, 1
  %prol.iter.next = add i64 %prol.iter, 1
  %prol.iter.cmp.not = icmp eq i64 %prol.iter.next, %xtraiter
  br i1 %prol.iter.cmp.not, label %vec.epilog.scalar.ph.prol.loopexit, label %vec.epilog.scalar.ph.prol, !llvm.loop !20

vec.epilog.scalar.ph.prol.loopexit:               ; preds = %vec.epilog.scalar.ph.prol, %vec.epilog.scalar.ph.preheader
  %indvars.iv.unr = phi i64 [ %indvars.iv.ph, %vec.epilog.scalar.ph.preheader ], [ %indvars.iv.next.prol, %vec.epilog.scalar.ph.prol ]
  %56 = sub nsw i64 %indvars.iv.ph, %wide.trip.count
  %57 = icmp ugt i64 %56, -4
  br i1 %57, label %._crit_edge.us, label %vec.epilog.scalar.ph

vec.epilog.scalar.ph:                             ; preds = %vec.epilog.scalar.ph.prol.loopexit, %vec.epilog.scalar.ph
  %indvars.iv = phi i64 [ %indvars.iv.next.3, %vec.epilog.scalar.ph ], [ %indvars.iv.unr, %vec.epilog.scalar.ph.prol.loopexit ]
  %58 = getelementptr inbounds i8, ptr %27, i64 %indvars.iv
  %59 = load i8, ptr %58, align 1, !tbaa !14
  %60 = icmp ugt i8 %59, %2
  %spec.select = select i1 %60, i8 %4, i8 %3
  %61 = getelementptr inbounds i8, ptr %32, i64 %indvars.iv
  store i8 %spec.select, ptr %61, align 1
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %62 = getelementptr inbounds i8, ptr %27, i64 %indvars.iv.next
  %63 = load i8, ptr %62, align 1, !tbaa !14
  %64 = icmp ugt i8 %63, %2
  %spec.select.1 = select i1 %64, i8 %4, i8 %3
  %65 = getelementptr inbounds i8, ptr %32, i64 %indvars.iv.next
  store i8 %spec.select.1, ptr %65, align 1
  %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
  %66 = getelementptr inbounds i8, ptr %27, i64 %indvars.iv.next.1
  %67 = load i8, ptr %66, align 1, !tbaa !14
  %68 = icmp ugt i8 %67, %2
  %spec.select.2 = select i1 %68, i8 %4, i8 %3
  %69 = getelementptr inbounds i8, ptr %32, i64 %indvars.iv.next.1
  store i8 %spec.select.2, ptr %69, align 1
  %indvars.iv.next.2 = add nuw nsw i64 %indvars.iv, 3
  %70 = getelementptr inbounds i8, ptr %27, i64 %indvars.iv.next.2
  %71 = load i8, ptr %70, align 1, !tbaa !14
  %72 = icmp ugt i8 %71, %2
  %spec.select.3 = select i1 %72, i8 %4, i8 %3
  %73 = getelementptr inbounds i8, ptr %32, i64 %indvars.iv.next.2
  store i8 %spec.select.3, ptr %73, align 1
  %indvars.iv.next.3 = add nuw nsw i64 %indvars.iv, 4
  %exitcond.not.3 = icmp eq i64 %indvars.iv.next.3, %wide.trip.count
  br i1 %exitcond.not.3, label %._crit_edge.us, label %vec.epilog.scalar.ph, !llvm.loop !22

._crit_edge.us:                                   ; preds = %vec.epilog.scalar.ph.prol.loopexit, %vec.epilog.scalar.ph, %vec.epilog.middle.block, %middle.block
  %74 = add nuw nsw i32 %.02628.us, 1
  %exitcond34.not = icmp eq i32 %74, %16
  br i1 %exitcond34.not, label %._crit_edge31, label %iter.check, !llvm.loop !23

._crit_edge31:                                    ; preds = %._crit_edge.us, %.lr.ph30, %14
  ret void
}

declare zeroext i1 @px_is_valid_gray_image(ptr noundef) local_unnamed_addr #1

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

declare zeroext i1 @px_image_equal_in_size(ptr noundef, ptr noundef) local_unnamed_addr #1

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 = { "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 = { 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 #3 = { nounwind }
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, !10, i64 12}
!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 8}
!12 = !{!6, !7, i64 0}
!13 = !{!6, !10, i64 20}
!14 = !{!8, !8, i64 0}
!15 = distinct !{!15, !16, !17, !18}
!16 = !{!"llvm.loop.mustprogress"}
!17 = !{!"llvm.loop.isvectorized", i32 1}
!18 = !{!"llvm.loop.unroll.runtime.disable"}
!19 = distinct !{!19, !16, !17, !18}
!20 = distinct !{!20, !21}
!21 = !{!"llvm.loop.unroll.disable"}
!22 = distinct !{!22, !16, !17}
!23 = distinct !{!23, !16}


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