; LLVM IR from Overload-Technologies/Overload :: Dependencies/soloud/src/filter (soloud_freeverbfilter)

; 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::FreeverbImpl::Comb" = type { float, float, float, float, ptr, i32, i32 }

; 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 speculatable willreturn memory(none)
declare float @llvm.fmuladd.f32(float, float, float) #1

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

; Function Attrs: mustprogress nounwind uwtable
define dso_local noundef float @_ZN6SoLoud12FreeverbImpl4Comb7processEf(ptr noundef nonnull align 8 dereferenceable(32) %0, float noundef %1) #2 align 2 {
  %3 = alloca ptr, align 8
  %4 = alloca float, align 4
  %5 = alloca float, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  store float %1, ptr %4, align 4, !tbaa !9
  %6 = load ptr, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #3
  %7 = getelementptr inbounds %"class.SoLoud::FreeverbImpl::Comb", ptr %6, i32 0, i32 4
  %8 = load ptr, ptr %7, align 8, !tbaa !11
  %9 = getelementptr inbounds %"class.SoLoud::FreeverbImpl::Comb", ptr %6, i32 0, i32 6
  %10 = load i32, ptr %9, align 4, !tbaa !14
  %11 = sext i32 %10 to i64
  %12 = getelementptr inbounds float, ptr %8, i64 %11
  %13 = load float, ptr %12, align 4, !tbaa !9
  store float %13, ptr %5, align 4, !tbaa !9
  %14 = load float, ptr %5, align 4, !tbaa !9
  %15 = getelementptr inbounds %"class.SoLoud::FreeverbImpl::Comb", ptr %6, i32 0, i32 3
  %16 = load float, ptr %15, align 4, !tbaa !15
  %17 = getelementptr inbounds %"class.SoLoud::FreeverbImpl::Comb", ptr %6, i32 0, i32 1
  %18 = load float, ptr %17, align 4, !tbaa !16
  %19 = getelementptr inbounds %"class.SoLoud::FreeverbImpl::Comb", ptr %6, i32 0, i32 2
  %20 = load float, ptr %19, align 8, !tbaa !17
  %21 = fmul float %18, %20
  %22 = call float @llvm.fmuladd.f32(float %14, float %16, float %21)
  %23 = getelementptr inbounds %"class.SoLoud::FreeverbImpl::Comb", ptr %6, i32 0, i32 1
  store float %22, ptr %23, align 4, !tbaa !16
  %24 = load float, ptr %4, align 4, !tbaa !9
  %25 = getelementptr inbounds %"class.SoLoud::FreeverbImpl::Comb", ptr %6, i32 0, i32 1
  %26 = load float, ptr %25, align 4, !tbaa !16
  %27 = getelementptr inbounds %"class.SoLoud::FreeverbImpl::Comb", ptr %6, i32 0, i32 0
  %28 = load float, ptr %27, align 8, !tbaa !18
  %29 = call float @llvm.fmuladd.f32(float %26, float %28, float %24)
  %30 = getelementptr inbounds %"class.SoLoud::FreeverbImpl::Comb", ptr %6, i32 0, i32 4
  %31 = load ptr, ptr %30, align 8, !tbaa !11
  %32 = getelementptr inbounds %"class.SoLoud::FreeverbImpl::Comb", ptr %6, i32 0, i32 6
  %33 = load i32, ptr %32, align 4, !tbaa !14
  %34 = sext i32 %33 to i64
  %35 = getelementptr inbounds float, ptr %31, i64 %34
  store float %29, ptr %35, align 4, !tbaa !9
  %36 = getelementptr inbounds %"class.SoLoud::FreeverbImpl::Comb", ptr %6, i32 0, i32 6
  %37 = load i32, ptr %36, align 4, !tbaa !14
  %38 = add nsw i32 %37, 1
  store i32 %38, ptr %36, align 4, !tbaa !14
  %39 = getelementptr inbounds %"class.SoLoud::FreeverbImpl::Comb", ptr %6, i32 0, i32 5
  %40 = load i32, ptr %39, align 8, !tbaa !19
  %41 = icmp sge i32 %38, %40
  br i1 %41, label %42, label %44

42:                                               ; preds = %2
  %43 = getelementptr inbounds %"class.SoLoud::FreeverbImpl::Comb", ptr %6, i32 0, i32 6
  store i32 0, ptr %43, align 4, !tbaa !14
  br label %44

44:                                               ; preds = %42, %2
  %45 = load float, ptr %5, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #3
  ret float %45
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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 = { 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 = !{!"float", !7, i64 0}
!11 = !{!12, !6, i64 16}
!12 = !{!"_ZTSN6SoLoud12FreeverbImpl4CombE", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !6, i64 16, !13, i64 24, !13, i64 28}
!13 = !{!"int", !7, i64 0}
!14 = !{!12, !13, i64 28}
!15 = !{!12, !10, i64 12}
!16 = !{!12, !10, i64 4}
!17 = !{!12, !10, i64 8}
!18 = !{!12, !10, i64 0}
!19 = !{!12, !13, i64 24}


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

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare float @llvm.fmuladd.f32(float, float, float) #0

; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(readwrite, inaccessiblemem: none) uwtable
define dso_local noundef float @_ZN6SoLoud12FreeverbImpl4Comb7processEf(ptr nocapture noundef nonnull align 8 dereferenceable(32) %0, float noundef %1) local_unnamed_addr #1 align 2 {
  %3 = getelementptr inbounds i8, ptr %0, i64 16
  %4 = load ptr, ptr %3, align 8, !tbaa !5
  %5 = getelementptr inbounds i8, ptr %0, i64 28
  %6 = load i32, ptr %5, align 4, !tbaa !12
  %7 = sext i32 %6 to i64
  %8 = getelementptr inbounds float, ptr %4, i64 %7
  %9 = load float, ptr %8, align 4, !tbaa !13
  %10 = getelementptr inbounds i8, ptr %0, i64 12
  %11 = load float, ptr %10, align 4, !tbaa !14
  %12 = getelementptr inbounds i8, ptr %0, i64 4
  %13 = load float, ptr %12, align 4, !tbaa !15
  %14 = getelementptr inbounds i8, ptr %0, i64 8
  %15 = load float, ptr %14, align 8, !tbaa !16
  %16 = fmul float %13, %15
  %17 = tail call float @llvm.fmuladd.f32(float %9, float %11, float %16)
  store float %17, ptr %12, align 4, !tbaa !15
  %18 = load float, ptr %0, align 8, !tbaa !17
  %19 = tail call float @llvm.fmuladd.f32(float %17, float %18, float %1)
  store float %19, ptr %8, align 4, !tbaa !13
  %20 = add nsw i32 %6, 1
  %21 = getelementptr inbounds i8, ptr %0, i64 24
  %22 = load i32, ptr %21, align 8, !tbaa !18
  %.not = icmp slt i32 %20, %22
  %spec.store.select = select i1 %.not, i32 %20, i32 0
  store i32 %spec.store.select, ptr %5, align 4
  ret float %9
}

attributes #0 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #1 = { mustprogress nofree norecurse nosync nounwind willreturn memory(readwrite, inaccessiblemem: none) 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" }

!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 = !{!"_ZTSN6SoLoud12FreeverbImpl4CombE", !7, i64 0, !7, i64 4, !7, i64 8, !7, i64 12, !10, i64 16, !11, i64 24, !11, i64 28}
!7 = !{!"float", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!"int", !8, i64 0}
!12 = !{!6, !11, i64 28}
!13 = !{!7, !7, i64 0}
!14 = !{!6, !7, i64 12}
!15 = !{!6, !7, i64 4}
!16 = !{!6, !7, i64 8}
!17 = !{!6, !7, i64 0}
!18 = !{!6, !11, i64 24}


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