; LLVM IR from SoloGameDevGitHub/AIEngine :: NeuralNetwork/MLP (MLP)

; 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.std::vector.10" = type { %"struct.std::_Vector_base.11" }
%"struct.std::_Vector_base.11" = 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 }
%"class.std::allocator.12" = type { i8 }
%"class.NeuralNetwork::MultiLayerPerceptron" = type { %"class.serialization::ISerializable", %"class.std::vector", %"class.std::vector.0", ptr }
%"class.serialization::ISerializable" = type { ptr }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<std::unique_ptr<NeuralNetwork::Layer>, std::allocator<std::unique_ptr<NeuralNetwork::Layer>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::unique_ptr<NeuralNetwork::Layer>, std::allocator<std::unique_ptr<NeuralNetwork::Layer>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::unique_ptr<NeuralNetwork::Layer>, std::allocator<std::unique_ptr<NeuralNetwork::Layer>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::unique_ptr<NeuralNetwork::Layer>, std::allocator<std::unique_ptr<NeuralNetwork::Layer>>>::_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<std::vector<double>, std::allocator<std::vector<double>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::vector<double>, std::allocator<std::vector<double>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::vector<double>, std::allocator<std::vector<double>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::vector<double>, std::allocator<std::vector<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: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN13NeuralNetwork20MultiLayerPerceptron11feedforwardESt6vectorIdSaIdEE(ptr dead_on_unwind noalias writable sret(%"class.std::vector.10") align 8, ptr noundef nonnull align 8 dereferenceable(64), ptr noundef) #2 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt6vectorISt10unique_ptrIN13NeuralNetwork5LayerESt14default_deleteIS2_EESaIS5_EE4sizeEv(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 @_ZNSt6vectorISt10unique_ptrIN13NeuralNetwork5LayerESt14default_deleteIS2_EESaIS5_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #1 align 2

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

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

declare void @_ZN13NeuralNetwork5Layer11feedforwardERKSt6vectorIdSaIdEE(ptr dead_on_unwind writable sret(%"class.std::vector.10") align 8, ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(24)) #3

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

; 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 @_ZNKSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #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: mustprogress uwtable
declare dso_local void @_Z19updateNeuronWeightsRN13NeuralNetwork6NeuronERKSt6vectorIdSaIdEEddd(ptr noundef nonnull align 8 dereferenceable(40), ptr noundef nonnull align 8 dereferenceable(24), double noundef, double noundef, double noundef) #2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN13NeuralNetwork20MultiLayerPerceptron13backpropagateESt6vectorIdSaIdEES3_d(ptr noundef nonnull align 8 dereferenceable(64) %0, ptr noundef %1, ptr noundef %2, double noundef %3) #2 align 2 personality ptr @__gxx_personality_v0 {
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca double, align 8
  %9 = alloca %"class.std::vector.10", align 8
  %10 = alloca %"class.std::vector.10", align 8
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  %13 = alloca %"class.std::vector.10", align 8
  %14 = alloca %"class.std::allocator.12", align 1
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca ptr, align 8
  %20 = alloca %"class.std::vector.10", align 8
  %21 = alloca %"class.std::allocator.12", align 1
  %22 = alloca ptr, align 8
  %23 = alloca %"class.std::vector.10", align 8
  %24 = alloca %"class.std::vector.10", align 8
  %25 = alloca i32, align 4
  %26 = alloca ptr, align 8
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store ptr %2, ptr %7, align 8, !tbaa !5
  store double %3, ptr %8, align 8, !tbaa !9
  %27 = load ptr, ptr %5, align 8
  call void @llvm.lifetime.start.p0(i64 24, ptr %9) #4
  call void @_ZNSt6vectorIdSaIdEEC2ERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %10, ptr noundef nonnull align 8 dereferenceable(24) %1)
  invoke void @_ZN13NeuralNetwork20MultiLayerPerceptron11feedforwardESt6vectorIdSaIdEE(ptr dead_on_unwind writable sret(%"class.std::vector.10") align 8 %9, ptr noundef nonnull align 8 dereferenceable(64) %27, ptr noundef %10)
          to label %28 unwind label %37

28:                                               ; preds = %4
  call void @_ZNSt6vectorIdSaIdEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %10) #4
  call void @llvm.lifetime.start.p0(i64 24, ptr %13) #4
  %29 = call noundef i64 @_ZNKSt6vectorIdSaIdEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %9) #4
  call void @llvm.lifetime.start.p0(i64 1, ptr %14) #4
  call void @_ZNSaIdEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %14) #4
  invoke void @_ZNSt6vectorIdSaIdEEC2EmRKS0_(ptr noundef nonnull align 8 dereferenceable(24) %13, i64 noundef %29, ptr noundef nonnull align 1 dereferenceable(1) %14)
          to label %30 unwind label %41

30:                                               ; preds = %28
  call void @_ZNSt15__new_allocatorIdED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %14) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr %14) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #4
  store i32 0, ptr %15, align 4, !tbaa !11
  br label %31

31:                                               ; preds = %58, %30
  %32 = load i32, ptr %15, align 4, !tbaa !11
  %33 = sext i32 %32 to i64
  %34 = call noundef i64 @_ZNKSt6vectorIdSaIdEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %9) #4
  %35 = icmp ult i64 %33, %34
  br i1 %35, label %45, label %36

36:                                               ; preds = %31
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #4
  br label %61

37:                                               ; preds = %4
  %38 = landingpad { ptr, i32 }
          cleanup
  %39 = extractvalue { ptr, i32 } %38, 0
  store ptr %39, ptr %11, align 8
  %40 = extractvalue { ptr, i32 } %38, 1
  store i32 %40, ptr %12, align 4
  call void @_ZNSt6vectorIdSaIdEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %10) #4
  br label %178

41:                                               ; preds = %28
  %42 = landingpad { ptr, i32 }
          cleanup
  %43 = extractvalue { ptr, i32 } %42, 0
  store ptr %43, ptr %11, align 8
  %44 = extractvalue { ptr, i32 } %42, 1
  store i32 %44, ptr %12, align 4
  call void @_ZNSt15__new_allocatorIdED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %14) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr %14) #4
  br label %177

45:                                               ; preds = %31
  %46 = load i32, ptr %15, align 4, !tbaa !11
  %47 = sext i32 %46 to i64
  %48 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %47) #4
  %49 = load double, ptr %48, align 8, !tbaa !9
  %50 = load i32, ptr %15, align 4, !tbaa !11
  %51 = sext i32 %50 to i64
  %52 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %9, i64 noundef %51) #4
  %53 = load double, ptr %52, align 8, !tbaa !9
  %54 = fsub double %49, %53
  %55 = load i32, ptr %15, align 4, !tbaa !11
  %56 = sext i32 %55 to i64
  %57 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %13, i64 noundef %56) #4
  store double %54, ptr %57, align 8, !tbaa !9
  br label %58

58:                                               ; preds = %45
  %59 = load i32, ptr %15, align 4, !tbaa !11
  %60 = add nsw i32 %59, 1
  store i32 %60, ptr %15, align 4, !tbaa !11
  br label %31, !llvm.loop !13

61:                                               ; preds = %36
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #4
  %62 = getelementptr inbounds %"class.NeuralNetwork::MultiLayerPerceptron", ptr %27, i32 0, i32 1
  %63 = call noundef i64 @_ZNKSt6vectorISt10unique_ptrIN13NeuralNetwork5LayerESt14default_deleteIS2_EESaIS5_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %62) #4
  %64 = sub i64 %63, 1
  %65 = trunc i64 %64 to i32
  store i32 %65, ptr %16, align 4, !tbaa !11
  br label %66

66:                                               ; preds = %163, %61
  %67 = load i32, ptr %16, align 4, !tbaa !11
  %68 = icmp sge i32 %67, 0
  br i1 %68, label %70, label %69

69:                                               ; preds = %66
  store i32 5, ptr %17, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #4
  br label %176

70:                                               ; preds = %66
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #4
  %71 = call noundef i64 @_ZNKSt6vectorIdSaIdEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %1) #4
  %72 = trunc i64 %71 to i32
  store i32 %72, ptr %18, align 4, !tbaa !11
  %73 = load i32, ptr %16, align 4, !tbaa !11
  %74 = icmp sgt i32 %73, 0
  br i1 %74, label %75, label %89

