; LLVM IR from IlyaGrebnov/libbsc :: libbsc/lzp (lzp)

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

; 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: mustprogress uwtable
declare dso_local noundef i32 @_Z20bsc_lzp_decode_blockPKhS0_Phii(ptr noalias noundef, ptr noundef, ptr noalias noundef, i32 noundef, i32 noundef) #1

; 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) #2

; Function Attrs: mustprogress uwtable
define dso_local i32 @bsc_lzp_decompress(ptr noundef %0, ptr noundef %1, i32 noundef %2, i32 noundef %3, i32 noundef %4, i32 noundef %5) #1 {
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca [256 x i32], align 16
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  %22 = alloca i32, align 4
  %23 = alloca i32, align 4
  %24 = alloca i32, align 4
  %25 = alloca i32, align 4
  store ptr %0, ptr %8, align 8, !tbaa !5
  store ptr %1, ptr %9, align 8, !tbaa !5
  store i32 %2, ptr %10, align 4, !tbaa !9
  store i32 %3, ptr %11, align 4, !tbaa !9
  store i32 %4, ptr %12, align 4, !tbaa !9
  store i32 %5, ptr %13, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #3
  %26 = load ptr, ptr %8, align 8, !tbaa !5
  %27 = getelementptr inbounds i8, ptr %26, i64 0
  %28 = load i8, ptr %27, align 1, !tbaa !11
  %29 = zext i8 %28 to i32
  store i32 %29, ptr %14, align 4, !tbaa !9
  %30 = load i32, ptr %14, align 4, !tbaa !9
  %31 = icmp eq i32 %30, 1
  br i1 %31, label %32, label %43

32:                                               ; preds = %6
  %33 = load ptr, ptr %8, align 8, !tbaa !5
  %34 = getelementptr inbounds i8, ptr %33, i64 1
  %35 = load ptr, ptr %8, align 8, !tbaa !5
  %36 = load i32, ptr %10, align 4, !tbaa !9
  %37 = sext i32 %36 to i64
  %38 = getelementptr inbounds i8, ptr %35, i64 %37
  %39 = load ptr, ptr %9, align 8, !tbaa !5
  %40 = load i32, ptr %11, align 4, !tbaa !9
  %41 = load i32, ptr %12, align 4, !tbaa !9
  %42 = call noundef i32 @_Z20bsc_lzp_decode_blockPKhS0_Phii(ptr noundef %34, ptr noundef %38, ptr noundef %39, i32 noundef %40, i32 noundef %41)
  store i32 %42, ptr %7, align 4
  store i32 1, ptr %15, align 4
  br label %179

43:                                               ; preds = %6
  call void @llvm.lifetime.start.p0(i64 1024, ptr %16) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #3
  store i32 0, ptr %17, align 4, !tbaa !9
  br label %44

44:                                               ; preds = %140, %43
  %45 = load i32, ptr %17, align 4, !tbaa !9
  %46 = load i32, ptr %14, align 4, !tbaa !9
  %47 = icmp slt i32 %45, %46
  br i1 %47, label %49, label %48

48:                                               ; preds = %44
  store i32 2, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #3
  br label %143

49:                                               ; preds = %44
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #3
  store i32 0, ptr %18, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #3
  store i32 0, ptr %20, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #3
  %50 = load i32, ptr %14, align 4, !tbaa !9
  %51 = mul nsw i32 8, %50
  %52 = add nsw i32 1, %51
  %53 = load i32, ptr %18, align 4, !tbaa !9
  %54 = add nsw i32 %53, %52
  store i32 %54, ptr %18, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #3
  store i32 0, ptr %22, align 4, !tbaa !9
  br label %55

55:                                               ; preds = %81, %49
  %56 = load i32, ptr %22, align 4, !tbaa !9
  %57 = load i32, ptr %17, align 4, !tbaa !9
  %58 = icmp slt i32 %56, %57
  br i1 %58, label %60, label %59

59:                                               ; preds = %55
  store i32 5, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #3
  br label %84

60:                                               ; preds = %55
  %61 = load ptr, ptr %8, align 8, !tbaa !5
  %62 = getelementptr inbounds i8, ptr %61, i64 1
  %63 = load i32, ptr %22, align 4, !tbaa !9
  %64 = mul nsw i32 8, %63
  %65 = sext i32 %64 to i64
  %66 = getelementptr inbounds i8, ptr %62, i64 %65
  %67 = getelementptr inbounds i8, ptr %66, i64 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %19, ptr align 1 %67, i64 4, i1 false)
  %68 = load ptr, ptr %8, align 8, !tbaa !5
  %69 = getelementptr inbounds i8, ptr %68, i64 1
  %70 = load i32, ptr %22, align 4, !tbaa !9
  %71 = mul nsw i32 8, %70
  %72 = sext i32 %71 to i64
  %73 = getelementptr inbounds i8, ptr %69, i64 %72
  %74 = getelementptr inbounds i8, ptr %73, i64 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %21, ptr align 1 %74, i64 4, i1 false)
  %75 = load i32, ptr %19, align 4, !tbaa !9
  %76 = load i32, ptr %18, align 4, !tbaa !9
  %77 = add nsw i32 %76, %75
  store i32 %77, ptr %18, align 4, !tbaa !9
  %78 = load i32, ptr %21, align 4, !tbaa !9
  %79 = load i32, ptr %20, align 4, !tbaa !9
  %80 = add nsw i32 %79, %78
  store i32 %80, ptr %20, align 4, !tbaa !9
  br label %81

81:                                               ; preds = %60
  %82 = load i32, ptr %22, align 4, !tbaa !9
  %83 = add nsw i32 %82, 1
  store i32 %83, ptr %22, align 4, !tbaa !9
  br label %55, !llvm.loop !12

84:                                               ; preds = %59
  %85 = load ptr, ptr %8, align 8, !tbaa !5
  %86 = getelementptr inbounds i8, ptr %85, i64 1
  %87 = load i32, ptr %17, align 4, !tbaa !9
  %88 = mul nsw i32 8, %87
  %89 = sext i32 %88 to i64
  %90 = getelementptr inbounds i8, ptr %86, i64 %89
  %91 = getelementptr inbounds i8, ptr %90, i64 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %19, ptr align 1 %91, i64 4, i1 false)
  %92 = load ptr, ptr %8, align 8, !tbaa !5
  %93 = getelementptr inbounds i8, ptr %92, i64 1
  %94 = load i32, ptr %17, align 4, !tbaa !9
  %95 = mul nsw i32 8, %94
  %96 = sext i32 %95 to i64
  %97 = getelementptr inbounds i8, ptr %93, i64 %96
  %98 = getelementptr inbounds i8, ptr %97, i64 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %21, ptr align 1 %98, i64 4, i1 false)
  %99 = load i32, ptr %19, align 4, !tbaa !9
  %100 = load i32, ptr %21, align 4, !tbaa !9
  %101 = icmp ne i32 %99, %100
  br i1 %101, label %102, label %124

102:                                              ; preds = %84
  %103 = load ptr, ptr %8, align 8, !tbaa !5
  %104 = load i32, ptr %18, align 4, !tbaa !9
  %105 = sext i32 %104 to i64
  %106 = getelementptr inbounds i8, ptr %103, i64 %105
  %107 = load ptr, ptr %8, align 8, !tbaa !5
  %108 = load i32, ptr %18, align 4, !tbaa !9
  %109 = sext i32 %108 to i64
  %110 = getelementptr inbounds i8, ptr %107, i64 %109
  %111 = load i32, ptr %19, align 4, !tbaa !9
  %112 = sext i32 %111 to i64
  %113 = getelementptr inbounds i8, ptr %110, i64 %112
  %114 = load ptr, ptr %9, align 8, !tbaa !5
  %115 = load i32, ptr %20, align 4, !tbaa !9
  %116 = sext i32 %115 to i64
  %117 = getelementptr inbounds i8, ptr %114, i64 %116
  %118 = load i32, ptr %11, align 4, !tbaa !9
  %119 = load i32, ptr %12, align 4, !tbaa !9
  %120 = call noundef i32 @_Z20bsc_lzp_decode_blockPKhS0_Phii(ptr noundef %106, ptr noundef %113, ptr noundef %117, i32 noundef %118, i32 noundef %119)
  %121 = load i32, ptr %17, align 4, !tbaa !9
  %122 = sext i32 %121 to i64
  %123 = getelementptr inbounds [256 x i32], ptr %16, i64 0, i64 %122
  store i32 %120, ptr %123, align 4, !tbaa !9
  br label %139

124:                                              ; preds = %84
  %125 = load i32, ptr %19, align 4, !tbaa !9
  %126 = load i32, ptr %17, align 4, !tbaa !9
  %127 = sext i32 %126 to i64
  %128 = getelementptr inbounds [256 x i32], ptr %16, i64 0, i64 %127
  store i32 %125, ptr %128, align 4, !tbaa !9
  %129 = load ptr, ptr %9, align 8, !tbaa !5
  %130 = load i32, ptr %20, align 4, !tbaa !9
  %131 = sext i32 %130 to i64
  %132 = getelementptr inbounds i8, ptr %129, i64 %131
  %133 = load ptr, ptr %8, align 8, !tbaa !5
  %134 = load i32, ptr %18, align 4, !tbaa !9
  %135 = sext i32 %134 to i64
  %136 = getelementptr inbounds i8, ptr %133, i64 %135
  %137 = load i32, ptr %19, align 4, !tbaa !9
  %138 = sext i32 %137 to i64
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %132, ptr align 1 %136, i64 %138, i1 false)
  br label %139

139:                                              ; preds = %124, %102
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #3
  br label %140

140:                                              ; preds = %139
  %141 = load i32, ptr %17, align 4, !tbaa !9
  %142 = add nsw i32 %141, 1
  store i32 %142, ptr %17, align 4, !tbaa !9
  br label %44, !llvm.loop !14

143:                                              ; preds = %48
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #3
  store i32 0, ptr %23, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #3
  store i32 0, ptr %24, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #3
  store i32 0, ptr %25, align 4, !tbaa !9
  br label %144

144:                                              ; preds = %167, %143
  %145 = load i32, ptr %25, align 4, !tbaa !9
  %146 = load i32, ptr %14, align 4, !tbaa !9
  %147 = icmp slt i32 %145, %146
  br i1 %147, label %149, label %148

148:                                              ; preds = %144
  store i32 8, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #3
  br label %170

149:                                              ; preds = %144
  %150 = load i32, ptr %25, align 4, !tbaa !9
  %151 = sext i32 %150 to i64
  %152 = getelementptr inbounds [256 x i32], ptr %16, i64 0, i64 %151
  %153 = load i32, ptr %152, align 4, !tbaa !9
  %154 = icmp slt i32 %153, 0
  br i1 %154, label %155, label %160

155:                                              ; preds = %149
  %156 = load i32, ptr %25, align 4, !tbaa !9
  %157 = sext i32 %156 to i64
  %158 = getelementptr inbounds [256 x i32], ptr %16, i64 0, i64 %157
  %159 = load i32, ptr %158, align 4, !tbaa !9
  store i32 %159, ptr %24, align 4, !tbaa !9
  br label %160

160:                                              ; preds = %155, %149
  %161 = load i32, ptr %25, align 4, !tbaa !9
  %162 = sext i32 %161 to i64
  %163 = getelementptr inbounds [256 x i32], ptr %16, i64 0, i64 %162
  %164 = load i32, ptr %163, align 4, !tbaa !9
  %165 = load i32, ptr %23, align 4, !tbaa !9
  %166 = add nsw i32 %165, %164
  store i32 %166, ptr %23, align 4, !tbaa !9
  br label %167

167:                                              ; preds = %160
  %168 = load i32, ptr %25, align 4, !tbaa !9
  %169 = add nsw i32 %168, 1
  store i32 %169, ptr %25, align 4, !tbaa !9
  br label %144, !llvm.loop !15

170:                                              ; preds = %148
  %171 = load i32, ptr %24, align 4, !tbaa !9
  %172 = icmp eq i32 %171, 0
  br i1 %172, label %173, label %175

173:                                              ; preds = %170
  %174 = load i32, ptr %23, align 4, !tbaa !9
  br label %177

175:                                              ; preds = %170
  %176 = load i32, ptr %24, align 4, !tbaa !9
  br label %177

177:                                              ; preds = %175, %173
  %178 = phi i32 [ %174, %173 ], [ %176, %175 ]
  store i32 %178, ptr %7, align 4
  store i32 1, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #3
  call void @llvm.lifetime.end.p0(i64 1024, ptr %16) #3
  br label %179

179:                                              ; preds = %177, %32
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #3
  %180 = load i32, ptr %7, align 4
  ret i32 %180
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress 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 nounwind willreturn memory(argmem: readwrite) }
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++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!7, !7, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = distinct !{!14, !13}
!15 = distinct !{!15, !13}


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

; Function Attrs: 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: mustprogress uwtable
declare dso_local noundef i32 @_Z20bsc_lzp_decode_blockPKhS0_Phii(ptr noalias noundef, ptr noundef, ptr noalias noundef, i32 noundef, i32 noundef) local_unnamed_addr #1

; 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) #2

; Function Attrs: mustprogress uwtable
define dso_local i32 @bsc_lzp_decompress(ptr noundef %0, ptr noundef %1, i32 noundef %2, i32 noundef %3, i32 noundef %4, i32 noundef %5) local_unnamed_addr #1 {
  %7 = alloca [256 x i32], align 16
  %8 = load i8, ptr %0, align 1, !tbaa !5
  %9 = zext i8 %8 to i32
  %10 = icmp eq i8 %8, 1
  br i1 %10, label %11, label %16

11:                                               ; preds = %6
  %12 = getelementptr inbounds i8, ptr %0, i64 1
  %13 = sext i32 %2 to i64
  %14 = getelementptr inbounds i8, ptr %0, i64 %13
  %15 = tail call noundef i32 @_Z20bsc_lzp_decode_blockPKhS0_Phii(ptr noundef nonnull %12, ptr noundef nonnull %14, ptr noundef %1, i32 noundef %3, i32 noundef %4)
  br label %81

16:                                               ; preds = %6
  call void @llvm.lifetime.start.p0(i64 1024, ptr nonnull %7) #4
  %.not83 = icmp eq i8 %8, 0
  br i1 %.not83, label %._crit_edge80.thread, label %.lr.ph75

.lr.ph75:                                         ; preds = %16
  %17 = shl nuw nsw i32 %9, 3
  %18 = or disjoint i32 %17, 1
  %19 = getelementptr inbounds i8, ptr %0, i64 1
  %wide.trip.count92 = zext i8 %8 to i64
  %20 = insertelement <4 x i32> <i32 poison, i32 0, i32 0, i32 0>, i32 %18, i64 0
  br label %22

.preheader:                                       ; preds = %57
  br i1 %.not83, label %._crit_edge80.thread, label %.lr.ph79.preheader

.lr.ph79.preheader:                               ; preds = %.preheader
  %xtraiter = and i64 %wide.trip.count92, 3
  %21 = icmp ult i8 %8, 4
  br i1 %21, label %._crit_edge80.unr-lcssa, label %.lr.ph79.preheader.new

.lr.ph79.preheader.new:                           ; preds = %.lr.ph79.preheader
  %unroll_iter = and i64 %wide.trip.count92, 252
  br label %.lr.ph79

22:                                               ; preds = %.lr.ph75, %57
  %indvars.iv89 = phi i64 [ 0, %.lr.ph75 ], [ %indvars.iv.next90, %57 ]
  %.not84 = icmp eq i64 %indvars.iv89, 0
  br i1 %.not84, label %._crit_edge, label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %22
  %min.iters.check = icmp ult i64 %indvars.iv89, 8
  br i1 %min.iters.check, label %.lr.ph.preheader116, label %vector.ph

.lr.ph.preheader116:                              ; preds = %middle.block, %.lr.ph.preheader
  %indvars.iv.ph = phi i64 [ 0, %.lr.ph.preheader ], [ %n.vec, %middle.block ]
  %.06370.ph = phi i32 [ 0, %.lr.ph.preheader ], [ %33, %middle.block ]
  %.06469.ph = phi i32 [ %18, %.lr.ph.preheader ], [ %34, %middle.block ]
  br label %.lr.ph

vector.ph:                                        ; preds = %.lr.ph.preheader
  %n.vec = and i64 %indvars.iv89, 9223372036854775800
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %30, %vector.body ]
  %vec.phi107 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %31, %vector.body ]
  %vec.phi108 = phi <4 x i32> [ %20, %vector.ph ], [ %28, %vector.body ]
  %vec.phi109 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %29, %vector.body ]
  %23 = shl nsw i64 %index, 3
  %24 = shl i64 %index, 3
  %25 = or disjoint i64 %24, 32
  %26 = getelementptr inbounds i8, ptr %19, i64 %23
  %27 = getelementptr inbounds i8, ptr %19, i64 %25
  %wide.vec = load <8 x i32>, ptr %26, align 1
  %wide.vec110 = load <8 x i32>, ptr %27, align 1
  %strided.vec = shufflevector <8 x i32> %wide.vec, <8 x i32> poison, <4 x i32> <i32 0, i32 2, i32 4, i32 6>
  %strided.vec111 = shufflevector <8 x i32> %wide.vec110, <8 x i32> poison, <4 x i32> <i32 0, i32 2, i32 4, i32 6>
  %strided.vec112 = shufflevector <8 x i32> %wide.vec, <8 x i32> poison, <4 x i32> <i32 1, i32 3, i32 5, i32 7>
  %strided.vec113 = shufflevector <8 x i32> %wide.vec110, <8 x i32> poison, <4 x i32> <i32 1, i32 3, i32 5, i32 7>
  %28 = add <4 x i32> %strided.vec112, %vec.phi108
  %29 = add <4 x i32> %strided.vec113, %vec.phi109
  %30 = add <4 x i32> %strided.vec, %vec.phi
  %31 = add <4 x i32> %strided.vec111, %vec.phi107
  %index.next = add nuw i64 %index, 8
  %32 = icmp eq i64 %index.next, %n.vec
  br i1 %32, label %middle.block, label %vector.body, !llvm.loop !8

middle.block:                                     ; preds = %vector.body
  %bin.rdx = add <4 x i32> %31, %30
  %33 = tail call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
  %bin.rdx114 = add <4 x i32> %29, %28
  %34 = tail call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx114)
  %cmp.n = icmp eq i64 %indvars.iv89, %n.vec
  br i1 %cmp.n, label %._crit_edge, label %.lr.ph.preheader116

._crit_edge:                                      ; preds = %.lr.ph, %middle.block, %22
  %.064.lcssa = phi i32 [ %18, %22 ], [ %34, %middle.block ], [ %41, %.lr.ph ]
  %.063.lcssa = phi i32 [ 0, %22 ], [ %33, %middle.block ], [ %42, %.lr.ph ]
  %35 = shl nsw i64 %indvars.iv89, 3
  %36 = getelementptr inbounds i8, ptr %19, i64 %35
  %37 = getelementptr inbounds i8, ptr %36, i64 4
  %.0.copyload21 = load i32, ptr %37, align 1
  %.0.copyload14 = load i32, ptr %36, align 1
  %.not = icmp eq i32 %.0.copyload21, %.0.copyload14
  br i1 %.not, label %51, label %43

.lr.ph:                                           ; preds = %.lr.ph.preheader116, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ %indvars.iv.ph, %.lr.ph.preheader116 ]
  %.06370 = phi i32 [ %42, %.lr.ph ], [ %.06370.ph, %.lr.ph.preheader116 ]
  %.06469 = phi i32 [ %41, %.lr.ph ], [ %.06469.ph, %.lr.ph.preheader116 ]
  %38 = shl nsw i64 %indvars.iv, 3
  %39 = getelementptr inbounds i8, ptr %19, i64 %38
  %40 = getelementptr inbounds i8, ptr %39, i64 4
  %.0.copyload19 = load i32, ptr %40, align 1
  %.0.copyload = load i32, ptr %39, align 1
  %41 = add nsw i32 %.0.copyload19, %.06469
  %42 = add nsw i32 %.0.copyload, %.06370
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %indvars.iv89
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph, !llvm.loop !12

43:                                               ; preds = %._crit_edge
  %44 = sext i32 %.064.lcssa to i64
  %45 = getelementptr inbounds i8, ptr %0, i64 %44
  %46 = sext i32 %.0.copyload21 to i64
  %47 = getelementptr inbounds i8, ptr %45, i64 %46
  %48 = sext i32 %.063.lcssa to i64
  %49 = getelementptr inbounds i8, ptr %1, i64 %48
  %50 = tail call noundef i32 @_Z20bsc_lzp_decode_blockPKhS0_Phii(ptr noundef nonnull %45, ptr noundef nonnull %47, ptr noundef %49, i32 noundef %3, i32 noundef %4)
  br label %57

51:                                               ; preds = %._crit_edge
  %52 = sext i32 %.063.lcssa to i64
  %53 = getelementptr inbounds i8, ptr %1, i64 %52
  %54 = sext i32 %.064.lcssa to i64
  %55 = getelementptr inbounds i8, ptr %0, i64 %54
  %56 = sext i32 %.0.copyload21 to i64
  tail call void @llvm.memcpy.p0.p0.i64(ptr align 1 %53, ptr nonnull align 1 %55, i64 %56, i1 false)
  br label %57

57:                                               ; preds = %51, %43
  %.sink = phi i32 [ %.0.copyload21, %51 ], [ %50, %43 ]
  %58 = getelementptr inbounds [256 x i32], ptr %7, i64 0, i64 %indvars.iv89
  store i32 %.sink, ptr %58, align 4
  %indvars.iv.next90 = add nuw nsw i64 %indvars.iv89, 1
  %exitcond93.not = icmp eq i64 %indvars.iv.next90, %wide.trip.count92
  br i1 %exitcond93.not, label %.preheader, label %22, !llvm.loop !13

._crit_edge80.unr-lcssa:                          ; preds = %.lr.ph79, %.lr.ph79.preheader
  %spec.select.fr.lcssa.ph = phi i32 [ poison, %.lr.ph79.preheader ], [ %spec.select.fr.3, %.lr.ph79 ]
  %.lcssa.ph = phi i32 [ poison, %.lr.ph79.preheader ], [ %80, %.lr.ph79 ]
  %indvars.iv94.unr = phi i64 [ 0, %.lr.ph79.preheader ], [ %indvars.iv.next95.3, %.lr.ph79 ]
  %.06077.unr = phi i32 [ 0, %.lr.ph79.preheader ], [ %spec.select.fr.3, %.lr.ph79 ]
  %.06176.unr = phi i32 [ 0, %.lr.ph79.preheader ], [ %80, %.lr.ph79 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge80, label %.lr.ph79.epil

.lr.ph79.epil:                                    ; preds = %._crit_edge80.unr-lcssa, %.lr.ph79.epil
  %indvars.iv94.epil = phi i64 [ %indvars.iv.next95.epil, %.lr.ph79.epil ], [ %indvars.iv94.unr, %._crit_edge80.unr-lcssa ]
  %.06077.epil = phi i32 [ %spec.select.fr.epil, %.lr.ph79.epil ], [ %.06077.unr, %._crit_edge80.unr-lcssa ]
  %.06176.epil = phi i32 [ %62, %.lr.ph79.epil ], [ %.06176.unr, %._crit_edge80.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.lr.ph79.epil ], [ 0, %._crit_edge80.unr-lcssa ]
  %59 = getelementptr inbounds [256 x i32], ptr %7, i64 0, i64 %indvars.iv94.epil
  %60 = load i32, ptr %59, align 4, !tbaa !14
  %61 = icmp slt i32 %60, 0
  %spec.select.epil = select i1 %61, i32 %60, i32 %.06077.epil
  %spec.select.fr.epil = freeze i32 %spec.select.epil
  %62 = add nsw i32 %60, %.06176.epil
  %indvars.iv.next95.epil = add nuw nsw i64 %indvars.iv94.epil, 1
  %epil.iter.next = add i64 %epil.iter, 1
  %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
  br i1 %epil.iter.cmp.not, label %._crit_edge80, label %.lr.ph79.epil, !llvm.loop !16

._crit_edge80:                                    ; preds = %.lr.ph79.epil, %._crit_edge80.unr-lcssa
  %spec.select.fr.lcssa = phi i32 [ %spec.select.fr.lcssa.ph, %._crit_edge80.unr-lcssa ], [ %spec.select.fr.epil, %.lr.ph79.epil ]
  %.lcssa = phi i32 [ %.lcssa.ph, %._crit_edge80.unr-lcssa ], [ %62, %.lr.ph79.epil ]
  %63 = icmp eq i32 %spec.select.fr.lcssa, 0
  %spec.select104 = select i1 %63, i32 %.lcssa, i32 %spec.select.fr.lcssa
  br label %._crit_edge80.thread

._crit_edge80.thread:                             ; preds = %._crit_edge80, %16, %.preheader
  %64 = phi i32 [ 0, %.preheader ], [ 0, %16 ], [ %spec.select104, %._crit_edge80 ]
  call void @llvm.lifetime.end.p0(i64 1024, ptr nonnull %7) #4
  br label %81

.lr.ph79:                                         ; preds = %.lr.ph79, %.lr.ph79.preheader.new
  %indvars.iv94 = phi i64 [ 0, %.lr.ph79.preheader.new ], [ %indvars.iv.next95.3, %.lr.ph79 ]
  %.06077 = phi i32 [ 0, %.lr.ph79.preheader.new ], [ %spec.select.fr.3, %.lr.ph79 ]
  %.06176 = phi i32 [ 0, %.lr.ph79.preheader.new ], [ %80, %.lr.ph79 ]
  %niter = phi i64 [ 0, %.lr.ph79.preheader.new ], [ %niter.next.3, %.lr.ph79 ]
  %65 = getelementptr inbounds [256 x i32], ptr %7, i64 0, i64 %indvars.iv94
  %66 = load i32, ptr %65, align 16, !tbaa !14
  %67 = icmp slt i32 %66, 0
  %spec.select = select i1 %67, i32 %66, i32 %.06077
  %spec.select.fr = freeze i32 %spec.select
  %68 = add nsw i32 %66, %.06176
  %indvars.iv.next95 = or disjoint i64 %indvars.iv94, 1
  %69 = getelementptr inbounds [256 x i32], ptr %7, i64 0, i64 %indvars.iv.next95
  %70 = load i32, ptr %69, align 4, !tbaa !14
  %71 = icmp slt i32 %70, 0
  %spec.select.1 = select i1 %71, i32 %70, i32 %spec.select.fr
  %spec.select.fr.1 = freeze i32 %spec.select.1
  %72 = add nsw i32 %70, %68
  %indvars.iv.next95.1 = or disjoint i64 %indvars.iv94, 2
  %73 = getelementptr inbounds [256 x i32], ptr %7, i64 0, i64 %indvars.iv.next95.1
  %74 = load i32, ptr %73, align 8, !tbaa !14
  %75 = icmp slt i32 %74, 0
  %spec.select.2 = select i1 %75, i32 %74, i32 %spec.select.fr.1
  %spec.select.fr.2 = freeze i32 %spec.select.2
  %76 = add nsw i32 %74, %72
  %indvars.iv.next95.2 = or disjoint i64 %indvars.iv94, 3
  %77 = getelementptr inbounds [256 x i32], ptr %7, i64 0, i64 %indvars.iv.next95.2
  %78 = load i32, ptr %77, align 4, !tbaa !14
  %79 = icmp slt i32 %78, 0
  %spec.select.3 = select i1 %79, i32 %78, i32 %spec.select.fr.2
  %spec.select.fr.3 = freeze i32 %spec.select.3
  %80 = add nsw i32 %78, %76
  %indvars.iv.next95.3 = add nuw nsw i64 %indvars.iv94, 4
  %niter.next.3 = add i64 %niter, 4
  %niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
  br i1 %niter.ncmp.3, label %._crit_edge80.unr-lcssa, label %.lr.ph79, !llvm.loop !18

81:                                               ; preds = %._crit_edge80.thread, %11
  %.066 = phi i32 [ %15, %11 ], [ %64, %._crit_edge80.thread ]
  ret i32 %.066
}

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #3

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress 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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = distinct !{!8, !9, !10, !11}
!9 = !{!"llvm.loop.mustprogress"}
!10 = !{!"llvm.loop.isvectorized", i32 1}
!11 = !{!"llvm.loop.unroll.runtime.disable"}
!12 = distinct !{!12, !9, !11, !10}
!13 = distinct !{!13, !9}
!14 = !{!15, !15, i64 0}
!15 = !{!"int", !6, i64 0}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.unroll.disable"}
!18 = distinct !{!18, !9}


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