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

; 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.lua_State = type { %union.anon }
%union.anon = type { %struct.anon, [320 x i8] }
%struct.anon = type { %struct.GCRef, i8, i8, i8, i8, %struct.MRef, %struct.GCRef, ptr, ptr, %struct.MRef, %struct.MRef, %struct.GCRef, %struct.GCRef, ptr, i32 }
%struct.MRef = type { i32 }
%struct.GCRef = type { i32 }
%union.TValue = type { i64 }
%struct.anon.2 = type { %struct.GCRef, %union.FrameLink }
%union.FrameLink = type { i32 }
%struct.GCfuncL = type { %struct.GCRef, i8, i8, i8, i8, %struct.GCRef, %struct.GCRef, %struct.MRef, [1 x %struct.GCRef] }
%struct.GG_State = type { %struct.lua_State, %struct.global_State, %struct.jit_State, [64 x i16], [243 x ptr], [57 x 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.4, %struct.MRef, i32 }
%union.anon.4 = 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.7 }
%struct.anon.7 = 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 }
%struct.GCproto = type { %struct.GCRef, i8, i8, i8, i8, i32, %struct.GCRef, %struct.MRef, %struct.MRef, i32, i32, i32, i8, i8, i16, %struct.GCRef, i32, i32, %struct.MRef, %struct.MRef, %struct.MRef }

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

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