75:                                               ; preds = %70
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #4
  %76 = getelementptr inbounds %"class.NeuralNetwork::MultiLayerPerceptron", ptr %27, i32 0, i32 1
  %77 = load i32, ptr %16, align 4, !tbaa !11
  %78 = sub nsw i32 %77, 1
  %79 = sext i32 %78 to i64
  %80 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorISt10unique_ptrIN13NeuralNetwork5LayerESt14default_deleteIS2_EESaIS5_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %76, i64 noundef %79) #4
  store ptr %80, ptr %19, align 8, !tbaa !5
  %81 = load ptr, ptr %19, align 8, !tbaa !5
  %82 = call noundef ptr @_ZNKSt10unique_ptrIN13NeuralNetwork5LayerESt14default_deleteIS1_EEptEv(ptr noundef nonnull align 8 dereferenceable(8) %81) #4
  %83 = invoke noundef i32 @_ZNK13NeuralNetwork5Layer16getNeuronsLengthEv(ptr noundef nonnull align 8 dereferenceable(32) %82)
          to label %84 unwind label %85

84:                                               ; preds = %75
  store i32 %83, ptr %18, align 4, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #4
  br label %89

85:                                               ; preds = %75
  %86 = landingpad { ptr, i32 }
          cleanup
  %87 = extractvalue { ptr, i32 } %86, 0
  store ptr %87, ptr %11, align 8
  %88 = extractvalue { ptr, i32 } %86, 1
  store i32 %88, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #4
  br label %175

89:                                               ; preds = %84, %70
  call void @llvm.lifetime.start.p0(i64 24, ptr %20) #4
  %90 = load i32, ptr %18, align 4, !tbaa !11
  %91 = sext i32 %90 to i64
  call void @llvm.lifetime.start.p0(i64 1, ptr %21) #4
  call void @_ZNSaIdEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %21) #4
  invoke void @_ZNSt6vectorIdSaIdEEC2EmRKS0_(ptr noundef nonnull align 8 dereferenceable(24) %20, i64 noundef %91, ptr noundef nonnull align 1 dereferenceable(1) %21)
          to label %92 unwind label %110

92:                                               ; preds = %89
  call void @_ZNSt15__new_allocatorIdED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %21) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr %21) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #4
  %93 = load i32, ptr %16, align 4, !tbaa !11
  %94 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNK13NeuralNetwork20MultiLayerPerceptron8getLayerEi(ptr noundef nonnull align 8 dereferenceable(64) %27, i32 noundef %93)
          to label %95 unwind label %114

95:                                               ; preds = %92
  store ptr %94, ptr %22, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 24, ptr %23) #4
  %96 = getelementptr inbounds %"class.NeuralNetwork::MultiLayerPerceptron", ptr %27, i32 0, i32 2
  %97 = load i32, ptr %16, align 4, !tbaa !11
  %98 = sext i32 %97 to i64
  %99 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIS_IdSaIdEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %96, i64 noundef %98) #4
  invoke void @_ZNSt6vectorIdSaIdEEC2ERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %23, ptr noundef nonnull align 8 dereferenceable(24) %99)
          to label %100 unwind label %118

100:                                              ; preds = %95
  call void @llvm.lifetime.start.p0(i64 24, ptr %24) #4
  %101 = load ptr, ptr %22, align 8, !tbaa !5
  invoke void @_ZN13NeuralNetwork5Layer11feedforwardERKSt6vectorIdSaIdEE(ptr dead_on_unwind writable sret(%"class.std::vector.10") align 8 %24, ptr noundef nonnull align 8 dereferenceable(32) %101, ptr noundef nonnull align 8 dereferenceable(24) %23)
          to label %102 unwind label %122

102:                                              ; preds = %100
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #4
  store i32 0, ptr %25, align 4, !tbaa !11
  br label %103

103:                                              ; preds = %152, %102
  %104 = load i32, ptr %25, align 4, !tbaa !11
  %105 = load ptr, ptr %22, align 8, !tbaa !5
  %106 = invoke noundef i32 @_ZNK13NeuralNetwork5Layer16getNeuronsLengthEv(ptr noundef nonnull align 8 dereferenceable(32) %105)
          to label %107 unwind label %126

107:                                              ; preds = %103
  %108 = icmp slt i32 %104, %106
  br i1 %108, label %130, label %109

109:                                              ; preds = %107
  store i32 8, ptr %17, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #4
  br label %160

110:                                              ; preds = %89
  %111 = landingpad { ptr, i32 }
          cleanup
  %112 = extractvalue { ptr, i32 } %111, 0
  store ptr %112, ptr %11, align 8
  %113 = extractvalue { ptr, i32 } %111, 1
  store i32 %113, ptr %12, align 4
  call void @_ZNSt15__new_allocatorIdED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %21) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr %21) #4
  br label %174

