; LLVM IR from SelfishOlex/MiniAudioO3DE :: MiniAudio/Code/Source/Clients (MiniAudioImplementation)

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

@.str.6 = external hidden unnamed_addr constant [104 x i8], align 1
@.str.170 = external hidden unnamed_addr constant [27 x i8], align 1
@__PRETTY_FUNCTION__.drflac_read_pcm_frames_f32 = external hidden unnamed_addr constant [75 x i8], align 1

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

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

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #1

; Function Attrs: mustprogress uwtable
define dso_local i64 @drflac_read_pcm_frames_f32(ptr noundef %0, i64 noundef %1, ptr noundef %2) #2 {
  %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) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  %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 %237

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 @_ZL34drflac__seek_forward_by_pcm_framesP6drflacy(ptr noundef %29, i64 noundef %30)
  store i64 %31, ptr %4, align 8
  store i32 1, ptr %10, align 4
  br label %237

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 = icmp sle i32 %36, 32
  br i1 %37, label %38, label %39

38:                                               ; preds = %32
  br label %41

39:                                               ; preds = %32
  call void @__assert_fail(ptr noundef @.str.170, ptr noundef @.str.6, i32 noundef 86698, ptr noundef @__PRETTY_FUNCTION__.drflac_read_pcm_frames_f32) #6
  unreachable

40:                                               ; No predecessors!
  br label %41

41:                                               ; preds = %40, %38
  %42 = load ptr, ptr %5, align 8, !tbaa !5
  %43 = getelementptr inbounds %struct.drflac, ptr %42, i32 0, i32 5
  %44 = load i8, ptr %43, align 1, !tbaa !11
  %45 = zext i8 %44 to i32
  %46 = sub nsw i32 32, %45
  store i32 %46, ptr %9, align 4, !tbaa !22
  store i64 0, ptr %8, align 8, !tbaa !9
  br label %47

47:                                               ; preds = %234, %41
  %48 = load i64, ptr %6, align 8, !tbaa !9
  %49 = icmp ugt i64 %48, 0
  br i1 %49, label %50, label %235

50:                                               ; preds = %47
  %51 = load ptr, ptr %5, align 8, !tbaa !5
  %52 = getelementptr inbounds %struct.drflac, ptr %51, i32 0, i32 10
  %53 = getelementptr inbounds %struct.drflac_frame, ptr %52, i32 0, i32 1
  %54 = load i32, ptr %53, align 8, !tbaa !23
  %55 = icmp eq i32 %54, 0
  br i1 %55, label %56, label %62

56:                                               ; preds = %50
  %57 = load ptr, ptr %5, align 8, !tbaa !5
  %58 = call noundef i32 @_ZL39drflac__read_and_decode_next_flac_frameP6drflac(ptr noundef %57)
  %59 = icmp ne i32 %58, 0
  br i1 %59, label %61, label %60

60:                                               ; preds = %56
  br label %235

61:                                               ; preds = %56
  br label %234

62:                                               ; preds = %50
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  %63 = load ptr, ptr %5, align 8, !tbaa !5
  %64 = getelementptr inbounds %struct.drflac, ptr %63, i32 0, i32 10
  %65 = getelementptr inbounds %struct.drflac_frame, ptr %64, i32 0, i32 0
  %66 = getelementptr inbounds %struct.drflac_frame_header, ptr %65, i32 0, i32 4
  %67 = load i8, ptr %66, align 2, !tbaa !24
  %68 = call noundef zeroext i8 @_ZL49drflac__get_channel_count_from_channel_assignmenta(i8 noundef signext %67)
  %69 = zext i8 %68 to i32
  store i32 %69, ptr %11, align 4, !tbaa !22
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  %70 = load ptr, ptr %5, align 8, !tbaa !5
  %71 = getelementptr inbounds %struct.drflac, ptr %70, i32 0, i32 10
  %72 = getelementptr inbounds %struct.drflac_frame, ptr %71, i32 0, i32 0
  %73 = getelementptr inbounds %struct.drflac_frame_header, ptr %72, i32 0, i32 3
  %74 = load i16, ptr %73, align 8, !tbaa !25
  %75 = zext i16 %74 to i32
  %76 = load ptr, ptr %5, align 8, !tbaa !5
  %77 = getelementptr inbounds %struct.drflac, ptr %76, i32 0, i32 10
  %78 = getelementptr inbounds %struct.drflac_frame, ptr %77, i32 0, i32 1
  %79 = load i32, ptr %78, align 8, !tbaa !23
  %80 = sub i32 %75, %79
  %81 = zext i32 %80 to i64
  store i64 %81, ptr %12, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #5
  %82 = load i64, ptr %6, align 8, !tbaa !9
  store i64 %82, ptr %13, align 8, !tbaa !9
  %83 = load i64, ptr %13, align 8, !tbaa !9
  %84 = load ptr, ptr %5, align 8, !tbaa !5
  %85 = getelementptr inbounds %struct.drflac, ptr %84, i32 0, i32 10
  %86 = getelementptr inbounds %struct.drflac_frame, ptr %85, i32 0, i32 1
  %87 = load i32, ptr %86, align 8, !tbaa !23
  %88 = zext i32 %87 to i64
  %89 = icmp ugt i64 %83, %88
  br i1 %89, label %90, label %96

90:                                               ; preds = %62
  %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 1
  %94 = load i32, ptr %93, align 8, !tbaa !23
  %95 = zext i32 %94 to i64
  store i64 %95, ptr %13, align 8, !tbaa !9
  br label %96

96:                                               ; preds = %90, %62
  %97 = load i32, ptr %11, align 4, !tbaa !22
  %98 = icmp eq i32 %97, 2
  br i1 %98, label %99, label %152

99:                                               ; preds = %96
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #5
  %100 = load ptr, ptr %5, align 8, !tbaa !5
  %101 = getelementptr inbounds %struct.drflac, ptr %100, i32 0, i32 10
  %102 = getelementptr inbounds %struct.drflac_frame, ptr %101, i32 0, i32 2
  %103 = getelementptr inbounds [8 x %struct.drflac_subframe], ptr %102, i64 0, i64 0
  %104 = getelementptr inbounds %struct.drflac_subframe, ptr %103, i32 0, i32 3
  %105 = load ptr, ptr %104, align 8, !tbaa !26
  %106 = load i64, ptr %12, align 8, !tbaa !9
  %107 = getelementptr inbounds i32, ptr %105, i64 %106
  store ptr %107, ptr %14, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #5
  %108 = load ptr, ptr %5, align 8, !tbaa !5
  %109 = getelementptr inbounds %struct.drflac, ptr %108, i32 0, i32 10
  %110 = getelementptr inbounds %struct.drflac_frame, ptr %109, i32 0, i32 2
  %111 = getelementptr inbounds [8 x %struct.drflac_subframe], ptr %110, i64 0, i64 1
  %112 = getelementptr inbounds %struct.drflac_subframe, ptr %111, i32 0, i32 3
  %113 = load ptr, ptr %112, align 8, !tbaa !26
  %114 = load i64, ptr %12, align 8, !tbaa !9
  %115 = getelementptr inbounds i32, ptr %113, i64 %114
  store ptr %115, ptr %15, align 8, !tbaa !5
  %116 = load ptr, ptr %5, align 8, !tbaa !5
  %117 = getelementptr inbounds %struct.drflac, ptr %116, i32 0, i32 10
  %118 = getelementptr inbounds %struct.drflac_frame, ptr %117, i32 0, i32 0
  %119 = getelementptr inbounds %struct.drflac_frame_header, ptr %118, i32 0, i32 4
  %120 = load i8, ptr %119, align 2, !tbaa !24
  %121 = zext i8 %120 to i32
  switch i32 %121, label %144 [
    i32 8, label %122
    i32 9, label %129
    i32 10, label %136
    i32 0, label %143
  ]

122:                                              ; preds = %99
  %123 = load ptr, ptr %5, align 8, !tbaa !5
  %124 = load i64, ptr %13, align 8, !tbaa !9
  %125 = load i32, ptr %9, align 4, !tbaa !22
  %126 = load ptr, ptr %14, align 8, !tbaa !5
  %127 = load ptr, ptr %15, align 8, !tbaa !5
  %128 = load ptr, ptr %7, align 8, !tbaa !5
  call void @_ZL44drflac_read_pcm_frames_f32__decode_left_sideP6drflacyjPKiS2_Pf(ptr noundef %123, i64 noundef %124, i32 noundef %125, ptr noundef %126, ptr noundef %127, ptr noundef %128)
  br label %151

129:                                              ; preds = %99
  %130 = load ptr, ptr %5, align 8, !tbaa !5
  %131 = load i64, ptr %13, align 8, !tbaa !9
  %132 = load i32, ptr %9, align 4, !tbaa !22
  %133 = load ptr, ptr %14, align 8, !tbaa !5
  %134 = load ptr, ptr %15, align 8, !tbaa !5
  %135 = load ptr, ptr %7, align 8, !tbaa !5
  call void @_ZL45drflac_read_pcm_frames_f32__decode_right_sideP6drflacyjPKiS2_Pf(ptr noundef %130, i64 noundef %131, i32 noundef %132, ptr noundef %133, ptr noundef %134, ptr noundef %135)
  br label %151

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

143:                                              ; preds = %99
  br label %144

144:                                              ; preds = %143, %99
  %145 = load ptr, ptr %5, align 8, !tbaa !5
  %146 = load i64, ptr %13, align 8, !tbaa !9
  %147 = load i32, ptr %9, align 4, !tbaa !22
  %148 = load ptr, ptr %14, align 8, !tbaa !5
  %149 = load ptr, ptr %15, align 8, !tbaa !5
  %150 = load ptr, ptr %7, align 8, !tbaa !5
  call void @_ZL53drflac_read_pcm_frames_f32__decode_independent_stereoP6drflacyjPKiS2_Pf(ptr noundef %145, i64 noundef %146, i32 noundef %147, ptr noundef %148, ptr noundef %149, ptr noundef %150)
  br label %151

151:                                              ; preds = %144, %136, %129, %122
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  br label %209

152:                                              ; preds = %96
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #5
  store i64 0, ptr %16, align 8, !tbaa !9
  br label %153

153:                                              ; preds = %205, %152
  %154 = load i64, ptr %16, align 8, !tbaa !9
  %155 = load i64, ptr %13, align 8, !tbaa !9
  %156 = icmp ult i64 %154, %155
  br i1 %156, label %157, label %208

157:                                              ; preds = %153
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #5
  store i32 0, ptr %17, align 4, !tbaa !22
  br label %158

158:                                              ; preds = %201, %157
  %159 = load i32, ptr %17, align 4, !tbaa !22
  %160 = load i32, ptr %11, align 4, !tbaa !22
  %161 = icmp ult i32 %159, %160
  br i1 %161, label %162, label %204

162:                                              ; preds = %158
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #5
  %163 = load ptr, ptr %5, align 8, !tbaa !5
  %164 = getelementptr inbounds %struct.drflac, ptr %163, i32 0, i32 10
  %165 = getelementptr inbounds %struct.drflac_frame, ptr %164, i32 0, i32 2
  %166 = load i32, ptr %17, align 4, !tbaa !22
  %167 = zext i32 %166 to i64
  %168 = getelementptr inbounds [8 x %struct.drflac_subframe], ptr %165, i64 0, i64 %167
  %169 = getelementptr inbounds %struct.drflac_subframe, ptr %168, i32 0, i32 3
  %170 = load ptr, ptr %169, align 8, !tbaa !26
  %171 = load i64, ptr %12, align 8, !tbaa !9
  %172 = load i64, ptr %16, align 8, !tbaa !9
  %173 = add i64 %171, %172
  %174 = getelementptr inbounds i32, ptr %170, i64 %173
  %175 = load i32, ptr %174, align 4, !tbaa !22
  %176 = load i32, ptr %9, align 4, !tbaa !22
  %177 = load ptr, ptr %5, align 8, !tbaa !5
  %178 = getelementptr inbounds %struct.drflac, ptr %177, i32 0, i32 10
  %179 = getelementptr inbounds %struct.drflac_frame, ptr %178, i32 0, i32 2
  %180 = load i32, ptr %17, align 4, !tbaa !22
  %181 = zext i32 %180 to i64
  %182 = getelementptr inbounds [8 x %struct.drflac_subframe], ptr %179, i64 0, i64 %181
  %183 = getelementptr inbounds %struct.drflac_subframe, ptr %182, i32 0, i32 1
  %184 = load i8, ptr %183, align 1, !tbaa !28
  %185 = zext i8 %184 to i32
  %186 = add i32 %176, %185
  %187 = shl i32 %175, %186
  store i32 %187, ptr %18, align 4, !tbaa !22
  %188 = load i32, ptr %18, align 4, !tbaa !22
  %189 = sitofp i32 %188 to double
  %190 = fdiv double %189, 0x41E0000000000000
  %191 = fptrunc double %190 to float
  %192 = load ptr, ptr %7, align 8, !tbaa !5
  %193 = load i64, ptr %16, align 8, !tbaa !9
  %194 = load i32, ptr %11, align 4, !tbaa !22
  %195 = zext i32 %194 to i64
  %196 = mul i64 %193, %195
  %197 = load i32, ptr %17, align 4, !tbaa !22
  %198 = zext i32 %197 to i64
  %199 = add i64 %196, %198
  %200 = getelementptr inbounds float, ptr %192, i64 %199
  store float %191, ptr %200, align 4, !tbaa !29
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #5
  br label %201

201:                                              ; preds = %162
  %202 = load i32, ptr %17, align 4, !tbaa !22
  %203 = add i32 %202, 1
  store i32 %203, ptr %17, align 4, !tbaa !22
  br label %158, !llvm.loop !31

204:                                              ; preds = %158
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #5
  br label %205

205:                                              ; preds = %204
  %206 = load i64, ptr %16, align 8, !tbaa !9
  %207 = add i64 %206, 1
  store i64 %207, ptr %16, align 8, !tbaa !9
  br label %153, !llvm.loop !33

208:                                              ; preds = %153
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #5
  br label %209

209:                                              ; preds = %208, %151
  %210 = load i64, ptr %13, align 8, !tbaa !9
  %211 = load i64, ptr %8, align 8, !tbaa !9
  %212 = add i64 %211, %210
  store i64 %212, ptr %8, align 8, !tbaa !9
  %213 = load i64, ptr %13, align 8, !tbaa !9
  %214 = load i32, ptr %11, align 4, !tbaa !22
  %215 = zext i32 %214 to i64
  %216 = mul i64 %213, %215
  %217 = load ptr, ptr %7, align 8, !tbaa !5
  %218 = getelementptr inbounds float, ptr %217, i64 %216
  store ptr %218, ptr %7, align 8, !tbaa !5
  %219 = load i64, ptr %13, align 8, !tbaa !9
  %220 = load i64, ptr %6, align 8, !tbaa !9
  %221 = sub i64 %220, %219
  store i64 %221, ptr %6, align 8, !tbaa !9
  %222 = load i64, ptr %13, align 8, !tbaa !9
  %223 = load ptr, ptr %5, align 8, !tbaa !5
  %224 = getelementptr inbounds %struct.drflac, ptr %223, i32 0, i32 11
  %225 = load i64, ptr %224, align 8, !tbaa !34
  %226 = add i64 %225, %222
  store i64 %226, ptr %224, align 8, !tbaa !34
  %227 = load i64, ptr %13, align 8, !tbaa !9
  %228 = trunc i64 %227 to i32
  %229 = load ptr, ptr %5, align 8, !tbaa !5
  %230 = getelementptr inbounds %struct.drflac, ptr %229, i32 0, i32 10
  %231 = getelementptr inbounds %struct.drflac_frame, ptr %230, i32 0, i32 1
  %232 = load i32, ptr %231, align 8, !tbaa !23
  %233 = sub i32 %232, %228
  store i32 %233, ptr %231, align 8, !tbaa !23
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  br label %234

234:                                              ; preds = %209, %61
  br label %47, !llvm.loop !35

235:                                              ; preds = %60, %47
  %236 = load i64, ptr %8, align 8, !tbaa !9
  store i64 %236, ptr %4, align 8
  store i32 1, ptr %10, align 4
  br label %237

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

; Function Attrs: mustprogress uwtable
declare hidden noundef i64 @_ZL34drflac__seek_forward_by_pcm_framesP6drflacy(ptr noundef, i64 noundef) #2

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

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

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

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

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

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { noreturn 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 = { 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 = { 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 #4 = { 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 #5 = { nounwind }
attributes #6 = { noreturn 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 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, !21, 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, !20, i64 8, !20, i64 16}
!20 = !{!"long", !7, i64 0}
!21 = !{!"_ZTS9drflac_bs", !6, i64 0, !6, i64 8, !6, i64 16, !20, 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}
!22 = !{!14, !14, i64 0}
!23 = !{!12, !14, i64 96}
!24 = !{!12, !7, i64 90}
!25 = !{!12, !15, i64 88}
!26 = !{!27, !6, i64 8}
!27 = !{!"_ZTS15drflac_subframe", !7, i64 0, !7, i64 1, !7, i64 2, !6, i64 8}
!28 = !{!27, !7, i64 1}
!29 = !{!30, !30, i64 0}
!30 = !{!"float", !7, i64 0}
!31 = distinct !{!31, !32}
!32 = !{!"llvm.loop.mustprogress"}
!33 = distinct !{!33, !32}
!34 = !{!12, !10, i64 232}
!35 = distinct !{!35, !32}


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

@.str.6 = external hidden unnamed_addr constant [104 x i8], align 1
@.str.170 = external hidden unnamed_addr constant [27 x i8], align 1
@__PRETTY_FUNCTION__.drflac_read_pcm_frames_f32 = external hidden unnamed_addr constant [75 x i8], align 1

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #0

; 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 #1 {
  %4 = icmp eq ptr %0, null
  %5 = icmp eq i64 %1, 0
  %or.cond = or i1 %4, %5
  br i1 %or.cond, label %.loopexit94, label %6

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

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

10:                                               ; preds = %6
  %11 = getelementptr inbounds i8, ptr %0, i64 53
  %12 = load i8, ptr %11, align 1, !tbaa !5
  %13 = icmp ult i8 %12, 33
  br i1 %13, label %.lr.ph, label %14

14:                                               ; preds = %10
  tail call void @__assert_fail(ptr noundef nonnull @.str.170, ptr noundef nonnull @.str.6, i32 noundef 86698, ptr noundef nonnull @__PRETTY_FUNCTION__.drflac_read_pcm_frames_f32) #5
  unreachable

.lr.ph:                                           ; preds = %10
  %15 = zext nneg i8 %12 to i32
  %16 = sub nuw nsw i32 32, %15
  %17 = getelementptr inbounds i8, ptr %0, i64 96
  %18 = getelementptr inbounds i8, ptr %0, i64 90
  %19 = getelementptr inbounds i8, ptr %0, i64 88
  %20 = getelementptr inbounds i8, ptr %0, i64 104
  %21 = getelementptr inbounds i8, ptr %0, i64 112
  %22 = getelementptr inbounds i8, ptr %0, i64 128
  %23 = getelementptr inbounds i8, ptr %0, i64 232
  br label %24

24:                                               ; preds = %.lr.ph, %111
  %.080102 = phi i64 [ %1, %.lr.ph ], [ %.1, %111 ]
  %.08199 = phi ptr [ %2, %.lr.ph ], [ %.182, %111 ]
  %.08498 = phi i64 [ 0, %.lr.ph ], [ %.185, %111 ]
  %25 = load i32, ptr %17, align 8, !tbaa !20
  %26 = icmp eq i32 %25, 0
  br i1 %26, label %27, label %29

27:                                               ; preds = %24
  %28 = tail call noundef i32 @_ZL39drflac__read_and_decode_next_flac_frameP6drflac(ptr noundef nonnull %0)
  %.not92 = icmp eq i32 %28, 0
  br i1 %.not92, label %.loopexit94, label %111

29:                                               ; preds = %24
  %30 = load i8, ptr %18, align 2, !tbaa !21
  %31 = tail call noundef zeroext i8 @_ZL49drflac__get_channel_count_from_channel_assignmenta(i8 noundef signext %30)
  %32 = load i16, ptr %19, align 8, !tbaa !22
  %33 = zext i16 %32 to i32
  %34 = load i32, ptr %17, align 8, !tbaa !20
  %35 = sub i32 %33, %34
  %36 = zext i32 %35 to i64
  %37 = zext i32 %34 to i64
  %spec.select = tail call i64 @llvm.umin.i64(i64 %.080102, i64 %37)
  %38 = icmp eq i8 %31, 2
  br i1 %38, label %91, label %.preheader93

.preheader93:                                     ; preds = %29
  %.not105 = icmp eq i32 %34, 0
  br i1 %.not105, label %.loopexit, label %.preheader.lr.ph

.preheader.lr.ph:                                 ; preds = %.preheader93
  %.not106 = icmp eq i8 %31, 0
  %39 = zext i8 %31 to i64
  br i1 %.not106, 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 %31 to i64
  %xtraiter = and i64 %wide.trip.count, 1
  %40 = icmp eq i8 %31, 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
  %.07996.us = phi i64 [ %90, %._crit_edge.us ], [ 0, %.preheader.us.preheader ]
  %41 = mul nuw nsw i64 %.07996.us, %39
  br i1 %40, 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 ]
  %42 = getelementptr inbounds [8 x %struct.drflac_subframe], ptr %20, i64 0, i64 %indvars.iv
  %43 = getelementptr inbounds i8, ptr %42, i64 8
  %44 = load ptr, ptr %43, align 8, !tbaa !23
  %45 = getelementptr inbounds i32, ptr %44, i64 %.07996.us
  %46 = getelementptr inbounds i32, ptr %45, i64 %36
  %47 = load i32, ptr %46, align 4, !tbaa !25
  %48 = getelementptr inbounds i8, ptr %42, i64 1
  %49 = load i8, ptr %48, align 1, !tbaa !26
  %50 = zext i8 %49 to i32
  %51 = add nuw nsw i32 %16, %50
  %52 = shl i32 %47, %51
  %53 = sitofp i32 %52 to double
  %54 = fmul double %53, 0x3E00000000000000
  %55 = fptrunc double %54 to float
  %56 = add nuw nsw i64 %41, %indvars.iv
  %57 = getelementptr inbounds float, ptr %.08199, i64 %56
  store float %55, ptr %57, align 4, !tbaa !27
  %indvars.iv.next = or disjoint i64 %indvars.iv, 1
  %58 = getelementptr inbounds [8 x %struct.drflac_subframe], ptr %20, i64 0, i64 %indvars.iv.next
  %59 = getelementptr inbounds i8, ptr %58, i64 8
  %60 = load ptr, ptr %59, align 8, !tbaa !23
  %61 = getelementptr inbounds i32, ptr %60, i64 %.07996.us
  %62 = getelementptr inbounds i32, ptr %61, i64 %36
  %63 = load i32, ptr %62, align 4, !tbaa !25
  %64 = getelementptr inbounds i8, ptr %58, i64 1
  %65 = load i8, ptr %64, align 1, !tbaa !26
  %66 = zext i8 %65 to i32
  %67 = add nuw nsw i32 %16, %66
  %68 = shl i32 %63, %67
  %69 = sitofp i32 %68 to double
  %70 = fmul double %69, 0x3E00000000000000
  %71 = fptrunc double %70 to float
  %72 = add nuw nsw i64 %41, %indvars.iv.next
  %73 = getelementptr inbounds float, ptr %.08199, i64 %72
  store float %71, ptr %73, align 4, !tbaa !27
  %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 !29

._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
  %74 = getelementptr inbounds [8 x %struct.drflac_subframe], ptr %20, i64 0, i64 %indvars.iv.unr
  %75 = getelementptr inbounds i8, ptr %74, i64 8
  %76 = load ptr, ptr %75, align 8, !tbaa !23
  %77 = getelementptr inbounds i32, ptr %76, i64 %.07996.us
  %78 = getelementptr inbounds i32, ptr %77, i64 %36
  %79 = load i32, ptr %78, align 4, !tbaa !25
  %80 = getelementptr inbounds i8, ptr %74, i64 1
  %81 = load i8, ptr %80, align 1, !tbaa !26
  %82 = zext i8 %81 to i32
  %83 = add nuw nsw i32 %16, %82
  %84 = shl i32 %79, %83
  %85 = sitofp i32 %84 to double
  %86 = fmul double %85, 0x3E00000000000000
  %87 = fptrunc double %86 to float
  %88 = add nuw nsw i64 %41, %indvars.iv.unr
  %89 = getelementptr inbounds float, ptr %.08199, i64 %88
  store float %87, ptr %89, align 4, !tbaa !27
  br label %._crit_edge.us

._crit_edge.us:                                   ; preds = %._crit_edge.us.unr-lcssa, %._crit_edge.us.epilog-lcssa
  %90 = add nuw nsw i64 %.07996.us, 1
  %exitcond109.not = icmp eq i64 %90, %umax
  br i1 %exitcond109.not, label %.loopexit, label %.preheader.us, !llvm.loop !31

91:                                               ; preds = %29
  %92 = load ptr, ptr %21, align 8, !tbaa !23
  %93 = getelementptr inbounds i32, ptr %92, i64 %36
  %94 = load ptr, ptr %22, align 8, !tbaa !23
  %95 = getelementptr inbounds i32, ptr %94, i64 %36
  %96 = load i8, ptr %18, align 2, !tbaa !21
  switch i8 %96, label %100 [
    i8 8, label %97
    i8 9, label %98
    i8 10, label %99
  ]

97:                                               ; preds = %91
  tail call void @_ZL44drflac_read_pcm_frames_f32__decode_left_sideP6drflacyjPKiS2_Pf(ptr noundef nonnull %0, i64 noundef %spec.select, i32 noundef %16, ptr noundef %93, ptr noundef %95, ptr noundef %.08199)
  br label %.loopexit

98:                                               ; preds = %91
  tail call void @_ZL45drflac_read_pcm_frames_f32__decode_right_sideP6drflacyjPKiS2_Pf(ptr noundef nonnull %0, i64 noundef %spec.select, i32 noundef %16, ptr noundef %93, ptr noundef %95, ptr noundef %.08199)
  br label %.loopexit

99:                                               ; preds = %91
  tail call void @_ZL43drflac_read_pcm_frames_f32__decode_mid_sideP6drflacyjPKiS2_Pf(ptr noundef nonnull %0, i64 noundef %spec.select, i32 noundef %16, ptr noundef %93, ptr noundef %95, ptr noundef %.08199)
  br label %.loopexit

100:                                              ; preds = %91
  tail call void @_ZL53drflac_read_pcm_frames_f32__decode_independent_stereoP6drflacyjPKiS2_Pf(ptr noundef nonnull %0, i64 noundef %spec.select, i32 noundef %16, ptr noundef %93, ptr noundef %95, ptr noundef %.08199)
  br label %.loopexit

.loopexit:                                        ; preds = %._crit_edge.us, %.preheader.lr.ph, %.preheader93, %97, %98, %99, %100
  %101 = add i64 %spec.select, %.08498
  %102 = zext i8 %31 to i64
  %103 = mul nuw nsw i64 %spec.select, %102
  %104 = getelementptr inbounds float, ptr %.08199, i64 %103
  %105 = sub i64 %.080102, %spec.select
  %106 = load i64, ptr %23, align 8, !tbaa !32
  %107 = add i64 %106, %spec.select
  store i64 %107, ptr %23, align 8, !tbaa !32
  %108 = trunc nuw i64 %spec.select to i32
  %109 = load i32, ptr %17, align 8, !tbaa !20
  %110 = sub i32 %109, %108
  store i32 %110, ptr %17, align 8, !tbaa !20
  br label %111

111:                                              ; preds = %27, %.loopexit
  %.185 = phi i64 [ %.08498, %27 ], [ %101, %.loopexit ]
  %.182 = phi ptr [ %.08199, %27 ], [ %104, %.loopexit ]
  %.1 = phi i64 [ %.080102, %27 ], [ %105, %.loopexit ]
  %.not = icmp eq i64 %.1, 0
  br i1 %.not, label %.loopexit94, label %24, !llvm.loop !33

.loopexit94:                                      ; preds = %27, %111, %3, %8
  %.0 = phi i64 [ %9, %8 ], [ 0, %3 ], [ %.08498, %27 ], [ %.185, %111 ]
  ret i64 %.0
}

; Function Attrs: mustprogress uwtable
declare hidden noundef i64 @_ZL34drflac__seek_forward_by_pcm_framesP6drflacy(ptr noundef, i64 noundef) local_unnamed_addr #1

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

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

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

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

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

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

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

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

attributes #0 = { noreturn 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 #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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { noreturn 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, !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, !19, 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 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, !18, i64 8, !18, i64 16}
!18 = !{!"long", !8, i64 0}
!19 = !{!"_ZTS9drflac_bs", !7, i64 0, !7, i64 8, !7, i64 16, !18, 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}
!20 = !{!6, !11, i64 96}
!21 = !{!6, !8, i64 90}
!22 = !{!6, !12, i64 88}
!23 = !{!24, !7, i64 8}
!24 = !{!"_ZTS15drflac_subframe", !8, i64 0, !8, i64 1, !8, i64 2, !7, i64 8}
!25 = !{!11, !11, i64 0}
!26 = !{!24, !8, i64 1}
!27 = !{!28, !28, i64 0}
!28 = !{!"float", !8, i64 0}
!29 = distinct !{!29, !30}
!30 = !{!"llvm.loop.mustprogress"}
!31 = distinct !{!31, !30}
!32 = !{!6, !13, i64 232}
!33 = distinct !{!33, !30}


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