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

; 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_vector" = type { 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::apbuffers" = type { %"struct.alglib_impl::ae_vector", %"struct.alglib_impl::ae_vector", %"struct.alglib_impl::ae_vector", %"struct.alglib_impl::ae_vector", %"struct.alglib_impl::ae_vector", %"struct.alglib_impl::ae_vector", %"struct.alglib_impl::ae_vector", %"struct.alglib_impl::ae_vector", %"struct.alglib_impl::ae_vector", %"struct.alglib_impl::ae_matrix", %"struct.alglib_impl::ae_matrix" }
%"struct.alglib_impl::ae_matrix" = type { i64, i64, i64, i64, i8, %"struct.alglib_impl::ae_dyn_block", %union.anon.0 }
%union.anon.0 = type { ptr }

; 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

declare noundef zeroext i1 @_ZN11alglib_impl8ae_fp_eqEdd(double noundef, double noundef) #1

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

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

declare noundef zeroext i1 @_ZN11alglib_impl9ae_fp_neqEdd(double noundef, double noundef) #1

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN11alglib_impl5rankxEPNS_9ae_vectorElbPNS_9apbuffersEPNS_8ae_stateE(ptr noundef %0, i64 noundef %1, i1 noundef zeroext %2, ptr noundef %3, ptr noundef %4) #2 {
  %6 = alloca ptr, align 8
  %7 = alloca i64, align 8
  %8 = alloca i8, align 1
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca i64, align 8
  %12 = alloca i64, align 8
  %13 = alloca i64, align 8
  %14 = alloca double, align 8
  %15 = alloca double, align 8
  %16 = alloca i32, align 4
  store ptr %0, ptr %6, align 8, !tbaa !5
  store i64 %1, ptr %7, align 8, !tbaa !9
  %17 = zext i1 %2 to i8
  store i8 %17, ptr %8, align 1, !tbaa !11
  store ptr %3, ptr %9, align 8, !tbaa !5
  store ptr %4, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #3
  %18 = load i64, ptr %7, align 8, !tbaa !9
  %19 = icmp slt i64 %18, 1
  br i1 %19, label %20, label %21

20:                                               ; preds = %5
  store i32 1, ptr %16, align 4
  br label %233

21:                                               ; preds = %5
  %22 = load i64, ptr %7, align 8, !tbaa !9
  %23 = icmp eq i64 %22, 1
  br i1 %23, label %24, label %29

24:                                               ; preds = %21
  %25 = load ptr, ptr %6, align 8, !tbaa !5
  %26 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %25, i32 0, i32 4
  %27 = load ptr, ptr %26, align 8, !tbaa !13
  %28 = getelementptr inbounds double, ptr %27, i64 0
  store double 0.000000e+00, ptr %28, align 8, !tbaa !14
  store i32 1, ptr %16, align 4
  br label %233

29:                                               ; preds = %21
  %30 = load ptr, ptr %9, align 8, !tbaa !5
  %31 = getelementptr inbounds %"struct.alglib_impl::apbuffers", ptr %30, i32 0, i32 6
  %32 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %31, i32 0, i32 0
  %33 = load i64, ptr %32, align 8, !tbaa !16
  %34 = load i64, ptr %7, align 8, !tbaa !9
  %35 = icmp slt i64 %33, %34
  br i1 %35, label %36, label %41

36:                                               ; preds = %29
  %37 = load ptr, ptr %9, align 8, !tbaa !5
  %38 = getelementptr inbounds %"struct.alglib_impl::apbuffers", ptr %37, i32 0, i32 6
  %39 = load i64, ptr %7, align 8, !tbaa !9
  %40 = load ptr, ptr %10, align 8, !tbaa !5
  call void @_ZN11alglib_impl20ae_vector_set_lengthEPNS_9ae_vectorElPNS_8ae_stateE(ptr noundef %38, i64 noundef %39, ptr noundef %40)
  br label %41

41:                                               ; preds = %36, %29
  %42 = load ptr, ptr %9, align 8, !tbaa !5
  %43 = getelementptr inbounds %"struct.alglib_impl::apbuffers", ptr %42, i32 0, i32 2
  %44 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %43, i32 0, i32 0
  %45 = load i64, ptr %44, align 8, !tbaa !21
  %46 = load i64, ptr %7, align 8, !tbaa !9
  %47 = icmp slt i64 %45, %46
  br i1 %47, label %48, label %53

48:                                               ; preds = %41
  %49 = load ptr, ptr %9, align 8, !tbaa !5
  %50 = getelementptr inbounds %"struct.alglib_impl::apbuffers", ptr %49, i32 0, i32 2
  %51 = load i64, ptr %7, align 8, !tbaa !9
  %52 = load ptr, ptr %10, align 8, !tbaa !5
  call void @_ZN11alglib_impl20ae_vector_set_lengthEPNS_9ae_vectorElPNS_8ae_stateE(ptr noundef %50, i64 noundef %51, ptr noundef %52)
  br label %53

53:                                               ; preds = %48, %41
  store i64 0, ptr %11, align 8, !tbaa !9
  br label %54

54:                                               ; preds = %79, %53
  %55 = load i64, ptr %11, align 8, !tbaa !9
  %56 = load i64, ptr %7, align 8, !tbaa !9
  %57 = sub nsw i64 %56, 1
  %58 = icmp sle i64 %55, %57
  br i1 %58, label %59, label %82

59:                                               ; preds = %54
  %60 = load ptr, ptr %6, align 8, !tbaa !5
  %61 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %60, i32 0, i32 4
  %62 = load ptr, ptr %61, align 8, !tbaa !13
  %63 = load i64, ptr %11, align 8, !tbaa !9
  %64 = getelementptr inbounds double, ptr %62, i64 %63
  %65 = load double, ptr %64, align 8, !tbaa !14
  %66 = load ptr, ptr %9, align 8, !tbaa !5
  %67 = getelementptr inbounds %"struct.alglib_impl::apbuffers", ptr %66, i32 0, i32 6
  %68 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %67, i32 0, i32 4
  %69 = load ptr, ptr %68, align 8, !tbaa !13
  %70 = load i64, ptr %11, align 8, !tbaa !9
  %71 = getelementptr inbounds double, ptr %69, i64 %70
  store double %65, ptr %71, align 8, !tbaa !14
  %72 = load i64, ptr %11, align 8, !tbaa !9
  %73 = load ptr, ptr %9, align 8, !tbaa !5
  %74 = getelementptr inbounds %"struct.alglib_impl::apbuffers", ptr %73, i32 0, i32 2
  %75 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %74, i32 0, i32 4
  %76 = load ptr, ptr %75, align 8, !tbaa !13
  %77 = load i64, ptr %11, align 8, !tbaa !9
  %78 = getelementptr inbounds i64, ptr %76, i64 %77
  store i64 %72, ptr %78, align 8, !tbaa !9
  br label %79

79:                                               ; preds = %59
  %80 = load i64, ptr %11, align 8, !tbaa !9
  %81 = add nsw i64 %80, 1
  store i64 %81, ptr %11, align 8, !tbaa !9
  br label %54, !llvm.loop !22

82:                                               ; preds = %54
  %83 = load ptr, ptr %9, align 8, !tbaa !5
  %84 = getelementptr inbounds %"struct.alglib_impl::apbuffers", ptr %83, i32 0, i32 6
  %85 = load ptr, ptr %9, align 8, !tbaa !5
  %86 = getelementptr inbounds %"struct.alglib_impl::apbuffers", ptr %85, i32 0, i32 2
  %87 = load ptr, ptr %9, align 8, !tbaa !5
  %88 = getelementptr inbounds %"struct.alglib_impl::apbuffers", ptr %87, i32 0, i32 7
  %89 = load ptr, ptr %9, align 8, !tbaa !5
  %90 = getelementptr inbounds %"struct.alglib_impl::apbuffers", ptr %89, i32 0, i32 3
  %91 = load i64, ptr %7, align 8, !tbaa !9
  %92 = load ptr, ptr %10, align 8, !tbaa !5
  call void @_ZN11alglib_impl12tagsortfastiEPNS_9ae_vectorES1_S1_S1_lPNS_8ae_stateE(ptr noundef %84, ptr noundef %86, ptr noundef %88, ptr noundef %90, i64 noundef %91, ptr noundef %92)
  %93 = load ptr, ptr %9, align 8, !tbaa !5
  %94 = getelementptr inbounds %"struct.alglib_impl::apbuffers", ptr %93, i32 0, i32 6
  %95 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %94, i32 0, i32 4
  %96 = load ptr, ptr %95, align 8, !tbaa !13
  %97 = getelementptr inbounds double, ptr %96, i64 0
  %98 = load double, ptr %97, align 8, !tbaa !14
  %99 = load ptr, ptr %9, align 8, !tbaa !5
  %100 = getelementptr inbounds %"struct.alglib_impl::apbuffers", ptr %99, i32 0, i32 6
  %101 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %100, i32 0, i32 4
  %102 = load ptr, ptr %101, align 8, !tbaa !13
  %103 = load i64, ptr %7, align 8, !tbaa !9
  %104 = sub nsw i64 %103, 1
  %105 = getelementptr inbounds double, ptr %102, i64 %104
  %106 = load double, ptr %105, align 8, !tbaa !14
  %107 = call noundef zeroext i1 @_ZN11alglib_impl8ae_fp_eqEdd(double noundef %98, double noundef %106)
  br i1 %107, label %108, label %134

108:                                              ; preds = %82
  %109 = load i8, ptr %8, align 1, !tbaa !11, !range !24, !noundef !25
  %110 = trunc i8 %109 to i1
  br i1 %110, label %111, label %112

111:                                              ; preds = %108
  store double 0.000000e+00, ptr %14, align 8, !tbaa !14
  br label %117

112:                                              ; preds = %108
  %113 = load i64, ptr %7, align 8, !tbaa !9
  %114 = sub nsw i64 %113, 1
  %115 = sitofp i64 %114 to double
  %116 = fdiv double %115, 2.000000e+00
  store double %116, ptr %14, align 8, !tbaa !14
  br label %117

117:                                              ; preds = %112, %111
  store i64 0, ptr %11, align 8, !tbaa !9
  br label %118

118:                                              ; preds = %130, %117
  %119 = load i64, ptr %11, align 8, !tbaa !9
  %120 = load i64, ptr %7, align 8, !tbaa !9
  %121 = sub nsw i64 %120, 1
  %122 = icmp sle i64 %119, %121
  br i1 %122, label %123, label %133

123:                                              ; preds = %118
  %124 = load double, ptr %14, align 8, !tbaa !14
  %125 = load ptr, ptr %6, align 8, !tbaa !5
  %126 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %125, i32 0, i32 4
  %127 = load ptr, ptr %126, align 8, !tbaa !13
  %128 = load i64, ptr %11, align 8, !tbaa !9
  %129 = getelementptr inbounds double, ptr %127, i64 %128
  store double %124, ptr %129, align 8, !tbaa !14
  br label %130

130:                                              ; preds = %123
  %131 = load i64, ptr %11, align 8, !tbaa !9
  %132 = add nsw i64 %131, 1
  store i64 %132, ptr %11, align 8, !tbaa !9
  br label %118, !llvm.loop !26

133:                                              ; preds = %118
  store i32 1, ptr %16, align 4
  br label %233

134:                                              ; preds = %82
  store i64 0, ptr %11, align 8, !tbaa !9
  br label %135

135:                                              ; preds = %191, %134
  %136 = load i64, ptr %11, align 8, !tbaa !9
  %137 = load i64, ptr %7, align 8, !tbaa !9
  %138 = sub nsw i64 %137, 1
  %139 = icmp sle i64 %136, %138
  br i1 %139, label %140, label %193

140:                                              ; preds = %135
  %141 = load i64, ptr %11, align 8, !tbaa !9
  %142 = add nsw i64 %141, 1
  store i64 %142, ptr %12, align 8, !tbaa !9
  br label %143

143:                                              ; preds = %165, %140
  %144 = load i64, ptr %12, align 8, !tbaa !9
  %145 = load i64, ptr %7, align 8, !tbaa !9
  %146 = sub nsw i64 %145, 1
  %147 = icmp sle i64 %144, %146
  br i1 %147, label %148, label %168

148:                                              ; preds = %143
  %149 = load ptr, ptr %9, align 8, !tbaa !5
  %150 = getelementptr inbounds %"struct.alglib_impl::apbuffers", ptr %149, i32 0, i32 6
  %151 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %150, i32 0, i32 4
  %152 = load ptr, ptr %151, align 8, !tbaa !13
  %153 = load i64, ptr %12, align 8, !tbaa !9
  %154 = getelementptr inbounds double, ptr %152, i64 %153
  %155 = load double, ptr %154, align 8, !tbaa !14
  %156 = load ptr, ptr %9, align 8, !tbaa !5
  %157 = getelementptr inbounds %"struct.alglib_impl::apbuffers", ptr %156, i32 0, i32 6
  %158 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %157, i32 0, i32 4
  %159 = load ptr, ptr %158, align 8, !tbaa !13
  %160 = load i64, ptr %11, align 8, !tbaa !9
  %161 = getelementptr inbounds double, ptr %159, i64 %160
  %162 = load double, ptr %161, align 8, !tbaa !14
  %163 = call noundef zeroext i1 @_ZN11alglib_impl9ae_fp_neqEdd(double noundef %155, double noundef %162)
  br i1 %163, label %164, label %165

164:                                              ; preds = %148
  br label %168

165:                                              ; preds = %148
  %166 = load i64, ptr %12, align 8, !tbaa !9
  %167 = add nsw i64 %166, 1
  store i64 %167, ptr %12, align 8, !tbaa !9
  br label %143, !llvm.loop !27

168:                                              ; preds = %164, %143
  %169 = load i64, ptr %11, align 8, !tbaa !9
  store i64 %169, ptr %13, align 8, !tbaa !9
  br label %170

170:                                              ; preds = %188, %168
  %171 = load i64, ptr %13, align 8, !tbaa !9
  %172 = load i64, ptr %12, align 8, !tbaa !9
  %173 = sub nsw i64 %172, 1
  %174 = icmp sle i64 %171, %173
  br i1 %174, label %175, label %191

175:                                              ; preds = %170
  %176 = load i64, ptr %11, align 8, !tbaa !9
  %177 = load i64, ptr %12, align 8, !tbaa !9
  %178 = add nsw i64 %176, %177
  %179 = sub nsw i64 %178, 1
  %180 = sitofp i64 %179 to double
  %181 = fdiv double %180, 2.000000e+00
  %182 = load ptr, ptr %9, align 8, !tbaa !5
  %183 = getelementptr inbounds %"struct.alglib_impl::apbuffers", ptr %182, i32 0, i32 6
  %184 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %183, i32 0, i32 4
  %185 = load ptr, ptr %184, align 8, !tbaa !13
  %186 = load i64, ptr %13, align 8, !tbaa !9
  %187 = getelementptr inbounds double, ptr %185, i64 %186
  store double %181, ptr %187, align 8, !tbaa !14
  br label %188

188:                                              ; preds = %175
  %189 = load i64, ptr %13, align 8, !tbaa !9
  %190 = add nsw i64 %189, 1
  store i64 %190, ptr %13, align 8, !tbaa !9
  br label %170, !llvm.loop !28

191:                                              ; preds = %170
  %192 = load i64, ptr %12, align 8, !tbaa !9
  store i64 %192, ptr %11, align 8, !tbaa !9
  br label %135, !llvm.loop !29

193:                                              ; preds = %135
  %194 = load i8, ptr %8, align 1, !tbaa !11, !range !24, !noundef !25
  %195 = trunc i8 %194 to i1
  br i1 %195, label %196, label %201

196:                                              ; preds = %193
  %197 = load i64, ptr %7, align 8, !tbaa !9
  %198 = sub nsw i64 %197, 1
  %199 = sitofp i64 %198 to double
  %200 = fdiv double %199, 2.000000e+00
  store double %200, ptr %15, align 8, !tbaa !14
  br label %202

201:                                              ; preds = %193
  store double 0.000000e+00, ptr %15, align 8, !tbaa !14
  br label %202

202:                                              ; preds = %201, %196
  store i64 0, ptr %11, align 8, !tbaa !9
  br label %203

203:                                              ; preds = %229, %202
  %204 = load i64, ptr %11, align 8, !tbaa !9
  %205 = load i64, ptr %7, align 8, !tbaa !9
  %206 = sub nsw i64 %205, 1
  %207 = icmp sle i64 %204, %206
  br i1 %207, label %208, label %232

208:                                              ; preds = %203
  %209 = load ptr, ptr %9, align 8, !tbaa !5
  %210 = getelementptr inbounds %"struct.alglib_impl::apbuffers", ptr %209, i32 0, i32 6
  %211 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %210, i32 0, i32 4
  %212 = load ptr, ptr %211, align 8, !tbaa !13
  %213 = load i64, ptr %11, align 8, !tbaa !9
  %214 = getelementptr inbounds double, ptr %212, i64 %213
  %215 = load double, ptr %214, align 8, !tbaa !14
  %216 = load double, ptr %15, align 8, !tbaa !14
  %217 = fsub double %215, %216
  %218 = load ptr, ptr %6, align 8, !tbaa !5
  %219 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %218, i32 0, i32 4
  %220 = load ptr, ptr %219, align 8, !tbaa !13
  %221 = load ptr, ptr %9, align 8, !tbaa !5
  %222 = getelementptr inbounds %"struct.alglib_impl::apbuffers", ptr %221, i32 0, i32 2
  %223 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %222, i32 0, i32 4
  %224 = load ptr, ptr %223, align 8, !tbaa !13
  %225 = load i64, ptr %11, align 8, !tbaa !9
  %226 = getelementptr inbounds i64, ptr %224, i64 %225
  %227 = load i64, ptr %226, align 8, !tbaa !9
  %228 = getelementptr inbounds double, ptr %220, i64 %227
  store double %217, ptr %228, align 8, !tbaa !14
  br label %229

229:                                              ; preds = %208
  %230 = load i64, ptr %11, align 8, !tbaa !9
  %231 = add nsw i64 %230, 1
  store i64 %231, ptr %11, align 8, !tbaa !9
  br label %203, !llvm.loop !30

232:                                              ; preds = %203
  store i32 0, ptr %16, align 4
  br label %233

233:                                              ; preds = %232, %133, %24, %20
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #3
  %234 = load i32, ptr %16, align 4
  switch i32 %234, label %236 [
    i32 0, label %235
    i32 1, label %235
  ]

235:                                              ; preds = %233, %233
  ret void

236:                                              ; preds = %233
  unreachable
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "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 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 = { 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 = !{!17, !10, i64 384}
!17 = !{!"_ZTSN11alglib_impl9apbuffersE", !18, i64 0, !18, i64 64, !18, i64 128, !18, i64 192, !18, i64 256, !18, i64 320, !18, i64 384, !18, i64 448, !18, i64 512, !20, i64 576, !20, i64 656}
!18 = !{!"_ZTSN11alglib_impl9ae_vectorE", !10, i64 0, !10, i64 8, !12, i64 16, !19, i64 24, !7, i64 56}
!19 = !{!"_ZTSN11alglib_impl12ae_dyn_blockE", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!20 = !{!"_ZTSN11alglib_impl9ae_matrixE", !10, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !12, i64 32, !19, i64 40, !7, i64 72}
!21 = !{!17, !10, i64 128}
!22 = distinct !{!22, !23}
!23 = !{!"llvm.loop.mustprogress"}
!24 = !{i8 0, i8 2}
!25 = !{}
!26 = distinct !{!26, !23}
!27 = distinct !{!27, !23}
!28 = distinct !{!28, !23}
!29 = distinct !{!29, !23}
!30 = distinct !{!30, !23}


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

declare noundef zeroext i1 @_ZN11alglib_impl8ae_fp_eqEdd(double noundef, double noundef) local_unnamed_addr #0

declare void @_ZN11alglib_impl20ae_vector_set_lengthEPNS_9ae_vectorElPNS_8ae_stateE(ptr noundef, i64 noundef, ptr noundef) local_unnamed_addr #0

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

declare noundef zeroext i1 @_ZN11alglib_impl9ae_fp_neqEdd(double noundef, double noundef) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN11alglib_impl5rankxEPNS_9ae_vectorElbPNS_9apbuffersEPNS_8ae_stateE(ptr nocapture noundef readonly %0, i64 noundef %1, i1 noundef zeroext %2, ptr noundef %3, ptr noundef %4) local_unnamed_addr #1 {
  %6 = icmp slt i64 %1, 1
  br i1 %6, label %.loopexit, label %7

7:                                                ; preds = %5
  %8 = icmp eq i64 %1, 1
  br i1 %8, label %9, label %12

9:                                                ; preds = %7
  %10 = getelementptr inbounds i8, ptr %0, i64 56
  %11 = load ptr, ptr %10, align 8, !tbaa !5
  store double 0.000000e+00, ptr %11, align 8, !tbaa !8
  br label %.loopexit

12:                                               ; preds = %7
  %13 = getelementptr inbounds i8, ptr %3, i64 384
  %14 = load i64, ptr %13, align 8, !tbaa !10
  %15 = icmp slt i64 %14, %1
  br i1 %15, label %16, label %17

16:                                               ; preds = %12
  tail call void @_ZN11alglib_impl20ae_vector_set_lengthEPNS_9ae_vectorElPNS_8ae_stateE(ptr noundef nonnull %13, i64 noundef %1, ptr noundef %4)
  br label %17

17:                                               ; preds = %16, %12
  %18 = getelementptr inbounds i8, ptr %3, i64 128
  %19 = load i64, ptr %18, align 8, !tbaa !18
  %20 = icmp slt i64 %19, %1
  br i1 %20, label %21, label %.lr.ph

21:                                               ; preds = %17
  tail call void @_ZN11alglib_impl20ae_vector_set_lengthEPNS_9ae_vectorElPNS_8ae_stateE(ptr noundef nonnull %18, i64 noundef %1, ptr noundef %4)
  br label %.lr.ph

.lr.ph:                                           ; preds = %17, %21
  %22 = getelementptr inbounds i8, ptr %0, i64 56
  %23 = getelementptr inbounds i8, ptr %3, i64 440
  %24 = getelementptr inbounds i8, ptr %3, i64 184
  %xtraiter = and i64 %1, 1
  %unroll_iter = and i64 %1, 9223372036854775806
  br label %25

25:                                               ; preds = %25, %.lr.ph
  %.07283 = phi i64 [ 0, %.lr.ph ], [ %41, %25 ]
  %niter = phi i64 [ 0, %.lr.ph ], [ %niter.next.1, %25 ]
  %26 = load ptr, ptr %22, align 8, !tbaa !5
  %27 = getelementptr inbounds double, ptr %26, i64 %.07283
  %28 = load double, ptr %27, align 8, !tbaa !8
  %29 = load ptr, ptr %23, align 8, !tbaa !5
  %30 = getelementptr inbounds double, ptr %29, i64 %.07283
  store double %28, ptr %30, align 8, !tbaa !8
  %31 = load ptr, ptr %24, align 8, !tbaa !5
  %32 = getelementptr inbounds i64, ptr %31, i64 %.07283
  store i64 %.07283, ptr %32, align 8, !tbaa !19
  %33 = or disjoint i64 %.07283, 1
  %34 = load ptr, ptr %22, align 8, !tbaa !5
  %35 = getelementptr inbounds double, ptr %34, i64 %33
  %36 = load double, ptr %35, align 8, !tbaa !8
  %37 = load ptr, ptr %23, align 8, !tbaa !5
  %38 = getelementptr inbounds double, ptr %37, i64 %33
  store double %36, ptr %38, align 8, !tbaa !8
  %39 = load ptr, ptr %24, align 8, !tbaa !5
  %40 = getelementptr inbounds i64, ptr %39, i64 %33
  store i64 %33, ptr %40, align 8, !tbaa !19
  %41 = add nuw nsw i64 %.07283, 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.unr-lcssa, label %25, !llvm.loop !20

._crit_edge.unr-lcssa:                            ; preds = %25
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge, label %._crit_edge.epilog-lcssa

._crit_edge.epilog-lcssa:                         ; preds = %._crit_edge.unr-lcssa
  %42 = load ptr, ptr %22, align 8, !tbaa !5
  %43 = getelementptr inbounds double, ptr %42, i64 %41
  %44 = load double, ptr %43, align 8, !tbaa !8
  %45 = load ptr, ptr %23, align 8, !tbaa !5
  %46 = getelementptr inbounds double, ptr %45, i64 %41
  store double %44, ptr %46, align 8, !tbaa !8
  %47 = load ptr, ptr %24, align 8, !tbaa !5
  %48 = getelementptr inbounds i64, ptr %47, i64 %41
  store i64 %41, ptr %48, align 8, !tbaa !19
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.unr-lcssa, %._crit_edge.epilog-lcssa
  %49 = add nsw i64 %1, -1
  %50 = getelementptr inbounds i8, ptr %3, i64 448
  %51 = getelementptr inbounds i8, ptr %3, i64 192
  tail call void @_ZN11alglib_impl12tagsortfastiEPNS_9ae_vectorES1_S1_S1_lPNS_8ae_stateE(ptr noundef nonnull %13, ptr noundef nonnull %18, ptr noundef nonnull %50, ptr noundef nonnull %51, i64 noundef %1, ptr noundef %4)
  %52 = getelementptr inbounds i8, ptr %3, i64 440
  %53 = load ptr, ptr %52, align 8, !tbaa !5
  %54 = load double, ptr %53, align 8, !tbaa !8
  %55 = getelementptr inbounds double, ptr %53, i64 %49
  %56 = load double, ptr %55, align 8, !tbaa !8
  %57 = tail call noundef zeroext i1 @_ZN11alglib_impl8ae_fp_eqEdd(double noundef %54, double noundef %56)
  br i1 %57, label %.lr.ph98, label %.preheader

.lr.ph98:                                         ; preds = %._crit_edge
  %58 = uitofp nneg i64 %49 to double
  %59 = fmul double %58, 5.000000e-01
  %.069 = select i1 %2, double 0.000000e+00, double %59
  %60 = getelementptr inbounds i8, ptr %0, i64 56
  %smax104 = tail call i64 @llvm.smax.i64(i64 %1, i64 1)
  %xtraiter117 = and i64 %smax104, 3
  %61 = icmp slt i64 %1, 4
  br i1 %61, label %.loopexit.loopexit.unr-lcssa, label %.lr.ph98.new

.lr.ph98.new:                                     ; preds = %.lr.ph98
  %unroll_iter119 = and i64 %smax104, 9223372036854775804
  br label %62

62:                                               ; preds = %62, %.lr.ph98.new
  %.196 = phi i64 [ 0, %.lr.ph98.new ], [ %74, %62 ]
  %niter120 = phi i64 [ 0, %.lr.ph98.new ], [ %niter120.next.3, %62 ]
  %63 = load ptr, ptr %60, align 8, !tbaa !5
  %64 = getelementptr inbounds double, ptr %63, i64 %.196
  store double %.069, ptr %64, align 8, !tbaa !8
  %65 = or disjoint i64 %.196, 1
  %66 = load ptr, ptr %60, align 8, !tbaa !5
  %67 = getelementptr inbounds double, ptr %66, i64 %65
  store double %.069, ptr %67, align 8, !tbaa !8
  %68 = or disjoint i64 %.196, 2
  %69 = load ptr, ptr %60, align 8, !tbaa !5
  %70 = getelementptr inbounds double, ptr %69, i64 %68
  store double %.069, ptr %70, align 8, !tbaa !8
  %71 = or disjoint i64 %.196, 3
  %72 = load ptr, ptr %60, align 8, !tbaa !5
  %73 = getelementptr inbounds double, ptr %72, i64 %71
  store double %.069, ptr %73, align 8, !tbaa !8
  %74 = add nuw nsw i64 %.196, 4
  %niter120.next.3 = add i64 %niter120, 4
  %niter120.ncmp.3 = icmp eq i64 %niter120.next.3, %unroll_iter119
  br i1 %niter120.ncmp.3, label %.loopexit.loopexit.unr-lcssa, label %62, !llvm.loop !22

.loopexit80:                                      ; preds = %.prol.loopexit, %.lr.ph87.new, %83
  %.not.not75 = icmp slt i64 %.071, %1
  br i1 %.not.not75, label %.preheader, label %.lr.ph94, !llvm.loop !23

.preheader:                                       ; preds = %._crit_edge, %.loopexit80
  %.289 = phi i64 [ %.071, %.loopexit80 ], [ 0, %._crit_edge ]
  br label %75

75:                                               ; preds = %.preheader, %76
  %indvar = phi i64 [ 0, %.preheader ], [ %indvar.next, %76 ]
  %indvars.iv.in = phi i64 [ %.289, %.preheader ], [ %indvars.iv, %76 ]
  %.071.in = phi i64 [ %.289, %.preheader ], [ %.071, %76 ]
  %.071 = add nsw i64 %.071.in, 1
  %.not.not77 = icmp slt i64 %.071.in, %49
  br i1 %.not.not77, label %76, label %83

76:                                               ; preds = %75
  %indvars.iv = add i64 %indvars.iv.in, 1
  %77 = load ptr, ptr %52, align 8, !tbaa !5
  %78 = getelementptr inbounds double, ptr %77, i64 %.071
  %79 = load double, ptr %78, align 8, !tbaa !8
  %80 = getelementptr inbounds double, ptr %77, i64 %.289
  %81 = load double, ptr %80, align 8, !tbaa !8
  %82 = tail call noundef zeroext i1 @_ZN11alglib_impl9ae_fp_neqEdd(double noundef %79, double noundef %81)
  %indvar.next = add i64 %indvar, 1
  br i1 %82, label %83, label %75, !llvm.loop !24

83:                                               ; preds = %76, %75
  %.not84 = icmp sgt i64 %.289, %.071.in
  br i1 %.not84, label %.loopexit80, label %.lr.ph87

.lr.ph87:                                         ; preds = %83
  %84 = add i64 %.071.in, %.289
  %85 = sitofp i64 %84 to double
  %86 = fmul double %85, 5.000000e-01
  %87 = add i64 %indvar, 1
  %xtraiter109 = and i64 %87, 3
  %lcmp.mod110.not = icmp eq i64 %xtraiter109, 0
  br i1 %lcmp.mod110.not, label %.prol.loopexit, label %.prol.preheader

.prol.preheader:                                  ; preds = %.lr.ph87, %.prol.preheader
  %.07085.prol = phi i64 [ %90, %.prol.preheader ], [ %.289, %.lr.ph87 ]
  %prol.iter = phi i64 [ %prol.iter.next, %.prol.preheader ], [ 0, %.lr.ph87 ]
  %88 = load ptr, ptr %52, align 8, !tbaa !5
  %89 = getelementptr inbounds double, ptr %88, i64 %.07085.prol
  store double %86, ptr %89, align 8, !tbaa !8
  %90 = add i64 %.07085.prol, 1
  %prol.iter.next = add i64 %prol.iter, 1
  %prol.iter.cmp.not = icmp eq i64 %prol.iter.next, %xtraiter109
  br i1 %prol.iter.cmp.not, label %.prol.loopexit, label %.prol.preheader, !llvm.loop !25

.prol.loopexit:                                   ; preds = %.prol.preheader, %.lr.ph87
  %.07085.unr = phi i64 [ %.289, %.lr.ph87 ], [ %90, %.prol.preheader ]
  %91 = icmp ult i64 %indvar, 3
  br i1 %91, label %.loopexit80, label %.lr.ph87.new

.lr.ph87.new:                                     ; preds = %.prol.loopexit, %.lr.ph87.new
  %.07085 = phi i64 [ %103, %.lr.ph87.new ], [ %.07085.unr, %.prol.loopexit ]
  %92 = load ptr, ptr %52, align 8, !tbaa !5
  %93 = getelementptr inbounds double, ptr %92, i64 %.07085
  store double %86, ptr %93, align 8, !tbaa !8
  %94 = load ptr, ptr %52, align 8, !tbaa !5
  %95 = getelementptr double, ptr %94, i64 %.07085
  %96 = getelementptr i8, ptr %95, i64 8
  store double %86, ptr %96, align 8, !tbaa !8
  %97 = load ptr, ptr %52, align 8, !tbaa !5
  %98 = getelementptr double, ptr %97, i64 %.07085
  %99 = getelementptr i8, ptr %98, i64 16
  store double %86, ptr %99, align 8, !tbaa !8
  %100 = add i64 %.07085, 3
  %101 = load ptr, ptr %52, align 8, !tbaa !5
  %102 = getelementptr inbounds double, ptr %101, i64 %100
  store double %86, ptr %102, align 8, !tbaa !8
  %103 = add i64 %.07085, 4
  %exitcond101.not.3 = icmp eq i64 %100, %indvars.iv.in
  br i1 %exitcond101.not.3, label %.loopexit80, label %.lr.ph87.new, !llvm.loop !27

.lr.ph94:                                         ; preds = %.loopexit80
  %104 = uitofp nneg i64 %49 to double
  %105 = fmul double %104, 5.000000e-01
  %.0 = select i1 %2, double %105, double 0.000000e+00
  %106 = getelementptr inbounds i8, ptr %0, i64 56
  %107 = getelementptr inbounds i8, ptr %3, i64 184
  %smax102 = tail call i64 @llvm.smax.i64(i64 %1, i64 1)
  %xtraiter112 = and i64 %smax102, 1
  %unroll_iter114 = and i64 %smax102, 9223372036854775806
  br label %108

108:                                              ; preds = %108, %.lr.ph94
  %.392 = phi i64 [ 0, %.lr.ph94 ], [ %128, %108 ]
  %niter115 = phi i64 [ 0, %.lr.ph94 ], [ %niter115.next.1, %108 ]
  %109 = load ptr, ptr %52, align 8, !tbaa !5
  %110 = getelementptr inbounds double, ptr %109, i64 %.392
  %111 = load double, ptr %110, align 8, !tbaa !8
  %112 = fsub double %111, %.0
  %113 = load ptr, ptr %106, align 8, !tbaa !5
  %114 = load ptr, ptr %107, align 8, !tbaa !5
  %115 = getelementptr inbounds i64, ptr %114, i64 %.392
  %116 = load i64, ptr %115, align 8, !tbaa !19
  %117 = getelementptr inbounds double, ptr %113, i64 %116
  store double %112, ptr %117, align 8, !tbaa !8
  %118 = or disjoint i64 %.392, 1
  %119 = load ptr, ptr %52, align 8, !tbaa !5
  %120 = getelementptr inbounds double, ptr %119, i64 %118
  %121 = load double, ptr %120, align 8, !tbaa !8
  %122 = fsub double %121, %.0
  %123 = load ptr, ptr %106, align 8, !tbaa !5
  %124 = load ptr, ptr %107, align 8, !tbaa !5
  %125 = getelementptr inbounds i64, ptr %124, i64 %118
  %126 = load i64, ptr %125, align 8, !tbaa !19
  %127 = getelementptr inbounds double, ptr %123, i64 %126
  store double %122, ptr %127, align 8, !tbaa !8
  %128 = add nuw nsw i64 %.392, 2
  %niter115.next.1 = add i64 %niter115, 2
  %niter115.ncmp.1 = icmp eq i64 %niter115.next.1, %unroll_iter114
  br i1 %niter115.ncmp.1, label %.loopexit.loopexit108.unr-lcssa, label %108, !llvm.loop !28

.loopexit.loopexit.unr-lcssa:                     ; preds = %62, %.lr.ph98
  %.196.unr = phi i64 [ 0, %.lr.ph98 ], [ %74, %62 ]
  %lcmp.mod118.not = icmp eq i64 %xtraiter117, 0
  br i1 %lcmp.mod118.not, label %.loopexit, label %.epil.preheader116

.epil.preheader116:                               ; preds = %.loopexit.loopexit.unr-lcssa, %.epil.preheader116
  %.196.epil = phi i64 [ %131, %.epil.preheader116 ], [ %.196.unr, %.loopexit.loopexit.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.epil.preheader116 ], [ 0, %.loopexit.loopexit.unr-lcssa ]
  %129 = load ptr, ptr %60, align 8, !tbaa !5
  %130 = getelementptr inbounds double, ptr %129, i64 %.196.epil
  store double %.069, ptr %130, align 8, !tbaa !8
  %131 = add nuw nsw i64 %.196.epil, 1
  %epil.iter.next = add i64 %epil.iter, 1
  %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter117
  br i1 %epil.iter.cmp.not, label %.loopexit, label %.epil.preheader116, !llvm.loop !29

.loopexit.loopexit108.unr-lcssa:                  ; preds = %108
  %lcmp.mod113.not = icmp eq i64 %xtraiter112, 0
  br i1 %lcmp.mod113.not, label %.loopexit, label %.loopexit.loopexit108.epilog-lcssa

.loopexit.loopexit108.epilog-lcssa:               ; preds = %.loopexit.loopexit108.unr-lcssa
  %132 = load ptr, ptr %52, align 8, !tbaa !5
  %133 = getelementptr inbounds double, ptr %132, i64 %128
  %134 = load double, ptr %133, align 8, !tbaa !8
  %135 = fsub double %134, %.0
  %136 = load ptr, ptr %106, align 8, !tbaa !5
  %137 = load ptr, ptr %107, align 8, !tbaa !5
  %138 = getelementptr inbounds i64, ptr %137, i64 %128
  %139 = load i64, ptr %138, align 8, !tbaa !19
  %140 = getelementptr inbounds double, ptr %136, i64 %139
  store double %135, ptr %140, align 8, !tbaa !8
  br label %.loopexit

.loopexit:                                        ; preds = %.loopexit.loopexit108.epilog-lcssa, %.loopexit.loopexit108.unr-lcssa, %.loopexit.loopexit.unr-lcssa, %.epil.preheader116, %5, %9
  ret void
}

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smax.i64(i64, i64) #2

attributes #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 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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"double", !6, i64 0}
!10 = !{!11, !13, i64 384}
!11 = !{!"_ZTSN11alglib_impl9apbuffersE", !12, i64 0, !12, i64 64, !12, i64 128, !12, i64 192, !12, i64 256, !12, i64 320, !12, i64 384, !12, i64 448, !12, i64 512, !17, i64 576, !17, i64 656}
!12 = !{!"_ZTSN11alglib_impl9ae_vectorE", !13, i64 0, !13, i64 8, !14, i64 16, !15, i64 24, !6, i64 56}
!13 = !{!"long", !6, i64 0}
!14 = !{!"bool", !6, i64 0}
!15 = !{!"_ZTSN11alglib_impl12ae_dyn_blockE", !16, i64 0, !16, i64 8, !16, i64 16, !16, i64 24}
!16 = !{!"any pointer", !6, i64 0}
!17 = !{!"_ZTSN11alglib_impl9ae_matrixE", !13, i64 0, !13, i64 8, !13, i64 16, !13, i64 24, !14, i64 32, !15, i64 40, !6, i64 72}
!18 = !{!11, !13, i64 128}
!19 = !{!13, !13, i64 0}
!20 = distinct !{!20, !21}
!21 = !{!"llvm.loop.mustprogress"}
!22 = distinct !{!22, !21}
!23 = distinct !{!23, !21}
!24 = distinct !{!24, !21}
!25 = distinct !{!25, !26}
!26 = !{!"llvm.loop.unroll.disable"}
!27 = distinct !{!27, !21}
!28 = distinct !{!28, !21}
!29 = distinct !{!29, !26}


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