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

; 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_55512FillPoly_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, 3
  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, 3
  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, 3
  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, 0
  %71 = load i32, ptr %12, align 4, !tbaa !9
  %72 = shl i32 %71, 5
  %73 = or i32 %70, %72
  %74 = load i32, ptr %11, align 4, !tbaa !9
  %75 = shl i32 %74, 10
  %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 %401

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 %401

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 = %397, %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 %400

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 i16, 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 %392

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 = trunc i32 %388 to i16
  %390 = load ptr, ptr %8, align 8, !tbaa !5
  %391 = getelementptr inbounds i16, ptr %390, i32 1
  store ptr %391, ptr %8, align 8, !tbaa !5
  store i16 %389, ptr %390, align 2, !tbaa !30
  br label %380, !llvm.loop !32

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

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

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

401:                                              ; preds = %400, %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
  %402 = load i32, ptr %26, align 4
  switch i32 %402, label %404 [
    i32 0, label %403
    i32 1, label %403
  ]

403:                                              ; preds = %401, %401
  ret void

404:                                              ; preds = %401
  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 = !{!31, !31, i64 0}
!31 = !{!"short", !7, i64 0}
!32 = distinct !{!32, !21}
!33 = distinct !{!33, !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_55512FillPoly_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 = lshr i32 %9, 3
  %11 = shl i32 %6, 2
  %12 = and i32 %11, 65504
  %13 = shl i32 %spec.select, 7
  %14 = and i32 %13, 64512
  %15 = or i32 %12, %14
  %16 = or i32 %15, %10
  %17 = tail call noundef i32 @_ZN8GPolygon4SizeEv(ptr noundef nonnull align 8 dereferenceable(808) @_ZN13PolygonEngine3_p1E)
  %18 = icmp slt i32 %17, 2
  br i1 %18, label %.loopexit, label %.preheader156

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

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

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

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

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

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

._crit_edge:                                      ; preds = %75
  %79 = icmp sgt i32 %56, 0
  %80 = icmp eq i32 %66, %76
  br i1 %80, label %.loopexit, label %.preheader155

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

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

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

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

.lr.ph175:                                        ; preds = %.preheader153
  %118 = shl nuw i32 %103, 1
  %119 = sext i32 %96 to i64
  %120 = sext i32 %102 to i64
  br label %132

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

.lr.ph188:                                        ; preds = %.preheader
  %121 = shl nuw i32 %103, 1
  %122 = sext i32 %96 to i64
  %123 = sext i32 %102 to i64
  br label %124

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

.lr.ph179:                                        ; preds = %124, %.lr.ph179
  %.1120177 = phi i32 [ %128, %.lr.ph179 ], [ %.0119187, %124 ]
  %.1124176 = phi i32 [ %127, %.lr.ph179 ], [ %.0123185, %124 ]
  %127 = add nsw i32 %.1124176, %112
  %128 = sub nsw i32 %.1120177, %121
  %129 = icmp sgt i32 %128, -1
  br i1 %129, label %.lr.ph179, label %._crit_edge180, !llvm.loop !21

._crit_edge180:                                   ; preds = %.lr.ph179, %124
  %.1124.lcssa = phi i32 [ %.0123185, %124 ], [ %127, %.lr.ph179 ]
  %.1120.lcssa = phi i32 [ %.0119187, %124 ], [ %128, %.lr.ph179 ]
  %130 = add nsw i32 %.1120.lcssa, %114
  %131 = add nuw i32 %.0121186, 1
  %exitcond214.not = icmp eq i32 %.0121186, %103
  br i1 %exitcond214.not, label %.loopexit152, label %124, !llvm.loop !22

132:                                              ; preds = %.lr.ph175, %._crit_edge167
  %indvars.iv = phi i64 [ %119, %.lr.ph175 ], [ %indvars.iv.next, %._crit_edge167 ]
  %.2174 = phi i32 [ %115, %.lr.ph175 ], [ %138, %._crit_edge167 ]
  %.1122173 = phi i32 [ 0, %.lr.ph175 ], [ %139, %._crit_edge167 ]
  %.2125172 = phi i32 [ %106, %.lr.ph175 ], [ %.3126.lcssa, %._crit_edge167 ]
  %133 = getelementptr inbounds [1024 x %class.Mug], ptr @_ZN13PolygonEngine4_mugE, i64 0, i64 %indvars.iv, i32 0, i32 1
  store i32 %.2125172, ptr %133, align 4, !tbaa !23
  %indvars.iv.next = add nsw i64 %indvars.iv, %120
  %134 = icmp sgt i32 %.2174, -1
  br i1 %134, label %.lr.ph166, label %._crit_edge167

.lr.ph166:                                        ; preds = %132, %.lr.ph166
  %.3164 = phi i32 [ %136, %.lr.ph166 ], [ %.2174, %132 ]
  %.3126163 = phi i32 [ %135, %.lr.ph166 ], [ %.2125172, %132 ]
  %135 = add nsw i32 %.3126163, %112
  %136 = sub nsw i32 %.3164, %118
  %137 = icmp sgt i32 %136, -1
  br i1 %137, label %.lr.ph166, label %._crit_edge167, !llvm.loop !24

._crit_edge167:                                   ; preds = %.lr.ph166, %132
  %.3126.lcssa = phi i32 [ %.2125172, %132 ], [ %135, %.lr.ph166 ]
  %.3.lcssa = phi i32 [ %.2174, %132 ], [ %136, %.lr.ph166 ]
  %138 = add nsw i32 %.3.lcssa, %114
  %139 = add nuw i32 %.1122173, 1
  %exitcond.not = icmp eq i32 %.1122173, %103
  br i1 %exitcond.not, label %.loopexit152, label %132, !llvm.loop !25

.loopexit152:                                     ; preds = %._crit_edge167, %._crit_edge180, %.preheader153, %.preheader, %.lr.ph190
  %140 = tail call noundef i32 @_ZN8GPolygon4SizeEv(ptr noundef nonnull align 8 dereferenceable(808) @_ZN13PolygonEngine3_p1E)
  %141 = icmp slt i32 %83, %140
  br i1 %141, 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

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

151:                                              ; preds = %.lr.ph202, %._crit_edge197
  %indvars.iv216 = phi i64 [ %149, %.lr.ph202 ], [ %indvars.iv.next217, %._crit_edge197 ]
  %.0128200 = phi ptr [ %146, %.lr.ph202 ], [ %167, %._crit_edge197 ]
  %152 = getelementptr inbounds [1024 x %class.Mug], ptr @_ZN13PolygonEngine4_mugE, i64 0, i64 %indvars.iv216
  %153 = getelementptr inbounds i8, ptr %152, i64 36
  %154 = load i32, ptr %153, align 4, !tbaa !23
  %155 = getelementptr inbounds i8, ptr %152, i64 164
  %156 = load i32, ptr %155, align 4, !tbaa !19
  %.not143192 = icmp sgt i32 %154, %156
  br i1 %.not143192, label %._crit_edge197, label %.lr.ph196.preheader

.lr.ph196.preheader:                              ; preds = %151
  %157 = sext i32 %154 to i64
  %158 = getelementptr inbounds i16, ptr %.0128200, i64 %157
  %159 = sub i32 %156, %154
  %160 = zext i32 %159 to i64
  %161 = add nuw nsw i64 %160, 1
  %min.iters.check = icmp ult i32 %159, 15
  br i1 %min.iters.check, label %.lr.ph196.preheader243, label %vector.ph

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

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

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

.lr.ph196:                                        ; preds = %.lr.ph196.preheader243, %.lr.ph196
  %.4194 = phi i32 [ %165, %.lr.ph196 ], [ %.4194.ph, %.lr.ph196.preheader243 ]
  %.0127193 = phi ptr [ %166, %.lr.ph196 ], [ %.0127193.ph, %.lr.ph196.preheader243 ]
  %165 = add i32 %.4194, 1
  %166 = getelementptr inbounds i8, ptr %.0127193, i64 2
  store i16 %147, ptr %.0127193, align 2, !tbaa !30
  %exitcond215.not = icmp eq i32 %.4194, %156
  br i1 %exitcond215.not, label %._crit_edge197, label %.lr.ph196, !llvm.loop !35

._crit_edge197:                                   ; preds = %.lr.ph196, %middle.block, %151
  %167 = getelementptr inbounds i8, ptr %.0128200, i64 %148
  %indvars.iv.next217 = add nsw i64 %indvars.iv216, 1
  %lftr.wideiv = trunc i64 %indvars.iv.next217 to i32
  %exitcond219.not = icmp eq i32 %150, %lftr.wideiv
  br i1 %exitcond219.not, label %.loopexit, label %151, !llvm.loop !36

.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 = !{!31, !31, i64 0}
!31 = !{!"short", !8, i64 0}
!32 = distinct !{!32, !18, !33, !34}
!33 = !{!"llvm.loop.isvectorized", i32 1}
!34 = !{!"llvm.loop.unroll.runtime.disable"}
!35 = distinct !{!35, !18, !34, !33}
!36 = distinct !{!36, !18}


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