; 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::optguardnonc1test0report" = type { i8, i64, %"struct.alglib_impl::ae_vector", %"struct.alglib_impl::ae_vector", i64, %"struct.alglib_impl::ae_vector", %"struct.alglib_impl::ae_vector", i64, i64, i64 }
%"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 }

; 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
define dso_local void @_ZN11alglib_impl35_optguardnonc1test0report_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) #3
  %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) #3
  %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::optguardnonc1test0report", ptr %14, i32 0, i32 0
  %16 = load i8, ptr %15, align 8, !tbaa !11, !range !16, !noundef !17
  %17 = trunc i8 %16 to i1
  %18 = load ptr, ptr %9, align 8, !tbaa !5
  %19 = getelementptr inbounds %"struct.alglib_impl::optguardnonc1test0report", ptr %18, i32 0, i32 0
  %20 = zext i1 %17 to i8
  store i8 %20, ptr %19, align 8, !tbaa !11
  %21 = load ptr, ptr %10, align 8, !tbaa !5
  %22 = getelementptr inbounds %"struct.alglib_impl::optguardnonc1test0report", ptr %21, i32 0, i32 1
  %23 = load i64, ptr %22, align 8, !tbaa !18
  %24 = load ptr, ptr %9, align 8, !tbaa !5
  %25 = getelementptr inbounds %"struct.alglib_impl::optguardnonc1test0report", ptr %24, i32 0, i32 1
  store i64 %23, ptr %25, align 8, !tbaa !18
  %26 = load ptr, ptr %9, align 8, !tbaa !5
  %27 = getelementptr inbounds %"struct.alglib_impl::optguardnonc1test0report", ptr %26, i32 0, i32 2
  %28 = load ptr, ptr %10, align 8, !tbaa !5
  %29 = getelementptr inbounds %"struct.alglib_impl::optguardnonc1test0report", 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 !16, !noundef !17
  %32 = trunc i8 %31 to i1
  call void @_ZN11alglib_impl19ae_vector_init_copyEPNS_9ae_vectorES1_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::optguardnonc1test0report", ptr %33, i32 0, i32 3
  %35 = load ptr, ptr %10, align 8, !tbaa !5
  %36 = getelementptr inbounds %"struct.alglib_impl::optguardnonc1test0report", 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 !16, !noundef !17
  %39 = trunc i8 %38 to i1
  call void @_ZN11alglib_impl19ae_vector_init_copyEPNS_9ae_vectorES1_PNS_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::optguardnonc1test0report", ptr %40, i32 0, i32 4
  %42 = load i64, ptr %41, align 8, !tbaa !19
  %43 = load ptr, ptr %9, align 8, !tbaa !5
  %44 = getelementptr inbounds %"struct.alglib_impl::optguardnonc1test0report", ptr %43, i32 0, i32 4
  store i64 %42, ptr %44, align 8, !tbaa !19
  %45 = load ptr, ptr %9, align 8, !tbaa !5
  %46 = getelementptr inbounds %"struct.alglib_impl::optguardnonc1test0report", ptr %45, i32 0, i32 5
  %47 = load ptr, ptr %10, align 8, !tbaa !5
  %48 = getelementptr inbounds %"struct.alglib_impl::optguardnonc1test0report", ptr %47, i32 0, i32 5
  %49 = load ptr, ptr %7, align 8, !tbaa !5
  %50 = load i8, ptr %8, align 1, !tbaa !9, !range !16, !noundef !17
  %51 = trunc i8 %50 to i1
  call void @_ZN11alglib_impl19ae_vector_init_copyEPNS_9ae_vectorES1_PNS_8ae_stateEb(ptr noundef %46, ptr noundef %48, ptr noundef %49, i1 noundef zeroext %51)
  %52 = load ptr, ptr %9, align 8, !tbaa !5
  %53 = getelementptr inbounds %"struct.alglib_impl::optguardnonc1test0report", ptr %52, i32 0, i32 6
  %54 = load ptr, ptr %10, align 8, !tbaa !5
  %55 = getelementptr inbounds %"struct.alglib_impl::optguardnonc1test0report", ptr %54, i32 0, i32 6
  %56 = load ptr, ptr %7, align 8, !tbaa !5
  %57 = load i8, ptr %8, align 1, !tbaa !9, !range !16, !noundef !17
  %58 = trunc i8 %57 to i1
  call void @_ZN11alglib_impl19ae_vector_init_copyEPNS_9ae_vectorES1_PNS_8ae_stateEb(ptr noundef %53, ptr noundef %55, ptr noundef %56, i1 noundef zeroext %58)
  %59 = load ptr, ptr %10, align 8, !tbaa !5
  %60 = getelementptr inbounds %"struct.alglib_impl::optguardnonc1test0report", ptr %59, i32 0, i32 7
  %61 = load i64, ptr %60, align 8, !tbaa !20
  %62 = load ptr, ptr %9, align 8, !tbaa !5
  %63 = getelementptr inbounds %"struct.alglib_impl::optguardnonc1test0report", ptr %62, i32 0, i32 7
  store i64 %61, ptr %63, align 8, !tbaa !20
  %64 = load ptr, ptr %10, align 8, !tbaa !5
  %65 = getelementptr inbounds %"struct.alglib_impl::optguardnonc1test0report", ptr %64, i32 0, i32 8
  %66 = load i64, ptr %65, align 8, !tbaa !21
  %67 = load ptr, ptr %9, align 8, !tbaa !5
  %68 = getelementptr inbounds %"struct.alglib_impl::optguardnonc1test0report", ptr %67, i32 0, i32 8
  store i64 %66, ptr %68, align 8, !tbaa !21
  %69 = load ptr, ptr %10, align 8, !tbaa !5
  %70 = getelementptr inbounds %"struct.alglib_impl::optguardnonc1test0report", ptr %69, i32 0, i32 9
  %71 = load i64, ptr %70, align 8, !tbaa !22
  %72 = load ptr, ptr %9, align 8, !tbaa !5
  %73 = getelementptr inbounds %"struct.alglib_impl::optguardnonc1test0report", ptr %72, i32 0, i32 9
  store i64 %71, ptr %73, align 8, !tbaa !22
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #3
  ret void
}

declare void @_ZN11alglib_impl19ae_vector_init_copyEPNS_9ae_vectorES1_PNS_8ae_stateEb(ptr noundef, ptr noundef, ptr noundef, i1 noundef zeroext) #2

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 = { "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 = { 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, !10, i64 0}
!12 = !{!"_ZTSN11alglib_impl24optguardnonc1test0reportE", !10, i64 0, !13, i64 8, !14, i64 16, !14, i64 80, !13, i64 144, !14, i64 152, !14, i64 216, !13, i64 280, !13, i64 288, !13, i64 296}
!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 = !{i8 0, i8 2}
!17 = !{}
!18 = !{!12, !13, i64 8}
!19 = !{!12, !13, i64 144}
!20 = !{!12, !13, i64 280}
!21 = !{!12, !13, i64 288}
!22 = !{!12, !13, i64 296}


; 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
define dso_local void @_ZN11alglib_impl35_optguardnonc1test0report_init_copyEPvS0_PNS_8ae_stateEb(ptr noundef %0, ptr noundef %1, ptr noundef %2, i1 noundef zeroext %3) local_unnamed_addr #0 {
  %5 = load i8, ptr %1, align 8, !tbaa !5, !range !14, !noundef !15
  store i8 %5, ptr %0, align 8, !tbaa !5
  %6 = getelementptr inbounds i8, ptr %1, i64 8
  %7 = load i64, ptr %6, align 8, !tbaa !16
  %8 = getelementptr inbounds i8, ptr %0, i64 8
  store i64 %7, ptr %8, align 8, !tbaa !16
  %9 = getelementptr inbounds i8, ptr %0, i64 16
  %10 = getelementptr inbounds i8, ptr %1, i64 16
  tail call void @_ZN11alglib_impl19ae_vector_init_copyEPNS_9ae_vectorES1_PNS_8ae_stateEb(ptr noundef nonnull %9, ptr noundef nonnull %10, ptr noundef %2, i1 noundef zeroext %3)
  %11 = getelementptr inbounds i8, ptr %0, i64 80
  %12 = getelementptr inbounds i8, ptr %1, i64 80
  tail call void @_ZN11alglib_impl19ae_vector_init_copyEPNS_9ae_vectorES1_PNS_8ae_stateEb(ptr noundef nonnull %11, ptr noundef nonnull %12, ptr noundef %2, i1 noundef zeroext %3)
  %13 = getelementptr inbounds i8, ptr %1, i64 144
  %14 = load i64, ptr %13, align 8, !tbaa !17
  %15 = getelementptr inbounds i8, ptr %0, i64 144
  store i64 %14, ptr %15, align 8, !tbaa !17
  %16 = getelementptr inbounds i8, ptr %0, i64 152
  %17 = getelementptr inbounds i8, ptr %1, i64 152
  tail call void @_ZN11alglib_impl19ae_vector_init_copyEPNS_9ae_vectorES1_PNS_8ae_stateEb(ptr noundef nonnull %16, ptr noundef nonnull %17, ptr noundef %2, i1 noundef zeroext %3)
  %18 = getelementptr inbounds i8, ptr %0, i64 216
  %19 = getelementptr inbounds i8, ptr %1, i64 216
  tail call void @_ZN11alglib_impl19ae_vector_init_copyEPNS_9ae_vectorES1_PNS_8ae_stateEb(ptr noundef nonnull %18, ptr noundef nonnull %19, ptr noundef %2, i1 noundef zeroext %3)
  %20 = getelementptr inbounds i8, ptr %1, i64 280
  %21 = getelementptr inbounds i8, ptr %0, i64 280
  %22 = load <2 x i64>, ptr %20, align 8, !tbaa !18
  store <2 x i64> %22, ptr %21, align 8, !tbaa !18
  %23 = getelementptr inbounds i8, ptr %1, i64 296
  %24 = load i64, ptr %23, align 8, !tbaa !19
  %25 = getelementptr inbounds i8, ptr %0, i64 296
  store i64 %24, ptr %25, align 8, !tbaa !19
  ret void
}

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

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

!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_impl24optguardnonc1test0reportE", !7, i64 0, !10, i64 8, !11, i64 16, !11, i64 80, !10, i64 144, !11, i64 152, !11, i64 216, !10, i64 280, !10, i64 288, !10, i64 296}
!7 = !{!"bool", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"long", !8, i64 0}
!11 = !{!"_ZTSN11alglib_impl9ae_vectorE", !10, i64 0, !10, i64 8, !7, i64 16, !12, i64 24, !8, i64 56}
!12 = !{!"_ZTSN11alglib_impl12ae_dyn_blockE", !13, i64 0, !13, i64 8, !13, i64 16, !13, i64 24}
!13 = !{!"any pointer", !8, i64 0}
!14 = !{i8 0, i8 2}
!15 = !{}
!16 = !{!6, !10, i64 8}
!17 = !{!6, !10, i64 144}
!18 = !{!10, !10, i64 0}
!19 = !{!6, !10, i64 296}


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