; LLVM IR from ABRG-Models/morphologica :: tests (testEvolveFit)

; 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::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"struct.morph::bn::GeneNetDual" = type <{ %"struct.morph::bn::GeneNet", i8, i8, i8, i8, [4 x i8] }>
%"struct.morph::bn::GeneNet" = type { %"class.morph::RandUniform" }
%"class.morph::RandUniform" = type { %"class.std::random_device", %"class.std::mersenne_twister_engine", %"class.std::uniform_int_distribution" }
%"class.std::random_device" = type { %union.anon.7 }
%union.anon.7 = type { %"class.std::mersenne_twister_engine" }
%"class.std::mersenne_twister_engine" = type { [624 x i64], i64 }
%"class.std::uniform_int_distribution" = type { %"struct.std::uniform_int_distribution<unsigned int>::param_type" }
%"struct.std::uniform_int_distribution<unsigned int>::param_type" = type { i32, i32 }
%"struct.morph::bn::Genome" = type { %"struct.std::array" }
%"struct.std::array" = type { [5 x i32] }

@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str.4 = external hidden unnamed_addr constant [17 x i8], align 1

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

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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #2 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca %"struct.morph::bn::GeneNetDual", align 8
  %3 = alloca %"struct.morph::bn::Genome", align 4
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 10016, ptr %2) #6
  call void @_ZN5morph2bn11GeneNetDualILm5ELm5EEC2Ev(ptr noundef nonnull align 8 dereferenceable(10012) %2)
  %6 = getelementptr inbounds %"struct.morph::bn::GeneNetDual", ptr %2, i32 0, i32 2
  store i8 0, ptr %6, align 1, !tbaa !5
  %7 = getelementptr inbounds %"struct.morph::bn::GeneNetDual", ptr %2, i32 0, i32 1
  store i8 0, ptr %7, align 8, !tbaa !17
  %8 = getelementptr inbounds %"struct.morph::bn::GeneNetDual", ptr %2, i32 0, i32 4
  store i8 21, ptr %8, align 1, !tbaa !18
  %9 = getelementptr inbounds %"struct.morph::bn::GeneNetDual", ptr %2, i32 0, i32 3
  store i8 10, ptr %9, align 2, !tbaa !19
  call void @llvm.lifetime.start.p0(i64 20, ptr %3) #6
  invoke void @_ZN5morph2bn11GeneNetDualILm5ELm5EE17evolve_new_genomeEf(ptr dead_on_unwind writable sret(%"struct.morph::bn::Genome") align 4 %3, ptr noundef nonnull align 8 dereferenceable(10012) %2, float noundef 0x3FA99999A0000000)
          to label %10 unwind label %19

10:                                               ; preds = %0
  %11 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.4)
          to label %12 unwind label %19

12:                                               ; preds = %10
  %13 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN5morph2bnlsILm5ELm5EEERSoS2_RKNS0_6GenomeIXT_EXT0_EEE(ptr noundef nonnull align 8 dereferenceable(8) %11, ptr noundef nonnull align 4 dereferenceable(20) %3)
          to label %14 unwind label %19

14:                                               ; preds = %12
  %15 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %13, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %16 unwind label %19

16:                                               ; preds = %14
  invoke void @_ZN5morph2bn6RandomILm5ELm5EE13i_deconstructEv()
          to label %17 unwind label %19

17:                                               ; preds = %16
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.end.p0(i64 20, ptr %3) #6
  call void @_ZN5morph2bn7GeneNetILm5ELm5EED2Ev(ptr noundef nonnull align 8 dereferenceable(10012) %2) #6
  call void @llvm.lifetime.end.p0(i64 10016, ptr %2) #6
  %18 = load i32, ptr %1, align 4
  ret i32 %18

19:                                               ; preds = %16, %14, %12, %10, %0
  %20 = landingpad { ptr, i32 }
          cleanup
  %21 = extractvalue { ptr, i32 } %20, 0
  store ptr %21, ptr %4, align 8
  %22 = extractvalue { ptr, i32 } %20, 1
  store i32 %22, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 20, ptr %3) #6
  call void @_ZN5morph2bn7GeneNetILm5ELm5EED2Ev(ptr noundef nonnull align 8 dereferenceable(10012) %2) #6
  call void @llvm.lifetime.end.p0(i64 10016, ptr %2) #6
  br label %23

23:                                               ; preds = %19
  %24 = load ptr, ptr %4, align 8
  %25 = load i32, ptr %5, align 4
  %26 = insertvalue { ptr, i32 } poison, ptr %24, 0
  %27 = insertvalue { ptr, i32 } %26, i32 %25, 1
  resume { ptr, i32 } %27
}

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN5morph2bn11GeneNetDualILm5ELm5EEC2Ev(ptr noundef nonnull align 8 dereferenceable(10012)) unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN5morph2bn11GeneNetDualILm5ELm5EE17evolve_new_genomeEf(ptr dead_on_unwind noalias writable sret(%"struct.morph::bn::Genome") align 4, ptr noundef nonnull align 8 dereferenceable(10012), float noundef) #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZN5morph2bnlsILm5ELm5EEERSoS2_RKNS0_6GenomeIXT_EXT0_EEE(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(20)) #3

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN5morph2bn6RandomILm5ELm5EE13i_deconstructEv() #4 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN5morph2bn7GeneNetILm5ELm5EED2Ev(ptr noundef nonnull align 8 dereferenceable(10008)) unnamed_addr #5 align 2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { mustprogress norecurse 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 = { 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 = { 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 #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, !10, i64 10009}
!6 = !{!"_ZTSN5morph2bn11GeneNetDualILm5ELm5EEE", !7, i64 0, !10, i64 10008, !10, i64 10009, !10, i64 10010, !10, i64 10011}
!7 = !{!"_ZTSN5morph2bn7GeneNetILm5ELm5EEE", !8, i64 0}
!8 = !{!"_ZTSN5morph11RandUniformIjSt23mersenne_twister_engineImLm32ELm624ELm397ELm31ELm2567483615ELm11ELm4294967295ELm7ELm2636928640ELm15ELm4022730752ELm18ELm1812433253EELb1EEE", !9, i64 0, !12, i64 5000, !14, i64 10000}
!9 = !{!"_ZTSSt13random_device", !10, i64 0}
!10 = !{!"omnipotent char", !11, i64 0}
!11 = !{!"Simple C++ TBAA"}
!12 = !{!"_ZTSSt23mersenne_twister_engineImLm32ELm624ELm397ELm31ELm2567483615ELm11ELm4294967295ELm7ELm2636928640ELm15ELm4022730752ELm18ELm1812433253EE", !10, i64 0, !13, i64 4992}
!13 = !{!"long", !10, i64 0}
!14 = !{!"_ZTSSt24uniform_int_distributionIjE", !15, i64 0}
!15 = !{!"_ZTSNSt24uniform_int_distributionIjE10param_typeE", !16, i64 0, !16, i64 4}
!16 = !{!"int", !10, i64 0}
!17 = !{!6, !10, i64 10008}
!18 = !{!6, !10, i64 10011}
!19 = !{!6, !10, i64 10010}


; 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::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"struct.morph::bn::GeneNetDual" = type <{ %"struct.morph::bn::GeneNet", i8, i8, i8, i8, [4 x i8] }>
%"struct.morph::bn::GeneNet" = type { %"class.morph::RandUniform" }
%"class.morph::RandUniform" = type { %"class.std::random_device", %"class.std::mersenne_twister_engine", %"class.std::uniform_int_distribution" }
%"class.std::random_device" = type { %union.anon.7 }
%union.anon.7 = type { %"class.std::mersenne_twister_engine" }
%"class.std::mersenne_twister_engine" = type { [624 x i64], i64 }
%"class.std::uniform_int_distribution" = type { %"struct.std::uniform_int_distribution<unsigned int>::param_type" }
%"struct.std::uniform_int_distribution<unsigned int>::param_type" = type { i32, i32 }
%"struct.morph::bn::Genome" = type { %"struct.std::array" }
%"struct.std::array" = type { [5 x i32] }

@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str.4 = external hidden unnamed_addr constant [17 x i8], align 1

; 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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #2 personality ptr @__gxx_personality_v0 {
  %1 = alloca %"struct.morph::bn::GeneNetDual", align 8
  %2 = alloca %"struct.morph::bn::Genome", align 4
  call void @llvm.lifetime.start.p0(i64 10016, ptr nonnull %1) #6
  call void @_ZN5morph2bn11GeneNetDualILm5ELm5EEC2Ev(ptr noundef nonnull align 8 dereferenceable(10012) %1)
  %3 = getelementptr inbounds i8, ptr %1, i64 10008
  store <4 x i8> <i8 0, i8 0, i8 10, i8 21>, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 20, ptr nonnull %2) #6
  invoke void @_ZN5morph2bn11GeneNetDualILm5ELm5EE17evolve_new_genomeEf(ptr dead_on_unwind nonnull writable sret(%"struct.morph::bn::Genome") align 4 %2, ptr noundef nonnull align 8 dereferenceable(10012) %1, float noundef 0x3FA99999A0000000)
          to label %4 unwind label %11

4:                                                ; preds = %0
  %5 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str.4)
          to label %6 unwind label %11

6:                                                ; preds = %4
  %7 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN5morph2bnlsILm5ELm5EEERSoS2_RKNS0_6GenomeIXT_EXT0_EEE(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 4 dereferenceable(20) %2)
          to label %8 unwind label %11

8:                                                ; preds = %6
  %9 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %10 unwind label %11

10:                                               ; preds = %8
  call void @_ZN5morph2bn6RandomILm5ELm5EE13i_deconstructEv()
  call void @llvm.lifetime.end.p0(i64 20, ptr nonnull %2) #6
  call void @_ZN5morph2bn7GeneNetILm5ELm5EED2Ev(ptr noundef nonnull align 8 dereferenceable(10012) %1) #6
  call void @llvm.lifetime.end.p0(i64 10016, ptr nonnull %1) #6
  ret i32 0

11:                                               ; preds = %8, %6, %4, %0
  %12 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 20, ptr nonnull %2) #6
  call void @_ZN5morph2bn7GeneNetILm5ELm5EED2Ev(ptr noundef nonnull align 8 dereferenceable(10012) %1) #6
  call void @llvm.lifetime.end.p0(i64 10016, ptr nonnull %1) #6
  resume { ptr, i32 } %12
}

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN5morph2bn11GeneNetDualILm5ELm5EEC2Ev(ptr noundef nonnull align 8 dereferenceable(10012)) unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN5morph2bn11GeneNetDualILm5ELm5EE17evolve_new_genomeEf(ptr dead_on_unwind noalias writable sret(%"struct.morph::bn::Genome") align 4, ptr noundef nonnull align 8 dereferenceable(10012), float noundef) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZN5morph2bnlsILm5ELm5EEERSoS2_RKNS0_6GenomeIXT_EXT0_EEE(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(20)) local_unnamed_addr #3

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN5morph2bn6RandomILm5ELm5EE13i_deconstructEv() local_unnamed_addr #4 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN5morph2bn7GeneNetILm5ELm5EED2Ev(ptr noundef nonnull align 8 dereferenceable(10008)) unnamed_addr #5 align 2

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { mustprogress norecurse 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 = { 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 = { 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 #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 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,SLPVectorizerPass,SROAPass,SimplifyCFGPass