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

%struct.drwav = type { ptr, ptr, ptr, ptr, %struct.drwav_allocation_callbacks, i32, %struct.drwav_fmt, i32, i16, i16, i16, i64, i64, i64, i64, i64, i64, i32, i32, ptr, i32, %struct.drwav__memory_stream, %struct.drwav__memory_stream_write, %struct.anon, %struct.anon.0 }
%struct.drwav_allocation_callbacks = type { ptr, ptr, ptr, ptr }
%struct.drwav_fmt = type { i16, i16, i32, i32, i16, i16, i16, i16, i32, [16 x i8] }
%struct.drwav__memory_stream = type { ptr, i64, i64 }
%struct.drwav__memory_stream_write = type { ptr, ptr, i64, i64, i64 }
%struct.anon = type { i32, [2 x i16], [2 x i32], [4 x i32], i32, [2 x [2 x i32]] }
%struct.anon.0 = type { i32, [2 x i32], [2 x i32], [16 x i32], 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: mustprogress uwtable
define dso_local noundef i32 @_ZN6SoLoud3Wav7loadwavEPNS_10MemoryFileE(ptr noundef nonnull align 8 dereferenceable(164) %0, ptr noundef %1) #1 align 2 {
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca %struct.drwav, 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 400, ptr %6) #5
  %15 = load ptr, ptr %5, align 8, !tbaa !5
  %16 = load ptr, ptr %15, align 8, !tbaa !9
  %17 = getelementptr inbounds ptr, ptr %16, i64 8
  %18 = load ptr, ptr %17, align 8
  %19 = call noundef ptr %18(ptr noundef nonnull align 8 dereferenceable(25) %15)
  %20 = load ptr, ptr %5, align 8, !tbaa !5
  %21 = load ptr, ptr %20, align 8, !tbaa !9
  %22 = getelementptr inbounds ptr, ptr %21, i64 4
  %23 = load ptr, ptr %22, align 8
  %24 = call noundef i32 %23(ptr noundef nonnull align 8 dereferenceable(25) %20)
  %25 = zext i32 %24 to i64
  %26 = call i32 @drwav_init_memory(ptr noundef %6, ptr noundef %19, i64 noundef %25, ptr noundef null)
  %27 = icmp ne i32 %26, 0
  br i1 %27, label %29, label %28

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

29:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #5
  %30 = getelementptr inbounds %struct.drwav, ptr %6, i32 0, i32 11
  %31 = load i64, ptr %30, align 8, !tbaa !11
  store i64 %31, ptr %8, align 8, !tbaa !25
  %32 = load i64, ptr %8, align 8, !tbaa !25
  %33 = icmp ne i64 %32, 0
  br i1 %33, label %36, label %34

34:                                               ; preds = %29
  %35 = call i32 @drwav_uninit(ptr noundef %6)
  store i32 3, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %131

36:                                               ; preds = %29
  %37 = load i64, ptr %8, align 8, !tbaa !25
  %38 = getelementptr inbounds %struct.drwav, ptr %6, i32 0, i32 8
  %39 = load i16, ptr %38, align 8, !tbaa !26
  %40 = zext i16 %39 to i64
  %41 = mul i64 %37, %40
  %42 = trunc i64 %41 to i32
  %43 = zext i32 %42 to i64
  %44 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %43, i64 4)
  %45 = extractvalue { i64, i1 } %44, 1
  %46 = extractvalue { i64, i1 } %44, 0
  %47 = select i1 %45, i64 -1, i64 %46
  %48 = call noalias noundef nonnull ptr @_Znam(i64 noundef %47) #6
  %49 = getelementptr inbounds %"class.SoLoud::Wav", ptr %14, i32 0, i32 1
  store ptr %48, ptr %49, align 8, !tbaa !27
  %50 = getelementptr inbounds %struct.drwav, ptr %6, i32 0, i32 7
  %51 = load i32, ptr %50, align 4, !tbaa !32
  %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 !33
  %54 = load i64, ptr %8, align 8, !tbaa !25
  %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 !34
  %57 = getelementptr inbounds %struct.drwav, ptr %6, i32 0, i32 8
  %58 = load i16, ptr %57, align 8, !tbaa !26
  %59 = zext i16 %58 to i32
  %60 = getelementptr inbounds %"class.SoLoud::AudioSource", ptr %14, i32 0, i32 4
  store i32 %59, ptr %60, align 4, !tbaa !35
  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 !36
  br label %61

61:                                               ; preds = %126, %36
  %62 = load i32, ptr %9, align 4, !tbaa !36
  %63 = getelementptr inbounds %"class.SoLoud::Wav", ptr %14, i32 0, i32 2
  %64 = load i32, ptr %63, align 8, !tbaa !34
  %65 = icmp ult i32 %62, %64
  br i1 %65, label %66, label %129

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

72:                                               ; preds = %66
  br label %78

73:                                               ; preds = %66
  %74 = getelementptr inbounds %"class.SoLoud::Wav", ptr %14, i32 0, i32 2
  %75 = load i32, ptr %74, align 8, !tbaa !34
  %76 = load i32, ptr %9, align 4, !tbaa !36
  %77 = sub i32 %75, %76
  br label %78

78:                                               ; preds = %73, %72
  %79 = phi i32 [ 512, %72 ], [ %77, %73 ]
  store i32 %79, ptr %13, align 4, !tbaa !36
  %80 = load i32, ptr %13, align 4, !tbaa !36
  %81 = zext i32 %80 to i64
  %82 = getelementptr inbounds [4096 x float], ptr %12, i64 0, i64 0
  %83 = call i64 @drwav_read_pcm_frames_f32(ptr noundef %6, i64 noundef %81, ptr noundef %82)
  store i32 0, ptr %10, align 4, !tbaa !36
  br label %84

84:                                               ; preds = %122, %78
  %85 = load i32, ptr %10, align 4, !tbaa !36
  %86 = load i32, ptr %13, align 4, !tbaa !36
  %87 = icmp ult i32 %85, %86
  br i1 %87, label %88, label %125

88:                                               ; preds = %84
  store i32 0, ptr %11, align 4, !tbaa !36
  br label %89

89:                                               ; preds = %118, %88
  %90 = load i32, ptr %11, align 4, !tbaa !36
  %91 = getelementptr inbounds %struct.drwav, ptr %6, i32 0, i32 8
  %92 = load i16, ptr %91, align 8, !tbaa !26
  %93 = zext i16 %92 to i32
  %94 = icmp ult i32 %90, %93
  br i1 %94, label %95, label %121

95:                                               ; preds = %89
  %96 = load i32, ptr %10, align 4, !tbaa !36
  %97 = getelementptr inbounds %struct.drwav, ptr %6, i32 0, i32 8
  %98 = load i16, ptr %97, align 8, !tbaa !26
  %99 = zext i16 %98 to i32
  %100 = mul i32 %96, %99
  %101 = load i32, ptr %11, align 4, !tbaa !36
  %102 = add i32 %100, %101
  %103 = zext i32 %102 to i64
  %104 = getelementptr inbounds [4096 x float], ptr %12, i64 0, i64 %103
  %105 = load float, ptr %104, align 4, !tbaa !37
  %106 = getelementptr inbounds %"class.SoLoud::Wav", ptr %14, i32 0, i32 1
  %107 = load ptr, ptr %106, align 8, !tbaa !27
  %108 = load i32, ptr %11, align 4, !tbaa !36
  %109 = getelementptr inbounds %"class.SoLoud::Wav", ptr %14, i32 0, i32 2
  %110 = load i32, ptr %109, align 8, !tbaa !34
  %111 = mul i32 %108, %110
  %112 = load i32, ptr %9, align 4, !tbaa !36
  %113 = add i32 %111, %112
  %114 = load i32, ptr %10, align 4, !tbaa !36
  %115 = add i32 %113, %114
  %116 = zext i32 %115 to i64
  %117 = getelementptr inbounds float, ptr %107, i64 %116
  store float %105, ptr %117, align 4, !tbaa !37
  br label %118

118:                                              ; preds = %95
  %119 = load i32, ptr %11, align 4, !tbaa !36
  %120 = add i32 %119, 1
  store i32 %120, ptr %11, align 4, !tbaa !36
  br label %89, !llvm.loop !38

121:                                              ; preds = %89
  br label %122

122:                                              ; preds = %121
  %123 = load i32, ptr %10, align 4, !tbaa !36
  %124 = add i32 %123, 1
  store i32 %124, ptr %10, align 4, !tbaa !36
  br label %84, !llvm.loop !40

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

126:                                              ; preds = %125
  %127 = load i32, ptr %9, align 4, !tbaa !36
  %128 = add i32 %127, 512
  store i32 %128, ptr %9, align 4, !tbaa !36
  br label %61, !llvm.loop !41

129:                                              ; preds = %61
  %130 = call i32 @drwav_uninit(ptr noundef %6)
  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 %131

131:                                              ; preds = %129, %34
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  br label %132

132:                                              ; preds = %131, %28
  call void @llvm.lifetime.end.p0(i64 400, ptr %6) #5
  %133 = load i32, ptr %3, align 4
  ret i32 %133
}

declare i32 @drwav_init_memory(ptr noundef, ptr noundef, i64 noundef, ptr noundef) #2

declare i32 @drwav_uninit(ptr noundef) #2

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare { i64, i1 } @llvm.umul.with.overflow.i64(i64, i64) #3

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

declare i64 @drwav_read_pcm_frames_f32(ptr noundef, i64 noundef, ptr noundef) #2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { 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 #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, !10, i64 0}
!10 = !{!"vtable pointer", !8, i64 0}
!11 = !{!12, !18, i64 120}
!12 = !{!"_ZTS5drwav", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !13, i64 32, !14, i64 64, !15, i64 68, !17, i64 108, !16, i64 112, !16, i64 114, !16, i64 116, !18, i64 120, !18, i64 128, !18, i64 136, !18, i64 144, !18, i64 152, !18, i64 160, !17, i64 168, !19, i64 172, !6, i64 176, !17, i64 184, !20, i64 192, !22, i64 216, !23, i64 256, !24, i64 308}
!13 = !{!"_ZTS26drwav_allocation_callbacks", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!14 = !{!"_ZTS15drwav_container", !7, i64 0}
!15 = !{!"_ZTS9drwav_fmt", !16, i64 0, !16, i64 2, !17, i64 4, !17, i64 8, !16, i64 12, !16, i64 14, !16, i64 16, !16, i64 18, !17, i64 20, !7, i64 24}
!16 = !{!"short", !7, i64 0}
!17 = !{!"int", !7, i64 0}
!18 = !{!"long long", !7, i64 0}
!19 = !{!"_ZTS19drwav_metadata_type", !7, i64 0}
!20 = !{!"_ZTS20drwav__memory_stream", !6, i64 0, !21, i64 8, !21, i64 16}
!21 = !{!"long", !7, i64 0}
!22 = !{!"_ZTS26drwav__memory_stream_write", !6, i64 0, !6, i64 8, !21, i64 16, !21, i64 24, !21, i64 32}
!23 = !{!"_ZTSN5drwavUt_E", !17, i64 0, !7, i64 4, !7, i64 8, !7, i64 16, !17, i64 32, !7, i64 36}
!24 = !{!"_ZTSN5drwavUt0_E", !17, i64 0, !7, i64 4, !7, i64 12, !7, i64 20, !17, i64 84}
!25 = !{!18, !18, i64 0}
!26 = !{!12, !16, i64 112}
!27 = !{!28, !6, i64 152}
!28 = !{!"_ZTSN6SoLoud3WavE", !29, i64 0, !6, i64 152, !17, i64 160}
!29 = !{!"_ZTSN6SoLoud11AudioSourceE", !17, i64 8, !30, i64 12, !30, i64 16, !17, i64 20, !17, i64 24, !30, i64 28, !30, i64 32, !30, i64 36, !17, i64 40, !30, i64 44, !7, i64 48, !6, i64 112, !6, i64 120, !6, i64 128, !17, i64 136, !31, i64 144}
!30 = !{!"float", !7, i64 0}
!31 = !{!"double", !7, i64 0}
!32 = !{!12, !17, i64 108}
!33 = !{!29, !30, i64 12}
!34 = !{!28, !17, i64 160}
!35 = !{!29, !17, i64 20}
!36 = !{!17, !17, i64 0}
!37 = !{!30, !30, i64 0}
!38 = distinct !{!38, !39}
!39 = !{!"llvm.loop.mustprogress"}
!40 = distinct !{!40, !39}
!41 = distinct !{!41, !39}


; 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.drwav = type { ptr, ptr, ptr, ptr, %struct.drwav_allocation_callbacks, i32, %struct.drwav_fmt, i32, i16, i16, i16, i64, i64, i64, i64, i64, i64, i32, i32, ptr, i32, %struct.drwav__memory_stream, %struct.drwav__memory_stream_write, %struct.anon, %struct.anon.0 }
%struct.drwav_allocation_callbacks = type { ptr, ptr, ptr, ptr }
%struct.drwav_fmt = type { i16, i16, i32, i32, i16, i16, i16, i16, i32, [16 x i8] }
%struct.drwav__memory_stream = type { ptr, i64, i64 }
%struct.drwav__memory_stream_write = type { ptr, ptr, i64, i64, i64 }
%struct.anon = type { i32, [2 x i16], [2 x i32], [4 x i32], i32, [2 x [2 x i32]] }
%struct.anon.0 = type { i32, [2 x i32], [2 x i32], [16 x i32], i32 }

; 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: mustprogress uwtable
define dso_local noundef range(i32 0, 4) i32 @_ZN6SoLoud3Wav7loadwavEPNS_10MemoryFileE(ptr nocapture noundef nonnull align 8 dereferenceable(164) %0, ptr noundef %1) local_unnamed_addr #1 align 2 {
  %3 = alloca %struct.drwav, align 8
  %4 = alloca [4096 x float], align 16
  call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %3) #5
  %5 = load ptr, ptr %1, align 8, !tbaa !5
  %6 = getelementptr inbounds i8, ptr %5, i64 64
  %7 = load ptr, ptr %6, align 8
  %8 = tail call noundef ptr %7(ptr noundef nonnull align 8 dereferenceable(25) %1)
  %9 = load ptr, ptr %1, align 8, !tbaa !5
  %10 = getelementptr inbounds i8, ptr %9, i64 32
  %11 = load ptr, ptr %10, align 8
  %12 = tail call noundef i32 %11(ptr noundef nonnull align 8 dereferenceable(25) %1)
  %13 = zext i32 %12 to i64
  %14 = call i32 @drwav_init_memory(ptr noundef nonnull %3, ptr noundef %8, i64 noundef %13, ptr noundef null)
  %.not = icmp eq i32 %14, 0
  br i1 %.not, label %101, label %15

15:                                               ; preds = %2
  %16 = getelementptr inbounds i8, ptr %3, i64 120
  %17 = load i64, ptr %16, align 8, !tbaa !8
  %.not27 = icmp eq i64 %17, 0
  br i1 %.not27, label %.sink.split, label %18

18:                                               ; preds = %15
  %19 = getelementptr inbounds i8, ptr %3, i64 112
  %20 = load i16, ptr %19, align 8, !tbaa !24
  %21 = zext i16 %20 to i64
  %22 = shl i64 %17, 2
  %23 = mul i64 %22, %21
  %24 = and i64 %23, 17179869180
  %25 = call noalias noundef nonnull ptr @_Znam(i64 noundef %24) #6
  %26 = getelementptr inbounds i8, ptr %0, i64 152
  store ptr %25, ptr %26, align 8, !tbaa !25
  %27 = getelementptr inbounds i8, ptr %3, i64 108
  %28 = load i32, ptr %27, align 4, !tbaa !30
  %29 = uitofp i32 %28 to float
  %30 = getelementptr inbounds i8, ptr %0, i64 12
  store float %29, ptr %30, align 4, !tbaa !31
  %31 = trunc i64 %17 to i32
  %32 = getelementptr inbounds i8, ptr %0, i64 160
  store i32 %31, ptr %32, align 8, !tbaa !32
  %33 = zext i16 %20 to i32
  %34 = getelementptr inbounds i8, ptr %0, i64 20
  store i32 %33, ptr %34, align 4, !tbaa !33
  %.not33 = icmp eq i32 %31, 0
  br i1 %.not33, label %.sink.split, label %.lr.ph

.lr.ph:                                           ; preds = %18, %._crit_edge30
  %indvar = phi i64 [ %indvar.next, %._crit_edge30 ], [ 0, %18 ]
  %35 = phi i32 [ %.pre41, %._crit_edge30 ], [ %31, %18 ]
  %.02331 = phi i32 [ %98, %._crit_edge30 ], [ 0, %18 ]
  %36 = zext i32 %.02331 to i64
  %37 = shl nuw nsw i64 %36, 2
  %38 = shl i64 %indvar, 9
  call void @llvm.lifetime.start.p0(i64 16384, ptr nonnull %4) #5
  %39 = sub i32 %35, %.02331
  %spec.select = call i32 @llvm.umin.i32(i32 %39, i32 512)
  %40 = zext nneg i32 %spec.select to i64
  %41 = call i64 @drwav_read_pcm_frames_f32(ptr noundef nonnull %3, i64 noundef %40, ptr noundef nonnull %4)
  %.not34 = icmp eq i32 %35, %.02331
  %.pre41 = load i32, ptr %32, align 8
  br i1 %.not34, label %._crit_edge30, label %.preheader.lr.ph

.preheader.lr.ph:                                 ; preds = %.lr.ph
  %42 = load i16, ptr %19, align 8, !tbaa !24
  %.not35 = icmp eq i16 %42, 0
  %43 = load ptr, ptr %26, align 8
  br i1 %.not35, label %._crit_edge30, label %.preheader.us.preheader

.preheader.us.preheader:                          ; preds = %.preheader.lr.ph
  %44 = zext i16 %42 to i64
  %45 = add nsw i64 %44, -1
  %umax = call i64 @llvm.umax.i64(i64 %40, i64 1)
  %46 = shl nuw nsw i64 %umax, 2
  %47 = mul nuw nsw i64 %46, %44
  %scevgep = getelementptr i8, ptr %4, i64 %47
  %scevgep42 = getelementptr i8, ptr %43, i64 %37
  %scevgep43 = getelementptr i8, ptr %43, i64 -4
  %48 = add nuw nsw i64 %umax, %44
  %49 = add nuw nsw i64 %48, %36
  %50 = shl nuw nsw i64 %49, 2
  %scevgep44 = getelementptr i8, ptr %scevgep43, i64 %50
  %min.iters.check = icmp ult i16 %42, 12
  %ident.check = icmp ne i32 %.pre41, 1
  %51 = trunc nsw i64 %45 to i32
  %52 = icmp ugt i64 %45, 4294967295
  %bound0 = icmp ult ptr %4, %scevgep44
  %bound1 = icmp ult ptr %scevgep42, %scevgep
  %found.conflict = and i1 %bound0, %bound1
  %n.vec = and i64 %44, 65528
  %cmp.n = icmp eq i64 %n.vec, %44
  %xtraiter = and i64 %44, 1
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  %53 = add nsw i64 %44, -1
  br label %.preheader.us

.preheader.us:                                    ; preds = %.preheader.us.preheader, %._crit_edge.us
  %indvars.iv38 = phi i64 [ 0, %.preheader.us.preheader ], [ %indvars.iv.next39, %._crit_edge.us ]
  %54 = mul nuw nsw i64 %indvars.iv38, %44
  %55 = trunc i64 %indvars.iv38 to i32
  %56 = add i32 %.02331, %55
  br i1 %min.iters.check, label %scalar.ph.preheader, label %vector.scevcheck

vector.scevcheck:                                 ; preds = %.preheader.us
  %57 = add i64 %38, %indvars.iv38
  %58 = trunc i64 %57 to i32
  %59 = xor i32 %58, -1
  %60 = icmp ult i32 %59, %51
  %61 = or i1 %60, %52
  %62 = or i1 %ident.check, %61
  %brmerge = select i1 %62, 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 ]
  %63 = trunc i64 %index to i32
  %64 = add nuw nsw i64 %54, %index
  %65 = getelementptr inbounds [4096 x float], ptr %4, i64 0, i64 %64
  %66 = getelementptr inbounds i8, ptr %65, i64 16
  %wide.load = load <4 x float>, ptr %65, align 4, !tbaa !34, !alias.scope !35, !noalias !38
  %wide.load45 = load <4 x float>, ptr %66, align 4, !tbaa !34, !alias.scope !35, !noalias !38
  %67 = add i32 %56, %63
  %68 = zext i32 %67 to i64
  %69 = getelementptr inbounds float, ptr %43, i64 %68
  %70 = getelementptr inbounds i8, ptr %69, i64 16
  store <4 x float> %wide.load, ptr %69, align 4, !tbaa !34, !alias.scope !38
  store <4 x float> %wide.load45, ptr %70, align 4, !tbaa !34, !alias.scope !38
  %index.next = add nuw i64 %index, 8
  %71 = icmp eq i64 %index.next, %n.vec
  br i1 %71, label %middle.block, label %vector.body, !llvm.loop !40

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
  %72 = add nuw nsw i64 %54, %indvars.iv.ph
  %73 = getelementptr inbounds [4096 x float], ptr %4, i64 0, i64 %72
  %74 = load float, ptr %73, align 4, !tbaa !34
  %75 = trunc nuw nsw i64 %indvars.iv.ph to i32
  %76 = mul i32 %.pre41, %75
  %77 = add i32 %56, %76
  %78 = zext i32 %77 to i64
  %79 = getelementptr inbounds float, ptr %43, i64 %78
  store float %74, ptr %79, align 4, !tbaa !34
  %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 ]
  %80 = icmp eq i64 %indvars.iv.ph, %53
  br i1 %80, 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 ]
  %81 = add nuw nsw i64 %54, %indvars.iv
  %82 = getelementptr inbounds [4096 x float], ptr %4, i64 0, i64 %81
  %83 = load float, ptr %82, align 4, !tbaa !34
  %84 = trunc nuw nsw i64 %indvars.iv to i32
  %85 = mul i32 %.pre41, %84
  %86 = add i32 %56, %85
  %87 = zext i32 %86 to i64
  %88 = getelementptr inbounds float, ptr %43, i64 %87
  store float %83, ptr %88, align 4, !tbaa !34
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %89 = add nuw nsw i64 %54, %indvars.iv.next
  %90 = getelementptr inbounds [4096 x float], ptr %4, i64 0, i64 %89
  %91 = load float, ptr %90, align 4, !tbaa !34
  %92 = trunc nuw nsw i64 %indvars.iv.next to i32
  %93 = mul i32 %.pre41, %92
  %94 = add i32 %56, %93
  %95 = zext i32 %94 to i64
  %96 = getelementptr inbounds float, ptr %43, i64 %95
  store float %91, ptr %96, align 4, !tbaa !34
  %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
  %exitcond.not.1 = icmp eq i64 %indvars.iv.next.1, %44
  br i1 %exitcond.not.1, label %._crit_edge.us, label %scalar.ph, !llvm.loop !44

._crit_edge.us:                                   ; preds = %scalar.ph.prol.loopexit, %scalar.ph, %middle.block
  %indvars.iv.next39 = add nuw nsw i64 %indvars.iv38, 1
  %97 = icmp ult i64 %indvars.iv.next39, %40
  br i1 %97, label %.preheader.us, label %._crit_edge30, !llvm.loop !45

._crit_edge30:                                    ; preds = %._crit_edge.us, %.preheader.lr.ph, %.lr.ph
  call void @llvm.lifetime.end.p0(i64 16384, ptr nonnull %4) #5
  %98 = add i32 %.02331, 512
  %99 = icmp ult i32 %98, %.pre41
  %indvar.next = add i64 %indvar, 1
  br i1 %99, label %.lr.ph, label %.sink.split, !llvm.loop !46

.sink.split:                                      ; preds = %._crit_edge30, %18, %15
  %.1.ph = phi i32 [ 3, %15 ], [ 0, %18 ], [ 0, %._crit_edge30 ]
  %100 = call i32 @drwav_uninit(ptr noundef nonnull %3)
  br label %101

101:                                              ; preds = %.sink.split, %2
  %.1 = phi i32 [ 3, %2 ], [ %.1.ph, %.sink.split ]
  call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %3) #5
  ret i32 %.1
}

declare i32 @drwav_init_memory(ptr noundef, ptr noundef, i64 noundef, ptr noundef) local_unnamed_addr #2

declare i32 @drwav_uninit(ptr noundef) local_unnamed_addr #2

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

declare i64 @drwav_read_pcm_frames_f32(ptr noundef, i64 noundef, ptr noundef) local_unnamed_addr #2

; 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 = { 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 = { "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 = { 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 #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !17, i64 120}
!9 = !{!"_ZTS5drwav", !10, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !12, i64 32, !13, i64 64, !14, i64 68, !16, i64 108, !15, i64 112, !15, i64 114, !15, i64 116, !17, i64 120, !17, i64 128, !17, i64 136, !17, i64 144, !17, i64 152, !17, i64 160, !16, i64 168, !18, i64 172, !10, i64 176, !16, i64 184, !19, i64 192, !21, i64 216, !22, i64 256, !23, i64 308}
!10 = !{!"any pointer", !11, i64 0}
!11 = !{!"omnipotent char", !7, i64 0}
!12 = !{!"_ZTS26drwav_allocation_callbacks", !10, i64 0, !10, i64 8, !10, i64 16, !10, i64 24}
!13 = !{!"_ZTS15drwav_container", !11, i64 0}
!14 = !{!"_ZTS9drwav_fmt", !15, i64 0, !15, i64 2, !16, i64 4, !16, i64 8, !15, i64 12, !15, i64 14, !15, i64 16, !15, i64 18, !16, i64 20, !11, i64 24}
!15 = !{!"short", !11, i64 0}
!16 = !{!"int", !11, i64 0}
!17 = !{!"long long", !11, i64 0}
!18 = !{!"_ZTS19drwav_metadata_type", !11, i64 0}
!19 = !{!"_ZTS20drwav__memory_stream", !10, i64 0, !20, i64 8, !20, i64 16}
!20 = !{!"long", !11, i64 0}
!21 = !{!"_ZTS26drwav__memory_stream_write", !10, i64 0, !10, i64 8, !20, i64 16, !20, i64 24, !20, i64 32}
!22 = !{!"_ZTSN5drwavUt_E", !16, i64 0, !11, i64 4, !11, i64 8, !11, i64 16, !16, i64 32, !11, i64 36}
!23 = !{!"_ZTSN5drwavUt0_E", !16, i64 0, !11, i64 4, !11, i64 12, !11, i64 20, !16, i64 84}
!24 = !{!9, !15, i64 112}
!25 = !{!26, !10, i64 152}
!26 = !{!"_ZTSN6SoLoud3WavE", !27, i64 0, !10, i64 152, !16, i64 160}
!27 = !{!"_ZTSN6SoLoud11AudioSourceE", !16, i64 8, !28, i64 12, !28, i64 16, !16, i64 20, !16, i64 24, !28, i64 28, !28, i64 32, !28, i64 36, !16, i64 40, !28, i64 44, !11, i64 48, !10, i64 112, !10, i64 120, !10, i64 128, !16, i64 136, !29, i64 144}
!28 = !{!"float", !11, i64 0}
!29 = !{!"double", !11, i64 0}
!30 = !{!9, !16, i64 108}
!31 = !{!27, !28, i64 12}
!32 = !{!26, !16, i64 160}
!33 = !{!27, !16, i64 20}
!34 = !{!28, !28, i64 0}
!35 = !{!36}
!36 = distinct !{!36, !37}
!37 = distinct !{!37, !"LVerDomain"}
!38 = !{!39}
!39 = distinct !{!39, !37}
!40 = distinct !{!40, !41, !42, !43}
!41 = !{!"llvm.loop.mustprogress"}
!42 = !{!"llvm.loop.isvectorized", i32 1}
!43 = !{!"llvm.loop.unroll.runtime.disable"}
!44 = distinct !{!44, !41, !42}
!45 = distinct !{!45, !41}
!46 = distinct !{!46, !41}


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