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

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

39:                                               ; preds = %213, %1
  %40 = load i32, ptr %8, align 4, !tbaa !10
  %41 = load i32, ptr %4, align 4, !tbaa !10
  %42 = icmp ugt i32 %40, %41
  br i1 %42, label %43, label %214

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

62:                                               ; preds = %43
  %63 = load ptr, ptr %9, align 8, !tbaa !5
  %64 = getelementptr inbounds %struct.anon, ptr %63, i32 0, i32 1
  %65 = load i16, ptr %64, align 2, !tbaa !9
  %66 = zext i16 %65 to i32
  %67 = load i32, ptr %5, align 4, !tbaa !10
  %68 = icmp ne i32 %66, %67
  br i1 %68, label %69, label %70

69:                                               ; preds = %62
  store i32 5, ptr %10, align 4
  br label %211

70:                                               ; preds = %62
  br label %206

71:                                               ; preds = %43
  %72 = load ptr, ptr %9, align 8, !tbaa !5
  %73 = getelementptr inbounds %struct.anon, ptr %72, i32 0, i32 1
  %74 = load i16, ptr %73, align 2, !tbaa !9
  %75 = zext i16 %74 to i32
  %76 = load i32, ptr %5, align 4, !tbaa !10
  %77 = icmp eq i32 %75, %76
  br i1 %77, label %78, label %79

78:                                               ; preds = %71
  store i32 4, ptr %2, align 4
  store i32 1, ptr %10, align 4
  br label %211

79:                                               ; preds = %71
  %80 = load i32, ptr %8, align 4, !tbaa !10
  %81 = load ptr, ptr %3, align 8, !tbaa !5
  %82 = getelementptr inbounds %struct.jit_State, ptr %81, i32 0, i32 38
  %83 = getelementptr inbounds [100 x i16], ptr %82, i64 0, i64 17
  %84 = load i16, ptr %83, align 2, !tbaa !22
  %85 = zext i16 %84 to i32
  %86 = icmp ugt i32 %80, %85
  br i1 %86, label %87, label %205

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

99:                                               ; preds = %113, %87
  %100 = load ptr, ptr %11, align 8, !tbaa !5
  %101 = load ptr, ptr %9, align 8, !tbaa !5
  %102 = icmp ugt ptr %100, %101
  br i1 %102, label %103, label %116

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

111:                                              ; preds = %103
  store i32 5, ptr %10, align 4
  br label %202

112:                                              ; preds = %103
  br label %113

113:                                              ; preds = %112
  %114 = load ptr, ptr %11, align 8, !tbaa !5
  %115 = getelementptr inbounds %union.IRIns, ptr %114, i32 -1
  store ptr %115, ptr %11, align 8, !tbaa !5
  br label %99, !llvm.loop !24

116:                                              ; preds = %99
  %117 = load ptr, ptr %9, align 8, !tbaa !5
  %118 = getelementptr inbounds %struct.anon, ptr %117, i32 0, i32 3
  %119 = load i16, ptr %118, align 2, !tbaa !9
  %120 = load ptr, ptr %7, align 8, !tbaa !5
  store i16 %119, ptr %120, align 2, !tbaa !22
  %121 = load ptr, ptr %9, align 8, !tbaa !5
  %122 = getelementptr inbounds %struct.anon.0, ptr %121, i32 0, i32 2
  store i8 12, ptr %122, align 1, !tbaa !9
  %123 = load ptr, ptr %9, align 8, !tbaa !5
  %124 = getelementptr inbounds %struct.anon.0, ptr %123, i32 0, i32 1
  %125 = getelementptr inbounds %struct.IRType1, ptr %124, i32 0, i32 0
  store i8 0, ptr %125, align 4, !tbaa !9
  %126 = load ptr, ptr %9, align 8, !tbaa !5
  %127 = getelementptr inbounds %struct.anon, ptr %126, i32 0, i32 1
  store i16 0, ptr %127, align 2, !tbaa !9
  %128 = load ptr, ptr %9, align 8, !tbaa !5
  %129 = getelementptr inbounds %struct.anon, ptr %128, i32 0, i32 0
  store i16 0, ptr %129, align 4, !tbaa !9
  %130 = load ptr, ptr %9, align 8, !tbaa !5
  %131 = getelementptr inbounds %struct.anon, ptr %130, i32 0, i32 3
  store i16 0, ptr %131, align 2, !tbaa !9
  %132 = load i32, ptr %8, align 4, !tbaa !10
  %133 = add i32 %132, 1
  %134 = load ptr, ptr %3, align 8, !tbaa !5
  %135 = getelementptr inbounds %struct.jit_State, ptr %134, i32 0, i32 0
  %136 = getelementptr inbounds %struct.GCtrace, ptr %135, i32 0, i32 5
  %137 = load i32, ptr %136, align 8, !tbaa !23
  %138 = icmp ult i32 %133, %137
  br i1 %138, label %139, label %201

139:                                              ; preds = %116
  %140 = load ptr, ptr %9, align 8, !tbaa !5
  %141 = getelementptr inbounds %union.IRIns, ptr %140, i64 1
  %142 = getelementptr inbounds %struct.anon.0, ptr %141, i32 0, i32 2
  %143 = load i8, ptr %142, align 1, !tbaa !9
  %144 = zext i8 %143 to i32
  %145 = icmp eq i32 %144, 88
  br i1 %145, label %146, label %201

146:                                              ; preds = %139
  %147 = load ptr, ptr %9, align 8, !tbaa !5
  %148 = getelementptr inbounds %union.IRIns, ptr %147, i64 1
  %149 = getelementptr inbounds %struct.anon, ptr %148, i32 0, i32 0
  %150 = load i16, ptr %149, align 4, !tbaa !9
  %151 = zext i16 %150 to i32
  %152 = load i32, ptr %4, align 4, !tbaa !10
  %153 = icmp eq i32 %151, %152
  br i1 %153, label %154, label %201

154:                                              ; preds = %146
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #3
  %155 = load ptr, ptr %3, align 8, !tbaa !5
  %156 = getelementptr inbounds %struct.jit_State, ptr %155, i32 0, i32 38
  %157 = getelementptr inbounds [100 x i16], ptr %156, i64 0, i64 88
  store ptr %157, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #3
  %158 = load ptr, ptr %3, align 8, !tbaa !5
  %159 = getelementptr inbounds %struct.jit_State, ptr %158, i32 0, i32 0
  %160 = getelementptr inbounds %struct.GCtrace, ptr %159, i32 0, i32 7
  %161 = load ptr, ptr %160, align 8, !tbaa !12
  %162 = load ptr, ptr %12, align 8, !tbaa !5
  %163 = load i16, ptr %162, align 2, !tbaa !22
  %164 = zext i16 %163 to i64
  %165 = getelementptr inbounds %union.IRIns, ptr %161, i64 %164
  store ptr %165, ptr %13, align 8, !tbaa !5
  br label %166

166:                                              ; preds = %176, %154
  %167 = load ptr, ptr %12, align 8, !tbaa !5
  %168 = load i16, ptr %167, align 2, !tbaa !22
  %169 = zext i16 %168 to i32
  %170 = load i32, ptr %8, align 4, !tbaa !10
  %171 = add i32 %170, 1
  %172 = icmp ugt i32 %169, %171
  br i1 %172, label %173, label %185

173:                                              ; preds = %166
  %174 = load ptr, ptr %13, align 8, !tbaa !5
  %175 = getelementptr inbounds %struct.anon, ptr %174, i32 0, i32 3
  store ptr %175, ptr %12, align 8, !tbaa !5
  br label %176

176:                                              ; preds = %173
  %177 = load ptr, ptr %3, align 8, !tbaa !5
  %178 = getelementptr inbounds %struct.jit_State, ptr %177, i32 0, i32 0
  %179 = getelementptr inbounds %struct.GCtrace, ptr %178, i32 0, i32 7
  %180 = load ptr, ptr %179, align 8, !tbaa !12
  %181 = load ptr, ptr %12, align 8, !tbaa !5
  %182 = load i16, ptr %181, align 2, !tbaa !22
  %183 = zext i16 %182 to i64
  %184 = getelementptr inbounds %union.IRIns, ptr %180, i64 %183
  store ptr %184, ptr %13, align 8, !tbaa !5
  br label %166, !llvm.loop !26

185:                                              ; preds = %166
  %186 = load ptr, ptr %13, align 8, !tbaa !5
  %187 = getelementptr inbounds %struct.anon, ptr %186, i32 0, i32 3
  %188 = load i16, ptr %187, align 2, !tbaa !9
  %189 = load ptr, ptr %12, align 8, !tbaa !5
  store i16 %188, ptr %189, align 2, !tbaa !22
  %190 = load ptr, ptr %13, align 8, !tbaa !5
  %191 = getelementptr inbounds %struct.anon.0, ptr %190, i32 0, i32 2
  store i8 12, ptr %191, align 1, !tbaa !9
  %192 = load ptr, ptr %13, align 8, !tbaa !5
  %193 = getelementptr inbounds %struct.anon.0, ptr %192, i32 0, i32 1
  %194 = getelementptr inbounds %struct.IRType1, ptr %193, i32 0, i32 0
  store i8 0, ptr %194, align 4, !tbaa !9
  %195 = load ptr, ptr %13, align 8, !tbaa !5
  %196 = getelementptr inbounds %struct.anon, ptr %195, i32 0, i32 1
  store i16 0, ptr %196, align 2, !tbaa !9
  %197 = load ptr, ptr %13, align 8, !tbaa !5
  %198 = getelementptr inbounds %struct.anon, ptr %197, i32 0, i32 0
  store i16 0, ptr %198, align 4, !tbaa !9
  %199 = load ptr, ptr %13, align 8, !tbaa !5
  %200 = getelementptr inbounds %struct.anon, ptr %199, i32 0, i32 3
  store i16 0, ptr %200, align 2, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #3
  br label %201

201:                                              ; preds = %185, %146, %139, %116
  store i32 0, ptr %10, align 4
  br label %202

202:                                              ; preds = %201, %111
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #3
  %203 = load i32, ptr %10, align 4
  switch i32 %203, label %211 [
    i32 0, label %204
  ]

204:                                              ; preds = %202
  br label %205

205:                                              ; preds = %204, %79
  store i32 5, ptr %10, align 4
  br label %211

206:                                              ; preds = %70, %43, %43
  %207 = load ptr, ptr %9, align 8, !tbaa !5
  %208 = getelementptr inbounds %struct.anon, ptr %207, i32 0, i32 3
  store ptr %208, ptr %7, align 8, !tbaa !5
  %209 = load i16, ptr %208, align 2, !tbaa !22
  %210 = zext i16 %209 to i32
  store i32 %210, ptr %8, align 4, !tbaa !10
  store i32 0, ptr %10, align 4
  br label %211

211:                                              ; preds = %206, %205, %202, %78, %69
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #3
  %212 = load i32, ptr %10, align 4
  switch i32 %212, label %218 [
    i32 0, label %213
    i32 5, label %215
  ]

213:                                              ; preds = %211
  br label %39, !llvm.loop !27

214:                                              ; preds = %39
  br label %215

215:                                              ; preds = %214, %211
  %216 = load ptr, ptr %3, align 8, !tbaa !5
  %217 = call i32 @lj_ir_emit(ptr noundef %216)
  store i32 %217, ptr %2, align 4
  store i32 1, ptr %10, align 4
  br label %218

218:                                              ; preds = %215, %211
  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
  %219 = load i32, ptr %2, align 4
  ret i32 %219
}

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}
!27 = distinct !{!27, !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_uref(ptr noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
define hidden i32 @lj_opt_dse_ustore(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 486
  %11 = load i16, ptr %10, align 2, !tbaa !20
  %12 = icmp ugt i16 %11, %3
  br i1 %12, label %.lr.ph88, label %.thread74

.lr.ph88:                                         ; preds = %1
  %13 = getelementptr inbounds i8, ptr %0, i64 370
  %14 = getelementptr inbounds i8, ptr %0, i64 8
  %15 = getelementptr inbounds i8, ptr %0, i64 512
  br label %16

16:                                               ; preds = %.lr.ph88, %69
  %.06186.in = phi i16 [ %11, %.lr.ph88 ], [ %71, %69 ]
  %.06385 = phi ptr [ %10, %.lr.ph88 ], [ %70, %69 ]
  %17 = load ptr, ptr %6, align 8, !tbaa !8
  %18 = zext i16 %.06186.in to i64
  %19 = getelementptr inbounds %union.IRIns, ptr %17, i64 %18
  %20 = load i16, ptr %19, align 4, !tbaa !5
  %21 = zext i16 %20 to i64
  %22 = getelementptr inbounds %union.IRIns, ptr %17, i64 %21
  %23 = tail call i32 @aa_uref(ptr noundef %9, ptr noundef %22)
  switch i32 %23, label %69 [
    i32 2, label %27
    i32 1, label %24
  ]

24:                                               ; preds = %16
  %25 = getelementptr inbounds i8, ptr %19, i64 2
  %26 = load i16, ptr %25, align 2, !tbaa !5
  %.not = icmp eq i16 %26, %5
  br i1 %.not, label %69, label %.thread74

27:                                               ; preds = %16
  %.06186.le = zext i16 %.06186.in to i32
  %28 = getelementptr inbounds i8, ptr %19, i64 2
  %29 = load i16, ptr %28, align 2, !tbaa !5
  %30 = icmp eq i16 %29, %5
  br i1 %30, label %.thread78, label %31

31:                                               ; preds = %27
  %32 = load i16, ptr %13, align 2, !tbaa !20
  %33 = icmp ugt i16 %.06186.in, %32
  br i1 %33, label %34, label %.thread74

34:                                               ; preds = %31
  %35 = load ptr, ptr %6, align 8, !tbaa !8
  %36 = load i32, ptr %14, align 8, !tbaa !21
  %37 = add i32 %36, -1
  %38 = zext i32 %37 to i64
  %39 = getelementptr inbounds %union.IRIns, ptr %35, i64 %38
  %.not6983 = icmp ugt ptr %39, %19
  br i1 %.not6983, label %.lr.ph, label %._crit_edge

40:                                               ; preds = %.lr.ph
  %41 = getelementptr inbounds i8, ptr %.05784, i64 -8
  %.not69 = icmp ugt ptr %41, %19
  br i1 %.not69, label %.lr.ph, label %._crit_edge, !llvm.loop !22

.lr.ph:                                           ; preds = %34, %40
  %.05784 = phi ptr [ %41, %40 ], [ %39, %34 ]
  %42 = getelementptr inbounds i8, ptr %.05784, i64 4
  %43 = load i8, ptr %42, align 4, !tbaa !5
  %.not68 = icmp sgt i8 %43, -1
  br i1 %.not68, label %40, label %.thread74

._crit_edge:                                      ; preds = %40, %34
  %44 = getelementptr inbounds i8, ptr %19, i64 6
  %45 = load i16, ptr %44, align 2, !tbaa !5
  store i16 %45, ptr %.06385, align 2, !tbaa !20
  %46 = getelementptr inbounds i8, ptr %19, i64 5
  store i8 12, ptr %46, align 1, !tbaa !5
  %47 = getelementptr inbounds i8, ptr %19, i64 4
  store i8 0, ptr %47, align 4, !tbaa !5
  store i16 0, ptr %28, align 2, !tbaa !5
  store i16 0, ptr %19, align 4, !tbaa !5
  store i16 0, ptr %44, align 2, !tbaa !5
  %48 = add nuw nsw i32 %.06186.le, 1
  %49 = load i32, ptr %14, align 8, !tbaa !21
  %50 = icmp ult i32 %48, %49
  br i1 %50, label %51, label %.thread74

51:                                               ; preds = %._crit_edge
  %52 = getelementptr inbounds i8, ptr %19, i64 13
  %53 = load i8, ptr %52, align 1, !tbaa !5
  %54 = icmp eq i8 %53, 88
  br i1 %54, label %55, label %.thread74

55:                                               ; preds = %51
  %56 = getelementptr inbounds i8, ptr %19, i64 8
  %57 = load i16, ptr %56, align 4, !tbaa !5
  %58 = icmp eq i16 %57, %3
  br i1 %58, label %59, label %.thread74

59:                                               ; preds = %55
  %60 = load ptr, ptr %6, align 8, !tbaa !8
  br label %61

61:                                               ; preds = %61, %59
  %.056 = phi ptr [ %15, %59 ], [ %64, %61 ]
  %.pn.in = load i16, ptr %.056, align 2, !tbaa !20
  %.pn = zext i16 %.pn.in to i64
  %.0 = getelementptr inbounds %union.IRIns, ptr %60, i64 %.pn
  %62 = zext i16 %.pn.in to i32
  %63 = icmp ult i32 %48, %62
  %64 = getelementptr inbounds i8, ptr %.0, i64 6
  br i1 %63, label %61, label %..thread74.loopexit82_crit_edge93, !llvm.loop !24

..thread74.loopexit82_crit_edge93:                ; preds = %61
  %65 = load i16, ptr %64, align 2, !tbaa !5
  store i16 %65, ptr %.056, align 2, !tbaa !20
  %66 = getelementptr inbounds i8, ptr %.0, i64 5
  store i8 12, ptr %66, align 1, !tbaa !5
  %67 = getelementptr inbounds i8, ptr %.0, i64 4
  store i8 0, ptr %67, align 4, !tbaa !5
  %68 = getelementptr inbounds i8, ptr %.0, i64 2
  store i16 0, ptr %68, align 2, !tbaa !5
  store i16 0, ptr %.0, align 4, !tbaa !5
  store i16 0, ptr %64, align 2, !tbaa !5
  br label %.thread74

69:                                               ; preds = %24, %16
  %70 = getelementptr inbounds i8, ptr %19, i64 6
  %71 = load i16, ptr %70, align 2, !tbaa !20
  %72 = icmp ugt i16 %71, %3
  br i1 %72, label %16, label %.thread74

.thread74:                                        ; preds = %69, %24, %.lr.ph, %1, %..thread74.loopexit82_crit_edge93, %55, %51, %._crit_edge, %31
  %73 = tail call i32 @lj_ir_emit(ptr noundef %0) #2
  br label %.thread78

.thread78:                                        ; preds = %27, %.thread74
  %.2 = phi i32 [ %73, %.thread74 ], [ 4, %27 ]
  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"}
!24 = distinct !{!24, !23}


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