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

; 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.3 }
%struct.anon.3 = 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.anon.2 = type { i16, i16, i16, i16 }
%struct.SnapShot = type { i16, i16, i8, i8, i8, i8 }
%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: alwaysinline nounwind uwtable
declare hidden void @lj_ir_set_(ptr noundef, i16 noundef zeroext, i16 noundef zeroext, i16 noundef zeroext) #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 hidden void @lj_record_stop(ptr noundef, i32 noundef, i32 noundef) #2

declare hidden void @lj_snap_add(ptr noundef) #3

; Function Attrs: noreturn
declare hidden void @lj_trace_err(ptr noundef, i32 noundef) #4

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #5

; Function Attrs: nounwind uwtable
define hidden void @lj_record_setup(ptr noundef %0) #2 {
  %2 = alloca ptr, align 8
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #6
  %7 = load ptr, ptr %2, align 8, !tbaa !5
  %8 = getelementptr inbounds %struct.jit_State, ptr %7, i32 0, i32 39
  %9 = getelementptr inbounds [255 x i32], ptr %8, i64 0, i64 0
  call void @llvm.memset.p0.i64(ptr align 8 %9, i8 0, i64 1020, i1 false)
  %10 = load ptr, ptr %2, align 8, !tbaa !5
  %11 = getelementptr inbounds %struct.jit_State, ptr %10, i32 0, i32 38
  %12 = getelementptr inbounds [100 x i16], ptr %11, i64 0, i64 0
  call void @llvm.memset.p0.i64(ptr align 8 %12, i8 0, i64 200, i1 false)
  %13 = load ptr, ptr %2, align 8, !tbaa !5
  %14 = getelementptr inbounds %struct.jit_State, ptr %13, i32 0, i32 45
  %15 = getelementptr inbounds [16 x %struct.BPropEntry], ptr %14, i64 0, i64 0
  call void @llvm.memset.p0.i64(ptr align 8 %15, i8 0, i64 128, i1 false)
  %16 = load ptr, ptr %2, align 8, !tbaa !5
  %17 = getelementptr inbounds %struct.jit_State, ptr %16, i32 0, i32 47
  %18 = getelementptr inbounds %struct.ScEvEntry, ptr %17, i32 0, i32 1
  store i16 32767, ptr %18, align 4, !tbaa !9
  %19 = load ptr, ptr %2, align 8, !tbaa !5
  %20 = getelementptr inbounds %struct.jit_State, ptr %19, i32 0, i32 47
  %21 = getelementptr inbounds %struct.ScEvEntry, ptr %20, i32 0, i32 0
  %22 = getelementptr inbounds %struct.MRef, ptr %21, i32 0, i32 0
  store i32 0, ptr %22, align 4, !tbaa !20
  %23 = load ptr, ptr %2, align 8, !tbaa !5
  %24 = getelementptr inbounds %struct.jit_State, ptr %23, i32 0, i32 8
  store i32 1, ptr %24, align 8, !tbaa !21
  %25 = load ptr, ptr %2, align 8, !tbaa !5
  %26 = getelementptr inbounds %struct.jit_State, ptr %25, i32 0, i32 39
  %27 = getelementptr inbounds [255 x i32], ptr %26, i64 0, i64 0
  %28 = load ptr, ptr %2, align 8, !tbaa !5
  %29 = getelementptr inbounds %struct.jit_State, ptr %28, i32 0, i32 8
  %30 = load i32, ptr %29, align 8, !tbaa !21
  %31 = zext i32 %30 to i64
  %32 = getelementptr inbounds i32, ptr %27, i64 %31
  %33 = load ptr, ptr %2, align 8, !tbaa !5
  %34 = getelementptr inbounds %struct.jit_State, ptr %33, i32 0, i32 5
  store ptr %32, ptr %34, align 8, !tbaa !22
  %35 = load ptr, ptr %2, align 8, !tbaa !5
  %36 = getelementptr inbounds %struct.jit_State, ptr %35, i32 0, i32 7
  store i32 0, ptr %36, align 4, !tbaa !23
  %37 = load ptr, ptr %2, align 8, !tbaa !5
  %38 = getelementptr inbounds %struct.jit_State, ptr %37, i32 0, i32 20
  store i32 0, ptr %38, align 4, !tbaa !24
  %39 = load ptr, ptr %2, align 8, !tbaa !5
  %40 = getelementptr inbounds %struct.jit_State, ptr %39, i32 0, i32 21
  store i32 0, ptr %40, align 8, !tbaa !25
  %41 = load ptr, ptr %2, align 8, !tbaa !5
  %42 = getelementptr inbounds %struct.jit_State, ptr %41, i32 0, i32 40
  %43 = getelementptr inbounds [15 x i32], ptr %42, i64 0, i64 9
  %44 = load i32, ptr %43, align 4, !tbaa !26
  %45 = load ptr, ptr %2, align 8, !tbaa !5
  %46 = getelementptr inbounds %struct.jit_State, ptr %45, i32 0, i32 17
  store i32 %44, ptr %46, align 8, !tbaa !27
  %47 = load ptr, ptr %2, align 8, !tbaa !5
  %48 = getelementptr inbounds %struct.jit_State, ptr %47, i32 0, i32 40
  %49 = getelementptr inbounds [15 x i32], ptr %48, i64 0, i64 10
  %50 = load i32, ptr %49, align 4, !tbaa !26
  %51 = load ptr, ptr %2, align 8, !tbaa !5
  %52 = getelementptr inbounds %struct.jit_State, ptr %51, i32 0, i32 18
  store i32 %50, ptr %52, align 4, !tbaa !28
  %53 = load ptr, ptr %2, align 8, !tbaa !5
  %54 = getelementptr inbounds %struct.jit_State, ptr %53, i32 0, i32 19
  store i32 0, ptr %54, align 8, !tbaa !29
  %55 = load ptr, ptr %2, align 8, !tbaa !5
  %56 = getelementptr inbounds %struct.jit_State, ptr %55, i32 0, i32 27
  store i32 0, ptr %56, align 8, !tbaa !30
  %57 = load ptr, ptr %2, align 8, !tbaa !5
  %58 = getelementptr inbounds %struct.jit_State, ptr %57, i32 0, i32 14
  store ptr null, ptr %58, align 8, !tbaa !31
  %59 = load ptr, ptr %2, align 8, !tbaa !5
  %60 = getelementptr inbounds %struct.jit_State, ptr %59, i32 0, i32 15
  store i32 -1, ptr %60, align 8, !tbaa !32
  %61 = load ptr, ptr %2, align 8, !tbaa !5
  %62 = load ptr, ptr %2, align 8, !tbaa !5
  %63 = getelementptr inbounds %struct.jit_State, ptr %62, i32 0, i32 49
  %64 = load i32, ptr %63, align 8, !tbaa !33
  %65 = trunc i32 %64 to i16
  %66 = load ptr, ptr %2, align 8, !tbaa !5
  %67 = getelementptr inbounds %struct.jit_State, ptr %66, i32 0, i32 50
  %68 = load i32, ptr %67, align 4, !tbaa !34
  %69 = trunc i32 %68 to i16
  call void @lj_ir_set_(ptr noundef %61, i16 noundef zeroext 3333, i16 noundef zeroext %65, i16 noundef zeroext %69)
  %70 = load ptr, ptr %2, align 8, !tbaa !5
  %71 = call i32 @lj_ir_emit(ptr noundef %70)
  store i32 0, ptr %3, align 4, !tbaa !26
  br label %72

72:                                               ; preds = %95, %1
  %73 = load i32, ptr %3, align 4, !tbaa !26
  %74 = icmp ule i32 %73, 2
  br i1 %74, label %75, label %98

75:                                               ; preds = %72
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #6
  %76 = load ptr, ptr %2, align 8, !tbaa !5
  %77 = getelementptr inbounds %struct.jit_State, ptr %76, i32 0, i32 0
  %78 = getelementptr inbounds %struct.GCtrace, ptr %77, i32 0, i32 7
  %79 = load ptr, ptr %78, align 8, !tbaa !35
  %80 = load i32, ptr %3, align 4, !tbaa !26
  %81 = sub i32 32767, %80
  %82 = zext i32 %81 to i64
  %83 = getelementptr inbounds %union.IRIns, ptr %79, i64 %82
  store ptr %83, ptr %4, align 8, !tbaa !5
  %84 = load ptr, ptr %4, align 8, !tbaa !5
  store i32 0, ptr %84, align 4, !tbaa !36
  %85 = load i32, ptr %3, align 4, !tbaa !26
  %86 = add i32 0, %85
  %87 = trunc i32 %86 to i8
  %88 = load ptr, ptr %4, align 8, !tbaa !5
  %89 = getelementptr inbounds %struct.anon.3, ptr %88, i32 0, i32 1
  %90 = getelementptr inbounds %struct.IRType1, ptr %89, i32 0, i32 0
  store i8 %87, ptr %90, align 4, !tbaa !36
  %91 = load ptr, ptr %4, align 8, !tbaa !5
  %92 = getelementptr inbounds %struct.anon.3, ptr %91, i32 0, i32 2
  store i8 22, ptr %92, align 1, !tbaa !36
  %93 = load ptr, ptr %4, align 8, !tbaa !5
  %94 = getelementptr inbounds %struct.anon.2, ptr %93, i32 0, i32 3
  store i16 0, ptr %94, align 2, !tbaa !36
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #6
  br label %95

95:                                               ; preds = %75
  %96 = load i32, ptr %3, align 4, !tbaa !26
  %97 = add i32 %96, 1
  store i32 %97, ptr %3, align 4, !tbaa !26
  br label %72, !llvm.loop !37

98:                                               ; preds = %72
  %99 = load ptr, ptr %2, align 8, !tbaa !5
  %100 = getelementptr inbounds %struct.jit_State, ptr %99, i32 0, i32 0
  %101 = getelementptr inbounds %struct.GCtrace, ptr %100, i32 0, i32 8
  store i32 32765, ptr %101, align 8, !tbaa !39
  %102 = load ptr, ptr %2, align 8, !tbaa !5
  %103 = getelementptr inbounds %struct.jit_State, ptr %102, i32 0, i32 2
  %104 = load ptr, ptr %103, align 8, !tbaa !40
  %105 = load ptr, ptr %2, align 8, !tbaa !5
  %106 = getelementptr inbounds %struct.jit_State, ptr %105, i32 0, i32 48
  store ptr %104, ptr %106, align 8, !tbaa !41
  %107 = load ptr, ptr %2, align 8, !tbaa !5
  %108 = getelementptr inbounds %struct.jit_State, ptr %107, i32 0, i32 2
  %109 = load ptr, ptr %108, align 8, !tbaa !40
  %110 = ptrtoint ptr %109 to i64
  %111 = trunc i64 %110 to i32
  %112 = load ptr, ptr %2, align 8, !tbaa !5
  %113 = getelementptr inbounds %struct.jit_State, ptr %112, i32 0, i32 0
  %114 = getelementptr inbounds %struct.GCtrace, ptr %113, i32 0, i32 14
  %115 = getelementptr inbounds %struct.MRef, ptr %114, i32 0, i32 0
  store i32 %111, ptr %115, align 4, !tbaa !42
  %116 = load ptr, ptr %2, align 8, !tbaa !5
  %117 = getelementptr inbounds %struct.jit_State, ptr %116, i32 0, i32 49
  %118 = load i32, ptr %117, align 8, !tbaa !33
  %119 = icmp ne i32 %118, 0
  br i1 %119, label %120, label %268

120:                                              ; preds = %98
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #6
  %121 = load ptr, ptr %2, align 8, !tbaa !5
  %122 = getelementptr inbounds %struct.jit_State, ptr %121, i32 0, i32 34
  %123 = load ptr, ptr %122, align 8, !tbaa !43
  %124 = load ptr, ptr %2, align 8, !tbaa !5
  %125 = getelementptr inbounds %struct.jit_State, ptr %124, i32 0, i32 49
  %126 = load i32, ptr %125, align 8, !tbaa !33
  %127 = zext i32 %126 to i64
  %128 = getelementptr inbounds %struct.GCRef, ptr %123, i64 %127
  %129 = getelementptr inbounds %struct.GCRef, ptr %128, i32 0, i32 0
  %130 = load i32, ptr %129, align 4, !tbaa !44
  %131 = zext i32 %130 to i64
  %132 = inttoptr i64 %131 to ptr
  store ptr %132, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  %133 = load ptr, ptr %5, align 8, !tbaa !5
  %134 = getelementptr inbounds %struct.GCtrace, ptr %133, i32 0, i32 23
  %135 = load i16, ptr %134, align 4, !tbaa !45
  %136 = zext i16 %135 to i32
  %137 = icmp ne i32 %136, 0
  br i1 %137, label %138, label %143

138:                                              ; preds = %120
  %139 = load ptr, ptr %5, align 8, !tbaa !5
  %140 = getelementptr inbounds %struct.GCtrace, ptr %139, i32 0, i32 23
  %141 = load i16, ptr %140, align 4, !tbaa !45
  %142 = zext i16 %141 to i32
  br label %147

143:                                              ; preds = %120
  %144 = load ptr, ptr %2, align 8, !tbaa !5
  %145 = getelementptr inbounds %struct.jit_State, ptr %144, i32 0, i32 49
  %146 = load i32, ptr %145, align 8, !tbaa !33
  br label %147

147:                                              ; preds = %143, %138
  %148 = phi i32 [ %142, %138 ], [ %146, %143 ]
  store i32 %148, ptr %6, align 4, !tbaa !26
  %149 = load i32, ptr %6, align 4, !tbaa !26
  %150 = trunc i32 %149 to i16
  %151 = load ptr, ptr %2, align 8, !tbaa !5
  %152 = getelementptr inbounds %struct.jit_State, ptr %151, i32 0, i32 0
  %153 = getelementptr inbounds %struct.GCtrace, ptr %152, i32 0, i32 23
  store i16 %150, ptr %153, align 4, !tbaa !46
  %154 = load ptr, ptr %2, align 8, !tbaa !5
  %155 = getelementptr inbounds %struct.jit_State, ptr %154, i32 0, i32 0
  %156 = getelementptr inbounds %struct.GCtrace, ptr %155, i32 0, i32 15
  store i32 88, ptr %156, align 8, !tbaa !47
  %157 = load ptr, ptr %2, align 8, !tbaa !5
  %158 = getelementptr inbounds %struct.jit_State, ptr %157, i32 0, i32 50
  %159 = load i32, ptr %158, align 4, !tbaa !34
  %160 = icmp eq i32 %159, 0
  br i1 %160, label %161, label %215

161:                                              ; preds = %147
  %162 = load ptr, ptr %5, align 8, !tbaa !5
  %163 = getelementptr inbounds %struct.GCtrace, ptr %162, i32 0, i32 11
  %164 = load ptr, ptr %163, align 8, !tbaa !48
  %165 = getelementptr inbounds %struct.SnapShot, ptr %164, i64 0
  %166 = getelementptr inbounds %struct.SnapShot, ptr %165, i32 0, i32 4
  %167 = load i8, ptr %166, align 2, !tbaa !49
  %168 = zext i8 %167 to i32
  %169 = icmp eq i32 %168, 0
  br i1 %169, label %170, label %215

170:                                              ; preds = %161
  %171 = load ptr, ptr %2, align 8, !tbaa !5
  %172 = getelementptr inbounds %struct.jit_State, ptr %171, i32 0, i32 2
  %173 = load ptr, ptr %172, align 8, !tbaa !40
  %174 = load ptr, ptr %2, align 8, !tbaa !5
  %175 = getelementptr inbounds %struct.jit_State, ptr %174, i32 0, i32 4
  %176 = load ptr, ptr %175, align 8, !tbaa !51
  %177 = getelementptr inbounds i8, ptr %176, i64 64
  %178 = icmp ugt ptr %173, %177
  br i1 %178, label %179, label %214

179:                                              ; preds = %170
  %180 = load ptr, ptr %2, align 8, !tbaa !5
  %181 = getelementptr inbounds %struct.jit_State, ptr %180, i32 0, i32 2
  %182 = load ptr, ptr %181, align 8, !tbaa !40
  %183 = getelementptr inbounds i32, ptr %182, i64 -1
  %184 = load i32, ptr %183, align 4, !tbaa !26
  %185 = and i32 %184, 255
  %186 = icmp eq i32 %185, 78
  br i1 %186, label %187, label %214

187:                                              ; preds = %179
  %188 = load ptr, ptr %2, align 8, !tbaa !5
  %189 = getelementptr inbounds %struct.jit_State, ptr %188, i32 0, i32 2
  %190 = load ptr, ptr %189, align 8, !tbaa !40
  %191 = load ptr, ptr %2, align 8, !tbaa !5
  %192 = getelementptr inbounds %struct.jit_State, ptr %191, i32 0, i32 2
  %193 = load ptr, ptr %192, align 8, !tbaa !40
  %194 = getelementptr inbounds i32, ptr %193, i64 -1
  %195 = load i32, ptr %194, align 4, !tbaa !26
  %196 = lshr i32 %195, 16
  %197 = zext i32 %196 to i64
  %198 = sub nsw i64 %197, 32768
  %199 = sub nsw i64 %198, 1
  %200 = getelementptr inbounds i32, ptr %190, i64 %199
  %201 = load i32, ptr %200, align 4, !tbaa !26
  %202 = lshr i32 %201, 16
  %203 = load i32, ptr %6, align 4, !tbaa !26
  %204 = icmp eq i32 %202, %203
  br i1 %204, label %205, label %214

205:                                              ; preds = %187
  %206 = load ptr, ptr %2, align 8, !tbaa !5
  call void @lj_snap_add(ptr noundef %206)
  %207 = load ptr, ptr %2, align 8, !tbaa !5
  %208 = load ptr, ptr %2, align 8, !tbaa !5
  %209 = getelementptr inbounds %struct.jit_State, ptr %208, i32 0, i32 2
  %210 = load ptr, ptr %209, align 8, !tbaa !40
  %211 = getelementptr inbounds i32, ptr %210, i64 -1
  %212 = load ptr, ptr %2, align 8, !tbaa !5
  %213 = getelementptr inbounds %struct.jit_State, ptr %212, i32 0, i32 47
  call void @rec_for_loop(ptr noundef %207, ptr noundef %211, ptr noundef %213, i32 noundef 1)
  br label %221

214:                                              ; preds = %187, %179, %170
  br label %218

215:                                              ; preds = %161, %147
  %216 = load ptr, ptr %2, align 8, !tbaa !5
  %217 = getelementptr inbounds %struct.jit_State, ptr %216, i32 0, i32 48
  store ptr null, ptr %217, align 8, !tbaa !41
  br label %218

218:                                              ; preds = %215, %214
  %219 = load ptr, ptr %2, align 8, !tbaa !5
  %220 = load ptr, ptr %5, align 8, !tbaa !5
  call void @lj_snap_replay(ptr noundef %219, ptr noundef %220)
  br label %221

221:                                              ; preds = %218, %205
  %222 = load ptr, ptr %2, align 8, !tbaa !5
  %223 = getelementptr inbounds %struct.jit_State, ptr %222, i32 0, i32 34
  %224 = load ptr, ptr %223, align 8, !tbaa !43
  %225 = load ptr, ptr %2, align 8, !tbaa !5
  %226 = getelementptr inbounds %struct.jit_State, ptr %225, i32 0, i32 0
  %227 = getelementptr inbounds %struct.GCtrace, ptr %226, i32 0, i32 23
  %228 = load i16, ptr %227, align 4, !tbaa !46
  %229 = zext i16 %228 to i64
  %230 = getelementptr inbounds %struct.GCRef, ptr %224, i64 %229
  %231 = getelementptr inbounds %struct.GCRef, ptr %230, i32 0, i32 0
  %232 = load i32, ptr %231, align 4, !tbaa !44
  %233 = zext i32 %232 to i64
  %234 = inttoptr i64 %233 to ptr
  %235 = getelementptr inbounds %struct.GCtrace, ptr %234, i32 0, i32 19
  %236 = load i16, ptr %235, align 4, !tbaa !52
  %237 = zext i16 %236 to i32
  %238 = load ptr, ptr %2, align 8, !tbaa !5
  %239 = getelementptr inbounds %struct.jit_State, ptr %238, i32 0, i32 40
  %240 = getelementptr inbounds [15 x i32], ptr %239, i64 0, i64 3
  %241 = load i32, ptr %240, align 4, !tbaa !26
  %242 = icmp sge i32 %237, %241
  br i1 %242, label %265, label %243

243:                                              ; preds = %221
  %244 = load ptr, ptr %5, align 8, !tbaa !5
  %245 = getelementptr inbounds %struct.GCtrace, ptr %244, i32 0, i32 11
  %246 = load ptr, ptr %245, align 8, !tbaa !48
  %247 = load ptr, ptr %2, align 8, !tbaa !5
  %248 = getelementptr inbounds %struct.jit_State, ptr %247, i32 0, i32 50
  %249 = load i32, ptr %248, align 4, !tbaa !34
  %250 = zext i32 %249 to i64
  %251 = getelementptr inbounds %struct.SnapShot, ptr %246, i64 %250
  %252 = getelementptr inbounds %struct.SnapShot, ptr %251, i32 0, i32 5
  %253 = load i8, ptr %252, align 1, !tbaa !53
  %254 = zext i8 %253 to i32
  %255 = load ptr, ptr %2, align 8, !tbaa !5
  %256 = getelementptr inbounds %struct.jit_State, ptr %255, i32 0, i32 40
  %257 = getelementptr inbounds [15 x i32], ptr %256, i64 0, i64 7
  %258 = load i32, ptr %257, align 4, !tbaa !26
  %259 = load ptr, ptr %2, align 8, !tbaa !5
  %260 = getelementptr inbounds %struct.jit_State, ptr %259, i32 0, i32 40
  %261 = getelementptr inbounds [15 x i32], ptr %260, i64 0, i64 8
  %262 = load i32, ptr %261, align 4, !tbaa !26
  %263 = add nsw i32 %258, %262
  %264 = icmp sge i32 %254, %263
  br i1 %264, label %265, label %267

265:                                              ; preds = %243, %221
  %266 = load ptr, ptr %2, align 8, !tbaa !5
  call void @lj_record_stop(ptr noundef %266, i32 noundef 6, i32 noundef 0)
  br label %267

267:                                              ; preds = %265, %243
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #6
  br label %321

268:                                              ; preds = %98
  %269 = load ptr, ptr %2, align 8, !tbaa !5
  %270 = getelementptr inbounds %struct.jit_State, ptr %269, i32 0, i32 0
  %271 = getelementptr inbounds %struct.GCtrace, ptr %270, i32 0, i32 23
  store i16 0, ptr %271, align 4, !tbaa !46
  %272 = load ptr, ptr %2, align 8, !tbaa !5
  %273 = getelementptr inbounds %struct.jit_State, ptr %272, i32 0, i32 2
  %274 = load ptr, ptr %273, align 8, !tbaa !40
  %275 = load i32, ptr %274, align 4, !tbaa !26
  %276 = load ptr, ptr %2, align 8, !tbaa !5
  %277 = getelementptr inbounds %struct.jit_State, ptr %276, i32 0, i32 0
  %278 = getelementptr inbounds %struct.GCtrace, ptr %277, i32 0, i32 15
  store i32 %275, ptr %278, align 8, !tbaa !47
  %279 = load ptr, ptr %2, align 8, !tbaa !5
  %280 = call ptr @rec_setup_root(ptr noundef %279)
  %281 = load ptr, ptr %2, align 8, !tbaa !5
  %282 = getelementptr inbounds %struct.jit_State, ptr %281, i32 0, i32 2
  store ptr %280, ptr %282, align 8, !tbaa !40
  %283 = load ptr, ptr %2, align 8, !tbaa !5
  call void @lj_snap_add(ptr noundef %283)
  %284 = load ptr, ptr %2, align 8, !tbaa !5
  %285 = getelementptr inbounds %struct.jit_State, ptr %284, i32 0, i32 0
  %286 = getelementptr inbounds %struct.GCtrace, ptr %285, i32 0, i32 15
  %287 = load i32, ptr %286, align 8, !tbaa !47
  %288 = and i32 %287, 255
  %289 = icmp eq i32 %288, 79
  br i1 %289, label %290, label %298

290:                                              ; preds = %268
  %291 = load ptr, ptr %2, align 8, !tbaa !5
  %292 = load ptr, ptr %2, align 8, !tbaa !5
  %293 = getelementptr inbounds %struct.jit_State, ptr %292, i32 0, i32 2
  %294 = load ptr, ptr %293, align 8, !tbaa !40
  %295 = getelementptr inbounds i32, ptr %294, i64 -1
  %296 = load ptr, ptr %2, align 8, !tbaa !5
  %297 = getelementptr inbounds %struct.jit_State, ptr %296, i32 0, i32 47
  call void @rec_for_loop(ptr noundef %291, ptr noundef %295, ptr noundef %297, i32 noundef 1)
  br label %309

298:                                              ; preds = %268
  %299 = load ptr, ptr %2, align 8, !tbaa !5
  %300 = getelementptr inbounds %struct.jit_State, ptr %299, i32 0, i32 0
  %301 = getelementptr inbounds %struct.GCtrace, ptr %300, i32 0, i32 15
  %302 = load i32, ptr %301, align 8, !tbaa !47
  %303 = and i32 %302, 255
  %304 = icmp eq i32 %303, 69
  br i1 %304, label %305, label %308

305:                                              ; preds = %298
  %306 = load ptr, ptr %2, align 8, !tbaa !5
  %307 = getelementptr inbounds %struct.jit_State, ptr %306, i32 0, i32 48
  store ptr null, ptr %307, align 8, !tbaa !41
  br label %308

308:                                              ; preds = %305, %298
  br label %309

309:                                              ; preds = %308, %290
  %310 = load ptr, ptr %2, align 8, !tbaa !5
  %311 = getelementptr inbounds %struct.jit_State, ptr %310, i32 0, i32 4
  %312 = load ptr, ptr %311, align 8, !tbaa !51
  %313 = getelementptr inbounds %struct.GCproto, ptr %312, i32 0, i32 4
  %314 = load i8, ptr %313, align 1, !tbaa !54
  %315 = zext i8 %314 to i32
  %316 = add nsw i32 1, %315
  %317 = icmp sge i32 %316, 250
  br i1 %317, label %318, label %320

318:                                              ; preds = %309
  %319 = load ptr, ptr %2, align 8, !tbaa !5
  call void @lj_trace_err(ptr noundef %319, i32 noundef 3) #7
  unreachable

320:                                              ; preds = %309
  br label %321

321:                                              ; preds = %320, %267
  %322 = load ptr, ptr %2, align 8, !tbaa !5
  %323 = getelementptr inbounds %struct.jit_State, ptr %322, i32 0, i32 60
  store ptr null, ptr %323, align 8, !tbaa !56
  %324 = load ptr, ptr %2, align 8, !tbaa !5
  %325 = getelementptr inbounds %struct.jit_State, ptr %324, i32 0, i32 61
  store i32 -1, ptr %325, align 8, !tbaa !57
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #6
  ret void
}

declare hidden i32 @lj_ir_emit(ptr noundef) #3

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

declare hidden void @lj_snap_replay(ptr noundef, ptr noundef) #3

; Function Attrs: nounwind uwtable
declare hidden ptr @rec_setup_root(ptr noundef) #2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 = { "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 = { 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 #5 = { nocallback nofree nounwind willreturn memory(argmem: write) }
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, !14, i64 2400}
!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 = !{!10, !13, i64 2396}
!21 = !{!10, !13, i64 144}
!22 = !{!10, !6, i64 128}
!23 = !{!10, !13, i64 140}
!24 = !{!10, !13, i64 204}
!25 = !{!10, !13, i64 208}
!26 = !{!13, !13, i64 0}
!27 = !{!10, !13, i64 192}
!28 = !{!10, !13, i64 196}
!29 = !{!10, !13, i64 200}
!30 = !{!10, !13, i64 272}
!31 = !{!10, !6, i64 176}
!32 = !{!10, !13, i64 184}
!33 = !{!10, !13, i64 2424}
!34 = !{!10, !13, i64 2428}
!35 = !{!10, !6, i64 16}
!36 = !{!7, !7, i64 0}
!37 = distinct !{!37, !38}
!38 = !{!"llvm.loop.mustprogress"}
!39 = !{!10, !13, i64 24}
!40 = !{!10, !6, i64 104}
!41 = !{!10, !6, i64 2416}
!42 = !{!10, !13, i64 52}
!43 = !{!10, !6, i64 312}
!44 = !{!12, !13, i64 0}
!45 = !{!11, !14, i64 84}
!46 = !{!10, !14, i64 84}
!47 = !{!10, !13, i64 56}
!48 = !{!11, !6, i64 32}
!49 = !{!50, !7, i64 6}
!50 = !{!"SnapShot", !14, i64 0, !14, i64 2, !7, i64 4, !7, i64 5, !7, i64 6, !7, i64 7}
!51 = !{!10, !6, i64 120}
!52 = !{!11, !14, i64 76}
!53 = !{!50, !7, i64 7}
!54 = !{!55, !7, i64 7}
!55 = !{!"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}
!56 = !{!10, !6, i64 2496}
!57 = !{!10, !13, i64 2504}


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

; Function Attrs: alwaysinline nounwind uwtable
declare hidden void @lj_ir_set_(ptr noundef, i16 noundef zeroext, i16 noundef zeroext, i16 noundef zeroext) local_unnamed_addr #0

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

declare hidden void @lj_snap_add(ptr noundef) local_unnamed_addr #2

; Function Attrs: noreturn
declare hidden void @lj_trace_err(ptr noundef, i32 noundef) local_unnamed_addr #3

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4

; Function Attrs: nounwind uwtable
define hidden void @lj_record_setup(ptr noundef %0) local_unnamed_addr #1 {
  %2 = getelementptr inbounds i8, ptr %0, i64 336
  %3 = getelementptr inbounds i8, ptr %0, i64 2264
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(128) %3, i8 0, i64 128, i1 false)
  %4 = getelementptr inbounds i8, ptr %0, i64 2396
  %5 = getelementptr inbounds i8, ptr %0, i64 2400
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(1220) %2, i8 0, i64 1220, i1 false)
  store i16 32767, ptr %5, align 4, !tbaa !5
  store i32 0, ptr %4, align 4, !tbaa !19
  %6 = getelementptr inbounds i8, ptr %0, i64 144
  store i32 1, ptr %6, align 8, !tbaa !20
  %7 = getelementptr inbounds i8, ptr %0, i64 540
  %8 = getelementptr inbounds i8, ptr %0, i64 128
  store ptr %7, ptr %8, align 8, !tbaa !21
  %9 = getelementptr inbounds i8, ptr %0, i64 140
  store i32 0, ptr %9, align 4, !tbaa !22
  %10 = getelementptr inbounds i8, ptr %0, i64 204
  store i32 0, ptr %10, align 4, !tbaa !23
  %11 = getelementptr inbounds i8, ptr %0, i64 208
  store i32 0, ptr %11, align 8, !tbaa !24
  %12 = getelementptr inbounds i8, ptr %0, i64 1592
  %13 = getelementptr inbounds i8, ptr %0, i64 192
  %14 = load <2 x i32>, ptr %12, align 4, !tbaa !25
  store <2 x i32> %14, ptr %13, align 8, !tbaa !25
  %15 = getelementptr inbounds i8, ptr %0, i64 200
  store i32 0, ptr %15, align 8, !tbaa !26
  %16 = getelementptr inbounds i8, ptr %0, i64 272
  store i32 0, ptr %16, align 8, !tbaa !27
  %17 = getelementptr inbounds i8, ptr %0, i64 176
  store ptr null, ptr %17, align 8, !tbaa !28
  %18 = getelementptr inbounds i8, ptr %0, i64 184
  store i32 -1, ptr %18, align 8, !tbaa !29
  %19 = getelementptr inbounds i8, ptr %0, i64 2424
  %20 = load i32, ptr %19, align 8, !tbaa !30
  %21 = trunc i32 %20 to i16
  %22 = getelementptr inbounds i8, ptr %0, i64 2428
  %23 = load i32, ptr %22, align 4, !tbaa !31
  %24 = trunc i32 %23 to i16
  tail call void @lj_ir_set_(ptr noundef %0, i16 noundef zeroext 3333, i16 noundef zeroext %21, i16 noundef zeroext %24)
  %25 = tail call i32 @lj_ir_emit(ptr noundef %0) #5
  %26 = getelementptr inbounds i8, ptr %0, i64 16
  %27 = load ptr, ptr %26, align 8, !tbaa !32
  %28 = getelementptr inbounds i8, ptr %27, i64 262136
  store i32 0, ptr %28, align 4, !tbaa !33
  %29 = getelementptr inbounds i8, ptr %27, i64 262140
  store i8 0, ptr %29, align 4, !tbaa !33
  %30 = getelementptr inbounds i8, ptr %27, i64 262141
  store i8 22, ptr %30, align 1, !tbaa !33
  %31 = getelementptr inbounds i8, ptr %27, i64 262142
  store i16 0, ptr %31, align 2, !tbaa !33
  %32 = load ptr, ptr %26, align 8, !tbaa !32
  %33 = getelementptr inbounds i8, ptr %32, i64 262128
  store i32 0, ptr %33, align 4, !tbaa !33
  %34 = getelementptr inbounds i8, ptr %32, i64 262132
  store i8 1, ptr %34, align 4, !tbaa !33
  %35 = getelementptr inbounds i8, ptr %32, i64 262133
  store i8 22, ptr %35, align 1, !tbaa !33
  %36 = getelementptr inbounds i8, ptr %32, i64 262134
  store i16 0, ptr %36, align 2, !tbaa !33
  %37 = load ptr, ptr %26, align 8, !tbaa !32
  %38 = getelementptr inbounds i8, ptr %37, i64 262120
  store i32 0, ptr %38, align 4, !tbaa !33
  %39 = getelementptr inbounds i8, ptr %37, i64 262124
  store i8 2, ptr %39, align 4, !tbaa !33
  %40 = getelementptr inbounds i8, ptr %37, i64 262125
  store i8 22, ptr %40, align 1, !tbaa !33
  %41 = getelementptr inbounds i8, ptr %37, i64 262126
  store i16 0, ptr %41, align 2, !tbaa !33
  %42 = getelementptr inbounds i8, ptr %0, i64 24
  store i32 32765, ptr %42, align 8, !tbaa !34
  %43 = getelementptr inbounds i8, ptr %0, i64 104
  %44 = load ptr, ptr %43, align 8, !tbaa !35
  %45 = getelementptr inbounds i8, ptr %0, i64 2416
  store ptr %44, ptr %45, align 8, !tbaa !36
  %46 = ptrtoint ptr %44 to i64
  %47 = trunc i64 %46 to i32
  %48 = getelementptr inbounds i8, ptr %0, i64 52
  store i32 %47, ptr %48, align 4, !tbaa !37
  %49 = load i32, ptr %19, align 8, !tbaa !30
  %.not = icmp eq i32 %49, 0
  br i1 %.not, label %123, label %50

50:                                               ; preds = %1
  %51 = getelementptr inbounds i8, ptr %0, i64 312
  %52 = load ptr, ptr %51, align 8, !tbaa !38
  %53 = zext i32 %49 to i64
  %54 = getelementptr inbounds %struct.GCRef, ptr %52, i64 %53
  %55 = load i32, ptr %54, align 4, !tbaa !39
  %56 = zext i32 %55 to i64
  %57 = inttoptr i64 %56 to ptr
  %58 = getelementptr inbounds i8, ptr %57, i64 84
  %59 = load i16, ptr %58, align 4, !tbaa !40
  %.not89 = icmp eq i16 %59, 0
  %60 = zext i16 %59 to i32
  %61 = select i1 %.not89, i32 %49, i32 %60
  %62 = trunc i32 %61 to i16
  %63 = getelementptr inbounds i8, ptr %0, i64 84
  store i16 %62, ptr %63, align 4, !tbaa !41
  %64 = getelementptr inbounds i8, ptr %0, i64 56
  store i32 88, ptr %64, align 8, !tbaa !42
  %65 = load i32, ptr %22, align 4, !tbaa !31
  %66 = icmp eq i32 %65, 0
  br i1 %66, label %67, label %94

67:                                               ; preds = %50
  %68 = getelementptr inbounds i8, ptr %57, i64 32
  %69 = load ptr, ptr %68, align 8, !tbaa !43
  %70 = getelementptr inbounds i8, ptr %69, i64 6
  %71 = load i8, ptr %70, align 2, !tbaa !44
  %72 = icmp eq i8 %71, 0
  br i1 %72, label %73, label %94

73:                                               ; preds = %67
  %74 = getelementptr inbounds i8, ptr %0, i64 120
  %75 = load ptr, ptr %74, align 8, !tbaa !46
  %76 = getelementptr inbounds i8, ptr %75, i64 64
  %77 = icmp ugt ptr %44, %76
  br i1 %77, label %78, label %95

78:                                               ; preds = %73
  %79 = getelementptr inbounds i8, ptr %44, i64 -4
  %80 = load i32, ptr %79, align 4, !tbaa !25
  %81 = and i32 %80, 255
  %82 = icmp eq i32 %81, 78
  br i1 %82, label %83, label %95

83:                                               ; preds = %78
  %84 = lshr i32 %80, 16
  %85 = zext nneg i32 %84 to i64
  %86 = getelementptr i32, ptr %44, i64 %85
  %87 = getelementptr i8, ptr %86, i64 -131076
  %88 = load i32, ptr %87, align 4, !tbaa !25
  %89 = lshr i32 %88, 16
  %90 = icmp eq i32 %89, %61
  br i1 %90, label %91, label %95

91:                                               ; preds = %83
  tail call void @lj_snap_add(ptr noundef nonnull %0) #5
  %92 = load ptr, ptr %43, align 8, !tbaa !35
  %93 = getelementptr inbounds i8, ptr %92, i64 -4
  tail call void @rec_for_loop(ptr noundef nonnull %0, ptr noundef nonnull %93, ptr noundef nonnull %4, i32 noundef 1)
  br label %96

94:                                               ; preds = %67, %50
  store ptr null, ptr %45, align 8, !tbaa !36
  br label %95

95:                                               ; preds = %73, %78, %83, %94
  tail call void @lj_snap_replay(ptr noundef nonnull %0, ptr noundef nonnull %57) #5
  br label %96

96:                                               ; preds = %95, %91
  %97 = load ptr, ptr %51, align 8, !tbaa !38
  %98 = load i16, ptr %63, align 4, !tbaa !41
  %99 = zext i16 %98 to i64
  %100 = getelementptr inbounds %struct.GCRef, ptr %97, i64 %99
  %101 = load i32, ptr %100, align 4, !tbaa !39
  %102 = zext i32 %101 to i64
  %103 = inttoptr i64 %102 to ptr
  %104 = getelementptr inbounds i8, ptr %103, i64 76
  %105 = load i16, ptr %104, align 4, !tbaa !47
  %106 = zext i16 %105 to i32
  %107 = getelementptr inbounds i8, ptr %0, i64 1568
  %108 = load i32, ptr %107, align 4, !tbaa !25
  %.not90 = icmp sgt i32 %108, %106
  br i1 %.not90, label %109, label %122

109:                                              ; preds = %96
  %110 = getelementptr inbounds i8, ptr %57, i64 32
  %111 = load ptr, ptr %110, align 8, !tbaa !43
  %112 = load i32, ptr %22, align 4, !tbaa !31
  %113 = zext i32 %112 to i64
  %114 = getelementptr inbounds %struct.SnapShot, ptr %111, i64 %113, i32 5
  %115 = load i8, ptr %114, align 1, !tbaa !48
  %116 = zext i8 %115 to i32
  %117 = getelementptr inbounds i8, ptr %0, i64 1584
  %118 = load i32, ptr %117, align 4, !tbaa !25
  %119 = getelementptr inbounds i8, ptr %0, i64 1588
  %120 = load i32, ptr %119, align 4, !tbaa !25
  %121 = add nsw i32 %120, %118
  %.not91 = icmp sgt i32 %121, %116
  br i1 %.not91, label %140, label %122

122:                                              ; preds = %109, %96
  tail call void @lj_record_stop(ptr noundef nonnull %0, i32 noundef 6, i32 noundef 0)
  br label %140

123:                                              ; preds = %1
  %124 = getelementptr inbounds i8, ptr %0, i64 84
  store i16 0, ptr %124, align 4, !tbaa !41
  %125 = load i32, ptr %44, align 4, !tbaa !25
  %126 = getelementptr inbounds i8, ptr %0, i64 56
  store i32 %125, ptr %126, align 8, !tbaa !42
  %127 = tail call ptr @rec_setup_root(ptr noundef nonnull %0)
  store ptr %127, ptr %43, align 8, !tbaa !35
  tail call void @lj_snap_add(ptr noundef nonnull %0) #5
  %128 = load i32, ptr %126, align 8, !tbaa !42
  %trunc = trunc i32 %128 to i8
  switch i8 %trunc, label %133 [
    i8 79, label %129
    i8 69, label %132
  ]

129:                                              ; preds = %123
  %130 = load ptr, ptr %43, align 8, !tbaa !35
  %131 = getelementptr inbounds i8, ptr %130, i64 -4
  tail call void @rec_for_loop(ptr noundef nonnull %0, ptr noundef nonnull %131, ptr noundef nonnull %4, i32 noundef 1)
  br label %133

132:                                              ; preds = %123
  store ptr null, ptr %45, align 8, !tbaa !36
  br label %133

133:                                              ; preds = %123, %132, %129
  %134 = getelementptr inbounds i8, ptr %0, i64 120
  %135 = load ptr, ptr %134, align 8, !tbaa !46
  %136 = getelementptr inbounds i8, ptr %135, i64 7
  %137 = load i8, ptr %136, align 1, !tbaa !49
  %138 = icmp ugt i8 %137, -8
  br i1 %138, label %139, label %140

139:                                              ; preds = %133
  tail call void @lj_trace_err(ptr noundef nonnull %0, i32 noundef 3) #6
  unreachable

140:                                              ; preds = %109, %122, %133
  %141 = getelementptr inbounds i8, ptr %0, i64 2496
  store ptr null, ptr %141, align 8, !tbaa !51
  %142 = getelementptr inbounds i8, ptr %0, i64 2504
  store i32 -1, ptr %142, align 8, !tbaa !52
  ret void
}

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

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

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

; Function Attrs: nounwind uwtable
declare hidden ptr @rec_setup_root(ptr noundef) local_unnamed_addr #1

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 = { 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 = { 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 #4 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #5 = { nounwind }
attributes #6 = { 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, !13, i64 2400}
!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, !9, i64 2396}
!20 = !{!6, !9, i64 144}
!21 = !{!6, !12, i64 128}
!22 = !{!6, !9, i64 140}
!23 = !{!6, !9, i64 204}
!24 = !{!6, !9, i64 208}
!25 = !{!9, !9, i64 0}
!26 = !{!6, !9, i64 200}
!27 = !{!6, !9, i64 272}
!28 = !{!6, !12, i64 176}
!29 = !{!6, !9, i64 184}
!30 = !{!6, !9, i64 2424}
!31 = !{!6, !9, i64 2428}
!32 = !{!6, !12, i64 16}
!33 = !{!10, !10, i64 0}
!34 = !{!6, !9, i64 24}
!35 = !{!6, !12, i64 104}
!36 = !{!6, !12, i64 2416}
!37 = !{!6, !9, i64 52}
!38 = !{!6, !12, i64 312}
!39 = !{!8, !9, i64 0}
!40 = !{!7, !13, i64 84}
!41 = !{!6, !13, i64 84}
!42 = !{!6, !9, i64 56}
!43 = !{!7, !12, i64 32}
!44 = !{!45, !10, i64 6}
!45 = !{!"SnapShot", !13, i64 0, !13, i64 2, !10, i64 4, !10, i64 5, !10, i64 6, !10, i64 7}
!46 = !{!6, !12, i64 120}
!47 = !{!7, !13, i64 76}
!48 = !{!45, !10, i64 7}
!49 = !{!50, !10, i64 7}
!50 = !{!"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}
!51 = !{!6, !12, i64 2496}
!52 = !{!6, !9, i64 2504}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,LICMPass,LoopRotatePass,MemCpyOptPass,ReassociatePass,SLPVectorizerPass,SROAPass,SimplifyCFGPass,TailCallElimPass