; LLVM IR from pms67/HadesFCS :: Firmware/F4Quad/Core/Src (LowPassFilter)

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

%struct.LPFTwoPole = type { float, [2 x float], float, [2 x float] }

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

; Function Attrs: nounwind uwtable
define dso_local float @LPFTwoPole_Update(ptr noundef %0, float noundef %1) #1 {
  %3 = alloca ptr, align 8
  %4 = alloca float, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  store float %1, ptr %4, align 4, !tbaa !9
  %5 = load ptr, ptr %3, align 8, !tbaa !5
  %6 = getelementptr inbounds %struct.LPFTwoPole, ptr %5, i32 0, i32 1
  %7 = getelementptr inbounds [2 x float], ptr %6, i64 0, i64 0
  %8 = load float, ptr %7, align 4, !tbaa !9
  %9 = load ptr, ptr %3, align 8, !tbaa !5
  %10 = getelementptr inbounds %struct.LPFTwoPole, ptr %9, i32 0, i32 1
  %11 = getelementptr inbounds [2 x float], ptr %10, i64 0, i64 1
  store float %8, ptr %11, align 4, !tbaa !9
  %12 = load ptr, ptr %3, align 8, !tbaa !5
  %13 = getelementptr inbounds %struct.LPFTwoPole, ptr %12, i32 0, i32 0
  %14 = load float, ptr %13, align 4, !tbaa !11
  %15 = load ptr, ptr %3, align 8, !tbaa !5
  %16 = getelementptr inbounds %struct.LPFTwoPole, ptr %15, i32 0, i32 1
  %17 = getelementptr inbounds [2 x float], ptr %16, i64 0, i64 0
  store float %14, ptr %17, align 4, !tbaa !9
  %18 = load ptr, ptr %3, align 8, !tbaa !5
  %19 = getelementptr inbounds %struct.LPFTwoPole, ptr %18, i32 0, i32 3
  %20 = getelementptr inbounds [2 x float], ptr %19, i64 0, i64 0
  %21 = load float, ptr %20, align 4, !tbaa !9
  %22 = load ptr, ptr %3, align 8, !tbaa !5
  %23 = getelementptr inbounds %struct.LPFTwoPole, ptr %22, i32 0, i32 2
  %24 = load float, ptr %23, align 4, !tbaa !13
  %25 = load float, ptr %4, align 4, !tbaa !9
  %26 = load ptr, ptr %3, align 8, !tbaa !5
  %27 = getelementptr inbounds %struct.LPFTwoPole, ptr %26, i32 0, i32 3
  %28 = getelementptr inbounds [2 x float], ptr %27, i64 0, i64 1
  %29 = load float, ptr %28, align 4, !tbaa !9
  %30 = load ptr, ptr %3, align 8, !tbaa !5
  %31 = getelementptr inbounds %struct.LPFTwoPole, ptr %30, i32 0, i32 1
  %32 = getelementptr inbounds [2 x float], ptr %31, i64 0, i64 0
  %33 = load float, ptr %32, align 4, !tbaa !9
  %34 = load ptr, ptr %3, align 8, !tbaa !5
  %35 = getelementptr inbounds %struct.LPFTwoPole, ptr %34, i32 0, i32 1
  %36 = getelementptr inbounds [2 x float], ptr %35, i64 0, i64 1
  %37 = load float, ptr %36, align 4, !tbaa !9
  %38 = call float @llvm.fmuladd.f32(float %29, float %33, float %37)
  %39 = fneg float %38
  %40 = call float @llvm.fmuladd.f32(float %24, float %25, float %39)
  %41 = fmul float %21, %40
  %42 = load ptr, ptr %3, align 8, !tbaa !5
  %43 = getelementptr inbounds %struct.LPFTwoPole, ptr %42, i32 0, i32 0
  store float %41, ptr %43, align 4, !tbaa !11
  %44 = load ptr, ptr %3, align 8, !tbaa !5
  %45 = getelementptr inbounds %struct.LPFTwoPole, ptr %44, i32 0, i32 0
  %46 = load float, ptr %45, align 4, !tbaa !11
  ret float %46
}

attributes #0 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #1 = { 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, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"float", !7, i64 0}
!11 = !{!12, !10, i64 0}
!12 = !{!"", !10, i64 0, !7, i64 4, !10, i64 12, !7, i64 16}
!13 = !{!12, !10, i64 12}


; 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(argmem: readwrite) uwtable
define dso_local float @LPFTwoPole_Update(ptr nocapture noundef %0, float noundef %1) local_unnamed_addr #1 {
  %3 = getelementptr inbounds i8, ptr %0, i64 4
  %4 = load <2 x float>, ptr %0, align 4, !tbaa !5
  store <2 x float> %4, ptr %3, align 4, !tbaa !5
  %5 = getelementptr inbounds i8, ptr %0, i64 16
  %6 = load float, ptr %5, align 4, !tbaa !5
  %7 = getelementptr inbounds i8, ptr %0, i64 12
  %8 = load float, ptr %7, align 4, !tbaa !9
  %9 = getelementptr inbounds i8, ptr %0, i64 20
  %10 = load float, ptr %9, align 4, !tbaa !5
  %11 = extractelement <2 x float> %4, i64 0
  %12 = extractelement <2 x float> %4, i64 1
  %13 = tail call float @llvm.fmuladd.f32(float %10, float %11, float %12)
  %14 = fneg float %13
  %15 = tail call float @llvm.fmuladd.f32(float %8, float %1, float %14)
  %16 = fmul float %6, %15
  store float %16, ptr %0, align 4, !tbaa !11
  ret float %16
}

attributes #0 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #1 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) 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, !6, i64 0}
!6 = !{!"float", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !6, i64 12}
!10 = !{!"", !6, i64 0, !7, i64 4, !6, i64 12, !7, i64 16}
!11 = !{!10, !6, i64 0}


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