; LLVM IR from Tunghohin/Competitive_Coding :: Hdu/hdu4635.ll (Z5solvei)

; 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 }
%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }

@e = external dso_local global [100010 x %struct.edge], align 16
@head = external dso_local global [100010 x i32], align 16
@in_d = external dso_local global [100010 x i32], align 16
@out_d = external dso_local global [100010 x i32], align 16
@dfn = external dso_local global [100010 x i32], align 16
@scc_cnt = external dso_local global i32, align 4
@scc_id = external dso_local global [100010 x i32], align 16
@scc_size = external dso_local global [100010 x i32], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [6 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 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 @_Z6tarjani(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: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #3

; 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 void @_Z4initi(i32 noundef) #0

; Function Attrs: mustprogress uwtable
define dso_local void @_Z5solvei(i32 noundef %0) #1 {
  %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
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  store i32 %0, ptr %2, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #6
  %16 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %3)
  %17 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %16, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %18 = load i32, ptr %3, align 4, !tbaa !5
  call void @_Z4initi(i32 noundef %18)
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #6
  store i32 1, ptr %5, align 4, !tbaa !5
  br label %19

19:                                               ; preds = %29, %1
  %20 = load i32, ptr %5, align 4, !tbaa !5
  %21 = load i32, ptr %4, align 4, !tbaa !5
  %22 = icmp sle i32 %20, %21
  br i1 %22, label %24, label %23

23:                                               ; preds = %19
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  br label %32

24:                                               ; preds = %19
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  %25 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %6)
  %26 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %25, ptr noundef nonnull align 4 dereferenceable(4) %7)
  %27 = load i32, ptr %6, align 4, !tbaa !5
  %28 = load i32, ptr %7, align 4, !tbaa !5
  call void @_Z8add_edgeii(i32 noundef %27, i32 noundef %28)
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  br label %29

29:                                               ; preds = %24
  %30 = load i32, ptr %5, align 4, !tbaa !5
  %31 = add nsw i32 %30, 1
  store i32 %31, ptr %5, align 4, !tbaa !5
  br label %19, !llvm.loop !9

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

33:                                               ; preds = %47, %32
  %34 = load i32, ptr %8, align 4, !tbaa !5
  %35 = load i32, ptr %3, align 4, !tbaa !5
  %36 = icmp sle i32 %34, %35
  br i1 %36, label %38, label %37

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

38:                                               ; preds = %33
  %39 = load i32, ptr %8, align 4, !tbaa !5
  %40 = sext i32 %39 to i64
  %41 = getelementptr inbounds [100010 x i32], ptr @dfn, i64 0, i64 %40
  %42 = load i32, ptr %41, align 4, !tbaa !5
  %43 = icmp ne i32 %42, 0
  br i1 %43, label %46, label %44

44:                                               ; preds = %38
  %45 = load i32, ptr %8, align 4, !tbaa !5
  call void @_Z6tarjani(i32 noundef %45)
  br label %46

46:                                               ; preds = %44, %38
  br label %47

47:                                               ; preds = %46
  %48 = load i32, ptr %8, align 4, !tbaa !5
  %49 = add nsw i32 %48, 1
  store i32 %49, ptr %8, align 4, !tbaa !5
  br label %33, !llvm.loop !11

50:                                               ; preds = %37
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  %51 = load i32, ptr %3, align 4, !tbaa !5
  %52 = load i32, ptr %3, align 4, !tbaa !5
  %53 = sub nsw i32 %52, 1
  %54 = mul nsw i32 %51, %53
  %55 = load i32, ptr %4, align 4, !tbaa !5
  %56 = sub nsw i32 %54, %55
  store i32 %56, ptr %9, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  store i32 1, ptr %10, align 4, !tbaa !5
  br label %57

57:                                               ; preds = %111, %50
  %58 = load i32, ptr %10, align 4, !tbaa !5
  %59 = load i32, ptr %3, align 4, !tbaa !5
  %60 = icmp sle i32 %58, %59
  br i1 %60, label %62, label %61

61:                                               ; preds = %57
  store i32 8, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  br label %114

62:                                               ; preds = %57
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  %63 = load i32, ptr %10, align 4, !tbaa !5
  %64 = sext i32 %63 to i64
  %65 = getelementptr inbounds [100010 x i32], ptr @head, i64 0, i64 %64
  %66 = load i32, ptr %65, align 4, !tbaa !5
  store i32 %66, ptr %12, align 4, !tbaa !5
  br label %67

67:                                               ; preds = %104, %62
  %68 = load i32, ptr %12, align 4, !tbaa !5
  %69 = icmp ne i32 %68, 0
  br i1 %69, label %71, label %70

70:                                               ; preds = %67
  store i32 11, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  br label %110

71:                                               ; preds = %67
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  %72 = load i32, ptr %12, align 4, !tbaa !5
  %73 = sext i32 %72 to i64
  %74 = getelementptr inbounds [100010 x %struct.edge], ptr @e, i64 0, i64 %73
  %75 = getelementptr inbounds %struct.edge, ptr %74, i32 0, i32 0
  %76 = load i32, ptr %75, align 8, !tbaa !12
  store i32 %76, ptr %13, align 4, !tbaa !5
  %77 = load i32, ptr %10, align 4, !tbaa !5
  %78 = sext i32 %77 to i64
  %79 = getelementptr inbounds [100010 x i32], ptr @scc_id, i64 0, i64 %78
  %80 = load i32, ptr %79, align 4, !tbaa !5
  %81 = load i32, ptr %13, align 4, !tbaa !5
  %82 = sext i32 %81 to i64
  %83 = getelementptr inbounds [100010 x i32], ptr @scc_id, i64 0, i64 %82
  %84 = load i32, ptr %83, align 4, !tbaa !5
  %85 = icmp ne i32 %80, %84
  br i1 %85, label %86, label %103

86:                                               ; preds = %71
  %87 = load i32, ptr %13, align 4, !tbaa !5
  %88 = sext i32 %87 to i64
  %89 = getelementptr inbounds [100010 x i32], ptr @scc_id, i64 0, i64 %88
  %90 = load i32, ptr %89, align 4, !tbaa !5
  %91 = sext i32 %90 to i64
  %92 = getelementptr inbounds [100010 x i32], ptr @in_d, i64 0, i64 %91
  %93 = load i32, ptr %92, align 4, !tbaa !5
  %94 = add nsw i32 %93, 1
  store i32 %94, ptr %92, align 4, !tbaa !5
  %95 = load i32, ptr %10, align 4, !tbaa !5
  %96 = sext i32 %95 to i64
  %97 = getelementptr inbounds [100010 x i32], ptr @scc_id, i64 0, i64 %96
  %98 = load i32, ptr %97, align 4, !tbaa !5
  %99 = sext i32 %98 to i64
  %100 = getelementptr inbounds [100010 x i32], ptr @out_d, i64 0, i64 %99
  %101 = load i32, ptr %100, align 4, !tbaa !5
  %102 = add nsw i32 %101, 1
  store i32 %102, ptr %100, align 4, !tbaa !5
  br label %103

103:                                              ; preds = %86, %71
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  br label %104

104:                                              ; preds = %103
  %105 = load i32, ptr %12, align 4, !tbaa !5
  %106 = sext i32 %105 to i64
  %107 = getelementptr inbounds [100010 x %struct.edge], ptr @e, i64 0, i64 %106
  %108 = getelementptr inbounds %struct.edge, ptr %107, i32 0, i32 1
  %109 = load i32, ptr %108, align 4, !tbaa !14
  store i32 %109, ptr %12, align 4, !tbaa !5
  br label %67, !llvm.loop !15

110:                                              ; preds = %70
  br label %111

111:                                              ; preds = %110
  %112 = load i32, ptr %10, align 4, !tbaa !5
  %113 = add nsw i32 %112, 1
  store i32 %113, ptr %10, align 4, !tbaa !5
  br label %57, !llvm.loop !16

114:                                              ; preds = %61
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #6
  store i32 1061109567, ptr %14, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #6
  store i32 1, ptr %15, align 4, !tbaa !5
  br label %115

115:                                              ; preds = %139, %114
  %116 = load i32, ptr %15, align 4, !tbaa !5
  %117 = load i32, ptr @scc_cnt, align 4, !tbaa !5
  %118 = icmp sle i32 %116, %117
  br i1 %118, label %120, label %119

119:                                              ; preds = %115
  store i32 14, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #6
  br label %142

120:                                              ; preds = %115
  %121 = load i32, ptr %15, align 4, !tbaa !5
  %122 = sext i32 %121 to i64
  %123 = getelementptr inbounds [100010 x i32], ptr @in_d, i64 0, i64 %122
  %124 = load i32, ptr %123, align 4, !tbaa !5
  %125 = icmp ne i32 %124, 0
  br i1 %125, label %126, label %132

126:                                              ; preds = %120
  %127 = load i32, ptr %15, align 4, !tbaa !5
  %128 = sext i32 %127 to i64
  %129 = getelementptr inbounds [100010 x i32], ptr @out_d, i64 0, i64 %128
  %130 = load i32, ptr %129, align 4, !tbaa !5
  %131 = icmp ne i32 %130, 0
  br i1 %131, label %138, label %132

132:                                              ; preds = %126, %120
  %133 = load i32, ptr %15, align 4, !tbaa !5
  %134 = sext i32 %133 to i64
  %135 = getelementptr inbounds [100010 x i32], ptr @scc_size, i64 0, i64 %134
  %136 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %14, ptr noundef nonnull align 4 dereferenceable(4) %135)
  %137 = load i32, ptr %136, align 4, !tbaa !5
  store i32 %137, ptr %14, align 4, !tbaa !5
  br label %138

138:                                              ; preds = %132, %126
  br label %139

139:                                              ; preds = %138
  %140 = load i32, ptr %15, align 4, !tbaa !5
  %141 = add nsw i32 %140, 1
  store i32 %141, ptr %15, align 4, !tbaa !5
  br label %115, !llvm.loop !17

142:                                              ; preds = %119
  %143 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str)
  %144 = load i32, ptr %2, align 4, !tbaa !5
  %145 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %143, i32 noundef %144)
  %146 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %145, ptr noundef @.str.1)
  %147 = load i32, ptr @scc_cnt, align 4, !tbaa !5
  %148 = icmp eq i32 %147, 1
  br i1 %148, label %149, label %152

149:                                              ; preds = %142
  %150 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef -1)
  %151 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %150, i8 noundef signext 10)
  br label %162

152:                                              ; preds = %142
  %153 = load i32, ptr %9, align 4, !tbaa !5
  %154 = load i32, ptr %14, align 4, !tbaa !5
  %155 = load i32, ptr %3, align 4, !tbaa !5
  %156 = load i32, ptr %14, align 4, !tbaa !5
  %157 = sub nsw i32 %155, %156
  %158 = mul nsw i32 %154, %157
  %159 = sub nsw i32 %153, %158
  %160 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %159)
  %161 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %160, i8 noundef signext 10)
  br label %162

162:                                              ; preds = %152, %149
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #6
  ret void
}

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4)) #4

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #5

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) #4

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8), i8 noundef signext) #5

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 = { 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 #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 = { 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 #6 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !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 = distinct !{!11, !10}
!12 = !{!13, !6, i64 0}
!13 = !{!"_ZTS4edge", !6, i64 0, !6, i64 4}
!14 = !{!13, !6, i64 4}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !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.edge = type { i32, i32 }
%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }

@e = external dso_local local_unnamed_addr global [100010 x %struct.edge], align 16
@head = external dso_local local_unnamed_addr global [100010 x i32], align 16
@in_d = external dso_local local_unnamed_addr global [100010 x i32], align 16
@out_d = external dso_local local_unnamed_addr global [100010 x i32], align 16
@dfn = external dso_local local_unnamed_addr global [100010 x i32], align 16
@scc_cnt = external dso_local local_unnamed_addr global i32, align 4
@scc_id = external dso_local local_unnamed_addr global [100010 x i32], align 16
@scc_size = external dso_local global [100010 x i32], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [6 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 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 @_Z6tarjani(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: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #3

; 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 void @_Z4initi(i32 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
define dso_local void @_Z5solvei(i32 noundef %0) local_unnamed_addr #1 {
  %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
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #6
  %7 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %8 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %7, ptr noundef nonnull align 4 dereferenceable(4) %3)
  %9 = load i32, ptr %2, align 4, !tbaa !5
  call void @_Z4initi(i32 noundef %9)
  %10 = load i32, ptr %3, align 4, !tbaa !5
  %.not39 = icmp slt i32 %10, 1
  br i1 %.not39, label %.preheader, label %.lr.ph

.preheader:                                       ; preds = %.lr.ph, %1
  %11 = phi i32 [ %10, %1 ], [ %21, %.lr.ph ]
  %12 = load i32, ptr %2, align 4, !tbaa !5
  %.not2941 = icmp slt i32 %12, 1
  br i1 %.not2941, label %._crit_edge.thread, label %.lr.ph43

._crit_edge.thread:                               ; preds = %.preheader
  %13 = add nsw i32 %12, -1
  %14 = mul nsw i32 %13, %12
  %15 = sub i32 %14, %11
  br label %._crit_edge54

.lr.ph:                                           ; preds = %1, %.lr.ph
  %.02340 = phi i32 [ %20, %.lr.ph ], [ 1, %1 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #6
  %16 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %17 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %16, ptr noundef nonnull align 4 dereferenceable(4) %5)
  %18 = load i32, ptr %4, align 4, !tbaa !5
  %19 = load i32, ptr %5, align 4, !tbaa !5
  call void @_Z8add_edgeii(i32 noundef %18, i32 noundef %19)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #6
  %20 = add nuw nsw i32 %.02340, 1
  %21 = load i32, ptr %3, align 4, !tbaa !5
  %.not.not = icmp slt i32 %.02340, %21
  br i1 %.not.not, label %.lr.ph, label %.preheader, !llvm.loop !9

._crit_edge:                                      ; preds = %31
  %.pre68 = load i32, ptr %3, align 4, !tbaa !5
  %22 = add nsw i32 %32, -1
  %23 = mul nsw i32 %22, %32
  %24 = sub i32 %23, %.pre68
  %.not3050 = icmp slt i32 %32, 1
  br i1 %.not3050, label %._crit_edge54, label %.lr.ph53.preheader

.lr.ph53.preheader:                               ; preds = %._crit_edge
  %25 = add nuw i32 %32, 1
  %wide.trip.count = zext i32 %25 to i64
  br label %.lr.ph53

.lr.ph43:                                         ; preds = %.preheader, %31
  %26 = phi i32 [ %32, %31 ], [ %12, %.preheader ]
  %indvars.iv = phi i64 [ %indvars.iv.next, %31 ], [ 1, %.preheader ]
  %27 = getelementptr inbounds [100010 x i32], ptr @dfn, i64 0, i64 %indvars.iv
  %28 = load i32, ptr %27, align 4, !tbaa !5
  %.not37 = icmp eq i32 %28, 0
  br i1 %.not37, label %29, label %31

29:                                               ; preds = %.lr.ph43
  %30 = trunc nuw nsw i64 %indvars.iv to i32
  call void @_Z6tarjani(i32 noundef %30)
  %.pre = load i32, ptr %2, align 4, !tbaa !5
  br label %31

31:                                               ; preds = %.lr.ph43, %29
  %32 = phi i32 [ %26, %.lr.ph43 ], [ %.pre, %29 ]
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %33 = sext i32 %32 to i64
  %.not29.not = icmp slt i64 %indvars.iv, %33
  br i1 %.not29.not, label %.lr.ph43, label %._crit_edge, !llvm.loop !11

._crit_edge54:                                    ; preds = %._crit_edge49, %._crit_edge.thread, %._crit_edge
  %34 = phi i32 [ %15, %._crit_edge.thread ], [ %24, %._crit_edge ], [ %24, %._crit_edge49 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #6
  store i32 1061109567, ptr %6, align 4, !tbaa !5
  %35 = load i32, ptr @scc_cnt, align 4, !tbaa !5
  %.not3155 = icmp slt i32 %35, 1
  br i1 %.not3155, label %._crit_edge59, label %.lr.ph58

.lr.ph53:                                         ; preds = %.lr.ph53.preheader, %._crit_edge49
  %indvars.iv62 = phi i64 [ 1, %.lr.ph53.preheader ], [ %indvars.iv.next63, %._crit_edge49 ]
  %36 = getelementptr inbounds [100010 x i32], ptr @head, i64 0, i64 %indvars.iv62
  %.02444 = load i32, ptr %36, align 4, !tbaa !5
  %.not3545 = icmp eq i32 %.02444, 0
  br i1 %.not3545, label %._crit_edge49, label %.lr.ph48

.lr.ph48:                                         ; preds = %.lr.ph53
  %37 = getelementptr inbounds [100010 x i32], ptr @scc_id, i64 0, i64 %indvars.iv62
  %38 = load i32, ptr %37, align 4, !tbaa !5
  %39 = sext i32 %38 to i64
  %40 = getelementptr inbounds [100010 x i32], ptr @out_d, i64 0, i64 %39
  br label %41

._crit_edge49:                                    ; preds = %55, %.lr.ph53
  %indvars.iv.next63 = add nuw nsw i64 %indvars.iv62, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next63, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge54, label %.lr.ph53, !llvm.loop !12

41:                                               ; preds = %.lr.ph48, %55
  %.02446 = phi i32 [ %.02444, %.lr.ph48 ], [ %.024, %55 ]
  %42 = sext i32 %.02446 to i64
  %43 = getelementptr inbounds [100010 x %struct.edge], ptr @e, i64 0, i64 %42
  %44 = load i32, ptr %43, align 8, !tbaa !13
  %45 = sext i32 %44 to i64
  %46 = getelementptr inbounds [100010 x i32], ptr @scc_id, i64 0, i64 %45
  %47 = load i32, ptr %46, align 4, !tbaa !5
  %.not36 = icmp eq i32 %38, %47
  br i1 %.not36, label %55, label %48

48:                                               ; preds = %41
  %49 = sext i32 %47 to i64
  %50 = getelementptr inbounds [100010 x i32], ptr @in_d, i64 0, i64 %49
  %51 = load i32, ptr %50, align 4, !tbaa !5
  %52 = add nsw i32 %51, 1
  store i32 %52, ptr %50, align 4, !tbaa !5
  %53 = load i32, ptr %40, align 4, !tbaa !5
  %54 = add nsw i32 %53, 1
  store i32 %54, ptr %40, align 4, !tbaa !5
  br label %55

55:                                               ; preds = %48, %41
  %56 = getelementptr inbounds i8, ptr %43, i64 4
  %.024 = load i32, ptr %56, align 4, !tbaa !5
  %.not35 = icmp eq i32 %.024, 0
  br i1 %.not35, label %._crit_edge49, label %41, !llvm.loop !15

._crit_edge59:                                    ; preds = %72, %._crit_edge54
  %57 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str)
  %58 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %57, i32 noundef %0)
  %59 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %58, ptr noundef nonnull @.str.1)
  %60 = load i32, ptr @scc_cnt, align 4, !tbaa !5
  %61 = icmp eq i32 %60, 1
  br i1 %61, label %79, label %75

.lr.ph58:                                         ; preds = %._crit_edge54, %72
  %62 = phi i32 [ %73, %72 ], [ %35, %._crit_edge54 ]
  %indvars.iv65 = phi i64 [ %indvars.iv.next66, %72 ], [ 1, %._crit_edge54 ]
  %63 = getelementptr inbounds [100010 x i32], ptr @in_d, i64 0, i64 %indvars.iv65
  %64 = load i32, ptr %63, align 4, !tbaa !5
  %.not33 = icmp eq i32 %64, 0
  br i1 %.not33, label %68, label %65

65:                                               ; preds = %.lr.ph58
  %66 = getelementptr inbounds [100010 x i32], ptr @out_d, i64 0, i64 %indvars.iv65
  %67 = load i32, ptr %66, align 4, !tbaa !5
  %.not34 = icmp eq i32 %67, 0
  br i1 %.not34, label %68, label %72

68:                                               ; preds = %65, %.lr.ph58
  %69 = getelementptr inbounds [100010 x i32], ptr @scc_size, i64 0, i64 %indvars.iv65
  %70 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %6, ptr noundef nonnull align 4 dereferenceable(4) %69)
  %71 = load i32, ptr %70, align 4, !tbaa !5
  store i32 %71, ptr %6, align 4, !tbaa !5
  %.pre69 = load i32, ptr @scc_cnt, align 4, !tbaa !5
  br label %72

72:                                               ; preds = %65, %68
  %73 = phi i32 [ %62, %65 ], [ %.pre69, %68 ]
  %indvars.iv.next66 = add nuw nsw i64 %indvars.iv65, 1
  %74 = sext i32 %73 to i64
  %.not31.not = icmp slt i64 %indvars.iv65, %74
  br i1 %.not31.not, label %.lr.ph58, label %._crit_edge59, !llvm.loop !16

75:                                               ; preds = %._crit_edge59
  %76 = load i32, ptr %6, align 4, !tbaa !5
  %77 = load i32, ptr %2, align 4, !tbaa !5
  %.neg = sub i32 %76, %77
  %.neg32 = mul i32 %.neg, %76
  %78 = add i32 %34, %.neg32
  br label %79

79:                                               ; preds = %._crit_edge59, %75
  %.sink73 = phi i32 [ %78, %75 ], [ -1, %._crit_edge59 ]
  %80 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %.sink73)
  %81 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %80, i8 noundef signext 10)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #6
  ret void
}

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #4

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #5

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) local_unnamed_addr #4

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8), i8 noundef signext) local_unnamed_addr #5

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 = { 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 #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 = { 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 #6 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !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 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = !{!14, !6, i64 0}
!14 = !{!"_ZTS4edge", !6, i64 0, !6, i64 4}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}


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