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

@_ZN11alglib_implL18idw_defaultlambda0E = external hidden global double, align 8
@.str.105 = external hidden unnamed_addr constant [43 x i8], align 1
@.str.106 = external hidden unnamed_addr constant [32 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_impl22idwbuildersetalgomstabEPNS_10idwbuilderEdPNS_8ae_stateE(ptr noundef %0, double noundef %1, ptr noundef %2) #1 {
  %4 = alloca ptr, align 8
  %5 = alloca double, align 8
  %6 = alloca ptr, align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  store double %1, ptr %5, align 8, !tbaa !9
  store ptr %2, ptr %6, align 8, !tbaa !5
  %7 = load double, ptr %5, align 8, !tbaa !9
  %8 = load ptr, ptr %6, align 8, !tbaa !5
  %9 = call noundef zeroext i1 @_ZN11alglib_impl11ae_isfiniteEdPNS_8ae_stateE(double noundef %7, ptr noundef %8)
  %10 = load ptr, ptr %6, align 8, !tbaa !5
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %9, ptr noundef @.str.105, ptr noundef %10)
  %11 = load double, ptr %5, align 8, !tbaa !9
  %12 = call noundef zeroext i1 @_ZN11alglib_impl13ae_fp_greaterEdd(double noundef %11, double noundef 0.000000e+00)
  %13 = load ptr, ptr %6, align 8, !tbaa !5
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %12, ptr noundef @.str.106, ptr noundef %13)
  %14 = load ptr, ptr %4, align 8, !tbaa !5
  %15 = getelementptr inbounds %"struct.alglib_impl::idwbuilder", ptr %14, i32 0, i32 2
  store i64 2, ptr %15, align 8, !tbaa !11
  %16 = load double, ptr %5, align 8, !tbaa !9
  %17 = load ptr, ptr %4, align 8, !tbaa !5
  %18 = getelementptr inbounds %"struct.alglib_impl::idwbuilder", ptr %17, i32 0, i32 4
  store double %16, ptr %18, align 8, !tbaa !20
  %19 = load ptr, ptr %4, align 8, !tbaa !5
  %20 = getelementptr inbounds %"struct.alglib_impl::idwbuilder", ptr %19, i32 0, i32 5
  store double 5.000000e-01, ptr %20, align 8, !tbaa !21
  %21 = load double, ptr @_ZN11alglib_implL18idw_defaultlambda0E, align 8, !tbaa !9
  %22 = load ptr, ptr %4, align 8, !tbaa !5
  %23 = getelementptr inbounds %"struct.alglib_impl::idwbuilder", ptr %22, i32 0, i32 6
  store double %21, ptr %23, align 8, !tbaa !22
  %24 = load ptr, ptr %4, align 8, !tbaa !5
  %25 = getelementptr inbounds %"struct.alglib_impl::idwbuilder", ptr %24, i32 0, i32 7
  store double 0.000000e+00, ptr %25, align 8, !tbaa !23
  %26 = load ptr, ptr %4, align 8, !tbaa !5
  %27 = getelementptr inbounds %"struct.alglib_impl::idwbuilder", ptr %26, i32 0, i32 8
  store double 1.000000e+00, ptr %27, align 8, !tbaa !24
  ret void
}

declare noundef zeroext i1 @_ZN11alglib_impl11ae_isfiniteEdPNS_8ae_stateE(double noundef, ptr noundef) #0

declare noundef zeroext i1 @_ZN11alglib_impl13ae_fp_greaterEdd(double noundef, double noundef) #0

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

!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 = !{!"double", !7, i64 0}
!11 = !{!12, !13, i64 72}
!12 = !{!"_ZTSN11alglib_impl10idwbuilderE", !13, i64 0, !14, i64 8, !13, i64 72, !13, i64 80, !10, i64 88, !10, i64 96, !10, i64 104, !10, i64 112, !10, i64 120, !10, i64 128, !14, i64 136, !13, i64 200, !13, i64 208, !13, i64 216, !17, i64 224, !17, i64 304, !14, i64 384, !14, i64 448, !14, i64 512, !14, i64 576, !14, i64 640, !18, i64 704, !14, i64 1704}
!13 = !{!"long", !7, i64 0}
!14 = !{!"_ZTSN11alglib_impl9ae_vectorE", !13, i64 0, !13, i64 8, !15, i64 16, !16, i64 24, !7, i64 56}
!15 = !{!"bool", !7, i64 0}
!16 = !{!"_ZTSN11alglib_impl12ae_dyn_blockE", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!17 = !{!"_ZTSN11alglib_impl9ae_matrixE", !13, i64 0, !13, i64 8, !13, i64 16, !13, i64 24, !15, i64 32, !16, i64 40, !7, i64 72}
!18 = !{!"_ZTSN11alglib_impl6kdtreeE", !13, i64 0, !13, i64 8, !13, i64 16, !13, i64 24, !17, i64 32, !14, i64 112, !14, i64 176, !14, i64 240, !14, i64 304, !14, i64 368, !19, i64 432, !13, i64 992}
!19 = !{!"_ZTSN11alglib_impl19kdtreerequestbufferE", !14, i64 0, !14, i64 64, !14, i64 128, !13, i64 192, !10, i64 200, !15, i64 208, !10, i64 216, !13, i64 224, !14, i64 232, !14, i64 296, !14, i64 360, !14, i64 424, !14, i64 488, !10, i64 552}
!20 = !{!12, !10, i64 88}
!21 = !{!12, !10, i64 96}
!22 = !{!12, !10, i64 104}
!23 = !{!12, !10, i64 112}
!24 = !{!12, !10, i64 120}


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

@_ZN11alglib_implL18idw_defaultlambda0E = external hidden local_unnamed_addr global double, align 8
@.str.105 = external hidden unnamed_addr constant [43 x i8], align 1
@.str.106 = external hidden unnamed_addr constant [32 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_impl22idwbuildersetalgomstabEPNS_10idwbuilderEdPNS_8ae_stateE(ptr nocapture noundef writeonly %0, double noundef %1, ptr noundef %2) local_unnamed_addr #1 {
  %4 = tail call noundef zeroext i1 @_ZN11alglib_impl11ae_isfiniteEdPNS_8ae_stateE(double noundef %1, ptr noundef %2)
  tail call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %4, ptr noundef nonnull @.str.105, ptr noundef %2)
  %5 = tail call noundef zeroext i1 @_ZN11alglib_impl13ae_fp_greaterEdd(double noundef %1, double noundef 0.000000e+00)
  tail call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %5, ptr noundef nonnull @.str.106, ptr noundef %2)
  %6 = getelementptr inbounds i8, ptr %0, i64 72
  store i64 2, ptr %6, align 8, !tbaa !5
  %7 = getelementptr inbounds i8, ptr %0, i64 88
  store double %1, ptr %7, align 8, !tbaa !18
  %8 = getelementptr inbounds i8, ptr %0, i64 96
  store double 5.000000e-01, ptr %8, align 8, !tbaa !19
  %9 = load double, ptr @_ZN11alglib_implL18idw_defaultlambda0E, align 8, !tbaa !20
  %10 = getelementptr inbounds i8, ptr %0, i64 104
  store double %9, ptr %10, align 8, !tbaa !21
  %11 = getelementptr inbounds i8, ptr %0, i64 112
  store <2 x double> <double 0.000000e+00, double 1.000000e+00>, ptr %11, align 8, !tbaa !20
  ret void
}

declare noundef zeroext i1 @_ZN11alglib_impl11ae_isfiniteEdPNS_8ae_stateE(double noundef, ptr noundef) local_unnamed_addr #0

declare noundef zeroext i1 @_ZN11alglib_impl13ae_fp_greaterEdd(double noundef, double noundef) local_unnamed_addr #0

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

!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 72}
!6 = !{!"_ZTSN11alglib_impl10idwbuilderE", !7, i64 0, !10, i64 8, !7, i64 72, !7, i64 80, !14, i64 88, !14, i64 96, !14, i64 104, !14, i64 112, !14, i64 120, !14, i64 128, !10, i64 136, !7, i64 200, !7, i64 208, !7, i64 216, !15, i64 224, !15, i64 304, !10, i64 384, !10, i64 448, !10, i64 512, !10, i64 576, !10, i64 640, !16, i64 704, !10, i64 1704}
!7 = !{!"long", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"_ZTSN11alglib_impl9ae_vectorE", !7, i64 0, !7, i64 8, !11, i64 16, !12, i64 24, !8, i64 56}
!11 = !{!"bool", !8, i64 0}
!12 = !{!"_ZTSN11alglib_impl12ae_dyn_blockE", !13, i64 0, !13, i64 8, !13, i64 16, !13, i64 24}
!13 = !{!"any pointer", !8, i64 0}
!14 = !{!"double", !8, i64 0}
!15 = !{!"_ZTSN11alglib_impl9ae_matrixE", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !11, i64 32, !12, i64 40, !8, i64 72}
!16 = !{!"_ZTSN11alglib_impl6kdtreeE", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !15, i64 32, !10, i64 112, !10, i64 176, !10, i64 240, !10, i64 304, !10, i64 368, !17, i64 432, !7, i64 992}
!17 = !{!"_ZTSN11alglib_impl19kdtreerequestbufferE", !10, i64 0, !10, i64 64, !10, i64 128, !7, i64 192, !14, i64 200, !11, i64 208, !14, i64 216, !7, i64 224, !10, i64 232, !10, i64 296, !10, i64 360, !10, i64 424, !10, i64 488, !14, i64 552}
!18 = !{!6, !14, i64 88}
!19 = !{!6, !14, i64 96}
!20 = !{!14, !14, i64 0}
!21 = !{!6, !14, i64 104}


; Effective O3 passes: GlobalOptPass,InstCombinePass,PostOrderFunctionAttrsPass,SLPVectorizerPass,SROAPass,TailCallElimPass