; 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.WavpackMetadata = type { i32, ptr, i8 }
%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 @send_general_metadata(ptr noundef %0) #1 {
  %2 = alloca ptr, align 8
  %3 = alloca ptr, align 8
  %4 = alloca i32, align 4
  %5 = alloca %struct.WavpackMetadata, align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #3
  %6 = load ptr, ptr %2, align 8, !tbaa !5
  %7 = getelementptr inbounds %struct.WavpackContext, ptr %6, i32 0, i32 36
  %8 = load ptr, ptr %7, align 8, !tbaa !9
  %9 = load ptr, ptr %2, align 8, !tbaa !5
  %10 = getelementptr inbounds %struct.WavpackContext, ptr %9, i32 0, i32 33
  %11 = load i32, ptr %10, align 4, !tbaa !15
  %12 = sext i32 %11 to i64
  %13 = getelementptr inbounds ptr, ptr %8, i64 %12
  %14 = load ptr, ptr %13, align 8, !tbaa !5
  store ptr %14, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #3
  %15 = load ptr, ptr %3, align 8, !tbaa !5
  %16 = getelementptr inbounds %struct.WavpackStream, ptr %15, i32 0, i32 0
  %17 = getelementptr inbounds %struct.WavpackHeader, ptr %16, i32 0, i32 3
  %18 = load i32, ptr %17, align 8, !tbaa !16
  store i32 %18, ptr %4, align 4, !tbaa !26
  call void @llvm.lifetime.start.p0(i64 24, ptr %5) #3
  %19 = load i32, ptr %4, align 4, !tbaa !26
  %20 = zext i32 %19 to i64
  %21 = and i64 %20, 125829120
  %22 = icmp eq i64 %21, 125829120
  br i1 %22, label %23, label %38

23:                                               ; preds = %1
  %24 = load ptr, ptr %2, align 8, !tbaa !5
  %25 = getelementptr inbounds %struct.WavpackContext, ptr %24, i32 0, i32 0
  %26 = getelementptr inbounds %struct.WavpackStreamConfig, ptr %25, i32 0, i32 12
  %27 = load i32, ptr %26, align 8, !tbaa !27
  %28 = icmp ne i32 %27, 44100
  br i1 %28, label %29, label %38

29:                                               ; preds = %23
  %30 = load ptr, ptr %2, align 8, !tbaa !5
  call void @write_sample_rate(ptr noundef %30, ptr noundef %5)
  %31 = load ptr, ptr %3, align 8, !tbaa !5
  %32 = getelementptr inbounds %struct.WavpackStream, ptr %31, i32 0, i32 2
  %33 = load ptr, ptr %32, align 8, !tbaa !28
  %34 = load ptr, ptr %3, align 8, !tbaa !5
  %35 = getelementptr inbounds %struct.WavpackStream, ptr %34, i32 0, i32 3
  %36 = load ptr, ptr %35, align 8, !tbaa !29
  %37 = call i32 @copy_metadata(ptr noundef %5, ptr noundef %33, ptr noundef %36)
  call void @free_metadata(ptr noundef %5)
  br label %38

38:                                               ; preds = %29, %23, %1
  %39 = load i32, ptr %4, align 4, !tbaa !26
  %40 = and i32 %39, 2048
  %41 = icmp ne i32 %40, 0
  br i1 %41, label %42, label %82

42:                                               ; preds = %38
  %43 = load ptr, ptr %2, align 8, !tbaa !5
  %44 = getelementptr inbounds %struct.WavpackContext, ptr %43, i32 0, i32 0
  %45 = getelementptr inbounds %struct.WavpackStreamConfig, ptr %44, i32 0, i32 7
  %46 = load i32, ptr %45, align 4, !tbaa !30
  %47 = icmp sgt i32 %46, 2
  br i1 %47, label %59, label %48

48:                                               ; preds = %42
  %49 = load ptr, ptr %2, align 8, !tbaa !5
  %50 = getelementptr inbounds %struct.WavpackContext, ptr %49, i32 0, i32 0
  %51 = getelementptr inbounds %struct.WavpackStreamConfig, ptr %50, i32 0, i32 13
  %52 = load i32, ptr %51, align 4, !tbaa !31
  %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 7
  %56 = load i32, ptr %55, align 4, !tbaa !30
  %57 = sub nsw i32 5, %56
  %58 = icmp ne i32 %52, %57
  br i1 %58, label %59, label %82

59:                                               ; preds = %48, %42
  %60 = load ptr, ptr %2, align 8, !tbaa !5
  call void @write_channel_info(ptr noundef %60, ptr noundef %5)
  %61 = load ptr, ptr %3, align 8, !tbaa !5
  %62 = getelementptr inbounds %struct.WavpackStream, ptr %61, i32 0, i32 2
  %63 = load ptr, ptr %62, align 8, !tbaa !28
  %64 = load ptr, ptr %3, align 8, !tbaa !5
  %65 = getelementptr inbounds %struct.WavpackStream, ptr %64, i32 0, i32 3
  %66 = load ptr, ptr %65, align 8, !tbaa !29
  %67 = call i32 @copy_metadata(ptr noundef %5, ptr noundef %63, ptr noundef %66)
  call void @free_metadata(ptr noundef %5)
  %68 = load ptr, ptr %2, align 8, !tbaa !5
  %69 = getelementptr inbounds %struct.WavpackContext, ptr %68, i32 0, i32 40
  %70 = load ptr, ptr %69, align 8, !tbaa !32
  %71 = icmp ne ptr %70, null
  br i1 %71, label %72, label %81

72:                                               ; preds = %59
  %73 = load ptr, ptr %2, align 8, !tbaa !5
  call void @write_channel_identities_info(ptr noundef %73, ptr noundef %5)
  %74 = load ptr, ptr %3, align 8, !tbaa !5
  %75 = getelementptr inbounds %struct.WavpackStream, ptr %74, i32 0, i32 2
  %76 = load ptr, ptr %75, align 8, !tbaa !28
  %77 = load ptr, ptr %3, align 8, !tbaa !5
  %78 = getelementptr inbounds %struct.WavpackStream, ptr %77, i32 0, i32 3
  %79 = load ptr, ptr %78, align 8, !tbaa !29
  %80 = call i32 @copy_metadata(ptr noundef %5, ptr noundef %76, ptr noundef %79)
  call void @free_metadata(ptr noundef %5)
  br label %81

81:                                               ; preds = %72, %59
  br label %82

82:                                               ; preds = %81, %48, %38
  %83 = load i32, ptr %4, align 4, !tbaa !26
  %84 = and i32 %83, 2048
  %85 = icmp ne i32 %84, 0
  br i1 %85, label %86, label %108

86:                                               ; preds = %82
  %87 = load ptr, ptr %3, align 8, !tbaa !5
  %88 = getelementptr inbounds %struct.WavpackStream, ptr %87, i32 0, i32 7
  %89 = load i64, ptr %88, align 8, !tbaa !33
  %90 = icmp ne i64 %89, 0
  br i1 %90, label %108, label %91

91:                                               ; preds = %86
  %92 = load ptr, ptr %2, align 8, !tbaa !5
  call void @write_config_info(ptr noundef %92, ptr noundef %5)
  %93 = load ptr, ptr %3, align 8, !tbaa !5
  %94 = getelementptr inbounds %struct.WavpackStream, ptr %93, i32 0, i32 2
  %95 = load ptr, ptr %94, align 8, !tbaa !28
  %96 = load ptr, ptr %3, align 8, !tbaa !5
  %97 = getelementptr inbounds %struct.WavpackStream, ptr %96, i32 0, i32 3
  %98 = load ptr, ptr %97, align 8, !tbaa !29
  %99 = call i32 @copy_metadata(ptr noundef %5, ptr noundef %95, ptr noundef %98)
  call void @free_metadata(ptr noundef %5)
  %100 = load ptr, ptr %2, align 8, !tbaa !5
  call void @write_total_samples(ptr noundef %100, ptr noundef %5)
  %101 = load ptr, ptr %3, align 8, !tbaa !5
  %102 = getelementptr inbounds %struct.WavpackStream, ptr %101, i32 0, i32 2
  %103 = load ptr, ptr %102, align 8, !tbaa !28
  %104 = load ptr, ptr %3, align 8, !tbaa !5
  %105 = getelementptr inbounds %struct.WavpackStream, ptr %104, i32 0, i32 3
  %106 = load ptr, ptr %105, align 8, !tbaa !29
  %107 = call i32 @copy_metadata(ptr noundef %5, ptr noundef %103, ptr noundef %106)
  call void @free_metadata(ptr noundef %5)
  br label %108

108:                                              ; preds = %91, %86, %82
  %109 = load i32, ptr %4, align 4, !tbaa !26
  %110 = and i32 %109, 2048
  %111 = icmp ne i32 %110, 0
  br i1 %111, label %112, label %139

112:                                              ; preds = %108
  %113 = load ptr, ptr %2, align 8, !tbaa !5
  %114 = getelementptr inbounds %struct.WavpackContext, ptr %113, i32 0, i32 38
  %115 = load i8, ptr %114, align 8, !tbaa !34
  %116 = zext i8 %115 to i32
  %117 = icmp ne i32 %116, 0
  br i1 %117, label %130, label %118

118:                                              ; preds = %112
  %119 = load ptr, ptr %2, align 8, !tbaa !5
  %120 = getelementptr inbounds %struct.WavpackContext, ptr %119, i32 0, i32 0
  %121 = getelementptr inbounds %struct.WavpackStreamConfig, ptr %120, i32 0, i32 4
  %122 = load i32, ptr %121, align 8, !tbaa !35
  %123 = and i32 %122, 255
  %124 = icmp ne i32 %123, 0
  br i1 %124, label %130, label %125

125:                                              ; preds = %118
  %126 = load ptr, ptr %2, align 8, !tbaa !5
  %127 = getelementptr inbounds %struct.WavpackContext, ptr %126, i32 0, i32 41
  %128 = load i32, ptr %127, align 8, !tbaa !36
  %129 = icmp ne i32 %128, 0
  br i1 %129, label %130, label %139

130:                                              ; preds = %125, %118, %112
  %131 = load ptr, ptr %2, align 8, !tbaa !5
  call void @write_new_config_info(ptr noundef %131, ptr noundef %5)
  %132 = load ptr, ptr %3, align 8, !tbaa !5
  %133 = getelementptr inbounds %struct.WavpackStream, ptr %132, i32 0, i32 2
  %134 = load ptr, ptr %133, align 8, !tbaa !28
  %135 = load ptr, ptr %3, align 8, !tbaa !5
  %136 = getelementptr inbounds %struct.WavpackStream, ptr %135, i32 0, i32 3
  %137 = load ptr, ptr %136, align 8, !tbaa !29
  %138 = call i32 @copy_metadata(ptr noundef %5, ptr noundef %134, ptr noundef %137)
  call void @free_metadata(ptr noundef %5)
  br label %139

139:                                              ; preds = %130, %125, %108
  call void @llvm.lifetime.end.p0(i64 24, ptr %5) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #3
  ret void
}

; Function Attrs: nounwind uwtable
declare hidden void @write_sample_rate(ptr noundef, ptr noundef) #1

declare i32 @copy_metadata(ptr noundef, ptr noundef, ptr noundef) #2

declare void @free_metadata(ptr noundef) #2

; Function Attrs: nounwind uwtable
declare hidden void @write_channel_info(ptr noundef, ptr noundef) #1

; Function Attrs: nounwind uwtable
declare hidden void @write_channel_identities_info(ptr noundef, ptr noundef) #1

; Function Attrs: nounwind uwtable
declare hidden void @write_config_info(ptr noundef, ptr noundef) #1

; Function Attrs: nounwind uwtable
declare hidden void @write_total_samples(ptr noundef, ptr noundef) #1

; Function Attrs: nounwind uwtable
declare hidden void @write_new_config_info(ptr noundef, ptr noundef) #1

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 = { "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, !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, !13, i64 8}
!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 = !{!13, !13, i64 0}
!27 = !{!10, !13, i64 48}
!28 = !{!17, !6, i64 88}
!29 = !{!17, !6, i64 96}
!30 = !{!10, !13, i64 28}
!31 = !{!10, !13, i64 52}
!32 = !{!10, !6, i64 320}
!33 = !{!17, !14, i64 128}
!34 = !{!10, !7, i64 304}
!35 = !{!10, !13, i64 16}
!36 = !{!10, !13, i64 328}


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

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

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

; Function Attrs: nounwind uwtable
define dso_local void @send_general_metadata(ptr noundef %0) local_unnamed_addr #1 {
  %2 = alloca %struct.WavpackMetadata, align 8
  %3 = getelementptr inbounds i8, ptr %0, i64 288
  %4 = load ptr, ptr %3, align 8, !tbaa !5
  %5 = getelementptr inbounds i8, ptr %0, i64 276
  %6 = load i32, ptr %5, align 4, !tbaa !14
  %7 = sext i32 %6 to i64
  %8 = getelementptr inbounds ptr, ptr %4, i64 %7
  %9 = load ptr, ptr %8, align 8, !tbaa !15
  %10 = getelementptr inbounds i8, ptr %9, i64 8
  %11 = load i32, ptr %10, align 8, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %2) #3
  %12 = and i32 %11, 125829120
  %13 = icmp eq i32 %12, 125829120
  br i1 %13, label %14, label %23

14:                                               ; preds = %1
  %15 = getelementptr inbounds i8, ptr %0, i64 48
  %16 = load i32, ptr %15, align 8, !tbaa !26
  %.not = icmp eq i32 %16, 44100
  br i1 %.not, label %23, label %17

17:                                               ; preds = %14
  call void @write_sample_rate(ptr noundef nonnull %0, ptr noundef nonnull %2)
  %18 = getelementptr inbounds i8, ptr %9, i64 88
  %19 = load ptr, ptr %18, align 8, !tbaa !27
  %20 = getelementptr inbounds i8, ptr %9, i64 96
  %21 = load ptr, ptr %20, align 8, !tbaa !28
  %22 = call i32 @copy_metadata(ptr noundef nonnull %2, ptr noundef %19, ptr noundef %21) #3
  call void @free_metadata(ptr noundef nonnull %2) #3
  br label %23

23:                                               ; preds = %17, %14, %1
  %24 = and i32 %11, 2048
  %.not33 = icmp eq i32 %24, 0
  br i1 %.not33, label %.critedge40, label %25

25:                                               ; preds = %23
  %26 = getelementptr inbounds i8, ptr %0, i64 28
  %27 = load i32, ptr %26, align 4, !tbaa !29
  %28 = icmp sgt i32 %27, 2
  br i1 %28, label %33, label %29

29:                                               ; preds = %25
  %30 = getelementptr inbounds i8, ptr %0, i64 52
  %31 = load i32, ptr %30, align 4, !tbaa !30
  %32 = sub nsw i32 5, %27
  %.not34 = icmp eq i32 %31, %32
  br i1 %.not34, label %45, label %33

33:                                               ; preds = %29, %25
  call void @write_channel_info(ptr noundef nonnull %0, ptr noundef nonnull %2)
  %34 = getelementptr inbounds i8, ptr %9, i64 88
  %35 = load ptr, ptr %34, align 8, !tbaa !27
  %36 = getelementptr inbounds i8, ptr %9, i64 96
  %37 = load ptr, ptr %36, align 8, !tbaa !28
  %38 = call i32 @copy_metadata(ptr noundef nonnull %2, ptr noundef %35, ptr noundef %37) #3
  call void @free_metadata(ptr noundef nonnull %2) #3
  %39 = getelementptr inbounds i8, ptr %0, i64 320
  %40 = load ptr, ptr %39, align 8, !tbaa !31
  %.not35 = icmp eq ptr %40, null
  br i1 %.not35, label %45, label %41

41:                                               ; preds = %33
  call void @write_channel_identities_info(ptr noundef nonnull %0, ptr noundef nonnull %2)
  %42 = load ptr, ptr %34, align 8, !tbaa !27
  %43 = load ptr, ptr %36, align 8, !tbaa !28
  %44 = call i32 @copy_metadata(ptr noundef nonnull %2, ptr noundef %42, ptr noundef %43) #3
  call void @free_metadata(ptr noundef nonnull %2) #3
  br label %45

45:                                               ; preds = %29, %41, %33
  %46 = getelementptr inbounds i8, ptr %9, i64 128
  %47 = load i64, ptr %46, align 8, !tbaa !32
  %.not36 = icmp eq i64 %47, 0
  br i1 %.not36, label %48, label %.critedge

48:                                               ; preds = %45
  call void @write_config_info(ptr noundef nonnull %0, ptr noundef nonnull %2)
  %49 = getelementptr inbounds i8, ptr %9, i64 88
  %50 = load ptr, ptr %49, align 8, !tbaa !27
  %51 = getelementptr inbounds i8, ptr %9, i64 96
  %52 = load ptr, ptr %51, align 8, !tbaa !28
  %53 = call i32 @copy_metadata(ptr noundef nonnull %2, ptr noundef %50, ptr noundef %52) #3
  call void @free_metadata(ptr noundef nonnull %2) #3
  call void @write_total_samples(ptr noundef nonnull %0, ptr noundef nonnull %2)
  %54 = load ptr, ptr %49, align 8, !tbaa !27
  %55 = load ptr, ptr %51, align 8, !tbaa !28
  %56 = call i32 @copy_metadata(ptr noundef nonnull %2, ptr noundef %54, ptr noundef %55) #3
  call void @free_metadata(ptr noundef nonnull %2) #3
  br label %.critedge

.critedge:                                        ; preds = %45, %48
  %57 = getelementptr inbounds i8, ptr %0, i64 304
  %58 = load i8, ptr %57, align 8, !tbaa !33
  %.not37 = icmp eq i8 %58, 0
  br i1 %.not37, label %59, label %66

59:                                               ; preds = %.critedge
  %60 = getelementptr inbounds i8, ptr %0, i64 16
  %61 = load i32, ptr %60, align 8, !tbaa !34
  %62 = and i32 %61, 255
  %.not38 = icmp eq i32 %62, 0
  br i1 %.not38, label %63, label %66

63:                                               ; preds = %59
  %64 = getelementptr inbounds i8, ptr %0, i64 328
  %65 = load i32, ptr %64, align 8, !tbaa !35
  %.not39 = icmp eq i32 %65, 0
  br i1 %.not39, label %.critedge40, label %66

66:                                               ; preds = %63, %59, %.critedge
  call void @write_new_config_info(ptr noundef nonnull %0, ptr noundef nonnull %2)
  %67 = getelementptr inbounds i8, ptr %9, i64 88
  %68 = load ptr, ptr %67, align 8, !tbaa !27
  %69 = getelementptr inbounds i8, ptr %9, i64 96
  %70 = load ptr, ptr %69, align 8, !tbaa !28
  %71 = call i32 @copy_metadata(ptr noundef nonnull %2, ptr noundef %68, ptr noundef %70) #3
  call void @free_metadata(ptr noundef nonnull %2) #3
  br label %.critedge40

.critedge40:                                      ; preds = %23, %66, %63
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %2) #3
  ret void
}

; Function Attrs: nounwind uwtable
declare hidden void @write_sample_rate(ptr noundef, ptr noundef) local_unnamed_addr #1

declare i32 @copy_metadata(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

declare void @free_metadata(ptr noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare hidden void @write_channel_info(ptr noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare hidden void @write_channel_identities_info(ptr noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare hidden void @write_config_info(ptr noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare hidden void @write_total_samples(ptr noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare hidden void @write_new_config_info(ptr noundef, ptr noundef) local_unnamed_addr #1

attributes #0 = { mustprogress 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 = { "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, !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, !11, i64 8}
!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 = !{!6, !11, i64 48}
!27 = !{!17, !12, i64 88}
!28 = !{!17, !12, i64 96}
!29 = !{!6, !11, i64 28}
!30 = !{!6, !11, i64 52}
!31 = !{!6, !12, i64 320}
!32 = !{!17, !13, i64 128}
!33 = !{!6, !9, i64 304}
!34 = !{!6, !11, i64 16}
!35 = !{!6, !11, i64 328}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,SROAPass,SimplifyCFGPass