; 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_Looper_Loop = type { ptr, i64, i64, i8 }
%struct.sig_dsp_Looper = type { %struct.sig_dsp_Signal, %struct.sig_dsp_Looper_Inputs, %struct.sig_dsp_Signal_SingleMonoOutput, %struct.sig_dsp_Looper_Loop, i64, float, float, float }
%struct.sig_dsp_Signal = type { ptr, ptr }
%struct.sig_dsp_Looper_Inputs = type { ptr, ptr, ptr, ptr, 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 }

@__const.sig_dsp_Looper_init.loop = external hidden unnamed_addr constant %struct.sig_dsp_Looper_Loop, align 8

; 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_Looper_init(ptr noundef %0, ptr noundef %1) #1 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca %struct.sig_dsp_Looper_Loop, align 8
  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_Looper_generate)
  call void @llvm.lifetime.start.p0(i64 32, ptr %5) #3
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %5, ptr align 8 @__const.sig_dsp_Looper_init.loop, i64 32, i1 false)
  %8 = load ptr, ptr %3, align 8, !tbaa !5
  %9 = getelementptr inbounds %struct.sig_dsp_Looper, ptr %8, i32 0, i32 3
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %9, ptr align 8 %5, i64 32, i1 false), !tbaa.struct !9
  %10 = load ptr, ptr %3, align 8, !tbaa !5
  %11 = getelementptr inbounds %struct.sig_dsp_Looper, ptr %10, i32 0, i32 5
  store float 0.000000e+00, ptr %11, align 8, !tbaa !14
  %12 = load ptr, ptr %3, align 8, !tbaa !5
  %13 = getelementptr inbounds %struct.sig_dsp_Looper, ptr %12, i32 0, i32 6
  store float 0.000000e+00, ptr %13, align 4, !tbaa !21
  %14 = load ptr, ptr %3, align 8, !tbaa !5
  %15 = getelementptr inbounds %struct.sig_dsp_Looper, ptr %14, i32 0, i32 7
  store float 0.000000e+00, ptr %15, align 8, !tbaa !22
  %16 = load ptr, ptr %3, align 8, !tbaa !5
  %17 = load ptr, ptr %4, align 8, !tbaa !5
  %18 = getelementptr inbounds %struct.sig_SignalContext, ptr %17, i32 0, i32 1
  %19 = load ptr, ptr %18, align 8, !tbaa !23
  call void @sig_dsp_Looper_setBuffer(ptr noundef %16, ptr noundef %19)
  %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 !25
  %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 !26
  %26 = load ptr, ptr %3, align 8, !tbaa !5
  %27 = getelementptr inbounds %struct.sig_dsp_Looper, ptr %26, i32 0, i32 1
  %28 = getelementptr inbounds %struct.sig_dsp_Looper_Inputs, ptr %27, i32 0, i32 0
  store ptr %25, ptr %28, align 8, !tbaa !28
  %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 !25
  %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 !26
  %35 = load ptr, ptr %3, align 8, !tbaa !5
  %36 = getelementptr inbounds %struct.sig_dsp_Looper, ptr %35, i32 0, i32 1
  %37 = getelementptr inbounds %struct.sig_dsp_Looper_Inputs, ptr %36, i32 0, i32 1
  store ptr %34, ptr %37, align 8, !tbaa !29
  %38 = load ptr, ptr %4, align 8, !tbaa !5
  %39 = getelementptr inbounds %struct.sig_SignalContext, ptr %38, i32 0, i32 4
  %40 = load ptr, ptr %39, align 8, !tbaa !30
  %41 = getelementptr inbounds %struct.sig_dsp_ConstantValue, ptr %40, i32 0, i32 1
  %42 = getelementptr inbounds %struct.sig_dsp_Signal_SingleMonoOutput, ptr %41, i32 0, i32 0
  %43 = load ptr, ptr %42, align 8, !tbaa !26
  %44 = load ptr, ptr %3, align 8, !tbaa !5
  %45 = getelementptr inbounds %struct.sig_dsp_Looper, ptr %44, i32 0, i32 1
  %46 = getelementptr inbounds %struct.sig_dsp_Looper_Inputs, ptr %45, i32 0, i32 2
  store ptr %43, ptr %46, align 8, !tbaa !31
  %47 = load ptr, ptr %4, align 8, !tbaa !5
  %48 = getelementptr inbounds %struct.sig_SignalContext, ptr %47, i32 0, i32 4
  %49 = load ptr, ptr %48, align 8, !tbaa !30
  %50 = getelementptr inbounds %struct.sig_dsp_ConstantValue, ptr %49, i32 0, i32 1
  %51 = getelementptr inbounds %struct.sig_dsp_Signal_SingleMonoOutput, ptr %50, i32 0, i32 0
  %52 = load ptr, ptr %51, align 8, !tbaa !26
  %53 = load ptr, ptr %3, align 8, !tbaa !5
  %54 = getelementptr inbounds %struct.sig_dsp_Looper, ptr %53, i32 0, i32 1
  %55 = getelementptr inbounds %struct.sig_dsp_Looper_Inputs, ptr %54, i32 0, i32 3
  store ptr %52, ptr %55, align 8, !tbaa !32
  %56 = load ptr, ptr %4, align 8, !tbaa !5
  %57 = getelementptr inbounds %struct.sig_SignalContext, ptr %56, i32 0, i32 3
  %58 = load ptr, ptr %57, align 8, !tbaa !25
  %59 = getelementptr inbounds %struct.sig_dsp_ConstantValue, ptr %58, i32 0, i32 1
  %60 = getelementptr inbounds %struct.sig_dsp_Signal_SingleMonoOutput, ptr %59, i32 0, i32 0
  %61 = load ptr, ptr %60, align 8, !tbaa !26
  %62 = load ptr, ptr %3, align 8, !tbaa !5
  %63 = getelementptr inbounds %struct.sig_dsp_Looper, ptr %62, i32 0, i32 1
  %64 = getelementptr inbounds %struct.sig_dsp_Looper_Inputs, ptr %63, i32 0, i32 4
  store ptr %61, ptr %64, align 8, !tbaa !33
  %65 = load ptr, ptr %4, align 8, !tbaa !5
  %66 = getelementptr inbounds %struct.sig_SignalContext, ptr %65, i32 0, i32 3
  %67 = load ptr, ptr %66, align 8, !tbaa !25
  %68 = getelementptr inbounds %struct.sig_dsp_ConstantValue, ptr %67, i32 0, i32 1
  %69 = getelementptr inbounds %struct.sig_dsp_Signal_SingleMonoOutput, ptr %68, i32 0, i32 0
  %70 = load ptr, ptr %69, align 8, !tbaa !26
  %71 = load ptr, ptr %3, align 8, !tbaa !5
  %72 = getelementptr inbounds %struct.sig_dsp_Looper, ptr %71, i32 0, i32 1
  %73 = getelementptr inbounds %struct.sig_dsp_Looper_Inputs, ptr %72, i32 0, i32 5
  store ptr %70, ptr %73, align 8, !tbaa !34
  call void @llvm.lifetime.end.p0(i64 32, ptr %5) #3
  ret void
}

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

; Function Attrs: nounwind uwtable
declare dso_local void @sig_dsp_Looper_setBuffer(ptr noundef, 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 = { 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 8, !5, i64 8, i64 8, !10, i64 16, i64 8, !10, i64 24, i64 1, !12}
!10 = !{!11, !11, i64 0}
!11 = !{!"long", !7, i64 0}
!12 = !{!13, !13, i64 0}
!13 = !{!"_Bool", !7, i64 0}
!14 = !{!15, !20, i64 112}
!15 = !{!"sig_dsp_Looper", !16, i64 0, !17, i64 16, !18, i64 64, !19, i64 72, !11, i64 104, !20, i64 112, !20, i64 116, !20, i64 120}
!16 = !{!"sig_dsp_Signal", !6, i64 0, !6, i64 8}
!17 = !{!"sig_dsp_Looper_Inputs", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40}
!18 = !{!"sig_dsp_Signal_SingleMonoOutput", !6, i64 0}
!19 = !{!"sig_dsp_Looper_Loop", !6, i64 0, !11, i64 8, !11, i64 16, !13, i64 24}
!20 = !{!"float", !7, i64 0}
!21 = !{!15, !20, i64 116}
!22 = !{!15, !20, i64 120}
!23 = !{!24, !6, i64 8}
!24 = !{!"sig_SignalContext", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32}
!25 = !{!24, !6, i64 24}
!26 = !{!27, !6, i64 16}
!27 = !{!"sig_dsp_ConstantValue", !16, i64 0, !18, i64 16}
!28 = !{!15, !6, i64 16}
!29 = !{!15, !6, i64 24}
!30 = !{!24, !6, i64 32}
!31 = !{!15, !6, i64 32}
!32 = !{!15, !6, i64 40}
!33 = !{!15, !6, i64 48}
!34 = !{!15, !6, i64 56}


; 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"

%struct.sig_dsp_Looper_Loop = type { ptr, i64, i64, i8 }

@__const.sig_dsp_Looper_init.loop = external hidden unnamed_addr constant %struct.sig_dsp_Looper_Loop, align 8

; 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: 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_dsp_Looper_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_Looper_generate)
  %3 = getelementptr inbounds i8, ptr %0, i64 72
  tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(32) %3, ptr noundef nonnull align 8 dereferenceable(32) @__const.sig_dsp_Looper_init.loop, i64 32, i1 false), !tbaa.struct !5
  %4 = getelementptr inbounds i8, ptr %0, i64 112
  store <2 x float> zeroinitializer, ptr %4, align 8, !tbaa !14
  %5 = getelementptr inbounds i8, ptr %0, i64 120
  store float 0.000000e+00, ptr %5, align 8, !tbaa !16
  %6 = getelementptr inbounds i8, ptr %1, i64 8
  %7 = load ptr, ptr %6, align 8, !tbaa !22
  tail call void @sig_dsp_Looper_setBuffer(ptr noundef %0, ptr noundef %7)
  %8 = getelementptr inbounds i8, ptr %1, i64 24
  %9 = load ptr, ptr %8, align 8, !tbaa !24
  %10 = getelementptr inbounds i8, ptr %9, i64 16
  %11 = load ptr, ptr %10, align 8, !tbaa !25
  %12 = getelementptr inbounds i8, ptr %0, i64 16
  store ptr %11, ptr %12, align 8, !tbaa !27
  %13 = getelementptr inbounds i8, ptr %0, i64 24
  store ptr %11, ptr %13, align 8, !tbaa !28
  %14 = getelementptr inbounds i8, ptr %1, i64 32
  %15 = load ptr, ptr %14, align 8, !tbaa !29
  %16 = getelementptr inbounds i8, ptr %15, i64 16
  %17 = load ptr, ptr %16, align 8, !tbaa !25
  %18 = getelementptr inbounds i8, ptr %0, i64 32
  store ptr %17, ptr %18, align 8, !tbaa !30
  %19 = getelementptr inbounds i8, ptr %0, i64 40
  store ptr %17, ptr %19, align 8, !tbaa !31
  %20 = getelementptr inbounds i8, ptr %0, i64 48
  store ptr %11, ptr %20, align 8, !tbaa !32
  %21 = getelementptr inbounds i8, ptr %0, i64 56
  store ptr %11, ptr %21, align 8, !tbaa !33
  ret void
}

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

; Function Attrs: nounwind uwtable
declare dso_local void @sig_dsp_Looper_setBuffer(ptr noundef, ptr noundef) local_unnamed_addr #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: readwrite) }

!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 = !{i64 0, i64 8, !6, i64 8, i64 8, !10, i64 16, i64 8, !10, i64 24, i64 1, !12}
!6 = !{!7, !7, i64 0}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!11, !11, i64 0}
!11 = !{!"long", !8, i64 0}
!12 = !{!13, !13, i64 0}
!13 = !{!"_Bool", !8, i64 0}
!14 = !{!15, !15, i64 0}
!15 = !{!"float", !8, i64 0}
!16 = !{!17, !15, i64 120}
!17 = !{!"sig_dsp_Looper", !18, i64 0, !19, i64 16, !20, i64 64, !21, i64 72, !11, i64 104, !15, i64 112, !15, i64 116, !15, i64 120}
!18 = !{!"sig_dsp_Signal", !7, i64 0, !7, i64 8}
!19 = !{!"sig_dsp_Looper_Inputs", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !7, i64 32, !7, i64 40}
!20 = !{!"sig_dsp_Signal_SingleMonoOutput", !7, i64 0}
!21 = !{!"sig_dsp_Looper_Loop", !7, i64 0, !11, i64 8, !11, i64 16, !13, i64 24}
!22 = !{!23, !7, i64 8}
!23 = !{!"sig_SignalContext", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !7, i64 32}
!24 = !{!23, !7, i64 24}
!25 = !{!26, !7, i64 16}
!26 = !{!"sig_dsp_ConstantValue", !18, i64 0, !20, i64 16}
!27 = !{!17, !7, i64 16}
!28 = !{!17, !7, i64 24}
!29 = !{!23, !7, i64 32}
!30 = !{!17, !7, i64 32}
!31 = !{!17, !7, i64 40}
!32 = !{!17, !7, i64 48}
!33 = !{!17, !7, i64 56}


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