; 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_matrix" = type { i64, i64, 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_impl16smatrixtdunpackqEPNS_9ae_matrixElbPNS_9ae_vectorES1_PNS_8ae_stateE(ptr noundef %0, i64 noundef %1, i1 noundef zeroext %2, ptr noundef %3, ptr noundef %4, ptr noundef %5) #2 {
  %7 = alloca ptr, align 8
  %8 = alloca i64, align 8
  %9 = alloca i8, align 1
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca %"struct.alglib_impl::ae_frame", align 8
  %14 = alloca i64, align 8
  %15 = alloca i64, align 8
  %16 = alloca %"struct.alglib_impl::ae_vector", align 8
  %17 = alloca %"struct.alglib_impl::ae_vector", align 8
  %18 = alloca i32, align 4
  store ptr %0, ptr %7, align 8, !tbaa !5
  store i64 %1, ptr %8, align 8, !tbaa !9
  %19 = zext i1 %2 to i8
  store i8 %19, ptr %9, align 1, !tbaa !11
  store ptr %3, ptr %10, align 8, !tbaa !5
  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) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #4
  call void @llvm.lifetime.start.p0(i64 64, ptr %16) #4
  call void @llvm.lifetime.start.p0(i64 64, ptr %17) #4
  %20 = load ptr, ptr %12, align 8, !tbaa !5
  call void @_ZN11alglib_impl13ae_frame_makeEPNS_8ae_stateEPNS_8ae_frameE(ptr noundef %20, ptr noundef %13)
  call void @llvm.memset.p0.i64(ptr align 8 %16, i8 0, i64 64, i1 false)
  call void @llvm.memset.p0.i64(ptr align 8 %17, i8 0, i64 64, i1 false)
  %21 = load ptr, ptr %11, align 8, !tbaa !5
  call void @_ZN11alglib_impl15ae_matrix_clearEPNS_9ae_matrixE(ptr noundef %21)
  %22 = load ptr, ptr %12, align 8, !tbaa !5
  call void @_ZN11alglib_impl14ae_vector_initEPNS_9ae_vectorEllPNS_8ae_stateEb(ptr noundef %16, i64 noundef 0, i64 noundef 3, ptr noundef %22, i1 noundef zeroext true)
  %23 = load ptr, ptr %12, align 8, !tbaa !5
  call void @_ZN11alglib_impl14ae_vector_initEPNS_9ae_vectorEllPNS_8ae_stateEb(ptr noundef %17, i64 noundef 0, i64 noundef 3, ptr noundef %23, i1 noundef zeroext true)
  %24 = load i64, ptr %8, align 8, !tbaa !9
  %25 = icmp eq i64 %24, 0
  br i1 %25, label %26, label %28

26:                                               ; preds = %6
  %27 = load ptr, ptr %12, align 8, !tbaa !5
  call void @_ZN11alglib_impl14ae_frame_leaveEPNS_8ae_stateE(ptr noundef %27)
  store i32 1, ptr %18, align 4
  br label %193

28:                                               ; preds = %6
  %29 = load ptr, ptr %11, align 8, !tbaa !5
  %30 = load i64, ptr %8, align 8, !tbaa !9
  %31 = sub nsw i64 %30, 1
  %32 = add nsw i64 %31, 1
  %33 = load i64, ptr %8, align 8, !tbaa !9
  %34 = sub nsw i64 %33, 1
  %35 = add nsw i64 %34, 1
  %36 = load ptr, ptr %12, align 8, !tbaa !5
  call void @_ZN11alglib_impl20ae_matrix_set_lengthEPNS_9ae_matrixEllPNS_8ae_stateE(ptr noundef %29, i64 noundef %32, i64 noundef %35, ptr noundef %36)
  %37 = load i64, ptr %8, align 8, !tbaa !9
  %38 = add nsw i64 %37, 1
  %39 = load ptr, ptr %12, align 8, !tbaa !5
  call void @_ZN11alglib_impl20ae_vector_set_lengthEPNS_9ae_vectorElPNS_8ae_stateE(ptr noundef %16, i64 noundef %38, ptr noundef %39)
  %40 = load i64, ptr %8, align 8, !tbaa !9
  %41 = sub nsw i64 %40, 1
  %42 = add nsw i64 %41, 1
  %43 = load ptr, ptr %12, align 8, !tbaa !5
  call void @_ZN11alglib_impl20ae_vector_set_lengthEPNS_9ae_vectorElPNS_8ae_stateE(ptr noundef %17, i64 noundef %42, ptr noundef %43)
  store i64 0, ptr %14, align 8, !tbaa !9
  br label %44

44:                                               ; preds = %82, %28
  %45 = load i64, ptr %14, align 8, !tbaa !9
  %46 = load i64, ptr %8, align 8, !tbaa !9
  %47 = sub nsw i64 %46, 1
  %48 = icmp sle i64 %45, %47
  br i1 %48, label %49, label %85

49:                                               ; preds = %44
  store i64 0, ptr %15, align 8, !tbaa !9
  br label %50

50:                                               ; preds = %78, %49
  %51 = load i64, ptr %15, align 8, !tbaa !9
  %52 = load i64, ptr %8, align 8, !tbaa !9
  %53 = sub nsw i64 %52, 1
  %54 = icmp sle i64 %51, %53
  br i1 %54, label %55, label %81

55:                                               ; preds = %50
  %56 = load i64, ptr %14, align 8, !tbaa !9
  %57 = load i64, ptr %15, align 8, !tbaa !9
  %58 = icmp eq i64 %56, %57
  br i1 %58, label %59, label %68

59:                                               ; preds = %55
  %60 = load ptr, ptr %11, align 8, !tbaa !5
  %61 = getelementptr inbounds %"struct.alglib_impl::ae_matrix", ptr %60, i32 0, i32 6
  %62 = load ptr, ptr %61, align 8, !tbaa !13
  %63 = load i64, ptr %14, align 8, !tbaa !9
  %64 = getelementptr inbounds ptr, ptr %62, i64 %63
  %65 = load ptr, ptr %64, align 8, !tbaa !5
  %66 = load i64, ptr %15, align 8, !tbaa !9
  %67 = getelementptr inbounds double, ptr %65, i64 %66
  store double 1.000000e+00, ptr %67, align 8, !tbaa !14
  br label %77

68:                                               ; preds = %55
  %69 = load ptr, ptr %11, align 8, !tbaa !5
  %70 = getelementptr inbounds %"struct.alglib_impl::ae_matrix", ptr %69, i32 0, i32 6
  %71 = load ptr, ptr %70, align 8, !tbaa !13
  %72 = load i64, ptr %14, align 8, !tbaa !9
  %73 = getelementptr inbounds ptr, ptr %71, i64 %72
  %74 = load ptr, ptr %73, align 8, !tbaa !5
  %75 = load i64, ptr %15, align 8, !tbaa !9
  %76 = getelementptr inbounds double, ptr %74, i64 %75
  store double 0.000000e+00, ptr %76, align 8, !tbaa !14
  br label %77

77:                                               ; preds = %68, %59
  br label %78

78:                                               ; preds = %77
  %79 = load i64, ptr %15, align 8, !tbaa !9
  %80 = add nsw i64 %79, 1
  store i64 %80, ptr %15, align 8, !tbaa !9
  br label %50, !llvm.loop !16

81:                                               ; preds = %50
  br label %82

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

85:                                               ; preds = %44
  %86 = load ptr, ptr %7, align 8, !tbaa !5
  %87 = load i64, ptr %8, align 8, !tbaa !9
  %88 = load i8, ptr %9, align 1, !tbaa !11, !range !19, !noundef !20
  %89 = trunc i8 %88 to i1
  %90 = load ptr, ptr %10, align 8, !tbaa !5
  %91 = load ptr, ptr %11, align 8, !tbaa !5
  %92 = load ptr, ptr %12, align 8, !tbaa !5
  %93 = call noundef zeroext i1 @_ZN11alglib_impl19smatrixtdunpackqmklEPNS_9ae_matrixElbPNS_9ae_vectorES1_PNS_8ae_stateE(ptr noundef %86, i64 noundef %87, i1 noundef zeroext %89, ptr noundef %90, ptr noundef %91, ptr noundef %92)
  br i1 %93, label %94, label %96

94:                                               ; preds = %85
  %95 = load ptr, ptr %12, align 8, !tbaa !5
  call void @_ZN11alglib_impl14ae_frame_leaveEPNS_8ae_stateE(ptr noundef %95)
  store i32 1, ptr %18, align 4
  br label %193

96:                                               ; preds = %85
  %97 = load i8, ptr %9, align 1, !tbaa !11, !range !19, !noundef !20
  %98 = trunc i8 %97 to i1
  br i1 %98, label %99, label %143

99:                                               ; preds = %96
  store i64 0, ptr %14, align 8, !tbaa !9
  br label %100

100:                                              ; preds = %139, %99
  %101 = load i64, ptr %14, align 8, !tbaa !9
  %102 = load i64, ptr %8, align 8, !tbaa !9
  %103 = sub nsw i64 %102, 2
  %104 = icmp sle i64 %101, %103
  br i1 %104, label %105, label %142

105:                                              ; preds = %100
  %106 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %16, i32 0, i32 4
  %107 = load ptr, ptr %106, align 8, !tbaa !13
  %108 = getelementptr inbounds double, ptr %107, i64 1
  %109 = load ptr, ptr %7, align 8, !tbaa !5
  %110 = getelementptr inbounds %"struct.alglib_impl::ae_matrix", ptr %109, i32 0, i32 6
  %111 = load ptr, ptr %110, align 8, !tbaa !13
  %112 = getelementptr inbounds ptr, ptr %111, i64 0
  %113 = load ptr, ptr %112, align 8, !tbaa !5
  %114 = load i64, ptr %14, align 8, !tbaa !9
  %115 = add nsw i64 %114, 1
  %116 = getelementptr inbounds double, ptr %113, i64 %115
  %117 = load ptr, ptr %7, align 8, !tbaa !5
  %118 = getelementptr inbounds %"struct.alglib_impl::ae_matrix", ptr %117, i32 0, i32 2
  %119 = load i64, ptr %118, align 8, !tbaa !21
  %120 = load i64, ptr %14, align 8, !tbaa !9
  %121 = add nsw i64 %120, 1
  %122 = call noundef i64 @_ZN11alglib_impl8ae_v_lenEll(i64 noundef 1, i64 noundef %121)
  call void @_ZN11alglib_impl9ae_v_moveEPdlPKdll(ptr noundef %108, i64 noundef 1, ptr noundef %116, i64 noundef %119, i64 noundef %122)
  %123 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %16, i32 0, i32 4
  %124 = load ptr, ptr %123, align 8, !tbaa !13
  %125 = load i64, ptr %14, align 8, !tbaa !9
  %126 = add nsw i64 %125, 1
  %127 = getelementptr inbounds double, ptr %124, i64 %126
  store double 1.000000e+00, ptr %127, align 8, !tbaa !14
  %128 = load ptr, ptr %11, align 8, !tbaa !5
  %129 = load ptr, ptr %10, align 8, !tbaa !5
  %130 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %129, i32 0, i32 4
  %131 = load ptr, ptr %130, align 8, !tbaa !13
  %132 = load i64, ptr %14, align 8, !tbaa !9
  %133 = getelementptr inbounds double, ptr %131, i64 %132
  %134 = load double, ptr %133, align 8, !tbaa !14
  %135 = load i64, ptr %14, align 8, !tbaa !9
  %136 = load i64, ptr %8, align 8, !tbaa !9
  %137 = sub nsw i64 %136, 1
  %138 = load ptr, ptr %12, align 8, !tbaa !5
  call void @_ZN11alglib_impl26applyreflectionfromtheleftEPNS_9ae_matrixEdPNS_9ae_vectorEllllS3_PNS_8ae_stateE(ptr noundef %128, double noundef %134, ptr noundef %16, i64 noundef 0, i64 noundef %135, i64 noundef 0, i64 noundef %137, ptr noundef %17, ptr noundef %138)
  br label %139

139:                                              ; preds = %105
  %140 = load i64, ptr %14, align 8, !tbaa !9
  %141 = add nsw i64 %140, 1
  store i64 %141, ptr %14, align 8, !tbaa !9
  br label %100, !llvm.loop !24

142:                                              ; preds = %100
  br label %191

143:                                              ; preds = %96
  %144 = load i64, ptr %8, align 8, !tbaa !9
  %145 = sub nsw i64 %144, 2
  store i64 %145, ptr %14, align 8, !tbaa !9
  br label %146

146:                                              ; preds = %187, %143
  %147 = load i64, ptr %14, align 8, !tbaa !9
  %148 = icmp sge i64 %147, 0
  br i1 %148, label %149, label %190

149:                                              ; preds = %146
  %150 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %16, i32 0, i32 4
  %151 = load ptr, ptr %150, align 8, !tbaa !13
  %152 = getelementptr inbounds double, ptr %151, i64 1
  %153 = load ptr, ptr %7, align 8, !tbaa !5
  %154 = getelementptr inbounds %"struct.alglib_impl::ae_matrix", ptr %153, i32 0, i32 6
  %155 = load ptr, ptr %154, align 8, !tbaa !13
  %156 = load i64, ptr %14, align 8, !tbaa !9
  %157 = add nsw i64 %156, 1
  %158 = getelementptr inbounds ptr, ptr %155, i64 %157
  %159 = load ptr, ptr %158, align 8, !tbaa !5
  %160 = load i64, ptr %14, align 8, !tbaa !9
  %161 = getelementptr inbounds double, ptr %159, i64 %160
  %162 = load ptr, ptr %7, align 8, !tbaa !5
  %163 = getelementptr inbounds %"struct.alglib_impl::ae_matrix", ptr %162, i32 0, i32 2
  %164 = load i64, ptr %163, align 8, !tbaa !21
  %165 = load i64, ptr %8, align 8, !tbaa !9
  %166 = load i64, ptr %14, align 8, !tbaa !9
  %167 = sub nsw i64 %165, %166
  %168 = sub nsw i64 %167, 1
  %169 = call noundef i64 @_ZN11alglib_impl8ae_v_lenEll(i64 noundef 1, i64 noundef %168)
  call void @_ZN11alglib_impl9ae_v_moveEPdlPKdll(ptr noundef %152, i64 noundef 1, ptr noundef %161, i64 noundef %164, i64 noundef %169)
  %170 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %16, i32 0, i32 4
  %171 = load ptr, ptr %170, align 8, !tbaa !13
  %172 = getelementptr inbounds double, ptr %171, i64 1
  store double 1.000000e+00, ptr %172, align 8, !tbaa !14
  %173 = load ptr, ptr %11, align 8, !tbaa !5
  %174 = load ptr, ptr %10, align 8, !tbaa !5
  %175 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %174, i32 0, i32 4
  %176 = load ptr, ptr %175, align 8, !tbaa !13
  %177 = load i64, ptr %14, align 8, !tbaa !9
  %178 = getelementptr inbounds double, ptr %176, i64 %177
  %179 = load double, ptr %178, align 8, !tbaa !14
  %180 = load i64, ptr %14, align 8, !tbaa !9
  %181 = add nsw i64 %180, 1
  %182 = load i64, ptr %8, align 8, !tbaa !9
  %183 = sub nsw i64 %182, 1
  %184 = load i64, ptr %8, align 8, !tbaa !9
  %185 = sub nsw i64 %184, 1
  %186 = load ptr, ptr %12, align 8, !tbaa !5
  call void @_ZN11alglib_impl26applyreflectionfromtheleftEPNS_9ae_matrixEdPNS_9ae_vectorEllllS3_PNS_8ae_stateE(ptr noundef %173, double noundef %179, ptr noundef %16, i64 noundef %181, i64 noundef %183, i64 noundef 0, i64 noundef %185, ptr noundef %17, ptr noundef %186)
  br label %187

187:                                              ; preds = %149
  %188 = load i64, ptr %14, align 8, !tbaa !9
  %189 = add nsw i64 %188, -1
  store i64 %189, ptr %14, align 8, !tbaa !9
  br label %146, !llvm.loop !25

190:                                              ; preds = %146
  br label %191

