; LLVM IR from AlgoGenesis/C :: Graph Algorithms/Kruskal's Algorithm (Program)

; 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.Edge = type { i32, i32, i32 }
%struct.Graph = type { i32, i32, ptr }
%struct.Subset = type { i32, i32 }

@.str = external hidden unnamed_addr constant [49 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [34 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: nounwind allocsize(0)
declare noalias ptr @malloc(i64 noundef) #1

; 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
declare dso_local i32 @find(ptr noundef, i32 noundef) #2

; Function Attrs: nounwind uwtable
declare dso_local void @Union(ptr noundef, i32 noundef, i32 noundef) #2

; Function Attrs: nounwind uwtable
declare dso_local i32 @compareEdges(ptr noundef, ptr noundef) #2

; Function Attrs: nounwind uwtable
define dso_local void @KruskalMST(ptr noundef %0) #2 {
  %2 = alloca ptr, align 8
  %3 = alloca i32, align 4
  %4 = alloca [100 x %struct.Edge], align 16
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca %struct.Edge, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #6
  %13 = load ptr, ptr %2, align 8, !tbaa !5
  %14 = getelementptr inbounds %struct.Graph, ptr %13, i32 0, i32 0
  %15 = load i32, ptr %14, align 8, !tbaa !9
  store i32 %15, ptr %3, align 4, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 1200, ptr %4) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #6
  store i32 0, ptr %5, align 4, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  store i32 0, ptr %6, align 4, !tbaa !12
  %16 = load ptr, ptr %2, align 8, !tbaa !5
  %17 = getelementptr inbounds %struct.Graph, ptr %16, i32 0, i32 2
  %18 = load ptr, ptr %17, align 8, !tbaa !13
  %19 = load ptr, ptr %2, align 8, !tbaa !5
  %20 = getelementptr inbounds %struct.Graph, ptr %19, i32 0, i32 1
  %21 = load i32, ptr %20, align 4, !tbaa !14
  %22 = sext i32 %21 to i64
  call void @qsort(ptr noundef %18, i64 noundef %22, i64 noundef 12, ptr noundef @compareEdges)
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #6
  %23 = load i32, ptr %3, align 4, !tbaa !12
  %24 = sext i32 %23 to i64
  %25 = mul i64 %24, 8
  %26 = call noalias ptr @malloc(i64 noundef %25) #7
  store ptr %26, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  store i32 0, ptr %8, align 4, !tbaa !12
  br label %27

27:                                               ; preds = %44, %1
  %28 = load i32, ptr %8, align 4, !tbaa !12
  %29 = load i32, ptr %3, align 4, !tbaa !12
  %30 = icmp slt i32 %28, %29
  br i1 %30, label %32, label %31

31:                                               ; preds = %27
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  br label %47

32:                                               ; preds = %27
  %33 = load i32, ptr %8, align 4, !tbaa !12
  %34 = load ptr, ptr %7, align 8, !tbaa !5
  %35 = load i32, ptr %8, align 4, !tbaa !12
  %36 = sext i32 %35 to i64
  %37 = getelementptr inbounds %struct.Subset, ptr %34, i64 %36
  %38 = getelementptr inbounds %struct.Subset, ptr %37, i32 0, i32 0
  store i32 %33, ptr %38, align 4, !tbaa !15
  %39 = load ptr, ptr %7, align 8, !tbaa !5
  %40 = load i32, ptr %8, align 4, !tbaa !12
  %41 = sext i32 %40 to i64
  %42 = getelementptr inbounds %struct.Subset, ptr %39, i64 %41
  %43 = getelementptr inbounds %struct.Subset, ptr %42, i32 0, i32 1
  store i32 0, ptr %43, align 4, !tbaa !17
  br label %44

44:                                               ; preds = %32
  %45 = load i32, ptr %8, align 4, !tbaa !12
  %46 = add nsw i32 %45, 1
  store i32 %46, ptr %8, align 4, !tbaa !12
  br label %27, !llvm.loop !18

47:                                               ; preds = %31
  br label %48

48:                                               ; preds = %88, %47
  %49 = load i32, ptr %5, align 4, !tbaa !12
  %50 = load i32, ptr %3, align 4, !tbaa !12
  %51 = sub nsw i32 %50, 1
  %52 = icmp slt i32 %49, %51
  br i1 %52, label %53, label %59

53:                                               ; preds = %48
  %54 = load i32, ptr %6, align 4, !tbaa !12
  %55 = load ptr, ptr %2, align 8, !tbaa !5
  %56 = getelementptr inbounds %struct.Graph, ptr %55, i32 0, i32 1
  %57 = load i32, ptr %56, align 4, !tbaa !14
  %58 = icmp slt i32 %54, %57
  br label %59

59:                                               ; preds = %53, %48
  %60 = phi i1 [ false, %48 ], [ %58, %53 ]
  br i1 %60, label %61, label %89

61:                                               ; preds = %59
  call void @llvm.lifetime.start.p0(i64 12, ptr %9) #6
  %62 = load ptr, ptr %2, align 8, !tbaa !5
  %63 = getelementptr inbounds %struct.Graph, ptr %62, i32 0, i32 2
  %64 = load ptr, ptr %63, align 8, !tbaa !13
  %65 = load i32, ptr %6, align 4, !tbaa !12
  %66 = add nsw i32 %65, 1
  store i32 %66, ptr %6, align 4, !tbaa !12
  %67 = sext i32 %65 to i64
  %68 = getelementptr inbounds %struct.Edge, ptr %64, i64 %67
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %9, ptr align 4 %68, i64 12, i1 false), !tbaa.struct !20
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  %69 = load ptr, ptr %7, align 8, !tbaa !5
  %70 = getelementptr inbounds %struct.Edge, ptr %9, i32 0, i32 0
  %71 = load i32, ptr %70, align 4, !tbaa !21
  %72 = call i32 @find(ptr noundef %69, i32 noundef %71)
  store i32 %72, ptr %10, align 4, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  %73 = load ptr, ptr %7, align 8, !tbaa !5
  %74 = getelementptr inbounds %struct.Edge, ptr %9, i32 0, i32 1
  %75 = load i32, ptr %74, align 4, !tbaa !23
  %76 = call i32 @find(ptr noundef %73, i32 noundef %75)
  store i32 %76, ptr %11, align 4, !tbaa !12
  %77 = load i32, ptr %10, align 4, !tbaa !12
  %78 = load i32, ptr %11, align 4, !tbaa !12
  %79 = icmp ne i32 %77, %78
  br i1 %79, label %80, label %88

80:                                               ; preds = %61
  %81 = load i32, ptr %5, align 4, !tbaa !12
  %82 = add nsw i32 %81, 1
  store i32 %82, ptr %5, align 4, !tbaa !12
  %83 = sext i32 %81 to i64
  %84 = getelementptr inbounds [100 x %struct.Edge], ptr %4, i64 0, i64 %83
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %84, ptr align 4 %9, i64 12, i1 false), !tbaa.struct !20
  %85 = load ptr, ptr %7, align 8, !tbaa !5
  %86 = load i32, ptr %10, align 4, !tbaa !12
  %87 = load i32, ptr %11, align 4, !tbaa !12
  call void @Union(ptr noundef %85, i32 noundef %86, i32 noundef %87)
  br label %88

88:                                               ; preds = %80, %61
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 12, ptr %9) #6
  br label %48, !llvm.loop !24

89:                                               ; preds = %59
  %90 = call i32 (ptr, ...) @printf(ptr noundef @.str)
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  store i32 0, ptr %12, align 4, !tbaa !12
  store i32 0, ptr %6, align 4, !tbaa !12
  br label %91

91:                                               ; preds = %119, %89
  %92 = load i32, ptr %6, align 4, !tbaa !12
  %93 = load i32, ptr %5, align 4, !tbaa !12
  %94 = icmp slt i32 %92, %93
  br i1 %94, label %95, label %122