114:                                              ; preds = %92
  %115 = landingpad { ptr, i32 }
          cleanup
  %116 = extractvalue { ptr, i32 } %115, 0
  store ptr %116, ptr %11, align 8
  %117 = extractvalue { ptr, i32 } %115, 1
  store i32 %117, ptr %12, align 4
  br label %173

118:                                              ; preds = %95
  %119 = landingpad { ptr, i32 }
          cleanup
  %120 = extractvalue { ptr, i32 } %119, 0
  store ptr %120, ptr %11, align 8
  %121 = extractvalue { ptr, i32 } %119, 1
  store i32 %121, ptr %12, align 4
  br label %172

122:                                              ; preds = %100
  %123 = landingpad { ptr, i32 }
          cleanup
  %124 = extractvalue { ptr, i32 } %123, 0
  store ptr %124, ptr %11, align 8
  %125 = extractvalue { ptr, i32 } %123, 1
  store i32 %125, ptr %12, align 4
  br label %171

126:                                              ; preds = %103
  %127 = landingpad { ptr, i32 }
          cleanup
  %128 = extractvalue { ptr, i32 } %127, 0
  store ptr %128, ptr %11, align 8
  %129 = extractvalue { ptr, i32 } %127, 1
  store i32 %129, ptr %12, align 4
  br label %159

130:                                              ; preds = %107
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #4
  %131 = load ptr, ptr %22, align 8, !tbaa !5
  %132 = load i32, ptr %25, align 4, !tbaa !11
  %133 = invoke noundef nonnull align 8 dereferenceable(40) ptr @_ZNK13NeuralNetwork5Layer9getNeuronEi(ptr noundef nonnull align 8 dereferenceable(32) %131, i32 noundef %132)
          to label %134 unwind label %155

134:                                              ; preds = %130
  store ptr %133, ptr %26, align 8, !tbaa !5
  %135 = load ptr, ptr %26, align 8, !tbaa !5
  %136 = load i32, ptr %25, align 4, !tbaa !11
  %137 = sext i32 %136 to i64
  %138 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %13, i64 noundef %137) #4
  %139 = load double, ptr %138, align 8, !tbaa !9
  invoke void @_Z22getPreviousLayerErrorsRKN13NeuralNetwork6NeuronEdRSt6vectorIdSaIdEE(ptr noundef nonnull align 8 dereferenceable(40) %135, double noundef %139, ptr noundef nonnull align 8 dereferenceable(24) %20)
          to label %140 unwind label %155

140:                                              ; preds = %134
  %141 = load ptr, ptr %26, align 8, !tbaa !5
  %142 = load i32, ptr %25, align 4, !tbaa !11
  %143 = sext i32 %142 to i64
  %144 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %24, i64 noundef %143) #4
  %145 = load double, ptr %144, align 8, !tbaa !9
  %146 = load i32, ptr %25, align 4, !tbaa !11
  %147 = sext i32 %146 to i64
  %148 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %13, i64 noundef %147) #4
  %149 = load double, ptr %148, align 8, !tbaa !9
  %150 = load double, ptr %8, align 8, !tbaa !9
  invoke void @_Z19updateNeuronWeightsRN13NeuralNetwork6NeuronERKSt6vectorIdSaIdEEddd(ptr noundef nonnull align 8 dereferenceable(40) %141, ptr noundef nonnull align 8 dereferenceable(24) %23, double noundef %145, double noundef %149, double noundef %150)
          to label %151 unwind label %155

151:                                              ; preds = %140
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #4
  br label %152

152:                                              ; preds = %151
  %153 = load i32, ptr %25, align 4, !tbaa !11
  %154 = add nsw i32 %153, 1
  store i32 %154, ptr %25, align 4, !tbaa !11
  br label %103, !llvm.loop !15

155:                                              ; preds = %140, %134, %130
  %156 = landingpad { ptr, i32 }
          cleanup
  %157 = extractvalue { ptr, i32 } %156, 0
  store ptr %157, ptr %11, align 8
  %158 = extractvalue { ptr, i32 } %156, 1
  store i32 %158, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #4
  br label %159

159:                                              ; preds = %155, %126
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #4
  br label %170

160:                                              ; preds = %109
  %161 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIdSaIdEEaSERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %13, ptr noundef nonnull align 8 dereferenceable(24) %20)
          to label %162 unwind label %166

162:                                              ; preds = %160
  call void @_ZNSt6vectorIdSaIdEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %24) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr %24) #4
  call void @_ZNSt6vectorIdSaIdEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %23) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr %23) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #4
  call void @_ZNSt6vectorIdSaIdEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %20) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr %20) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #4
  br label %163

163:                                              ; preds = %162
  %164 = load i32, ptr %16, align 4, !tbaa !11
  %165 = add nsw i32 %164, -1
  store i32 %165, ptr %16, align 4, !tbaa !11
  br label %66, !llvm.loop !16

166:                                              ; preds = %160
  %167 = landingpad { ptr, i32 }
          cleanup
  %168 = extractvalue { ptr, i32 } %167, 0
  store ptr %168, ptr %11, align 8
  %169 = extractvalue { ptr, i32 } %167, 1
  store i32 %169, ptr %12, align 4
  br label %170

170:                                              ; preds = %166, %159
  call void @_ZNSt6vectorIdSaIdEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %24) #4
  br label %171

171:                                              ; preds = %170, %122
  call void @llvm.lifetime.end.p0(i64 24, ptr %24) #4
  call void @_ZNSt6vectorIdSaIdEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %23) #4
  br label %172

172:                                              ; preds = %171, %118
  call void @llvm.lifetime.end.p0(i64 24, ptr %23) #4
  br label %173

173:                                              ; preds = %172, %114
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #4
  call void @_ZNSt6vectorIdSaIdEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %20) #4
  br label %174

174:                                              ; preds = %173, %110
  call void @llvm.lifetime.end.p0(i64 24, ptr %20) #4
  br label %175

175:                                              ; preds = %174, %85
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #4
  call void @_ZNSt6vectorIdSaIdEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %13) #4
  br label %177

176:                                              ; preds = %69
  call void @_ZNSt6vectorIdSaIdEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %13) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr %13) #4
  call void @_ZNSt6vectorIdSaIdEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %9) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr %9) #4
  ret void

177:                                              ; preds = %175, %41
  call void @llvm.lifetime.end.p0(i64 24, ptr %13) #4
  call void @_ZNSt6vectorIdSaIdEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %9) #4
  br label %178

178:                                              ; preds = %177, %37
  call void @llvm.lifetime.end.p0(i64 24, ptr %9) #4
  br label %179

179:                                              ; preds = %178
  %180 = load ptr, ptr %11, align 8
  %181 = load i32, ptr %12, align 4
  %182 = insertvalue { ptr, i32 } poison, ptr %180, 0
  %183 = insertvalue { ptr, i32 } %182, i32 %181, 1
  resume { ptr, i32 } %183
}

declare noundef i32 @_ZNK13NeuralNetwork5Layer16getNeuronsLengthEv(ptr noundef nonnull align 8 dereferenceable(32)) #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(32) ptr @_ZNK13NeuralNetwork20MultiLayerPerceptron8getLayerEi(ptr noundef nonnull align 8 dereferenceable(64), i32 noundef) #1 align 2

declare noundef nonnull align 8 dereferenceable(40) ptr @_ZNK13NeuralNetwork5Layer9getNeuronEi(ptr noundef nonnull align 8 dereferenceable(32), i32 noundef) #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt15__new_allocatorIdED2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #1 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 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"double", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}
!16 = distinct !{!16, !14}


; 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.std::vector.10" = type { %"struct.std::_Vector_base.11" }
%"struct.std::_Vector_base.11" = 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 }
%"class.std::allocator.12" = type { i8 }

; 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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN13NeuralNetwork20MultiLayerPerceptron11feedforwardESt6vectorIdSaIdEE(ptr dead_on_unwind noalias writable sret(%"class.std::vector.10") align 8, ptr noundef nonnull align 8 dereferenceable(64), ptr noundef) local_unnamed_addr #2 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt6vectorISt10unique_ptrIN13NeuralNetwork5LayerESt14default_deleteIS2_EESaIS5_EE4sizeEv(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 @_ZNSt6vectorISt10unique_ptrIN13NeuralNetwork5LayerESt14default_deleteIS2_EESaIS5_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #1 align 2

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

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

declare void @_ZN13NeuralNetwork5Layer11feedforwardERKSt6vectorIdSaIdEE(ptr dead_on_unwind writable sret(%"class.std::vector.10") align 8, ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #3

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

; 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 @_ZNKSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) 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 uwtable
declare dso_local void @_Z19updateNeuronWeightsRN13NeuralNetwork6NeuronERKSt6vectorIdSaIdEEddd(ptr noundef nonnull align 8 dereferenceable(40), ptr noundef nonnull align 8 dereferenceable(24), double noundef, double noundef, double noundef) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN13NeuralNetwork20MultiLayerPerceptron13backpropagateESt6vectorIdSaIdEES3_d(ptr noundef nonnull align 8 dereferenceable(64) %0, ptr noundef nonnull %1, ptr noundef %2, double noundef %3) local_unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %5 = alloca %"class.std::vector.10", align 8
  %6 = alloca %"class.std::vector.10", align 8
  %7 = alloca %"class.std::vector.10", align 8
  %8 = alloca %"class.std::allocator.12", align 1
  %9 = alloca %"class.std::vector.10", align 8
  %10 = alloca %"class.std::allocator.12", align 1
  %11 = alloca %"class.std::vector.10", align 8
  %12 = alloca %"class.std::vector.10", align 8
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %5) #4
  call void @_ZNSt6vectorIdSaIdEEC2ERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %6, ptr noundef nonnull align 8 dereferenceable(24) %1)
  invoke void @_ZN13NeuralNetwork20MultiLayerPerceptron11feedforwardESt6vectorIdSaIdEE(ptr dead_on_unwind nonnull writable sret(%"class.std::vector.10") align 8 %5, ptr noundef nonnull align 8 dereferenceable(64) %0, ptr noundef nonnull %6)
          to label %13 unwind label %24

13:                                               ; preds = %4
  call void @_ZNSt6vectorIdSaIdEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %6) #4
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %7) #4
  %14 = call noundef i64 @_ZNKSt6vectorIdSaIdEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %5) #4
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %8) #4
  call void @_ZNSaIdEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %8) #4
  invoke void @_ZNSt6vectorIdSaIdEEC2EmRKS0_(ptr noundef nonnull align 8 dereferenceable(24) %7, i64 noundef %14, ptr noundef nonnull align 1 dereferenceable(1) %8)
          to label %15 unwind label %26

15:                                               ; preds = %13
  call void @_ZNSt15__new_allocatorIdED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %8) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %8) #4
  %16 = call noundef i64 @_ZNKSt6vectorIdSaIdEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %5) #4
  %.not55 = icmp eq i64 %16, 0
  br i1 %.not55, label %._crit_edge, label %.lr.ph

._crit_edge:                                      ; preds = %.lr.ph, %15
  %17 = getelementptr inbounds i8, ptr %0, i64 8
  %18 = call noundef i64 @_ZNKSt6vectorISt10unique_ptrIN13NeuralNetwork5LayerESt14default_deleteIS2_EESaIS5_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %17) #4
  %19 = trunc i64 %18 to i32
  %.03849 = add i32 %19, -1
  %20 = icmp sgt i32 %.03849, -1
  br i1 %20, label %.lr.ph53, label %._crit_edge54

.lr.ph53:                                         ; preds = %._crit_edge
  %21 = getelementptr inbounds i8, ptr %0, i64 32
  %22 = zext nneg i32 %.03849 to i64
  %23 = and i64 %18, 4294967295
  br label %36

24:                                               ; preds = %4
  %25 = landingpad { ptr, i32 }
          cleanup
  br label %92

26:                                               ; preds = %13
  %27 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt15__new_allocatorIdED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %8) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %8) #4
  br label %91

.lr.ph:                                           ; preds = %15, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %15 ]
  %28 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %indvars.iv) #4
  %29 = load double, ptr %28, align 8, !tbaa !5
  %30 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %indvars.iv) #4
  %31 = load double, ptr %30, align 8, !tbaa !5
  %32 = fsub double %29, %31
  %33 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %7, i64 noundef %indvars.iv) #4
  store double %32, ptr %33, align 8, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %34 = call noundef i64 @_ZNKSt6vectorIdSaIdEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %5) #4
  %35 = icmp ugt i64 %34, %indvars.iv.next
  br i1 %35, label %.lr.ph, label %._crit_edge, !llvm.loop !9

._crit_edge54:                                    ; preds = %82, %._crit_edge
  call void @_ZNSt6vectorIdSaIdEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %7) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %7) #4
  call void @_ZNSt6vectorIdSaIdEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #4
  ret void

36:                                               ; preds = %.lr.ph53, %82
  %indvars.iv62 = phi i64 [ %23, %.lr.ph53 ], [ %indvars.iv.next63, %82 ]
  %indvars.iv60 = phi i64 [ %22, %.lr.ph53 ], [ %indvars.iv.next61, %82 ]
  %37 = call noundef i64 @_ZNKSt6vectorIdSaIdEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %1) #4
  %38 = trunc i64 %37 to i32
  %.not = icmp eq i64 %indvars.iv60, 0
  br i1 %.not, label %47, label %39

39:                                               ; preds = %36
  %40 = add i64 %indvars.iv62, 4294967294
  %41 = and i64 %40, 4294967295
  %42 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorISt10unique_ptrIN13NeuralNetwork5LayerESt14default_deleteIS2_EESaIS5_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %17, i64 noundef %41) #4
  %43 = call noundef ptr @_ZNKSt10unique_ptrIN13NeuralNetwork5LayerESt14default_deleteIS1_EEptEv(ptr noundef nonnull align 8 dereferenceable(8) %42) #4
  %44 = invoke noundef i32 @_ZNK13NeuralNetwork5Layer16getNeuronsLengthEv(ptr noundef nonnull align 8 dereferenceable(32) %43)
          to label %47 unwind label %45

45:                                               ; preds = %39
  %46 = landingpad { ptr, i32 }
          cleanup
  br label %90

47:                                               ; preds = %39, %36
  %.037 = phi i32 [ %38, %36 ], [ %44, %39 ]
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %9) #4
  %48 = sext i32 %.037 to i64
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %10) #4
  call void @_ZNSaIdEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %10) #4
  invoke void @_ZNSt6vectorIdSaIdEEC2EmRKS0_(ptr noundef nonnull align 8 dereferenceable(24) %9, i64 noundef %48, ptr noundef nonnull align 1 dereferenceable(1) %10)
          to label %49 unwind label %60

49:                                               ; preds = %47
  call void @_ZNSt15__new_allocatorIdED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %10) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %10) #4
  %50 = trunc nuw nsw i64 %indvars.iv60 to i32
  %51 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNK13NeuralNetwork20MultiLayerPerceptron8getLayerEi(ptr noundef nonnull align 8 dereferenceable(64) %0, i32 noundef %50)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %11) #4
  %52 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIS_IdSaIdEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %21, i64 noundef %indvars.iv60) #4
  invoke void @_ZNSt6vectorIdSaIdEEC2ERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %11, ptr noundef nonnull align 8 dereferenceable(24) %52)
          to label %53 unwind label %62

53:                                               ; preds = %49
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %12) #4
  invoke void @_ZN13NeuralNetwork5Layer11feedforwardERKSt6vectorIdSaIdEE(ptr dead_on_unwind nonnull writable sret(%"class.std::vector.10") align 8 %12, ptr noundef nonnull align 8 dereferenceable(32) %51, ptr noundef nonnull align 8 dereferenceable(24) %11)
          to label %.preheader unwind label %64

.preheader:                                       ; preds = %53, %79
  %indvars.iv57 = phi i64 [ %indvars.iv.next58, %79 ], [ 0, %53 ]
  %54 = invoke noundef i32 @_ZNK13NeuralNetwork5Layer16getNeuronsLengthEv(ptr noundef nonnull align 8 dereferenceable(32) %51)
          to label %55 unwind label %66

55:                                               ; preds = %.preheader
  %56 = sext i32 %54 to i64
  %57 = icmp slt i64 %indvars.iv57, %56
  br i1 %57, label %68, label %58

58:                                               ; preds = %55
  %59 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIdSaIdEEaSERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %7, ptr noundef nonnull align 8 dereferenceable(24) %9)
          to label %82 unwind label %84

60:                                               ; preds = %47
  %61 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt15__new_allocatorIdED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %10) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %10) #4
  br label %89

62:                                               ; preds = %49
  %63 = landingpad { ptr, i32 }
          cleanup
  br label %88

64:                                               ; preds = %53
  %65 = landingpad { ptr, i32 }
          cleanup
  br label %87

66:                                               ; preds = %.preheader
  %67 = landingpad { ptr, i32 }
          cleanup
  br label %86

68:                                               ; preds = %55
  %69 = trunc nuw nsw i64 %indvars.iv57 to i32
  %70 = invoke noundef nonnull align 8 dereferenceable(40) ptr @_ZNK13NeuralNetwork5Layer9getNeuronEi(ptr noundef nonnull align 8 dereferenceable(32) %51, i32 noundef %69)
          to label %71 unwind label %80

71:                                               ; preds = %68
  %72 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %7, i64 noundef %indvars.iv57) #4
  %73 = load double, ptr %72, align 8, !tbaa !5
  invoke void @_Z22getPreviousLayerErrorsRKN13NeuralNetwork6NeuronEdRSt6vectorIdSaIdEE(ptr noundef nonnull align 8 dereferenceable(40) %70, double noundef %73, ptr noundef nonnull align 8 dereferenceable(24) %9)
          to label %74 unwind label %80

74:                                               ; preds = %71
  %75 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %12, i64 noundef %indvars.iv57) #4
  %76 = load double, ptr %75, align 8, !tbaa !5
  %77 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %7, i64 noundef %indvars.iv57) #4
  %78 = load double, ptr %77, align 8, !tbaa !5
  invoke void @_Z19updateNeuronWeightsRN13NeuralNetwork6NeuronERKSt6vectorIdSaIdEEddd(ptr noundef nonnull align 8 dereferenceable(40) %70, ptr noundef nonnull align 8 dereferenceable(24) %11, double noundef %76, double noundef %78, double noundef %3)
          to label %79 unwind label %80

79:                                               ; preds = %74
  %indvars.iv.next58 = add nuw nsw i64 %indvars.iv57, 1
  br label %.preheader, !llvm.loop !11

80:                                               ; preds = %74, %71, %68
  %81 = landingpad { ptr, i32 }
          cleanup
  br label %86

82:                                               ; preds = %58
  call void @_ZNSt6vectorIdSaIdEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %12) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %12) #4
  call void @_ZNSt6vectorIdSaIdEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %11) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %11) #4
  call void @_ZNSt6vectorIdSaIdEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %9) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %9) #4
  %indvars.iv.next61 = add nsw i64 %indvars.iv60, -1
  %83 = icmp sgt i64 %indvars.iv60, 0
  %indvars.iv.next63 = add nsw i64 %indvars.iv62, -1
  br i1 %83, label %36, label %._crit_edge54, !llvm.loop !12

84:                                               ; preds = %58
  %85 = landingpad { ptr, i32 }
          cleanup
  br label %86

86:                                               ; preds = %66, %80, %84
  %.pn.pn = phi { ptr, i32 } [ %85, %84 ], [ %81, %80 ], [ %67, %66 ]
  call void @_ZNSt6vectorIdSaIdEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %12) #4
  br label %87

87:                                               ; preds = %86, %64
  %.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn, %86 ], [ %65, %64 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %12) #4
  call void @_ZNSt6vectorIdSaIdEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %11) #4
  br label %88

88:                                               ; preds = %87, %62
  %.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn.pn, %87 ], [ %63, %62 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %11) #4
  call void @_ZNSt6vectorIdSaIdEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %9) #4
  br label %89

89:                                               ; preds = %88, %60
  %.pn.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn.pn.pn, %88 ], [ %61, %60 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %9) #4
  br label %90

90:                                               ; preds = %89, %45
  %.pn.pn.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn.pn.pn.pn, %89 ], [ %46, %45 ]
  call void @_ZNSt6vectorIdSaIdEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %7) #4
  br label %91

91:                                               ; preds = %90, %26
  %.pn.pn.pn.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn.pn.pn.pn.pn, %90 ], [ %27, %26 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %7) #4
  br label %92

92:                                               ; preds = %91, %24
  %.sink = phi ptr [ %5, %91 ], [ %6, %24 ]
  %.pn.pn.pn.pn.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn.pn.pn.pn.pn.pn, %91 ], [ %25, %24 ]
  call void @_ZNSt6vectorIdSaIdEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %.sink) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #4
  resume { ptr, i32 } %.pn.pn.pn.pn.pn.pn.pn.pn
}

declare noundef i32 @_ZNK13NeuralNetwork5Layer16getNeuronsLengthEv(ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(32) ptr @_ZNK13NeuralNetwork20MultiLayerPerceptron8getLayerEi(ptr noundef nonnull align 8 dereferenceable(64), i32 noundef) local_unnamed_addr #1 align 2

declare noundef nonnull align 8 dereferenceable(40) ptr @_ZNK13NeuralNetwork5Layer9getNeuronEi(ptr noundef nonnull align 8 dereferenceable(32), i32 noundef) local_unnamed_addr #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt15__new_allocatorIdED2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #1 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 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"double", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass