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

; 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::minbcstate" = type { %"class.alglib::_minbcstate_owner.base", ptr, ptr, ptr, ptr, %"class.alglib::real_1d_array", %"class.alglib::real_1d_array" }
%"class.alglib::_minbcstate_owner.base" = type <{ ptr, ptr, i8 }>
%"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.178 = external hidden unnamed_addr constant [71 x i8], align 1
@.str.179 = external hidden unnamed_addr constant [50 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

declare void @_ZN11alglib_impl27ae_clean_up_before_breakingEPNS_8ae_stateE(ptr noundef) #1

declare void @__cxa_rethrow()

declare void @__cxa_end_catch()

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZN6alglib17_minbcstate_owner5c_ptrEv(ptr noundef nonnull align 8 dereferenceable(17)) #5 align 2

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

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

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

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

23:                                               ; preds = %19
  call void @__cxa_throw(ptr %20, ptr @_ZTIN6alglib8ap_errorE, ptr @_ZN6alglib8ap_errorD2Ev) #9
  unreachable

24:                                               ; preds = %19
  %25 = landingpad { ptr, i32 }
          cleanup
  %26 = extractvalue { ptr, i32 } %25, 0
  store ptr %26, ptr %13, align 8
  %27 = extractvalue { ptr, i32 } %25, 1
  store i32 %27, ptr %14, align 4
  call void @__cxa_free_exception(ptr %20) #7
  br label %98

28:                                               ; preds = %5
  call void @_ZN11alglib_impl23ae_state_set_break_jumpEPNS_8ae_stateEPA1_13__jmp_buf_tag(ptr noundef %12, ptr noundef %11)
  %29 = getelementptr inbounds %"struct.alglib::xparams", ptr %6, i32 0, i32 0
  %30 = load i64, ptr %29, align 8, !tbaa !16
  %31 = icmp ne i64 %30, 0
  br i1 %31, label %32, label %35

32:                                               ; preds = %28
  %33 = getelementptr inbounds %"struct.alglib::xparams", ptr %6, i32 0, i32 0
  %34 = load i64, ptr %33, align 8, !tbaa !16
  call void @_ZN11alglib_impl18ae_state_set_flagsEPNS_8ae_stateEy(ptr noundef %12, i64 noundef %34)
  br label %35

35:                                               ; preds = %32, %28
  %36 = load ptr, ptr %8, align 8, !tbaa !5
  %37 = icmp ne ptr %36, null
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %37, ptr noundef @.str.179, ptr noundef %12)
  %38 = load ptr, ptr %7, align 8, !tbaa !5
  %39 = call noundef ptr @_ZN6alglib17_minbcstate_owner5c_ptrEv(ptr noundef nonnull align 8 dereferenceable(17) %38)
  call void @_ZN11alglib_impl18minbcsetprotocolv1EPNS_10minbcstateEPNS_8ae_stateE(ptr noundef %39, ptr noundef %12)
  br label %40

40:                                               ; preds = %96, %88, %60, %35
  %41 = load ptr, ptr %7, align 8, !tbaa !5
  %42 = call noundef ptr @_ZN6alglib17_minbcstate_owner5c_ptrEv(ptr noundef nonnull align 8 dereferenceable(17) %41)
  %43 = call noundef zeroext i1 @_ZN11alglib_impl14minbciterationEPNS_10minbcstateEPNS_8ae_stateE(ptr noundef %42, ptr noundef %12)
  br i1 %43, label %44, label %97

44:                                               ; preds = %40
  %45 = load ptr, ptr %7, align 8, !tbaa !5
  %46 = getelementptr inbounds %"class.alglib::minbcstate", ptr %45, i32 0, i32 2
  %47 = load ptr, ptr %46, align 8, !tbaa !18
  %48 = load i8, ptr %47, align 1, !tbaa !25, !range !26, !noundef !27
  %49 = trunc i8 %48 to i1
  br i1 %49, label %50, label %69

50:                                               ; preds = %44
  %51 = load ptr, ptr %8, align 8, !tbaa !5
  %52 = load ptr, ptr %7, align 8, !tbaa !5
  %53 = getelementptr inbounds %"class.alglib::minbcstate", ptr %52, i32 0, i32 6
  %54 = load ptr, ptr %7, align 8, !tbaa !5
  %55 = getelementptr inbounds %"class.alglib::minbcstate", ptr %54, i32 0, i32 4
  %56 = load ptr, ptr %55, align 8, !tbaa !28
  %57 = load ptr, ptr %7, align 8, !tbaa !5
  %58 = getelementptr inbounds %"class.alglib::minbcstate", ptr %57, i32 0, i32 5
  %59 = load ptr, ptr %10, align 8, !tbaa !5
  invoke void %51(ptr noundef nonnull align 8 dereferenceable(81) %53, ptr noundef nonnull align 8 dereferenceable(8) %56, ptr noundef nonnull align 8 dereferenceable(81) %58, ptr noundef %59)
          to label %60 unwind label %61

60:                                               ; preds = %50
  br label %40, !llvm.loop !29

61:                                               ; preds = %78, %50
  %62 = landingpad { ptr, i32 }
          catch ptr null
  %63 = extractvalue { ptr, i32 } %62, 0
  store ptr %63, ptr %13, align 8
  %64 = extractvalue { ptr, i32 } %62, 1
  store i32 %64, ptr %14, align 4
  br label %65

65:                                               ; preds = %61
  %66 = load ptr, ptr %13, align 8
  %67 = call ptr @__cxa_begin_catch(ptr %66) #7
  invoke void @_ZN11alglib_impl27ae_clean_up_before_breakingEPNS_8ae_stateE(ptr noundef %12)
          to label %68 unwind label %90

68:                                               ; preds = %65
  invoke void @__cxa_rethrow() #9
          to label %107 unwind label %90

69:                                               ; preds = %44
  %70 = load ptr, ptr %7, align 8, !tbaa !5
  %71 = getelementptr inbounds %"class.alglib::minbcstate", ptr %70, i32 0, i32 3
  %72 = load ptr, ptr %71, align 8, !tbaa !31
  %73 = load i8, ptr %72, align 1, !tbaa !25, !range !26, !noundef !27
  %74 = trunc i8 %73 to i1
  br i1 %74, label %75, label %89

75:                                               ; preds = %69
  %76 = load ptr, ptr %9, align 8, !tbaa !5
  %77 = icmp ne ptr %76, null
  br i1 %77, label %78, label %88

78:                                               ; preds = %75
  %79 = load ptr, ptr %9, align 8, !tbaa !5
  %80 = load ptr, ptr %7, align 8, !tbaa !5
  %81 = getelementptr inbounds %"class.alglib::minbcstate", ptr %80, i32 0, i32 6
  %82 = load ptr, ptr %7, align 8, !tbaa !5
  %83 = getelementptr inbounds %"class.alglib::minbcstate", ptr %82, i32 0, i32 4
  %84 = load ptr, ptr %83, align 8, !tbaa !28
  %85 = load double, ptr %84, align 8, !tbaa !32
  %86 = load ptr, ptr %10, align 8, !tbaa !5
  invoke void %79(ptr noundef nonnull align 8 dereferenceable(81) %81, double noundef %85, ptr noundef %86)
          to label %87 unwind label %61

87:                                               ; preds = %78
  br label %88

88:                                               ; preds = %87, %75
  br label %40, !llvm.loop !29

89:                                               ; preds = %69
  br label %96

90:                                               ; preds = %68, %65
  %91 = landingpad { ptr, i32 }
          cleanup
  %92 = extractvalue { ptr, i32 } %91, 0
  store ptr %92, ptr %13, align 8
  %93 = extractvalue { ptr, i32 } %91, 1
  store i32 %93, ptr %14, align 4
  invoke void @__cxa_end_catch()
          to label %94 unwind label %104

94:                                               ; preds = %90
  br label %98

95:                                               ; No predecessors!
  br label %96

96:                                               ; preds = %95, %89
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext false, ptr noundef @.str.178, ptr noundef %12)
  br label %40, !llvm.loop !29

97:                                               ; preds = %40
  call void @_ZN11alglib_impl14ae_state_clearEPNS_8ae_stateE(ptr noundef %12)
  call void @llvm.lifetime.end.p0(i64 128, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 200, ptr %11) #7
  ret void

98:                                               ; preds = %94, %24
  call void @llvm.lifetime.end.p0(i64 128, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 200, ptr %11) #7
  br label %99

99:                                               ; preds = %98
  %100 = load ptr, ptr %13, align 8
  %101 = load i32, ptr %14, align 4
  %102 = insertvalue { ptr, i32 } poison, ptr %100, 0
  %103 = insertvalue { ptr, i32 } %102, i32 %101, 1
  resume { ptr, i32 } %103

104:                                              ; preds = %90
  %105 = landingpad { ptr, i32 }
          catch ptr null
  %106 = extractvalue { ptr, i32 } %105, 0
  call void @__clang_call_terminate(ptr %106) #10
  unreachable

107:                                              ; preds = %68
  unreachable
}

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 32}
!19 = !{!"_ZTSN6alglib10minbcstateE", !20, i64 0, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !22, i64 56, !22, i64 144}
!20 = !{!"_ZTSN6alglib17_minbcstate_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 = !{!21, !21, i64 0}
!26 = !{i8 0, i8 2}
!27 = !{}
!28 = !{!19, !6, i64 48}
!29 = distinct !{!29, !30}
!30 = !{!"llvm.loop.mustprogress"}
!31 = !{!19, !6, i64 40}
!32 = !{!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.178 = external hidden unnamed_addr constant [71 x i8], align 1
@.str.179 = external hidden unnamed_addr constant [50 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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZN6alglib17_minbcstate_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_impl14minbciterationEPNS_10minbcstateEPNS_8ae_stateE(ptr noundef, ptr noundef) local_unnamed_addr #6

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

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

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

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

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

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

17:                                               ; preds = %16
  call void @_ZN11alglib_impl18ae_state_set_flagsEPNS_8ae_stateEy(ptr noundef nonnull %7, i64 noundef %4)
  br label %18

18:                                               ; preds = %17, %16
  %19 = icmp ne ptr %1, null
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %19, ptr noundef nonnull @.str.179, ptr noundef nonnull %7)
  %20 = call noundef ptr @_ZN6alglib17_minbcstate_owner5c_ptrEv(ptr noundef nonnull align 8 dereferenceable(17) %0)
  call void @_ZN11alglib_impl18minbcsetprotocolv1EPNS_10minbcstateEPNS_8ae_stateE(ptr noundef %20, ptr noundef nonnull %7)
  %21 = call noundef ptr @_ZN6alglib17_minbcstate_owner5c_ptrEv(ptr noundef nonnull align 8 dereferenceable(17) %0)
  %22 = call noundef zeroext i1 @_ZN11alglib_impl14minbciterationEPNS_10minbcstateEPNS_8ae_stateE(ptr noundef %21, ptr noundef nonnull %7)
  br i1 %22, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %18
  %23 = getelementptr inbounds i8, ptr %0, i64 32
  %24 = getelementptr inbounds i8, ptr %0, i64 40
  %.not22 = icmp eq ptr %2, null
  %25 = getelementptr inbounds i8, ptr %0, i64 144
  %26 = getelementptr inbounds i8, ptr %0, i64 48
  %27 = getelementptr inbounds i8, ptr %0, i64 56
  br i1 %.not22, label %.lr.ph.split.us, label %.lr.ph.split

.lr.ph.split.us:                                  ; preds = %.lr.ph, %.backedge.us
  %28 = load ptr, ptr %23, align 8, !tbaa !15
  %29 = load i8, ptr %28, align 1, !tbaa !22, !range !23, !noundef !24
  %30 = trunc nuw i8 %29 to i1
  br i1 %30, label %36, label %31

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

35:                                               ; preds = %31
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext false, ptr noundef nonnull @.str.178, ptr noundef nonnull %7)
  br label %.backedge.us

36:                                               ; preds = %.lr.ph.split.us
  %37 = load ptr, ptr %26, align 8, !tbaa !26
  invoke void %1(ptr noundef nonnull align 8 dereferenceable(81) %25, ptr noundef nonnull align 8 dereferenceable(8) %37, ptr noundef nonnull align 8 dereferenceable(81) %27, ptr noundef %3)
          to label %.backedge.us unwind label %.split.us

.backedge.us:                                     ; preds = %31, %36, %35
  %38 = call noundef ptr @_ZN6alglib17_minbcstate_owner5c_ptrEv(ptr noundef nonnull align 8 dereferenceable(17) %0)
  %39 = call noundef zeroext i1 @_ZN11alglib_impl14minbciterationEPNS_10minbcstateEPNS_8ae_stateE(ptr noundef %38, ptr noundef nonnull %7)
  br i1 %39, label %.lr.ph.split.us, label %._crit_edge, !llvm.loop !27

.split.us:                                        ; preds = %36
  %40 = landingpad { ptr, i32 }
          catch ptr null
  br label %47

.lr.ph.split:                                     ; preds = %.lr.ph, %.backedge
  %41 = load ptr, ptr %23, align 8, !tbaa !15
  %42 = load i8, ptr %41, align 1, !tbaa !22, !range !23, !noundef !24
  %43 = trunc nuw i8 %42 to i1
  br i1 %43, label %44, label %51

44:                                               ; preds = %.lr.ph.split
  %45 = load ptr, ptr %26, align 8, !tbaa !26
  invoke void %1(ptr noundef nonnull align 8 dereferenceable(81) %25, ptr noundef nonnull align 8 dereferenceable(8) %45, ptr noundef nonnull align 8 dereferenceable(81) %27, ptr noundef %3)
          to label %.backedge unwind label %.split

.split:                                           ; preds = %55, %44
  %46 = landingpad { ptr, i32 }
          catch ptr null
  br label %47

47:                                               ; preds = %.split.us, %.split
  %.us-phi = phi { ptr, i32 } [ %46, %.split ], [ %40, %.split.us ]
  %48 = extractvalue { ptr, i32 } %.us-phi, 0
  %49 = call ptr @__cxa_begin_catch(ptr %48) #7
  invoke void @_ZN11alglib_impl27ae_clean_up_before_breakingEPNS_8ae_stateE(ptr noundef nonnull %7)
          to label %50 unwind label %60

50:                                               ; preds = %47
  invoke void @__cxa_rethrow() #9
          to label %67 unwind label %60

51:                                               ; preds = %.lr.ph.split
  %52 = load ptr, ptr %24, align 8, !tbaa !25
  %53 = load i8, ptr %52, align 1, !tbaa !22, !range !23, !noundef !24
  %54 = trunc nuw i8 %53 to i1
  br i1 %54, label %55, label %62

55:                                               ; preds = %51
  %56 = load ptr, ptr %26, align 8, !tbaa !26
  %57 = load double, ptr %56, align 8, !tbaa !29
  invoke void %2(ptr noundef nonnull align 8 dereferenceable(81) %25, double noundef %57, ptr noundef %3)
          to label %.backedge unwind label %.split

.backedge:                                        ; preds = %55, %62, %44
  %58 = call noundef ptr @_ZN6alglib17_minbcstate_owner5c_ptrEv(ptr noundef nonnull align 8 dereferenceable(17) %0)
  %59 = call noundef zeroext i1 @_ZN11alglib_impl14minbciterationEPNS_10minbcstateEPNS_8ae_stateE(ptr noundef %58, ptr noundef nonnull %7)
  br i1 %59, label %.lr.ph.split, label %._crit_edge, !llvm.loop !27

60:                                               ; preds = %50, %47
  %61 = landingpad { ptr, i32 }
          cleanup
  invoke void @__cxa_end_catch()
          to label %63 unwind label %64

62:                                               ; preds = %51
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext false, ptr noundef nonnull @.str.178, ptr noundef nonnull %7)
  br label %.backedge

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

63:                                               ; preds = %60, %14
  %.pn = phi { ptr, i32 } [ %15, %14 ], [ %61, %60 ]
  call void @llvm.lifetime.end.p0(i64 128, ptr nonnull %7) #7
  call void @llvm.lifetime.end.p0(i64 200, ptr nonnull %6) #7
  resume { ptr, i32 } %.pn

64:                                               ; preds = %60
  %65 = landingpad { ptr, i32 }
          catch ptr null
  %66 = extractvalue { ptr, i32 } %65, 0
  call void @__clang_call_terminate(ptr %66) #10
  unreachable

67:                                               ; preds = %50
  unreachable
}

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 32}
!16 = !{!"_ZTSN6alglib10minbcstateE", !17, i64 0, !11, i64 24, !11, i64 32, !11, i64 40, !11, i64 48, !19, i64 56, !19, i64 144}
!17 = !{!"_ZTSN6alglib17_minbcstate_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 = !{!18, !18, i64 0}
!23 = !{i8 0, i8 2}
!24 = !{}
!25 = !{!16, !11, i64 40}
!26 = !{!16, !11, i64 48}
!27 = distinct !{!27, !28}
!28 = !{!"llvm.loop.mustprogress"}
!29 = !{!10, !10, i64 0}


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