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

; 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::multilayerperceptron" = type { i64, i64, %"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_vector", %"struct.alglib_impl::ae_vector", %"struct.alglib_impl::ae_vector", %"struct.alglib_impl::ae_matrix", %"struct.alglib_impl::ae_vector", %"struct.alglib_impl::ae_vector", %"struct.alglib_impl::ae_vector", %"struct.alglib_impl::modelerrors", %"struct.alglib_impl::ae_vector", %"struct.alglib_impl::ae_shared_pool", %"struct.alglib_impl::ae_shared_pool", %"struct.alglib_impl::ae_matrix", %"struct.alglib_impl::sparsematrix", %"struct.alglib_impl::ae_vector", %"struct.alglib_impl::ae_shared_pool" }
%"struct.alglib_impl::modelerrors" = type { double, double, double, double, double }
%"struct.alglib_impl::ae_matrix" = type { i64, i64, i64, i64, i8, %"struct.alglib_impl::ae_dyn_block", %union.anon.0 }
%"struct.alglib_impl::ae_dyn_block" = type { ptr, ptr, ptr, ptr }
%union.anon.0 = type { ptr }
%"struct.alglib_impl::sparsematrix" = 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", i64, i64, i64, i64, i64, i64 }
%"struct.alglib_impl::ae_vector" = type { i64, i64, i8, %"struct.alglib_impl::ae_dyn_block", %union.anon.1 }
%union.anon.1 = type { ptr }
%"struct.alglib_impl::ae_shared_pool" = type { %"struct.alglib_impl::ae_lock", ptr, ptr, ptr, ptr, i64, ptr, ptr, ptr, %"struct.alglib_impl::ae_dyn_block" }
%"struct.alglib_impl::ae_lock" = type { ptr, %"struct.alglib_impl::ae_dyn_block", i8 }

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN11alglib_impl8mlpgradnEPNS_20multilayerperceptronEPNS_9ae_vectorES3_PdS3_PNS_8ae_stateE(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3, ptr noundef %4, ptr noundef %5) #1 {
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca double, align 8
  %14 = alloca i64, align 8
  %15 = alloca i64, align 8
  %16 = alloca i64, align 8
  store ptr %0, ptr %7, align 8, !tbaa !5
  store ptr %1, ptr %8, align 8, !tbaa !5
  store ptr %2, ptr %9, align 8, !tbaa !5
  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 8, 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 8, ptr %16) #4
  %17 = load ptr, ptr %10, align 8, !tbaa !5
  store double 0.000000e+00, ptr %17, align 8, !tbaa !9
  %18 = load ptr, ptr %11, align 8, !tbaa !5
  %19 = load ptr, ptr %7, align 8, !tbaa !5
  %20 = getelementptr inbounds %"struct.alglib_impl::multilayerperceptron", ptr %19, i32 0, i32 5
  %21 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %20, i32 0, i32 4
  %22 = load ptr, ptr %21, align 8, !tbaa !11
  %23 = getelementptr inbounds i64, ptr %22, i64 4
  %24 = load i64, ptr %23, align 8, !tbaa !12
  %25 = load ptr, ptr %12, align 8, !tbaa !5
  call void @_ZN11alglib_impl23rvectorsetlengthatleastEPNS_9ae_vectorElPNS_8ae_stateE(ptr noundef %18, i64 noundef %24, ptr noundef %25)
  %26 = load ptr, ptr %7, align 8, !tbaa !5
  %27 = load ptr, ptr %8, align 8, !tbaa !5
  %28 = load ptr, ptr %7, align 8, !tbaa !5
  %29 = getelementptr inbounds %"struct.alglib_impl::multilayerperceptron", ptr %28, i32 0, i32 13
  %30 = load ptr, ptr %12, align 8, !tbaa !5
  call void @_ZN11alglib_impl10mlpprocessEPNS_20multilayerperceptronEPNS_9ae_vectorES3_PNS_8ae_stateE(ptr noundef %26, ptr noundef %27, ptr noundef %29, ptr noundef %30)
  %31 = load ptr, ptr %7, align 8, !tbaa !5
  %32 = getelementptr inbounds %"struct.alglib_impl::multilayerperceptron", ptr %31, i32 0, i32 5
  %33 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %32, i32 0, i32 4
  %34 = load ptr, ptr %33, align 8, !tbaa !11
  %35 = getelementptr inbounds i64, ptr %34, i64 2
  %36 = load i64, ptr %35, align 8, !tbaa !12
  store i64 %36, ptr %15, align 8, !tbaa !12
  %37 = load ptr, ptr %7, align 8, !tbaa !5
  %38 = getelementptr inbounds %"struct.alglib_impl::multilayerperceptron", ptr %37, i32 0, i32 5
  %39 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %38, i32 0, i32 4
  %40 = load ptr, ptr %39, align 8, !tbaa !11
  %41 = getelementptr inbounds i64, ptr %40, i64 3
  %42 = load i64, ptr %41, align 8, !tbaa !12
  store i64 %42, ptr %16, align 8, !tbaa !12
  store i64 0, ptr %14, align 8, !tbaa !12
  br label %43

43:                                               ; preds = %55, %6
  %44 = load i64, ptr %14, align 8, !tbaa !12
  %45 = load i64, ptr %16, align 8, !tbaa !12
  %46 = sub nsw i64 %45, 1
  %47 = icmp sle i64 %44, %46
  br i1 %47, label %48, label %58

48:                                               ; preds = %43
  %49 = load ptr, ptr %7, align 8, !tbaa !5
  %50 = getelementptr inbounds %"struct.alglib_impl::multilayerperceptron", ptr %49, i32 0, i32 11
  %51 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %50, i32 0, i32 4
  %52 = load ptr, ptr %51, align 8, !tbaa !11
  %53 = load i64, ptr %14, align 8, !tbaa !12
  %54 = getelementptr inbounds double, ptr %52, i64 %53
  store double 0.000000e+00, ptr %54, align 8, !tbaa !9
  br label %55

55:                                               ; preds = %48
  %56 = load i64, ptr %14, align 8, !tbaa !12
  %57 = add nsw i64 %56, 1
  store i64 %57, ptr %14, align 8, !tbaa !12
  br label %43, !llvm.loop !14

58:                                               ; preds = %43
  %59 = load ptr, ptr %10, align 8, !tbaa !5
  store double 0.000000e+00, ptr %59, align 8, !tbaa !9
  %60 = load ptr, ptr %7, align 8, !tbaa !5
  %61 = getelementptr inbounds %"struct.alglib_impl::multilayerperceptron", ptr %60, i32 0, i32 5
  %62 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %61, i32 0, i32 4
  %63 = load ptr, ptr %62, align 8, !tbaa !11
  %64 = getelementptr inbounds i64, ptr %63, i64 6
  %65 = load i64, ptr %64, align 8, !tbaa !12
  %66 = icmp eq i64 %65, 0
  br i1 %66, label %67, label %123

67:                                               ; preds = %58
  store i64 0, ptr %14, align 8, !tbaa !12
  br label %68

68:                                               ; preds = %119, %67
  %69 = load i64, ptr %14, align 8, !tbaa !12
  %70 = load i64, ptr %15, align 8, !tbaa !12
  %71 = sub nsw i64 %70, 1
  %72 = icmp sle i64 %69, %71
  br i1 %72, label %73, label %122

73:                                               ; preds = %68
  %74 = load ptr, ptr %7, align 8, !tbaa !5
  %75 = getelementptr inbounds %"struct.alglib_impl::multilayerperceptron", ptr %74, i32 0, i32 13
  %76 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %75, i32 0, i32 4
  %77 = load ptr, ptr %76, align 8, !tbaa !11
  %78 = load i64, ptr %14, align 8, !tbaa !12
  %79 = getelementptr inbounds double, ptr %77, i64 %78
  %80 = load double, ptr %79, align 8, !tbaa !9
  %81 = load ptr, ptr %9, align 8, !tbaa !5
  %82 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %81, i32 0, i32 4
  %83 = load ptr, ptr %82, align 8, !tbaa !11
  %84 = load i64, ptr %14, align 8, !tbaa !12
  %85 = getelementptr inbounds double, ptr %83, i64 %84
  %86 = load double, ptr %85, align 8, !tbaa !9
  %87 = fsub double %80, %86
  %88 = load ptr, ptr %7, align 8, !tbaa !5
  %89 = getelementptr inbounds %"struct.alglib_impl::multilayerperceptron", ptr %88, i32 0, i32 11
  %90 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %89, i32 0, i32 4
  %91 = load ptr, ptr %90, align 8, !tbaa !11
  %92 = load i64, ptr %16, align 8, !tbaa !12
  %93 = load i64, ptr %15, align 8, !tbaa !12
  %94 = sub nsw i64 %92, %93
  %95 = load i64, ptr %14, align 8, !tbaa !12
  %96 = add nsw i64 %94, %95
  %97 = getelementptr inbounds double, ptr %91, i64 %96
  store double %87, ptr %97, align 8, !tbaa !9
  %98 = load ptr, ptr %10, align 8, !tbaa !5
  %99 = load double, ptr %98, align 8, !tbaa !9
  %100 = load ptr, ptr %7, align 8, !tbaa !5
  %101 = getelementptr inbounds %"struct.alglib_impl::multilayerperceptron", ptr %100, i32 0, i32 13
  %102 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %101, i32 0, i32 4
  %103 = load ptr, ptr %102, align 8, !tbaa !11
  %104 = load i64, ptr %14, align 8, !tbaa !12
  %105 = getelementptr inbounds double, ptr %103, i64 %104
  %106 = load double, ptr %105, align 8, !tbaa !9
  %107 = load ptr, ptr %9, align 8, !tbaa !5
  %108 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %107, i32 0, i32 4
  %109 = load ptr, ptr %108, align 8, !tbaa !11
  %110 = load i64, ptr %14, align 8, !tbaa !12
  %111 = getelementptr inbounds double, ptr %109, i64 %110
  %112 = load double, ptr %111, align 8, !tbaa !9
  %113 = fsub double %106, %112
  %114 = load ptr, ptr %12, align 8, !tbaa !5
  %115 = call noundef double @_ZN11alglib_impl6ae_sqrEdPNS_8ae_stateE(double noundef %113, ptr noundef %114)
  %116 = fdiv double %115, 2.000000e+00
  %117 = fadd double %99, %116
  %118 = load ptr, ptr %10, align 8, !tbaa !5
  store double %117, ptr %118, align 8, !tbaa !9
  br label %119

119:                                              ; preds = %73
  %120 = load i64, ptr %14, align 8, !tbaa !12
  %121 = add nsw i64 %120, 1
  store i64 %121, ptr %14, align 8, !tbaa !12
  br label %68, !llvm.loop !16

122:                                              ; preds = %68
  br label %197

123:                                              ; preds = %58
  store double 0.000000e+00, ptr %13, align 8, !tbaa !9
  store i64 0, ptr %14, align 8, !tbaa !12
  br label %124

124:                                              ; preds = %138, %123
  %125 = load i64, ptr %14, align 8, !tbaa !12
  %126 = load i64, ptr %15, align 8, !tbaa !12
  %127 = sub nsw i64 %126, 1
  %128 = icmp sle i64 %125, %127
  br i1 %128, label %129, label %141

129:                                              ; preds = %124
  %130 = load double, ptr %13, align 8, !tbaa !9
  %131 = load ptr, ptr %9, align 8, !tbaa !5
  %132 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %131, i32 0, i32 4
  %133 = load ptr, ptr %132, align 8, !tbaa !11
  %134 = load i64, ptr %14, align 8, !tbaa !12
  %135 = getelementptr inbounds double, ptr %133, i64 %134
  %136 = load double, ptr %135, align 8, !tbaa !9
  %137 = fadd double %130, %136
  store double %137, ptr %13, align 8, !tbaa !9
  br label %138

138:                                              ; preds = %129
  %139 = load i64, ptr %14, align 8, !tbaa !12
  %140 = add nsw i64 %139, 1
  store i64 %140, ptr %14, align 8, !tbaa !12
  br label %124, !llvm.loop !17

141:                                              ; preds = %124
  store i64 0, ptr %14, align 8, !tbaa !12
  br label %142

142:                                              ; preds = %193, %141
  %143 = load i64, ptr %14, align 8, !tbaa !12
  %144 = load i64, ptr %15, align 8, !tbaa !12
  %145 = sub nsw i64 %144, 1
  %146 = icmp sle i64 %143, %145
  br i1 %146, label %147, label %196

147:                                              ; preds = %142
  %148 = load double, ptr %13, align 8, !tbaa !9
  %149 = load ptr, ptr %7, align 8, !tbaa !5
  %150 = getelementptr inbounds %"struct.alglib_impl::multilayerperceptron", ptr %149, i32 0, i32 13
  %151 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %150, i32 0, i32 4
  %152 = load ptr, ptr %151, align 8, !tbaa !11
  %153 = load i64, ptr %14, align 8, !tbaa !12
  %154 = getelementptr inbounds double, ptr %152, i64 %153
  %155 = load double, ptr %154, align 8, !tbaa !9
  %156 = load ptr, ptr %9, align 8, !tbaa !5
  %157 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %156, i32 0, i32 4
  %158 = load ptr, ptr %157, align 8, !tbaa !11
  %159 = load i64, ptr %14, align 8, !tbaa !12
  %160 = getelementptr inbounds double, ptr %158, i64 %159
  %161 = load double, ptr %160, align 8, !tbaa !9
  %162 = fneg double %161
  %163 = call double @llvm.fmuladd.f64(double %148, double %155, double %162)
  %164 = load ptr, ptr %7, align 8, !tbaa !5
  %165 = getelementptr inbounds %"struct.alglib_impl::multilayerperceptron", ptr %164, i32 0, i32 11
  %166 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %165, i32 0, i32 4
  %167 = load ptr, ptr %166, align 8, !tbaa !11
  %168 = load i64, ptr %16, align 8, !tbaa !12
  %169 = load i64, ptr %15, align 8, !tbaa !12
  %170 = sub nsw i64 %168, %169
  %171 = load i64, ptr %14, align 8, !tbaa !12
  %172 = add nsw i64 %170, %171
  %173 = getelementptr inbounds double, ptr %167, i64 %172
  store double %163, ptr %173, align 8, !tbaa !9
  %174 = load ptr, ptr %10, align 8, !tbaa !5
  %175 = load double, ptr %174, align 8, !tbaa !9
  %176 = load ptr, ptr %9, align 8, !tbaa !5
  %177 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %176, i32 0, i32 4
  %178 = load ptr, ptr %177, align 8, !tbaa !11
  %179 = load i64, ptr %14, align 8, !tbaa !12
  %180 = getelementptr inbounds double, ptr %178, i64 %179
  %181 = load double, ptr %180, align 8, !tbaa !9
  %182 = load ptr, ptr %7, align 8, !tbaa !5
  %183 = getelementptr inbounds %"struct.alglib_impl::multilayerperceptron", ptr %182, i32 0, i32 13
  %184 = getelementptr inbounds %"struct.alglib_impl::ae_vector", ptr %183, i32 0, i32 4
  %185 = load ptr, ptr %184, align 8, !tbaa !11
  %186 = load i64, ptr %14, align 8, !tbaa !12
  %187 = getelementptr inbounds double, ptr %185, i64 %186
  %188 = load double, ptr %187, align 8, !tbaa !9
  %189 = load ptr, ptr %12, align 8, !tbaa !5
  %190 = call noundef double @_ZN11alglib_implL24mlpbase_safecrossentropyEddPNS_8ae_stateE(double noundef %181, double noundef %188, ptr noundef %189)
  %191 = fadd double %175, %190
  %192 = load ptr, ptr %10, align 8, !tbaa !5
  store double %191, ptr %192, align 8, !tbaa !9
  br label %193

193:                                              ; preds = %147
  %194 = load i64, ptr %14, align 8, !tbaa !12
  %195 = add nsw i64 %194, 1
  store i64 %195, ptr %14, align 8, !tbaa !12
  br label %142, !llvm.loop !18

196:                                              ; preds = %142
  br label %197

197:                                              ; preds = %196, %122
  %198 = load ptr, ptr %7, align 8, !tbaa !5
  %199 = load ptr, ptr %7, align 8, !tbaa !5
  %200 = getelementptr inbounds %"struct.alglib_impl::multilayerperceptron", ptr %199, i32 0, i32 9
  %201 = load ptr, ptr %7, align 8, !tbaa !5
  %202 = getelementptr inbounds %"struct.alglib_impl::multilayerperceptron", ptr %201, i32 0, i32 6
  %203 = load ptr, ptr %7, align 8, !tbaa !5
  %204 = getelementptr inbounds %"struct.alglib_impl::multilayerperceptron", ptr %203, i32 0, i32 11
  %205 = load ptr, ptr %11, align 8, !tbaa !5
  %206 = load ptr, ptr %12, align 8, !tbaa !5
  call void @_ZN11alglib_implL36mlpbase_mlpinternalcalculategradientEPNS_20multilayerperceptronEPNS_9ae_vectorES3_S3_S3_bPNS_8ae_stateE(ptr noundef %198, ptr noundef %200, ptr noundef %202, ptr noundef %204, ptr noundef %205, i1 noundef zeroext true, ptr noundef %206)
  call void @llvm.lifetime.end.p0(i64 8, 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 8, ptr %13) #4
  ret void
}

declare noundef double @_ZN11alglib_impl6ae_sqrEdPNS_8ae_stateE(double noundef, ptr noundef) #2

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #3

declare void @_ZN11alglib_impl23rvectorsetlengthatleastEPNS_9ae_vectorElPNS_8ae_stateE(ptr noundef, i64 noundef, ptr noundef) #2

; Function Attrs: mustprogress uwtable
declare hidden noundef double @_ZN11alglib_implL24mlpbase_safecrossentropyEddPNS_8ae_stateE(double noundef, double noundef, ptr noundef) #1

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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 = !{!"double", !7, i64 0}
!11 = !{!7, !7, i64 0}
!12 = !{!13, !13, i64 0}
!13 = !{!"long", !7, i64 0}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}
!16 = distinct !{!16, !15}
!17 = distinct !{!17, !15}
!18 = distinct !{!18, !15}


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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN11alglib_impl8mlpgradnEPNS_20multilayerperceptronEPNS_9ae_vectorES3_PdS3_PNS_8ae_stateE(ptr noundef %0, ptr noundef %1, ptr nocapture noundef readonly %2, ptr nocapture noundef %3, ptr noundef %4, ptr noundef %5) local_unnamed_addr #0 {
  store double 0.000000e+00, ptr %3, align 8, !tbaa !5
  %7 = getelementptr inbounds i8, ptr %0, i64 264
  %8 = load ptr, ptr %7, align 8, !tbaa !9
  %9 = getelementptr inbounds i8, ptr %8, i64 32
  %10 = load i64, ptr %9, align 8, !tbaa !10
  tail call void @_ZN11alglib_impl23rvectorsetlengthatleastEPNS_9ae_vectorElPNS_8ae_stateE(ptr noundef %4, i64 noundef %10, ptr noundef %5)
  %11 = getelementptr inbounds i8, ptr %0, i64 720
  tail call void @_ZN11alglib_impl10mlpprocessEPNS_20multilayerperceptronEPNS_9ae_vectorES3_PNS_8ae_stateE(ptr noundef %0, ptr noundef %1, ptr noundef nonnull %11, ptr noundef %5)
  %12 = load ptr, ptr %7, align 8, !tbaa !9
  %13 = getelementptr inbounds i8, ptr %12, i64 16
  %14 = load i64, ptr %13, align 8, !tbaa !10
  %15 = getelementptr inbounds i8, ptr %12, i64 24
  %16 = load i64, ptr %15, align 8, !tbaa !10
  %.not.not73 = icmp sgt i64 %16, 0
  br i1 %.not.not73, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %6
  %17 = getelementptr inbounds i8, ptr %0, i64 648
  %xtraiter = and i64 %16, 3
  %18 = icmp ult i64 %16, 4
  br i1 %18, label %._crit_edge.loopexit.unr-lcssa, label %.lr.ph.new

.lr.ph.new:                                       ; preds = %.lr.ph
  %unroll_iter = and i64 %16, 9223372036854775804
  br label %19

19:                                               ; preds = %19, %.lr.ph.new
  %.06574 = phi i64 [ 0, %.lr.ph.new ], [ %31, %19 ]
  %niter = phi i64 [ 0, %.lr.ph.new ], [ %niter.next.3, %19 ]
  %20 = load ptr, ptr %17, align 8, !tbaa !9
  %21 = getelementptr inbounds double, ptr %20, i64 %.06574
  store double 0.000000e+00, ptr %21, align 8, !tbaa !5
  %22 = or disjoint i64 %.06574, 1
  %23 = load ptr, ptr %17, align 8, !tbaa !9
  %24 = getelementptr inbounds double, ptr %23, i64 %22
  store double 0.000000e+00, ptr %24, align 8, !tbaa !5
  %25 = or disjoint i64 %.06574, 2
  %26 = load ptr, ptr %17, align 8, !tbaa !9
  %27 = getelementptr inbounds double, ptr %26, i64 %25
  store double 0.000000e+00, ptr %27, align 8, !tbaa !5
  %28 = or disjoint i64 %.06574, 3
  %29 = load ptr, ptr %17, align 8, !tbaa !9
  %30 = getelementptr inbounds double, ptr %29, i64 %28
  store double 0.000000e+00, ptr %30, align 8, !tbaa !5
  %31 = add nuw nsw i64 %.06574, 4
  %niter.next.3 = add i64 %niter, 4
  %niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
  br i1 %niter.ncmp.3, label %._crit_edge.loopexit.unr-lcssa, label %19, !llvm.loop !12

._crit_edge.loopexit.unr-lcssa:                   ; preds = %19, %.lr.ph
  %.06574.unr = phi i64 [ 0, %.lr.ph ], [ %31, %19 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge, label %.epil.preheader

.epil.preheader:                                  ; preds = %._crit_edge.loopexit.unr-lcssa, %.epil.preheader
  %.06574.epil = phi i64 [ %34, %.epil.preheader ], [ %.06574.unr, %._crit_edge.loopexit.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.epil.preheader ], [ 0, %._crit_edge.loopexit.unr-lcssa ]
  %32 = load ptr, ptr %17, align 8, !tbaa !9
  %33 = getelementptr inbounds double, ptr %32, i64 %.06574.epil
  store double 0.000000e+00, ptr %33, align 8, !tbaa !5
  %34 = add nuw nsw i64 %.06574.epil, 1
  %epil.iter.next = add i64 %epil.iter, 1
  %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
  br i1 %epil.iter.cmp.not, label %._crit_edge, label %.epil.preheader, !llvm.loop !14

._crit_edge:                                      ; preds = %._crit_edge.loopexit.unr-lcssa, %.epil.preheader, %6
  store double 0.000000e+00, ptr %3, align 8, !tbaa !5
  %35 = load ptr, ptr %7, align 8, !tbaa !9
  %36 = getelementptr inbounds i8, ptr %35, i64 48
  %37 = load i64, ptr %36, align 8, !tbaa !10
  %38 = icmp eq i64 %37, 0
  %.not.not6982 = icmp sgt i64 %14, 0
  br i1 %38, label %.preheader, label %.preheader72

.preheader72:                                     ; preds = %._crit_edge
  br i1 %.not.not6982, label %.lr.ph78, label %.loopexit

.lr.ph78:                                         ; preds = %.preheader72
  %39 = getelementptr inbounds i8, ptr %2, i64 56
  %40 = load ptr, ptr %39, align 8, !tbaa !9
  %xtraiter94 = and i64 %14, 7
  %41 = icmp ult i64 %14, 8
  br i1 %41, label %.preheader70.unr-lcssa, label %.lr.ph78.new

.lr.ph78.new:                                     ; preds = %.lr.ph78
  %unroll_iter98 = and i64 %14, 9223372036854775800
  br label %77

.preheader:                                       ; preds = %._crit_edge
  br i1 %.not.not6982, label %.lr.ph84, label %.loopexit

.lr.ph84:                                         ; preds = %.preheader
  %42 = getelementptr inbounds i8, ptr %0, i64 776
  %43 = getelementptr inbounds i8, ptr %2, i64 56
  %44 = getelementptr inbounds i8, ptr %0, i64 648
  %45 = sub nsw i64 %16, %14
  br label %46

46:                                               ; preds = %.lr.ph84, %46
  %.183 = phi i64 [ 0, %.lr.ph84 ], [ %68, %46 ]
  %47 = load ptr, ptr %42, align 8, !tbaa !9
  %48 = getelementptr inbounds double, ptr %47, i64 %.183
  %49 = load double, ptr %48, align 8, !tbaa !5
  %50 = load ptr, ptr %43, align 8, !tbaa !9
  %51 = getelementptr inbounds double, ptr %50, i64 %.183
  %52 = load double, ptr %51, align 8, !tbaa !5
  %53 = fsub double %49, %52
  %54 = load ptr, ptr %44, align 8, !tbaa !9
  %55 = getelementptr double, ptr %54, i64 %45
  %56 = getelementptr double, ptr %55, i64 %.183
  store double %53, ptr %56, align 8, !tbaa !5
  %57 = load double, ptr %3, align 8, !tbaa !5
  %58 = load ptr, ptr %42, align 8, !tbaa !9
  %59 = getelementptr inbounds double, ptr %58, i64 %.183
  %60 = load double, ptr %59, align 8, !tbaa !5
  %61 = load ptr, ptr %43, align 8, !tbaa !9
  %62 = getelementptr inbounds double, ptr %61, i64 %.183
  %63 = load double, ptr %62, align 8, !tbaa !5
  %64 = fsub double %60, %63
  %65 = tail call noundef double @_ZN11alglib_impl6ae_sqrEdPNS_8ae_stateE(double noundef %64, ptr noundef %5)
  %66 = fmul double %65, 5.000000e-01
  %67 = fadd double %57, %66
  store double %67, ptr %3, align 8, !tbaa !5
  %68 = add nuw nsw i64 %.183, 1
  %exitcond88.not = icmp eq i64 %68, %14
  br i1 %exitcond88.not, label %.loopexit, label %46, !llvm.loop !16

.preheader70.unr-lcssa:                           ; preds = %77, %.lr.ph78
  %.lcssa.ph = phi double [ poison, %.lr.ph78 ], [ %108, %77 ]
  %.077.unr = phi double [ 0.000000e+00, %.lr.ph78 ], [ %108, %77 ]
  %.276.unr = phi i64 [ 0, %.lr.ph78 ], [ %109, %77 ]
  %lcmp.mod96.not = icmp eq i64 %xtraiter94, 0
  br i1 %lcmp.mod96.not, label %.preheader70, label %.epil.preheader93

.epil.preheader93:                                ; preds = %.preheader70.unr-lcssa, %.epil.preheader93
  %.077.epil = phi double [ %71, %.epil.preheader93 ], [ %.077.unr, %.preheader70.unr-lcssa ]
  %.276.epil = phi i64 [ %72, %.epil.preheader93 ], [ %.276.unr, %.preheader70.unr-lcssa ]
  %epil.iter95 = phi i64 [ %epil.iter95.next, %.epil.preheader93 ], [ 0, %.preheader70.unr-lcssa ]
  %69 = getelementptr inbounds double, ptr %40, i64 %.276.epil
  %70 = load double, ptr %69, align 8, !tbaa !5
  %71 = fadd double %.077.epil, %70
  %72 = add nuw nsw i64 %.276.epil, 1
  %epil.iter95.next = add i64 %epil.iter95, 1
  %epil.iter95.cmp.not = icmp eq i64 %epil.iter95.next, %xtraiter94
  br i1 %epil.iter95.cmp.not, label %.preheader70, label %.epil.preheader93, !llvm.loop !17

.preheader70:                                     ; preds = %.epil.preheader93, %.preheader70.unr-lcssa
  %.lcssa = phi double [ %.lcssa.ph, %.preheader70.unr-lcssa ], [ %71, %.epil.preheader93 ]
  br i1 %.not.not6982, label %.lr.ph81, label %.loopexit

.lr.ph81:                                         ; preds = %.preheader70
  %73 = getelementptr inbounds i8, ptr %0, i64 776
  %74 = getelementptr inbounds i8, ptr %2, i64 56
  %75 = getelementptr inbounds i8, ptr %0, i64 648
  %76 = sub nsw i64 %16, %14
  br label %110

77:                                               ; preds = %77, %.lr.ph78.new
  %.077 = phi double [ 0.000000e+00, %.lr.ph78.new ], [ %108, %77 ]
  %.276 = phi i64 [ 0, %.lr.ph78.new ], [ %109, %77 ]
  %niter99 = phi i64 [ 0, %.lr.ph78.new ], [ %niter99.next.7, %77 ]
  %78 = getelementptr inbounds double, ptr %40, i64 %.276
  %79 = load double, ptr %78, align 8, !tbaa !5
  %80 = fadd double %.077, %79
  %81 = or disjoint i64 %.276, 1
  %82 = getelementptr inbounds double, ptr %40, i64 %81
  %83 = load double, ptr %82, align 8, !tbaa !5
  %84 = fadd double %80, %83
  %85 = or disjoint i64 %.276, 2
  %86 = getelementptr inbounds double, ptr %40, i64 %85
  %87 = load double, ptr %86, align 8, !tbaa !5
  %88 = fadd double %84, %87
  %89 = or disjoint i64 %.276, 3
  %90 = getelementptr inbounds double, ptr %40, i64 %89
  %91 = load double, ptr %90, align 8, !tbaa !5
  %92 = fadd double %88, %91
  %93 = or disjoint i64 %.276, 4
  %94 = getelementptr inbounds double, ptr %40, i64 %93
  %95 = load double, ptr %94, align 8, !tbaa !5
  %96 = fadd double %92, %95
  %97 = or disjoint i64 %.276, 5
  %98 = getelementptr inbounds double, ptr %40, i64 %97
  %99 = load double, ptr %98, align 8, !tbaa !5
  %100 = fadd double %96, %99
  %101 = or disjoint i64 %.276, 6
  %102 = getelementptr inbounds double, ptr %40, i64 %101
  %103 = load double, ptr %102, align 8, !tbaa !5
  %104 = fadd double %100, %103
  %105 = or disjoint i64 %.276, 7
  %106 = getelementptr inbounds double, ptr %40, i64 %105
  %107 = load double, ptr %106, align 8, !tbaa !5
  %108 = fadd double %104, %107
  %109 = add nuw nsw i64 %.276, 8
  %niter99.next.7 = add i64 %niter99, 8
  %niter99.ncmp.7 = icmp eq i64 %niter99.next.7, %unroll_iter98
  br i1 %niter99.ncmp.7, label %.preheader70.unr-lcssa, label %77, !llvm.loop !18

110:                                              ; preds = %.lr.ph81, %110
  %.380 = phi i64 [ 0, %.lr.ph81 ], [ %131, %110 ]
  %111 = load ptr, ptr %73, align 8, !tbaa !9
  %112 = getelementptr inbounds double, ptr %111, i64 %.380
  %113 = load double, ptr %112, align 8, !tbaa !5
  %114 = load ptr, ptr %74, align 8, !tbaa !9
  %115 = getelementptr inbounds double, ptr %114, i64 %.380
  %116 = load double, ptr %115, align 8, !tbaa !5
  %117 = fneg double %116
  %118 = tail call double @llvm.fmuladd.f64(double %.lcssa, double %113, double %117)
  %119 = load ptr, ptr %75, align 8, !tbaa !9
  %120 = getelementptr double, ptr %119, i64 %76
  %121 = getelementptr double, ptr %120, i64 %.380
  store double %118, ptr %121, align 8, !tbaa !5
  %122 = load double, ptr %3, align 8, !tbaa !5
  %123 = load ptr, ptr %74, align 8, !tbaa !9
  %124 = getelementptr inbounds double, ptr %123, i64 %.380
  %125 = load double, ptr %124, align 8, !tbaa !5
  %126 = load ptr, ptr %73, align 8, !tbaa !9
  %127 = getelementptr inbounds double, ptr %126, i64 %.380
  %128 = load double, ptr %127, align 8, !tbaa !5
  %129 = tail call noundef double @_ZN11alglib_implL24mlpbase_safecrossentropyEddPNS_8ae_stateE(double noundef %125, double noundef %128, ptr noundef %5)
  %130 = fadd double %122, %129
  store double %130, ptr %3, align 8, !tbaa !5
  %131 = add nuw nsw i64 %.380, 1
  %exitcond87.not = icmp eq i64 %131, %14
  br i1 %exitcond87.not, label %.loopexit, label %110, !llvm.loop !19

.loopexit:                                        ; preds = %110, %46, %.preheader72, %.preheader70, %.preheader
  %132 = getelementptr inbounds i8, ptr %0, i64 464
  %133 = getelementptr inbounds i8, ptr %0, i64 272
  %134 = getelementptr inbounds i8, ptr %0, i64 592
  tail call void @_ZN11alglib_implL36mlpbase_mlpinternalcalculategradientEPNS_20multilayerperceptronEPNS_9ae_vectorES3_S3_S3_bPNS_8ae_stateE(ptr noundef %0, ptr noundef nonnull %132, ptr noundef nonnull %133, ptr noundef nonnull %134, ptr noundef %4, i1 noundef zeroext true, ptr noundef %5)
  ret void
}

declare noundef double @_ZN11alglib_impl6ae_sqrEdPNS_8ae_stateE(double noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #2

declare void @_ZN11alglib_impl23rvectorsetlengthatleastEPNS_9ae_vectorElPNS_8ae_stateE(ptr noundef, i64 noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
declare hidden noundef double @_ZN11alglib_implL24mlpbase_safecrossentropyEddPNS_8ae_stateE(double noundef, double noundef, ptr noundef) local_unnamed_addr #0

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

attributes #0 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree 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 = !{!"double", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!7, !7, i64 0}
!10 = !{!11, !11, i64 0}
!11 = !{!"long", !7, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.unroll.disable"}
!16 = distinct !{!16, !13}
!17 = distinct !{!17, !15}
!18 = distinct !{!18, !13}
!19 = distinct !{!19, !13}


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