; LLVM IR from Overload-Technologies/Overload :: Dependencies/soloud/src/audiosource/wav (soloud_wav)

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

%"class.SoLoud::MemoryFile" = type <{ %"class.SoLoud::File", ptr, i32, i32, i8, [7 x i8] }>
%"class.SoLoud::File" = type { ptr }
%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 }
%"class.SoLoud::Wav" = type <{ %"class.SoLoud::AudioSource", ptr, i32, [4 x i8] }>
%"class.SoLoud::AudioSource" = type { ptr, i32, float, float, i32, i32, float, float, float, i32, float, [8 x ptr], ptr, ptr, ptr, i32, double }

; 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: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare { i64, i1 } @llvm.umul.with.overflow.i64(i64, i64) #1

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znam(i64 noundef) #2

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN6SoLoud3Wav8loadflacEPNS_10MemoryFileE(ptr noundef nonnull align 8 dereferenceable(164) %0, ptr noundef %1) #3 align 2 {
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca i64, align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca [4096 x float], align 16
  %13 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  %14 = load ptr, ptr %4, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #5
  %15 = load ptr, ptr %5, align 8, !tbaa !5
  %16 = getelementptr inbounds %"class.SoLoud::MemoryFile", ptr %15, i32 0, i32 1
  %17 = load ptr, ptr %16, align 8, !tbaa !9
  %18 = load ptr, ptr %5, align 8, !tbaa !5
  %19 = getelementptr inbounds %"class.SoLoud::MemoryFile", ptr %18, i32 0, i32 2
  %20 = load i32, ptr %19, align 8, !tbaa !14
  %21 = zext i32 %20 to i64
  %22 = call ptr @drflac_open_memory(ptr noundef %17, i64 noundef %21, ptr noundef null)
  store ptr %22, ptr %6, align 8, !tbaa !5
  %23 = load ptr, ptr %6, align 8, !tbaa !5
  %24 = icmp ne ptr %23, null
  br i1 %24, label %26, label %25

25:                                               ; preds = %2
  store i32 3, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %138

26:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #5
  %27 = load ptr, ptr %6, align 8, !tbaa !5
  %28 = getelementptr inbounds %struct.drflac, ptr %27, i32 0, i32 7
  %29 = load i64, ptr %28, align 8, !tbaa !15
  store i64 %29, ptr %8, align 8, !tbaa !26
  %30 = load i64, ptr %8, align 8, !tbaa !26
  %31 = icmp ne i64 %30, 0
  br i1 %31, label %34, label %32

32:                                               ; preds = %26
  %33 = load ptr, ptr %6, align 8, !tbaa !5
  call void @drflac_close(ptr noundef %33)
  store i32 3, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %137

34:                                               ; preds = %26
  %35 = load i64, ptr %8, align 8, !tbaa !26
  %36 = load ptr, ptr %6, align 8, !tbaa !5
  %37 = getelementptr inbounds %struct.drflac, ptr %36, i32 0, i32 4
  %38 = load i8, ptr %37, align 4, !tbaa !27
  %39 = zext i8 %38 to i64
  %40 = mul i64 %35, %39
  %41 = trunc i64 %40 to i32
  %42 = zext i32 %41 to i64
  %43 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %42, i64 4)
  %44 = extractvalue { i64, i1 } %43, 1
  %45 = extractvalue { i64, i1 } %43, 0
  %46 = select i1 %44, i64 -1, i64 %45
  %47 = call noalias noundef nonnull ptr @_Znam(i64 noundef %46) #6
  %48 = getelementptr inbounds %"class.SoLoud::Wav", ptr %14, i32 0, i32 1
  store ptr %47, ptr %48, align 8, !tbaa !28
  %49 = load ptr, ptr %6, align 8, !tbaa !5
  %50 = getelementptr inbounds %struct.drflac, ptr %49, i32 0, i32 3
  %51 = load i32, ptr %50, align 8, !tbaa !33
  %52 = uitofp i32 %51 to float
  %53 = getelementptr inbounds %"class.SoLoud::AudioSource", ptr %14, i32 0, i32 2
  store float %52, ptr %53, align 4, !tbaa !34
  %54 = load i64, ptr %8, align 8, !tbaa !26
  %55 = trunc i64 %54 to i32
  %56 = getelementptr inbounds %"class.SoLoud::Wav", ptr %14, i32 0, i32 2
  store i32 %55, ptr %56, align 8, !tbaa !35
  %57 = load ptr, ptr %6, align 8, !tbaa !5
  %58 = getelementptr inbounds %struct.drflac, ptr %57, i32 0, i32 4
  %59 = load i8, ptr %58, align 4, !tbaa !27
  %60 = zext i8 %59 to i32
  %61 = getelementptr inbounds %"class.SoLoud::AudioSource", ptr %14, i32 0, i32 4
  store i32 %60, ptr %61, align 4, !tbaa !36
  %62 = load ptr, ptr %6, align 8, !tbaa !5
  %63 = call i32 @drflac_seek_to_pcm_frame(ptr noundef %62, i64 noundef 0)
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  store i32 0, ptr %9, align 4, !tbaa !37
  br label %64

64:                                               ; preds = %132, %34
  %65 = load i32, ptr %9, align 4, !tbaa !37
  %66 = getelementptr inbounds %"class.SoLoud::Wav", ptr %14, i32 0, i32 2
  %67 = load i32, ptr %66, align 8, !tbaa !35
  %68 = icmp ult i32 %65, %67
  br i1 %68, label %69, label %135

69:                                               ; preds = %64
  call void @llvm.lifetime.start.p0(i64 16384, ptr %12) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  %70 = getelementptr inbounds %"class.SoLoud::Wav", ptr %14, i32 0, i32 2
  %71 = load i32, ptr %70, align 8, !tbaa !35
  %72 = load i32, ptr %9, align 4, !tbaa !37
  %73 = sub i32 %71, %72
  %74 = icmp ugt i32 %73, 512
  br i1 %74, label %75, label %76

75:                                               ; preds = %69
  br label %81

76:                                               ; preds = %69
  %77 = getelementptr inbounds %"class.SoLoud::Wav", ptr %14, i32 0, i32 2
  %78 = load i32, ptr %77, align 8, !tbaa !35
  %79 = load i32, ptr %9, align 4, !tbaa !37
  %80 = sub i32 %78, %79
  br label %81

81:                                               ; preds = %76, %75
  %82 = phi i32 [ 512, %75 ], [ %80, %76 ]
  store i32 %82, ptr %13, align 4, !tbaa !37
  %83 = load ptr, ptr %6, align 8, !tbaa !5
  %84 = load i32, ptr %13, align 4, !tbaa !37
  %85 = zext i32 %84 to i64
  %86 = getelementptr inbounds [4096 x float], ptr %12, i64 0, i64 0
  %87 = call i64 @drflac_read_pcm_frames_f32(ptr noundef %83, i64 noundef %85, ptr noundef %86)
  store i32 0, ptr %10, align 4, !tbaa !37
  br label %88

88:                                               ; preds = %128, %81
  %89 = load i32, ptr %10, align 4, !tbaa !37
  %90 = load i32, ptr %13, align 4, !tbaa !37
  %91 = icmp ult i32 %89, %90
  br i1 %91, label %92, label %131

92:                                               ; preds = %88
  store i32 0, ptr %11, align 4, !tbaa !37
  br label %93

93:                                               ; preds = %124, %92
  %94 = load i32, ptr %11, align 4, !tbaa !37
  %95 = load ptr, ptr %6, align 8, !tbaa !5
  %96 = getelementptr inbounds %struct.drflac, ptr %95, i32 0, i32 4
  %97 = load i8, ptr %96, align 4, !tbaa !27
  %98 = zext i8 %97 to i32
  %99 = icmp ult i32 %94, %98
  br i1 %99, label %100, label %127

100:                                              ; preds = %93
  %101 = load i32, ptr %10, align 4, !tbaa !37
  %102 = load ptr, ptr %6, align 8, !tbaa !5
  %103 = getelementptr inbounds %struct.drflac, ptr %102, i32 0, i32 4
  %104 = load i8, ptr %103, align 4, !tbaa !27
  %105 = zext i8 %104 to i32
  %106 = mul i32 %101, %105
  %107 = load i32, ptr %11, align 4, !tbaa !37
  %108 = add i32 %106, %107
  %109 = zext i32 %108 to i64
  %110 = getelementptr inbounds [4096 x float], ptr %12, i64 0, i64 %109
  %111 = load float, ptr %110, align 4, !tbaa !38
  %112 = getelementptr inbounds %"class.SoLoud::Wav", ptr %14, i32 0, i32 1
  %113 = load ptr, ptr %112, align 8, !tbaa !28
  %114 = load i32, ptr %11, align 4, !tbaa !37
  %115 = getelementptr inbounds %"class.SoLoud::Wav", ptr %14, i32 0, i32 2
  %116 = load i32, ptr %115, align 8, !tbaa !35
  %117 = mul i32 %114, %116
  %118 = load i32, ptr %9, align 4, !tbaa !37
  %119 = add i32 %117, %118
  %120 = load i32, ptr %10, align 4, !tbaa !37
  %121 = add i32 %119, %120
  %122 = zext i32 %121 to i64
  %123 = getelementptr inbounds float, ptr %113, i64 %122
  store float %111, ptr %123, align 4, !tbaa !38
  br label %124

124:                                              ; preds = %100
  %125 = load i32, ptr %11, align 4, !tbaa !37
  %126 = add i32 %125, 1
  store i32 %126, ptr %11, align 4, !tbaa !37
  br label %93, !llvm.loop !39

127:                                              ; preds = %93
  br label %128

128:                                              ; preds = %127
  %129 = load i32, ptr %10, align 4, !tbaa !37
  %130 = add i32 %129, 1
  store i32 %130, ptr %10, align 4, !tbaa !37
  br label %88, !llvm.loop !41

131:                                              ; preds = %88
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 16384, ptr %12) #5
  br label %132

132:                                              ; preds = %131
  %133 = load i32, ptr %9, align 4, !tbaa !37
  %134 = add i32 %133, 512
  store i32 %134, ptr %9, align 4, !tbaa !37
  br label %64, !llvm.loop !42

135:                                              ; preds = %64
  %136 = load ptr, ptr %6, align 8, !tbaa !5
  call void @drflac_close(ptr noundef %136)
  store i32 0, ptr %3, align 4
  store i32 1, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  br label %137

137:                                              ; preds = %135, %32
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  br label %138

138:                                              ; preds = %137, %25
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #5
  %139 = load i32, ptr %3, align 4
  ret i32 %139
}

declare ptr @drflac_open_memory(ptr noundef, i64 noundef, ptr noundef) #4

declare void @drflac_close(ptr noundef) #4

declare i32 @drflac_seek_to_pcm_frame(ptr noundef, i64 noundef) #4

declare i64 @drflac_read_pcm_frames_f32(ptr noundef, i64 noundef, ptr noundef) #4

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #2 = { nobuiltin allocsize(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 = { 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 = { "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 = { builtin allocsize(0) }

!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, !6, i64 8}
!10 = !{!"_ZTSN6SoLoud10MemoryFileE", !11, i64 0, !6, i64 8, !12, i64 16, !12, i64 20, !13, i64 24}
!11 = !{!"_ZTSN6SoLoud4FileE"}
!12 = !{!"int", !7, i64 0}
!13 = !{!"bool", !7, i64 0}
!14 = !{!10, !12, i64 16}
!15 = !{!16, !19, i64 56}
!16 = !{!"_ZTS6drflac", !6, i64 0, !6, i64 8, !17, i64 16, !12, i64 48, !7, i64 52, !7, i64 53, !18, i64 54, !19, i64 56, !20, i64 64, !12, i64 68, !21, i64 72, !19, i64 232, !19, i64 240, !23, i64 248, !6, i64 272, !6, i64 280, !6, i64 288, !12, i64 296, !12, i64 296, !12, i64 296, !25, i64 304, !7, i64 4480}
!17 = !{!"_ZTS27drflac_allocation_callbacks", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!18 = !{!"short", !7, i64 0}
!19 = !{!"long long", !7, i64 0}
!20 = !{!"_ZTS16drflac_container", !7, i64 0}
!21 = !{!"_ZTS12drflac_frame", !22, i64 0, !12, i64 24, !7, i64 32}
!22 = !{!"_ZTS19drflac_frame_header", !19, i64 0, !12, i64 8, !12, i64 12, !18, i64 16, !7, i64 18, !7, i64 19, !7, i64 20}
!23 = !{!"_ZTS21drflac__memory_stream", !6, i64 0, !24, i64 8, !24, i64 16}
!24 = !{!"long", !7, i64 0}
!25 = !{!"_ZTS9drflac_bs", !6, i64 0, !6, i64 8, !6, i64 16, !24, i64 24, !19, i64 32, !12, i64 40, !12, i64 44, !7, i64 48, !19, i64 4144, !18, i64 4152, !19, i64 4160, !12, i64 4168}
!26 = !{!19, !19, i64 0}
!27 = !{!16, !7, i64 52}
!28 = !{!29, !6, i64 152}
!29 = !{!"_ZTSN6SoLoud3WavE", !30, i64 0, !6, i64 152, !12, i64 160}
!30 = !{!"_ZTSN6SoLoud11AudioSourceE", !12, i64 8, !31, i64 12, !31, i64 16, !12, i64 20, !12, i64 24, !31, i64 28, !31, i64 32, !31, i64 36, !12, i64 40, !31, i64 44, !7, i64 48, !6, i64 112, !6, i64 120, !6, i64 128, !12, i64 136, !32, i64 144}
!31 = !{!"float", !7, i64 0}
!32 = !{!"double", !7, i64 0}
!33 = !{!16, !12, i64 48}
!34 = !{!30, !31, i64 12}
!35 = !{!29, !12, i64 160}
!36 = !{!30, !12, i64 20}
!37 = !{!12, !12, i64 0}
!38 = !{!31, !31, i64 0}
!39 = distinct !{!39, !40}
!40 = !{!"llvm.loop.mustprogress"}
!41 = distinct !{!41, !40}
!42 = distinct !{!42, !40}


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

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

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

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znam(i64 noundef) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
define dso_local noundef range(i32 0, 4) i32 @_ZN6SoLoud3Wav8loadflacEPNS_10MemoryFileE(ptr nocapture noundef nonnull align 8 dereferenceable(164) %0, ptr nocapture noundef readonly %1) local_unnamed_addr #2 align 2 {
  %3 = alloca [4096 x float], align 16
  %4 = getelementptr inbounds i8, ptr %1, i64 8
  %5 = load ptr, ptr %4, align 8, !tbaa !5
  %6 = getelementptr inbounds i8, ptr %1, i64 16
  %7 = load i32, ptr %6, align 8, !tbaa !13
  %8 = zext i32 %7 to i64
  %9 = tail call ptr @drflac_open_memory(ptr noundef %5, i64 noundef %8, ptr noundef null)
  %.not = icmp eq ptr %9, null
  br i1 %.not, label %98, label %10

10:                                               ; preds = %2
  %11 = getelementptr inbounds i8, ptr %9, i64 56
  %12 = load i64, ptr %11, align 8, !tbaa !14
  %.not39 = icmp eq i64 %12, 0
  br i1 %.not39, label %13, label %14

13:                                               ; preds = %10
  tail call void @drflac_close(ptr noundef nonnull %9)
  br label %98

14:                                               ; preds = %10
  %15 = getelementptr inbounds i8, ptr %9, i64 52
  %16 = load i8, ptr %15, align 4, !tbaa !25
  %17 = zext i8 %16 to i64
  %18 = shl i64 %12, 2
  %19 = mul i64 %18, %17
  %20 = and i64 %19, 17179869180
  %21 = tail call noalias noundef nonnull ptr @_Znam(i64 noundef %20) #5
  %22 = getelementptr inbounds i8, ptr %0, i64 152
  store ptr %21, ptr %22, align 8, !tbaa !26
  %23 = getelementptr inbounds i8, ptr %9, i64 48
  %24 = load i32, ptr %23, align 8, !tbaa !31
  %25 = uitofp i32 %24 to float
  %26 = getelementptr inbounds i8, ptr %0, i64 12
  store float %25, ptr %26, align 4, !tbaa !32
  %27 = trunc i64 %12 to i32
  %28 = getelementptr inbounds i8, ptr %0, i64 160
  store i32 %27, ptr %28, align 8, !tbaa !33
  %29 = zext i8 %16 to i32
  %30 = getelementptr inbounds i8, ptr %0, i64 20
  store i32 %29, ptr %30, align 4, !tbaa !34
  %31 = tail call i32 @drflac_seek_to_pcm_frame(ptr noundef nonnull %9, i64 noundef 0)
  %32 = load i32, ptr %28, align 8, !tbaa !33
  %.not45 = icmp eq i32 %32, 0
  br i1 %.not45, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %14, %._crit_edge42
  %indvar = phi i64 [ %indvar.next, %._crit_edge42 ], [ 0, %14 ]
  %33 = phi i32 [ %.pre53, %._crit_edge42 ], [ %32, %14 ]
  %.03443 = phi i32 [ %96, %._crit_edge42 ], [ 0, %14 ]
  %34 = zext i32 %.03443 to i64
  %35 = shl nuw nsw i64 %34, 2
  %36 = shl i64 %indvar, 9
  call void @llvm.lifetime.start.p0(i64 16384, ptr nonnull %3) #6
  %37 = sub i32 %33, %.03443
  %spec.select = call i32 @llvm.umin.i32(i32 %37, i32 512)
  %38 = zext nneg i32 %spec.select to i64
  %39 = call i64 @drflac_read_pcm_frames_f32(ptr noundef nonnull %9, i64 noundef %38, ptr noundef nonnull %3)
  %.not46 = icmp eq i32 %33, %.03443
  %.pre53 = load i32, ptr %28, align 8
  br i1 %.not46, label %._crit_edge42, label %.preheader.lr.ph

.preheader.lr.ph:                                 ; preds = %.lr.ph
  %40 = load i8, ptr %15, align 4, !tbaa !25
  %.not47 = icmp eq i8 %40, 0
  %41 = load ptr, ptr %22, align 8
  br i1 %.not47, label %._crit_edge42, label %.preheader.us.preheader

.preheader.us.preheader:                          ; preds = %.preheader.lr.ph
  %42 = zext i8 %40 to i64
  %43 = add nsw i64 %42, -1
  %umax = call i64 @llvm.umax.i64(i64 %38, i64 1)
  %44 = shl nuw nsw i64 %umax, 2
  %45 = mul nuw nsw i64 %44, %42
  %scevgep = getelementptr i8, ptr %3, i64 %45
  %scevgep54 = getelementptr i8, ptr %41, i64 %35
  %scevgep55 = getelementptr i8, ptr %41, i64 -4
  %46 = add nuw nsw i64 %umax, %42
  %47 = add nuw nsw i64 %46, %34
  %48 = shl nuw nsw i64 %47, 2
  %scevgep56 = getelementptr i8, ptr %scevgep55, i64 %48
  %min.iters.check = icmp ult i8 %40, 12
  %ident.check = icmp ne i32 %.pre53, 1
  %49 = trunc nsw i64 %43 to i32
  %50 = icmp ugt i64 %43, 4294967295
  %bound0 = icmp ult ptr %3, %scevgep56
  %bound1 = icmp ult ptr %scevgep54, %scevgep
  %found.conflict = and i1 %bound0, %bound1
  %n.vec = and i64 %42, 248
  %cmp.n = icmp eq i64 %n.vec, %42
  %xtraiter = and i64 %42, 1
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  %51 = add nsw i64 %42, -1
  br label %.preheader.us

.preheader.us:                                    ; preds = %.preheader.us.preheader, %._crit_edge.us
  %indvars.iv50 = phi i64 [ 0, %.preheader.us.preheader ], [ %indvars.iv.next51, %._crit_edge.us ]
  %52 = mul nuw nsw i64 %indvars.iv50, %42
  %53 = trunc i64 %indvars.iv50 to i32
  %54 = add i32 %.03443, %53
  br i1 %min.iters.check, label %scalar.ph.preheader, label %vector.scevcheck

vector.scevcheck:                                 ; preds = %.preheader.us
  %55 = add i64 %36, %indvars.iv50
  %56 = trunc i64 %55 to i32
  %57 = xor i32 %56, -1
  %58 = icmp ult i32 %57, %49
  %59 = or i1 %58, %50
  %60 = or i1 %ident.check, %59
  %brmerge = select i1 %60, i1 true, i1 %found.conflict
  br i1 %brmerge, label %scalar.ph.preheader, label %vector.body

vector.body:                                      ; preds = %vector.scevcheck, %vector.body
  %index = phi i64 [ %index.next, %vector.body ], [ 0, %vector.scevcheck ]
  %61 = trunc i64 %index to i32
  %62 = add nuw nsw i64 %52, %index
  %63 = getelementptr inbounds [4096 x float], ptr %3, i64 0, i64 %62
  %64 = getelementptr inbounds i8, ptr %63, i64 16
  %wide.load = load <4 x float>, ptr %63, align 4, !tbaa !35, !alias.scope !36, !noalias !39
  %wide.load57 = load <4 x float>, ptr %64, align 4, !tbaa !35, !alias.scope !36, !noalias !39
  %65 = add i32 %54, %61
  %66 = zext i32 %65 to i64
  %67 = getelementptr inbounds float, ptr %41, i64 %66
  %68 = getelementptr inbounds i8, ptr %67, i64 16
  store <4 x float> %wide.load, ptr %67, align 4, !tbaa !35, !alias.scope !39
  store <4 x float> %wide.load57, ptr %68, align 4, !tbaa !35, !alias.scope !39
  %index.next = add nuw i64 %index, 8
  %69 = icmp eq i64 %index.next, %n.vec
  br i1 %69, label %middle.block, label %vector.body, !llvm.loop !41

middle.block:                                     ; preds = %vector.body
  br i1 %cmp.n, label %._crit_edge.us, label %scalar.ph.preheader

scalar.ph.preheader:                              ; preds = %vector.scevcheck, %middle.block, %.preheader.us
  %indvars.iv.ph = phi i64 [ 0, %vector.scevcheck ], [ 0, %.preheader.us ], [ %n.vec, %middle.block ]
  br i1 %lcmp.mod.not, label %scalar.ph.prol.loopexit, label %scalar.ph.prol

scalar.ph.prol:                                   ; preds = %scalar.ph.preheader
  %70 = add nuw nsw i64 %52, %indvars.iv.ph
  %71 = getelementptr inbounds [4096 x float], ptr %3, i64 0, i64 %70
  %72 = load float, ptr %71, align 4, !tbaa !35
  %73 = trunc nuw nsw i64 %indvars.iv.ph to i32
  %74 = mul i32 %.pre53, %73
  %75 = add i32 %54, %74
  %76 = zext i32 %75 to i64
  %77 = getelementptr inbounds float, ptr %41, i64 %76
  store float %72, ptr %77, align 4, !tbaa !35
  %indvars.iv.next.prol = or disjoint i64 %indvars.iv.ph, 1
  br label %scalar.ph.prol.loopexit

scalar.ph.prol.loopexit:                          ; preds = %scalar.ph.prol, %scalar.ph.preheader
  %indvars.iv.unr = phi i64 [ %indvars.iv.ph, %scalar.ph.preheader ], [ %indvars.iv.next.prol, %scalar.ph.prol ]
  %78 = icmp eq i64 %indvars.iv.ph, %51
  br i1 %78, label %._crit_edge.us, label %scalar.ph

scalar.ph:                                        ; preds = %scalar.ph.prol.loopexit, %scalar.ph
  %indvars.iv = phi i64 [ %indvars.iv.next.1, %scalar.ph ], [ %indvars.iv.unr, %scalar.ph.prol.loopexit ]
  %79 = add nuw nsw i64 %52, %indvars.iv
  %80 = getelementptr inbounds [4096 x float], ptr %3, i64 0, i64 %79
  %81 = load float, ptr %80, align 4, !tbaa !35
  %82 = trunc nuw nsw i64 %indvars.iv to i32
  %83 = mul i32 %.pre53, %82
  %84 = add i32 %54, %83
  %85 = zext i32 %84 to i64
  %86 = getelementptr inbounds float, ptr %41, i64 %85
  store float %81, ptr %86, align 4, !tbaa !35
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %87 = add nuw nsw i64 %52, %indvars.iv.next
  %88 = getelementptr inbounds [4096 x float], ptr %3, i64 0, i64 %87
  %89 = load float, ptr %88, align 4, !tbaa !35
  %90 = trunc nuw nsw i64 %indvars.iv.next to i32
  %91 = mul i32 %.pre53, %90
  %92 = add i32 %54, %91
  %93 = zext i32 %92 to i64
  %94 = getelementptr inbounds float, ptr %41, i64 %93
  store float %89, ptr %94, align 4, !tbaa !35
  %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
  %exitcond.not.1 = icmp eq i64 %indvars.iv.next.1, %42
  br i1 %exitcond.not.1, label %._crit_edge.us, label %scalar.ph, !llvm.loop !45

._crit_edge.us:                                   ; preds = %scalar.ph.prol.loopexit, %scalar.ph, %middle.block
  %indvars.iv.next51 = add nuw nsw i64 %indvars.iv50, 1
  %95 = icmp ult i64 %indvars.iv.next51, %38
  br i1 %95, label %.preheader.us, label %._crit_edge42, !llvm.loop !46

._crit_edge42:                                    ; preds = %._crit_edge.us, %.preheader.lr.ph, %.lr.ph
  call void @llvm.lifetime.end.p0(i64 16384, ptr nonnull %3) #6
  %96 = add i32 %.03443, 512
  %97 = icmp ult i32 %96, %.pre53
  %indvar.next = add i64 %indvar, 1
  br i1 %97, label %.lr.ph, label %._crit_edge, !llvm.loop !47

._crit_edge:                                      ; preds = %._crit_edge42, %14
  call void @drflac_close(ptr noundef nonnull %9)
  br label %98

98:                                               ; preds = %13, %._crit_edge, %2
  %.1 = phi i32 [ 3, %2 ], [ 0, %._crit_edge ], [ 3, %13 ]
  ret i32 %.1
}

declare ptr @drflac_open_memory(ptr noundef, i64 noundef, ptr noundef) local_unnamed_addr #3

declare void @drflac_close(ptr noundef) local_unnamed_addr #3

declare i32 @drflac_seek_to_pcm_frame(ptr noundef, i64 noundef) local_unnamed_addr #3

declare i64 @drflac_read_pcm_frames_f32(ptr noundef, i64 noundef, ptr noundef) local_unnamed_addr #3

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

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nobuiltin allocsize(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 = { 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 = { "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 = { builtin allocsize(0) }
attributes #6 = { 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 8}
!6 = !{!"_ZTSN6SoLoud10MemoryFileE", !7, i64 0, !8, i64 8, !11, i64 16, !11, i64 20, !12, i64 24}
!7 = !{!"_ZTSN6SoLoud4FileE"}
!8 = !{!"any pointer", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C++ TBAA"}
!11 = !{!"int", !9, i64 0}
!12 = !{!"bool", !9, i64 0}
!13 = !{!6, !11, i64 16}
!14 = !{!15, !18, i64 56}
!15 = !{!"_ZTS6drflac", !8, i64 0, !8, i64 8, !16, i64 16, !11, i64 48, !9, i64 52, !9, i64 53, !17, i64 54, !18, i64 56, !19, i64 64, !11, i64 68, !20, i64 72, !18, i64 232, !18, i64 240, !22, i64 248, !8, i64 272, !8, i64 280, !8, i64 288, !11, i64 296, !11, i64 296, !11, i64 296, !24, i64 304, !9, i64 4480}
!16 = !{!"_ZTS27drflac_allocation_callbacks", !8, i64 0, !8, i64 8, !8, i64 16, !8, i64 24}
!17 = !{!"short", !9, i64 0}
!18 = !{!"long long", !9, i64 0}
!19 = !{!"_ZTS16drflac_container", !9, i64 0}
!20 = !{!"_ZTS12drflac_frame", !21, i64 0, !11, i64 24, !9, i64 32}
!21 = !{!"_ZTS19drflac_frame_header", !18, i64 0, !11, i64 8, !11, i64 12, !17, i64 16, !9, i64 18, !9, i64 19, !9, i64 20}
!22 = !{!"_ZTS21drflac__memory_stream", !8, i64 0, !23, i64 8, !23, i64 16}
!23 = !{!"long", !9, i64 0}
!24 = !{!"_ZTS9drflac_bs", !8, i64 0, !8, i64 8, !8, i64 16, !23, i64 24, !18, i64 32, !11, i64 40, !11, i64 44, !9, i64 48, !18, i64 4144, !17, i64 4152, !18, i64 4160, !11, i64 4168}
!25 = !{!15, !9, i64 52}
!26 = !{!27, !8, i64 152}
!27 = !{!"_ZTSN6SoLoud3WavE", !28, i64 0, !8, i64 152, !11, i64 160}
!28 = !{!"_ZTSN6SoLoud11AudioSourceE", !11, i64 8, !29, i64 12, !29, i64 16, !11, i64 20, !11, i64 24, !29, i64 28, !29, i64 32, !29, i64 36, !11, i64 40, !29, i64 44, !9, i64 48, !8, i64 112, !8, i64 120, !8, i64 128, !11, i64 136, !30, i64 144}
!29 = !{!"float", !9, i64 0}
!30 = !{!"double", !9, i64 0}
!31 = !{!15, !11, i64 48}
!32 = !{!28, !29, i64 12}
!33 = !{!27, !11, i64 160}
!34 = !{!28, !11, i64 20}
!35 = !{!29, !29, i64 0}
!36 = !{!37}
!37 = distinct !{!37, !38}
!38 = distinct !{!38, !"LVerDomain"}
!39 = !{!40}
!40 = distinct !{!40, !38}
!41 = distinct !{!41, !42, !43, !44}
!42 = !{!"llvm.loop.mustprogress"}
!43 = !{!"llvm.loop.isvectorized", i32 1}
!44 = !{!"llvm.loop.unroll.runtime.disable"}
!45 = distinct !{!45, !42, !43}
!46 = distinct !{!46, !42}
!47 = distinct !{!47, !42}


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