; LLVM IR from NavInfoNC/nc-geo :: src/polygon_marker.ll (ZN13PolygonMarker20findCentralMarkPointEPP13StaticPolygoniP5PointPi)

; 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.Point = type { i32, i32 }
%struct.Rect = type { i32, i32, i32, i32 }
%class.PolygonMarker = type { %class.Vector, %class.Vector, ptr, i32, %class.SmallObjectAllocator }
%class.Vector = type { ptr, i64, i64 }
%class.SmallObjectAllocator = type { ptr, i64, %class.Vector, %class.Vector }
%"struct.PolygonMarker::Cell" = type { %struct.Point, i32, i32, i32 }

@_ZN13PolygonMarker4Cell14s_polygonCountE = external dso_local global i32, align 4
@_ZN13PolygonMarker4Cell9s_polygonE = external dso_local global ptr, align 8
@_ZN13PolygonMarker4Cell15s_polygonCenterE = external dso_local global %struct.Point, align 4

; 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: 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: mustprogress uwtable
define dso_local void @_ZN13PolygonMarker20findCentralMarkPointEPP13StaticPolygoniP5PointPi(ptr noundef nonnull align 8 dereferenceable(128) %0, ptr noundef %1, i32 noundef %2, ptr noundef %3, ptr noundef %4) #2 align 2 {
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca %struct.Rect, align 4
  %12 = alloca i32, align 4
  %13 = alloca %struct.Rect, align 4
  %14 = alloca %struct.Point, align 4
  %15 = alloca %struct.Point, align 4
  store ptr %0, ptr %6, align 8, !tbaa !5
  store ptr %1, ptr %7, align 8, !tbaa !5
  store i32 %2, ptr %8, align 4, !tbaa !9
  store ptr %3, ptr %9, align 8, !tbaa !5
  store ptr %4, ptr %10, align 8, !tbaa !5
  %16 = load ptr, ptr %6, align 8
  %17 = getelementptr inbounds %class.PolygonMarker, ptr %16, i32 0, i32 4
  call void @_ZN20SmallObjectAllocatorIN13PolygonMarker4CellEE14freeAllObjectsEv(ptr noundef nonnull align 8 dereferenceable(64) %17)
  %18 = load ptr, ptr %7, align 8, !tbaa !5
  store ptr %18, ptr @_ZN13PolygonMarker4Cell9s_polygonE, align 8, !tbaa !5
  %19 = load i32, ptr %8, align 4, !tbaa !9
  store i32 %19, ptr @_ZN13PolygonMarker4Cell14s_polygonCountE, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 16, ptr %11) #6
  %20 = load ptr, ptr %7, align 8, !tbaa !5
  %21 = getelementptr inbounds ptr, ptr %20, i64 0
  %22 = load ptr, ptr %21, align 8, !tbaa !5
  %23 = call { i64, i64 } @_ZN13StaticPolygon11boundingBoxEv(ptr noundef nonnull align 8 dereferenceable(40) %22)
  %24 = getelementptr inbounds { i64, i64 }, ptr %11, i32 0, i32 0
  %25 = extractvalue { i64, i64 } %23, 0
  store i64 %25, ptr %24, align 4
  %26 = getelementptr inbounds { i64, i64 }, ptr %11, i32 0, i32 1
  %27 = extractvalue { i64, i64 } %23, 1
  store i64 %27, ptr %26, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  store i32 0, ptr %12, align 4, !tbaa !9
  br label %28

28:                                               ; preds = %48, %5
  %29 = load i32, ptr %12, align 4, !tbaa !9
  %30 = load i32, ptr %8, align 4, !tbaa !9
  %31 = icmp slt i32 %29, %30
  br i1 %31, label %33, label %32

32:                                               ; preds = %28
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  br label %51

33:                                               ; preds = %28
  %34 = load ptr, ptr %7, align 8, !tbaa !5
  %35 = load i32, ptr %12, align 4, !tbaa !9
  %36 = sext i32 %35 to i64
  %37 = getelementptr inbounds ptr, ptr %34, i64 %36
  %38 = load ptr, ptr %37, align 8, !tbaa !5
  %39 = call { i64, i64 } @_ZN13StaticPolygon11boundingBoxEv(ptr noundef nonnull align 8 dereferenceable(40) %38)
  %40 = getelementptr inbounds { i64, i64 }, ptr %13, i32 0, i32 0
  %41 = extractvalue { i64, i64 } %39, 0
  store i64 %41, ptr %40, align 4
  %42 = getelementptr inbounds { i64, i64 }, ptr %13, i32 0, i32 1
  %43 = extractvalue { i64, i64 } %39, 1
  store i64 %43, ptr %42, align 4
  %44 = getelementptr inbounds { i64, i64 }, ptr %13, i32 0, i32 0
  %45 = load i64, ptr %44, align 4
  %46 = getelementptr inbounds { i64, i64 }, ptr %13, i32 0, i32 1
  %47 = load i64, ptr %46, align 4
  call void @_ZN4Rect11combineRectES_(ptr noundef nonnull align 4 dereferenceable(16) %11, i64 %45, i64 %47)
  br label %48

48:                                               ; preds = %33
  %49 = load i32, ptr %12, align 4, !tbaa !9
  %50 = add nsw i32 %49, 1
  store i32 %50, ptr %12, align 4, !tbaa !9
  br label %28, !llvm.loop !11

51:                                               ; preds = %32
  %52 = getelementptr inbounds %class.PolygonMarker, ptr %16, i32 0, i32 0
  call void @_ZN6VectorIPN13PolygonMarker4CellEE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) %52)
  %53 = getelementptr inbounds %class.PolygonMarker, ptr %16, i32 0, i32 1
  call void @_ZN6VectorIPN13PolygonMarker4CellEE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) %53)
  %54 = call noundef ptr @_ZN13PolygonMarker9allocCellEv(ptr noundef nonnull align 8 dereferenceable(128) %16)
  %55 = getelementptr inbounds %class.PolygonMarker, ptr %16, i32 0, i32 2
  store ptr %54, ptr %55, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #6
  %56 = call i64 @_ZN4Rect6centerEv(ptr noundef nonnull align 4 dereferenceable(16) %11)
  store i64 %56, ptr %14, align 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 @_ZN13PolygonMarker4Cell15s_polygonCenterE, ptr align 4 %14, i64 8, i1 false), !tbaa.struct !18
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  %57 = getelementptr inbounds %class.PolygonMarker, ptr %16, i32 0, i32 2
  %58 = load ptr, ptr %57, align 8, !tbaa !13
  %59 = call i64 @_ZN4Rect6centerEv(ptr noundef nonnull align 4 dereferenceable(16) %11)
  store i64 %59, ptr %15, align 4
  %60 = call noundef i32 @_ZN4Rect5widthEv(ptr noundef nonnull align 4 dereferenceable(16) %11)
  %61 = call noundef i32 @_ZN4Rect6heightEv(ptr noundef nonnull align 4 dereferenceable(16) %11)
  %62 = icmp sgt i32 %60, %61
  br i1 %62, label %63, label %65

63:                                               ; preds = %51
  %64 = call noundef i32 @_ZN4Rect5widthEv(ptr noundef nonnull align 4 dereferenceable(16) %11)
  br label %67

65:                                               ; preds = %51
  %66 = call noundef i32 @_ZN4Rect6heightEv(ptr noundef nonnull align 4 dereferenceable(16) %11)
  br label %67

67:                                               ; preds = %65, %63
  %68 = phi i32 [ %64, %63 ], [ %66, %65 ]
  %69 = add nsw i32 %68, 1
  %70 = sdiv i32 %69, 2
  %71 = load i64, ptr %15, align 4
  call void @_ZN13PolygonMarker4Cell4initE5Pointi(ptr noundef nonnull align 4 dereferenceable(20) %58, i64 %71, i32 noundef %70)
  %72 = getelementptr inbounds %class.PolygonMarker, ptr %16, i32 0, i32 0
  %73 = getelementptr inbounds %class.PolygonMarker, ptr %16, i32 0, i32 2
  call void @_ZN6VectorIPN13PolygonMarker4CellEE6appendERKS2_(ptr noundef nonnull align 8 dereferenceable(24) %72, ptr noundef nonnull align 8 dereferenceable(8) %73)
  br label %74

74:                                               ; preds = %94, %67
  %75 = getelementptr inbounds %class.PolygonMarker, ptr %16, i32 0, i32 0
  %76 = call noundef i64 @_ZNK6VectorIPN13PolygonMarker4CellEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %75)
  %77 = icmp ne i64 %76, 0
  br i1 %77, label %82, label %78

78:                                               ; preds = %74
  %79 = getelementptr inbounds %class.PolygonMarker, ptr %16, i32 0, i32 1
  %80 = call noundef i64 @_ZNK6VectorIPN13PolygonMarker4CellEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %79)
  %81 = icmp ne i64 %80, 0
  br label %82

82:                                               ; preds = %78, %74
  %83 = phi i1 [ true, %74 ], [ %81, %78 ]
  br i1 %83, label %84, label %95

84:                                               ; preds = %82
  %85 = getelementptr inbounds %class.PolygonMarker, ptr %16, i32 0, i32 0
  %86 = call noundef i64 @_ZNK6VectorIPN13PolygonMarker4CellEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %85)
  %87 = icmp ne i64 %86, 0
  br i1 %87, label %88, label %91

88:                                               ; preds = %84
  %89 = getelementptr inbounds %class.PolygonMarker, ptr %16, i32 0, i32 0
  %90 = getelementptr inbounds %class.PolygonMarker, ptr %16, i32 0, i32 1
  call void @_ZN13PolygonMarker20searchCandidateCellsER6VectorIPNS_4CellEES4_(ptr noundef nonnull align 8 dereferenceable(128) %16, ptr noundef nonnull align 8 dereferenceable(24) %89, ptr noundef nonnull align 8 dereferenceable(24) %90)
  br label %94

91:                                               ; preds = %84
  %92 = getelementptr inbounds %class.PolygonMarker, ptr %16, i32 0, i32 1
  %93 = getelementptr inbounds %class.PolygonMarker, ptr %16, i32 0, i32 0
  call void @_ZN13PolygonMarker20searchCandidateCellsER6VectorIPNS_4CellEES4_(ptr noundef nonnull align 8 dereferenceable(128) %16, ptr noundef nonnull align 8 dereferenceable(24) %92, ptr noundef nonnull align 8 dereferenceable(24) %93)
  br label %94

94:                                               ; preds = %91, %88
  br label %74, !llvm.loop !19

95:                                               ; preds = %82
  %96 = getelementptr inbounds %class.PolygonMarker, ptr %16, i32 0, i32 2
  %97 = load ptr, ptr %96, align 8, !tbaa !13
  %98 = getelementptr inbounds %"struct.PolygonMarker::Cell", ptr %97, i32 0, i32 0
  %99 = getelementptr inbounds %struct.Point, ptr %98, i32 0, i32 0
  %100 = load i32, ptr %99, align 4, !tbaa !20
  %101 = load ptr, ptr %9, align 8, !tbaa !5
  %102 = getelementptr inbounds %struct.Point, ptr %101, i32 0, i32 0
  store i32 %100, ptr %102, align 4, !tbaa !23
  %103 = getelementptr inbounds %class.PolygonMarker, ptr %16, i32 0, i32 2
  %104 = load ptr, ptr %103, align 8, !tbaa !13
  %105 = getelementptr inbounds %"struct.PolygonMarker::Cell", ptr %104, i32 0, i32 0
  %106 = getelementptr inbounds %struct.Point, ptr %105, i32 0, i32 1
  %107 = load i32, ptr %106, align 4, !tbaa !24
  %108 = load ptr, ptr %9, align 8, !tbaa !5
  %109 = getelementptr inbounds %struct.Point, ptr %108, i32 0, i32 1
  store i32 %107, ptr %109, align 4, !tbaa !25
  %110 = load ptr, ptr %10, align 8, !tbaa !5
  %111 = icmp ne ptr %110, null
  br i1 %111, label %112, label %118

112:                                              ; preds = %95
  %113 = getelementptr inbounds %class.PolygonMarker, ptr %16, i32 0, i32 2
  %114 = load ptr, ptr %113, align 8, !tbaa !13
  %115 = getelementptr inbounds %"struct.PolygonMarker::Cell", ptr %114, i32 0, i32 2
  %116 = load i32, ptr %115, align 4, !tbaa !26
  %117 = load ptr, ptr %10, align 8, !tbaa !5
  store i32 %116, ptr %117, align 4, !tbaa !9
  br label %118

118:                                              ; preds = %112, %95
  call void @llvm.lifetime.end.p0(i64 16, ptr %11) #6
  ret void
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN20SmallObjectAllocatorIN13PolygonMarker4CellEE14freeAllObjectsEv(ptr noundef nonnull align 8 dereferenceable(64)) #2 align 2

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local { i64, i64 } @_ZN13StaticPolygon11boundingBoxEv(ptr noundef nonnull align 8 dereferenceable(40)) #3 align 2

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local void @_ZN4Rect11combineRectES_(ptr noundef nonnull align 4 dereferenceable(16), i64, i64) #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN6VectorIPN13PolygonMarker4CellEE5clearEv(ptr noundef nonnull align 8 dereferenceable(24)) #4 align 2

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local noundef ptr @_ZN13PolygonMarker9allocCellEv(ptr noundef nonnull align 8 dereferenceable(128)) #3 align 2

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare dso_local i64 @_ZN4Rect6centerEv(ptr noundef nonnull align 4 dereferenceable(16)) #5 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN13PolygonMarker4Cell4initE5Pointi(ptr noundef nonnull align 4 dereferenceable(20), i64, i32 noundef) #2 align 2

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN4Rect5widthEv(ptr noundef nonnull align 4 dereferenceable(16)) #5 align 2

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN4Rect6heightEv(ptr noundef nonnull align 4 dereferenceable(16)) #5 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6VectorIPN13PolygonMarker4CellEE6appendERKS2_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(8)) #2 align 2

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNK6VectorIPN13PolygonMarker4CellEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) #5 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN13PolygonMarker20searchCandidateCellsER6VectorIPNS_4CellEES4_(ptr noundef nonnull align 8 dereferenceable(128), ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) #2 align 2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { alwaysinline 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 = { 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 #5 = { alwaysinline 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 #6 = { 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 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!14, !6, i64 48}
!14 = !{!"_ZTS13PolygonMarker", !15, i64 0, !15, i64 24, !6, i64 48, !10, i64 56, !17, i64 64}
!15 = !{!"_ZTS6VectorIPN13PolygonMarker4CellEE", !6, i64 0, !16, i64 8, !16, i64 16}
!16 = !{!"long", !7, i64 0}
!17 = !{!"_ZTS20SmallObjectAllocatorIN13PolygonMarker4CellEE", !16, i64 8, !15, i64 16, !15, i64 40}
!18 = !{i64 0, i64 4, !9, i64 4, i64 4, !9}
!19 = distinct !{!19, !12}
!20 = !{!21, !10, i64 0}
!21 = !{!"_ZTSN13PolygonMarker4CellE", !22, i64 0, !10, i64 8, !10, i64 12, !10, i64 16}
!22 = !{!"_ZTS5Point", !10, i64 0, !10, i64 4}
!23 = !{!22, !10, i64 0}
!24 = !{!21, !10, i64 4}
!25 = !{!22, !10, i64 4}
!26 = !{!21, !10, i64 12}


; 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.Point = type { i32, i32 }
%struct.Rect = type { i32, i32, i32, i32 }

@_ZN13PolygonMarker4Cell14s_polygonCountE = external dso_local local_unnamed_addr global i32, align 4
@_ZN13PolygonMarker4Cell9s_polygonE = external dso_local local_unnamed_addr global ptr, align 8
@_ZN13PolygonMarker4Cell15s_polygonCenterE = external dso_local local_unnamed_addr global %struct.Point, align 4

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN13PolygonMarker20findCentralMarkPointEPP13StaticPolygoniP5PointPi(ptr noundef nonnull align 8 dereferenceable(128) %0, ptr noundef %1, i32 noundef %2, ptr nocapture noundef writeonly %3, ptr noundef writeonly %4) local_unnamed_addr #1 align 2 {
  %6 = alloca %struct.Rect, align 8
  %7 = getelementptr inbounds i8, ptr %0, i64 64
  tail call void @_ZN20SmallObjectAllocatorIN13PolygonMarker4CellEE14freeAllObjectsEv(ptr noundef nonnull align 8 dereferenceable(64) %7)
  store ptr %1, ptr @_ZN13PolygonMarker4Cell9s_polygonE, align 8, !tbaa !5
  store i32 %2, ptr @_ZN13PolygonMarker4Cell14s_polygonCountE, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %6) #5
  %8 = load ptr, ptr %1, align 8, !tbaa !5
  %9 = tail call { i64, i64 } @_ZN13StaticPolygon11boundingBoxEv(ptr noundef nonnull align 8 dereferenceable(40) %8)
  %10 = extractvalue { i64, i64 } %9, 0
  store i64 %10, ptr %6, align 8
  %11 = getelementptr inbounds i8, ptr %6, i64 8
  %12 = extractvalue { i64, i64 } %9, 1
  store i64 %12, ptr %11, align 8
  %13 = icmp sgt i32 %2, 0
  br i1 %13, label %.lr.ph.preheader, label %._crit_edge

.lr.ph.preheader:                                 ; preds = %5
  %wide.trip.count = zext nneg i32 %2 to i64
  br label %.lr.ph

._crit_edge:                                      ; preds = %.lr.ph, %5
  call void @_ZN6VectorIPN13PolygonMarker4CellEE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) %0)
  %14 = getelementptr inbounds i8, ptr %0, i64 24
  call void @_ZN6VectorIPN13PolygonMarker4CellEE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) %14)
  %15 = call noundef ptr @_ZN13PolygonMarker9allocCellEv(ptr noundef nonnull align 8 dereferenceable(128) %0)
  %16 = getelementptr inbounds i8, ptr %0, i64 48
  store ptr %15, ptr %16, align 8, !tbaa !11
  %17 = call i64 @_ZN4Rect6centerEv(ptr noundef nonnull align 4 dereferenceable(16) %6)
  store i64 %17, ptr @_ZN13PolygonMarker4Cell15s_polygonCenterE, align 4
  %18 = load ptr, ptr %16, align 8, !tbaa !11
  %19 = call i64 @_ZN4Rect6centerEv(ptr noundef nonnull align 4 dereferenceable(16) %6)
  %20 = call noundef i32 @_ZN4Rect5widthEv(ptr noundef nonnull align 4 dereferenceable(16) %6)
  %21 = call noundef i32 @_ZN4Rect6heightEv(ptr noundef nonnull align 4 dereferenceable(16) %6)
  %22 = icmp sgt i32 %20, %21
  br i1 %22, label %28, label %30

.lr.ph:                                           ; preds = %.lr.ph.preheader, %.lr.ph
  %indvars.iv = phi i64 [ 0, %.lr.ph.preheader ], [ %indvars.iv.next, %.lr.ph ]
  %23 = getelementptr inbounds ptr, ptr %1, i64 %indvars.iv
  %24 = load ptr, ptr %23, align 8, !tbaa !5
  %25 = call { i64, i64 } @_ZN13StaticPolygon11boundingBoxEv(ptr noundef nonnull align 8 dereferenceable(40) %24)
  %26 = extractvalue { i64, i64 } %25, 0
  %27 = extractvalue { i64, i64 } %25, 1
  call void @_ZN4Rect11combineRectES_(ptr noundef nonnull align 4 dereferenceable(16) %6, i64 %26, i64 %27)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph, !llvm.loop !16

28:                                               ; preds = %._crit_edge
  %29 = call noundef i32 @_ZN4Rect5widthEv(ptr noundef nonnull align 4 dereferenceable(16) %6)
  br label %32

30:                                               ; preds = %._crit_edge
  %31 = call noundef i32 @_ZN4Rect6heightEv(ptr noundef nonnull align 4 dereferenceable(16) %6)
  br label %32

32:                                               ; preds = %30, %28
  %33 = phi i32 [ %29, %28 ], [ %31, %30 ]
  %34 = add nsw i32 %33, 1
  %35 = sdiv i32 %34, 2
  call void @_ZN13PolygonMarker4Cell4initE5Pointi(ptr noundef nonnull align 4 dereferenceable(20) %18, i64 %19, i32 noundef %35)
  call void @_ZN6VectorIPN13PolygonMarker4CellEE6appendERKS2_(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 8 dereferenceable(8) %16)
  br label %36

36:                                               ; preds = %.backedge, %32
  %37 = call noundef i64 @_ZNK6VectorIPN13PolygonMarker4CellEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %0)
  %.not = icmp eq i64 %37, 0
  br i1 %.not, label %38, label %.critedge

38:                                               ; preds = %36
  %39 = call noundef i64 @_ZNK6VectorIPN13PolygonMarker4CellEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %14)
  %.not15 = icmp eq i64 %39, 0
  br i1 %.not15, label %43, label %.critedge

.critedge:                                        ; preds = %36, %38
  %40 = call noundef i64 @_ZNK6VectorIPN13PolygonMarker4CellEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %0)
  %.not17 = icmp eq i64 %40, 0
  br i1 %.not17, label %42, label %41

41:                                               ; preds = %.critedge
  call void @_ZN13PolygonMarker20searchCandidateCellsER6VectorIPNS_4CellEES4_(ptr noundef nonnull align 8 dereferenceable(128) %0, ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 8 dereferenceable(24) %14)
  br label %.backedge

42:                                               ; preds = %.critedge
  call void @_ZN13PolygonMarker20searchCandidateCellsER6VectorIPNS_4CellEES4_(ptr noundef nonnull align 8 dereferenceable(128) %0, ptr noundef nonnull align 8 dereferenceable(24) %14, ptr noundef nonnull align 8 dereferenceable(24) %0)
  br label %.backedge

.backedge:                                        ; preds = %42, %41
  br label %36, !llvm.loop !18

43:                                               ; preds = %38
  %44 = load ptr, ptr %16, align 8, !tbaa !11
  %45 = load <2 x i32>, ptr %44, align 4, !tbaa !9
  store <2 x i32> %45, ptr %3, align 4, !tbaa !9
  %.not16 = icmp eq ptr %4, null
  br i1 %.not16, label %49, label %46

46:                                               ; preds = %43
  %47 = getelementptr inbounds i8, ptr %44, i64 12
  %48 = load i32, ptr %47, align 4, !tbaa !19
  store i32 %48, ptr %4, align 4, !tbaa !9
  br label %49

49:                                               ; preds = %46, %43
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #5
  ret void
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN20SmallObjectAllocatorIN13PolygonMarker4CellEE14freeAllObjectsEv(ptr noundef nonnull align 8 dereferenceable(64)) local_unnamed_addr #1 align 2

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local { i64, i64 } @_ZN13StaticPolygon11boundingBoxEv(ptr noundef nonnull align 8 dereferenceable(40)) local_unnamed_addr #2 align 2

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local void @_ZN4Rect11combineRectES_(ptr noundef nonnull align 4 dereferenceable(16), i64, i64) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN6VectorIPN13PolygonMarker4CellEE5clearEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #3 align 2

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local noundef ptr @_ZN13PolygonMarker9allocCellEv(ptr noundef nonnull align 8 dereferenceable(128)) local_unnamed_addr #2 align 2

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare dso_local i64 @_ZN4Rect6centerEv(ptr noundef nonnull align 4 dereferenceable(16)) local_unnamed_addr #4 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN13PolygonMarker4Cell4initE5Pointi(ptr noundef nonnull align 4 dereferenceable(20), i64, i32 noundef) local_unnamed_addr #1 align 2

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN4Rect5widthEv(ptr noundef nonnull align 4 dereferenceable(16)) local_unnamed_addr #4 align 2

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN4Rect6heightEv(ptr noundef nonnull align 4 dereferenceable(16)) local_unnamed_addr #4 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6VectorIPN13PolygonMarker4CellEE6appendERKS2_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #1 align 2

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNK6VectorIPN13PolygonMarker4CellEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #4 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN13PolygonMarker20searchCandidateCellsER6VectorIPNS_4CellEES4_(ptr noundef nonnull align 8 dereferenceable(128), ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #1 align 2

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { alwaysinline 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 #3 = { 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 #4 = { alwaysinline 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 #5 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !6, i64 48}
!12 = !{!"_ZTS13PolygonMarker", !13, i64 0, !13, i64 24, !6, i64 48, !10, i64 56, !15, i64 64}
!13 = !{!"_ZTS6VectorIPN13PolygonMarker4CellEE", !6, i64 0, !14, i64 8, !14, i64 16}
!14 = !{!"long", !7, i64 0}
!15 = !{!"_ZTS20SmallObjectAllocatorIN13PolygonMarker4CellEE", !14, i64 8, !13, i64 16, !13, i64 40}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.mustprogress"}
!18 = distinct !{!18, !17}
!19 = !{!20, !10, i64 12}
!20 = !{!"_ZTSN13PolygonMarker4CellE", !21, i64 0, !10, i64 8, !10, i64 12, !10, i64 16}
!21 = !{!"_ZTS5Point", !10, i64 0, !10, i64 4}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SLPVectorizerPass,SROAPass,SimplifyCFGPass,TailCallElimPass