; LLVM IR from dbry/wavpack-stream :: src (common_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.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: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0

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

; Function Attrs: nounwind uwtable
define dso_local void @free_streams(ptr noundef %0) #1 {
  %2 = alloca ptr, align 8
  %3 = alloca i32, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #3
  %4 = load ptr, ptr %2, align 8, !tbaa !5
  %5 = getelementptr inbounds %struct.WavpackContext, ptr %4, i32 0, i32 34
  %6 = load i32, ptr %5, align 8, !tbaa !9
  store i32 %6, ptr %3, align 4, !tbaa !15
  br label %7

7:                                                ; preds = %151, %1
  %8 = load i32, ptr %3, align 4, !tbaa !15
  %9 = add nsw i32 %8, -1
  store i32 %9, ptr %3, align 4, !tbaa !15
  %10 = icmp ne i32 %8, 0
  br i1 %10, label %11, label %152

11:                                               ; preds = %7
  %12 = load ptr, ptr %2, align 8, !tbaa !5
  %13 = getelementptr inbounds %struct.WavpackContext, ptr %12, i32 0, i32 36
  %14 = load ptr, ptr %13, align 8, !tbaa !16
  %15 = load i32, ptr %3, align 4, !tbaa !15
  %16 = sext i32 %15 to i64
  %17 = getelementptr inbounds ptr, ptr %14, i64 %16
  %18 = load ptr, ptr %17, align 8, !tbaa !5
  %19 = getelementptr inbounds %struct.WavpackStream, ptr %18, i32 0, i32 2
  %20 = load ptr, ptr %19, align 8, !tbaa !17
  %21 = icmp ne ptr %20, null
  br i1 %21, label %22, label %40

22:                                               ; preds = %11
  %23 = load ptr, ptr %2, align 8, !tbaa !5
  %24 = getelementptr inbounds %struct.WavpackContext, ptr %23, i32 0, i32 36
  %25 = load ptr, ptr %24, align 8, !tbaa !16
  %26 = load i32, ptr %3, align 4, !tbaa !15
  %27 = sext i32 %26 to i64
  %28 = getelementptr inbounds ptr, ptr %25, i64 %27
  %29 = load ptr, ptr %28, align 8, !tbaa !5
  %30 = getelementptr inbounds %struct.WavpackStream, ptr %29, i32 0, i32 2
  %31 = load ptr, ptr %30, align 8, !tbaa !17
  call void @free(ptr noundef %31) #3
  %32 = load ptr, ptr %2, align 8, !tbaa !5
  %33 = getelementptr inbounds %struct.WavpackContext, ptr %32, i32 0, i32 36
  %34 = load ptr, ptr %33, align 8, !tbaa !16
  %35 = load i32, ptr %3, align 4, !tbaa !15
  %36 = sext i32 %35 to i64
  %37 = getelementptr inbounds ptr, ptr %34, i64 %36
  %38 = load ptr, ptr %37, align 8, !tbaa !5
  %39 = getelementptr inbounds %struct.WavpackStream, ptr %38, i32 0, i32 2
  store ptr null, ptr %39, align 8, !tbaa !17
  br label %40

40:                                               ; preds = %22, %11
  %41 = load ptr, ptr %2, align 8, !tbaa !5
  %42 = getelementptr inbounds %struct.WavpackContext, ptr %41, i32 0, i32 36
  %43 = load ptr, ptr %42, align 8, !tbaa !16
  %44 = load i32, ptr %3, align 4, !tbaa !15
  %45 = sext i32 %44 to i64
  %46 = getelementptr inbounds ptr, ptr %43, i64 %45
  %47 = load ptr, ptr %46, align 8, !tbaa !5
  %48 = getelementptr inbounds %struct.WavpackStream, ptr %47, i32 0, i32 4
  %49 = load ptr, ptr %48, align 8, !tbaa !27
  %50 = icmp ne ptr %49, null
  br i1 %50, label %51, label %69

51:                                               ; preds = %40
  %52 = load ptr, ptr %2, align 8, !tbaa !5
  %53 = getelementptr inbounds %struct.WavpackContext, ptr %52, i32 0, i32 36
  %54 = load ptr, ptr %53, align 8, !tbaa !16
  %55 = load i32, ptr %3, align 4, !tbaa !15
  %56 = sext i32 %55 to i64
  %57 = getelementptr inbounds ptr, ptr %54, i64 %56
  %58 = load ptr, ptr %57, align 8, !tbaa !5
  %59 = getelementptr inbounds %struct.WavpackStream, ptr %58, i32 0, i32 4
  %60 = load ptr, ptr %59, align 8, !tbaa !27
  call void @free(ptr noundef %60) #3
  %61 = load ptr, ptr %2, align 8, !tbaa !5
  %62 = getelementptr inbounds %struct.WavpackContext, ptr %61, i32 0, i32 36
  %63 = load ptr, ptr %62, align 8, !tbaa !16
  %64 = load i32, ptr %3, align 4, !tbaa !15
  %65 = sext i32 %64 to i64
  %66 = getelementptr inbounds ptr, ptr %63, i64 %65
  %67 = load ptr, ptr %66, align 8, !tbaa !5
  %68 = getelementptr inbounds %struct.WavpackStream, ptr %67, i32 0, i32 4
  store ptr null, ptr %68, align 8, !tbaa !27
  br label %69

69:                                               ; preds = %51, %40
  %70 = load ptr, ptr %2, align 8, !tbaa !5
  %71 = getelementptr inbounds %struct.WavpackContext, ptr %70, i32 0, i32 36
  %72 = load ptr, ptr %71, align 8, !tbaa !16
  %73 = load i32, ptr %3, align 4, !tbaa !15
  %74 = sext i32 %73 to i64
  %75 = getelementptr inbounds ptr, ptr %72, i64 %74
  %76 = load ptr, ptr %75, align 8, !tbaa !5
  %77 = getelementptr inbounds %struct.WavpackStream, ptr %76, i32 0, i32 6
  %78 = load ptr, ptr %77, align 8, !tbaa !28
  %79 = icmp ne ptr %78, null
  br i1 %79, label %80, label %98

80:                                               ; preds = %69
  %81 = load ptr, ptr %2, align 8, !tbaa !5
  %82 = getelementptr inbounds %struct.WavpackContext, ptr %81, i32 0, i32 36
  %83 = load ptr, ptr %82, align 8, !tbaa !16
  %84 = load i32, ptr %3, align 4, !tbaa !15
  %85 = sext i32 %84 to i64
  %86 = getelementptr inbounds ptr, ptr %83, i64 %85
  %87 = load ptr, ptr %86, align 8, !tbaa !5
  %88 = getelementptr inbounds %struct.WavpackStream, ptr %87, i32 0, i32 6
  %89 = load ptr, ptr %88, align 8, !tbaa !28
  call void @free(ptr noundef %89) #3
  %90 = load ptr, ptr %2, align 8, !tbaa !5
  %91 = getelementptr inbounds %struct.WavpackContext, ptr %90, i32 0, i32 36
  %92 = load ptr, ptr %91, align 8, !tbaa !16
  %93 = load i32, ptr %3, align 4, !tbaa !15
  %94 = sext i32 %93 to i64
  %95 = getelementptr inbounds ptr, ptr %92, i64 %94
  %96 = load ptr, ptr %95, align 8, !tbaa !5
  %97 = getelementptr inbounds %struct.WavpackStream, ptr %96, i32 0, i32 6
  store ptr null, ptr %97, align 8, !tbaa !28
  br label %98

98:                                               ; preds = %80, %69
  %99 = load ptr, ptr %2, align 8, !tbaa !5
  %100 = getelementptr inbounds %struct.WavpackContext, ptr %99, i32 0, i32 36
  %101 = load ptr, ptr %100, align 8, !tbaa !16
  %102 = load i32, ptr %3, align 4, !tbaa !15
  %103 = sext i32 %102 to i64
  %104 = getelementptr inbounds ptr, ptr %101, i64 %103
  %105 = load ptr, ptr %104, align 8, !tbaa !5
  %106 = getelementptr inbounds %struct.WavpackStream, ptr %105, i32 0, i32 39
  %107 = getelementptr inbounds %struct.anon, ptr %106, i32 0, i32 6
  %108 = load ptr, ptr %107, align 8, !tbaa !29
  %109 = icmp ne ptr %108, null
  br i1 %109, label %110, label %130

110:                                              ; preds = %98
  %111 = load ptr, ptr %2, align 8, !tbaa !5
  %112 = getelementptr inbounds %struct.WavpackContext, ptr %111, i32 0, i32 36
  %113 = load ptr, ptr %112, align 8, !tbaa !16
  %114 = load i32, ptr %3, align 4, !tbaa !15
  %115 = sext i32 %114 to i64
  %116 = getelementptr inbounds ptr, ptr %113, i64 %115
  %117 = load ptr, ptr %116, align 8, !tbaa !5
  %118 = getelementptr inbounds %struct.WavpackStream, ptr %117, i32 0, i32 39
  %119 = getelementptr inbounds %struct.anon, ptr %118, i32 0, i32 6
  %120 = load ptr, ptr %119, align 8, !tbaa !29
  call void @free(ptr noundef %120) #3
  %121 = load ptr, ptr %2, align 8, !tbaa !5
  %122 = getelementptr inbounds %struct.WavpackContext, ptr %121, i32 0, i32 36
  %123 = load ptr, ptr %122, align 8, !tbaa !16
  %124 = load i32, ptr %3, align 4, !tbaa !15
  %125 = sext i32 %124 to i64
  %126 = getelementptr inbounds ptr, ptr %123, i64 %125
  %127 = load ptr, ptr %126, align 8, !tbaa !5
  %128 = getelementptr inbounds %struct.WavpackStream, ptr %127, i32 0, i32 39
  %129 = getelementptr inbounds %struct.anon, ptr %128, i32 0, i32 6
  store ptr null, ptr %129, align 8, !tbaa !29
  br label %130

130:                                              ; preds = %110, %98
  %131 = load i32, ptr %3, align 4, !tbaa !15
  %132 = icmp ne i32 %131, 0
  br i1 %132, label %133, label %151

133:                                              ; preds = %130
  %134 = load ptr, ptr %2, align 8, !tbaa !5
  %135 = getelementptr inbounds %struct.WavpackContext, ptr %134, i32 0, i32 34
  %136 = load i32, ptr %135, align 8, !tbaa !9
  %137 = add nsw i32 %136, -1
  store i32 %137, ptr %135, align 8, !tbaa !9
  %138 = load ptr, ptr %2, align 8, !tbaa !5
  %139 = getelementptr inbounds %struct.WavpackContext, ptr %138, i32 0, i32 36
  %140 = load ptr, ptr %139, align 8, !tbaa !16
  %141 = load i32, ptr %3, align 4, !tbaa !15
  %142 = sext i32 %141 to i64
  %143 = getelementptr inbounds ptr, ptr %140, i64 %142
  %144 = load ptr, ptr %143, align 8, !tbaa !5
  call void @free(ptr noundef %144) #3
  %145 = load ptr, ptr %2, align 8, !tbaa !5
  %146 = getelementptr inbounds %struct.WavpackContext, ptr %145, i32 0, i32 36
  %147 = load ptr, ptr %146, align 8, !tbaa !16
  %148 = load i32, ptr %3, align 4, !tbaa !15
  %149 = sext i32 %148 to i64
  %150 = getelementptr inbounds ptr, ptr %147, i64 %149
  store ptr null, ptr %150, align 8, !tbaa !5
  br label %151

151:                                              ; preds = %133, %130
  br label %7, !llvm.loop !30

152:                                              ; preds = %7
  %153 = load ptr, ptr %2, align 8, !tbaa !5
  %154 = getelementptr inbounds %struct.WavpackContext, ptr %153, i32 0, i32 33
  store i32 0, ptr %154, align 4, !tbaa !32
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #3
  ret void
}

; Function Attrs: nounwind
declare void @free(ptr noundef) #2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nounwind "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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !13, i64 280}
!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 = !{!13, !13, i64 0}
!16 = !{!10, !6, i64 288}
!17 = !{!18, !6, i64 88}
!18 = !{!"", !19, i64 0, !21, 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, !22, i64 200, !22, i64 248, !22, 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, !23, i64 360, !7, i64 432, !25, i64 1968, !6, i64 2064, !26, i64 2072}
!19 = !{!"", !7, i64 0, !20, i64 4, !20, i64 6, !13, i64 8}
!20 = !{!"short", !7, i64 0}
!21 = !{!"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}
!22 = !{!"bs", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !13, i64 32, !13, i64 36, !13, i64 40}
!23 = !{!"", !7, i64 0, !7, i64 8, !7, i64 16, !24, i64 24, !24, i64 32, !24, i64 40, !6, i64 48, !6, i64 56, !13, i64 64}
!24 = !{!"double", !7, i64 0}
!25 = !{!"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}
!26 = !{!"", !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}
!27 = !{!18, !6, i64 104}
!28 = !{!18, !6, i64 120}
!29 = !{!18, !6, i64 408}
!30 = distinct !{!30, !31}
!31 = !{!"llvm.loop.mustprogress"}
!32 = !{!10, !13, i64 276}


; 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 @free_streams(ptr nocapture noundef %0) local_unnamed_addr #0 {
  %2 = getelementptr inbounds i8, ptr %0, i64 280
  %3 = load i32, ptr %2, align 8, !tbaa !5
  %.not41 = icmp eq i32 %3, 0
  br i1 %.not41, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %1
  %4 = getelementptr inbounds i8, ptr %0, i64 288
  %5 = sext i32 %3 to i64
  br label %6

6:                                                ; preds = %49, %.lr.ph
  %indvars.iv = phi i64 [ %5, %.lr.ph ], [ %indvars.iv.next, %49 ]
  %indvars.iv.next = add nsw i64 %indvars.iv, -1
  %7 = load ptr, ptr %4, align 8, !tbaa !14
  %8 = getelementptr inbounds ptr, ptr %7, i64 %indvars.iv.next
  %9 = load ptr, ptr %8, align 8, !tbaa !15
  %10 = getelementptr inbounds i8, ptr %9, i64 88
  %11 = load ptr, ptr %10, align 8, !tbaa !16
  %.not36 = icmp eq ptr %11, null
  br i1 %.not36, label %17, label %12

12:                                               ; preds = %6
  tail call void @free(ptr noundef nonnull %11) #2
  %13 = load ptr, ptr %4, align 8, !tbaa !14
  %14 = getelementptr inbounds ptr, ptr %13, i64 %indvars.iv.next
  %15 = load ptr, ptr %14, align 8, !tbaa !15
  %16 = getelementptr inbounds i8, ptr %15, i64 88
  store ptr null, ptr %16, align 8, !tbaa !16
  %.pre = load ptr, ptr %14, align 8, !tbaa !15
  br label %17

17:                                               ; preds = %12, %6
  %18 = phi ptr [ %.pre, %12 ], [ %9, %6 ]
  %19 = phi ptr [ %13, %12 ], [ %7, %6 ]
  %20 = getelementptr inbounds i8, ptr %18, i64 104
  %21 = load ptr, ptr %20, align 8, !tbaa !26
  %.not37 = icmp eq ptr %21, null
  br i1 %.not37, label %27, label %22

22:                                               ; preds = %17
  tail call void @free(ptr noundef nonnull %21) #2
  %23 = load ptr, ptr %4, align 8, !tbaa !14
  %24 = getelementptr inbounds ptr, ptr %23, i64 %indvars.iv.next
  %25 = load ptr, ptr %24, align 8, !tbaa !15
  %26 = getelementptr inbounds i8, ptr %25, i64 104
  store ptr null, ptr %26, align 8, !tbaa !26
  %.pre43 = load ptr, ptr %24, align 8, !tbaa !15
  br label %27

27:                                               ; preds = %22, %17
  %28 = phi ptr [ %.pre43, %22 ], [ %18, %17 ]
  %29 = phi ptr [ %23, %22 ], [ %19, %17 ]
  %30 = getelementptr inbounds i8, ptr %28, i64 120
  %31 = load ptr, ptr %30, align 8, !tbaa !27
  %.not38 = icmp eq ptr %31, null
  br i1 %.not38, label %37, label %32

32:                                               ; preds = %27
  tail call void @free(ptr noundef nonnull %31) #2
  %33 = load ptr, ptr %4, align 8, !tbaa !14
  %34 = getelementptr inbounds ptr, ptr %33, i64 %indvars.iv.next
  %35 = load ptr, ptr %34, align 8, !tbaa !15
  %36 = getelementptr inbounds i8, ptr %35, i64 120
  store ptr null, ptr %36, align 8, !tbaa !27
  %.pre44 = load ptr, ptr %34, align 8, !tbaa !15
  br label %37

37:                                               ; preds = %32, %27
  %38 = phi ptr [ %.pre44, %32 ], [ %28, %27 ]
  %39 = phi ptr [ %33, %32 ], [ %29, %27 ]
  %40 = getelementptr inbounds i8, ptr %38, i64 408
  %41 = load ptr, ptr %40, align 8, !tbaa !28
  %.not39 = icmp eq ptr %41, null
  br i1 %.not39, label %47, label %42

42:                                               ; preds = %37
  tail call void @free(ptr noundef nonnull %41) #2
  %43 = load ptr, ptr %4, align 8, !tbaa !14
  %44 = getelementptr inbounds ptr, ptr %43, i64 %indvars.iv.next
  %45 = load ptr, ptr %44, align 8, !tbaa !15
  %46 = getelementptr inbounds i8, ptr %45, i64 408
  store ptr null, ptr %46, align 8, !tbaa !28
  br label %47

47:                                               ; preds = %42, %37
  %48 = phi ptr [ %43, %42 ], [ %39, %37 ]
  %.not40 = icmp eq i64 %indvars.iv.next, 0
  br i1 %.not40, label %._crit_edge, label %49

49:                                               ; preds = %47
  %50 = load i32, ptr %2, align 8, !tbaa !5
  %51 = add nsw i32 %50, -1
  store i32 %51, ptr %2, align 8, !tbaa !5
  %52 = getelementptr inbounds ptr, ptr %48, i64 %indvars.iv.next
  %53 = load ptr, ptr %52, align 8, !tbaa !15
  tail call void @free(ptr noundef %53) #2
  %54 = load ptr, ptr %4, align 8, !tbaa !14
  %55 = getelementptr inbounds ptr, ptr %54, i64 %indvars.iv.next
  store ptr null, ptr %55, align 8, !tbaa !15
  br label %6, !llvm.loop !29

._crit_edge:                                      ; preds = %47, %1
  %56 = getelementptr inbounds i8, ptr %0, i64 276
  store i32 0, ptr %56, align 4, !tbaa !31
  ret void
}

; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #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 nounwind willreturn allockind("free") memory(argmem: readwrite, 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 #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, !11, i64 280}
!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, !12, i64 288}
!15 = !{!12, !12, i64 0}
!16 = !{!17, !12, i64 88}
!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, !12, i64 104}
!27 = !{!17, !12, i64 120}
!28 = !{!17, !12, i64 408}
!29 = distinct !{!29, !30}
!30 = !{!"llvm.loop.mustprogress"}
!31 = !{!6, !11, i64 276}


; Effective O3 passes: BDCEPass,CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass