; LLVM IR from gabekz/GoodsackEngine :: goodsack/gsk/gsk/asset/import (loader_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.gsk_AudioData = type { i32, i32, i32, i32, ptr }

@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [42 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [36 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [42 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [48 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [41 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [16 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local ptr @gsk_load_wav(ptr noundef %0) #0 {
  %2 = alloca ptr, align 8
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca [4 x i8], align 1
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i16, align 2
  %9 = alloca i16, align 2
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i16, align 2
  %13 = alloca i16, align 2
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i16, align 2
  %17 = alloca ptr, align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #6
  %18 = call noalias ptr @malloc(i64 noundef 24) #7
  store ptr %18, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  call void @llvm.lifetime.start.p0(i64 2, ptr %8) #6
  call void @llvm.lifetime.start.p0(i64 2, ptr %9) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  call void @llvm.lifetime.start.p0(i64 2, ptr %12) #6
  call void @llvm.lifetime.start.p0(i64 2, ptr %13) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #6
  %19 = load ptr, ptr %2, align 8, !tbaa !5
  %20 = call noalias ptr @fopen(ptr noundef %19, ptr noundef @.str)
  store ptr %20, ptr %4, align 8, !tbaa !5
  %21 = load ptr, ptr %4, align 8, !tbaa !5
  %22 = icmp eq ptr %21, null
  br i1 %22, label %23, label %25

23:                                               ; preds = %1
  %24 = load ptr, ptr %2, align 8, !tbaa !5
  call void (i32, ptr, i32, ptr, ...) @logger_log(i32 noundef 5, ptr noundef @.str.1, i32 noundef 34, ptr noundef @.str.2, ptr noundef %24)
  br label %25

25:                                               ; preds = %23, %1
  %26 = getelementptr inbounds [4 x i8], ptr %5, i64 0, i64 0
  %27 = load ptr, ptr %4, align 8, !tbaa !5
  %28 = call i64 @fread(ptr noundef %26, i64 noundef 1, i64 noundef 4, ptr noundef %27)
  %29 = getelementptr inbounds [4 x i8], ptr %5, i64 0, i64 0
  %30 = call i32 @strcmp(ptr noundef %29, ptr noundef @.str.3) #8
  %31 = icmp ne i32 %30, 0
  br i1 %31, label %32, label %34

32:                                               ; preds = %25
  %33 = getelementptr inbounds [4 x i8], ptr %5, i64 0, i64 0
  call void (i32, ptr, i32, ptr, ...) @logger_log(i32 noundef 5, ptr noundef @.str.1, i32 noundef 39, ptr noundef @.str.4, ptr noundef %33)
  br label %34

34:                                               ; preds = %32, %25
  %35 = load ptr, ptr %4, align 8, !tbaa !5
  %36 = call i64 @fread(ptr noundef %6, i64 noundef 4, i64 noundef 1, ptr noundef %35)
  %37 = getelementptr inbounds [4 x i8], ptr %5, i64 0, i64 0
  %38 = load ptr, ptr %4, align 8, !tbaa !5
  %39 = call i64 @fread(ptr noundef %37, i64 noundef 1, i64 noundef 4, ptr noundef %38)
  %40 = getelementptr inbounds [4 x i8], ptr %5, i64 0, i64 0
  %41 = call i32 @strcmp(ptr noundef %40, ptr noundef @.str.5) #8
  %42 = icmp ne i32 %41, 0
  br i1 %42, label %43, label %44

43:                                               ; preds = %34
  call void (i32, ptr, i32, ptr, ...) @logger_log(i32 noundef 5, ptr noundef @.str.1, i32 noundef 45, ptr noundef @.str.6)
  br label %44

44:                                               ; preds = %43, %34
  %45 = getelementptr inbounds [4 x i8], ptr %5, i64 0, i64 0
  %46 = load ptr, ptr %4, align 8, !tbaa !5
  %47 = call i64 @fread(ptr noundef %45, i64 noundef 1, i64 noundef 4, ptr noundef %46)
  %48 = getelementptr inbounds [4 x i8], ptr %5, i64 0, i64 0
  %49 = call i32 @strcmp(ptr noundef %48, ptr noundef @.str.7) #8
  %50 = icmp ne i32 %49, 0
  br i1 %50, label %51, label %52

51:                                               ; preds = %44
  call void (i32, ptr, i32, ptr, ...) @logger_log(i32 noundef 5, ptr noundef @.str.1, i32 noundef 48, ptr noundef @.str.6)
  br label %52

52:                                               ; preds = %51, %44
  %53 = load ptr, ptr %4, align 8, !tbaa !5
  %54 = call i64 @fread(ptr noundef %7, i64 noundef 4, i64 noundef 1, ptr noundef %53)
  %55 = load ptr, ptr %4, align 8, !tbaa !5
  %56 = call i64 @fread(ptr noundef %8, i64 noundef 2, i64 noundef 1, ptr noundef %55)
  %57 = load i16, ptr %8, align 2, !tbaa !9
  %58 = sext i16 %57 to i32
  %59 = icmp ne i32 %58, 1
  br i1 %59, label %60, label %62

60:                                               ; preds = %52
  %61 = getelementptr inbounds [4 x i8], ptr %5, i64 0, i64 0
  call void (i32, ptr, i32, ptr, ...) @logger_log(i32 noundef 5, ptr noundef @.str.1, i32 noundef 55, ptr noundef @.str.8, ptr noundef %61)
  br label %62

62:                                               ; preds = %60, %52
  %63 = load ptr, ptr %4, align 8, !tbaa !5
  %64 = call i64 @fread(ptr noundef %9, i64 noundef 2, i64 noundef 1, ptr noundef %63)
  %65 = load i16, ptr %9, align 2, !tbaa !9
  %66 = sext i16 %65 to i32
  %67 = icmp ne i32 %66, 1
  br i1 %67, label %68, label %71

68:                                               ; preds = %62
  %69 = load i16, ptr %9, align 2, !tbaa !9
  %70 = sext i16 %69 to i32
  call void (i32, ptr, i32, ptr, ...) @logger_log(i32 noundef 5, ptr noundef @.str.1, i32 noundef 61, ptr noundef @.str.9, i32 noundef %70)
  br label %71

71:                                               ; preds = %68, %62
  %72 = load i16, ptr %9, align 2, !tbaa !9
  %73 = sext i16 %72 to i32
  %74 = load ptr, ptr %3, align 8, !tbaa !5
  %75 = getelementptr inbounds %struct.gsk_AudioData, ptr %74, i32 0, i32 1
  store i32 %73, ptr %75, align 4, !tbaa !11
  %76 = load ptr, ptr %4, align 8, !tbaa !5
  %77 = call i64 @fread(ptr noundef %10, i64 noundef 4, i64 noundef 1, ptr noundef %76)
  %78 = load i32, ptr %10, align 4, !tbaa !14
  %79 = icmp ne i32 %78, 44100
  br i1 %79, label %80, label %82

80:                                               ; preds = %71
  %81 = load i32, ptr %10, align 4, !tbaa !14
  call void (i32, ptr, i32, ptr, ...) @logger_log(i32 noundef 5, ptr noundef @.str.1, i32 noundef 70, ptr noundef @.str.10, i32 noundef 44100, i32 noundef %81)
  br label %82

82:                                               ; preds = %80, %71
  %83 = load i32, ptr %10, align 4, !tbaa !14
  %84 = load ptr, ptr %3, align 8, !tbaa !5
  %85 = getelementptr inbounds %struct.gsk_AudioData, ptr %84, i32 0, i32 0
  store i32 %83, ptr %85, align 8, !tbaa !15
  %86 = load ptr, ptr %4, align 8, !tbaa !5
  %87 = call i64 @fread(ptr noundef %11, i64 noundef 4, i64 noundef 1, ptr noundef %86)
  %88 = load ptr, ptr %4, align 8, !tbaa !5
  %89 = call i64 @fread(ptr noundef %12, i64 noundef 2, i64 noundef 1, ptr noundef %88)
  %90 = load ptr, ptr %4, align 8, !tbaa !5
  %91 = call i64 @fread(ptr noundef %13, i64 noundef 2, i64 noundef 1, ptr noundef %90)
  %92 = load i16, ptr %13, align 2, !tbaa !9
  %93 = sext i16 %92 to i32
  %94 = icmp ne i32 %93, 16
  br i1 %94, label %95, label %96

95:                                               ; preds = %82
  call void (i32, ptr, i32, ptr, ...) @logger_log(i32 noundef 5, ptr noundef @.str.1, i32 noundef 77, ptr noundef @.str.11)
  br label %96

96:                                               ; preds = %95, %82
  %97 = load i16, ptr %13, align 2, !tbaa !9
  %98 = sext i16 %97 to i32
  %99 = load ptr, ptr %3, align 8, !tbaa !5
  %100 = getelementptr inbounds %struct.gsk_AudioData, ptr %99, i32 0, i32 2
  store i32 %98, ptr %100, align 8, !tbaa !16
  %101 = getelementptr inbounds [4 x i8], ptr %5, i64 0, i64 0
  %102 = load ptr, ptr %4, align 8, !tbaa !5
  %103 = call i64 @fread(ptr noundef %101, i64 noundef 1, i64 noundef 4, ptr noundef %102)
  %104 = getelementptr inbounds [4 x i8], ptr %5, i64 0, i64 0
  %105 = call i32 @strcmp(ptr noundef %104, ptr noundef @.str.12) #8
  %106 = icmp ne i32 %105, 0
  br i1 %106, label %116, label %107

107:                                              ; preds = %96
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #6
  call void @llvm.lifetime.start.p0(i64 2, ptr %16) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #6
  %108 = load ptr, ptr %4, align 8, !tbaa !5
  %109 = call i64 @fread(ptr noundef %15, i64 noundef 1, i64 noundef 4, ptr noundef %108)
  %110 = load ptr, ptr %4, align 8, !tbaa !5
  %111 = call i64 @fread(ptr noundef %16, i64 noundef 1, i64 noundef 4, ptr noundef %110)
  %112 = load i32, ptr %15, align 4, !tbaa !14
  %113 = zext i32 %112 to i64
  %114 = load ptr, ptr %4, align 8, !tbaa !5
  %115 = call i64 @fread(ptr noundef %17, i64 noundef %113, i64 noundef 1, ptr noundef %114)
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #6
  call void @llvm.lifetime.end.p0(i64 2, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #6
  br label %116

116:                                              ; preds = %107, %96
  %117 = getelementptr inbounds [4 x i8], ptr %5, i64 0, i64 0
  %118 = call i32 @strcmp(ptr noundef %117, ptr noundef @.str.13) #8
  %119 = icmp ne i32 %118, 0
  br i1 %119, label %120, label %122

120:                                              ; preds = %116
  %121 = getelementptr inbounds [4 x i8], ptr %5, i64 0, i64 0
  call void (i32, ptr, i32, ptr, ...) @logger_log(i32 noundef 5, ptr noundef @.str.1, i32 noundef 94, ptr noundef @.str.14, ptr noundef %121)
  br label %122

122:                                              ; preds = %120, %116
  %123 = load ptr, ptr %4, align 8, !tbaa !5
  %124 = call i64 @fread(ptr noundef %14, i64 noundef 4, i64 noundef 1, ptr noundef %123)
  %125 = load i32, ptr %14, align 4, !tbaa !14
  %126 = sext i32 %125 to i64
  %127 = call noalias ptr @malloc(i64 noundef %126) #7
  %128 = load ptr, ptr %3, align 8, !tbaa !5
  %129 = getelementptr inbounds %struct.gsk_AudioData, ptr %128, i32 0, i32 4
  store ptr %127, ptr %129, align 8, !tbaa !17
  %130 = load ptr, ptr %3, align 8, !tbaa !5
  %131 = getelementptr inbounds %struct.gsk_AudioData, ptr %130, i32 0, i32 4
  %132 = load ptr, ptr %131, align 8, !tbaa !17
  %133 = icmp eq ptr %132, null
  br i1 %133, label %134, label %138

134:                                              ; preds = %122
  call void (i32, ptr, i32, ptr, ...) @logger_log(i32 noundef 5, ptr noundef @.str.1, i32 noundef 102, ptr noundef @.str.15)
  %135 = load ptr, ptr %3, align 8, !tbaa !5
  %136 = getelementptr inbounds %struct.gsk_AudioData, ptr %135, i32 0, i32 4
  %137 = load ptr, ptr %136, align 8, !tbaa !17
  call void @free(ptr noundef %137) #6
  br label %138

138:                                              ; preds = %134, %122
  %139 = load ptr, ptr %3, align 8, !tbaa !5
  %140 = getelementptr inbounds %struct.gsk_AudioData, ptr %139, i32 0, i32 4
  %141 = load ptr, ptr %140, align 8, !tbaa !17
  %142 = load i32, ptr %14, align 4, !tbaa !14
  %143 = sext i32 %142 to i64
  %144 = load ptr, ptr %4, align 8, !tbaa !5
  %145 = call i64 @fread(ptr noundef %141, i64 noundef 1, i64 noundef %143, ptr noundef %144)
  %146 = load i32, ptr %14, align 4, !tbaa !14
  %147 = sext i32 %146 to i64
  %148 = icmp ne i64 %145, %147
  br i1 %148, label %149, label %150

149:                                              ; preds = %138
  call void (i32, ptr, i32, ptr, ...) @logger_log(i32 noundef 5, ptr noundef @.str.1, i32 noundef 108, ptr noundef @.str.16)
  br label %150

150:                                              ; preds = %149, %138
  %151 = load i32, ptr %14, align 4, !tbaa !14
  %152 = load ptr, ptr %3, align 8, !tbaa !5
  %153 = getelementptr inbounds %struct.gsk_AudioData, ptr %152, i32 0, i32 3
  store i32 %151, ptr %153, align 4, !tbaa !18
  call void (i32, ptr, i32, ptr, ...) @logger_log(i32 noundef 0, ptr noundef @.str.1, i32 noundef 112, ptr noundef @.str.17)
  %154 = load ptr, ptr %2, align 8, !tbaa !5
  call void (i32, ptr, i32, ptr, ...) @logger_log(i32 noundef 3, ptr noundef @.str.1, i32 noundef 113, ptr noundef @.str.18, ptr noundef %154)
  %155 = load i32, ptr %10, align 4, !tbaa !14
  call void (i32, ptr, i32, ptr, ...) @logger_log(i32 noundef 0, ptr noundef @.str.1, i32 noundef 114, ptr noundef @.str.19, i32 noundef 44100, i32 noundef %155)
  %156 = load i16, ptr %13, align 2, !tbaa !9
  %157 = sext i16 %156 to i32
  call void (i32, ptr, i32, ptr, ...) @logger_log(i32 noundef 0, ptr noundef @.str.1, i32 noundef 115, ptr noundef @.str.20, i32 noundef %157)
  %158 = load i32, ptr %11, align 4, !tbaa !14
  call void (i32, ptr, i32, ptr, ...) @logger_log(i32 noundef 0, ptr noundef @.str.1, i32 noundef 116, ptr noundef @.str.21, i32 noundef %158)
  %159 = load i16, ptr %12, align 2, !tbaa !9
  %160 = sext i16 %159 to i32
  call void (i32, ptr, i32, ptr, ...) @logger_log(i32 noundef 0, ptr noundef @.str.1, i32 noundef 117, ptr noundef @.str.22, i32 noundef %160)
  %161 = load i32, ptr %14, align 4, !tbaa !14
  call void (i32, ptr, i32, ptr, ...) @logger_log(i32 noundef 0, ptr noundef @.str.1, i32 noundef 118, ptr noundef @.str.23, i32 noundef %161)
  call void (i32, ptr, i32, ptr, ...) @logger_log(i32 noundef 0, ptr noundef @.str.1, i32 noundef 119, ptr noundef @.str.17)
  %162 = load ptr, ptr %4, align 8, !tbaa !5
  %163 = call i32 @fclose(ptr noundef %162)
  %164 = load ptr, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 2, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 2, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 2, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 2, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #6
  ret ptr %164
}

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

; Function Attrs: nounwind allocsize(0)
declare noalias ptr @malloc(i64 noundef) #2

declare noalias ptr @fopen(ptr noundef, ptr noundef) #3

declare void @logger_log(i32 noundef, ptr noundef, i32 noundef, ptr noundef, ...) #3

declare i64 @fread(ptr noundef, i64 noundef, i64 noundef, ptr noundef) #3

; Function Attrs: nounwind willreturn memory(read)
declare i32 @strcmp(ptr noundef, ptr noundef) #4

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

; Function Attrs: nounwind
declare void @free(ptr noundef) #5

declare i32 @fclose(ptr noundef) #3

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

!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/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"short", !7, i64 0}
!11 = !{!12, !13, i64 4}
!12 = !{!"gsk_AudioData", !13, i64 0, !13, i64 4, !13, i64 8, !13, i64 12, !6, i64 16}
!13 = !{!"int", !7, i64 0}
!14 = !{!13, !13, i64 0}
!15 = !{!12, !13, i64 0}
!16 = !{!12, !13, i64 8}
!17 = !{!12, !6, i64 16}
!18 = !{!12, !13, i64 12}


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

@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [42 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [36 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [42 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [48 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [41 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [16 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local noalias noundef ptr @gsk_load_wav(ptr noundef %0) local_unnamed_addr #0 {
  %2 = alloca [4 x i8], align 1
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i16, align 2
  %6 = alloca i16, align 2
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i16, align 2
  %10 = alloca i16, align 2
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i16, align 2
  %14 = alloca ptr, align 8
  %15 = tail call noalias dereferenceable_or_null(24) ptr @malloc(i64 noundef 24) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #7
  call void @llvm.lifetime.start.p0(i64 2, ptr nonnull %5) #7
  call void @llvm.lifetime.start.p0(i64 2, ptr nonnull %6) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #7
  call void @llvm.lifetime.start.p0(i64 2, ptr nonnull %9) #7
  call void @llvm.lifetime.start.p0(i64 2, ptr nonnull %10) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %11) #7
  %16 = tail call noalias ptr @fopen(ptr noundef %0, ptr noundef nonnull @.str)
  %17 = icmp eq ptr %16, null
  br i1 %17, label %18, label %19

18:                                               ; preds = %1
  tail call void (i32, ptr, i32, ptr, ...) @logger_log(i32 noundef 5, ptr noundef nonnull @.str.1, i32 noundef 34, ptr noundef nonnull @.str.2, ptr noundef %0) #7
  br label %19

19:                                               ; preds = %18, %1
  %20 = call i64 @fread(ptr noundef nonnull %2, i64 noundef 1, i64 noundef 4, ptr noundef %16)
  %21 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %2, ptr noundef nonnull dereferenceable(1) @.str.3) #8
  %.not = icmp eq i32 %21, 0
  br i1 %.not, label %23, label %22

22:                                               ; preds = %19
  call void (i32, ptr, i32, ptr, ...) @logger_log(i32 noundef 5, ptr noundef nonnull @.str.1, i32 noundef 39, ptr noundef nonnull @.str.4, ptr noundef nonnull %2) #7
  br label %23

23:                                               ; preds = %22, %19
  %24 = call i64 @fread(ptr noundef nonnull %3, i64 noundef 4, i64 noundef 1, ptr noundef %16)
  %25 = call i64 @fread(ptr noundef nonnull %2, i64 noundef 1, i64 noundef 4, ptr noundef %16)
  %26 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %2, ptr noundef nonnull dereferenceable(1) @.str.5) #8
  %.not32 = icmp eq i32 %26, 0
  br i1 %.not32, label %28, label %27

27:                                               ; preds = %23
  call void (i32, ptr, i32, ptr, ...) @logger_log(i32 noundef 5, ptr noundef nonnull @.str.1, i32 noundef 45, ptr noundef nonnull @.str.6) #7
  br label %28

28:                                               ; preds = %27, %23
  %29 = call i64 @fread(ptr noundef nonnull %2, i64 noundef 1, i64 noundef 4, ptr noundef %16)
  %30 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %2, ptr noundef nonnull dereferenceable(1) @.str.7) #8
  %.not33 = icmp eq i32 %30, 0
  br i1 %.not33, label %32, label %31

31:                                               ; preds = %28
  call void (i32, ptr, i32, ptr, ...) @logger_log(i32 noundef 5, ptr noundef nonnull @.str.1, i32 noundef 48, ptr noundef nonnull @.str.6) #7
  br label %32

32:                                               ; preds = %31, %28
  %33 = call i64 @fread(ptr noundef nonnull %4, i64 noundef 4, i64 noundef 1, ptr noundef %16)
  %34 = call i64 @fread(ptr noundef nonnull %5, i64 noundef 2, i64 noundef 1, ptr noundef %16)
  %35 = load i16, ptr %5, align 2, !tbaa !5
  %.not34 = icmp eq i16 %35, 1
  br i1 %.not34, label %37, label %36

36:                                               ; preds = %32
  call void (i32, ptr, i32, ptr, ...) @logger_log(i32 noundef 5, ptr noundef nonnull @.str.1, i32 noundef 55, ptr noundef nonnull @.str.8, ptr noundef nonnull %2) #7
  br label %37

37:                                               ; preds = %36, %32
  %38 = call i64 @fread(ptr noundef nonnull %6, i64 noundef 2, i64 noundef 1, ptr noundef %16)
  %39 = load i16, ptr %6, align 2, !tbaa !5
  %.not35 = icmp eq i16 %39, 1
  br i1 %.not35, label %._crit_edge, label %40

40:                                               ; preds = %37
  %41 = sext i16 %39 to i32
  call void (i32, ptr, i32, ptr, ...) @logger_log(i32 noundef 5, ptr noundef nonnull @.str.1, i32 noundef 61, ptr noundef nonnull @.str.9, i32 noundef %41) #7
  br label %._crit_edge

._crit_edge:                                      ; preds = %37, %40
  %.pre-phi = phi i32 [ %41, %40 ], [ 1, %37 ]
  %42 = getelementptr inbounds i8, ptr %15, i64 4
  store i32 %.pre-phi, ptr %42, align 4, !tbaa !9
  %43 = call i64 @fread(ptr noundef nonnull %7, i64 noundef 4, i64 noundef 1, ptr noundef %16)
  %44 = load i32, ptr %7, align 4, !tbaa !13
  %.not36 = icmp eq i32 %44, 44100
  br i1 %.not36, label %46, label %45

45:                                               ; preds = %._crit_edge
  call void (i32, ptr, i32, ptr, ...) @logger_log(i32 noundef 5, ptr noundef nonnull @.str.1, i32 noundef 70, ptr noundef nonnull @.str.10, i32 noundef 44100, i32 noundef %44) #7
  br label %46

46:                                               ; preds = %45, %._crit_edge
  store i32 %44, ptr %15, align 8, !tbaa !14
  %47 = call i64 @fread(ptr noundef nonnull %8, i64 noundef 4, i64 noundef 1, ptr noundef %16)
  %48 = call i64 @fread(ptr noundef nonnull %9, i64 noundef 2, i64 noundef 1, ptr noundef %16)
  %49 = call i64 @fread(ptr noundef nonnull %10, i64 noundef 2, i64 noundef 1, ptr noundef %16)
  %50 = load i16, ptr %10, align 2, !tbaa !5
  %.not37 = icmp eq i16 %50, 16
  br i1 %.not37, label %52, label %51

51:                                               ; preds = %46
  call void (i32, ptr, i32, ptr, ...) @logger_log(i32 noundef 5, ptr noundef nonnull @.str.1, i32 noundef 77, ptr noundef nonnull @.str.11) #7
  br label %52

52:                                               ; preds = %51, %46
  %53 = sext i16 %50 to i32
  %54 = getelementptr inbounds i8, ptr %15, i64 8
  store i32 %53, ptr %54, align 8, !tbaa !15
  %55 = call i64 @fread(ptr noundef nonnull %2, i64 noundef 1, i64 noundef 4, ptr noundef %16)
  %56 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %2, ptr noundef nonnull dereferenceable(1) @.str.12) #8
  %.not38 = icmp eq i32 %56, 0
  br i1 %.not38, label %57, label %63

57:                                               ; preds = %52
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %12) #7
  call void @llvm.lifetime.start.p0(i64 2, ptr nonnull %13) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %14) #7
  %58 = call i64 @fread(ptr noundef nonnull %12, i64 noundef 1, i64 noundef 4, ptr noundef %16)
  %59 = call i64 @fread(ptr noundef nonnull %13, i64 noundef 1, i64 noundef 4, ptr noundef %16)
  %60 = load i32, ptr %12, align 4, !tbaa !13
  %61 = zext i32 %60 to i64
  %62 = call i64 @fread(ptr noundef nonnull %14, i64 noundef %61, i64 noundef 1, ptr noundef %16)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %14) #7
  call void @llvm.lifetime.end.p0(i64 2, ptr nonnull %13) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %12) #7
  br label %63

63:                                               ; preds = %57, %52
  %64 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %2, ptr noundef nonnull dereferenceable(1) @.str.13) #8
  %.not39 = icmp eq i32 %64, 0
  br i1 %.not39, label %66, label %65

65:                                               ; preds = %63
  call void (i32, ptr, i32, ptr, ...) @logger_log(i32 noundef 5, ptr noundef nonnull @.str.1, i32 noundef 94, ptr noundef nonnull @.str.14, ptr noundef nonnull %2) #7
  br label %66

66:                                               ; preds = %65, %63
  %67 = call i64 @fread(ptr noundef nonnull %11, i64 noundef 4, i64 noundef 1, ptr noundef %16)
  %68 = load i32, ptr %11, align 4, !tbaa !13
  %69 = sext i32 %68 to i64
  %70 = call noalias ptr @malloc(i64 noundef %69) #6
  %71 = getelementptr inbounds i8, ptr %15, i64 16
  store ptr %70, ptr %71, align 8, !tbaa !16
  %72 = icmp eq ptr %70, null
  br i1 %72, label %73, label %74

73:                                               ; preds = %66
  call void (i32, ptr, i32, ptr, ...) @logger_log(i32 noundef 5, ptr noundef nonnull @.str.1, i32 noundef 102, ptr noundef nonnull @.str.15) #7
  br label %74

74:                                               ; preds = %73, %66
  %75 = call i64 @fread(ptr noundef %70, i64 noundef 1, i64 noundef %69, ptr noundef %16)
  %.not40 = icmp eq i64 %75, %69
  br i1 %.not40, label %77, label %76

76:                                               ; preds = %74
  call void (i32, ptr, i32, ptr, ...) @logger_log(i32 noundef 5, ptr noundef nonnull @.str.1, i32 noundef 108, ptr noundef nonnull @.str.16) #7
  br label %77

77:                                               ; preds = %76, %74
  %78 = getelementptr inbounds i8, ptr %15, i64 12
  store i32 %68, ptr %78, align 4, !tbaa !17
  call void (i32, ptr, i32, ptr, ...) @logger_log(i32 noundef 0, ptr noundef nonnull @.str.1, i32 noundef 112, ptr noundef nonnull @.str.17) #7
  call void (i32, ptr, i32, ptr, ...) @logger_log(i32 noundef 3, ptr noundef nonnull @.str.1, i32 noundef 113, ptr noundef nonnull @.str.18, ptr noundef %0) #7
  call void (i32, ptr, i32, ptr, ...) @logger_log(i32 noundef 0, ptr noundef nonnull @.str.1, i32 noundef 114, ptr noundef nonnull @.str.19, i32 noundef 44100, i32 noundef %44) #7
  call void (i32, ptr, i32, ptr, ...) @logger_log(i32 noundef 0, ptr noundef nonnull @.str.1, i32 noundef 115, ptr noundef nonnull @.str.20, i32 noundef %53) #7
  %79 = load i32, ptr %8, align 4, !tbaa !13
  call void (i32, ptr, i32, ptr, ...) @logger_log(i32 noundef 0, ptr noundef nonnull @.str.1, i32 noundef 116, ptr noundef nonnull @.str.21, i32 noundef %79) #7
  %80 = load i16, ptr %9, align 2, !tbaa !5
  %81 = sext i16 %80 to i32
  call void (i32, ptr, i32, ptr, ...) @logger_log(i32 noundef 0, ptr noundef nonnull @.str.1, i32 noundef 117, ptr noundef nonnull @.str.22, i32 noundef %81) #7
  call void (i32, ptr, i32, ptr, ...) @logger_log(i32 noundef 0, ptr noundef nonnull @.str.1, i32 noundef 118, ptr noundef nonnull @.str.23, i32 noundef %68) #7
  call void (i32, ptr, i32, ptr, ...) @logger_log(i32 noundef 0, ptr noundef nonnull @.str.1, i32 noundef 119, ptr noundef nonnull @.str.17) #7
  %82 = call i32 @fclose(ptr noundef %16)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %11) #7
  call void @llvm.lifetime.end.p0(i64 2, ptr nonnull %10) #7
  call void @llvm.lifetime.end.p0(i64 2, ptr nonnull %9) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #7
  call void @llvm.lifetime.end.p0(i64 2, ptr nonnull %6) #7
  call void @llvm.lifetime.end.p0(i64 2, ptr nonnull %5) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #7
  ret ptr %15
}

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

; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #2

; Function Attrs: nofree nounwind
declare noalias noundef ptr @fopen(ptr nocapture noundef readonly, ptr nocapture noundef readonly) local_unnamed_addr #3

declare void @logger_log(i32 noundef, ptr noundef, i32 noundef, ptr noundef, ...) local_unnamed_addr #4

; Function Attrs: nofree nounwind
declare noundef i64 @fread(ptr nocapture noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #3

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #5

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

; Function Attrs: nofree nounwind
declare noundef i32 @fclose(ptr nocapture noundef) local_unnamed_addr #3

attributes #0 = { 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 #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "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 = { nofree 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 #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 = { mustprogress nofree nounwind willreturn memory(argmem: read) "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 #6 = { nounwind allocsize(0) }
attributes #7 = { nounwind }
attributes #8 = { nounwind willreturn memory(read) }

!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 = !{!"short", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !11, i64 4}
!10 = !{!"gsk_AudioData", !11, i64 0, !11, i64 4, !11, i64 8, !11, i64 12, !12, i64 16}
!11 = !{!"int", !7, i64 0}
!12 = !{!"any pointer", !7, i64 0}
!13 = !{!11, !11, i64 0}
!14 = !{!10, !11, i64 0}
!15 = !{!10, !11, i64 8}
!16 = !{!10, !12, i64 16}
!17 = !{!10, !11, i64 12}


; Effective O3 passes: ADCEPass,CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass