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

@.str.259 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.260 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.261 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.262 = external hidden unnamed_addr constant [56 x i8], align 1
@.str.263 = external hidden unnamed_addr constant [56 x i8], align 1
@.str.264 = external hidden unnamed_addr constant [67 x i8], align 1

; 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 nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #1

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN11alglib_impl22spline1dbuildlinearbufEPKNS_9ae_vectorES2_lPNS_19spline1dinterpolantEPNS_8ae_stateE(ptr noundef %0, ptr noundef %1, i64 noundef %2, ptr noundef %3, ptr noundef %4) #3 {
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i64, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca %"struct.alglib_impl::ae_frame", align 8
  %12 = alloca %"struct.alglib_impl::ae_vector", align 8
  %13 = alloca %"struct.alglib_impl::ae_vector", align 8
  %14 = alloca i64, align 8
  store ptr %0, ptr %6, align 8, !tbaa !5
  store ptr %1, ptr %7, align 8, !tbaa !5
  store i64 %2, ptr %8, align 8, !tbaa !9
  store ptr %3, ptr %9, align 8, !tbaa !5
  store ptr %4, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 32, ptr %11) #4
  call void @llvm.lifetime.start.p0(i64 64, ptr %12) #4
  call void @llvm.lifetime.start.p0(i64 64, ptr %13) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #4
  %15 = load ptr, ptr %10, align 8, !tbaa !5
  call void @_ZN11alglib_impl13ae_frame_makeEPNS_8ae_stateEPNS_8ae_frameE(ptr noundef %15, ptr noundef %11)
  call void @llvm.memset.p0.i64(ptr align 8 %12, i8 0, i64 64, i1 false)
  call void @llvm.memset.p0.i64(ptr align 8 %13, i8 0, i64 64, i1 false)
  %16 = load ptr, ptr %6, align 8, !tbaa !5
  %17 = load ptr, ptr %10, align 8, !tbaa !5
  call void @_ZN11alglib_impl19ae_vector_init_copyEPNS_9ae_vectorEPKS0_PNS_8ae_stateEb(ptr noundef %12, ptr noundef %16, ptr noundef %17, i1 noundef zeroext true)
  %18 = load ptr, ptr %7, align 8, !tbaa !5
  %19 = load ptr, ptr %10, align 8, !tbaa !5
  call void @_ZN11alglib_impl19ae_vector_init_copyEPNS_9ae_vectorEPKS0_PNS_8ae_stateEb(ptr noundef %13, ptr noundef %18, ptr noundef %19, i1 noundef zeroext true)
  %20 = load i64, ptr %8, align 8, !tbaa !9
  %21 = icmp sgt i64 %20, 1
  %22 = load ptr, ptr %10, align 8, !tbaa !5
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %21, ptr noundef @.str.259, ptr noundef %22)
  %23 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %12, i32 0, i32 0
  %24 = load i64, ptr %23, align 8, !tbaa !11
  %25 = load i64, ptr %8, align 8, !tbaa !9
  %26 = icmp sge i64 %24, %25
  %27 = load ptr, ptr %10, align 8, !tbaa !5
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %26, ptr noundef @.str.260, ptr noundef %27)
  %28 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %13, i32 0, i32 0
  %29 = load i64, ptr %28, align 8, !tbaa !11
  %30 = load i64, ptr %8, align 8, !tbaa !9
  %31 = icmp sge i64 %29, %30
  %32 = load ptr, ptr %10, align 8, !tbaa !5
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %31, ptr noundef @.str.261, ptr noundef %32)
  %33 = load i64, ptr %8, align 8, !tbaa !9
  %34 = load ptr, ptr %10, align 8, !tbaa !5
  %35 = call noundef zeroext i1 @_ZN11alglib_impl14isfinitevectorEPKNS_9ae_vectorElPNS_8ae_stateE(ptr noundef %12, i64 noundef %33, ptr noundef %34)
  %36 = load ptr, ptr %10, align 8, !tbaa !5
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %35, ptr noundef @.str.262, ptr noundef %36)
  %37 = load i64, ptr %8, align 8, !tbaa !9
  %38 = load ptr, ptr %10, align 8, !tbaa !5
  %39 = call noundef zeroext i1 @_ZN11alglib_impl14isfinitevectorEPKNS_9ae_vectorElPNS_8ae_stateE(ptr noundef %13, i64 noundef %37, ptr noundef %38)
  %40 = load ptr, ptr %10, align 8, !tbaa !5
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %39, ptr noundef @.str.263, ptr noundef %40)
  %41 = load i64, ptr %8, align 8, !tbaa !9
  %42 = load ptr, ptr %10, align 8, !tbaa !5
  call void @_ZN11alglib_implL23spline1d_heapsortpointsEPNS_9ae_vectorES1_lPNS_8ae_stateE(ptr noundef %12, ptr noundef %13, i64 noundef %41, ptr noundef %42)
  %43 = load i64, ptr %8, align 8, !tbaa !9
  %44 = load ptr, ptr %10, align 8, !tbaa !5
  %45 = call noundef zeroext i1 @_ZN11alglib_impl11aredistinctEPKNS_9ae_vectorElPNS_8ae_stateE(ptr noundef %12, i64 noundef %43, ptr noundef %44)
  %46 = load ptr, ptr %10, align 8, !tbaa !5
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %45, ptr noundef @.str.264, ptr noundef %46)
  %47 = load ptr, ptr %9, align 8, !tbaa !5
  %48 = getelementptr inbounds %"struct.alglib_impl::spline1dinterpolant", ptr %47, i32 0, i32 0
  store i8 0, ptr %48, align 8, !tbaa !15
  %49 = load i64, ptr %8, align 8, !tbaa !9
  %50 = load ptr, ptr %9, align 8, !tbaa !5
  %51 = getelementptr inbounds %"struct.alglib_impl::spline1dinterpolant", ptr %50, i32 0, i32 1
  store i64 %49, ptr %51, align 8, !tbaa !17
  %52 = load ptr, ptr %9, align 8, !tbaa !5
  %53 = getelementptr inbounds %"struct.alglib_impl::spline1dinterpolant", ptr %52, i32 0, i32 2
  store i64 3, ptr %53, align 8, !tbaa !18
  %54 = load ptr, ptr %9, align 8, !tbaa !5
  %55 = getelementptr inbounds %"struct.alglib_impl::spline1dinterpolant", ptr %54, i32 0, i32 3
  store i64 0, ptr %55, align 8, !tbaa !19
  %56 = load ptr, ptr %9, align 8, !tbaa !5
  %57 = getelementptr inbounds %"struct.alglib_impl::spline1dinterpolant", ptr %56, i32 0, i32 4
  %58 = load i64, ptr %8, align 8, !tbaa !9
  %59 = load ptr, ptr %10, align 8, !tbaa !5
  call void @_ZN11alglib_impl20ae_vector_set_lengthEPNS_9ae_vectorElPNS_8ae_stateE(ptr noundef %57, i64 noundef %58, ptr noundef %59)
  %60 = load ptr, ptr %9, align 8, !tbaa !5
  %61 = getelementptr inbounds %"struct.alglib_impl::spline1dinterpolant", ptr %60, i32 0, i32 5
  %62 = load i64, ptr %8, align 8, !tbaa !9
  %63 = sub nsw i64 %62, 1
  %64 = mul nsw i64 4, %63
  %65 = add nsw i64 %64, 2
  %66 = load ptr, ptr %10, align 8, !tbaa !5
  call void @_ZN11alglib_impl20ae_vector_set_lengthEPNS_9ae_vectorElPNS_8ae_stateE(ptr noundef %61, i64 noundef %65, ptr noundef %66)
  store i64 0, ptr %14, align 8, !tbaa !9
  br label %67

67:                                               ; preds = %84, %5
  %68 = load i64, ptr %14, align 8, !tbaa !9
  %69 = load i64, ptr %8, align 8, !tbaa !9
  %70 = sub nsw i64 %69, 1
  %71 = icmp sle i64 %68, %70
  br i1 %71, label %72, label %87

72:                                               ; preds = %67
  %73 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %12, i32 0, i32 4
  %74 = load ptr, ptr %73, align 8, !tbaa !20
  %75 = load i64, ptr %14, align 8, !tbaa !9
  %76 = getelementptr inbounds double, ptr %74, i64 %75
  %77 = load double, ptr %76, align 8, !tbaa !21
  %78 = load ptr, ptr %9, align 8, !tbaa !5
  %79 = getelementptr inbounds %"struct.alglib_impl::spline1dinterpolant", ptr %78, i32 0, i32 4
  %80 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %79, i32 0, i32 4
  %81 = load ptr, ptr %80, align 8, !tbaa !20
  %82 = load i64, ptr %14, align 8, !tbaa !9
  %83 = getelementptr inbounds double, ptr %81, i64 %82
  store double %77, ptr %83, align 8, !tbaa !21
  br label %84

84:                                               ; preds = %72
  %85 = load i64, ptr %14, align 8, !tbaa !9
  %86 = add nsw i64 %85, 1
  store i64 %86, ptr %14, align 8, !tbaa !9
  br label %67, !llvm.loop !23

