; 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.272 = external hidden unnamed_addr constant [34 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
declare dso_local void @_ZN11alglib_impl19spline1dbuildlinearEPNS_9ae_vectorES1_lPNS_19spline1dinterpolantEPNS_8ae_stateE(ptr noundef, ptr noundef, i64 noundef, ptr noundef, ptr noundef) #3

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef double @_ZN11alglib_impl12spline1dcalcEPNS_19spline1dinterpolantEdPNS_8ae_stateE(ptr noundef, double noundef, ptr noundef) #3

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN11alglib_impl17spline1dlintransxEPNS_19spline1dinterpolantEddPNS_8ae_stateE(ptr noundef %0, double noundef %1, double noundef %2, ptr noundef %3) #3 {
  %5 = alloca ptr, align 8
  %6 = alloca double, align 8
  %7 = alloca double, align 8
  %8 = alloca ptr, align 8
  %9 = alloca %"struct.alglib_impl::ae_frame", align 8
  %10 = alloca i64, align 8
  %11 = alloca i64, align 8
  %12 = alloca double, align 8
  %13 = alloca double, align 8
  %14 = alloca double, align 8
  %15 = alloca %"struct.alglib_impl::ae_vector", align 8
  %16 = alloca %"struct.alglib_impl::ae_vector", align 8
  %17 = alloca %"struct.alglib_impl::ae_vector", align 8
  %18 = alloca i8, align 1
  %19 = alloca i64, align 8
  store ptr %0, ptr %5, align 8, !tbaa !5
  store double %1, ptr %6, align 8, !tbaa !9
  store double %2, ptr %7, align 8, !tbaa !9
  store ptr %3, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 32, ptr %9) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #4
  call void @llvm.lifetime.start.p0(i64 64, ptr %15) #4
  call void @llvm.lifetime.start.p0(i64 64, ptr %16) #4
  call void @llvm.lifetime.start.p0(i64 64, ptr %17) #4
  call void @llvm.lifetime.start.p0(i64 1, ptr %18) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #4
  %20 = load ptr, ptr %8, align 8, !tbaa !5
  call void @_ZN11alglib_impl13ae_frame_makeEPNS_8ae_stateEPNS_8ae_frameE(ptr noundef %20, ptr noundef %9)
  call void @llvm.memset.p0.i64(ptr align 8 %15, i8 0, i64 64, i1 false)
  call void @llvm.memset.p0.i64(ptr align 8 %16, i8 0, i64 64, i1 false)
  call void @llvm.memset.p0.i64(ptr align 8 %17, i8 0, i64 64, i1 false)
  %21 = load ptr, ptr %8, align 8, !tbaa !5
  call void @_ZN11alglib_impl14ae_vector_initEPNS_9ae_vectorEllPNS_8ae_stateEb(ptr noundef %15, i64 noundef 0, i64 noundef 3, ptr noundef %21, i1 noundef zeroext true)
  %22 = load ptr, ptr %8, align 8, !tbaa !5
  call void @_ZN11alglib_impl14ae_vector_initEPNS_9ae_vectorEllPNS_8ae_stateEb(ptr noundef %16, i64 noundef 0, i64 noundef 3, ptr noundef %22, i1 noundef zeroext true)
  %23 = load ptr, ptr %8, align 8, !tbaa !5
  call void @_ZN11alglib_impl14ae_vector_initEPNS_9ae_vectorEllPNS_8ae_stateEb(ptr noundef %17, i64 noundef 0, i64 noundef 3, ptr noundef %23, i1 noundef zeroext true)
  %24 = load ptr, ptr %5, align 8, !tbaa !5
  %25 = getelementptr inbounds %"struct.alglib_impl::spline1dinterpolant", ptr %24, i32 0, i32 2
  %26 = load i64, ptr %25, align 8, !tbaa !11
  %27 = icmp eq i64 %26, 3
  %28 = load ptr, ptr %8, align 8, !tbaa !5
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %27, ptr noundef @.str.272, ptr noundef %28)
  %29 = load ptr, ptr %5, align 8, !tbaa !5
  %30 = getelementptr inbounds %"struct.alglib_impl::spline1dinterpolant", ptr %29, i32 0, i32 1
  %31 = load i64, ptr %30, align 8, !tbaa !17
  store i64 %31, ptr %11, align 8, !tbaa !18
  %32 = load i64, ptr %11, align 8, !tbaa !18
  %33 = load ptr, ptr %8, align 8, !tbaa !5
  call void @_ZN11alglib_impl20ae_vector_set_lengthEPNS_9ae_vectorElPNS_8ae_stateE(ptr noundef %15, i64 noundef %32, ptr noundef %33)
  %34 = load i64, ptr %11, align 8, !tbaa !18
  %35 = load ptr, ptr %8, align 8, !tbaa !5
  call void @_ZN11alglib_impl20ae_vector_set_lengthEPNS_9ae_vectorElPNS_8ae_stateE(ptr noundef %16, i64 noundef %34, ptr noundef %35)
  %36 = load i64, ptr %11, align 8, !tbaa !18
  %37 = load ptr, ptr %8, align 8, !tbaa !5
  call void @_ZN11alglib_impl20ae_vector_set_lengthEPNS_9ae_vectorElPNS_8ae_stateE(ptr noundef %17, i64 noundef %36, ptr noundef %37)
  %38 = load double, ptr %6, align 8, !tbaa !9
  %39 = call noundef zeroext i1 @_ZN11alglib_impl8ae_fp_eqEdd(double noundef %38, double noundef 0.000000e+00)
  br i1 %39, label %40, label %75

