; 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_TiltEQ = type { %struct.sig_dsp_Signal, %struct.sig_dsp_TiltEQ_Inputs, %struct.sig_dsp_Signal_SingleMonoOutput, float, float }
%struct.sig_dsp_Signal = type { ptr, ptr }
%struct.sig_dsp_TiltEQ_Inputs = type { ptr, ptr, ptr }
%struct.sig_dsp_Signal_SingleMonoOutput = type { ptr }
%struct.sig_AudioSettings = type { float, i64, i64 }

; 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: nounwind uwtable
define dso_local void @sig_dsp_TiltEQ_generate(ptr noundef %0) #2 {
  %2 = alloca ptr, align 8
  %3 = alloca ptr, align 8
  %4 = alloca float, align 4
  %5 = alloca float, align 4
  %6 = alloca float, align 4
  %7 = alloca float, align 4
  %8 = alloca i64, align 8
  %9 = alloca float, 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
  %19 = alloca float, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #4
  %20 = load ptr, ptr %2, align 8, !tbaa !5
  store ptr %20, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #4
  store float 0x40214FF580000000, ptr %4, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #4
  store float 5.000000e+00, ptr %5, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #4
  %21 = load ptr, ptr %3, align 8, !tbaa !5
  %22 = getelementptr inbounds %struct.sig_dsp_TiltEQ, ptr %21, i32 0, i32 3
  %23 = load float, ptr %22, align 8, !tbaa !11
  store float %23, ptr %6, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  %24 = load ptr, ptr %3, align 8, !tbaa !5
  %25 = getelementptr inbounds %struct.sig_dsp_TiltEQ, ptr %24, i32 0, i32 4
  %26 = load float, ptr %25, align 4, !tbaa !16
  store float %26, ptr %7, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #4
  store i64 0, ptr %8, align 8, !tbaa !17
  br label %27

27:                                               ; preds = %130, %1
  %28 = load i64, ptr %8, align 8, !tbaa !17
  %29 = load ptr, ptr %3, align 8, !tbaa !5
  %30 = getelementptr inbounds %struct.sig_dsp_TiltEQ, ptr %29, i32 0, i32 0
  %31 = getelementptr inbounds %struct.sig_dsp_Signal, ptr %30, i32 0, i32 0
  %32 = load ptr, ptr %31, align 8, !tbaa !19
  %33 = getelementptr inbounds %struct.sig_AudioSettings, ptr %32, i32 0, i32 2
  %34 = load i64, ptr %33, align 8, !tbaa !20
  %35 = icmp ult i64 %28, %34
  br i1 %35, label %37, label %36

36:                                               ; preds = %27
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #4
  br label %133

37:                                               ; preds = %27
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #4
  %38 = load ptr, ptr %3, align 8, !tbaa !5
  %39 = getelementptr inbounds %struct.sig_dsp_TiltEQ, ptr %38, i32 0, i32 1
  %40 = getelementptr inbounds %struct.sig_dsp_TiltEQ_Inputs, ptr %39, i32 0, i32 0
  %41 = load ptr, ptr %40, align 8, !tbaa !22
  %42 = load i64, ptr %8, align 8, !tbaa !17
  %43 = getelementptr inbounds float, ptr %41, i64 %42
  %44 = load float, ptr %43, align 4, !tbaa !9
  store float %44, ptr %9, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #4
  %45 = load ptr, ptr %3, align 8, !tbaa !5
  %46 = getelementptr inbounds %struct.sig_dsp_TiltEQ, ptr %45, i32 0, i32 1
  %47 = getelementptr inbounds %struct.sig_dsp_TiltEQ_Inputs, ptr %46, i32 0, i32 1
  %48 = load ptr, ptr %47, align 8, !tbaa !23
  %49 = load i64, ptr %8, align 8, !tbaa !17
  %50 = getelementptr inbounds float, ptr %48, 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) #4
  %52 = load ptr, ptr %3, align 8, !tbaa !5
  %53 = getelementptr inbounds %struct.sig_dsp_TiltEQ, ptr %52, i32 0, i32 1
  %54 = getelementptr inbounds %struct.sig_dsp_TiltEQ_Inputs, ptr %53, i32 0, i32 2
  %55 = load ptr, ptr %54, align 8, !tbaa !24
  %56 = load i64, ptr %8, align 8, !tbaa !17
  %57 = getelementptr inbounds float, ptr %55, i64 %56
  %58 = load float, ptr %57, align 4, !tbaa !9
  %59 = fmul float %58, 6.000000e+00
  store float %59, ptr %11, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #4
  %60 = load float, ptr %11, align 4, !tbaa !9
  %61 = fcmp ogt float %60, 0.000000e+00
  br i1 %61, label %62, label %68

62:                                               ; preds = %37
  %63 = load float, ptr %5, align 4, !tbaa !9
  %64 = fneg float %63
  %65 = load float, ptr %11, align 4, !tbaa !9
  %66 = fmul float %64, %65
  store float %66, ptr %12, align 4, !tbaa !9
  %67 = load float, ptr %11, align 4, !tbaa !9
  store float %67, ptr %13, align 4, !tbaa !9
  br label %74

68:                                               ; preds = %37
  %69 = load float, ptr %11, align 4, !tbaa !9
  %70 = fneg float %69
  store float %70, ptr %12, align 4, !tbaa !9
  %71 = load float, ptr %5, align 4, !tbaa !9
  %72 = load float, ptr %11, align 4, !tbaa !9
  %73 = fmul float %71, %72
  store float %73, ptr %13, align 4, !tbaa !9
  br label %74

74:                                               ; preds = %68, %62
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #4
  %75 = load float, ptr %12, align 4, !tbaa !9
  %76 = load float, ptr %4, align 4, !tbaa !9
  %77 = fdiv float %75, %76
  %78 = fpext float %77 to double
  %79 = call double @exp(double noundef %78) #4
  %80 = fsub double %79, 1.000000e+00
  %81 = fptrunc double %80 to float
  store float %81, ptr %14, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #4
  %82 = load float, ptr %13, align 4, !tbaa !9
  %83 = load float, ptr %4, align 4, !tbaa !9
  %84 = fdiv float %82, %83
  %85 = fpext float %84 to double
  %86 = call double @exp(double noundef %85) #4
  %87 = fsub double %86, 1.000000e+00
  %88 = fptrunc double %87 to float
  store float %88, ptr %15, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #4
  %89 = load float, ptr %10, align 4, !tbaa !9
  %90 = fmul float 0x401921FB60000000, %89
  store float %90, ptr %16, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #4
  %91 = load float, ptr %6, align 4, !tbaa !9
  %92 = load float, ptr %16, align 4, !tbaa !9
  %93 = fadd float %91, %92
  %94 = fpext float %93 to double
  %95 = fdiv double 1.000000e+00, %94
  %96 = fptrunc double %95 to float
  store float %96, ptr %17, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #4
  %97 = load float, ptr %16, align 4, !tbaa !9
  %98 = fpext float %97 to double
  %99 = fmul double 2.000000e+00, %98
  %100 = load float, ptr %17, align 4, !tbaa !9
  %101 = fpext float %100 to double
  %102 = fmul double %99, %101
  %103 = fptrunc double %102 to float
  store float %103, ptr %18, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #4
  %104 = load float, ptr %6, align 4, !tbaa !9
  %105 = load float, ptr %16, align 4, !tbaa !9
  %106 = fsub float %104, %105
  %107 = load float, ptr %17, align 4, !tbaa !9
  %108 = fmul float %106, %107
  store float %108, ptr %19, align 4, !tbaa !9
  %109 = load float, ptr %18, align 4, !tbaa !9
  %110 = load float, ptr %9, align 4, !tbaa !9
  %111 = load float, ptr %19, align 4, !tbaa !9
  %112 = load float, ptr %7, align 4, !tbaa !9
  %113 = fmul float %111, %112
  %114 = call float @llvm.fmuladd.f32(float %109, float %110, float %113)
  store float %114, ptr %7, align 4, !tbaa !9
  %115 = load float, ptr %9, align 4, !tbaa !9
  %116 = load float, ptr %14, align 4, !tbaa !9
  %117 = load float, ptr %7, align 4, !tbaa !9
  %118 = call float @llvm.fmuladd.f32(float %116, float %117, float %115)
  %119 = load float, ptr %15, align 4, !tbaa !9
  %120 = load float, ptr %9, align 4, !tbaa !9
  %121 = load float, ptr %7, align 4, !tbaa !9
  %122 = fsub float %120, %121
  %123 = call float @llvm.fmuladd.f32(float %119, float %122, float %118)
  %124 = load ptr, ptr %3, align 8, !tbaa !5
  %125 = getelementptr inbounds %struct.sig_dsp_TiltEQ, ptr %124, i32 0, i32 2
  %126 = getelementptr inbounds %struct.sig_dsp_Signal_SingleMonoOutput, ptr %125, i32 0, i32 0
  %127 = load ptr, ptr %126, align 8, !tbaa !25
  %128 = load i64, ptr %8, align 8, !tbaa !17
  %129 = getelementptr inbounds float, ptr %127, i64 %128
  store float %123, ptr %129, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #4
  br label %130

130:                                              ; preds = %74
  %131 = load i64, ptr %8, align 8, !tbaa !17
  %132 = add i64 %131, 1
  store i64 %132, ptr %8, align 8, !tbaa !17
  br label %27, !llvm.loop !26

133:                                              ; preds = %36
  %134 = load float, ptr %7, align 4, !tbaa !9
  %135 = load ptr, ptr %3, align 8, !tbaa !5
  %136 = getelementptr inbounds %struct.sig_dsp_TiltEQ, ptr %135, i32 0, i32 4
  store float %134, ptr %136, align 4, !tbaa !16
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #4
  ret void
}

; Function Attrs: nounwind
declare double @exp(double noundef) #3

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #2 = { 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 "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, !10, i64 0}
!10 = !{!"float", !7, i64 0}
!11 = !{!12, !10, i64 48}
!12 = !{!"sig_dsp_TiltEQ", !13, i64 0, !14, i64 16, !15, i64 40, !10, i64 48, !10, i64 52}
!13 = !{!"sig_dsp_Signal", !6, i64 0, !6, i64 8}
!14 = !{!"sig_dsp_TiltEQ_Inputs", !6, i64 0, !6, i64 8, !6, i64 16}
!15 = !{!"sig_dsp_Signal_SingleMonoOutput", !6, i64 0}
!16 = !{!12, !10, i64 52}
!17 = !{!18, !18, i64 0}
!18 = !{!"long", !7, i64 0}
!19 = !{!12, !6, i64 0}
!20 = !{!21, !18, i64 16}
!21 = !{!"sig_AudioSettings", !10, i64 0, !18, i64 8, !18, i64 16}
!22 = !{!12, !6, i64 16}
!23 = !{!12, !6, i64 24}
!24 = !{!12, !6, i64 32}
!25 = !{!12, !6, i64 40}
!26 = distinct !{!26, !27}
!27 = !{!"llvm.loop.mustprogress"}


; 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: nofree nounwind memory(readwrite, inaccessiblemem: write) uwtable
define dso_local void @sig_dsp_TiltEQ_generate(ptr nocapture noundef %0) local_unnamed_addr #1 {
  %2 = getelementptr inbounds i8, ptr %0, i64 48
  %3 = load float, ptr %2, align 8, !tbaa !5
  %4 = getelementptr inbounds i8, ptr %0, i64 52
  %5 = load float, ptr %4, align 4, !tbaa !14
  %6 = load ptr, ptr %0, align 8, !tbaa !15
  %7 = getelementptr inbounds i8, ptr %6, i64 16
  %8 = load i64, ptr %7, align 8, !tbaa !16
  %.not = icmp eq i64 %8, 0
  br i1 %.not, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %1
  %9 = getelementptr inbounds i8, ptr %0, i64 16
  %10 = getelementptr inbounds i8, ptr %0, i64 24
  %11 = getelementptr inbounds i8, ptr %0, i64 32
  %12 = getelementptr inbounds i8, ptr %0, i64 40
  br label %13

._crit_edge:                                      ; preds = %13, %1
  %.0.lcssa = phi float [ %5, %1 ], [ %49, %13 ]
  store float %.0.lcssa, ptr %4, align 4, !tbaa !14
  ret void

13:                                               ; preds = %.lr.ph, %13
  %.049 = phi float [ %5, %.lr.ph ], [ %49, %13 ]
  %.04448 = phi i64 [ 0, %.lr.ph ], [ %55, %13 ]
  %14 = load ptr, ptr %9, align 8, !tbaa !19
  %15 = getelementptr inbounds float, ptr %14, i64 %.04448
  %16 = load float, ptr %15, align 4, !tbaa !20
  %17 = load ptr, ptr %10, align 8, !tbaa !21
  %18 = getelementptr inbounds float, ptr %17, i64 %.04448
  %19 = load float, ptr %18, align 4, !tbaa !20
  %20 = load ptr, ptr %11, align 8, !tbaa !22
  %21 = getelementptr inbounds float, ptr %20, i64 %.04448
  %22 = load float, ptr %21, align 4, !tbaa !20
  %23 = fmul float %22, 6.000000e+00
  %24 = fcmp ogt float %23, 0.000000e+00
  %25 = fmul float %23, -5.000000e+00
  %26 = fneg float %23
  %27 = fmul float %23, 5.000000e+00
  %.046 = select i1 %24, float %23, float %27
  %.045 = select i1 %24, float %25, float %26
  %28 = fdiv float %.045, 0x40214FF580000000
  %29 = fpext float %28 to double
  %30 = tail call double @exp(double noundef %29) #3
  %31 = fadd double %30, -1.000000e+00
  %32 = fptrunc double %31 to float
  %33 = fdiv float %.046, 0x40214FF580000000
  %34 = fpext float %33 to double
  %35 = tail call double @exp(double noundef %34) #3
  %36 = fadd double %35, -1.000000e+00
  %37 = fptrunc double %36 to float
  %38 = fmul float %19, 0x401921FB60000000
  %39 = fadd float %3, %38
  %40 = fdiv float 1.000000e+00, %39
  %41 = fpext float %38 to double
  %42 = fmul double %41, 2.000000e+00
  %43 = fpext float %40 to double
  %44 = fmul double %42, %43
  %45 = fptrunc double %44 to float
  %46 = fsub float %3, %38
  %47 = fmul float %46, %40
  %48 = fmul float %.049, %47
  %49 = tail call float @llvm.fmuladd.f32(float %45, float %16, float %48)
  %50 = tail call float @llvm.fmuladd.f32(float %32, float %49, float %16)
  %51 = fsub float %16, %49
  %52 = tail call float @llvm.fmuladd.f32(float %37, float %51, float %50)
  %53 = load ptr, ptr %12, align 8, !tbaa !23
  %54 = getelementptr inbounds float, ptr %53, i64 %.04448
  store float %52, ptr %54, align 4, !tbaa !20
  %55 = add nuw i64 %.04448, 1
  %56 = load ptr, ptr %0, align 8, !tbaa !15
  %57 = getelementptr inbounds i8, ptr %56, i64 16
  %58 = load i64, ptr %57, align 8, !tbaa !16
  %59 = icmp ult i64 %55, %58
  br i1 %59, label %13, label %._crit_edge, !llvm.loop !24
}

; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @exp(double noundef) local_unnamed_addr #2

attributes #0 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #1 = { nofree nounwind memory(readwrite, inaccessiblemem: write) 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 = { mustprogress nofree nounwind willreturn memory(write) "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, !13, i64 48}
!6 = !{!"sig_dsp_TiltEQ", !7, i64 0, !11, i64 16, !12, i64 40, !13, i64 48, !13, i64 52}
!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_TiltEQ_Inputs", !8, i64 0, !8, i64 8, !8, i64 16}
!12 = !{!"sig_dsp_Signal_SingleMonoOutput", !8, i64 0}
!13 = !{!"float", !9, i64 0}
!14 = !{!6, !13, i64 52}
!15 = !{!6, !8, i64 0}
!16 = !{!17, !18, i64 16}
!17 = !{!"sig_AudioSettings", !13, i64 0, !18, i64 8, !18, i64 16}
!18 = !{!"long", !9, i64 0}
!19 = !{!6, !8, i64 16}
!20 = !{!13, !13, i64 0}
!21 = !{!6, !8, i64 24}
!22 = !{!6, !8, i64 32}
!23 = !{!6, !8, i64 40}
!24 = distinct !{!24, !25}
!25 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass