; LLVM IR from jgaeddert/liquid-dsp :: src/filter/src (filter_cccf)

; 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.iirfiltsos_cccf_s = type { [3 x { float, float }], [3 x { float, float }], [3 x { float, float }], [3 x { float, float }], [3 x { float, float }] }

; 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 <2 x float> @__divsc3(float, float, float, float)

; Function Attrs: nounwind uwtable
define dso_local i32 @iirfiltsos_cccf_set_coefficients(ptr noundef %0, ptr noundef %1, ptr noundef %2) #1 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca { float, float }, align 4
  %8 = alloca { float, float }, align 4
  %9 = alloca { float, float }, align 4
  %10 = alloca { float, float }, align 4
  %11 = alloca { float, float }, align 4
  %12 = alloca { float, float }, align 4
  %13 = alloca { float, float }, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  store ptr %2, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #2
  %14 = load ptr, ptr %6, align 8, !tbaa !5
  %15 = getelementptr inbounds { float, float }, ptr %14, i64 0
  %16 = getelementptr inbounds { float, float }, ptr %15, i32 0, i32 0
  %17 = load float, ptr %16, align 4
  %18 = getelementptr inbounds { float, float }, ptr %15, i32 0, i32 1
  %19 = load float, ptr %18, align 4
  %20 = getelementptr inbounds { float, float }, ptr %7, i32 0, i32 0
  %21 = getelementptr inbounds { float, float }, ptr %7, i32 0, i32 1
  store float %17, ptr %20, align 4
  store float %19, ptr %21, align 4
  %22 = load ptr, ptr %5, align 8, !tbaa !5
  %23 = getelementptr inbounds { float, float }, ptr %22, i64 0
  %24 = getelementptr inbounds { float, float }, ptr %23, i32 0, i32 0
  %25 = load float, ptr %24, align 4
  %26 = getelementptr inbounds { float, float }, ptr %23, i32 0, i32 1
  %27 = load float, ptr %26, align 4
  %28 = getelementptr inbounds { float, float }, ptr %7, i32 0, i32 0
  %29 = load float, ptr %28, align 4
  %30 = getelementptr inbounds { float, float }, ptr %7, i32 0, i32 1
  %31 = load float, ptr %30, align 4
  %32 = call <2 x float> @__divsc3(float noundef %25, float noundef %27, float noundef %29, float noundef %31) #2
  store <2 x float> %32, ptr %8, align 4
  %33 = getelementptr inbounds { float, float }, ptr %8, i32 0, i32 0
  %34 = load float, ptr %33, align 4
  %35 = getelementptr inbounds { float, float }, ptr %8, i32 0, i32 1
  %36 = load float, ptr %35, align 4
  %37 = load ptr, ptr %4, align 8, !tbaa !5
  %38 = getelementptr inbounds %struct.iirfiltsos_cccf_s, ptr %37, i32 0, i32 0
  %39 = getelementptr inbounds [3 x { float, float }], ptr %38, i64 0, i64 0
  %40 = getelementptr inbounds { float, float }, ptr %39, i32 0, i32 0
  %41 = getelementptr inbounds { float, float }, ptr %39, i32 0, i32 1
  store float %34, ptr %40, align 4
  store float %36, ptr %41, align 4
  %42 = load ptr, ptr %5, align 8, !tbaa !5
  %43 = getelementptr inbounds { float, float }, ptr %42, i64 1
  %44 = getelementptr inbounds { float, float }, ptr %43, i32 0, i32 0
  %45 = load float, ptr %44, align 4
  %46 = getelementptr inbounds { float, float }, ptr %43, i32 0, i32 1
  %47 = load float, ptr %46, align 4
  %48 = getelementptr inbounds { float, float }, ptr %7, i32 0, i32 0
  %49 = load float, ptr %48, align 4
  %50 = getelementptr inbounds { float, float }, ptr %7, i32 0, i32 1
  %51 = load float, ptr %50, align 4
  %52 = call <2 x float> @__divsc3(float noundef %45, float noundef %47, float noundef %49, float noundef %51) #2
  store <2 x float> %52, ptr %9, align 4
  %53 = getelementptr inbounds { float, float }, ptr %9, i32 0, i32 0
  %54 = load float, ptr %53, align 4
  %55 = getelementptr inbounds { float, float }, ptr %9, i32 0, i32 1
  %56 = load float, ptr %55, align 4
  %57 = load ptr, ptr %4, align 8, !tbaa !5
  %58 = getelementptr inbounds %struct.iirfiltsos_cccf_s, ptr %57, i32 0, i32 0
  %59 = getelementptr inbounds [3 x { float, float }], ptr %58, i64 0, i64 1
  %60 = getelementptr inbounds { float, float }, ptr %59, i32 0, i32 0
  %61 = getelementptr inbounds { float, float }, ptr %59, i32 0, i32 1
  store float %54, ptr %60, align 4
  store float %56, ptr %61, align 4
  %62 = load ptr, ptr %5, align 8, !tbaa !5
  %63 = getelementptr inbounds { float, float }, ptr %62, i64 2
  %64 = getelementptr inbounds { float, float }, ptr %63, i32 0, i32 0
  %65 = load float, ptr %64, align 4
  %66 = getelementptr inbounds { float, float }, ptr %63, i32 0, i32 1
  %67 = load float, ptr %66, align 4
  %68 = getelementptr inbounds { float, float }, ptr %7, i32 0, i32 0
  %69 = load float, ptr %68, align 4
  %70 = getelementptr inbounds { float, float }, ptr %7, i32 0, i32 1
  %71 = load float, ptr %70, align 4
  %72 = call <2 x float> @__divsc3(float noundef %65, float noundef %67, float noundef %69, float noundef %71) #2
  store <2 x float> %72, ptr %10, align 4
  %73 = getelementptr inbounds { float, float }, ptr %10, i32 0, i32 0
  %74 = load float, ptr %73, align 4
  %75 = getelementptr inbounds { float, float }, ptr %10, i32 0, i32 1
  %76 = load float, ptr %75, align 4
  %77 = load ptr, ptr %4, align 8, !tbaa !5
  %78 = getelementptr inbounds %struct.iirfiltsos_cccf_s, ptr %77, i32 0, i32 0
  %79 = getelementptr inbounds [3 x { float, float }], ptr %78, i64 0, i64 2
  %80 = getelementptr inbounds { float, float }, ptr %79, i32 0, i32 0
  %81 = getelementptr inbounds { float, float }, ptr %79, i32 0, i32 1
  store float %74, ptr %80, align 4
  store float %76, ptr %81, align 4
  %82 = load ptr, ptr %6, align 8, !tbaa !5
  %83 = getelementptr inbounds { float, float }, ptr %82, i64 0
  %84 = getelementptr inbounds { float, float }, ptr %83, i32 0, i32 0
  %85 = load float, ptr %84, align 4
  %86 = getelementptr inbounds { float, float }, ptr %83, i32 0, i32 1
  %87 = load float, ptr %86, align 4
  %88 = getelementptr inbounds { float, float }, ptr %7, i32 0, i32 0
  %89 = load float, ptr %88, align 4
  %90 = getelementptr inbounds { float, float }, ptr %7, i32 0, i32 1
  %91 = load float, ptr %90, align 4
  %92 = call <2 x float> @__divsc3(float noundef %85, float noundef %87, float noundef %89, float noundef %91) #2
  store <2 x float> %92, ptr %11, align 4
  %93 = getelementptr inbounds { float, float }, ptr %11, i32 0, i32 0
  %94 = load float, ptr %93, align 4
  %95 = getelementptr inbounds { float, float }, ptr %11, i32 0, i32 1
  %96 = load float, ptr %95, align 4
  %97 = load ptr, ptr %4, align 8, !tbaa !5
  %98 = getelementptr inbounds %struct.iirfiltsos_cccf_s, ptr %97, i32 0, i32 1
  %99 = getelementptr inbounds [3 x { float, float }], ptr %98, i64 0, i64 0
  %100 = getelementptr inbounds { float, float }, ptr %99, i32 0, i32 0
  %101 = getelementptr inbounds { float, float }, ptr %99, i32 0, i32 1
  store float %94, ptr %100, align 4
  store float %96, ptr %101, align 4
  %102 = load ptr, ptr %6, align 8, !tbaa !5
  %103 = getelementptr inbounds { float, float }, ptr %102, i64 1
  %104 = getelementptr inbounds { float, float }, ptr %103, i32 0, i32 0
  %105 = load float, ptr %104, align 4
  %106 = getelementptr inbounds { float, float }, ptr %103, i32 0, i32 1
  %107 = load float, ptr %106, align 4
  %108 = getelementptr inbounds { float, float }, ptr %7, i32 0, i32 0
  %109 = load float, ptr %108, align 4
  %110 = getelementptr inbounds { float, float }, ptr %7, i32 0, i32 1
  %111 = load float, ptr %110, align 4
  %112 = call <2 x float> @__divsc3(float noundef %105, float noundef %107, float noundef %109, float noundef %111) #2
  store <2 x float> %112, ptr %12, align 4
  %113 = getelementptr inbounds { float, float }, ptr %12, i32 0, i32 0
  %114 = load float, ptr %113, align 4
  %115 = getelementptr inbounds { float, float }, ptr %12, i32 0, i32 1
  %116 = load float, ptr %115, align 4
  %117 = load ptr, ptr %4, align 8, !tbaa !5
  %118 = getelementptr inbounds %struct.iirfiltsos_cccf_s, ptr %117, i32 0, i32 1
  %119 = getelementptr inbounds [3 x { float, float }], ptr %118, i64 0, i64 1
  %120 = getelementptr inbounds { float, float }, ptr %119, i32 0, i32 0
  %121 = getelementptr inbounds { float, float }, ptr %119, i32 0, i32 1
  store float %114, ptr %120, align 4
  store float %116, ptr %121, align 4
  %122 = load ptr, ptr %6, align 8, !tbaa !5
  %123 = getelementptr inbounds { float, float }, ptr %122, i64 2
  %124 = getelementptr inbounds { float, float }, ptr %123, i32 0, i32 0
  %125 = load float, ptr %124, align 4
  %126 = getelementptr inbounds { float, float }, ptr %123, i32 0, i32 1
  %127 = load float, ptr %126, align 4
  %128 = getelementptr inbounds { float, float }, ptr %7, i32 0, i32 0
  %129 = load float, ptr %128, align 4
  %130 = getelementptr inbounds { float, float }, ptr %7, i32 0, i32 1
  %131 = load float, ptr %130, align 4
  %132 = call <2 x float> @__divsc3(float noundef %125, float noundef %127, float noundef %129, float noundef %131) #2
  store <2 x float> %132, ptr %13, align 4
  %133 = getelementptr inbounds { float, float }, ptr %13, i32 0, i32 0
  %134 = load float, ptr %133, align 4
  %135 = getelementptr inbounds { float, float }, ptr %13, i32 0, i32 1
  %136 = load float, ptr %135, align 4
  %137 = load ptr, ptr %4, align 8, !tbaa !5
  %138 = getelementptr inbounds %struct.iirfiltsos_cccf_s, ptr %137, i32 0, i32 1
  %139 = getelementptr inbounds [3 x { float, float }], ptr %138, i64 0, i64 2
  %140 = getelementptr inbounds { float, float }, ptr %139, i32 0, i32 0
  %141 = getelementptr inbounds { float, float }, ptr %139, i32 0, i32 1
  store float %134, ptr %140, align 4
  store float %136, ptr %141, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #2
  ret i32 0
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nounwind uwtable "min-legal-vector-width"="64" "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 = { 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"}


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

declare <2 x float> @__divsc3(float, float, float, float) local_unnamed_addr

; Function Attrs: nounwind uwtable
define dso_local noundef i32 @iirfiltsos_cccf_set_coefficients(ptr nocapture noundef writeonly %0, ptr nocapture noundef readonly %1, ptr nocapture noundef readonly %2) local_unnamed_addr #0 {
  %4 = load float, ptr %2, align 4
  %5 = getelementptr inbounds i8, ptr %2, i64 4
  %6 = load float, ptr %5, align 4
  %7 = load float, ptr %1, align 4
  %8 = getelementptr inbounds i8, ptr %1, i64 4
  %9 = load float, ptr %8, align 4
  %10 = tail call <2 x float> @__divsc3(float noundef %7, float noundef %9, float noundef %4, float noundef %6) #1
  store <2 x float> %10, ptr %0, align 4
  %11 = getelementptr inbounds i8, ptr %1, i64 8
  %12 = load float, ptr %11, align 4
  %13 = getelementptr inbounds i8, ptr %1, i64 12
  %14 = load float, ptr %13, align 4
  %15 = tail call <2 x float> @__divsc3(float noundef %12, float noundef %14, float noundef %4, float noundef %6) #1
  %16 = getelementptr inbounds i8, ptr %0, i64 8
  store <2 x float> %15, ptr %16, align 4
  %17 = getelementptr inbounds i8, ptr %1, i64 16
  %18 = load float, ptr %17, align 4
  %19 = getelementptr inbounds i8, ptr %1, i64 20
  %20 = load float, ptr %19, align 4
  %21 = tail call <2 x float> @__divsc3(float noundef %18, float noundef %20, float noundef %4, float noundef %6) #1
  %22 = getelementptr inbounds i8, ptr %0, i64 16
  store <2 x float> %21, ptr %22, align 4
  %23 = load float, ptr %2, align 4
  %24 = load float, ptr %5, align 4
  %25 = tail call <2 x float> @__divsc3(float noundef %23, float noundef %24, float noundef %4, float noundef %6) #1
  %26 = getelementptr inbounds i8, ptr %0, i64 24
  store <2 x float> %25, ptr %26, align 4
  %27 = getelementptr inbounds i8, ptr %2, i64 8
  %28 = load float, ptr %27, align 4
  %29 = getelementptr inbounds i8, ptr %2, i64 12
  %30 = load float, ptr %29, align 4
  %31 = tail call <2 x float> @__divsc3(float noundef %28, float noundef %30, float noundef %4, float noundef %6) #1
  %32 = getelementptr inbounds i8, ptr %0, i64 32
  store <2 x float> %31, ptr %32, align 4
  %33 = getelementptr inbounds i8, ptr %2, i64 16
  %34 = load float, ptr %33, align 4
  %35 = getelementptr inbounds i8, ptr %2, i64 20
  %36 = load float, ptr %35, align 4
  %37 = tail call <2 x float> @__divsc3(float noundef %34, float noundef %36, float noundef %4, float noundef %6) #1
  %38 = getelementptr inbounds i8, ptr %0, i64 40
  store <2 x float> %37, ptr %38, align 4
  ret i32 0
}

attributes #0 = { nounwind uwtable "min-legal-vector-width"="64" "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 = { 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)"}


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