; 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::xparams" = type { i64 }
%struct.__jmp_buf_tag = type { [8 x i64], i32, %struct.__sigset_t }
%struct.__sigset_t = type { [16 x i64] }
%"struct.alglib_impl::ae_state" = type { i64, double, double, double, ptr, %"struct.alglib_impl::ae_dyn_block", ptr, i32, ptr, i64, ptr, ptr, ptr }
%"struct.alglib_impl::ae_dyn_block" = type { ptr, ptr, ptr, ptr }
%"class.alglib::lsfitstate" = type { %"class.alglib::_lsfitstate_owner", ptr, ptr, ptr, ptr, %"class.alglib::real_1d_array", ptr, %"class.alglib::real_1d_array", %"class.alglib::real_2d_array", %"class.alglib::real_1d_array" }
%"class.alglib::_lsfitstate_owner" = type { ptr, ptr }
%"class.alglib::real_2d_array" = type { %"class.alglib::ae_matrix_wrapper.base", [7 x i8] }
%"class.alglib::ae_matrix_wrapper.base" = type <{ ptr, ptr, %"struct.alglib_impl::ae_matrix", i8 }>
%"struct.alglib_impl::ae_matrix" = type { i64, i64, i64, i64, i8, %"struct.alglib_impl::ae_dyn_block", %union.anon.1 }
%union.anon.1 = type { ptr }
%"class.alglib::real_1d_array" = type { %"class.alglib::ae_vector_wrapper.base", [7 x i8] }
%"class.alglib::ae_vector_wrapper.base" = type <{ ptr, ptr, %"struct.alglib_impl::ae_vector", i8 }>
%"struct.alglib_impl::ae_vector" = type { i64, i64, i8, %"struct.alglib_impl::ae_dyn_block", %union.anon.0 }
%union.anon.0 = type { ptr }

@_ZTIN6alglib8ap_errorE = external dso_local constant { ptr, ptr }, align 8
@.str.74 = external hidden unnamed_addr constant [45 x i8], align 1
@.str.75 = external hidden unnamed_addr constant [66 x i8], align 1
@.str.76 = external hidden unnamed_addr constant [45 x i8], align 1
@.str.77 = external hidden unnamed_addr constant [45 x i8], align 1
@.str.78 = external hidden unnamed_addr constant [45 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

declare void @_ZN11alglib_impl13ae_state_initEPNS_8ae_stateE(ptr noundef) #1

; Function Attrs: nounwind returns_twice
declare i32 @_setjmp(ptr noundef) #2

declare ptr @__cxa_allocate_exception(i64)

declare void @_ZN6alglib8ap_errorC1EPKc(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef) unnamed_addr #1

declare i32 @__gxx_personality_v0(...)

declare void @__cxa_free_exception(ptr)

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN6alglib8ap_errorD2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #3 align 2

declare void @__cxa_throw(ptr, ptr, ptr)

declare void @_ZN11alglib_impl23ae_state_set_break_jumpEPNS_8ae_stateEPA1_13__jmp_buf_tag(ptr noundef, ptr noundef) #1

declare void @_ZN11alglib_impl14ae_state_clearEPNS_8ae_stateE(ptr noundef) #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) #1

declare ptr @__cxa_begin_catch(ptr)

declare void @_ZN11alglib_impl18ae_state_set_flagsEPNS_8ae_stateEy(ptr noundef, i64 noundef) #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZN6alglib17_lsfitstate_owner5c_ptrEv(ptr noundef nonnull align 8 dereferenceable(16)) #4 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN11alglib_impl14lsfititerationEPNS_10lsfitstateEPNS_8ae_stateE(ptr noundef, ptr noundef) #5

declare void @__cxa_end_catch()

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN6alglib8lsfitfitERNS_10lsfitstateEPFvRKNS_13real_1d_arrayES4_RdPvEPFvS4_S4_S5_RS2_S6_EPFvS4_S4_S5_S9_RNS_13real_2d_arrayES6_EPFvS4_dS6_ES6_NS_7xparamsE(ptr noundef nonnull align 8 dereferenceable(424) %0, ptr noundef %1, ptr noundef %2, ptr noundef %3, ptr noundef %4, ptr noundef %5, i64 %6) #5 personality ptr @__gxx_personality_v0 {
  %8 = alloca %"struct.alglib::xparams", align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca [1 x %struct.__jmp_buf_tag], align 16
  %16 = alloca %"struct.alglib_impl::ae_state", align 8
  %17 = alloca ptr, align 8
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = getelementptr inbounds %"struct.alglib::xparams", ptr %8, i32 0, i32 0
  store i64 %6, ptr %20, align 8
  store ptr %0, ptr %9, align 8, !tbaa !5
  store ptr %1, ptr %10, align 8, !tbaa !5
  store ptr %2, ptr %11, align 8, !tbaa !5
  store ptr %3, ptr %12, align 8, !tbaa !5
  store ptr %4, ptr %13, align 8, !tbaa !5
  store ptr %5, ptr %14, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 200, ptr %15) #6
  call void @llvm.lifetime.start.p0(i64 128, ptr %16) #6
  call void @_ZN11alglib_impl13ae_state_initEPNS_8ae_stateE(ptr noundef %16)
  %21 = getelementptr inbounds [1 x %struct.__jmp_buf_tag], ptr %15, i64 0, i64 0
  %22 = call i32 @_setjmp(ptr noundef %21) #7
  %23 = icmp ne i32 %22, 0
  br i1 %23, label %24, label %33

24:                                               ; preds = %7
  %25 = call ptr @__cxa_allocate_exception(i64 32) #6
  %26 = getelementptr inbounds %"struct.alglib_impl::ae_state", ptr %16, i32 0, i32 8
  %27 = load volatile ptr, ptr %26, align 8, !tbaa !9
  invoke void @_ZN6alglib8ap_errorC1EPKc(ptr noundef nonnull align 8 dereferenceable(32) %25, ptr noundef %27)
          to label %28 unwind label %29

28:                                               ; preds = %24
  call void @__cxa_throw(ptr %25, ptr @_ZTIN6alglib8ap_errorE, ptr @_ZN6alglib8ap_errorD2Ev) #8
  unreachable

29:                                               ; preds = %24
  %30 = landingpad { ptr, i32 }
          cleanup
  %31 = extractvalue { ptr, i32 } %30, 0
  store ptr %31, ptr %17, align 8
  %32 = extractvalue { ptr, i32 } %30, 1
  store i32 %32, ptr %18, align 4
  call void @__cxa_free_exception(ptr %25) #6
  call void @llvm.lifetime.end.p0(i64 128, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 200, ptr %15) #6
  br label %140

33:                                               ; preds = %7
  call void @_ZN11alglib_impl23ae_state_set_break_jumpEPNS_8ae_stateEPA1_13__jmp_buf_tag(ptr noundef %16, ptr noundef %15)
  %34 = getelementptr inbounds %"struct.alglib::xparams", ptr %8, i32 0, i32 0
  %35 = load i64, ptr %34, align 8, !tbaa !16
  %36 = icmp ne i64 %35, 0
  br i1 %36, label %37, label %40

37:                                               ; preds = %33
  %38 = getelementptr inbounds %"struct.alglib::xparams", ptr %8, i32 0, i32 0
  %39 = load i64, ptr %38, align 8, !tbaa !16
  call void @_ZN11alglib_impl18ae_state_set_flagsEPNS_8ae_stateEy(ptr noundef %16, i64 noundef %39)
  br label %40

40:                                               ; preds = %37, %33
  %41 = load ptr, ptr %10, align 8, !tbaa !5
  %42 = icmp ne ptr %41, null
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %42, ptr noundef @.str.74, ptr noundef %16)
  %43 = load ptr, ptr %11, align 8, !tbaa !5
  %44 = icmp ne ptr %43, null
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %44, ptr noundef @.str.77, ptr noundef %16)
  %45 = load ptr, ptr %12, align 8, !tbaa !5
  %46 = icmp ne ptr %45, null
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %46, ptr noundef @.str.78, ptr noundef %16)
  br label %47

47:                                               ; preds = %138, %134, %114, %93, %67, %40
  %48 = load ptr, ptr %9, align 8, !tbaa !5
  %49 = call noundef ptr @_ZN6alglib17_lsfitstate_owner5c_ptrEv(ptr noundef nonnull align 8 dereferenceable(16) %48)
  %50 = call noundef zeroext i1 @_ZN11alglib_impl14lsfititerationEPNS_10lsfitstateEPNS_8ae_stateE(ptr noundef %49, ptr noundef %16)
  br i1 %50, label %51, label %139

51:                                               ; preds = %47
  %52 = load ptr, ptr %9, align 8, !tbaa !5
  %53 = getelementptr inbounds %"class.alglib::lsfitstate", ptr %52, i32 0, i32 1
  %54 = load ptr, ptr %53, align 8, !tbaa !18
  %55 = load i8, ptr %54, align 1, !tbaa !28, !range !29, !noundef !30
  %56 = trunc i8 %55 to i1
  br i1 %56, label %57, label %75

57:                                               ; preds = %51
  %58 = load ptr, ptr %10, align 8, !tbaa !5
  %59 = load ptr, ptr %9, align 8, !tbaa !5
  %60 = getelementptr inbounds %"class.alglib::lsfitstate", ptr %59, i32 0, i32 5
  %61 = load ptr, ptr %9, align 8, !tbaa !5
  %62 = getelementptr inbounds %"class.alglib::lsfitstate", ptr %61, i32 0, i32 9
  %63 = load ptr, ptr %9, align 8, !tbaa !5
  %64 = getelementptr inbounds %"class.alglib::lsfitstate", ptr %63, i32 0, i32 6
  %65 = load ptr, ptr %64, align 8, !tbaa !31
  %66 = load ptr, ptr %14, align 8, !tbaa !5
  invoke void %58(ptr noundef nonnull align 8 dereferenceable(81) %60, ptr noundef nonnull align 8 dereferenceable(81) %62, ptr noundef nonnull align 8 dereferenceable(8) %65, ptr noundef %66)
          to label %67 unwind label %68

67:                                               ; preds = %57
  br label %47, !llvm.loop !32

68:                                               ; preds = %124, %100, %81, %57
  %69 = landingpad { ptr, i32 }
          catch ptr null
  %70 = extractvalue { ptr, i32 } %69, 0
  store ptr %70, ptr %17, align 8
  %71 = extractvalue { ptr, i32 } %69, 1
  store i32 %71, ptr %18, align 4
  br label %72

72:                                               ; preds = %68
  %73 = load ptr, ptr %17, align 8
  %74 = call ptr @__cxa_begin_catch(ptr %73) #6
  store i32 5, ptr %19, align 4
  call void @__cxa_end_catch()
  br label %138

75:                                               ; preds = %51
  %76 = load ptr, ptr %9, align 8, !tbaa !5
  %77 = getelementptr inbounds %"class.alglib::lsfitstate", ptr %76, i32 0, i32 2
  %78 = load ptr, ptr %77, align 8, !tbaa !34
  %79 = load i8, ptr %78, align 1, !tbaa !28, !range !29, !noundef !30
  %80 = trunc i8 %79 to i1
  br i1 %80, label %81, label %94

81:                                               ; preds = %75
  %82 = load ptr, ptr %11, align 8, !tbaa !5
  %83 = load ptr, ptr %9, align 8, !tbaa !5
  %84 = getelementptr inbounds %"class.alglib::lsfitstate", ptr %83, i32 0, i32 5
  %85 = load ptr, ptr %9, align 8, !tbaa !5
  %86 = getelementptr inbounds %"class.alglib::lsfitstate", ptr %85, i32 0, i32 9
  %87 = load ptr, ptr %9, align 8, !tbaa !5
  %88 = getelementptr inbounds %"class.alglib::lsfitstate", ptr %87, i32 0, i32 6
  %89 = load ptr, ptr %88, align 8, !tbaa !31
  %90 = load ptr, ptr %9, align 8, !tbaa !5
  %91 = getelementptr inbounds %"class.alglib::lsfitstate", ptr %90, i32 0, i32 7
  %92 = load ptr, ptr %14, align 8, !tbaa !5
  invoke void %82(ptr noundef nonnull align 8 dereferenceable(81) %84, ptr noundef nonnull align 8 dereferenceable(81) %86, ptr noundef nonnull align 8 dereferenceable(8) %89, ptr noundef nonnull align 8 dereferenceable(81) %91, ptr noundef %92)
          to label %93 unwind label %68

93:                                               ; preds = %81
  br label %47, !llvm.loop !32

94:                                               ; preds = %75
  %95 = load ptr, ptr %9, align 8, !tbaa !5
  %96 = getelementptr inbounds %"class.alglib::lsfitstate", ptr %95, i32 0, i32 3
  %97 = load ptr, ptr %96, align 8, !tbaa !35
  %98 = load i8, ptr %97, align 1, !tbaa !28, !range !29, !noundef !30
  %99 = trunc i8 %98 to i1
  br i1 %99, label %100, label %115

100:                                              ; preds = %94
  %101 = load ptr, ptr %12, align 8, !tbaa !5
  %102 = load ptr, ptr %9, align 8, !tbaa !5
  %103 = getelementptr inbounds %"class.alglib::lsfitstate", ptr %102, i32 0, i32 5
  %104 = load ptr, ptr %9, align 8, !tbaa !5
  %105 = getelementptr inbounds %"class.alglib::lsfitstate", ptr %104, i32 0, i32 9
  %106 = load ptr, ptr %9, align 8, !tbaa !5
  %107 = getelementptr inbounds %"class.alglib::lsfitstate", ptr %106, i32 0, i32 6
  %108 = load ptr, ptr %107, align 8, !tbaa !31
  %109 = load ptr, ptr %9, align 8, !tbaa !5
  %110 = getelementptr inbounds %"class.alglib::lsfitstate", ptr %109, i32 0, i32 7
  %111 = load ptr, ptr %9, align 8, !tbaa !5
  %112 = getelementptr inbounds %"class.alglib::lsfitstate", ptr %111, i32 0, i32 8
  %113 = load ptr, ptr %14, align 8, !tbaa !5
  invoke void %101(ptr noundef nonnull align 8 dereferenceable(81) %103, ptr noundef nonnull align 8 dereferenceable(81) %105, ptr noundef nonnull align 8 dereferenceable(8) %108, ptr noundef nonnull align 8 dereferenceable(81) %110, ptr noundef nonnull align 8 dereferenceable(97) %112, ptr noundef %113)
          to label %114 unwind label %68

114:                                              ; preds = %100
  br label %47, !llvm.loop !32

115:                                              ; preds = %94
  %116 = load ptr, ptr %9, align 8, !tbaa !5
  %117 = getelementptr inbounds %"class.alglib::lsfitstate", ptr %116, i32 0, i32 4
  %118 = load ptr, ptr %117, align 8, !tbaa !36
  %119 = load i8, ptr %118, align 1, !tbaa !28, !range !29, !noundef !30
  %120 = trunc i8 %119 to i1
  br i1 %120, label %121, label %135

121:                                              ; preds = %115
  %122 = load ptr, ptr %13, align 8, !tbaa !5
  %123 = icmp ne ptr %122, null
  br i1 %123, label %124, label %134

124:                                              ; preds = %121
  %125 = load ptr, ptr %13, align 8, !tbaa !5
  %126 = load ptr, ptr %9, align 8, !tbaa !5
  %127 = getelementptr inbounds %"class.alglib::lsfitstate", ptr %126, i32 0, i32 5
  %128 = load ptr, ptr %9, align 8, !tbaa !5
  %129 = getelementptr inbounds %"class.alglib::lsfitstate", ptr %128, i32 0, i32 6
  %130 = load ptr, ptr %129, align 8, !tbaa !31
  %131 = load double, ptr %130, align 8, !tbaa !37
  %132 = load ptr, ptr %14, align 8, !tbaa !5
  invoke void %125(ptr noundef nonnull align 8 dereferenceable(81) %127, double noundef %131, ptr noundef %132)
          to label %133 unwind label %68

133:                                              ; preds = %124
  br label %134

134:                                              ; preds = %133, %121
  br label %47, !llvm.loop !32

135:                                              ; preds = %115
  br label %137

136:                                              ; No predecessors!
  br label %137

137:                                              ; preds = %136, %135
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext false, ptr noundef @.str.75, ptr noundef %16)
  br label %138

138:                                              ; preds = %137, %72
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext false, ptr noundef @.str.76, ptr noundef %16)
  br label %47, !llvm.loop !32

139:                                              ; preds = %47
  call void @_ZN11alglib_impl14ae_state_clearEPNS_8ae_stateE(ptr noundef %16)
  call void @llvm.lifetime.end.p0(i64 128, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 200, ptr %15) #6
  ret void

140:                                              ; preds = %29
  %141 = load ptr, ptr %17, align 8
  %142 = load i32, ptr %18, align 4
  %143 = insertvalue { ptr, i32 } poison, ptr %141, 0
  %144 = insertvalue { ptr, i32 } %143, i32 %142, 1
  resume { ptr, i32 } %144
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nounwind returns_twice "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 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { 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 #6 = { nounwind }
attributes #7 = { nounwind returns_twice }
attributes #8 = { noreturn }

!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, !6, i64 88}
!10 = !{!"_ZTSN11alglib_impl8ae_stateE", !11, i64 0, !12, i64 8, !12, i64 16, !12, i64 24, !6, i64 32, !13, i64 40, !6, i64 72, !14, i64 80, !6, i64 88, !15, i64 96, !6, i64 104, !6, i64 112, !6, i64 120}
!11 = !{!"long", !7, i64 0}
!12 = !{!"double", !7, i64 0}
!13 = !{!"_ZTSN11alglib_impl12ae_dyn_blockE", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!14 = !{!"_ZTSN11alglib_impl13ae_error_typeE", !7, i64 0}
!15 = !{!"long long", !7, i64 0}
!16 = !{!17, !15, i64 0}
!17 = !{!"_ZTSN6alglib7xparamsE", !15, i64 0}
!18 = !{!19, !6, i64 16}
!19 = !{!"_ZTSN6alglib10lsfitstateE", !20, i64 0, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !21, i64 48, !6, i64 136, !21, i64 144, !25, i64 232, !21, i64 336}
!20 = !{!"_ZTSN6alglib17_lsfitstate_ownerE", !6, i64 8}
!21 = !{!"_ZTSN6alglib13real_1d_arrayE", !22, i64 0}
!22 = !{!"_ZTSN6alglib17ae_vector_wrapperE", !6, i64 8, !23, i64 16, !24, i64 80}
!23 = !{!"_ZTSN11alglib_impl9ae_vectorE", !11, i64 0, !11, i64 8, !24, i64 16, !13, i64 24, !7, i64 56}
!24 = !{!"bool", !7, i64 0}
!25 = !{!"_ZTSN6alglib13real_2d_arrayE", !26, i64 0}
!26 = !{!"_ZTSN6alglib17ae_matrix_wrapperE", !6, i64 8, !27, i64 16, !24, i64 96}
!27 = !{!"_ZTSN11alglib_impl9ae_matrixE", !11, i64 0, !11, i64 8, !11, i64 16, !11, i64 24, !24, i64 32, !13, i64 40, !7, i64 72}
!28 = !{!24, !24, i64 0}
!29 = !{i8 0, i8 2}
!30 = !{}
!31 = !{!19, !6, i64 136}
!32 = distinct !{!32, !33}
!33 = !{!"llvm.loop.mustprogress"}
!34 = !{!19, !6, i64 24}
!35 = !{!19, !6, i64 32}
!36 = !{!19, !6, i64 40}
!37 = !{!12, !12, i64 0}


; 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.__jmp_buf_tag = type { [8 x i64], i32, %struct.__sigset_t }
%struct.__sigset_t = type { [16 x i64] }
%"struct.alglib_impl::ae_state" = type { i64, double, double, double, ptr, %"struct.alglib_impl::ae_dyn_block", ptr, i32, ptr, i64, ptr, ptr, ptr }
%"struct.alglib_impl::ae_dyn_block" = type { ptr, ptr, ptr, ptr }

@_ZTIN6alglib8ap_errorE = external dso_local constant { ptr, ptr }, align 8
@.str.74 = external hidden unnamed_addr constant [45 x i8], align 1
@.str.75 = external hidden unnamed_addr constant [66 x i8], align 1
@.str.76 = external hidden unnamed_addr constant [45 x i8], align 1
@.str.77 = external hidden unnamed_addr constant [45 x i8], align 1
@.str.78 = external hidden unnamed_addr constant [45 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

declare void @_ZN11alglib_impl13ae_state_initEPNS_8ae_stateE(ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind returns_twice
declare i32 @_setjmp(ptr noundef) local_unnamed_addr #2

declare ptr @__cxa_allocate_exception(i64) local_unnamed_addr

declare void @_ZN6alglib8ap_errorC1EPKc(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef) unnamed_addr #1

declare i32 @__gxx_personality_v0(...)

declare void @__cxa_free_exception(ptr) local_unnamed_addr

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN6alglib8ap_errorD2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #3 align 2

declare void @__cxa_throw(ptr, ptr, ptr) local_unnamed_addr

declare void @_ZN11alglib_impl23ae_state_set_break_jumpEPNS_8ae_stateEPA1_13__jmp_buf_tag(ptr noundef, ptr noundef) local_unnamed_addr #1

declare void @_ZN11alglib_impl14ae_state_clearEPNS_8ae_stateE(ptr noundef) local_unnamed_addr #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 #1

declare ptr @__cxa_begin_catch(ptr) local_unnamed_addr

declare void @_ZN11alglib_impl18ae_state_set_flagsEPNS_8ae_stateEy(ptr noundef, i64 noundef) local_unnamed_addr #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZN6alglib17_lsfitstate_owner5c_ptrEv(ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #4 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN11alglib_impl14lsfititerationEPNS_10lsfitstateEPNS_8ae_stateE(ptr noundef, ptr noundef) local_unnamed_addr #5

declare void @__cxa_end_catch() local_unnamed_addr

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN6alglib8lsfitfitERNS_10lsfitstateEPFvRKNS_13real_1d_arrayES4_RdPvEPFvS4_S4_S5_RS2_S6_EPFvS4_S4_S5_S9_RNS_13real_2d_arrayES6_EPFvS4_dS6_ES6_NS_7xparamsE(ptr noundef nonnull align 8 dereferenceable(424) %0, ptr noundef readonly %1, ptr noundef readonly %2, ptr noundef readonly %3, ptr noundef readonly %4, ptr noundef %5, i64 %6) local_unnamed_addr #5 personality ptr @__gxx_personality_v0 {
  %8 = alloca [1 x %struct.__jmp_buf_tag], align 16
  %9 = alloca %"struct.alglib_impl::ae_state", align 8
  call void @llvm.lifetime.start.p0(i64 200, ptr nonnull %8) #6
  call void @llvm.lifetime.start.p0(i64 128, ptr nonnull %9) #6
  call void @_ZN11alglib_impl13ae_state_initEPNS_8ae_stateE(ptr noundef nonnull %9)
  %10 = call i32 @_setjmp(ptr noundef nonnull %8) #7
  %.not = icmp eq i32 %10, 0
  br i1 %.not, label %18, label %11

11:                                               ; preds = %7
  %12 = call ptr @__cxa_allocate_exception(i64 32) #6
  %13 = getelementptr inbounds i8, ptr %9, i64 88
  %14 = load volatile ptr, ptr %13, align 8, !tbaa !5
  invoke void @_ZN6alglib8ap_errorC1EPKc(ptr noundef nonnull align 8 dereferenceable(32) %12, ptr noundef %14)
          to label %15 unwind label %16

15:                                               ; preds = %11
  call void @__cxa_throw(ptr nonnull %12, ptr nonnull @_ZTIN6alglib8ap_errorE, ptr nonnull @_ZN6alglib8ap_errorD2Ev) #8
  unreachable

16:                                               ; preds = %11
  %17 = landingpad { ptr, i32 }
          cleanup
  call void @__cxa_free_exception(ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 128, ptr nonnull %9) #6
  call void @llvm.lifetime.end.p0(i64 200, ptr nonnull %8) #6
  resume { ptr, i32 } %17

18:                                               ; preds = %7
  call void @_ZN11alglib_impl23ae_state_set_break_jumpEPNS_8ae_stateEPA1_13__jmp_buf_tag(ptr noundef nonnull %9, ptr noundef nonnull %8)
  %.not35 = icmp eq i64 %6, 0
  br i1 %.not35, label %20, label %19

19:                                               ; preds = %18
  call void @_ZN11alglib_impl18ae_state_set_flagsEPNS_8ae_stateEy(ptr noundef nonnull %9, i64 noundef %6)
  br label %20

20:                                               ; preds = %19, %18
  %21 = icmp ne ptr %1, null
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %21, ptr noundef nonnull @.str.74, ptr noundef nonnull %9)
  %22 = icmp ne ptr %2, null
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %22, ptr noundef nonnull @.str.77, ptr noundef nonnull %9)
  %23 = icmp ne ptr %3, null
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %23, ptr noundef nonnull @.str.78, ptr noundef nonnull %9)
  %24 = call noundef ptr @_ZN6alglib17_lsfitstate_owner5c_ptrEv(ptr noundef nonnull align 8 dereferenceable(16) %0)
  %25 = call noundef zeroext i1 @_ZN11alglib_impl14lsfititerationEPNS_10lsfitstateEPNS_8ae_stateE(ptr noundef %24, ptr noundef nonnull %9)
  br i1 %25, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %20
  %26 = getelementptr inbounds i8, ptr %0, i64 16
  %27 = getelementptr inbounds i8, ptr %0, i64 24
  %28 = getelementptr inbounds i8, ptr %0, i64 32
  %29 = getelementptr inbounds i8, ptr %0, i64 40
  %.not36 = icmp eq ptr %4, null
  %30 = getelementptr inbounds i8, ptr %0, i64 48
  %31 = getelementptr inbounds i8, ptr %0, i64 136
  %32 = getelementptr inbounds i8, ptr %0, i64 336
  %33 = getelementptr inbounds i8, ptr %0, i64 144
  %34 = getelementptr inbounds i8, ptr %0, i64 232
  br label %35

