; 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_VOctCVIn = type { %struct.sig_dsp_Signal, %struct.sig_host_VOctCVIn_Parameters, %struct.sig_dsp_Signal_SingleMonoOutput, ptr, ptr, ptr }
%struct.sig_dsp_Signal = type { ptr, ptr }
%struct.sig_host_VOctCVIn_Parameters = type { float, float, i32, float }
%struct.sig_dsp_Signal_SingleMonoOutput = type { ptr }
%struct.sig_dsp_LinearToFreq = type { %struct.sig_dsp_Signal, %struct.sig_dsp_LinearToFreq_Inputs, %struct.sig_dsp_LinearToFreq_Parameters, %struct.sig_dsp_Signal_SingleMonoOutput }
%struct.sig_dsp_LinearToFreq_Inputs = type { ptr }
%struct.sig_dsp_LinearToFreq_Parameters = type { float }
%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 }

declare void @sig_dsp_Signal_init(ptr noundef, ptr noundef, ptr noundef) #0

; 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) #1

; Function Attrs: nounwind uwtable
define dso_local void @sig_host_VOctCVIn_init(ptr noundef %0, ptr noundef %1) #2 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %5 = load ptr, ptr %3, align 8, !tbaa !5
  %6 = load ptr, ptr %4, align 8, !tbaa !5
  call void @sig_dsp_Signal_init(ptr noundef %5, ptr noundef %6, ptr noundef @sig_host_VOctCVIn_generate)
  %7 = load ptr, ptr %3, align 8, !tbaa !5
  %8 = getelementptr inbounds %struct.sig_host_VOctCVIn, ptr %7, i32 0, i32 1
  %9 = getelementptr inbounds %struct.sig_host_VOctCVIn_Parameters, ptr %8, i32 0, i32 0
  store float 1.000000e+00, ptr %9, align 8, !tbaa !9
  %10 = load ptr, ptr %3, align 8, !tbaa !5
  %11 = getelementptr inbounds %struct.sig_host_VOctCVIn, ptr %10, i32 0, i32 1
  %12 = getelementptr inbounds %struct.sig_host_VOctCVIn_Parameters, ptr %11, i32 0, i32 1
  store float 0.000000e+00, ptr %12, align 4, !tbaa !16
  %13 = load ptr, ptr %3, align 8, !tbaa !5
  %14 = getelementptr inbounds %struct.sig_host_VOctCVIn, ptr %13, i32 0, i32 1
  %15 = getelementptr inbounds %struct.sig_host_VOctCVIn_Parameters, ptr %14, i32 0, i32 2
  store i32 0, ptr %15, align 8, !tbaa !17
  %16 = load ptr, ptr %3, align 8, !tbaa !5
  %17 = getelementptr inbounds %struct.sig_host_VOctCVIn, ptr %16, i32 0, i32 5
  %18 = load ptr, ptr %17, align 8, !tbaa !18
  %19 = getelementptr inbounds %struct.sig_dsp_LinearToFreq, ptr %18, i32 0, i32 2
  %20 = getelementptr inbounds %struct.sig_dsp_LinearToFreq_Parameters, ptr %19, i32 0, i32 0
  %21 = load float, ptr %20, align 8, !tbaa !19
  %22 = load ptr, ptr %3, align 8, !tbaa !5
  %23 = getelementptr inbounds %struct.sig_host_VOctCVIn, ptr %22, i32 0, i32 1
  %24 = getelementptr inbounds %struct.sig_host_VOctCVIn_Parameters, ptr %23, i32 0, i32 3
  store float %21, ptr %24, align 4, !tbaa !23
  %25 = load ptr, ptr %3, align 8, !tbaa !5
  %26 = getelementptr inbounds %struct.sig_host_VOctCVIn, ptr %25, i32 0, i32 2
  %27 = load ptr, ptr %3, align 8, !tbaa !5
  %28 = getelementptr inbounds %struct.sig_host_VOctCVIn, ptr %27, i32 0, i32 5
  %29 = load ptr, ptr %28, align 8, !tbaa !18
  %30 = getelementptr inbounds %struct.sig_dsp_LinearToFreq, ptr %29, i32 0, i32 3
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %26, ptr align 8 %30, i64 8, i1 false), !tbaa.struct !24
  %31 = load ptr, ptr %3, align 8, !tbaa !5
  %32 = getelementptr inbounds %struct.sig_host_VOctCVIn, ptr %31, i32 0, i32 4
  %33 = load ptr, ptr %32, align 8, !tbaa !25
  %34 = getelementptr inbounds %struct.sig_host_CVIn, ptr %33, i32 0, i32 2
  %35 = getelementptr inbounds %struct.sig_dsp_Signal_SingleMonoOutput, ptr %34, i32 0, i32 0
  %36 = load ptr, ptr %35, align 8, !tbaa !26
  %37 = load ptr, ptr %3, align 8, !tbaa !5
  %38 = getelementptr inbounds %struct.sig_host_VOctCVIn, ptr %37, i32 0, i32 5
  %39 = load ptr, ptr %38, align 8, !tbaa !18
  %40 = getelementptr inbounds %struct.sig_dsp_LinearToFreq, ptr %39, i32 0, i32 1
  %41 = getelementptr inbounds %struct.sig_dsp_LinearToFreq_Inputs, ptr %40, i32 0, i32 0
  store ptr %36, ptr %41, align 8, !tbaa !29
  ret void
}

; Function Attrs: nounwind uwtable
declare dso_local void @sig_host_VOctCVIn_generate(ptr noundef) #2

attributes #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 nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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, !13, i64 16}
!10 = !{!"sig_host_VOctCVIn", !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_VOctCVIn_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, !13, i64 20}
!17 = !{!10, !14, i64 24}
!18 = !{!10, !6, i64 56}
!19 = !{!20, !13, i64 24}
!20 = !{!"sig_dsp_LinearToFreq", !11, i64 0, !21, i64 16, !22, i64 24, !15, i64 32}
!21 = !{!"sig_dsp_LinearToFreq_Inputs", !6, i64 0}
!22 = !{!"sig_dsp_LinearToFreq_Parameters", !13, i64 0}
!23 = !{!10, !13, i64 28}
!24 = !{i64 0, i64 8, !5}
!25 = !{!10, !6, i64 48}
!26 = !{!27, !6, i64 32}
!27 = !{!"sig_host_CVIn", !11, i64 0, !28, i64 16, !15, i64 32, !6, i64 40}
!28 = !{!"sig_host_CV_Parameters", !13, i64 0, !13, i64 4, !14, i64 8}
!29 = !{!20, !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"

declare void @sig_dsp_Signal_init(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
define dso_local void @sig_host_VOctCVIn_init(ptr noundef %0, ptr noundef %1) local_unnamed_addr #1 {
  tail call void @sig_dsp_Signal_init(ptr noundef %0, ptr noundef %1, ptr noundef nonnull @sig_host_VOctCVIn_generate) #2
  %3 = getelementptr inbounds i8, ptr %0, i64 16
  store <2 x float> <float 1.000000e+00, float 0.000000e+00>, ptr %3, align 8, !tbaa !5
  %4 = getelementptr inbounds i8, ptr %0, i64 24
  store i32 0, ptr %4, align 8, !tbaa !9
  %5 = getelementptr inbounds i8, ptr %0, i64 56
  %6 = load ptr, ptr %5, align 8, !tbaa !16
  %7 = getelementptr inbounds i8, ptr %6, i64 24
  %8 = load float, ptr %7, align 8, !tbaa !17
  %9 = getelementptr inbounds i8, ptr %0, i64 28
  store float %8, ptr %9, align 4, !tbaa !21
  %10 = getelementptr inbounds i8, ptr %0, i64 32
  %11 = getelementptr inbounds i8, ptr %6, i64 32
  %12 = load i64, ptr %11, align 8, !tbaa !22
  store i64 %12, ptr %10, align 8, !tbaa !22
  %13 = getelementptr inbounds i8, ptr %0, i64 48
  %14 = load ptr, ptr %13, align 8, !tbaa !23
  %15 = getelementptr inbounds i8, ptr %14, i64 32
  %16 = load ptr, ptr %15, align 8, !tbaa !24
  %17 = getelementptr inbounds i8, ptr %6, i64 16
  store ptr %16, ptr %17, align 8, !tbaa !27
  ret void
}

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

attributes #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 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 = !{!"float", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !14, i64 24}
!10 = !{!"sig_host_VOctCVIn", !11, i64 0, !13, i64 16, !15, i64 32, !12, i64 40, !12, i64 48, !12, i64 56}
!11 = !{!"sig_dsp_Signal", !12, i64 0, !12, i64 8}
!12 = !{!"any pointer", !7, i64 0}
!13 = !{!"sig_host_VOctCVIn_Parameters", !6, i64 0, !6, i64 4, !14, i64 8, !6, i64 12}
!14 = !{!"int", !7, i64 0}
!15 = !{!"sig_dsp_Signal_SingleMonoOutput", !12, i64 0}
!16 = !{!10, !12, i64 56}
!17 = !{!18, !6, i64 24}
!18 = !{!"sig_dsp_LinearToFreq", !11, i64 0, !19, i64 16, !20, i64 24, !15, i64 32}
!19 = !{!"sig_dsp_LinearToFreq_Inputs", !12, i64 0}
!20 = !{!"sig_dsp_LinearToFreq_Parameters", !6, i64 0}
!21 = !{!10, !6, i64 28}
!22 = !{!12, !12, i64 0}
!23 = !{!10, !12, i64 48}
!24 = !{!25, !12, i64 32}
!25 = !{!"sig_host_CVIn", !11, i64 0, !26, i64 16, !15, i64 32, !12, i64 40}
!26 = !{!"sig_host_CV_Parameters", !6, i64 0, !6, i64 4, !14, i64 8}
!27 = !{!18, !12, i64 16}


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