; LLVM IR from lichen-community-systems/signaletic :: libsignaletic/src (libsignaletic)

; 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.sig_dsp_OnePole = type { %struct.sig_dsp_Signal, %struct.sig_dsp_OnePole_Inputs, %struct.sig_dsp_OnePole_Parameters, %struct.sig_dsp_Signal_SingleMonoOutput, float, float, i32, float, float }
%struct.sig_dsp_Signal = type { ptr, ptr }
%struct.sig_dsp_OnePole_Inputs = type { ptr, ptr }
%struct.sig_dsp_OnePole_Parameters = type { i32 }
%struct.sig_dsp_Signal_SingleMonoOutput = type { ptr }
%struct.sig_AudioSettings = type { float, i64, i64 }

; 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 willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: inlinehint nounwind uwtable
declare dso_local float @sig_filter_onepole_HPF_calculateA1(float noundef, float noundef) #1

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

; Function Attrs: inlinehint nounwind uwtable
declare dso_local float @sig_filter_onepole_LPF_calculateA1(float noundef, float noundef) #1

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

; Function Attrs: inlinehint nounwind uwtable
define dso_local void @sig_dsp_OnePole_recalculateCoefficients(ptr noundef %0, float noundef %1) #1 {
  %3 = alloca ptr, align 8
  %4 = alloca float, align 4
  %5 = alloca float, align 4
  %6 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  store float %1, ptr %4, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #2
  %7 = load ptr, ptr %3, align 8, !tbaa !5
  %8 = getelementptr inbounds %struct.sig_dsp_OnePole, ptr %7, i32 0, i32 0
  %9 = getelementptr inbounds %struct.sig_dsp_Signal, ptr %8, i32 0, i32 0
  %10 = load ptr, ptr %9, align 8, !tbaa !11
  %11 = getelementptr inbounds %struct.sig_AudioSettings, ptr %10, i32 0, i32 0
  %12 = load float, ptr %11, align 8, !tbaa !18
  store float %12, ptr %5, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #2
  %13 = load ptr, ptr %3, align 8, !tbaa !5
  %14 = getelementptr inbounds %struct.sig_dsp_OnePole, ptr %13, i32 0, i32 2
  %15 = getelementptr inbounds %struct.sig_dsp_OnePole_Parameters, ptr %14, i32 0, i32 0
  %16 = load i32, ptr %15, align 8, !tbaa !21
  store i32 %16, ptr %6, align 4, !tbaa !22
  %17 = load float, ptr %4, align 4, !tbaa !9
  %18 = load ptr, ptr %3, align 8, !tbaa !5
  %19 = getelementptr inbounds %struct.sig_dsp_OnePole, ptr %18, i32 0, i32 7
  store float %17, ptr %19, align 4, !tbaa !23
  %20 = load i32, ptr %6, align 4, !tbaa !22
  %21 = load ptr, ptr %3, align 8, !tbaa !5
  %22 = getelementptr inbounds %struct.sig_dsp_OnePole, ptr %21, i32 0, i32 6
  store i32 %20, ptr %22, align 8, !tbaa !24
  %23 = load i32, ptr %6, align 4, !tbaa !22
  %24 = icmp eq i32 %23, 0
  br i1 %24, label %25, label %37

25:                                               ; preds = %2
  %26 = load float, ptr %4, align 4, !tbaa !9
  %27 = load float, ptr %5, align 4, !tbaa !9
  %28 = call float @sig_filter_onepole_HPF_calculateA1(float noundef %26, float noundef %27)
  %29 = load ptr, ptr %3, align 8, !tbaa !5
  %30 = getelementptr inbounds %struct.sig_dsp_OnePole, ptr %29, i32 0, i32 5
  store float %28, ptr %30, align 4, !tbaa !25
  %31 = load ptr, ptr %3, align 8, !tbaa !5
  %32 = getelementptr inbounds %struct.sig_dsp_OnePole, ptr %31, i32 0, i32 5
  %33 = load float, ptr %32, align 4, !tbaa !25
  %34 = call float @sig_filter_onepole_HPF_calculateB0(float noundef %33)
  %35 = load ptr, ptr %3, align 8, !tbaa !5
  %36 = getelementptr inbounds %struct.sig_dsp_OnePole, ptr %35, i32 0, i32 4
  store float %34, ptr %36, align 8, !tbaa !26
  br label %49

37:                                               ; preds = %2
  %38 = load float, ptr %4, align 4, !tbaa !9
  %39 = load float, ptr %5, align 4, !tbaa !9
  %40 = call float @sig_filter_onepole_LPF_calculateA1(float noundef %38, float noundef %39)
  %41 = load ptr, ptr %3, align 8, !tbaa !5
  %42 = getelementptr inbounds %struct.sig_dsp_OnePole, ptr %41, i32 0, i32 5
  store float %40, ptr %42, align 4, !tbaa !25
  %43 = load ptr, ptr %3, align 8, !tbaa !5
  %44 = getelementptr inbounds %struct.sig_dsp_OnePole, ptr %43, i32 0, i32 5
  %45 = load float, ptr %44, align 4, !tbaa !25
  %46 = call float @sig_filter_onepole_LPF_calculateB0(float noundef %45)
  %47 = load ptr, ptr %3, align 8, !tbaa !5
  %48 = getelementptr inbounds %struct.sig_dsp_OnePole, ptr %47, i32 0, i32 4
  store float %46, ptr %48, align 8, !tbaa !26
  br label %49

49:                                               ; preds = %37, %25
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #2
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #2
  ret void
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { inlinehint 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 #2 = { 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/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"float", !7, i64 0}
!11 = !{!12, !6, i64 0}
!12 = !{!"sig_dsp_OnePole", !13, i64 0, !14, i64 16, !15, i64 32, !17, i64 40, !10, i64 48, !10, i64 52, !16, i64 56, !10, i64 60, !10, i64 64}
!13 = !{!"sig_dsp_Signal", !6, i64 0, !6, i64 8}
!14 = !{!"sig_dsp_OnePole_Inputs", !6, i64 0, !6, i64 8}
!15 = !{!"sig_dsp_OnePole_Parameters", !16, i64 0}
!16 = !{!"int", !7, i64 0}
!17 = !{!"sig_dsp_Signal_SingleMonoOutput", !6, i64 0}
!18 = !{!19, !10, i64 0}
!19 = !{!"sig_AudioSettings", !10, i64 0, !20, i64 8, !20, i64 16}
!20 = !{!"long", !7, i64 0}
!21 = !{!12, !16, i64 32}
!22 = !{!16, !16, i64 0}
!23 = !{!12, !10, i64 60}
!24 = !{!12, !16, i64 56}
!25 = !{!12, !10, i64 52}
!26 = !{!12, !10, i64 48}


; 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: inlinehint nounwind uwtable
declare dso_local float @sig_filter_onepole_HPF_calculateA1(float noundef, float noundef) local_unnamed_addr #0

; Function Attrs: inlinehint nounwind uwtable
declare dso_local float @sig_filter_onepole_HPF_calculateB0(float noundef) local_unnamed_addr #0

; Function Attrs: inlinehint nounwind uwtable
declare dso_local float @sig_filter_onepole_LPF_calculateA1(float noundef, float noundef) local_unnamed_addr #0

; Function Attrs: inlinehint nounwind uwtable
declare dso_local float @sig_filter_onepole_LPF_calculateB0(float noundef) local_unnamed_addr #0

; Function Attrs: inlinehint nounwind uwtable
define dso_local void @sig_dsp_OnePole_recalculateCoefficients(ptr nocapture noundef %0, float noundef %1) local_unnamed_addr #0 {
  %3 = load ptr, ptr %0, align 8, !tbaa !5
  %4 = load float, ptr %3, align 8, !tbaa !16
  %5 = getelementptr inbounds i8, ptr %0, i64 32
  %6 = load i32, ptr %5, align 8, !tbaa !19
  %7 = getelementptr inbounds i8, ptr %0, i64 60
  store float %1, ptr %7, align 4, !tbaa !20
  %8 = getelementptr inbounds i8, ptr %0, i64 56
  store i32 %6, ptr %8, align 8, !tbaa !21
  %9 = icmp eq i32 %6, 0
  %10 = getelementptr inbounds i8, ptr %0, i64 52
  br i1 %9, label %11, label %14

11:                                               ; preds = %2
  %12 = tail call float @sig_filter_onepole_HPF_calculateA1(float noundef %1, float noundef %4)
  store float %12, ptr %10, align 4, !tbaa !22
  %13 = tail call float @sig_filter_onepole_HPF_calculateB0(float noundef %12)
  br label %17

14:                                               ; preds = %2
  %15 = tail call float @sig_filter_onepole_LPF_calculateA1(float noundef %1, float noundef %4)
  store float %15, ptr %10, align 4, !tbaa !22
  %16 = tail call float @sig_filter_onepole_LPF_calculateB0(float noundef %15)
  br label %17

17:                                               ; preds = %14, %11
  %.sink = phi float [ %13, %11 ], [ %16, %14 ]
  %18 = getelementptr inbounds i8, ptr %0, i64 48
  store float %.sink, ptr %18, align 8
  ret void
}

attributes #0 = { inlinehint 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, !8, i64 0}
!6 = !{!"sig_dsp_OnePole", !7, i64 0, !11, i64 16, !12, i64 32, !14, i64 40, !15, i64 48, !15, i64 52, !13, i64 56, !15, i64 60, !15, i64 64}
!7 = !{!"sig_dsp_Signal", !8, i64 0, !8, i64 8}
!8 = !{!"any pointer", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C/C++ TBAA"}
!11 = !{!"sig_dsp_OnePole_Inputs", !8, i64 0, !8, i64 8}
!12 = !{!"sig_dsp_OnePole_Parameters", !13, i64 0}
!13 = !{!"int", !9, i64 0}
!14 = !{!"sig_dsp_Signal_SingleMonoOutput", !8, i64 0}
!15 = !{!"float", !9, i64 0}
!16 = !{!17, !15, i64 0}
!17 = !{!"sig_AudioSettings", !15, i64 0, !18, i64 8, !18, i64 16}
!18 = !{!"long", !9, i64 0}
!19 = !{!6, !13, i64 32}
!20 = !{!6, !15, i64 60}
!21 = !{!6, !13, i64 56}
!22 = !{!6, !15, i64 52}


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