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

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

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

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

; Function Attrs: alwaysinline nounwind uwtable
declare hidden i32 @bcread_uleb128(ptr noundef) #2

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

; Function Attrs: nounwind uwtable
define hidden ptr @lj_bcread(ptr noundef %0) #0 {
  %2 = alloca ptr, align 8
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #5
  %8 = load ptr, ptr %2, align 8, !tbaa !5
  %9 = getelementptr inbounds %struct.LexState, ptr %8, i32 0, i32 1
  %10 = load ptr, ptr %9, align 8, !tbaa !9
  store ptr %10, ptr %3, align 8, !tbaa !5
  %11 = load ptr, ptr %3, align 8, !tbaa !5
  %12 = getelementptr inbounds %struct.lua_State, ptr %11, i32 0, i32 0
  %13 = getelementptr inbounds %struct.anon.5, ptr %12, i32 0, i32 8
  %14 = load ptr, ptr %13, align 8, !tbaa !14
  %15 = load ptr, ptr %3, align 8, !tbaa !5
  %16 = getelementptr inbounds %struct.lua_State, ptr %15, i32 0, i32 0
  %17 = getelementptr inbounds %struct.anon.5, ptr %16, i32 0, i32 10
  %18 = getelementptr inbounds %struct.MRef, ptr %17, i32 0, i32 0
  %19 = load i32, ptr %18, align 4, !tbaa !14
  %20 = zext i32 %19 to i64
  %21 = inttoptr i64 %20 to ptr
  %22 = ptrtoint ptr %14 to i64
  %23 = ptrtoint ptr %21 to i64
  %24 = sub i64 %22, %23
  %25 = trunc i64 %24 to i32
  %26 = load ptr, ptr %2, align 8, !tbaa !5
  %27 = getelementptr inbounds %struct.LexState, ptr %26, i32 0, i32 13
  store i32 %25, ptr %27, align 4, !tbaa !15
  %28 = load ptr, ptr %2, align 8, !tbaa !5
  %29 = getelementptr inbounds %struct.LexState, ptr %28, i32 0, i32 9
  call void @lj_buf_reset(ptr noundef %29)
  %30 = load ptr, ptr %2, align 8, !tbaa !5
  %31 = call i32 @bcread_header(ptr noundef %30)
  %32 = icmp ne i32 %31, 0
  br i1 %32, label %35, label %33

33:                                               ; preds = %1
  %34 = load ptr, ptr %2, align 8, !tbaa !5
  call void @bcread_error(ptr noundef %34, i32 noundef 2938)
  br label %35

35:                                               ; preds = %33, %1
  br label %36

36:                                               ; preds = %109, %35
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #5
  %37 = load ptr, ptr %2, align 8, !tbaa !5
  %38 = getelementptr inbounds %struct.LexState, ptr %37, i32 0, i32 4
  %39 = load ptr, ptr %38, align 8, !tbaa !16
  %40 = load ptr, ptr %2, align 8, !tbaa !5
  %41 = getelementptr inbounds %struct.LexState, ptr %40, i32 0, i32 5
  %42 = load ptr, ptr %41, align 8, !tbaa !17
  %43 = icmp ult ptr %39, %42
  br i1 %43, label %44, label %57

44:                                               ; preds = %36
  %45 = load ptr, ptr %2, align 8, !tbaa !5
  %46 = getelementptr inbounds %struct.LexState, ptr %45, i32 0, i32 4
  %47 = load ptr, ptr %46, align 8, !tbaa !16
  %48 = getelementptr inbounds i8, ptr %47, i64 0
  %49 = load i8, ptr %48, align 1, !tbaa !14
  %50 = sext i8 %49 to i32
  %51 = icmp eq i32 %50, 0
  br i1 %51, label %52, label %57

52:                                               ; preds = %44
  %53 = load ptr, ptr %2, align 8, !tbaa !5
  %54 = getelementptr inbounds %struct.LexState, ptr %53, i32 0, i32 4
  %55 = load ptr, ptr %54, align 8, !tbaa !16
  %56 = getelementptr inbounds i8, ptr %55, i32 1
  store ptr %56, ptr %54, align 8, !tbaa !16
  store i32 2, ptr %7, align 4
  br label %107

57:                                               ; preds = %44, %36
  %58 = load ptr, ptr %2, align 8, !tbaa !5
  call void @bcread_want(ptr noundef %58, i32 noundef 5)
  %59 = load ptr, ptr %2, align 8, !tbaa !5
  %60 = call i32 @bcread_uleb128(ptr noundef %59)
  store i32 %60, ptr %5, align 4, !tbaa !18
  %61 = load i32, ptr %5, align 4, !tbaa !18
  %62 = icmp ne i32 %61, 0
  br i1 %62, label %64, label %63

63:                                               ; preds = %57
  store i32 2, ptr %7, align 4
  br label %107

64:                                               ; preds = %57
  %65 = load ptr, ptr %2, align 8, !tbaa !5
  %66 = load i32, ptr %5, align 4, !tbaa !18
  call void @bcread_need(ptr noundef %65, i32 noundef %66)
  %67 = load ptr, ptr %2, align 8, !tbaa !5
  %68 = getelementptr inbounds %struct.LexState, ptr %67, i32 0, i32 4
  %69 = load ptr, ptr %68, align 8, !tbaa !16
  store ptr %69, ptr %6, align 8, !tbaa !5
  %70 = load ptr, ptr %2, align 8, !tbaa !5
  %71 = call ptr @lj_bcread_proto(ptr noundef %70)
  store ptr %71, ptr %4, align 8, !tbaa !5
  %72 = load ptr, ptr %2, align 8, !tbaa !5
  %73 = getelementptr inbounds %struct.LexState, ptr %72, i32 0, i32 4
  %74 = load ptr, ptr %73, align 8, !tbaa !16
  %75 = load ptr, ptr %6, align 8, !tbaa !5
  %76 = load i32, ptr %5, align 4, !tbaa !18
  %77 = zext i32 %76 to i64
  %78 = getelementptr inbounds i8, ptr %75, i64 %77
  %79 = icmp ne ptr %74, %78
  br i1 %79, label %80, label %82

80:                                               ; preds = %64
  %81 = load ptr, ptr %2, align 8, !tbaa !5
  call void @bcread_error(ptr noundef %81, i32 noundef 2972)
  br label %82

82:                                               ; preds = %80, %64
  %83 = load ptr, ptr %3, align 8, !tbaa !5
  %84 = load ptr, ptr %3, align 8, !tbaa !5
  %85 = getelementptr inbounds %struct.lua_State, ptr %84, i32 0, i32 0
  %86 = getelementptr inbounds %struct.anon.5, ptr %85, i32 0, i32 8
  %87 = load ptr, ptr %86, align 8, !tbaa !14
  %88 = load ptr, ptr %4, align 8, !tbaa !5
  call void @setprotoV(ptr noundef %83, ptr noundef %87, ptr noundef %88)
  %89 = load ptr, ptr %3, align 8, !tbaa !5
  %90 = getelementptr inbounds %struct.lua_State, ptr %89, i32 0, i32 0
  %91 = getelementptr inbounds %struct.anon.5, ptr %90, i32 0, i32 8
  %92 = load ptr, ptr %91, align 8, !tbaa !14
  %93 = getelementptr inbounds %union.TValue, ptr %92, i32 1
  store ptr %93, ptr %91, align 8, !tbaa !14
  %94 = load ptr, ptr %3, align 8, !tbaa !5
  %95 = getelementptr inbounds %struct.lua_State, ptr %94, i32 0, i32 0
  %96 = getelementptr inbounds %struct.anon.5, ptr %95, i32 0, i32 9
  %97 = getelementptr inbounds %struct.MRef, ptr %96, i32 0, i32 0
  %98 = load i32, ptr %97, align 8, !tbaa !14
  %99 = zext i32 %98 to i64
  %100 = inttoptr i64 %99 to ptr
  %101 = icmp uge ptr %93, %100
  br i1 %101, label %102, label %104

102:                                              ; preds = %82
  %103 = load ptr, ptr %3, align 8, !tbaa !5
  call void @lj_state_growstack1(ptr noundef %103)
  br label %104

104:                                              ; preds = %102, %82
  %105 = phi i1 [ false, %82 ], [ false, %102 ]
  %106 = zext i1 %105 to i32
  store i32 0, ptr %7, align 4
  br label %107

107:                                              ; preds = %104, %63, %52
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #5
  %108 = load i32, ptr %7, align 4
  switch i32 %108, label %159 [
    i32 0, label %109
    i32 2, label %110
  ]

109:                                              ; preds = %107
  br label %36

110:                                              ; preds = %107
  %111 = load ptr, ptr %2, align 8, !tbaa !5
  %112 = getelementptr inbounds %struct.LexState, ptr %111, i32 0, i32 5
  %113 = load ptr, ptr %112, align 8, !tbaa !17
  %114 = load ptr, ptr %2, align 8, !tbaa !5
  %115 = getelementptr inbounds %struct.LexState, ptr %114, i32 0, i32 4
  %116 = load ptr, ptr %115, align 8, !tbaa !16
  %117 = ptrtoint ptr %113 to i64
  %118 = ptrtoint ptr %116 to i64
  %119 = sub i64 %117, %118
  %120 = trunc i64 %119 to i32
  %121 = mul i32 2, %120
  %122 = icmp sgt i32 %121, 0
  br i1 %122, label %142, label %123

123:                                              ; preds = %110
  %124 = load ptr, ptr %3, align 8, !tbaa !5
  %125 = getelementptr inbounds %struct.lua_State, ptr %124, i32 0, i32 0
  %126 = getelementptr inbounds %struct.anon.5, ptr %125, i32 0, i32 8
  %127 = load ptr, ptr %126, align 8, !tbaa !14
  %128 = getelementptr inbounds %union.TValue, ptr %127, i64 -1
  %129 = load ptr, ptr %3, align 8, !tbaa !5
  %130 = getelementptr inbounds %struct.lua_State, ptr %129, i32 0, i32 0
  %131 = getelementptr inbounds %struct.anon.5, ptr %130, i32 0, i32 10
  %132 = getelementptr inbounds %struct.MRef, ptr %131, i32 0, i32 0
  %133 = load i32, ptr %132, align 4, !tbaa !14
  %134 = zext i32 %133 to i64
  %135 = inttoptr i64 %134 to ptr
  %136 = load ptr, ptr %2, align 8, !tbaa !5
  %137 = getelementptr inbounds %struct.LexState, ptr %136, i32 0, i32 13
  %138 = load i32, ptr %137, align 4, !tbaa !15
  %139 = sext i32 %138 to i64
  %140 = getelementptr inbounds i8, ptr %135, i64 %139
  %141 = icmp ne ptr %128, %140
  br i1 %141, label %142, label %144

142:                                              ; preds = %123, %110
  %143 = load ptr, ptr %2, align 8, !tbaa !5
  call void @bcread_error(ptr noundef %143, i32 noundef 2972)
  br label %144

144:                                              ; preds = %142, %123
  %145 = load ptr, ptr %3, align 8, !tbaa !5
  %146 = getelementptr inbounds %struct.lua_State, ptr %145, i32 0, i32 0
  %147 = getelementptr inbounds %struct.anon.5, ptr %146, i32 0, i32 8
  %148 = load ptr, ptr %147, align 8, !tbaa !14
  %149 = getelementptr inbounds %union.TValue, ptr %148, i32 -1
  store ptr %149, ptr %147, align 8, !tbaa !14
  %150 = load ptr, ptr %3, align 8, !tbaa !5
  %151 = getelementptr inbounds %struct.lua_State, ptr %150, i32 0, i32 0
  %152 = getelementptr inbounds %struct.anon.5, ptr %151, i32 0, i32 8
  %153 = load ptr, ptr %152, align 8, !tbaa !14
  %154 = getelementptr inbounds %struct.anon, ptr %153, i32 0, i32 0
  %155 = getelementptr inbounds %struct.GCRef, ptr %154, i32 0, i32 0
  %156 = load i32, ptr %155, align 8, !tbaa !14
  %157 = zext i32 %156 to i64
  %158 = inttoptr i64 %157 to ptr
  store i32 1, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #5
  ret ptr %158

159:                                              ; preds = %107
  unreachable
}

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

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

; Function Attrs: noinline nounwind uwtable
declare hidden void @bcread_error(ptr noundef, i32 noundef) #3

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

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

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

declare hidden void @lj_state_growstack1(ptr noundef) #4

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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { noinline 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 = !{!10, !6, i64 8}
!10 = !{!"LexState", !6, i64 0, !6, i64 8, !7, i64 16, !7, i64 24, !6, i64 32, !6, i64 40, !11, i64 48, !11, i64 52, !11, i64 56, !12, i64 60, !6, i64 80, !6, i64 88, !11, i64 96, !11, i64 100, !6, i64 104, !6, i64 112, !6, i64 120, !6, i64 128, !11, i64 136, !11, i64 140, !6, i64 144, !11, i64 152, !11, i64 156}
!11 = !{!"int", !7, i64 0}
!12 = !{!"SBuf", !13, i64 0, !13, i64 4, !13, i64 8, !13, i64 12}
!13 = !{!"MRef", !11, i64 0}
!14 = !{!7, !7, i64 0}
!15 = !{!10, !11, i64 100}
!16 = !{!10, !6, i64 32}
!17 = !{!10, !6, i64 40}
!18 = !{!11, !11, i64 0}


; 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 ptr @lj_bcread_proto(ptr noundef) local_unnamed_addr #0

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

; Function Attrs: nounwind uwtable
define hidden ptr @lj_bcread(ptr noundef %0) local_unnamed_addr #0 {
  %2 = getelementptr inbounds i8, ptr %0, i64 8
  %3 = load ptr, ptr %2, align 8, !tbaa !5
  %4 = getelementptr inbounds i8, ptr %3, i64 24
  %5 = load ptr, ptr %4, align 8, !tbaa !13
  %6 = getelementptr inbounds i8, ptr %3, i64 36
  %7 = load i32, ptr %6, align 4, !tbaa !13
  %8 = ptrtoint ptr %5 to i64
  %9 = trunc i64 %8 to i32
  %10 = sub i32 %9, %7
  %11 = getelementptr inbounds i8, ptr %0, i64 100
  store i32 %10, ptr %11, align 4, !tbaa !14
  %12 = getelementptr inbounds i8, ptr %0, i64 60
  tail call void @lj_buf_reset(ptr noundef nonnull %12)
  %13 = tail call i32 @bcread_header(ptr noundef %0)
  %.not = icmp eq i32 %13, 0
  br i1 %.not, label %14, label %15

14:                                               ; preds = %1
  tail call void @bcread_error(ptr noundef nonnull %0, i32 noundef 2938)
  br label %15

15:                                               ; preds = %14, %1
  %16 = getelementptr inbounds i8, ptr %0, i64 32
  %17 = getelementptr inbounds i8, ptr %0, i64 40
  %18 = getelementptr inbounds i8, ptr %3, i64 32
  br label %19

19:                                               ; preds = %.backedge, %15
  %20 = load ptr, ptr %16, align 8, !tbaa !15
  %21 = load ptr, ptr %17, align 8, !tbaa !16
  %22 = icmp ult ptr %20, %21
  br i1 %22, label %23, label %28

23:                                               ; preds = %19
  %24 = load i8, ptr %20, align 1, !tbaa !13
  %25 = icmp eq i8 %24, 0
  br i1 %25, label %26, label %28

26:                                               ; preds = %23
  %27 = getelementptr inbounds i8, ptr %20, i64 1
  store ptr %27, ptr %16, align 8, !tbaa !15
  br label %45

28:                                               ; preds = %23, %19
  tail call void @bcread_want(ptr noundef nonnull %0, i32 noundef 5)
  %29 = tail call i32 @bcread_uleb128(ptr noundef nonnull %0)
  %.not38 = icmp eq i32 %29, 0
  br i1 %.not38, label %.loopexit, label %30

30:                                               ; preds = %28
  tail call void @bcread_need(ptr noundef nonnull %0, i32 noundef %29)
  %31 = load ptr, ptr %16, align 8, !tbaa !15
  %32 = tail call ptr @lj_bcread_proto(ptr noundef nonnull %0)
  %33 = load ptr, ptr %16, align 8, !tbaa !15
  %34 = zext i32 %29 to i64
  %35 = getelementptr inbounds i8, ptr %31, i64 %34
  %.not39 = icmp eq ptr %33, %35
  br i1 %.not39, label %37, label %36

36:                                               ; preds = %30
  tail call void @bcread_error(ptr noundef nonnull %0, i32 noundef 2972)
  br label %37

37:                                               ; preds = %36, %30
  %38 = load ptr, ptr %4, align 8, !tbaa !13
  tail call void @setprotoV(ptr noundef nonnull %3, ptr noundef %38, ptr noundef %32)
  %39 = load ptr, ptr %4, align 8, !tbaa !13
  %40 = getelementptr inbounds i8, ptr %39, i64 8
  store ptr %40, ptr %4, align 8, !tbaa !13
  %41 = load i32, ptr %18, align 8, !tbaa !13
  %42 = zext i32 %41 to i64
  %43 = inttoptr i64 %42 to ptr
  %.not40 = icmp ult ptr %40, %43
  br i1 %.not40, label %.backedge, label %44

.backedge:                                        ; preds = %37, %44
  br label %19

44:                                               ; preds = %37
  tail call void @lj_state_growstack1(ptr noundef nonnull %3) #4
  br label %.backedge

.loopexit:                                        ; preds = %28
  %.pre = load ptr, ptr %17, align 8, !tbaa !16
  %.pre50 = load ptr, ptr %16, align 8, !tbaa !15
  br label %45

45:                                               ; preds = %.loopexit, %26
  %46 = phi ptr [ %.pre50, %.loopexit ], [ %27, %26 ]
  %47 = phi ptr [ %.pre, %.loopexit ], [ %21, %26 ]
  %48 = ptrtoint ptr %47 to i64
  %49 = ptrtoint ptr %46 to i64
  %50 = sub i64 %48, %49
  %51 = trunc i64 %50 to i32
  %52 = shl i32 %51, 1
  %53 = icmp sgt i32 %52, 0
  br i1 %53, label %63, label %54

54:                                               ; preds = %45
  %55 = load ptr, ptr %4, align 8, !tbaa !13
  %56 = getelementptr inbounds i8, ptr %55, i64 -8
  %57 = load i32, ptr %6, align 4, !tbaa !13
  %58 = zext i32 %57 to i64
  %59 = inttoptr i64 %58 to ptr
  %60 = load i32, ptr %11, align 4, !tbaa !14
  %61 = sext i32 %60 to i64
  %62 = getelementptr inbounds i8, ptr %59, i64 %61
  %.not41 = icmp eq ptr %56, %62
  br i1 %.not41, label %64, label %63

63:                                               ; preds = %54, %45
  tail call void @bcread_error(ptr noundef nonnull %0, i32 noundef 2972)
  %.pre51 = load ptr, ptr %4, align 8, !tbaa !13
  br label %64

64:                                               ; preds = %63, %54
  %65 = phi ptr [ %.pre51, %63 ], [ %55, %54 ]
  %66 = getelementptr inbounds i8, ptr %65, i64 -8
  store ptr %66, ptr %4, align 8, !tbaa !13
  %67 = load i32, ptr %66, align 8, !tbaa !13
  %68 = zext i32 %67 to i64
  %69 = inttoptr i64 %68 to ptr
  ret ptr %69
}

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

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

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

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

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

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

declare hidden void @lj_state_growstack1(ptr 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 = { 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 = { noinline 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, !7, i64 8}
!6 = !{!"LexState", !7, i64 0, !7, i64 8, !8, i64 16, !8, i64 24, !7, i64 32, !7, i64 40, !10, i64 48, !10, i64 52, !10, i64 56, !11, i64 60, !7, i64 80, !7, i64 88, !10, i64 96, !10, i64 100, !7, i64 104, !7, i64 112, !7, i64 120, !7, i64 128, !10, i64 136, !10, i64 140, !7, i64 144, !10, i64 152, !10, i64 156}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!"SBuf", !12, i64 0, !12, i64 4, !12, i64 8, !12, i64 12}
!12 = !{!"MRef", !10, i64 0}
!13 = !{!8, !8, i64 0}
!14 = !{!6, !10, i64 100}
!15 = !{!6, !7, i64 32}
!16 = !{!6, !7, i64 40}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass,TailCallElimPass