; LLVM IR from AlgoGenesis/C :: Mathematical Algorithms/Minimum Spanning Tree/Krushal'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

; 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 ptr, align 8
  %5 = alloca i64, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca %struct.Edge, 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) #7
  %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
  %16 = load i32, ptr %3, align 4, !tbaa !12
  %17 = zext i32 %16 to i64
  %18 = call ptr @llvm.stacksave.p0()
  store ptr %18, ptr %4, align 8
  %19 = alloca %struct.Edge, i64 %17, align 16
  store i64 %17, ptr %5, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #7
  store i32 0, ptr %6, align 4, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #7
  store i32 0, ptr %7, align 4, !tbaa !12
  %20 = load ptr, ptr %2, align 8, !tbaa !5
  %21 = getelementptr inbounds %struct.Graph, ptr %20, i32 0, i32 2
  %22 = load ptr, ptr %21, align 8, !tbaa !13
  %23 = load ptr, ptr %2, align 8, !tbaa !5
  %24 = getelementptr inbounds %struct.Graph, ptr %23, i32 0, i32 1
  %25 = load i32, ptr %24, align 4, !tbaa !14
  %26 = sext i32 %25 to i64
  call void @qsort(ptr noundef %22, i64 noundef %26, i64 noundef 12, ptr noundef @compareEdges)
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #7
  %27 = load i32, ptr %3, align 4, !tbaa !12
  %28 = sext i32 %27 to i64
  %29 = mul i64 %28, 8
  %30 = call noalias ptr @malloc(i64 noundef %29) #8
  store ptr %30, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #7
  store i32 0, ptr %9, align 4, !tbaa !12
  br label %31

31:                                               ; preds = %48, %1
  %32 = load i32, ptr %9, align 4, !tbaa !12
  %33 = load i32, ptr %3, align 4, !tbaa !12
  %34 = icmp slt i32 %32, %33
  br i1 %34, label %36, label %35

35:                                               ; preds = %31
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #7
  br label %51

36:                                               ; preds = %31
  %37 = load i32, ptr %9, align 4, !tbaa !12
  %38 = load ptr, ptr %8, align 8, !tbaa !5
  %39 = load i32, ptr %9, align 4, !tbaa !12
  %40 = sext i32 %39 to i64
  %41 = getelementptr inbounds %struct.subset, ptr %38, i64 %40
  %42 = getelementptr inbounds %struct.subset, ptr %41, i32 0, i32 0
  store i32 %37, ptr %42, align 4, !tbaa !15
  %43 = load ptr, ptr %8, align 8, !tbaa !5
  %44 = load i32, ptr %9, align 4, !tbaa !12
  %45 = sext i32 %44 to i64
  %46 = getelementptr inbounds %struct.subset, ptr %43, i64 %45
  %47 = getelementptr inbounds %struct.subset, ptr %46, i32 0, i32 1
  store i32 0, ptr %47, align 4, !tbaa !17
  br label %48

48:                                               ; preds = %36
  %49 = load i32, ptr %9, align 4, !tbaa !12
  %50 = add nsw i32 %49, 1
  store i32 %50, ptr %9, align 4, !tbaa !12
  br label %31, !llvm.loop !18

51:                                               ; preds = %35
  br label %52

52:                                               ; preds = %92, %51
  %53 = load i32, ptr %6, align 4, !tbaa !12
  %54 = load i32, ptr %3, align 4, !tbaa !12
  %55 = sub nsw i32 %54, 1
  %56 = icmp slt i32 %53, %55
  br i1 %56, label %57, label %63

57:                                               ; preds = %52
  %58 = load i32, ptr %7, align 4, !tbaa !12
  %59 = load ptr, ptr %2, align 8, !tbaa !5
  %60 = getelementptr inbounds %struct.Graph, ptr %59, i32 0, i32 1
  %61 = load i32, ptr %60, align 4, !tbaa !14
  %62 = icmp slt i32 %58, %61
  br label %63

63:                                               ; preds = %57, %52
  %64 = phi i1 [ false, %52 ], [ %62, %57 ]
  br i1 %64, label %65, label %93

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

84:                                               ; preds = %65
  %85 = load i32, ptr %6, align 4, !tbaa !12
  %86 = add nsw i32 %85, 1
  store i32 %86, ptr %6, align 4, !tbaa !12
  %87 = sext i32 %85 to i64
  %88 = getelementptr inbounds %struct.Edge, ptr %19, i64 %87
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %88, ptr align 4 %10, i64 12, i1 false), !tbaa.struct !20
  %89 = load ptr, ptr %8, align 8, !tbaa !5
  %90 = load i32, ptr %11, align 4, !tbaa !12
  %91 = load i32, ptr %12, align 4, !tbaa !12
  call void @Union(ptr noundef %89, i32 noundef %90, i32 noundef %91)
  br label %92

92:                                               ; preds = %84, %65
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr %10) #7
  br label %52, !llvm.loop !24

93:                                               ; preds = %63
  %94 = call i32 (ptr, ...) @printf(ptr noundef @.str)
  store i32 0, ptr %7, align 4, !tbaa !12
  br label %95

95:                                               ; preds = %116, %93
  %96 = load i32, ptr %7, align 4, !tbaa !12
  %97 = load i32, ptr %6, align 4, !tbaa !12
  %98 = icmp slt i32 %96, %97
  br i1 %98, label %99, label %119

99:                                               ; preds = %95
  %100 = load i32, ptr %7, align 4, !tbaa !12
  %101 = sext i32 %100 to i64
  %102 = getelementptr inbounds %struct.Edge, ptr %19, i64 %101
  %103 = getelementptr inbounds %struct.Edge, ptr %102, i32 0, i32 0
  %104 = load i32, ptr %103, align 4, !tbaa !21
  %105 = load i32, ptr %7, align 4, !tbaa !12
  %106 = sext i32 %105 to i64
  %107 = getelementptr inbounds %struct.Edge, ptr %19, i64 %106
  %108 = getelementptr inbounds %struct.Edge, ptr %107, i32 0, i32 1
  %109 = load i32, ptr %108, align 4, !tbaa !23
  %110 = load i32, ptr %7, align 4, !tbaa !12
  %111 = sext i32 %110 to i64
  %112 = getelementptr inbounds %struct.Edge, ptr %19, i64 %111
  %113 = getelementptr inbounds %struct.Edge, ptr %112, i32 0, i32 2
  %114 = load i32, ptr %113, align 4, !tbaa !25
  %115 = call i32 (ptr, ...) @printf(ptr noundef @.str.1, i32 noundef %104, i32 noundef %109, i32 noundef %114)
  br label %116

116:                                              ; preds = %99
  %117 = load i32, ptr %7, align 4, !tbaa !12
  %118 = add nsw i32 %117, 1
  store i32 %118, ptr %7, align 4, !tbaa !12
  br label %95, !llvm.loop !26

119:                                              ; preds = %95
  %120 = load ptr, ptr %8, align 8, !tbaa !5
  call void @free(ptr noundef %120) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #7
  %121 = load ptr, ptr %4, align 8
  call void @llvm.stackrestore.p0(ptr %121)
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #7
  ret void
}

; Function Attrs: nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #3

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

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

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

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

; Function Attrs: nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #3

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 = { nocallback nofree nosync nounwind willreturn }
attributes #4 = { "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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #6 = { 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 #7 = { nounwind }
attributes #8 = { 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

; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local i32 @find(ptr noundef, i32 noundef) local_unnamed_addr #1

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

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

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

.lr.ph.preheader:                                 ; preds = %1
  %min.iters.check = icmp ult i32 %2, 4
  br i1 %min.iters.check, label %.lr.ph.preheader66, label %vector.ph

.lr.ph.preheader66:                               ; 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 %3, 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>
  %14 = or disjoint i64 %index, 2
  %15 = getelementptr inbounds %struct.subset, ptr %12, i64 %index
  %16 = getelementptr inbounds %struct.subset, ptr %12, i64 %14
  %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 %15, align 4, !tbaa !13
  %interleaved.vec65 = 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.vec65, ptr %16, align 4, !tbaa !13
  %index.next = add nuw i64 %index, 4
  %vec.ind.next = add <2 x i32> %vec.ind, <i32 4, i32 4>
  %17 = icmp eq i64 %index.next, %n.vec
  br i1 %17, label %middle.block, label %vector.body, !llvm.loop !14

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %n.vec, %3
  br i1 %cmp.n, label %.preheader, label %.lr.ph.preheader66

.preheader:                                       ; preds = %.lr.ph, %middle.block
  %18 = add nsw i32 %2, -1
  %.not63 = icmp eq i32 %2, 1
  br i1 %.not63, label %.critedge.thread, label %.lr.ph48

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

.lr.ph48:                                         ; preds = %.preheader, %36
  %indvars.iv54 = phi i64 [ %indvars.iv.next55, %36 ], [ 0, %.preheader ]
  %.047 = phi i32 [ %.1, %36 ], [ 0, %.preheader ]
  %22 = load i32, ptr %7, align 4, !tbaa !12
  %23 = sext i32 %22 to i64
  %24 = icmp slt i64 %indvars.iv54, %23
  br i1 %24, label %25, label %.critedge

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

32:                                               ; preds = %25
  %33 = add nsw i32 %.047, 1
  %34 = sext i32 %.047 to i64
  %35 = getelementptr inbounds %struct.Edge, ptr %4, i64 %34
  store i32 %.sroa.0.0.copyload, ptr %35, align 4, !tbaa !13
  %.sroa.5.0..sroa_idx5 = getelementptr inbounds i8, ptr %35, i64 4
  store <2 x i32> %28, ptr %.sroa.5.0..sroa_idx5, align 4, !tbaa !13
  tail call void @Union(ptr noundef %12, i32 noundef %29, i32 noundef %31)
  br label %36

36:                                               ; preds = %32, %25
  %.1 = phi i32 [ %33, %32 ], [ %.047, %25 ]
  %37 = icmp slt i32 %.1, %18
  br i1 %37, label %.lr.ph48, label %.critedge, !llvm.loop !22

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

.critedge:                                        ; preds = %.lr.ph48, %36
  %.0.lcssa = phi i32 [ %.047, %.lr.ph48 ], [ %.1, %36 ]
  %39 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str)
  %40 = icmp sgt i32 %.0.lcssa, 0
  br i1 %40, label %.lr.ph52.preheader, label %._crit_edge

.lr.ph52.preheader:                               ; preds = %.critedge
  %wide.trip.count60 = zext nneg i32 %.0.lcssa to i64
  br label %.lr.ph52

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

._crit_edge:                                      ; preds = %.lr.ph52, %.critedge.thread, %.critedge
  tail call void @free(ptr noundef %12) #5
  ret void
}

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

; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) 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

attributes #0 = { 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 #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 = { 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 #3 = { 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 #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 }
attributes #6 = { 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,JumpThreadingPass,LCSSAPass,LICMPass,LoopLoadEliminationPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,LoopVectorizePass,PostOrderFunctionAttrsPass,SLPVectorizerPass,SROAPass,SimplifyCFGPass,TailCallElimPass