; LLVM IR from eyangch/competitive-programming :: Codeforces/1635 (e)

; 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::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl" }
%"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl" = type { %"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl_data" }
%"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"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.__gnu_cxx::__normal_iterator" = type { ptr }
%"class.std::queue" = type { %"class.std::deque" }
%"class.std::deque" = type { %"class.std::_Deque_base" }
%"class.std::_Deque_base" = type { %"struct.std::_Deque_base<long long, std::allocator<long long>>::_Deque_impl" }
%"struct.std::_Deque_base<long long, std::allocator<long long>>::_Deque_impl" = type { %"struct.std::_Deque_base<long long, std::allocator<long long>>::_Deque_impl_data" }
%"struct.std::_Deque_base<long long, std::allocator<long long>>::_Deque_impl_data" = type { ptr, i64, %"struct.std::_Deque_iterator", %"struct.std::_Deque_iterator" }
%"struct.std::_Deque_iterator" = type { ptr, ptr, ptr, ptr }

@N = external dso_local global i64, align 8
@M = external dso_local global i64, align 8
@O = external dso_local global [200000 x i64], align 16
@Q2 = external dso_local global [200000 x i64], align 16
@Q3 = external dso_local global [200000 x i64], align 16
@din = external dso_local global [200000 x i64], align 16
@tcnt = external dso_local global i64, align 8
@ans = external dso_local global [200000 x i64], align 16
@Q1 = external dso_local global [200000 x i8], align 16
@ori = external dso_local global [200000 x %"class.std::vector"], align 16
@topo = external dso_local global [200000 x %"class.std::vector"], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z8add_edgexxb(i64 noundef, i64 noundef, i1 noundef zeroext) #0

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_Z3dfsxx(i64 noundef, i64 noundef) #0

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

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

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

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

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

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

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #4 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca i64, align 8
  %3 = alloca i64, align 8
  %4 = alloca i64, align 8
  %5 = alloca i64, align 8
  %6 = alloca i64, align 8
  %7 = alloca i32, align 4
  %8 = alloca i64, align 8
  %9 = alloca i64, align 8
  %10 = alloca ptr, align 8
  %11 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %12 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %13 = alloca i64, align 8
  %14 = alloca %"class.std::queue", align 8
  %15 = alloca i64, align 8
  %16 = alloca ptr, align 8
  %17 = alloca i32, align 4
  %18 = alloca i64, align 8
  %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 i64, align 8
  %23 = alloca i64, align 8
  store i32 0, ptr %1, align 4
  %24 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %25 = getelementptr i8, ptr %24, i64 -24
  %26 = load i64, ptr %25, align 8
  %27 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %26
  %28 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %27, ptr noundef null)
  %29 = call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %30 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) @N)
  %31 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %30, ptr noundef nonnull align 8 dereferenceable(8) @M)
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #7
  store i64 0, ptr %2, align 8, !tbaa !8
  br label %32

32:                                               ; preds = %61, %0
  %33 = load i64, ptr %2, align 8, !tbaa !8
  %34 = load i64, ptr @M, align 8, !tbaa !8
  %35 = icmp slt i64 %33, %34
  br i1 %35, label %37, label %36

36:                                               ; preds = %32
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #7
  br label %64

37:                                               ; preds = %32
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #7
  %38 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %3)
  %39 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %38, ptr noundef nonnull align 8 dereferenceable(8) %4)
  %40 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %39, ptr noundef nonnull align 8 dereferenceable(8) %5)
  %41 = load i64, ptr %4, align 8, !tbaa !8
  %42 = add nsw i64 %41, -1
  store i64 %42, ptr %4, align 8, !tbaa !8
  %43 = load i64, ptr %5, align 8, !tbaa !8
  %44 = add nsw i64 %43, -1
  store i64 %44, ptr %5, align 8, !tbaa !8
  %45 = load i64, ptr %3, align 8, !tbaa !8
  %46 = sub nsw i64 %45, 1
  %47 = icmp ne i64 %46, 0
  %48 = load i64, ptr %2, align 8, !tbaa !8
  %49 = getelementptr inbounds [200000 x i8], ptr @Q1, i64 0, i64 %48
  %50 = zext i1 %47 to i8
  store i8 %50, ptr %49, align 1, !tbaa !11
  %51 = load i64, ptr %4, align 8, !tbaa !8
  %52 = load i64, ptr %2, align 8, !tbaa !8
  %53 = getelementptr inbounds [200000 x i64], ptr @Q2, i64 0, i64 %52
  store i64 %51, ptr %53, align 8, !tbaa !8
  %54 = load i64, ptr %5, align 8, !tbaa !8
  %55 = load i64, ptr %2, align 8, !tbaa !8
  %56 = getelementptr inbounds [200000 x i64], ptr @Q3, i64 0, i64 %55
  store i64 %54, ptr %56, align 8, !tbaa !8
  %57 = load i64, ptr %4, align 8, !tbaa !8
  %58 = getelementptr inbounds [200000 x %"class.std::vector"], ptr @ori, i64 0, i64 %57
  call void @_ZNSt6vectorIxSaIxEE9push_backERKx(ptr noundef nonnull align 8 dereferenceable(24) %58, ptr noundef nonnull align 8 dereferenceable(8) %5)
  %59 = load i64, ptr %5, align 8, !tbaa !8
  %60 = getelementptr inbounds [200000 x %"class.std::vector"], ptr @ori, i64 0, i64 %59
  call void @_ZNSt6vectorIxSaIxEE9push_backERKx(ptr noundef nonnull align 8 dereferenceable(24) %60, ptr noundef nonnull align 8 dereferenceable(8) %4)
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #7
  br label %61

61:                                               ; preds = %37
  %62 = load i64, ptr %2, align 8, !tbaa !8
  %63 = add nsw i64 %62, 1
  store i64 %63, ptr %2, align 8, !tbaa !8
  br label %32, !llvm.loop !13

64:                                               ; preds = %36
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #7
  store i64 0, ptr %6, align 8, !tbaa !8
  br label %65

65:                                               ; preds = %83, %64
  %66 = load i64, ptr %6, align 8, !tbaa !8
  %67 = load i64, ptr @N, align 8, !tbaa !8
  %68 = icmp slt i64 %66, %67
  br i1 %68, label %70, label %69

69:                                               ; preds = %65
  store i32 5, ptr %7, align 4
  br label %86

70:                                               ; preds = %65
  %71 = load i64, ptr %6, align 8, !tbaa !8
  %72 = getelementptr inbounds [200000 x i64], ptr @O, i64 0, i64 %71
  %73 = load i64, ptr %72, align 8, !tbaa !8
  %74 = icmp sgt i64 %73, 0
  br i1 %74, label %75, label %76

75:                                               ; preds = %70
  br label %83

76:                                               ; preds = %70
  %77 = load i64, ptr %6, align 8, !tbaa !8
  %78 = call noundef zeroext i1 @_Z3dfsxx(i64 noundef %77, i64 noundef 1)
  br i1 %78, label %82, label %79

79:                                               ; preds = %76
  %80 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str)
  %81 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %80, i8 noundef signext 10)
  store i32 0, ptr %1, align 4
  store i32 1, ptr %7, align 4
  br label %86

82:                                               ; preds = %76
  br label %83

83:                                               ; preds = %82, %75
  %84 = load i64, ptr %6, align 8, !tbaa !8
  %85 = add nsw i64 %84, 1
  store i64 %85, ptr %6, align 8, !tbaa !8
  br label %65, !llvm.loop !15

86:                                               ; preds = %79, %69
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #7
  %87 = load i32, ptr %7, align 4
  switch i32 %87, label %270 [
    i32 5, label %88
    i32 1, label %262
  ]

88:                                               ; preds = %86
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #7
  store i64 0, ptr %8, align 8, !tbaa !8
  br label %89

89:                                               ; preds = %105, %88
  %90 = load i64, ptr %8, align 8, !tbaa !8
  %91 = load i64, ptr @M, align 8, !tbaa !8
  %92 = icmp slt i64 %90, %91
  br i1 %92, label %94, label %93

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

94:                                               ; preds = %89
  %95 = load i64, ptr %8, align 8, !tbaa !8
  %96 = getelementptr inbounds [200000 x i64], ptr @Q2, i64 0, i64 %95
  %97 = load i64, ptr %96, align 8, !tbaa !8
  %98 = load i64, ptr %8, align 8, !tbaa !8
  %99 = getelementptr inbounds [200000 x i64], ptr @Q3, i64 0, i64 %98
  %100 = load i64, ptr %99, align 8, !tbaa !8
  %101 = load i64, ptr %8, align 8, !tbaa !8
  %102 = getelementptr inbounds [200000 x i8], ptr @Q1, i64 0, i64 %101
  %103 = load i8, ptr %102, align 1, !tbaa !11, !range !16, !noundef !17
  %104 = trunc i8 %103 to i1
  call void @_Z8add_edgexxb(i64 noundef %97, i64 noundef %100, i1 noundef zeroext %104)
  br label %105

105:                                              ; preds = %94
  %106 = load i64, ptr %8, align 8, !tbaa !8
  %107 = add nsw i64 %106, 1
  store i64 %107, ptr %8, align 8, !tbaa !8
  br label %89, !llvm.loop !18

108:                                              ; preds = %93
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #7
  store i64 0, ptr %9, align 8, !tbaa !8
  br label %109

109:                                              ; preds = %136, %108
  %110 = load i64, ptr %9, align 8, !tbaa !8
  %111 = load i64, ptr @N, align 8, !tbaa !8
  %112 = icmp slt i64 %110, %111
  br i1 %112, label %114, label %113

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

114:                                              ; preds = %109
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #7
  %115 = load i64, ptr %9, align 8, !tbaa !8
  %116 = getelementptr inbounds [200000 x %"class.std::vector"], ptr @topo, i64 0, i64 %115
  store ptr %116, ptr %10, align 8, !tbaa !19
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #7
  %117 = load ptr, ptr %10, align 8, !tbaa !19
  %118 = call ptr @_ZNSt6vectorIxSaIxEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %117) #7
  %119 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %11, i32 0, i32 0
  store ptr %118, ptr %119, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #7
  %120 = load ptr, ptr %10, align 8, !tbaa !19
  %121 = call ptr @_ZNSt6vectorIxSaIxEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %120) #7
  %122 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %12, i32 0, i32 0
  store ptr %121, ptr %122, align 8
  br label %123

123:                                              ; preds = %133, %114
  %124 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPxSt6vectorIxSaIxEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %11, ptr noundef nonnull align 8 dereferenceable(8) %12) #7
  br i1 %124, label %126, label %125

125:                                              ; preds = %123
  store i32 14, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #7
  br label %135

126:                                              ; preds = %123
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #7
  %127 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPxSt6vectorIxSaIxEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %11) #7
  %128 = load i64, ptr %127, align 8, !tbaa !8
  store i64 %128, ptr %13, align 8, !tbaa !8
  %129 = load i64, ptr %13, align 8, !tbaa !8
  %130 = getelementptr inbounds [200000 x i64], ptr @din, i64 0, i64 %129
  %131 = load i64, ptr %130, align 8, !tbaa !8
  %132 = add nsw i64 %131, 1
  store i64 %132, ptr %130, align 8, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #7
  br label %133

133:                                              ; preds = %126
  %134 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPxSt6vectorIxSaIxEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %11) #7
  br label %123

135:                                              ; preds = %125
  br label %136

136:                                              ; preds = %135
  %137 = load i64, ptr %9, align 8, !tbaa !8
  %138 = add nsw i64 %137, 1
  store i64 %138, ptr %9, align 8, !tbaa !8
  br label %109, !llvm.loop !21

139:                                              ; preds = %113
  call void @llvm.lifetime.start.p0(i64 80, ptr %14) #7
  call void @_ZNSt5queueIxSt5dequeIxSaIxEEEC2IS2_vEEv(ptr noundef nonnull align 8 dereferenceable(80) %14)
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #7
  store i64 0, ptr %15, align 8, !tbaa !8
  br label %140

140:                                              ; preds = %157, %139
  %141 = load i64, ptr %15, align 8, !tbaa !8
  %142 = load i64, ptr @N, align 8, !tbaa !8
  %143 = icmp slt i64 %141, %142
  br i1 %143, label %145, label %144

144:                                              ; preds = %140
  store i32 16, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #7
  br label %160

145:                                              ; preds = %140
  %146 = load i64, ptr %15, align 8, !tbaa !8
  %147 = getelementptr inbounds [200000 x i64], ptr @din, i64 0, i64 %146
  %148 = load i64, ptr %147, align 8, !tbaa !8
  %149 = icmp eq i64 %148, 0
  br i1 %149, label %150, label %156

150:                                              ; preds = %145
  invoke void @_ZNSt5queueIxSt5dequeIxSaIxEEE4pushERKx(ptr noundef nonnull align 8 dereferenceable(80) %14, ptr noundef nonnull align 8 dereferenceable(8) %15)
          to label %151 unwind label %152

151:                                              ; preds = %150
  br label %156

152:                                              ; preds = %150
  %153 = landingpad { ptr, i32 }
          cleanup
  %154 = extractvalue { ptr, i32 } %153, 0
  store ptr %154, ptr %16, align 8
  %155 = extractvalue { ptr, i32 } %153, 1
  store i32 %155, ptr %17, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #7
  br label %264

156:                                              ; preds = %151, %145
  br label %157

157:                                              ; preds = %156
  %158 = load i64, ptr %15, align 8, !tbaa !8
  %159 = add nsw i64 %158, 1
  store i64 %159, ptr %15, align 8, !tbaa !8
  br label %140, !llvm.loop !22

160:                                              ; preds = %144
  br label %161

161:                                              ; preds = %210, %160
  %162 = invoke noundef zeroext i1 @_ZNKSt5queueIxSt5dequeIxSaIxEEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %14)
          to label %163 unwind label %185

163:                                              ; preds = %161
  %164 = xor i1 %162, true
  br i1 %164, label %165, label %212

165:                                              ; preds = %163
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #7
  %166 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt5queueIxSt5dequeIxSaIxEEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) %14)
          to label %167 unwind label %189

167:                                              ; preds = %165
  %168 = load i64, ptr %166, align 8, !tbaa !8
  store i64 %168, ptr %18, align 8, !tbaa !8
  invoke void @_ZNSt5queueIxSt5dequeIxSaIxEEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %14)
          to label %169 unwind label %189

169:                                              ; preds = %167
  %170 = load i64, ptr @tcnt, align 8, !tbaa !8
  %171 = add nsw i64 %170, 1
  store i64 %171, ptr @tcnt, align 8, !tbaa !8
  %172 = load i64, ptr %18, align 8, !tbaa !8
  %173 = getelementptr inbounds [200000 x i64], ptr @ans, i64 0, i64 %172
  store i64 %171, ptr %173, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #7
  %174 = load i64, ptr %18, align 8, !tbaa !8
  %175 = getelementptr inbounds [200000 x %"class.std::vector"], ptr @topo, i64 0, i64 %174
  store ptr %175, ptr %19, align 8, !tbaa !19
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #7
  %176 = load ptr, ptr %19, align 8, !tbaa !19
  %177 = call ptr @_ZNSt6vectorIxSaIxEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %176) #7
  %178 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %20, i32 0, i32 0
  store ptr %177, ptr %178, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #7
  %179 = load ptr, ptr %19, align 8, !tbaa !19
  %180 = call ptr @_ZNSt6vectorIxSaIxEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %179) #7
  %181 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %21, i32 0, i32 0
  store ptr %180, ptr %181, align 8
  br label %182

182:                                              ; preds = %208, %169
  %183 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPxSt6vectorIxSaIxEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %20, ptr noundef nonnull align 8 dereferenceable(8) %21) #7
  br i1 %183, label %193, label %184

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

185:                                              ; preds = %226, %224, %221, %219, %212, %161
  %186 = landingpad { ptr, i32 }
          cleanup
  %187 = extractvalue { ptr, i32 } %186, 0
  store ptr %187, ptr %16, align 8
  %188 = extractvalue { ptr, i32 } %186, 1
  store i32 %188, ptr %17, align 4
  br label %264

189:                                              ; preds = %167, %165
  %190 = landingpad { ptr, i32 }
          cleanup
  %191 = extractvalue { ptr, i32 } %190, 0
  store ptr %191, ptr %16, align 8
  %192 = extractvalue { ptr, i32 } %190, 1
  store i32 %192, ptr %17, align 4
  br label %211

193:                                              ; preds = %182
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #7
  %194 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPxSt6vectorIxSaIxEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %20) #7
  %195 = load i64, ptr %194, align 8, !tbaa !8
  store i64 %195, ptr %22, align 8, !tbaa !8
  %196 = load i64, ptr %22, align 8, !tbaa !8
  %197 = getelementptr inbounds [200000 x i64], ptr @din, i64 0, i64 %196
  %198 = load i64, ptr %197, align 8, !tbaa !8
  %199 = add nsw i64 %198, -1
  store i64 %199, ptr %197, align 8, !tbaa !8
  %200 = icmp eq i64 %199, 0
  br i1 %200, label %201, label %207

201:                                              ; preds = %193
  invoke void @_ZNSt5queueIxSt5dequeIxSaIxEEE4pushERKx(ptr noundef nonnull align 8 dereferenceable(80) %14, ptr noundef nonnull align 8 dereferenceable(8) %22)
          to label %202 unwind label %203

202:                                              ; preds = %201
  br label %207

203:                                              ; preds = %201
  %204 = landingpad { ptr, i32 }
          cleanup
  %205 = extractvalue { ptr, i32 } %204, 0
  store ptr %205, ptr %16, align 8
  %206 = extractvalue { ptr, i32 } %204, 1
  store i32 %206, ptr %17, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #7
  br label %211

207:                                              ; preds = %202, %193
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #7
  br label %208

208:                                              ; preds = %207
  %209 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPxSt6vectorIxSaIxEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %20) #7
  br label %182

210:                                              ; preds = %184
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #7
  br label %161, !llvm.loop !23

211:                                              ; preds = %203, %189
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #7
  br label %264

212:                                              ; preds = %163
  %213 = load i64, ptr @N, align 8, !tbaa !8
  %214 = getelementptr inbounds i64, ptr @ans, i64 %213
  %215 = invoke noundef ptr @_ZSt11min_elementIPxET_S1_S1_(ptr noundef @ans, ptr noundef %214)
          to label %216 unwind label %185

216:                                              ; preds = %212
  %217 = load i64, ptr %215, align 8, !tbaa !8
  %218 = icmp eq i64 %217, 0
  br i1 %218, label %219, label %224

219:                                              ; preds = %216
  %220 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str)
          to label %221 unwind label %185

221:                                              ; preds = %219
  %222 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %220, i8 noundef signext 10)
          to label %223 unwind label %185

223:                                              ; preds = %221
  store i32 0, ptr %1, align 4
  store i32 1, ptr %7, align 4
  br label %260

224:                                              ; preds = %216
  %225 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.4)
          to label %226 unwind label %185

226:                                              ; preds = %224
  %227 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %225, i8 noundef signext 10)
          to label %228 unwind label %185

228:                                              ; preds = %226
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #7
  store i64 0, ptr %23, align 8, !tbaa !8
  br label %229

229:                                              ; preds = %252, %228
  %230 = load i64, ptr %23, align 8, !tbaa !8
  %231 = load i64, ptr @N, align 8, !tbaa !8
  %232 = icmp slt i64 %230, %231
  br i1 %232, label %234, label %233

233:                                              ; preds = %229
  store i32 23, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #7
  br label %259

234:                                              ; preds = %229
  %235 = load i64, ptr %23, align 8, !tbaa !8
  %236 = getelementptr inbounds [200000 x i64], ptr @O, i64 0, i64 %235
  %237 = load i64, ptr %236, align 8, !tbaa !8
  %238 = icmp eq i64 %237, 1
  %239 = zext i1 %238 to i64
  %240 = select i1 %238, i8 76, i8 82
  %241 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i8 noundef signext %240)
          to label %242 unwind label %255

242:                                              ; preds = %234
  %243 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %241, i8 noundef signext 32)
          to label %244 unwind label %255

244:                                              ; preds = %242
  %245 = load i64, ptr %23, align 8, !tbaa !8
  %246 = getelementptr inbounds [200000 x i64], ptr @ans, i64 0, i64 %245
  %247 = load i64, ptr %246, align 8, !tbaa !8
  %248 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) %243, i64 noundef %247)
          to label %249 unwind label %255

249:                                              ; preds = %244
  %250 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %248, i8 noundef signext 10)
          to label %251 unwind label %255

251:                                              ; preds = %249
  br label %252

252:                                              ; preds = %251
  %253 = load i64, ptr %23, align 8, !tbaa !8
  %254 = add nsw i64 %253, 1
  store i64 %254, ptr %23, align 8, !tbaa !8
  br label %229, !llvm.loop !24

255:                                              ; preds = %249, %244, %242, %234
  %256 = landingpad { ptr, i32 }
          cleanup
  %257 = extractvalue { ptr, i32 } %256, 0
  store ptr %257, ptr %16, align 8
  %258 = extractvalue { ptr, i32 } %256, 1
  store i32 %258, ptr %17, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #7
  br label %264

259:                                              ; preds = %233
  store i32 0, ptr %7, align 4
  br label %260

260:                                              ; preds = %259, %223
  call void @_ZNSt5queueIxSt5dequeIxSaIxEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %14) #7
  call void @llvm.lifetime.end.p0(i64 80, ptr %14) #7
  %261 = load i32, ptr %7, align 4
  switch i32 %261, label %270 [
    i32 0, label %262
    i32 1, label %262
  ]

262:                                              ; preds = %260, %260, %86
  %263 = load i32, ptr %1, align 4
  ret i32 %263

264:                                              ; preds = %255, %211, %185, %152
  call void @_ZNSt5queueIxSt5dequeIxSaIxEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %14) #7
  call void @llvm.lifetime.end.p0(i64 80, ptr %14) #7
  br label %265

265:                                              ; preds = %264
  %266 = load ptr, ptr %16, align 8
  %267 = load i32, ptr %17, align 4
  %268 = insertvalue { ptr, i32 } poison, ptr %266, 0
  %269 = insertvalue { ptr, i32 } %268, i32 %267, 1
  resume { ptr, i32 } %269

270:                                              ; preds = %260, %86
  unreachable
}

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

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

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(8)) #0 align 2

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

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

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

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

declare i32 @__gxx_personality_v0(...)

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef ptr @_ZSt11min_elementIPxET_S1_S1_(ptr noundef, ptr noundef) #6

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZNSt5queueIxSt5dequeIxSaIxEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80)) unnamed_addr #3 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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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 #5 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { nounwind }

!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 = !{!"long long", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"bool", !10, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}
!16 = !{i8 0, i8 2}
!17 = !{}
!18 = distinct !{!18, !14}
!19 = !{!20, !20, i64 0}
!20 = !{!"any pointer", !10, i64 0}
!21 = distinct !{!21, !14}
!22 = distinct !{!22, !14}
!23 = distinct !{!23, !14}
!24 = distinct !{!24, !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::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl" }
%"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl" = type { %"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl_data" }
%"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"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.__gnu_cxx::__normal_iterator" = type { ptr }
%"class.std::queue" = type { %"class.std::deque" }
%"class.std::deque" = type { %"class.std::_Deque_base" }
%"class.std::_Deque_base" = type { %"struct.std::_Deque_base<long long, std::allocator<long long>>::_Deque_impl" }
%"struct.std::_Deque_base<long long, std::allocator<long long>>::_Deque_impl" = type { %"struct.std::_Deque_base<long long, std::allocator<long long>>::_Deque_impl_data" }
%"struct.std::_Deque_base<long long, std::allocator<long long>>::_Deque_impl_data" = type { ptr, i64, %"struct.std::_Deque_iterator", %"struct.std::_Deque_iterator" }
%"struct.std::_Deque_iterator" = type { ptr, ptr, ptr, ptr }

@N = external dso_local global i64, align 8
@M = external dso_local global i64, align 8
@O = external dso_local local_unnamed_addr global [200000 x i64], align 16
@Q2 = external dso_local local_unnamed_addr global [200000 x i64], align 16
@Q3 = external dso_local local_unnamed_addr global [200000 x i64], align 16
@din = external dso_local local_unnamed_addr global [200000 x i64], align 16
@tcnt = external dso_local local_unnamed_addr global i64, align 8
@ans = external dso_local global [200000 x i64], align 16
@Q1 = external dso_local local_unnamed_addr global [200000 x i8], align 16
@ori = external dso_local global [200000 x %"class.std::vector"], align 16
@topo = external dso_local global [200000 x %"class.std::vector"], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z8add_edgexxb(i64 noundef, i64 noundef, i1 noundef zeroext) local_unnamed_addr #0

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_Z3dfsxx(i64 noundef, i64 noundef) local_unnamed_addr #0

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt6vectorIxSaIxEE3endEv(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_cxxneIPxSt6vectorIxSaIxEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #3

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

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

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #4 personality ptr @__gxx_personality_v0 {
  %1 = alloca i64, align 8
  %2 = alloca i64, align 8
  %3 = alloca i64, align 8
  %4 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %5 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %6 = alloca %"class.std::queue", align 8
  %7 = alloca i64, align 8
  %8 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %9 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %10 = alloca i64, align 8
  %11 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %12 = getelementptr i8, ptr %11, i64 -24
  %13 = load i64, ptr %12, align 8
  %14 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %13
  %15 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %14, ptr noundef null)
  %16 = tail call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %17 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) @N)
  %18 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %17, ptr noundef nonnull align 8 dereferenceable(8) @M)
  %19 = load i64, ptr @M, align 8, !tbaa !8
  %20 = icmp sgt i64 %19, 0
  br i1 %20, label %.lr.ph, label %.preheader46

.preheader46:                                     ; preds = %.lr.ph, %0
  %21 = phi i64 [ %19, %0 ], [ %41, %.lr.ph ]
  %22 = load i64, ptr @N, align 8, !tbaa !8
  %23 = icmp sgt i64 %22, 0
  br i1 %23, label %.lr.ph49, label %.preheader45

.lr.ph:                                           ; preds = %0, %.lr.ph
  %.03247 = phi i64 [ %40, %.lr.ph ], [ 0, %0 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #7
  %24 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %1)
  %25 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %24, ptr noundef nonnull align 8 dereferenceable(8) %2)
  %26 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %25, ptr noundef nonnull align 8 dereferenceable(8) %3)
  %27 = load i64, ptr %2, align 8, !tbaa !8
  %28 = add nsw i64 %27, -1
  store i64 %28, ptr %2, align 8, !tbaa !8
  %29 = load i64, ptr %3, align 8, !tbaa !8
  %30 = add nsw i64 %29, -1
  store i64 %30, ptr %3, align 8, !tbaa !8
  %31 = load i64, ptr %1, align 8, !tbaa !8
  %32 = icmp ne i64 %31, 1
  %33 = getelementptr inbounds [200000 x i8], ptr @Q1, i64 0, i64 %.03247
  %34 = zext i1 %32 to i8
  store i8 %34, ptr %33, align 1, !tbaa !11
  %35 = getelementptr inbounds [200000 x i64], ptr @Q2, i64 0, i64 %.03247
  store i64 %28, ptr %35, align 8, !tbaa !8
  %36 = getelementptr inbounds [200000 x i64], ptr @Q3, i64 0, i64 %.03247
  store i64 %30, ptr %36, align 8, !tbaa !8
  %37 = getelementptr inbounds [200000 x %"class.std::vector"], ptr @ori, i64 0, i64 %28
  call void @_ZNSt6vectorIxSaIxEE9push_backERKx(ptr noundef nonnull align 8 dereferenceable(24) %37, ptr noundef nonnull align 8 dereferenceable(8) %3)
  %38 = load i64, ptr %3, align 8, !tbaa !8
  %39 = getelementptr inbounds [200000 x %"class.std::vector"], ptr @ori, i64 0, i64 %38
  call void @_ZNSt6vectorIxSaIxEE9push_backERKx(ptr noundef nonnull align 8 dereferenceable(24) %39, ptr noundef nonnull align 8 dereferenceable(8) %2)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #7
  %40 = add nuw nsw i64 %.03247, 1
  %41 = load i64, ptr @M, align 8, !tbaa !8
  %42 = icmp slt i64 %40, %41
  br i1 %42, label %.lr.ph, label %.preheader46, !llvm.loop !13

.preheader45.loopexit:                            ; preds = %54
  %.pre69 = load i64, ptr @M, align 8, !tbaa !8
  br label %.preheader45

.preheader45:                                     ; preds = %.preheader45.loopexit, %.preheader46
  %43 = phi i64 [ %55, %.preheader45.loopexit ], [ %22, %.preheader46 ]
  %44 = phi i64 [ %.pre69, %.preheader45.loopexit ], [ %21, %.preheader46 ]
  %45 = icmp sgt i64 %44, 0
  br i1 %45, label %.lr.ph51, label %.preheader44

.lr.ph49:                                         ; preds = %.preheader46, %54
  %46 = phi i64 [ %55, %54 ], [ %22, %.preheader46 ]
  %.03548 = phi i64 [ %56, %54 ], [ 0, %.preheader46 ]
  %47 = getelementptr inbounds [200000 x i64], ptr @O, i64 0, i64 %.03548
  %48 = load i64, ptr %47, align 8, !tbaa !8
  %49 = icmp sgt i64 %48, 0
  br i1 %49, label %54, label %50

50:                                               ; preds = %.lr.ph49
  %51 = call noundef zeroext i1 @_Z3dfsxx(i64 noundef %.03548, i64 noundef 1)
  br i1 %51, label %._crit_edge68, label %.thread

._crit_edge68:                                    ; preds = %50
  %.pre = load i64, ptr @N, align 8, !tbaa !8
  br label %54

.thread:                                          ; preds = %50
  %52 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str)
  %53 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %52, i8 noundef signext 10)
  br label %158

54:                                               ; preds = %._crit_edge68, %.lr.ph49
  %55 = phi i64 [ %.pre, %._crit_edge68 ], [ %46, %.lr.ph49 ]
  %56 = add nuw nsw i64 %.03548, 1
  %57 = icmp slt i64 %56, %55
  br i1 %57, label %.lr.ph49, label %.preheader45.loopexit, !llvm.loop !15

.preheader44.loopexit:                            ; preds = %.lr.ph51
  %.pre70 = load i64, ptr @N, align 8, !tbaa !8
  br label %.preheader44

.preheader44:                                     ; preds = %.preheader44.loopexit, %.preheader45
  %58 = phi i64 [ %.pre70, %.preheader44.loopexit ], [ %43, %.preheader45 ]
  %59 = icmp sgt i64 %58, 0
  br i1 %59, label %.lr.ph54, label %._crit_edge55

.lr.ph51:                                         ; preds = %.preheader45, %.lr.ph51
  %.03850 = phi i64 [ %67, %.lr.ph51 ], [ 0, %.preheader45 ]
  %60 = getelementptr inbounds [200000 x i64], ptr @Q2, i64 0, i64 %.03850
  %61 = load i64, ptr %60, align 8, !tbaa !8
  %62 = getelementptr inbounds [200000 x i64], ptr @Q3, i64 0, i64 %.03850
  %63 = load i64, ptr %62, align 8, !tbaa !8
  %64 = getelementptr inbounds [200000 x i8], ptr @Q1, i64 0, i64 %.03850
  %65 = load i8, ptr %64, align 1, !tbaa !11, !range !16, !noundef !17
  %66 = trunc nuw i8 %65 to i1
  call void @_Z8add_edgexxb(i64 noundef %61, i64 noundef %63, i1 noundef zeroext %66)
  %67 = add nuw nsw i64 %.03850, 1
  %68 = load i64, ptr @M, align 8, !tbaa !8
  %69 = icmp slt i64 %67, %68
  br i1 %69, label %.lr.ph51, label %.preheader44.loopexit, !llvm.loop !18

._crit_edge55:                                    ; preds = %._crit_edge, %.preheader44
  call void @llvm.lifetime.start.p0(i64 80, ptr nonnull %6) #7
  call void @_ZNSt5queueIxSt5dequeIxSaIxEEEC2IS2_vEEv(ptr noundef nonnull align 8 dereferenceable(80) %6)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #7
  store i64 0, ptr %7, align 8, !tbaa !8
  %70 = load i64, ptr @N, align 8, !tbaa !8
  %71 = icmp sgt i64 %70, 0
  br i1 %71, label %.lr.ph58, label %._crit_edge59

.lr.ph54:                                         ; preds = %.preheader44, %._crit_edge
  %.03753 = phi i64 [ %76, %._crit_edge ], [ 0, %.preheader44 ]
  %72 = getelementptr inbounds [200000 x %"class.std::vector"], ptr @topo, i64 0, i64 %.03753
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #7
  %73 = call ptr @_ZNSt6vectorIxSaIxEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %72) #7
  store ptr %73, ptr %4, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #7
  %74 = call ptr @_ZNSt6vectorIxSaIxEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %72) #7
  store ptr %74, ptr %5, align 8
  %75 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPxSt6vectorIxSaIxEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(8) %5) #7
  br i1 %75, label %.lr.ph52, label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph52, %.lr.ph54
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #7
  %76 = add nuw nsw i64 %.03753, 1
  %77 = load i64, ptr @N, align 8, !tbaa !8
  %78 = icmp slt i64 %76, %77
  br i1 %78, label %.lr.ph54, label %._crit_edge55, !llvm.loop !19

.lr.ph52:                                         ; preds = %.lr.ph54, %.lr.ph52
  %79 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPxSt6vectorIxSaIxEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %4) #7
  %80 = load i64, ptr %79, align 8, !tbaa !8
  %81 = getelementptr inbounds [200000 x i64], ptr @din, i64 0, i64 %80
  %82 = load i64, ptr %81, align 8, !tbaa !8
  %83 = add nsw i64 %82, 1
  store i64 %83, ptr %81, align 8, !tbaa !8
  %84 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPxSt6vectorIxSaIxEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %4) #7
  %85 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPxSt6vectorIxSaIxEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(8) %5) #7
  br i1 %85, label %.lr.ph52, label %._crit_edge

._crit_edge59:                                    ; preds = %94, %._crit_edge55
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #7
  %86 = call noundef zeroext i1 @_ZNKSt5queueIxSt5dequeIxSaIxEEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %6)
  br i1 %86, label %._crit_edge65, label %.lr.ph64

.lr.ph58:                                         ; preds = %._crit_edge55, %94
  %87 = phi i64 [ %95, %94 ], [ %70, %._crit_edge55 ]
  %storemerge56 = phi i64 [ %97, %94 ], [ 0, %._crit_edge55 ]
  %88 = getelementptr inbounds [200000 x i64], ptr @din, i64 0, i64 %storemerge56
  %89 = load i64, ptr %88, align 8, !tbaa !8
  %90 = icmp eq i64 %89, 0
  br i1 %90, label %91, label %94

91:                                               ; preds = %.lr.ph58
  invoke void @_ZNSt5queueIxSt5dequeIxSaIxEEE4pushERKx(ptr noundef nonnull align 8 dereferenceable(80) %6, ptr noundef nonnull align 8 dereferenceable(8) %7)
          to label %._crit_edge71 unwind label %92

._crit_edge71:                                    ; preds = %91
  %.pre72 = load i64, ptr %7, align 8, !tbaa !8
  %.pre73 = load i64, ptr @N, align 8, !tbaa !8
  br label %94

92:                                               ; preds = %91
  %93 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #7
  br label %159

94:                                               ; preds = %._crit_edge71, %.lr.ph58
  %95 = phi i64 [ %.pre73, %._crit_edge71 ], [ %87, %.lr.ph58 ]
  %96 = phi i64 [ %.pre72, %._crit_edge71 ], [ %storemerge56, %.lr.ph58 ]
  %97 = add nsw i64 %96, 1
  store i64 %97, ptr %7, align 8, !tbaa !8
  %98 = icmp slt i64 %97, %95
  br i1 %98, label %.lr.ph58, label %._crit_edge59, !llvm.loop !20

.lr.ph64:                                         ; preds = %._crit_edge59, %._crit_edge62
  %99 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt5queueIxSt5dequeIxSaIxEEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) %6)
  %100 = load i64, ptr %99, align 8, !tbaa !8
  call void @_ZNSt5queueIxSt5dequeIxSaIxEEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %6)
  %101 = load i64, ptr @tcnt, align 8, !tbaa !8
  %102 = add nsw i64 %101, 1
  store i64 %102, ptr @tcnt, align 8, !tbaa !8
  %103 = getelementptr inbounds [200000 x i64], ptr @ans, i64 0, i64 %100
  store i64 %102, ptr %103, align 8, !tbaa !8
  %104 = getelementptr inbounds [200000 x %"class.std::vector"], ptr @topo, i64 0, i64 %100
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #7
  %105 = call ptr @_ZNSt6vectorIxSaIxEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %104) #7
  store ptr %105, ptr %8, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #7
  %106 = call ptr @_ZNSt6vectorIxSaIxEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %104) #7
  store ptr %106, ptr %9, align 8
  %107 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPxSt6vectorIxSaIxEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull align 8 dereferenceable(8) %9) #7
  br i1 %107, label %.lr.ph61, label %._crit_edge62

._crit_edge62:                                    ; preds = %120, %.lr.ph64
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #7
  %108 = call noundef zeroext i1 @_ZNKSt5queueIxSt5dequeIxSaIxEEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %6)
  br i1 %108, label %._crit_edge65, label %.lr.ph64, !llvm.loop !21

109:                                              ; preds = %135, %133, %131, %129, %._crit_edge65
  %110 = landingpad { ptr, i32 }
          cleanup
  br label %159

.lr.ph61:                                         ; preds = %.lr.ph64, %120
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #7
  %111 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPxSt6vectorIxSaIxEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %8) #7
  %112 = load i64, ptr %111, align 8, !tbaa !8
  store i64 %112, ptr %10, align 8, !tbaa !8
  %113 = getelementptr inbounds [200000 x i64], ptr @din, i64 0, i64 %112
  %114 = load i64, ptr %113, align 8, !tbaa !8
  %115 = add nsw i64 %114, -1
  store i64 %115, ptr %113, align 8, !tbaa !8
  %116 = icmp eq i64 %115, 0
  br i1 %116, label %117, label %120

117:                                              ; preds = %.lr.ph61
  invoke void @_ZNSt5queueIxSt5dequeIxSaIxEEE4pushERKx(ptr noundef nonnull align 8 dereferenceable(80) %6, ptr noundef nonnull align 8 dereferenceable(8) %10)
          to label %120 unwind label %118

118:                                              ; preds = %117
  %119 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #7
  br label %159

120:                                              ; preds = %117, %.lr.ph61
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #7
  %121 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPxSt6vectorIxSaIxEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %8) #7
  %122 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPxSt6vectorIxSaIxEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull align 8 dereferenceable(8) %9) #7
  br i1 %122, label %.lr.ph61, label %._crit_edge62

._crit_edge65:                                    ; preds = %._crit_edge62, %._crit_edge59
  %123 = load i64, ptr @N, align 8, !tbaa !8
  %124 = getelementptr inbounds i64, ptr @ans, i64 %123
  %125 = invoke noundef ptr @_ZSt11min_elementIPxET_S1_S1_(ptr noundef nonnull @ans, ptr noundef nonnull %124)
          to label %126 unwind label %109

126:                                              ; preds = %._crit_edge65
  %127 = load i64, ptr %125, align 8, !tbaa !8
  %128 = icmp eq i64 %127, 0
  br i1 %128, label %129, label %133

129:                                              ; preds = %126
  %130 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str)
          to label %131 unwind label %109

131:                                              ; preds = %129
  %132 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %130, i8 noundef signext 10)
          to label %.loopexit unwind label %109

133:                                              ; preds = %126
  %134 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str.4)
          to label %135 unwind label %109

135:                                              ; preds = %133
  %136 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %134, i8 noundef signext 10)
          to label %.preheader unwind label %109

.preheader:                                       ; preds = %135
  %137 = load i64, ptr @N, align 8, !tbaa !8
  %138 = icmp sgt i64 %137, 0
  br i1 %138, label %.lr.ph67, label %.loopexit

.lr.ph67:                                         ; preds = %.preheader, %152
  %.066 = phi i64 [ %153, %152 ], [ 0, %.preheader ]
  %139 = getelementptr inbounds [200000 x i64], ptr @O, i64 0, i64 %.066
  %140 = load i64, ptr %139, align 8, !tbaa !8
  %141 = icmp eq i64 %140, 1
  %142 = select i1 %141, i8 76, i8 82
  %143 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i8 noundef signext %142)
          to label %144 unwind label %156

144:                                              ; preds = %.lr.ph67
  %145 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %143, i8 noundef signext 32)
          to label %146 unwind label %156

146:                                              ; preds = %144
  %147 = getelementptr inbounds [200000 x i64], ptr @ans, i64 0, i64 %.066
  %148 = load i64, ptr %147, align 8, !tbaa !8
  %149 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) %145, i64 noundef %148)
          to label %150 unwind label %156

150:                                              ; preds = %146
  %151 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %149, i8 noundef signext 10)
          to label %152 unwind label %156

152:                                              ; preds = %150
  %153 = add nuw nsw i64 %.066, 1
  %154 = load i64, ptr @N, align 8, !tbaa !8
  %155 = icmp slt i64 %153, %154
  br i1 %155, label %.lr.ph67, label %.loopexit, !llvm.loop !22

156:                                              ; preds = %150, %146, %144, %.lr.ph67
  %157 = landingpad { ptr, i32 }
          cleanup
  br label %159

.loopexit:                                        ; preds = %152, %.preheader, %131
  call void @_ZNSt5queueIxSt5dequeIxSaIxEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %6) #7
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %6) #7
  br label %158

158:                                              ; preds = %.thread, %.loopexit
  ret i32 0

159:                                              ; preds = %156, %118, %109, %92
  %.pn = phi { ptr, i32 } [ %93, %92 ], [ %119, %118 ], [ %110, %109 ], [ %157, %156 ]
  call void @_ZNSt5queueIxSt5dequeIxSaIxEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %6) #7
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %6) #7
  resume { ptr, i32 } %.pn
}

; 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 noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext) local_unnamed_addr #5

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

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

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

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

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

declare i32 @__gxx_personality_v0(...)

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef ptr @_ZSt11min_elementIPxET_S1_S1_(ptr noundef, ptr noundef) local_unnamed_addr #6

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZNSt5queueIxSt5dequeIxSaIxEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80)) unnamed_addr #3 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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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 #5 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { nounwind }

!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 = !{!"long long", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"bool", !10, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}
!16 = !{i8 0, i8 2}
!17 = !{}
!18 = distinct !{!18, !14}
!19 = distinct !{!19, !14}
!20 = distinct !{!20, !14}
!21 = distinct !{!21, !14}
!22 = distinct !{!22, !14}


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