; LLVM IR from cornell-zhang/rosetta :: optical-flow/imageLib/Image.ll (ZN6CImage9SetPixelsEPv)

; 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.CImage = type <{ %struct.CImageAttributes, %struct.CShape, [4 x i8], ptr, i32, i32, i32, [4 x i8], ptr, %class.CRefCntMem, i32, [4 x i8] }>
%struct.CImageAttributes = type { i32, [2 x i32], i32 }
%struct.CShape = type { i32, i32, i32 }
%class.CRefCntMem = type { ptr }

; 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) #0

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZN6CImage12PixelAddressEiii(ptr noundef nonnull align 8 dereferenceable(76), i32 noundef, i32 noundef, i32 noundef) #2 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN6CImage9SetPixelsEPv(ptr noundef nonnull align 8 dereferenceable(76) %0, ptr noundef %1) #3 align 2 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i8, align 1
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  %13 = alloca ptr, align 8
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %16 = load ptr, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #5
  %17 = load ptr, ptr %4, align 8, !tbaa !5
  store ptr %17, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr %6) #5
  store i8 1, ptr %6, align 1, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  store i32 0, ptr %7, align 4, !tbaa !11
  br label %18

18:                                               ; preds = %42, %2
  %19 = load i32, ptr %7, align 4, !tbaa !11
  %20 = getelementptr inbounds %class.CImage, ptr %16, i32 0, i32 4
  %21 = load i32, ptr %20, align 8, !tbaa !13
  %22 = icmp slt i32 %19, %21
  br i1 %22, label %24, label %23

23:                                               ; preds = %18
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  br label %45

24:                                               ; preds = %18
  %25 = load i8, ptr %6, align 1, !tbaa !9, !range !19, !noundef !20
  %26 = trunc i8 %25 to i1
  br i1 %26, label %27, label %39

27:                                               ; preds = %24
  %28 = load ptr, ptr %5, align 8, !tbaa !5
  %29 = load i32, ptr %7, align 4, !tbaa !11
  %30 = sext i32 %29 to i64
  %31 = getelementptr inbounds i8, ptr %28, i64 %30
  %32 = load i8, ptr %31, align 1, !tbaa !21
  %33 = zext i8 %32 to i32
  %34 = load ptr, ptr %5, align 8, !tbaa !5
  %35 = getelementptr inbounds i8, ptr %34, i64 0
  %36 = load i8, ptr %35, align 1, !tbaa !21
  %37 = zext i8 %36 to i32
  %38 = icmp eq i32 %33, %37
  br label %39

39:                                               ; preds = %27, %24
  %40 = phi i1 [ false, %24 ], [ %38, %27 ]
  %41 = zext i1 %40 to i8
  store i8 %41, ptr %6, align 1, !tbaa !9
  br label %42

42:                                               ; preds = %39
  %43 = load i32, ptr %7, align 4, !tbaa !11
  %44 = add nsw i32 %43, 1
  store i32 %44, ptr %7, align 4, !tbaa !11
  br label %18, !llvm.loop !22

45:                                               ; preds = %23
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  %46 = getelementptr inbounds %class.CImage, ptr %16, i32 0, i32 1
  %47 = getelementptr inbounds %struct.CShape, ptr %46, i32 0, i32 0
  %48 = load i32, ptr %47, align 8, !tbaa !24
  %49 = getelementptr inbounds %class.CImage, ptr %16, i32 0, i32 1
  %50 = getelementptr inbounds %struct.CShape, ptr %49, i32 0, i32 2
  %51 = load i32, ptr %50, align 8, !tbaa !25
  %52 = mul nsw i32 %48, %51
  store i32 %52, ptr %8, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  store i32 0, ptr %9, align 4, !tbaa !11
  br label %53

53:                                               ; preds = %124, %45
  %54 = load i32, ptr %9, align 4, !tbaa !11
  %55 = getelementptr inbounds %class.CImage, ptr %16, i32 0, i32 1
  %56 = getelementptr inbounds %struct.CShape, ptr %55, i32 0, i32 1
  %57 = load i32, ptr %56, align 4, !tbaa !26
  %58 = icmp slt i32 %54, %57
  br i1 %58, label %60, label %59

59:                                               ; preds = %53
  store i32 5, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  br label %127

60:                                               ; preds = %53
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  %61 = load i32, ptr %9, align 4, !tbaa !11
  %62 = call noundef ptr @_ZN6CImage12PixelAddressEiii(ptr noundef nonnull align 8 dereferenceable(76) %16, i32 noundef 0, i32 noundef %61, i32 noundef 0)
  store ptr %62, ptr %11, align 8, !tbaa !5
  %63 = load i8, ptr %6, align 1, !tbaa !9, !range !19, !noundef !20
  %64 = trunc i8 %63 to i1
  br i1 %64, label %65, label %77

65:                                               ; preds = %60
  %66 = load ptr, ptr %11, align 8, !tbaa !5
  %67 = load ptr, ptr %5, align 8, !tbaa !5
  %68 = getelementptr inbounds i8, ptr %67, i64 0
  %69 = load i8, ptr %68, align 1, !tbaa !21
  %70 = zext i8 %69 to i32
  %71 = trunc i32 %70 to i8
  %72 = load i32, ptr %8, align 4, !tbaa !11
  %73 = getelementptr inbounds %class.CImage, ptr %16, i32 0, i32 4
  %74 = load i32, ptr %73, align 8, !tbaa !13
  %75 = mul nsw i32 %72, %74
  %76 = sext i32 %75 to i64
  call void @llvm.memset.p0.i64(ptr align 1 %66, i8 %71, i64 %76, i1 false)
  br label %123

77:                                               ; preds = %60
  %78 = getelementptr inbounds %class.CImage, ptr %16, i32 0, i32 4
  %79 = load i32, ptr %78, align 8, !tbaa !13
  %80 = sext i32 %79 to i64
  %81 = icmp eq i64 %80, 4
  br i1 %81, label %82, label %101

82:                                               ; preds = %77
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  %83 = load ptr, ptr %4, align 8, !tbaa !5
  %84 = load i32, ptr %83, align 4, !tbaa !11
  store i32 %84, ptr %12, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #5
  %85 = load ptr, ptr %11, align 8, !tbaa !5
  store ptr %85, ptr %13, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #5
  store i32 0, ptr %14, align 4, !tbaa !11
  br label %86

86:                                               ; preds = %97, %82
  %87 = load i32, ptr %14, align 4, !tbaa !11
  %88 = load i32, ptr %8, align 4, !tbaa !11
  %89 = icmp slt i32 %87, %88
  br i1 %89, label %91, label %90

90:                                               ; preds = %86
  store i32 8, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  br label %100

91:                                               ; preds = %86
  %92 = load i32, ptr %12, align 4, !tbaa !11
  %93 = load ptr, ptr %13, align 8, !tbaa !5
  %94 = load i32, ptr %14, align 4, !tbaa !11
  %95 = sext i32 %94 to i64
  %96 = getelementptr inbounds i32, ptr %93, i64 %95
  store i32 %92, ptr %96, align 4, !tbaa !11
  br label %97

97:                                               ; preds = %91
  %98 = load i32, ptr %14, align 4, !tbaa !11
  %99 = add nsw i32 %98, 1
  store i32 %99, ptr %14, align 4, !tbaa !11
  br label %86, !llvm.loop !27

100:                                              ; preds = %90
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  br label %122

101:                                              ; preds = %77
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #5
  store i32 0, ptr %15, align 4, !tbaa !11
  br label %102

102:                                              ; preds = %113, %101
  %103 = load i32, ptr %15, align 4, !tbaa !11
  %104 = load i32, ptr %8, align 4, !tbaa !11
  %105 = icmp slt i32 %103, %104
  br i1 %105, label %107, label %106

106:                                              ; preds = %102
  store i32 11, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #5
  br label %121

107:                                              ; preds = %102
  %108 = load ptr, ptr %11, align 8, !tbaa !5
  %109 = load ptr, ptr %5, align 8, !tbaa !5
  %110 = getelementptr inbounds %class.CImage, ptr %16, i32 0, i32 4
  %111 = load i32, ptr %110, align 8, !tbaa !13
  %112 = sext i32 %111 to i64
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %108, ptr align 1 %109, i64 %112, i1 false)
  br label %113

113:                                              ; preds = %107
  %114 = load i32, ptr %15, align 4, !tbaa !11
  %115 = add nsw i32 %114, 1
  store i32 %115, ptr %15, align 4, !tbaa !11
  %116 = getelementptr inbounds %class.CImage, ptr %16, i32 0, i32 4
  %117 = load i32, ptr %116, align 8, !tbaa !13
  %118 = load ptr, ptr %11, align 8, !tbaa !5
  %119 = sext i32 %117 to i64
  %120 = getelementptr inbounds i8, ptr %118, i64 %119
  store ptr %120, ptr %11, align 8, !tbaa !5
  br label %102, !llvm.loop !28

121:                                              ; preds = %106
  br label %122

122:                                              ; preds = %121, %100
  br label %123

123:                                              ; preds = %122, %65
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  br label %124

124:                                              ; preds = %123
  %125 = load i32, ptr %9, align 4, !tbaa !11
  %126 = add nsw i32 %125, 1
  store i32 %126, ptr %9, align 4, !tbaa !11
  br label %53, !llvm.loop !29

127:                                              ; preds = %59
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #5
  ret void
}

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4

attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { inlinehint 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 = { 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 #4 = { nocallback nofree nounwind willreturn memory(argmem: write) }
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++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"bool", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!14, !12, i64 40}
!14 = !{!"_ZTS6CImage", !15, i64 0, !17, i64 16, !6, i64 32, !12, i64 40, !12, i64 44, !12, i64 48, !6, i64 56, !18, i64 64, !12, i64 72}
!15 = !{!"_ZTS16CImageAttributes", !12, i64 0, !7, i64 4, !16, i64 12}
!16 = !{!"_ZTS11EBorderMode", !7, i64 0}
!17 = !{!"_ZTS6CShape", !12, i64 0, !12, i64 4, !12, i64 8}
!18 = !{!"_ZTS10CRefCntMem", !6, i64 0}
!19 = !{i8 0, i8 2}
!20 = !{}
!21 = !{!7, !7, i64 0}
!22 = distinct !{!22, !23}
!23 = !{!"llvm.loop.mustprogress"}
!24 = !{!14, !12, i64 16}
!25 = !{!14, !12, i64 24}
!26 = !{!14, !12, i64 20}
!27 = distinct !{!27, !23}
!28 = distinct !{!28, !23}
!29 = distinct !{!29, !23}


; 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 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) #0

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZN6CImage12PixelAddressEiii(ptr noundef nonnull align 8 dereferenceable(76), i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_ZN6CImage9SetPixelsEPv(ptr noundef nonnull align 8 dereferenceable(76) %0, ptr nocapture noundef readonly %1) local_unnamed_addr #2 align 2 {
  %3 = getelementptr inbounds i8, ptr %0, i64 40
  %4 = load i32, ptr %3, align 8, !tbaa !5
  %5 = icmp sgt i32 %4, 0
  br i1 %5, label %.lr.ph.preheader, label %._crit_edge.thread

.lr.ph.preheader:                                 ; preds = %2
  %wide.trip.count = zext nneg i32 %4 to i64
  %xtraiter = and i64 %wide.trip.count, 3
  %6 = icmp ult i32 %4, 4
  br i1 %6, label %._crit_edge.unr-lcssa, label %.lr.ph.preheader.new

.lr.ph.preheader.new:                             ; preds = %.lr.ph.preheader
  %unroll_iter = and i64 %wide.trip.count, 2147483644
  br label %.lr.ph

._crit_edge.unr-lcssa:                            ; preds = %89, %.lr.ph.preheader
  %.lcssa.ph = phi i1 [ poison, %.lr.ph.preheader ], [ %91, %89 ]
  %indvars.iv.unr = phi i64 [ 0, %.lr.ph.preheader ], [ %indvars.iv.next.3, %89 ]
  %.02935.unr = phi i1 [ true, %.lr.ph.preheader ], [ %91, %89 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge, label %.lr.ph.epil

.lr.ph.epil:                                      ; preds = %._crit_edge.unr-lcssa, %12
  %indvars.iv.epil = phi i64 [ %indvars.iv.next.epil, %12 ], [ %indvars.iv.unr, %._crit_edge.unr-lcssa ]
  %.02935.epil = phi i1 [ %14, %12 ], [ %.02935.unr, %._crit_edge.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %12 ], [ 0, %._crit_edge.unr-lcssa ]
  br i1 %.02935.epil, label %7, label %12

7:                                                ; preds = %.lr.ph.epil
  %8 = getelementptr inbounds i8, ptr %1, i64 %indvars.iv.epil
  %9 = load i8, ptr %8, align 1, !tbaa !15
  %10 = load i8, ptr %1, align 1, !tbaa !15
  %11 = icmp eq i8 %9, %10
  br label %12

12:                                               ; preds = %7, %.lr.ph.epil
  %13 = phi i1 [ false, %.lr.ph.epil ], [ %11, %7 ]
  %14 = freeze i1 %13
  %indvars.iv.next.epil = add nuw nsw i64 %indvars.iv.epil, 1
  %epil.iter.next = add i64 %epil.iter, 1
  %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
  br i1 %epil.iter.cmp.not, label %._crit_edge, label %.lr.ph.epil, !llvm.loop !16

._crit_edge:                                      ; preds = %12, %._crit_edge.unr-lcssa
  %.lcssa = phi i1 [ %.lcssa.ph, %._crit_edge.unr-lcssa ], [ %14, %12 ]
  %15 = getelementptr inbounds i8, ptr %0, i64 16
  %16 = load i32, ptr %15, align 8, !tbaa !18
  %17 = getelementptr inbounds i8, ptr %0, i64 24
  %18 = load i32, ptr %17, align 8, !tbaa !19
  %19 = mul nsw i32 %18, %16
  %.fr54 = freeze i32 %19
  %20 = getelementptr inbounds i8, ptr %0, i64 20
  %21 = load i32, ptr %20, align 4, !tbaa !20
  %22 = icmp sgt i32 %21, 0
  br i1 %22, label %.lr.ph44, label %._crit_edge45

._crit_edge.thread:                               ; preds = %2
  %23 = getelementptr inbounds i8, ptr %0, i64 16
  %24 = load i32, ptr %23, align 8, !tbaa !18
  %25 = getelementptr inbounds i8, ptr %0, i64 24
  %26 = load i32, ptr %25, align 8, !tbaa !19
  %27 = mul nsw i32 %26, %24
  %.fr5471 = freeze i32 %27
  %28 = getelementptr inbounds i8, ptr %0, i64 20
  %29 = load i32, ptr %28, align 4, !tbaa !20
  %30 = icmp sgt i32 %29, 0
  br i1 %30, label %.lr.ph44.split.us.preheader, label %._crit_edge45

.lr.ph44:                                         ; preds = %._crit_edge
  br i1 %.lcssa, label %.lr.ph44.split.us.preheader, label %.lr.ph44.split

.lr.ph44.split.us.preheader:                      ; preds = %._crit_edge.thread, %.lr.ph44
  %.fr547376 = phi i32 [ %.fr54, %.lr.ph44 ], [ %.fr5471, %._crit_edge.thread ]
  %31 = phi ptr [ %20, %.lr.ph44 ], [ %28, %._crit_edge.thread ]
  br label %.lr.ph44.split.us

.lr.ph44.split.us:                                ; preds = %.lr.ph44.split.us.preheader, %.lr.ph44.split.us
  %.03242.us = phi i32 [ %37, %.lr.ph44.split.us ], [ 0, %.lr.ph44.split.us.preheader ]
  %32 = tail call noundef ptr @_ZN6CImage12PixelAddressEiii(ptr noundef nonnull align 8 dereferenceable(76) %0, i32 noundef 0, i32 noundef %.03242.us, i32 noundef 0)
  %33 = load i8, ptr %1, align 1, !tbaa !15
  %34 = load i32, ptr %3, align 8, !tbaa !5
  %35 = mul nsw i32 %34, %.fr547376
  %36 = sext i32 %35 to i64
  tail call void @llvm.memset.p0.i64(ptr align 1 %32, i8 %33, i64 %36, i1 false)
  %37 = add nuw nsw i32 %.03242.us, 1
  %38 = load i32, ptr %31, align 4, !tbaa !20
  %39 = icmp slt i32 %37, %38
  br i1 %39, label %.lr.ph44.split.us, label %._crit_edge45, !llvm.loop !21

.lr.ph44.split:                                   ; preds = %.lr.ph44
  %40 = icmp sgt i32 %.fr54, 0
  br i1 %40, label %.lr.ph44.split.split.us.preheader, label %.lr.ph44.split.split.split

.lr.ph44.split.split.us.preheader:                ; preds = %.lr.ph44.split
  %wide.trip.count68 = zext nneg i32 %.fr54 to i64
  %xtraiter88 = and i32 %.fr54, 1
  %41 = icmp eq i32 %.fr54, 1
  %unroll_iter91 = and i32 %.fr54, 2147483646
  %lcmp.mod90.not = icmp eq i32 %xtraiter88, 0
  %min.iters.check = icmp ult i32 %.fr54, 8
  %n.vec = and i64 %wide.trip.count68, 2147483640
  %cmp.n = icmp eq i64 %n.vec, %wide.trip.count68
  br label %.lr.ph44.split.split.us

.lr.ph44.split.split.us:                          ; preds = %.lr.ph44.split.split.us.preheader, %.loopexit.us
  %.03242.us46 = phi i32 [ %60, %.loopexit.us ], [ 0, %.lr.ph44.split.split.us.preheader ]
  %42 = tail call noundef ptr @_ZN6CImage12PixelAddressEiii(ptr noundef nonnull align 8 dereferenceable(76) %0, i32 noundef 0, i32 noundef %.03242.us46, i32 noundef 0)
  %43 = load i32, ptr %3, align 8, !tbaa !5
  %44 = icmp eq i32 %43, 4
  br i1 %44, label %.lr.ph41.us.preheader, label %.preheader.us.preheader

.preheader.us.preheader:                          ; preds = %.lr.ph44.split.split.us
  br i1 %41, label %.loopexit.us.loopexit84.unr-lcssa, label %.preheader.us

.preheader.us:                                    ; preds = %.preheader.us.preheader, %.preheader.us
  %45 = phi i32 [ %51, %.preheader.us ], [ %43, %.preheader.us.preheader ]
  %.03136.us = phi ptr [ %53, %.preheader.us ], [ %42, %.preheader.us.preheader ]
  %niter92 = phi i32 [ %niter92.next.1, %.preheader.us ], [ 0, %.preheader.us.preheader ]
  %46 = sext i32 %45 to i64
  tail call void @llvm.memcpy.p0.p0.i64(ptr align 1 %.03136.us, ptr align 1 %1, i64 %46, i1 false)
  %47 = load i32, ptr %3, align 8, !tbaa !5
  %48 = sext i32 %47 to i64
  %49 = getelementptr inbounds i8, ptr %.03136.us, i64 %48
  %50 = sext i32 %47 to i64
  tail call void @llvm.memcpy.p0.p0.i64(ptr align 1 %49, ptr align 1 %1, i64 %50, i1 false)
  %51 = load i32, ptr %3, align 8, !tbaa !5
  %52 = sext i32 %51 to i64
  %53 = getelementptr inbounds i8, ptr %49, i64 %52
  %niter92.next.1 = add i32 %niter92, 2
  %niter92.ncmp.1 = icmp eq i32 %niter92.next.1, %unroll_iter91
  br i1 %niter92.ncmp.1, label %.loopexit.us.loopexit84.unr-lcssa, label %.preheader.us, !llvm.loop !23

.lr.ph41.us.preheader:                            ; preds = %.lr.ph44.split.split.us
  %54 = load i32, ptr %1, align 4, !tbaa !24
  br i1 %min.iters.check, label %.lr.ph41.us.preheader83, label %vector.ph

vector.ph:                                        ; preds = %.lr.ph41.us.preheader
  %broadcast.splatinsert = insertelement <4 x i32> poison, i32 %54, i64 0
  %broadcast.splat = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %55 = getelementptr inbounds i32, ptr %42, i64 %index
  %56 = getelementptr inbounds i8, ptr %55, i64 16
  store <4 x i32> %broadcast.splat, ptr %55, align 4, !tbaa !24
  store <4 x i32> %broadcast.splat, ptr %56, align 4, !tbaa !24
  %index.next = add nuw i64 %index, 8
  %57 = icmp eq i64 %index.next, %n.vec
  br i1 %57, label %middle.block, label %vector.body, !llvm.loop !25

middle.block:                                     ; preds = %vector.body
  br i1 %cmp.n, label %.loopexit.us, label %.lr.ph41.us.preheader83

.lr.ph41.us.preheader83:                          ; preds = %middle.block, %.lr.ph41.us.preheader
  %indvars.iv65.ph = phi i64 [ 0, %.lr.ph41.us.preheader ], [ %n.vec, %middle.block ]
  br label %.lr.ph41.us

.lr.ph41.us:                                      ; preds = %.lr.ph41.us.preheader83, %.lr.ph41.us
  %indvars.iv65 = phi i64 [ %indvars.iv.next66, %.lr.ph41.us ], [ %indvars.iv65.ph, %.lr.ph41.us.preheader83 ]
  %58 = getelementptr inbounds i32, ptr %42, i64 %indvars.iv65
  store i32 %54, ptr %58, align 4, !tbaa !24
  %indvars.iv.next66 = add nuw nsw i64 %indvars.iv65, 1
  %exitcond69.not = icmp eq i64 %indvars.iv.next66, %wide.trip.count68
  br i1 %exitcond69.not, label %.loopexit.us, label %.lr.ph41.us, !llvm.loop !28

.loopexit.us.loopexit84.unr-lcssa:                ; preds = %.preheader.us, %.preheader.us.preheader
  %.unr = phi i32 [ %43, %.preheader.us.preheader ], [ %51, %.preheader.us ]
  %.03136.us.unr = phi ptr [ %42, %.preheader.us.preheader ], [ %53, %.preheader.us ]
  br i1 %lcmp.mod90.not, label %.loopexit.us, label %.preheader.us.epil

.preheader.us.epil:                               ; preds = %.loopexit.us.loopexit84.unr-lcssa
  %59 = sext i32 %.unr to i64
  tail call void @llvm.memcpy.p0.p0.i64(ptr align 1 %.03136.us.unr, ptr align 1 %1, i64 %59, i1 false)
  br label %.loopexit.us

.loopexit.us:                                     ; preds = %.preheader.us.epil, %.loopexit.us.loopexit84.unr-lcssa, %.lr.ph41.us, %middle.block
  %60 = add nuw nsw i32 %.03242.us46, 1
  %61 = load i32, ptr %20, align 4, !tbaa !20
  %62 = icmp slt i32 %60, %61
  br i1 %62, label %.lr.ph44.split.split.us, label %._crit_edge45, !llvm.loop !21

.lr.ph:                                           ; preds = %89, %.lr.ph.preheader.new
  %indvars.iv = phi i64 [ 0, %.lr.ph.preheader.new ], [ %indvars.iv.next.3, %89 ]
  %.02935 = phi i1 [ true, %.lr.ph.preheader.new ], [ %91, %89 ]
  %niter = phi i64 [ 0, %.lr.ph.preheader.new ], [ %niter.next.3, %89 ]
  br i1 %.02935, label %63, label %.lr.ph.1

63:                                               ; preds = %.lr.ph
  %64 = getelementptr inbounds i8, ptr %1, i64 %indvars.iv
  %65 = load i8, ptr %64, align 1, !tbaa !15
  %66 = load i8, ptr %1, align 1, !tbaa !15
  %67 = icmp eq i8 %65, %66
  br label %.lr.ph.1

.lr.ph.1:                                         ; preds = %63, %.lr.ph
  %68 = phi i1 [ false, %.lr.ph ], [ %67, %63 ]
  %69 = freeze i1 %68
  br i1 %69, label %70, label %.lr.ph.2

70:                                               ; preds = %.lr.ph.1
  %indvars.iv.next = or disjoint i64 %indvars.iv, 1
  %71 = getelementptr inbounds i8, ptr %1, i64 %indvars.iv.next
  %72 = load i8, ptr %71, align 1, !tbaa !15
  %73 = load i8, ptr %1, align 1, !tbaa !15
  %74 = icmp eq i8 %72, %73
  br label %.lr.ph.2

.lr.ph.2:                                         ; preds = %70, %.lr.ph.1
  %75 = phi i1 [ false, %.lr.ph.1 ], [ %74, %70 ]
  %76 = freeze i1 %75
  br i1 %76, label %77, label %.lr.ph.3

77:                                               ; preds = %.lr.ph.2
  %indvars.iv.next.1 = or disjoint i64 %indvars.iv, 2
  %78 = getelementptr inbounds i8, ptr %1, i64 %indvars.iv.next.1
  %79 = load i8, ptr %78, align 1, !tbaa !15
  %80 = load i8, ptr %1, align 1, !tbaa !15
  %81 = icmp eq i8 %79, %80
  br label %.lr.ph.3

.lr.ph.3:                                         ; preds = %77, %.lr.ph.2
  %82 = phi i1 [ false, %.lr.ph.2 ], [ %81, %77 ]
  %83 = freeze i1 %82
  br i1 %83, label %84, label %89

84:                                               ; preds = %.lr.ph.3
  %indvars.iv.next.2 = or disjoint i64 %indvars.iv, 3
  %85 = getelementptr inbounds i8, ptr %1, i64 %indvars.iv.next.2
  %86 = load i8, ptr %85, align 1, !tbaa !15
  %87 = load i8, ptr %1, align 1, !tbaa !15
  %88 = icmp eq i8 %86, %87
  br label %89

89:                                               ; preds = %84, %.lr.ph.3
  %90 = phi i1 [ false, %.lr.ph.3 ], [ %88, %84 ]
  %91 = freeze i1 %90
  %indvars.iv.next.3 = add nuw nsw i64 %indvars.iv, 4
  %niter.next.3 = add i64 %niter, 4
  %niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
  br i1 %niter.ncmp.3, label %._crit_edge.unr-lcssa, label %.lr.ph, !llvm.loop !29

._crit_edge45:                                    ; preds = %.lr.ph44.split.split.split, %.loopexit.us, %.lr.ph44.split.us, %._crit_edge.thread, %._crit_edge
  ret void

.lr.ph44.split.split.split:                       ; preds = %.lr.ph44.split, %.lr.ph44.split.split.split
  %.03242 = phi i32 [ %93, %.lr.ph44.split.split.split ], [ 0, %.lr.ph44.split ]
  %92 = tail call noundef ptr @_ZN6CImage12PixelAddressEiii(ptr noundef nonnull align 8 dereferenceable(76) %0, i32 noundef 0, i32 noundef %.03242, i32 noundef 0)
  %93 = add nuw nsw i32 %.03242, 1
  %94 = load i32, ptr %20, align 4, !tbaa !20
  %95 = icmp slt i32 %93, %94
  br i1 %95, label %.lr.ph44.split.split.split, label %._crit_edge45, !llvm.loop !21
}

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3

attributes #0 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { inlinehint 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 #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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !8, i64 40}
!6 = !{!"_ZTS6CImage", !7, i64 0, !12, i64 16, !13, i64 32, !8, i64 40, !8, i64 44, !8, i64 48, !13, i64 56, !14, i64 64, !8, i64 72}
!7 = !{!"_ZTS16CImageAttributes", !8, i64 0, !9, i64 4, !11, i64 12}
!8 = !{!"int", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C++ TBAA"}
!11 = !{!"_ZTS11EBorderMode", !9, i64 0}
!12 = !{!"_ZTS6CShape", !8, i64 0, !8, i64 4, !8, i64 8}
!13 = !{!"any pointer", !9, i64 0}
!14 = !{!"_ZTS10CRefCntMem", !13, i64 0}
!15 = !{!9, !9, i64 0}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.unroll.disable"}
!18 = !{!6, !8, i64 16}
!19 = !{!6, !8, i64 24}
!20 = !{!6, !8, i64 20}
!21 = distinct !{!21, !22}
!22 = !{!"llvm.loop.mustprogress"}
!23 = distinct !{!23, !22}
!24 = !{!8, !8, i64 0}
!25 = distinct !{!25, !22, !26, !27}
!26 = !{!"llvm.loop.isvectorized", i32 1}
!27 = !{!"llvm.loop.unroll.runtime.disable"}
!28 = distinct !{!28, !22, !27, !26}
!29 = distinct !{!29, !22}


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