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

; 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.ExitDataCP = type { ptr, ptr, ptr }
%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.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.global_State = type { ptr, i32, i32, ptr, ptr, %struct.GCState, i32, %struct.SBuf, %struct.GCstr, i8, i8, i8, i8, %struct.GCRef, %union.TValue, %union.TValue, %union.TValue, %struct.Node, %struct.GCupval, i32, i32, ptr, ptr, ptr, i32, i32, %struct.GCRef, %struct.MRef, %struct.MRef, [38 x %struct.GCRef] }
%struct.GCState = type { i32, i32, i8, i8, i8, i8, i32, %struct.GCRef, %struct.MRef, %struct.GCRef, %struct.GCRef, %struct.GCRef, %struct.GCRef, i32, i32, i32, i32 }
%struct.SBuf = type { %struct.MRef, %struct.MRef, %struct.MRef, %struct.MRef }
%struct.GCstr = type { %struct.GCRef, i8, i8, i8, i8, i32, i32 }
%struct.Node = type { %union.TValue, %union.TValue, %struct.MRef, %struct.MRef }
%struct.GCupval = type { %struct.GCRef, i8, i8, i8, i8, %union.anon.6, %struct.MRef, i32 }
%union.anon.6 = type { %union.TValue }

; Function Attrs: alwaysinline nounwind uwtable
declare hidden void @setintV(ptr noundef, i32 noundef) #0

; 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

declare hidden i64 @lj_vmevent_prepare(ptr noundef, i32 noundef) #2

declare hidden void @lj_vmevent_call(ptr noundef, i64 noundef) #2

declare hidden i32 @lj_vm_cpcall(ptr noundef, ptr noundef, ptr noundef, ptr noundef) #2

; Function Attrs: nounwind willreturn memory(none)
declare ptr @__errno_location() #3

; Function Attrs: nounwind uwtable
define hidden i32 @lj_trace_exit(ptr noundef %0, ptr noundef %1) #4 {
  %3 = alloca i32, align 4
  %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 %struct.ExitDataCP, align 8
  %10 = alloca i32, align 4
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca i32, align 4
  %15 = alloca i64, align 8
  %16 = alloca ptr, align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  %17 = call ptr @__errno_location() #6
  %18 = load i32, ptr %17, align 4, !tbaa !9
  store i32 %18, ptr %6, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #5
  %19 = load ptr, ptr %4, align 8, !tbaa !5
  %20 = getelementptr inbounds %struct.jit_State, ptr %19, i32 0, i32 1
  %21 = load ptr, ptr %20, align 8, !tbaa !11
  store ptr %21, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #5
  %22 = load ptr, ptr %5, align 8, !tbaa !5
  store ptr %22, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 24, ptr %9) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #5
  %23 = load ptr, ptr %4, align 8, !tbaa !5
  %24 = getelementptr inbounds %struct.jit_State, ptr %23, i32 0, i32 34
  %25 = load ptr, ptr %24, align 8, !tbaa !21
  %26 = load ptr, ptr %4, align 8, !tbaa !5
  %27 = getelementptr inbounds %struct.jit_State, ptr %26, i32 0, i32 49
  %28 = load i32, ptr %27, align 8, !tbaa !22
  %29 = zext i32 %28 to i64
  %30 = getelementptr inbounds %struct.GCRef, ptr %25, i64 %29
  %31 = getelementptr inbounds %struct.GCRef, ptr %30, i32 0, i32 0
  %32 = load i32, ptr %31, align 4, !tbaa !23
  %33 = zext i32 %32 to i64
  %34 = inttoptr i64 %33 to ptr
  store ptr %34, ptr %13, align 8, !tbaa !5
  %35 = load ptr, ptr %13, align 8, !tbaa !5
  %36 = load ptr, ptr %4, align 8, !tbaa !5
  %37 = getelementptr inbounds %struct.ExitDataCP, ptr %9, i32 0, i32 0
  store ptr %36, ptr %37, align 8, !tbaa !24
  %38 = load ptr, ptr %5, align 8, !tbaa !5
  %39 = getelementptr inbounds %struct.ExitDataCP, ptr %9, i32 0, i32 1
  store ptr %38, ptr %39, align 8, !tbaa !26
  %40 = load ptr, ptr %7, align 8, !tbaa !5
  %41 = call i32 @lj_vm_cpcall(ptr noundef %40, ptr noundef null, ptr noundef %9, ptr noundef @trace_exit_cp)
  store i32 %41, ptr %10, align 4, !tbaa !9
  %42 = load i32, ptr %10, align 4, !tbaa !9
  %43 = icmp ne i32 %42, 0
  br i1 %43, label %44, label %47

44:                                               ; preds = %2
  %45 = load i32, ptr %10, align 4, !tbaa !9
  %46 = sub nsw i32 0, %45
  store i32 %46, ptr %3, align 4
  store i32 1, ptr %14, align 4
  br label %328

47:                                               ; preds = %2
  %48 = load ptr, ptr %7, align 8, !tbaa !5
  %49 = getelementptr inbounds %struct.lua_State, ptr %48, i32 0, i32 0
  %50 = getelementptr inbounds %struct.anon.5, ptr %49, i32 0, i32 5
  %51 = getelementptr inbounds %struct.MRef, ptr %50, i32 0, i32 0
  %52 = load i32, ptr %51, align 8, !tbaa !27
  %53 = zext i32 %52 to i64
  %54 = inttoptr i64 %53 to ptr
  %55 = getelementptr inbounds %struct.global_State, ptr %54, i32 0, i32 10
  %56 = load i8, ptr %55, align 1, !tbaa !28
  %57 = zext i8 %56 to i32
  %58 = and i32 %57, 128
  %59 = icmp ne i32 %58, 0
  br i1 %59, label %102, label %60

