; 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::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.161 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.162 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.163 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.164 = external hidden unnamed_addr constant [56 x i8], align 1
@.str.165 = external hidden unnamed_addr constant [56 x i8], align 1
@.str.166 = 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_impl19spline1dbuildlinearEPNS_9ae_vectorES1_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_vectorES1_PNS_8ae_stateEb(ptr noundef %12, ptr noundef %16, ptr noundef %17, i1 noundef zeroext true)
  store ptr %12, ptr %6, align 8, !tbaa !5
  %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_vectorES1_PNS_8ae_stateEb(ptr noundef %13, ptr noundef %18, ptr noundef %19, i1 noundef zeroext true)
  store ptr %13, ptr %7, align 8, !tbaa !5
  %20 = load ptr, ptr %9, align 8, !tbaa !5
  call void @_ZN11alglib_impl26_spline1dinterpolant_clearEPv(ptr noundef %20)
  %21 = load i64, ptr %8, align 8, !tbaa !9
  %22 = icmp sgt i64 %21, 1
  %23 = load ptr, ptr %10, align 8, !tbaa !5
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %22, ptr noundef @.str.161, ptr noundef %23)
  %24 = load ptr, ptr %6, align 8, !tbaa !5
  %25 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %24, i32 0, i32 0
  %26 = load i64, ptr %25, align 8, !tbaa !11
  %27 = load i64, ptr %8, align 8, !tbaa !9
  %28 = icmp sge i64 %26, %27
  %29 = load ptr, ptr %10, align 8, !tbaa !5
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %28, ptr noundef @.str.162, ptr noundef %29)
  %30 = load ptr, ptr %7, align 8, !tbaa !5
  %31 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %30, i32 0, i32 0
  %32 = load i64, ptr %31, align 8, !tbaa !11
  %33 = load i64, ptr %8, align 8, !tbaa !9
  %34 = icmp sge i64 %32, %33
  %35 = load ptr, ptr %10, align 8, !tbaa !5
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %34, ptr noundef @.str.163, ptr noundef %35)
  %36 = load ptr, ptr %6, align 8, !tbaa !5
  %37 = load i64, ptr %8, align 8, !tbaa !9
  %38 = load ptr, ptr %10, align 8, !tbaa !5
  %39 = call noundef zeroext i1 @_ZN11alglib_impl14isfinitevectorEPNS_9ae_vectorElPNS_8ae_stateE(ptr noundef %36, 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.164, ptr noundef %40)
  %41 = load ptr, ptr %7, align 8, !tbaa !5
  %42 = load i64, ptr %8, align 8, !tbaa !9
  %43 = load ptr, ptr %10, align 8, !tbaa !5
  %44 = call noundef zeroext i1 @_ZN11alglib_impl14isfinitevectorEPNS_9ae_vectorElPNS_8ae_stateE(ptr noundef %41, i64 noundef %42, ptr noundef %43)
  %45 = load ptr, ptr %10, align 8, !tbaa !5
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %44, ptr noundef @.str.165, ptr noundef %45)
  %46 = load ptr, ptr %6, align 8, !tbaa !5
  %47 = load ptr, ptr %7, align 8, !tbaa !5
  %48 = load i64, ptr %8, align 8, !tbaa !9
  %49 = load ptr, ptr %10, align 8, !tbaa !5
  call void @_ZN11alglib_implL23spline1d_heapsortpointsEPNS_9ae_vectorES1_lPNS_8ae_stateE(ptr noundef %46, ptr noundef %47, i64 noundef %48, ptr noundef %49)
  %50 = load ptr, ptr %6, align 8, !tbaa !5
  %51 = load i64, ptr %8, align 8, !tbaa !9
  %52 = load ptr, ptr %10, align 8, !tbaa !5
  %53 = call noundef zeroext i1 @_ZN11alglib_impl11aredistinctEPNS_9ae_vectorElPNS_8ae_stateE(ptr noundef %50, i64 noundef %51, ptr noundef %52)
  %54 = load ptr, ptr %10, align 8, !tbaa !5
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %53, ptr noundef @.str.166, ptr noundef %54)
  %55 = load ptr, ptr %9, align 8, !tbaa !5
  %56 = getelementptr inbounds %"struct.alglib_impl::spline1dinterpolant", ptr %55, i32 0, i32 0
  store i8 0, ptr %56, align 8, !tbaa !15
  %57 = load i64, ptr %8, align 8, !tbaa !9
  %58 = load ptr, ptr %9, align 8, !tbaa !5
  %59 = getelementptr inbounds %"struct.alglib_impl::spline1dinterpolant", ptr %58, i32 0, i32 1
  store i64 %57, ptr %59, align 8, !tbaa !17
  %60 = load ptr, ptr %9, align 8, !tbaa !5
  %61 = getelementptr inbounds %"struct.alglib_impl::spline1dinterpolant", ptr %60, i32 0, i32 2
  store i64 3, ptr %61, align 8, !tbaa !18
  %62 = load ptr, ptr %9, align 8, !tbaa !5
  %63 = getelementptr inbounds %"struct.alglib_impl::spline1dinterpolant", ptr %62, i32 0, i32 3
  store i64 0, ptr %63, align 8, !tbaa !19
  %64 = load ptr, ptr %9, align 8, !tbaa !5
  %65 = getelementptr inbounds %"struct.alglib_impl::spline1dinterpolant", ptr %64, i32 0, i32 4
  %66 = load i64, ptr %8, align 8, !tbaa !9
  %67 = load ptr, ptr %10, align 8, !tbaa !5
  call void @_ZN11alglib_impl20ae_vector_set_lengthEPNS_9ae_vectorElPNS_8ae_stateE(ptr noundef %65, i64 noundef %66, ptr noundef %67)
  %68 = load ptr, ptr %9, align 8, !tbaa !5
  %69 = getelementptr inbounds %"struct.alglib_impl::spline1dinterpolant", ptr %68, i32 0, i32 5
  %70 = load i64, ptr %8, align 8, !tbaa !9
  %71 = sub nsw i64 %70, 1
  %72 = mul nsw i64 4, %71
  %73 = add nsw i64 %72, 2
  %74 = load ptr, ptr %10, align 8, !tbaa !5
  call void @_ZN11alglib_impl20ae_vector_set_lengthEPNS_9ae_vectorElPNS_8ae_stateE(ptr noundef %69, i64 noundef %73, ptr noundef %74)
  store i64 0, ptr %14, align 8, !tbaa !9
  br label %75

75:                                               ; preds = %93, %5
  %76 = load i64, ptr %14, align 8, !tbaa !9
  %77 = load i64, ptr %8, align 8, !tbaa !9
  %78 = sub nsw i64 %77, 1
  %79 = icmp sle i64 %76, %78
  br i1 %79, label %80, label %96

80:                                               ; preds = %75
  %81 = load ptr, ptr %6, align 8, !tbaa !5
  %82 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %81, i32 0, i32 4
  %83 = load ptr, ptr %82, align 8, !tbaa !20
  %84 = load i64, ptr %14, align 8, !tbaa !9
  %85 = getelementptr inbounds double, ptr %83, i64 %84
  %86 = load double, ptr %85, align 8, !tbaa !21
  %87 = load ptr, ptr %9, align 8, !tbaa !5
  %88 = getelementptr inbounds %"struct.alglib_impl::spline1dinterpolant", ptr %87, i32 0, i32 4
  %89 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %88, i32 0, i32 4
  %90 = load ptr, ptr %89, align 8, !tbaa !20
  %91 = load i64, ptr %14, align 8, !tbaa !9
  %92 = getelementptr inbounds double, ptr %90, i64 %91
  store double %86, ptr %92, align 8, !tbaa !21
  br label %93

93:                                               ; preds = %80
  %94 = load i64, ptr %14, align 8, !tbaa !9
  %95 = add nsw i64 %94, 1
  store i64 %95, ptr %14, align 8, !tbaa !9
  br label %75, !llvm.loop !23

96:                                               ; preds = %75
  store i64 0, ptr %14, align 8, !tbaa !9
  br label %97

97:                                               ; preds = %170, %96
  %98 = load i64, ptr %14, align 8, !tbaa !9
  %99 = load i64, ptr %8, align 8, !tbaa !9
  %100 = sub nsw i64 %99, 2
  %101 = icmp sle i64 %98, %100
  br i1 %101, label %102, label %173

102:                                              ; preds = %97
  %103 = load ptr, ptr %7, align 8, !tbaa !5
  %104 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %103, i32 0, i32 4
  %105 = load ptr, ptr %104, align 8, !tbaa !20
  %106 = load i64, ptr %14, align 8, !tbaa !9
  %107 = getelementptr inbounds double, ptr %105, i64 %106
  %108 = load double, ptr %107, align 8, !tbaa !21
  %109 = load ptr, ptr %9, align 8, !tbaa !5
  %110 = getelementptr inbounds %"struct.alglib_impl::spline1dinterpolant", ptr %109, i32 0, i32 5
  %111 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %110, i32 0, i32 4
  %112 = load ptr, ptr %111, align 8, !tbaa !20
  %113 = load i64, ptr %14, align 8, !tbaa !9
  %114 = mul nsw i64 4, %113
  %115 = add nsw i64 %114, 0
  %116 = getelementptr inbounds double, ptr %112, i64 %115
  store double %108, ptr %116, align 8, !tbaa !21
  %117 = load ptr, ptr %7, align 8, !tbaa !5
  %118 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %117, i32 0, i32 4
  %119 = load ptr, ptr %118, align 8, !tbaa !20
  %120 = load i64, ptr %14, align 8, !tbaa !9
  %121 = add nsw i64 %120, 1
  %122 = getelementptr inbounds double, ptr %119, i64 %121
  %123 = load double, ptr %122, align 8, !tbaa !21
  %124 = load ptr, ptr %7, align 8, !tbaa !5
  %125 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %124, 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 %123, %129
  %131 = load ptr, ptr %6, align 8, !tbaa !5
  %132 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %131, i32 0, i32 4
  %133 = load ptr, ptr %132, align 8, !tbaa !20
  %134 = load i64, ptr %14, align 8, !tbaa !9
  %135 = add nsw i64 %134, 1
  %136 = getelementptr inbounds double, ptr %133, i64 %135
  %137 = load double, ptr %136, align 8, !tbaa !21
  %138 = load ptr, ptr %6, align 8, !tbaa !5
  %139 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %138, i32 0, i32 4
  %140 = load ptr, ptr %139, align 8, !tbaa !20
  %141 = load i64, ptr %14, align 8, !tbaa !9
  %142 = getelementptr inbounds double, ptr %140, i64 %141
  %143 = load double, ptr %142, align 8, !tbaa !21
  %144 = fsub double %137, %143
  %145 = fdiv double %130, %144
  %146 = load ptr, ptr %9, align 8, !tbaa !5
  %147 = getelementptr inbounds %"struct.alglib_impl::spline1dinterpolant", ptr %146, i32 0, i32 5
  %148 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %147, i32 0, i32 4
  %149 = load ptr, ptr %148, align 8, !tbaa !20
  %150 = load i64, ptr %14, align 8, !tbaa !9
  %151 = mul nsw i64 4, %150
  %152 = add nsw i64 %151, 1
  %153 = getelementptr inbounds double, ptr %149, i64 %152
  store double %145, ptr %153, align 8, !tbaa !21
  %154 = load ptr, ptr %9, align 8, !tbaa !5
  %155 = getelementptr inbounds %"struct.alglib_impl::spline1dinterpolant", ptr %154, i32 0, i32 5
  %156 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %155, i32 0, i32 4
  %157 = load ptr, ptr %156, align 8, !tbaa !20
  %158 = load i64, ptr %14, align 8, !tbaa !9
  %159 = mul nsw i64 4, %158
  %160 = add nsw i64 %159, 2
  %161 = getelementptr inbounds double, ptr %157, i64 %160
  store double 0.000000e+00, ptr %161, align 8, !tbaa !21
  %162 = load ptr, ptr %9, align 8, !tbaa !5
  %163 = getelementptr inbounds %"struct.alglib_impl::spline1dinterpolant", ptr %162, i32 0, i32 5
  %164 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %163, i32 0, i32 4
  %165 = load ptr, ptr %164, align 8, !tbaa !20
  %166 = load i64, ptr %14, align 8, !tbaa !9
  %167 = mul nsw i64 4, %166
  %168 = add nsw i64 %167, 3
  %169 = getelementptr inbounds double, ptr %165, i64 %168
  store double 0.000000e+00, ptr %169, align 8, !tbaa !21
  br label %170

170:                                              ; preds = %102
  %171 = load i64, ptr %14, align 8, !tbaa !9
  %172 = add nsw i64 %171, 1
  store i64 %172, ptr %14, align 8, !tbaa !9
  br label %97, !llvm.loop !25

173:                                              ; preds = %97
  %174 = load ptr, ptr %7, align 8, !tbaa !5
  %175 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %174, i32 0, i32 4
  %176 = load ptr, ptr %175, align 8, !tbaa !20
  %177 = load i64, ptr %8, align 8, !tbaa !9
  %178 = sub nsw i64 %177, 1
  %179 = getelementptr inbounds double, ptr %176, i64 %178
  %180 = load double, ptr %179, align 8, !tbaa !21
  %181 = load ptr, ptr %9, align 8, !tbaa !5
  %182 = getelementptr inbounds %"struct.alglib_impl::spline1dinterpolant", ptr %181, i32 0, i32 5
  %183 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %182, i32 0, i32 4
  %184 = load ptr, ptr %183, align 8, !tbaa !20
  %185 = load i64, ptr %8, align 8, !tbaa !9
  %186 = sub nsw i64 %185, 1
  %187 = mul nsw i64 4, %186
  %188 = add nsw i64 %187, 0
  %189 = getelementptr inbounds double, ptr %184, i64 %188
  store double %180, ptr %189, align 8, !tbaa !21
  %190 = load ptr, ptr %9, align 8, !tbaa !5
  %191 = getelementptr inbounds %"struct.alglib_impl::spline1dinterpolant", ptr %190, i32 0, i32 5
  %192 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %191, i32 0, i32 4
  %193 = load ptr, ptr %192, align 8, !tbaa !20
  %194 = load i64, ptr %8, align 8, !tbaa !9
  %195 = sub nsw i64 %194, 2
  %196 = mul nsw i64 4, %195
  %197 = add nsw i64 %196, 1
  %198 = getelementptr inbounds double, ptr %193, i64 %197
  %199 = load double, ptr %198, align 8, !tbaa !21
  %200 = load ptr, ptr %9, align 8, !tbaa !5
  %201 = getelementptr inbounds %"struct.alglib_impl::spline1dinterpolant", ptr %200, i32 0, i32 5
  %202 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %201, i32 0, i32 4
  %203 = load ptr, ptr %202, align 8, !tbaa !20
  %204 = load i64, ptr %8, align 8, !tbaa !9
  %205 = sub nsw i64 %204, 1
  %206 = mul nsw i64 4, %205
  %207 = add nsw i64 %206, 1
  %208 = getelementptr inbounds double, ptr %203, i64 %207
  store double %199, ptr %208, align 8, !tbaa !21
  %209 = load ptr, ptr %10, align 8, !tbaa !5
  call void @_ZN11alglib_impl14ae_frame_leaveEPNS_8ae_stateE(ptr noundef %209)
  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 noundef zeroext i1 @_ZN11alglib_impl14isfinitevectorEPNS_9ae_vectorElPNS_8ae_stateE(ptr noundef, i64 noundef, ptr noundef) #2

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

declare void @_ZN11alglib_impl19ae_vector_init_copyEPNS_9ae_vectorES1_PNS_8ae_stateEb(ptr noundef, ptr noundef, ptr noundef, i1 noundef zeroext) #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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN11alglib_impl26_spline1dinterpolant_clearEPv(ptr noundef) #3

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

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

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.161 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.162 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.163 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.164 = external hidden unnamed_addr constant [56 x i8], align 1
@.str.165 = external hidden unnamed_addr constant [56 x i8], align 1
@.str.166 = 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_impl19spline1dbuildlinearEPNS_9ae_vectorES1_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_vectorES1_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_vectorES1_PNS_8ae_stateEb(ptr noundef nonnull %8, ptr noundef %1, ptr noundef %4, i1 noundef zeroext true)
  call void @_ZN11alglib_impl26_spline1dinterpolant_clearEPv(ptr noundef %3)
  %9 = icmp sgt i64 %2, 1
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %9, ptr noundef nonnull @.str.161, 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.162, 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.163, ptr noundef %4)
  %14 = call noundef zeroext i1 @_ZN11alglib_impl14isfinitevectorEPNS_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.164, ptr noundef %4)
  %15 = call noundef zeroext i1 @_ZN11alglib_impl14isfinitevectorEPNS_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.165, 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_impl11aredistinctEPNS_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.166, 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.not79 = icmp sgt i64 %2, 0
  br i1 %.not.not79, 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
  %.080.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
  %.080.epil = phi i64 [ %33, %.epil.preheader ], [ %.080.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 %.080.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 %.080.epil
  store double %30, ptr %32, align 8, !tbaa !19
  %33 = add nuw nsw i64 %.080.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
  %.not81 = icmp eq i64 %2, 1
  br i1 %.not81, label %._crit_edge, label %.lr.ph83

.lr.ph83:                                         ; 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
  %.080 = 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 %.080
  %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 %.080
  store double %40, ptr %42, align 8, !tbaa !19
  %43 = or disjoint i64 %.080, 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 %.080, 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 %.080, 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 %.080, 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.ph83, %62
  %.182 = phi i64 [ 0, %.lr.ph83 ], [ %70, %62 ]
  %63 = load ptr, ptr %34, align 8, !tbaa !18
  %64 = getelementptr inbounds double, ptr %63, i64 %.182
  %65 = load double, ptr %64, align 8, !tbaa !19
  %66 = load ptr, ptr %35, align 8, !tbaa !18
  %67 = shl nsw i64 %.182, 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 %.182, 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 %.182
  %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 %.182
  %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
  %exitcond85.not = icmp eq i64 %70, %22
  br i1 %exitcond85.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 noundef zeroext i1 @_ZN11alglib_impl14isfinitevectorEPNS_9ae_vectorElPNS_8ae_stateE(ptr noundef, i64 noundef, ptr noundef) local_unnamed_addr #2

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

declare void @_ZN11alglib_impl19ae_vector_init_copyEPNS_9ae_vectorES1_PNS_8ae_stateEb(ptr noundef, ptr noundef, ptr noundef, i1 noundef zeroext) 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

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

; 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

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

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