; LLVM IR from venumb/ZSPACE :: cpp/depends/alglib/cpp/src (linalg)

; 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::ae_frame" = type { %"struct.alglib_impl::ae_dyn_block" }
%"struct.alglib_impl::ae_dyn_block" = type { ptr, ptr, ptr, ptr }
%"struct.alglib_impl::ae_vector" = type { i64, i64, i8, %"struct.alglib_impl::ae_dyn_block", %union.anon.0 }
%union.anon.0 = type { ptr }
%"struct.alglib_impl::ae_complex" = type { double, double }
%"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 }

@.str.268 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.269 = external hidden unnamed_addr constant [25 x i8], align 1

; 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 nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #1

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #3

declare noundef i64 @_ZN11alglib_impl9ae_minintEllPNS_8ae_stateE(i64 noundef, i64 noundef, ptr noundef) #2

declare noundef i64 @_ZN11alglib_impl9ae_maxintEllPNS_8ae_stateE(i64 noundef, i64 noundef, ptr noundef) #2

declare noundef zeroext i1 @_ZN11alglib_impl9ae_fp_neqEdd(double noundef, double noundef) #2

declare noundef i64 @_ZN11alglib_impl8ae_v_lenEll(i64 noundef, i64 noundef) #2

declare void @_ZN11alglib_impl13ae_frame_makeEPNS_8ae_stateEPNS_8ae_frameE(ptr noundef, ptr noundef) #2

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

declare void @_ZN11alglib_impl20ae_vector_set_lengthEPNS_9ae_vectorElPNS_8ae_stateE(ptr noundef, i64 noundef, ptr noundef) #2

declare void @_ZN11alglib_impl14ae_frame_leaveEPNS_8ae_stateE(ptr noundef) #2

declare void @_ZN11alglib_impl15ae_vector_clearEPNS_9ae_vectorE(ptr noundef) #2

declare noundef double @_ZN11alglib_impl10ae_maxrealEddPNS_8ae_stateE(double noundef, double noundef, ptr noundef) #2

declare { double, double } @_ZN11alglib_impl17ae_complex_from_dEd(double noundef) #2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN11alglib_impl13cmatrixplurecEPNS_9ae_matrixElllPNS_9ae_vectorES3_PNS_8ae_stateE(ptr noundef, i64 noundef, i64 noundef, i64 noundef, ptr noundef, ptr noundef, ptr noundef) #4

declare void @_ZN11alglib_impl10ae_v_cmulcEPNS_10ae_complexEllS0_(ptr noundef, i64 noundef, i64 noundef, double, double) #2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN11alglib_impl10cmatrixpluEPNS_9ae_matrixEllPNS_9ae_vectorEPNS_8ae_stateE(ptr noundef %0, i64 noundef %1, i64 noundef %2, ptr noundef %3, ptr noundef %4) #4 {
  %6 = alloca ptr, align 8
  %7 = alloca i64, align 8
  %8 = alloca i64, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca %"struct.alglib_impl::ae_frame", align 8
  %12 = alloca %"struct.alglib_impl::ae_vector", align 8
  %13 = alloca i64, align 8
  %14 = alloca i64, align 8
  %15 = alloca double, align 8
  %16 = alloca %"struct.alglib_impl::ae_complex", align 8
  %17 = alloca %"struct.alglib_impl::ae_complex", align 8
  %18 = alloca %"struct.alglib_impl::ae_complex", align 8
  %19 = alloca %"struct.alglib_impl::ae_complex", align 8
  %20 = alloca %"struct.alglib_impl::ae_complex", align 8
  %21 = alloca %"struct.alglib_impl::ae_complex", align 8
  store ptr %0, ptr %6, align 8, !tbaa !5
  store i64 %1, ptr %7, align 8, !tbaa !9
  store i64 %2, ptr %8, align 8, !tbaa !9
  store ptr %3, ptr %9, align 8, !tbaa !5
  store ptr %4, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 32, ptr %11) #5
  call void @llvm.lifetime.start.p0(i64 64, ptr %12) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #5
  call void @llvm.lifetime.start.p0(i64 16, ptr %16) #5
  %22 = load ptr, ptr %10, align 8, !tbaa !5
  call void @_ZN11alglib_impl13ae_frame_makeEPNS_8ae_stateEPNS_8ae_frameE(ptr noundef %22, ptr noundef %11)
  call void @llvm.memset.p0.i64(ptr align 8 %12, i8 0, i64 64, i1 false)
  %23 = load ptr, ptr %9, align 8, !tbaa !5
  call void @_ZN11alglib_impl15ae_vector_clearEPNS_9ae_vectorE(ptr noundef %23)
  %24 = load ptr, ptr %10, align 8, !tbaa !5
  call void @_ZN11alglib_impl14ae_vector_initEPNS_9ae_vectorEllPNS_8ae_stateEb(ptr noundef %12, i64 noundef 0, i64 noundef 4, ptr noundef %24, i1 noundef zeroext true)
  %25 = load i64, ptr %7, align 8, !tbaa !9
  %26 = icmp sgt i64 %25, 0
  %27 = load ptr, ptr %10, align 8, !tbaa !5
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %26, ptr noundef @.str.268, ptr noundef %27)
  %28 = load i64, ptr %8, align 8, !tbaa !9
  %29 = icmp sgt i64 %28, 0
  %30 = load ptr, ptr %10, align 8, !tbaa !5
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %29, ptr noundef @.str.269, ptr noundef %30)
  %31 = load i64, ptr %7, align 8, !tbaa !9
  %32 = load i64, ptr %8, align 8, !tbaa !9
  %33 = load ptr, ptr %10, align 8, !tbaa !5
  %34 = call noundef i64 @_ZN11alglib_impl9ae_maxintEllPNS_8ae_stateE(i64 noundef %31, i64 noundef %32, ptr noundef %33)
  %35 = mul nsw i64 2, %34
  %36 = load ptr, ptr %10, align 8, !tbaa !5
  call void @_ZN11alglib_impl20ae_vector_set_lengthEPNS_9ae_vectorElPNS_8ae_stateE(ptr noundef %12, i64 noundef %35, ptr noundef %36)
  %37 = load ptr, ptr %9, align 8, !tbaa !5
  %38 = load i64, ptr %7, align 8, !tbaa !9
  %39 = load i64, ptr %8, align 8, !tbaa !9
  %40 = load ptr, ptr %10, align 8, !tbaa !5
  %41 = call noundef i64 @_ZN11alglib_impl9ae_minintEllPNS_8ae_stateE(i64 noundef %38, i64 noundef %39, ptr noundef %40)
  %42 = load ptr, ptr %10, align 8, !tbaa !5
  call void @_ZN11alglib_impl20ae_vector_set_lengthEPNS_9ae_vectorElPNS_8ae_stateE(ptr noundef %37, i64 noundef %41, ptr noundef %42)
  store double 0.000000e+00, ptr %15, align 8, !tbaa !11
  store i64 0, ptr %13, align 8, !tbaa !9
  br label %43

43:                                               ; preds = %76, %5
  %44 = load i64, ptr %13, align 8, !tbaa !9
  %45 = load i64, ptr %7, align 8, !tbaa !9
  %46 = sub nsw i64 %45, 1
  %47 = icmp sle i64 %44, %46
  br i1 %47, label %48, label %79

48:                                               ; preds = %43
  store i64 0, ptr %14, align 8, !tbaa !9
  br label %49

49:                                               ; preds = %72, %48
  %50 = load i64, ptr %14, align 8, !tbaa !9
  %51 = load i64, ptr %8, align 8, !tbaa !9
  %52 = sub nsw i64 %51, 1
  %53 = icmp sle i64 %50, %52
  br i1 %53, label %54, label %75

54:                                               ; preds = %49
  %55 = load double, ptr %15, align 8, !tbaa !11
  %56 = load ptr, ptr %6, align 8, !tbaa !5
  %57 = getelementptr inbounds %"struct.alglib_impl::ae_matrix", ptr %56, i32 0, i32 6
  %58 = load ptr, ptr %57, align 8, !tbaa !13
  %59 = load i64, ptr %13, align 8, !tbaa !9
  %60 = getelementptr inbounds ptr, ptr %58, i64 %59
  %61 = load ptr, ptr %60, align 8, !tbaa !5
  %62 = load i64, ptr %14, align 8, !tbaa !9
  %63 = getelementptr inbounds %"struct.alglib_impl::ae_complex", ptr %61, i64 %62
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %17, ptr align 8 %63, i64 16, i1 false), !tbaa.struct !14
  %64 = load ptr, ptr %10, align 8, !tbaa !5
  %65 = getelementptr inbounds { double, double }, ptr %17, i32 0, i32 0
  %66 = load double, ptr %65, align 8
  %67 = getelementptr inbounds { double, double }, ptr %17, i32 0, i32 1
  %68 = load double, ptr %67, align 8
  %69 = call noundef double @_ZN11alglib_impl8ae_c_absENS_10ae_complexEPNS_8ae_stateE(double %66, double %68, ptr noundef %64)
  %70 = load ptr, ptr %10, align 8, !tbaa !5
  %71 = call noundef double @_ZN11alglib_impl10ae_maxrealEddPNS_8ae_stateE(double noundef %55, double noundef %69, ptr noundef %70)
  store double %71, ptr %15, align 8, !tbaa !11
  br label %72

72:                                               ; preds = %54
  %73 = load i64, ptr %14, align 8, !tbaa !9
  %74 = add nsw i64 %73, 1
  store i64 %74, ptr %14, align 8, !tbaa !9
  br label %49, !llvm.loop !15

75:                                               ; preds = %49
  br label %76

76:                                               ; preds = %75
  %77 = load i64, ptr %13, align 8, !tbaa !9
  %78 = add nsw i64 %77, 1
  store i64 %78, ptr %13, align 8, !tbaa !9
  br label %43, !llvm.loop !17

79:                                               ; preds = %43
  %80 = load double, ptr %15, align 8, !tbaa !11
  %81 = call noundef zeroext i1 @_ZN11alglib_impl9ae_fp_neqEdd(double noundef %80, double noundef 0.000000e+00)
  br i1 %81, label %82, label %114

82:                                               ; preds = %79
  call void @llvm.lifetime.start.p0(i64 16, ptr %18) #5
  %83 = load double, ptr %15, align 8, !tbaa !11
  %84 = fdiv double 1.000000e+00, %83
  %85 = call { double, double } @_ZN11alglib_impl17ae_complex_from_dEd(double noundef %84)
  %86 = getelementptr inbounds { double, double }, ptr %18, i32 0, i32 0
  %87 = extractvalue { double, double } %85, 0
  store double %87, ptr %86, align 8
  %88 = getelementptr inbounds { double, double }, ptr %18, i32 0, i32 1
  %89 = extractvalue { double, double } %85, 1
  store double %89, ptr %88, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %16, ptr align 8 %18, i64 16, i1 false), !tbaa.struct !14
  call void @llvm.lifetime.end.p0(i64 16, ptr %18) #5
  store i64 0, ptr %13, align 8, !tbaa !9
  br label %90

90:                                               ; preds = %110, %82
  %91 = load i64, ptr %13, align 8, !tbaa !9
  %92 = load i64, ptr %7, align 8, !tbaa !9
  %93 = sub nsw i64 %92, 1
  %94 = icmp sle i64 %91, %93
  br i1 %94, label %95, label %113

95:                                               ; preds = %90
  %96 = load ptr, ptr %6, align 8, !tbaa !5
  %97 = getelementptr inbounds %"struct.alglib_impl::ae_matrix", ptr %96, i32 0, i32 6
  %98 = load ptr, ptr %97, align 8, !tbaa !13
  %99 = load i64, ptr %13, align 8, !tbaa !9
  %100 = getelementptr inbounds ptr, ptr %98, i64 %99
  %101 = load ptr, ptr %100, align 8, !tbaa !5
  %102 = getelementptr inbounds %"struct.alglib_impl::ae_complex", ptr %101, i64 0
  %103 = load i64, ptr %8, align 8, !tbaa !9
  %104 = sub nsw i64 %103, 1
  %105 = call noundef i64 @_ZN11alglib_impl8ae_v_lenEll(i64 noundef 0, i64 noundef %104)
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %19, ptr align 8 %16, i64 16, i1 false), !tbaa.struct !14
  %106 = getelementptr inbounds { double, double }, ptr %19, i32 0, i32 0
  %107 = load double, ptr %106, align 8
  %108 = getelementptr inbounds { double, double }, ptr %19, i32 0, i32 1
  %109 = load double, ptr %108, align 8
  call void @_ZN11alglib_impl10ae_v_cmulcEPNS_10ae_complexEllS0_(ptr noundef %102, i64 noundef 1, i64 noundef %105, double %107, double %109)
  br label %110

110:                                              ; preds = %95
  %111 = load i64, ptr %13, align 8, !tbaa !9
  %112 = add nsw i64 %111, 1
  store i64 %112, ptr %13, align 8, !tbaa !9
  br label %90, !llvm.loop !18

113:                                              ; preds = %90
  br label %114

114:                                              ; preds = %113, %79
  %115 = load ptr, ptr %6, align 8, !tbaa !5
  %116 = load i64, ptr %7, align 8, !tbaa !9
  %117 = load i64, ptr %8, align 8, !tbaa !9
  %118 = load ptr, ptr %9, align 8, !tbaa !5
  %119 = load ptr, ptr %10, align 8, !tbaa !5
  call void @_ZN11alglib_impl13cmatrixplurecEPNS_9ae_matrixElllPNS_9ae_vectorES3_PNS_8ae_stateE(ptr noundef %115, i64 noundef 0, i64 noundef %116, i64 noundef %117, ptr noundef %118, ptr noundef %12, ptr noundef %119)
  %120 = load double, ptr %15, align 8, !tbaa !11
  %121 = call noundef zeroext i1 @_ZN11alglib_impl9ae_fp_neqEdd(double noundef %120, double noundef 0.000000e+00)
  br i1 %121, label %122, label %158

122:                                              ; preds = %114
  call void @llvm.lifetime.start.p0(i64 16, ptr %20) #5
  %123 = load double, ptr %15, align 8, !tbaa !11
  %124 = call { double, double } @_ZN11alglib_impl17ae_complex_from_dEd(double noundef %123)
  %125 = getelementptr inbounds { double, double }, ptr %20, i32 0, i32 0
  %126 = extractvalue { double, double } %124, 0
  store double %126, ptr %125, align 8
  %127 = getelementptr inbounds { double, double }, ptr %20, i32 0, i32 1
  %128 = extractvalue { double, double } %124, 1
  store double %128, ptr %127, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %16, ptr align 8 %20, i64 16, i1 false), !tbaa.struct !14
  call void @llvm.lifetime.end.p0(i64 16, ptr %20) #5
  store i64 0, ptr %13, align 8, !tbaa !9
  br label %129

129:                                              ; preds = %154, %122
  %130 = load i64, ptr %13, align 8, !tbaa !9
  %131 = load i64, ptr %7, align 8, !tbaa !9
  %132 = load i64, ptr %8, align 8, !tbaa !9
  %133 = load ptr, ptr %10, align 8, !tbaa !5
  %134 = call noundef i64 @_ZN11alglib_impl9ae_minintEllPNS_8ae_stateE(i64 noundef %131, i64 noundef %132, ptr noundef %133)
  %135 = sub nsw i64 %134, 1
  %136 = icmp sle i64 %130, %135
  br i1 %136, label %137, label %157

137:                                              ; preds = %129
  %138 = load ptr, ptr %6, align 8, !tbaa !5
  %139 = getelementptr inbounds %"struct.alglib_impl::ae_matrix", ptr %138, i32 0, i32 6
  %140 = load ptr, ptr %139, align 8, !tbaa !13
  %141 = load i64, ptr %13, align 8, !tbaa !9
  %142 = getelementptr inbounds ptr, ptr %140, i64 %141
  %143 = load ptr, ptr %142, align 8, !tbaa !5
  %144 = load i64, ptr %13, align 8, !tbaa !9
  %145 = getelementptr inbounds %"struct.alglib_impl::ae_complex", ptr %143, i64 %144
  %146 = load i64, ptr %13, align 8, !tbaa !9
  %147 = load i64, ptr %8, align 8, !tbaa !9
  %148 = sub nsw i64 %147, 1
  %149 = call noundef i64 @_ZN11alglib_impl8ae_v_lenEll(i64 noundef %146, i64 noundef %148)
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %21, ptr align 8 %16, i64 16, i1 false), !tbaa.struct !14
  %150 = getelementptr inbounds { double, double }, ptr %21, i32 0, i32 0
  %151 = load double, ptr %150, align 8
  %152 = getelementptr inbounds { double, double }, ptr %21, i32 0, i32 1
  %153 = load double, ptr %152, align 8
  call void @_ZN11alglib_impl10ae_v_cmulcEPNS_10ae_complexEllS0_(ptr noundef %145, i64 noundef 1, i64 noundef %149, double %151, double %153)
  br label %154

154:                                              ; preds = %137
  %155 = load i64, ptr %13, align 8, !tbaa !9
  %156 = add nsw i64 %155, 1
  store i64 %156, ptr %13, align 8, !tbaa !9
  br label %129, !llvm.loop !19

157:                                              ; preds = %129
  br label %158

158:                                              ; preds = %157, %114
  %159 = load ptr, ptr %10, align 8, !tbaa !5
  call void @_ZN11alglib_impl14ae_frame_leaveEPNS_8ae_stateE(ptr noundef %159)
  call void @llvm.lifetime.end.p0(i64 16, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 64, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %11) #5
  ret void
}

declare noundef double @_ZN11alglib_impl8ae_c_absENS_10ae_complexEPNS_8ae_stateE(double, double, ptr noundef) #2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: write) }
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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { 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 #5 = { 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 = !{!"long", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"double", !7, i64 0}
!13 = !{!7, !7, i64 0}
!14 = !{i64 0, i64 8, !11, i64 8, i64 8, !11}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}
!17 = distinct !{!17, !16}
!18 = distinct !{!18, !16}
!19 = distinct !{!19, !16}


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

%"struct.alglib_impl::ae_frame" = type { %"struct.alglib_impl::ae_dyn_block" }
%"struct.alglib_impl::ae_dyn_block" = type { ptr, ptr, ptr, ptr }
%"struct.alglib_impl::ae_vector" = type { i64, i64, i8, %"struct.alglib_impl::ae_dyn_block", %union.anon.0 }
%union.anon.0 = type { ptr }
%"struct.alglib_impl::ae_complex" = type { double, double }

@.str.268 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.269 = external hidden unnamed_addr constant [25 x i8], align 1

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #1

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

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

declare noundef i64 @_ZN11alglib_impl9ae_minintEllPNS_8ae_stateE(i64 noundef, i64 noundef, ptr noundef) local_unnamed_addr #2

declare noundef i64 @_ZN11alglib_impl9ae_maxintEllPNS_8ae_stateE(i64 noundef, i64 noundef, ptr noundef) local_unnamed_addr #2

declare noundef zeroext i1 @_ZN11alglib_impl9ae_fp_neqEdd(double noundef, double noundef) local_unnamed_addr #2

declare noundef i64 @_ZN11alglib_impl8ae_v_lenEll(i64 noundef, i64 noundef) local_unnamed_addr #2

declare void @_ZN11alglib_impl13ae_frame_makeEPNS_8ae_stateEPNS_8ae_frameE(ptr noundef, ptr noundef) local_unnamed_addr #2

declare void @_ZN11alglib_impl14ae_vector_initEPNS_9ae_vectorEllPNS_8ae_stateEb(ptr noundef, i64 noundef, i64 noundef, ptr noundef, i1 noundef zeroext) local_unnamed_addr #2

declare void @_ZN11alglib_impl20ae_vector_set_lengthEPNS_9ae_vectorElPNS_8ae_stateE(ptr noundef, i64 noundef, ptr noundef) local_unnamed_addr #2

declare void @_ZN11alglib_impl14ae_frame_leaveEPNS_8ae_stateE(ptr noundef) local_unnamed_addr #2

declare void @_ZN11alglib_impl15ae_vector_clearEPNS_9ae_vectorE(ptr noundef) local_unnamed_addr #2

declare noundef double @_ZN11alglib_impl10ae_maxrealEddPNS_8ae_stateE(double noundef, double noundef, ptr noundef) local_unnamed_addr #2

declare { double, double } @_ZN11alglib_impl17ae_complex_from_dEd(double noundef) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN11alglib_impl13cmatrixplurecEPNS_9ae_matrixElllPNS_9ae_vectorES3_PNS_8ae_stateE(ptr noundef, i64 noundef, i64 noundef, i64 noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #3

declare void @_ZN11alglib_impl10ae_v_cmulcEPNS_10ae_complexEllS0_(ptr noundef, i64 noundef, i64 noundef, double, double) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN11alglib_impl10cmatrixpluEPNS_9ae_matrixEllPNS_9ae_vectorEPNS_8ae_stateE(ptr noundef %0, i64 noundef %1, i64 noundef %2, ptr noundef %3, ptr noundef %4) local_unnamed_addr #3 {
  %6 = alloca %"struct.alglib_impl::ae_frame", align 8
  %7 = alloca %"struct.alglib_impl::ae_vector", align 8
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %6) #4
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %7) #4
  call void @_ZN11alglib_impl13ae_frame_makeEPNS_8ae_stateEPNS_8ae_frameE(ptr noundef %4, ptr noundef nonnull %6)
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(64) %7, i8 0, i64 64, i1 false)
  call void @_ZN11alglib_impl15ae_vector_clearEPNS_9ae_vectorE(ptr noundef %3)
  call void @_ZN11alglib_impl14ae_vector_initEPNS_9ae_vectorEllPNS_8ae_stateEb(ptr noundef nonnull %7, i64 noundef 0, i64 noundef 4, ptr noundef %4, i1 noundef zeroext true)
  %8 = icmp sgt i64 %1, 0
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %8, ptr noundef nonnull @.str.268, ptr noundef %4)
  %9 = icmp sgt i64 %2, 0
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %9, ptr noundef nonnull @.str.269, ptr noundef %4)
  %10 = call noundef i64 @_ZN11alglib_impl9ae_maxintEllPNS_8ae_stateE(i64 noundef %1, i64 noundef %2, ptr noundef %4)
  %11 = shl nsw i64 %10, 1
  call void @_ZN11alglib_impl20ae_vector_set_lengthEPNS_9ae_vectorElPNS_8ae_stateE(ptr noundef nonnull %7, i64 noundef %11, ptr noundef %4)
  %12 = call noundef i64 @_ZN11alglib_impl9ae_minintEllPNS_8ae_stateE(i64 noundef %1, i64 noundef %2, ptr noundef %4)
  call void @_ZN11alglib_impl20ae_vector_set_lengthEPNS_9ae_vectorElPNS_8ae_stateE(ptr noundef %3, i64 noundef %12, ptr noundef %4)
  br i1 %8, label %.preheader.lr.ph, label %._crit_edge75

.preheader.lr.ph:                                 ; preds = %5
  %13 = getelementptr inbounds i8, ptr %0, i64 72
  br i1 %9, label %.preheader.us, label %._crit_edge75

.preheader.us:                                    ; preds = %.preheader.lr.ph, %._crit_edge.us
  %.074.us = phi i64 [ %22, %._crit_edge.us ], [ 0, %.preheader.lr.ph ]
  %.06273.us = phi double [ %20, %._crit_edge.us ], [ 0.000000e+00, %.preheader.lr.ph ]
  br label %14

14:                                               ; preds = %.preheader.us, %14
  %.06171.us = phi i64 [ 0, %.preheader.us ], [ %21, %14 ]
  %.16370.us = phi double [ %.06273.us, %.preheader.us ], [ %20, %14 ]
  %15 = load ptr, ptr %13, align 8, !tbaa !5
  %16 = getelementptr inbounds ptr, ptr %15, i64 %.074.us
  %17 = load ptr, ptr %16, align 8, !tbaa !8
  %18 = getelementptr inbounds %"struct.alglib_impl::ae_complex", ptr %17, i64 %.06171.us
  %.sroa.06.0.copyload.us = load double, ptr %18, align 8, !tbaa !10
  %.sroa.27.0..sroa_idx.us = getelementptr inbounds i8, ptr %18, i64 8
  %.sroa.27.0.copyload.us = load double, ptr %.sroa.27.0..sroa_idx.us, align 8, !tbaa !10
  %19 = call noundef double @_ZN11alglib_impl8ae_c_absENS_10ae_complexEPNS_8ae_stateE(double %.sroa.06.0.copyload.us, double %.sroa.27.0.copyload.us, ptr noundef %4)
  %20 = call noundef double @_ZN11alglib_impl10ae_maxrealEddPNS_8ae_stateE(double noundef %.16370.us, double noundef %19, ptr noundef %4)
  %21 = add nuw nsw i64 %.06171.us, 1
  %exitcond.not = icmp eq i64 %21, %2
  br i1 %exitcond.not, label %._crit_edge.us, label %14, !llvm.loop !12

._crit_edge.us:                                   ; preds = %14
  %22 = add nuw nsw i64 %.074.us, 1
  %exitcond83.not = icmp eq i64 %22, %1
  br i1 %exitcond83.not, label %._crit_edge75, label %.preheader.us, !llvm.loop !14

._crit_edge75:                                    ; preds = %._crit_edge.us, %.preheader.lr.ph, %5
  %.062.lcssa = phi double [ 0.000000e+00, %5 ], [ 0.000000e+00, %.preheader.lr.ph ], [ %20, %._crit_edge.us ]
  %23 = call noundef zeroext i1 @_ZN11alglib_impl9ae_fp_neqEdd(double noundef %.062.lcssa, double noundef 0.000000e+00)
  br i1 %23, label %24, label %.loopexit68

24:                                               ; preds = %._crit_edge75
  %25 = fdiv double 1.000000e+00, %.062.lcssa
  %26 = call { double, double } @_ZN11alglib_impl17ae_complex_from_dEd(double noundef %25)
  %27 = extractvalue { double, double } %26, 0
  %28 = extractvalue { double, double } %26, 1
  br i1 %8, label %.lr.ph, label %.loopexit68

.lr.ph:                                           ; preds = %24
  %29 = getelementptr inbounds i8, ptr %0, i64 72
  %30 = add nsw i64 %2, -1
  br label %31

31:                                               ; preds = %.lr.ph, %31
  %.178 = phi i64 [ 0, %.lr.ph ], [ %36, %31 ]
  %32 = load ptr, ptr %29, align 8, !tbaa !5
  %33 = getelementptr inbounds ptr, ptr %32, i64 %.178
  %34 = load ptr, ptr %33, align 8, !tbaa !8
  %35 = call noundef i64 @_ZN11alglib_impl8ae_v_lenEll(i64 noundef 0, i64 noundef %30)
  call void @_ZN11alglib_impl10ae_v_cmulcEPNS_10ae_complexEllS0_(ptr noundef %34, i64 noundef 1, i64 noundef %35, double %27, double %28)
  %36 = add nuw nsw i64 %.178, 1
  %exitcond84.not = icmp eq i64 %36, %1
  br i1 %exitcond84.not, label %.loopexit68, label %31, !llvm.loop !15

.loopexit68:                                      ; preds = %31, %24, %._crit_edge75
  call void @_ZN11alglib_impl13cmatrixplurecEPNS_9ae_matrixElllPNS_9ae_vectorES3_PNS_8ae_stateE(ptr noundef %0, i64 noundef 0, i64 noundef %1, i64 noundef %2, ptr noundef %3, ptr noundef nonnull %7, ptr noundef %4)
  %37 = call noundef zeroext i1 @_ZN11alglib_impl9ae_fp_neqEdd(double noundef %.062.lcssa, double noundef 0.000000e+00)
  br i1 %37, label %38, label %.loopexit

38:                                               ; preds = %.loopexit68
  %39 = call { double, double } @_ZN11alglib_impl17ae_complex_from_dEd(double noundef %.062.lcssa)
  %40 = extractvalue { double, double } %39, 0
  %41 = extractvalue { double, double } %39, 1
  %42 = call noundef i64 @_ZN11alglib_impl9ae_minintEllPNS_8ae_stateE(i64 noundef %1, i64 noundef %2, ptr noundef %4)
  %.not.not6679 = icmp sgt i64 %42, 0
  br i1 %.not.not6679, label %.lr.ph81, label %.loopexit

.lr.ph81:                                         ; preds = %38
  %43 = getelementptr inbounds i8, ptr %0, i64 72
  %44 = add nsw i64 %2, -1
  br label %45

45:                                               ; preds = %.lr.ph81, %45
  %.280 = phi i64 [ 0, %.lr.ph81 ], [ %51, %45 ]
  %46 = load ptr, ptr %43, align 8, !tbaa !5
  %47 = getelementptr inbounds ptr, ptr %46, i64 %.280
  %48 = load ptr, ptr %47, align 8, !tbaa !8
  %49 = getelementptr inbounds %"struct.alglib_impl::ae_complex", ptr %48, i64 %.280
  %50 = call noundef i64 @_ZN11alglib_impl8ae_v_lenEll(i64 noundef %.280, i64 noundef %44)
  call void @_ZN11alglib_impl10ae_v_cmulcEPNS_10ae_complexEllS0_(ptr noundef %49, i64 noundef 1, i64 noundef %50, double %40, double %41)
  %51 = add nuw nsw i64 %.280, 1
  %52 = call noundef i64 @_ZN11alglib_impl9ae_minintEllPNS_8ae_stateE(i64 noundef %1, i64 noundef %2, ptr noundef %4)
  %.not.not66 = icmp slt i64 %51, %52
  br i1 %.not.not66, label %45, label %.loopexit, !llvm.loop !16

.loopexit:                                        ; preds = %45, %38, %.loopexit68
  call void @_ZN11alglib_impl14ae_frame_leaveEPNS_8ae_stateE(ptr noundef %4)
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %7) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %6) #4
  ret void
}

declare noundef double @_ZN11alglib_impl8ae_c_absENS_10ae_complexEPNS_8ae_stateE(double, double, ptr noundef) local_unnamed_addr #2

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
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 = { 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 #4 = { 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 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"any pointer", !6, i64 0}
!10 = !{!11, !11, i64 0}
!11 = !{!"double", !6, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = distinct !{!14, !13}
!15 = distinct !{!15, !13}
!16 = distinct !{!16, !13}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopInstSimplifyPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass