; LLVM IR from paintdream/DontStarveLuaJIT :: src/luajit/src (lj_snap)

; 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.jit_State = type { %struct.GCtrace, ptr, ptr, ptr, ptr, ptr, i32, i32, i32, i8, i8, %struct.IRType1, i8, %struct.FoldState, ptr, i32, i32, i32, i32, i32, i32, i32, %struct.MRef, [5 x %union.TValue], ptr, i32, i32, i32, i32, ptr, ptr, i32, i32, i8, ptr, i32, i32, ptr, [100 x i16], [255 x i32], [15 x i32], [16 x ptr], [64 x %struct.HotPenalty], i32, i32, [16 x %struct.BPropEntry], i32, %struct.ScEvEntry, ptr, i32, i32, ptr, i32, i32, ptr, ptr, ptr, i64, i64, %union.TValue, ptr, i32, i32 }
%struct.GCtrace = type { %struct.GCRef, i8, i8, i8, i8, i32, %struct.GCRef, ptr, i32, i16, i16, ptr, ptr, %struct.GCRef, %struct.MRef, i32, i32, ptr, i32, i16, i16, i16, i16, i16, i16, i16, i8, i8 }
%struct.GCRef = type { i32 }
%struct.IRType1 = type { i8 }
%struct.FoldState = type { %union.IRIns, %union.IRIns, %union.IRIns }
%union.IRIns = type { %struct.anon.0 }
%struct.anon.0 = type { i32, %struct.IRType1, i8, i8, i8 }
%struct.MRef = type { i32 }
%struct.HotPenalty = type { %struct.MRef, i16, i16 }
%struct.BPropEntry = type { i16, i16, i32 }
%struct.ScEvEntry = type { %struct.MRef, i16, i16, i16, i16, %struct.IRType1, i8 }
%union.TValue = type { i64 }
%struct.SnapShot = type { i16, i16, i8, i8, i8, i8 }
%struct.lua_State = type { %union.anon.4 }
%union.anon.4 = type { %struct.anon.5, [320 x i8] }
%struct.anon.5 = type { %struct.GCRef, i8, i8, i8, i8, %struct.MRef, %struct.GCRef, ptr, ptr, %struct.MRef, %struct.MRef, %struct.GCRef, %struct.GCRef, ptr, i32 }
%struct.anon.2 = type { %struct.GCRef, %union.FrameLink }
%union.FrameLink = type { i32 }
%struct.GCfuncL = type { %struct.GCRef, i8, i8, i8, i8, %struct.GCRef, %struct.GCRef, %struct.MRef, [1 x %struct.GCRef] }
%struct.GCproto = type { %struct.GCRef, i8, i8, i8, i8, i32, %struct.GCRef, %struct.MRef, %struct.MRef, i32, i32, i32, i8, i8, i16, %struct.GCRef, i32, i32, %struct.MRef, %struct.MRef, %struct.MRef }

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

; 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 hidden i64 @snap_renamefilter(ptr noundef, i32 noundef) #1

; Function Attrs: nounwind uwtable
define hidden ptr @lj_snap_restore(ptr noundef %0, ptr noundef %1) #1 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca i64, align 8
  %14 = alloca ptr, align 8
  %15 = alloca i64, align 8
  %16 = alloca ptr, align 8
  %17 = alloca ptr, align 8
  %18 = alloca i32, align 4
  %19 = alloca ptr, align 8
  %20 = alloca i32, align 4
  %21 = alloca ptr, align 8
  %22 = alloca i32, align 4
  %23 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #5
  %24 = load ptr, ptr %4, align 8, !tbaa !5
  store ptr %24, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  %25 = load ptr, ptr %3, align 8, !tbaa !5
  %26 = getelementptr inbounds %struct.jit_State, ptr %25, i32 0, i32 50
  %27 = load i32, ptr %26, align 4, !tbaa !9
  store i32 %27, ptr %6, align 4, !tbaa !20
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #5
  %28 = load ptr, ptr %3, align 8, !tbaa !5
  %29 = getelementptr inbounds %struct.jit_State, ptr %28, i32 0, i32 34
  %30 = load ptr, ptr %29, align 8, !tbaa !21
  %31 = load ptr, ptr %3, align 8, !tbaa !5
  %32 = getelementptr inbounds %struct.jit_State, ptr %31, i32 0, i32 49
  %33 = load i32, ptr %32, align 8, !tbaa !22
  %34 = zext i32 %33 to i64
  %35 = getelementptr inbounds %struct.GCRef, ptr %30, i64 %34
  %36 = getelementptr inbounds %struct.GCRef, ptr %35, i32 0, i32 0
  %37 = load i32, ptr %36, align 4, !tbaa !23
  %38 = zext i32 %37 to i64
  %39 = inttoptr i64 %38 to ptr
  store ptr %39, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #5
  %40 = load ptr, ptr %7, align 8, !tbaa !5
  %41 = getelementptr inbounds %struct.GCtrace, ptr %40, i32 0, i32 11
  %42 = load ptr, ptr %41, align 8, !tbaa !24
  %43 = load i32, ptr %6, align 4, !tbaa !20
  %44 = zext i32 %43 to i64
  %45 = getelementptr inbounds %struct.SnapShot, ptr %42, i64 %44
  store ptr %45, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  %46 = load ptr, ptr %8, align 8, !tbaa !5
  %47 = getelementptr inbounds %struct.SnapShot, ptr %46, i32 0, i32 4
  %48 = load i8, ptr %47, align 2, !tbaa !25
  %49 = zext i8 %48 to i32
  store i32 %49, ptr %10, align 4, !tbaa !20
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  %50 = load ptr, ptr %7, align 8, !tbaa !5
  %51 = getelementptr inbounds %struct.GCtrace, ptr %50, i32 0, i32 12
  %52 = load ptr, ptr %51, align 8, !tbaa !27
  %53 = load ptr, ptr %8, align 8, !tbaa !5
  %54 = getelementptr inbounds %struct.SnapShot, ptr %53, i32 0, i32 0
  %55 = load i16, ptr %54, align 2, !tbaa !28
  %56 = zext i16 %55 to i64
  %57 = getelementptr inbounds i32, ptr %52, i64 %56
  store ptr %57, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  %58 = load ptr, ptr %7, align 8, !tbaa !5
  %59 = getelementptr inbounds %struct.GCtrace, ptr %58, i32 0, i32 12
  %60 = load ptr, ptr %59, align 8, !tbaa !27
  %61 = load ptr, ptr %7, align 8, !tbaa !5
  %62 = load ptr, ptr %8, align 8, !tbaa !5
  %63 = call i32 @snap_nextofs(ptr noundef %61, ptr noundef %62)
  %64 = sub i32 %63, 1
  %65 = zext i32 %64 to i64
  %66 = getelementptr inbounds i32, ptr %60, i64 %65
  store ptr %66, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #5
  %67 = load ptr, ptr %7, align 8, !tbaa !5
  %68 = load i32, ptr %6, align 4, !tbaa !20
  %69 = call i64 @snap_renamefilter(ptr noundef %67, i32 noundef %68)
  store i64 %69, ptr %15, align 8, !tbaa !29
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #5
  %70 = load ptr, ptr %11, align 8, !tbaa !5
  %71 = load i32, ptr %10, align 4, !tbaa !20
  %72 = zext i32 %71 to i64
  %73 = getelementptr inbounds i32, ptr %70, i64 %72
  %74 = load i32, ptr %73, align 4, !tbaa !20
  %75 = zext i32 %74 to i64
  %76 = inttoptr i64 %75 to ptr
  store ptr %76, ptr %16, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #5
  %77 = load ptr, ptr %3, align 8, !tbaa !5
  %78 = getelementptr inbounds %struct.jit_State, ptr %77, i32 0, i32 1
  %79 = load ptr, ptr %78, align 8, !tbaa !30
  store ptr %79, ptr %17, align 8, !tbaa !5
  %80 = load ptr, ptr %16, align 8, !tbaa !5
  %81 = getelementptr inbounds i32, ptr %80, i64 1
  %82 = ptrtoint ptr %81 to i64
  %83 = trunc i64 %82 to i32
  %84 = load ptr, ptr %17, align 8, !tbaa !5
  %85 = getelementptr inbounds %struct.lua_State, ptr %84, i32 0, i32 0
  %86 = getelementptr inbounds %struct.anon.5, ptr %85, i32 0, i32 13
  %87 = load ptr, ptr %86, align 8, !tbaa !31
  %88 = ptrtoint ptr %87 to i64
  %89 = and i64 %88, -4
  %90 = inttoptr i64 %89 to ptr
  %91 = getelementptr inbounds i8, ptr %90, i64 28
  %92 = getelementptr inbounds %struct.MRef, ptr %91, i32 0, i32 0
  store i32 %83, ptr %92, align 4, !tbaa !32
  %93 = load ptr, ptr %17, align 8, !tbaa !5
  %94 = getelementptr inbounds %struct.lua_State, ptr %93, i32 0, i32 0
  %95 = getelementptr inbounds %struct.anon.5, ptr %94, i32 0, i32 7
  %96 = load ptr, ptr %95, align 8, !tbaa !31
  %97 = load ptr, ptr %8, align 8, !tbaa !5
  %98 = getelementptr inbounds %struct.SnapShot, ptr %97, i32 0, i32 3
  %99 = load i8, ptr %98, align 1, !tbaa !33
  %100 = zext i8 %99 to i32
  %101 = sext i32 %100 to i64
  %102 = getelementptr inbounds %union.TValue, ptr %96, i64 %101
  %103 = load ptr, ptr %17, align 8, !tbaa !5
  %104 = getelementptr inbounds %struct.lua_State, ptr %103, i32 0, i32 0
  %105 = getelementptr inbounds %struct.anon.5, ptr %104, i32 0, i32 9
  %106 = getelementptr inbounds %struct.MRef, ptr %105, i32 0, i32 0
  %107 = load i32, ptr %106, align 8, !tbaa !31
  %108 = zext i32 %107 to i64
  %109 = inttoptr i64 %108 to ptr
  %110 = icmp uge ptr %102, %109
  %111 = xor i1 %110, true
  %112 = xor i1 %111, true
  %113 = zext i1 %112 to i32
  %114 = sext i32 %113 to i64
  %115 = call i64 @llvm.expect.i64(i64 %114, i64 0)
  %116 = icmp ne i64 %115, 0
  br i1 %116, label %117, label %171

117:                                              ; preds = %2
  %118 = load ptr, ptr %17, align 8, !tbaa !5
  %119 = getelementptr inbounds %struct.lua_State, ptr %118, i32 0, i32 0
  %120 = getelementptr inbounds %struct.anon.5, ptr %119, i32 0, i32 7
  %121 = load ptr, ptr %120, align 8, !tbaa !31
  %122 = load ptr, ptr %17, align 8, !tbaa !5
  %123 = getelementptr inbounds %struct.lua_State, ptr %122, i32 0, i32 0
  %124 = getelementptr inbounds %struct.anon.5, ptr %123, i32 0, i32 7
  %125 = load ptr, ptr %124, align 8, !tbaa !31
  %126 = getelementptr inbounds %union.TValue, ptr %125, i64 -1
  %127 = getelementptr inbounds %struct.anon.2, ptr %126, i32 0, i32 0
  %128 = getelementptr inbounds %struct.GCRef, ptr %127, i32 0, i32 0
  %129 = load i32, ptr %128, align 8, !tbaa !31
  %130 = zext i32 %129 to i64
  %131 = inttoptr i64 %130 to ptr
  %132 = getelementptr inbounds %struct.GCfuncL, ptr %131, i32 0, i32 7
  %133 = getelementptr inbounds %struct.MRef, ptr %132, i32 0, i32 0
  %134 = load i32, ptr %133, align 8, !tbaa !31
  %135 = zext i32 %134 to i64
  %136 = inttoptr i64 %135 to ptr
  %137 = getelementptr inbounds i8, ptr %136, i64 -64
  %138 = getelementptr inbounds %struct.GCproto, ptr %137, i32 0, i32 4
  %139 = load i8, ptr %138, align 1, !tbaa !34
  %140 = zext i8 %139 to i32
  %141 = sext i32 %140 to i64
  %142 = getelementptr inbounds %union.TValue, ptr %121, i64 %141
  %143 = load ptr, ptr %17, align 8, !tbaa !5
  %144 = getelementptr inbounds %struct.lua_State, ptr %143, i32 0, i32 0
  %145 = getelementptr inbounds %struct.anon.5, ptr %144, i32 0, i32 8
  store ptr %142, ptr %145, align 8, !tbaa !31
  %146 = load ptr, ptr %17, align 8, !tbaa !5
  %147 = load ptr, ptr %8, align 8, !tbaa !5
  %148 = getelementptr inbounds %struct.SnapShot, ptr %147, i32 0, i32 3
  %149 = load i8, ptr %148, align 1, !tbaa !33
  %150 = zext i8 %149 to i32
  %151 = load ptr, ptr %17, align 8, !tbaa !5
  %152 = getelementptr inbounds %struct.lua_State, ptr %151, i32 0, i32 0
  %153 = getelementptr inbounds %struct.anon.5, ptr %152, i32 0, i32 7
  %154 = load ptr, ptr %153, align 8, !tbaa !31
  %155 = getelementptr inbounds %union.TValue, ptr %154, i64 -1
  %156 = getelementptr inbounds %struct.anon.2, ptr %155, i32 0, i32 0
  %157 = getelementptr inbounds %struct.GCRef, ptr %156, i32 0, i32 0
  %158 = load i32, ptr %157, align 8, !tbaa !31
  %159 = zext i32 %158 to i64
  %160 = inttoptr i64 %159 to ptr
  %161 = getelementptr inbounds %struct.GCfuncL, ptr %160, i32 0, i32 7
  %162 = getelementptr inbounds %struct.MRef, ptr %161, i32 0, i32 0
  %163 = load i32, ptr %162, align 8, !tbaa !31
  %164 = zext i32 %163 to i64
  %165 = inttoptr i64 %164 to ptr
  %166 = getelementptr inbounds i8, ptr %165, i64 -64
  %167 = getelementptr inbounds %struct.GCproto, ptr %166, i32 0, i32 4
  %168 = load i8, ptr %167, align 1, !tbaa !34
  %169 = zext i8 %168 to i32
  %170 = sub nsw i32 %150, %169
  call void @lj_state_growstack(ptr noundef %146, i32 noundef %170)
  br label %171

171:                                              ; preds = %117, %2
  %172 = load ptr, ptr %17, align 8, !tbaa !5
  %173 = getelementptr inbounds %struct.lua_State, ptr %172, i32 0, i32 0
  %174 = getelementptr inbounds %struct.anon.5, ptr %173, i32 0, i32 7
  %175 = load ptr, ptr %174, align 8, !tbaa !31
  %176 = getelementptr inbounds %union.TValue, ptr %175, i64 -1
  store ptr %176, ptr %14, align 8, !tbaa !5
  %177 = load ptr, ptr %14, align 8, !tbaa !5
  %178 = getelementptr inbounds %struct.anon.2, ptr %177, i32 0, i32 1
  %179 = load i32, ptr %178, align 4, !tbaa !31
  %180 = sext i32 %179 to i64
  store i64 %180, ptr %13, align 8, !tbaa !29
  store i32 0, ptr %9, align 4, !tbaa !20
  br label %181

181:                                              ; preds = %292, %171
  %182 = load i32, ptr %9, align 4, !tbaa !20
  %183 = load i32, ptr %10, align 4, !tbaa !20
  %184 = icmp ult i32 %182, %183
  br i1 %184, label %185, label %295

185:                                              ; preds = %181
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #5
  %186 = load ptr, ptr %11, align 8, !tbaa !5
  %187 = load i32, ptr %9, align 4, !tbaa !20
  %188 = zext i32 %187 to i64
  %189 = getelementptr inbounds i32, ptr %186, i64 %188
  %190 = load i32, ptr %189, align 4, !tbaa !20
  store i32 %190, ptr %18, align 4, !tbaa !20
  %191 = load i32, ptr %18, align 4, !tbaa !20
  %192 = and i32 %191, 262144
  %193 = icmp ne i32 %192, 0
  br i1 %193, label %288, label %194

194:                                              ; preds = %185
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #5
  %195 = load ptr, ptr %14, align 8, !tbaa !5
  %196 = load i32, ptr %18, align 4, !tbaa !20
  %197 = lshr i32 %196, 24
  %198 = zext i32 %197 to i64
  %199 = getelementptr inbounds %union.TValue, ptr %195, i64 %198
  store ptr %199, ptr %19, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #5
  %200 = load i32, ptr %18, align 4, !tbaa !20
  %201 = and i32 %200, 65535
  store i32 %201, ptr %20, align 4, !tbaa !20
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #5
  %202 = load ptr, ptr %7, align 8, !tbaa !5
  %203 = getelementptr inbounds %struct.GCtrace, ptr %202, i32 0, i32 7
  %204 = load ptr, ptr %203, align 8, !tbaa !36
  %205 = load i32, ptr %20, align 4, !tbaa !20
  %206 = zext i32 %205 to i64
  %207 = getelementptr inbounds %union.IRIns, ptr %204, i64 %206
  store ptr %207, ptr %21, align 8, !tbaa !5
  %208 = load ptr, ptr %21, align 8, !tbaa !5
  %209 = getelementptr inbounds %struct.anon.0, ptr %208, i32 0, i32 3
  %210 = load i8, ptr %209, align 2, !tbaa !31
  %211 = zext i8 %210 to i32
  %212 = icmp eq i32 %211, 253
  br i1 %212, label %213, label %252

213:                                              ; preds = %194
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #5
  store i32 0, ptr %22, align 4, !tbaa !20
  br label %214

214:                                              ; preds = %240, %213
  %215 = load i32, ptr %22, align 4, !tbaa !20
  %216 = load i32, ptr %9, align 4, !tbaa !20
  %217 = icmp ult i32 %215, %216
  br i1 %217, label %218, label %243

218:                                              ; preds = %214
  %219 = load ptr, ptr %11, align 8, !tbaa !5
  %220 = load i32, ptr %22, align 4, !tbaa !20
  %221 = zext i32 %220 to i64
  %222 = getelementptr inbounds i32, ptr %219, i64 %221
  %223 = load i32, ptr %222, align 4, !tbaa !20
  %224 = and i32 %223, 65535
  %225 = load i32, ptr %20, align 4, !tbaa !20
  %226 = icmp eq i32 %224, %225
  br i1 %226, label %227, label %239

227:                                              ; preds = %218
  %228 = load ptr, ptr %17, align 8, !tbaa !5
  %229 = load ptr, ptr %19, align 8, !tbaa !5
  %230 = load ptr, ptr %14, align 8, !tbaa !5
  %231 = load ptr, ptr %11, align 8, !tbaa !5
  %232 = load i32, ptr %22, align 4, !tbaa !20
  %233 = zext i32 %232 to i64
  %234 = getelementptr inbounds i32, ptr %231, i64 %233
  %235 = load i32, ptr %234, align 4, !tbaa !20
  %236 = lshr i32 %235, 24
  %237 = zext i32 %236 to i64
  %238 = getelementptr inbounds %union.TValue, ptr %230, i64 %237
  call void @copyTV(ptr noundef %228, ptr noundef %229, ptr noundef %238)
  br label %251

239:                                              ; preds = %218
  br label %240

240:                                              ; preds = %239
  %241 = load i32, ptr %22, align 4, !tbaa !20
  %242 = add i32 %241, 1
  store i32 %242, ptr %22, align 4, !tbaa !20
  br label %214, !llvm.loop !37

243:                                              ; preds = %214
  %244 = load ptr, ptr %3, align 8, !tbaa !5
  %245 = load ptr, ptr %7, align 8, !tbaa !5
  %246 = load ptr, ptr %5, align 8, !tbaa !5
  %247 = load i32, ptr %6, align 4, !tbaa !20
  %248 = load i64, ptr %15, align 8, !tbaa !29
  %249 = load ptr, ptr %21, align 8, !tbaa !5
  %250 = load ptr, ptr %19, align 8, !tbaa !5
  call void @snap_unsink(ptr noundef %244, ptr noundef %245, ptr noundef %246, i32 noundef %247, i64 noundef %248, ptr noundef %249, ptr noundef %250)
  br label %251

251:                                              ; preds = %243, %227
  store i32 4, ptr %23, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #5
  br label %285

252:                                              ; preds = %194
  %253 = load ptr, ptr %3, align 8, !tbaa !5
  %254 = load ptr, ptr %7, align 8, !tbaa !5
  %255 = load ptr, ptr %5, align 8, !tbaa !5
  %256 = load i32, ptr %6, align 4, !tbaa !20
  %257 = load i64, ptr %15, align 8, !tbaa !29
  %258 = load i32, ptr %20, align 4, !tbaa !20
  %259 = load ptr, ptr %19, align 8, !tbaa !5
  call void @snap_restoreval(ptr noundef %253, ptr noundef %254, ptr noundef %255, i32 noundef %256, i64 noundef %257, i32 noundef %258, ptr noundef %259)
  %260 = load i32, ptr %18, align 4, !tbaa !20
  %261 = and i32 %260, 196608
  %262 = icmp ne i32 %261, 0
  br i1 %262, label %263, label %284

263:                                              ; preds = %252
  %264 = load i32, ptr %18, align 4, !tbaa !20
  %265 = lshr i32 %264, 24
  %266 = icmp ne i32 %265, 0
  br i1 %266, label %267, label %272

267:                                              ; preds = %263
  %268 = load ptr, ptr %12, align 8, !tbaa !5
  %269 = getelementptr inbounds i32, ptr %268, i32 -1
  store ptr %269, ptr %12, align 8, !tbaa !5
  %270 = load i32, ptr %268, align 4, !tbaa !20
  %271 = sext i32 %270 to i64
  br label %274

272:                                              ; preds = %263
  %273 = load i64, ptr %13, align 8, !tbaa !29
  br label %274

274:                                              ; preds = %272, %267
  %275 = phi i64 [ %271, %267 ], [ %273, %272 ]
  %276 = trunc i64 %275 to i32
  %277 = load ptr, ptr %19, align 8, !tbaa !5
  %278 = getelementptr inbounds %struct.anon.2, ptr %277, i32 0, i32 1
  store i32 %276, ptr %278, align 4, !tbaa !31
  %279 = load ptr, ptr %19, align 8, !tbaa !5
  %280 = getelementptr inbounds %union.TValue, ptr %279, i64 1
  %281 = load ptr, ptr %17, align 8, !tbaa !5
  %282 = getelementptr inbounds %struct.lua_State, ptr %281, i32 0, i32 0
  %283 = getelementptr inbounds %struct.anon.5, ptr %282, i32 0, i32 7
  store ptr %280, ptr %283, align 8, !tbaa !31
  br label %284

284:                                              ; preds = %274, %252
  store i32 0, ptr %23, align 4
  br label %285

285:                                              ; preds = %284, %251
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #5
  %286 = load i32, ptr %23, align 4
  switch i32 %286, label %289 [
    i32 0, label %287
  ]

287:                                              ; preds = %285
  br label %288

288:                                              ; preds = %287, %185
  store i32 0, ptr %23, align 4
  br label %289

289:                                              ; preds = %288, %285
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #5
  %290 = load i32, ptr %23, align 4
  switch i32 %290, label %347 [
    i32 0, label %291
    i32 4, label %292
  ]

291:                                              ; preds = %289
  br label %292

292:                                              ; preds = %291, %289
  %293 = load i32, ptr %9, align 4, !tbaa !20
  %294 = add i32 %293, 1
  store i32 %294, ptr %9, align 4, !tbaa !20
  br label %181, !llvm.loop !39

295:                                              ; preds = %181
  %296 = load ptr, ptr %16, align 8, !tbaa !5
  %297 = load i32, ptr %296, align 4, !tbaa !20
  %298 = and i32 %297, 255
  switch i32 %298, label %299 [
    i32 65, label %334
    i32 67, label %334
    i32 73, label %334
    i32 63, label %334
  ]

299:                                              ; preds = %295
  %300 = load ptr, ptr %16, align 8, !tbaa !5
  %301 = load i32, ptr %300, align 4, !tbaa !20
  %302 = and i32 %301, 255
  %303 = icmp ult i32 %302, 89
  br i1 %303, label %304, label %333

304:                                              ; preds = %299
  %305 = load ptr, ptr %17, align 8, !tbaa !5
  %306 = getelementptr inbounds %struct.lua_State, ptr %305, i32 0, i32 0
  %307 = getelementptr inbounds %struct.anon.5, ptr %306, i32 0, i32 7
  %308 = load ptr, ptr %307, align 8, !tbaa !31
  %309 = load ptr, ptr %17, align 8, !tbaa !5
  %310 = getelementptr inbounds %struct.lua_State, ptr %309, i32 0, i32 0
  %311 = getelementptr inbounds %struct.anon.5, ptr %310, i32 0, i32 7
  %312 = load ptr, ptr %311, align 8, !tbaa !31
  %313 = getelementptr inbounds %union.TValue, ptr %312, i64 -1
  %314 = getelementptr inbounds %struct.anon.2, ptr %313, i32 0, i32 0
  %315 = getelementptr inbounds %struct.GCRef, ptr %314, i32 0, i32 0
  %316 = load i32, ptr %315, align 8, !tbaa !31
  %317 = zext i32 %316 to i64
  %318 = inttoptr i64 %317 to ptr
  %319 = getelementptr inbounds %struct.GCfuncL, ptr %318, i32 0, i32 7
  %320 = getelementptr inbounds %struct.MRef, ptr %319, i32 0, i32 0
  %321 = load i32, ptr %320, align 8, !tbaa !31
  %322 = zext i32 %321 to i64
  %323 = inttoptr i64 %322 to ptr
  %324 = getelementptr inbounds i8, ptr %323, i64 -64
  %325 = getelementptr inbounds %struct.GCproto, ptr %324, i32 0, i32 4
  %326 = load i8, ptr %325, align 1, !tbaa !34
  %327 = zext i8 %326 to i32
  %328 = sext i32 %327 to i64
  %329 = getelementptr inbounds %union.TValue, ptr %308, i64 %328
  %330 = load ptr, ptr %17, align 8, !tbaa !5
  %331 = getelementptr inbounds %struct.lua_State, ptr %330, i32 0, i32 0
  %332 = getelementptr inbounds %struct.anon.5, ptr %331, i32 0, i32 8
  store ptr %329, ptr %332, align 8, !tbaa !31
  br label %345

333:                                              ; preds = %299
  br label %334

334:                                              ; preds = %333, %295, %295, %295, %295
  %335 = load ptr, ptr %14, align 8, !tbaa !5
  %336 = load ptr, ptr %8, align 8, !tbaa !5
  %337 = getelementptr inbounds %struct.SnapShot, ptr %336, i32 0, i32 2
  %338 = load i8, ptr %337, align 2, !tbaa !40
  %339 = zext i8 %338 to i32
  %340 = sext i32 %339 to i64
  %341 = getelementptr inbounds %union.TValue, ptr %335, i64 %340
  %342 = load ptr, ptr %17, align 8, !tbaa !5
  %343 = getelementptr inbounds %struct.lua_State, ptr %342, i32 0, i32 0
  %344 = getelementptr inbounds %struct.anon.5, ptr %343, i32 0, i32 8
  store ptr %341, ptr %344, align 8, !tbaa !31
  br label %345

345:                                              ; preds = %334, %304
  %346 = load ptr, ptr %16, align 8, !tbaa !5
  store i32 1, ptr %23, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #5
  ret ptr %346

347:                                              ; preds = %289
  unreachable
}

; Function Attrs: alwaysinline nounwind uwtable
declare hidden i32 @snap_nextofs(ptr noundef, ptr noundef) #2

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(none)
declare i64 @llvm.expect.i64(i64, i64) #3

declare hidden void @lj_state_growstack(ptr noundef, i32 noundef) #4

; Function Attrs: alwaysinline nounwind uwtable
declare hidden void @copyTV(ptr noundef, ptr noundef, ptr noundef) #2

; Function Attrs: nounwind uwtable
declare hidden void @snap_unsink(ptr noundef, ptr noundef, ptr noundef, i32 noundef, i64 noundef, ptr noundef, ptr noundef) #1

; Function Attrs: nounwind uwtable
declare hidden void @snap_restoreval(ptr noundef, ptr noundef, ptr noundef, i32 noundef, i64 noundef, i32 noundef, ptr noundef) #1

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { alwaysinline 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 willreturn memory(none) }
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 = { 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/C++ TBAA"}
!9 = !{!10, !13, i64 2428}
!10 = !{!"jit_State", !11, i64 0, !6, i64 96, !6, i64 104, !6, i64 112, !6, i64 120, !6, i64 128, !13, i64 136, !13, i64 140, !13, i64 144, !7, i64 148, !7, i64 149, !16, i64 150, !7, i64 151, !17, i64 152, !6, i64 176, !13, i64 184, !13, i64 188, !13, i64 192, !13, i64 196, !13, i64 200, !13, i64 204, !13, i64 208, !15, i64 212, !7, i64 216, !6, i64 256, !13, i64 264, !13, i64 268, !13, i64 272, !13, i64 276, !6, i64 280, !6, i64 288, !13, i64 296, !13, i64 300, !7, i64 304, !6, i64 312, !13, i64 320, !13, i64 324, !6, i64 328, !7, i64 336, !7, i64 536, !7, i64 1556, !7, i64 1616, !7, i64 1744, !13, i64 2256, !13, i64 2260, !7, i64 2264, !13, i64 2392, !18, i64 2396, !6, i64 2416, !13, i64 2424, !13, i64 2428, !6, i64 2432, !13, i64 2440, !13, i64 2444, !6, i64 2448, !6, i64 2456, !6, i64 2464, !19, i64 2472, !19, i64 2480, !7, i64 2488, !6, i64 2496, !13, i64 2504, !13, i64 2508}
!11 = !{!"GCtrace", !12, i64 0, !7, i64 4, !7, i64 5, !7, i64 6, !7, i64 7, !13, i64 8, !12, i64 12, !6, i64 16, !13, i64 24, !14, i64 28, !14, i64 30, !6, i64 32, !6, i64 40, !12, i64 48, !15, i64 52, !13, i64 56, !13, i64 60, !6, i64 64, !13, i64 72, !14, i64 76, !14, i64 78, !14, i64 80, !14, i64 82, !14, i64 84, !14, i64 86, !14, i64 88, !7, i64 90, !7, i64 91}
!12 = !{!"GCRef", !13, i64 0}
!13 = !{!"int", !7, i64 0}
!14 = !{!"short", !7, i64 0}
!15 = !{!"MRef", !13, i64 0}
!16 = !{!"IRType1", !7, i64 0}
!17 = !{!"FoldState", !7, i64 0, !7, i64 8, !7, i64 16}
!18 = !{!"ScEvEntry", !15, i64 0, !14, i64 4, !14, i64 6, !14, i64 8, !14, i64 10, !16, i64 12, !7, i64 13}
!19 = !{!"long", !7, i64 0}
!20 = !{!13, !13, i64 0}
!21 = !{!10, !6, i64 312}
!22 = !{!10, !13, i64 2424}
!23 = !{!12, !13, i64 0}
!24 = !{!11, !6, i64 32}
!25 = !{!26, !7, i64 6}
!26 = !{!"SnapShot", !14, i64 0, !14, i64 2, !7, i64 4, !7, i64 5, !7, i64 6, !7, i64 7}
!27 = !{!11, !6, i64 40}
!28 = !{!26, !14, i64 0}
!29 = !{!19, !19, i64 0}
!30 = !{!10, !6, i64 96}
!31 = !{!7, !7, i64 0}
!32 = !{!15, !13, i64 0}
!33 = !{!26, !7, i64 5}
!34 = !{!35, !7, i64 7}
!35 = !{!"GCproto", !12, i64 0, !7, i64 4, !7, i64 5, !7, i64 6, !7, i64 7, !13, i64 8, !12, i64 12, !15, i64 16, !15, i64 20, !13, i64 24, !13, i64 28, !13, i64 32, !7, i64 36, !7, i64 37, !14, i64 38, !12, i64 40, !13, i64 44, !13, i64 48, !15, i64 52, !15, i64 56, !15, i64 60}
!36 = !{!11, !6, i64 16}
!37 = distinct !{!37, !38}
!38 = !{!"llvm.loop.mustprogress"}
!39 = distinct !{!39, !38}
!40 = !{!26, !7, i64 4}


; 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.GCRef = type { i32 }
%struct.SnapShot = type { i16, i16, i8, i8, i8, i8 }
%union.TValue = type { i64 }
%union.IRIns = type { %struct.anon.0 }
%struct.anon.0 = type { i32, %struct.IRType1, i8, i8, i8 }
%struct.IRType1 = type { i8 }

; Function Attrs: nounwind uwtable
declare hidden i64 @snap_renamefilter(ptr noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
define hidden ptr @lj_snap_restore(ptr noundef %0, ptr noundef %1) local_unnamed_addr #0 {
  %3 = getelementptr inbounds i8, ptr %0, i64 2428
  %4 = load i32, ptr %3, align 4, !tbaa !5
  %5 = getelementptr inbounds i8, ptr %0, i64 312
  %6 = load ptr, ptr %5, align 8, !tbaa !19
  %7 = getelementptr inbounds i8, ptr %0, i64 2424
  %8 = load i32, ptr %7, align 8, !tbaa !20
  %9 = zext i32 %8 to i64
  %10 = getelementptr inbounds %struct.GCRef, ptr %6, i64 %9
  %11 = load i32, ptr %10, align 4, !tbaa !21
  %12 = zext i32 %11 to i64
  %13 = inttoptr i64 %12 to ptr
  %14 = getelementptr inbounds i8, ptr %13, i64 32
  %15 = load ptr, ptr %14, align 8, !tbaa !22
  %16 = zext i32 %4 to i64
  %17 = getelementptr inbounds %struct.SnapShot, ptr %15, i64 %16
  %18 = getelementptr inbounds i8, ptr %17, i64 6
  %19 = load i8, ptr %18, align 2, !tbaa !23
  %20 = getelementptr inbounds i8, ptr %13, i64 40
  %21 = load ptr, ptr %20, align 8, !tbaa !25
  %22 = load i16, ptr %17, align 2, !tbaa !26
  %23 = zext i16 %22 to i64
  %24 = getelementptr inbounds i32, ptr %21, i64 %23
  %25 = tail call i32 @snap_nextofs(ptr noundef %13, ptr noundef nonnull %17)
  %26 = add i32 %25, -1
  %27 = zext i32 %26 to i64
  %28 = getelementptr inbounds i32, ptr %21, i64 %27
  %29 = tail call i64 @snap_renamefilter(ptr noundef %13, i32 noundef %4)
  %30 = zext i8 %19 to i64
  %31 = getelementptr inbounds i32, ptr %24, i64 %30
  %32 = load i32, ptr %31, align 4, !tbaa !27
  %33 = zext i32 %32 to i64
  %34 = inttoptr i64 %33 to ptr
  %35 = getelementptr inbounds i8, ptr %0, i64 96
  %36 = load ptr, ptr %35, align 8, !tbaa !28
  %37 = getelementptr inbounds i8, ptr %34, i64 4
  %38 = ptrtoint ptr %37 to i64
  %39 = trunc i64 %38 to i32
  %40 = getelementptr inbounds i8, ptr %36, i64 48
  %41 = load ptr, ptr %40, align 8, !tbaa !29
  %42 = ptrtoint ptr %41 to i64
  %43 = and i64 %42, -4
  %44 = inttoptr i64 %43 to ptr
  %45 = getelementptr inbounds i8, ptr %44, i64 28
  store i32 %39, ptr %45, align 4, !tbaa !30
  %46 = getelementptr inbounds i8, ptr %36, i64 16
  %47 = load ptr, ptr %46, align 8, !tbaa !29
  %48 = getelementptr inbounds i8, ptr %17, i64 5
  %49 = load i8, ptr %48, align 1, !tbaa !31
  %50 = zext i8 %49 to i64
  %51 = getelementptr inbounds %union.TValue, ptr %47, i64 %50
  %52 = getelementptr inbounds i8, ptr %36, i64 32
  %53 = load i32, ptr %52, align 8, !tbaa !29
  %54 = zext i32 %53 to i64
  %55 = inttoptr i64 %54 to ptr
  %.not = icmp ult ptr %51, %55
  br i1 %.not, label %83, label %56, !prof !32

56:                                               ; preds = %2
  %57 = getelementptr inbounds i8, ptr %47, i64 -8
  %58 = load i32, ptr %57, align 8, !tbaa !29
  %59 = zext i32 %58 to i64
  %60 = inttoptr i64 %59 to ptr
  %61 = getelementptr inbounds i8, ptr %60, i64 16
  %62 = load i32, ptr %61, align 8, !tbaa !29
  %63 = zext i32 %62 to i64
  %64 = inttoptr i64 %63 to ptr
  %65 = getelementptr inbounds i8, ptr %64, i64 -57
  %66 = load i8, ptr %65, align 1, !tbaa !33
  %67 = zext i8 %66 to i64
  %68 = getelementptr inbounds %union.TValue, ptr %47, i64 %67
  %69 = getelementptr inbounds i8, ptr %36, i64 24
  store ptr %68, ptr %69, align 8, !tbaa !29
  %70 = load i8, ptr %48, align 1, !tbaa !31
  %71 = zext i8 %70 to i32
  %72 = load i32, ptr %57, align 8, !tbaa !29
  %73 = zext i32 %72 to i64
  %74 = inttoptr i64 %73 to ptr
  %75 = getelementptr inbounds i8, ptr %74, i64 16
  %76 = load i32, ptr %75, align 8, !tbaa !29
  %77 = zext i32 %76 to i64
  %78 = inttoptr i64 %77 to ptr
  %79 = getelementptr inbounds i8, ptr %78, i64 -57
  %80 = load i8, ptr %79, align 1, !tbaa !33
  %81 = zext i8 %80 to i32
  %82 = sub nsw i32 %71, %81
  tail call void @lj_state_growstack(ptr noundef nonnull %36, i32 noundef %82) #4
  %.pre = load ptr, ptr %46, align 8, !tbaa !29
  br label %83

83:                                               ; preds = %56, %2
  %84 = phi ptr [ %.pre, %56 ], [ %47, %2 ]
  %85 = getelementptr inbounds i8, ptr %84, i64 -8
  %86 = getelementptr inbounds i8, ptr %84, i64 -4
  %87 = load i32, ptr %86, align 4, !tbaa !29
  %.not96 = icmp eq i8 %19, 0
  br i1 %.not96, label %._crit_edge95, label %.lr.ph94

.lr.ph94:                                         ; preds = %83
  %88 = getelementptr inbounds i8, ptr %13, i64 16
  %wide.trip.count103 = zext i8 %19 to i64
  br label %89

89:                                               ; preds = %.lr.ph94, %121
  %indvars.iv100 = phi i64 [ 0, %.lr.ph94 ], [ %indvars.iv.next101, %121 ]
  %.08591 = phi ptr [ %28, %.lr.ph94 ], [ %.5, %121 ]
  %90 = getelementptr inbounds i32, ptr %24, i64 %indvars.iv100
  %91 = load i32, ptr %90, align 4, !tbaa !27
  %92 = and i32 %91, 262144
  %.not86 = icmp eq i32 %92, 0
  br i1 %.not86, label %93, label %121

93:                                               ; preds = %89
  %94 = lshr i32 %91, 24
  %95 = zext nneg i32 %94 to i64
  %96 = getelementptr inbounds %union.TValue, ptr %85, i64 %95
  %97 = and i32 %91, 65535
  %98 = load ptr, ptr %88, align 8, !tbaa !35
  %99 = zext nneg i32 %97 to i64
  %100 = getelementptr inbounds %union.IRIns, ptr %98, i64 %99
  %101 = getelementptr inbounds i8, ptr %100, i64 6
  %102 = load i8, ptr %101, align 2, !tbaa !29
  %.not89 = icmp eq i8 %102, -3
  br i1 %.not89, label %.preheader, label %112

.preheader:                                       ; preds = %93
  %.not97 = icmp eq i64 %indvars.iv100, 0
  br i1 %.not97, label %._crit_edge, label %.lr.ph

103:                                              ; preds = %.lr.ph
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %indvars.iv100
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph, !llvm.loop !36

.lr.ph:                                           ; preds = %.preheader, %103
  %indvars.iv = phi i64 [ %indvars.iv.next, %103 ], [ 0, %.preheader ]
  %104 = getelementptr inbounds i32, ptr %24, i64 %indvars.iv
  %105 = load i32, ptr %104, align 4, !tbaa !27
  %106 = and i32 %105, 65535
  %107 = icmp eq i32 %106, %97
  br i1 %107, label %108, label %103

108:                                              ; preds = %.lr.ph
  %109 = lshr i32 %105, 24
  %110 = zext nneg i32 %109 to i64
  %111 = getelementptr inbounds %union.TValue, ptr %85, i64 %110
  tail call void @copyTV(ptr noundef %36, ptr noundef nonnull %96, ptr noundef nonnull %111)
  br label %121

._crit_edge:                                      ; preds = %103, %.preheader
  tail call void @snap_unsink(ptr noundef %0, ptr noundef %13, ptr noundef %1, i32 noundef %4, i64 noundef %29, ptr noundef %100, ptr noundef nonnull %96)
  br label %121

112:                                              ; preds = %93
  tail call void @snap_restoreval(ptr noundef %0, ptr noundef nonnull %13, ptr noundef %1, i32 noundef %4, i64 noundef %29, i32 noundef %97, ptr noundef nonnull %96)
  %113 = and i32 %91, 196608
  %.not87 = icmp eq i32 %113, 0
  br i1 %.not87, label %121, label %114

114:                                              ; preds = %112
  %.not88 = icmp ult i32 %91, 16777216
  br i1 %.not88, label %118, label %115

115:                                              ; preds = %114
  %116 = getelementptr inbounds i8, ptr %.08591, i64 -4
  %117 = load i32, ptr %.08591, align 4, !tbaa !27
  br label %118

118:                                              ; preds = %114, %115
  %.1 = phi ptr [ %116, %115 ], [ %.08591, %114 ]
  %.in = phi i32 [ %117, %115 ], [ %87, %114 ]
  %119 = getelementptr inbounds i8, ptr %96, i64 4
  store i32 %.in, ptr %119, align 4, !tbaa !29
  %120 = getelementptr inbounds i8, ptr %96, i64 8
  store ptr %120, ptr %46, align 8, !tbaa !29
  br label %121

121:                                              ; preds = %._crit_edge, %108, %118, %112, %89
  %.5 = phi ptr [ %.08591, %89 ], [ %.08591, %._crit_edge ], [ %.08591, %108 ], [ %.1, %118 ], [ %.08591, %112 ]
  %indvars.iv.next101 = add nuw nsw i64 %indvars.iv100, 1
  %exitcond104.not = icmp eq i64 %indvars.iv.next101, %wide.trip.count103
  br i1 %exitcond104.not, label %._crit_edge95, label %89, !llvm.loop !38

._crit_edge95:                                    ; preds = %121, %83
  %122 = load i32, ptr %34, align 4, !tbaa !27
  %123 = and i32 %122, 255
  %124 = add nsw i32 %123, -63
  %125 = tail call i32 @llvm.fshl.i32(i32 %124, i32 %124, i32 31)
  switch i32 %125, label %126 [
    i32 1, label %139
    i32 2, label %139
    i32 5, label %139
    i32 0, label %139
  ]

126:                                              ; preds = %._crit_edge95
  %127 = icmp ult i32 %123, 89
  br i1 %127, label %128, label %139

128:                                              ; preds = %126
  %129 = load ptr, ptr %46, align 8, !tbaa !29
  %130 = getelementptr inbounds i8, ptr %129, i64 -8
  %131 = load i32, ptr %130, align 8, !tbaa !29
  %132 = zext i32 %131 to i64
  %133 = inttoptr i64 %132 to ptr
  %134 = getelementptr inbounds i8, ptr %133, i64 16
  %135 = load i32, ptr %134, align 8, !tbaa !29
  %136 = zext i32 %135 to i64
  %137 = inttoptr i64 %136 to ptr
  %138 = getelementptr inbounds i8, ptr %137, i64 -57
  br label %141

139:                                              ; preds = %126, %._crit_edge95, %._crit_edge95, %._crit_edge95, %._crit_edge95
  %140 = getelementptr inbounds i8, ptr %17, i64 4
  br label %141

141:                                              ; preds = %139, %128
  %.sink.in = phi ptr [ %140, %139 ], [ %138, %128 ]
  %.sink107 = phi ptr [ %85, %139 ], [ %129, %128 ]
  %.sink = load i8, ptr %.sink.in, align 1, !tbaa !29
  %142 = zext i8 %.sink to i64
  %143 = getelementptr inbounds %union.TValue, ptr %.sink107, i64 %142
  %144 = getelementptr inbounds i8, ptr %36, i64 24
  store ptr %143, ptr %144, align 8, !tbaa !29
  ret ptr %34
}

; Function Attrs: alwaysinline nounwind uwtable
declare hidden i32 @snap_nextofs(ptr noundef, ptr noundef) local_unnamed_addr #1

declare hidden void @lj_state_growstack(ptr noundef, i32 noundef) local_unnamed_addr #2

; Function Attrs: alwaysinline nounwind uwtable
declare hidden void @copyTV(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare hidden void @snap_unsink(ptr noundef, ptr noundef, ptr noundef, i32 noundef, i64 noundef, ptr noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare hidden void @snap_restoreval(ptr noundef, ptr noundef, ptr noundef, i32 noundef, i64 noundef, i32 noundef, ptr noundef) local_unnamed_addr #0

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

attributes #0 = { 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 = { alwaysinline 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 = { "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 = { 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, !9, i64 2428}
!6 = !{!"jit_State", !7, i64 0, !12, i64 96, !12, i64 104, !12, i64 112, !12, i64 120, !12, i64 128, !9, i64 136, !9, i64 140, !9, i64 144, !10, i64 148, !10, i64 149, !15, i64 150, !10, i64 151, !16, i64 152, !12, i64 176, !9, i64 184, !9, i64 188, !9, i64 192, !9, i64 196, !9, i64 200, !9, i64 204, !9, i64 208, !14, i64 212, !10, i64 216, !12, i64 256, !9, i64 264, !9, i64 268, !9, i64 272, !9, i64 276, !12, i64 280, !12, i64 288, !9, i64 296, !9, i64 300, !10, i64 304, !12, i64 312, !9, i64 320, !9, i64 324, !12, i64 328, !10, i64 336, !10, i64 536, !10, i64 1556, !10, i64 1616, !10, i64 1744, !9, i64 2256, !9, i64 2260, !10, i64 2264, !9, i64 2392, !17, i64 2396, !12, i64 2416, !9, i64 2424, !9, i64 2428, !12, i64 2432, !9, i64 2440, !9, i64 2444, !12, i64 2448, !12, i64 2456, !12, i64 2464, !18, i64 2472, !18, i64 2480, !10, i64 2488, !12, i64 2496, !9, i64 2504, !9, i64 2508}
!7 = !{!"GCtrace", !8, i64 0, !10, i64 4, !10, i64 5, !10, i64 6, !10, i64 7, !9, i64 8, !8, i64 12, !12, i64 16, !9, i64 24, !13, i64 28, !13, i64 30, !12, i64 32, !12, i64 40, !8, i64 48, !14, i64 52, !9, i64 56, !9, i64 60, !12, i64 64, !9, i64 72, !13, i64 76, !13, i64 78, !13, i64 80, !13, i64 82, !13, i64 84, !13, i64 86, !13, i64 88, !10, i64 90, !10, i64 91}
!8 = !{!"GCRef", !9, i64 0}
!9 = !{!"int", !10, i64 0}
!10 = !{!"omnipotent char", !11, i64 0}
!11 = !{!"Simple C/C++ TBAA"}
!12 = !{!"any pointer", !10, i64 0}
!13 = !{!"short", !10, i64 0}
!14 = !{!"MRef", !9, i64 0}
!15 = !{!"IRType1", !10, i64 0}
!16 = !{!"FoldState", !10, i64 0, !10, i64 8, !10, i64 16}
!17 = !{!"ScEvEntry", !14, i64 0, !13, i64 4, !13, i64 6, !13, i64 8, !13, i64 10, !15, i64 12, !10, i64 13}
!18 = !{!"long", !10, i64 0}
!19 = !{!6, !12, i64 312}
!20 = !{!6, !9, i64 2424}
!21 = !{!8, !9, i64 0}
!22 = !{!7, !12, i64 32}
!23 = !{!24, !10, i64 6}
!24 = !{!"SnapShot", !13, i64 0, !13, i64 2, !10, i64 4, !10, i64 5, !10, i64 6, !10, i64 7}
!25 = !{!7, !12, i64 40}
!26 = !{!24, !13, i64 0}
!27 = !{!9, !9, i64 0}
!28 = !{!6, !12, i64 96}
!29 = !{!10, !10, i64 0}
!30 = !{!14, !9, i64 0}
!31 = !{!24, !10, i64 5}
!32 = !{!"branch_weights", !"expected", i32 2000, i32 1}
!33 = !{!34, !10, i64 7}
!34 = !{!"GCproto", !8, i64 0, !10, i64 4, !10, i64 5, !10, i64 6, !10, i64 7, !9, i64 8, !8, i64 12, !14, i64 16, !14, i64 20, !9, i64 24, !9, i64 28, !9, i64 32, !10, i64 36, !10, i64 37, !13, i64 38, !8, i64 40, !9, i64 44, !9, i64 48, !14, i64 52, !14, i64 56, !14, i64 60}
!35 = !{!7, !12, i64 16}
!36 = distinct !{!36, !37}
!37 = !{!"llvm.loop.mustprogress"}
!38 = distinct !{!38, !37}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopInstSimplifyPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,LowerExpectIntrinsicPass,SCCPPass,SROAPass,SimplifyCFGPass,TailCallElimPass