; LLVM IR from FidoProject/Fido :: src/GeneticAlgo.ll (ZN3gen11GeneticAlgo20getBestNeuralNetworkEiN3net9NeuralNetE)

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

%"class.net::NeuralNet" = type { %"class.std::vector.5" }
%"class.std::vector.5" = type { %"struct.std::_Vector_base.6" }
%"struct.std::_Vector_base.6" = type { %"struct.std::_Vector_base<net::Layer, std::allocator<net::Layer>>::_Vector_impl" }
%"struct.std::_Vector_base<net::Layer, std::allocator<net::Layer>>::_Vector_impl" = type { %"struct.std::_Vector_base<net::Layer, std::allocator<net::Layer>>::_Vector_impl_data" }
%"struct.std::_Vector_base<net::Layer, std::allocator<net::Layer>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.gen::GeneticAlgo" = type <{ %"class.std::vector", %"class.std::vector.0", i32, i32, float, float, ptr, i32, [4 x i8] }>
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<net::NeuralNet, std::allocator<net::NeuralNet>>::_Vector_impl" }
%"struct.std::_Vector_base<net::NeuralNet, std::allocator<net::NeuralNet>>::_Vector_impl" = type { %"struct.std::_Vector_base<net::NeuralNet, std::allocator<net::NeuralNet>>::_Vector_impl_data" }
%"struct.std::_Vector_base<net::NeuralNet, std::allocator<net::NeuralNet>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.0" = type { %"struct.std::_Vector_base.1" }
%"struct.std::_Vector_base.1" = type { %"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl" }
%"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl" = type { %"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl_data" }
%"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl_data" = type { ptr, ptr, ptr }

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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt6vectorIdSaIdEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #1 align 2

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN3net9NeuralNetC2ERKS0_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN3net9NeuralNetD2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIN3net9NeuralNetESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3gen11GeneticAlgo20createNextGenerationEv(ptr noundef nonnull align 8 dereferenceable(76)) #4 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIN3net9NeuralNetESaIS1_EE9push_backERKS1_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) #4 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIN3net9NeuralNetESaIS1_EE5clearEv(ptr noundef nonnull align 8 dereferenceable(24)) #1 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3gen11GeneticAlgo20getBestNeuralNetworkEiN3net9NeuralNetE(ptr dead_on_unwind noalias writable sret(%"class.net::NeuralNet") align 8 %0, ptr noundef nonnull align 8 dereferenceable(76) %1, i32 noundef %2, ptr noundef %3) #4 align 2 personality ptr @__gxx_personality_v0 {
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca %"class.net::NeuralNet", align 8
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  store ptr %0, ptr %5, align 8
  store ptr %1, ptr %6, align 8, !tbaa !5
  store i32 %2, ptr %7, align 4, !tbaa !9
  store ptr %3, ptr %8, align 8, !tbaa !5
  %16 = load ptr, ptr %6, align 8
  %17 = getelementptr inbounds %"class.gen::GeneticAlgo", ptr %16, i32 0, i32 0
  call void @_ZNSt6vectorIN3net9NeuralNetESaIS1_EE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) %17) #5
  %18 = getelementptr inbounds %"class.gen::GeneticAlgo", ptr %16, i32 0, i32 1
  call void @_ZNSt6vectorIdSaIdEE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) %18) #5
  %19 = getelementptr inbounds %"class.gen::GeneticAlgo", ptr %16, i32 0, i32 0
  call void @_ZNSt6vectorIN3net9NeuralNetESaIS1_EE9push_backERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %19, ptr noundef nonnull align 8 dereferenceable(24) %3)
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  store i32 0, ptr %9, align 4, !tbaa !9
  br label %20

20:                                               ; preds = %30, %4
  %21 = load i32, ptr %9, align 4, !tbaa !9
  %22 = getelementptr inbounds %"class.gen::GeneticAlgo", ptr %16, i32 0, i32 2
  %23 = load i32, ptr %22, align 8, !tbaa !11
  %24 = sub i32 %23, 1
  %25 = icmp ult i32 %21, %24
  br i1 %25, label %27, label %26

26:                                               ; preds = %20
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  br label %37

27:                                               ; preds = %20
  %28 = getelementptr inbounds %"class.gen::GeneticAlgo", ptr %16, i32 0, i32 0
  call void @llvm.lifetime.start.p0(i64 24, ptr %10) #5
  call void @_ZN3net9NeuralNetC2ERKS0_(ptr noundef nonnull align 8 dereferenceable(24) %10, ptr noundef nonnull align 8 dereferenceable(24) %3)
  invoke void @_ZNSt6vectorIN3net9NeuralNetESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %28, ptr noundef nonnull align 8 dereferenceable(24) %10)
          to label %29 unwind label %33

29:                                               ; preds = %27
  call void @_ZN3net9NeuralNetD2Ev(ptr noundef nonnull align 8 dereferenceable(24) %10) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %10) #5
  br label %30

30:                                               ; preds = %29
  %31 = load i32, ptr %9, align 4, !tbaa !9
  %32 = add i32 %31, 1
  store i32 %32, ptr %9, align 4, !tbaa !9
  br label %20, !llvm.loop !22

33:                                               ; preds = %27
  %34 = landingpad { ptr, i32 }
          cleanup
  %35 = extractvalue { ptr, i32 } %34, 0
  store ptr %35, ptr %11, align 8
  %36 = extractvalue { ptr, i32 } %34, 1
  store i32 %36, ptr %12, align 4
  call void @_ZN3net9NeuralNetD2Ev(ptr noundef nonnull align 8 dereferenceable(24) %10) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  br label %78

37:                                               ; preds = %26
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  store i32 0, ptr %13, align 4, !tbaa !9
  br label %38

38:                                               ; preds = %44, %37
  %39 = load i32, ptr %13, align 4, !tbaa !9
  %40 = load i32, ptr %7, align 4, !tbaa !9
  %41 = icmp ult i32 %39, %40
  br i1 %41, label %43, label %42

42:                                               ; preds = %38
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  br label %47

43:                                               ; preds = %38
  call void @_ZN3gen11GeneticAlgo20getPopulationFitnessEv(ptr noundef nonnull align 8 dereferenceable(76) %16)
  call void @_ZN3gen11GeneticAlgo20createNextGenerationEv(ptr noundef nonnull align 8 dereferenceable(76) %16)
  br label %44

44:                                               ; preds = %43
  %45 = load i32, ptr %13, align 4, !tbaa !9
  %46 = add i32 %45, 1
  store i32 %46, ptr %13, align 4, !tbaa !9
  br label %38, !llvm.loop !24

47:                                               ; preds = %42
  call void @_ZN3gen11GeneticAlgo20getPopulationFitnessEv(ptr noundef nonnull align 8 dereferenceable(76) %16)
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #5
  store i32 0, ptr %14, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #5
  store i32 1, ptr %15, align 4, !tbaa !9
  br label %48

48:                                               ; preds = %70, %47
  %49 = load i32, ptr %15, align 4, !tbaa !9
  %50 = zext i32 %49 to i64
  %51 = getelementptr inbounds %"class.gen::GeneticAlgo", ptr %16, i32 0, i32 1
  %52 = call noundef i64 @_ZNKSt6vectorIdSaIdEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %51) #5
  %53 = icmp ult i64 %50, %52
  br i1 %53, label %55, label %54

54:                                               ; preds = %48
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #5
  br label %73

55:                                               ; preds = %48
  %56 = getelementptr inbounds %"class.gen::GeneticAlgo", ptr %16, i32 0, i32 1
  %57 = load i32, ptr %15, align 4, !tbaa !9
  %58 = zext i32 %57 to i64
  %59 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %56, i64 noundef %58) #5
  %60 = load double, ptr %59, align 8, !tbaa !25
  %61 = getelementptr inbounds %"class.gen::GeneticAlgo", ptr %16, i32 0, i32 1
  %62 = load i32, ptr %14, align 4, !tbaa !9
  %63 = sext i32 %62 to i64
  %64 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %61, i64 noundef %63) #5
  %65 = load double, ptr %64, align 8, !tbaa !25
  %66 = fcmp ogt double %60, %65
  br i1 %66, label %67, label %69

67:                                               ; preds = %55
  %68 = load i32, ptr %15, align 4, !tbaa !9
  store i32 %68, ptr %14, align 4, !tbaa !9
  br label %69

69:                                               ; preds = %67, %55
  br label %70

70:                                               ; preds = %69
  %71 = load i32, ptr %15, align 4, !tbaa !9
  %72 = add i32 %71, 1
  store i32 %72, ptr %15, align 4, !tbaa !9
  br label %48, !llvm.loop !27

73:                                               ; preds = %54
  %74 = getelementptr inbounds %"class.gen::GeneticAlgo", ptr %16, i32 0, i32 0
  %75 = load i32, ptr %14, align 4, !tbaa !9
  %76 = sext i32 %75 to i64
  %77 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIN3net9NeuralNetESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %74, i64 noundef %76) #5
  call void @_ZN3net9NeuralNetC2ERKS0_(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 8 dereferenceable(24) %77)
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  ret void

78:                                               ; preds = %33
  %79 = load ptr, ptr %11, align 8
  %80 = load i32, ptr %12, align 4
  %81 = insertvalue { ptr, i32 } poison, ptr %79, 0
  %82 = insertvalue { ptr, i32 } %81, i32 %80, 1
  resume { ptr, i32 } %82
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIdSaIdEE5clearEv(ptr noundef nonnull align 8 dereferenceable(24)) #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIN3net9NeuralNetESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) #4 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3gen11GeneticAlgo20getPopulationFitnessEv(ptr noundef nonnull align 8 dereferenceable(76)) #4 align 2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { inlinehint 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 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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 #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 = !{!"int", !7, i64 0}
!11 = !{!12, !10, i64 48}
!12 = !{!"_ZTSN3gen11GeneticAlgoE", !13, i64 0, !17, i64 24, !10, i64 48, !10, i64 52, !21, i64 56, !21, i64 60, !6, i64 64, !10, i64 72}
!13 = !{!"_ZTSSt6vectorIN3net9NeuralNetESaIS1_EE", !14, i64 0}
!14 = !{!"_ZTSSt12_Vector_baseIN3net9NeuralNetESaIS1_EE", !15, i64 0}
!15 = !{!"_ZTSNSt12_Vector_baseIN3net9NeuralNetESaIS1_EE12_Vector_implE", !16, i64 0}
!16 = !{!"_ZTSNSt12_Vector_baseIN3net9NeuralNetESaIS1_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!17 = !{!"_ZTSSt6vectorIdSaIdEE", !18, i64 0}
!18 = !{!"_ZTSSt12_Vector_baseIdSaIdEE", !19, i64 0}
!19 = !{!"_ZTSNSt12_Vector_baseIdSaIdEE12_Vector_implE", !20, i64 0}
!20 = !{!"_ZTSNSt12_Vector_baseIdSaIdEE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!21 = !{!"float", !7, i64 0}
!22 = distinct !{!22, !23}
!23 = !{!"llvm.loop.mustprogress"}
!24 = distinct !{!24, !23}
!25 = !{!26, !26, i64 0}
!26 = !{!"double", !7, i64 0}
!27 = distinct !{!27, !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"

%"class.net::NeuralNet" = type { %"class.std::vector.5" }
%"class.std::vector.5" = type { %"struct.std::_Vector_base.6" }
%"struct.std::_Vector_base.6" = type { %"struct.std::_Vector_base<net::Layer, std::allocator<net::Layer>>::_Vector_impl" }
%"struct.std::_Vector_base<net::Layer, std::allocator<net::Layer>>::_Vector_impl" = type { %"struct.std::_Vector_base<net::Layer, std::allocator<net::Layer>>::_Vector_impl_data" }
%"struct.std::_Vector_base<net::Layer, std::allocator<net::Layer>>::_Vector_impl_data" = type { ptr, ptr, ptr }

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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt6vectorIdSaIdEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #1 align 2

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN3net9NeuralNetC2ERKS0_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN3net9NeuralNetD2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIN3net9NeuralNetESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3gen11GeneticAlgo20createNextGenerationEv(ptr noundef nonnull align 8 dereferenceable(76)) local_unnamed_addr #4 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIN3net9NeuralNetESaIS1_EE9push_backERKS1_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #4 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIN3net9NeuralNetESaIS1_EE5clearEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3gen11GeneticAlgo20getBestNeuralNetworkEiN3net9NeuralNetE(ptr dead_on_unwind noalias writable sret(%"class.net::NeuralNet") align 8 %0, ptr noundef nonnull align 8 dereferenceable(76) %1, i32 noundef %2, ptr noundef %3) local_unnamed_addr #4 align 2 personality ptr @__gxx_personality_v0 {
  %5 = alloca %"class.net::NeuralNet", align 8
  tail call void @_ZNSt6vectorIN3net9NeuralNetESaIS1_EE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) %1) #5
  %6 = getelementptr inbounds i8, ptr %1, i64 24
  tail call void @_ZNSt6vectorIdSaIdEE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) %6) #5
  tail call void @_ZNSt6vectorIN3net9NeuralNetESaIS1_EE9push_backERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %1, ptr noundef nonnull align 8 dereferenceable(24) %3)
  %7 = getelementptr inbounds i8, ptr %1, i64 48
  %8 = load i32, ptr %7, align 8, !tbaa !5
  %.not = icmp eq i32 %8, 1
  br i1 %.not, label %.preheader, label %.lr.ph

.preheader:                                       ; preds = %9, %4
  %.not25 = icmp eq i32 %2, 0
  br i1 %.not25, label %._crit_edge, label %.lr.ph19

.lr.ph:                                           ; preds = %4, %9
  %.01517 = phi i32 [ %10, %9 ], [ 0, %4 ]
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %5) #5
  call void @_ZN3net9NeuralNetC2ERKS0_(ptr noundef nonnull align 8 dereferenceable(24) %5, ptr noundef nonnull align 8 dereferenceable(24) %3)
  invoke void @_ZNSt6vectorIN3net9NeuralNetESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %1, ptr noundef nonnull align 8 dereferenceable(24) %5)
          to label %9 unwind label %14

9:                                                ; preds = %.lr.ph
  call void @_ZN3net9NeuralNetD2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #5
  %10 = add nuw i32 %.01517, 1
  %11 = load i32, ptr %7, align 8, !tbaa !5
  %12 = add i32 %11, -1
  %13 = icmp ult i32 %10, %12
  br i1 %13, label %.lr.ph, label %.preheader, !llvm.loop !20

14:                                               ; preds = %.lr.ph
  %15 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN3net9NeuralNetD2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #5
  resume { ptr, i32 } %15

._crit_edge:                                      ; preds = %.lr.ph19, %.preheader
  call void @_ZN3gen11GeneticAlgo20getPopulationFitnessEv(ptr noundef nonnull align 8 dereferenceable(76) %1)
  %16 = call noundef i64 @_ZNKSt6vectorIdSaIdEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %6) #5
  %17 = icmp ugt i64 %16, 1
  br i1 %17, label %.lr.ph23, label %._crit_edge24

.lr.ph19:                                         ; preds = %.preheader, %.lr.ph19
  %.01418 = phi i32 [ %18, %.lr.ph19 ], [ 0, %.preheader ]
  call void @_ZN3gen11GeneticAlgo20getPopulationFitnessEv(ptr noundef nonnull align 8 dereferenceable(76) %1)
  call void @_ZN3gen11GeneticAlgo20createNextGenerationEv(ptr noundef nonnull align 8 dereferenceable(76) %1)
  %18 = add nuw i32 %.01418, 1
  %exitcond.not = icmp eq i32 %18, %2
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph19, !llvm.loop !22

._crit_edge24.loopexit:                           ; preds = %.lr.ph23
  %19 = sext i32 %.1 to i64
  br label %._crit_edge24

._crit_edge24:                                    ; preds = %._crit_edge24.loopexit, %._crit_edge
  %.013.lcssa = phi i64 [ 0, %._crit_edge ], [ %19, %._crit_edge24.loopexit ]
  %20 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIN3net9NeuralNetESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %.013.lcssa) #5
  call void @_ZN3net9NeuralNetC2ERKS0_(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 8 dereferenceable(24) %20)
  ret void

.lr.ph23:                                         ; preds = %._crit_edge, %.lr.ph23
  %21 = phi i64 [ %29, %.lr.ph23 ], [ 1, %._crit_edge ]
  %.021 = phi i32 [ %28, %.lr.ph23 ], [ 1, %._crit_edge ]
  %.01320 = phi i32 [ %.1, %.lr.ph23 ], [ 0, %._crit_edge ]
  %22 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %6, i64 noundef %21) #5
  %23 = load double, ptr %22, align 8, !tbaa !23
  %24 = sext i32 %.01320 to i64
  %25 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %6, i64 noundef %24) #5
  %26 = load double, ptr %25, align 8, !tbaa !23
  %27 = fcmp ogt double %23, %26
  %.1 = select i1 %27, i32 %.021, i32 %.01320
  %28 = add i32 %.021, 1
  %29 = zext i32 %28 to i64
  %30 = call noundef i64 @_ZNKSt6vectorIdSaIdEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %6) #5
  %31 = icmp ugt i64 %30, %29
  br i1 %31, label %.lr.ph23, label %._crit_edge24.loopexit, !llvm.loop !25
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIdSaIdEE5clearEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIN3net9NeuralNetESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #4 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3gen11GeneticAlgo20getPopulationFitnessEv(ptr noundef nonnull align 8 dereferenceable(76)) local_unnamed_addr #4 align 2

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { inlinehint 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 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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 #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, !18, i64 48}
!6 = !{!"_ZTSN3gen11GeneticAlgoE", !7, i64 0, !14, i64 24, !18, i64 48, !18, i64 52, !19, i64 56, !19, i64 60, !11, i64 64, !18, i64 72}
!7 = !{!"_ZTSSt6vectorIN3net9NeuralNetESaIS1_EE", !8, i64 0}
!8 = !{!"_ZTSSt12_Vector_baseIN3net9NeuralNetESaIS1_EE", !9, i64 0}
!9 = !{!"_ZTSNSt12_Vector_baseIN3net9NeuralNetESaIS1_EE12_Vector_implE", !10, i64 0}
!10 = !{!"_ZTSNSt12_Vector_baseIN3net9NeuralNetESaIS1_EE17_Vector_impl_dataE", !11, i64 0, !11, i64 8, !11, i64 16}
!11 = !{!"any pointer", !12, i64 0}
!12 = !{!"omnipotent char", !13, i64 0}
!13 = !{!"Simple C++ TBAA"}
!14 = !{!"_ZTSSt6vectorIdSaIdEE", !15, i64 0}
!15 = !{!"_ZTSSt12_Vector_baseIdSaIdEE", !16, i64 0}
!16 = !{!"_ZTSNSt12_Vector_baseIdSaIdEE12_Vector_implE", !17, i64 0}
!17 = !{!"_ZTSNSt12_Vector_baseIdSaIdEE17_Vector_impl_dataE", !11, i64 0, !11, i64 8, !11, i64 16}
!18 = !{!"int", !12, i64 0}
!19 = !{!"float", !12, i64 0}
!20 = distinct !{!20, !21}
!21 = !{!"llvm.loop.mustprogress"}
!22 = distinct !{!22, !21}
!23 = !{!24, !24, i64 0}
!24 = !{!"double", !12, i64 0}
!25 = distinct !{!25, !21}


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