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

; 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.WavpackContext = type { %struct.WavpackStreamConfig, ptr, i32, i32, ptr, i32, ptr, ptr, ptr, ptr, ptr, ptr, i64, i64, i64, i64, i64, i64, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, ptr, ptr, i8, ptr, ptr, i32, i32, ptr, [8 x i8], ptr, [80 x i8] }
%struct.WavpackStreamConfig = type { float, float, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, [16 x i8], i8, i32, ptr }
%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 void @pack_init(ptr noundef %0) #0 {
  %2 = alloca ptr, align 8
  %3 = alloca ptr, align 8
  %4 = alloca i32, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #6
  %5 = load ptr, ptr %2, align 8, !tbaa !5
  %6 = getelementptr inbounds %struct.WavpackContext, ptr %5, i32 0, i32 36
  %7 = load ptr, ptr %6, align 8, !tbaa !9
  %8 = load ptr, ptr %2, align 8, !tbaa !5
  %9 = getelementptr inbounds %struct.WavpackContext, ptr %8, i32 0, i32 33
  %10 = load i32, ptr %9, align 4, !tbaa !15
  %11 = sext i32 %10 to i64
  %12 = getelementptr inbounds ptr, ptr %7, i64 %11
  %13 = load ptr, ptr %12, align 8, !tbaa !5
  store ptr %13, ptr %3, align 8, !tbaa !5
  %14 = load ptr, ptr %3, align 8, !tbaa !5
  %15 = getelementptr inbounds %struct.WavpackStream, ptr %14, i32 0, i32 7
  store i64 0, ptr %15, align 8, !tbaa !16
  %16 = load ptr, ptr %3, align 8, !tbaa !5
  %17 = getelementptr inbounds %struct.WavpackStream, ptr %16, i32 0, i32 30
  store float 2.000000e+00, ptr %17, align 8, !tbaa !26
  %18 = load ptr, ptr %3, align 8, !tbaa !5
  %19 = getelementptr inbounds %struct.WavpackStream, ptr %18, i32 0, i32 40
  call void @llvm.memset.p0.i64(ptr align 8 %19, i8 0, i64 1536, i1 false)
  %20 = load ptr, ptr %3, align 8, !tbaa !5
  %21 = getelementptr inbounds %struct.WavpackStream, ptr %20, i32 0, i32 39
  call void @llvm.memset.p0.i64(ptr align 8 %21, i8 0, i64 72, i1 false)
  %22 = load ptr, ptr %3, align 8, !tbaa !5
  %23 = getelementptr inbounds %struct.WavpackStream, ptr %22, i32 0, i32 41
  call void @llvm.memset.p0.i64(ptr align 8 %23, i8 0, i64 96, i1 false)
  %24 = load ptr, ptr %3, align 8, !tbaa !5
  %25 = getelementptr inbounds %struct.WavpackStream, ptr %24, i32 0, i32 41
  %26 = getelementptr inbounds %struct.decorr_pass, ptr %25, i32 0, i32 0
  store i32 18, ptr %26, align 8, !tbaa !27
  %27 = load ptr, ptr %3, align 8, !tbaa !5
  %28 = getelementptr inbounds %struct.WavpackStream, ptr %27, i32 0, i32 41
  %29 = getelementptr inbounds %struct.decorr_pass, ptr %28, i32 0, i32 1
  store i32 2, ptr %29, align 4, !tbaa !28
  %30 = load ptr, ptr %2, align 8, !tbaa !5
  %31 = getelementptr inbounds %struct.WavpackContext, ptr %30, i32 0, i32 0
  %32 = getelementptr inbounds %struct.WavpackStreamConfig, ptr %31, i32 0, i32 5
  %33 = load i32, ptr %32, align 4, !tbaa !29
  %34 = and i32 %33, 16384
  %35 = icmp ne i32 %34, 0
  br i1 %35, label %36, label %75

36:                                               ; preds = %1
  %37 = load ptr, ptr %2, align 8, !tbaa !5
  %38 = getelementptr inbounds %struct.WavpackContext, ptr %37, i32 0, i32 0
  %39 = getelementptr inbounds %struct.WavpackStreamConfig, ptr %38, i32 0, i32 5
  %40 = load i32, ptr %39, align 4, !tbaa !29
  %41 = and i32 %40, 1048576
  %42 = icmp ne i32 %41, 0
  br i1 %42, label %43, label %52

43:                                               ; preds = %36
  %44 = load ptr, ptr %3, align 8, !tbaa !5
  %45 = getelementptr inbounds %struct.WavpackStream, ptr %44, i32 0, i32 39
  %46 = getelementptr inbounds %struct.anon, ptr %45, i32 0, i32 0
  %47 = getelementptr inbounds [2 x i32], ptr %46, i64 0, i64 1
  store i32 -33554432, ptr %47, align 4, !tbaa !30
  %48 = load ptr, ptr %3, align 8, !tbaa !5
  %49 = getelementptr inbounds %struct.WavpackStream, ptr %48, i32 0, i32 39
  %50 = getelementptr inbounds %struct.anon, ptr %49, i32 0, i32 0
  %51 = getelementptr inbounds [2 x i32], ptr %50, i64 0, i64 0
  store i32 -33554432, ptr %51, align 8, !tbaa !30
  br label %74

52:                                               ; preds = %36
  %53 = load ptr, ptr %2, align 8, !tbaa !5
  %54 = getelementptr inbounds %struct.WavpackContext, ptr %53, i32 0, i32 0
  %55 = getelementptr inbounds %struct.WavpackStreamConfig, ptr %54, i32 0, i32 12
  %56 = load i32, ptr %55, align 8, !tbaa !31
  %57 = icmp sge i32 %56, 64000
  br i1 %57, label %58, label %67

58:                                               ; preds = %52
  %59 = load ptr, ptr %3, align 8, !tbaa !5
  %60 = getelementptr inbounds %struct.WavpackStream, ptr %59, i32 0, i32 39
  %61 = getelementptr inbounds %struct.anon, ptr %60, i32 0, i32 0
  %62 = getelementptr inbounds [2 x i32], ptr %61, i64 0, i64 1
  store i32 67108864, ptr %62, align 4, !tbaa !30
  %63 = load ptr, ptr %3, align 8, !tbaa !5
  %64 = getelementptr inbounds %struct.WavpackStream, ptr %63, i32 0, i32 39
  %65 = getelementptr inbounds %struct.anon, ptr %64, i32 0, i32 0
  %66 = getelementptr inbounds [2 x i32], ptr %65, i64 0, i64 0
  store i32 67108864, ptr %66, align 8, !tbaa !30
  br label %73

67:                                               ; preds = %52
  %68 = load ptr, ptr %2, align 8, !tbaa !5
  %69 = getelementptr inbounds %struct.WavpackContext, ptr %68, i32 0, i32 0
  %70 = getelementptr inbounds %struct.WavpackStreamConfig, ptr %69, i32 0, i32 5
  %71 = load i32, ptr %70, align 4, !tbaa !29
  %72 = or i32 %71, 131072
  store i32 %72, ptr %70, align 4, !tbaa !29
  br label %73

73:                                               ; preds = %67, %58
  br label %74

74:                                               ; preds = %73, %43
  br label %98

75:                                               ; preds = %1
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #6
  %76 = load ptr, ptr %2, align 8, !tbaa !5
  %77 = getelementptr inbounds %struct.WavpackContext, ptr %76, i32 0, i32 0
  %78 = getelementptr inbounds %struct.WavpackStreamConfig, ptr %77, i32 0, i32 1
  %79 = load float, ptr %78, align 4, !tbaa !32
  %80 = fpext float %79 to double
  %81 = call double @llvm.fmuladd.f64(double %80, double 1.024000e+03, double 5.000000e-01)
  %82 = call double @llvm.floor.f64(double %81)
  %83 = fptosi double %82 to i32
  store i32 %83, ptr %4, align 4, !tbaa !30
  %84 = load i32, ptr %4, align 4, !tbaa !30
  %85 = icmp sle i32 %84, -1000
  br i1 %85, label %86, label %87

86:                                               ; preds = %75
  store i32 -1000, ptr %4, align 4, !tbaa !30
  br label %87

87:                                               ; preds = %86, %75
  %88 = load i32, ptr %4, align 4, !tbaa !30
  %89 = shl i32 %88, 16
  %90 = load ptr, ptr %3, align 8, !tbaa !5
  %91 = getelementptr inbounds %struct.WavpackStream, ptr %90, i32 0, i32 39
  %92 = getelementptr inbounds %struct.anon, ptr %91, i32 0, i32 0
  %93 = getelementptr inbounds [2 x i32], ptr %92, i64 0, i64 1
  store i32 %89, ptr %93, align 4, !tbaa !30
  %94 = load ptr, ptr %3, align 8, !tbaa !5
  %95 = getelementptr inbounds %struct.WavpackStream, ptr %94, i32 0, i32 39
  %96 = getelementptr inbounds %struct.anon, ptr %95, i32 0, i32 0
  %97 = getelementptr inbounds [2 x i32], ptr %96, i64 0, i64 0
  store i32 %89, ptr %97, align 8, !tbaa !30
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  br label %98

98:                                               ; preds = %87, %74
  %99 = load ptr, ptr %2, align 8, !tbaa !5
  %100 = getelementptr inbounds %struct.WavpackContext, ptr %99, i32 0, i32 0
  %101 = getelementptr inbounds %struct.WavpackStreamConfig, ptr %100, i32 0, i32 5
  %102 = load i32, ptr %101, align 4, !tbaa !29
  %103 = and i32 %102, 131072
  %104 = icmp ne i32 %103, 0
  br i1 %104, label %105, label %115

105:                                              ; preds = %98
  %106 = load ptr, ptr %2, align 8, !tbaa !5
  %107 = getelementptr inbounds %struct.WavpackContext, ptr %106, i32 0, i32 26
  %108 = load i32, ptr %107, align 8, !tbaa !33
  %109 = zext i32 %108 to i64
  %110 = mul i64 %109, 2
  %111 = call noalias ptr @malloc(i64 noundef %110) #7
  %112 = load ptr, ptr %3, align 8, !tbaa !5
  %113 = getelementptr inbounds %struct.WavpackStream, ptr %112, i32 0, i32 39
  %114 = getelementptr inbounds %struct.anon, ptr %113, i32 0, i32 6
  store ptr %111, ptr %114, align 8, !tbaa !34
  br label %115

115:                                              ; preds = %105, %98
  %116 = load ptr, ptr %2, align 8, !tbaa !5
  %117 = getelementptr inbounds %struct.WavpackContext, ptr %116, i32 0, i32 0
  %118 = getelementptr inbounds %struct.WavpackStreamConfig, ptr %117, i32 0, i32 6
  %119 = load i32, ptr %118, align 8, !tbaa !35
  %120 = icmp ne i32 %119, 0
  br i1 %120, label %124, label %121

121:                                              ; preds = %115
  %122 = load ptr, ptr %3, align 8, !tbaa !5
  %123 = getelementptr inbounds %struct.WavpackStream, ptr %122, i32 0, i32 20
  store i32 0, ptr %123, align 8, !tbaa !36
  br label %147

124:                                              ; preds = %115
  %125 = load ptr, ptr %2, align 8, !tbaa !5
  %126 = getelementptr inbounds %struct.WavpackContext, ptr %125, i32 0, i32 0
  %127 = getelementptr inbounds %struct.WavpackStreamConfig, ptr %126, i32 0, i32 6
  %128 = load i32, ptr %127, align 8, !tbaa !35
  %129 = icmp eq i32 %128, 1
  br i1 %129, label %130, label %133

130:                                              ; preds = %124
  %131 = load ptr, ptr %3, align 8, !tbaa !5
  %132 = getelementptr inbounds %struct.WavpackStream, ptr %131, i32 0, i32 20
  store i32 2, ptr %132, align 8, !tbaa !36
  br label %146

133:                                              ; preds = %124
  %134 = load ptr, ptr %2, align 8, !tbaa !5
  %135 = getelementptr inbounds %struct.WavpackContext, ptr %134, i32 0, i32 0
  %136 = getelementptr inbounds %struct.WavpackStreamConfig, ptr %135, i32 0, i32 6
  %137 = load i32, ptr %136, align 8, !tbaa !35
  %138 = icmp eq i32 %137, 2
  br i1 %138, label %139, label %142

139:                                              ; preds = %133
  %140 = load ptr, ptr %3, align 8, !tbaa !5
  %141 = getelementptr inbounds %struct.WavpackStream, ptr %140, i32 0, i32 20
  store i32 4, ptr %141, align 8, !tbaa !36
  br label %145

