; LLVM IR from merpheus-dev/LavaEngine :: src/Utils/soloud/src/audiosource/wav (dr_impl)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

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

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

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

; Function Attrs: mustprogress uwtable
declare hidden noundef i32 @_ZL27drwav__riff_chunk_size_riffm(i64 noundef) #1

; Function Attrs: mustprogress uwtable
declare hidden noundef i64 @_ZL26drwav__riff_chunk_size_w64m(i64 noundef) #1

; Function Attrs: mustprogress uwtable
define dso_local i32 @drwav_uninit(ptr noundef %0) #1 {
  %2 = alloca i32, align 4
  %3 = alloca ptr, align 8
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i64, align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i64, align 8
  %11 = alloca i64, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #3
  store i32 0, ptr %4, align 4, !tbaa !9
  %12 = load ptr, ptr %3, align 8, !tbaa !5
  %13 = icmp eq ptr %12, null
  br i1 %13, label %14, label %15

14:                                               ; preds = %1
  store i32 -2, ptr %2, align 4
  store i32 1, ptr %5, align 4
  br label %178

15:                                               ; preds = %1
  %16 = load ptr, ptr %3, align 8, !tbaa !5
  %17 = getelementptr inbounds %struct.drwav, ptr %16, i32 0, i32 1
  %18 = load ptr, ptr %17, align 8, !tbaa !11
  %19 = icmp ne ptr %18, null
  br i1 %19, label %20, label %176

20:                                               ; preds = %15
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #3
  store i32 0, ptr %6, align 4, !tbaa !9
  %21 = load ptr, ptr %3, align 8, !tbaa !5
  %22 = getelementptr inbounds %struct.drwav, ptr %21, i32 0, i32 5
  %23 = load i32, ptr %22, align 8, !tbaa !24
  %24 = icmp eq i32 %23, 0
  br i1 %24, label %25, label %30

25:                                               ; preds = %20
  %26 = load ptr, ptr %3, align 8, !tbaa !5
  %27 = getelementptr inbounds %struct.drwav, ptr %26, i32 0, i32 12
  %28 = load i64, ptr %27, align 8, !tbaa !25
  %29 = call noundef i32 @_ZL30drwav__chunk_padding_size_riffm(i64 noundef %28)
  store i32 %29, ptr %6, align 4, !tbaa !9
  br label %35

30:                                               ; preds = %20
  %31 = load ptr, ptr %3, align 8, !tbaa !5
  %32 = getelementptr inbounds %struct.drwav, ptr %31, i32 0, i32 12
  %33 = load i64, ptr %32, align 8, !tbaa !25
  %34 = call noundef i32 @_ZL29drwav__chunk_padding_size_w64m(i64 noundef %33)
  store i32 %34, ptr %6, align 4, !tbaa !9
  br label %35

35:                                               ; preds = %30, %25
  %36 = load i32, ptr %6, align 4, !tbaa !9
  %37 = icmp ugt i32 %36, 0
  br i1 %37, label %38, label %48

38:                                               ; preds = %35
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #3
  store i64 0, ptr %7, align 8, !tbaa !26
  %39 = load ptr, ptr %3, align 8, !tbaa !5
  %40 = getelementptr inbounds %struct.drwav, ptr %39, i32 0, i32 1
  %41 = load ptr, ptr %40, align 8, !tbaa !11
  %42 = load ptr, ptr %3, align 8, !tbaa !5
  %43 = getelementptr inbounds %struct.drwav, ptr %42, i32 0, i32 3
  %44 = load ptr, ptr %43, align 8, !tbaa !27
  %45 = load i32, ptr %6, align 4, !tbaa !9
  %46 = zext i32 %45 to i64
  %47 = call noundef i64 %41(ptr noundef %44, ptr noundef %7, i64 noundef %46)
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #3
  br label %48

48:                                               ; preds = %38, %35
  %49 = load ptr, ptr %3, align 8, !tbaa !5
  %50 = getelementptr inbounds %struct.drwav, ptr %49, i32 0, i32 2
  %51 = load ptr, ptr %50, align 8, !tbaa !28
  %52 = icmp ne ptr %51, null
  br i1 %52, label %53, label %160

53:                                               ; preds = %48
  %54 = load ptr, ptr %3, align 8, !tbaa !5
  %55 = getelementptr inbounds %struct.drwav, ptr %54, i32 0, i32 16
  %56 = load i32, ptr %55, align 8, !tbaa !29
  %57 = icmp ne i32 %56, 0
  br i1 %57, label %160, label %58

58:                                               ; preds = %53
  %59 = load ptr, ptr %3, align 8, !tbaa !5
  %60 = getelementptr inbounds %struct.drwav, ptr %59, i32 0, i32 5
  %61 = load i32, ptr %60, align 8, !tbaa !24
  %62 = icmp eq i32 %61, 0
  br i1 %62, label %63, label %111

63:                                               ; preds = %58
  %64 = load ptr, ptr %3, align 8, !tbaa !5
  %65 = getelementptr inbounds %struct.drwav, ptr %64, i32 0, i32 2
  %66 = load ptr, ptr %65, align 8, !tbaa !28
  %67 = load ptr, ptr %3, align 8, !tbaa !5
  %68 = getelementptr inbounds %struct.drwav, ptr %67, i32 0, i32 3
  %69 = load ptr, ptr %68, align 8, !tbaa !27
  %70 = call noundef i32 %66(ptr noundef %69, i32 noundef 4, i32 noundef 0)
  %71 = icmp ne i32 %70, 0
  br i1 %71, label %72, label %84

72:                                               ; preds = %63
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #3
  %73 = load ptr, ptr %3, align 8, !tbaa !5
  %74 = getelementptr inbounds %struct.drwav, ptr %73, i32 0, i32 12
  %75 = load i64, ptr %74, align 8, !tbaa !25
  %76 = call noundef i32 @_ZL27drwav__riff_chunk_size_riffm(i64 noundef %75)
  store i32 %76, ptr %8, align 4, !tbaa !9
  %77 = load ptr, ptr %3, align 8, !tbaa !5
  %78 = getelementptr inbounds %struct.drwav, ptr %77, i32 0, i32 1
  %79 = load ptr, ptr %78, align 8, !tbaa !11
  %80 = load ptr, ptr %3, align 8, !tbaa !5
  %81 = getelementptr inbounds %struct.drwav, ptr %80, i32 0, i32 3
  %82 = load ptr, ptr %81, align 8, !tbaa !27
  %83 = call noundef i64 %79(ptr noundef %82, ptr noundef %8, i64 noundef 4)
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #3
  br label %84

84:                                               ; preds = %72, %63
  %85 = load ptr, ptr %3, align 8, !tbaa !5
  %86 = getelementptr inbounds %struct.drwav, ptr %85, i32 0, i32 2
  %87 = load ptr, ptr %86, align 8, !tbaa !28
  %88 = load ptr, ptr %3, align 8, !tbaa !5
  %89 = getelementptr inbounds %struct.drwav, ptr %88, i32 0, i32 3
  %90 = load ptr, ptr %89, align 8, !tbaa !27
  %91 = load ptr, ptr %3, align 8, !tbaa !5
  %92 = getelementptr inbounds %struct.drwav, ptr %91, i32 0, i32 13
  %93 = load i64, ptr %92, align 8, !tbaa !30
  %94 = trunc i64 %93 to i32
  %95 = add nsw i32 %94, 4
  %96 = call noundef i32 %87(ptr noundef %90, i32 noundef %95, i32 noundef 0)
  %97 = icmp ne i32 %96, 0
  br i1 %97, label %98, label %110

98:                                               ; preds = %84
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #3
  %99 = load ptr, ptr %3, align 8, !tbaa !5
  %100 = getelementptr inbounds %struct.drwav, ptr %99, i32 0, i32 12
  %101 = load i64, ptr %100, align 8, !tbaa !25
  %102 = call noundef i32 @_ZL27drwav__data_chunk_size_riffm(i64 noundef %101)
  store i32 %102, ptr %9, align 4, !tbaa !9
  %103 = load ptr, ptr %3, align 8, !tbaa !5
  %104 = getelementptr inbounds %struct.drwav, ptr %103, i32 0, i32 1
  %105 = load ptr, ptr %104, align 8, !tbaa !11
  %106 = load ptr, ptr %3, align 8, !tbaa !5
  %107 = getelementptr inbounds %struct.drwav, ptr %106, i32 0, i32 3
  %108 = load ptr, ptr %107, align 8, !tbaa !27
  %109 = call noundef i64 %105(ptr noundef %108, ptr noundef %9, i64 noundef 4)
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #3
  br label %110

110:                                              ; preds = %98, %84
  br label %159

111:                                              ; preds = %58
  %112 = load ptr, ptr %3, align 8, !tbaa !5
  %113 = getelementptr inbounds %struct.drwav, ptr %112, i32 0, i32 2
  %114 = load ptr, ptr %113, align 8, !tbaa !28
  %115 = load ptr, ptr %3, align 8, !tbaa !5
  %116 = getelementptr inbounds %struct.drwav, ptr %115, i32 0, i32 3
  %117 = load ptr, ptr %116, align 8, !tbaa !27
  %118 = call noundef i32 %114(ptr noundef %117, i32 noundef 16, i32 noundef 0)
  %119 = icmp ne i32 %118, 0
  br i1 %119, label %120, label %132

120:                                              ; preds = %111
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #3
  %121 = load ptr, ptr %3, align 8, !tbaa !5
  %122 = getelementptr inbounds %struct.drwav, ptr %121, i32 0, i32 12
  %123 = load i64, ptr %122, align 8, !tbaa !25
  %124 = call noundef i64 @_ZL26drwav__riff_chunk_size_w64m(i64 noundef %123)
  store i64 %124, ptr %10, align 8, !tbaa !26
  %125 = load ptr, ptr %3, align 8, !tbaa !5
  %126 = getelementptr inbounds %struct.drwav, ptr %125, i32 0, i32 1
  %127 = load ptr, ptr %126, align 8, !tbaa !11
  %128 = load ptr, ptr %3, align 8, !tbaa !5
  %129 = getelementptr inbounds %struct.drwav, ptr %128, i32 0, i32 3
  %130 = load ptr, ptr %129, align 8, !tbaa !27
  %131 = call noundef i64 %127(ptr noundef %130, ptr noundef %10, i64 noundef 8)
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #3
  br label %132

132:                                              ; preds = %120, %111
  %133 = load ptr, ptr %3, align 8, !tbaa !5
  %134 = getelementptr inbounds %struct.drwav, ptr %133, i32 0, i32 2
  %135 = load ptr, ptr %134, align 8, !tbaa !28
  %136 = load ptr, ptr %3, align 8, !tbaa !5
  %137 = getelementptr inbounds %struct.drwav, ptr %136, i32 0, i32 3
  %138 = load ptr, ptr %137, align 8, !tbaa !27
  %139 = load ptr, ptr %3, align 8, !tbaa !5
  %140 = getelementptr inbounds %struct.drwav, ptr %139, i32 0, i32 13
  %141 = load i64, ptr %140, align 8, !tbaa !30
  %142 = trunc i64 %141 to i32
  %143 = add nsw i32 %142, 16
  %144 = call noundef i32 %135(ptr noundef %138, i32 noundef %143, i32 noundef 0)
  %145 = icmp ne i32 %144, 0
  br i1 %145, label %146, label %158

146:                                              ; preds = %132
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #3
  %147 = load ptr, ptr %3, align 8, !tbaa !5
  %148 = getelementptr inbounds %struct.drwav, ptr %147, i32 0, i32 12
  %149 = load i64, ptr %148, align 8, !tbaa !25
  %150 = call noundef i64 @_ZL26drwav__data_chunk_size_w64m(i64 noundef %149)
  store i64 %150, ptr %11, align 8, !tbaa !26
  %151 = load ptr, ptr %3, align 8, !tbaa !5
  %152 = getelementptr inbounds %struct.drwav, ptr %151, i32 0, i32 1
  %153 = load ptr, ptr %152, align 8, !tbaa !11
  %154 = load ptr, ptr %3, align 8, !tbaa !5
  %155 = getelementptr inbounds %struct.drwav, ptr %154, i32 0, i32 3
  %156 = load ptr, ptr %155, align 8, !tbaa !27
  %157 = call noundef i64 %153(ptr noundef %156, ptr noundef %11, i64 noundef 8)
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #3
  br label %158

158:                                              ; preds = %146, %132
  br label %159

159:                                              ; preds = %158, %110
  br label %160

160:                                              ; preds = %159, %53, %48
  %161 = load ptr, ptr %3, align 8, !tbaa !5
  %162 = getelementptr inbounds %struct.drwav, ptr %161, i32 0, i32 16
  %163 = load i32, ptr %162, align 8, !tbaa !29
  %164 = icmp ne i32 %163, 0
  br i1 %164, label %165, label %175

165:                                              ; preds = %160
  %166 = load ptr, ptr %3, align 8, !tbaa !5
  %167 = getelementptr inbounds %struct.drwav, ptr %166, i32 0, i32 12
  %168 = load i64, ptr %167, align 8, !tbaa !25
  %169 = load ptr, ptr %3, align 8, !tbaa !5
  %170 = getelementptr inbounds %struct.drwav, ptr %169, i32 0, i32 15
  %171 = load i64, ptr %170, align 8, !tbaa !31
  %172 = icmp ne i64 %168, %171
  br i1 %172, label %173, label %174

173:                                              ; preds = %165
  store i32 -100, ptr %4, align 4, !tbaa !9
  br label %174

174:                                              ; preds = %173, %165
  br label %175

175:                                              ; preds = %174, %160
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #3
  br label %176

176:                                              ; preds = %175, %15
  %177 = load i32, ptr %4, align 4, !tbaa !9
  store i32 %177, ptr %2, align 4
  store i32 1, ptr %5, align 4
  br label %178

178:                                              ; preds = %176, %14
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #3
  %179 = load i32, ptr %2, align 4
  ret i32 %179
}

; Function Attrs: mustprogress nounwind uwtable
declare hidden noundef i32 @_ZL30drwav__chunk_padding_size_riffm(i64 noundef) #2

; Function Attrs: mustprogress nounwind uwtable
declare hidden noundef i32 @_ZL29drwav__chunk_padding_size_w64m(i64 noundef) #2

; Function Attrs: mustprogress nounwind uwtable
declare hidden noundef i32 @_ZL27drwav__data_chunk_size_riffm(i64 noundef) #2

; Function Attrs: mustprogress nounwind uwtable
declare hidden noundef i64 @_ZL26drwav__data_chunk_size_w64m(i64 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 = { 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 = { 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 = !{!"int", !7, i64 0}
!11 = !{!12, !6, i64 8}
!12 = !{!"_ZTS5drwav", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !13, i64 32, !14, i64 64, !15, i64 68, !10, i64 108, !16, i64 112, !16, i64 114, !16, i64 116, !17, i64 120, !17, i64 128, !17, i64 136, !17, i64 144, !17, i64 152, !10, i64 160, !18, i64 164, !19, i64 224, !20, i64 248, !21, i64 288, !22, i64 296, !23, i64 348}
!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, !10, i64 4, !10, i64 8, !16, i64 12, !16, i64 14, !16, i64 16, !16, i64 18, !10, i64 20, !7, i64 24}
!16 = !{!"short", !7, i64 0}
!17 = !{!"long", !7, i64 0}
!18 = !{!"_ZTS10drwav_smpl", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !10, i64 16, !10, i64 20, !10, i64 24, !10, i64 28, !10, i64 32, !7, i64 36}
!19 = !{!"_ZTS20drwav__memory_stream", !6, i64 0, !17, i64 8, !17, i64 16}
!20 = !{!"_ZTS26drwav__memory_stream_write", !6, i64 0, !6, i64 8, !17, i64 16, !17, i64 24, !17, i64 32}
!21 = !{!"_ZTSN5drwavUt_E", !17, i64 0}
!22 = !{!"_ZTSN5drwavUt0_E", !10, i64 0, !7, i64 4, !7, i64 8, !7, i64 16, !10, i64 32, !7, i64 36}
!23 = !{!"_ZTSN5drwavUt1_E", !10, i64 0, !7, i64 4, !7, i64 12, !7, i64 20, !10, i64 84}
!24 = !{!12, !14, i64 64}
!25 = !{!12, !17, i64 128}
!26 = !{!17, !17, i64 0}
!27 = !{!12, !6, i64 24}
!28 = !{!12, !6, i64 16}
!29 = !{!12, !10, i64 160}
!30 = !{!12, !17, i64 136}
!31 = !{!12, !17, i64 152}


; 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: mustprogress uwtable
declare hidden noundef i32 @_ZL27drwav__riff_chunk_size_riffm(i64 noundef) local_unnamed_addr #1

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

; Function Attrs: mustprogress uwtable
define dso_local range(i32 -100, 1) i32 @drwav_uninit(ptr noundef readonly %0) local_unnamed_addr #1 {
  %2 = alloca i64, align 8
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i64, align 8
  %6 = alloca i64, align 8
  %7 = icmp eq ptr %0, null
  br i1 %7, label %95, label %8

8:                                                ; preds = %1
  %9 = getelementptr inbounds i8, ptr %0, i64 8
  %10 = load ptr, ptr %9, align 8, !tbaa !5
  %.not = icmp eq ptr %10, null
  br i1 %.not, label %95, label %11

11:                                               ; preds = %8
  %12 = getelementptr inbounds i8, ptr %0, i64 64
  %13 = load i32, ptr %12, align 8, !tbaa !22
  %14 = icmp eq i32 %13, 0
  %15 = getelementptr inbounds i8, ptr %0, i64 128
  %16 = load i64, ptr %15, align 8, !tbaa !23
  br i1 %14, label %17, label %19

17:                                               ; preds = %11
  %18 = tail call noundef i32 @_ZL30drwav__chunk_padding_size_riffm(i64 noundef %16)
  br label %21

19:                                               ; preds = %11
  %20 = tail call noundef i32 @_ZL29drwav__chunk_padding_size_w64m(i64 noundef %16)
  br label %21

21:                                               ; preds = %19, %17
  %.0 = phi i32 [ %18, %17 ], [ %20, %19 ]
  %.not42 = icmp eq i32 %.0, 0
  br i1 %.not42, label %28, label %22

22:                                               ; preds = %21
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #3
  store i64 0, ptr %2, align 8, !tbaa !24
  %23 = load ptr, ptr %9, align 8, !tbaa !5
  %24 = getelementptr inbounds i8, ptr %0, i64 24
  %25 = load ptr, ptr %24, align 8, !tbaa !25
  %26 = zext i32 %.0 to i64
  %27 = call noundef i64 %23(ptr noundef %25, ptr noundef nonnull %2, i64 noundef %26)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #3
  br label %28

28:                                               ; preds = %22, %21
  %29 = getelementptr inbounds i8, ptr %0, i64 16
  %30 = load ptr, ptr %29, align 8, !tbaa !26
  %.not43 = icmp eq ptr %30, null
  br i1 %.not43, label %87, label %31

31:                                               ; preds = %28
  %32 = getelementptr inbounds i8, ptr %0, i64 160
  %33 = load i32, ptr %32, align 8, !tbaa !27
  %.not44 = icmp eq i32 %33, 0
  br i1 %.not44, label %34, label %87

34:                                               ; preds = %31
  %35 = load i32, ptr %12, align 8, !tbaa !22
  %36 = icmp eq i32 %35, 0
  %37 = getelementptr inbounds i8, ptr %0, i64 24
  %38 = load ptr, ptr %37, align 8, !tbaa !25
  br i1 %36, label %39, label %63

39:                                               ; preds = %34
  %40 = call noundef i32 %30(ptr noundef %38, i32 noundef 4, i32 noundef 0)
  %.not47 = icmp eq i32 %40, 0
  br i1 %.not47, label %48, label %41

41:                                               ; preds = %39
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #3
  %42 = getelementptr inbounds i8, ptr %0, i64 128
  %43 = load i64, ptr %42, align 8, !tbaa !23
  %44 = call noundef i32 @_ZL27drwav__riff_chunk_size_riffm(i64 noundef %43)
  store i32 %44, ptr %3, align 4, !tbaa !28
  %45 = load ptr, ptr %9, align 8, !tbaa !5
  %46 = load ptr, ptr %37, align 8, !tbaa !25
  %47 = call noundef i64 %45(ptr noundef %46, ptr noundef nonnull %3, i64 noundef 4)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #3
  br label %48

48:                                               ; preds = %41, %39
  %49 = load ptr, ptr %29, align 8, !tbaa !26
  %50 = load ptr, ptr %37, align 8, !tbaa !25
  %51 = getelementptr inbounds i8, ptr %0, i64 136
  %52 = load i64, ptr %51, align 8, !tbaa !29
  %53 = trunc i64 %52 to i32
  %54 = add nsw i32 %53, 4
  %55 = call noundef i32 %49(ptr noundef %50, i32 noundef %54, i32 noundef 0)
  %.not48 = icmp eq i32 %55, 0
  br i1 %.not48, label %87, label %56

56:                                               ; preds = %48
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #3
  %57 = getelementptr inbounds i8, ptr %0, i64 128
  %58 = load i64, ptr %57, align 8, !tbaa !23
  %59 = call noundef i32 @_ZL27drwav__data_chunk_size_riffm(i64 noundef %58)
  store i32 %59, ptr %4, align 4, !tbaa !28
  %60 = load ptr, ptr %9, align 8, !tbaa !5
  %61 = load ptr, ptr %37, align 8, !tbaa !25
  %62 = call noundef i64 %60(ptr noundef %61, ptr noundef nonnull %4, i64 noundef 4)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #3
  br label %87

63:                                               ; preds = %34
  %64 = call noundef i32 %30(ptr noundef %38, i32 noundef 16, i32 noundef 0)
  %.not45 = icmp eq i32 %64, 0
  br i1 %.not45, label %72, label %65

65:                                               ; preds = %63
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #3
  %66 = getelementptr inbounds i8, ptr %0, i64 128
  %67 = load i64, ptr %66, align 8, !tbaa !23
  %68 = call noundef i64 @_ZL26drwav__riff_chunk_size_w64m(i64 noundef %67)
  store i64 %68, ptr %5, align 8, !tbaa !24
  %69 = load ptr, ptr %9, align 8, !tbaa !5
  %70 = load ptr, ptr %37, align 8, !tbaa !25
  %71 = call noundef i64 %69(ptr noundef %70, ptr noundef nonnull %5, i64 noundef 8)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #3
  br label %72

72:                                               ; preds = %65, %63
  %73 = load ptr, ptr %29, align 8, !tbaa !26
  %74 = load ptr, ptr %37, align 8, !tbaa !25
  %75 = getelementptr inbounds i8, ptr %0, i64 136
  %76 = load i64, ptr %75, align 8, !tbaa !29
  %77 = trunc i64 %76 to i32
  %78 = add nsw i32 %77, 16
  %79 = call noundef i32 %73(ptr noundef %74, i32 noundef %78, i32 noundef 0)
  %.not46 = icmp eq i32 %79, 0
  br i1 %.not46, label %87, label %80

80:                                               ; preds = %72
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #3
  %81 = getelementptr inbounds i8, ptr %0, i64 128
  %82 = load i64, ptr %81, align 8, !tbaa !23
  %83 = call noundef i64 @_ZL26drwav__data_chunk_size_w64m(i64 noundef %82)
  store i64 %83, ptr %6, align 8, !tbaa !24
  %84 = load ptr, ptr %9, align 8, !tbaa !5
  %85 = load ptr, ptr %37, align 8, !tbaa !25
  %86 = call noundef i64 %84(ptr noundef %85, ptr noundef nonnull %6, i64 noundef 8)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #3
  br label %87

87:                                               ; preds = %56, %48, %80, %72, %31, %28
  %88 = getelementptr inbounds i8, ptr %0, i64 160
  %89 = load i32, ptr %88, align 8, !tbaa !27
  %.not49 = icmp eq i32 %89, 0
  br i1 %.not49, label %95, label %90

90:                                               ; preds = %87
  %91 = getelementptr inbounds i8, ptr %0, i64 128
  %92 = load i64, ptr %91, align 8, !tbaa !23
  %93 = getelementptr inbounds i8, ptr %0, i64 152
  %94 = load i64, ptr %93, align 8, !tbaa !30
  %.not50 = icmp eq i64 %92, %94
  %spec.select = select i1 %.not50, i32 0, i32 -100
  br label %95

95:                                               ; preds = %90, %8, %87, %1
  %.039 = phi i32 [ -2, %1 ], [ 0, %8 ], [ 0, %87 ], [ %spec.select, %90 ]
  ret i32 %.039
}

; Function Attrs: mustprogress nounwind uwtable
declare hidden noundef i32 @_ZL30drwav__chunk_padding_size_riffm(i64 noundef) local_unnamed_addr #2

; Function Attrs: mustprogress nounwind uwtable
declare hidden noundef i32 @_ZL29drwav__chunk_padding_size_w64m(i64 noundef) local_unnamed_addr #2

; Function Attrs: mustprogress nounwind uwtable
declare hidden noundef i32 @_ZL27drwav__data_chunk_size_riffm(i64 noundef) local_unnamed_addr #2

; Function Attrs: mustprogress nounwind uwtable
declare hidden noundef i64 @_ZL26drwav__data_chunk_size_w64m(i64 noundef) local_unnamed_addr #2

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 = { 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 = { 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, !7, i64 8}
!6 = !{!"_ZTS5drwav", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !10, i64 32, !11, i64 64, !12, i64 68, !14, i64 108, !13, i64 112, !13, i64 114, !13, i64 116, !15, i64 120, !15, i64 128, !15, i64 136, !15, i64 144, !15, i64 152, !14, i64 160, !16, i64 164, !17, i64 224, !18, i64 248, !19, i64 288, !20, i64 296, !21, i64 348}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"_ZTS26drwav_allocation_callbacks", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24}
!11 = !{!"_ZTS15drwav_container", !8, i64 0}
!12 = !{!"_ZTS9drwav_fmt", !13, i64 0, !13, i64 2, !14, i64 4, !14, i64 8, !13, i64 12, !13, i64 14, !13, i64 16, !13, i64 18, !14, i64 20, !8, i64 24}
!13 = !{!"short", !8, i64 0}
!14 = !{!"int", !8, i64 0}
!15 = !{!"long", !8, i64 0}
!16 = !{!"_ZTS10drwav_smpl", !14, i64 0, !14, i64 4, !14, i64 8, !14, i64 12, !14, i64 16, !14, i64 20, !14, i64 24, !14, i64 28, !14, i64 32, !8, i64 36}
!17 = !{!"_ZTS20drwav__memory_stream", !7, i64 0, !15, i64 8, !15, i64 16}
!18 = !{!"_ZTS26drwav__memory_stream_write", !7, i64 0, !7, i64 8, !15, i64 16, !15, i64 24, !15, i64 32}
!19 = !{!"_ZTSN5drwavUt_E", !15, i64 0}
!20 = !{!"_ZTSN5drwavUt0_E", !14, i64 0, !8, i64 4, !8, i64 8, !8, i64 16, !14, i64 32, !8, i64 36}
!21 = !{!"_ZTSN5drwavUt1_E", !14, i64 0, !8, i64 4, !8, i64 12, !8, i64 20, !14, i64 84}
!22 = !{!6, !11, i64 64}
!23 = !{!6, !15, i64 128}
!24 = !{!15, !15, i64 0}
!25 = !{!6, !7, i64 24}
!26 = !{!6, !7, i64 16}
!27 = !{!6, !14, i64 160}
!28 = !{!14, !14, i64 0}
!29 = !{!6, !15, i64 136}
!30 = !{!6, !15, i64 152}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass