; 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_TimedGate_Parameters = type { float, float }
%struct.sig_dsp_TimedGate = type { %struct.sig_dsp_Signal, %struct.sig_dsp_TimedGate_Inputs, %struct.sig_dsp_TimedGate_Parameters, %struct.sig_dsp_Signal_SingleMonoOutput, float, float, float, i64, i64 }
%struct.sig_dsp_Signal = type { ptr, ptr }
%struct.sig_dsp_TimedGate_Inputs = type { ptr, ptr }
%struct.sig_dsp_Signal_SingleMonoOutput = type { ptr }
%struct.sig_SignalContext = type { ptr, ptr, ptr, ptr, ptr }
%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: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3

; Function Attrs: nounwind uwtable
define dso_local void @sig_dsp_TimedGate_init(ptr noundef %0, ptr noundef %1) #1 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca %struct.sig_dsp_TimedGate_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_TimedGate_generate)
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #4
  call void @llvm.memset.p0.i64(ptr align 4 %5, i8 0, i64 8, i1 false)
  %8 = load ptr, ptr %3, align 8, !tbaa !5
  %9 = getelementptr inbounds %struct.sig_dsp_TimedGate, ptr %8, i32 0, i32 2
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %9, ptr align 4 %5, i64 8, i1 false), !tbaa.struct !9
  %10 = load ptr, ptr %3, align 8, !tbaa !5
  %11 = getelementptr inbounds %struct.sig_dsp_TimedGate, ptr %10, i32 0, i32 4
  store float 0.000000e+00, ptr %11, align 8, !tbaa !12
  %12 = load ptr, ptr %3, align 8, !tbaa !5
  %13 = getelementptr inbounds %struct.sig_dsp_TimedGate, ptr %12, i32 0, i32 6
  store float 0.000000e+00, ptr %13, align 8, !tbaa !19
  %14 = load ptr, ptr %3, align 8, !tbaa !5
  %15 = getelementptr inbounds %struct.sig_dsp_TimedGate, ptr %14, i32 0, i32 5
  store float 0.000000e+00, ptr %15, align 4, !tbaa !20
  %16 = load ptr, ptr %3, align 8, !tbaa !5
  %17 = getelementptr inbounds %struct.sig_dsp_TimedGate, ptr %16, i32 0, i32 7
  store i64 0, ptr %17, align 8, !tbaa !21
  %18 = load ptr, ptr %3, align 8, !tbaa !5
  %19 = getelementptr inbounds %struct.sig_dsp_TimedGate, ptr %18, i32 0, i32 8
  store i64 0, ptr %19, align 8, !tbaa !22
  %20 = load ptr, ptr %4, align 8, !tbaa !5
  %21 = getelementptr inbounds %struct.sig_SignalContext, ptr %20, i32 0, i32 3
  %22 = load ptr, ptr %21, align 8, !tbaa !23
  %23 = getelementptr inbounds %struct.sig_dsp_ConstantValue, ptr %22, i32 0, i32 1
  %24 = getelementptr inbounds %struct.sig_dsp_Signal_SingleMonoOutput, ptr %23, i32 0, i32 0
  %25 = load ptr, ptr %24, align 8, !tbaa !25
  %26 = load ptr, ptr %3, align 8, !tbaa !5
  %27 = getelementptr inbounds %struct.sig_dsp_TimedGate, ptr %26, i32 0, i32 1
  %28 = getelementptr inbounds %struct.sig_dsp_TimedGate_Inputs, ptr %27, i32 0, i32 0
  store ptr %25, ptr %28, align 8, !tbaa !27
  %29 = load ptr, ptr %4, align 8, !tbaa !5
  %30 = getelementptr inbounds %struct.sig_SignalContext, ptr %29, i32 0, i32 3
  %31 = load ptr, ptr %30, align 8, !tbaa !23
  %32 = getelementptr inbounds %struct.sig_dsp_ConstantValue, ptr %31, i32 0, i32 1
  %33 = getelementptr inbounds %struct.sig_dsp_Signal_SingleMonoOutput, ptr %32, i32 0, i32 0
  %34 = load ptr, ptr %33, align 8, !tbaa !25
  %35 = load ptr, ptr %3, align 8, !tbaa !5
  %36 = getelementptr inbounds %struct.sig_dsp_TimedGate, ptr %35, i32 0, i32 1
  %37 = getelementptr inbounds %struct.sig_dsp_TimedGate_Inputs, ptr %36, i32 0, i32 1
  store ptr %34, ptr %37, align 8, !tbaa !28
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #4
  ret void
}

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

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, i64 4, i64 4, !10}
!10 = !{!11, !11, i64 0}
!11 = !{!"float", !7, i64 0}
!12 = !{!13, !11, i64 48}
!13 = !{!"sig_dsp_TimedGate", !14, i64 0, !15, i64 16, !16, i64 32, !17, i64 40, !11, i64 48, !11, i64 52, !11, i64 56, !18, i64 64, !18, i64 72}
!14 = !{!"sig_dsp_Signal", !6, i64 0, !6, i64 8}
!15 = !{!"sig_dsp_TimedGate_Inputs", !6, i64 0, !6, i64 8}
!16 = !{!"sig_dsp_TimedGate_Parameters", !11, i64 0, !11, i64 4}
!17 = !{!"sig_dsp_Signal_SingleMonoOutput", !6, i64 0}
!18 = !{!"long", !7, i64 0}
!19 = !{!13, !11, i64 56}
!20 = !{!13, !11, i64 52}
!21 = !{!13, !18, i64 64}
!22 = !{!13, !18, i64 72}
!23 = !{!24, !6, i64 24}
!24 = !{!"sig_SignalContext", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32}
!25 = !{!26, !6, i64 16}
!26 = !{!"sig_dsp_ConstantValue", !14, i64 0, !17, i64 16}
!27 = !{!13, !6, i64 16}
!28 = !{!13, !6, i64 24}


; 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: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #1

; Function Attrs: nounwind uwtable
define dso_local void @sig_dsp_TimedGate_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_TimedGate_generate)
  %3 = getelementptr inbounds i8, ptr %0, i64 32
  store i64 0, ptr %3, align 8
  %4 = getelementptr inbounds i8, ptr %0, i64 48
  %5 = getelementptr inbounds i8, ptr %0, i64 56
  store float 0.000000e+00, ptr %5, align 8, !tbaa !5
  store <2 x float> zeroinitializer, ptr %4, align 8, !tbaa !16
  %6 = getelementptr inbounds i8, ptr %0, i64 64
  %7 = getelementptr inbounds i8, ptr %1, i64 24
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %6, i8 0, i64 16, i1 false)
  %8 = load ptr, ptr %7, align 8, !tbaa !17
  %9 = getelementptr inbounds i8, ptr %8, i64 16
  %10 = load ptr, ptr %9, align 8, !tbaa !19
  %11 = getelementptr inbounds i8, ptr %0, i64 16
  store ptr %10, ptr %11, align 8, !tbaa !21
  %12 = getelementptr inbounds i8, ptr %0, i64 24
  store ptr %10, ptr %12, align 8, !tbaa !22
  ret void
}

; Function Attrs: nounwind uwtable
declare dso_local void @sig_dsp_TimedGate_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" }
attributes #1 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }

!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, !13, i64 56}
!6 = !{!"sig_dsp_TimedGate", !7, i64 0, !11, i64 16, !12, i64 32, !14, i64 40, !13, i64 48, !13, i64 52, !13, i64 56, !15, i64 64, !15, i64 72}
!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_TimedGate_Inputs", !8, i64 0, !8, i64 8}
!12 = !{!"sig_dsp_TimedGate_Parameters", !13, i64 0, !13, i64 4}
!13 = !{!"float", !9, i64 0}
!14 = !{!"sig_dsp_Signal_SingleMonoOutput", !8, i64 0}
!15 = !{!"long", !9, i64 0}
!16 = !{!13, !13, i64 0}
!17 = !{!18, !8, i64 24}
!18 = !{!"sig_SignalContext", !8, i64 0, !8, i64 8, !8, i64 16, !8, i64 24, !8, i64 32}
!19 = !{!20, !8, i64 16}
!20 = !{!"sig_dsp_ConstantValue", !7, i64 0, !14, i64 16}
!21 = !{!6, !8, i64 16}
!22 = !{!6, !8, i64 24}


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