; LLVM IR from eyangch/competitive-programming :: USACOcontests/silver/2019.12 (milkvisits)

; 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::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::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"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 }
%"class.std::stack" = type { %"class.std::deque" }
%"class.std::deque" = type { %"class.std::_Deque_base" }
%"class.std::_Deque_base" = type { %"struct.std::_Deque_base<dfs_s, std::allocator<dfs_s>>::_Deque_impl" }
%"struct.std::_Deque_base<dfs_s, std::allocator<dfs_s>>::_Deque_impl" = type { %"struct.std::_Deque_base<dfs_s, std::allocator<dfs_s>>::_Deque_impl_data" }
%"struct.std::_Deque_base<dfs_s, std::allocator<dfs_s>>::_Deque_impl_data" = type { ptr, i64, %"struct.std::_Deque_iterator", %"struct.std::_Deque_iterator" }
%"struct.std::_Deque_iterator" = type { ptr, ptr, ptr, ptr }
%struct.dfs_s = type { i32, i8, i32 }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }

@_ZSt3cin = external global %"class.std::basic_istream", align 8
@.str = external hidden unnamed_addr constant [14 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [2 x i8], align 1
@stdin = external global ptr, align 8
@.str.2 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [2 x i8], align 1
@stdout = external global ptr, align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca %"class.std::__cxx11::basic_string", align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca [100005 x %"class.std::vector"], align 16
  %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 [100005 x i32], align 16
  %14 = alloca i32, align 4
  %15 = alloca %"class.std::stack", align 8
  %16 = alloca %struct.dfs_s, align 4
  %17 = alloca %struct.dfs_s, align 4
  %18 = alloca i32, align 4
  %19 = alloca ptr, align 8
  %20 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %21 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %22 = alloca i32, align 4
  %23 = alloca %struct.dfs_s, align 4
  %24 = alloca i32, align 4
  %25 = alloca i32, align 4
  %26 = alloca i32, align 4
  %27 = alloca i8, align 1
  store i32 0, ptr %1, align 4
  %28 = call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %29 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %30 = getelementptr i8, ptr %29, i64 -24
  %31 = load i64, ptr %30, align 8
  %32 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %31
  %33 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %32, ptr noundef null)
  %34 = load ptr, ptr @stdin, align 8, !tbaa !8
  %35 = call ptr @freopen(ptr noundef @.str, ptr noundef @.str.1, ptr noundef %34)
  %36 = load ptr, ptr @stdout, align 8, !tbaa !8
  %37 = call ptr @freopen(ptr noundef @.str.2, ptr noundef @.str.3, ptr noundef %36)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #8
  %38 = 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)
  %39 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %38, ptr noundef nonnull align 4 dereferenceable(4) %3)
  call void @llvm.lifetime.start.p0(i64 32, ptr %4) #8
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %4) #8
  %40 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(32) %4)
          to label %41 unwind label %55

41:                                               ; preds = %0
  call void @llvm.lifetime.start.p0(i64 2400120, ptr %7) #8
  %42 = getelementptr inbounds [100005 x %"class.std::vector"], ptr %7, i32 0, i32 0
  %43 = getelementptr inbounds %"class.std::vector", ptr %42, i64 100005
  br label %44

44:                                               ; preds = %44, %41
  %45 = phi ptr [ %42, %41 ], [ %46, %44 ]
  call void @_ZNSt6vectorIiSaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %45) #8
  %46 = getelementptr inbounds %"class.std::vector", ptr %45, i64 1
  %47 = icmp eq ptr %46, %43
  br i1 %47, label %48, label %44

48:                                               ; preds = %44
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #8
  store i32 0, ptr %8, align 4, !tbaa !11
  br label %49

49:                                               ; preds = %78, %48
  %50 = load i32, ptr %8, align 4, !tbaa !11
  %51 = load i32, ptr %2, align 4, !tbaa !11
  %52 = sub nsw i32 %51, 1
  %53 = icmp slt i32 %50, %52
  br i1 %53, label %59, label %54

54:                                               ; preds = %49
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #8
  br label %94

55:                                               ; preds = %0
  %56 = landingpad { ptr, i32 }
          cleanup
  %57 = extractvalue { ptr, i32 } %56, 0
  store ptr %57, ptr %5, align 8
  %58 = extractvalue { ptr, i32 } %56, 1
  store i32 %58, ptr %6, align 4
  br label %282

59:                                               ; preds = %49
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #8
  %60 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %9)
          to label %61 unwind label %81

61:                                               ; preds = %59
  %62 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %60, ptr noundef nonnull align 4 dereferenceable(4) %10)
          to label %63 unwind label %81

63:                                               ; preds = %61
  %64 = load i32, ptr %9, align 4, !tbaa !11
  %65 = sub nsw i32 %64, 1
  %66 = sext i32 %65 to i64
  %67 = getelementptr inbounds [100005 x %"class.std::vector"], ptr %7, i64 0, i64 %66
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #8
  %68 = load i32, ptr %10, align 4, !tbaa !11
  %69 = sub nsw i32 %68, 1
  store i32 %69, ptr %11, align 4, !tbaa !11
  invoke void @_ZNSt6vectorIiSaIiEE9push_backEOi(ptr noundef nonnull align 8 dereferenceable(24) %67, ptr noundef nonnull align 4 dereferenceable(4) %11)
          to label %70 unwind label %85

70:                                               ; preds = %63
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #8
  %71 = load i32, ptr %10, align 4, !tbaa !11
  %72 = sub nsw i32 %71, 1
  %73 = sext i32 %72 to i64
  %74 = getelementptr inbounds [100005 x %"class.std::vector"], ptr %7, i64 0, i64 %73
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #8
  %75 = load i32, ptr %9, align 4, !tbaa !11
  %76 = sub nsw i32 %75, 1
  store i32 %76, ptr %12, align 4, !tbaa !11
  invoke void @_ZNSt6vectorIiSaIiEE9push_backEOi(ptr noundef nonnull align 8 dereferenceable(24) %74, ptr noundef nonnull align 4 dereferenceable(4) %12)
          to label %77 unwind label %89

77:                                               ; preds = %70
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #8
  br label %78

78:                                               ; preds = %77
  %79 = load i32, ptr %8, align 4, !tbaa !11
  %80 = add nsw i32 %79, 1
  store i32 %80, ptr %8, align 4, !tbaa !11
  br label %49, !llvm.loop !13

81:                                               ; preds = %61, %59
  %82 = landingpad { ptr, i32 }
          cleanup
  %83 = extractvalue { ptr, i32 } %82, 0
  store ptr %83, ptr %5, align 8
  %84 = extractvalue { ptr, i32 } %82, 1
  store i32 %84, ptr %6, align 4
  br label %93

85:                                               ; preds = %63
  %86 = landingpad { ptr, i32 }
          cleanup
  %87 = extractvalue { ptr, i32 } %86, 0
  store ptr %87, ptr %5, align 8
  %88 = extractvalue { ptr, i32 } %86, 1
  store i32 %88, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #8
  br label %93

89:                                               ; preds = %70
  %90 = landingpad { ptr, i32 }
          cleanup
  %91 = extractvalue { ptr, i32 } %90, 0
  store ptr %91, ptr %5, align 8
  %92 = extractvalue { ptr, i32 } %90, 1
  store i32 %92, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #8
  br label %93

93:                                               ; preds = %89, %85, %81
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #8
  br label %274

94:                                               ; preds = %54
  call void @llvm.lifetime.start.p0(i64 400020, ptr %13) #8
  %95 = getelementptr inbounds [100005 x i32], ptr %13, i64 0, i64 0
  %96 = getelementptr inbounds [100005 x i32], ptr %13, i64 0, i64 0
  %97 = load i32, ptr %2, align 4, !tbaa !11
  %98 = sext i32 %97 to i64
  %99 = getelementptr inbounds i32, ptr %96, i64 %98
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #8
  store i32 -1, ptr %14, align 4, !tbaa !11
  invoke void @_ZSt4fillIPiiEvT_S1_RKT0_(ptr noundef %95, ptr noundef %99, ptr noundef nonnull align 4 dereferenceable(4) %14)
          to label %100 unwind label %124

100:                                              ; preds = %94
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #8
  call void @llvm.lifetime.start.p0(i64 80, ptr %15) #8
  invoke void @_ZNSt5stackI5dfs_sSt5dequeIS0_SaIS0_EEEC2IS3_vEEv(ptr noundef nonnull align 8 dereferenceable(80) %15)
          to label %101 unwind label %128

101:                                              ; preds = %100
  call void @llvm.lifetime.start.p0(i64 12, ptr %16) #8
  %102 = getelementptr inbounds %struct.dfs_s, ptr %16, i32 0, i32 0
  store i32 0, ptr %102, align 4, !tbaa !15
  %103 = getelementptr inbounds %struct.dfs_s, ptr %16, i32 0, i32 1
  %104 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %4, i64 noundef 0)
          to label %105 unwind label %132

105:                                              ; preds = %101
  %106 = load i8, ptr %104, align 1, !tbaa !17
  store i8 %106, ptr %103, align 4, !tbaa !18
  %107 = getelementptr inbounds %struct.dfs_s, ptr %16, i32 0, i32 2
  store i32 0, ptr %107, align 4, !tbaa !19
  invoke void @_ZNSt5stackI5dfs_sSt5dequeIS0_SaIS0_EEE4pushERKS0_(ptr noundef nonnull align 8 dereferenceable(80) %15, ptr noundef nonnull align 4 dereferenceable(12) %16)
          to label %108 unwind label %132

108:                                              ; preds = %105
  br label %109

109:                                              ; preds = %204, %202, %108
  %110 = invoke noundef zeroext i1 @_ZNKSt5stackI5dfs_sSt5dequeIS0_SaIS0_EEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %15)
          to label %111 unwind label %132

111:                                              ; preds = %109
  %112 = xor i1 %110, true
  br i1 %112, label %113, label %206

113:                                              ; preds = %111
  call void @llvm.lifetime.start.p0(i64 12, ptr %17) #8
  %114 = invoke noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt5stackI5dfs_sSt5dequeIS0_SaIS0_EEE3topEv(ptr noundef nonnull align 8 dereferenceable(80) %15)
          to label %115 unwind label %136

115:                                              ; preds = %113
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %17, ptr align 4 %114, i64 12, i1 false), !tbaa.struct !20
  invoke void @_ZNSt5stackI5dfs_sSt5dequeIS0_SaIS0_EEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %15)
          to label %116 unwind label %136

116:                                              ; preds = %115
  %117 = getelementptr inbounds %struct.dfs_s, ptr %17, i32 0, i32 0
  %118 = load i32, ptr %117, align 4, !tbaa !15
  %119 = sext i32 %118 to i64
  %120 = getelementptr inbounds [100005 x i32], ptr %13, i64 0, i64 %119
  %121 = load i32, ptr %120, align 4, !tbaa !11
  %122 = icmp ne i32 %121, -1
  br i1 %122, label %123, label %140

123:                                              ; preds = %116
  store i32 5, ptr %18, align 4
  br label %202, !llvm.loop !21

124:                                              ; preds = %94
  %125 = landingpad { ptr, i32 }
          cleanup
  %126 = extractvalue { ptr, i32 } %125, 0
  store ptr %126, ptr %5, align 8
  %127 = extractvalue { ptr, i32 } %125, 1
  store i32 %127, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #8
  br label %267

128:                                              ; preds = %100
  %129 = landingpad { ptr, i32 }
          cleanup
  %130 = extractvalue { ptr, i32 } %129, 0
  store ptr %130, ptr %5, align 8
  %131 = extractvalue { ptr, i32 } %129, 1
  store i32 %131, ptr %6, align 4
  br label %266

132:                                              ; preds = %260, %109, %105, %101
  %133 = landingpad { ptr, i32 }
          cleanup
  %134 = extractvalue { ptr, i32 } %133, 0
  store ptr %134, ptr %5, align 8
  %135 = extractvalue { ptr, i32 } %133, 1
  store i32 %135, ptr %6, align 4
  br label %265

136:                                              ; preds = %156, %140, %115, %113
  %137 = landingpad { ptr, i32 }
          cleanup
  %138 = extractvalue { ptr, i32 } %137, 0
  store ptr %138, ptr %5, align 8
  %139 = extractvalue { ptr, i32 } %137, 1
  store i32 %139, ptr %6, align 4
  br label %205

140:                                              ; preds = %116
  %141 = getelementptr inbounds %struct.dfs_s, ptr %17, i32 0, i32 0
  %142 = load i32, ptr %141, align 4, !tbaa !15
  %143 = sext i32 %142 to i64
  %144 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %4, i64 noundef %143)
          to label %145 unwind label %136

145:                                              ; preds = %140
  %146 = load i8, ptr %144, align 1, !tbaa !17
  %147 = sext i8 %146 to i32
  %148 = getelementptr inbounds %struct.dfs_s, ptr %17, i32 0, i32 1
  %149 = load i8, ptr %148, align 4, !tbaa !18
  %150 = sext i8 %149 to i32
  %151 = icmp ne i32 %147, %150
  br i1 %151, label %152, label %156

152:                                              ; preds = %145
  %153 = getelementptr inbounds %struct.dfs_s, ptr %17, i32 0, i32 0
  %154 = load i32, ptr %153, align 4, !tbaa !15
  %155 = getelementptr inbounds %struct.dfs_s, ptr %17, i32 0, i32 2
  store i32 %154, ptr %155, align 4, !tbaa !19
  br label %156

156:                                              ; preds = %152, %145
  %157 = getelementptr inbounds %struct.dfs_s, ptr %17, i32 0, i32 0
  %158 = load i32, ptr %157, align 4, !tbaa !15
  %159 = sext i32 %158 to i64
  %160 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %4, i64 noundef %159)
          to label %161 unwind label %136

161:                                              ; preds = %156
  %162 = load i8, ptr %160, align 1, !tbaa !17
  %163 = getelementptr inbounds %struct.dfs_s, ptr %17, i32 0, i32 1
  store i8 %162, ptr %163, align 4, !tbaa !18
  %164 = getelementptr inbounds %struct.dfs_s, ptr %17, i32 0, i32 2
  %165 = load i32, ptr %164, align 4, !tbaa !19
  %166 = getelementptr inbounds %struct.dfs_s, ptr %17, i32 0, i32 0
  %167 = load i32, ptr %166, align 4, !tbaa !15
  %168 = sext i32 %167 to i64
  %169 = getelementptr inbounds [100005 x i32], ptr %13, i64 0, i64 %168
  store i32 %165, ptr %169, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #8
  %170 = getelementptr inbounds %struct.dfs_s, ptr %17, i32 0, i32 0
  %171 = load i32, ptr %170, align 4, !tbaa !15
  %172 = sext i32 %171 to i64
  %173 = getelementptr inbounds [100005 x %"class.std::vector"], ptr %7, i64 0, i64 %172
  store ptr %173, ptr %19, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #8
  %174 = load ptr, ptr %19, align 8, !tbaa !8
  %175 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %174) #8
  %176 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %20, i32 0, i32 0
  store ptr %175, ptr %176, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #8
  %177 = load ptr, ptr %19, align 8, !tbaa !8
  %178 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %177) #8
  %179 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %21, i32 0, i32 0
  store ptr %178, ptr %179, align 8
  br label %180

180:                                              ; preds = %195, %161
  %181 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %20, ptr noundef nonnull align 8 dereferenceable(8) %21) #8
  br i1 %181, label %183, label %182

182:                                              ; preds = %180
  store i32 7, ptr %18, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #8
  br label %201

183:                                              ; preds = %180
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #8
  %184 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %20) #8
  %185 = load i32, ptr %184, align 4, !tbaa !11
  store i32 %185, ptr %22, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 12, ptr %23) #8
  %186 = getelementptr inbounds %struct.dfs_s, ptr %23, i32 0, i32 0
  %187 = load i32, ptr %22, align 4, !tbaa !11
  store i32 %187, ptr %186, align 4, !tbaa !15
  %188 = getelementptr inbounds %struct.dfs_s, ptr %23, i32 0, i32 1
  %189 = getelementptr inbounds %struct.dfs_s, ptr %17, i32 0, i32 1
  %190 = load i8, ptr %189, align 4, !tbaa !18
  store i8 %190, ptr %188, align 4, !tbaa !18
  %191 = getelementptr inbounds %struct.dfs_s, ptr %23, i32 0, i32 2
  %192 = getelementptr inbounds %struct.dfs_s, ptr %17, i32 0, i32 2
  %193 = load i32, ptr %192, align 4, !tbaa !19
  store i32 %193, ptr %191, align 4, !tbaa !19
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %16, ptr align 4 %23, i64 12, i1 false), !tbaa.struct !20
  call void @llvm.lifetime.end.p0(i64 12, ptr %23) #8
  invoke void @_ZNSt5stackI5dfs_sSt5dequeIS0_SaIS0_EEE4pushERKS0_(ptr noundef nonnull align 8 dereferenceable(80) %15, ptr noundef nonnull align 4 dereferenceable(12) %16)
          to label %194 unwind label %197

194:                                              ; preds = %183
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #8
  br label %195

195:                                              ; preds = %194
  %196 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %20) #8
  br label %180

197:                                              ; preds = %183
  %198 = landingpad { ptr, i32 }
          cleanup
  %199 = extractvalue { ptr, i32 } %198, 0
  store ptr %199, ptr %5, align 8
  %200 = extractvalue { ptr, i32 } %198, 1
  store i32 %200, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #8
  br label %205

201:                                              ; preds = %182
  store i32 0, ptr %18, align 4
  br label %202

202:                                              ; preds = %201, %123
  call void @llvm.lifetime.end.p0(i64 12, ptr %17) #8
  %203 = load i32, ptr %18, align 4
  switch i32 %203, label %288 [
    i32 0, label %204
    i32 5, label %109
  ]

204:                                              ; preds = %202
  br label %109, !llvm.loop !21

205:                                              ; preds = %197, %136
  call void @llvm.lifetime.end.p0(i64 12, ptr %17) #8
  br label %265

206:                                              ; preds = %111
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #8
  store i32 0, ptr %24, align 4, !tbaa !11
  br label %207

207:                                              ; preds = %256, %206
  %208 = load i32, ptr %24, align 4, !tbaa !11
  %209 = load i32, ptr %3, align 4, !tbaa !11
  %210 = icmp slt i32 %208, %209
  br i1 %210, label %212, label %211

211:                                              ; preds = %207
  store i32 9, ptr %18, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #8
  br label %260

212:                                              ; preds = %207
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #8
  %213 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %25)
          to label %214 unwind label %244

214:                                              ; preds = %212
  %215 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %213, ptr noundef nonnull align 4 dereferenceable(4) %26)
          to label %216 unwind label %244

216:                                              ; preds = %214
  call void @llvm.lifetime.start.p0(i64 1, ptr %27) #8
  %217 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcEERSt13basic_istreamIT_T0_ES6_RS3_(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 1 dereferenceable(1) %27)
          to label %218 unwind label %248

218:                                              ; preds = %216
  %219 = load i32, ptr %25, align 4, !tbaa !11
  %220 = sub nsw i32 %219, 1
  %221 = sext i32 %220 to i64
  %222 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %4, i64 noundef %221)
          to label %223 unwind label %248

223:                                              ; preds = %218
  %224 = load i8, ptr %222, align 1, !tbaa !17
  %225 = sext i8 %224 to i32
  %226 = load i8, ptr %27, align 1, !tbaa !17
  %227 = sext i8 %226 to i32
  %228 = icmp eq i32 %225, %227
  br i1 %228, label %241, label %229

229:                                              ; preds = %223
  %230 = load i32, ptr %25, align 4, !tbaa !11
  %231 = sub nsw i32 %230, 1
  %232 = sext i32 %231 to i64
  %233 = getelementptr inbounds [100005 x i32], ptr %13, i64 0, i64 %232
  %234 = load i32, ptr %233, align 4, !tbaa !11
  %235 = load i32, ptr %26, align 4, !tbaa !11
  %236 = sub nsw i32 %235, 1
  %237 = sext i32 %236 to i64
  %238 = getelementptr inbounds [100005 x i32], ptr %13, i64 0, i64 %237
  %239 = load i32, ptr %238, align 4, !tbaa !11
  %240 = icmp ne i32 %234, %239
  br i1 %240, label %241, label %252

241:                                              ; preds = %229, %223
  %242 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef 1)
          to label %243 unwind label %248

243:                                              ; preds = %241
  br label %255

244:                                              ; preds = %214, %212
  %245 = landingpad { ptr, i32 }
          cleanup
  %246 = extractvalue { ptr, i32 } %245, 0
  store ptr %246, ptr %5, align 8
  %247 = extractvalue { ptr, i32 } %245, 1
  store i32 %247, ptr %6, align 4
  br label %259

248:                                              ; preds = %252, %241, %218, %216
  %249 = landingpad { ptr, i32 }
          cleanup
  %250 = extractvalue { ptr, i32 } %249, 0
  store ptr %250, ptr %5, align 8
  %251 = extractvalue { ptr, i32 } %249, 1
  store i32 %251, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 1, ptr %27) #8
  br label %259

252:                                              ; preds = %229
  %253 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef 0)
          to label %254 unwind label %248

254:                                              ; preds = %252
  br label %255

255:                                              ; preds = %254, %243
  call void @llvm.lifetime.end.p0(i64 1, ptr %27) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #8
  br label %256

256:                                              ; preds = %255
  %257 = load i32, ptr %24, align 4, !tbaa !11
  %258 = add nsw i32 %257, 1
  store i32 %258, ptr %24, align 4, !tbaa !11
  br label %207, !llvm.loop !22

259:                                              ; preds = %248, %244
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #8
  br label %265

260:                                              ; preds = %211
  %261 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %262 unwind label %132

262:                                              ; preds = %260
  store i32 0, ptr %1, align 4
  store i32 1, ptr %18, align 4
  call void @llvm.lifetime.end.p0(i64 12, ptr %16) #8
  call void @_ZNSt5stackI5dfs_sSt5dequeIS0_SaIS0_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %15) #8
  call void @llvm.lifetime.end.p0(i64 80, ptr %15) #8
  call void @llvm.lifetime.end.p0(i64 400020, ptr %13) #8
  %263 = getelementptr inbounds [100005 x %"class.std::vector"], ptr %7, i32 0, i32 0
  %264 = getelementptr inbounds %"class.std::vector", ptr %263, i64 100005
  br label %268

265:                                              ; preds = %259, %205, %132
  call void @llvm.lifetime.end.p0(i64 12, ptr %16) #8
  call void @_ZNSt5stackI5dfs_sSt5dequeIS0_SaIS0_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %15) #8
  br label %266

266:                                              ; preds = %265, %128
  call void @llvm.lifetime.end.p0(i64 80, ptr %15) #8
  br label %267

267:                                              ; preds = %266, %124
  call void @llvm.lifetime.end.p0(i64 400020, ptr %13) #8
  br label %274

268:                                              ; preds = %268, %262
  %269 = phi ptr [ %264, %262 ], [ %270, %268 ]
  %270 = getelementptr inbounds %"class.std::vector", ptr %269, i64 -1
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %270) #8
  %271 = icmp eq ptr %270, %263
  br i1 %271, label %272, label %268

272:                                              ; preds = %268
  call void @llvm.lifetime.end.p0(i64 2400120, ptr %7) #8
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %4) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr %4) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #8
  %273 = load i32, ptr %1, align 4
  ret i32 %273

274:                                              ; preds = %267, %93
  %275 = getelementptr inbounds [100005 x %"class.std::vector"], ptr %7, i32 0, i32 0
  %276 = getelementptr inbounds %"class.std::vector", ptr %275, i64 100005
  br label %277

277:                                              ; preds = %277, %274
  %278 = phi ptr [ %276, %274 ], [ %279, %277 ]
  %279 = getelementptr inbounds %"class.std::vector", ptr %278, i64 -1
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %279) #8
  %280 = icmp eq ptr %279, %275
  br i1 %280, label %281, label %277

281:                                              ; preds = %277
  call void @llvm.lifetime.end.p0(i64 2400120, ptr %7) #8
  br label %282

282:                                              ; preds = %281, %55
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %4) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr %4) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #8
  br label %283

283:                                              ; preds = %282
  %284 = load ptr, ptr %5, align 8
  %285 = load i32, ptr %6, align 4
  %286 = insertvalue { ptr, i32 } poison, ptr %284, 0
  %287 = insertvalue { ptr, i32 } %286, i32 %285, 1
  resume { ptr, i32 } %287

288:                                              ; preds = %202
  unreachable
}

declare noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext) #1

; Function Attrs: mustprogress nounwind uwtable
declare noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264), ptr noundef) #2 align 2

declare ptr @freopen(ptr noundef, ptr noundef, ptr noundef) #1

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

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

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #2 align 2

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(32)) #1

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIiSaIiEE9push_backEOi(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(4)) #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: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4fillIPiiEvT_S1_RKT0_(ptr noundef, ptr noundef, ptr noundef nonnull align 4 dereferenceable(4)) #5

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt5stackI5dfs_sSt5dequeIS0_SaIS0_EEEC2IS3_vEEv(ptr noundef nonnull align 8 dereferenceable(80)) unnamed_addr #4 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt5stackI5dfs_sSt5dequeIS0_SaIS0_EEE4pushERKS0_(ptr noundef nonnull align 8 dereferenceable(80), ptr noundef nonnull align 4 dereferenceable(12)) #4 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNKSt5stackI5dfs_sSt5dequeIS0_SaIS0_EEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80)) #2 align 2

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #6

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

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

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

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

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

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

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcEERSt13basic_istreamIT_T0_ES6_RS3_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 1 dereferenceable(1)) #1

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #2 align 2

attributes #0 = { 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 #1 = { "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 nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { 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 #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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 = { 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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"any pointer", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !10, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = !{!16, !12, i64 0}
!16 = !{!"_ZTS5dfs_s", !12, i64 0, !10, i64 4, !12, i64 8}
!17 = !{!10, !10, i64 0}
!18 = !{!16, !10, i64 4}
!19 = !{!16, !12, i64 8}
!20 = !{i64 0, i64 4, !11, i64 4, i64 1, !17, i64 8, i64 4, !11}
!21 = distinct !{!21, !14}
!22 = distinct !{!22, !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::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::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"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 }
%"class.std::stack" = type { %"class.std::deque" }
%"class.std::deque" = type { %"class.std::_Deque_base" }
%"class.std::_Deque_base" = type { %"struct.std::_Deque_base<dfs_s, std::allocator<dfs_s>>::_Deque_impl" }
%"struct.std::_Deque_base<dfs_s, std::allocator<dfs_s>>::_Deque_impl" = type { %"struct.std::_Deque_base<dfs_s, std::allocator<dfs_s>>::_Deque_impl_data" }
%"struct.std::_Deque_base<dfs_s, std::allocator<dfs_s>>::_Deque_impl_data" = type { ptr, i64, %"struct.std::_Deque_iterator", %"struct.std::_Deque_iterator" }
%"struct.std::_Deque_iterator" = type { ptr, ptr, ptr, ptr }
%struct.dfs_s = type { i32, i8, i32 }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }

@_ZSt3cin = external global %"class.std::basic_istream", align 8
@.str = external hidden unnamed_addr constant [14 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [2 x i8], align 1
@stdin = external local_unnamed_addr global ptr, align 8
@.str.2 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [2 x i8], align 1
@stdout = external local_unnamed_addr global ptr, align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca %"class.std::__cxx11::basic_string", align 8
  %4 = alloca [100005 x %"class.std::vector"], align 16
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca [100005 x i32], align 16
  %10 = alloca i32, align 4
  %11 = alloca %"class.std::stack", align 8
  %12 = alloca %struct.dfs_s, align 4
  %13 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %14 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i8, align 1
  %18 = tail call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %19 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %20 = getelementptr i8, ptr %19, i64 -24
  %21 = load i64, ptr %20, align 8
  %22 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %21
  %23 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %22, ptr noundef null)
  %24 = load ptr, ptr @stdin, align 8, !tbaa !8
  %25 = tail call ptr @freopen(ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, ptr noundef %24)
  %26 = load ptr, ptr @stdout, align 8, !tbaa !8
  %27 = tail call ptr @freopen(ptr noundef nonnull @.str.2, ptr noundef nonnull @.str.3, ptr noundef %26)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #7
  %28 = 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)
  %29 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %28, ptr noundef nonnull align 4 dereferenceable(4) %2)
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %3) #7
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %3) #7
  %30 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(32) %3)
          to label %31 unwind label %39

31:                                               ; preds = %0
  call void @llvm.lifetime.start.p0(i64 2400120, ptr nonnull %4) #7
  br label %32

32:                                               ; preds = %32, %31
  %.idx = phi i64 [ 0, %31 ], [ %.add, %32 ]
  %.ptr = getelementptr inbounds i8, ptr %4, i64 %.idx
  call void @_ZNSt6vectorIiSaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %.ptr) #7
  %.add = add nuw nsw i64 %.idx, 24
  %33 = icmp eq i64 %.add, 2400120
  br i1 %33, label %.preheader44, label %32

.preheader44:                                     ; preds = %32
  %34 = getelementptr inbounds i8, ptr %4, i64 2400120
  %35 = load i32, ptr %1, align 4, !tbaa !11
  %36 = icmp sgt i32 %35, 1
  br i1 %36, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %58, %.preheader44
  %.lcssa = phi i32 [ %35, %.preheader44 ], [ %60, %58 ]
  call void @llvm.lifetime.start.p0(i64 400020, ptr nonnull %9) #7
  %37 = sext i32 %.lcssa to i64
  %38 = getelementptr inbounds i32, ptr %9, i64 %37
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %10) #7
  store i32 -1, ptr %10, align 4, !tbaa !11
  invoke void @_ZSt4fillIPiiEvT_S1_RKT0_(ptr noundef nonnull %9, ptr noundef nonnull %38, ptr noundef nonnull align 4 dereferenceable(4) %10)
          to label %70 unwind label %83

39:                                               ; preds = %0
  %40 = landingpad { ptr, i32 }
          cleanup
  br label %159

.lr.ph:                                           ; preds = %.preheader44, %58
  %.02748 = phi i32 [ %59, %58 ], [ 0, %.preheader44 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #7
  %41 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %5)
          to label %42 unwind label %63

42:                                               ; preds = %.lr.ph
  %43 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %41, ptr noundef nonnull align 4 dereferenceable(4) %6)
          to label %44 unwind label %63

44:                                               ; preds = %42
  %45 = load i32, ptr %5, align 4, !tbaa !11
  %46 = add nsw i32 %45, -1
  %47 = sext i32 %46 to i64
  %48 = getelementptr inbounds [100005 x %"class.std::vector"], ptr %4, i64 0, i64 %47
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #7
  %49 = load i32, ptr %6, align 4, !tbaa !11
  %50 = add nsw i32 %49, -1
  store i32 %50, ptr %7, align 4, !tbaa !11
  invoke void @_ZNSt6vectorIiSaIiEE9push_backEOi(ptr noundef nonnull align 8 dereferenceable(24) %48, ptr noundef nonnull align 4 dereferenceable(4) %7)
          to label %51 unwind label %65

51:                                               ; preds = %44
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #7
  %52 = load i32, ptr %6, align 4, !tbaa !11
  %53 = add nsw i32 %52, -1
  %54 = sext i32 %53 to i64
  %55 = getelementptr inbounds [100005 x %"class.std::vector"], ptr %4, i64 0, i64 %54
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #7
  %56 = load i32, ptr %5, align 4, !tbaa !11
  %57 = add nsw i32 %56, -1
  store i32 %57, ptr %8, align 4, !tbaa !11
  invoke void @_ZNSt6vectorIiSaIiEE9push_backEOi(ptr noundef nonnull align 8 dereferenceable(24) %55, ptr noundef nonnull align 4 dereferenceable(4) %8)
          to label %58 unwind label %67

58:                                               ; preds = %51
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #7
  %59 = add nuw nsw i32 %.02748, 1
  %60 = load i32, ptr %1, align 4, !tbaa !11
  %61 = add nsw i32 %60, -1
  %62 = icmp slt i32 %59, %61
  br i1 %62, label %.lr.ph, label %._crit_edge, !llvm.loop !13

63:                                               ; preds = %42, %.lr.ph
  %64 = landingpad { ptr, i32 }
          cleanup
  br label %69

65:                                               ; preds = %44
  %66 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #7
  br label %69

67:                                               ; preds = %51
  %68 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #7
  br label %69

69:                                               ; preds = %67, %65, %63
  %.pn39 = phi { ptr, i32 } [ %68, %67 ], [ %66, %65 ], [ %64, %63 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #7
  br label %153

70:                                               ; preds = %._crit_edge
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %10) #7
  call void @llvm.lifetime.start.p0(i64 80, ptr nonnull %11) #7
  invoke void @_ZNSt5stackI5dfs_sSt5dequeIS0_SaIS0_EEEC2IS3_vEEv(ptr noundef nonnull align 8 dereferenceable(80) %11)
          to label %71 unwind label %85

71:                                               ; preds = %70
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %12) #7
  store i32 0, ptr %12, align 4, !tbaa !15
  %72 = getelementptr inbounds i8, ptr %12, i64 4
  %73 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %3, i64 noundef 0)
  %74 = load i8, ptr %73, align 1, !tbaa !17
  store i8 %74, ptr %72, align 4, !tbaa !18
  %75 = getelementptr inbounds i8, ptr %12, i64 8
  store i32 0, ptr %75, align 4, !tbaa !19
  invoke void @_ZNSt5stackI5dfs_sSt5dequeIS0_SaIS0_EEE4pushERKS0_(ptr noundef nonnull align 8 dereferenceable(80) %11, ptr noundef nonnull align 4 dereferenceable(12) %12)
          to label %.preheader43 unwind label %87

.preheader43:                                     ; preds = %71
  %76 = call noundef zeroext i1 @_ZNKSt5stackI5dfs_sSt5dequeIS0_SaIS0_EEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %11)
  br i1 %76, label %.preheader, label %.lr.ph52

.preheader:                                       ; preds = %105, %.preheader43
  %77 = load i32, ptr %2, align 4, !tbaa !11
  %78 = icmp sgt i32 %77, 0
  br i1 %78, label %.lr.ph54, label %._crit_edge55

.lr.ph52:                                         ; preds = %.preheader43, %105
  %79 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt5stackI5dfs_sSt5dequeIS0_SaIS0_EEE3topEv(ptr noundef nonnull align 8 dereferenceable(80) %11)
  %.sroa.05.0.copyload = load i32, ptr %79, align 4, !tbaa !11
  %.sroa.10.0..sroa_idx = getelementptr inbounds i8, ptr %79, i64 4
  %.sroa.10.0.copyload = load i8, ptr %.sroa.10.0..sroa_idx, align 4, !tbaa !17
  %.sroa.1312.0..sroa_idx = getelementptr inbounds i8, ptr %79, i64 8
  %.sroa.1312.0.copyload = load i32, ptr %.sroa.1312.0..sroa_idx, align 4, !tbaa !11
  call void @_ZNSt5stackI5dfs_sSt5dequeIS0_SaIS0_EEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %11)
  %80 = sext i32 %.sroa.05.0.copyload to i64
  %81 = getelementptr inbounds [100005 x i32], ptr %9, i64 0, i64 %80
  %82 = load i32, ptr %81, align 4, !tbaa !11
  %.not33 = icmp eq i32 %82, -1
  br i1 %.not33, label %89, label %105, !llvm.loop !20

83:                                               ; preds = %._crit_edge
  %84 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %10) #7
  br label %147

85:                                               ; preds = %70
  %86 = landingpad { ptr, i32 }
          cleanup
  br label %146

87:                                               ; preds = %._crit_edge55, %71
  %88 = landingpad { ptr, i32 }
          cleanup
  br label %145

89:                                               ; preds = %.lr.ph52
  %90 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %3, i64 noundef %80)
  %91 = load i8, ptr %90, align 1, !tbaa !17
  %.not34 = icmp eq i8 %91, %.sroa.10.0.copyload
  %spec.select = select i1 %.not34, i32 %.sroa.1312.0.copyload, i32 %.sroa.05.0.copyload
  %92 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %3, i64 noundef %80)
  %93 = load i8, ptr %92, align 1, !tbaa !17
  store i32 %spec.select, ptr %81, align 4, !tbaa !11
  %94 = getelementptr inbounds [100005 x %"class.std::vector"], ptr %4, i64 0, i64 %80
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %13) #7
  %95 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %94) #7
  store ptr %95, ptr %13, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %14) #7
  %96 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %94) #7
  store ptr %96, ptr %14, align 8
  %97 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %13, ptr noundef nonnull align 8 dereferenceable(8) %14) #7
  br i1 %97, label %.lr.ph50, label %._crit_edge51

._crit_edge51:                                    ; preds = %100, %89
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %14) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %13) #7
  br label %105

.lr.ph50:                                         ; preds = %89, %100
  %98 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %13) #7
  %99 = load i32, ptr %98, align 4, !tbaa !11
  store i32 %99, ptr %12, align 4, !tbaa !11
  store i8 %93, ptr %72, align 4, !tbaa !17
  store i32 %spec.select, ptr %75, align 4, !tbaa !11
  invoke void @_ZNSt5stackI5dfs_sSt5dequeIS0_SaIS0_EEE4pushERKS0_(ptr noundef nonnull align 8 dereferenceable(80) %11, ptr noundef nonnull align 4 dereferenceable(12) %12)
          to label %100 unwind label %103

100:                                              ; preds = %.lr.ph50
  %101 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %13) #7
  %102 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %13, ptr noundef nonnull align 8 dereferenceable(8) %14) #7
  br i1 %102, label %.lr.ph50, label %._crit_edge51

103:                                              ; preds = %.lr.ph50
  %104 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %14) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %13) #7
  br label %145

105:                                              ; preds = %.lr.ph52, %._crit_edge51
  %106 = call noundef zeroext i1 @_ZNKSt5stackI5dfs_sSt5dequeIS0_SaIS0_EEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %11)
  br i1 %106, label %.preheader, label %.lr.ph52

._crit_edge55:                                    ; preds = %139, %.preheader
  %107 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %144 unwind label %87

.lr.ph54:                                         ; preds = %.preheader, %139
  %.053 = phi i32 [ %140, %139 ], [ 0, %.preheader ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %15) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %16) #7
  %108 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %15)
          to label %109 unwind label %133

109:                                              ; preds = %.lr.ph54
  %110 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %108, ptr noundef nonnull align 4 dereferenceable(4) %16)
          to label %111 unwind label %133

111:                                              ; preds = %109
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %17) #7
  %112 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcEERSt13basic_istreamIT_T0_ES6_RS3_(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 1 dereferenceable(1) %17)
          to label %113 unwind label %135

113:                                              ; preds = %111
  %114 = load i32, ptr %15, align 4, !tbaa !11
  %115 = add nsw i32 %114, -1
  %116 = sext i32 %115 to i64
  %117 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %3, i64 noundef %116)
  %118 = load i8, ptr %117, align 1, !tbaa !17
  %119 = load i8, ptr %17, align 1, !tbaa !17
  %120 = icmp eq i8 %118, %119
  br i1 %120, label %132, label %121

121:                                              ; preds = %113
  %122 = load i32, ptr %15, align 4, !tbaa !11
  %123 = add nsw i32 %122, -1
  %124 = sext i32 %123 to i64
  %125 = getelementptr inbounds [100005 x i32], ptr %9, i64 0, i64 %124
  %126 = load i32, ptr %125, align 4, !tbaa !11
  %127 = load i32, ptr %16, align 4, !tbaa !11
  %128 = add nsw i32 %127, -1
  %129 = sext i32 %128 to i64
  %130 = getelementptr inbounds [100005 x i32], ptr %9, i64 0, i64 %129
  %131 = load i32, ptr %130, align 4, !tbaa !11
  %.not = icmp eq i32 %126, %131
  br i1 %.not, label %.invoke, label %132

132:                                              ; preds = %121, %113
  br label %.invoke

133:                                              ; preds = %109, %.lr.ph54
  %134 = landingpad { ptr, i32 }
          cleanup
  br label %143

135:                                              ; preds = %.invoke, %111
  %136 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %17) #7
  br label %143

.invoke:                                          ; preds = %121, %132
  %137 = phi i32 [ 1, %132 ], [ 0, %121 ]
  %138 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %137)
          to label %139 unwind label %135

139:                                              ; preds = %.invoke
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %17) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %16) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %15) #7
  %140 = add nuw nsw i32 %.053, 1
  %141 = load i32, ptr %2, align 4, !tbaa !11
  %142 = icmp slt i32 %140, %141
  br i1 %142, label %.lr.ph54, label %._crit_edge55, !llvm.loop !21

143:                                              ; preds = %135, %133
  %.pn = phi { ptr, i32 } [ %136, %135 ], [ %134, %133 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %16) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %15) #7
  br label %145

144:                                              ; preds = %._crit_edge55
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %12) #7
  call void @_ZNSt5stackI5dfs_sSt5dequeIS0_SaIS0_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %11) #7
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %11) #7
  call void @llvm.lifetime.end.p0(i64 400020, ptr nonnull %9) #7
  br label %148

145:                                              ; preds = %143, %103, %87
  %.pn35 = phi { ptr, i32 } [ %104, %103 ], [ %.pn, %143 ], [ %88, %87 ]
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %12) #7
  call void @_ZNSt5stackI5dfs_sSt5dequeIS0_SaIS0_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %11) #7
  br label %146

146:                                              ; preds = %145, %85
  %.pn35.pn = phi { ptr, i32 } [ %.pn35, %145 ], [ %86, %85 ]
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %11) #7
  br label %147

147:                                              ; preds = %146, %83
  %.pn35.pn.pn = phi { ptr, i32 } [ %.pn35.pn, %146 ], [ %84, %83 ]
  call void @llvm.lifetime.end.p0(i64 400020, ptr nonnull %9) #7
  br label %153

148:                                              ; preds = %148, %144
  %149 = phi ptr [ %34, %144 ], [ %150, %148 ]
  %150 = getelementptr inbounds i8, ptr %149, i64 -24
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %150) #7
  %151 = icmp eq ptr %150, %4
  br i1 %151, label %152, label %148

152:                                              ; preds = %148
  call void @llvm.lifetime.end.p0(i64 2400120, ptr nonnull %4) #7
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %3) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %3) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #7
  ret i32 0

153:                                              ; preds = %147, %69
  %.pn39.pn = phi { ptr, i32 } [ %.pn39, %69 ], [ %.pn35.pn.pn, %147 ]
  br label %154

154:                                              ; preds = %154, %153
  %155 = phi ptr [ %34, %153 ], [ %156, %154 ]
  %156 = getelementptr inbounds i8, ptr %155, i64 -24
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %156) #7
  %157 = icmp eq ptr %156, %4
  br i1 %157, label %158, label %154

158:                                              ; preds = %154
  call void @llvm.lifetime.end.p0(i64 2400120, ptr nonnull %4) #7
  br label %159

159:                                              ; preds = %158, %39
  %.pn39.pn.pn = phi { ptr, i32 } [ %.pn39.pn, %158 ], [ %40, %39 ]
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %3) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %3) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #7
  resume { ptr, i32 } %.pn39.pn.pn
}

declare noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext) local_unnamed_addr #1

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

declare ptr @freopen(ptr noundef, ptr noundef, ptr 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) #3

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

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #2 align 2

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #1

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIiSaIiEE9push_backEOi(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(4)) 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: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4fillIPiiEvT_S1_RKT0_(ptr noundef, ptr noundef, ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #5

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt5stackI5dfs_sSt5dequeIS0_SaIS0_EEEC2IS3_vEEv(ptr noundef nonnull align 8 dereferenceable(80)) unnamed_addr #4 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt5stackI5dfs_sSt5dequeIS0_SaIS0_EEE4pushERKS0_(ptr noundef nonnull align 8 dereferenceable(80), ptr noundef nonnull align 4 dereferenceable(12)) local_unnamed_addr #4 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNKSt5stackI5dfs_sSt5dequeIS0_SaIS0_EEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80)) local_unnamed_addr #2 align 2

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

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

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

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

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

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

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

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcEERSt13basic_istreamIT_T0_ES6_RS3_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 1 dereferenceable(1)) 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 #1

; 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 #4 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)) #5

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZNSt5stackI5dfs_sSt5dequeIS0_SaIS0_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80)) unnamed_addr #6 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #2 align 2

attributes #0 = { 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 #1 = { "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 nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { 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 #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 = { 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 #7 = { 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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"any pointer", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !10, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = !{!16, !12, i64 0}
!16 = !{!"_ZTS5dfs_s", !12, i64 0, !10, i64 4, !12, i64 8}
!17 = !{!10, !10, i64 0}
!18 = !{!16, !10, i64 4}
!19 = !{!16, !12, i64 8}
!20 = distinct !{!20, !14}
!21 = distinct !{!21, !14}


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