; LLVM IR from Dev-XYS/Algorithms :: Tarjan(Strongly-Connected-Components) (main)

; 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.vertex = type { i32, i32, i32, i32, i8 }
%struct.res = type { %"class.std::vector" }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }

@V = external dso_local global [100010 x %struct.vertex], align 16
@R = external dso_local global ptr, align 8
@ivc = external dso_local global i32, align 4
@iec = external dso_local global i32, align 4
@col = external dso_local global i32, align 4
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [2 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z8add_edgeii(i32 noundef, i32 noundef) #0

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z3DFSi(i32 noundef) #1

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_Z8_res_cmp3resS_(ptr noundef, ptr noundef) #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #0 align 2

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #3 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #9
  %10 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @ivc, ptr noundef @iec)
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #9
  store i32 0, ptr %4, align 4, !tbaa !5
  br label %11

11:                                               ; preds = %20, %0
  %12 = load i32, ptr %4, align 4, !tbaa !5
  %13 = load i32, ptr @iec, align 4, !tbaa !5
  %14 = icmp slt i32 %12, %13
  br i1 %14, label %16, label %15

15:                                               ; preds = %11
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #9
  br label %23

16:                                               ; preds = %11
  %17 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %2, ptr noundef %3)
  %18 = load i32, ptr %2, align 4, !tbaa !5
  %19 = load i32, ptr %3, align 4, !tbaa !5
  call void @_Z8add_edgeii(i32 noundef %18, i32 noundef %19)
  br label %20

20:                                               ; preds = %16
  %21 = load i32, ptr %4, align 4, !tbaa !5
  %22 = add nsw i32 %21, 1
  store i32 %22, ptr %4, align 4, !tbaa !5
  br label %11, !llvm.loop !9

23:                                               ; preds = %15
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #9
  store i32 1, ptr %5, align 4, !tbaa !5
  br label %24

24:                                               ; preds = %39, %23
  %25 = load i32, ptr %5, align 4, !tbaa !5
  %26 = load i32, ptr @ivc, align 4, !tbaa !5
  %27 = icmp sle i32 %25, %26
  br i1 %27, label %29, label %28

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

29:                                               ; preds = %24
  %30 = load i32, ptr %5, align 4, !tbaa !5
  %31 = sext i32 %30 to i64
  %32 = getelementptr inbounds [100010 x %struct.vertex], ptr @V, i64 0, i64 %31
  %33 = getelementptr inbounds %struct.vertex, ptr %32, i32 0, i32 1
  %34 = load i32, ptr %33, align 4, !tbaa !11
  %35 = icmp eq i32 %34, 0
  br i1 %35, label %36, label %38

36:                                               ; preds = %29
  %37 = load i32, ptr %5, align 4, !tbaa !5
  call void @_Z3DFSi(i32 noundef %37)
  br label %38

38:                                               ; preds = %36, %29
  br label %39

39:                                               ; preds = %38
  %40 = load i32, ptr %5, align 4, !tbaa !5
  %41 = add nsw i32 %40, 1
  store i32 %41, ptr %5, align 4, !tbaa !5
  br label %24, !llvm.loop !14

42:                                               ; preds = %28
  %43 = load i32, ptr @col, align 4, !tbaa !5
  %44 = add nsw i32 %43, 1
  %45 = sext i32 %44 to i64
  %46 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %45, i64 24)
  %47 = extractvalue { i64, i1 } %46, 1
  %48 = extractvalue { i64, i1 } %46, 0
  %49 = call { i64, i1 } @llvm.uadd.with.overflow.i64(i64 %48, i64 8)
  %50 = extractvalue { i64, i1 } %49, 1
  %51 = or i1 %47, %50
  %52 = extractvalue { i64, i1 } %49, 0
  %53 = select i1 %51, i64 -1, i64 %52
  %54 = call noalias noundef nonnull ptr @_Znam(i64 noundef %53) #10
  store i64 %45, ptr %54, align 16
  %55 = getelementptr inbounds i8, ptr %54, i64 8
  %56 = icmp eq i64 %45, 0
  br i1 %56, label %63, label %57

57:                                               ; preds = %42
  %58 = getelementptr inbounds %struct.res, ptr %55, i64 %45
  br label %59

59:                                               ; preds = %59, %57
  %60 = phi ptr [ %55, %57 ], [ %61, %59 ]
  call void @_ZN3resC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %60) #9
  %61 = getelementptr inbounds %struct.res, ptr %60, i64 1
  %62 = icmp eq ptr %61, %58
  br i1 %62, label %63, label %59

63:                                               ; preds = %59, %42
  store ptr %55, ptr @R, align 8, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #9
  store i32 1, ptr %6, align 4, !tbaa !5
  br label %64

64:                                               ; preds = %79, %63
  %65 = load i32, ptr %6, align 4, !tbaa !5
  %66 = load i32, ptr @ivc, align 4, !tbaa !5
  %67 = icmp sle i32 %65, %66
  br i1 %67, label %69, label %68

68:                                               ; preds = %64
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #9
  br label %82

69:                                               ; preds = %64
  %70 = load ptr, ptr @R, align 8, !tbaa !15
  %71 = load i32, ptr %6, align 4, !tbaa !5
  %72 = sext i32 %71 to i64
  %73 = getelementptr inbounds [100010 x %struct.vertex], ptr @V, i64 0, i64 %72
  %74 = getelementptr inbounds %struct.vertex, ptr %73, i32 0, i32 3
  %75 = load i32, ptr %74, align 4, !tbaa !17
  %76 = sext i32 %75 to i64
  %77 = getelementptr inbounds %struct.res, ptr %70, i64 %76
  %78 = getelementptr inbounds %struct.res, ptr %77, i32 0, i32 0
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %78, ptr noundef nonnull align 4 dereferenceable(4) %6)
  br label %79

79:                                               ; preds = %69
  %80 = load i32, ptr %6, align 4, !tbaa !5
  %81 = add nsw i32 %80, 1
  store i32 %81, ptr %6, align 4, !tbaa !5
  br label %64, !llvm.loop !18

82:                                               ; preds = %68
  %83 = load ptr, ptr @R, align 8, !tbaa !15
  %84 = getelementptr inbounds %struct.res, ptr %83, i64 1
  %85 = load ptr, ptr @R, align 8, !tbaa !15
  %86 = load i32, ptr @col, align 4, !tbaa !5
  %87 = sext i32 %86 to i64
  %88 = getelementptr inbounds %struct.res, ptr %85, i64 %87
  call void @_ZSt4sortIP3resPFbS0_S0_EEvT_S4_T0_(ptr noundef %84, ptr noundef %88, ptr noundef @_Z8_res_cmp3resS_)
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #9
  store i32 1, ptr %7, align 4, !tbaa !5
  br label %89

89:                                               ; preds = %130, %82
  %90 = load i32, ptr %7, align 4, !tbaa !5
  %91 = load i32, ptr @col, align 4, !tbaa !5
  %92 = icmp slt i32 %90, %91
  br i1 %92, label %94, label %93

93:                                               ; preds = %89
  store i32 11, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #9
  br label %133

94:                                               ; preds = %89
  %95 = load ptr, ptr @R, align 8, !tbaa !15
  %96 = load i32, ptr %7, align 4, !tbaa !5
  %97 = sext i32 %96 to i64
  %98 = getelementptr inbounds %struct.res, ptr %95, i64 %97
  %99 = getelementptr inbounds %struct.res, ptr %98, i32 0, i32 0
  %100 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %99, i64 noundef 0) #9
  %101 = load i32, ptr %100, align 4, !tbaa !5
  %102 = call i32 (ptr, ...) @printf(ptr noundef @.str.1, i32 noundef %101)
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #9
  store i32 1, ptr %9, align 4, !tbaa !5
  br label %103

103:                                              ; preds = %125, %94
  %104 = load i32, ptr %9, align 4, !tbaa !5
  %105 = sext i32 %104 to i64
  %106 = load ptr, ptr @R, align 8, !tbaa !15
  %107 = load i32, ptr %7, align 4, !tbaa !5
  %108 = sext i32 %107 to i64
  %109 = getelementptr inbounds %struct.res, ptr %106, i64 %108
  %110 = getelementptr inbounds %struct.res, ptr %109, i32 0, i32 0
  %111 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %110) #9
  %112 = icmp ult i64 %105, %111
  br i1 %112, label %114, label %113

113:                                              ; preds = %103
  store i32 14, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #9
  br label %128

114:                                              ; preds = %103
  %115 = load ptr, ptr @R, align 8, !tbaa !15
  %116 = load i32, ptr %7, align 4, !tbaa !5
  %117 = sext i32 %116 to i64
  %118 = getelementptr inbounds %struct.res, ptr %115, i64 %117
  %119 = getelementptr inbounds %struct.res, ptr %118, i32 0, i32 0
  %120 = load i32, ptr %9, align 4, !tbaa !5
  %121 = sext i32 %120 to i64
  %122 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %119, i64 noundef %121) #9
  %123 = load i32, ptr %122, align 4, !tbaa !5
  %124 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, i32 noundef %123)
  br label %125

125:                                              ; preds = %114
  %126 = load i32, ptr %9, align 4, !tbaa !5
  %127 = add nsw i32 %126, 1
  store i32 %127, ptr %9, align 4, !tbaa !5
  br label %103, !llvm.loop !19

128:                                              ; preds = %113
  %129 = call i32 (ptr, ...) @printf(ptr noundef @.str.3)
  br label %130

130:                                              ; preds = %128
  %131 = load i32, ptr %7, align 4, !tbaa !5
  %132 = add nsw i32 %131, 1
  store i32 %132, ptr %7, align 4, !tbaa !5
  br label %89, !llvm.loop !20

133:                                              ; preds = %93
  store i32 0, ptr %1, align 4
  store i32 1, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #9
  %134 = load i32, ptr %1, align 4
  ret i32 %134
}

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare { i64, i1 } @llvm.umul.with.overflow.i64(i64, i64) #5

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare { i64, i1 } @llvm.uadd.with.overflow.i64(i64, i64) #5

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znam(i64 noundef) #6

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN3resC2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #7 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(4)) #1 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIP3resPFbS0_S0_EEvT_S4_T0_(ptr noundef, ptr noundef, ptr noundef) #8

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) #0 align 2

attributes #0 = { mustprogress 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 #1 = { mustprogress 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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { mustprogress norecurse 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 = { "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 nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { nobuiltin 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 #7 = { inlinehint mustprogress 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 #8 = { inlinehint mustprogress 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 #9 = { nounwind }
attributes #10 = { builtin 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!12, !6, i64 4}
!12 = !{!"_ZTS6vertex", !6, i64 0, !6, i64 4, !6, i64 8, !6, i64 12, !13, i64 16}
!13 = !{!"bool", !7, i64 0}
!14 = distinct !{!14, !10}
!15 = !{!16, !16, i64 0}
!16 = !{!"any pointer", !7, i64 0}
!17 = !{!12, !6, i64 12}
!18 = distinct !{!18, !10}
!19 = distinct !{!19, !10}
!20 = distinct !{!20, !10}


; 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.vertex = type { i32, i32, i32, i32, i8 }
%struct.res = type { %"class.std::vector" }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }

@V = external dso_local local_unnamed_addr global [100010 x %struct.vertex], align 16
@R = external dso_local local_unnamed_addr global ptr, align 8
@ivc = external dso_local global i32, align 4
@iec = external dso_local global i32, align 4
@col = external dso_local local_unnamed_addr global i32, align 4
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [2 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z8add_edgeii(i32 noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z3DFSi(i32 noundef) local_unnamed_addr #1

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_Z8_res_cmp3resS_(ptr noundef, ptr noundef) #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #3 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #9
  %4 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @ivc, ptr noundef nonnull @iec)
  %5 = load i32, ptr @iec, align 4, !tbaa !5
  %6 = icmp sgt i32 %5, 0
  br i1 %6, label %.lr.ph, label %.preheader

.preheader:                                       ; preds = %.lr.ph, %0
  %7 = load i32, ptr @ivc, align 4, !tbaa !5
  %.not23 = icmp slt i32 %7, 1
  br i1 %.not23, label %._crit_edge, label %.lr.ph25

.lr.ph:                                           ; preds = %0, %.lr.ph
  %.01722 = phi i32 [ %11, %.lr.ph ], [ 0, %0 ]
  %8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %1, ptr noundef nonnull %2)
  %9 = load i32, ptr %1, align 4, !tbaa !5
  %10 = load i32, ptr %2, align 4, !tbaa !5
  call void @_Z8add_edgeii(i32 noundef %9, i32 noundef %10)
  %11 = add nuw nsw i32 %.01722, 1
  %12 = load i32, ptr @iec, align 4, !tbaa !5
  %13 = icmp slt i32 %11, %12
  br i1 %13, label %.lr.ph, label %.preheader, !llvm.loop !9

._crit_edge:                                      ; preds = %35, %.preheader
  %14 = phi i32 [ %7, %.preheader ], [ %36, %35 ]
  %15 = load i32, ptr @col, align 4, !tbaa !5
  %16 = add nsw i32 %15, 1
  %17 = sext i32 %16 to i64
  %18 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %17, i64 24)
  %19 = extractvalue { i64, i1 } %18, 1
  %20 = extractvalue { i64, i1 } %18, 0
  %21 = call { i64, i1 } @llvm.uadd.with.overflow.i64(i64 %20, i64 8)
  %22 = extractvalue { i64, i1 } %21, 1
  %23 = or i1 %19, %22
  %24 = extractvalue { i64, i1 } %21, 0
  %25 = select i1 %23, i64 -1, i64 %24
  %26 = call noalias noundef nonnull ptr @_Znam(i64 noundef %25) #10
  store i64 %17, ptr %26, align 16
  %27 = getelementptr inbounds i8, ptr %26, i64 8
  %28 = icmp eq i32 %16, 0
  br i1 %28, label %.loopexit, label %38

.lr.ph25:                                         ; preds = %.preheader, %35
  %29 = phi i32 [ %36, %35 ], [ %7, %.preheader ]
  %indvars.iv = phi i64 [ %indvars.iv.next, %35 ], [ 1, %.preheader ]
  %30 = getelementptr inbounds [100010 x %struct.vertex], ptr @V, i64 0, i64 %indvars.iv, i32 1
  %31 = load i32, ptr %30, align 4, !tbaa !11
  %32 = icmp eq i32 %31, 0
  br i1 %32, label %33, label %35

33:                                               ; preds = %.lr.ph25
  %34 = trunc nuw nsw i64 %indvars.iv to i32
  call void @_Z3DFSi(i32 noundef %34)
  %.pre = load i32, ptr @ivc, align 4, !tbaa !5
  br label %35

35:                                               ; preds = %.lr.ph25, %33
  %36 = phi i32 [ %29, %.lr.ph25 ], [ %.pre, %33 ]
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %37 = sext i32 %36 to i64
  %.not.not = icmp slt i64 %indvars.iv, %37
  br i1 %.not.not, label %.lr.ph25, label %._crit_edge, !llvm.loop !14

38:                                               ; preds = %._crit_edge
  %39 = getelementptr inbounds %struct.res, ptr %27, i64 %17
  br label %40

40:                                               ; preds = %40, %38
  %41 = phi ptr [ %27, %38 ], [ %42, %40 ]
  call void @_ZN3resC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %41) #9
  %42 = getelementptr inbounds i8, ptr %41, i64 24
  %43 = icmp eq ptr %42, %39
  br i1 %43, label %.loopexit.loopexit, label %40

.loopexit.loopexit:                               ; preds = %40
  %.pre46 = load i32, ptr @ivc, align 4, !tbaa !5
  br label %.loopexit

.loopexit:                                        ; preds = %.loopexit.loopexit, %._crit_edge
  %44 = phi i32 [ %.pre46, %.loopexit.loopexit ], [ %14, %._crit_edge ]
  store ptr %27, ptr @R, align 8, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #9
  store i32 1, ptr %3, align 4, !tbaa !5
  %.not2126 = icmp slt i32 %44, 1
  br i1 %.not2126, label %._crit_edge30, label %.lr.ph29

._crit_edge30.loopexit:                           ; preds = %.lr.ph29
  %.pre47 = load ptr, ptr @R, align 8, !tbaa !15
  br label %._crit_edge30

._crit_edge30:                                    ; preds = %._crit_edge30.loopexit, %.loopexit
  %45 = phi ptr [ %.pre47, %._crit_edge30.loopexit ], [ %27, %.loopexit ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #9
  %46 = getelementptr inbounds i8, ptr %45, i64 24
  %47 = load i32, ptr @col, align 4, !tbaa !5
  %48 = sext i32 %47 to i64
  %49 = getelementptr inbounds %struct.res, ptr %45, i64 %48
  call void @_ZSt4sortIP3resPFbS0_S0_EEvT_S4_T0_(ptr noundef nonnull %46, ptr noundef %49, ptr noundef nonnull @_Z8_res_cmp3resS_)
  %50 = load i32, ptr @col, align 4, !tbaa !5
  %51 = icmp sgt i32 %50, 1
  br i1 %51, label %.lr.ph37, label %._crit_edge38

.lr.ph29:                                         ; preds = %.loopexit, %.lr.ph29
  %storemerge27 = phi i32 [ %59, %.lr.ph29 ], [ 1, %.loopexit ]
  %52 = load ptr, ptr @R, align 8, !tbaa !15
  %53 = sext i32 %storemerge27 to i64
  %54 = getelementptr inbounds [100010 x %struct.vertex], ptr @V, i64 0, i64 %53, i32 3
  %55 = load i32, ptr %54, align 4, !tbaa !17
  %56 = sext i32 %55 to i64
  %57 = getelementptr inbounds %struct.res, ptr %52, i64 %56
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %57, ptr noundef nonnull align 4 dereferenceable(4) %3)
  %58 = load i32, ptr %3, align 4, !tbaa !5
  %59 = add nsw i32 %58, 1
  store i32 %59, ptr %3, align 4, !tbaa !5
  %60 = load i32, ptr @ivc, align 4, !tbaa !5
  %.not21.not = icmp slt i32 %58, %60
  br i1 %.not21.not, label %.lr.ph29, label %._crit_edge30.loopexit, !llvm.loop !18

._crit_edge38:                                    ; preds = %._crit_edge34, %._crit_edge30
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #9
  ret i32 0

.lr.ph37:                                         ; preds = %._crit_edge30, %._crit_edge34
  %indvars.iv43 = phi i64 [ %indvars.iv.next44, %._crit_edge34 ], [ 1, %._crit_edge30 ]
  %61 = load ptr, ptr @R, align 8, !tbaa !15
  %62 = getelementptr inbounds %struct.res, ptr %61, i64 %indvars.iv43
  %63 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %62, i64 noundef 0) #9
  %64 = load i32, ptr %63, align 4, !tbaa !5
  %65 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %64)
  %66 = load ptr, ptr @R, align 8, !tbaa !15
  %67 = getelementptr inbounds %struct.res, ptr %66, i64 %indvars.iv43
  %68 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %67) #9
  %69 = icmp ugt i64 %68, 1
  br i1 %69, label %.lr.ph33, label %._crit_edge34

._crit_edge34:                                    ; preds = %.lr.ph33, %.lr.ph37
  %70 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3)
  %indvars.iv.next44 = add nuw nsw i64 %indvars.iv43, 1
  %71 = load i32, ptr @col, align 4, !tbaa !5
  %72 = sext i32 %71 to i64
  %73 = icmp slt i64 %indvars.iv.next44, %72
  br i1 %73, label %.lr.ph37, label %._crit_edge38, !llvm.loop !19

.lr.ph33:                                         ; preds = %.lr.ph37, %.lr.ph33
  %indvars.iv40 = phi i64 [ %indvars.iv.next41, %.lr.ph33 ], [ 1, %.lr.ph37 ]
  %74 = load ptr, ptr @R, align 8, !tbaa !15
  %75 = getelementptr inbounds %struct.res, ptr %74, i64 %indvars.iv43
  %76 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %75, i64 noundef %indvars.iv40) #9
  %77 = load i32, ptr %76, align 4, !tbaa !5
  %78 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %77)
  %indvars.iv.next41 = add nuw nsw i64 %indvars.iv40, 1
  %79 = load ptr, ptr @R, align 8, !tbaa !15
  %80 = getelementptr inbounds %struct.res, ptr %79, i64 %indvars.iv43
  %81 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %80) #9
  %82 = icmp ugt i64 %81, %indvars.iv.next41
  br i1 %82, label %.lr.ph33, label %._crit_edge34, !llvm.loop !20
}

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

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare { i64, i1 } @llvm.umul.with.overflow.i64(i64, i64) #5

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare { i64, i1 } @llvm.uadd.with.overflow.i64(i64, i64) #5

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znam(i64 noundef) local_unnamed_addr #6

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN3resC2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #7 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIP3resPFbS0_S0_EEvT_S4_T0_(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #8

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #0 align 2

attributes #0 = { mustprogress 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 #1 = { mustprogress 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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { mustprogress norecurse 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 = { 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 nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { nobuiltin 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 #7 = { inlinehint mustprogress 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 #8 = { inlinehint mustprogress 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 #9 = { nounwind }
attributes #10 = { builtin 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!12, !6, i64 4}
!12 = !{!"_ZTS6vertex", !6, i64 0, !6, i64 4, !6, i64 8, !6, i64 12, !13, i64 16}
!13 = !{!"bool", !7, i64 0}
!14 = distinct !{!14, !10}
!15 = !{!16, !16, i64 0}
!16 = !{!"any pointer", !7, i64 0}
!17 = !{!12, !6, i64 12}
!18 = distinct !{!18, !10}
!19 = distinct !{!19, !10}
!20 = distinct !{!20, !10}


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