35:                                               ; preds = %.lr.ph, %.backedge
  %36 = load ptr, ptr %26, align 8, !tbaa !15
  %37 = load i8, ptr %36, align 1, !tbaa !25, !range !26, !noundef !27
  %38 = trunc nuw i8 %37 to i1
  br i1 %38, label %39, label %45

39:                                               ; preds = %35
  %40 = load ptr, ptr %31, align 8, !tbaa !28
  invoke void %1(ptr noundef nonnull align 8 dereferenceable(81) %30, ptr noundef nonnull align 8 dereferenceable(81) %32, ptr noundef nonnull align 8 dereferenceable(8) %40, ptr noundef %5)
          to label %.backedge unwind label %41

41:                                               ; preds = %62, %55, %49, %39
  %42 = landingpad { ptr, i32 }
          catch ptr null
  %43 = extractvalue { ptr, i32 } %42, 0
  %44 = call ptr @__cxa_begin_catch(ptr %43) #6
  call void @__cxa_end_catch()
  br label %68

45:                                               ; preds = %35
  %46 = load ptr, ptr %27, align 8, !tbaa !29
  %47 = load i8, ptr %46, align 1, !tbaa !25, !range !26, !noundef !27
  %48 = trunc nuw i8 %47 to i1
  br i1 %48, label %49, label %51

49:                                               ; preds = %45
  %50 = load ptr, ptr %31, align 8, !tbaa !28
  invoke void %2(ptr noundef nonnull align 8 dereferenceable(81) %30, ptr noundef nonnull align 8 dereferenceable(81) %32, ptr noundef nonnull align 8 dereferenceable(8) %50, ptr noundef nonnull align 8 dereferenceable(81) %33, ptr noundef %5)
          to label %.backedge unwind label %41

51:                                               ; preds = %45
  %52 = load ptr, ptr %28, align 8, !tbaa !30
  %53 = load i8, ptr %52, align 1, !tbaa !25, !range !26, !noundef !27
  %54 = trunc nuw i8 %53 to i1
  br i1 %54, label %55, label %57

55:                                               ; preds = %51
  %56 = load ptr, ptr %31, align 8, !tbaa !28
  invoke void %3(ptr noundef nonnull align 8 dereferenceable(81) %30, ptr noundef nonnull align 8 dereferenceable(81) %32, ptr noundef nonnull align 8 dereferenceable(8) %56, ptr noundef nonnull align 8 dereferenceable(81) %33, ptr noundef nonnull align 8 dereferenceable(97) %34, ptr noundef %5)
          to label %.backedge unwind label %41

57:                                               ; preds = %51
  %58 = load ptr, ptr %29, align 8, !tbaa !31
  %59 = load i8, ptr %58, align 1, !tbaa !25, !range !26, !noundef !27
  %60 = trunc nuw i8 %59 to i1
  br i1 %60, label %61, label %67

61:                                               ; preds = %57
  br i1 %.not36, label %.backedge, label %62

62:                                               ; preds = %61
  %63 = load ptr, ptr %31, align 8, !tbaa !28
  %64 = load double, ptr %63, align 8, !tbaa !32
  invoke void %4(ptr noundef nonnull align 8 dereferenceable(81) %30, double noundef %64, ptr noundef %5)
          to label %.backedge unwind label %41

.backedge:                                        ; preds = %61, %62, %68, %39, %49, %55
  %65 = call noundef ptr @_ZN6alglib17_lsfitstate_owner5c_ptrEv(ptr noundef nonnull align 8 dereferenceable(16) %0)
  %66 = call noundef zeroext i1 @_ZN11alglib_impl14lsfititerationEPNS_10lsfitstateEPNS_8ae_stateE(ptr noundef %65, ptr noundef nonnull %9)
  br i1 %66, label %35, label %._crit_edge, !llvm.loop !33

67:                                               ; preds = %57
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext false, ptr noundef nonnull @.str.75, ptr noundef nonnull %9)
  br label %68

68:                                               ; preds = %67, %41
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext false, ptr noundef nonnull @.str.76, ptr noundef nonnull %9)
  br label %.backedge

._crit_edge:                                      ; preds = %.backedge, %20
  call void @_ZN11alglib_impl14ae_state_clearEPNS_8ae_stateE(ptr noundef nonnull %9)
  call void @llvm.lifetime.end.p0(i64 128, ptr nonnull %9) #6
  call void @llvm.lifetime.end.p0(i64 200, ptr nonnull %8) #6
  ret void
}

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nounwind returns_twice "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 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { 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 #6 = { nounwind }
attributes #7 = { nounwind returns_twice }
attributes #8 = { noreturn }

!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, !11, i64 88}
!6 = !{!"_ZTSN11alglib_impl8ae_stateE", !7, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !11, i64 32, !12, i64 40, !11, i64 72, !13, i64 80, !11, i64 88, !14, i64 96, !11, i64 104, !11, i64 112, !11, i64 120}
!7 = !{!"long", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"double", !8, i64 0}
!11 = !{!"any pointer", !8, i64 0}
!12 = !{!"_ZTSN11alglib_impl12ae_dyn_blockE", !11, i64 0, !11, i64 8, !11, i64 16, !11, i64 24}
!13 = !{!"_ZTSN11alglib_impl13ae_error_typeE", !8, i64 0}
!14 = !{!"long long", !8, i64 0}
!15 = !{!16, !11, i64 16}
!16 = !{!"_ZTSN6alglib10lsfitstateE", !17, i64 0, !11, i64 16, !11, i64 24, !11, i64 32, !11, i64 40, !18, i64 48, !11, i64 136, !18, i64 144, !22, i64 232, !18, i64 336}
!17 = !{!"_ZTSN6alglib17_lsfitstate_ownerE", !11, i64 8}
!18 = !{!"_ZTSN6alglib13real_1d_arrayE", !19, i64 0}
!19 = !{!"_ZTSN6alglib17ae_vector_wrapperE", !11, i64 8, !20, i64 16, !21, i64 80}
!20 = !{!"_ZTSN11alglib_impl9ae_vectorE", !7, i64 0, !7, i64 8, !21, i64 16, !12, i64 24, !8, i64 56}
!21 = !{!"bool", !8, i64 0}
!22 = !{!"_ZTSN6alglib13real_2d_arrayE", !23, i64 0}
!23 = !{!"_ZTSN6alglib17ae_matrix_wrapperE", !11, i64 8, !24, i64 16, !21, i64 96}
!24 = !{!"_ZTSN11alglib_impl9ae_matrixE", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !21, i64 32, !12, i64 40, !8, i64 72}
!25 = !{!21, !21, i64 0}
!26 = !{i8 0, i8 2}
!27 = !{}
!28 = !{!16, !11, i64 136}
!29 = !{!16, !11, i64 24}
!30 = !{!16, !11, i64 32}
!31 = !{!16, !11, i64 40}
!32 = !{!10, !10, i64 0}
!33 = distinct !{!33, !34}
!34 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass