; 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_Dust_Parameters = type { float }
%struct.sig_dsp_Dust = type { %struct.sig_dsp_Signal, %struct.sig_dsp_Dust_Inputs, %struct.sig_dsp_Dust_Parameters, %struct.sig_dsp_Signal_SingleMonoOutput, float, float, float, float }
%struct.sig_dsp_Signal = type { ptr, ptr }
%struct.sig_dsp_Dust_Inputs = type { ptr }
%struct.sig_dsp_Signal_SingleMonoOutput = type { ptr }
%struct.sig_SignalContext = type { ptr, ptr, ptr, ptr, ptr }
%struct.sig_AudioSettings = type { float, i64, i64 }
%struct.sig_dsp_ConstantValue = type { %struct.sig_dsp_Signal, %struct.sig_dsp_Signal_SingleMonoOutput }

; 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: nounwind uwtable
declare dso_local void @sig_dsp_Signal_init(ptr noundef, ptr noundef, ptr noundef) #1

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #2

; Function Attrs: nounwind uwtable
define dso_local void @sig_dsp_Dust_init(ptr noundef %0, ptr noundef %1) #1 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca %struct.sig_dsp_Dust_Parameters, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %6 = load ptr, ptr %3, align 8, !tbaa !5
  %7 = load ptr, ptr %4, align 8, !tbaa !5
  call void @sig_dsp_Signal_init(ptr noundef %6, ptr noundef %7, ptr noundef @sig_dsp_Dust_generate)
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #4
  call void @llvm.memset.p0.i64(ptr align 4 %5, i8 0, i64 4, i1 false)
  %8 = load ptr, ptr %3, align 8, !tbaa !5
  %9 = getelementptr inbounds %struct.sig_dsp_Dust, ptr %8, i32 0, i32 2
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %9, ptr align 4 %5, i64 4, i1 false), !tbaa.struct !9
  %10 = load ptr, ptr %4, align 8, !tbaa !5
  %11 = getelementptr inbounds %struct.sig_SignalContext, ptr %10, i32 0, i32 0
  %12 = load ptr, ptr %11, align 8, !tbaa !12
  %13 = getelementptr inbounds %struct.sig_AudioSettings, ptr %12, i32 0, i32 0
  %14 = load float, ptr %13, align 8, !tbaa !14
  %15 = fpext float %14 to double
  %16 = fdiv double 1.000000e+00, %15
  %17 = fptrunc double %16 to float
  %18 = load ptr, ptr %3, align 8, !tbaa !5
  %19 = getelementptr inbounds %struct.sig_dsp_Dust, ptr %18, i32 0, i32 4
  store float %17, ptr %19, align 8, !tbaa !17
  %20 = load ptr, ptr %3, align 8, !tbaa !5
  %21 = getelementptr inbounds %struct.sig_dsp_Dust, ptr %20, i32 0, i32 5
  store float 0.000000e+00, ptr %21, align 4, !tbaa !23
  %22 = load ptr, ptr %3, align 8, !tbaa !5
  %23 = getelementptr inbounds %struct.sig_dsp_Dust, ptr %22, i32 0, i32 6
  store float 0.000000e+00, ptr %23, align 8, !tbaa !24
  %24 = load ptr, ptr %4, align 8, !tbaa !5
  %25 = getelementptr inbounds %struct.sig_SignalContext, ptr %24, i32 0, i32 3
  %26 = load ptr, ptr %25, align 8, !tbaa !25
  %27 = getelementptr inbounds %struct.sig_dsp_ConstantValue, ptr %26, i32 0, i32 1
  %28 = getelementptr inbounds %struct.sig_dsp_Signal_SingleMonoOutput, ptr %27, i32 0, i32 0
  %29 = load ptr, ptr %28, align 8, !tbaa !26
  %30 = load ptr, ptr %3, align 8, !tbaa !5
  %31 = getelementptr inbounds %struct.sig_dsp_Dust, ptr %30, i32 0, i32 1
  %32 = getelementptr inbounds %struct.sig_dsp_Dust_Inputs, ptr %31, i32 0, i32 0
  store ptr %29, ptr %32, align 8, !tbaa !28
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #4
  ret void
}

; Function Attrs: nounwind uwtable
declare dso_local void @sig_dsp_Dust_generate(ptr noundef) #1

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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" }
attributes #2 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { 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 = !{i64 0, i64 4, !10}
!10 = !{!11, !11, i64 0}
!11 = !{!"float", !7, i64 0}
!12 = !{!13, !6, i64 0}
!13 = !{!"sig_SignalContext", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32}
!14 = !{!15, !11, i64 0}
!15 = !{!"sig_AudioSettings", !11, i64 0, !16, i64 8, !16, i64 16}
!16 = !{!"long", !7, i64 0}
!17 = !{!18, !11, i64 40}
!18 = !{!"sig_dsp_Dust", !19, i64 0, !20, i64 16, !21, i64 24, !22, i64 32, !11, i64 40, !11, i64 44, !11, i64 48, !11, i64 52}
!19 = !{!"sig_dsp_Signal", !6, i64 0, !6, i64 8}
!20 = !{!"sig_dsp_Dust_Inputs", !6, i64 0}
!21 = !{!"sig_dsp_Dust_Parameters", !11, i64 0}
!22 = !{!"sig_dsp_Signal_SingleMonoOutput", !6, i64 0}
!23 = !{!18, !11, i64 44}
!24 = !{!18, !11, i64 48}
!25 = !{!13, !6, i64 24}
!26 = !{!27, !6, i64 16}
!27 = !{!"sig_dsp_ConstantValue", !19, i64 0, !22, i64 16}
!28 = !{!18, !6, i64 16}


; 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: nounwind uwtable
declare dso_local void @sig_dsp_Signal_init(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
define dso_local void @sig_dsp_Dust_init(ptr noundef %0, ptr noundef %1) local_unnamed_addr #0 {
  tail call void @sig_dsp_Signal_init(ptr noundef %0, ptr noundef %1, ptr noundef nonnull @sig_dsp_Dust_generate)
  %3 = getelementptr inbounds i8, ptr %0, i64 24
  store float 0.000000e+00, ptr %3, align 8, !tbaa !5
  %4 = load ptr, ptr %1, align 8, !tbaa !9
  %5 = load float, ptr %4, align 8, !tbaa !12
  %6 = fdiv float 1.000000e+00, %5
  %7 = getelementptr inbounds i8, ptr %0, i64 40
  store float %6, ptr %7, align 8, !tbaa !15
  %8 = getelementptr inbounds i8, ptr %0, i64 44
  store <2 x float> zeroinitializer, ptr %8, align 4, !tbaa !5
  %9 = getelementptr inbounds i8, ptr %1, i64 24
  %10 = load ptr, ptr %9, align 8, !tbaa !21
  %11 = getelementptr inbounds i8, ptr %10, i64 16
  %12 = load ptr, ptr %11, align 8, !tbaa !22
  %13 = getelementptr inbounds i8, ptr %0, i64 16
  store ptr %12, ptr %13, align 8, !tbaa !24
  ret void
}

; Function Attrs: nounwind uwtable
declare dso_local void @sig_dsp_Dust_generate(ptr noundef) #0

attributes #0 = { 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 = !{!"float", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !11, i64 0}
!10 = !{!"sig_SignalContext", !11, i64 0, !11, i64 8, !11, i64 16, !11, i64 24, !11, i64 32}
!11 = !{!"any pointer", !7, i64 0}
!12 = !{!13, !6, i64 0}
!13 = !{!"sig_AudioSettings", !6, i64 0, !14, i64 8, !14, i64 16}
!14 = !{!"long", !7, i64 0}
!15 = !{!16, !6, i64 40}
!16 = !{!"sig_dsp_Dust", !17, i64 0, !18, i64 16, !19, i64 24, !20, i64 32, !6, i64 40, !6, i64 44, !6, i64 48, !6, i64 52}
!17 = !{!"sig_dsp_Signal", !11, i64 0, !11, i64 8}
!18 = !{!"sig_dsp_Dust_Inputs", !11, i64 0}
!19 = !{!"sig_dsp_Dust_Parameters", !6, i64 0}
!20 = !{!"sig_dsp_Signal_SingleMonoOutput", !11, i64 0}
!21 = !{!10, !11, i64 24}
!22 = !{!23, !11, i64 16}
!23 = !{!"sig_dsp_ConstantValue", !17, i64 0, !20, i64 16}
!24 = !{!16, !11, i64 16}


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