; LLVM IR from venumb/ZSPACE :: cpp/depends/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::qqpsettings" = type { double, double, double, i64, i8, i8, 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 nounwind uwtable
define dso_local void @_ZN11alglib_impl22_qqpsettings_init_copyEPvS0_PNS_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::qqpsettings", ptr %14, i32 0, i32 0
  %16 = load double, ptr %15, align 8, !tbaa !11
  %17 = load ptr, ptr %9, align 8, !tbaa !5
  %18 = getelementptr inbounds %"struct.alglib_impl::qqpsettings", ptr %17, i32 0, i32 0
  store double %16, ptr %18, align 8, !tbaa !11
  %19 = load ptr, ptr %10, align 8, !tbaa !5
  %20 = getelementptr inbounds %"struct.alglib_impl::qqpsettings", ptr %19, i32 0, i32 1
  %21 = load double, ptr %20, align 8, !tbaa !15
  %22 = load ptr, ptr %9, align 8, !tbaa !5
  %23 = getelementptr inbounds %"struct.alglib_impl::qqpsettings", ptr %22, i32 0, i32 1
  store double %21, ptr %23, align 8, !tbaa !15
  %24 = load ptr, ptr %10, align 8, !tbaa !5
  %25 = getelementptr inbounds %"struct.alglib_impl::qqpsettings", ptr %24, i32 0, i32 2
  %26 = load double, ptr %25, align 8, !tbaa !16
  %27 = load ptr, ptr %9, align 8, !tbaa !5
  %28 = getelementptr inbounds %"struct.alglib_impl::qqpsettings", ptr %27, i32 0, i32 2
  store double %26, ptr %28, align 8, !tbaa !16
  %29 = load ptr, ptr %10, align 8, !tbaa !5
  %30 = getelementptr inbounds %"struct.alglib_impl::qqpsettings", ptr %29, i32 0, i32 3
  %31 = load i64, ptr %30, align 8, !tbaa !17
  %32 = load ptr, ptr %9, align 8, !tbaa !5
  %33 = getelementptr inbounds %"struct.alglib_impl::qqpsettings", ptr %32, i32 0, i32 3
  store i64 %31, ptr %33, align 8, !tbaa !17
  %34 = load ptr, ptr %10, align 8, !tbaa !5
  %35 = getelementptr inbounds %"struct.alglib_impl::qqpsettings", ptr %34, i32 0, i32 4
  %36 = load i8, ptr %35, align 8, !tbaa !18, !range !19, !noundef !20
  %37 = trunc i8 %36 to i1
  %38 = load ptr, ptr %9, align 8, !tbaa !5
  %39 = getelementptr inbounds %"struct.alglib_impl::qqpsettings", ptr %38, i32 0, i32 4
  %40 = zext i1 %37 to i8
  store i8 %40, ptr %39, align 8, !tbaa !18
  %41 = load ptr, ptr %10, align 8, !tbaa !5
  %42 = getelementptr inbounds %"struct.alglib_impl::qqpsettings", ptr %41, i32 0, i32 5
  %43 = load i8, ptr %42, align 1, !tbaa !21, !range !19, !noundef !20
  %44 = trunc i8 %43 to i1
  %45 = load ptr, ptr %9, align 8, !tbaa !5
  %46 = getelementptr inbounds %"struct.alglib_impl::qqpsettings", ptr %45, i32 0, i32 5
  %47 = zext i1 %44 to i8
  store i8 %47, ptr %46, align 1, !tbaa !21
  %48 = load ptr, ptr %10, align 8, !tbaa !5
  %49 = getelementptr inbounds %"struct.alglib_impl::qqpsettings", ptr %48, i32 0, i32 6
  %50 = load i64, ptr %49, align 8, !tbaa !22
  %51 = load ptr, ptr %9, align 8, !tbaa !5
  %52 = getelementptr inbounds %"struct.alglib_impl::qqpsettings", ptr %51, i32 0, i32 6
  store i64 %50, ptr %52, align 8, !tbaa !22
  %53 = load ptr, ptr %10, align 8, !tbaa !5
  %54 = getelementptr inbounds %"struct.alglib_impl::qqpsettings", ptr %53, i32 0, i32 7
  %55 = load i64, ptr %54, align 8, !tbaa !23
  %56 = load ptr, ptr %9, align 8, !tbaa !5
  %57 = getelementptr inbounds %"struct.alglib_impl::qqpsettings", ptr %56, i32 0, i32 7
  store i64 %55, ptr %57, align 8, !tbaa !23
  %58 = load ptr, ptr %10, align 8, !tbaa !5
  %59 = getelementptr inbounds %"struct.alglib_impl::qqpsettings", ptr %58, i32 0, i32 8
  %60 = load i64, ptr %59, align 8, !tbaa !24
  %61 = load ptr, ptr %9, align 8, !tbaa !5
  %62 = getelementptr inbounds %"struct.alglib_impl::qqpsettings", ptr %61, i32 0, i32 8
  store i64 %60, ptr %62, align 8, !tbaa !24
  %63 = load ptr, ptr %10, align 8, !tbaa !5
  %64 = getelementptr inbounds %"struct.alglib_impl::qqpsettings", ptr %63, i32 0, i32 9
  %65 = load i64, ptr %64, align 8, !tbaa !25
  %66 = load ptr, ptr %9, align 8, !tbaa !5
  %67 = getelementptr inbounds %"struct.alglib_impl::qqpsettings", ptr %66, i32 0, i32 9
  store i64 %65, ptr %67, align 8, !tbaa !25
  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 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 #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_impl11qqpsettingsE", !13, i64 0, !13, i64 8, !13, i64 16, !14, i64 24, !10, i64 32, !10, i64 33, !14, i64 40, !14, i64 48, !14, i64 56, !14, i64 64}
!13 = !{!"double", !7, i64 0}
!14 = !{!"long", !7, i64 0}
!15 = !{!12, !13, i64 8}
!16 = !{!12, !13, i64 16}
!17 = !{!12, !14, i64 24}
!18 = !{!12, !10, i64 32}
!19 = !{i8 0, i8 2}
!20 = !{}
!21 = !{!12, !10, i64 33}
!22 = !{!12, !14, i64 40}
!23 = !{!12, !14, i64 48}
!24 = !{!12, !14, i64 56}
!25 = !{!12, !14, i64 64}


; 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 nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable
define dso_local void @_ZN11alglib_impl22_qqpsettings_init_copyEPvS0_PNS_8ae_stateEb(ptr nocapture noundef writeonly %0, ptr nocapture noundef readonly %1, ptr nocapture noundef readnone %2, i1 noundef zeroext %3) local_unnamed_addr #0 {
  %5 = load <2 x double>, ptr %1, align 8, !tbaa !5
  store <2 x double> %5, ptr %0, align 8, !tbaa !5
  %6 = getelementptr inbounds i8, ptr %1, i64 16
  %7 = load double, ptr %6, align 8, !tbaa !9
  %8 = getelementptr inbounds i8, ptr %0, i64 16
  store double %7, ptr %8, align 8, !tbaa !9
  %9 = getelementptr inbounds i8, ptr %1, i64 24
  %10 = load i64, ptr %9, align 8, !tbaa !13
  %11 = getelementptr inbounds i8, ptr %0, i64 24
  store i64 %10, ptr %11, align 8, !tbaa !13
  %12 = getelementptr inbounds i8, ptr %1, i64 32
  %13 = load i8, ptr %12, align 8, !tbaa !14, !range !15, !noundef !16
  %14 = getelementptr inbounds i8, ptr %0, i64 32
  store i8 %13, ptr %14, align 8, !tbaa !14
  %15 = getelementptr inbounds i8, ptr %1, i64 33
  %16 = load i8, ptr %15, align 1, !tbaa !17, !range !15, !noundef !16
  %17 = getelementptr inbounds i8, ptr %0, i64 33
  store i8 %16, ptr %17, align 1, !tbaa !17
  %18 = getelementptr inbounds i8, ptr %1, i64 40
  %19 = getelementptr inbounds i8, ptr %0, i64 40
  %20 = load <2 x i64>, ptr %18, align 8, !tbaa !18
  store <2 x i64> %20, ptr %19, align 8, !tbaa !18
  %21 = getelementptr inbounds i8, ptr %1, i64 56
  %22 = getelementptr inbounds i8, ptr %0, i64 56
  %23 = load <2 x i64>, ptr %21, align 8, !tbaa !18
  store <2 x i64> %23, ptr %22, align 8, !tbaa !18
  ret void
}

attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) 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, !6, i64 0}
!6 = !{!"double", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !6, i64 16}
!10 = !{!"_ZTSN11alglib_impl11qqpsettingsE", !6, i64 0, !6, i64 8, !6, i64 16, !11, i64 24, !12, i64 32, !12, i64 33, !11, i64 40, !11, i64 48, !11, i64 56, !11, i64 64}
!11 = !{!"long", !7, i64 0}
!12 = !{!"bool", !7, i64 0}
!13 = !{!10, !11, i64 24}
!14 = !{!10, !12, i64 32}
!15 = !{i8 0, i8 2}
!16 = !{}
!17 = !{!10, !12, i64 33}
!18 = !{!11, !11, i64 0}


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