; LLVM IR from Dimandragon/non-parametric-dsp :: alglib-cpp/src (alglibmisc)

; 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::xdebugrecord1" = type { i64, %"struct.alglib_impl::ae_complex", %"struct.alglib_impl::ae_vector" }
%"struct.alglib_impl::ae_complex" = type { double, double }
%"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: mustprogress uwtable
define dso_local void @_ZN11alglib_impl19xdebugupdaterecord1EPNS_13xdebugrecord1EPNS_8ae_stateE(ptr noundef %0, ptr noundef %1) #0 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %5 = load ptr, ptr %3, align 8, !tbaa !5
  %6 = getelementptr inbounds %"struct.alglib_impl::xdebugrecord1", ptr %5, i32 0, i32 0
  %7 = load i64, ptr %6, align 8, !tbaa !9
  %8 = add nsw i64 %7, 1
  %9 = load ptr, ptr %3, align 8, !tbaa !5
  %10 = getelementptr inbounds %"struct.alglib_impl::xdebugrecord1", ptr %9, i32 0, i32 0
  store i64 %8, ptr %10, align 8, !tbaa !9
  %11 = load ptr, ptr %3, align 8, !tbaa !5
  %12 = getelementptr inbounds %"struct.alglib_impl::xdebugrecord1", ptr %11, i32 0, i32 1
  %13 = getelementptr inbounds %"struct.alglib_impl::ae_complex", ptr %12, i32 0, i32 0
  %14 = load double, ptr %13, align 8, !tbaa !17
  %15 = fadd double %14, 2.000000e+00
  %16 = load ptr, ptr %3, align 8, !tbaa !5
  %17 = getelementptr inbounds %"struct.alglib_impl::xdebugrecord1", ptr %16, i32 0, i32 1
  %18 = getelementptr inbounds %"struct.alglib_impl::ae_complex", ptr %17, i32 0, i32 0
  store double %15, ptr %18, align 8, !tbaa !17
  %19 = load ptr, ptr %3, align 8, !tbaa !5
  %20 = getelementptr inbounds %"struct.alglib_impl::xdebugrecord1", ptr %19, i32 0, i32 1
  %21 = getelementptr inbounds %"struct.alglib_impl::ae_complex", ptr %20, i32 0, i32 1
  %22 = load double, ptr %21, align 8, !tbaa !18
  %23 = fadd double %22, 3.000000e+00
  %24 = load ptr, ptr %3, align 8, !tbaa !5
  %25 = getelementptr inbounds %"struct.alglib_impl::xdebugrecord1", ptr %24, i32 0, i32 1
  %26 = getelementptr inbounds %"struct.alglib_impl::ae_complex", ptr %25, i32 0, i32 1
  store double %23, ptr %26, align 8, !tbaa !18
  %27 = load ptr, ptr %3, align 8, !tbaa !5
  %28 = getelementptr inbounds %"struct.alglib_impl::xdebugrecord1", ptr %27, i32 0, i32 2
  %29 = load ptr, ptr %3, align 8, !tbaa !5
  %30 = getelementptr inbounds %"struct.alglib_impl::xdebugrecord1", ptr %29, i32 0, i32 2
  %31 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %30, i32 0, i32 0
  %32 = load i64, ptr %31, align 8, !tbaa !19
  %33 = add nsw i64 %32, 1
  %34 = load ptr, ptr %4, align 8, !tbaa !5
  call void @_ZN11alglib_impl13rvectorresizeEPNS_9ae_vectorElPNS_8ae_stateE(ptr noundef %28, i64 noundef %33, ptr noundef %34)
  %35 = load ptr, ptr %3, align 8, !tbaa !5
  %36 = getelementptr inbounds %"struct.alglib_impl::xdebugrecord1", ptr %35, i32 0, i32 2
  %37 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %36, i32 0, i32 4
  %38 = load ptr, ptr %37, align 8, !tbaa !20
  %39 = load ptr, ptr %3, align 8, !tbaa !5
  %40 = getelementptr inbounds %"struct.alglib_impl::xdebugrecord1", ptr %39, i32 0, i32 2
  %41 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %40, i32 0, i32 0
  %42 = load i64, ptr %41, align 8, !tbaa !19
  %43 = sub nsw i64 %42, 2
  %44 = getelementptr inbounds double, ptr %38, i64 %43
  %45 = load double, ptr %44, align 8, !tbaa !21
  %46 = fadd double %45, 3.000000e+00
  %47 = load ptr, ptr %3, align 8, !tbaa !5
  %48 = getelementptr inbounds %"struct.alglib_impl::xdebugrecord1", ptr %47, i32 0, i32 2
  %49 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %48, i32 0, i32 4
  %50 = load ptr, ptr %49, align 8, !tbaa !20
  %51 = load ptr, ptr %3, align 8, !tbaa !5
  %52 = getelementptr inbounds %"struct.alglib_impl::xdebugrecord1", ptr %51, i32 0, i32 2
  %53 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %52, i32 0, i32 0
  %54 = load i64, ptr %53, align 8, !tbaa !19
  %55 = sub nsw i64 %54, 1
  %56 = getelementptr inbounds double, ptr %50, i64 %55
  store double %46, ptr %56, align 8, !tbaa !21
  ret void
}

declare void @_ZN11alglib_impl13rvectorresizeEPNS_9ae_vectorElPNS_8ae_stateE(ptr noundef, i64 noundef, ptr noundef) #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, !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_impl13xdebugrecord1E", !11, i64 0, !12, i64 8, !14, i64 24}
!11 = !{!"long", !7, i64 0}
!12 = !{!"_ZTSN11alglib_impl10ae_complexE", !13, i64 0, !13, i64 8}
!13 = !{!"double", !7, i64 0}
!14 = !{!"_ZTSN11alglib_impl9ae_vectorE", !11, i64 0, !11, i64 8, !15, i64 16, !16, i64 24, !7, i64 56}
!15 = !{!"bool", !7, i64 0}
!16 = !{!"_ZTSN11alglib_impl12ae_dyn_blockE", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!17 = !{!10, !13, i64 8}
!18 = !{!10, !13, i64 16}
!19 = !{!10, !11, i64 24}
!20 = !{!7, !7, i64 0}
!21 = !{!13, !13, i64 0}


; 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_impl19xdebugupdaterecord1EPNS_13xdebugrecord1EPNS_8ae_stateE(ptr noundef %0, ptr noundef %1) local_unnamed_addr #0 {
  %3 = load i64, ptr %0, align 8, !tbaa !5
  %4 = add nsw i64 %3, 1
  store i64 %4, ptr %0, align 8, !tbaa !5
  %5 = getelementptr inbounds i8, ptr %0, i64 8
  %6 = load <2 x double>, ptr %5, align 8, !tbaa !16
  %7 = fadd <2 x double> %6, <double 2.000000e+00, double 3.000000e+00>
  store <2 x double> %7, ptr %5, align 8, !tbaa !16
  %8 = getelementptr inbounds i8, ptr %0, i64 24
  %9 = load i64, ptr %8, align 8, !tbaa !17
  %10 = add nsw i64 %9, 1
  tail call void @_ZN11alglib_impl13rvectorresizeEPNS_9ae_vectorElPNS_8ae_stateE(ptr noundef nonnull %8, i64 noundef %10, ptr noundef %1)
  %11 = getelementptr inbounds i8, ptr %0, i64 80
  %12 = load ptr, ptr %11, align 8, !tbaa !18
  %13 = load i64, ptr %8, align 8, !tbaa !17
  %14 = getelementptr double, ptr %12, i64 %13
  %15 = getelementptr i8, ptr %14, i64 -16
  %16 = load double, ptr %15, align 8, !tbaa !16
  %17 = fadd double %16, 3.000000e+00
  %18 = getelementptr i8, ptr %14, i64 -8
  store double %17, ptr %18, align 8, !tbaa !16
  ret void
}

declare void @_ZN11alglib_impl13rvectorresizeEPNS_9ae_vectorElPNS_8ae_stateE(ptr noundef, i64 noundef, ptr noundef) 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_impl13xdebugrecord1E", !7, i64 0, !10, i64 8, !12, i64 24}
!7 = !{!"long", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"_ZTSN11alglib_impl10ae_complexE", !11, i64 0, !11, i64 8}
!11 = !{!"double", !8, i64 0}
!12 = !{!"_ZTSN11alglib_impl9ae_vectorE", !7, i64 0, !7, i64 8, !13, i64 16, !14, i64 24, !8, i64 56}
!13 = !{!"bool", !8, i64 0}
!14 = !{!"_ZTSN11alglib_impl12ae_dyn_blockE", !15, i64 0, !15, i64 8, !15, i64 16, !15, i64 24}
!15 = !{!"any pointer", !8, i64 0}
!16 = !{!11, !11, i64 0}
!17 = !{!6, !7, i64 24}
!18 = !{!8, !8, i64 0}


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