; LLVM IR from Dimandragon/non-parametric-dsp :: alglib-cpp/src (interpolation)

; 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.alglib_impl::spline2dinterpolant" = type { i64, i8, i64, i64, i64, %"struct.alglib_impl::ae_vector", %"struct.alglib_impl::ae_vector", %"struct.alglib_impl::ae_vector", %"struct.alglib_impl::ae_vector", %"struct.alglib_impl::ae_vector" }
%"struct.alglib_impl::ae_vector" = type { i64, i64, i8, %"struct.alglib_impl::ae_dyn_block", %union.anon.0 }
%"struct.alglib_impl::ae_dyn_block" = type { ptr, ptr, ptr, ptr }
%union.anon.0 = type { ptr }

; 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: mustprogress uwtable
define dso_local void @_ZN11alglib_impl30_spline2dinterpolant_init_copyEPvPKvPNS_8ae_stateEb(ptr noundef %0, ptr noundef %1, ptr noundef %2, i1 noundef zeroext %3) #1 {
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i8, align 1
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store ptr %2, ptr %7, align 8, !tbaa !5
  %11 = zext i1 %3 to i8
  store i8 %11, ptr %8, align 1, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #3
  %12 = load ptr, ptr %5, align 8, !tbaa !5
  store ptr %12, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #3
  %13 = load ptr, ptr %6, align 8, !tbaa !5
  store ptr %13, ptr %10, align 8, !tbaa !5
  %14 = load ptr, ptr %10, align 8, !tbaa !5
  %15 = getelementptr inbounds %"struct.alglib_impl::spline2dinterpolant", ptr %14, i32 0, i32 0
  %16 = load i64, ptr %15, align 8, !tbaa !11
  %17 = load ptr, ptr %9, align 8, !tbaa !5
  %18 = getelementptr inbounds %"struct.alglib_impl::spline2dinterpolant", ptr %17, i32 0, i32 0
  store i64 %16, ptr %18, align 8, !tbaa !11
  %19 = load ptr, ptr %10, align 8, !tbaa !5
  %20 = getelementptr inbounds %"struct.alglib_impl::spline2dinterpolant", ptr %19, i32 0, i32 1
  %21 = load i8, ptr %20, align 8, !tbaa !16, !range !17, !noundef !18
  %22 = trunc i8 %21 to i1
  %23 = load ptr, ptr %9, align 8, !tbaa !5
  %24 = getelementptr inbounds %"struct.alglib_impl::spline2dinterpolant", ptr %23, i32 0, i32 1
  %25 = zext i1 %22 to i8
  store i8 %25, ptr %24, align 8, !tbaa !16
  %26 = load ptr, ptr %10, align 8, !tbaa !5
  %27 = getelementptr inbounds %"struct.alglib_impl::spline2dinterpolant", ptr %26, i32 0, i32 2
  %28 = load i64, ptr %27, align 8, !tbaa !19
  %29 = load ptr, ptr %9, align 8, !tbaa !5
  %30 = getelementptr inbounds %"struct.alglib_impl::spline2dinterpolant", ptr %29, i32 0, i32 2
  store i64 %28, ptr %30, align 8, !tbaa !19
  %31 = load ptr, ptr %10, align 8, !tbaa !5
  %32 = getelementptr inbounds %"struct.alglib_impl::spline2dinterpolant", ptr %31, i32 0, i32 3
  %33 = load i64, ptr %32, align 8, !tbaa !20
  %34 = load ptr, ptr %9, align 8, !tbaa !5
  %35 = getelementptr inbounds %"struct.alglib_impl::spline2dinterpolant", ptr %34, i32 0, i32 3
  store i64 %33, ptr %35, align 8, !tbaa !20
  %36 = load ptr, ptr %10, align 8, !tbaa !5
  %37 = getelementptr inbounds %"struct.alglib_impl::spline2dinterpolant", ptr %36, i32 0, i32 4
  %38 = load i64, ptr %37, align 8, !tbaa !21
  %39 = load ptr, ptr %9, align 8, !tbaa !5
  %40 = getelementptr inbounds %"struct.alglib_impl::spline2dinterpolant", ptr %39, i32 0, i32 4
  store i64 %38, ptr %40, align 8, !tbaa !21
  %41 = load ptr, ptr %9, align 8, !tbaa !5
  %42 = getelementptr inbounds %"struct.alglib_impl::spline2dinterpolant", ptr %41, i32 0, i32 5
  %43 = load ptr, ptr %10, align 8, !tbaa !5
  %44 = getelementptr inbounds %"struct.alglib_impl::spline2dinterpolant", ptr %43, i32 0, i32 5
  %45 = load ptr, ptr %7, align 8, !tbaa !5
  %46 = load i8, ptr %8, align 1, !tbaa !9, !range !17, !noundef !18
  %47 = trunc i8 %46 to i1
  call void @_ZN11alglib_impl19ae_vector_init_copyEPNS_9ae_vectorEPKS0_PNS_8ae_stateEb(ptr noundef %42, ptr noundef %44, ptr noundef %45, i1 noundef zeroext %47)
  %48 = load ptr, ptr %9, align 8, !tbaa !5
  %49 = getelementptr inbounds %"struct.alglib_impl::spline2dinterpolant", ptr %48, i32 0, i32 6
  %50 = load ptr, ptr %10, align 8, !tbaa !5
  %51 = getelementptr inbounds %"struct.alglib_impl::spline2dinterpolant", ptr %50, i32 0, i32 6
  %52 = load ptr, ptr %7, align 8, !tbaa !5
  %53 = load i8, ptr %8, align 1, !tbaa !9, !range !17, !noundef !18
  %54 = trunc i8 %53 to i1
  call void @_ZN11alglib_impl19ae_vector_init_copyEPNS_9ae_vectorEPKS0_PNS_8ae_stateEb(ptr noundef %49, ptr noundef %51, ptr noundef %52, i1 noundef zeroext %54)
  %55 = load ptr, ptr %9, align 8, !tbaa !5
  %56 = getelementptr inbounds %"struct.alglib_impl::spline2dinterpolant", ptr %55, i32 0, i32 7
  %57 = load ptr, ptr %10, align 8, !tbaa !5
  %58 = getelementptr inbounds %"struct.alglib_impl::spline2dinterpolant", ptr %57, i32 0, i32 7
  %59 = load ptr, ptr %7, align 8, !tbaa !5
  %60 = load i8, ptr %8, align 1, !tbaa !9, !range !17, !noundef !18
  %61 = trunc i8 %60 to i1
  call void @_ZN11alglib_impl19ae_vector_init_copyEPNS_9ae_vectorEPKS0_PNS_8ae_stateEb(ptr noundef %56, ptr noundef %58, ptr noundef %59, i1 noundef zeroext %61)
  %62 = load ptr, ptr %9, align 8, !tbaa !5
  %63 = getelementptr inbounds %"struct.alglib_impl::spline2dinterpolant", ptr %62, i32 0, i32 8
  %64 = load ptr, ptr %10, align 8, !tbaa !5
  %65 = getelementptr inbounds %"struct.alglib_impl::spline2dinterpolant", ptr %64, i32 0, i32 8
  %66 = load ptr, ptr %7, align 8, !tbaa !5
  %67 = load i8, ptr %8, align 1, !tbaa !9, !range !17, !noundef !18
  %68 = trunc i8 %67 to i1
  call void @_ZN11alglib_impl19ae_vector_init_copyEPNS_9ae_vectorEPKS0_PNS_8ae_stateEb(ptr noundef %63, ptr noundef %65, ptr noundef %66, i1 noundef zeroext %68)
  %69 = load ptr, ptr %9, align 8, !tbaa !5
  %70 = getelementptr inbounds %"struct.alglib_impl::spline2dinterpolant", ptr %69, i32 0, i32 9
  %71 = load ptr, ptr %10, align 8, !tbaa !5
  %72 = getelementptr inbounds %"struct.alglib_impl::spline2dinterpolant", ptr %71, i32 0, i32 9
  %73 = load ptr, ptr %7, align 8, !tbaa !5
  %74 = load i8, ptr %8, align 1, !tbaa !9, !range !17, !noundef !18
  %75 = trunc i8 %74 to i1
  call void @_ZN11alglib_impl19ae_vector_init_copyEPNS_9ae_vectorEPKS0_PNS_8ae_stateEb(ptr noundef %70, ptr noundef %72, ptr noundef %73, i1 noundef zeroext %75)
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #3
  ret void
}

declare void @_ZN11alglib_impl19ae_vector_init_copyEPNS_9ae_vectorEPKS0_PNS_8ae_stateEb(ptr noundef, ptr noundef, ptr noundef, i1 noundef zeroext) #2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress 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 = { "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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"bool", !7, i64 0}
!11 = !{!12, !13, i64 0}
!12 = !{!"_ZTSN11alglib_impl19spline2dinterpolantE", !13, i64 0, !10, i64 8, !13, i64 16, !13, i64 24, !13, i64 32, !14, i64 40, !14, i64 104, !14, i64 168, !14, i64 232, !14, i64 296}
!13 = !{!"long", !7, i64 0}
!14 = !{!"_ZTSN11alglib_impl9ae_vectorE", !13, i64 0, !13, i64 8, !10, i64 16, !15, i64 24, !7, i64 56}
!15 = !{!"_ZTSN11alglib_impl12ae_dyn_blockE", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!16 = !{!12, !10, i64 8}
!17 = !{i8 0, i8 2}
!18 = !{}
!19 = !{!12, !13, i64 16}
!20 = !{!12, !13, i64 24}
!21 = !{!12, !13, i64 32}


; 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 uwtable
define dso_local void @_ZN11alglib_impl30_spline2dinterpolant_init_copyEPvPKvPNS_8ae_stateEb(ptr noundef %0, ptr noundef %1, ptr noundef %2, i1 noundef zeroext %3) local_unnamed_addr #0 {
  %5 = load i64, ptr %1, align 8, !tbaa !5
  store i64 %5, ptr %0, align 8, !tbaa !5
  %6 = getelementptr inbounds i8, ptr %1, i64 8
  %7 = load i8, ptr %6, align 8, !tbaa !14, !range !15, !noundef !16
  %8 = getelementptr inbounds i8, ptr %0, i64 8
  store i8 %7, ptr %8, align 8, !tbaa !14
  %9 = getelementptr inbounds i8, ptr %1, i64 16
  %10 = getelementptr inbounds i8, ptr %0, i64 16
  %11 = load <2 x i64>, ptr %9, align 8, !tbaa !17
  store <2 x i64> %11, ptr %10, align 8, !tbaa !17
  %12 = getelementptr inbounds i8, ptr %1, i64 32
  %13 = load i64, ptr %12, align 8, !tbaa !18
  %14 = getelementptr inbounds i8, ptr %0, i64 32
  store i64 %13, ptr %14, align 8, !tbaa !18
  %15 = getelementptr inbounds i8, ptr %0, i64 40
  %16 = getelementptr inbounds i8, ptr %1, i64 40
  tail call void @_ZN11alglib_impl19ae_vector_init_copyEPNS_9ae_vectorEPKS0_PNS_8ae_stateEb(ptr noundef nonnull %15, ptr noundef nonnull %16, ptr noundef %2, i1 noundef zeroext %3)
  %17 = getelementptr inbounds i8, ptr %0, i64 104
  %18 = getelementptr inbounds i8, ptr %1, i64 104
  tail call void @_ZN11alglib_impl19ae_vector_init_copyEPNS_9ae_vectorEPKS0_PNS_8ae_stateEb(ptr noundef nonnull %17, ptr noundef nonnull %18, ptr noundef %2, i1 noundef zeroext %3)
  %19 = getelementptr inbounds i8, ptr %0, i64 168
  %20 = getelementptr inbounds i8, ptr %1, i64 168
  tail call void @_ZN11alglib_impl19ae_vector_init_copyEPNS_9ae_vectorEPKS0_PNS_8ae_stateEb(ptr noundef nonnull %19, ptr noundef nonnull %20, ptr noundef %2, i1 noundef zeroext %3)
  %21 = getelementptr inbounds i8, ptr %0, i64 232
  %22 = getelementptr inbounds i8, ptr %1, i64 232
  tail call void @_ZN11alglib_impl19ae_vector_init_copyEPNS_9ae_vectorEPKS0_PNS_8ae_stateEb(ptr noundef nonnull %21, ptr noundef nonnull %22, ptr noundef %2, i1 noundef zeroext %3)
  %23 = getelementptr inbounds i8, ptr %0, i64 296
  %24 = getelementptr inbounds i8, ptr %1, i64 296
  tail call void @_ZN11alglib_impl19ae_vector_init_copyEPNS_9ae_vectorEPKS0_PNS_8ae_stateEb(ptr noundef nonnull %23, ptr noundef nonnull %24, ptr noundef %2, i1 noundef zeroext %3)
  ret void
}

declare void @_ZN11alglib_impl19ae_vector_init_copyEPNS_9ae_vectorEPKS0_PNS_8ae_stateEb(ptr noundef, ptr noundef, ptr noundef, i1 noundef zeroext) local_unnamed_addr #1

attributes #0 = { mustprogress 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 #1 = { "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, !7, i64 0}
!6 = !{!"_ZTSN11alglib_impl19spline2dinterpolantE", !7, i64 0, !10, i64 8, !7, i64 16, !7, i64 24, !7, i64 32, !11, i64 40, !11, i64 104, !11, i64 168, !11, i64 232, !11, i64 296}
!7 = !{!"long", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"bool", !8, i64 0}
!11 = !{!"_ZTSN11alglib_impl9ae_vectorE", !7, i64 0, !7, i64 8, !10, i64 16, !12, i64 24, !8, i64 56}
!12 = !{!"_ZTSN11alglib_impl12ae_dyn_blockE", !13, i64 0, !13, i64 8, !13, i64 16, !13, i64 24}
!13 = !{!"any pointer", !8, i64 0}
!14 = !{!6, !10, i64 8}
!15 = !{i8 0, i8 2}
!16 = !{}
!17 = !{!7, !7, i64 0}
!18 = !{!6, !7, i64 32}


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