; 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_impl::ae_frame" = type { %"struct.alglib_impl::ae_dyn_block" }
%"struct.alglib_impl::ae_dyn_block" = type { ptr, ptr, ptr, ptr }
%"struct.alglib_impl::ae_smart_ptr" = type { ptr, ptr, i8, i8, i64, ptr, ptr, %"struct.alglib_impl::ae_dyn_block" }
%"struct.alglib_impl::xquadraticconstraints" = type { i64, %"struct.alglib_impl::ae_obj_array", %"struct.alglib_impl::ae_vector" }
%"struct.alglib_impl::ae_obj_array" = type { i64, i64, i8, ptr, ptr, ptr, ptr, %"struct.alglib_impl::ae_lock", %"struct.alglib_impl::ae_dyn_block" }
%"struct.alglib_impl::ae_lock" = type { ptr, %"struct.alglib_impl::ae_dyn_block", i8 }
%"struct.alglib_impl::ae_vector" = type { i64, i64, i8, %"struct.alglib_impl::ae_dyn_block", %union.anon.0 }
%union.anon.0 = type { ptr }
%"struct.alglib_impl::xquadraticconstraint" = type { i64, %"struct.alglib_impl::ae_vector", %"struct.alglib_impl::ae_vector", %"struct.alglib_impl::sparsematrix", double, double, i8 }
%"struct.alglib_impl::sparsematrix" = type { %"struct.alglib_impl::ae_vector", %"struct.alglib_impl::ae_vector", %"struct.alglib_impl::ae_vector", %"struct.alglib_impl::ae_vector", %"struct.alglib_impl::ae_vector", i64, i64, i64, i64, i64, i64 }

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

declare noundef ptr @_ZN11alglib_impl9ae_mallocEmPNS_8ae_stateE(i64 noundef, ptr noundef) #1

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2

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

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

declare void @_ZN11alglib_impl14ae_frame_leaveEPNS_8ae_stateE(ptr noundef) #1

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

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

declare void @_ZN11alglib_impl18ae_obj_array_clearEPNS_12ae_obj_arrayE(ptr noundef) #1

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN11alglib_impl7xqccopyEPNS_21xquadraticconstraintsES1_PNS_8ae_stateE(ptr noundef %0, ptr noundef %1, ptr noundef %2) #3 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca %"struct.alglib_impl::ae_frame", align 8
  %8 = alloca i64, align 8
  %9 = alloca i64, align 8
  %10 = alloca ptr, align 8
  %11 = alloca %"struct.alglib_impl::ae_smart_ptr", align 8
  %12 = alloca ptr, align 8
  %13 = alloca %"struct.alglib_impl::ae_smart_ptr", align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  store ptr %2, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 32, ptr %7) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #4
  call void @llvm.lifetime.start.p0(i64 80, ptr %11) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #4
  call void @llvm.lifetime.start.p0(i64 80, ptr %13) #4
  %14 = load ptr, ptr %6, align 8, !tbaa !5
  call void @_ZN11alglib_impl13ae_frame_makeEPNS_8ae_stateEPNS_8ae_frameE(ptr noundef %14, ptr noundef %7)
  call void @llvm.memset.p0.i64(ptr align 8 %11, i8 0, i64 80, i1 false)
  call void @llvm.memset.p0.i64(ptr align 8 %13, i8 0, i64 80, i1 false)
  %15 = load ptr, ptr %6, align 8, !tbaa !5
  call void @_ZN11alglib_impl17ae_smart_ptr_initEPNS_12ae_smart_ptrEPPvPNS_8ae_stateEb(ptr noundef %11, ptr noundef %10, ptr noundef %15, i1 noundef zeroext true)
  %16 = load ptr, ptr %6, align 8, !tbaa !5
  call void @_ZN11alglib_impl17ae_smart_ptr_initEPNS_12ae_smart_ptrEPPvPNS_8ae_stateEb(ptr noundef %13, ptr noundef %12, ptr noundef %16, i1 noundef zeroext true)
  %17 = load ptr, ptr %4, align 8, !tbaa !5
  %18 = getelementptr inbounds %"struct.alglib_impl::xquadraticconstraints", ptr %17, i32 0, i32 0
  %19 = load i64, ptr %18, align 8, !tbaa !9
  %20 = load ptr, ptr %5, align 8, !tbaa !5
  %21 = getelementptr inbounds %"struct.alglib_impl::xquadraticconstraints", ptr %20, i32 0, i32 0
  store i64 %19, ptr %21, align 8, !tbaa !9
  %22 = load ptr, ptr %4, align 8, !tbaa !5
  %23 = getelementptr inbounds %"struct.alglib_impl::xquadraticconstraints", ptr %22, i32 0, i32 1
  %24 = call noundef i64 @_ZN11alglib_impl23ae_obj_array_get_lengthEPKNS_12ae_obj_arrayE(ptr noundef %23)
  store i64 %24, ptr %9, align 8, !tbaa !17
  %25 = load ptr, ptr %5, align 8, !tbaa !5
  %26 = getelementptr inbounds %"struct.alglib_impl::xquadraticconstraints", ptr %25, i32 0, i32 1
  call void @_ZN11alglib_impl18ae_obj_array_clearEPNS_12ae_obj_arrayE(ptr noundef %26)
  store i64 0, ptr %8, align 8, !tbaa !17
  br label %27

27:                                               ; preds = %96, %3
  %28 = load i64, ptr %8, align 8, !tbaa !17
  %29 = load i64, ptr %9, align 8, !tbaa !17
  %30 = sub nsw i64 %29, 1
  %31 = icmp sle i64 %28, %30
  br i1 %31, label %32, label %99

32:                                               ; preds = %27
  %33 = load ptr, ptr %4, align 8, !tbaa !5
  %34 = getelementptr inbounds %"struct.alglib_impl::xquadraticconstraints", ptr %33, i32 0, i32 1
  %35 = load i64, ptr %8, align 8, !tbaa !17
  %36 = load ptr, ptr %6, align 8, !tbaa !5
  call void @_ZN11alglib_impl16ae_obj_array_getEPNS_12ae_obj_arrayElPNS_12ae_smart_ptrEPNS_8ae_stateE(ptr noundef %34, i64 noundef %35, ptr noundef %11, ptr noundef %36)
  %37 = load ptr, ptr %6, align 8, !tbaa !5
  %38 = call noundef ptr @_ZN11alglib_impl9ae_mallocEmPNS_8ae_stateE(i64 noundef 528, ptr noundef %37)
  store ptr %38, ptr %12, align 8, !tbaa !5
  %39 = load ptr, ptr %12, align 8, !tbaa !5
  call void @llvm.memset.p0.i64(ptr align 8 %39, i8 0, i64 528, i1 false)
  %40 = load ptr, ptr %12, align 8, !tbaa !5
  %41 = load ptr, ptr %6, align 8, !tbaa !5
  call void @_ZN11alglib_impl26_xquadraticconstraint_initEPvPNS_8ae_stateEb(ptr noundef %40, ptr noundef %41, i1 noundef zeroext false)
  %42 = load ptr, ptr %12, align 8, !tbaa !5
  call void @_ZN11alglib_impl19ae_smart_ptr_assignEPNS_12ae_smart_ptrEPvbblPFvS2_PKvPNS_8ae_stateEbEPFvS2_E(ptr noundef %13, ptr noundef %42, i1 noundef zeroext true, i1 noundef zeroext true, i64 noundef 528, ptr noundef @_ZN11alglib_impl31_xquadraticconstraint_init_copyEPvPKvPNS_8ae_stateEb, ptr noundef @_ZN11alglib_impl29_xquadraticconstraint_destroyEPv)
  %43 = load ptr, ptr %10, align 8, !tbaa !5
  %44 = getelementptr inbounds %"struct.alglib_impl::xquadraticconstraint", ptr %43, i32 0, i32 0
  %45 = load i64, ptr %44, align 8, !tbaa !18
  %46 = load ptr, ptr %12, align 8, !tbaa !5
  %47 = getelementptr inbounds %"struct.alglib_impl::xquadraticconstraint", ptr %46, i32 0, i32 0
  store i64 %45, ptr %47, align 8, !tbaa !18
  %48 = load ptr, ptr %10, align 8, !tbaa !5
  %49 = getelementptr inbounds %"struct.alglib_impl::xquadraticconstraint", ptr %48, i32 0, i32 4
  %50 = load double, ptr %49, align 8, !tbaa !22
  %51 = load ptr, ptr %12, align 8, !tbaa !5
  %52 = getelementptr inbounds %"struct.alglib_impl::xquadraticconstraint", ptr %51, i32 0, i32 4
  store double %50, ptr %52, align 8, !tbaa !22
  %53 = load ptr, ptr %10, align 8, !tbaa !5
  %54 = getelementptr inbounds %"struct.alglib_impl::xquadraticconstraint", ptr %53, i32 0, i32 5
  %55 = load double, ptr %54, align 8, !tbaa !23
  %56 = load ptr, ptr %12, align 8, !tbaa !5
  %57 = getelementptr inbounds %"struct.alglib_impl::xquadraticconstraint", ptr %56, i32 0, i32 5
  store double %55, ptr %57, align 8, !tbaa !23
  %58 = load ptr, ptr %10, align 8, !tbaa !5
  %59 = getelementptr inbounds %"struct.alglib_impl::xquadraticconstraint", ptr %58, i32 0, i32 6
  %60 = load i8, ptr %59, align 8, !tbaa !24, !range !25, !noundef !26
  %61 = trunc i8 %60 to i1
  %62 = load ptr, ptr %12, align 8, !tbaa !5
  %63 = getelementptr inbounds %"struct.alglib_impl::xquadraticconstraint", ptr %62, i32 0, i32 6
  %64 = zext i1 %61 to i8
  store i8 %64, ptr %63, align 8, !tbaa !24
  %65 = load ptr, ptr %10, align 8, !tbaa !5
  %66 = getelementptr inbounds %"struct.alglib_impl::xquadraticconstraint", ptr %65, i32 0, i32 0
  %67 = load i64, ptr %66, align 8, !tbaa !18
  %68 = icmp sgt i64 %67, 0
  br i1 %68, label %69, label %91

69:                                               ; preds = %32
  %70 = load ptr, ptr %10, align 8, !tbaa !5
  %71 = getelementptr inbounds %"struct.alglib_impl::xquadraticconstraint", ptr %70, i32 0, i32 0
  %72 = load i64, ptr %71, align 8, !tbaa !18
  %73 = load ptr, ptr %10, align 8, !tbaa !5
  %74 = getelementptr inbounds %"struct.alglib_impl::xquadraticconstraint", ptr %73, i32 0, i32 1
  %75 = load ptr, ptr %12, align 8, !tbaa !5
  %76 = getelementptr inbounds %"struct.alglib_impl::xquadraticconstraint", ptr %75, i32 0, i32 1
  %77 = load ptr, ptr %6, align 8, !tbaa !5
  call void @_ZN11alglib_impl11icopyallocvElPKNS_9ae_vectorEPS0_PNS_8ae_stateE(i64 noundef %72, ptr noundef %74, ptr noundef %76, ptr noundef %77)
  %78 = load ptr, ptr %10, align 8, !tbaa !5
  %79 = getelementptr inbounds %"struct.alglib_impl::xquadraticconstraint", ptr %78, i32 0, i32 0
  %80 = load i64, ptr %79, align 8, !tbaa !18
  %81 = load ptr, ptr %10, align 8, !tbaa !5
  %82 = getelementptr inbounds %"struct.alglib_impl::xquadraticconstraint", ptr %81, i32 0, i32 2
  %83 = load ptr, ptr %12, align 8, !tbaa !5
  %84 = getelementptr inbounds %"struct.alglib_impl::xquadraticconstraint", ptr %83, i32 0, i32 2
  %85 = load ptr, ptr %6, align 8, !tbaa !5
  call void @_ZN11alglib_impl11rcopyallocvElPKNS_9ae_vectorEPS0_PNS_8ae_stateE(i64 noundef %80, ptr noundef %82, ptr noundef %84, ptr noundef %85)
  %86 = load ptr, ptr %10, align 8, !tbaa !5
  %87 = getelementptr inbounds %"struct.alglib_impl::xquadraticconstraint", ptr %86, i32 0, i32 3
  %88 = load ptr, ptr %12, align 8, !tbaa !5
  %89 = getelementptr inbounds %"struct.alglib_impl::xquadraticconstraint", ptr %88, i32 0, i32 3
  %90 = load ptr, ptr %6, align 8, !tbaa !5
  call void @_ZN11alglib_impl13sparsecopybufEPKNS_12sparsematrixEPS0_PNS_8ae_stateE(ptr noundef %87, ptr noundef %89, ptr noundef %90)
  br label %91