; Function Attrs: nounwind uwtable
define hidden void @lj_dispatch_ins(ptr noundef %0, ptr noundef %1) #1 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca ptr, align 8
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #5
  %16 = call ptr @__errno_location() #6
  %17 = load i32, ptr %16, align 4, !tbaa !9
  store i32 %17, ptr %5, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #5
  %18 = load ptr, ptr %3, align 8, !tbaa !5
  %19 = getelementptr inbounds %struct.lua_State, ptr %18, i32 0, i32 0
  %20 = getelementptr inbounds %struct.anon, ptr %19, i32 0, i32 7
  %21 = load ptr, ptr %20, align 8, !tbaa !11
  %22 = getelementptr inbounds %union.TValue, ptr %21, i64 -1
  %23 = getelementptr inbounds %struct.anon.2, ptr %22, i32 0, i32 0
  %24 = getelementptr inbounds %struct.GCRef, ptr %23, i32 0, i32 0
  %25 = load i32, ptr %24, align 8, !tbaa !11
  %26 = zext i32 %25 to i64
  %27 = inttoptr i64 %26 to ptr
  store ptr %27, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #5
  %28 = load ptr, ptr %6, align 8, !tbaa !5
  %29 = getelementptr inbounds %struct.GCfuncL, ptr %28, i32 0, i32 7
  %30 = getelementptr inbounds %struct.MRef, ptr %29, i32 0, i32 0
  %31 = load i32, ptr %30, align 8, !tbaa !11
  %32 = zext i32 %31 to i64
  %33 = inttoptr i64 %32 to ptr
  %34 = getelementptr inbounds i8, ptr %33, i64 -64
  store ptr %34, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #5
  %35 = load ptr, ptr %3, align 8, !tbaa !5
  %36 = getelementptr inbounds %struct.lua_State, ptr %35, i32 0, i32 0
  %37 = getelementptr inbounds %struct.anon, ptr %36, i32 0, i32 13
  %38 = load ptr, ptr %37, align 8, !tbaa !11
  %39 = ptrtoint ptr %38 to i64
  %40 = and i64 %39, -4
  %41 = inttoptr i64 %40 to ptr
  store ptr %41, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #5
  %42 = load ptr, ptr %8, align 8, !tbaa !5
  %43 = getelementptr inbounds i8, ptr %42, i64 28
  %44 = getelementptr inbounds %struct.MRef, ptr %43, i32 0, i32 0
  %45 = load i32, ptr %44, align 4, !tbaa !12
  %46 = zext i32 %45 to i64
  %47 = inttoptr i64 %46 to ptr
  store ptr %47, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #5
  %48 = load ptr, ptr %3, align 8, !tbaa !5
  %49 = getelementptr inbounds %struct.lua_State, ptr %48, i32 0, i32 0
  %50 = getelementptr inbounds %struct.anon, 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 !11
  %53 = zext i32 %52 to i64
  %54 = inttoptr i64 %53 to ptr
  store ptr %54, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  %55 = load ptr, ptr %4, align 8, !tbaa !5
  %56 = ptrtoint ptr %55 to i64
  %57 = trunc i64 %56 to i32
  %58 = load ptr, ptr %8, align 8, !tbaa !5
  %59 = getelementptr inbounds i8, ptr %58, i64 28
  %60 = getelementptr inbounds %struct.MRef, ptr %59, i32 0, i32 0
  store i32 %57, ptr %60, align 4, !tbaa !12
  %61 = load ptr, ptr %7, align 8, !tbaa !5
  %62 = load ptr, ptr %4, align 8, !tbaa !5
  %63 = load ptr, ptr %8, align 8, !tbaa !5
  %64 = getelementptr inbounds i8, ptr %63, i64 4
  %65 = load i32, ptr %64, align 4, !tbaa !9
  %66 = lshr i32 %65, 0
  %67 = call i32 @cur_topslot(ptr noundef %61, ptr noundef %62, i32 noundef %66)
  store i32 %67, ptr %11, align 4, !tbaa !9
  %68 = load ptr, ptr %3, align 8, !tbaa !5
  %69 = getelementptr inbounds %struct.lua_State, ptr %68, i32 0, i32 0
  %70 = getelementptr inbounds %struct.anon, ptr %69, i32 0, i32 7
  %71 = load ptr, ptr %70, align 8, !tbaa !11
  %72 = load i32, ptr %11, align 4, !tbaa !9
  %73 = zext i32 %72 to i64
  %74 = getelementptr inbounds %union.TValue, ptr %71, i64 %73
  %75 = load ptr, ptr %3, align 8, !tbaa !5
  %76 = getelementptr inbounds %struct.lua_State, ptr %75, i32 0, i32 0
  %77 = getelementptr inbounds %struct.anon, ptr %76, i32 0, i32 8
  store ptr %74, ptr %77, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  %78 = load ptr, ptr %10, align 8, !tbaa !5
  %79 = getelementptr inbounds i8, ptr %78, i64 -384
  %80 = getelementptr inbounds %struct.GG_State, ptr %79, i32 0, i32 2
  store ptr %80, ptr %12, align 8, !tbaa !5
  %81 = load ptr, ptr %12, align 8, !tbaa !5
  %82 = getelementptr inbounds %struct.jit_State, ptr %81, i32 0, i32 16
  %83 = load i32, ptr %82, align 4, !tbaa !14
  %84 = icmp ne i32 %83, 0
  br i1 %84, label %85, label %92

85:                                               ; preds = %2
  %86 = load ptr, ptr %3, align 8, !tbaa !5
  %87 = load ptr, ptr %12, align 8, !tbaa !5
  %88 = getelementptr inbounds %struct.jit_State, ptr %87, i32 0, i32 1
  store ptr %86, ptr %88, align 8, !tbaa !23
  %89 = load ptr, ptr %12, align 8, !tbaa !5
  %90 = load ptr, ptr %4, align 8, !tbaa !5
  %91 = getelementptr inbounds i32, ptr %90, i64 -1
  call void @lj_trace_ins(ptr noundef %89, ptr noundef %91)
  br label %92

92:                                               ; preds = %85, %2
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  %93 = load ptr, ptr %10, align 8, !tbaa !5
  %94 = getelementptr inbounds %struct.global_State, ptr %93, i32 0, i32 10
  %95 = load i8, ptr %94, align 1, !tbaa !24
  %96 = zext i8 %95 to i32
  %97 = and i32 %96, 8
  %98 = icmp ne i32 %97, 0
  br i1 %98, label %99, label %121

99:                                               ; preds = %92
  %100 = load ptr, ptr %10, align 8, !tbaa !5
  %101 = getelementptr inbounds %struct.global_State, ptr %100, i32 0, i32 19
  %102 = load i32, ptr %101, align 8, !tbaa !31
  %103 = icmp eq i32 %102, 0
  br i1 %103, label %104, label %121

104:                                              ; preds = %99
  %105 = load ptr, ptr %10, align 8, !tbaa !5
  %106 = getelementptr inbounds %struct.global_State, ptr %105, i32 0, i32 20
  %107 = load i32, ptr %106, align 4, !tbaa !32
  %108 = load ptr, ptr %10, align 8, !tbaa !5
  %109 = getelementptr inbounds %struct.global_State, ptr %108, i32 0, i32 19
  store i32 %107, ptr %109, align 8, !tbaa !31
  %110 = load ptr, ptr %3, align 8, !tbaa !5
  call void @callhook(ptr noundef %110, i32 noundef 3, i32 noundef -1)
  %111 = load ptr, ptr %3, align 8, !tbaa !5
  %112 = getelementptr inbounds %struct.lua_State, ptr %111, i32 0, i32 0
  %113 = getelementptr inbounds %struct.anon, ptr %112, i32 0, i32 7
  %114 = load ptr, ptr %113, align 8, !tbaa !11
  %115 = load i32, ptr %11, align 4, !tbaa !9
  %116 = zext i32 %115 to i64
  %117 = getelementptr inbounds %union.TValue, ptr %114, i64 %116
  %118 = load ptr, ptr %3, align 8, !tbaa !5
  %119 = getelementptr inbounds %struct.lua_State, ptr %118, i32 0, i32 0
  %120 = getelementptr inbounds %struct.anon, ptr %119, i32 0, i32 8
  store ptr %117, ptr %120, align 8, !tbaa !11
  br label %121

121:                                              ; preds = %104, %99, %92
  %122 = load ptr, ptr %10, align 8, !tbaa !5
  %123 = getelementptr inbounds %struct.global_State, ptr %122, i32 0, i32 10
  %124 = load i8, ptr %123, align 1, !tbaa !24
  %125 = zext i8 %124 to i32
  %126 = and i32 %125, 4
  %127 = icmp ne i32 %126, 0
  br i1 %127, label %128, label %179

128:                                              ; preds = %121
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  %129 = load ptr, ptr %4, align 8, !tbaa !5
  %130 = load ptr, ptr %7, align 8, !tbaa !5
  %131 = getelementptr inbounds i8, ptr %130, i64 64
  %132 = ptrtoint ptr %129 to i64
  %133 = ptrtoint ptr %131 to i64
  %134 = sub i64 %132, %133
  %135 = sdiv exact i64 %134, 4
  %136 = trunc i64 %135 to i32
  %137 = sub i32 %136, 1
  store i32 %137, ptr %13, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #5
  %138 = load ptr, ptr %9, align 8, !tbaa !5
  %139 = load ptr, ptr %7, align 8, !tbaa !5
  %140 = getelementptr inbounds i8, ptr %139, i64 64
  %141 = ptrtoint ptr %138 to i64
  %142 = ptrtoint ptr %140 to i64
  %143 = sub i64 %141, %142
  %144 = sdiv exact i64 %143, 4
  %145 = trunc i64 %144 to i32
  %146 = sub i32 %145, 1
  store i32 %146, ptr %14, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #5
  %147 = load ptr, ptr %7, align 8, !tbaa !5
  %148 = load i32, ptr %13, align 4, !tbaa !9
  %149 = call i32 @lj_debug_line(ptr noundef %147, i32 noundef %148)
  store i32 %149, ptr %15, align 4, !tbaa !9
  %150 = load ptr, ptr %4, align 8, !tbaa !5
  %151 = load ptr, ptr %9, align 8, !tbaa !5
  %152 = icmp ule ptr %150, %151
  br i1 %152, label %165, label %153

153:                                              ; preds = %128
  %154 = load i32, ptr %14, align 4, !tbaa !9
  %155 = load ptr, ptr %7, align 8, !tbaa !5
  %156 = getelementptr inbounds %struct.GCproto, ptr %155, i32 0, i32 5
  %157 = load i32, ptr %156, align 4, !tbaa !33
  %158 = icmp uge i32 %154, %157
  br i1 %158, label %165, label %159

159:                                              ; preds = %153
  %160 = load i32, ptr %15, align 4, !tbaa !9
  %161 = load ptr, ptr %7, align 8, !tbaa !5
  %162 = load i32, ptr %14, align 4, !tbaa !9
  %163 = call i32 @lj_debug_line(ptr noundef %161, i32 noundef %162)
  %164 = icmp ne i32 %160, %163
  br i1 %164, label %165, label %178

165:                                              ; preds = %159, %153, %128
  %166 = load ptr, ptr %3, align 8, !tbaa !5
  %167 = load i32, ptr %15, align 4, !tbaa !9
  call void @callhook(ptr noundef %166, i32 noundef 2, i32 noundef %167)
  %168 = load ptr, ptr %3, align 8, !tbaa !5
  %169 = getelementptr inbounds %struct.lua_State, ptr %168, i32 0, i32 0
  %170 = getelementptr inbounds %struct.anon, ptr %169, i32 0, i32 7
  %171 = load ptr, ptr %170, align 8, !tbaa !11
  %172 = load i32, ptr %11, align 4, !tbaa !9
  %173 = zext i32 %172 to i64
  %174 = getelementptr inbounds %union.TValue, ptr %171, i64 %173
  %175 = load ptr, ptr %3, align 8, !tbaa !5
  %176 = getelementptr inbounds %struct.lua_State, ptr %175, i32 0, i32 0
  %177 = getelementptr inbounds %struct.anon, ptr %176, i32 0, i32 8
  store ptr %174, ptr %177, align 8, !tbaa !11
  br label %178

178:                                              ; preds = %165, %159
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  br label %179

179:                                              ; preds = %178, %121
  %180 = load ptr, ptr %10, align 8, !tbaa !5
  %181 = getelementptr inbounds %struct.global_State, ptr %180, i32 0, i32 10
  %182 = load i8, ptr %181, align 1, !tbaa !24
  %183 = zext i8 %182 to i32
  %184 = and i32 %183, 2
  %185 = icmp ne i32 %184, 0
  br i1 %185, label %186, label %195

186:                                              ; preds = %179
  %187 = load ptr, ptr %4, align 8, !tbaa !5
  %188 = getelementptr inbounds i32, ptr %187, i64 -1
  %189 = load i32, ptr %188, align 4, !tbaa !9
  %190 = and i32 %189, 255
  %191 = call i32 @bc_isret(i32 noundef %190)
  %192 = icmp ne i32 %191, 0
  br i1 %192, label %193, label %195

193:                                              ; preds = %186
  %194 = load ptr, ptr %3, align 8, !tbaa !5
  call void @callhook(ptr noundef %194, i32 noundef 1, i32 noundef -1)
  br label %195

195:                                              ; preds = %193, %186, %179
  %196 = load i32, ptr %5, align 4, !tbaa !9
  %197 = call ptr @__errno_location() #6
  store i32 %196, ptr %197, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 8, 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 8, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  ret void
}

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

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

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

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

declare hidden i32 @lj_debug_line(ptr noundef, i32 noundef) #3

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { 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 #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 = { 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 #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 = !{!7, !7, i64 0}
!12 = !{!13, !10, i64 0}
!13 = !{!"MRef", !10, i64 0}
!14 = !{!15, !10, i64 188}
!15 = !{!"jit_State", !16, 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, !19, i64 150, !7, i64 151, !20, 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, !13, 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, !21, 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, !22, i64 2472, !22, i64 2480, !7, i64 2488, !6, i64 2496, !10, i64 2504, !10, i64 2508}
!16 = !{!"GCtrace", !17, i64 0, !7, i64 4, !7, i64 5, !7, i64 6, !7, i64 7, !10, i64 8, !17, i64 12, !6, i64 16, !10, i64 24, !18, i64 28, !18, i64 30, !6, i64 32, !6, i64 40, !17, i64 48, !13, i64 52, !10, i64 56, !10, i64 60, !6, i64 64, !10, i64 72, !18, i64 76, !18, i64 78, !18, i64 80, !18, i64 82, !18, i64 84, !18, i64 86, !18, i64 88, !7, i64 90, !7, i64 91}
!17 = !{!"GCRef", !10, i64 0}
!18 = !{!"short", !7, i64 0}
!19 = !{!"IRType1", !7, i64 0}
!20 = !{!"FoldState", !7, i64 0, !7, i64 8, !7, i64 16}
!21 = !{!"ScEvEntry", !13, i64 0, !18, i64 4, !18, i64 6, !18, i64 8, !18, i64 10, !19, i64 12, !7, i64 13}
!22 = !{!"long", !7, i64 0}
!23 = !{!15, !6, i64 96}
!24 = !{!25, !7, i64 125}
!25 = !{!"global_State", !6, i64 0, !10, i64 8, !10, i64 12, !6, i64 16, !6, i64 24, !26, i64 32, !10, i64 88, !27, i64 92, !28, i64 108, !7, i64 124, !7, i64 125, !7, i64 126, !7, i64 127, !17, i64 128, !7, i64 136, !7, i64 144, !7, i64 152, !29, i64 160, !30, i64 184, !10, i64 208, !10, i64 212, !6, i64 216, !6, i64 224, !6, i64 232, !10, i64 240, !10, i64 244, !17, i64 248, !13, i64 252, !13, i64 256, !7, i64 260}
!26 = !{!"GCState", !10, i64 0, !10, i64 4, !7, i64 8, !7, i64 9, !7, i64 10, !7, i64 11, !10, i64 12, !17, i64 16, !13, i64 20, !17, i64 24, !17, i64 28, !17, i64 32, !17, i64 36, !10, i64 40, !10, i64 44, !10, i64 48, !10, i64 52}
!27 = !{!"SBuf", !13, i64 0, !13, i64 4, !13, i64 8, !13, i64 12}
!28 = !{!"GCstr", !17, i64 0, !7, i64 4, !7, i64 5, !7, i64 6, !7, i64 7, !10, i64 8, !10, i64 12}
!29 = !{!"Node", !7, i64 0, !7, i64 8, !13, i64 16, !13, i64 20}
!30 = !{!"GCupval", !17, i64 0, !7, i64 4, !7, i64 5, !7, i64 6, !7, i64 7, !7, i64 8, !13, i64 16, !10, i64 20}
!31 = !{!25, !10, i64 208}
!32 = !{!25, !10, i64 212}
!33 = !{!34, !10, i64 8}
!34 = !{!"GCproto", !17, i64 0, !7, i64 4, !7, i64 5, !7, i64 6, !7, i64 7, !10, i64 8, !17, i64 12, !13, i64 16, !13, i64 20, !10, i64 24, !10, i64 28, !10, i64 32, !7, i64 36, !7, i64 37, !18, i64 38, !17, i64 40, !10, i64 44, !10, i64 48, !13, i64 52, !13, i64 56, !13, i64 60}


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

%union.TValue = type { i64 }

; Function Attrs: nounwind uwtable
define hidden void @lj_dispatch_ins(ptr noundef %0, ptr noundef %1) local_unnamed_addr #0 {
  %3 = tail call ptr @__errno_location() #4
  %4 = load i32, ptr %3, align 4, !tbaa !5
  %5 = getelementptr inbounds i8, ptr %0, i64 16
  %6 = load ptr, ptr %5, align 8, !tbaa !9
  %7 = getelementptr inbounds i8, ptr %6, i64 -8
  %8 = load i32, ptr %7, align 8, !tbaa !9
  %9 = zext i32 %8 to i64
  %10 = inttoptr i64 %9 to ptr
  %11 = getelementptr inbounds i8, ptr %10, i64 16
  %12 = load i32, ptr %11, align 8, !tbaa !9
  %13 = zext i32 %12 to i64
  %14 = inttoptr i64 %13 to ptr
  %15 = getelementptr inbounds i8, ptr %14, i64 -64
  %16 = getelementptr inbounds i8, ptr %0, i64 48
  %17 = load ptr, ptr %16, align 8, !tbaa !9
  %18 = ptrtoint ptr %17 to i64
  %19 = and i64 %18, -4
  %20 = inttoptr i64 %19 to ptr
  %21 = getelementptr inbounds i8, ptr %20, i64 28
  %22 = load i32, ptr %21, align 4, !tbaa !10
  %23 = zext i32 %22 to i64
  %24 = inttoptr i64 %23 to ptr
  %25 = getelementptr inbounds i8, ptr %0, i64 8
  %26 = load i32, ptr %25, align 8, !tbaa !9
  %27 = zext i32 %26 to i64
  %28 = inttoptr i64 %27 to ptr
  %29 = ptrtoint ptr %1 to i64
  %30 = trunc i64 %29 to i32
  store i32 %30, ptr %21, align 4, !tbaa !10
  %31 = getelementptr inbounds i8, ptr %20, i64 4
  %32 = load i32, ptr %31, align 4, !tbaa !5
  %33 = tail call i32 @cur_topslot(ptr noundef nonnull %15, ptr noundef %1, i32 noundef %32)
  %34 = load ptr, ptr %5, align 8, !tbaa !9
  %35 = zext i32 %33 to i64
  %36 = getelementptr inbounds %union.TValue, ptr %34, i64 %35
  %37 = getelementptr inbounds i8, ptr %0, i64 24
  store ptr %36, ptr %37, align 8, !tbaa !9
  %38 = getelementptr inbounds i8, ptr %28, i64 604
  %39 = load i32, ptr %38, align 4, !tbaa !12
  %.not = icmp eq i32 %39, 0
  br i1 %.not, label %44, label %40

40:                                               ; preds = %2
  %41 = getelementptr inbounds i8, ptr %28, i64 416
  %42 = getelementptr inbounds i8, ptr %28, i64 512
  store ptr %0, ptr %42, align 8, !tbaa !22
  %43 = getelementptr inbounds i8, ptr %1, i64 -4
  tail call void @lj_trace_ins(ptr noundef nonnull %41, ptr noundef nonnull %43) #5
  br label %44

44:                                               ; preds = %40, %2
  %45 = getelementptr inbounds i8, ptr %28, i64 125
  %46 = load i8, ptr %45, align 1, !tbaa !23
  %47 = and i8 %46, 8
  %.not49 = icmp eq i8 %47, 0
  br i1 %.not49, label %57, label %48

48:                                               ; preds = %44
  %49 = getelementptr inbounds i8, ptr %28, i64 208
  %50 = load i32, ptr %49, align 8, !tbaa !30
  %51 = icmp eq i32 %50, 0
  br i1 %51, label %52, label %57

52:                                               ; preds = %48
  %53 = getelementptr inbounds i8, ptr %28, i64 212
  %54 = load i32, ptr %53, align 4, !tbaa !31
  store i32 %54, ptr %49, align 8, !tbaa !30
  tail call void @callhook(ptr noundef nonnull %0, i32 noundef 3, i32 noundef -1)
  %55 = load ptr, ptr %5, align 8, !tbaa !9
  %56 = getelementptr inbounds %union.TValue, ptr %55, i64 %35
  store ptr %56, ptr %37, align 8, !tbaa !9
  %.pre = load i8, ptr %45, align 1, !tbaa !23
  br label %57

57:                                               ; preds = %52, %48, %44
  %58 = phi i8 [ %.pre, %52 ], [ %46, %48 ], [ %46, %44 ]
  %59 = and i8 %58, 4
  %.not50 = icmp eq i8 %59, 0
  br i1 %.not50, label %78, label %60

60:                                               ; preds = %57
  %61 = sub i64 %29, %13
  %62 = lshr exact i64 %61, 2
  %63 = trunc i64 %62 to i32
  %64 = add i32 %63, -1
  %65 = sub nsw i64 %23, %13
  %66 = lshr exact i64 %65, 2
  %67 = trunc i64 %66 to i32
  %68 = add i32 %67, -1
  %69 = tail call i32 @lj_debug_line(ptr noundef nonnull %15, i32 noundef %64) #5
  %.not51 = icmp ult ptr %24, %1
  br i1 %.not51, label %70, label %75

70:                                               ; preds = %60
  %71 = getelementptr inbounds i8, ptr %14, i64 -56
  %72 = load i32, ptr %71, align 4, !tbaa !32
  %.not52 = icmp ult i32 %68, %72
  br i1 %.not52, label %73, label %75

73:                                               ; preds = %70
  %74 = tail call i32 @lj_debug_line(ptr noundef nonnull %15, i32 noundef %68) #5
  %.not53 = icmp eq i32 %69, %74
  br i1 %.not53, label %78, label %75

75:                                               ; preds = %73, %70, %60
  tail call void @callhook(ptr noundef nonnull %0, i32 noundef 2, i32 noundef %69)
  %76 = load ptr, ptr %5, align 8, !tbaa !9
  %77 = getelementptr inbounds %union.TValue, ptr %76, i64 %35
  store ptr %77, ptr %37, align 8, !tbaa !9
  br label %78

78:                                               ; preds = %73, %75, %57
  %79 = load i8, ptr %45, align 1, !tbaa !23
  %80 = and i8 %79, 2
  %.not54 = icmp eq i8 %80, 0
  br i1 %.not54, label %87, label %81

81:                                               ; preds = %78
  %82 = getelementptr inbounds i8, ptr %1, i64 -4
  %83 = load i32, ptr %82, align 4, !tbaa !5
  %84 = and i32 %83, 255
  %85 = tail call i32 @bc_isret(i32 noundef %84)
  %.not55 = icmp eq i32 %85, 0
  br i1 %.not55, label %87, label %86

86:                                               ; preds = %81
  tail call void @callhook(ptr noundef nonnull %0, i32 noundef 1, i32 noundef -1)
  br label %87

87:                                               ; preds = %86, %81, %78
  store i32 %4, ptr %3, align 4, !tbaa !5
  ret void
}

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

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

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

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

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

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

attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { 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 #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 = { 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 #4 = { nounwind willreturn memory(none) }
attributes #5 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!7, !7, i64 0}
!10 = !{!11, !6, i64 0}
!11 = !{!"MRef", !6, i64 0}
!12 = !{!13, !6, i64 188}
!13 = !{!"jit_State", !14, i64 0, !16, i64 96, !16, i64 104, !16, i64 112, !16, i64 120, !16, i64 128, !6, i64 136, !6, i64 140, !6, i64 144, !7, i64 148, !7, i64 149, !18, i64 150, !7, i64 151, !19, i64 152, !16, i64 176, !6, i64 184, !6, i64 188, !6, i64 192, !6, i64 196, !6, i64 200, !6, i64 204, !6, i64 208, !11, i64 212, !7, i64 216, !16, i64 256, !6, i64 264, !6, i64 268, !6, i64 272, !6, i64 276, !16, i64 280, !16, i64 288, !6, i64 296, !6, i64 300, !7, i64 304, !16, i64 312, !6, i64 320, !6, i64 324, !16, 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, !20, i64 2396, !16, i64 2416, !6, i64 2424, !6, i64 2428, !16, i64 2432, !6, i64 2440, !6, i64 2444, !16, i64 2448, !16, i64 2456, !16, i64 2464, !21, i64 2472, !21, i64 2480, !7, i64 2488, !16, i64 2496, !6, i64 2504, !6, i64 2508}
!14 = !{!"GCtrace", !15, i64 0, !7, i64 4, !7, i64 5, !7, i64 6, !7, i64 7, !6, i64 8, !15, i64 12, !16, i64 16, !6, i64 24, !17, i64 28, !17, i64 30, !16, i64 32, !16, i64 40, !15, i64 48, !11, i64 52, !6, i64 56, !6, i64 60, !16, i64 64, !6, 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}
!15 = !{!"GCRef", !6, i64 0}
!16 = !{!"any pointer", !7, i64 0}
!17 = !{!"short", !7, i64 0}
!18 = !{!"IRType1", !7, i64 0}
!19 = !{!"FoldState", !7, i64 0, !7, i64 8, !7, i64 16}
!20 = !{!"ScEvEntry", !11, i64 0, !17, i64 4, !17, i64 6, !17, i64 8, !17, i64 10, !18, i64 12, !7, i64 13}
!21 = !{!"long", !7, i64 0}
!22 = !{!13, !16, i64 96}
!23 = !{!24, !7, i64 125}
!24 = !{!"global_State", !16, i64 0, !6, i64 8, !6, i64 12, !16, i64 16, !16, i64 24, !25, i64 32, !6, i64 88, !26, i64 92, !27, i64 108, !7, i64 124, !7, i64 125, !7, i64 126, !7, i64 127, !15, i64 128, !7, i64 136, !7, i64 144, !7, i64 152, !28, i64 160, !29, i64 184, !6, i64 208, !6, i64 212, !16, i64 216, !16, i64 224, !16, i64 232, !6, i64 240, !6, i64 244, !15, i64 248, !11, i64 252, !11, i64 256, !7, i64 260}
!25 = !{!"GCState", !6, i64 0, !6, i64 4, !7, i64 8, !7, i64 9, !7, i64 10, !7, i64 11, !6, i64 12, !15, i64 16, !11, i64 20, !15, i64 24, !15, i64 28, !15, i64 32, !15, i64 36, !6, i64 40, !6, i64 44, !6, i64 48, !6, i64 52}
!26 = !{!"SBuf", !11, i64 0, !11, i64 4, !11, i64 8, !11, i64 12}
!27 = !{!"GCstr", !15, i64 0, !7, i64 4, !7, i64 5, !7, i64 6, !7, i64 7, !6, i64 8, !6, i64 12}
!28 = !{!"Node", !7, i64 0, !7, i64 8, !11, i64 16, !11, i64 20}
!29 = !{!"GCupval", !15, i64 0, !7, i64 4, !7, i64 5, !7, i64 6, !7, i64 7, !7, i64 8, !11, i64 16, !6, i64 20}
!30 = !{!24, !6, i64 208}
!31 = !{!24, !6, i64 212}
!32 = !{!33, !6, i64 8}
!33 = !{!"GCproto", !15, i64 0, !7, i64 4, !7, i64 5, !7, i64 6, !7, i64 7, !6, i64 8, !15, i64 12, !11, i64 16, !11, i64 20, !6, i64 24, !6, i64 28, !6, i64 32, !7, i64 36, !7, i64 37, !17, i64 38, !15, i64 40, !6, i64 44, !6, i64 48, !11, i64 52, !11, i64 56, !11, i64 60}


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