60:                                               ; preds = %47
  %61 = load ptr, ptr %7, align 8, !tbaa !5
  %62 = getelementptr inbounds %struct.lua_State, ptr %61, i32 0, i32 0
  %63 = getelementptr inbounds %struct.anon.5, ptr %62, i32 0, i32 5
  %64 = getelementptr inbounds %struct.MRef, ptr %63, i32 0, i32 0
  %65 = load i32, ptr %64, align 8, !tbaa !27
  %66 = zext i32 %65 to i64
  %67 = inttoptr i64 %66 to ptr
  %68 = getelementptr inbounds %struct.global_State, ptr %67, i32 0, i32 12
  %69 = load i8, ptr %68, align 1, !tbaa !35
  %70 = zext i8 %69 to i32
  %71 = and i32 %70, 8
  %72 = icmp ne i32 %71, 0
  br i1 %72, label %73, label %101

73:                                               ; preds = %60
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #5
  %74 = load ptr, ptr %7, align 8, !tbaa !5
  %75 = call i64 @lj_vmevent_prepare(ptr noundef %74, i32 noundef -1796237949)
  store i64 %75, ptr %15, align 8, !tbaa !36
  %76 = load i64, ptr %15, align 8, !tbaa !36
  %77 = icmp ne i64 %76, 0
  br i1 %77, label %78, label %100

78:                                               ; preds = %73
  %79 = load ptr, ptr %7, align 8, !tbaa !5
  call void @lj_state_checkstack(ptr noundef %79, i32 noundef 56)
  %80 = load ptr, ptr %7, align 8, !tbaa !5
  %81 = getelementptr inbounds %struct.lua_State, ptr %80, i32 0, i32 0
  %82 = getelementptr inbounds %struct.anon.5, ptr %81, i32 0, i32 8
  %83 = load ptr, ptr %82, align 8, !tbaa !27
  %84 = getelementptr inbounds %union.TValue, ptr %83, i32 1
  store ptr %84, ptr %82, align 8, !tbaa !27
  %85 = load ptr, ptr %4, align 8, !tbaa !5
  %86 = getelementptr inbounds %struct.jit_State, ptr %85, i32 0, i32 49
  %87 = load i32, ptr %86, align 8, !tbaa !22
  call void @setintV(ptr noundef %83, i32 noundef %87)
  %88 = load ptr, ptr %7, align 8, !tbaa !5
  %89 = getelementptr inbounds %struct.lua_State, ptr %88, i32 0, i32 0
  %90 = getelementptr inbounds %struct.anon.5, ptr %89, i32 0, i32 8
  %91 = load ptr, ptr %90, align 8, !tbaa !27
  %92 = getelementptr inbounds %union.TValue, ptr %91, i32 1
  store ptr %92, ptr %90, align 8, !tbaa !27
  %93 = load ptr, ptr %4, align 8, !tbaa !5
  %94 = getelementptr inbounds %struct.jit_State, ptr %93, i32 0, i32 50
  %95 = load i32, ptr %94, align 4, !tbaa !37
  call void @setintV(ptr noundef %91, i32 noundef %95)
  %96 = load ptr, ptr %7, align 8, !tbaa !5
  %97 = load ptr, ptr %8, align 8, !tbaa !5
  call void @trace_exit_regs(ptr noundef %96, ptr noundef %97)
  %98 = load ptr, ptr %7, align 8, !tbaa !5
  %99 = load i64, ptr %15, align 8, !tbaa !36
  call void @lj_vmevent_call(ptr noundef %98, i64 noundef %99)
  br label %100

100:                                              ; preds = %78, %73
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  br label %101

101:                                              ; preds = %100, %60
  br label %102

102:                                              ; preds = %101, %47
  %103 = getelementptr inbounds %struct.ExitDataCP, ptr %9, i32 0, i32 2
  %104 = load ptr, ptr %103, align 8, !tbaa !38
  store ptr %104, ptr %11, align 8, !tbaa !5
  %105 = load ptr, ptr %7, align 8, !tbaa !5
  %106 = getelementptr inbounds %struct.lua_State, ptr %105, i32 0, i32 0
  %107 = getelementptr inbounds %struct.anon.5, ptr %106, i32 0, i32 13
  %108 = load ptr, ptr %107, align 8, !tbaa !27
  %109 = ptrtoint ptr %108 to i64
  %110 = and i64 %109, -4
  %111 = inttoptr i64 %110 to ptr
  store ptr %111, ptr %12, align 8, !tbaa !5
  %112 = load ptr, ptr %11, align 8, !tbaa !5
  %113 = ptrtoint ptr %112 to i64
  %114 = trunc i64 %113 to i32
  %115 = load ptr, ptr %12, align 8, !tbaa !5
  %116 = getelementptr inbounds i8, ptr %115, i64 28
  %117 = getelementptr inbounds %struct.MRef, ptr %116, i32 0, i32 0
  store i32 %114, ptr %117, align 4, !tbaa !39
  %118 = load ptr, ptr %7, 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 5
  %121 = getelementptr inbounds %struct.MRef, ptr %120, i32 0, i32 0
  %122 = load i32, ptr %121, align 8, !tbaa !27
  %123 = zext i32 %122 to i64
  %124 = inttoptr i64 %123 to ptr
  %125 = getelementptr inbounds %struct.global_State, ptr %124, i32 0, i32 10
  %126 = load i8, ptr %125, align 1, !tbaa !28
  %127 = zext i8 %126 to i32
  %128 = and i32 %127, 128
  %129 = icmp ne i32 %128, 0
  br i1 %129, label %130, label %131

130:                                              ; preds = %102
  br label %178

131:                                              ; preds = %102
  %132 = load ptr, ptr %7, align 8, !tbaa !5
  %133 = getelementptr inbounds %struct.lua_State, ptr %132, i32 0, i32 0
  %134 = getelementptr inbounds %struct.anon.5, ptr %133, i32 0, i32 5
  %135 = getelementptr inbounds %struct.MRef, ptr %134, i32 0, i32 0
  %136 = load i32, ptr %135, align 8, !tbaa !27
  %137 = zext i32 %136 to i64
  %138 = inttoptr i64 %137 to ptr
  %139 = getelementptr inbounds %struct.global_State, ptr %138, i32 0, i32 5
  %140 = getelementptr inbounds %struct.GCState, ptr %139, i32 0, i32 3
  %141 = load i8, ptr %140, align 1, !tbaa !40
  %142 = zext i8 %141 to i32
  %143 = icmp eq i32 %142, 2
  br i1 %143, label %157, label %144

144:                                              ; preds = %131
  %145 = load ptr, ptr %7, align 8, !tbaa !5
  %146 = getelementptr inbounds %struct.lua_State, ptr %145, i32 0, i32 0
  %147 = getelementptr inbounds %struct.anon.5, ptr %146, i32 0, i32 5
  %148 = getelementptr inbounds %struct.MRef, ptr %147, i32 0, i32 0
  %149 = load i32, ptr %148, align 8, !tbaa !27
  %150 = zext i32 %149 to i64
  %151 = inttoptr i64 %150 to ptr
  %152 = getelementptr inbounds %struct.global_State, ptr %151, i32 0, i32 5
  %153 = getelementptr inbounds %struct.GCState, ptr %152, i32 0, i32 3
  %154 = load i8, ptr %153, align 1, !tbaa !40
  %155 = zext i8 %154 to i32
  %156 = icmp eq i32 %155, 5
  br i1 %156, label %157, label %174

157:                                              ; preds = %144, %131
  %158 = load ptr, ptr %7, align 8, !tbaa !5
  %159 = getelementptr inbounds %struct.lua_State, ptr %158, i32 0, i32 0
  %160 = getelementptr inbounds %struct.anon.5, ptr %159, i32 0, i32 5
  %161 = getelementptr inbounds %struct.MRef, ptr %160, i32 0, i32 0
  %162 = load i32, ptr %161, align 8, !tbaa !27
  %163 = zext i32 %162 to i64
  %164 = inttoptr i64 %163 to ptr
  %165 = getelementptr inbounds %struct.global_State, ptr %164, i32 0, i32 10
  %166 = load i8, ptr %165, align 1, !tbaa !28
  %167 = zext i8 %166 to i32
  %168 = and i32 %167, 64
  %169 = icmp ne i32 %168, 0
  br i1 %169, label %173, label %170

170:                                              ; preds = %157
  %171 = load ptr, ptr %7, align 8, !tbaa !5
  %172 = call i32 @lj_gc_step(ptr noundef %171)
  br label %173

173:                                              ; preds = %170, %157
  br label %177

174:                                              ; preds = %144
  %175 = load ptr, ptr %4, align 8, !tbaa !5
  %176 = load ptr, ptr %11, align 8, !tbaa !5
  call void @trace_hotside(ptr noundef %175, ptr noundef %176)
  br label %177

177:                                              ; preds = %174, %173
  br label %178

178:                                              ; preds = %177, %130
  %179 = load ptr, ptr %11, align 8, !tbaa !5
  %180 = load i32, ptr %179, align 4, !tbaa !9
  %181 = and i32 %180, 255
  %182 = icmp eq i32 %181, 87
  br i1 %182, label %183, label %232

183:                                              ; preds = %178
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #5
  %184 = load ptr, ptr %4, align 8, !tbaa !5
  %185 = getelementptr inbounds %struct.jit_State, ptr %184, i32 0, i32 34
  %186 = load ptr, ptr %185, align 8, !tbaa !21
  %187 = load ptr, ptr %11, align 8, !tbaa !5
  %188 = load i32, ptr %187, align 4, !tbaa !9
  %189 = lshr i32 %188, 16
  %190 = zext i32 %189 to i64
  %191 = getelementptr inbounds %struct.GCRef, ptr %186, i64 %190
  %192 = getelementptr inbounds %struct.GCRef, ptr %191, i32 0, i32 0
  %193 = load i32, ptr %192, align 4, !tbaa !23
  %194 = zext i32 %193 to i64
  %195 = inttoptr i64 %194 to ptr
  %196 = getelementptr inbounds %struct.GCtrace, ptr %195, i32 0, i32 15
  store ptr %196, ptr %16, align 8, !tbaa !5
  %197 = load ptr, ptr %16, align 8, !tbaa !5
  %198 = load i32, ptr %197, align 4, !tbaa !9
  %199 = and i32 %198, 255
  %200 = call i32 @bc_isret(i32 noundef %199)
  %201 = icmp ne i32 %200, 0
  br i1 %201, label %202, label %231

202:                                              ; preds = %183
  %203 = load ptr, ptr %4, align 8, !tbaa !5
  %204 = getelementptr inbounds %struct.jit_State, ptr %203, i32 0, i32 16
  %205 = load i32, ptr %204, align 4, !tbaa !41
  %206 = icmp eq i32 %205, 17
  br i1 %206, label %207, label %222

207:                                              ; preds = %202
  %208 = load ptr, ptr %11, align 8, !tbaa !5
  %209 = load i32, ptr %208, align 4, !tbaa !9
  %210 = load ptr, ptr %4, align 8, !tbaa !5
  %211 = getelementptr inbounds %struct.jit_State, ptr %210, i32 0, i32 52
  store i32 %209, ptr %211, align 8, !tbaa !42
  %212 = load ptr, ptr %11, align 8, !tbaa !5
  %213 = load ptr, ptr %4, align 8, !tbaa !5
  %214 = getelementptr inbounds %struct.jit_State, ptr %213, i32 0, i32 51
  store ptr %212, ptr %214, align 8, !tbaa !43
  %215 = load ptr, ptr %16, align 8, !tbaa !5
  %216 = load i32, ptr %215, align 4, !tbaa !9
  %217 = load ptr, ptr %4, align 8, !tbaa !5
  %218 = getelementptr inbounds %struct.jit_State, ptr %217, i32 0, i32 51
  %219 = load ptr, ptr %218, align 8, !tbaa !43
  store i32 %216, ptr %219, align 4, !tbaa !9
  %220 = load ptr, ptr %4, align 8, !tbaa !5
  %221 = getelementptr inbounds %struct.jit_State, ptr %220, i32 0, i32 12
  store i8 1, ptr %221, align 1, !tbaa !44
  br label %230

222:                                              ; preds = %202
  %223 = load ptr, ptr %16, align 8, !tbaa !5
  store ptr %223, ptr %11, align 8, !tbaa !5
  %224 = load ptr, ptr %11, align 8, !tbaa !5
  %225 = ptrtoint ptr %224 to i64
  %226 = trunc i64 %225 to i32
  %227 = load ptr, ptr %12, align 8, !tbaa !5
  %228 = getelementptr inbounds i8, ptr %227, i64 28
  %229 = getelementptr inbounds %struct.MRef, ptr %228, i32 0, i32 0
  store i32 %226, ptr %229, align 4, !tbaa !39
  br label %230

230:                                              ; preds = %222, %207
  br label %231

231:                                              ; preds = %230, %183
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #5
  br label %232

232:                                              ; preds = %231, %178
  %233 = load i32, ptr %6, align 4, !tbaa !9
  %234 = call ptr @__errno_location() #6
  store i32 %233, ptr %234, align 4, !tbaa !9
  %235 = load ptr, ptr %11, align 8, !tbaa !5
  %236 = load i32, ptr %235, align 4, !tbaa !9
  %237 = and i32 %236, 255
  switch i32 %237, label %307 [
    i32 65, label %238
    i32 67, label %238
    i32 73, label %263
    i32 63, label %287
  ]

238:                                              ; preds = %232, %232
  %239 = load ptr, ptr %7, align 8, !tbaa !5
  %240 = getelementptr inbounds %struct.lua_State, ptr %239, i32 0, i32 0
  %241 = getelementptr inbounds %struct.anon.5, ptr %240, i32 0, i32 8
  %242 = load ptr, ptr %241, align 8, !tbaa !27
  %243 = load ptr, ptr %7, align 8, !tbaa !5
  %244 = getelementptr inbounds %struct.lua_State, ptr %243, i32 0, i32 0
  %245 = getelementptr inbounds %struct.anon.5, ptr %244, i32 0, i32 7
  %246 = load ptr, ptr %245, align 8, !tbaa !27
  %247 = ptrtoint ptr %242 to i64
  %248 = ptrtoint ptr %246 to i64
  %249 = sub i64 %247, %248
  %250 = sdiv exact i64 %249, 8
  %251 = trunc i64 %250 to i32
  %252 = load ptr, ptr %11, align 8, !tbaa !5
  %253 = load i32, ptr %252, align 4, !tbaa !9
  %254 = lshr i32 %253, 8
  %255 = and i32 %254, 255
  %256 = sub i32 %251, %255
  %257 = load ptr, ptr %11, align 8, !tbaa !5
  %258 = load i32, ptr %257, align 4, !tbaa !9
  %259 = lshr i32 %258, 16
  %260 = and i32 %259, 255
  %261 = sub i32 %256, %260
  %262 = add i32 %261, 0
  store i32 %262, ptr %3, align 4
  store i32 1, ptr %14, align 4
  br label %328

263:                                              ; preds = %232
  %264 = load ptr, ptr %7, align 8, !tbaa !5
  %265 = getelementptr inbounds %struct.lua_State, ptr %264, i32 0, i32 0
  %266 = getelementptr inbounds %struct.anon.5, ptr %265, i32 0, i32 8
  %267 = load ptr, ptr %266, align 8, !tbaa !27
  %268 = load ptr, ptr %7, align 8, !tbaa !5
  %269 = getelementptr inbounds %struct.lua_State, ptr %268, i32 0, i32 0
  %270 = getelementptr inbounds %struct.anon.5, ptr %269, i32 0, i32 7
  %271 = load ptr, ptr %270, align 8, !tbaa !27
  %272 = ptrtoint ptr %267 to i64
  %273 = ptrtoint ptr %271 to i64
  %274 = sub i64 %272, %273
  %275 = sdiv exact i64 %274, 8
  %276 = trunc i64 %275 to i32
  %277 = add i32 %276, 1
  %278 = load ptr, ptr %11, align 8, !tbaa !5
  %279 = load i32, ptr %278, align 4, !tbaa !9
  %280 = lshr i32 %279, 8
  %281 = and i32 %280, 255
  %282 = sub i32 %277, %281
  %283 = load ptr, ptr %11, align 8, !tbaa !5
  %284 = load i32, ptr %283, align 4, !tbaa !9
  %285 = lshr i32 %284, 16
  %286 = sub i32 %282, %285
  store i32 %286, ptr %3, align 4
  store i32 1, ptr %14, align 4
  br label %328

287:                                              ; preds = %232
  %288 = load ptr, ptr %7, align 8, !tbaa !5
  %289 = getelementptr inbounds %struct.lua_State, ptr %288, i32 0, i32 0
  %290 = getelementptr inbounds %struct.anon.5, ptr %289, i32 0, i32 8
  %291 = load ptr, ptr %290, align 8, !tbaa !27
  %292 = load ptr, ptr %7, align 8, !tbaa !5
  %293 = getelementptr inbounds %struct.lua_State, ptr %292, i32 0, i32 0
  %294 = getelementptr inbounds %struct.anon.5, ptr %293, i32 0, i32 7
  %295 = load ptr, ptr %294, align 8, !tbaa !27
  %296 = ptrtoint ptr %291 to i64
  %297 = ptrtoint ptr %295 to i64
  %298 = sub i64 %296, %297
  %299 = sdiv exact i64 %298, 8
  %300 = trunc i64 %299 to i32
  %301 = add i32 %300, 1
  %302 = load ptr, ptr %11, align 8, !tbaa !5
  %303 = load i32, ptr %302, align 4, !tbaa !9
  %304 = lshr i32 %303, 8
  %305 = and i32 %304, 255
  %306 = sub i32 %301, %305
  store i32 %306, ptr %3, align 4
  store i32 1, ptr %14, align 4
  br label %328

307:                                              ; preds = %232
  %308 = load ptr, ptr %11, align 8, !tbaa !5
  %309 = load i32, ptr %308, align 4, !tbaa !9
  %310 = and i32 %309, 255
  %311 = icmp uge i32 %310, 89
  br i1 %311, label %312, label %327

312:                                              ; preds = %307
  %313 = load ptr, ptr %7, align 8, !tbaa !5
  %314 = getelementptr inbounds %struct.lua_State, ptr %313, i32 0, i32 0
  %315 = getelementptr inbounds %struct.anon.5, ptr %314, i32 0, i32 8
  %316 = load ptr, ptr %315, align 8, !tbaa !27
  %317 = load ptr, ptr %7, align 8, !tbaa !5
  %318 = getelementptr inbounds %struct.lua_State, ptr %317, i32 0, i32 0
  %319 = getelementptr inbounds %struct.anon.5, ptr %318, i32 0, i32 7
  %320 = load ptr, ptr %319, align 8, !tbaa !27
  %321 = ptrtoint ptr %316 to i64
  %322 = ptrtoint ptr %320 to i64
  %323 = sub i64 %321, %322
  %324 = sdiv exact i64 %323, 8
  %325 = trunc i64 %324 to i32
  %326 = add i32 %325, 1
  store i32 %326, ptr %3, align 4
  store i32 1, ptr %14, align 4
  br label %328

327:                                              ; preds = %307
  store i32 0, ptr %3, align 4
  store i32 1, ptr %14, align 4
  br label %328

328:                                              ; preds = %327, %312, %287, %263, %238, %44
  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 24, 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
  %329 = load i32, ptr %3, align 4
  ret i32 %329
}

; Function Attrs: nounwind uwtable
declare hidden ptr @trace_exit_cp(ptr noundef, ptr noundef, ptr noundef) #4

; Function Attrs: alwaysinline nounwind uwtable
declare hidden void @lj_state_checkstack(ptr noundef, i32 noundef) #0

; Function Attrs: nounwind uwtable
declare hidden void @trace_exit_regs(ptr noundef, ptr noundef) #4

declare hidden i32 @lj_gc_step(ptr noundef) #2

; Function Attrs: nounwind uwtable
declare hidden void @trace_hotside(ptr noundef, ptr noundef) #4

; Function Attrs: alwaysinline nounwind uwtable
declare hidden i32 @bc_isret(i32 noundef) #0

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


; 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.ExitDataCP = type { ptr, ptr, ptr }
%struct.GCRef = type { i32 }

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

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

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

declare hidden i64 @lj_vmevent_prepare(ptr noundef, i32 noundef) local_unnamed_addr #2

declare hidden void @lj_vmevent_call(ptr noundef, i64 noundef) local_unnamed_addr #2

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

; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none)
declare ptr @__errno_location() local_unnamed_addr #3

; Function Attrs: nounwind uwtable
define hidden i32 @lj_trace_exit(ptr noundef %0, ptr noundef %1) local_unnamed_addr #4 {
  %3 = alloca %struct.ExitDataCP, align 8
  %4 = tail call ptr @__errno_location() #6
  %5 = load i32, ptr %4, align 4, !tbaa !5
  %6 = getelementptr inbounds i8, ptr %0, i64 96
  %7 = load ptr, ptr %6, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %3) #7
  %8 = getelementptr inbounds i8, ptr %0, i64 312
  %9 = getelementptr inbounds i8, ptr %0, i64 2424
  store ptr %0, ptr %3, align 8, !tbaa !20
  %10 = getelementptr inbounds i8, ptr %3, i64 8
  store ptr %1, ptr %10, align 8, !tbaa !22
  %11 = call i32 @lj_vm_cpcall(ptr noundef %7, ptr noundef null, ptr noundef nonnull %3, ptr noundef nonnull @trace_exit_cp) #7
  %.not = icmp eq i32 %11, 0
  br i1 %.not, label %14, label %12

12:                                               ; preds = %2
  %13 = sub nsw i32 0, %11
  br label %150

14:                                               ; preds = %2
  %15 = getelementptr inbounds i8, ptr %7, i64 8
  %16 = load i32, ptr %15, align 8, !tbaa !23
  %17 = zext i32 %16 to i64
  %18 = inttoptr i64 %17 to ptr
  %19 = getelementptr inbounds i8, ptr %18, i64 125
  %20 = load i8, ptr %19, align 1, !tbaa !24
  %.not68 = icmp sgt i8 %20, -1
  br i1 %.not68, label %21, label %36

21:                                               ; preds = %14
  %22 = getelementptr inbounds i8, ptr %18, i64 127
  %23 = load i8, ptr %22, align 1, !tbaa !31
  %24 = and i8 %23, 8
  %.not69 = icmp eq i8 %24, 0
  br i1 %.not69, label %36, label %25

25:                                               ; preds = %21
  %26 = call i64 @lj_vmevent_prepare(ptr noundef nonnull %7, i32 noundef -1796237949) #7
  %.not70 = icmp eq i64 %26, 0
  br i1 %.not70, label %36, label %27

27:                                               ; preds = %25
  call void @lj_state_checkstack(ptr noundef nonnull %7, i32 noundef 56)
  %28 = getelementptr inbounds i8, ptr %7, i64 24
  %29 = load ptr, ptr %28, align 8, !tbaa !23
  %30 = getelementptr inbounds i8, ptr %29, i64 8
  store ptr %30, ptr %28, align 8, !tbaa !23
  %31 = load i32, ptr %9, align 8, !tbaa !32
  call void @setintV(ptr noundef %29, i32 noundef %31)
  %32 = load ptr, ptr %28, align 8, !tbaa !23
  %33 = getelementptr inbounds i8, ptr %32, i64 8
  store ptr %33, ptr %28, align 8, !tbaa !23
  %34 = getelementptr inbounds i8, ptr %0, i64 2428
  %35 = load i32, ptr %34, align 4, !tbaa !33
  call void @setintV(ptr noundef %32, i32 noundef %35)
  call void @trace_exit_regs(ptr noundef nonnull %7, ptr noundef %1)
  call void @lj_vmevent_call(ptr noundef nonnull %7, i64 noundef %26) #7
  br label %36

36:                                               ; preds = %25, %27, %21, %14
  %37 = getelementptr inbounds i8, ptr %3, i64 16
  %38 = load ptr, ptr %37, align 8, !tbaa !34
  %39 = getelementptr inbounds i8, ptr %7, i64 48
  %40 = load ptr, ptr %39, align 8, !tbaa !23
  %41 = ptrtoint ptr %40 to i64
  %42 = and i64 %41, -4
  %43 = inttoptr i64 %42 to ptr
  %44 = ptrtoint ptr %38 to i64
  %45 = trunc i64 %44 to i32
  %46 = getelementptr inbounds i8, ptr %43, i64 28
  store i32 %45, ptr %46, align 4, !tbaa !35
  %47 = load i32, ptr %15, align 8, !tbaa !23
  %48 = zext i32 %47 to i64
  %49 = inttoptr i64 %48 to ptr
  %50 = getelementptr inbounds i8, ptr %49, i64 125
  %51 = load i8, ptr %50, align 1, !tbaa !24
  %.not71 = icmp sgt i8 %51, -1
  br i1 %.not71, label %52, label %59

52:                                               ; preds = %36
  %53 = getelementptr inbounds i8, ptr %49, i64 41
  %54 = load i8, ptr %53, align 1, !tbaa !36
  switch i8 %54, label %58 [
    i8 2, label %55
    i8 5, label %55
  ]

55:                                               ; preds = %52, %52
  %.not72 = icmp ult i8 %51, 64
  br i1 %.not72, label %56, label %59

56:                                               ; preds = %55
  %57 = call i32 @lj_gc_step(ptr noundef nonnull %7) #7
  br label %59

58:                                               ; preds = %52
  call void @trace_hotside(ptr noundef nonnull %0, ptr noundef %38)
  br label %59

59:                                               ; preds = %58, %56, %55, %36
  %60 = load i32, ptr %38, align 4, !tbaa !5
  %61 = and i32 %60, 255
  %62 = icmp eq i32 %61, 87
  br i1 %62, label %63, label %88

63:                                               ; preds = %59
  %64 = load ptr, ptr %8, align 8, !tbaa !37
  %65 = lshr i32 %60, 16
  %66 = zext nneg i32 %65 to i64
  %67 = getelementptr inbounds %struct.GCRef, ptr %64, i64 %66
  %68 = load i32, ptr %67, align 4, !tbaa !38
  %69 = zext i32 %68 to i64
  %70 = inttoptr i64 %69 to ptr
  %71 = getelementptr inbounds i8, ptr %70, i64 56
  %72 = load i32, ptr %71, align 4, !tbaa !5
  %73 = and i32 %72, 255
  %74 = call i32 @bc_isret(i32 noundef %73)
  %.not73 = icmp eq i32 %74, 0
  br i1 %.not73, label %88, label %75

75:                                               ; preds = %63
  %76 = getelementptr inbounds i8, ptr %0, i64 188
  %77 = load i32, ptr %76, align 4, !tbaa !39
  %78 = icmp eq i32 %77, 17
  br i1 %78, label %79, label %85

79:                                               ; preds = %75
  %80 = load i32, ptr %38, align 4, !tbaa !5
  %81 = getelementptr inbounds i8, ptr %0, i64 2440
  store i32 %80, ptr %81, align 8, !tbaa !40
  %82 = getelementptr inbounds i8, ptr %0, i64 2432
  store ptr %38, ptr %82, align 8, !tbaa !41
  %83 = load i32, ptr %71, align 4, !tbaa !5
  store i32 %83, ptr %38, align 4, !tbaa !5
  %84 = getelementptr inbounds i8, ptr %0, i64 151
  store i8 1, ptr %84, align 1, !tbaa !42
  br label %88

85:                                               ; preds = %75
  %86 = ptrtoint ptr %71 to i64
  %87 = trunc i64 %86 to i32
  store i32 %87, ptr %46, align 4, !tbaa !35
  br label %88

88:                                               ; preds = %63, %85, %79, %59
  %.1 = phi ptr [ %38, %59 ], [ %38, %79 ], [ %71, %85 ], [ %38, %63 ]
  store i32 %5, ptr %4, align 4, !tbaa !5
  %89 = load i32, ptr %.1, align 4, !tbaa !5
  %90 = and i32 %89, 255
  %91 = add nsw i32 %90, -63
  %92 = call i32 @llvm.fshl.i32(i32 %91, i32 %91, i32 31)
  switch i32 %92, label %137 [
    i32 1, label %93
    i32 2, label %93
    i32 5, label %109
    i32 0, label %124
  ]

93:                                               ; preds = %88, %88
  %94 = getelementptr inbounds i8, ptr %7, i64 24
  %95 = load ptr, ptr %94, align 8, !tbaa !23
  %96 = getelementptr inbounds i8, ptr %7, i64 16
  %97 = load ptr, ptr %96, align 8, !tbaa !23
  %98 = ptrtoint ptr %95 to i64
  %99 = ptrtoint ptr %97 to i64
  %100 = sub i64 %98, %99
  %101 = lshr exact i64 %100, 3
  %102 = trunc i64 %101 to i32
  %103 = lshr i32 %89, 8
  %104 = and i32 %103, 255
  %105 = lshr i32 %89, 16
  %106 = and i32 %105, 255
  %107 = add nuw nsw i32 %104, %106
  %108 = sub i32 %102, %107
  br label %150

109:                                              ; preds = %88
  %110 = getelementptr inbounds i8, ptr %7, i64 24
  %111 = load ptr, ptr %110, align 8, !tbaa !23
  %112 = getelementptr inbounds i8, ptr %7, i64 16
  %113 = load ptr, ptr %112, align 8, !tbaa !23
  %114 = ptrtoint ptr %111 to i64
  %115 = ptrtoint ptr %113 to i64
  %116 = sub i64 %114, %115
  %117 = lshr exact i64 %116, 3
  %118 = trunc i64 %117 to i32
  %119 = lshr i32 %89, 8
  %120 = and i32 %119, 255
  %121 = lshr i32 %89, 16
  %122 = add nuw nsw i32 %121, %120
  %reass.sub80 = sub i32 %118, %122
  %123 = add i32 %reass.sub80, 1
  br label %150

124:                                              ; preds = %88
  %125 = getelementptr inbounds i8, ptr %7, i64 24
  %126 = load ptr, ptr %125, align 8, !tbaa !23
  %127 = getelementptr inbounds i8, ptr %7, i64 16
  %128 = load ptr, ptr %127, align 8, !tbaa !23
  %129 = ptrtoint ptr %126 to i64
  %130 = ptrtoint ptr %128 to i64
  %131 = sub i64 %129, %130
  %132 = lshr exact i64 %131, 3
  %133 = trunc i64 %132 to i32
  %134 = lshr i32 %89, 8
  %135 = and i32 %134, 255
  %reass.sub = sub i32 %133, %135
  %136 = add i32 %reass.sub, 1
  br label %150

137:                                              ; preds = %88
  %138 = icmp ugt i32 %90, 88
  br i1 %138, label %139, label %150

139:                                              ; preds = %137
  %140 = getelementptr inbounds i8, ptr %7, i64 24
  %141 = load ptr, ptr %140, align 8, !tbaa !23
  %142 = getelementptr inbounds i8, ptr %7, i64 16
  %143 = load ptr, ptr %142, align 8, !tbaa !23
  %144 = ptrtoint ptr %141 to i64
  %145 = ptrtoint ptr %143 to i64
  %146 = sub i64 %144, %145
  %147 = lshr exact i64 %146, 3
  %148 = trunc i64 %147 to i32
  %149 = add i32 %148, 1
  br label %150

150:                                              ; preds = %137, %139, %124, %109, %93, %12
  %.0 = phi i32 [ %13, %12 ], [ %149, %139 ], [ %136, %124 ], [ %123, %109 ], [ %108, %93 ], [ 0, %137 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %3) #7
  ret i32 %.0
}

; Function Attrs: nounwind uwtable
declare hidden ptr @trace_exit_cp(ptr noundef, ptr noundef, ptr noundef) #4

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

; Function Attrs: nounwind uwtable
declare hidden void @trace_exit_regs(ptr noundef, ptr noundef) local_unnamed_addr #4

declare hidden i32 @lj_gc_step(ptr noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare hidden void @trace_hotside(ptr noundef, ptr noundef) local_unnamed_addr #4

; Function Attrs: alwaysinline nounwind uwtable
declare hidden i32 @bc_isret(i32 noundef) local_unnamed_addr #0

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

attributes #0 = { 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 #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { mustprogress nofree nosync nounwind willreturn memory(none) "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 = { 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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { nounwind willreturn memory(none) }
attributes #7 = { 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !13, i64 96}
!10 = !{!"jit_State", !11, i64 0, !13, i64 96, !13, i64 104, !13, i64 112, !13, i64 120, !13, i64 128, !6, i64 136, !6, i64 140, !6, i64 144, !7, i64 148, !7, i64 149, !16, i64 150, !7, i64 151, !17, i64 152, !13, i64 176, !6, i64 184, !6, i64 188, !6, i64 192, !6, i64 196, !6, i64 200, !6, i64 204, !6, i64 208, !15, i64 212, !7, i64 216, !13, i64 256, !6, i64 264, !6, i64 268, !6, i64 272, !6, i64 276, !13, i64 280, !13, i64 288, !6, i64 296, !6, i64 300, !7, i64 304, !13, i64 312, !6, i64 320, !6, i64 324, !13, i64 328, !7, i64 336, !7, i64 536, !7, i64 1556, !7, i64 1616, !7, i64 1744, !6, i64 2256, !6, i64 2260, !7, i64 2264, !6, i64 2392, !18, i64 2396, !13, i64 2416, !6, i64 2424, !6, i64 2428, !13, i64 2432, !6, i64 2440, !6, i64 2444, !13, i64 2448, !13, i64 2456, !13, i64 2464, !19, i64 2472, !19, i64 2480, !7, i64 2488, !13, i64 2496, !6, i64 2504, !6, i64 2508}
!11 = !{!"GCtrace", !12, i64 0, !7, i64 4, !7, i64 5, !7, i64 6, !7, i64 7, !6, i64 8, !12, i64 12, !13, i64 16, !6, i64 24, !14, i64 28, !14, i64 30, !13, i64 32, !13, i64 40, !12, i64 48, !15, i64 52, !6, i64 56, !6, i64 60, !13, i64 64, !6, 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", !6, i64 0}
!13 = !{!"any pointer", !7, i64 0}
!14 = !{!"short", !7, i64 0}
!15 = !{!"MRef", !6, 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 = !{!21, !13, i64 0}
!21 = !{!"ExitDataCP", !13, i64 0, !13, i64 8, !13, i64 16}
!22 = !{!21, !13, i64 8}
!23 = !{!7, !7, i64 0}
!24 = !{!25, !7, i64 125}
!25 = !{!"global_State", !13, i64 0, !6, i64 8, !6, i64 12, !13, i64 16, !13, i64 24, !26, i64 32, !6, i64 88, !27, i64 92, !28, i64 108, !7, i64 124, !7, i64 125, !7, i64 126, !7, i64 127, !12, i64 128, !7, i64 136, !7, i64 144, !7, i64 152, !29, i64 160, !30, i64 184, !6, i64 208, !6, i64 212, !13, i64 216, !13, i64 224, !13, i64 232, !6, i64 240, !6, i64 244, !12, i64 248, !15, i64 252, !15, i64 256, !7, i64 260}
!26 = !{!"GCState", !6, i64 0, !6, i64 4, !7, i64 8, !7, i64 9, !7, i64 10, !7, i64 11, !6, i64 12, !12, i64 16, !15, i64 20, !12, i64 24, !12, i64 28, !12, i64 32, !12, i64 36, !6, i64 40, !6, i64 44, !6, i64 48, !6, i64 52}
!27 = !{!"SBuf", !15, i64 0, !15, i64 4, !15, i64 8, !15, i64 12}
!28 = !{!"GCstr", !12, i64 0, !7, i64 4, !7, i64 5, !7, i64 6, !7, i64 7, !6, i64 8, !6, i64 12}
!29 = !{!"Node", !7, i64 0, !7, i64 8, !15, i64 16, !15, i64 20}
!30 = !{!"GCupval", !12, i64 0, !7, i64 4, !7, i64 5, !7, i64 6, !7, i64 7, !7, i64 8, !15, i64 16, !6, i64 20}
!31 = !{!25, !7, i64 127}
!32 = !{!10, !6, i64 2424}
!33 = !{!10, !6, i64 2428}
!34 = !{!21, !13, i64 16}
!35 = !{!15, !6, i64 0}
!36 = !{!25, !7, i64 41}
!37 = !{!10, !13, i64 312}
!38 = !{!12, !6, i64 0}
!39 = !{!10, !6, i64 188}
!40 = !{!10, !6, i64 2440}
!41 = !{!10, !13, i64 2432}
!42 = !{!10, !7, i64 151}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass