; LLVM IR from ejoy/ejoy2d :: lua (lstate)

; 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.LG = type { %struct.LX, %struct.global_State }
%struct.LX = type { [8 x i8], %struct.lua_State }
%struct.lua_State = type { ptr, i8, i8, i8, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, %struct.CallInfo, ptr, i64, i32, i32, i32, i16, i16, i8, i8 }
%struct.CallInfo = type { ptr, ptr, ptr, ptr, %union.anon, i64, i16, i8 }
%union.anon = type { %struct.anon.0 }
%struct.anon.0 = type { ptr, i64, i64 }
%struct.global_State = type { ptr, ptr, i64, i64, i64, i64, %struct.stringtable, %struct.lua_TValue, i32, i8, i8, i8, i8, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, %struct.Mbuffer, i32, i32, i32, ptr, ptr, ptr, ptr, [24 x ptr], [9 x ptr] }
%struct.stringtable = type { ptr, i32, i32 }
%struct.lua_TValue = type { %union.Value, i32 }
%union.Value = type { ptr }
%struct.Mbuffer = type { ptr, i64, i64 }

; 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
declare hidden void @preinit_thread(ptr noundef, ptr noundef) #1

; Function Attrs: nounwind uwtable
define dso_local ptr @lua_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 i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = 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 4, ptr %6) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #3
  %11 = load ptr, ptr %4, align 8, !tbaa !5
  %12 = load ptr, ptr %5, align 8, !tbaa !5
  %13 = call ptr %11(ptr noundef %12, ptr noundef null, i64 noundef 8, i64 noundef 728)
  store ptr %13, ptr %9, align 8, !tbaa !5
  %14 = load ptr, ptr %9, align 8, !tbaa !5
  %15 = icmp eq ptr %14, null
  br i1 %15, label %16, label %17

16:                                               ; preds = %2
  store ptr null, ptr %3, align 8
  store i32 1, ptr %10, align 4
  br label %134

17:                                               ; preds = %2
  %18 = load ptr, ptr %9, align 8, !tbaa !5
  %19 = getelementptr inbounds %struct.LG, ptr %18, i32 0, i32 0
  %20 = getelementptr inbounds %struct.LX, ptr %19, i32 0, i32 1
  store ptr %20, ptr %7, align 8, !tbaa !5
  %21 = load ptr, ptr %9, align 8, !tbaa !5
  %22 = getelementptr inbounds %struct.LG, ptr %21, i32 0, i32 1
  store ptr %22, ptr %8, align 8, !tbaa !5
  %23 = load ptr, ptr %7, align 8, !tbaa !5
  %24 = getelementptr inbounds %struct.lua_State, ptr %23, i32 0, i32 0
  store ptr null, ptr %24, align 8, !tbaa !9
  %25 = load ptr, ptr %7, align 8, !tbaa !5
  %26 = getelementptr inbounds %struct.lua_State, ptr %25, i32 0, i32 1
  store i8 8, ptr %26, align 8, !tbaa !15
  %27 = load ptr, ptr %8, align 8, !tbaa !5
  %28 = getelementptr inbounds %struct.global_State, ptr %27, i32 0, i32 9
  store i8 1, ptr %28, align 4, !tbaa !16
  %29 = load ptr, ptr %8, align 8, !tbaa !5
  %30 = getelementptr inbounds %struct.global_State, ptr %29, i32 0, i32 9
  %31 = load i8, ptr %30, align 4, !tbaa !16
  %32 = zext i8 %31 to i32
  %33 = and i32 %32, 3
  %34 = trunc i32 %33 to i8
  %35 = load ptr, ptr %7, align 8, !tbaa !5
  %36 = getelementptr inbounds %struct.lua_State, ptr %35, i32 0, i32 2
  store i8 %34, ptr %36, align 1, !tbaa !21
  %37 = load ptr, ptr %7, align 8, !tbaa !5
  %38 = load ptr, ptr %8, align 8, !tbaa !5
  call void @preinit_thread(ptr noundef %37, ptr noundef %38)
  %39 = load ptr, ptr %4, align 8, !tbaa !5
  %40 = load ptr, ptr %8, align 8, !tbaa !5
  %41 = getelementptr inbounds %struct.global_State, ptr %40, i32 0, i32 0
  store ptr %39, ptr %41, align 8, !tbaa !22
  %42 = load ptr, ptr %5, align 8, !tbaa !5
  %43 = load ptr, ptr %8, align 8, !tbaa !5
  %44 = getelementptr inbounds %struct.global_State, ptr %43, i32 0, i32 1
  store ptr %42, ptr %44, align 8, !tbaa !23
  %45 = load ptr, ptr %7, align 8, !tbaa !5
  %46 = load ptr, ptr %8, align 8, !tbaa !5
  %47 = getelementptr inbounds %struct.global_State, ptr %46, i32 0, i32 29
  store ptr %45, ptr %47, align 8, !tbaa !24
  %48 = load ptr, ptr %7, align 8, !tbaa !5
  %49 = call i32 @makeseed(ptr noundef %48)
  %50 = load ptr, ptr %8, align 8, !tbaa !5
  %51 = getelementptr inbounds %struct.global_State, ptr %50, i32 0, i32 8
  store i32 %49, ptr %51, align 8, !tbaa !25
  %52 = load ptr, ptr %8, align 8, !tbaa !5
  %53 = getelementptr inbounds %struct.global_State, ptr %52, i32 0, i32 12
  store i8 0, ptr %53, align 1, !tbaa !26
  %54 = load ptr, ptr %8, align 8, !tbaa !5
  %55 = getelementptr inbounds %struct.global_State, ptr %54, i32 0, i32 5
  store i64 0, ptr %55, align 8, !tbaa !27
  %56 = load ptr, ptr %8, align 8, !tbaa !5
  %57 = getelementptr inbounds %struct.global_State, ptr %56, i32 0, i32 6
  %58 = getelementptr inbounds %struct.stringtable, ptr %57, i32 0, i32 1
  store i32 0, ptr %58, align 8, !tbaa !28
  %59 = load ptr, ptr %8, align 8, !tbaa !5
  %60 = getelementptr inbounds %struct.global_State, ptr %59, i32 0, i32 6
  %61 = getelementptr inbounds %struct.stringtable, ptr %60, i32 0, i32 2
  store i32 0, ptr %61, align 4, !tbaa !29
  %62 = load ptr, ptr %8, align 8, !tbaa !5
  %63 = getelementptr inbounds %struct.global_State, ptr %62, i32 0, i32 6
  %64 = getelementptr inbounds %struct.stringtable, ptr %63, i32 0, i32 0
  store ptr null, ptr %64, align 8, !tbaa !30
  %65 = load ptr, ptr %8, align 8, !tbaa !5
  %66 = getelementptr inbounds %struct.global_State, ptr %65, i32 0, i32 7
  %67 = getelementptr inbounds %struct.lua_TValue, ptr %66, i32 0, i32 1
  store i32 0, ptr %67, align 8, !tbaa !31
  %68 = load ptr, ptr %8, align 8, !tbaa !5
  %69 = getelementptr inbounds %struct.global_State, ptr %68, i32 0, i32 24
  %70 = getelementptr inbounds %struct.Mbuffer, ptr %69, i32 0, i32 0
  store ptr null, ptr %70, align 8, !tbaa !32
  %71 = load ptr, ptr %8, align 8, !tbaa !5
  %72 = getelementptr inbounds %struct.global_State, ptr %71, i32 0, i32 24
  %73 = getelementptr inbounds %struct.Mbuffer, ptr %72, i32 0, i32 2
  store i64 0, ptr %73, align 8, !tbaa !33
  %74 = load ptr, ptr %8, align 8, !tbaa !5
  %75 = getelementptr inbounds %struct.global_State, ptr %74, i32 0, i32 28
  store ptr null, ptr %75, align 8, !tbaa !34
  %76 = load ptr, ptr %8, align 8, !tbaa !5
  %77 = getelementptr inbounds %struct.global_State, ptr %76, i32 0, i32 30
  store ptr null, ptr %77, align 8, !tbaa !35
  %78 = load ptr, ptr %8, align 8, !tbaa !5
  %79 = getelementptr inbounds %struct.global_State, ptr %78, i32 0, i32 10
  store i8 7, ptr %79, align 1, !tbaa !36
  %80 = load ptr, ptr %8, align 8, !tbaa !5
  %81 = getelementptr inbounds %struct.global_State, ptr %80, i32 0, i32 11
  store i8 0, ptr %81, align 2, !tbaa !37
  %82 = load ptr, ptr %8, align 8, !tbaa !5
  %83 = getelementptr inbounds %struct.global_State, ptr %82, i32 0, i32 22
  store ptr null, ptr %83, align 8, !tbaa !38
  %84 = load ptr, ptr %8, align 8, !tbaa !5
  %85 = getelementptr inbounds %struct.global_State, ptr %84, i32 0, i32 21
  store ptr null, ptr %85, align 8, !tbaa !39
  %86 = load ptr, ptr %8, align 8, !tbaa !5
  %87 = getelementptr inbounds %struct.global_State, ptr %86, i32 0, i32 15
  store ptr null, ptr %87, align 8, !tbaa !40
  %88 = load ptr, ptr %8, align 8, !tbaa !5
  %89 = getelementptr inbounds %struct.global_State, ptr %88, i32 0, i32 13
  store ptr null, ptr %89, align 8, !tbaa !41
  %90 = load ptr, ptr %8, align 8, !tbaa !5
  %91 = getelementptr inbounds %struct.global_State, ptr %90, i32 0, i32 14
  store ptr null, ptr %91, align 8, !tbaa !42
  %92 = load ptr, ptr %8, align 8, !tbaa !5
  %93 = getelementptr inbounds %struct.global_State, ptr %92, i32 0, i32 17
  store ptr null, ptr %93, align 8, !tbaa !43
  %94 = load ptr, ptr %8, align 8, !tbaa !5
  %95 = getelementptr inbounds %struct.global_State, ptr %94, i32 0, i32 16
  store ptr null, ptr %95, align 8, !tbaa !44
  %96 = load ptr, ptr %8, align 8, !tbaa !5
  %97 = getelementptr inbounds %struct.global_State, ptr %96, i32 0, i32 20
  store ptr null, ptr %97, align 8, !tbaa !45
  %98 = load ptr, ptr %8, align 8, !tbaa !5
  %99 = getelementptr inbounds %struct.global_State, ptr %98, i32 0, i32 19
  store ptr null, ptr %99, align 8, !tbaa !46
  %100 = load ptr, ptr %8, align 8, !tbaa !5
  %101 = getelementptr inbounds %struct.global_State, ptr %100, i32 0, i32 18
  store ptr null, ptr %101, align 8, !tbaa !47
  %102 = load ptr, ptr %8, align 8, !tbaa !5
  %103 = getelementptr inbounds %struct.global_State, ptr %102, i32 0, i32 23
  store ptr null, ptr %103, align 8, !tbaa !48
  %104 = load ptr, ptr %8, align 8, !tbaa !5
  %105 = getelementptr inbounds %struct.global_State, ptr %104, i32 0, i32 2
  store i64 728, ptr %105, align 8, !tbaa !49
  %106 = load ptr, ptr %8, align 8, !tbaa !5
  %107 = getelementptr inbounds %struct.global_State, ptr %106, i32 0, i32 3
  store i64 0, ptr %107, align 8, !tbaa !50
  %108 = load ptr, ptr %8, align 8, !tbaa !5
  %109 = getelementptr inbounds %struct.global_State, ptr %108, i32 0, i32 25
  store i32 0, ptr %109, align 8, !tbaa !51
  %110 = load ptr, ptr %8, align 8, !tbaa !5
  %111 = getelementptr inbounds %struct.global_State, ptr %110, i32 0, i32 26
  store i32 200, ptr %111, align 4, !tbaa !52
  %112 = load ptr, ptr %8, align 8, !tbaa !5
  %113 = getelementptr inbounds %struct.global_State, ptr %112, i32 0, i32 27
  store i32 200, ptr %113, align 8, !tbaa !53
  store i32 0, ptr %6, align 4, !tbaa !54
  br label %114

114:                                              ; preds = %123, %17
  %115 = load i32, ptr %6, align 4, !tbaa !54
  %116 = icmp slt i32 %115, 9
  br i1 %116, label %117, label %126

117:                                              ; preds = %114
  %118 = load ptr, ptr %8, align 8, !tbaa !5
  %119 = getelementptr inbounds %struct.global_State, ptr %118, i32 0, i32 33
  %120 = load i32, ptr %6, align 4, !tbaa !54
  %121 = sext i32 %120 to i64
  %122 = getelementptr inbounds [9 x ptr], ptr %119, i64 0, i64 %121
  store ptr null, ptr %122, align 8, !tbaa !5
  br label %123

123:                                              ; preds = %117
  %124 = load i32, ptr %6, align 4, !tbaa !54
  %125 = add nsw i32 %124, 1
  store i32 %125, ptr %6, align 4, !tbaa !54
  br label %114, !llvm.loop !55

126:                                              ; preds = %114
  %127 = load ptr, ptr %7, align 8, !tbaa !5
  %128 = call i32 @luaD_rawrunprotected(ptr noundef %127, ptr noundef @f_luaopen, ptr noundef null)
  %129 = icmp ne i32 %128, 0
  br i1 %129, label %130, label %132

130:                                              ; preds = %126
  %131 = load ptr, ptr %7, align 8, !tbaa !5
  call void @close_state(ptr noundef %131)
  store ptr null, ptr %7, align 8, !tbaa !5
  br label %132

132:                                              ; preds = %130, %126
  %133 = load ptr, ptr %7, align 8, !tbaa !5
  store ptr %133, ptr %3, align 8
  store i32 1, ptr %10, align 4
  br label %134

134:                                              ; preds = %132, %16
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #3
  %135 = load ptr, ptr %3, align 8
  ret ptr %135
}

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

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

; Function Attrs: nounwind uwtable
declare hidden void @f_luaopen(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 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }

!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, !6, i64 0}
!10 = !{!"lua_State", !6, i64 0, !7, i64 8, !7, i64 9, !7, i64 10, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !6, i64 88, !11, i64 96, !6, i64 168, !12, i64 176, !14, i64 184, !14, i64 188, !14, i64 192, !13, i64 196, !13, i64 198, !7, i64 200, !7, i64 201}
!11 = !{!"CallInfo", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !7, i64 32, !12, i64 56, !13, i64 64, !7, i64 66}
!12 = !{!"long", !7, i64 0}
!13 = !{!"short", !7, i64 0}
!14 = !{!"int", !7, i64 0}
!15 = !{!10, !7, i64 8}
!16 = !{!17, !7, i64 84}
!17 = !{!"global_State", !6, i64 0, !6, i64 8, !12, i64 16, !12, i64 24, !12, i64 32, !12, i64 40, !18, i64 48, !19, i64 64, !14, i64 80, !7, i64 84, !7, i64 85, !7, i64 86, !7, i64 87, !6, i64 88, !6, i64 96, !6, i64 104, !6, i64 112, !6, i64 120, !6, i64 128, !6, i64 136, !6, i64 144, !6, i64 152, !6, i64 160, !6, i64 168, !20, i64 176, !14, i64 200, !14, i64 204, !14, i64 208, !6, i64 216, !6, i64 224, !6, i64 232, !6, i64 240, !7, i64 248, !7, i64 440}
!18 = !{!"stringtable", !6, i64 0, !14, i64 8, !14, i64 12}
!19 = !{!"lua_TValue", !7, i64 0, !14, i64 8}
!20 = !{!"Mbuffer", !6, i64 0, !12, i64 8, !12, i64 16}
!21 = !{!10, !7, i64 9}
!22 = !{!17, !6, i64 0}
!23 = !{!17, !6, i64 8}
!24 = !{!17, !6, i64 224}
!25 = !{!17, !14, i64 80}
!26 = !{!17, !7, i64 87}
!27 = !{!17, !12, i64 40}
!28 = !{!17, !14, i64 56}
!29 = !{!17, !14, i64 60}
!30 = !{!17, !6, i64 48}
!31 = !{!17, !14, i64 72}
!32 = !{!17, !6, i64 176}
!33 = !{!17, !12, i64 192}
!34 = !{!17, !6, i64 216}
!35 = !{!17, !6, i64 232}
!36 = !{!17, !7, i64 85}
!37 = !{!17, !7, i64 86}
!38 = !{!17, !6, i64 160}
!39 = !{!17, !6, i64 152}
!40 = !{!17, !6, i64 104}
!41 = !{!17, !6, i64 88}
!42 = !{!17, !6, i64 96}
!43 = !{!17, !6, i64 120}
!44 = !{!17, !6, i64 112}
!45 = !{!17, !6, i64 144}
!46 = !{!17, !6, i64 136}
!47 = !{!17, !6, i64 128}
!48 = !{!17, !6, i64 168}
!49 = !{!17, !12, i64 16}
!50 = !{!17, !12, i64 24}
!51 = !{!17, !14, i64 200}
!52 = !{!17, !14, i64 204}
!53 = !{!17, !14, i64 208}
!54 = !{!14, !14, i64 0}
!55 = distinct !{!55, !56}
!56 = !{!"llvm.loop.mustprogress"}


; 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
declare hidden void @preinit_thread(ptr noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
define dso_local noundef ptr @lua_newstate(ptr noundef %0, ptr noundef %1) local_unnamed_addr #0 {
  %3 = tail call ptr %0(ptr noundef %1, ptr noundef null, i64 noundef 8, i64 noundef 728) #3
  %4 = icmp eq ptr %3, null
  br i1 %4, label %33, label %5

5:                                                ; preds = %2
  %6 = getelementptr inbounds i8, ptr %3, i64 8
  %7 = getelementptr inbounds i8, ptr %3, i64 216
  store ptr null, ptr %6, align 8, !tbaa !5
  %8 = getelementptr inbounds i8, ptr %3, i64 16
  store i8 8, ptr %8, align 8, !tbaa !14
  %9 = getelementptr inbounds i8, ptr %3, i64 300
  store i8 1, ptr %9, align 4, !tbaa !15
  %10 = getelementptr inbounds i8, ptr %3, i64 17
  store i8 1, ptr %10, align 1, !tbaa !20
  tail call void @preinit_thread(ptr noundef nonnull %6, ptr noundef nonnull %7)
  store ptr %0, ptr %7, align 8, !tbaa !21
  %11 = getelementptr inbounds i8, ptr %3, i64 224
  store ptr %1, ptr %11, align 8, !tbaa !22
  %12 = getelementptr inbounds i8, ptr %3, i64 440
  store ptr %6, ptr %12, align 8, !tbaa !23
  %13 = tail call i32 @makeseed(ptr noundef nonnull %6)
  %14 = getelementptr inbounds i8, ptr %3, i64 296
  store i32 %13, ptr %14, align 8, !tbaa !24
  %15 = getelementptr inbounds i8, ptr %3, i64 303
  store i8 0, ptr %15, align 1, !tbaa !25
  %16 = getelementptr inbounds i8, ptr %3, i64 256
  %17 = getelementptr inbounds i8, ptr %3, i64 288
  store i32 0, ptr %17, align 8, !tbaa !26
  %18 = getelementptr inbounds i8, ptr %3, i64 392
  store ptr null, ptr %18, align 8, !tbaa !27
  %19 = getelementptr inbounds i8, ptr %3, i64 408
  store i64 0, ptr %19, align 8, !tbaa !28
  %20 = getelementptr inbounds i8, ptr %3, i64 432
  store ptr null, ptr %20, align 8, !tbaa !29
  %21 = getelementptr inbounds i8, ptr %3, i64 448
  store ptr null, ptr %21, align 8, !tbaa !30
  %22 = getelementptr inbounds i8, ptr %3, i64 301
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %16, i8 0, i64 24, i1 false)
  store i8 7, ptr %22, align 1, !tbaa !31
  %23 = getelementptr inbounds i8, ptr %3, i64 302
  store i8 0, ptr %23, align 2, !tbaa !32
  %24 = getelementptr inbounds i8, ptr %3, i64 304
  %25 = getelementptr inbounds i8, ptr %3, i64 232
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(88) %24, i8 0, i64 88, i1 false)
  store i64 728, ptr %25, align 8, !tbaa !33
  %26 = getelementptr inbounds i8, ptr %3, i64 240
  store i64 0, ptr %26, align 8, !tbaa !34
  %27 = getelementptr inbounds i8, ptr %3, i64 416
  store i32 0, ptr %27, align 8, !tbaa !35
  %28 = getelementptr inbounds i8, ptr %3, i64 420
  store i32 200, ptr %28, align 4, !tbaa !36
  %29 = getelementptr inbounds i8, ptr %3, i64 424
  store i32 200, ptr %29, align 8, !tbaa !37
  %30 = getelementptr inbounds i8, ptr %3, i64 656
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(72) %30, i8 0, i64 72, i1 false), !tbaa !38
  %31 = tail call i32 @luaD_rawrunprotected(ptr noundef nonnull %6, ptr noundef nonnull @f_luaopen, ptr noundef null) #3
  %.not = icmp eq i32 %31, 0
  br i1 %.not, label %33, label %32

32:                                               ; preds = %5
  tail call void @close_state(ptr noundef nonnull %6)
  br label %33

33:                                               ; preds = %5, %32, %2
  %.0 = phi ptr [ null, %2 ], [ null, %32 ], [ %6, %5 ]
  ret ptr %.0
}

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

declare hidden i32 @luaD_rawrunprotected(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

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

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

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

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 = { "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 = { 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, !7, i64 0}
!6 = !{!"lua_State", !7, i64 0, !8, i64 8, !8, i64 9, !8, i64 10, !7, i64 16, !7, i64 24, !7, i64 32, !7, i64 40, !7, i64 48, !7, i64 56, !7, i64 64, !7, i64 72, !7, i64 80, !7, i64 88, !10, i64 96, !7, i64 168, !11, i64 176, !13, i64 184, !13, i64 188, !13, i64 192, !12, i64 196, !12, i64 198, !8, i64 200, !8, i64 201}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"CallInfo", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !8, i64 32, !11, i64 56, !12, i64 64, !8, i64 66}
!11 = !{!"long", !8, i64 0}
!12 = !{!"short", !8, i64 0}
!13 = !{!"int", !8, i64 0}
!14 = !{!6, !8, i64 8}
!15 = !{!16, !8, i64 84}
!16 = !{!"global_State", !7, i64 0, !7, i64 8, !11, i64 16, !11, i64 24, !11, i64 32, !11, i64 40, !17, i64 48, !18, i64 64, !13, i64 80, !8, i64 84, !8, i64 85, !8, i64 86, !8, i64 87, !7, i64 88, !7, i64 96, !7, i64 104, !7, i64 112, !7, i64 120, !7, i64 128, !7, i64 136, !7, i64 144, !7, i64 152, !7, i64 160, !7, i64 168, !19, i64 176, !13, i64 200, !13, i64 204, !13, i64 208, !7, i64 216, !7, i64 224, !7, i64 232, !7, i64 240, !8, i64 248, !8, i64 440}
!17 = !{!"stringtable", !7, i64 0, !13, i64 8, !13, i64 12}
!18 = !{!"lua_TValue", !8, i64 0, !13, i64 8}
!19 = !{!"Mbuffer", !7, i64 0, !11, i64 8, !11, i64 16}
!20 = !{!6, !8, i64 9}
!21 = !{!16, !7, i64 0}
!22 = !{!16, !7, i64 8}
!23 = !{!16, !7, i64 224}
!24 = !{!16, !13, i64 80}
!25 = !{!16, !8, i64 87}
!26 = !{!16, !13, i64 72}
!27 = !{!16, !7, i64 176}
!28 = !{!16, !11, i64 192}
!29 = !{!16, !7, i64 216}
!30 = !{!16, !7, i64 232}
!31 = !{!16, !8, i64 85}
!32 = !{!16, !8, i64 86}
!33 = !{!16, !11, i64 16}
!34 = !{!16, !11, i64 24}
!35 = !{!16, !13, i64 200}
!36 = !{!16, !13, i64 204}
!37 = !{!16, !13, i64 208}
!38 = !{!7, !7, i64 0}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,LICMPass,LoopIdiomRecognizePass,LoopRotatePass,MemCpyOptPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass