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

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

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

@.str.200 = external hidden unnamed_addr constant [2 x i8], align 1

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN11alglib_impl16hmatrixtdunpackqEPNS_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) #3 {
  %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
  %19 = alloca %"struct.alglib_impl::ae_complex", align 8
  %20 = alloca %"struct.alglib_impl::ae_complex", align 8
  %21 = alloca %"struct.alglib_impl::ae_complex", align 8
  %22 = alloca %"struct.alglib_impl::ae_complex", align 8
  %23 = alloca %"struct.alglib_impl::ae_complex", align 8
  %24 = 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
  %25 = zext i1 %2 to i8
  store i8 %25, 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) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #5
  call void @llvm.lifetime.start.p0(i64 64, ptr %16) #5
  call void @llvm.lifetime.start.p0(i64 64, ptr %17) #5
  %26 = load ptr, ptr %12, align 8, !tbaa !5
  call void @_ZN11alglib_impl13ae_frame_makeEPNS_8ae_stateEPNS_8ae_frameE(ptr noundef %26, 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)
  %27 = load ptr, ptr %11, align 8, !tbaa !5
  call void @_ZN11alglib_impl15ae_matrix_clearEPNS_9ae_matrixE(ptr noundef %27)
  %28 = 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 4, ptr noundef %28, i1 noundef zeroext true)
  %29 = 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 4, ptr noundef %29, i1 noundef zeroext true)
  %30 = load i64, ptr %8, align 8, !tbaa !9
  %31 = icmp eq i64 %30, 0
  br i1 %31, label %32, label %34

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

34:                                               ; preds = %6
  %35 = load ptr, ptr %11, align 8, !tbaa !5
  %36 = load i64, ptr %8, align 8, !tbaa !9
  %37 = sub nsw i64 %36, 1
  %38 = add nsw i64 %37, 1
  %39 = load i64, ptr %8, align 8, !tbaa !9
  %40 = sub nsw i64 %39, 1
  %41 = add nsw i64 %40, 1
  %42 = load ptr, ptr %12, align 8, !tbaa !5
  call void @_ZN11alglib_impl20ae_matrix_set_lengthEPNS_9ae_matrixEllPNS_8ae_stateE(ptr noundef %35, i64 noundef %38, i64 noundef %41, ptr noundef %42)
  %43 = load i64, ptr %8, align 8, !tbaa !9
  %44 = add nsw i64 %43, 1
  %45 = load ptr, ptr %12, align 8, !tbaa !5
  call void @_ZN11alglib_impl20ae_vector_set_lengthEPNS_9ae_vectorElPNS_8ae_stateE(ptr noundef %16, i64 noundef %44, ptr noundef %45)
  %46 = load i64, ptr %8, align 8, !tbaa !9
  %47 = sub nsw i64 %46, 1
  %48 = add nsw i64 %47, 1
  %49 = load ptr, ptr %12, align 8, !tbaa !5
  call void @_ZN11alglib_impl20ae_vector_set_lengthEPNS_9ae_vectorElPNS_8ae_stateE(ptr noundef %17, i64 noundef %48, ptr noundef %49)
  %50 = load ptr, ptr %7, align 8, !tbaa !5
  %51 = load i64, ptr %8, align 8, !tbaa !9
  %52 = load i8, ptr %9, align 1, !tbaa !11, !range !13, !noundef !14
  %53 = trunc i8 %52 to i1
  %54 = load ptr, ptr %10, align 8, !tbaa !5
  %55 = load ptr, ptr %11, align 8, !tbaa !5
  %56 = load ptr, ptr %12, align 8, !tbaa !5
  %57 = call noundef zeroext i1 @_ZN11alglib_impl19hmatrixtdunpackqmklEPNS_9ae_matrixElbPNS_9ae_vectorES1_PNS_8ae_stateE(ptr noundef %50, i64 noundef %51, i1 noundef zeroext %53, ptr noundef %54, ptr noundef %55, ptr noundef %56)
  br i1 %57, label %58, label %60

58:                                               ; preds = %34
  %59 = load ptr, ptr %12, align 8, !tbaa !5
  call void @_ZN11alglib_impl14ae_frame_leaveEPNS_8ae_stateE(ptr noundef %59)
  store i32 1, ptr %18, align 4
  br label %225

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

61:                                               ; preds = %109, %60
  %62 = load i64, ptr %14, 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 %112

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

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

72:                                               ; preds = %67
  %73 = load i64, ptr %14, align 8, !tbaa !9
  %74 = load i64, ptr %15, align 8, !tbaa !9
  %75 = icmp eq i64 %73, %74
  br i1 %75, label %76, label %90

76:                                               ; preds = %72
  call void @llvm.lifetime.start.p0(i64 16, ptr %19) #5
  %77 = call { double, double } @_ZN11alglib_impl17ae_complex_from_iEl(i64 noundef 1)
  %78 = getelementptr inbounds { double, double }, ptr %19, i32 0, i32 0
  %79 = extractvalue { double, double } %77, 0
  store double %79, ptr %78, align 8
  %80 = getelementptr inbounds { double, double }, ptr %19, i32 0, i32 1
  %81 = extractvalue { double, double } %77, 1
  store double %81, ptr %80, align 8
  %82 = load ptr, ptr %11, align 8, !tbaa !5
  %83 = getelementptr inbounds %"struct.alglib_impl::ae_matrix", ptr %82, i32 0, i32 6
  %84 = load ptr, ptr %83, align 8, !tbaa !15
  %85 = load i64, ptr %14, align 8, !tbaa !9
  %86 = getelementptr inbounds ptr, ptr %84, i64 %85
  %87 = load ptr, ptr %86, align 8, !tbaa !5
  %88 = load i64, ptr %15, align 8, !tbaa !9
  %89 = getelementptr inbounds %"struct.alglib_impl::ae_complex", ptr %87, i64 %88
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %89, ptr align 8 %19, i64 16, i1 false), !tbaa.struct !16
  call void @llvm.lifetime.end.p0(i64 16, ptr %19) #5
  br label %104

90:                                               ; preds = %72
  call void @llvm.lifetime.start.p0(i64 16, ptr %20) #5
  %91 = call { double, double } @_ZN11alglib_impl17ae_complex_from_iEl(i64 noundef 0)
  %92 = getelementptr inbounds { double, double }, ptr %20, i32 0, i32 0
  %93 = extractvalue { double, double } %91, 0
  store double %93, ptr %92, align 8
  %94 = getelementptr inbounds { double, double }, ptr %20, i32 0, i32 1
  %95 = extractvalue { double, double } %91, 1
  store double %95, ptr %94, align 8
  %96 = load ptr, ptr %11, align 8, !tbaa !5
  %97 = getelementptr inbounds %"struct.alglib_impl::ae_matrix", ptr %96, i32 0, i32 6
  %98 = load ptr, ptr %97, align 8, !tbaa !15
  %99 = load i64, ptr %14, align 8, !tbaa !9
  %100 = getelementptr inbounds ptr, ptr %98, i64 %99
  %101 = load ptr, ptr %100, align 8, !tbaa !5
  %102 = load i64, ptr %15, align 8, !tbaa !9
  %103 = getelementptr inbounds %"struct.alglib_impl::ae_complex", ptr %101, i64 %102
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %103, ptr align 8 %20, i64 16, i1 false), !tbaa.struct !16
  call void @llvm.lifetime.end.p0(i64 16, ptr %20) #5
  br label %104

104:                                              ; preds = %90, %76
  br label %105

105:                                              ; preds = %104
  %106 = load i64, ptr %15, align 8, !tbaa !9
  %107 = add nsw i64 %106, 1
  store i64 %107, ptr %15, align 8, !tbaa !9
  br label %67, !llvm.loop !19

108:                                              ; preds = %67
  br label %109

109:                                              ; preds = %108
  %110 = load i64, ptr %14, align 8, !tbaa !9
  %111 = add nsw i64 %110, 1
  store i64 %111, ptr %14, align 8, !tbaa !9
  br label %61, !llvm.loop !21

112:                                              ; preds = %61
  %113 = load i8, ptr %9, align 1, !tbaa !11, !range !13, !noundef !14
  %114 = trunc i8 %113 to i1
  br i1 %114, label %115, label %167

115:                                              ; preds = %112
  store i64 0, ptr %14, align 8, !tbaa !9
  br label %116

116:                                              ; preds = %163, %115
  %117 = load i64, ptr %14, align 8, !tbaa !9
  %118 = load i64, ptr %8, align 8, !tbaa !9
  %119 = sub nsw i64 %118, 2
  %120 = icmp sle i64 %117, %119
  br i1 %120, label %121, label %166

121:                                              ; preds = %116
  %122 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %16, i32 0, i32 4
  %123 = load ptr, ptr %122, align 8, !tbaa !15
  %124 = getelementptr inbounds %"struct.alglib_impl::ae_complex", ptr %123, i64 1
  %125 = load ptr, ptr %7, align 8, !tbaa !5
  %126 = getelementptr inbounds %"struct.alglib_impl::ae_matrix", ptr %125, i32 0, i32 6
  %127 = load ptr, ptr %126, align 8, !tbaa !15
  %128 = getelementptr inbounds ptr, ptr %127, i64 0
  %129 = load ptr, ptr %128, align 8, !tbaa !5
  %130 = load i64, ptr %14, align 8, !tbaa !9
  %131 = add nsw i64 %130, 1
  %132 = getelementptr inbounds %"struct.alglib_impl::ae_complex", ptr %129, i64 %131
  %133 = load ptr, ptr %7, align 8, !tbaa !5
  %134 = getelementptr inbounds %"struct.alglib_impl::ae_matrix", ptr %133, i32 0, i32 2
  %135 = load i64, ptr %134, align 8, !tbaa !22
  %136 = load i64, ptr %14, align 8, !tbaa !9
  %137 = add nsw i64 %136, 1
  %138 = call noundef i64 @_ZN11alglib_impl8ae_v_lenEll(i64 noundef 1, i64 noundef %137)
  call void @_ZN11alglib_impl10ae_v_cmoveEPNS_10ae_complexElPKS0_lPKcl(ptr noundef %124, i64 noundef 1, ptr noundef %132, i64 noundef %135, ptr noundef @.str.200, i64 noundef %138)
  call void @llvm.lifetime.start.p0(i64 16, ptr %21) #5
  %139 = call { double, double } @_ZN11alglib_impl17ae_complex_from_iEl(i64 noundef 1)
  %140 = getelementptr inbounds { double, double }, ptr %21, i32 0, i32 0
  %141 = extractvalue { double, double } %139, 0
  store double %141, ptr %140, align 8
  %142 = getelementptr inbounds { double, double }, ptr %21, i32 0, i32 1
  %143 = extractvalue { double, double } %139, 1
  store double %143, ptr %142, align 8
  %144 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %16, i32 0, i32 4
  %145 = load ptr, ptr %144, align 8, !tbaa !15
  %146 = load i64, ptr %14, align 8, !tbaa !9
  %147 = add nsw i64 %146, 1
  %148 = getelementptr inbounds %"struct.alglib_impl::ae_complex", ptr %145, i64 %147
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %148, ptr align 8 %21, i64 16, i1 false), !tbaa.struct !16
  call void @llvm.lifetime.end.p0(i64 16, ptr %21) #5
  %149 = load ptr, ptr %11, align 8, !tbaa !5
  %150 = load ptr, ptr %10, align 8, !tbaa !5
  %151 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %150, i32 0, i32 4
  %152 = load ptr, ptr %151, align 8, !tbaa !15
  %153 = load i64, ptr %14, align 8, !tbaa !9
  %154 = getelementptr inbounds %"struct.alglib_impl::ae_complex", ptr %152, i64 %153
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %22, ptr align 8 %154, i64 16, i1 false), !tbaa.struct !16
  %155 = load i64, ptr %14, align 8, !tbaa !9
  %156 = load i64, ptr %8, align 8, !tbaa !9
  %157 = sub nsw i64 %156, 1
  %158 = load ptr, ptr %12, align 8, !tbaa !5
  %159 = getelementptr inbounds { double, double }, ptr %22, i32 0, i32 0
  %160 = load double, ptr %159, align 8
  %161 = getelementptr inbounds { double, double }, ptr %22, i32 0, i32 1
  %162 = load double, ptr %161, align 8
  call void @_ZN11alglib_impl33complexapplyreflectionfromtheleftEPNS_9ae_matrixENS_10ae_complexEPNS_9ae_vectorEllllS4_PNS_8ae_stateE(ptr noundef %149, double %160, double %162, ptr noundef %16, i64 noundef 0, i64 noundef %155, i64 noundef 0, i64 noundef %157, ptr noundef %17, ptr noundef %158)
  br label %163

163:                                              ; preds = %121
  %164 = load i64, ptr %14, align 8, !tbaa !9
  %165 = add nsw i64 %164, 1
  store i64 %165, ptr %14, align 8, !tbaa !9
  br label %116, !llvm.loop !25

166:                                              ; preds = %116
  br label %223

167:                                              ; preds = %112
  %168 = load i64, ptr %8, align 8, !tbaa !9
  %169 = sub nsw i64 %168, 2
  store i64 %169, ptr %14, align 8, !tbaa !9
  br label %170

170:                                              ; preds = %219, %167
  %171 = load i64, ptr %14, align 8, !tbaa !9
  %172 = icmp sge i64 %171, 0
  br i1 %172, label %173, label %222

173:                                              ; preds = %170
  %174 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %16, i32 0, i32 4
  %175 = load ptr, ptr %174, align 8, !tbaa !15
  %176 = getelementptr inbounds %"struct.alglib_impl::ae_complex", ptr %175, i64 1
  %177 = load ptr, ptr %7, align 8, !tbaa !5
  %178 = getelementptr inbounds %"struct.alglib_impl::ae_matrix", ptr %177, i32 0, i32 6
  %179 = load ptr, ptr %178, align 8, !tbaa !15
  %180 = load i64, ptr %14, align 8, !tbaa !9
  %181 = add nsw i64 %180, 1
  %182 = getelementptr inbounds ptr, ptr %179, i64 %181
  %183 = load ptr, ptr %182, align 8, !tbaa !5
  %184 = load i64, ptr %14, align 8, !tbaa !9
  %185 = getelementptr inbounds %"struct.alglib_impl::ae_complex", ptr %183, i64 %184
  %186 = load ptr, ptr %7, align 8, !tbaa !5
  %187 = getelementptr inbounds %"struct.alglib_impl::ae_matrix", ptr %186, i32 0, i32 2
  %188 = load i64, ptr %187, align 8, !tbaa !22
  %189 = load i64, ptr %8, align 8, !tbaa !9
  %190 = load i64, ptr %14, align 8, !tbaa !9
  %191 = sub nsw i64 %189, %190
  %192 = sub nsw i64 %191, 1
  %193 = call noundef i64 @_ZN11alglib_impl8ae_v_lenEll(i64 noundef 1, i64 noundef %192)
  call void @_ZN11alglib_impl10ae_v_cmoveEPNS_10ae_complexElPKS0_lPKcl(ptr noundef %176, i64 noundef 1, ptr noundef %185, i64 noundef %188, ptr noundef @.str.200, i64 noundef %193)
  call void @llvm.lifetime.start.p0(i64 16, ptr %23) #5
  %194 = call { double, double } @_ZN11alglib_impl17ae_complex_from_iEl(i64 noundef 1)
  %195 = getelementptr inbounds { double, double }, ptr %23, i32 0, i32 0
  %196 = extractvalue { double, double } %194, 0
  store double %196, ptr %195, align 8
  %197 = getelementptr inbounds { double, double }, ptr %23, i32 0, i32 1
  %198 = extractvalue { double, double } %194, 1
  store double %198, ptr %197, align 8
  %199 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %16, i32 0, i32 4
  %200 = load ptr, ptr %199, align 8, !tbaa !15
  %201 = getelementptr inbounds %"struct.alglib_impl::ae_complex", ptr %200, i64 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %201, ptr align 8 %23, i64 16, i1 false), !tbaa.struct !16
  call void @llvm.lifetime.end.p0(i64 16, ptr %23) #5
  %202 = load ptr, ptr %11, align 8, !tbaa !5
  %203 = load ptr, ptr %10, align 8, !tbaa !5
  %204 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %203, i32 0, i32 4
  %205 = load ptr, ptr %204, align 8, !tbaa !15
  %206 = load i64, ptr %14, align 8, !tbaa !9
  %207 = getelementptr inbounds %"struct.alglib_impl::ae_complex", ptr %205, i64 %206
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %24, ptr align 8 %207, i64 16, i1 false), !tbaa.struct !16
  %208 = load i64, ptr %14, align 8, !tbaa !9
  %209 = add nsw i64 %208, 1
  %210 = load i64, ptr %8, align 8, !tbaa !9
  %211 = sub nsw i64 %210, 1
  %212 = load i64, ptr %8, align 8, !tbaa !9
  %213 = sub nsw i64 %212, 1
  %214 = load ptr, ptr %12, align 8, !tbaa !5
  %215 = getelementptr inbounds { double, double }, ptr %24, i32 0, i32 0
  %216 = load double, ptr %215, align 8
  %217 = getelementptr inbounds { double, double }, ptr %24, i32 0, i32 1
  %218 = load double, ptr %217, align 8
  call void @_ZN11alglib_impl33complexapplyreflectionfromtheleftEPNS_9ae_matrixENS_10ae_complexEPNS_9ae_vectorEllllS4_PNS_8ae_stateE(ptr noundef %202, double %216, double %218, ptr noundef %16, i64 noundef %209, i64 noundef %211, i64 noundef 0, i64 noundef %213, ptr noundef %17, ptr noundef %214)
  br label %219

219:                                              ; preds = %173
  %220 = load i64, ptr %14, align 8, !tbaa !9
  %221 = add nsw i64 %220, -1
  store i64 %221, ptr %14, align 8, !tbaa !9
  br label %170, !llvm.loop !26

222:                                              ; preds = %170
  br label %223

223:                                              ; preds = %222, %166
  %224 = load ptr, ptr %12, align 8, !tbaa !5
  call void @_ZN11alglib_impl14ae_frame_leaveEPNS_8ae_stateE(ptr noundef %224)
  store i32 0, ptr %18, align 4
  br label %225

225:                                              ; preds = %223, %58, %32
  call void @llvm.lifetime.end.p0(i64 64, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 64, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %13) #5
  %226 = load i32, ptr %18, align 4
  switch i32 %226, label %228 [
    i32 0, label %227
    i32 1, label %227
  ]

227:                                              ; preds = %225, %225
  ret void

228:                                              ; preds = %225
  unreachable
}

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

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

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

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

declare void @_ZN11alglib_impl14ae_frame_leaveEPNS_8ae_stateE(ptr noundef) #4

declare void @_ZN11alglib_impl10ae_v_cmoveEPNS_10ae_complexElPKS0_lPKcl(ptr noundef, i64 noundef, ptr noundef, i64 noundef, ptr noundef, i64 noundef) #4

declare { double, double } @_ZN11alglib_impl17ae_complex_from_iEl(i64 noundef) #4

declare void @_ZN11alglib_impl15ae_matrix_clearEPNS_9ae_matrixE(ptr noundef) #4

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

declare void @_ZN11alglib_impl33complexapplyreflectionfromtheleftEPNS_9ae_matrixENS_10ae_complexEPNS_9ae_vectorEllllS4_PNS_8ae_stateE(ptr noundef, double, double, ptr noundef, i64 noundef, i64 noundef, i64 noundef, i64 noundef, ptr noundef, ptr noundef) #4

declare noundef zeroext i1 @_ZN11alglib_impl19hmatrixtdunpackqmklEPNS_9ae_matrixElbPNS_9ae_vectorES1_PNS_8ae_stateE(ptr noundef, i64 noundef, i1 noundef zeroext, ptr noundef, ptr noundef, ptr noundef) #4

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #2 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"bool", !7, i64 0}
!13 = !{i8 0, i8 2}
!14 = !{}
!15 = !{!7, !7, i64 0}
!16 = !{i64 0, i64 8, !17, i64 8, i64 8, !17}
!17 = !{!18, !18, i64 0}
!18 = !{!"double", !7, i64 0}
!19 = distinct !{!19, !20}
!20 = !{!"llvm.loop.mustprogress"}
!21 = distinct !{!21, !20}
!22 = !{!23, !10, i64 16}
!23 = !{!"_ZTSN11alglib_impl9ae_matrixE", !10, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !12, i64 32, !24, i64 40, !7, i64 72}
!24 = !{!"_ZTSN11alglib_impl12ae_dyn_blockE", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!25 = distinct !{!25, !20}
!26 = distinct !{!26, !20}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

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

@.str.200 = external hidden unnamed_addr constant [2 x i8], align 1

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN11alglib_impl16hmatrixtdunpackqEPNS_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 4, 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 4, 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)
  %14 = call noundef zeroext i1 @_ZN11alglib_impl19hmatrixtdunpackqmklEPNS_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 %14, label %.loopexit, label %.preheader82

.preheader82:                                     ; preds = %11
  %.not.not85 = icmp sgt i64 %1, 0
  br i1 %.not.not85, label %.preheader81.lr.ph, label %._crit_edge87

.preheader81.lr.ph:                               ; preds = %.preheader82
  %15 = getelementptr inbounds i8, ptr %4, i64 72
  br label %.preheader81.us

.preheader81.us:                                  ; preds = %._crit_edge.us, %.preheader81.lr.ph
  %.086.us = phi i64 [ 0, %.preheader81.lr.ph ], [ %26, %._crit_edge.us ]
  br label %16

16:                                               ; preds = %.preheader81.us, %16
  %.07584.us = phi i64 [ 0, %.preheader81.us ], [ %25, %16 ]
  %17 = icmp eq i64 %.086.us, %.07584.us
  %. = zext i1 %17 to i64
  %18 = call { double, double } @_ZN11alglib_impl17ae_complex_from_iEl(i64 noundef %.)
  %19 = extractvalue { double, double } %18, 0
  %20 = extractvalue { double, double } %18, 1
  %21 = load ptr, ptr %15, align 8, !tbaa !5
  %22 = getelementptr inbounds ptr, ptr %21, i64 %.086.us
  %23 = load ptr, ptr %22, align 8, !tbaa !8
  %24 = getelementptr inbounds %"struct.alglib_impl::ae_complex", ptr %23, i64 %.07584.us
  store double %19, ptr %24, align 8, !tbaa !10
  %.sroa.49.0..sroa_idx.us = getelementptr inbounds i8, ptr %24, i64 8
  store double %20, ptr %.sroa.49.0..sroa_idx.us, align 8, !tbaa !10
  %25 = add nuw nsw i64 %.07584.us, 1
  %exitcond.not = icmp eq i64 %25, %1
  br i1 %exitcond.not, label %._crit_edge.us, label %16, !llvm.loop !12

._crit_edge.us:                                   ; preds = %16
  %26 = add nuw nsw i64 %.086.us, 1
  %exitcond93.not = icmp eq i64 %26, %1
  br i1 %exitcond93.not, label %._crit_edge87, label %.preheader81.us, !llvm.loop !14

._crit_edge87:                                    ; preds = %._crit_edge.us, %.preheader82
  br i1 %2, label %.preheader, label %47

.preheader:                                       ; preds = %._crit_edge87
  %.not89 = icmp slt i64 %1, 2
  br i1 %.not89, label %.loopexit, label %.lr.ph91

.lr.ph91:                                         ; preds = %.preheader
  %27 = getelementptr inbounds i8, ptr %8, i64 56
  %28 = getelementptr inbounds i8, ptr %0, i64 72
  %29 = getelementptr inbounds i8, ptr %0, i64 16
  %30 = getelementptr inbounds i8, ptr %3, i64 56
  br label %31

31:                                               ; preds = %.lr.ph91, %31
  %.190 = phi i64 [ 0, %.lr.ph91 ], [ %36, %31 ]
  %32 = load ptr, ptr %27, align 8, !tbaa !5
  %33 = getelementptr inbounds i8, ptr %32, i64 16
  %34 = load ptr, ptr %28, align 8, !tbaa !5
  %35 = load ptr, ptr %34, align 8, !tbaa !8
  %36 = add nuw nsw i64 %.190, 1
  %37 = getelementptr inbounds %"struct.alglib_impl::ae_complex", ptr %35, i64 %36
  %38 = load i64, ptr %29, align 8, !tbaa !15
  %39 = call noundef i64 @_ZN11alglib_impl8ae_v_lenEll(i64 noundef 1, i64 noundef %36)
  call void @_ZN11alglib_impl10ae_v_cmoveEPNS_10ae_complexElPKS0_lPKcl(ptr noundef nonnull %33, i64 noundef 1, ptr noundef nonnull %37, i64 noundef %38, ptr noundef nonnull @.str.200, i64 noundef %39)
  %40 = call { double, double } @_ZN11alglib_impl17ae_complex_from_iEl(i64 noundef 1)
  %41 = extractvalue { double, double } %40, 0
  %42 = extractvalue { double, double } %40, 1
  %43 = load ptr, ptr %27, align 8, !tbaa !5
  %44 = getelementptr inbounds %"struct.alglib_impl::ae_complex", ptr %43, i64 %36
  store double %41, ptr %44, align 8, !tbaa !10
  %.sroa.45.0..sroa_idx = getelementptr inbounds i8, ptr %44, i64 8
  store double %42, ptr %.sroa.45.0..sroa_idx, align 8, !tbaa !10
  %45 = load ptr, ptr %30, align 8, !tbaa !5
  %46 = getelementptr inbounds %"struct.alglib_impl::ae_complex", ptr %45, i64 %.190
  %.sroa.02.0.copyload = load double, ptr %46, align 8, !tbaa !10
  %.sroa.23.0..sroa_idx = getelementptr inbounds i8, ptr %46, i64 8
  %.sroa.23.0.copyload = load double, ptr %.sroa.23.0..sroa_idx, align 8, !tbaa !10
  call void @_ZN11alglib_impl33complexapplyreflectionfromtheleftEPNS_9ae_matrixENS_10ae_complexEPNS_9ae_vectorEllllS4_PNS_8ae_stateE(ptr noundef %4, double %.sroa.02.0.copyload, double %.sroa.23.0.copyload, ptr noundef nonnull %8, i64 noundef 0, i64 noundef %.190, i64 noundef 0, i64 noundef %12, ptr noundef nonnull %9, ptr noundef %5)
  %exitcond94.not = icmp eq i64 %36, %12
  br i1 %exitcond94.not, label %.loopexit, label %31, !llvm.loop !20

47:                                               ; preds = %._crit_edge87
  %48 = icmp sgt i64 %1, 1
  br i1 %48, label %.lr.ph, label %.loopexit

.lr.ph:                                           ; preds = %47
  %49 = add nsw i64 %1, -2
  %50 = getelementptr inbounds i8, ptr %8, i64 56
  %51 = getelementptr inbounds i8, ptr %0, i64 72
  %52 = getelementptr inbounds i8, ptr %0, i64 16
  %53 = getelementptr inbounds i8, ptr %3, i64 56
  br label %54

54:                                               ; preds = %.lr.ph, %54
  %.288 = phi i64 [ %49, %.lr.ph ], [ %73, %54 ]
  %55 = load ptr, ptr %50, align 8, !tbaa !5
  %56 = getelementptr inbounds i8, ptr %55, i64 16
  %57 = load ptr, ptr %51, align 8, !tbaa !5
  %58 = add nuw nsw i64 %.288, 1
  %59 = getelementptr inbounds ptr, ptr %57, i64 %58
  %60 = load ptr, ptr %59, align 8, !tbaa !8
  %61 = getelementptr inbounds %"struct.alglib_impl::ae_complex", ptr %60, i64 %.288
  %62 = load i64, ptr %52, align 8, !tbaa !15
  %63 = xor i64 %.288, -1
  %64 = add i64 %63, %1
  %65 = call noundef i64 @_ZN11alglib_impl8ae_v_lenEll(i64 noundef 1, i64 noundef %64)
  call void @_ZN11alglib_impl10ae_v_cmoveEPNS_10ae_complexElPKS0_lPKcl(ptr noundef nonnull %56, i64 noundef 1, ptr noundef %61, i64 noundef %62, ptr noundef nonnull @.str.200, i64 noundef %65)
  %66 = call { double, double } @_ZN11alglib_impl17ae_complex_from_iEl(i64 noundef 1)
  %67 = extractvalue { double, double } %66, 0
  %68 = extractvalue { double, double } %66, 1
  %69 = load ptr, ptr %50, align 8, !tbaa !5
  %70 = getelementptr inbounds i8, ptr %69, i64 16
  store double %67, ptr %70, align 8, !tbaa !10
  %.sroa.4.0..sroa_idx = getelementptr inbounds i8, ptr %69, i64 24
  store double %68, ptr %.sroa.4.0..sroa_idx, align 8, !tbaa !10
  %71 = load ptr, ptr %53, align 8, !tbaa !5
  %72 = getelementptr inbounds %"struct.alglib_impl::ae_complex", ptr %71, i64 %.288
  %.sroa.0.0.copyload = load double, ptr %72, align 8, !tbaa !10
  %.sroa.2.0..sroa_idx = getelementptr inbounds i8, ptr %72, i64 8
  %.sroa.2.0.copyload = load double, ptr %.sroa.2.0..sroa_idx, align 8, !tbaa !10
  call void @_ZN11alglib_impl33complexapplyreflectionfromtheleftEPNS_9ae_matrixENS_10ae_complexEPNS_9ae_vectorEllllS4_PNS_8ae_stateE(ptr noundef %4, double %.sroa.0.0.copyload, double %.sroa.2.0.copyload, ptr noundef nonnull %8, i64 noundef %58, i64 noundef %12, i64 noundef 0, i64 noundef %12, ptr noundef nonnull %9, ptr noundef %5)
  %73 = add nsw i64 %.288, -1
  %.not = icmp eq i64 %.288, 0
  br i1 %.not, label %.loopexit, label %54, !llvm.loop !21

.loopexit:                                        ; preds = %54, %31, %.preheader, %47, %11, %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

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

declare { double, double } @_ZN11alglib_impl17ae_complex_from_iEl(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 void @_ZN11alglib_impl33complexapplyreflectionfromtheleftEPNS_9ae_matrixENS_10ae_complexEPNS_9ae_vectorEllllS4_PNS_8ae_stateE(ptr noundef, double, double, ptr noundef, i64 noundef, i64 noundef, i64 noundef, i64 noundef, ptr noundef, ptr noundef) local_unnamed_addr #3

declare noundef zeroext i1 @_ZN11alglib_impl19hmatrixtdunpackqmklEPNS_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,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass