; LLVM IR from DionysiosB/CodeForces :: 0200-0299 (294C-ShaassAndLights)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl" }
%"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl" = type { %"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl_data" }
%"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::allocator" = type { i8 }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }

@.str = external hidden unnamed_addr constant [10 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [6 x i8], align 1

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #1 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i64, align 8
  %4 = alloca %"class.std::vector", align 8
  %5 = alloca %"class.std::allocator", align 1
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i64, align 8
  %10 = alloca i64, align 8
  %11 = alloca i64, align 8
  %12 = alloca %"class.std::vector", align 8
  %13 = alloca %"class.std::allocator", align 1
  %14 = alloca i64, align 8
  %15 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %16 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %17 = alloca i64, align 8
  %18 = alloca %"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 %"class.std::vector", align 8
  %24 = alloca %"class.std::allocator", align 1
  %25 = alloca i64, align 8
  %26 = alloca i64, align 8
  %27 = alloca i32, align 4
  %28 = alloca i64, align 8
  %29 = alloca i64, align 8
  %30 = alloca i64, align 8
  %31 = alloca i64, align 8
  %32 = alloca i64, align 8
  %33 = alloca i64, align 8
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #6
  store i32 1010, ptr %2, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #6
  store i64 1000000007, ptr %3, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 24, ptr %4) #6
  call void @llvm.lifetime.start.p0(i64 1, ptr %5) #6
  call void @_ZNSaIxEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %5) #6
  invoke void @_ZNSt6vectorIxSaIxEEC2EmRKS0_(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef 1010, ptr noundef nonnull align 1 dereferenceable(1) %5)
          to label %34 unwind label %40

34:                                               ; preds = %0
  call void @_ZNSt15__new_allocatorIxED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %5) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %5) #6
  %35 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef 0) #6
  store i64 1, ptr %35, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  store i32 1, ptr %8, align 4, !tbaa !5
  br label %36

36:                                               ; preds = %59, %34
  %37 = load i32, ptr %8, align 4, !tbaa !5
  %38 = icmp slt i32 %37, 1010
  br i1 %38, label %44, label %39

39:                                               ; preds = %36
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  br label %62

40:                                               ; preds = %0
  %41 = landingpad { ptr, i32 }
          cleanup
  %42 = extractvalue { ptr, i32 } %41, 0
  store ptr %42, ptr %6, align 8
  %43 = extractvalue { ptr, i32 } %41, 1
  store i32 %43, ptr %7, align 4
  call void @_ZNSt15__new_allocatorIxED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %5) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %5) #6
  br label %278

44:                                               ; preds = %36
  %45 = load i32, ptr %8, align 4, !tbaa !5
  %46 = sub nsw i32 %45, 1
  %47 = sext i32 %46 to i64
  %48 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %47) #6
  %49 = load i64, ptr %48, align 8, !tbaa !9
  %50 = mul nsw i64 2, %49
  %51 = load i32, ptr %8, align 4, !tbaa !5
  %52 = sext i32 %51 to i64
  %53 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %52) #6
  store i64 %50, ptr %53, align 8, !tbaa !9
  %54 = load i32, ptr %8, align 4, !tbaa !5
  %55 = sext i32 %54 to i64
  %56 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %55) #6
  %57 = load i64, ptr %56, align 8, !tbaa !9
  %58 = srem i64 %57, 1000000007
  store i64 %58, ptr %56, align 8, !tbaa !9
  br label %59

59:                                               ; preds = %44
  %60 = load i32, ptr %8, align 4, !tbaa !5
  %61 = add nsw i32 %60, 1
  store i32 %61, ptr %8, align 4, !tbaa !5
  br label %36, !llvm.loop !11

62:                                               ; preds = %39
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #6
  store i64 1, ptr %9, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  %63 = invoke i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %10, ptr noundef %11)
          to label %64 unwind label %72

64:                                               ; preds = %62
  call void @llvm.lifetime.start.p0(i64 24, ptr %12) #6
  %65 = load i64, ptr %11, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 1, ptr %13) #6
  call void @_ZNSaIxEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %13) #6
  invoke void @_ZNSt6vectorIxSaIxEEC2EmRKS0_(ptr noundef nonnull align 8 dereferenceable(24) %12, i64 noundef %65, ptr noundef nonnull align 1 dereferenceable(1) %13)
          to label %66 unwind label %76

66:                                               ; preds = %64
  call void @_ZNSt15__new_allocatorIxED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %13) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %13) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #6
  store i64 0, ptr %14, align 8, !tbaa !9
  br label %67

67:                                               ; preds = %85, %66
  %68 = load i64, ptr %14, align 8, !tbaa !9
  %69 = load i64, ptr %11, align 8, !tbaa !9
  %70 = icmp slt i64 %68, %69
  br i1 %70, label %80, label %71

71:                                               ; preds = %67
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  br label %92

