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

; 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.SnapShot = type { i16, i16, i8, i8, i8, i8 }

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

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

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

; Function Attrs: nounwind uwtable
define hidden void @lj_snap_shrink(ptr noundef %0) #1 {
  %2 = alloca ptr, align 8
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca [255 x i8], align 16
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #2
  %14 = load ptr, ptr %2, align 8, !tbaa !5
  %15 = getelementptr inbounds %struct.jit_State, ptr %14, i32 0, i32 0
  %16 = getelementptr inbounds %struct.GCtrace, ptr %15, i32 0, i32 11
  %17 = load ptr, ptr %16, align 8, !tbaa !9
  %18 = load ptr, ptr %2, align 8, !tbaa !5
  %19 = getelementptr inbounds %struct.jit_State, ptr %18, i32 0, i32 0
  %20 = getelementptr inbounds %struct.GCtrace, ptr %19, i32 0, i32 9
  %21 = load i16, ptr %20, align 4, !tbaa !20
  %22 = zext i16 %21 to i32
  %23 = sub nsw i32 %22, 1
  %24 = sext i32 %23 to i64
  %25 = getelementptr inbounds %struct.SnapShot, ptr %17, i64 %24
  store ptr %25, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #2
  %26 = load ptr, ptr %2, 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 12
  %29 = load ptr, ptr %28, align 8, !tbaa !21
  %30 = load ptr, ptr %3, align 8, !tbaa !5
  %31 = getelementptr inbounds %struct.SnapShot, ptr %30, i32 0, i32 0
  %32 = load i16, ptr %31, align 2, !tbaa !22
  %33 = zext i16 %32 to i64
  %34 = getelementptr inbounds i32, ptr %29, i64 %33
  store ptr %34, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #2
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #2
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #2
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #2
  %35 = load ptr, ptr %3, align 8, !tbaa !5
  %36 = getelementptr inbounds %struct.SnapShot, ptr %35, i32 0, i32 4
  %37 = load i8, ptr %36, align 2, !tbaa !24
  %38 = zext i8 %37 to i32
  store i32 %38, ptr %8, align 4, !tbaa !25
  call void @llvm.lifetime.start.p0(i64 255, ptr %9) #2
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #2
  %39 = load ptr, ptr %2, align 8, !tbaa !5
  %40 = getelementptr inbounds %struct.jit_State, ptr %39, i32 0, i32 7
  %41 = load i32, ptr %40, align 4, !tbaa !26
  store i32 %41, ptr %10, align 4, !tbaa !25
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #2
  %42 = load ptr, ptr %2, align 8, !tbaa !5
  %43 = getelementptr inbounds [255 x i8], ptr %9, i64 0, i64 0
  %44 = load ptr, ptr %4, align 8, !tbaa !5
  %45 = load i32, ptr %8, align 4, !tbaa !25
  %46 = zext i32 %45 to i64
  %47 = getelementptr inbounds i32, ptr %44, i64 %46
  %48 = load i32, ptr %47, align 4, !tbaa !25
  %49 = zext i32 %48 to i64
  %50 = inttoptr i64 %49 to ptr
  %51 = load i32, ptr %10, align 4, !tbaa !25
  %52 = call i32 @snap_usedef(ptr noundef %42, ptr noundef %43, ptr noundef %50, i32 noundef %51)
  store i32 %52, ptr %11, align 4, !tbaa !25
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #2
  %53 = load ptr, ptr %2, align 8, !tbaa !5
  %54 = getelementptr inbounds %struct.jit_State, ptr %53, i32 0, i32 8
  %55 = load i32, ptr %54, align 8, !tbaa !27
  store i32 %55, ptr %12, align 4, !tbaa !25
  %56 = load i32, ptr %12, align 4, !tbaa !25
  %57 = load i32, ptr %10, align 4, !tbaa !25
  %58 = add i32 %57, %56
  store i32 %58, ptr %10, align 4, !tbaa !25
  %59 = load i32, ptr %12, align 4, !tbaa !25
  %60 = load i32, ptr %11, align 4, !tbaa !25
  %61 = add i32 %60, %59
  store i32 %61, ptr %11, align 4, !tbaa !25
  %62 = load i32, ptr %10, align 4, !tbaa !25
  %63 = trunc i32 %62 to i8
  %64 = load ptr, ptr %3, align 8, !tbaa !5
  %65 = getelementptr inbounds %struct.SnapShot, ptr %64, i32 0, i32 2
  store i8 %63, ptr %65, align 2, !tbaa !28
  store i32 0, ptr %6, align 4, !tbaa !25
  store i32 0, ptr %5, align 4, !tbaa !25
  br label %66

66:                                               ; preds = %105, %1
  %67 = load i32, ptr %5, align 4, !tbaa !25
  %68 = load i32, ptr %8, align 4, !tbaa !25
  %69 = icmp ult i32 %67, %68
  br i1 %69, label %70, label %108

70:                                               ; preds = %66
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #2
  %71 = load ptr, ptr %4, align 8, !tbaa !5
  %72 = load i32, ptr %5, align 4, !tbaa !25
  %73 = zext i32 %72 to i64
  %74 = getelementptr inbounds i32, ptr %71, i64 %73
  %75 = load i32, ptr %74, align 4, !tbaa !25
  %76 = lshr i32 %75, 24
  store i32 %76, ptr %13, align 4, !tbaa !25
  %77 = load i32, ptr %13, align 4, !tbaa !25
  %78 = load i32, ptr %11, align 4, !tbaa !25
  %79 = icmp ult i32 %77, %78
  br i1 %79, label %93, label %80

80:                                               ; preds = %70
  %81 = load i32, ptr %13, align 4, !tbaa !25
  %82 = load i32, ptr %10, align 4, !tbaa !25
  %83 = icmp ult i32 %81, %82
  br i1 %83, label %84, label %104

84:                                               ; preds = %80
  %85 = load i32, ptr %13, align 4, !tbaa !25
  %86 = load i32, ptr %12, align 4, !tbaa !25
  %87 = sub i32 %85, %86
  %88 = zext i32 %87 to i64
  %89 = getelementptr inbounds [255 x i8], ptr %9, i64 0, i64 %88
  %90 = load i8, ptr %89, align 1, !tbaa !29
  %91 = zext i8 %90 to i32
  %92 = icmp eq i32 %91, 0
  br i1 %92, label %93, label %104

93:                                               ; preds = %84, %70
  %94 = load ptr, ptr %4, align 8, !tbaa !5
  %95 = load i32, ptr %5, align 4, !tbaa !25
  %96 = zext i32 %95 to i64
  %97 = getelementptr inbounds i32, ptr %94, i64 %96
  %98 = load i32, ptr %97, align 4, !tbaa !25
  %99 = load ptr, ptr %4, align 8, !tbaa !5
  %100 = load i32, ptr %6, align 4, !tbaa !25
  %101 = add i32 %100, 1
  store i32 %101, ptr %6, align 4, !tbaa !25
  %102 = zext i32 %100 to i64
  %103 = getelementptr inbounds i32, ptr %99, i64 %102
  store i32 %98, ptr %103, align 4, !tbaa !25
  br label %104

104:                                              ; preds = %93, %84, %80
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #2
  br label %105

105:                                              ; preds = %104
  %106 = load i32, ptr %5, align 4, !tbaa !25
  %107 = add i32 %106, 1
  store i32 %107, ptr %5, align 4, !tbaa !25
  br label %66, !llvm.loop !30

108:                                              ; preds = %66
  %109 = load i32, ptr %6, align 4, !tbaa !25
  %110 = trunc i32 %109 to i8
  %111 = load ptr, ptr %3, align 8, !tbaa !5
  %112 = getelementptr inbounds %struct.SnapShot, ptr %111, i32 0, i32 4
  store i8 %110, ptr %112, align 2, !tbaa !24
  %113 = load ptr, ptr %2, align 8, !tbaa !5
  %114 = getelementptr inbounds %struct.jit_State, ptr %113, i32 0, i32 0
  %115 = getelementptr inbounds %struct.GCtrace, ptr %114, i32 0, i32 10
  %116 = load i16, ptr %115, align 2, !tbaa !32
  %117 = zext i16 %116 to i32
  %118 = load ptr, ptr %3, align 8, !tbaa !5
  %119 = getelementptr inbounds %struct.SnapShot, ptr %118, i32 0, i32 0
  %120 = load i16, ptr %119, align 2, !tbaa !22
  %121 = zext i16 %120 to i32
  %122 = sub nsw i32 %117, %121
  %123 = sub nsw i32 %122, 1
  store i32 %123, ptr %7, align 4, !tbaa !25
  br label %124

124:                                              ; preds = %128, %108
  %125 = load i32, ptr %5, align 4, !tbaa !25
  %126 = load i32, ptr %7, align 4, !tbaa !25
  %127 = icmp ule i32 %125, %126
  br i1 %127, label %128, label %140

128:                                              ; preds = %124
  %129 = load ptr, ptr %4, align 8, !tbaa !5
  %130 = load i32, ptr %5, align 4, !tbaa !25
  %131 = add i32 %130, 1
  store i32 %131, ptr %5, align 4, !tbaa !25
  %132 = zext i32 %130 to i64
  %133 = getelementptr inbounds i32, ptr %129, i64 %132
  %134 = load i32, ptr %133, align 4, !tbaa !25
  %135 = load ptr, ptr %4, align 8, !tbaa !5
  %136 = load i32, ptr %6, align 4, !tbaa !25
  %137 = add i32 %136, 1
  store i32 %137, ptr %6, align 4, !tbaa !25
  %138 = zext i32 %136 to i64
  %139 = getelementptr inbounds i32, ptr %135, i64 %138
  store i32 %134, ptr %139, align 4, !tbaa !25
  br label %124, !llvm.loop !33

140:                                              ; preds = %124
  %141 = load ptr, ptr %3, align 8, !tbaa !5
  %142 = getelementptr inbounds %struct.SnapShot, ptr %141, i32 0, i32 0
  %143 = load i16, ptr %142, align 2, !tbaa !22
  %144 = zext i16 %143 to i32
  %145 = load i32, ptr %6, align 4, !tbaa !25
  %146 = add i32 %144, %145
  %147 = trunc i32 %146 to i16
  %148 = load ptr, ptr %2, align 8, !tbaa !5
  %149 = getelementptr inbounds %struct.jit_State, ptr %148, i32 0, i32 0
  %150 = getelementptr inbounds %struct.GCtrace, ptr %149, i32 0, i32 10
  store i16 %147, ptr %150, align 2, !tbaa !32
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #2
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #2
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #2
  call void @llvm.lifetime.end.p0(i64 255, ptr %9) #2
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #2
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #2
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #2
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #2
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #2
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #2
  ret void
}

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


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

%struct.SnapShot = type { i16, i16, i8, i8, i8, i8 }

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

; Function Attrs: mustprogress 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 @snap_usedef(ptr noundef, ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
define hidden void @lj_snap_shrink(ptr noundef %0) local_unnamed_addr #1 {
  %2 = alloca [255 x i8], align 16
  %3 = getelementptr inbounds i8, ptr %0, i64 32
  %4 = load ptr, ptr %3, align 8, !tbaa !5
  %5 = getelementptr inbounds i8, ptr %0, i64 28
  %6 = load i16, ptr %5, align 4, !tbaa !19
  %7 = zext i16 %6 to i64
  %8 = getelementptr %struct.SnapShot, ptr %4, i64 %7
  %9 = getelementptr i8, ptr %8, i64 -8
  %10 = getelementptr inbounds i8, ptr %0, i64 40
  %11 = load ptr, ptr %10, align 8, !tbaa !20
  %12 = load i16, ptr %9, align 2, !tbaa !21
  %13 = zext i16 %12 to i64
  %14 = getelementptr inbounds i32, ptr %11, i64 %13
  %15 = getelementptr i8, ptr %8, i64 -2
  %16 = load i8, ptr %15, align 2, !tbaa !23
  %17 = zext i8 %16 to i32
  call void @llvm.lifetime.start.p0(i64 255, ptr nonnull %2) #3
  %18 = getelementptr inbounds i8, ptr %0, i64 140
  %19 = load i32, ptr %18, align 4, !tbaa !24
  %20 = zext i8 %16 to i64
  %21 = getelementptr inbounds i32, ptr %14, i64 %20
  %22 = load i32, ptr %21, align 4, !tbaa !25
  %23 = zext i32 %22 to i64
  %24 = inttoptr i64 %23 to ptr
  %25 = call i32 @snap_usedef(ptr noundef %0, ptr noundef nonnull %2, ptr noundef %24, i32 noundef %19)
  %26 = getelementptr inbounds i8, ptr %0, i64 144
  %27 = load i32, ptr %26, align 8, !tbaa !26
  %28 = add i32 %27, %19
  %29 = add i32 %27, %25
  %30 = trunc i32 %28 to i8
  %31 = getelementptr i8, ptr %8, i64 -4
  store i8 %30, ptr %31, align 2, !tbaa !27
  %.not57 = icmp eq i8 %16, 0
  br i1 %.not57, label %._crit_edge.thread, label %.lr.ph.preheader

._crit_edge.thread:                               ; preds = %1
  store i8 0, ptr %15, align 2, !tbaa !23
  %32 = getelementptr inbounds i8, ptr %0, i64 30
  %33 = load i16, ptr %32, align 2, !tbaa !28
  %34 = zext i16 %33 to i32
  %35 = load i16, ptr %9, align 2, !tbaa !21
  %36 = zext i16 %35 to i32
  %37 = xor i32 %36, -1
  %38 = add nsw i32 %37, %34
  br label %.lr.ph54.preheader

.lr.ph.preheader:                                 ; preds = %1
  %wide.trip.count = zext i8 %16 to i64
  br label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph.preheader, %55
  %indvars.iv = phi i64 [ 0, %.lr.ph.preheader ], [ %indvars.iv.next, %55 ]
  %.04447 = phi i32 [ 0, %.lr.ph.preheader ], [ %.145, %55 ]
  %39 = getelementptr inbounds i32, ptr %14, i64 %indvars.iv
  %40 = load i32, ptr %39, align 4, !tbaa !25
  %41 = lshr i32 %40, 24
  %42 = icmp ult i32 %41, %29
  br i1 %42, label %51, label %43

43:                                               ; preds = %.lr.ph
  %44 = icmp ult i32 %41, %28
  br i1 %44, label %45, label %55

45:                                               ; preds = %43
  %46 = sub i32 %41, %27
  %47 = zext i32 %46 to i64
  %48 = getelementptr inbounds [255 x i8], ptr %2, i64 0, i64 %47
  %49 = load i8, ptr %48, align 1, !tbaa !29
  %50 = icmp eq i8 %49, 0
  br i1 %50, label %51, label %55

51:                                               ; preds = %45, %.lr.ph
  %52 = add i32 %.04447, 1
  %53 = zext i32 %.04447 to i64
  %54 = getelementptr inbounds i32, ptr %14, i64 %53
  store i32 %40, ptr %54, align 4, !tbaa !25
  br label %55

55:                                               ; preds = %51, %45, %43
  %.145 = phi i32 [ %52, %51 ], [ %.04447, %45 ], [ %.04447, %43 ]
  %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 !30

._crit_edge:                                      ; preds = %55
  %56 = trunc i32 %.145 to i8
  store i8 %56, ptr %15, align 2, !tbaa !23
  %57 = getelementptr inbounds i8, ptr %0, i64 30
  %58 = load i16, ptr %57, align 2, !tbaa !28
  %59 = zext i16 %58 to i32
  %60 = load i16, ptr %9, align 2, !tbaa !21
  %61 = zext i16 %60 to i32
  %62 = xor i32 %61, -1
  %63 = add nsw i32 %62, %59
  %.not50 = icmp ult i32 %63, %17
  br i1 %.not50, label %._crit_edge55, label %.lr.ph54.preheader

.lr.ph54.preheader:                               ; preds = %._crit_edge.thread, %._crit_edge
  %64 = phi i32 [ %38, %._crit_edge.thread ], [ %63, %._crit_edge ]
  %65 = phi i16 [ %35, %._crit_edge.thread ], [ %60, %._crit_edge ]
  %66 = phi ptr [ %32, %._crit_edge.thread ], [ %57, %._crit_edge ]
  %.0.lcssa64 = phi i32 [ 0, %._crit_edge.thread ], [ %17, %._crit_edge ]
  %.044.lcssa63 = phi i32 [ 0, %._crit_edge.thread ], [ %.145, %._crit_edge ]
  %67 = add nsw i32 %64, 1
  %68 = add nuw nsw i32 %17, 1
  %umax65 = call i32 @llvm.umax.i32(i32 %67, i32 %68)
  %69 = sub i32 %umax65, %17
  %min.iters.check = icmp ult i32 %69, 28
  br i1 %min.iters.check, label %.lr.ph54.preheader70, label %vector.scevcheck

vector.scevcheck:                                 ; preds = %.lr.ph54.preheader
  %70 = add nsw i32 %64, 1
  %71 = add nuw nsw i32 %17, 1
  %umax = call i32 @llvm.umax.i32(i32 %70, i32 %71)
  %72 = add i32 %umax, -1
  %73 = sub i32 %72, %17
  %74 = xor i32 %.044.lcssa63, -1
  %75 = icmp ugt i32 %73, %74
  %76 = icmp ult i32 %72, %17
  %77 = or i1 %75, %76
  br i1 %77, label %.lr.ph54.preheader70, label %vector.memcheck

vector.memcheck:                                  ; preds = %vector.scevcheck
  %78 = zext i32 %.044.lcssa63 to i64
  %79 = zext i8 %16 to i64
  %80 = sub nsw i64 %78, %79
  %81 = and i64 %80, 4611686018427387896
  %diff.check = icmp eq i64 %81, 0
  br i1 %diff.check, label %.lr.ph54.preheader70, label %vector.ph

vector.ph:                                        ; preds = %vector.memcheck
  %n.vec = and i32 %69, -8
  %ind.end = add i32 %.0.lcssa64, %n.vec
  %ind.end66 = add i32 %.044.lcssa63, %n.vec
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i32 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %offset.idx = add i32 %.0.lcssa64, %index
  %offset.idx68 = add i32 %.044.lcssa63, %index
  %82 = zext i32 %offset.idx to i64
  %83 = getelementptr inbounds i32, ptr %14, i64 %82
  %84 = getelementptr inbounds i8, ptr %83, i64 16
  %wide.load = load <4 x i32>, ptr %83, align 4, !tbaa !25
  %wide.load69 = load <4 x i32>, ptr %84, align 4, !tbaa !25
  %85 = zext i32 %offset.idx68 to i64
  %86 = getelementptr inbounds i32, ptr %14, i64 %85
  %87 = getelementptr inbounds i8, ptr %86, i64 16
  store <4 x i32> %wide.load, ptr %86, align 4, !tbaa !25
  store <4 x i32> %wide.load69, ptr %87, align 4, !tbaa !25
  %index.next = add nuw i32 %index, 8
  %88 = icmp eq i32 %index.next, %n.vec
  br i1 %88, label %middle.block, label %vector.body, !llvm.loop !32

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i32 %69, %n.vec
  br i1 %cmp.n, label %._crit_edge55, label %.lr.ph54.preheader70

.lr.ph54.preheader70:                             ; preds = %middle.block, %vector.memcheck, %vector.scevcheck, %.lr.ph54.preheader
  %.152.ph = phi i32 [ %.0.lcssa64, %vector.memcheck ], [ %.0.lcssa64, %vector.scevcheck ], [ %.0.lcssa64, %.lr.ph54.preheader ], [ %ind.end, %middle.block ]
  %.251.ph = phi i32 [ %.044.lcssa63, %vector.memcheck ], [ %.044.lcssa63, %vector.scevcheck ], [ %.044.lcssa63, %.lr.ph54.preheader ], [ %ind.end66, %middle.block ]
  br label %.lr.ph54

.lr.ph54:                                         ; preds = %.lr.ph54.preheader70, %.lr.ph54
  %.152 = phi i32 [ %89, %.lr.ph54 ], [ %.152.ph, %.lr.ph54.preheader70 ]
  %.251 = phi i32 [ %93, %.lr.ph54 ], [ %.251.ph, %.lr.ph54.preheader70 ]
  %89 = add i32 %.152, 1
  %90 = zext i32 %.152 to i64
  %91 = getelementptr inbounds i32, ptr %14, i64 %90
  %92 = load i32, ptr %91, align 4, !tbaa !25
  %93 = add i32 %.251, 1
  %94 = zext i32 %.251 to i64
  %95 = getelementptr inbounds i32, ptr %14, i64 %94
  store i32 %92, ptr %95, align 4, !tbaa !25
  %.not = icmp ugt i32 %89, %64
  br i1 %.not, label %._crit_edge55, label %.lr.ph54, !llvm.loop !35

._crit_edge55:                                    ; preds = %.lr.ph54, %middle.block, %._crit_edge
  %96 = phi i16 [ %60, %._crit_edge ], [ %65, %middle.block ], [ %65, %.lr.ph54 ]
  %97 = phi ptr [ %57, %._crit_edge ], [ %66, %middle.block ], [ %66, %.lr.ph54 ]
  %.2.lcssa = phi i32 [ %.145, %._crit_edge ], [ %ind.end66, %middle.block ], [ %93, %.lr.ph54 ]
  %98 = trunc i32 %.2.lcssa to i16
  %99 = add i16 %96, %98
  store i16 %99, ptr %97, align 2, !tbaa !28
  call void @llvm.lifetime.end.p0(i64 255, ptr nonnull %2) #3
  ret void
}

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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, !12, i64 32}
!6 = !{!"jit_State", !7, i64 0, !12, i64 96, !12, i64 104, !12, i64 112, !12, i64 120, !12, i64 128, !9, i64 136, !9, i64 140, !9, i64 144, !10, i64 148, !10, i64 149, !15, i64 150, !10, i64 151, !16, i64 152, !12, i64 176, !9, i64 184, !9, i64 188, !9, i64 192, !9, i64 196, !9, i64 200, !9, i64 204, !9, i64 208, !14, i64 212, !10, i64 216, !12, i64 256, !9, i64 264, !9, i64 268, !9, i64 272, !9, i64 276, !12, i64 280, !12, i64 288, !9, i64 296, !9, i64 300, !10, i64 304, !12, i64 312, !9, i64 320, !9, i64 324, !12, i64 328, !10, i64 336, !10, i64 536, !10, i64 1556, !10, i64 1616, !10, i64 1744, !9, i64 2256, !9, i64 2260, !10, i64 2264, !9, i64 2392, !17, i64 2396, !12, i64 2416, !9, i64 2424, !9, i64 2428, !12, i64 2432, !9, i64 2440, !9, i64 2444, !12, i64 2448, !12, i64 2456, !12, i64 2464, !18, i64 2472, !18, i64 2480, !10, i64 2488, !12, i64 2496, !9, i64 2504, !9, i64 2508}
!7 = !{!"GCtrace", !8, i64 0, !10, i64 4, !10, i64 5, !10, i64 6, !10, i64 7, !9, i64 8, !8, i64 12, !12, i64 16, !9, i64 24, !13, i64 28, !13, i64 30, !12, i64 32, !12, i64 40, !8, i64 48, !14, i64 52, !9, i64 56, !9, i64 60, !12, i64 64, !9, i64 72, !13, i64 76, !13, i64 78, !13, i64 80, !13, i64 82, !13, i64 84, !13, i64 86, !13, i64 88, !10, i64 90, !10, i64 91}
!8 = !{!"GCRef", !9, i64 0}
!9 = !{!"int", !10, i64 0}
!10 = !{!"omnipotent char", !11, i64 0}
!11 = !{!"Simple C/C++ TBAA"}
!12 = !{!"any pointer", !10, i64 0}
!13 = !{!"short", !10, i64 0}
!14 = !{!"MRef", !9, i64 0}
!15 = !{!"IRType1", !10, i64 0}
!16 = !{!"FoldState", !10, i64 0, !10, i64 8, !10, i64 16}
!17 = !{!"ScEvEntry", !14, i64 0, !13, i64 4, !13, i64 6, !13, i64 8, !13, i64 10, !15, i64 12, !10, i64 13}
!18 = !{!"long", !10, i64 0}
!19 = !{!6, !13, i64 28}
!20 = !{!6, !12, i64 40}
!21 = !{!22, !13, i64 0}
!22 = !{!"SnapShot", !13, i64 0, !13, i64 2, !10, i64 4, !10, i64 5, !10, i64 6, !10, i64 7}
!23 = !{!22, !10, i64 6}
!24 = !{!6, !9, i64 140}
!25 = !{!9, !9, i64 0}
!26 = !{!6, !9, i64 144}
!27 = !{!22, !10, i64 4}
!28 = !{!6, !13, i64 30}
!29 = !{!10, !10, i64 0}
!30 = distinct !{!30, !31}
!31 = !{!"llvm.loop.mustprogress"}
!32 = distinct !{!32, !31, !33, !34}
!33 = !{!"llvm.loop.isvectorized", i32 1}
!34 = !{!"llvm.loop.unroll.runtime.disable"}
!35 = distinct !{!35, !31, !33}


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