; 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_f32(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
  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
  %18 = load ptr, ptr %5, align 8, !tbaa !5
  %19 = icmp eq ptr %18, null
  br i1 %19, label %23, label %20

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

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

24:                                               ; preds = %20
  %25 = load ptr, ptr %7, align 8, !tbaa !5
  %26 = icmp eq ptr %25, null
  br i1 %26, label %27, label %31

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

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

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

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

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

50:                                               ; preds = %46
  br label %225

51:                                               ; preds = %46
  br label %224

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

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

86:                                               ; preds = %80, %52
  %87 = load i32, ptr %11, align 4, !tbaa !21
  %88 = icmp eq i32 %87, 2
  br i1 %88, label %89, label %142

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

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

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

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

133:                                              ; preds = %89
  br label %134

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

141:                                              ; preds = %134, %126, %119, %112
  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

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

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

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

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

152:                                              ; preds = %148
  %153 = load ptr, ptr %5, align 8, !tbaa !5
  %154 = getelementptr inbounds %struct.drflac, ptr %153, i32 0, i32 10
  %155 = getelementptr inbounds %struct.drflac_frame, ptr %154, i32 0, i32 2
  %156 = load i32, ptr %17, align 4, !tbaa !21
  %157 = zext i32 %156 to i64
  %158 = getelementptr inbounds [8 x %struct.drflac_subframe], ptr %155, i64 0, i64 %157
  %159 = getelementptr inbounds %struct.drflac_subframe, ptr %158, i32 0, i32 3
  %160 = load ptr, ptr %159, align 8, !tbaa !25
  %161 = load i64, ptr %12, align 8, !tbaa !9
  %162 = load i64, ptr %16, align 8, !tbaa !9
  %163 = add i64 %161, %162
  %164 = getelementptr inbounds i32, ptr %160, i64 %163
  %165 = load i32, ptr %164, align 4, !tbaa !21
  %166 = load i32, ptr %9, align 4, !tbaa !21
  %167 = load ptr, ptr %5, align 8, !tbaa !5
  %168 = getelementptr inbounds %struct.drflac, ptr %167, i32 0, i32 10
  %169 = getelementptr inbounds %struct.drflac_frame, ptr %168, i32 0, i32 2
  %170 = load i32, ptr %17, align 4, !tbaa !21
  %171 = zext i32 %170 to i64
  %172 = getelementptr inbounds [8 x %struct.drflac_subframe], ptr %169, i64 0, i64 %171
  %173 = getelementptr inbounds %struct.drflac_subframe, ptr %172, i32 0, i32 1
  %174 = load i8, ptr %173, align 1, !tbaa !27
  %175 = zext i8 %174 to i32
  %176 = add nsw i32 %166, %175
  %177 = shl i32 %165, %176
  %178 = sext i32 %177 to i64
  %179 = uitofp i64 %178 to double
  %180 = fdiv double %179, 0x41E0000000000000
  %181 = fptrunc double %180 to float
  %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 float, ptr %182, i64 %189
  store float %181, ptr %190, align 4, !tbaa !28
  br label %191

191:                                              ; preds = %152
  %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 %148, !llvm.loop !30

194:                                              ; preds = %148
  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 %143, !llvm.loop !32

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

199:                                              ; preds = %198, %141
  %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 float, 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 !33
  %216 = add i64 %215, %212
  store i64 %216, ptr %214, align 8, !tbaa !33
  %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, %51
  br label %37, !llvm.loop !34

225:                                              ; preds = %50, %37
  %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, %27, %23
  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_f32__decode_left_sideP6drflacmiPKiS2_Pf(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_f32__decode_right_sideP6drflacmiPKiS2_Pf(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_f32__decode_mid_sideP6drflacmiPKiS2_Pf(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_f32__decode_independent_stereoP6drflacmiPKiS2_Pf(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 = !{!29, !29, i64 0}
!29 = !{!"float", !7, i64 0}
!30 = distinct !{!30, !31}
!31 = !{!"llvm.loop.mustprogress"}
!32 = distinct !{!32, !31}
!33 = !{!12, !10, i64 232}
!34 = distinct !{!34, !31}


; 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_f32(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 %.loopexit91, 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 %.loopexit91

.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, %77
  %.07899 = phi i64 [ %1, %.lr.ph ], [ %.1, %77 ]
  %.08096 = phi ptr [ %2, %.lr.ph ], [ %.181, %77 ]
  %.08295 = phi i64 [ 0, %.lr.ph ], [ %.183, %77 ]
  %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)
  %.not89 = icmp eq i32 %25, 0
  br i1 %.not89, label %.loopexit91, label %77

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 %.07899, i64 %34)
  %35 = icmp eq i8 %28, 2
  br i1 %35, label %57, label %.preheader90

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

.preheader.lr.ph:                                 ; preds = %.preheader90
  %.not103 = icmp eq i8 %28, 0
  %36 = zext i8 %28 to i64
  br i1 %.not103, 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
  br label %.preheader.us

.preheader.us:                                    ; preds = %.preheader.us.preheader, %._crit_edge.us
  %.07693.us = phi i64 [ %56, %._crit_edge.us ], [ 0, %.preheader.us.preheader ]
  %37 = mul nuw nsw i64 %.07693.us, %36
  br label %38

38:                                               ; preds = %.preheader.us, %38
  %indvars.iv = phi i64 [ 0, %.preheader.us ], [ %indvars.iv.next, %38 ]
  %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 %.07693.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 = sext i32 %49 to i64
  %51 = uitofp i64 %50 to double
  %52 = fmul double %51, 0x3E00000000000000
  %53 = fptrunc double %52 to float
  %54 = add nuw nsw i64 %37, %indvars.iv
  %55 = getelementptr inbounds float, ptr %.08096, i64 %54
  store float %53, ptr %55, align 4, !tbaa !26
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge.us, label %38, !llvm.loop !28

._crit_edge.us:                                   ; preds = %38
  %56 = add nuw nsw i64 %.07693.us, 1
  %exitcond106.not = icmp eq i64 %56, %umax
  br i1 %exitcond106.not, label %.loopexit, label %.preheader.us, !llvm.loop !30

57:                                               ; preds = %26
  %58 = load ptr, ptr %18, align 8, !tbaa !22
  %59 = getelementptr inbounds i32, ptr %58, i64 %33
  %60 = load ptr, ptr %19, align 8, !tbaa !22
  %61 = getelementptr inbounds i32, ptr %60, i64 %33
  %62 = load i8, ptr %15, align 2, !tbaa !20
  switch i8 %62, label %66 [
    i8 8, label %63
    i8 9, label %64
    i8 10, label %65
  ]

63:                                               ; preds = %57
  tail call void @_ZL44drflac_read_pcm_frames_f32__decode_left_sideP6drflacmiPKiS2_Pf(ptr noundef nonnull %0, i64 noundef %spec.select, i32 noundef %13, ptr noundef %59, ptr noundef %61, ptr noundef %.08096)
  br label %.loopexit

64:                                               ; preds = %57
  tail call void @_ZL45drflac_read_pcm_frames_f32__decode_right_sideP6drflacmiPKiS2_Pf(ptr noundef nonnull %0, i64 noundef %spec.select, i32 noundef %13, ptr noundef %59, ptr noundef %61, ptr noundef %.08096)
  br label %.loopexit

65:                                               ; preds = %57
  tail call void @_ZL43drflac_read_pcm_frames_f32__decode_mid_sideP6drflacmiPKiS2_Pf(ptr noundef nonnull %0, i64 noundef %spec.select, i32 noundef %13, ptr noundef %59, ptr noundef %61, ptr noundef %.08096)
  br label %.loopexit

66:                                               ; preds = %57
  tail call void @_ZL53drflac_read_pcm_frames_f32__decode_independent_stereoP6drflacmiPKiS2_Pf(ptr noundef nonnull %0, i64 noundef %spec.select, i32 noundef %13, ptr noundef %59, ptr noundef %61, ptr noundef %.08096)
  br label %.loopexit

.loopexit:                                        ; preds = %._crit_edge.us, %.preheader.lr.ph, %.preheader90, %63, %64, %65, %66
  %67 = add i64 %spec.select, %.08295
  %68 = zext i8 %28 to i64
  %69 = mul nuw nsw i64 %spec.select, %68
  %70 = getelementptr inbounds float, ptr %.08096, i64 %69
  %71 = sub i64 %.07899, %spec.select
  %72 = load i64, ptr %20, align 8, !tbaa !31
  %73 = add i64 %72, %spec.select
  store i64 %73, ptr %20, align 8, !tbaa !31
  %74 = trunc nuw i64 %spec.select to i32
  %75 = load i32, ptr %14, align 8, !tbaa !19
  %76 = sub i32 %75, %74
  store i32 %76, ptr %14, align 8, !tbaa !19
  br label %77

77:                                               ; preds = %24, %.loopexit
  %.183 = phi i64 [ %.08295, %24 ], [ %67, %.loopexit ]
  %.181 = phi ptr [ %.08096, %24 ], [ %70, %.loopexit ]
  %.1 = phi i64 [ %.07899, %24 ], [ %71, %.loopexit ]
  %.not = icmp eq i64 %.1, 0
  br i1 %.not, label %.loopexit91, label %21, !llvm.loop !32

.loopexit91:                                      ; preds = %24, %77, %3, %8
  %.077 = phi i64 [ %9, %8 ], [ 0, %3 ], [ %.08295, %24 ], [ %.183, %77 ]
  ret i64 %.077
}

; Function Attrs: alwaysinline mustprogress uwtable
declare hidden void @_ZL44drflac_read_pcm_frames_f32__decode_left_sideP6drflacmiPKiS2_Pf(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_f32__decode_right_sideP6drflacmiPKiS2_Pf(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_f32__decode_mid_sideP6drflacmiPKiS2_Pf(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_f32__decode_independent_stereoP6drflacmiPKiS2_Pf(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 = !{!27, !27, i64 0}
!27 = !{!"float", !8, i64 0}
!28 = distinct !{!28, !29}
!29 = !{!"llvm.loop.mustprogress"}
!30 = distinct !{!30, !29}
!31 = !{!6, !13, i64 232}
!32 = distinct !{!32, !29}


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