; LLVM IR from ritikbanger/Hacktoberfest2022-DSA :: 17. Graph (Kruskal's Algo)

; 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 [30 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [49 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [32 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 i32 @Union(ptr noundef, i32 noundef, i32 noundef) #2

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

35:                                               ; preds = %54, %1
  %36 = load i32, ptr %10, align 4, !tbaa !12
  %37 = load i32, ptr %3, align 4, !tbaa !12
  %38 = icmp slt i32 %36, %37
  br i1 %38, label %39, label %57

39:                                               ; preds = %35
  %40 = load i32, ptr %10, align 4, !tbaa !12
  %41 = load ptr, ptr %9, align 8, !tbaa !5
  %42 = load i32, ptr %10, align 4, !tbaa !12
  %43 = sext i32 %42 to i64
  %44 = getelementptr inbounds %struct.Subset, ptr %41, i64 %43
  %45 = getelementptr inbounds %struct.Subset, ptr %44, i32 0, i32 0
  store i32 %40, ptr %45, align 4, !tbaa !15
  %46 = load i32, ptr %10, align 4, !tbaa !12
  %47 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, i32 noundef %46)
  %48 = load ptr, ptr %9, align 8, !tbaa !5
  %49 = load i32, ptr %10, align 4, !tbaa !12
  %50 = sext i32 %49 to i64
  %51 = getelementptr inbounds %struct.Subset, ptr %48, i64 %50
  %52 = getelementptr inbounds %struct.Subset, ptr %51, i32 0, i32 1
  store i32 0, ptr %52, align 4, !tbaa !17
  %53 = call i32 (ptr, ...) @printf(ptr noundef @.str.3)
  br label %54

54:                                               ; preds = %39
  %55 = load i32, ptr %10, align 4, !tbaa !12
  %56 = add nsw i32 %55, 1
  store i32 %56, ptr %10, align 4, !tbaa !12
  br label %35, !llvm.loop !18

57:                                               ; preds = %35
  %58 = call i32 (ptr, ...) @printf(ptr noundef @.str.4)
  br label %59

59:                                               ; preds = %115, %57
  %60 = load i32, ptr %6, align 4, !tbaa !12
  %61 = load i32, ptr %3, align 4, !tbaa !12
  %62 = sub nsw i32 %61, 1
  %63 = icmp slt i32 %60, %62
  br i1 %63, label %64, label %70

64:                                               ; preds = %59
  %65 = load i32, ptr %7, align 4, !tbaa !12
  %66 = load ptr, ptr %2, align 8, !tbaa !5
  %67 = getelementptr inbounds %struct.Graph, ptr %66, i32 0, i32 1
  %68 = load i32, ptr %67, align 4, !tbaa !14
  %69 = icmp slt i32 %65, %68
  br label %70

70:                                               ; preds = %64, %59
  %71 = phi i1 [ false, %59 ], [ %69, %64 ]
  br i1 %71, label %72, label %116

72:                                               ; preds = %70
  call void @llvm.lifetime.start.p0(i64 12, ptr %11) #6
  %73 = load ptr, ptr %2, align 8, !tbaa !5
  %74 = getelementptr inbounds %struct.Graph, ptr %73, i32 0, i32 2
  %75 = load ptr, ptr %74, align 8, !tbaa !13
  %76 = load i32, ptr %7, align 4, !tbaa !12
  %77 = add nsw i32 %76, 1
  store i32 %77, ptr %7, align 4, !tbaa !12
  %78 = sext i32 %76 to i64
  %79 = getelementptr inbounds %struct.Edge, ptr %75, i64 %78
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %11, ptr align 4 %79, i64 12, i1 false), !tbaa.struct !20
  %80 = getelementptr inbounds %struct.Edge, ptr %11, i32 0, i32 0
  %81 = load i32, ptr %80, align 4, !tbaa !21
  %82 = getelementptr inbounds %struct.Edge, ptr %11, i32 0, i32 1
  %83 = load i32, ptr %82, align 4, !tbaa !23
  %84 = call i32 (ptr, ...) @printf(ptr noundef @.str.5, i32 noundef %81, i32 noundef %83)
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  %85 = load ptr, ptr %9, align 8, !tbaa !5
  %86 = getelementptr inbounds %struct.Edge, ptr %11, i32 0, i32 0
  %87 = load i32, ptr %86, align 4, !tbaa !21
  %88 = call i32 @find(ptr noundef %85, i32 noundef %87)
  store i32 %88, ptr %12, align 4, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  %89 = load ptr, ptr %9, align 8, !tbaa !5
  %90 = getelementptr inbounds %struct.Edge, ptr %11, i32 0, i32 1
  %91 = load i32, ptr %90, align 4, !tbaa !23
  %92 = call i32 @find(ptr noundef %89, i32 noundef %91)
  store i32 %92, ptr %13, align 4, !tbaa !12
  %93 = load i32, ptr %12, align 4, !tbaa !12
  %94 = load i32, ptr %13, align 4, !tbaa !12
  %95 = icmp ne i32 %93, %94
  br i1 %95, label %96, label %113

96:                                               ; preds = %72
  %97 = load i32, ptr %6, align 4, !tbaa !12
  %98 = add nsw i32 %97, 1
  store i32 %98, ptr %6, align 4, !tbaa !12
  %99 = sext i32 %97 to i64
  %100 = getelementptr inbounds %struct.Edge, ptr %21, i64 %99
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %100, ptr align 4 %11, i64 12, i1 false), !tbaa.struct !20
  %101 = load ptr, ptr %9, align 8, !tbaa !5
  %102 = load i32, ptr %12, align 4, !tbaa !12
  %103 = load i32, ptr %13, align 4, !tbaa !12
  %104 = call i32 @Union(ptr noundef %101, i32 noundef %102, i32 noundef %103)
  store i32 %104, ptr %8, align 4, !tbaa !12
  %105 = load i32, ptr %8, align 4, !tbaa !12
  %106 = load ptr, ptr %9, align 8, !tbaa !5
  %107 = load i32, ptr %8, align 4, !tbaa !12
  %108 = sext i32 %107 to i64
  %109 = getelementptr inbounds %struct.Subset, ptr %106, i64 %108
  %110 = getelementptr inbounds %struct.Subset, ptr %109, i32 0, i32 1
  %111 = load i32, ptr %110, align 4, !tbaa !17
  %112 = call i32 (ptr, ...) @printf(ptr noundef @.str.6, i32 noundef %105, i32 noundef %111)
  br label %115

113:                                              ; preds = %72
  %114 = call i32 (ptr, ...) @printf(ptr noundef @.str.7)
  br label %115

115:                                              ; preds = %113, %96
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 12, ptr %11) #6
  br label %59, !llvm.loop !24

116:                                              ; preds = %70
  %117 = call i32 (ptr, ...) @printf(ptr noundef @.str.8)
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #6
  store i32 0, ptr %14, align 4, !tbaa !12
  store i32 0, ptr %7, align 4, !tbaa !12
  br label %118

118:                                              ; preds = %146, %116
  %119 = load i32, ptr %7, align 4, !tbaa !12
  %120 = load i32, ptr %6, align 4, !tbaa !12
  %121 = icmp slt i32 %119, %120
  br i1 %121, label %122, label %149

122:                                              ; preds = %118
  %123 = load i32, ptr %7, align 4, !tbaa !12
  %124 = sext i32 %123 to i64
  %125 = getelementptr inbounds %struct.Edge, ptr %21, i64 %124
  %126 = getelementptr inbounds %struct.Edge, ptr %125, i32 0, i32 0
  %127 = load i32, ptr %126, align 4, !tbaa !21
  %128 = load i32, ptr %7, align 4, !tbaa !12
  %129 = sext i32 %128 to i64
  %130 = getelementptr inbounds %struct.Edge, ptr %21, i64 %129
  %131 = getelementptr inbounds %struct.Edge, ptr %130, i32 0, i32 1
  %132 = load i32, ptr %131, align 4, !tbaa !23
  %133 = load i32, ptr %7, align 4, !tbaa !12
  %134 = sext i32 %133 to i64
  %135 = getelementptr inbounds %struct.Edge, ptr %21, i64 %134
  %136 = getelementptr inbounds %struct.Edge, ptr %135, i32 0, i32 2
  %137 = load i32, ptr %136, align 4, !tbaa !25
  %138 = call i32 (ptr, ...) @printf(ptr noundef @.str.9, i32 noundef %127, i32 noundef %132, i32 noundef %137)
  %139 = load i32, ptr %7, align 4, !tbaa !12
  %140 = sext i32 %139 to i64
  %141 = getelementptr inbounds %struct.Edge, ptr %21, i64 %140
  %142 = getelementptr inbounds %struct.Edge, ptr %141, i32 0, i32 2
  %143 = load i32, ptr %142, align 4, !tbaa !25
  %144 = load i32, ptr %14, align 4, !tbaa !12
  %145 = add nsw i32 %144, %143
  store i32 %145, ptr %14, align 4, !tbaa !12
  br label %146

146:                                              ; preds = %122
  %147 = load i32, ptr %7, align 4, !tbaa !12
  %148 = add nsw i32 %147, 1
  store i32 %148, ptr %7, align 4, !tbaa !12
  br label %118, !llvm.loop !26

149:                                              ; preds = %118
  %150 = load i32, ptr %14, align 4, !tbaa !12
  %151 = call i32 (ptr, ...) @printf(ptr noundef @.str.10, i32 noundef %150)
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  %152 = load ptr, ptr %4, align 8
  call void @llvm.stackrestore.p0(ptr %152)
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #6
  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

declare i32 @printf(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

; 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 }
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 [30 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [49 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [32 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 i32 @Union(ptr noundef, i32 noundef, i32 noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare dso_local i32 @myComp(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 @myComp) #4
  %10 = sext i32 %2 to i64
  %11 = shl nsw i64 %10, 3
  %12 = tail call noalias ptr @malloc(i64 noundef %11) #5
  %13 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str)
  %14 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1)
  %15 = icmp sgt i32 %2, 0
  br i1 %15, label %.lr.ph, label %._crit_edge.thread

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

.lr.ph:                                           ; preds = %1, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %1 ]
  %17 = getelementptr inbounds %struct.Subset, ptr %12, i64 %indvars.iv
  %18 = trunc nuw nsw i64 %indvars.iv to i32
  store i32 %18, ptr %17, align 4, !tbaa !13
  %19 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %18)
  %20 = getelementptr inbounds i8, ptr %17, i64 4
  store i32 0, ptr %20, align 4, !tbaa !15
  %21 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %3
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph, !llvm.loop !16

._crit_edge:                                      ; preds = %.lr.ph
  %22 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4)
  %23 = add nsw i32 %2, -1
  %.not76 = icmp eq i32 %2, 1
  br i1 %.not76, label %.critedge.thread, label %.lr.ph58

.lr.ph58:                                         ; preds = %._crit_edge, %46
  %indvars.iv67 = phi i64 [ %indvars.iv.next68, %46 ], [ 0, %._crit_edge ]
  %.04756 = phi i32 [ %.1, %46 ], [ 0, %._crit_edge ]
  %24 = load i32, ptr %7, align 4, !tbaa !12
  %25 = sext i32 %24 to i64
  %26 = icmp slt i64 %indvars.iv67, %25
  br i1 %26, label %27, label %.critedge

27:                                               ; preds = %.lr.ph58
  %28 = load ptr, ptr %5, align 8, !tbaa !11
  %indvars.iv.next68 = add nuw nsw i64 %indvars.iv67, 1
  %29 = getelementptr inbounds %struct.Edge, ptr %28, i64 %indvars.iv67
  %.sroa.0.0.copyload = load i32, ptr %29, align 4, !tbaa !18
  %.sroa.6.0..sroa_idx = getelementptr inbounds i8, ptr %29, i64 4
  %30 = load <2 x i32>, ptr %.sroa.6.0..sroa_idx, align 4, !tbaa !18
  %31 = extractelement <2 x i32> %30, i64 0
  %32 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef %.sroa.0.0.copyload, i32 noundef %31)
  %33 = tail call i32 @find(ptr noundef %12, i32 noundef %.sroa.0.0.copyload)
  %34 = tail call i32 @find(ptr noundef %12, i32 noundef %31)
  %.not = icmp eq i32 %33, %34
  br i1 %.not, label %44, label %35

35:                                               ; preds = %27
  %36 = add nsw i32 %.04756, 1
  %37 = sext i32 %.04756 to i64
  %38 = getelementptr inbounds %struct.Edge, ptr %4, i64 %37
  store i32 %.sroa.0.0.copyload, ptr %38, align 4, !tbaa !18
  %.sroa.6.0..sroa_idx8 = getelementptr inbounds i8, ptr %38, i64 4
  store <2 x i32> %30, ptr %.sroa.6.0..sroa_idx8, align 4, !tbaa !18
  %39 = tail call i32 @Union(ptr noundef %12, i32 noundef %33, i32 noundef %34)
  %40 = sext i32 %39 to i64
  %41 = getelementptr inbounds %struct.Subset, ptr %12, i64 %40, i32 1
  %42 = load i32, ptr %41, align 4, !tbaa !15
  %43 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.6, i32 noundef %39, i32 noundef %42)
  br label %46

44:                                               ; preds = %27
  %45 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.7)
  br label %46

46:                                               ; preds = %44, %35
  %.1 = phi i32 [ %36, %35 ], [ %.04756, %44 ]
  %47 = icmp slt i32 %.1, %23
  br i1 %47, label %.lr.ph58, label %.critedge, !llvm.loop !19

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

.critedge:                                        ; preds = %.lr.ph58, %46
  %.047.lcssa = phi i32 [ %.04756, %.lr.ph58 ], [ %.1, %46 ]
  %49 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.8)
  %50 = icmp sgt i32 %.047.lcssa, 0
  br i1 %50, label %.lr.ph63.preheader, label %._crit_edge64

.lr.ph63.preheader:                               ; preds = %.critedge
  %wide.trip.count73 = zext nneg i32 %.047.lcssa to i64
  br label %.lr.ph63

.lr.ph63:                                         ; preds = %.lr.ph63.preheader, %.lr.ph63
  %indvars.iv70 = phi i64 [ 0, %.lr.ph63.preheader ], [ %indvars.iv.next71, %.lr.ph63 ]
  %.062 = phi i32 [ 0, %.lr.ph63.preheader ], [ %58, %.lr.ph63 ]
  %51 = getelementptr inbounds %struct.Edge, ptr %4, i64 %indvars.iv70
  %52 = load i32, ptr %51, align 4, !tbaa !20
  %53 = getelementptr inbounds i8, ptr %51, i64 4
  %54 = load i32, ptr %53, align 4, !tbaa !22
  %55 = getelementptr inbounds i8, ptr %51, i64 8
  %56 = load i32, ptr %55, align 4, !tbaa !23
  %57 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.9, i32 noundef %52, i32 noundef %54, i32 noundef %56)
  %58 = add nsw i32 %56, %.062
  %indvars.iv.next71 = add nuw nsw i64 %indvars.iv70, 1
  %exitcond74.not = icmp eq i64 %indvars.iv.next71, %wide.trip.count73
  br i1 %exitcond74.not, label %._crit_edge64, label %.lr.ph63, !llvm.loop !24

._crit_edge64:                                    ; preds = %.lr.ph63, %.critedge.thread, %.critedge
  %.0.lcssa = phi i32 [ 0, %.critedge ], [ 0, %.critedge.thread ], [ %58, %.lr.ph63 ]
  %59 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.10, i32 noundef %.0.lcssa)
  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

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 = { nounwind }
attributes #5 = { 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 = !{!14, !7, i64 0}
!14 = !{!"Subset", !7, i64 0, !7, i64 4}
!15 = !{!14, !7, i64 4}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.mustprogress"}
!18 = !{!7, !7, i64 0}
!19 = distinct !{!19, !17}
!20 = !{!21, !7, i64 0}
!21 = !{!"Edge", !7, i64 0, !7, i64 4, !7, i64 8}
!22 = !{!21, !7, i64 4}
!23 = !{!21, !7, i64 8}
!24 = distinct !{!24, !17}


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