; LLVM IR from tyoma/agge :: src/agge/vector_rasterizer.ll (ZN4agge17vector_rasterizer4sortEb)

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

%"class.agge::vector_rasterizer" = type <{ %"class.agge::pod_vector", %"class.agge::pod_vector.0", %"class.agge::pod_vector.0", %"class.agge::pod_vector", i32, i32, i32, i32, i32, [4 x i8] }>
%"class.agge::pod_vector.0" = type { ptr, ptr, ptr }
%"class.agge::pod_vector" = type { ptr, ptr, ptr }
%"struct.agge::vector_rasterizer::cell" = type <{ i16, i16, i32, i16 }>

; 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: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK4agge17vector_rasterizer5emptyEv(ptr noundef nonnull align 8 dereferenceable(116)) #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZN4agge10pod_vectorINS_17vector_rasterizer4cellEE3endEv(ptr noundef nonnull align 8 dereferenceable(24)) #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK4agge10pod_vectorINS_17vector_rasterizer4cellEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) #1 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4agge17vector_rasterizer4sortEb(ptr noundef nonnull align 8 dereferenceable(116) %0, i1 noundef zeroext %1) #2 align 2 {
  %3 = alloca ptr, align 8
  %4 = alloca i8, align 1
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca ptr, align 8
  %17 = alloca ptr, align 8
  %18 = alloca ptr, align 8
  %19 = alloca ptr, align 8
  %20 = alloca ptr, align 8
  %21 = alloca ptr, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  %22 = zext i1 %1 to i8
  store i8 %22, ptr %4, align 1, !tbaa !9
  %23 = load ptr, ptr %3, align 8
  %24 = getelementptr inbounds %"class.agge::vector_rasterizer", ptr %23, i32 0, i32 8
  %25 = load i32, ptr %24, align 8, !tbaa !11
  %26 = icmp ne i32 %25, 0
  br i1 %26, label %29, label %27

27:                                               ; preds = %2
  %28 = call noundef zeroext i1 @_ZNK4agge17vector_rasterizer5emptyEv(ptr noundef nonnull align 8 dereferenceable(116) %23)
  br i1 %28, label %29, label %30

29:                                               ; preds = %27, %2
  br label %247

30:                                               ; preds = %27
  %31 = getelementptr inbounds %"class.agge::vector_rasterizer", ptr %23, i32 0, i32 3
  %32 = getelementptr inbounds %"class.agge::vector_rasterizer", ptr %23, i32 0, i32 0
  %33 = call noundef i32 @_ZNK4agge10pod_vectorINS_17vector_rasterizer4cellEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %32)
  call void @_ZN4agge10pod_vectorINS_17vector_rasterizer4cellEE6resizeEj(ptr noundef nonnull align 8 dereferenceable(24) %31, i32 noundef %33)
  %34 = getelementptr inbounds %"class.agge::vector_rasterizer", ptr %23, i32 0, i32 1
  %35 = call noundef i32 @_ZNK4agge17vector_rasterizer6heightEv(ptr noundef nonnull align 8 dereferenceable(116) %23)
  %36 = add nsw i32 %35, 2
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #6
  store i32 0, ptr %5, align 4, !tbaa !16
  call void @_ZN4agge10pod_vectorIjE6assignEjRKj(ptr noundef nonnull align 8 dereferenceable(24) %34, i32 noundef %36, ptr noundef nonnull align 4 dereferenceable(4) %5)
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #6
  %37 = getelementptr inbounds %"class.agge::vector_rasterizer", ptr %23, i32 0, i32 1
  %38 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN4agge10pod_vectorIjEixEj(ptr noundef nonnull align 8 dereferenceable(24) %37, i32 noundef 0)
  %39 = getelementptr inbounds %"class.agge::vector_rasterizer", ptr %23, i32 0, i32 4
  %40 = load i32, ptr %39, align 8, !tbaa !17
  %41 = sext i32 %40 to i64
  %42 = sub i64 0, %41
  %43 = getelementptr inbounds i32, ptr %38, i64 %42
  %44 = getelementptr inbounds i32, ptr %43, i64 2
  store ptr %44, ptr %6, align 8, !tbaa !5
  %45 = load i8, ptr %4, align 1, !tbaa !9, !range !18, !noundef !19
  %46 = trunc i8 %45 to i1
  br i1 %46, label %47, label %72

47:                                               ; preds = %30
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #6
  %48 = getelementptr inbounds %"class.agge::vector_rasterizer", ptr %23, i32 0, i32 0
  %49 = call noundef ptr @_ZN4agge10pod_vectorINS_17vector_rasterizer4cellEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %48)
  store ptr %49, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #6
  %50 = getelementptr inbounds %"class.agge::vector_rasterizer", ptr %23, i32 0, i32 0
  %51 = call noundef ptr @_ZN4agge10pod_vectorINS_17vector_rasterizer4cellEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %50)
  store ptr %51, ptr %8, align 8, !tbaa !5
  br label %52

52:                                               ; preds = %66, %47
  %53 = load ptr, ptr %7, align 8, !tbaa !5
  %54 = load ptr, ptr %8, align 8, !tbaa !5
  %55 = icmp ne ptr %53, %54
  br i1 %55, label %57, label %56

56:                                               ; preds = %52
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  br label %69

57:                                               ; preds = %52
  %58 = load ptr, ptr %6, align 8, !tbaa !5
  %59 = load ptr, ptr %7, align 8, !tbaa !5
  %60 = getelementptr inbounds %"struct.agge::vector_rasterizer::cell", ptr %59, i32 0, i32 1
  %61 = load i16, ptr %60, align 1, !tbaa !20
  %62 = sext i16 %61 to i64
  %63 = getelementptr inbounds i32, ptr %58, i64 %62
  %64 = load i32, ptr %63, align 4, !tbaa !16
  %65 = add i32 %64, 1
  store i32 %65, ptr %63, align 4, !tbaa !16
  br label %66

66:                                               ; preds = %57
  %67 = load ptr, ptr %7, align 8, !tbaa !5
  %68 = getelementptr inbounds %"struct.agge::vector_rasterizer::cell", ptr %67, i32 1
  store ptr %68, ptr %7, align 8, !tbaa !5
  br label %52, !llvm.loop !23

69:                                               ; preds = %56
  %70 = getelementptr inbounds %"class.agge::vector_rasterizer", ptr %23, i32 0, i32 0
  %71 = getelementptr inbounds %"class.agge::vector_rasterizer", ptr %23, i32 0, i32 3
  call void @_ZN4agge10pod_vectorINS_17vector_rasterizer4cellEE4swapERS3_(ptr noundef nonnull align 8 dereferenceable(24) %70, ptr noundef nonnull align 8 dereferenceable(24) %71)
  br label %164

72:                                               ; preds = %30
  %73 = getelementptr inbounds %"class.agge::vector_rasterizer", ptr %23, i32 0, i32 2
  %74 = call noundef i32 @_ZNK4agge17vector_rasterizer5widthEv(ptr noundef nonnull align 8 dereferenceable(116) %23)
  %75 = add nsw i32 %74, 1
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  store i32 0, ptr %9, align 4, !tbaa !16
  call void @_ZN4agge10pod_vectorIjE6assignEjRKj(ptr noundef nonnull align 8 dereferenceable(24) %73, i32 noundef %75, ptr noundef nonnull align 4 dereferenceable(4) %9)
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  %76 = getelementptr inbounds %"class.agge::vector_rasterizer", ptr %23, i32 0, i32 2
  %77 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN4agge10pod_vectorIjEixEj(ptr noundef nonnull align 8 dereferenceable(24) %76, i32 noundef 0)
  %78 = getelementptr inbounds %"class.agge::vector_rasterizer", ptr %23, i32 0, i32 5
  %79 = load i32, ptr %78, align 4, !tbaa !25
  %80 = sext i32 %79 to i64
  %81 = sub i64 0, %80
  %82 = getelementptr inbounds i32, ptr %77, i64 %81
  %83 = getelementptr inbounds i32, ptr %82, i64 1
  store ptr %83, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  %84 = getelementptr inbounds %"class.agge::vector_rasterizer", ptr %23, i32 0, i32 0
  %85 = call noundef ptr @_ZN4agge10pod_vectorINS_17vector_rasterizer4cellEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %84)
  store ptr %85, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  %86 = getelementptr inbounds %"class.agge::vector_rasterizer", ptr %23, i32 0, i32 0
  %87 = call noundef ptr @_ZN4agge10pod_vectorINS_17vector_rasterizer4cellEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %86)
  store ptr %87, ptr %12, align 8, !tbaa !5
  br label %88

88:                                               ; preds = %110, %72
  %89 = load ptr, ptr %11, align 8, !tbaa !5
  %90 = load ptr, ptr %12, align 8, !tbaa !5
  %91 = icmp ne ptr %89, %90
  br i1 %91, label %93, label %92

92:                                               ; preds = %88
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  br label %113

93:                                               ; preds = %88
  %94 = load ptr, ptr %10, align 8, !tbaa !5
  %95 = load ptr, ptr %11, align 8, !tbaa !5
  %96 = getelementptr inbounds %"struct.agge::vector_rasterizer::cell", ptr %95, i32 0, i32 0
  %97 = load i16, ptr %96, align 1, !tbaa !26
  %98 = sext i16 %97 to i64
  %99 = getelementptr inbounds i32, ptr %94, i64 %98
  %100 = load i32, ptr %99, align 4, !tbaa !16
  %101 = add i32 %100, 1
  store i32 %101, ptr %99, align 4, !tbaa !16
  %102 = load ptr, ptr %6, align 8, !tbaa !5
  %103 = load ptr, ptr %11, align 8, !tbaa !5
  %104 = getelementptr inbounds %"struct.agge::vector_rasterizer::cell", ptr %103, i32 0, i32 1
  %105 = load i16, ptr %104, align 1, !tbaa !20
  %106 = sext i16 %105 to i64
  %107 = getelementptr inbounds i32, ptr %102, i64 %106
  %108 = load i32, ptr %107, align 4, !tbaa !16
  %109 = add i32 %108, 1
  store i32 %109, ptr %107, align 4, !tbaa !16
  br label %110

110:                                              ; preds = %93
  %111 = load ptr, ptr %11, align 8, !tbaa !5
  %112 = getelementptr inbounds %"struct.agge::vector_rasterizer::cell", ptr %111, i32 1
  store ptr %112, ptr %11, align 8, !tbaa !5
  br label %88, !llvm.loop !27

113:                                              ; preds = %92
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #6
  %114 = getelementptr inbounds %"class.agge::vector_rasterizer", ptr %23, i32 0, i32 2
  %115 = call noundef ptr @_ZN4agge10pod_vectorIjE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %114)
  %116 = getelementptr inbounds i32, ptr %115, i64 1
  store ptr %116, ptr %13, align 8, !tbaa !5
  br label %117

