; 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::FreeverbFilterInstance" = type { %"class.SoLoud::FilterInstance", ptr, ptr }
%"class.SoLoud::FilterInstance" = type { ptr, i32, i32, ptr, ptr }
%"class.SoLoud::FreeverbFilter" = type { %"class.SoLoud::Filter", float, float, float, float }
%"class.SoLoud::Filter" = type { ptr }

@_ZTVN6SoLoud22FreeverbFilterInstanceE = external dso_local unnamed_addr constant { [12 x ptr] }, align 8

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN6SoLoud22FreeverbFilterInstanceC2EPNS_14FreeverbFilterE(ptr noundef nonnull align 8 dereferenceable(48) %0, ptr noundef %1) unnamed_addr #0 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %7 = load ptr, ptr %3, align 8
  call void @_ZN6SoLoud14FilterInstanceC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %7)
  store ptr getelementptr inbounds inrange(-16, 80) ({ [12 x ptr] }, ptr @_ZTVN6SoLoud22FreeverbFilterInstanceE, i32 0, i32 0, i32 2), ptr %7, align 8, !tbaa !9
  %8 = load ptr, ptr %7, align 8, !tbaa !9
  %9 = getelementptr inbounds ptr, ptr %8, i64 0
  %10 = load ptr, ptr %9, align 8
  %11 = invoke noundef i32 %10(ptr noundef nonnull align 8 dereferenceable(32) %7, i32 noundef 5)
          to label %12 unwind label %46

12:                                               ; preds = %2
  %13 = load ptr, ptr %4, align 8, !tbaa !5
  %14 = getelementptr inbounds %"class.SoLoud::FreeverbFilterInstance", ptr %7, i32 0, i32 1
  store ptr %13, ptr %14, align 8, !tbaa !11
  %15 = invoke noalias noundef nonnull ptr @_Znwm(i64 noundef 102552) #5
          to label %16 unwind label %46

16:                                               ; preds = %12
  invoke void @_ZN6SoLoud12FreeverbImpl8RevmodelC1Ev(ptr noundef nonnull align 8 dereferenceable(102552) %15)
          to label %17 unwind label %50

17:                                               ; preds = %16
  %18 = getelementptr inbounds %"class.SoLoud::FreeverbFilterInstance", ptr %7, i32 0, i32 2
  store ptr %15, ptr %18, align 8, !tbaa !15
  %19 = load ptr, ptr %4, align 8, !tbaa !5
  %20 = getelementptr inbounds %"class.SoLoud::FreeverbFilter", ptr %19, i32 0, i32 1
  %21 = load float, ptr %20, align 8, !tbaa !16
  %22 = getelementptr inbounds %"class.SoLoud::FilterInstance", ptr %7, i32 0, i32 3
  %23 = load ptr, ptr %22, align 8, !tbaa !20
  %24 = getelementptr inbounds float, ptr %23, i64 1
  store float %21, ptr %24, align 4, !tbaa !21
  %25 = load ptr, ptr %4, align 8, !tbaa !5
  %26 = getelementptr inbounds %"class.SoLoud::FreeverbFilter", ptr %25, i32 0, i32 2
  %27 = load float, ptr %26, align 4, !tbaa !22
  %28 = getelementptr inbounds %"class.SoLoud::FilterInstance", ptr %7, i32 0, i32 3
  %29 = load ptr, ptr %28, align 8, !tbaa !20
  %30 = getelementptr inbounds float, ptr %29, i64 2
  store float %27, ptr %30, align 4, !tbaa !21
  %31 = load ptr, ptr %4, align 8, !tbaa !5
  %32 = getelementptr inbounds %"class.SoLoud::FreeverbFilter", ptr %31, i32 0, i32 3
  %33 = load float, ptr %32, align 8, !tbaa !23
  %34 = getelementptr inbounds %"class.SoLoud::FilterInstance", ptr %7, i32 0, i32 3
  %35 = load ptr, ptr %34, align 8, !tbaa !20
  %36 = getelementptr inbounds float, ptr %35, i64 3
  store float %33, ptr %36, align 4, !tbaa !21
  %37 = load ptr, ptr %4, align 8, !tbaa !5
  %38 = getelementptr inbounds %"class.SoLoud::FreeverbFilter", ptr %37, i32 0, i32 4
  %39 = load float, ptr %38, align 4, !tbaa !24
  %40 = getelementptr inbounds %"class.SoLoud::FilterInstance", ptr %7, i32 0, i32 3
  %41 = load ptr, ptr %40, align 8, !tbaa !20
  %42 = getelementptr inbounds float, ptr %41, i64 4
  store float %39, ptr %42, align 4, !tbaa !21
  %43 = getelementptr inbounds %"class.SoLoud::FilterInstance", ptr %7, i32 0, i32 3
  %44 = load ptr, ptr %43, align 8, !tbaa !20
  %45 = getelementptr inbounds float, ptr %44, i64 0
  store float 1.000000e+00, ptr %45, align 4, !tbaa !21
  ret void

46:                                               ; preds = %12, %2
  %47 = landingpad { ptr, i32 }
          cleanup
  %48 = extractvalue { ptr, i32 } %47, 0
  store ptr %48, ptr %5, align 8
  %49 = extractvalue { ptr, i32 } %47, 1
  store i32 %49, ptr %6, align 4
  br label %54

50:                                               ; preds = %16
  %51 = landingpad { ptr, i32 }
          cleanup
  %52 = extractvalue { ptr, i32 } %51, 0
  store ptr %52, ptr %5, align 8
  %53 = extractvalue { ptr, i32 } %51, 1
  store i32 %53, ptr %6, align 4
  call void @_ZdlPvm(ptr noundef %15, i64 noundef 102552) #6
  br label %54

54:                                               ; preds = %50, %46
  call void @_ZN6SoLoud14FilterInstanceD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %7) #7
  br label %55

55:                                               ; preds = %54
  %56 = load ptr, ptr %5, align 8
  %57 = load i32, ptr %6, align 4
  %58 = insertvalue { ptr, i32 } poison, ptr %56, 0
  %59 = insertvalue { ptr, i32 } %58, i32 %57, 1
  resume { ptr, i32 } %59
}

declare void @_ZN6SoLoud14FilterInstanceC2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #1

declare i32 @__gxx_personality_v0(...)

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

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

; Function Attrs: nounwind
declare void @_ZN6SoLoud14FilterInstanceD2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #4

declare void @_ZN6SoLoud12FreeverbImpl8RevmodelC1Ev(ptr)

attributes #0 = { 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 #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 = { 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 #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 = { 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 = { builtin allocsize(0) }
attributes #6 = { builtin nounwind }
attributes #7 = { 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 = !{!"vtable pointer", !8, i64 0}
!11 = !{!12, !6, i64 32}
!12 = !{!"_ZTSN6SoLoud22FreeverbFilterInstanceE", !13, i64 0, !6, i64 32, !6, i64 40}
!13 = !{!"_ZTSN6SoLoud14FilterInstanceE", !14, i64 8, !14, i64 12, !6, i64 16, !6, i64 24}
!14 = !{!"int", !7, i64 0}
!15 = !{!12, !6, i64 40}
!16 = !{!17, !19, i64 8}
!17 = !{!"_ZTSN6SoLoud14FreeverbFilterE", !18, i64 0, !19, i64 8, !19, i64 12, !19, i64 16, !19, i64 20}
!18 = !{!"_ZTSN6SoLoud6FilterE"}
!19 = !{!"float", !7, i64 0}
!20 = !{!13, !6, i64 16}
!21 = !{!19, !19, i64 0}
!22 = !{!17, !19, i64 12}
!23 = !{!17, !19, i64 16}
!24 = !{!17, !19, i64 20}


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

@_ZTVN6SoLoud22FreeverbFilterInstanceE = external dso_local unnamed_addr constant { [12 x ptr] }, align 8

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN6SoLoud22FreeverbFilterInstanceC2EPNS_14FreeverbFilterE(ptr noundef nonnull align 8 dereferenceable(48) %0, ptr noundef %1) unnamed_addr #0 align 2 personality ptr @__gxx_personality_v0 {
  tail call void @_ZN6SoLoud14FilterInstanceC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %0)
  store ptr getelementptr inbounds inrange(-16, 80) (i8, ptr @_ZTVN6SoLoud22FreeverbFilterInstanceE, i64 16), ptr %0, align 8, !tbaa !5
  %3 = load ptr, ptr getelementptr inbounds inrange(-16, 80) (i8, ptr @_ZTVN6SoLoud22FreeverbFilterInstanceE, i64 16), align 8
  %4 = invoke noundef i32 %3(ptr noundef nonnull align 8 dereferenceable(32) %0, i32 noundef 5)
          to label %5 unwind label %25

5:                                                ; preds = %2
  %6 = getelementptr inbounds i8, ptr %0, i64 32
  store ptr %1, ptr %6, align 8, !tbaa !8
  %7 = invoke noalias noundef nonnull dereferenceable(102552) ptr @_Znwm(i64 noundef 102552) #5
          to label %8 unwind label %25

8:                                                ; preds = %5
  invoke void @_ZN6SoLoud12FreeverbImpl8RevmodelC1Ev(ptr noundef nonnull align 8 dereferenceable(102552) %7)
          to label %9 unwind label %27

9:                                                ; preds = %8
  %10 = getelementptr inbounds i8, ptr %0, i64 40
  store ptr %7, ptr %10, align 8, !tbaa !14
  %11 = getelementptr inbounds i8, ptr %1, i64 8
  %12 = load float, ptr %11, align 8, !tbaa !15
  %13 = getelementptr inbounds i8, ptr %0, i64 16
  %14 = load ptr, ptr %13, align 8, !tbaa !19
  %15 = getelementptr inbounds i8, ptr %14, i64 4
  store float %12, ptr %15, align 4, !tbaa !20
  %16 = getelementptr inbounds i8, ptr %1, i64 12
  %17 = load float, ptr %16, align 4, !tbaa !21
  %18 = getelementptr inbounds i8, ptr %14, i64 8
  store float %17, ptr %18, align 4, !tbaa !20
  %19 = getelementptr inbounds i8, ptr %1, i64 16
  %20 = load float, ptr %19, align 8, !tbaa !22
  %21 = getelementptr inbounds i8, ptr %14, i64 12
  store float %20, ptr %21, align 4, !tbaa !20
  %22 = getelementptr inbounds i8, ptr %1, i64 20
  %23 = load float, ptr %22, align 4, !tbaa !23
  %24 = getelementptr inbounds i8, ptr %14, i64 16
  store float %23, ptr %24, align 4, !tbaa !20
  store float 1.000000e+00, ptr %14, align 4, !tbaa !20
  ret void

25:                                               ; preds = %5, %2
  %26 = landingpad { ptr, i32 }
          cleanup
  br label %29

27:                                               ; preds = %8
  %28 = landingpad { ptr, i32 }
          cleanup
  tail call void @_ZdlPvm(ptr noundef nonnull %7, i64 noundef 102552) #6
  br label %29

29:                                               ; preds = %27, %25
  %.pn = phi { ptr, i32 } [ %28, %27 ], [ %26, %25 ]
  tail call void @_ZN6SoLoud14FilterInstanceD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %0) #7
  resume { ptr, i32 } %.pn
}

declare void @_ZN6SoLoud14FilterInstanceC2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #1

declare i32 @__gxx_personality_v0(...)

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

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

; Function Attrs: nounwind
declare void @_ZN6SoLoud14FilterInstanceD2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #4

declare void @_ZN6SoLoud12FreeverbImpl8RevmodelC1Ev(ptr) local_unnamed_addr

attributes #0 = { 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 #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 = { 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 #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 = { 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 = { builtin allocsize(0) }
attributes #6 = { builtin nounwind }
attributes #7 = { 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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !13, i64 32}
!9 = !{!"_ZTSN6SoLoud22FreeverbFilterInstanceE", !10, i64 0, !13, i64 32, !13, i64 40}
!10 = !{!"_ZTSN6SoLoud14FilterInstanceE", !11, i64 8, !11, i64 12, !13, i64 16, !13, i64 24}
!11 = !{!"int", !12, i64 0}
!12 = !{!"omnipotent char", !7, i64 0}
!13 = !{!"any pointer", !12, i64 0}
!14 = !{!9, !13, i64 40}
!15 = !{!16, !18, i64 8}
!16 = !{!"_ZTSN6SoLoud14FreeverbFilterE", !17, i64 0, !18, i64 8, !18, i64 12, !18, i64 16, !18, i64 20}
!17 = !{!"_ZTSN6SoLoud6FilterE"}
!18 = !{!"float", !12, i64 0}
!19 = !{!10, !13, i64 16}
!20 = !{!18, !18, i64 0}
!21 = !{!16, !18, i64 12}
!22 = !{!16, !18, i64 16}
!23 = !{!16, !18, i64 20}


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