; LLVM IR from dbry/wavpack-stream :: src (entropy_utils)

; 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.WavpackMetadata = type { i32, ptr, i8 }
%struct.WavpackStream = type { %struct.WavpackHeader, %struct.words_data, ptr, ptr, ptr, ptr, ptr, i64, i64, i32, i32, i32, i8, i8, i8, i8, i8, i8, i8, i32, i32, i32, i32, i32, i32, i32, i32, %struct.bs, %struct.bs, %struct.bs, float, i8, i8, i8, i8, i8, i8, i8, i8, %struct.anon, [16 x %struct.decorr_pass], %struct.decorr_pass, ptr, %struct.anon.0 }
%struct.WavpackHeader = type { [4 x i8], i16, i16, i32 }
%struct.words_data = type { [2 x i32], [2 x i32], i32, i32, i32, i32, i32, [2 x %struct.entropy_data] }
%struct.entropy_data = type { [3 x i32], i32, i32 }
%struct.bs = type { ptr, ptr, ptr, ptr, i32, i32, i32 }
%struct.anon = type { [2 x i32], [2 x i32], [2 x i32], double, double, double, ptr, ptr, i32 }
%struct.decorr_pass = type { i32, i32, i32, i32, [8 x i32], [8 x i32], i32, i32, i32, i32 }
%struct.anon.0 = type { ptr, ptr, ptr, ptr, ptr, i8, i8, i32, i32, i32, ptr, i32, i32, i32, [2 x %struct.DSDfilters], ptr }
%struct.DSDfilters = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32 }

; Function Attrs: nounwind uwtable
define dso_local i32 @read_entropy_combined(ptr noundef %0, ptr noundef %1) #0 {
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #2
  %9 = load ptr, ptr %5, align 8, !tbaa !5
  %10 = getelementptr inbounds %struct.WavpackMetadata, ptr %9, i32 0, i32 1
  %11 = load ptr, ptr %10, align 8, !tbaa !9
  store ptr %11, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #2
  %12 = load ptr, ptr %6, align 8, !tbaa !5
  %13 = load ptr, ptr %5, align 8, !tbaa !5
  %14 = getelementptr inbounds %struct.WavpackMetadata, ptr %13, i32 0, i32 0
  %15 = load i32, ptr %14, align 8, !tbaa !12
  %16 = sext i32 %15 to i64
  %17 = getelementptr inbounds i8, ptr %12, i64 %16
  store ptr %17, ptr %7, align 8, !tbaa !5
  %18 = load ptr, ptr %5, align 8, !tbaa !5
  %19 = getelementptr inbounds %struct.WavpackMetadata, ptr %18, i32 0, i32 0
  %20 = load i32, ptr %19, align 8, !tbaa !12
  %21 = load ptr, ptr %4, align 8, !tbaa !5
  %22 = getelementptr inbounds %struct.WavpackStream, ptr %21, i32 0, i32 0
  %23 = getelementptr inbounds %struct.WavpackHeader, ptr %22, i32 0, i32 3
  %24 = load i32, ptr %23, align 8, !tbaa !13
  %25 = and i32 %24, 1073741828
  %26 = icmp ne i32 %25, 0
  %27 = zext i1 %26 to i64
  %28 = select i1 %26, i32 3, i32 6
  %29 = icmp slt i32 %20, %28
  br i1 %29, label %30, label %31

30:                                               ; preds = %2
  store i32 0, ptr %3, align 4
  store i32 1, ptr %8, align 4
  br label %186

31:                                               ; preds = %2
  %32 = load ptr, ptr %6, align 8, !tbaa !5
  %33 = getelementptr inbounds i8, ptr %32, i32 1
  store ptr %33, ptr %6, align 8, !tbaa !5
  %34 = load i8, ptr %32, align 1, !tbaa !25
  %35 = call i32 @wp_exp2_uchar(i8 noundef zeroext %34)
  %36 = load ptr, ptr %4, align 8, !tbaa !5
  %37 = getelementptr inbounds %struct.WavpackStream, ptr %36, i32 0, i32 1
  %38 = getelementptr inbounds %struct.words_data, ptr %37, i32 0, i32 7
  %39 = getelementptr inbounds [2 x %struct.entropy_data], ptr %38, i64 0, i64 0
  %40 = getelementptr inbounds %struct.entropy_data, ptr %39, i32 0, i32 0
  %41 = getelementptr inbounds [3 x i32], ptr %40, i64 0, i64 0
  store i32 %35, ptr %41, align 4, !tbaa !26
  %42 = load ptr, ptr %6, align 8, !tbaa !5
  %43 = getelementptr inbounds i8, ptr %42, i32 1
  store ptr %43, ptr %6, align 8, !tbaa !5
  %44 = load i8, ptr %42, align 1, !tbaa !25
  %45 = call i32 @wp_exp2_uchar(i8 noundef zeroext %44)
  %46 = load ptr, ptr %4, align 8, !tbaa !5
  %47 = getelementptr inbounds %struct.WavpackStream, ptr %46, i32 0, i32 1
  %48 = getelementptr inbounds %struct.words_data, ptr %47, i32 0, i32 7
  %49 = getelementptr inbounds [2 x %struct.entropy_data], ptr %48, i64 0, i64 0
  %50 = getelementptr inbounds %struct.entropy_data, ptr %49, i32 0, i32 0
  %51 = getelementptr inbounds [3 x i32], ptr %50, i64 0, i64 1
  store i32 %45, ptr %51, align 4, !tbaa !26
  %52 = load ptr, ptr %6, align 8, !tbaa !5
  %53 = getelementptr inbounds i8, ptr %52, i32 1
  store ptr %53, ptr %6, align 8, !tbaa !5
  %54 = load i8, ptr %52, align 1, !tbaa !25
  %55 = call i32 @wp_exp2_uchar(i8 noundef zeroext %54)
  %56 = load ptr, ptr %4, align 8, !tbaa !5
  %57 = getelementptr inbounds %struct.WavpackStream, ptr %56, i32 0, i32 1
  %58 = getelementptr inbounds %struct.words_data, ptr %57, i32 0, i32 7
  %59 = getelementptr inbounds [2 x %struct.entropy_data], ptr %58, i64 0, i64 0
  %60 = getelementptr inbounds %struct.entropy_data, ptr %59, i32 0, i32 0
  %61 = getelementptr inbounds [3 x i32], ptr %60, i64 0, i64 2
  store i32 %55, ptr %61, align 4, !tbaa !26
  %62 = load ptr, ptr %4, align 8, !tbaa !5
  %63 = getelementptr inbounds %struct.WavpackStream, ptr %62, i32 0, i32 0
  %64 = getelementptr inbounds %struct.WavpackHeader, ptr %63, i32 0, i32 3
  %65 = load i32, ptr %64, align 8, !tbaa !13
  %66 = and i32 %65, 1073741828
  %67 = icmp ne i32 %66, 0
  br i1 %67, label %99, label %68

68:                                               ; preds = %31
  %69 = load ptr, ptr %6, align 8, !tbaa !5
  %70 = getelementptr inbounds i8, ptr %69, i32 1
  store ptr %70, ptr %6, align 8, !tbaa !5
  %71 = load i8, ptr %69, align 1, !tbaa !25
  %72 = call i32 @wp_exp2_uchar(i8 noundef zeroext %71)
  %73 = load ptr, ptr %4, align 8, !tbaa !5
  %74 = getelementptr inbounds %struct.WavpackStream, ptr %73, i32 0, i32 1
  %75 = getelementptr inbounds %struct.words_data, ptr %74, i32 0, i32 7
  %76 = getelementptr inbounds [2 x %struct.entropy_data], ptr %75, i64 0, i64 1
  %77 = getelementptr inbounds %struct.entropy_data, ptr %76, i32 0, i32 0
  %78 = getelementptr inbounds [3 x i32], ptr %77, i64 0, i64 0
  store i32 %72, ptr %78, align 4, !tbaa !26
  %79 = load ptr, ptr %6, align 8, !tbaa !5
  %80 = getelementptr inbounds i8, ptr %79, i32 1
  store ptr %80, ptr %6, align 8, !tbaa !5
  %81 = load i8, ptr %79, align 1, !tbaa !25
  %82 = call i32 @wp_exp2_uchar(i8 noundef zeroext %81)
  %83 = load ptr, ptr %4, align 8, !tbaa !5
  %84 = getelementptr inbounds %struct.WavpackStream, ptr %83, i32 0, i32 1
  %85 = getelementptr inbounds %struct.words_data, ptr %84, i32 0, i32 7
  %86 = getelementptr inbounds [2 x %struct.entropy_data], ptr %85, i64 0, i64 1
  %87 = getelementptr inbounds %struct.entropy_data, ptr %86, i32 0, i32 0
  %88 = getelementptr inbounds [3 x i32], ptr %87, i64 0, i64 1
  store i32 %82, ptr %88, align 4, !tbaa !26
  %89 = load ptr, ptr %6, align 8, !tbaa !5
  %90 = getelementptr inbounds i8, ptr %89, i32 1
  store ptr %90, ptr %6, align 8, !tbaa !5
  %91 = load i8, ptr %89, align 1, !tbaa !25
  %92 = call i32 @wp_exp2_uchar(i8 noundef zeroext %91)
  %93 = load ptr, ptr %4, align 8, !tbaa !5
  %94 = getelementptr inbounds %struct.WavpackStream, ptr %93, i32 0, i32 1
  %95 = getelementptr inbounds %struct.words_data, ptr %94, i32 0, i32 7
  %96 = getelementptr inbounds [2 x %struct.entropy_data], ptr %95, i64 0, i64 1
  %97 = getelementptr inbounds %struct.entropy_data, ptr %96, i32 0, i32 0
  %98 = getelementptr inbounds [3 x i32], ptr %97, i64 0, i64 2
  store i32 %92, ptr %98, align 4, !tbaa !26
  br label %99

99:                                               ; preds = %68, %31
  %100 = load ptr, ptr %4, align 8, !tbaa !5
  %101 = getelementptr inbounds %struct.WavpackStream, ptr %100, i32 0, i32 0
  %102 = getelementptr inbounds %struct.WavpackHeader, ptr %101, i32 0, i32 3
  %103 = load i32, ptr %102, align 8, !tbaa !13
  %104 = and i32 %103, 8
  %105 = icmp ne i32 %104, 0
  br i1 %105, label %106, label %181

106:                                              ; preds = %99
  %107 = load ptr, ptr %4, align 8, !tbaa !5
  %108 = getelementptr inbounds %struct.WavpackStream, ptr %107, i32 0, i32 0
  %109 = getelementptr inbounds %struct.WavpackHeader, ptr %108, i32 0, i32 3
  %110 = load i32, ptr %109, align 8, !tbaa !13
  %111 = and i32 %110, 512
  %112 = icmp ne i32 %111, 0
  br i1 %112, label %113, label %159

113:                                              ; preds = %106
  %114 = load ptr, ptr %6, align 8, !tbaa !5
  %115 = load ptr, ptr %4, align 8, !tbaa !5
  %116 = getelementptr inbounds %struct.WavpackStream, ptr %115, i32 0, i32 0
  %117 = getelementptr inbounds %struct.WavpackHeader, ptr %116, i32 0, i32 3
  %118 = load i32, ptr %117, align 8, !tbaa !13
  %119 = and i32 %118, 1073741828
  %120 = icmp ne i32 %119, 0
  %121 = zext i1 %120 to i64
  %122 = select i1 %120, i32 1, i32 2
  %123 = sext i32 %122 to i64
  %124 = getelementptr inbounds i8, ptr %114, i64 %123
  %125 = load ptr, ptr %7, align 8, !tbaa !5
  %126 = icmp ugt ptr %124, %125
  br i1 %126, label %127, label %128

127:                                              ; preds = %113
  store i32 0, ptr %3, align 4
  store i32 1, ptr %8, align 4
  br label %186

128:                                              ; preds = %113
  %129 = load ptr, ptr %6, align 8, !tbaa !5
  %130 = getelementptr inbounds i8, ptr %129, i32 1
  store ptr %130, ptr %6, align 8, !tbaa !5
  %131 = load i8, ptr %129, align 1, !tbaa !25
  %132 = call i32 @wp_exp2_uchar(i8 noundef zeroext %131)
  %133 = call i32 @wp_log2(i32 noundef %132)
  %134 = shl i32 %133, 8
  %135 = load ptr, ptr %4, align 8, !tbaa !5
  %136 = getelementptr inbounds %struct.WavpackStream, ptr %135, i32 0, i32 1
  %137 = getelementptr inbounds %struct.words_data, ptr %136, i32 0, i32 7
  %138 = getelementptr inbounds [2 x %struct.entropy_data], ptr %137, i64 0, i64 0
  %139 = getelementptr inbounds %struct.entropy_data, ptr %138, i32 0, i32 1
  store i32 %134, ptr %139, align 4, !tbaa !27
  %140 = load ptr, ptr %4, align 8, !tbaa !5
  %141 = getelementptr inbounds %struct.WavpackStream, ptr %140, i32 0, i32 0
  %142 = getelementptr inbounds %struct.WavpackHeader, ptr %141, i32 0, i32 3
  %143 = load i32, ptr %142, align 8, !tbaa !13
  %144 = and i32 %143, 1073741828
  %145 = icmp ne i32 %144, 0
  br i1 %145, label %158, label %146

146:                                              ; preds = %128
  %147 = load ptr, ptr %6, align 8, !tbaa !5
  %148 = getelementptr inbounds i8, ptr %147, i32 1
  store ptr %148, ptr %6, align 8, !tbaa !5
  %149 = load i8, ptr %147, align 1, !tbaa !25
  %150 = call i32 @wp_exp2_uchar(i8 noundef zeroext %149)
  %151 = call i32 @wp_log2(i32 noundef %150)
  %152 = shl i32 %151, 8
  %153 = load ptr, ptr %4, align 8, !tbaa !5
  %154 = getelementptr inbounds %struct.WavpackStream, ptr %153, i32 0, i32 1
  %155 = getelementptr inbounds %struct.words_data, ptr %154, i32 0, i32 7
  %156 = getelementptr inbounds [2 x %struct.entropy_data], ptr %155, i64 0, i64 1
  %157 = getelementptr inbounds %struct.entropy_data, ptr %156, i32 0, i32 1
  store i32 %152, ptr %157, align 4, !tbaa !27
  br label %158

158:                                              ; preds = %146, %128
  br label %159

159:                                              ; preds = %158, %106
  %160 = load ptr, ptr %6, align 8, !tbaa !5
  %161 = getelementptr inbounds i8, ptr %160, i64 2
  %162 = load ptr, ptr %7, align 8, !tbaa !5
  %163 = icmp ugt ptr %161, %162
  br i1 %163, label %164, label %165

164:                                              ; preds = %159
  store i32 0, ptr %3, align 4
  store i32 1, ptr %8, align 4
  br label %186

165:                                              ; preds = %159
  %166 = load ptr, ptr %6, align 8, !tbaa !5
  %167 = getelementptr inbounds i8, ptr %166, i64 0
  %168 = load i8, ptr %167, align 1, !tbaa !25
  %169 = zext i8 %168 to i32
  %170 = load ptr, ptr %6, align 8, !tbaa !5
  %171 = getelementptr inbounds i8, ptr %170, i64 1
  %172 = load i8, ptr %171, align 1, !tbaa !25
  %173 = zext i8 %172 to i32
  %174 = shl i32 %173, 8
  %175 = or i32 %169, %174
  %176 = load ptr, ptr %4, align 8, !tbaa !5
  %177 = getelementptr inbounds %struct.WavpackStream, ptr %176, i32 0, i32 9
  store i32 %175, ptr %177, align 8, !tbaa !29
  %178 = load ptr, ptr %4, align 8, !tbaa !5
  call void @word_set_bitrate(ptr noundef %178)
  %179 = load ptr, ptr %6, align 8, !tbaa !5
  %180 = getelementptr inbounds i8, ptr %179, i64 2
  store ptr %180, ptr %6, align 8, !tbaa !5
  br label %181

181:                                              ; preds = %165, %99
  %182 = load ptr, ptr %6, align 8, !tbaa !5
  %183 = load ptr, ptr %7, align 8, !tbaa !5
  %184 = icmp eq ptr %182, %183
  %185 = zext i1 %184 to i32
  store i32 %185, ptr %3, align 4
  store i32 1, ptr %8, align 4
  br label %186

186:                                              ; preds = %181, %164, %127, %30
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #2
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #2
  %187 = load i32, ptr %3, align 4
  ret i32 %187
}

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

; Function Attrs: nounwind uwtable
declare dso_local i32 @wp_exp2_uchar(i8 noundef zeroext) #0

; Function Attrs: nounwind uwtable
declare dso_local i32 @wp_log2(i32 noundef) #0

; Function Attrs: nounwind uwtable
declare dso_local void @word_set_bitrate(ptr noundef) #0

; 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 = { 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 8}
!10 = !{!"", !11, i64 0, !6, i64 8, !7, i64 16}
!11 = !{!"int", !7, i64 0}
!12 = !{!10, !11, i64 0}
!13 = !{!14, !11, i64 8}
!14 = !{!"", !15, i64 0, !17, i64 12, !6, i64 88, !6, i64 96, !6, i64 104, !6, i64 112, !6, i64 120, !18, i64 128, !18, i64 136, !11, i64 144, !11, i64 148, !11, i64 152, !7, i64 156, !7, i64 157, !7, i64 158, !7, i64 159, !7, i64 160, !7, i64 161, !7, i64 162, !11, i64 164, !11, i64 168, !11, i64 172, !11, i64 176, !11, i64 180, !11, i64 184, !11, i64 188, !11, i64 192, !19, i64 200, !19, i64 248, !19, i64 296, !20, i64 344, !7, i64 348, !7, i64 349, !7, i64 350, !7, i64 351, !7, i64 352, !7, i64 353, !7, i64 354, !7, i64 355, !21, i64 360, !7, i64 432, !23, i64 1968, !6, i64 2064, !24, i64 2072}
!15 = !{!"", !7, i64 0, !16, i64 4, !16, i64 6, !11, i64 8}
!16 = !{!"short", !7, i64 0}
!17 = !{!"words_data", !7, i64 0, !7, i64 8, !11, i64 16, !11, i64 20, !11, i64 24, !11, i64 28, !11, i64 32, !7, i64 36}
!18 = !{!"long", !7, i64 0}
!19 = !{!"bs", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !11, i64 32, !11, i64 36, !11, i64 40}
!20 = !{!"float", !7, i64 0}
!21 = !{!"", !7, i64 0, !7, i64 8, !7, i64 16, !22, i64 24, !22, i64 32, !22, i64 40, !6, i64 48, !6, i64 56, !11, i64 64}
!22 = !{!"double", !7, i64 0}
!23 = !{!"decorr_pass", !11, i64 0, !11, i64 4, !11, i64 8, !11, i64 12, !7, i64 16, !7, i64 48, !11, i64 80, !11, i64 84, !11, i64 88, !11, i64 92}
!24 = !{!"", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !7, i64 40, !7, i64 41, !11, i64 44, !11, i64 48, !11, i64 52, !6, i64 56, !11, i64 64, !11, i64 68, !11, i64 72, !7, i64 76, !6, i64 160}
!25 = !{!7, !7, i64 0}
!26 = !{!11, !11, i64 0}
!27 = !{!28, !11, i64 12}
!28 = !{!"entropy_data", !7, i64 0, !11, i64 12, !11, i64 16}
!29 = !{!14, !11, i64 144}


; 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: nounwind uwtable
define dso_local range(i32 0, 2) i32 @read_entropy_combined(ptr noundef %0, ptr nocapture noundef readonly %1) local_unnamed_addr #0 {
  %3 = getelementptr inbounds i8, ptr %1, i64 8
  %4 = load ptr, ptr %3, align 8, !tbaa !5
  %5 = load i32, ptr %1, align 8, !tbaa !11
  %6 = sext i32 %5 to i64
  %7 = getelementptr inbounds i8, ptr %4, i64 %6
  %8 = getelementptr inbounds i8, ptr %0, i64 8
  %9 = load i32, ptr %8, align 8, !tbaa !12
  %10 = and i32 %9, 1073741828
  %.not = icmp eq i32 %10, 0
  %11 = select i1 %.not, i32 6, i32 3
  %12 = icmp slt i32 %5, %11
  br i1 %12, label %77, label %13

13:                                               ; preds = %2
  %14 = getelementptr inbounds i8, ptr %4, i64 1
  %15 = load i8, ptr %4, align 1, !tbaa !24
  %16 = tail call i32 @wp_exp2_uchar(i8 noundef zeroext %15)
  %17 = getelementptr inbounds i8, ptr %0, i64 48
  store i32 %16, ptr %17, align 4, !tbaa !25
  %18 = getelementptr inbounds i8, ptr %4, i64 2
  %19 = load i8, ptr %14, align 1, !tbaa !24
  %20 = tail call i32 @wp_exp2_uchar(i8 noundef zeroext %19)
  %21 = getelementptr inbounds i8, ptr %0, i64 52
  store i32 %20, ptr %21, align 4, !tbaa !25
  %22 = getelementptr inbounds i8, ptr %4, i64 3
  %23 = load i8, ptr %18, align 1, !tbaa !24
  %24 = tail call i32 @wp_exp2_uchar(i8 noundef zeroext %23)
  %25 = getelementptr inbounds i8, ptr %0, i64 56
  store i32 %24, ptr %25, align 4, !tbaa !25
  %26 = load i32, ptr %8, align 8, !tbaa !12
  %27 = and i32 %26, 1073741828
  %.not39 = icmp eq i32 %27, 0
  br i1 %.not39, label %28, label %41

28:                                               ; preds = %13
  %29 = getelementptr inbounds i8, ptr %4, i64 4
  %30 = load i8, ptr %22, align 1, !tbaa !24
  %31 = tail call i32 @wp_exp2_uchar(i8 noundef zeroext %30)
  %32 = getelementptr inbounds i8, ptr %0, i64 68
  store i32 %31, ptr %32, align 4, !tbaa !25
  %33 = getelementptr inbounds i8, ptr %4, i64 5
  %34 = load i8, ptr %29, align 1, !tbaa !24
  %35 = tail call i32 @wp_exp2_uchar(i8 noundef zeroext %34)
  %36 = getelementptr inbounds i8, ptr %0, i64 72
  store i32 %35, ptr %36, align 4, !tbaa !25
  %37 = getelementptr inbounds i8, ptr %4, i64 6
  %38 = load i8, ptr %33, align 1, !tbaa !24
  %39 = tail call i32 @wp_exp2_uchar(i8 noundef zeroext %38)
  %40 = getelementptr inbounds i8, ptr %0, i64 76
  store i32 %39, ptr %40, align 4, !tbaa !25
  %.pre = load i32, ptr %8, align 8, !tbaa !12
  br label %41

41:                                               ; preds = %28, %13
  %42 = phi i32 [ %26, %13 ], [ %.pre, %28 ]
  %.037 = phi ptr [ %22, %13 ], [ %37, %28 ]
  %43 = and i32 %42, 8
  %.not40 = icmp eq i32 %43, 0
  br i1 %.not40, label %74, label %44

44:                                               ; preds = %41
  %45 = and i32 %42, 512
  %.not41 = icmp eq i32 %45, 0
  br i1 %.not41, label %67, label %46

46:                                               ; preds = %44
  %47 = and i32 %42, 1073741828
  %.not42 = icmp eq i32 %47, 0
  %48 = select i1 %.not42, i64 2, i64 1
  %49 = getelementptr inbounds i8, ptr %.037, i64 %48
  %50 = icmp ugt ptr %49, %7
  br i1 %50, label %77, label %51

51:                                               ; preds = %46
  %52 = getelementptr inbounds i8, ptr %.037, i64 1
  %53 = load i8, ptr %.037, align 1, !tbaa !24
  %54 = tail call i32 @wp_exp2_uchar(i8 noundef zeroext %53)
  %55 = tail call i32 @wp_log2(i32 noundef %54)
  %56 = shl i32 %55, 8
  %57 = getelementptr inbounds i8, ptr %0, i64 60
  store i32 %56, ptr %57, align 4, !tbaa !26
  %58 = load i32, ptr %8, align 8, !tbaa !12
  %59 = and i32 %58, 1073741828
  %.not43 = icmp eq i32 %59, 0
  br i1 %.not43, label %60, label %67

60:                                               ; preds = %51
  %61 = getelementptr inbounds i8, ptr %.037, i64 2
  %62 = load i8, ptr %52, align 1, !tbaa !24
  %63 = tail call i32 @wp_exp2_uchar(i8 noundef zeroext %62)
  %64 = tail call i32 @wp_log2(i32 noundef %63)
  %65 = shl i32 %64, 8
  %66 = getelementptr inbounds i8, ptr %0, i64 80
  store i32 %65, ptr %66, align 4, !tbaa !26
  br label %67

67:                                               ; preds = %51, %60, %44
  %.1 = phi ptr [ %52, %51 ], [ %61, %60 ], [ %.037, %44 ]
  %68 = getelementptr inbounds i8, ptr %.1, i64 2
  %69 = icmp ugt ptr %68, %7
  br i1 %69, label %77, label %70

70:                                               ; preds = %67
  %71 = load i16, ptr %.1, align 1
  %72 = zext i16 %71 to i32
  %73 = getelementptr inbounds i8, ptr %0, i64 144
  store i32 %72, ptr %73, align 8, !tbaa !28
  tail call void @word_set_bitrate(ptr noundef nonnull %0)
  br label %74

74:                                               ; preds = %70, %41
  %.2 = phi ptr [ %68, %70 ], [ %.037, %41 ]
  %75 = icmp eq ptr %.2, %7
  %76 = zext i1 %75 to i32
  br label %77

77:                                               ; preds = %67, %46, %2, %74
  %.0 = phi i32 [ %76, %74 ], [ 0, %2 ], [ 0, %46 ], [ 0, %67 ]
  ret i32 %.0
}

; Function Attrs: nounwind uwtable
declare dso_local i32 @wp_exp2_uchar(i8 noundef zeroext) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local i32 @wp_log2(i32 noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local void @word_set_bitrate(ptr noundef) local_unnamed_addr #0

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

!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, !10, i64 8}
!6 = !{!"", !7, i64 0, !10, i64 8, !8, i64 16}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!6, !7, i64 0}
!12 = !{!13, !7, i64 8}
!13 = !{!"", !14, i64 0, !16, i64 12, !10, i64 88, !10, i64 96, !10, i64 104, !10, i64 112, !10, i64 120, !17, i64 128, !17, i64 136, !7, i64 144, !7, i64 148, !7, i64 152, !8, i64 156, !8, i64 157, !8, i64 158, !8, i64 159, !8, i64 160, !8, i64 161, !8, i64 162, !7, i64 164, !7, i64 168, !7, i64 172, !7, i64 176, !7, i64 180, !7, i64 184, !7, i64 188, !7, i64 192, !18, i64 200, !18, i64 248, !18, i64 296, !19, i64 344, !8, i64 348, !8, i64 349, !8, i64 350, !8, i64 351, !8, i64 352, !8, i64 353, !8, i64 354, !8, i64 355, !20, i64 360, !8, i64 432, !22, i64 1968, !10, i64 2064, !23, i64 2072}
!14 = !{!"", !8, i64 0, !15, i64 4, !15, i64 6, !7, i64 8}
!15 = !{!"short", !8, i64 0}
!16 = !{!"words_data", !8, i64 0, !8, i64 8, !7, i64 16, !7, i64 20, !7, i64 24, !7, i64 28, !7, i64 32, !8, i64 36}
!17 = !{!"long", !8, i64 0}
!18 = !{!"bs", !10, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !7, i64 32, !7, i64 36, !7, i64 40}
!19 = !{!"float", !8, i64 0}
!20 = !{!"", !8, i64 0, !8, i64 8, !8, i64 16, !21, i64 24, !21, i64 32, !21, i64 40, !10, i64 48, !10, i64 56, !7, i64 64}
!21 = !{!"double", !8, i64 0}
!22 = !{!"decorr_pass", !7, i64 0, !7, i64 4, !7, i64 8, !7, i64 12, !8, i64 16, !8, i64 48, !7, i64 80, !7, i64 84, !7, i64 88, !7, i64 92}
!23 = !{!"", !10, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !10, i64 32, !8, i64 40, !8, i64 41, !7, i64 44, !7, i64 48, !7, i64 52, !10, i64 56, !7, i64 64, !7, i64 68, !7, i64 72, !8, i64 76, !10, i64 160}
!24 = !{!8, !8, i64 0}
!25 = !{!7, !7, i64 0}
!26 = !{!27, !7, i64 12}
!27 = !{!"entropy_data", !8, i64 0, !7, i64 12, !7, i64 16}
!28 = !{!13, !7, i64 144}


; Effective O3 passes: AggressiveInstCombinePass,CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass