; 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_Chorus = type { %struct.sig_dsp_Signal, %struct.sig_dsp_Chorus_Inputs, %struct.sig_dsp_Chorus_Outputs, ptr, %struct.sig_osc_FastLFSine, float, float }
%struct.sig_dsp_Signal = type { ptr, ptr }
%struct.sig_dsp_Chorus_Inputs = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.sig_dsp_Chorus_Outputs = type { ptr, ptr }
%struct.sig_osc_FastLFSine = type { float, float, float, float }
%struct.sig_AudioSettings = type { float, i64, i64 }
%struct.sig_SignalContext = type { ptr, ptr, ptr, ptr, ptr }
%struct.sig_dsp_ConstantValue = type { %struct.sig_dsp_Signal, %struct.sig_dsp_Signal_SingleMonoOutput }
%struct.sig_dsp_Signal_SingleMonoOutput = type { ptr }

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

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

; Function Attrs: nounwind uwtable
define dso_local void @sig_dsp_Chorus_init(ptr noundef %0, ptr noundef %1) #0 {
  %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_dsp_Chorus_generate)
  %7 = load ptr, ptr %3, align 8, !tbaa !5
  %8 = getelementptr inbounds %struct.sig_dsp_Chorus, ptr %7, i32 0, i32 4
  %9 = load ptr, ptr %3, align 8, !tbaa !5
  %10 = getelementptr inbounds %struct.sig_dsp_Chorus, ptr %9, i32 0, i32 0
  %11 = getelementptr inbounds %struct.sig_dsp_Signal, ptr %10, i32 0, i32 0
  %12 = load ptr, ptr %11, align 8, !tbaa !9
  %13 = getelementptr inbounds %struct.sig_AudioSettings, ptr %12, i32 0, i32 0
  %14 = load float, ptr %13, align 8, !tbaa !16
  call void @sig_osc_FastLFSine_init(ptr noundef %8, float noundef %14)
  %15 = load ptr, ptr %3, align 8, !tbaa !5
  %16 = getelementptr inbounds %struct.sig_dsp_Chorus, ptr %15, i32 0, i32 5
  store float 0.000000e+00, ptr %16, align 8, !tbaa !19
  %17 = load ptr, ptr %3, align 8, !tbaa !5
  %18 = getelementptr inbounds %struct.sig_dsp_Chorus, ptr %17, i32 0, i32 6
  store float 0.000000e+00, ptr %18, align 4, !tbaa !20
  %19 = load ptr, ptr %4, align 8, !tbaa !5
  %20 = getelementptr inbounds %struct.sig_SignalContext, ptr %19, i32 0, i32 3
  %21 = load ptr, ptr %20, align 8, !tbaa !21
  %22 = getelementptr inbounds %struct.sig_dsp_ConstantValue, ptr %21, i32 0, i32 1
  %23 = getelementptr inbounds %struct.sig_dsp_Signal_SingleMonoOutput, ptr %22, i32 0, i32 0
  %24 = load ptr, ptr %23, align 8, !tbaa !23
  %25 = load ptr, ptr %3, align 8, !tbaa !5
  %26 = getelementptr inbounds %struct.sig_dsp_Chorus, ptr %25, i32 0, i32 1
  %27 = getelementptr inbounds %struct.sig_dsp_Chorus_Inputs, ptr %26, i32 0, i32 0
  store ptr %24, ptr %27, align 8, !tbaa !26
  %28 = load ptr, ptr %4, align 8, !tbaa !5
  %29 = getelementptr inbounds %struct.sig_SignalContext, ptr %28, i32 0, i32 3
  %30 = load ptr, ptr %29, align 8, !tbaa !21
  %31 = getelementptr inbounds %struct.sig_dsp_ConstantValue, ptr %30, i32 0, i32 1
  %32 = getelementptr inbounds %struct.sig_dsp_Signal_SingleMonoOutput, ptr %31, i32 0, i32 0
  %33 = load ptr, ptr %32, align 8, !tbaa !23
  %34 = load ptr, ptr %3, align 8, !tbaa !5
  %35 = getelementptr inbounds %struct.sig_dsp_Chorus, ptr %34, i32 0, i32 1
  %36 = getelementptr inbounds %struct.sig_dsp_Chorus_Inputs, ptr %35, i32 0, i32 1
  store ptr %33, ptr %36, align 8, !tbaa !27
  %37 = load ptr, ptr %4, align 8, !tbaa !5
  %38 = getelementptr inbounds %struct.sig_SignalContext, ptr %37, i32 0, i32 3
  %39 = load ptr, ptr %38, align 8, !tbaa !21
  %40 = getelementptr inbounds %struct.sig_dsp_ConstantValue, ptr %39, i32 0, i32 1
  %41 = getelementptr inbounds %struct.sig_dsp_Signal_SingleMonoOutput, ptr %40, i32 0, i32 0
  %42 = load ptr, ptr %41, align 8, !tbaa !23
  %43 = load ptr, ptr %3, align 8, !tbaa !5
  %44 = getelementptr inbounds %struct.sig_dsp_Chorus, ptr %43, i32 0, i32 1
  %45 = getelementptr inbounds %struct.sig_dsp_Chorus_Inputs, ptr %44, i32 0, i32 2
  store ptr %42, ptr %45, align 8, !tbaa !28
  %46 = load ptr, ptr %4, align 8, !tbaa !5
  %47 = getelementptr inbounds %struct.sig_SignalContext, ptr %46, i32 0, i32 3
  %48 = load ptr, ptr %47, align 8, !tbaa !21
  %49 = getelementptr inbounds %struct.sig_dsp_ConstantValue, ptr %48, i32 0, i32 1
  %50 = getelementptr inbounds %struct.sig_dsp_Signal_SingleMonoOutput, ptr %49, i32 0, i32 0
  %51 = load ptr, ptr %50, align 8, !tbaa !23
  %52 = load ptr, ptr %3, align 8, !tbaa !5
  %53 = getelementptr inbounds %struct.sig_dsp_Chorus, ptr %52, i32 0, i32 1
  %54 = getelementptr inbounds %struct.sig_dsp_Chorus_Inputs, ptr %53, i32 0, i32 3
  store ptr %51, ptr %54, align 8, !tbaa !29
  %55 = load ptr, ptr %4, align 8, !tbaa !5
  %56 = getelementptr inbounds %struct.sig_SignalContext, ptr %55, i32 0, i32 3
  %57 = load ptr, ptr %56, align 8, !tbaa !21
  %58 = getelementptr inbounds %struct.sig_dsp_ConstantValue, ptr %57, i32 0, i32 1
  %59 = getelementptr inbounds %struct.sig_dsp_Signal_SingleMonoOutput, ptr %58, i32 0, i32 0
  %60 = load ptr, ptr %59, align 8, !tbaa !23
  %61 = load ptr, ptr %3, align 8, !tbaa !5
  %62 = getelementptr inbounds %struct.sig_dsp_Chorus, ptr %61, i32 0, i32 1
  %63 = getelementptr inbounds %struct.sig_dsp_Chorus_Inputs, ptr %62, i32 0, i32 4
  store ptr %60, ptr %63, align 8, !tbaa !30
  %64 = load ptr, ptr %4, align 8, !tbaa !5
  %65 = getelementptr inbounds %struct.sig_SignalContext, ptr %64, i32 0, i32 3
  %66 = load ptr, ptr %65, align 8, !tbaa !21
  %67 = getelementptr inbounds %struct.sig_dsp_ConstantValue, ptr %66, i32 0, i32 1
  %68 = getelementptr inbounds %struct.sig_dsp_Signal_SingleMonoOutput, ptr %67, i32 0, i32 0
  %69 = load ptr, ptr %68, align 8, !tbaa !23
  %70 = load ptr, ptr %3, align 8, !tbaa !5
  %71 = getelementptr inbounds %struct.sig_dsp_Chorus, ptr %70, i32 0, i32 1
  %72 = getelementptr inbounds %struct.sig_dsp_Chorus_Inputs, ptr %71, i32 0, i32 5
  store ptr %69, ptr %72, align 8, !tbaa !31
  %73 = load ptr, ptr %4, align 8, !tbaa !5
  %74 = getelementptr inbounds %struct.sig_SignalContext, ptr %73, i32 0, i32 3
  %75 = load ptr, ptr %74, align 8, !tbaa !21
  %76 = getelementptr inbounds %struct.sig_dsp_ConstantValue, ptr %75, i32 0, i32 1
  %77 = getelementptr inbounds %struct.sig_dsp_Signal_SingleMonoOutput, ptr %76, i32 0, i32 0
  %78 = load ptr, ptr %77, align 8, !tbaa !23
  %79 = load ptr, ptr %3, align 8, !tbaa !5
  %80 = getelementptr inbounds %struct.sig_dsp_Chorus, ptr %79, i32 0, i32 1
  %81 = getelementptr inbounds %struct.sig_dsp_Chorus_Inputs, ptr %80, i32 0, i32 6
  store ptr %78, ptr %81, align 8, !tbaa !32
  ret void
}

; Function Attrs: nounwind uwtable
declare dso_local void @sig_dsp_Chorus_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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !6, i64 0}
!10 = !{!"sig_dsp_Chorus", !11, i64 0, !12, i64 16, !13, i64 72, !6, i64 88, !14, i64 96, !15, i64 112, !15, i64 116}
!11 = !{!"sig_dsp_Signal", !6, i64 0, !6, i64 8}
!12 = !{!"sig_dsp_Chorus_Inputs", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48}
!13 = !{!"sig_dsp_Chorus_Outputs", !6, i64 0, !6, i64 8}
!14 = !{!"sig_osc_FastLFSine", !15, i64 0, !15, i64 4, !15, i64 8, !15, i64 12}
!15 = !{!"float", !7, i64 0}
!16 = !{!17, !15, i64 0}
!17 = !{!"sig_AudioSettings", !15, i64 0, !18, i64 8, !18, i64 16}
!18 = !{!"long", !7, i64 0}
!19 = !{!10, !15, i64 112}
!20 = !{!10, !15, i64 116}
!21 = !{!22, !6, i64 24}
!22 = !{!"sig_SignalContext", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32}
!23 = !{!24, !6, i64 16}
!24 = !{!"sig_dsp_ConstantValue", !11, i64 0, !25, i64 16}
!25 = !{!"sig_dsp_Signal_SingleMonoOutput", !6, i64 0}
!26 = !{!10, !6, i64 16}
!27 = !{!10, !6, i64 24}
!28 = !{!10, !6, i64 32}
!29 = !{!10, !6, i64 40}
!30 = !{!10, !6, i64 48}
!31 = !{!10, !6, i64 56}
!32 = !{!10, !6, i64 64}


; 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_osc_FastLFSine_init(ptr noundef, float noundef) local_unnamed_addr #0

; 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_Chorus_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_Chorus_generate)
  %3 = getelementptr inbounds i8, ptr %0, i64 96
  %4 = load ptr, ptr %0, align 8, !tbaa !5
  %5 = load float, ptr %4, align 8, !tbaa !15
  tail call void @sig_osc_FastLFSine_init(ptr noundef nonnull %3, float noundef %5)
  %6 = getelementptr inbounds i8, ptr %0, i64 112
  store <2 x float> zeroinitializer, ptr %6, align 8, !tbaa !18
  %7 = getelementptr inbounds i8, ptr %1, i64 24
  %8 = load ptr, ptr %7, align 8, !tbaa !19
  %9 = getelementptr inbounds i8, ptr %8, i64 16
  %10 = load ptr, ptr %9, align 8, !tbaa !21
  %11 = getelementptr inbounds i8, ptr %0, i64 16
  %12 = insertelement <4 x ptr> poison, ptr %10, i64 0
  %13 = shufflevector <4 x ptr> %12, <4 x ptr> poison, <4 x i32> zeroinitializer
  store <4 x ptr> %13, ptr %11, align 8, !tbaa !24
  %14 = getelementptr inbounds i8, ptr %0, i64 48
  store ptr %10, ptr %14, align 8, !tbaa !25
  %15 = getelementptr inbounds i8, ptr %0, i64 56
  store ptr %10, ptr %15, align 8, !tbaa !26
  %16 = getelementptr inbounds i8, ptr %0, i64 64
  store ptr %10, ptr %16, align 8, !tbaa !27
  ret void
}

; Function Attrs: nounwind uwtable
declare dso_local void @sig_dsp_Chorus_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, !8, i64 0}
!6 = !{!"sig_dsp_Chorus", !7, i64 0, !11, i64 16, !12, i64 72, !8, i64 88, !13, i64 96, !14, i64 112, !14, i64 116}
!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_Chorus_Inputs", !8, i64 0, !8, i64 8, !8, i64 16, !8, i64 24, !8, i64 32, !8, i64 40, !8, i64 48}
!12 = !{!"sig_dsp_Chorus_Outputs", !8, i64 0, !8, i64 8}
!13 = !{!"sig_osc_FastLFSine", !14, i64 0, !14, i64 4, !14, i64 8, !14, i64 12}
!14 = !{!"float", !9, i64 0}
!15 = !{!16, !14, i64 0}
!16 = !{!"sig_AudioSettings", !14, i64 0, !17, i64 8, !17, i64 16}
!17 = !{!"long", !9, i64 0}
!18 = !{!14, !14, i64 0}
!19 = !{!20, !8, i64 24}
!20 = !{!"sig_SignalContext", !8, i64 0, !8, i64 8, !8, i64 16, !8, i64 24, !8, i64 32}
!21 = !{!22, !8, i64 16}
!22 = !{!"sig_dsp_ConstantValue", !7, i64 0, !23, i64 16}
!23 = !{!"sig_dsp_Signal_SingleMonoOutput", !8, i64 0}
!24 = !{!8, !8, i64 0}
!25 = !{!6, !8, i64 48}
!26 = !{!6, !8, i64 56}
!27 = !{!6, !8, i64 64}


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