; LLVM IR from jgaeddert/liquid-dsp :: sandbox (math_casinf_test)

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

; Function Attrs: nounwind uwtable
declare dso_local <2 x float> @sandbox_cacosf(<2 x float> noundef) #0

; Function Attrs: nounwind uwtable
define dso_local <2 x float> @sandbox_casinf(<2 x float> noundef %0) #0 {
  %2 = alloca { float, float }, align 4
  %3 = alloca { float, float }, align 4
  %4 = alloca { float, float }, align 4
  %5 = alloca { float, float }, align 4
  store <2 x float> %0, ptr %3, align 4
  %6 = getelementptr inbounds { float, float }, ptr %3, i32 0, i32 0
  %7 = load float, ptr %6, align 4
  %8 = getelementptr inbounds { float, float }, ptr %3, i32 0, i32 1
  %9 = load float, ptr %8, align 4
  %10 = getelementptr inbounds { float, float }, ptr %4, i32 0, i32 0
  %11 = getelementptr inbounds { float, float }, ptr %4, i32 0, i32 1
  store float %7, ptr %10, align 4
  store float %9, ptr %11, align 4
  %12 = load <2 x float>, ptr %4, align 4
  %13 = call <2 x float> @sandbox_cacosf(<2 x float> noundef %12)
  store <2 x float> %13, ptr %5, align 4
  %14 = getelementptr inbounds { float, float }, ptr %5, i32 0, i32 0
  %15 = load float, ptr %14, align 4
  %16 = getelementptr inbounds { float, float }, ptr %5, i32 0, i32 1
  %17 = load float, ptr %16, align 4
  %18 = fpext float %15 to double
  %19 = fpext float %17 to double
  %20 = fsub double 0x3FF921FB54442D18, %18
  %21 = fneg double %19
  %22 = fptrunc double %20 to float
  %23 = fptrunc double %21 to float
  %24 = getelementptr inbounds { float, float }, ptr %2, i32 0, i32 0
  %25 = getelementptr inbounds { float, float }, ptr %2, i32 0, i32 1
  store float %22, ptr %24, align 4
  store float %23, ptr %25, align 4
  %26 = load <2 x float>, ptr %2, align 4
  ret <2 x float> %26
}

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

!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)"}


; 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: nounwind uwtable
declare dso_local <2 x float> @sandbox_cacosf(<2 x float> noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
define dso_local <2 x float> @sandbox_casinf(<2 x float> noundef %0) local_unnamed_addr #0 {
  %2 = tail call <2 x float> @sandbox_cacosf(<2 x float> noundef %0)
  %.sroa.0.0.vec.extract = extractelement <2 x float> %2, i64 0
  %3 = fpext float %.sroa.0.0.vec.extract to double
  %4 = fsub double 0x3FF921FB54442D18, %3
  %5 = fptrunc double %4 to float
  %6 = fneg <2 x float> %2
  %.sroa.04.4.vec.insert = insertelement <2 x float> %6, float %5, i64 0
  ret <2 x float> %.sroa.04.4.vec.insert
}

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

!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: GlobalOptPass,InstCombinePass,SROAPass,TailCallElimPass,VectorCombinePass