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

; 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.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.GCRef = type { i32 }
%struct.IRType1 = type { i8 }
%struct.FoldState = type { %union.IRIns, %union.IRIns, %union.IRIns }
%union.IRIns = type { %struct.anon.0 }
%struct.anon.0 = type { i32, %struct.IRType1, i8, i8, i8 }
%struct.MRef = type { i32 }
%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 }
%union.TValue = type { i64 }
%struct.anon = type { i16, i16, i16, i16 }

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

declare hidden i32 @lj_ir_emit(ptr noundef) #1

; 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 i32 @aa_ahref(ptr noundef, ptr noundef, ptr noundef) #2

; Function Attrs: nounwind uwtable
define hidden i32 @lj_opt_dse_ahstore(ptr noundef %0) #2 {
  %2 = alloca i32, align 4
  %3 = alloca ptr, align 8
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca ptr, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #3
  %12 = load ptr, ptr %3, align 8, !tbaa !5
  %13 = getelementptr inbounds %struct.jit_State, ptr %12, i32 0, i32 13
  %14 = getelementptr inbounds %struct.FoldState, ptr %13, i32 0, i32 0
  %15 = getelementptr inbounds %struct.anon, ptr %14, i32 0, i32 0
  %16 = load i16, ptr %15, align 8, !tbaa !9
  %17 = zext i16 %16 to i32
  store i32 %17, ptr %4, align 4, !tbaa !10
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #3
  %18 = load ptr, ptr %3, align 8, !tbaa !5
  %19 = getelementptr inbounds %struct.jit_State, ptr %18, i32 0, i32 13
  %20 = getelementptr inbounds %struct.FoldState, ptr %19, i32 0, i32 0
  %21 = getelementptr inbounds %struct.anon, ptr %20, i32 0, i32 1
  %22 = load i16, ptr %21, align 2, !tbaa !9
  %23 = zext i16 %22 to i32
  store i32 %23, ptr %5, align 4, !tbaa !10
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #3
  %24 = load ptr, ptr %3, align 8, !tbaa !5
  %25 = getelementptr inbounds %struct.jit_State, ptr %24, i32 0, i32 0
  %26 = getelementptr inbounds %struct.GCtrace, ptr %25, i32 0, i32 7
  %27 = load ptr, ptr %26, align 8, !tbaa !12
  %28 = load i32, ptr %4, align 4, !tbaa !10
  %29 = zext i32 %28 to i64
  %30 = getelementptr inbounds %union.IRIns, ptr %27, i64 %29
  store ptr %30, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #3
  %31 = load ptr, ptr %3, align 8, !tbaa !5
  %32 = getelementptr inbounds %struct.jit_State, ptr %31, i32 0, i32 38
  %33 = load ptr, ptr %3, align 8, !tbaa !5
  %34 = getelementptr inbounds %struct.jit_State, ptr %33, i32 0, i32 13
  %35 = getelementptr inbounds %struct.FoldState, ptr %34, i32 0, i32 0
  %36 = getelementptr inbounds %struct.anon.0, ptr %35, i32 0, i32 2
  %37 = load i8, ptr %36, align 1, !tbaa !9
  %38 = zext i8 %37 to i64
  %39 = getelementptr inbounds [100 x i16], ptr %32, i64 0, i64 %38
  store ptr %39, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #3
  %40 = load ptr, ptr %7, align 8, !tbaa !5
  %41 = load i16, ptr %40, align 2, !tbaa !22
  %42 = zext i16 %41 to i32
  store i32 %42, ptr %8, align 4, !tbaa !10
  br label %43

43:                                               ; preds = %154, %1
  %44 = load i32, ptr %8, align 4, !tbaa !10
  %45 = load i32, ptr %4, align 4, !tbaa !10
  %46 = icmp ugt i32 %44, %45
  br i1 %46, label %47, label %155

47:                                               ; preds = %43
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #3
  %48 = load ptr, ptr %3, align 8, !tbaa !5
  %49 = getelementptr inbounds %struct.jit_State, ptr %48, i32 0, i32 0
  %50 = getelementptr inbounds %struct.GCtrace, ptr %49, i32 0, i32 7
  %51 = load ptr, ptr %50, align 8, !tbaa !12
  %52 = load i32, ptr %8, align 4, !tbaa !10
  %53 = zext i32 %52 to i64
  %54 = getelementptr inbounds %union.IRIns, ptr %51, i64 %53
  store ptr %54, ptr %9, align 8, !tbaa !5
  %55 = load ptr, ptr %3, align 8, !tbaa !5
  %56 = load ptr, ptr %6, align 8, !tbaa !5
  %57 = load ptr, ptr %3, align 8, !tbaa !5
  %58 = getelementptr inbounds %struct.jit_State, ptr %57, i32 0, i32 0
  %59 = getelementptr inbounds %struct.GCtrace, ptr %58, i32 0, i32 7
  %60 = load ptr, ptr %59, align 8, !tbaa !12
  %61 = load ptr, ptr %9, align 8, !tbaa !5
  %62 = getelementptr inbounds %struct.anon, ptr %61, i32 0, i32 0
  %63 = load i16, ptr %62, align 4, !tbaa !9
  %64 = zext i16 %63 to i64
  %65 = getelementptr inbounds %union.IRIns, ptr %60, i64 %64
  %66 = call i32 @aa_ahref(ptr noundef %55, ptr noundef %56, ptr noundef %65)
  switch i32 %66, label %147 [
    i32 0, label %147
    i32 1, label %67
    i32 2, label %76
  ]

67:                                               ; preds = %47
  %68 = load ptr, ptr %9, align 8, !tbaa !5
  %69 = getelementptr inbounds %struct.anon, ptr %68, i32 0, i32 1
  %70 = load i16, ptr %69, align 2, !tbaa !9
  %71 = zext i16 %70 to i32
  %72 = load i32, ptr %5, align 4, !tbaa !10
  %73 = icmp ne i32 %71, %72
  br i1 %73, label %74, label %75

74:                                               ; preds = %67
  store i32 5, ptr %10, align 4
  br label %152

75:                                               ; preds = %67
  br label %147

76:                                               ; preds = %47
  %77 = load ptr, ptr %9, align 8, !tbaa !5
  %78 = getelementptr inbounds %struct.anon, ptr %77, i32 0, i32 1
  %79 = load i16, ptr %78, align 2, !tbaa !9
  %80 = zext i16 %79 to i32
  %81 = load i32, ptr %5, align 4, !tbaa !10
  %82 = icmp eq i32 %80, %81
  br i1 %82, label %83, label %84

83:                                               ; preds = %76
  store i32 4, ptr %2, align 4
  store i32 1, ptr %10, align 4
  br label %152

84:                                               ; preds = %76
  %85 = load i32, ptr %8, align 4, !tbaa !10
  %86 = load ptr, ptr %3, align 8, !tbaa !5
  %87 = getelementptr inbounds %struct.jit_State, ptr %86, i32 0, i32 38
  %88 = getelementptr inbounds [100 x i16], ptr %87, i64 0, i64 17
  %89 = load i16, ptr %88, align 2, !tbaa !22
  %90 = zext i16 %89 to i32
  %91 = icmp ugt i32 %85, %90
  br i1 %91, label %92, label %146

92:                                               ; preds = %84
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #3
  %93 = load ptr, ptr %3, align 8, !tbaa !5
  %94 = getelementptr inbounds %struct.jit_State, ptr %93, i32 0, i32 0
  %95 = getelementptr inbounds %struct.GCtrace, ptr %94, i32 0, i32 7
  %96 = load ptr, ptr %95, align 8, !tbaa !12
  %97 = load ptr, ptr %3, align 8, !tbaa !5
  %98 = getelementptr inbounds %struct.jit_State, ptr %97, i32 0, i32 0
  %99 = getelementptr inbounds %struct.GCtrace, ptr %98, i32 0, i32 5
  %100 = load i32, ptr %99, align 8, !tbaa !23
  %101 = sub i32 %100, 1
  %102 = zext i32 %101 to i64
  %103 = getelementptr inbounds %union.IRIns, ptr %96, i64 %102
  store ptr %103, ptr %11, align 8, !tbaa !5
  br label %104

104:                                              ; preds = %124, %92
  %105 = load ptr, ptr %11, align 8, !tbaa !5
  %106 = load ptr, ptr %9, align 8, !tbaa !5
  %107 = icmp ugt ptr %105, %106
  br i1 %107, label %108, label %127

108:                                              ; preds = %104
  %109 = load ptr, ptr %11, align 8, !tbaa !5
  %110 = getelementptr inbounds %struct.anon.0, ptr %109, i32 0, i32 1
  %111 = getelementptr inbounds %struct.IRType1, ptr %110, i32 0, i32 0
  %112 = load i8, ptr %111, align 4, !tbaa !9
  %113 = zext i8 %112 to i32
  %114 = and i32 %113, 128
  %115 = icmp ne i32 %114, 0
  br i1 %115, label %122, label %116

116:                                              ; preds = %108
  %117 = load ptr, ptr %11, align 8, !tbaa !5
  %118 = getelementptr inbounds %struct.anon.0, ptr %117, i32 0, i32 2
  %119 = load i8, ptr %118, align 1, !tbaa !9
  %120 = zext i8 %119 to i32
  %121 = icmp eq i32 %120, 96
  br i1 %121, label %122, label %123

122:                                              ; preds = %116, %108
  store i32 5, ptr %10, align 4
  br label %143

123:                                              ; preds = %116
  br label %124

124:                                              ; preds = %123
  %125 = load ptr, ptr %11, align 8, !tbaa !5
  %126 = getelementptr inbounds %union.IRIns, ptr %125, i32 -1
  store ptr %126, ptr %11, align 8, !tbaa !5
  br label %104, !llvm.loop !24

127:                                              ; preds = %104
  %128 = load ptr, ptr %9, align 8, !tbaa !5
  %129 = getelementptr inbounds %struct.anon, ptr %128, i32 0, i32 3
  %130 = load i16, ptr %129, align 2, !tbaa !9
  %131 = load ptr, ptr %7, align 8, !tbaa !5
  store i16 %130, ptr %131, align 2, !tbaa !22
  %132 = load ptr, ptr %9, align 8, !tbaa !5
  %133 = getelementptr inbounds %struct.anon.0, ptr %132, i32 0, i32 2
  store i8 12, ptr %133, align 1, !tbaa !9
  %134 = load ptr, ptr %9, align 8, !tbaa !5
  %135 = getelementptr inbounds %struct.anon.0, ptr %134, i32 0, i32 1
  %136 = getelementptr inbounds %struct.IRType1, ptr %135, i32 0, i32 0
  store i8 0, ptr %136, align 4, !tbaa !9
  %137 = load ptr, ptr %9, align 8, !tbaa !5
  %138 = getelementptr inbounds %struct.anon, ptr %137, i32 0, i32 1
  store i16 0, ptr %138, align 2, !tbaa !9
  %139 = load ptr, ptr %9, align 8, !tbaa !5
  %140 = getelementptr inbounds %struct.anon, ptr %139, i32 0, i32 0
  store i16 0, ptr %140, align 4, !tbaa !9
  %141 = load ptr, ptr %9, align 8, !tbaa !5
  %142 = getelementptr inbounds %struct.anon, ptr %141, i32 0, i32 3
  store i16 0, ptr %142, align 2, !tbaa !9
  store i32 0, ptr %10, align 4
  br label %143

143:                                              ; preds = %127, %122
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #3
  %144 = load i32, ptr %10, align 4
  switch i32 %144, label %152 [
    i32 0, label %145
  ]

145:                                              ; preds = %143
  br label %146

146:                                              ; preds = %145, %84
  store i32 5, ptr %10, align 4
  br label %152

147:                                              ; preds = %75, %47, %47
  %148 = load ptr, ptr %9, align 8, !tbaa !5
  %149 = getelementptr inbounds %struct.anon, ptr %148, i32 0, i32 3
  store ptr %149, ptr %7, align 8, !tbaa !5
  %150 = load i16, ptr %149, align 2, !tbaa !22
  %151 = zext i16 %150 to i32
  store i32 %151, ptr %8, align 4, !tbaa !10
  store i32 0, ptr %10, align 4
  br label %152

152:                                              ; preds = %147, %146, %143, %83, %74
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #3
  %153 = load i32, ptr %10, align 4
  switch i32 %153, label %159 [
    i32 0, label %154
    i32 5, label %156
  ]

154:                                              ; preds = %152
  br label %43, !llvm.loop !26

155:                                              ; preds = %43
  br label %156

156:                                              ; preds = %155, %152
  %157 = load ptr, ptr %3, align 8, !tbaa !5
  %158 = call i32 @lj_ir_emit(ptr noundef %157)
  store i32 %158, ptr %2, align 4
  store i32 1, ptr %10, align 4
  br label %159

159:                                              ; preds = %156, %152
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #3
  %160 = load i32, ptr %2, align 4
  ret i32 %160
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 = { 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, !11, i64 0}
!11 = !{!"int", !7, i64 0}
!12 = !{!13, !6, i64 16}
!13 = !{!"jit_State", !14, i64 0, !6, i64 96, !6, i64 104, !6, i64 112, !6, i64 120, !6, i64 128, !11, i64 136, !11, i64 140, !11, i64 144, !7, i64 148, !7, i64 149, !18, i64 150, !7, i64 151, !19, i64 152, !6, i64 176, !11, i64 184, !11, i64 188, !11, i64 192, !11, i64 196, !11, i64 200, !11, i64 204, !11, i64 208, !17, i64 212, !7, i64 216, !6, i64 256, !11, i64 264, !11, i64 268, !11, i64 272, !11, i64 276, !6, i64 280, !6, i64 288, !11, i64 296, !11, i64 300, !7, i64 304, !6, i64 312, !11, i64 320, !11, i64 324, !6, i64 328, !7, i64 336, !7, i64 536, !7, i64 1556, !7, i64 1616, !7, i64 1744, !11, i64 2256, !11, i64 2260, !7, i64 2264, !11, i64 2392, !20, i64 2396, !6, i64 2416, !11, i64 2424, !11, i64 2428, !6, i64 2432, !11, i64 2440, !11, i64 2444, !6, i64 2448, !6, i64 2456, !6, i64 2464, !21, i64 2472, !21, i64 2480, !7, i64 2488, !6, i64 2496, !11, i64 2504, !11, i64 2508}
!14 = !{!"GCtrace", !15, i64 0, !7, i64 4, !7, i64 5, !7, i64 6, !7, i64 7, !11, i64 8, !15, i64 12, !6, i64 16, !11, i64 24, !16, i64 28, !16, i64 30, !6, i64 32, !6, i64 40, !15, i64 48, !17, i64 52, !11, i64 56, !11, i64 60, !6, i64 64, !11, i64 72, !16, i64 76, !16, i64 78, !16, i64 80, !16, i64 82, !16, i64 84, !16, i64 86, !16, i64 88, !7, i64 90, !7, i64 91}
!15 = !{!"GCRef", !11, i64 0}
!16 = !{!"short", !7, i64 0}
!17 = !{!"MRef", !11, i64 0}
!18 = !{!"IRType1", !7, i64 0}
!19 = !{!"FoldState", !7, i64 0, !7, i64 8, !7, i64 16}
!20 = !{!"ScEvEntry", !17, i64 0, !16, i64 4, !16, i64 6, !16, i64 8, !16, i64 10, !18, i64 12, !7, i64 13}
!21 = !{!"long", !7, i64 0}
!22 = !{!16, !16, i64 0}
!23 = !{!13, !11, i64 8}
!24 = distinct !{!24, !25}
!25 = !{!"llvm.loop.mustprogress"}
!26 = distinct !{!26, !25}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%union.IRIns = type { %struct.anon.0 }
%struct.anon.0 = type { i32, %struct.IRType1, i8, i8, i8 }
%struct.IRType1 = type { i8 }

declare hidden i32 @lj_ir_emit(ptr noundef) local_unnamed_addr #0

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

; Function Attrs: nounwind uwtable
define hidden i32 @lj_opt_dse_ahstore(ptr noundef %0) local_unnamed_addr #1 {
  %2 = getelementptr inbounds i8, ptr %0, i64 152
  %3 = load i16, ptr %2, align 8, !tbaa !5
  %4 = getelementptr inbounds i8, ptr %0, i64 154
  %5 = load i16, ptr %4, align 2, !tbaa !5
  %6 = getelementptr inbounds i8, ptr %0, i64 16
  %7 = load ptr, ptr %6, align 8, !tbaa !8
  %8 = zext i16 %3 to i64
  %9 = getelementptr inbounds %union.IRIns, ptr %7, i64 %8
  %10 = getelementptr inbounds i8, ptr %0, i64 336
  %11 = getelementptr inbounds i8, ptr %0, i64 157
  %12 = load i8, ptr %11, align 1, !tbaa !5
  %13 = zext i8 %12 to i64
  %14 = getelementptr inbounds [100 x i16], ptr %10, i64 0, i64 %13
  %.042.in62 = load i16, ptr %14, align 2, !tbaa !20
  %15 = icmp ugt i16 %.042.in62, %3
  br i1 %15, label %.lr.ph, label %.thread51

.lr.ph:                                           ; preds = %1, %53
  %.042.in64 = phi i16 [ %.042.in, %53 ], [ %.042.in62, %1 ]
  %.04463 = phi ptr [ %54, %53 ], [ %14, %1 ]
  %16 = load ptr, ptr %6, align 8, !tbaa !8
  %17 = zext i16 %.042.in64 to i64
  %18 = getelementptr inbounds %union.IRIns, ptr %16, i64 %17
  %19 = load i16, ptr %18, align 4, !tbaa !5
  %20 = zext i16 %19 to i64
  %21 = getelementptr inbounds %union.IRIns, ptr %16, i64 %20
  %22 = tail call i32 @aa_ahref(ptr noundef nonnull %0, ptr noundef %9, ptr noundef %21)
  switch i32 %22, label %53 [
    i32 2, label %26
    i32 1, label %23
  ]

23:                                               ; preds = %.lr.ph
  %24 = getelementptr inbounds i8, ptr %18, i64 2
  %25 = load i16, ptr %24, align 2, !tbaa !5
  %.not = icmp eq i16 %25, %5
  br i1 %.not, label %53, label %.thread51

26:                                               ; preds = %.lr.ph
  %27 = getelementptr inbounds i8, ptr %18, i64 2
  %28 = load i16, ptr %27, align 2, !tbaa !5
  %29 = icmp eq i16 %28, %5
  br i1 %29, label %.thread55, label %30

30:                                               ; preds = %26
  %31 = getelementptr inbounds i8, ptr %0, i64 370
  %32 = load i16, ptr %31, align 2, !tbaa !20
  %33 = icmp ugt i16 %.042.in64, %32
  br i1 %33, label %34, label %.thread51

34:                                               ; preds = %30
  %35 = load ptr, ptr %6, align 8, !tbaa !8
  %36 = getelementptr inbounds i8, ptr %0, i64 8
  %37 = load i32, ptr %36, align 8, !tbaa !21
  %38 = add i32 %37, -1
  %39 = zext i32 %38 to i64
  %40 = getelementptr inbounds %union.IRIns, ptr %35, i64 %39
  %.not4866 = icmp ugt ptr %40, %18
  br i1 %.not4866, label %.lr.ph68, label %._crit_edge

41:                                               ; preds = %45
  %42 = getelementptr inbounds i8, ptr %.067, i64 -8
  %.not48 = icmp ugt ptr %42, %18
  br i1 %.not48, label %.lr.ph68, label %._crit_edge, !llvm.loop !22

.lr.ph68:                                         ; preds = %34, %41
  %.067 = phi ptr [ %42, %41 ], [ %40, %34 ]
  %43 = getelementptr inbounds i8, ptr %.067, i64 4
  %44 = load i8, ptr %43, align 4, !tbaa !5
  %.not47 = icmp sgt i8 %44, -1
  br i1 %.not47, label %45, label %.thread51

45:                                               ; preds = %.lr.ph68
  %46 = getelementptr inbounds i8, ptr %.067, i64 5
  %47 = load i8, ptr %46, align 1, !tbaa !5
  %48 = icmp eq i8 %47, 96
  br i1 %48, label %.thread51, label %41

._crit_edge:                                      ; preds = %41, %34
  %49 = getelementptr inbounds i8, ptr %18, i64 6
  %50 = load i16, ptr %49, align 2, !tbaa !5
  store i16 %50, ptr %.04463, align 2, !tbaa !20
  %51 = getelementptr inbounds i8, ptr %18, i64 5
  store i8 12, ptr %51, align 1, !tbaa !5
  %52 = getelementptr inbounds i8, ptr %18, i64 4
  store i8 0, ptr %52, align 4, !tbaa !5
  store i16 0, ptr %27, align 2, !tbaa !5
  store i16 0, ptr %18, align 4, !tbaa !5
  store i16 0, ptr %49, align 2, !tbaa !5
  br label %.thread51

53:                                               ; preds = %.lr.ph, %23
  %54 = getelementptr inbounds i8, ptr %18, i64 6
  %.042.in = load i16, ptr %54, align 2, !tbaa !20
  %55 = icmp ugt i16 %.042.in, %3
  br i1 %55, label %.lr.ph, label %.thread51

.thread51:                                        ; preds = %53, %23, %45, %.lr.ph68, %1, %30, %._crit_edge
  %56 = tail call i32 @lj_ir_emit(ptr noundef %0) #2
  br label %.thread55

.thread55:                                        ; preds = %26, %.thread51
  %.2 = phi i32 [ %56, %.thread51 ], [ 4, %26 ]
  ret i32 %.2
}

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

!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, !13, i64 16}
!9 = !{!"jit_State", !10, i64 0, !13, i64 96, !13, i64 104, !13, i64 112, !13, i64 120, !13, i64 128, !12, i64 136, !12, i64 140, !12, i64 144, !6, i64 148, !6, i64 149, !16, i64 150, !6, i64 151, !17, i64 152, !13, i64 176, !12, i64 184, !12, i64 188, !12, i64 192, !12, i64 196, !12, i64 200, !12, i64 204, !12, i64 208, !15, i64 212, !6, i64 216, !13, i64 256, !12, i64 264, !12, i64 268, !12, i64 272, !12, i64 276, !13, i64 280, !13, i64 288, !12, i64 296, !12, i64 300, !6, i64 304, !13, i64 312, !12, i64 320, !12, i64 324, !13, i64 328, !6, i64 336, !6, i64 536, !6, i64 1556, !6, i64 1616, !6, i64 1744, !12, i64 2256, !12, i64 2260, !6, i64 2264, !12, i64 2392, !18, i64 2396, !13, i64 2416, !12, i64 2424, !12, i64 2428, !13, i64 2432, !12, i64 2440, !12, i64 2444, !13, i64 2448, !13, i64 2456, !13, i64 2464, !19, i64 2472, !19, i64 2480, !6, i64 2488, !13, i64 2496, !12, i64 2504, !12, i64 2508}
!10 = !{!"GCtrace", !11, i64 0, !6, i64 4, !6, i64 5, !6, i64 6, !6, i64 7, !12, i64 8, !11, i64 12, !13, i64 16, !12, i64 24, !14, i64 28, !14, i64 30, !13, i64 32, !13, i64 40, !11, i64 48, !15, i64 52, !12, i64 56, !12, i64 60, !13, i64 64, !12, i64 72, !14, i64 76, !14, i64 78, !14, i64 80, !14, i64 82, !14, i64 84, !14, i64 86, !14, i64 88, !6, i64 90, !6, i64 91}
!11 = !{!"GCRef", !12, i64 0}
!12 = !{!"int", !6, i64 0}
!13 = !{!"any pointer", !6, i64 0}
!14 = !{!"short", !6, i64 0}
!15 = !{!"MRef", !12, i64 0}
!16 = !{!"IRType1", !6, i64 0}
!17 = !{!"FoldState", !6, i64 0, !6, i64 8, !6, i64 16}
!18 = !{!"ScEvEntry", !15, i64 0, !14, i64 4, !14, i64 6, !14, i64 8, !14, i64 10, !16, i64 12, !6, i64 13}
!19 = !{!"long", !6, i64 0}
!20 = !{!14, !14, i64 0}
!21 = !{!9, !12, i64 8}
!22 = distinct !{!22, !23}
!23 = !{!"llvm.loop.mustprogress"}


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