; LLVM IR from CLASS-SZ/class_sz :: class-sz/tools (arrays)

; 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: 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 double @llvm.fmuladd.f64(double, double, double) #1

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

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 }

!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 = !{!"double", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !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: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #0

; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: write) uwtable
define dso_local noundef i32 @array_interpolate_parabola(double noundef %0, double noundef %1, double noundef %2, double noundef %3, double noundef %4, double noundef %5, double noundef %6, ptr nocapture noundef writeonly %7, ptr nocapture noundef writeonly %8, ptr nocapture noundef writeonly %9, ptr nocapture noundef readnone %10) local_unnamed_addr #1 {
  %12 = fsub double %4, %5
  %13 = fsub double %2, %1
  %14 = fmul double %13, %12
  %15 = fadd double %1, %2
  %16 = fsub double %6, %5
  %17 = fsub double %0, %1
  %18 = fadd double %0, %1
  %19 = fneg double %16
  %20 = fmul double %17, %19
  %21 = fmul double %18, %20
  %22 = tail call double @llvm.fmuladd.f64(double %14, double %15, double %21)
  %23 = fdiv double %22, %17
  %24 = fdiv double %23, %13
  %25 = fsub double %2, %0
  %26 = fdiv double %24, %25
  %27 = fneg double %26
  %28 = tail call double @llvm.fmuladd.f64(double %27, double %17, double %12)
  %29 = fdiv double %28, %17
  %30 = fdiv double %29, %18
  %31 = tail call double @llvm.fmuladd.f64(double %27, double %1, double %5)
  %32 = fneg double %30
  %33 = fmul double %26, %3
  %34 = insertelement <2 x double> poison, double %30, i64 0
  %35 = insertelement <2 x double> %34, double %32, i64 1
  %36 = insertelement <2 x double> poison, double %3, i64 0
  %37 = insertelement <2 x double> %36, double %1, i64 1
  %38 = fmul <2 x double> %35, %37
  %39 = insertelement <2 x double> poison, double %33, i64 0
  %40 = insertelement <2 x double> %39, double %31, i64 1
  %41 = tail call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %38, <2 x double> %37, <2 x double> %40)
  %shift = shufflevector <2 x double> %41, <2 x double> poison, <2 x i32> <i32 1, i32 poison>
  %42 = fadd <2 x double> %41, %shift
  %43 = extractelement <2 x double> %42, i64 0
  store double %43, ptr %7, align 8, !tbaa !5
  %44 = fmul double %30, 2.000000e+00
  %45 = tail call double @llvm.fmuladd.f64(double %44, double %3, double %26)
  store double %45, ptr %8, align 8, !tbaa !5
  store double %44, ptr %9, align 8, !tbaa !5
  ret i32 0
}

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <2 x double> @llvm.fmuladd.v2f64(<2 x double>, <2 x double>, <2 x double>) #2

attributes #0 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #1 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: 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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }

!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 = !{!"double", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}


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