; 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
@_ZN16GraphicComponent13_truecolormapE = external global [256 x i32], align 16
@_ZN16GraphicProcessor2D4E = external global [16 x i32], align 16

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN17PolygonEngine_55512FillPoly_c_DEP17GVertexAttributes(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
  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
  %32 = load ptr, ptr %2, align 8, !tbaa !5
  %33 = getelementptr inbounds %class.GVertexAttributes, ptr %32, i32 0, i32 1
  %34 = load i32, ptr %33, align 4, !tbaa !11
  store i32 %34, ptr %11, align 4, !tbaa !9
  %35 = load i32, ptr %11, align 4, !tbaa !9
  %36 = icmp sgt i32 %35, 4080
  br i1 %36, label %37, label %38

37:                                               ; preds = %1
  br label %40

38:                                               ; preds = %1
  %39 = load i32, ptr %11, align 4, !tbaa !9
  br label %40

40:                                               ; preds = %38, %37
  %41 = phi i32 [ 4080, %37 ], [ %39, %38 ]
  store i32 %41, ptr %11, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #3
  %42 = load i32, ptr %11, align 4, !tbaa !9
  %43 = ashr i32 %42, 4
  store i32 %43, ptr %12, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #3
  %44 = load i32, ptr %11, align 4, !tbaa !9
  %45 = and i32 %44, 15
  store i32 %45, ptr %13, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #3
  %46 = call noundef i32 @_ZN8GPolygon4SizeEv(ptr noundef nonnull align 8 dereferenceable(808) @_ZN13PolygonEngine3_p1E)
  %47 = icmp slt i32 %46, 2
  br i1 %47, label %48, label %49

48:                                               ; preds = %40
  store i32 1, ptr %25, align 4
  br label %395

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

50:                                               ; preds = %144, %49
  %51 = load i32, ptr %5, align 4, !tbaa !9
  %52 = call noundef i32 @_ZN8GPolygon4SizeEv(ptr noundef nonnull align 8 dereferenceable(808) @_ZN13PolygonEngine3_p1E)
  %53 = icmp slt i32 %51, %52
  br i1 %53, label %54, label %147

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

60:                                               ; preds = %54
  store i32 0, ptr %26, align 4, !tbaa !9
  br label %61

61:                                               ; preds = %60, %54
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #3
  %62 = load i32, ptr %26, align 4, !tbaa !9
  %63 = add nsw i32 %62, 1
  store i32 %63, ptr %27, align 4, !tbaa !9
  %64 = load i32, ptr %27, align 4, !tbaa !9
  %65 = call noundef i32 @_ZN8GPolygon4SizeEv(ptr noundef nonnull align 8 dereferenceable(808) @_ZN13PolygonEngine3_p1E)
  %66 = icmp eq i32 %64, %65
  br i1 %66, label %67, label %68

67:                                               ; preds = %61
  store i32 0, ptr %27, align 4, !tbaa !9
  br label %68

68:                                               ; preds = %67, %61
  call void @llvm.lifetime.start.p0(i64 4, ptr %28) #3
  %69 = load i32, ptr %5, align 4, !tbaa !9
  %70 = call noundef ptr @_ZN8GPolygonixEi(ptr noundef nonnull align 8 dereferenceable(808) @_ZN13PolygonEngine3_p1E, i32 noundef %69)
  %71 = getelementptr inbounds %class.GVertex, ptr %70, i32 0, i32 1
  %72 = load i32, ptr %71, align 4, !tbaa !13
  %73 = load i32, ptr %26, align 4, !tbaa !9
  %74 = call noundef ptr @_ZN8GPolygonixEi(ptr noundef nonnull align 8 dereferenceable(808) @_ZN13PolygonEngine3_p1E, i32 noundef %73)
  %75 = getelementptr inbounds %class.GVertex, ptr %74, i32 0, i32 1
  %76 = load i32, ptr %75, align 4, !tbaa !13
  %77 = sub nsw i32 %72, %76
  store i32 %77, ptr %28, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %29) #3
  %78 = load i32, ptr %5, align 4, !tbaa !9
  %79 = call noundef ptr @_ZN8GPolygonixEi(ptr noundef nonnull align 8 dereferenceable(808) @_ZN13PolygonEngine3_p1E, i32 noundef %78)
  %80 = getelementptr inbounds %class.GVertex, ptr %79, i32 0, i32 2
  %81 = load i32, ptr %80, align 4, !tbaa !17
  %82 = load i32, ptr %26, align 4, !tbaa !9
  %83 = call noundef ptr @_ZN8GPolygonixEi(ptr noundef nonnull align 8 dereferenceable(808) @_ZN13PolygonEngine3_p1E, i32 noundef %82)
  %84 = getelementptr inbounds %class.GVertex, ptr %83, i32 0, i32 2
  %85 = load i32, ptr %84, align 4, !tbaa !17
  %86 = sub nsw i32 %81, %85
  store i32 %86, ptr %29, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %30) #3
  %87 = load i32, ptr %27, align 4, !tbaa !9
  %88 = call noundef ptr @_ZN8GPolygonixEi(ptr noundef nonnull align 8 dereferenceable(808) @_ZN13PolygonEngine3_p1E, i32 noundef %87)
  %89 = getelementptr inbounds %class.GVertex, ptr %88, i32 0, i32 1
  %90 = load i32, ptr %89, align 4, !tbaa !13
  %91 = load i32, ptr %26, align 4, !tbaa !9
  %92 = call noundef ptr @_ZN8GPolygonixEi(ptr noundef nonnull align 8 dereferenceable(808) @_ZN13PolygonEngine3_p1E, i32 noundef %91)
  %93 = getelementptr inbounds %class.GVertex, ptr %92, i32 0, i32 1
  %94 = load i32, ptr %93, align 4, !tbaa !13
  %95 = sub nsw i32 %90, %94
  store i32 %95, ptr %30, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %31) #3
  %96 = load i32, ptr %27, align 4, !tbaa !9
  %97 = call noundef ptr @_ZN8GPolygonixEi(ptr noundef nonnull align 8 dereferenceable(808) @_ZN13PolygonEngine3_p1E, i32 noundef %96)
  %98 = getelementptr inbounds %class.GVertex, ptr %97, i32 0, i32 2
  %99 = load i32, ptr %98, align 4, !tbaa !17
  %100 = load i32, ptr %26, 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 2
  %103 = load i32, ptr %102, align 4, !tbaa !17
  %104 = sub nsw i32 %99, %103
  store i32 %104, ptr %31, align 4, !tbaa !9
  %105 = load i32, ptr %28, align 4, !tbaa !9
  %106 = load i32, ptr %31, align 4, !tbaa !9
  %107 = mul nsw i32 %105, %106
  %108 = load i32, ptr %30, align 4, !tbaa !9
  %109 = load i32, ptr %29, align 4, !tbaa !9
  %110 = mul nsw i32 %108, %109
  %111 = sub nsw i32 %107, %110
  %112 = load i32, ptr %10, align 4, !tbaa !9
  %113 = add nsw i32 %112, %111
  store i32 %113, ptr %10, align 4, !tbaa !9
  %114 = load i32, ptr %3, align 4, !tbaa !9
  %115 = load i32, ptr %5, align 4, !tbaa !9
  %116 = call noundef ptr @_ZN8GPolygonixEi(ptr noundef nonnull align 8 dereferenceable(808) @_ZN13PolygonEngine3_p1E, i32 noundef %115)
  %117 = getelementptr inbounds %class.GVertex, ptr %116, i32 0, i32 2
  %118 = load i32, ptr %117, align 4, !tbaa !17
  %119 = icmp slt i32 %114, %118
  br i1 %119, label %120, label %122

120:                                              ; preds = %68
  %121 = load i32, ptr %3, align 4, !tbaa !9
  br label %127

122:                                              ; preds = %68
  %123 = load i32, ptr %5, align 4, !tbaa !9
  %124 = call noundef ptr @_ZN8GPolygonixEi(ptr noundef nonnull align 8 dereferenceable(808) @_ZN13PolygonEngine3_p1E, i32 noundef %123)
  %125 = getelementptr inbounds %class.GVertex, ptr %124, i32 0, i32 2
  %126 = load i32, ptr %125, align 4, !tbaa !17
  br label %127

127:                                              ; preds = %122, %120
  %128 = phi i32 [ %121, %120 ], [ %126, %122 ]
  store i32 %128, ptr %3, align 4, !tbaa !9
  %129 = load i32, ptr %4, align 4, !tbaa !9
  %130 = load i32, ptr %5, align 4, !tbaa !9
  %131 = call noundef ptr @_ZN8GPolygonixEi(ptr noundef nonnull align 8 dereferenceable(808) @_ZN13PolygonEngine3_p1E, i32 noundef %130)
  %132 = getelementptr inbounds %class.GVertex, ptr %131, i32 0, i32 2
  %133 = load i32, ptr %132, align 4, !tbaa !17
  %134 = icmp sgt i32 %129, %133
  br i1 %134, label %135, label %137

135:                                              ; preds = %127
  %136 = load i32, ptr %4, align 4, !tbaa !9
  br label %142

137:                                              ; preds = %127
  %138 = load i32, ptr %5, align 4, !tbaa !9
  %139 = call noundef ptr @_ZN8GPolygonixEi(ptr noundef nonnull align 8 dereferenceable(808) @_ZN13PolygonEngine3_p1E, i32 noundef %138)
  %140 = getelementptr inbounds %class.GVertex, ptr %139, i32 0, i32 2
  %141 = load i32, ptr %140, align 4, !tbaa !17
  br label %142

142:                                              ; preds = %137, %135
  %143 = phi i32 [ %136, %135 ], [ %141, %137 ]
  store i32 %143, ptr %4, align 4, !tbaa !9
  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
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #3
  br label %144

144:                                              ; preds = %142
  %145 = load i32, ptr %5, align 4, !tbaa !9
  %146 = add nsw i32 %145, 1
  store i32 %146, ptr %5, align 4, !tbaa !9
  br label %50, !llvm.loop !18

147:                                              ; preds = %50
  %148 = load i32, ptr %10, align 4, !tbaa !9
  %149 = icmp sgt i32 %148, 0
  %150 = zext i1 %149 to i32
  store i32 %150, ptr %10, align 4, !tbaa !9
  %151 = load i32, ptr %3, align 4, !tbaa !9
  %152 = load i32, ptr %4, align 4, !tbaa !9
  %153 = icmp eq i32 %151, %152
  br i1 %153, label %154, label %155

154:                                              ; preds = %147
  store i32 1, ptr %25, align 4
  br label %395

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

156:                                              ; preds = %311, %155
  %157 = load i32, ptr %5, align 4, !tbaa !9
  %158 = call noundef i32 @_ZN8GPolygon4SizeEv(ptr noundef nonnull align 8 dereferenceable(808) @_ZN13PolygonEngine3_p1E)
  %159 = icmp slt i32 %157, %158
  br i1 %159, label %160, label %314

160:                                              ; preds = %156
  %161 = load i32, ptr %5, align 4, !tbaa !9
  %162 = add nsw i32 %161, 1
  store i32 %162, ptr %6, align 4, !tbaa !9
  %163 = load i32, ptr %6, align 4, !tbaa !9
  %164 = call noundef i32 @_ZN8GPolygon4SizeEv(ptr noundef nonnull align 8 dereferenceable(808) @_ZN13PolygonEngine3_p1E)
  %165 = icmp eq i32 %163, %164
  br i1 %165, label %166, label %167

166:                                              ; preds = %160
  store i32 0, ptr %6, align 4, !tbaa !9
  br label %167

167:                                              ; preds = %166, %160
  %168 = load i32, ptr %5, align 4, !tbaa !9
  %169 = call noundef ptr @_ZN8GPolygonixEi(ptr noundef nonnull align 8 dereferenceable(808) @_ZN13PolygonEngine3_p1E, i32 noundef %168)
  %170 = getelementptr inbounds %class.GVertex, ptr %169, i32 0, i32 2
  %171 = load i32, ptr %170, align 4, !tbaa !17
  %172 = load i32, ptr %6, align 4, !tbaa !9
  %173 = call noundef ptr @_ZN8GPolygonixEi(ptr noundef nonnull align 8 dereferenceable(808) @_ZN13PolygonEngine3_p1E, i32 noundef %172)
  %174 = getelementptr inbounds %class.GVertex, ptr %173, i32 0, i32 2
  %175 = load i32, ptr %174, align 4, !tbaa !17
  %176 = icmp eq i32 %171, %175
  br i1 %176, label %177, label %178

177:                                              ; preds = %167
  br label %311

178:                                              ; preds = %167
  %179 = load i32, ptr %5, align 4, !tbaa !9
  %180 = call noundef ptr @_ZN8GPolygonixEi(ptr noundef nonnull align 8 dereferenceable(808) @_ZN13PolygonEngine3_p1E, i32 noundef %179)
  %181 = getelementptr inbounds %class.GVertex, ptr %180, i32 0, i32 2
  %182 = load i32, ptr %181, align 4, !tbaa !17
  store i32 %182, ptr %15, align 4, !tbaa !9
  %183 = load i32, ptr %6, align 4, !tbaa !9
  %184 = call noundef ptr @_ZN8GPolygonixEi(ptr noundef nonnull align 8 dereferenceable(808) @_ZN13PolygonEngine3_p1E, i32 noundef %183)
  %185 = getelementptr inbounds %class.GVertex, ptr %184, i32 0, i32 2
  %186 = load i32, ptr %185, align 4, !tbaa !17
  store i32 %186, ptr %16, align 4, !tbaa !9
  %187 = load i32, ptr %16, align 4, !tbaa !9
  %188 = load i32, ptr %15, align 4, !tbaa !9
  %189 = sub nsw i32 %187, %188
  store i32 %189, ptr %17, align 4, !tbaa !9
  %190 = load i32, ptr %17, align 4, !tbaa !9
  %191 = icmp sgt i32 %190, 0
  br i1 %191, label %192, label %193

192:                                              ; preds = %178
  br label %198

193:                                              ; preds = %178
  %194 = load i32, ptr %17, align 4, !tbaa !9
  %195 = icmp ne i32 %194, 0
  %196 = zext i1 %195 to i64
  %197 = select i1 %195, i32 -1, i32 0
  br label %198

198:                                              ; preds = %193, %192
  %199 = phi i32 [ 1, %192 ], [ %197, %193 ]
  store i32 %199, ptr %18, align 4, !tbaa !9
  %200 = load i32, ptr %18, align 4, !tbaa !9
  %201 = load i32, ptr %17, align 4, !tbaa !9
  %202 = mul nsw i32 %201, %200
  store i32 %202, ptr %17, align 4, !tbaa !9
  %203 = load i32, ptr %15, align 4, !tbaa !9
  store i32 %203, ptr %14, align 4, !tbaa !9
  %204 = load i32, ptr %5, align 4, !tbaa !9
  %205 = call noundef ptr @_ZN8GPolygonixEi(ptr noundef nonnull align 8 dereferenceable(808) @_ZN13PolygonEngine3_p1E, i32 noundef %204)
  %206 = getelementptr inbounds %class.GVertex, ptr %205, i32 0, i32 1
  %207 = load i32, ptr %206, align 4, !tbaa !13
  store i32 %207, ptr %20, align 4, !tbaa !9
  %208 = load i32, ptr %6, align 4, !tbaa !9
  %209 = call noundef ptr @_ZN8GPolygonixEi(ptr noundef nonnull align 8 dereferenceable(808) @_ZN13PolygonEngine3_p1E, i32 noundef %208)
  %210 = getelementptr inbounds %class.GVertex, ptr %209, i32 0, i32 1
  %211 = load i32, ptr %210, align 4, !tbaa !13
  store i32 %211, ptr %21, align 4, !tbaa !9
  %212 = load i32, ptr %21, align 4, !tbaa !9
  %213 = load i32, ptr %20, align 4, !tbaa !9
  %214 = sub nsw i32 %212, %213
  store i32 %214, ptr %22, align 4, !tbaa !9
  %215 = load i32, ptr %22, align 4, !tbaa !9
  %216 = icmp sgt i32 %215, 0
  br i1 %216, label %217, label %218

217:                                              ; preds = %198
  br label %223

218:                                              ; preds = %198
  %219 = load i32, ptr %22, align 4, !tbaa !9
  %220 = icmp ne i32 %219, 0
  %221 = zext i1 %220 to i64
  %222 = select i1 %220, i32 -1, i32 0
  br label %223

223:                                              ; preds = %218, %217
  %224 = phi i32 [ 1, %217 ], [ %222, %218 ]
  store i32 %224, ptr %23, align 4, !tbaa !9
  %225 = load i32, ptr %23, align 4, !tbaa !9
  %226 = load i32, ptr %22, align 4, !tbaa !9
  %227 = mul nsw i32 %226, %225
  store i32 %227, ptr %22, align 4, !tbaa !9
  %228 = load i32, ptr %22, align 4, !tbaa !9
  %229 = shl i32 %228, 1
  %230 = load i32, ptr %17, align 4, !tbaa !9
  %231 = sub nsw i32 %229, %230
  store i32 %231, ptr %24, align 4, !tbaa !9
  %232 = load i32, ptr %20, align 4, !tbaa !9
  store i32 %232, ptr %19, align 4, !tbaa !9
  %233 = load i32, ptr %10, align 4, !tbaa !9
  %234 = load i32, ptr %16, align 4, !tbaa !9
  %235 = load i32, ptr %15, align 4, !tbaa !9
  %236 = icmp sgt i32 %234, %235
  %237 = zext i1 %236 to i32
  %238 = xor i32 %233, %237
  %239 = icmp ne i32 %238, 0
  br i1 %239, label %240, label %275

240:                                              ; preds = %223
  store i32 0, ptr %7, align 4, !tbaa !9
  br label %241

241:                                              ; preds = %271, %240
  %242 = load i32, ptr %7, align 4, !tbaa !9
  %243 = load i32, ptr %17, align 4, !tbaa !9
  %244 = icmp sle i32 %242, %243
  br i1 %244, label %245, label %274

245:                                              ; preds = %241
  %246 = load i32, ptr %19, align 4, !tbaa !9
  %247 = load i32, ptr %14, align 4, !tbaa !9
  %248 = sext i32 %247 to i64
  %249 = getelementptr inbounds [1024 x %class.Mug], ptr @_ZN13PolygonEngine4_mugE, i64 0, i64 %248
  %250 = getelementptr inbounds %class.Mug, ptr %249, i32 0, i32 1
  %251 = getelementptr inbounds %class.GVertex, ptr %250, i32 0, i32 1
  store i32 %246, ptr %251, align 4, !tbaa !20
  %252 = load i32, ptr %18, align 4, !tbaa !9
  %253 = load i32, ptr %14, align 4, !tbaa !9
  %254 = add nsw i32 %253, %252
  store i32 %254, ptr %14, align 4, !tbaa !9
  br label %255

255:                                              ; preds = %258, %245
  %256 = load i32, ptr %24, align 4, !tbaa !9
  %257 = icmp sge i32 %256, 0
  br i1 %257, label %258, label %266

258:                                              ; preds = %255
  %259 = load i32, ptr %23, align 4, !tbaa !9
  %260 = load i32, ptr %19, align 4, !tbaa !9
  %261 = add nsw i32 %260, %259
  store i32 %261, ptr %19, align 4, !tbaa !9
  %262 = load i32, ptr %17, align 4, !tbaa !9
  %263 = shl i32 %262, 1
  %264 = load i32, ptr %24, align 4, !tbaa !9
  %265 = sub nsw i32 %264, %263
  store i32 %265, ptr %24, align 4, !tbaa !9
  br label %255, !llvm.loop !22

266:                                              ; preds = %255
  %267 = load i32, ptr %22, align 4, !tbaa !9
  %268 = shl i32 %267, 1
  %269 = load i32, ptr %24, align 4, !tbaa !9
  %270 = add nsw i32 %269, %268
  store i32 %270, ptr %24, align 4, !tbaa !9
  br label %271

271:                                              ; preds = %266
  %272 = load i32, ptr %7, align 4, !tbaa !9
  %273 = add nsw i32 %272, 1
  store i32 %273, ptr %7, align 4, !tbaa !9
  br label %241, !llvm.loop !23

274:                                              ; preds = %241
  br label %310

275:                                              ; preds = %223
  store i32 0, ptr %7, align 4, !tbaa !9
  br label %276

276:                                              ; preds = %306, %275
  %277 = load i32, ptr %7, align 4, !tbaa !9
  %278 = load i32, ptr %17, align 4, !tbaa !9
  %279 = icmp sle i32 %277, %278
  br i1 %279, label %280, label %309

280:                                              ; preds = %276
  %281 = load i32, ptr %19, align 4, !tbaa !9
  %282 = load i32, ptr %14, align 4, !tbaa !9
  %283 = sext i32 %282 to i64
  %284 = getelementptr inbounds [1024 x %class.Mug], ptr @_ZN13PolygonEngine4_mugE, i64 0, i64 %283
  %285 = getelementptr inbounds %class.Mug, ptr %284, i32 0, i32 0
  %286 = getelementptr inbounds %class.GVertex, ptr %285, i32 0, i32 1
  store i32 %281, ptr %286, align 4, !tbaa !24
  %287 = load i32, ptr %18, align 4, !tbaa !9
  %288 = load i32, ptr %14, align 4, !tbaa !9
  %289 = add nsw i32 %288, %287
  store i32 %289, ptr %14, align 4, !tbaa !9
  br label %290

290:                                              ; preds = %293, %280
  %291 = load i32, ptr %24, align 4, !tbaa !9
  %292 = icmp sge i32 %291, 0
  br i1 %292, label %293, label %301

293:                                              ; preds = %290
  %294 = load i32, ptr %23, align 4, !tbaa !9
  %295 = load i32, ptr %19, align 4, !tbaa !9
  %296 = add nsw i32 %295, %294
  store i32 %296, ptr %19, align 4, !tbaa !9
  %297 = load i32, ptr %17, align 4, !tbaa !9
  %298 = shl i32 %297, 1
  %299 = load i32, ptr %24, align 4, !tbaa !9
  %300 = sub nsw i32 %299, %298
  store i32 %300, ptr %24, align 4, !tbaa !9
  br label %290, !llvm.loop !25

301:                                              ; preds = %290
  %302 = load i32, ptr %22, align 4, !tbaa !9
  %303 = shl i32 %302, 1
  %304 = load i32, ptr %24, align 4, !tbaa !9
  %305 = add nsw i32 %304, %303
  store i32 %305, ptr %24, align 4, !tbaa !9
  br label %306

306:                                              ; preds = %301
  %307 = load i32, ptr %7, align 4, !tbaa !9
  %308 = add nsw i32 %307, 1
  store i32 %308, ptr %7, align 4, !tbaa !9
  br label %276, !llvm.loop !26

309:                                              ; preds = %276
  br label %310

310:                                              ; preds = %309, %274
  br label %311

311:                                              ; preds = %310, %177
  %312 = load i32, ptr %5, align 4, !tbaa !9
  %313 = add nsw i32 %312, 1
  store i32 %313, ptr %5, align 4, !tbaa !9
  br label %156, !llvm.loop !27

314:                                              ; preds = %156
  %315 = load ptr, ptr @_ZN16GraphicComponent10_graph_memE, align 8, !tbaa !5
  %316 = load i32, ptr %3, align 4, !tbaa !9
  %317 = load i32, ptr @_ZN16GraphicComponent15_bytes_per_lineE, align 4, !tbaa !9
  %318 = mul nsw i32 %316, %317
  %319 = sext i32 %318 to i64
  %320 = getelementptr inbounds i8, ptr %315, i64 %319
  store ptr %320, ptr %9, align 8, !tbaa !5
  %321 = load i32, ptr %3, align 4, !tbaa !9
  store i32 %321, ptr %14, align 4, !tbaa !9
  br label %322

322:                                              ; preds = %391, %314
  %323 = load i32, ptr %14, align 4, !tbaa !9
  %324 = load i32, ptr %4, align 4, !tbaa !9
  %325 = icmp sle i32 %323, %324
  br i1 %325, label %326, label %394

326:                                              ; preds = %322
  %327 = load i32, ptr %14, align 4, !tbaa !9
  %328 = sext i32 %327 to i64
  %329 = getelementptr inbounds [1024 x %class.Mug], ptr @_ZN13PolygonEngine4_mugE, i64 0, i64 %328
  %330 = getelementptr inbounds %class.Mug, ptr %329, i32 0, i32 0
  %331 = getelementptr inbounds %class.GVertex, ptr %330, i32 0, i32 1
  %332 = load i32, ptr %331, align 4, !tbaa !24
  store i32 %332, ptr %20, align 4, !tbaa !9
  %333 = load i32, ptr %14, align 4, !tbaa !9
  %334 = sext i32 %333 to i64
  %335 = getelementptr inbounds [1024 x %class.Mug], ptr @_ZN13PolygonEngine4_mugE, i64 0, i64 %334
  %336 = getelementptr inbounds %class.Mug, ptr %335, i32 0, i32 1
  %337 = getelementptr inbounds %class.GVertex, ptr %336, i32 0, i32 1
  %338 = load i32, ptr %337, align 4, !tbaa !20
  store i32 %338, ptr %21, align 4, !tbaa !9
  %339 = load i32, ptr %21, align 4, !tbaa !9
  %340 = load i32, ptr %20, align 4, !tbaa !9
  %341 = sub nsw i32 %339, %340
  %342 = add nsw i32 %341, 1
  store i32 %342, ptr %22, align 4, !tbaa !9
  %343 = load i32, ptr %20, align 4, !tbaa !9
  store i32 %343, ptr %19, align 4, !tbaa !9
  %344 = load ptr, ptr %9, align 8, !tbaa !5
  %345 = load i32, ptr %20, align 4, !tbaa !9
  %346 = sext i32 %345 to i64
  %347 = getelementptr inbounds i16, ptr %344, i64 %346
  store ptr %347, ptr %8, align 8, !tbaa !5
  %348 = load i32, ptr %20, align 4, !tbaa !9
  store i32 %348, ptr %19, align 4, !tbaa !9
  br label %349

349:                                              ; preds = %383, %326
  %350 = load i32, ptr %19, align 4, !tbaa !9
  %351 = load i32, ptr %21, align 4, !tbaa !9
  %352 = icmp sle i32 %350, %351
  br i1 %352, label %353, label %386

353:                                              ; preds = %349
  %354 = load i32, ptr %13, align 4, !tbaa !9
  %355 = load i32, ptr %19, align 4, !tbaa !9
  %356 = and i32 %355, 3
  %357 = load i32, ptr %14, align 4, !tbaa !9
  %358 = and i32 %357, 3
  %359 = shl i32 %358, 2
  %360 = add nsw i32 %356, %359
  %361 = sext i32 %360 to i64
  %362 = getelementptr inbounds [16 x i32], ptr @_ZN16GraphicProcessor2D4E, i64 0, i64 %361
  %363 = load i32, ptr %362, align 4, !tbaa !9
  %364 = icmp sgt i32 %354, %363
  br i1 %364, label %365, label %373

365:                                              ; preds = %353
  %366 = load i32, ptr %12, align 4, !tbaa !9
  %367 = add nsw i32 %366, 1
  %368 = sext i32 %367 to i64
  %369 = getelementptr inbounds [256 x i32], ptr @_ZN16GraphicComponent13_truecolormapE, i64 0, i64 %368
  %370 = load i32, ptr %369, align 4, !tbaa !9
  %371 = trunc i32 %370 to i16
  %372 = load ptr, ptr %8, align 8, !tbaa !5
  store i16 %371, ptr %372, align 2, !tbaa !28
  br label %380

373:                                              ; preds = %353
  %374 = load i32, ptr %12, align 4, !tbaa !9
  %375 = sext i32 %374 to i64
  %376 = getelementptr inbounds [256 x i32], ptr @_ZN16GraphicComponent13_truecolormapE, i64 0, i64 %375
  %377 = load i32, ptr %376, align 4, !tbaa !9
  %378 = trunc i32 %377 to i16
  %379 = load ptr, ptr %8, align 8, !tbaa !5
  store i16 %378, ptr %379, align 2, !tbaa !28
  br label %380

380:                                              ; preds = %373, %365
  %381 = load ptr, ptr %8, align 8, !tbaa !5
  %382 = getelementptr inbounds i16, ptr %381, i32 1
  store ptr %382, ptr %8, align 8, !tbaa !5
  br label %383

383:                                              ; preds = %380
  %384 = load i32, ptr %19, align 4, !tbaa !9
  %385 = add nsw i32 %384, 1
  store i32 %385, ptr %19, align 4, !tbaa !9
  br label %349, !llvm.loop !30

386:                                              ; preds = %349
  %387 = load ptr, ptr %9, align 8, !tbaa !5
  %388 = load i32, ptr @_ZN16GraphicComponent15_bytes_per_lineE, align 4, !tbaa !9
  %389 = sext i32 %388 to i64
  %390 = getelementptr inbounds i8, ptr %387, i64 %389
  store ptr %390, ptr %9, align 8, !tbaa !5
  br label %391

391:                                              ; preds = %386
  %392 = load i32, ptr %14, align 4, !tbaa !9
  %393 = add nsw i32 %392, 1
  store i32 %393, ptr %14, align 4, !tbaa !9
  br label %322, !llvm.loop !31

394:                                              ; preds = %322
  store i32 0, ptr %25, align 4
  br label %395

395:                                              ; preds = %394, %154, %48
  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
  %396 = load i32, ptr %25, align 4
  switch i32 %396, label %398 [
    i32 0, label %397
    i32 1, label %397
  ]

397:                                              ; preds = %395, %395
  ret void

398:                                              ; preds = %395
  unreachable
}

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

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

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

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

attributes #0 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }

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

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


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

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

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

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_ZN17PolygonEngine_55512FillPoly_c_DEP17GVertexAttributes(ptr nocapture noundef readonly %0) local_unnamed_addr #0 align 2 {
  %2 = getelementptr inbounds i8, ptr %0, i64 4
  %3 = load i32, ptr %2, align 4, !tbaa !5
  %4 = tail call i32 @llvm.smin.i32(i32 %3, i32 4080)
  %5 = ashr i32 %4, 4
  %6 = and i32 %4, 15
  %7 = tail call noundef i32 @_ZN8GPolygon4SizeEv(ptr noundef nonnull align 8 dereferenceable(808) @_ZN13PolygonEngine3_p1E)
  %8 = icmp slt i32 %7, 2
  br i1 %8, label %.loopexit, label %.preheader154

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

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

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

55:                                               ; preds = %.lr.ph, %51
  %56 = phi i32 [ %54, %51 ], [ %.0158, %.lr.ph ]
  %57 = tail call noundef ptr @_ZN8GPolygonixEi(ptr noundef nonnull align 8 dereferenceable(808) @_ZN13PolygonEngine3_p1E, i32 noundef %.0117156)
  %58 = getelementptr inbounds i8, ptr %57, i64 40
  %59 = load i32, ptr %58, align 4, !tbaa !14
  %60 = icmp sgt i32 %.0116157, %59
  br i1 %60, label %65, label %61

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

65:                                               ; preds = %55, %61
  %66 = phi i32 [ %64, %61 ], [ %.0116157, %55 ]
  %67 = tail call noundef i32 @_ZN8GPolygon4SizeEv(ptr noundef nonnull align 8 dereferenceable(808) @_ZN13PolygonEngine3_p1E)
  %68 = icmp slt i32 %11, %67
  br i1 %68, label %.lr.ph, label %._crit_edge, !llvm.loop !15

._crit_edge:                                      ; preds = %65
  %69 = icmp sgt i32 %46, 0
  %70 = icmp eq i32 %56, %66
  br i1 %70, label %.loopexit, label %.preheader153

.preheader153:                                    ; preds = %.preheader154, %._crit_edge
  %.0.lcssa223 = phi i32 [ %56, %._crit_edge ], [ 1000, %.preheader154 ]
  %.0116.lcssa222 = phi i32 [ %66, %._crit_edge ], [ -1, %.preheader154 ]
  %.0131.lcssa221 = phi i1 [ %69, %._crit_edge ], [ false, %.preheader154 ]
  %71 = tail call noundef i32 @_ZN8GPolygon4SizeEv(ptr noundef nonnull align 8 dereferenceable(808) @_ZN13PolygonEngine3_p1E)
  %72 = icmp sgt i32 %71, 0
  br i1 %72, label %.lr.ph188, label %._crit_edge189

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

83:                                               ; preds = %.lr.ph188
  %84 = tail call noundef ptr @_ZN8GPolygonixEi(ptr noundef nonnull align 8 dereferenceable(808) @_ZN13PolygonEngine3_p1E, i32 noundef %.1187)
  %85 = getelementptr inbounds i8, ptr %84, i64 40
  %86 = load i32, ptr %85, align 4, !tbaa !14
  %87 = tail call noundef ptr @_ZN8GPolygonixEi(ptr noundef nonnull align 8 dereferenceable(808) @_ZN13PolygonEngine3_p1E, i32 noundef %spec.select148)
  %88 = getelementptr inbounds i8, ptr %87, i64 40
  %89 = load i32, ptr %88, align 4, !tbaa !14
  %90 = sub i32 %89, %86
  %.not143 = icmp ne i32 %89, %86
  %91 = sext i1 %.not143 to i32
  %.inv = icmp slt i32 %90, 1
  %92 = select i1 %.inv, i32 %91, i32 1
  %93 = mul i32 %92, %90
  %94 = tail call noundef ptr @_ZN8GPolygonixEi(ptr noundef nonnull align 8 dereferenceable(808) @_ZN13PolygonEngine3_p1E, i32 noundef %.1187)
  %95 = getelementptr inbounds i8, ptr %94, i64 36
  %96 = load i32, ptr %95, align 4, !tbaa !10
  %97 = tail call noundef ptr @_ZN8GPolygonixEi(ptr noundef nonnull align 8 dereferenceable(808) @_ZN13PolygonEngine3_p1E, i32 noundef %spec.select148)
  %98 = getelementptr inbounds i8, ptr %97, i64 36
  %99 = load i32, ptr %98, align 4, !tbaa !10
  %100 = sub nsw i32 %99, %96
  %.not144 = icmp ne i32 %99, %96
  %101 = sext i1 %.not144 to i32
  %.inv149 = icmp slt i32 %100, 1
  %102 = select i1 %.inv149, i32 %101, i32 1
  %103 = shl i32 %100, 1
  %104 = mul i32 %103, %102
  %105 = sub nsw i32 %104, %93
  %106 = icmp sgt i32 %89, %86
  %107 = xor i1 %.0131.lcssa221, %106
  %.not146181 = icmp slt i32 %93, 0
  br i1 %107, label %.preheader, label %.preheader151

.preheader151:                                    ; preds = %83
  br i1 %.not146181, label %.loopexit150, label %.lr.ph173

.lr.ph173:                                        ; preds = %.preheader151
  %108 = shl nuw i32 %93, 1
  %109 = sext i32 %86 to i64
  %110 = sext i32 %92 to i64
  br label %122

.preheader:                                       ; preds = %83
  br i1 %.not146181, label %.loopexit150, label %.lr.ph186

.lr.ph186:                                        ; preds = %.preheader
  %111 = shl nuw i32 %93, 1
  %112 = sext i32 %86 to i64
  %113 = sext i32 %92 to i64
  br label %114

114:                                              ; preds = %.lr.ph186, %._crit_edge178
  %indvars.iv209 = phi i64 [ %112, %.lr.ph186 ], [ %indvars.iv.next210, %._crit_edge178 ]
  %.0121185 = phi i32 [ %105, %.lr.ph186 ], [ %120, %._crit_edge178 ]
  %.0123184 = phi i32 [ 0, %.lr.ph186 ], [ %121, %._crit_edge178 ]
  %.0125183 = phi i32 [ %96, %.lr.ph186 ], [ %.1126.lcssa, %._crit_edge178 ]
  %115 = getelementptr inbounds [1024 x %class.Mug], ptr @_ZN13PolygonEngine4_mugE, i64 0, i64 %indvars.iv209, i32 1, i32 1
  store i32 %.0125183, ptr %115, align 4, !tbaa !17
  %indvars.iv.next210 = add nsw i64 %indvars.iv209, %113
  %116 = icmp sgt i32 %.0121185, -1
  br i1 %116, label %.lr.ph177, label %._crit_edge178

.lr.ph177:                                        ; preds = %114, %.lr.ph177
  %.1122175 = phi i32 [ %118, %.lr.ph177 ], [ %.0121185, %114 ]
  %.1126174 = phi i32 [ %117, %.lr.ph177 ], [ %.0125183, %114 ]
  %117 = add nsw i32 %.1126174, %102
  %118 = sub nsw i32 %.1122175, %111
  %119 = icmp sgt i32 %118, -1
  br i1 %119, label %.lr.ph177, label %._crit_edge178, !llvm.loop !19

._crit_edge178:                                   ; preds = %.lr.ph177, %114
  %.1126.lcssa = phi i32 [ %.0125183, %114 ], [ %117, %.lr.ph177 ]
  %.1122.lcssa = phi i32 [ %.0121185, %114 ], [ %118, %.lr.ph177 ]
  %120 = add nsw i32 %.1122.lcssa, %104
  %121 = add nuw i32 %.0123184, 1
  %exitcond212.not = icmp eq i32 %.0123184, %93
  br i1 %exitcond212.not, label %.loopexit150, label %114, !llvm.loop !20

122:                                              ; preds = %.lr.ph173, %._crit_edge165
  %indvars.iv = phi i64 [ %109, %.lr.ph173 ], [ %indvars.iv.next, %._crit_edge165 ]
  %.2172 = phi i32 [ %105, %.lr.ph173 ], [ %128, %._crit_edge165 ]
  %.1124171 = phi i32 [ 0, %.lr.ph173 ], [ %129, %._crit_edge165 ]
  %.2127170 = phi i32 [ %96, %.lr.ph173 ], [ %.3128.lcssa, %._crit_edge165 ]
  %123 = getelementptr inbounds [1024 x %class.Mug], ptr @_ZN13PolygonEngine4_mugE, i64 0, i64 %indvars.iv, i32 0, i32 1
  store i32 %.2127170, ptr %123, align 4, !tbaa !21
  %indvars.iv.next = add nsw i64 %indvars.iv, %110
  %124 = icmp sgt i32 %.2172, -1
  br i1 %124, label %.lr.ph164, label %._crit_edge165

.lr.ph164:                                        ; preds = %122, %.lr.ph164
  %.3162 = phi i32 [ %126, %.lr.ph164 ], [ %.2172, %122 ]
  %.3128161 = phi i32 [ %125, %.lr.ph164 ], [ %.2127170, %122 ]
  %125 = add nsw i32 %.3128161, %102
  %126 = sub nsw i32 %.3162, %108
  %127 = icmp sgt i32 %126, -1
  br i1 %127, label %.lr.ph164, label %._crit_edge165, !llvm.loop !22

._crit_edge165:                                   ; preds = %.lr.ph164, %122
  %.3128.lcssa = phi i32 [ %.2127170, %122 ], [ %125, %.lr.ph164 ]
  %.3.lcssa = phi i32 [ %.2172, %122 ], [ %126, %.lr.ph164 ]
  %128 = add nsw i32 %.3.lcssa, %104
  %129 = add nuw i32 %.1124171, 1
  %exitcond.not = icmp eq i32 %.1124171, %93
  br i1 %exitcond.not, label %.loopexit150, label %122, !llvm.loop !23

.loopexit150:                                     ; preds = %._crit_edge165, %._crit_edge178, %.preheader151, %.preheader, %.lr.ph188
  %130 = tail call noundef i32 @_ZN8GPolygon4SizeEv(ptr noundef nonnull align 8 dereferenceable(808) @_ZN13PolygonEngine3_p1E)
  %131 = icmp slt i32 %73, %130
  br i1 %131, label %.lr.ph188, label %._crit_edge189, !llvm.loop !24

._crit_edge189:                                   ; preds = %.loopexit150, %.preheader153
  %.not196 = icmp sgt i32 %.0.lcssa223, %.0116.lcssa222
  br i1 %.not196, label %.loopexit, label %.lr.ph200

.lr.ph200:                                        ; preds = %._crit_edge189
  %132 = load ptr, ptr @_ZN16GraphicComponent10_graph_memE, align 8, !tbaa !25
  %133 = load i32, ptr @_ZN16GraphicComponent15_bytes_per_lineE, align 4, !tbaa !27
  %134 = mul nsw i32 %133, %.0.lcssa223
  %135 = sext i32 %134 to i64
  %136 = getelementptr inbounds i8, ptr %132, i64 %135
  %137 = sext i32 %133 to i64
  %138 = sext i32 %.0.lcssa223 to i64
  %139 = add i32 %.0116.lcssa222, 1
  br label %140

140:                                              ; preds = %.lr.ph200, %._crit_edge195
  %indvars.iv214 = phi i64 [ %138, %.lr.ph200 ], [ %indvars.iv.next215, %._crit_edge195 ]
  %.0130198 = phi ptr [ %136, %.lr.ph200 ], [ %181, %._crit_edge195 ]
  %141 = getelementptr inbounds [1024 x %class.Mug], ptr @_ZN13PolygonEngine4_mugE, i64 0, i64 %indvars.iv214
  %142 = getelementptr inbounds i8, ptr %141, i64 36
  %143 = load i32, ptr %142, align 4, !tbaa !21
  %144 = getelementptr inbounds i8, ptr %141, i64 164
  %145 = load i32, ptr %144, align 4, !tbaa !17
  %.not142190 = icmp sgt i32 %143, %145
  br i1 %.not142190, label %._crit_edge195, label %.lr.ph194

.lr.ph194:                                        ; preds = %140
  %146 = sext i32 %143 to i64
  %147 = getelementptr inbounds i16, ptr %.0130198, i64 %146
  %148 = trunc nsw i64 %indvars.iv214 to i32
  %149 = shl i32 %148, 2
  %150 = and i32 %149, 12
  %151 = add i32 %145, %143
  %152 = and i32 %151, 1
  %lcmp.mod.not.not = icmp eq i32 %152, 0
  br i1 %lcmp.mod.not.not, label %.prol.loopexit.unr-lcssa, label %.prol.loopexit

.prol.loopexit.unr-lcssa:                         ; preds = %.lr.ph194
  %153 = and i32 %143, 3
  %154 = or disjoint i32 %153, %150
  %155 = zext nneg i32 %154 to i64
  %156 = getelementptr inbounds [16 x i32], ptr @_ZN16GraphicProcessor2D4E, i64 0, i64 %155
  %157 = load i32, ptr %156, align 4, !tbaa !27
  %158 = icmp sgt i32 %6, %157
  %159 = zext i1 %158 to i32
  %.pn.in.prol = add nsw i32 %5, %159
  %.pn.prol = sext i32 %.pn.in.prol to i64
  %storemerge.in.in.prol = getelementptr inbounds [256 x i32], ptr @_ZN16GraphicComponent13_truecolormapE, i64 0, i64 %.pn.prol
  %storemerge.in.prol = load i32, ptr %storemerge.in.in.prol, align 4, !tbaa !27
  %storemerge.prol = trunc i32 %storemerge.in.prol to i16
  store i16 %storemerge.prol, ptr %147, align 2, !tbaa !28
  %160 = getelementptr inbounds i8, ptr %147, i64 2
  %161 = add i32 %143, 1
  br label %.prol.loopexit

.prol.loopexit:                                   ; preds = %.prol.loopexit.unr-lcssa, %.lr.ph194
  %.4192.unr = phi i32 [ %143, %.lr.ph194 ], [ %161, %.prol.loopexit.unr-lcssa ]
  %.0129191.unr = phi ptr [ %147, %.lr.ph194 ], [ %160, %.prol.loopexit.unr-lcssa ]
  %162 = icmp eq i32 %145, %143
  br i1 %162, label %._crit_edge195, label %.lr.ph194.new

.lr.ph194.new:                                    ; preds = %.prol.loopexit, %.lr.ph194.new
  %.4192 = phi i32 [ %180, %.lr.ph194.new ], [ %.4192.unr, %.prol.loopexit ]
  %.0129191 = phi ptr [ %179, %.lr.ph194.new ], [ %.0129191.unr, %.prol.loopexit ]
  %163 = and i32 %.4192, 3
  %164 = or disjoint i32 %163, %150
  %165 = zext nneg i32 %164 to i64
  %166 = getelementptr inbounds [16 x i32], ptr @_ZN16GraphicProcessor2D4E, i64 0, i64 %165
  %167 = load i32, ptr %166, align 4, !tbaa !27
  %168 = icmp sgt i32 %6, %167
  %169 = zext i1 %168 to i32
  %.pn.in = add nsw i32 %5, %169
  %.pn = sext i32 %.pn.in to i64
  %storemerge.in.in = getelementptr inbounds [256 x i32], ptr @_ZN16GraphicComponent13_truecolormapE, i64 0, i64 %.pn
  %storemerge.in = load i32, ptr %storemerge.in.in, align 4, !tbaa !27
  %storemerge = trunc i32 %storemerge.in to i16
  store i16 %storemerge, ptr %.0129191, align 2, !tbaa !28
  %170 = getelementptr inbounds i8, ptr %.0129191, i64 2
  %171 = add i32 %.4192, 1
  %172 = and i32 %171, 3
  %173 = or disjoint i32 %172, %150
  %174 = zext nneg i32 %173 to i64
  %175 = getelementptr inbounds [16 x i32], ptr @_ZN16GraphicProcessor2D4E, i64 0, i64 %174
  %176 = load i32, ptr %175, align 4, !tbaa !27
  %177 = icmp sgt i32 %6, %176
  %178 = zext i1 %177 to i32
  %.pn.in.1 = add nsw i32 %5, %178
  %.pn.1 = sext i32 %.pn.in.1 to i64
  %storemerge.in.in.1 = getelementptr inbounds [256 x i32], ptr @_ZN16GraphicComponent13_truecolormapE, i64 0, i64 %.pn.1
  %storemerge.in.1 = load i32, ptr %storemerge.in.in.1, align 4, !tbaa !27
  %storemerge.1 = trunc i32 %storemerge.in.1 to i16
  store i16 %storemerge.1, ptr %170, align 2, !tbaa !28
  %179 = getelementptr inbounds i8, ptr %.0129191, i64 4
  %180 = add i32 %.4192, 2
  %exitcond213.not.1 = icmp eq i32 %171, %145
  br i1 %exitcond213.not.1, label %._crit_edge195, label %.lr.ph194.new, !llvm.loop !30

._crit_edge195:                                   ; preds = %.prol.loopexit, %.lr.ph194.new, %140
  %181 = getelementptr inbounds i8, ptr %.0130198, i64 %137
  %indvars.iv.next215 = add nsw i64 %indvars.iv214, 1
  %lftr.wideiv = trunc i64 %indvars.iv.next215 to i32
  %exitcond217.not = icmp eq i32 %139, %lftr.wideiv
  br i1 %exitcond217.not, label %.loopexit, label %140, !llvm.loop !31

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


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