; 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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN17PolygonEngine_32x12FillPoly_rgbEP17GVertexAttributes(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
  %30 = alloca i32, align 4
  %31 = alloca i32, align 4
  %32 = 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
  %33 = load ptr, ptr %2, align 8, !tbaa !5
  %34 = getelementptr inbounds %class.GVertexAttributes, ptr %33, i32 0, i32 2
  %35 = load i32, ptr %34, align 4, !tbaa !11
  %36 = icmp slt i32 %35, 255
  br i1 %36, label %37, label %41

37:                                               ; preds = %1
  %38 = load ptr, ptr %2, align 8, !tbaa !5
  %39 = getelementptr inbounds %class.GVertexAttributes, ptr %38, i32 0, i32 2
  %40 = load i32, ptr %39, align 4, !tbaa !11
  br label %42

41:                                               ; preds = %1
  br label %42

42:                                               ; preds = %41, %37
  %43 = phi i32 [ %40, %37 ], [ 255, %41 ]
  %44 = ashr i32 %43, 0
  store i32 %44, ptr %11, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #3
  %45 = load ptr, ptr %2, align 8, !tbaa !5
  %46 = getelementptr inbounds %class.GVertexAttributes, ptr %45, i32 0, i32 3
  %47 = load i32, ptr %46, align 4, !tbaa !13
  %48 = icmp slt i32 %47, 255
  br i1 %48, label %49, label %53

49:                                               ; preds = %42
  %50 = load ptr, ptr %2, align 8, !tbaa !5
  %51 = getelementptr inbounds %class.GVertexAttributes, ptr %50, i32 0, i32 3
  %52 = load i32, ptr %51, align 4, !tbaa !13
  br label %54

53:                                               ; preds = %42
  br label %54

54:                                               ; preds = %53, %49
  %55 = phi i32 [ %52, %49 ], [ 255, %53 ]
  %56 = ashr i32 %55, 0
  store i32 %56, ptr %12, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #3
  %57 = load ptr, ptr %2, align 8, !tbaa !5
  %58 = getelementptr inbounds %class.GVertexAttributes, ptr %57, i32 0, i32 4
  %59 = load i32, ptr %58, align 4, !tbaa !14
  %60 = icmp slt i32 %59, 255
  br i1 %60, label %61, label %65

61:                                               ; preds = %54
  %62 = load ptr, ptr %2, align 8, !tbaa !5
  %63 = getelementptr inbounds %class.GVertexAttributes, ptr %62, i32 0, i32 4
  %64 = load i32, ptr %63, align 4, !tbaa !14
  br label %66

65:                                               ; preds = %54
  br label %66

66:                                               ; preds = %65, %61
  %67 = phi i32 [ %64, %61 ], [ 255, %65 ]
  %68 = ashr i32 %67, 0
  store i32 %68, ptr %13, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #3
  %69 = load i32, ptr %13, align 4, !tbaa !9
  %70 = shl i32 %69, 8
  %71 = load i32, ptr %12, align 4, !tbaa !9
  %72 = shl i32 %71, 16
  %73 = or i32 %70, %72
  %74 = load i32, ptr %11, align 4, !tbaa !9
  %75 = shl i32 %74, 24
  %76 = or i32 %73, %75
  store i32 %76, ptr %14, align 4, !tbaa !9
  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
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #3
  %77 = call noundef i32 @_ZN8GPolygon4SizeEv(ptr noundef nonnull align 8 dereferenceable(808) @_ZN13PolygonEngine3_p1E)
  %78 = icmp slt i32 %77, 2
  br i1 %78, label %79, label %80

79:                                               ; preds = %66
  store i32 1, ptr %26, align 4
  br label %400

80:                                               ; preds = %66
  store i32 0, ptr %5, align 4, !tbaa !9
  br label %81

81:                                               ; preds = %175, %80
  %82 = load i32, ptr %5, align 4, !tbaa !9
  %83 = call noundef i32 @_ZN8GPolygon4SizeEv(ptr noundef nonnull align 8 dereferenceable(808) @_ZN13PolygonEngine3_p1E)
  %84 = icmp slt i32 %82, %83
  br i1 %84, label %85, label %178

85:                                               ; preds = %81
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #3
  %86 = load i32, ptr %5, align 4, !tbaa !9
  %87 = add nsw i32 %86, 1
  store i32 %87, ptr %27, align 4, !tbaa !9
  %88 = load i32, ptr %27, align 4, !tbaa !9
  %89 = call noundef i32 @_ZN8GPolygon4SizeEv(ptr noundef nonnull align 8 dereferenceable(808) @_ZN13PolygonEngine3_p1E)
  %90 = icmp eq i32 %88, %89
  br i1 %90, label %91, label %92

91:                                               ; preds = %85
  store i32 0, ptr %27, align 4, !tbaa !9
  br label %92

92:                                               ; preds = %91, %85
  call void @llvm.lifetime.start.p0(i64 4, ptr %28) #3
  %93 = load i32, ptr %27, align 4, !tbaa !9
  %94 = add nsw i32 %93, 1
  store i32 %94, ptr %28, align 4, !tbaa !9
  %95 = load i32, ptr %28, align 4, !tbaa !9
  %96 = call noundef i32 @_ZN8GPolygon4SizeEv(ptr noundef nonnull align 8 dereferenceable(808) @_ZN13PolygonEngine3_p1E)
  %97 = icmp eq i32 %95, %96
  br i1 %97, label %98, label %99

98:                                               ; preds = %92
  store i32 0, ptr %28, align 4, !tbaa !9
  br label %99

99:                                               ; preds = %98, %92
  call void @llvm.lifetime.start.p0(i64 4, ptr %29) #3
  %100 = load i32, ptr %5, align 4, !tbaa !9
  %101 = call noundef ptr @_ZN8GPolygonixEi(ptr noundef nonnull align 8 dereferenceable(808) @_ZN13PolygonEngine3_p1E, i32 noundef %100)
  %102 = getelementptr inbounds %class.GVertex, ptr %101, i32 0, i32 1
  %103 = load i32, ptr %102, align 4, !tbaa !15
  %104 = load i32, ptr %27, align 4, !tbaa !9
  %105 = call noundef ptr @_ZN8GPolygonixEi(ptr noundef nonnull align 8 dereferenceable(808) @_ZN13PolygonEngine3_p1E, i32 noundef %104)
  %106 = getelementptr inbounds %class.GVertex, ptr %105, i32 0, i32 1
  %107 = load i32, ptr %106, align 4, !tbaa !15
  %108 = sub nsw i32 %103, %107
  store i32 %108, ptr %29, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %30) #3
  %109 = load i32, ptr %5, align 4, !tbaa !9
  %110 = call noundef ptr @_ZN8GPolygonixEi(ptr noundef nonnull align 8 dereferenceable(808) @_ZN13PolygonEngine3_p1E, i32 noundef %109)
  %111 = getelementptr inbounds %class.GVertex, ptr %110, i32 0, i32 2
  %112 = load i32, ptr %111, align 4, !tbaa !19
  %113 = load i32, ptr %27, align 4, !tbaa !9
  %114 = call noundef ptr @_ZN8GPolygonixEi(ptr noundef nonnull align 8 dereferenceable(808) @_ZN13PolygonEngine3_p1E, i32 noundef %113)
  %115 = getelementptr inbounds %class.GVertex, ptr %114, i32 0, i32 2
  %116 = load i32, ptr %115, align 4, !tbaa !19
  %117 = sub nsw i32 %112, %116
  store i32 %117, ptr %30, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %31) #3
  %118 = load i32, ptr %28, align 4, !tbaa !9
  %119 = call noundef ptr @_ZN8GPolygonixEi(ptr noundef nonnull align 8 dereferenceable(808) @_ZN13PolygonEngine3_p1E, i32 noundef %118)
  %120 = getelementptr inbounds %class.GVertex, ptr %119, i32 0, i32 1
  %121 = load i32, ptr %120, align 4, !tbaa !15
  %122 = load i32, ptr %27, align 4, !tbaa !9
  %123 = call noundef ptr @_ZN8GPolygonixEi(ptr noundef nonnull align 8 dereferenceable(808) @_ZN13PolygonEngine3_p1E, i32 noundef %122)
  %124 = getelementptr inbounds %class.GVertex, ptr %123, i32 0, i32 1
  %125 = load i32, ptr %124, align 4, !tbaa !15
  %126 = sub nsw i32 %121, %125
  store i32 %126, ptr %31, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %32) #3
  %127 = load i32, ptr %28, align 4, !tbaa !9
  %128 = call noundef ptr @_ZN8GPolygonixEi(ptr noundef nonnull align 8 dereferenceable(808) @_ZN13PolygonEngine3_p1E, i32 noundef %127)
  %129 = getelementptr inbounds %class.GVertex, ptr %128, i32 0, i32 2
  %130 = load i32, ptr %129, align 4, !tbaa !19
  %131 = load i32, ptr %27, align 4, !tbaa !9
  %132 = call noundef ptr @_ZN8GPolygonixEi(ptr noundef nonnull align 8 dereferenceable(808) @_ZN13PolygonEngine3_p1E, i32 noundef %131)
  %133 = getelementptr inbounds %class.GVertex, ptr %132, i32 0, i32 2
  %134 = load i32, ptr %133, align 4, !tbaa !19
  %135 = sub nsw i32 %130, %134
  store i32 %135, ptr %32, align 4, !tbaa !9
  %136 = load i32, ptr %29, align 4, !tbaa !9
  %137 = load i32, ptr %32, align 4, !tbaa !9
  %138 = mul nsw i32 %136, %137
  %139 = load i32, ptr %31, align 4, !tbaa !9
  %140 = load i32, ptr %30, align 4, !tbaa !9
  %141 = mul nsw i32 %139, %140
  %142 = sub nsw i32 %138, %141
  %143 = load i32, ptr %10, align 4, !tbaa !9
  %144 = add nsw i32 %143, %142
  store i32 %144, ptr %10, align 4, !tbaa !9
  %145 = load i32, ptr %3, align 4, !tbaa !9
  %146 = load i32, ptr %5, align 4, !tbaa !9
  %147 = call noundef ptr @_ZN8GPolygonixEi(ptr noundef nonnull align 8 dereferenceable(808) @_ZN13PolygonEngine3_p1E, i32 noundef %146)
  %148 = getelementptr inbounds %class.GVertex, ptr %147, i32 0, i32 2
  %149 = load i32, ptr %148, align 4, !tbaa !19
  %150 = icmp slt i32 %145, %149
  br i1 %150, label %151, label %153

151:                                              ; preds = %99
  %152 = load i32, ptr %3, align 4, !tbaa !9
  br label %158

153:                                              ; preds = %99
  %154 = load i32, ptr %5, align 4, !tbaa !9
  %155 = call noundef ptr @_ZN8GPolygonixEi(ptr noundef nonnull align 8 dereferenceable(808) @_ZN13PolygonEngine3_p1E, i32 noundef %154)
  %156 = getelementptr inbounds %class.GVertex, ptr %155, i32 0, i32 2
  %157 = load i32, ptr %156, align 4, !tbaa !19
  br label %158

158:                                              ; preds = %153, %151
  %159 = phi i32 [ %152, %151 ], [ %157, %153 ]
  store i32 %159, ptr %3, align 4, !tbaa !9
  %160 = load i32, ptr %4, align 4, !tbaa !9
  %161 = load i32, ptr %5, align 4, !tbaa !9
  %162 = call noundef ptr @_ZN8GPolygonixEi(ptr noundef nonnull align 8 dereferenceable(808) @_ZN13PolygonEngine3_p1E, i32 noundef %161)
  %163 = getelementptr inbounds %class.GVertex, ptr %162, i32 0, i32 2
  %164 = load i32, ptr %163, align 4, !tbaa !19
  %165 = icmp sgt i32 %160, %164
  br i1 %165, label %166, label %168

166:                                              ; preds = %158
  %167 = load i32, ptr %4, align 4, !tbaa !9
  br label %173

168:                                              ; preds = %158
  %169 = load i32, ptr %5, align 4, !tbaa !9
  %170 = call noundef ptr @_ZN8GPolygonixEi(ptr noundef nonnull align 8 dereferenceable(808) @_ZN13PolygonEngine3_p1E, i32 noundef %169)
  %171 = getelementptr inbounds %class.GVertex, ptr %170, i32 0, i32 2
  %172 = load i32, ptr %171, align 4, !tbaa !19
  br label %173

173:                                              ; preds = %168, %166
  %174 = phi i32 [ %167, %166 ], [ %172, %168 ]
  store i32 %174, ptr %4, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %32) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %31) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %30) #3
  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
  br label %175

175:                                              ; preds = %173
  %176 = load i32, ptr %5, align 4, !tbaa !9
  %177 = add nsw i32 %176, 1
  store i32 %177, ptr %5, align 4, !tbaa !9
  br label %81, !llvm.loop !20

178:                                              ; preds = %81
  %179 = load i32, ptr %10, align 4, !tbaa !9
  %180 = icmp sgt i32 %179, 0
  %181 = zext i1 %180 to i32
  store i32 %181, ptr %10, align 4, !tbaa !9
  %182 = load i32, ptr %3, align 4, !tbaa !9
  %183 = load i32, ptr %4, align 4, !tbaa !9
  %184 = icmp eq i32 %182, %183
  br i1 %184, label %185, label %186

185:                                              ; preds = %178
  store i32 1, ptr %26, align 4
  br label %400

186:                                              ; preds = %178
  store i32 0, ptr %5, align 4, !tbaa !9
  br label %187

187:                                              ; preds = %342, %186
  %188 = load i32, ptr %5, align 4, !tbaa !9
  %189 = call noundef i32 @_ZN8GPolygon4SizeEv(ptr noundef nonnull align 8 dereferenceable(808) @_ZN13PolygonEngine3_p1E)
  %190 = icmp slt i32 %188, %189
  br i1 %190, label %191, label %345

191:                                              ; preds = %187
  %192 = load i32, ptr %5, align 4, !tbaa !9
  %193 = add nsw i32 %192, 1
  store i32 %193, ptr %6, align 4, !tbaa !9
  %194 = load i32, ptr %6, align 4, !tbaa !9
  %195 = call noundef i32 @_ZN8GPolygon4SizeEv(ptr noundef nonnull align 8 dereferenceable(808) @_ZN13PolygonEngine3_p1E)
  %196 = icmp eq i32 %194, %195
  br i1 %196, label %197, label %198

197:                                              ; preds = %191
  store i32 0, ptr %6, align 4, !tbaa !9
  br label %198

198:                                              ; preds = %197, %191
  %199 = load i32, ptr %5, 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 2
  %202 = load i32, ptr %201, align 4, !tbaa !19
  %203 = load i32, ptr %6, align 4, !tbaa !9
  %204 = call noundef ptr @_ZN8GPolygonixEi(ptr noundef nonnull align 8 dereferenceable(808) @_ZN13PolygonEngine3_p1E, i32 noundef %203)
  %205 = getelementptr inbounds %class.GVertex, ptr %204, i32 0, i32 2
  %206 = load i32, ptr %205, align 4, !tbaa !19
  %207 = icmp eq i32 %202, %206
  br i1 %207, label %208, label %209

208:                                              ; preds = %198
  br label %342

209:                                              ; preds = %198
  %210 = load i32, ptr %5, align 4, !tbaa !9
  %211 = call noundef ptr @_ZN8GPolygonixEi(ptr noundef nonnull align 8 dereferenceable(808) @_ZN13PolygonEngine3_p1E, i32 noundef %210)
  %212 = getelementptr inbounds %class.GVertex, ptr %211, i32 0, i32 2
  %213 = load i32, ptr %212, align 4, !tbaa !19
  store i32 %213, ptr %16, align 4, !tbaa !9
  %214 = load i32, ptr %6, align 4, !tbaa !9
  %215 = call noundef ptr @_ZN8GPolygonixEi(ptr noundef nonnull align 8 dereferenceable(808) @_ZN13PolygonEngine3_p1E, i32 noundef %214)
  %216 = getelementptr inbounds %class.GVertex, ptr %215, i32 0, i32 2
  %217 = load i32, ptr %216, align 4, !tbaa !19
  store i32 %217, ptr %17, align 4, !tbaa !9
  %218 = load i32, ptr %17, align 4, !tbaa !9
  %219 = load i32, ptr %16, align 4, !tbaa !9
  %220 = sub nsw i32 %218, %219
  store i32 %220, ptr %18, align 4, !tbaa !9
  %221 = load i32, ptr %18, align 4, !tbaa !9
  %222 = icmp sgt i32 %221, 0
  br i1 %222, label %223, label %224

223:                                              ; preds = %209
  br label %229

224:                                              ; preds = %209
  %225 = load i32, ptr %18, align 4, !tbaa !9
  %226 = icmp ne i32 %225, 0
  %227 = zext i1 %226 to i64
  %228 = select i1 %226, i32 -1, i32 0
  br label %229

229:                                              ; preds = %224, %223
  %230 = phi i32 [ 1, %223 ], [ %228, %224 ]
  store i32 %230, ptr %19, align 4, !tbaa !9
  %231 = load i32, ptr %19, align 4, !tbaa !9
  %232 = load i32, ptr %18, align 4, !tbaa !9
  %233 = mul nsw i32 %232, %231
  store i32 %233, ptr %18, align 4, !tbaa !9
  %234 = load i32, ptr %16, align 4, !tbaa !9
  store i32 %234, ptr %15, align 4, !tbaa !9
  %235 = load i32, ptr %5, align 4, !tbaa !9
  %236 = call noundef ptr @_ZN8GPolygonixEi(ptr noundef nonnull align 8 dereferenceable(808) @_ZN13PolygonEngine3_p1E, i32 noundef %235)
  %237 = getelementptr inbounds %class.GVertex, ptr %236, i32 0, i32 1
  %238 = load i32, ptr %237, align 4, !tbaa !15
  store i32 %238, ptr %21, align 4, !tbaa !9
  %239 = load i32, ptr %6, align 4, !tbaa !9
  %240 = call noundef ptr @_ZN8GPolygonixEi(ptr noundef nonnull align 8 dereferenceable(808) @_ZN13PolygonEngine3_p1E, i32 noundef %239)
  %241 = getelementptr inbounds %class.GVertex, ptr %240, i32 0, i32 1
  %242 = load i32, ptr %241, align 4, !tbaa !15
  store i32 %242, ptr %22, align 4, !tbaa !9
  %243 = load i32, ptr %22, align 4, !tbaa !9
  %244 = load i32, ptr %21, align 4, !tbaa !9
  %245 = sub nsw i32 %243, %244
  store i32 %245, ptr %23, align 4, !tbaa !9
  %246 = load i32, ptr %23, align 4, !tbaa !9
  %247 = icmp sgt i32 %246, 0
  br i1 %247, label %248, label %249

248:                                              ; preds = %229
  br label %254

249:                                              ; preds = %229
  %250 = load i32, ptr %23, align 4, !tbaa !9
  %251 = icmp ne i32 %250, 0
  %252 = zext i1 %251 to i64
  %253 = select i1 %251, i32 -1, i32 0
  br label %254

254:                                              ; preds = %249, %248
  %255 = phi i32 [ 1, %248 ], [ %253, %249 ]
  store i32 %255, ptr %24, align 4, !tbaa !9
  %256 = load i32, ptr %24, align 4, !tbaa !9
  %257 = load i32, ptr %23, align 4, !tbaa !9
  %258 = mul nsw i32 %257, %256
  store i32 %258, ptr %23, align 4, !tbaa !9
  %259 = load i32, ptr %23, align 4, !tbaa !9
  %260 = shl i32 %259, 1
  %261 = load i32, ptr %18, align 4, !tbaa !9
  %262 = sub nsw i32 %260, %261
  store i32 %262, ptr %25, align 4, !tbaa !9
  %263 = load i32, ptr %21, align 4, !tbaa !9
  store i32 %263, ptr %20, align 4, !tbaa !9
  %264 = load i32, ptr %10, align 4, !tbaa !9
  %265 = load i32, ptr %17, align 4, !tbaa !9
  %266 = load i32, ptr %16, align 4, !tbaa !9
  %267 = icmp sgt i32 %265, %266
  %268 = zext i1 %267 to i32
  %269 = xor i32 %264, %268
  %270 = icmp ne i32 %269, 0
  br i1 %270, label %271, label %306

271:                                              ; preds = %254
  store i32 0, ptr %7, align 4, !tbaa !9
  br label %272

272:                                              ; preds = %302, %271
  %273 = load i32, ptr %7, align 4, !tbaa !9
  %274 = load i32, ptr %18, align 4, !tbaa !9
  %275 = icmp sle i32 %273, %274
  br i1 %275, label %276, label %305

276:                                              ; preds = %272
  %277 = load i32, ptr %20, align 4, !tbaa !9
  %278 = load i32, ptr %15, align 4, !tbaa !9
  %279 = sext i32 %278 to i64
  %280 = getelementptr inbounds [1024 x %class.Mug], ptr @_ZN13PolygonEngine4_mugE, i64 0, i64 %279
  %281 = getelementptr inbounds %class.Mug, ptr %280, i32 0, i32 1
  %282 = getelementptr inbounds %class.GVertex, ptr %281, i32 0, i32 1
  store i32 %277, ptr %282, align 4, !tbaa !22
  %283 = load i32, ptr %19, align 4, !tbaa !9
  %284 = load i32, ptr %15, align 4, !tbaa !9
  %285 = add nsw i32 %284, %283
  store i32 %285, ptr %15, align 4, !tbaa !9
  br label %286

286:                                              ; preds = %289, %276
  %287 = load i32, ptr %25, align 4, !tbaa !9
  %288 = icmp sge i32 %287, 0
  br i1 %288, label %289, label %297

289:                                              ; preds = %286
  %290 = load i32, ptr %24, align 4, !tbaa !9
  %291 = load i32, ptr %20, align 4, !tbaa !9
  %292 = add nsw i32 %291, %290
  store i32 %292, ptr %20, align 4, !tbaa !9
  %293 = load i32, ptr %18, align 4, !tbaa !9
  %294 = shl i32 %293, 1
  %295 = load i32, ptr %25, align 4, !tbaa !9
  %296 = sub nsw i32 %295, %294
  store i32 %296, ptr %25, align 4, !tbaa !9
  br label %286, !llvm.loop !24

297:                                              ; preds = %286
  %298 = load i32, ptr %23, align 4, !tbaa !9
  %299 = shl i32 %298, 1
  %300 = load i32, ptr %25, align 4, !tbaa !9
  %301 = add nsw i32 %300, %299
  store i32 %301, ptr %25, align 4, !tbaa !9
  br label %302

302:                                              ; preds = %297
  %303 = load i32, ptr %7, align 4, !tbaa !9
  %304 = add nsw i32 %303, 1
  store i32 %304, ptr %7, align 4, !tbaa !9
  br label %272, !llvm.loop !25

305:                                              ; preds = %272
  br label %341

306:                                              ; preds = %254
  store i32 0, ptr %7, align 4, !tbaa !9
  br label %307

307:                                              ; preds = %337, %306
  %308 = load i32, ptr %7, align 4, !tbaa !9
  %309 = load i32, ptr %18, align 4, !tbaa !9
  %310 = icmp sle i32 %308, %309
  br i1 %310, label %311, label %340

311:                                              ; preds = %307
  %312 = load i32, ptr %20, align 4, !tbaa !9
  %313 = load i32, ptr %15, align 4, !tbaa !9
  %314 = sext i32 %313 to i64
  %315 = getelementptr inbounds [1024 x %class.Mug], ptr @_ZN13PolygonEngine4_mugE, i64 0, i64 %314
  %316 = getelementptr inbounds %class.Mug, ptr %315, i32 0, i32 0
  %317 = getelementptr inbounds %class.GVertex, ptr %316, i32 0, i32 1
  store i32 %312, ptr %317, align 4, !tbaa !26
  %318 = load i32, ptr %19, align 4, !tbaa !9
  %319 = load i32, ptr %15, align 4, !tbaa !9
  %320 = add nsw i32 %319, %318
  store i32 %320, ptr %15, align 4, !tbaa !9
  br label %321

321:                                              ; preds = %324, %311
  %322 = load i32, ptr %25, align 4, !tbaa !9
  %323 = icmp sge i32 %322, 0
  br i1 %323, label %324, label %332

324:                                              ; preds = %321
  %325 = load i32, ptr %24, align 4, !tbaa !9
  %326 = load i32, ptr %20, align 4, !tbaa !9
  %327 = add nsw i32 %326, %325
  store i32 %327, ptr %20, align 4, !tbaa !9
  %328 = load i32, ptr %18, align 4, !tbaa !9
  %329 = shl i32 %328, 1
  %330 = load i32, ptr %25, align 4, !tbaa !9
  %331 = sub nsw i32 %330, %329
  store i32 %331, ptr %25, align 4, !tbaa !9
  br label %321, !llvm.loop !27

332:                                              ; preds = %321
  %333 = load i32, ptr %23, align 4, !tbaa !9
  %334 = shl i32 %333, 1
  %335 = load i32, ptr %25, align 4, !tbaa !9
  %336 = add nsw i32 %335, %334
  store i32 %336, ptr %25, align 4, !tbaa !9
  br label %337

337:                                              ; preds = %332
  %338 = load i32, ptr %7, align 4, !tbaa !9
  %339 = add nsw i32 %338, 1
  store i32 %339, ptr %7, align 4, !tbaa !9
  br label %307, !llvm.loop !28

340:                                              ; preds = %307
  br label %341

341:                                              ; preds = %340, %305
  br label %342

342:                                              ; preds = %341, %208
  %343 = load i32, ptr %5, align 4, !tbaa !9
  %344 = add nsw i32 %343, 1
  store i32 %344, ptr %5, align 4, !tbaa !9
  br label %187, !llvm.loop !29

345:                                              ; preds = %187
  %346 = load ptr, ptr @_ZN16GraphicComponent10_graph_memE, align 8, !tbaa !5
  %347 = load i32, ptr %3, align 4, !tbaa !9
  %348 = load i32, ptr @_ZN16GraphicComponent15_bytes_per_lineE, align 4, !tbaa !9
  %349 = mul nsw i32 %347, %348
  %350 = sext i32 %349 to i64
  %351 = getelementptr inbounds i8, ptr %346, i64 %350
  store ptr %351, ptr %9, align 8, !tbaa !5
  %352 = load i32, ptr %3, align 4, !tbaa !9
  store i32 %352, ptr %15, align 4, !tbaa !9
  br label %353

353:                                              ; preds = %396, %345
  %354 = load i32, ptr %15, align 4, !tbaa !9
  %355 = load i32, ptr %4, align 4, !tbaa !9
  %356 = icmp sle i32 %354, %355
  br i1 %356, label %357, label %399

357:                                              ; preds = %353
  %358 = load i32, ptr %15, align 4, !tbaa !9
  %359 = sext i32 %358 to i64
  %360 = getelementptr inbounds [1024 x %class.Mug], ptr @_ZN13PolygonEngine4_mugE, i64 0, i64 %359
  %361 = getelementptr inbounds %class.Mug, ptr %360, i32 0, i32 0
  %362 = getelementptr inbounds %class.GVertex, ptr %361, i32 0, i32 1
  %363 = load i32, ptr %362, align 4, !tbaa !26
  store i32 %363, ptr %21, align 4, !tbaa !9
  %364 = load i32, ptr %15, align 4, !tbaa !9
  %365 = sext i32 %364 to i64
  %366 = getelementptr inbounds [1024 x %class.Mug], ptr @_ZN13PolygonEngine4_mugE, i64 0, i64 %365
  %367 = getelementptr inbounds %class.Mug, ptr %366, i32 0, i32 1
  %368 = getelementptr inbounds %class.GVertex, ptr %367, i32 0, i32 1
  %369 = load i32, ptr %368, align 4, !tbaa !22
  store i32 %369, ptr %22, align 4, !tbaa !9
  %370 = load i32, ptr %22, align 4, !tbaa !9
  %371 = load i32, ptr %21, align 4, !tbaa !9
  %372 = sub nsw i32 %370, %371
  %373 = add nsw i32 %372, 1
  store i32 %373, ptr %23, align 4, !tbaa !9
  %374 = load i32, ptr %21, align 4, !tbaa !9
  store i32 %374, ptr %20, align 4, !tbaa !9
  %375 = load ptr, ptr %9, align 8, !tbaa !5
  %376 = load i32, ptr %21, align 4, !tbaa !9
  %377 = sext i32 %376 to i64
  %378 = getelementptr inbounds i32, ptr %375, i64 %377
  store ptr %378, ptr %8, align 8, !tbaa !5
  %379 = load i32, ptr %21, align 4, !tbaa !9
  store i32 %379, ptr %20, align 4, !tbaa !9
  br label %380

380:                                              ; preds = %385, %357
  %381 = load i32, ptr %20, align 4, !tbaa !9
  %382 = load i32, ptr %22, align 4, !tbaa !9
  %383 = icmp sle i32 %381, %382
  br i1 %383, label %384, label %391

384:                                              ; preds = %380
  br label %385

385:                                              ; preds = %384
  %386 = load i32, ptr %20, align 4, !tbaa !9
  %387 = add nsw i32 %386, 1
  store i32 %387, ptr %20, align 4, !tbaa !9
  %388 = load i32, ptr %14, align 4, !tbaa !9
  %389 = load ptr, ptr %8, align 8, !tbaa !5
  %390 = getelementptr inbounds i32, ptr %389, i32 1
  store ptr %390, ptr %8, align 8, !tbaa !5
  store i32 %388, ptr %389, align 4, !tbaa !9
  br label %380, !llvm.loop !30

391:                                              ; preds = %380
  %392 = load ptr, ptr %9, align 8, !tbaa !5
  %393 = load i32, ptr @_ZN16GraphicComponent15_bytes_per_lineE, align 4, !tbaa !9
  %394 = sext i32 %393 to i64
  %395 = getelementptr inbounds i8, ptr %392, i64 %394
  store ptr %395, ptr %9, align 8, !tbaa !5
  br label %396

396:                                              ; preds = %391
  %397 = load i32, ptr %15, align 4, !tbaa !9
  %398 = add nsw i32 %397, 1
  store i32 %398, ptr %15, align 4, !tbaa !9
  br label %353, !llvm.loop !31

399:                                              ; preds = %353
  store i32 0, ptr %26, align 4
  br label %400

400:                                              ; preds = %399, %185, %79
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #3
  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
  %401 = load i32, ptr %26, align 4
  switch i32 %401, label %403 [
    i32 0, label %402
    i32 1, label %402
  ]

402:                                              ; preds = %400, %400
  ret void

403:                                              ; preds = %400
  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 8}
!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 = !{!12, !10, i64 12}
!14 = !{!12, !10, i64 16}
!15 = !{!16, !10, i64 36}
!16 = !{!"_ZTS7GVertex", !12, i64 0, !10, i64 36, !10, i64 40, !17, i64 44, !17, i64 60, !17, i64 76, !17, i64 92, !17, i64 108, !18, i64 124}
!17 = !{!"_ZTS7GVector", !7, i64 0}
!18 = !{!"_ZTS5Flags", !10, i64 0}
!19 = !{!16, !10, i64 40}
!20 = distinct !{!20, !21}
!21 = !{!"llvm.loop.mustprogress"}
!22 = !{!23, !10, i64 164}
!23 = !{!"_ZTS3Mug", !16, i64 0, !16, i64 128}
!24 = distinct !{!24, !21}
!25 = distinct !{!25, !21}
!26 = !{!23, !10, i64 36}
!27 = distinct !{!27, !21}
!28 = distinct !{!28, !21}
!29 = distinct !{!29, !21}
!30 = distinct !{!30, !21}
!31 = distinct !{!31, !21}


; 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

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_ZN17PolygonEngine_32x12FillPoly_rgbEP17GVertexAttributes(ptr nocapture noundef readonly %0) local_unnamed_addr #0 align 2 {
  %2 = getelementptr inbounds i8, ptr %0, i64 8
  %3 = load i32, ptr %2, align 4, !tbaa !5
  %spec.select = tail call i32 @llvm.smin.i32(i32 %3, i32 255)
  %4 = getelementptr inbounds i8, ptr %0, i64 12
  %5 = load i32, ptr %4, align 4, !tbaa !10
  %6 = tail call i32 @llvm.smin.i32(i32 %5, i32 255)
  %7 = getelementptr inbounds i8, ptr %0, i64 16
  %8 = load i32, ptr %7, align 4, !tbaa !11
  %9 = tail call i32 @llvm.smin.i32(i32 %8, i32 255)
  %10 = shl i32 %9, 8
  %11 = shl i32 %6, 16
  %12 = shl i32 %spec.select, 24
  %13 = or i32 %11, %12
  %14 = or i32 %13, %10
  %15 = tail call noundef i32 @_ZN8GPolygon4SizeEv(ptr noundef nonnull align 8 dereferenceable(808) @_ZN13PolygonEngine3_p1E)
  %16 = icmp slt i32 %15, 2
  br i1 %16, label %.loopexit, label %.preheader156

.preheader156:                                    ; preds = %1
  %17 = tail call noundef i32 @_ZN8GPolygon4SizeEv(ptr noundef nonnull align 8 dereferenceable(808) @_ZN13PolygonEngine3_p1E)
  %18 = icmp sgt i32 %17, 0
  br i1 %18, label %.lr.ph, label %.preheader155

.lr.ph:                                           ; preds = %.preheader156, %73
  %.0160 = phi i32 [ %64, %73 ], [ 1000, %.preheader156 ]
  %.0114159 = phi i32 [ %74, %73 ], [ -1, %.preheader156 ]
  %.0115158 = phi i32 [ %19, %73 ], [ 0, %.preheader156 ]
  %.0129157 = phi i32 [ %54, %73 ], [ 0, %.preheader156 ]
  %19 = add nuw nsw i32 %.0115158, 1
  %20 = tail call noundef i32 @_ZN8GPolygon4SizeEv(ptr noundef nonnull align 8 dereferenceable(808) @_ZN13PolygonEngine3_p1E)
  %21 = icmp eq i32 %19, %20
  %spec.select149 = select i1 %21, i32 0, i32 %19
  %22 = add nuw nsw i32 %spec.select149, 1
  %23 = tail call noundef i32 @_ZN8GPolygon4SizeEv(ptr noundef nonnull align 8 dereferenceable(808) @_ZN13PolygonEngine3_p1E)
  %24 = icmp eq i32 %22, %23
  %.0117 = select i1 %24, i32 0, i32 %22
  %25 = tail call noundef ptr @_ZN8GPolygonixEi(ptr noundef nonnull align 8 dereferenceable(808) @_ZN13PolygonEngine3_p1E, i32 noundef %.0115158)
  %26 = getelementptr inbounds i8, ptr %25, i64 36
  %27 = load i32, ptr %26, align 4, !tbaa !12
  %28 = tail call noundef ptr @_ZN8GPolygonixEi(ptr noundef nonnull align 8 dereferenceable(808) @_ZN13PolygonEngine3_p1E, i32 noundef %spec.select149)
  %29 = getelementptr inbounds i8, ptr %28, i64 36
  %30 = load i32, ptr %29, align 4, !tbaa !12
  %31 = sub nsw i32 %27, %30
  %32 = tail call noundef ptr @_ZN8GPolygonixEi(ptr noundef nonnull align 8 dereferenceable(808) @_ZN13PolygonEngine3_p1E, i32 noundef %.0115158)
  %33 = getelementptr inbounds i8, ptr %32, i64 40
  %34 = load i32, ptr %33, align 4, !tbaa !16
  %35 = tail call noundef ptr @_ZN8GPolygonixEi(ptr noundef nonnull align 8 dereferenceable(808) @_ZN13PolygonEngine3_p1E, i32 noundef %spec.select149)
  %36 = getelementptr inbounds i8, ptr %35, i64 40
  %37 = load i32, ptr %36, align 4, !tbaa !16
  %.neg = sub i32 %37, %34
  %38 = tail call noundef ptr @_ZN8GPolygonixEi(ptr noundef nonnull align 8 dereferenceable(808) @_ZN13PolygonEngine3_p1E, i32 noundef %.0117)
  %39 = getelementptr inbounds i8, ptr %38, i64 36
  %40 = load i32, ptr %39, align 4, !tbaa !12
  %41 = tail call noundef ptr @_ZN8GPolygonixEi(ptr noundef nonnull align 8 dereferenceable(808) @_ZN13PolygonEngine3_p1E, i32 noundef %spec.select149)
  %42 = getelementptr inbounds i8, ptr %41, i64 36
  %43 = load i32, ptr %42, align 4, !tbaa !12
  %44 = sub nsw i32 %40, %43
  %45 = tail call noundef ptr @_ZN8GPolygonixEi(ptr noundef nonnull align 8 dereferenceable(808) @_ZN13PolygonEngine3_p1E, i32 noundef %.0117)
  %46 = getelementptr inbounds i8, ptr %45, i64 40
  %47 = load i32, ptr %46, align 4, !tbaa !16
  %48 = tail call noundef ptr @_ZN8GPolygonixEi(ptr noundef nonnull align 8 dereferenceable(808) @_ZN13PolygonEngine3_p1E, i32 noundef %spec.select149)
  %49 = getelementptr inbounds i8, ptr %48, i64 40
  %50 = load i32, ptr %49, align 4, !tbaa !16
  %51 = sub nsw i32 %47, %50
  %52 = mul nsw i32 %51, %31
  %.neg148 = mul i32 %44, %.neg
  %53 = add i32 %.neg148, %.0129157
  %54 = add i32 %53, %52
  %55 = tail call noundef ptr @_ZN8GPolygonixEi(ptr noundef nonnull align 8 dereferenceable(808) @_ZN13PolygonEngine3_p1E, i32 noundef %.0115158)
  %56 = getelementptr inbounds i8, ptr %55, i64 40
  %57 = load i32, ptr %56, align 4, !tbaa !16
  %58 = icmp slt i32 %.0160, %57
  br i1 %58, label %63, label %59

59:                                               ; preds = %.lr.ph
  %60 = tail call noundef ptr @_ZN8GPolygonixEi(ptr noundef nonnull align 8 dereferenceable(808) @_ZN13PolygonEngine3_p1E, i32 noundef %.0115158)
  %61 = getelementptr inbounds i8, ptr %60, i64 40
  %62 = load i32, ptr %61, align 4, !tbaa !16
  br label %63

63:                                               ; preds = %.lr.ph, %59
  %64 = phi i32 [ %62, %59 ], [ %.0160, %.lr.ph ]
  %65 = tail call noundef ptr @_ZN8GPolygonixEi(ptr noundef nonnull align 8 dereferenceable(808) @_ZN13PolygonEngine3_p1E, i32 noundef %.0115158)
  %66 = getelementptr inbounds i8, ptr %65, i64 40
  %67 = load i32, ptr %66, align 4, !tbaa !16
  %68 = icmp sgt i32 %.0114159, %67
  br i1 %68, label %73, label %69

69:                                               ; preds = %63
  %70 = tail call noundef ptr @_ZN8GPolygonixEi(ptr noundef nonnull align 8 dereferenceable(808) @_ZN13PolygonEngine3_p1E, i32 noundef %.0115158)
  %71 = getelementptr inbounds i8, ptr %70, i64 40
  %72 = load i32, ptr %71, align 4, !tbaa !16
  br label %73

73:                                               ; preds = %63, %69
  %74 = phi i32 [ %72, %69 ], [ %.0114159, %63 ]
  %75 = tail call noundef i32 @_ZN8GPolygon4SizeEv(ptr noundef nonnull align 8 dereferenceable(808) @_ZN13PolygonEngine3_p1E)
  %76 = icmp slt i32 %19, %75
  br i1 %76, label %.lr.ph, label %._crit_edge, !llvm.loop !17

._crit_edge:                                      ; preds = %73
  %77 = icmp sgt i32 %54, 0
  %78 = icmp eq i32 %64, %74
  br i1 %78, label %.loopexit, label %.preheader155

.preheader155:                                    ; preds = %.preheader156, %._crit_edge
  %.0.lcssa225 = phi i32 [ %64, %._crit_edge ], [ 1000, %.preheader156 ]
  %.0114.lcssa224 = phi i32 [ %74, %._crit_edge ], [ -1, %.preheader156 ]
  %.0129.lcssa223 = phi i1 [ %77, %._crit_edge ], [ false, %.preheader156 ]
  %79 = tail call noundef i32 @_ZN8GPolygon4SizeEv(ptr noundef nonnull align 8 dereferenceable(808) @_ZN13PolygonEngine3_p1E)
  %80 = icmp sgt i32 %79, 0
  br i1 %80, label %.lr.ph190, label %._crit_edge191

.lr.ph190:                                        ; preds = %.preheader155, %.loopexit152
  %.1189 = phi i32 [ %81, %.loopexit152 ], [ 0, %.preheader155 ]
  %81 = add nuw nsw i32 %.1189, 1
  %82 = tail call noundef i32 @_ZN8GPolygon4SizeEv(ptr noundef nonnull align 8 dereferenceable(808) @_ZN13PolygonEngine3_p1E)
  %83 = icmp eq i32 %81, %82
  %spec.select150 = select i1 %83, i32 0, i32 %81
  %84 = tail call noundef ptr @_ZN8GPolygonixEi(ptr noundef nonnull align 8 dereferenceable(808) @_ZN13PolygonEngine3_p1E, i32 noundef %.1189)
  %85 = getelementptr inbounds i8, ptr %84, i64 40
  %86 = load i32, ptr %85, align 4, !tbaa !16
  %87 = tail call noundef ptr @_ZN8GPolygonixEi(ptr noundef nonnull align 8 dereferenceable(808) @_ZN13PolygonEngine3_p1E, i32 noundef %spec.select150)
  %88 = getelementptr inbounds i8, ptr %87, i64 40
  %89 = load i32, ptr %88, align 4, !tbaa !16
  %90 = icmp eq i32 %86, %89
  br i1 %90, label %.loopexit152, label %91

91:                                               ; preds = %.lr.ph190
  %92 = tail call noundef ptr @_ZN8GPolygonixEi(ptr noundef nonnull align 8 dereferenceable(808) @_ZN13PolygonEngine3_p1E, i32 noundef %.1189)
  %93 = getelementptr inbounds i8, ptr %92, i64 40
  %94 = load i32, ptr %93, align 4, !tbaa !16
  %95 = tail call noundef ptr @_ZN8GPolygonixEi(ptr noundef nonnull align 8 dereferenceable(808) @_ZN13PolygonEngine3_p1E, i32 noundef %spec.select150)
  %96 = getelementptr inbounds i8, ptr %95, i64 40
  %97 = load i32, ptr %96, align 4, !tbaa !16
  %98 = sub i32 %97, %94
  %.not144 = icmp ne i32 %97, %94
  %99 = sext i1 %.not144 to i32
  %.inv = icmp slt i32 %98, 1
  %100 = select i1 %.inv, i32 %99, i32 1
  %101 = mul i32 %100, %98
  %102 = tail call noundef ptr @_ZN8GPolygonixEi(ptr noundef nonnull align 8 dereferenceable(808) @_ZN13PolygonEngine3_p1E, i32 noundef %.1189)
  %103 = getelementptr inbounds i8, ptr %102, i64 36
  %104 = load i32, ptr %103, align 4, !tbaa !12
  %105 = tail call noundef ptr @_ZN8GPolygonixEi(ptr noundef nonnull align 8 dereferenceable(808) @_ZN13PolygonEngine3_p1E, i32 noundef %spec.select150)
  %106 = getelementptr inbounds i8, ptr %105, i64 36
  %107 = load i32, ptr %106, align 4, !tbaa !12
  %108 = sub nsw i32 %107, %104
  %.not145 = icmp ne i32 %107, %104
  %109 = sext i1 %.not145 to i32
  %.inv151 = icmp slt i32 %108, 1
  %110 = select i1 %.inv151, i32 %109, i32 1
  %111 = shl i32 %108, 1
  %112 = mul i32 %111, %110
  %113 = sub nsw i32 %112, %101
  %114 = icmp sgt i32 %97, %94
  %115 = xor i1 %.0129.lcssa223, %114
  %.not147183 = icmp slt i32 %101, 0
  br i1 %115, label %.preheader, label %.preheader153

.preheader153:                                    ; preds = %91
  br i1 %.not147183, label %.loopexit152, label %.lr.ph175

.lr.ph175:                                        ; preds = %.preheader153
  %116 = shl nuw i32 %101, 1
  %117 = sext i32 %94 to i64
  %118 = sext i32 %100 to i64
  br label %130

.preheader:                                       ; preds = %91
  br i1 %.not147183, label %.loopexit152, label %.lr.ph188

.lr.ph188:                                        ; preds = %.preheader
  %119 = shl nuw i32 %101, 1
  %120 = sext i32 %94 to i64
  %121 = sext i32 %100 to i64
  br label %122

122:                                              ; preds = %.lr.ph188, %._crit_edge180
  %indvars.iv211 = phi i64 [ %120, %.lr.ph188 ], [ %indvars.iv.next212, %._crit_edge180 ]
  %.0119187 = phi i32 [ %113, %.lr.ph188 ], [ %128, %._crit_edge180 ]
  %.0121186 = phi i32 [ 0, %.lr.ph188 ], [ %129, %._crit_edge180 ]
  %.0123185 = phi i32 [ %104, %.lr.ph188 ], [ %.1124.lcssa, %._crit_edge180 ]
  %123 = getelementptr inbounds [1024 x %class.Mug], ptr @_ZN13PolygonEngine4_mugE, i64 0, i64 %indvars.iv211, i32 1, i32 1
  store i32 %.0123185, ptr %123, align 4, !tbaa !19
  %indvars.iv.next212 = add nsw i64 %indvars.iv211, %121
  %124 = icmp sgt i32 %.0119187, -1
  br i1 %124, label %.lr.ph179, label %._crit_edge180

.lr.ph179:                                        ; preds = %122, %.lr.ph179
  %.1120177 = phi i32 [ %126, %.lr.ph179 ], [ %.0119187, %122 ]
  %.1124176 = phi i32 [ %125, %.lr.ph179 ], [ %.0123185, %122 ]
  %125 = add nsw i32 %.1124176, %110
  %126 = sub nsw i32 %.1120177, %119
  %127 = icmp sgt i32 %126, -1
  br i1 %127, label %.lr.ph179, label %._crit_edge180, !llvm.loop !21

._crit_edge180:                                   ; preds = %.lr.ph179, %122
  %.1124.lcssa = phi i32 [ %.0123185, %122 ], [ %125, %.lr.ph179 ]
  %.1120.lcssa = phi i32 [ %.0119187, %122 ], [ %126, %.lr.ph179 ]
  %128 = add nsw i32 %.1120.lcssa, %112
  %129 = add nuw i32 %.0121186, 1
  %exitcond214.not = icmp eq i32 %.0121186, %101
  br i1 %exitcond214.not, label %.loopexit152, label %122, !llvm.loop !22

130:                                              ; preds = %.lr.ph175, %._crit_edge167
  %indvars.iv = phi i64 [ %117, %.lr.ph175 ], [ %indvars.iv.next, %._crit_edge167 ]
  %.2174 = phi i32 [ %113, %.lr.ph175 ], [ %136, %._crit_edge167 ]
  %.1122173 = phi i32 [ 0, %.lr.ph175 ], [ %137, %._crit_edge167 ]
  %.2125172 = phi i32 [ %104, %.lr.ph175 ], [ %.3126.lcssa, %._crit_edge167 ]
  %131 = getelementptr inbounds [1024 x %class.Mug], ptr @_ZN13PolygonEngine4_mugE, i64 0, i64 %indvars.iv, i32 0, i32 1
  store i32 %.2125172, ptr %131, align 4, !tbaa !23
  %indvars.iv.next = add nsw i64 %indvars.iv, %118
  %132 = icmp sgt i32 %.2174, -1
  br i1 %132, label %.lr.ph166, label %._crit_edge167

.lr.ph166:                                        ; preds = %130, %.lr.ph166
  %.3164 = phi i32 [ %134, %.lr.ph166 ], [ %.2174, %130 ]
  %.3126163 = phi i32 [ %133, %.lr.ph166 ], [ %.2125172, %130 ]
  %133 = add nsw i32 %.3126163, %110
  %134 = sub nsw i32 %.3164, %116
  %135 = icmp sgt i32 %134, -1
  br i1 %135, label %.lr.ph166, label %._crit_edge167, !llvm.loop !24

._crit_edge167:                                   ; preds = %.lr.ph166, %130
  %.3126.lcssa = phi i32 [ %.2125172, %130 ], [ %133, %.lr.ph166 ]
  %.3.lcssa = phi i32 [ %.2174, %130 ], [ %134, %.lr.ph166 ]
  %136 = add nsw i32 %.3.lcssa, %112
  %137 = add nuw i32 %.1122173, 1
  %exitcond.not = icmp eq i32 %.1122173, %101
  br i1 %exitcond.not, label %.loopexit152, label %130, !llvm.loop !25

.loopexit152:                                     ; preds = %._crit_edge167, %._crit_edge180, %.preheader153, %.preheader, %.lr.ph190
  %138 = tail call noundef i32 @_ZN8GPolygon4SizeEv(ptr noundef nonnull align 8 dereferenceable(808) @_ZN13PolygonEngine3_p1E)
  %139 = icmp slt i32 %81, %138
  br i1 %139, label %.lr.ph190, label %._crit_edge191, !llvm.loop !26

._crit_edge191:                                   ; preds = %.loopexit152, %.preheader155
  %.not198 = icmp sgt i32 %.0.lcssa225, %.0114.lcssa224
  br i1 %.not198, label %.loopexit, label %.lr.ph202.preheader

.lr.ph202.preheader:                              ; preds = %._crit_edge191
  %140 = load ptr, ptr @_ZN16GraphicComponent10_graph_memE, align 8, !tbaa !27
  %141 = load i32, ptr @_ZN16GraphicComponent15_bytes_per_lineE, align 4, !tbaa !29
  %142 = mul nsw i32 %141, %.0.lcssa225
  %143 = sext i32 %142 to i64
  %144 = getelementptr inbounds i8, ptr %140, i64 %143
  %145 = sext i32 %.0.lcssa225 to i64
  %146 = add i32 %.0114.lcssa224, 1
  %broadcast.splatinsert = insertelement <4 x i32> poison, i32 %14, i64 0
  %broadcast.splat = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
  br label %.lr.ph202

.lr.ph202:                                        ; preds = %.lr.ph202.preheader, %._crit_edge197
  %147 = phi i32 [ %141, %.lr.ph202.preheader ], [ %163, %._crit_edge197 ]
  %indvars.iv216 = phi i64 [ %145, %.lr.ph202.preheader ], [ %indvars.iv.next217, %._crit_edge197 ]
  %.0128200 = phi ptr [ %144, %.lr.ph202.preheader ], [ %165, %._crit_edge197 ]
  %148 = getelementptr inbounds [1024 x %class.Mug], ptr @_ZN13PolygonEngine4_mugE, i64 0, i64 %indvars.iv216
  %149 = getelementptr inbounds i8, ptr %148, i64 36
  %150 = load i32, ptr %149, align 4, !tbaa !23
  %151 = getelementptr inbounds i8, ptr %148, i64 164
  %152 = load i32, ptr %151, align 4, !tbaa !19
  %.not143192 = icmp sgt i32 %150, %152
  br i1 %.not143192, label %._crit_edge197, label %.lr.ph196.preheader

.lr.ph196.preheader:                              ; preds = %.lr.ph202
  %153 = sext i32 %150 to i64
  %154 = getelementptr inbounds i32, ptr %.0128200, i64 %153
  %155 = sub i32 %152, %150
  %156 = zext i32 %155 to i64
  %157 = add nuw nsw i64 %156, 1
  %min.iters.check = icmp ult i32 %155, 7
  br i1 %min.iters.check, label %.lr.ph196.preheader243, label %vector.ph

vector.ph:                                        ; preds = %.lr.ph196.preheader
  %n.vec = and i64 %157, 8589934584
  %.cast = trunc i64 %n.vec to i32
  %ind.end = add i32 %150, %.cast
  %158 = shl nuw nsw i64 %n.vec, 2
  %ind.end240 = getelementptr i8, ptr %154, i64 %158
  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 %154, i64 %offset.idx
  %159 = getelementptr i8, ptr %next.gep, i64 16
  store <4 x i32> %broadcast.splat, ptr %next.gep, align 4, !tbaa !29
  store <4 x i32> %broadcast.splat, ptr %159, align 4, !tbaa !29
  %index.next = add nuw i64 %index, 8
  %160 = icmp eq i64 %index.next, %n.vec
  br i1 %160, label %middle.block, label %vector.body, !llvm.loop !30

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %157, %n.vec
  br i1 %cmp.n, label %._crit_edge197.loopexit, label %.lr.ph196.preheader243

.lr.ph196.preheader243:                           ; preds = %middle.block, %.lr.ph196.preheader
  %.4194.ph = phi i32 [ %150, %.lr.ph196.preheader ], [ %ind.end, %middle.block ]
  %.0127193.ph = phi ptr [ %154, %.lr.ph196.preheader ], [ %ind.end240, %middle.block ]
  br label %.lr.ph196

.lr.ph196:                                        ; preds = %.lr.ph196.preheader243, %.lr.ph196
  %.4194 = phi i32 [ %161, %.lr.ph196 ], [ %.4194.ph, %.lr.ph196.preheader243 ]
  %.0127193 = phi ptr [ %162, %.lr.ph196 ], [ %.0127193.ph, %.lr.ph196.preheader243 ]
  %161 = add i32 %.4194, 1
  %162 = getelementptr inbounds i8, ptr %.0127193, i64 4
  store i32 %14, ptr %.0127193, align 4, !tbaa !29
  %exitcond215.not = icmp eq i32 %.4194, %152
  br i1 %exitcond215.not, label %._crit_edge197.loopexit, label %.lr.ph196, !llvm.loop !33

._crit_edge197.loopexit:                          ; preds = %.lr.ph196, %middle.block
  %.pre = load i32, ptr @_ZN16GraphicComponent15_bytes_per_lineE, align 4, !tbaa !29
  br label %._crit_edge197

._crit_edge197:                                   ; preds = %._crit_edge197.loopexit, %.lr.ph202
  %163 = phi i32 [ %.pre, %._crit_edge197.loopexit ], [ %147, %.lr.ph202 ]
  %164 = sext i32 %163 to i64
  %165 = getelementptr inbounds i8, ptr %.0128200, i64 %164
  %indvars.iv.next217 = add nsw i64 %indvars.iv216, 1
  %lftr.wideiv = trunc i64 %indvars.iv.next217 to i32
  %exitcond219.not = icmp eq i32 %146, %lftr.wideiv
  br i1 %exitcond219.not, label %.loopexit, label %.lr.ph202, !llvm.loop !34

.loopexit:                                        ; preds = %._crit_edge197, %._crit_edge191, %._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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #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" }
attributes #2 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !7, i64 8}
!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 = !{!6, !7, i64 12}
!11 = !{!6, !7, i64 16}
!12 = !{!13, !7, i64 36}
!13 = !{!"_ZTS7GVertex", !6, i64 0, !7, i64 36, !7, i64 40, !14, i64 44, !14, i64 60, !14, i64 76, !14, i64 92, !14, i64 108, !15, i64 124}
!14 = !{!"_ZTS7GVector", !8, i64 0}
!15 = !{!"_ZTS5Flags", !7, i64 0}
!16 = !{!13, !7, i64 40}
!17 = distinct !{!17, !18}
!18 = !{!"llvm.loop.mustprogress"}
!19 = !{!20, !7, i64 164}
!20 = !{!"_ZTS3Mug", !13, i64 0, !13, i64 128}
!21 = distinct !{!21, !18}
!22 = distinct !{!22, !18}
!23 = !{!20, !7, i64 36}
!24 = distinct !{!24, !18}
!25 = distinct !{!25, !18}
!26 = distinct !{!26, !18}
!27 = !{!28, !28, i64 0}
!28 = !{!"any pointer", !8, i64 0}
!29 = !{!7, !7, i64 0}
!30 = distinct !{!30, !18, !31, !32}
!31 = !{!"llvm.loop.isvectorized", i32 1}
!32 = !{!"llvm.loop.unroll.runtime.disable"}
!33 = distinct !{!33, !18, !32, !31}
!34 = distinct !{!34, !18}


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