95:                                               ; preds = %91
  %96 = load i32, ptr %6, align 4, !tbaa !12
  %97 = sext i32 %96 to i64
  %98 = getelementptr inbounds [100 x %struct.Edge], ptr %4, i64 0, i64 %97
  %99 = getelementptr inbounds %struct.Edge, ptr %98, i32 0, i32 0
  %100 = load i32, ptr %99, align 4, !tbaa !21
  %101 = load i32, ptr %6, align 4, !tbaa !12
  %102 = sext i32 %101 to i64
  %103 = getelementptr inbounds [100 x %struct.Edge], ptr %4, i64 0, i64 %102
  %104 = getelementptr inbounds %struct.Edge, ptr %103, i32 0, i32 1
  %105 = load i32, ptr %104, align 4, !tbaa !23
  %106 = load i32, ptr %6, align 4, !tbaa !12
  %107 = sext i32 %106 to i64
  %108 = getelementptr inbounds [100 x %struct.Edge], ptr %4, i64 0, i64 %107
  %109 = getelementptr inbounds %struct.Edge, ptr %108, i32 0, i32 2
  %110 = load i32, ptr %109, align 4, !tbaa !25
  %111 = call i32 (ptr, ...) @printf(ptr noundef @.str.1, i32 noundef %100, i32 noundef %105, i32 noundef %110)
  %112 = load i32, ptr %6, align 4, !tbaa !12
  %113 = sext i32 %112 to i64
  %114 = getelementptr inbounds [100 x %struct.Edge], ptr %4, i64 0, i64 %113
  %115 = getelementptr inbounds %struct.Edge, ptr %114, i32 0, i32 2
  %116 = load i32, ptr %115, align 4, !tbaa !25
  %117 = load i32, ptr %12, align 4, !tbaa !12
  %118 = add nsw i32 %117, %116
  store i32 %118, ptr %12, align 4, !tbaa !12
  br label %119

119:                                              ; preds = %95
  %120 = load i32, ptr %6, align 4, !tbaa !12
  %121 = add nsw i32 %120, 1
  store i32 %121, ptr %6, align 4, !tbaa !12
  br label %91, !llvm.loop !26

122:                                              ; preds = %91
  %123 = load i32, ptr %12, align 4, !tbaa !12
  %124 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, i32 noundef %123)
  %125 = load ptr, ptr %7, align 8, !tbaa !5
  call void @free(ptr noundef %125) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 1200, ptr %4) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #6
  ret void
}

declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr noundef) #3

; 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) #4

declare i32 @printf(ptr noundef, ...) #3

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

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

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


; 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.Edge = type { i32, i32, i32 }
%struct.Subset = type { i32, i32 }

@.str = external hidden unnamed_addr constant [49 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [34 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 nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #1

; 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
declare dso_local i32 @find(ptr noundef, i32 noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare dso_local void @Union(ptr noundef, i32 noundef, i32 noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare dso_local i32 @compareEdges(ptr noundef, ptr noundef) #2

; Function Attrs: nounwind uwtable
define dso_local void @KruskalMST(ptr nocapture noundef readonly %0) local_unnamed_addr #2 {
  %2 = alloca [100 x %struct.Edge], align 16
  %3 = load i32, ptr %0, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1200, ptr nonnull %2) #6
  %4 = getelementptr inbounds i8, ptr %0, i64 8
  %5 = load ptr, ptr %4, align 8, !tbaa !11
  %6 = getelementptr inbounds i8, ptr %0, i64 4
  %7 = load i32, ptr %6, align 4, !tbaa !12
  %8 = sext i32 %7 to i64
  tail call void @qsort(ptr noundef %5, i64 noundef %8, i64 noundef 12, ptr noundef nonnull @compareEdges) #6
  %9 = sext i32 %3 to i64
  %10 = shl nsw i64 %9, 3
  %11 = tail call noalias ptr @malloc(i64 noundef %10) #7
  %12 = icmp sgt i32 %3, 0
  br i1 %12, label %.lr.ph.preheader, label %.critedge.thread

.lr.ph.preheader:                                 ; preds = %1
  %wide.trip.count = zext nneg i32 %3 to i64
  %min.iters.check = icmp ult i32 %3, 4
  br i1 %min.iters.check, label %.lr.ph.preheader70, label %vector.ph

.lr.ph.preheader70:                               ; preds = %middle.block, %.lr.ph.preheader
  %indvars.iv.ph = phi i64 [ 0, %.lr.ph.preheader ], [ %n.vec, %middle.block ]
  br label %.lr.ph

vector.ph:                                        ; preds = %.lr.ph.preheader
  %n.vec = and i64 %wide.trip.count, 2147483644
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %vec.ind = phi <2 x i32> [ <i32 0, i32 1>, %vector.ph ], [ %vec.ind.next, %vector.body ]
  %step.add = add <2 x i32> %vec.ind, <i32 2, i32 2>
  %13 = or disjoint i64 %index, 2
  %14 = getelementptr inbounds %struct.Subset, ptr %11, i64 %index
  %15 = getelementptr inbounds %struct.Subset, ptr %11, i64 %13
  %interleaved.vec = shufflevector <2 x i32> %vec.ind, <2 x i32> zeroinitializer, <4 x i32> <i32 0, i32 2, i32 1, i32 3>
  store <4 x i32> %interleaved.vec, ptr %14, align 4, !tbaa !13
  %interleaved.vec69 = shufflevector <2 x i32> %step.add, <2 x i32> zeroinitializer, <4 x i32> <i32 0, i32 2, i32 1, i32 3>
  store <4 x i32> %interleaved.vec69, ptr %15, align 4, !tbaa !13
  %index.next = add nuw i64 %index, 4
  %vec.ind.next = add <2 x i32> %vec.ind, <i32 4, i32 4>
  %16 = icmp eq i64 %index.next, %n.vec
  br i1 %16, label %middle.block, label %vector.body, !llvm.loop !14

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %n.vec, %wide.trip.count
  br i1 %cmp.n, label %.preheader, label %.lr.ph.preheader70

.preheader:                                       ; preds = %.lr.ph, %middle.block
  %17 = add nsw i32 %3, -1
  %.not67 = icmp eq i32 %3, 1
  br i1 %.not67, label %.critedge.thread, label %.lr.ph50

.lr.ph:                                           ; preds = %.lr.ph.preheader70, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ %indvars.iv.ph, %.lr.ph.preheader70 ]
  %18 = getelementptr inbounds %struct.Subset, ptr %11, i64 %indvars.iv
  %19 = trunc nuw nsw i64 %indvars.iv to i32
  store i32 %19, ptr %18, align 4, !tbaa !18
  %20 = getelementptr inbounds i8, ptr %18, i64 4
  store i32 0, ptr %20, align 4, !tbaa !20
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %.preheader, label %.lr.ph, !llvm.loop !21

.lr.ph50:                                         ; preds = %.preheader, %35
  %indvars.iv58 = phi i64 [ %indvars.iv.next59, %35 ], [ 0, %.preheader ]
  %.04049 = phi i32 [ %.1, %35 ], [ 0, %.preheader ]
  %21 = load i32, ptr %6, align 4, !tbaa !12
  %22 = sext i32 %21 to i64
  %23 = icmp slt i64 %indvars.iv58, %22
  br i1 %23, label %24, label %.critedge

24:                                               ; preds = %.lr.ph50
  %25 = load ptr, ptr %4, align 8, !tbaa !11
  %indvars.iv.next59 = add nuw nsw i64 %indvars.iv58, 1
  %26 = getelementptr inbounds %struct.Edge, ptr %25, i64 %indvars.iv58
  %.sroa.0.0.copyload = load i32, ptr %26, align 4, !tbaa !13
  %.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %26, i64 4
  %27 = load <2 x i32>, ptr %.sroa.5.0..sroa_idx, align 4, !tbaa !13
  %28 = tail call i32 @find(ptr noundef %11, i32 noundef %.sroa.0.0.copyload)
  %29 = extractelement <2 x i32> %27, i64 0
  %30 = tail call i32 @find(ptr noundef %11, i32 noundef %29)
  %.not = icmp eq i32 %28, %30
  br i1 %.not, label %35, label %31

31:                                               ; preds = %24
  %32 = add nsw i32 %.04049, 1
  %33 = sext i32 %.04049 to i64
  %34 = getelementptr inbounds [100 x %struct.Edge], ptr %2, i64 0, i64 %33
  store i32 %.sroa.0.0.copyload, ptr %34, align 4, !tbaa !13
  %.sroa.5.0..sroa_idx7 = getelementptr inbounds i8, ptr %34, i64 4
  store <2 x i32> %27, ptr %.sroa.5.0..sroa_idx7, align 4, !tbaa !13
  tail call void @Union(ptr noundef %11, i32 noundef %28, i32 noundef %30)
  br label %35

35:                                               ; preds = %31, %24
  %.1 = phi i32 [ %32, %31 ], [ %.04049, %24 ]
  %36 = icmp slt i32 %.1, %17
  br i1 %36, label %.lr.ph50, label %.critedge, !llvm.loop !22

.critedge.thread:                                 ; preds = %.preheader, %1
  %37 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str)
  br label %._crit_edge

.critedge:                                        ; preds = %.lr.ph50, %35
  %.040.lcssa = phi i32 [ %.04049, %.lr.ph50 ], [ %.1, %35 ]
  %38 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str)
  %39 = icmp sgt i32 %.040.lcssa, 0
  br i1 %39, label %.lr.ph55.preheader, label %._crit_edge

.lr.ph55.preheader:                               ; preds = %.critedge
  %wide.trip.count64 = zext nneg i32 %.040.lcssa to i64
  br label %.lr.ph55

.lr.ph55:                                         ; preds = %.lr.ph55.preheader, %.lr.ph55
  %indvars.iv61 = phi i64 [ 0, %.lr.ph55.preheader ], [ %indvars.iv.next62, %.lr.ph55 ]
  %.054 = phi i32 [ 0, %.lr.ph55.preheader ], [ %47, %.lr.ph55 ]
  %40 = getelementptr inbounds [100 x %struct.Edge], ptr %2, i64 0, i64 %indvars.iv61
  %41 = load i32, ptr %40, align 4, !tbaa !23
  %42 = getelementptr inbounds i8, ptr %40, i64 4
  %43 = load i32, ptr %42, align 4, !tbaa !25
  %44 = getelementptr inbounds i8, ptr %40, i64 8
  %45 = load i32, ptr %44, align 4, !tbaa !26
  %46 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %41, i32 noundef %43, i32 noundef %45)
  %47 = add nsw i32 %45, %.054
  %indvars.iv.next62 = add nuw nsw i64 %indvars.iv61, 1
  %exitcond65.not = icmp eq i64 %indvars.iv.next62, %wide.trip.count64
  br i1 %exitcond65.not, label %._crit_edge, label %.lr.ph55, !llvm.loop !27

._crit_edge:                                      ; preds = %.lr.ph55, %.critedge.thread, %.critedge
  %.0.lcssa = phi i32 [ 0, %.critedge ], [ 0, %.critedge.thread ], [ %47, %.lr.ph55 ]
  %48 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %.0.lcssa)
  tail call void @free(ptr noundef %11) #6
  call void @llvm.lifetime.end.p0(i64 1200, ptr nonnull %2) #6
  ret void
}

; Function Attrs: nofree
declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #3

; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) 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 = { 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 = { nofree "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 = { nofree 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 = { 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 #6 = { nounwind }
attributes #7 = { nounwind allocsize(0) }

!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 0}
!6 = !{!"Graph", !7, i64 0, !7, i64 4, !10, i64 8}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!6, !10, i64 8}
!12 = !{!6, !7, i64 4}
!13 = !{!7, !7, i64 0}
!14 = distinct !{!14, !15, !16, !17}
!15 = !{!"llvm.loop.mustprogress"}
!16 = !{!"llvm.loop.isvectorized", i32 1}
!17 = !{!"llvm.loop.unroll.runtime.disable"}
!18 = !{!19, !7, i64 0}
!19 = !{!"Subset", !7, i64 0, !7, i64 4}
!20 = !{!19, !7, i64 4}
!21 = distinct !{!21, !15, !17, !16}
!22 = distinct !{!22, !15}
!23 = !{!24, !7, i64 0}
!24 = !{!"Edge", !7, i64 0, !7, i64 4, !7, i64 8}
!25 = !{!24, !7, i64 4}
!26 = !{!24, !7, i64 8}
!27 = distinct !{!27, !15}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopLoadEliminationPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,LoopVectorizePass,PostOrderFunctionAttrsPass,ReassociatePass,SLPVectorizerPass,SROAPass,SimplifyCFGPass,TailCallElimPass