; LLVM IR from Overload-Technologies/Overload :: Dependencies/soloud/src/core (soloud_core_voicegroup)

; 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::Soloud" = type <{ ptr, ptr, i8, [7 x i8], ptr, ptr, ptr, i32, i32, %"class.SoLoud::AlignedFloatBuffer", i32, [4 x i8], %"class.SoLoud::AlignedFloatBuffer", ptr, %"class.SoLoud::AlignedFloatBuffer", ptr, [1024 x ptr], i32, i32, i32, i32, ptr, i32, i32, float, float, i32, i32, %"class.SoLoud::Fader", double, double, [8 x ptr], [8 x ptr], [8 x float], [256 x float], [256 x float], [256 x float], [3 x float], [3 x float], [3 x float], [3 x float], float, [24 x float], [4 x i8], [1024 x %"class.SoLoud::AudioSourceInstance3dData"], ptr, i32, [1024 x i32], i32, i8, [7 x i8] }>
%"class.SoLoud::AlignedFloatBuffer" = type <{ ptr, ptr, i32, [4 x i8] }>
%"class.SoLoud::Fader" = type { float, float, float, double, double, double, float, i32 }
%"class.SoLoud::AudioSourceInstance3dData" = type <{ [3 x float], [3 x float], float, float, float, i32, float, [4 x i8], ptr, ptr, i32, float, float, [8 x float], i32, i32, [4 x i8] }>

declare void @_ZN6SoLoud6Soloud23lockAudioMutex_internalEv(ptr noundef nonnull align 8 dereferenceable(138833)) #0

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

declare void @_ZN6SoLoud6Soloud25unlockAudioMutex_internalEv(ptr noundef nonnull align 8 dereferenceable(138833)) #0

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN6SoLoud6Soloud12isVoiceGroupEj(ptr noundef nonnull align 8 dereferenceable(138833), i32 noundef) #2 align 2

declare noundef zeroext i1 @_ZN6SoLoud6Soloud18isValidVoiceHandleEj(ptr noundef nonnull align 8 dereferenceable(138833), i32 noundef) #0

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN6SoLoud6Soloud23trimVoiceGroup_internalEj(ptr noundef nonnull align 8 dereferenceable(138833) %0, i32 noundef %1) #2 align 2 {
  %3 = alloca ptr, align 8
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  store i32 %1, ptr %4, align 4, !tbaa !9
  %9 = load ptr, ptr %3, align 8
  %10 = load i32, ptr %4, align 4, !tbaa !9
  %11 = call noundef zeroext i1 @_ZN6SoLoud6Soloud12isVoiceGroupEj(ptr noundef nonnull align 8 dereferenceable(138833) %9, i32 noundef %10)
  br i1 %11, label %13, label %12

12:                                               ; preds = %2
  br label %158

13:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #3
  %14 = load i32, ptr %4, align 4, !tbaa !9
  %15 = and i32 %14, 4095
  store i32 %15, ptr %5, align 4, !tbaa !9
  call void @_ZN6SoLoud6Soloud23lockAudioMutex_internalEv(ptr noundef nonnull align 8 dereferenceable(138833) %9)
  %16 = getelementptr inbounds %"class.SoLoud::Soloud", ptr %9, i32 0, i32 45
  %17 = load ptr, ptr %16, align 8, !tbaa !11
  %18 = load i32, ptr %5, align 4, !tbaa !9
  %19 = sext i32 %18 to i64
  %20 = getelementptr inbounds ptr, ptr %17, i64 %19
  %21 = load ptr, ptr %20, align 8, !tbaa !5
  %22 = getelementptr inbounds i32, ptr %21, i64 1
  %23 = load i32, ptr %22, align 4, !tbaa !9
  %24 = icmp eq i32 %23, 0
  br i1 %24, label %25, label %26

25:                                               ; preds = %13
  call void @_ZN6SoLoud6Soloud25unlockAudioMutex_internalEv(ptr noundef nonnull align 8 dereferenceable(138833) %9)
  store i32 1, ptr %6, align 4
  br label %156

26:                                               ; preds = %13
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #3
  store i32 1, ptr %7, align 4, !tbaa !9
  br label %27

27:                                               ; preds = %151, %26
  %28 = load i32, ptr %7, align 4, !tbaa !9
  %29 = getelementptr inbounds %"class.SoLoud::Soloud", ptr %9, i32 0, i32 45
  %30 = load ptr, ptr %29, align 8, !tbaa !11
  %31 = load i32, ptr %5, align 4, !tbaa !9
  %32 = sext i32 %31 to i64
  %33 = getelementptr inbounds ptr, ptr %30, i64 %32
  %34 = load ptr, ptr %33, align 8, !tbaa !5
  %35 = getelementptr inbounds i32, ptr %34, i64 0
  %36 = load i32, ptr %35, align 4, !tbaa !9
  %37 = icmp ult i32 %28, %36
  br i1 %37, label %38, label %154

38:                                               ; preds = %27
  %39 = getelementptr inbounds %"class.SoLoud::Soloud", ptr %9, i32 0, i32 45
  %40 = load ptr, ptr %39, align 8, !tbaa !11
  %41 = load i32, ptr %5, align 4, !tbaa !9
  %42 = sext i32 %41 to i64
  %43 = getelementptr inbounds ptr, ptr %40, i64 %42
  %44 = load ptr, ptr %43, align 8, !tbaa !5
  %45 = load i32, ptr %7, align 4, !tbaa !9
  %46 = zext i32 %45 to i64
  %47 = getelementptr inbounds i32, ptr %44, i64 %46
  %48 = load i32, ptr %47, align 4, !tbaa !9
  %49 = icmp eq i32 %48, 0
  br i1 %49, label %50, label %51

50:                                               ; preds = %38
  call void @_ZN6SoLoud6Soloud25unlockAudioMutex_internalEv(ptr noundef nonnull align 8 dereferenceable(138833) %9)
  store i32 1, ptr %6, align 4
  br label %155

51:                                               ; preds = %38
  call void @_ZN6SoLoud6Soloud25unlockAudioMutex_internalEv(ptr noundef nonnull align 8 dereferenceable(138833) %9)
  br label %52

52:                                               ; preds = %149, %51
  %53 = getelementptr inbounds %"class.SoLoud::Soloud", ptr %9, i32 0, i32 45
  %54 = load ptr, ptr %53, align 8, !tbaa !11
  %55 = load i32, ptr %5, align 4, !tbaa !9
  %56 = sext i32 %55 to i64
  %57 = getelementptr inbounds ptr, ptr %54, i64 %56
  %58 = load ptr, ptr %57, align 8, !tbaa !5
  %59 = load i32, ptr %7, align 4, !tbaa !9
  %60 = zext i32 %59 to i64
  %61 = getelementptr inbounds i32, ptr %58, i64 %60
  %62 = load i32, ptr %61, align 4, !tbaa !9
  %63 = call noundef zeroext i1 @_ZN6SoLoud6Soloud18isValidVoiceHandleEj(ptr noundef nonnull align 8 dereferenceable(138833) %9, i32 noundef %62)
  %64 = xor i1 %63, true
  br i1 %64, label %65, label %150

65:                                               ; preds = %52
  call void @_ZN6SoLoud6Soloud23lockAudioMutex_internalEv(ptr noundef nonnull align 8 dereferenceable(138833) %9)
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #3
  %66 = load i32, ptr %7, align 4, !tbaa !9
  store i32 %66, ptr %8, align 4, !tbaa !9
  br label %67

67:                                               ; preds = %113, %65
  %68 = load i32, ptr %8, align 4, !tbaa !9
  %69 = getelementptr inbounds %"class.SoLoud::Soloud", ptr %9, i32 0, i32 45
  %70 = load ptr, ptr %69, align 8, !tbaa !11
  %71 = load i32, ptr %5, align 4, !tbaa !9
  %72 = sext i32 %71 to i64
  %73 = getelementptr inbounds ptr, ptr %70, i64 %72
  %74 = load ptr, ptr %73, align 8, !tbaa !5
  %75 = getelementptr inbounds i32, ptr %74, i64 0
  %76 = load i32, ptr %75, align 4, !tbaa !9
  %77 = sub i32 %76, 1
  %78 = icmp ult i32 %68, %77
  br i1 %78, label %79, label %116

79:                                               ; preds = %67
  %80 = getelementptr inbounds %"class.SoLoud::Soloud", ptr %9, i32 0, i32 45
  %81 = load ptr, ptr %80, align 8, !tbaa !11
  %82 = load i32, ptr %5, align 4, !tbaa !9
  %83 = sext i32 %82 to i64
  %84 = getelementptr inbounds ptr, ptr %81, i64 %83
  %85 = load ptr, ptr %84, align 8, !tbaa !5
  %86 = load i32, ptr %8, align 4, !tbaa !9
  %87 = add i32 %86, 1
  %88 = zext i32 %87 to i64
  %89 = getelementptr inbounds i32, ptr %85, i64 %88
  %90 = load i32, ptr %89, align 4, !tbaa !9
  %91 = getelementptr inbounds %"class.SoLoud::Soloud", ptr %9, i32 0, i32 45
  %92 = load ptr, ptr %91, align 8, !tbaa !11
  %93 = load i32, ptr %5, align 4, !tbaa !9
  %94 = sext i32 %93 to i64
  %95 = getelementptr inbounds ptr, ptr %92, i64 %94
  %96 = load ptr, ptr %95, align 8, !tbaa !5
  %97 = load i32, ptr %8, align 4, !tbaa !9
  %98 = zext i32 %97 to i64
  %99 = getelementptr inbounds i32, ptr %96, i64 %98
  store i32 %90, ptr %99, align 4, !tbaa !9
  %100 = getelementptr inbounds %"class.SoLoud::Soloud", ptr %9, i32 0, i32 45
  %101 = load ptr, ptr %100, align 8, !tbaa !11
  %102 = load i32, ptr %5, align 4, !tbaa !9
  %103 = sext i32 %102 to i64
  %104 = getelementptr inbounds ptr, ptr %101, i64 %103
  %105 = load ptr, ptr %104, align 8, !tbaa !5
  %106 = load i32, ptr %8, align 4, !tbaa !9
  %107 = zext i32 %106 to i64
  %108 = getelementptr inbounds i32, ptr %105, i64 %107
  %109 = load i32, ptr %108, align 4, !tbaa !9
  %110 = icmp eq i32 %109, 0
  br i1 %110, label %111, label %112

111:                                              ; preds = %79
  br label %116

112:                                              ; preds = %79
  br label %113

113:                                              ; preds = %112
  %114 = load i32, ptr %8, align 4, !tbaa !9
  %115 = add i32 %114, 1
  store i32 %115, ptr %8, align 4, !tbaa !9
  br label %67, !llvm.loop !18

116:                                              ; preds = %111, %67
  %117 = getelementptr inbounds %"class.SoLoud::Soloud", ptr %9, i32 0, i32 45
  %118 = load ptr, ptr %117, align 8, !tbaa !11
  %119 = load i32, ptr %5, align 4, !tbaa !9
  %120 = sext i32 %119 to i64
  %121 = getelementptr inbounds ptr, ptr %118, i64 %120
  %122 = load ptr, ptr %121, align 8, !tbaa !5
  %123 = getelementptr inbounds %"class.SoLoud::Soloud", ptr %9, i32 0, i32 45
  %124 = load ptr, ptr %123, align 8, !tbaa !11
  %125 = load i32, ptr %5, align 4, !tbaa !9
  %126 = sext i32 %125 to i64
  %127 = getelementptr inbounds ptr, ptr %124, i64 %126
  %128 = load ptr, ptr %127, align 8, !tbaa !5
  %129 = getelementptr inbounds i32, ptr %128, i64 0
  %130 = load i32, ptr %129, align 4, !tbaa !9
  %131 = sub i32 %130, 1
  %132 = zext i32 %131 to i64
  %133 = getelementptr inbounds i32, ptr %122, i64 %132
  store i32 0, ptr %133, align 4, !tbaa !9
  %134 = getelementptr inbounds %"class.SoLoud::Soloud", ptr %9, i32 0, i32 45
  %135 = load ptr, ptr %134, align 8, !tbaa !11
  %136 = load i32, ptr %5, align 4, !tbaa !9
  %137 = sext i32 %136 to i64
  %138 = getelementptr inbounds ptr, ptr %135, i64 %137
  %139 = load ptr, ptr %138, align 8, !tbaa !5
  %140 = load i32, ptr %7, align 4, !tbaa !9
  %141 = zext i32 %140 to i64
  %142 = getelementptr inbounds i32, ptr %139, i64 %141
  %143 = load i32, ptr %142, align 4, !tbaa !9
  %144 = icmp eq i32 %143, 0
  br i1 %144, label %145, label %146

145:                                              ; preds = %116
  call void @_ZN6SoLoud6Soloud25unlockAudioMutex_internalEv(ptr noundef nonnull align 8 dereferenceable(138833) %9)
  store i32 1, ptr %6, align 4
  br label %147

146:                                              ; preds = %116
  call void @_ZN6SoLoud6Soloud25unlockAudioMutex_internalEv(ptr noundef nonnull align 8 dereferenceable(138833) %9)
  store i32 0, ptr %6, align 4
  br label %147

147:                                              ; preds = %146, %145
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #3
  %148 = load i32, ptr %6, align 4
  switch i32 %148, label %155 [
    i32 0, label %149
  ]

149:                                              ; preds = %147
  br label %52, !llvm.loop !20

150:                                              ; preds = %52
  call void @_ZN6SoLoud6Soloud23lockAudioMutex_internalEv(ptr noundef nonnull align 8 dereferenceable(138833) %9)
  br label %151

151:                                              ; preds = %150
  %152 = load i32, ptr %7, align 4, !tbaa !9
  %153 = add i32 %152, 1
  store i32 %153, ptr %7, align 4, !tbaa !9
  br label %27, !llvm.loop !21

154:                                              ; preds = %27
  call void @_ZN6SoLoud6Soloud25unlockAudioMutex_internalEv(ptr noundef nonnull align 8 dereferenceable(138833) %9)
  store i32 0, ptr %6, align 4
  br label %155

155:                                              ; preds = %154, %147, %50
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #3
  br label %156

156:                                              ; preds = %155, %25
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #3
  %157 = load i32, ptr %6, align 4
  switch i32 %157, label %159 [
    i32 0, label %158
    i32 1, label %158
  ]

158:                                              ; preds = %156, %156, %12
  ret void

159:                                              ; preds = %156
  unreachable
}

attributes #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 = { 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 = { 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 134720}
!12 = !{!"_ZTSN6SoLoud6SoloudE", !6, i64 0, !6, i64 8, !13, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !10, i64 48, !10, i64 52, !14, i64 56, !10, i64 80, !14, i64 88, !6, i64 112, !14, i64 120, !6, i64 144, !7, i64 152, !10, i64 8344, !10, i64 8348, !10, i64 8352, !10, i64 8356, !6, i64 8360, !10, i64 8368, !10, i64 8372, !15, i64 8376, !15, i64 8380, !10, i64 8384, !10, i64 8388, !16, i64 8392, !17, i64 8440, !17, i64 8448, !7, i64 8456, !7, i64 8520, !7, i64 8584, !7, i64 8616, !7, i64 9640, !7, i64 10664, !7, i64 11688, !7, i64 11700, !7, i64 11712, !7, i64 11724, !15, i64 11736, !7, i64 11740, !7, i64 11840, !6, i64 134720, !10, i64 134728, !7, i64 134732, !10, i64 138828, !13, i64 138832}
!13 = !{!"bool", !7, i64 0}
!14 = !{!"_ZTSN6SoLoud18AlignedFloatBufferE", !6, i64 0, !6, i64 8, !10, i64 16}
!15 = !{!"float", !7, i64 0}
!16 = !{!"_ZTSN6SoLoud5FaderE", !15, i64 0, !15, i64 4, !15, i64 8, !17, i64 16, !17, i64 24, !17, i64 32, !15, i64 40, !10, i64 44}
!17 = !{!"double", !7, i64 0}
!18 = distinct !{!18, !19}
!19 = !{!"llvm.loop.mustprogress"}
!20 = distinct !{!20, !19}
!21 = distinct !{!21, !19}


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

declare void @_ZN6SoLoud6Soloud23lockAudioMutex_internalEv(ptr noundef nonnull align 8 dereferenceable(138833)) local_unnamed_addr #0

declare void @_ZN6SoLoud6Soloud25unlockAudioMutex_internalEv(ptr noundef nonnull align 8 dereferenceable(138833)) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN6SoLoud6Soloud12isVoiceGroupEj(ptr noundef nonnull align 8 dereferenceable(138833), i32 noundef) local_unnamed_addr #1 align 2

declare noundef zeroext i1 @_ZN6SoLoud6Soloud18isValidVoiceHandleEj(ptr noundef nonnull align 8 dereferenceable(138833), i32 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN6SoLoud6Soloud23trimVoiceGroup_internalEj(ptr noundef nonnull align 8 dereferenceable(138833) %0, i32 noundef %1) local_unnamed_addr #1 align 2 {
  %3 = tail call noundef zeroext i1 @_ZN6SoLoud6Soloud12isVoiceGroupEj(ptr noundef nonnull align 8 dereferenceable(138833) %0, i32 noundef %1)
  br i1 %3, label %4, label %.thread

4:                                                ; preds = %2
  %5 = and i32 %1, 4095
  tail call void @_ZN6SoLoud6Soloud23lockAudioMutex_internalEv(ptr noundef nonnull align 8 dereferenceable(138833) %0)
  %6 = getelementptr inbounds i8, ptr %0, i64 134720
  %7 = load ptr, ptr %6, align 8, !tbaa !5
  %8 = zext nneg i32 %5 to i64
  %9 = getelementptr inbounds ptr, ptr %7, i64 %8
  %10 = load ptr, ptr %9, align 8, !tbaa !16
  %11 = getelementptr inbounds i8, ptr %10, i64 4
  %12 = load i32, ptr %11, align 4, !tbaa !17
  %13 = icmp eq i32 %12, 0
  br i1 %13, label %.thread.sink.split, label %.preheader

.preheader:                                       ; preds = %4
  %14 = load i32, ptr %10, align 4, !tbaa !17
  %15 = icmp ugt i32 %14, 1
  br i1 %15, label %.lr.ph28, label %.thread.sink.split

.lr.ph28:                                         ; preds = %.preheader, %._crit_edge
  %16 = phi ptr [ %54, %._crit_edge ], [ %10, %.preheader ]
  %.02527 = phi i32 [ %51, %._crit_edge ], [ 1, %.preheader ]
  %17 = zext i32 %.02527 to i64
  %18 = getelementptr inbounds i32, ptr %16, i64 %17
  %19 = load i32, ptr %18, align 4, !tbaa !17
  %20 = icmp eq i32 %19, 0
  tail call void @_ZN6SoLoud6Soloud25unlockAudioMutex_internalEv(ptr noundef nonnull align 8 dereferenceable(138833) %0)
  br i1 %20, label %.thread, label %21

21:                                               ; preds = %.lr.ph28
  %22 = load ptr, ptr %6, align 8, !tbaa !5
  %23 = getelementptr inbounds ptr, ptr %22, i64 %8
  %24 = load ptr, ptr %23, align 8, !tbaa !16
  %25 = getelementptr inbounds i32, ptr %24, i64 %17
  %26 = load i32, ptr %25, align 4, !tbaa !17
  %27 = tail call noundef zeroext i1 @_ZN6SoLoud6Soloud18isValidVoiceHandleEj(ptr noundef nonnull align 8 dereferenceable(138833) %0, i32 noundef %26)
  br i1 %27, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %21, %44
  tail call void @_ZN6SoLoud6Soloud23lockAudioMutex_internalEv(ptr noundef nonnull align 8 dereferenceable(138833) %0)
  %28 = load ptr, ptr %6, align 8, !tbaa !5
  %29 = getelementptr inbounds ptr, ptr %28, i64 %8
  %30 = load ptr, ptr %29, align 8, !tbaa !16
  br label %31

31:                                               ; preds = %36, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %36 ], [ %17, %.lr.ph ]
  %32 = load i32, ptr %30, align 4, !tbaa !17
  %33 = add i32 %32, -1
  %34 = zext i32 %33 to i64
  %35 = icmp ult i64 %indvars.iv, %34
  br i1 %35, label %36, label %split

36:                                               ; preds = %31
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %37 = getelementptr inbounds i32, ptr %30, i64 %indvars.iv.next
  %38 = load i32, ptr %37, align 4, !tbaa !17
  %39 = getelementptr inbounds i32, ptr %30, i64 %indvars.iv
  store i32 %38, ptr %39, align 4, !tbaa !17
  %40 = icmp eq i32 %38, 0
  br i1 %40, label %._crit_edge31, label %31, !llvm.loop !18

._crit_edge31:                                    ; preds = %36
  %.pre = load i32, ptr %30, align 4, !tbaa !17
  %.pre32 = add i32 %.pre, -1
  %.pre33 = zext i32 %.pre32 to i64
  br label %split

split:                                            ; preds = %31, %._crit_edge31
  %.pre-phi34 = phi i64 [ %.pre33, %._crit_edge31 ], [ %34, %31 ]
  %41 = getelementptr inbounds i32, ptr %30, i64 %.pre-phi34
  store i32 0, ptr %41, align 4, !tbaa !17
  %42 = getelementptr inbounds i32, ptr %30, i64 %17
  %43 = load i32, ptr %42, align 4, !tbaa !17
  %.not = icmp eq i32 %43, 0
  tail call void @_ZN6SoLoud6Soloud25unlockAudioMutex_internalEv(ptr noundef nonnull align 8 dereferenceable(138833) %0)
  br i1 %.not, label %.thread, label %44

44:                                               ; preds = %split
  %45 = load ptr, ptr %6, align 8, !tbaa !5
  %46 = getelementptr inbounds ptr, ptr %45, i64 %8
  %47 = load ptr, ptr %46, align 8, !tbaa !16
  %48 = getelementptr inbounds i32, ptr %47, i64 %17
  %49 = load i32, ptr %48, align 4, !tbaa !17
  %50 = tail call noundef zeroext i1 @_ZN6SoLoud6Soloud18isValidVoiceHandleEj(ptr noundef nonnull align 8 dereferenceable(138833) %0, i32 noundef %49)
  br i1 %50, label %._crit_edge, label %.lr.ph, !llvm.loop !20

._crit_edge:                                      ; preds = %44, %21
  tail call void @_ZN6SoLoud6Soloud23lockAudioMutex_internalEv(ptr noundef nonnull align 8 dereferenceable(138833) %0)
  %51 = add nuw i32 %.02527, 1
  %52 = load ptr, ptr %6, align 8, !tbaa !5
  %53 = getelementptr inbounds ptr, ptr %52, i64 %8
  %54 = load ptr, ptr %53, align 8, !tbaa !16
  %55 = load i32, ptr %54, align 4, !tbaa !17
  %56 = icmp ult i32 %51, %55
  br i1 %56, label %.lr.ph28, label %.thread.sink.split, !llvm.loop !21

.thread.sink.split:                               ; preds = %._crit_edge, %.preheader, %4
  tail call void @_ZN6SoLoud6Soloud25unlockAudioMutex_internalEv(ptr noundef nonnull align 8 dereferenceable(138833) %0)
  br label %.thread

.thread:                                          ; preds = %.lr.ph28, %split, %.thread.sink.split, %2
  ret void
}

attributes #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 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" }

!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 134720}
!6 = !{!"_ZTSN6SoLoud6SoloudE", !7, i64 0, !7, i64 8, !10, i64 16, !7, i64 24, !7, i64 32, !7, i64 40, !11, i64 48, !11, i64 52, !12, i64 56, !11, i64 80, !12, i64 88, !7, i64 112, !12, i64 120, !7, i64 144, !8, i64 152, !11, i64 8344, !11, i64 8348, !11, i64 8352, !11, i64 8356, !7, i64 8360, !11, i64 8368, !11, i64 8372, !13, i64 8376, !13, i64 8380, !11, i64 8384, !11, i64 8388, !14, i64 8392, !15, i64 8440, !15, i64 8448, !8, i64 8456, !8, i64 8520, !8, i64 8584, !8, i64 8616, !8, i64 9640, !8, i64 10664, !8, i64 11688, !8, i64 11700, !8, i64 11712, !8, i64 11724, !13, i64 11736, !8, i64 11740, !8, i64 11840, !7, i64 134720, !11, i64 134728, !8, i64 134732, !11, i64 138828, !10, i64 138832}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"bool", !8, i64 0}
!11 = !{!"int", !8, i64 0}
!12 = !{!"_ZTSN6SoLoud18AlignedFloatBufferE", !7, i64 0, !7, i64 8, !11, i64 16}
!13 = !{!"float", !8, i64 0}
!14 = !{!"_ZTSN6SoLoud5FaderE", !13, i64 0, !13, i64 4, !13, i64 8, !15, i64 16, !15, i64 24, !15, i64 32, !13, i64 40, !11, i64 44}
!15 = !{!"double", !8, i64 0}
!16 = !{!7, !7, i64 0}
!17 = !{!11, !11, i64 0}
!18 = distinct !{!18, !19}
!19 = !{!"llvm.loop.mustprogress"}
!20 = distinct !{!20, !19}
!21 = distinct !{!21, !19}


; Effective O3 passes: BDCEPass,CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopInstSimplifyPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass,TailCallElimPass