; LLVM IR from VastoLorde95/Competitive-Programming :: Codeforces/Good Bye 2015/Problem F (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::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"class.std::map" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<long long, std::pair<const long long, long long>, std::_Select1st<std::pair<const long long, long long>>, std::less<long long>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<long long, std::pair<const long long, long long>, std::_Select1st<std::pair<const long long, long long>>, std::less<long long>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::_Rb_tree_header" = type { %"struct.std::_Rb_tree_node_base", i64 }
%"struct.std::_Rb_tree_node_base" = type { i32, ptr, ptr, ptr }
%"class.std::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 }

@n = external dso_local global i64, align 8
@h = external dso_local global i64, align 8
@w = external dso_local global i64, align 8
@inf = external dso_local global i64, align 8
@_Z1sB5cxx11 = external dso_local global %"class.std::__cxx11::basic_string", align 8
@lx = external dso_local global %"class.std::map", align 8
@ly = external dso_local global %"class.std::map", align 8
@MOD = external dso_local global i64, align 8
@m = external dso_local global %"class.std::vector", align 8
@_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.5 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [110 x i8], align 1
@__PRETTY_FUNCTION__.main = external hidden unnamed_addr constant [11 x i8], align 1

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #1 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 i64, align 8
  %8 = alloca i64, align 8
  %9 = alloca i64, align 8
  %10 = alloca i64, align 8
  %11 = alloca i32, align 4
  %12 = alloca i64, align 8
  %13 = alloca i64, align 8
  %14 = alloca i64, align 8
  %15 = alloca i64, align 8
  %16 = alloca i32, align 4
  %17 = alloca i64, align 8
  %18 = alloca i64, align 8
  %19 = alloca i64, align 8
  %20 = alloca i64, align 8
  %21 = alloca i64, align 8
  %22 = alloca i64, align 8
  %23 = alloca i64, align 8
  %24 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %25 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %26 = alloca %"class.std::vector", align 8
  %27 = alloca i32, align 4
  %28 = alloca i64, align 8
  %29 = alloca i32, align 4
  %30 = alloca i64, align 8
  %31 = alloca ptr, align 8
  %32 = alloca i32, align 4
  %33 = alloca i64, align 8
  %34 = alloca i64, align 8
  %35 = alloca i64, align 8
  %36 = alloca i64, align 8
  %37 = alloca i64, align 8
  %38 = alloca i32, align 4
  %39 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %40 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %41 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %42 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  store i32 0, ptr %1, align 4
  %43 = call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %44 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %45 = getelementptr i8, ptr %44, i64 -24
  %46 = load i64, ptr %45, align 8
  %47 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %46
  %48 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %47, ptr noundef null)
  %49 = load ptr, ptr @_ZSt4cout, align 8, !tbaa !5
  %50 = getelementptr i8, ptr %49, i64 -24
  %51 = load i64, ptr %50, align 8
  %52 = getelementptr inbounds i8, ptr @_ZSt4cout, i64 %51
  %53 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %52, ptr noundef null)
  %54 = 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)
  %55 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %54, ptr noundef nonnull align 8 dereferenceable(8) @h)
  %56 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %55, ptr noundef nonnull align 8 dereferenceable(8) @w)
  %57 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(32) @_Z1sB5cxx11)
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #8
  %58 = load i64, ptr @inf, align 8, !tbaa !8
  %59 = sub nsw i64 0, %58
  store i64 %59, ptr %2, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #8
  %60 = load i64, ptr @inf, align 8, !tbaa !8
  store i64 %60, ptr %3, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #8
  %61 = load i64, ptr @inf, align 8, !tbaa !8
  %62 = sub nsw i64 0, %61
  store i64 %62, ptr %4, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #8
  %63 = load i64, ptr @inf, align 8, !tbaa !8
  store i64 %63, ptr %5, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #8
  store i64 0, ptr %6, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #8
  store i64 0, ptr %7, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #8
  store i64 0, ptr %8, align 8, !tbaa !8
  %64 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapIxxSt4lessIxESaISt4pairIKxxEEEixEOx(ptr noundef nonnull align 8 dereferenceable(48) @lx, ptr noundef nonnull align 8 dereferenceable(8) %8)
  store i64 0, ptr %64, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #8
  store i64 0, ptr %9, align 8, !tbaa !8
  %65 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapIxxSt4lessIxESaISt4pairIKxxEEEixEOx(ptr noundef nonnull align 8 dereferenceable(48) @ly, ptr noundef nonnull align 8 dereferenceable(8) %9)
  store i64 0, ptr %65, align 8, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #8
  store i64 1, ptr %10, align 8, !tbaa !8
  br label %66

66:                                               ; preds = %135, %0
  %67 = load i64, ptr %10, align 8, !tbaa !8
  %68 = load i64, ptr @n, align 8, !tbaa !8
  %69 = icmp sle i64 %67, %68
  br i1 %69, label %71, label %70

70:                                               ; preds = %66
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #8
  br label %138

71:                                               ; preds = %66
  %72 = load i64, ptr %10, align 8, !tbaa !8
  %73 = sub nsw i64 %72, 1
  %74 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) @_Z1sB5cxx11, i64 noundef %73)
  %75 = load i8, ptr %74, align 1, !tbaa !11
  %76 = sext i8 %75 to i32
  %77 = icmp eq i32 %76, 85
  br i1 %77, label %78, label %81

78:                                               ; preds = %71
  %79 = load i64, ptr %6, align 8, !tbaa !8
  %80 = add nsw i64 %79, -1
  store i64 %80, ptr %6, align 8, !tbaa !8
  br label %114

81:                                               ; preds = %71
  %82 = load i64, ptr %10, align 8, !tbaa !8
  %83 = sub nsw i64 %82, 1
  %84 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) @_Z1sB5cxx11, i64 noundef %83)
  %85 = load i8, ptr %84, align 1, !tbaa !11
  %86 = sext i8 %85 to i32
  %87 = icmp eq i32 %86, 68
  br i1 %87, label %88, label %91

88:                                               ; preds = %81
  %89 = load i64, ptr %6, align 8, !tbaa !8
  %90 = add nsw i64 %89, 1
  store i64 %90, ptr %6, align 8, !tbaa !8
  br label %113

91:                                               ; preds = %81
  %92 = load i64, ptr %10, align 8, !tbaa !8
  %93 = sub nsw i64 %92, 1
  %94 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) @_Z1sB5cxx11, i64 noundef %93)
  %95 = load i8, ptr %94, align 1, !tbaa !11
  %96 = sext i8 %95 to i32
  %97 = icmp eq i32 %96, 76
  br i1 %97, label %98, label %101

98:                                               ; preds = %91
  %99 = load i64, ptr %7, align 8, !tbaa !8
  %100 = add nsw i64 %99, -1
  store i64 %100, ptr %7, align 8, !tbaa !8
  br label %112

101:                                              ; preds = %91
  %102 = load i64, ptr %10, align 8, !tbaa !8
  %103 = sub nsw i64 %102, 1
  %104 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) @_Z1sB5cxx11, i64 noundef %103)
  %105 = load i8, ptr %104, align 1, !tbaa !11
  %106 = sext i8 %105 to i32
  %107 = icmp eq i32 %106, 82
  br i1 %107, label %108, label %111

108:                                              ; preds = %101
  %109 = load i64, ptr %7, align 8, !tbaa !8
  %110 = add nsw i64 %109, 1
  store i64 %110, ptr %7, align 8, !tbaa !8
  br label %111

111:                                              ; preds = %108, %101
  br label %112

112:                                              ; preds = %111, %98
  br label %113

113:                                              ; preds = %112, %88
  br label %114

114:                                              ; preds = %113, %78
  %115 = call noundef i64 @_ZNKSt3mapIxxSt4lessIxESaISt4pairIKxxEEE5countERS3_(ptr noundef nonnull align 8 dereferenceable(48) @lx, ptr noundef nonnull align 8 dereferenceable(8) %6)
  %116 = icmp ne i64 %115, 0
  br i1 %116, label %120, label %117

117:                                              ; preds = %114
  %118 = load i64, ptr %10, align 8, !tbaa !8
  %119 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapIxxSt4lessIxESaISt4pairIKxxEEEixERS3_(ptr noundef nonnull align 8 dereferenceable(48) @lx, ptr noundef nonnull align 8 dereferenceable(8) %6)
  store i64 %118, ptr %119, align 8, !tbaa !8
  br label %120

120:                                              ; preds = %117, %114
  %121 = call noundef i64 @_ZNKSt3mapIxxSt4lessIxESaISt4pairIKxxEEE5countERS3_(ptr noundef nonnull align 8 dereferenceable(48) @ly, ptr noundef nonnull align 8 dereferenceable(8) %7)
  %122 = icmp ne i64 %121, 0
  br i1 %122, label %126, label %123

123:                                              ; preds = %120
  %124 = load i64, ptr %10, align 8, !tbaa !8
  %125 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapIxxSt4lessIxESaISt4pairIKxxEEEixERS3_(ptr noundef nonnull align 8 dereferenceable(48) @ly, ptr noundef nonnull align 8 dereferenceable(8) %7)
  store i64 %124, ptr %125, align 8, !tbaa !8
  br label %126

126:                                              ; preds = %123, %120
  %127 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %2, ptr noundef nonnull align 8 dereferenceable(8) %6)
  %128 = load i64, ptr %127, align 8, !tbaa !8
  store i64 %128, ptr %2, align 8, !tbaa !8
  %129 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %6)
  %130 = load i64, ptr %129, align 8, !tbaa !8
  store i64 %130, ptr %3, align 8, !tbaa !8
  %131 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(8) %7)
  %132 = load i64, ptr %131, align 8, !tbaa !8
  store i64 %132, ptr %4, align 8, !tbaa !8
  %133 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(8) %7)
  %134 = load i64, ptr %133, align 8, !tbaa !8
  store i64 %134, ptr %5, align 8, !tbaa !8
  br label %135

135:                                              ; preds = %126
  %136 = load i64, ptr %10, align 8, !tbaa !8
  %137 = add nsw i64 %136, 1
  store i64 %137, ptr %10, align 8, !tbaa !8
  br label %66, !llvm.loop !12

138:                                              ; preds = %70
  %139 = load i64, ptr %6, align 8, !tbaa !8
  %140 = icmp eq i64 %139, 0
  br i1 %140, label %141, label %164

141:                                              ; preds = %138
  %142 = load i64, ptr %7, align 8, !tbaa !8
  %143 = icmp eq i64 %142, 0
  br i1 %143, label %144, label %164

144:                                              ; preds = %141
  %145 = load i64, ptr %2, align 8, !tbaa !8
  %146 = load i64, ptr @h, align 8, !tbaa !8
  %147 = icmp slt i64 %145, %146
  br i1 %147, label %148, label %164

148:                                              ; preds = %144
  %149 = load i64, ptr %3, align 8, !tbaa !8
  %150 = load i64, ptr @h, align 8, !tbaa !8
  %151 = sub nsw i64 0, %150
  %152 = icmp sgt i64 %149, %151
  br i1 %152, label %153, label %164

153:                                              ; preds = %148
  %154 = load i64, ptr %4, align 8, !tbaa !8
  %155 = load i64, ptr @w, align 8, !tbaa !8
  %156 = icmp slt i64 %154, %155
  br i1 %156, label %157, label %164

157:                                              ; preds = %153
  %158 = load i64, ptr %5, align 8, !tbaa !8
  %159 = load i64, ptr @w, align 8, !tbaa !8
  %160 = sub nsw i64 0, %159
  %161 = icmp sgt i64 %158, %160
  br i1 %161, label %162, label %164

162:                                              ; preds = %157
  %163 = call i32 @puts(ptr noundef @.str)
  store i32 0, ptr %1, align 4
  store i32 1, ptr %11, align 4
  br label %612

164:                                              ; preds = %157, %153, %148, %144, %141, %138
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #8
  store i64 0, ptr %15, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #8
  store i32 1, ptr %16, align 4, !tbaa !14
  br label %165

165:                                              ; preds = %312, %164
  %166 = load i32, ptr %16, align 4, !tbaa !14
  %167 = sext i32 %166 to i64
  %168 = load i64, ptr @w, align 8, !tbaa !8
  %169 = icmp sle i64 %167, %168
  br i1 %169, label %171, label %170

170:                                              ; preds = %165
  store i32 5, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #8
  br label %315

171:                                              ; preds = %165
  %172 = load i64, ptr @inf, align 8, !tbaa !8
  store i64 %172, ptr %14, align 8, !tbaa !8
  %173 = load i64, ptr %4, align 8, !tbaa !8
  %174 = load i64, ptr @w, align 8, !tbaa !8
  %175 = load i32, ptr %16, align 4, !tbaa !14
  %176 = sext i32 %175 to i64
  %177 = sub nsw i64 %174, %176
  %178 = add nsw i64 %177, 1
  %179 = icmp sge i64 %173, %178
  br i1 %179, label %180, label %189

180:                                              ; preds = %171
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #8
  %181 = load i64, ptr @w, align 8, !tbaa !8
  %182 = load i32, ptr %16, align 4, !tbaa !14
  %183 = sext i32 %182 to i64
  %184 = sub nsw i64 %181, %183
  %185 = add nsw i64 %184, 1
  store i64 %185, ptr %17, align 8, !tbaa !8
  %186 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapIxxSt4lessIxESaISt4pairIKxxEEEixEOx(ptr noundef nonnull align 8 dereferenceable(48) @ly, ptr noundef nonnull align 8 dereferenceable(8) %17)
  %187 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %14, ptr noundef nonnull align 8 dereferenceable(8) %186)
  %188 = load i64, ptr %187, align 8, !tbaa !8
  store i64 %188, ptr %14, align 8, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #8
  br label %189

189:                                              ; preds = %180, %171
  %190 = load i64, ptr %5, align 8, !tbaa !8
  %191 = load i32, ptr %16, align 4, !tbaa !14
  %192 = sub nsw i32 0, %191
  %193 = sext i32 %192 to i64
  %194 = icmp sle i64 %190, %193
  br i1 %194, label %195, label %202

195:                                              ; preds = %189
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #8
  %196 = load i32, ptr %16, align 4, !tbaa !14
  %197 = sub nsw i32 0, %196
  %198 = sext i32 %197 to i64
  store i64 %198, ptr %18, align 8, !tbaa !8
  %199 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapIxxSt4lessIxESaISt4pairIKxxEEEixEOx(ptr noundef nonnull align 8 dereferenceable(48) @ly, ptr noundef nonnull align 8 dereferenceable(8) %18)
  %200 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %14, ptr noundef nonnull align 8 dereferenceable(8) %199)
  %201 = load i64, ptr %200, align 8, !tbaa !8
  store i64 %201, ptr %14, align 8, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #8
  br label %202

202:                                              ; preds = %195, %189
  %203 = load i64, ptr %14, align 8, !tbaa !8
  %204 = load i64, ptr @inf, align 8, !tbaa !8
  %205 = icmp eq i64 %203, %204
  br i1 %205, label %206, label %301

206:                                              ; preds = %202
  %207 = load i64, ptr %7, align 8, !tbaa !8
  %208 = icmp sgt i64 %207, 0
  br i1 %208, label %209, label %252

209:                                              ; preds = %206
  %210 = load i64, ptr %4, align 8, !tbaa !8
  %211 = icmp sgt i64 %210, 0
  br i1 %211, label %212, label %252

212:                                              ; preds = %209
  %213 = load i64, ptr @w, align 8, !tbaa !8
  %214 = load i32, ptr %16, align 4, !tbaa !14
  %215 = sext i32 %214 to i64
  %216 = sub nsw i64 %213, %215
  %217 = add nsw i64 %216, 1
  %218 = load i64, ptr %4, align 8, !tbaa !8
  %219 = sub nsw i64 %217, %218
  %220 = load i64, ptr %7, align 8, !tbaa !8
  %221 = add nsw i64 %219, %220
  %222 = sub nsw i64 %221, 1
  %223 = load i64, ptr %7, align 8, !tbaa !8
  %224 = sdiv i64 %222, %223
  store i64 %224, ptr %12, align 8, !tbaa !8
  %225 = load i64, ptr @w, align 8, !tbaa !8
  %226 = load i32, ptr %16, align 4, !tbaa !14
  %227 = sext i32 %226 to i64
  %228 = sub nsw i64 %225, %227
  %229 = add nsw i64 %228, 1
  %230 = load i64, ptr %12, align 8, !tbaa !8
  %231 = load i64, ptr %7, align 8, !tbaa !8
  %232 = mul nsw i64 %230, %231
  %233 = sub nsw i64 %229, %232
  store i64 %233, ptr %13, align 8, !tbaa !8
  %234 = load i64, ptr %13, align 8, !tbaa !8
  %235 = icmp sge i64 %234, 0
  br i1 %235, label %236, label %237

236:                                              ; preds = %212
  br label %239

237:                                              ; preds = %212
  call void @__assert_fail(ptr noundef @.str.5, ptr noundef @.str.6, i32 noundef 84, ptr noundef @__PRETTY_FUNCTION__.main) #9
  unreachable

238:                                              ; No predecessors!
  br label %239

239:                                              ; preds = %238, %236
  %240 = call noundef i64 @_ZNKSt3mapIxxSt4lessIxESaISt4pairIKxxEEE5countERS3_(ptr noundef nonnull align 8 dereferenceable(48) @ly, ptr noundef nonnull align 8 dereferenceable(8) %13)
  %241 = icmp ne i64 %240, 0
  br i1 %241, label %242, label %251

242:                                              ; preds = %239
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #8
  %243 = load i64, ptr @n, align 8, !tbaa !8
  %244 = load i64, ptr %12, align 8, !tbaa !8
  %245 = mul nsw i64 %243, %244
  %246 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapIxxSt4lessIxESaISt4pairIKxxEEEixERS3_(ptr noundef nonnull align 8 dereferenceable(48) @ly, ptr noundef nonnull align 8 dereferenceable(8) %13)
  %247 = load i64, ptr %246, align 8, !tbaa !8
  %248 = add nsw i64 %245, %247
  store i64 %248, ptr %19, align 8, !tbaa !8
  %249 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %14, ptr noundef nonnull align 8 dereferenceable(8) %19)
  %250 = load i64, ptr %249, align 8, !tbaa !8
  store i64 %250, ptr %14, align 8, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #8
  br label %251

251:                                              ; preds = %242, %239
  br label %300

252:                                              ; preds = %209, %206
  %253 = load i64, ptr %7, align 8, !tbaa !8
  %254 = icmp slt i64 %253, 0
  br i1 %254, label %255, label %299

255:                                              ; preds = %252
  %256 = load i64, ptr %5, align 8, !tbaa !8
  %257 = icmp slt i64 %256, 0
  br i1 %257, label %258, label %299

258:                                              ; preds = %255
  %259 = load i32, ptr %16, align 4, !tbaa !14
  %260 = sext i32 %259 to i64
  %261 = load i64, ptr %5, align 8, !tbaa !8
  %262 = add nsw i64 %260, %261
  %263 = load i64, ptr %7, align 8, !tbaa !8
  %264 = call noundef i64 @_ZSt3absx(i64 noundef %263)
  %265 = add nsw i64 %262, %264
  %266 = sub nsw i64 %265, 1
  %267 = sub nsw i64 0, %266
  %268 = load i64, ptr %7, align 8, !tbaa !8
  %269 = sdiv i64 %267, %268
  store i64 %269, ptr %12, align 8, !tbaa !8
  %270 = load i32, ptr %16, align 4, !tbaa !14
  %271 = sext i32 %270 to i64
  %272 = load i64, ptr %12, align 8, !tbaa !8
  %273 = load i64, ptr %7, align 8, !tbaa !8
  %274 = call noundef i64 @_ZSt3absx(i64 noundef %273)
  %275 = mul nsw i64 %272, %274
  %276 = sub nsw i64 %271, %275
  store i64 %276, ptr %13, align 8, !tbaa !8
  %277 = load i64, ptr %13, align 8, !tbaa !8
  %278 = icmp sge i64 %277, 0
  br i1 %278, label %279, label %280

279:                                              ; preds = %258
  br label %282

280:                                              ; preds = %258
  call void @__assert_fail(ptr noundef @.str.5, ptr noundef @.str.6, i32 noundef 92, ptr noundef @__PRETTY_FUNCTION__.main) #9
  unreachable

281:                                              ; No predecessors!
  br label %282

282:                                              ; preds = %281, %279
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #8
  %283 = load i64, ptr %13, align 8, !tbaa !8
  %284 = sub nsw i64 0, %283
  store i64 %284, ptr %20, align 8, !tbaa !8
  %285 = call noundef i64 @_ZNKSt3mapIxxSt4lessIxESaISt4pairIKxxEEE5countERS3_(ptr noundef nonnull align 8 dereferenceable(48) @ly, ptr noundef nonnull align 8 dereferenceable(8) %20)
  %286 = icmp ne i64 %285, 0
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #8
  br i1 %286, label %287, label %298

287:                                              ; preds = %282
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #8
  %288 = load i64, ptr @n, align 8, !tbaa !8
  %289 = load i64, ptr %12, align 8, !tbaa !8
  %290 = mul nsw i64 %288, %289
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #8
  %291 = load i64, ptr %13, align 8, !tbaa !8
  %292 = sub nsw i64 0, %291
  store i64 %292, ptr %22, align 8, !tbaa !8
  %293 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapIxxSt4lessIxESaISt4pairIKxxEEEixEOx(ptr noundef nonnull align 8 dereferenceable(48) @ly, ptr noundef nonnull align 8 dereferenceable(8) %22)
  %294 = load i64, ptr %293, align 8, !tbaa !8
  %295 = add nsw i64 %290, %294
  store i64 %295, ptr %21, align 8, !tbaa !8
  %296 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %14, ptr noundef nonnull align 8 dereferenceable(8) %21)
  %297 = load i64, ptr %296, align 8, !tbaa !8
  store i64 %297, ptr %14, align 8, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #8
  br label %298

298:                                              ; preds = %287, %282
  br label %299

299:                                              ; preds = %298, %255, %252
  br label %300

300:                                              ; preds = %299, %251
  br label %301

301:                                              ; preds = %300, %202
  %302 = load i64, ptr %14, align 8, !tbaa !8
  %303 = load i64, ptr @inf, align 8, !tbaa !8
  %304 = icmp eq i64 %302, %303
  br i1 %304, label %305, label %308

305:                                              ; preds = %301
  %306 = load i64, ptr %15, align 8, !tbaa !8
  %307 = add nsw i64 %306, 1
  store i64 %307, ptr %15, align 8, !tbaa !8
  br label %312

308:                                              ; preds = %301
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #8
  %309 = load i64, ptr %14, align 8, !tbaa !8
  %310 = load i64, ptr @MOD, align 8, !tbaa !8
  %311 = srem i64 %309, %310
  store i64 %311, ptr %23, align 8, !tbaa !8
  call void @_ZNSt6vectorIxSaIxEE9push_backEOx(ptr noundef nonnull align 8 dereferenceable(24) @m, ptr noundef nonnull align 8 dereferenceable(8) %23)
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #8
  br label %312

312:                                              ; preds = %308, %305
  %313 = load i32, ptr %16, align 4, !tbaa !14
  %314 = add nsw i32 %313, 1
  store i32 %314, ptr %16, align 4, !tbaa !14
  br label %165, !llvm.loop !16

315:                                              ; preds = %170
  %316 = call ptr @_ZNSt6vectorIxSaIxEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) @m) #8
  %317 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %24, i32 0, i32 0
  store ptr %316, ptr %317, align 8
  %318 = call ptr @_ZNSt6vectorIxSaIxEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) @m) #8
  %319 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %25, i32 0, i32 0
  store ptr %318, ptr %319, align 8
  %320 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %24, i32 0, i32 0
  %321 = load ptr, ptr %320, align 8
  %322 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %25, i32 0, i32 0
  %323 = load ptr, ptr %322, align 8
  call void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPxSt6vectorIxSaIxEEEEEvT_S7_(ptr %321, ptr %323)
  call void @llvm.lifetime.start.p0(i64 24, ptr %26) #8
  call void @_ZNSt6vectorIxSaIxEEC2ERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %26, ptr noundef nonnull align 8 dereferenceable(24) @m)
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #8
  store i32 1, ptr %27, align 4, !tbaa !14
  br label %324

324:                                              ; preds = %346, %315
  %325 = load i32, ptr %27, align 4, !tbaa !14
  %326 = sext i32 %325 to i64
  %327 = call noundef i64 @_ZNKSt6vectorIxSaIxEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %26) #8
  %328 = icmp ult i64 %326, %327
  br i1 %328, label %330, label %329

329:                                              ; preds = %324
  store i32 8, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #8
  br label %349

330:                                              ; preds = %324
  %331 = load i32, ptr %27, align 4, !tbaa !14
  %332 = sext i32 %331 to i64
  %333 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %26, i64 noundef %332) #8
  %334 = load i64, ptr %333, align 8, !tbaa !8
  %335 = load i32, ptr %27, align 4, !tbaa !14
  %336 = sub nsw i32 %335, 1
  %337 = sext i32 %336 to i64
  %338 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %26, i64 noundef %337) #8
  %339 = load i64, ptr %338, align 8, !tbaa !8
  %340 = add nsw i64 %334, %339
  %341 = load i64, ptr @MOD, align 8, !tbaa !8
  %342 = srem i64 %340, %341
  %343 = load i32, ptr %27, align 4, !tbaa !14
  %344 = sext i32 %343 to i64
  %345 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %26, i64 noundef %344) #8
  store i64 %342, ptr %345, align 8, !tbaa !8
  br label %346

346:                                              ; preds = %330
  %347 = load i32, ptr %27, align 4, !tbaa !14
  %348 = add nsw i32 %347, 1
  store i32 %348, ptr %27, align 4, !tbaa !14
  br label %324, !llvm.loop !17

349:                                              ; preds = %329
  call void @llvm.lifetime.start.p0(i64 8, ptr %28) #8
  store i64 0, ptr %28, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %29) #8
  store i32 1, ptr %29, align 4, !tbaa !14
  br label %350

350:                                              ; preds = %593, %349
  %351 = load i32, ptr %29, align 4, !tbaa !14
  %352 = sext i32 %351 to i64
  %353 = load i64, ptr @h, align 8, !tbaa !8
  %354 = icmp sle i64 %352, %353
  br i1 %354, label %356, label %355

355:                                              ; preds = %350
  store i32 11, ptr %11, align 4
  br label %597

356:                                              ; preds = %350
  %357 = load i64, ptr @inf, align 8, !tbaa !8
  store i64 %357, ptr %14, align 8, !tbaa !8
  %358 = load i64, ptr %2, align 8, !tbaa !8
  %359 = load i64, ptr @h, align 8, !tbaa !8
  %360 = load i32, ptr %29, align 4, !tbaa !14
  %361 = sext i32 %360 to i64
  %362 = sub nsw i64 %359, %361
  %363 = add nsw i64 %362, 1
  %364 = icmp sge i64 %358, %363
  br i1 %364, label %365, label %380

365:                                              ; preds = %356
  call void @llvm.lifetime.start.p0(i64 8, ptr %30) #8
  %366 = load i64, ptr @h, align 8, !tbaa !8
  %367 = load i32, ptr %29, align 4, !tbaa !14
  %368 = sext i32 %367 to i64
  %369 = sub nsw i64 %366, %368
  %370 = add nsw i64 %369, 1
  store i64 %370, ptr %30, align 8, !tbaa !8
  %371 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapIxxSt4lessIxESaISt4pairIKxxEEEixEOx(ptr noundef nonnull align 8 dereferenceable(48) @lx, ptr noundef nonnull align 8 dereferenceable(8) %30)
          to label %372 unwind label %376

372:                                              ; preds = %365
  %373 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %14, ptr noundef nonnull align 8 dereferenceable(8) %371)
          to label %374 unwind label %376

374:                                              ; preds = %372
  %375 = load i64, ptr %373, align 8, !tbaa !8
  store i64 %375, ptr %14, align 8, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 8, ptr %30) #8
  br label %380

376:                                              ; preds = %372, %365
  %377 = landingpad { ptr, i32 }
          cleanup
  %378 = extractvalue { ptr, i32 } %377, 0
  store ptr %378, ptr %31, align 8
  %379 = extractvalue { ptr, i32 } %377, 1
  store i32 %379, ptr %32, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %30) #8
  br label %599

380:                                              ; preds = %374, %356
  %381 = load i64, ptr %3, align 8, !tbaa !8
  %382 = load i32, ptr %29, align 4, !tbaa !14
  %383 = sub nsw i32 0, %382
  %384 = sext i32 %383 to i64
  %385 = icmp sle i64 %381, %384
  br i1 %385, label %386, label %399

386:                                              ; preds = %380
  call void @llvm.lifetime.start.p0(i64 8, ptr %33) #8
  %387 = load i32, ptr %29, align 4, !tbaa !14
  %388 = sub nsw i32 0, %387
  %389 = sext i32 %388 to i64
  store i64 %389, ptr %33, align 8, !tbaa !8
  %390 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapIxxSt4lessIxESaISt4pairIKxxEEEixEOx(ptr noundef nonnull align 8 dereferenceable(48) @lx, ptr noundef nonnull align 8 dereferenceable(8) %33)
          to label %391 unwind label %395

391:                                              ; preds = %386
  %392 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %14, ptr noundef nonnull align 8 dereferenceable(8) %390)
          to label %393 unwind label %395

393:                                              ; preds = %391
  %394 = load i64, ptr %392, align 8, !tbaa !8
  store i64 %394, ptr %14, align 8, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 8, ptr %33) #8
  br label %399

395:                                              ; preds = %391, %386
  %396 = landingpad { ptr, i32 }
          cleanup
  %397 = extractvalue { ptr, i32 } %396, 0
  store ptr %397, ptr %31, align 8
  %398 = extractvalue { ptr, i32 } %396, 1
  store i32 %398, ptr %32, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %33) #8
  br label %599

399:                                              ; preds = %393, %380
  %400 = load i64, ptr %14, align 8, !tbaa !8
  %401 = load i64, ptr @inf, align 8, !tbaa !8
  %402 = icmp eq i64 %400, %401
  br i1 %402, label %403, label %522

403:                                              ; preds = %399
  %404 = load i64, ptr %6, align 8, !tbaa !8
  %405 = icmp sgt i64 %404, 0
  br i1 %405, label %406, label %460

406:                                              ; preds = %403
  %407 = load i64, ptr %2, align 8, !tbaa !8
  %408 = icmp sgt i64 %407, 0
  br i1 %408, label %409, label %460

409:                                              ; preds = %406
  %410 = load i64, ptr @h, align 8, !tbaa !8
  %411 = load i32, ptr %29, align 4, !tbaa !14
  %412 = sext i32 %411 to i64
  %413 = sub nsw i64 %410, %412
  %414 = add nsw i64 %413, 1
  %415 = load i64, ptr %2, align 8, !tbaa !8
  %416 = sub nsw i64 %414, %415
  %417 = load i64, ptr %6, align 8, !tbaa !8
  %418 = add nsw i64 %416, %417
  %419 = sub nsw i64 %418, 1
  %420 = load i64, ptr %6, align 8, !tbaa !8
  %421 = sdiv i64 %419, %420
  store i64 %421, ptr %12, align 8, !tbaa !8
  %422 = load i64, ptr @h, align 8, !tbaa !8
  %423 = load i32, ptr %29, align 4, !tbaa !14
  %424 = sext i32 %423 to i64
  %425 = sub nsw i64 %422, %424
  %426 = add nsw i64 %425, 1
  %427 = load i64, ptr %12, align 8, !tbaa !8
  %428 = load i64, ptr %6, align 8, !tbaa !8
  %429 = mul nsw i64 %427, %428
  %430 = sub nsw i64 %426, %429
  store i64 %430, ptr %13, align 8, !tbaa !8
  %431 = load i64, ptr %13, align 8, !tbaa !8
  %432 = icmp sge i64 %431, 0
  br i1 %432, label %433, label %434

433:                                              ; preds = %409
  br label %436

434:                                              ; preds = %409
  call void @__assert_fail(ptr noundef @.str.5, ptr noundef @.str.6, i32 noundef 127, ptr noundef @__PRETTY_FUNCTION__.main) #9
  unreachable

435:                                              ; No predecessors!
  br label %436

436:                                              ; preds = %435, %433
  %437 = invoke noundef i64 @_ZNKSt3mapIxxSt4lessIxESaISt4pairIKxxEEE5countERS3_(ptr noundef nonnull align 8 dereferenceable(48) @lx, ptr noundef nonnull align 8 dereferenceable(8) %13)
          to label %438 unwind label %451

438:                                              ; preds = %436
  %439 = icmp ne i64 %437, 0
  br i1 %439, label %440, label %459

440:                                              ; preds = %438
  call void @llvm.lifetime.start.p0(i64 8, ptr %34) #8
  %441 = load i64, ptr @n, align 8, !tbaa !8
  %442 = load i64, ptr %12, align 8, !tbaa !8
  %443 = mul nsw i64 %441, %442
  %444 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapIxxSt4lessIxESaISt4pairIKxxEEEixERS3_(ptr noundef nonnull align 8 dereferenceable(48) @lx, ptr noundef nonnull align 8 dereferenceable(8) %13)
          to label %445 unwind label %455

445:                                              ; preds = %440
  %446 = load i64, ptr %444, align 8, !tbaa !8
  %447 = add nsw i64 %443, %446
  store i64 %447, ptr %34, align 8, !tbaa !8
  %448 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %14, ptr noundef nonnull align 8 dereferenceable(8) %34)
          to label %449 unwind label %455

449:                                              ; preds = %445
  %450 = load i64, ptr %448, align 8, !tbaa !8
  store i64 %450, ptr %14, align 8, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 8, ptr %34) #8
  br label %459

451:                                              ; preds = %473, %466, %436
  %452 = landingpad { ptr, i32 }
          cleanup
  %453 = extractvalue { ptr, i32 } %452, 0
  store ptr %453, ptr %31, align 8
  %454 = extractvalue { ptr, i32 } %452, 1
  store i32 %454, ptr %32, align 4
  br label %599

455:                                              ; preds = %445, %440
  %456 = landingpad { ptr, i32 }
          cleanup
  %457 = extractvalue { ptr, i32 } %456, 0
  store ptr %457, ptr %31, align 8
  %458 = extractvalue { ptr, i32 } %456, 1
  store i32 %458, ptr %32, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %34) #8
  br label %599

459:                                              ; preds = %449, %438
  br label %521

460:                                              ; preds = %406, %403
  %461 = load i64, ptr %6, align 8, !tbaa !8
  %462 = icmp slt i64 %461, 0
  br i1 %462, label %463, label %520

463:                                              ; preds = %460
  %464 = load i64, ptr %3, align 8, !tbaa !8
  %465 = icmp slt i64 %464, 0
  br i1 %465, label %466, label %520

466:                                              ; preds = %463
  %467 = load i32, ptr %29, align 4, !tbaa !14
  %468 = sext i32 %467 to i64
  %469 = load i64, ptr %3, align 8, !tbaa !8
  %470 = add nsw i64 %468, %469
  %471 = load i64, ptr %6, align 8, !tbaa !8
  %472 = invoke noundef i64 @_ZSt3absx(i64 noundef %471)
          to label %473 unwind label %451

473:                                              ; preds = %466
  %474 = add nsw i64 %470, %472
  %475 = sub nsw i64 %474, 1
  %476 = sub nsw i64 0, %475
  %477 = load i64, ptr %6, align 8, !tbaa !8
  %478 = sdiv i64 %476, %477
  store i64 %478, ptr %12, align 8, !tbaa !8
  %479 = load i32, ptr %29, align 4, !tbaa !14
  %480 = sext i32 %479 to i64
  %481 = load i64, ptr %12, align 8, !tbaa !8
  %482 = load i64, ptr %6, align 8, !tbaa !8
  %483 = invoke noundef i64 @_ZSt3absx(i64 noundef %482)
          to label %484 unwind label %451

484:                                              ; preds = %473
  %485 = mul nsw i64 %481, %483
  %486 = sub nsw i64 %480, %485
  store i64 %486, ptr %13, align 8, !tbaa !8
  %487 = load i64, ptr %13, align 8, !tbaa !8
  %488 = icmp sge i64 %487, 0
  br i1 %488, label %489, label %490

489:                                              ; preds = %484
  br label %492

490:                                              ; preds = %484
  call void @__assert_fail(ptr noundef @.str.5, ptr noundef @.str.6, i32 noundef 135, ptr noundef @__PRETTY_FUNCTION__.main) #9
  unreachable

491:                                              ; No predecessors!
  br label %492

492:                                              ; preds = %491, %489
  call void @llvm.lifetime.start.p0(i64 8, ptr %35) #8
  %493 = load i64, ptr %13, align 8, !tbaa !8
  %494 = sub nsw i64 0, %493
  store i64 %494, ptr %35, align 8, !tbaa !8
  %495 = invoke noundef i64 @_ZNKSt3mapIxxSt4lessIxESaISt4pairIKxxEEE5countERS3_(ptr noundef nonnull align 8 dereferenceable(48) @lx, ptr noundef nonnull align 8 dereferenceable(8) %35)
          to label %496 unwind label %511

496:                                              ; preds = %492
  %497 = icmp ne i64 %495, 0
  call void @llvm.lifetime.end.p0(i64 8, ptr %35) #8
  br i1 %497, label %498, label %519

498:                                              ; preds = %496
  call void @llvm.lifetime.start.p0(i64 8, ptr %36) #8
  %499 = load i64, ptr @n, align 8, !tbaa !8
  %500 = load i64, ptr %12, align 8, !tbaa !8
  %501 = mul nsw i64 %499, %500
  call void @llvm.lifetime.start.p0(i64 8, ptr %37) #8
  %502 = load i64, ptr %13, align 8, !tbaa !8
  %503 = sub nsw i64 0, %502
  store i64 %503, ptr %37, align 8, !tbaa !8
  %504 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapIxxSt4lessIxESaISt4pairIKxxEEEixEOx(ptr noundef nonnull align 8 dereferenceable(48) @lx, ptr noundef nonnull align 8 dereferenceable(8) %37)
          to label %505 unwind label %515

505:                                              ; preds = %498
  %506 = load i64, ptr %504, align 8, !tbaa !8
  %507 = add nsw i64 %501, %506
  store i64 %507, ptr %36, align 8, !tbaa !8
  %508 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %14, ptr noundef nonnull align 8 dereferenceable(8) %36)
          to label %509 unwind label %515

509:                                              ; preds = %505
  %510 = load i64, ptr %508, align 8, !tbaa !8
  store i64 %510, ptr %14, align 8, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 8, ptr %37) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %36) #8
  br label %519

511:                                              ; preds = %492
  %512 = landingpad { ptr, i32 }
          cleanup
  %513 = extractvalue { ptr, i32 } %512, 0
  store ptr %513, ptr %31, align 8
  %514 = extractvalue { ptr, i32 } %512, 1
  store i32 %514, ptr %32, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %35) #8
  br label %599

515:                                              ; preds = %505, %498
  %516 = landingpad { ptr, i32 }
          cleanup
  %517 = extractvalue { ptr, i32 } %516, 0
  store ptr %517, ptr %31, align 8
  %518 = extractvalue { ptr, i32 } %516, 1
  store i32 %518, ptr %32, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %37) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %36) #8
  br label %599

519:                                              ; preds = %509, %496
  br label %520

520:                                              ; preds = %519, %463, %460
  br label %521

521:                                              ; preds = %520, %459
  br label %522

522:                                              ; preds = %521, %399
  call void @llvm.lifetime.start.p0(i64 4, ptr %38) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %39) #8
  %523 = call ptr @_ZNSt6vectorIxSaIxEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) @m) #8
  %524 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %40, i32 0, i32 0
  store ptr %523, ptr %524, align 8
  %525 = call ptr @_ZNSt6vectorIxSaIxEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) @m) #8
  %526 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %41, i32 0, i32 0
  store ptr %525, ptr %526, align 8
  %527 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %40, i32 0, i32 0
  %528 = load ptr, ptr %527, align 8
  %529 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %41, i32 0, i32 0
  %530 = load ptr, ptr %529, align 8
  %531 = invoke ptr @_ZSt11upper_boundIN9__gnu_cxx17__normal_iteratorIPxSt6vectorIxSaIxEEEExET_S7_S7_RKT0_(ptr %528, ptr %530, ptr noundef nonnull align 8 dereferenceable(8) %14)
          to label %532 unwind label %551

532:                                              ; preds = %522
  %533 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %39, i32 0, i32 0
  store ptr %531, ptr %533, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %42) #8
  %534 = call ptr @_ZNSt6vectorIxSaIxEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) @m) #8
  %535 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %42, i32 0, i32 0
  store ptr %534, ptr %535, align 8
  %536 = call noundef i64 @_ZN9__gnu_cxxmiIPxSt6vectorIxSaIxEEEENS_17__normal_iteratorIT_T0_E15difference_typeERKS8_SB_(ptr noundef nonnull align 8 dereferenceable(8) %39, ptr noundef nonnull align 8 dereferenceable(8) %42) #8
  %537 = trunc i64 %536 to i32
  call void @llvm.lifetime.end.p0(i64 8, ptr %42) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %39) #8
  store i32 %537, ptr %38, align 4, !tbaa !14
  %538 = load i32, ptr %38, align 4, !tbaa !14
  %539 = icmp sgt i32 %538, 0
  br i1 %539, label %540, label %555

540:                                              ; preds = %532
  %541 = load i32, ptr %38, align 4, !tbaa !14
  %542 = sub nsw i32 %541, 1
  %543 = sext i32 %542 to i64
  %544 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %26, i64 noundef %543) #8
  %545 = load i64, ptr %544, align 8, !tbaa !8
  %546 = load i64, ptr %28, align 8, !tbaa !8
  %547 = add nsw i64 %546, %545
  store i64 %547, ptr %28, align 8, !tbaa !8
  %548 = load i64, ptr @MOD, align 8, !tbaa !8
  %549 = load i64, ptr %28, align 8, !tbaa !8
  %550 = srem i64 %549, %548
  store i64 %550, ptr %28, align 8, !tbaa !8
  br label %555

551:                                              ; preds = %522
  %552 = landingpad { ptr, i32 }
          cleanup
  %553 = extractvalue { ptr, i32 } %552, 0
  store ptr %553, ptr %31, align 8
  %554 = extractvalue { ptr, i32 } %552, 1
  store i32 %554, ptr %32, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %39) #8
  br label %596

555:                                              ; preds = %540, %532
  %556 = load i64, ptr %14, align 8, !tbaa !8
  %557 = load i64, ptr @inf, align 8, !tbaa !8
  %558 = icmp ne i64 %556, %557
  br i1 %558, label %559, label %575

559:                                              ; preds = %555
  %560 = load i64, ptr %15, align 8, !tbaa !8
  %561 = call noundef i64 @_ZNKSt6vectorIxSaIxEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %26) #8
  %562 = add nsw i64 %560, %561
  %563 = load i32, ptr %38, align 4, !tbaa !14
  %564 = sext i32 %563 to i64
  %565 = sub nsw i64 %562, %564
  %566 = load i64, ptr %14, align 8, !tbaa !8
  %567 = mul nsw i64 %565, %566
  %568 = load i64, ptr @MOD, align 8, !tbaa !8
  %569 = srem i64 %567, %568
  %570 = load i64, ptr %28, align 8, !tbaa !8
  %571 = add nsw i64 %570, %569
  store i64 %571, ptr %28, align 8, !tbaa !8
  %572 = load i64, ptr @MOD, align 8, !tbaa !8
  %573 = load i64, ptr %28, align 8, !tbaa !8
  %574 = srem i64 %573, %572
  store i64 %574, ptr %28, align 8, !tbaa !8
  br label %575

575:                                              ; preds = %559, %555
  %576 = load i64, ptr %14, align 8, !tbaa !8
  %577 = load i64, ptr @inf, align 8, !tbaa !8
  %578 = icmp eq i64 %576, %577
  br i1 %578, label %579, label %589

579:                                              ; preds = %575
  %580 = load i64, ptr %15, align 8, !tbaa !8
  %581 = icmp sgt i64 %580, 0
  br i1 %581, label %582, label %589

582:                                              ; preds = %579
  %583 = invoke i32 @puts(ptr noundef @.str)
          to label %584 unwind label %585

584:                                              ; preds = %582
  store i32 0, ptr %1, align 4
  store i32 1, ptr %11, align 4
  br label %590

585:                                              ; preds = %582
  %586 = landingpad { ptr, i32 }
          cleanup
  %587 = extractvalue { ptr, i32 } %586, 0
  store ptr %587, ptr %31, align 8
  %588 = extractvalue { ptr, i32 } %586, 1
  store i32 %588, ptr %32, align 4
  br label %596

589:                                              ; preds = %579, %575
  store i32 0, ptr %11, align 4
  br label %590

590:                                              ; preds = %589, %584
  call void @llvm.lifetime.end.p0(i64 4, ptr %38) #8
  %591 = load i32, ptr %11, align 4
  switch i32 %591, label %597 [
    i32 0, label %592
  ]

592:                                              ; preds = %590
  br label %593

593:                                              ; preds = %592
  %594 = load i32, ptr %29, align 4, !tbaa !14
  %595 = add nsw i32 %594, 1
  store i32 %595, ptr %29, align 4, !tbaa !14
  br label %350, !llvm.loop !18

596:                                              ; preds = %585, %551
  call void @llvm.lifetime.end.p0(i64 4, ptr %38) #8
  br label %599

597:                                              ; preds = %590, %355
  call void @llvm.lifetime.end.p0(i64 4, ptr %29) #8
  %598 = load i32, ptr %11, align 4
  switch i32 %598, label %610 [
    i32 11, label %600
  ]

599:                                              ; preds = %596, %515, %511, %455, %451, %395, %376
  call void @llvm.lifetime.end.p0(i64 4, ptr %29) #8
  br label %611

600:                                              ; preds = %597
  %601 = load i64, ptr %28, align 8, !tbaa !8
  %602 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %601)
          to label %603 unwind label %606

603:                                              ; preds = %600
  %604 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %602, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %605 unwind label %606

605:                                              ; preds = %603
  store i32 0, ptr %1, align 4
  store i32 1, ptr %11, align 4
  br label %610

606:                                              ; preds = %603, %600
  %607 = landingpad { ptr, i32 }
          cleanup
  %608 = extractvalue { ptr, i32 } %607, 0
  store ptr %608, ptr %31, align 8
  %609 = extractvalue { ptr, i32 } %607, 1
  store i32 %609, ptr %32, align 4
  br label %611

610:                                              ; preds = %605, %597
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #8
  call void @_ZNSt6vectorIxSaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %26) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr %26) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #8
  br label %612

611:                                              ; preds = %606, %599
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #8
  call void @_ZNSt6vectorIxSaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %26) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr %26) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #8
  br label %614

612:                                              ; preds = %610, %162
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #8
  %613 = load i32, ptr %1, align 4
  ret i32 %613

614:                                              ; preds = %611
  %615 = load ptr, ptr %31, align 8
  %616 = load i32, ptr %32, align 4
  %617 = insertvalue { ptr, i32 } poison, ptr %615, 0
  %618 = insertvalue { ptr, i32 } %617, i32 %616, 1
  resume { ptr, i32 } %618
}

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

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapIxxSt4lessIxESaISt4pairIKxxEEEixEOx(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 8 dereferenceable(8)) #3 align 2

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapIxxSt4lessIxESaISt4pairIKxxEEEixERS3_(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 8 dereferenceable(8)) #3 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #5

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #5

declare i32 @puts(ptr noundef) #2

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #6

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZSt3absx(i64 noundef) #5

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPxSt6vectorIxSaIxEEEEEvT_S7_(ptr, ptr) #7

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

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

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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZN9__gnu_cxxmiIPxSt6vectorIxSaIxEEEENS_17__normal_iteratorIT_T0_E15difference_typeERKS8_SB_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #5

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

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

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 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 #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress 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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { 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 #6 = { noreturn nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { 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 #8 = { nounwind }
attributes #9 = { noreturn nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"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 = !{!10, !10, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = !{!15, !15, i64 0}
!15 = !{!"int", !10, i64 0}
!16 = distinct !{!16, !13}
!17 = distinct !{!17, !13}
!18 = distinct !{!18, !13}


; 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::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"class.std::map" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<long long, std::pair<const long long, long long>, std::_Select1st<std::pair<const long long, long long>>, std::less<long long>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<long long, std::pair<const long long, long long>, std::_Select1st<std::pair<const long long, long long>>, std::less<long long>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::_Rb_tree_header" = type { %"struct.std::_Rb_tree_node_base", i64 }
%"struct.std::_Rb_tree_node_base" = type { i32, ptr, ptr, ptr }
%"class.std::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 }

@n = external dso_local global i64, align 8
@h = external dso_local global i64, align 8
@w = external dso_local global i64, align 8
@inf = external dso_local local_unnamed_addr global i64, align 8
@_Z1sB5cxx11 = external dso_local global %"class.std::__cxx11::basic_string", align 8
@lx = external dso_local global %"class.std::map", align 8
@ly = external dso_local global %"class.std::map", align 8
@MOD = external dso_local local_unnamed_addr global i64, align 8
@m = external dso_local global %"class.std::vector", align 8
@_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.5 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [110 x i8], align 1
@__PRETTY_FUNCTION__.main = external hidden unnamed_addr constant [11 x i8], align 1

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #1 personality ptr @__gxx_personality_v0 {
  %1 = alloca i64, align 8
  %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 i64, align 8
  %8 = alloca i64, align 8
  %9 = alloca i64, align 8
  %10 = alloca i64, align 8
  %11 = alloca i64, align 8
  %12 = alloca i64, align 8
  %13 = alloca i64, align 8
  %14 = alloca i64, align 8
  %15 = alloca i64, align 8
  %16 = alloca i64, align 8
  %17 = alloca i64, align 8
  %18 = alloca %"class.std::vector", align 8
  %19 = alloca i64, align 8
  %20 = alloca i64, align 8
  %21 = alloca i64, align 8
  %22 = alloca i64, align 8
  %23 = alloca i64, align 8
  %24 = alloca i64, align 8
  %25 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %26 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %27 = tail call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %28 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %29 = getelementptr i8, ptr %28, i64 -24
  %30 = load i64, ptr %29, align 8
  %31 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %30
  %32 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %31, ptr noundef null)
  %33 = load ptr, ptr @_ZSt4cout, align 8, !tbaa !5
  %34 = getelementptr i8, ptr %33, i64 -24
  %35 = load i64, ptr %34, align 8
  %36 = getelementptr inbounds i8, ptr @_ZSt4cout, i64 %35
  %37 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %36, ptr noundef null)
  %38 = 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)
  %39 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %38, ptr noundef nonnull align 8 dereferenceable(8) @h)
  %40 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %39, ptr noundef nonnull align 8 dereferenceable(8) @w)
  %41 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(32) @_Z1sB5cxx11)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #9
  %42 = load i64, ptr @inf, align 8, !tbaa !8
  %43 = sub nsw i64 0, %42
  store i64 %43, ptr %1, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #9
  store i64 %42, ptr %2, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #9
  store i64 %43, ptr %3, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #9
  store i64 %42, ptr %4, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #9
  store i64 0, ptr %5, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #9
  store i64 0, ptr %6, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #9
  store i64 0, ptr %7, align 8, !tbaa !8
  %44 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapIxxSt4lessIxESaISt4pairIKxxEEEixEOx(ptr noundef nonnull align 8 dereferenceable(48) @lx, ptr noundef nonnull align 8 dereferenceable(8) %7)
  store i64 0, ptr %44, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #9
  store i64 0, ptr %8, align 8, !tbaa !8
  %45 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapIxxSt4lessIxESaISt4pairIKxxEEEixEOx(ptr noundef nonnull align 8 dereferenceable(48) @ly, ptr noundef nonnull align 8 dereferenceable(8) %8)
  store i64 0, ptr %45, align 8, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #9
  %46 = load i64, ptr @n, align 8, !tbaa !8
  %.not147 = icmp slt i64 %46, 1
  br i1 %.not147, label %._crit_edge, label %.lr.ph

._crit_edge.loopexit:                             ; preds = %88
  %.pre = load i64, ptr %5, align 8, !tbaa !8
  %.pre172 = load i64, ptr %6, align 8
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %0
  %47 = phi i64 [ %96, %._crit_edge.loopexit ], [ %42, %0 ]
  %48 = phi i64 [ %.pre172, %._crit_edge.loopexit ], [ 0, %0 ]
  %49 = phi i64 [ %.pre, %._crit_edge.loopexit ], [ 0, %0 ]
  %50 = icmp eq i64 %49, 0
  %51 = icmp eq i64 %48, 0
  %or.cond = select i1 %50, i1 %51, i1 false
  br i1 %or.cond, label %99, label %thread-pre-split

.lr.ph:                                           ; preds = %0, %88
  %.071148 = phi i64 [ %97, %88 ], [ 1, %0 ]
  %52 = add nsw i64 %.071148, -1
  %53 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) @_Z1sB5cxx11, i64 noundef %52)
  %54 = load i8, ptr %53, align 1, !tbaa !11
  %55 = icmp eq i8 %54, 85
  br i1 %55, label %56, label %59

56:                                               ; preds = %.lr.ph
  %57 = load i64, ptr %5, align 8, !tbaa !8
  %58 = add nsw i64 %57, -1
  store i64 %58, ptr %5, align 8, !tbaa !8
  br label %80

59:                                               ; preds = %.lr.ph
  %60 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) @_Z1sB5cxx11, i64 noundef %52)
  %61 = load i8, ptr %60, align 1, !tbaa !11
  %62 = icmp eq i8 %61, 68
  br i1 %62, label %63, label %66

63:                                               ; preds = %59
  %64 = load i64, ptr %5, align 8, !tbaa !8
  %65 = add nsw i64 %64, 1
  store i64 %65, ptr %5, align 8, !tbaa !8
  br label %80

66:                                               ; preds = %59
  %67 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) @_Z1sB5cxx11, i64 noundef %52)
  %68 = load i8, ptr %67, align 1, !tbaa !11
  %69 = icmp eq i8 %68, 76
  br i1 %69, label %70, label %73

70:                                               ; preds = %66
  %71 = load i64, ptr %6, align 8, !tbaa !8
  %72 = add nsw i64 %71, -1
  store i64 %72, ptr %6, align 8, !tbaa !8
  br label %80

73:                                               ; preds = %66
  %74 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) @_Z1sB5cxx11, i64 noundef %52)
  %75 = load i8, ptr %74, align 1, !tbaa !11
  %76 = icmp eq i8 %75, 82
  br i1 %76, label %77, label %80

77:                                               ; preds = %73
  %78 = load i64, ptr %6, align 8, !tbaa !8
  %79 = add nsw i64 %78, 1
  store i64 %79, ptr %6, align 8, !tbaa !8
  br label %80

80:                                               ; preds = %63, %73, %77, %70, %56
  %81 = call noundef i64 @_ZNKSt3mapIxxSt4lessIxESaISt4pairIKxxEEE5countERS3_(ptr noundef nonnull align 8 dereferenceable(48) @lx, ptr noundef nonnull align 8 dereferenceable(8) %5)
  %.not119 = icmp eq i64 %81, 0
  br i1 %.not119, label %82, label %84

82:                                               ; preds = %80
  %83 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapIxxSt4lessIxESaISt4pairIKxxEEEixERS3_(ptr noundef nonnull align 8 dereferenceable(48) @lx, ptr noundef nonnull align 8 dereferenceable(8) %5)
  store i64 %.071148, ptr %83, align 8, !tbaa !8
  br label %84

84:                                               ; preds = %82, %80
  %85 = call noundef i64 @_ZNKSt3mapIxxSt4lessIxESaISt4pairIKxxEEE5countERS3_(ptr noundef nonnull align 8 dereferenceable(48) @ly, ptr noundef nonnull align 8 dereferenceable(8) %6)
  %.not120 = icmp eq i64 %85, 0
  br i1 %.not120, label %86, label %88

86:                                               ; preds = %84
  %87 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapIxxSt4lessIxESaISt4pairIKxxEEEixERS3_(ptr noundef nonnull align 8 dereferenceable(48) @ly, ptr noundef nonnull align 8 dereferenceable(8) %6)
  store i64 %.071148, ptr %87, align 8, !tbaa !8
  br label %88

88:                                               ; preds = %86, %84
  %89 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef nonnull align 8 dereferenceable(8) %5)
  %90 = load i64, ptr %89, align 8, !tbaa !8
  store i64 %90, ptr %1, align 8, !tbaa !8
  %91 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %2, ptr noundef nonnull align 8 dereferenceable(8) %5)
  %92 = load i64, ptr %91, align 8, !tbaa !8
  store i64 %92, ptr %2, align 8, !tbaa !8
  %93 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %6)
  %94 = load i64, ptr %93, align 8, !tbaa !8
  store i64 %94, ptr %3, align 8, !tbaa !8
  %95 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(8) %6)
  %96 = load i64, ptr %95, align 8, !tbaa !8
  store i64 %96, ptr %4, align 8, !tbaa !8
  %97 = add nuw nsw i64 %.071148, 1
  %98 = load i64, ptr @n, align 8, !tbaa !8
  %.not.not = icmp slt i64 %.071148, %98
  br i1 %.not.not, label %.lr.ph, label %._crit_edge.loopexit, !llvm.loop !12

99:                                               ; preds = %._crit_edge
  %100 = load i64, ptr %1, align 8, !tbaa !8
  %101 = load i64, ptr @h, align 8, !tbaa !8
  %102 = icmp slt i64 %100, %101
  br i1 %102, label %103, label %thread-pre-split

103:                                              ; preds = %99
  %104 = load i64, ptr %2, align 8, !tbaa !8
  %105 = sub nsw i64 0, %101
  %106 = icmp sgt i64 %104, %105
  br i1 %106, label %107, label %thread-pre-split

107:                                              ; preds = %103
  %108 = load i64, ptr %3, align 8, !tbaa !8
  %109 = load i64, ptr @w, align 8, !tbaa !8
  %110 = icmp slt i64 %108, %109
  %111 = sub nsw i64 0, %109
  %112 = icmp sgt i64 %47, %111
  %or.cond179 = select i1 %110, i1 %112, i1 false
  br i1 %or.cond179, label %113, label %115

113:                                              ; preds = %107
  %114 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str)
  br label %366

thread-pre-split:                                 ; preds = %._crit_edge, %99, %103
  %.pr = load i64, ptr @w, align 8, !tbaa !8
  br label %115

115:                                              ; preds = %thread-pre-split, %107
  %116 = phi i64 [ %.pr, %thread-pre-split ], [ %109, %107 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #9
  %.not103149 = icmp slt i64 %116, 1
  br i1 %.not103149, label %._crit_edge154, label %.lr.ph153.preheader

.lr.ph153.preheader:                              ; preds = %115
  %.pre174 = load i64, ptr @inf, align 8, !tbaa !8
  br label %.lr.ph153

._crit_edge154:                                   ; preds = %207, %115
  %.084.lcssa = phi i64 [ 0, %115 ], [ %.185, %207 ]
  %117 = call ptr @_ZNSt6vectorIxSaIxEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) @m) #9
  %118 = call ptr @_ZNSt6vectorIxSaIxEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) @m) #9
  call void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPxSt6vectorIxSaIxEEEEEvT_S7_(ptr %117, ptr %118)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %18) #9
  call void @_ZNSt6vectorIxSaIxEEC2ERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %18, ptr noundef nonnull align 8 dereferenceable(24) @m)
  %119 = call noundef i64 @_ZNKSt6vectorIxSaIxEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %18) #9
  %120 = icmp ugt i64 %119, 1
  br i1 %120, label %.lr.ph157, label %.preheader

.lr.ph153:                                        ; preds = %.lr.ph153.preheader, %207
  %121 = phi i64 [ %.pre174, %.lr.ph153.preheader ], [ %208, %207 ]
  %indvars.iv = phi i64 [ 1, %.lr.ph153.preheader ], [ %indvars.iv.next, %207 ]
  %122 = phi i64 [ %116, %.lr.ph153.preheader ], [ %209, %207 ]
  %.084151 = phi i64 [ 0, %.lr.ph153.preheader ], [ %.185, %207 ]
  store i64 %121, ptr %10, align 8, !tbaa !8
  %123 = load i64, ptr %3, align 8, !tbaa !8
  %124 = sub nsw i64 %122, %indvars.iv
  %.not115.not = icmp sgt i64 %123, %124
  br i1 %.not115.not, label %125, label %130

125:                                              ; preds = %.lr.ph153
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %11) #9
  %126 = add nsw i64 %124, 1
  store i64 %126, ptr %11, align 8, !tbaa !8
  %127 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapIxxSt4lessIxESaISt4pairIKxxEEEixEOx(ptr noundef nonnull align 8 dereferenceable(48) @ly, ptr noundef nonnull align 8 dereferenceable(8) %11)
  %128 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %10, ptr noundef nonnull align 8 dereferenceable(8) %127)
  %129 = load i64, ptr %128, align 8, !tbaa !8
  store i64 %129, ptr %10, align 8, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #9
  br label %130

130:                                              ; preds = %125, %.lr.ph153
  %131 = phi i64 [ %129, %125 ], [ %121, %.lr.ph153 ]
  %132 = load i64, ptr %4, align 8, !tbaa !8
  %133 = sub nsw i64 0, %indvars.iv
  %.not116 = icmp sgt i64 %132, %133
  br i1 %.not116, label %138, label %134

134:                                              ; preds = %130
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %12) #9
  store i64 %133, ptr %12, align 8, !tbaa !8
  %135 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapIxxSt4lessIxESaISt4pairIKxxEEEixEOx(ptr noundef nonnull align 8 dereferenceable(48) @ly, ptr noundef nonnull align 8 dereferenceable(8) %12)
  %136 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %10, ptr noundef nonnull align 8 dereferenceable(8) %135)
  %137 = load i64, ptr %136, align 8, !tbaa !8
  store i64 %137, ptr %10, align 8, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #9
  br label %138

138:                                              ; preds = %134, %130
  %139 = phi i64 [ %137, %134 ], [ %131, %130 ]
  %140 = load i64, ptr @inf, align 8, !tbaa !8
  %141 = icmp eq i64 %139, %140
  br i1 %141, label %142, label %198

142:                                              ; preds = %138
  %143 = load i64, ptr %6, align 8, !tbaa !8
  %144 = icmp sgt i64 %143, 0
  %145 = load i64, ptr %3, align 8
  %146 = icmp sgt i64 %145, 0
  %or.cond4 = select i1 %144, i1 %146, i1 false
  br i1 %or.cond4, label %147, label %169

147:                                              ; preds = %142
  %148 = load i64, ptr @w, align 8, !tbaa !8
  %149 = sub nsw i64 %148, %indvars.iv
  %150 = add nsw i64 %149, 1
  %151 = xor i64 %145, -1
  %152 = add nsw i64 %143, %151
  %153 = add i64 %152, %150
  %154 = sdiv i64 %153, %143
  %155 = mul nsw i64 %154, %143
  %156 = sub nsw i64 %150, %155
  store i64 %156, ptr %9, align 8, !tbaa !8
  %157 = icmp sgt i64 %156, -1
  br i1 %157, label %159, label %158

158:                                              ; preds = %147
  call void @__assert_fail(ptr noundef nonnull @.str.5, ptr noundef nonnull @.str.6, i32 noundef 84, ptr noundef nonnull @__PRETTY_FUNCTION__.main) #10
  unreachable

159:                                              ; preds = %147
  %160 = call noundef i64 @_ZNKSt3mapIxxSt4lessIxESaISt4pairIKxxEEE5countERS3_(ptr noundef nonnull align 8 dereferenceable(48) @ly, ptr noundef nonnull align 8 dereferenceable(8) %9)
  %.not118 = icmp eq i64 %160, 0
  br i1 %.not118, label %198, label %161

161:                                              ; preds = %159
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %13) #9
  %162 = load i64, ptr @n, align 8, !tbaa !8
  %163 = mul nsw i64 %162, %154
  %164 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapIxxSt4lessIxESaISt4pairIKxxEEEixERS3_(ptr noundef nonnull align 8 dereferenceable(48) @ly, ptr noundef nonnull align 8 dereferenceable(8) %9)
  %165 = load i64, ptr %164, align 8, !tbaa !8
  %166 = add nsw i64 %165, %163
  store i64 %166, ptr %13, align 8, !tbaa !8
  %167 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %10, ptr noundef nonnull align 8 dereferenceable(8) %13)
  %168 = load i64, ptr %167, align 8, !tbaa !8
  store i64 %168, ptr %10, align 8, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %13) #9
  br label %198

169:                                              ; preds = %142
  %170 = icmp slt i64 %143, 0
  %171 = load i64, ptr %4, align 8
  %172 = icmp slt i64 %171, 0
  %or.cond6 = select i1 %170, i1 %172, i1 false
  br i1 %or.cond6, label %173, label %198

173:                                              ; preds = %169
  %174 = call noundef i64 @_ZSt3absx(i64 noundef %143)
  %175 = add nsw i64 %indvars.iv, %171
  %176 = add i64 %175, %174
  %177 = sub i64 1, %176
  %178 = load i64, ptr %6, align 8, !tbaa !8
  %179 = sdiv i64 %177, %178
  %180 = call noundef i64 @_ZSt3absx(i64 noundef %178)
  %181 = mul nsw i64 %180, %179
  %182 = sub nsw i64 %indvars.iv, %181
  store i64 %182, ptr %9, align 8, !tbaa !8
  %183 = icmp sgt i64 %182, -1
  br i1 %183, label %185, label %184

184:                                              ; preds = %173
  call void @__assert_fail(ptr noundef nonnull @.str.5, ptr noundef nonnull @.str.6, i32 noundef 92, ptr noundef nonnull @__PRETTY_FUNCTION__.main) #10
  unreachable

185:                                              ; preds = %173
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %14) #9
  %186 = sub nsw i64 0, %182
  store i64 %186, ptr %14, align 8, !tbaa !8
  %187 = call noundef i64 @_ZNKSt3mapIxxSt4lessIxESaISt4pairIKxxEEE5countERS3_(ptr noundef nonnull align 8 dereferenceable(48) @ly, ptr noundef nonnull align 8 dereferenceable(8) %14)
  %.not117 = icmp eq i64 %187, 0
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %14) #9
  br i1 %.not117, label %198, label %188

188:                                              ; preds = %185
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %15) #9
  %189 = load i64, ptr @n, align 8, !tbaa !8
  %190 = mul nsw i64 %189, %179
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %16) #9
  %191 = load i64, ptr %9, align 8, !tbaa !8
  %192 = sub nsw i64 0, %191
  store i64 %192, ptr %16, align 8, !tbaa !8
  %193 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapIxxSt4lessIxESaISt4pairIKxxEEEixEOx(ptr noundef nonnull align 8 dereferenceable(48) @ly, ptr noundef nonnull align 8 dereferenceable(8) %16)
  %194 = load i64, ptr %193, align 8, !tbaa !8
  %195 = add nsw i64 %194, %190
  store i64 %195, ptr %15, align 8, !tbaa !8
  %196 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %10, ptr noundef nonnull align 8 dereferenceable(8) %15)
  %197 = load i64, ptr %196, align 8, !tbaa !8
  store i64 %197, ptr %10, align 8, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %16) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %15) #9
  br label %198

198:                                              ; preds = %161, %159, %185, %188, %169, %138
  %199 = load i64, ptr %10, align 8, !tbaa !8
  %200 = load i64, ptr @inf, align 8, !tbaa !8
  %201 = icmp eq i64 %199, %200
  br i1 %201, label %202, label %204

202:                                              ; preds = %198
  %203 = add nsw i64 %.084151, 1
  br label %207

204:                                              ; preds = %198
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %17) #9
  %205 = load i64, ptr @MOD, align 8, !tbaa !8
  %206 = srem i64 %199, %205
  store i64 %206, ptr %17, align 8, !tbaa !8
  call void @_ZNSt6vectorIxSaIxEE9push_backEOx(ptr noundef nonnull align 8 dereferenceable(24) @m, ptr noundef nonnull align 8 dereferenceable(8) %17)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %17) #9
  %.pre173 = load i64, ptr @inf, align 8, !tbaa !8
  br label %207

207:                                              ; preds = %204, %202
  %208 = phi i64 [ %199, %202 ], [ %.pre173, %204 ]
  %.185 = phi i64 [ %203, %202 ], [ %.084151, %204 ]
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %209 = load i64, ptr @w, align 8, !tbaa !8
  %.not103.not = icmp sgt i64 %209, %indvars.iv
  br i1 %.not103.not, label %.lr.ph153, label %._crit_edge154, !llvm.loop !14

.preheader:                                       ; preds = %.lr.ph157, %._crit_edge154
  %210 = load i64, ptr @h, align 8, !tbaa !8
  %.not104158 = icmp slt i64 %210, 1
  br i1 %.not104158, label %._crit_edge162, label %.lr.ph161

.lr.ph161:                                        ; preds = %.preheader
  %211 = icmp slt i64 %.084.lcssa, 1
  %.pre175 = load i64, ptr @inf, align 8, !tbaa !8
  br label %225

.lr.ph157:                                        ; preds = %._crit_edge154, %.lr.ph157
  %indvars.iv166 = phi i64 [ %indvars.iv.next167, %.lr.ph157 ], [ 1, %._crit_edge154 ]
  %212 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %18, i64 noundef %indvars.iv166) #9
  %213 = load i64, ptr %212, align 8, !tbaa !8
  %214 = add nsw i64 %indvars.iv166, -1
  %215 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %18, i64 noundef %214) #9
  %216 = load i64, ptr %215, align 8, !tbaa !8
  %217 = add nsw i64 %216, %213
  %218 = load i64, ptr @MOD, align 8, !tbaa !8
  %219 = srem i64 %217, %218
  %220 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %18, i64 noundef %indvars.iv166) #9
  store i64 %219, ptr %220, align 8, !tbaa !8
  %indvars.iv.next167 = add nuw nsw i64 %indvars.iv166, 1
  %221 = call noundef i64 @_ZNKSt6vectorIxSaIxEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %18) #9
  %222 = icmp ugt i64 %221, %indvars.iv.next167
  br i1 %222, label %.lr.ph157, label %.preheader, !llvm.loop !15

223:                                              ; preds = %.critedge
  %indvars.iv.next170 = add nuw nsw i64 %indvars.iv169, 1
  %224 = load i64, ptr @h, align 8, !tbaa !8
  %.not104.not = icmp sgt i64 %224, %indvars.iv169
  br i1 %.not104.not, label %225, label %._crit_edge162, !llvm.loop !16

225:                                              ; preds = %.lr.ph161, %223
  %226 = phi i64 [ %.pre175, %.lr.ph161 ], [ %354, %223 ]
  %indvars.iv169 = phi i64 [ 1, %.lr.ph161 ], [ %indvars.iv.next170, %223 ]
  %227 = phi i64 [ %210, %.lr.ph161 ], [ %224, %223 ]
  %.079159 = phi i64 [ 0, %.lr.ph161 ], [ %.281, %223 ]
  store i64 %226, ptr %10, align 8, !tbaa !8
  %228 = load i64, ptr %1, align 8, !tbaa !8
  %229 = sub nsw i64 %227, %indvars.iv169
  %.not105.not = icmp sgt i64 %228, %229
  br i1 %.not105.not, label %230, label %238

230:                                              ; preds = %225
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %19) #9
  %231 = add nsw i64 %229, 1
  store i64 %231, ptr %19, align 8, !tbaa !8
  %232 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapIxxSt4lessIxESaISt4pairIKxxEEEixEOx(ptr noundef nonnull align 8 dereferenceable(48) @lx, ptr noundef nonnull align 8 dereferenceable(8) %19)
          to label %233 unwind label %236

233:                                              ; preds = %230
  %234 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %10, ptr noundef nonnull align 8 dereferenceable(8) %232)
  %235 = load i64, ptr %234, align 8, !tbaa !8
  store i64 %235, ptr %10, align 8, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %19) #9
  br label %238

236:                                              ; preds = %230
  %237 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %19) #9
  br label %365

238:                                              ; preds = %233, %225
  %239 = phi i64 [ %235, %233 ], [ %226, %225 ]
  %240 = load i64, ptr %2, align 8, !tbaa !8
  %241 = sub nsw i64 0, %indvars.iv169
  %.not106 = icmp sgt i64 %240, %241
  br i1 %.not106, label %249, label %242

242:                                              ; preds = %238
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %20) #9
  store i64 %241, ptr %20, align 8, !tbaa !8
  %243 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapIxxSt4lessIxESaISt4pairIKxxEEEixEOx(ptr noundef nonnull align 8 dereferenceable(48) @lx, ptr noundef nonnull align 8 dereferenceable(8) %20)
          to label %244 unwind label %247

244:                                              ; preds = %242
  %245 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %10, ptr noundef nonnull align 8 dereferenceable(8) %243)
  %246 = load i64, ptr %245, align 8, !tbaa !8
  store i64 %246, ptr %10, align 8, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %20) #9
  br label %249

247:                                              ; preds = %242
  %248 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %20) #9
  br label %365

249:                                              ; preds = %244, %238
  %250 = phi i64 [ %246, %244 ], [ %239, %238 ]
  %251 = load i64, ptr @inf, align 8, !tbaa !8
  %252 = icmp eq i64 %250, %251
  br i1 %252, label %253, label %321

253:                                              ; preds = %249
  %254 = load i64, ptr %5, align 8, !tbaa !8
  %255 = icmp sgt i64 %254, 0
  %256 = load i64, ptr %1, align 8
  %257 = icmp sgt i64 %256, 0
  %or.cond8 = select i1 %255, i1 %257, i1 false
  br i1 %or.cond8, label %258, label %286

258:                                              ; preds = %253
  %259 = load i64, ptr @h, align 8, !tbaa !8
  %260 = sub nsw i64 %259, %indvars.iv169
  %261 = add nsw i64 %260, 1
  %262 = xor i64 %256, -1
  %263 = add nsw i64 %254, %262
  %264 = add i64 %263, %261
  %265 = sdiv i64 %264, %254
  %266 = mul nsw i64 %265, %254
  %267 = sub nsw i64 %261, %266
  store i64 %267, ptr %9, align 8, !tbaa !8
  %268 = icmp sgt i64 %267, -1
  br i1 %268, label %270, label %269

269:                                              ; preds = %258
  call void @__assert_fail(ptr noundef nonnull @.str.5, ptr noundef nonnull @.str.6, i32 noundef 127, ptr noundef nonnull @__PRETTY_FUNCTION__.main) #10
  unreachable

270:                                              ; preds = %258
  %271 = invoke noundef i64 @_ZNKSt3mapIxxSt4lessIxESaISt4pairIKxxEEE5countERS3_(ptr noundef nonnull align 8 dereferenceable(48) @lx, ptr noundef nonnull align 8 dereferenceable(8) %9)
          to label %272 unwind label %282

272:                                              ; preds = %270
  %.not108 = icmp eq i64 %271, 0
  br i1 %.not108, label %321, label %273

273:                                              ; preds = %272
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %21) #9
  %274 = load i64, ptr @n, align 8, !tbaa !8
  %275 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapIxxSt4lessIxESaISt4pairIKxxEEEixERS3_(ptr noundef nonnull align 8 dereferenceable(48) @lx, ptr noundef nonnull align 8 dereferenceable(8) %9)
          to label %276 unwind label %284

276:                                              ; preds = %273
  %277 = mul nsw i64 %274, %265
  %278 = load i64, ptr %275, align 8, !tbaa !8
  %279 = add nsw i64 %278, %277
  store i64 %279, ptr %21, align 8, !tbaa !8
  %280 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %10, ptr noundef nonnull align 8 dereferenceable(8) %21)
  %281 = load i64, ptr %280, align 8, !tbaa !8
  store i64 %281, ptr %10, align 8, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %21) #9
  br label %321

282:                                              ; preds = %270
  %283 = landingpad { ptr, i32 }
          cleanup
  br label %365

284:                                              ; preds = %273
  %285 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %21) #9
  br label %365

286:                                              ; preds = %253
  %287 = icmp slt i64 %254, 0
  %288 = load i64, ptr %2, align 8
  %289 = icmp slt i64 %288, 0
  %or.cond10 = select i1 %287, i1 %289, i1 false
  br i1 %or.cond10, label %290, label %321

290:                                              ; preds = %286
  %291 = call noundef i64 @_ZSt3absx(i64 noundef %254)
  %292 = add nsw i64 %indvars.iv169, %288
  %293 = add i64 %292, %291
  %294 = sub i64 1, %293
  %295 = load i64, ptr %5, align 8, !tbaa !8
  %296 = sdiv i64 %294, %295
  %297 = call noundef i64 @_ZSt3absx(i64 noundef %295)
  %298 = mul nsw i64 %297, %296
  %299 = sub nsw i64 %indvars.iv169, %298
  store i64 %299, ptr %9, align 8, !tbaa !8
  %300 = icmp sgt i64 %299, -1
  br i1 %300, label %302, label %301

301:                                              ; preds = %290
  call void @__assert_fail(ptr noundef nonnull @.str.5, ptr noundef nonnull @.str.6, i32 noundef 135, ptr noundef nonnull @__PRETTY_FUNCTION__.main) #10
  unreachable

302:                                              ; preds = %290
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %22) #9
  %303 = sub nsw i64 0, %299
  store i64 %303, ptr %22, align 8, !tbaa !8
  %304 = invoke noundef i64 @_ZNKSt3mapIxxSt4lessIxESaISt4pairIKxxEEE5countERS3_(ptr noundef nonnull align 8 dereferenceable(48) @lx, ptr noundef nonnull align 8 dereferenceable(8) %22)
          to label %305 unwind label %317

305:                                              ; preds = %302
  %.not107 = icmp eq i64 %304, 0
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %22) #9
  br i1 %.not107, label %321, label %306

306:                                              ; preds = %305
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %23) #9
  %307 = load i64, ptr @n, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %24) #9
  %308 = load i64, ptr %9, align 8, !tbaa !8
  %309 = sub nsw i64 0, %308
  store i64 %309, ptr %24, align 8, !tbaa !8
  %310 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapIxxSt4lessIxESaISt4pairIKxxEEEixEOx(ptr noundef nonnull align 8 dereferenceable(48) @lx, ptr noundef nonnull align 8 dereferenceable(8) %24)
          to label %311 unwind label %319

311:                                              ; preds = %306
  %312 = mul nsw i64 %307, %296
  %313 = load i64, ptr %310, align 8, !tbaa !8
  %314 = add nsw i64 %313, %312
  store i64 %314, ptr %23, align 8, !tbaa !8
  %315 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %10, ptr noundef nonnull align 8 dereferenceable(8) %23)
  %316 = load i64, ptr %315, align 8, !tbaa !8
  store i64 %316, ptr %10, align 8, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %24) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %23) #9
  br label %321

317:                                              ; preds = %302
  %318 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %22) #9
  br label %365

319:                                              ; preds = %306
  %320 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %24) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %23) #9
  br label %365

321:                                              ; preds = %276, %272, %305, %311, %286, %249
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %25) #9
  %322 = call ptr @_ZNSt6vectorIxSaIxEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) @m) #9
  %323 = call ptr @_ZNSt6vectorIxSaIxEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) @m) #9
  %324 = invoke ptr @_ZSt11upper_boundIN9__gnu_cxx17__normal_iteratorIPxSt6vectorIxSaIxEEEExET_S7_S7_RKT0_(ptr %322, ptr %323, ptr noundef nonnull align 8 dereferenceable(8) %10)
          to label %325 unwind label %338

325:                                              ; preds = %321
  store ptr %324, ptr %25, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %26) #9
  %326 = call ptr @_ZNSt6vectorIxSaIxEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) @m) #9
  store ptr %326, ptr %26, align 8
  %327 = call noundef i64 @_ZN9__gnu_cxxmiIPxSt6vectorIxSaIxEEEENS_17__normal_iteratorIT_T0_E15difference_typeERKS8_SB_(ptr noundef nonnull align 8 dereferenceable(8) %25, ptr noundef nonnull align 8 dereferenceable(8) %26) #9
  %328 = trunc i64 %327 to i32
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %26) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %25) #9
  %329 = icmp sgt i32 %328, 0
  br i1 %329, label %330, label %340

330:                                              ; preds = %325
  %331 = add i64 %327, 4294967295
  %332 = and i64 %331, 4294967295
  %333 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %18, i64 noundef %332) #9
  %334 = load i64, ptr %333, align 8, !tbaa !8
  %335 = add nsw i64 %334, %.079159
  %336 = load i64, ptr @MOD, align 8, !tbaa !8
  %337 = srem i64 %335, %336
  br label %340

338:                                              ; preds = %321
  %339 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %25) #9
  br label %365

340:                                              ; preds = %330, %325
  %.180 = phi i64 [ %337, %330 ], [ %.079159, %325 ]
  %341 = load i64, ptr %10, align 8, !tbaa !8
  %342 = load i64, ptr @inf, align 8, !tbaa !8
  %.not110 = icmp eq i64 %341, %342
  br i1 %.not110, label %.critedge, label %343

343:                                              ; preds = %340
  %344 = call noundef i64 @_ZNKSt6vectorIxSaIxEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %18) #9
  %sext = shl i64 %327, 32
  %345 = ashr exact i64 %sext, 32
  %346 = sub i64 %.084.lcssa, %345
  %347 = add i64 %346, %344
  %348 = load i64, ptr %10, align 8, !tbaa !8
  %349 = mul nsw i64 %347, %348
  %350 = load i64, ptr @MOD, align 8, !tbaa !8
  %351 = srem i64 %349, %350
  %352 = add nsw i64 %351, %.180
  %353 = srem i64 %352, %350
  %.pre176 = load i64, ptr @inf, align 8, !tbaa !8
  br label %.critedge

.critedge:                                        ; preds = %343, %340
  %354 = phi i64 [ %.pre176, %343 ], [ %341, %340 ]
  %355 = phi i64 [ %348, %343 ], [ %341, %340 ]
  %.281 = phi i64 [ %353, %343 ], [ %.180, %340 ]
  %356 = icmp ne i64 %355, %354
  %or.cond12.not = select i1 %356, i1 true, i1 %211
  br i1 %or.cond12.not, label %223, label %357

357:                                              ; preds = %.critedge
  %358 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str)
  br label %364

._crit_edge162:                                   ; preds = %223, %.preheader
  %.079.lcssa = phi i64 [ 0, %.preheader ], [ %.281, %223 ]
  %359 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %.079.lcssa)
          to label %360 unwind label %362

360:                                              ; preds = %._crit_edge162
  %361 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %359, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %364 unwind label %362

362:                                              ; preds = %360, %._crit_edge162
  %363 = landingpad { ptr, i32 }
          cleanup
  br label %365

364:                                              ; preds = %357, %360
  call void @_ZNSt6vectorIxSaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %18) #9
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %18) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #9
  br label %366

365:                                              ; preds = %236, %247, %282, %284, %317, %319, %338, %362
  %.pn113 = phi { ptr, i32 } [ %363, %362 ], [ %339, %338 ], [ %285, %284 ], [ %283, %282 ], [ %320, %319 ], [ %318, %317 ], [ %248, %247 ], [ %237, %236 ]
  call void @_ZNSt6vectorIxSaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %18) #9
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %18) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #9
  resume { ptr, i32 } %.pn113

366:                                              ; preds = %364, %113
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #9
  ret i32 0
}

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

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

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_ZNKSt3mapIxxSt4lessIxESaISt4pairIKxxEEE5countERS3_(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #3 align 2

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #5

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #5

; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #6

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #7

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZSt3absx(i64 noundef) local_unnamed_addr #5

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPxSt6vectorIxSaIxEEEEEvT_S7_(ptr, ptr) local_unnamed_addr #8

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

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

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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZN9__gnu_cxxmiIPxSt6vectorIxSaIxEEEENS_17__normal_iteratorIT_T0_E15difference_typeERKS8_SB_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #5

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local ptr @_ZSt11upper_boundIN9__gnu_cxx17__normal_iteratorIPxSt6vectorIxSaIxEEEExET_S7_S7_RKT0_(ptr, ptr, ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #8

; 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 #3 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 #3 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)) #8

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 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 #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress 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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { 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 #6 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { noreturn nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #8 = { 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 #9 = { nounwind }
attributes #10 = { noreturn nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"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 = !{!10, !10, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = distinct !{!14, !13}
!15 = distinct !{!15, !13}
!16 = distinct !{!16, !13}


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