40:                                               ; preds = %4
  %41 = load ptr, ptr %5, align 8, !tbaa !5
  %42 = load double, ptr %7, align 8, !tbaa !9
  %43 = load ptr, ptr %8, align 8, !tbaa !5
  %44 = call noundef double @_ZN11alglib_impl12spline1dcalcEPNS_19spline1dinterpolantEdPNS_8ae_stateE(ptr noundef %41, double noundef %42, ptr noundef %43)
  store double %44, ptr %12, align 8, !tbaa !9
  store i64 0, ptr %10, align 8, !tbaa !18
  br label %45

45:                                               ; preds = %71, %40
  %46 = load i64, ptr %10, align 8, !tbaa !18
  %47 = load i64, ptr %11, align 8, !tbaa !18
  %48 = sub nsw i64 %47, 1
  %49 = icmp sle i64 %46, %48
  br i1 %49, label %50, label %74

50:                                               ; preds = %45
  %51 = load ptr, ptr %5, align 8, !tbaa !5
  %52 = getelementptr inbounds %"struct.alglib_impl::spline1dinterpolant", ptr %51, i32 0, i32 4
  %53 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %52, i32 0, i32 4
  %54 = load ptr, ptr %53, align 8, !tbaa !19
  %55 = load i64, ptr %10, align 8, !tbaa !18
  %56 = getelementptr inbounds double, ptr %54, i64 %55
  %57 = load double, ptr %56, align 8, !tbaa !9
  %58 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %15, i32 0, i32 4
  %59 = load ptr, ptr %58, align 8, !tbaa !19
  %60 = load i64, ptr %10, align 8, !tbaa !18
  %61 = getelementptr inbounds double, ptr %59, i64 %60
  store double %57, ptr %61, align 8, !tbaa !9
  %62 = load double, ptr %12, align 8, !tbaa !9
  %63 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %16, i32 0, i32 4
  %64 = load ptr, ptr %63, align 8, !tbaa !19
  %65 = load i64, ptr %10, align 8, !tbaa !18
  %66 = getelementptr inbounds double, ptr %64, i64 %65
  store double %62, ptr %66, align 8, !tbaa !9
  %67 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %17, i32 0, i32 4
  %68 = load ptr, ptr %67, align 8, !tbaa !19
  %69 = load i64, ptr %10, align 8, !tbaa !18
  %70 = getelementptr inbounds double, ptr %68, i64 %69
  store double 0.000000e+00, ptr %70, align 8, !tbaa !9
  br label %71

71:                                               ; preds = %50
  %72 = load i64, ptr %10, align 8, !tbaa !18
  %73 = add nsw i64 %72, 1
  store i64 %73, ptr %10, align 8, !tbaa !18
  br label %45, !llvm.loop !20

74:                                               ; preds = %45
  br label %129

75:                                               ; preds = %4
  store i64 0, ptr %10, align 8, !tbaa !18
  br label %76

76:                                               ; preds = %125, %75
  %77 = load i64, ptr %10, align 8, !tbaa !18
  %78 = load i64, ptr %11, align 8, !tbaa !18
  %79 = sub nsw i64 %78, 1
  %80 = icmp sle i64 %77, %79
  br i1 %80, label %81, label %128

81:                                               ; preds = %76
  %82 = load ptr, ptr %5, align 8, !tbaa !5
  %83 = getelementptr inbounds %"struct.alglib_impl::spline1dinterpolant", ptr %82, i32 0, i32 4
  %84 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %83, i32 0, i32 4
  %85 = load ptr, ptr %84, align 8, !tbaa !19
  %86 = load i64, ptr %10, align 8, !tbaa !18
  %87 = getelementptr inbounds double, ptr %85, i64 %86
  %88 = load double, ptr %87, align 8, !tbaa !9
  %89 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %15, i32 0, i32 4
  %90 = load ptr, ptr %89, align 8, !tbaa !19
  %91 = load i64, ptr %10, align 8, !tbaa !18
  %92 = getelementptr inbounds double, ptr %90, i64 %91
  store double %88, ptr %92, align 8, !tbaa !9
  %93 = load ptr, ptr %5, align 8, !tbaa !5
  %94 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %15, i32 0, i32 4
  %95 = load ptr, ptr %94, align 8, !tbaa !19
  %96 = load i64, ptr %10, align 8, !tbaa !18
  %97 = getelementptr inbounds double, ptr %95, i64 %96
  %98 = load double, ptr %97, align 8, !tbaa !9
  %99 = load ptr, ptr %8, align 8, !tbaa !5
  call void @_ZN11alglib_impl12spline1ddiffEPNS_19spline1dinterpolantEdPdS2_S2_PNS_8ae_stateE(ptr noundef %93, double noundef %98, ptr noundef %12, ptr noundef %13, ptr noundef %14, ptr noundef %99)
  %100 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %15, i32 0, i32 4
  %101 = load ptr, ptr %100, align 8, !tbaa !19
  %102 = load i64, ptr %10, align 8, !tbaa !18
  %103 = getelementptr inbounds double, ptr %101, i64 %102
  %104 = load double, ptr %103, align 8, !tbaa !9
  %105 = load double, ptr %7, align 8, !tbaa !9
  %106 = fsub double %104, %105
  %107 = load double, ptr %6, align 8, !tbaa !9
  %108 = fdiv double %106, %107
  %109 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %15, i32 0, i32 4
  %110 = load ptr, ptr %109, align 8, !tbaa !19
  %111 = load i64, ptr %10, align 8, !tbaa !18
  %112 = getelementptr inbounds double, ptr %110, i64 %111
  store double %108, ptr %112, align 8, !tbaa !9
  %113 = load double, ptr %12, align 8, !tbaa !9
  %114 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %16, i32 0, i32 4
  %115 = load ptr, ptr %114, align 8, !tbaa !19
  %116 = load i64, ptr %10, align 8, !tbaa !18
  %117 = getelementptr inbounds double, ptr %115, i64 %116
  store double %113, ptr %117, align 8, !tbaa !9
  %118 = load double, ptr %6, align 8, !tbaa !9
  %119 = load double, ptr %13, align 8, !tbaa !9
  %120 = fmul double %118, %119
  %121 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %17, i32 0, i32 4
  %122 = load ptr, ptr %121, align 8, !tbaa !19
  %123 = load i64, ptr %10, align 8, !tbaa !18
  %124 = getelementptr inbounds double, ptr %122, i64 %123
  store double %120, ptr %124, align 8, !tbaa !9
  br label %125

125:                                              ; preds = %81
  %126 = load i64, ptr %10, align 8, !tbaa !18
  %127 = add nsw i64 %126, 1
  store i64 %127, ptr %10, align 8, !tbaa !18
  br label %76, !llvm.loop !22

128:                                              ; preds = %76
  br label %129

129:                                              ; preds = %128, %74
  %130 = load ptr, ptr %5, align 8, !tbaa !5
  %131 = getelementptr inbounds %"struct.alglib_impl::spline1dinterpolant", ptr %130, i32 0, i32 0
  %132 = load i8, ptr %131, align 8, !tbaa !23, !range !24, !noundef !25
  %133 = trunc i8 %132 to i1
  %134 = zext i1 %133 to i8
  store i8 %134, ptr %18, align 1, !tbaa !26
  %135 = load ptr, ptr %5, align 8, !tbaa !5
  %136 = getelementptr inbounds %"struct.alglib_impl::spline1dinterpolant", ptr %135, i32 0, i32 3
  %137 = load i64, ptr %136, align 8, !tbaa !27
  store i64 %137, ptr %19, align 8, !tbaa !18
  %138 = load i64, ptr %19, align 8, !tbaa !18
  %139 = icmp sgt i64 %138, 0
  br i1 %139, label %140, label %144

140:                                              ; preds = %129
  %141 = load i64, ptr %11, align 8, !tbaa !18
  %142 = load ptr, ptr %5, align 8, !tbaa !5
  %143 = load ptr, ptr %8, align 8, !tbaa !5
  call void @_ZN11alglib_impl20spline1dbuildhermiteEPNS_9ae_vectorES1_S1_lPNS_19spline1dinterpolantEPNS_8ae_stateE(ptr noundef %15, ptr noundef %16, ptr noundef %17, i64 noundef %141, ptr noundef %142, ptr noundef %143)
  br label %148

144:                                              ; preds = %129
  %145 = load i64, ptr %11, align 8, !tbaa !18
  %146 = load ptr, ptr %5, align 8, !tbaa !5
  %147 = load ptr, ptr %8, align 8, !tbaa !5
  call void @_ZN11alglib_impl19spline1dbuildlinearEPNS_9ae_vectorES1_lPNS_19spline1dinterpolantEPNS_8ae_stateE(ptr noundef %15, ptr noundef %16, i64 noundef %145, ptr noundef %146, ptr noundef %147)
  br label %148

148:                                              ; preds = %144, %140
  %149 = load i8, ptr %18, align 1, !tbaa !26, !range !24, !noundef !25
  %150 = trunc i8 %149 to i1
  %151 = load ptr, ptr %5, align 8, !tbaa !5
  %152 = getelementptr inbounds %"struct.alglib_impl::spline1dinterpolant", ptr %151, i32 0, i32 0
  %153 = zext i1 %150 to i8
  store i8 %153, ptr %152, align 8, !tbaa !23
  %154 = load i64, ptr %19, align 8, !tbaa !18
  %155 = load ptr, ptr %5, align 8, !tbaa !5
  %156 = getelementptr inbounds %"struct.alglib_impl::spline1dinterpolant", ptr %155, i32 0, i32 3
  store i64 %154, ptr %156, align 8, !tbaa !27
  %157 = load ptr, ptr %8, align 8, !tbaa !5
  call void @_ZN11alglib_impl14ae_frame_leaveEPNS_8ae_stateE(ptr noundef %157)
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr %18) #4
  call void @llvm.lifetime.end.p0(i64 64, ptr %17) #4
  call void @llvm.lifetime.end.p0(i64 64, ptr %16) #4
  call void @llvm.lifetime.end.p0(i64 64, ptr %15) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr %9) #4
  ret void
}

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

declare noundef zeroext i1 @_ZN11alglib_impl8ae_fp_eqEdd(double noundef, double noundef) #2

declare void @_ZN11alglib_impl14ae_vector_initEPNS_9ae_vectorEllPNS_8ae_stateEb(ptr noundef, i64 noundef, i64 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

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 = !{!"double", !7, i64 0}
!11 = !{!12, !14, i64 16}
!12 = !{!"_ZTSN11alglib_impl19spline1dinterpolantE", !13, i64 0, !14, i64 8, !14, i64 16, !14, i64 24, !15, i64 32, !15, i64 96}
!13 = !{!"bool", !7, i64 0}
!14 = !{!"long", !7, i64 0}
!15 = !{!"_ZTSN11alglib_impl9ae_vectorE", !14, i64 0, !14, i64 8, !13, i64 16, !16, i64 24, !7, i64 56}
!16 = !{!"_ZTSN11alglib_impl12ae_dyn_blockE", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!17 = !{!12, !14, i64 8}
!18 = !{!14, !14, i64 0}
!19 = !{!7, !7, i64 0}
!20 = distinct !{!20, !21}
!21 = !{!"llvm.loop.mustprogress"}
!22 = distinct !{!22, !21}
!23 = !{!12, !13, i64 0}
!24 = !{i8 0, i8 2}
!25 = !{}
!26 = !{!13, !13, i64 0}
!27 = !{!12, !14, i64 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.272 = external hidden unnamed_addr constant [34 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
declare dso_local void @_ZN11alglib_impl19spline1dbuildlinearEPNS_9ae_vectorES1_lPNS_19spline1dinterpolantEPNS_8ae_stateE(ptr noundef, ptr noundef, i64 noundef, ptr noundef, ptr noundef) local_unnamed_addr #3

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef double @_ZN11alglib_impl12spline1dcalcEPNS_19spline1dinterpolantEdPNS_8ae_stateE(ptr noundef, double noundef, ptr noundef) local_unnamed_addr #3

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN11alglib_impl17spline1dlintransxEPNS_19spline1dinterpolantEddPNS_8ae_stateE(ptr noundef %0, double noundef %1, double noundef %2, ptr noundef %3) local_unnamed_addr #3 {
  %5 = alloca %"struct.alglib_impl::ae_frame", align 8
  %6 = alloca double, align 8
  %7 = alloca double, align 8
  %8 = alloca double, align 8
  %9 = alloca %"struct.alglib_impl::ae_vector", align 8
  %10 = alloca %"struct.alglib_impl::ae_vector", align 8
  %11 = alloca %"struct.alglib_impl::ae_vector", align 8
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %5) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #4
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %9) #4
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %10) #4
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %11) #4
  call void @_ZN11alglib_impl13ae_frame_makeEPNS_8ae_stateEPNS_8ae_frameE(ptr noundef %3, ptr noundef nonnull %5)
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(64) %9, i8 0, i64 64, i1 false)
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(64) %10, i8 0, i64 64, i1 false)
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(64) %11, i8 0, i64 64, i1 false)
  call void @_ZN11alglib_impl14ae_vector_initEPNS_9ae_vectorEllPNS_8ae_stateEb(ptr noundef nonnull %9, i64 noundef 0, i64 noundef 3, ptr noundef %3, i1 noundef zeroext true)
  call void @_ZN11alglib_impl14ae_vector_initEPNS_9ae_vectorEllPNS_8ae_stateEb(ptr noundef nonnull %10, i64 noundef 0, i64 noundef 3, ptr noundef %3, i1 noundef zeroext true)
  call void @_ZN11alglib_impl14ae_vector_initEPNS_9ae_vectorEllPNS_8ae_stateEb(ptr noundef nonnull %11, i64 noundef 0, i64 noundef 3, ptr noundef %3, i1 noundef zeroext true)
  %12 = getelementptr inbounds i8, ptr %0, i64 16
  %13 = load i64, ptr %12, align 8, !tbaa !5
  %14 = icmp eq i64 %13, 3
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %14, ptr noundef nonnull @.str.272, ptr noundef %3)
  %15 = getelementptr inbounds i8, ptr %0, i64 8
  %16 = load i64, ptr %15, align 8, !tbaa !14
  call void @_ZN11alglib_impl20ae_vector_set_lengthEPNS_9ae_vectorElPNS_8ae_stateE(ptr noundef nonnull %9, i64 noundef %16, ptr noundef %3)
  call void @_ZN11alglib_impl20ae_vector_set_lengthEPNS_9ae_vectorElPNS_8ae_stateE(ptr noundef nonnull %10, i64 noundef %16, ptr noundef %3)
  call void @_ZN11alglib_impl20ae_vector_set_lengthEPNS_9ae_vectorElPNS_8ae_stateE(ptr noundef nonnull %11, i64 noundef %16, ptr noundef %3)
  %17 = call noundef zeroext i1 @_ZN11alglib_impl8ae_fp_eqEdd(double noundef %1, double noundef 0.000000e+00)
  br i1 %17, label %22, label %.preheader

.preheader:                                       ; preds = %4
  %.not.not56 = icmp sgt i64 %16, 0
  br i1 %.not.not56, label %.lr.ph, label %.loopexit

.lr.ph:                                           ; preds = %.preheader
  %18 = getelementptr inbounds i8, ptr %0, i64 88
  %19 = getelementptr inbounds i8, ptr %9, i64 56
  %20 = getelementptr inbounds i8, ptr %10, i64 56
  %21 = getelementptr inbounds i8, ptr %11, i64 56
  br label %50

22:                                               ; preds = %4
  %23 = call noundef double @_ZN11alglib_impl12spline1dcalcEPNS_19spline1dinterpolantEdPNS_8ae_stateE(ptr noundef nonnull %0, double noundef %2, ptr noundef %3)
  store double %23, ptr %6, align 8, !tbaa !15
  %.not.not5458 = icmp sgt i64 %16, 0
  br i1 %.not.not5458, label %.lr.ph60, label %.loopexit

.lr.ph60:                                         ; preds = %22
  %24 = getelementptr inbounds i8, ptr %0, i64 88
  %25 = getelementptr inbounds i8, ptr %9, i64 56
  %26 = getelementptr inbounds i8, ptr %10, i64 56
  %27 = getelementptr inbounds i8, ptr %11, i64 56
  %xtraiter = and i64 %16, 1
  %28 = icmp eq i64 %16, 1
  br i1 %28, label %.loopexit.loopexit.unr-lcssa, label %.lr.ph60.new

.lr.ph60.new:                                     ; preds = %.lr.ph60
  %unroll_iter = and i64 %16, 9223372036854775806
  br label %29

29:                                               ; preds = %29, %.lr.ph60.new
  %.059 = phi i64 [ 0, %.lr.ph60.new ], [ %49, %29 ]
  %niter = phi i64 [ 0, %.lr.ph60.new ], [ %niter.next.1, %29 ]
  %30 = load ptr, ptr %24, align 8, !tbaa !17
  %31 = getelementptr inbounds double, ptr %30, i64 %.059
  %32 = load double, ptr %31, align 8, !tbaa !15
  %33 = load ptr, ptr %25, align 8, !tbaa !17
  %34 = getelementptr inbounds double, ptr %33, i64 %.059
  store double %32, ptr %34, align 8, !tbaa !15
  %35 = load ptr, ptr %26, align 8, !tbaa !17
  %36 = getelementptr inbounds double, ptr %35, i64 %.059
  store double %23, ptr %36, align 8, !tbaa !15
  %37 = load ptr, ptr %27, align 8, !tbaa !17
  %38 = getelementptr inbounds double, ptr %37, i64 %.059
  store double 0.000000e+00, ptr %38, align 8, !tbaa !15
  %39 = or disjoint i64 %.059, 1
  %40 = load ptr, ptr %24, align 8, !tbaa !17
  %41 = getelementptr inbounds double, ptr %40, i64 %39
  %42 = load double, ptr %41, align 8, !tbaa !15
  %43 = load ptr, ptr %25, align 8, !tbaa !17
  %44 = getelementptr inbounds double, ptr %43, i64 %39
  store double %42, ptr %44, align 8, !tbaa !15
  %45 = load ptr, ptr %26, align 8, !tbaa !17
  %46 = getelementptr inbounds double, ptr %45, i64 %39
  store double %23, ptr %46, align 8, !tbaa !15
  %47 = load ptr, ptr %27, align 8, !tbaa !17
  %48 = getelementptr inbounds double, ptr %47, i64 %39
  store double 0.000000e+00, ptr %48, align 8, !tbaa !15
  %49 = add nuw nsw i64 %.059, 2
  %niter.next.1 = add i64 %niter, 2
  %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
  br i1 %niter.ncmp.1, label %.loopexit.loopexit.unr-lcssa, label %29, !llvm.loop !18

50:                                               ; preds = %.lr.ph, %50
  %.157 = phi i64 [ 0, %.lr.ph ], [ %71, %50 ]
  %51 = load ptr, ptr %18, align 8, !tbaa !17
  %52 = getelementptr inbounds double, ptr %51, i64 %.157
  %53 = load double, ptr %52, align 8, !tbaa !15
  %54 = load ptr, ptr %19, align 8, !tbaa !17
  %55 = getelementptr inbounds double, ptr %54, i64 %.157
  store double %53, ptr %55, align 8, !tbaa !15
  %56 = load ptr, ptr %19, align 8, !tbaa !17
  %57 = getelementptr inbounds double, ptr %56, i64 %.157
  %58 = load double, ptr %57, align 8, !tbaa !15
  call void @_ZN11alglib_impl12spline1ddiffEPNS_19spline1dinterpolantEdPdS2_S2_PNS_8ae_stateE(ptr noundef nonnull %0, double noundef %58, ptr noundef nonnull %6, ptr noundef nonnull %7, ptr noundef nonnull %8, ptr noundef %3)
  %59 = load ptr, ptr %19, align 8, !tbaa !17
  %60 = getelementptr inbounds double, ptr %59, i64 %.157
  %61 = load double, ptr %60, align 8, !tbaa !15
  %62 = fsub double %61, %2
  %63 = fdiv double %62, %1
  store double %63, ptr %60, align 8, !tbaa !15
  %64 = load double, ptr %6, align 8, !tbaa !15
  %65 = load ptr, ptr %20, align 8, !tbaa !17
  %66 = getelementptr inbounds double, ptr %65, i64 %.157
  store double %64, ptr %66, align 8, !tbaa !15
  %67 = load double, ptr %7, align 8, !tbaa !15
  %68 = fmul double %67, %1
  %69 = load ptr, ptr %21, align 8, !tbaa !17
  %70 = getelementptr inbounds double, ptr %69, i64 %.157
  store double %68, ptr %70, align 8, !tbaa !15
  %71 = add nuw nsw i64 %.157, 1
  %exitcond.not = icmp eq i64 %71, %16
  br i1 %exitcond.not, label %.loopexit, label %50, !llvm.loop !20

.loopexit.loopexit.unr-lcssa:                     ; preds = %29, %.lr.ph60
  %.059.unr = phi i64 [ 0, %.lr.ph60 ], [ %49, %29 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.loopexit, label %.loopexit.loopexit.epilog-lcssa

.loopexit.loopexit.epilog-lcssa:                  ; preds = %.loopexit.loopexit.unr-lcssa
  %72 = load ptr, ptr %24, align 8, !tbaa !17
  %73 = getelementptr inbounds double, ptr %72, i64 %.059.unr
  %74 = load double, ptr %73, align 8, !tbaa !15
  %75 = load ptr, ptr %25, align 8, !tbaa !17
  %76 = getelementptr inbounds double, ptr %75, i64 %.059.unr
  store double %74, ptr %76, align 8, !tbaa !15
  %77 = load ptr, ptr %26, align 8, !tbaa !17
  %78 = getelementptr inbounds double, ptr %77, i64 %.059.unr
  store double %23, ptr %78, align 8, !tbaa !15
  %79 = load ptr, ptr %27, align 8, !tbaa !17
  %80 = getelementptr inbounds double, ptr %79, i64 %.059.unr
  store double 0.000000e+00, ptr %80, align 8, !tbaa !15
  br label %.loopexit

.loopexit:                                        ; preds = %50, %.loopexit.loopexit.epilog-lcssa, %.loopexit.loopexit.unr-lcssa, %.preheader, %22
  %81 = load i8, ptr %0, align 8, !tbaa !21, !range !22, !noundef !23
  %82 = getelementptr inbounds i8, ptr %0, i64 24
  %83 = load i64, ptr %82, align 8, !tbaa !24
  %84 = icmp sgt i64 %83, 0
  br i1 %84, label %85, label %86

85:                                               ; preds = %.loopexit
  call void @_ZN11alglib_impl20spline1dbuildhermiteEPNS_9ae_vectorES1_S1_lPNS_19spline1dinterpolantEPNS_8ae_stateE(ptr noundef nonnull %9, ptr noundef nonnull %10, ptr noundef nonnull %11, i64 noundef %16, ptr noundef nonnull %0, ptr noundef %3)
  br label %87

86:                                               ; preds = %.loopexit
  call void @_ZN11alglib_impl19spline1dbuildlinearEPNS_9ae_vectorES1_lPNS_19spline1dinterpolantEPNS_8ae_stateE(ptr noundef nonnull %9, ptr noundef nonnull %10, i64 noundef %16, ptr noundef nonnull %0, ptr noundef %3)
  br label %87

87:                                               ; preds = %86, %85
  store i8 %81, ptr %0, align 8, !tbaa !21
  store i64 %83, ptr %82, align 8, !tbaa !24
  call void @_ZN11alglib_impl14ae_frame_leaveEPNS_8ae_stateE(ptr noundef %3)
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %11) #4
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %10) #4
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %9) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #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 noundef zeroext i1 @_ZN11alglib_impl8ae_fp_eqEdd(double noundef, double noundef) local_unnamed_addr #2

declare void @_ZN11alglib_impl14ae_vector_initEPNS_9ae_vectorEllPNS_8ae_stateEb(ptr noundef, i64 noundef, i64 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

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, !10, i64 16}
!6 = !{!"_ZTSN11alglib_impl19spline1dinterpolantE", !7, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !11, i64 32, !11, i64 96}
!7 = !{!"bool", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"long", !8, i64 0}
!11 = !{!"_ZTSN11alglib_impl9ae_vectorE", !10, i64 0, !10, i64 8, !7, i64 16, !12, i64 24, !8, i64 56}
!12 = !{!"_ZTSN11alglib_impl12ae_dyn_blockE", !13, i64 0, !13, i64 8, !13, i64 16, !13, i64 24}
!13 = !{!"any pointer", !8, i64 0}
!14 = !{!6, !10, i64 8}
!15 = !{!16, !16, i64 0}
!16 = !{!"double", !8, i64 0}
!17 = !{!8, !8, i64 0}
!18 = distinct !{!18, !19}
!19 = !{!"llvm.loop.mustprogress"}
!20 = distinct !{!20, !19}
!21 = !{!6, !7, i64 0}
!22 = !{i8 0, i8 2}
!23 = !{}
!24 = !{!6, !10, i64 24}


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