; 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::smoothnessmonitor" = type { i64, i64, i8, %"struct.alglib_impl::ae_vector", i64, %"struct.alglib_impl::ae_vector", %"struct.alglib_impl::ae_vector", %"struct.alglib_impl::ae_vector", %"struct.alglib_impl::ae_matrix", %"struct.alglib_impl::ae_vector", %"struct.alglib_impl::ae_vector", i64, i8, i8, double, double, i8, %"struct.alglib_impl::optguardreport", double, double, %"struct.alglib_impl::optguardnonc1test0report", %"struct.alglib_impl::optguardnonc1test0report", double, double, %"struct.alglib_impl::optguardnonc1test1report", %"struct.alglib_impl::optguardnonc1test1report", i8, %"struct.alglib_impl::ae_vector", %"struct.alglib_impl::ae_vector", %"struct.alglib_impl::ae_matrix", %"struct.alglib_impl::rcommstate", %"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", %"struct.alglib_impl::ae_vector", %"struct.alglib_impl::ae_vector", %"struct.alglib_impl::ae_vector", %"struct.alglib_impl::ae_matrix", %"struct.alglib_impl::ae_matrix", %"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", %"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", %"struct.alglib_impl::ae_matrix" }
%"struct.alglib_impl::optguardreport" = type { i8, i8, i64, double, i8, i8, i8, i64, double, i8, i64, i64, %"struct.alglib_impl::ae_vector", %"struct.alglib_impl::ae_matrix", %"struct.alglib_impl::ae_matrix" }
%"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::optguardnonc1test1report" = type { i8, i64, 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::rcommstate" = type { i32, %"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" = 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::ae_matrix" = type { i64, i64, i64, i64, i8, %"struct.alglib_impl::ae_dyn_block", %union.anon.1 }
%union.anon.1 = type { ptr }

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN11alglib_impl35smoothnessmonitorfinalizelinesearchEPNS_17smoothnessmonitorEPNS_8ae_stateE(ptr noundef, ptr noundef) #1

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN11alglib_impl29smoothnessmonitorexportreportEPNS_17smoothnessmonitorEPNS_14optguardreportEPNS_8ae_stateE(ptr noundef %0, ptr noundef %1, ptr noundef %2) #0 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  store ptr %2, ptr %6, align 8, !tbaa !5
  %7 = load ptr, ptr %4, align 8, !tbaa !5
  %8 = getelementptr inbounds %"struct.alglib_impl::smoothnessmonitor", ptr %7, i32 0, i32 4
  %9 = load i64, ptr %8, align 8, !tbaa !9
  %10 = icmp sgt i64 %9, 0
  br i1 %10, label %11, label %14

11:                                               ; preds = %3
  %12 = load ptr, ptr %4, align 8, !tbaa !5
  %13 = load ptr, ptr %6, align 8, !tbaa !5
  call void @_ZN11alglib_impl35smoothnessmonitorfinalizelinesearchEPNS_17smoothnessmonitorEPNS_8ae_stateE(ptr noundef %12, ptr noundef %13)
  br label %14

14:                                               ; preds = %11, %3
  %15 = load ptr, ptr %4, align 8, !tbaa !5
  %16 = getelementptr inbounds %"struct.alglib_impl::smoothnessmonitor", ptr %15, i32 0, i32 17
  %17 = load ptr, ptr %4, align 8, !tbaa !5
  %18 = getelementptr inbounds %"struct.alglib_impl::smoothnessmonitor", ptr %17, i32 0, i32 0
  %19 = load i64, ptr %18, align 8, !tbaa !22
  %20 = load ptr, ptr %4, align 8, !tbaa !5
  %21 = getelementptr inbounds %"struct.alglib_impl::smoothnessmonitor", ptr %20, i32 0, i32 1
  %22 = load i64, ptr %21, align 8, !tbaa !23
  %23 = load ptr, ptr %4, align 8, !tbaa !5
  %24 = getelementptr inbounds %"struct.alglib_impl::smoothnessmonitor", ptr %23, i32 0, i32 16
  %25 = load i8, ptr %24, align 8, !tbaa !24, !range !25, !noundef !26
  %26 = trunc i8 %25 to i1
  %27 = load ptr, ptr %5, align 8, !tbaa !5
  %28 = load ptr, ptr %6, align 8, !tbaa !5
  call void @_ZN11alglib_impl20optguardexportreportEPNS_14optguardreportEllbS1_PNS_8ae_stateE(ptr noundef %16, i64 noundef %19, i64 noundef %22, i1 noundef zeroext %26, ptr noundef %27, ptr noundef %28)
  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" }
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" }

!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 88}
!10 = !{!"_ZTSN11alglib_impl17smoothnessmonitorE", !11, i64 0, !11, i64 8, !12, i64 16, !13, i64 24, !11, i64 88, !13, i64 96, !13, i64 160, !13, i64 224, !15, i64 288, !13, i64 368, !13, i64 432, !11, i64 496, !12, i64 504, !12, i64 505, !16, i64 512, !16, i64 520, !12, i64 528, !17, i64 536, !16, i64 832, !16, i64 840, !18, i64 848, !18, i64 1152, !16, i64 1456, !16, i64 1464, !19, i64 1472, !19, i64 1784, !12, i64 2096, !13, i64 2104, !13, i64 2168, !15, i64 2232, !20, i64 2312, !13, i64 2576, !13, i64 2640, !13, i64 2704, !13, i64 2768, !13, i64 2832, !13, i64 2896, !13, i64 2960, !13, i64 3024, !15, i64 3088, !15, i64 3168, !13, i64 3248, !13, i64 3312, !13, i64 3376, !13, i64 3440, !13, i64 3504, !13, i64 3568, !13, i64 3632, !13, i64 3696, !13, i64 3760, !13, i64 3824, !15, i64 3888}
!11 = !{!"long", !7, i64 0}
!12 = !{!"bool", !7, i64 0}
!13 = !{!"_ZTSN11alglib_impl9ae_vectorE", !11, i64 0, !11, i64 8, !12, i64 16, !14, i64 24, !7, i64 56}
!14 = !{!"_ZTSN11alglib_impl12ae_dyn_blockE", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!15 = !{!"_ZTSN11alglib_impl9ae_matrixE", !11, i64 0, !11, i64 8, !11, i64 16, !11, i64 24, !12, i64 32, !14, i64 40, !7, i64 72}
!16 = !{!"double", !7, i64 0}
!17 = !{!"_ZTSN11alglib_impl14optguardreportE", !12, i64 0, !12, i64 1, !11, i64 8, !16, i64 16, !12, i64 24, !12, i64 25, !12, i64 26, !11, i64 32, !16, i64 40, !12, i64 48, !11, i64 56, !11, i64 64, !13, i64 72, !15, i64 136, !15, i64 216}
!18 = !{!"_ZTSN11alglib_impl24optguardnonc1test0reportE", !12, i64 0, !11, i64 8, !13, i64 16, !13, i64 80, !11, i64 144, !13, i64 152, !13, i64 216, !11, i64 280, !11, i64 288, !11, i64 296}
!19 = !{!"_ZTSN11alglib_impl24optguardnonc1test1reportE", !12, i64 0, !11, i64 8, !11, i64 16, !13, i64 24, !13, i64 88, !11, i64 152, !13, i64 160, !13, i64 224, !11, i64 288, !11, i64 296, !11, i64 304}
!20 = !{!"_ZTSN11alglib_impl10rcommstateE", !21, i64 0, !13, i64 8, !13, i64 72, !13, i64 136, !13, i64 200}
!21 = !{!"int", !7, i64 0}
!22 = !{!10, !11, i64 0}
!23 = !{!10, !11, i64 8}
!24 = !{!10, !12, i64 528}
!25 = !{i8 0, i8 2}
!26 = !{}


; 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_impl20optguardexportreportEPNS_14optguardreportEllbS1_PNS_8ae_stateE(ptr noundef, i64 noundef, i64 noundef, i1 noundef zeroext, ptr noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN11alglib_impl35smoothnessmonitorfinalizelinesearchEPNS_17smoothnessmonitorEPNS_8ae_stateE(ptr noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN11alglib_impl29smoothnessmonitorexportreportEPNS_17smoothnessmonitorEPNS_14optguardreportEPNS_8ae_stateE(ptr noundef %0, ptr noundef %1, ptr noundef %2) local_unnamed_addr #0 {
  %4 = getelementptr inbounds i8, ptr %0, i64 88
  %5 = load i64, ptr %4, align 8, !tbaa !5
  %6 = icmp sgt i64 %5, 0
  br i1 %6, label %7, label %8

7:                                                ; preds = %3
  tail call void @_ZN11alglib_impl35smoothnessmonitorfinalizelinesearchEPNS_17smoothnessmonitorEPNS_8ae_stateE(ptr noundef nonnull %0, ptr noundef %2)
  br label %8

8:                                                ; preds = %7, %3
  %9 = getelementptr inbounds i8, ptr %0, i64 536
  %10 = load i64, ptr %0, align 8, !tbaa !21
  %11 = getelementptr inbounds i8, ptr %0, i64 8
  %12 = load i64, ptr %11, align 8, !tbaa !22
  %13 = getelementptr inbounds i8, ptr %0, i64 528
  %14 = load i8, ptr %13, align 8, !tbaa !23, !range !24, !noundef !25
  %15 = trunc nuw i8 %14 to i1
  tail call void @_ZN11alglib_impl20optguardexportreportEPNS_14optguardreportEllbS1_PNS_8ae_stateE(ptr noundef nonnull %9, i64 noundef %10, i64 noundef %12, i1 noundef zeroext %15, ptr noundef %1, ptr noundef %2)
  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" }
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" }

!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 88}
!6 = !{!"_ZTSN11alglib_impl17smoothnessmonitorE", !7, i64 0, !7, i64 8, !10, i64 16, !11, i64 24, !7, i64 88, !11, i64 96, !11, i64 160, !11, i64 224, !14, i64 288, !11, i64 368, !11, i64 432, !7, i64 496, !10, i64 504, !10, i64 505, !15, i64 512, !15, i64 520, !10, i64 528, !16, i64 536, !15, i64 832, !15, i64 840, !17, i64 848, !17, i64 1152, !15, i64 1456, !15, i64 1464, !18, i64 1472, !18, i64 1784, !10, i64 2096, !11, i64 2104, !11, i64 2168, !14, i64 2232, !19, i64 2312, !11, i64 2576, !11, i64 2640, !11, i64 2704, !11, i64 2768, !11, i64 2832, !11, i64 2896, !11, i64 2960, !11, i64 3024, !14, i64 3088, !14, i64 3168, !11, i64 3248, !11, i64 3312, !11, i64 3376, !11, i64 3440, !11, i64 3504, !11, i64 3568, !11, i64 3632, !11, i64 3696, !11, i64 3760, !11, i64 3824, !14, i64 3888}
!7 = !{!"long", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"bool", !8, i64 0}
!11 = !{!"_ZTSN11alglib_impl9ae_vectorE", !7, i64 0, !7, i64 8, !10, 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 = !{!"_ZTSN11alglib_impl9ae_matrixE", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !10, i64 32, !12, i64 40, !8, i64 72}
!15 = !{!"double", !8, i64 0}
!16 = !{!"_ZTSN11alglib_impl14optguardreportE", !10, i64 0, !10, i64 1, !7, i64 8, !15, i64 16, !10, i64 24, !10, i64 25, !10, i64 26, !7, i64 32, !15, i64 40, !10, i64 48, !7, i64 56, !7, i64 64, !11, i64 72, !14, i64 136, !14, i64 216}
!17 = !{!"_ZTSN11alglib_impl24optguardnonc1test0reportE", !10, i64 0, !7, i64 8, !11, i64 16, !11, i64 80, !7, i64 144, !11, i64 152, !11, i64 216, !7, i64 280, !7, i64 288, !7, i64 296}
!18 = !{!"_ZTSN11alglib_impl24optguardnonc1test1reportE", !10, i64 0, !7, i64 8, !7, i64 16, !11, i64 24, !11, i64 88, !7, i64 152, !11, i64 160, !11, i64 224, !7, i64 288, !7, i64 296, !7, i64 304}
!19 = !{!"_ZTSN11alglib_impl10rcommstateE", !20, i64 0, !11, i64 8, !11, i64 72, !11, i64 136, !11, i64 200}
!20 = !{!"int", !8, i64 0}
!21 = !{!6, !7, i64 0}
!22 = !{!6, !7, i64 8}
!23 = !{!6, !10, i64 528}
!24 = !{i8 0, i8 2}
!25 = !{}


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