117:                                              ; preds = %130, %113
  %118 = load ptr, ptr %13, align 8, !tbaa !5
  %119 = getelementptr inbounds %"class.agge::vector_rasterizer", ptr %23, i32 0, i32 2
  %120 = call noundef ptr @_ZN4agge10pod_vectorIjE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %119)
  %121 = icmp ne ptr %118, %120
  br i1 %121, label %123, label %122

122:                                              ; preds = %117
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  br label %133

123:                                              ; preds = %117
  %124 = load ptr, ptr %13, align 8, !tbaa !5
  %125 = getelementptr inbounds i32, ptr %124, i64 -1
  %126 = load i32, ptr %125, align 4, !tbaa !16
  %127 = load ptr, ptr %13, align 8, !tbaa !5
  %128 = load i32, ptr %127, align 4, !tbaa !16
  %129 = add i32 %128, %126
  store i32 %129, ptr %127, align 4, !tbaa !16
  br label %130

130:                                              ; preds = %123
  %131 = load ptr, ptr %13, align 8, !tbaa !5
  %132 = getelementptr inbounds i32, ptr %131, i32 1
  store ptr %132, ptr %13, align 8, !tbaa !5
  br label %117, !llvm.loop !28

133:                                              ; preds = %122
  %134 = load ptr, ptr %10, align 8, !tbaa !5
  %135 = getelementptr inbounds i32, ptr %134, i32 -1
  store ptr %135, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #6
  %136 = getelementptr inbounds %"class.agge::vector_rasterizer", ptr %23, i32 0, i32 0
  %137 = call noundef ptr @_ZN4agge10pod_vectorINS_17vector_rasterizer4cellEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %136)
  store ptr %137, ptr %14, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #6
  %138 = getelementptr inbounds %"class.agge::vector_rasterizer", ptr %23, i32 0, i32 3
  %139 = call noundef ptr @_ZN4agge10pod_vectorINS_17vector_rasterizer4cellEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %138)
  store ptr %139, ptr %15, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #6
  %140 = getelementptr inbounds %"class.agge::vector_rasterizer", ptr %23, i32 0, i32 0
  %141 = call noundef ptr @_ZN4agge10pod_vectorINS_17vector_rasterizer4cellEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %140)
  store ptr %141, ptr %16, align 8, !tbaa !5
  br label %142

142:                                              ; preds = %160, %133
  %143 = load ptr, ptr %14, align 8, !tbaa !5
  %144 = load ptr, ptr %16, align 8, !tbaa !5
  %145 = icmp ne ptr %143, %144
  br i1 %145, label %147, label %146

146:                                              ; preds = %142
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  br label %163

147:                                              ; preds = %142
  %148 = load ptr, ptr %14, align 8, !tbaa !5
  %149 = load ptr, ptr %15, align 8, !tbaa !5
  %150 = load ptr, ptr %10, align 8, !tbaa !5
  %151 = load ptr, ptr %14, align 8, !tbaa !5
  %152 = getelementptr inbounds %"struct.agge::vector_rasterizer::cell", ptr %151, i32 0, i32 0
  %153 = load i16, ptr %152, align 1, !tbaa !26
  %154 = sext i16 %153 to i64
  %155 = getelementptr inbounds i32, ptr %150, i64 %154
  %156 = load i32, ptr %155, align 4, !tbaa !16
  %157 = add i32 %156, 1
  store i32 %157, ptr %155, align 4, !tbaa !16
  %158 = zext i32 %156 to i64
  %159 = getelementptr inbounds %"struct.agge::vector_rasterizer::cell", ptr %149, i64 %158
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %159, ptr align 1 %148, i64 10, i1 false), !tbaa.struct !29
  br label %160

160:                                              ; preds = %147
  %161 = load ptr, ptr %14, align 8, !tbaa !5
  %162 = getelementptr inbounds %"struct.agge::vector_rasterizer::cell", ptr %161, i32 1
  store ptr %162, ptr %14, align 8, !tbaa !5
  br label %142, !llvm.loop !31

163:                                              ; preds = %146
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  br label %164

164:                                              ; preds = %163, %69
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #6
  %165 = getelementptr inbounds %"class.agge::vector_rasterizer", ptr %23, i32 0, i32 1
  %166 = call noundef ptr @_ZN4agge10pod_vectorIjE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %165)
  %167 = getelementptr inbounds i32, ptr %166, i64 2
  store ptr %167, ptr %17, align 8, !tbaa !5
  br label %168

168:                                              ; preds = %181, %164
  %169 = load ptr, ptr %17, align 8, !tbaa !5
  %170 = getelementptr inbounds %"class.agge::vector_rasterizer", ptr %23, i32 0, i32 1
  %171 = call noundef ptr @_ZN4agge10pod_vectorIjE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %170)
  %172 = icmp ne ptr %169, %171
  br i1 %172, label %174, label %173

173:                                              ; preds = %168
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #6
  br label %184

174:                                              ; preds = %168
  %175 = load ptr, ptr %17, align 8, !tbaa !5
  %176 = getelementptr inbounds i32, ptr %175, i64 -1
  %177 = load i32, ptr %176, align 4, !tbaa !16
  %178 = load ptr, ptr %17, align 8, !tbaa !5
  %179 = load i32, ptr %178, align 4, !tbaa !16
  %180 = add i32 %179, %177
  store i32 %180, ptr %178, align 4, !tbaa !16
  br label %181

181:                                              ; preds = %174
  %182 = load ptr, ptr %17, align 8, !tbaa !5
  %183 = getelementptr inbounds i32, ptr %182, i32 1
  store ptr %183, ptr %17, align 8, !tbaa !5
  br label %168, !llvm.loop !32

184:                                              ; preds = %173
  %185 = load ptr, ptr %6, align 8, !tbaa !5
  %186 = getelementptr inbounds i32, ptr %185, i32 -1
  store ptr %186, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #6
  %187 = getelementptr inbounds %"class.agge::vector_rasterizer", ptr %23, i32 0, i32 3
  %188 = call noundef ptr @_ZN4agge10pod_vectorINS_17vector_rasterizer4cellEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %187)
  store ptr %188, ptr %18, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #6
  %189 = getelementptr inbounds %"class.agge::vector_rasterizer", ptr %23, i32 0, i32 0
  %190 = call noundef ptr @_ZN4agge10pod_vectorINS_17vector_rasterizer4cellEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %189)
  store ptr %190, ptr %19, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #6
  %191 = getelementptr inbounds %"class.agge::vector_rasterizer", ptr %23, i32 0, i32 3
  %192 = call noundef ptr @_ZN4agge10pod_vectorINS_17vector_rasterizer4cellEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %191)
  store ptr %192, ptr %20, align 8, !tbaa !5
  br label %193

193:                                              ; preds = %211, %184
  %194 = load ptr, ptr %18, align 8, !tbaa !5
  %195 = load ptr, ptr %20, align 8, !tbaa !5
  %196 = icmp ne ptr %194, %195
  br i1 %196, label %198, label %197

197:                                              ; preds = %193
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #6
  br label %214

198:                                              ; preds = %193
  %199 = load ptr, ptr %18, align 8, !tbaa !5
  %200 = load ptr, ptr %19, align 8, !tbaa !5
  %201 = load ptr, ptr %6, align 8, !tbaa !5
  %202 = load ptr, ptr %18, align 8, !tbaa !5
  %203 = getelementptr inbounds %"struct.agge::vector_rasterizer::cell", ptr %202, i32 0, i32 1
  %204 = load i16, ptr %203, align 1, !tbaa !20
  %205 = sext i16 %204 to i64
  %206 = getelementptr inbounds i32, ptr %201, i64 %205
  %207 = load i32, ptr %206, align 4, !tbaa !16
  %208 = add i32 %207, 1
  store i32 %208, ptr %206, align 4, !tbaa !16
  %209 = zext i32 %207 to i64
  %210 = getelementptr inbounds %"struct.agge::vector_rasterizer::cell", ptr %200, i64 %209
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %210, ptr align 1 %199, i64 10, i1 false), !tbaa.struct !29
  br label %211

211:                                              ; preds = %198
  %212 = load ptr, ptr %18, align 8, !tbaa !5
  %213 = getelementptr inbounds %"struct.agge::vector_rasterizer::cell", ptr %212, i32 1
  store ptr %213, ptr %18, align 8, !tbaa !5
  br label %193, !llvm.loop !33

214:                                              ; preds = %197
  %215 = load i8, ptr %4, align 1, !tbaa !9, !range !18, !noundef !19
  %216 = trunc i8 %215 to i1
  br i1 %216, label %217, label %245

217:                                              ; preds = %214
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #6
  %218 = getelementptr inbounds %"class.agge::vector_rasterizer", ptr %23, i32 0, i32 1
  %219 = call noundef ptr @_ZN4agge10pod_vectorIjE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %218)
  store ptr %219, ptr %21, align 8, !tbaa !5
  br label %220

220:                                              ; preds = %241, %217
  %221 = load ptr, ptr %21, align 8, !tbaa !5
  %222 = getelementptr inbounds %"class.agge::vector_rasterizer", ptr %23, i32 0, i32 1
  %223 = call noundef ptr @_ZN4agge10pod_vectorIjE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %222)
  %224 = getelementptr inbounds i32, ptr %223, i64 -1
  %225 = icmp ne ptr %221, %224
  br i1 %225, label %227, label %226

226:                                              ; preds = %220
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #6
  br label %244

227:                                              ; preds = %220
  %228 = getelementptr inbounds %"class.agge::vector_rasterizer", ptr %23, i32 0, i32 0
  %229 = call noundef ptr @_ZN4agge10pod_vectorINS_17vector_rasterizer4cellEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %228)
  %230 = load ptr, ptr %21, align 8, !tbaa !5
  %231 = load i32, ptr %230, align 4, !tbaa !16
  %232 = zext i32 %231 to i64
  %233 = getelementptr inbounds %"struct.agge::vector_rasterizer::cell", ptr %229, i64 %232
  %234 = getelementptr inbounds %"class.agge::vector_rasterizer", ptr %23, i32 0, i32 0
  %235 = call noundef ptr @_ZN4agge10pod_vectorINS_17vector_rasterizer4cellEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %234)
  %236 = load ptr, ptr %21, align 8, !tbaa !5
  %237 = getelementptr inbounds i32, ptr %236, i64 1
  %238 = load i32, ptr %237, align 4, !tbaa !16
  %239 = zext i32 %238 to i64
  %240 = getelementptr inbounds %"struct.agge::vector_rasterizer::cell", ptr %235, i64 %239
  call void @_ZN4agge12_GLOBAL__N_122sort_cells_x_ascendingIPNS_17vector_rasterizer4cellEEEvT_S5_(ptr noundef %233, ptr noundef %240)
  br label %241

241:                                              ; preds = %227
  %242 = load ptr, ptr %21, align 8, !tbaa !5
  %243 = getelementptr inbounds i32, ptr %242, i32 1
  store ptr %243, ptr %21, align 8, !tbaa !5
  br label %220, !llvm.loop !34

244:                                              ; preds = %226
  br label %245

245:                                              ; preds = %244, %214
  %246 = getelementptr inbounds %"class.agge::vector_rasterizer", ptr %23, i32 0, i32 8
  store i32 1, ptr %246, align 8, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #6
  br label %247

247:                                              ; preds = %245, %29
  ret void
}

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN4agge10pod_vectorIjE6assignEjRKj(ptr noundef nonnull align 8 dereferenceable(24), i32 noundef, ptr noundef nonnull align 4 dereferenceable(4)) #3 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK4agge17vector_rasterizer6heightEv(ptr noundef nonnull align 8 dereferenceable(116)) #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZN4agge10pod_vectorIjEixEj(ptr noundef nonnull align 8 dereferenceable(24), i32 noundef) #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZN4agge10pod_vectorINS_17vector_rasterizer4cellEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24)) #1 align 2

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK4agge17vector_rasterizer5widthEv(ptr noundef nonnull align 8 dereferenceable(116)) #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZN4agge10pod_vectorIjE5beginEv(ptr noundef nonnull align 8 dereferenceable(24)) #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZN4agge10pod_vectorIjE3endEv(ptr noundef nonnull align 8 dereferenceable(24)) #1 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare hidden void @_ZN4agge12_GLOBAL__N_122sort_cells_x_ascendingIPNS_17vector_rasterizer4cellEEEvT_S5_(ptr noundef, ptr noundef) #5

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { inlinehint 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 #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 = { inlinehint 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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { 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 = !{!"bool", !7, i64 0}
!11 = !{!12, !15, i64 112}
!12 = !{!"_ZTSN4agge17vector_rasterizerE", !13, i64 0, !14, i64 24, !14, i64 48, !13, i64 72, !15, i64 96, !15, i64 100, !15, i64 104, !15, i64 108, !15, i64 112}
!13 = !{!"_ZTSN4agge10pod_vectorINS_17vector_rasterizer4cellEEE", !6, i64 0, !6, i64 8, !6, i64 16}
!14 = !{!"_ZTSN4agge10pod_vectorIjEE", !6, i64 0, !6, i64 8, !6, i64 16}
!15 = !{!"int", !7, i64 0}
!16 = !{!15, !15, i64 0}
!17 = !{!12, !15, i64 96}
!18 = !{i8 0, i8 2}
!19 = !{}
!20 = !{!21, !22, i64 2}
!21 = !{!"_ZTSN4agge17vector_rasterizer4cellE", !22, i64 0, !22, i64 2, !15, i64 4, !22, i64 8}
!22 = !{!"short", !7, i64 0}
!23 = distinct !{!23, !24}
!24 = !{!"llvm.loop.mustprogress"}
!25 = !{!12, !15, i64 100}
!26 = !{!21, !22, i64 0}
!27 = distinct !{!27, !24}
!28 = distinct !{!28, !24}
!29 = !{i64 0, i64 2, !30, i64 2, i64 2, !30, i64 4, i64 4, !16, i64 8, i64 2, !30}
!30 = !{!22, !22, i64 0}
!31 = distinct !{!31, !24}
!32 = distinct !{!32, !24}
!33 = distinct !{!33, !24}
!34 = distinct !{!34, !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.agge::vector_rasterizer::cell" = type <{ i16, i16, i32, i16 }>

; 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: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK4agge17vector_rasterizer5emptyEv(ptr noundef nonnull align 8 dereferenceable(116)) local_unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZN4agge10pod_vectorINS_17vector_rasterizer4cellEE3endEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK4agge10pod_vectorINS_17vector_rasterizer4cellEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4agge17vector_rasterizer4sortEb(ptr noundef nonnull align 8 dereferenceable(116) %0, i1 noundef zeroext %1) local_unnamed_addr #2 align 2 {
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = getelementptr inbounds i8, ptr %0, i64 112
  %6 = load i32, ptr %5, align 8, !tbaa !5
  %.not = icmp eq i32 %6, 0
  br i1 %.not, label %7, label %111

7:                                                ; preds = %2
  %8 = tail call noundef zeroext i1 @_ZNK4agge17vector_rasterizer5emptyEv(ptr noundef nonnull align 8 dereferenceable(116) %0)
  br i1 %8, label %111, label %9

9:                                                ; preds = %7
  %10 = getelementptr inbounds i8, ptr %0, i64 72
  %11 = tail call noundef i32 @_ZNK4agge10pod_vectorINS_17vector_rasterizer4cellEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %0)
  tail call void @_ZN4agge10pod_vectorINS_17vector_rasterizer4cellEE6resizeEj(ptr noundef nonnull align 8 dereferenceable(24) %10, i32 noundef %11)
  %12 = getelementptr inbounds i8, ptr %0, i64 24
  %13 = tail call noundef i32 @_ZNK4agge17vector_rasterizer6heightEv(ptr noundef nonnull align 8 dereferenceable(116) %0)
  %14 = add nsw i32 %13, 2
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #6
  store i32 0, ptr %3, align 4, !tbaa !13
  call void @_ZN4agge10pod_vectorIjE6assignEjRKj(ptr noundef nonnull align 8 dereferenceable(24) %12, i32 noundef %14, ptr noundef nonnull align 4 dereferenceable(4) %3)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #6
  %15 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN4agge10pod_vectorIjEixEj(ptr noundef nonnull align 8 dereferenceable(24) %12, i32 noundef 0)
  %16 = getelementptr inbounds i8, ptr %0, i64 96
  %17 = load i32, ptr %16, align 8, !tbaa !14
  %18 = sext i32 %17 to i64
  %19 = sub nsw i64 0, %18
  %20 = getelementptr inbounds i32, ptr %15, i64 %19
  %21 = getelementptr inbounds i8, ptr %20, i64 8
  br i1 %1, label %22, label %32

22:                                               ; preds = %9
  %23 = call noundef ptr @_ZN4agge10pod_vectorINS_17vector_rasterizer4cellEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %0)
  %24 = call noundef ptr @_ZN4agge10pod_vectorINS_17vector_rasterizer4cellEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %0)
  %.not5169 = icmp eq ptr %23, %24
  br i1 %.not5169, label %._crit_edge73, label %.lr.ph72

._crit_edge73:                                    ; preds = %.lr.ph72, %22
  call void @_ZN4agge10pod_vectorINS_17vector_rasterizer4cellEE4swapERS3_(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 8 dereferenceable(24) %10)
  br label %.loopexit55

.lr.ph72:                                         ; preds = %22, %.lr.ph72
  %.04270 = phi ptr [ %31, %.lr.ph72 ], [ %23, %22 ]
  %25 = getelementptr inbounds i8, ptr %.04270, i64 2
  %26 = load i16, ptr %25, align 1, !tbaa !15
  %27 = sext i16 %26 to i64
  %28 = getelementptr inbounds i32, ptr %21, i64 %27
  %29 = load i32, ptr %28, align 4, !tbaa !13
  %30 = add i32 %29, 1
  store i32 %30, ptr %28, align 4, !tbaa !13
  %31 = getelementptr inbounds i8, ptr %.04270, i64 10
  %.not51 = icmp eq ptr %31, %24
  br i1 %.not51, label %._crit_edge73, label %.lr.ph72, !llvm.loop !18

32:                                               ; preds = %9
  %33 = getelementptr inbounds i8, ptr %0, i64 48
  %34 = call noundef i32 @_ZNK4agge17vector_rasterizer5widthEv(ptr noundef nonnull align 8 dereferenceable(116) %0)
  %35 = add nsw i32 %34, 1
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #6
  store i32 0, ptr %4, align 4, !tbaa !13
  call void @_ZN4agge10pod_vectorIjE6assignEjRKj(ptr noundef nonnull align 8 dereferenceable(24) %33, i32 noundef %35, ptr noundef nonnull align 4 dereferenceable(4) %4)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #6
  %36 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN4agge10pod_vectorIjEixEj(ptr noundef nonnull align 8 dereferenceable(24) %33, i32 noundef 0)
  %37 = getelementptr inbounds i8, ptr %0, i64 100
  %38 = load i32, ptr %37, align 4, !tbaa !20
  %39 = sext i32 %38 to i64
  %40 = sub nsw i64 0, %39
  %41 = getelementptr inbounds i32, ptr %36, i64 %40
  %42 = getelementptr inbounds i8, ptr %41, i64 4
  %43 = call noundef ptr @_ZN4agge10pod_vectorINS_17vector_rasterizer4cellEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %0)
  %44 = call noundef ptr @_ZN4agge10pod_vectorINS_17vector_rasterizer4cellEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %0)
  %.not4856 = icmp eq ptr %43, %44
  br i1 %.not4856, label %._crit_edge, label %.lr.ph

._crit_edge:                                      ; preds = %.lr.ph, %32
  %45 = call noundef ptr @_ZN4agge10pod_vectorIjE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %33)
  %.04758 = getelementptr inbounds i8, ptr %45, i64 4
  %46 = call noundef ptr @_ZN4agge10pod_vectorIjE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %33)
  %.not4959 = icmp eq ptr %.04758, %46
  br i1 %.not4959, label %._crit_edge64, label %.lr.ph63

.lr.ph:                                           ; preds = %32, %.lr.ph
  %.04557 = phi ptr [ %58, %.lr.ph ], [ %43, %32 ]
  %47 = load i16, ptr %.04557, align 1, !tbaa !21
  %48 = sext i16 %47 to i64
  %49 = getelementptr inbounds i32, ptr %42, i64 %48
  %50 = load i32, ptr %49, align 4, !tbaa !13
  %51 = add i32 %50, 1
  store i32 %51, ptr %49, align 4, !tbaa !13
  %52 = getelementptr inbounds i8, ptr %.04557, i64 2
  %53 = load i16, ptr %52, align 1, !tbaa !15
  %54 = sext i16 %53 to i64
  %55 = getelementptr inbounds i32, ptr %21, i64 %54
  %56 = load i32, ptr %55, align 4, !tbaa !13
  %57 = add i32 %56, 1
  store i32 %57, ptr %55, align 4, !tbaa !13
  %58 = getelementptr inbounds i8, ptr %.04557, i64 10
  %.not48 = icmp eq ptr %58, %44
  br i1 %.not48, label %._crit_edge, label %.lr.ph, !llvm.loop !22

._crit_edge64:                                    ; preds = %.lr.ph63, %._crit_edge
  %59 = call noundef ptr @_ZN4agge10pod_vectorINS_17vector_rasterizer4cellEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %0)
  %60 = call noundef ptr @_ZN4agge10pod_vectorINS_17vector_rasterizer4cellEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %10)
  %61 = call noundef ptr @_ZN4agge10pod_vectorINS_17vector_rasterizer4cellEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %0)
  %.not5065 = icmp eq ptr %59, %61
  br i1 %.not5065, label %.loopexit55, label %.lr.ph68

.lr.ph63:                                         ; preds = %._crit_edge, %.lr.ph63
  %.04761 = phi ptr [ %.047, %.lr.ph63 ], [ %.04758, %._crit_edge ]
  %.pn60 = phi ptr [ %.04761, %.lr.ph63 ], [ %45, %._crit_edge ]
  %62 = load i32, ptr %.pn60, align 4, !tbaa !13
  %63 = load i32, ptr %.04761, align 4, !tbaa !13
  %64 = add i32 %63, %62
  store i32 %64, ptr %.04761, align 4, !tbaa !13
  %.047 = getelementptr inbounds i8, ptr %.04761, i64 4
  %65 = call noundef ptr @_ZN4agge10pod_vectorIjE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %33)
  %.not49 = icmp eq ptr %.047, %65
  br i1 %.not49, label %._crit_edge64, label %.lr.ph63, !llvm.loop !23

.lr.ph68:                                         ; preds = %._crit_edge64, %.lr.ph68
  %.04666 = phi ptr [ %73, %.lr.ph68 ], [ %59, %._crit_edge64 ]
  %66 = load i16, ptr %.04666, align 1, !tbaa !21
  %67 = sext i16 %66 to i64
  %68 = getelementptr inbounds i32, ptr %41, i64 %67
  %69 = load i32, ptr %68, align 4, !tbaa !13
  %70 = add i32 %69, 1
  store i32 %70, ptr %68, align 4, !tbaa !13
  %71 = zext i32 %69 to i64
  %72 = getelementptr inbounds %"struct.agge::vector_rasterizer::cell", ptr %60, i64 %71
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(10) %72, ptr noundef nonnull align 1 dereferenceable(10) %.04666, i64 10, i1 false), !tbaa.struct !24
  %73 = getelementptr inbounds i8, ptr %.04666, i64 10
  %.not50 = icmp eq ptr %73, %61
  br i1 %.not50, label %.loopexit55, label %.lr.ph68, !llvm.loop !26

.loopexit55:                                      ; preds = %.lr.ph68, %._crit_edge64, %._crit_edge73
  %74 = call noundef ptr @_ZN4agge10pod_vectorIjE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %12)
  %75 = getelementptr inbounds i8, ptr %74, i64 8
  %76 = call noundef ptr @_ZN4agge10pod_vectorIjE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %12)
  %.not5274 = icmp eq ptr %75, %76
  br i1 %.not5274, label %._crit_edge78, label %.lr.ph77

._crit_edge78:                                    ; preds = %.lr.ph77, %.loopexit55
  %77 = getelementptr inbounds i8, ptr %20, i64 4
  %78 = call noundef ptr @_ZN4agge10pod_vectorINS_17vector_rasterizer4cellEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %10)
  %79 = call noundef ptr @_ZN4agge10pod_vectorINS_17vector_rasterizer4cellEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %0)
  %80 = call noundef ptr @_ZN4agge10pod_vectorINS_17vector_rasterizer4cellEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %10)
  %.not5379 = icmp eq ptr %78, %80
  br i1 %.not5379, label %._crit_edge83, label %.lr.ph82

.lr.ph77:                                         ; preds = %.loopexit55, %.lr.ph77
  %.04475 = phi ptr [ %85, %.lr.ph77 ], [ %75, %.loopexit55 ]
  %81 = getelementptr inbounds i8, ptr %.04475, i64 -4
  %82 = load i32, ptr %81, align 4, !tbaa !13
  %83 = load i32, ptr %.04475, align 4, !tbaa !13
  %84 = add i32 %83, %82
  store i32 %84, ptr %.04475, align 4, !tbaa !13
  %85 = getelementptr inbounds i8, ptr %.04475, i64 4
  %86 = call noundef ptr @_ZN4agge10pod_vectorIjE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %12)
  %.not52 = icmp eq ptr %85, %86
  br i1 %.not52, label %._crit_edge78, label %.lr.ph77, !llvm.loop !27

._crit_edge83:                                    ; preds = %.lr.ph82, %._crit_edge78
  br i1 %1, label %96, label %.loopexit

.lr.ph82:                                         ; preds = %._crit_edge78, %.lr.ph82
  %.04380 = phi ptr [ %95, %.lr.ph82 ], [ %78, %._crit_edge78 ]
  %87 = getelementptr inbounds i8, ptr %.04380, i64 2
  %88 = load i16, ptr %87, align 1, !tbaa !15
  %89 = sext i16 %88 to i64
  %90 = getelementptr inbounds i32, ptr %77, i64 %89
  %91 = load i32, ptr %90, align 4, !tbaa !13
  %92 = add i32 %91, 1
  store i32 %92, ptr %90, align 4, !tbaa !13
  %93 = zext i32 %91 to i64
  %94 = getelementptr inbounds %"struct.agge::vector_rasterizer::cell", ptr %79, i64 %93
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(10) %94, ptr noundef nonnull align 1 dereferenceable(10) %.04380, i64 10, i1 false), !tbaa.struct !24
  %95 = getelementptr inbounds i8, ptr %.04380, i64 10
  %.not53 = icmp eq ptr %95, %80
  br i1 %.not53, label %._crit_edge83, label %.lr.ph82, !llvm.loop !28

96:                                               ; preds = %._crit_edge83
  %97 = call noundef ptr @_ZN4agge10pod_vectorIjE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %12)
  %98 = call noundef ptr @_ZN4agge10pod_vectorIjE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %12)
  %99 = getelementptr inbounds i8, ptr %98, i64 -4
  %.not5484 = icmp eq ptr %97, %99
  br i1 %.not5484, label %.loopexit, label %.lr.ph87

.lr.ph87:                                         ; preds = %96, %.lr.ph87
  %.085 = phi ptr [ %105, %.lr.ph87 ], [ %97, %96 ]
  %100 = call noundef ptr @_ZN4agge10pod_vectorINS_17vector_rasterizer4cellEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %0)
  %101 = load i32, ptr %.085, align 4, !tbaa !13
  %102 = zext i32 %101 to i64
  %103 = getelementptr inbounds %"struct.agge::vector_rasterizer::cell", ptr %100, i64 %102
  %104 = call noundef ptr @_ZN4agge10pod_vectorINS_17vector_rasterizer4cellEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %0)
  %105 = getelementptr inbounds i8, ptr %.085, i64 4
  %106 = load i32, ptr %105, align 4, !tbaa !13
  %107 = zext i32 %106 to i64
  %108 = getelementptr inbounds %"struct.agge::vector_rasterizer::cell", ptr %104, i64 %107
  call void @_ZN4agge12_GLOBAL__N_122sort_cells_x_ascendingIPNS_17vector_rasterizer4cellEEEvT_S5_(ptr noundef %103, ptr noundef %108)
  %109 = call noundef ptr @_ZN4agge10pod_vectorIjE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %12)
  %110 = getelementptr inbounds i8, ptr %109, i64 -4
  %.not54 = icmp eq ptr %105, %110
  br i1 %.not54, label %.loopexit, label %.lr.ph87, !llvm.loop !29

.loopexit:                                        ; preds = %.lr.ph87, %96, %._crit_edge83
  store i32 1, ptr %5, align 8, !tbaa !5
  br label %111

111:                                              ; preds = %2, %7, %.loopexit
  ret void
}

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN4agge10pod_vectorINS_17vector_rasterizer4cellEE6resizeEj(ptr noundef nonnull align 8 dereferenceable(24), i32 noundef) local_unnamed_addr #3 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN4agge10pod_vectorIjE6assignEjRKj(ptr noundef nonnull align 8 dereferenceable(24), i32 noundef, ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #3 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK4agge17vector_rasterizer6heightEv(ptr noundef nonnull align 8 dereferenceable(116)) local_unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZN4agge10pod_vectorIjEixEj(ptr noundef nonnull align 8 dereferenceable(24), i32 noundef) local_unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZN4agge10pod_vectorINS_17vector_rasterizer4cellEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #1 align 2

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK4agge17vector_rasterizer5widthEv(ptr noundef nonnull align 8 dereferenceable(116)) local_unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZN4agge10pod_vectorIjE5beginEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZN4agge10pod_vectorIjE3endEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #1 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare hidden void @_ZN4agge12_GLOBAL__N_122sort_cells_x_ascendingIPNS_17vector_rasterizer4cellEEEvT_S5_(ptr noundef, ptr noundef) local_unnamed_addr #5

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { inlinehint 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 #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 = { inlinehint 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 nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { 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, !12, i64 112}
!6 = !{!"_ZTSN4agge17vector_rasterizerE", !7, i64 0, !11, i64 24, !11, i64 48, !7, i64 72, !12, i64 96, !12, i64 100, !12, i64 104, !12, i64 108, !12, i64 112}
!7 = !{!"_ZTSN4agge10pod_vectorINS_17vector_rasterizer4cellEEE", !8, i64 0, !8, i64 8, !8, i64 16}
!8 = !{!"any pointer", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C++ TBAA"}
!11 = !{!"_ZTSN4agge10pod_vectorIjEE", !8, i64 0, !8, i64 8, !8, i64 16}
!12 = !{!"int", !9, i64 0}
!13 = !{!12, !12, i64 0}
!14 = !{!6, !12, i64 96}
!15 = !{!16, !17, i64 2}
!16 = !{!"_ZTSN4agge17vector_rasterizer4cellE", !17, i64 0, !17, i64 2, !12, i64 4, !17, i64 8}
!17 = !{!"short", !9, i64 0}
!18 = distinct !{!18, !19}
!19 = !{!"llvm.loop.mustprogress"}
!20 = !{!6, !12, i64 100}
!21 = !{!16, !17, i64 0}
!22 = distinct !{!22, !19}
!23 = distinct !{!23, !19}
!24 = !{i64 0, i64 2, !25, i64 2, i64 2, !25, i64 4, i64 4, !13, i64 8, i64 2, !25}
!25 = !{!17, !17, i64 0}
!26 = distinct !{!26, !19}
!27 = distinct !{!27, !19}
!28 = distinct !{!28, !19}
!29 = distinct !{!29, !19}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass,TailCallElimPass