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

; 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_matrix" = type { i64, i64, i64, i64, i8, %"struct.alglib_impl::ae_dyn_block", %union.anon }
%"struct.alglib_impl::ae_dyn_block" = type { ptr, ptr, ptr, ptr }
%union.anon = type { ptr }
%"struct.alglib_impl::x_matrix" = type { i64, i64, i64, i64, i64, i64, %union.anon.2 }
%union.anon.2 = type { ptr }

@.str = external hidden unnamed_addr constant [27 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [44 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 nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN11alglib_impl9ae_mallocEmPNS_8ae_stateE(i64 noundef, ptr noundef) #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN11alglib_impl7ae_freeEPv(ptr noundef) #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZN11alglib_impl9ae_sizeofEl(i64 noundef) #2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext, ptr noundef, ptr noundef) #1

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN11alglib_impl15ae_x_set_matrixEPNS_8x_matrixEPNS_9ae_matrixEPNS_8ae_stateE(ptr noundef %0, ptr noundef %1, ptr noundef %2) #1 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i64, align 8
  %10 = alloca i64, align 8
  %11 = alloca i32, align 4
  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
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #4
  %12 = load ptr, ptr %5, align 8, !tbaa !5
  %13 = getelementptr inbounds %"struct.alglib_impl::ae_matrix", ptr %12, i32 0, i32 6
  %14 = load ptr, ptr %13, align 8, !tbaa !9
  %15 = icmp ne ptr %14, null
  br i1 %15, label %16, label %27

16:                                               ; preds = %3
  %17 = load ptr, ptr %5, align 8, !tbaa !5
  %18 = getelementptr inbounds %"struct.alglib_impl::ae_matrix", ptr %17, i32 0, i32 6
  %19 = load ptr, ptr %18, align 8, !tbaa !9
  %20 = getelementptr inbounds ptr, ptr %19, i64 0
  %21 = load ptr, ptr %20, align 8, !tbaa !5
  %22 = load ptr, ptr %4, align 8, !tbaa !5
  %23 = getelementptr inbounds %"struct.alglib_impl::x_matrix", ptr %22, i32 0, i32 6
  %24 = load ptr, ptr %23, align 8, !tbaa !9
  %25 = icmp eq ptr %21, %24
  br i1 %25, label %26, label %27

26:                                               ; preds = %16
  store i32 1, ptr %11, align 4
  br label %209

27:                                               ; preds = %16, %3
  %28 = load ptr, ptr %4, align 8, !tbaa !5
  %29 = getelementptr inbounds %"struct.alglib_impl::x_matrix", ptr %28, i32 0, i32 0
  %30 = load i64, ptr %29, align 8, !tbaa !10
  %31 = load ptr, ptr %5, align 8, !tbaa !5
  %32 = getelementptr inbounds %"struct.alglib_impl::ae_matrix", ptr %31, i32 0, i32 0
  %33 = load i64, ptr %32, align 8, !tbaa !13
  %34 = icmp ne i64 %30, %33
  br i1 %34, label %51, label %35

35:                                               ; preds = %27
  %36 = load ptr, ptr %4, align 8, !tbaa !5
  %37 = getelementptr inbounds %"struct.alglib_impl::x_matrix", ptr %36, i32 0, i32 1
  %38 = load i64, ptr %37, align 8, !tbaa !18
  %39 = load ptr, ptr %5, align 8, !tbaa !5
  %40 = getelementptr inbounds %"struct.alglib_impl::ae_matrix", ptr %39, i32 0, i32 1
  %41 = load i64, ptr %40, align 8, !tbaa !19
  %42 = icmp ne i64 %38, %41
  br i1 %42, label %51, label %43

43:                                               ; preds = %35
  %44 = load ptr, ptr %4, align 8, !tbaa !5
  %45 = getelementptr inbounds %"struct.alglib_impl::x_matrix", ptr %44, i32 0, i32 3
  %46 = load i64, ptr %45, align 8, !tbaa !20
  %47 = load ptr, ptr %5, align 8, !tbaa !5
  %48 = getelementptr inbounds %"struct.alglib_impl::ae_matrix", ptr %47, i32 0, i32 3
  %49 = load i64, ptr %48, align 8, !tbaa !21
  %50 = icmp ne i64 %46, %49
  br i1 %50, label %51, label %118

51:                                               ; preds = %43, %35, %27
  %52 = load ptr, ptr %4, align 8, !tbaa !5
  %53 = getelementptr inbounds %"struct.alglib_impl::x_matrix", ptr %52, i32 0, i32 4
  %54 = load i64, ptr %53, align 8, !tbaa !22
  %55 = icmp eq i64 %54, 2
  br i1 %55, label %56, label %60

56:                                               ; preds = %51
  %57 = load ptr, ptr %4, align 8, !tbaa !5
  %58 = getelementptr inbounds %"struct.alglib_impl::x_matrix", ptr %57, i32 0, i32 6
  %59 = load ptr, ptr %58, align 8, !tbaa !9
  call void @_ZN11alglib_impl7ae_freeEPv(ptr noundef %59)
  br label %60

60:                                               ; preds = %56, %51
  %61 = load ptr, ptr %5, align 8, !tbaa !5
  %62 = getelementptr inbounds %"struct.alglib_impl::ae_matrix", ptr %61, i32 0, i32 0
  %63 = load i64, ptr %62, align 8, !tbaa !13
  %64 = load ptr, ptr %4, align 8, !tbaa !5
  %65 = getelementptr inbounds %"struct.alglib_impl::x_matrix", ptr %64, i32 0, i32 0
  store i64 %63, ptr %65, align 8, !tbaa !10
  %66 = load ptr, ptr %5, align 8, !tbaa !5
  %67 = getelementptr inbounds %"struct.alglib_impl::ae_matrix", ptr %66, i32 0, i32 1
  %68 = load i64, ptr %67, align 8, !tbaa !19
  %69 = load ptr, ptr %4, align 8, !tbaa !5
  %70 = getelementptr inbounds %"struct.alglib_impl::x_matrix", ptr %69, i32 0, i32 1
  store i64 %68, ptr %70, align 8, !tbaa !18
  %71 = load ptr, ptr %5, align 8, !tbaa !5
  %72 = getelementptr inbounds %"struct.alglib_impl::ae_matrix", ptr %71, i32 0, i32 1
  %73 = load i64, ptr %72, align 8, !tbaa !19
  %74 = load ptr, ptr %4, align 8, !tbaa !5
  %75 = getelementptr inbounds %"struct.alglib_impl::x_matrix", ptr %74, i32 0, i32 2
  store i64 %73, ptr %75, align 8, !tbaa !23
  %76 = load ptr, ptr %5, align 8, !tbaa !5
  %77 = getelementptr inbounds %"struct.alglib_impl::ae_matrix", ptr %76, i32 0, i32 3
  %78 = load i64, ptr %77, align 8, !tbaa !21
  %79 = load ptr, ptr %4, align 8, !tbaa !5
  %80 = getelementptr inbounds %"struct.alglib_impl::x_matrix", ptr %79, i32 0, i32 3
  store i64 %78, ptr %80, align 8, !tbaa !20
  %81 = load ptr, ptr %4, align 8, !tbaa !5
  %82 = getelementptr inbounds %"struct.alglib_impl::x_matrix", ptr %81, i32 0, i32 0
  %83 = load i64, ptr %82, align 8, !tbaa !10
  %84 = load ptr, ptr %4, align 8, !tbaa !5
  %85 = getelementptr inbounds %"struct.alglib_impl::x_matrix", ptr %84, i32 0, i32 2
  %86 = load i64, ptr %85, align 8, !tbaa !23
  %87 = mul nsw i64 %83, %86
  %88 = load ptr, ptr %5, align 8, !tbaa !5
  %89 = getelementptr inbounds %"struct.alglib_impl::ae_matrix", ptr %88, i32 0, i32 3
  %90 = load i64, ptr %89, align 8, !tbaa !21
  %91 = call noundef i64 @_ZN11alglib_impl9ae_sizeofEl(i64 noundef %90)
  %92 = mul nsw i64 %87, %91
  %93 = load ptr, ptr %6, align 8, !tbaa !5
  %94 = call noundef ptr @_ZN11alglib_impl9ae_mallocEmPNS_8ae_stateE(i64 noundef %92, ptr noundef %93)
  %95 = load ptr, ptr %4, align 8, !tbaa !5
  %96 = getelementptr inbounds %"struct.alglib_impl::x_matrix", ptr %95, i32 0, i32 6
  store ptr %94, ptr %96, align 8, !tbaa !9
  %97 = load ptr, ptr %4, align 8, !tbaa !5
  %98 = getelementptr inbounds %"struct.alglib_impl::x_matrix", ptr %97, i32 0, i32 0
  %99 = load i64, ptr %98, align 8, !tbaa !10
  %100 = icmp ne i64 %99, 0
  br i1 %100, label %101, label %113

101:                                              ; preds = %60
  %102 = load ptr, ptr %4, align 8, !tbaa !5
  %103 = getelementptr inbounds %"struct.alglib_impl::x_matrix", ptr %102, i32 0, i32 2
  %104 = load i64, ptr %103, align 8, !tbaa !23
  %105 = icmp ne i64 %104, 0
  br i1 %105, label %106, label %113

106:                                              ; preds = %101
  %107 = load ptr, ptr %4, align 8, !tbaa !5
  %108 = getelementptr inbounds %"struct.alglib_impl::x_matrix", ptr %107, i32 0, i32 6
  %109 = load ptr, ptr %108, align 8, !tbaa !9
  %110 = icmp eq ptr %109, null
  br i1 %110, label %111, label %113

111:                                              ; preds = %106
  %112 = load ptr, ptr %6, align 8, !tbaa !5
  call void @_ZN11alglib_impl8ae_breakEPNS_8ae_stateENS_13ae_error_typeEPKc(ptr noundef %112, i32 noundef 1, ptr noundef @.str)
  br label %113

113:                                              ; preds = %111, %106, %101, %60
  %114 = load ptr, ptr %4, align 8, !tbaa !5
  %115 = getelementptr inbounds %"struct.alglib_impl::x_matrix", ptr %114, i32 0, i32 5
  store i64 3, ptr %115, align 8, !tbaa !24
  %116 = load ptr, ptr %4, align 8, !tbaa !5
  %117 = getelementptr inbounds %"struct.alglib_impl::x_matrix", ptr %116, i32 0, i32 4
  store i64 2, ptr %117, align 8, !tbaa !22
  br label %147

118:                                              ; preds = %43
  %119 = load ptr, ptr %4, align 8, !tbaa !5
  %120 = getelementptr inbounds %"struct.alglib_impl::x_matrix", ptr %119, i32 0, i32 5
  %121 = load i64, ptr %120, align 8, !tbaa !24
  %122 = icmp eq i64 %121, 1
  br i1 %122, label %123, label %126

123:                                              ; preds = %118
  %124 = load ptr, ptr %4, align 8, !tbaa !5
  %125 = getelementptr inbounds %"struct.alglib_impl::x_matrix", ptr %124, i32 0, i32 5
  store i64 2, ptr %125, align 8, !tbaa !24
  br label %146

126:                                              ; preds = %118
  %127 = load ptr, ptr %4, align 8, !tbaa !5
  %128 = getelementptr inbounds %"struct.alglib_impl::x_matrix", ptr %127, i32 0, i32 5
  %129 = load i64, ptr %128, align 8, !tbaa !24
  %130 = icmp eq i64 %129, 2
  br i1 %130, label %131, label %134

131:                                              ; preds = %126
  %132 = load ptr, ptr %4, align 8, !tbaa !5
  %133 = getelementptr inbounds %"struct.alglib_impl::x_matrix", ptr %132, i32 0, i32 5
  store i64 2, ptr %133, align 8, !tbaa !24
  br label %145

134:                                              ; preds = %126
  %135 = load ptr, ptr %4, align 8, !tbaa !5
  %136 = getelementptr inbounds %"struct.alglib_impl::x_matrix", ptr %135, i32 0, i32 5
  %137 = load i64, ptr %136, align 8, !tbaa !24
  %138 = icmp eq i64 %137, 3
  br i1 %138, label %139, label %142

139:                                              ; preds = %134
  %140 = load ptr, ptr %4, align 8, !tbaa !5
  %141 = getelementptr inbounds %"struct.alglib_impl::x_matrix", ptr %140, i32 0, i32 5
  store i64 3, ptr %141, align 8, !tbaa !24
  br label %144

142:                                              ; preds = %134
  %143 = load ptr, ptr %6, align 8, !tbaa !5
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext false, ptr noundef @.str.15, ptr noundef %143)
  br label %144

144:                                              ; preds = %142, %139
  br label %145

145:                                              ; preds = %144, %131
  br label %146

146:                                              ; preds = %145, %123
  br label %147

147:                                              ; preds = %146, %113
  %148 = load ptr, ptr %5, align 8, !tbaa !5
  %149 = getelementptr inbounds %"struct.alglib_impl::ae_matrix", ptr %148, i32 0, i32 0
  %150 = load i64, ptr %149, align 8, !tbaa !13
  %151 = icmp ne i64 %150, 0
  br i1 %151, label %152, label %208

152:                                              ; preds = %147
  %153 = load ptr, ptr %5, align 8, !tbaa !5
  %154 = getelementptr inbounds %"struct.alglib_impl::ae_matrix", ptr %153, i32 0, i32 1
  %155 = load i64, ptr %154, align 8, !tbaa !19
  %156 = icmp ne i64 %155, 0
  br i1 %156, label %157, label %208

157:                                              ; preds = %152
  %158 = load ptr, ptr %5, align 8, !tbaa !5
  %159 = getelementptr inbounds %"struct.alglib_impl::ae_matrix", ptr %158, i32 0, i32 6
  %160 = load ptr, ptr %159, align 8, !tbaa !9
  %161 = getelementptr inbounds ptr, ptr %160, i64 0
  %162 = load ptr, ptr %161, align 8, !tbaa !5
  store ptr %162, ptr %7, align 8, !tbaa !5
  %163 = load ptr, ptr %4, align 8, !tbaa !5
  %164 = getelementptr inbounds %"struct.alglib_impl::x_matrix", ptr %163, i32 0, i32 6
  %165 = load ptr, ptr %164, align 8, !tbaa !9
  store ptr %165, ptr %8, align 8, !tbaa !5
  %166 = load ptr, ptr %5, align 8, !tbaa !5
  %167 = getelementptr inbounds %"struct.alglib_impl::ae_matrix", ptr %166, i32 0, i32 3
  %168 = load i64, ptr %167, align 8, !tbaa !21
  %169 = call noundef i64 @_ZN11alglib_impl9ae_sizeofEl(i64 noundef %168)
  %170 = load ptr, ptr %5, align 8, !tbaa !5
  %171 = getelementptr inbounds %"struct.alglib_impl::ae_matrix", ptr %170, i32 0, i32 1
  %172 = load i64, ptr %171, align 8, !tbaa !19
  %173 = mul nsw i64 %169, %172
  store i64 %173, ptr %10, align 8, !tbaa !25
  store i64 0, ptr %9, align 8, !tbaa !25
  br label %174

174:                                              ; preds = %184, %157
  %175 = load i64, ptr %9, align 8, !tbaa !25
  %176 = load ptr, ptr %5, align 8, !tbaa !5
  %177 = getelementptr inbounds %"struct.alglib_impl::ae_matrix", ptr %176, i32 0, i32 0
  %178 = load i64, ptr %177, align 8, !tbaa !13
  %179 = icmp slt i64 %175, %178
  br i1 %179, label %180, label %207

180:                                              ; preds = %174
  %181 = load ptr, ptr %8, align 8, !tbaa !5
  %182 = load ptr, ptr %7, align 8, !tbaa !5
  %183 = load i64, ptr %10, align 8, !tbaa !25
  call void @llvm.memmove.p0.p0.i64(ptr align 1 %181, ptr align 1 %182, i64 %183, i1 false)
  br label %184

184:                                              ; preds = %180
  %185 = load i64, ptr %9, align 8, !tbaa !25
  %186 = add nsw i64 %185, 1
  store i64 %186, ptr %9, align 8, !tbaa !25
  %187 = load ptr, ptr %5, align 8, !tbaa !5
  %188 = getelementptr inbounds %"struct.alglib_impl::ae_matrix", ptr %187, i32 0, i32 2
  %189 = load i64, ptr %188, align 8, !tbaa !26
  %190 = load ptr, ptr %5, align 8, !tbaa !5
  %191 = getelementptr inbounds %"struct.alglib_impl::ae_matrix", ptr %190, i32 0, i32 3
  %192 = load i64, ptr %191, align 8, !tbaa !21
  %193 = call noundef i64 @_ZN11alglib_impl9ae_sizeofEl(i64 noundef %192)
  %194 = mul nsw i64 %189, %193
  %195 = load ptr, ptr %7, align 8, !tbaa !5
  %196 = getelementptr inbounds i8, ptr %195, i64 %194
  store ptr %196, ptr %7, align 8, !tbaa !5
  %197 = load ptr, ptr %4, align 8, !tbaa !5
  %198 = getelementptr inbounds %"struct.alglib_impl::x_matrix", ptr %197, i32 0, i32 2
  %199 = load i64, ptr %198, align 8, !tbaa !23
  %200 = load ptr, ptr %5, align 8, !tbaa !5
  %201 = getelementptr inbounds %"struct.alglib_impl::ae_matrix", ptr %200, i32 0, i32 3
  %202 = load i64, ptr %201, align 8, !tbaa !21
  %203 = call noundef i64 @_ZN11alglib_impl9ae_sizeofEl(i64 noundef %202)
  %204 = mul nsw i64 %199, %203
  %205 = load ptr, ptr %8, align 8, !tbaa !5
  %206 = getelementptr inbounds i8, ptr %205, i64 %204
  store ptr %206, ptr %8, align 8, !tbaa !5
  br label %174, !llvm.loop !27

207:                                              ; preds = %174
  br label %208

208:                                              ; preds = %207, %152, %147
  store i32 0, ptr %11, align 4
  br label %209

209:                                              ; preds = %208, %26
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #4
  %210 = load i32, ptr %11, align 4
  switch i32 %210, label %212 [
    i32 0, label %211
    i32 1, label %211
  ]

211:                                              ; preds = %209, %209
  ret void

212:                                              ; preds = %209
  unreachable
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { 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" }
attributes #3 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!7, !7, i64 0}
!10 = !{!11, !12, i64 0}
!11 = !{!"_ZTSN11alglib_impl8x_matrixE", !12, i64 0, !12, i64 8, !12, i64 16, !12, i64 24, !12, i64 32, !12, i64 40, !7, i64 48}
!12 = !{!"long long", !7, i64 0}
!13 = !{!14, !15, i64 0}
!14 = !{!"_ZTSN11alglib_impl9ae_matrixE", !15, i64 0, !15, i64 8, !15, i64 16, !15, i64 24, !16, i64 32, !17, i64 40, !7, i64 72}
!15 = !{!"long", !7, i64 0}
!16 = !{!"bool", !7, i64 0}
!17 = !{!"_ZTSN11alglib_impl12ae_dyn_blockE", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!18 = !{!11, !12, i64 8}
!19 = !{!14, !15, i64 8}
!20 = !{!11, !12, i64 24}
!21 = !{!14, !15, i64 24}
!22 = !{!11, !12, i64 32}
!23 = !{!11, !12, i64 16}
!24 = !{!11, !12, i64 40}
!25 = !{!15, !15, i64 0}
!26 = !{!14, !15, i64 16}
!27 = distinct !{!27, !28}
!28 = !{!"llvm.loop.mustprogress"}


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

@.str = external hidden unnamed_addr constant [27 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [44 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN11alglib_impl8ae_breakEPNS_8ae_stateENS_13ae_error_typeEPKc(ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN11alglib_impl9ae_mallocEmPNS_8ae_stateE(i64 noundef, ptr noundef) local_unnamed_addr #0

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZN11alglib_impl9ae_sizeofEl(i64 noundef) local_unnamed_addr #1

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN11alglib_impl15ae_x_set_matrixEPNS_8x_matrixEPNS_9ae_matrixEPNS_8ae_stateE(ptr nocapture noundef %0, ptr nocapture noundef readonly %1, ptr noundef %2) local_unnamed_addr #0 {
  %4 = getelementptr inbounds i8, ptr %1, i64 72
  %5 = load ptr, ptr %4, align 8, !tbaa !5
  %.not = icmp eq ptr %5, null
  br i1 %.not, label %11, label %6

6:                                                ; preds = %3
  %7 = load ptr, ptr %5, align 8, !tbaa !8
  %8 = getelementptr inbounds i8, ptr %0, i64 48
  %9 = load ptr, ptr %8, align 8, !tbaa !5
  %10 = icmp eq ptr %7, %9
  br i1 %10, label %.loopexit, label %11

11:                                               ; preds = %6, %3
  %12 = load i64, ptr %0, align 8, !tbaa !10
  %13 = load i64, ptr %1, align 8, !tbaa !13
  %.not58 = icmp eq i64 %12, %13
  br i1 %.not58, label %14, label %24

14:                                               ; preds = %11
  %15 = getelementptr inbounds i8, ptr %0, i64 8
  %16 = load i64, ptr %15, align 8, !tbaa !18
  %17 = getelementptr inbounds i8, ptr %1, i64 8
  %18 = load i64, ptr %17, align 8, !tbaa !19
  %.not59 = icmp eq i64 %16, %18
  br i1 %.not59, label %19, label %24

19:                                               ; preds = %14
  %20 = getelementptr inbounds i8, ptr %0, i64 24
  %21 = load i64, ptr %20, align 8, !tbaa !20
  %22 = getelementptr inbounds i8, ptr %1, i64 24
  %23 = load i64, ptr %22, align 8, !tbaa !21
  %.not60 = icmp eq i64 %21, %23
  br i1 %.not60, label %52, label %24

24:                                               ; preds = %19, %14, %11
  %25 = getelementptr inbounds i8, ptr %0, i64 32
  %26 = load i64, ptr %25, align 8, !tbaa !22
  %27 = icmp eq i64 %26, 2
  br i1 %27, label %28, label %31

28:                                               ; preds = %24
  %29 = getelementptr inbounds i8, ptr %0, i64 48
  %30 = load ptr, ptr %29, align 8, !tbaa !5
  tail call void @_ZN11alglib_impl7ae_freeEPv(ptr noundef %30)
  %.pre = load i64, ptr %1, align 8, !tbaa !13
  br label %31

31:                                               ; preds = %28, %24
  %32 = phi i64 [ %.pre, %28 ], [ %13, %24 ]
  store i64 %32, ptr %0, align 8, !tbaa !10
  %33 = getelementptr inbounds i8, ptr %1, i64 8
  %34 = load i64, ptr %33, align 8, !tbaa !19
  %35 = getelementptr inbounds i8, ptr %0, i64 8
  store i64 %34, ptr %35, align 8, !tbaa !18
  %36 = getelementptr inbounds i8, ptr %0, i64 16
  store i64 %34, ptr %36, align 8, !tbaa !23
  %37 = getelementptr inbounds i8, ptr %1, i64 24
  %38 = load i64, ptr %37, align 8, !tbaa !21
  %39 = getelementptr inbounds i8, ptr %0, i64 24
  store i64 %38, ptr %39, align 8, !tbaa !20
  %40 = mul nsw i64 %34, %32
  %41 = tail call noundef i64 @_ZN11alglib_impl9ae_sizeofEl(i64 noundef %38)
  %42 = mul nsw i64 %40, %41
  %43 = tail call noundef ptr @_ZN11alglib_impl9ae_mallocEmPNS_8ae_stateE(i64 noundef %42, ptr noundef %2)
  %44 = getelementptr inbounds i8, ptr %0, i64 48
  store ptr %43, ptr %44, align 8, !tbaa !5
  %45 = load i64, ptr %0, align 8, !tbaa !10
  %.not61 = icmp eq i64 %45, 0
  br i1 %.not61, label %50, label %46

46:                                               ; preds = %31
  %47 = load i64, ptr %36, align 8, !tbaa !23
  %.not62 = icmp ne i64 %47, 0
  %48 = icmp eq ptr %43, null
  %or.cond = and i1 %48, %.not62
  br i1 %or.cond, label %49, label %50

49:                                               ; preds = %46
  tail call void @_ZN11alglib_impl8ae_breakEPNS_8ae_stateENS_13ae_error_typeEPKc(ptr noundef %2, i32 noundef 1, ptr noundef nonnull @.str)
  br label %50

50:                                               ; preds = %49, %46, %31
  %51 = getelementptr inbounds i8, ptr %0, i64 40
  store i64 3, ptr %51, align 8, !tbaa !24
  store i64 2, ptr %25, align 8, !tbaa !22
  br label %59

52:                                               ; preds = %19
  %53 = getelementptr inbounds i8, ptr %0, i64 40
  %54 = load i64, ptr %53, align 8, !tbaa !24
  switch i64 %54, label %58 [
    i64 1, label %55
    i64 2, label %56
    i64 3, label %57
  ]

55:                                               ; preds = %52
  store i64 2, ptr %53, align 8, !tbaa !24
  br label %59

56:                                               ; preds = %52
  store i64 2, ptr %53, align 8, !tbaa !24
  br label %59

57:                                               ; preds = %52
  store i64 3, ptr %53, align 8, !tbaa !24
  br label %59

58:                                               ; preds = %52
  tail call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext false, ptr noundef nonnull @.str.15, ptr noundef %2)
  br label %59

59:                                               ; preds = %55, %57, %58, %56, %50
  %60 = load i64, ptr %1, align 8, !tbaa !13
  %.not63 = icmp eq i64 %60, 0
  br i1 %.not63, label %.loopexit, label %61

61:                                               ; preds = %59
  %62 = getelementptr inbounds i8, ptr %1, i64 8
  %63 = load i64, ptr %62, align 8, !tbaa !19
  %.not64 = icmp eq i64 %63, 0
  br i1 %.not64, label %.loopexit, label %64

64:                                               ; preds = %61
  %65 = load ptr, ptr %4, align 8, !tbaa !5
  %66 = load ptr, ptr %65, align 8, !tbaa !8
  %67 = getelementptr inbounds i8, ptr %0, i64 48
  %68 = load ptr, ptr %67, align 8, !tbaa !5
  %69 = getelementptr inbounds i8, ptr %1, i64 24
  %70 = load i64, ptr %69, align 8, !tbaa !21
  %71 = tail call noundef i64 @_ZN11alglib_impl9ae_sizeofEl(i64 noundef %70)
  %72 = load i64, ptr %62, align 8, !tbaa !19
  %73 = mul nsw i64 %72, %71
  %74 = load i64, ptr %1, align 8, !tbaa !13
  %75 = icmp sgt i64 %74, 0
  br i1 %75, label %.lr.ph, label %.loopexit

.lr.ph:                                           ; preds = %64
  %76 = getelementptr inbounds i8, ptr %1, i64 16
  %77 = getelementptr inbounds i8, ptr %0, i64 16
  br label %78

78:                                               ; preds = %.lr.ph, %78
  %.067 = phi ptr [ %66, %.lr.ph ], [ %84, %78 ]
  %.05466 = phi i64 [ 0, %.lr.ph ], [ %79, %78 ]
  %.05565 = phi ptr [ %68, %.lr.ph ], [ %89, %78 ]
  tail call void @llvm.memmove.p0.p0.i64(ptr align 1 %.05565, ptr align 1 %.067, i64 %73, i1 false)
  %79 = add nuw nsw i64 %.05466, 1
  %80 = load i64, ptr %76, align 8, !tbaa !25
  %81 = load i64, ptr %69, align 8, !tbaa !21
  %82 = tail call noundef i64 @_ZN11alglib_impl9ae_sizeofEl(i64 noundef %81)
  %83 = mul nsw i64 %82, %80
  %84 = getelementptr inbounds i8, ptr %.067, i64 %83
  %85 = load i64, ptr %77, align 8, !tbaa !23
  %86 = load i64, ptr %69, align 8, !tbaa !21
  %87 = tail call noundef i64 @_ZN11alglib_impl9ae_sizeofEl(i64 noundef %86)
  %88 = mul nsw i64 %87, %85
  %89 = getelementptr inbounds i8, ptr %.05565, i64 %88
  %90 = load i64, ptr %1, align 8, !tbaa !13
  %91 = icmp slt i64 %79, %90
  br i1 %91, label %78, label %.loopexit, !llvm.loop !26

.loopexit:                                        ; preds = %78, %64, %59, %61, %6
  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" }
attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }

!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, !12, i64 0}
!11 = !{!"_ZTSN11alglib_impl8x_matrixE", !12, i64 0, !12, i64 8, !12, i64 16, !12, i64 24, !12, i64 32, !12, i64 40, !6, i64 48}
!12 = !{!"long long", !6, i64 0}
!13 = !{!14, !15, i64 0}
!14 = !{!"_ZTSN11alglib_impl9ae_matrixE", !15, i64 0, !15, i64 8, !15, i64 16, !15, i64 24, !16, i64 32, !17, i64 40, !6, i64 72}
!15 = !{!"long", !6, i64 0}
!16 = !{!"bool", !6, i64 0}
!17 = !{!"_ZTSN11alglib_impl12ae_dyn_blockE", !9, i64 0, !9, i64 8, !9, i64 16, !9, i64 24}
!18 = !{!11, !12, i64 8}
!19 = !{!14, !15, i64 8}
!20 = !{!11, !12, i64 24}
!21 = !{!14, !15, i64 24}
!22 = !{!11, !12, i64 32}
!23 = !{!11, !12, i64 16}
!24 = !{!11, !12, i64 40}
!25 = !{!14, !15, i64 16}
!26 = distinct !{!26, !27}
!27 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass