; LLVM IR from venumb/ZSPACE :: cpp/depends/alglib/cpp/src/ap.ll (ZN6alglib17ae_matrix_wrapper6assignERKS0_)

; 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.__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::ae_matrix_wrapper" = type <{ ptr, ptr, %"struct.alglib_impl::ae_matrix", i8, [7 x i8] }>
%"struct.alglib_impl::ae_matrix" = type { i64, i64, i64, i64, i8, %"struct.alglib_impl::ae_dyn_block", %union.anon }
%union.anon = type { ptr }

@_ZTIN6alglib8ap_errorE = external dso_local constant { ptr, ptr }, align 8
@.str.68 = external hidden unnamed_addr constant [67 x i8], align 1
@.str.69 = external hidden unnamed_addr constant [61 x i8], align 1
@.str.70 = external hidden unnamed_addr constant [57 x i8], align 1
@.str.71 = external hidden unnamed_addr constant [63 x i8], align 1

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN11alglib_impl14ae_state_clearEPNS_8ae_stateE(ptr noundef) #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZN11alglib_impl9ae_sizeofEl(i64 noundef) #2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN11alglib_impl13ae_state_initEPNS_8ae_stateE(ptr noundef) #1

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext, ptr noundef, ptr noundef) #1

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #3

declare i32 @__gxx_personality_v0(...)

declare ptr @__cxa_allocate_exception(i64)

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 #4 align 2

declare void @__cxa_throw(ptr, ptr, ptr)

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

; Function Attrs: mustprogress uwtable
define dso_local noundef nonnull align 8 dereferenceable(97) ptr @_ZN6alglib17ae_matrix_wrapper6assignERKS0_(ptr noundef nonnull align 8 dereferenceable(97) %0, ptr noundef nonnull align 8 dereferenceable(97) %1) #1 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i64, align 8
  %7 = alloca [1 x %struct.__jmp_buf_tag], align 16
  %8 = alloca %"struct.alglib_impl::ae_state", align 8
  %9 = alloca i32, align 4
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  %12 = load ptr, ptr %4, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #6
  call void @llvm.lifetime.start.p0(i64 200, ptr %7) #6
  call void @llvm.lifetime.start.p0(i64 128, ptr %8) #6
  %13 = load ptr, ptr %5, align 8, !tbaa !5
  %14 = icmp eq ptr %12, %13
  br i1 %14, label %15, label %16

15:                                               ; preds = %2
  store ptr %12, ptr %3, align 8
  store i32 1, ptr %9, align 4
  br label %144

16:                                               ; preds = %2
  call void @_ZN11alglib_impl13ae_state_initEPNS_8ae_stateE(ptr noundef %8)
  %17 = getelementptr inbounds [1 x %struct.__jmp_buf_tag], ptr %7, i64 0, i64 0
  %18 = call i32 @_setjmp(ptr noundef %17) #7
  %19 = icmp ne i32 %18, 0
  br i1 %19, label %20, label %29

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

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

