; 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_matrix" = type { i64, i64, i64, i64, i8, %"struct.alglib_impl::ae_dyn_block", %union.anon.1 }
%union.anon.1 = type { 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.274 = external hidden unnamed_addr constant [20 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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef double @_ZN11alglib_impl13cmatrixrcond1EPNS_9ae_matrixElPNS_8ae_stateE(ptr noundef %0, i64 noundef %1, ptr noundef %2) #4 {
  %4 = alloca ptr, align 8
  %5 = alloca i64, align 8
  %6 = alloca ptr, align 8
  %7 = alloca %"struct.alglib_impl::ae_frame", align 8
  %8 = alloca %"struct.alglib_impl::ae_matrix", align 8
  %9 = alloca i64, align 8
  %10 = alloca i64, align 8
  %11 = alloca double, align 8
  %12 = alloca double, align 8
  %13 = alloca %"struct.alglib_impl::ae_vector", align 8
  %14 = alloca %"struct.alglib_impl::ae_vector", align 8
  %15 = alloca double, align 8
  %16 = alloca %"struct.alglib_impl::ae_complex", align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  store i64 %1, ptr %5, align 8, !tbaa !9
  store ptr %2, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 32, ptr %7) #5
  call void @llvm.lifetime.start.p0(i64 80, ptr %8) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  call void @llvm.lifetime.start.p0(i64 64, ptr %13) #5
  call void @llvm.lifetime.start.p0(i64 64, ptr %14) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #5
  %17 = load ptr, ptr %6, align 8, !tbaa !5
  call void @_ZN11alglib_impl13ae_frame_makeEPNS_8ae_stateEPNS_8ae_frameE(ptr noundef %17, ptr noundef %7)
  call void @llvm.memset.p0.i64(ptr align 8 %8, i8 0, i64 80, i1 false)
  call void @llvm.memset.p0.i64(ptr align 8 %13, i8 0, i64 64, i1 false)
  call void @llvm.memset.p0.i64(ptr align 8 %14, i8 0, i64 64, i1 false)
  %18 = load ptr, ptr %4, align 8, !tbaa !5
  %19 = load ptr, ptr %6, align 8, !tbaa !5
  call void @_ZN11alglib_impl19ae_matrix_init_copyEPNS_9ae_matrixES1_PNS_8ae_stateEb(ptr noundef %8, ptr noundef %18, ptr noundef %19, i1 noundef zeroext true)
  store ptr %8, ptr %4, align 8, !tbaa !5
  %20 = load ptr, ptr %6, align 8, !tbaa !5
  call void @_ZN11alglib_impl14ae_vector_initEPNS_9ae_vectorEllPNS_8ae_stateEb(ptr noundef %13, i64 noundef 0, i64 noundef 2, ptr noundef %20, i1 noundef zeroext true)
  %21 = load ptr, ptr %6, align 8, !tbaa !5
  call void @_ZN11alglib_impl14ae_vector_initEPNS_9ae_vectorEllPNS_8ae_stateEb(ptr noundef %14, i64 noundef 0, i64 noundef 3, ptr noundef %21, i1 noundef zeroext true)
  %22 = load i64, ptr %5, align 8, !tbaa !9
  %23 = icmp sge i64 %22, 1
  %24 = load ptr, ptr %6, align 8, !tbaa !5
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %23, ptr noundef @.str.274, ptr noundef %24)
  %25 = load i64, ptr %5, align 8, !tbaa !9
  %26 = load ptr, ptr %6, align 8, !tbaa !5
  call void @_ZN11alglib_impl20ae_vector_set_lengthEPNS_9ae_vectorElPNS_8ae_stateE(ptr noundef %14, i64 noundef %25, ptr noundef %26)
  store i64 0, ptr %9, align 8, !tbaa !9
  br label %27

27:                                               ; preds = %37, %3
  %28 = load i64, ptr %9, align 8, !tbaa !9
  %29 = load i64, ptr %5, align 8, !tbaa !9
  %30 = sub nsw i64 %29, 1
  %31 = icmp sle i64 %28, %30
  br i1 %31, label %32, label %40

32:                                               ; preds = %27
  %33 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %14, i32 0, i32 4
  %34 = load ptr, ptr %33, align 8, !tbaa !11
  %35 = load i64, ptr %9, align 8, !tbaa !9
  %36 = getelementptr inbounds double, ptr %34, i64 %35
  store double 0.000000e+00, ptr %36, align 8, !tbaa !12
  br label %37

37:                                               ; preds = %32
  %38 = load i64, ptr %9, align 8, !tbaa !9
  %39 = add nsw i64 %38, 1
  store i64 %39, ptr %9, align 8, !tbaa !9
  br label %27, !llvm.loop !14

40:                                               ; preds = %27
  store i64 0, ptr %9, align 8, !tbaa !9
  br label %41

41:                                               ; preds = %81, %40
  %42 = load i64, ptr %9, align 8, !tbaa !9
  %43 = load i64, ptr %5, align 8, !tbaa !9
  %44 = sub nsw i64 %43, 1
  %45 = icmp sle i64 %42, %44
  br i1 %45, label %46, label %84

46:                                               ; preds = %41
  store i64 0, ptr %10, align 8, !tbaa !9
  br label %47

47:                                               ; preds = %77, %46
  %48 = load i64, ptr %10, align 8, !tbaa !9
  %49 = load i64, ptr %5, align 8, !tbaa !9
  %50 = sub nsw i64 %49, 1
  %51 = icmp sle i64 %48, %50
  br i1 %51, label %52, label %80

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

77:                                               ; preds = %52
  %78 = load i64, ptr %10, align 8, !tbaa !9
  %79 = add nsw i64 %78, 1
  store i64 %79, ptr %10, align 8, !tbaa !9
  br label %47, !llvm.loop !17

80:                                               ; preds = %47
  br label %81

81:                                               ; preds = %80
  %82 = load i64, ptr %9, align 8, !tbaa !9
  %83 = add nsw i64 %82, 1
  store i64 %83, ptr %9, align 8, !tbaa !9
  br label %41, !llvm.loop !18

84:                                               ; preds = %41
  store double 0.000000e+00, ptr %12, align 8, !tbaa !12
  store i64 0, ptr %9, align 8, !tbaa !9
  br label %85

85:                                               ; preds = %99, %84
  %86 = load i64, ptr %9, align 8, !tbaa !9
  %87 = load i64, ptr %5, align 8, !tbaa !9
  %88 = sub nsw i64 %87, 1
  %89 = icmp sle i64 %86, %88
  br i1 %89, label %90, label %102

90:                                               ; preds = %85
  %91 = load double, ptr %12, align 8, !tbaa !12
  %92 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %14, i32 0, i32 4
  %93 = load ptr, ptr %92, align 8, !tbaa !11
  %94 = load i64, ptr %9, align 8, !tbaa !9
  %95 = getelementptr inbounds double, ptr %93, i64 %94
  %96 = load double, ptr %95, align 8, !tbaa !12
  %97 = load ptr, ptr %6, align 8, !tbaa !5
  %98 = call noundef double @_ZN11alglib_impl10ae_maxrealEddPNS_8ae_stateE(double noundef %91, double noundef %96, ptr noundef %97)
  store double %98, ptr %12, align 8, !tbaa !12
  br label %99

99:                                               ; preds = %90
  %100 = load i64, ptr %9, align 8, !tbaa !9
  %101 = add nsw i64 %100, 1
  store i64 %101, ptr %9, align 8, !tbaa !9
  br label %85, !llvm.loop !19

102:                                              ; preds = %85
  %103 = load ptr, ptr %4, align 8, !tbaa !5
  %104 = load i64, ptr %5, align 8, !tbaa !9
  %105 = load i64, ptr %5, align 8, !tbaa !9
  %106 = load ptr, ptr %6, align 8, !tbaa !5
  call void @_ZN11alglib_impl9cmatrixluEPNS_9ae_matrixEllPNS_9ae_vectorEPNS_8ae_stateE(ptr noundef %103, i64 noundef %104, i64 noundef %105, ptr noundef %13, ptr noundef %106)
  %107 = load ptr, ptr %4, align 8, !tbaa !5
  %108 = load i64, ptr %5, align 8, !tbaa !9
  %109 = load double, ptr %12, align 8, !tbaa !12
  %110 = load ptr, ptr %6, align 8, !tbaa !5
  call void @_ZN11alglib_implL28rcond_cmatrixrcondluinternalEPNS_9ae_matrixElbbdPdPNS_8ae_stateE(ptr noundef %107, i64 noundef %108, i1 noundef zeroext true, i1 noundef zeroext true, double noundef %109, ptr noundef %11, ptr noundef %110)
  %111 = load double, ptr %11, align 8, !tbaa !12
  store double %111, ptr %15, align 8, !tbaa !12
  %112 = load ptr, ptr %6, align 8, !tbaa !5
  call void @_ZN11alglib_impl14ae_frame_leaveEPNS_8ae_stateE(ptr noundef %112)
  %113 = load double, ptr %15, align 8, !tbaa !12
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 64, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 64, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 80, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %7) #5
  ret double %113
}

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 noundef double @_ZN11alglib_impl10ae_maxrealEddPNS_8ae_stateE(double noundef, double noundef, ptr noundef) #2

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

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

; Function Attrs: mustprogress uwtable
declare hidden void @_ZN11alglib_implL28rcond_cmatrixrcondluinternalEPNS_9ae_matrixElbbdPdPNS_8ae_stateE(ptr noundef, i64 noundef, i1 noundef zeroext, i1 noundef zeroext, double noundef, ptr noundef, ptr noundef) #4

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 = !{!7, !7, i64 0}
!12 = !{!13, !13, i64 0}
!13 = !{!"double", !7, i64 0}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}
!16 = !{i64 0, i64 8, !12, i64 8, i64 8, !12}
!17 = distinct !{!17, !15}
!18 = distinct !{!18, !15}
!19 = distinct !{!19, !15}


; 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_matrix" = type { i64, i64, i64, i64, i8, %"struct.alglib_impl::ae_dyn_block", %union.anon.1 }
%union.anon.1 = type { 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.274 = external hidden unnamed_addr constant [20 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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef double @_ZN11alglib_impl13cmatrixrcond1EPNS_9ae_matrixElPNS_8ae_stateE(ptr noundef %0, i64 noundef %1, ptr noundef %2) local_unnamed_addr #3 {
  %4 = alloca %"struct.alglib_impl::ae_frame", align 8
  %5 = alloca %"struct.alglib_impl::ae_matrix", align 8
  %6 = alloca double, align 8
  %7 = alloca %"struct.alglib_impl::ae_vector", align 8
  %8 = alloca %"struct.alglib_impl::ae_vector", align 8
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %4) #4
  call void @llvm.lifetime.start.p0(i64 80, ptr nonnull %5) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #4
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %7) #4
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %8) #4
  call void @_ZN11alglib_impl13ae_frame_makeEPNS_8ae_stateEPNS_8ae_frameE(ptr noundef %2, ptr noundef nonnull %4)
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(80) %5, i8 0, i64 80, i1 false)
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(64) %7, i8 0, i64 64, i1 false)
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(64) %8, i8 0, i64 64, i1 false)
  call void @_ZN11alglib_impl19ae_matrix_init_copyEPNS_9ae_matrixES1_PNS_8ae_stateEb(ptr noundef nonnull %5, ptr noundef %0, ptr noundef %2, i1 noundef zeroext true)
  call void @_ZN11alglib_impl14ae_vector_initEPNS_9ae_vectorEllPNS_8ae_stateEb(ptr noundef nonnull %7, i64 noundef 0, i64 noundef 2, ptr noundef %2, i1 noundef zeroext true)
  call void @_ZN11alglib_impl14ae_vector_initEPNS_9ae_vectorEllPNS_8ae_stateEb(ptr noundef nonnull %8, i64 noundef 0, i64 noundef 3, ptr noundef %2, i1 noundef zeroext true)
  %9 = icmp sgt i64 %1, 0
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %9, ptr noundef nonnull @.str.274, ptr noundef %2)
  call void @_ZN11alglib_impl20ae_vector_set_lengthEPNS_9ae_vectorElPNS_8ae_stateE(ptr noundef nonnull %8, i64 noundef %1, ptr noundef %2)
  br i1 %9, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %3
  %10 = getelementptr inbounds i8, ptr %8, i64 56
  %xtraiter = and i64 %1, 3
  %11 = icmp ult i64 %1, 4
  br i1 %11, label %.preheader47.unr-lcssa, label %.lr.ph.new

.lr.ph.new:                                       ; preds = %.lr.ph
  %unroll_iter = and i64 %1, 9223372036854775804
  br label %31

.preheader47.unr-lcssa:                           ; preds = %31, %.lr.ph
  %.049.unr = phi i64 [ 0, %.lr.ph ], [ %43, %31 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.preheader47, label %.epil.preheader

.epil.preheader:                                  ; preds = %.preheader47.unr-lcssa, %.epil.preheader
  %.049.epil = phi i64 [ %14, %.epil.preheader ], [ %.049.unr, %.preheader47.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.epil.preheader ], [ 0, %.preheader47.unr-lcssa ]
  %12 = load ptr, ptr %10, align 8, !tbaa !5
  %13 = getelementptr inbounds double, ptr %12, i64 %.049.epil
  store double 0.000000e+00, ptr %13, align 8, !tbaa !8
  %14 = add nuw nsw i64 %.049.epil, 1
  %epil.iter.next = add i64 %epil.iter, 1
  %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
  br i1 %epil.iter.cmp.not, label %.preheader47, label %.epil.preheader, !llvm.loop !10

.preheader47:                                     ; preds = %.epil.preheader, %.preheader47.unr-lcssa
  br i1 %9, label %.preheader46.lr.ph, label %._crit_edge

.preheader46.lr.ph:                               ; preds = %.preheader47
  %15 = getelementptr inbounds i8, ptr %8, i64 56
  %16 = getelementptr inbounds i8, ptr %5, i64 72
  br label %.preheader46.us

.preheader46.us:                                  ; preds = %._crit_edge.us, %.preheader46.lr.ph
  %.154.us = phi i64 [ 0, %.preheader46.lr.ph ], [ %30, %._crit_edge.us ]
  br label %17

17:                                               ; preds = %.preheader46.us, %17
  %.04051.us = phi i64 [ 0, %.preheader46.us ], [ %29, %17 ]
  %18 = load ptr, ptr %15, align 8, !tbaa !5
  %19 = getelementptr inbounds double, ptr %18, i64 %.04051.us
  %20 = load double, ptr %19, align 8, !tbaa !8
  %21 = load ptr, ptr %16, align 8, !tbaa !5
  %22 = getelementptr inbounds ptr, ptr %21, i64 %.154.us
  %23 = load ptr, ptr %22, align 8, !tbaa !12
  %24 = getelementptr inbounds %"struct.alglib_impl::ae_complex", ptr %23, i64 %.04051.us
  %.sroa.0.0.copyload.us = load double, ptr %24, align 8, !tbaa !8
  %.sroa.2.0..sroa_idx.us = getelementptr inbounds i8, ptr %24, i64 8
  %.sroa.2.0.copyload.us = load double, ptr %.sroa.2.0..sroa_idx.us, align 8, !tbaa !8
  %25 = call noundef double @_ZN11alglib_impl8ae_c_absENS_10ae_complexEPNS_8ae_stateE(double %.sroa.0.0.copyload.us, double %.sroa.2.0.copyload.us, ptr noundef %2)
  %26 = fadd double %20, %25
  %27 = load ptr, ptr %15, align 8, !tbaa !5
  %28 = getelementptr inbounds double, ptr %27, i64 %.04051.us
  store double %26, ptr %28, align 8, !tbaa !8
  %29 = add nuw nsw i64 %.04051.us, 1
  %exitcond59.not = icmp eq i64 %29, %1
  br i1 %exitcond59.not, label %._crit_edge.us, label %17, !llvm.loop !14

._crit_edge.us:                                   ; preds = %17
  %30 = add nuw nsw i64 %.154.us, 1
  %exitcond60.not = icmp eq i64 %30, %1
  br i1 %exitcond60.not, label %.preheader, label %.preheader46.us, !llvm.loop !16

31:                                               ; preds = %31, %.lr.ph.new
  %.049 = phi i64 [ 0, %.lr.ph.new ], [ %43, %31 ]
  %niter = phi i64 [ 0, %.lr.ph.new ], [ %niter.next.3, %31 ]
  %32 = load ptr, ptr %10, align 8, !tbaa !5
  %33 = getelementptr inbounds double, ptr %32, i64 %.049
  store double 0.000000e+00, ptr %33, align 8, !tbaa !8
  %34 = or disjoint i64 %.049, 1
  %35 = load ptr, ptr %10, align 8, !tbaa !5
  %36 = getelementptr inbounds double, ptr %35, i64 %34
  store double 0.000000e+00, ptr %36, align 8, !tbaa !8
  %37 = or disjoint i64 %.049, 2
  %38 = load ptr, ptr %10, align 8, !tbaa !5
  %39 = getelementptr inbounds double, ptr %38, i64 %37
  store double 0.000000e+00, ptr %39, align 8, !tbaa !8
  %40 = or disjoint i64 %.049, 3
  %41 = load ptr, ptr %10, align 8, !tbaa !5
  %42 = getelementptr inbounds double, ptr %41, i64 %40
  store double 0.000000e+00, ptr %42, align 8, !tbaa !8
  %43 = add nuw nsw i64 %.049, 4
  %niter.next.3 = add i64 %niter, 4
  %niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
  br i1 %niter.ncmp.3, label %.preheader47.unr-lcssa, label %31, !llvm.loop !17

.preheader:                                       ; preds = %._crit_edge.us
  br i1 %9, label %.lr.ph58, label %._crit_edge

.lr.ph58:                                         ; preds = %.preheader
  %44 = getelementptr inbounds i8, ptr %8, i64 56
  br label %45

45:                                               ; preds = %.lr.ph58, %45
  %.257 = phi i64 [ 0, %.lr.ph58 ], [ %50, %45 ]
  %.04156 = phi double [ 0.000000e+00, %.lr.ph58 ], [ %49, %45 ]
  %46 = load ptr, ptr %44, align 8, !tbaa !5
  %47 = getelementptr inbounds double, ptr %46, i64 %.257
  %48 = load double, ptr %47, align 8, !tbaa !8
  %49 = call noundef double @_ZN11alglib_impl10ae_maxrealEddPNS_8ae_stateE(double noundef %.04156, double noundef %48, ptr noundef %2)
  %50 = add nuw nsw i64 %.257, 1
  %exitcond61.not = icmp eq i64 %50, %1
  br i1 %exitcond61.not, label %._crit_edge, label %45, !llvm.loop !18

._crit_edge:                                      ; preds = %45, %3, %.preheader47, %.preheader
  %.041.lcssa = phi double [ 0.000000e+00, %.preheader ], [ 0.000000e+00, %.preheader47 ], [ 0.000000e+00, %3 ], [ %49, %45 ]
  call void @_ZN11alglib_impl9cmatrixluEPNS_9ae_matrixEllPNS_9ae_vectorEPNS_8ae_stateE(ptr noundef nonnull %5, i64 noundef %1, i64 noundef %1, ptr noundef nonnull %7, ptr noundef %2)
  call void @_ZN11alglib_implL28rcond_cmatrixrcondluinternalEPNS_9ae_matrixElbbdPdPNS_8ae_stateE(ptr noundef nonnull %5, i64 noundef %1, i1 noundef zeroext true, i1 noundef zeroext true, double noundef %.041.lcssa, ptr noundef nonnull %6, ptr noundef %2)
  %51 = load double, ptr %6, align 8, !tbaa !8
  call void @_ZN11alglib_impl14ae_frame_leaveEPNS_8ae_stateE(ptr noundef %2)
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %8) #4
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %7) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #4
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %5) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %4) #4
  ret double %51
}

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 noundef double @_ZN11alglib_impl10ae_maxrealEddPNS_8ae_stateE(double noundef, double noundef, ptr noundef) local_unnamed_addr #2

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

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

; Function Attrs: mustprogress uwtable
declare hidden void @_ZN11alglib_implL28rcond_cmatrixrcondluinternalEPNS_9ae_matrixElbbdPdPNS_8ae_stateE(ptr noundef, i64 noundef, i1 noundef zeroext, i1 noundef zeroext, double noundef, ptr noundef, ptr noundef) local_unnamed_addr #3

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 = !{!"double", !6, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.unroll.disable"}
!12 = !{!13, !13, i64 0}
!13 = !{!"any pointer", !6, i64 0}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}
!16 = distinct !{!16, !15}
!17 = distinct !{!17, !15}
!18 = distinct !{!18, !15}


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