87:                                               ; preds = %67
  store i64 0, ptr %14, align 8, !tbaa !9
  br label %88

88:                                               ; preds = %156, %87
  %89 = load i64, ptr %14, align 8, !tbaa !9
  %90 = load i64, ptr %8, align 8, !tbaa !9
  %91 = sub nsw i64 %90, 2
  %92 = icmp sle i64 %89, %91
  br i1 %92, label %93, label %159

93:                                               ; preds = %88
  %94 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %13, i32 0, i32 4
  %95 = load ptr, ptr %94, align 8, !tbaa !20
  %96 = load i64, ptr %14, align 8, !tbaa !9
  %97 = getelementptr inbounds double, ptr %95, i64 %96
  %98 = load double, ptr %97, align 8, !tbaa !21
  %99 = load ptr, ptr %9, align 8, !tbaa !5
  %100 = getelementptr inbounds %"struct.alglib_impl::spline1dinterpolant", ptr %99, i32 0, i32 5
  %101 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %100, i32 0, i32 4
  %102 = load ptr, ptr %101, align 8, !tbaa !20
  %103 = load i64, ptr %14, align 8, !tbaa !9
  %104 = mul nsw i64 4, %103
  %105 = add nsw i64 %104, 0
  %106 = getelementptr inbounds double, ptr %102, i64 %105
  store double %98, ptr %106, align 8, !tbaa !21
  %107 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %13, i32 0, i32 4
  %108 = load ptr, ptr %107, align 8, !tbaa !20
  %109 = load i64, ptr %14, align 8, !tbaa !9
  %110 = add nsw i64 %109, 1
  %111 = getelementptr inbounds double, ptr %108, i64 %110
  %112 = load double, ptr %111, align 8, !tbaa !21
  %113 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %13, i32 0, i32 4
  %114 = load ptr, ptr %113, align 8, !tbaa !20
  %115 = load i64, ptr %14, align 8, !tbaa !9
  %116 = getelementptr inbounds double, ptr %114, i64 %115
  %117 = load double, ptr %116, align 8, !tbaa !21
  %118 = fsub double %112, %117
  %119 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %12, i32 0, i32 4
  %120 = load ptr, ptr %119, align 8, !tbaa !20
  %121 = load i64, ptr %14, align 8, !tbaa !9
  %122 = add nsw i64 %121, 1
  %123 = getelementptr inbounds double, ptr %120, i64 %122
  %124 = load double, ptr %123, align 8, !tbaa !21
  %125 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %12, i32 0, i32 4
  %126 = load ptr, ptr %125, align 8, !tbaa !20
  %127 = load i64, ptr %14, align 8, !tbaa !9
  %128 = getelementptr inbounds double, ptr %126, i64 %127
  %129 = load double, ptr %128, align 8, !tbaa !21
  %130 = fsub double %124, %129
  %131 = fdiv double %118, %130
  %132 = load ptr, ptr %9, align 8, !tbaa !5
  %133 = getelementptr inbounds %"struct.alglib_impl::spline1dinterpolant", ptr %132, i32 0, i32 5
  %134 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %133, i32 0, i32 4
  %135 = load ptr, ptr %134, align 8, !tbaa !20
  %136 = load i64, ptr %14, align 8, !tbaa !9
  %137 = mul nsw i64 4, %136
  %138 = add nsw i64 %137, 1
  %139 = getelementptr inbounds double, ptr %135, i64 %138
  store double %131, ptr %139, align 8, !tbaa !21
  %140 = load ptr, ptr %9, align 8, !tbaa !5
  %141 = getelementptr inbounds %"struct.alglib_impl::spline1dinterpolant", ptr %140, i32 0, i32 5
  %142 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %141, i32 0, i32 4
  %143 = load ptr, ptr %142, align 8, !tbaa !20
  %144 = load i64, ptr %14, align 8, !tbaa !9
  %145 = mul nsw i64 4, %144
  %146 = add nsw i64 %145, 2
  %147 = getelementptr inbounds double, ptr %143, i64 %146
  store double 0.000000e+00, ptr %147, align 8, !tbaa !21
  %148 = load ptr, ptr %9, align 8, !tbaa !5
  %149 = getelementptr inbounds %"struct.alglib_impl::spline1dinterpolant", ptr %148, i32 0, i32 5
  %150 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %149, i32 0, i32 4
  %151 = load ptr, ptr %150, align 8, !tbaa !20
  %152 = load i64, ptr %14, align 8, !tbaa !9
  %153 = mul nsw i64 4, %152
  %154 = add nsw i64 %153, 3
  %155 = getelementptr inbounds double, ptr %151, i64 %154
  store double 0.000000e+00, ptr %155, align 8, !tbaa !21
  br label %156

156:                                              ; preds = %93
  %157 = load i64, ptr %14, align 8, !tbaa !9
  %158 = add nsw i64 %157, 1
  store i64 %158, ptr %14, align 8, !tbaa !9
  br label %88, !llvm.loop !25

159:                                              ; preds = %88
  %160 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %13, i32 0, i32 4
  %161 = load ptr, ptr %160, align 8, !tbaa !20
  %162 = load i64, ptr %8, align 8, !tbaa !9
  %163 = sub nsw i64 %162, 1
  %164 = getelementptr inbounds double, ptr %161, i64 %163
  %165 = load double, ptr %164, align 8, !tbaa !21
  %166 = load ptr, ptr %9, align 8, !tbaa !5
  %167 = getelementptr inbounds %"struct.alglib_impl::spline1dinterpolant", ptr %166, i32 0, i32 5
  %168 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %167, i32 0, i32 4
  %169 = load ptr, ptr %168, align 8, !tbaa !20
  %170 = load i64, ptr %8, align 8, !tbaa !9
  %171 = sub nsw i64 %170, 1
  %172 = mul nsw i64 4, %171
  %173 = add nsw i64 %172, 0
  %174 = getelementptr inbounds double, ptr %169, i64 %173
  store double %165, ptr %174, align 8, !tbaa !21
  %175 = load ptr, ptr %9, align 8, !tbaa !5
  %176 = getelementptr inbounds %"struct.alglib_impl::spline1dinterpolant", ptr %175, i32 0, i32 5
  %177 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %176, i32 0, i32 4
  %178 = load ptr, ptr %177, align 8, !tbaa !20
  %179 = load i64, ptr %8, align 8, !tbaa !9
  %180 = sub nsw i64 %179, 2
  %181 = mul nsw i64 4, %180
  %182 = add nsw i64 %181, 1
  %183 = getelementptr inbounds double, ptr %178, i64 %182
  %184 = load double, ptr %183, align 8, !tbaa !21
  %185 = load ptr, ptr %9, align 8, !tbaa !5
  %186 = getelementptr inbounds %"struct.alglib_impl::spline1dinterpolant", ptr %185, i32 0, i32 5
  %187 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %186, i32 0, i32 4
  %188 = load ptr, ptr %187, align 8, !tbaa !20
  %189 = load i64, ptr %8, align 8, !tbaa !9
  %190 = sub nsw i64 %189, 1
  %191 = mul nsw i64 4, %190
  %192 = add nsw i64 %191, 1
  %193 = getelementptr inbounds double, ptr %188, i64 %192
  store double %184, ptr %193, align 8, !tbaa !21
  %194 = load ptr, ptr %10, align 8, !tbaa !5
  call void @_ZN11alglib_impl14ae_frame_leaveEPNS_8ae_stateE(ptr noundef %194)
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #4
  call void @llvm.lifetime.end.p0(i64 64, ptr %13) #4
  call void @llvm.lifetime.end.p0(i64 64, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr %11) #4
  ret void
}

declare void @_ZN11alglib_impl20ae_vector_set_lengthEPNS_9ae_vectorElPNS_8ae_stateE(ptr noundef, i64 noundef, ptr noundef) #2

declare void @_ZN11alglib_impl13ae_frame_makeEPNS_8ae_stateEPNS_8ae_frameE(ptr noundef, ptr noundef) #2

declare void @_ZN11alglib_impl14ae_frame_leaveEPNS_8ae_stateE(ptr noundef) #2

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

declare noundef zeroext i1 @_ZN11alglib_impl14isfinitevectorEPKNS_9ae_vectorElPNS_8ae_stateE(ptr noundef, i64 noundef, ptr noundef) #2

declare noundef zeroext i1 @_ZN11alglib_impl11aredistinctEPKNS_9ae_vectorElPNS_8ae_stateE(ptr noundef, i64 noundef, ptr noundef) #2

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: write) }
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 = { 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 #4 = { 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 = !{!"long", !7, i64 0}
!11 = !{!12, !10, i64 0}
!12 = !{!"_ZTSN11alglib_impl9ae_vectorE", !10, i64 0, !10, i64 8, !13, i64 16, !14, i64 24, !7, i64 56}
!13 = !{!"bool", !7, i64 0}
!14 = !{!"_ZTSN11alglib_impl12ae_dyn_blockE", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!15 = !{!16, !13, i64 0}
!16 = !{!"_ZTSN11alglib_impl19spline1dinterpolantE", !13, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !12, i64 32, !12, i64 96}
!17 = !{!16, !10, i64 8}
!18 = !{!16, !10, i64 16}
!19 = !{!16, !10, i64 24}
!20 = !{!7, !7, i64 0}
!21 = !{!22, !22, i64 0}
!22 = !{!"double", !7, i64 0}
!23 = distinct !{!23, !24}
!24 = !{!"llvm.loop.mustprogress"}
!25 = distinct !{!25, !24}


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

%"struct.alglib_impl::ae_frame" = type { %"struct.alglib_impl::ae_dyn_block" }
%"struct.alglib_impl::ae_dyn_block" = type { ptr, ptr, ptr, 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.259 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.260 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.261 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.262 = external hidden unnamed_addr constant [56 x i8], align 1
@.str.263 = external hidden unnamed_addr constant [56 x i8], align 1
@.str.264 = external hidden unnamed_addr constant [67 x i8], align 1

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #1

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN11alglib_impl22spline1dbuildlinearbufEPKNS_9ae_vectorES2_lPNS_19spline1dinterpolantEPNS_8ae_stateE(ptr noundef %0, ptr noundef %1, i64 noundef %2, ptr noundef %3, ptr noundef %4) local_unnamed_addr #3 {
  %6 = alloca %"struct.alglib_impl::ae_frame", align 8
  %7 = alloca %"struct.alglib_impl::ae_vector", align 8
  %8 = alloca %"struct.alglib_impl::ae_vector", align 8
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %6) #4
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %7) #4
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %8) #4
  call void @_ZN11alglib_impl13ae_frame_makeEPNS_8ae_stateEPNS_8ae_frameE(ptr noundef %4, ptr noundef nonnull %6)
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(64) %7, i8 0, i64 64, i1 false)
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(64) %8, i8 0, i64 64, i1 false)
  call void @_ZN11alglib_impl19ae_vector_init_copyEPNS_9ae_vectorEPKS0_PNS_8ae_stateEb(ptr noundef nonnull %7, ptr noundef %0, ptr noundef %4, i1 noundef zeroext true)
  call void @_ZN11alglib_impl19ae_vector_init_copyEPNS_9ae_vectorEPKS0_PNS_8ae_stateEb(ptr noundef nonnull %8, ptr noundef %1, ptr noundef %4, i1 noundef zeroext true)
  %9 = icmp sgt i64 %2, 1
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %9, ptr noundef nonnull @.str.259, ptr noundef %4)
  %10 = load i64, ptr %7, align 8, !tbaa !5
  %11 = icmp sge i64 %10, %2
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %11, ptr noundef nonnull @.str.260, ptr noundef %4)
  %12 = load i64, ptr %8, align 8, !tbaa !5
  %13 = icmp sge i64 %12, %2
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %13, ptr noundef nonnull @.str.261, ptr noundef %4)
  %14 = call noundef zeroext i1 @_ZN11alglib_impl14isfinitevectorEPKNS_9ae_vectorElPNS_8ae_stateE(ptr noundef nonnull %7, i64 noundef %2, ptr noundef %4)
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %14, ptr noundef nonnull @.str.262, ptr noundef %4)
  %15 = call noundef zeroext i1 @_ZN11alglib_impl14isfinitevectorEPKNS_9ae_vectorElPNS_8ae_stateE(ptr noundef nonnull %8, i64 noundef %2, ptr noundef %4)
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %15, ptr noundef nonnull @.str.263, ptr noundef %4)
  call void @_ZN11alglib_implL23spline1d_heapsortpointsEPNS_9ae_vectorES1_lPNS_8ae_stateE(ptr noundef nonnull %7, ptr noundef nonnull %8, i64 noundef %2, ptr noundef %4)
  %16 = call noundef zeroext i1 @_ZN11alglib_impl11aredistinctEPKNS_9ae_vectorElPNS_8ae_stateE(ptr noundef nonnull %7, i64 noundef %2, ptr noundef %4)
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %16, ptr noundef nonnull @.str.264, ptr noundef %4)
  store i8 0, ptr %3, align 8, !tbaa !13
  %17 = getelementptr inbounds i8, ptr %3, i64 8
  store i64 %2, ptr %17, align 8, !tbaa !15
  %18 = getelementptr inbounds i8, ptr %3, i64 16
  store i64 3, ptr %18, align 8, !tbaa !16
  %19 = getelementptr inbounds i8, ptr %3, i64 24
  store i64 0, ptr %19, align 8, !tbaa !17
  %20 = getelementptr inbounds i8, ptr %3, i64 32
  call void @_ZN11alglib_impl20ae_vector_set_lengthEPNS_9ae_vectorElPNS_8ae_stateE(ptr noundef nonnull %20, i64 noundef %2, ptr noundef %4)
  %21 = getelementptr inbounds i8, ptr %3, i64 96
  %22 = add i64 %2, -1
  %23 = shl nsw i64 %22, 2
  %24 = or disjoint i64 %23, 2
  call void @_ZN11alglib_impl20ae_vector_set_lengthEPNS_9ae_vectorElPNS_8ae_stateE(ptr noundef nonnull %21, i64 noundef %24, ptr noundef %4)
  %.not.not64 = icmp sgt i64 %2, 0
  br i1 %.not.not64, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %5
  %25 = getelementptr inbounds i8, ptr %7, i64 56
  %26 = getelementptr inbounds i8, ptr %3, i64 88
  %xtraiter = and i64 %2, 3
  %27 = icmp ult i64 %2, 4
  br i1 %27, label %.preheader.unr-lcssa, label %.lr.ph.new

.lr.ph.new:                                       ; preds = %.lr.ph
  %unroll_iter = and i64 %2, 9223372036854775804
  br label %37

.preheader.unr-lcssa:                             ; preds = %37, %.lr.ph
  %.065.unr = phi i64 [ 0, %.lr.ph ], [ %61, %37 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.preheader, label %.epil.preheader

.epil.preheader:                                  ; preds = %.preheader.unr-lcssa, %.epil.preheader
  %.065.epil = phi i64 [ %33, %.epil.preheader ], [ %.065.unr, %.preheader.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.epil.preheader ], [ 0, %.preheader.unr-lcssa ]
  %28 = load ptr, ptr %25, align 8, !tbaa !18
  %29 = getelementptr inbounds double, ptr %28, i64 %.065.epil
  %30 = load double, ptr %29, align 8, !tbaa !19
  %31 = load ptr, ptr %26, align 8, !tbaa !18
  %32 = getelementptr inbounds double, ptr %31, i64 %.065.epil
  store double %30, ptr %32, align 8, !tbaa !19
  %33 = add nuw nsw i64 %.065.epil, 1
  %epil.iter.next = add i64 %epil.iter, 1
  %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
  br i1 %epil.iter.cmp.not, label %.preheader, label %.epil.preheader, !llvm.loop !21

.preheader:                                       ; preds = %.epil.preheader, %.preheader.unr-lcssa
  %.not66 = icmp eq i64 %2, 1
  br i1 %.not66, label %._crit_edge, label %.lr.ph68

.lr.ph68:                                         ; preds = %.preheader
  %34 = getelementptr inbounds i8, ptr %8, i64 56
  %35 = getelementptr inbounds i8, ptr %3, i64 152
  %36 = getelementptr inbounds i8, ptr %7, i64 56
  br label %62

37:                                               ; preds = %37, %.lr.ph.new
  %.065 = phi i64 [ 0, %.lr.ph.new ], [ %61, %37 ]
  %niter = phi i64 [ 0, %.lr.ph.new ], [ %niter.next.3, %37 ]
  %38 = load ptr, ptr %25, align 8, !tbaa !18
  %39 = getelementptr inbounds double, ptr %38, i64 %.065
  %40 = load double, ptr %39, align 8, !tbaa !19
  %41 = load ptr, ptr %26, align 8, !tbaa !18
  %42 = getelementptr inbounds double, ptr %41, i64 %.065
  store double %40, ptr %42, align 8, !tbaa !19
  %43 = or disjoint i64 %.065, 1
  %44 = load ptr, ptr %25, align 8, !tbaa !18
  %45 = getelementptr inbounds double, ptr %44, i64 %43
  %46 = load double, ptr %45, align 8, !tbaa !19
  %47 = load ptr, ptr %26, align 8, !tbaa !18
  %48 = getelementptr inbounds double, ptr %47, i64 %43
  store double %46, ptr %48, align 8, !tbaa !19
  %49 = or disjoint i64 %.065, 2
  %50 = load ptr, ptr %25, align 8, !tbaa !18
  %51 = getelementptr inbounds double, ptr %50, i64 %49
  %52 = load double, ptr %51, align 8, !tbaa !19
  %53 = load ptr, ptr %26, align 8, !tbaa !18
  %54 = getelementptr inbounds double, ptr %53, i64 %49
  store double %52, ptr %54, align 8, !tbaa !19
  %55 = or disjoint i64 %.065, 3
  %56 = load ptr, ptr %25, align 8, !tbaa !18
  %57 = getelementptr inbounds double, ptr %56, i64 %55
  %58 = load double, ptr %57, align 8, !tbaa !19
  %59 = load ptr, ptr %26, align 8, !tbaa !18
  %60 = getelementptr inbounds double, ptr %59, i64 %55
  store double %58, ptr %60, align 8, !tbaa !19
  %61 = add nuw nsw i64 %.065, 4
  %niter.next.3 = add i64 %niter, 4
  %niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
  br i1 %niter.ncmp.3, label %.preheader.unr-lcssa, label %37, !llvm.loop !23

62:                                               ; preds = %.lr.ph68, %62
  %.167 = phi i64 [ 0, %.lr.ph68 ], [ %70, %62 ]
  %63 = load ptr, ptr %34, align 8, !tbaa !18
  %64 = getelementptr inbounds double, ptr %63, i64 %.167
  %65 = load double, ptr %64, align 8, !tbaa !19
  %66 = load ptr, ptr %35, align 8, !tbaa !18
  %67 = shl nsw i64 %.167, 2
  %68 = getelementptr inbounds double, ptr %66, i64 %67
  store double %65, ptr %68, align 8, !tbaa !19
  %69 = load ptr, ptr %34, align 8, !tbaa !18
  %70 = add nuw nsw i64 %.167, 1
  %71 = getelementptr inbounds double, ptr %69, i64 %70
  %72 = load double, ptr %71, align 8, !tbaa !19
  %73 = getelementptr inbounds double, ptr %69, i64 %.167
  %74 = load double, ptr %73, align 8, !tbaa !19
  %75 = fsub double %72, %74
  %76 = load ptr, ptr %36, align 8, !tbaa !18
  %77 = getelementptr inbounds double, ptr %76, i64 %70
  %78 = load double, ptr %77, align 8, !tbaa !19
  %79 = getelementptr inbounds double, ptr %76, i64 %.167
  %80 = load double, ptr %79, align 8, !tbaa !19
  %81 = fsub double %78, %80
  %82 = fdiv double %75, %81
  %83 = load ptr, ptr %35, align 8, !tbaa !18
  %84 = or disjoint i64 %67, 1
  %85 = getelementptr inbounds double, ptr %83, i64 %84
  store double %82, ptr %85, align 8, !tbaa !19
  %86 = load ptr, ptr %35, align 8, !tbaa !18
  %87 = or disjoint i64 %67, 2
  %88 = getelementptr inbounds double, ptr %86, i64 %87
  store double 0.000000e+00, ptr %88, align 8, !tbaa !19
  %89 = load ptr, ptr %35, align 8, !tbaa !18
  %90 = or disjoint i64 %67, 3
  %91 = getelementptr inbounds double, ptr %89, i64 %90
  store double 0.000000e+00, ptr %91, align 8, !tbaa !19
  %exitcond70.not = icmp eq i64 %70, %22
  br i1 %exitcond70.not, label %._crit_edge, label %62, !llvm.loop !25

._crit_edge:                                      ; preds = %62, %5, %.preheader
  %92 = getelementptr inbounds i8, ptr %8, i64 56
  %93 = load ptr, ptr %92, align 8, !tbaa !18
  %94 = getelementptr inbounds double, ptr %93, i64 %22
  %95 = load double, ptr %94, align 8, !tbaa !19
  %96 = getelementptr inbounds i8, ptr %3, i64 152
  %97 = load ptr, ptr %96, align 8, !tbaa !18
  %98 = getelementptr inbounds double, ptr %97, i64 %23
  store double %95, ptr %98, align 8, !tbaa !19
  %99 = load ptr, ptr %96, align 8, !tbaa !18
  %.idx = shl i64 %2, 5
  %100 = getelementptr i8, ptr %99, i64 %.idx
  %101 = getelementptr i8, ptr %100, i64 -56
  %102 = load double, ptr %101, align 8, !tbaa !19
  %103 = or disjoint i64 %23, 1
  %104 = getelementptr inbounds double, ptr %99, i64 %103
  store double %102, ptr %104, align 8, !tbaa !19
  call void @_ZN11alglib_impl14ae_frame_leaveEPNS_8ae_stateE(ptr noundef %4)
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %8) #4
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %7) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %6) #4
  ret void
}

declare void @_ZN11alglib_impl20ae_vector_set_lengthEPNS_9ae_vectorElPNS_8ae_stateE(ptr noundef, i64 noundef, ptr noundef) local_unnamed_addr #2

declare void @_ZN11alglib_impl13ae_frame_makeEPNS_8ae_stateEPNS_8ae_frameE(ptr noundef, ptr noundef) local_unnamed_addr #2

declare void @_ZN11alglib_impl14ae_frame_leaveEPNS_8ae_stateE(ptr noundef) local_unnamed_addr #2

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

declare noundef zeroext i1 @_ZN11alglib_impl14isfinitevectorEPKNS_9ae_vectorElPNS_8ae_stateE(ptr noundef, i64 noundef, ptr noundef) local_unnamed_addr #2

declare noundef zeroext i1 @_ZN11alglib_impl11aredistinctEPKNS_9ae_vectorElPNS_8ae_stateE(ptr noundef, i64 noundef, ptr noundef) local_unnamed_addr #2

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
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 = { 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 #4 = { 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, !7, i64 0}
!6 = !{!"_ZTSN11alglib_impl9ae_vectorE", !7, i64 0, !7, i64 8, !10, i64 16, !11, i64 24, !8, i64 56}
!7 = !{!"long", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"bool", !8, i64 0}
!11 = !{!"_ZTSN11alglib_impl12ae_dyn_blockE", !12, i64 0, !12, i64 8, !12, i64 16, !12, i64 24}
!12 = !{!"any pointer", !8, i64 0}
!13 = !{!14, !10, i64 0}
!14 = !{!"_ZTSN11alglib_impl19spline1dinterpolantE", !10, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !6, i64 32, !6, i64 96}
!15 = !{!14, !7, i64 8}
!16 = !{!14, !7, i64 16}
!17 = !{!14, !7, i64 24}
!18 = !{!8, !8, i64 0}
!19 = !{!20, !20, i64 0}
!20 = !{!"double", !8, i64 0}
!21 = distinct !{!21, !22}
!22 = !{!"llvm.loop.unroll.disable"}
!23 = distinct !{!23, !24}
!24 = !{!"llvm.loop.mustprogress"}
!25 = distinct !{!25, !24}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SROAPass,SimplifyCFGPass