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

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

@.str = external hidden unnamed_addr constant [14 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [118 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [24 x i8], align 1
@__PRETTY_FUNCTION__._ZN6SoLoud6Soloud22setVoicePause_internalEji = external hidden unnamed_addr constant [63 x i8], align 1

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #0

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_ZN6SoLoud6Soloud22setVoicePause_internalEji(ptr noundef nonnull align 8 dereferenceable(138833) %0, i32 noundef %1, i32 noundef %2) #1 align 2 {
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store i32 %1, ptr %5, align 4, !tbaa !9
  store i32 %2, ptr %6, align 4, !tbaa !9
  %7 = load ptr, ptr %4, align 8
  %8 = load i32, ptr %5, align 4, !tbaa !9
  %9 = icmp ult i32 %8, 1024
  br i1 %9, label %10, label %11

10:                                               ; preds = %3
  br label %13

11:                                               ; preds = %3
  call void @__assert_fail(ptr noundef @.str, ptr noundef @.str.1, i32 noundef 51, ptr noundef @__PRETTY_FUNCTION__._ZN6SoLoud6Soloud22setVoicePause_internalEji) #2
  unreachable

12:                                               ; No predecessors!
  br label %13

13:                                               ; preds = %12, %10
  %14 = getelementptr inbounds %"class.SoLoud::Soloud", ptr %7, i32 0, i32 2
  %15 = load i8, ptr %14, align 8, !tbaa !11, !range !18, !noundef !19
  %16 = trunc i8 %15 to i1
  br i1 %16, label %17, label %18

17:                                               ; preds = %13
  br label %20

18:                                               ; preds = %13
  call void @__assert_fail(ptr noundef @.str.2, ptr noundef @.str.1, i32 noundef 52, ptr noundef @__PRETTY_FUNCTION__._ZN6SoLoud6Soloud22setVoicePause_internalEji) #2
  unreachable

19:                                               ; No predecessors!
  br label %20

20:                                               ; preds = %19, %17
  %21 = getelementptr inbounds %"class.SoLoud::Soloud", ptr %7, i32 0, i32 49
  store i8 1, ptr %21, align 8, !tbaa !20
  %22 = getelementptr inbounds %"class.SoLoud::Soloud", ptr %7, i32 0, i32 16
  %23 = load i32, ptr %5, align 4, !tbaa !9
  %24 = zext i32 %23 to i64
  %25 = getelementptr inbounds [1024 x ptr], ptr %22, i64 0, i64 %24
  %26 = load ptr, ptr %25, align 8, !tbaa !5
  %27 = icmp ne ptr %26, null
  br i1 %27, label %28, label %57

28:                                               ; preds = %20
  %29 = getelementptr inbounds %"class.SoLoud::Soloud", ptr %7, i32 0, i32 16
  %30 = load i32, ptr %5, align 4, !tbaa !9
  %31 = zext i32 %30 to i64
  %32 = getelementptr inbounds [1024 x ptr], ptr %29, i64 0, i64 %31
  %33 = load ptr, ptr %32, align 8, !tbaa !5
  %34 = getelementptr inbounds %"class.SoLoud::AudioSourceInstance", ptr %33, i32 0, i32 18
  %35 = getelementptr inbounds %"class.SoLoud::Fader", ptr %34, i32 0, i32 7
  store i32 0, ptr %35, align 4, !tbaa !21
  %36 = load i32, ptr %6, align 4, !tbaa !9
  %37 = icmp ne i32 %36, 0
  br i1 %37, label %38, label %47

38:                                               ; preds = %28
  %39 = getelementptr inbounds %"class.SoLoud::Soloud", ptr %7, i32 0, i32 16
  %40 = load i32, ptr %5, align 4, !tbaa !9
  %41 = zext 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 !23
  %46 = or i32 %45, 4
  store i32 %46, ptr %44, align 8, !tbaa !23
  br label %56

47:                                               ; preds = %28
  %48 = getelementptr inbounds %"class.SoLoud::Soloud", ptr %7, i32 0, i32 16
  %49 = load i32, ptr %5, align 4, !tbaa !9
  %50 = zext i32 %49 to i64
  %51 = getelementptr inbounds [1024 x ptr], ptr %48, i64 0, i64 %50
  %52 = load ptr, ptr %51, align 8, !tbaa !5
  %53 = getelementptr inbounds %"class.SoLoud::AudioSourceInstance", ptr %52, i32 0, i32 3
  %54 = load i32, ptr %53, align 8, !tbaa !23
  %55 = and i32 %54, -5
  store i32 %55, ptr %53, align 8, !tbaa !23
  br label %56

56:                                               ; preds = %47, %38
  br label %57

57:                                               ; preds = %56, %20
  ret void
}

attributes #0 = { noreturn nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nounwind 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 = { noreturn 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, !13, i64 16}
!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 = !{i8 0, i8 2}
!19 = !{}
!20 = !{!12, !13, i64 138832}
!21 = !{!22, !10, i64 292}
!22 = !{!"_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}
!23 = !{!22, !10, i64 16}


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

@.str = external hidden unnamed_addr constant [14 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [118 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [24 x i8], align 1
@__PRETTY_FUNCTION__._ZN6SoLoud6Soloud22setVoicePause_internalEji = external hidden unnamed_addr constant [63 x i8], align 1

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_ZN6SoLoud6Soloud22setVoicePause_internalEji(ptr nocapture noundef nonnull align 8 dereferenceable(138833) %0, i32 noundef %1, i32 noundef %2) local_unnamed_addr #1 align 2 {
  %4 = icmp ult i32 %1, 1024
  br i1 %4, label %6, label %5

5:                                                ; preds = %3
  tail call void @__assert_fail(ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 51, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN6SoLoud6Soloud22setVoicePause_internalEji) #2
  unreachable

6:                                                ; preds = %3
  %7 = getelementptr inbounds i8, ptr %0, i64 16
  %8 = load i8, ptr %7, align 8, !tbaa !5, !range !16, !noundef !17
  %9 = trunc nuw i8 %8 to i1
  br i1 %9, label %11, label %10

10:                                               ; preds = %6
  tail call void @__assert_fail(ptr noundef nonnull @.str.2, ptr noundef nonnull @.str.1, i32 noundef 52, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN6SoLoud6Soloud22setVoicePause_internalEji) #2
  unreachable

11:                                               ; preds = %6
  %12 = getelementptr inbounds i8, ptr %0, i64 138832
  store i8 1, ptr %12, align 8, !tbaa !18
  %13 = getelementptr inbounds i8, ptr %0, i64 152
  %14 = zext nneg i32 %1 to i64
  %15 = getelementptr inbounds [1024 x ptr], ptr %13, i64 0, i64 %14
  %16 = load ptr, ptr %15, align 8, !tbaa !19
  %.not = icmp eq ptr %16, null
  br i1 %.not, label %21, label %.sink.split

.sink.split:                                      ; preds = %11
  %17 = getelementptr inbounds i8, ptr %16, i64 292
  store i32 0, ptr %17, align 4, !tbaa !20
  %.not7 = icmp eq i32 %2, 0
  %18 = getelementptr inbounds i8, ptr %16, i64 16
  %19 = load i32, ptr %18, align 8, !tbaa !22
  %20 = and i32 %19, -5
  %masksel = select i1 %.not7, i32 0, i32 4
  %.sink = or disjoint i32 %20, %masksel
  store i32 %.sink, ptr %18, align 8, !tbaa !22
  br label %21

21:                                               ; preds = %.sink.split, %11
  ret void
}

attributes #0 = { noreturn nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nounwind 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 = { noreturn 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, !10, i64 16}
!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 = !{i8 0, i8 2}
!17 = !{}
!18 = !{!6, !10, i64 138832}
!19 = !{!7, !7, i64 0}
!20 = !{!21, !11, i64 292}
!21 = !{!"_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}
!22 = !{!21, !11, i64 16}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IPSCCPPass,InstCombinePass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass