; LLVM IR from BrunoLevy/learn-fpga :: LiteX/software/Doom/mc1-doom/src (r_things)

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

%struct.mobj_s = type { %struct.thinker_s, i32, i32, i32, ptr, ptr, i32, i32, i32, ptr, ptr, ptr, i32, i32, i32, i32, i32, i32, i32, i32, i32, ptr, i32, ptr, i32, i32, i32, i32, ptr, i32, i32, ptr, i32, %struct.mapthing_t, ptr }
%struct.thinker_s = type { ptr, ptr, %union.actionf_t }
%union.actionf_t = type { ptr }
%struct.mapthing_t = type { i16, i16, i16, i16, i16 }
%struct.spritedef_t = type { i32, ptr }
%struct.spriteframe_t = type { i32, [8 x i16], [8 x i8] }
%struct.vissprite_s = type { ptr, ptr, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, ptr, i32 }

@numsprites = external dso_local global i32, align 4
@sprites = external dso_local global ptr, align 8
@viewx = external global i32, align 4
@viewy = external global i32, align 4
@viewcos = external global i32, align 4
@viewsin = external global i32, align 4
@projection = external global i32, align 4
@.str.7 = external hidden unnamed_addr constant [43 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [47 x i8], align 1
@spriteoffset = external global ptr, align 8
@centerxfrac = external global i32, align 4
@viewwidth = external global i32, align 4
@spritewidth = external global ptr, align 8
@spritetopoffset = external global ptr, align 8
@viewz = external global i32, align 4
@fixedcolormap = external global ptr, align 8
@colormaps = external global ptr, align 8
@spritelights = external dso_local global ptr, align 8

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

; Function Attrs: noreturn
declare void @I_Error(ptr noundef, ...) #1

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

; Function Attrs: nounwind uwtable
declare dso_local ptr @R_NewVisSprite() #2

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.abs.i32(i32, i1 immarg) #3

; Function Attrs: inlinehint nounwind uwtable
declare hidden i32 @FixedMul(i32 noundef, i32 noundef) #4

; Function Attrs: nounwind uwtable
define dso_local void @R_ProjectSprite(ptr noundef %0) #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 i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca ptr, align 8
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #6
  %22 = load ptr, ptr %2, align 8, !tbaa !5
  %23 = getelementptr inbounds %struct.mobj_s, ptr %22, i32 0, i32 1
  %24 = load i32, ptr %23, align 8, !tbaa !9
  %25 = load i32, ptr @viewx, align 4, !tbaa !15
  %26 = sub nsw i32 %24, %25
  store i32 %26, ptr %3, align 4, !tbaa !15
  %27 = load ptr, ptr %2, align 8, !tbaa !5
  %28 = getelementptr inbounds %struct.mobj_s, ptr %27, i32 0, i32 2
  %29 = load i32, ptr %28, align 4, !tbaa !16
  %30 = load i32, ptr @viewy, align 4, !tbaa !15
  %31 = sub nsw i32 %29, %30
  store i32 %31, ptr %4, align 4, !tbaa !15
  %32 = load i32, ptr %3, align 4, !tbaa !15
  %33 = load i32, ptr @viewcos, align 4, !tbaa !15
  %34 = call i32 @FixedMul(i32 noundef %32, i32 noundef %33)
  store i32 %34, ptr %5, align 4, !tbaa !15
  %35 = load i32, ptr %4, align 4, !tbaa !15
  %36 = load i32, ptr @viewsin, align 4, !tbaa !15
  %37 = call i32 @FixedMul(i32 noundef %35, i32 noundef %36)
  %38 = sub nsw i32 0, %37
  store i32 %38, ptr %6, align 4, !tbaa !15
  %39 = load i32, ptr %5, align 4, !tbaa !15
  %40 = load i32, ptr %6, align 4, !tbaa !15
  %41 = sub nsw i32 %39, %40
  store i32 %41, ptr %8, align 4, !tbaa !15
  %42 = load i32, ptr %8, align 4, !tbaa !15
  %43 = icmp slt i32 %42, 262144
  br i1 %43, label %44, label %45

44:                                               ; preds = %1
  store i32 1, ptr %21, align 4
  br label %341

45:                                               ; preds = %1
  %46 = load i32, ptr @projection, align 4, !tbaa !15
  %47 = load i32, ptr %8, align 4, !tbaa !15
  %48 = call i32 @FixedDiv(i32 noundef %46, i32 noundef %47)
  store i32 %48, ptr %9, align 4, !tbaa !15
  %49 = load i32, ptr %3, align 4, !tbaa !15
  %50 = load i32, ptr @viewsin, align 4, !tbaa !15
  %51 = call i32 @FixedMul(i32 noundef %49, i32 noundef %50)
  %52 = sub nsw i32 0, %51
  store i32 %52, ptr %5, align 4, !tbaa !15
  %53 = load i32, ptr %4, align 4, !tbaa !15
  %54 = load i32, ptr @viewcos, align 4, !tbaa !15
  %55 = call i32 @FixedMul(i32 noundef %53, i32 noundef %54)
  store i32 %55, ptr %6, align 4, !tbaa !15
  %56 = load i32, ptr %6, align 4, !tbaa !15
  %57 = load i32, ptr %5, align 4, !tbaa !15
  %58 = add nsw i32 %56, %57
  %59 = sub nsw i32 0, %58
  store i32 %59, ptr %7, align 4, !tbaa !15
  %60 = load i32, ptr %7, align 4, !tbaa !15
  %61 = call i32 @llvm.abs.i32(i32 %60, i1 true)
  %62 = load i32, ptr %8, align 4, !tbaa !15
  %63 = shl i32 %62, 2
  %64 = icmp sgt i32 %61, %63
  br i1 %64, label %65, label %66

65:                                               ; preds = %45
  store i32 1, ptr %21, align 4
  br label %341

66:                                               ; preds = %45
  %67 = load ptr, ptr %2, align 8, !tbaa !5
  %68 = getelementptr inbounds %struct.mobj_s, ptr %67, i32 0, i32 7
  %69 = load i32, ptr %68, align 4, !tbaa !17
  %70 = load i32, ptr @numsprites, align 4, !tbaa !15
  %71 = icmp uge i32 %69, %70
  br i1 %71, label %72, label %76

72:                                               ; preds = %66
  %73 = load ptr, ptr %2, align 8, !tbaa !5
  %74 = getelementptr inbounds %struct.mobj_s, ptr %73, i32 0, i32 7
  %75 = load i32, ptr %74, align 4, !tbaa !17
  call void (ptr, ...) @I_Error(ptr noundef @.str.7, i32 noundef %75) #7
  unreachable

76:                                               ; preds = %66
  %77 = load ptr, ptr @sprites, align 8, !tbaa !5
  %78 = load ptr, ptr %2, align 8, !tbaa !5
  %79 = getelementptr inbounds %struct.mobj_s, ptr %78, i32 0, i32 7
  %80 = load i32, ptr %79, align 4, !tbaa !17
  %81 = zext i32 %80 to i64
  %82 = getelementptr inbounds %struct.spritedef_t, ptr %77, i64 %81
  store ptr %82, ptr %12, align 8, !tbaa !5
  %83 = load ptr, ptr %2, align 8, !tbaa !5
  %84 = getelementptr inbounds %struct.mobj_s, ptr %83, i32 0, i32 8
  %85 = load i32, ptr %84, align 8, !tbaa !18
  %86 = and i32 %85, 32767
  %87 = load ptr, ptr %12, align 8, !tbaa !5
  %88 = getelementptr inbounds %struct.spritedef_t, ptr %87, i32 0, i32 0
  %89 = load i32, ptr %88, align 8, !tbaa !19
  %90 = icmp sge i32 %86, %89
  br i1 %90, label %91, label %98

91:                                               ; preds = %76
  %92 = load ptr, ptr %2, align 8, !tbaa !5
  %93 = getelementptr inbounds %struct.mobj_s, ptr %92, i32 0, i32 7
  %94 = load i32, ptr %93, align 4, !tbaa !17
  %95 = load ptr, ptr %2, align 8, !tbaa !5
  %96 = getelementptr inbounds %struct.mobj_s, ptr %95, i32 0, i32 8
  %97 = load i32, ptr %96, align 8, !tbaa !18
  call void (ptr, ...) @I_Error(ptr noundef @.str.8, i32 noundef %94, i32 noundef %97) #7
  unreachable

98:                                               ; preds = %76
  %99 = load ptr, ptr %12, align 8, !tbaa !5
  %100 = getelementptr inbounds %struct.spritedef_t, ptr %99, i32 0, i32 1
  %101 = load ptr, ptr %100, align 8, !tbaa !21
  %102 = load ptr, ptr %2, align 8, !tbaa !5
  %103 = getelementptr inbounds %struct.mobj_s, ptr %102, i32 0, i32 8
  %104 = load i32, ptr %103, align 8, !tbaa !18
  %105 = and i32 %104, 32767
  %106 = sext i32 %105 to i64
  %107 = getelementptr inbounds %struct.spriteframe_t, ptr %101, i64 %106
  store ptr %107, ptr %13, align 8, !tbaa !5
  %108 = load ptr, ptr %13, align 8, !tbaa !5
  %109 = getelementptr inbounds %struct.spriteframe_t, ptr %108, i32 0, i32 0
  %110 = load i32, ptr %109, align 4, !tbaa !22
  %111 = icmp ne i32 %110, 0
  br i1 %111, label %112, label %141

112:                                              ; preds = %98
  %113 = load ptr, ptr %2, align 8, !tbaa !5
  %114 = getelementptr inbounds %struct.mobj_s, ptr %113, i32 0, i32 1
  %115 = load i32, ptr %114, align 8, !tbaa !9
  %116 = load ptr, ptr %2, align 8, !tbaa !5
  %117 = getelementptr inbounds %struct.mobj_s, ptr %116, i32 0, i32 2
  %118 = load i32, ptr %117, align 4, !tbaa !16
  %119 = call i32 @R_PointToAngle(i32 noundef %115, i32 noundef %118)
  store i32 %119, ptr %19, align 4, !tbaa !15
  %120 = load i32, ptr %19, align 4, !tbaa !15
  %121 = load ptr, ptr %2, align 8, !tbaa !5
  %122 = getelementptr inbounds %struct.mobj_s, ptr %121, i32 0, i32 6
  %123 = load i32, ptr %122, align 8, !tbaa !24
  %124 = sub i32 %120, %123
  %125 = add i32 %124, -1879048192
  %126 = lshr i32 %125, 29
  store i32 %126, ptr %15, align 4, !tbaa !15
  %127 = load ptr, ptr %13, align 8, !tbaa !5
  %128 = getelementptr inbounds %struct.spriteframe_t, ptr %127, i32 0, i32 1
  %129 = load i32, ptr %15, align 4, !tbaa !15
  %130 = zext i32 %129 to i64
  %131 = getelementptr inbounds [8 x i16], ptr %128, i64 0, i64 %130
  %132 = load i16, ptr %131, align 2, !tbaa !25
  %133 = sext i16 %132 to i32
  store i32 %133, ptr %14, align 4, !tbaa !15
  %134 = load ptr, ptr %13, align 8, !tbaa !5
  %135 = getelementptr inbounds %struct.spriteframe_t, ptr %134, i32 0, i32 2
  %136 = load i32, ptr %15, align 4, !tbaa !15
  %137 = zext i32 %136 to i64
  %138 = getelementptr inbounds [8 x i8], ptr %135, i64 0, i64 %137
  %139 = load i8, ptr %138, align 1, !tbaa !26
  %140 = zext i8 %139 to i32
  store i32 %140, ptr %16, align 4, !tbaa !15
  br label %152

141:                                              ; preds = %98
  %142 = load ptr, ptr %13, align 8, !tbaa !5
  %143 = getelementptr inbounds %struct.spriteframe_t, ptr %142, i32 0, i32 1
  %144 = getelementptr inbounds [8 x i16], ptr %143, i64 0, i64 0
  %145 = load i16, ptr %144, align 4, !tbaa !25
  %146 = sext i16 %145 to i32
  store i32 %146, ptr %14, align 4, !tbaa !15
  %147 = load ptr, ptr %13, align 8, !tbaa !5
  %148 = getelementptr inbounds %struct.spriteframe_t, ptr %147, i32 0, i32 2
  %149 = getelementptr inbounds [8 x i8], ptr %148, i64 0, i64 0
  %150 = load i8, ptr %149, align 4, !tbaa !26
  %151 = zext i8 %150 to i32
  store i32 %151, ptr %16, align 4, !tbaa !15
  br label %152

152:                                              ; preds = %141, %112
  %153 = load ptr, ptr @spriteoffset, align 8, !tbaa !5
  %154 = load i32, ptr %14, align 4, !tbaa !15
  %155 = sext i32 %154 to i64
  %156 = getelementptr inbounds i32, ptr %153, i64 %155
  %157 = load i32, ptr %156, align 4, !tbaa !15
  %158 = load i32, ptr %7, align 4, !tbaa !15
  %159 = sub nsw i32 %158, %157
  store i32 %159, ptr %7, align 4, !tbaa !15
  %160 = load i32, ptr @centerxfrac, align 4, !tbaa !15
  %161 = load i32, ptr %7, align 4, !tbaa !15
  %162 = load i32, ptr %9, align 4, !tbaa !15
  %163 = call i32 @FixedMul(i32 noundef %161, i32 noundef %162)
  %164 = add nsw i32 %160, %163
  %165 = ashr i32 %164, 16
  store i32 %165, ptr %10, align 4, !tbaa !15
  %166 = load i32, ptr %10, align 4, !tbaa !15
  %167 = load i32, ptr @viewwidth, align 4, !tbaa !15
  %168 = icmp sgt i32 %166, %167
  br i1 %168, label %169, label %170

169:                                              ; preds = %152
  store i32 1, ptr %21, align 4
  br label %341

170:                                              ; preds = %152
  %171 = load ptr, ptr @spritewidth, align 8, !tbaa !5
  %172 = load i32, ptr %14, align 4, !tbaa !15
  %173 = sext i32 %172 to i64
  %174 = getelementptr inbounds i32, ptr %171, i64 %173
  %175 = load i32, ptr %174, align 4, !tbaa !15
  %176 = load i32, ptr %7, align 4, !tbaa !15
  %177 = add nsw i32 %176, %175
  store i32 %177, ptr %7, align 4, !tbaa !15
  %178 = load i32, ptr @centerxfrac, align 4, !tbaa !15
  %179 = load i32, ptr %7, align 4, !tbaa !15
  %180 = load i32, ptr %9, align 4, !tbaa !15
  %181 = call i32 @FixedMul(i32 noundef %179, i32 noundef %180)
  %182 = add nsw i32 %178, %181
  %183 = ashr i32 %182, 16
  %184 = sub nsw i32 %183, 1
  store i32 %184, ptr %11, align 4, !tbaa !15
  %185 = load i32, ptr %11, align 4, !tbaa !15
  %186 = icmp slt i32 %185, 0
  br i1 %186, label %187, label %188

187:                                              ; preds = %170
  store i32 1, ptr %21, align 4
  br label %341

188:                                              ; preds = %170
  %189 = call ptr @R_NewVisSprite()
  store ptr %189, ptr %18, align 8, !tbaa !5
  %190 = load ptr, ptr %2, align 8, !tbaa !5
  %191 = getelementptr inbounds %struct.mobj_s, ptr %190, i32 0, i32 24
  %192 = load i32, ptr %191, align 8, !tbaa !27
  %193 = load ptr, ptr %18, align 8, !tbaa !5
  %194 = getelementptr inbounds %struct.vissprite_s, ptr %193, i32 0, i32 14
  store i32 %192, ptr %194, align 8, !tbaa !28
  %195 = load i32, ptr %9, align 4, !tbaa !15
  %196 = load ptr, ptr %18, align 8, !tbaa !5
  %197 = getelementptr inbounds %struct.vissprite_s, ptr %196, i32 0, i32 9
  store i32 %195, ptr %197, align 4, !tbaa !30
  %198 = load ptr, ptr %2, align 8, !tbaa !5
  %199 = getelementptr inbounds %struct.mobj_s, ptr %198, i32 0, i32 1
  %200 = load i32, ptr %199, align 8, !tbaa !9
  %201 = load ptr, ptr %18, align 8, !tbaa !5
  %202 = getelementptr inbounds %struct.vissprite_s, ptr %201, i32 0, i32 4
  store i32 %200, ptr %202, align 8, !tbaa !31
  %203 = load ptr, ptr %2, align 8, !tbaa !5
  %204 = getelementptr inbounds %struct.mobj_s, ptr %203, i32 0, i32 2
  %205 = load i32, ptr %204, align 4, !tbaa !16
  %206 = load ptr, ptr %18, align 8, !tbaa !5
  %207 = getelementptr inbounds %struct.vissprite_s, ptr %206, i32 0, i32 5
  store i32 %205, ptr %207, align 4, !tbaa !32
  %208 = load ptr, ptr %2, align 8, !tbaa !5
  %209 = getelementptr inbounds %struct.mobj_s, ptr %208, i32 0, i32 3
  %210 = load i32, ptr %209, align 8, !tbaa !33
  %211 = load ptr, ptr %18, align 8, !tbaa !5
  %212 = getelementptr inbounds %struct.vissprite_s, ptr %211, i32 0, i32 6
  store i32 %210, ptr %212, align 8, !tbaa !34
  %213 = load ptr, ptr %2, align 8, !tbaa !5
  %214 = getelementptr inbounds %struct.mobj_s, ptr %213, i32 0, i32 3
  %215 = load i32, ptr %214, align 8, !tbaa !33
  %216 = load ptr, ptr @spritetopoffset, align 8, !tbaa !5
  %217 = load i32, ptr %14, align 4, !tbaa !15
  %218 = sext i32 %217 to i64
  %219 = getelementptr inbounds i32, ptr %216, i64 %218
  %220 = load i32, ptr %219, align 4, !tbaa !15
  %221 = add nsw i32 %215, %220
  %222 = load ptr, ptr %18, align 8, !tbaa !5
  %223 = getelementptr inbounds %struct.vissprite_s, ptr %222, i32 0, i32 7
  store i32 %221, ptr %223, align 4, !tbaa !35
  %224 = load ptr, ptr %18, align 8, !tbaa !5
  %225 = getelementptr inbounds %struct.vissprite_s, ptr %224, i32 0, i32 7
  %226 = load i32, ptr %225, align 4, !tbaa !35
  %227 = load i32, ptr @viewz, align 4, !tbaa !15
  %228 = sub nsw i32 %226, %227
  %229 = load ptr, ptr %18, align 8, !tbaa !5
  %230 = getelementptr inbounds %struct.vissprite_s, ptr %229, i32 0, i32 11
  store i32 %228, ptr %230, align 4, !tbaa !36
  %231 = load i32, ptr %10, align 4, !tbaa !15
  %232 = icmp slt i32 %231, 0
  br i1 %232, label %233, label %234

233:                                              ; preds = %188
  br label %236

234:                                              ; preds = %188
  %235 = load i32, ptr %10, align 4, !tbaa !15
  br label %236

236:                                              ; preds = %234, %233
  %237 = phi i32 [ 0, %233 ], [ %235, %234 ]
  %238 = load ptr, ptr %18, align 8, !tbaa !5
  %239 = getelementptr inbounds %struct.vissprite_s, ptr %238, i32 0, i32 2
  store i32 %237, ptr %239, align 8, !tbaa !37
  %240 = load i32, ptr %11, align 4, !tbaa !15
  %241 = load i32, ptr @viewwidth, align 4, !tbaa !15
  %242 = icmp sge i32 %240, %241
  br i1 %242, label %243, label %246

243:                                              ; preds = %236
  %244 = load i32, ptr @viewwidth, align 4, !tbaa !15
  %245 = sub nsw i32 %244, 1
  br label %248

246:                                              ; preds = %236
  %247 = load i32, ptr %11, align 4, !tbaa !15
  br label %248

248:                                              ; preds = %246, %243
  %249 = phi i32 [ %245, %243 ], [ %247, %246 ]
  %250 = load ptr, ptr %18, align 8, !tbaa !5
  %251 = getelementptr inbounds %struct.vissprite_s, ptr %250, i32 0, i32 3
  store i32 %249, ptr %251, align 4, !tbaa !38
  %252 = load i32, ptr %9, align 4, !tbaa !15
  %253 = call i32 @FixedDiv(i32 noundef 65536, i32 noundef %252)
  store i32 %253, ptr %20, align 4, !tbaa !15
  %254 = load i32, ptr %16, align 4, !tbaa !15
  %255 = icmp ne i32 %254, 0
  br i1 %255, label %256, label %269

256:                                              ; preds = %248
  %257 = load ptr, ptr @spritewidth, align 8, !tbaa !5
  %258 = load i32, ptr %14, align 4, !tbaa !15
  %259 = sext i32 %258 to i64
  %260 = getelementptr inbounds i32, ptr %257, i64 %259
  %261 = load i32, ptr %260, align 4, !tbaa !15
  %262 = sub nsw i32 %261, 1
  %263 = load ptr, ptr %18, align 8, !tbaa !5
  %264 = getelementptr inbounds %struct.vissprite_s, ptr %263, i32 0, i32 8
  store i32 %262, ptr %264, align 8, !tbaa !39
  %265 = load i32, ptr %20, align 4, !tbaa !15
  %266 = sub nsw i32 0, %265
  %267 = load ptr, ptr %18, align 8, !tbaa !5
  %268 = getelementptr inbounds %struct.vissprite_s, ptr %267, i32 0, i32 10
  store i32 %266, ptr %268, align 8, !tbaa !40
  br label %275

269:                                              ; preds = %248
  %270 = load ptr, ptr %18, align 8, !tbaa !5
  %271 = getelementptr inbounds %struct.vissprite_s, ptr %270, i32 0, i32 8
  store i32 0, ptr %271, align 8, !tbaa !39
  %272 = load i32, ptr %20, align 4, !tbaa !15
  %273 = load ptr, ptr %18, align 8, !tbaa !5
  %274 = getelementptr inbounds %struct.vissprite_s, ptr %273, i32 0, i32 10
  store i32 %272, ptr %274, align 8, !tbaa !40
  br label %275

275:                                              ; preds = %269, %256
  %276 = load ptr, ptr %18, align 8, !tbaa !5
  %277 = getelementptr inbounds %struct.vissprite_s, ptr %276, i32 0, i32 2
  %278 = load i32, ptr %277, align 8, !tbaa !37
  %279 = load i32, ptr %10, align 4, !tbaa !15
  %280 = icmp sgt i32 %278, %279
  br i1 %280, label %281, label %295

281:                                              ; preds = %275
  %282 = load ptr, ptr %18, align 8, !tbaa !5
  %283 = getelementptr inbounds %struct.vissprite_s, ptr %282, i32 0, i32 10
  %284 = load i32, ptr %283, align 8, !tbaa !40
  %285 = load ptr, ptr %18, align 8, !tbaa !5
  %286 = getelementptr inbounds %struct.vissprite_s, ptr %285, i32 0, i32 2
  %287 = load i32, ptr %286, align 8, !tbaa !37
  %288 = load i32, ptr %10, align 4, !tbaa !15
  %289 = sub nsw i32 %287, %288
  %290 = mul nsw i32 %284, %289
  %291 = load ptr, ptr %18, align 8, !tbaa !5
  %292 = getelementptr inbounds %struct.vissprite_s, ptr %291, i32 0, i32 8
  %293 = load i32, ptr %292, align 8, !tbaa !39
  %294 = add nsw i32 %293, %290
  store i32 %294, ptr %292, align 8, !tbaa !39
  br label %295

295:                                              ; preds = %281, %275
  %296 = load i32, ptr %14, align 4, !tbaa !15
  %297 = load ptr, ptr %18, align 8, !tbaa !5
  %298 = getelementptr inbounds %struct.vissprite_s, ptr %297, i32 0, i32 12
  store i32 %296, ptr %298, align 8, !tbaa !41
  %299 = load ptr, ptr %2, align 8, !tbaa !5
  %300 = getelementptr inbounds %struct.mobj_s, ptr %299, i32 0, i32 24
  %301 = load i32, ptr %300, align 8, !tbaa !27
  %302 = and i32 %301, 262144
  %303 = icmp ne i32 %302, 0
  br i1 %303, label %304, label %307

304:                                              ; preds = %295
  %305 = load ptr, ptr %18, align 8, !tbaa !5
  %306 = getelementptr inbounds %struct.vissprite_s, ptr %305, i32 0, i32 13
  store ptr null, ptr %306, align 8, !tbaa !42
  br label %340

307:                                              ; preds = %295
  %308 = load ptr, ptr @fixedcolormap, align 8, !tbaa !5
  %309 = icmp ne ptr %308, null
  br i1 %309, label %310, label %314

310:                                              ; preds = %307
  %311 = load ptr, ptr @fixedcolormap, align 8, !tbaa !5
  %312 = load ptr, ptr %18, align 8, !tbaa !5
  %313 = getelementptr inbounds %struct.vissprite_s, ptr %312, i32 0, i32 13
  store ptr %311, ptr %313, align 8, !tbaa !42
  br label %339

314:                                              ; preds = %307
  %315 = load ptr, ptr %2, align 8, !tbaa !5
  %316 = getelementptr inbounds %struct.mobj_s, ptr %315, i32 0, i32 8
  %317 = load i32, ptr %316, align 8, !tbaa !18
  %318 = and i32 %317, 32768
  %319 = icmp ne i32 %318, 0
  br i1 %319, label %320, label %324

320:                                              ; preds = %314
  %321 = load ptr, ptr @colormaps, align 8, !tbaa !5
  %322 = load ptr, ptr %18, align 8, !tbaa !5
  %323 = getelementptr inbounds %struct.vissprite_s, ptr %322, i32 0, i32 13
  store ptr %321, ptr %323, align 8, !tbaa !42
  br label %338

324:                                              ; preds = %314
  %325 = load i32, ptr %9, align 4, !tbaa !15
  %326 = ashr i32 %325, 12
  store i32 %326, ptr %17, align 4, !tbaa !15
  %327 = load i32, ptr %17, align 4, !tbaa !15
  %328 = icmp sge i32 %327, 48
  br i1 %328, label %329, label %330

329:                                              ; preds = %324
  store i32 47, ptr %17, align 4, !tbaa !15
  br label %330

330:                                              ; preds = %329, %324
  %331 = load ptr, ptr @spritelights, align 8, !tbaa !5
  %332 = load i32, ptr %17, align 4, !tbaa !15
  %333 = sext i32 %332 to i64
  %334 = getelementptr inbounds ptr, ptr %331, i64 %333
  %335 = load ptr, ptr %334, align 8, !tbaa !5
  %336 = load ptr, ptr %18, align 8, !tbaa !5
  %337 = getelementptr inbounds %struct.vissprite_s, ptr %336, i32 0, i32 13
  store ptr %335, ptr %337, align 8, !tbaa !42
  br label %338

338:                                              ; preds = %330, %320
  br label %339

339:                                              ; preds = %338, %310
  br label %340

340:                                              ; preds = %339, %304
  store i32 0, ptr %21, align 4
  br label %341

341:                                              ; preds = %340, %187, %169, %65, %44
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #6
  %342 = load i32, ptr %21, align 4
  switch i32 %342, label %344 [
    i32 0, label %343
    i32 1, label %343
  ]

343:                                              ; preds = %341, %341
  ret void

344:                                              ; preds = %341
  unreachable
}

declare i32 @FixedDiv(i32 noundef, i32 noundef) #5

declare i32 @R_PointToAngle(i32 noundef, i32 noundef) #5

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { noreturn "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 = { 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 nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { inlinehint 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 #5 = { "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 #6 = { nounwind }
attributes #7 = { noreturn }

!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/C++ TBAA"}
!9 = !{!10, !12, i64 24}
!10 = !{!"mobj_s", !11, i64 0, !12, i64 24, !12, i64 28, !12, i64 32, !6, i64 40, !6, i64 48, !12, i64 56, !12, i64 60, !12, i64 64, !6, i64 72, !6, i64 80, !6, i64 88, !12, i64 96, !12, i64 100, !12, i64 104, !12, i64 108, !12, i64 112, !12, i64 116, !12, i64 120, !12, i64 124, !12, i64 128, !6, i64 136, !12, i64 144, !6, i64 152, !12, i64 160, !12, i64 164, !12, i64 168, !12, i64 172, !6, i64 176, !12, i64 184, !12, i64 188, !6, i64 192, !12, i64 200, !13, i64 204, !6, i64 216}
!11 = !{!"thinker_s", !6, i64 0, !6, i64 8, !7, i64 16}
!12 = !{!"int", !7, i64 0}
!13 = !{!"", !14, i64 0, !14, i64 2, !14, i64 4, !14, i64 6, !14, i64 8}
!14 = !{!"short", !7, i64 0}
!15 = !{!12, !12, i64 0}
!16 = !{!10, !12, i64 28}
!17 = !{!10, !12, i64 60}
!18 = !{!10, !12, i64 64}
!19 = !{!20, !12, i64 0}
!20 = !{!"", !12, i64 0, !6, i64 8}
!21 = !{!20, !6, i64 8}
!22 = !{!23, !12, i64 0}
!23 = !{!"", !12, i64 0, !7, i64 4, !7, i64 20}
!24 = !{!10, !12, i64 56}
!25 = !{!14, !14, i64 0}
!26 = !{!7, !7, i64 0}
!27 = !{!10, !12, i64 160}
!28 = !{!29, !12, i64 72}
!29 = !{!"vissprite_s", !6, i64 0, !6, i64 8, !12, i64 16, !12, i64 20, !12, i64 24, !12, i64 28, !12, i64 32, !12, i64 36, !12, i64 40, !12, i64 44, !12, i64 48, !12, i64 52, !12, i64 56, !6, i64 64, !12, i64 72}
!30 = !{!29, !12, i64 44}
!31 = !{!29, !12, i64 24}
!32 = !{!29, !12, i64 28}
!33 = !{!10, !12, i64 32}
!34 = !{!29, !12, i64 32}
!35 = !{!29, !12, i64 36}
!36 = !{!29, !12, i64 52}
!37 = !{!29, !12, i64 16}
!38 = !{!29, !12, i64 20}
!39 = !{!29, !12, i64 40}
!40 = !{!29, !12, i64 48}
!41 = !{!29, !12, i64 56}
!42 = !{!29, !6, i64 64}


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

%struct.spritedef_t = type { i32, ptr }
%struct.spriteframe_t = type { i32, [8 x i16], [8 x i8] }

@numsprites = external dso_local local_unnamed_addr global i32, align 4
@sprites = external dso_local local_unnamed_addr global ptr, align 8
@viewx = external local_unnamed_addr global i32, align 4
@viewy = external local_unnamed_addr global i32, align 4
@viewcos = external local_unnamed_addr global i32, align 4
@viewsin = external local_unnamed_addr global i32, align 4
@projection = external local_unnamed_addr global i32, align 4
@.str.7 = external hidden unnamed_addr constant [43 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [47 x i8], align 1
@spriteoffset = external local_unnamed_addr global ptr, align 8
@centerxfrac = external local_unnamed_addr global i32, align 4
@viewwidth = external local_unnamed_addr global i32, align 4
@spritewidth = external local_unnamed_addr global ptr, align 8
@spritetopoffset = external local_unnamed_addr global ptr, align 8
@viewz = external local_unnamed_addr global i32, align 4
@fixedcolormap = external local_unnamed_addr global ptr, align 8
@colormaps = external local_unnamed_addr global ptr, align 8
@spritelights = external dso_local local_unnamed_addr global ptr, align 8

; Function Attrs: noreturn
declare void @I_Error(ptr noundef, ...) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local ptr @R_NewVisSprite() local_unnamed_addr #1

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.abs.i32(i32, i1 immarg) #2

; Function Attrs: inlinehint nounwind uwtable
declare hidden i32 @FixedMul(i32 noundef, i32 noundef) local_unnamed_addr #3

; Function Attrs: nounwind uwtable
define dso_local void @R_ProjectSprite(ptr nocapture noundef readonly %0) local_unnamed_addr #1 {
  %2 = getelementptr inbounds i8, ptr %0, i64 24
  %3 = load i32, ptr %2, align 8, !tbaa !5
  %4 = load i32, ptr @viewx, align 4, !tbaa !14
  %5 = sub nsw i32 %3, %4
  %6 = getelementptr inbounds i8, ptr %0, i64 28
  %7 = load i32, ptr %6, align 4, !tbaa !15
  %8 = load i32, ptr @viewy, align 4, !tbaa !14
  %9 = sub nsw i32 %7, %8
  %10 = load i32, ptr @viewcos, align 4, !tbaa !14
  %11 = tail call i32 @FixedMul(i32 noundef %5, i32 noundef %10)
  %12 = load i32, ptr @viewsin, align 4, !tbaa !14
  %13 = tail call i32 @FixedMul(i32 noundef %9, i32 noundef %12)
  %14 = add nsw i32 %13, %11
  %15 = icmp slt i32 %14, 262144
  br i1 %15, label %143, label %16

16:                                               ; preds = %1
  %17 = load i32, ptr @projection, align 4, !tbaa !14
  %18 = tail call i32 @FixedDiv(i32 noundef %17, i32 noundef %14) #6
  %19 = load i32, ptr @viewsin, align 4, !tbaa !14
  %20 = tail call i32 @FixedMul(i32 noundef %5, i32 noundef %19)
  %21 = load i32, ptr @viewcos, align 4, !tbaa !14
  %22 = tail call i32 @FixedMul(i32 noundef %9, i32 noundef %21)
  %.neg = sub i32 %20, %22
  %23 = tail call i32 @llvm.abs.i32(i32 %.neg, i1 true)
  %24 = shl i32 %14, 2
  %25 = icmp sgt i32 %23, %24
  br i1 %25, label %143, label %26

26:                                               ; preds = %16
  %27 = getelementptr inbounds i8, ptr %0, i64 60
  %28 = load i32, ptr %27, align 4, !tbaa !16
  %29 = load i32, ptr @numsprites, align 4, !tbaa !14
  %.not = icmp ult i32 %28, %29
  br i1 %.not, label %31, label %30

30:                                               ; preds = %26
  tail call void (ptr, ...) @I_Error(ptr noundef nonnull @.str.7, i32 noundef %28) #7
  unreachable

31:                                               ; preds = %26
  %32 = load ptr, ptr @sprites, align 8, !tbaa !17
  %33 = zext i32 %28 to i64
  %34 = getelementptr inbounds %struct.spritedef_t, ptr %32, i64 %33
  %35 = getelementptr inbounds i8, ptr %0, i64 64
  %36 = load i32, ptr %35, align 8, !tbaa !18
  %37 = and i32 %36, 32767
  %38 = load i32, ptr %34, align 8, !tbaa !19
  %.not98 = icmp slt i32 %37, %38
  br i1 %.not98, label %40, label %39

39:                                               ; preds = %31
  tail call void (ptr, ...) @I_Error(ptr noundef nonnull @.str.8, i32 noundef %28, i32 noundef %36) #7
  unreachable

40:                                               ; preds = %31
  %41 = getelementptr inbounds i8, ptr %34, i64 8
  %42 = load ptr, ptr %41, align 8, !tbaa !21
  %43 = zext nneg i32 %37 to i64
  %44 = getelementptr inbounds %struct.spriteframe_t, ptr %42, i64 %43
  %45 = load i32, ptr %44, align 4, !tbaa !22
  %.not99 = icmp eq i32 %45, 0
  br i1 %.not99, label %60, label %46

46:                                               ; preds = %40
  %47 = load i32, ptr %2, align 8, !tbaa !5
  %48 = load i32, ptr %6, align 4, !tbaa !15
  %49 = tail call i32 @R_PointToAngle(i32 noundef %47, i32 noundef %48) #6
  %50 = getelementptr inbounds i8, ptr %0, i64 56
  %51 = load i32, ptr %50, align 8, !tbaa !24
  %52 = add i32 %49, -1879048192
  %53 = sub i32 %52, %51
  %54 = lshr i32 %53, 29
  %55 = getelementptr inbounds i8, ptr %44, i64 4
  %56 = zext nneg i32 %54 to i64
  %57 = getelementptr inbounds [8 x i16], ptr %55, i64 0, i64 %56
  %58 = getelementptr inbounds i8, ptr %44, i64 20
  %59 = getelementptr inbounds [8 x i8], ptr %58, i64 0, i64 %56
  br label %63

60:                                               ; preds = %40
  %61 = getelementptr inbounds i8, ptr %44, i64 4
  %62 = getelementptr inbounds i8, ptr %44, i64 20
  br label %63

63:                                               ; preds = %60, %46
  %.090.in.in = phi ptr [ %59, %46 ], [ %62, %60 ]
  %.0.in.in = phi ptr [ %57, %46 ], [ %61, %60 ]
  %.0.in = load i16, ptr %.0.in.in, align 2, !tbaa !25
  %.0 = sext i16 %.0.in to i32
  %.090.in = load i8, ptr %.090.in.in, align 1, !tbaa !26
  %64 = load ptr, ptr @spriteoffset, align 8, !tbaa !17
  %65 = sext i16 %.0.in to i64
  %66 = getelementptr inbounds i32, ptr %64, i64 %65
  %67 = load i32, ptr %66, align 4, !tbaa !14
  %68 = sub nsw i32 %.neg, %67
  %69 = load i32, ptr @centerxfrac, align 4, !tbaa !14
  %70 = tail call i32 @FixedMul(i32 noundef %68, i32 noundef %18)
  %71 = add nsw i32 %70, %69
  %72 = ashr i32 %71, 16
  %73 = load i32, ptr @viewwidth, align 4, !tbaa !14
  %74 = icmp sgt i32 %72, %73
  br i1 %74, label %143, label %75

75:                                               ; preds = %63
  %76 = load ptr, ptr @spritewidth, align 8, !tbaa !17
  %77 = getelementptr inbounds i32, ptr %76, i64 %65
  %78 = load i32, ptr %77, align 4, !tbaa !14
  %79 = add nsw i32 %78, %68
  %80 = load i32, ptr @centerxfrac, align 4, !tbaa !14
  %81 = tail call i32 @FixedMul(i32 noundef %79, i32 noundef %18)
  %82 = add nsw i32 %81, %80
  %83 = ashr i32 %82, 16
  %84 = icmp slt i32 %83, 1
  br i1 %84, label %143, label %85

85:                                               ; preds = %75
  %86 = tail call ptr @R_NewVisSprite()
  %87 = getelementptr inbounds i8, ptr %0, i64 160
  %88 = load i32, ptr %87, align 8, !tbaa !27
  %89 = getelementptr inbounds i8, ptr %86, i64 72
  store i32 %88, ptr %89, align 8, !tbaa !28
  %90 = getelementptr inbounds i8, ptr %86, i64 44
  store i32 %18, ptr %90, align 4, !tbaa !30
  %91 = getelementptr inbounds i8, ptr %86, i64 24
  %92 = load <2 x i32>, ptr %2, align 8, !tbaa !14
  store <2 x i32> %92, ptr %91, align 8, !tbaa !14
  %93 = getelementptr inbounds i8, ptr %0, i64 32
  %94 = load i32, ptr %93, align 8, !tbaa !31
  %95 = getelementptr inbounds i8, ptr %86, i64 32
  store i32 %94, ptr %95, align 8, !tbaa !32
  %96 = load ptr, ptr @spritetopoffset, align 8, !tbaa !17
  %97 = getelementptr inbounds i32, ptr %96, i64 %65
  %98 = load i32, ptr %97, align 4, !tbaa !14
  %99 = add nsw i32 %98, %94
  %100 = getelementptr inbounds i8, ptr %86, i64 36
  store i32 %99, ptr %100, align 4, !tbaa !33
  %101 = load i32, ptr @viewz, align 4, !tbaa !14
  %102 = sub nsw i32 %99, %101
  %103 = getelementptr inbounds i8, ptr %86, i64 52
  store i32 %102, ptr %103, align 4, !tbaa !34
  %104 = tail call i32 @llvm.smax.i32(i32 %72, i32 0)
  %105 = getelementptr inbounds i8, ptr %86, i64 16
  store i32 %104, ptr %105, align 8, !tbaa !35
  %106 = load i32, ptr @viewwidth, align 4
  %.v = tail call i32 @llvm.smin.i32(i32 %83, i32 %106)
  %107 = add nsw i32 %.v, -1
  %108 = getelementptr inbounds i8, ptr %86, i64 20
  store i32 %107, ptr %108, align 4, !tbaa !36
  %109 = tail call i32 @FixedDiv(i32 noundef 65536, i32 noundef %18) #6
  %.not101 = icmp eq i8 %.090.in, 0
  br i1 %.not101, label %116, label %110

110:                                              ; preds = %85
  %111 = load ptr, ptr @spritewidth, align 8, !tbaa !17
  %112 = getelementptr inbounds i32, ptr %111, i64 %65
  %113 = load i32, ptr %112, align 4, !tbaa !14
  %114 = add nsw i32 %113, -1
  %115 = sub nsw i32 0, %109
  br label %116

116:                                              ; preds = %85, %110
  %117 = phi i32 [ %114, %110 ], [ 0, %85 ]
  %118 = phi i32 [ %115, %110 ], [ %109, %85 ]
  %119 = getelementptr inbounds i8, ptr %86, i64 40
  store i32 %117, ptr %119, align 8
  %120 = getelementptr inbounds i8, ptr %86, i64 48
  store i32 %118, ptr %120, align 8
  %121 = load i32, ptr %105, align 8, !tbaa !35
  %122 = icmp sgt i32 %121, %72
  br i1 %122, label %123, label %127

123:                                              ; preds = %116
  %124 = sub nsw i32 %121, %72
  %125 = mul nsw i32 %118, %124
  %126 = add nsw i32 %117, %125
  store i32 %126, ptr %119, align 8, !tbaa !37
  br label %127

127:                                              ; preds = %123, %116
  %128 = getelementptr inbounds i8, ptr %86, i64 56
  store i32 %.0, ptr %128, align 8, !tbaa !38
  %129 = load i32, ptr %87, align 8, !tbaa !27
  %130 = and i32 %129, 262144
  %.not102 = icmp eq i32 %130, 0
  br i1 %.not102, label %131, label %.sink.split

131:                                              ; preds = %127
  %132 = load ptr, ptr @fixedcolormap, align 8, !tbaa !17
  %.not103 = icmp eq ptr %132, null
  br i1 %.not103, label %133, label %.sink.split

133:                                              ; preds = %131
  %134 = load i32, ptr %35, align 8, !tbaa !18
  %135 = and i32 %134, 32768
  %.not104 = icmp eq i32 %135, 0
  br i1 %.not104, label %136, label %.sink.split.sink.split

136:                                              ; preds = %133
  %137 = ashr i32 %18, 12
  %spec.store.select = tail call i32 @llvm.smin.i32(i32 %137, i32 47)
  %138 = load ptr, ptr @spritelights, align 8, !tbaa !17
  %139 = sext i32 %spec.store.select to i64
  %140 = getelementptr inbounds ptr, ptr %138, i64 %139
  br label %.sink.split.sink.split

.sink.split.sink.split:                           ; preds = %133, %136
  %.sink108 = phi ptr [ %140, %136 ], [ @colormaps, %133 ]
  %141 = load ptr, ptr %.sink108, align 8, !tbaa !17
  br label %.sink.split

.sink.split:                                      ; preds = %.sink.split.sink.split, %131, %127
  %.sink = phi ptr [ null, %127 ], [ %132, %131 ], [ %141, %.sink.split.sink.split ]
  %142 = getelementptr inbounds i8, ptr %86, i64 64
  store ptr %.sink, ptr %142, align 8, !tbaa !39
  br label %143

143:                                              ; preds = %.sink.split, %75, %63, %16, %1
  ret void
}

declare i32 @FixedDiv(i32 noundef, i32 noundef) local_unnamed_addr #4

declare i32 @R_PointToAngle(i32 noundef, i32 noundef) local_unnamed_addr #4

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #5

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #5

attributes #0 = { noreturn "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 = { 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 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #3 = { inlinehint 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 #4 = { "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 #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { nounwind }
attributes #7 = { noreturn 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, !11, i64 24}
!6 = !{!"mobj_s", !7, i64 0, !11, i64 24, !11, i64 28, !11, i64 32, !8, i64 40, !8, i64 48, !11, i64 56, !11, i64 60, !11, i64 64, !8, i64 72, !8, i64 80, !8, i64 88, !11, i64 96, !11, i64 100, !11, i64 104, !11, i64 108, !11, i64 112, !11, i64 116, !11, i64 120, !11, i64 124, !11, i64 128, !8, i64 136, !11, i64 144, !8, i64 152, !11, i64 160, !11, i64 164, !11, i64 168, !11, i64 172, !8, i64 176, !11, i64 184, !11, i64 188, !8, i64 192, !11, i64 200, !12, i64 204, !8, i64 216}
!7 = !{!"thinker_s", !8, i64 0, !8, i64 8, !9, i64 16}
!8 = !{!"any pointer", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C/C++ TBAA"}
!11 = !{!"int", !9, i64 0}
!12 = !{!"", !13, i64 0, !13, i64 2, !13, i64 4, !13, i64 6, !13, i64 8}
!13 = !{!"short", !9, i64 0}
!14 = !{!11, !11, i64 0}
!15 = !{!6, !11, i64 28}
!16 = !{!6, !11, i64 60}
!17 = !{!8, !8, i64 0}
!18 = !{!6, !11, i64 64}
!19 = !{!20, !11, i64 0}
!20 = !{!"", !11, i64 0, !8, i64 8}
!21 = !{!20, !8, i64 8}
!22 = !{!23, !11, i64 0}
!23 = !{!"", !11, i64 0, !9, i64 4, !9, i64 20}
!24 = !{!6, !11, i64 56}
!25 = !{!13, !13, i64 0}
!26 = !{!9, !9, i64 0}
!27 = !{!6, !11, i64 160}
!28 = !{!29, !11, i64 72}
!29 = !{!"vissprite_s", !8, i64 0, !8, i64 8, !11, i64 16, !11, i64 20, !11, i64 24, !11, i64 28, !11, i64 32, !11, i64 36, !11, i64 40, !11, i64 44, !11, i64 48, !11, i64 52, !11, i64 56, !8, i64 64, !11, i64 72}
!30 = !{!29, !11, i64 44}
!31 = !{!6, !11, i64 32}
!32 = !{!29, !11, i64 32}
!33 = !{!29, !11, i64 36}
!34 = !{!29, !11, i64 52}
!35 = !{!29, !11, i64 16}
!36 = !{!29, !11, i64 20}
!37 = !{!29, !11, i64 40}
!38 = !{!29, !11, i64 56}
!39 = !{!29, !8, i64 64}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,MergedLoadStoreMotionPass,PostOrderFunctionAttrsPass,ReassociatePass,SLPVectorizerPass,SROAPass,SimplifyCFGPass,TailCallElimPass