; 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.RecordIndex = type { %union.TValue, %union.TValue, %union.TValue, %union.TValue, ptr, ptr, i32, i32, i32, i32, i32, i32 }
%union.TValue = type { i64 }
%struct.anon = type { %union.anon, i32 }
%union.anon = type { %struct.GCRef }
%struct.GCRef = type { i32 }
%struct.GCtab = type { %struct.GCRef, i8, i8, i8, i8, %struct.MRef, %struct.GCRef, %struct.GCRef, ptr, %struct.MRef, i32, i32 }
%struct.MRef = type { i32 }
%struct.GCudata = type { %struct.GCRef, i8, i8, i8, i8, %struct.GCRef, i32, %struct.GCRef, i32 }
%struct.GG_State = type { %struct.lua_State, %struct.global_State, %struct.jit_State, [64 x i16], [243 x ptr], [57 x i32] }
%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 }
%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.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.HotPenalty = type { %struct.MRef, i16, i16 }
%struct.BPropEntry = type { i16, i16, i32 }
%struct.ScEvEntry = type { %struct.MRef, i16, i16, i16, i16, %struct.IRType1, i8 }

; 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

declare hidden i32 @lj_opt_fold(ptr noundef) #2

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

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

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

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

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

; Function Attrs: nounwind uwtable
define hidden i32 @lj_record_mm_lookup(ptr noundef %0, ptr noundef %1, i32 noundef %2) #4 {
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca %struct.RecordIndex, align 8
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store i32 %2, ptr %7, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 72, ptr %8) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #5
  %16 = load ptr, ptr %6, align 8, !tbaa !5
  %17 = getelementptr inbounds %struct.RecordIndex, ptr %16, i32 0, i32 6
  %18 = load i32, ptr %17, align 8, !tbaa !11
  %19 = and i32 %18, 520093696
  %20 = icmp eq i32 %19, 184549376
  br i1 %20, label %21, label %42

21:                                               ; preds = %3
  %22 = load ptr, ptr %6, align 8, !tbaa !5
  %23 = getelementptr inbounds %struct.RecordIndex, ptr %22, i32 0, i32 0
  %24 = getelementptr inbounds %struct.anon, ptr %23, i32 0, i32 0
  %25 = getelementptr inbounds %struct.GCRef, ptr %24, i32 0, i32 0
  %26 = load i32, ptr %25, align 8, !tbaa !13
  %27 = zext i32 %26 to i64
  %28 = inttoptr i64 %27 to ptr
  %29 = getelementptr inbounds %struct.GCtab, ptr %28, i32 0, i32 7
  %30 = getelementptr inbounds %struct.GCRef, ptr %29, i32 0, i32 0
  %31 = load i32, ptr %30, align 8, !tbaa !13
  %32 = zext i32 %31 to i64
  %33 = inttoptr i64 %32 to ptr
  store ptr %33, ptr %9, align 8, !tbaa !5
  %34 = load ptr, ptr %5, align 8, !tbaa !5
  %35 = load ptr, ptr %6, align 8, !tbaa !5
  %36 = getelementptr inbounds %struct.RecordIndex, ptr %35, i32 0, i32 6
  %37 = load i32, ptr %36, align 8, !tbaa !11
  %38 = trunc i32 %37 to i16
  call void @lj_ir_set_(ptr noundef %34, i16 noundef zeroext 17675, i16 noundef zeroext %38, i16 noundef zeroext 5)
  %39 = load ptr, ptr %5, align 8, !tbaa !5
  %40 = call i32 @lj_opt_fold(ptr noundef %39)
  %41 = getelementptr inbounds %struct.RecordIndex, ptr %8, i32 0, i32 6
  store i32 %40, ptr %41, align 8, !tbaa !11
  br label %240

42:                                               ; preds = %3
  %43 = load ptr, ptr %6, align 8, !tbaa !5
  %44 = getelementptr inbounds %struct.RecordIndex, ptr %43, i32 0, i32 6
  %45 = load i32, ptr %44, align 8, !tbaa !11
  %46 = and i32 %45, 520093696
  %47 = icmp eq i32 %46, 201326592
  br i1 %47, label %48, label %184

48:                                               ; preds = %42
  %49 = load ptr, ptr %6, align 8, !tbaa !5
  %50 = getelementptr inbounds %struct.RecordIndex, ptr %49, i32 0, i32 0
  %51 = getelementptr inbounds %struct.anon, ptr %50, i32 0, i32 0
  %52 = getelementptr inbounds %struct.GCRef, ptr %51, i32 0, i32 0
  %53 = load i32, ptr %52, align 8, !tbaa !13
  %54 = zext i32 %53 to i64
  %55 = inttoptr i64 %54 to ptr
  %56 = getelementptr inbounds %struct.GCudata, ptr %55, i32 0, i32 3
  %57 = load i8, ptr %56, align 2, !tbaa !13
  %58 = zext i8 %57 to i32
  store i32 %58, ptr %10, align 4, !tbaa !9
  %59 = load ptr, ptr %6, align 8, !tbaa !5
  %60 = getelementptr inbounds %struct.RecordIndex, ptr %59, i32 0, i32 0
  %61 = getelementptr inbounds %struct.anon, ptr %60, i32 0, i32 0
  %62 = getelementptr inbounds %struct.GCRef, ptr %61, i32 0, i32 0
  %63 = load i32, ptr %62, align 8, !tbaa !13
  %64 = zext i32 %63 to i64
  %65 = inttoptr i64 %64 to ptr
  %66 = getelementptr inbounds %struct.GCudata, ptr %65, i32 0, i32 7
  %67 = getelementptr inbounds %struct.GCRef, ptr %66, i32 0, i32 0
  %68 = load i32, ptr %67, align 8, !tbaa !13
  %69 = zext i32 %68 to i64
  %70 = inttoptr i64 %69 to ptr
  store ptr %70, ptr %9, align 8, !tbaa !5
  %71 = load i32, ptr %10, align 4, !tbaa !9
  %72 = icmp ne i32 %71, 0
  br i1 %72, label %73, label %175

73:                                               ; preds = %48
  %74 = load i32, ptr %10, align 4, !tbaa !9
  %75 = icmp eq i32 %74, 2
  br i1 %75, label %76, label %94

76:                                               ; preds = %73
  %77 = load ptr, ptr %5, align 8, !tbaa !5
  %78 = load ptr, ptr %6, align 8, !tbaa !5
  %79 = getelementptr inbounds %struct.RecordIndex, ptr %78, i32 0, i32 6
  %80 = load i32, ptr %79, align 8, !tbaa !11
  %81 = trunc i32 %80 to i16
  %82 = load ptr, ptr %5, align 8, !tbaa !5
  %83 = load ptr, ptr %6, align 8, !tbaa !5
  %84 = getelementptr inbounds %struct.RecordIndex, ptr %83, i32 0, i32 0
  %85 = getelementptr inbounds %struct.anon, ptr %84, i32 0, i32 0
  %86 = getelementptr inbounds %struct.GCRef, ptr %85, i32 0, i32 0
  %87 = load i32, ptr %86, align 8, !tbaa !13
  %88 = zext i32 %87 to i64
  %89 = inttoptr i64 %88 to ptr
  %90 = call i32 @lj_ir_kptr_(ptr noundef %82, i32 noundef 25, ptr noundef %89)
  %91 = trunc i32 %90 to i16
  call void @lj_ir_set_(ptr noundef %77, i16 noundef zeroext 2181, i16 noundef zeroext %81, i16 noundef zeroext %91)
  %92 = load ptr, ptr %5, align 8, !tbaa !5
  %93 = call i32 @lj_opt_fold(ptr noundef %92)
  br label %111

94:                                               ; preds = %73
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  %95 = load ptr, ptr %5, align 8, !tbaa !5
  %96 = load ptr, ptr %6, align 8, !tbaa !5
  %97 = getelementptr inbounds %struct.RecordIndex, ptr %96, i32 0, i32 6
  %98 = load i32, ptr %97, align 8, !tbaa !11
  %99 = trunc i32 %98 to i16
  call void @lj_ir_set_(ptr noundef %95, i16 noundef zeroext 17680, i16 noundef zeroext %99, i16 noundef zeroext 12)
  %100 = load ptr, ptr %5, align 8, !tbaa !5
  %101 = call i32 @lj_opt_fold(ptr noundef %100)
  store i32 %101, ptr %12, align 4, !tbaa !9
  %102 = load ptr, ptr %5, align 8, !tbaa !5
  %103 = load i32, ptr %12, align 4, !tbaa !9
  %104 = trunc i32 %103 to i16
  %105 = load ptr, ptr %5, align 8, !tbaa !5
  %106 = load i32, ptr %10, align 4, !tbaa !9
  %107 = call i32 @lj_ir_kint(ptr noundef %105, i32 noundef %106)
  %108 = trunc i32 %107 to i16
  call void @lj_ir_set_(ptr noundef %102, i16 noundef zeroext 2195, i16 noundef zeroext %104, i16 noundef zeroext %108)
  %109 = load ptr, ptr %5, align 8, !tbaa !5
  %110 = call i32 @lj_opt_fold(ptr noundef %109)
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  br label %111

111:                                              ; preds = %94, %76
  br label %112

112:                                              ; preds = %231, %111
  %113 = load ptr, ptr %9, align 8, !tbaa !5
  %114 = load ptr, ptr %5, align 8, !tbaa !5
  %115 = getelementptr inbounds i8, ptr %114, i64 -800
  %116 = getelementptr inbounds %struct.GG_State, ptr %115, i32 0, i32 1
  %117 = getelementptr inbounds %struct.global_State, ptr %116, i32 0, i32 29
  %118 = load i32, ptr %7, align 4, !tbaa !9
  %119 = add i32 0, %118
  %120 = zext i32 %119 to i64
  %121 = getelementptr inbounds [38 x %struct.GCRef], ptr %117, i64 0, i64 %120
  %122 = getelementptr inbounds %struct.GCRef, ptr %121, i32 0, i32 0
  %123 = load i32, ptr %122, align 4, !tbaa !14
  %124 = zext i32 %123 to i64
  %125 = inttoptr i64 %124 to ptr
  %126 = call ptr @lj_tab_getstr(ptr noundef %113, ptr noundef %125)
  store ptr %126, ptr %11, align 8, !tbaa !5
  %127 = load ptr, ptr %11, align 8, !tbaa !5
  %128 = icmp ne ptr %127, null
  br i1 %128, label %129, label %134

129:                                              ; preds = %112
  %130 = load ptr, ptr %11, align 8, !tbaa !5
  %131 = getelementptr inbounds %struct.anon, ptr %130, i32 0, i32 1
  %132 = load i32, ptr %131, align 4, !tbaa !13
  %133 = icmp eq i32 %132, -1
  br i1 %133, label %134, label %135

134:                                              ; preds = %129, %112
  store i32 0, ptr %4, align 4
  store i32 1, ptr %13, align 4
  br label %332

135:                                              ; preds = %129
  %136 = load ptr, ptr %11, align 8, !tbaa !5
  %137 = getelementptr inbounds %struct.anon, ptr %136, i32 0, i32 1
  %138 = load i32, ptr %137, align 4, !tbaa !13
  %139 = icmp eq i32 %138, -9
  br i1 %139, label %147, label %140

140:                                              ; preds = %135
  %141 = load ptr, ptr %11, align 8, !tbaa !5
  %142 = getelementptr inbounds %struct.anon, ptr %141, i32 0, i32 1
  %143 = load i32, ptr %142, align 4, !tbaa !13
  %144 = icmp eq i32 %143, -12
  br i1 %144, label %147, label %145

145:                                              ; preds = %140
  %146 = load ptr, ptr %5, align 8, !tbaa !5
  call void @lj_trace_err(ptr noundef %146, i32 noundef 11) #6
  unreachable

147:                                              ; preds = %140, %135
  %148 = load ptr, ptr %5, align 8, !tbaa !5
  %149 = getelementptr inbounds %struct.jit_State, ptr %148, i32 0, i32 1
  %150 = load ptr, ptr %149, align 8, !tbaa !16
  %151 = load ptr, ptr %6, align 8, !tbaa !5
  %152 = getelementptr inbounds %struct.RecordIndex, ptr %151, i32 0, i32 3
  %153 = load ptr, ptr %11, align 8, !tbaa !5
  call void @copyTV(ptr noundef %150, ptr noundef %152, ptr noundef %153)
  %154 = load ptr, ptr %5, align 8, !tbaa !5
  %155 = load ptr, ptr %11, align 8, !tbaa !5
  %156 = getelementptr inbounds %struct.anon, 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 !13
  %159 = zext i32 %158 to i64
  %160 = inttoptr i64 %159 to ptr
  %161 = load ptr, ptr %11, align 8, !tbaa !5
  %162 = getelementptr inbounds %struct.anon, ptr %161, i32 0, i32 1
  %163 = load i32, ptr %162, align 4, !tbaa !13
  %164 = icmp eq i32 %163, -9
  %165 = zext i1 %164 to i64
  %166 = select i1 %164, i32 8, i32 11
  %167 = call i32 @lj_ir_kgc(ptr noundef %154, ptr noundef %160, i32 noundef %166)
  %168 = load ptr, ptr %6, align 8, !tbaa !5
  %169 = getelementptr inbounds %struct.RecordIndex, ptr %168, i32 0, i32 10
  store i32 %167, ptr %169, align 8, !tbaa !25
  %170 = load ptr, ptr %9, align 8, !tbaa !5
  %171 = load ptr, ptr %6, align 8, !tbaa !5
  %172 = getelementptr inbounds %struct.RecordIndex, ptr %171, i32 0, i32 4
  store ptr %170, ptr %172, align 8, !tbaa !26
  %173 = load ptr, ptr %6, align 8, !tbaa !5
  %174 = getelementptr inbounds %struct.RecordIndex, ptr %173, i32 0, i32 9
  store i32 32767, ptr %174, align 4, !tbaa !27
  store i32 1, ptr %4, align 4
  store i32 1, ptr %13, align 4
  br label %332

175:                                              ; preds = %48
  %176 = load ptr, ptr %5, align 8, !tbaa !5
  %177 = load ptr, ptr %6, align 8, !tbaa !5
  %178 = getelementptr inbounds %struct.RecordIndex, ptr %177, i32 0, i32 6
  %179 = load i32, ptr %178, align 8, !tbaa !11
  %180 = trunc i32 %179 to i16
  call void @lj_ir_set_(ptr noundef %176, i16 noundef zeroext 17675, i16 noundef zeroext %180, i16 noundef zeroext 11)
  %181 = load ptr, ptr %5, align 8, !tbaa !5
  %182 = call i32 @lj_opt_fold(ptr noundef %181)
  %183 = getelementptr inbounds %struct.RecordIndex, ptr %8, i32 0, i32 6
  store i32 %182, ptr %183, align 8, !tbaa !11
  br label %239

184:                                              ; preds = %42
  %185 = load ptr, ptr %5, align 8, !tbaa !5
  %186 = getelementptr inbounds i8, ptr %185, i64 -800
  %187 = getelementptr inbounds %struct.GG_State, ptr %186, i32 0, i32 1
  %188 = getelementptr inbounds %struct.global_State, ptr %187, i32 0, i32 29
  %189 = load ptr, ptr %6, align 8, !tbaa !5
  %190 = getelementptr inbounds %struct.RecordIndex, ptr %189, i32 0, i32 0
  %191 = getelementptr inbounds %struct.anon, ptr %190, i32 0, i32 1
  %192 = load i32, ptr %191, align 4, !tbaa !13
  %193 = icmp ule i32 %192, -65537
  br i1 %193, label %194, label %195

194:                                              ; preds = %184
  br label %211

195:                                              ; preds = %184
  %196 = load ptr, ptr %6, align 8, !tbaa !5
  %197 = getelementptr inbounds %struct.RecordIndex, ptr %196, i32 0, i32 0
  %198 = getelementptr inbounds %struct.anon, ptr %197, i32 0, i32 1
  %199 = load i32, ptr %198, align 4, !tbaa !13
  %200 = ashr i32 %199, 15
  %201 = icmp eq i32 %200, -2
  br i1 %201, label %202, label %203

202:                                              ; preds = %195
  br label %209

203:                                              ; preds = %195
  %204 = load ptr, ptr %6, align 8, !tbaa !5
  %205 = getelementptr inbounds %struct.RecordIndex, ptr %204, i32 0, i32 0
  %206 = getelementptr inbounds %struct.anon, ptr %205, i32 0, i32 1
  %207 = load i32, ptr %206, align 4, !tbaa !13
  %208 = xor i32 %207, -1
  br label %209

209:                                              ; preds = %203, %202
  %210 = phi i32 [ 3, %202 ], [ %208, %203 ]
  br label %211

211:                                              ; preds = %209, %194
  %212 = phi i32 [ 13, %194 ], [ %210, %209 ]
  %213 = add i32 22, %212
  %214 = zext i32 %213 to i64
  %215 = getelementptr inbounds [38 x %struct.GCRef], ptr %188, i64 0, i64 %214
  %216 = getelementptr inbounds %struct.GCRef, ptr %215, i32 0, i32 0
  %217 = load i32, ptr %216, align 4, !tbaa !14
  %218 = zext i32 %217 to i64
  %219 = inttoptr i64 %218 to ptr
  store ptr %219, ptr %9, align 8, !tbaa !5
  %220 = load ptr, ptr %9, align 8, !tbaa !5
  %221 = icmp eq ptr %220, null
  br i1 %221, label %222, label %225

222:                                              ; preds = %211
  %223 = load ptr, ptr %6, align 8, !tbaa !5
  %224 = getelementptr inbounds %struct.RecordIndex, ptr %223, i32 0, i32 9
  store i32 32767, ptr %224, align 4, !tbaa !27
  store i32 0, ptr %4, align 4
  store i32 1, ptr %13, align 4
  br label %332

225:                                              ; preds = %211
  %226 = load ptr, ptr %6, align 8, !tbaa !5
  %227 = getelementptr inbounds %struct.RecordIndex, ptr %226, i32 0, i32 6
  %228 = load i32, ptr %227, align 8, !tbaa !11
  %229 = and i32 %228, 520093696
  %230 = icmp eq i32 %229, 167772160
  br i1 %230, label %231, label %232

231:                                              ; preds = %225
  br label %112

232:                                              ; preds = %225
  %233 = load ptr, ptr %5, align 8, !tbaa !5
  %234 = load ptr, ptr %9, align 8, !tbaa !5
  %235 = call i32 @lj_ir_kgc(ptr noundef %233, ptr noundef %234, i32 noundef 11)
  %236 = getelementptr inbounds %struct.RecordIndex, ptr %8, i32 0, i32 6
  store i32 %235, ptr %236, align 8, !tbaa !11
  %237 = load ptr, ptr %6, align 8, !tbaa !5
  %238 = getelementptr inbounds %struct.RecordIndex, ptr %237, i32 0, i32 9
  store i32 %235, ptr %238, align 4, !tbaa !27
  br label %267

239:                                              ; preds = %175
  br label %240

240:                                              ; preds = %239, %21
  %241 = load ptr, ptr %9, align 8, !tbaa !5
  %242 = icmp ne ptr %241, null
  br i1 %242, label %243, label %246

243:                                              ; preds = %240
  %244 = getelementptr inbounds %struct.RecordIndex, ptr %8, i32 0, i32 6
  %245 = load i32, ptr %244, align 8, !tbaa !11
  br label %247

246:                                              ; preds = %240
  br label %247

247:                                              ; preds = %246, %243
  %248 = phi i32 [ %245, %243 ], [ 32767, %246 ]
  %249 = load ptr, ptr %6, align 8, !tbaa !5
  %250 = getelementptr inbounds %struct.RecordIndex, ptr %249, i32 0, i32 9
  store i32 %248, ptr %250, align 4, !tbaa !27
  %251 = load ptr, ptr %5, align 8, !tbaa !5
  %252 = load ptr, ptr %9, align 8, !tbaa !5
  %253 = icmp ne ptr %252, null
  %254 = zext i1 %253 to i64
  %255 = select i1 %253, i32 9, i32 8
  %256 = shl i32 %255, 8
  %257 = or i32 %256, 139
  %258 = trunc i32 %257 to i16
  %259 = getelementptr inbounds %struct.RecordIndex, ptr %8, i32 0, i32 6
  %260 = load i32, ptr %259, align 8, !tbaa !11
  %261 = trunc i32 %260 to i16
  %262 = load ptr, ptr %5, align 8, !tbaa !5
  %263 = call i32 @lj_ir_knull(ptr noundef %262, i32 noundef 11)
  %264 = trunc i32 %263 to i16
  call void @lj_ir_set_(ptr noundef %251, i16 noundef zeroext %258, i16 noundef zeroext %261, i16 noundef zeroext %264)
  %265 = load ptr, ptr %5, align 8, !tbaa !5
  %266 = call i32 @lj_opt_fold(ptr noundef %265)
  br label %267

267:                                              ; preds = %247, %232
  %268 = load ptr, ptr %9, align 8, !tbaa !5
  %269 = icmp ne ptr %268, null
  br i1 %269, label %270, label %331

270:                                              ; preds = %267
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #5
  %271 = load ptr, ptr %5, align 8, !tbaa !5
  %272 = getelementptr inbounds i8, ptr %271, i64 -800
  %273 = getelementptr inbounds %struct.GG_State, ptr %272, i32 0, i32 1
  %274 = getelementptr inbounds %struct.global_State, ptr %273, i32 0, i32 29
  %275 = load i32, ptr %7, align 4, !tbaa !9
  %276 = add i32 0, %275
  %277 = zext i32 %276 to i64
  %278 = getelementptr inbounds [38 x %struct.GCRef], ptr %274, i64 0, i64 %277
  %279 = getelementptr inbounds %struct.GCRef, ptr %278, i32 0, i32 0
  %280 = load i32, ptr %279, align 4, !tbaa !14
  %281 = zext i32 %280 to i64
  %282 = inttoptr i64 %281 to ptr
  store ptr %282, ptr %14, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #5
  %283 = load ptr, ptr %9, align 8, !tbaa !5
  %284 = load ptr, ptr %14, align 8, !tbaa !5
  %285 = call ptr @lj_tab_getstr(ptr noundef %283, ptr noundef %284)
  store ptr %285, ptr %15, align 8, !tbaa !5
  %286 = load ptr, ptr %15, align 8, !tbaa !5
  %287 = icmp ne ptr %286, null
  br i1 %287, label %288, label %300

288:                                              ; preds = %270
  %289 = load ptr, ptr %15, align 8, !tbaa !5
  %290 = getelementptr inbounds %struct.anon, ptr %289, i32 0, i32 1
  %291 = load i32, ptr %290, align 4, !tbaa !13
  %292 = icmp eq i32 %291, -1
  br i1 %292, label %300, label %293

293:                                              ; preds = %288
  %294 = load ptr, ptr %5, align 8, !tbaa !5
  %295 = getelementptr inbounds %struct.jit_State, ptr %294, i32 0, i32 1
  %296 = load ptr, ptr %295, align 8, !tbaa !16
  %297 = load ptr, ptr %6, align 8, !tbaa !5
  %298 = getelementptr inbounds %struct.RecordIndex, ptr %297, i32 0, i32 3
  %299 = load ptr, ptr %15, align 8, !tbaa !5
  call void @copyTV(ptr noundef %296, ptr noundef %298, ptr noundef %299)
  br label %300

300:                                              ; preds = %293, %288, %270
  %301 = load ptr, ptr %9, align 8, !tbaa !5
  %302 = load ptr, ptr %6, align 8, !tbaa !5
  %303 = getelementptr inbounds %struct.RecordIndex, ptr %302, i32 0, i32 4
  store ptr %301, ptr %303, align 8, !tbaa !26
  %304 = load ptr, ptr %5, align 8, !tbaa !5
  %305 = getelementptr inbounds %struct.jit_State, ptr %304, i32 0, i32 1
  %306 = load ptr, ptr %305, align 8, !tbaa !16
  %307 = getelementptr inbounds %struct.RecordIndex, ptr %8, i32 0, i32 0
  %308 = load ptr, ptr %9, align 8, !tbaa !5
  call void @settabV(ptr noundef %306, ptr noundef %307, ptr noundef %308)
  %309 = load ptr, ptr %5, align 8, !tbaa !5
  %310 = getelementptr inbounds %struct.jit_State, ptr %309, i32 0, i32 1
  %311 = load ptr, ptr %310, align 8, !tbaa !16
  %312 = getelementptr inbounds %struct.RecordIndex, ptr %8, i32 0, i32 1
  %313 = load ptr, ptr %14, align 8, !tbaa !5
  call void @setstrV(ptr noundef %311, ptr noundef %312, ptr noundef %313)
  %314 = load ptr, ptr %5, align 8, !tbaa !5
  %315 = load ptr, ptr %14, align 8, !tbaa !5
  %316 = call i32 @lj_ir_kgc(ptr noundef %314, ptr noundef %315, i32 noundef 4)
  %317 = getelementptr inbounds %struct.RecordIndex, ptr %8, i32 0, i32 7
  store i32 %316, ptr %317, align 4, !tbaa !28
  %318 = getelementptr inbounds %struct.RecordIndex, ptr %8, i32 0, i32 8
  store i32 0, ptr %318, align 8, !tbaa !29
  %319 = getelementptr inbounds %struct.RecordIndex, ptr %8, i32 0, i32 11
  store i32 0, ptr %319, align 4, !tbaa !30
  %320 = load ptr, ptr %5, align 8, !tbaa !5
  %321 = call i32 @lj_record_idx(ptr noundef %320, ptr noundef %8)
  %322 = load ptr, ptr %6, align 8, !tbaa !5
  %323 = getelementptr inbounds %struct.RecordIndex, ptr %322, i32 0, i32 10
  store i32 %321, ptr %323, align 8, !tbaa !25
  %324 = load ptr, ptr %6, align 8, !tbaa !5
  %325 = getelementptr inbounds %struct.RecordIndex, ptr %324, i32 0, i32 10
  %326 = load i32, ptr %325, align 8, !tbaa !25
  %327 = and i32 %326, 520093696
  %328 = icmp eq i32 %327, 0
  %329 = xor i1 %328, true
  %330 = zext i1 %329 to i32
  store i32 %330, ptr %4, align 4
  store i32 1, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  br label %332

331:                                              ; preds = %267
  store i32 0, ptr %4, align 4
  store i32 1, ptr %13, align 4
  br label %332

332:                                              ; preds = %331, %300, %222, %147, %134
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 72, ptr %8) #5
  %333 = load i32, ptr %4, align 4
  ret i32 %333
}

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

declare hidden ptr @lj_tab_getstr(ptr noundef, ptr noundef) #2

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

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

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

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

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 = { "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 = { 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 = { 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, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !10, i64 48}
!12 = !{!"RecordIndex", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !6, i64 32, !6, i64 40, !10, i64 48, !10, i64 52, !10, i64 56, !10, i64 60, !10, i64 64, !10, i64 68}
!13 = !{!7, !7, i64 0}
!14 = !{!15, !10, i64 0}
!15 = !{!"GCRef", !10, i64 0}
!16 = !{!17, !6, i64 96}
!17 = !{!"jit_State", !18, 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, !21, i64 150, !7, i64 151, !22, 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, !20, 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, !23, 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, !24, i64 2472, !24, i64 2480, !7, i64 2488, !6, i64 2496, !10, i64 2504, !10, i64 2508}
!18 = !{!"GCtrace", !15, i64 0, !7, i64 4, !7, i64 5, !7, i64 6, !7, i64 7, !10, i64 8, !15, i64 12, !6, i64 16, !10, i64 24, !19, i64 28, !19, i64 30, !6, i64 32, !6, i64 40, !15, i64 48, !20, i64 52, !10, i64 56, !10, i64 60, !6, i64 64, !10, i64 72, !19, i64 76, !19, i64 78, !19, i64 80, !19, i64 82, !19, i64 84, !19, i64 86, !19, i64 88, !7, i64 90, !7, i64 91}
!19 = !{!"short", !7, i64 0}
!20 = !{!"MRef", !10, i64 0}
!21 = !{!"IRType1", !7, i64 0}
!22 = !{!"FoldState", !7, i64 0, !7, i64 8, !7, i64 16}
!23 = !{!"ScEvEntry", !20, i64 0, !19, i64 4, !19, i64 6, !19, i64 8, !19, i64 10, !21, i64 12, !7, i64 13}
!24 = !{!"long", !7, i64 0}
!25 = !{!12, !10, i64 64}
!26 = !{!12, !6, i64 32}
!27 = !{!12, !10, i64 60}
!28 = !{!12, !10, i64 52}
!29 = !{!12, !10, i64 56}
!30 = !{!12, !10, i64 68}


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

; Function Attrs: mustprogress 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) local_unnamed_addr #1

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

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

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

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

declare hidden i32 @lj_ir_kptr_(ptr noundef, i32 noundef, ptr 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
define hidden range(i32 0, 2) i32 @lj_record_mm_lookup(ptr noundef %0, ptr noundef %1, i32 noundef %2) local_unnamed_addr #4 {
  %4 = alloca %struct.RecordIndex, align 8
  call void @llvm.lifetime.start.p0(i64 72, ptr nonnull %4) #5
  %5 = getelementptr inbounds i8, ptr %1, i64 48
  %6 = load i32, ptr %5, align 8, !tbaa !5
  %7 = and i32 %6, 520093696
  switch i32 %7, label %64 [
    i32 184549376, label %8
    i32 201326592, label %16
  ]

8:                                                ; preds = %3
  %9 = load i32, ptr %1, align 8, !tbaa !11
  %10 = zext i32 %9 to i64
  %11 = inttoptr i64 %10 to ptr
  %12 = getelementptr inbounds i8, ptr %11, i64 16
  %13 = load i32, ptr %12, align 8, !tbaa !11
  %14 = zext i32 %13 to i64
  %15 = inttoptr i64 %14 to ptr
  br label %89

16:                                               ; preds = %3
  %17 = load i32, ptr %1, align 8, !tbaa !11
  %18 = zext i32 %17 to i64
  %19 = inttoptr i64 %18 to ptr
  %20 = getelementptr inbounds i8, ptr %19, i64 6
  %21 = load i8, ptr %20, align 2, !tbaa !11
  %22 = getelementptr inbounds i8, ptr %19, i64 16
  %23 = load i32, ptr %22, align 8, !tbaa !11
  %24 = zext i32 %23 to i64
  %25 = inttoptr i64 %24 to ptr
  switch i8 %21, label %30 [
    i8 0, label %89
    i8 2, label %26
  ]

26:                                               ; preds = %16
  %27 = trunc i32 %6 to i16
  %28 = tail call i32 @lj_ir_kptr_(ptr noundef %0, i32 noundef 25, ptr noundef nonnull %19) #5
  %29 = trunc i32 %28 to i16
  tail call void @lj_ir_set_(ptr noundef %0, i16 noundef zeroext 2181, i16 noundef zeroext %27, i16 noundef zeroext %29)
  br label %.sink.split

30:                                               ; preds = %16
  %31 = zext i8 %21 to i32
  %32 = trunc i32 %6 to i16
  tail call void @lj_ir_set_(ptr noundef %0, i16 noundef zeroext 17680, i16 noundef zeroext %32, i16 noundef zeroext 12)
  %33 = tail call i32 @lj_opt_fold(ptr noundef %0) #5
  %34 = trunc i32 %33 to i16
  %35 = tail call i32 @lj_ir_kint(ptr noundef %0, i32 noundef %31) #5
  %36 = trunc i32 %35 to i16
  tail call void @lj_ir_set_(ptr noundef %0, i16 noundef zeroext 2195, i16 noundef zeroext %34, i16 noundef zeroext %36)
  br label %.sink.split

.sink.split:                                      ; preds = %30, %26
  %37 = tail call i32 @lj_opt_fold(ptr noundef %0) #5
  br label %38

38:                                               ; preds = %.sink.split, %83
  %.081 = phi ptr [ %79, %83 ], [ %25, %.sink.split ]
  %39 = getelementptr inbounds i8, ptr %0, i64 -156
  %40 = zext i32 %2 to i64
  %41 = getelementptr inbounds [38 x %struct.GCRef], ptr %39, i64 0, i64 %40
  %42 = load i32, ptr %41, align 4, !tbaa !12
  %43 = zext i32 %42 to i64
  %44 = inttoptr i64 %43 to ptr
  %45 = tail call ptr @lj_tab_getstr(ptr noundef %.081, ptr noundef %44) #5
  %.not89 = icmp eq ptr %45, null
  br i1 %.not89, label %132, label %46

46:                                               ; preds = %38
  %47 = getelementptr inbounds i8, ptr %45, i64 4
  %48 = load i32, ptr %47, align 4, !tbaa !11
  switch i32 %48, label %49 [
    i32 -1, label %132
    i32 -9, label %50
    i32 -12, label %50
  ]

49:                                               ; preds = %46
  tail call void @lj_trace_err(ptr noundef nonnull %0, i32 noundef 11) #6
  unreachable

50:                                               ; preds = %46, %46
  %51 = getelementptr inbounds i8, ptr %0, i64 96
  %52 = load ptr, ptr %51, align 8, !tbaa !14
  %53 = getelementptr inbounds i8, ptr %1, i64 24
  tail call void @copyTV(ptr noundef %52, ptr noundef nonnull %53, ptr noundef nonnull %45)
  %54 = load i32, ptr %45, align 8, !tbaa !11
  %55 = zext i32 %54 to i64
  %56 = inttoptr i64 %55 to ptr
  %57 = load i32, ptr %47, align 4, !tbaa !11
  %58 = icmp eq i32 %57, -9
  %59 = select i1 %58, i32 8, i32 11
  %60 = tail call i32 @lj_ir_kgc(ptr noundef nonnull %0, ptr noundef %56, i32 noundef %59) #5
  %61 = getelementptr inbounds i8, ptr %1, i64 64
  store i32 %60, ptr %61, align 8, !tbaa !23
  %62 = getelementptr inbounds i8, ptr %1, i64 32
  store ptr %.081, ptr %62, align 8, !tbaa !24
  %63 = getelementptr inbounds i8, ptr %1, i64 60
  store i32 32767, ptr %63, align 4, !tbaa !25
  br label %132

64:                                               ; preds = %3
  %65 = getelementptr inbounds i8, ptr %0, i64 -156
  %66 = getelementptr inbounds i8, ptr %1, i64 4
  %67 = load i32, ptr %66, align 4, !tbaa !11
  %68 = icmp ult i32 %67, -65536
  br i1 %68, label %74, label %69

69:                                               ; preds = %64
  %.mask = and i32 %67, -32768
  %70 = icmp eq i32 %.mask, -65536
  br i1 %70, label %74, label %71

71:                                               ; preds = %69
  %72 = sub nsw i32 21, %67
  %73 = zext nneg i32 %72 to i64
  br label %74

74:                                               ; preds = %71, %69, %64
  %75 = phi i64 [ 35, %64 ], [ %73, %71 ], [ 25, %69 ]
  %76 = getelementptr inbounds [38 x %struct.GCRef], ptr %65, i64 0, i64 %75
  %77 = load i32, ptr %76, align 4, !tbaa !12
  %78 = zext i32 %77 to i64
  %79 = inttoptr i64 %78 to ptr
  %80 = icmp eq i32 %77, 0
  br i1 %80, label %81, label %83

81:                                               ; preds = %74
  %82 = getelementptr inbounds i8, ptr %1, i64 60
  store i32 32767, ptr %82, align 4, !tbaa !25
  br label %132

83:                                               ; preds = %74
  %84 = icmp eq i32 %7, 167772160
  br i1 %84, label %38, label %85

85:                                               ; preds = %83
  %86 = tail call i32 @lj_ir_kgc(ptr noundef nonnull %0, ptr noundef nonnull %79, i32 noundef 11) #5
  %87 = getelementptr inbounds i8, ptr %4, i64 48
  store i32 %86, ptr %87, align 8, !tbaa !5
  %88 = getelementptr inbounds i8, ptr %1, i64 60
  store i32 %86, ptr %88, align 4, !tbaa !25
  br label %100

89:                                               ; preds = %16, %8
  %.sink94 = phi i16 [ 5, %8 ], [ 11, %16 ]
  %.1 = phi ptr [ %15, %8 ], [ %25, %16 ]
  %90 = trunc i32 %6 to i16
  tail call void @lj_ir_set_(ptr noundef %0, i16 noundef zeroext 17675, i16 noundef zeroext %90, i16 noundef zeroext %.sink94)
  %91 = tail call i32 @lj_opt_fold(ptr noundef %0) #5
  %92 = getelementptr inbounds i8, ptr %4, i64 48
  store i32 %91, ptr %92, align 8, !tbaa !5
  %.not90 = icmp eq ptr %.1, null
  %93 = select i1 %.not90, i32 32767, i32 %91
  %94 = getelementptr inbounds i8, ptr %1, i64 60
  store i32 %93, ptr %94, align 4, !tbaa !25
  %95 = select i1 %.not90, i16 2187, i16 2443
  %96 = trunc i32 %91 to i16
  %97 = tail call i32 @lj_ir_knull(ptr noundef %0, i32 noundef 11) #5
  %98 = trunc i32 %97 to i16
  tail call void @lj_ir_set_(ptr noundef %0, i16 noundef zeroext %95, i16 noundef zeroext %96, i16 noundef zeroext %98)
  %99 = tail call i32 @lj_opt_fold(ptr noundef %0) #5
  br label %100

100:                                              ; preds = %89, %85
  %.2 = phi ptr [ %.1, %89 ], [ %79, %85 ]
  %.not91 = icmp eq ptr %.2, null
  br i1 %.not91, label %132, label %101

101:                                              ; preds = %100
  %102 = getelementptr inbounds i8, ptr %0, i64 -156
  %103 = zext i32 %2 to i64
  %104 = getelementptr inbounds [38 x %struct.GCRef], ptr %102, i64 0, i64 %103
  %105 = load i32, ptr %104, align 4, !tbaa !12
  %106 = zext i32 %105 to i64
  %107 = inttoptr i64 %106 to ptr
  %108 = tail call ptr @lj_tab_getstr(ptr noundef nonnull %.2, ptr noundef %107) #5
  %.not92 = icmp eq ptr %108, null
  br i1 %.not92, label %117, label %109

109:                                              ; preds = %101
  %110 = getelementptr inbounds i8, ptr %108, i64 4
  %111 = load i32, ptr %110, align 4, !tbaa !11
  %112 = icmp eq i32 %111, -1
  br i1 %112, label %117, label %113

113:                                              ; preds = %109
  %114 = getelementptr inbounds i8, ptr %0, i64 96
  %115 = load ptr, ptr %114, align 8, !tbaa !14
  %116 = getelementptr inbounds i8, ptr %1, i64 24
  tail call void @copyTV(ptr noundef %115, ptr noundef nonnull %116, ptr noundef nonnull %108)
  br label %117

117:                                              ; preds = %113, %109, %101
  %118 = getelementptr inbounds i8, ptr %1, i64 32
  store ptr %.2, ptr %118, align 8, !tbaa !24
  %119 = getelementptr inbounds i8, ptr %0, i64 96
  %120 = load ptr, ptr %119, align 8, !tbaa !14
  call void @settabV(ptr noundef %120, ptr noundef nonnull %4, ptr noundef nonnull %.2)
  %121 = load ptr, ptr %119, align 8, !tbaa !14
  %122 = getelementptr inbounds i8, ptr %4, i64 8
  call void @setstrV(ptr noundef %121, ptr noundef nonnull %122, ptr noundef %107)
  %123 = call i32 @lj_ir_kgc(ptr noundef nonnull %0, ptr noundef %107, i32 noundef 4) #5
  %124 = getelementptr inbounds i8, ptr %4, i64 52
  store i32 %123, ptr %124, align 4, !tbaa !26
  %125 = getelementptr inbounds i8, ptr %4, i64 56
  store i32 0, ptr %125, align 8, !tbaa !27
  %126 = getelementptr inbounds i8, ptr %4, i64 68
  store i32 0, ptr %126, align 4, !tbaa !28
  %127 = call i32 @lj_record_idx(ptr noundef nonnull %0, ptr noundef nonnull %4)
  %128 = getelementptr inbounds i8, ptr %1, i64 64
  store i32 %127, ptr %128, align 8, !tbaa !23
  %129 = and i32 %127, 520093696
  %130 = icmp ne i32 %129, 0
  %131 = zext i1 %130 to i32
  br label %132

132:                                              ; preds = %100, %46, %38, %117, %81, %50
  %.0 = phi i32 [ %131, %117 ], [ 1, %50 ], [ 0, %81 ], [ 0, %46 ], [ 0, %38 ], [ 0, %100 ]
  call void @llvm.lifetime.end.p0(i64 72, ptr nonnull %4) #5
  ret i32 %.0
}

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

declare hidden ptr @lj_tab_getstr(ptr noundef, ptr noundef) local_unnamed_addr #2

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

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

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

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

attributes #0 = { mustprogress 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 = { "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 = { 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 = { 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, !10, i64 48}
!6 = !{!"RecordIndex", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !9, i64 32, !9, i64 40, !10, i64 48, !10, i64 52, !10, i64 56, !10, i64 60, !10, i64 64, !10, i64 68}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!"any pointer", !7, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!7, !7, i64 0}
!12 = !{!13, !10, i64 0}
!13 = !{!"GCRef", !10, i64 0}
!14 = !{!15, !9, i64 96}
!15 = !{!"jit_State", !16, i64 0, !9, i64 96, !9, i64 104, !9, i64 112, !9, i64 120, !9, i64 128, !10, i64 136, !10, i64 140, !10, i64 144, !7, i64 148, !7, i64 149, !19, i64 150, !7, i64 151, !20, i64 152, !9, i64 176, !10, i64 184, !10, i64 188, !10, i64 192, !10, i64 196, !10, i64 200, !10, i64 204, !10, i64 208, !18, i64 212, !7, i64 216, !9, i64 256, !10, i64 264, !10, i64 268, !10, i64 272, !10, i64 276, !9, i64 280, !9, i64 288, !10, i64 296, !10, i64 300, !7, i64 304, !9, i64 312, !10, i64 320, !10, i64 324, !9, 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, !21, i64 2396, !9, i64 2416, !10, i64 2424, !10, i64 2428, !9, i64 2432, !10, i64 2440, !10, i64 2444, !9, i64 2448, !9, i64 2456, !9, i64 2464, !22, i64 2472, !22, i64 2480, !7, i64 2488, !9, i64 2496, !10, i64 2504, !10, i64 2508}
!16 = !{!"GCtrace", !13, i64 0, !7, i64 4, !7, i64 5, !7, i64 6, !7, i64 7, !10, i64 8, !13, i64 12, !9, i64 16, !10, i64 24, !17, i64 28, !17, i64 30, !9, i64 32, !9, i64 40, !13, i64 48, !18, i64 52, !10, i64 56, !10, i64 60, !9, i64 64, !10, i64 72, !17, i64 76, !17, i64 78, !17, i64 80, !17, i64 82, !17, i64 84, !17, i64 86, !17, i64 88, !7, i64 90, !7, i64 91}
!17 = !{!"short", !7, i64 0}
!18 = !{!"MRef", !10, i64 0}
!19 = !{!"IRType1", !7, i64 0}
!20 = !{!"FoldState", !7, i64 0, !7, i64 8, !7, i64 16}
!21 = !{!"ScEvEntry", !18, i64 0, !17, i64 4, !17, i64 6, !17, i64 8, !17, i64 10, !19, i64 12, !7, i64 13}
!22 = !{!"long", !7, i64 0}
!23 = !{!6, !10, i64 64}
!24 = !{!6, !9, i64 32}
!25 = !{!6, !10, i64 60}
!26 = !{!6, !10, i64 52}
!27 = !{!6, !10, i64 56}
!28 = !{!6, !10, i64 68}


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