; LLVM IR from bbenligiray/stag :: src/ED/ValidateEdgeSegments.ll (Z18ExtractNewSegmentsP7EdgeMap)

; 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.EdgeMap = type <{ i32, i32, ptr, ptr, ptr, i32, [4 x i8] }>
%struct.EdgeSegment = type { ptr, i32 }
%struct.Pixel = type { i32, i32 }

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_Z18ExtractNewSegmentsP7EdgeMap(ptr noundef %0) #0 {
  %2 = alloca ptr, align 8
  %3 = alloca ptr, align 8
  %4 = alloca i32, align 4
  %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
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #3
  %17 = load ptr, ptr %2, align 8, !tbaa !5
  %18 = getelementptr inbounds %struct.EdgeMap, ptr %17, i32 0, i32 2
  %19 = load ptr, ptr %18, align 8, !tbaa !9
  store ptr %19, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #3
  %20 = load ptr, ptr %2, align 8, !tbaa !5
  %21 = getelementptr inbounds %struct.EdgeMap, ptr %20, i32 0, i32 0
  %22 = load i32, ptr %21, align 8, !tbaa !12
  store i32 %22, ptr %4, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #3
  %23 = load ptr, ptr %2, align 8, !tbaa !5
  %24 = getelementptr inbounds %struct.EdgeMap, ptr %23, i32 0, i32 4
  %25 = load ptr, ptr %24, align 8, !tbaa !14
  %26 = load ptr, ptr %2, align 8, !tbaa !5
  %27 = getelementptr inbounds %struct.EdgeMap, ptr %26, i32 0, i32 5
  %28 = load i32, ptr %27, align 8, !tbaa !15
  %29 = sext i32 %28 to i64
  %30 = getelementptr inbounds %struct.EdgeSegment, ptr %25, i64 %29
  store ptr %30, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #3
  store i32 0, 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
  br label %31

31:                                               ; preds = %200, %1
  %32 = load i32, ptr %7, align 4, !tbaa !13
  %33 = load ptr, ptr %2, align 8, !tbaa !5
  %34 = getelementptr inbounds %struct.EdgeMap, ptr %33, i32 0, i32 5
  %35 = load i32, ptr %34, align 8, !tbaa !15
  %36 = icmp slt i32 %32, %35
  br i1 %36, label %38, label %37

37:                                               ; preds = %31
  store i32 2, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #3
  br label %203

38:                                               ; preds = %31
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #3
  store i32 0, ptr %9, align 4, !tbaa !13
  br label %39

39:                                               ; preds = %196, %38
  %40 = load i32, ptr %9, align 4, !tbaa !13
  %41 = load ptr, ptr %2, align 8, !tbaa !5
  %42 = getelementptr inbounds %struct.EdgeMap, ptr %41, i32 0, i32 4
  %43 = load ptr, ptr %42, align 8, !tbaa !14
  %44 = load i32, ptr %7, align 4, !tbaa !13
  %45 = sext i32 %44 to i64
  %46 = getelementptr inbounds %struct.EdgeSegment, ptr %43, i64 %45
  %47 = getelementptr inbounds %struct.EdgeSegment, ptr %46, i32 0, i32 1
  %48 = load i32, ptr %47, align 8, !tbaa !16
  %49 = icmp slt i32 %40, %48
  br i1 %49, label %50, label %199

50:                                               ; preds = %39
  br label %51

51:                                               ; preds = %105, %50
  %52 = load i32, ptr %9, align 4, !tbaa !13
  %53 = load ptr, ptr %2, align 8, !tbaa !5
  %54 = getelementptr inbounds %struct.EdgeMap, ptr %53, i32 0, i32 4
  %55 = load ptr, ptr %54, align 8, !tbaa !14
  %56 = load i32, ptr %7, align 4, !tbaa !13
  %57 = sext i32 %56 to i64
  %58 = getelementptr inbounds %struct.EdgeSegment, ptr %55, i64 %57
  %59 = getelementptr inbounds %struct.EdgeSegment, ptr %58, i32 0, i32 1
  %60 = load i32, ptr %59, align 8, !tbaa !16
  %61 = icmp slt i32 %52, %60
  br i1 %61, label %62, label %106

62:                                               ; preds = %51
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #3
  %63 = load ptr, ptr %2, align 8, !tbaa !5
  %64 = getelementptr inbounds %struct.EdgeMap, ptr %63, i32 0, i32 4
  %65 = load ptr, ptr %64, align 8, !tbaa !14
  %66 = load i32, ptr %7, align 4, !tbaa !13
  %67 = sext i32 %66 to i64
  %68 = getelementptr inbounds %struct.EdgeSegment, ptr %65, i64 %67
  %69 = getelementptr inbounds %struct.EdgeSegment, ptr %68, i32 0, i32 0
  %70 = load ptr, ptr %69, align 8, !tbaa !18
  %71 = load i32, ptr %9, align 4, !tbaa !13
  %72 = sext i32 %71 to i64
  %73 = getelementptr inbounds %struct.Pixel, ptr %70, i64 %72
  %74 = getelementptr inbounds %struct.Pixel, ptr %73, i32 0, i32 0
  %75 = load i32, ptr %74, align 4, !tbaa !19
  store i32 %75, ptr %10, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #3
  %76 = load ptr, ptr %2, align 8, !tbaa !5
  %77 = getelementptr inbounds %struct.EdgeMap, ptr %76, i32 0, i32 4
  %78 = load ptr, ptr %77, align 8, !tbaa !14
  %79 = load i32, ptr %7, align 4, !tbaa !13
  %80 = sext i32 %79 to i64
  %81 = getelementptr inbounds %struct.EdgeSegment, ptr %78, i64 %80
  %82 = getelementptr inbounds %struct.EdgeSegment, ptr %81, i32 0, i32 0
  %83 = load ptr, ptr %82, align 8, !tbaa !18
  %84 = load i32, ptr %9, align 4, !tbaa !13
  %85 = sext i32 %84 to i64
  %86 = getelementptr inbounds %struct.Pixel, ptr %83, i64 %85
  %87 = getelementptr inbounds %struct.Pixel, ptr %86, i32 0, i32 1
  %88 = load i32, ptr %87, align 4, !tbaa !21
  store i32 %88, ptr %11, align 4, !tbaa !13
  %89 = load ptr, ptr %3, align 8, !tbaa !5
  %90 = load i32, ptr %10, align 4, !tbaa !13
  %91 = load i32, ptr %4, align 4, !tbaa !13
  %92 = mul nsw i32 %90, %91
  %93 = load i32, ptr %11, align 4, !tbaa !13
  %94 = add nsw i32 %92, %93
  %95 = sext i32 %94 to i64
  %96 = getelementptr inbounds i8, ptr %89, i64 %95
  %97 = load i8, ptr %96, align 1, !tbaa !22
  %98 = icmp ne i8 %97, 0
  br i1 %98, label %99, label %100

99:                                               ; preds = %62
  store i32 8, ptr %8, align 4
  br label %103

100:                                              ; preds = %62
  %101 = load i32, ptr %9, align 4, !tbaa !13
  %102 = add nsw i32 %101, 1
  store i32 %102, ptr %9, align 4, !tbaa !13
  store i32 0, ptr %8, align 4
  br label %103

103:                                              ; preds = %100, %99
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #3
  %104 = load i32, ptr %8, align 4
  switch i32 %104, label %227 [
    i32 0, label %105
    i32 8, label %106
  ]

105:                                              ; preds = %103
  br label %51, !llvm.loop !23

106:                                              ; preds = %103, %51
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #3
  %107 = load i32, ptr %9, align 4, !tbaa !13
  %108 = add nsw i32 %107, 1
  store i32 %108, ptr %12, align 4, !tbaa !13
  br label %109

109:                                              ; preds = %164, %106
  %110 = load i32, ptr %12, align 4, !tbaa !13
  %111 = load ptr, ptr %2, align 8, !tbaa !5
  %112 = getelementptr inbounds %struct.EdgeMap, ptr %111, i32 0, i32 4
  %113 = load ptr, ptr %112, align 8, !tbaa !14
  %114 = load i32, ptr %7, align 4, !tbaa !13
  %115 = sext i32 %114 to i64
  %116 = getelementptr inbounds %struct.EdgeSegment, ptr %113, i64 %115
  %117 = getelementptr inbounds %struct.EdgeSegment, ptr %116, i32 0, i32 1
  %118 = load i32, ptr %117, align 8, !tbaa !16
  %119 = icmp slt i32 %110, %118
  br i1 %119, label %120, label %165

120:                                              ; preds = %109
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #3
  %121 = load ptr, ptr %2, align 8, !tbaa !5
  %122 = getelementptr inbounds %struct.EdgeMap, ptr %121, i32 0, i32 4
  %123 = load ptr, ptr %122, align 8, !tbaa !14
  %124 = load i32, ptr %7, align 4, !tbaa !13
  %125 = sext i32 %124 to i64
  %126 = getelementptr inbounds %struct.EdgeSegment, ptr %123, i64 %125
  %127 = getelementptr inbounds %struct.EdgeSegment, ptr %126, i32 0, i32 0
  %128 = load ptr, ptr %127, align 8, !tbaa !18
  %129 = load i32, ptr %12, align 4, !tbaa !13
  %130 = sext i32 %129 to i64
  %131 = getelementptr inbounds %struct.Pixel, ptr %128, i64 %130
  %132 = getelementptr inbounds %struct.Pixel, ptr %131, i32 0, i32 0
  %133 = load i32, ptr %132, align 4, !tbaa !19
  store i32 %133, ptr %13, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #3
  %134 = load ptr, ptr %2, align 8, !tbaa !5
  %135 = getelementptr inbounds %struct.EdgeMap, ptr %134, i32 0, i32 4
  %136 = load ptr, ptr %135, align 8, !tbaa !14
  %137 = load i32, ptr %7, align 4, !tbaa !13
  %138 = sext i32 %137 to i64
  %139 = getelementptr inbounds %struct.EdgeSegment, ptr %136, i64 %138
  %140 = getelementptr inbounds %struct.EdgeSegment, ptr %139, i32 0, i32 0
  %141 = load ptr, ptr %140, align 8, !tbaa !18
  %142 = load i32, ptr %12, align 4, !tbaa !13
  %143 = sext i32 %142 to i64
  %144 = getelementptr inbounds %struct.Pixel, ptr %141, i64 %143
  %145 = getelementptr inbounds %struct.Pixel, ptr %144, i32 0, i32 1
  %146 = load i32, ptr %145, align 4, !tbaa !21
  store i32 %146, ptr %14, align 4, !tbaa !13
  %147 = load ptr, ptr %3, align 8, !tbaa !5
  %148 = load i32, ptr %13, align 4, !tbaa !13
  %149 = load i32, ptr %4, align 4, !tbaa !13
  %150 = mul nsw i32 %148, %149
  %151 = load i32, ptr %14, align 4, !tbaa !13
  %152 = add nsw i32 %150, %151
  %153 = sext i32 %152 to i64
  %154 = getelementptr inbounds i8, ptr %147, i64 %153
  %155 = load i8, ptr %154, align 1, !tbaa !22
  %156 = zext i8 %155 to i32
  %157 = icmp eq i32 %156, 0
  br i1 %157, label %158, label %159

158:                                              ; preds = %120
  store i32 10, ptr %8, align 4
  br label %162

159:                                              ; preds = %120
  %160 = load i32, ptr %12, align 4, !tbaa !13
  %161 = add nsw i32 %160, 1
  store i32 %161, ptr %12, align 4, !tbaa !13
  store i32 0, ptr %8, align 4
  br label %162

162:                                              ; preds = %159, %158
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #3
  %163 = load i32, ptr %8, align 4
  switch i32 %163, label %227 [
    i32 0, label %164
    i32 10, label %165
  ]

164:                                              ; preds = %162
  br label %109, !llvm.loop !25

165:                                              ; preds = %162, %109
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #3
  %166 = load i32, ptr %12, align 4, !tbaa !13
  %167 = load i32, ptr %9, align 4, !tbaa !13
  %168 = sub nsw i32 %166, %167
  store i32 %168, ptr %15, align 4, !tbaa !13
  %169 = load i32, ptr %15, align 4, !tbaa !13
  %170 = icmp sge i32 %169, 10
  br i1 %170, label %171, label %196

171:                                              ; preds = %165
  %172 = load ptr, ptr %2, align 8, !tbaa !5
  %173 = getelementptr inbounds %struct.EdgeMap, ptr %172, i32 0, i32 4
  %174 = load ptr, ptr %173, align 8, !tbaa !14
  %175 = load i32, ptr %7, align 4, !tbaa !13
  %176 = sext i32 %175 to i64
  %177 = getelementptr inbounds %struct.EdgeSegment, ptr %174, i64 %176
  %178 = getelementptr inbounds %struct.EdgeSegment, ptr %177, i32 0, i32 0
  %179 = load ptr, ptr %178, align 8, !tbaa !18
  %180 = load i32, ptr %9, align 4, !tbaa !13
  %181 = sext i32 %180 to i64
  %182 = getelementptr inbounds %struct.Pixel, ptr %179, i64 %181
  %183 = load ptr, ptr %5, align 8, !tbaa !5
  %184 = load i32, ptr %6, align 4, !tbaa !13
  %185 = sext i32 %184 to i64
  %186 = getelementptr inbounds %struct.EdgeSegment, ptr %183, i64 %185
  %187 = getelementptr inbounds %struct.EdgeSegment, ptr %186, i32 0, i32 0
  store ptr %182, ptr %187, align 8, !tbaa !18
  %188 = load i32, ptr %15, align 4, !tbaa !13
  %189 = load ptr, ptr %5, align 8, !tbaa !5
  %190 = load i32, ptr %6, align 4, !tbaa !13
  %191 = sext i32 %190 to i64
  %192 = getelementptr inbounds %struct.EdgeSegment, ptr %189, i64 %191
  %193 = getelementptr inbounds %struct.EdgeSegment, ptr %192, i32 0, i32 1
  store i32 %188, ptr %193, align 8, !tbaa !16
  %194 = load i32, ptr %6, align 4, !tbaa !13
  %195 = add nsw i32 %194, 1
  store i32 %195, ptr %6, align 4, !tbaa !13
  br label %196

196:                                              ; preds = %171, %165
  %197 = load i32, ptr %12, align 4, !tbaa !13
  %198 = add nsw i32 %197, 1
  store i32 %198, ptr %9, align 4, !tbaa !13
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #3
  br label %39, !llvm.loop !26

199:                                              ; preds = %39
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #3
  br label %200

200:                                              ; preds = %199
  %201 = load i32, ptr %7, align 4, !tbaa !13
  %202 = add nsw i32 %201, 1
  store i32 %202, ptr %7, align 4, !tbaa !13
  br label %31, !llvm.loop !27

203:                                              ; preds = %37
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #3
  store i32 0, ptr %16, align 4, !tbaa !13
  br label %204

204:                                              ; preds = %220, %203
  %205 = load i32, ptr %16, align 4, !tbaa !13
  %206 = load i32, ptr %6, align 4, !tbaa !13
  %207 = icmp slt i32 %205, %206
  br i1 %207, label %209, label %208

208:                                              ; preds = %204
  store i32 11, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #3
  br label %223

209:                                              ; preds = %204
  %210 = load ptr, ptr %5, align 8, !tbaa !5
  %211 = load i32, ptr %16, align 4, !tbaa !13
  %212 = sext i32 %211 to i64
  %213 = getelementptr inbounds %struct.EdgeSegment, ptr %210, i64 %212
  %214 = load ptr, ptr %2, align 8, !tbaa !5
  %215 = getelementptr inbounds %struct.EdgeMap, ptr %214, i32 0, i32 4
  %216 = load ptr, ptr %215, align 8, !tbaa !14
  %217 = load i32, ptr %16, align 4, !tbaa !13
  %218 = sext i32 %217 to i64
  %219 = getelementptr inbounds %struct.EdgeSegment, ptr %216, i64 %218
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %219, ptr align 8 %213, i64 16, i1 false), !tbaa.struct !28
  br label %220

220:                                              ; preds = %209
  %221 = load i32, ptr %16, align 4, !tbaa !13
  %222 = add nsw i32 %221, 1
  store i32 %222, ptr %16, align 4, !tbaa !13
  br label %204, !llvm.loop !29

223:                                              ; preds = %208
  %224 = load i32, ptr %6, align 4, !tbaa !13
  %225 = load ptr, ptr %2, align 8, !tbaa !5
  %226 = getelementptr inbounds %struct.EdgeMap, ptr %225, i32 0, i32 5
  store i32 %224, ptr %226, align 8, !tbaa !15
  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 4, ptr %4) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #3
  ret void

227:                                              ; preds = %162, %103
  unreachable
}

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

attributes #0 = { 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 #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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, !6, i64 8}
!10 = !{!"_ZTS7EdgeMap", !11, i64 0, !11, i64 4, !6, i64 8, !6, i64 16, !6, i64 24, !11, i64 32}
!11 = !{!"int", !7, i64 0}
!12 = !{!10, !11, i64 0}
!13 = !{!11, !11, i64 0}
!14 = !{!10, !6, i64 24}
!15 = !{!10, !11, i64 32}
!16 = !{!17, !11, i64 8}
!17 = !{!"_ZTS11EdgeSegment", !6, i64 0, !11, i64 8}
!18 = !{!17, !6, i64 0}
!19 = !{!20, !11, i64 0}
!20 = !{!"_ZTS5Pixel", !11, i64 0, !11, i64 4}
!21 = !{!20, !11, i64 4}
!22 = !{!7, !7, i64 0}
!23 = distinct !{!23, !24}
!24 = !{!"llvm.loop.mustprogress"}
!25 = distinct !{!25, !24}
!26 = distinct !{!26, !24}
!27 = distinct !{!27, !24}
!28 = !{i64 0, i64 8, !5, i64 8, i64 4, !13}
!29 = distinct !{!29, !24}


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

; Function Attrs: mustprogress nofree norecurse nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable
define dso_local void @_Z18ExtractNewSegmentsP7EdgeMap(ptr nocapture noundef %0) local_unnamed_addr #0 {
  %2 = getelementptr inbounds i8, ptr %0, i64 8
  %3 = load ptr, ptr %2, align 8, !tbaa !5
  %4 = load i32, ptr %0, align 8, !tbaa !11
  %5 = getelementptr inbounds i8, ptr %0, i64 24
  %6 = load ptr, ptr %5, align 8, !tbaa !12
  %7 = getelementptr inbounds i8, ptr %0, i64 32
  %8 = load i32, ptr %7, align 8, !tbaa !13
  %9 = sext i32 %8 to i64
  %10 = getelementptr inbounds %struct.EdgeSegment, ptr %6, i64 %9
  %11 = icmp sgt i32 %8, 0
  br i1 %11, label %.preheader74.preheader, label %._crit_edge82

.preheader74.preheader:                           ; preds = %1
  %wide.trip.count = zext nneg i32 %8 to i64
  br label %.preheader74

.preheader74:                                     ; preds = %.preheader74.preheader, %._crit_edge
  %indvars.iv88 = phi i64 [ 0, %.preheader74.preheader ], [ %indvars.iv.next89, %._crit_edge ]
  %.06279 = phi i32 [ 0, %.preheader74.preheader ], [ %.1.lcssa, %._crit_edge ]
  %12 = getelementptr inbounds %struct.EdgeSegment, ptr %6, i64 %indvars.iv88, i32 1
  %13 = load i32, ptr %12, align 8, !tbaa !14
  %14 = icmp sgt i32 %13, 0
  br i1 %14, label %.preheader73.lr.ph, label %._crit_edge

.preheader73.lr.ph:                               ; preds = %.preheader74
  %15 = getelementptr inbounds %struct.EdgeSegment, ptr %6, i64 %indvars.iv88
  br label %.preheader73

.preheader:                                       ; preds = %._crit_edge
  %16 = icmp sgt i32 %.1.lcssa, 0
  br i1 %16, label %.lr.ph.preheader, label %._crit_edge82

.lr.ph.preheader:                                 ; preds = %.preheader
  %wide.trip.count94 = zext nneg i32 %.1.lcssa to i64
  %xtraiter = and i64 %wide.trip.count94, 1
  %17 = icmp eq i32 %.1.lcssa, 1
  br i1 %17, label %._crit_edge82.loopexit.unr-lcssa, label %.lr.ph.preheader.new

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

.preheader73:                                     ; preds = %.preheader73.lr.ph, %63
  %18 = phi i32 [ %13, %.preheader73.lr.ph ], [ %64, %63 ]
  %.177 = phi i32 [ %.06279, %.preheader73.lr.ph ], [ %.2, %63 ]
  %.06976 = phi i32 [ 0, %.preheader73.lr.ph ], [ %65, %63 ]
  %19 = sext i32 %.06976 to i64
  %20 = sext i32 %18 to i64
  %smax = tail call i32 @llvm.smax.i32(i32 %.06976, i32 %18)
  br label %21

21:                                               ; preds = %.preheader73, %23
  %indvars.iv = phi i64 [ %19, %.preheader73 ], [ %indvars.iv.next, %23 ]
  %22 = icmp slt i64 %indvars.iv, %20
  br i1 %22, label %23, label %.split.loop.exit98

23:                                               ; preds = %21
  %24 = load ptr, ptr %15, align 8, !tbaa !16
  %25 = getelementptr inbounds %struct.Pixel, ptr %24, i64 %indvars.iv
  %26 = load i32, ptr %25, align 4, !tbaa !17
  %27 = getelementptr inbounds i8, ptr %25, i64 4
  %28 = load i32, ptr %27, align 4, !tbaa !19
  %29 = mul nsw i32 %26, %4
  %30 = add nsw i32 %29, %28
  %31 = sext i32 %30 to i64
  %32 = getelementptr inbounds i8, ptr %3, i64 %31
  %33 = load i8, ptr %32, align 1, !tbaa !20
  %.not = icmp eq i8 %33, 0
  %indvars.iv.next = add nsw i64 %indvars.iv, 1
  br i1 %.not, label %21, label %.split.loop.exit

.split.loop.exit:                                 ; preds = %23
  %34 = trunc nsw i64 %indvars.iv to i32
  br label %.split.loop.exit98

.split.loop.exit98:                               ; preds = %21, %.split.loop.exit
  %.170.lcssa = phi i32 [ %34, %.split.loop.exit ], [ %smax, %21 ]
  %35 = sext i32 %.170.lcssa to i64
  %36 = add nsw i32 %.170.lcssa, 1
  %smax86 = tail call i32 @llvm.smax.i32(i32 %18, i32 %36)
  %37 = add nsw i32 %smax86, -1
  br label %38

38:                                               ; preds = %40, %.split.loop.exit98
  %indvars.iv84 = phi i64 [ %indvars.iv.next85, %40 ], [ %35, %.split.loop.exit98 ]
  %indvars.iv.next85 = add nsw i64 %indvars.iv84, 1
  %39 = icmp slt i64 %indvars.iv.next85, %20
  br i1 %39, label %40, label %.split.loop.exit101

40:                                               ; preds = %38
  %41 = load ptr, ptr %15, align 8, !tbaa !16
  %42 = getelementptr inbounds %struct.Pixel, ptr %41, i64 %indvars.iv.next85
  %43 = load i32, ptr %42, align 4, !tbaa !17
  %44 = getelementptr inbounds i8, ptr %42, i64 4
  %45 = load i32, ptr %44, align 4, !tbaa !19
  %46 = mul nsw i32 %43, %4
  %47 = add nsw i32 %46, %45
  %48 = sext i32 %47 to i64
  %49 = getelementptr inbounds i8, ptr %3, i64 %48
  %50 = load i8, ptr %49, align 1, !tbaa !20
  %51 = icmp eq i8 %50, 0
  br i1 %51, label %.split.loop.exit100, label %38

.split.loop.exit100:                              ; preds = %40
  %52 = trunc nsw i64 %indvars.iv84 to i32
  %53 = trunc nsw i64 %indvars.iv.next85 to i32
  br label %.split.loop.exit101

.split.loop.exit101:                              ; preds = %38, %.split.loop.exit100
  %.066.in.lcssa = phi i32 [ %52, %.split.loop.exit100 ], [ %37, %38 ]
  %.066.lcssa = phi i32 [ %53, %.split.loop.exit100 ], [ %smax86, %38 ]
  %54 = sub nsw i32 %.066.lcssa, %.170.lcssa
  %55 = icmp sgt i32 %54, 9
  br i1 %55, label %56, label %63

56:                                               ; preds = %.split.loop.exit101
  %57 = load ptr, ptr %15, align 8, !tbaa !16
  %58 = getelementptr inbounds %struct.Pixel, ptr %57, i64 %35
  %59 = sext i32 %.177 to i64
  %60 = getelementptr inbounds %struct.EdgeSegment, ptr %10, i64 %59
  store ptr %58, ptr %60, align 8, !tbaa !16
  %61 = getelementptr inbounds i8, ptr %60, i64 8
  store i32 %54, ptr %61, align 8, !tbaa !14
  %62 = add nsw i32 %.177, 1
  %.pre = load i32, ptr %12, align 8, !tbaa !14
  br label %63

63:                                               ; preds = %56, %.split.loop.exit101
  %64 = phi i32 [ %.pre, %56 ], [ %18, %.split.loop.exit101 ]
  %.2 = phi i32 [ %62, %56 ], [ %.177, %.split.loop.exit101 ]
  %65 = add nsw i32 %.066.in.lcssa, 2
  %66 = icmp slt i32 %65, %64
  br i1 %66, label %.preheader73, label %._crit_edge, !llvm.loop !21

._crit_edge:                                      ; preds = %63, %.preheader74
  %.1.lcssa = phi i32 [ %.06279, %.preheader74 ], [ %.2, %63 ]
  %indvars.iv.next89 = add nuw nsw i64 %indvars.iv88, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next89, %wide.trip.count
  br i1 %exitcond.not, label %.preheader, label %.preheader74, !llvm.loop !23

._crit_edge82.loopexit.unr-lcssa:                 ; preds = %.lr.ph, %.lr.ph.preheader
  %indvars.iv91.unr = phi i64 [ 0, %.lr.ph.preheader ], [ %indvars.iv.next92.1, %.lr.ph ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge82, label %.lr.ph.epil

.lr.ph.epil:                                      ; preds = %._crit_edge82.loopexit.unr-lcssa
  %67 = getelementptr inbounds %struct.EdgeSegment, ptr %10, i64 %indvars.iv91.unr
  %68 = load ptr, ptr %5, align 8, !tbaa !12
  %69 = getelementptr inbounds %struct.EdgeSegment, ptr %68, i64 %indvars.iv91.unr
  tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %69, ptr noundef nonnull align 8 dereferenceable(16) %67, i64 16, i1 false), !tbaa.struct !24
  br label %._crit_edge82

._crit_edge82:                                    ; preds = %.lr.ph.epil, %._crit_edge82.loopexit.unr-lcssa, %1, %.preheader
  %.062.lcssa97 = phi i32 [ %.1.lcssa, %.preheader ], [ 0, %1 ], [ %.1.lcssa, %._crit_edge82.loopexit.unr-lcssa ], [ %.1.lcssa, %.lr.ph.epil ]
  store i32 %.062.lcssa97, ptr %7, align 8, !tbaa !13
  ret void

.lr.ph:                                           ; preds = %.lr.ph, %.lr.ph.preheader.new
  %indvars.iv91 = phi i64 [ 0, %.lr.ph.preheader.new ], [ %indvars.iv.next92.1, %.lr.ph ]
  %niter = phi i64 [ 0, %.lr.ph.preheader.new ], [ %niter.next.1, %.lr.ph ]
  %70 = getelementptr inbounds %struct.EdgeSegment, ptr %10, i64 %indvars.iv91
  %71 = load ptr, ptr %5, align 8, !tbaa !12
  %72 = getelementptr inbounds %struct.EdgeSegment, ptr %71, i64 %indvars.iv91
  tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %72, ptr noundef nonnull align 8 dereferenceable(16) %70, i64 16, i1 false), !tbaa.struct !24
  %indvars.iv.next92 = or disjoint i64 %indvars.iv91, 1
  %73 = getelementptr inbounds %struct.EdgeSegment, ptr %10, i64 %indvars.iv.next92
  %74 = load ptr, ptr %5, align 8, !tbaa !12
  %75 = getelementptr inbounds %struct.EdgeSegment, ptr %74, i64 %indvars.iv.next92
  tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %75, ptr noundef nonnull align 8 dereferenceable(16) %73, i64 16, i1 false), !tbaa.struct !24
  %indvars.iv.next92.1 = add nuw nsw i64 %indvars.iv91, 2
  %niter.next.1 = add i64 %niter, 2
  %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
  br i1 %niter.ncmp.1, label %._crit_edge82.loopexit.unr-lcssa, label %.lr.ph, !llvm.loop !27
}

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

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

attributes #0 = { mustprogress nofree norecurse nosync nounwind memory(readwrite, inaccessiblemem: none) 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 nounwind willreturn memory(argmem: readwrite) }
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, !10, i64 8}
!6 = !{!"_ZTS7EdgeMap", !7, i64 0, !7, i64 4, !10, i64 8, !10, i64 16, !10, i64 24, !7, i64 32}
!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 0}
!12 = !{!6, !10, i64 24}
!13 = !{!6, !7, i64 32}
!14 = !{!15, !7, i64 8}
!15 = !{!"_ZTS11EdgeSegment", !10, i64 0, !7, i64 8}
!16 = !{!15, !10, i64 0}
!17 = !{!18, !7, i64 0}
!18 = !{!"_ZTS5Pixel", !7, i64 0, !7, i64 4}
!19 = !{!18, !7, i64 4}
!20 = !{!8, !8, i64 0}
!21 = distinct !{!21, !22}
!22 = !{!"llvm.loop.mustprogress"}
!23 = distinct !{!23, !22}
!24 = !{i64 0, i64 8, !25, i64 8, i64 4, !26}
!25 = !{!10, !10, i64 0}
!26 = !{!7, !7, i64 0}
!27 = distinct !{!27, !22}


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