25:                                               ; preds = %20
  %26 = landingpad { ptr, i32 }
          cleanup
  %27 = extractvalue { ptr, i32 } %26, 0
  store ptr %27, ptr %10, align 8
  %28 = extractvalue { ptr, i32 } %26, 1
  store i32 %28, ptr %11, align 4
  call void @__cxa_free_exception(ptr %21) #6
  call void @llvm.lifetime.end.p0(i64 128, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 200, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #6
  br label %146

29:                                               ; preds = %16
  call void @_ZN11alglib_impl23ae_state_set_break_jumpEPNS_8ae_stateEPA1_13__jmp_buf_tag(ptr noundef %8, ptr noundef %7)
  %30 = getelementptr inbounds %"class.alglib::ae_matrix_wrapper", ptr %12, i32 0, i32 1
  %31 = load ptr, ptr %30, align 8, !tbaa !16
  %32 = icmp ne ptr %31, null
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %32, ptr noundef @.str.68, ptr noundef %8)
  %33 = load ptr, ptr %5, align 8, !tbaa !5
  %34 = getelementptr inbounds %"class.alglib::ae_matrix_wrapper", ptr %33, i32 0, i32 1
  %35 = load ptr, ptr %34, align 8, !tbaa !16
  %36 = icmp ne ptr %35, null
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %36, ptr noundef @.str.69, ptr noundef %8)
  %37 = load ptr, ptr %5, align 8, !tbaa !5
  %38 = getelementptr inbounds %"class.alglib::ae_matrix_wrapper", ptr %37, i32 0, i32 1
  %39 = load ptr, ptr %38, align 8, !tbaa !16
  %40 = getelementptr inbounds %"struct.alglib_impl::ae_matrix", ptr %39, i32 0, i32 3
  %41 = load i64, ptr %40, align 8, !tbaa !20
  %42 = getelementptr inbounds %"class.alglib::ae_matrix_wrapper", ptr %12, i32 0, i32 1
  %43 = load ptr, ptr %42, align 8, !tbaa !16
  %44 = getelementptr inbounds %"struct.alglib_impl::ae_matrix", ptr %43, i32 0, i32 3
  %45 = load i64, ptr %44, align 8, !tbaa !20
  %46 = icmp eq i64 %41, %45
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %46, ptr noundef @.str.70, ptr noundef %8)
  %47 = getelementptr inbounds %"class.alglib::ae_matrix_wrapper", ptr %12, i32 0, i32 3
  %48 = load i8, ptr %47, align 8, !tbaa !21, !range !22, !noundef !23
  %49 = trunc i8 %48 to i1
  br i1 %49, label %50, label %71

50:                                               ; preds = %29
  %51 = load ptr, ptr %5, align 8, !tbaa !5
  %52 = getelementptr inbounds %"class.alglib::ae_matrix_wrapper", ptr %51, i32 0, i32 1
  %53 = load ptr, ptr %52, align 8, !tbaa !16
  %54 = getelementptr inbounds %"struct.alglib_impl::ae_matrix", ptr %53, i32 0, i32 0
  %55 = load i64, ptr %54, align 8, !tbaa !24
  %56 = getelementptr inbounds %"class.alglib::ae_matrix_wrapper", ptr %12, i32 0, i32 1
  %57 = load ptr, ptr %56, align 8, !tbaa !16
  %58 = getelementptr inbounds %"struct.alglib_impl::ae_matrix", ptr %57, i32 0, i32 0
  %59 = load i64, ptr %58, align 8, !tbaa !24
  %60 = icmp eq i64 %55, %59
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %60, ptr noundef @.str.71, ptr noundef %8)
  %61 = load ptr, ptr %5, align 8, !tbaa !5
  %62 = getelementptr inbounds %"class.alglib::ae_matrix_wrapper", ptr %61, i32 0, i32 1
  %63 = load ptr, ptr %62, align 8, !tbaa !16
  %64 = getelementptr inbounds %"struct.alglib_impl::ae_matrix", ptr %63, i32 0, i32 1
  %65 = load i64, ptr %64, align 8, !tbaa !25
  %66 = getelementptr inbounds %"class.alglib::ae_matrix_wrapper", ptr %12, i32 0, i32 1
  %67 = load ptr, ptr %66, align 8, !tbaa !16
  %68 = getelementptr inbounds %"struct.alglib_impl::ae_matrix", ptr %67, i32 0, i32 1
  %69 = load i64, ptr %68, align 8, !tbaa !25
  %70 = icmp eq i64 %65, %69
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %70, ptr noundef @.str.71, ptr noundef %8)
  br label %71

71:                                               ; preds = %50, %29
  %72 = load ptr, ptr %5, align 8, !tbaa !5
  %73 = getelementptr inbounds %"class.alglib::ae_matrix_wrapper", ptr %72, i32 0, i32 1
  %74 = load ptr, ptr %73, align 8, !tbaa !16
  %75 = getelementptr inbounds %"struct.alglib_impl::ae_matrix", ptr %74, i32 0, i32 0
  %76 = load i64, ptr %75, align 8, !tbaa !24
  %77 = getelementptr inbounds %"class.alglib::ae_matrix_wrapper", ptr %12, i32 0, i32 1
  %78 = load ptr, ptr %77, align 8, !tbaa !16
  %79 = getelementptr inbounds %"struct.alglib_impl::ae_matrix", ptr %78, i32 0, i32 0
  %80 = load i64, ptr %79, align 8, !tbaa !24
  %81 = icmp ne i64 %76, %80
  br i1 %81, label %93, label %82

82:                                               ; preds = %71
  %83 = load ptr, ptr %5, align 8, !tbaa !5
  %84 = getelementptr inbounds %"class.alglib::ae_matrix_wrapper", ptr %83, i32 0, i32 1
  %85 = load ptr, ptr %84, align 8, !tbaa !16
  %86 = getelementptr inbounds %"struct.alglib_impl::ae_matrix", ptr %85, i32 0, i32 1
  %87 = load i64, ptr %86, align 8, !tbaa !25
  %88 = getelementptr inbounds %"class.alglib::ae_matrix_wrapper", ptr %12, i32 0, i32 1
  %89 = load ptr, ptr %88, align 8, !tbaa !16
  %90 = getelementptr inbounds %"struct.alglib_impl::ae_matrix", ptr %89, i32 0, i32 1
  %91 = load i64, ptr %90, align 8, !tbaa !25
  %92 = icmp ne i64 %87, %91
  br i1 %92, label %93, label %106

93:                                               ; preds = %82, %71
  %94 = getelementptr inbounds %"class.alglib::ae_matrix_wrapper", ptr %12, i32 0, i32 1
  %95 = load ptr, ptr %94, align 8, !tbaa !16
  %96 = load ptr, ptr %5, align 8, !tbaa !5
  %97 = getelementptr inbounds %"class.alglib::ae_matrix_wrapper", ptr %96, i32 0, i32 1
  %98 = load ptr, ptr %97, align 8, !tbaa !16
  %99 = getelementptr inbounds %"struct.alglib_impl::ae_matrix", ptr %98, i32 0, i32 0
  %100 = load i64, ptr %99, align 8, !tbaa !24
  %101 = load ptr, ptr %5, align 8, !tbaa !5
  %102 = getelementptr inbounds %"class.alglib::ae_matrix_wrapper", ptr %101, i32 0, i32 1
  %103 = load ptr, ptr %102, align 8, !tbaa !16
  %104 = getelementptr inbounds %"struct.alglib_impl::ae_matrix", ptr %103, i32 0, i32 1
  %105 = load i64, ptr %104, align 8, !tbaa !25
  call void @_ZN11alglib_impl20ae_matrix_set_lengthEPNS_9ae_matrixEllPNS_8ae_stateE(ptr noundef %95, i64 noundef %100, i64 noundef %105, ptr noundef %8)
  br label %106

106:                                              ; preds = %93, %82
  store i64 0, ptr %6, align 8, !tbaa !26
  br label %107

107:                                              ; preds = %140, %106
  %108 = load i64, ptr %6, align 8, !tbaa !26
  %109 = getelementptr inbounds %"class.alglib::ae_matrix_wrapper", ptr %12, i32 0, i32 1
  %110 = load ptr, ptr %109, align 8, !tbaa !16
  %111 = getelementptr inbounds %"struct.alglib_impl::ae_matrix", ptr %110, i32 0, i32 0
  %112 = load i64, ptr %111, align 8, !tbaa !24
  %113 = icmp slt i64 %108, %112
  br i1 %113, label %114, label %143

114:                                              ; preds = %107
  %115 = getelementptr inbounds %"class.alglib::ae_matrix_wrapper", ptr %12, i32 0, i32 1
  %116 = load ptr, ptr %115, align 8, !tbaa !16
  %117 = getelementptr inbounds %"struct.alglib_impl::ae_matrix", ptr %116, i32 0, i32 6
  %118 = load ptr, ptr %117, align 8, !tbaa !27
  %119 = load i64, ptr %6, align 8, !tbaa !26
  %120 = getelementptr inbounds ptr, ptr %118, i64 %119
  %121 = load ptr, ptr %120, align 8, !tbaa !5
  %122 = load ptr, ptr %5, align 8, !tbaa !5
  %123 = getelementptr inbounds %"class.alglib::ae_matrix_wrapper", ptr %122, i32 0, i32 1
  %124 = load ptr, ptr %123, align 8, !tbaa !16
  %125 = getelementptr inbounds %"struct.alglib_impl::ae_matrix", ptr %124, i32 0, i32 6
  %126 = load ptr, ptr %125, align 8, !tbaa !27
  %127 = load i64, ptr %6, align 8, !tbaa !26
  %128 = getelementptr inbounds ptr, ptr %126, i64 %127
  %129 = load ptr, ptr %128, align 8, !tbaa !5
  %130 = getelementptr inbounds %"class.alglib::ae_matrix_wrapper", ptr %12, i32 0, i32 1
  %131 = load ptr, ptr %130, align 8, !tbaa !16
  %132 = getelementptr inbounds %"struct.alglib_impl::ae_matrix", ptr %131, i32 0, i32 1
  %133 = load i64, ptr %132, align 8, !tbaa !25
  %134 = getelementptr inbounds %"class.alglib::ae_matrix_wrapper", ptr %12, i32 0, i32 1
  %135 = load ptr, ptr %134, align 8, !tbaa !16
  %136 = getelementptr inbounds %"struct.alglib_impl::ae_matrix", ptr %135, i32 0, i32 3
  %137 = load i64, ptr %136, align 8, !tbaa !20
  %138 = call noundef i64 @_ZN11alglib_impl9ae_sizeofEl(i64 noundef %137)
  %139 = mul nsw i64 %133, %138
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %121, ptr align 1 %129, i64 %139, i1 false)
  br label %140

140:                                              ; preds = %114
  %141 = load i64, ptr %6, align 8, !tbaa !26
  %142 = add nsw i64 %141, 1
  store i64 %142, ptr %6, align 8, !tbaa !26
  br label %107, !llvm.loop !28

143:                                              ; preds = %107
  call void @_ZN11alglib_impl14ae_state_clearEPNS_8ae_stateE(ptr noundef %8)
  store ptr %12, ptr %3, align 8
  store i32 1, ptr %9, align 4
  br label %144

144:                                              ; preds = %143, %15
  call void @llvm.lifetime.end.p0(i64 128, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 200, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #6
  %145 = load ptr, ptr %3, align 8
  ret ptr %145

146:                                              ; preds = %25
  %147 = load ptr, ptr %10, align 8
  %148 = load i32, ptr %11, align 4
  %149 = insertvalue { ptr, i32 } poison, ptr %147, 0
  %150 = insertvalue { ptr, i32 } %149, i32 %148, 1
  resume { ptr, i32 } %150
}

declare void @_ZN6alglib8ap_errorC1EPKc(ptr, ptr)

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { 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 #3 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { 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 #5 = { 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 #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, !6, i64 8}
!17 = !{!"_ZTSN6alglib17ae_matrix_wrapperE", !6, i64 8, !18, i64 16, !19, i64 96}
!18 = !{!"_ZTSN11alglib_impl9ae_matrixE", !11, i64 0, !11, i64 8, !11, i64 16, !11, i64 24, !19, i64 32, !13, i64 40, !7, i64 72}
!19 = !{!"bool", !7, i64 0}
!20 = !{!18, !11, i64 24}
!21 = !{!17, !19, i64 96}
!22 = !{i8 0, i8 2}
!23 = !{}
!24 = !{!18, !11, i64 0}
!25 = !{!18, !11, i64 8}
!26 = !{!11, !11, i64 0}
!27 = !{!7, !7, i64 0}
!28 = distinct !{!28, !29}
!29 = !{!"llvm.loop.mustprogress"}


; 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.68 = external hidden unnamed_addr constant [67 x i8], align 1
@.str.69 = external hidden unnamed_addr constant [61 x i8], align 1
@.str.70 = external hidden unnamed_addr constant [57 x i8], align 1
@.str.71 = external hidden unnamed_addr constant [63 x i8], align 1

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZN11alglib_impl9ae_sizeofEl(i64 noundef) local_unnamed_addr #2

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext, ptr noundef, ptr noundef) local_unnamed_addr #1

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

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #3

declare i32 @__gxx_personality_v0(...)

declare ptr @__cxa_allocate_exception(i64) local_unnamed_addr

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 #4 align 2

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

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

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

6:                                                ; preds = %2
  call void @_ZN11alglib_impl13ae_state_initEPNS_8ae_stateE(ptr noundef nonnull %4)
  %7 = call i32 @_setjmp(ptr noundef nonnull %3) #7
  %.not = icmp eq i32 %7, 0
  br i1 %.not, label %15, label %8

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

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

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

15:                                               ; preds = %6
  call void @_ZN11alglib_impl23ae_state_set_break_jumpEPNS_8ae_stateEPA1_13__jmp_buf_tag(ptr noundef nonnull %4, ptr noundef nonnull %3)
  %16 = getelementptr inbounds i8, ptr %0, i64 8
  %17 = load ptr, ptr %16, align 8, !tbaa !15
  %18 = icmp ne ptr %17, null
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %18, ptr noundef nonnull @.str.68, ptr noundef nonnull %4)
  %19 = getelementptr inbounds i8, ptr %1, i64 8
  %20 = load ptr, ptr %19, align 8, !tbaa !15
  %21 = icmp ne ptr %20, null
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %21, ptr noundef nonnull @.str.69, ptr noundef nonnull %4)
  %22 = load ptr, ptr %19, align 8, !tbaa !15
  %23 = getelementptr inbounds i8, ptr %22, i64 24
  %24 = load i64, ptr %23, align 8, !tbaa !19
  %25 = load ptr, ptr %16, align 8, !tbaa !15
  %26 = getelementptr inbounds i8, ptr %25, i64 24
  %27 = load i64, ptr %26, align 8, !tbaa !19
  %28 = icmp eq i64 %24, %27
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %28, ptr noundef nonnull @.str.70, ptr noundef nonnull %4)
  %29 = getelementptr inbounds i8, ptr %0, i64 96
  %30 = load i8, ptr %29, align 8, !tbaa !20, !range !21, !noundef !22
  %31 = trunc nuw i8 %30 to i1
  br i1 %31, label %32, label %45

32:                                               ; preds = %15
  %33 = load ptr, ptr %19, align 8, !tbaa !15
  %34 = load i64, ptr %33, align 8, !tbaa !23
  %35 = load ptr, ptr %16, align 8, !tbaa !15
  %36 = load i64, ptr %35, align 8, !tbaa !23
  %37 = icmp eq i64 %34, %36
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %37, ptr noundef nonnull @.str.71, ptr noundef nonnull %4)
  %38 = load ptr, ptr %19, align 8, !tbaa !15
  %39 = getelementptr inbounds i8, ptr %38, i64 8
  %40 = load i64, ptr %39, align 8, !tbaa !24
  %41 = load ptr, ptr %16, align 8, !tbaa !15
  %42 = getelementptr inbounds i8, ptr %41, i64 8
  %43 = load i64, ptr %42, align 8, !tbaa !24
  %44 = icmp eq i64 %40, %43
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %44, ptr noundef nonnull @.str.71, ptr noundef nonnull %4)
  br label %45

45:                                               ; preds = %32, %15
  %46 = load ptr, ptr %19, align 8, !tbaa !15
  %47 = load i64, ptr %46, align 8, !tbaa !23
  %48 = load ptr, ptr %16, align 8, !tbaa !15
  %49 = load i64, ptr %48, align 8, !tbaa !23
  %.not19 = icmp eq i64 %47, %49
  %50 = getelementptr inbounds i8, ptr %46, i64 8
  %51 = load i64, ptr %50, align 8, !tbaa !24
  br i1 %.not19, label %52, label %._crit_edge22

52:                                               ; preds = %45
  %53 = getelementptr inbounds i8, ptr %48, i64 8
  %54 = load i64, ptr %53, align 8, !tbaa !24
  %.not20 = icmp eq i64 %51, %54
  br i1 %.not20, label %55, label %._crit_edge22

._crit_edge22:                                    ; preds = %45, %52
  call void @_ZN11alglib_impl20ae_matrix_set_lengthEPNS_9ae_matrixEllPNS_8ae_stateE(ptr noundef nonnull %48, i64 noundef %47, i64 noundef %51, ptr noundef nonnull %4)
  %.pre23 = load ptr, ptr %16, align 8, !tbaa !15
  %.pre24 = load i64, ptr %.pre23, align 8, !tbaa !23
  br label %55

55:                                               ; preds = %._crit_edge22, %52
  %56 = phi i64 [ %.pre24, %._crit_edge22 ], [ %47, %52 ]
  %57 = phi ptr [ %.pre23, %._crit_edge22 ], [ %48, %52 ]
  %58 = icmp sgt i64 %56, 0
  br i1 %58, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %55, %.lr.ph
  %59 = phi ptr [ %76, %.lr.ph ], [ %57, %55 ]
  %.01721 = phi i64 [ %75, %.lr.ph ], [ 0, %55 ]
  %60 = getelementptr inbounds i8, ptr %59, i64 72
  %61 = load ptr, ptr %60, align 8, !tbaa !25
  %62 = getelementptr inbounds ptr, ptr %61, i64 %.01721
  %63 = load ptr, ptr %62, align 8, !tbaa !26
  %64 = load ptr, ptr %19, align 8, !tbaa !15
  %65 = getelementptr inbounds i8, ptr %64, i64 72
  %66 = load ptr, ptr %65, align 8, !tbaa !25
  %67 = getelementptr inbounds ptr, ptr %66, i64 %.01721
  %68 = load ptr, ptr %67, align 8, !tbaa !26
  %69 = getelementptr inbounds i8, ptr %59, i64 8
  %70 = load i64, ptr %69, align 8, !tbaa !24
  %71 = getelementptr inbounds i8, ptr %59, i64 24
  %72 = load i64, ptr %71, align 8, !tbaa !19
  %73 = call noundef i64 @_ZN11alglib_impl9ae_sizeofEl(i64 noundef %72)
  %74 = mul nsw i64 %73, %70
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %63, ptr align 1 %68, i64 %74, i1 false)
  %75 = add nuw nsw i64 %.01721, 1
  %76 = load ptr, ptr %16, align 8, !tbaa !15
  %77 = load i64, ptr %76, align 8, !tbaa !23
  %78 = icmp slt i64 %75, %77
  br i1 %78, label %.lr.ph, label %._crit_edge, !llvm.loop !27

._crit_edge:                                      ; preds = %.lr.ph, %55
  call void @_ZN11alglib_impl14ae_state_clearEPNS_8ae_stateE(ptr noundef nonnull %4)
  br label %79

79:                                               ; preds = %2, %._crit_edge
  call void @llvm.lifetime.end.p0(i64 128, ptr nonnull %4) #6
  call void @llvm.lifetime.end.p0(i64 200, ptr nonnull %3) #6
  ret ptr %0
}

declare void @_ZN6alglib8ap_errorC1EPKc(ptr, ptr) local_unnamed_addr

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { 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 #3 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { 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 #5 = { 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 #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 8}
!16 = !{!"_ZTSN6alglib17ae_matrix_wrapperE", !11, i64 8, !17, i64 16, !18, i64 96}
!17 = !{!"_ZTSN11alglib_impl9ae_matrixE", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !18, i64 32, !12, i64 40, !8, i64 72}
!18 = !{!"bool", !8, i64 0}
!19 = !{!17, !7, i64 24}
!20 = !{!16, !18, i64 96}
!21 = !{i8 0, i8 2}
!22 = !{}
!23 = !{!17, !7, i64 0}
!24 = !{!17, !7, i64 8}
!25 = !{!8, !8, i64 0}
!26 = !{!11, !11, i64 0}
!27 = distinct !{!27, !28}
!28 = !{!"llvm.loop.mustprogress"}


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