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

; 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 }
%struct.PixelValue = type { i8, i8, i8 }

@_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 @_ZN16PolygonEngine_2412FillPoly_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) #4
  store i32 1000, ptr %3, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #4
  store i32 -1, ptr %4, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #4
  store i32 0, ptr %10, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #4
  %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) #4
  %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) #4
  %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) #4
  %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, 8
  %73 = or i32 %70, %72
  %74 = load i32, ptr %11, align 4, !tbaa !9
  %75 = shl i32 %74, 16
  %76 = or i32 %73, %75
  store i32 %76, ptr %14, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #4
  %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 %399

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) #4
  %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) #4
  %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) #4
  %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) #4
  %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) #4
  %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) #4
  %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) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %31) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %30) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %29) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %28) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #4
  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 %399

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 = %395, %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 %398

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 %struct.PixelValue, 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 %390

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 ptr, ptr %8, align 8, !tbaa !5
  %389 = getelementptr inbounds %struct.PixelValue, ptr %388, i32 1
  store ptr %389, ptr %8, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %388, ptr align 4 %14, i64 3, i1 false), !tbaa.struct !30
  br label %380, !llvm.loop !32

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

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

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

399:                                              ; preds = %398, %185, %79
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #4
  %400 = load i32, ptr %26, align 4
  switch i32 %400, label %402 [
    i32 0, label %401
    i32 1, label %401
  ]

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

402:                                              ; preds = %399
  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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #3

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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { 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 = !{i64 0, i64 1, !31, i64 1, i64 1, !31, i64 2, i64 1, !31}
!31 = !{!7, !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 }
%struct.PixelValue = type { i8, i8, i8 }

@_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 @_ZN16PolygonEngine_2412FillPoly_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 %6, 8
  %11 = shl i32 %spec.select, 16
  %12 = or i32 %10, %11
  %13 = or i32 %12, %9
  %14 = tail call noundef i32 @_ZN8GPolygon4SizeEv(ptr noundef nonnull align 8 dereferenceable(808) @_ZN13PolygonEngine3_p1E)
  %15 = icmp slt i32 %14, 2
  br i1 %15, label %.loopexit, label %.preheader156

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

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

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

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

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

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

._crit_edge:                                      ; preds = %72
  %76 = icmp sgt i32 %53, 0
  %77 = icmp eq i32 %63, %73
  br i1 %77, label %.loopexit, label %.preheader155

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

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

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

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

.lr.ph175:                                        ; preds = %.preheader153
  %115 = shl nuw i32 %100, 1
  %116 = sext i32 %93 to i64
  %117 = sext i32 %99 to i64
  br label %129

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

.lr.ph188:                                        ; preds = %.preheader
  %118 = shl nuw i32 %100, 1
  %119 = sext i32 %93 to i64
  %120 = sext i32 %99 to i64
  br label %121

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

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

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

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

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

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

.loopexit152:                                     ; preds = %._crit_edge167, %._crit_edge180, %.preheader153, %.preheader, %.lr.ph190
  %137 = tail call noundef i32 @_ZN8GPolygon4SizeEv(ptr noundef nonnull align 8 dereferenceable(808) @_ZN13PolygonEngine3_p1E)
  %138 = icmp slt i32 %80, %137
  br i1 %138, 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
  %139 = load ptr, ptr @_ZN16GraphicComponent10_graph_memE, align 8, !tbaa !27
  %140 = load i32, ptr @_ZN16GraphicComponent15_bytes_per_lineE, align 4, !tbaa !29
  %141 = mul nsw i32 %140, %.0.lcssa225
  %142 = sext i32 %141 to i64
  %143 = getelementptr inbounds i8, ptr %139, i64 %142
  %.0.extract.trunc = trunc i32 %13 to i24
  %144 = sext i32 %.0.lcssa225 to i64
  %145 = add i32 %.0114.lcssa224, 1
  br label %146

146:                                              ; preds = %.lr.ph202, %._crit_edge197
  %147 = phi i32 [ %140, %.lr.ph202 ], [ %171, %._crit_edge197 ]
  %indvars.iv216 = phi i64 [ %144, %.lr.ph202 ], [ %indvars.iv.next217, %._crit_edge197 ]
  %.0128200 = phi ptr [ %143, %.lr.ph202 ], [ %173, %._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 = %146
  %153 = sext i32 %150 to i64
  %154 = getelementptr inbounds %struct.PixelValue, ptr %.0128200, i64 %153
  %155 = add i32 %152, 1
  %156 = sub i32 %155, %150
  %157 = sub i32 %152, %150
  %xtraiter = and i32 %156, 7
  %lcmp.mod.not = icmp eq i32 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.lr.ph196.prol.loopexit, label %.lr.ph196.prol

.lr.ph196.prol:                                   ; preds = %.lr.ph196.preheader, %.lr.ph196.prol
  %.4194.prol = phi i32 [ %158, %.lr.ph196.prol ], [ %150, %.lr.ph196.preheader ]
  %.0127193.prol = phi ptr [ %159, %.lr.ph196.prol ], [ %154, %.lr.ph196.preheader ]
  %prol.iter = phi i32 [ %prol.iter.next, %.lr.ph196.prol ], [ 0, %.lr.ph196.preheader ]
  %158 = add i32 %.4194.prol, 1
  %159 = getelementptr inbounds i8, ptr %.0127193.prol, i64 3
  store i24 %.0.extract.trunc, ptr %.0127193.prol, align 1
  %prol.iter.next = add i32 %prol.iter, 1
  %prol.iter.cmp.not = icmp eq i32 %prol.iter.next, %xtraiter
  br i1 %prol.iter.cmp.not, label %.lr.ph196.prol.loopexit, label %.lr.ph196.prol, !llvm.loop !30

.lr.ph196.prol.loopexit:                          ; preds = %.lr.ph196.prol, %.lr.ph196.preheader
  %.4194.unr = phi i32 [ %150, %.lr.ph196.preheader ], [ %158, %.lr.ph196.prol ]
  %.0127193.unr = phi ptr [ %154, %.lr.ph196.preheader ], [ %159, %.lr.ph196.prol ]
  %160 = icmp ult i32 %157, 7
  br i1 %160, label %._crit_edge197.loopexit, label %.lr.ph196

.lr.ph196:                                        ; preds = %.lr.ph196.prol.loopexit, %.lr.ph196
  %.4194 = phi i32 [ %169, %.lr.ph196 ], [ %.4194.unr, %.lr.ph196.prol.loopexit ]
  %.0127193 = phi ptr [ %170, %.lr.ph196 ], [ %.0127193.unr, %.lr.ph196.prol.loopexit ]
  %161 = getelementptr inbounds i8, ptr %.0127193, i64 3
  store i24 %.0.extract.trunc, ptr %.0127193, align 1
  %162 = getelementptr inbounds i8, ptr %.0127193, i64 6
  store i24 %.0.extract.trunc, ptr %161, align 1
  %163 = getelementptr inbounds i8, ptr %.0127193, i64 9
  store i24 %.0.extract.trunc, ptr %162, align 1
  %164 = getelementptr inbounds i8, ptr %.0127193, i64 12
  store i24 %.0.extract.trunc, ptr %163, align 1
  %165 = getelementptr inbounds i8, ptr %.0127193, i64 15
  store i24 %.0.extract.trunc, ptr %164, align 1
  %166 = getelementptr inbounds i8, ptr %.0127193, i64 18
  store i24 %.0.extract.trunc, ptr %165, align 1
  %167 = add i32 %.4194, 7
  %168 = getelementptr inbounds i8, ptr %.0127193, i64 21
  store i24 %.0.extract.trunc, ptr %166, align 1
  %169 = add i32 %.4194, 8
  %170 = getelementptr inbounds i8, ptr %.0127193, i64 24
  store i24 %.0.extract.trunc, ptr %168, align 1
  %exitcond215.not.7 = icmp eq i32 %167, %152
  br i1 %exitcond215.not.7, label %._crit_edge197.loopexit, label %.lr.ph196, !llvm.loop !32

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

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

.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, !31}
!31 = !{!"llvm.loop.unroll.disable"}
!32 = distinct !{!32, !18}
!33 = distinct !{!33, !18}


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