; LLVM IR from Overload-Technologies/Overload :: Dependencies/soloud/src/audiosource/tedsid (soloud_tedsid)

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

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN6SoLoud6TedSid8loadFileEPNS_4FileE(ptr noundef nonnull align 8 dereferenceable(172) %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 %191

20:                                               ; preds = %2
  %21 = getelementptr inbounds %"class.SoLoud::TedSid", ptr %16, i32 0, i32 3
  %22 = load ptr, ptr %21, align 8, !tbaa !9
  %23 = icmp eq ptr %22, null
  br i1 %23, label %25, label %24

24:                                               ; preds = %20
  call void @_ZdaPv(ptr noundef %22) #6
  br label %25

25:                                               ; preds = %24, %20
  %26 = getelementptr inbounds %"class.SoLoud::TedSid", ptr %16, i32 0, i32 3
  store ptr null, ptr %26, align 8, !tbaa !9
  %27 = load ptr, ptr %5, align 8, !tbaa !5
  %28 = load ptr, ptr %27, align 8, !tbaa !15
  %29 = getelementptr inbounds ptr, ptr %28, i64 4
  %30 = load ptr, ptr %29, align 8
  %31 = call noundef i32 %30(ptr noundef nonnull align 8 dereferenceable(8) %27)
  %32 = icmp ult i32 %31, 34
  br i1 %32, label %33, label %34

33:                                               ; preds = %25
  store i32 3, ptr %3, align 4
  br label %191

34:                                               ; preds = %25
  %35 = load ptr, ptr %5, align 8, !tbaa !5
  %36 = load ptr, ptr %35, align 8, !tbaa !15
  %37 = getelementptr inbounds ptr, ptr %36, i64 5
  %38 = load ptr, ptr %37, align 8
  call void %38(ptr noundef nonnull align 8 dereferenceable(8) %35, i32 noundef 0)
  %39 = load ptr, ptr %5, align 8, !tbaa !5
  %40 = call noundef i32 @_ZN6SoLoud4File6read32Ev(ptr noundef nonnull align 8 dereferenceable(8) %39)
  %41 = icmp ne i32 %40, 1346979907
  br i1 %41, label %42, label %43

42:                                               ; preds = %34
  store i32 3, ptr %3, align 4
  br label %191

43:                                               ; preds = %34
  %44 = load ptr, ptr %5, align 8, !tbaa !5
  %45 = call noundef i32 @_ZN6SoLoud4File6read32Ev(ptr noundef nonnull align 8 dereferenceable(8) %44)
  %46 = icmp ne i32 %45, 1162761556
  br i1 %46, label %47, label %48

47:                                               ; preds = %43
  store i32 3, ptr %3, align 4
  br label %191

48:                                               ; preds = %43
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #7
  %49 = load ptr, ptr %5, align 8, !tbaa !5
  %50 = call noundef i32 @_ZN6SoLoud4File6read16Ev(ptr noundef nonnull align 8 dereferenceable(8) %49)
  store i32 %50, ptr %6, align 4, !tbaa !17
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #7
  %51 = load ptr, ptr %5, align 8, !tbaa !5
  %52 = call noundef i32 @_ZN6SoLoud4File5read8Ev(ptr noundef nonnull align 8 dereferenceable(8) %51)
  store i32 %52, ptr %7, align 4, !tbaa !17
  %53 = load i32, ptr %7, align 4, !tbaa !17
  %54 = icmp eq i32 %53, 0
  br i1 %54, label %65, label %55

55:                                               ; preds = %48
  %56 = load i32, ptr %7, align 4, !tbaa !17
  %57 = icmp eq i32 %56, 4
  br i1 %57, label %65, label %58

58:                                               ; preds = %55
  %59 = load i32, ptr %7, align 4, !tbaa !17
  %60 = icmp eq i32 %59, 5
  br i1 %60, label %65, label %61

61:                                               ; preds = %58
  %62 = load i32, ptr %7, align 4, !tbaa !17
  %63 = icmp eq i32 %62, 6
  br i1 %63, label %65, label %64

64:                                               ; preds = %61
  store i32 3, ptr %3, align 4
  store i32 1, ptr %8, align 4
  br label %190

65:                                               ; preds = %61, %58, %55, %48
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #7
  %66 = load ptr, ptr %5, align 8, !tbaa !5
  %67 = call noundef i32 @_ZN6SoLoud4File5read8Ev(ptr noundef nonnull align 8 dereferenceable(8) %66)
  store i32 %67, ptr %9, align 4, !tbaa !17
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #7
  %68 = load ptr, ptr %5, align 8, !tbaa !5
  %69 = call noundef i32 @_ZN6SoLoud4File6read16Ev(ptr noundef nonnull align 8 dereferenceable(8) %68)
  store i32 %69, ptr %10, align 4, !tbaa !17
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #7
  %70 = load ptr, ptr %5, align 8, !tbaa !5
  %71 = call noundef i32 @_ZN6SoLoud4File6read16Ev(ptr noundef nonnull align 8 dereferenceable(8) %70)
  store i32 %71, ptr %11, align 4, !tbaa !17
  %72 = load i32, ptr %10, align 4, !tbaa !17
  %73 = sub nsw i32 %72, 1
  %74 = mul nsw i32 %73, 1024
  %75 = load i32, ptr %11, align 4, !tbaa !17
  %76 = add nsw i32 %74, %75
  %77 = getelementptr inbounds %"class.SoLoud::TedSid", ptr %16, i32 0, i32 2
  store i32 %76, ptr %77, align 4, !tbaa !18
  %78 = load ptr, ptr %5, align 8, !tbaa !5
  %79 = call noundef i32 @_ZN6SoLoud4File6read16Ev(ptr noundef nonnull align 8 dereferenceable(8) %78)
  %80 = mul i32 %79, 1024
  %81 = load ptr, ptr %5, align 8, !tbaa !5
  %82 = call noundef i32 @_ZN6SoLoud4File6read16Ev(ptr noundef nonnull align 8 dereferenceable(8) %81)
  %83 = add i32 %80, %82
  %84 = getelementptr inbounds %"class.SoLoud::TedSid", ptr %16, i32 0, i32 1
  store i32 %83, ptr %84, align 8, !tbaa !19
  %85 = load ptr, ptr %5, align 8, !tbaa !5
  %86 = call noundef i32 @_ZN6SoLoud4File6read32Ev(ptr noundef nonnull align 8 dereferenceable(8) %85)
  %87 = load ptr, ptr %5, align 8, !tbaa !5
  %88 = call noundef i32 @_ZN6SoLoud4File6read32Ev(ptr noundef nonnull align 8 dereferenceable(8) %87)
  %89 = getelementptr inbounds %"class.SoLoud::AudioSource", ptr %16, i32 0, i32 1
  %90 = load i32, ptr %89, align 8, !tbaa !20
  %91 = and i32 %90, 48
  %92 = icmp eq i32 %91, 0
  br i1 %92, label %93, label %95

93:                                               ; preds = %65
  %94 = getelementptr inbounds %"class.SoLoud::TedSid", ptr %16, i32 0, i32 4
  store i32 0, ptr %94, align 8, !tbaa !21
  br label %95

95:                                               ; preds = %93, %65
  %96 = getelementptr inbounds %"class.SoLoud::AudioSource", ptr %16, i32 0, i32 1
  %97 = load i32, ptr %96, align 8, !tbaa !20
  %98 = and i32 %97, 48
  %99 = icmp eq i32 %98, 16
  br i1 %99, label %100, label %102

100:                                              ; preds = %95
  %101 = getelementptr inbounds %"class.SoLoud::TedSid", ptr %16, i32 0, i32 4
  store i32 1, ptr %101, align 8, !tbaa !21
  br label %102

102:                                              ; preds = %100, %95
  %103 = getelementptr inbounds %"class.SoLoud::AudioSource", ptr %16, i32 0, i32 1
  %104 = load i32, ptr %103, align 8, !tbaa !20
  %105 = and i32 %104, 48
  %106 = icmp eq i32 %105, 32
  br i1 %106, label %107, label %109

107:                                              ; preds = %102
  %108 = getelementptr inbounds %"class.SoLoud::TedSid", ptr %16, i32 0, i32 4
  store i32 2, ptr %108, align 8, !tbaa !21
  br label %109

109:                                              ; preds = %107, %102
  %110 = getelementptr inbounds %"class.SoLoud::AudioSource", ptr %16, i32 0, i32 1
  %111 = load i32, ptr %110, align 8, !tbaa !20
  %112 = and i32 %111, 48
  %113 = icmp eq i32 %112, 48
  br i1 %113, label %114, label %116

114:                                              ; preds = %109
  %115 = getelementptr inbounds %"class.SoLoud::TedSid", ptr %16, i32 0, i32 4
  store i32 3, ptr %115, align 8, !tbaa !21
  br label %116

116:                                              ; preds = %114, %109
  %117 = getelementptr inbounds %"class.SoLoud::TedSid", ptr %16, i32 0, i32 2
  %118 = load i32, ptr %117, align 4, !tbaa !18
  %119 = sext i32 %118 to i64
  %120 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %119, i64 2)
  %121 = extractvalue { i64, i1 } %120, 1
  %122 = extractvalue { i64, i1 } %120, 0
  %123 = select i1 %121, i64 -1, i64 %122
  %124 = call noalias noundef nonnull ptr @_Znam(i64 noundef %123) #8
  %125 = getelementptr inbounds %"class.SoLoud::TedSid", ptr %16, i32 0, i32 3
  store ptr %124, ptr %125, align 8, !tbaa !9
  %126 = load ptr, ptr %5, align 8, !tbaa !5
  %127 = load i32, ptr %6, align 4, !tbaa !17
  %128 = load ptr, ptr %126, align 8, !tbaa !15
  %129 = getelementptr inbounds ptr, ptr %128, i64 5
  %130 = load ptr, ptr %129, align 8
  call void %130(ptr noundef nonnull align 8 dereferenceable(8) %126, i32 noundef %127)
  %131 = load i32, ptr %9, align 4, !tbaa !17
  %132 = and i32 %131, 1
  %133 = icmp ne i32 %132, 0
  br i1 %133, label %134, label %144

134:                                              ; preds = %116
  %135 = load ptr, ptr %5, align 8, !tbaa !5
  %136 = getelementptr inbounds %"class.SoLoud::TedSid", ptr %16, i32 0, i32 3
  %137 = load ptr, ptr %136, align 8, !tbaa !9
  %138 = getelementptr inbounds %"class.SoLoud::TedSid", ptr %16, i32 0, i32 2
  %139 = load i32, ptr %138, align 4, !tbaa !18
  %140 = load ptr, ptr %135, align 8, !tbaa !15
  %141 = getelementptr inbounds ptr, ptr %140, i64 3
  %142 = load ptr, ptr %141, align 8
  %143 = call noundef i32 %142(ptr noundef nonnull align 8 dereferenceable(8) %135, ptr noundef %137, i32 noundef %139)
  br label %189

144:                                              ; preds = %116
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #7
  %145 = load ptr, ptr %5, align 8, !tbaa !5
  %146 = load ptr, ptr %145, align 8, !tbaa !15
  %147 = getelementptr inbounds ptr, ptr %146, i64 4
  %148 = load ptr, ptr %147, align 8
  %149 = call noundef i32 %148(ptr noundef nonnull align 8 dereferenceable(8) %145)
  %150 = load i32, ptr %6, align 4, !tbaa !17
  %151 = sub i32 %149, %150
  store i32 %151, ptr %12, align 4, !tbaa !17
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #7
  %152 = load i32, ptr %12, align 4, !tbaa !17
  %153 = sext i32 %152 to i64
  %154 = call noalias noundef nonnull ptr @_Znam(i64 noundef %153) #8
  store ptr %154, ptr %13, align 8, !tbaa !5
  %155 = load ptr, ptr %5, align 8, !tbaa !5
  %156 = load ptr, ptr %13, align 8, !tbaa !5
  %157 = load i32, ptr %12, align 4, !tbaa !17
  %158 = load ptr, ptr %155, align 8, !tbaa !15
  %159 = getelementptr inbounds ptr, ptr %158, i64 3
  %160 = load ptr, ptr %159, align 8
  %161 = call noundef i32 %160(ptr noundef nonnull align 8 dereferenceable(8) %155, ptr noundef %156, i32 noundef %157)
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #7
  store i32 0, ptr %14, align 4, !tbaa !17
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #7
  store i32 0, ptr %15, align 4, !tbaa !17
  br label %162

162:                                              ; preds = %181, %144
  %163 = load i32, ptr %15, align 4, !tbaa !17
  %164 = load i32, ptr %10, align 4, !tbaa !17
  %165 = icmp slt i32 %163, %164
  br i1 %165, label %167, label %166

166:                                              ; preds = %162
  store i32 2, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #7
  br label %184

167:                                              ; preds = %162
  %168 = load ptr, ptr %13, align 8, !tbaa !5
  %169 = load i32, ptr %14, align 4, !tbaa !17
  %170 = sext i32 %169 to i64
  %171 = getelementptr inbounds i8, ptr %168, i64 %170
  %172 = getelementptr inbounds %"class.SoLoud::TedSid", ptr %16, i32 0, i32 3
  %173 = load ptr, ptr %172, align 8, !tbaa !9
  %174 = load i32, ptr %15, align 4, !tbaa !17
  %175 = mul nsw i32 %174, 1024
  %176 = sext i32 %175 to i64
  %177 = getelementptr inbounds i8, ptr %173, i64 %176
  %178 = call noundef i32 @_ZL14zx7_decompressPhS_(ptr noundef %171, ptr noundef %177)
  %179 = load i32, ptr %14, align 4, !tbaa !17
  %180 = add nsw i32 %179, %178
  store i32 %180, ptr %14, align 4, !tbaa !17
  br label %181

181:                                              ; preds = %167
  %182 = load i32, ptr %15, align 4, !tbaa !17
  %183 = add nsw i32 %182, 1
  store i32 %183, ptr %15, align 4, !tbaa !17
  br label %162, !llvm.loop !22

184:                                              ; preds = %166
  %185 = load ptr, ptr %13, align 8, !tbaa !5
  %186 = icmp eq ptr %185, null
  br i1 %186, label %188, label %187

187:                                              ; preds = %184
  call void @_ZdaPv(ptr noundef %185) #6
  br label %188

188:                                              ; preds = %187, %184
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #7
  br label %189

189:                                              ; preds = %188, %134
  store i32 0, ptr %3, align 4
  store i32 1, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #7
  br label %190

190:                                              ; preds = %189, %64
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #7
  br label %191

191:                                              ; preds = %190, %47, %42, %33, %19
  %192 = load i32, ptr %3, align 4
  ret i32 %192
}

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 = { builtin nounwind }
attributes #7 = { nounwind }
attributes #8 = { builtin allocsize(0) }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !6, i64 160}
!10 = !{!"_ZTSN6SoLoud6TedSidE", !11, i64 0, !12, i64 152, !12, i64 156, !6, i64 160, !12, i64 168}
!11 = !{!"_ZTSN6SoLoud11AudioSourceE", !12, i64 8, !13, i64 12, !13, i64 16, !12, i64 20, !12, i64 24, !13, i64 28, !13, i64 32, !13, i64 36, !12, i64 40, !13, i64 44, !7, i64 48, !6, i64 112, !6, i64 120, !6, i64 128, !12, i64 136, !14, i64 144}
!12 = !{!"int", !7, i64 0}
!13 = !{!"float", !7, i64 0}
!14 = !{!"double", !7, i64 0}
!15 = !{!16, !16, i64 0}
!16 = !{!"vtable pointer", !8, i64 0}
!17 = !{!12, !12, i64 0}
!18 = !{!10, !12, i64 156}
!19 = !{!10, !12, i64 152}
!20 = !{!11, !12, i64 8}
!21 = !{!10, !12, i64 168}
!22 = distinct !{!22, !23}
!23 = !{!"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 @_ZN6SoLoud6TedSid8loadFileEPNS_4FileE(ptr nocapture noundef nonnull align 8 dereferenceable(172) %0, ptr noundef %1) local_unnamed_addr #1 align 2 {
  %3 = icmp eq ptr %1, null
  br i1 %3, label %81, label %4

4:                                                ; preds = %2
  %5 = getelementptr inbounds i8, ptr %0, i64 160
  %6 = load ptr, ptr %5, align 8, !tbaa !5
  %7 = icmp eq ptr %6, null
  br i1 %7, label %9, label %8

8:                                                ; preds = %4
  tail call void @_ZdaPv(ptr noundef nonnull %6) #4
  br label %9

9:                                                ; preds = %8, %4
  store ptr null, ptr %5, align 8, !tbaa !5
  %10 = load ptr, ptr %1, align 8, !tbaa !14
  %11 = getelementptr inbounds i8, ptr %10, i64 32
  %12 = load ptr, ptr %11, align 8
  %13 = tail call noundef i32 %12(ptr noundef nonnull align 8 dereferenceable(8) %1)
  %14 = icmp ult i32 %13, 34
  br i1 %14, label %81, label %15

15:                                               ; preds = %9
  %16 = load ptr, ptr %1, align 8, !tbaa !14
  %17 = getelementptr inbounds i8, ptr %16, i64 40
  %18 = load ptr, ptr %17, align 8
  tail call void %18(ptr noundef nonnull align 8 dereferenceable(8) %1, i32 noundef 0)
  %19 = tail call noundef i32 @_ZN6SoLoud4File6read32Ev(ptr noundef nonnull align 8 dereferenceable(8) %1)
  %.not = icmp eq i32 %19, 1346979907
  br i1 %.not, label %20, label %81

20:                                               ; preds = %15
  %21 = tail call noundef i32 @_ZN6SoLoud4File6read32Ev(ptr noundef nonnull align 8 dereferenceable(8) %1)
  %.not48 = icmp eq i32 %21, 1162761556
  br i1 %.not48, label %22, label %81

22:                                               ; preds = %20
  %23 = tail call noundef i32 @_ZN6SoLoud4File6read16Ev(ptr noundef nonnull align 8 dereferenceable(8) %1)
  %24 = tail call noundef i32 @_ZN6SoLoud4File5read8Ev(ptr noundef nonnull align 8 dereferenceable(8) %1)
  switch i32 %24, label %81 [
    i32 6, label %.thread52
    i32 5, label %.thread52
    i32 4, label %.thread52
    i32 0, label %.thread52
  ]

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

54:                                               ; preds = %.thread52
  %55 = load ptr, ptr %5, align 8, !tbaa !5
  %56 = load i32, ptr %31, align 4, !tbaa !16
  %57 = load ptr, ptr %1, align 8, !tbaa !14
  %58 = getelementptr inbounds i8, ptr %57, i64 24
  %59 = load ptr, ptr %58, align 8
  %60 = tail call noundef i32 %59(ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef %55, i32 noundef %56)
  br label %81

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

.lr.ph.preheader:                                 ; preds = %61
  %wide.trip.count = zext nneg i32 %26 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 ]
  %.04453 = phi i32 [ 0, %.lr.ph.preheader ], [ %80, %.lr.ph ]
  %74 = sext i32 %.04453 to i64
  %75 = getelementptr inbounds i8, ptr %68, i64 %74
  %76 = load ptr, ptr %5, align 8, !tbaa !5
  %77 = shl nsw i64 %indvars.iv, 10
  %78 = getelementptr inbounds i8, ptr %76, i64 %77
  %79 = tail call noundef i32 @_ZL14zx7_decompressPhS_(ptr noundef nonnull %75, ptr noundef %78)
  %80 = add nsw i32 %79, %.04453
  %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 !20

._crit_edge:                                      ; preds = %.lr.ph, %61
  tail call void @_ZdaPv(ptr noundef nonnull %68) #4
  br label %81

81:                                               ; preds = %22, %._crit_edge, %54, %20, %15, %9, %2
  %.1 = phi i32 [ 1, %2 ], [ 3, %9 ], [ 3, %15 ], [ 3, %20 ], [ 3, %22 ], [ 0, %._crit_edge ], [ 0, %54 ]
  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 nounwind }
attributes #5 = { 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, !12, i64 160}
!6 = !{!"_ZTSN6SoLoud6TedSidE", !7, i64 0, !8, i64 152, !8, i64 156, !12, i64 160, !8, i64 168}
!7 = !{!"_ZTSN6SoLoud11AudioSourceE", !8, i64 8, !11, i64 12, !11, i64 16, !8, i64 20, !8, i64 24, !11, i64 28, !11, i64 32, !11, i64 36, !8, i64 40, !11, i64 44, !9, i64 48, !12, i64 112, !12, i64 120, !12, i64 128, !8, i64 136, !13, i64 144}
!8 = !{!"int", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C++ TBAA"}
!11 = !{!"float", !9, i64 0}
!12 = !{!"any pointer", !9, i64 0}
!13 = !{!"double", !9, i64 0}
!14 = !{!15, !15, i64 0}
!15 = !{!"vtable pointer", !10, i64 0}
!16 = !{!6, !8, i64 156}
!17 = !{!6, !8, i64 152}
!18 = !{!7, !8, i64 8}
!19 = !{!6, !8, i64 168}
!20 = distinct !{!20, !21}
!21 = !{!"llvm.loop.mustprogress"}


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