; LLVM IR from merpheus-dev/LavaEngine :: src/Utils/soloud/src/core (soloud_core_setters)

; 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, i32, i32, %"class.SoLoud::AlignedFloatBuffer", i32, i32, %"class.SoLoud::AlignedFloatBuffer", ptr, ptr, [1024 x ptr], i32, i32, i32, [4 x i8], 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] }>

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

declare void @_ZN6SoLoud6Soloud23lockAudioMutex_internalEv(ptr noundef nonnull align 8 dereferenceable(138793)) #1

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

declare void @_ZN6SoLoud6Soloud25unlockAudioMutex_internalEv(ptr noundef nonnull align 8 dereferenceable(138793)) #1

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN6SoLoud6Soloud22setMaxActiveVoiceCountEj(ptr noundef nonnull align 8 dereferenceable(138793) %0, i32 noundef %1) #2 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store i32 %1, ptr %5, align 4, !tbaa !9
  %9 = load ptr, ptr %4, align 8
  %10 = load i32, ptr %5, align 4, !tbaa !9
  %11 = icmp eq i32 %10, 0
  br i1 %11, label %15, label %12

12:                                               ; preds = %2
  %13 = load i32, ptr %5, align 4, !tbaa !9
  %14 = icmp uge i32 %13, 1024
  br i1 %14, label %15, label %16

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

16:                                               ; preds = %12
  call void @_ZN6SoLoud6Soloud23lockAudioMutex_internalEv(ptr noundef nonnull align 8 dereferenceable(138793) %9)
  %17 = load i32, ptr %5, align 4, !tbaa !9
  %18 = getelementptr inbounds %"class.SoLoud::Soloud", ptr %9, i32 0, i32 5
  store i32 %17, ptr %18, align 8, !tbaa !11
  %19 = getelementptr inbounds %"class.SoLoud::Soloud", ptr %9, i32 0, i32 11
  %20 = load ptr, ptr %19, align 8, !tbaa !18
  %21 = icmp eq ptr %20, null
  br i1 %21, label %34, label %22

22:                                               ; preds = %16
  %23 = getelementptr inbounds i8, ptr %20, i64 -8
  %24 = load i64, ptr %23, align 8
  %25 = getelementptr inbounds %"class.SoLoud::AlignedFloatBuffer", ptr %20, i64 %24
  %26 = icmp eq ptr %20, %25
  br i1 %26, label %31, label %27

27:                                               ; preds = %27, %22
  %28 = phi ptr [ %25, %22 ], [ %29, %27 ]
  %29 = getelementptr inbounds %"class.SoLoud::AlignedFloatBuffer", ptr %28, i64 -1
  call void @_ZN6SoLoud18AlignedFloatBufferD1Ev(ptr noundef nonnull align 8 dereferenceable(20) %29) #7
  %30 = icmp eq ptr %29, %20
  br i1 %30, label %31, label %27

31:                                               ; preds = %27, %22
  %32 = mul i64 24, %24
  %33 = add i64 %32, 8
  call void @_ZdaPvm(ptr noundef %23, i64 noundef %33) #8
  br label %34

34:                                               ; preds = %31, %16
  %35 = getelementptr inbounds %"class.SoLoud::Soloud", ptr %9, i32 0, i32 12
  %36 = load ptr, ptr %35, align 8, !tbaa !19
  %37 = icmp eq ptr %36, null
  br i1 %37, label %39, label %38

38:                                               ; preds = %34
  call void @_ZdaPv(ptr noundef %36) #8
  br label %39

39:                                               ; preds = %38, %34
  %40 = load i32, ptr %5, align 4, !tbaa !9
  %41 = mul i32 %40, 2
  %42 = zext i32 %41 to i64
  %43 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %42, i64 24)
  %44 = extractvalue { i64, i1 } %43, 1
  %45 = extractvalue { i64, i1 } %43, 0
  %46 = call { i64, i1 } @llvm.uadd.with.overflow.i64(i64 %45, i64 8)
  %47 = extractvalue { i64, i1 } %46, 1
  %48 = or i1 %44, %47
  %49 = extractvalue { i64, i1 } %46, 0
  %50 = select i1 %48, i64 -1, i64 %49
  %51 = call noalias noundef nonnull ptr @_Znam(i64 noundef %50) #9
  store i64 %42, ptr %51, align 16
  %52 = getelementptr inbounds i8, ptr %51, i64 8
  %53 = icmp eq i64 %42, 0
  br i1 %53, label %61, label %54

54:                                               ; preds = %39
  %55 = getelementptr inbounds %"class.SoLoud::AlignedFloatBuffer", ptr %52, i64 %42
  br label %56

56:                                               ; preds = %58, %54
  %57 = phi ptr [ %52, %54 ], [ %59, %58 ]
  invoke void @_ZN6SoLoud18AlignedFloatBufferC1Ev(ptr noundef nonnull align 8 dereferenceable(20) %57)
          to label %58 unwind label %86

58:                                               ; preds = %56
  %59 = getelementptr inbounds %"class.SoLoud::AlignedFloatBuffer", ptr %57, i64 1
  %60 = icmp eq ptr %59, %55
  br i1 %60, label %61, label %56

61:                                               ; preds = %58, %39
  %62 = getelementptr inbounds %"class.SoLoud::Soloud", ptr %9, i32 0, i32 11
  store ptr %52, ptr %62, align 8, !tbaa !18
  %63 = load i32, ptr %5, align 4, !tbaa !9
  %64 = zext i32 %63 to i64
  %65 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %64, i64 8)
  %66 = extractvalue { i64, i1 } %65, 1
  %67 = extractvalue { i64, i1 } %65, 0
  %68 = select i1 %66, i64 -1, i64 %67
  %69 = call noalias noundef nonnull ptr @_Znam(i64 noundef %68) #9
  %70 = getelementptr inbounds %"class.SoLoud::Soloud", ptr %9, i32 0, i32 12
  store ptr %69, ptr %70, align 8, !tbaa !19
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #7
  store i32 0, ptr %8, align 4, !tbaa !9
  br label %71

71:                                               ; preds = %83, %61
  %72 = load i32, ptr %8, align 4, !tbaa !9
  %73 = load i32, ptr %5, align 4, !tbaa !9
  %74 = mul i32 %73, 2
  %75 = icmp ult i32 %72, %74
  br i1 %75, label %76, label %96

76:                                               ; preds = %71
  %77 = getelementptr inbounds %"class.SoLoud::Soloud", ptr %9, i32 0, i32 11
  %78 = load ptr, ptr %77, align 8, !tbaa !18
  %79 = load i32, ptr %8, align 4, !tbaa !9
  %80 = zext i32 %79 to i64
  %81 = getelementptr inbounds %"class.SoLoud::AlignedFloatBuffer", ptr %78, i64 %80
  %82 = call noundef i32 @_ZN6SoLoud18AlignedFloatBuffer4initEj(ptr noundef nonnull align 8 dereferenceable(20) %81, i32 noundef 4096)
  br label %83

83:                                               ; preds = %76
  %84 = load i32, ptr %8, align 4, !tbaa !9
  %85 = add i32 %84, 1
  store i32 %85, ptr %8, align 4, !tbaa !9
  br label %71, !llvm.loop !20

86:                                               ; preds = %56
  %87 = landingpad { ptr, i32 }
          cleanup
  %88 = extractvalue { ptr, i32 } %87, 0
  store ptr %88, ptr %6, align 8
  %89 = extractvalue { ptr, i32 } %87, 1
  store i32 %89, ptr %7, align 4
  %90 = icmp eq ptr %52, %57
  br i1 %90, label %95, label %91

91:                                               ; preds = %91, %86
  %92 = phi ptr [ %57, %86 ], [ %93, %91 ]
  %93 = getelementptr inbounds %"class.SoLoud::AlignedFloatBuffer", ptr %92, i64 -1
  call void @_ZN6SoLoud18AlignedFloatBufferD1Ev(ptr noundef nonnull align 8 dereferenceable(20) %93) #7
  %94 = icmp eq ptr %93, %52
  br i1 %94, label %95, label %91

95:                                               ; preds = %91, %86
  call void @_ZdaPvm(ptr noundef %51, i64 noundef %50) #8
  br label %114

96:                                               ; preds = %71
  store i32 0, ptr %8, align 4, !tbaa !9
  br label %97

97:                                               ; preds = %107, %96
  %98 = load i32, ptr %8, align 4, !tbaa !9
  %99 = load i32, ptr %5, align 4, !tbaa !9
  %100 = icmp ult i32 %98, %99
  br i1 %100, label %101, label %110

101:                                              ; preds = %97
  %102 = getelementptr inbounds %"class.SoLoud::Soloud", ptr %9, i32 0, i32 12
  %103 = load ptr, ptr %102, align 8, !tbaa !19
  %104 = load i32, ptr %8, align 4, !tbaa !9
  %105 = zext i32 %104 to i64
  %106 = getelementptr inbounds ptr, ptr %103, i64 %105
  store ptr null, ptr %106, align 8, !tbaa !5
  br label %107

107:                                              ; preds = %101
  %108 = load i32, ptr %8, align 4, !tbaa !9
  %109 = add i32 %108, 1
  store i32 %109, ptr %8, align 4, !tbaa !9
  br label %97, !llvm.loop !22

110:                                              ; preds = %97
  %111 = getelementptr inbounds %"class.SoLoud::Soloud", ptr %9, i32 0, i32 46
  store i8 1, ptr %111, align 8, !tbaa !23
  call void @_ZN6SoLoud6Soloud25unlockAudioMutex_internalEv(ptr noundef nonnull align 8 dereferenceable(138793) %9)
  store i32 0, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #7
  br label %112

112:                                              ; preds = %110, %15
  %113 = load i32, ptr %3, align 4
  ret i32 %113

114:                                              ; preds = %95
  %115 = load ptr, ptr %6, align 8
  %116 = load i32, ptr %7, align 4
  %117 = insertvalue { ptr, i32 } poison, ptr %115, 0
  %118 = insertvalue { ptr, i32 } %117, i32 %116, 1
  resume { ptr, i32 } %118
}

; Function Attrs: nounwind
declare void @_ZN6SoLoud18AlignedFloatBufferD1Ev(ptr noundef nonnull align 8 dereferenceable(20)) unnamed_addr #3

; Function Attrs: nobuiltin nounwind
declare void @_ZdaPvm(ptr noundef, i64 noundef) #4

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

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

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

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

declare void @_ZN6SoLoud18AlignedFloatBufferC1Ev(ptr noundef nonnull align 8 dereferenceable(20)) unnamed_addr #1

declare i32 @__gxx_personality_v0(...)

declare noundef i32 @_ZN6SoLoud18AlignedFloatBuffer4initEj(ptr noundef nonnull align 8 dereferenceable(20), i32 noundef) #1

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "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 = { 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 #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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { 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 #7 = { nounwind }
attributes #8 = { builtin nounwind }
attributes #9 = { 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, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !10, i64 32}
!12 = !{!"_ZTSN6SoLoud6SoloudE", !6, i64 0, !6, i64 8, !13, i64 16, !6, i64 24, !10, i64 32, !10, i64 36, !14, i64 40, !10, i64 64, !10, i64 68, !14, i64 72, !6, i64 96, !6, i64 104, !7, i64 112, !10, i64 8304, !10, i64 8308, !10, i64 8312, !6, i64 8320, !10, i64 8328, !10, i64 8332, !15, i64 8336, !15, i64 8340, !10, i64 8344, !10, i64 8348, !16, i64 8352, !17, i64 8400, !17, i64 8408, !7, i64 8416, !7, i64 8480, !7, i64 8544, !7, i64 8576, !7, i64 9600, !7, i64 10624, !7, i64 11648, !7, i64 11660, !7, i64 11672, !7, i64 11684, !15, i64 11696, !7, i64 11700, !7, i64 11800, !6, i64 134680, !10, i64 134688, !7, i64 134692, !10, i64 138788, !13, i64 138792}
!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 = !{!12, !6, i64 96}
!19 = !{!12, !6, i64 104}
!20 = distinct !{!20, !21}
!21 = !{!"llvm.loop.mustprogress"}
!22 = distinct !{!22, !21}
!23 = !{!12, !13, i64 138792}


; 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::AlignedFloatBuffer" = type <{ ptr, ptr, i32, [4 x i8] }>

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef range(i32 0, 2) i32 @_ZN6SoLoud6Soloud22setMaxActiveVoiceCountEj(ptr noundef nonnull align 8 dereferenceable(138793) %0, i32 noundef %1) local_unnamed_addr #1 align 2 personality ptr @__gxx_personality_v0 {
  %3 = add i32 %1, -1024
  %or.cond = icmp ult i32 %3, -1023
  br i1 %or.cond, label %57, label %4

4:                                                ; preds = %2
  tail call void @_ZN6SoLoud6Soloud23lockAudioMutex_internalEv(ptr noundef nonnull align 8 dereferenceable(138793) %0)
  %5 = getelementptr inbounds i8, ptr %0, i64 32
  store i32 %1, ptr %5, align 8, !tbaa !5
  %6 = getelementptr inbounds i8, ptr %0, i64 96
  %7 = load ptr, ptr %6, align 8, !tbaa !16
  %8 = icmp eq ptr %7, null
  br i1 %8, label %19, label %9

9:                                                ; preds = %4
  %10 = getelementptr inbounds i8, ptr %7, i64 -8
  %11 = load i64, ptr %10, align 8
  %12 = icmp eq i64 %11, 0
  br i1 %12, label %.loopexit33, label %.preheader32.preheader

.preheader32.preheader:                           ; preds = %9
  %13 = getelementptr inbounds %"class.SoLoud::AlignedFloatBuffer", ptr %7, i64 %11
  br label %.preheader32

.preheader32:                                     ; preds = %.preheader32.preheader, %.preheader32
  %14 = phi ptr [ %15, %.preheader32 ], [ %13, %.preheader32.preheader ]
  %15 = getelementptr inbounds i8, ptr %14, i64 -24
  tail call void @_ZN6SoLoud18AlignedFloatBufferD1Ev(ptr noundef nonnull align 8 dereferenceable(20) %15) #6
  %16 = icmp eq ptr %15, %7
  br i1 %16, label %.loopexit33, label %.preheader32

.loopexit33:                                      ; preds = %.preheader32, %9
  %17 = mul i64 %11, 24
  %18 = add i64 %17, 8
  tail call void @_ZdaPvm(ptr noundef nonnull %10, i64 noundef %18) #7
  br label %19

19:                                               ; preds = %.loopexit33, %4
  %20 = getelementptr inbounds i8, ptr %0, i64 104
  %21 = load ptr, ptr %20, align 8, !tbaa !17
  %22 = icmp eq ptr %21, null
  br i1 %22, label %24, label %23

23:                                               ; preds = %19
  tail call void @_ZdaPv(ptr noundef nonnull %21) #7
  br label %24

24:                                               ; preds = %23, %19
  %25 = shl nuw nsw i32 %1, 1
  %26 = zext nneg i32 %25 to i64
  %27 = mul nuw nsw i64 %26, 24
  %28 = or disjoint i64 %27, 8
  %29 = tail call noalias noundef nonnull ptr @_Znam(i64 noundef %28) #8
  store i64 %26, ptr %29, align 16
  %.ptr26 = getelementptr inbounds i8, ptr %29, i64 8
  %30 = getelementptr inbounds %"class.SoLoud::AlignedFloatBuffer", ptr %.ptr26, i64 %26
  br label %31

31:                                               ; preds = %32, %24
  %.idx = phi i64 [ 8, %24 ], [ %.add, %32 ]
  %.ptr.ptr = getelementptr inbounds i8, ptr %29, i64 %.idx
  invoke void @_ZN6SoLoud18AlignedFloatBufferC1Ev(ptr noundef nonnull align 8 dereferenceable(20) %.ptr.ptr)
          to label %32 unwind label %42

32:                                               ; preds = %31
  %.add = add nuw nsw i64 %.idx, 24
  %.ptr25 = getelementptr inbounds i8, ptr %29, i64 %.add
  %33 = icmp eq ptr %.ptr25, %30
  br i1 %33, label %34, label %31

34:                                               ; preds = %32
  store ptr %.ptr26, ptr %6, align 8, !tbaa !16
  %35 = shl nuw nsw i32 %1, 3
  %36 = zext nneg i32 %35 to i64
  %37 = tail call noalias noundef nonnull ptr @_Znam(i64 noundef %36) #8
  store ptr %37, ptr %20, align 8, !tbaa !17
  %.not = icmp eq i32 %1, 0
  br i1 %.not, label %._crit_edge, label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %34
  %umax = tail call i32 @llvm.umax.i32(i32 %25, i32 1)
  %wide.trip.count = zext nneg i32 %umax to i64
  br label %.lr.ph

.preheader:                                       ; preds = %.lr.ph
  br i1 %.not, label %._crit_edge, label %.lr.ph37.preheader

.lr.ph37.preheader:                               ; preds = %.preheader
  %wide.trip.count44 = zext nneg i32 %1 to i64
  %xtraiter = and i64 %wide.trip.count44, 3
  %38 = icmp ult i32 %1, 4
  br i1 %38, label %._crit_edge.loopexit.unr-lcssa, label %.lr.ph37.preheader.new

.lr.ph37.preheader.new:                           ; preds = %.lr.ph37.preheader
  %unroll_iter = and i64 %wide.trip.count44, 1020
  br label %.lr.ph37

.lr.ph:                                           ; preds = %.lr.ph.preheader, %.lr.ph
  %indvars.iv = phi i64 [ 0, %.lr.ph.preheader ], [ %indvars.iv.next, %.lr.ph ]
  %39 = load ptr, ptr %6, align 8, !tbaa !16
  %40 = getelementptr inbounds %"class.SoLoud::AlignedFloatBuffer", ptr %39, i64 %indvars.iv
  %41 = tail call noundef i32 @_ZN6SoLoud18AlignedFloatBuffer4initEj(ptr noundef nonnull align 8 dereferenceable(20) %40, i32 noundef 4096)
  %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 %.preheader, label %.lr.ph, !llvm.loop !18

42:                                               ; preds = %31
  %43 = landingpad { ptr, i32 }
          cleanup
  %44 = icmp eq i64 %.idx, 8
  br i1 %44, label %.loopexit, label %.preheader31

.preheader31:                                     ; preds = %42, %.preheader31
  %.idx27 = phi i64 [ %.add28, %.preheader31 ], [ %.idx, %42 ]
  %.add28 = add nsw i64 %.idx27, -24
  %.ptr30 = getelementptr inbounds i8, ptr %29, i64 %.add28
  tail call void @_ZN6SoLoud18AlignedFloatBufferD1Ev(ptr noundef nonnull align 8 dereferenceable(20) %.ptr30) #6
  %45 = icmp eq i64 %.add28, 8
  br i1 %45, label %.loopexit, label %.preheader31

.loopexit:                                        ; preds = %.preheader31, %42
  tail call void @_ZdaPvm(ptr noundef nonnull %29, i64 noundef %28) #7
  resume { ptr, i32 } %43

.lr.ph37:                                         ; preds = %.lr.ph37, %.lr.ph37.preheader.new
  %indvars.iv41 = phi i64 [ 0, %.lr.ph37.preheader.new ], [ %indvars.iv.next42.3, %.lr.ph37 ]
  %niter = phi i64 [ 0, %.lr.ph37.preheader.new ], [ %niter.next.3, %.lr.ph37 ]
  %46 = load ptr, ptr %20, align 8, !tbaa !17
  %47 = getelementptr inbounds ptr, ptr %46, i64 %indvars.iv41
  store ptr null, ptr %47, align 8, !tbaa !20
  %indvars.iv.next42 = or disjoint i64 %indvars.iv41, 1
  %48 = load ptr, ptr %20, align 8, !tbaa !17
  %49 = getelementptr inbounds ptr, ptr %48, i64 %indvars.iv.next42
  store ptr null, ptr %49, align 8, !tbaa !20
  %indvars.iv.next42.1 = or disjoint i64 %indvars.iv41, 2
  %50 = load ptr, ptr %20, align 8, !tbaa !17
  %51 = getelementptr inbounds ptr, ptr %50, i64 %indvars.iv.next42.1
  store ptr null, ptr %51, align 8, !tbaa !20
  %indvars.iv.next42.2 = or disjoint i64 %indvars.iv41, 3
  %52 = load ptr, ptr %20, align 8, !tbaa !17
  %53 = getelementptr inbounds ptr, ptr %52, i64 %indvars.iv.next42.2
  store ptr null, ptr %53, align 8, !tbaa !20
  %indvars.iv.next42.3 = add nuw nsw i64 %indvars.iv41, 4
  %niter.next.3 = add i64 %niter, 4
  %niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
  br i1 %niter.ncmp.3, label %._crit_edge.loopexit.unr-lcssa, label %.lr.ph37, !llvm.loop !21

._crit_edge.loopexit.unr-lcssa:                   ; preds = %.lr.ph37, %.lr.ph37.preheader
  %indvars.iv41.unr = phi i64 [ 0, %.lr.ph37.preheader ], [ %indvars.iv.next42.3, %.lr.ph37 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge, label %.lr.ph37.epil

.lr.ph37.epil:                                    ; preds = %._crit_edge.loopexit.unr-lcssa, %.lr.ph37.epil
  %indvars.iv41.epil = phi i64 [ %indvars.iv.next42.epil, %.lr.ph37.epil ], [ %indvars.iv41.unr, %._crit_edge.loopexit.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.lr.ph37.epil ], [ 0, %._crit_edge.loopexit.unr-lcssa ]
  %54 = load ptr, ptr %20, align 8, !tbaa !17
  %55 = getelementptr inbounds ptr, ptr %54, i64 %indvars.iv41.epil
  store ptr null, ptr %55, align 8, !tbaa !20
  %indvars.iv.next42.epil = add nuw nsw i64 %indvars.iv41.epil, 1
  %epil.iter.next = add i64 %epil.iter, 1
  %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
  br i1 %epil.iter.cmp.not, label %._crit_edge, label %.lr.ph37.epil, !llvm.loop !22

._crit_edge:                                      ; preds = %._crit_edge.loopexit.unr-lcssa, %.lr.ph37.epil, %34, %.preheader
  %56 = getelementptr inbounds i8, ptr %0, i64 138792
  store i8 1, ptr %56, align 8, !tbaa !24
  tail call void @_ZN6SoLoud6Soloud25unlockAudioMutex_internalEv(ptr noundef nonnull align 8 dereferenceable(138793) %0)
  br label %57

57:                                               ; preds = %2, %._crit_edge
  %.017 = phi i32 [ 0, %._crit_edge ], [ 1, %2 ]
  ret i32 %.017
}

; Function Attrs: nounwind
declare void @_ZN6SoLoud18AlignedFloatBufferD1Ev(ptr noundef nonnull align 8 dereferenceable(20)) unnamed_addr #2

; Function Attrs: nobuiltin nounwind
declare void @_ZdaPvm(ptr noundef, i64 noundef) local_unnamed_addr #3

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

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

declare void @_ZN6SoLoud18AlignedFloatBufferC1Ev(ptr noundef nonnull align 8 dereferenceable(20)) unnamed_addr #0

declare i32 @__gxx_personality_v0(...)

declare noundef i32 @_ZN6SoLoud18AlignedFloatBuffer4initEj(ptr noundef nonnull align 8 dereferenceable(20), i32 noundef) local_unnamed_addr #0

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.umax.i32(i32, i32) #5

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" }
attributes #2 = { 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 = { 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 #4 = { 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 #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { nounwind }
attributes #7 = { builtin 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, !11, i64 32}
!6 = !{!"_ZTSN6SoLoud6SoloudE", !7, i64 0, !7, i64 8, !10, i64 16, !7, i64 24, !11, i64 32, !11, i64 36, !12, i64 40, !11, i64 64, !11, i64 68, !12, i64 72, !7, i64 96, !7, i64 104, !8, i64 112, !11, i64 8304, !11, i64 8308, !11, i64 8312, !7, i64 8320, !11, i64 8328, !11, i64 8332, !13, i64 8336, !13, i64 8340, !11, i64 8344, !11, i64 8348, !14, i64 8352, !15, i64 8400, !15, i64 8408, !8, i64 8416, !8, i64 8480, !8, i64 8544, !8, i64 8576, !8, i64 9600, !8, i64 10624, !8, i64 11648, !8, i64 11660, !8, i64 11672, !8, i64 11684, !13, i64 11696, !8, i64 11700, !8, i64 11800, !7, i64 134680, !11, i64 134688, !8, i64 134692, !11, i64 138788, !10, i64 138792}
!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 = !{!6, !7, i64 96}
!17 = !{!6, !7, i64 104}
!18 = distinct !{!18, !19}
!19 = !{!"llvm.loop.mustprogress"}
!20 = !{!7, !7, i64 0}
!21 = distinct !{!21, !19}
!22 = distinct !{!22, !23}
!23 = !{!"llvm.loop.unroll.disable"}
!24 = !{!6, !10, i64 138792}


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