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

; 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.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 }
%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 }
%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 }
%union.TValue = type { i64 }
%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.anon.5 = type { %struct.GCRef, %struct.GCRef }
%struct.anon.0 = type { %union.anon.1, i32 }
%union.anon.1 = type { %struct.GCRef }

; 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 ptr @lj_state_newstate(ptr noundef %0, ptr noundef %1) #1 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #5
  %10 = load ptr, ptr %4, align 8, !tbaa !5
  %11 = load ptr, ptr %5, align 8, !tbaa !5
  %12 = call ptr %10(ptr noundef %11, ptr noundef null, i64 noundef 0, i64 noundef 5616)
  store ptr %12, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #5
  %13 = load ptr, ptr %6, align 8, !tbaa !5
  %14 = getelementptr inbounds %struct.GG_State, ptr %13, i32 0, i32 0
  store ptr %14, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #5
  %15 = load ptr, ptr %6, align 8, !tbaa !5
  %16 = getelementptr inbounds %struct.GG_State, ptr %15, i32 0, i32 1
  store ptr %16, ptr %8, align 8, !tbaa !5
  %17 = load ptr, ptr %6, align 8, !tbaa !5
  %18 = icmp eq ptr %17, null
  br i1 %18, label %19, label %20

19:                                               ; preds = %2
  store ptr null, ptr %3, align 8
  store i32 1, ptr %9, align 4
  br label %148

20:                                               ; preds = %2
  %21 = load ptr, ptr %6, align 8, !tbaa !5
  call void @llvm.memset.p0.i64(ptr align 8 %21, i8 0, i64 5616, i1 false)
  %22 = load ptr, ptr %7, align 8, !tbaa !5
  %23 = getelementptr inbounds %struct.lua_State, ptr %22, i32 0, i32 0
  %24 = getelementptr inbounds %struct.anon, ptr %23, i32 0, i32 2
  store i8 6, ptr %24, align 1, !tbaa !9
  %25 = load ptr, ptr %7, align 8, !tbaa !5
  %26 = getelementptr inbounds %struct.lua_State, ptr %25, i32 0, i32 0
  %27 = getelementptr inbounds %struct.anon, ptr %26, i32 0, i32 1
  store i8 97, ptr %27, align 4, !tbaa !9
  %28 = load ptr, ptr %7, align 8, !tbaa !5
  %29 = getelementptr inbounds %struct.lua_State, ptr %28, i32 0, i32 0
  %30 = getelementptr inbounds %struct.anon, ptr %29, i32 0, i32 3
  store i8 1, ptr %30, align 2, !tbaa !9
  %31 = load ptr, ptr %8, align 8, !tbaa !5
  %32 = ptrtoint ptr %31 to i64
  %33 = trunc i64 %32 to i32
  %34 = load ptr, ptr %7, align 8, !tbaa !5
  %35 = getelementptr inbounds %struct.lua_State, ptr %34, i32 0, i32 0
  %36 = getelementptr inbounds %struct.anon, ptr %35, i32 0, i32 5
  %37 = getelementptr inbounds %struct.MRef, ptr %36, i32 0, i32 0
  store i32 %33, ptr %37, align 8, !tbaa !9
  %38 = load ptr, ptr %8, align 8, !tbaa !5
  %39 = getelementptr inbounds %struct.global_State, ptr %38, i32 0, i32 5
  %40 = getelementptr inbounds %struct.GCState, ptr %39, i32 0, i32 2
  store i8 33, ptr %40, align 8, !tbaa !10
  %41 = load ptr, ptr %8, align 8, !tbaa !5
  %42 = getelementptr inbounds %struct.global_State, ptr %41, i32 0, i32 8
  %43 = getelementptr inbounds %struct.GCstr, ptr %42, i32 0, i32 1
  store i8 1, ptr %43, align 4, !tbaa !20
  %44 = load ptr, ptr %8, align 8, !tbaa !5
  %45 = getelementptr inbounds %struct.global_State, ptr %44, i32 0, i32 8
  %46 = getelementptr inbounds %struct.GCstr, ptr %45, i32 0, i32 2
  store i8 4, ptr %46, align 1, !tbaa !21
  %47 = load ptr, ptr %4, align 8, !tbaa !5
  %48 = load ptr, ptr %8, align 8, !tbaa !5
  %49 = getelementptr inbounds %struct.global_State, ptr %48, i32 0, i32 3
  store ptr %47, ptr %49, align 8, !tbaa !22
  %50 = load ptr, ptr %5, align 8, !tbaa !5
  %51 = load ptr, ptr %8, align 8, !tbaa !5
  %52 = getelementptr inbounds %struct.global_State, ptr %51, i32 0, i32 4
  store ptr %50, ptr %52, align 8, !tbaa !23
  %53 = load ptr, ptr %7, align 8, !tbaa !5
  %54 = ptrtoint ptr %53 to i64
  %55 = trunc i64 %54 to i32
  %56 = load ptr, ptr %8, align 8, !tbaa !5
  %57 = getelementptr inbounds %struct.global_State, ptr %56, i32 0, i32 13
  %58 = getelementptr inbounds %struct.GCRef, ptr %57, i32 0, i32 0
  store i32 %55, ptr %58, align 8, !tbaa !24
  %59 = load ptr, ptr %8, align 8, !tbaa !5
  %60 = getelementptr inbounds %struct.global_State, ptr %59, i32 0, i32 18
  %61 = ptrtoint ptr %60 to i64
  %62 = trunc i64 %61 to i32
  %63 = load ptr, ptr %8, align 8, !tbaa !5
  %64 = getelementptr inbounds %struct.global_State, ptr %63, i32 0, i32 18
  %65 = getelementptr inbounds %struct.GCupval, ptr %64, i32 0, i32 5
  %66 = getelementptr inbounds %struct.anon.5, ptr %65, i32 0, i32 0
  %67 = getelementptr inbounds %struct.GCRef, ptr %66, i32 0, i32 0
  store i32 %62, ptr %67, align 8, !tbaa !9
  %68 = load ptr, ptr %8, align 8, !tbaa !5
  %69 = getelementptr inbounds %struct.global_State, ptr %68, i32 0, i32 18
  %70 = ptrtoint ptr %69 to i64
  %71 = trunc i64 %70 to i32
  %72 = load ptr, ptr %8, align 8, !tbaa !5
  %73 = getelementptr inbounds %struct.global_State, ptr %72, i32 0, i32 18
  %74 = getelementptr inbounds %struct.GCupval, ptr %73, i32 0, i32 5
  %75 = getelementptr inbounds %struct.anon.5, ptr %74, i32 0, i32 1
  %76 = getelementptr inbounds %struct.GCRef, ptr %75, i32 0, i32 0
  store i32 %71, ptr %76, align 4, !tbaa !9
  %77 = load ptr, ptr %8, align 8, !tbaa !5
  %78 = getelementptr inbounds %struct.global_State, ptr %77, i32 0, i32 1
  store i32 -1, ptr %78, align 8, !tbaa !25
  %79 = load ptr, ptr %7, align 8, !tbaa !5
  %80 = getelementptr inbounds %struct.lua_State, ptr %79, i32 0, i32 0
  %81 = getelementptr inbounds %struct.anon, ptr %80, i32 0, i32 5
  %82 = getelementptr inbounds %struct.MRef, ptr %81, i32 0, i32 0
  %83 = load i32, ptr %82, align 8, !tbaa !9
  %84 = zext i32 %83 to i64
  %85 = inttoptr i64 %84 to ptr
  %86 = getelementptr inbounds %struct.global_State, ptr %85, i32 0, i32 14
  %87 = getelementptr inbounds %struct.anon.0, ptr %86, i32 0, i32 1
  store i32 -1, ptr %87, align 4, !tbaa !9
  %88 = load ptr, ptr %8, align 8, !tbaa !5
  %89 = getelementptr inbounds %struct.global_State, ptr %88, i32 0, i32 17
  %90 = getelementptr inbounds %struct.Node, ptr %89, i32 0, i32 0
  %91 = getelementptr inbounds %struct.anon.0, ptr %90, i32 0, i32 1
  store i32 -1, ptr %91, align 4, !tbaa !9
  %92 = load ptr, ptr %8, align 8, !tbaa !5
  %93 = getelementptr inbounds %struct.global_State, ptr %92, i32 0, i32 17
  %94 = getelementptr inbounds %struct.Node, ptr %93, i32 0, i32 1
  %95 = getelementptr inbounds %struct.anon.0, ptr %94, i32 0, i32 1
  store i32 -1, ptr %95, align 4, !tbaa !9
  %96 = load ptr, ptr %8, align 8, !tbaa !5
  %97 = getelementptr inbounds %struct.global_State, ptr %96, i32 0, i32 17
  %98 = ptrtoint ptr %97 to i64
  %99 = trunc i64 %98 to i32
  %100 = load ptr, ptr %8, align 8, !tbaa !5
  %101 = getelementptr inbounds %struct.global_State, ptr %100, i32 0, i32 17
  %102 = getelementptr inbounds %struct.Node, ptr %101, i32 0, i32 3
  %103 = getelementptr inbounds %struct.MRef, ptr %102, i32 0, i32 0
  store i32 %99, ptr %103, align 4, !tbaa !26
  %104 = load ptr, ptr %8, align 8, !tbaa !5
  %105 = getelementptr inbounds %struct.global_State, ptr %104, i32 0, i32 7
  call void @lj_buf_init(ptr noundef null, ptr noundef %105)
  %106 = load ptr, ptr %8, align 8, !tbaa !5
  %107 = getelementptr inbounds %struct.global_State, ptr %106, i32 0, i32 5
  %108 = getelementptr inbounds %struct.GCState, ptr %107, i32 0, i32 3
  store i8 0, ptr %108, align 1, !tbaa !27
  %109 = load ptr, ptr %7, align 8, !tbaa !5
  %110 = ptrtoint ptr %109 to i64
  %111 = trunc i64 %110 to i32
  %112 = load ptr, ptr %8, align 8, !tbaa !5
  %113 = getelementptr inbounds %struct.global_State, ptr %112, i32 0, i32 5
  %114 = getelementptr inbounds %struct.GCState, ptr %113, i32 0, i32 7
  %115 = getelementptr inbounds %struct.GCRef, ptr %114, i32 0, i32 0
  store i32 %111, ptr %115, align 8, !tbaa !28
  %116 = load ptr, ptr %8, align 8, !tbaa !5
  %117 = getelementptr inbounds %struct.global_State, ptr %116, i32 0, i32 5
  %118 = getelementptr inbounds %struct.GCState, ptr %117, i32 0, i32 7
  %119 = ptrtoint ptr %118 to i64
  %120 = trunc i64 %119 to i32
  %121 = load ptr, ptr %8, align 8, !tbaa !5
  %122 = getelementptr inbounds %struct.global_State, ptr %121, i32 0, i32 5
  %123 = getelementptr inbounds %struct.GCState, ptr %122, i32 0, i32 8
  %124 = getelementptr inbounds %struct.MRef, ptr %123, i32 0, i32 0
  store i32 %120, ptr %124, align 4, !tbaa !29
  %125 = load ptr, ptr %8, align 8, !tbaa !5
  %126 = getelementptr inbounds %struct.global_State, ptr %125, i32 0, i32 5
  %127 = getelementptr inbounds %struct.GCState, ptr %126, i32 0, i32 0
  store i32 5616, ptr %127, align 8, !tbaa !30
  %128 = load ptr, ptr %8, align 8, !tbaa !5
  %129 = getelementptr inbounds %struct.global_State, ptr %128, i32 0, i32 5
  %130 = getelementptr inbounds %struct.GCState, ptr %129, i32 0, i32 16
  store i32 200, ptr %130, align 4, !tbaa !31
  %131 = load ptr, ptr %8, align 8, !tbaa !5
  %132 = getelementptr inbounds %struct.global_State, ptr %131, i32 0, i32 5
  %133 = getelementptr inbounds %struct.GCState, ptr %132, i32 0, i32 15
  store i32 200, ptr %133, align 8, !tbaa !32
  %134 = load ptr, ptr %7, align 8, !tbaa !5
  call void @lj_dispatch_init(ptr noundef %134)
  %135 = load ptr, ptr %7, align 8, !tbaa !5
  %136 = getelementptr inbounds %struct.lua_State, ptr %135, i32 0, i32 0
  %137 = getelementptr inbounds %struct.anon, ptr %136, i32 0, i32 4
  store i8 6, ptr %137, align 1, !tbaa !9
  %138 = load ptr, ptr %7, align 8, !tbaa !5
  %139 = call i32 @lj_vm_cpcall(ptr noundef %138, ptr noundef null, ptr noundef null, ptr noundef @cpluaopen)
  %140 = icmp ne i32 %139, 0
  br i1 %140, label %141, label %143

141:                                              ; preds = %20
  %142 = load ptr, ptr %7, align 8, !tbaa !5
  call void @close_state(ptr noundef %142)
  store ptr null, ptr %3, align 8
  store i32 1, ptr %9, align 4
  br label %148

143:                                              ; preds = %20
  %144 = load ptr, ptr %7, align 8, !tbaa !5
  %145 = getelementptr inbounds %struct.lua_State, ptr %144, i32 0, i32 0
  %146 = getelementptr inbounds %struct.anon, ptr %145, i32 0, i32 4
  store i8 0, ptr %146, align 1, !tbaa !9
  %147 = load ptr, ptr %7, align 8, !tbaa !5
  store ptr %147, ptr %3, align 8
  store i32 1, ptr %9, align 4
  br label %148

148:                                              ; preds = %143, %141, %19
  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
  %149 = load ptr, ptr %3, align 8
  ret ptr %149
}

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

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

declare hidden void @lj_dispatch_init(ptr noundef) #4

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

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

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

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!7, !7, i64 0}
!10 = !{!11, !7, i64 40}
!11 = !{!"global_State", !6, i64 0, !12, i64 8, !12, i64 12, !6, i64 16, !6, i64 24, !13, i64 32, !12, i64 88, !16, i64 92, !17, i64 108, !7, i64 124, !7, i64 125, !7, i64 126, !7, i64 127, !14, i64 128, !7, i64 136, !7, i64 144, !7, i64 152, !18, i64 160, !19, i64 184, !12, i64 208, !12, i64 212, !6, i64 216, !6, i64 224, !6, i64 232, !12, i64 240, !12, i64 244, !14, i64 248, !15, i64 252, !15, i64 256, !7, i64 260}
!12 = !{!"int", !7, i64 0}
!13 = !{!"GCState", !12, i64 0, !12, i64 4, !7, i64 8, !7, i64 9, !7, i64 10, !7, i64 11, !12, i64 12, !14, i64 16, !15, i64 20, !14, i64 24, !14, i64 28, !14, i64 32, !14, i64 36, !12, i64 40, !12, i64 44, !12, i64 48, !12, i64 52}
!14 = !{!"GCRef", !12, i64 0}
!15 = !{!"MRef", !12, i64 0}
!16 = !{!"SBuf", !15, i64 0, !15, i64 4, !15, i64 8, !15, i64 12}
!17 = !{!"GCstr", !14, i64 0, !7, i64 4, !7, i64 5, !7, i64 6, !7, i64 7, !12, i64 8, !12, i64 12}
!18 = !{!"Node", !7, i64 0, !7, i64 8, !15, i64 16, !15, i64 20}
!19 = !{!"GCupval", !14, i64 0, !7, i64 4, !7, i64 5, !7, i64 6, !7, i64 7, !7, i64 8, !15, i64 16, !12, i64 20}
!20 = !{!11, !7, i64 112}
!21 = !{!11, !7, i64 113}
!22 = !{!11, !6, i64 16}
!23 = !{!11, !6, i64 24}
!24 = !{!11, !12, i64 128}
!25 = !{!11, !12, i64 8}
!26 = !{!11, !12, i64 180}
!27 = !{!11, !7, i64 41}
!28 = !{!11, !12, i64 48}
!29 = !{!11, !12, i64 52}
!30 = !{!11, !12, i64 32}
!31 = !{!11, !12, i64 84}
!32 = !{!11, !12, i64 80}


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

; Function Attrs: nounwind uwtable
define hidden ptr @lj_state_newstate(ptr noundef %0, ptr noundef %1) local_unnamed_addr #0 {
  %3 = tail call ptr %0(ptr noundef %1, ptr noundef null, i64 noundef 0, i64 noundef 5616) #4
  %4 = icmp eq ptr %3, null
  br i1 %4, label %49, label %5

5:                                                ; preds = %2
  %6 = getelementptr inbounds i8, ptr %3, i64 384
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(5616) %3, i8 0, i64 5616, i1 false)
  %7 = getelementptr inbounds i8, ptr %3, i64 5
  store i8 6, ptr %7, align 1, !tbaa !5
  %8 = getelementptr inbounds i8, ptr %3, i64 4
  store i8 97, ptr %8, align 4, !tbaa !5
  %9 = getelementptr inbounds i8, ptr %3, i64 6
  store i8 1, ptr %9, align 2, !tbaa !5
  %10 = ptrtoint ptr %6 to i64
  %11 = trunc i64 %10 to i32
  %12 = getelementptr inbounds i8, ptr %3, i64 8
  store i32 %11, ptr %12, align 8, !tbaa !5
  %13 = getelementptr inbounds i8, ptr %3, i64 416
  %14 = getelementptr inbounds i8, ptr %3, i64 424
  store i8 33, ptr %14, align 8, !tbaa !8
  %15 = getelementptr inbounds i8, ptr %3, i64 496
  store i8 1, ptr %15, align 4, !tbaa !19
  %16 = getelementptr inbounds i8, ptr %3, i64 497
  store i8 4, ptr %16, align 1, !tbaa !20
  %17 = getelementptr inbounds i8, ptr %3, i64 400
  store ptr %0, ptr %17, align 8, !tbaa !21
  %18 = getelementptr inbounds i8, ptr %3, i64 408
  store ptr %1, ptr %18, align 8, !tbaa !22
  %19 = ptrtoint ptr %3 to i64
  %20 = trunc i64 %19 to i32
  %21 = getelementptr inbounds i8, ptr %3, i64 512
  store i32 %20, ptr %21, align 8, !tbaa !23
  %22 = getelementptr inbounds i8, ptr %3, i64 568
  %23 = ptrtoint ptr %22 to i64
  %24 = trunc i64 %23 to i32
  %25 = getelementptr inbounds i8, ptr %3, i64 576
  store i32 %24, ptr %25, align 8, !tbaa !5
  %26 = getelementptr inbounds i8, ptr %3, i64 580
  store i32 %24, ptr %26, align 4, !tbaa !5
  %27 = getelementptr inbounds i8, ptr %3, i64 392
  store i32 -1, ptr %27, align 8, !tbaa !24
  %28 = and i64 %10, 4294967295
  %29 = inttoptr i64 %28 to ptr
  %30 = getelementptr inbounds i8, ptr %29, i64 140
  store i32 -1, ptr %30, align 4, !tbaa !5
  %31 = getelementptr inbounds i8, ptr %3, i64 544
  %32 = getelementptr inbounds i8, ptr %3, i64 548
  store i32 -1, ptr %32, align 4, !tbaa !5
  %33 = getelementptr inbounds i8, ptr %3, i64 556
  store i32 -1, ptr %33, align 4, !tbaa !5
  %34 = ptrtoint ptr %31 to i64
  %35 = trunc i64 %34 to i32
  %36 = getelementptr inbounds i8, ptr %3, i64 564
  store i32 %35, ptr %36, align 4, !tbaa !25
  %37 = getelementptr inbounds i8, ptr %3, i64 476
  tail call void @lj_buf_init(ptr noundef null, ptr noundef nonnull %37)
  %38 = getelementptr inbounds i8, ptr %3, i64 425
  store i8 0, ptr %38, align 1, !tbaa !26
  %39 = getelementptr inbounds i8, ptr %3, i64 432
  store i32 %20, ptr %39, align 8, !tbaa !27
  %40 = ptrtoint ptr %39 to i64
  %41 = trunc i64 %40 to i32
  %42 = getelementptr inbounds i8, ptr %3, i64 436
  store i32 %41, ptr %42, align 4, !tbaa !28
  store i32 5616, ptr %13, align 8, !tbaa !29
  %43 = getelementptr inbounds i8, ptr %3, i64 468
  store i32 200, ptr %43, align 4, !tbaa !30
  %44 = getelementptr inbounds i8, ptr %3, i64 464
  store i32 200, ptr %44, align 8, !tbaa !31
  tail call void @lj_dispatch_init(ptr noundef nonnull %3) #4
  %45 = getelementptr inbounds i8, ptr %3, i64 7
  store i8 6, ptr %45, align 1, !tbaa !5
  %46 = tail call i32 @lj_vm_cpcall(ptr noundef nonnull %3, ptr noundef null, ptr noundef null, ptr noundef nonnull @cpluaopen) #4
  %.not = icmp eq i32 %46, 0
  br i1 %.not, label %48, label %47

47:                                               ; preds = %5
  tail call void @close_state(ptr noundef nonnull %3)
  br label %49

48:                                               ; preds = %5
  store i8 0, ptr %45, align 1, !tbaa !5
  br label %49

49:                                               ; preds = %2, %48, %47
  %.0 = phi ptr [ null, %47 ], [ %3, %48 ], [ null, %2 ]
  ret ptr %.0
}

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

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

declare hidden void @lj_dispatch_init(ptr noundef) local_unnamed_addr #3

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

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

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

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

!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 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = !{!9, !6, i64 40}
!9 = !{!"global_State", !10, i64 0, !11, i64 8, !11, i64 12, !10, i64 16, !10, i64 24, !12, i64 32, !11, i64 88, !15, i64 92, !16, i64 108, !6, i64 124, !6, i64 125, !6, i64 126, !6, i64 127, !13, i64 128, !6, i64 136, !6, i64 144, !6, i64 152, !17, i64 160, !18, i64 184, !11, i64 208, !11, i64 212, !10, i64 216, !10, i64 224, !10, i64 232, !11, i64 240, !11, i64 244, !13, i64 248, !14, i64 252, !14, i64 256, !6, i64 260}
!10 = !{!"any pointer", !6, i64 0}
!11 = !{!"int", !6, i64 0}
!12 = !{!"GCState", !11, i64 0, !11, i64 4, !6, i64 8, !6, i64 9, !6, i64 10, !6, i64 11, !11, i64 12, !13, i64 16, !14, i64 20, !13, i64 24, !13, i64 28, !13, i64 32, !13, i64 36, !11, i64 40, !11, i64 44, !11, i64 48, !11, i64 52}
!13 = !{!"GCRef", !11, i64 0}
!14 = !{!"MRef", !11, i64 0}
!15 = !{!"SBuf", !14, i64 0, !14, i64 4, !14, i64 8, !14, i64 12}
!16 = !{!"GCstr", !13, i64 0, !6, i64 4, !6, i64 5, !6, i64 6, !6, i64 7, !11, i64 8, !11, i64 12}
!17 = !{!"Node", !6, i64 0, !6, i64 8, !14, i64 16, !14, i64 20}
!18 = !{!"GCupval", !13, i64 0, !6, i64 4, !6, i64 5, !6, i64 6, !6, i64 7, !6, i64 8, !14, i64 16, !11, i64 20}
!19 = !{!9, !6, i64 112}
!20 = !{!9, !6, i64 113}
!21 = !{!9, !10, i64 16}
!22 = !{!9, !10, i64 24}
!23 = !{!9, !11, i64 128}
!24 = !{!9, !11, i64 8}
!25 = !{!9, !11, i64 180}
!26 = !{!9, !6, i64 41}
!27 = !{!9, !11, i64 48}
!28 = !{!9, !11, i64 52}
!29 = !{!9, !11, i64 32}
!30 = !{!9, !11, i64 84}
!31 = !{!9, !11, i64 80}


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