; LLVM IR from Overload-Technologies/Overload :: Dependencies/soloud/src/audiosource/ay/soloud_ay.ll (ZN6SoLoud2Ay8loadFileEPNS_4FileE)

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

%"class.SoLoud::Ay" = type { %"class.SoLoud::AudioSource", i8, i32, i32, i32, i32, ptr }
%"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: nobuiltin nounwind
declare void @_ZdaPv(ptr noundef) #1

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN6SoLoud2Ay8loadFileEPNS_4FileE(ptr noundef nonnull align 8 dereferenceable(184) %0, ptr noundef %1) #2 align 2 {
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca ptr, align 8
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  %16 = load ptr, ptr %4, align 8
  %17 = load ptr, ptr %5, align 8, !tbaa !5
  %18 = icmp eq ptr %17, null
  br i1 %18, label %19, label %20

19:                                               ; preds = %2
  store i32 1, ptr %3, align 4
  br label %163

20:                                               ; preds = %2
  %21 = load ptr, ptr %5, align 8, !tbaa !5
  %22 = load ptr, ptr %21, align 8, !tbaa !9
  %23 = getelementptr inbounds ptr, ptr %22, i64 4
  %24 = load ptr, ptr %23, align 8
  %25 = call noundef i32 %24(ptr noundef nonnull align 8 dereferenceable(8) %21)
  %26 = icmp ult i32 %25, 34
  br i1 %26, label %27, label %28

27:                                               ; preds = %20
  store i32 3, ptr %3, align 4
  br label %163

28:                                               ; preds = %20
  %29 = load ptr, ptr %5, align 8, !tbaa !5
  %30 = load ptr, ptr %29, align 8, !tbaa !9
  %31 = getelementptr inbounds ptr, ptr %30, i64 5
  %32 = load ptr, ptr %31, align 8
  call void %32(ptr noundef nonnull align 8 dereferenceable(8) %29, i32 noundef 0)
  %33 = load ptr, ptr %5, align 8, !tbaa !5
  %34 = call noundef i32 @_ZN6SoLoud4File6read32Ev(ptr noundef nonnull align 8 dereferenceable(8) %33)
  %35 = icmp ne i32 %34, 1346979907
  br i1 %35, label %36, label %37

36:                                               ; preds = %28
  store i32 3, ptr %3, align 4
  br label %163

37:                                               ; preds = %28
  %38 = load ptr, ptr %5, align 8, !tbaa !5
  %39 = call noundef i32 @_ZN6SoLoud4File6read32Ev(ptr noundef nonnull align 8 dereferenceable(8) %38)
  %40 = icmp ne i32 %39, 1162761556
  br i1 %40, label %41, label %42

41:                                               ; preds = %37
  store i32 3, ptr %3, align 4
  br label %163

42:                                               ; preds = %37
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  %43 = load ptr, ptr %5, align 8, !tbaa !5
  %44 = call noundef i32 @_ZN6SoLoud4File6read16Ev(ptr noundef nonnull align 8 dereferenceable(8) %43)
  store i32 %44, ptr %6, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  %45 = load ptr, ptr %5, align 8, !tbaa !5
  %46 = call noundef i32 @_ZN6SoLoud4File5read8Ev(ptr noundef nonnull align 8 dereferenceable(8) %45)
  store i32 %46, ptr %7, align 4, !tbaa !11
  %47 = load i32, ptr %7, align 4, !tbaa !11
  %48 = icmp eq i32 %47, 1
  br i1 %48, label %56, label %49

49:                                               ; preds = %42
  %50 = load i32, ptr %7, align 4, !tbaa !11
  %51 = icmp eq i32 %50, 2
  br i1 %51, label %56, label %52

52:                                               ; preds = %49
  %53 = load i32, ptr %7, align 4, !tbaa !11
  %54 = icmp eq i32 %53, 3
  br i1 %54, label %56, label %55

55:                                               ; preds = %52
  store i32 3, ptr %3, align 4
  store i32 1, ptr %8, align 4
  br label %162

56:                                               ; preds = %52, %49, %42
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  %57 = load ptr, ptr %5, align 8, !tbaa !5
  %58 = call noundef i32 @_ZN6SoLoud4File5read8Ev(ptr noundef nonnull align 8 dereferenceable(8) %57)
  store i32 %58, ptr %9, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  %59 = load ptr, ptr %5, align 8, !tbaa !5
  %60 = call noundef i32 @_ZN6SoLoud4File6read16Ev(ptr noundef nonnull align 8 dereferenceable(8) %59)
  store i32 %60, ptr %10, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  %61 = load ptr, ptr %5, align 8, !tbaa !5
  %62 = call noundef i32 @_ZN6SoLoud4File6read16Ev(ptr noundef nonnull align 8 dereferenceable(8) %61)
  store i32 %62, ptr %11, align 4, !tbaa !11
  %63 = load i32, ptr %10, align 4, !tbaa !11
  %64 = sub nsw i32 %63, 1
  %65 = mul nsw i32 %64, 1024
  %66 = load i32, ptr %11, align 4, !tbaa !11
  %67 = add nsw i32 %65, %66
  %68 = getelementptr inbounds %"class.SoLoud::Ay", ptr %16, i32 0, i32 5
  store i32 %67, ptr %68, align 8, !tbaa !13
  %69 = load ptr, ptr %5, align 8, !tbaa !5
  %70 = call noundef i32 @_ZN6SoLoud4File6read16Ev(ptr noundef nonnull align 8 dereferenceable(8) %69)
  %71 = mul i32 %70, 1024
  %72 = load ptr, ptr %5, align 8, !tbaa !5
  %73 = call noundef i32 @_ZN6SoLoud4File6read16Ev(ptr noundef nonnull align 8 dereferenceable(8) %72)
  %74 = add i32 %71, %73
  %75 = getelementptr inbounds %"class.SoLoud::Ay", ptr %16, i32 0, i32 4
  store i32 %74, ptr %75, align 4, !tbaa !19
  %76 = load ptr, ptr %5, align 8, !tbaa !5
  %77 = call noundef i32 @_ZN6SoLoud4File6read32Ev(ptr noundef nonnull align 8 dereferenceable(8) %76)
  %78 = getelementptr inbounds %"class.SoLoud::Ay", ptr %16, i32 0, i32 3
  store i32 %77, ptr %78, align 8, !tbaa !20
  %79 = load ptr, ptr %5, align 8, !tbaa !5
  %80 = call noundef i32 @_ZN6SoLoud4File6read32Ev(ptr noundef nonnull align 8 dereferenceable(8) %79)
  %81 = getelementptr inbounds %"class.SoLoud::Ay", ptr %16, i32 0, i32 2
  store i32 %80, ptr %81, align 4, !tbaa !21
  %82 = getelementptr inbounds %"class.SoLoud::Ay", ptr %16, i32 0, i32 1
  store i8 0, ptr %82, align 8, !tbaa !22
  %83 = load i32, ptr %9, align 4, !tbaa !11
  %84 = and i32 %83, 64
  %85 = icmp ne i32 %84, 0
  br i1 %85, label %86, label %88

86:                                               ; preds = %56
  %87 = getelementptr inbounds %"class.SoLoud::Ay", ptr %16, i32 0, i32 1
  store i8 1, ptr %87, align 8, !tbaa !22
  br label %88

88:                                               ; preds = %86, %56
  %89 = getelementptr inbounds %"class.SoLoud::Ay", ptr %16, i32 0, i32 5
  %90 = load i32, ptr %89, align 8, !tbaa !13
  %91 = sext i32 %90 to i64
  %92 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %91, i64 2)
  %93 = extractvalue { i64, i1 } %92, 1
  %94 = extractvalue { i64, i1 } %92, 0
  %95 = select i1 %93, i64 -1, i64 %94
  %96 = call noalias noundef nonnull ptr @_Znam(i64 noundef %95) #7
  %97 = getelementptr inbounds %"class.SoLoud::Ay", ptr %16, i32 0, i32 6
  store ptr %96, ptr %97, align 8, !tbaa !23
  %98 = load ptr, ptr %5, align 8, !tbaa !5
  %99 = load i32, ptr %6, align 4, !tbaa !11
  %100 = load ptr, ptr %98, align 8, !tbaa !9
  %101 = getelementptr inbounds ptr, ptr %100, i64 5
  %102 = load ptr, ptr %101, align 8
  call void %102(ptr noundef nonnull align 8 dereferenceable(8) %98, i32 noundef %99)
  %103 = load i32, ptr %9, align 4, !tbaa !11
  %104 = and i32 %103, 1
  %105 = icmp ne i32 %104, 0
  br i1 %105, label %106, label %116

106:                                              ; preds = %88
  %107 = load ptr, ptr %5, align 8, !tbaa !5
  %108 = getelementptr inbounds %"class.SoLoud::Ay", ptr %16, i32 0, i32 6
  %109 = load ptr, ptr %108, align 8, !tbaa !23
  %110 = getelementptr inbounds %"class.SoLoud::Ay", ptr %16, i32 0, i32 5
  %111 = load i32, ptr %110, align 8, !tbaa !13
  %112 = load ptr, ptr %107, align 8, !tbaa !9
  %113 = getelementptr inbounds ptr, ptr %112, i64 3
  %114 = load ptr, ptr %113, align 8
  %115 = call noundef i32 %114(ptr noundef nonnull align 8 dereferenceable(8) %107, ptr noundef %109, i32 noundef %111)
  br label %161

116:                                              ; preds = %88
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  %117 = load ptr, ptr %5, align 8, !tbaa !5
  %118 = load ptr, ptr %117, align 8, !tbaa !9
  %119 = getelementptr inbounds ptr, ptr %118, i64 4
  %120 = load ptr, ptr %119, align 8
  %121 = call noundef i32 %120(ptr noundef nonnull align 8 dereferenceable(8) %117)
  %122 = load i32, ptr %6, align 4, !tbaa !11
  %123 = sub i32 %121, %122
  store i32 %123, ptr %12, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #6
  %124 = load i32, ptr %12, align 4, !tbaa !11
  %125 = sext i32 %124 to i64
  %126 = call noalias noundef nonnull ptr @_Znam(i64 noundef %125) #7
  store ptr %126, ptr %13, align 8, !tbaa !5
  %127 = load ptr, ptr %5, align 8, !tbaa !5
  %128 = load ptr, ptr %13, align 8, !tbaa !5
  %129 = load i32, ptr %12, align 4, !tbaa !11
  %130 = load ptr, ptr %127, align 8, !tbaa !9
  %131 = getelementptr inbounds ptr, ptr %130, i64 3
  %132 = load ptr, ptr %131, align 8
  %133 = call noundef i32 %132(ptr noundef nonnull align 8 dereferenceable(8) %127, ptr noundef %128, i32 noundef %129)
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #6
  store i32 0, ptr %14, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #6
  store i32 0, ptr %15, align 4, !tbaa !11
  br label %134

134:                                              ; preds = %153, %116
  %135 = load i32, ptr %15, align 4, !tbaa !11
  %136 = load i32, ptr %10, align 4, !tbaa !11
  %137 = icmp slt i32 %135, %136
  br i1 %137, label %139, label %138

138:                                              ; preds = %134
  store i32 2, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #6
  br label %156

139:                                              ; preds = %134
  %140 = load ptr, ptr %13, align 8, !tbaa !5
  %141 = load i32, ptr %14, align 4, !tbaa !11
  %142 = sext i32 %141 to i64
  %143 = getelementptr inbounds i8, ptr %140, i64 %142
  %144 = getelementptr inbounds %"class.SoLoud::Ay", ptr %16, i32 0, i32 6
  %145 = load ptr, ptr %144, align 8, !tbaa !23
  %146 = load i32, ptr %15, align 4, !tbaa !11
  %147 = mul nsw i32 %146, 1024
  %148 = sext i32 %147 to i64
  %149 = getelementptr inbounds i8, ptr %145, i64 %148
  %150 = call noundef i32 @_ZL14zx7_decompressPhS_(ptr noundef %143, ptr noundef %149)
  %151 = load i32, ptr %14, align 4, !tbaa !11
  %152 = add nsw i32 %151, %150
  store i32 %152, ptr %14, align 4, !tbaa !11
  br label %153

153:                                              ; preds = %139
  %154 = load i32, ptr %15, align 4, !tbaa !11
  %155 = add nsw i32 %154, 1
  store i32 %155, ptr %15, align 4, !tbaa !11
  br label %134, !llvm.loop !24

156:                                              ; preds = %138
  %157 = load ptr, ptr %13, align 8, !tbaa !5
  %158 = icmp eq ptr %157, null
  br i1 %158, label %160, label %159

159:                                              ; preds = %156
  call void @_ZdaPv(ptr noundef %157) #8
  br label %160

160:                                              ; preds = %159, %156
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  br label %161

161:                                              ; preds = %160, %106
  store i32 0, ptr %3, align 4
  store i32 1, ptr %8, align 4
  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 4, ptr %9) #6
  br label %162

162:                                              ; preds = %161, %55
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  br label %163

163:                                              ; preds = %162, %41, %36, %27, %19
  %164 = load i32, ptr %3, align 4
  ret i32 %164
}

declare noundef i32 @_ZN6SoLoud4File6read32Ev(ptr noundef nonnull align 8 dereferenceable(8)) #3

declare noundef i32 @_ZN6SoLoud4File6read16Ev(ptr noundef nonnull align 8 dereferenceable(8)) #3

declare noundef i32 @_ZN6SoLoud4File5read8Ev(ptr noundef nonnull align 8 dereferenceable(8)) #3

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

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

; Function Attrs: mustprogress uwtable
declare hidden noundef i32 @_ZL14zx7_decompressPhS_(ptr noundef, ptr noundef) #2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nobuiltin nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { "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 = { 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 #6 = { nounwind }
attributes #7 = { builtin allocsize(0) }
attributes #8 = { builtin 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 = !{!"vtable pointer", !8, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!14, !12, i64 168}
!14 = !{!"_ZTSN6SoLoud2AyE", !15, i64 0, !18, i64 152, !12, i64 156, !12, i64 160, !12, i64 164, !12, i64 168, !6, i64 176}
!15 = !{!"_ZTSN6SoLoud11AudioSourceE", !12, i64 8, !16, i64 12, !16, i64 16, !12, i64 20, !12, i64 24, !16, i64 28, !16, i64 32, !16, i64 36, !12, i64 40, !16, i64 44, !7, i64 48, !6, i64 112, !6, i64 120, !6, i64 128, !12, i64 136, !17, i64 144}
!16 = !{!"float", !7, i64 0}
!17 = !{!"double", !7, i64 0}
!18 = !{!"bool", !7, i64 0}
!19 = !{!14, !12, i64 164}
!20 = !{!14, !12, i64 160}
!21 = !{!14, !12, i64 156}
!22 = !{!14, !18, i64 152}
!23 = !{!14, !6, i64 176}
!24 = distinct !{!24, !25}
!25 = !{!"llvm.loop.mustprogress"}


; 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: nobuiltin nounwind
declare void @_ZdaPv(ptr noundef) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
define dso_local noundef range(i32 0, 4) i32 @_ZN6SoLoud2Ay8loadFileEPNS_4FileE(ptr nocapture noundef nonnull align 8 dereferenceable(184) %0, ptr noundef %1) local_unnamed_addr #1 align 2 {
  %3 = icmp eq ptr %1, null
  br i1 %3, label %79, label %4

4:                                                ; preds = %2
  %5 = load ptr, ptr %1, align 8, !tbaa !5
  %6 = getelementptr inbounds i8, ptr %5, i64 32
  %7 = load ptr, ptr %6, align 8
  %8 = tail call noundef i32 %7(ptr noundef nonnull align 8 dereferenceable(8) %1)
  %9 = icmp ult i32 %8, 34
  br i1 %9, label %79, label %10

10:                                               ; preds = %4
  %11 = load ptr, ptr %1, align 8, !tbaa !5
  %12 = getelementptr inbounds i8, ptr %11, i64 40
  %13 = load ptr, ptr %12, align 8
  tail call void %13(ptr noundef nonnull align 8 dereferenceable(8) %1, i32 noundef 0)
  %14 = tail call noundef i32 @_ZN6SoLoud4File6read32Ev(ptr noundef nonnull align 8 dereferenceable(8) %1)
  %.not = icmp eq i32 %14, 1346979907
  br i1 %.not, label %15, label %79

15:                                               ; preds = %10
  %16 = tail call noundef i32 @_ZN6SoLoud4File6read32Ev(ptr noundef nonnull align 8 dereferenceable(8) %1)
  %.not45 = icmp eq i32 %16, 1162761556
  br i1 %.not45, label %17, label %79

17:                                               ; preds = %15
  %18 = tail call noundef i32 @_ZN6SoLoud4File6read16Ev(ptr noundef nonnull align 8 dereferenceable(8) %1)
  %19 = tail call noundef i32 @_ZN6SoLoud4File5read8Ev(ptr noundef nonnull align 8 dereferenceable(8) %1)
  %20 = add i32 %19, -1
  %or.cond3 = icmp ult i32 %20, 3
  br i1 %or.cond3, label %21, label %79

21:                                               ; preds = %17
  %22 = tail call noundef i32 @_ZN6SoLoud4File5read8Ev(ptr noundef nonnull align 8 dereferenceable(8) %1)
  %23 = tail call noundef i32 @_ZN6SoLoud4File6read16Ev(ptr noundef nonnull align 8 dereferenceable(8) %1)
  %24 = tail call noundef i32 @_ZN6SoLoud4File6read16Ev(ptr noundef nonnull align 8 dereferenceable(8) %1)
  %25 = shl i32 %23, 10
  %26 = add i32 %25, -1024
  %27 = add nsw i32 %26, %24
  %28 = getelementptr inbounds i8, ptr %0, i64 168
  store i32 %27, ptr %28, align 8, !tbaa !8
  %29 = tail call noundef i32 @_ZN6SoLoud4File6read16Ev(ptr noundef nonnull align 8 dereferenceable(8) %1)
  %30 = shl i32 %29, 10
  %31 = tail call noundef i32 @_ZN6SoLoud4File6read16Ev(ptr noundef nonnull align 8 dereferenceable(8) %1)
  %32 = add i32 %30, %31
  %33 = getelementptr inbounds i8, ptr %0, i64 164
  store i32 %32, ptr %33, align 4, !tbaa !17
  %34 = tail call noundef i32 @_ZN6SoLoud4File6read32Ev(ptr noundef nonnull align 8 dereferenceable(8) %1)
  %35 = getelementptr inbounds i8, ptr %0, i64 160
  store i32 %34, ptr %35, align 8, !tbaa !18
  %36 = tail call noundef i32 @_ZN6SoLoud4File6read32Ev(ptr noundef nonnull align 8 dereferenceable(8) %1)
  %37 = getelementptr inbounds i8, ptr %0, i64 156
  store i32 %36, ptr %37, align 4, !tbaa !19
  %38 = getelementptr inbounds i8, ptr %0, i64 152
  %39 = trunc i32 %22 to i8
  %40 = lshr i8 %39, 6
  %spec.select = and i8 %40, 1
  store i8 %spec.select, ptr %38, align 8, !tbaa !20
  %41 = load i32, ptr %28, align 8, !tbaa !8
  %42 = sext i32 %41 to i64
  %43 = icmp slt i32 %41, 0
  %44 = shl nsw i64 %42, 1
  %45 = select i1 %43, i64 -1, i64 %44
  %46 = tail call noalias noundef nonnull ptr @_Znam(i64 noundef %45) #4
  %47 = getelementptr inbounds i8, ptr %0, i64 176
  store ptr %46, ptr %47, align 8, !tbaa !21
  %48 = load ptr, ptr %1, align 8, !tbaa !5
  %49 = getelementptr inbounds i8, ptr %48, i64 40
  %50 = load ptr, ptr %49, align 8
  tail call void %50(ptr noundef nonnull align 8 dereferenceable(8) %1, i32 noundef %18)
  %51 = and i32 %22, 1
  %.not47 = icmp eq i32 %51, 0
  br i1 %.not47, label %59, label %52

52:                                               ; preds = %21
  %53 = load ptr, ptr %47, align 8, !tbaa !21
  %54 = load i32, ptr %28, align 8, !tbaa !8
  %55 = load ptr, ptr %1, align 8, !tbaa !5
  %56 = getelementptr inbounds i8, ptr %55, i64 24
  %57 = load ptr, ptr %56, align 8
  %58 = tail call noundef i32 %57(ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef %53, i32 noundef %54)
  br label %79

59:                                               ; preds = %21
  %60 = load ptr, ptr %1, align 8, !tbaa !5
  %61 = getelementptr inbounds i8, ptr %60, i64 32
  %62 = load ptr, ptr %61, align 8
  %63 = tail call noundef i32 %62(ptr noundef nonnull align 8 dereferenceable(8) %1)
  %64 = sub i32 %63, %18
  %65 = sext i32 %64 to i64
  %66 = tail call noalias noundef nonnull ptr @_Znam(i64 noundef %65) #4
  %67 = load ptr, ptr %1, align 8, !tbaa !5
  %68 = getelementptr inbounds i8, ptr %67, i64 24
  %69 = load ptr, ptr %68, align 8
  %70 = tail call noundef i32 %69(ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef nonnull %66, i32 noundef %64)
  %71 = icmp sgt i32 %23, 0
  br i1 %71, label %.lr.ph.preheader, label %._crit_edge

.lr.ph.preheader:                                 ; preds = %59
  %wide.trip.count = zext nneg i32 %23 to i64
  br label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph.preheader, %.lr.ph
  %indvars.iv = phi i64 [ 0, %.lr.ph.preheader ], [ %indvars.iv.next, %.lr.ph ]
  %.04248 = phi i32 [ 0, %.lr.ph.preheader ], [ %78, %.lr.ph ]
  %72 = sext i32 %.04248 to i64
  %73 = getelementptr inbounds i8, ptr %66, i64 %72
  %74 = load ptr, ptr %47, align 8, !tbaa !21
  %75 = shl nsw i64 %indvars.iv, 10
  %76 = getelementptr inbounds i8, ptr %74, i64 %75
  %77 = tail call noundef i32 @_ZL14zx7_decompressPhS_(ptr noundef nonnull %73, ptr noundef %76)
  %78 = add nsw i32 %77, %.04248
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph, !llvm.loop !22

._crit_edge:                                      ; preds = %.lr.ph, %59
  tail call void @_ZdaPv(ptr noundef nonnull %66) #5
  br label %79

79:                                               ; preds = %17, %._crit_edge, %52, %15, %10, %4, %2
  %.1 = phi i32 [ 1, %2 ], [ 3, %4 ], [ 3, %10 ], [ 3, %15 ], [ 3, %17 ], [ 0, %._crit_edge ], [ 0, %52 ]
  ret i32 %.1
}

declare noundef i32 @_ZN6SoLoud4File6read32Ev(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #2

declare noundef i32 @_ZN6SoLoud4File6read16Ev(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #2

declare noundef i32 @_ZN6SoLoud4File5read8Ev(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #2

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

; Function Attrs: mustprogress uwtable
declare hidden noundef i32 @_ZL14zx7_decompressPhS_(ptr noundef, ptr noundef) local_unnamed_addr #1

attributes #0 = { nobuiltin nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { "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 = { builtin allocsize(0) }
attributes #5 = { builtin 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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !11, i64 168}
!9 = !{!"_ZTSN6SoLoud2AyE", !10, i64 0, !16, i64 152, !11, i64 156, !11, i64 160, !11, i64 164, !11, i64 168, !14, i64 176}
!10 = !{!"_ZTSN6SoLoud11AudioSourceE", !11, i64 8, !13, i64 12, !13, i64 16, !11, i64 20, !11, i64 24, !13, i64 28, !13, i64 32, !13, i64 36, !11, i64 40, !13, i64 44, !12, i64 48, !14, i64 112, !14, i64 120, !14, i64 128, !11, i64 136, !15, i64 144}
!11 = !{!"int", !12, i64 0}
!12 = !{!"omnipotent char", !7, i64 0}
!13 = !{!"float", !12, i64 0}
!14 = !{!"any pointer", !12, i64 0}
!15 = !{!"double", !12, i64 0}
!16 = !{!"bool", !12, i64 0}
!17 = !{!9, !11, i64 164}
!18 = !{!9, !11, i64 160}
!19 = !{!9, !11, i64 156}
!20 = !{!9, !16, i64 152}
!21 = !{!9, !14, i64 176}
!22 = distinct !{!22, !23}
!23 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass