; LLVM IR from Wilson-ZheLin/Introduction-to-Digital-Image-Processing :: 9. Thresholding, Roberts, Prewitt, Sobel, and Edge Detection/src (main)

; 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.Image = type { i32, i32, i32, ptr, [15 x [100 x i8]], i32 }

@.str.5 = external hidden unnamed_addr constant [18 x i8], align 1

; 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
declare dso_local noundef ptr @_Z14CreateNewImageP5ImagePc(ptr noundef, ptr noundef) #1

; Function Attrs: mustprogress uwtable
define dso_local noundef ptr @_Z9ThresholdP5Image(ptr noundef %0) #1 {
  %2 = alloca ptr, align 8
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #3
  %11 = load ptr, ptr %2, align 8, !tbaa !5
  %12 = getelementptr inbounds %struct.Image, ptr %11, i32 0, i32 0
  %13 = load i32, ptr %12, align 8, !tbaa !9
  %14 = load ptr, ptr %2, align 8, !tbaa !5
  %15 = getelementptr inbounds %struct.Image, ptr %14, i32 0, i32 1
  %16 = load i32, ptr %15, align 4, !tbaa !12
  %17 = mul nsw i32 %13, %16
  store i32 %17, ptr %6, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #3
  store i32 0, ptr %7, align 4, !tbaa !13
  %18 = load ptr, ptr %2, align 8, !tbaa !5
  %19 = call noundef ptr @_Z14CreateNewImageP5ImagePc(ptr noundef %18, ptr noundef @.str.5)
  store ptr %19, ptr %5, align 8, !tbaa !5
  %20 = load ptr, ptr %2, align 8, !tbaa !5
  %21 = getelementptr inbounds %struct.Image, ptr %20, i32 0, i32 3
  %22 = load ptr, ptr %21, align 8, !tbaa !14
  store ptr %22, ptr %3, align 8, !tbaa !5
  %23 = load ptr, ptr %5, align 8, !tbaa !5
  %24 = getelementptr inbounds %struct.Image, ptr %23, i32 0, i32 3
  %25 = load ptr, ptr %24, align 8, !tbaa !14
  store ptr %25, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #3
  store i32 0, ptr %8, align 4, !tbaa !13
  br label %26

26:                                               ; preds = %48, %1
  %27 = load i32, ptr %8, align 4, !tbaa !13
  %28 = load i32, ptr %6, align 4, !tbaa !13
  %29 = icmp slt i32 %27, %28
  br i1 %29, label %31, label %30

30:                                               ; preds = %26
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #3
  br label %51

31:                                               ; preds = %26
  %32 = load ptr, ptr %3, align 8, !tbaa !5
  %33 = load i32, ptr %8, align 4, !tbaa !13
  %34 = sext i32 %33 to i64
  %35 = getelementptr inbounds i8, ptr %32, i64 %34
  %36 = load i8, ptr %35, align 1, !tbaa !15
  %37 = zext i8 %36 to i32
  %38 = load i32, ptr %7, align 4, !tbaa !13
  %39 = icmp sgt i32 %37, %38
  br i1 %39, label %40, label %47

40:                                               ; preds = %31
  %41 = load ptr, ptr %3, align 8, !tbaa !5
  %42 = load i32, ptr %8, align 4, !tbaa !13
  %43 = sext i32 %42 to i64
  %44 = getelementptr inbounds i8, ptr %41, i64 %43
  %45 = load i8, ptr %44, align 1, !tbaa !15
  %46 = zext i8 %45 to i32
  store i32 %46, ptr %7, align 4, !tbaa !13
  br label %47

47:                                               ; preds = %40, %31
  br label %48

48:                                               ; preds = %47
  %49 = load i32, ptr %8, align 4, !tbaa !13
  %50 = add nsw i32 %49, 1
  store i32 %50, ptr %8, align 4, !tbaa !13
  br label %26, !llvm.loop !16

51:                                               ; preds = %30
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #3
  %52 = load i32, ptr %7, align 4, !tbaa !13
  %53 = sitofp i32 %52 to float
  %54 = fpext float %53 to double
  %55 = fmul double %54, 3.300000e-01
  %56 = call double @llvm.round.f64(double %55)
  %57 = fptosi double %56 to i32
  store i32 %57, ptr %9, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #3
  store i32 0, ptr %10, align 4, !tbaa !13
  br label %58

58:                                               ; preds = %83, %51
  %59 = load i32, ptr %10, align 4, !tbaa !13
  %60 = load i32, ptr %6, align 4, !tbaa !13
  %61 = icmp slt i32 %59, %60
  br i1 %61, label %63, label %62

62:                                               ; preds = %58
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #3
  br label %86

63:                                               ; preds = %58
  %64 = load ptr, ptr %3, align 8, !tbaa !5
  %65 = load i32, ptr %10, align 4, !tbaa !13
  %66 = sext i32 %65 to i64
  %67 = getelementptr inbounds i8, ptr %64, i64 %66
  %68 = load i8, ptr %67, align 1, !tbaa !15
  %69 = zext i8 %68 to i32
  %70 = load i32, ptr %9, align 4, !tbaa !13
  %71 = icmp sge i32 %69, %70
  br i1 %71, label %72, label %77

72:                                               ; preds = %63
  %73 = load ptr, ptr %4, align 8, !tbaa !5
  %74 = load i32, ptr %10, align 4, !tbaa !13
  %75 = sext i32 %74 to i64
  %76 = getelementptr inbounds i8, ptr %73, i64 %75
  store i8 -1, ptr %76, align 1, !tbaa !15
  br label %82

77:                                               ; preds = %63
  %78 = load ptr, ptr %4, align 8, !tbaa !5
  %79 = load i32, ptr %10, align 4, !tbaa !13
  %80 = sext i32 %79 to i64
  %81 = getelementptr inbounds i8, ptr %78, i64 %80
  store i8 0, ptr %81, align 1, !tbaa !15
  br label %82

82:                                               ; preds = %77, %72
  br label %83

83:                                               ; preds = %82
  %84 = load i32, ptr %10, align 4, !tbaa !13
  %85 = add nsw i32 %84, 1
  store i32 %85, ptr %10, align 4, !tbaa !13
  br label %58, !llvm.loop !18

86:                                               ; preds = %62
  %87 = load ptr, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #3
  ret ptr %87
}

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

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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #3 = { 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, !11, i64 0}
!10 = !{!"_ZTS5Image", !11, i64 0, !11, i64 4, !11, i64 8, !6, i64 16, !7, i64 24, !11, i64 1524}
!11 = !{!"int", !7, i64 0}
!12 = !{!10, !11, i64 4}
!13 = !{!11, !11, i64 0}
!14 = !{!10, !6, i64 16}
!15 = !{!7, !7, i64 0}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.mustprogress"}
!18 = distinct !{!18, !17}


; 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.5 = external hidden unnamed_addr constant [18 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_Z14CreateNewImageP5ImagePc(ptr noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
define dso_local noundef ptr @_Z9ThresholdP5Image(ptr noundef %0) local_unnamed_addr #0 {
  %2 = load i32, ptr %0, align 8, !tbaa !5
  %3 = getelementptr inbounds i8, ptr %0, i64 4
  %4 = load i32, ptr %3, align 4, !tbaa !11
  %5 = mul i32 %4, %2
  %6 = tail call noundef ptr @_Z14CreateNewImageP5ImagePc(ptr noundef nonnull %0, ptr noundef nonnull @.str.5)
  %7 = getelementptr inbounds i8, ptr %0, i64 16
  %8 = load ptr, ptr %7, align 8, !tbaa !12
  %9 = ptrtoint ptr %8 to i64
  %10 = getelementptr inbounds i8, ptr %6, i64 16
  %11 = load ptr, ptr %10, align 8, !tbaa !12
  %12 = ptrtoint ptr %11 to i64
  %13 = icmp sgt i32 %5, 0
  br i1 %13, label %.lr.ph.preheader, label %._crit_edge33

.lr.ph.preheader:                                 ; preds = %1
  %wide.trip.count = zext nneg i32 %5 to i64
  %min.iters.check = icmp ult i32 %5, 8
  br i1 %min.iters.check, label %.lr.ph.preheader66, label %vector.ph

.lr.ph.preheader66:                               ; preds = %middle.block, %.lr.ph.preheader
  %indvars.iv.ph = phi i64 [ 0, %.lr.ph.preheader ], [ %n.vec, %middle.block ]
  %.02429.ph = phi i32 [ 0, %.lr.ph.preheader ], [ %21, %middle.block ]
  br label %.lr.ph

vector.ph:                                        ; preds = %.lr.ph.preheader
  %n.vec = and i64 %wide.trip.count, 2147483640
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %18, %vector.body ]
  %vec.phi42 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %19, %vector.body ]
  %14 = getelementptr inbounds i8, ptr %8, i64 %index
  %15 = getelementptr inbounds i8, ptr %14, i64 4
  %wide.load = load <4 x i8>, ptr %14, align 1, !tbaa !13
  %wide.load43 = load <4 x i8>, ptr %15, align 1, !tbaa !13
  %16 = zext <4 x i8> %wide.load to <4 x i32>
  %17 = zext <4 x i8> %wide.load43 to <4 x i32>
  %18 = tail call <4 x i32> @llvm.smax.v4i32(<4 x i32> %vec.phi, <4 x i32> %16)
  %19 = tail call <4 x i32> @llvm.smax.v4i32(<4 x i32> %vec.phi42, <4 x i32> %17)
  %index.next = add nuw i64 %index, 8
  %20 = icmp eq i64 %index.next, %n.vec
  br i1 %20, label %middle.block, label %vector.body, !llvm.loop !14

middle.block:                                     ; preds = %vector.body
  %rdx.minmax = tail call <4 x i32> @llvm.smax.v4i32(<4 x i32> %18, <4 x i32> %19)
  %21 = tail call i32 @llvm.vector.reduce.smax.v4i32(<4 x i32> %rdx.minmax)
  %cmp.n = icmp eq i64 %n.vec, %wide.trip.count
  br i1 %cmp.n, label %._crit_edge, label %.lr.ph.preheader66

._crit_edge:                                      ; preds = %.lr.ph, %middle.block
  %spec.select.lcssa = phi i32 [ %21, %middle.block ], [ %spec.select, %.lr.ph ]
  %22 = uitofp nneg i32 %spec.select.lcssa to float
  %23 = fpext float %22 to double
  %24 = fmul double %23, 3.300000e-01
  %25 = tail call double @llvm.round.f64(double %24)
  %26 = fptosi double %25 to i32
  br i1 %13, label %iter.check, label %._crit_edge33

iter.check:                                       ; preds = %._crit_edge
  %wide.trip.count38 = zext nneg i32 %5 to i64
  %min.iters.check46 = icmp ult i32 %5, 8
  %27 = sub i64 %12, %9
  %diff.check = icmp ult i64 %27, 16
  %or.cond = select i1 %min.iters.check46, i1 true, i1 %diff.check
  br i1 %or.cond, label %.lr.ph32.preheader, label %vector.main.loop.iter.check

vector.main.loop.iter.check:                      ; preds = %iter.check
  %min.iters.check48 = icmp ult i32 %5, 16
  br i1 %min.iters.check48, label %vec.epilog.ph, label %vector.ph49

vector.ph49:                                      ; preds = %vector.main.loop.iter.check
  %n.vec51 = and i64 %wide.trip.count, 2147483632
  %broadcast.splatinsert = insertelement <16 x i32> poison, i32 %26, i64 0
  %broadcast.splat = shufflevector <16 x i32> %broadcast.splatinsert, <16 x i32> poison, <16 x i32> zeroinitializer
  br label %vector.body52

vector.body52:                                    ; preds = %vector.body52, %vector.ph49
  %index53 = phi i64 [ 0, %vector.ph49 ], [ %index.next55, %vector.body52 ]
  %28 = getelementptr inbounds i8, ptr %8, i64 %index53
  %wide.load54 = load <16 x i8>, ptr %28, align 1, !tbaa !13
  %29 = zext <16 x i8> %wide.load54 to <16 x i32>
  %30 = icmp sle <16 x i32> %broadcast.splat, %29
  %31 = sext <16 x i1> %30 to <16 x i8>
  %32 = getelementptr inbounds i8, ptr %11, i64 %index53
  store <16 x i8> %31, ptr %32, align 1
  %index.next55 = add nuw i64 %index53, 16
  %33 = icmp eq i64 %index.next55, %n.vec51
  br i1 %33, label %middle.block44, label %vector.body52, !llvm.loop !18

middle.block44:                                   ; preds = %vector.body52
  %cmp.n56 = icmp eq i64 %n.vec51, %wide.trip.count
  br i1 %cmp.n56, label %._crit_edge33, label %vec.epilog.iter.check

vec.epilog.iter.check:                            ; preds = %middle.block44
  %n.vec.remaining = and i64 %wide.trip.count, 8
  %min.epilog.iters.check.not.not = icmp eq i64 %n.vec.remaining, 0
  br i1 %min.epilog.iters.check.not.not, label %.lr.ph32.preheader, label %vec.epilog.ph

.lr.ph32.preheader:                               ; preds = %vec.epilog.middle.block, %iter.check, %vec.epilog.iter.check
  %indvars.iv35.ph = phi i64 [ 0, %iter.check ], [ %n.vec51, %vec.epilog.iter.check ], [ %n.vec58, %vec.epilog.middle.block ]
  %xtraiter = and i64 %wide.trip.count, 3
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.lr.ph32.prol.loopexit, label %.lr.ph32.prol

.lr.ph32.prol:                                    ; preds = %.lr.ph32.preheader, %.lr.ph32.prol
  %indvars.iv35.prol = phi i64 [ %indvars.iv.next36.prol, %.lr.ph32.prol ], [ %indvars.iv35.ph, %.lr.ph32.preheader ]
  %prol.iter = phi i64 [ %prol.iter.next, %.lr.ph32.prol ], [ 0, %.lr.ph32.preheader ]
  %34 = getelementptr inbounds i8, ptr %8, i64 %indvars.iv35.prol
  %35 = load i8, ptr %34, align 1, !tbaa !13
  %36 = zext i8 %35 to i32
  %.not.prol = icmp sge i32 %36, %26
  %spec.select41.prol = sext i1 %.not.prol to i8
  %37 = getelementptr inbounds i8, ptr %11, i64 %indvars.iv35.prol
  store i8 %spec.select41.prol, ptr %37, align 1
  %indvars.iv.next36.prol = add nuw nsw i64 %indvars.iv35.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 %.lr.ph32.prol.loopexit, label %.lr.ph32.prol, !llvm.loop !19

.lr.ph32.prol.loopexit:                           ; preds = %.lr.ph32.prol, %.lr.ph32.preheader
  %indvars.iv35.unr = phi i64 [ %indvars.iv35.ph, %.lr.ph32.preheader ], [ %indvars.iv.next36.prol, %.lr.ph32.prol ]
  %38 = sub nsw i64 %indvars.iv35.ph, %wide.trip.count
  %39 = icmp ugt i64 %38, -4
  br i1 %39, label %._crit_edge33, label %.lr.ph32

vec.epilog.ph:                                    ; preds = %vector.main.loop.iter.check, %vec.epilog.iter.check
  %vec.epilog.resume.val = phi i64 [ %n.vec51, %vec.epilog.iter.check ], [ 0, %vector.main.loop.iter.check ]
  %n.vec58 = and i64 %wide.trip.count, 2147483640
  %broadcast.splatinsert62 = insertelement <8 x i32> poison, i32 %26, i64 0
  %broadcast.splat63 = shufflevector <8 x i32> %broadcast.splatinsert62, <8 x i32> poison, <8 x i32> zeroinitializer
  br label %vec.epilog.vector.body

vec.epilog.vector.body:                           ; preds = %vec.epilog.vector.body, %vec.epilog.ph
  %index60 = phi i64 [ %vec.epilog.resume.val, %vec.epilog.ph ], [ %index.next64, %vec.epilog.vector.body ]
  %40 = getelementptr inbounds i8, ptr %8, i64 %index60
  %wide.load61 = load <8 x i8>, ptr %40, align 1, !tbaa !13
  %41 = zext <8 x i8> %wide.load61 to <8 x i32>
  %42 = icmp sle <8 x i32> %broadcast.splat63, %41
  %43 = sext <8 x i1> %42 to <8 x i8>
  %44 = getelementptr inbounds i8, ptr %11, i64 %index60
  store <8 x i8> %43, ptr %44, align 1
  %index.next64 = add nuw i64 %index60, 8
  %45 = icmp eq i64 %index.next64, %n.vec58
  br i1 %45, label %vec.epilog.middle.block, label %vec.epilog.vector.body, !llvm.loop !21

vec.epilog.middle.block:                          ; preds = %vec.epilog.vector.body
  %cmp.n65 = icmp eq i64 %n.vec58, %wide.trip.count
  br i1 %cmp.n65, label %._crit_edge33, label %.lr.ph32.preheader

.lr.ph:                                           ; preds = %.lr.ph.preheader66, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ %indvars.iv.ph, %.lr.ph.preheader66 ]
  %.02429 = phi i32 [ %spec.select, %.lr.ph ], [ %.02429.ph, %.lr.ph.preheader66 ]
  %46 = getelementptr inbounds i8, ptr %8, i64 %indvars.iv
  %47 = load i8, ptr %46, align 1, !tbaa !13
  %48 = zext i8 %47 to i32
  %spec.select = tail call i32 @llvm.smax.i32(i32 %.02429, i32 %48)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph, !llvm.loop !22

._crit_edge33:                                    ; preds = %.lr.ph32.prol.loopexit, %.lr.ph32, %middle.block44, %vec.epilog.middle.block, %1, %._crit_edge
  ret ptr %6

.lr.ph32:                                         ; preds = %.lr.ph32.prol.loopexit, %.lr.ph32
  %indvars.iv35 = phi i64 [ %indvars.iv.next36.3, %.lr.ph32 ], [ %indvars.iv35.unr, %.lr.ph32.prol.loopexit ]
  %49 = getelementptr inbounds i8, ptr %8, i64 %indvars.iv35
  %50 = load i8, ptr %49, align 1, !tbaa !13
  %51 = zext i8 %50 to i32
  %.not = icmp sge i32 %51, %26
  %spec.select41 = sext i1 %.not to i8
  %52 = getelementptr inbounds i8, ptr %11, i64 %indvars.iv35
  store i8 %spec.select41, ptr %52, align 1
  %indvars.iv.next36 = add nuw nsw i64 %indvars.iv35, 1
  %53 = getelementptr inbounds i8, ptr %8, i64 %indvars.iv.next36
  %54 = load i8, ptr %53, align 1, !tbaa !13
  %55 = zext i8 %54 to i32
  %.not.1 = icmp sge i32 %55, %26
  %spec.select41.1 = sext i1 %.not.1 to i8
  %56 = getelementptr inbounds i8, ptr %11, i64 %indvars.iv.next36
  store i8 %spec.select41.1, ptr %56, align 1
  %indvars.iv.next36.1 = add nuw nsw i64 %indvars.iv35, 2
  %57 = getelementptr inbounds i8, ptr %8, i64 %indvars.iv.next36.1
  %58 = load i8, ptr %57, align 1, !tbaa !13
  %59 = zext i8 %58 to i32
  %.not.2 = icmp sge i32 %59, %26
  %spec.select41.2 = sext i1 %.not.2 to i8
  %60 = getelementptr inbounds i8, ptr %11, i64 %indvars.iv.next36.1
  store i8 %spec.select41.2, ptr %60, align 1
  %indvars.iv.next36.2 = add nuw nsw i64 %indvars.iv35, 3
  %61 = getelementptr inbounds i8, ptr %8, i64 %indvars.iv.next36.2
  %62 = load i8, ptr %61, align 1, !tbaa !13
  %63 = zext i8 %62 to i32
  %.not.3 = icmp sge i32 %63, %26
  %spec.select41.3 = sext i1 %.not.3 to i8
  %64 = getelementptr inbounds i8, ptr %11, i64 %indvars.iv.next36.2
  store i8 %spec.select41.3, ptr %64, align 1
  %indvars.iv.next36.3 = add nuw nsw i64 %indvars.iv35, 4
  %exitcond39.not.3 = icmp eq i64 %indvars.iv.next36.3, %wide.trip.count38
  br i1 %exitcond39.not.3, label %._crit_edge33, label %.lr.ph32, !llvm.loop !23
}

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

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <4 x i32> @llvm.smax.v4i32(<4 x i32>, <4 x i32>) #2

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.smax.v4i32(<4 x i32>) #2

attributes #0 = { 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 #1 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #2 = { 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, !7, i64 0}
!6 = !{!"_ZTS5Image", !7, i64 0, !7, i64 4, !7, i64 8, !10, i64 16, !8, i64 24, !7, i64 1524}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!6, !7, i64 4}
!12 = !{!6, !10, i64 16}
!13 = !{!8, !8, i64 0}
!14 = distinct !{!14, !15, !16, !17}
!15 = !{!"llvm.loop.mustprogress"}
!16 = !{!"llvm.loop.isvectorized", i32 1}
!17 = !{!"llvm.loop.unroll.runtime.disable"}
!18 = distinct !{!18, !15, !16, !17}
!19 = distinct !{!19, !20}
!20 = !{!"llvm.loop.unroll.disable"}
!21 = distinct !{!21, !15, !16, !17}
!22 = distinct !{!22, !15, !17, !16}
!23 = distinct !{!23, !15, !16}


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