91:                                               ; preds = %69, %32
  %92 = load ptr, ptr %5, align 8, !tbaa !5
  %93 = getelementptr inbounds %"struct.alglib_impl::xquadraticconstraints", ptr %92, i32 0, i32 1
  %94 = load ptr, ptr %6, align 8, !tbaa !5
  %95 = call noundef i64 @_ZN11alglib_impl28ae_obj_array_append_transferEPNS_12ae_obj_arrayEPNS_12ae_smart_ptrEPNS_8ae_stateE(ptr noundef %93, ptr noundef %13, ptr noundef %94)
  br label %96

96:                                               ; preds = %91
  %97 = load i64, ptr %8, align 8, !tbaa !17
  %98 = add nsw i64 %97, 1
  store i64 %98, ptr %8, align 8, !tbaa !17
  br label %27, !llvm.loop !27

99:                                               ; preds = %27
  %100 = load ptr, ptr %6, align 8, !tbaa !5
  call void @_ZN11alglib_impl14ae_frame_leaveEPNS_8ae_stateE(ptr noundef %100)
  call void @llvm.lifetime.end.p0(i64 80, ptr %13) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 80, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr %7) #4
  ret void
}

declare void @_ZN11alglib_impl17ae_smart_ptr_initEPNS_12ae_smart_ptrEPPvPNS_8ae_stateEb(ptr noundef, ptr noundef, ptr noundef, i1 noundef zeroext) #1

declare noundef i64 @_ZN11alglib_impl23ae_obj_array_get_lengthEPKNS_12ae_obj_arrayE(ptr noundef) #1

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

declare void @_ZN11alglib_impl26_xquadraticconstraint_initEPvPNS_8ae_stateEb(ptr noundef, ptr noundef, i1 noundef zeroext) #1

declare void @_ZN11alglib_impl19ae_smart_ptr_assignEPNS_12ae_smart_ptrEPvbblPFvS2_PKvPNS_8ae_stateEbEPFvS2_E(ptr noundef, ptr noundef, i1 noundef zeroext, i1 noundef zeroext, i64 noundef, ptr noundef, ptr noundef) #1

declare void @_ZN11alglib_impl31_xquadraticconstraint_init_copyEPvPKvPNS_8ae_stateEb(ptr noundef, ptr noundef, ptr noundef, i1 noundef zeroext) #1

declare void @_ZN11alglib_impl29_xquadraticconstraint_destroyEPv(ptr noundef) #1

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

declare noundef i64 @_ZN11alglib_impl28ae_obj_array_append_transferEPNS_12ae_obj_arrayEPNS_12ae_smart_ptrEPNS_8ae_stateE(ptr noundef, ptr noundef, ptr noundef) #1

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

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !11, i64 0}
!10 = !{!"_ZTSN11alglib_impl21xquadraticconstraintsE", !11, i64 0, !12, i64 8, !16, i64 144}
!11 = !{!"long", !7, i64 0}
!12 = !{!"_ZTSN11alglib_impl12ae_obj_arrayE", !11, i64 0, !11, i64 8, !13, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !14, i64 56, !15, i64 104}
!13 = !{!"bool", !7, i64 0}
!14 = !{!"_ZTSN11alglib_impl7ae_lockE", !6, i64 0, !15, i64 8, !13, i64 40}
!15 = !{!"_ZTSN11alglib_impl12ae_dyn_blockE", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!16 = !{!"_ZTSN11alglib_impl9ae_vectorE", !11, i64 0, !11, i64 8, !13, i64 16, !15, i64 24, !7, i64 56}
!17 = !{!11, !11, i64 0}
!18 = !{!19, !11, i64 0}
!19 = !{!"_ZTSN11alglib_impl20xquadraticconstraintE", !11, i64 0, !16, i64 8, !16, i64 72, !20, i64 136, !21, i64 504, !21, i64 512, !13, i64 520}
!20 = !{!"_ZTSN11alglib_impl12sparsematrixE", !16, i64 0, !16, i64 64, !16, i64 128, !16, i64 192, !16, i64 256, !11, i64 320, !11, i64 328, !11, i64 336, !11, i64 344, !11, i64 352, !11, i64 360}
!21 = !{!"double", !7, i64 0}
!22 = !{!19, !21, i64 504}
!23 = !{!19, !21, i64 512}
!24 = !{!19, !13, i64 520}
!25 = !{i8 0, i8 2}
!26 = !{}
!27 = distinct !{!27, !28}
!28 = !{!"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.alglib_impl::ae_frame" = type { %"struct.alglib_impl::ae_dyn_block" }
%"struct.alglib_impl::ae_dyn_block" = type { ptr, ptr, ptr, ptr }
%"struct.alglib_impl::ae_smart_ptr" = type { ptr, ptr, i8, i8, i64, ptr, ptr, %"struct.alglib_impl::ae_dyn_block" }

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

declare noundef ptr @_ZN11alglib_impl9ae_mallocEmPNS_8ae_stateE(i64 noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2

; 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_impl13ae_frame_makeEPNS_8ae_stateEPNS_8ae_frameE(ptr noundef, ptr noundef) local_unnamed_addr #1

declare void @_ZN11alglib_impl14ae_frame_leaveEPNS_8ae_stateE(ptr noundef) local_unnamed_addr #1

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

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

declare void @_ZN11alglib_impl18ae_obj_array_clearEPNS_12ae_obj_arrayE(ptr noundef) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN11alglib_impl7xqccopyEPNS_21xquadraticconstraintsES1_PNS_8ae_stateE(ptr noundef %0, ptr noundef %1, ptr noundef %2) local_unnamed_addr #3 {
  %4 = alloca %"struct.alglib_impl::ae_frame", align 8
  %5 = alloca ptr, align 8
  %6 = alloca %"struct.alglib_impl::ae_smart_ptr", align 8
  %7 = alloca ptr, align 8
  %8 = alloca %"struct.alglib_impl::ae_smart_ptr", align 8
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %4) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #4
  call void @llvm.lifetime.start.p0(i64 80, ptr nonnull %6) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #4
  call void @llvm.lifetime.start.p0(i64 80, ptr nonnull %8) #4
  call void @_ZN11alglib_impl13ae_frame_makeEPNS_8ae_stateEPNS_8ae_frameE(ptr noundef %2, ptr noundef nonnull %4)
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(80) %6, i8 0, i64 80, i1 false)
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(80) %8, i8 0, i64 80, i1 false)
  call void @_ZN11alglib_impl17ae_smart_ptr_initEPNS_12ae_smart_ptrEPPvPNS_8ae_stateEb(ptr noundef nonnull %6, ptr noundef nonnull %5, ptr noundef %2, i1 noundef zeroext true)
  call void @_ZN11alglib_impl17ae_smart_ptr_initEPNS_12ae_smart_ptrEPPvPNS_8ae_stateEb(ptr noundef nonnull %8, ptr noundef nonnull %7, ptr noundef %2, i1 noundef zeroext true)
  %9 = load i64, ptr %0, align 8, !tbaa !5
  store i64 %9, ptr %1, align 8, !tbaa !5
  %10 = getelementptr inbounds i8, ptr %0, i64 8
  %11 = call noundef i64 @_ZN11alglib_impl23ae_obj_array_get_lengthEPKNS_12ae_obj_arrayE(ptr noundef nonnull %10)
  %12 = getelementptr inbounds i8, ptr %1, i64 8
  call void @_ZN11alglib_impl18ae_obj_array_clearEPNS_12ae_obj_arrayE(ptr noundef nonnull %12)
  %.not.not21 = icmp sgt i64 %11, 0
  br i1 %.not.not21, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %3, %37
  %.022 = phi i64 [ %39, %37 ], [ 0, %3 ]
  call void @_ZN11alglib_impl16ae_obj_array_getEPNS_12ae_obj_arrayElPNS_12ae_smart_ptrEPNS_8ae_stateE(ptr noundef nonnull %10, i64 noundef %.022, ptr noundef nonnull %6, ptr noundef %2)
  %13 = call noundef ptr @_ZN11alglib_impl9ae_mallocEmPNS_8ae_stateE(i64 noundef 528, ptr noundef %2)
  store ptr %13, ptr %7, align 8, !tbaa !16
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(528) %13, i8 0, i64 528, i1 false)
  call void @_ZN11alglib_impl26_xquadraticconstraint_initEPvPNS_8ae_stateEb(ptr noundef %13, ptr noundef %2, i1 noundef zeroext false)
  %14 = load ptr, ptr %7, align 8, !tbaa !16
  call void @_ZN11alglib_impl19ae_smart_ptr_assignEPNS_12ae_smart_ptrEPvbblPFvS2_PKvPNS_8ae_stateEbEPFvS2_E(ptr noundef nonnull %8, ptr noundef %14, i1 noundef zeroext true, i1 noundef zeroext true, i64 noundef 528, ptr noundef nonnull @_ZN11alglib_impl31_xquadraticconstraint_init_copyEPvPKvPNS_8ae_stateEb, ptr noundef nonnull @_ZN11alglib_impl29_xquadraticconstraint_destroyEPv)
  %15 = load ptr, ptr %5, align 8, !tbaa !16
  %16 = load i64, ptr %15, align 8, !tbaa !17
  %17 = load ptr, ptr %7, align 8, !tbaa !16
  store i64 %16, ptr %17, align 8, !tbaa !17
  %18 = getelementptr inbounds i8, ptr %15, i64 504
  %19 = getelementptr inbounds i8, ptr %17, i64 504
  %20 = load <2 x double>, ptr %18, align 8, !tbaa !21
  store <2 x double> %20, ptr %19, align 8, !tbaa !21
  %21 = getelementptr inbounds i8, ptr %15, i64 520
  %22 = load i8, ptr %21, align 8, !tbaa !22, !range !23, !noundef !24
  %23 = getelementptr inbounds i8, ptr %17, i64 520
  store i8 %22, ptr %23, align 8, !tbaa !22
  %24 = icmp sgt i64 %16, 0
  br i1 %24, label %25, label %37

25:                                               ; preds = %.lr.ph
  %26 = getelementptr inbounds i8, ptr %15, i64 8
  %27 = getelementptr inbounds i8, ptr %17, i64 8
  call void @_ZN11alglib_impl11icopyallocvElPKNS_9ae_vectorEPS0_PNS_8ae_stateE(i64 noundef %16, ptr noundef nonnull %26, ptr noundef nonnull %27, ptr noundef %2)
  %28 = load ptr, ptr %5, align 8, !tbaa !16
  %29 = load i64, ptr %28, align 8, !tbaa !17
  %30 = getelementptr inbounds i8, ptr %28, i64 72
  %31 = load ptr, ptr %7, align 8, !tbaa !16
  %32 = getelementptr inbounds i8, ptr %31, i64 72
  call void @_ZN11alglib_impl11rcopyallocvElPKNS_9ae_vectorEPS0_PNS_8ae_stateE(i64 noundef %29, ptr noundef nonnull %30, ptr noundef nonnull %32, ptr noundef %2)
  %33 = load ptr, ptr %5, align 8, !tbaa !16
  %34 = getelementptr inbounds i8, ptr %33, i64 136
  %35 = load ptr, ptr %7, align 8, !tbaa !16
  %36 = getelementptr inbounds i8, ptr %35, i64 136
  call void @_ZN11alglib_impl13sparsecopybufEPKNS_12sparsematrixEPS0_PNS_8ae_stateE(ptr noundef nonnull %34, ptr noundef nonnull %36, ptr noundef %2)
  br label %37

37:                                               ; preds = %25, %.lr.ph
  %38 = call noundef i64 @_ZN11alglib_impl28ae_obj_array_append_transferEPNS_12ae_obj_arrayEPNS_12ae_smart_ptrEPNS_8ae_stateE(ptr noundef nonnull %12, ptr noundef nonnull %8, ptr noundef %2)
  %39 = add nuw nsw i64 %.022, 1
  %exitcond.not = icmp eq i64 %39, %11
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph, !llvm.loop !25

._crit_edge:                                      ; preds = %37, %3
  call void @_ZN11alglib_impl14ae_frame_leaveEPNS_8ae_stateE(ptr noundef %2)
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %8) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #4
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %6) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %4) #4
  ret void
}

declare void @_ZN11alglib_impl17ae_smart_ptr_initEPNS_12ae_smart_ptrEPPvPNS_8ae_stateEb(ptr noundef, ptr noundef, ptr noundef, i1 noundef zeroext) local_unnamed_addr #1

declare noundef i64 @_ZN11alglib_impl23ae_obj_array_get_lengthEPKNS_12ae_obj_arrayE(ptr noundef) local_unnamed_addr #1

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

declare void @_ZN11alglib_impl26_xquadraticconstraint_initEPvPNS_8ae_stateEb(ptr noundef, ptr noundef, i1 noundef zeroext) local_unnamed_addr #1

declare void @_ZN11alglib_impl19ae_smart_ptr_assignEPNS_12ae_smart_ptrEPvbblPFvS2_PKvPNS_8ae_stateEbEPFvS2_E(ptr noundef, ptr noundef, i1 noundef zeroext, i1 noundef zeroext, i64 noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

declare void @_ZN11alglib_impl31_xquadraticconstraint_init_copyEPvPKvPNS_8ae_stateEb(ptr noundef, ptr noundef, ptr noundef, i1 noundef zeroext) #1

declare void @_ZN11alglib_impl29_xquadraticconstraint_destroyEPv(ptr noundef) #1

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

declare noundef i64 @_ZN11alglib_impl28ae_obj_array_append_transferEPNS_12ae_obj_arrayEPNS_12ae_smart_ptrEPNS_8ae_stateE(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

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

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !7, i64 0}
!6 = !{!"_ZTSN11alglib_impl21xquadraticconstraintsE", !7, i64 0, !10, i64 8, !15, i64 144}
!7 = !{!"long", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"_ZTSN11alglib_impl12ae_obj_arrayE", !7, i64 0, !7, i64 8, !11, i64 16, !12, i64 24, !12, i64 32, !12, i64 40, !12, i64 48, !13, i64 56, !14, i64 104}
!11 = !{!"bool", !8, i64 0}
!12 = !{!"any pointer", !8, i64 0}
!13 = !{!"_ZTSN11alglib_impl7ae_lockE", !12, i64 0, !14, i64 8, !11, i64 40}
!14 = !{!"_ZTSN11alglib_impl12ae_dyn_blockE", !12, i64 0, !12, i64 8, !12, i64 16, !12, i64 24}
!15 = !{!"_ZTSN11alglib_impl9ae_vectorE", !7, i64 0, !7, i64 8, !11, i64 16, !14, i64 24, !8, i64 56}
!16 = !{!12, !12, i64 0}
!17 = !{!18, !7, i64 0}
!18 = !{!"_ZTSN11alglib_impl20xquadraticconstraintE", !7, i64 0, !15, i64 8, !15, i64 72, !19, i64 136, !20, i64 504, !20, i64 512, !11, i64 520}
!19 = !{!"_ZTSN11alglib_impl12sparsematrixE", !15, i64 0, !15, i64 64, !15, i64 128, !15, i64 192, !15, i64 256, !7, i64 320, !7, i64 328, !7, i64 336, !7, i64 344, !7, i64 352, !7, i64 360}
!20 = !{!"double", !8, i64 0}
!21 = !{!20, !20, i64 0}
!22 = !{!18, !11, i64 520}
!23 = !{i8 0, i8 2}
!24 = !{}
!25 = distinct !{!25, !26}
!26 = !{!"llvm.loop.mustprogress"}


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