191:                                              ; preds = %190, %142
  %192 = load ptr, ptr %12, align 8, !tbaa !5
  call void @_ZN11alglib_impl14ae_frame_leaveEPNS_8ae_stateE(ptr noundef %192)
  store i32 0, ptr %18, align 4
  br label %193

193:                                              ; preds = %191, %94, %26
  call void @llvm.lifetime.end.p0(i64 64, ptr %17) #4
  call void @llvm.lifetime.end.p0(i64 64, ptr %16) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr %13) #4
  %194 = load i32, ptr %18, align 4
  switch i32 %194, label %196 [
    i32 0, label %195
    i32 1, label %195
  ]

195:                                              ; preds = %193, %193
  ret void

196:                                              ; preds = %193
  unreachable
}

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

declare void @_ZN11alglib_impl13ae_frame_makeEPNS_8ae_stateEPNS_8ae_frameE(ptr noundef, ptr noundef) #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_impl20ae_vector_set_lengthEPNS_9ae_vectorElPNS_8ae_stateE(ptr noundef, i64 noundef, ptr noundef) #3

declare void @_ZN11alglib_impl14ae_frame_leaveEPNS_8ae_stateE(ptr noundef) #3

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN11alglib_impl26applyreflectionfromtheleftEPNS_9ae_matrixEdPNS_9ae_vectorEllllS3_PNS_8ae_stateE(ptr noundef, double noundef, ptr noundef, i64 noundef, i64 noundef, i64 noundef, i64 noundef, ptr noundef, ptr noundef) #2

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

declare void @_ZN11alglib_impl15ae_matrix_clearEPNS_9ae_matrixE(ptr noundef) #3

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

declare noundef zeroext i1 @_ZN11alglib_impl19smatrixtdunpackqmklEPNS_9ae_matrixElbPNS_9ae_vectorES1_PNS_8ae_stateE(ptr noundef, i64 noundef, i1 noundef zeroext, ptr noundef, ptr 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 = { 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 = !{!"bool", !7, i64 0}
!13 = !{!7, !7, i64 0}
!14 = !{!15, !15, i64 0}
!15 = !{!"double", !7, i64 0}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.mustprogress"}
!18 = distinct !{!18, !17}
!19 = !{i8 0, i8 2}
!20 = !{}
!21 = !{!22, !10, i64 16}
!22 = !{!"_ZTSN11alglib_impl9ae_matrixE", !10, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !12, i64 32, !23, i64 40, !7, i64 72}
!23 = !{!"_ZTSN11alglib_impl12ae_dyn_blockE", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!24 = distinct !{!24, !17}
!25 = distinct !{!25, !17}


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

; 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_impl16smatrixtdunpackqEPNS_9ae_matrixElbPNS_9ae_vectorES1_PNS_8ae_stateE(ptr noundef %0, i64 noundef %1, i1 noundef zeroext %2, ptr noundef %3, ptr noundef %4, ptr noundef %5) local_unnamed_addr #2 {
  %7 = alloca %"struct.alglib_impl::ae_frame", align 8
  %8 = alloca %"struct.alglib_impl::ae_vector", align 8
  %9 = alloca %"struct.alglib_impl::ae_vector", align 8
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %7) #4
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %8) #4
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %9) #4
  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(64) %8, i8 0, i64 64, i1 false)
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(64) %9, i8 0, i64 64, i1 false)
  call void @_ZN11alglib_impl15ae_matrix_clearEPNS_9ae_matrixE(ptr noundef %4)
  call void @_ZN11alglib_impl14ae_vector_initEPNS_9ae_vectorEllPNS_8ae_stateEb(ptr noundef nonnull %8, i64 noundef 0, i64 noundef 3, ptr noundef %5, i1 noundef zeroext true)
  call void @_ZN11alglib_impl14ae_vector_initEPNS_9ae_vectorEllPNS_8ae_stateEb(ptr noundef nonnull %9, i64 noundef 0, i64 noundef 3, ptr noundef %5, i1 noundef zeroext true)
  %10 = icmp eq i64 %1, 0
  br i1 %10, label %.loopexit, label %11

11:                                               ; preds = %6
  %12 = add i64 %1, -1
  call void @_ZN11alglib_impl20ae_matrix_set_lengthEPNS_9ae_matrixEllPNS_8ae_stateE(ptr noundef %4, i64 noundef %1, i64 noundef %1, ptr noundef %5)
  %13 = add nsw i64 %1, 1
  call void @_ZN11alglib_impl20ae_vector_set_lengthEPNS_9ae_vectorElPNS_8ae_stateE(ptr noundef nonnull %8, i64 noundef %13, ptr noundef %5)
  call void @_ZN11alglib_impl20ae_vector_set_lengthEPNS_9ae_vectorElPNS_8ae_stateE(ptr noundef nonnull %9, i64 noundef %1, ptr noundef %5)
  %.not.not75 = icmp sgt i64 %1, 0
  br i1 %.not.not75, label %.preheader72.lr.ph, label %._crit_edge77

.preheader72.lr.ph:                               ; preds = %11
  %14 = getelementptr inbounds i8, ptr %4, i64 72
  %xtraiter = and i64 %1, 1
  %15 = icmp eq i64 %1, 1
  %unroll_iter = and i64 %1, 9223372036854775806
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br label %.preheader72.us

.preheader72.us:                                  ; preds = %._crit_edge.us, %.preheader72.lr.ph
  %.06676.us = phi i64 [ 0, %.preheader72.lr.ph ], [ %33, %._crit_edge.us ]
  br i1 %15, label %._crit_edge.us.unr-lcssa, label %.preheader72.us.new

.preheader72.us.new:                              ; preds = %.preheader72.us, %.preheader72.us.new
  %.074.us = phi i64 [ %27, %.preheader72.us.new ], [ 0, %.preheader72.us ]
  %niter = phi i64 [ %niter.next.1, %.preheader72.us.new ], [ 0, %.preheader72.us ]
  %16 = icmp eq i64 %.06676.us, %.074.us
  %17 = load ptr, ptr %14, align 8, !tbaa !5
  %18 = getelementptr inbounds ptr, ptr %17, i64 %.06676.us
  %19 = load ptr, ptr %18, align 8, !tbaa !8
  %. = select i1 %16, double 1.000000e+00, double 0.000000e+00
  %20 = getelementptr inbounds double, ptr %19, i64 %.074.us
  store double %., ptr %20, align 8, !tbaa !10
  %21 = or disjoint i64 %.074.us, 1
  %22 = icmp eq i64 %.06676.us, %21
  %23 = load ptr, ptr %14, align 8, !tbaa !5
  %24 = getelementptr inbounds ptr, ptr %23, i64 %.06676.us
  %25 = load ptr, ptr %24, align 8, !tbaa !8
  %..1 = select i1 %22, double 1.000000e+00, double 0.000000e+00
  %26 = getelementptr inbounds double, ptr %25, i64 %21
  store double %..1, ptr %26, align 8, !tbaa !10
  %27 = add nuw nsw i64 %.074.us, 2
  %niter.next.1 = add i64 %niter, 2
  %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
  br i1 %niter.ncmp.1, label %._crit_edge.us.unr-lcssa, label %.preheader72.us.new, !llvm.loop !12

._crit_edge.us.unr-lcssa:                         ; preds = %.preheader72.us.new, %.preheader72.us
  %.074.us.unr = phi i64 [ 0, %.preheader72.us ], [ %27, %.preheader72.us.new ]
  br i1 %lcmp.mod.not, label %._crit_edge.us, label %._crit_edge.us.epilog-lcssa

._crit_edge.us.epilog-lcssa:                      ; preds = %._crit_edge.us.unr-lcssa
  %28 = icmp eq i64 %.06676.us, %.074.us.unr
  %29 = load ptr, ptr %14, align 8, !tbaa !5
  %30 = getelementptr inbounds ptr, ptr %29, i64 %.06676.us
  %31 = load ptr, ptr %30, align 8, !tbaa !8
  %..epil = select i1 %28, double 1.000000e+00, double 0.000000e+00
  %32 = getelementptr inbounds double, ptr %31, i64 %.074.us.unr
  store double %..epil, ptr %32, align 8, !tbaa !10
  br label %._crit_edge.us

._crit_edge.us:                                   ; preds = %._crit_edge.us.unr-lcssa, %._crit_edge.us.epilog-lcssa
  %33 = add nuw nsw i64 %.06676.us, 1
  %exitcond83.not = icmp eq i64 %33, %1
  br i1 %exitcond83.not, label %._crit_edge77, label %.preheader72.us, !llvm.loop !14

._crit_edge77:                                    ; preds = %._crit_edge.us, %11
  %34 = call noundef zeroext i1 @_ZN11alglib_impl19smatrixtdunpackqmklEPNS_9ae_matrixElbPNS_9ae_vectorES1_PNS_8ae_stateE(ptr noundef %0, i64 noundef %1, i1 noundef zeroext %2, ptr noundef %3, ptr noundef %4, ptr noundef %5)
  br i1 %34, label %.loopexit, label %35

35:                                               ; preds = %._crit_edge77
  br i1 %2, label %.preheader, label %54

.preheader:                                       ; preds = %35
  %.not79 = icmp slt i64 %1, 2
  br i1 %.not79, label %.loopexit, label %.lr.ph81

.lr.ph81:                                         ; preds = %.preheader
  %36 = getelementptr inbounds i8, ptr %8, i64 56
  %37 = getelementptr inbounds i8, ptr %0, i64 72
  %38 = getelementptr inbounds i8, ptr %0, i64 16
  %39 = getelementptr inbounds i8, ptr %3, i64 56
  br label %40

40:                                               ; preds = %.lr.ph81, %40
  %.180 = phi i64 [ 0, %.lr.ph81 ], [ %45, %40 ]
  %41 = load ptr, ptr %36, align 8, !tbaa !5
  %42 = getelementptr inbounds i8, ptr %41, i64 8
  %43 = load ptr, ptr %37, align 8, !tbaa !5
  %44 = load ptr, ptr %43, align 8, !tbaa !8
  %45 = add nuw nsw i64 %.180, 1
  %46 = getelementptr inbounds double, ptr %44, i64 %45
  %47 = load i64, ptr %38, align 8, !tbaa !15
  %48 = call noundef i64 @_ZN11alglib_impl8ae_v_lenEll(i64 noundef 1, i64 noundef %45)
  call void @_ZN11alglib_impl9ae_v_moveEPdlPKdll(ptr noundef nonnull %42, i64 noundef 1, ptr noundef nonnull %46, i64 noundef %47, i64 noundef %48)
  %49 = load ptr, ptr %36, align 8, !tbaa !5
  %50 = getelementptr inbounds double, ptr %49, i64 %45
  store double 1.000000e+00, ptr %50, align 8, !tbaa !10
  %51 = load ptr, ptr %39, align 8, !tbaa !5
  %52 = getelementptr inbounds double, ptr %51, i64 %.180
  %53 = load double, ptr %52, align 8, !tbaa !10
  call void @_ZN11alglib_impl26applyreflectionfromtheleftEPNS_9ae_matrixEdPNS_9ae_vectorEllllS3_PNS_8ae_stateE(ptr noundef %4, double noundef %53, ptr noundef nonnull %8, i64 noundef 0, i64 noundef %.180, i64 noundef 0, i64 noundef %12, ptr noundef nonnull %9, ptr noundef %5)
  %exitcond84.not = icmp eq i64 %45, %12
  br i1 %exitcond84.not, label %.loopexit, label %40, !llvm.loop !20

54:                                               ; preds = %35
  %55 = icmp sgt i64 %1, 1
  br i1 %55, label %.lr.ph, label %.loopexit

.lr.ph:                                           ; preds = %54
  %56 = add nsw i64 %1, -2
  %57 = getelementptr inbounds i8, ptr %8, i64 56
  %58 = getelementptr inbounds i8, ptr %0, i64 72
  %59 = getelementptr inbounds i8, ptr %0, i64 16
  %60 = getelementptr inbounds i8, ptr %3, i64 56
  br label %61

61:                                               ; preds = %.lr.ph, %61
  %.278 = phi i64 [ %56, %.lr.ph ], [ %78, %61 ]
  %62 = load ptr, ptr %57, align 8, !tbaa !5
  %63 = getelementptr inbounds i8, ptr %62, i64 8
  %64 = load ptr, ptr %58, align 8, !tbaa !5
  %65 = add nuw nsw i64 %.278, 1
  %66 = getelementptr inbounds ptr, ptr %64, i64 %65
  %67 = load ptr, ptr %66, align 8, !tbaa !8
  %68 = getelementptr inbounds double, ptr %67, i64 %.278
  %69 = load i64, ptr %59, align 8, !tbaa !15
  %70 = xor i64 %.278, -1
  %71 = add i64 %70, %1
  %72 = call noundef i64 @_ZN11alglib_impl8ae_v_lenEll(i64 noundef 1, i64 noundef %71)
  call void @_ZN11alglib_impl9ae_v_moveEPdlPKdll(ptr noundef nonnull %63, i64 noundef 1, ptr noundef %68, i64 noundef %69, i64 noundef %72)
  %73 = load ptr, ptr %57, align 8, !tbaa !5
  %74 = getelementptr inbounds i8, ptr %73, i64 8
  store double 1.000000e+00, ptr %74, align 8, !tbaa !10
  %75 = load ptr, ptr %60, align 8, !tbaa !5
  %76 = getelementptr inbounds double, ptr %75, i64 %.278
  %77 = load double, ptr %76, align 8, !tbaa !10
  call void @_ZN11alglib_impl26applyreflectionfromtheleftEPNS_9ae_matrixEdPNS_9ae_vectorEllllS3_PNS_8ae_stateE(ptr noundef %4, double noundef %77, ptr noundef nonnull %8, i64 noundef %65, i64 noundef %12, i64 noundef 0, i64 noundef %12, ptr noundef nonnull %9, ptr noundef %5)
  %78 = add nsw i64 %.278, -1
  %.not = icmp eq i64 %.278, 0
  br i1 %.not, label %.loopexit, label %61, !llvm.loop !21

.loopexit:                                        ; preds = %61, %40, %.preheader, %54, %._crit_edge77, %6
  call void @_ZN11alglib_impl14ae_frame_leaveEPNS_8ae_stateE(ptr noundef %5)
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %9) #4
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %8) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %7) #4
  ret void
}

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

declare void @_ZN11alglib_impl13ae_frame_makeEPNS_8ae_stateEPNS_8ae_frameE(ptr noundef, ptr noundef) 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_impl20ae_vector_set_lengthEPNS_9ae_vectorElPNS_8ae_stateE(ptr noundef, i64 noundef, ptr noundef) local_unnamed_addr #3

declare void @_ZN11alglib_impl14ae_frame_leaveEPNS_8ae_stateE(ptr noundef) local_unnamed_addr #3

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN11alglib_impl26applyreflectionfromtheleftEPNS_9ae_matrixEdPNS_9ae_vectorEllllS3_PNS_8ae_stateE(ptr noundef, double noundef, ptr noundef, i64 noundef, i64 noundef, i64 noundef, i64 noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

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

declare void @_ZN11alglib_impl15ae_matrix_clearEPNS_9ae_matrixE(ptr noundef) local_unnamed_addr #3

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

declare noundef zeroext i1 @_ZN11alglib_impl19smatrixtdunpackqmklEPNS_9ae_matrixElbPNS_9ae_vectorES1_PNS_8ae_stateE(ptr noundef, i64 noundef, i1 noundef zeroext, ptr 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 = { 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 = { 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 = !{!16, !17, i64 16}
!16 = !{!"_ZTSN11alglib_impl9ae_matrixE", !17, i64 0, !17, i64 8, !17, i64 16, !17, i64 24, !18, i64 32, !19, i64 40, !6, i64 72}
!17 = !{!"long", !6, i64 0}
!18 = !{!"bool", !6, i64 0}
!19 = !{!"_ZTSN11alglib_impl12ae_dyn_blockE", !9, i64 0, !9, i64 8, !9, i64 16, !9, i64 24}
!20 = distinct !{!20, !13}
!21 = distinct !{!21, !13}


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