; LLVM IR from 4LT/galines :: evolver (mutateAndSelect)

; 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.LineDef = type { i32, i32, i32, i32, i32 }
%struct.PointList = type { ptr, i32, i32 }
%struct.Evolver = type { ptr, i32, i32, %struct.Sequence, ptr }
%struct.Sequence = type { i64, ptr }

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

; Function Attrs: nounwind allocsize(0,1)
declare noalias ptr @calloc(i64 noundef, i64 noundef) #1

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #2

; Function Attrs: nounwind uwtable
declare hidden void @randomLine(ptr dead_on_unwind noalias writable sret(%struct.LineDef) align 4, ptr noundef) #3

; Function Attrs: nounwind uwtable
declare hidden { ptr, i64 } @lineToPoints(ptr noundef byval(%struct.LineDef) align 8) #3

; Function Attrs: nounwind uwtable
declare hidden void @drawPoints(ptr noundef, i32 noundef, ptr, i64) #3

; Function Attrs: nounwind
declare void @free(ptr noundef) #4

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

; Function Attrs: nounwind uwtable
define dso_local void @mutateAndSelect(ptr noundef %0) #3 {
  %2 = alloca ptr, align 8
  %3 = alloca ptr, align 8
  %4 = alloca %struct.LineDef, align 8
  %5 = alloca %struct.PointList, align 8
  %6 = alloca i32, align 4
  %7 = alloca %struct.PointList, align 8
  %8 = alloca %struct.LineDef, align 8
  %9 = alloca i32, align 4
  %10 = alloca %struct.PointList, align 8
  %11 = alloca %struct.LineDef, align 8
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #5
  %14 = load ptr, ptr %2, align 8, !tbaa !5
  %15 = getelementptr inbounds %struct.Evolver, ptr %14, i32 0, i32 1
  %16 = load i32, ptr %15, align 8, !tbaa !9
  %17 = load ptr, ptr %2, align 8, !tbaa !5
  %18 = getelementptr inbounds %struct.Evolver, ptr %17, i32 0, i32 2
  %19 = load i32, ptr %18, align 4, !tbaa !14
  %20 = mul i32 %16, %19
  %21 = zext i32 %20 to i64
  %22 = call noalias ptr @calloc(i64 noundef %21, i64 noundef 4) #6
  store ptr %22, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 20, ptr %4) #5
  %23 = load ptr, ptr %2, align 8, !tbaa !5
  call void @randomLine(ptr dead_on_unwind writable sret(%struct.LineDef) align 4 %4, ptr noundef %23)
  call void @llvm.lifetime.start.p0(i64 16, ptr %5) #5
  %24 = call { ptr, i64 } @lineToPoints(ptr noundef byval(%struct.LineDef) align 8 %4)
  %25 = getelementptr inbounds { ptr, i64 }, ptr %5, i32 0, i32 0
  %26 = extractvalue { ptr, i64 } %24, 0
  store ptr %26, ptr %25, align 8
  %27 = getelementptr inbounds { ptr, i64 }, ptr %5, i32 0, i32 1
  %28 = extractvalue { ptr, i64 } %24, 1
  store i64 %28, ptr %27, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  %29 = call i32 @rand() #5
  %30 = sext i32 %29 to i64
  %31 = load ptr, ptr %2, align 8, !tbaa !5
  %32 = getelementptr inbounds %struct.Evolver, ptr %31, i32 0, i32 3
  %33 = getelementptr inbounds %struct.Sequence, ptr %32, i32 0, i32 0
  %34 = load i64, ptr %33, align 8, !tbaa !15
  %35 = urem i64 %30, %34
  %36 = trunc i64 %35 to i32
  store i32 %36, ptr %6, align 4, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 16, ptr %7) #5
  %37 = load ptr, ptr %2, align 8, !tbaa !5
  %38 = getelementptr inbounds %struct.Evolver, ptr %37, i32 0, i32 3
  %39 = getelementptr inbounds %struct.Sequence, ptr %38, i32 0, i32 1
  %40 = load ptr, ptr %39, align 8, !tbaa !17
  %41 = load i32, ptr %6, align 4, !tbaa !16
  %42 = sext i32 %41 to i64
  %43 = getelementptr inbounds %struct.LineDef, ptr %40, i64 %42
  call void @llvm.lifetime.start.p0(i64 20, ptr %8) #5
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %8, ptr align 4 %43, i64 20, i1 false), !tbaa.struct !18
  %44 = call { ptr, i64 } @lineToPoints(ptr noundef byval(%struct.LineDef) align 8 %8)
  %45 = getelementptr inbounds { ptr, i64 }, ptr %7, i32 0, i32 0
  %46 = extractvalue { ptr, i64 } %44, 0
  store ptr %46, ptr %45, align 8
  %47 = getelementptr inbounds { ptr, i64 }, ptr %7, i32 0, i32 1
  %48 = extractvalue { ptr, i64 } %44, 1
  store i64 %48, ptr %47, align 8
  call void @llvm.lifetime.end.p0(i64 20, ptr %8) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  store i32 0, ptr %9, align 4, !tbaa !16
  br label %49

49:                                               ; preds = %95, %1
  %50 = load i32, ptr %9, align 4, !tbaa !16
  %51 = sext i32 %50 to i64
  %52 = load ptr, ptr %2, align 8, !tbaa !5
  %53 = getelementptr inbounds %struct.Evolver, ptr %52, i32 0, i32 3
  %54 = getelementptr inbounds %struct.Sequence, ptr %53, i32 0, i32 0
  %55 = load i64, ptr %54, align 8, !tbaa !15
  %56 = icmp ult i64 %51, %55
  br i1 %56, label %58, label %57

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

58:                                               ; preds = %49
  %59 = load i32, ptr %9, align 4, !tbaa !16
  %60 = load i32, ptr %6, align 4, !tbaa !16
  %61 = icmp eq i32 %59, %60
  br i1 %61, label %62, label %71

62:                                               ; preds = %58
  %63 = load ptr, ptr %3, align 8, !tbaa !5
  %64 = load ptr, ptr %2, align 8, !tbaa !5
  %65 = getelementptr inbounds %struct.Evolver, ptr %64, i32 0, i32 1
  %66 = load i32, ptr %65, align 8, !tbaa !9
  %67 = getelementptr inbounds { ptr, i64 }, ptr %5, i32 0, i32 0
  %68 = load ptr, ptr %67, align 8
  %69 = getelementptr inbounds { ptr, i64 }, ptr %5, i32 0, i32 1
  %70 = load i64, ptr %69, align 8
  call void @drawPoints(ptr noundef %63, i32 noundef %66, ptr %68, i64 %70)
  br label %94

71:                                               ; preds = %58
  call void @llvm.lifetime.start.p0(i64 16, ptr %10) #5
  %72 = load ptr, ptr %2, align 8, !tbaa !5
  %73 = getelementptr inbounds %struct.Evolver, ptr %72, i32 0, i32 3
  %74 = getelementptr inbounds %struct.Sequence, ptr %73, i32 0, i32 1
  %75 = load ptr, ptr %74, align 8, !tbaa !17
  %76 = load i32, ptr %9, align 4, !tbaa !16
  %77 = sext i32 %76 to i64
  %78 = getelementptr inbounds %struct.LineDef, ptr %75, i64 %77
  call void @llvm.lifetime.start.p0(i64 20, ptr %11) #5
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %11, ptr align 4 %78, i64 20, i1 false), !tbaa.struct !18
  %79 = call { ptr, i64 } @lineToPoints(ptr noundef byval(%struct.LineDef) align 8 %11)
  %80 = getelementptr inbounds { ptr, i64 }, ptr %10, i32 0, i32 0
  %81 = extractvalue { ptr, i64 } %79, 0
  store ptr %81, ptr %80, align 8
  %82 = getelementptr inbounds { ptr, i64 }, ptr %10, i32 0, i32 1
  %83 = extractvalue { ptr, i64 } %79, 1
  store i64 %83, ptr %82, align 8
  call void @llvm.lifetime.end.p0(i64 20, ptr %11) #5
  %84 = load ptr, ptr %3, align 8, !tbaa !5
  %85 = load ptr, ptr %2, align 8, !tbaa !5
  %86 = getelementptr inbounds %struct.Evolver, ptr %85, i32 0, i32 1
  %87 = load i32, ptr %86, align 8, !tbaa !9
  %88 = getelementptr inbounds { ptr, i64 }, ptr %10, i32 0, i32 0
  %89 = load ptr, ptr %88, align 8
  %90 = getelementptr inbounds { ptr, i64 }, ptr %10, i32 0, i32 1
  %91 = load i64, ptr %90, align 8
  call void @drawPoints(ptr noundef %84, i32 noundef %87, ptr %89, i64 %91)
  %92 = getelementptr inbounds %struct.PointList, ptr %10, i32 0, i32 0
  %93 = load ptr, ptr %92, align 8, !tbaa !19
  call void @free(ptr noundef %93) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %10) #5
  br label %94

94:                                               ; preds = %71, %62
  br label %95

95:                                               ; preds = %94
  %96 = load i32, ptr %9, align 4, !tbaa !16
  %97 = add nsw i32 %96, 1
  store i32 %97, ptr %9, align 4, !tbaa !16
  br label %49, !llvm.loop !21

98:                                               ; preds = %57
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  %99 = load ptr, ptr %2, align 8, !tbaa !5
  %100 = load ptr, ptr %2, align 8, !tbaa !5
  %101 = getelementptr inbounds %struct.Evolver, ptr %100, i32 0, i32 4
  %102 = load ptr, ptr %101, align 8, !tbaa !23
  %103 = getelementptr inbounds { ptr, i64 }, ptr %5, i32 0, i32 0
  %104 = load ptr, ptr %103, align 8
  %105 = getelementptr inbounds { ptr, i64 }, ptr %5, i32 0, i32 1
  %106 = load i64, ptr %105, align 8
  %107 = getelementptr inbounds { ptr, i64 }, ptr %7, i32 0, i32 0
  %108 = load ptr, ptr %107, align 8
  %109 = getelementptr inbounds { ptr, i64 }, ptr %7, i32 0, i32 1
  %110 = load i64, ptr %109, align 8
  %111 = call i32 @fitness(ptr noundef %99, ptr noundef %102, ptr %104, i64 %106, ptr %108, i64 %110)
  store i32 %111, ptr %12, align 4, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  %112 = load ptr, ptr %2, align 8, !tbaa !5
  %113 = load ptr, ptr %3, align 8, !tbaa !5
  %114 = getelementptr inbounds { ptr, i64 }, ptr %5, i32 0, i32 0
  %115 = load ptr, ptr %114, align 8
  %116 = getelementptr inbounds { ptr, i64 }, ptr %5, i32 0, i32 1
  %117 = load i64, ptr %116, align 8
  %118 = getelementptr inbounds { ptr, i64 }, ptr %7, i32 0, i32 0
  %119 = load ptr, ptr %118, align 8
  %120 = getelementptr inbounds { ptr, i64 }, ptr %7, i32 0, i32 1
  %121 = load i64, ptr %120, align 8
  %122 = call i32 @fitness(ptr noundef %112, ptr noundef %113, ptr %115, i64 %117, ptr %119, i64 %121)
  store i32 %122, ptr %13, align 4, !tbaa !16
  %123 = load i32, ptr %13, align 4, !tbaa !16
  %124 = load i32, ptr %12, align 4, !tbaa !16
  %125 = icmp sgt i32 %123, %124
  br i1 %125, label %126, label %140

126:                                              ; preds = %98
  %127 = load ptr, ptr %2, align 8, !tbaa !5
  %128 = getelementptr inbounds %struct.Evolver, ptr %127, i32 0, i32 3
  %129 = getelementptr inbounds %struct.Sequence, ptr %128, i32 0, i32 1
  %130 = load ptr, ptr %129, align 8, !tbaa !17
  %131 = load i32, ptr %6, align 4, !tbaa !16
  %132 = sext i32 %131 to i64
  %133 = getelementptr inbounds %struct.LineDef, ptr %130, i64 %132
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %133, ptr align 4 %4, i64 20, i1 false), !tbaa.struct !18
  %134 = load ptr, ptr %2, align 8, !tbaa !5
  %135 = getelementptr inbounds %struct.Evolver, ptr %134, i32 0, i32 4
  %136 = load ptr, ptr %135, align 8, !tbaa !23
  call void @free(ptr noundef %136) #5
  %137 = load ptr, ptr %3, align 8, !tbaa !5
  %138 = load ptr, ptr %2, align 8, !tbaa !5
  %139 = getelementptr inbounds %struct.Evolver, ptr %138, i32 0, i32 4
  store ptr %137, ptr %139, align 8, !tbaa !23
  br label %142

140:                                              ; preds = %98
  %141 = load ptr, ptr %3, align 8, !tbaa !5
  call void @free(ptr noundef %141) #5
  br label %142

142:                                              ; preds = %140, %126
  %143 = getelementptr inbounds %struct.PointList, ptr %5, i32 0, i32 0
  %144 = load ptr, ptr %143, align 8, !tbaa !19
  call void @free(ptr noundef %144) #5
  %145 = getelementptr inbounds %struct.PointList, ptr %7, i32 0, i32 0
  %146 = load ptr, ptr %145, align 8, !tbaa !19
  call void @free(ptr noundef %146) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %5) #5
  call void @llvm.lifetime.end.p0(i64 20, ptr %4) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #5
  ret void
}

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

; Function Attrs: nounwind uwtable
declare hidden i32 @fitness(ptr noundef, ptr noundef, ptr, i64, ptr, i64) #3

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nounwind allocsize(0,1) "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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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 #5 = { nounwind }
attributes #6 = { nounwind allocsize(0,1) }

!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, !11, i64 8}
!10 = !{!"Evolver", !6, i64 0, !11, i64 8, !11, i64 12, !12, i64 16, !6, i64 32}
!11 = !{!"int", !7, i64 0}
!12 = !{!"Sequence", !13, i64 0, !6, i64 8}
!13 = !{!"long", !7, i64 0}
!14 = !{!10, !11, i64 12}
!15 = !{!10, !13, i64 16}
!16 = !{!11, !11, i64 0}
!17 = !{!10, !6, i64 24}
!18 = !{i64 0, i64 4, !16, i64 4, i64 4, !16, i64 8, i64 4, !16, i64 12, i64 4, !16, i64 16, i64 4, !16}
!19 = !{!20, !6, i64 0}
!20 = !{!"PointList", !6, i64 0, !11, i64 8, !11, i64 12}
!21 = distinct !{!21, !22}
!22 = !{!"llvm.loop.mustprogress"}
!23 = !{!10, !6, i64 32}


; 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.LineDef = type { i32, i32, i32, i32, i32 }

; 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 nofree nounwind willreturn allockind("alloc,zeroed") allocsize(0,1) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @calloc(i64 noundef, i64 noundef) local_unnamed_addr #1

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #2

; Function Attrs: nounwind uwtable
declare hidden void @randomLine(ptr dead_on_unwind noalias writable sret(%struct.LineDef) align 4, ptr noundef) local_unnamed_addr #3

; Function Attrs: nounwind uwtable
declare hidden { ptr, i64 } @lineToPoints(ptr noundef byval(%struct.LineDef) align 8) local_unnamed_addr #3

; Function Attrs: nounwind uwtable
declare hidden void @drawPoints(ptr noundef, i32 noundef, ptr, i64) local_unnamed_addr #3

; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #4

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

; Function Attrs: nounwind uwtable
define dso_local void @mutateAndSelect(ptr noundef %0) local_unnamed_addr #3 {
  %2 = alloca %struct.LineDef, align 8
  %3 = alloca %struct.LineDef, align 8
  %4 = alloca %struct.LineDef, align 8
  %5 = getelementptr inbounds i8, ptr %0, i64 8
  %6 = load i32, ptr %5, align 8, !tbaa !5
  %7 = getelementptr inbounds i8, ptr %0, i64 12
  %8 = load i32, ptr %7, align 4, !tbaa !13
  %9 = mul i32 %8, %6
  %10 = zext i32 %9 to i64
  %11 = tail call noalias ptr @calloc(i64 noundef %10, i64 noundef 4) #6
  call void @llvm.lifetime.start.p0(i64 20, ptr nonnull %2) #7
  call void @randomLine(ptr dead_on_unwind nonnull writable sret(%struct.LineDef) align 4 %2, ptr noundef %0)
  %12 = call { ptr, i64 } @lineToPoints(ptr noundef nonnull byval(%struct.LineDef) align 8 %2)
  %13 = extractvalue { ptr, i64 } %12, 0
  %14 = extractvalue { ptr, i64 } %12, 1
  %15 = call i32 @rand() #7
  %16 = sext i32 %15 to i64
  %17 = getelementptr inbounds i8, ptr %0, i64 16
  %18 = load i64, ptr %17, align 8, !tbaa !14
  %19 = urem i64 %16, %18
  %20 = getelementptr inbounds i8, ptr %0, i64 24
  %21 = load ptr, ptr %20, align 8, !tbaa !15
  %sext = shl i64 %19, 32
  %22 = ashr exact i64 %sext, 32
  %23 = getelementptr inbounds %struct.LineDef, ptr %21, i64 %22
  call void @llvm.lifetime.start.p0(i64 20, ptr nonnull %3) #7
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(20) %3, ptr noundef nonnull align 4 dereferenceable(20) %23, i64 20, i1 false), !tbaa.struct !16
  %24 = call { ptr, i64 } @lineToPoints(ptr noundef nonnull byval(%struct.LineDef) align 8 %3)
  %25 = extractvalue { ptr, i64 } %24, 0
  %26 = extractvalue { ptr, i64 } %24, 1
  call void @llvm.lifetime.end.p0(i64 20, ptr nonnull %3) #7
  %27 = load i64, ptr %17, align 8, !tbaa !14
  %.not = icmp eq i64 %27, 0
  br i1 %.not, label %._crit_edge, label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %1
  %28 = and i64 %19, 4294967295
  br label %.lr.ph

._crit_edge:                                      ; preds = %44, %1
  %29 = getelementptr inbounds i8, ptr %0, i64 32
  %30 = load ptr, ptr %29, align 8, !tbaa !18
  %31 = call i32 @fitness(ptr noundef nonnull %0, ptr noundef %30, ptr %13, i64 %14, ptr %25, i64 %26)
  %32 = call i32 @fitness(ptr noundef nonnull %0, ptr noundef %11, ptr %13, i64 %14, ptr %25, i64 %26)
  %33 = icmp sgt i32 %32, %31
  br i1 %33, label %47, label %51

.lr.ph:                                           ; preds = %.lr.ph.preheader, %44
  %indvars.iv = phi i64 [ 0, %.lr.ph.preheader ], [ %indvars.iv.next, %44 ]
  %34 = icmp eq i64 %indvars.iv, %28
  br i1 %34, label %35, label %37

35:                                               ; preds = %.lr.ph
  %36 = load i32, ptr %5, align 8, !tbaa !5
  call void @drawPoints(ptr noundef %11, i32 noundef %36, ptr %13, i64 %14)
  br label %44

37:                                               ; preds = %.lr.ph
  %38 = load ptr, ptr %20, align 8, !tbaa !15
  %39 = getelementptr inbounds %struct.LineDef, ptr %38, i64 %indvars.iv
  call void @llvm.lifetime.start.p0(i64 20, ptr nonnull %4) #7
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(20) %4, ptr noundef nonnull align 4 dereferenceable(20) %39, i64 20, i1 false), !tbaa.struct !16
  %40 = call { ptr, i64 } @lineToPoints(ptr noundef nonnull byval(%struct.LineDef) align 8 %4)
  %41 = extractvalue { ptr, i64 } %40, 0
  %42 = extractvalue { ptr, i64 } %40, 1
  call void @llvm.lifetime.end.p0(i64 20, ptr nonnull %4) #7
  %43 = load i32, ptr %5, align 8, !tbaa !5
  call void @drawPoints(ptr noundef %11, i32 noundef %43, ptr %41, i64 %42)
  call void @free(ptr noundef %41) #7
  br label %44

44:                                               ; preds = %35, %37
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %45 = load i64, ptr %17, align 8, !tbaa !14
  %46 = icmp ugt i64 %45, %indvars.iv.next
  br i1 %46, label %.lr.ph, label %._crit_edge, !llvm.loop !19

47:                                               ; preds = %._crit_edge
  %48 = load ptr, ptr %20, align 8, !tbaa !15
  %49 = getelementptr inbounds %struct.LineDef, ptr %48, i64 %22
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(20) %49, ptr noundef nonnull align 8 dereferenceable(20) %2, i64 20, i1 false), !tbaa.struct !16
  %50 = load ptr, ptr %29, align 8, !tbaa !18
  call void @free(ptr noundef %50) #7
  store ptr %11, ptr %29, align 8, !tbaa !18
  br label %52

51:                                               ; preds = %._crit_edge
  call void @free(ptr noundef %11) #7
  br label %52

52:                                               ; preds = %51, %47
  call void @free(ptr noundef %13) #7
  call void @free(ptr noundef %25) #7
  call void @llvm.lifetime.end.p0(i64 20, ptr nonnull %2) #7
  ret void
}

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

; Function Attrs: nounwind uwtable
declare hidden i32 @fitness(ptr noundef, ptr noundef, ptr, i64, ptr, i64) local_unnamed_addr #3

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress nofree nounwind willreturn allockind("alloc,zeroed") allocsize(0,1) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "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 nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind "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 allocsize(0,1) }
attributes #7 = { 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 8}
!6 = !{!"Evolver", !7, i64 0, !10, i64 8, !10, i64 12, !11, i64 16, !7, i64 32}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!"Sequence", !12, i64 0, !7, i64 8}
!12 = !{!"long", !8, i64 0}
!13 = !{!6, !10, i64 12}
!14 = !{!6, !12, i64 16}
!15 = !{!6, !7, i64 24}
!16 = !{i64 0, i64 4, !17, i64 4, i64 4, !17, i64 8, i64 4, !17, i64 12, i64 4, !17, i64 16, i64 4, !17}
!17 = !{!10, !10, i64 0}
!18 = !{!6, !7, i64 32}
!19 = distinct !{!19, !20}
!20 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass