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

; 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.DFFFileHeader = type <{ [4 x i8], i64, [4 x i8] }>
%struct.DFFChunkHeader = type <{ [4 x i8], i64 }>
%struct.DFFVersionChunk = type <{ [4 x i8], i64, i32 }>
%struct.DFFSampleRateChunk = type <{ [4 x i8], i64, i32 }>
%struct.DFFChannelsHeader = type <{ [4 x i8], i64, i16 }>
%struct.DFFCompressionHeader = type <{ [4 x i8], i64, [4 x i8] }>

@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [4 x i8], align 1
@debug_logging_mode = external global i32, align 4
@.str.6 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.28 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.36 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.37 = external hidden unnamed_addr constant [60 x i8], align 1
@.str.38 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.39 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.40 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.41 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.42 = 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: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1

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

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

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

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

; Function Attrs: nounwind uwtable
define dso_local i32 @WriteDsdiffHeader(ptr noundef %0, ptr noundef %1, i64 noundef %2, i32 noundef %3) #5 {
  %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.DFFFileHeader, align 2
  %13 = alloca %struct.DFFFileHeader, align 2
  %14 = alloca %struct.DFFChunkHeader, align 2
  %15 = alloca %struct.DFFVersionChunk, align 2
  %16 = alloca %struct.DFFSampleRateChunk, align 2
  %17 = alloca %struct.DFFChannelsHeader, align 2
  %18 = alloca %struct.DFFCompressionHeader, align 2
  %19 = alloca ptr, align 8
  %20 = alloca ptr, align 8
  %21 = alloca i64, align 8
  %22 = alloca i64, align 8
  %23 = alloca i64, align 8
  %24 = alloca i32, align 4
  %25 = alloca i32, align 4
  %26 = alloca i32, align 4
  %27 = alloca i32, align 4
  %28 = alloca ptr, align 8
  %29 = alloca i32, align 4
  %30 = alloca i32, align 4
  %31 = 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) #7
  %32 = load ptr, ptr %7, align 8, !tbaa !5
  %33 = call i32 @WavpackStreamGetChannelMask(ptr noundef %32)
  store i32 %33, ptr %10, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #7
  %34 = load ptr, ptr %7, align 8, !tbaa !5
  %35 = call i32 @WavpackStreamGetNumChannels(ptr noundef %34)
  store i32 %35, ptr %11, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 16, ptr %12) #7
  call void @llvm.lifetime.start.p0(i64 16, ptr %13) #7
  call void @llvm.lifetime.start.p0(i64 12, ptr %14) #7
  call void @llvm.lifetime.start.p0(i64 16, ptr %15) #7
  call void @llvm.lifetime.start.p0(i64 16, ptr %16) #7
  call void @llvm.lifetime.start.p0(i64 14, ptr %17) #7
  call void @llvm.lifetime.start.p0(i64 16, ptr %18) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #7
  store ptr @.str.36, ptr %19, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #7
  %36 = load i32, ptr @debug_logging_mode, align 4, !tbaa !11
  %37 = icmp ne i32 %36, 0
  br i1 %37, label %38, label %41

38:                                               ; preds = %4
  %39 = load i64, ptr %8, align 8, !tbaa !9
  %40 = load i32, ptr %9, align 4, !tbaa !11
  call void (ptr, ...) @error_line(ptr noundef @.str.37, i64 noundef %39, i32 noundef %40)
  br label %41

41:                                               ; preds = %38, %4
  %42 = load ptr, ptr %19, align 8, !tbaa !5
  %43 = call i64 @strlen(ptr noundef %42) #8
  %44 = add i64 %43, 1
  %45 = and i64 %44, -2
  %46 = trunc i64 %45 to i32
  store i32 %46, ptr %24, align 4, !tbaa !11
  %47 = load i32, ptr %11, align 4, !tbaa !11
  %48 = mul nsw i32 %47, 4
  store i32 %48, ptr %25, align 4, !tbaa !11
  %49 = load i32, ptr %25, align 4, !tbaa !11
  %50 = sext i32 %49 to i64
  %51 = call noalias ptr @malloc(i64 noundef %50) #9
  store ptr %51, ptr %20, align 8, !tbaa !5
  %52 = load ptr, ptr %20, align 8, !tbaa !5
  %53 = icmp ne ptr %52, null
  br i1 %53, label %54, label %157

54:                                               ; preds = %41
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #7
  store i32 1, ptr %27, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %28) #7
  %55 = load ptr, ptr %20, align 8, !tbaa !5
  store ptr %55, ptr %28, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %29) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %30) #7
  store i32 0, ptr %30, align 4, !tbaa !11
  store i32 0, ptr %29, align 4, !tbaa !11
  br label %56

56:                                               ; preds = %153, %54
  %57 = load i32, ptr %29, align 4, !tbaa !11
  %58 = load i32, ptr %11, align 4, !tbaa !11
  %59 = icmp slt i32 %57, %58
  br i1 %59, label %60, label %156

60:                                               ; preds = %56
  br label %61

61:                                               ; preds = %72, %60
  %62 = load i32, ptr %27, align 4, !tbaa !11
  %63 = icmp ne i32 %62, 0
  br i1 %63, label %64, label %70

64:                                               ; preds = %61
  %65 = load i32, ptr %27, align 4, !tbaa !11
  %66 = load i32, ptr %10, align 4, !tbaa !11
  %67 = and i32 %65, %66
  %68 = icmp ne i32 %67, 0
  %69 = xor i1 %68, true
  br label %70

70:                                               ; preds = %64, %61
  %71 = phi i1 [ false, %61 ], [ %69, %64 ]
  br i1 %71, label %72, label %75

72:                                               ; preds = %70
  %73 = load i32, ptr %27, align 4, !tbaa !11
  %74 = shl i32 %73, 1
  store i32 %74, ptr %27, align 4, !tbaa !11
  br label %61, !llvm.loop !13

75:                                               ; preds = %70
  %76 = load i32, ptr %27, align 4, !tbaa !11
  %77 = and i32 %76, 1
  %78 = icmp ne i32 %77, 0
  br i1 %78, label %79, label %85

79:                                               ; preds = %75
  %80 = load ptr, ptr %28, align 8, !tbaa !5
  %81 = load i32, ptr %11, align 4, !tbaa !11
  %82 = icmp sle i32 %81, 2
  %83 = zext i1 %82 to i64
  %84 = select i1 %82, ptr @.str.18, ptr @.str.19
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %80, ptr align 1 %84, i64 4, i1 false)
  br label %148

85:                                               ; preds = %75
  %86 = load i32, ptr %27, align 4, !tbaa !11
  %87 = and i32 %86, 2
  %88 = icmp ne i32 %87, 0
  br i1 %88, label %89, label %95

89:                                               ; preds = %85
  %90 = load ptr, ptr %28, align 8, !tbaa !5
  %91 = load i32, ptr %11, align 4, !tbaa !11
  %92 = icmp sle i32 %91, 2
  %93 = zext i1 %92 to i64
  %94 = select i1 %92, ptr @.str.20, ptr @.str.21
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %90, ptr align 1 %94, i64 4, i1 false)
  br label %147

95:                                               ; preds = %85
  %96 = load i32, ptr %27, align 4, !tbaa !11
  %97 = and i32 %96, 4
  %98 = icmp ne i32 %97, 0
  br i1 %98, label %99, label %101

99:                                               ; preds = %95
  %100 = load ptr, ptr %28, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %100, ptr align 1 @.str.24, i64 4, i1 false)
  br label %146

101:                                              ; preds = %95
  %102 = load i32, ptr %27, align 4, !tbaa !11
  %103 = and i32 %102, 8
  %104 = icmp ne i32 %103, 0
  br i1 %104, label %105, label %107

105:                                              ; preds = %101
  %106 = load ptr, ptr %28, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %106, ptr align 1 @.str.25, i64 4, i1 false)
  br label %145

107:                                              ; preds = %101
  %108 = load i32, ptr %27, align 4, !tbaa !11
  %109 = and i32 %108, 16
  %110 = icmp ne i32 %109, 0
  br i1 %110, label %111, label %113

111:                                              ; preds = %107
  %112 = load ptr, ptr %28, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %112, ptr align 1 @.str.22, i64 4, i1 false)
  br label %144

113:                                              ; preds = %107
  %114 = load i32, ptr %27, align 4, !tbaa !11
  %115 = and i32 %114, 32
  %116 = icmp ne i32 %115, 0
  br i1 %116, label %117, label %119

117:                                              ; preds = %113
  %118 = load ptr, ptr %28, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %118, ptr align 1 @.str.23, i64 4, i1 false)
  br label %143

119:                                              ; preds = %113
  %120 = load ptr, ptr %28, align 8, !tbaa !5
  %121 = getelementptr inbounds i8, ptr %120, i64 0
  store i8 67, ptr %121, align 1, !tbaa !15
  %122 = load i32, ptr %30, align 4, !tbaa !11
  %123 = sdiv i32 %122, 100
  %124 = add nsw i32 %123, 48
  %125 = trunc i32 %124 to i8
  %126 = load ptr, ptr %28, align 8, !tbaa !5
  %127 = getelementptr inbounds i8, ptr %126, i64 1
  store i8 %125, ptr %127, align 1, !tbaa !15
  %128 = load i32, ptr %30, align 4, !tbaa !11
  %129 = srem i32 %128, 100
  %130 = sdiv i32 %129, 10
  %131 = add nsw i32 %130, 48
  %132 = trunc i32 %131 to i8
  %133 = load ptr, ptr %28, align 8, !tbaa !5
  %134 = getelementptr inbounds i8, ptr %133, i64 2
  store i8 %132, ptr %134, align 1, !tbaa !15
  %135 = load i32, ptr %30, align 4, !tbaa !11
  %136 = srem i32 %135, 10
  %137 = add nsw i32 %136, 48
  %138 = trunc i32 %137 to i8
  %139 = load ptr, ptr %28, align 8, !tbaa !5
  %140 = getelementptr inbounds i8, ptr %139, i64 3
  store i8 %138, ptr %140, align 1, !tbaa !15
  %141 = load i32, ptr %30, align 4, !tbaa !11
  %142 = add nsw i32 %141, 1
  store i32 %142, ptr %30, align 4, !tbaa !11
  br label %143

143:                                              ; preds = %119, %117
  br label %144

144:                                              ; preds = %143, %111
  br label %145

145:                                              ; preds = %144, %105
  br label %146

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

147:                                              ; preds = %146, %89
  br label %148

148:                                              ; preds = %147, %79
  %149 = load i32, ptr %27, align 4, !tbaa !11
  %150 = shl i32 %149, 1
  store i32 %150, ptr %27, align 4, !tbaa !11
  %151 = load ptr, ptr %28, align 8, !tbaa !5
  %152 = getelementptr inbounds i8, ptr %151, i64 4
  store ptr %152, ptr %28, align 8, !tbaa !5
  br label %153

153:                                              ; preds = %148
  %154 = load i32, ptr %29, align 4, !tbaa !11
  %155 = add nsw i32 %154, 1
  store i32 %155, ptr %29, align 4, !tbaa !11
  br label %56, !llvm.loop !16

156:                                              ; preds = %56
  call void @llvm.lifetime.end.p0(i64 4, ptr %30) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %29) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #7
  br label %158

157:                                              ; preds = %41
  call void (ptr, ...) @error_line(ptr noundef @.str.38)
  store i32 0, ptr %5, align 4
  store i32 1, ptr %31, align 4
  br label %304

158:                                              ; preds = %156
  %159 = load i64, ptr %8, align 8, !tbaa !9
  %160 = load i32, ptr %11, align 4, !tbaa !11
  %161 = sext i32 %160 to i64
  %162 = mul nsw i64 %159, %161
  store i64 %162, ptr %23, align 8, !tbaa !9
  %163 = load i32, ptr %25, align 4, !tbaa !11
  %164 = sext i32 %163 to i64
  %165 = add i64 46, %164
  %166 = add i64 %165, 16
  %167 = load i32, ptr %24, align 4, !tbaa !11
  %168 = sext i32 %167 to i64
  %169 = add i64 %166, %168
  store i64 %169, ptr %22, align 8, !tbaa !9
  %170 = load i64, ptr %22, align 8, !tbaa !9
  %171 = add i64 32, %170
  %172 = add i64 %171, 12
  %173 = load i64, ptr %23, align 8, !tbaa !9
  %174 = add nsw i64 %173, 1
  %175 = and i64 %174, -2
  %176 = add i64 %172, %175
  store i64 %176, ptr %21, align 8, !tbaa !9
  %177 = getelementptr inbounds %struct.DFFFileHeader, ptr %12, i32 0, i32 0
  %178 = getelementptr inbounds [4 x i8], ptr %177, i64 0, i64 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 2 %178, ptr align 1 @.str.39, i64 4, i1 false)
  %179 = load i64, ptr %21, align 8, !tbaa !9
  %180 = sub nsw i64 %179, 12
  %181 = getelementptr inbounds %struct.DFFFileHeader, ptr %12, i32 0, i32 1
  store i64 %180, ptr %181, align 2, !tbaa !17
  %182 = getelementptr inbounds %struct.DFFFileHeader, ptr %12, i32 0, i32 2
  %183 = getelementptr inbounds [4 x i8], ptr %182, i64 0, i64 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 2 %183, ptr align 1 @.str, i64 4, i1 false)
  %184 = getelementptr inbounds %struct.DFFFileHeader, ptr %13, i32 0, i32 0
  %185 = getelementptr inbounds [4 x i8], ptr %184, i64 0, i64 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 2 %185, ptr align 1 @.str.11, i64 4, i1 false)
  %186 = load i64, ptr %22, align 8, !tbaa !9
  %187 = sub nsw i64 %186, 12
  %188 = getelementptr inbounds %struct.DFFFileHeader, ptr %13, i32 0, i32 1
  store i64 %187, ptr %188, align 2, !tbaa !17
  %189 = getelementptr inbounds %struct.DFFFileHeader, ptr %13, i32 0, i32 2
  %190 = getelementptr inbounds [4 x i8], ptr %189, i64 0, i64 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 2 %190, ptr align 1 @.str.13, i64 4, i1 false)
  %191 = getelementptr inbounds %struct.DFFVersionChunk, ptr %15, i32 0, i32 0
  %192 = getelementptr inbounds [4 x i8], ptr %191, i64 0, i64 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 2 %192, ptr align 1 @.str.8, i64 4, i1 false)
  %193 = getelementptr inbounds %struct.DFFVersionChunk, ptr %15, i32 0, i32 1
  store i64 4, ptr %193, align 2, !tbaa !19
  %194 = getelementptr inbounds %struct.DFFVersionChunk, ptr %15, i32 0, i32 2
  store i32 17104896, ptr %194, align 2, !tbaa !21
  %195 = getelementptr inbounds %struct.DFFSampleRateChunk, ptr %16, i32 0, i32 0
  %196 = getelementptr inbounds [4 x i8], ptr %195, i64 0, i64 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 2 %196, ptr align 1 @.str.14, i64 4, i1 false)
  %197 = getelementptr inbounds %struct.DFFSampleRateChunk, ptr %16, i32 0, i32 1
  store i64 4, ptr %197, align 2, !tbaa !19
  %198 = load ptr, ptr %7, align 8, !tbaa !5
  %199 = call i32 @WavpackStreamGetSampleRate(ptr noundef %198)
  %200 = mul i32 %199, 8
  %201 = getelementptr inbounds %struct.DFFSampleRateChunk, ptr %16, i32 0, i32 2
  store i32 %200, ptr %201, align 2, !tbaa !21
  %202 = getelementptr inbounds %struct.DFFChannelsHeader, ptr %17, i32 0, i32 0
  %203 = getelementptr inbounds [4 x i8], ptr %202, i64 0, i64 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 2 %203, ptr align 1 @.str.16, i64 4, i1 false)
  %204 = load i32, ptr %25, align 4, !tbaa !11
  %205 = sext i32 %204 to i64
  %206 = add i64 14, %205
  %207 = sub i64 %206, 12
  %208 = getelementptr inbounds %struct.DFFChannelsHeader, ptr %17, i32 0, i32 1
  store i64 %207, ptr %208, align 2, !tbaa !22
  %209 = load i32, ptr %11, align 4, !tbaa !11
  %210 = trunc i32 %209 to i16
  %211 = getelementptr inbounds %struct.DFFChannelsHeader, ptr %17, i32 0, i32 2
  store i16 %210, ptr %211, align 2, !tbaa !25
  %212 = getelementptr inbounds %struct.DFFCompressionHeader, ptr %18, i32 0, i32 0
  %213 = getelementptr inbounds [4 x i8], ptr %212, i64 0, i64 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 2 %213, ptr align 1 @.str.28, i64 4, i1 false)
  %214 = load i32, ptr %24, align 4, !tbaa !11
  %215 = sext i32 %214 to i64
  %216 = add i64 16, %215
  %217 = sub i64 %216, 12
  %218 = getelementptr inbounds %struct.DFFCompressionHeader, ptr %18, i32 0, i32 1
  store i64 %217, ptr %218, align 2, !tbaa !17
  %219 = getelementptr inbounds %struct.DFFCompressionHeader, ptr %18, i32 0, i32 2
  %220 = getelementptr inbounds [4 x i8], ptr %219, i64 0, i64 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 2 %220, ptr align 1 @.str, i64 4, i1 false)
  %221 = getelementptr inbounds %struct.DFFChunkHeader, ptr %14, i32 0, i32 0
  %222 = getelementptr inbounds [4 x i8], ptr %221, i64 0, i64 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 2 %222, ptr align 1 @.str, i64 4, i1 false)
  %223 = load i64, ptr %23, align 8, !tbaa !9
  %224 = getelementptr inbounds %struct.DFFChunkHeader, ptr %14, i32 0, i32 1
  store i64 %223, ptr %224, align 2, !tbaa !26
  call void @WavpackStreamNativeToBigEndian(ptr noundef %12, ptr noundef @.str.3)
  call void @WavpackStreamNativeToBigEndian(ptr noundef %15, ptr noundef @.str.40)
  call void @WavpackStreamNativeToBigEndian(ptr noundef %13, ptr noundef @.str.3)
  call void @WavpackStreamNativeToBigEndian(ptr noundef %16, ptr noundef @.str.40)
  call void @WavpackStreamNativeToBigEndian(ptr noundef %17, ptr noundef @.str.41)
  call void @WavpackStreamNativeToBigEndian(ptr noundef %18, ptr noundef @.str.3)
  call void @WavpackStreamNativeToBigEndian(ptr noundef %14, ptr noundef @.str.6)
  %225 = load ptr, ptr %6, align 8, !tbaa !5
  %226 = call i32 @DoWriteFile(ptr noundef %225, ptr noundef %12, i32 noundef 16, ptr noundef %26)
  %227 = icmp ne i32 %226, 0
  br i1 %227, label %228, label %300

228:                                              ; preds = %158
  %229 = load i32, ptr %26, align 4, !tbaa !11
  %230 = zext i32 %229 to i64
  %231 = icmp ne i64 %230, 16
  br i1 %231, label %300, label %232

232:                                              ; preds = %228
  %233 = load ptr, ptr %6, align 8, !tbaa !5
  %234 = call i32 @DoWriteFile(ptr noundef %233, ptr noundef %15, i32 noundef 16, ptr noundef %26)
  %235 = icmp ne i32 %234, 0
  br i1 %235, label %236, label %300

236:                                              ; preds = %232
  %237 = load i32, ptr %26, align 4, !tbaa !11
  %238 = zext i32 %237 to i64
  %239 = icmp ne i64 %238, 16
  br i1 %239, label %300, label %240

240:                                              ; preds = %236
  %241 = load ptr, ptr %6, align 8, !tbaa !5
  %242 = call i32 @DoWriteFile(ptr noundef %241, ptr noundef %13, i32 noundef 16, ptr noundef %26)
  %243 = icmp ne i32 %242, 0
  br i1 %243, label %244, label %300

244:                                              ; preds = %240
  %245 = load i32, ptr %26, align 4, !tbaa !11
  %246 = zext i32 %245 to i64
  %247 = icmp ne i64 %246, 16
  br i1 %247, label %300, label %248

248:                                              ; preds = %244
  %249 = load ptr, ptr %6, align 8, !tbaa !5
  %250 = call i32 @DoWriteFile(ptr noundef %249, ptr noundef %16, i32 noundef 16, ptr noundef %26)
  %251 = icmp ne i32 %250, 0
  br i1 %251, label %252, label %300

252:                                              ; preds = %248
  %253 = load i32, ptr %26, align 4, !tbaa !11
  %254 = zext i32 %253 to i64
  %255 = icmp ne i64 %254, 16
  br i1 %255, label %300, label %256

256:                                              ; preds = %252
  %257 = load ptr, ptr %6, align 8, !tbaa !5
  %258 = call i32 @DoWriteFile(ptr noundef %257, ptr noundef %17, i32 noundef 14, ptr noundef %26)
  %259 = icmp ne i32 %258, 0
  br i1 %259, label %260, label %300

260:                                              ; preds = %256
  %261 = load i32, ptr %26, align 4, !tbaa !11
  %262 = zext i32 %261 to i64
  %263 = icmp ne i64 %262, 14
  br i1 %263, label %300, label %264

264:                                              ; preds = %260
  %265 = load ptr, ptr %6, align 8, !tbaa !5
  %266 = load ptr, ptr %20, align 8, !tbaa !5
  %267 = load i32, ptr %25, align 4, !tbaa !11
  %268 = call i32 @DoWriteFile(ptr noundef %265, ptr noundef %266, i32 noundef %267, ptr noundef %26)
  %269 = icmp ne i32 %268, 0
  br i1 %269, label %270, label %300

270:                                              ; preds = %264
  %271 = load i32, ptr %26, align 4, !tbaa !11
  %272 = load i32, ptr %25, align 4, !tbaa !11
  %273 = icmp ne i32 %271, %272
  br i1 %273, label %300, label %274

274:                                              ; preds = %270
  %275 = load ptr, ptr %6, align 8, !tbaa !5
  %276 = call i32 @DoWriteFile(ptr noundef %275, ptr noundef %18, i32 noundef 16, ptr noundef %26)
  %277 = icmp ne i32 %276, 0
  br i1 %277, label %278, label %300

278:                                              ; preds = %274
  %279 = load i32, ptr %26, align 4, !tbaa !11
  %280 = zext i32 %279 to i64
  %281 = icmp ne i64 %280, 16
  br i1 %281, label %300, label %282

282:                                              ; preds = %278
  %283 = load ptr, ptr %6, align 8, !tbaa !5
  %284 = load ptr, ptr %19, align 8, !tbaa !5
  %285 = load i32, ptr %24, align 4, !tbaa !11
  %286 = call i32 @DoWriteFile(ptr noundef %283, ptr noundef %284, i32 noundef %285, ptr noundef %26)
  %287 = icmp ne i32 %286, 0
  br i1 %287, label %288, label %300

288:                                              ; preds = %282
  %289 = load i32, ptr %26, align 4, !tbaa !11
  %290 = load i32, ptr %24, align 4, !tbaa !11
  %291 = icmp ne i32 %289, %290
  br i1 %291, label %300, label %292

292:                                              ; preds = %288
  %293 = load ptr, ptr %6, align 8, !tbaa !5
  %294 = call i32 @DoWriteFile(ptr noundef %293, ptr noundef %14, i32 noundef 12, ptr noundef %26)
  %295 = icmp ne i32 %294, 0
  br i1 %295, label %296, label %300

296:                                              ; preds = %292
  %297 = load i32, ptr %26, align 4, !tbaa !11
  %298 = zext i32 %297 to i64
  %299 = icmp ne i64 %298, 12
  br i1 %299, label %300, label %302

300:                                              ; preds = %296, %292, %288, %282, %278, %274, %270, %264, %260, %256, %252, %248, %244, %240, %236, %232, %228, %158
  call void (ptr, ...) @error_line(ptr noundef @.str.42)
  %301 = load ptr, ptr %20, align 8, !tbaa !5
  call void @free(ptr noundef %301) #7
  store i32 0, ptr %5, align 4
  store i32 1, ptr %31, align 4
  br label %304

302:                                              ; preds = %296
  %303 = load ptr, ptr %20, align 8, !tbaa !5
  call void @free(ptr noundef %303) #7
  store i32 1, ptr %5, align 4
  store i32 1, ptr %31, align 4
  br label %304

304:                                              ; preds = %302, %300, %157
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %18) #7
  call void @llvm.lifetime.end.p0(i64 14, ptr %17) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %16) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %15) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr %14) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %13) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #7
  %305 = load i32, ptr %5, align 4
  ret i32 %305
}

declare i32 @WavpackStreamGetChannelMask(ptr noundef) #2

declare i32 @WavpackStreamGetNumChannels(ptr noundef) #2

; Function Attrs: nounwind willreturn memory(read)
declare i64 @strlen(ptr noundef) #6

declare i32 @WavpackStreamGetSampleRate(ptr noundef) #2

declare void @WavpackStreamNativeToBigEndian(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: readwrite) }
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 allocsize(0) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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 #5 = { 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 #6 = { nounwind willreturn memory(read) "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 #7 = { nounwind }
attributes #8 = { nounwind willreturn memory(read) }
attributes #9 = { nounwind allocsize(0) }

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

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


; 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.DFFFileHeader = type <{ [4 x i8], i64, [4 x i8] }>
%struct.DFFChunkHeader = type <{ [4 x i8], i64 }>
%struct.DFFVersionChunk = type <{ [4 x i8], i64, i32 }>
%struct.DFFSampleRateChunk = type <{ [4 x i8], i64, i32 }>
%struct.DFFChannelsHeader = type <{ [4 x i8], i64, i16 }>
%struct.DFFCompressionHeader = type <{ [4 x i8], i64, [4 x i8] }>

@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [4 x i8], align 1
@debug_logging_mode = external local_unnamed_addr global i32, align 4
@.str.6 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.28 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.36 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.37 = external hidden unnamed_addr constant [60 x i8], align 1
@.str.38 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.39 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.40 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.41 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.42 = 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

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

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

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

; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #3

; Function Attrs: nounwind uwtable
define dso_local range(i32 0, 2) i32 @WriteDsdiffHeader(ptr noundef %0, ptr noundef %1, i64 noundef %2, i32 noundef %3) local_unnamed_addr #4 {
  %5 = alloca %struct.DFFFileHeader, align 4
  %6 = alloca %struct.DFFFileHeader, align 4
  %7 = alloca %struct.DFFChunkHeader, align 4
  %8 = alloca %struct.DFFVersionChunk, align 4
  %9 = alloca %struct.DFFSampleRateChunk, align 4
  %10 = alloca %struct.DFFChannelsHeader, align 4
  %11 = alloca %struct.DFFCompressionHeader, align 4
  %12 = alloca i32, align 4
  %13 = tail call i32 @WavpackStreamGetChannelMask(ptr noundef %1) #6
  %14 = tail call i32 @WavpackStreamGetNumChannels(ptr noundef %1) #6
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %5) #6
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %6) #6
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %7) #6
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %8) #6
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %9) #6
  call void @llvm.lifetime.start.p0(i64 14, ptr nonnull %10) #6
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %11) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %12) #6
  %15 = load i32, ptr @debug_logging_mode, align 4, !tbaa !5
  %.not = icmp eq i32 %15, 0
  br i1 %.not, label %17, label %16

16:                                               ; preds = %4
  tail call void (ptr, ...) @error_line(ptr noundef nonnull @.str.37, i64 noundef %2, i32 noundef %3) #6
  br label %17

17:                                               ; preds = %16, %4
  %18 = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) @.str.36) #7
  %19 = trunc i64 %18 to i32
  %20 = add i32 %19, 1
  %21 = and i32 %20, -2
  %22 = shl nsw i32 %14, 2
  %23 = sext i32 %22 to i64
  %24 = tail call noalias ptr @malloc(i64 noundef %23) #8
  %.not97 = icmp eq ptr %24, null
  br i1 %.not97, label %110, label %.preheader113

.preheader113:                                    ; preds = %17
  %25 = icmp sgt i32 %14, 0
  br i1 %25, label %.preheader.lr.ph, label %._crit_edge

.preheader.lr.ph:                                 ; preds = %.preheader113
  %26 = icmp ult i32 %14, 3
  %.str.18.val = load i32, ptr @.str.18, align 1
  %.str.19.val = load i32, ptr @.str.19, align 1
  %27 = select i1 %26, i32 %.str.18.val, i32 %.str.19.val
  %.str.20.val = load i32, ptr @.str.20, align 1
  %.str.21.val = load i32, ptr @.str.21, align 1
  %28 = select i1 %26, i32 %.str.20.val, i32 %.str.21.val
  %29 = load i32, ptr @.str.24, align 1
  %30 = load i32, ptr @.str.25, align 1
  %31 = load i32, ptr @.str.22, align 1
  %32 = load i32, ptr @.str.23, align 1
  br label %.preheader

.preheader:                                       ; preds = %.preheader.lr.ph, %67
  %.0117 = phi i32 [ 0, %.preheader.lr.ph ], [ %.1, %67 ]
  %.090116 = phi i32 [ 0, %.preheader.lr.ph ], [ %69, %67 ]
  %.091115 = phi ptr [ %24, %.preheader.lr.ph ], [ %68, %67 ]
  %.092114 = phi i32 [ 1, %.preheader.lr.ph ], [ %35, %67 ]
  br label %33

33:                                               ; preds = %33, %.preheader
  %.193 = phi i32 [ %35, %33 ], [ %.092114, %.preheader ]
  %.not102 = icmp ne i32 %.193, 0
  %34 = and i32 %.193, %13
  %.not103 = icmp eq i32 %34, 0
  %or.cond110 = select i1 %.not102, i1 %.not103, i1 false
  %35 = shl i32 %.193, 1
  br i1 %or.cond110, label %33, label %.critedge, !llvm.loop !9

.critedge:                                        ; preds = %33
  %36 = and i32 %.193, 1
  %.not104 = icmp eq i32 %36, 0
  br i1 %.not104, label %38, label %37

37:                                               ; preds = %.critedge
  store i32 %27, ptr %.091115, align 1
  br label %67

38:                                               ; preds = %.critedge
  %39 = and i32 %.193, 2
  %.not105 = icmp eq i32 %39, 0
  br i1 %.not105, label %41, label %40

40:                                               ; preds = %38
  store i32 %28, ptr %.091115, align 1
  br label %67

41:                                               ; preds = %38
  %42 = and i32 %.193, 4
  %.not106 = icmp eq i32 %42, 0
  br i1 %.not106, label %44, label %43

43:                                               ; preds = %41
  store i32 %29, ptr %.091115, align 1
  br label %67

44:                                               ; preds = %41
  %45 = and i32 %.193, 8
  %.not107 = icmp eq i32 %45, 0
  br i1 %.not107, label %47, label %46

46:                                               ; preds = %44
  store i32 %30, ptr %.091115, align 1
  br label %67

47:                                               ; preds = %44
  %48 = and i32 %.193, 16
  %.not108 = icmp eq i32 %48, 0
  br i1 %.not108, label %50, label %49

49:                                               ; preds = %47
  store i32 %31, ptr %.091115, align 1
  br label %67

50:                                               ; preds = %47
  %51 = and i32 %.193, 32
  %.not109 = icmp eq i32 %51, 0
  br i1 %.not109, label %53, label %52

52:                                               ; preds = %50
  store i32 %32, ptr %.091115, align 1
  br label %67

53:                                               ; preds = %50
  store i8 67, ptr %.091115, align 1, !tbaa !11
  %54 = sdiv i32 %.0117, 100
  %55 = trunc i32 %54 to i8
  %56 = add i8 %55, 48
  %57 = getelementptr inbounds i8, ptr %.091115, i64 1
  store i8 %56, ptr %57, align 1, !tbaa !11
  %58 = srem i32 %.0117, 100
  %.lhs.trunc = trunc nsw i32 %58 to i8
  %59 = sdiv i8 %.lhs.trunc, 10
  %60 = add nsw i8 %59, 48
  %61 = getelementptr inbounds i8, ptr %.091115, i64 2
  store i8 %60, ptr %61, align 1, !tbaa !11
  %62 = srem i32 %.0117, 10
  %63 = trunc nsw i32 %62 to i8
  %64 = add nsw i8 %63, 48
  %65 = getelementptr inbounds i8, ptr %.091115, i64 3
  store i8 %64, ptr %65, align 1, !tbaa !11
  %66 = add nsw i32 %.0117, 1
  br label %67

67:                                               ; preds = %40, %46, %52, %53, %49, %43, %37
  %.1 = phi i32 [ %.0117, %37 ], [ %.0117, %40 ], [ %.0117, %43 ], [ %.0117, %46 ], [ %.0117, %49 ], [ %.0117, %52 ], [ %66, %53 ]
  %68 = getelementptr inbounds i8, ptr %.091115, i64 4
  %69 = add nuw nsw i32 %.090116, 1
  %exitcond.not = icmp eq i32 %69, %14
  br i1 %exitcond.not, label %._crit_edge, label %.preheader, !llvm.loop !12

._crit_edge:                                      ; preds = %67, %.preheader113
  %70 = sext i32 %14 to i64
  %71 = mul nsw i64 %70, %2
  %72 = add nsw i64 %23, 62
  %73 = sext i32 %21 to i64
  %74 = add nsw i64 %72, %73
  %75 = add nsw i64 %71, 1
  %76 = and i64 %75, -2
  %77 = load i32, ptr @.str.39, align 1
  store i32 %77, ptr %5, align 4
  %78 = add i64 %76, 32
  %79 = add i64 %78, %74
  %80 = getelementptr inbounds i8, ptr %5, i64 4
  store i64 %79, ptr %80, align 4, !tbaa !13
  %81 = getelementptr inbounds i8, ptr %5, i64 12
  %82 = load i32, ptr @.str, align 1
  store i32 %82, ptr %81, align 4
  %83 = load i32, ptr @.str.11, align 1
  store i32 %83, ptr %6, align 4
  %84 = add nsw i64 %74, -12
  %85 = getelementptr inbounds i8, ptr %6, i64 4
  store i64 %84, ptr %85, align 4, !tbaa !13
  %86 = getelementptr inbounds i8, ptr %6, i64 12
  %87 = load i32, ptr @.str.13, align 1
  store i32 %87, ptr %86, align 4
  %88 = load i32, ptr @.str.8, align 1
  store i32 %88, ptr %8, align 4
  %89 = getelementptr inbounds i8, ptr %8, i64 4
  store i64 4, ptr %89, align 4, !tbaa !16
  %90 = getelementptr inbounds i8, ptr %8, i64 12
  store i32 17104896, ptr %90, align 4, !tbaa !18
  %91 = load i32, ptr @.str.14, align 1
  store i32 %91, ptr %9, align 4
  %92 = getelementptr inbounds i8, ptr %9, i64 4
  store i64 4, ptr %92, align 4, !tbaa !16
  %93 = tail call i32 @WavpackStreamGetSampleRate(ptr noundef %1) #6
  %94 = shl i32 %93, 3
  %95 = getelementptr inbounds i8, ptr %9, i64 12
  store i32 %94, ptr %95, align 4, !tbaa !18
  %96 = load i32, ptr @.str.16, align 1
  store i32 %96, ptr %10, align 4
  %97 = or disjoint i64 %23, 2
  %98 = getelementptr inbounds i8, ptr %10, i64 4
  store i64 %97, ptr %98, align 4, !tbaa !19
  %99 = trunc i32 %14 to i16
  %100 = getelementptr inbounds i8, ptr %10, i64 12
  store i16 %99, ptr %100, align 4, !tbaa !22
  %101 = load i32, ptr @.str.28, align 1
  store i32 %101, ptr %11, align 4
  %102 = add nsw i64 %73, 4
  %103 = getelementptr inbounds i8, ptr %11, i64 4
  store i64 %102, ptr %103, align 4, !tbaa !13
  %104 = getelementptr inbounds i8, ptr %11, i64 12
  store i32 %82, ptr %104, align 4
  store i32 %82, ptr %7, align 4
  %105 = getelementptr inbounds i8, ptr %7, i64 4
  store i64 %71, ptr %105, align 4, !tbaa !23
  call void @WavpackStreamNativeToBigEndian(ptr noundef nonnull %5, ptr noundef nonnull @.str.3) #6
  call void @WavpackStreamNativeToBigEndian(ptr noundef nonnull %8, ptr noundef nonnull @.str.40) #6
  call void @WavpackStreamNativeToBigEndian(ptr noundef nonnull %6, ptr noundef nonnull @.str.3) #6
  call void @WavpackStreamNativeToBigEndian(ptr noundef nonnull %9, ptr noundef nonnull @.str.40) #6
  call void @WavpackStreamNativeToBigEndian(ptr noundef nonnull %10, ptr noundef nonnull @.str.41) #6
  call void @WavpackStreamNativeToBigEndian(ptr noundef nonnull %11, ptr noundef nonnull @.str.3) #6
  call void @WavpackStreamNativeToBigEndian(ptr noundef nonnull %7, ptr noundef nonnull @.str.6) #6
  %106 = call i32 @DoWriteFile(ptr noundef %0, ptr noundef nonnull %5, i32 noundef 16, ptr noundef nonnull %12) #6
  %107 = icmp eq i32 %106, 0
  %108 = load i32, ptr %12, align 4
  %109 = icmp ne i32 %108, 16
  %or.cond = select i1 %107, i1 true, i1 %109
  br i1 %or.cond, label %147, label %111

110:                                              ; preds = %17
  tail call void (ptr, ...) @error_line(ptr noundef nonnull @.str.38) #6
  br label %149

111:                                              ; preds = %._crit_edge
  %112 = call i32 @DoWriteFile(ptr noundef %0, ptr noundef nonnull %8, i32 noundef 16, ptr noundef nonnull %12) #6
  %113 = icmp eq i32 %112, 0
  %114 = load i32, ptr %12, align 4
  %115 = icmp ne i32 %114, 16
  %or.cond5 = select i1 %113, i1 true, i1 %115
  br i1 %or.cond5, label %147, label %116

116:                                              ; preds = %111
  %117 = call i32 @DoWriteFile(ptr noundef %0, ptr noundef nonnull %6, i32 noundef 16, ptr noundef nonnull %12) #6
  %118 = icmp eq i32 %117, 0
  %119 = load i32, ptr %12, align 4
  %120 = icmp ne i32 %119, 16
  %or.cond8 = select i1 %118, i1 true, i1 %120
  br i1 %or.cond8, label %147, label %121

121:                                              ; preds = %116
  %122 = call i32 @DoWriteFile(ptr noundef %0, ptr noundef nonnull %9, i32 noundef 16, ptr noundef nonnull %12) #6
  %123 = icmp eq i32 %122, 0
  %124 = load i32, ptr %12, align 4
  %125 = icmp ne i32 %124, 16
  %or.cond11 = select i1 %123, i1 true, i1 %125
  br i1 %or.cond11, label %147, label %126

126:                                              ; preds = %121
  %127 = call i32 @DoWriteFile(ptr noundef %0, ptr noundef nonnull %10, i32 noundef 14, ptr noundef nonnull %12) #6
  %128 = icmp eq i32 %127, 0
  %129 = load i32, ptr %12, align 4
  %130 = icmp ne i32 %129, 14
  %or.cond14 = select i1 %128, i1 true, i1 %130
  br i1 %or.cond14, label %147, label %131

131:                                              ; preds = %126
  %132 = call i32 @DoWriteFile(ptr noundef %0, ptr noundef nonnull %24, i32 noundef %22, ptr noundef nonnull %12) #6
  %.not98 = icmp ne i32 %132, 0
  %133 = load i32, ptr %12, align 4
  %.not99 = icmp eq i32 %133, %22
  %or.cond111 = select i1 %.not98, i1 %.not99, i1 false
  br i1 %or.cond111, label %134, label %147

134:                                              ; preds = %131
  %135 = call i32 @DoWriteFile(ptr noundef %0, ptr noundef nonnull %11, i32 noundef 16, ptr noundef nonnull %12) #6
  %136 = icmp eq i32 %135, 0
  %137 = load i32, ptr %12, align 4
  %138 = icmp ne i32 %137, 16
  %or.cond17 = select i1 %136, i1 true, i1 %138
  br i1 %or.cond17, label %147, label %139

139:                                              ; preds = %134
  %140 = call i32 @DoWriteFile(ptr noundef %0, ptr noundef nonnull @.str.36, i32 noundef %21, ptr noundef nonnull %12) #6
  %.not100 = icmp ne i32 %140, 0
  %141 = load i32, ptr %12, align 4
  %.not101 = icmp eq i32 %141, %21
  %or.cond112 = select i1 %.not100, i1 %.not101, i1 false
  br i1 %or.cond112, label %142, label %147

142:                                              ; preds = %139
  %143 = call i32 @DoWriteFile(ptr noundef %0, ptr noundef nonnull %7, i32 noundef 12, ptr noundef nonnull %12) #6
  %144 = icmp eq i32 %143, 0
  %145 = load i32, ptr %12, align 4
  %146 = icmp ne i32 %145, 12
  %or.cond20 = select i1 %144, i1 true, i1 %146
  br i1 %or.cond20, label %147, label %148

147:                                              ; preds = %142, %139, %134, %131, %126, %121, %116, %111, %._crit_edge
  call void (ptr, ...) @error_line(ptr noundef nonnull @.str.42) #6
  call void @free(ptr noundef %24) #6
  br label %149

148:                                              ; preds = %142
  call void @free(ptr noundef %24) #6
  br label %149

149:                                              ; preds = %148, %147, %110
  %.094 = phi i32 [ 0, %147 ], [ 1, %148 ], [ 0, %110 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %12) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %11) #6
  call void @llvm.lifetime.end.p0(i64 14, ptr nonnull %10) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %9) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %8) #6
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %7) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #6
  ret i32 %.094
}

declare i32 @WavpackStreamGetChannelMask(ptr noundef) local_unnamed_addr #1

declare i32 @WavpackStreamGetNumChannels(ptr noundef) local_unnamed_addr #1

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #5

declare i32 @WavpackStreamGetSampleRate(ptr noundef) local_unnamed_addr #1

declare void @WavpackStreamNativeToBigEndian(ptr noundef, ptr noundef) local_unnamed_addr #1

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "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 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { 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 #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 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nounwind }
attributes #7 = { nounwind willreturn memory(read) }
attributes #8 = { nounwind allocsize(0) }

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

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


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass