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

; 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
declare dso_local void @_Z18ExtractNewSegmentsP7EdgeMap(ptr noundef) #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: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare { i64, i1 } @llvm.umul.with.overflow.i64(i64, i64) #3

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znam(i64 noundef) #4

; Function Attrs: mustprogress uwtable
declare hidden void @_ZL11TestSegmentP7EdgeMapPsiiiiPdd(ptr noundef, ptr noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, ptr noundef, double noundef) #5

; Function Attrs: nobuiltin nounwind
declare void @_ZdlPvm(ptr noundef, i64 noundef) #6

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_Z46ValidateEdgeSegmentsWithGradientMapMultipleDivP7EdgeMapPsPPhi(ptr noundef %0, ptr noundef %1, ptr noundef %2, i32 noundef %3) #5 {
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %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 i32, align 4
  %21 = alloca i32, align 4
  %22 = alloca i32, align 4
  %23 = alloca double, align 8
  %24 = alloca ptr, align 8
  %25 = alloca i32, align 4
  %26 = alloca i32, align 4
  %27 = alloca i32, align 4
  %28 = alloca i32, align 4
  %29 = alloca i32, align 4
  %30 = alloca i32, align 4
  %31 = alloca i32, align 4
  %32 = alloca i32, align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store ptr %2, ptr %7, align 8, !tbaa !5
  store i32 %3, ptr %8, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #7
  %33 = load ptr, ptr %5, align 8, !tbaa !5
  %34 = getelementptr inbounds %struct.EdgeMap, ptr %33, i32 0, i32 0
  %35 = load i32, ptr %34, align 8, !tbaa !11
  store i32 %35, ptr %9, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #7
  %36 = load ptr, ptr %5, align 8, !tbaa !5
  %37 = getelementptr inbounds %struct.EdgeMap, ptr %36, i32 0, i32 1
  %38 = load i32, ptr %37, align 4, !tbaa !13
  store i32 %38, ptr %10, align 4, !tbaa !9
  %39 = load ptr, ptr %5, align 8, !tbaa !5
  %40 = getelementptr inbounds %struct.EdgeMap, ptr %39, i32 0, i32 2
  %41 = load ptr, ptr %40, align 8, !tbaa !14
  %42 = load i32, ptr %9, align 4, !tbaa !9
  %43 = load i32, ptr %10, align 4, !tbaa !9
  %44 = mul nsw i32 %42, %43
  %45 = sext i32 %44 to i64
  call void @llvm.memset.p0.i64(ptr align 1 %41, i8 0, i64 %45, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #7
  store i32 32768, ptr %11, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #7
  %46 = load i32, ptr %11, align 4, !tbaa !9
  %47 = sext i32 %46 to i64
  %48 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %47, i64 8)
  %49 = extractvalue { i64, i1 } %48, 1
  %50 = extractvalue { i64, i1 } %48, 0
  %51 = select i1 %49, i64 -1, i64 %50
  %52 = call noalias noundef nonnull ptr @_Znam(i64 noundef %51) #8
  store ptr %52, ptr %12, align 8, !tbaa !5
  %53 = load ptr, ptr %12, align 8, !tbaa !5
  %54 = load i32, ptr %11, align 4, !tbaa !9
  %55 = sext i32 %54 to i64
  %56 = mul i64 8, %55
  call void @llvm.memset.p0.i64(ptr align 8 %53, i8 0, i64 %56, i1 false)
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #7
  %57 = load i32, ptr %11, align 4, !tbaa !9
  %58 = sext i32 %57 to i64
  %59 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %58, i64 4)
  %60 = extractvalue { i64, i1 } %59, 1
  %61 = extractvalue { i64, i1 } %59, 0
  %62 = select i1 %60, i64 -1, i64 %61
  %63 = call noalias noundef nonnull ptr @_Znam(i64 noundef %62) #8
  store ptr %63, ptr %13, align 8, !tbaa !5
  %64 = load ptr, ptr %13, align 8, !tbaa !5
  %65 = load i32, ptr %11, align 4, !tbaa !9
  %66 = sext i32 %65 to i64
  %67 = mul i64 4, %66
  call void @llvm.memset.p0.i64(ptr align 4 %64, i8 0, i64 %67, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #7
  store i32 1, ptr %14, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #7
  %68 = load i32, ptr %14, align 4, !tbaa !9
  store i32 %68, ptr %15, align 4, !tbaa !9
  br label %69

69:                                               ; preds = %106, %4
  %70 = load i32, ptr %15, align 4, !tbaa !9
  %71 = load i32, ptr %10, align 4, !tbaa !9
  %72 = load i32, ptr %14, align 4, !tbaa !9
  %73 = sub nsw i32 %71, %72
  %74 = icmp slt i32 %70, %73
  br i1 %74, label %76, label %75

75:                                               ; preds = %69
  store i32 2, ptr %16, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #7
  br label %109

76:                                               ; preds = %69
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #7
  %77 = load i32, ptr %14, align 4, !tbaa !9
  store i32 %77, ptr %17, align 4, !tbaa !9
  br label %78

78:                                               ; preds = %102, %76
  %79 = load i32, ptr %17, align 4, !tbaa !9
  %80 = load i32, ptr %9, align 4, !tbaa !9
  %81 = load i32, ptr %14, align 4, !tbaa !9
  %82 = sub nsw i32 %80, %81
  %83 = icmp slt i32 %79, %82
  br i1 %83, label %85, label %84

84:                                               ; preds = %78
  store i32 5, ptr %16, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #7
  br label %105

85:                                               ; preds = %78
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #7
  %86 = load ptr, ptr %6, align 8, !tbaa !5
  %87 = load i32, ptr %15, align 4, !tbaa !9
  %88 = load i32, ptr %9, align 4, !tbaa !9
  %89 = mul nsw i32 %87, %88
  %90 = load i32, ptr %17, align 4, !tbaa !9
  %91 = add nsw i32 %89, %90
  %92 = sext i32 %91 to i64
  %93 = getelementptr inbounds i16, ptr %86, i64 %92
  %94 = load i16, ptr %93, align 2, !tbaa !15
  %95 = sext i16 %94 to i32
  store i32 %95, ptr %18, align 4, !tbaa !9
  %96 = load ptr, ptr %13, align 8, !tbaa !5
  %97 = load i32, ptr %18, align 4, !tbaa !9
  %98 = sext i32 %97 to i64
  %99 = getelementptr inbounds i32, ptr %96, i64 %98
  %100 = load i32, ptr %99, align 4, !tbaa !9
  %101 = add nsw i32 %100, 1
  store i32 %101, ptr %99, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #7
  br label %102

102:                                              ; preds = %85
  %103 = load i32, ptr %17, align 4, !tbaa !9
  %104 = add nsw i32 %103, 1
  store i32 %104, ptr %17, align 4, !tbaa !9
  br label %78, !llvm.loop !17

105:                                              ; preds = %84
  br label %106

106:                                              ; preds = %105
  %107 = load i32, ptr %15, align 4, !tbaa !9
  %108 = add nsw i32 %107, 1
  store i32 %108, ptr %15, align 4, !tbaa !9
  br label %69, !llvm.loop !19

109:                                              ; preds = %75
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #7
  %110 = load i32, ptr %9, align 4, !tbaa !9
  %111 = load i32, ptr %14, align 4, !tbaa !9
  %112 = mul nsw i32 2, %111
  %113 = sub nsw i32 %110, %112
  %114 = load i32, ptr %10, align 4, !tbaa !9
  %115 = load i32, ptr %14, align 4, !tbaa !9
  %116 = mul nsw i32 2, %115
  %117 = sub nsw i32 %114, %116
  %118 = mul nsw i32 %113, %117
  store i32 %118, ptr %19, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #7
  %119 = load i32, ptr %11, align 4, !tbaa !9
  %120 = sub nsw i32 %119, 1
  store i32 %120, ptr %20, align 4, !tbaa !9
  br label %121

121:                                              ; preds = %138, %109
  %122 = load i32, ptr %20, align 4, !tbaa !9
  %123 = icmp sgt i32 %122, 0
  br i1 %123, label %125, label %124

124:                                              ; preds = %121
  store i32 8, ptr %16, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #7
  br label %141

125:                                              ; preds = %121
  %126 = load ptr, ptr %13, align 8, !tbaa !5
  %127 = load i32, ptr %20, align 4, !tbaa !9
  %128 = sext i32 %127 to i64
  %129 = getelementptr inbounds i32, ptr %126, i64 %128
  %130 = load i32, ptr %129, align 4, !tbaa !9
  %131 = load ptr, ptr %13, align 8, !tbaa !5
  %132 = load i32, ptr %20, align 4, !tbaa !9
  %133 = sub nsw i32 %132, 1
  %134 = sext i32 %133 to i64
  %135 = getelementptr inbounds i32, ptr %131, i64 %134
  %136 = load i32, ptr %135, align 4, !tbaa !9
  %137 = add nsw i32 %136, %130
  store i32 %137, ptr %135, align 4, !tbaa !9
  br label %138

138:                                              ; preds = %125
  %139 = load i32, ptr %20, align 4, !tbaa !9
  %140 = add nsw i32 %139, -1
  store i32 %140, ptr %20, align 4, !tbaa !9
  br label %121, !llvm.loop !20

141:                                              ; preds = %124
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #7
  store i32 0, ptr %21, align 4, !tbaa !9
  br label %142

142:                                              ; preds = %161, %141
  %143 = load i32, ptr %21, align 4, !tbaa !9
  %144 = load i32, ptr %11, align 4, !tbaa !9
  %145 = icmp slt i32 %143, %144
  br i1 %145, label %147, label %146

146:                                              ; preds = %142
  store i32 11, ptr %16, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #7
  br label %164

147:                                              ; preds = %142
  %148 = load ptr, ptr %13, align 8, !tbaa !5
  %149 = load i32, ptr %21, align 4, !tbaa !9
  %150 = sext i32 %149 to i64
  %151 = getelementptr inbounds i32, ptr %148, i64 %150
  %152 = load i32, ptr %151, align 4, !tbaa !9
  %153 = sitofp i32 %152 to double
  %154 = load i32, ptr %19, align 4, !tbaa !9
  %155 = sitofp i32 %154 to double
  %156 = fdiv double %153, %155
  %157 = load ptr, ptr %12, align 8, !tbaa !5
  %158 = load i32, ptr %21, align 4, !tbaa !9
  %159 = sext i32 %158 to i64
  %160 = getelementptr inbounds double, ptr %157, i64 %159
  store double %156, ptr %160, align 8, !tbaa !21
  br label %161

161:                                              ; preds = %147
  %162 = load i32, ptr %21, align 4, !tbaa !9
  %163 = add nsw i32 %162, 1
  store i32 %163, ptr %21, align 4, !tbaa !9
  br label %142, !llvm.loop !23

164:                                              ; preds = %146
  %165 = load ptr, ptr %13, align 8, !tbaa !5
  %166 = icmp eq ptr %165, null
  br i1 %166, label %168, label %167

167:                                              ; preds = %164
  call void @_ZdlPvm(ptr noundef %165, i64 noundef 4) #9
  br label %168

168:                                              ; preds = %167, %164
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #7
  store i32 0, ptr %22, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #7
  store double 1.000000e+00, ptr %23, align 8, !tbaa !21
  br label %169

169:                                              ; preds = %326, %168
  %170 = load double, ptr %23, align 8, !tbaa !21
  %171 = fcmp ole double %170, 8.500000e+00
  br i1 %171, label %173, label %172

172:                                              ; preds = %169
  store i32 14, ptr %16, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #7
  br label %331

173:                                              ; preds = %169
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #7
  %174 = load ptr, ptr %7, align 8, !tbaa !5
  %175 = load i32, ptr %22, align 4, !tbaa !9
  %176 = sext i32 %175 to i64
  %177 = getelementptr inbounds ptr, ptr %174, i64 %176
  %178 = load ptr, ptr %177, align 8, !tbaa !5
  store ptr %178, ptr %24, align 8, !tbaa !5
  %179 = load ptr, ptr %24, align 8, !tbaa !5
  %180 = icmp eq ptr %179, null
  br i1 %180, label %181, label %198

181:                                              ; preds = %173
  %182 = load i32, ptr %9, align 4, !tbaa !9
  %183 = load i32, ptr %10, align 4, !tbaa !9
  %184 = mul nsw i32 %182, %183
  %185 = sext i32 %184 to i64
  %186 = call noalias noundef nonnull ptr @_Znam(i64 noundef %185) #8
  store ptr %186, ptr %24, align 8, !tbaa !5
  %187 = load ptr, ptr %7, align 8, !tbaa !5
  %188 = load i32, ptr %22, align 4, !tbaa !9
  %189 = sext i32 %188 to i64
  %190 = getelementptr inbounds ptr, ptr %187, i64 %189
  store ptr %186, ptr %190, align 8, !tbaa !5
  %191 = load ptr, ptr %24, align 8, !tbaa !5
  %192 = load i32, ptr %9, align 4, !tbaa !9
  %193 = load i32, ptr %10, align 4, !tbaa !9
  %194 = mul nsw i32 %192, %193
  %195 = sext i32 %194 to i64
  call void @llvm.memset.p0.i64(ptr align 1 %191, i8 0, i64 %195, i1 false)
  %196 = load i32, ptr %8, align 4, !tbaa !9
  %197 = add nsw i32 %196, 1
  store i32 %197, ptr %8, align 4, !tbaa !9
  br label %198

198:                                              ; preds = %181, %173
  %199 = load ptr, ptr %5, align 8, !tbaa !5
  %200 = getelementptr inbounds %struct.EdgeMap, ptr %199, i32 0, i32 2
  %201 = load ptr, ptr %200, align 8, !tbaa !14
  %202 = load i32, ptr %9, align 4, !tbaa !9
  %203 = load i32, ptr %10, align 4, !tbaa !9
  %204 = mul nsw i32 %202, %203
  %205 = sext i32 %204 to i64
  call void @llvm.memset.p0.i64(ptr align 1 %201, i8 0, i64 %205, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #7
  store i32 0, ptr %25, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #7
  store i32 0, ptr %26, align 4, !tbaa !9
  br label %206

206:                                              ; preds = %229, %198
  %207 = load i32, ptr %26, align 4, !tbaa !9
  %208 = load ptr, ptr %5, align 8, !tbaa !5
  %209 = getelementptr inbounds %struct.EdgeMap, ptr %208, i32 0, i32 5
  %210 = load i32, ptr %209, align 8, !tbaa !24
  %211 = icmp slt i32 %207, %210
  br i1 %211, label %213, label %212

212:                                              ; preds = %206
  store i32 17, ptr %16, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #7
  br label %232

213:                                              ; preds = %206
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #7
  %214 = load ptr, ptr %5, align 8, !tbaa !5
  %215 = getelementptr inbounds %struct.EdgeMap, ptr %214, i32 0, i32 4
  %216 = load ptr, ptr %215, align 8, !tbaa !25
  %217 = load i32, ptr %26, align 4, !tbaa !9
  %218 = sext i32 %217 to i64
  %219 = getelementptr inbounds %struct.EdgeSegment, ptr %216, i64 %218
  %220 = getelementptr inbounds %struct.EdgeSegment, ptr %219, i32 0, i32 1
  %221 = load i32, ptr %220, align 8, !tbaa !26
  store i32 %221, ptr %27, align 4, !tbaa !9
  %222 = load i32, ptr %27, align 4, !tbaa !9
  %223 = load i32, ptr %27, align 4, !tbaa !9
  %224 = sub nsw i32 %223, 1
  %225 = mul nsw i32 %222, %224
  %226 = sdiv i32 %225, 2
  %227 = load i32, ptr %25, align 4, !tbaa !9
  %228 = add nsw i32 %227, %226
  store i32 %228, ptr %25, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #7
  br label %229

229:                                              ; preds = %213
  %230 = load i32, ptr %26, align 4, !tbaa !9
  %231 = add nsw i32 %230, 1
  store i32 %231, ptr %26, align 4, !tbaa !9
  br label %206, !llvm.loop !28

232:                                              ; preds = %212
  call void @llvm.lifetime.start.p0(i64 4, ptr %28) #7
  store i32 0, ptr %28, align 4, !tbaa !9
  br label %233

233:                                              ; preds = %256, %232
  %234 = load i32, ptr %28, align 4, !tbaa !9
  %235 = load ptr, ptr %5, align 8, !tbaa !5
  %236 = getelementptr inbounds %struct.EdgeMap, ptr %235, i32 0, i32 5
  %237 = load i32, ptr %236, align 8, !tbaa !24
  %238 = icmp slt i32 %234, %237
  br i1 %238, label %240, label %239

239:                                              ; preds = %233
  store i32 20, ptr %16, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %28) #7
  br label %259

240:                                              ; preds = %233
  %241 = load ptr, ptr %5, align 8, !tbaa !5
  %242 = load ptr, ptr %6, align 8, !tbaa !5
  %243 = load i32, ptr %28, align 4, !tbaa !9
  %244 = load ptr, ptr %5, align 8, !tbaa !5
  %245 = getelementptr inbounds %struct.EdgeMap, ptr %244, i32 0, i32 4
  %246 = load ptr, ptr %245, align 8, !tbaa !25
  %247 = load i32, ptr %28, align 4, !tbaa !9
  %248 = sext i32 %247 to i64
  %249 = getelementptr inbounds %struct.EdgeSegment, ptr %246, i64 %248
  %250 = getelementptr inbounds %struct.EdgeSegment, ptr %249, i32 0, i32 1
  %251 = load i32, ptr %250, align 8, !tbaa !26
  %252 = sub nsw i32 %251, 1
  %253 = load i32, ptr %25, align 4, !tbaa !9
  %254 = load ptr, ptr %12, align 8, !tbaa !5
  %255 = load double, ptr %23, align 8, !tbaa !21
  call void @_ZL11TestSegmentP7EdgeMapPsiiiiPdd(ptr noundef %241, ptr noundef %242, i32 noundef %243, i32 noundef 0, i32 noundef %252, i32 noundef %253, ptr noundef %254, double noundef %255)
  br label %256

256:                                              ; preds = %240
  %257 = load i32, ptr %28, align 4, !tbaa !9
  %258 = add nsw i32 %257, 1
  store i32 %258, ptr %28, align 4, !tbaa !9
  br label %233, !llvm.loop !29

259:                                              ; preds = %239
  %260 = load ptr, ptr %5, align 8, !tbaa !5
  call void @_Z18ExtractNewSegmentsP7EdgeMap(ptr noundef %260)
  call void @llvm.lifetime.start.p0(i64 4, ptr %29) #7
  store i32 0, ptr %29, align 4, !tbaa !9
  br label %261

261:                                              ; preds = %322, %259
  %262 = load i32, ptr %29, align 4, !tbaa !9
  %263 = load ptr, ptr %5, align 8, !tbaa !5
  %264 = getelementptr inbounds %struct.EdgeMap, ptr %263, i32 0, i32 5
  %265 = load i32, ptr %264, align 8, !tbaa !24
  %266 = icmp slt i32 %262, %265
  br i1 %266, label %268, label %267

267:                                              ; preds = %261
  store i32 23, ptr %16, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %29) #7
  br label %325

268:                                              ; preds = %261
  call void @llvm.lifetime.start.p0(i64 4, ptr %30) #7
  store i32 0, ptr %30, align 4, !tbaa !9
  br label %269

269:                                              ; preds = %318, %268
  %270 = load i32, ptr %30, align 4, !tbaa !9
  %271 = load ptr, ptr %5, align 8, !tbaa !5
  %272 = getelementptr inbounds %struct.EdgeMap, ptr %271, i32 0, i32 4
  %273 = load ptr, ptr %272, align 8, !tbaa !25
  %274 = load i32, ptr %29, align 4, !tbaa !9
  %275 = sext i32 %274 to i64
  %276 = getelementptr inbounds %struct.EdgeSegment, ptr %273, i64 %275
  %277 = getelementptr inbounds %struct.EdgeSegment, ptr %276, i32 0, i32 1
  %278 = load i32, ptr %277, align 8, !tbaa !26
  %279 = icmp slt i32 %270, %278
  br i1 %279, label %281, label %280

280:                                              ; preds = %269
  store i32 26, ptr %16, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %30) #7
  br label %321

281:                                              ; preds = %269
  call void @llvm.lifetime.start.p0(i64 4, ptr %31) #7
  %282 = load ptr, ptr %5, align 8, !tbaa !5
  %283 = getelementptr inbounds %struct.EdgeMap, ptr %282, i32 0, i32 4
  %284 = load ptr, ptr %283, align 8, !tbaa !25
  %285 = load i32, ptr %29, align 4, !tbaa !9
  %286 = sext i32 %285 to i64
  %287 = getelementptr inbounds %struct.EdgeSegment, ptr %284, i64 %286
  %288 = getelementptr inbounds %struct.EdgeSegment, ptr %287, i32 0, i32 0
  %289 = load ptr, ptr %288, align 8, !tbaa !30
  %290 = load i32, ptr %30, align 4, !tbaa !9
  %291 = sext i32 %290 to i64
  %292 = getelementptr inbounds %struct.Pixel, ptr %289, i64 %291
  %293 = getelementptr inbounds %struct.Pixel, ptr %292, i32 0, i32 0
  %294 = load i32, ptr %293, align 4, !tbaa !31
  store i32 %294, ptr %31, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %32) #7
  %295 = load ptr, ptr %5, align 8, !tbaa !5
  %296 = getelementptr inbounds %struct.EdgeMap, ptr %295, i32 0, i32 4
  %297 = load ptr, ptr %296, align 8, !tbaa !25
  %298 = load i32, ptr %29, align 4, !tbaa !9
  %299 = sext i32 %298 to i64
  %300 = getelementptr inbounds %struct.EdgeSegment, ptr %297, i64 %299
  %301 = getelementptr inbounds %struct.EdgeSegment, ptr %300, i32 0, i32 0
  %302 = load ptr, ptr %301, align 8, !tbaa !30
  %303 = load i32, ptr %30, align 4, !tbaa !9
  %304 = sext i32 %303 to i64
  %305 = getelementptr inbounds %struct.Pixel, ptr %302, i64 %304
  %306 = getelementptr inbounds %struct.Pixel, ptr %305, i32 0, i32 1
  %307 = load i32, ptr %306, align 4, !tbaa !33
  store i32 %307, ptr %32, align 4, !tbaa !9
  %308 = load ptr, ptr %24, align 8, !tbaa !5
  %309 = load i32, ptr %31, align 4, !tbaa !9
  %310 = load i32, ptr %9, align 4, !tbaa !9
  %311 = mul nsw i32 %309, %310
  %312 = load i32, ptr %32, align 4, !tbaa !9
  %313 = add nsw i32 %311, %312
  %314 = sext i32 %313 to i64
  %315 = getelementptr inbounds i8, ptr %308, i64 %314
  %316 = load i8, ptr %315, align 1, !tbaa !34
  %317 = add i8 %316, 1
  store i8 %317, ptr %315, align 1, !tbaa !34
  call void @llvm.lifetime.end.p0(i64 4, ptr %32) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %31) #7
  br label %318

318:                                              ; preds = %281
  %319 = load i32, ptr %30, align 4, !tbaa !9
  %320 = add nsw i32 %319, 1
  store i32 %320, ptr %30, align 4, !tbaa !9
  br label %269, !llvm.loop !35

321:                                              ; preds = %280
  br label %322

322:                                              ; preds = %321
  %323 = load i32, ptr %29, align 4, !tbaa !9
  %324 = add nsw i32 %323, 1
  store i32 %324, ptr %29, align 4, !tbaa !9
  br label %261, !llvm.loop !36

325:                                              ; preds = %267
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #7
  br label %326

326:                                              ; preds = %325
  %327 = load double, ptr %23, align 8, !tbaa !21
  %328 = fadd double %327, 5.000000e-01
  store double %328, ptr %23, align 8, !tbaa !21
  %329 = load i32, ptr %22, align 4, !tbaa !9
  %330 = add nsw i32 %329, 1
  store i32 %330, ptr %22, align 4, !tbaa !9
  br label %169, !llvm.loop !37

331:                                              ; preds = %172
  %332 = load ptr, ptr %12, align 8, !tbaa !5
  %333 = icmp eq ptr %332, null
  br i1 %333, label %335, label %334

334:                                              ; preds = %331
  call void @_ZdlPvm(ptr noundef %332, i64 noundef 8) #9
  br label %335

335:                                              ; preds = %334, %331
  %336 = load i32, ptr %8, align 4, !tbaa !9
  store i32 1, ptr %16, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #7
  ret i32 %336
}

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: write) }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nobuiltin 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 #5 = { 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 #6 = { nobuiltin 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 #7 = { nounwind }
attributes #8 = { builtin allocsize(0) }
attributes #9 = { builtin 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 = !{!"int", !7, i64 0}
!11 = !{!12, !10, i64 0}
!12 = !{!"_ZTS7EdgeMap", !10, i64 0, !10, i64 4, !6, i64 8, !6, i64 16, !6, i64 24, !10, i64 32}
!13 = !{!12, !10, i64 4}
!14 = !{!12, !6, i64 8}
!15 = !{!16, !16, i64 0}
!16 = !{!"short", !7, i64 0}
!17 = distinct !{!17, !18}
!18 = !{!"llvm.loop.mustprogress"}
!19 = distinct !{!19, !18}
!20 = distinct !{!20, !18}
!21 = !{!22, !22, i64 0}
!22 = !{!"double", !7, i64 0}
!23 = distinct !{!23, !18}
!24 = !{!12, !10, i64 32}
!25 = !{!12, !6, i64 24}
!26 = !{!27, !10, i64 8}
!27 = !{!"_ZTS11EdgeSegment", !6, i64 0, !10, i64 8}
!28 = distinct !{!28, !18}
!29 = distinct !{!29, !18}
!30 = !{!27, !6, i64 0}
!31 = !{!32, !10, i64 0}
!32 = !{!"_ZTS5Pixel", !10, i64 0, !10, i64 4}
!33 = !{!32, !10, i64 4}
!34 = !{!7, !7, i64 0}
!35 = distinct !{!35, !18}
!36 = distinct !{!36, !18}
!37 = distinct !{!37, !18}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%struct.EdgeSegment = type { ptr, i32 }
%struct.Pixel = type { i32, i32 }

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z18ExtractNewSegmentsP7EdgeMap(ptr noundef) local_unnamed_addr #0

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

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znam(i64 noundef) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
declare hidden void @_ZL11TestSegmentP7EdgeMapPsiiiiPdd(ptr noundef, ptr noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, ptr noundef, double noundef) local_unnamed_addr #3

; Function Attrs: nobuiltin nounwind
declare void @_ZdlPvm(ptr noundef, i64 noundef) local_unnamed_addr #4

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_Z46ValidateEdgeSegmentsWithGradientMapMultipleDivP7EdgeMapPsPPhi(ptr noundef %0, ptr noundef %1, ptr nocapture noundef %2, i32 noundef %3) local_unnamed_addr #3 {
  %5 = load i32, ptr %0, align 8, !tbaa !5
  %6 = getelementptr inbounds i8, ptr %0, i64 4
  %7 = load i32, ptr %6, align 4, !tbaa !11
  %8 = getelementptr inbounds i8, ptr %0, i64 8
  %9 = load ptr, ptr %8, align 8, !tbaa !12
  %10 = mul nsw i32 %7, %5
  %11 = sext i32 %10 to i64
  tail call void @llvm.memset.p0.i64(ptr align 1 %9, i8 0, i64 %11, i1 false)
  %12 = tail call noalias noundef nonnull dereferenceable(262144) ptr @_Znam(i64 noundef 262144) #6
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(262144) %12, i8 0, i64 262144, i1 false)
  %13 = tail call noalias noundef nonnull dereferenceable(131072) ptr @_Znam(i64 noundef 131072) #6
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(131072) %13, i8 0, i64 131072, i1 false)
  %14 = icmp sgt i32 %7, 2
  %15 = icmp sgt i32 %5, 2
  %or.cond = select i1 %14, i1 %15, i1 false
  br i1 %or.cond, label %.preheader117.us.preheader, label %._crit_edge120

.preheader117.us.preheader:                       ; preds = %4
  %16 = add nsw i32 %7, -1
  %17 = add nsw i32 %5, -1
  %18 = zext nneg i32 %5 to i64
  %wide.trip.count140 = zext nneg i32 %16 to i64
  %wide.trip.count = zext i32 %17 to i64
  %19 = add nsw i64 %wide.trip.count, -1
  %20 = add nsw i64 %wide.trip.count, -2
  %xtraiter = and i64 %19, 3
  %21 = icmp ult i64 %20, 3
  %unroll_iter = and i64 %19, -4
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br label %.preheader117.us

.preheader117.us:                                 ; preds = %.preheader117.us.preheader, %._crit_edge.us
  %indvars.iv137 = phi i64 [ 1, %.preheader117.us.preheader ], [ %indvars.iv.next138, %._crit_edge.us ]
  %22 = mul nuw nsw i64 %indvars.iv137, %18
  %invariant.gep = getelementptr inbounds i16, ptr %1, i64 %22
  br i1 %21, label %._crit_edge.us.unr-lcssa, label %.preheader117.us.new

.preheader117.us.new:                             ; preds = %.preheader117.us
  %invariant.gep185 = getelementptr inbounds i8, ptr %invariant.gep, i64 2
  %invariant.gep187 = getelementptr inbounds i8, ptr %invariant.gep, i64 4
  %invariant.gep189 = getelementptr inbounds i8, ptr %invariant.gep, i64 6
  br label %23

23:                                               ; preds = %23, %.preheader117.us.new
  %indvars.iv = phi i64 [ 1, %.preheader117.us.new ], [ %indvars.iv.next.3, %23 ]
  %niter = phi i64 [ 0, %.preheader117.us.new ], [ %niter.next.3, %23 ]
  %gep = getelementptr inbounds i16, ptr %invariant.gep, i64 %indvars.iv
  %24 = load i16, ptr %gep, align 2, !tbaa !13
  %25 = sext i16 %24 to i64
  %26 = getelementptr inbounds i32, ptr %13, i64 %25
  %27 = load i32, ptr %26, align 4, !tbaa !15
  %28 = add nsw i32 %27, 1
  store i32 %28, ptr %26, align 4, !tbaa !15
  %gep186 = getelementptr inbounds i16, ptr %invariant.gep185, i64 %indvars.iv
  %29 = load i16, ptr %gep186, align 2, !tbaa !13
  %30 = sext i16 %29 to i64
  %31 = getelementptr inbounds i32, ptr %13, i64 %30
  %32 = load i32, ptr %31, align 4, !tbaa !15
  %33 = add nsw i32 %32, 1
  store i32 %33, ptr %31, align 4, !tbaa !15
  %gep188 = getelementptr inbounds i16, ptr %invariant.gep187, i64 %indvars.iv
  %34 = load i16, ptr %gep188, align 2, !tbaa !13
  %35 = sext i16 %34 to i64
  %36 = getelementptr inbounds i32, ptr %13, i64 %35
  %37 = load i32, ptr %36, align 4, !tbaa !15
  %38 = add nsw i32 %37, 1
  store i32 %38, ptr %36, align 4, !tbaa !15
  %gep190 = getelementptr inbounds i16, ptr %invariant.gep189, i64 %indvars.iv
  %39 = load i16, ptr %gep190, align 2, !tbaa !13
  %40 = sext i16 %39 to i64
  %41 = getelementptr inbounds i32, ptr %13, i64 %40
  %42 = load i32, ptr %41, align 4, !tbaa !15
  %43 = add nsw i32 %42, 1
  store i32 %43, ptr %41, align 4, !tbaa !15
  %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.us.unr-lcssa, label %23, !llvm.loop !16

._crit_edge.us.unr-lcssa:                         ; preds = %23, %.preheader117.us
  %indvars.iv.unr = phi i64 [ 1, %.preheader117.us ], [ %indvars.iv.next.3, %23 ]
  br i1 %lcmp.mod.not, label %._crit_edge.us, label %.epil.preheader

.epil.preheader:                                  ; preds = %._crit_edge.us.unr-lcssa, %.epil.preheader
  %indvars.iv.epil = phi i64 [ %indvars.iv.next.epil, %.epil.preheader ], [ %indvars.iv.unr, %._crit_edge.us.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.epil.preheader ], [ 0, %._crit_edge.us.unr-lcssa ]
  %gep.epil = getelementptr inbounds i16, ptr %invariant.gep, i64 %indvars.iv.epil
  %44 = load i16, ptr %gep.epil, align 2, !tbaa !13
  %45 = sext i16 %44 to i64
  %46 = getelementptr inbounds i32, ptr %13, i64 %45
  %47 = load i32, ptr %46, align 4, !tbaa !15
  %48 = add nsw i32 %47, 1
  store i32 %48, ptr %46, align 4, !tbaa !15
  %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.us, label %.epil.preheader, !llvm.loop !18

._crit_edge.us:                                   ; preds = %.epil.preheader, %._crit_edge.us.unr-lcssa
  %indvars.iv.next138 = add nuw nsw i64 %indvars.iv137, 1
  %exitcond141.not = icmp eq i64 %indvars.iv.next138, %wide.trip.count140
  br i1 %exitcond141.not, label %._crit_edge120, label %.preheader117.us, !llvm.loop !20

._crit_edge120:                                   ; preds = %._crit_edge.us, %4
  %49 = add nsw i32 %7, -2
  %scevgep = getelementptr inbounds i8, ptr %13, i64 131068
  %load_initial = load i32, ptr %scevgep, align 4
  %invariant.gep191 = getelementptr i8, ptr %13, i64 -4
  %invariant.gep193 = getelementptr i8, ptr %13, i64 -8
  %invariant.gep195 = getelementptr i8, ptr %13, i64 -4
  %invariant.gep197 = getelementptr i8, ptr %13, i64 -16
  br label %70

vector.ph:                                        ; preds = %70
  %50 = add nsw i32 %5, -2
  %51 = mul nsw i32 %49, %50
  %52 = sitofp i32 %51 to double
  %broadcast.splatinsert = insertelement <2 x double> poison, double %52, i64 0
  %broadcast.splat = shufflevector <2 x double> %broadcast.splatinsert, <2 x double> poison, <2 x i32> zeroinitializer
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next.3, %vector.body ]
  %53 = getelementptr inbounds i32, ptr %13, i64 %index
  %wide.load = load <2 x i32>, ptr %53, align 4, !tbaa !15
  %54 = sitofp <2 x i32> %wide.load to <2 x double>
  %55 = fdiv <2 x double> %54, %broadcast.splat
  %56 = getelementptr inbounds double, ptr %12, i64 %index
  store <2 x double> %55, ptr %56, align 8, !tbaa !21
  %index.next = or disjoint i64 %index, 2
  %57 = getelementptr inbounds i32, ptr %13, i64 %index.next
  %wide.load.1 = load <2 x i32>, ptr %57, align 4, !tbaa !15
  %58 = sitofp <2 x i32> %wide.load.1 to <2 x double>
  %59 = fdiv <2 x double> %58, %broadcast.splat
  %60 = getelementptr inbounds double, ptr %12, i64 %index.next
  store <2 x double> %59, ptr %60, align 8, !tbaa !21
  %index.next.1 = or disjoint i64 %index, 4
  %61 = getelementptr inbounds i32, ptr %13, i64 %index.next.1
  %wide.load.2 = load <2 x i32>, ptr %61, align 4, !tbaa !15
  %62 = sitofp <2 x i32> %wide.load.2 to <2 x double>
  %63 = fdiv <2 x double> %62, %broadcast.splat
  %64 = getelementptr inbounds double, ptr %12, i64 %index.next.1
  store <2 x double> %63, ptr %64, align 8, !tbaa !21
  %index.next.2 = or disjoint i64 %index, 6
  %65 = getelementptr inbounds i32, ptr %13, i64 %index.next.2
  %wide.load.3 = load <2 x i32>, ptr %65, align 4, !tbaa !15
  %66 = sitofp <2 x i32> %wide.load.3 to <2 x double>
  %67 = fdiv <2 x double> %66, %broadcast.splat
  %68 = getelementptr inbounds double, ptr %12, i64 %index.next.2
  store <2 x double> %67, ptr %68, align 8, !tbaa !21
  %index.next.3 = add nuw nsw i64 %index, 8
  %69 = icmp eq i64 %index.next.3, 32768
  br i1 %69, label %middle.block, label %vector.body, !llvm.loop !23

70:                                               ; preds = %78, %._crit_edge120
  %store_forwarded = phi i32 [ %load_initial, %._crit_edge120 ], [ %80, %78 ]
  %indvars.iv142 = phi i64 [ 32767, %._crit_edge120 ], [ %indvars.iv.next143.3, %78 ]
  %gep192 = getelementptr i32, ptr %invariant.gep191, i64 %indvars.iv142
  %71 = load i32, ptr %gep192, align 4, !tbaa !15
  %72 = add nsw i32 %71, %store_forwarded
  store i32 %72, ptr %gep192, align 4, !tbaa !15
  %gep194 = getelementptr i32, ptr %invariant.gep193, i64 %indvars.iv142
  %73 = load i32, ptr %gep194, align 4, !tbaa !15
  %74 = add nsw i32 %73, %72
  store i32 %74, ptr %gep194, align 4, !tbaa !15
  %indvars.iv.next143.1 = add nsw i64 %indvars.iv142, -2
  %gep196 = getelementptr i32, ptr %invariant.gep195, i64 %indvars.iv.next143.1
  %75 = load i32, ptr %gep196, align 4, !tbaa !15
  %76 = add nsw i32 %75, %74
  store i32 %76, ptr %gep196, align 4, !tbaa !15
  %77 = icmp ugt i64 %indvars.iv.next143.1, 1
  br i1 %77, label %78, label %vector.ph, !llvm.loop !26

78:                                               ; preds = %70
  %gep198 = getelementptr i32, ptr %invariant.gep197, i64 %indvars.iv142
  %79 = load i32, ptr %gep198, align 4, !tbaa !15
  %80 = add nsw i32 %79, %76
  store i32 %80, ptr %gep198, align 4, !tbaa !15
  %indvars.iv.next143.3 = add nsw i64 %indvars.iv142, -4
  br label %70

middle.block:                                     ; preds = %vector.body
  tail call void @_ZdlPvm(ptr noundef nonnull %13, i64 noundef 4) #7
  %81 = getelementptr inbounds i8, ptr %0, i64 32
  %82 = getelementptr inbounds i8, ptr %0, i64 24
  br label %83

83:                                               ; preds = %middle.block, %._crit_edge131
  %indvars.iv163 = phi i64 [ 0, %middle.block ], [ %indvars.iv.next164, %._crit_edge131 ]
  %.0134 = phi i32 [ %3, %middle.block ], [ %.1, %._crit_edge131 ]
  %.0109133 = phi double [ 1.000000e+00, %middle.block ], [ %160, %._crit_edge131 ]
  %84 = getelementptr inbounds ptr, ptr %2, i64 %indvars.iv163
  %85 = load ptr, ptr %84, align 8, !tbaa !27
  %86 = icmp eq ptr %85, null
  br i1 %86, label %87, label %90

87:                                               ; preds = %83
  %88 = tail call noalias noundef nonnull ptr @_Znam(i64 noundef %11) #6
  store ptr %88, ptr %84, align 8, !tbaa !27
  tail call void @llvm.memset.p0.i64(ptr nonnull align 1 %88, i8 0, i64 %11, i1 false)
  %89 = add nsw i32 %.0134, 1
  br label %90

90:                                               ; preds = %87, %83
  %.0108 = phi ptr [ %88, %87 ], [ %85, %83 ]
  %.1 = phi i32 [ %89, %87 ], [ %.0134, %83 ]
  %91 = load ptr, ptr %8, align 8, !tbaa !12
  tail call void @llvm.memset.p0.i64(ptr align 1 %91, i8 0, i64 %11, i1 false)
  %92 = load i32, ptr %81, align 8, !tbaa !28
  %93 = icmp sgt i32 %92, 0
  br i1 %93, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %90
  %94 = load ptr, ptr %82, align 8, !tbaa !29
  %wide.trip.count152 = zext nneg i32 %92 to i64
  %min.iters.check = icmp ult i32 %92, 9
  br i1 %min.iters.check, label %scalar.ph172.preheader, label %vector.ph173

scalar.ph172.preheader:                           ; preds = %middle.block171, %.lr.ph
  %indvars.iv149.ph = phi i64 [ 0, %.lr.ph ], [ %n.vec, %middle.block171 ]
  %.0107123.ph = phi i32 [ 0, %.lr.ph ], [ %137, %middle.block171 ]
  br label %scalar.ph172

vector.ph173:                                     ; preds = %.lr.ph
  %n.mod.vf = and i64 %wide.trip.count152, 7
  %95 = icmp eq i64 %n.mod.vf, 0
  %96 = select i1 %95, i64 8, i64 %n.mod.vf
  %n.vec = sub nsw i64 %wide.trip.count152, %96
  br label %vector.body175

vector.body175:                                   ; preds = %vector.body175, %vector.ph173
  %index176 = phi i64 [ 0, %vector.ph173 ], [ %index.next178, %vector.body175 ]
  %vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph173 ], [ %134, %vector.body175 ]
  %vec.phi177 = phi <4 x i32> [ zeroinitializer, %vector.ph173 ], [ %135, %vector.body175 ]
  %97 = or disjoint i64 %index176, 1
  %98 = or disjoint i64 %index176, 2
  %99 = or disjoint i64 %index176, 3
  %100 = or disjoint i64 %index176, 4
  %101 = or disjoint i64 %index176, 5
  %102 = or disjoint i64 %index176, 6
  %103 = or disjoint i64 %index176, 7
  %104 = getelementptr inbounds %struct.EdgeSegment, ptr %94, i64 %index176, i32 1
  %105 = getelementptr inbounds %struct.EdgeSegment, ptr %94, i64 %97, i32 1
  %106 = getelementptr inbounds %struct.EdgeSegment, ptr %94, i64 %98, i32 1
  %107 = getelementptr inbounds %struct.EdgeSegment, ptr %94, i64 %99, i32 1
  %108 = getelementptr inbounds %struct.EdgeSegment, ptr %94, i64 %100, i32 1
  %109 = getelementptr inbounds %struct.EdgeSegment, ptr %94, i64 %101, i32 1
  %110 = getelementptr inbounds %struct.EdgeSegment, ptr %94, i64 %102, i32 1
  %111 = getelementptr inbounds %struct.EdgeSegment, ptr %94, i64 %103, i32 1
  %112 = load i32, ptr %104, align 8, !tbaa !30
  %113 = load i32, ptr %105, align 8, !tbaa !30
  %114 = load i32, ptr %106, align 8, !tbaa !30
  %115 = load i32, ptr %107, align 8, !tbaa !30
  %116 = insertelement <4 x i32> poison, i32 %112, i64 0
  %117 = insertelement <4 x i32> %116, i32 %113, i64 1
  %118 = insertelement <4 x i32> %117, i32 %114, i64 2
  %119 = insertelement <4 x i32> %118, i32 %115, i64 3
  %120 = load i32, ptr %108, align 8, !tbaa !30
  %121 = load i32, ptr %109, align 8, !tbaa !30
  %122 = load i32, ptr %110, align 8, !tbaa !30
  %123 = load i32, ptr %111, align 8, !tbaa !30
  %124 = insertelement <4 x i32> poison, i32 %120, i64 0
  %125 = insertelement <4 x i32> %124, i32 %121, i64 1
  %126 = insertelement <4 x i32> %125, i32 %122, i64 2
  %127 = insertelement <4 x i32> %126, i32 %123, i64 3
  %128 = add nsw <4 x i32> %119, <i32 -1, i32 -1, i32 -1, i32 -1>
  %129 = add nsw <4 x i32> %127, <i32 -1, i32 -1, i32 -1, i32 -1>
  %130 = mul nsw <4 x i32> %128, %119
  %131 = mul nsw <4 x i32> %129, %127
  %132 = sdiv <4 x i32> %130, <i32 2, i32 2, i32 2, i32 2>
  %133 = sdiv <4 x i32> %131, <i32 2, i32 2, i32 2, i32 2>
  %134 = add <4 x i32> %132, %vec.phi
  %135 = add <4 x i32> %133, %vec.phi177
  %index.next178 = add nuw i64 %index176, 8
  %136 = icmp eq i64 %index.next178, %n.vec
  br i1 %136, label %middle.block171, label %vector.body175, !llvm.loop !32

middle.block171:                                  ; preds = %vector.body175
  %bin.rdx = add <4 x i32> %135, %134
  %137 = tail call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
  br label %scalar.ph172.preheader

.preheader115:                                    ; preds = %scalar.ph172
  br i1 %93, label %.lr.ph126, label %._crit_edge

scalar.ph172:                                     ; preds = %scalar.ph172.preheader, %scalar.ph172
  %indvars.iv149 = phi i64 [ %indvars.iv.next150, %scalar.ph172 ], [ %indvars.iv149.ph, %scalar.ph172.preheader ]
  %.0107123 = phi i32 [ %143, %scalar.ph172 ], [ %.0107123.ph, %scalar.ph172.preheader ]
  %138 = getelementptr inbounds %struct.EdgeSegment, ptr %94, i64 %indvars.iv149, i32 1
  %139 = load i32, ptr %138, align 8, !tbaa !30
  %140 = add nsw i32 %139, -1
  %141 = mul nsw i32 %140, %139
  %142 = sdiv i32 %141, 2
  %143 = add nsw i32 %142, %.0107123
  %indvars.iv.next150 = add nuw nsw i64 %indvars.iv149, 1
  %exitcond153.not = icmp eq i64 %indvars.iv.next150, %wide.trip.count152
  br i1 %exitcond153.not, label %.preheader115, label %scalar.ph172, !llvm.loop !33

._crit_edge:                                      ; preds = %.lr.ph126, %90, %.preheader115
  tail call void @_Z18ExtractNewSegmentsP7EdgeMap(ptr noundef nonnull %0)
  %144 = load i32, ptr %81, align 8, !tbaa !28
  %145 = icmp sgt i32 %144, 0
  br i1 %145, label %.preheader.preheader, label %._crit_edge131

.preheader.preheader:                             ; preds = %._crit_edge
  %.pre = load ptr, ptr %82, align 8, !tbaa !29
  br label %.preheader

.lr.ph126:                                        ; preds = %.preheader115, %.lr.ph126
  %indvars.iv154 = phi i64 [ %indvars.iv.next155, %.lr.ph126 ], [ 0, %.preheader115 ]
  %146 = load ptr, ptr %82, align 8, !tbaa !29
  %147 = getelementptr inbounds %struct.EdgeSegment, ptr %146, i64 %indvars.iv154, i32 1
  %148 = load i32, ptr %147, align 8, !tbaa !30
  %149 = add nsw i32 %148, -1
  %150 = trunc nuw nsw i64 %indvars.iv154 to i32
  tail call void @_ZL11TestSegmentP7EdgeMapPsiiiiPdd(ptr noundef nonnull %0, ptr noundef %1, i32 noundef %150, i32 noundef 0, i32 noundef %149, i32 noundef %143, ptr noundef nonnull %12, double noundef %.0109133)
  %indvars.iv.next155 = add nuw nsw i64 %indvars.iv154, 1
  %151 = load i32, ptr %81, align 8, !tbaa !28
  %152 = sext i32 %151 to i64
  %153 = icmp slt i64 %indvars.iv.next155, %152
  br i1 %153, label %.lr.ph126, label %._crit_edge, !llvm.loop !34

.preheader:                                       ; preds = %.preheader.preheader, %._crit_edge129
  %154 = phi i32 [ %144, %.preheader.preheader ], [ %161, %._crit_edge129 ]
  %155 = phi ptr [ %.pre, %.preheader.preheader ], [ %162, %._crit_edge129 ]
  %indvars.iv160 = phi i64 [ 0, %.preheader.preheader ], [ %indvars.iv.next161, %._crit_edge129 ]
  %156 = getelementptr inbounds %struct.EdgeSegment, ptr %155, i64 %indvars.iv160
  %157 = getelementptr inbounds i8, ptr %156, i64 8
  %158 = load i32, ptr %157, align 8, !tbaa !30
  %159 = icmp sgt i32 %158, 0
  br i1 %159, label %.lr.ph128, label %._crit_edge129

._crit_edge131:                                   ; preds = %._crit_edge129, %._crit_edge
  %160 = fadd double %.0109133, 5.000000e-01
  %indvars.iv.next164 = add nuw nsw i64 %indvars.iv163, 1
  %exitcond166 = icmp eq i64 %indvars.iv.next164, 16
  br i1 %exitcond166, label %183, label %83, !llvm.loop !35

._crit_edge129.loopexit:                          ; preds = %.lr.ph128
  %.pre167 = load i32, ptr %81, align 8, !tbaa !28
  br label %._crit_edge129

._crit_edge129:                                   ; preds = %._crit_edge129.loopexit, %.preheader
  %161 = phi i32 [ %.pre167, %._crit_edge129.loopexit ], [ %154, %.preheader ]
  %162 = phi ptr [ %177, %._crit_edge129.loopexit ], [ %155, %.preheader ]
  %indvars.iv.next161 = add nuw nsw i64 %indvars.iv160, 1
  %163 = sext i32 %161 to i64
  %164 = icmp slt i64 %indvars.iv.next161, %163
  br i1 %164, label %.preheader, label %._crit_edge131, !llvm.loop !36

.lr.ph128:                                        ; preds = %.preheader, %.lr.ph128
  %indvars.iv157 = phi i64 [ %indvars.iv.next158, %.lr.ph128 ], [ 0, %.preheader ]
  %165 = phi ptr [ %178, %.lr.ph128 ], [ %156, %.preheader ]
  %166 = load ptr, ptr %165, align 8, !tbaa !37
  %167 = getelementptr inbounds %struct.Pixel, ptr %166, i64 %indvars.iv157
  %168 = load i32, ptr %167, align 4, !tbaa !38
  %169 = getelementptr inbounds i8, ptr %167, i64 4
  %170 = load i32, ptr %169, align 4, !tbaa !40
  %171 = mul nsw i32 %168, %5
  %172 = add nsw i32 %171, %170
  %173 = sext i32 %172 to i64
  %174 = getelementptr inbounds i8, ptr %.0108, i64 %173
  %175 = load i8, ptr %174, align 1, !tbaa !41
  %176 = add i8 %175, 1
  store i8 %176, ptr %174, align 1, !tbaa !41
  %indvars.iv.next158 = add nuw nsw i64 %indvars.iv157, 1
  %177 = load ptr, ptr %82, align 8, !tbaa !29
  %178 = getelementptr inbounds %struct.EdgeSegment, ptr %177, i64 %indvars.iv160
  %179 = getelementptr inbounds i8, ptr %178, i64 8
  %180 = load i32, ptr %179, align 8, !tbaa !30
  %181 = sext i32 %180 to i64
  %182 = icmp slt i64 %indvars.iv.next158, %181
  br i1 %182, label %.lr.ph128, label %._crit_edge129.loopexit, !llvm.loop !42

183:                                              ; preds = %._crit_edge131
  tail call void @_ZdlPvm(ptr noundef nonnull %12, i64 noundef 8) #7
  ret i32 %.1
}

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

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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #2 = { nobuiltin 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 #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 = { nobuiltin 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 #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { builtin allocsize(0) }
attributes #7 = { builtin 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, !7, i64 0}
!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 4}
!12 = !{!6, !10, i64 8}
!13 = !{!14, !14, i64 0}
!14 = !{!"short", !8, i64 0}
!15 = !{!7, !7, i64 0}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.mustprogress"}
!18 = distinct !{!18, !19}
!19 = !{!"llvm.loop.unroll.disable"}
!20 = distinct !{!20, !17}
!21 = !{!22, !22, i64 0}
!22 = !{!"double", !8, i64 0}
!23 = distinct !{!23, !17, !24, !25}
!24 = !{!"llvm.loop.isvectorized", i32 1}
!25 = !{!"llvm.loop.unroll.runtime.disable"}
!26 = distinct !{!26, !17}
!27 = !{!10, !10, i64 0}
!28 = !{!6, !7, i64 32}
!29 = !{!6, !10, i64 24}
!30 = !{!31, !7, i64 8}
!31 = !{!"_ZTS11EdgeSegment", !10, i64 0, !7, i64 8}
!32 = distinct !{!32, !17, !24, !25}
!33 = distinct !{!33, !17, !25, !24}
!34 = distinct !{!34, !17}
!35 = distinct !{!35, !17}
!36 = distinct !{!36, !17}
!37 = !{!31, !10, i64 0}
!38 = !{!39, !7, i64 0}
!39 = !{!"_ZTS5Pixel", !7, i64 0, !7, i64 4}
!40 = !{!39, !7, i64 4}
!41 = !{!8, !8, i64 0}
!42 = distinct !{!42, !17}


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