; LLVM IR from upupming/algorithm :: acwing/算法竞赛进阶指南/0x21-树与图的遍历/164. 可达性统计 (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"

%"class.std::bitset" = type { %"struct.std::_Base_bitset" }
%"struct.std::_Base_bitset" = type { [469 x i64] }
%"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" }
%"class.std::bitset<30010>::reference" = type { ptr, i64 }

@a = external dso_local global [30010 x i32], align 16
@ver = external dso_local global [30010 x i32], align 16
@Next = external dso_local global [30010 x i32], align 16
@head = external dso_local global [30010 x i32], align 16
@cnt = external dso_local global i32, align 4
@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@bs = external dso_local global [30010 x %"class.std::bitset"], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@.str = external hidden unnamed_addr constant [9 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [133 x i8], align 1
@__PRETTY_FUNCTION__.main = external hidden unnamed_addr constant [11 x i8], align 1
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z7topsortv() #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 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 %"class.std::bitset<30010>::reference", align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %12 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) @n)
  %13 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %12, ptr noundef nonnull align 4 dereferenceable(4) @m)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #7
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %14

14:                                               ; preds = %24, %0
  %15 = load i32, ptr %2, align 4, !tbaa !5
  %16 = load i32, ptr @m, align 4, !tbaa !5
  %17 = icmp slt i32 %15, %16
  br i1 %17, label %19, label %18

18:                                               ; preds = %14
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #7
  br label %27

19:                                               ; preds = %14
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #7
  %20 = 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)
  %21 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %20, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %22 = load i32, ptr %3, align 4, !tbaa !5
  %23 = load i32, ptr %4, align 4, !tbaa !5
  call void @_Z3addii(i32 noundef %22, i32 noundef %23)
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #7
  br label %24

24:                                               ; preds = %19
  %25 = load i32, ptr %2, align 4, !tbaa !5
  %26 = add nsw i32 %25, 1
  store i32 %26, ptr %2, align 4, !tbaa !5
  br label %14, !llvm.loop !9

27:                                               ; preds = %18
  call void @_Z7topsortv()
  %28 = load i32, ptr @cnt, align 4, !tbaa !5
  %29 = load i32, ptr @n, align 4, !tbaa !5
  %30 = icmp eq i32 %28, %29
  br i1 %30, label %31, label %32

31:                                               ; preds = %27
  br label %34

32:                                               ; preds = %27
  call void @__assert_fail(ptr noundef @.str, ptr noundef @.str.1, i32 noundef 45, ptr noundef @__PRETTY_FUNCTION__.main) #8
  unreachable

33:                                               ; No predecessors!
  br label %34

34:                                               ; preds = %33, %31
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #7
  %35 = load i32, ptr @n, align 4, !tbaa !5
  store i32 %35, ptr %5, align 4, !tbaa !5
  br label %36

36:                                               ; preds = %77, %34
  %37 = load i32, ptr %5, align 4, !tbaa !5
  %38 = icmp sge i32 %37, 1
  br i1 %38, label %40, label %39

39:                                               ; preds = %36
  store i32 5, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #7
  br label %80

40:                                               ; preds = %36
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #7
  %41 = load i32, ptr %5, align 4, !tbaa !5
  %42 = sext i32 %41 to i64
  %43 = getelementptr inbounds [30010 x i32], ptr @a, i64 0, i64 %42
  %44 = load i32, ptr %43, align 4, !tbaa !5
  store i32 %44, ptr %7, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, ptr %8) #7
  %45 = load i32, ptr %7, align 4, !tbaa !5
  %46 = sext i32 %45 to i64
  %47 = getelementptr inbounds [30010 x %"class.std::bitset"], ptr @bs, i64 0, i64 %46
  %48 = load i32, ptr %7, align 4, !tbaa !5
  %49 = sext i32 %48 to i64
  call void @_ZNSt6bitsetILm30010EEixEm(ptr dead_on_unwind writable sret(%"class.std::bitset<30010>::reference") align 8 %8, ptr noundef nonnull align 8 dereferenceable(3752) %47, i64 noundef %49)
  %50 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6bitsetILm30010EE9referenceaSEb(ptr noundef nonnull align 8 dereferenceable(16) %8, i1 noundef zeroext true) #7
  call void @_ZNSt6bitsetILm30010EE9referenceD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %8) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %8) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #7
  %51 = load i32, ptr %7, align 4, !tbaa !5
  %52 = sext i32 %51 to i64
  %53 = getelementptr inbounds [30010 x i32], ptr @head, i64 0, i64 %52
  %54 = load i32, ptr %53, align 4, !tbaa !5
  store i32 %54, ptr %9, align 4, !tbaa !5
  br label %55