142:                                              ; preds = %133
  %143 = load ptr, ptr %3, align 8, !tbaa !5
  %144 = getelementptr inbounds %struct.WavpackStream, ptr %143, i32 0, i32 20
  store i32 9, ptr %144, align 8, !tbaa !36
  br label %145

145:                                              ; preds = %142, %139
  br label %146

146:                                              ; preds = %145, %130
  br label %147

147:                                              ; preds = %146, %121
  %148 = load ptr, ptr %2, align 8, !tbaa !5
  %149 = getelementptr inbounds %struct.WavpackContext, ptr %148, i32 0, i32 0
  %150 = getelementptr inbounds %struct.WavpackStreamConfig, ptr %149, i32 0, i32 5
  %151 = load i32, ptr %150, align 4, !tbaa !29
  %152 = and i32 %151, 4096
  %153 = icmp ne i32 %152, 0
  br i1 %153, label %154, label %161

154:                                              ; preds = %147
  %155 = call i32 @get_num_very_high_specs()
  %156 = load ptr, ptr %3, align 8, !tbaa !5
  %157 = getelementptr inbounds %struct.WavpackStream, ptr %156, i32 0, i32 19
  store i32 %155, ptr %157, align 4, !tbaa !37
  %158 = call ptr @get_very_high_specs()
  %159 = load ptr, ptr %3, align 8, !tbaa !5
  %160 = getelementptr inbounds %struct.WavpackStream, ptr %159, i32 0, i32 42
  store ptr %158, ptr %160, align 8, !tbaa !38
  br label %198

161:                                              ; preds = %147
  %162 = load ptr, ptr %2, align 8, !tbaa !5
  %163 = getelementptr inbounds %struct.WavpackContext, ptr %162, i32 0, i32 0
  %164 = getelementptr inbounds %struct.WavpackStreamConfig, ptr %163, i32 0, i32 5
  %165 = load i32, ptr %164, align 4, !tbaa !29
  %166 = and i32 %165, 2048
  %167 = icmp ne i32 %166, 0
  br i1 %167, label %168, label %175

168:                                              ; preds = %161
  %169 = call i32 @get_num_high_specs()
  %170 = load ptr, ptr %3, align 8, !tbaa !5
  %171 = getelementptr inbounds %struct.WavpackStream, ptr %170, i32 0, i32 19
  store i32 %169, ptr %171, align 4, !tbaa !37
  %172 = call ptr @get_high_specs()
  %173 = load ptr, ptr %3, align 8, !tbaa !5
  %174 = getelementptr inbounds %struct.WavpackStream, ptr %173, i32 0, i32 42
  store ptr %172, ptr %174, align 8, !tbaa !38
  br label %197

175:                                              ; preds = %161
  %176 = load ptr, ptr %2, align 8, !tbaa !5
  %177 = getelementptr inbounds %struct.WavpackContext, ptr %176, i32 0, i32 0
  %178 = getelementptr inbounds %struct.WavpackStreamConfig, ptr %177, i32 0, i32 5
  %179 = load i32, ptr %178, align 4, !tbaa !29
  %180 = and i32 %179, 512
  %181 = icmp ne i32 %180, 0
  br i1 %181, label %182, label %189

182:                                              ; preds = %175
  %183 = call i32 @get_num_fast_specs()
  %184 = load ptr, ptr %3, align 8, !tbaa !5
  %185 = getelementptr inbounds %struct.WavpackStream, ptr %184, i32 0, i32 19
  store i32 %183, ptr %185, align 4, !tbaa !37
  %186 = call ptr @get_fast_specs()
  %187 = load ptr, ptr %3, align 8, !tbaa !5
  %188 = getelementptr inbounds %struct.WavpackStream, ptr %187, i32 0, i32 42
  store ptr %186, ptr %188, align 8, !tbaa !38
  br label %196

189:                                              ; preds = %175
  %190 = call i32 @get_num_default_specs()
  %191 = load ptr, ptr %3, align 8, !tbaa !5
  %192 = getelementptr inbounds %struct.WavpackStream, ptr %191, i32 0, i32 19
  store i32 %190, ptr %192, align 4, !tbaa !37
  %193 = call ptr @get_default_specs()
  %194 = load ptr, ptr %3, align 8, !tbaa !5
  %195 = getelementptr inbounds %struct.WavpackStream, ptr %194, i32 0, i32 42
  store ptr %193, ptr %195, align 8, !tbaa !38
  br label %196

196:                                              ; preds = %189, %182
  br label %197

197:                                              ; preds = %196, %168
  br label %198

198:                                              ; preds = %197, %154
  %199 = load ptr, ptr %3, align 8, !tbaa !5
  call void @init_words(ptr noundef %199)
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #6
  ret void
}

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #3

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.floor.f64(double) #3

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

; Function Attrs: nounwind allocsize(0)
declare noalias ptr @malloc(i64 noundef) #4

declare i32 @get_num_very_high_specs() #5

declare ptr @get_very_high_specs() #5

declare i32 @get_num_high_specs() #5

declare ptr @get_high_specs() #5

declare i32 @get_num_fast_specs() #5

declare ptr @get_fast_specs() #5

declare i32 @get_num_default_specs() #5

declare ptr @get_default_specs() #5

declare void @init_words(ptr noundef) #5

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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind allocsize(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 #5 = { "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 #6 = { nounwind }
attributes #7 = { nounwind allocsize(0) }

!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 288}
!10 = !{!"WavpackContext", !11, i64 0, !6, i64 88, !13, i64 96, !13, i64 100, !6, i64 104, !13, i64 112, !6, i64 120, !6, i64 128, !6, i64 136, !6, i64 144, !6, i64 152, !6, i64 160, !14, i64 168, !14, i64 176, !14, i64 184, !14, i64 192, !14, i64 200, !14, i64 208, !13, i64 216, !13, i64 220, !13, i64 224, !13, i64 228, !13, i64 232, !13, i64 236, !13, i64 240, !13, i64 244, !13, i64 248, !13, i64 252, !13, i64 256, !13, i64 260, !13, i64 264, !13, i64 268, !13, i64 272, !13, i64 276, !13, i64 280, !13, i64 284, !6, i64 288, !6, i64 296, !7, i64 304, !6, i64 312, !6, i64 320, !13, i64 328, !13, i64 332, !6, i64 336, !7, i64 344, !6, i64 352, !7, i64 360}
!11 = !{!"", !12, i64 0, !12, i64 4, !13, i64 8, !13, i64 12, !13, i64 16, !13, i64 20, !13, i64 24, !13, i64 28, !13, i64 32, !13, i64 36, !13, i64 40, !13, i64 44, !13, i64 48, !13, i64 52, !7, i64 56, !7, i64 72, !13, i64 76, !6, i64 80}
!12 = !{!"float", !7, i64 0}
!13 = !{!"int", !7, i64 0}
!14 = !{!"long", !7, i64 0}
!15 = !{!10, !13, i64 276}
!16 = !{!17, !14, i64 128}
!17 = !{!"", !18, i64 0, !20, i64 12, !6, i64 88, !6, i64 96, !6, i64 104, !6, i64 112, !6, i64 120, !14, i64 128, !14, i64 136, !13, i64 144, !13, i64 148, !13, i64 152, !7, i64 156, !7, i64 157, !7, i64 158, !7, i64 159, !7, i64 160, !7, i64 161, !7, i64 162, !13, i64 164, !13, i64 168, !13, i64 172, !13, i64 176, !13, i64 180, !13, i64 184, !13, i64 188, !13, i64 192, !21, i64 200, !21, i64 248, !21, i64 296, !12, 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, !22, i64 360, !7, i64 432, !24, i64 1968, !6, i64 2064, !25, i64 2072}
!18 = !{!"", !7, i64 0, !19, i64 4, !19, i64 6, !13, i64 8}
!19 = !{!"short", !7, i64 0}
!20 = !{!"words_data", !7, i64 0, !7, i64 8, !13, i64 16, !13, i64 20, !13, i64 24, !13, i64 28, !13, i64 32, !7, i64 36}
!21 = !{!"bs", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !13, i64 32, !13, i64 36, !13, i64 40}
!22 = !{!"", !7, i64 0, !7, i64 8, !7, i64 16, !23, i64 24, !23, i64 32, !23, i64 40, !6, i64 48, !6, i64 56, !13, i64 64}
!23 = !{!"double", !7, i64 0}
!24 = !{!"decorr_pass", !13, i64 0, !13, i64 4, !13, i64 8, !13, i64 12, !7, i64 16, !7, i64 48, !13, i64 80, !13, i64 84, !13, i64 88, !13, i64 92}
!25 = !{!"", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !7, i64 40, !7, i64 41, !13, i64 44, !13, i64 48, !13, i64 52, !6, i64 56, !13, i64 64, !13, i64 68, !13, i64 72, !7, i64 76, !6, i64 160}
!26 = !{!17, !12, i64 344}
!27 = !{!17, !13, i64 1968}
!28 = !{!17, !13, i64 1972}
!29 = !{!10, !13, i64 20}
!30 = !{!13, !13, i64 0}
!31 = !{!10, !13, i64 48}
!32 = !{!10, !12, i64 4}
!33 = !{!10, !13, i64 248}
!34 = !{!17, !6, i64 408}
!35 = !{!10, !13, i64 24}
!36 = !{!17, !13, i64 168}
!37 = !{!17, !13, i64 164}
!38 = !{!17, !6, i64 2064}


