; LLVM IR from seppo0010/rlite :: src (scripting)

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

@.str.18 = external hidden unnamed_addr constant [44 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [45 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [21 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local void @rliteLogRaw(i32 noundef, 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: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1

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

; Function Attrs: nounwind allocsize(0)
declare noalias ptr @malloc(i64 noundef) #2

; Function Attrs: nounwind
declare void @free(ptr noundef) #3

declare i32 @lua_gettop(ptr noundef) #4

declare double @lua_tonumber(ptr noundef, i32 noundef) #4

declare ptr @lua_tolstring(ptr noundef, i32 noundef, ptr noundef) #4

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

16:                                               ; preds = %1
  %17 = load ptr, ptr %3, align 8, !tbaa !5
  call void @luaPushError(ptr noundef %17, ptr noundef @.str.18)
  store i32 1, ptr %2, align 4
  store i32 1, ptr %10, align 4
  br label %144

18:                                               ; preds = %1
  %19 = load ptr, ptr %3, align 8, !tbaa !5
  %20 = load i32, ptr %5, align 4, !tbaa !9
  %21 = sub nsw i32 0, %20
  %22 = call i32 @lua_isnumber(ptr noundef %19, i32 noundef %21)
  %23 = icmp ne i32 %22, 0
  br i1 %23, label %26, label %24

24:                                               ; preds = %18
  %25 = load ptr, ptr %3, align 8, !tbaa !5
  call void @luaPushError(ptr noundef %25, ptr noundef @.str.19)
  store i32 1, ptr %2, align 4
  store i32 1, ptr %10, align 4
  br label %144

26:                                               ; preds = %18
  br label %27

27:                                               ; preds = %26
  %28 = load ptr, ptr %3, align 8, !tbaa !5
  %29 = load i32, ptr %5, align 4, !tbaa !9
  %30 = sub nsw i32 0, %29
  %31 = call double @lua_tonumber(ptr noundef %28, i32 noundef %30)
  %32 = fptosi double %31 to i32
  store i32 %32, ptr %6, align 4, !tbaa !9
  %33 = load i32, ptr %6, align 4, !tbaa !9
  %34 = icmp slt i32 %33, 0
  br i1 %34, label %38, label %35

35:                                               ; preds = %27
  %36 = load i32, ptr %6, align 4, !tbaa !9
  %37 = icmp sgt i32 %36, 3
  br i1 %37, label %38, label %40

38:                                               ; preds = %35, %27
  %39 = load ptr, ptr %3, align 8, !tbaa !5
  call void @luaPushError(ptr noundef %39, ptr noundef @.str.20)
  store i32 1, ptr %2, align 4
  store i32 1, ptr %10, align 4
  br label %144

40:                                               ; preds = %35
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  store i64 0, ptr %11, align 8, !tbaa !11
  %41 = load i32, ptr %5, align 4, !tbaa !9
  %42 = sub nsw i32 %41, 1
  %43 = sext i32 %42 to i64
  %44 = mul i64 8, %43
  %45 = call noalias ptr @malloc(i64 noundef %44) #7
  store ptr %45, ptr %8, align 8, !tbaa !5
  %46 = load ptr, ptr %8, align 8, !tbaa !5
  %47 = icmp ne ptr %46, null
  br i1 %47, label %49, label %48

48:                                               ; preds = %40
  store i32 1, ptr %2, align 4
  store i32 1, ptr %10, align 4
  br label %143

49:                                               ; preds = %40
  %50 = load i32, ptr %5, align 4, !tbaa !9
  %51 = sub nsw i32 %50, 1
  %52 = sext i32 %51 to i64
  %53 = mul i64 8, %52
  %54 = call noalias ptr @malloc(i64 noundef %53) #7
  store ptr %54, ptr %9, align 8, !tbaa !5
  %55 = load ptr, ptr %9, align 8, !tbaa !5
  %56 = icmp ne ptr %55, null
  br i1 %56, label %59, label %57

57:                                               ; preds = %49
  %58 = load ptr, ptr %8, align 8, !tbaa !5
  call void @free(ptr noundef %58) #6
  store i32 1, ptr %2, align 4
  store i32 1, ptr %10, align 4
  br label %143

59:                                               ; preds = %49
  %60 = load i32, ptr %5, align 4, !tbaa !9
  %61 = sub nsw i32 %60, 1
  %62 = sext i32 %61 to i64
  %63 = mul i64 8, %62
  %64 = call noalias ptr @malloc(i64 noundef %63) #7
  store ptr %64, ptr %9, align 8, !tbaa !5
  store i32 1, ptr %4, align 4, !tbaa !9
  br label %65

65:                                               ; preds = %94, %59
  %66 = load i32, ptr %4, align 4, !tbaa !9
  %67 = load i32, ptr %5, align 4, !tbaa !9
  %68 = icmp slt i32 %66, %67
  br i1 %68, label %69, label %97

69:                                               ; preds = %65
  %70 = load ptr, ptr %3, align 8, !tbaa !5
  %71 = load i32, ptr %5, align 4, !tbaa !9
  %72 = sub nsw i32 0, %71
  %73 = load i32, ptr %4, align 4, !tbaa !9
  %74 = add nsw i32 %72, %73
  %75 = load ptr, ptr %9, align 8, !tbaa !5
  %76 = load i32, ptr %4, align 4, !tbaa !9
  %77 = sub nsw i32 %76, 1
  %78 = sext i32 %77 to i64
  %79 = getelementptr inbounds i64, ptr %75, i64 %78
  %80 = call ptr @lua_tolstring(ptr noundef %70, i32 noundef %74, ptr noundef %79)
  %81 = load ptr, ptr %8, align 8, !tbaa !5
  %82 = load i32, ptr %4, align 4, !tbaa !9
  %83 = sub nsw i32 %82, 1
  %84 = sext i32 %83 to i64
  %85 = getelementptr inbounds ptr, ptr %81, i64 %84
  store ptr %80, ptr %85, align 8, !tbaa !5
  %86 = load ptr, ptr %9, align 8, !tbaa !5
  %87 = load i32, ptr %4, align 4, !tbaa !9
  %88 = sub nsw i32 %87, 1
  %89 = sext i32 %88 to i64
  %90 = getelementptr inbounds i64, ptr %86, i64 %89
  %91 = load i64, ptr %90, align 8, !tbaa !11
  %92 = load i64, ptr %11, align 8, !tbaa !11
  %93 = add i64 %92, %91
  store i64 %93, ptr %11, align 8, !tbaa !11
  br label %94

94:                                               ; preds = %69
  %95 = load i32, ptr %4, align 4, !tbaa !9
  %96 = add nsw i32 %95, 1
  store i32 %96, ptr %4, align 4, !tbaa !9
  br label %65, !llvm.loop !13

97:                                               ; preds = %65
  %98 = load i64, ptr %11, align 8, !tbaa !11
  %99 = add i64 %98, 1
  %100 = mul i64 1, %99
  %101 = call noalias ptr @malloc(i64 noundef %100) #7
  store ptr %101, ptr %7, align 8, !tbaa !5
  %102 = load ptr, ptr %7, align 8, !tbaa !5
  %103 = icmp ne ptr %102, null
  br i1 %103, label %107, label %104

104:                                              ; preds = %97
  %105 = load ptr, ptr %8, align 8, !tbaa !5
  call void @free(ptr noundef %105) #6
  %106 = load ptr, ptr %9, align 8, !tbaa !5
  call void @free(ptr noundef %106) #6
  store i32 1, ptr %2, align 4
  store i32 1, ptr %10, align 4
  br label %143

107:                                              ; preds = %97
  store i64 0, ptr %11, align 8, !tbaa !11
  store i32 0, ptr %4, align 4, !tbaa !9
  br label %108

108:                                              ; preds = %134, %107
  %109 = load i32, ptr %4, align 4, !tbaa !9
  %110 = load i32, ptr %5, align 4, !tbaa !9
  %111 = sub nsw i32 %110, 1
  %112 = icmp slt i32 %109, %111
  br i1 %112, label %113, label %137

113:                                              ; preds = %108
  %114 = load ptr, ptr %7, align 8, !tbaa !5
  %115 = load i64, ptr %11, align 8, !tbaa !11
  %116 = getelementptr inbounds i8, ptr %114, i64 %115
  %117 = load ptr, ptr %8, align 8, !tbaa !5
  %118 = load i32, ptr %4, align 4, !tbaa !9
  %119 = sext i32 %118 to i64
  %120 = getelementptr inbounds ptr, ptr %117, i64 %119
  %121 = load ptr, ptr %120, align 8, !tbaa !5
  %122 = load ptr, ptr %9, align 8, !tbaa !5
  %123 = load i32, ptr %4, align 4, !tbaa !9
  %124 = sext i32 %123 to i64
  %125 = getelementptr inbounds i64, ptr %122, i64 %124
  %126 = load i64, ptr %125, align 8, !tbaa !11
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %116, ptr align 1 %121, i64 %126, i1 false)
  %127 = load ptr, ptr %9, align 8, !tbaa !5
  %128 = load i32, ptr %4, align 4, !tbaa !9
  %129 = sext i32 %128 to i64
  %130 = getelementptr inbounds i64, ptr %127, i64 %129
  %131 = load i64, ptr %130, align 8, !tbaa !11
  %132 = load i64, ptr %11, align 8, !tbaa !11
  %133 = add i64 %132, %131
  store i64 %133, ptr %11, align 8, !tbaa !11
  br label %134

134:                                              ; preds = %113
  %135 = load i32, ptr %4, align 4, !tbaa !9
  %136 = add nsw i32 %135, 1
  store i32 %136, ptr %4, align 4, !tbaa !9
  br label %108, !llvm.loop !15

137:                                              ; preds = %108
  %138 = load ptr, ptr %7, align 8, !tbaa !5
  %139 = load i64, ptr %11, align 8, !tbaa !11
  %140 = getelementptr inbounds i8, ptr %138, i64 %139
  store i8 0, ptr %140, align 1, !tbaa !16
  %141 = load i32, ptr %6, align 4, !tbaa !9
  %142 = load ptr, ptr %7, align 8, !tbaa !5
  call void (i32, ptr, ...) @rliteLogRaw(i32 noundef %141, ptr noundef %142)
  store i32 0, ptr %2, align 4
  store i32 1, ptr %10, align 4
  br label %143

143:                                              ; preds = %137, %104, %57, %48
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  br label %144

144:                                              ; preds = %143, %38, %24, %16
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  %145 = load i32, ptr %2, align 4
  ret i32 %145
}

declare i32 @lua_isnumber(ptr noundef, i32 noundef) #4

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #5

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 = { nounwind allocsize(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 = { nounwind "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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #6 = { nounwind }
attributes #7 = { nounwind allocsize(0) }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}
!16 = !{!7, !7, 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"

@.str.18 = external hidden unnamed_addr constant [44 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [45 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [21 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local void @rliteLogRaw(i32 noundef, ptr noundef, ...) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local void @luaPushError(ptr noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #1

; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #2

declare i32 @lua_gettop(ptr noundef) local_unnamed_addr #3

declare double @lua_tonumber(ptr noundef, i32 noundef) local_unnamed_addr #3

declare ptr @lua_tolstring(ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #3

; Function Attrs: nounwind uwtable
define dso_local range(i32 0, 2) i32 @luaLogCommand(ptr noundef %0) local_unnamed_addr #0 {
  %2 = tail call i32 @lua_gettop(ptr noundef %0) #6
  %3 = icmp slt i32 %2, 2
  br i1 %3, label %4, label %5

4:                                                ; preds = %1
  tail call void @luaPushError(ptr noundef %0, ptr noundef nonnull @.str.18)
  br label %50

5:                                                ; preds = %1
  %6 = sub nsw i32 0, %2
  %7 = tail call i32 @lua_isnumber(ptr noundef %0, i32 noundef %6) #6
  %.not = icmp eq i32 %7, 0
  br i1 %.not, label %8, label %9

8:                                                ; preds = %5
  tail call void @luaPushError(ptr noundef %0, ptr noundef nonnull @.str.19)
  br label %50

9:                                                ; preds = %5
  %10 = tail call double @lua_tonumber(ptr noundef %0, i32 noundef %6) #6
  %11 = fptosi double %10 to i32
  %or.cond = icmp ugt i32 %11, 3
  br i1 %or.cond, label %12, label %13

12:                                               ; preds = %9
  tail call void @luaPushError(ptr noundef %0, ptr noundef nonnull @.str.20)
  br label %50

13:                                               ; preds = %9
  %14 = add nsw i32 %2, -1
  %15 = zext nneg i32 %14 to i64
  %16 = shl nuw nsw i64 %15, 3
  %17 = tail call noalias ptr @malloc(i64 noundef %16) #7
  %.not59 = icmp eq ptr %17, null
  br i1 %.not59, label %50, label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %13
  %18 = tail call noalias ptr @malloc(i64 noundef %16) #7
  %wide.trip.count = zext nneg i32 %2 to i64
  br label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph.preheader, %.lr.ph
  %indvars.iv = phi i64 [ 1, %.lr.ph.preheader ], [ %indvars.iv.next, %.lr.ph ]
  %.062 = phi i64 [ 0, %.lr.ph.preheader ], [ %26, %.lr.ph ]
  %19 = add nsw i64 %indvars.iv, -1
  %20 = getelementptr inbounds i64, ptr %18, i64 %19
  %21 = trunc i64 %indvars.iv to i32
  %22 = sub i32 %21, %2
  %23 = tail call ptr @lua_tolstring(ptr noundef %0, i32 noundef %22, ptr noundef %20) #6
  %24 = getelementptr inbounds ptr, ptr %17, i64 %19
  store ptr %23, ptr %24, align 8, !tbaa !5
  %25 = load i64, ptr %20, align 8, !tbaa !9
  %26 = add i64 %25, %.062
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph, !llvm.loop !11

._crit_edge:                                      ; preds = %.lr.ph
  %27 = add i64 %26, 1
  %28 = tail call noalias ptr @malloc(i64 noundef %27) #7
  %.not60 = icmp eq ptr %28, null
  br i1 %.not60, label %30, label %.lr.ph65.preheader

.lr.ph65.preheader:                               ; preds = %._crit_edge
  %smax = tail call i32 @llvm.smax.i32(i32 %14, i32 1)
  %wide.trip.count73 = zext nneg i32 %smax to i64
  %xtraiter = and i64 %wide.trip.count73, 1
  %29 = icmp eq i32 %2, 2
  br i1 %29, label %._crit_edge66.unr-lcssa, label %.lr.ph65.preheader.new

.lr.ph65.preheader.new:                           ; preds = %.lr.ph65.preheader
  %unroll_iter = and i64 %wide.trip.count73, 2147483646
  br label %.lr.ph65

30:                                               ; preds = %._crit_edge
  tail call void @free(ptr noundef nonnull %17) #6
  tail call void @free(ptr noundef nonnull %18) #6
  br label %50

.lr.ph65:                                         ; preds = %.lr.ph65, %.lr.ph65.preheader.new
  %indvars.iv70 = phi i64 [ 0, %.lr.ph65.preheader.new ], [ %indvars.iv.next71.1, %.lr.ph65 ]
  %.164 = phi i64 [ 0, %.lr.ph65.preheader.new ], [ %42, %.lr.ph65 ]
  %niter = phi i64 [ 0, %.lr.ph65.preheader.new ], [ %niter.next.1, %.lr.ph65 ]
  %31 = getelementptr inbounds i8, ptr %28, i64 %.164
  %32 = getelementptr inbounds ptr, ptr %17, i64 %indvars.iv70
  %33 = load ptr, ptr %32, align 8, !tbaa !5
  %34 = getelementptr inbounds i64, ptr %18, i64 %indvars.iv70
  %35 = load i64, ptr %34, align 8, !tbaa !9
  tail call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 1 %31, ptr align 1 %33, i64 %35, i1 false)
  %36 = add i64 %35, %.164
  %indvars.iv.next71 = or disjoint i64 %indvars.iv70, 1
  %37 = getelementptr inbounds i8, ptr %28, i64 %36
  %38 = getelementptr inbounds ptr, ptr %17, i64 %indvars.iv.next71
  %39 = load ptr, ptr %38, align 8, !tbaa !5
  %40 = getelementptr inbounds i64, ptr %18, i64 %indvars.iv.next71
  %41 = load i64, ptr %40, align 8, !tbaa !9
  tail call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 1 %37, ptr align 1 %39, i64 %41, i1 false)
  %42 = add i64 %41, %36
  %indvars.iv.next71.1 = add nuw nsw i64 %indvars.iv70, 2
  %niter.next.1 = add i64 %niter, 2
  %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
  br i1 %niter.ncmp.1, label %._crit_edge66.unr-lcssa, label %.lr.ph65, !llvm.loop !13

._crit_edge66.unr-lcssa:                          ; preds = %.lr.ph65, %.lr.ph65.preheader
  %.lcssa.ph = phi i64 [ poison, %.lr.ph65.preheader ], [ %42, %.lr.ph65 ]
  %indvars.iv70.unr = phi i64 [ 0, %.lr.ph65.preheader ], [ %indvars.iv.next71.1, %.lr.ph65 ]
  %.164.unr = phi i64 [ 0, %.lr.ph65.preheader ], [ %42, %.lr.ph65 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge66, label %.lr.ph65.epil

.lr.ph65.epil:                                    ; preds = %._crit_edge66.unr-lcssa
  %43 = getelementptr inbounds i8, ptr %28, i64 %.164.unr
  %44 = getelementptr inbounds ptr, ptr %17, i64 %indvars.iv70.unr
  %45 = load ptr, ptr %44, align 8, !tbaa !5
  %46 = getelementptr inbounds i64, ptr %18, i64 %indvars.iv70.unr
  %47 = load i64, ptr %46, align 8, !tbaa !9
  tail call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 1 %43, ptr align 1 %45, i64 %47, i1 false)
  %48 = add i64 %47, %.164.unr
  br label %._crit_edge66

._crit_edge66:                                    ; preds = %._crit_edge66.unr-lcssa, %.lr.ph65.epil
  %.lcssa = phi i64 [ %.lcssa.ph, %._crit_edge66.unr-lcssa ], [ %48, %.lr.ph65.epil ]
  %49 = getelementptr inbounds i8, ptr %28, i64 %.lcssa
  store i8 0, ptr %49, align 1, !tbaa !14
  tail call void (i32, ptr, ...) @rliteLogRaw(i32 noundef %11, ptr noundef nonnull %28)
  br label %50

50:                                               ; preds = %30, %._crit_edge66, %13, %12, %8, %4
  %.152 = phi i32 [ 1, %4 ], [ 1, %12 ], [ 1, %8 ], [ 0, %._crit_edge66 ], [ 1, %30 ], [ 1, %13 ]
  ret i32 %.152
}

declare i32 @lua_isnumber(ptr noundef, i32 noundef) local_unnamed_addr #3

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #4

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #5

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 nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "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 = { mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { nounwind }
attributes #7 = { nounwind allocsize(0) }

!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 = !{!"long", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = !{!7, !7, i64 0}


; Effective O3 passes: BDCEPass,CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SCCPPass,SROAPass,SimplifyCFGPass,TailCallElimPass