; LLVM IR from dbry/wavpack-stream :: cli (riff)

; 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.ChunkHeader = type { [4 x i8], i32 }
%struct.RiffChunkHeader = type { [4 x i8], i32, [4 x i8] }
%struct.DS64Chunk = type <{ i64, i64, i64, i32 }>
%struct.JunkChunk = type { [4 x i8], i32, [28 x i8] }
%struct.WaveHeader = type { i16, i16, i32, i32, i16, i16, i16, i16, i32, i16, [14 x i8] }

@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [5 x i8], align 1
@debug_logging_mode = external global i32, align 4
@.str.9 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.28 = external hidden unnamed_addr constant [69 x i8], align 1
@.str.29 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.30 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.31 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.32 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.33 = external hidden unnamed_addr constant [43 x i8], align 1

; 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 nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #1

declare void @error_line(ptr noundef, ...) #2

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #3

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

; Function Attrs: nounwind uwtable
define dso_local i32 @WriteRiffHeader(ptr noundef %0, ptr noundef %1, i64 noundef %2, i32 noundef %3) #4 {
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i64, align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca %struct.ChunkHeader, align 4
  %13 = alloca %struct.ChunkHeader, align 4
  %14 = alloca %struct.ChunkHeader, align 4
  %15 = alloca %struct.RiffChunkHeader, align 4
  %16 = alloca %struct.DS64Chunk, align 4
  %17 = alloca %struct.JunkChunk, align 4
  %18 = alloca %struct.WaveHeader, align 4
  %19 = alloca i32, align 4
  %20 = alloca i64, align 8
  %21 = alloca i64, align 8
  %22 = alloca i32, align 4
  %23 = alloca i32, align 4
  %24 = alloca i32, align 4
  %25 = alloca i32, align 4
  %26 = alloca i32, align 4
  %27 = alloca i32, align 4
  %28 = alloca i32, align 4
  %29 = alloca i32, align 4
  store ptr %0, ptr %6, align 8, !tbaa !5
  store ptr %1, ptr %7, align 8, !tbaa !5
  store i64 %2, ptr %8, align 8, !tbaa !9
  store i32 %3, ptr %9, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  store i32 0, ptr %10, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  store i32 1, ptr %11, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #5
  call void @llvm.lifetime.start.p0(i64 12, ptr %15) #5
  call void @llvm.lifetime.start.p0(i64 28, ptr %16) #5
  call void @llvm.lifetime.start.p0(i64 36, ptr %17) #5
  call void @llvm.lifetime.start.p0(i64 40, ptr %18) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #5
  %30 = load ptr, ptr %7, align 8, !tbaa !5
  %31 = call i32 @WavpackStreamGetNumChannels(ptr noundef %30)
  store i32 %31, ptr %22, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #5
  %32 = load ptr, ptr %7, align 8, !tbaa !5
  %33 = call i32 @WavpackStreamGetChannelMask(ptr noundef %32)
  store i32 %33, ptr %23, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #5
  %34 = load ptr, ptr %7, align 8, !tbaa !5
  %35 = call i32 @WavpackStreamGetSampleRate(ptr noundef %34)
  store i32 %35, ptr %24, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #5
  %36 = load ptr, ptr %7, align 8, !tbaa !5
  %37 = call i32 @WavpackStreamGetBytesPerSample(ptr noundef %36)
  store i32 %37, ptr %25, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #5
  %38 = load ptr, ptr %7, align 8, !tbaa !5
  %39 = call i32 @WavpackStreamGetBitsPerSample(ptr noundef %38)
  store i32 %39, ptr %26, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #5
  %40 = load ptr, ptr %7, align 8, !tbaa !5
  %41 = call i32 @WavpackStreamGetFloatNormExp(ptr noundef %40)
  %42 = icmp ne i32 %41, 0
  %43 = zext i1 %42 to i64
  %44 = select i1 %42, i32 3, i32 1
  store i32 %44, ptr %27, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %28) #5
  store i32 16, ptr %28, align 4, !tbaa !11
  %45 = load i32, ptr %27, align 4, !tbaa !11
  %46 = icmp eq i32 %45, 3
  br i1 %46, label %47, label %52

47:                                               ; preds = %4
  %48 = load ptr, ptr %7, align 8, !tbaa !5
  %49 = call i32 @WavpackStreamGetFloatNormExp(ptr noundef %48)
  %50 = icmp ne i32 %49, 127
  br i1 %50, label %51, label %52

51:                                               ; preds = %47
  call void (ptr, ...) @error_line(ptr noundef @.str.28)
  store i32 0, ptr %5, align 4
  store i32 1, ptr %29, align 4
  br label %271

52:                                               ; preds = %47, %4
  %53 = load i64, ptr %8, align 8, !tbaa !9
  %54 = icmp eq i64 %53, -1
  br i1 %54, label %55, label %61

55:                                               ; preds = %52
  %56 = load i32, ptr %25, align 4, !tbaa !11
  %57 = load i32, ptr %22, align 4, !tbaa !11
  %58 = mul nsw i32 %56, %57
  %59 = sdiv i32 2147479552, %58
  %60 = sext i32 %59 to i64
  store i64 %60, ptr %8, align 8, !tbaa !9
  br label %61

61:                                               ; preds = %55, %52
  %62 = load i64, ptr %8, align 8, !tbaa !9
  %63 = load i32, ptr %25, align 4, !tbaa !11
  %64 = sext i32 %63 to i64
  %65 = mul nsw i64 %62, %64
  %66 = load i32, ptr %22, align 4, !tbaa !11
  %67 = sext i32 %66 to i64
  %68 = mul nsw i64 %65, %67
  store i64 %68, ptr %20, align 8, !tbaa !9
  %69 = load i64, ptr %20, align 8, !tbaa !9
  %70 = icmp sgt i64 %69, 4278190080
  br i1 %70, label %71, label %77

71:                                               ; preds = %61
  %72 = load i32, ptr @debug_logging_mode, align 4, !tbaa !11
  %73 = icmp ne i32 %72, 0
  br i1 %73, label %74, label %76

74:                                               ; preds = %71
  %75 = load i64, ptr %20, align 8, !tbaa !9
  call void (ptr, ...) @error_line(ptr noundef @.str.29, i64 noundef %75)
  br label %76

76:                                               ; preds = %74, %71
  store i32 0, ptr %11, align 4, !tbaa !11
  store i32 1, ptr %10, align 4, !tbaa !11
  br label %83

77:                                               ; preds = %61
  %78 = load i32, ptr @debug_logging_mode, align 4, !tbaa !11
  %79 = icmp ne i32 %78, 0
  br i1 %79, label %80, label %82

80:                                               ; preds = %77
  %81 = load i64, ptr %20, align 8, !tbaa !9
  call void (ptr, ...) @error_line(ptr noundef @.str.30, i64 noundef %81)
  br label %82

82:                                               ; preds = %80, %77
  br label %83

83:                                               ; preds = %82, %76
  call void @llvm.memset.p0.i64(ptr align 4 %18, i8 0, i64 40, i1 false)
  %84 = load i32, ptr %27, align 4, !tbaa !11
  %85 = trunc i32 %84 to i16
  %86 = getelementptr inbounds %struct.WaveHeader, ptr %18, i32 0, i32 0
  store i16 %85, ptr %86, align 4, !tbaa !13
  %87 = load i32, ptr %22, align 4, !tbaa !11
  %88 = trunc i32 %87 to i16
  %89 = getelementptr inbounds %struct.WaveHeader, ptr %18, i32 0, i32 1
  store i16 %88, ptr %89, align 2, !tbaa !16
  %90 = load i32, ptr %24, align 4, !tbaa !11
  %91 = getelementptr inbounds %struct.WaveHeader, ptr %18, i32 0, i32 2
  store i32 %90, ptr %91, align 4, !tbaa !17
  %92 = load i32, ptr %24, align 4, !tbaa !11
  %93 = load i32, ptr %22, align 4, !tbaa !11
  %94 = mul nsw i32 %92, %93
  %95 = load i32, ptr %25, align 4, !tbaa !11
  %96 = mul nsw i32 %94, %95
  %97 = getelementptr inbounds %struct.WaveHeader, ptr %18, i32 0, i32 3
  store i32 %96, ptr %97, align 4, !tbaa !18
  %98 = load i32, ptr %25, align 4, !tbaa !11
  %99 = load i32, ptr %22, align 4, !tbaa !11
  %100 = mul nsw i32 %98, %99
  %101 = trunc i32 %100 to i16
  %102 = getelementptr inbounds %struct.WaveHeader, ptr %18, i32 0, i32 4
  store i16 %101, ptr %102, align 4, !tbaa !19
  %103 = load i32, ptr %26, align 4, !tbaa !11
  %104 = trunc i32 %103 to i16
  %105 = getelementptr inbounds %struct.WaveHeader, ptr %18, i32 0, i32 5
  store i16 %104, ptr %105, align 2, !tbaa !20
  %106 = load i32, ptr %22, align 4, !tbaa !11
  %107 = icmp sgt i32 %106, 2
  br i1 %107, label %113, label %108

108:                                              ; preds = %83
  %109 = load i32, ptr %23, align 4, !tbaa !11
  %110 = load i32, ptr %22, align 4, !tbaa !11
  %111 = sub nsw i32 5, %110
  %112 = icmp ne i32 %109, %111
  br i1 %112, label %113, label %140

113:                                              ; preds = %108, %83
  store i32 40, ptr %28, align 4, !tbaa !11
  %114 = getelementptr inbounds %struct.WaveHeader, ptr %18, i32 0, i32 6
  store i16 22, ptr %114, align 4, !tbaa !21
  %115 = load i32, ptr %26, align 4, !tbaa !11
  %116 = trunc i32 %115 to i16
  %117 = getelementptr inbounds %struct.WaveHeader, ptr %18, i32 0, i32 7
  store i16 %116, ptr %117, align 2, !tbaa !22
  %118 = load i32, ptr %27, align 4, !tbaa !11
  %119 = trunc i32 %118 to i16
  %120 = getelementptr inbounds %struct.WaveHeader, ptr %18, i32 0, i32 9
  store i16 %119, ptr %120, align 4, !tbaa !23
  %121 = load i32, ptr %23, align 4, !tbaa !11
  %122 = getelementptr inbounds %struct.WaveHeader, ptr %18, i32 0, i32 8
  store i32 %121, ptr %122, align 4, !tbaa !24
  %123 = getelementptr inbounds %struct.WaveHeader, ptr %18, i32 0, i32 0
  store i16 -2, ptr %123, align 4, !tbaa !13
  %124 = load i32, ptr %25, align 4, !tbaa !11
  %125 = mul nsw i32 %124, 8
  %126 = trunc i32 %125 to i16
  %127 = getelementptr inbounds %struct.WaveHeader, ptr %18, i32 0, i32 5
  store i16 %126, ptr %127, align 2, !tbaa !20
  %128 = getelementptr inbounds %struct.WaveHeader, ptr %18, i32 0, i32 10
  %129 = getelementptr inbounds [14 x i8], ptr %128, i64 0, i64 4
  store i8 16, ptr %129, align 2, !tbaa !25
  %130 = getelementptr inbounds %struct.WaveHeader, ptr %18, i32 0, i32 10
  %131 = getelementptr inbounds [14 x i8], ptr %130, i64 0, i64 6
  store i8 -128, ptr %131, align 2, !tbaa !25
  %132 = getelementptr inbounds %struct.WaveHeader, ptr %18, i32 0, i32 10
  %133 = getelementptr inbounds [14 x i8], ptr %132, i64 0, i64 9
  store i8 -86, ptr %133, align 1, !tbaa !25
  %134 = getelementptr inbounds %struct.WaveHeader, ptr %18, i32 0, i32 10
  %135 = getelementptr inbounds [14 x i8], ptr %134, i64 0, i64 11
  store i8 56, ptr %135, align 1, !tbaa !25
  %136 = getelementptr inbounds %struct.WaveHeader, ptr %18, i32 0, i32 10
  %137 = getelementptr inbounds [14 x i8], ptr %136, i64 0, i64 12
  store i8 -101, ptr %137, align 2, !tbaa !25
  %138 = getelementptr inbounds %struct.WaveHeader, ptr %18, i32 0, i32 10
  %139 = getelementptr inbounds [14 x i8], ptr %138, i64 0, i64 13
  store i8 113, ptr %139, align 1, !tbaa !25
  br label %140

140:                                              ; preds = %113, %108
  %141 = getelementptr inbounds %struct.RiffChunkHeader, ptr %15, i32 0, i32 0
  %142 = getelementptr inbounds [4 x i8], ptr %141, i64 0, i64 0
  %143 = load i32, ptr %10, align 4, !tbaa !11
  %144 = icmp ne i32 %143, 0
  %145 = zext i1 %144 to i64
  %146 = select i1 %144, ptr @.str, ptr @.str.31
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %142, ptr align 1 %146, i64 4, i1 false)
  %147 = getelementptr inbounds %struct.RiffChunkHeader, ptr %15, i32 0, i32 2
  %148 = getelementptr inbounds [4 x i8], ptr %147, i64 0, i64 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %148, ptr align 1 @.str.2, i64 4, i1 false)
  %149 = load i32, ptr %28, align 4, !tbaa !11
  %150 = sext i32 %149 to i64
  %151 = add i64 12, %150
  %152 = add i64 %151, 8
  %153 = load i64, ptr %20, align 8, !tbaa !9
  %154 = add nsw i64 %153, 1
  %155 = and i64 %154, -2
  %156 = add i64 %152, %155
  store i64 %156, ptr %21, align 8, !tbaa !9
  %157 = load i32, ptr %10, align 4, !tbaa !11
  %158 = icmp ne i32 %157, 0
  br i1 %158, label %159, label %162

159:                                              ; preds = %140
  %160 = load i64, ptr %21, align 8, !tbaa !9
  %161 = add i64 %160, 36
  store i64 %161, ptr %21, align 8, !tbaa !9
  br label %162

162:                                              ; preds = %159, %140
  %163 = load i32, ptr %11, align 4, !tbaa !11
  %164 = icmp ne i32 %163, 0
  br i1 %164, label %165, label %168

165:                                              ; preds = %162
  %166 = load i64, ptr %21, align 8, !tbaa !9
  %167 = add i64 %166, 36
  store i64 %167, ptr %21, align 8, !tbaa !9
  br label %168

168:                                              ; preds = %165, %162
  %169 = getelementptr inbounds %struct.ChunkHeader, ptr %14, i32 0, i32 0
  %170 = getelementptr inbounds [4 x i8], ptr %169, i64 0, i64 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %170, ptr align 1 @.str.9, i64 4, i1 false)
  %171 = getelementptr inbounds %struct.ChunkHeader, ptr %13, i32 0, i32 0
  %172 = getelementptr inbounds [4 x i8], ptr %171, i64 0, i64 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %172, ptr align 1 @.str.21, i64 4, i1 false)
  %173 = load i32, ptr %28, align 4, !tbaa !11
  %174 = getelementptr inbounds %struct.ChunkHeader, ptr %14, i32 0, i32 1
  store i32 %173, ptr %174, align 4, !tbaa !26
  %175 = load i32, ptr %11, align 4, !tbaa !11
  %176 = icmp ne i32 %175, 0
  br i1 %176, label %177, label %181

177:                                              ; preds = %168
  call void @llvm.memset.p0.i64(ptr align 4 %17, i8 0, i64 36, i1 false)
  %178 = getelementptr inbounds %struct.JunkChunk, ptr %17, i32 0, i32 0
  %179 = getelementptr inbounds [4 x i8], ptr %178, i64 0, i64 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %179, ptr align 1 @.str.32, i64 4, i1 false)
  %180 = getelementptr inbounds %struct.JunkChunk, ptr %17, i32 0, i32 1
  store i32 28, ptr %180, align 4, !tbaa !28
  call void @WavpackStreamNativeToLittleEndian(ptr noundef %17, ptr noundef @.str.5)
  br label %181

181:                                              ; preds = %177, %168
  %182 = load i32, ptr %10, align 4, !tbaa !11
  %183 = icmp ne i32 %182, 0
  br i1 %183, label %184, label %196

184:                                              ; preds = %181
  %185 = getelementptr inbounds %struct.ChunkHeader, ptr %12, i32 0, i32 0
  %186 = getelementptr inbounds [4 x i8], ptr %185, i64 0, i64 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %186, ptr align 1 @.str.6, i64 4, i1 false)
  %187 = getelementptr inbounds %struct.ChunkHeader, ptr %12, i32 0, i32 1
  store i32 28, ptr %187, align 4, !tbaa !26
  call void @llvm.memset.p0.i64(ptr align 4 %16, i8 0, i64 28, i1 false)
  %188 = load i64, ptr %21, align 8, !tbaa !9
  %189 = getelementptr inbounds %struct.DS64Chunk, ptr %16, i32 0, i32 0
  store i64 %188, ptr %189, align 4, !tbaa !30
  %190 = load i64, ptr %20, align 8, !tbaa !9
  %191 = getelementptr inbounds %struct.DS64Chunk, ptr %16, i32 0, i32 1
  store i64 %190, ptr %191, align 4, !tbaa !32
  %192 = load i64, ptr %8, align 8, !tbaa !9
  %193 = getelementptr inbounds %struct.DS64Chunk, ptr %16, i32 0, i32 2
  store i64 %192, ptr %193, align 4, !tbaa !33
  %194 = getelementptr inbounds %struct.RiffChunkHeader, ptr %15, i32 0, i32 1
  store i32 -1, ptr %194, align 4, !tbaa !28
  %195 = getelementptr inbounds %struct.ChunkHeader, ptr %13, i32 0, i32 1
  store i32 -1, ptr %195, align 4, !tbaa !26
  call void @WavpackStreamNativeToLittleEndian(ptr noundef %12, ptr noundef @.str.5)
  call void @WavpackStreamNativeToLittleEndian(ptr noundef %16, ptr noundef @.str.7)
  br label %203

196:                                              ; preds = %181
  %197 = load i64, ptr %21, align 8, !tbaa !9
  %198 = trunc i64 %197 to i32
  %199 = getelementptr inbounds %struct.RiffChunkHeader, ptr %15, i32 0, i32 1
  store i32 %198, ptr %199, align 4, !tbaa !28
  %200 = load i64, ptr %20, align 8, !tbaa !9
  %201 = trunc i64 %200 to i32
  %202 = getelementptr inbounds %struct.ChunkHeader, ptr %13, i32 0, i32 1
  store i32 %201, ptr %202, align 4, !tbaa !26
  br label %203

203:                                              ; preds = %196, %184
  call void @WavpackStreamNativeToLittleEndian(ptr noundef %15, ptr noundef @.str.5)
  call void @WavpackStreamNativeToLittleEndian(ptr noundef %14, ptr noundef @.str.5)
  call void @WavpackStreamNativeToLittleEndian(ptr noundef %18, ptr noundef @.str.10)
  call void @WavpackStreamNativeToLittleEndian(ptr noundef %13, ptr noundef @.str.5)
  %204 = load ptr, ptr %6, align 8, !tbaa !5
  %205 = call i32 @DoWriteFile(ptr noundef %204, ptr noundef %15, i32 noundef 12, ptr noundef %19)
  %206 = icmp ne i32 %205, 0
  br i1 %206, label %207, label %269

207:                                              ; preds = %203
  %208 = load i32, ptr %19, align 4, !tbaa !11
  %209 = zext i32 %208 to i64
  %210 = icmp ne i64 %209, 12
  br i1 %210, label %269, label %211

211:                                              ; preds = %207
  %212 = load i32, ptr %10, align 4, !tbaa !11
  %213 = icmp ne i32 %212, 0
  br i1 %213, label %214, label %222

214:                                              ; preds = %211
  %215 = load ptr, ptr %6, align 8, !tbaa !5
  %216 = call i32 @DoWriteFile(ptr noundef %215, ptr noundef %12, i32 noundef 8, ptr noundef %19)
  %217 = icmp ne i32 %216, 0
  br i1 %217, label %218, label %269

218:                                              ; preds = %214
  %219 = load i32, ptr %19, align 4, !tbaa !11
  %220 = zext i32 %219 to i64
  %221 = icmp ne i64 %220, 8
  br i1 %221, label %269, label %222

222:                                              ; preds = %218, %211
  %223 = load i32, ptr %10, align 4, !tbaa !11
  %224 = icmp ne i32 %223, 0
  br i1 %224, label %225, label %233

225:                                              ; preds = %222
  %226 = load ptr, ptr %6, align 8, !tbaa !5
  %227 = call i32 @DoWriteFile(ptr noundef %226, ptr noundef %16, i32 noundef 28, ptr noundef %19)
  %228 = icmp ne i32 %227, 0
  br i1 %228, label %229, label %269

229:                                              ; preds = %225
  %230 = load i32, ptr %19, align 4, !tbaa !11
  %231 = zext i32 %230 to i64
  %232 = icmp ne i64 %231, 28
  br i1 %232, label %269, label %233

233:                                              ; preds = %229, %222
  %234 = load i32, ptr %11, align 4, !tbaa !11
  %235 = icmp ne i32 %234, 0
  br i1 %235, label %236, label %244

236:                                              ; preds = %233
  %237 = load ptr, ptr %6, align 8, !tbaa !5
  %238 = call i32 @DoWriteFile(ptr noundef %237, ptr noundef %17, i32 noundef 36, ptr noundef %19)
  %239 = icmp ne i32 %238, 0
  br i1 %239, label %240, label %269

240:                                              ; preds = %236
  %241 = load i32, ptr %19, align 4, !tbaa !11
  %242 = zext i32 %241 to i64
  %243 = icmp ne i64 %242, 36
  br i1 %243, label %269, label %244

244:                                              ; preds = %240, %233
  %245 = load ptr, ptr %6, align 8, !tbaa !5
  %246 = call i32 @DoWriteFile(ptr noundef %245, ptr noundef %14, i32 noundef 8, ptr noundef %19)
  %247 = icmp ne i32 %246, 0
  br i1 %247, label %248, label %269

248:                                              ; preds = %244
  %249 = load i32, ptr %19, align 4, !tbaa !11
  %250 = zext i32 %249 to i64
  %251 = icmp ne i64 %250, 8
  br i1 %251, label %269, label %252

252:                                              ; preds = %248
  %253 = load ptr, ptr %6, align 8, !tbaa !5
  %254 = load i32, ptr %28, align 4, !tbaa !11
  %255 = call i32 @DoWriteFile(ptr noundef %253, ptr noundef %18, i32 noundef %254, ptr noundef %19)
  %256 = icmp ne i32 %255, 0
  br i1 %256, label %257, label %269

257:                                              ; preds = %252
  %258 = load i32, ptr %19, align 4, !tbaa !11
  %259 = load i32, ptr %28, align 4, !tbaa !11
  %260 = icmp ne i32 %258, %259
  br i1 %260, label %269, label %261

261:                                              ; preds = %257
  %262 = load ptr, ptr %6, align 8, !tbaa !5
  %263 = call i32 @DoWriteFile(ptr noundef %262, ptr noundef %13, i32 noundef 8, ptr noundef %19)
  %264 = icmp ne i32 %263, 0
  br i1 %264, label %265, label %269

265:                                              ; preds = %261
  %266 = load i32, ptr %19, align 4, !tbaa !11
  %267 = zext i32 %266 to i64
  %268 = icmp ne i64 %267, 8
  br i1 %268, label %269, label %270

269:                                              ; preds = %265, %261, %257, %252, %248, %244, %240, %236, %229, %225, %218, %214, %207, %203
  call void (ptr, ...) @error_line(ptr noundef @.str.33)
  store i32 0, ptr %5, align 4
  store i32 1, ptr %29, align 4
  br label %271

270:                                              ; preds = %265
  store i32 1, ptr %5, align 4
  store i32 1, ptr %29, align 4
  br label %271

271:                                              ; preds = %270, %269, %51
  call void @llvm.lifetime.end.p0(i64 4, ptr %28) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #5
  call void @llvm.lifetime.end.p0(i64 40, ptr %18) #5
  call void @llvm.lifetime.end.p0(i64 36, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 28, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 12, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  %272 = load i32, ptr %5, align 4
  ret i32 %272
}

declare i32 @WavpackStreamGetNumChannels(ptr noundef) #2

declare i32 @WavpackStreamGetChannelMask(ptr noundef) #2

declare i32 @WavpackStreamGetSampleRate(ptr noundef) #2

declare i32 @WavpackStreamGetBytesPerSample(ptr noundef) #2

declare i32 @WavpackStreamGetBitsPerSample(ptr noundef) #2

declare i32 @WavpackStreamGetFloatNormExp(ptr noundef) #2

declare void @WavpackStreamNativeToLittleEndian(ptr noundef, ptr noundef) #2

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { nounwind 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 #5 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!14, !15, i64 0}
!14 = !{!"", !15, i64 0, !15, i64 2, !12, i64 4, !12, i64 8, !15, i64 12, !15, i64 14, !15, i64 16, !15, i64 18, !12, i64 20, !15, i64 24, !7, i64 26}
!15 = !{!"short", !7, i64 0}
!16 = !{!14, !15, i64 2}
!17 = !{!14, !12, i64 4}
!18 = !{!14, !12, i64 8}
!19 = !{!14, !15, i64 12}
!20 = !{!14, !15, i64 14}
!21 = !{!14, !15, i64 16}
!22 = !{!14, !15, i64 18}
!23 = !{!14, !15, i64 24}
!24 = !{!14, !12, i64 20}
!25 = !{!7, !7, i64 0}
!26 = !{!27, !12, i64 4}
!27 = !{!"", !7, i64 0, !12, i64 4}
!28 = !{!29, !12, i64 4}
!29 = !{!"", !7, i64 0, !12, i64 4, !7, i64 8}
!30 = !{!31, !10, i64 0}
!31 = !{!"", !10, i64 0, !10, i64 8, !10, i64 16, !12, i64 24}
!32 = !{!31, !10, i64 8}
!33 = !{!31, !10, i64 16}


; 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.ChunkHeader = type { [4 x i8], i32 }
%struct.RiffChunkHeader = type { [4 x i8], i32, [4 x i8] }
%struct.DS64Chunk = type <{ i64, i64, i64, i32 }>
%struct.JunkChunk = type { [4 x i8], i32, [28 x i8] }
%struct.WaveHeader = type { i16, i16, i32, i32, i16, i16, i16, i16, i32, i16, [14 x i8] }

@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [5 x i8], align 1
@debug_logging_mode = external local_unnamed_addr global i32, align 4
@.str.9 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.28 = external hidden unnamed_addr constant [69 x i8], align 1
@.str.29 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.30 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.31 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.32 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.33 = external hidden unnamed_addr constant [43 x i8], align 1

; 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 nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #1

declare void @error_line(ptr noundef, ...) local_unnamed_addr #2

; 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 range(i32 0, 2) i32 @WriteRiffHeader(ptr noundef %0, ptr noundef %1, i64 noundef %2, i32 noundef %3) local_unnamed_addr #3 {
  %5 = alloca %struct.ChunkHeader, align 4
  %6 = alloca %struct.ChunkHeader, align 4
  %7 = alloca %struct.ChunkHeader, align 4
  %8 = alloca %struct.RiffChunkHeader, align 4
  %9 = alloca %struct.DS64Chunk, align 8
  %10 = alloca %struct.JunkChunk, align 4
  %11 = alloca %struct.WaveHeader, align 4
  %12 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #4
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %8) #4
  call void @llvm.lifetime.start.p0(i64 28, ptr nonnull %9) #4
  call void @llvm.lifetime.start.p0(i64 36, ptr nonnull %10) #4
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %11) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %12) #4
  %13 = tail call i32 @WavpackStreamGetNumChannels(ptr noundef %1) #4
  %14 = tail call i32 @WavpackStreamGetChannelMask(ptr noundef %1) #4
  %15 = tail call i32 @WavpackStreamGetSampleRate(ptr noundef %1) #4
  %16 = tail call i32 @WavpackStreamGetBytesPerSample(ptr noundef %1) #4
  %17 = tail call i32 @WavpackStreamGetBitsPerSample(ptr noundef %1) #4
  %18 = tail call i32 @WavpackStreamGetFloatNormExp(ptr noundef %1) #4
  %.not = icmp eq i32 %18, 0
  br i1 %.not, label %22, label %19

19:                                               ; preds = %4
  %20 = tail call i32 @WavpackStreamGetFloatNormExp(ptr noundef %1) #4
  %.not86 = icmp eq i32 %20, 127
  br i1 %.not86, label %22, label %21

21:                                               ; preds = %19
  tail call void (ptr, ...) @error_line(ptr noundef nonnull @.str.28) #4
  br label %123

22:                                               ; preds = %19, %4
  %23 = icmp eq i64 %2, -1
  br i1 %23, label %24, label %28

24:                                               ; preds = %22
  %25 = mul nsw i32 %16, %13
  %26 = sdiv i32 2147479552, %25
  %27 = sext i32 %26 to i64
  br label %28

28:                                               ; preds = %24, %22
  %.078 = phi i64 [ %27, %24 ], [ %2, %22 ]
  %29 = sext i32 %16 to i64
  %30 = sext i32 %13 to i64
  %31 = mul nsw i64 %29, %30
  %32 = mul i64 %31, %.078
  %33 = icmp sgt i64 %32, 4278190080
  %34 = load i32, ptr @debug_logging_mode, align 4, !tbaa !5
  %.not88 = icmp eq i32 %34, 0
  br i1 %.not88, label %35, label %.sink.split

.sink.split:                                      ; preds = %28
  %.str.29..str.30 = select i1 %33, ptr @.str.29, ptr @.str.30
  tail call void (ptr, ...) @error_line(ptr noundef nonnull %.str.29..str.30, i64 noundef %32) #4
  br label %35

35:                                               ; preds = %28, %.sink.split
  %36 = getelementptr inbounds i8, ptr %11, i64 16
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(40) %36, i8 0, i64 24, i1 false)
  %37 = select i1 %.not, i16 1, i16 3
  store i16 %37, ptr %11, align 4, !tbaa !9
  %38 = trunc i32 %13 to i16
  %39 = getelementptr inbounds i8, ptr %11, i64 2
  store i16 %38, ptr %39, align 2, !tbaa !12
  %40 = getelementptr inbounds i8, ptr %11, i64 4
  store i32 %15, ptr %40, align 4, !tbaa !13
  %41 = mul i32 %16, %13
  %42 = mul i32 %41, %15
  %43 = getelementptr inbounds i8, ptr %11, i64 8
  store i32 %42, ptr %43, align 4, !tbaa !14
  %44 = trunc i32 %41 to i16
  %45 = getelementptr inbounds i8, ptr %11, i64 12
  store i16 %44, ptr %45, align 4, !tbaa !15
  %46 = trunc i32 %17 to i16
  %47 = getelementptr inbounds i8, ptr %11, i64 14
  store i16 %46, ptr %47, align 2, !tbaa !16
  %48 = icmp slt i32 %13, 3
  %49 = sub nsw i32 5, %13
  %.not89 = icmp eq i32 %14, %49
  %or.cond94 = select i1 %48, i1 %.not89, i1 false
  br i1 %or.cond94, label %62, label %50

50:                                               ; preds = %35
  %51 = getelementptr inbounds i8, ptr %11, i64 16
  store i16 22, ptr %51, align 4, !tbaa !17
  %52 = getelementptr inbounds i8, ptr %11, i64 18
  store i16 %46, ptr %52, align 2, !tbaa !18
  %53 = getelementptr inbounds i8, ptr %11, i64 24
  store i16 %37, ptr %53, align 4, !tbaa !19
  %54 = getelementptr inbounds i8, ptr %11, i64 20
  store i32 %14, ptr %54, align 4, !tbaa !20
  store i16 -2, ptr %11, align 4, !tbaa !9
  %.tr = trunc i32 %16 to i16
  %55 = shl i16 %.tr, 3
  store i16 %55, ptr %47, align 2, !tbaa !16
  %56 = getelementptr inbounds i8, ptr %11, i64 30
  store i8 16, ptr %56, align 2, !tbaa !21
  %57 = getelementptr inbounds i8, ptr %11, i64 32
  store i8 -128, ptr %57, align 4, !tbaa !21
  %58 = getelementptr inbounds i8, ptr %11, i64 35
  store i8 -86, ptr %58, align 1, !tbaa !21
  %59 = getelementptr inbounds i8, ptr %11, i64 37
  store i8 56, ptr %59, align 1, !tbaa !21
  %60 = getelementptr inbounds i8, ptr %11, i64 38
  store i8 -101, ptr %60, align 2, !tbaa !21
  %61 = getelementptr inbounds i8, ptr %11, i64 39
  store i8 113, ptr %61, align 1, !tbaa !21
  br label %62

62:                                               ; preds = %35, %50
  %.0 = phi i32 [ 40, %50 ], [ 16, %35 ]
  %.str.31.val = load i32, ptr @.str.31, align 1
  %.str.val = load i32, ptr @.str, align 1
  %63 = select i1 %33, i32 %.str.val, i32 %.str.31.val
  store i32 %63, ptr %8, align 4
  %64 = getelementptr inbounds i8, ptr %8, i64 8
  %65 = load i32, ptr @.str.2, align 1
  store i32 %65, ptr %64, align 4
  %narrow = add nuw nsw i32 %.0, 20
  %66 = zext nneg i32 %narrow to i64
  %67 = add nsw i64 %32, 1
  %68 = and i64 %67, -2
  %69 = add i64 %68, %66
  %70 = load i32, ptr @.str.9, align 1
  store i32 %70, ptr %7, align 4
  %71 = load i32, ptr @.str.21, align 1
  store i32 %71, ptr %6, align 4
  %72 = getelementptr inbounds i8, ptr %7, i64 4
  store i32 %.0, ptr %72, align 4, !tbaa !22
  br i1 %33, label %.critedge, label %73

73:                                               ; preds = %62
  %74 = getelementptr inbounds i8, ptr %10, i64 8
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(36) %74, i8 0, i64 28, i1 false)
  %75 = load i32, ptr @.str.32, align 1
  store i32 %75, ptr %10, align 4
  %76 = getelementptr inbounds i8, ptr %10, i64 4
  store i32 28, ptr %76, align 4, !tbaa !24
  call void @WavpackStreamNativeToLittleEndian(ptr noundef nonnull %10, ptr noundef nonnull @.str.5) #4
  %77 = trunc i64 %69 to i32
  %78 = add i32 %77, 36
  %79 = getelementptr inbounds i8, ptr %8, i64 4
  store i32 %78, ptr %79, align 4, !tbaa !24
  %80 = trunc i64 %32 to i32
  %81 = getelementptr inbounds i8, ptr %6, i64 4
  store i32 %80, ptr %81, align 4, !tbaa !22
  br label %90

.critedge:                                        ; preds = %62
  %82 = add i64 %69, 36
  %83 = load i32, ptr @.str.6, align 1
  store i32 %83, ptr %5, align 4
  %84 = getelementptr inbounds i8, ptr %5, i64 4
  store i32 28, ptr %84, align 4, !tbaa !22
  %85 = getelementptr inbounds i8, ptr %9, i64 24
  store i32 0, ptr %85, align 8
  store i64 %82, ptr %9, align 8, !tbaa !26
  %86 = getelementptr inbounds i8, ptr %9, i64 8
  store i64 %32, ptr %86, align 8, !tbaa !29
  %87 = getelementptr inbounds i8, ptr %9, i64 16
  store i64 %.078, ptr %87, align 8, !tbaa !30
  %88 = getelementptr inbounds i8, ptr %8, i64 4
  store i32 -1, ptr %88, align 4, !tbaa !24
  %89 = getelementptr inbounds i8, ptr %6, i64 4
  store i32 -1, ptr %89, align 4, !tbaa !22
  call void @WavpackStreamNativeToLittleEndian(ptr noundef nonnull %5, ptr noundef nonnull @.str.5) #4
  call void @WavpackStreamNativeToLittleEndian(ptr noundef nonnull %9, ptr noundef nonnull @.str.7) #4
  br label %90

90:                                               ; preds = %73, %.critedge
  call void @WavpackStreamNativeToLittleEndian(ptr noundef nonnull %8, ptr noundef nonnull @.str.5) #4
  call void @WavpackStreamNativeToLittleEndian(ptr noundef nonnull %7, ptr noundef nonnull @.str.5) #4
  call void @WavpackStreamNativeToLittleEndian(ptr noundef nonnull %11, ptr noundef nonnull @.str.10) #4
  call void @WavpackStreamNativeToLittleEndian(ptr noundef nonnull %6, ptr noundef nonnull @.str.5) #4
  %91 = call i32 @DoWriteFile(ptr noundef %0, ptr noundef nonnull %8, i32 noundef 12, ptr noundef nonnull %12) #4
  %92 = icmp eq i32 %91, 0
  %93 = load i32, ptr %12, align 4
  %94 = icmp ne i32 %93, 12
  %or.cond = select i1 %92, i1 true, i1 %94
  br i1 %or.cond, label %122, label %95

95:                                               ; preds = %90
  br i1 %33, label %96, label %.critedge97

96:                                               ; preds = %95
  %97 = call i32 @DoWriteFile(ptr noundef %0, ptr noundef nonnull %5, i32 noundef 8, ptr noundef nonnull %12) #4
  %98 = icmp eq i32 %97, 0
  %99 = load i32, ptr %12, align 4
  %100 = icmp ne i32 %99, 8
  %or.cond5 = select i1 %98, i1 true, i1 %100
  br i1 %or.cond5, label %122, label %101

101:                                              ; preds = %96
  %102 = call i32 @DoWriteFile(ptr noundef %0, ptr noundef nonnull %9, i32 noundef 28, ptr noundef nonnull %12) #4
  %103 = icmp eq i32 %102, 0
  %104 = load i32, ptr %12, align 4
  %105 = icmp ne i32 %104, 28
  %or.cond8 = select i1 %103, i1 true, i1 %105
  br i1 %or.cond8, label %122, label %.critedge96

.critedge97:                                      ; preds = %95
  %106 = call i32 @DoWriteFile(ptr noundef %0, ptr noundef nonnull %10, i32 noundef 36, ptr noundef nonnull %12) #4
  %107 = icmp eq i32 %106, 0
  %108 = load i32, ptr %12, align 4
  %109 = icmp ne i32 %108, 36
  %or.cond11 = select i1 %107, i1 true, i1 %109
  br i1 %or.cond11, label %122, label %.critedge96

.critedge96:                                      ; preds = %101, %.critedge97
  %110 = call i32 @DoWriteFile(ptr noundef %0, ptr noundef nonnull %7, i32 noundef 8, ptr noundef nonnull %12) #4
  %111 = icmp eq i32 %110, 0
  %112 = load i32, ptr %12, align 4
  %113 = icmp ne i32 %112, 8
  %or.cond14 = select i1 %111, i1 true, i1 %113
  br i1 %or.cond14, label %122, label %114

114:                                              ; preds = %.critedge96
  %115 = call i32 @DoWriteFile(ptr noundef %0, ptr noundef nonnull %11, i32 noundef %.0, ptr noundef nonnull %12) #4
  %.not92 = icmp ne i32 %115, 0
  %116 = load i32, ptr %12, align 4
  %.not93 = icmp eq i32 %116, %.0
  %or.cond98 = select i1 %.not92, i1 %.not93, i1 false
  br i1 %or.cond98, label %117, label %122

117:                                              ; preds = %114
  %118 = call i32 @DoWriteFile(ptr noundef %0, ptr noundef nonnull %6, i32 noundef 8, ptr noundef nonnull %12) #4
  %119 = icmp eq i32 %118, 0
  %120 = load i32, ptr %12, align 4
  %121 = icmp ne i32 %120, 8
  %or.cond17 = select i1 %119, i1 true, i1 %121
  br i1 %or.cond17, label %122, label %123

122:                                              ; preds = %117, %114, %.critedge96, %.critedge97, %101, %96, %90
  call void (ptr, ...) @error_line(ptr noundef nonnull @.str.33) #4
  br label %123

123:                                              ; preds = %117, %122, %21
  %.077 = phi i32 [ 0, %21 ], [ 0, %122 ], [ 1, %117 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %12) #4
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %11) #4
  call void @llvm.lifetime.end.p0(i64 36, ptr nonnull %10) #4
  call void @llvm.lifetime.end.p0(i64 28, ptr nonnull %9) #4
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %8) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #4
  ret i32 %.077
}

declare i32 @WavpackStreamGetNumChannels(ptr noundef) local_unnamed_addr #2

declare i32 @WavpackStreamGetChannelMask(ptr noundef) local_unnamed_addr #2

declare i32 @WavpackStreamGetSampleRate(ptr noundef) local_unnamed_addr #2

declare i32 @WavpackStreamGetBytesPerSample(ptr noundef) local_unnamed_addr #2

declare i32 @WavpackStreamGetBitsPerSample(ptr noundef) local_unnamed_addr #2

declare i32 @WavpackStreamGetFloatNormExp(ptr noundef) local_unnamed_addr #2

declare void @WavpackStreamNativeToLittleEndian(ptr noundef, ptr noundef) local_unnamed_addr #2

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
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 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 #4 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !11, i64 0}
!10 = !{!"", !11, i64 0, !11, i64 2, !6, i64 4, !6, i64 8, !11, i64 12, !11, i64 14, !11, i64 16, !11, i64 18, !6, i64 20, !11, i64 24, !7, i64 26}
!11 = !{!"short", !7, i64 0}
!12 = !{!10, !11, i64 2}
!13 = !{!10, !6, i64 4}
!14 = !{!10, !6, i64 8}
!15 = !{!10, !11, i64 12}
!16 = !{!10, !11, i64 14}
!17 = !{!10, !11, i64 16}
!18 = !{!10, !11, i64 18}
!19 = !{!10, !11, i64 24}
!20 = !{!10, !6, i64 20}
!21 = !{!7, !7, i64 0}
!22 = !{!23, !6, i64 4}
!23 = !{!"", !7, i64 0, !6, i64 4}
!24 = !{!25, !6, i64 4}
!25 = !{!"", !7, i64 0, !6, i64 4, !7, i64 8}
!26 = !{!27, !28, i64 0}
!27 = !{!"", !28, i64 0, !28, i64 8, !28, i64 16, !6, i64 24}
!28 = !{!"long", !7, i64 0}
!29 = !{!27, !28, i64 8}
!30 = !{!27, !28, i64 16}


; Effective O3 passes: CorrelatedValuePropagationPass,DSEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass