; LLVM IR from merpheus-dev/LavaEngine :: src/Utils/soloud/src/audiosource/wav (dr_impl)

; 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.drflac = type { ptr, ptr, %struct.drflac_allocation_callbacks, i32, i8, i8, i16, i64, i32, i32, %struct.drflac_frame, i64, i64, %struct.drflac__memory_stream, ptr, ptr, ptr, i8, %struct.drflac_bs, [1 x i8] }
%struct.drflac_allocation_callbacks = type { ptr, ptr, ptr, ptr }
%struct.drflac_frame = type { %struct.drflac_frame_header, i32, [8 x %struct.drflac_subframe] }
%struct.drflac_frame_header = type { i64, i32, i32, i16, i8, i8, i8 }
%struct.drflac_subframe = type { i8, i8, i8, ptr }
%struct.drflac__memory_stream = type { ptr, i64, i64 }
%struct.drflac_bs = type { ptr, ptr, ptr, i64, i64, i32, i32, [512 x i64], i64, i16, i64, i32 }

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_Z34drflac__seek_forward_by_pcm_framesP6drflacm(ptr noundef, i64 noundef) #1

; Function Attrs: mustprogress uwtable
declare hidden noundef i32 @_ZL39drflac__read_and_decode_next_flac_frameP6drflac(ptr noundef) #1

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare hidden noundef zeroext i8 @_ZL49drflac__get_channel_count_from_channel_assignmenta(i8 noundef signext) #2

; Function Attrs: mustprogress uwtable
define dso_local i64 @drflac_read_pcm_frames_s16(ptr noundef %0, i64 noundef %1, ptr noundef %2) #1 {
  %4 = alloca i64, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i64, 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 i64, align 8
  %13 = alloca i64, align 8
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca i64, align 8
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  store i64 %1, ptr %6, align 8, !tbaa !9
  store ptr %2, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #4
  %19 = load ptr, ptr %5, align 8, !tbaa !5
  %20 = icmp eq ptr %19, null
  br i1 %20, label %24, label %21

21:                                               ; preds = %3
  %22 = load i64, ptr %6, align 8, !tbaa !9
  %23 = icmp eq i64 %22, 0
  br i1 %23, label %24, label %25

24:                                               ; preds = %21, %3
  store i64 0, ptr %4, align 8
  store i32 1, ptr %10, align 4
  br label %227

25:                                               ; preds = %21
  %26 = load ptr, ptr %7, align 8, !tbaa !5
  %27 = icmp eq ptr %26, null
  br i1 %27, label %28, label %32

28:                                               ; preds = %25
  %29 = load ptr, ptr %5, align 8, !tbaa !5
  %30 = load i64, ptr %6, align 8, !tbaa !9
  %31 = call noundef i64 @_Z34drflac__seek_forward_by_pcm_framesP6drflacm(ptr noundef %29, i64 noundef %30)
  store i64 %31, ptr %4, align 8
  store i32 1, ptr %10, align 4
  br label %227

32:                                               ; preds = %25
  %33 = load ptr, ptr %5, align 8, !tbaa !5
  %34 = getelementptr inbounds %struct.drflac, ptr %33, i32 0, i32 5
  %35 = load i8, ptr %34, align 1, !tbaa !11
  %36 = zext i8 %35 to i32
  %37 = sub nsw i32 32, %36
  store i32 %37, ptr %9, align 4, !tbaa !21
  store i64 0, ptr %8, align 8, !tbaa !9
  br label %38

38:                                               ; preds = %224, %32
  %39 = load i64, ptr %6, align 8, !tbaa !9
  %40 = icmp ugt i64 %39, 0
  br i1 %40, label %41, label %225

41:                                               ; preds = %38
  %42 = load ptr, ptr %5, align 8, !tbaa !5
  %43 = getelementptr inbounds %struct.drflac, ptr %42, i32 0, i32 10
  %44 = getelementptr inbounds %struct.drflac_frame, ptr %43, i32 0, i32 1
  %45 = load i32, ptr %44, align 8, !tbaa !22
  %46 = icmp eq i32 %45, 0
  br i1 %46, label %47, label %53

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

51:                                               ; preds = %47
  br label %225

52:                                               ; preds = %47
  br label %224

53:                                               ; preds = %41
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #4
  %54 = load ptr, ptr %5, align 8, !tbaa !5
  %55 = getelementptr inbounds %struct.drflac, ptr %54, i32 0, i32 10
  %56 = getelementptr inbounds %struct.drflac_frame, ptr %55, i32 0, i32 0
  %57 = getelementptr inbounds %struct.drflac_frame_header, ptr %56, i32 0, i32 4
  %58 = load i8, ptr %57, align 2, !tbaa !23
  %59 = call noundef zeroext i8 @_ZL49drflac__get_channel_count_from_channel_assignmenta(i8 noundef signext %58)
  %60 = zext i8 %59 to i32
  store i32 %60, ptr %11, align 4, !tbaa !21
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #4
  %61 = load ptr, ptr %5, align 8, !tbaa !5
  %62 = getelementptr inbounds %struct.drflac, ptr %61, i32 0, i32 10
  %63 = getelementptr inbounds %struct.drflac_frame, ptr %62, i32 0, i32 0
  %64 = getelementptr inbounds %struct.drflac_frame_header, ptr %63, i32 0, i32 3
  %65 = load i16, ptr %64, align 8, !tbaa !24
  %66 = zext i16 %65 to i32
  %67 = load ptr, ptr %5, align 8, !tbaa !5
  %68 = getelementptr inbounds %struct.drflac, ptr %67, i32 0, i32 10
  %69 = getelementptr inbounds %struct.drflac_frame, ptr %68, i32 0, i32 1
  %70 = load i32, ptr %69, align 8, !tbaa !22
  %71 = sub i32 %66, %70
  %72 = zext i32 %71 to i64
  store i64 %72, ptr %12, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #4
  %73 = load i64, ptr %6, align 8, !tbaa !9
  store i64 %73, ptr %13, align 8, !tbaa !9
  %74 = load i64, ptr %13, align 8, !tbaa !9
  %75 = load ptr, ptr %5, align 8, !tbaa !5
  %76 = getelementptr inbounds %struct.drflac, ptr %75, i32 0, i32 10
  %77 = getelementptr inbounds %struct.drflac_frame, ptr %76, i32 0, i32 1
  %78 = load i32, ptr %77, align 8, !tbaa !22
  %79 = zext i32 %78 to i64
  %80 = icmp ugt i64 %74, %79
  br i1 %80, label %81, label %87

81:                                               ; preds = %53
  %82 = load ptr, ptr %5, align 8, !tbaa !5
  %83 = getelementptr inbounds %struct.drflac, ptr %82, i32 0, i32 10
  %84 = getelementptr inbounds %struct.drflac_frame, ptr %83, i32 0, i32 1
  %85 = load i32, ptr %84, align 8, !tbaa !22
  %86 = zext i32 %85 to i64
  store i64 %86, ptr %13, align 8, !tbaa !9
  br label %87

87:                                               ; preds = %81, %53
  %88 = load i32, ptr %11, align 4, !tbaa !21
  %89 = icmp eq i32 %88, 2
  br i1 %89, label %90, label %143

90:                                               ; preds = %87
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #4
  %91 = load ptr, ptr %5, align 8, !tbaa !5
  %92 = getelementptr inbounds %struct.drflac, ptr %91, i32 0, i32 10
  %93 = getelementptr inbounds %struct.drflac_frame, ptr %92, i32 0, i32 2
  %94 = getelementptr inbounds [8 x %struct.drflac_subframe], ptr %93, i64 0, i64 0
  %95 = getelementptr inbounds %struct.drflac_subframe, ptr %94, i32 0, i32 3
  %96 = load ptr, ptr %95, align 8, !tbaa !25
  %97 = load i64, ptr %12, align 8, !tbaa !9
  %98 = getelementptr inbounds i32, ptr %96, i64 %97
  store ptr %98, ptr %14, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #4
  %99 = load ptr, ptr %5, align 8, !tbaa !5
  %100 = getelementptr inbounds %struct.drflac, ptr %99, i32 0, i32 10
  %101 = getelementptr inbounds %struct.drflac_frame, ptr %100, i32 0, i32 2
  %102 = getelementptr inbounds [8 x %struct.drflac_subframe], ptr %101, i64 0, i64 1
  %103 = getelementptr inbounds %struct.drflac_subframe, ptr %102, i32 0, i32 3
  %104 = load ptr, ptr %103, align 8, !tbaa !25
  %105 = load i64, ptr %12, align 8, !tbaa !9
  %106 = getelementptr inbounds i32, ptr %104, i64 %105
  store ptr %106, ptr %15, align 8, !tbaa !5
  %107 = load ptr, ptr %5, align 8, !tbaa !5
  %108 = getelementptr inbounds %struct.drflac, ptr %107, i32 0, i32 10
  %109 = getelementptr inbounds %struct.drflac_frame, ptr %108, i32 0, i32 0
  %110 = getelementptr inbounds %struct.drflac_frame_header, ptr %109, i32 0, i32 4
  %111 = load i8, ptr %110, align 2, !tbaa !23
  %112 = zext i8 %111 to i32
  switch i32 %112, label %135 [
    i32 8, label %113
    i32 9, label %120
    i32 10, label %127
    i32 0, label %134
  ]

113:                                              ; preds = %90
  %114 = load ptr, ptr %5, align 8, !tbaa !5
  %115 = load i64, ptr %13, align 8, !tbaa !9
  %116 = load i32, ptr %9, align 4, !tbaa !21
  %117 = load ptr, ptr %14, align 8, !tbaa !5
  %118 = load ptr, ptr %15, align 8, !tbaa !5
  %119 = load ptr, ptr %7, align 8, !tbaa !5
  call void @_ZL44drflac_read_pcm_frames_s16__decode_left_sideP6drflacmiPKiS2_Ps(ptr noundef %114, i64 noundef %115, i32 noundef %116, ptr noundef %117, ptr noundef %118, ptr noundef %119)
  br label %142

120:                                              ; preds = %90
  %121 = load ptr, ptr %5, align 8, !tbaa !5
  %122 = load i64, ptr %13, align 8, !tbaa !9
  %123 = load i32, ptr %9, align 4, !tbaa !21
  %124 = load ptr, ptr %14, align 8, !tbaa !5
  %125 = load ptr, ptr %15, align 8, !tbaa !5
  %126 = load ptr, ptr %7, align 8, !tbaa !5
  call void @_ZL45drflac_read_pcm_frames_s16__decode_right_sideP6drflacmiPKiS2_Ps(ptr noundef %121, i64 noundef %122, i32 noundef %123, ptr noundef %124, ptr noundef %125, ptr noundef %126)
  br label %142

127:                                              ; preds = %90
  %128 = load ptr, ptr %5, align 8, !tbaa !5
  %129 = load i64, ptr %13, align 8, !tbaa !9
  %130 = load i32, ptr %9, align 4, !tbaa !21
  %131 = load ptr, ptr %14, align 8, !tbaa !5
  %132 = load ptr, ptr %15, align 8, !tbaa !5
  %133 = load ptr, ptr %7, align 8, !tbaa !5
  call void @_ZL43drflac_read_pcm_frames_s16__decode_mid_sideP6drflacmiPKiS2_Ps(ptr noundef %128, i64 noundef %129, i32 noundef %130, ptr noundef %131, ptr noundef %132, ptr noundef %133)
  br label %142

134:                                              ; preds = %90
  br label %135

135:                                              ; preds = %134, %90
  %136 = load ptr, ptr %5, align 8, !tbaa !5
  %137 = load i64, ptr %13, align 8, !tbaa !9
  %138 = load i32, ptr %9, align 4, !tbaa !21
  %139 = load ptr, ptr %14, align 8, !tbaa !5
  %140 = load ptr, ptr %15, align 8, !tbaa !5
  %141 = load ptr, ptr %7, align 8, !tbaa !5
  call void @_ZL53drflac_read_pcm_frames_s16__decode_independent_stereoP6drflacmiPKiS2_Ps(ptr noundef %136, i64 noundef %137, i32 noundef %138, ptr noundef %139, ptr noundef %140, ptr noundef %141)
  br label %142

142:                                              ; preds = %135, %127, %120, %113
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #4
  br label %199

143:                                              ; preds = %87
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #4
  store i64 0, ptr %16, align 8, !tbaa !9
  br label %144

144:                                              ; preds = %195, %143
  %145 = load i64, ptr %16, align 8, !tbaa !9
  %146 = load i64, ptr %13, align 8, !tbaa !9
  %147 = icmp ult i64 %145, %146
  br i1 %147, label %148, label %198

148:                                              ; preds = %144
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #4
  store i32 0, ptr %17, align 4, !tbaa !21
  br label %149

149:                                              ; preds = %191, %148
  %150 = load i32, ptr %17, align 4, !tbaa !21
  %151 = load i32, ptr %11, align 4, !tbaa !21
  %152 = icmp ult i32 %150, %151
  br i1 %152, label %153, label %194

153:                                              ; preds = %149
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #4
  %154 = load ptr, ptr %5, align 8, !tbaa !5
  %155 = getelementptr inbounds %struct.drflac, ptr %154, i32 0, i32 10
  %156 = getelementptr inbounds %struct.drflac_frame, ptr %155, i32 0, i32 2
  %157 = load i32, ptr %17, align 4, !tbaa !21
  %158 = zext i32 %157 to i64
  %159 = getelementptr inbounds [8 x %struct.drflac_subframe], ptr %156, i64 0, i64 %158
  %160 = getelementptr inbounds %struct.drflac_subframe, ptr %159, i32 0, i32 3
  %161 = load ptr, ptr %160, align 8, !tbaa !25
  %162 = load i64, ptr %12, align 8, !tbaa !9
  %163 = load i64, ptr %16, align 8, !tbaa !9
  %164 = add i64 %162, %163
  %165 = getelementptr inbounds i32, ptr %161, i64 %164
  %166 = load i32, ptr %165, align 4, !tbaa !21
  %167 = load i32, ptr %9, align 4, !tbaa !21
  %168 = load ptr, ptr %5, align 8, !tbaa !5
  %169 = getelementptr inbounds %struct.drflac, ptr %168, i32 0, i32 10
  %170 = getelementptr inbounds %struct.drflac_frame, ptr %169, i32 0, i32 2
  %171 = load i32, ptr %17, align 4, !tbaa !21
  %172 = zext i32 %171 to i64
  %173 = getelementptr inbounds [8 x %struct.drflac_subframe], ptr %170, i64 0, i64 %172
  %174 = getelementptr inbounds %struct.drflac_subframe, ptr %173, i32 0, i32 1
  %175 = load i8, ptr %174, align 1, !tbaa !27
  %176 = zext i8 %175 to i32
  %177 = add nsw i32 %167, %176
  %178 = shl i32 %166, %177
  store i32 %178, ptr %18, align 4, !tbaa !21
  %179 = load i32, ptr %18, align 4, !tbaa !21
  %180 = ashr i32 %179, 16
  %181 = trunc i32 %180 to i16
  %182 = load ptr, ptr %7, align 8, !tbaa !5
  %183 = load i64, ptr %16, align 8, !tbaa !9
  %184 = load i32, ptr %11, align 4, !tbaa !21
  %185 = zext i32 %184 to i64
  %186 = mul i64 %183, %185
  %187 = load i32, ptr %17, align 4, !tbaa !21
  %188 = zext i32 %187 to i64
  %189 = add i64 %186, %188
  %190 = getelementptr inbounds i16, ptr %182, i64 %189
  store i16 %181, ptr %190, align 2, !tbaa !28
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #4
  br label %191

191:                                              ; preds = %153
  %192 = load i32, ptr %17, align 4, !tbaa !21
  %193 = add i32 %192, 1
  store i32 %193, ptr %17, align 4, !tbaa !21
  br label %149, !llvm.loop !29

194:                                              ; preds = %149
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #4
  br label %195

195:                                              ; preds = %194
  %196 = load i64, ptr %16, align 8, !tbaa !9
  %197 = add i64 %196, 1
  store i64 %197, ptr %16, align 8, !tbaa !9
  br label %144, !llvm.loop !31

198:                                              ; preds = %144
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #4
  br label %199

199:                                              ; preds = %198, %142
  %200 = load i64, ptr %13, align 8, !tbaa !9
  %201 = load i64, ptr %8, align 8, !tbaa !9
  %202 = add i64 %201, %200
  store i64 %202, ptr %8, align 8, !tbaa !9
  %203 = load i64, ptr %13, align 8, !tbaa !9
  %204 = load i32, ptr %11, align 4, !tbaa !21
  %205 = zext i32 %204 to i64
  %206 = mul i64 %203, %205
  %207 = load ptr, ptr %7, align 8, !tbaa !5
  %208 = getelementptr inbounds i16, ptr %207, i64 %206
  store ptr %208, ptr %7, align 8, !tbaa !5
  %209 = load i64, ptr %13, align 8, !tbaa !9
  %210 = load i64, ptr %6, align 8, !tbaa !9
  %211 = sub i64 %210, %209
  store i64 %211, ptr %6, align 8, !tbaa !9
  %212 = load i64, ptr %13, align 8, !tbaa !9
  %213 = load ptr, ptr %5, align 8, !tbaa !5
  %214 = getelementptr inbounds %struct.drflac, ptr %213, i32 0, i32 11
  %215 = load i64, ptr %214, align 8, !tbaa !32
  %216 = add i64 %215, %212
  store i64 %216, ptr %214, align 8, !tbaa !32
  %217 = load i64, ptr %13, align 8, !tbaa !9
  %218 = trunc i64 %217 to i32
  %219 = load ptr, ptr %5, align 8, !tbaa !5
  %220 = getelementptr inbounds %struct.drflac, ptr %219, i32 0, i32 10
  %221 = getelementptr inbounds %struct.drflac_frame, ptr %220, i32 0, i32 1
  %222 = load i32, ptr %221, align 8, !tbaa !22
  %223 = sub i32 %222, %218
  store i32 %223, ptr %221, align 8, !tbaa !22
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #4
  br label %224

224:                                              ; preds = %199, %52
  br label %38, !llvm.loop !33

225:                                              ; preds = %51, %38
  %226 = load i64, ptr %8, align 8, !tbaa !9
  store i64 %226, ptr %4, align 8
  store i32 1, ptr %10, align 4
  br label %227

227:                                              ; preds = %225, %28, %24
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #4
  %228 = load i64, ptr %4, align 8
  ret i64 %228
}

; Function Attrs: alwaysinline mustprogress uwtable
declare hidden void @_ZL44drflac_read_pcm_frames_s16__decode_left_sideP6drflacmiPKiS2_Ps(ptr noundef, i64 noundef, i32 noundef, ptr noundef, ptr noundef, ptr noundef) #3

; Function Attrs: alwaysinline mustprogress uwtable
declare hidden void @_ZL45drflac_read_pcm_frames_s16__decode_right_sideP6drflacmiPKiS2_Ps(ptr noundef, i64 noundef, i32 noundef, ptr noundef, ptr noundef, ptr noundef) #3

; Function Attrs: alwaysinline mustprogress uwtable
declare hidden void @_ZL43drflac_read_pcm_frames_s16__decode_mid_sideP6drflacmiPKiS2_Ps(ptr noundef, i64 noundef, i32 noundef, ptr noundef, ptr noundef, ptr noundef) #3

; Function Attrs: alwaysinline mustprogress uwtable
declare hidden void @_ZL53drflac_read_pcm_frames_s16__decode_independent_stereoP6drflacmiPKiS2_Ps(ptr noundef, i64 noundef, i32 noundef, ptr noundef, ptr noundef, ptr noundef) #3

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { alwaysinline mustprogress 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 #3 = { alwaysinline mustprogress 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++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long", !7, i64 0}
!11 = !{!12, !7, i64 53}
!12 = !{!"_ZTS6drflac", !6, i64 0, !6, i64 8, !13, i64 16, !14, i64 48, !7, i64 52, !7, i64 53, !15, i64 54, !10, i64 56, !16, i64 64, !14, i64 68, !17, i64 72, !10, i64 232, !10, i64 240, !19, i64 248, !6, i64 272, !6, i64 280, !6, i64 288, !14, i64 296, !14, i64 296, !14, i64 296, !20, i64 304, !7, i64 4480}
!13 = !{!"_ZTS27drflac_allocation_callbacks", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!14 = !{!"int", !7, i64 0}
!15 = !{!"short", !7, i64 0}
!16 = !{!"_ZTS16drflac_container", !7, i64 0}
!17 = !{!"_ZTS12drflac_frame", !18, i64 0, !14, i64 24, !7, i64 32}
!18 = !{!"_ZTS19drflac_frame_header", !10, i64 0, !14, i64 8, !14, i64 12, !15, i64 16, !7, i64 18, !7, i64 19, !7, i64 20}
!19 = !{!"_ZTS21drflac__memory_stream", !6, i64 0, !10, i64 8, !10, i64 16}
!20 = !{!"_ZTS9drflac_bs", !6, i64 0, !6, i64 8, !6, i64 16, !10, i64 24, !10, i64 32, !14, i64 40, !14, i64 44, !7, i64 48, !10, i64 4144, !15, i64 4152, !10, i64 4160, !14, i64 4168}
!21 = !{!14, !14, i64 0}
!22 = !{!12, !14, i64 96}
!23 = !{!12, !7, i64 90}
!24 = !{!12, !15, i64 88}
!25 = !{!26, !6, i64 8}
!26 = !{!"_ZTS15drflac_subframe", !7, i64 0, !7, i64 1, !7, i64 2, !6, i64 8}
!27 = !{!26, !7, i64 1}
!28 = !{!15, !15, i64 0}
!29 = distinct !{!29, !30}
!30 = !{!"llvm.loop.mustprogress"}
!31 = distinct !{!31, !30}
!32 = !{!12, !10, i64 232}
!33 = distinct !{!33, !30}


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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_Z34drflac__seek_forward_by_pcm_framesP6drflacm(ptr noundef, i64 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
declare hidden noundef i32 @_ZL39drflac__read_and_decode_next_flac_frameP6drflac(ptr noundef) local_unnamed_addr #0

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare hidden noundef zeroext i8 @_ZL49drflac__get_channel_count_from_channel_assignmenta(i8 noundef signext) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
define dso_local i64 @drflac_read_pcm_frames_s16(ptr noundef %0, i64 noundef %1, ptr noundef %2) local_unnamed_addr #0 {
  %4 = icmp eq ptr %0, null
  %5 = icmp eq i64 %1, 0
  %or.cond = or i1 %4, %5
  br i1 %or.cond, label %.loopexit92, label %6

6:                                                ; preds = %3
  %7 = icmp eq ptr %2, null
  br i1 %7, label %8, label %.lr.ph

8:                                                ; preds = %6
  %9 = tail call noundef i64 @_Z34drflac__seek_forward_by_pcm_framesP6drflacm(ptr noundef nonnull %0, i64 noundef %1)
  br label %.loopexit92

.lr.ph:                                           ; preds = %6
  %10 = getelementptr inbounds i8, ptr %0, i64 53
  %11 = load i8, ptr %10, align 1, !tbaa !5
  %12 = zext i8 %11 to i32
  %13 = sub nsw i32 32, %12
  %14 = getelementptr inbounds i8, ptr %0, i64 96
  %15 = getelementptr inbounds i8, ptr %0, i64 90
  %16 = getelementptr inbounds i8, ptr %0, i64 88
  %17 = getelementptr inbounds i8, ptr %0, i64 104
  %18 = getelementptr inbounds i8, ptr %0, i64 112
  %19 = getelementptr inbounds i8, ptr %0, i64 128
  %20 = getelementptr inbounds i8, ptr %0, i64 232
  br label %21

21:                                               ; preds = %.lr.ph, %105
  %.079100 = phi i64 [ %1, %.lr.ph ], [ %.1, %105 ]
  %.08097 = phi ptr [ %2, %.lr.ph ], [ %.181, %105 ]
  %.08396 = phi i64 [ 0, %.lr.ph ], [ %.184, %105 ]
  %22 = load i32, ptr %14, align 8, !tbaa !19
  %23 = icmp eq i32 %22, 0
  br i1 %23, label %24, label %26

24:                                               ; preds = %21
  %25 = tail call noundef i32 @_ZL39drflac__read_and_decode_next_flac_frameP6drflac(ptr noundef nonnull %0)
  %.not90 = icmp eq i32 %25, 0
  br i1 %.not90, label %.loopexit92, label %105

26:                                               ; preds = %21
  %27 = load i8, ptr %15, align 2, !tbaa !20
  %28 = tail call noundef zeroext i8 @_ZL49drflac__get_channel_count_from_channel_assignmenta(i8 noundef signext %27)
  %29 = load i16, ptr %16, align 8, !tbaa !21
  %30 = zext i16 %29 to i32
  %31 = load i32, ptr %14, align 8, !tbaa !19
  %32 = sub i32 %30, %31
  %33 = zext i32 %32 to i64
  %34 = zext i32 %31 to i64
  %spec.select = tail call i64 @llvm.umin.i64(i64 %.079100, i64 %34)
  %35 = icmp eq i8 %28, 2
  br i1 %35, label %85, label %.preheader91

.preheader91:                                     ; preds = %26
  %.not103 = icmp eq i32 %31, 0
  br i1 %.not103, label %.loopexit, label %.preheader.lr.ph

.preheader.lr.ph:                                 ; preds = %.preheader91
  %.not104 = icmp eq i8 %28, 0
  %36 = zext i8 %28 to i64
  br i1 %.not104, label %.loopexit, label %.preheader.us.preheader

.preheader.us.preheader:                          ; preds = %.preheader.lr.ph
  %umax = tail call i64 @llvm.umax.i64(i64 %spec.select, i64 1)
  %wide.trip.count = zext i8 %28 to i64
  %xtraiter = and i64 %wide.trip.count, 1
  %37 = icmp eq i8 %28, 1
  %unroll_iter = and i64 %wide.trip.count, 254
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br label %.preheader.us

.preheader.us:                                    ; preds = %.preheader.us.preheader, %._crit_edge.us
  %.07894.us = phi i64 [ %84, %._crit_edge.us ], [ 0, %.preheader.us.preheader ]
  %38 = mul nuw nsw i64 %.07894.us, %36
  br i1 %37, label %._crit_edge.us.unr-lcssa, label %.preheader.us.new

.preheader.us.new:                                ; preds = %.preheader.us, %.preheader.us.new
  %indvars.iv = phi i64 [ %indvars.iv.next.1, %.preheader.us.new ], [ 0, %.preheader.us ]
  %niter = phi i64 [ %niter.next.1, %.preheader.us.new ], [ 0, %.preheader.us ]
  %39 = getelementptr inbounds [8 x %struct.drflac_subframe], ptr %17, i64 0, i64 %indvars.iv
  %40 = getelementptr inbounds i8, ptr %39, i64 8
  %41 = load ptr, ptr %40, align 8, !tbaa !22
  %42 = getelementptr inbounds i32, ptr %41, i64 %.07894.us
  %43 = getelementptr inbounds i32, ptr %42, i64 %33
  %44 = load i32, ptr %43, align 4, !tbaa !24
  %45 = getelementptr inbounds i8, ptr %39, i64 1
  %46 = load i8, ptr %45, align 1, !tbaa !25
  %47 = zext i8 %46 to i32
  %48 = add nsw i32 %13, %47
  %49 = shl i32 %44, %48
  %50 = lshr i32 %49, 16
  %51 = trunc nuw i32 %50 to i16
  %52 = add nuw nsw i64 %38, %indvars.iv
  %53 = getelementptr inbounds i16, ptr %.08097, i64 %52
  store i16 %51, ptr %53, align 2, !tbaa !26
  %indvars.iv.next = or disjoint i64 %indvars.iv, 1
  %54 = getelementptr inbounds [8 x %struct.drflac_subframe], ptr %17, i64 0, i64 %indvars.iv.next
  %55 = getelementptr inbounds i8, ptr %54, i64 8
  %56 = load ptr, ptr %55, align 8, !tbaa !22
  %57 = getelementptr inbounds i32, ptr %56, i64 %.07894.us
  %58 = getelementptr inbounds i32, ptr %57, i64 %33
  %59 = load i32, ptr %58, align 4, !tbaa !24
  %60 = getelementptr inbounds i8, ptr %54, i64 1
  %61 = load i8, ptr %60, align 1, !tbaa !25
  %62 = zext i8 %61 to i32
  %63 = add nsw i32 %13, %62
  %64 = shl i32 %59, %63
  %65 = lshr i32 %64, 16
  %66 = trunc nuw i32 %65 to i16
  %67 = add nuw nsw i64 %38, %indvars.iv.next
  %68 = getelementptr inbounds i16, ptr %.08097, i64 %67
  store i16 %66, ptr %68, align 2, !tbaa !26
  %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
  %niter.next.1 = add i64 %niter, 2
  %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
  br i1 %niter.ncmp.1, label %._crit_edge.us.unr-lcssa, label %.preheader.us.new, !llvm.loop !27

._crit_edge.us.unr-lcssa:                         ; preds = %.preheader.us.new, %.preheader.us
  %indvars.iv.unr = phi i64 [ 0, %.preheader.us ], [ %indvars.iv.next.1, %.preheader.us.new ]
  br i1 %lcmp.mod.not, label %._crit_edge.us, label %._crit_edge.us.epilog-lcssa

._crit_edge.us.epilog-lcssa:                      ; preds = %._crit_edge.us.unr-lcssa
  %69 = getelementptr inbounds [8 x %struct.drflac_subframe], ptr %17, i64 0, i64 %indvars.iv.unr
  %70 = getelementptr inbounds i8, ptr %69, i64 8
  %71 = load ptr, ptr %70, align 8, !tbaa !22
  %72 = getelementptr inbounds i32, ptr %71, i64 %.07894.us
  %73 = getelementptr inbounds i32, ptr %72, i64 %33
  %74 = load i32, ptr %73, align 4, !tbaa !24
  %75 = getelementptr inbounds i8, ptr %69, i64 1
  %76 = load i8, ptr %75, align 1, !tbaa !25
  %77 = zext i8 %76 to i32
  %78 = add nsw i32 %13, %77
  %79 = shl i32 %74, %78
  %80 = lshr i32 %79, 16
  %81 = trunc nuw i32 %80 to i16
  %82 = add nuw nsw i64 %38, %indvars.iv.unr
  %83 = getelementptr inbounds i16, ptr %.08097, i64 %82
  store i16 %81, ptr %83, align 2, !tbaa !26
  br label %._crit_edge.us

._crit_edge.us:                                   ; preds = %._crit_edge.us.unr-lcssa, %._crit_edge.us.epilog-lcssa
  %84 = add nuw nsw i64 %.07894.us, 1
  %exitcond107.not = icmp eq i64 %84, %umax
  br i1 %exitcond107.not, label %.loopexit, label %.preheader.us, !llvm.loop !29

85:                                               ; preds = %26
  %86 = load ptr, ptr %18, align 8, !tbaa !22
  %87 = getelementptr inbounds i32, ptr %86, i64 %33
  %88 = load ptr, ptr %19, align 8, !tbaa !22
  %89 = getelementptr inbounds i32, ptr %88, i64 %33
  %90 = load i8, ptr %15, align 2, !tbaa !20
  switch i8 %90, label %94 [
    i8 8, label %91
    i8 9, label %92
    i8 10, label %93
  ]

91:                                               ; preds = %85
  tail call void @_ZL44drflac_read_pcm_frames_s16__decode_left_sideP6drflacmiPKiS2_Ps(ptr noundef nonnull %0, i64 noundef %spec.select, i32 noundef %13, ptr noundef %87, ptr noundef %89, ptr noundef %.08097)
  br label %.loopexit

92:                                               ; preds = %85
  tail call void @_ZL45drflac_read_pcm_frames_s16__decode_right_sideP6drflacmiPKiS2_Ps(ptr noundef nonnull %0, i64 noundef %spec.select, i32 noundef %13, ptr noundef %87, ptr noundef %89, ptr noundef %.08097)
  br label %.loopexit

93:                                               ; preds = %85
  tail call void @_ZL43drflac_read_pcm_frames_s16__decode_mid_sideP6drflacmiPKiS2_Ps(ptr noundef nonnull %0, i64 noundef %spec.select, i32 noundef %13, ptr noundef %87, ptr noundef %89, ptr noundef %.08097)
  br label %.loopexit

94:                                               ; preds = %85
  tail call void @_ZL53drflac_read_pcm_frames_s16__decode_independent_stereoP6drflacmiPKiS2_Ps(ptr noundef nonnull %0, i64 noundef %spec.select, i32 noundef %13, ptr noundef %87, ptr noundef %89, ptr noundef %.08097)
  br label %.loopexit

.loopexit:                                        ; preds = %._crit_edge.us, %.preheader.lr.ph, %.preheader91, %91, %92, %93, %94
  %95 = add i64 %spec.select, %.08396
  %96 = zext i8 %28 to i64
  %97 = mul nuw nsw i64 %spec.select, %96
  %98 = getelementptr inbounds i16, ptr %.08097, i64 %97
  %99 = sub i64 %.079100, %spec.select
  %100 = load i64, ptr %20, align 8, !tbaa !30
  %101 = add i64 %100, %spec.select
  store i64 %101, ptr %20, align 8, !tbaa !30
  %102 = trunc nuw i64 %spec.select to i32
  %103 = load i32, ptr %14, align 8, !tbaa !19
  %104 = sub i32 %103, %102
  store i32 %104, ptr %14, align 8, !tbaa !19
  br label %105

105:                                              ; preds = %24, %.loopexit
  %.184 = phi i64 [ %.08396, %24 ], [ %95, %.loopexit ]
  %.181 = phi ptr [ %.08097, %24 ], [ %98, %.loopexit ]
  %.1 = phi i64 [ %.079100, %24 ], [ %99, %.loopexit ]
  %.not = icmp eq i64 %.1, 0
  br i1 %.not, label %.loopexit92, label %21, !llvm.loop !31

.loopexit92:                                      ; preds = %24, %105, %3, %8
  %.0 = phi i64 [ %9, %8 ], [ 0, %3 ], [ %.08396, %24 ], [ %.184, %105 ]
  ret i64 %.0
}

; Function Attrs: alwaysinline mustprogress uwtable
declare hidden void @_ZL44drflac_read_pcm_frames_s16__decode_left_sideP6drflacmiPKiS2_Ps(ptr noundef, i64 noundef, i32 noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: alwaysinline mustprogress uwtable
declare hidden void @_ZL45drflac_read_pcm_frames_s16__decode_right_sideP6drflacmiPKiS2_Ps(ptr noundef, i64 noundef, i32 noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: alwaysinline mustprogress uwtable
declare hidden void @_ZL43drflac_read_pcm_frames_s16__decode_mid_sideP6drflacmiPKiS2_Ps(ptr noundef, i64 noundef, i32 noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: alwaysinline mustprogress uwtable
declare hidden void @_ZL53drflac_read_pcm_frames_s16__decode_independent_stereoP6drflacmiPKiS2_Ps(ptr noundef, i64 noundef, i32 noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.umin.i64(i64, i64) #3

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.umax.i64(i64, i64) #3

attributes #0 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { alwaysinline mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { alwaysinline mustprogress 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 #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }

!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, !8, i64 53}
!6 = !{!"_ZTS6drflac", !7, i64 0, !7, i64 8, !10, i64 16, !11, i64 48, !8, i64 52, !8, i64 53, !12, i64 54, !13, i64 56, !14, i64 64, !11, i64 68, !15, i64 72, !13, i64 232, !13, i64 240, !17, i64 248, !7, i64 272, !7, i64 280, !7, i64 288, !11, i64 296, !11, i64 296, !11, i64 296, !18, i64 304, !8, i64 4480}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"_ZTS27drflac_allocation_callbacks", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24}
!11 = !{!"int", !8, i64 0}
!12 = !{!"short", !8, i64 0}
!13 = !{!"long", !8, i64 0}
!14 = !{!"_ZTS16drflac_container", !8, i64 0}
!15 = !{!"_ZTS12drflac_frame", !16, i64 0, !11, i64 24, !8, i64 32}
!16 = !{!"_ZTS19drflac_frame_header", !13, i64 0, !11, i64 8, !11, i64 12, !12, i64 16, !8, i64 18, !8, i64 19, !8, i64 20}
!17 = !{!"_ZTS21drflac__memory_stream", !7, i64 0, !13, i64 8, !13, i64 16}
!18 = !{!"_ZTS9drflac_bs", !7, i64 0, !7, i64 8, !7, i64 16, !13, i64 24, !13, i64 32, !11, i64 40, !11, i64 44, !8, i64 48, !13, i64 4144, !12, i64 4152, !13, i64 4160, !11, i64 4168}
!19 = !{!6, !11, i64 96}
!20 = !{!6, !8, i64 90}
!21 = !{!6, !12, i64 88}
!22 = !{!23, !7, i64 8}
!23 = !{!"_ZTS15drflac_subframe", !8, i64 0, !8, i64 1, !8, i64 2, !7, i64 8}
!24 = !{!11, !11, i64 0}
!25 = !{!23, !8, i64 1}
!26 = !{!12, !12, i64 0}
!27 = distinct !{!27, !28}
!28 = !{!"llvm.loop.mustprogress"}
!29 = distinct !{!29, !28}
!30 = !{!6, !13, i64 232}
!31 = distinct !{!31, !28}


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