; LLVM IR from lichen-community-systems/signaletic :: hosts/daisy/src (signaletic-host)

; 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_host_FilteredCVIn = type { %struct.sig_dsp_Signal, %struct.sig_host_FilteredCVIn_Parameters, %struct.sig_dsp_Signal_SingleMonoOutput, ptr, ptr, ptr }
%struct.sig_dsp_Signal = type { ptr, ptr }
%struct.sig_host_FilteredCVIn_Parameters = type { float, float, i32, float }
%struct.sig_dsp_Signal_SingleMonoOutput = type { ptr }
%struct.sig_host_CVIn = type { %struct.sig_dsp_Signal, %struct.sig_host_CV_Parameters, %struct.sig_dsp_Signal_SingleMonoOutput, ptr }
%struct.sig_host_CV_Parameters = type { float, float, i32 }
%struct.sig_dsp_Smooth = type { %struct.sig_dsp_Signal, %struct.sig_dsp_Smooth_Inputs, %struct.sig_dsp_Smooth_Parameters, %struct.sig_dsp_Signal_SingleMonoOutput, float, float, float }
%struct.sig_dsp_Smooth_Inputs = type { ptr }
%struct.sig_dsp_Smooth_Parameters = type { float }

; 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
define dso_local void @sig_host_FilteredCVIn_generate(ptr noundef %0) #1 {
  %2 = alloca ptr, align 8
  %3 = alloca ptr, align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #2
  %4 = load ptr, ptr %2, align 8, !tbaa !5
  store ptr %4, ptr %3, align 8, !tbaa !5
  %5 = load ptr, ptr %3, align 8, !tbaa !5
  %6 = getelementptr inbounds %struct.sig_host_FilteredCVIn, ptr %5, i32 0, i32 3
  %7 = load ptr, ptr %6, align 8, !tbaa !9
  %8 = load ptr, ptr %3, align 8, !tbaa !5
  %9 = getelementptr inbounds %struct.sig_host_FilteredCVIn, ptr %8, i32 0, i32 4
  %10 = load ptr, ptr %9, align 8, !tbaa !16
  %11 = getelementptr inbounds %struct.sig_host_CVIn, ptr %10, i32 0, i32 3
  store ptr %7, ptr %11, align 8, !tbaa !17
  %12 = load ptr, ptr %3, align 8, !tbaa !5
  %13 = getelementptr inbounds %struct.sig_host_FilteredCVIn, ptr %12, i32 0, i32 1
  %14 = getelementptr inbounds %struct.sig_host_FilteredCVIn_Parameters, ptr %13, i32 0, i32 3
  %15 = load float, ptr %14, align 4, !tbaa !20
  %16 = load ptr, ptr %3, align 8, !tbaa !5
  %17 = getelementptr inbounds %struct.sig_host_FilteredCVIn, ptr %16, i32 0, i32 5
  %18 = load ptr, ptr %17, align 8, !tbaa !21
  %19 = getelementptr inbounds %struct.sig_dsp_Smooth, ptr %18, i32 0, i32 2
  %20 = getelementptr inbounds %struct.sig_dsp_Smooth_Parameters, ptr %19, i32 0, i32 0
  store float %15, ptr %20, align 8, !tbaa !22
  %21 = load ptr, ptr %3, align 8, !tbaa !5
  %22 = getelementptr inbounds %struct.sig_host_FilteredCVIn, ptr %21, i32 0, i32 1
  %23 = getelementptr inbounds %struct.sig_host_FilteredCVIn_Parameters, ptr %22, i32 0, i32 2
  %24 = load i32, ptr %23, align 8, !tbaa !26
  %25 = load ptr, ptr %3, align 8, !tbaa !5
  %26 = getelementptr inbounds %struct.sig_host_FilteredCVIn, ptr %25, i32 0, i32 4
  %27 = load ptr, ptr %26, align 8, !tbaa !16
  %28 = getelementptr inbounds %struct.sig_host_CVIn, ptr %27, i32 0, i32 1
  %29 = getelementptr inbounds %struct.sig_host_CV_Parameters, ptr %28, i32 0, i32 2
  store i32 %24, ptr %29, align 8, !tbaa !27
  %30 = load ptr, ptr %3, align 8, !tbaa !5
  %31 = getelementptr inbounds %struct.sig_host_FilteredCVIn, ptr %30, i32 0, i32 1
  %32 = getelementptr inbounds %struct.sig_host_FilteredCVIn_Parameters, ptr %31, i32 0, i32 0
  %33 = load float, ptr %32, align 8, !tbaa !28
  %34 = load ptr, ptr %3, align 8, !tbaa !5
  %35 = getelementptr inbounds %struct.sig_host_FilteredCVIn, ptr %34, i32 0, i32 4
  %36 = load ptr, ptr %35, align 8, !tbaa !16
  %37 = getelementptr inbounds %struct.sig_host_CVIn, ptr %36, i32 0, i32 1
  %38 = getelementptr inbounds %struct.sig_host_CV_Parameters, ptr %37, i32 0, i32 0
  store float %33, ptr %38, align 8, !tbaa !29
  %39 = load ptr, ptr %3, align 8, !tbaa !5
  %40 = getelementptr inbounds %struct.sig_host_FilteredCVIn, ptr %39, i32 0, i32 1
  %41 = getelementptr inbounds %struct.sig_host_FilteredCVIn_Parameters, ptr %40, i32 0, i32 1
  %42 = load float, ptr %41, align 4, !tbaa !30
  %43 = load ptr, ptr %3, align 8, !tbaa !5
  %44 = getelementptr inbounds %struct.sig_host_FilteredCVIn, ptr %43, i32 0, i32 4
  %45 = load ptr, ptr %44, align 8, !tbaa !16
  %46 = getelementptr inbounds %struct.sig_host_CVIn, ptr %45, i32 0, i32 1
  %47 = getelementptr inbounds %struct.sig_host_CV_Parameters, ptr %46, i32 0, i32 1
  store float %42, ptr %47, align 4, !tbaa !31
  %48 = load ptr, ptr %3, align 8, !tbaa !5
  %49 = getelementptr inbounds %struct.sig_host_FilteredCVIn, ptr %48, i32 0, i32 4
  %50 = load ptr, ptr %49, align 8, !tbaa !16
  %51 = getelementptr inbounds %struct.sig_host_CVIn, ptr %50, i32 0, i32 0
  %52 = getelementptr inbounds %struct.sig_dsp_Signal, ptr %51, i32 0, i32 1
  %53 = load ptr, ptr %52, align 8, !tbaa !32
  %54 = load ptr, ptr %3, align 8, !tbaa !5
  %55 = getelementptr inbounds %struct.sig_host_FilteredCVIn, ptr %54, i32 0, i32 4
  %56 = load ptr, ptr %55, align 8, !tbaa !16
  call void %53(ptr noundef %56)
  %57 = load ptr, ptr %3, align 8, !tbaa !5
  %58 = getelementptr inbounds %struct.sig_host_FilteredCVIn, ptr %57, i32 0, i32 5
  %59 = load ptr, ptr %58, align 8, !tbaa !21
  %60 = getelementptr inbounds %struct.sig_dsp_Smooth, ptr %59, i32 0, i32 0
  %61 = getelementptr inbounds %struct.sig_dsp_Signal, ptr %60, i32 0, i32 1
  %62 = load ptr, ptr %61, align 8, !tbaa !33
  %63 = load ptr, ptr %3, align 8, !tbaa !5
  %64 = getelementptr inbounds %struct.sig_host_FilteredCVIn, ptr %63, i32 0, i32 5
  %65 = load ptr, ptr %64, align 8, !tbaa !21
  call void %62(ptr noundef %65)
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #2
  ret void
}

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 = { 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, !6, i64 40}
!10 = !{!"sig_host_FilteredCVIn", !11, i64 0, !12, i64 16, !15, i64 32, !6, i64 40, !6, i64 48, !6, i64 56}
!11 = !{!"sig_dsp_Signal", !6, i64 0, !6, i64 8}
!12 = !{!"sig_host_FilteredCVIn_Parameters", !13, i64 0, !13, i64 4, !14, i64 8, !13, i64 12}
!13 = !{!"float", !7, i64 0}
!14 = !{!"int", !7, i64 0}
!15 = !{!"sig_dsp_Signal_SingleMonoOutput", !6, i64 0}
!16 = !{!10, !6, i64 48}
!17 = !{!18, !6, i64 40}
!18 = !{!"sig_host_CVIn", !11, i64 0, !19, i64 16, !15, i64 32, !6, i64 40}
!19 = !{!"sig_host_CV_Parameters", !13, i64 0, !13, i64 4, !14, i64 8}
!20 = !{!10, !13, i64 28}
!21 = !{!10, !6, i64 56}
!22 = !{!23, !13, i64 24}
!23 = !{!"sig_dsp_Smooth", !11, i64 0, !24, i64 16, !25, i64 24, !15, i64 32, !13, i64 40, !13, i64 44, !13, i64 48}
!24 = !{!"sig_dsp_Smooth_Inputs", !6, i64 0}
!25 = !{!"sig_dsp_Smooth_Parameters", !13, i64 0}
!26 = !{!10, !14, i64 24}
!27 = !{!18, !14, i64 24}
!28 = !{!10, !13, i64 16}
!29 = !{!18, !13, i64 16}
!30 = !{!10, !13, i64 20}
!31 = !{!18, !13, i64 20}
!32 = !{!18, !6, i64 8}
!33 = !{!23, !6, i64 8}


; 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
define dso_local void @sig_host_FilteredCVIn_generate(ptr nocapture noundef readonly %0) local_unnamed_addr #0 {
  %2 = getelementptr inbounds i8, ptr %0, i64 40
  %3 = load ptr, ptr %2, align 8, !tbaa !5
  %4 = getelementptr inbounds i8, ptr %0, i64 48
  %5 = load ptr, ptr %4, align 8, !tbaa !15
  %6 = getelementptr inbounds i8, ptr %5, i64 40
  store ptr %3, ptr %6, align 8, !tbaa !16
  %7 = getelementptr inbounds i8, ptr %0, i64 16
  %8 = getelementptr inbounds i8, ptr %0, i64 28
  %9 = load float, ptr %8, align 4, !tbaa !19
  %10 = getelementptr inbounds i8, ptr %0, i64 56
  %11 = load ptr, ptr %10, align 8, !tbaa !20
  %12 = getelementptr inbounds i8, ptr %11, i64 24
  store float %9, ptr %12, align 8, !tbaa !21
  %13 = getelementptr inbounds i8, ptr %0, i64 24
  %14 = load i32, ptr %13, align 8, !tbaa !25
  %15 = getelementptr inbounds i8, ptr %5, i64 24
  store i32 %14, ptr %15, align 8, !tbaa !26
  %16 = getelementptr inbounds i8, ptr %5, i64 16
  %17 = load <2 x float>, ptr %7, align 8, !tbaa !27
  store <2 x float> %17, ptr %16, align 8, !tbaa !27
  %18 = getelementptr inbounds i8, ptr %5, i64 8
  %19 = load ptr, ptr %18, align 8, !tbaa !28
  tail call void %19(ptr noundef %5) #1
  %20 = load ptr, ptr %10, align 8, !tbaa !20
  %21 = getelementptr inbounds i8, ptr %20, i64 8
  %22 = load ptr, ptr %21, align 8, !tbaa !29
  tail call void %22(ptr noundef %20) #1
  ret void
}

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" }
attributes #1 = { 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, !8, i64 40}
!6 = !{!"sig_host_FilteredCVIn", !7, i64 0, !11, i64 16, !14, i64 32, !8, i64 40, !8, i64 48, !8, i64 56}
!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_host_FilteredCVIn_Parameters", !12, i64 0, !12, i64 4, !13, i64 8, !12, i64 12}
!12 = !{!"float", !9, i64 0}
!13 = !{!"int", !9, i64 0}
!14 = !{!"sig_dsp_Signal_SingleMonoOutput", !8, i64 0}
!15 = !{!6, !8, i64 48}
!16 = !{!17, !8, i64 40}
!17 = !{!"sig_host_CVIn", !7, i64 0, !18, i64 16, !14, i64 32, !8, i64 40}
!18 = !{!"sig_host_CV_Parameters", !12, i64 0, !12, i64 4, !13, i64 8}
!19 = !{!6, !12, i64 28}
!20 = !{!6, !8, i64 56}
!21 = !{!22, !12, i64 24}
!22 = !{!"sig_dsp_Smooth", !7, i64 0, !23, i64 16, !24, i64 24, !14, i64 32, !12, i64 40, !12, i64 44, !12, i64 48}
!23 = !{!"sig_dsp_Smooth_Inputs", !8, i64 0}
!24 = !{!"sig_dsp_Smooth_Parameters", !12, i64 0}
!25 = !{!6, !13, i64 24}
!26 = !{!17, !13, i64 24}
!27 = !{!12, !12, i64 0}
!28 = !{!17, !8, i64 8}
!29 = !{!22, !8, i64 8}


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