; LLVM IR from NongMindHouse/MasterNongMind :: Archives (mm-genetic-5)

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

; 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: nounwind
declare i32 @rand() #1

; Function Attrs: nounwind uwtable
define dso_local void @SinglePointCrossover(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3) #2 {
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  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 ptr %3, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #3
  %12 = call i32 @rand() #3
  %13 = srem i32 %12, 4
  %14 = add nsw i32 %13, 1
  store i32 %14, ptr %9, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #3
  store i32 0, ptr %10, align 4, !tbaa !9
  br label %15

15:                                               ; preds = %39, %4
  %16 = load i32, ptr %10, align 4, !tbaa !9
  %17 = load i32, ptr %9, align 4, !tbaa !9
  %18 = icmp slt i32 %16, %17
  br i1 %18, label %20, label %19

19:                                               ; preds = %15
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #3
  br label %42

20:                                               ; preds = %15
  %21 = load ptr, ptr %5, align 8, !tbaa !5
  %22 = load i32, ptr %10, align 4, !tbaa !9
  %23 = sext i32 %22 to i64
  %24 = getelementptr inbounds i32, ptr %21, i64 %23
  %25 = load i32, ptr %24, align 4, !tbaa !9
  %26 = load ptr, ptr %7, align 8, !tbaa !5
  %27 = load i32, ptr %10, align 4, !tbaa !9
  %28 = sext i32 %27 to i64
  %29 = getelementptr inbounds i32, ptr %26, i64 %28
  store i32 %25, ptr %29, align 4, !tbaa !9
  %30 = load ptr, ptr %6, align 8, !tbaa !5
  %31 = load i32, ptr %10, align 4, !tbaa !9
  %32 = sext i32 %31 to i64
  %33 = getelementptr inbounds i32, ptr %30, i64 %32
  %34 = load i32, ptr %33, align 4, !tbaa !9
  %35 = load ptr, ptr %8, align 8, !tbaa !5
  %36 = load i32, ptr %10, align 4, !tbaa !9
  %37 = sext i32 %36 to i64
  %38 = getelementptr inbounds i32, ptr %35, i64 %37
  store i32 %34, ptr %38, align 4, !tbaa !9
  br label %39

39:                                               ; preds = %20
  %40 = load i32, ptr %10, align 4, !tbaa !9
  %41 = add nsw i32 %40, 1
  store i32 %41, ptr %10, align 4, !tbaa !9
  br label %15, !llvm.loop !11

42:                                               ; preds = %19
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #3
  %43 = load i32, ptr %9, align 4, !tbaa !9
  store i32 %43, ptr %11, align 4, !tbaa !9
  br label %44

44:                                               ; preds = %67, %42
  %45 = load i32, ptr %11, align 4, !tbaa !9
  %46 = icmp slt i32 %45, 4
  br i1 %46, label %48, label %47

47:                                               ; preds = %44
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #3
  br label %70

48:                                               ; preds = %44
  %49 = load ptr, ptr %6, align 8, !tbaa !5
  %50 = load i32, ptr %11, align 4, !tbaa !9
  %51 = sext i32 %50 to i64
  %52 = getelementptr inbounds i32, ptr %49, i64 %51
  %53 = load i32, ptr %52, align 4, !tbaa !9
  %54 = load ptr, ptr %7, align 8, !tbaa !5
  %55 = load i32, ptr %11, align 4, !tbaa !9
  %56 = sext i32 %55 to i64
  %57 = getelementptr inbounds i32, ptr %54, i64 %56
  store i32 %53, ptr %57, align 4, !tbaa !9
  %58 = load ptr, ptr %5, align 8, !tbaa !5
  %59 = load i32, ptr %11, align 4, !tbaa !9
  %60 = sext i32 %59 to i64
  %61 = getelementptr inbounds i32, ptr %58, i64 %60
  %62 = load i32, ptr %61, align 4, !tbaa !9
  %63 = load ptr, ptr %8, align 8, !tbaa !5
  %64 = load i32, ptr %11, align 4, !tbaa !9
  %65 = sext i32 %64 to i64
  %66 = getelementptr inbounds i32, ptr %63, i64 %65
  store i32 %62, ptr %66, align 4, !tbaa !9
  br label %67

67:                                               ; preds = %48
  %68 = load i32, ptr %11, align 4, !tbaa !9
  %69 = add nsw i32 %68, 1
  store i32 %69, ptr %11, align 4, !tbaa !9
  br label %44, !llvm.loop !13

70:                                               ; preds = %47
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #3
  ret void
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nounwind "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 = { 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 #3 = { 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/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}


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

; Function Attrs: nounwind
declare i32 @rand() local_unnamed_addr #0

; Function Attrs: nounwind uwtable
define dso_local void @SinglePointCrossover(ptr nocapture noundef readonly %0, ptr nocapture noundef readonly %1, ptr nocapture noundef writeonly %2, ptr nocapture noundef writeonly %3) local_unnamed_addr #1 {
  %5 = ptrtoint ptr %0 to i64
  %6 = ptrtoint ptr %1 to i64
  %7 = ptrtoint ptr %2 to i64
  %8 = ptrtoint ptr %3 to i64
  %9 = tail call i32 @rand() #2
  %10 = srem i32 %9, 4
  %.not23 = icmp slt i32 %10, 0
  br i1 %.not23, label %.lr.ph26.preheader, label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %4
  %11 = add nuw nsw i32 %10, 1
  %12 = load i32, ptr %0, align 4, !tbaa !5
  store i32 %12, ptr %2, align 4, !tbaa !5
  %13 = load i32, ptr %1, align 4, !tbaa !5
  store i32 %13, ptr %3, align 4, !tbaa !5
  %exitcond.not = icmp eq i32 %10, 0
  br i1 %exitcond.not, label %.preheader, label %.lr.ph.1, !llvm.loop !9

.preheader:                                       ; preds = %.lr.ph.3, %.lr.ph.2, %.lr.ph.1, %.lr.ph.preheader
  %14 = icmp slt i32 %10, 3
  br i1 %14, label %.lr.ph26.preheader, label %._crit_edge

.lr.ph26.preheader:                               ; preds = %4, %.preheader
  %15 = sext i32 %10 to i64
  %16 = sub nsw i64 3, %15
  %min.iters.check = icmp ult i64 %16, 24
  br i1 %min.iters.check, label %.lr.ph26.preheader42, label %vector.memcheck

.lr.ph26.preheader42:                             ; preds = %vector.ph, %vector.memcheck, %.lr.ph26.preheader
  %indvars.iv28.ph = phi i64 [ %15, %vector.memcheck ], [ %15, %.lr.ph26.preheader ], [ %ind.end, %vector.ph ]
  %17 = sub nsw i64 1, %indvars.iv28.ph
  %xtraiter = and i64 %17, 1
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.lr.ph26.prol.loopexit, label %.lr.ph26.prol

.lr.ph26.prol:                                    ; preds = %.lr.ph26.preheader42
  %indvars.iv.next29.prol = add nsw i64 %indvars.iv28.ph, 1
  %18 = getelementptr inbounds i32, ptr %1, i64 %indvars.iv.next29.prol
  %19 = load i32, ptr %18, align 4, !tbaa !5
  %20 = getelementptr inbounds i32, ptr %2, i64 %indvars.iv.next29.prol
  store i32 %19, ptr %20, align 4, !tbaa !5
  %21 = getelementptr inbounds i32, ptr %0, i64 %indvars.iv.next29.prol
  %22 = load i32, ptr %21, align 4, !tbaa !5
  %23 = getelementptr inbounds i32, ptr %3, i64 %indvars.iv.next29.prol
  store i32 %22, ptr %23, align 4, !tbaa !5
  br label %.lr.ph26.prol.loopexit

.lr.ph26.prol.loopexit:                           ; preds = %.lr.ph26.prol, %.lr.ph26.preheader42
  %indvars.iv28.unr = phi i64 [ %indvars.iv28.ph, %.lr.ph26.preheader42 ], [ %indvars.iv.next29.prol, %.lr.ph26.prol ]
  %24 = icmp eq i64 %indvars.iv28.ph, 2
  br i1 %24, label %._crit_edge, label %.lr.ph26

vector.memcheck:                                  ; preds = %.lr.ph26.preheader
  %25 = sub i64 %8, %7
  %diff.check = icmp ult i64 %25, 32
  %26 = sub i64 %7, %6
  %diff.check32 = icmp ult i64 %26, 32
  %conflict.rdx = or i1 %diff.check, %diff.check32
  %27 = sub i64 %5, %7
  %diff.check33 = icmp ult i64 %27, 32
  %conflict.rdx34 = or i1 %conflict.rdx, %diff.check33
  %28 = sub i64 %8, %6
  %diff.check35 = icmp ult i64 %28, 32
  %conflict.rdx36 = or i1 %conflict.rdx34, %diff.check35
  %29 = sub i64 %8, %5
  %diff.check37 = icmp ult i64 %29, 32
  %conflict.rdx38 = or i1 %conflict.rdx36, %diff.check37
  br i1 %conflict.rdx38, label %.lr.ph26.preheader42, label %vector.ph

vector.ph:                                        ; preds = %vector.memcheck
  %n.vec = and i64 %16, -8
  %ind.end = add nsw i64 %n.vec, %15
  %30 = add nsw i64 %15, 1
  %31 = getelementptr inbounds i32, ptr %1, i64 %30
  %32 = getelementptr inbounds i8, ptr %31, i64 16
  %wide.load = load <4 x i32>, ptr %31, align 4, !tbaa !5
  %wide.load39 = load <4 x i32>, ptr %32, align 4, !tbaa !5
  %33 = getelementptr inbounds i32, ptr %2, i64 %30
  %34 = getelementptr inbounds i8, ptr %33, i64 16
  store <4 x i32> %wide.load, ptr %33, align 4, !tbaa !5
  store <4 x i32> %wide.load39, ptr %34, align 4, !tbaa !5
  %35 = getelementptr inbounds i32, ptr %0, i64 %30
  %36 = getelementptr inbounds i8, ptr %35, i64 16
  %wide.load40 = load <4 x i32>, ptr %35, align 4, !tbaa !5
  %wide.load41 = load <4 x i32>, ptr %36, align 4, !tbaa !5
  %37 = getelementptr inbounds i32, ptr %3, i64 %30
  %38 = getelementptr inbounds i8, ptr %37, i64 16
  store <4 x i32> %wide.load40, ptr %37, align 4, !tbaa !5
  store <4 x i32> %wide.load41, ptr %38, align 4, !tbaa !5
  %cmp.n = icmp eq i64 %16, %n.vec
  br i1 %cmp.n, label %._crit_edge, label %.lr.ph26.preheader42

