; LLVM IR from venumb/ZSPACE :: cpp/depends/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::rbfmodel" = type { i64, i64, i64, %"struct.alglib_impl::rbfv1model", %"struct.alglib_impl::rbfv2model", double, double, double, i64, i64, i64, double, double, i64, i64, i64, %"struct.alglib_impl::ae_matrix", %"struct.alglib_impl::ae_matrix", i8, %"struct.alglib_impl::ae_vector", i64, i8 }
%"struct.alglib_impl::rbfv1model" = type { i64, i64, i64, i64, %"struct.alglib_impl::kdtree", %"struct.alglib_impl::ae_matrix", %"struct.alglib_impl::ae_matrix", double, %"struct.alglib_impl::ae_matrix", %"struct.alglib_impl::ae_vector", %"struct.alglib_impl::ae_matrix", %"struct.alglib_impl::ae_vector" }
%"struct.alglib_impl::kdtree" = type { i64, i64, i64, i64, %"struct.alglib_impl::ae_matrix", %"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::kdtreerequestbuffer", i64 }
%"struct.alglib_impl::kdtreerequestbuffer" = type { %"struct.alglib_impl::ae_vector", %"struct.alglib_impl::ae_vector", %"struct.alglib_impl::ae_vector", i64, double, i8, double, 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", double }
%"struct.alglib_impl::rbfv2model" = type { i64, 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", %"struct.alglib_impl::ae_vector", %"struct.alglib_impl::ae_vector", %"struct.alglib_impl::ae_matrix", double, i64, double, i64, %"struct.alglib_impl::rbfv2calcbuffer" }
%"struct.alglib_impl::rbfv2calcbuffer" = type { %"struct.alglib_impl::ae_vector", %"struct.alglib_impl::ae_vector", %"struct.alglib_impl::ae_vector", double, %"struct.alglib_impl::ae_vector", %"struct.alglib_impl::ae_vector" }
%"struct.alglib_impl::ae_matrix" = type { i64, i64, i64, i64, i8, %"struct.alglib_impl::ae_dyn_block", %union.anon.1 }
%"struct.alglib_impl::ae_dyn_block" = type { ptr, ptr, ptr, ptr }
%union.anon.1 = type { ptr }
%"struct.alglib_impl::ae_vector" = type { i64, i64, i8, %"struct.alglib_impl::ae_dyn_block", %union.anon.0 }
%union.anon.0 = type { ptr }

@.str.662 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.663 = external hidden unnamed_addr constant [16 x i8], align 1

declare void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext, ptr noundef, ptr noundef) #0

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN11alglib_impl9rbfcreateEllPNS_8rbfmodelEPNS_8ae_stateE(i64 noundef %0, i64 noundef %1, ptr noundef %2, ptr noundef %3) #1 {
  %5 = alloca i64, align 8
  %6 = alloca i64, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  store i64 %0, ptr %5, align 8, !tbaa !5
  store i64 %1, ptr %6, align 8, !tbaa !5
  store ptr %2, ptr %7, align 8, !tbaa !9
  store ptr %3, ptr %8, align 8, !tbaa !9
  %9 = load ptr, ptr %7, align 8, !tbaa !9
  call void @_ZN11alglib_impl15_rbfmodel_clearEPv(ptr noundef %9)
  %10 = load i64, ptr %5, align 8, !tbaa !5
  %11 = icmp sge i64 %10, 1
  %12 = load ptr, ptr %8, align 8, !tbaa !9
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %11, ptr noundef @.str.662, ptr noundef %12)
  %13 = load i64, ptr %6, align 8, !tbaa !5
  %14 = icmp sge i64 %13, 1
  %15 = load ptr, ptr %8, align 8, !tbaa !9
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %14, ptr noundef @.str.663, ptr noundef %15)
  %16 = load i64, ptr %5, align 8, !tbaa !5
  %17 = load ptr, ptr %7, align 8, !tbaa !9
  %18 = getelementptr inbounds %"struct.alglib_impl::rbfmodel", ptr %17, i32 0, i32 0
  store i64 %16, ptr %18, align 8, !tbaa !11
  %19 = load i64, ptr %6, align 8, !tbaa !5
  %20 = load ptr, ptr %7, align 8, !tbaa !9
  %21 = getelementptr inbounds %"struct.alglib_impl::rbfmodel", ptr %20, i32 0, i32 1
  store i64 %19, ptr %21, align 8, !tbaa !23
  %22 = load ptr, ptr %7, align 8, !tbaa !9
  %23 = load ptr, ptr %8, align 8, !tbaa !9
  call void @_ZN11alglib_implL35rbf_rbfpreparenonserializablefieldsEPNS_8rbfmodelEPNS_8ae_stateE(ptr noundef %22, ptr noundef %23)
  %24 = load i64, ptr %5, align 8, !tbaa !5
  %25 = load i64, ptr %6, align 8, !tbaa !5
  %26 = load ptr, ptr %7, align 8, !tbaa !9
  %27 = getelementptr inbounds %"struct.alglib_impl::rbfmodel", ptr %26, i32 0, i32 3
  %28 = load ptr, ptr %8, align 8, !tbaa !9
  call void @_ZN11alglib_implL16rbf_initializev1EllPNS_10rbfv1modelEPNS_8ae_stateE(i64 noundef %24, i64 noundef %25, ptr noundef %27, ptr noundef %28)
  %29 = load i64, ptr %5, align 8, !tbaa !5
  %30 = load i64, ptr %6, align 8, !tbaa !5
  %31 = load ptr, ptr %7, align 8, !tbaa !9
  %32 = getelementptr inbounds %"struct.alglib_impl::rbfmodel", ptr %31, i32 0, i32 4
  %33 = load ptr, ptr %8, align 8, !tbaa !9
  call void @_ZN11alglib_implL16rbf_initializev2EllPNS_10rbfv2modelEPNS_8ae_stateE(i64 noundef %29, i64 noundef %30, ptr noundef %32, ptr noundef %33)
  %34 = load i64, ptr %5, align 8, !tbaa !5
  %35 = icmp eq i64 %34, 2
  br i1 %35, label %39, label %36

36:                                               ; preds = %4
  %37 = load i64, ptr %5, align 8, !tbaa !5
  %38 = icmp eq i64 %37, 3
  br i1 %38, label %39, label %42

39:                                               ; preds = %36, %4
  %40 = load ptr, ptr %7, align 8, !tbaa !9
  %41 = getelementptr inbounds %"struct.alglib_impl::rbfmodel", ptr %40, i32 0, i32 2
  store i64 1, ptr %41, align 8, !tbaa !24
  br label %45

42:                                               ; preds = %36
  %43 = load ptr, ptr %7, align 8, !tbaa !9
  %44 = getelementptr inbounds %"struct.alglib_impl::rbfmodel", ptr %43, i32 0, i32 2
  store i64 2, ptr %44, align 8, !tbaa !24
  br label %45

45:                                               ; preds = %42, %39
  %46 = load ptr, ptr %7, align 8, !tbaa !9
  %47 = getelementptr inbounds %"struct.alglib_impl::rbfmodel", ptr %46, i32 0, i32 20
  store i64 0, ptr %47, align 8, !tbaa !25
  %48 = load ptr, ptr %7, align 8, !tbaa !9
  %49 = getelementptr inbounds %"struct.alglib_impl::rbfmodel", ptr %48, i32 0, i32 21
  store i8 0, ptr %49, align 8, !tbaa !26
  ret void
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN11alglib_impl15_rbfmodel_clearEPv(ptr noundef) #1

; Function Attrs: mustprogress nounwind uwtable
declare hidden void @_ZN11alglib_implL35rbf_rbfpreparenonserializablefieldsEPNS_8rbfmodelEPNS_8ae_stateE(ptr noundef, ptr noundef) #2

; Function Attrs: mustprogress uwtable
declare hidden void @_ZN11alglib_implL16rbf_initializev1EllPNS_10rbfv1modelEPNS_8ae_stateE(i64 noundef, i64 noundef, ptr noundef, ptr noundef) #1

; Function Attrs: mustprogress uwtable
declare hidden void @_ZN11alglib_implL16rbf_initializev2EllPNS_10rbfv2modelEPNS_8ae_stateE(i64 noundef, i64 noundef, ptr noundef, ptr noundef) #1

attributes #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 = { 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 = { mustprogress 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" }

!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 = !{!"long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !6, i64 0}
!12 = !{!"_ZTSN11alglib_impl8rbfmodelE", !6, i64 0, !6, i64 8, !6, i64 16, !13, i64 24, !21, i64 1512, !20, i64 2496, !20, i64 2504, !20, i64 2512, !6, i64 2520, !6, i64 2528, !6, i64 2536, !20, i64 2544, !20, i64 2552, !6, i64 2560, !6, i64 2568, !6, i64 2576, !15, i64 2584, !15, i64 2664, !16, i64 2744, !18, i64 2752, !6, i64 2816, !16, i64 2824}
!13 = !{!"_ZTSN11alglib_impl10rbfv1modelE", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !14, i64 32, !15, i64 1032, !15, i64 1112, !20, i64 1192, !15, i64 1200, !18, i64 1280, !15, i64 1344, !18, i64 1424}
!14 = !{!"_ZTSN11alglib_impl6kdtreeE", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !15, i64 32, !18, i64 112, !18, i64 176, !18, i64 240, !18, i64 304, !18, i64 368, !19, i64 432, !6, i64 992}
!15 = !{!"_ZTSN11alglib_impl9ae_matrixE", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !16, i64 32, !17, i64 40, !7, i64 72}
!16 = !{!"bool", !7, i64 0}
!17 = !{!"_ZTSN11alglib_impl12ae_dyn_blockE", !10, i64 0, !10, i64 8, !10, i64 16, !10, i64 24}
!18 = !{!"_ZTSN11alglib_impl9ae_vectorE", !6, i64 0, !6, i64 8, !16, i64 16, !17, i64 24, !7, i64 56}
!19 = !{!"_ZTSN11alglib_impl19kdtreerequestbufferE", !18, i64 0, !18, i64 64, !18, i64 128, !6, i64 192, !20, i64 200, !16, i64 208, !20, i64 216, !6, i64 224, !18, i64 232, !18, i64 296, !18, i64 360, !18, i64 424, !18, i64 488, !20, i64 552}
!20 = !{!"double", !7, i64 0}
!21 = !{!"_ZTSN11alglib_impl10rbfv2modelE", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !18, i64 32, !18, i64 96, !18, i64 160, !18, i64 224, !18, i64 288, !18, i64 352, !18, i64 416, !18, i64 480, !15, i64 544, !20, i64 624, !6, i64 632, !20, i64 640, !6, i64 648, !22, i64 656}
!22 = !{!"_ZTSN11alglib_impl15rbfv2calcbufferE", !18, i64 0, !18, i64 64, !18, i64 128, !20, i64 192, !18, i64 200, !18, i64 264}
!23 = !{!12, !6, i64 8}
!24 = !{!12, !6, i64 16}
!25 = !{!12, !6, i64 2816}
!26 = !{!12, !16, i64 2824}


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

@.str.662 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.663 = external hidden unnamed_addr constant [16 x i8], align 1

declare void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext, ptr noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN11alglib_impl9rbfcreateEllPNS_8rbfmodelEPNS_8ae_stateE(i64 noundef %0, i64 noundef %1, ptr noundef %2, ptr noundef %3) local_unnamed_addr #1 {
  tail call void @_ZN11alglib_impl15_rbfmodel_clearEPv(ptr noundef %2)
  %5 = icmp sgt i64 %0, 0
  tail call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %5, ptr noundef nonnull @.str.662, ptr noundef %3)
  %6 = icmp sgt i64 %1, 0
  tail call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %6, ptr noundef nonnull @.str.663, ptr noundef %3)
  store i64 %0, ptr %2, align 8, !tbaa !5
  %7 = getelementptr inbounds i8, ptr %2, i64 8
  store i64 %1, ptr %7, align 8, !tbaa !21
  tail call void @_ZN11alglib_implL35rbf_rbfpreparenonserializablefieldsEPNS_8rbfmodelEPNS_8ae_stateE(ptr noundef nonnull %2, ptr noundef %3)
  %8 = getelementptr inbounds i8, ptr %2, i64 24
  tail call void @_ZN11alglib_implL16rbf_initializev1EllPNS_10rbfv1modelEPNS_8ae_stateE(i64 noundef %0, i64 noundef %1, ptr noundef nonnull %8, ptr noundef %3)
  %9 = getelementptr inbounds i8, ptr %2, i64 1512
  tail call void @_ZN11alglib_implL16rbf_initializev2EllPNS_10rbfv2modelEPNS_8ae_stateE(i64 noundef %0, i64 noundef %1, ptr noundef nonnull %9, ptr noundef %3)
  %10 = and i64 %0, -2
  %or.cond = icmp eq i64 %10, 2
  %spec.select = select i1 %or.cond, i64 1, i64 2
  %11 = getelementptr inbounds i8, ptr %2, i64 16
  store i64 %spec.select, ptr %11, align 8
  %12 = getelementptr inbounds i8, ptr %2, i64 2816
  store i64 0, ptr %12, align 8, !tbaa !22
  %13 = getelementptr inbounds i8, ptr %2, i64 2824
  store i8 0, ptr %13, align 8, !tbaa !23
  ret void
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN11alglib_impl15_rbfmodel_clearEPv(ptr noundef) local_unnamed_addr #1

; Function Attrs: mustprogress nounwind uwtable
declare hidden void @_ZN11alglib_implL35rbf_rbfpreparenonserializablefieldsEPNS_8rbfmodelEPNS_8ae_stateE(ptr noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
declare hidden void @_ZN11alglib_implL16rbf_initializev1EllPNS_10rbfv1modelEPNS_8ae_stateE(i64 noundef, i64 noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
declare hidden void @_ZN11alglib_implL16rbf_initializev2EllPNS_10rbfv2modelEPNS_8ae_stateE(i64 noundef, i64 noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

attributes #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 = { 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 = { mustprogress 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" }

!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_impl8rbfmodelE", !7, i64 0, !7, i64 8, !7, i64 16, !10, i64 24, !19, i64 1512, !18, i64 2496, !18, i64 2504, !18, i64 2512, !7, i64 2520, !7, i64 2528, !7, i64 2536, !18, i64 2544, !18, i64 2552, !7, i64 2560, !7, i64 2568, !7, i64 2576, !12, i64 2584, !12, i64 2664, !13, i64 2744, !16, i64 2752, !7, i64 2816, !13, i64 2824}
!7 = !{!"long", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"_ZTSN11alglib_impl10rbfv1modelE", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !11, i64 32, !12, i64 1032, !12, i64 1112, !18, i64 1192, !12, i64 1200, !16, i64 1280, !12, i64 1344, !16, i64 1424}
!11 = !{!"_ZTSN11alglib_impl6kdtreeE", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !12, i64 32, !16, i64 112, !16, i64 176, !16, i64 240, !16, i64 304, !16, i64 368, !17, i64 432, !7, i64 992}
!12 = !{!"_ZTSN11alglib_impl9ae_matrixE", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !13, i64 32, !14, i64 40, !8, i64 72}
!13 = !{!"bool", !8, i64 0}
!14 = !{!"_ZTSN11alglib_impl12ae_dyn_blockE", !15, i64 0, !15, i64 8, !15, i64 16, !15, i64 24}
!15 = !{!"any pointer", !8, i64 0}
!16 = !{!"_ZTSN11alglib_impl9ae_vectorE", !7, i64 0, !7, i64 8, !13, i64 16, !14, i64 24, !8, i64 56}
!17 = !{!"_ZTSN11alglib_impl19kdtreerequestbufferE", !16, i64 0, !16, i64 64, !16, i64 128, !7, i64 192, !18, i64 200, !13, i64 208, !18, i64 216, !7, i64 224, !16, i64 232, !16, i64 296, !16, i64 360, !16, i64 424, !16, i64 488, !18, i64 552}
!18 = !{!"double", !8, i64 0}
!19 = !{!"_ZTSN11alglib_impl10rbfv2modelE", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !16, i64 32, !16, i64 96, !16, i64 160, !16, i64 224, !16, i64 288, !16, i64 352, !16, i64 416, !16, i64 480, !12, i64 544, !18, i64 624, !7, i64 632, !18, i64 640, !7, i64 648, !20, i64 656}
!20 = !{!"_ZTSN11alglib_impl15rbfv2calcbufferE", !16, i64 0, !16, i64 64, !16, i64 128, !18, i64 192, !16, i64 200, !16, i64 264}
!21 = !{!6, !7, i64 8}
!22 = !{!6, !7, i64 2816}
!23 = !{!6, !13, i64 2824}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,InstCombinePass,JumpThreadingPass,MergedLoadStoreMotionPass,SROAPass,SimplifyCFGPass,TailCallElimPass