; LLVM IR from BrunoLevy/learn-fpga :: LiteX/software/Tagl/Lib (peng_32x)

; 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.GPolygon = type { i32, [100 x ptr] }
%class.Mug = type { %class.GVertex, %class.GVertex }
%class.GVertex = type { %class.GVertexAttributes, i32, i32, %class.GVector, %class.GVector, %class.GVector, %class.GVector, %class.GVector, %class.Flags }
%class.GVertexAttributes = type { i32, i32, i32, i32, i32, i32, i32, i32, i32 }
%class.GVector = type { [4 x %class.GCoord] }
%class.GCoord = type { float }
%class.Flags = type { i32 }

@_ZN13PolygonEngine3_p1E = external global %class.GPolygon, align 8
@_ZN13PolygonEngine4_mugE = external global [1024 x %class.Mug], align 16
@_ZN16GraphicComponent10_graph_memE = external global ptr, align 8
@_ZN16GraphicComponent15_bytes_per_lineE = external global i32, align 4
@_ZN16GraphicComponent13_truecolormapE = external global [256 x i32], align 16

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN17PolygonEngine_32x10FillPoly_cEP17GVertexAttributes(ptr noundef %0) #0 align 2 {
  %2 = alloca ptr, align 8
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %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 i32, align 4
  %24 = alloca i32, align 4
  %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
  store ptr %0, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #3
  store i32 1000, ptr %3, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #3
  store i32 -1, ptr %4, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #3
  store i32 0, ptr %10, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #3
  %30 = load ptr, ptr %2, align 8, !tbaa !5
  %31 = getelementptr inbounds %class.GVertexAttributes, ptr %30, i32 0, i32 1
  %32 = load i32, ptr %31, align 4, !tbaa !11
  %33 = ashr i32 %32, 4
  %34 = sext i32 %33 to i64
  %35 = getelementptr inbounds [256 x i32], ptr @_ZN16GraphicComponent13_truecolormapE, i64 0, i64 %34
  %36 = load i32, ptr %35, align 4, !tbaa !9
  store i32 %36, ptr %11, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #3
  %37 = call noundef i32 @_ZN8GPolygon4SizeEv(ptr noundef nonnull align 8 dereferenceable(808) @_ZN13PolygonEngine3_p1E)
  %38 = icmp slt i32 %37, 2
  br i1 %38, label %39, label %40

39:                                               ; preds = %1
  store i32 1, ptr %23, align 4
  br label %360

40:                                               ; preds = %1
  store i32 0, ptr %5, align 4, !tbaa !9
  br label %41

41:                                               ; preds = %135, %40
  %42 = load i32, ptr %5, align 4, !tbaa !9
  %43 = call noundef i32 @_ZN8GPolygon4SizeEv(ptr noundef nonnull align 8 dereferenceable(808) @_ZN13PolygonEngine3_p1E)
  %44 = icmp slt i32 %42, %43
  br i1 %44, label %45, label %138

45:                                               ; preds = %41
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #3
  %46 = load i32, ptr %5, align 4, !tbaa !9
  %47 = add nsw i32 %46, 1
  store i32 %47, ptr %24, align 4, !tbaa !9
  %48 = load i32, ptr %24, align 4, !tbaa !9
  %49 = call noundef i32 @_ZN8GPolygon4SizeEv(ptr noundef nonnull align 8 dereferenceable(808) @_ZN13PolygonEngine3_p1E)
  %50 = icmp eq i32 %48, %49
  br i1 %50, label %51, label %52

51:                                               ; preds = %45
  store i32 0, ptr %24, align 4, !tbaa !9
  br label %52

52:                                               ; preds = %51, %45
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #3
  %53 = load i32, ptr %24, align 4, !tbaa !9
  %54 = add nsw i32 %53, 1
  store i32 %54, ptr %25, align 4, !tbaa !9
  %55 = load i32, ptr %25, align 4, !tbaa !9
  %56 = call noundef i32 @_ZN8GPolygon4SizeEv(ptr noundef nonnull align 8 dereferenceable(808) @_ZN13PolygonEngine3_p1E)
  %57 = icmp eq i32 %55, %56
  br i1 %57, label %58, label %59

58:                                               ; preds = %52
  store i32 0, ptr %25, align 4, !tbaa !9
  br label %59

59:                                               ; preds = %58, %52
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #3
  %60 = load i32, ptr %5, align 4, !tbaa !9
  %61 = call noundef ptr @_ZN8GPolygonixEi(ptr noundef nonnull align 8 dereferenceable(808) @_ZN13PolygonEngine3_p1E, i32 noundef %60)
  %62 = getelementptr inbounds %class.GVertex, ptr %61, i32 0, i32 1
  %63 = load i32, ptr %62, align 4, !tbaa !13
  %64 = load i32, ptr %24, align 4, !tbaa !9
  %65 = call noundef ptr @_ZN8GPolygonixEi(ptr noundef nonnull align 8 dereferenceable(808) @_ZN13PolygonEngine3_p1E, i32 noundef %64)
  %66 = getelementptr inbounds %class.GVertex, ptr %65, i32 0, i32 1
  %67 = load i32, ptr %66, align 4, !tbaa !13
  %68 = sub nsw i32 %63, %67
  store i32 %68, ptr %26, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #3
  %69 = load i32, ptr %5, align 4, !tbaa !9
  %70 = call noundef ptr @_ZN8GPolygonixEi(ptr noundef nonnull align 8 dereferenceable(808) @_ZN13PolygonEngine3_p1E, i32 noundef %69)
  %71 = getelementptr inbounds %class.GVertex, ptr %70, i32 0, i32 2
  %72 = load i32, ptr %71, align 4, !tbaa !17
  %73 = load i32, ptr %24, align 4, !tbaa !9
  %74 = call noundef ptr @_ZN8GPolygonixEi(ptr noundef nonnull align 8 dereferenceable(808) @_ZN13PolygonEngine3_p1E, i32 noundef %73)
  %75 = getelementptr inbounds %class.GVertex, ptr %74, i32 0, i32 2
  %76 = load i32, ptr %75, align 4, !tbaa !17
  %77 = sub nsw i32 %72, %76
  store i32 %77, ptr %27, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %28) #3
  %78 = load i32, ptr %25, align 4, !tbaa !9
  %79 = call noundef ptr @_ZN8GPolygonixEi(ptr noundef nonnull align 8 dereferenceable(808) @_ZN13PolygonEngine3_p1E, i32 noundef %78)
  %80 = getelementptr inbounds %class.GVertex, ptr %79, i32 0, i32 1
  %81 = load i32, ptr %80, align 4, !tbaa !13
  %82 = load i32, ptr %24, align 4, !tbaa !9
  %83 = call noundef ptr @_ZN8GPolygonixEi(ptr noundef nonnull align 8 dereferenceable(808) @_ZN13PolygonEngine3_p1E, i32 noundef %82)
  %84 = getelementptr inbounds %class.GVertex, ptr %83, i32 0, i32 1
  %85 = load i32, ptr %84, align 4, !tbaa !13
  %86 = sub nsw i32 %81, %85
  store i32 %86, ptr %28, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %29) #3
  %87 = load i32, ptr %25, align 4, !tbaa !9
  %88 = call noundef ptr @_ZN8GPolygonixEi(ptr noundef nonnull align 8 dereferenceable(808) @_ZN13PolygonEngine3_p1E, i32 noundef %87)
  %89 = getelementptr inbounds %class.GVertex, ptr %88, i32 0, i32 2
  %90 = load i32, ptr %89, align 4, !tbaa !17
  %91 = load i32, ptr %24, align 4, !tbaa !9
  %92 = call noundef ptr @_ZN8GPolygonixEi(ptr noundef nonnull align 8 dereferenceable(808) @_ZN13PolygonEngine3_p1E, i32 noundef %91)
  %93 = getelementptr inbounds %class.GVertex, ptr %92, i32 0, i32 2
  %94 = load i32, ptr %93, align 4, !tbaa !17
  %95 = sub nsw i32 %90, %94
  store i32 %95, ptr %29, align 4, !tbaa !9
  %96 = load i32, ptr %26, align 4, !tbaa !9
  %97 = load i32, ptr %29, align 4, !tbaa !9
  %98 = mul nsw i32 %96, %97
  %99 = load i32, ptr %28, align 4, !tbaa !9
  %100 = load i32, ptr %27, align 4, !tbaa !9
  %101 = mul nsw i32 %99, %100
  %102 = sub nsw i32 %98, %101
  %103 = load i32, ptr %10, align 4, !tbaa !9
  %104 = add nsw i32 %103, %102
  store i32 %104, ptr %10, align 4, !tbaa !9
  %105 = load i32, ptr %3, align 4, !tbaa !9
  %106 = load i32, ptr %5, align 4, !tbaa !9
  %107 = call noundef ptr @_ZN8GPolygonixEi(ptr noundef nonnull align 8 dereferenceable(808) @_ZN13PolygonEngine3_p1E, i32 noundef %106)
  %108 = getelementptr inbounds %class.GVertex, ptr %107, i32 0, i32 2
  %109 = load i32, ptr %108, align 4, !tbaa !17
  %110 = icmp slt i32 %105, %109
  br i1 %110, label %111, label %113

111:                                              ; preds = %59
  %112 = load i32, ptr %3, align 4, !tbaa !9
  br label %118

113:                                              ; preds = %59
  %114 = load i32, ptr %5, align 4, !tbaa !9
  %115 = call noundef ptr @_ZN8GPolygonixEi(ptr noundef nonnull align 8 dereferenceable(808) @_ZN13PolygonEngine3_p1E, i32 noundef %114)
  %116 = getelementptr inbounds %class.GVertex, ptr %115, i32 0, i32 2
  %117 = load i32, ptr %116, align 4, !tbaa !17
  br label %118

118:                                              ; preds = %113, %111
  %119 = phi i32 [ %112, %111 ], [ %117, %113 ]
  store i32 %119, ptr %3, align 4, !tbaa !9
  %120 = load i32, ptr %4, align 4, !tbaa !9
  %121 = load i32, ptr %5, align 4, !tbaa !9
  %122 = call noundef ptr @_ZN8GPolygonixEi(ptr noundef nonnull align 8 dereferenceable(808) @_ZN13PolygonEngine3_p1E, i32 noundef %121)
  %123 = getelementptr inbounds %class.GVertex, ptr %122, i32 0, i32 2
  %124 = load i32, ptr %123, align 4, !tbaa !17
  %125 = icmp sgt i32 %120, %124
  br i1 %125, label %126, label %128

126:                                              ; preds = %118
  %127 = load i32, ptr %4, align 4, !tbaa !9
  br label %133

128:                                              ; preds = %118
  %129 = load i32, ptr %5, align 4, !tbaa !9
  %130 = call noundef ptr @_ZN8GPolygonixEi(ptr noundef nonnull align 8 dereferenceable(808) @_ZN13PolygonEngine3_p1E, i32 noundef %129)
  %131 = getelementptr inbounds %class.GVertex, ptr %130, i32 0, i32 2
  %132 = load i32, ptr %131, align 4, !tbaa !17
  br label %133

133:                                              ; preds = %128, %126
  %134 = phi i32 [ %127, %126 ], [ %132, %128 ]
  store i32 %134, ptr %4, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %29) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %28) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #3
  br label %135

135:                                              ; preds = %133
  %136 = load i32, ptr %5, align 4, !tbaa !9
  %137 = add nsw i32 %136, 1
  store i32 %137, ptr %5, align 4, !tbaa !9
  br label %41, !llvm.loop !18

138:                                              ; preds = %41
  %139 = load i32, ptr %10, align 4, !tbaa !9
  %140 = icmp sgt i32 %139, 0
  %141 = zext i1 %140 to i32
  store i32 %141, ptr %10, align 4, !tbaa !9
  %142 = load i32, ptr %3, align 4, !tbaa !9
  %143 = load i32, ptr %4, align 4, !tbaa !9
  %144 = icmp eq i32 %142, %143
  br i1 %144, label %145, label %146

145:                                              ; preds = %138
  store i32 1, ptr %23, align 4
  br label %360

146:                                              ; preds = %138
  store i32 0, ptr %5, align 4, !tbaa !9
  br label %147

147:                                              ; preds = %302, %146
  %148 = load i32, ptr %5, align 4, !tbaa !9
  %149 = call noundef i32 @_ZN8GPolygon4SizeEv(ptr noundef nonnull align 8 dereferenceable(808) @_ZN13PolygonEngine3_p1E)
  %150 = icmp slt i32 %148, %149
  br i1 %150, label %151, label %305

151:                                              ; preds = %147
  %152 = load i32, ptr %5, align 4, !tbaa !9
  %153 = add nsw i32 %152, 1
  store i32 %153, ptr %6, align 4, !tbaa !9
  %154 = load i32, ptr %6, align 4, !tbaa !9
  %155 = call noundef i32 @_ZN8GPolygon4SizeEv(ptr noundef nonnull align 8 dereferenceable(808) @_ZN13PolygonEngine3_p1E)
  %156 = icmp eq i32 %154, %155
  br i1 %156, label %157, label %158

157:                                              ; preds = %151
  store i32 0, ptr %6, align 4, !tbaa !9
  br label %158

158:                                              ; preds = %157, %151
  %159 = load i32, ptr %5, align 4, !tbaa !9
  %160 = call noundef ptr @_ZN8GPolygonixEi(ptr noundef nonnull align 8 dereferenceable(808) @_ZN13PolygonEngine3_p1E, i32 noundef %159)
  %161 = getelementptr inbounds %class.GVertex, ptr %160, i32 0, i32 2
  %162 = load i32, ptr %161, align 4, !tbaa !17
  %163 = load i32, ptr %6, align 4, !tbaa !9
  %164 = call noundef ptr @_ZN8GPolygonixEi(ptr noundef nonnull align 8 dereferenceable(808) @_ZN13PolygonEngine3_p1E, i32 noundef %163)
  %165 = getelementptr inbounds %class.GVertex, ptr %164, i32 0, i32 2
  %166 = load i32, ptr %165, align 4, !tbaa !17
  %167 = icmp eq i32 %162, %166
  br i1 %167, label %168, label %169

168:                                              ; preds = %158
  br label %302

169:                                              ; preds = %158
  %170 = load i32, ptr %5, align 4, !tbaa !9
  %171 = call noundef ptr @_ZN8GPolygonixEi(ptr noundef nonnull align 8 dereferenceable(808) @_ZN13PolygonEngine3_p1E, i32 noundef %170)
  %172 = getelementptr inbounds %class.GVertex, ptr %171, i32 0, i32 2
  %173 = load i32, ptr %172, align 4, !tbaa !17
  store i32 %173, ptr %13, align 4, !tbaa !9
  %174 = load i32, ptr %6, align 4, !tbaa !9
  %175 = call noundef ptr @_ZN8GPolygonixEi(ptr noundef nonnull align 8 dereferenceable(808) @_ZN13PolygonEngine3_p1E, i32 noundef %174)
  %176 = getelementptr inbounds %class.GVertex, ptr %175, i32 0, i32 2
  %177 = load i32, ptr %176, align 4, !tbaa !17
  store i32 %177, ptr %14, align 4, !tbaa !9
  %178 = load i32, ptr %14, align 4, !tbaa !9
  %179 = load i32, ptr %13, align 4, !tbaa !9
  %180 = sub nsw i32 %178, %179
  store i32 %180, ptr %15, align 4, !tbaa !9
  %181 = load i32, ptr %15, align 4, !tbaa !9
  %182 = icmp sgt i32 %181, 0
  br i1 %182, label %183, label %184

183:                                              ; preds = %169
  br label %189

184:                                              ; preds = %169
  %185 = load i32, ptr %15, align 4, !tbaa !9
  %186 = icmp ne i32 %185, 0
  %187 = zext i1 %186 to i64
  %188 = select i1 %186, i32 -1, i32 0
  br label %189

189:                                              ; preds = %184, %183
  %190 = phi i32 [ 1, %183 ], [ %188, %184 ]
  store i32 %190, ptr %16, align 4, !tbaa !9
  %191 = load i32, ptr %16, align 4, !tbaa !9
  %192 = load i32, ptr %15, align 4, !tbaa !9
  %193 = mul nsw i32 %192, %191
  store i32 %193, ptr %15, align 4, !tbaa !9
  %194 = load i32, ptr %13, align 4, !tbaa !9
  store i32 %194, ptr %12, align 4, !tbaa !9
  %195 = load i32, ptr %5, align 4, !tbaa !9
  %196 = call noundef ptr @_ZN8GPolygonixEi(ptr noundef nonnull align 8 dereferenceable(808) @_ZN13PolygonEngine3_p1E, i32 noundef %195)
  %197 = getelementptr inbounds %class.GVertex, ptr %196, i32 0, i32 1
  %198 = load i32, ptr %197, align 4, !tbaa !13
  store i32 %198, ptr %18, align 4, !tbaa !9
  %199 = load i32, ptr %6, align 4, !tbaa !9
  %200 = call noundef ptr @_ZN8GPolygonixEi(ptr noundef nonnull align 8 dereferenceable(808) @_ZN13PolygonEngine3_p1E, i32 noundef %199)
  %201 = getelementptr inbounds %class.GVertex, ptr %200, i32 0, i32 1
  %202 = load i32, ptr %201, align 4, !tbaa !13
  store i32 %202, ptr %19, align 4, !tbaa !9
  %203 = load i32, ptr %19, align 4, !tbaa !9
  %204 = load i32, ptr %18, align 4, !tbaa !9
  %205 = sub nsw i32 %203, %204
  store i32 %205, ptr %20, align 4, !tbaa !9
  %206 = load i32, ptr %20, align 4, !tbaa !9
  %207 = icmp sgt i32 %206, 0
  br i1 %207, label %208, label %209

208:                                              ; preds = %189
  br label %214

209:                                              ; preds = %189
  %210 = load i32, ptr %20, align 4, !tbaa !9
  %211 = icmp ne i32 %210, 0
  %212 = zext i1 %211 to i64
  %213 = select i1 %211, i32 -1, i32 0
  br label %214

214:                                              ; preds = %209, %208
  %215 = phi i32 [ 1, %208 ], [ %213, %209 ]
  store i32 %215, ptr %21, align 4, !tbaa !9
  %216 = load i32, ptr %21, align 4, !tbaa !9
  %217 = load i32, ptr %20, align 4, !tbaa !9
  %218 = mul nsw i32 %217, %216
  store i32 %218, ptr %20, align 4, !tbaa !9
  %219 = load i32, ptr %20, align 4, !tbaa !9
  %220 = shl i32 %219, 1
  %221 = load i32, ptr %15, align 4, !tbaa !9
  %222 = sub nsw i32 %220, %221
  store i32 %222, ptr %22, align 4, !tbaa !9
  %223 = load i32, ptr %18, align 4, !tbaa !9
  store i32 %223, ptr %17, align 4, !tbaa !9
  %224 = load i32, ptr %10, align 4, !tbaa !9
  %225 = load i32, ptr %14, align 4, !tbaa !9
  %226 = load i32, ptr %13, align 4, !tbaa !9
  %227 = icmp sgt i32 %225, %226
  %228 = zext i1 %227 to i32
  %229 = xor i32 %224, %228
  %230 = icmp ne i32 %229, 0
  br i1 %230, label %231, label %266

231:                                              ; preds = %214
  store i32 0, ptr %7, align 4, !tbaa !9
  br label %232

232:                                              ; preds = %262, %231
  %233 = load i32, ptr %7, align 4, !tbaa !9
  %234 = load i32, ptr %15, align 4, !tbaa !9
  %235 = icmp sle i32 %233, %234
  br i1 %235, label %236, label %265

236:                                              ; preds = %232
  %237 = load i32, ptr %17, align 4, !tbaa !9
  %238 = load i32, ptr %12, align 4, !tbaa !9
  %239 = sext i32 %238 to i64
  %240 = getelementptr inbounds [1024 x %class.Mug], ptr @_ZN13PolygonEngine4_mugE, i64 0, i64 %239
  %241 = getelementptr inbounds %class.Mug, ptr %240, i32 0, i32 1
  %242 = getelementptr inbounds %class.GVertex, ptr %241, i32 0, i32 1
  store i32 %237, ptr %242, align 4, !tbaa !20
  %243 = load i32, ptr %16, align 4, !tbaa !9
  %244 = load i32, ptr %12, align 4, !tbaa !9
  %245 = add nsw i32 %244, %243
  store i32 %245, ptr %12, align 4, !tbaa !9
  br label %246

246:                                              ; preds = %249, %236
  %247 = load i32, ptr %22, align 4, !tbaa !9
  %248 = icmp sge i32 %247, 0
  br i1 %248, label %249, label %257

249:                                              ; preds = %246
  %250 = load i32, ptr %21, align 4, !tbaa !9
  %251 = load i32, ptr %17, align 4, !tbaa !9
  %252 = add nsw i32 %251, %250
  store i32 %252, ptr %17, align 4, !tbaa !9
  %253 = load i32, ptr %15, align 4, !tbaa !9
  %254 = shl i32 %253, 1
  %255 = load i32, ptr %22, align 4, !tbaa !9
  %256 = sub nsw i32 %255, %254
  store i32 %256, ptr %22, align 4, !tbaa !9
  br label %246, !llvm.loop !22

257:                                              ; preds = %246
  %258 = load i32, ptr %20, align 4, !tbaa !9
  %259 = shl i32 %258, 1
  %260 = load i32, ptr %22, align 4, !tbaa !9
  %261 = add nsw i32 %260, %259
  store i32 %261, ptr %22, align 4, !tbaa !9
  br label %262

262:                                              ; preds = %257
  %263 = load i32, ptr %7, align 4, !tbaa !9
  %264 = add nsw i32 %263, 1
  store i32 %264, ptr %7, align 4, !tbaa !9
  br label %232, !llvm.loop !23

265:                                              ; preds = %232
  br label %301

266:                                              ; preds = %214
  store i32 0, ptr %7, align 4, !tbaa !9
  br label %267

267:                                              ; preds = %297, %266
  %268 = load i32, ptr %7, align 4, !tbaa !9
  %269 = load i32, ptr %15, align 4, !tbaa !9
  %270 = icmp sle i32 %268, %269
  br i1 %270, label %271, label %300

271:                                              ; preds = %267
  %272 = load i32, ptr %17, align 4, !tbaa !9
  %273 = load i32, ptr %12, align 4, !tbaa !9
  %274 = sext i32 %273 to i64
  %275 = getelementptr inbounds [1024 x %class.Mug], ptr @_ZN13PolygonEngine4_mugE, i64 0, i64 %274
  %276 = getelementptr inbounds %class.Mug, ptr %275, i32 0, i32 0
  %277 = getelementptr inbounds %class.GVertex, ptr %276, i32 0, i32 1
  store i32 %272, ptr %277, align 4, !tbaa !24
  %278 = load i32, ptr %16, align 4, !tbaa !9
  %279 = load i32, ptr %12, align 4, !tbaa !9
  %280 = add nsw i32 %279, %278
  store i32 %280, ptr %12, align 4, !tbaa !9
  br label %281

281:                                              ; preds = %284, %271
  %282 = load i32, ptr %22, align 4, !tbaa !9
  %283 = icmp sge i32 %282, 0
  br i1 %283, label %284, label %292

284:                                              ; preds = %281
  %285 = load i32, ptr %21, align 4, !tbaa !9
  %286 = load i32, ptr %17, align 4, !tbaa !9
  %287 = add nsw i32 %286, %285
  store i32 %287, ptr %17, align 4, !tbaa !9
  %288 = load i32, ptr %15, align 4, !tbaa !9
  %289 = shl i32 %288, 1
  %290 = load i32, ptr %22, align 4, !tbaa !9
  %291 = sub nsw i32 %290, %289
  store i32 %291, ptr %22, align 4, !tbaa !9
  br label %281, !llvm.loop !25

292:                                              ; preds = %281
  %293 = load i32, ptr %20, align 4, !tbaa !9
  %294 = shl i32 %293, 1
  %295 = load i32, ptr %22, align 4, !tbaa !9
  %296 = add nsw i32 %295, %294
  store i32 %296, ptr %22, align 4, !tbaa !9
  br label %297

297:                                              ; preds = %292
  %298 = load i32, ptr %7, align 4, !tbaa !9
  %299 = add nsw i32 %298, 1
  store i32 %299, ptr %7, align 4, !tbaa !9
  br label %267, !llvm.loop !26

300:                                              ; preds = %267
  br label %301

301:                                              ; preds = %300, %265
  br label %302

302:                                              ; preds = %301, %168
  %303 = load i32, ptr %5, align 4, !tbaa !9
  %304 = add nsw i32 %303, 1
  store i32 %304, ptr %5, align 4, !tbaa !9
  br label %147, !llvm.loop !27

305:                                              ; preds = %147
  %306 = load ptr, ptr @_ZN16GraphicComponent10_graph_memE, align 8, !tbaa !5
  %307 = load i32, ptr %3, align 4, !tbaa !9
  %308 = load i32, ptr @_ZN16GraphicComponent15_bytes_per_lineE, align 4, !tbaa !9
  %309 = mul nsw i32 %307, %308
  %310 = sext i32 %309 to i64
  %311 = getelementptr inbounds i8, ptr %306, i64 %310
  store ptr %311, ptr %9, align 8, !tbaa !5
  %312 = load i32, ptr %3, align 4, !tbaa !9
  store i32 %312, ptr %12, align 4, !tbaa !9
  br label %313

313:                                              ; preds = %356, %305
  %314 = load i32, ptr %12, align 4, !tbaa !9
  %315 = load i32, ptr %4, align 4, !tbaa !9
  %316 = icmp sle i32 %314, %315
  br i1 %316, label %317, label %359

317:                                              ; preds = %313
  %318 = load i32, ptr %12, align 4, !tbaa !9
  %319 = sext i32 %318 to i64
  %320 = getelementptr inbounds [1024 x %class.Mug], ptr @_ZN13PolygonEngine4_mugE, i64 0, i64 %319
  %321 = getelementptr inbounds %class.Mug, ptr %320, i32 0, i32 0
  %322 = getelementptr inbounds %class.GVertex, ptr %321, i32 0, i32 1
  %323 = load i32, ptr %322, align 4, !tbaa !24
  store i32 %323, ptr %18, align 4, !tbaa !9
  %324 = load i32, ptr %12, align 4, !tbaa !9
  %325 = sext i32 %324 to i64
  %326 = getelementptr inbounds [1024 x %class.Mug], ptr @_ZN13PolygonEngine4_mugE, i64 0, i64 %325
  %327 = getelementptr inbounds %class.Mug, ptr %326, i32 0, i32 1
  %328 = getelementptr inbounds %class.GVertex, ptr %327, i32 0, i32 1
  %329 = load i32, ptr %328, align 4, !tbaa !20
  store i32 %329, ptr %19, align 4, !tbaa !9
  %330 = load i32, ptr %19, align 4, !tbaa !9
  %331 = load i32, ptr %18, align 4, !tbaa !9
  %332 = sub nsw i32 %330, %331
  %333 = add nsw i32 %332, 1
  store i32 %333, ptr %20, align 4, !tbaa !9
  %334 = load i32, ptr %18, align 4, !tbaa !9
  store i32 %334, ptr %17, align 4, !tbaa !9
  %335 = load ptr, ptr %9, align 8, !tbaa !5
  %336 = load i32, ptr %18, align 4, !tbaa !9
  %337 = sext i32 %336 to i64
  %338 = getelementptr inbounds i32, ptr %335, i64 %337
  store ptr %338, ptr %8, align 8, !tbaa !5
  %339 = load i32, ptr %18, align 4, !tbaa !9
  store i32 %339, ptr %17, align 4, !tbaa !9
  br label %340

340:                                              ; preds = %345, %317
  %341 = load i32, ptr %17, align 4, !tbaa !9
  %342 = load i32, ptr %19, align 4, !tbaa !9
  %343 = icmp sle i32 %341, %342
  br i1 %343, label %344, label %351

344:                                              ; preds = %340
  br label %345

345:                                              ; preds = %344
  %346 = load i32, ptr %17, align 4, !tbaa !9
  %347 = add nsw i32 %346, 1
  store i32 %347, ptr %17, align 4, !tbaa !9
  %348 = load i32, ptr %11, align 4, !tbaa !9
  %349 = load ptr, ptr %8, align 8, !tbaa !5
  %350 = getelementptr inbounds i32, ptr %349, i32 1
  store ptr %350, ptr %8, align 8, !tbaa !5
  store i32 %348, ptr %349, align 4, !tbaa !9
  br label %340, !llvm.loop !28

351:                                              ; preds = %340
  %352 = load ptr, ptr %9, align 8, !tbaa !5
  %353 = load i32, ptr @_ZN16GraphicComponent15_bytes_per_lineE, align 4, !tbaa !9
  %354 = sext i32 %353 to i64
  %355 = getelementptr inbounds i8, ptr %352, i64 %354
  store ptr %355, ptr %9, align 8, !tbaa !5
  br label %356

356:                                              ; preds = %351
  %357 = load i32, ptr %12, align 4, !tbaa !9
  %358 = add nsw i32 %357, 1
  store i32 %358, ptr %12, align 4, !tbaa !9
  br label %313, !llvm.loop !29

359:                                              ; preds = %313
  store i32 0, ptr %23, align 4
  br label %360

360:                                              ; preds = %359, %145, %39
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #3
  %361 = load i32, ptr %23, align 4
  switch i32 %361, label %363 [
    i32 0, label %362
    i32 1, label %362
  ]

362:                                              ; preds = %360, %360
  ret void

363:                                              ; preds = %360
  unreachable
}

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZN8GPolygonixEi(ptr noundef nonnull align 8 dereferenceable(808), i32 noundef) #2 align 2

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !10, i64 4}
!12 = !{!"_ZTS17GVertexAttributes", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !10, i64 16, !10, i64 20, !10, i64 24, !10, i64 28, !10, i64 32}
!13 = !{!14, !10, i64 36}
!14 = !{!"_ZTS7GVertex", !12, i64 0, !10, i64 36, !10, i64 40, !15, i64 44, !15, i64 60, !15, i64 76, !15, i64 92, !15, i64 108, !16, i64 124}
!15 = !{!"_ZTS7GVector", !7, i64 0}
!16 = !{!"_ZTS5Flags", !10, i64 0}
!17 = !{!14, !10, i64 40}
!18 = distinct !{!18, !19}
!19 = !{!"llvm.loop.mustprogress"}
!20 = !{!21, !10, i64 164}
!21 = !{!"_ZTS3Mug", !14, i64 0, !14, i64 128}
!22 = distinct !{!22, !19}
!23 = distinct !{!23, !19}
!24 = !{!21, !10, i64 36}
!25 = distinct !{!25, !19}
!26 = distinct !{!26, !19}
!27 = distinct !{!27, !19}
!28 = distinct !{!28, !19}
!29 = distinct !{!29, !19}


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

%class.GPolygon = type { i32, [100 x ptr] }
%class.Mug = type { %class.GVertex, %class.GVertex }
%class.GVertex = type { %class.GVertexAttributes, i32, i32, %class.GVector, %class.GVector, %class.GVector, %class.GVector, %class.GVector, %class.Flags }
%class.GVertexAttributes = type { i32, i32, i32, i32, i32, i32, i32, i32, i32 }
%class.GVector = type { [4 x %class.GCoord] }
%class.GCoord = type { float }
%class.Flags = type { i32 }

@_ZN13PolygonEngine3_p1E = external global %class.GPolygon, align 8
@_ZN13PolygonEngine4_mugE = external local_unnamed_addr global [1024 x %class.Mug], align 16
@_ZN16GraphicComponent10_graph_memE = external local_unnamed_addr global ptr, align 8
@_ZN16GraphicComponent15_bytes_per_lineE = external local_unnamed_addr global i32, align 4
@_ZN16GraphicComponent13_truecolormapE = external local_unnamed_addr global [256 x i32], align 16

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_ZN17PolygonEngine_32x10FillPoly_cEP17GVertexAttributes(ptr nocapture noundef readonly %0) local_unnamed_addr #0 align 2 {
  %2 = getelementptr inbounds i8, ptr %0, i64 4
  %3 = load i32, ptr %2, align 4, !tbaa !5
  %4 = ashr i32 %3, 4
  %5 = sext i32 %4 to i64
  %6 = getelementptr inbounds [256 x i32], ptr @_ZN16GraphicComponent13_truecolormapE, i64 0, i64 %5
  %7 = load i32, ptr %6, align 4, !tbaa !10
  %8 = tail call noundef i32 @_ZN8GPolygon4SizeEv(ptr noundef nonnull align 8 dereferenceable(808) @_ZN13PolygonEngine3_p1E)
  %9 = icmp slt i32 %8, 2
  br i1 %9, label %.loopexit, label %.preheader144

.preheader144:                                    ; preds = %1
  %10 = tail call noundef i32 @_ZN8GPolygon4SizeEv(ptr noundef nonnull align 8 dereferenceable(808) @_ZN13PolygonEngine3_p1E)
  %11 = icmp sgt i32 %10, 0
  br i1 %11, label %.lr.ph, label %.preheader143

.lr.ph:                                           ; preds = %.preheader144, %66
  %.0148 = phi i32 [ %57, %66 ], [ 1000, %.preheader144 ]
  %.0106147 = phi i32 [ %67, %66 ], [ -1, %.preheader144 ]
  %.0107146 = phi i32 [ %12, %66 ], [ 0, %.preheader144 ]
  %.0121145 = phi i32 [ %47, %66 ], [ 0, %.preheader144 ]
  %12 = add nuw nsw i32 %.0107146, 1
  %13 = tail call noundef i32 @_ZN8GPolygon4SizeEv(ptr noundef nonnull align 8 dereferenceable(808) @_ZN13PolygonEngine3_p1E)
  %14 = icmp eq i32 %12, %13
  %spec.select = select i1 %14, i32 0, i32 %12
  %15 = add nuw nsw i32 %spec.select, 1
  %16 = tail call noundef i32 @_ZN8GPolygon4SizeEv(ptr noundef nonnull align 8 dereferenceable(808) @_ZN13PolygonEngine3_p1E)
  %17 = icmp eq i32 %15, %16
  %.0109 = select i1 %17, i32 0, i32 %15
  %18 = tail call noundef ptr @_ZN8GPolygonixEi(ptr noundef nonnull align 8 dereferenceable(808) @_ZN13PolygonEngine3_p1E, i32 noundef %.0107146)
  %19 = getelementptr inbounds i8, ptr %18, i64 36
  %20 = load i32, ptr %19, align 4, !tbaa !11
  %21 = tail call noundef ptr @_ZN8GPolygonixEi(ptr noundef nonnull align 8 dereferenceable(808) @_ZN13PolygonEngine3_p1E, i32 noundef %spec.select)
  %22 = getelementptr inbounds i8, ptr %21, i64 36
  %23 = load i32, ptr %22, align 4, !tbaa !11
  %24 = sub nsw i32 %20, %23
  %25 = tail call noundef ptr @_ZN8GPolygonixEi(ptr noundef nonnull align 8 dereferenceable(808) @_ZN13PolygonEngine3_p1E, i32 noundef %.0107146)
  %26 = getelementptr inbounds i8, ptr %25, i64 40
  %27 = load i32, ptr %26, align 4, !tbaa !15
  %28 = tail call noundef ptr @_ZN8GPolygonixEi(ptr noundef nonnull align 8 dereferenceable(808) @_ZN13PolygonEngine3_p1E, i32 noundef %spec.select)
  %29 = getelementptr inbounds i8, ptr %28, i64 40
  %30 = load i32, ptr %29, align 4, !tbaa !15
  %.neg = sub i32 %30, %27
  %31 = tail call noundef ptr @_ZN8GPolygonixEi(ptr noundef nonnull align 8 dereferenceable(808) @_ZN13PolygonEngine3_p1E, i32 noundef %.0109)
  %32 = getelementptr inbounds i8, ptr %31, i64 36
  %33 = load i32, ptr %32, align 4, !tbaa !11
  %34 = tail call noundef ptr @_ZN8GPolygonixEi(ptr noundef nonnull align 8 dereferenceable(808) @_ZN13PolygonEngine3_p1E, i32 noundef %spec.select)
  %35 = getelementptr inbounds i8, ptr %34, i64 36
  %36 = load i32, ptr %35, align 4, !tbaa !11
  %37 = sub nsw i32 %33, %36
  %38 = tail call noundef ptr @_ZN8GPolygonixEi(ptr noundef nonnull align 8 dereferenceable(808) @_ZN13PolygonEngine3_p1E, i32 noundef %.0109)
  %39 = getelementptr inbounds i8, ptr %38, i64 40
  %40 = load i32, ptr %39, align 4, !tbaa !15
  %41 = tail call noundef ptr @_ZN8GPolygonixEi(ptr noundef nonnull align 8 dereferenceable(808) @_ZN13PolygonEngine3_p1E, i32 noundef %spec.select)
  %42 = getelementptr inbounds i8, ptr %41, i64 40
  %43 = load i32, ptr %42, align 4, !tbaa !15
  %44 = sub nsw i32 %40, %43
  %45 = mul nsw i32 %44, %24
  %.neg137 = mul i32 %37, %.neg
  %46 = add i32 %.neg137, %.0121145
  %47 = add i32 %46, %45
  %48 = tail call noundef ptr @_ZN8GPolygonixEi(ptr noundef nonnull align 8 dereferenceable(808) @_ZN13PolygonEngine3_p1E, i32 noundef %.0107146)
  %49 = getelementptr inbounds i8, ptr %48, i64 40
  %50 = load i32, ptr %49, align 4, !tbaa !15
  %51 = icmp slt i32 %.0148, %50
  br i1 %51, label %56, label %52

52:                                               ; preds = %.lr.ph
  %53 = tail call noundef ptr @_ZN8GPolygonixEi(ptr noundef nonnull align 8 dereferenceable(808) @_ZN13PolygonEngine3_p1E, i32 noundef %.0107146)
  %54 = getelementptr inbounds i8, ptr %53, i64 40
  %55 = load i32, ptr %54, align 4, !tbaa !15
  br label %56

56:                                               ; preds = %.lr.ph, %52
  %57 = phi i32 [ %55, %52 ], [ %.0148, %.lr.ph ]
  %58 = tail call noundef ptr @_ZN8GPolygonixEi(ptr noundef nonnull align 8 dereferenceable(808) @_ZN13PolygonEngine3_p1E, i32 noundef %.0107146)
  %59 = getelementptr inbounds i8, ptr %58, i64 40
  %60 = load i32, ptr %59, align 4, !tbaa !15
  %61 = icmp sgt i32 %.0106147, %60
  br i1 %61, label %66, label %62

62:                                               ; preds = %56
  %63 = tail call noundef ptr @_ZN8GPolygonixEi(ptr noundef nonnull align 8 dereferenceable(808) @_ZN13PolygonEngine3_p1E, i32 noundef %.0107146)
  %64 = getelementptr inbounds i8, ptr %63, i64 40
  %65 = load i32, ptr %64, align 4, !tbaa !15
  br label %66

66:                                               ; preds = %56, %62
  %67 = phi i32 [ %65, %62 ], [ %.0106147, %56 ]
  %68 = tail call noundef i32 @_ZN8GPolygon4SizeEv(ptr noundef nonnull align 8 dereferenceable(808) @_ZN13PolygonEngine3_p1E)
  %69 = icmp slt i32 %12, %68
  br i1 %69, label %.lr.ph, label %._crit_edge, !llvm.loop !16

._crit_edge:                                      ; preds = %66
  %70 = icmp sgt i32 %47, 0
  %71 = icmp eq i32 %57, %67
  br i1 %71, label %.loopexit, label %.preheader143

.preheader143:                                    ; preds = %.preheader144, %._crit_edge
  %.0.lcssa213 = phi i32 [ %57, %._crit_edge ], [ 1000, %.preheader144 ]
  %.0106.lcssa212 = phi i32 [ %67, %._crit_edge ], [ -1, %.preheader144 ]
  %.0121.lcssa211 = phi i1 [ %70, %._crit_edge ], [ false, %.preheader144 ]
  %72 = tail call noundef i32 @_ZN8GPolygon4SizeEv(ptr noundef nonnull align 8 dereferenceable(808) @_ZN13PolygonEngine3_p1E)
  %73 = icmp sgt i32 %72, 0
  br i1 %73, label %.lr.ph178, label %._crit_edge179

.lr.ph178:                                        ; preds = %.preheader143, %.loopexit140
  %.1177 = phi i32 [ %74, %.loopexit140 ], [ 0, %.preheader143 ]
  %74 = add nuw nsw i32 %.1177, 1
  %75 = tail call noundef i32 @_ZN8GPolygon4SizeEv(ptr noundef nonnull align 8 dereferenceable(808) @_ZN13PolygonEngine3_p1E)
  %76 = icmp eq i32 %74, %75
  %spec.select138 = select i1 %76, i32 0, i32 %74
  %77 = tail call noundef ptr @_ZN8GPolygonixEi(ptr noundef nonnull align 8 dereferenceable(808) @_ZN13PolygonEngine3_p1E, i32 noundef %.1177)
  %78 = getelementptr inbounds i8, ptr %77, i64 40
  %79 = load i32, ptr %78, align 4, !tbaa !15
  %80 = tail call noundef ptr @_ZN8GPolygonixEi(ptr noundef nonnull align 8 dereferenceable(808) @_ZN13PolygonEngine3_p1E, i32 noundef %spec.select138)
  %81 = getelementptr inbounds i8, ptr %80, i64 40
  %82 = load i32, ptr %81, align 4, !tbaa !15
  %83 = icmp eq i32 %79, %82
  br i1 %83, label %.loopexit140, label %84

84:                                               ; preds = %.lr.ph178
  %85 = tail call noundef ptr @_ZN8GPolygonixEi(ptr noundef nonnull align 8 dereferenceable(808) @_ZN13PolygonEngine3_p1E, i32 noundef %.1177)
  %86 = getelementptr inbounds i8, ptr %85, i64 40
  %87 = load i32, ptr %86, align 4, !tbaa !15
  %88 = tail call noundef ptr @_ZN8GPolygonixEi(ptr noundef nonnull align 8 dereferenceable(808) @_ZN13PolygonEngine3_p1E, i32 noundef %spec.select138)
  %89 = getelementptr inbounds i8, ptr %88, i64 40
  %90 = load i32, ptr %89, align 4, !tbaa !15
  %91 = sub i32 %90, %87
  %.not133 = icmp ne i32 %90, %87
  %92 = sext i1 %.not133 to i32
  %.inv = icmp slt i32 %91, 1
  %93 = select i1 %.inv, i32 %92, i32 1
  %94 = mul i32 %93, %91
  %95 = tail call noundef ptr @_ZN8GPolygonixEi(ptr noundef nonnull align 8 dereferenceable(808) @_ZN13PolygonEngine3_p1E, i32 noundef %.1177)
  %96 = getelementptr inbounds i8, ptr %95, i64 36
  %97 = load i32, ptr %96, align 4, !tbaa !11
  %98 = tail call noundef ptr @_ZN8GPolygonixEi(ptr noundef nonnull align 8 dereferenceable(808) @_ZN13PolygonEngine3_p1E, i32 noundef %spec.select138)
  %99 = getelementptr inbounds i8, ptr %98, i64 36
  %100 = load i32, ptr %99, align 4, !tbaa !11
  %101 = sub nsw i32 %100, %97
  %.not134 = icmp ne i32 %100, %97
  %102 = sext i1 %.not134 to i32
  %.inv139 = icmp slt i32 %101, 1
  %103 = select i1 %.inv139, i32 %102, i32 1
  %104 = shl i32 %101, 1
  %105 = mul i32 %104, %103
  %106 = sub nsw i32 %105, %94
  %107 = icmp sgt i32 %90, %87
  %108 = xor i1 %.0121.lcssa211, %107
  %.not136171 = icmp slt i32 %94, 0
  br i1 %108, label %.preheader, label %.preheader141

.preheader141:                                    ; preds = %84
  br i1 %.not136171, label %.loopexit140, label %.lr.ph163

.lr.ph163:                                        ; preds = %.preheader141
  %109 = shl nuw i32 %94, 1
  %110 = sext i32 %87 to i64
  %111 = sext i32 %93 to i64
  br label %123

.preheader:                                       ; preds = %84
  br i1 %.not136171, label %.loopexit140, label %.lr.ph176

.lr.ph176:                                        ; preds = %.preheader
  %112 = shl nuw i32 %94, 1
  %113 = sext i32 %87 to i64
  %114 = sext i32 %93 to i64
  br label %115

115:                                              ; preds = %.lr.ph176, %._crit_edge168
  %indvars.iv199 = phi i64 [ %113, %.lr.ph176 ], [ %indvars.iv.next200, %._crit_edge168 ]
  %.0111175 = phi i32 [ %106, %.lr.ph176 ], [ %121, %._crit_edge168 ]
  %.0113174 = phi i32 [ 0, %.lr.ph176 ], [ %122, %._crit_edge168 ]
  %.0115173 = phi i32 [ %97, %.lr.ph176 ], [ %.1116.lcssa, %._crit_edge168 ]
  %116 = getelementptr inbounds [1024 x %class.Mug], ptr @_ZN13PolygonEngine4_mugE, i64 0, i64 %indvars.iv199, i32 1, i32 1
  store i32 %.0115173, ptr %116, align 4, !tbaa !18
  %indvars.iv.next200 = add nsw i64 %indvars.iv199, %114
  %117 = icmp sgt i32 %.0111175, -1
  br i1 %117, label %.lr.ph167, label %._crit_edge168

.lr.ph167:                                        ; preds = %115, %.lr.ph167
  %.1112165 = phi i32 [ %119, %.lr.ph167 ], [ %.0111175, %115 ]
  %.1116164 = phi i32 [ %118, %.lr.ph167 ], [ %.0115173, %115 ]
  %118 = add nsw i32 %.1116164, %103
  %119 = sub nsw i32 %.1112165, %112
  %120 = icmp sgt i32 %119, -1
  br i1 %120, label %.lr.ph167, label %._crit_edge168, !llvm.loop !20

._crit_edge168:                                   ; preds = %.lr.ph167, %115
  %.1116.lcssa = phi i32 [ %.0115173, %115 ], [ %118, %.lr.ph167 ]
  %.1112.lcssa = phi i32 [ %.0111175, %115 ], [ %119, %.lr.ph167 ]
  %121 = add nsw i32 %.1112.lcssa, %105
  %122 = add nuw i32 %.0113174, 1
  %exitcond202.not = icmp eq i32 %.0113174, %94
  br i1 %exitcond202.not, label %.loopexit140, label %115, !llvm.loop !21

123:                                              ; preds = %.lr.ph163, %._crit_edge155
  %indvars.iv = phi i64 [ %110, %.lr.ph163 ], [ %indvars.iv.next, %._crit_edge155 ]
  %.2162 = phi i32 [ %106, %.lr.ph163 ], [ %129, %._crit_edge155 ]
  %.1114161 = phi i32 [ 0, %.lr.ph163 ], [ %130, %._crit_edge155 ]
  %.2117160 = phi i32 [ %97, %.lr.ph163 ], [ %.3118.lcssa, %._crit_edge155 ]
  %124 = getelementptr inbounds [1024 x %class.Mug], ptr @_ZN13PolygonEngine4_mugE, i64 0, i64 %indvars.iv, i32 0, i32 1
  store i32 %.2117160, ptr %124, align 4, !tbaa !22
  %indvars.iv.next = add nsw i64 %indvars.iv, %111
  %125 = icmp sgt i32 %.2162, -1
  br i1 %125, label %.lr.ph154, label %._crit_edge155

.lr.ph154:                                        ; preds = %123, %.lr.ph154
  %.3152 = phi i32 [ %127, %.lr.ph154 ], [ %.2162, %123 ]
  %.3118151 = phi i32 [ %126, %.lr.ph154 ], [ %.2117160, %123 ]
  %126 = add nsw i32 %.3118151, %103
  %127 = sub nsw i32 %.3152, %109
  %128 = icmp sgt i32 %127, -1
  br i1 %128, label %.lr.ph154, label %._crit_edge155, !llvm.loop !23

._crit_edge155:                                   ; preds = %.lr.ph154, %123
  %.3118.lcssa = phi i32 [ %.2117160, %123 ], [ %126, %.lr.ph154 ]
  %.3.lcssa = phi i32 [ %.2162, %123 ], [ %127, %.lr.ph154 ]
  %129 = add nsw i32 %.3.lcssa, %105
  %130 = add nuw i32 %.1114161, 1
  %exitcond.not = icmp eq i32 %.1114161, %94
  br i1 %exitcond.not, label %.loopexit140, label %123, !llvm.loop !24

.loopexit140:                                     ; preds = %._crit_edge155, %._crit_edge168, %.preheader141, %.preheader, %.lr.ph178
  %131 = tail call noundef i32 @_ZN8GPolygon4SizeEv(ptr noundef nonnull align 8 dereferenceable(808) @_ZN13PolygonEngine3_p1E)
  %132 = icmp slt i32 %74, %131
  br i1 %132, label %.lr.ph178, label %._crit_edge179, !llvm.loop !25

._crit_edge179:                                   ; preds = %.loopexit140, %.preheader143
  %.not186 = icmp sgt i32 %.0.lcssa213, %.0106.lcssa212
  br i1 %.not186, label %.loopexit, label %.lr.ph190.preheader

.lr.ph190.preheader:                              ; preds = %._crit_edge179
  %133 = load ptr, ptr @_ZN16GraphicComponent10_graph_memE, align 8, !tbaa !26
  %134 = load i32, ptr @_ZN16GraphicComponent15_bytes_per_lineE, align 4, !tbaa !10
  %135 = mul nsw i32 %134, %.0.lcssa213
  %136 = sext i32 %135 to i64
  %137 = getelementptr inbounds i8, ptr %133, i64 %136
  %138 = sext i32 %.0.lcssa213 to i64
  %139 = add i32 %.0106.lcssa212, 1
  %broadcast.splatinsert = insertelement <4 x i32> poison, i32 %7, i64 0
  %broadcast.splat = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
  br label %.lr.ph190

.lr.ph190:                                        ; preds = %.lr.ph190.preheader, %._crit_edge185
  %140 = phi i32 [ %134, %.lr.ph190.preheader ], [ %156, %._crit_edge185 ]
  %indvars.iv204 = phi i64 [ %138, %.lr.ph190.preheader ], [ %indvars.iv.next205, %._crit_edge185 ]
  %.0120188 = phi ptr [ %137, %.lr.ph190.preheader ], [ %158, %._crit_edge185 ]
  %141 = getelementptr inbounds [1024 x %class.Mug], ptr @_ZN13PolygonEngine4_mugE, i64 0, i64 %indvars.iv204
  %142 = getelementptr inbounds i8, ptr %141, i64 36
  %143 = load i32, ptr %142, align 4, !tbaa !22
  %144 = getelementptr inbounds i8, ptr %141, i64 164
  %145 = load i32, ptr %144, align 4, !tbaa !18
  %.not132180 = icmp sgt i32 %143, %145
  br i1 %.not132180, label %._crit_edge185, label %.lr.ph184.preheader

.lr.ph184.preheader:                              ; preds = %.lr.ph190
  %146 = sext i32 %143 to i64
  %147 = getelementptr inbounds i32, ptr %.0120188, i64 %146
  %148 = sub i32 %145, %143
  %149 = zext i32 %148 to i64
  %150 = add nuw nsw i64 %149, 1
  %min.iters.check = icmp ult i32 %148, 7
  br i1 %min.iters.check, label %.lr.ph184.preheader231, label %vector.ph

vector.ph:                                        ; preds = %.lr.ph184.preheader
  %n.vec = and i64 %150, 8589934584
  %.cast = trunc i64 %n.vec to i32
  %ind.end = add i32 %143, %.cast
  %151 = shl nuw nsw i64 %n.vec, 2
  %ind.end228 = getelementptr i8, ptr %147, i64 %151
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %offset.idx = shl i64 %index, 2
  %next.gep = getelementptr i8, ptr %147, i64 %offset.idx
  %152 = getelementptr i8, ptr %next.gep, i64 16
  store <4 x i32> %broadcast.splat, ptr %next.gep, align 4, !tbaa !10
  store <4 x i32> %broadcast.splat, ptr %152, align 4, !tbaa !10
  %index.next = add nuw i64 %index, 8
  %153 = icmp eq i64 %index.next, %n.vec
  br i1 %153, label %middle.block, label %vector.body, !llvm.loop !28

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %150, %n.vec
  br i1 %cmp.n, label %._crit_edge185.loopexit, label %.lr.ph184.preheader231

.lr.ph184.preheader231:                           ; preds = %middle.block, %.lr.ph184.preheader
  %.4182.ph = phi i32 [ %143, %.lr.ph184.preheader ], [ %ind.end, %middle.block ]
  %.0119181.ph = phi ptr [ %147, %.lr.ph184.preheader ], [ %ind.end228, %middle.block ]
  br label %.lr.ph184

.lr.ph184:                                        ; preds = %.lr.ph184.preheader231, %.lr.ph184
  %.4182 = phi i32 [ %154, %.lr.ph184 ], [ %.4182.ph, %.lr.ph184.preheader231 ]
  %.0119181 = phi ptr [ %155, %.lr.ph184 ], [ %.0119181.ph, %.lr.ph184.preheader231 ]
  %154 = add i32 %.4182, 1
  %155 = getelementptr inbounds i8, ptr %.0119181, i64 4
  store i32 %7, ptr %.0119181, align 4, !tbaa !10
  %exitcond203.not = icmp eq i32 %.4182, %145
  br i1 %exitcond203.not, label %._crit_edge185.loopexit, label %.lr.ph184, !llvm.loop !31

._crit_edge185.loopexit:                          ; preds = %.lr.ph184, %middle.block
  %.pre = load i32, ptr @_ZN16GraphicComponent15_bytes_per_lineE, align 4, !tbaa !10
  br label %._crit_edge185

._crit_edge185:                                   ; preds = %._crit_edge185.loopexit, %.lr.ph190
  %156 = phi i32 [ %.pre, %._crit_edge185.loopexit ], [ %140, %.lr.ph190 ]
  %157 = sext i32 %156 to i64
  %158 = getelementptr inbounds i8, ptr %.0120188, i64 %157
  %indvars.iv.next205 = add nsw i64 %indvars.iv204, 1
  %lftr.wideiv = trunc i64 %indvars.iv.next205 to i32
  %exitcond207.not = icmp eq i32 %139, %lftr.wideiv
  br i1 %exitcond207.not, label %.loopexit, label %.lr.ph190, !llvm.loop !32

.loopexit:                                        ; preds = %._crit_edge185, %._crit_edge179, %._crit_edge, %1
  ret void
}

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

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

attributes #0 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { 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" }

!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 4}
!6 = !{!"_ZTS17GVertexAttributes", !7, i64 0, !7, i64 4, !7, i64 8, !7, i64 12, !7, i64 16, !7, i64 20, !7, i64 24, !7, i64 28, !7, i64 32}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!7, !7, i64 0}
!11 = !{!12, !7, i64 36}
!12 = !{!"_ZTS7GVertex", !6, i64 0, !7, i64 36, !7, i64 40, !13, i64 44, !13, i64 60, !13, i64 76, !13, i64 92, !13, i64 108, !14, i64 124}
!13 = !{!"_ZTS7GVector", !8, i64 0}
!14 = !{!"_ZTS5Flags", !7, i64 0}
!15 = !{!12, !7, i64 40}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.mustprogress"}
!18 = !{!19, !7, i64 164}
!19 = !{!"_ZTS3Mug", !12, i64 0, !12, i64 128}
!20 = distinct !{!20, !17}
!21 = distinct !{!21, !17}
!22 = !{!19, !7, i64 36}
!23 = distinct !{!23, !17}
!24 = distinct !{!24, !17}
!25 = distinct !{!25, !17}
!26 = !{!27, !27, i64 0}
!27 = !{!"any pointer", !8, i64 0}
!28 = distinct !{!28, !17, !29, !30}
!29 = !{!"llvm.loop.isvectorized", i32 1}
!30 = !{!"llvm.loop.unroll.runtime.disable"}
!31 = distinct !{!31, !17, !30, !29}
!32 = distinct !{!32, !17}


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