55:                                               ; preds = %71, %40
  %56 = load i32, ptr %9, align 4, !tbaa !5
  %57 = icmp ne i32 %56, 0
  br i1 %57, label %59, label %58

58:                                               ; preds = %55
  store i32 8, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #7
  br label %76

59:                                               ; preds = %55
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #7
  %60 = load i32, ptr %9, align 4, !tbaa !5
  %61 = sext i32 %60 to i64
  %62 = getelementptr inbounds [30010 x i32], ptr @ver, i64 0, i64 %61
  %63 = load i32, ptr %62, align 4, !tbaa !5
  store i32 %63, ptr %10, align 4, !tbaa !5
  %64 = load i32, ptr %10, align 4, !tbaa !5
  %65 = sext i32 %64 to i64
  %66 = getelementptr inbounds [30010 x %"class.std::bitset"], ptr @bs, i64 0, i64 %65
  %67 = load i32, ptr %7, align 4, !tbaa !5
  %68 = sext i32 %67 to i64
  %69 = getelementptr inbounds [30010 x %"class.std::bitset"], ptr @bs, i64 0, i64 %68
  %70 = call noundef nonnull align 8 dereferenceable(3752) ptr @_ZNSt6bitsetILm30010EEoRERKS0_(ptr noundef nonnull align 8 dereferenceable(3752) %69, ptr noundef nonnull align 8 dereferenceable(3752) %66) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #7
  br label %71

71:                                               ; preds = %59
  %72 = load i32, ptr %9, align 4, !tbaa !5
  %73 = sext i32 %72 to i64
  %74 = getelementptr inbounds [30010 x i32], ptr @Next, i64 0, i64 %73
  %75 = load i32, ptr %74, align 4, !tbaa !5
  store i32 %75, ptr %9, align 4, !tbaa !5
  br label %55, !llvm.loop !11

76:                                               ; preds = %58
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #7
  br label %77

77:                                               ; preds = %76
  %78 = load i32, ptr %5, align 4, !tbaa !5
  %79 = add nsw i32 %78, -1
  store i32 %79, ptr %5, align 4, !tbaa !5
  br label %36, !llvm.loop !12

80:                                               ; preds = %39
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #7
  store i32 1, ptr %11, align 4, !tbaa !5
  br label %81

81:                                               ; preds = %93, %80
  %82 = load i32, ptr %11, align 4, !tbaa !5
  %83 = load i32, ptr @n, align 4, !tbaa !5
  %84 = icmp sle i32 %82, %83
  br i1 %84, label %86, label %85

85:                                               ; preds = %81
  store i32 11, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #7
  br label %96

86:                                               ; preds = %81
  %87 = load i32, ptr %11, align 4, !tbaa !5
  %88 = sext i32 %87 to i64
  %89 = getelementptr inbounds [30010 x %"class.std::bitset"], ptr @bs, i64 0, i64 %88
  %90 = call noundef i64 @_ZNKSt6bitsetILm30010EE5countEv(ptr noundef nonnull align 8 dereferenceable(3752) %89) #7
  %91 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEm(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %90)
  %92 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %91, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %93

93:                                               ; preds = %86
  %94 = load i32, ptr %11, align 4, !tbaa !5
  %95 = add nsw i32 %94, 1
  store i32 %95, ptr %11, align 4, !tbaa !5
  br label %81, !llvm.loop !13

96:                                               ; preds = %85
  ret i32 0
}

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: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #5

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6bitsetILm30010EEixEm(ptr dead_on_unwind noalias writable sret(%"class.std::bitset<30010>::reference") align 8, ptr noundef nonnull align 8 dereferenceable(3752), i64 noundef) #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6bitsetILm30010EE9referenceaSEb(ptr noundef nonnull align 8 dereferenceable(16), i1 noundef zeroext) #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6bitsetILm30010EE9referenceD2Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(3752) ptr @_ZNSt6bitsetILm30010EEoRERKS0_(ptr noundef nonnull align 8 dereferenceable(3752), ptr noundef nonnull align 8 dereferenceable(3752)) #0 align 2

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEm(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) #1 align 2

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

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #1 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #6

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 = { noreturn nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { 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 #7 = { nounwind }
attributes #8 = { noreturn 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 = distinct !{!13, !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"

%"class.std::bitset" = type { %"struct.std::_Base_bitset" }
%"struct.std::_Base_bitset" = type { [469 x i64] }
%"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" }
%"class.std::bitset<30010>::reference" = type { ptr, i64 }

@a = external dso_local local_unnamed_addr global [30010 x i32], align 16
@ver = external dso_local local_unnamed_addr global [30010 x i32], align 16
@Next = external dso_local local_unnamed_addr global [30010 x i32], align 16
@head = external dso_local local_unnamed_addr global [30010 x i32], align 16
@cnt = external dso_local local_unnamed_addr global i32, align 4
@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@bs = external dso_local global [30010 x %"class.std::bitset"], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@.str = external hidden unnamed_addr constant [9 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [133 x i8], align 1
@__PRETTY_FUNCTION__.main = external hidden unnamed_addr constant [11 x i8], align 1
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z7topsortv() 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 norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #3 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca %"class.std::bitset<30010>::reference", align 8
  %4 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) @n)
  %5 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %4, ptr noundef nonnull align 4 dereferenceable(4) @m)
  %6 = load i32, ptr @m, align 4, !tbaa !5
  %7 = icmp sgt i32 %6, 0
  br i1 %7, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %0
  call void @_Z7topsortv()
  %8 = load i32, ptr @cnt, align 4, !tbaa !5
  %9 = load i32, ptr @n, align 4, !tbaa !5
  %10 = icmp eq i32 %8, %9
  br i1 %10, label %.preheader21, label %20

.preheader21:                                     ; preds = %._crit_edge
  %11 = icmp sgt i32 %8, 0
  br i1 %11, label %.lr.ph30.preheader, label %._crit_edge34

.lr.ph30.preheader:                               ; preds = %.preheader21
  %12 = zext nneg i32 %8 to i64
  br label %.lr.ph30

.lr.ph:                                           ; preds = %0, %.lr.ph
  %.01622 = phi i32 [ %17, %.lr.ph ], [ 0, %0 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #7
  %13 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %1)
  %14 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %13, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %15 = load i32, ptr %1, align 4, !tbaa !5
  %16 = load i32, ptr %2, align 4, !tbaa !5
  call void @_Z3addii(i32 noundef %15, i32 noundef %16)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #7
  %17 = add nuw nsw i32 %.01622, 1
  %18 = load i32, ptr @m, align 4, !tbaa !5
  %19 = icmp slt i32 %17, %18
  br i1 %19, label %.lr.ph, label %._crit_edge, !llvm.loop !9

20:                                               ; preds = %._crit_edge
  call void @__assert_fail(ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 45, ptr noundef nonnull @__PRETTY_FUNCTION__.main) #8
  unreachable

.preheader:                                       ; preds = %._crit_edge28
  %.pre = load i32, ptr @n, align 4, !tbaa !5
  %21 = icmp slt i32 %.pre, 1
  br i1 %21, label %._crit_edge34, label %.lr.ph33

.lr.ph30:                                         ; preds = %.lr.ph30.preheader, %._crit_edge28
  %indvars.iv = phi i64 [ %12, %.lr.ph30.preheader ], [ %indvars.iv.next, %._crit_edge28 ]
  %22 = getelementptr inbounds [30010 x i32], ptr @a, i64 0, i64 %indvars.iv
  %23 = load i32, ptr %22, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %3) #7
  %24 = sext i32 %23 to i64
  %25 = getelementptr inbounds [30010 x %"class.std::bitset"], ptr @bs, i64 0, i64 %24
  call void @_ZNSt6bitsetILm30010EEixEm(ptr dead_on_unwind nonnull writable sret(%"class.std::bitset<30010>::reference") align 8 %3, ptr noundef nonnull align 8 dereferenceable(3752) %25, i64 noundef %24)
  %26 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6bitsetILm30010EE9referenceaSEb(ptr noundef nonnull align 8 dereferenceable(16) %3, i1 noundef zeroext true) #7
  call void @_ZNSt6bitsetILm30010EE9referenceD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %3) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %3) #7
  %27 = getelementptr inbounds [30010 x i32], ptr @head, i64 0, i64 %24
  %.01723 = load i32, ptr %27, align 4, !tbaa !5
  %.not2024 = icmp eq i32 %.01723, 0
  br i1 %.not2024, label %._crit_edge28, label %.lr.ph27

._crit_edge28:                                    ; preds = %.lr.ph27, %.lr.ph30
  %indvars.iv.next = add nsw i64 %indvars.iv, -1
  %28 = icmp sgt i64 %indvars.iv, 1
  br i1 %28, label %.lr.ph30, label %.preheader, !llvm.loop !11

.lr.ph27:                                         ; preds = %.lr.ph30, %.lr.ph27
  %.01725 = phi i32 [ %.017, %.lr.ph27 ], [ %.01723, %.lr.ph30 ]
  %29 = sext i32 %.01725 to i64
  %30 = getelementptr inbounds [30010 x i32], ptr @ver, i64 0, i64 %29
  %31 = load i32, ptr %30, align 4, !tbaa !5
  %32 = sext i32 %31 to i64
  %33 = getelementptr inbounds [30010 x %"class.std::bitset"], ptr @bs, i64 0, i64 %32
  %34 = call noundef nonnull align 8 dereferenceable(3752) ptr @_ZNSt6bitsetILm30010EEoRERKS0_(ptr noundef nonnull align 8 dereferenceable(3752) %25, ptr noundef nonnull align 8 dereferenceable(3752) %33) #7
  %35 = getelementptr inbounds [30010 x i32], ptr @Next, i64 0, i64 %29
  %.017 = load i32, ptr %35, align 4, !tbaa !5
  %.not20 = icmp eq i32 %.017, 0
  br i1 %.not20, label %._crit_edge28, label %.lr.ph27, !llvm.loop !12

._crit_edge34:                                    ; preds = %.lr.ph33, %.preheader21, %.preheader
  ret i32 0

.lr.ph33:                                         ; preds = %.preheader, %.lr.ph33
  %indvars.iv36 = phi i64 [ %indvars.iv.next37, %.lr.ph33 ], [ 1, %.preheader ]
  %36 = getelementptr inbounds [30010 x %"class.std::bitset"], ptr @bs, i64 0, i64 %indvars.iv36
  %37 = call noundef i64 @_ZNKSt6bitsetILm30010EE5countEv(ptr noundef nonnull align 8 dereferenceable(3752) %36) #7
  %38 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEm(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %37)
  %39 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %38, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  %indvars.iv.next37 = add nuw nsw i64 %indvars.iv36, 1
  %40 = load i32, ptr @n, align 4, !tbaa !5
  %41 = sext i32 %40 to i64
  %.not.not = icmp slt i64 %indvars.iv36, %41
  br i1 %.not.not, label %.lr.ph33, label %._crit_edge34, !llvm.loop !13
}

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: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #5

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6bitsetILm30010EEixEm(ptr dead_on_unwind noalias writable sret(%"class.std::bitset<30010>::reference") align 8, ptr noundef nonnull align 8 dereferenceable(3752), i64 noundef) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6bitsetILm30010EE9referenceaSEb(ptr noundef nonnull align 8 dereferenceable(16), i1 noundef zeroext) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6bitsetILm30010EE9referenceD2Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(3752) ptr @_ZNSt6bitsetILm30010EEoRERKS0_(ptr noundef nonnull align 8 dereferenceable(3752), ptr noundef nonnull align 8 dereferenceable(3752)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEm(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) local_unnamed_addr #1 align 2

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

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #6

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 = { "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 = { noreturn nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { 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 #7 = { nounwind }
attributes #8 = { noreturn 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 = distinct !{!13, !10}


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