; LLVM IR from Overload-Technologies/Overload :: Dependencies/soloud/src/core/soloud_core_3d.ll (ZN6SoLoud6Soloud13update3dAudioEv)

; 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] }>
%"class.SoLoud::AudioSourceInstance" = type { ptr, i32, i32, i32, float, [8 x float], float, float, float, float, i32, float, float, double, double, %"class.SoLoud::Fader", %"class.SoLoud::Fader", %"class.SoLoud::Fader", %"class.SoLoud::Fader", %"class.SoLoud::Fader", i32, [8 x float], i32, i32, [8 x ptr], [2 x ptr], i32, i32, 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: mustprogress uwtable
declare dso_local void @_ZN6SoLoud6Soloud23update3dVoices_internalEPjj(ptr noundef nonnull align 8 dereferenceable(138833), ptr noundef, i32 noundef) #1 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN6SoLoud6Soloud13update3dAudioEv(ptr noundef nonnull align 8 dereferenceable(138833) %0) #2 align 2 {
  %2 = alloca ptr, align 8
  %3 = alloca i32, align 4
  %4 = alloca [1024 x i32], align 16
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  %9 = load ptr, ptr %2, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #4
  store i32 0, ptr %3, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4096, ptr %4) #4
  call void @_ZN6SoLoud6Soloud23lockAudioMutex_internalEv(ptr noundef nonnull align 8 dereferenceable(138833) %9)
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #4
  store i32 0, ptr %5, align 4, !tbaa !9
  br label %10

10:                                               ; preds = %52, %1
  %11 = load i32, ptr %5, align 4, !tbaa !9
  %12 = getelementptr inbounds %"class.SoLoud::Soloud", ptr %9, i32 0, i32 8
  %13 = load i32, ptr %12, align 4, !tbaa !11
  %14 = icmp slt i32 %11, %13
  br i1 %14, label %15, label %55

15:                                               ; preds = %10
  %16 = getelementptr inbounds %"class.SoLoud::Soloud", ptr %9, i32 0, i32 16
  %17 = load i32, ptr %5, align 4, !tbaa !9
  %18 = sext i32 %17 to i64
  %19 = getelementptr inbounds [1024 x ptr], ptr %16, i64 0, i64 %18
  %20 = load ptr, ptr %19, align 8, !tbaa !5
  %21 = icmp ne ptr %20, null
  br i1 %21, label %22, label %51

22:                                               ; preds = %15
  %23 = getelementptr inbounds %"class.SoLoud::Soloud", ptr %9, i32 0, i32 16
  %24 = load i32, ptr %5, align 4, !tbaa !9
  %25 = sext i32 %24 to i64
  %26 = getelementptr inbounds [1024 x ptr], ptr %23, i64 0, i64 %25
  %27 = load ptr, ptr %26, align 8, !tbaa !5
  %28 = getelementptr inbounds %"class.SoLoud::AudioSourceInstance", ptr %27, i32 0, i32 3
  %29 = load i32, ptr %28, align 8, !tbaa !18
  %30 = and i32 %29, 8
  %31 = icmp ne i32 %30, 0
  br i1 %31, label %32, label %51

32:                                               ; preds = %22
  %33 = load i32, ptr %5, align 4, !tbaa !9
  %34 = load i32, ptr %3, align 4, !tbaa !9
  %35 = zext i32 %34 to i64
  %36 = getelementptr inbounds [1024 x i32], ptr %4, i64 0, i64 %35
  store i32 %33, ptr %36, align 4, !tbaa !9
  %37 = load i32, ptr %3, align 4, !tbaa !9
  %38 = add i32 %37, 1
  store i32 %38, ptr %3, align 4, !tbaa !9
  %39 = getelementptr inbounds %"class.SoLoud::Soloud", ptr %9, i32 0, i32 16
  %40 = load i32, ptr %5, align 4, !tbaa !9
  %41 = sext i32 %40 to i64
  %42 = getelementptr inbounds [1024 x ptr], ptr %39, i64 0, i64 %41
  %43 = load ptr, ptr %42, align 8, !tbaa !5
  %44 = getelementptr inbounds %"class.SoLoud::AudioSourceInstance", ptr %43, i32 0, i32 3
  %45 = load i32, ptr %44, align 8, !tbaa !18
  %46 = getelementptr inbounds %"class.SoLoud::Soloud", ptr %9, i32 0, i32 44
  %47 = load i32, ptr %5, align 4, !tbaa !9
  %48 = sext i32 %47 to i64
  %49 = getelementptr inbounds [1024 x %"class.SoLoud::AudioSourceInstance3dData"], ptr %46, i64 0, i64 %48
  %50 = getelementptr inbounds %"class.SoLoud::AudioSourceInstance3dData", ptr %49, i32 0, i32 14
  store i32 %45, ptr %50, align 4, !tbaa !20
  br label %51

51:                                               ; preds = %32, %22, %15
  br label %52

52:                                               ; preds = %51
  %53 = load i32, ptr %5, align 4, !tbaa !9
  %54 = add nsw i32 %53, 1
  store i32 %54, ptr %5, align 4, !tbaa !9
  br label %10, !llvm.loop !22

55:                                               ; preds = %10
  call void @_ZN6SoLoud6Soloud25unlockAudioMutex_internalEv(ptr noundef nonnull align 8 dereferenceable(138833) %9)
  %56 = getelementptr inbounds [1024 x i32], ptr %4, i64 0, i64 0
  %57 = load i32, ptr %3, align 4, !tbaa !9
  call void @_ZN6SoLoud6Soloud23update3dVoices_internalEPjj(ptr noundef nonnull align 8 dereferenceable(138833) %9, ptr noundef %56, i32 noundef %57)
  call void @_ZN6SoLoud6Soloud23lockAudioMutex_internalEv(ptr noundef nonnull align 8 dereferenceable(138833) %9)
  store i32 0, ptr %5, align 4, !tbaa !9
  br label %58

58:                                               ; preds = %135, %55
  %59 = load i32, ptr %5, align 4, !tbaa !9
  %60 = load i32, ptr %3, align 4, !tbaa !9
  %61 = icmp slt i32 %59, %60
  br i1 %61, label %62, label %138

62:                                               ; preds = %58
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #4
  %63 = getelementptr inbounds %"class.SoLoud::Soloud", ptr %9, i32 0, i32 44
  %64 = load i32, ptr %5, align 4, !tbaa !9
  %65 = sext i32 %64 to i64
  %66 = getelementptr inbounds [1024 x i32], ptr %4, i64 0, i64 %65
  %67 = load i32, ptr %66, align 4, !tbaa !9
  %68 = zext i32 %67 to i64
  %69 = getelementptr inbounds [1024 x %"class.SoLoud::AudioSourceInstance3dData"], ptr %63, i64 0, i64 %68
  store ptr %69, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #4
  %70 = getelementptr inbounds %"class.SoLoud::Soloud", ptr %9, i32 0, i32 16
  %71 = load i32, ptr %5, align 4, !tbaa !9
  %72 = sext i32 %71 to i64
  %73 = getelementptr inbounds [1024 x i32], ptr %4, i64 0, i64 %72
  %74 = load i32, ptr %73, align 4, !tbaa !9
  %75 = zext i32 %74 to i64
  %76 = getelementptr inbounds [1024 x ptr], ptr %70, i64 0, i64 %75
  %77 = load ptr, ptr %76, align 8, !tbaa !5
  store ptr %77, ptr %7, align 8, !tbaa !5
  %78 = load ptr, ptr %7, align 8, !tbaa !5
  %79 = icmp ne ptr %78, null
  br i1 %79, label %80, label %134

80:                                               ; preds = %62
  %81 = load i32, ptr %5, align 4, !tbaa !9
  %82 = sext i32 %81 to i64
  %83 = getelementptr inbounds [1024 x i32], ptr %4, i64 0, i64 %82
  %84 = load i32, ptr %83, align 4, !tbaa !9
  call void @_ZN6SoLoud6Soloud37updateVoiceRelativePlaySpeed_internalEj(ptr noundef nonnull align 8 dereferenceable(138833) %9, i32 noundef %84)
  %85 = load i32, ptr %5, align 4, !tbaa !9
  %86 = sext i32 %85 to i64
  %87 = getelementptr inbounds [1024 x i32], ptr %4, i64 0, i64 %86
  %88 = load i32, ptr %87, align 4, !tbaa !9
  call void @_ZN6SoLoud6Soloud26updateVoiceVolume_internalEj(ptr noundef nonnull align 8 dereferenceable(138833) %9, i32 noundef %88)
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #4
  store i32 0, ptr %8, align 4, !tbaa !9
  br label %89

89:                                               ; preds = %104, %80
  %90 = load i32, ptr %8, align 4, !tbaa !9
  %91 = icmp slt i32 %90, 8
  br i1 %91, label %92, label %107

92:                                               ; preds = %89
  %93 = load ptr, ptr %6, align 8, !tbaa !5
  %94 = getelementptr inbounds %"class.SoLoud::AudioSourceInstance3dData", ptr %93, i32 0, i32 13
  %95 = load i32, ptr %8, align 4, !tbaa !9
  %96 = sext i32 %95 to i64
  %97 = getelementptr inbounds [8 x float], ptr %94, i64 0, i64 %96
  %98 = load float, ptr %97, align 4, !tbaa !24
  %99 = load ptr, ptr %7, align 8, !tbaa !5
  %100 = getelementptr inbounds %"class.SoLoud::AudioSourceInstance", ptr %99, i32 0, i32 5
  %101 = load i32, ptr %8, align 4, !tbaa !9
  %102 = sext i32 %101 to i64
  %103 = getelementptr inbounds [8 x float], ptr %100, i64 0, i64 %102
  store float %98, ptr %103, align 4, !tbaa !24
  br label %104

104:                                              ; preds = %92
  %105 = load i32, ptr %8, align 4, !tbaa !9
  %106 = add nsw i32 %105, 1
  store i32 %106, ptr %8, align 4, !tbaa !9
  br label %89, !llvm.loop !25

107:                                              ; preds = %89
  %108 = load ptr, ptr %7, align 8, !tbaa !5
  %109 = getelementptr inbounds %"class.SoLoud::AudioSourceInstance", ptr %108, i32 0, i32 7
  %110 = load float, ptr %109, align 4, !tbaa !26
  %111 = fcmp olt float %110, 0x3F50624DE0000000
  br i1 %111, label %112, label %128

112:                                              ; preds = %107
  %113 = load ptr, ptr %7, align 8, !tbaa !5
  %114 = getelementptr inbounds %"class.SoLoud::AudioSourceInstance", ptr %113, i32 0, i32 3
  %115 = load i32, ptr %114, align 8, !tbaa !18
  %116 = or i32 %115, 32
  store i32 %116, ptr %114, align 8, !tbaa !18
  %117 = load ptr, ptr %7, align 8, !tbaa !5
  %118 = getelementptr inbounds %"class.SoLoud::AudioSourceInstance", ptr %117, i32 0, i32 3
  %119 = load i32, ptr %118, align 8, !tbaa !18
  %120 = and i32 %119, 64
  %121 = icmp ne i32 %120, 0
  br i1 %121, label %122, label %127

122:                                              ; preds = %112
  %123 = load i32, ptr %5, align 4, !tbaa !9
  %124 = sext i32 %123 to i64
  %125 = getelementptr inbounds [1024 x i32], ptr %4, i64 0, i64 %124
  %126 = load i32, ptr %125, align 4, !tbaa !9
  call void @_ZN6SoLoud6Soloud18stopVoice_internalEj(ptr noundef nonnull align 8 dereferenceable(138833) %9, i32 noundef %126)
  br label %127

127:                                              ; preds = %122, %112
  br label %133

128:                                              ; preds = %107
  %129 = load ptr, ptr %7, align 8, !tbaa !5
  %130 = getelementptr inbounds %"class.SoLoud::AudioSourceInstance", ptr %129, i32 0, i32 3
  %131 = load i32, ptr %130, align 8, !tbaa !18
  %132 = and i32 %131, -33
  store i32 %132, ptr %130, align 8, !tbaa !18
  br label %133

133:                                              ; preds = %128, %127
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  br label %134

134:                                              ; preds = %133, %62
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #4
  br label %135

135:                                              ; preds = %134
  %136 = load i32, ptr %5, align 4, !tbaa !9
  %137 = add nsw i32 %136, 1
  store i32 %137, ptr %5, align 4, !tbaa !9
  br label %58, !llvm.loop !27

138:                                              ; preds = %58
  %139 = getelementptr inbounds %"class.SoLoud::Soloud", ptr %9, i32 0, i32 49
  store i8 1, ptr %139, align 8, !tbaa !28
  call void @_ZN6SoLoud6Soloud25unlockAudioMutex_internalEv(ptr noundef nonnull align 8 dereferenceable(138833) %9)
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #4
  call void @llvm.lifetime.end.p0(i64 4096, ptr %4) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #4
  ret void
}

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

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

declare void @_ZN6SoLoud6Soloud37updateVoiceRelativePlaySpeed_internalEj(ptr noundef nonnull align 8 dereferenceable(138833), i32 noundef) #3

declare void @_ZN6SoLoud6Soloud26updateVoiceVolume_internalEj(ptr noundef nonnull align 8 dereferenceable(138833), i32 noundef) #3

declare void @_ZN6SoLoud6Soloud18stopVoice_internalEj(ptr noundef nonnull align 8 dereferenceable(138833), i32 noundef) #3

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress uwtable "min-legal-vector-width"="64" "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 = { 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, !10, i64 52}
!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 = !{!19, !10, i64 16}
!19 = !{!"_ZTSN6SoLoud19AudioSourceInstanceE", !10, i64 8, !10, i64 12, !10, i64 16, !15, i64 20, !7, i64 24, !15, i64 56, !15, i64 60, !15, i64 64, !15, i64 68, !10, i64 72, !15, i64 76, !15, i64 80, !17, i64 88, !17, i64 96, !16, i64 104, !16, i64 152, !16, i64 200, !16, i64 248, !16, i64 296, !10, i64 344, !7, i64 348, !10, i64 380, !10, i64 384, !7, i64 392, !7, i64 456, !10, i64 472, !10, i64 476, !10, i64 480, !17, i64 488}
!20 = !{!21, !10, i64 108}
!21 = !{!"_ZTSN6SoLoud25AudioSourceInstance3dDataE", !7, i64 0, !7, i64 12, !15, i64 24, !15, i64 28, !15, i64 32, !10, i64 36, !15, i64 40, !6, i64 48, !6, i64 56, !10, i64 64, !15, i64 68, !15, i64 72, !7, i64 76, !10, i64 108, !10, i64 112}
!22 = distinct !{!22, !23}
!23 = !{!"llvm.loop.mustprogress"}
!24 = !{!15, !15, i64 0}
!25 = distinct !{!25, !23}
!26 = !{!19, !15, i64 60}
!27 = distinct !{!27, !23}
!28 = !{!12, !13, i64 138832}


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

%"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] }>

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN6SoLoud6Soloud13update3dAudioEv(ptr noundef nonnull align 8 dereferenceable(138833) %0) local_unnamed_addr #2 align 2 {
  %2 = alloca [1024 x i32], align 16
  call void @llvm.lifetime.start.p0(i64 4096, ptr nonnull %2) #4
  tail call void @_ZN6SoLoud6Soloud23lockAudioMutex_internalEv(ptr noundef nonnull align 8 dereferenceable(138833) %0)
  %3 = getelementptr inbounds i8, ptr %0, i64 52
  %4 = load i32, ptr %3, align 4, !tbaa !5
  %5 = icmp sgt i32 %4, 0
  br i1 %5, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %1
  %6 = getelementptr inbounds i8, ptr %0, i64 152
  %7 = getelementptr inbounds i8, ptr %0, i64 11840
  %wide.trip.count = zext nneg i32 %4 to i64
  br label %8

8:                                                ; preds = %.lr.ph, %21
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %21 ]
  %.02938 = phi i32 [ 0, %.lr.ph ], [ %.1, %21 ]
  %9 = getelementptr inbounds [1024 x ptr], ptr %6, i64 0, i64 %indvars.iv
  %10 = load ptr, ptr %9, align 8, !tbaa !16
  %.not35 = icmp eq ptr %10, null
  br i1 %.not35, label %21, label %11

11:                                               ; preds = %8
  %12 = getelementptr inbounds i8, ptr %10, i64 16
  %13 = load i32, ptr %12, align 8, !tbaa !17
  %14 = and i32 %13, 8
  %.not36 = icmp eq i32 %14, 0
  br i1 %.not36, label %21, label %15

15:                                               ; preds = %11
  %16 = zext i32 %.02938 to i64
  %17 = getelementptr inbounds [1024 x i32], ptr %2, i64 0, i64 %16
  %18 = trunc nuw nsw i64 %indvars.iv to i32
  store i32 %18, ptr %17, align 4, !tbaa !19
  %19 = add i32 %.02938, 1
  %20 = getelementptr inbounds [1024 x %"class.SoLoud::AudioSourceInstance3dData"], ptr %7, i64 0, i64 %indvars.iv, i32 14
  store i32 %13, ptr %20, align 4, !tbaa !20
  br label %21

21:                                               ; preds = %8, %11, %15
  %.1 = phi i32 [ %19, %15 ], [ %.02938, %11 ], [ %.02938, %8 ]
  %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 %8, !llvm.loop !22

._crit_edge:                                      ; preds = %21, %1
  %.029.lcssa = phi i32 [ 0, %1 ], [ %.1, %21 ]
  tail call void @_ZN6SoLoud6Soloud25unlockAudioMutex_internalEv(ptr noundef nonnull align 8 dereferenceable(138833) %0)
  call void @_ZN6SoLoud6Soloud23update3dVoices_internalEPjj(ptr noundef nonnull align 8 dereferenceable(138833) %0, ptr noundef nonnull %2, i32 noundef %.029.lcssa)
  call void @_ZN6SoLoud6Soloud23lockAudioMutex_internalEv(ptr noundef nonnull align 8 dereferenceable(138833) %0)
  %22 = icmp sgt i32 %.029.lcssa, 0
  br i1 %22, label %.lr.ph42, label %._crit_edge43

.lr.ph42:                                         ; preds = %._crit_edge
  %23 = getelementptr inbounds i8, ptr %0, i64 11840
  %24 = getelementptr inbounds i8, ptr %0, i64 152
  %wide.trip.count53 = zext nneg i32 %.029.lcssa to i64
  br label %25

25:                                               ; preds = %.lr.ph42, %69
  %indvars.iv50 = phi i64 [ 0, %.lr.ph42 ], [ %indvars.iv.next51, %69 ]
  %26 = getelementptr inbounds [1024 x i32], ptr %2, i64 0, i64 %indvars.iv50
  %27 = load i32, ptr %26, align 4, !tbaa !19
  %28 = zext i32 %27 to i64
  %29 = getelementptr inbounds [1024 x ptr], ptr %24, i64 0, i64 %28
  %30 = load ptr, ptr %29, align 8, !tbaa !16
  %.not = icmp eq ptr %30, null
  br i1 %.not, label %69, label %31

31:                                               ; preds = %25
  call void @_ZN6SoLoud6Soloud37updateVoiceRelativePlaySpeed_internalEj(ptr noundef nonnull align 8 dereferenceable(138833) %0, i32 noundef %27)
  %32 = load i32, ptr %26, align 4, !tbaa !19
  call void @_ZN6SoLoud6Soloud26updateVoiceVolume_internalEj(ptr noundef nonnull align 8 dereferenceable(138833) %0, i32 noundef %32)
  %33 = getelementptr inbounds i8, ptr %30, i64 24
  %34 = getelementptr inbounds [1024 x %"class.SoLoud::AudioSourceInstance3dData"], ptr %23, i64 0, i64 %28, i32 13, i64 0
  %35 = load float, ptr %34, align 4, !tbaa !24
  store float %35, ptr %33, align 4, !tbaa !24
  %36 = getelementptr inbounds [1024 x %"class.SoLoud::AudioSourceInstance3dData"], ptr %23, i64 0, i64 %28, i32 13, i64 1
  %37 = load float, ptr %36, align 8, !tbaa !24
  %38 = getelementptr inbounds i8, ptr %30, i64 28
  store float %37, ptr %38, align 4, !tbaa !24
  %39 = getelementptr inbounds [1024 x %"class.SoLoud::AudioSourceInstance3dData"], ptr %23, i64 0, i64 %28, i32 13, i64 2
  %40 = load float, ptr %39, align 4, !tbaa !24
  %41 = getelementptr inbounds i8, ptr %30, i64 32
  store float %40, ptr %41, align 4, !tbaa !24
  %42 = getelementptr inbounds [1024 x %"class.SoLoud::AudioSourceInstance3dData"], ptr %23, i64 0, i64 %28, i32 13, i64 3
  %43 = load float, ptr %42, align 8, !tbaa !24
  %44 = getelementptr inbounds i8, ptr %30, i64 36
  store float %43, ptr %44, align 4, !tbaa !24
  %45 = getelementptr inbounds [1024 x %"class.SoLoud::AudioSourceInstance3dData"], ptr %23, i64 0, i64 %28, i32 13, i64 4
  %46 = load float, ptr %45, align 4, !tbaa !24
  %47 = getelementptr inbounds i8, ptr %30, i64 40
  store float %46, ptr %47, align 4, !tbaa !24
  %48 = getelementptr inbounds [1024 x %"class.SoLoud::AudioSourceInstance3dData"], ptr %23, i64 0, i64 %28, i32 13, i64 5
  %49 = load float, ptr %48, align 8, !tbaa !24
  %50 = getelementptr inbounds i8, ptr %30, i64 44
  store float %49, ptr %50, align 4, !tbaa !24
  %51 = getelementptr inbounds [1024 x %"class.SoLoud::AudioSourceInstance3dData"], ptr %23, i64 0, i64 %28, i32 13, i64 6
  %52 = load float, ptr %51, align 4, !tbaa !24
  %53 = getelementptr inbounds i8, ptr %30, i64 48
  store float %52, ptr %53, align 4, !tbaa !24
  %54 = getelementptr inbounds [1024 x %"class.SoLoud::AudioSourceInstance3dData"], ptr %23, i64 0, i64 %28, i32 13, i64 7
  %55 = load float, ptr %54, align 8, !tbaa !24
  %56 = getelementptr inbounds i8, ptr %30, i64 52
  store float %55, ptr %56, align 4, !tbaa !24
  %57 = getelementptr inbounds i8, ptr %30, i64 60
  %58 = load float, ptr %57, align 4, !tbaa !25
  %59 = fcmp olt float %58, 0x3F50624DE0000000
  %60 = getelementptr inbounds i8, ptr %30, i64 16
  %61 = load i32, ptr %60, align 8, !tbaa !17
  br i1 %59, label %62, label %67

62:                                               ; preds = %31
  %63 = or i32 %61, 32
  store i32 %63, ptr %60, align 8, !tbaa !17
  %64 = and i32 %61, 64
  %.not34 = icmp eq i32 %64, 0
  br i1 %.not34, label %69, label %65

65:                                               ; preds = %62
  %66 = load i32, ptr %26, align 4, !tbaa !19
  call void @_ZN6SoLoud6Soloud18stopVoice_internalEj(ptr noundef nonnull align 8 dereferenceable(138833) %0, i32 noundef %66)
  br label %69

67:                                               ; preds = %31
  %68 = and i32 %61, -33
  store i32 %68, ptr %60, align 8, !tbaa !17
  br label %69

69:                                               ; preds = %67, %65, %62, %25
  %indvars.iv.next51 = add nuw nsw i64 %indvars.iv50, 1
  %exitcond54.not = icmp eq i64 %indvars.iv.next51, %wide.trip.count53
  br i1 %exitcond54.not, label %._crit_edge43, label %25, !llvm.loop !26

._crit_edge43:                                    ; preds = %69, %._crit_edge
  %70 = getelementptr inbounds i8, ptr %0, i64 138832
  store i8 1, ptr %70, align 8, !tbaa !27
  call void @_ZN6SoLoud6Soloud25unlockAudioMutex_internalEv(ptr noundef nonnull align 8 dereferenceable(138833) %0)
  call void @llvm.lifetime.end.p0(i64 4096, ptr nonnull %2) #4
  ret void
}

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

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

declare void @_ZN6SoLoud6Soloud37updateVoiceRelativePlaySpeed_internalEj(ptr noundef nonnull align 8 dereferenceable(138833), i32 noundef) local_unnamed_addr #3

declare void @_ZN6SoLoud6Soloud26updateVoiceVolume_internalEj(ptr noundef nonnull align 8 dereferenceable(138833), i32 noundef) local_unnamed_addr #3

declare void @_ZN6SoLoud6Soloud18stopVoice_internalEj(ptr noundef nonnull align 8 dereferenceable(138833), i32 noundef) local_unnamed_addr #3

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress uwtable "min-legal-vector-width"="64" "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 = { 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, !11, i64 52}
!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 = !{!18, !11, i64 16}
!18 = !{!"_ZTSN6SoLoud19AudioSourceInstanceE", !11, i64 8, !11, i64 12, !11, i64 16, !13, i64 20, !8, i64 24, !13, i64 56, !13, i64 60, !13, i64 64, !13, i64 68, !11, i64 72, !13, i64 76, !13, i64 80, !15, i64 88, !15, i64 96, !14, i64 104, !14, i64 152, !14, i64 200, !14, i64 248, !14, i64 296, !11, i64 344, !8, i64 348, !11, i64 380, !11, i64 384, !8, i64 392, !8, i64 456, !11, i64 472, !11, i64 476, !11, i64 480, !15, i64 488}
!19 = !{!11, !11, i64 0}
!20 = !{!21, !11, i64 108}
!21 = !{!"_ZTSN6SoLoud25AudioSourceInstance3dDataE", !8, i64 0, !8, i64 12, !13, i64 24, !13, i64 28, !13, i64 32, !11, i64 36, !13, i64 40, !7, i64 48, !7, i64 56, !11, i64 64, !13, i64 68, !13, i64 72, !8, i64 76, !11, i64 108, !11, i64 112}
!22 = distinct !{!22, !23}
!23 = !{!"llvm.loop.mustprogress"}
!24 = !{!13, !13, i64 0}
!25 = !{!18, !13, i64 60}
!26 = distinct !{!26, !23}
!27 = !{!6, !10, i64 138832}


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