.lr.ph.1:                                         ; preds = %.lr.ph.preheader
  %39 = getelementptr inbounds i8, ptr %0, i64 4
  %40 = load i32, ptr %39, align 4, !tbaa !5
  %41 = getelementptr inbounds i8, ptr %2, i64 4
  store i32 %40, ptr %41, align 4, !tbaa !5
  %42 = getelementptr inbounds i8, ptr %1, i64 4
  %43 = load i32, ptr %42, align 4, !tbaa !5
  %44 = getelementptr inbounds i8, ptr %3, i64 4
  store i32 %43, ptr %44, align 4, !tbaa !5
  %exitcond.not.1 = icmp eq i32 %11, 2
  br i1 %exitcond.not.1, label %.preheader, label %.lr.ph.2, !llvm.loop !9

.lr.ph.2:                                         ; preds = %.lr.ph.1
  %45 = getelementptr inbounds i8, ptr %0, i64 8
  %46 = load i32, ptr %45, align 4, !tbaa !5
  %47 = getelementptr inbounds i8, ptr %2, i64 8
  store i32 %46, ptr %47, align 4, !tbaa !5
  %48 = getelementptr inbounds i8, ptr %1, i64 8
  %49 = load i32, ptr %48, align 4, !tbaa !5
  %50 = getelementptr inbounds i8, ptr %3, i64 8
  store i32 %49, ptr %50, align 4, !tbaa !5
  %exitcond.not.2 = icmp eq i32 %11, 3
  br i1 %exitcond.not.2, label %.preheader, label %.lr.ph.3, !llvm.loop !9

.lr.ph.3:                                         ; preds = %.lr.ph.2
  %51 = getelementptr inbounds i8, ptr %0, i64 12
  %52 = load i32, ptr %51, align 4, !tbaa !5
  %53 = getelementptr inbounds i8, ptr %2, i64 12
  store i32 %52, ptr %53, align 4, !tbaa !5
  %54 = getelementptr inbounds i8, ptr %1, i64 12
  %55 = load i32, ptr %54, align 4, !tbaa !5
  %56 = getelementptr inbounds i8, ptr %3, i64 12
  store i32 %55, ptr %56, align 4, !tbaa !5
  br label %.preheader

._crit_edge:                                      ; preds = %.lr.ph26.prol.loopexit, %.lr.ph26, %vector.ph, %.preheader
  ret void

.lr.ph26:                                         ; preds = %.lr.ph26.prol.loopexit, %.lr.ph26
  %indvars.iv28 = phi i64 [ %indvars.iv.next29.1, %.lr.ph26 ], [ %indvars.iv28.unr, %.lr.ph26.prol.loopexit ]
  %indvars.iv.next29 = add nsw i64 %indvars.iv28, 1
  %57 = getelementptr inbounds i32, ptr %1, i64 %indvars.iv.next29
  %58 = load i32, ptr %57, align 4, !tbaa !5
  %59 = getelementptr inbounds i32, ptr %2, i64 %indvars.iv.next29
  store i32 %58, ptr %59, align 4, !tbaa !5
  %60 = getelementptr inbounds i32, ptr %0, i64 %indvars.iv.next29
  %61 = load i32, ptr %60, align 4, !tbaa !5
  %62 = getelementptr inbounds i32, ptr %3, i64 %indvars.iv.next29
  store i32 %61, ptr %62, align 4, !tbaa !5
  %indvars.iv.next29.1 = add nsw i64 %indvars.iv28, 2
  %63 = getelementptr inbounds i32, ptr %1, i64 %indvars.iv.next29.1
  %64 = load i32, ptr %63, align 4, !tbaa !5
  %65 = getelementptr inbounds i32, ptr %2, i64 %indvars.iv.next29.1
  store i32 %64, ptr %65, align 4, !tbaa !5
  %66 = getelementptr inbounds i32, ptr %0, i64 %indvars.iv.next29.1
  %67 = load i32, ptr %66, align 4, !tbaa !5
  %68 = getelementptr inbounds i32, ptr %3, i64 %indvars.iv.next29.1
  store i32 %67, ptr %68, align 4, !tbaa !5
  %exitcond31.not.1 = icmp eq i64 %indvars.iv.next29.1, 3
  br i1 %exitcond31.not.1, label %._crit_edge, label %.lr.ph26, !llvm.loop !11
}

attributes #0 = { nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { 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 = { 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10, !12}
!12 = !{!"llvm.loop.isvectorized", i32 1}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LoopLoadEliminationPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,LoopVectorizePass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass