; LLVM IR from kazunetakahashi/atcoder :: 201510_201609/1224_xmas_2015/B3.ll (Z3dfsii)

; 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::set" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<int, int, std::_Identity<int>, std::less<int>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<int, int, std::_Identity<int>, std::less<int>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::_Rb_tree_header" = type { %"struct.std::_Rb_tree_node_base", i64 }
%"struct.std::_Rb_tree_node_base" = type { i32, ptr, ptr, ptr }
%"class.std::basic_ostream" = type { ptr, %"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 }
%"struct.std::_Rb_tree_const_iterator" = type { ptr }

@X = external dso_local global [200010 x %"class.std::set"], align 16
@visited = external dso_local global [200010 x i8], align 16
@N = external dso_local global i32, align 4
@have = external dso_local global i32, align 4
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [2 x i8], align 1

; Function Attrs: mustprogress uwtable
define dso_local void @_Z3dfsii(i32 noundef %0, i32 noundef %1) #0 {
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %7 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %8 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %9 = alloca i32, align 4
  %10 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  store i32 %0, ptr %3, align 4, !tbaa !5
  store i32 %1, ptr %4, align 4, !tbaa !5
  %11 = load i32, ptr %3, align 4, !tbaa !5
  %12 = sext i32 %11 to i64
  %13 = getelementptr inbounds [200010 x i8], ptr @visited, i64 0, i64 %12
  %14 = load i8, ptr %13, align 1, !tbaa !9, !range !11, !noundef !12
  %15 = trunc i8 %14 to i1
  br i1 %15, label %16, label %17

16:                                               ; preds = %2
  br label %123

17:                                               ; preds = %2
  %18 = load i32, ptr %4, align 4, !tbaa !5
  %19 = icmp sge i32 %18, 0
  br i1 %19, label %20, label %31

20:                                               ; preds = %17
  %21 = load i32, ptr %3, align 4, !tbaa !5
  %22 = add nsw i32 %21, 1
  %23 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %22)
  %24 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %23, ptr noundef @.str)
  %25 = load i32, ptr %4, align 4, !tbaa !5
  %26 = add nsw i32 %25, 1
  %27 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %24, i32 noundef %26)
  %28 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %27, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  %29 = load i32, ptr @have, align 4, !tbaa !5
  %30 = add nsw i32 %29, 1
  store i32 %30, ptr @have, align 4, !tbaa !5
  br label %31

31:                                               ; preds = %20, %17
  %32 = load i32, ptr %3, align 4, !tbaa !5
  %33 = sext i32 %32 to i64
  %34 = getelementptr inbounds [200010 x i8], ptr @visited, i64 0, i64 %33
  store i8 1, ptr %34, align 1, !tbaa !9
  %35 = load i32, ptr @have, align 4, !tbaa !5
  %36 = load i32, ptr @N, align 4, !tbaa !5
  %37 = sub nsw i32 %36, 1
  %38 = icmp eq i32 %35, %37
  br i1 %38, label %39, label %40

39:                                               ; preds = %31
  br label %123

40:                                               ; preds = %31
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #5
  store i32 0, ptr %5, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #5
  %41 = load i32, ptr %3, align 4, !tbaa !5
  %42 = sext i32 %41 to i64
  %43 = getelementptr inbounds [200010 x %"class.std::set"], ptr @X, i64 0, i64 %42
  %44 = call ptr @_ZNKSt3setIiSt4lessIiESaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %43) #5
  %45 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %6, i32 0, i32 0
  store ptr %44, ptr %45, align 8
  br label %46

46:                                               ; preds = %96, %40
  %47 = load i32, ptr %5, align 4, !tbaa !5
  %48 = load i32, ptr @N, align 4, !tbaa !5
  %49 = icmp slt i32 %47, %48
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #5
  br i1 %49, label %50, label %57

50:                                               ; preds = %46
  %51 = load i32, ptr %3, align 4, !tbaa !5
  %52 = sext i32 %51 to i64
  %53 = getelementptr inbounds [200010 x %"class.std::set"], ptr @X, i64 0, i64 %52
  %54 = call ptr @_ZNKSt3setIiSt4lessIiESaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %53) #5
  %55 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %7, i32 0, i32 0
  store ptr %54, ptr %55, align 8
  %56 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorIiES2_(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %7) #5
  br label %57

57:                                               ; preds = %50, %46
  %58 = phi i1 [ false, %46 ], [ %56, %50 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  br i1 %58, label %59, label %97

59:                                               ; preds = %57
  %60 = load i32, ptr %5, align 4, !tbaa !5
  %61 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt23_Rb_tree_const_iteratorIiEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %6) #5
  %62 = load i32, ptr %61, align 4, !tbaa !5
  %63 = icmp eq i32 %60, %62
  br i1 %63, label %64, label %69

64:                                               ; preds = %59
  %65 = load i32, ptr %5, align 4, !tbaa !5
  %66 = add nsw i32 %65, 1
  store i32 %66, ptr %5, align 4, !tbaa !5
  %67 = call ptr @_ZNSt23_Rb_tree_const_iteratorIiEppEi(ptr noundef nonnull align 8 dereferenceable(8) %6, i32 noundef 0) #5
  %68 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %8, i32 0, i32 0
  store ptr %67, ptr %68, align 8
  br label %96

69:                                               ; preds = %59
  %70 = load i32, ptr %5, align 4, !tbaa !5
  %71 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt23_Rb_tree_const_iteratorIiEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %6) #5
  %72 = load i32, ptr %71, align 4, !tbaa !5
  %73 = icmp slt i32 %70, %72
  br i1 %73, label %74, label %92

74:                                               ; preds = %69
  %75 = load i32, ptr %5, align 4, !tbaa !5
  %76 = sext i32 %75 to i64
  %77 = getelementptr inbounds [200010 x i8], ptr @visited, i64 0, i64 %76
  %78 = load i8, ptr %77, align 1, !tbaa !9, !range !11, !noundef !12
  %79 = trunc i8 %78 to i1
  br i1 %79, label %89, label %80

80:                                               ; preds = %74
  %81 = load i32, ptr %5, align 4, !tbaa !5
  %82 = load i32, ptr %3, align 4, !tbaa !5
  call void @_Z3dfsii(i32 noundef %81, i32 noundef %82)
  %83 = load i32, ptr @have, align 4, !tbaa !5
  %84 = load i32, ptr @N, align 4, !tbaa !5
  %85 = sub nsw i32 %84, 1
  %86 = icmp eq i32 %83, %85
  br i1 %86, label %87, label %88

87:                                               ; preds = %80
  store i32 1, ptr %9, align 4
  br label %121

88:                                               ; preds = %80
  br label %89

89:                                               ; preds = %88, %74
  %90 = load i32, ptr %5, align 4, !tbaa !5
  %91 = add nsw i32 %90, 1
  store i32 %91, ptr %5, align 4, !tbaa !5
  br label %95

92:                                               ; preds = %69
  %93 = call ptr @_ZNSt23_Rb_tree_const_iteratorIiEppEi(ptr noundef nonnull align 8 dereferenceable(8) %6, i32 noundef 0) #5
  %94 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %10, i32 0, i32 0
  store ptr %93, ptr %94, align 8
  br label %95

95:                                               ; preds = %92, %89
  br label %96

96:                                               ; preds = %95, %64
  br label %46, !llvm.loop !13

97:                                               ; preds = %57
  br label %98

98:                                               ; preds = %117, %97
  %99 = load i32, ptr %5, align 4, !tbaa !5
  %100 = load i32, ptr @N, align 4, !tbaa !5
  %101 = icmp slt i32 %99, %100
  br i1 %101, label %102, label %120

102:                                              ; preds = %98
  %103 = load i32, ptr %5, align 4, !tbaa !5
  %104 = sext i32 %103 to i64
  %105 = getelementptr inbounds [200010 x i8], ptr @visited, i64 0, i64 %104
  %106 = load i8, ptr %105, align 1, !tbaa !9, !range !11, !noundef !12
  %107 = trunc i8 %106 to i1
  br i1 %107, label %117, label %108

108:                                              ; preds = %102
  %109 = load i32, ptr %5, align 4, !tbaa !5
  %110 = load i32, ptr %3, align 4, !tbaa !5
  call void @_Z3dfsii(i32 noundef %109, i32 noundef %110)
  %111 = load i32, ptr @have, align 4, !tbaa !5
  %112 = load i32, ptr @N, align 4, !tbaa !5
  %113 = sub nsw i32 %112, 1
  %114 = icmp eq i32 %111, %113
  br i1 %114, label %115, label %116

115:                                              ; preds = %108
  store i32 1, ptr %9, align 4
  br label %121

116:                                              ; preds = %108
  br label %117

117:                                              ; preds = %116, %102
  %118 = load i32, ptr %5, align 4, !tbaa !5
  %119 = add nsw i32 %118, 1
  store i32 %119, ptr %5, align 4, !tbaa !5
  br label %98, !llvm.loop !15

120:                                              ; preds = %98
  store i32 0, ptr %9, align 4
  br label %121

121:                                              ; preds = %120, %115, %87
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  %122 = load i32, ptr %9, align 4
  switch i32 %122, label %124 [
    i32 0, label %123
    i32 1, label %123
  ]

123:                                              ; preds = %121, %121, %39, %16
  ret void

124:                                              ; preds = %121
  unreachable
}

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

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

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #0 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)) #1

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNKSt3setIiSt4lessIiESaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48)) #4 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorIiES2_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #4

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNKSt3setIiSt4lessIiESaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(48)) #4 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt23_Rb_tree_const_iteratorIiEdeEv(ptr noundef nonnull align 8 dereferenceable(8)) #4 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt23_Rb_tree_const_iteratorIiEppEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) #4 align 2

attributes #0 = { 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 #1 = { 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 #2 = { "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 memory(argmem: readwrite) }
attributes #4 = { 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 #5 = { 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 = !{!10, !10, i64 0}
!10 = !{!"bool", !7, i64 0}
!11 = !{i8 0, i8 2}
!12 = !{}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}


; 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::set" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<int, int, std::_Identity<int>, std::less<int>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<int, int, std::_Identity<int>, std::less<int>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::_Rb_tree_header" = type { %"struct.std::_Rb_tree_node_base", i64 }
%"struct.std::_Rb_tree_node_base" = type { i32, ptr, ptr, ptr }
%"class.std::basic_ostream" = type { ptr, %"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 }
%"struct.std::_Rb_tree_const_iterator" = type { ptr }

@X = external dso_local global [200010 x %"class.std::set"], align 16
@visited = external dso_local local_unnamed_addr global [200010 x i8], align 16
@N = external dso_local local_unnamed_addr global i32, align 4
@have = external dso_local local_unnamed_addr global i32, align 4
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [2 x i8], align 1

; Function Attrs: mustprogress uwtable
define dso_local void @_Z3dfsii(i32 noundef %0, i32 noundef %1) local_unnamed_addr #0 {
  %3 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %4 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %5 = sext i32 %0 to i64
  %6 = getelementptr inbounds [200010 x i8], ptr @visited, i64 0, i64 %5
  %7 = load i8, ptr %6, align 1, !tbaa !5, !range !9, !noundef !10
  %8 = trunc nuw i8 %7 to i1
  br i1 %8, label %78, label %9

9:                                                ; preds = %2
  %10 = icmp sgt i32 %1, -1
  br i1 %10, label %11, label %._crit_edge

._crit_edge:                                      ; preds = %9
  %.pre = load i32, ptr @have, align 4, !tbaa !11
  br label %20

11:                                               ; preds = %9
  %12 = add nsw i32 %0, 1
  %13 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %12)
  %14 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %13, ptr noundef nonnull @.str)
  %15 = add nuw nsw i32 %1, 1
  %16 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %14, i32 noundef %15)
  %17 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %16, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  %18 = load i32, ptr @have, align 4, !tbaa !11
  %19 = add nsw i32 %18, 1
  store i32 %19, ptr @have, align 4, !tbaa !11
  br label %20

20:                                               ; preds = %._crit_edge, %11
  %21 = phi i32 [ %.pre, %._crit_edge ], [ %19, %11 ]
  store i8 1, ptr %6, align 1, !tbaa !5
  %22 = load i32, ptr @N, align 4, !tbaa !11
  %23 = add nsw i32 %22, -1
  %24 = icmp eq i32 %21, %23
  br i1 %24, label %78, label %25

25:                                               ; preds = %20
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #5
  %26 = getelementptr inbounds [200010 x %"class.std::set"], ptr @X, i64 0, i64 %5
  %27 = tail call ptr @_ZNKSt3setIiSt4lessIiESaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %26) #5
  store ptr %27, ptr %3, align 8
  %28 = load i32, ptr @N, align 4, !tbaa !11
  %29 = icmp sgt i32 %28, 0
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #5
  br i1 %29, label %.lr.ph, label %.critedge

.lr.ph:                                           ; preds = %25, %57
  %.027 = phi i32 [ %.1, %57 ], [ 0, %25 ]
  %30 = call ptr @_ZNKSt3setIiSt4lessIiESaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %26) #5
  store ptr %30, ptr %4, align 8
  %31 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorIiES2_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %4) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #5
  br i1 %31, label %32, label %.loopexit22.loopexit

32:                                               ; preds = %.lr.ph
  %33 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt23_Rb_tree_const_iteratorIiEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #5
  %34 = load i32, ptr %33, align 4, !tbaa !11
  %35 = icmp eq i32 %.027, %34
  br i1 %35, label %36, label %39

36:                                               ; preds = %32
  %37 = add nsw i32 %.027, 1
  %38 = call ptr @_ZNSt23_Rb_tree_const_iteratorIiEppEi(ptr noundef nonnull align 8 dereferenceable(8) %3, i32 noundef 0) #5
  br label %57

39:                                               ; preds = %32
  %40 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt23_Rb_tree_const_iteratorIiEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #5
  %41 = load i32, ptr %40, align 4, !tbaa !11
  %42 = icmp slt i32 %.027, %41
  br i1 %42, label %43, label %55

43:                                               ; preds = %39
  %44 = sext i32 %.027 to i64
  %45 = getelementptr inbounds [200010 x i8], ptr @visited, i64 0, i64 %44
  %46 = load i8, ptr %45, align 1, !tbaa !5, !range !9, !noundef !10
  %47 = trunc nuw i8 %46 to i1
  br i1 %47, label %53, label %48

48:                                               ; preds = %43
  call void @_Z3dfsii(i32 noundef %.027, i32 noundef %0)
  %49 = load i32, ptr @have, align 4, !tbaa !11
  %50 = load i32, ptr @N, align 4, !tbaa !11
  %51 = add nsw i32 %50, -1
  %52 = icmp eq i32 %49, %51
  br i1 %52, label %.loopexit, label %53

53:                                               ; preds = %48, %43
  %54 = add nsw i32 %.027, 1
  br label %57

55:                                               ; preds = %39
  %56 = call ptr @_ZNSt23_Rb_tree_const_iteratorIiEppEi(ptr noundef nonnull align 8 dereferenceable(8) %3, i32 noundef 0) #5
  br label %57

57:                                               ; preds = %53, %55, %36
  %.1 = phi i32 [ %37, %36 ], [ %54, %53 ], [ %.027, %55 ]
  %58 = load i32, ptr @N, align 4, !tbaa !11
  %59 = icmp slt i32 %.1, %58
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #5
  br i1 %59, label %.lr.ph, label %.critedge, !llvm.loop !13

.critedge:                                        ; preds = %57, %25
  %60 = phi i32 [ %28, %25 ], [ %58, %57 ]
  %.0.lcssa = phi i32 [ 0, %25 ], [ %.1, %57 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #5
  br label %.loopexit22

.loopexit22.loopexit:                             ; preds = %.lr.ph
  %.pre35 = load i32, ptr @N, align 4, !tbaa !11
  br label %.loopexit22

.loopexit22:                                      ; preds = %.loopexit22.loopexit, %.critedge
  %61 = phi i32 [ %60, %.critedge ], [ %.pre35, %.loopexit22.loopexit ]
  %.026 = phi i32 [ %.0.lcssa, %.critedge ], [ %.027, %.loopexit22.loopexit ]
  %62 = icmp slt i32 %.026, %61
  br i1 %62, label %.lr.ph29.preheader, label %.loopexit

.lr.ph29.preheader:                               ; preds = %.loopexit22
  %63 = sext i32 %.026 to i64
  br label %.lr.ph29

.lr.ph29:                                         ; preds = %.lr.ph29.preheader, %74
  %64 = phi i32 [ %61, %.lr.ph29.preheader ], [ %75, %74 ]
  %indvars.iv = phi i64 [ %63, %.lr.ph29.preheader ], [ %indvars.iv.next, %74 ]
  %65 = getelementptr inbounds [200010 x i8], ptr @visited, i64 0, i64 %indvars.iv
  %66 = load i8, ptr %65, align 1, !tbaa !5, !range !9, !noundef !10
  %67 = trunc nuw i8 %66 to i1
  br i1 %67, label %74, label %68

68:                                               ; preds = %.lr.ph29
  %69 = trunc nsw i64 %indvars.iv to i32
  call void @_Z3dfsii(i32 noundef %69, i32 noundef %0)
  %70 = load i32, ptr @have, align 4, !tbaa !11
  %71 = load i32, ptr @N, align 4, !tbaa !11
  %72 = add nsw i32 %71, -1
  %73 = icmp eq i32 %70, %72
  br i1 %73, label %.loopexit, label %74

74:                                               ; preds = %68, %.lr.ph29
  %75 = phi i32 [ %71, %68 ], [ %64, %.lr.ph29 ]
  %indvars.iv.next = add nsw i64 %indvars.iv, 1
  %76 = sext i32 %75 to i64
  %77 = icmp slt i64 %indvars.iv.next, %76
  br i1 %77, label %.lr.ph29, label %.loopexit, !llvm.loop !15

.loopexit:                                        ; preds = %48, %68, %74, %.loopexit22
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #5
  br label %78

78:                                               ; preds = %20, %2, %.loopexit
  ret void
}

; 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 #1

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) local_unnamed_addr #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 #0 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)) #1

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNKSt3setIiSt4lessIiESaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48)) local_unnamed_addr #4 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorIiES2_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #4

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNKSt3setIiSt4lessIiESaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(48)) local_unnamed_addr #4 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt23_Rb_tree_const_iteratorIiEdeEv(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #4 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt23_Rb_tree_const_iteratorIiEppEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) local_unnamed_addr #4 align 2

attributes #0 = { 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 #1 = { 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 #2 = { "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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { 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 #5 = { 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 = !{!"bool", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{i8 0, i8 2}
!10 = !{}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}


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