; LLVM IR from lichen-community-systems/signaletic :: libsignaletic/tests (test-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_Allocator = type { ptr, ptr }
%struct.sig_Buffer = type { i64, ptr }
%struct.sig_dsp_List = type { %struct.sig_dsp_Signal, %struct.sig_dsp_List_Inputs, %struct.sig_dsp_List_Parameters, %struct.sig_dsp_List_Outputs, ptr }
%struct.sig_dsp_Signal = type { ptr, ptr }
%struct.sig_dsp_List_Inputs = type { ptr }
%struct.sig_dsp_List_Parameters = type { float, float, float }
%struct.sig_dsp_List_Outputs = type { ptr, ptr, ptr }
%struct.sig_dsp_Value = type { %struct.sig_dsp_Signal, %struct.sig_dsp_Value_Parameters, %struct.sig_dsp_Signal_SingleMonoOutput, float }
%struct.sig_dsp_Value_Parameters = type { float }
%struct.sig_dsp_Signal_SingleMonoOutput = type { ptr }

@allocator = external dso_local global %struct.sig_Allocator, align 8
@context = external dso_local global ptr, align 8
@__const.test_sig_dsp_List_interpolation.listItems = external hidden unnamed_addr constant [5 x float], align 16

; 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

declare ptr @sig_dsp_Value_new(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
declare dso_local void @generateAndTestListIndex(ptr noundef, float noundef, ptr noundef, float noundef) #3

declare ptr @sig_dsp_List_new(ptr noundef, ptr noundef) #1

; Function Attrs: nounwind uwtable
define dso_local void @test_sig_dsp_List_interpolation() #3 {
  %1 = alloca ptr, align 8
  %2 = alloca [5 x float], align 16
  %3 = alloca %struct.sig_Buffer, align 8
  %4 = alloca ptr, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %1) #4
  %5 = load ptr, ptr @context, align 8, !tbaa !5
  %6 = call ptr @sig_dsp_Value_new(ptr noundef @allocator, ptr noundef %5)
  store ptr %6, ptr %1, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 20, ptr %2) #4
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %2, ptr align 16 @__const.test_sig_dsp_List_interpolation.listItems, i64 20, i1 false)
  call void @llvm.lifetime.start.p0(i64 16, ptr %3) #4
  %7 = getelementptr inbounds %struct.sig_Buffer, ptr %3, i32 0, i32 0
  store i64 5, ptr %7, align 8, !tbaa !9
  %8 = getelementptr inbounds %struct.sig_Buffer, ptr %3, i32 0, i32 1
  %9 = getelementptr inbounds [5 x float], ptr %2, i64 0, i64 0
  store ptr %9, ptr %8, align 8, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #4
  %10 = load ptr, ptr @context, align 8, !tbaa !5
  %11 = call ptr @sig_dsp_List_new(ptr noundef @allocator, ptr noundef %10)
  store ptr %11, ptr %4, align 8, !tbaa !5
  %12 = load ptr, ptr %4, align 8, !tbaa !5
  %13 = getelementptr inbounds %struct.sig_dsp_List, ptr %12, i32 0, i32 2
  %14 = getelementptr inbounds %struct.sig_dsp_List_Parameters, ptr %13, i32 0, i32 0
  store float 1.000000e+00, ptr %14, align 8, !tbaa !13
  %15 = load ptr, ptr %4, align 8, !tbaa !5
  %16 = getelementptr inbounds %struct.sig_dsp_List, ptr %15, i32 0, i32 2
  %17 = getelementptr inbounds %struct.sig_dsp_List_Parameters, ptr %16, i32 0, i32 2
  store float 1.000000e+00, ptr %17, align 8, !tbaa !20
  %18 = load ptr, ptr %4, align 8, !tbaa !5
  %19 = getelementptr inbounds %struct.sig_dsp_List, ptr %18, i32 0, i32 2
  %20 = getelementptr inbounds %struct.sig_dsp_List_Parameters, ptr %19, i32 0, i32 1
  store float 1.000000e+00, ptr %20, align 4, !tbaa !21
  %21 = load ptr, ptr %4, align 8, !tbaa !5
  %22 = getelementptr inbounds %struct.sig_dsp_List, ptr %21, i32 0, i32 4
  store ptr %3, ptr %22, align 8, !tbaa !22
  %23 = load ptr, ptr %1, align 8, !tbaa !5
  %24 = getelementptr inbounds %struct.sig_dsp_Value, ptr %23, i32 0, i32 2
  %25 = getelementptr inbounds %struct.sig_dsp_Signal_SingleMonoOutput, ptr %24, i32 0, i32 0
  %26 = load ptr, ptr %25, align 8, !tbaa !23
  %27 = load ptr, ptr %4, align 8, !tbaa !5
  %28 = getelementptr inbounds %struct.sig_dsp_List, ptr %27, i32 0, i32 1
  %29 = getelementptr inbounds %struct.sig_dsp_List_Inputs, ptr %28, i32 0, i32 0
  store ptr %26, ptr %29, align 8, !tbaa !27
  %30 = load ptr, ptr %1, align 8, !tbaa !5
  %31 = load ptr, ptr %4, align 8, !tbaa !5
  call void @generateAndTestListIndex(ptr noundef %30, float noundef 0.000000e+00, ptr noundef %31, float noundef 1.000000e+00)
  %32 = load ptr, ptr %1, align 8, !tbaa !5
  %33 = load ptr, ptr %4, align 8, !tbaa !5
  call void @generateAndTestListIndex(ptr noundef %32, float noundef 0x3FB99999A0000000, ptr noundef %33, float noundef 0x3FF6666660000000)
  %34 = load ptr, ptr %1, align 8, !tbaa !5
  %35 = load ptr, ptr %4, align 8, !tbaa !5
  call void @generateAndTestListIndex(ptr noundef %34, float noundef 5.000000e-01, ptr noundef %35, float noundef 3.000000e+00)
  %36 = load ptr, ptr %1, align 8, !tbaa !5
  %37 = load ptr, ptr %4, align 8, !tbaa !5
  call void @generateAndTestListIndex(ptr noundef %36, float noundef 0x3FE3333340000000, ptr noundef %37, float noundef 0x400B333340000000)
  %38 = load ptr, ptr %1, align 8, !tbaa !5
  %39 = load ptr, ptr %4, align 8, !tbaa !5
  call void @generateAndTestListIndex(ptr noundef %38, float noundef 1.000000e+00, ptr noundef %39, float noundef 5.000000e+00)
  %40 = load ptr, ptr %1, align 8, !tbaa !5
  %41 = load ptr, ptr %4, align 8, !tbaa !5
  call void @generateAndTestListIndex(ptr noundef %40, float noundef 1.000000e+00, ptr noundef %41, float noundef 5.000000e+00)
  %42 = load ptr, ptr %1, align 8, !tbaa !5
  %43 = load ptr, ptr %4, align 8, !tbaa !5
  call void @generateAndTestListIndex(ptr noundef %42, float noundef 0x3FF19999A0000000, ptr noundef %43, float noundef 0x3FF6666660000000)
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr %3) #4
  call void @llvm.lifetime.end.p0(i64 20, ptr %2) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %1) #4
  ret void
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "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 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 #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 = !{!10, !11, i64 0}
!10 = !{!"sig_Buffer", !11, i64 0, !6, i64 8}
!11 = !{!"long", !7, i64 0}
!12 = !{!10, !6, i64 8}
!13 = !{!14, !18, i64 24}
!14 = !{!"sig_dsp_List", !15, i64 0, !16, i64 16, !17, i64 24, !19, i64 40, !6, i64 64}
!15 = !{!"sig_dsp_Signal", !6, i64 0, !6, i64 8}
!16 = !{!"sig_dsp_List_Inputs", !6, i64 0}
!17 = !{!"sig_dsp_List_Parameters", !18, i64 0, !18, i64 4, !18, i64 8}
!18 = !{!"float", !7, i64 0}
!19 = !{!"sig_dsp_List_Outputs", !6, i64 0, !6, i64 8, !6, i64 16}
!20 = !{!14, !18, i64 32}
!21 = !{!14, !18, i64 28}
!22 = !{!14, !6, i64 64}
!23 = !{!24, !6, i64 24}
!24 = !{!"sig_dsp_Value", !15, i64 0, !25, i64 16, !26, i64 24, !18, i64 32}
!25 = !{!"sig_dsp_Value_Parameters", !18, i64 0}
!26 = !{!"sig_dsp_Signal_SingleMonoOutput", !6, i64 0}
!27 = !{!14, !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"

%struct.sig_Allocator = type { ptr, ptr }
%struct.sig_Buffer = type { i64, ptr }

@allocator = external dso_local global %struct.sig_Allocator, align 8
@context = external dso_local local_unnamed_addr global ptr, align 8
@__const.test_sig_dsp_List_interpolation.listItems = external hidden unnamed_addr constant [5 x float], align 16

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

declare ptr @sig_dsp_Value_new(ptr noundef, ptr noundef) local_unnamed_addr #1

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

; Function Attrs: nounwind uwtable
declare dso_local void @generateAndTestListIndex(ptr noundef, float noundef, ptr noundef, float noundef) local_unnamed_addr #3

declare ptr @sig_dsp_List_new(ptr noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
define dso_local void @test_sig_dsp_List_interpolation() local_unnamed_addr #3 {
  %1 = alloca [5 x float], align 16
  %2 = alloca %struct.sig_Buffer, align 8
  %3 = load ptr, ptr @context, align 8, !tbaa !5
  %4 = tail call ptr @sig_dsp_Value_new(ptr noundef nonnull @allocator, ptr noundef %3) #4
  call void @llvm.lifetime.start.p0(i64 20, ptr nonnull %1) #4
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(20) %1, ptr noundef nonnull align 16 dereferenceable(20) @__const.test_sig_dsp_List_interpolation.listItems, i64 20, i1 false)
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %2) #4
  store i64 5, ptr %2, align 8, !tbaa !9
  %5 = getelementptr inbounds i8, ptr %2, i64 8
  store ptr %1, ptr %5, align 8, !tbaa !12
  %6 = load ptr, ptr @context, align 8, !tbaa !5
  %7 = call ptr @sig_dsp_List_new(ptr noundef nonnull @allocator, ptr noundef %6) #4
  %8 = getelementptr inbounds i8, ptr %7, i64 24
  %9 = getelementptr inbounds i8, ptr %7, i64 32
  store float 1.000000e+00, ptr %9, align 8, !tbaa !13
  store <2 x float> <float 1.000000e+00, float 1.000000e+00>, ptr %8, align 8, !tbaa !20
  %10 = getelementptr inbounds i8, ptr %7, i64 64
  store ptr %2, ptr %10, align 8, !tbaa !21
  %11 = getelementptr inbounds i8, ptr %4, i64 24
  %12 = load ptr, ptr %11, align 8, !tbaa !22
  %13 = getelementptr inbounds i8, ptr %7, i64 16
  store ptr %12, ptr %13, align 8, !tbaa !26
  call void @generateAndTestListIndex(ptr noundef %4, float noundef 0.000000e+00, ptr noundef %7, float noundef 1.000000e+00)
  call void @generateAndTestListIndex(ptr noundef %4, float noundef 0x3FB99999A0000000, ptr noundef %7, float noundef 0x3FF6666660000000)
  call void @generateAndTestListIndex(ptr noundef %4, float noundef 5.000000e-01, ptr noundef %7, float noundef 3.000000e+00)
  call void @generateAndTestListIndex(ptr noundef %4, float noundef 0x3FE3333340000000, ptr noundef %7, float noundef 0x400B333340000000)
  call void @generateAndTestListIndex(ptr noundef %4, float noundef 1.000000e+00, ptr noundef %7, float noundef 5.000000e+00)
  call void @generateAndTestListIndex(ptr noundef %4, float noundef 1.000000e+00, ptr noundef %7, float noundef 5.000000e+00)
  call void @generateAndTestListIndex(ptr noundef %4, float noundef 0x3FF19999A0000000, ptr noundef %7, float noundef 0x3FF6666660000000)
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %2) #4
  call void @llvm.lifetime.end.p0(i64 20, ptr nonnull %1) #4
  ret void
}

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { 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 #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 = !{!10, !11, i64 0}
!10 = !{!"sig_Buffer", !11, i64 0, !6, i64 8}
!11 = !{!"long", !7, i64 0}
!12 = !{!10, !6, i64 8}
!13 = !{!14, !18, i64 32}
!14 = !{!"sig_dsp_List", !15, i64 0, !16, i64 16, !17, i64 24, !19, i64 40, !6, i64 64}
!15 = !{!"sig_dsp_Signal", !6, i64 0, !6, i64 8}
!16 = !{!"sig_dsp_List_Inputs", !6, i64 0}
!17 = !{!"sig_dsp_List_Parameters", !18, i64 0, !18, i64 4, !18, i64 8}
!18 = !{!"float", !7, i64 0}
!19 = !{!"sig_dsp_List_Outputs", !6, i64 0, !6, i64 8, !6, i64 16}
!20 = !{!18, !18, i64 0}
!21 = !{!14, !6, i64 64}
!22 = !{!23, !6, i64 24}
!23 = !{!"sig_dsp_Value", !15, i64 0, !24, i64 16, !25, i64 24, !18, i64 32}
!24 = !{!"sig_dsp_Value_Parameters", !18, i64 0}
!25 = !{!"sig_dsp_Signal_SingleMonoOutput", !6, i64 0}
!26 = !{!14, !6, i64 16}


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