; LLVM IR from Dimandragon/non-parametric-dsp :: alglib-cpp/src (solvers)

; 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::nleqstate" = type { %"class.alglib::_nleqstate_owner.base", ptr, ptr, ptr, ptr, %"class.alglib::real_1d_array", %"class.alglib::real_2d_array", %"class.alglib::real_1d_array" }
%"class.alglib::_nleqstate_owner.base" = type <{ ptr, ptr, i8 }>
%"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.81 = external hidden unnamed_addr constant [46 x i8], align 1
@.str.82 = external hidden unnamed_addr constant [45 x i8], align 1
@.str.83 = 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

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

; Function Attrs: noinline noreturn nounwind uwtable
declare hidden void @__clang_call_terminate(ptr noundef) #4

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 @_ZN6alglib16_nleqstate_owner5c_ptrEv(ptr noundef nonnull align 8 dereferenceable(17)) #5 align 2

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

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

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

25:                                               ; preds = %21
  call void @__cxa_throw(ptr %22, ptr @_ZTIN6alglib8ap_errorE, ptr @_ZN6alglib8ap_errorD2Ev) #9
  unreachable

26:                                               ; preds = %21
  %27 = landingpad { ptr, i32 }
          cleanup
  %28 = extractvalue { ptr, i32 } %27, 0
  store ptr %28, ptr %15, align 8
  %29 = extractvalue { ptr, i32 } %27, 1
  store i32 %29, ptr %16, align 4
  call void @__cxa_free_exception(ptr %22) #7
  br label %116

30:                                               ; preds = %6
  call void @_ZN11alglib_impl23ae_state_set_break_jumpEPNS_8ae_stateEPA1_13__jmp_buf_tag(ptr noundef %14, ptr noundef %13)
  %31 = getelementptr inbounds %"struct.alglib::xparams", ptr %7, i32 0, i32 0
  %32 = load i64, ptr %31, align 8, !tbaa !16
  %33 = icmp ne i64 %32, 0
  br i1 %33, label %34, label %37

34:                                               ; preds = %30
  %35 = getelementptr inbounds %"struct.alglib::xparams", ptr %7, i32 0, i32 0
  %36 = load i64, ptr %35, align 8, !tbaa !16
  call void @_ZN11alglib_impl18ae_state_set_flagsEPNS_8ae_stateEy(ptr noundef %14, i64 noundef %36)
  br label %37

37:                                               ; preds = %34, %30
  %38 = load ptr, ptr %9, align 8, !tbaa !5
  %39 = icmp ne ptr %38, null
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %39, ptr noundef @.str.81, ptr noundef %14)
  %40 = load ptr, ptr %10, align 8, !tbaa !5
  %41 = icmp ne ptr %40, null
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %41, ptr noundef @.str.82, ptr noundef %14)
  %42 = load ptr, ptr %8, align 8, !tbaa !5
  %43 = call noundef ptr @_ZN6alglib16_nleqstate_owner5c_ptrEv(ptr noundef nonnull align 8 dereferenceable(17) %42)
  call void @_ZN11alglib_impl17nleqsetprotocolv1EPNS_9nleqstateEPNS_8ae_stateE(ptr noundef %43, ptr noundef %14)
  br label %44

44:                                               ; preds = %114, %106, %86, %62, %37
  %45 = load ptr, ptr %8, align 8, !tbaa !5
  %46 = call noundef ptr @_ZN6alglib16_nleqstate_owner5c_ptrEv(ptr noundef nonnull align 8 dereferenceable(17) %45)
  %47 = call noundef zeroext i1 @_ZN11alglib_impl13nleqiterationEPNS_9nleqstateEPNS_8ae_stateE(ptr noundef %46, ptr noundef %14)
  br i1 %47, label %48, label %115

48:                                               ; preds = %44
  %49 = load ptr, ptr %8, align 8, !tbaa !5
  %50 = getelementptr inbounds %"class.alglib::nleqstate", ptr %49, i32 0, i32 1
  %51 = load ptr, ptr %50, align 8, !tbaa !18
  %52 = load i8, ptr %51, align 1, !tbaa !28, !range !29, !noundef !30
  %53 = trunc i8 %52 to i1
  br i1 %53, label %54, label %71

54:                                               ; preds = %48
  %55 = load ptr, ptr %9, align 8, !tbaa !5
  %56 = load ptr, ptr %8, align 8, !tbaa !5
  %57 = getelementptr inbounds %"class.alglib::nleqstate", ptr %56, i32 0, i32 7
  %58 = load ptr, ptr %8, align 8, !tbaa !5
  %59 = getelementptr inbounds %"class.alglib::nleqstate", ptr %58, i32 0, i32 4
  %60 = load ptr, ptr %59, align 8, !tbaa !31
  %61 = load ptr, ptr %12, align 8, !tbaa !5
  invoke void %55(ptr noundef nonnull align 8 dereferenceable(81) %57, ptr noundef nonnull align 8 dereferenceable(8) %60, ptr noundef %61)
          to label %62 unwind label %63

62:                                               ; preds = %54
  br label %44, !llvm.loop !32

63:                                               ; preds = %96, %77, %54
  %64 = landingpad { ptr, i32 }
          catch ptr null
  %65 = extractvalue { ptr, i32 } %64, 0
  store ptr %65, ptr %15, align 8
  %66 = extractvalue { ptr, i32 } %64, 1
  store i32 %66, ptr %16, align 4
  br label %67

67:                                               ; preds = %63
  %68 = load ptr, ptr %15, align 8
  %69 = call ptr @__cxa_begin_catch(ptr %68) #7
  invoke void @_ZN11alglib_impl27ae_clean_up_before_breakingEPNS_8ae_stateE(ptr noundef %14)
          to label %70 unwind label %108

70:                                               ; preds = %67
  invoke void @__cxa_rethrow() #9
          to label %125 unwind label %108

71:                                               ; preds = %48
  %72 = load ptr, ptr %8, align 8, !tbaa !5
  %73 = getelementptr inbounds %"class.alglib::nleqstate", ptr %72, i32 0, i32 2
  %74 = load ptr, ptr %73, align 8, !tbaa !34
  %75 = load i8, ptr %74, align 1, !tbaa !28, !range !29, !noundef !30
  %76 = trunc i8 %75 to i1
  br i1 %76, label %77, label %87

77:                                               ; preds = %71
  %78 = load ptr, ptr %10, align 8, !tbaa !5
  %79 = load ptr, ptr %8, align 8, !tbaa !5
  %80 = getelementptr inbounds %"class.alglib::nleqstate", ptr %79, i32 0, i32 7
  %81 = load ptr, ptr %8, align 8, !tbaa !5
  %82 = getelementptr inbounds %"class.alglib::nleqstate", ptr %81, i32 0, i32 5
  %83 = load ptr, ptr %8, align 8, !tbaa !5
  %84 = getelementptr inbounds %"class.alglib::nleqstate", ptr %83, i32 0, i32 6
  %85 = load ptr, ptr %12, align 8, !tbaa !5
  invoke void %78(ptr noundef nonnull align 8 dereferenceable(81) %80, ptr noundef nonnull align 8 dereferenceable(81) %82, ptr noundef nonnull align 8 dereferenceable(97) %84, ptr noundef %85)
          to label %86 unwind label %63

86:                                               ; preds = %77
  br label %44, !llvm.loop !32

87:                                               ; preds = %71
  %88 = load ptr, ptr %8, align 8, !tbaa !5
  %89 = getelementptr inbounds %"class.alglib::nleqstate", ptr %88, i32 0, i32 3
  %90 = load ptr, ptr %89, align 8, !tbaa !35
  %91 = load i8, ptr %90, align 1, !tbaa !28, !range !29, !noundef !30
  %92 = trunc i8 %91 to i1
  br i1 %92, label %93, label %107

93:                                               ; preds = %87
  %94 = load ptr, ptr %11, align 8, !tbaa !5
  %95 = icmp ne ptr %94, null
  br i1 %95, label %96, label %106

96:                                               ; preds = %93
  %97 = load ptr, ptr %11, align 8, !tbaa !5
  %98 = load ptr, ptr %8, align 8, !tbaa !5
  %99 = getelementptr inbounds %"class.alglib::nleqstate", ptr %98, i32 0, i32 7
  %100 = load ptr, ptr %8, align 8, !tbaa !5
  %101 = getelementptr inbounds %"class.alglib::nleqstate", ptr %100, i32 0, i32 4
  %102 = load ptr, ptr %101, align 8, !tbaa !31
  %103 = load double, ptr %102, align 8, !tbaa !36
  %104 = load ptr, ptr %12, align 8, !tbaa !5
  invoke void %97(ptr noundef nonnull align 8 dereferenceable(81) %99, double noundef %103, ptr noundef %104)
          to label %105 unwind label %63

105:                                              ; preds = %96
  br label %106

106:                                              ; preds = %105, %93
  br label %44, !llvm.loop !32

107:                                              ; preds = %87
  br label %114

108:                                              ; preds = %70, %67
  %109 = landingpad { ptr, i32 }
          cleanup
  %110 = extractvalue { ptr, i32 } %109, 0
  store ptr %110, ptr %15, align 8
  %111 = extractvalue { ptr, i32 } %109, 1
  store i32 %111, ptr %16, align 4
  invoke void @__cxa_end_catch()
          to label %112 unwind label %122

112:                                              ; preds = %108
  br label %116

113:                                              ; No predecessors!
  br label %114

114:                                              ; preds = %113, %107
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext false, ptr noundef @.str.83, ptr noundef %14)
  br label %44, !llvm.loop !32

115:                                              ; preds = %44
  call void @_ZN11alglib_impl14ae_state_clearEPNS_8ae_stateE(ptr noundef %14)
  call void @llvm.lifetime.end.p0(i64 128, ptr %14) #7
  call void @llvm.lifetime.end.p0(i64 200, ptr %13) #7
  ret void

116:                                              ; preds = %112, %26
  call void @llvm.lifetime.end.p0(i64 128, ptr %14) #7
  call void @llvm.lifetime.end.p0(i64 200, ptr %13) #7
  br label %117

117:                                              ; preds = %116
  %118 = load ptr, ptr %15, align 8
  %119 = load i32, ptr %16, align 4
  %120 = insertvalue { ptr, i32 } poison, ptr %118, 0
  %121 = insertvalue { ptr, i32 } %120, i32 %119, 1
  resume { ptr, i32 } %121

122:                                              ; preds = %108
  %123 = landingpad { ptr, i32 }
          catch ptr null
  %124 = extractvalue { ptr, i32 } %123, 0
  call void @__clang_call_terminate(ptr %124) #10
  unreachable

125:                                              ; preds = %70
  unreachable
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN11alglib_impl17nleqsetprotocolv1EPNS_9nleqstateEPNS_8ae_stateE(ptr noundef, ptr noundef) #5

declare void @_ZN11alglib_impl27ae_clean_up_before_breakingEPNS_8ae_stateE(ptr noundef) #1

declare void @__cxa_rethrow()

declare void @__cxa_end_catch()

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 = { noinline noreturn nounwind uwtable "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 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 #6 = { 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 #7 = { nounwind }
attributes #8 = { nounwind returns_twice }
attributes #9 = { noreturn }
attributes #10 = { noreturn 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, !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 24}
!19 = !{!"_ZTSN6alglib9nleqstateE", !20, i64 0, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !22, i64 56, !25, i64 144, !22, i64 248}
!20 = !{!"_ZTSN6alglib16_nleqstate_ownerE", !6, i64 8, !21, i64 16}
!21 = !{!"bool", !7, i64 0}
!22 = !{!"_ZTSN6alglib13real_1d_arrayE", !23, i64 0}
!23 = !{!"_ZTSN6alglib17ae_vector_wrapperE", !6, i64 8, !24, i64 16, !21, i64 80}
!24 = !{!"_ZTSN11alglib_impl9ae_vectorE", !11, i64 0, !11, i64 8, !21, i64 16, !13, i64 24, !7, i64 56}
!25 = !{!"_ZTSN6alglib13real_2d_arrayE", !26, i64 0}
!26 = !{!"_ZTSN6alglib17ae_matrix_wrapperE", !6, i64 8, !27, i64 16, !21, i64 96}
!27 = !{!"_ZTSN11alglib_impl9ae_matrixE", !11, i64 0, !11, i64 8, !11, i64 16, !11, i64 24, !21, i64 32, !13, i64 40, !7, i64 72}
!28 = !{!21, !21, i64 0}
!29 = !{i8 0, i8 2}
!30 = !{}
!31 = !{!19, !6, i64 48}
!32 = distinct !{!32, !33}
!33 = !{!"llvm.loop.mustprogress"}
!34 = !{!19, !6, i64 32}
!35 = !{!19, !6, i64 40}
!36 = !{!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.81 = external hidden unnamed_addr constant [46 x i8], align 1
@.str.82 = external hidden unnamed_addr constant [45 x i8], align 1
@.str.83 = 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

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

; Function Attrs: noinline noreturn nounwind uwtable
declare hidden void @__clang_call_terminate(ptr noundef) local_unnamed_addr #4

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 @_ZN6alglib16_nleqstate_owner5c_ptrEv(ptr noundef nonnull align 8 dereferenceable(17)) local_unnamed_addr #5 align 2

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

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

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

14:                                               ; preds = %10
  call void @__cxa_throw(ptr nonnull %11, ptr nonnull @_ZTIN6alglib8ap_errorE, ptr nonnull @_ZN6alglib8ap_errorD2Ev) #9
  unreachable

15:                                               ; preds = %10
  %16 = landingpad { ptr, i32 }
          cleanup
  call void @__cxa_free_exception(ptr %11) #7
  br label %77

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

18:                                               ; preds = %17
  call void @_ZN11alglib_impl18ae_state_set_flagsEPNS_8ae_stateEy(ptr noundef nonnull %8, i64 noundef %5)
  br label %19

19:                                               ; preds = %18, %17
  %20 = icmp ne ptr %1, null
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %20, ptr noundef nonnull @.str.81, ptr noundef nonnull %8)
  %21 = icmp ne ptr %2, null
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %21, ptr noundef nonnull @.str.82, ptr noundef nonnull %8)
  %22 = call noundef ptr @_ZN6alglib16_nleqstate_owner5c_ptrEv(ptr noundef nonnull align 8 dereferenceable(17) %0)
  call void @_ZN11alglib_impl17nleqsetprotocolv1EPNS_9nleqstateEPNS_8ae_stateE(ptr noundef %22, ptr noundef nonnull %8)
  %23 = call noundef ptr @_ZN6alglib16_nleqstate_owner5c_ptrEv(ptr noundef nonnull align 8 dereferenceable(17) %0)
  %24 = call noundef zeroext i1 @_ZN11alglib_impl13nleqiterationEPNS_9nleqstateEPNS_8ae_stateE(ptr noundef %23, ptr noundef nonnull %8)
  br i1 %24, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %19
  %25 = getelementptr inbounds i8, ptr %0, i64 24
  %26 = getelementptr inbounds i8, ptr %0, i64 32
  %27 = getelementptr inbounds i8, ptr %0, i64 40
  %.not28 = icmp eq ptr %3, null
  %28 = getelementptr inbounds i8, ptr %0, i64 248
  %29 = getelementptr inbounds i8, ptr %0, i64 48
  %30 = getelementptr inbounds i8, ptr %0, i64 56
  %31 = getelementptr inbounds i8, ptr %0, i64 144
  br i1 %.not28, label %.lr.ph.split.us, label %.lr.ph.split

.lr.ph.split.us:                                  ; preds = %.lr.ph, %.backedge.us
  %32 = load ptr, ptr %25, align 8, !tbaa !15
  %33 = load i8, ptr %32, align 1, !tbaa !25, !range !26, !noundef !27
  %34 = trunc nuw i8 %33 to i1
  br i1 %34, label %45, label %35

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

39:                                               ; preds = %35
  %40 = load ptr, ptr %27, align 8, !tbaa !29
  %41 = load i8, ptr %40, align 1, !tbaa !25, !range !26, !noundef !27
  %42 = trunc nuw i8 %41 to i1
  br i1 %42, label %.backedge.us, label %43

43:                                               ; preds = %39
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext false, ptr noundef nonnull @.str.83, ptr noundef nonnull %8)
  br label %.backedge.us

44:                                               ; preds = %35
  invoke void %2(ptr noundef nonnull align 8 dereferenceable(81) %28, ptr noundef nonnull align 8 dereferenceable(81) %30, ptr noundef nonnull align 8 dereferenceable(97) %31, ptr noundef %4)
          to label %.backedge.us unwind label %.split.us

45:                                               ; preds = %.lr.ph.split.us
  %46 = load ptr, ptr %29, align 8, !tbaa !30
  invoke void %1(ptr noundef nonnull align 8 dereferenceable(81) %28, ptr noundef nonnull align 8 dereferenceable(8) %46, ptr noundef %4)
          to label %.backedge.us unwind label %.split.us

.backedge.us:                                     ; preds = %39, %45, %44, %43
  %47 = call noundef ptr @_ZN6alglib16_nleqstate_owner5c_ptrEv(ptr noundef nonnull align 8 dereferenceable(17) %0)
  %48 = call noundef zeroext i1 @_ZN11alglib_impl13nleqiterationEPNS_9nleqstateEPNS_8ae_stateE(ptr noundef %47, ptr noundef nonnull %8)
  br i1 %48, label %.lr.ph.split.us, label %._crit_edge, !llvm.loop !31

.split.us:                                        ; preds = %45, %44
  %49 = landingpad { ptr, i32 }
          catch ptr null
  br label %56

.lr.ph.split:                                     ; preds = %.lr.ph, %.backedge
  %50 = load ptr, ptr %25, align 8, !tbaa !15
  %51 = load i8, ptr %50, align 1, !tbaa !25, !range !26, !noundef !27
  %52 = trunc nuw i8 %51 to i1
  br i1 %52, label %53, label %60

53:                                               ; preds = %.lr.ph.split
  %54 = load ptr, ptr %29, align 8, !tbaa !30
  invoke void %1(ptr noundef nonnull align 8 dereferenceable(81) %28, ptr noundef nonnull align 8 dereferenceable(8) %54, ptr noundef %4)
          to label %.backedge unwind label %.split

.split:                                           ; preds = %69, %64, %53
  %55 = landingpad { ptr, i32 }
          catch ptr null
  br label %56

56:                                               ; preds = %.split.us, %.split
  %.us-phi = phi { ptr, i32 } [ %55, %.split ], [ %49, %.split.us ]
  %57 = extractvalue { ptr, i32 } %.us-phi, 0
  %58 = call ptr @__cxa_begin_catch(ptr %57) #7
  invoke void @_ZN11alglib_impl27ae_clean_up_before_breakingEPNS_8ae_stateE(ptr noundef nonnull %8)
          to label %59 unwind label %74

59:                                               ; preds = %56
  invoke void @__cxa_rethrow() #9
          to label %81 unwind label %74

60:                                               ; preds = %.lr.ph.split
  %61 = load ptr, ptr %26, align 8, !tbaa !28
  %62 = load i8, ptr %61, align 1, !tbaa !25, !range !26, !noundef !27
  %63 = trunc nuw i8 %62 to i1
  br i1 %63, label %64, label %65

64:                                               ; preds = %60
  invoke void %2(ptr noundef nonnull align 8 dereferenceable(81) %28, ptr noundef nonnull align 8 dereferenceable(81) %30, ptr noundef nonnull align 8 dereferenceable(97) %31, ptr noundef %4)
          to label %.backedge unwind label %.split

65:                                               ; preds = %60
  %66 = load ptr, ptr %27, align 8, !tbaa !29
  %67 = load i8, ptr %66, align 1, !tbaa !25, !range !26, !noundef !27
  %68 = trunc nuw i8 %67 to i1
  br i1 %68, label %69, label %76

69:                                               ; preds = %65
  %70 = load ptr, ptr %29, align 8, !tbaa !30
  %71 = load double, ptr %70, align 8, !tbaa !33
  invoke void %3(ptr noundef nonnull align 8 dereferenceable(81) %28, double noundef %71, ptr noundef %4)
          to label %.backedge unwind label %.split

.backedge:                                        ; preds = %69, %76, %53, %64
  %72 = call noundef ptr @_ZN6alglib16_nleqstate_owner5c_ptrEv(ptr noundef nonnull align 8 dereferenceable(17) %0)
  %73 = call noundef zeroext i1 @_ZN11alglib_impl13nleqiterationEPNS_9nleqstateEPNS_8ae_stateE(ptr noundef %72, ptr noundef nonnull %8)
  br i1 %73, label %.lr.ph.split, label %._crit_edge, !llvm.loop !31

74:                                               ; preds = %59, %56
  %75 = landingpad { ptr, i32 }
          cleanup
  invoke void @__cxa_end_catch()
          to label %77 unwind label %78

76:                                               ; preds = %65
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext false, ptr noundef nonnull @.str.83, ptr noundef nonnull %8)
  br label %.backedge

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

77:                                               ; preds = %74, %15
  %.pn = phi { ptr, i32 } [ %16, %15 ], [ %75, %74 ]
  call void @llvm.lifetime.end.p0(i64 128, ptr nonnull %8) #7
  call void @llvm.lifetime.end.p0(i64 200, ptr nonnull %7) #7
  resume { ptr, i32 } %.pn

78:                                               ; preds = %74
  %79 = landingpad { ptr, i32 }
          catch ptr null
  %80 = extractvalue { ptr, i32 } %79, 0
  call void @__clang_call_terminate(ptr %80) #10
  unreachable

81:                                               ; preds = %59
  unreachable
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN11alglib_impl17nleqsetprotocolv1EPNS_9nleqstateEPNS_8ae_stateE(ptr noundef, ptr noundef) local_unnamed_addr #5

declare void @_ZN11alglib_impl27ae_clean_up_before_breakingEPNS_8ae_stateE(ptr noundef) local_unnamed_addr #1

declare void @__cxa_rethrow() local_unnamed_addr

declare void @__cxa_end_catch() local_unnamed_addr

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 = { noinline noreturn nounwind uwtable "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 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 #6 = { 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 #7 = { nounwind }
attributes #8 = { nounwind returns_twice }
attributes #9 = { noreturn }
attributes #10 = { noreturn 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, !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 24}
!16 = !{!"_ZTSN6alglib9nleqstateE", !17, i64 0, !11, i64 24, !11, i64 32, !11, i64 40, !11, i64 48, !19, i64 56, !22, i64 144, !19, i64 248}
!17 = !{!"_ZTSN6alglib16_nleqstate_ownerE", !11, i64 8, !18, i64 16}
!18 = !{!"bool", !8, i64 0}
!19 = !{!"_ZTSN6alglib13real_1d_arrayE", !20, i64 0}
!20 = !{!"_ZTSN6alglib17ae_vector_wrapperE", !11, i64 8, !21, i64 16, !18, i64 80}
!21 = !{!"_ZTSN11alglib_impl9ae_vectorE", !7, i64 0, !7, i64 8, !18, i64 16, !12, i64 24, !8, i64 56}
!22 = !{!"_ZTSN6alglib13real_2d_arrayE", !23, i64 0}
!23 = !{!"_ZTSN6alglib17ae_matrix_wrapperE", !11, i64 8, !24, i64 16, !18, i64 96}
!24 = !{!"_ZTSN11alglib_impl9ae_matrixE", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !18, i64 32, !12, i64 40, !8, i64 72}
!25 = !{!18, !18, i64 0}
!26 = !{i8 0, i8 2}
!27 = !{}
!28 = !{!16, !11, i64 32}
!29 = !{!16, !11, i64 40}
!30 = !{!16, !11, i64 48}
!31 = distinct !{!31, !32}
!32 = !{!"llvm.loop.mustprogress"}
!33 = !{!10, !10, i64 0}


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