; 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::dualsimplexsettings" = type { double, double, i64, i64, i64, i64, i64, double, double, double }

@_ZN11alglib_implL35reviseddualsimplex_defaultmaxtrfageE = external hidden global i64, align 8

declare noundef double @_ZN11alglib_impl7ae_sqrtEdPNS_8ae_stateE(double noundef, ptr noundef) #0

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN11alglib_impl15dsssettingsinitEPNS_19dualsimplexsettingsEPNS_8ae_stateE(ptr noundef %0, ptr noundef %1) #1 {
  %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::dualsimplexsettings", ptr %5, i32 0, i32 7
  store double 0x3EB0C6F7A0B5ED8D, ptr %6, align 8, !tbaa !9
  %7 = load ptr, ptr %3, align 8, !tbaa !5
  %8 = getelementptr inbounds %"struct.alglib_impl::dualsimplexsettings", ptr %7, i32 0, i32 9
  store double 0x3EB0C6F7A0B5ED8D, ptr %8, align 8, !tbaa !13
  %9 = load ptr, ptr %3, align 8, !tbaa !5
  %10 = getelementptr inbounds %"struct.alglib_impl::dualsimplexsettings", ptr %9, i32 0, i32 8
  store double 1.000000e-02, ptr %10, align 8, !tbaa !14
  %11 = load ptr, ptr %4, align 8, !tbaa !5
  %12 = call noundef double @_ZN11alglib_impl7ae_sqrtEdPNS_8ae_stateE(double noundef 5.000000e-16, ptr noundef %11)
  %13 = fmul double 1.000000e+01, %12
  %14 = load ptr, ptr %3, align 8, !tbaa !5
  %15 = getelementptr inbounds %"struct.alglib_impl::dualsimplexsettings", ptr %14, i32 0, i32 0
  store double %13, ptr %15, align 8, !tbaa !15
  %16 = load ptr, ptr %3, align 8, !tbaa !5
  %17 = getelementptr inbounds %"struct.alglib_impl::dualsimplexsettings", ptr %16, i32 0, i32 0
  %18 = load double, ptr %17, align 8, !tbaa !15
  %19 = fmul double 1.000000e+01, %18
  %20 = load ptr, ptr %3, align 8, !tbaa !5
  %21 = getelementptr inbounds %"struct.alglib_impl::dualsimplexsettings", ptr %20, i32 0, i32 1
  store double %19, ptr %21, align 8, !tbaa !16
  %22 = load i64, ptr @_ZN11alglib_implL35reviseddualsimplex_defaultmaxtrfageE, align 8, !tbaa !17
  %23 = load ptr, ptr %3, align 8, !tbaa !5
  %24 = getelementptr inbounds %"struct.alglib_impl::dualsimplexsettings", ptr %23, i32 0, i32 2
  store i64 %22, ptr %24, align 8, !tbaa !18
  %25 = load ptr, ptr %3, align 8, !tbaa !5
  %26 = getelementptr inbounds %"struct.alglib_impl::dualsimplexsettings", ptr %25, i32 0, i32 3
  store i64 3, ptr %26, align 8, !tbaa !19
  %27 = load ptr, ptr %3, align 8, !tbaa !5
  %28 = getelementptr inbounds %"struct.alglib_impl::dualsimplexsettings", ptr %27, i32 0, i32 4
  store i64 1, ptr %28, align 8, !tbaa !20
  %29 = load ptr, ptr %3, align 8, !tbaa !5
  %30 = getelementptr inbounds %"struct.alglib_impl::dualsimplexsettings", ptr %29, i32 0, i32 5
  store i64 1, ptr %30, align 8, !tbaa !21
  %31 = load ptr, ptr %3, align 8, !tbaa !5
  %32 = getelementptr inbounds %"struct.alglib_impl::dualsimplexsettings", ptr %31, i32 0, i32 6
  store i64 2, ptr %32, align 8, !tbaa !22
  ret void
}

attributes #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 = { 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, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !11, i64 56}
!10 = !{!"_ZTSN11alglib_impl19dualsimplexsettingsE", !11, i64 0, !11, i64 8, !12, i64 16, !12, i64 24, !12, i64 32, !12, i64 40, !12, i64 48, !11, i64 56, !11, i64 64, !11, i64 72}
!11 = !{!"double", !7, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = !{!10, !11, i64 72}
!14 = !{!10, !11, i64 64}
!15 = !{!10, !11, i64 0}
!16 = !{!10, !11, i64 8}
!17 = !{!12, !12, i64 0}
!18 = !{!10, !12, i64 16}
!19 = !{!10, !12, i64 24}
!20 = !{!10, !12, i64 32}
!21 = !{!10, !12, i64 40}
!22 = !{!10, !12, i64 48}


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

@_ZN11alglib_implL35reviseddualsimplex_defaultmaxtrfageE = external hidden local_unnamed_addr global i64, align 8

declare noundef double @_ZN11alglib_impl7ae_sqrtEdPNS_8ae_stateE(double noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN11alglib_impl15dsssettingsinitEPNS_19dualsimplexsettingsEPNS_8ae_stateE(ptr nocapture noundef writeonly %0, ptr noundef %1) local_unnamed_addr #1 {
  %3 = getelementptr inbounds i8, ptr %0, i64 56
  %4 = getelementptr inbounds i8, ptr %0, i64 72
  store double 0x3EB0C6F7A0B5ED8D, ptr %4, align 8, !tbaa !5
  store <2 x double> <double 0x3EB0C6F7A0B5ED8D, double 1.000000e-02>, ptr %3, align 8, !tbaa !11
  %5 = tail call noundef double @_ZN11alglib_impl7ae_sqrtEdPNS_8ae_stateE(double noundef 5.000000e-16, ptr noundef %1)
  %6 = fmul double %5, 1.000000e+01
  store double %6, ptr %0, align 8, !tbaa !12
  %7 = fmul double %6, 1.000000e+01
  %8 = getelementptr inbounds i8, ptr %0, i64 8
  store double %7, ptr %8, align 8, !tbaa !13
  %9 = load i64, ptr @_ZN11alglib_implL35reviseddualsimplex_defaultmaxtrfageE, align 8, !tbaa !14
  %10 = getelementptr inbounds i8, ptr %0, i64 16
  store i64 %9, ptr %10, align 8, !tbaa !15
  %11 = getelementptr inbounds i8, ptr %0, i64 24
  store i64 3, ptr %11, align 8, !tbaa !16
  %12 = getelementptr inbounds i8, ptr %0, i64 32
  store i64 1, ptr %12, align 8, !tbaa !17
  %13 = getelementptr inbounds i8, ptr %0, i64 40
  store i64 1, ptr %13, align 8, !tbaa !18
  %14 = getelementptr inbounds i8, ptr %0, i64 48
  store i64 2, ptr %14, align 8, !tbaa !19
  ret void
}

attributes #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 = { 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 72}
!6 = !{!"_ZTSN11alglib_impl19dualsimplexsettingsE", !7, i64 0, !7, i64 8, !10, i64 16, !10, i64 24, !10, i64 32, !10, i64 40, !10, i64 48, !7, i64 56, !7, i64 64, !7, i64 72}
!7 = !{!"double", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"long", !8, i64 0}
!11 = !{!7, !7, i64 0}
!12 = !{!6, !7, i64 0}
!13 = !{!6, !7, i64 8}
!14 = !{!10, !10, i64 0}
!15 = !{!6, !10, i64 16}
!16 = !{!6, !10, i64 24}
!17 = !{!6, !10, i64 32}
!18 = !{!6, !10, i64 40}
!19 = !{!6, !10, i64 48}


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