; LLVM IR from Try/Tempest :: Engine/thirdparty/openal-soft/core/mixer (mixer_sse)

; 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.al::span.0" = type { ptr, i64 }
%"class.al::span" = type { ptr, i64 }
%"class.al::ptr_wrapper" = type { ptr }
%class.anon.8 = type { ptr, ptr, %"class.al::span", i32, %"class.al::span", i64 }
%struct.BsincState = type { float, i32, i32, %"class.al::span" }

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write)
declare void @llvm.assume(i1 noundef) #0

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNK2al4spanIfLm18446744073709551615EE5beginEv(ptr noundef nonnull align 8 dereferenceable(16)) #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNK2al4spanIfLm18446744073709551615EE3endEv(ptr noundef nonnull align 8 dereferenceable(16)) #3 align 2

; 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 nonnull align 8 dereferenceable(32) ptr @_ZSt3getI10BsincStateJSt9monostate10CubicStateS0_EERKT_RKSt7variantIJDpT0_EE(ptr noundef nonnull align 8 dereferenceable(33)) #4

; Function Attrs: mustprogress nounwind uwtable
declare dso_local { ptr, i64 } @_ZNK2al4spanIKfLm18446744073709551615EE5firstEm(ptr noundef nonnull align 8 dereferenceable(16), i64 noundef) #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_Zli3_uzy(i64 noundef) #3

; Function Attrs: mustprogress uwtable
define dso_local void @_Z9Resample_I12FastBSincTag6SSETagEvPKSt7variantIJSt9monostate10CubicState10BsincStateEEN2al4spanIKfLm18446744073709551615EEEjjNSA_IfLm18446744073709551615EEE(ptr noundef %0, ptr %1, i64 %2, i32 noundef %3, i32 noundef %4, ptr noundef byval(%"class.al::span.0") align 8 %5) #4 {
  %7 = alloca %"class.al::span", align 8
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca ptr, align 8
  %12 = alloca i64, align 8
  %13 = alloca %"class.al::span", align 8
  %14 = alloca i64, align 8
  %15 = alloca %"class.al::ptr_wrapper", align 8
  %16 = alloca %"class.al::ptr_wrapper", align 8
  %17 = alloca %class.anon.8, align 8
  %18 = getelementptr inbounds { ptr, i64 }, ptr %7, i32 0, i32 0
  store ptr %1, ptr %18, align 8
  %19 = getelementptr inbounds { ptr, i64 }, ptr %7, i32 0, i32 1
  store i64 %2, ptr %19, align 8
  store ptr %0, ptr %8, align 8, !tbaa !5
  store i32 %3, ptr %9, align 4, !tbaa !9
  store i32 %4, ptr %10, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  %20 = load ptr, ptr %8, align 8, !tbaa !5
  %21 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZSt3getI10BsincStateJSt9monostate10CubicStateS0_EERKT_RKSt7variantIJDpT0_EE(ptr noundef nonnull align 8 dereferenceable(33) %20)
  store ptr %21, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  %22 = load ptr, ptr %11, align 8, !tbaa !5
  %23 = getelementptr inbounds %struct.BsincState, ptr %22, i32 0, i32 1
  %24 = load i32, ptr %23, align 4, !tbaa !11
  %25 = zext i32 %24 to i64
  store i64 %25, ptr %12, align 8, !tbaa !16
  %26 = load i64, ptr %12, align 8, !tbaa !16
  %27 = icmp ugt i64 %26, 0
  call void @llvm.assume(i1 %27)
  %28 = load i64, ptr %12, align 8, !tbaa !16
  %29 = icmp ule i64 %28, 48
  call void @llvm.assume(i1 %29)
  %30 = load i32, ptr %9, align 4, !tbaa !9
  %31 = icmp ult i32 %30, 65536
  call void @llvm.assume(i1 %31)
  call void @llvm.lifetime.start.p0(i64 16, ptr %13) #5
  %32 = load ptr, ptr %11, align 8, !tbaa !5
  %33 = getelementptr inbounds %struct.BsincState, ptr %32, i32 0, i32 3
  %34 = call noundef i64 @_Zli3_uzy(i64 noundef 2) #5
  %35 = load i64, ptr %12, align 8, !tbaa !16
  %36 = mul i64 %34, %35
  %37 = mul i64 %36, 32
  %38 = call { ptr, i64 } @_ZNK2al4spanIKfLm18446744073709551615EE5firstEm(ptr noundef nonnull align 8 dereferenceable(16) %33, i64 noundef %37) #5
  %39 = getelementptr inbounds { ptr, i64 }, ptr %13, i32 0, i32 0
  %40 = extractvalue { ptr, i64 } %38, 0
  store ptr %40, ptr %39, align 8
  %41 = getelementptr inbounds { ptr, i64 }, ptr %13, i32 0, i32 1
  %42 = extractvalue { ptr, i64 } %38, 1
  store i64 %42, ptr %41, align 8
  %43 = load ptr, ptr %11, align 8, !tbaa !5
  %44 = getelementptr inbounds %struct.BsincState, ptr %43, i32 0, i32 2
  %45 = load i32, ptr %44, align 8, !tbaa !17
  %46 = icmp ule i32 %45, 24
  call void @llvm.assume(i1 %46)
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #5
  %47 = load ptr, ptr %11, align 8, !tbaa !5
  %48 = getelementptr inbounds %struct.BsincState, ptr %47, i32 0, i32 2
  %49 = load i32, ptr %48, align 8, !tbaa !17
  %50 = sub i32 24, %49
  %51 = zext i32 %50 to i64
  store i64 %51, ptr %14, align 8, !tbaa !16
  %52 = call ptr @_ZNK2al4spanIfLm18446744073709551615EE5beginEv(ptr noundef nonnull align 8 dereferenceable(16) %5) #5
  %53 = getelementptr inbounds %"class.al::ptr_wrapper", ptr %15, i32 0, i32 0
  store ptr %52, ptr %53, align 8
  %54 = call ptr @_ZNK2al4spanIfLm18446744073709551615EE3endEv(ptr noundef nonnull align 8 dereferenceable(16) %5) #5
  %55 = getelementptr inbounds %"class.al::ptr_wrapper", ptr %16, i32 0, i32 0
  store ptr %54, ptr %55, align 8
  %56 = getelementptr inbounds %class.anon.8, ptr %17, i32 0, i32 0
  store ptr %14, ptr %56, align 8, !tbaa !5
  %57 = getelementptr inbounds %class.anon.8, ptr %17, i32 0, i32 1
  store ptr %9, ptr %57, align 8, !tbaa !5
  %58 = getelementptr inbounds %class.anon.8, ptr %17, i32 0, i32 2
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %58, ptr align 8 %7, i64 16, i1 false), !tbaa.struct !18
  %59 = getelementptr inbounds %class.anon.8, ptr %17, i32 0, i32 3
  %60 = load i32, ptr %10, align 4, !tbaa !9
  store i32 %60, ptr %59, align 8, !tbaa !19
  %61 = getelementptr inbounds %class.anon.8, ptr %17, i32 0, i32 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %61, ptr align 8 %13, i64 16, i1 false), !tbaa.struct !18
  %62 = getelementptr inbounds %class.anon.8, ptr %17, i32 0, i32 5
  %63 = load i64, ptr %12, align 8, !tbaa !16
  store i64 %63, ptr %62, align 8, !tbaa !21
  %64 = getelementptr inbounds %"class.al::ptr_wrapper", ptr %15, i32 0, i32 0
  %65 = load ptr, ptr %64, align 8
  %66 = getelementptr inbounds %"class.al::ptr_wrapper", ptr %16, i32 0, i32 0
  %67 = load ptr, ptr %66, align 8
  call void @"_ZSt8generateIN2al11ptr_wrapperIPfEEZ9Resample_I12FastBSincTag6SSETagEvPKSt7variantIJSt9monostate10CubicState10BsincStateEENS0_4spanIKfLm18446744073709551615EEEjjNSE_IfLm18446744073709551615EEEE3$_0EvT_SJ_T0_"(ptr %65, ptr %67, ptr noundef byval(%class.anon.8) align 8 %17)
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  ret void
}

; Function Attrs: mustprogress uwtable
declare hidden void @"_ZSt8generateIN2al11ptr_wrapperIPfEEZ9Resample_I12FastBSincTag6SSETagEvPKSt7variantIJSt9monostate10CubicState10BsincStateEENS0_4spanIKfLm18446744073709551615EEEjjNSE_IfLm18446744073709551615EEEE3$_0EvT_SJ_T0_"(ptr, ptr, ptr noundef byval(%class.anon.8) align 8) #4

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write) }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { 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 #4 = { 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 #5 = { 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 4}
!12 = !{!"_ZTS10BsincState", !13, i64 0, !10, i64 4, !10, i64 8, !14, i64 16}
!13 = !{!"float", !7, i64 0}
!14 = !{!"_ZTSN2al4spanIKfLm18446744073709551615EEE", !6, i64 0, !15, i64 8}
!15 = !{!"long", !7, i64 0}
!16 = !{!15, !15, i64 0}
!17 = !{!12, !10, i64 8}
!18 = !{i64 0, i64 8, !5, i64 8, i64 8, !16}
!19 = !{!20, !10, i64 32}
!20 = !{!"_ZTSZ9Resample_I12FastBSincTag6SSETagEvPKSt7variantIJSt9monostate10CubicState10BsincStateEEN2al4spanIKfLm18446744073709551615EEEjjNSA_IfLm18446744073709551615EEEE3$_0", !6, i64 0, !6, i64 8, !14, i64 16, !10, i64 32, !14, i64 40, !15, i64 56}
!21 = !{!20, !15, i64 56}


; 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.al::span.0" = type { ptr, i64 }
%class.anon.8 = type { ptr, ptr, %"class.al::span", i32, %"class.al::span", i64 }
%"class.al::span" = type { ptr, i64 }

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write)
declare void @llvm.assume(i1 noundef) #0

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNK2al4spanIfLm18446744073709551615EE5beginEv(ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNK2al4spanIfLm18446744073709551615EE3endEv(ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress 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 nonnull align 8 dereferenceable(32) ptr @_ZSt3getI10BsincStateJSt9monostate10CubicStateS0_EERKT_RKSt7variantIJDpT0_EE(ptr noundef nonnull align 8 dereferenceable(33)) local_unnamed_addr #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local { ptr, i64 } @_ZNK2al4spanIKfLm18446744073709551615EE5firstEm(ptr noundef nonnull align 8 dereferenceable(16), i64 noundef) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_Zli3_uzy(i64 noundef) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
define dso_local void @_Z9Resample_I12FastBSincTag6SSETagEvPKSt7variantIJSt9monostate10CubicState10BsincStateEEN2al4spanIKfLm18446744073709551615EEEjjNSA_IfLm18446744073709551615EEE(ptr noundef nonnull %0, ptr %1, i64 %2, i32 noundef %3, i32 noundef %4, ptr noundef byval(%"class.al::span.0") align 8 %5) local_unnamed_addr #3 {
  %7 = alloca i32, align 4
  %8 = alloca i64, align 8
  %9 = alloca %class.anon.8, align 8
  store i32 %3, ptr %7, align 4, !tbaa !5
  %10 = tail call noundef nonnull align 8 dereferenceable(32) ptr @_ZSt3getI10BsincStateJSt9monostate10CubicStateS0_EERKT_RKSt7variantIJDpT0_EE(ptr noundef nonnull align 8 dereferenceable(33) %0)
  %11 = getelementptr inbounds i8, ptr %10, i64 4
  %12 = load i32, ptr %11, align 4, !tbaa !9
  %13 = zext nneg i32 %12 to i64
  %14 = icmp ne i32 %12, 0
  tail call void @llvm.assume(i1 %14)
  %15 = icmp ult i32 %12, 49
  tail call void @llvm.assume(i1 %15)
  %16 = icmp ult i32 %3, 65536
  tail call void @llvm.assume(i1 %16)
  %17 = getelementptr inbounds i8, ptr %10, i64 16
  %18 = tail call noundef i64 @_Zli3_uzy(i64 noundef 2) #4
  %19 = shl nuw nsw i64 %13, 5
  %20 = mul i64 %19, %18
  %21 = tail call { ptr, i64 } @_ZNK2al4spanIKfLm18446744073709551615EE5firstEm(ptr noundef nonnull align 8 dereferenceable(16) %17, i64 noundef %20) #4
  %22 = extractvalue { ptr, i64 } %21, 0
  %23 = extractvalue { ptr, i64 } %21, 1
  %24 = getelementptr inbounds i8, ptr %10, i64 8
  %25 = load i32, ptr %24, align 8, !tbaa !15
  %26 = icmp ult i32 %25, 25
  tail call void @llvm.assume(i1 %26)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #4
  %27 = sub nuw nsw i32 24, %25
  %28 = zext nneg i32 %27 to i64
  store i64 %28, ptr %8, align 8, !tbaa !16
  %29 = call ptr @_ZNK2al4spanIfLm18446744073709551615EE5beginEv(ptr noundef nonnull align 8 dereferenceable(16) %5) #4
  %30 = call ptr @_ZNK2al4spanIfLm18446744073709551615EE3endEv(ptr noundef nonnull align 8 dereferenceable(16) %5) #4
  store ptr %8, ptr %9, align 8, !tbaa !17
  %31 = getelementptr inbounds i8, ptr %9, i64 8
  store ptr %7, ptr %31, align 8, !tbaa !17
  %32 = getelementptr inbounds i8, ptr %9, i64 16
  store ptr %1, ptr %32, align 8, !tbaa !17
  %.sroa.2.0..sroa_idx = getelementptr inbounds i8, ptr %9, i64 24
  store i64 %2, ptr %.sroa.2.0..sroa_idx, align 8, !tbaa !16
  %33 = getelementptr inbounds i8, ptr %9, i64 32
  store i32 %4, ptr %33, align 8, !tbaa !18
  %34 = getelementptr inbounds i8, ptr %9, i64 40
  store ptr %22, ptr %34, align 8, !tbaa !17
  %.sroa.4.0..sroa_idx = getelementptr inbounds i8, ptr %9, i64 48
  store i64 %23, ptr %.sroa.4.0..sroa_idx, align 8, !tbaa !16
  %35 = getelementptr inbounds i8, ptr %9, i64 56
  store i64 %13, ptr %35, align 8, !tbaa !20
  call void @"_ZSt8generateIN2al11ptr_wrapperIPfEEZ9Resample_I12FastBSincTag6SSETagEvPKSt7variantIJSt9monostate10CubicState10BsincStateEENS0_4spanIKfLm18446744073709551615EEEjjNSE_IfLm18446744073709551615EEEE3$_0EvT_SJ_T0_"(ptr %29, ptr %30, ptr noundef nonnull byval(%class.anon.8) align 8 %9)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #4
  ret void
}

; Function Attrs: mustprogress uwtable
declare hidden void @"_ZSt8generateIN2al11ptr_wrapperIPfEEZ9Resample_I12FastBSincTag6SSETagEvPKSt7variantIJSt9monostate10CubicState10BsincStateEENS0_4spanIKfLm18446744073709551615EEEjjNSE_IfLm18446744073709551615EEEE3$_0EvT_SJ_T0_"(ptr, ptr, ptr noundef byval(%class.anon.8) align 8) local_unnamed_addr #3

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write) }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #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 = { 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !6, i64 4}
!10 = !{!"_ZTS10BsincState", !11, i64 0, !6, i64 4, !6, i64 8, !12, i64 16}
!11 = !{!"float", !7, i64 0}
!12 = !{!"_ZTSN2al4spanIKfLm18446744073709551615EEE", !13, i64 0, !14, i64 8}
!13 = !{!"any pointer", !7, i64 0}
!14 = !{!"long", !7, i64 0}
!15 = !{!10, !6, i64 8}
!16 = !{!14, !14, i64 0}
!17 = !{!13, !13, i64 0}
!18 = !{!19, !6, i64 32}
!19 = !{!"_ZTSZ9Resample_I12FastBSincTag6SSETagEvPKSt7variantIJSt9monostate10CubicState10BsincStateEEN2al4spanIKfLm18446744073709551615EEEjjNSA_IfLm18446744073709551615EEEE3$_0", !13, i64 0, !13, i64 8, !12, i64 16, !6, i64 32, !12, i64 40, !14, i64 56}
!20 = !{!19, !14, i64 56}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,TailCallElimPass