; 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 void @pack_init(ptr nocapture noundef %0) local_unnamed_addr #0 {
  %2 = getelementptr inbounds i8, ptr %0, i64 288
  %3 = load ptr, ptr %2, align 8, !tbaa !5
  %4 = getelementptr inbounds i8, ptr %0, i64 276
  %5 = load i32, ptr %4, align 4, !tbaa !14
  %6 = sext i32 %5 to i64
  %7 = getelementptr inbounds ptr, ptr %3, i64 %6
  %8 = load ptr, ptr %7, align 8, !tbaa !15
  %9 = getelementptr inbounds i8, ptr %8, i64 128
  store i64 0, ptr %9, align 8, !tbaa !16
  %10 = getelementptr inbounds i8, ptr %8, i64 344
  store float 2.000000e+00, ptr %10, align 8, !tbaa !26
  %11 = getelementptr inbounds i8, ptr %8, i64 360
  %12 = getelementptr inbounds i8, ptr %8, i64 1968
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(1704) %11, i8 0, i64 1704, i1 false)
  store i32 18, ptr %12, align 8, !tbaa !27
  %13 = getelementptr inbounds i8, ptr %8, i64 1972
  store i32 2, ptr %13, align 4, !tbaa !28
  %14 = getelementptr inbounds i8, ptr %0, i64 20
  %15 = load i32, ptr %14, align 4, !tbaa !29
  %16 = and i32 %15, 16384
  %.not = icmp eq i32 %16, 0
  br i1 %.not, label %29, label %17

17:                                               ; preds = %1
  %18 = and i32 %15, 1048576
  %.not43 = icmp eq i32 %18, 0
  br i1 %.not43, label %21, label %19

19:                                               ; preds = %17
  %20 = getelementptr inbounds i8, ptr %8, i64 364
  store i32 -33554432, ptr %20, align 4, !tbaa !30
  store i32 -33554432, ptr %11, align 8, !tbaa !30
  br label %38

21:                                               ; preds = %17
  %22 = getelementptr inbounds i8, ptr %0, i64 48
  %23 = load i32, ptr %22, align 8, !tbaa !31
  %24 = icmp sgt i32 %23, 63999
  br i1 %24, label %25, label %27

25:                                               ; preds = %21
  %26 = getelementptr inbounds i8, ptr %8, i64 364
  store i32 67108864, ptr %26, align 4, !tbaa !30
  store i32 67108864, ptr %11, align 8, !tbaa !30
  br label %38

27:                                               ; preds = %21
  %28 = or i32 %15, 131072
  store i32 %28, ptr %14, align 4, !tbaa !29
  br label %38

29:                                               ; preds = %1
  %30 = getelementptr inbounds i8, ptr %0, i64 4
  %31 = load float, ptr %30, align 4, !tbaa !32
  %32 = fpext float %31 to double
  %33 = tail call double @llvm.fmuladd.f64(double %32, double 1.024000e+03, double 5.000000e-01)
  %34 = tail call double @llvm.floor.f64(double %33)
  %35 = fptosi double %34 to i32
  %spec.store.select = tail call i32 @llvm.smax.i32(i32 %35, i32 -1000)
  %36 = shl i32 %spec.store.select, 16
  %37 = getelementptr inbounds i8, ptr %8, i64 364
  store i32 %36, ptr %37, align 4, !tbaa !30
  store i32 %36, ptr %11, align 8, !tbaa !30
  br label %38

38:                                               ; preds = %19, %27, %25, %29
  %39 = load i32, ptr %14, align 4, !tbaa !29
  %40 = and i32 %39, 131072
  %.not44 = icmp eq i32 %40, 0
  br i1 %.not44, label %48, label %41

41:                                               ; preds = %38
  %42 = getelementptr inbounds i8, ptr %0, i64 248
  %43 = load i32, ptr %42, align 8, !tbaa !33
  %44 = zext i32 %43 to i64
  %45 = shl nuw nsw i64 %44, 1
  %46 = tail call noalias ptr @malloc(i64 noundef %45) #6
  %47 = getelementptr inbounds i8, ptr %8, i64 408
  store ptr %46, ptr %47, align 8, !tbaa !34
  br label %48

48:                                               ; preds = %41, %38
  %49 = getelementptr inbounds i8, ptr %0, i64 24
  %50 = load i32, ptr %49, align 8, !tbaa !35
  %51 = getelementptr inbounds i8, ptr %8, i64 168
  %52 = icmp ult i32 %50, 3
  %switch.idx.mult = shl nsw i32 %50, 1
  %.sink = select i1 %52, i32 %switch.idx.mult, i32 9
  store i32 %.sink, ptr %51, align 8, !tbaa !36
  %53 = and i32 %39, 4096
  %.not46 = icmp eq i32 %53, 0
  br i1 %.not46, label %59, label %54

54:                                               ; preds = %48
  %55 = tail call i32 @get_num_very_high_specs() #7
  %56 = getelementptr inbounds i8, ptr %8, i64 164
  store i32 %55, ptr %56, align 4, !tbaa !37
  %57 = tail call ptr @get_very_high_specs() #7
  %58 = getelementptr inbounds i8, ptr %8, i64 2064
  store ptr %57, ptr %58, align 8, !tbaa !38
  br label %76

59:                                               ; preds = %48
  %60 = and i32 %39, 2048
  %.not47 = icmp eq i32 %60, 0
  br i1 %.not47, label %66, label %61

61:                                               ; preds = %59
  %62 = tail call i32 @get_num_high_specs() #7
  %63 = getelementptr inbounds i8, ptr %8, i64 164
  store i32 %62, ptr %63, align 4, !tbaa !37
  %64 = tail call ptr @get_high_specs() #7
  %65 = getelementptr inbounds i8, ptr %8, i64 2064
  store ptr %64, ptr %65, align 8, !tbaa !38
  br label %76

66:                                               ; preds = %59
  %67 = and i32 %39, 512
  %.not48 = icmp eq i32 %67, 0
  %68 = getelementptr inbounds i8, ptr %8, i64 164
  %69 = getelementptr inbounds i8, ptr %8, i64 2064
  br i1 %.not48, label %73, label %70

70:                                               ; preds = %66
  %71 = tail call i32 @get_num_fast_specs() #7
  store i32 %71, ptr %68, align 4, !tbaa !37
  %72 = tail call ptr @get_fast_specs() #7
  store ptr %72, ptr %69, align 8, !tbaa !38
  br label %76

73:                                               ; preds = %66
  %74 = tail call i32 @get_num_default_specs() #7
  store i32 %74, ptr %68, align 4, !tbaa !37
  %75 = tail call ptr @get_default_specs() #7
  store ptr %75, ptr %69, align 8, !tbaa !38
  br label %76

76:                                               ; preds = %61, %73, %70, %54
  tail call void @init_words(ptr noundef nonnull %8) #7
  ret void
}

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #1

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #2

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.floor.f64(double) #2

; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #3

declare i32 @get_num_very_high_specs() local_unnamed_addr #4

declare ptr @get_very_high_specs() local_unnamed_addr #4

declare i32 @get_num_high_specs() local_unnamed_addr #4

declare ptr @get_high_specs() local_unnamed_addr #4

declare i32 @get_num_fast_specs() local_unnamed_addr #4

declare ptr @get_fast_specs() local_unnamed_addr #4

declare i32 @get_num_default_specs() local_unnamed_addr #4

declare ptr @get_default_specs() local_unnamed_addr #4

declare void @init_words(ptr noundef) local_unnamed_addr #4

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

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 nounwind willreturn memory(argmem: write) }
attributes #2 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #3 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "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 #4 = { "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 #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { nounwind allocsize(0) }
attributes #7 = { 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 288}
!6 = !{!"WavpackContext", !7, i64 0, !12, i64 88, !11, i64 96, !11, i64 100, !12, i64 104, !11, i64 112, !12, i64 120, !12, i64 128, !12, i64 136, !12, i64 144, !12, i64 152, !12, i64 160, !13, i64 168, !13, i64 176, !13, i64 184, !13, i64 192, !13, i64 200, !13, i64 208, !11, i64 216, !11, i64 220, !11, i64 224, !11, i64 228, !11, i64 232, !11, i64 236, !11, i64 240, !11, i64 244, !11, i64 248, !11, i64 252, !11, i64 256, !11, i64 260, !11, i64 264, !11, i64 268, !11, i64 272, !11, i64 276, !11, i64 280, !11, i64 284, !12, i64 288, !12, i64 296, !9, i64 304, !12, i64 312, !12, i64 320, !11, i64 328, !11, i64 332, !12, i64 336, !9, i64 344, !12, i64 352, !9, i64 360}
!7 = !{!"", !8, i64 0, !8, i64 4, !11, i64 8, !11, i64 12, !11, i64 16, !11, i64 20, !11, i64 24, !11, i64 28, !11, i64 32, !11, i64 36, !11, i64 40, !11, i64 44, !11, i64 48, !11, i64 52, !9, i64 56, !9, i64 72, !11, i64 76, !12, i64 80}
!8 = !{!"float", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C/C++ TBAA"}
!11 = !{!"int", !9, i64 0}
!12 = !{!"any pointer", !9, i64 0}
!13 = !{!"long", !9, i64 0}
!14 = !{!6, !11, i64 276}
!15 = !{!12, !12, i64 0}
!16 = !{!17, !13, i64 128}
!17 = !{!"", !18, i64 0, !20, i64 12, !12, i64 88, !12, i64 96, !12, i64 104, !12, i64 112, !12, i64 120, !13, i64 128, !13, i64 136, !11, i64 144, !11, i64 148, !11, i64 152, !9, i64 156, !9, i64 157, !9, i64 158, !9, i64 159, !9, i64 160, !9, i64 161, !9, 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, !21, i64 200, !21, i64 248, !21, i64 296, !8, i64 344, !9, i64 348, !9, i64 349, !9, i64 350, !9, i64 351, !9, i64 352, !9, i64 353, !9, i64 354, !9, i64 355, !22, i64 360, !9, i64 432, !24, i64 1968, !12, i64 2064, !25, i64 2072}
!18 = !{!"", !9, i64 0, !19, i64 4, !19, i64 6, !11, i64 8}
!19 = !{!"short", !9, i64 0}
!20 = !{!"words_data", !9, i64 0, !9, i64 8, !11, i64 16, !11, i64 20, !11, i64 24, !11, i64 28, !11, i64 32, !9, i64 36}
!21 = !{!"bs", !12, i64 0, !12, i64 8, !12, i64 16, !12, i64 24, !11, i64 32, !11, i64 36, !11, i64 40}
!22 = !{!"", !9, i64 0, !9, i64 8, !9, i64 16, !23, i64 24, !23, i64 32, !23, i64 40, !12, i64 48, !12, i64 56, !11, i64 64}
!23 = !{!"double", !9, i64 0}
!24 = !{!"decorr_pass", !11, i64 0, !11, i64 4, !11, i64 8, !11, i64 12, !9, i64 16, !9, i64 48, !11, i64 80, !11, i64 84, !11, i64 88, !11, i64 92}
!25 = !{!"", !12, i64 0, !12, i64 8, !12, i64 16, !12, i64 24, !12, i64 32, !9, i64 40, !9, i64 41, !11, i64 44, !11, i64 48, !11, i64 52, !12, i64 56, !11, i64 64, !11, i64 68, !11, i64 72, !9, i64 76, !12, i64 160}
!26 = !{!17, !8, i64 344}
!27 = !{!17, !11, i64 1968}
!28 = !{!17, !11, i64 1972}
!29 = !{!6, !11, i64 20}
!30 = !{!11, !11, i64 0}
!31 = !{!6, !11, i64 48}
!32 = !{!6, !8, i64 4}
!33 = !{!6, !11, i64 248}
!34 = !{!17, !12, i64 408}
!35 = !{!6, !11, i64 24}
!36 = !{!17, !11, i64 168}
!37 = !{!17, !11, i64 164}
!38 = !{!17, !12, i64 2064}


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