72:                                               ; preds = %62
  %73 = landingpad { ptr, i32 }
          cleanup
  %74 = extractvalue { ptr, i32 } %73, 0
  store ptr %74, ptr %6, align 8
  %75 = extractvalue { ptr, i32 } %73, 1
  store i32 %75, ptr %7, align 4
  br label %277

76:                                               ; preds = %64
  %77 = landingpad { ptr, i32 }
          cleanup
  %78 = extractvalue { ptr, i32 } %77, 0
  store ptr %78, ptr %6, align 8
  %79 = extractvalue { ptr, i32 } %77, 1
  store i32 %79, ptr %7, align 4
  call void @_ZNSt15__new_allocatorIxED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %13) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %13) #6
  br label %276

80:                                               ; preds = %67
  %81 = load i64, ptr %14, align 8, !tbaa !9
  %82 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %12, i64 noundef %81) #6
  %83 = invoke i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %82)
          to label %84 unwind label %88

84:                                               ; preds = %80
  br label %85

85:                                               ; preds = %84
  %86 = load i64, ptr %14, align 8, !tbaa !9
  %87 = add nsw i64 %86, 1
  store i64 %87, ptr %14, align 8, !tbaa !9
  br label %67, !llvm.loop !13

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

92:                                               ; preds = %71
  %93 = call ptr @_ZNSt6vectorIxSaIxEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %12) #6
  %94 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %15, i32 0, i32 0
  store ptr %93, ptr %94, align 8
  %95 = call ptr @_ZNSt6vectorIxSaIxEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %12) #6
  %96 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %16, i32 0, i32 0
  store ptr %95, ptr %96, align 8
  %97 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %15, i32 0, i32 0
  %98 = load ptr, ptr %97, align 8
  %99 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %16, i32 0, i32 0
  %100 = load ptr, ptr %99, align 8
  invoke void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPxSt6vectorIxSaIxEEEEEvT_S7_(ptr %98, ptr %100)
          to label %101 unwind label %110

101:                                              ; preds = %92
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #6
  %102 = load i64, ptr %10, align 8, !tbaa !9
  %103 = load i64, ptr %11, align 8, !tbaa !9
  %104 = sub nsw i64 %102, %103
  store i64 %104, ptr %17, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 24, ptr %18) #6
  call void @_ZNSt6vectorIxSaIxEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %18) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #6
  store i64 0, ptr %19, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #6
  store i64 0, ptr %20, align 8, !tbaa !9
  br label %105

105:                                              ; preds = %148, %101
  %106 = load i64, ptr %20, align 8, !tbaa !9
  %107 = load i64, ptr %11, align 8, !tbaa !9
  %108 = icmp slt i64 %106, %107
  br i1 %108, label %114, label %109

109:                                              ; preds = %105
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #6
  br label %151

110:                                              ; preds = %92
  %111 = landingpad { ptr, i32 }
          cleanup
  %112 = extractvalue { ptr, i32 } %111, 0
  store ptr %112, ptr %6, align 8
  %113 = extractvalue { ptr, i32 } %111, 1
  store i32 %113, ptr %7, align 4
  br label %275

114:                                              ; preds = %105
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #6
  %115 = load i64, ptr %20, align 8, !tbaa !9
  %116 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %12, i64 noundef %115) #6
  %117 = load i64, ptr %116, align 8, !tbaa !9
  %118 = load i64, ptr %19, align 8, !tbaa !9
  %119 = sub nsw i64 %117, %118
  %120 = sub nsw i64 %119, 1
  store i64 %120, ptr %21, align 8, !tbaa !9
  %121 = load i64, ptr %21, align 8, !tbaa !9
  %122 = icmp sgt i64 %121, 0
  br i1 %122, label %123, label %129

123:                                              ; preds = %114
  invoke void @_ZNSt6vectorIxSaIxEE9push_backERKx(ptr noundef nonnull align 8 dereferenceable(24) %18, ptr noundef nonnull align 8 dereferenceable(8) %21)
          to label %124 unwind label %125

124:                                              ; preds = %123
  br label %129

125:                                              ; preds = %123
  %126 = landingpad { ptr, i32 }
          cleanup
  %127 = extractvalue { ptr, i32 } %126, 0
  store ptr %127, ptr %6, align 8
  %128 = extractvalue { ptr, i32 } %126, 1
  store i32 %128, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #6
  br label %274

129:                                              ; preds = %124, %114
  %130 = load i64, ptr %21, align 8, !tbaa !9
  %131 = icmp sgt i64 %130, 0
  br i1 %131, label %132, label %144

132:                                              ; preds = %129
  %133 = load i64, ptr %19, align 8, !tbaa !9
  %134 = icmp sgt i64 %133, 0
  br i1 %134, label %135, label %144

135:                                              ; preds = %132
  %136 = load i64, ptr %21, align 8, !tbaa !9
  %137 = sub nsw i64 %136, 1
  %138 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %137) #6
  %139 = load i64, ptr %138, align 8, !tbaa !9
  %140 = load i64, ptr %9, align 8, !tbaa !9
  %141 = mul nsw i64 %140, %139
  store i64 %141, ptr %9, align 8, !tbaa !9
  %142 = load i64, ptr %9, align 8, !tbaa !9
  %143 = srem i64 %142, 1000000007
  store i64 %143, ptr %9, align 8, !tbaa !9
  br label %144

144:                                              ; preds = %135, %132, %129
  %145 = load i64, ptr %20, align 8, !tbaa !9
  %146 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %12, i64 noundef %145) #6
  %147 = load i64, ptr %146, align 8, !tbaa !9
  store i64 %147, ptr %19, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #6
  br label %148

148:                                              ; preds = %144
  %149 = load i64, ptr %20, align 8, !tbaa !9
  %150 = add nsw i64 %149, 1
  store i64 %150, ptr %20, align 8, !tbaa !9
  br label %105, !llvm.loop !14

151:                                              ; preds = %109
  %152 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEE4backEv(ptr noundef nonnull align 8 dereferenceable(24) %12) #6
  %153 = load i64, ptr %152, align 8, !tbaa !9
  %154 = load i64, ptr %10, align 8, !tbaa !9
  %155 = icmp slt i64 %153, %154
  br i1 %155, label %156, label %166

156:                                              ; preds = %151
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #6
  %157 = load i64, ptr %10, align 8, !tbaa !9
  %158 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEE4backEv(ptr noundef nonnull align 8 dereferenceable(24) %12) #6
  %159 = load i64, ptr %158, align 8, !tbaa !9
  %160 = sub nsw i64 %157, %159
  store i64 %160, ptr %22, align 8, !tbaa !9
  invoke void @_ZNSt6vectorIxSaIxEE9push_backEOx(ptr noundef nonnull align 8 dereferenceable(24) %18, ptr noundef nonnull align 8 dereferenceable(8) %22)
          to label %161 unwind label %162

161:                                              ; preds = %156
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #6
  br label %166

162:                                              ; preds = %156
  %163 = landingpad { ptr, i32 }
          cleanup
  %164 = extractvalue { ptr, i32 } %163, 0
  store ptr %164, ptr %6, align 8
  %165 = extractvalue { ptr, i32 } %163, 1
  store i32 %165, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #6
  br label %274

166:                                              ; preds = %161, %151
  call void @llvm.lifetime.start.p0(i64 24, ptr %23) #6
  %167 = load i64, ptr %17, align 8, !tbaa !9
  %168 = add nsw i64 %167, 1
  call void @llvm.lifetime.start.p0(i64 1, ptr %24) #6
  call void @_ZNSaIxEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %24) #6
  invoke void @_ZNSt6vectorIxSaIxEEC2EmRKS0_(ptr noundef nonnull align 8 dereferenceable(24) %23, i64 noundef %168, ptr noundef nonnull align 1 dereferenceable(1) %24)
          to label %169 unwind label %175

169:                                              ; preds = %166
  call void @_ZNSt15__new_allocatorIxED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %24) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %24) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #6
  store i64 1, ptr %25, align 8, !tbaa !9
  br label %170

170:                                              ; preds = %183, %169
  %171 = load i64, ptr %25, align 8, !tbaa !9
  %172 = load i64, ptr %17, align 8, !tbaa !9
  %173 = icmp sle i64 %171, %172
  br i1 %173, label %179, label %174

174:                                              ; preds = %170
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #6
  br label %186

175:                                              ; preds = %166
  %176 = landingpad { ptr, i32 }
          cleanup
  %177 = extractvalue { ptr, i32 } %176, 0
  store ptr %177, ptr %6, align 8
  %178 = extractvalue { ptr, i32 } %176, 1
  store i32 %178, ptr %7, align 4
  call void @_ZNSt15__new_allocatorIxED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %24) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %24) #6
  br label %273

179:                                              ; preds = %170
  %180 = load i64, ptr %25, align 8, !tbaa !9
  %181 = load i64, ptr %25, align 8, !tbaa !9
  %182 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %23, i64 noundef %181) #6
  store i64 %180, ptr %182, align 8, !tbaa !9
  br label %183

183:                                              ; preds = %179
  %184 = load i64, ptr %25, align 8, !tbaa !9
  %185 = add nsw i64 %184, 1
  store i64 %185, ptr %25, align 8, !tbaa !9
  br label %170, !llvm.loop !15

186:                                              ; preds = %174
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #6
  store i64 0, ptr %26, align 8, !tbaa !9
  br label %187

187:                                              ; preds = %243, %186
  %188 = load i64, ptr %26, align 8, !tbaa !9
  %189 = call noundef i64 @_ZNKSt6vectorIxSaIxEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %18) #6
  %190 = icmp ult i64 %188, %189
  br i1 %190, label %192, label %191

191:                                              ; preds = %187
  store i32 14, ptr %27, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #6
  br label %246

192:                                              ; preds = %187
  call void @llvm.lifetime.start.p0(i64 8, ptr %28) #6
  %193 = load i64, ptr %26, align 8, !tbaa !9
  %194 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %18, i64 noundef %193) #6
  %195 = load i64, ptr %194, align 8, !tbaa !9
  store i64 %195, ptr %28, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %29) #6
  store i64 2, ptr %29, align 8, !tbaa !9
  br label %196

196:                                              ; preds = %239, %192
  %197 = load i64, ptr %29, align 8, !tbaa !9
  %198 = load i64, ptr %28, align 8, !tbaa !9
  %199 = icmp sle i64 %197, %198
  br i1 %199, label %201, label %200

200:                                              ; preds = %196
  store i32 17, ptr %27, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %29) #6
  br label %242

201:                                              ; preds = %196
  call void @llvm.lifetime.start.p0(i64 8, ptr %30) #6
  %202 = load i64, ptr %29, align 8, !tbaa !9
  store i64 %202, ptr %30, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %31) #6
  store i64 1, ptr %31, align 8, !tbaa !9
  br label %203

203:                                              ; preds = %234, %201
  %204 = load i64, ptr %31, align 8, !tbaa !9
  %205 = call noundef i64 @_ZNKSt6vectorIxSaIxEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %23) #6
  %206 = icmp ult i64 %204, %205
  br i1 %206, label %208, label %207

207:                                              ; preds = %203
  store i32 20, ptr %27, align 4
  br label %237

208:                                              ; preds = %203
  call void @llvm.lifetime.start.p0(i64 8, ptr %32) #6
  %209 = load i64, ptr %31, align 8, !tbaa !9
  %210 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %23, i64 noundef %209) #6
  %211 = load i64, ptr %210, align 8, !tbaa !9
  %212 = load i64, ptr %30, align 8, !tbaa !9
  %213 = invoke noundef i64 @_Z3gcdxx(i64 noundef %211, i64 noundef %212)
          to label %214 unwind label %226

214:                                              ; preds = %208
  store i64 %213, ptr %32, align 8, !tbaa !9
  %215 = load i64, ptr %32, align 8, !tbaa !9
  %216 = load i64, ptr %31, align 8, !tbaa !9
  %217 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %23, i64 noundef %216) #6
  %218 = load i64, ptr %217, align 8, !tbaa !9
  %219 = sdiv i64 %218, %215
  store i64 %219, ptr %217, align 8, !tbaa !9
  %220 = load i64, ptr %32, align 8, !tbaa !9
  %221 = load i64, ptr %30, align 8, !tbaa !9
  %222 = sdiv i64 %221, %220
  store i64 %222, ptr %30, align 8, !tbaa !9
  %223 = load i64, ptr %30, align 8, !tbaa !9
  %224 = icmp sle i64 %223, 1
  br i1 %224, label %225, label %230

225:                                              ; preds = %214
  store i32 20, ptr %27, align 4
  br label %231

226:                                              ; preds = %208
  %227 = landingpad { ptr, i32 }
          cleanup
  %228 = extractvalue { ptr, i32 } %227, 0
  store ptr %228, ptr %6, align 8
  %229 = extractvalue { ptr, i32 } %227, 1
  store i32 %229, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %32) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %31) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %30) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %29) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #6
  br label %272

230:                                              ; preds = %214
  store i32 0, ptr %27, align 4
  br label %231

231:                                              ; preds = %230, %225
  call void @llvm.lifetime.end.p0(i64 8, ptr %32) #6
  %232 = load i32, ptr %27, align 4
  switch i32 %232, label %237 [
    i32 0, label %233
  ]

233:                                              ; preds = %231
  br label %234

234:                                              ; preds = %233
  %235 = load i64, ptr %31, align 8, !tbaa !9
  %236 = add nsw i64 %235, 1
  store i64 %236, ptr %31, align 8, !tbaa !9
  br label %203, !llvm.loop !16

237:                                              ; preds = %231, %207
  call void @llvm.lifetime.end.p0(i64 8, ptr %31) #6
  br label %238

238:                                              ; preds = %237
  call void @llvm.lifetime.end.p0(i64 8, ptr %30) #6
  br label %239

239:                                              ; preds = %238
  %240 = load i64, ptr %29, align 8, !tbaa !9
  %241 = add nsw i64 %240, 1
  store i64 %241, ptr %29, align 8, !tbaa !9
  br label %196, !llvm.loop !17

242:                                              ; preds = %200
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #6
  br label %243

243:                                              ; preds = %242
  %244 = load i64, ptr %26, align 8, !tbaa !9
  %245 = add nsw i64 %244, 1
  store i64 %245, ptr %26, align 8, !tbaa !9
  br label %187, !llvm.loop !18

246:                                              ; preds = %191
  call void @llvm.lifetime.start.p0(i64 8, ptr %33) #6
  store i64 1, ptr %33, align 8, !tbaa !9
  br label %247

247:                                              ; preds = %260, %246
  %248 = load i64, ptr %33, align 8, !tbaa !9
  %249 = call noundef i64 @_ZNKSt6vectorIxSaIxEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %23) #6
  %250 = icmp ult i64 %248, %249
  br i1 %250, label %252, label %251

251:                                              ; preds = %247
  store i32 23, ptr %27, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %33) #6
  br label %263

252:                                              ; preds = %247
  %253 = load i64, ptr %33, align 8, !tbaa !9
  %254 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %23, i64 noundef %253) #6
  %255 = load i64, ptr %254, align 8, !tbaa !9
  %256 = load i64, ptr %9, align 8, !tbaa !9
  %257 = mul nsw i64 %256, %255
  store i64 %257, ptr %9, align 8, !tbaa !9
  %258 = load i64, ptr %9, align 8, !tbaa !9
  %259 = srem i64 %258, 1000000007
  store i64 %259, ptr %9, align 8, !tbaa !9
  br label %260

260:                                              ; preds = %252
  %261 = load i64, ptr %33, align 8, !tbaa !9
  %262 = add nsw i64 %261, 1
  store i64 %262, ptr %33, align 8, !tbaa !9
  br label %247, !llvm.loop !19

263:                                              ; preds = %251
  %264 = load i64, ptr %9, align 8, !tbaa !9
  %265 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.2, i64 noundef %264)
          to label %266 unwind label %268

266:                                              ; preds = %263
  store i32 0, ptr %1, align 4
  store i32 1, ptr %27, align 4
  call void @_ZNSt6vectorIxSaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %23) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %23) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #6
  call void @_ZNSt6vectorIxSaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %18) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %18) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #6
  call void @_ZNSt6vectorIxSaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %12) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  call void @_ZNSt6vectorIxSaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %4) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #6
  %267 = load i32, ptr %1, align 4
  ret i32 %267

268:                                              ; preds = %263
  %269 = landingpad { ptr, i32 }
          cleanup
  %270 = extractvalue { ptr, i32 } %269, 0
  store ptr %270, ptr %6, align 8
  %271 = extractvalue { ptr, i32 } %269, 1
  store i32 %271, ptr %7, align 4
  br label %272

272:                                              ; preds = %268, %226
  call void @_ZNSt6vectorIxSaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %23) #6
  br label %273

273:                                              ; preds = %272, %175
  call void @llvm.lifetime.end.p0(i64 24, ptr %23) #6
  br label %274

274:                                              ; preds = %273, %162, %125
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #6
  call void @_ZNSt6vectorIxSaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %18) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %18) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #6
  br label %275

275:                                              ; preds = %274, %110, %88
  call void @_ZNSt6vectorIxSaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %12) #6
  br label %276

276:                                              ; preds = %275, %76
  call void @llvm.lifetime.end.p0(i64 24, ptr %12) #6
  br label %277

277:                                              ; preds = %276, %72
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  call void @_ZNSt6vectorIxSaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #6
  br label %278

278:                                              ; preds = %277, %40
  call void @llvm.lifetime.end.p0(i64 24, ptr %4) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #6
  br label %279

279:                                              ; preds = %278
  %280 = load ptr, ptr %6, align 8
  %281 = load i32, ptr %7, align 4
  %282 = insertvalue { ptr, i32 } poison, ptr %280, 0
  %283 = insertvalue { ptr, i32 } %282, i32 %281, 1
  resume { ptr, i32 } %283
}

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSaIxEC2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #3 align 2

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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #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) #3 align 2

declare i32 @__isoc99_scanf(ptr noundef, ...) #4

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

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

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

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

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

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

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

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

declare i32 @printf(ptr noundef, ...) #4

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt15__new_allocatorIxED2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #3 align 2

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long long", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !12}
!15 = distinct !{!15, !12}
!16 = distinct !{!16, !12}
!17 = distinct !{!17, !12}
!18 = distinct !{!18, !12}
!19 = distinct !{!19, !12}


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

%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl" }
%"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl" = type { %"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl_data" }
%"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::allocator" = type { i8 }

@.str = external hidden unnamed_addr constant [10 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [6 x i8], align 1

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #1 personality ptr @__gxx_personality_v0 {
  %1 = alloca %"class.std::vector", align 8
  %2 = alloca %"class.std::allocator", align 1
  %3 = alloca i64, align 8
  %4 = alloca i64, align 8
  %5 = alloca %"class.std::vector", align 8
  %6 = alloca %"class.std::allocator", align 1
  %7 = alloca %"class.std::vector", align 8
  %8 = alloca i64, align 8
  %9 = alloca i64, align 8
  %10 = alloca %"class.std::vector", align 8
  %11 = alloca %"class.std::allocator", align 1
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %1) #6
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %2) #6
  call void @_ZNSaIxEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %2) #6
  invoke void @_ZNSt6vectorIxSaIxEEC2EmRKS0_(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef 1010, ptr noundef nonnull align 1 dereferenceable(1) %2)
          to label %12 unwind label %17

12:                                               ; preds = %0
  call void @_ZNSt15__new_allocatorIxED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %2) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %2) #6
  %13 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef 0) #6
  store i64 1, ptr %13, align 8, !tbaa !5
  br label %19

14:                                               ; preds = %19
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #6
  %15 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %3, ptr noundef nonnull %4)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %5) #6
  %16 = load i64, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %6) #6
  call void @_ZNSaIxEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %6) #6
  invoke void @_ZNSt6vectorIxSaIxEEC2EmRKS0_(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %16, ptr noundef nonnull align 1 dereferenceable(1) %6)
          to label %28 unwind label %33

17:                                               ; preds = %0
  %18 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt15__new_allocatorIxED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %2) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %2) #6
  br label %128

19:                                               ; preds = %12, %19
  %indvars.iv = phi i64 [ 1, %12 ], [ %indvars.iv.next, %19 ]
  %20 = add nsw i64 %indvars.iv, -1
  %21 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %20) #6
  %22 = load i64, ptr %21, align 8, !tbaa !5
  %23 = shl nsw i64 %22, 1
  %24 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %indvars.iv) #6
  store i64 %23, ptr %24, align 8, !tbaa !5
  %25 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %indvars.iv) #6
  %26 = load i64, ptr %25, align 8, !tbaa !5
  %27 = srem i64 %26, 1000000007
  store i64 %27, ptr %25, align 8, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, 1010
  br i1 %exitcond.not, label %14, label %19, !llvm.loop !9

28:                                               ; preds = %14
  call void @_ZNSt15__new_allocatorIxED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %6) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %6) #6
  %29 = load i64, ptr %4, align 8, !tbaa !5
  %30 = icmp sgt i64 %29, 0
  br i1 %30, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %28
  %31 = call ptr @_ZNSt6vectorIxSaIxEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %5) #6
  %32 = call ptr @_ZNSt6vectorIxSaIxEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %5) #6
  invoke void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPxSt6vectorIxSaIxEEEEEvT_S7_(ptr %31, ptr %32)
          to label %40 unwind label %50

33:                                               ; preds = %14
  %34 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt15__new_allocatorIxED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %6) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %6) #6
  br label %127

.lr.ph:                                           ; preds = %28, %.lr.ph
  %.06780 = phi i64 [ %37, %.lr.ph ], [ 0, %28 ]
  %35 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %.06780) #6
  %36 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %35)
  %37 = add nuw nsw i64 %.06780, 1
  %38 = load i64, ptr %4, align 8, !tbaa !5
  %39 = icmp slt i64 %37, %38
  br i1 %39, label %.lr.ph, label %._crit_edge, !llvm.loop !11

40:                                               ; preds = %._crit_edge
  %41 = load i64, ptr %3, align 8, !tbaa !5
  %42 = load i64, ptr %4, align 8, !tbaa !5
  %43 = sub nsw i64 %41, %42
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %7) #6
  call void @_ZNSt6vectorIxSaIxEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %7) #6
  %44 = load i64, ptr %4, align 8, !tbaa !5
  %45 = icmp sgt i64 %44, 0
  br i1 %45, label %.lr.ph85, label %._crit_edge86

._crit_edge86:                                    ; preds = %.thread, %40
  %.064.lcssa = phi i64 [ 1, %40 ], [ %.165, %.thread ]
  %46 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEE4backEv(ptr noundef nonnull align 8 dereferenceable(24) %5) #6
  %47 = load i64, ptr %46, align 8, !tbaa !5
  %48 = load i64, ptr %3, align 8, !tbaa !5
  %49 = icmp slt i64 %47, %48
  br i1 %49, label %74, label %81

50:                                               ; preds = %._crit_edge
  %51 = landingpad { ptr, i32 }
          cleanup
  br label %126

.lr.ph85:                                         ; preds = %40, %.thread
  %.05683 = phi i64 [ %71, %.thread ], [ 0, %40 ]
  %.05782 = phi i64 [ %70, %.thread ], [ 0, %40 ]
  %.06481 = phi i64 [ %.165, %.thread ], [ 1, %40 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #6
  %52 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %.05683) #6
  %53 = load i64, ptr %52, align 8, !tbaa !5
  %54 = xor i64 %.05782, -1
  %55 = add i64 %53, %54
  store i64 %55, ptr %8, align 8, !tbaa !5
  %56 = icmp sgt i64 %55, 0
  br i1 %56, label %57, label %.thread

57:                                               ; preds = %.lr.ph85
  invoke void @_ZNSt6vectorIxSaIxEE9push_backERKx(ptr noundef nonnull align 8 dereferenceable(24) %7, ptr noundef nonnull align 8 dereferenceable(8) %8)
          to label %60 unwind label %58

58:                                               ; preds = %57
  %59 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #6
  br label %125

60:                                               ; preds = %57
  %.pre = load i64, ptr %8, align 8, !tbaa !5
  %61 = icmp sgt i64 %.pre, 0
  %62 = icmp sgt i64 %.05782, 0
  %or.cond = select i1 %61, i1 %62, i1 false
  br i1 %or.cond, label %63, label %.thread

63:                                               ; preds = %60
  %64 = add nsw i64 %.pre, -1
  %65 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %64) #6
  %66 = load i64, ptr %65, align 8, !tbaa !5
  %67 = mul nsw i64 %66, %.06481
  %68 = srem i64 %67, 1000000007
  br label %.thread

.thread:                                          ; preds = %.lr.ph85, %63, %60
  %.165 = phi i64 [ %68, %63 ], [ %.06481, %60 ], [ %.06481, %.lr.ph85 ]
  %69 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %.05683) #6
  %70 = load i64, ptr %69, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #6
  %71 = add nuw nsw i64 %.05683, 1
  %72 = load i64, ptr %4, align 8, !tbaa !5
  %73 = icmp slt i64 %71, %72
  br i1 %73, label %.lr.ph85, label %._crit_edge86, !llvm.loop !12

74:                                               ; preds = %._crit_edge86
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #6
  %75 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEE4backEv(ptr noundef nonnull align 8 dereferenceable(24) %5) #6
  %76 = load i64, ptr %75, align 8, !tbaa !5
  %77 = sub nsw i64 %48, %76
  store i64 %77, ptr %9, align 8, !tbaa !5
  invoke void @_ZNSt6vectorIxSaIxEE9push_backEOx(ptr noundef nonnull align 8 dereferenceable(24) %7, ptr noundef nonnull align 8 dereferenceable(8) %9)
          to label %78 unwind label %79

78:                                               ; preds = %74
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #6
  br label %81

79:                                               ; preds = %74
  %80 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #6
  br label %125

81:                                               ; preds = %78, %._crit_edge86
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %10) #6
  %82 = add nsw i64 %43, 1
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %11) #6
  call void @_ZNSaIxEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %11) #6
  invoke void @_ZNSt6vectorIxSaIxEEC2EmRKS0_(ptr noundef nonnull align 8 dereferenceable(24) %10, i64 noundef %82, ptr noundef nonnull align 1 dereferenceable(1) %11)
          to label %83 unwind label %87

83:                                               ; preds = %81
  call void @_ZNSt15__new_allocatorIxED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %11) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %11) #6
  %.not87 = icmp slt i64 %43, 1
  br i1 %.not87, label %.preheader77, label %.lr.ph90.preheader

.lr.ph90.preheader:                               ; preds = %83
  %84 = add i64 %41, 1
  %85 = sub i64 %84, %42
  br label %.lr.ph90

.preheader77:                                     ; preds = %.lr.ph90, %83
  %86 = call noundef i64 @_ZNKSt6vectorIxSaIxEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %7) #6
  %.not = icmp eq i64 %86, 0
  br i1 %.not, label %.preheader, label %.lr.ph100

87:                                               ; preds = %81
  %88 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt15__new_allocatorIxED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %11) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %11) #6
  br label %124

.lr.ph90:                                         ; preds = %.lr.ph90.preheader, %.lr.ph90
  %.05588 = phi i64 [ %90, %.lr.ph90 ], [ 1, %.lr.ph90.preheader ]
  %89 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %10, i64 noundef %.05588) #6
  store i64 %.05588, ptr %89, align 8, !tbaa !5
  %90 = add nuw i64 %.05588, 1
  %exitcond107.not = icmp eq i64 %90, %85
  br i1 %exitcond107.not, label %.preheader77, label %.lr.ph90, !llvm.loop !13

.preheader:                                       ; preds = %._crit_edge98, %.preheader77
  %91 = call noundef i64 @_ZNKSt6vectorIxSaIxEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %10) #6
  %92 = icmp ugt i64 %91, 1
  br i1 %92, label %.lr.ph103, label %._crit_edge104

.lr.ph100:                                        ; preds = %.preheader77, %._crit_edge98
  %.05499 = phi i64 [ %97, %._crit_edge98 ], [ 0, %.preheader77 ]
  %93 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %7, i64 noundef %.05499) #6
  %94 = load i64, ptr %93, align 8, !tbaa !5
  %.not6996 = icmp slt i64 %94, 2
  br i1 %.not6996, label %._crit_edge98, label %.preheader76

.preheader76:                                     ; preds = %.lr.ph100, %._crit_edge94
  %.05197 = phi i64 [ %115, %._crit_edge94 ], [ 2, %.lr.ph100 ]
  %95 = call noundef i64 @_ZNKSt6vectorIxSaIxEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %10) #6
  %96 = icmp ugt i64 %95, 1
  br i1 %96, label %.lr.ph93, label %._crit_edge94

._crit_edge98:                                    ; preds = %._crit_edge94, %.lr.ph100
  %97 = add nuw nsw i64 %.05499, 1
  %98 = call noundef i64 @_ZNKSt6vectorIxSaIxEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %7) #6
  %99 = icmp ult i64 %97, %98
  br i1 %99, label %.lr.ph100, label %.preheader, !llvm.loop !14

100:                                              ; preds = %107
  %101 = add nuw nsw i64 %.04992, 1
  %102 = call noundef i64 @_ZNKSt6vectorIxSaIxEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %10) #6
  %103 = icmp ult i64 %101, %102
  br i1 %103, label %.lr.ph93, label %._crit_edge94, !llvm.loop !15

.lr.ph93:                                         ; preds = %.preheader76, %100
  %.04992 = phi i64 [ %101, %100 ], [ 1, %.preheader76 ]
  %.05091 = phi i64 [ %111, %100 ], [ %.05197, %.preheader76 ]
  %104 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %10, i64 noundef %.04992) #6
  %105 = load i64, ptr %104, align 8, !tbaa !5
  %106 = invoke noundef i64 @_Z3gcdxx(i64 noundef %105, i64 noundef %.05091)
          to label %107 unwind label %113

107:                                              ; preds = %.lr.ph93
  %108 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %10, i64 noundef %.04992) #6
  %109 = load i64, ptr %108, align 8, !tbaa !5
  %110 = sdiv i64 %109, %106
  store i64 %110, ptr %108, align 8, !tbaa !5
  %111 = sdiv i64 %.05091, %106
  %112 = icmp sgt i64 %111, 1
  br i1 %112, label %100, label %._crit_edge94

113:                                              ; preds = %.lr.ph93
  %114 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt6vectorIxSaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %10) #6
  br label %124

._crit_edge94:                                    ; preds = %107, %100, %.preheader76
  %115 = add nuw i64 %.05197, 1
  %exitcond108.not = icmp eq i64 %.05197, %94
  br i1 %exitcond108.not, label %._crit_edge98, label %.preheader76, !llvm.loop !16

._crit_edge104:                                   ; preds = %.lr.ph103, %.preheader
  %.266.lcssa = phi i64 [ %.064.lcssa, %.preheader ], [ %120, %.lr.ph103 ]
  %116 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %.266.lcssa)
  call void @_ZNSt6vectorIxSaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %10) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %10) #6
  call void @_ZNSt6vectorIxSaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %7) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %7) #6
  call void @_ZNSt6vectorIxSaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #6
  call void @_ZNSt6vectorIxSaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %1) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %1) #6
  ret i32 0

.lr.ph103:                                        ; preds = %.preheader, %.lr.ph103
  %.0102 = phi i64 [ %121, %.lr.ph103 ], [ 1, %.preheader ]
  %.266101 = phi i64 [ %120, %.lr.ph103 ], [ %.064.lcssa, %.preheader ]
  %117 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %10, i64 noundef %.0102) #6
  %118 = load i64, ptr %117, align 8, !tbaa !5
  %119 = mul nsw i64 %118, %.266101
  %120 = srem i64 %119, 1000000007
  %121 = add nuw nsw i64 %.0102, 1
  %122 = call noundef i64 @_ZNKSt6vectorIxSaIxEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %10) #6
  %123 = icmp ult i64 %121, %122
  br i1 %123, label %.lr.ph103, label %._crit_edge104, !llvm.loop !17

124:                                              ; preds = %113, %87
  %.pn = phi { ptr, i32 } [ %114, %113 ], [ %88, %87 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %10) #6
  br label %125

125:                                              ; preds = %124, %79, %58
  %.pn71 = phi { ptr, i32 } [ %59, %58 ], [ %.pn, %124 ], [ %80, %79 ]
  call void @_ZNSt6vectorIxSaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %7) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %7) #6
  br label %126

126:                                              ; preds = %125, %50
  %.pn71.pn = phi { ptr, i32 } [ %.pn71, %125 ], [ %51, %50 ]
  call void @_ZNSt6vectorIxSaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #6
  br label %127

127:                                              ; preds = %126, %33
  %.pn71.pn.pn = phi { ptr, i32 } [ %.pn71.pn, %126 ], [ %34, %33 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #6
  call void @_ZNSt6vectorIxSaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %1) #6
  br label %128

128:                                              ; preds = %127, %17
  %.pn71.pn.pn.pn = phi { ptr, i32 } [ %.pn71.pn.pn, %127 ], [ %18, %17 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %1) #6
  resume { ptr, i32 } %.pn71.pn.pn.pn
}

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSaIxEC2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #3 align 2

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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #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 #3 align 2

; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4

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

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

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

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

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

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

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

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

; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt15__new_allocatorIxED2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #3 align 2

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


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