; 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_DelayLine = type { ptr, i64 }
%struct.sig_Buffer = type { i64, ptr }

; 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: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare float @llvm.fmuladd.f32(float, float, float) #1

; Function Attrs: inlinehint nounwind uwtable
define dso_local float @sig_DelayLine_cubicReadAt(ptr noundef %0, float noundef %1) #2 {
  %3 = alloca ptr, align 8
  %4 = alloca float, align 4
  %5 = alloca i64, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca float, align 4
  %9 = alloca i32, align 4
  %10 = alloca float, align 4
  %11 = alloca float, align 4
  %12 = alloca float, align 4
  %13 = alloca float, align 4
  %14 = alloca float, align 4
  %15 = alloca float, align 4
  %16 = alloca float, align 4
  %17 = alloca float, align 4
  %18 = alloca float, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  store float %1, ptr %4, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #3
  %19 = load ptr, ptr %3, align 8, !tbaa !5
  %20 = getelementptr inbounds %struct.sig_DelayLine, ptr %19, i32 0, i32 0
  %21 = load ptr, ptr %20, align 8, !tbaa !11
  %22 = getelementptr inbounds %struct.sig_Buffer, ptr %21, i32 0, i32 0
  %23 = load i64, ptr %22, align 8, !tbaa !14
  store i64 %23, ptr %5, align 8, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #3
  %24 = load ptr, ptr %3, align 8, !tbaa !5
  %25 = getelementptr inbounds %struct.sig_DelayLine, ptr %24, i32 0, i32 0
  %26 = load ptr, ptr %25, align 8, !tbaa !11
  %27 = getelementptr inbounds %struct.sig_Buffer, ptr %26, i32 0, i32 1
  %28 = load ptr, ptr %27, align 8, !tbaa !17
  store ptr %28, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #3
  %29 = load float, ptr %4, align 4, !tbaa !9
  %30 = fptosi float %29 to i32
  store i32 %30, ptr %7, align 4, !tbaa !18
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #3
  %31 = load float, ptr %4, align 4, !tbaa !9
  %32 = load i32, ptr %7, align 4, !tbaa !18
  %33 = sitofp i32 %32 to float
  %34 = fsub float %31, %33
  store float %34, ptr %8, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #3
  %35 = load ptr, ptr %3, align 8, !tbaa !5
  %36 = getelementptr inbounds %struct.sig_DelayLine, ptr %35, i32 0, i32 1
  %37 = load i64, ptr %36, align 8, !tbaa !20
  %38 = load i32, ptr %7, align 4, !tbaa !18
  %39 = sext i32 %38 to i64
  %40 = add i64 %37, %39
  %41 = load i64, ptr %5, align 8, !tbaa !16
  %42 = add i64 %40, %41
  %43 = trunc i64 %42 to i32
  store i32 %43, ptr %9, align 4, !tbaa !18
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #3
  %44 = load ptr, ptr %6, align 8, !tbaa !5
  %45 = load i32, ptr %9, align 4, !tbaa !18
  %46 = sub nsw i32 %45, 1
  %47 = sext i32 %46 to i64
  %48 = load i64, ptr %5, align 8, !tbaa !16
  %49 = urem i64 %47, %48
  %50 = getelementptr inbounds float, ptr %44, i64 %49
  %51 = load float, ptr %50, align 4, !tbaa !9
  store float %51, ptr %10, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #3
  %52 = load ptr, ptr %6, align 8, !tbaa !5
  %53 = load i32, ptr %9, align 4, !tbaa !18
  %54 = sext i32 %53 to i64
  %55 = load i64, ptr %5, align 8, !tbaa !16
  %56 = urem i64 %54, %55
  %57 = getelementptr inbounds float, ptr %52, i64 %56
  %58 = load float, ptr %57, align 4, !tbaa !9
  store float %58, ptr %11, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #3
  %59 = load ptr, ptr %6, align 8, !tbaa !5
  %60 = load i32, ptr %9, align 4, !tbaa !18
  %61 = add nsw i32 %60, 1
  %62 = sext i32 %61 to i64
  %63 = load i64, ptr %5, align 8, !tbaa !16
  %64 = urem i64 %62, %63
  %65 = getelementptr inbounds float, ptr %59, i64 %64
  %66 = load float, ptr %65, align 4, !tbaa !9
  store float %66, ptr %12, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #3
  %67 = load ptr, ptr %6, align 8, !tbaa !5
  %68 = load i32, ptr %9, align 4, !tbaa !18
  %69 = add nsw i32 %68, 2
  %70 = sext i32 %69 to i64
  %71 = load i64, ptr %5, align 8, !tbaa !16
  %72 = urem i64 %70, %71
  %73 = getelementptr inbounds float, ptr %67, i64 %72
  %74 = load float, ptr %73, align 4, !tbaa !9
  store float %74, ptr %13, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #3
  %75 = load float, ptr %12, align 4, !tbaa !9
  %76 = load float, ptr %10, align 4, !tbaa !9
  %77 = fsub float %75, %76
  %78 = fmul float %77, 5.000000e-01
  store float %78, ptr %14, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #3
  %79 = load float, ptr %11, align 4, !tbaa !9
  %80 = load float, ptr %12, align 4, !tbaa !9
  %81 = fsub float %79, %80
  store float %81, ptr %15, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #3
  %82 = load float, ptr %14, align 4, !tbaa !9
  %83 = load float, ptr %15, align 4, !tbaa !9
  %84 = fadd float %82, %83
  store float %84, ptr %16, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #3
  %85 = load float, ptr %16, align 4, !tbaa !9
  %86 = load float, ptr %15, align 4, !tbaa !9
  %87 = fadd float %85, %86
  %88 = load float, ptr %13, align 4, !tbaa !9
  %89 = load float, ptr %11, align 4, !tbaa !9
  %90 = fsub float %88, %89
  %91 = call float @llvm.fmuladd.f32(float %90, float 5.000000e-01, float %87)
  store float %91, ptr %17, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #3
  %92 = load float, ptr %16, align 4, !tbaa !9
  %93 = load float, ptr %17, align 4, !tbaa !9
  %94 = fadd float %92, %93
  store float %94, ptr %18, align 4, !tbaa !9
  %95 = load float, ptr %17, align 4, !tbaa !9
  %96 = load float, ptr %8, align 4, !tbaa !9
  %97 = load float, ptr %18, align 4, !tbaa !9
  %98 = fneg float %97
  %99 = call float @llvm.fmuladd.f32(float %95, float %96, float %98)
  %100 = load float, ptr %8, align 4, !tbaa !9
  %101 = load float, ptr %14, align 4, !tbaa !9
  %102 = call float @llvm.fmuladd.f32(float %99, float %100, float %101)
  %103 = load float, ptr %8, align 4, !tbaa !9
  %104 = load float, ptr %11, align 4, !tbaa !9
  %105 = call float @llvm.fmuladd.f32(float %102, float %103, float %104)
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #3
  ret float %105
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #2 = { inlinehint 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 #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 = !{!10, !10, i64 0}
!10 = !{!"float", !7, i64 0}
!11 = !{!12, !6, i64 0}
!12 = !{!"sig_DelayLine", !6, i64 0, !13, i64 8}
!13 = !{!"long", !7, i64 0}
!14 = !{!15, !13, i64 0}
!15 = !{!"sig_Buffer", !13, i64 0, !6, i64 8}
!16 = !{!13, !13, i64 0}
!17 = !{!15, !6, i64 8}
!18 = !{!19, !19, i64 0}
!19 = !{!"int", !7, i64 0}
!20 = !{!12, !13, i64 8}


; 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: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare float @llvm.fmuladd.f32(float, float, float) #0

; Function Attrs: inlinehint mustprogress nofree norecurse nosync nounwind willreturn memory(read, inaccessiblemem: none) uwtable
define dso_local float @sig_DelayLine_cubicReadAt(ptr nocapture noundef readonly %0, float noundef %1) local_unnamed_addr #1 {
  %3 = load ptr, ptr %0, align 8, !tbaa !5
  %4 = load i64, ptr %3, align 8, !tbaa !11
  %5 = getelementptr inbounds i8, ptr %3, i64 8
  %6 = load ptr, ptr %5, align 8, !tbaa !13
  %7 = fptosi float %1 to i32
  %8 = sitofp i32 %7 to float
  %9 = fsub float %1, %8
  %10 = getelementptr inbounds i8, ptr %0, i64 8
  %11 = load i64, ptr %10, align 8, !tbaa !14
  %12 = zext i32 %7 to i64
  %13 = add i64 %4, %12
  %14 = add i64 %13, %11
  %15 = shl i64 %14, 32
  %sext = add i64 %15, -4294967296
  %16 = ashr exact i64 %sext, 32
  %17 = urem i64 %16, %4
  %18 = getelementptr inbounds float, ptr %6, i64 %17
  %19 = load float, ptr %18, align 4, !tbaa !15
  %20 = ashr exact i64 %15, 32
  %21 = urem i64 %20, %4
  %22 = getelementptr inbounds float, ptr %6, i64 %21
  %23 = load float, ptr %22, align 4, !tbaa !15
  %sext39 = add i64 %15, 4294967296
  %24 = ashr exact i64 %sext39, 32
  %25 = urem i64 %24, %4
  %26 = getelementptr inbounds float, ptr %6, i64 %25
  %27 = load float, ptr %26, align 4, !tbaa !15
  %sext40 = add i64 %15, 8589934592
  %28 = ashr exact i64 %sext40, 32
  %29 = urem i64 %28, %4
  %30 = getelementptr inbounds float, ptr %6, i64 %29
  %31 = load float, ptr %30, align 4, !tbaa !15
  %32 = fsub float %27, %19
  %33 = fmul float %32, 5.000000e-01
  %34 = fsub float %23, %27
  %35 = fadd float %34, %33
  %36 = fadd float %34, %35
  %37 = fsub float %31, %23
  %38 = tail call float @llvm.fmuladd.f32(float %37, float 5.000000e-01, float %36)
  %39 = fadd float %35, %38
  %40 = fneg float %39
  %41 = tail call float @llvm.fmuladd.f32(float %38, float %9, float %40)
  %42 = tail call float @llvm.fmuladd.f32(float %41, float %9, float %33)
  %43 = tail call float @llvm.fmuladd.f32(float %42, float %9, float %23)
  ret float %43
}

attributes #0 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #1 = { inlinehint mustprogress nofree norecurse nosync nounwind willreturn memory(read, inaccessiblemem: none) 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, !7, i64 0}
!6 = !{!"sig_DelayLine", !7, i64 0, !10, i64 8}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"long", !8, i64 0}
!11 = !{!12, !10, i64 0}
!12 = !{!"sig_Buffer", !10, i64 0, !7, i64 8}
!13 = !{!12, !7, i64 8}
!14 = !{!6, !10, i64 8}
!15 = !{!16, !16, i64 0}
!16 = !{!"float", !8, i64 0}


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