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

; 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.0 }
%union.anon.0 = type { ptr }
%"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.1 }
%union.anon.1 = type { ptr }

; 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

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

30:                                               ; preds = %6
  %31 = load i64, ptr %10, align 8, !tbaa !9
  %32 = icmp sle i64 %31, 0
  br i1 %32, label %33, label %36

33:                                               ; preds = %30, %6
  %34 = load ptr, ptr %11, align 8, !tbaa !5
  store i64 -1, ptr %34, align 8, !tbaa !9
  %35 = load ptr, ptr %12, align 8, !tbaa !5
  call void @_ZN11alglib_impl14ae_frame_leaveEPNS_8ae_stateE(ptr noundef %35)
  store i32 1, ptr %20, align 4
  br label %182

36:                                               ; preds = %30
  %37 = load ptr, ptr %7, align 8, !tbaa !5
  %38 = load i64, ptr %8, align 8, !tbaa !9
  %39 = load i64, ptr %8, align 8, !tbaa !9
  %40 = load ptr, ptr %12, align 8, !tbaa !5
  call void @_ZN11alglib_impl9cmatrixluEPNS_9ae_matrixEllPNS_9ae_vectorEPNS_8ae_stateE(ptr noundef %37, i64 noundef %38, i64 noundef %39, ptr noundef %19, ptr noundef %40)
  store i64 0, ptr %16, align 8, !tbaa !9
  br label %41

41:                                               ; preds = %97, %36
  %42 = load i64, ptr %16, align 8, !tbaa !9
  %43 = load i64, ptr %8, align 8, !tbaa !9
  %44 = sub nsw i64 %43, 1
  %45 = icmp sle i64 %42, %44
  br i1 %45, label %46, label %100

46:                                               ; preds = %41
  %47 = load ptr, ptr %7, align 8, !tbaa !5
  %48 = getelementptr inbounds %"struct.alglib_impl::ae_matrix", ptr %47, i32 0, i32 6
  %49 = load ptr, ptr %48, align 8, !tbaa !11
  %50 = load i64, ptr %16, align 8, !tbaa !9
  %51 = getelementptr inbounds ptr, ptr %49, i64 %50
  %52 = load ptr, ptr %51, align 8, !tbaa !5
  %53 = load i64, ptr %16, align 8, !tbaa !9
  %54 = getelementptr inbounds %"struct.alglib_impl::ae_complex", ptr %52, i64 %53
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %21, ptr align 8 %54, i64 16, i1 false), !tbaa.struct !12
  %55 = getelementptr inbounds { double, double }, ptr %21, i32 0, i32 0
  %56 = load double, ptr %55, align 8
  %57 = getelementptr inbounds { double, double }, ptr %21, i32 0, i32 1
  %58 = load double, ptr %57, align 8
  %59 = call noundef zeroext i1 @_ZN11alglib_impl9ae_c_eq_dENS_10ae_complexEd(double %56, double %58, double noundef 0.000000e+00)
  br i1 %59, label %60, label %96

60:                                               ; preds = %46
  store i64 0, ptr %17, align 8, !tbaa !9
  br label %61

61:                                               ; preds = %90, %60
  %62 = load i64, ptr %17, align 8, !tbaa !9
  %63 = load i64, ptr %8, align 8, !tbaa !9
  %64 = sub nsw i64 %63, 1
  %65 = icmp sle i64 %62, %64
  br i1 %65, label %66, label %93

66:                                               ; preds = %61
  store i64 0, ptr %18, align 8, !tbaa !9
  br label %67

67:                                               ; preds = %86, %66
  %68 = load i64, ptr %18, align 8, !tbaa !9
  %69 = load i64, ptr %10, align 8, !tbaa !9
  %70 = sub nsw i64 %69, 1
  %71 = icmp sle i64 %68, %70
  br i1 %71, label %72, label %89

72:                                               ; preds = %67
  call void @llvm.lifetime.start.p0(i64 16, ptr %22) #5
  %73 = call { double, double } @_ZN11alglib_impl17ae_complex_from_dEd(double noundef 0.000000e+00)
  %74 = getelementptr inbounds { double, double }, ptr %22, i32 0, i32 0
  %75 = extractvalue { double, double } %73, 0
  store double %75, ptr %74, align 8
  %76 = getelementptr inbounds { double, double }, ptr %22, i32 0, i32 1
  %77 = extractvalue { double, double } %73, 1
  store double %77, ptr %76, align 8
  %78 = load ptr, ptr %9, align 8, !tbaa !5
  %79 = getelementptr inbounds %"struct.alglib_impl::ae_matrix", ptr %78, i32 0, i32 6
  %80 = load ptr, ptr %79, align 8, !tbaa !11
  %81 = load i64, ptr %17, align 8, !tbaa !9
  %82 = getelementptr inbounds ptr, ptr %80, i64 %81
  %83 = load ptr, ptr %82, align 8, !tbaa !5
  %84 = load i64, ptr %18, align 8, !tbaa !9
  %85 = getelementptr inbounds %"struct.alglib_impl::ae_complex", ptr %83, i64 %84
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %85, ptr align 8 %22, i64 16, i1 false), !tbaa.struct !12
  call void @llvm.lifetime.end.p0(i64 16, ptr %22) #5
  br label %86

86:                                               ; preds = %72
  %87 = load i64, ptr %18, align 8, !tbaa !9
  %88 = add nsw i64 %87, 1
  store i64 %88, ptr %18, align 8, !tbaa !9
  br label %67, !llvm.loop !15

89:                                               ; preds = %67
  br label %90

90:                                               ; preds = %89
  %91 = load i64, ptr %17, align 8, !tbaa !9
  %92 = add nsw i64 %91, 1
  store i64 %92, ptr %17, align 8, !tbaa !9
  br label %61, !llvm.loop !17

93:                                               ; preds = %61
  %94 = load ptr, ptr %11, align 8, !tbaa !5
  store i64 -3, ptr %94, align 8, !tbaa !9
  %95 = load ptr, ptr %12, align 8, !tbaa !5
  call void @_ZN11alglib_impl14ae_frame_leaveEPNS_8ae_stateE(ptr noundef %95)
  store i32 1, ptr %20, align 4
  br label %182

96:                                               ; preds = %46
  br label %97

97:                                               ; preds = %96
  %98 = load i64, ptr %16, align 8, !tbaa !9
  %99 = add nsw i64 %98, 1
  store i64 %99, ptr %16, align 8, !tbaa !9
  br label %41, !llvm.loop !18

100:                                              ; preds = %41
  store i64 0, ptr %16, align 8, !tbaa !9
  br label %101

101:                                              ; preds = %166, %100
  %102 = load i64, ptr %16, align 8, !tbaa !9
  %103 = load i64, ptr %8, align 8, !tbaa !9
  %104 = sub nsw i64 %103, 1
  %105 = icmp sle i64 %102, %104
  br i1 %105, label %106, label %169

106:                                              ; preds = %101
  %107 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %19, i32 0, i32 4
  %108 = load ptr, ptr %107, align 8, !tbaa !11
  %109 = load i64, ptr %16, align 8, !tbaa !9
  %110 = getelementptr inbounds i64, ptr %108, i64 %109
  %111 = load i64, ptr %110, align 8, !tbaa !9
  %112 = load i64, ptr %16, align 8, !tbaa !9
  %113 = icmp ne i64 %111, %112
  br i1 %113, label %114, label %165

114:                                              ; preds = %106
  store i64 0, ptr %17, align 8, !tbaa !9
  br label %115

115:                                              ; preds = %161, %114
  %116 = load i64, ptr %17, align 8, !tbaa !9
  %117 = load i64, ptr %10, align 8, !tbaa !9
  %118 = sub nsw i64 %117, 1
  %119 = icmp sle i64 %116, %118
  br i1 %119, label %120, label %164

120:                                              ; preds = %115
  %121 = load ptr, ptr %9, align 8, !tbaa !5
  %122 = getelementptr inbounds %"struct.alglib_impl::ae_matrix", ptr %121, i32 0, i32 6
  %123 = load ptr, ptr %122, align 8, !tbaa !11
  %124 = load i64, ptr %16, align 8, !tbaa !9
  %125 = getelementptr inbounds ptr, ptr %123, i64 %124
  %126 = load ptr, ptr %125, align 8, !tbaa !5
  %127 = load i64, ptr %17, align 8, !tbaa !9
  %128 = getelementptr inbounds %"struct.alglib_impl::ae_complex", ptr %126, i64 %127
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %15, ptr align 8 %128, i64 16, i1 false), !tbaa.struct !12
  %129 = load ptr, ptr %9, align 8, !tbaa !5
  %130 = getelementptr inbounds %"struct.alglib_impl::ae_matrix", ptr %129, i32 0, i32 6
  %131 = load ptr, ptr %130, align 8, !tbaa !11
  %132 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %19, i32 0, i32 4
  %133 = load ptr, ptr %132, align 8, !tbaa !11
  %134 = load i64, ptr %16, align 8, !tbaa !9
  %135 = getelementptr inbounds i64, ptr %133, i64 %134
  %136 = load i64, ptr %135, align 8, !tbaa !9
  %137 = getelementptr inbounds ptr, ptr %131, i64 %136
  %138 = load ptr, ptr %137, align 8, !tbaa !5
  %139 = load i64, ptr %17, align 8, !tbaa !9
  %140 = getelementptr inbounds %"struct.alglib_impl::ae_complex", ptr %138, i64 %139
  %141 = load ptr, ptr %9, align 8, !tbaa !5
  %142 = getelementptr inbounds %"struct.alglib_impl::ae_matrix", ptr %141, i32 0, i32 6
  %143 = load ptr, ptr %142, align 8, !tbaa !11
  %144 = load i64, ptr %16, align 8, !tbaa !9
  %145 = getelementptr inbounds ptr, ptr %143, i64 %144
  %146 = load ptr, ptr %145, align 8, !tbaa !5
  %147 = load i64, ptr %17, align 8, !tbaa !9
  %148 = getelementptr inbounds %"struct.alglib_impl::ae_complex", ptr %146, i64 %147
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %148, ptr align 8 %140, i64 16, i1 false), !tbaa.struct !12
  %149 = load ptr, ptr %9, align 8, !tbaa !5
  %150 = getelementptr inbounds %"struct.alglib_impl::ae_matrix", ptr %149, i32 0, i32 6
  %151 = load ptr, ptr %150, align 8, !tbaa !11
  %152 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %19, i32 0, i32 4
  %153 = load ptr, ptr %152, align 8, !tbaa !11
  %154 = load i64, ptr %16, align 8, !tbaa !9
  %155 = getelementptr inbounds i64, ptr %153, i64 %154
  %156 = load i64, ptr %155, align 8, !tbaa !9
  %157 = getelementptr inbounds ptr, ptr %151, i64 %156
  %158 = load ptr, ptr %157, align 8, !tbaa !5
  %159 = load i64, ptr %17, align 8, !tbaa !9
  %160 = getelementptr inbounds %"struct.alglib_impl::ae_complex", ptr %158, i64 %159
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %160, ptr align 8 %15, i64 16, i1 false), !tbaa.struct !12
  br label %161

161:                                              ; preds = %120
  %162 = load i64, ptr %17, align 8, !tbaa !9
  %163 = add nsw i64 %162, 1
  store i64 %163, ptr %17, align 8, !tbaa !9
  br label %115, !llvm.loop !19

164:                                              ; preds = %115
  br label %165

165:                                              ; preds = %164, %106
  br label %166

166:                                              ; preds = %165
  %167 = load i64, ptr %16, align 8, !tbaa !9
  %168 = add nsw i64 %167, 1
  store i64 %168, ptr %16, align 8, !tbaa !9
  br label %101, !llvm.loop !20

169:                                              ; preds = %101
  %170 = load i64, ptr %8, align 8, !tbaa !9
  %171 = load i64, ptr %10, align 8, !tbaa !9
  %172 = load ptr, ptr %7, align 8, !tbaa !5
  %173 = load ptr, ptr %9, align 8, !tbaa !5
  %174 = load ptr, ptr %12, align 8, !tbaa !5
  call void @_ZN11alglib_impl15cmatrixlefttrsmEllPNS_9ae_matrixEllbblS1_llPNS_8ae_stateE(i64 noundef %170, i64 noundef %171, ptr noundef %172, i64 noundef 0, i64 noundef 0, i1 noundef zeroext false, i1 noundef zeroext true, i64 noundef 0, ptr noundef %173, i64 noundef 0, i64 noundef 0, ptr noundef %174)
  %175 = load i64, ptr %8, align 8, !tbaa !9
  %176 = load i64, ptr %10, align 8, !tbaa !9
  %177 = load ptr, ptr %7, align 8, !tbaa !5
  %178 = load ptr, ptr %9, align 8, !tbaa !5
  %179 = load ptr, ptr %12, align 8, !tbaa !5
  call void @_ZN11alglib_impl15cmatrixlefttrsmEllPNS_9ae_matrixEllbblS1_llPNS_8ae_stateE(i64 noundef %175, i64 noundef %176, ptr noundef %177, i64 noundef 0, i64 noundef 0, i1 noundef zeroext true, i1 noundef zeroext false, i64 noundef 0, ptr noundef %178, i64 noundef 0, i64 noundef 0, ptr noundef %179)
  %180 = load ptr, ptr %11, align 8, !tbaa !5
  store i64 1, ptr %180, align 8, !tbaa !9
  %181 = load ptr, ptr %12, align 8, !tbaa !5
  call void @_ZN11alglib_impl14ae_frame_leaveEPNS_8ae_stateE(ptr noundef %181)
  store i32 0, ptr %20, align 4
  br label %182

182:                                              ; preds = %169, %93, %33
  call void @llvm.lifetime.end.p0(i64 64, ptr %19) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 80, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %13) #5
  %183 = load i32, ptr %20, align 4
  switch i32 %183, label %185 [
    i32 0, label %184
    i32 1, label %184
  ]

184:                                              ; preds = %182, %182
  ret void

185:                                              ; preds = %182
  unreachable
}

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

declare void @_ZN11alglib_impl14ae_frame_leaveEPNS_8ae_stateE(ptr noundef) #3

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

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

declare void @_ZN11alglib_impl9cmatrixluEPNS_9ae_matrixEllPNS_9ae_vectorEPNS_8ae_stateE(ptr noundef, i64 noundef, i64 noundef, ptr noundef, ptr noundef) #3

declare noundef zeroext i1 @_ZN11alglib_impl9ae_c_eq_dENS_10ae_complexEd(double, double, double noundef) #3

; 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) #4

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

declare void @_ZN11alglib_impl15cmatrixlefttrsmEllPNS_9ae_matrixEllbblS1_llPNS_8ae_stateE(i64 noundef, i64 noundef, ptr noundef, i64 noundef, i64 noundef, i1 noundef zeroext, i1 noundef zeroext, i64 noundef, ptr noundef, i64 noundef, i64 noundef, ptr noundef) #3

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #2 = { 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 #3 = { "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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 = !{i64 0, i64 8, !13, i64 8, i64 8, !13}
!13 = !{!14, !14, i64 0}
!14 = !{!"double", !7, i64 0}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}
!17 = distinct !{!17, !16}
!18 = distinct !{!18, !16}
!19 = distinct !{!19, !16}
!20 = distinct !{!20, !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_matrix" = type { i64, i64, 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_vector" = type { i64, i64, i8, %"struct.alglib_impl::ae_dyn_block", %union.anon.1 }
%union.anon.1 = type { ptr }

; 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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN11alglib_impl17cmatrixsolvemfastEPNS_9ae_matrixElS1_lPlPNS_8ae_stateE(ptr noundef %0, i64 noundef %1, ptr noundef %2, i64 noundef %3, ptr nocapture noundef writeonly %4, ptr noundef %5) local_unnamed_addr #2 {
  %7 = alloca %"struct.alglib_impl::ae_frame", align 8
  %8 = alloca %"struct.alglib_impl::ae_matrix", align 8
  %9 = alloca %"struct.alglib_impl::ae_complex", align 8
  %10 = alloca %"struct.alglib_impl::ae_vector", align 8
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %7) #5
  call void @llvm.lifetime.start.p0(i64 80, ptr nonnull %8) #5
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %9)
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %10) #5
  call void @_ZN11alglib_impl13ae_frame_makeEPNS_8ae_stateEPNS_8ae_frameE(ptr noundef %5, ptr noundef nonnull %7)
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(80) %8, i8 0, i64 80, i1 false)
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(64) %10, i8 0, i64 64, i1 false)
  call void @_ZN11alglib_impl19ae_matrix_init_copyEPNS_9ae_matrixES1_PNS_8ae_stateEb(ptr noundef nonnull %8, ptr noundef %0, ptr noundef %5, i1 noundef zeroext true)
  store i64 0, ptr %4, align 8, !tbaa !5
  call void @_ZN11alglib_impl14ae_vector_initEPNS_9ae_vectorEllPNS_8ae_stateEb(ptr noundef nonnull %10, i64 noundef 0, i64 noundef 2, ptr noundef %5, i1 noundef zeroext true)
  %11 = icmp slt i64 %1, 1
  %12 = icmp slt i64 %3, 1
  %or.cond = or i1 %11, %12
  br i1 %or.cond, label %._crit_edge89, label %13

13:                                               ; preds = %6
  call void @_ZN11alglib_impl9cmatrixluEPNS_9ae_matrixEllPNS_9ae_vectorEPNS_8ae_stateE(ptr noundef nonnull %8, i64 noundef %1, i64 noundef %1, ptr noundef nonnull %10, ptr noundef %5)
  %14 = getelementptr inbounds i8, ptr %8, i64 72
  br label %41

15:                                               ; preds = %41
  %16 = add nuw nsw i64 %.077, 1
  %exitcond.not = icmp eq i64 %16, %1
  br i1 %exitcond.not, label %.preheader76, label %41, !llvm.loop !9

.preheader76:                                     ; preds = %15
  %.not.not7080 = icmp sgt i64 %1, 0
  br i1 %.not.not7080, label %.lr.ph83, label %._crit_edge

.lr.ph83:                                         ; preds = %.preheader76
  %17 = getelementptr inbounds i8, ptr %10, i64 56
  %.not71.not78 = icmp sgt i64 %3, 0
  %18 = getelementptr inbounds i8, ptr %2, i64 72
  br i1 %.not71.not78, label %.lr.ph83.split.us, label %._crit_edge

.lr.ph83.split.us:                                ; preds = %.lr.ph83, %..loopexit_crit_edge.us
  %.181.us = phi i64 [ %40, %..loopexit_crit_edge.us ], [ 0, %.lr.ph83 ]
  %19 = load ptr, ptr %17, align 8, !tbaa !11
  %20 = getelementptr inbounds i64, ptr %19, i64 %.181.us
  %21 = load i64, ptr %20, align 8, !tbaa !5
  %.not.us = icmp eq i64 %21, %.181.us
  br i1 %.not.us, label %..loopexit_crit_edge.us, label %.preheader75.us

.preheader75.us:                                  ; preds = %.lr.ph83.split.us, %.preheader75.us
  %.16479.us = phi i64 [ %39, %.preheader75.us ], [ 0, %.lr.ph83.split.us ]
  %22 = load ptr, ptr %18, align 8, !tbaa !11
  %23 = getelementptr inbounds ptr, ptr %22, i64 %.181.us
  %24 = load ptr, ptr %23, align 8, !tbaa !12
  %25 = getelementptr inbounds %"struct.alglib_impl::ae_complex", ptr %24, i64 %.16479.us
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %9, ptr noundef nonnull align 8 dereferenceable(16) %25, i64 16, i1 false), !tbaa.struct !14
  %26 = load ptr, ptr %17, align 8, !tbaa !11
  %27 = getelementptr inbounds i64, ptr %26, i64 %.181.us
  %28 = load i64, ptr %27, align 8, !tbaa !5
  %29 = getelementptr inbounds ptr, ptr %22, i64 %28
  %30 = load ptr, ptr %29, align 8, !tbaa !12
  %31 = getelementptr inbounds %"struct.alglib_impl::ae_complex", ptr %30, i64 %.16479.us
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %25, ptr noundef nonnull align 8 dereferenceable(16) %31, i64 16, i1 false), !tbaa.struct !14
  %32 = load ptr, ptr %18, align 8, !tbaa !11
  %33 = load ptr, ptr %17, align 8, !tbaa !11
  %34 = getelementptr inbounds i64, ptr %33, i64 %.181.us
  %35 = load i64, ptr %34, align 8, !tbaa !5
  %36 = getelementptr inbounds ptr, ptr %32, i64 %35
  %37 = load ptr, ptr %36, align 8, !tbaa !12
  %38 = getelementptr inbounds %"struct.alglib_impl::ae_complex", ptr %37, i64 %.16479.us
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %38, ptr noundef nonnull align 8 dereferenceable(16) %9, i64 16, i1 false), !tbaa.struct !14
  %39 = add nuw nsw i64 %.16479.us, 1
  %exitcond92.not = icmp eq i64 %39, %3
  br i1 %exitcond92.not, label %..loopexit_crit_edge.us, label %.preheader75.us, !llvm.loop !17

..loopexit_crit_edge.us:                          ; preds = %.preheader75.us, %.lr.ph83.split.us
  %40 = add nuw nsw i64 %.181.us, 1
  %exitcond93.not = icmp eq i64 %40, %1
  br i1 %exitcond93.not, label %._crit_edge, label %.lr.ph83.split.us, !llvm.loop !18

41:                                               ; preds = %13, %15
  %.077 = phi i64 [ 0, %13 ], [ %16, %15 ]
  %42 = load ptr, ptr %14, align 8, !tbaa !11
  %43 = getelementptr inbounds ptr, ptr %42, i64 %.077
  %44 = load ptr, ptr %43, align 8, !tbaa !12
  %45 = getelementptr inbounds %"struct.alglib_impl::ae_complex", ptr %44, i64 %.077
  %.sroa.02.0.copyload = load double, ptr %45, align 8, !tbaa !15
  %.sroa.2.0..sroa_idx = getelementptr inbounds i8, ptr %45, i64 8
  %.sroa.2.0.copyload = load double, ptr %.sroa.2.0..sroa_idx, align 8, !tbaa !15
  %46 = call noundef zeroext i1 @_ZN11alglib_impl9ae_c_eq_dENS_10ae_complexEd(double %.sroa.02.0.copyload, double %.sroa.2.0.copyload, double noundef 0.000000e+00)
  br i1 %46, label %.preheader74, label %15

.preheader74:                                     ; preds = %41
  %.not72.not87 = icmp sgt i64 %1, 0
  br i1 %.not72.not87, label %.preheader.lr.ph, label %._crit_edge89

.preheader.lr.ph:                                 ; preds = %.preheader74
  %.not73.not84 = icmp sgt i64 %3, 0
  %47 = getelementptr inbounds i8, ptr %2, i64 72
  br i1 %.not73.not84, label %.preheader.us, label %._crit_edge89

.preheader.us:                                    ; preds = %.preheader.lr.ph, %._crit_edge86.us
  %.06388.us = phi i64 [ %57, %._crit_edge86.us ], [ 0, %.preheader.lr.ph ]
  br label %48

48:                                               ; preds = %.preheader.us, %48
  %.06585.us = phi i64 [ 0, %.preheader.us ], [ %56, %48 ]
  %49 = call { double, double } @_ZN11alglib_impl17ae_complex_from_dEd(double noundef 0.000000e+00)
  %50 = extractvalue { double, double } %49, 0
  %51 = extractvalue { double, double } %49, 1
  %52 = load ptr, ptr %47, align 8, !tbaa !11
  %53 = getelementptr inbounds ptr, ptr %52, i64 %.06388.us
  %54 = load ptr, ptr %53, align 8, !tbaa !12
  %55 = getelementptr inbounds %"struct.alglib_impl::ae_complex", ptr %54, i64 %.06585.us
  store double %50, ptr %55, align 8, !tbaa !15
  %.sroa.4.0..sroa_idx.us = getelementptr inbounds i8, ptr %55, i64 8
  store double %51, ptr %.sroa.4.0..sroa_idx.us, align 8, !tbaa !15
  %56 = add nuw nsw i64 %.06585.us, 1
  %exitcond94.not = icmp eq i64 %56, %3
  br i1 %exitcond94.not, label %._crit_edge86.us, label %48, !llvm.loop !19

._crit_edge86.us:                                 ; preds = %48
  %57 = add nuw nsw i64 %.06388.us, 1
  %exitcond95.not = icmp eq i64 %57, %1
  br i1 %exitcond95.not, label %._crit_edge89, label %.preheader.us, !llvm.loop !20

._crit_edge:                                      ; preds = %..loopexit_crit_edge.us, %.lr.ph83, %.preheader76
  call void @_ZN11alglib_impl15cmatrixlefttrsmEllPNS_9ae_matrixEllbblS1_llPNS_8ae_stateE(i64 noundef %1, i64 noundef %3, ptr noundef nonnull %8, i64 noundef 0, i64 noundef 0, i1 noundef zeroext false, i1 noundef zeroext true, i64 noundef 0, ptr noundef %2, i64 noundef 0, i64 noundef 0, ptr noundef %5)
  call void @_ZN11alglib_impl15cmatrixlefttrsmEllPNS_9ae_matrixEllbblS1_llPNS_8ae_stateE(i64 noundef %1, i64 noundef %3, ptr noundef nonnull %8, i64 noundef 0, i64 noundef 0, i1 noundef zeroext true, i1 noundef zeroext false, i64 noundef 0, ptr noundef %2, i64 noundef 0, i64 noundef 0, ptr noundef %5)
  br label %._crit_edge89

._crit_edge89:                                    ; preds = %._crit_edge86.us, %.preheader74, %.preheader.lr.ph, %6, %._crit_edge
  %.sink = phi i64 [ 1, %._crit_edge ], [ -1, %6 ], [ -3, %.preheader.lr.ph ], [ -3, %.preheader74 ], [ -3, %._crit_edge86.us ]
  store i64 %.sink, ptr %4, align 8, !tbaa !5
  call void @_ZN11alglib_impl14ae_frame_leaveEPNS_8ae_stateE(ptr noundef %5)
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %10) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %9)
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %8) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %7) #5
  ret void
}

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

declare void @_ZN11alglib_impl14ae_frame_leaveEPNS_8ae_stateE(ptr noundef) local_unnamed_addr #3

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

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

declare void @_ZN11alglib_impl9cmatrixluEPNS_9ae_matrixEllPNS_9ae_vectorEPNS_8ae_stateE(ptr noundef, i64 noundef, i64 noundef, ptr noundef, ptr noundef) local_unnamed_addr #3

declare noundef zeroext i1 @_ZN11alglib_impl9ae_c_eq_dENS_10ae_complexEd(double, double, double noundef) local_unnamed_addr #3

; Function Attrs: mustprogress 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) #4

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

declare void @_ZN11alglib_impl15cmatrixlefttrsmEllPNS_9ae_matrixEllbblS1_llPNS_8ae_stateE(i64 noundef, i64 noundef, ptr noundef, i64 noundef, i64 noundef, i1 noundef zeroext, i1 noundef zeroext, i64 noundef, ptr noundef, i64 noundef, i64 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 = { 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 #3 = { "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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 = !{!"long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!7, !7, i64 0}
!12 = !{!13, !13, i64 0}
!13 = !{!"any pointer", !7, i64 0}
!14 = !{i64 0, i64 8, !15, i64 8, i64 8, !15}
!15 = !{!16, !16, i64 0}
!16 = !{!"double", !7, i64 0}
!17 = distinct !{!17, !10}
!18 = distinct !{!18, !10}
!19 = distinct !{!19, !10}
!20 = distinct !{!20, !10}


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