; LLVM IR from jgaeddert/liquid-dsp :: sandbox (ellip_func_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> @ellip_acdf(<2 x float> noundef, float noundef, i32 noundef) #0

; Function Attrs: nounwind uwtable
define dso_local <2 x float> @ellip_asnf(<2 x float> noundef %0, float noundef %1, i32 noundef %2) #0 {
  %4 = alloca { float, float }, align 4
  %5 = alloca { float, float }, align 4
  %6 = alloca float, align 4
  %7 = alloca i32, align 4
  %8 = alloca { float, float }, align 4
  %9 = alloca { float, float }, align 4
  store <2 x float> %0, ptr %5, align 4
  store float %1, ptr %6, align 4, !tbaa !5
  store i32 %2, ptr %7, align 4, !tbaa !9
  %10 = getelementptr inbounds { float, float }, ptr %5, i32 0, i32 0
  %11 = load float, ptr %10, align 4
  %12 = getelementptr inbounds { float, float }, ptr %5, i32 0, i32 1
  %13 = load float, ptr %12, align 4
  %14 = load float, ptr %6, align 4, !tbaa !5
  %15 = load i32, ptr %7, align 4, !tbaa !9
  %16 = getelementptr inbounds { float, float }, ptr %8, i32 0, i32 0
  %17 = getelementptr inbounds { float, float }, ptr %8, i32 0, i32 1
  store float %11, ptr %16, align 4
  store float %13, ptr %17, align 4
  %18 = load <2 x float>, ptr %8, align 4
  %19 = call <2 x float> @ellip_acdf(<2 x float> noundef %18, float noundef %14, i32 noundef %15)
  store <2 x float> %19, ptr %9, align 4
  %20 = getelementptr inbounds { float, float }, ptr %9, i32 0, i32 0
  %21 = load float, ptr %20, align 4
  %22 = getelementptr inbounds { float, float }, ptr %9, i32 0, i32 1
  %23 = load float, ptr %22, align 4
  %24 = fpext float %21 to double
  %25 = fpext float %23 to double
  %26 = fsub double 1.000000e+00, %24
  %27 = fneg double %25
  %28 = fptrunc double %26 to float
  %29 = fptrunc double %27 to float
  %30 = getelementptr inbounds { float, float }, ptr %4, i32 0, i32 0
  %31 = getelementptr inbounds { float, float }, ptr %4, i32 0, i32 1
  store float %28, ptr %30, align 4
  store float %29, ptr %31, align 4
  %32 = load <2 x float>, ptr %4, align 4
  ret <2 x float> %32
}

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)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"float", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}


; 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> @ellip_acdf(<2 x float> noundef, float noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
define dso_local <2 x float> @ellip_asnf(<2 x float> noundef %0, float noundef %1, i32 noundef %2) local_unnamed_addr #0 {
  %4 = tail call <2 x float> @ellip_acdf(<2 x float> noundef %0, float noundef %1, i32 noundef %2)
  %.sroa.0.0.vec.extract = extractelement <2 x float> %4, i64 0
  %5 = fsub float 1.000000e+00, %.sroa.0.0.vec.extract
  %6 = fneg <2 x float> %4
  %.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