; 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_s32 = external hidden unnamed_addr constant [82 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_s32(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
  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
  %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 %232

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

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

37:                                               ; preds = %31
  br label %40

38:                                               ; preds = %31
  call void @__assert_fail(ptr noundef @.str.170, ptr noundef @.str.6, i32 noundef 85234, ptr noundef @__PRETTY_FUNCTION__.drflac_read_pcm_frames_s32) #6
  unreachable

39:                                               ; No predecessors!
  br label %40

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

46:                                               ; preds = %229, %40
  %47 = load i64, ptr %6, align 8, !tbaa !9
  %48 = icmp ugt i64 %47, 0
  br i1 %48, label %49, label %230

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

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

59:                                               ; preds = %55
  br label %230

60:                                               ; preds = %55
  br label %229

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

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

95:                                               ; preds = %89, %61
  %96 = load i32, ptr %11, align 4, !tbaa !22
  %97 = icmp eq i32 %96, 2
  br i1 %97, label %98, label %151

98:                                               ; preds = %95
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #5
  %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 0
  %103 = getelementptr inbounds %struct.drflac_subframe, ptr %102, i32 0, i32 3
  %104 = load ptr, ptr %103, align 8, !tbaa !26
  %105 = load i64, ptr %12, align 8, !tbaa !9
  %106 = getelementptr inbounds i32, ptr %104, i64 %105
  store ptr %106, ptr %14, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #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 2
  %110 = getelementptr inbounds [8 x %struct.drflac_subframe], ptr %109, i64 0, i64 1
  %111 = getelementptr inbounds %struct.drflac_subframe, ptr %110, i32 0, i32 3
  %112 = load ptr, ptr %111, align 8, !tbaa !26
  %113 = load i64, ptr %12, align 8, !tbaa !9
  %114 = getelementptr inbounds i32, ptr %112, i64 %113
  store ptr %114, ptr %15, align 8, !tbaa !5
  %115 = load ptr, ptr %5, align 8, !tbaa !5
  %116 = getelementptr inbounds %struct.drflac, ptr %115, i32 0, i32 10
  %117 = getelementptr inbounds %struct.drflac_frame, ptr %116, i32 0, i32 0
  %118 = getelementptr inbounds %struct.drflac_frame_header, ptr %117, i32 0, i32 4
  %119 = load i8, ptr %118, align 2, !tbaa !24
  %120 = zext i8 %119 to i32
  switch i32 %120, label %143 [
    i32 8, label %121
    i32 9, label %128
    i32 10, label %135
    i32 0, label %142
  ]

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

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

135:                                              ; preds = %98
  %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 !22
  %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 @_ZL43drflac_read_pcm_frames_s32__decode_mid_sideP6drflacyjPKiS2_Pi(ptr noundef %136, i64 noundef %137, i32 noundef %138, ptr noundef %139, ptr noundef %140, ptr noundef %141)
  br label %150

142:                                              ; preds = %98
  br label %143

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

150:                                              ; preds = %143, %135, %128, %121
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  br label %204

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

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

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

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

161:                                              ; preds = %157
  %162 = load ptr, ptr %5, align 8, !tbaa !5
  %163 = getelementptr inbounds %struct.drflac, ptr %162, i32 0, i32 10
  %164 = getelementptr inbounds %struct.drflac_frame, ptr %163, i32 0, i32 2
  %165 = load i32, ptr %17, align 4, !tbaa !22
  %166 = zext i32 %165 to i64
  %167 = getelementptr inbounds [8 x %struct.drflac_subframe], ptr %164, i64 0, i64 %166
  %168 = getelementptr inbounds %struct.drflac_subframe, ptr %167, i32 0, i32 3
  %169 = load ptr, ptr %168, align 8, !tbaa !26
  %170 = load i64, ptr %12, align 8, !tbaa !9
  %171 = load i64, ptr %16, align 8, !tbaa !9
  %172 = add i64 %170, %171
  %173 = getelementptr inbounds i32, ptr %169, i64 %172
  %174 = load i32, ptr %173, align 4, !tbaa !22
  %175 = load i32, ptr %9, align 4, !tbaa !22
  %176 = load ptr, ptr %5, align 8, !tbaa !5
  %177 = getelementptr inbounds %struct.drflac, ptr %176, i32 0, i32 10
  %178 = getelementptr inbounds %struct.drflac_frame, ptr %177, i32 0, i32 2
  %179 = load i32, ptr %17, align 4, !tbaa !22
  %180 = zext i32 %179 to i64
  %181 = getelementptr inbounds [8 x %struct.drflac_subframe], ptr %178, i64 0, i64 %180
  %182 = getelementptr inbounds %struct.drflac_subframe, ptr %181, i32 0, i32 1
  %183 = load i8, ptr %182, align 1, !tbaa !28
  %184 = zext i8 %183 to i32
  %185 = add i32 %175, %184
  %186 = shl i32 %174, %185
  %187 = load ptr, ptr %7, align 8, !tbaa !5
  %188 = load i64, ptr %16, align 8, !tbaa !9
  %189 = load i32, ptr %11, align 4, !tbaa !22
  %190 = zext i32 %189 to i64
  %191 = mul i64 %188, %190
  %192 = load i32, ptr %17, align 4, !tbaa !22
  %193 = zext i32 %192 to i64
  %194 = add i64 %191, %193
  %195 = getelementptr inbounds i32, ptr %187, i64 %194
  store i32 %186, ptr %195, align 4, !tbaa !22
  br label %196

196:                                              ; preds = %161
  %197 = load i32, ptr %17, align 4, !tbaa !22
  %198 = add i32 %197, 1
  store i32 %198, ptr %17, align 4, !tbaa !22
  br label %157, !llvm.loop !29

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

200:                                              ; preds = %199
  %201 = load i64, ptr %16, align 8, !tbaa !9
  %202 = add i64 %201, 1
  store i64 %202, ptr %16, align 8, !tbaa !9
  br label %152, !llvm.loop !31

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

204:                                              ; preds = %203, %150
  %205 = load i64, ptr %13, align 8, !tbaa !9
  %206 = load i64, ptr %8, align 8, !tbaa !9
  %207 = add i64 %206, %205
  store i64 %207, ptr %8, align 8, !tbaa !9
  %208 = load i64, ptr %13, align 8, !tbaa !9
  %209 = load i32, ptr %11, align 4, !tbaa !22
  %210 = zext i32 %209 to i64
  %211 = mul i64 %208, %210
  %212 = load ptr, ptr %7, align 8, !tbaa !5
  %213 = getelementptr inbounds i32, ptr %212, i64 %211
  store ptr %213, ptr %7, align 8, !tbaa !5
  %214 = load i64, ptr %13, align 8, !tbaa !9
  %215 = load i64, ptr %6, align 8, !tbaa !9
  %216 = sub i64 %215, %214
  store i64 %216, ptr %6, align 8, !tbaa !9
  %217 = load i64, ptr %13, align 8, !tbaa !9
  %218 = load ptr, ptr %5, align 8, !tbaa !5
  %219 = getelementptr inbounds %struct.drflac, ptr %218, i32 0, i32 11
  %220 = load i64, ptr %219, align 8, !tbaa !32
  %221 = add i64 %220, %217
  store i64 %221, ptr %219, align 8, !tbaa !32
  %222 = load i64, ptr %13, align 8, !tbaa !9
  %223 = trunc i64 %222 to i32
  %224 = load ptr, ptr %5, align 8, !tbaa !5
  %225 = getelementptr inbounds %struct.drflac, ptr %224, i32 0, i32 10
  %226 = getelementptr inbounds %struct.drflac_frame, ptr %225, i32 0, i32 1
  %227 = load i32, ptr %226, align 8, !tbaa !23
  %228 = sub i32 %227, %223
  store i32 %228, ptr %226, 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 %229

229:                                              ; preds = %204, %60
  br label %46, !llvm.loop !33

230:                                              ; preds = %59, %46
  %231 = load i64, ptr %8, align 8, !tbaa !9
  store i64 %231, ptr %4, align 8
  store i32 1, ptr %10, align 4
  br label %232

232:                                              ; preds = %230, %27, %23
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  %233 = load i64, ptr %4, align 8
  ret i64 %233
}

; 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_s32__decode_left_sideP6drflacyjPKiS2_Pi(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_s32__decode_right_sideP6drflacyjPKiS2_Pi(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_s32__decode_mid_sideP6drflacyjPKiS2_Pi(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_s32__decode_independent_stereoP6drflacyjPKiS2_Pi(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 = 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 }

@.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_s32 = external hidden unnamed_addr constant [82 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_s32(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 %.loopexit93, 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 %.loopexit93

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 85234, ptr noundef nonnull @__PRETTY_FUNCTION__.drflac_read_pcm_frames_s32) #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, %102
  %.079101 = phi i64 [ %1, %.lr.ph ], [ %.1, %102 ]
  %.08198 = phi ptr [ %2, %.lr.ph ], [ %.182, %102 ]
  %.08397 = phi i64 [ 0, %.lr.ph ], [ %.184, %102 ]
  %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)
  %.not91 = icmp eq i32 %28, 0
  br i1 %.not91, label %.loopexit93, label %102

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 %.079101, i64 %37)
  %38 = icmp eq i8 %31, 2
  br i1 %38, label %82, label %.preheader92

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

.preheader.lr.ph:                                 ; preds = %.preheader92
  %.not105 = icmp eq i8 %31, 0
  %39 = zext i8 %31 to i64
  br i1 %.not105, 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
  %.07795.us = phi i64 [ %81, %._crit_edge.us ], [ 0, %.preheader.us.preheader ]
  %41 = mul nuw nsw i64 %.07795.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 %.07795.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 = add nuw nsw i64 %41, %indvars.iv
  %54 = getelementptr inbounds i32, ptr %.08198, i64 %53
  store i32 %52, ptr %54, align 4, !tbaa !25
  %indvars.iv.next = or disjoint i64 %indvars.iv, 1
  %55 = getelementptr inbounds [8 x %struct.drflac_subframe], ptr %20, i64 0, i64 %indvars.iv.next
  %56 = getelementptr inbounds i8, ptr %55, i64 8
  %57 = load ptr, ptr %56, align 8, !tbaa !23
  %58 = getelementptr inbounds i32, ptr %57, i64 %.07795.us
  %59 = getelementptr inbounds i32, ptr %58, i64 %36
  %60 = load i32, ptr %59, align 4, !tbaa !25
  %61 = getelementptr inbounds i8, ptr %55, i64 1
  %62 = load i8, ptr %61, align 1, !tbaa !26
  %63 = zext i8 %62 to i32
  %64 = add nuw nsw i32 %16, %63
  %65 = shl i32 %60, %64
  %66 = add nuw nsw i64 %41, %indvars.iv.next
  %67 = getelementptr inbounds i32, ptr %.08198, i64 %66
  store i32 %65, ptr %67, align 4, !tbaa !25
  %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
  %68 = getelementptr inbounds [8 x %struct.drflac_subframe], ptr %20, i64 0, i64 %indvars.iv.unr
  %69 = getelementptr inbounds i8, ptr %68, i64 8
  %70 = load ptr, ptr %69, align 8, !tbaa !23
  %71 = getelementptr inbounds i32, ptr %70, i64 %.07795.us
  %72 = getelementptr inbounds i32, ptr %71, i64 %36
  %73 = load i32, ptr %72, align 4, !tbaa !25
  %74 = getelementptr inbounds i8, ptr %68, i64 1
  %75 = load i8, ptr %74, align 1, !tbaa !26
  %76 = zext i8 %75 to i32
  %77 = add nuw nsw i32 %16, %76
  %78 = shl i32 %73, %77
  %79 = add nuw nsw i64 %41, %indvars.iv.unr
  %80 = getelementptr inbounds i32, ptr %.08198, i64 %79
  store i32 %78, ptr %80, align 4, !tbaa !25
  br label %._crit_edge.us

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

82:                                               ; preds = %29
  %83 = load ptr, ptr %21, align 8, !tbaa !23
  %84 = getelementptr inbounds i32, ptr %83, i64 %36
  %85 = load ptr, ptr %22, align 8, !tbaa !23
  %86 = getelementptr inbounds i32, ptr %85, i64 %36
  %87 = load i8, ptr %18, align 2, !tbaa !21
  switch i8 %87, label %91 [
    i8 8, label %88
    i8 9, label %89
    i8 10, label %90
  ]

88:                                               ; preds = %82
  tail call void @_ZL44drflac_read_pcm_frames_s32__decode_left_sideP6drflacyjPKiS2_Pi(ptr noundef nonnull %0, i64 noundef %spec.select, i32 noundef %16, ptr noundef %84, ptr noundef %86, ptr noundef %.08198)
  br label %.loopexit

89:                                               ; preds = %82
  tail call void @_ZL45drflac_read_pcm_frames_s32__decode_right_sideP6drflacyjPKiS2_Pi(ptr noundef nonnull %0, i64 noundef %spec.select, i32 noundef %16, ptr noundef %84, ptr noundef %86, ptr noundef %.08198)
  br label %.loopexit

90:                                               ; preds = %82
  tail call void @_ZL43drflac_read_pcm_frames_s32__decode_mid_sideP6drflacyjPKiS2_Pi(ptr noundef nonnull %0, i64 noundef %spec.select, i32 noundef %16, ptr noundef %84, ptr noundef %86, ptr noundef %.08198)
  br label %.loopexit

91:                                               ; preds = %82
  tail call void @_ZL53drflac_read_pcm_frames_s32__decode_independent_stereoP6drflacyjPKiS2_Pi(ptr noundef nonnull %0, i64 noundef %spec.select, i32 noundef %16, ptr noundef %84, ptr noundef %86, ptr noundef %.08198)
  br label %.loopexit

.loopexit:                                        ; preds = %._crit_edge.us, %.preheader.lr.ph, %.preheader92, %88, %89, %90, %91
  %92 = add i64 %spec.select, %.08397
  %93 = zext i8 %31 to i64
  %94 = mul nuw nsw i64 %spec.select, %93
  %95 = getelementptr inbounds i32, ptr %.08198, i64 %94
  %96 = sub i64 %.079101, %spec.select
  %97 = load i64, ptr %23, align 8, !tbaa !30
  %98 = add i64 %97, %spec.select
  store i64 %98, ptr %23, align 8, !tbaa !30
  %99 = trunc nuw i64 %spec.select to i32
  %100 = load i32, ptr %17, align 8, !tbaa !20
  %101 = sub i32 %100, %99
  store i32 %101, ptr %17, align 8, !tbaa !20
  br label %102

102:                                              ; preds = %27, %.loopexit
  %.184 = phi i64 [ %.08397, %27 ], [ %92, %.loopexit ]
  %.182 = phi ptr [ %.08198, %27 ], [ %95, %.loopexit ]
  %.1 = phi i64 [ %.079101, %27 ], [ %96, %.loopexit ]
  %.not = icmp eq i64 %.1, 0
  br i1 %.not, label %.loopexit93, label %24, !llvm.loop !31

.loopexit93:                                      ; preds = %27, %102, %3, %8
  %.078 = phi i64 [ %9, %8 ], [ 0, %3 ], [ %.08397, %27 ], [ %.184, %102 ]
  ret i64 %.078
}

; 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_s32__decode_left_sideP6drflacyjPKiS2_Pi(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_s32__decode_right_sideP6drflacyjPKiS2_Pi(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_s32__decode_mid_sideP6drflacyjPKiS2_Pi(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_s32__decode_independent_stereoP6drflacyjPKiS2_Pi(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 = 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