; LLVM IR from hoodoer/ENNEoS :: enneosEncoder/genotype.ll (ZN7CGenome7AddLinkEddR11CInnovationii)

; 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.SLinkGene = type <{ i8, [3 x i8], i32, i32, i32, double, i8, [7 x i8] }>
%class.CGenome = type <{ i32, [4 x i8], %"class.std::vector", %"class.std::vector.0", ptr, i32, [4 x i8], double, double, double, i32, i32, i32, [4 x i8] }>
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<SNeuronGene, std::allocator<SNeuronGene>>::_Vector_impl" }
%"struct.std::_Vector_base<SNeuronGene, std::allocator<SNeuronGene>>::_Vector_impl" = type { %"struct.std::_Vector_base<SNeuronGene, std::allocator<SNeuronGene>>::_Vector_impl_data" }
%"struct.std::_Vector_base<SNeuronGene, std::allocator<SNeuronGene>>::_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<SLinkGene, std::allocator<SLinkGene>>::_Vector_impl" }
%"struct.std::_Vector_base<SLinkGene, std::allocator<SLinkGene>>::_Vector_impl" = type { %"struct.std::_Vector_base<SLinkGene, std::allocator<SLinkGene>>::_Vector_impl_data" }
%"struct.std::_Vector_base<SLinkGene, std::allocator<SLinkGene>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%struct.SNeuronGene = type { i32, i32, i8, double, double, double }

; 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 nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(40) ptr @_ZNSt6vectorI11SNeuronGeneSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #1 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef double @_Z13RandomClampedv() #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN9SLinkGeneC2Eiibidb(ptr noundef nonnull align 8 dereferenceable(25), i32 noundef, i32 noundef, i1 noundef zeroext, i32 noundef, double noundef, i1 noundef zeroext) unnamed_addr #1 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN7CGenome13GetElementPosEi(ptr noundef nonnull align 8 dereferenceable(108), i32 noundef) #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN7CGenome13DuplicateLinkEii(ptr noundef nonnull align 8 dereferenceable(108), i32 noundef, i32 noundef) #1 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN7CGenome7AddLinkEddR11CInnovationii(ptr noundef nonnull align 8 dereferenceable(108) %0, double noundef %1, double noundef %2, ptr noundef nonnull align 8 dereferenceable(32) %3, i32 noundef %4, i32 noundef %5) #3 align 2 {
  %7 = alloca ptr, align 8
  %8 = alloca double, align 8
  %9 = alloca double, align 8
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i8, align 1
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca %struct.SLinkGene, align 8
  %21 = alloca %struct.SLinkGene, align 8
  store ptr %0, ptr %7, align 8, !tbaa !5
  store double %1, ptr %8, align 8, !tbaa !9
  store double %2, ptr %9, align 8, !tbaa !9
  store ptr %3, ptr %10, align 8, !tbaa !5
  store i32 %4, ptr %11, align 4, !tbaa !11
  store i32 %5, ptr %12, align 4, !tbaa !11
  %22 = load ptr, ptr %7, align 8
  %23 = call noundef double @_Z10RandDoublev()
  %24 = load double, ptr %8, align 8, !tbaa !9
  %25 = fcmp ogt double %23, %24
  br i1 %25, label %26, label %27

26:                                               ; preds = %6
  br label %182

27:                                               ; preds = %6
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  store i32 -1, ptr %13, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #6
  store i32 -1, ptr %14, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 1, ptr %15) #6
  store i8 0, ptr %15, align 1, !tbaa !13
  %28 = call noundef double @_Z10RandDoublev()
  %29 = load double, ptr %9, align 8, !tbaa !9
  %30 = fcmp olt double %28, %29
  br i1 %30, label %31, label %82

31:                                               ; preds = %27
  br label %32

32:                                               ; preds = %80, %31
  %33 = load i32, ptr %11, align 4, !tbaa !11
  %34 = add nsw i32 %33, -1
  store i32 %34, ptr %11, align 4, !tbaa !11
  %35 = icmp ne i32 %33, 0
  br i1 %35, label %36, label %81

36:                                               ; preds = %32
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #6
  %37 = getelementptr inbounds %class.CGenome, ptr %22, i32 0, i32 10
  %38 = load i32, ptr %37, align 8, !tbaa !15
  %39 = add nsw i32 %38, 1
  %40 = getelementptr inbounds %class.CGenome, ptr %22, i32 0, i32 2
  %41 = call noundef i64 @_ZNKSt6vectorI11SNeuronGeneSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %40) #6
  %42 = sub i64 %41, 1
  %43 = trunc i64 %42 to i32
  %44 = call noundef i32 @_Z7RandIntii(i32 noundef %39, i32 noundef %43)
  store i32 %44, ptr %16, align 4, !tbaa !11
  %45 = getelementptr inbounds %class.CGenome, ptr %22, i32 0, i32 2
  %46 = load i32, ptr %16, align 4, !tbaa !11
  %47 = sext i32 %46 to i64
  %48 = call noundef nonnull align 8 dereferenceable(40) ptr @_ZNSt6vectorI11SNeuronGeneSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %45, i64 noundef %47) #6
  %49 = getelementptr inbounds %struct.SNeuronGene, ptr %48, i32 0, i32 2
  %50 = load i8, ptr %49, align 8, !tbaa !25, !range !28, !noundef !29
  %51 = trunc i8 %50 to i1
  br i1 %51, label %80, label %52

52:                                               ; preds = %36
  %53 = getelementptr inbounds %class.CGenome, ptr %22, i32 0, i32 2
  %54 = load i32, ptr %16, align 4, !tbaa !11
  %55 = sext i32 %54 to i64
  %56 = call noundef nonnull align 8 dereferenceable(40) ptr @_ZNSt6vectorI11SNeuronGeneSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %53, i64 noundef %55) #6
  %57 = getelementptr inbounds %struct.SNeuronGene, ptr %56, i32 0, i32 1
  %58 = load i32, ptr %57, align 4, !tbaa !30
  %59 = icmp ne i32 %58, 3
  br i1 %59, label %60, label %80

60:                                               ; preds = %52
  %61 = getelementptr inbounds %class.CGenome, ptr %22, i32 0, i32 2
  %62 = load i32, ptr %16, align 4, !tbaa !11
  %63 = sext i32 %62 to i64
  %64 = call noundef nonnull align 8 dereferenceable(40) ptr @_ZNSt6vectorI11SNeuronGeneSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %61, i64 noundef %63) #6
  %65 = getelementptr inbounds %struct.SNeuronGene, ptr %64, i32 0, i32 1
  %66 = load i32, ptr %65, align 4, !tbaa !30
  %67 = icmp ne i32 %66, 0
  br i1 %67, label %68, label %80

68:                                               ; preds = %60
  %69 = getelementptr inbounds %class.CGenome, ptr %22, i32 0, i32 2
  %70 = load i32, ptr %16, align 4, !tbaa !11
  %71 = sext i32 %70 to i64
  %72 = call noundef nonnull align 8 dereferenceable(40) ptr @_ZNSt6vectorI11SNeuronGeneSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %69, i64 noundef %71) #6
  %73 = getelementptr inbounds %struct.SNeuronGene, ptr %72, i32 0, i32 0
  %74 = load i32, ptr %73, align 8, !tbaa !31
  store i32 %74, ptr %14, align 4, !tbaa !11
  store i32 %74, ptr %13, align 4, !tbaa !11
  %75 = getelementptr inbounds %class.CGenome, ptr %22, i32 0, i32 2
  %76 = load i32, ptr %16, align 4, !tbaa !11
  %77 = sext i32 %76 to i64
  %78 = call noundef nonnull align 8 dereferenceable(40) ptr @_ZNSt6vectorI11SNeuronGeneSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %75, i64 noundef %77) #6
  %79 = getelementptr inbounds %struct.SNeuronGene, ptr %78, i32 0, i32 2
  store i8 1, ptr %79, align 8, !tbaa !25
  store i8 1, ptr %15, align 1, !tbaa !13
  store i32 0, ptr %11, align 4, !tbaa !11
  br label %80

80:                                               ; preds = %68, %60, %52, %36
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #6
  br label %32, !llvm.loop !32

81:                                               ; preds = %32
  br label %122

82:                                               ; preds = %27
  br label %83

83:                                               ; preds = %120, %82
  %84 = load i32, ptr %12, align 4, !tbaa !11
  %85 = add nsw i32 %84, -1
  store i32 %85, ptr %12, align 4, !tbaa !11
  %86 = icmp ne i32 %84, 0
  br i1 %86, label %87, label %121

87:                                               ; preds = %83
  %88 = getelementptr inbounds %class.CGenome, ptr %22, i32 0, i32 2
  %89 = getelementptr inbounds %class.CGenome, ptr %22, i32 0, i32 2
  %90 = call noundef i64 @_ZNKSt6vectorI11SNeuronGeneSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %89) #6
  %91 = sub i64 %90, 1
  %92 = trunc i64 %91 to i32
  %93 = call noundef i32 @_Z7RandIntii(i32 noundef 0, i32 noundef %92)
  %94 = sext i32 %93 to i64
  %95 = call noundef nonnull align 8 dereferenceable(40) ptr @_ZNSt6vectorI11SNeuronGeneSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %88, i64 noundef %94) #6
  %96 = getelementptr inbounds %struct.SNeuronGene, ptr %95, i32 0, i32 0
  %97 = load i32, ptr %96, align 8, !tbaa !31
  store i32 %97, ptr %13, align 4, !tbaa !11
  %98 = getelementptr inbounds %class.CGenome, ptr %22, i32 0, i32 2
  %99 = getelementptr inbounds %class.CGenome, ptr %22, i32 0, i32 10
  %100 = load i32, ptr %99, align 8, !tbaa !15
  %101 = add nsw i32 %100, 1
  %102 = getelementptr inbounds %class.CGenome, ptr %22, i32 0, i32 2
  %103 = call noundef i64 @_ZNKSt6vectorI11SNeuronGeneSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %102) #6
  %104 = sub i64 %103, 1
  %105 = trunc i64 %104 to i32
  %106 = call noundef i32 @_Z7RandIntii(i32 noundef %101, i32 noundef %105)
  %107 = sext i32 %106 to i64
  %108 = call noundef nonnull align 8 dereferenceable(40) ptr @_ZNSt6vectorI11SNeuronGeneSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %98, i64 noundef %107) #6
  %109 = getelementptr inbounds %struct.SNeuronGene, ptr %108, i32 0, i32 0
  %110 = load i32, ptr %109, align 8, !tbaa !31
  store i32 %110, ptr %14, align 4, !tbaa !11
  %111 = load i32, ptr %13, align 4, !tbaa !11
  %112 = load i32, ptr %14, align 4, !tbaa !11
  %113 = call noundef zeroext i1 @_ZN7CGenome13DuplicateLinkEii(ptr noundef nonnull align 8 dereferenceable(108) %22, i32 noundef %111, i32 noundef %112)
  br i1 %113, label %118, label %114

114:                                              ; preds = %87
  %115 = load i32, ptr %13, align 4, !tbaa !11
  %116 = load i32, ptr %14, align 4, !tbaa !11
  %117 = icmp eq i32 %115, %116
  br i1 %117, label %118, label %119

118:                                              ; preds = %114, %87
  store i32 -1, ptr %13, align 4, !tbaa !11
  store i32 -1, ptr %14, align 4, !tbaa !11
  br label %120

119:                                              ; preds = %114
  store i32 0, ptr %12, align 4, !tbaa !11
  br label %120

120:                                              ; preds = %119, %118
  br label %83, !llvm.loop !34

121:                                              ; preds = %83
  br label %122

122:                                              ; preds = %121, %81
  %123 = load i32, ptr %13, align 4, !tbaa !11
  %124 = icmp slt i32 %123, 0
  br i1 %124, label %128, label %125

125:                                              ; preds = %122
  %126 = load i32, ptr %14, align 4, !tbaa !11
  %127 = icmp slt i32 %126, 0
  br i1 %127, label %128, label %129

128:                                              ; preds = %125, %122
  store i32 1, ptr %17, align 4
  br label %181

129:                                              ; preds = %125
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #6
  %130 = load ptr, ptr %10, align 8, !tbaa !5
  %131 = load i32, ptr %13, align 4, !tbaa !11
  %132 = load i32, ptr %14, align 4, !tbaa !11
  %133 = call noundef i32 @_ZN11CInnovation15CheckInnovationEii10innov_type(ptr noundef nonnull align 8 dereferenceable(32) %130, i32 noundef %131, i32 noundef %132, i32 noundef 1)
  store i32 %133, ptr %18, align 4, !tbaa !11
  %134 = getelementptr inbounds %class.CGenome, ptr %22, i32 0, i32 2
  %135 = load i32, ptr %13, align 4, !tbaa !11
  %136 = call noundef i32 @_ZN7CGenome13GetElementPosEi(ptr noundef nonnull align 8 dereferenceable(108) %22, i32 noundef %135)
  %137 = sext i32 %136 to i64
  %138 = call noundef nonnull align 8 dereferenceable(40) ptr @_ZNSt6vectorI11SNeuronGeneSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %134, i64 noundef %137) #6
  %139 = getelementptr inbounds %struct.SNeuronGene, ptr %138, i32 0, i32 3
  %140 = load double, ptr %139, align 8, !tbaa !35
  %141 = getelementptr inbounds %class.CGenome, ptr %22, i32 0, i32 2
  %142 = load i32, ptr %14, align 4, !tbaa !11
  %143 = call noundef i32 @_ZN7CGenome13GetElementPosEi(ptr noundef nonnull align 8 dereferenceable(108) %22, i32 noundef %142)
  %144 = sext i32 %143 to i64
  %145 = call noundef nonnull align 8 dereferenceable(40) ptr @_ZNSt6vectorI11SNeuronGeneSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %141, i64 noundef %144) #6
  %146 = getelementptr inbounds %struct.SNeuronGene, ptr %145, i32 0, i32 3
  %147 = load double, ptr %146, align 8, !tbaa !35
  %148 = fcmp ogt double %140, %147
  br i1 %148, label %149, label %154

149:                                              ; preds = %129
  %150 = load double, ptr %9, align 8, !tbaa !9
  %151 = fcmp ogt double %150, 0.000000e+00
  br i1 %151, label %152, label %153

152:                                              ; preds = %149
  store i8 1, ptr %15, align 1, !tbaa !13
  br label %153

153:                                              ; preds = %152, %149
  br label %154

154:                                              ; preds = %153, %129
  %155 = load i32, ptr %18, align 4, !tbaa !11
  %156 = icmp slt i32 %155, 0
  br i1 %156, label %157, label %172

157:                                              ; preds = %154
  %158 = load ptr, ptr %10, align 8, !tbaa !5
  %159 = load i32, ptr %13, align 4, !tbaa !11
  %160 = load i32, ptr %14, align 4, !tbaa !11
  %161 = call noundef i32 @_ZN11CInnovation19CreateNewInnovationEii10innov_type(ptr noundef nonnull align 8 dereferenceable(32) %158, i32 noundef %159, i32 noundef %160, i32 noundef 1)
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #6
  %162 = load ptr, ptr %10, align 8, !tbaa !5
  %163 = call noundef i32 @_ZN11CInnovation10NextNumberEi(ptr noundef nonnull align 8 dereferenceable(32) %162, i32 noundef 0)
  %164 = sub nsw i32 %163, 1
  store i32 %164, ptr %19, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 32, ptr %20) #6
  %165 = load i32, ptr %13, align 4, !tbaa !11
  %166 = load i32, ptr %14, align 4, !tbaa !11
  %167 = load i32, ptr %19, align 4, !tbaa !11
  %168 = call noundef double @_Z13RandomClampedv()
  %169 = load i8, ptr %15, align 1, !tbaa !13, !range !28, !noundef !29
  %170 = trunc i8 %169 to i1
  call void @_ZN9SLinkGeneC2Eiibidb(ptr noundef nonnull align 8 dereferenceable(25) %20, i32 noundef %165, i32 noundef %166, i1 noundef zeroext true, i32 noundef %167, double noundef %168, i1 noundef zeroext %170)
  %171 = getelementptr inbounds %class.CGenome, ptr %22, i32 0, i32 3
  call void @_ZNSt6vectorI9SLinkGeneSaIS0_EE9push_backERKS0_(ptr noundef nonnull align 8 dereferenceable(24) %171, ptr noundef nonnull align 8 dereferenceable(25) %20)
  call void @llvm.lifetime.end.p0(i64 32, ptr %20) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #6
  br label %180

172:                                              ; preds = %154
  call void @llvm.lifetime.start.p0(i64 32, ptr %21) #6
  %173 = load i32, ptr %13, align 4, !tbaa !11
  %174 = load i32, ptr %14, align 4, !tbaa !11
  %175 = load i32, ptr %18, align 4, !tbaa !11
  %176 = call noundef double @_Z13RandomClampedv()
  %177 = load i8, ptr %15, align 1, !tbaa !13, !range !28, !noundef !29
  %178 = trunc i8 %177 to i1
  call void @_ZN9SLinkGeneC2Eiibidb(ptr noundef nonnull align 8 dereferenceable(25) %21, i32 noundef %173, i32 noundef %174, i1 noundef zeroext true, i32 noundef %175, double noundef %176, i1 noundef zeroext %178)
  %179 = getelementptr inbounds %class.CGenome, ptr %22, i32 0, i32 3
  call void @_ZNSt6vectorI9SLinkGeneSaIS0_EE9push_backERKS0_(ptr noundef nonnull align 8 dereferenceable(24) %179, ptr noundef nonnull align 8 dereferenceable(25) %21)
  call void @llvm.lifetime.end.p0(i64 32, ptr %21) #6
  br label %180

180:                                              ; preds = %172, %157
  store i32 1, ptr %17, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #6
  br label %181

181:                                              ; preds = %180, %128
  call void @llvm.lifetime.end.p0(i64 1, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  br label %182

182:                                              ; preds = %181, %26
  ret void
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_Z10RandDoublev() #4

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z7RandIntii(i32 noundef, i32 noundef) #4

declare noundef i32 @_ZN11CInnovation15CheckInnovationEii10innov_type(ptr noundef nonnull align 8 dereferenceable(32), i32 noundef, i32 noundef, i32 noundef) #5

declare noundef i32 @_ZN11CInnovation19CreateNewInnovationEii10innov_type(ptr noundef nonnull align 8 dereferenceable(32), i32 noundef, i32 noundef, i32 noundef) #5

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorI9SLinkGeneSaIS0_EE9push_backERKS0_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(25)) #3 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 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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 #5 = { "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 #6 = { 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 = !{!14, !14, i64 0}
!14 = !{!"bool", !7, i64 0}
!15 = !{!16, !12, i64 96}
!16 = !{!"_ZTS7CGenome", !12, i64 0, !17, i64 8, !21, i64 32, !6, i64 56, !12, i64 64, !10, i64 72, !10, i64 80, !10, i64 88, !12, i64 96, !12, i64 100, !12, i64 104}
!17 = !{!"_ZTSSt6vectorI11SNeuronGeneSaIS0_EE", !18, i64 0}
!18 = !{!"_ZTSSt12_Vector_baseI11SNeuronGeneSaIS0_EE", !19, i64 0}
!19 = !{!"_ZTSNSt12_Vector_baseI11SNeuronGeneSaIS0_EE12_Vector_implE", !20, i64 0}
!20 = !{!"_ZTSNSt12_Vector_baseI11SNeuronGeneSaIS0_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!21 = !{!"_ZTSSt6vectorI9SLinkGeneSaIS0_EE", !22, i64 0}
!22 = !{!"_ZTSSt12_Vector_baseI9SLinkGeneSaIS0_EE", !23, i64 0}
!23 = !{!"_ZTSNSt12_Vector_baseI9SLinkGeneSaIS0_EE12_Vector_implE", !24, i64 0}
!24 = !{!"_ZTSNSt12_Vector_baseI9SLinkGeneSaIS0_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!25 = !{!26, !14, i64 8}
!26 = !{!"_ZTS11SNeuronGene", !12, i64 0, !27, i64 4, !14, i64 8, !10, i64 16, !10, i64 24, !10, i64 32}
!27 = !{!"_ZTS11neuron_type", !7, i64 0}
!28 = !{i8 0, i8 2}
!29 = !{}
!30 = !{!26, !27, i64 4}
!31 = !{!26, !12, i64 0}
!32 = distinct !{!32, !33}
!33 = !{!"llvm.loop.mustprogress"}
!34 = distinct !{!34, !33}
!35 = !{!26, !10, i64 16}


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

%struct.SLinkGene = type <{ i8, [3 x i8], i32, i32, i32, double, i8, [7 x i8] }>

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

; Function Attrs: mustprogress nocallback nofree 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 noundef nonnull align 8 dereferenceable(40) ptr @_ZNSt6vectorI11SNeuronGeneSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef double @_Z13RandomClampedv() local_unnamed_addr #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN9SLinkGeneC2Eiibidb(ptr noundef nonnull align 8 dereferenceable(25), i32 noundef, i32 noundef, i1 noundef zeroext, i32 noundef, double noundef, i1 noundef zeroext) unnamed_addr #1 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN7CGenome13GetElementPosEi(ptr noundef nonnull align 8 dereferenceable(108), i32 noundef) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN7CGenome13DuplicateLinkEii(ptr noundef nonnull align 8 dereferenceable(108), i32 noundef, i32 noundef) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN7CGenome7AddLinkEddR11CInnovationii(ptr noundef nonnull align 8 dereferenceable(108) %0, double noundef %1, double noundef %2, ptr noundef nonnull align 8 dereferenceable(32) %3, i32 noundef %4, i32 noundef %5) local_unnamed_addr #3 align 2 {
  %7 = alloca %struct.SLinkGene, align 8
  %8 = alloca %struct.SLinkGene, align 8
  %9 = tail call noundef double @_Z10RandDoublev()
  %10 = fcmp ogt double %9, %1
  br i1 %10, label %.loopexit.thread, label %11

11:                                               ; preds = %6
  %12 = tail call noundef double @_Z10RandDoublev()
  %13 = fcmp olt double %12, %2
  br i1 %13, label %.preheader, label %.preheader57

.preheader57:                                     ; preds = %11
  %.not59 = icmp eq i32 %5, 0
  br i1 %.not59, label %.loopexit.thread, label %.lr.ph

.lr.ph:                                           ; preds = %.preheader57
  %14 = getelementptr inbounds i8, ptr %0, i64 8
  %15 = getelementptr inbounds i8, ptr %0, i64 96
  br label %.backedge

.preheader:                                       ; preds = %11
  %.not5361 = icmp eq i32 %4, 0
  br i1 %.not5361, label %.loopexit.thread, label %.lr.ph65

.lr.ph65:                                         ; preds = %.preheader
  %16 = getelementptr inbounds i8, ptr %0, i64 96
  %17 = getelementptr inbounds i8, ptr %0, i64 8
  br label %18

18:                                               ; preds = %.lr.ph65, %43
  %.in69 = phi i32 [ %4, %.lr.ph65 ], [ %19, %43 ]
  %19 = add nsw i32 %.in69, -1
  %20 = load i32, ptr %16, align 8, !tbaa !5
  %21 = add nsw i32 %20, 1
  %22 = tail call noundef i64 @_ZNKSt6vectorI11SNeuronGeneSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %17) #6
  %23 = trunc i64 %22 to i32
  %24 = add i32 %23, -1
  %25 = tail call noundef i32 @_Z7RandIntii(i32 noundef %21, i32 noundef %24)
  %26 = sext i32 %25 to i64
  %27 = tail call noundef nonnull align 8 dereferenceable(40) ptr @_ZNSt6vectorI11SNeuronGeneSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %17, i64 noundef %26) #6
  %28 = getelementptr inbounds i8, ptr %27, i64 8
  %29 = load i8, ptr %28, align 8, !tbaa !20, !range !24, !noundef !25
  %30 = trunc nuw i8 %29 to i1
  br i1 %30, label %43, label %31

31:                                               ; preds = %18
  %32 = tail call noundef nonnull align 8 dereferenceable(40) ptr @_ZNSt6vectorI11SNeuronGeneSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %17, i64 noundef %26) #6
  %33 = getelementptr inbounds i8, ptr %32, i64 4
  %34 = load i32, ptr %33, align 4, !tbaa !26
  %.not54 = icmp eq i32 %34, 3
  br i1 %.not54, label %43, label %35

35:                                               ; preds = %31
  %36 = tail call noundef nonnull align 8 dereferenceable(40) ptr @_ZNSt6vectorI11SNeuronGeneSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %17, i64 noundef %26) #6
  %37 = getelementptr inbounds i8, ptr %36, i64 4
  %38 = load i32, ptr %37, align 4, !tbaa !26
  %.not55 = icmp eq i32 %38, 0
  br i1 %.not55, label %43, label %.thread

.thread:                                          ; preds = %35
  %39 = tail call noundef nonnull align 8 dereferenceable(40) ptr @_ZNSt6vectorI11SNeuronGeneSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %17, i64 noundef %26) #6
  %40 = load i32, ptr %39, align 8, !tbaa !27
  %41 = tail call noundef nonnull align 8 dereferenceable(40) ptr @_ZNSt6vectorI11SNeuronGeneSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %17, i64 noundef %26) #6
  %42 = getelementptr inbounds i8, ptr %41, i64 8
  store i8 1, ptr %42, align 8, !tbaa !20
  br label %.loopexit

43:                                               ; preds = %35, %31, %18
  %.not53 = icmp eq i32 %19, 0
  br i1 %.not53, label %.loopexit, label %18, !llvm.loop !28

.backedge:                                        ; preds = %.lr.ph, %.backedge
  %.in = phi i32 [ %5, %.lr.ph ], [ %44, %.backedge ]
  %44 = add nsw i32 %.in, -1
  %45 = tail call noundef i64 @_ZNKSt6vectorI11SNeuronGeneSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %14) #6
  %46 = trunc i64 %45 to i32
  %47 = add i32 %46, -1
  %48 = tail call noundef i32 @_Z7RandIntii(i32 noundef 0, i32 noundef %47)
  %49 = sext i32 %48 to i64
  %50 = tail call noundef nonnull align 8 dereferenceable(40) ptr @_ZNSt6vectorI11SNeuronGeneSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %14, i64 noundef %49) #6
  %51 = load i32, ptr %50, align 8, !tbaa !27
  %52 = load i32, ptr %15, align 8, !tbaa !5
  %53 = add nsw i32 %52, 1
  %54 = tail call noundef i64 @_ZNKSt6vectorI11SNeuronGeneSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %14) #6
  %55 = trunc i64 %54 to i32
  %56 = add i32 %55, -1
  %57 = tail call noundef i32 @_Z7RandIntii(i32 noundef %53, i32 noundef %56)
  %58 = sext i32 %57 to i64
  %59 = tail call noundef nonnull align 8 dereferenceable(40) ptr @_ZNSt6vectorI11SNeuronGeneSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %14, i64 noundef %58) #6
  %60 = load i32, ptr %59, align 8, !tbaa !27
  %61 = tail call noundef zeroext i1 @_ZN7CGenome13DuplicateLinkEii(ptr noundef nonnull align 8 dereferenceable(108) %0, i32 noundef %51, i32 noundef %60)
  %62 = icmp eq i32 %51, %60
  %or.cond56 = select i1 %61, i1 true, i1 %62
  %.not86 = icmp ne i32 %44, 0
  %.not.not = select i1 %or.cond56, i1 %.not86, i1 false
  br i1 %.not.not, label %.backedge, label %.loopexit.loopexit70, !llvm.loop !30

.loopexit.loopexit70:                             ; preds = %.backedge
  %.2.be = select i1 %or.cond56, i32 -1, i32 %51
  %.247.be = select i1 %or.cond56, i32 -1, i32 %60
  br label %.loopexit

.loopexit:                                        ; preds = %43, %.thread, %.loopexit.loopexit70
  %.449 = phi i32 [ %.247.be, %.loopexit.loopexit70 ], [ %40, %.thread ], [ -1, %43 ]
  %.243 = phi i8 [ 0, %.loopexit.loopexit70 ], [ 1, %.thread ], [ 0, %43 ]
  %.4 = phi i32 [ %.2.be, %.loopexit.loopexit70 ], [ %40, %.thread ], [ -1, %43 ]
  %63 = icmp slt i32 %.4, 0
  %64 = icmp slt i32 %.449, 0
  %or.cond = select i1 %63, i1 true, i1 %64
  br i1 %or.cond, label %.loopexit.thread, label %65

65:                                               ; preds = %.loopexit
  %66 = tail call noundef i32 @_ZN11CInnovation15CheckInnovationEii10innov_type(ptr noundef nonnull align 8 dereferenceable(32) %3, i32 noundef %.4, i32 noundef %.449, i32 noundef 1)
  %67 = getelementptr inbounds i8, ptr %0, i64 8
  %68 = tail call noundef i32 @_ZN7CGenome13GetElementPosEi(ptr noundef nonnull align 8 dereferenceable(108) %0, i32 noundef %.4)
  %69 = sext i32 %68 to i64
  %70 = tail call noundef nonnull align 8 dereferenceable(40) ptr @_ZNSt6vectorI11SNeuronGeneSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %67, i64 noundef %69) #6
  %71 = getelementptr inbounds i8, ptr %70, i64 16
  %72 = load double, ptr %71, align 8, !tbaa !31
  %73 = tail call noundef i32 @_ZN7CGenome13GetElementPosEi(ptr noundef nonnull align 8 dereferenceable(108) %0, i32 noundef %.449)
  %74 = sext i32 %73 to i64
  %75 = tail call noundef nonnull align 8 dereferenceable(40) ptr @_ZNSt6vectorI11SNeuronGeneSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %67, i64 noundef %74) #6
  %76 = getelementptr inbounds i8, ptr %75, i64 16
  %77 = load double, ptr %76, align 8, !tbaa !31
  %78 = fcmp ogt double %72, %77
  %79 = fcmp ogt double %2, 0.000000e+00
  %or.cond3 = and i1 %79, %78
  %spec.select = select i1 %or.cond3, i8 1, i8 %.243
  %80 = icmp slt i32 %66, 0
  br i1 %80, label %81, label %88

81:                                               ; preds = %65
  %82 = tail call noundef i32 @_ZN11CInnovation19CreateNewInnovationEii10innov_type(ptr noundef nonnull align 8 dereferenceable(32) %3, i32 noundef %.4, i32 noundef %.449, i32 noundef 1)
  %83 = tail call noundef i32 @_ZN11CInnovation10NextNumberEi(ptr noundef nonnull align 8 dereferenceable(32) %3, i32 noundef 0)
  %84 = add nsw i32 %83, -1
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %7) #6
  %85 = tail call noundef double @_Z13RandomClampedv()
  %86 = trunc nuw i8 %spec.select to i1
  call void @_ZN9SLinkGeneC2Eiibidb(ptr noundef nonnull align 8 dereferenceable(25) %7, i32 noundef %.4, i32 noundef %.449, i1 noundef zeroext true, i32 noundef %84, double noundef %85, i1 noundef zeroext %86)
  %87 = getelementptr inbounds i8, ptr %0, i64 32
  call void @_ZNSt6vectorI9SLinkGeneSaIS0_EE9push_backERKS0_(ptr noundef nonnull align 8 dereferenceable(24) %87, ptr noundef nonnull align 8 dereferenceable(25) %7)
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %7) #6
  br label %.loopexit.thread

88:                                               ; preds = %65
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %8) #6
  %89 = tail call noundef double @_Z13RandomClampedv()
  %90 = trunc nuw i8 %spec.select to i1
  call void @_ZN9SLinkGeneC2Eiibidb(ptr noundef nonnull align 8 dereferenceable(25) %8, i32 noundef %.4, i32 noundef %.449, i1 noundef zeroext true, i32 noundef %66, double noundef %89, i1 noundef zeroext %90)
  %91 = getelementptr inbounds i8, ptr %0, i64 32
  call void @_ZNSt6vectorI9SLinkGeneSaIS0_EE9push_backERKS0_(ptr noundef nonnull align 8 dereferenceable(24) %91, ptr noundef nonnull align 8 dereferenceable(25) %8)
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %8) #6
  br label %.loopexit.thread

.loopexit.thread:                                 ; preds = %.preheader57, %.preheader, %.loopexit, %88, %81, %6
  ret void
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_Z10RandDoublev() local_unnamed_addr #4

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z7RandIntii(i32 noundef, i32 noundef) local_unnamed_addr #4

declare noundef i32 @_ZN11CInnovation15CheckInnovationEii10innov_type(ptr noundef nonnull align 8 dereferenceable(32), i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #5

declare noundef i32 @_ZN11CInnovation19CreateNewInnovationEii10innov_type(ptr noundef nonnull align 8 dereferenceable(32), i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #5

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorI9SLinkGeneSaIS0_EE9push_backERKS0_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(25)) local_unnamed_addr #3 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 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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 #5 = { "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 #6 = { 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, !7, i64 96}
!6 = !{!"_ZTS7CGenome", !7, i64 0, !10, i64 8, !15, i64 32, !14, i64 56, !7, i64 64, !19, i64 72, !19, i64 80, !19, i64 88, !7, i64 96, !7, i64 100, !7, i64 104}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"_ZTSSt6vectorI11SNeuronGeneSaIS0_EE", !11, i64 0}
!11 = !{!"_ZTSSt12_Vector_baseI11SNeuronGeneSaIS0_EE", !12, i64 0}
!12 = !{!"_ZTSNSt12_Vector_baseI11SNeuronGeneSaIS0_EE12_Vector_implE", !13, i64 0}
!13 = !{!"_ZTSNSt12_Vector_baseI11SNeuronGeneSaIS0_EE17_Vector_impl_dataE", !14, i64 0, !14, i64 8, !14, i64 16}
!14 = !{!"any pointer", !8, i64 0}
!15 = !{!"_ZTSSt6vectorI9SLinkGeneSaIS0_EE", !16, i64 0}
!16 = !{!"_ZTSSt12_Vector_baseI9SLinkGeneSaIS0_EE", !17, i64 0}
!17 = !{!"_ZTSNSt12_Vector_baseI9SLinkGeneSaIS0_EE12_Vector_implE", !18, i64 0}
!18 = !{!"_ZTSNSt12_Vector_baseI9SLinkGeneSaIS0_EE17_Vector_impl_dataE", !14, i64 0, !14, i64 8, !14, i64 16}
!19 = !{!"double", !8, i64 0}
!20 = !{!21, !23, i64 8}
!21 = !{!"_ZTS11SNeuronGene", !7, i64 0, !22, i64 4, !23, i64 8, !19, i64 16, !19, i64 24, !19, i64 32}
!22 = !{!"_ZTS11neuron_type", !8, i64 0}
!23 = !{!"bool", !8, i64 0}
!24 = !{i8 0, i8 2}
!25 = !{}
!26 = !{!21, !22, i64 4}
!27 = !{!21, !7, i64 0}
!28 = distinct !{!28, !29}
!29 = !{!"llvm.loop.mustprogress"}
!30 = distinct !{!30, !29}
!31 = !{!21, !19, i64 16}


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