; LLVM IR from kazunetakahashi/atcoder :: 2017/1216_ARC087 (F)

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

@fact = external dso_local global [1000010 x i64], align 16
@N = external dso_local global i32, align 4
@V = external dso_local global [5010 x %"class.std::vector"], align 16
@children = external dso_local global [5010 x %"class.std::vector"], align 16
@child_num = external dso_local global [5010 x i32], align 16
@parent = external dso_local global [5010 x i32], align 16
@DP = external dso_local global [5010 x [5010 x i64]], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z4initv() #0

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

; 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 i64 @_Z1Cii(i32 noundef, i32 noundef) #0

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z14calc_child_numi(i32 noundef) #2

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

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

; 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)) #0 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)) #0 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 i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca %"class.std::queue", align 8
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca ptr, align 8
  %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 i8, align 1
  %17 = alloca i32, align 4
  %18 = alloca i8, align 1
  %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 i32, align 4
  %24 = alloca i64, align 8
  %25 = alloca %"class.std::vector.0", align 8
  %26 = alloca i64, align 8
  %27 = alloca i64, align 8
  %28 = alloca ptr, align 8
  %29 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %30 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %31 = alloca i32, align 4
  %32 = alloca i64, align 8
  %33 = alloca i32, align 4
  %34 = alloca i32, align 4
  %35 = alloca i32, align 4
  %36 = alloca i32, align 4
  %37 = alloca i32, align 4
  %38 = alloca i64, align 8
  %39 = alloca i64, align 8
  %40 = alloca i64, align 8
  %41 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  call void @_Z4initv()
  %42 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) @N)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #7
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %43

43:                                               ; preds = %62, %0
  %44 = load i32, ptr %2, align 4, !tbaa !5
  %45 = load i32, ptr @N, align 4, !tbaa !5
  %46 = sub nsw i32 %45, 1
  %47 = icmp slt i32 %44, %46
  br i1 %47, label %49, label %48

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

49:                                               ; preds = %43
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #7
  %50 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %3)
  %51 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %50, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %52 = load i32, ptr %3, align 4, !tbaa !5
  %53 = add nsw i32 %52, -1
  store i32 %53, ptr %3, align 4, !tbaa !5
  %54 = load i32, ptr %4, align 4, !tbaa !5
  %55 = add nsw i32 %54, -1
  store i32 %55, ptr %4, align 4, !tbaa !5
  %56 = load i32, ptr %3, align 4, !tbaa !5
  %57 = sext i32 %56 to i64
  %58 = getelementptr inbounds [5010 x %"class.std::vector"], ptr @V, i64 0, i64 %57
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %58, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %59 = load i32, ptr %4, align 4, !tbaa !5
  %60 = sext i32 %59 to i64
  %61 = getelementptr inbounds [5010 x %"class.std::vector"], ptr @V, i64 0, i64 %60
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %61, ptr noundef nonnull align 4 dereferenceable(4) %3)
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #7
  br label %62

62:                                               ; preds = %49
  %63 = load i32, ptr %2, align 4, !tbaa !5
  %64 = add nsw i32 %63, 1
  store i32 %64, ptr %2, align 4, !tbaa !5
  br label %43, !llvm.loop !9

65:                                               ; preds = %48
  call void @llvm.lifetime.start.p0(i64 80, ptr %5) #7
  call void @_ZNSt5queueIiSt5dequeIiSaIiEEEC2IS2_vEEv(ptr noundef nonnull align 8 dereferenceable(80) %5)
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #7
  store i32 0, ptr %6, align 4, !tbaa !5
  invoke void @_ZNSt5queueIiSt5dequeIiSaIiEEE4pushEOi(ptr noundef nonnull align 8 dereferenceable(80) %5, ptr noundef nonnull align 4 dereferenceable(4) %6)
          to label %66 unwind label %90

66:                                               ; preds = %65
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #7
  store i32 -1, ptr %9, align 4, !tbaa !5
  invoke void @_ZSt4fillIPiiEvT_S1_RKT0_(ptr noundef @child_num, ptr noundef getelementptr inbounds (i32, ptr @child_num, i64 5010), ptr noundef nonnull align 4 dereferenceable(4) %9)
          to label %67 unwind label %94

67:                                               ; preds = %66
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #7
  store i32 -1, ptr %10, align 4, !tbaa !5
  invoke void @_ZSt4fillIPiiEvT_S1_RKT0_(ptr noundef @parent, ptr noundef getelementptr inbounds (i32, ptr @parent, i64 5010), ptr noundef nonnull align 4 dereferenceable(4) %10)
          to label %68 unwind label %98

68:                                               ; preds = %67
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #7
  store i32 -2, ptr @parent, align 16, !tbaa !5
  br label %69

69:                                               ; preds = %135, %68
  %70 = invoke noundef zeroext i1 @_ZNKSt5queueIiSt5dequeIiSaIiEEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %5)
          to label %71 unwind label %102

71:                                               ; preds = %69
  %72 = xor i1 %70, true
  br i1 %72, label %73, label %137

73:                                               ; preds = %71
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #7
  %74 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5queueIiSt5dequeIiSaIiEEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) %5)
          to label %75 unwind label %106

75:                                               ; preds = %73
  %76 = load i32, ptr %74, align 4, !tbaa !5
  store i32 %76, ptr %11, align 4, !tbaa !5
  invoke void @_ZNSt5queueIiSt5dequeIiSaIiEEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %5)
          to label %77 unwind label %106

77:                                               ; preds = %75
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #7
  %78 = load i32, ptr %11, align 4, !tbaa !5
  %79 = sext i32 %78 to i64
  %80 = getelementptr inbounds [5010 x %"class.std::vector"], ptr @V, i64 0, i64 %79
  store ptr %80, ptr %12, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #7
  %81 = load ptr, ptr %12, align 8, !tbaa !11
  %82 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %81) #7
  %83 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %13, i32 0, i32 0
  store ptr %82, ptr %83, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #7
  %84 = load ptr, ptr %12, align 8, !tbaa !11
  %85 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %84) #7
  %86 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %14, i32 0, i32 0
  store ptr %85, ptr %86, align 8
  br label %87

87:                                               ; preds = %133, %77
  %88 = 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 %88, label %110, label %89

89:                                               ; preds = %87
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #7
  br label %135

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

94:                                               ; preds = %66
  %95 = landingpad { ptr, i32 }
          cleanup
  %96 = extractvalue { ptr, i32 } %95, 0
  store ptr %96, ptr %7, align 8
  %97 = extractvalue { ptr, i32 } %95, 1
  store i32 %97, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #7
  br label %432

98:                                               ; preds = %67
  %99 = landingpad { ptr, i32 }
          cleanup
  %100 = extractvalue { ptr, i32 } %99, 0
  store ptr %100, ptr %7, align 8
  %101 = extractvalue { ptr, i32 } %99, 1
  store i32 %101, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #7
  br label %432

102:                                              ; preds = %137, %69
  %103 = landingpad { ptr, i32 }
          cleanup
  %104 = extractvalue { ptr, i32 } %103, 0
  store ptr %104, ptr %7, align 8
  %105 = extractvalue { ptr, i32 } %103, 1
  store i32 %105, ptr %8, align 4
  br label %432

106:                                              ; preds = %75, %73
  %107 = landingpad { ptr, i32 }
          cleanup
  %108 = extractvalue { ptr, i32 } %107, 0
  store ptr %108, ptr %7, align 8
  %109 = extractvalue { ptr, i32 } %107, 1
  store i32 %109, ptr %8, align 4
  br label %136

110:                                              ; preds = %87
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #7
  %111 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %13) #7
  %112 = load i32, ptr %111, align 4, !tbaa !5
  store i32 %112, ptr %15, align 4, !tbaa !5
  %113 = load i32, ptr %15, align 4, !tbaa !5
  %114 = sext i32 %113 to i64
  %115 = getelementptr inbounds [5010 x i32], ptr @parent, i64 0, i64 %114
  %116 = load i32, ptr %115, align 4, !tbaa !5
  %117 = icmp eq i32 %116, -1
  br i1 %117, label %118, label %132

118:                                              ; preds = %110
  %119 = load i32, ptr %11, align 4, !tbaa !5
  %120 = load i32, ptr %15, align 4, !tbaa !5
  %121 = sext i32 %120 to i64
  %122 = getelementptr inbounds [5010 x i32], ptr @parent, i64 0, i64 %121
  store i32 %119, ptr %122, align 4, !tbaa !5
  %123 = load i32, ptr %11, align 4, !tbaa !5
  %124 = sext i32 %123 to i64
  %125 = getelementptr inbounds [5010 x %"class.std::vector"], ptr @children, i64 0, i64 %124
  invoke void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %125, ptr noundef nonnull align 4 dereferenceable(4) %15)
          to label %126 unwind label %128

126:                                              ; preds = %118
  invoke void @_ZNSt5queueIiSt5dequeIiSaIiEEE4pushERKi(ptr noundef nonnull align 8 dereferenceable(80) %5, ptr noundef nonnull align 4 dereferenceable(4) %15)
          to label %127 unwind label %128

127:                                              ; preds = %126
  br label %132

128:                                              ; preds = %126, %118
  %129 = landingpad { ptr, i32 }
          cleanup
  %130 = extractvalue { ptr, i32 } %129, 0
  store ptr %130, ptr %7, align 8
  %131 = extractvalue { ptr, i32 } %129, 1
  store i32 %131, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #7
  br label %136

132:                                              ; preds = %127, %110
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #7
  br label %133

133:                                              ; preds = %132
  %134 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %13) #7
  br label %87

135:                                              ; preds = %89
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #7
  br label %69, !llvm.loop !13

136:                                              ; preds = %128, %106
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #7
  br label %432

137:                                              ; preds = %71
  %138 = invoke noundef i32 @_Z14calc_child_numi(i32 noundef 0)
          to label %139 unwind label %102

139:                                              ; preds = %137
  call void @llvm.lifetime.start.p0(i64 1, ptr %16) #7
  store i8 0, ptr %16, align 1, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #7
  store i32 0, ptr %17, align 4, !tbaa !5
  br label %140

140:                                              ; preds = %195, %139
  br label %141

141:                                              ; preds = %140
  call void @llvm.lifetime.start.p0(i64 1, ptr %18) #7
  store i8 1, ptr %18, align 1, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #7
  %142 = load i32, ptr %17, align 4, !tbaa !5
  %143 = sext i32 %142 to i64
  %144 = getelementptr inbounds [5010 x %"class.std::vector"], ptr @children, i64 0, i64 %143
  store ptr %144, ptr %19, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #7
  %145 = load ptr, ptr %19, align 8, !tbaa !11
  %146 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %145) #7
  %147 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %20, i32 0, i32 0
  store ptr %146, ptr %147, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #7
  %148 = load ptr, ptr %19, align 8, !tbaa !11
  %149 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %148) #7
  %150 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %21, i32 0, i32 0
  store ptr %149, ptr %150, align 8
  br label %151

151:                                              ; preds = %185, %141
  %152 = 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) #7
  br i1 %152, label %154, label %153

153:                                              ; preds = %151
  store i32 11, ptr %22, align 4
  br label %187

154:                                              ; preds = %151
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #7
  %155 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %20) #7
  %156 = load i32, ptr %155, align 4, !tbaa !5
  store i32 %156, ptr %23, align 4, !tbaa !5
  %157 = load i32, ptr @N, align 4, !tbaa !5
  %158 = srem i32 %157, 2
  %159 = icmp eq i32 %158, 0
  br i1 %159, label %160, label %170

160:                                              ; preds = %154
  %161 = load i32, ptr %23, align 4, !tbaa !5
  %162 = sext i32 %161 to i64
  %163 = getelementptr inbounds [5010 x i32], ptr @child_num, i64 0, i64 %162
  %164 = load i32, ptr %163, align 4, !tbaa !5
  %165 = load i32, ptr @N, align 4, !tbaa !5
  %166 = sdiv i32 %165, 2
  %167 = icmp eq i32 %164, %166
  br i1 %167, label %168, label %170

168:                                              ; preds = %160
  store i8 1, ptr %16, align 1, !tbaa !14
  %169 = load i32, ptr %23, align 4, !tbaa !5
  store i32 %169, ptr %17, align 4, !tbaa !5
  store i32 11, ptr %22, align 4
  br label %182

170:                                              ; preds = %160, %154
  %171 = load i32, ptr %23, align 4, !tbaa !5
  %172 = sext i32 %171 to i64
  %173 = getelementptr inbounds [5010 x i32], ptr @child_num, i64 0, i64 %172
  %174 = load i32, ptr %173, align 4, !tbaa !5
  %175 = load i32, ptr @N, align 4, !tbaa !5
  %176 = sdiv i32 %175, 2
  %177 = icmp sgt i32 %174, %176
  br i1 %177, label %178, label %180

178:                                              ; preds = %170
  %179 = load i32, ptr %23, align 4, !tbaa !5
  store i32 %179, ptr %17, align 4, !tbaa !5
  store i8 0, ptr %18, align 1, !tbaa !14
  store i32 11, ptr %22, align 4
  br label %182

180:                                              ; preds = %170
  br label %181

181:                                              ; preds = %180
  store i32 0, ptr %22, align 4
  br label %182

182:                                              ; preds = %181, %178, %168
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #7
  %183 = load i32, ptr %22, align 4
  switch i32 %183, label %187 [
    i32 0, label %184
  ]

184:                                              ; preds = %182
  br label %185

185:                                              ; preds = %184
  %186 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %20) #7
  br label %151

187:                                              ; preds = %182, %153
  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 %188

188:                                              ; preds = %187
  %189 = load i8, ptr %18, align 1, !tbaa !14, !range !16, !noundef !17
  %190 = trunc i8 %189 to i1
  br i1 %190, label %191, label %192

191:                                              ; preds = %188
  store i32 10, ptr %22, align 4
  br label %193

192:                                              ; preds = %188
  store i32 0, ptr %22, align 4
  br label %193

193:                                              ; preds = %192, %191
  call void @llvm.lifetime.end.p0(i64 1, ptr %18) #7
  %194 = load i32, ptr %22, align 4
  switch i32 %194, label %438 [
    i32 0, label %195
    i32 10, label %196
  ]

195:                                              ; preds = %193
  br label %140, !llvm.loop !18

196:                                              ; preds = %193
  %197 = load i8, ptr %16, align 1, !tbaa !14, !range !16, !noundef !17
  %198 = trunc i8 %197 to i1
  br i1 %198, label %199, label %217

199:                                              ; preds = %196
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #7
  %200 = load i32, ptr @N, align 4, !tbaa !5
  %201 = sdiv i32 %200, 2
  %202 = sext i32 %201 to i64
  %203 = getelementptr inbounds [1000010 x i64], ptr @fact, i64 0, i64 %202
  %204 = load i64, ptr %203, align 8, !tbaa !19
  store i64 %204, ptr %24, align 8, !tbaa !19
  %205 = load i64, ptr %24, align 8, !tbaa !19
  %206 = load i64, ptr %24, align 8, !tbaa !19
  %207 = mul nsw i64 %205, %206
  %208 = srem i64 %207, 1000000007
  %209 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %208)
          to label %210 unwind label %213

210:                                              ; preds = %199
  %211 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %209, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %212 unwind label %213

212:                                              ; preds = %210
  store i32 0, ptr %1, align 4
  store i32 1, ptr %22, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #7
  br label %420

213:                                              ; preds = %210, %199
  %214 = landingpad { ptr, i32 }
          cleanup
  %215 = extractvalue { ptr, i32 } %214, 0
  store ptr %215, ptr %7, align 8
  %216 = extractvalue { ptr, i32 } %214, 1
  store i32 %216, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #7
  br label %431

217:                                              ; preds = %196
  call void @llvm.lifetime.start.p0(i64 24, ptr %25) #7
  call void @_ZNSt6vectorIxSaIxEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %25) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #7
  store i64 0, ptr %26, align 8, !tbaa !19
  invoke void @_ZNSt6vectorIxSaIxEE9push_backEOx(ptr noundef nonnull align 8 dereferenceable(24) %25, ptr noundef nonnull align 8 dereferenceable(8) %26)
          to label %218 unwind label %234

218:                                              ; preds = %217
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #7
  %219 = load i32, ptr @N, align 4, !tbaa !5
  %220 = sub nsw i32 %219, 1
  %221 = sext i32 %220 to i64
  store i64 %221, ptr %27, align 8, !tbaa !19
  call void @llvm.lifetime.start.p0(i64 8, ptr %28) #7
  %222 = load i32, ptr %17, align 4, !tbaa !5
  %223 = sext i32 %222 to i64
  %224 = getelementptr inbounds [5010 x %"class.std::vector"], ptr @children, i64 0, i64 %223
  store ptr %224, ptr %28, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %29) #7
  %225 = load ptr, ptr %28, align 8, !tbaa !11
  %226 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %225) #7
  %227 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %29, i32 0, i32 0
  store ptr %226, ptr %227, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %30) #7
  %228 = load ptr, ptr %28, align 8, !tbaa !11
  %229 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %228) #7
  %230 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %30, i32 0, i32 0
  store ptr %229, ptr %230, align 8
  br label %231

231:                                              ; preds = %250, %218
  %232 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %29, ptr noundef nonnull align 8 dereferenceable(8) %30) #7
  br i1 %232, label %238, label %233

233:                                              ; preds = %231
  store i32 13, ptr %22, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %30) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %29) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #7
  br label %256

234:                                              ; preds = %217
  %235 = landingpad { ptr, i32 }
          cleanup
  %236 = extractvalue { ptr, i32 } %235, 0
  store ptr %236, ptr %7, align 8
  %237 = extractvalue { ptr, i32 } %235, 1
  store i32 %237, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #7
  br label %430

238:                                              ; preds = %231
  call void @llvm.lifetime.start.p0(i64 4, ptr %31) #7
  %239 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %29) #7
  %240 = load i32, ptr %239, align 4, !tbaa !5
  store i32 %240, ptr %31, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %32) #7
  %241 = load i32, ptr %31, align 4, !tbaa !5
  %242 = sext i32 %241 to i64
  %243 = getelementptr inbounds [5010 x i32], ptr @child_num, i64 0, i64 %242
  %244 = load i32, ptr %243, align 4, !tbaa !5
  %245 = sext i32 %244 to i64
  store i64 %245, ptr %32, align 8, !tbaa !19
  invoke void @_ZNSt6vectorIxSaIxEE9push_backERKx(ptr noundef nonnull align 8 dereferenceable(24) %25, ptr noundef nonnull align 8 dereferenceable(8) %32)
          to label %246 unwind label %252

246:                                              ; preds = %238
  %247 = load i64, ptr %32, align 8, !tbaa !19
  %248 = load i64, ptr %27, align 8, !tbaa !19
  %249 = sub nsw i64 %248, %247
  store i64 %249, ptr %27, align 8, !tbaa !19
  call void @llvm.lifetime.end.p0(i64 8, ptr %32) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %31) #7
  br label %250

250:                                              ; preds = %246
  %251 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %29) #7
  br label %231

252:                                              ; preds = %238
  %253 = landingpad { ptr, i32 }
          cleanup
  %254 = extractvalue { ptr, i32 } %253, 0
  store ptr %254, ptr %7, align 8
  %255 = extractvalue { ptr, i32 } %253, 1
  store i32 %255, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %32) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %31) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %30) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %29) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #7
  br label %429

256:                                              ; preds = %233
  %257 = load i64, ptr %27, align 8, !tbaa !19
  %258 = icmp sgt i64 %257, 0
  br i1 %258, label %259, label %265

259:                                              ; preds = %256
  invoke void @_ZNSt6vectorIxSaIxEE9push_backERKx(ptr noundef nonnull align 8 dereferenceable(24) %25, ptr noundef nonnull align 8 dereferenceable(8) %27)
          to label %260 unwind label %261

260:                                              ; preds = %259
  br label %265

261:                                              ; preds = %259
  %262 = landingpad { ptr, i32 }
          cleanup
  %263 = extractvalue { ptr, i32 } %262, 0
  store ptr %263, ptr %7, align 8
  %264 = extractvalue { ptr, i32 } %262, 1
  store i32 %264, ptr %8, align 4
  br label %429

265:                                              ; preds = %260, %256
  call void @llvm.lifetime.start.p0(i64 4, ptr %33) #7
  %266 = call noundef i64 @_ZNKSt6vectorIxSaIxEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %25) #7
  %267 = trunc i64 %266 to i32
  store i32 %267, ptr %33, align 4, !tbaa !5
  %268 = load i32, ptr %33, align 4, !tbaa !5
  %269 = add nsw i32 %268, -1
  store i32 %269, ptr %33, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %34) #7
  store i32 0, ptr %34, align 4, !tbaa !5
  invoke void @_ZSt4fillIPxiEvT_S1_RKT0_(ptr noundef @DP, ptr noundef getelementptr inbounds (i64, ptr @DP, i64 25100100), ptr noundef nonnull align 4 dereferenceable(4) %34)
          to label %270 unwind label %276

270:                                              ; preds = %265
  call void @llvm.lifetime.end.p0(i64 4, ptr %34) #7
  store i64 1, ptr @DP, align 16, !tbaa !19
  call void @llvm.lifetime.start.p0(i64 4, ptr %35) #7
  store i32 1, ptr %35, align 4, !tbaa !5
  br label %271

271:                                              ; preds = %356, %270
  %272 = load i32, ptr %35, align 4, !tbaa !5
  %273 = load i32, ptr %33, align 4, !tbaa !5
  %274 = icmp sle i32 %272, %273
  br i1 %274, label %280, label %275

