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

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%struct.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 }

@.str.6 = external hidden unnamed_addr constant [37 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: nounwind
declare ptr @strcpy(ptr noundef, ptr noundef) #1

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

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

; Function Attrs: nounwind uwtable
define dso_local i32 @unpack_init(ptr noundef %0) #3 {
  %2 = alloca i32, align 4
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca %struct.WavpackMetadata, align 8
  %8 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #4
  %9 = load ptr, ptr %3, align 8, !tbaa !5
  %10 = getelementptr inbounds %struct.WavpackContext, ptr %9, i32 0, i32 36
  %11 = load ptr, ptr %10, align 8, !tbaa !9
  %12 = load ptr, ptr %3, align 8, !tbaa !5
  %13 = getelementptr inbounds %struct.WavpackContext, ptr %12, i32 0, i32 33
  %14 = load i32, ptr %13, align 4, !tbaa !15
  %15 = sext i32 %14 to i64
  %16 = getelementptr inbounds ptr, ptr %11, i64 %15
  %17 = load ptr, ptr %16, align 8, !tbaa !5
  store ptr %17, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #4
  call void @llvm.lifetime.start.p0(i64 24, ptr %7) #4
  %18 = load ptr, ptr %4, align 8, !tbaa !5
  %19 = getelementptr inbounds %struct.WavpackStream, ptr %18, i32 0, i32 10
  store i32 0, ptr %19, align 4, !tbaa !16
  %20 = load ptr, ptr %4, align 8, !tbaa !5
  %21 = getelementptr inbounds %struct.WavpackStream, ptr %20, i32 0, i32 12
  store i8 0, ptr %21, align 4, !tbaa !26
  %22 = load ptr, ptr %4, align 8, !tbaa !5
  %23 = getelementptr inbounds %struct.WavpackStream, ptr %22, i32 0, i32 24
  store i32 -1, ptr %23, align 8, !tbaa !27
  %24 = load ptr, ptr %4, align 8, !tbaa !5
  %25 = getelementptr inbounds %struct.WavpackStream, ptr %24, i32 0, i32 23
  store i32 -1, ptr %25, align 4, !tbaa !28
  %26 = load ptr, ptr %4, align 8, !tbaa !5
  %27 = getelementptr inbounds %struct.WavpackStream, ptr %26, i32 0, i32 18
  store i8 0, ptr %27, align 2, !tbaa !29
  %28 = load ptr, ptr %4, align 8, !tbaa !5
  %29 = getelementptr inbounds %struct.WavpackStream, ptr %28, i32 0, i32 17
  store i8 0, ptr %29, align 1, !tbaa !30
  %30 = load ptr, ptr %4, align 8, !tbaa !5
  %31 = getelementptr inbounds %struct.WavpackStream, ptr %30, i32 0, i32 43
  %32 = getelementptr inbounds %struct.anon.0, ptr %31, i32 0, i32 6
  store i8 0, ptr %32, align 1, !tbaa !31
  %33 = load ptr, ptr %4, align 8, !tbaa !5
  %34 = getelementptr inbounds %struct.WavpackStream, ptr %33, i32 0, i32 27
  call void @llvm.memset.p0.i64(ptr align 8 %34, i8 0, i64 48, i1 false)
  %35 = load ptr, ptr %4, align 8, !tbaa !5
  %36 = getelementptr inbounds %struct.WavpackStream, ptr %35, i32 0, i32 28
  call void @llvm.memset.p0.i64(ptr align 8 %36, i8 0, i64 48, i1 false)
  %37 = load ptr, ptr %4, align 8, !tbaa !5
  %38 = getelementptr inbounds %struct.WavpackStream, ptr %37, i32 0, i32 29
  call void @llvm.memset.p0.i64(ptr align 8 %38, i8 0, i64 48, i1 false)
  %39 = load ptr, ptr %4, align 8, !tbaa !5
  %40 = getelementptr inbounds %struct.WavpackStream, ptr %39, i32 0, i32 40
  call void @llvm.memset.p0.i64(ptr align 8 %40, i8 0, i64 1536, i1 false)
  %41 = load ptr, ptr %4, align 8, !tbaa !5
  %42 = getelementptr inbounds %struct.WavpackStream, ptr %41, i32 0, i32 39
  call void @llvm.memset.p0.i64(ptr align 8 %42, i8 0, i64 72, i1 false)
  %43 = load ptr, ptr %4, align 8, !tbaa !5
  %44 = getelementptr inbounds %struct.WavpackStream, ptr %43, i32 0, i32 1
  call void @llvm.memset.p0.i64(ptr align 4 %44, i8 0, i64 76, i1 false)
  %45 = load ptr, ptr %4, align 8, !tbaa !5
  %46 = getelementptr inbounds %struct.WavpackStream, ptr %45, i32 0, i32 0
  %47 = getelementptr inbounds %struct.WavpackHeader, ptr %46, i32 0, i32 3
  %48 = load i32, ptr %47, align 8, !tbaa !32
  %49 = and i32 %48, 4
  %50 = icmp ne i32 %49, 0
  br i1 %50, label %78, label %51

51:                                               ; preds = %1
  %52 = load ptr, ptr %3, align 8, !tbaa !5
  %53 = getelementptr inbounds %struct.WavpackContext, ptr %52, i32 0, i32 0
  %54 = getelementptr inbounds %struct.WavpackStreamConfig, ptr %53, i32 0, i32 7
  %55 = load i32, ptr %54, align 4, !tbaa !33
  %56 = icmp ne i32 %55, 0
  br i1 %56, label %57, label %78

57:                                               ; preds = %51
  %58 = load ptr, ptr %4, align 8, !tbaa !5
  %59 = getelementptr inbounds %struct.WavpackStream, ptr %58, i32 0, i32 0
  %60 = getelementptr inbounds %struct.WavpackHeader, ptr %59, i32 0, i32 2
  %61 = load i16, ptr %60, align 2, !tbaa !34
  %62 = zext i16 %61 to i32
  %63 = icmp ne i32 %62, 0
  br i1 %63, label %64, label %78

64:                                               ; preds = %57
  %65 = load ptr, ptr %3, align 8, !tbaa !5
  %66 = getelementptr inbounds %struct.WavpackContext, ptr %65, i32 0, i32 23
  %67 = load i32, ptr %66, align 4, !tbaa !35
  %68 = icmp eq i32 %67, 1
  br i1 %68, label %75, label %69

69:                                               ; preds = %64
  %70 = load ptr, ptr %3, align 8, !tbaa !5
  %71 = getelementptr inbounds %struct.WavpackContext, ptr %70, i32 0, i32 0
  %72 = getelementptr inbounds %struct.WavpackStreamConfig, ptr %71, i32 0, i32 7
  %73 = load i32, ptr %72, align 4, !tbaa !33
  %74 = icmp eq i32 %73, 1
  br i1 %74, label %75, label %78

75:                                               ; preds = %69, %64
  %76 = load ptr, ptr %4, align 8, !tbaa !5
  %77 = getelementptr inbounds %struct.WavpackStream, ptr %76, i32 0, i32 12
  store i8 1, ptr %77, align 4, !tbaa !26
  store i32 0, ptr %2, align 4
  store i32 1, ptr %8, align 4
  br label %244

78:                                               ; preds = %69, %57, %51, %1
  %79 = load ptr, ptr %4, align 8, !tbaa !5
  %80 = getelementptr inbounds %struct.WavpackStream, ptr %79, i32 0, i32 0
  %81 = getelementptr inbounds %struct.WavpackHeader, ptr %80, i32 0, i32 3
  %82 = load i32, ptr %81, align 8, !tbaa !32
  %83 = and i32 %82, 0
  %84 = icmp ne i32 %83, 0
  br i1 %84, label %92, label %85

85:                                               ; preds = %78
  %86 = load ptr, ptr %4, align 8, !tbaa !5
  %87 = getelementptr inbounds %struct.WavpackStream, ptr %86, i32 0, i32 0
  %88 = getelementptr inbounds %struct.WavpackHeader, ptr %87, i32 0, i32 3
  %89 = load i32, ptr %88, align 8, !tbaa !32
  %90 = and i32 %89, 1073741828
  %91 = icmp eq i32 %90, 1073741828
  br i1 %91, label %92, label %95

92:                                               ; preds = %85, %78
  %93 = load ptr, ptr %4, align 8, !tbaa !5
  %94 = getelementptr inbounds %struct.WavpackStream, ptr %93, i32 0, i32 12
  store i8 1, ptr %94, align 4, !tbaa !26
  store i32 0, ptr %2, align 4
  store i32 1, ptr %8, align 4
  br label %244

95:                                               ; preds = %85
  %96 = load ptr, ptr %4, align 8, !tbaa !5
  %97 = getelementptr inbounds %struct.WavpackStream, ptr %96, i32 0, i32 2
  %98 = load ptr, ptr %97, align 8, !tbaa !36
  %99 = getelementptr inbounds i8, ptr %98, i64 12
  store ptr %99, ptr %5, align 8, !tbaa !5
  br label %100

100:                                              ; preds = %113, %95
  %101 = load ptr, ptr %4, align 8, !tbaa !5
  %102 = getelementptr inbounds %struct.WavpackStream, ptr %101, i32 0, i32 2
  %103 = load ptr, ptr %102, align 8, !tbaa !36
  %104 = call i32 @read_metadata_buff(ptr noundef %7, ptr noundef %103, ptr noundef %5)
  %105 = icmp ne i32 %104, 0
  br i1 %105, label %106, label %114

106:                                              ; preds = %100
  %107 = load ptr, ptr %3, align 8, !tbaa !5
  %108 = call i32 @process_metadata(ptr noundef %107, ptr noundef %7)
  %109 = icmp ne i32 %108, 0
  br i1 %109, label %113, label %110

110:                                              ; preds = %106
  %111 = load ptr, ptr %4, align 8, !tbaa !5
  %112 = getelementptr inbounds %struct.WavpackStream, ptr %111, i32 0, i32 12
  store i8 1, ptr %112, align 4, !tbaa !26
  store i32 0, ptr %2, align 4
  store i32 1, ptr %8, align 4
  br label %244

113:                                              ; preds = %106
  br label %100, !llvm.loop !37

114:                                              ; preds = %100
  %115 = load ptr, ptr %4, align 8, !tbaa !5
  %116 = getelementptr inbounds %struct.WavpackStream, ptr %115, i32 0, i32 0
  %117 = getelementptr inbounds %struct.WavpackHeader, ptr %116, i32 0, i32 2
  %118 = load i16, ptr %117, align 2, !tbaa !34
  %119 = zext i16 %118 to i32
  %120 = icmp ne i32 %119, 0
  br i1 %120, label %121, label %151

121:                                              ; preds = %114
  %122 = load ptr, ptr %3, align 8, !tbaa !5
  %123 = getelementptr inbounds %struct.WavpackContext, ptr %122, i32 0, i32 20
  %124 = load i32, ptr %123, align 8, !tbaa !39
  %125 = icmp ne i32 %124, 0
  br i1 %125, label %126, label %151

126:                                              ; preds = %121
  %127 = load ptr, ptr %4, align 8, !tbaa !5
  %128 = getelementptr inbounds %struct.WavpackStream, ptr %127, i32 0, i32 4
  %129 = load ptr, ptr %128, align 8, !tbaa !40
  %130 = icmp ne ptr %129, null
  br i1 %130, label %131, label %151

131:                                              ; preds = %126
  %132 = load ptr, ptr %4, align 8, !tbaa !5
  %133 = getelementptr inbounds %struct.WavpackStream, ptr %132, i32 0, i32 4
  %134 = load ptr, ptr %133, align 8, !tbaa !40
  %135 = getelementptr inbounds i8, ptr %134, i64 12
  store ptr %135, ptr %6, align 8, !tbaa !5
  br label %136

136:                                              ; preds = %149, %131
  %137 = load ptr, ptr %4, align 8, !tbaa !5
  %138 = getelementptr inbounds %struct.WavpackStream, ptr %137, i32 0, i32 4
  %139 = load ptr, ptr %138, align 8, !tbaa !40
  %140 = call i32 @read_metadata_buff(ptr noundef %7, ptr noundef %139, ptr noundef %6)
  %141 = icmp ne i32 %140, 0
  br i1 %141, label %142, label %150

142:                                              ; preds = %136
  %143 = load ptr, ptr %3, align 8, !tbaa !5
  %144 = call i32 @process_metadata(ptr noundef %143, ptr noundef %7)
  %145 = icmp ne i32 %144, 0
  br i1 %145, label %149, label %146

146:                                              ; preds = %142
  %147 = load ptr, ptr %4, align 8, !tbaa !5
  %148 = getelementptr inbounds %struct.WavpackStream, ptr %147, i32 0, i32 12
  store i8 1, ptr %148, align 4, !tbaa !26
  store i32 0, ptr %2, align 4
  store i32 1, ptr %8, align 4
  br label %244

149:                                              ; preds = %142
  br label %136, !llvm.loop !41

150:                                              ; preds = %136
  br label %151

151:                                              ; preds = %150, %126, %121, %114
  %152 = load ptr, ptr %4, align 8, !tbaa !5
  %153 = getelementptr inbounds %struct.WavpackStream, ptr %152, i32 0, i32 0
  %154 = getelementptr inbounds %struct.WavpackHeader, ptr %153, i32 0, i32 2
  %155 = load i16, ptr %154, align 2, !tbaa !34
  %156 = zext i16 %155 to i32
  %157 = icmp ne i32 %156, 0
  br i1 %157, label %158, label %191

158:                                              ; preds = %151
  %159 = load ptr, ptr %4, align 8, !tbaa !5
  %160 = getelementptr inbounds %struct.WavpackStream, ptr %159, i32 0, i32 0
  %161 = getelementptr inbounds %struct.WavpackHeader, ptr %160, i32 0, i32 3
  %162 = load i32, ptr %161, align 8, !tbaa !32
  %163 = and i32 %162, -2147483648
  %164 = icmp ne i32 %163, 0
  br i1 %164, label %165, label %171

165:                                              ; preds = %158
  %166 = load ptr, ptr %4, align 8, !tbaa !5
  %167 = getelementptr inbounds %struct.WavpackStream, ptr %166, i32 0, i32 43
  %168 = getelementptr inbounds %struct.anon.0, ptr %167, i32 0, i32 6
  %169 = load i8, ptr %168, align 1, !tbaa !31
  %170 = icmp ne i8 %169, 0
  br i1 %170, label %191, label %177

171:                                              ; preds = %158
  %172 = load ptr, ptr %4, align 8, !tbaa !5
  %173 = getelementptr inbounds %struct.WavpackStream, ptr %172, i32 0, i32 27
  %174 = getelementptr inbounds %struct.bs, ptr %173, i32 0, i32 2
  %175 = load ptr, ptr %174, align 8, !tbaa !42
  %176 = icmp ne ptr %175, null
  br i1 %176, label %191, label %177

177:                                              ; preds = %171, %165
  %178 = load ptr, ptr %4, align 8, !tbaa !5
  %179 = getelementptr inbounds %struct.WavpackStream, ptr %178, i32 0, i32 28
  %180 = getelementptr inbounds %struct.bs, ptr %179, i32 0, i32 2
  %181 = load ptr, ptr %180, align 8, !tbaa !43
  %182 = icmp ne ptr %181, null
  br i1 %182, label %183, label %188

183:                                              ; preds = %177
  %184 = load ptr, ptr %3, align 8, !tbaa !5
  %185 = getelementptr inbounds %struct.WavpackContext, ptr %184, i32 0, i32 46
  %186 = getelementptr inbounds [80 x i8], ptr %185, i64 0, i64 0
  %187 = call ptr @strcpy(ptr noundef %186, ptr noundef @.str.6) #4
  br label %188

188:                                              ; preds = %183, %177
  %189 = load ptr, ptr %4, align 8, !tbaa !5
  %190 = getelementptr inbounds %struct.WavpackStream, ptr %189, i32 0, i32 12
  store i8 1, ptr %190, align 4, !tbaa !26
  store i32 0, ptr %2, align 4
  store i32 1, ptr %8, align 4
  br label %244

191:                                              ; preds = %171, %165, %151
  %192 = load ptr, ptr %4, align 8, !tbaa !5
  %193 = getelementptr inbounds %struct.WavpackStream, ptr %192, i32 0, i32 0
  %194 = getelementptr inbounds %struct.WavpackHeader, ptr %193, i32 0, i32 2
  %195 = load i16, ptr %194, align 2, !tbaa !34
  %196 = zext i16 %195 to i32
  %197 = icmp ne i32 %196, 0
  br i1 %197, label %198, label %238

198:                                              ; preds = %191
  %199 = load ptr, ptr %4, align 8, !tbaa !5
  %200 = getelementptr inbounds %struct.WavpackStream, ptr %199, i32 0, i32 29
  %201 = getelementptr inbounds %struct.bs, ptr %200, i32 0, i32 2
  %202 = load ptr, ptr %201, align 8, !tbaa !44
  %203 = icmp ne ptr %202, null
  br i1 %203, label %238, label %204

204:                                              ; preds = %198
  %205 = load ptr, ptr %4, align 8, !tbaa !5
  %206 = getelementptr inbounds %struct.WavpackStream, ptr %205, i32 0, i32 0
  %207 = getelementptr inbounds %struct.WavpackHeader, ptr %206, i32 0, i32 3
  %208 = load i32, ptr %207, align 8, !tbaa !32
  %209 = and i32 %208, 256
  %210 = icmp ne i32 %209, 0
  br i1 %210, label %211, label %220

211:                                              ; preds = %204
  %212 = load ptr, ptr %4, align 8, !tbaa !5
  %213 = getelementptr inbounds %struct.WavpackStream, ptr %212, i32 0, i32 31
  %214 = load i8, ptr %213, align 4, !tbaa !45
  %215 = zext i8 %214 to i32
  %216 = icmp ne i32 %215, 0
  br i1 %216, label %217, label %220

217:                                              ; preds = %211
  %218 = load ptr, ptr %3, align 8, !tbaa !5
  %219 = getelementptr inbounds %struct.WavpackContext, ptr %218, i32 0, i32 24
  store i32 1, ptr %219, align 8, !tbaa !46
  br label %220

220:                                              ; preds = %217, %211, %204
  %221 = load ptr, ptr %4, align 8, !tbaa !5
  %222 = getelementptr inbounds %struct.WavpackStream, ptr %221, i32 0, i32 0
  %223 = getelementptr inbounds %struct.WavpackHeader, ptr %222, i32 0, i32 3
  %224 = load i32, ptr %223, align 8, !tbaa !32
  %225 = and i32 %224, 128
  %226 = icmp ne i32 %225, 0
  br i1 %226, label %227, label %237

227:                                              ; preds = %220
  %228 = load ptr, ptr %4, align 8, !tbaa !5
  %229 = getelementptr inbounds %struct.WavpackStream, ptr %228, i32 0, i32 35
  %230 = load i8, ptr %229, align 8, !tbaa !47
  %231 = zext i8 %230 to i32
  %232 = and i32 %231, 46
  %233 = icmp ne i32 %232, 0
  br i1 %233, label %234, label %237

234:                                              ; preds = %227
  %235 = load ptr, ptr %3, align 8, !tbaa !5
  %236 = getelementptr inbounds %struct.WavpackContext, ptr %235, i32 0, i32 24
  store i32 1, ptr %236, align 8, !tbaa !46
  br label %237

237:                                              ; preds = %234, %227, %220
  br label %238

238:                                              ; preds = %237, %198, %191
  %239 = load ptr, ptr %4, align 8, !tbaa !5
  %240 = getelementptr inbounds %struct.WavpackStream, ptr %239, i32 0, i32 7
  %241 = load i64, ptr %240, align 8, !tbaa !48
  %242 = load ptr, ptr %4, align 8, !tbaa !5
  %243 = getelementptr inbounds %struct.WavpackStream, ptr %242, i32 0, i32 8
  store i64 %241, ptr %243, align 8, !tbaa !49
  store i32 1, ptr %2, align 4
  store i32 1, ptr %8, align 4
  br label %244

244:                                              ; preds = %238, %188, %146, %110, %92, %75
  call void @llvm.lifetime.end.p0(i64 24, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #4
  %245 = load i32, ptr %2, align 4
  ret i32 %245
}

; Function Attrs: nounwind uwtable
declare hidden i32 @read_metadata_buff(ptr noundef, ptr noundef, ptr noundef) #3

; Function Attrs: nounwind uwtable
declare hidden i32 @process_metadata(ptr noundef, ptr noundef) #3

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { nocallback nofree nounwind willreturn memory(argmem: write) }
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 = !{!"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 148}
!17 = !{!"", !18, i64 0, !20, i64 12, !6, i64 88, !6, i64 96, !6, i64 104, !6, i64 112, !6, i64 120, !14, i64 128, !14, i64 136, !13, i64 144, !13, i64 148, !13, i64 152, !7, i64 156, !7, i64 157, !7, i64 158, !7, i64 159, !7, i64 160, !7, i64 161, !7, i64 162, !13, i64 164, !13, i64 168, !13, i64 172, !13, i64 176, !13, i64 180, !13, i64 184, !13, i64 188, !13, i64 192, !21, i64 200, !21, i64 248, !21, i64 296, !12, i64 344, !7, i64 348, !7, i64 349, !7, i64 350, !7, i64 351, !7, i64 352, !7, i64 353, !7, i64 354, !7, i64 355, !22, i64 360, !7, i64 432, !24, i64 1968, !6, i64 2064, !25, i64 2072}
!18 = !{!"", !7, i64 0, !19, i64 4, !19, i64 6, !13, i64 8}
!19 = !{!"short", !7, i64 0}
!20 = !{!"words_data", !7, i64 0, !7, i64 8, !13, i64 16, !13, i64 20, !13, i64 24, !13, i64 28, !13, i64 32, !7, i64 36}
!21 = !{!"bs", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !13, i64 32, !13, i64 36, !13, i64 40}
!22 = !{!"", !7, i64 0, !7, i64 8, !7, i64 16, !23, i64 24, !23, i64 32, !23, i64 40, !6, i64 48, !6, i64 56, !13, i64 64}
!23 = !{!"double", !7, i64 0}
!24 = !{!"decorr_pass", !13, i64 0, !13, i64 4, !13, i64 8, !13, i64 12, !7, i64 16, !7, i64 48, !13, i64 80, !13, i64 84, !13, i64 88, !13, i64 92}
!25 = !{!"", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !7, i64 40, !7, i64 41, !13, i64 44, !13, i64 48, !13, i64 52, !6, i64 56, !13, i64 64, !13, i64 68, !13, i64 72, !7, i64 76, !6, i64 160}
!26 = !{!17, !7, i64 156}
!27 = !{!17, !13, i64 184}
!28 = !{!17, !13, i64 180}
!29 = !{!17, !7, i64 162}
!30 = !{!17, !7, i64 161}
!31 = !{!17, !7, i64 2113}
!32 = !{!17, !13, i64 8}
!33 = !{!10, !13, i64 28}
!34 = !{!17, !19, i64 6}
!35 = !{!10, !13, i64 236}
!36 = !{!17, !6, i64 88}
!37 = distinct !{!37, !38}
!38 = !{!"llvm.loop.mustprogress"}
!39 = !{!10, !13, i64 224}
!40 = !{!17, !6, i64 104}
!41 = distinct !{!41, !38}
!42 = !{!17, !6, i64 216}
!43 = !{!17, !6, i64 264}
!44 = !{!17, !6, i64 312}
!45 = !{!17, !7, i64 348}
!46 = !{!10, !13, i64 240}
!47 = !{!17, !7, i64 352}
!48 = !{!17, !14, i64 128}
!49 = !{!17, !14, i64 136}


; 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 }

@.str.6 = external hidden unnamed_addr constant [37 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 nofree nounwind willreturn memory(argmem: readwrite)
declare ptr @strcpy(ptr noalias noundef returned writeonly, ptr noalias nocapture noundef readonly) local_unnamed_addr #1

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #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 @unpack_init(ptr noundef %0) local_unnamed_addr #3 {
  %2 = alloca ptr, align 8
  %3 = alloca ptr, align 8
  %4 = alloca %struct.WavpackMetadata, align 8
  %5 = getelementptr inbounds i8, ptr %0, i64 288
  %6 = load ptr, ptr %5, align 8, !tbaa !5
  %7 = getelementptr inbounds i8, ptr %0, i64 276
  %8 = load i32, ptr %7, align 4, !tbaa !14
  %9 = sext i32 %8 to i64
  %10 = getelementptr inbounds ptr, ptr %6, i64 %9
  %11 = load ptr, ptr %10, align 8, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #4
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %4) #4
  %12 = getelementptr inbounds i8, ptr %11, i64 148
  store i32 0, ptr %12, align 4, !tbaa !16
  %13 = getelementptr inbounds i8, ptr %11, i64 156
  store i8 0, ptr %13, align 4, !tbaa !26
  %14 = getelementptr inbounds i8, ptr %11, i64 184
  store i32 -1, ptr %14, align 8, !tbaa !27
  %15 = getelementptr inbounds i8, ptr %11, i64 180
  store i32 -1, ptr %15, align 4, !tbaa !28
  %16 = getelementptr inbounds i8, ptr %11, i64 162
  store i8 0, ptr %16, align 2, !tbaa !29
  %17 = getelementptr inbounds i8, ptr %11, i64 161
  store i8 0, ptr %17, align 1, !tbaa !30
  %18 = getelementptr inbounds i8, ptr %11, i64 2113
  store i8 0, ptr %18, align 1, !tbaa !31
  %19 = getelementptr inbounds i8, ptr %11, i64 200
  %20 = getelementptr inbounds i8, ptr %11, i64 360
  %21 = getelementptr inbounds i8, ptr %11, i64 12
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(76) %21, i8 0, i64 76, i1 false)
  %22 = getelementptr inbounds i8, ptr %11, i64 8
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(144) %19, i8 0, i64 144, i1 false)
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(1608) %20, i8 0, i64 1608, i1 false)
  %23 = load i32, ptr %22, align 8, !tbaa !32
  %24 = and i32 %23, 4
  %.not = icmp eq i32 %24, 0
  br i1 %.not, label %25, label %37

25:                                               ; preds = %1
  %26 = getelementptr inbounds i8, ptr %0, i64 28
  %27 = load i32, ptr %26, align 4, !tbaa !33
  %.not54 = icmp eq i32 %27, 0
  br i1 %.not54, label %37, label %28

28:                                               ; preds = %25
  %29 = getelementptr inbounds i8, ptr %11, i64 6
  %30 = load i16, ptr %29, align 2, !tbaa !34
  %.not55 = icmp eq i16 %30, 0
  br i1 %.not55, label %37, label %31

31:                                               ; preds = %28
  %32 = getelementptr inbounds i8, ptr %0, i64 236
  %33 = load i32, ptr %32, align 4, !tbaa !35
  %34 = icmp eq i32 %33, 1
  %35 = icmp eq i32 %27, 1
  %or.cond = or i1 %35, %34
  br i1 %or.cond, label %36, label %37

36:                                               ; preds = %31
  store i8 1, ptr %13, align 4, !tbaa !26
  br label %103

37:                                               ; preds = %1, %25, %28, %31
  %38 = and i32 %23, 1073741828
  %39 = icmp eq i32 %38, 1073741828
  br i1 %39, label %40, label %41

40:                                               ; preds = %37
  store i8 1, ptr %13, align 4, !tbaa !26
  br label %103

41:                                               ; preds = %37
  %42 = getelementptr inbounds i8, ptr %11, i64 88
  %43 = load ptr, ptr %42, align 8, !tbaa !36
  %44 = getelementptr inbounds i8, ptr %43, i64 12
  store ptr %44, ptr %2, align 8, !tbaa !15
  br label %45

45:                                               ; preds = %48, %41
  %46 = load ptr, ptr %42, align 8, !tbaa !36
  %47 = call i32 @read_metadata_buff(ptr noundef nonnull %4, ptr noundef %46, ptr noundef nonnull %2)
  %.not56 = icmp eq i32 %47, 0
  br i1 %.not56, label %51, label %48

48:                                               ; preds = %45
  %49 = call i32 @process_metadata(ptr noundef %0, ptr noundef nonnull %4)
  %.not73 = icmp eq i32 %49, 0
  br i1 %.not73, label %50, label %45, !llvm.loop !37

50:                                               ; preds = %48
  store i8 1, ptr %13, align 4, !tbaa !26
  br label %103

51:                                               ; preds = %45
  %52 = getelementptr inbounds i8, ptr %11, i64 6
  %53 = load i16, ptr %52, align 2, !tbaa !34
  %.not57 = icmp eq i16 %53, 0
  br i1 %.not57, label %.thread76, label %54

54:                                               ; preds = %51
  %55 = getelementptr inbounds i8, ptr %0, i64 224
  %56 = load i32, ptr %55, align 8, !tbaa !39
  %.not58 = icmp eq i32 %56, 0
  br i1 %.not58, label %.loopexit.thread, label %57

57:                                               ; preds = %54
  %58 = getelementptr inbounds i8, ptr %11, i64 104
  %59 = load ptr, ptr %58, align 8, !tbaa !40
  %.not59 = icmp eq ptr %59, null
  br i1 %.not59, label %.loopexit.thread, label %60

60:                                               ; preds = %57
  %61 = getelementptr inbounds i8, ptr %59, i64 12
  store ptr %61, ptr %3, align 8, !tbaa !15
  br label %62

62:                                               ; preds = %65, %60
  %63 = load ptr, ptr %58, align 8, !tbaa !40
  %64 = call i32 @read_metadata_buff(ptr noundef nonnull %4, ptr noundef %63, ptr noundef nonnull %3)
  %.not60 = icmp eq i32 %64, 0
  br i1 %.not60, label %.loopexit, label %65

65:                                               ; preds = %62
  %66 = call i32 @process_metadata(ptr noundef %0, ptr noundef nonnull %4)
  %.not72 = icmp eq i32 %66, 0
  br i1 %.not72, label %67, label %62, !llvm.loop !41

67:                                               ; preds = %65
  store i8 1, ptr %13, align 4, !tbaa !26
  br label %103

.loopexit:                                        ; preds = %62
  %.pr.pre = load i16, ptr %52, align 2, !tbaa !34
  %68 = icmp eq i16 %.pr.pre, 0
  br i1 %68, label %.thread76, label %.loopexit.thread

.loopexit.thread:                                 ; preds = %54, %57, %.loopexit
  %69 = load i32, ptr %22, align 8, !tbaa !32
  %.not62 = icmp sgt i32 %69, -1
  br i1 %.not62, label %72, label %70

70:                                               ; preds = %.loopexit.thread
  %71 = load i8, ptr %18, align 1, !tbaa !31
  %.not64 = icmp eq i8 %71, 0
  br i1 %.not64, label %75, label %82

72:                                               ; preds = %.loopexit.thread
  %73 = getelementptr inbounds i8, ptr %11, i64 216
  %74 = load ptr, ptr %73, align 8, !tbaa !42
  %.not63 = icmp eq ptr %74, null
  br i1 %.not63, label %75, label %82

75:                                               ; preds = %72, %70
  %76 = getelementptr inbounds i8, ptr %11, i64 264
  %77 = load ptr, ptr %76, align 8, !tbaa !43
  %.not65 = icmp eq ptr %77, null
  br i1 %.not65, label %81, label %78

78:                                               ; preds = %75
  %79 = getelementptr inbounds i8, ptr %0, i64 360
  %80 = call ptr @strcpy(ptr noundef nonnull dereferenceable(1) %79, ptr noundef nonnull dereferenceable(1) @.str.6) #4
  br label %81

81:                                               ; preds = %78, %75
  store i8 1, ptr %13, align 4, !tbaa !26
  br label %103

82:                                               ; preds = %70, %72
  %83 = getelementptr inbounds i8, ptr %11, i64 312
  %84 = load ptr, ptr %83, align 8, !tbaa !44
  %.not67 = icmp eq ptr %84, null
  br i1 %.not67, label %85, label %.thread76

85:                                               ; preds = %82
  %86 = and i32 %69, 256
  %.not68 = icmp eq i32 %86, 0
  br i1 %.not68, label %92, label %87

87:                                               ; preds = %85
  %88 = getelementptr inbounds i8, ptr %11, i64 348
  %89 = load i8, ptr %88, align 4, !tbaa !45
  %.not69 = icmp eq i8 %89, 0
  br i1 %.not69, label %92, label %90

90:                                               ; preds = %87
  %91 = getelementptr inbounds i8, ptr %0, i64 240
  store i32 1, ptr %91, align 8, !tbaa !46
  br label %92

92:                                               ; preds = %90, %87, %85
  %93 = and i32 %69, 128
  %.not70 = icmp eq i32 %93, 0
  br i1 %.not70, label %.thread76, label %94

94:                                               ; preds = %92
  %95 = getelementptr inbounds i8, ptr %11, i64 352
  %96 = load i8, ptr %95, align 8, !tbaa !47
  %97 = and i8 %96, 46
  %.not71 = icmp eq i8 %97, 0
  br i1 %.not71, label %.thread76, label %98

98:                                               ; preds = %94
  %99 = getelementptr inbounds i8, ptr %0, i64 240
  store i32 1, ptr %99, align 8, !tbaa !46
  br label %.thread76

.thread76:                                        ; preds = %51, %.loopexit, %92, %94, %98, %82
  %100 = getelementptr inbounds i8, ptr %11, i64 128
  %101 = load i64, ptr %100, align 8, !tbaa !48
  %102 = getelementptr inbounds i8, ptr %11, i64 136
  store i64 %101, ptr %102, align 8, !tbaa !49
  br label %103

103:                                              ; preds = %.thread76, %81, %67, %50, %40, %36
  %.0 = phi i32 [ 0, %40 ], [ 0, %50 ], [ 0, %67 ], [ 1, %.thread76 ], [ 0, %81 ], [ 0, %36 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #4
  ret i32 %.0
}

; Function Attrs: nounwind uwtable
declare hidden i32 @read_metadata_buff(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #3

; Function Attrs: nounwind uwtable
declare hidden i32 @process_metadata(ptr noundef, ptr noundef) local_unnamed_addr #3

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress nofree nounwind willreturn memory(argmem: readwrite) "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 nocallback nofree nounwind willreturn memory(argmem: write) }
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, !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 148}
!17 = !{!"", !18, i64 0, !20, i64 12, !12, i64 88, !12, i64 96, !12, i64 104, !12, i64 112, !12, i64 120, !13, i64 128, !13, i64 136, !11, i64 144, !11, i64 148, !11, i64 152, !9, i64 156, !9, i64 157, !9, i64 158, !9, i64 159, !9, i64 160, !9, i64 161, !9, i64 162, !11, i64 164, !11, i64 168, !11, i64 172, !11, i64 176, !11, i64 180, !11, i64 184, !11, i64 188, !11, i64 192, !21, i64 200, !21, i64 248, !21, i64 296, !8, i64 344, !9, i64 348, !9, i64 349, !9, i64 350, !9, i64 351, !9, i64 352, !9, i64 353, !9, i64 354, !9, i64 355, !22, i64 360, !9, i64 432, !24, i64 1968, !12, i64 2064, !25, i64 2072}
!18 = !{!"", !9, i64 0, !19, i64 4, !19, i64 6, !11, i64 8}
!19 = !{!"short", !9, i64 0}
!20 = !{!"words_data", !9, i64 0, !9, i64 8, !11, i64 16, !11, i64 20, !11, i64 24, !11, i64 28, !11, i64 32, !9, i64 36}
!21 = !{!"bs", !12, i64 0, !12, i64 8, !12, i64 16, !12, i64 24, !11, i64 32, !11, i64 36, !11, i64 40}
!22 = !{!"", !9, i64 0, !9, i64 8, !9, i64 16, !23, i64 24, !23, i64 32, !23, i64 40, !12, i64 48, !12, i64 56, !11, i64 64}
!23 = !{!"double", !9, i64 0}
!24 = !{!"decorr_pass", !11, i64 0, !11, i64 4, !11, i64 8, !11, i64 12, !9, i64 16, !9, i64 48, !11, i64 80, !11, i64 84, !11, i64 88, !11, i64 92}
!25 = !{!"", !12, i64 0, !12, i64 8, !12, i64 16, !12, i64 24, !12, i64 32, !9, i64 40, !9, i64 41, !11, i64 44, !11, i64 48, !11, i64 52, !12, i64 56, !11, i64 64, !11, i64 68, !11, i64 72, !9, i64 76, !12, i64 160}
!26 = !{!17, !9, i64 156}
!27 = !{!17, !11, i64 184}
!28 = !{!17, !11, i64 180}
!29 = !{!17, !9, i64 162}
!30 = !{!17, !9, i64 161}
!31 = !{!17, !9, i64 2113}
!32 = !{!17, !11, i64 8}
!33 = !{!6, !11, i64 28}
!34 = !{!17, !19, i64 6}
!35 = !{!6, !11, i64 236}
!36 = !{!17, !12, i64 88}
!37 = distinct !{!37, !38}
!38 = !{!"llvm.loop.mustprogress"}
!39 = !{!6, !11, i64 224}
!40 = !{!17, !12, i64 104}
!41 = distinct !{!41, !38}
!42 = !{!17, !12, i64 216}
!43 = !{!17, !12, i64 264}
!44 = !{!17, !12, i64 312}
!45 = !{!17, !9, i64 348}
!46 = !{!6, !11, i64 240}
!47 = !{!17, !9, i64 352}
!48 = !{!17, !13, i64 128}
!49 = !{!17, !13, i64 136}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LoopSimplifyPass,MemCpyOptPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass