; LLVM IR from avik-das/seam-carver :: seam-carver (compute_vertical_seam_links)

; 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.seam_link = type { i32, i32 }

@stderr = external global ptr, align 8
@.str.9 = external hidden unnamed_addr constant [32 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: nounwind allocsize(0)
declare noalias ptr @malloc(i64 noundef) #1

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

; Function Attrs: nounwind
declare i32 @fprintf(ptr noundef, ptr noundef, ...) #3

; Function Attrs: nounwind uwtable
define dso_local ptr @compute_vertical_seam_links(ptr noundef %0, i32 noundef %1, i32 noundef %2) #4 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca %struct.seam_link, 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
  %20 = alloca %struct.seam_link, align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  store i32 %1, ptr %6, align 4, !tbaa !9
  store i32 %2, ptr %7, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #5
  %21 = load i32, ptr %6, align 4, !tbaa !9
  %22 = load i32, ptr %7, align 4, !tbaa !9
  %23 = mul nsw i32 %21, %22
  %24 = sext i32 %23 to i64
  %25 = mul i64 %24, 8
  %26 = call noalias ptr @malloc(i64 noundef %25) #6
  store ptr %26, ptr %8, align 8, !tbaa !5
  %27 = load ptr, ptr %8, align 8, !tbaa !5
  %28 = icmp ne ptr %27, null
  br i1 %28, label %32, label %29

29:                                               ; preds = %3
  %30 = load ptr, ptr @stderr, align 8, !tbaa !5
  %31 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %30, ptr noundef @.str.9, i32 noundef 74) #5
  store ptr null, ptr %4, align 8
  store i32 1, ptr %9, align 4
  br label %141

32:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  store i32 0, ptr %10, align 4, !tbaa !9
  br label %33

33:                                               ; preds = %50, %32
  %34 = load i32, ptr %10, align 4, !tbaa !9
  %35 = load i32, ptr %6, align 4, !tbaa !9
  %36 = icmp slt i32 %34, %35
  br i1 %36, label %38, label %37

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

38:                                               ; preds = %33
  %39 = load ptr, ptr %8, align 8, !tbaa !5
  %40 = load i32, ptr %10, align 4, !tbaa !9
  %41 = sext i32 %40 to i64
  %42 = getelementptr inbounds %struct.seam_link, ptr %39, i64 %41
  %43 = getelementptr inbounds %struct.seam_link, ptr %11, i32 0, i32 0
  %44 = load ptr, ptr %5, align 8, !tbaa !5
  %45 = load i32, ptr %10, align 4, !tbaa !9
  %46 = sext i32 %45 to i64
  %47 = getelementptr inbounds i32, ptr %44, i64 %46
  %48 = load i32, ptr %47, align 4, !tbaa !9
  store i32 %48, ptr %43, align 4, !tbaa !11
  %49 = getelementptr inbounds %struct.seam_link, ptr %11, i32 0, i32 1
  store i32 -1, ptr %49, align 4, !tbaa !13
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %42, ptr align 4 %11, i64 8, i1 false), !tbaa.struct !14
  br label %50

50:                                               ; preds = %38
  %51 = load i32, ptr %10, align 4, !tbaa !9
  %52 = add nsw i32 %51, 1
  store i32 %52, ptr %10, align 4, !tbaa !9
  br label %33, !llvm.loop !15

53:                                               ; preds = %37
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  store i32 1, ptr %12, align 4, !tbaa !9
  br label %54

54:                                               ; preds = %136, %53
  %55 = load i32, ptr %12, align 4, !tbaa !9
  %56 = load i32, ptr %7, align 4, !tbaa !9
  %57 = icmp slt i32 %55, %56
  br i1 %57, label %59, label %58

58:                                               ; preds = %54
  store i32 5, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  br label %139

59:                                               ; preds = %54
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  store i32 0, ptr %13, align 4, !tbaa !9
  br label %60

60:                                               ; preds = %132, %59
  %61 = load i32, ptr %13, align 4, !tbaa !9
  %62 = load i32, ptr %6, align 4, !tbaa !9
  %63 = icmp slt i32 %61, %62
  br i1 %63, label %65, label %64

64:                                               ; preds = %60
  store i32 8, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  br label %135

65:                                               ; preds = %60
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #5
  %66 = load i32, ptr %12, align 4, !tbaa !9
  %67 = load i32, ptr %6, align 4, !tbaa !9
  %68 = mul nsw i32 %66, %67
  %69 = load i32, ptr %13, align 4, !tbaa !9
  %70 = add nsw i32 %68, %69
  store i32 %70, ptr %14, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #5
  store i32 2147483647, ptr %15, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #5
  store i32 -1, ptr %16, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #5
  %71 = load i32, ptr %13, align 4, !tbaa !9
  %72 = icmp eq i32 %71, 0
  br i1 %72, label %73, label %75

73:                                               ; preds = %65
  %74 = load i32, ptr %13, align 4, !tbaa !9
  br label %78

75:                                               ; preds = %65
  %76 = load i32, ptr %13, align 4, !tbaa !9
  %77 = sub nsw i32 %76, 1
  br label %78

78:                                               ; preds = %75, %73
  %79 = phi i32 [ %74, %73 ], [ %77, %75 ]
  store i32 %79, ptr %17, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #5
  %80 = load i32, ptr %13, align 4, !tbaa !9
  %81 = load i32, ptr %6, align 4, !tbaa !9
  %82 = sub nsw i32 %81, 1
  %83 = icmp eq i32 %80, %82
  br i1 %83, label %84, label %86

84:                                               ; preds = %78
  %85 = load i32, ptr %13, align 4, !tbaa !9
  br label %89

86:                                               ; preds = %78
  %87 = load i32, ptr %13, align 4, !tbaa !9
  %88 = add nsw i32 %87, 1
  br label %89

89:                                               ; preds = %86, %84
  %90 = phi i32 [ %85, %84 ], [ %88, %86 ]
  store i32 %90, ptr %18, align 4, !tbaa !9
  br label %91

91:                                               ; preds = %114, %89
  %92 = load i32, ptr %17, align 4, !tbaa !9
  %93 = load i32, ptr %18, align 4, !tbaa !9
  %94 = icmp sle i32 %92, %93
  br i1 %94, label %95, label %117

95:                                               ; preds = %91
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #5
  %96 = load ptr, ptr %8, align 8, !tbaa !5
  %97 = load i32, ptr %12, align 4, !tbaa !9
  %98 = sub nsw i32 %97, 1
  %99 = load i32, ptr %6, align 4, !tbaa !9
  %100 = mul nsw i32 %98, %99
  %101 = load i32, ptr %17, align 4, !tbaa !9
  %102 = add nsw i32 %100, %101
  %103 = sext i32 %102 to i64
  %104 = getelementptr inbounds %struct.seam_link, ptr %96, i64 %103
  %105 = getelementptr inbounds %struct.seam_link, ptr %104, i32 0, i32 0
  %106 = load i32, ptr %105, align 4, !tbaa !11
  store i32 %106, ptr %19, align 4, !tbaa !9
  %107 = load i32, ptr %19, align 4, !tbaa !9
  %108 = load i32, ptr %15, align 4, !tbaa !9
  %109 = icmp slt i32 %107, %108
  br i1 %109, label %110, label %113

110:                                              ; preds = %95
  %111 = load i32, ptr %19, align 4, !tbaa !9
  store i32 %111, ptr %15, align 4, !tbaa !9
  %112 = load i32, ptr %17, align 4, !tbaa !9
  store i32 %112, ptr %16, align 4, !tbaa !9
  br label %113

113:                                              ; preds = %110, %95
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #5
  br label %114

114:                                              ; preds = %113
  %115 = load i32, ptr %17, align 4, !tbaa !9
  %116 = add nsw i32 %115, 1
  store i32 %116, ptr %17, align 4, !tbaa !9
  br label %91, !llvm.loop !17

117:                                              ; preds = %91
  %118 = load ptr, ptr %8, align 8, !tbaa !5
  %119 = load i32, ptr %14, align 4, !tbaa !9
  %120 = sext i32 %119 to i64
  %121 = getelementptr inbounds %struct.seam_link, ptr %118, i64 %120
  %122 = getelementptr inbounds %struct.seam_link, ptr %20, i32 0, i32 0
  %123 = load ptr, ptr %5, align 8, !tbaa !5
  %124 = load i32, ptr %14, align 4, !tbaa !9
  %125 = sext i32 %124 to i64
  %126 = getelementptr inbounds i32, ptr %123, i64 %125
  %127 = load i32, ptr %126, align 4, !tbaa !9
  %128 = load i32, ptr %15, align 4, !tbaa !9
  %129 = add i32 %127, %128
  store i32 %129, ptr %122, align 4, !tbaa !11
  %130 = getelementptr inbounds %struct.seam_link, ptr %20, i32 0, i32 1
  %131 = load i32, ptr %16, align 4, !tbaa !9
  store i32 %131, ptr %130, align 4, !tbaa !13
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %121, ptr align 4 %20, i64 8, i1 false), !tbaa.struct !14
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  br label %132

132:                                              ; preds = %117
  %133 = load i32, ptr %13, align 4, !tbaa !9
  %134 = add nsw i32 %133, 1
  store i32 %134, ptr %13, align 4, !tbaa !9
  br label %60, !llvm.loop !18

135:                                              ; preds = %64
  br label %136

136:                                              ; preds = %135
  %137 = load i32, ptr %12, align 4, !tbaa !9
  %138 = add nsw i32 %137, 1
  store i32 %138, ptr %12, align 4, !tbaa !9
  br label %54, !llvm.loop !19

139:                                              ; preds = %58
  %140 = load ptr, ptr %8, align 8, !tbaa !5
  store ptr %140, ptr %4, align 8
  store i32 1, ptr %9, align 4
  br label %141

141:                                              ; preds = %139, %29
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  %142 = load ptr, ptr %4, align 8
  ret ptr %142
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nounwind allocsize(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 nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { 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 #4 = { 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 #5 = { nounwind }
attributes #6 = { nounwind allocsize(0) }

!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, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !10, i64 0}
!12 = !{!"seam_link", !10, i64 0, !10, i64 4}
!13 = !{!12, !10, i64 4}
!14 = !{i64 0, i64 4, !9, i64 4, i64 4, !9}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}
!17 = distinct !{!17, !16}
!18 = distinct !{!18, !16}
!19 = distinct !{!19, !16}


; 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"

%struct.seam_link = type { i32, i32 }

@stderr = external local_unnamed_addr global ptr, align 8
@.str.9 = external hidden unnamed_addr constant [32 x i8], align 1

; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #0

; Function Attrs: nofree nounwind
declare noundef i32 @fprintf(ptr nocapture noundef, ptr nocapture noundef readonly, ...) local_unnamed_addr #1

; Function Attrs: nofree nounwind uwtable
define dso_local noalias noundef ptr @compute_vertical_seam_links(ptr nocapture noundef readonly %0, i32 noundef %1, i32 noundef %2) local_unnamed_addr #2 {
  %4 = mul nsw i32 %2, %1
  %5 = sext i32 %4 to i64
  %6 = shl nsw i64 %5, 3
  %7 = tail call noalias ptr @malloc(i64 noundef %6) #4
  %.not = icmp eq ptr %7, null
  br i1 %.not, label %15, label %.preheader59

.preheader59:                                     ; preds = %3
  %8 = icmp slt i32 %1, 1
  br i1 %8, label %.loopexit, label %.lr.ph.preheader

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

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

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

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %9 = or disjoint i64 %index, 2
  %10 = getelementptr inbounds i32, ptr %0, i64 %index
  %11 = getelementptr inbounds i8, ptr %10, i64 8
  %wide.load = load <2 x i32>, ptr %10, align 4, !tbaa !5
  %wide.load89 = load <2 x i32>, ptr %11, align 4, !tbaa !5
  %12 = getelementptr inbounds %struct.seam_link, ptr %7, i64 %index
  %13 = getelementptr inbounds %struct.seam_link, ptr %7, i64 %9
  %interleaved.vec = shufflevector <2 x i32> %wide.load, <2 x i32> <i32 -1, i32 -1>, <4 x i32> <i32 0, i32 2, i32 1, i32 3>
  store <4 x i32> %interleaved.vec, ptr %12, align 4, !tbaa !5
  %interleaved.vec90 = shufflevector <2 x i32> %wide.load89, <2 x i32> <i32 -1, i32 -1>, <4 x i32> <i32 0, i32 2, i32 1, i32 3>
  store <4 x i32> %interleaved.vec90, ptr %13, align 4, !tbaa !5
  %index.next = add nuw i64 %index, 4
  %14 = icmp eq i64 %index.next, %n.vec
  br i1 %14, label %middle.block, label %vector.body, !llvm.loop !9

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %n.vec, %wide.trip.count
  br i1 %cmp.n, label %.preheader58, label %.lr.ph.preheader91

15:                                               ; preds = %3
  %16 = load ptr, ptr @stderr, align 8, !tbaa !13
  %17 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %16, ptr noundef nonnull @.str.9, i32 noundef 74) #5
  br label %.loopexit

.preheader58:                                     ; preds = %.lr.ph, %middle.block
  %18 = icmp slt i32 %2, 2
  %brmerge = or i1 %18, %8
  br i1 %brmerge, label %.loopexit, label %.preheader.us.preheader

.preheader.us.preheader:                          ; preds = %.preheader58
  %19 = add nsw i32 %1, -1
  %20 = zext nneg i32 %19 to i64
  %21 = zext nneg i32 %1 to i64
  %wide.trip.count85 = zext nneg i32 %2 to i64
  %wide.trip.count79 = zext nneg i32 %1 to i64
  br label %.preheader.us

.preheader.us:                                    ; preds = %.preheader.us.preheader, %._crit_edge69.us
  %indvars.iv81 = phi i64 [ 1, %.preheader.us.preheader ], [ %indvars.iv.next82, %._crit_edge69.us ]
  %22 = add nsw i64 %indvars.iv81, -1
  %23 = mul nsw i64 %22, %21
  %24 = trunc i64 %indvars.iv81 to i32
  %25 = mul i32 %24, %1
  %26 = zext i32 %25 to i64
  %invariant.gep = getelementptr %struct.seam_link, ptr %7, i64 %23
  br label %27

27:                                               ; preds = %.preheader.us, %._crit_edge.us
  %indvars.iv76 = phi i64 [ 0, %.preheader.us ], [ %indvars.iv.next77, %._crit_edge.us ]
  %28 = trunc nuw nsw i64 %indvars.iv76 to i32
  %29 = add nuw nsw i64 %indvars.iv76, %26
  %30 = tail call i32 @llvm.usub.sat.i32(i32 %28, i32 1)
  %31 = icmp eq i64 %indvars.iv76, %20
  %indvars.iv.next77 = add nuw nsw i64 %indvars.iv76, 1
  %indvars = trunc i64 %indvars.iv.next77 to i32
  %32 = select i1 %31, i32 %28, i32 %indvars
  %.not5661.us = icmp ugt i32 %30, %32
  br i1 %.not5661.us, label %._crit_edge.us, label %.lr.ph65.us.preheader

.lr.ph65.us.preheader:                            ; preds = %27
  %33 = icmp ne i64 %indvars.iv76, 0
  %umin.neg = sext i1 %33 to i64
  %34 = add i64 %indvars.iv76, %umin.neg
  %sext = shl i64 %34, 32
  %35 = ashr exact i64 %sext, 32
  br label %.lr.ph65.us

.lr.ph65.us:                                      ; preds = %.lr.ph65.us.preheader, %.lr.ph65.us
  %indvars.iv73 = phi i64 [ %35, %.lr.ph65.us.preheader ], [ %indvars.iv.next74, %.lr.ph65.us ]
  %.04963.us = phi i32 [ -1, %.lr.ph65.us.preheader ], [ %spec.select57.us, %.lr.ph65.us ]
  %.05062.us = phi i32 [ 2147483647, %.lr.ph65.us.preheader ], [ %spec.select.us, %.lr.ph65.us ]
  %gep = getelementptr %struct.seam_link, ptr %invariant.gep, i64 %indvars.iv73
  %36 = load i32, ptr %gep, align 4, !tbaa !15
  %37 = icmp slt i32 %36, %.05062.us
  %spec.select.us = tail call i32 @llvm.smin.i32(i32 %36, i32 %.05062.us)
  %38 = trunc nsw i64 %indvars.iv73 to i32
  %spec.select57.us = select i1 %37, i32 %38, i32 %.04963.us
  %indvars.iv.next74 = add nuw nsw i64 %indvars.iv73, 1
  %.not56.us.not = icmp ugt i32 %32, %38
  br i1 %.not56.us.not, label %.lr.ph65.us, label %._crit_edge.us, !llvm.loop !17

._crit_edge.us:                                   ; preds = %.lr.ph65.us, %27
  %.050.lcssa.us = phi i32 [ 2147483647, %27 ], [ %spec.select.us, %.lr.ph65.us ]
  %.049.lcssa.us = phi i32 [ -1, %27 ], [ %spec.select57.us, %.lr.ph65.us ]
  %39 = getelementptr inbounds %struct.seam_link, ptr %7, i64 %29
  %40 = getelementptr inbounds i32, ptr %0, i64 %29
  %41 = load i32, ptr %40, align 4, !tbaa !5
  %42 = add i32 %41, %.050.lcssa.us
  store i32 %42, ptr %39, align 4, !tbaa !5
  %.sroa.2.0..sroa_idx.us = getelementptr inbounds i8, ptr %39, i64 4
  store i32 %.049.lcssa.us, ptr %.sroa.2.0..sroa_idx.us, align 4, !tbaa !5
  %exitcond80.not = icmp eq i64 %indvars.iv.next77, %wide.trip.count79
  br i1 %exitcond80.not, label %._crit_edge69.us, label %27, !llvm.loop !18

._crit_edge69.us:                                 ; preds = %._crit_edge.us
  %indvars.iv.next82 = add nuw nsw i64 %indvars.iv81, 1
  %exitcond86.not = icmp eq i64 %indvars.iv.next82, %wide.trip.count85
  br i1 %exitcond86.not, label %.loopexit, label %.preheader.us, !llvm.loop !19

.lr.ph:                                           ; preds = %.lr.ph.preheader91, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ %indvars.iv.ph, %.lr.ph.preheader91 ]
  %43 = getelementptr inbounds %struct.seam_link, ptr %7, i64 %indvars.iv
  %44 = getelementptr inbounds i32, ptr %0, i64 %indvars.iv
  %45 = load i32, ptr %44, align 4, !tbaa !5
  store i32 %45, ptr %43, align 4, !tbaa !5
  %.sroa.226.0..sroa_idx = getelementptr inbounds i8, ptr %43, i64 4
  store i32 -1, ptr %.sroa.226.0..sroa_idx, align 4, !tbaa !5
  %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 %.preheader58, label %.lr.ph, !llvm.loop !20

.loopexit:                                        ; preds = %._crit_edge69.us, %.preheader58, %.preheader59, %15
  ret ptr %7
}

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

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

attributes #0 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "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 = { nofree 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 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind allocsize(0) }
attributes #5 = { cold 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10, !11, !12}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.isvectorized", i32 1}
!12 = !{!"llvm.loop.unroll.runtime.disable"}
!13 = !{!14, !14, i64 0}
!14 = !{!"any pointer", !7, i64 0}
!15 = !{!16, !6, i64 0}
!16 = !{!"seam_link", !6, i64 0, !6, i64 4}
!17 = distinct !{!17, !10}
!18 = distinct !{!18, !10}
!19 = distinct !{!19, !10}
!20 = distinct !{!20, !10, !12, !11}


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