275:                                              ; preds = %271
  store i32 15, ptr %22, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %35) #7
  br label %359

276:                                              ; preds = %265
  %277 = landingpad { ptr, i32 }
          cleanup
  %278 = extractvalue { ptr, i32 } %277, 0
  store ptr %278, ptr %7, align 8
  %279 = extractvalue { ptr, i32 } %277, 1
  store i32 %279, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %34) #7
  br label %428

280:                                              ; preds = %271
  call void @llvm.lifetime.start.p0(i64 4, ptr %36) #7
  store i32 0, ptr %36, align 4, !tbaa !5
  br label %281

281:                                              ; preds = %352, %280
  %282 = load i32, ptr %36, align 4, !tbaa !5
  %283 = sext i32 %282 to i64
  %284 = load i32, ptr %35, align 4, !tbaa !5
  %285 = sext i32 %284 to i64
  %286 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %25, i64 noundef %285) #7
  %287 = load i64, ptr %286, align 8, !tbaa !19
  %288 = icmp sle i64 %283, %287
  br i1 %288, label %290, label %289

289:                                              ; preds = %281
  store i32 18, ptr %22, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %36) #7
  br label %355

290:                                              ; preds = %281
  call void @llvm.lifetime.start.p0(i64 4, ptr %37) #7
  store i32 0, ptr %37, align 4, !tbaa !5
  br label %291

291:                                              ; preds = %348, %290
  %292 = load i32, ptr %37, align 4, !tbaa !5
  %293 = load i32, ptr @N, align 4, !tbaa !5
  %294 = load i32, ptr %36, align 4, !tbaa !5
  %295 = sub nsw i32 %293, %294
  %296 = icmp sle i32 %292, %295
  br i1 %296, label %298, label %297

297:                                              ; preds = %291
  store i32 21, ptr %22, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %37) #7
  br label %351

298:                                              ; preds = %291
  call void @llvm.lifetime.start.p0(i64 8, ptr %38) #7
  %299 = load i32, ptr %35, align 4, !tbaa !5
  %300 = sext i32 %299 to i64
  %301 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %25, i64 noundef %300) #7
  %302 = load i64, ptr %301, align 8, !tbaa !19
  %303 = trunc i64 %302 to i32
  %304 = load i32, ptr %36, align 4, !tbaa !5
  %305 = call noundef i64 @_Z1Cii(i32 noundef %303, i32 noundef %304)
  store i64 %305, ptr %38, align 8, !tbaa !19
  call void @llvm.lifetime.start.p0(i64 8, ptr %39) #7
  %306 = load i32, ptr %35, align 4, !tbaa !5
  %307 = sub nsw i32 %306, 1
  %308 = sext i32 %307 to i64
  %309 = getelementptr inbounds [5010 x [5010 x i64]], ptr @DP, i64 0, i64 %308
  %310 = load i32, ptr %37, align 4, !tbaa !5
  %311 = sext i32 %310 to i64
  %312 = getelementptr inbounds [5010 x i64], ptr %309, i64 0, i64 %311
  %313 = load i64, ptr %312, align 8, !tbaa !19
  %314 = load i32, ptr %36, align 4, !tbaa !5
  %315 = sext i32 %314 to i64
  %316 = getelementptr inbounds [1000010 x i64], ptr @fact, i64 0, i64 %315
  %317 = load i64, ptr %316, align 8, !tbaa !19
  %318 = mul nsw i64 %313, %317
  %319 = srem i64 %318, 1000000007
  store i64 %319, ptr %39, align 8, !tbaa !19
  %320 = load i64, ptr %39, align 8, !tbaa !19
  %321 = load i64, ptr %38, align 8, !tbaa !19
  %322 = load i64, ptr %38, align 8, !tbaa !19
  %323 = mul nsw i64 %321, %322
  %324 = srem i64 %323, 1000000007
  %325 = mul nsw i64 %320, %324
  %326 = srem i64 %325, 1000000007
  store i64 %326, ptr %39, align 8, !tbaa !19
  %327 = load i64, ptr %39, align 8, !tbaa !19
  %328 = load i32, ptr %35, align 4, !tbaa !5
  %329 = sext i32 %328 to i64
  %330 = getelementptr inbounds [5010 x [5010 x i64]], ptr @DP, i64 0, i64 %329
  %331 = load i32, ptr %37, align 4, !tbaa !5
  %332 = load i32, ptr %36, align 4, !tbaa !5
  %333 = add nsw i32 %331, %332
  %334 = sext i32 %333 to i64
  %335 = getelementptr inbounds [5010 x i64], ptr %330, i64 0, i64 %334
  %336 = load i64, ptr %335, align 8, !tbaa !19
  %337 = add nsw i64 %336, %327
  store i64 %337, ptr %335, align 8, !tbaa !19
  %338 = load i32, ptr %35, align 4, !tbaa !5
  %339 = sext i32 %338 to i64
  %340 = getelementptr inbounds [5010 x [5010 x i64]], ptr @DP, i64 0, i64 %339
  %341 = load i32, ptr %37, align 4, !tbaa !5
  %342 = load i32, ptr %36, align 4, !tbaa !5
  %343 = add nsw i32 %341, %342
  %344 = sext i32 %343 to i64
  %345 = getelementptr inbounds [5010 x i64], ptr %340, i64 0, i64 %344
  %346 = load i64, ptr %345, align 8, !tbaa !19
  %347 = srem i64 %346, 1000000007
  store i64 %347, ptr %345, align 8, !tbaa !19
  call void @llvm.lifetime.end.p0(i64 8, ptr %39) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %38) #7
  br label %348

348:                                              ; preds = %298
  %349 = load i32, ptr %37, align 4, !tbaa !5
  %350 = add nsw i32 %349, 1
  store i32 %350, ptr %37, align 4, !tbaa !5
  br label %291, !llvm.loop !21

351:                                              ; preds = %297
  br label %352

352:                                              ; preds = %351
  %353 = load i32, ptr %36, align 4, !tbaa !5
  %354 = add nsw i32 %353, 1
  store i32 %354, ptr %36, align 4, !tbaa !5
  br label %281, !llvm.loop !22

355:                                              ; preds = %289
  br label %356

356:                                              ; preds = %355
  %357 = load i32, ptr %35, align 4, !tbaa !5
  %358 = add nsw i32 %357, 1
  store i32 %358, ptr %35, align 4, !tbaa !5
  br label %271, !llvm.loop !23

359:                                              ; preds = %275
  call void @llvm.lifetime.start.p0(i64 8, ptr %40) #7
  store i64 0, ptr %40, align 8, !tbaa !19
  call void @llvm.lifetime.start.p0(i64 4, ptr %41) #7
  store i32 0, ptr %41, align 4, !tbaa !5
  br label %360

360:                                              ; preds = %411, %359
  %361 = load i32, ptr %41, align 4, !tbaa !5
  %362 = load i32, ptr @N, align 4, !tbaa !5
  %363 = icmp sle i32 %361, %362
  br i1 %363, label %365, label %364

364:                                              ; preds = %360
  store i32 24, ptr %22, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %41) #7
  br label %414

365:                                              ; preds = %360
  %366 = load i32, ptr %41, align 4, !tbaa !5
  %367 = srem i32 %366, 2
  %368 = icmp eq i32 %367, 0
  br i1 %368, label %369, label %389

369:                                              ; preds = %365
  %370 = load i32, ptr @N, align 4, !tbaa !5
  %371 = load i32, ptr %41, align 4, !tbaa !5
  %372 = sub nsw i32 %370, %371
  %373 = sext i32 %372 to i64
  %374 = getelementptr inbounds [1000010 x i64], ptr @fact, i64 0, i64 %373
  %375 = load i64, ptr %374, align 8, !tbaa !19
  %376 = load i32, ptr %33, align 4, !tbaa !5
  %377 = sext i32 %376 to i64
  %378 = getelementptr inbounds [5010 x [5010 x i64]], ptr @DP, i64 0, i64 %377
  %379 = load i32, ptr %41, align 4, !tbaa !5
  %380 = sext i32 %379 to i64
  %381 = getelementptr inbounds [5010 x i64], ptr %378, i64 0, i64 %380
  %382 = load i64, ptr %381, align 8, !tbaa !19
  %383 = mul nsw i64 %375, %382
  %384 = srem i64 %383, 1000000007
  %385 = load i64, ptr %40, align 8, !tbaa !19
  %386 = add nsw i64 %385, %384
  store i64 %386, ptr %40, align 8, !tbaa !19
  %387 = load i64, ptr %40, align 8, !tbaa !19
  %388 = srem i64 %387, 1000000007
  store i64 %388, ptr %40, align 8, !tbaa !19
  br label %410

389:                                              ; preds = %365
  %390 = load i32, ptr @N, align 4, !tbaa !5
  %391 = load i32, ptr %41, align 4, !tbaa !5
  %392 = sub nsw i32 %390, %391
  %393 = sext i32 %392 to i64
  %394 = getelementptr inbounds [1000010 x i64], ptr @fact, i64 0, i64 %393
  %395 = load i64, ptr %394, align 8, !tbaa !19
  %396 = load i32, ptr %33, align 4, !tbaa !5
  %397 = sext i32 %396 to i64
  %398 = getelementptr inbounds [5010 x [5010 x i64]], ptr @DP, i64 0, i64 %397
  %399 = load i32, ptr %41, align 4, !tbaa !5
  %400 = sext i32 %399 to i64
  %401 = getelementptr inbounds [5010 x i64], ptr %398, i64 0, i64 %400
  %402 = load i64, ptr %401, align 8, !tbaa !19
  %403 = mul nsw i64 %395, %402
  %404 = srem i64 %403, 1000000007
  %405 = sub nsw i64 1000000007, %404
  %406 = load i64, ptr %40, align 8, !tbaa !19
  %407 = add nsw i64 %406, %405
  store i64 %407, ptr %40, align 8, !tbaa !19
  %408 = load i64, ptr %40, align 8, !tbaa !19
  %409 = srem i64 %408, 1000000007
  store i64 %409, ptr %40, align 8, !tbaa !19
  br label %410

410:                                              ; preds = %389, %369
  br label %411

411:                                              ; preds = %410
  %412 = load i32, ptr %41, align 4, !tbaa !5
  %413 = add nsw i32 %412, 1
  store i32 %413, ptr %41, align 4, !tbaa !5
  br label %360, !llvm.loop !24

414:                                              ; preds = %364
  %415 = load i64, ptr %40, align 8, !tbaa !19
  %416 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %415)
          to label %417 unwind label %424

417:                                              ; preds = %414
  %418 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %416, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %419 unwind label %424

419:                                              ; preds = %417
  call void @llvm.lifetime.end.p0(i64 8, ptr %40) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %33) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #7
  call void @_ZNSt6vectorIxSaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %25) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %25) #7
  store i32 0, ptr %22, align 4
  br label %420

420:                                              ; preds = %419, %212
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %16) #7
  call void @_ZNSt5queueIiSt5dequeIiSaIiEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %5) #7
  call void @llvm.lifetime.end.p0(i64 80, ptr %5) #7
  %421 = load i32, ptr %22, align 4
  switch i32 %421, label %438 [
    i32 0, label %422
    i32 1, label %422
  ]

422:                                              ; preds = %420, %420
  %423 = load i32, ptr %1, align 4
  ret i32 %423

424:                                              ; preds = %417, %414
  %425 = landingpad { ptr, i32 }
          cleanup
  %426 = extractvalue { ptr, i32 } %425, 0
  store ptr %426, ptr %7, align 8
  %427 = extractvalue { ptr, i32 } %425, 1
  store i32 %427, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %40) #7
  br label %428

428:                                              ; preds = %424, %276
  call void @llvm.lifetime.end.p0(i64 4, ptr %33) #7
  br label %429

429:                                              ; preds = %428, %261, %252
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #7
  br label %430

430:                                              ; preds = %429, %234
  call void @_ZNSt6vectorIxSaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %25) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %25) #7
  br label %431

431:                                              ; preds = %430, %213
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %16) #7
  br label %432

432:                                              ; preds = %431, %136, %102, %98, %94, %90
  call void @_ZNSt5queueIiSt5dequeIiSaIiEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %5) #7
  call void @llvm.lifetime.end.p0(i64 80, ptr %5) #7
  br label %433

433:                                              ; preds = %432
  %434 = load ptr, ptr %7, align 8
  %435 = load i32, ptr %8, align 4
  %436 = insertvalue { ptr, i32 } poison, ptr %434, 0
  %437 = insertvalue { ptr, i32 } %436, i32 %435, 1
  resume { ptr, i32 } %437

438:                                              ; preds = %420, %193
  unreachable
}

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

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

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

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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4fillIPiiEvT_S1_RKT0_(ptr noundef, ptr noundef, ptr noundef nonnull align 4 dereferenceable(4)) #6

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

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

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

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

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

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

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

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

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4fillIPxiEvT_S1_RKT0_(ptr noundef, ptr noundef, ptr noundef nonnull align 4 dereferenceable(4)) #6

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

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

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

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


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

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

@fact = external dso_local local_unnamed_addr global [1000010 x i64], align 16
@N = external dso_local global i32, align 4
@V = external dso_local global [5010 x %"class.std::vector"], align 16
@children = external dso_local global [5010 x %"class.std::vector"], align 16
@child_num = external dso_local global [5010 x i32], align 16
@parent = external dso_local global [5010 x i32], align 16
@DP = external dso_local global [5010 x [5010 x i64]], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z4initv() 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 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 i64 @_Z1Cii(i32 noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z14calc_child_numi(i32 noundef) local_unnamed_addr #2

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

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

; 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 #0 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 #0 align 2

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #4 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca %"class.std::queue", align 8
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %8 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %9 = alloca i32, align 4
  %10 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %11 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %12 = alloca %"class.std::vector.0", align 8
  %13 = alloca i64, align 8
  %14 = alloca i64, align 8
  %15 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %16 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %17 = alloca i64, align 8
  %18 = alloca i32, align 4
  tail call void @_Z4initv()
  %19 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) @N)
  %20 = load i32, ptr @N, align 4, !tbaa !5
  %21 = icmp sgt i32 %20, 1
  br i1 %21, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %0
  call void @llvm.lifetime.start.p0(i64 80, ptr nonnull %3) #7
  call void @_ZNSt5queueIiSt5dequeIiSaIiEEEC2IS2_vEEv(ptr noundef nonnull align 8 dereferenceable(80) %3)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #7
  store i32 0, ptr %4, align 4, !tbaa !5
  invoke void @_ZNSt5queueIiSt5dequeIiSaIiEEE4pushEOi(ptr noundef nonnull align 8 dereferenceable(80) %3, ptr noundef nonnull align 4 dereferenceable(4) %4)
          to label %37 unwind label %50

.lr.ph:                                           ; preds = %0, %.lr.ph
  %.067113 = phi i32 [ %33, %.lr.ph ], [ 0, %0 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #7
  %22 = 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)
  %23 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %22, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %24 = load i32, ptr %1, align 4, !tbaa !5
  %25 = add nsw i32 %24, -1
  store i32 %25, ptr %1, align 4, !tbaa !5
  %26 = load i32, ptr %2, align 4, !tbaa !5
  %27 = add nsw i32 %26, -1
  store i32 %27, ptr %2, align 4, !tbaa !5
  %28 = sext i32 %25 to i64
  %29 = getelementptr inbounds [5010 x %"class.std::vector"], ptr @V, i64 0, i64 %28
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %29, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %30 = load i32, ptr %2, align 4, !tbaa !5
  %31 = sext i32 %30 to i64
  %32 = getelementptr inbounds [5010 x %"class.std::vector"], ptr @V, i64 0, i64 %31
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %32, ptr noundef nonnull align 4 dereferenceable(4) %1)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #7
  %33 = add nuw nsw i32 %.067113, 1
  %34 = load i32, ptr @N, align 4, !tbaa !5
  %35 = add nsw i32 %34, -1
  %36 = icmp slt i32 %33, %35
  br i1 %36, label %.lr.ph, label %._crit_edge, !llvm.loop !9

37:                                               ; preds = %._crit_edge
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #7
  store i32 -1, ptr %5, align 4, !tbaa !5
  invoke void @_ZSt4fillIPiiEvT_S1_RKT0_(ptr noundef nonnull @child_num, ptr noundef nonnull getelementptr inbounds (i8, ptr @child_num, i64 20040), ptr noundef nonnull align 4 dereferenceable(4) %5)
          to label %38 unwind label %52

38:                                               ; preds = %37
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #7
  store i32 -1, ptr %6, align 4, !tbaa !5
  invoke void @_ZSt4fillIPiiEvT_S1_RKT0_(ptr noundef nonnull @parent, ptr noundef nonnull getelementptr inbounds (i8, ptr @parent, i64 20040), ptr noundef nonnull align 4 dereferenceable(4) %6)
          to label %39 unwind label %54

39:                                               ; preds = %38
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #7
  store i32 -2, ptr @parent, align 16, !tbaa !5
  %40 = call noundef zeroext i1 @_ZNKSt5queueIiSt5dequeIiSaIiEEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %3)
  br i1 %40, label %._crit_edge119, label %.lr.ph118

.lr.ph118:                                        ; preds = %39, %._crit_edge116
  %41 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5queueIiSt5dequeIiSaIiEEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) %3)
  %42 = load i32, ptr %41, align 4, !tbaa !5
  call void @_ZNSt5queueIiSt5dequeIiSaIiEEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %3)
  %43 = sext i32 %42 to i64
  %44 = getelementptr inbounds [5010 x %"class.std::vector"], ptr @V, i64 0, i64 %43
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #7
  %45 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %44) #7
  store ptr %45, ptr %7, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #7
  %46 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %44) #7
  store ptr %46, ptr %8, align 8
  %47 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef nonnull align 8 dereferenceable(8) %8) #7
  br i1 %47, label %.lr.ph115, label %._crit_edge116

.lr.ph115:                                        ; preds = %.lr.ph118
  %48 = getelementptr inbounds [5010 x %"class.std::vector"], ptr @children, i64 0, i64 %43
  br label %58

._crit_edge116:                                   ; preds = %69, %.lr.ph118
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #7
  %49 = call noundef zeroext i1 @_ZNKSt5queueIiSt5dequeIiSaIiEEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %3)
  br i1 %49, label %._crit_edge119, label %.lr.ph118, !llvm.loop !11

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

52:                                               ; preds = %37
  %53 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #7
  br label %200

54:                                               ; preds = %38
  %55 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #7
  br label %200

56:                                               ; preds = %._crit_edge119
  %57 = landingpad { ptr, i32 }
          cleanup
  br label %200

58:                                               ; preds = %.lr.ph115, %69
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %9) #7
  %59 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %7) #7
  %60 = load i32, ptr %59, align 4, !tbaa !5
  store i32 %60, ptr %9, align 4, !tbaa !5
  %61 = sext i32 %60 to i64
  %62 = getelementptr inbounds [5010 x i32], ptr @parent, i64 0, i64 %61
  %63 = load i32, ptr %62, align 4, !tbaa !5
  %64 = icmp eq i32 %63, -1
  br i1 %64, label %65, label %69

65:                                               ; preds = %58
  store i32 %42, ptr %62, align 4, !tbaa !5
  invoke void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %48, ptr noundef nonnull align 4 dereferenceable(4) %9)
          to label %66 unwind label %67

66:                                               ; preds = %65
  invoke void @_ZNSt5queueIiSt5dequeIiSaIiEEE4pushERKi(ptr noundef nonnull align 8 dereferenceable(80) %3, ptr noundef nonnull align 4 dereferenceable(4) %9)
          to label %69 unwind label %67

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

69:                                               ; preds = %66, %58
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #7
  %70 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %7) #7
  %71 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef nonnull align 8 dereferenceable(8) %8) #7
  br i1 %71, label %58, label %._crit_edge116

._crit_edge119:                                   ; preds = %._crit_edge116, %39
  %72 = invoke noundef i32 @_Z14calc_child_numi(i32 noundef 0)
          to label %.preheader112 unwind label %56

.preheader112:                                    ; preds = %._crit_edge119, %.thread
  %.082 = phi i32 [ %.385, %.thread ], [ 0, %._crit_edge119 ]
  %.078 = phi i1 [ %.381, %.thread ], [ false, %._crit_edge119 ]
  %73 = sext i32 %.082 to i64
  %74 = getelementptr inbounds [5010 x %"class.std::vector"], ptr @children, i64 0, i64 %73
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #7
  %75 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %74) #7
  store ptr %75, ptr %10, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %11) #7
  %76 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %74) #7
  store ptr %76, ptr %11, align 8
  %77 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %10, ptr noundef nonnull align 8 dereferenceable(8) %11) #7
  br i1 %77, label %.lr.ph123, label %.thread.thread

.thread.thread:                                   ; preds = %.preheader112
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #7
  br i1 %.078, label %93, label %106

.lr.ph123:                                        ; preds = %.preheader112, %89
  %78 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %10) #7
  %79 = load i32, ptr %78, align 4, !tbaa !5
  %80 = load i32, ptr @N, align 4, !tbaa !5
  %81 = and i32 %80, 1
  %82 = icmp eq i32 %81, 0
  %83 = sext i32 %79 to i64
  %84 = getelementptr inbounds [5010 x i32], ptr @child_num, i64 0, i64 %83
  %85 = load i32, ptr %84, align 4, !tbaa !5
  %86 = ashr exact i32 %80, 1
  %87 = icmp eq i32 %85, %86
  %or.cond = select i1 %82, i1 %87, i1 false
  br i1 %or.cond, label %.thread, label %.lr.ph123._crit_edge

.lr.ph123._crit_edge:                             ; preds = %.lr.ph123
  %88 = sdiv i32 %80, 2
  %.not109.not = icmp sgt i32 %85, %88
  br i1 %.not109.not, label %.thread, label %89

89:                                               ; preds = %.lr.ph123._crit_edge
  %90 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %10) #7
  %91 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %10, ptr noundef nonnull align 8 dereferenceable(8) %11) #7
  br i1 %91, label %.lr.ph123, label %.thread

.thread:                                          ; preds = %.lr.ph123, %.lr.ph123._crit_edge, %89
  %.290 = phi i1 [ false, %.lr.ph123._crit_edge ], [ true, %89 ], [ true, %.lr.ph123 ]
  %.385 = phi i32 [ %79, %.lr.ph123._crit_edge ], [ %.082, %89 ], [ %79, %.lr.ph123 ]
  %.381 = phi i1 [ %.078, %.lr.ph123._crit_edge ], [ %.078, %89 ], [ true, %.lr.ph123 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #7
  br i1 %.290, label %92, label %.preheader112

92:                                               ; preds = %.thread
  br i1 %.381, label %93, label %106

93:                                               ; preds = %.thread.thread, %92
  %94 = load i32, ptr @N, align 4, !tbaa !5
  %95 = sdiv i32 %94, 2
  %96 = sext i32 %95 to i64
  %97 = getelementptr inbounds [1000010 x i64], ptr @fact, i64 0, i64 %96
  %98 = load i64, ptr %97, align 8, !tbaa !12
  %99 = mul nsw i64 %98, %98
  %100 = urem i64 %99, 1000000007
  %101 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %100)
          to label %102 unwind label %104

102:                                              ; preds = %93
  %103 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %101, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %195 unwind label %104

104:                                              ; preds = %102, %93
  %105 = landingpad { ptr, i32 }
          cleanup
  br label %200

106:                                              ; preds = %.thread.thread, %92
  %.385169171 = phi i32 [ %.082, %.thread.thread ], [ %.385, %92 ]
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %12) #7
  call void @_ZNSt6vectorIxSaIxEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %12) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %13) #7
  store i64 0, ptr %13, align 8, !tbaa !12
  invoke void @_ZNSt6vectorIxSaIxEE9push_backEOx(ptr noundef nonnull align 8 dereferenceable(24) %12, ptr noundef nonnull align 8 dereferenceable(8) %13)
          to label %107 unwind label %118

107:                                              ; preds = %106
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %13) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %14) #7
  %108 = load i32, ptr @N, align 4, !tbaa !5
  %109 = add nsw i32 %108, -1
  %110 = sext i32 %109 to i64
  store i64 %110, ptr %14, align 8, !tbaa !12
  %111 = sext i32 %.385169171 to i64
  %112 = getelementptr inbounds [5010 x %"class.std::vector"], ptr @children, i64 0, i64 %111
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %15) #7
  %113 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %112) #7
  store ptr %113, ptr %15, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %16) #7
  %114 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %112) #7
  store ptr %114, ptr %16, align 8
  %115 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %15, ptr noundef nonnull align 8 dereferenceable(8) %16) #7
  br i1 %115, label %.lr.ph135, label %._crit_edge136

._crit_edge136:                                   ; preds = %127, %107
  %116 = phi i64 [ %110, %107 ], [ %129, %127 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %16) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %15) #7
  %117 = icmp sgt i64 %116, 0
  br i1 %117, label %134, label %137

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

.lr.ph135:                                        ; preds = %107, %127
  %120 = phi i64 [ %129, %127 ], [ %110, %107 ]
  %121 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %15) #7
  %122 = load i32, ptr %121, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %17) #7
  %123 = sext i32 %122 to i64
  %124 = getelementptr inbounds [5010 x i32], ptr @child_num, i64 0, i64 %123
  %125 = load i32, ptr %124, align 4, !tbaa !5
  %126 = sext i32 %125 to i64
  store i64 %126, ptr %17, align 8, !tbaa !12
  invoke void @_ZNSt6vectorIxSaIxEE9push_backERKx(ptr noundef nonnull align 8 dereferenceable(24) %12, ptr noundef nonnull align 8 dereferenceable(8) %17)
          to label %127 unwind label %132

127:                                              ; preds = %.lr.ph135
  %128 = load i64, ptr %17, align 8, !tbaa !12
  %129 = sub nsw i64 %120, %128
  store i64 %129, ptr %14, align 8, !tbaa !12
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %17) #7
  %130 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %15) #7
  %131 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %15, ptr noundef nonnull align 8 dereferenceable(8) %16) #7
  br i1 %131, label %.lr.ph135, label %._crit_edge136

132:                                              ; preds = %.lr.ph135
  %133 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %17) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %16) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %15) #7
  br label %198

134:                                              ; preds = %._crit_edge136
  invoke void @_ZNSt6vectorIxSaIxEE9push_backERKx(ptr noundef nonnull align 8 dereferenceable(24) %12, ptr noundef nonnull align 8 dereferenceable(8) %14)
          to label %137 unwind label %135

135:                                              ; preds = %134
  %136 = landingpad { ptr, i32 }
          cleanup
  br label %198

137:                                              ; preds = %134, %._crit_edge136
  %138 = call noundef i64 @_ZNKSt6vectorIxSaIxEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %12) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %18) #7
  store i32 0, ptr %18, align 4, !tbaa !5
  invoke void @_ZSt4fillIPxiEvT_S1_RKT0_(ptr noundef nonnull @DP, ptr noundef nonnull getelementptr inbounds (i8, ptr @DP, i64 200800800), ptr noundef nonnull align 4 dereferenceable(4) %18)
          to label %139 unwind label %149

139:                                              ; preds = %137
  %140 = trunc i64 %138 to i32
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %18) #7
  store i64 1, ptr @DP, align 16, !tbaa !12
  %.not.not144 = icmp sgt i32 %140, 1
  br i1 %.not.not144, label %.preheader111.preheader, label %.preheader

.preheader111.preheader:                          ; preds = %139
  %wide.trip.count = and i64 %138, 2147483647
  br label %.preheader111

.preheader111:                                    ; preds = %.preheader111.preheader, %._crit_edge143
  %indvars.iv157 = phi i64 [ 1, %.preheader111.preheader ], [ %indvars.iv.next158, %._crit_edge143 ]
  %141 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %12, i64 noundef %indvars.iv157) #7
  %142 = load i64, ptr %141, align 8, !tbaa !12
  %.not95141 = icmp slt i64 %142, 0
  br i1 %.not95141, label %._crit_edge143, label %.preheader110.lr.ph

.preheader110.lr.ph:                              ; preds = %.preheader111
  %143 = add nsw i64 %indvars.iv157, -1
  br label %.preheader110

.preheader:                                       ; preds = %._crit_edge143, %139
  %144 = load i32, ptr @N, align 4, !tbaa !5
  %.not146 = icmp slt i32 %144, 0
  br i1 %.not146, label %._crit_edge150, label %.lr.ph149

.lr.ph149:                                        ; preds = %.preheader
  %145 = shl i64 %138, 32
  %sext = add i64 %145, -4294967296
  %146 = ashr exact i64 %sext, 32
  %147 = zext nneg i32 %144 to i64
  %148 = add nuw i32 %144, 1
  %wide.trip.count163 = zext i32 %148 to i64
  br label %180

149:                                              ; preds = %137
  %150 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %18) #7
  br label %198

.preheader110:                                    ; preds = %.preheader110.lr.ph, %._crit_edge140
  %indvars.iv154 = phi i64 [ 0, %.preheader110.lr.ph ], [ %indvars.iv.next155, %._crit_edge140 ]
  %151 = load i32, ptr @N, align 4, !tbaa !5
  %152 = sext i32 %151 to i64
  %.not96137 = icmp sgt i64 %indvars.iv154, %152
  br i1 %.not96137, label %._crit_edge140, label %.lr.ph139

.lr.ph139:                                        ; preds = %.preheader110
  %153 = getelementptr inbounds [1000010 x i64], ptr @fact, i64 0, i64 %indvars.iv154
  %154 = trunc nuw nsw i64 %indvars.iv154 to i32
  br label %157

._crit_edge143:                                   ; preds = %._crit_edge140, %.preheader111
  %indvars.iv.next158 = add nuw nsw i64 %indvars.iv157, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next158, %wide.trip.count
  br i1 %exitcond.not, label %.preheader, label %.preheader111, !llvm.loop !14

._crit_edge140:                                   ; preds = %157, %.preheader110
  %indvars.iv.next155 = add nuw nsw i64 %indvars.iv154, 1
  %155 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %12, i64 noundef %indvars.iv157) #7
  %156 = load i64, ptr %155, align 8, !tbaa !12
  %.not95.not = icmp sgt i64 %156, %indvars.iv154
  br i1 %.not95.not, label %.preheader110, label %._crit_edge143, !llvm.loop !15

157:                                              ; preds = %.lr.ph139, %157
  %indvars.iv = phi i64 [ 0, %.lr.ph139 ], [ %indvars.iv.next, %157 ]
  %158 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %12, i64 noundef %indvars.iv157) #7
  %159 = load i64, ptr %158, align 8, !tbaa !12
  %160 = trunc i64 %159 to i32
  %161 = call noundef i64 @_Z1Cii(i32 noundef %160, i32 noundef %154)
  %162 = getelementptr inbounds [5010 x [5010 x i64]], ptr @DP, i64 0, i64 %143, i64 %indvars.iv
  %163 = load i64, ptr %162, align 8, !tbaa !12
  %164 = load i64, ptr %153, align 8, !tbaa !12
  %165 = mul nsw i64 %164, %163
  %166 = srem i64 %165, 1000000007
  %167 = mul nsw i64 %161, %161
  %168 = urem i64 %167, 1000000007
  %169 = mul nsw i64 %166, %168
  %170 = srem i64 %169, 1000000007
  %171 = add nuw nsw i64 %indvars.iv, %indvars.iv154
  %172 = getelementptr inbounds [5010 x [5010 x i64]], ptr @DP, i64 0, i64 %indvars.iv157, i64 %171
  %173 = load i64, ptr %172, align 8, !tbaa !12
  %174 = add nsw i64 %170, %173
  %175 = srem i64 %174, 1000000007
  store i64 %175, ptr %172, align 8, !tbaa !12
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %176 = load i32, ptr @N, align 4, !tbaa !5
  %177 = sub nsw i32 %176, %154
  %178 = sext i32 %177 to i64
  %.not96.not = icmp slt i64 %indvars.iv, %178
  br i1 %.not96.not, label %157, label %._crit_edge140, !llvm.loop !16

._crit_edge150:                                   ; preds = %180, %.preheader
  %.065.lcssa = phi i64 [ 0, %.preheader ], [ %.1, %180 ]
  %179 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %.065.lcssa)
          to label %192 unwind label %196

180:                                              ; preds = %.lr.ph149, %180
  %indvars.iv160 = phi i64 [ 0, %.lr.ph149 ], [ %indvars.iv.next161, %180 ]
  %.065147 = phi i64 [ 0, %.lr.ph149 ], [ %.1, %180 ]
  %181 = and i64 %indvars.iv160, 1
  %182 = icmp eq i64 %181, 0
  %183 = sub nsw i64 %147, %indvars.iv160
  %184 = getelementptr inbounds [1000010 x i64], ptr @fact, i64 0, i64 %183
  %185 = load i64, ptr %184, align 8, !tbaa !12
  %186 = getelementptr inbounds [5010 x [5010 x i64]], ptr @DP, i64 0, i64 %146, i64 %indvars.iv160
  %187 = load i64, ptr %186, align 8, !tbaa !12
  %188 = mul nsw i64 %187, %185
  %189 = srem i64 %188, 1000000007
  %190 = add nsw i64 %189, %.065147
  %reass.sub = add nsw i64 %.065147, 1000000007
  %191 = sub nsw i64 %reass.sub, %189
  %.1.in = select i1 %182, i64 %190, i64 %191
  %.1 = srem i64 %.1.in, 1000000007
  %indvars.iv.next161 = add nuw nsw i64 %indvars.iv160, 1
  %exitcond164.not = icmp eq i64 %indvars.iv.next161, %wide.trip.count163
  br i1 %exitcond164.not, label %._crit_edge150, label %180, !llvm.loop !17

192:                                              ; preds = %._crit_edge150
  %193 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %179, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %194 unwind label %196

194:                                              ; preds = %192
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %14) #7
  call void @_ZNSt6vectorIxSaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %12) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %12) #7
  br label %195

195:                                              ; preds = %102, %194
  call void @_ZNSt5queueIiSt5dequeIiSaIiEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %3) #7
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %3) #7
  ret i32 0

196:                                              ; preds = %192, %._crit_edge150
  %197 = landingpad { ptr, i32 }
          cleanup
  br label %198

198:                                              ; preds = %149, %196, %135, %132
  %.pn97 = phi { ptr, i32 } [ %133, %132 ], [ %136, %135 ], [ %197, %196 ], [ %150, %149 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %14) #7
  br label %199

199:                                              ; preds = %198, %118
  %.pn97.pn = phi { ptr, i32 } [ %.pn97, %198 ], [ %119, %118 ]
  call void @_ZNSt6vectorIxSaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %12) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %12) #7
  br label %200

200:                                              ; preds = %104, %199, %67, %56, %54, %52, %50
  %.pn102 = phi { ptr, i32 } [ %68, %67 ], [ %57, %56 ], [ %55, %54 ], [ %53, %52 ], [ %51, %50 ], [ %105, %104 ], [ %.pn97.pn, %199 ]
  call void @_ZNSt5queueIiSt5dequeIiSaIiEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %3) #7
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %3) #7
  resume { ptr, i32 } %.pn102
}

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

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

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

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

declare i32 @__gxx_personality_v0(...)

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

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

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

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

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

; 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 #2 align 2

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

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

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

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

; 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 #2 align 2

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4fillIPxiEvT_S1_RKT0_(ptr noundef, ptr noundef, ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #6

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

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

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

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


; Effective O3 passes: ADCEPass,AggressiveInstCombinePass,BDCEPass,CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopInstSimplifyPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass