; 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

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

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

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

; Function Attrs: nobuiltin nounwind
declare void @_ZdaPv(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: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN6SoLoud6Soloud12isVoiceGroupEj(ptr noundef nonnull align 8 dereferenceable(138833), i32 noundef) #5 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN6SoLoud6Soloud15addVoiceToGroupEjj(ptr noundef nonnull align 8 dereferenceable(138833) %0, i32 noundef %1, i32 noundef %2) #5 align 2 {
  %4 = alloca i32, align 4
  %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 ptr, align 8
  store ptr %0, ptr %5, align 8, !tbaa !5
  store i32 %1, ptr %6, align 4, !tbaa !9
  store i32 %2, ptr %7, align 4, !tbaa !9
  %12 = load ptr, ptr %5, align 8
  %13 = load i32, ptr %6, align 4, !tbaa !9
  %14 = call noundef zeroext i1 @_ZN6SoLoud6Soloud12isVoiceGroupEj(ptr noundef nonnull align 8 dereferenceable(138833) %12, i32 noundef %13)
  br i1 %14, label %16, label %15

15:                                               ; preds = %3
  store i32 1, ptr %4, align 4
  br label %172

16:                                               ; preds = %3
  %17 = load i32, ptr %7, align 4, !tbaa !9
  %18 = call noundef zeroext i1 @_ZN6SoLoud6Soloud18isValidVoiceHandleEj(ptr noundef nonnull align 8 dereferenceable(138833) %12, i32 noundef %17)
  br i1 %18, label %20, label %19

19:                                               ; preds = %16
  store i32 0, ptr %4, align 4
  br label %172

20:                                               ; preds = %16
  %21 = load i32, ptr %6, align 4, !tbaa !9
  call void @_ZN6SoLoud6Soloud23trimVoiceGroup_internalEj(ptr noundef nonnull align 8 dereferenceable(138833) %12, i32 noundef %21)
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  %22 = load i32, ptr %6, align 4, !tbaa !9
  %23 = and i32 %22, 4095
  store i32 %23, ptr %8, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  call void @_ZN6SoLoud6Soloud23lockAudioMutex_internalEv(ptr noundef nonnull align 8 dereferenceable(138833) %12)
  store i32 1, ptr %9, align 4, !tbaa !9
  br label %24

24:                                               ; preds = %83, %20
  %25 = load i32, ptr %9, align 4, !tbaa !9
  %26 = getelementptr inbounds %"class.SoLoud::Soloud", ptr %12, i32 0, i32 45
  %27 = load ptr, ptr %26, align 8, !tbaa !11
  %28 = load i32, ptr %8, align 4, !tbaa !9
  %29 = sext i32 %28 to i64
  %30 = getelementptr inbounds ptr, ptr %27, i64 %29
  %31 = load ptr, ptr %30, align 8, !tbaa !5
  %32 = getelementptr inbounds i32, ptr %31, i64 0
  %33 = load i32, ptr %32, align 4, !tbaa !9
  %34 = icmp ult i32 %25, %33
  br i1 %34, label %35, label %86

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

48:                                               ; preds = %35
  call void @_ZN6SoLoud6Soloud25unlockAudioMutex_internalEv(ptr noundef nonnull align 8 dereferenceable(138833) %12)
  store i32 0, ptr %4, align 4
  store i32 1, ptr %10, align 4
  br label %171

49:                                               ; preds = %35
  %50 = getelementptr inbounds %"class.SoLoud::Soloud", ptr %12, i32 0, i32 45
  %51 = load ptr, ptr %50, align 8, !tbaa !11
  %52 = load i32, ptr %8, align 4, !tbaa !9
  %53 = sext i32 %52 to i64
  %54 = getelementptr inbounds ptr, ptr %51, i64 %53
  %55 = load ptr, ptr %54, align 8, !tbaa !5
  %56 = load i32, ptr %9, align 4, !tbaa !9
  %57 = zext i32 %56 to i64
  %58 = getelementptr inbounds i32, ptr %55, i64 %57
  %59 = load i32, ptr %58, align 4, !tbaa !9
  %60 = icmp eq i32 %59, 0
  br i1 %60, label %61, label %82

61:                                               ; preds = %49
  %62 = load i32, ptr %7, align 4, !tbaa !9
  %63 = getelementptr inbounds %"class.SoLoud::Soloud", ptr %12, i32 0, i32 45
  %64 = load ptr, ptr %63, align 8, !tbaa !11
  %65 = load i32, ptr %8, align 4, !tbaa !9
  %66 = sext i32 %65 to i64
  %67 = getelementptr inbounds ptr, ptr %64, i64 %66
  %68 = load ptr, ptr %67, align 8, !tbaa !5
  %69 = load i32, ptr %9, align 4, !tbaa !9
  %70 = zext i32 %69 to i64
  %71 = getelementptr inbounds i32, ptr %68, i64 %70
  store i32 %62, ptr %71, align 4, !tbaa !9
  %72 = getelementptr inbounds %"class.SoLoud::Soloud", ptr %12, i32 0, i32 45
  %73 = load ptr, ptr %72, align 8, !tbaa !11
  %74 = load i32, ptr %8, align 4, !tbaa !9
  %75 = sext i32 %74 to i64
  %76 = getelementptr inbounds ptr, ptr %73, i64 %75
  %77 = load ptr, ptr %76, align 8, !tbaa !5
  %78 = load i32, ptr %9, align 4, !tbaa !9
  %79 = add i32 %78, 1
  %80 = zext i32 %79 to i64
  %81 = getelementptr inbounds i32, ptr %77, i64 %80
  store i32 0, ptr %81, align 4, !tbaa !9
  call void @_ZN6SoLoud6Soloud25unlockAudioMutex_internalEv(ptr noundef nonnull align 8 dereferenceable(138833) %12)
  store i32 0, ptr %4, align 4
  store i32 1, ptr %10, align 4
  br label %171

82:                                               ; preds = %49
  br label %83

83:                                               ; preds = %82
  %84 = load i32, ptr %9, align 4, !tbaa !9
  %85 = add i32 %84, 1
  store i32 %85, ptr %9, align 4, !tbaa !9
  br label %24, !llvm.loop !18

86:                                               ; preds = %24
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  %87 = getelementptr inbounds %"class.SoLoud::Soloud", ptr %12, i32 0, i32 45
  %88 = load ptr, ptr %87, align 8, !tbaa !11
  %89 = load i32, ptr %8, align 4, !tbaa !9
  %90 = sext i32 %89 to i64
  %91 = getelementptr inbounds ptr, ptr %88, i64 %90
  %92 = load ptr, ptr %91, align 8, !tbaa !5
  %93 = getelementptr inbounds i32, ptr %92, i64 0
  %94 = load i32, ptr %93, align 4, !tbaa !9
  %95 = mul i32 %94, 2
  %96 = add i32 %95, 1
  %97 = zext i32 %96 to i64
  %98 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %97, i64 4)
  %99 = extractvalue { i64, i1 } %98, 1
  %100 = extractvalue { i64, i1 } %98, 0
  %101 = select i1 %99, i64 -1, i64 %100
  %102 = call noalias noundef nonnull ptr @_Znam(i64 noundef %101) #7
  store ptr %102, ptr %11, align 8, !tbaa !5
  %103 = load ptr, ptr %11, align 8, !tbaa !5
  %104 = icmp eq ptr %103, null
  br i1 %104, label %105, label %106

105:                                              ; preds = %86
  call void @_ZN6SoLoud6Soloud25unlockAudioMutex_internalEv(ptr noundef nonnull align 8 dereferenceable(138833) %12)
  store i32 5, ptr %4, align 4
  store i32 1, ptr %10, align 4
  br label %170

106:                                              ; preds = %86
  store i32 0, ptr %9, align 4, !tbaa !9
  br label %107

107:                                              ; preds = %133, %106
  %108 = load i32, ptr %9, align 4, !tbaa !9
  %109 = getelementptr inbounds %"class.SoLoud::Soloud", ptr %12, i32 0, i32 45
  %110 = load ptr, ptr %109, align 8, !tbaa !11
  %111 = load i32, ptr %8, align 4, !tbaa !9
  %112 = sext i32 %111 to i64
  %113 = getelementptr inbounds ptr, ptr %110, i64 %112
  %114 = load ptr, ptr %113, align 8, !tbaa !5
  %115 = getelementptr inbounds i32, ptr %114, i64 0
  %116 = load i32, ptr %115, align 4, !tbaa !9
  %117 = icmp ult i32 %108, %116
  br i1 %117, label %118, label %136

118:                                              ; preds = %107
  %119 = getelementptr inbounds %"class.SoLoud::Soloud", ptr %12, i32 0, i32 45
  %120 = load ptr, ptr %119, align 8, !tbaa !11
  %121 = load i32, ptr %8, align 4, !tbaa !9
  %122 = sext i32 %121 to i64
  %123 = getelementptr inbounds ptr, ptr %120, i64 %122
  %124 = load ptr, ptr %123, align 8, !tbaa !5
  %125 = load i32, ptr %9, align 4, !tbaa !9
  %126 = zext i32 %125 to i64
  %127 = getelementptr inbounds i32, ptr %124, i64 %126
  %128 = load i32, ptr %127, align 4, !tbaa !9
  %129 = load ptr, ptr %11, align 8, !tbaa !5
  %130 = load i32, ptr %9, align 4, !tbaa !9
  %131 = zext i32 %130 to i64
  %132 = getelementptr inbounds i32, ptr %129, i64 %131
  store i32 %128, ptr %132, align 4, !tbaa !9
  br label %133

133:                                              ; preds = %118
  %134 = load i32, ptr %9, align 4, !tbaa !9
  %135 = add i32 %134, 1
  store i32 %135, ptr %9, align 4, !tbaa !9
  br label %107, !llvm.loop !20

136:                                              ; preds = %107
  %137 = load i32, ptr %7, align 4, !tbaa !9
  %138 = load ptr, ptr %11, align 8, !tbaa !5
  %139 = load ptr, ptr %11, align 8, !tbaa !5
  %140 = getelementptr inbounds i32, ptr %139, i64 0
  %141 = load i32, ptr %140, align 4, !tbaa !9
  %142 = zext i32 %141 to i64
  %143 = getelementptr inbounds i32, ptr %138, i64 %142
  store i32 %137, ptr %143, align 4, !tbaa !9
  %144 = load ptr, ptr %11, align 8, !tbaa !5
  %145 = load ptr, ptr %11, align 8, !tbaa !5
  %146 = getelementptr inbounds i32, ptr %145, i64 0
  %147 = load i32, ptr %146, align 4, !tbaa !9
  %148 = add i32 %147, 1
  %149 = zext i32 %148 to i64
  %150 = getelementptr inbounds i32, ptr %144, i64 %149
  store i32 0, ptr %150, align 4, !tbaa !9
  %151 = load ptr, ptr %11, align 8, !tbaa !5
  %152 = getelementptr inbounds i32, ptr %151, i64 0
  %153 = load i32, ptr %152, align 4, !tbaa !9
  %154 = mul i32 %153, 2
  store i32 %154, ptr %152, align 4, !tbaa !9
  %155 = getelementptr inbounds %"class.SoLoud::Soloud", ptr %12, i32 0, i32 45
  %156 = load ptr, ptr %155, align 8, !tbaa !11
  %157 = load i32, ptr %8, align 4, !tbaa !9
  %158 = sext i32 %157 to i64
  %159 = getelementptr inbounds ptr, ptr %156, i64 %158
  %160 = load ptr, ptr %159, align 8, !tbaa !5
  %161 = icmp eq ptr %160, null
  br i1 %161, label %163, label %162

162:                                              ; preds = %136
  call void @_ZdaPv(ptr noundef %160) #8
  br label %163

163:                                              ; preds = %162, %136
  %164 = load ptr, ptr %11, align 8, !tbaa !5
  %165 = getelementptr inbounds %"class.SoLoud::Soloud", ptr %12, i32 0, i32 45
  %166 = load ptr, ptr %165, align 8, !tbaa !11
  %167 = load i32, ptr %8, align 4, !tbaa !9
  %168 = sext i32 %167 to i64
  %169 = getelementptr inbounds ptr, ptr %166, i64 %168
  store ptr %164, ptr %169, align 8, !tbaa !5
  call void @_ZN6SoLoud6Soloud25unlockAudioMutex_internalEv(ptr noundef nonnull align 8 dereferenceable(138833) %12)
  store i32 0, ptr %4, align 4
  store i32 1, ptr %10, align 4
  br label %170

170:                                              ; preds = %163, %105
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  br label %171

171:                                              ; preds = %170, %61, %48
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  br label %172

172:                                              ; preds = %171, %19, %15
  %173 = load i32, ptr %4, align 4
  ret i32 %173
}

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6SoLoud6Soloud23trimVoiceGroup_internalEj(ptr noundef nonnull align 8 dereferenceable(138833), i32 noundef) #5 align 2

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 = { 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 #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { 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 #5 = { 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 #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 = !{!"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}


; 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

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

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

; Function Attrs: nobuiltin nounwind
declare void @_ZdaPv(ptr noundef) local_unnamed_addr #2

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

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

5:                                                ; preds = %3
  %6 = tail call noundef zeroext i1 @_ZN6SoLoud6Soloud18isValidVoiceHandleEj(ptr noundef nonnull align 8 dereferenceable(138833) %0, i32 noundef %2)
  br i1 %6, label %7, label %56

7:                                                ; preds = %5
  tail call void @_ZN6SoLoud6Soloud23trimVoiceGroup_internalEj(ptr noundef nonnull align 8 dereferenceable(138833) %0, i32 noundef %1)
  %8 = and i32 %1, 4095
  tail call void @_ZN6SoLoud6Soloud23lockAudioMutex_internalEv(ptr noundef nonnull align 8 dereferenceable(138833) %0)
  %9 = getelementptr inbounds i8, ptr %0, i64 134720
  %10 = load ptr, ptr %9, align 8, !tbaa !5
  %11 = zext nneg i32 %8 to i64
  %12 = getelementptr inbounds ptr, ptr %10, i64 %11
  %13 = load ptr, ptr %12, align 8, !tbaa !16
  %14 = ptrtoint ptr %13 to i64
  %15 = load i32, ptr %13, align 4, !tbaa !17
  %16 = icmp ugt i32 %15, 1
  br i1 %16, label %.lr.ph.preheader, label %._crit_edge

.lr.ph.preheader:                                 ; preds = %7
  %wide.trip.count = zext i32 %15 to i64
  br label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph.preheader, %27
  %indvars.iv = phi i64 [ 1, %.lr.ph.preheader ], [ %indvars.iv.next, %27 ]
  %17 = getelementptr inbounds i32, ptr %13, i64 %indvars.iv
  %18 = load i32, ptr %17, align 4, !tbaa !17
  %19 = icmp eq i32 %18, %2
  br i1 %19, label %.sink.split, label %20

20:                                               ; preds = %.lr.ph
  %21 = icmp eq i32 %18, 0
  br i1 %21, label %22, label %27

22:                                               ; preds = %20
  %23 = getelementptr inbounds i32, ptr %13, i64 %indvars.iv
  store i32 %2, ptr %23, align 4, !tbaa !17
  %24 = add nuw i64 %indvars.iv, 1
  %25 = and i64 %24, 4294967295
  %26 = getelementptr inbounds i32, ptr %13, i64 %25
  store i32 0, ptr %26, align 4, !tbaa !17
  br label %.sink.split

27:                                               ; preds = %20
  %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 !18

._crit_edge:                                      ; preds = %27, %7
  %28 = shl i32 %15, 1
  %29 = or disjoint i32 %28, 1
  %30 = zext i32 %29 to i64
  %31 = shl nuw nsw i64 %30, 2
  %32 = tail call noalias noundef nonnull ptr @_Znam(i64 noundef %31) #4
  %.not = icmp eq i32 %15, 0
  br i1 %.not, label %._crit_edge72, label %.lr.ph71.preheader

.lr.ph71.preheader:                               ; preds = %._crit_edge
  %33 = ptrtoint ptr %32 to i64
  %34 = zext i32 %15 to i64
  %min.iters.check = icmp ult i32 %15, 8
  %35 = sub i64 %33, %14
  %diff.check = icmp ult i64 %35, 32
  %or.cond = or i1 %min.iters.check, %diff.check
  br i1 %or.cond, label %.lr.ph71.preheader89, label %vector.ph

vector.ph:                                        ; preds = %.lr.ph71.preheader
  %n.vec = and i64 %34, 4294967288
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %36 = getelementptr inbounds i32, ptr %13, i64 %index
  %37 = getelementptr inbounds i8, ptr %36, i64 16
  %wide.load = load <4 x i32>, ptr %36, align 4, !tbaa !17
  %wide.load88 = load <4 x i32>, ptr %37, align 4, !tbaa !17
  %38 = getelementptr inbounds i32, ptr %32, i64 %index
  %39 = getelementptr inbounds i8, ptr %38, i64 16
  store <4 x i32> %wide.load, ptr %38, align 4, !tbaa !17
  store <4 x i32> %wide.load88, ptr %39, align 4, !tbaa !17
  %index.next = add nuw i64 %index, 8
  %40 = icmp eq i64 %index.next, %n.vec
  br i1 %40, label %middle.block, label %vector.body, !llvm.loop !20

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %n.vec, %34
  br i1 %cmp.n, label %._crit_edge72.loopexit, label %.lr.ph71.preheader89

.lr.ph71.preheader89:                             ; preds = %middle.block, %.lr.ph71.preheader
  %indvars.iv79.ph = phi i64 [ 0, %.lr.ph71.preheader ], [ %n.vec, %middle.block ]
  br label %.lr.ph71

.lr.ph71:                                         ; preds = %.lr.ph71.preheader89, %.lr.ph71
  %indvars.iv79 = phi i64 [ %indvars.iv.next80, %.lr.ph71 ], [ %indvars.iv79.ph, %.lr.ph71.preheader89 ]
  %41 = getelementptr inbounds i32, ptr %13, i64 %indvars.iv79
  %42 = load i32, ptr %41, align 4, !tbaa !17
  %43 = getelementptr inbounds i32, ptr %32, i64 %indvars.iv79
  store i32 %42, ptr %43, align 4, !tbaa !17
  %indvars.iv.next80 = add nuw nsw i64 %indvars.iv79, 1
  %44 = icmp ult i64 %indvars.iv.next80, %34
  br i1 %44, label %.lr.ph71, label %._crit_edge72.loopexit, !llvm.loop !23

._crit_edge72.loopexit:                           ; preds = %.lr.ph71, %middle.block
  %.pre = load i32, ptr %32, align 4, !tbaa !17
  %45 = zext i32 %.pre to i64
  br label %._crit_edge72

._crit_edge72:                                    ; preds = %._crit_edge72.loopexit, %._crit_edge
  %46 = phi i64 [ %45, %._crit_edge72.loopexit ], [ 0, %._crit_edge ]
  %47 = getelementptr inbounds i32, ptr %32, i64 %46
  store i32 %2, ptr %47, align 4, !tbaa !17
  %48 = load i32, ptr %32, align 4, !tbaa !17
  %49 = add i32 %48, 1
  %50 = zext i32 %49 to i64
  %51 = getelementptr inbounds i32, ptr %32, i64 %50
  store i32 0, ptr %51, align 4, !tbaa !17
  %52 = load i32, ptr %32, align 4, !tbaa !17
  %53 = shl i32 %52, 1
  store i32 %53, ptr %32, align 4, !tbaa !17
  tail call void @_ZdaPv(ptr noundef nonnull %13) #5
  %54 = load ptr, ptr %9, align 8, !tbaa !5
  %55 = getelementptr inbounds ptr, ptr %54, i64 %11
  store ptr %32, ptr %55, align 8, !tbaa !16
  br label %.sink.split

.sink.split:                                      ; preds = %.lr.ph, %._crit_edge72, %22
  tail call void @_ZN6SoLoud6Soloud25unlockAudioMutex_internalEv(ptr noundef nonnull align 8 dereferenceable(138833) %0)
  br label %56

56:                                               ; preds = %.sink.split, %5, %3
  %.2 = phi i32 [ 1, %3 ], [ 0, %5 ], [ 0, %.sink.split ]
  ret i32 %.2
}

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6SoLoud6Soloud23trimVoiceGroup_internalEj(ptr noundef nonnull align 8 dereferenceable(138833), i32 noundef) local_unnamed_addr #3 align 2

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 = { 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 #2 = { 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 #3 = { 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 #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, !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, !22}
!21 = !{!"llvm.loop.isvectorized", i32 1}
!22 = !{!"llvm.loop.unroll.runtime.disable"}
!23 = distinct !{!23, !19, !21}


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