; LLVM IR from Overload-Technologies/Overload :: Dependencies/soloud/src/audiosource/speech (resonator)

; 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.resonator = type { float, float, float, float, float }

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN9resonator13initResonatorEiii(ptr noundef nonnull align 4 dereferenceable(20) %0, i32 noundef %1, i32 noundef %2, i32 noundef %3) #0 align 2 {
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca float, align 4
  %10 = alloca float, align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  store i32 %1, ptr %6, align 4, !tbaa !9
  store i32 %2, ptr %7, align 4, !tbaa !9
  store i32 %3, ptr %8, align 4, !tbaa !9
  %11 = load ptr, ptr %5, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #3
  %12 = load i32, ptr %8, align 4, !tbaa !9
  %13 = sitofp i32 %12 to float
  %14 = fdiv float 0xC00921FB60000000, %13
  %15 = load i32, ptr %7, align 4, !tbaa !9
  %16 = sitofp i32 %15 to float
  %17 = fmul float %14, %16
  store float %17, ptr %9, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #3
  %18 = load float, ptr %9, align 4, !tbaa !11
  %19 = call noundef float @_ZSt3expf(float noundef %18)
  store float %19, ptr %10, align 4, !tbaa !11
  %20 = load float, ptr %10, align 4, !tbaa !11
  %21 = load float, ptr %10, align 4, !tbaa !11
  %22 = fmul float %20, %21
  %23 = fneg float %22
  %24 = getelementptr inbounds %class.resonator, ptr %11, i32 0, i32 2
  store float %23, ptr %24, align 4, !tbaa !13
  %25 = load i32, ptr %8, align 4, !tbaa !9
  %26 = sitofp i32 %25 to float
  %27 = fdiv float 0xC01921FB60000000, %26
  %28 = load i32, ptr %6, align 4, !tbaa !9
  %29 = sitofp i32 %28 to float
  %30 = fmul float %27, %29
  store float %30, ptr %9, align 4, !tbaa !11
  %31 = load float, ptr %10, align 4, !tbaa !11
  %32 = load float, ptr %9, align 4, !tbaa !11
  %33 = call noundef float @_ZSt3cosf(float noundef %32)
  %34 = fmul float %31, %33
  %35 = fmul float %34, 2.000000e+00
  %36 = getelementptr inbounds %class.resonator, ptr %11, i32 0, i32 1
  store float %35, ptr %36, align 4, !tbaa !15
  %37 = getelementptr inbounds %class.resonator, ptr %11, i32 0, i32 1
  %38 = load float, ptr %37, align 4, !tbaa !15
  %39 = fsub float 1.000000e+00, %38
  %40 = getelementptr inbounds %class.resonator, ptr %11, i32 0, i32 2
  %41 = load float, ptr %40, align 4, !tbaa !13
  %42 = fsub float %39, %41
  %43 = getelementptr inbounds %class.resonator, ptr %11, i32 0, i32 0
  store float %42, ptr %43, align 4, !tbaa !16
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #3
  ret void
}

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef float @_ZSt3expf(float noundef) #2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef float @_ZSt3cosf(float noundef) #2

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

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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { inlinehint 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 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"float", !7, i64 0}
!13 = !{!14, !12, i64 8}
!14 = !{!"_ZTS9resonator", !12, i64 0, !12, i64 4, !12, i64 8, !12, i64 12, !12, i64 16}
!15 = !{!14, !12, i64 4}
!16 = !{!14, !12, i64 0}


; 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 nounwind uwtable
define dso_local void @_ZN9resonator13initResonatorEiii(ptr nocapture noundef nonnull align 4 dereferenceable(20) %0, i32 noundef %1, i32 noundef %2, i32 noundef %3) local_unnamed_addr #0 align 2 {
  %5 = sitofp i32 %3 to float
  %6 = fdiv float 0xC00921FB60000000, %5
  %7 = sitofp i32 %2 to float
  %8 = fmul float %6, %7
  %9 = tail call noundef float @_ZSt3expf(float noundef %8)
  %10 = fneg float %9
  %11 = fmul float %9, %10
  %12 = getelementptr inbounds i8, ptr %0, i64 8
  store float %11, ptr %12, align 4, !tbaa !5
  %13 = fdiv float 0xC01921FB60000000, %5
  %14 = sitofp i32 %1 to float
  %15 = fmul float %13, %14
  %16 = tail call noundef float @_ZSt3cosf(float noundef %15)
  %17 = fmul float %9, %16
  %18 = fmul float %17, 2.000000e+00
  %19 = getelementptr inbounds i8, ptr %0, i64 4
  store float %18, ptr %19, align 4, !tbaa !10
  %20 = fsub float 1.000000e+00, %18
  %21 = load float, ptr %12, align 4, !tbaa !5
  %22 = fsub float %20, %21
  store float %22, ptr %0, align 4, !tbaa !11
  ret void
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef float @_ZSt3expf(float noundef) local_unnamed_addr #1

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef float @_ZSt3cosf(float noundef) local_unnamed_addr #1

attributes #0 = { 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 #1 = { inlinehint 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" }

!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, !7, i64 8}
!6 = !{!"_ZTS9resonator", !7, i64 0, !7, i64 4, !7, i64 8, !7, i64 12, !7, i64 16}
!7 = !{!"float", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!6, !7, i64 4}
!11 = !{!6, !7, i64 0}


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