; LLVM IR from catid/Zpng :: zstd (huf_decompress)

; 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.DTableDesc = type { i8, i8, i8, i8 }
%struct.HUF_DEltX2 = type { i8, i8 }

; Function Attrs: nounwind uwtable
define dso_local i64 @HUF_readDTableX2_wksp(ptr noundef %0, ptr noundef %1, i64 noundef %2, ptr noundef %3, i64 noundef %4) #0 {
  %6 = alloca i64, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i64, align 8
  %10 = alloca ptr, align 8
  %11 = alloca i64, align 8
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i64, align 8
  %15 = alloca ptr, align 8
  %16 = alloca ptr, align 8
  %17 = alloca ptr, align 8
  %18 = alloca ptr, align 8
  %19 = alloca i64, align 8
  %20 = alloca i32, align 4
  %21 = alloca %struct.DTableDesc, align 1
  %22 = alloca i32, align 4
  %23 = alloca i32, align 4
  %24 = alloca i32, align 4
  %25 = alloca i32, align 4
  %26 = alloca i32, align 4
  %27 = alloca i32, align 4
  %28 = alloca i32, align 4
  %29 = alloca %struct.HUF_DEltX2, align 1
  store ptr %0, ptr %7, align 8, !tbaa !5
  store ptr %1, ptr %8, align 8, !tbaa !5
  store i64 %2, ptr %9, align 8, !tbaa !9
  store ptr %3, ptr %10, align 8, !tbaa !5
  store i64 %4, ptr %11, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #4
  store i32 0, ptr %12, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #4
  store i32 0, ptr %13, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #4
  %30 = load ptr, ptr %7, align 8, !tbaa !5
  %31 = getelementptr inbounds i32, ptr %30, i64 1
  store ptr %31, ptr %15, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #4
  %32 = load ptr, ptr %15, align 8, !tbaa !5
  store ptr %32, ptr %16, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #4
  store i64 0, ptr %19, align 8, !tbaa !9
  %33 = load ptr, ptr %10, align 8, !tbaa !5
  %34 = load i64, ptr %19, align 8, !tbaa !9
  %35 = getelementptr inbounds i32, ptr %33, i64 %34
  store ptr %35, ptr %17, align 8, !tbaa !5
  %36 = load i64, ptr %19, align 8, !tbaa !9
  %37 = add i64 %36, 16
  store i64 %37, ptr %19, align 8, !tbaa !9
  %38 = load ptr, ptr %10, align 8, !tbaa !5
  %39 = load i64, ptr %19, align 8, !tbaa !9
  %40 = getelementptr inbounds i32, ptr %38, i64 %39
  store ptr %40, ptr %18, align 8, !tbaa !5
  %41 = load i64, ptr %19, align 8, !tbaa !9
  %42 = add i64 %41, 64
  store i64 %42, ptr %19, align 8, !tbaa !9
  %43 = load i64, ptr %19, align 8, !tbaa !9
  %44 = shl i64 %43, 2
  %45 = load i64, ptr %11, align 8, !tbaa !9
  %46 = icmp ugt i64 %44, %45
  br i1 %46, label %47, label %48

47:                                               ; preds = %5
  store i64 -44, ptr %6, align 8
  store i32 1, ptr %20, align 4
  br label %163

48:                                               ; preds = %5
  %49 = load ptr, ptr %18, align 8, !tbaa !5
  %50 = load ptr, ptr %17, align 8, !tbaa !5
  %51 = load ptr, ptr %8, align 8, !tbaa !5
  %52 = load i64, ptr %9, align 8, !tbaa !9
  %53 = call i64 @HUF_readStats(ptr noundef %49, i64 noundef 256, ptr noundef %50, ptr noundef %13, ptr noundef %12, ptr noundef %51, i64 noundef %52)
  store i64 %53, ptr %14, align 8, !tbaa !9
  %54 = load i64, ptr %14, align 8, !tbaa !9
  %55 = call i32 @ERR_isError(i64 noundef %54)
  %56 = icmp ne i32 %55, 0
  br i1 %56, label %57, label %59

57:                                               ; preds = %48
  %58 = load i64, ptr %14, align 8, !tbaa !9
  store i64 %58, ptr %6, align 8
  store i32 1, ptr %20, align 4
  br label %163

59:                                               ; preds = %48
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #4
  %60 = load ptr, ptr %7, align 8, !tbaa !5
  %61 = call i32 @HUF_getDTableDesc(ptr noundef %60)
  store i32 %61, ptr %21, align 1
  %62 = load i32, ptr %12, align 4, !tbaa !11
  %63 = getelementptr inbounds %struct.DTableDesc, ptr %21, i32 0, i32 0
  %64 = load i8, ptr %63, align 1, !tbaa !13
  %65 = zext i8 %64 to i32
  %66 = add nsw i32 %65, 1
  %67 = icmp ugt i32 %62, %66
  br i1 %67, label %68, label %69

68:                                               ; preds = %59
  store i64 -44, ptr %6, align 8
  store i32 1, ptr %20, align 4
  br label %75

69:                                               ; preds = %59
  %70 = getelementptr inbounds %struct.DTableDesc, ptr %21, i32 0, i32 1
  store i8 0, ptr %70, align 1, !tbaa !15
  %71 = load i32, ptr %12, align 4, !tbaa !11
  %72 = trunc i32 %71 to i8
  %73 = getelementptr inbounds %struct.DTableDesc, ptr %21, i32 0, i32 2
  store i8 %72, ptr %73, align 1, !tbaa !16
  %74 = load ptr, ptr %7, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %74, ptr align 1 %21, i64 4, i1 false)
  store i32 0, ptr %20, align 4
  br label %75

75:                                               ; preds = %69, %68
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #4
  %76 = load i32, ptr %20, align 4
  switch i32 %76, label %163 [
    i32 0, label %77
  ]

77:                                               ; preds = %75
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #4
  store i32 0, ptr %23, align 4, !tbaa !11
  store i32 1, ptr %22, align 4, !tbaa !11
  br label %78

78:                                               ; preds = %100, %77
  %79 = load i32, ptr %22, align 4, !tbaa !11
  %80 = load i32, ptr %12, align 4, !tbaa !11
  %81 = add i32 %80, 1
  %82 = icmp ult i32 %79, %81
  br i1 %82, label %83, label %103

83:                                               ; preds = %78
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #4
  %84 = load i32, ptr %23, align 4, !tbaa !11
  store i32 %84, ptr %24, align 4, !tbaa !11
  %85 = load ptr, ptr %17, align 8, !tbaa !5
  %86 = load i32, ptr %22, align 4, !tbaa !11
  %87 = zext i32 %86 to i64
  %88 = getelementptr inbounds i32, ptr %85, i64 %87
  %89 = load i32, ptr %88, align 4, !tbaa !11
  %90 = load i32, ptr %22, align 4, !tbaa !11
  %91 = sub i32 %90, 1
  %92 = shl i32 %89, %91
  %93 = load i32, ptr %23, align 4, !tbaa !11
  %94 = add i32 %93, %92
  store i32 %94, ptr %23, align 4, !tbaa !11
  %95 = load i32, ptr %24, align 4, !tbaa !11
  %96 = load ptr, ptr %17, align 8, !tbaa !5
  %97 = load i32, ptr %22, align 4, !tbaa !11
  %98 = zext i32 %97 to i64
  %99 = getelementptr inbounds i32, ptr %96, i64 %98
  store i32 %95, ptr %99, align 4, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #4
  br label %100

100:                                              ; preds = %83
  %101 = load i32, ptr %22, align 4, !tbaa !11
  %102 = add i32 %101, 1
  store i32 %102, ptr %22, align 4, !tbaa !11
  br label %78, !llvm.loop !17

103:                                              ; preds = %78
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #4
  store i32 0, ptr %25, align 4, !tbaa !11
  br label %104

104:                                              ; preds = %158, %103
  %105 = load i32, ptr %25, align 4, !tbaa !11
  %106 = load i32, ptr %13, align 4, !tbaa !11
  %107 = icmp ult i32 %105, %106
  br i1 %107, label %108, label %161

108:                                              ; preds = %104
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #4
  %109 = load ptr, ptr %18, align 8, !tbaa !5
  %110 = load i32, ptr %25, align 4, !tbaa !11
  %111 = zext i32 %110 to i64
  %112 = getelementptr inbounds i8, ptr %109, i64 %111
  %113 = load i8, ptr %112, align 1, !tbaa !19
  %114 = zext i8 %113 to i32
  store i32 %114, ptr %26, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #4
  %115 = load i32, ptr %26, align 4, !tbaa !11
  %116 = shl i32 1, %115
  %117 = ashr i32 %116, 1
  store i32 %117, ptr %27, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %28) #4
  call void @llvm.lifetime.start.p0(i64 2, ptr %29) #4
  %118 = load i32, ptr %25, align 4, !tbaa !11
  %119 = trunc i32 %118 to i8
  %120 = getelementptr inbounds %struct.HUF_DEltX2, ptr %29, i32 0, i32 0
  store i8 %119, ptr %120, align 1, !tbaa !20
  %121 = load i32, ptr %12, align 4, !tbaa !11
  %122 = add i32 %121, 1
  %123 = load i32, ptr %26, align 4, !tbaa !11
  %124 = sub i32 %122, %123
  %125 = trunc i32 %124 to i8
  %126 = getelementptr inbounds %struct.HUF_DEltX2, ptr %29, i32 0, i32 1
  store i8 %125, ptr %126, align 1, !tbaa !22
  %127 = load ptr, ptr %17, align 8, !tbaa !5
  %128 = load i32, ptr %26, align 4, !tbaa !11
  %129 = zext i32 %128 to i64
  %130 = getelementptr inbounds i32, ptr %127, i64 %129
  %131 = load i32, ptr %130, align 4, !tbaa !11
  store i32 %131, ptr %28, align 4, !tbaa !11
  br label %132

132:                                              ; preds = %147, %108
  %133 = load i32, ptr %28, align 4, !tbaa !11
  %134 = load ptr, ptr %17, align 8, !tbaa !5
  %135 = load i32, ptr %26, align 4, !tbaa !11
  %136 = zext i32 %135 to i64
  %137 = getelementptr inbounds i32, ptr %134, i64 %136
  %138 = load i32, ptr %137, align 4, !tbaa !11
  %139 = load i32, ptr %27, align 4, !tbaa !11
  %140 = add i32 %138, %139
  %141 = icmp ult i32 %133, %140
  br i1 %141, label %142, label %150

142:                                              ; preds = %132
  %143 = load ptr, ptr %16, align 8, !tbaa !5
  %144 = load i32, ptr %28, align 4, !tbaa !11
  %145 = zext i32 %144 to i64
  %146 = getelementptr inbounds %struct.HUF_DEltX2, ptr %143, i64 %145
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %146, ptr align 1 %29, i64 2, i1 false), !tbaa.struct !23
  br label %147

147:                                              ; preds = %142
  %148 = load i32, ptr %28, align 4, !tbaa !11
  %149 = add i32 %148, 1
  store i32 %149, ptr %28, align 4, !tbaa !11
  br label %132, !llvm.loop !24

150:                                              ; preds = %132
  %151 = load i32, ptr %27, align 4, !tbaa !11
  %152 = load ptr, ptr %17, align 8, !tbaa !5
  %153 = load i32, ptr %26, align 4, !tbaa !11
  %154 = zext i32 %153 to i64
  %155 = getelementptr inbounds i32, ptr %152, i64 %154
  %156 = load i32, ptr %155, align 4, !tbaa !11
  %157 = add i32 %156, %151
  store i32 %157, ptr %155, align 4, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 2, ptr %29) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %28) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #4
  br label %158

158:                                              ; preds = %150
  %159 = load i32, ptr %25, align 4, !tbaa !11
  %160 = add i32 %159, 1
  store i32 %160, ptr %25, align 4, !tbaa !11
  br label %104, !llvm.loop !25

161:                                              ; preds = %104
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #4
  %162 = load i64, ptr %14, align 8, !tbaa !9
  store i64 %162, ptr %6, align 8
  store i32 1, ptr %20, align 4
  br label %163

163:                                              ; preds = %161, %75, %57, %47
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #4
  %164 = load i64, ptr %6, align 8
  ret i64 %164
}

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

declare i64 @HUF_readStats(ptr noundef, i64 noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, i64 noundef) #2

; Function Attrs: nounwind uwtable
declare hidden i32 @ERR_isError(i64 noundef) #0

; Function Attrs: nounwind uwtable
declare hidden i32 @HUF_getDTableDesc(ptr noundef) #0

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

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

attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!14, !7, i64 0}
!14 = !{!"", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3}
!15 = !{!14, !7, i64 1}
!16 = !{!14, !7, i64 2}
!17 = distinct !{!17, !18}
!18 = !{!"llvm.loop.mustprogress"}
!19 = !{!7, !7, i64 0}
!20 = !{!21, !7, i64 0}
!21 = !{!"", !7, i64 0, !7, i64 1}
!22 = !{!21, !7, i64 1}
!23 = !{i64 0, i64 1, !19, i64 1, i64 1, !19}
!24 = distinct !{!24, !18}
!25 = distinct !{!25, !18}


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

; Function Attrs: nounwind uwtable
define dso_local noundef i64 @HUF_readDTableX2_wksp(ptr noundef %0, ptr noundef %1, i64 noundef %2, ptr noundef %3, i64 noundef %4) local_unnamed_addr #0 {
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #3
  store i32 0, ptr %6, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #3
  store i32 0, ptr %7, align 4, !tbaa !5
  %8 = getelementptr inbounds i8, ptr %0, i64 4
  %9 = getelementptr inbounds i8, ptr %3, i64 64
  %10 = icmp ult i64 %4, 320
  br i1 %10, label %.critedge, label %11

11:                                               ; preds = %5
  %12 = call i64 @HUF_readStats(ptr noundef nonnull %9, i64 noundef 256, ptr noundef %3, ptr noundef nonnull %7, ptr noundef nonnull %6, ptr noundef %1, i64 noundef %2) #3
  %13 = call i32 @ERR_isError(i64 noundef %12)
  %.not = icmp eq i32 %13, 0
  br i1 %.not, label %14, label %.critedge

14:                                               ; preds = %11
  %15 = call i32 @HUF_getDTableDesc(ptr noundef %0)
  %16 = load i32, ptr %6, align 4, !tbaa !5
  %17 = and i32 %15, 255
  %18 = add nuw nsw i32 %17, 1
  %.not56 = icmp ugt i32 %16, %18
  br i1 %.not56, label %.critedge, label %19

19:                                               ; preds = %14
  %.sroa.022.0.extract.trunc = trunc i32 %15 to i8
  %.sroa.7.0.extract.shift = lshr i32 %15, 24
  %.sroa.7.0.extract.trunc = trunc nuw i32 %.sroa.7.0.extract.shift to i8
  %20 = trunc i32 %16 to i8
  store i8 %.sroa.022.0.extract.trunc, ptr %0, align 4
  %.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %0, i64 1
  store i8 0, ptr %.sroa.5.0..sroa_idx, align 1
  %.sroa.6.0..sroa_idx = getelementptr inbounds i8, ptr %0, i64 2
  store i8 %20, ptr %.sroa.6.0..sroa_idx, align 2
  %.sroa.7.0..sroa_idx = getelementptr inbounds i8, ptr %0, i64 3
  store i8 %.sroa.7.0.extract.trunc, ptr %.sroa.7.0..sroa_idx, align 1
  %.not5758 = icmp eq i32 %16, 0
  br i1 %.not5758, label %.preheader, label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %19
  %xtraiter = and i32 %16, 1
  %21 = icmp eq i32 %16, 1
  br i1 %21, label %.preheader.loopexit.unr-lcssa, label %.lr.ph.preheader.new

.lr.ph.preheader.new:                             ; preds = %.lr.ph.preheader
  %unroll_iter = and i32 %16, -2
  br label %.lr.ph

.preheader.loopexit.unr-lcssa:                    ; preds = %.lr.ph, %.lr.ph.preheader
  %indvars.iv.unr = phi i64 [ 1, %.lr.ph.preheader ], [ %indvars.iv.next.1, %.lr.ph ]
  %.05459.unr = phi i32 [ 0, %.lr.ph.preheader ], [ %36, %.lr.ph ]
  %lcmp.mod.not = icmp eq i32 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.preheader, label %.lr.ph.epil

.lr.ph.epil:                                      ; preds = %.preheader.loopexit.unr-lcssa
  %22 = getelementptr inbounds i32, ptr %3, i64 %indvars.iv.unr
  store i32 %.05459.unr, ptr %22, align 4, !tbaa !5
  br label %.preheader

.preheader:                                       ; preds = %.lr.ph.epil, %.preheader.loopexit.unr-lcssa, %19
  %23 = load i32, ptr %7, align 4, !tbaa !5
  %.not65 = icmp eq i32 %23, 0
  br i1 %.not65, label %.critedge, label %.lr.ph64

.lr.ph64:                                         ; preds = %.preheader
  %24 = add i8 %20, 1
  %wide.trip.count = zext i32 %23 to i64
  br label %37

.lr.ph:                                           ; preds = %.lr.ph, %.lr.ph.preheader.new
  %indvars.iv = phi i64 [ 1, %.lr.ph.preheader.new ], [ %indvars.iv.next.1, %.lr.ph ]
  %.05459 = phi i32 [ 0, %.lr.ph.preheader.new ], [ %36, %.lr.ph ]
  %niter = phi i32 [ 0, %.lr.ph.preheader.new ], [ %niter.next.1, %.lr.ph ]
  %25 = getelementptr inbounds i32, ptr %3, i64 %indvars.iv
  %26 = load i32, ptr %25, align 4, !tbaa !5
  %27 = trunc i64 %indvars.iv to i32
  %28 = add nsw i32 %27, -1
  %29 = shl i32 %26, %28
  %30 = add i32 %29, %.05459
  store i32 %.05459, ptr %25, align 4, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %31 = getelementptr inbounds i32, ptr %3, i64 %indvars.iv.next
  %32 = load i32, ptr %31, align 4, !tbaa !5
  %33 = trunc i64 %indvars.iv.next to i32
  %34 = add i32 %33, -1
  %35 = shl i32 %32, %34
  %36 = add i32 %35, %30
  store i32 %30, ptr %31, align 4, !tbaa !5
  %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
  %niter.next.1 = add i32 %niter, 2
  %niter.ncmp.1 = icmp eq i32 %niter.next.1, %unroll_iter
  br i1 %niter.ncmp.1, label %.preheader.loopexit.unr-lcssa, label %.lr.ph, !llvm.loop !9

37:                                               ; preds = %.lr.ph64, %._crit_edge
  %indvars.iv71 = phi i64 [ 0, %.lr.ph64 ], [ %indvars.iv.next72, %._crit_edge ]
  %38 = getelementptr inbounds i8, ptr %9, i64 %indvars.iv71
  %39 = load i8, ptr %38, align 1, !tbaa !11
  %40 = zext nneg i8 %39 to i32
  %41 = shl nuw i32 1, %40
  %42 = ashr i32 %41, 1
  %43 = trunc i64 %indvars.iv71 to i8
  %44 = sub i8 %24, %39
  %45 = zext i8 %39 to i64
  %46 = getelementptr inbounds i32, ptr %3, i64 %45
  %47 = load i32, ptr %46, align 4, !tbaa !5
  %48 = add i32 %47, %42
  %49 = icmp ult i32 %47, %48
  br i1 %49, label %.lr.ph62.preheader, label %._crit_edge

.lr.ph62.preheader:                               ; preds = %37
  %50 = zext i32 %47 to i64
  br label %.lr.ph62

.lr.ph62:                                         ; preds = %.lr.ph62.preheader, %.lr.ph62
  %indvars.iv68 = phi i64 [ %50, %.lr.ph62.preheader ], [ %indvars.iv.next69, %.lr.ph62 ]
  %51 = getelementptr inbounds %struct.HUF_DEltX2, ptr %8, i64 %indvars.iv68
  store i8 %43, ptr %51, align 1, !tbaa !11
  %.sroa.4.0..sroa_idx = getelementptr inbounds i8, ptr %51, i64 1
  store i8 %44, ptr %.sroa.4.0..sroa_idx, align 1, !tbaa !11
  %indvars.iv.next69 = add nuw nsw i64 %indvars.iv68, 1
  %52 = load i32, ptr %46, align 4, !tbaa !5
  %53 = add i32 %52, %42
  %54 = zext i32 %53 to i64
  %55 = icmp ult i64 %indvars.iv.next69, %54
  br i1 %55, label %.lr.ph62, label %._crit_edge, !llvm.loop !12

._crit_edge:                                      ; preds = %.lr.ph62, %37
  %.lcssa = phi i32 [ %48, %37 ], [ %53, %.lr.ph62 ]
  store i32 %.lcssa, ptr %46, align 4, !tbaa !5
  %indvars.iv.next72 = add nuw nsw i64 %indvars.iv71, 1
  %exitcond74.not = icmp eq i64 %indvars.iv.next72, %wide.trip.count
  br i1 %exitcond74.not, label %.critedge, label %37, !llvm.loop !13

.critedge:                                        ; preds = %._crit_edge, %.preheader, %14, %11, %5
  %.1 = phi i64 [ -44, %5 ], [ %12, %11 ], [ -44, %14 ], [ %12, %.preheader ], [ %12, %._crit_edge ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #3
  ret i64 %.1
}

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

declare i64 @HUF_readStats(ptr noundef, i64 noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, i64 noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare hidden i32 @ERR_isError(i64 noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare hidden i32 @HUF_getDTableDesc(ptr noundef) local_unnamed_addr #0

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

attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!7, !7, i64 0}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}


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