; LLVM IR from Dimandragon/non-parametric-dsp :: alglib-cpp/src/ap.ll (ZN11alglib_impl31_xquadraticconstraint_init_copyEPvPKvPNS_8ae_stateEb)

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

; 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_impl19ae_vector_init_copyEPNS_9ae_vectorEPKS0_PNS_8ae_stateEb(ptr noundef, ptr noundef, ptr noundef, i1 noundef zeroext) #1

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN11alglib_impl31_xquadraticconstraint_init_copyEPvPKvPNS_8ae_stateEb(ptr noundef %0, ptr noundef %1, ptr noundef %2, i1 noundef zeroext %3) #1 {
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i8, align 1
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store ptr %2, ptr %7, align 8, !tbaa !5
  %11 = zext i1 %3 to i8
  store i8 %11, ptr %8, align 1, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #2
  %12 = load ptr, ptr %5, align 8, !tbaa !5
  store ptr %12, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #2
  %13 = load ptr, ptr %6, align 8, !tbaa !5
  store ptr %13, ptr %10, align 8, !tbaa !5
  %14 = load ptr, ptr %10, align 8, !tbaa !5
  %15 = getelementptr inbounds %"struct.alglib_impl::xquadraticconstraint", ptr %14, i32 0, i32 0
  %16 = load i64, ptr %15, align 8, !tbaa !11
  %17 = load ptr, ptr %9, align 8, !tbaa !5
  %18 = getelementptr inbounds %"struct.alglib_impl::xquadraticconstraint", ptr %17, i32 0, i32 0
  store i64 %16, ptr %18, align 8, !tbaa !11
  %19 = load ptr, ptr %9, align 8, !tbaa !5
  %20 = getelementptr inbounds %"struct.alglib_impl::xquadraticconstraint", ptr %19, i32 0, i32 1
  %21 = load ptr, ptr %10, align 8, !tbaa !5
  %22 = getelementptr inbounds %"struct.alglib_impl::xquadraticconstraint", ptr %21, i32 0, i32 1
  %23 = load ptr, ptr %7, align 8, !tbaa !5
  %24 = load i8, ptr %8, align 1, !tbaa !9, !range !18, !noundef !19
  %25 = trunc i8 %24 to i1
  call void @_ZN11alglib_impl19ae_vector_init_copyEPNS_9ae_vectorEPKS0_PNS_8ae_stateEb(ptr noundef %20, ptr noundef %22, ptr noundef %23, i1 noundef zeroext %25)
  %26 = load ptr, ptr %9, align 8, !tbaa !5
  %27 = getelementptr inbounds %"struct.alglib_impl::xquadraticconstraint", ptr %26, i32 0, i32 2
  %28 = load ptr, ptr %10, align 8, !tbaa !5
  %29 = getelementptr inbounds %"struct.alglib_impl::xquadraticconstraint", ptr %28, i32 0, i32 2
  %30 = load ptr, ptr %7, align 8, !tbaa !5
  %31 = load i8, ptr %8, align 1, !tbaa !9, !range !18, !noundef !19
  %32 = trunc i8 %31 to i1
  call void @_ZN11alglib_impl19ae_vector_init_copyEPNS_9ae_vectorEPKS0_PNS_8ae_stateEb(ptr noundef %27, ptr noundef %29, ptr noundef %30, i1 noundef zeroext %32)
  %33 = load ptr, ptr %9, align 8, !tbaa !5
  %34 = getelementptr inbounds %"struct.alglib_impl::xquadraticconstraint", ptr %33, i32 0, i32 3
  %35 = load ptr, ptr %10, align 8, !tbaa !5
  %36 = getelementptr inbounds %"struct.alglib_impl::xquadraticconstraint", ptr %35, i32 0, i32 3
  %37 = load ptr, ptr %7, align 8, !tbaa !5
  %38 = load i8, ptr %8, align 1, !tbaa !9, !range !18, !noundef !19
  %39 = trunc i8 %38 to i1
  call void @_ZN11alglib_impl23_sparsematrix_init_copyEPvPKvPNS_8ae_stateEb(ptr noundef %34, ptr noundef %36, ptr noundef %37, i1 noundef zeroext %39)
  %40 = load ptr, ptr %10, align 8, !tbaa !5
  %41 = getelementptr inbounds %"struct.alglib_impl::xquadraticconstraint", ptr %40, i32 0, i32 4
  %42 = load double, ptr %41, align 8, !tbaa !20
  %43 = load ptr, ptr %9, align 8, !tbaa !5
  %44 = getelementptr inbounds %"struct.alglib_impl::xquadraticconstraint", ptr %43, i32 0, i32 4
  store double %42, ptr %44, align 8, !tbaa !20
  %45 = load ptr, ptr %10, align 8, !tbaa !5
  %46 = getelementptr inbounds %"struct.alglib_impl::xquadraticconstraint", ptr %45, i32 0, i32 5
  %47 = load double, ptr %46, align 8, !tbaa !21
  %48 = load ptr, ptr %9, align 8, !tbaa !5
  %49 = getelementptr inbounds %"struct.alglib_impl::xquadraticconstraint", ptr %48, i32 0, i32 5
  store double %47, ptr %49, align 8, !tbaa !21
  %50 = load ptr, ptr %10, align 8, !tbaa !5
  %51 = getelementptr inbounds %"struct.alglib_impl::xquadraticconstraint", ptr %50, i32 0, i32 6
  %52 = load i8, ptr %51, align 8, !tbaa !22, !range !18, !noundef !19
  %53 = trunc i8 %52 to i1
  %54 = load ptr, ptr %9, align 8, !tbaa !5
  %55 = getelementptr inbounds %"struct.alglib_impl::xquadraticconstraint", ptr %54, i32 0, i32 6
  %56 = zext i1 %53 to i8
  store i8 %56, ptr %55, align 8, !tbaa !22
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #2
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #2
  ret void
}

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 = { 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, !10, i64 0}
!10 = !{!"bool", !7, i64 0}
!11 = !{!12, !13, i64 0}
!12 = !{!"_ZTSN11alglib_impl20xquadraticconstraintE", !13, i64 0, !14, i64 8, !14, i64 72, !16, i64 136, !17, i64 504, !17, i64 512, !10, i64 520}
!13 = !{!"long", !7, i64 0}
!14 = !{!"_ZTSN11alglib_impl9ae_vectorE", !13, i64 0, !13, i64 8, !10, i64 16, !15, i64 24, !7, i64 56}
!15 = !{!"_ZTSN11alglib_impl12ae_dyn_blockE", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!16 = !{!"_ZTSN11alglib_impl12sparsematrixE", !14, i64 0, !14, i64 64, !14, i64 128, !14, i64 192, !14, i64 256, !13, i64 320, !13, i64 328, !13, i64 336, !13, i64 344, !13, i64 352, !13, i64 360}
!17 = !{!"double", !7, i64 0}
!18 = !{i8 0, i8 2}
!19 = !{}
!20 = !{!12, !17, i64 504}
!21 = !{!12, !17, i64 512}
!22 = !{!12, !10, i64 520}


; 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"

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN11alglib_impl31_xquadraticconstraint_init_copyEPvPKvPNS_8ae_stateEb(ptr noundef %0, ptr noundef %1, ptr noundef %2, i1 noundef zeroext %3) local_unnamed_addr #0 {
  %5 = load i64, ptr %1, align 8, !tbaa !5
  store i64 %5, ptr %0, align 8, !tbaa !5
  %6 = getelementptr inbounds i8, ptr %0, i64 8
  %7 = getelementptr inbounds i8, ptr %1, i64 8
  tail call void @_ZN11alglib_impl19ae_vector_init_copyEPNS_9ae_vectorEPKS0_PNS_8ae_stateEb(ptr noundef nonnull %6, ptr noundef nonnull %7, ptr noundef %2, i1 noundef zeroext %3)
  %8 = getelementptr inbounds i8, ptr %0, i64 72
  %9 = getelementptr inbounds i8, ptr %1, i64 72
  tail call void @_ZN11alglib_impl19ae_vector_init_copyEPNS_9ae_vectorEPKS0_PNS_8ae_stateEb(ptr noundef nonnull %8, ptr noundef nonnull %9, ptr noundef %2, i1 noundef zeroext %3)
  %10 = getelementptr inbounds i8, ptr %0, i64 136
  %11 = getelementptr inbounds i8, ptr %1, i64 136
  tail call void @_ZN11alglib_impl23_sparsematrix_init_copyEPvPKvPNS_8ae_stateEb(ptr noundef nonnull %10, ptr noundef nonnull %11, ptr noundef %2, i1 noundef zeroext %3)
  %12 = getelementptr inbounds i8, ptr %1, i64 504
  %13 = getelementptr inbounds i8, ptr %0, i64 504
  %14 = load <2 x double>, ptr %12, align 8, !tbaa !16
  store <2 x double> %14, ptr %13, align 8, !tbaa !16
  %15 = getelementptr inbounds i8, ptr %1, i64 520
  %16 = load i8, ptr %15, align 8, !tbaa !17, !range !18, !noundef !19
  %17 = getelementptr inbounds i8, ptr %0, i64 520
  store i8 %16, ptr %17, align 8, !tbaa !17
  ret void
}

attributes #0 = { 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" }

!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_impl20xquadraticconstraintE", !7, i64 0, !10, i64 8, !10, i64 72, !14, i64 136, !15, i64 504, !15, i64 512, !11, i64 520}
!7 = !{!"long", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"_ZTSN11alglib_impl9ae_vectorE", !7, i64 0, !7, i64 8, !11, i64 16, !12, i64 24, !8, i64 56}
!11 = !{!"bool", !8, i64 0}
!12 = !{!"_ZTSN11alglib_impl12ae_dyn_blockE", !13, i64 0, !13, i64 8, !13, i64 16, !13, i64 24}
!13 = !{!"any pointer", !8, i64 0}
!14 = !{!"_ZTSN11alglib_impl12sparsematrixE", !10, i64 0, !10, i64 64, !10, i64 128, !10, i64 192, !10, i64 256, !7, i64 320, !7, i64 328, !7, i64 336, !7, i64 344, !7, i64 352, !7, i64 360}
!15 = !{!"double", !8, i64 0}
!16 = !{!15, !15, i64 0}
!17 = !{!6, !11, i64 520}
!18 = !{i8 0, i8 2}
!19 = !{}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,SLPVectorizerPass,SROAPass,TailCallElimPass