; LLVM IR from tangjz/acm-icpc :: codeforces/complete (963C)

; 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"

%struct.Edge = type { i64, i64, i64 }
%"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 }

@n = external dso_local global i32, align 4
@rc = external dso_local global i32, align 4
@cc = external dso_local global i32, align 4
@row = external dso_local global [200001 x i64], align 16
@col = external dso_local global [200001 x i64], align 16
@e = external dso_local global [200001 x %struct.Edge], align 16
@g = external dso_local global [200001 x %"class.std::vector"], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i64, align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %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 i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca i64, align 8
  %21 = alloca i32, align 4
  %22 = alloca i64, align 8
  %23 = alloca i64, align 8
  store i32 0, ptr %1, align 4
  %24 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @n)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #6
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %25

25:                                               ; preds = %62, %0
  %26 = load i32, ptr %2, align 4, !tbaa !5
  %27 = load i32, ptr @n, align 4, !tbaa !5
  %28 = icmp slt i32 %26, %27
  br i1 %28, label %30, label %29

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

30:                                               ; preds = %25
  %31 = load i32, ptr %2, align 4, !tbaa !5
  %32 = sext i32 %31 to i64
  %33 = getelementptr inbounds [200001 x %struct.Edge], ptr @e, i64 0, i64 %32
  %34 = getelementptr inbounds %struct.Edge, ptr %33, i32 0, i32 0
  %35 = load i32, ptr %2, align 4, !tbaa !5
  %36 = sext i32 %35 to i64
  %37 = getelementptr inbounds [200001 x %struct.Edge], ptr @e, i64 0, i64 %36
  %38 = getelementptr inbounds %struct.Edge, ptr %37, i32 0, i32 1
  %39 = load i32, ptr %2, align 4, !tbaa !5
  %40 = sext i32 %39 to i64
  %41 = getelementptr inbounds [200001 x %struct.Edge], ptr @e, i64 0, i64 %40
  %42 = getelementptr inbounds %struct.Edge, ptr %41, i32 0, i32 2
  %43 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.2, ptr noundef %34, ptr noundef %38, ptr noundef %42)
  %44 = load i32, ptr %2, align 4, !tbaa !5
  %45 = sext i32 %44 to i64
  %46 = getelementptr inbounds [200001 x %struct.Edge], ptr @e, i64 0, i64 %45
  %47 = getelementptr inbounds %struct.Edge, ptr %46, i32 0, i32 0
  %48 = load i64, ptr %47, align 8, !tbaa !9
  %49 = load i32, ptr @rc, align 4, !tbaa !5
  %50 = add nsw i32 %49, 1
  store i32 %50, ptr @rc, align 4, !tbaa !5
  %51 = sext i32 %49 to i64
  %52 = getelementptr inbounds [200001 x i64], ptr @row, i64 0, i64 %51
  store i64 %48, ptr %52, align 8, !tbaa !12
  %53 = load i32, ptr %2, align 4, !tbaa !5
  %54 = sext i32 %53 to i64
  %55 = getelementptr inbounds [200001 x %struct.Edge], ptr @e, i64 0, i64 %54
  %56 = getelementptr inbounds %struct.Edge, ptr %55, i32 0, i32 1
  %57 = load i64, ptr %56, align 8, !tbaa !13
  %58 = load i32, ptr @cc, align 4, !tbaa !5
  %59 = add nsw i32 %58, 1
  store i32 %59, ptr @cc, align 4, !tbaa !5
  %60 = sext i32 %58 to i64
  %61 = getelementptr inbounds [200001 x i64], ptr @col, i64 0, i64 %60
  store i64 %57, ptr %61, align 8, !tbaa !12
  br label %62

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

65:                                               ; preds = %29
  %66 = load i32, ptr @rc, align 4, !tbaa !5
  %67 = sext i32 %66 to i64
  %68 = getelementptr inbounds i64, ptr @row, i64 %67
  call void @_ZSt4sortIPxEvT_S1_(ptr noundef @row, ptr noundef %68)
  %69 = load i32, ptr @rc, align 4, !tbaa !5
  %70 = sext i32 %69 to i64
  %71 = getelementptr inbounds i64, ptr @row, i64 %70
  %72 = call noundef ptr @_ZSt6uniqueIPxET_S1_S1_(ptr noundef @row, ptr noundef %71)
  %73 = ptrtoint ptr %72 to i64
  %74 = sub i64 %73, ptrtoint (ptr @row to i64)
  %75 = sdiv exact i64 %74, 8
  %76 = trunc i64 %75 to i32
  store i32 %76, ptr @rc, align 4, !tbaa !5
  %77 = load i32, ptr @cc, align 4, !tbaa !5
  %78 = sext i32 %77 to i64
  %79 = getelementptr inbounds i64, ptr @col, i64 %78
  call void @_ZSt4sortIPxEvT_S1_(ptr noundef @col, ptr noundef %79)
  %80 = load i32, ptr @cc, align 4, !tbaa !5
  %81 = sext i32 %80 to i64
  %82 = getelementptr inbounds i64, ptr @col, i64 %81
  %83 = call noundef ptr @_ZSt6uniqueIPxET_S1_S1_(ptr noundef @col, ptr noundef %82)
  %84 = ptrtoint ptr %83 to i64
  %85 = sub i64 %84, ptrtoint (ptr @col to i64)
  %86 = sdiv exact i64 %85, 8
  %87 = trunc i64 %86 to i32
  store i32 %87, ptr @cc, align 4, !tbaa !5
  %88 = load i32, ptr @rc, align 4, !tbaa !5
  %89 = sext i32 %88 to i64
  %90 = load i32, ptr @cc, align 4, !tbaa !5
  %91 = sext i32 %90 to i64
  %92 = mul nsw i64 %89, %91
  %93 = load i32, ptr @n, align 4, !tbaa !5
  %94 = sext i32 %93 to i64
  %95 = icmp ne i64 %92, %94
  br i1 %95, label %96, label %98

96:                                               ; preds = %65
  %97 = call i32 @puts(ptr noundef @.str.3)
  store i32 0, ptr %1, align 4
  br label %356

98:                                               ; preds = %65
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #6
  store i32 0, ptr %3, align 4, !tbaa !5
  br label %99

99:                                               ; preds = %118, %98
  %100 = load i32, ptr %3, align 4, !tbaa !5
  %101 = load i32, ptr @rc, align 4, !tbaa !5
  %102 = icmp slt i32 %100, %101
  br i1 %102, label %104, label %103

103:                                              ; preds = %99
  store i32 5, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #6
  br label %121

104:                                              ; preds = %99
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #6
  store i32 0, ptr %5, align 4, !tbaa !5
  br label %105

105:                                              ; preds = %114, %104
  %106 = load i32, ptr %5, align 4, !tbaa !5
  %107 = load i32, ptr @cc, align 4, !tbaa !5
  %108 = icmp slt i32 %106, %107
  br i1 %108, label %110, label %109

109:                                              ; preds = %105
  store i32 8, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  br label %117

110:                                              ; preds = %105
  %111 = load i32, ptr %3, align 4, !tbaa !5
  %112 = sext i32 %111 to i64
  %113 = getelementptr inbounds [200001 x %"class.std::vector"], ptr @g, i64 0, i64 %112
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #6
  store i64 0, ptr %6, align 8, !tbaa !12
  call void @_ZNSt6vectorIxSaIxEE9push_backEOx(ptr noundef nonnull align 8 dereferenceable(24) %113, ptr noundef nonnull align 8 dereferenceable(8) %6)
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #6
  br label %114

114:                                              ; preds = %110
  %115 = load i32, ptr %5, align 4, !tbaa !5
  %116 = add nsw i32 %115, 1
  store i32 %116, ptr %5, align 4, !tbaa !5
  br label %105, !llvm.loop !16

117:                                              ; preds = %109
  br label %118

118:                                              ; preds = %117
  %119 = load i32, ptr %3, align 4, !tbaa !5
  %120 = add nsw i32 %119, 1
  store i32 %120, ptr %3, align 4, !tbaa !5
  br label %99, !llvm.loop !17

121:                                              ; preds = %103
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  store i32 0, ptr %7, align 4, !tbaa !5
  br label %122

122:                                              ; preds = %177, %121
  %123 = load i32, ptr %7, align 4, !tbaa !5
  %124 = load i32, ptr @n, align 4, !tbaa !5
  %125 = icmp slt i32 %123, %124
  br i1 %125, label %127, label %126

126:                                              ; preds = %122
  store i32 11, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  br label %180

127:                                              ; preds = %122
  %128 = load i32, ptr @rc, align 4, !tbaa !5
  %129 = sext i32 %128 to i64
  %130 = getelementptr inbounds i64, ptr @row, i64 %129
  %131 = load i32, ptr %7, align 4, !tbaa !5
  %132 = sext i32 %131 to i64
  %133 = getelementptr inbounds [200001 x %struct.Edge], ptr @e, i64 0, i64 %132
  %134 = getelementptr inbounds %struct.Edge, ptr %133, i32 0, i32 0
  %135 = call noundef ptr @_ZSt11lower_boundIPxxET_S1_S1_RKT0_(ptr noundef @row, ptr noundef %130, ptr noundef nonnull align 8 dereferenceable(8) %134)
  %136 = ptrtoint ptr %135 to i64
  %137 = sub i64 %136, ptrtoint (ptr @row to i64)
  %138 = sdiv exact i64 %137, 8
  %139 = load i32, ptr %7, align 4, !tbaa !5
  %140 = sext i32 %139 to i64
  %141 = getelementptr inbounds [200001 x %struct.Edge], ptr @e, i64 0, i64 %140
  %142 = getelementptr inbounds %struct.Edge, ptr %141, i32 0, i32 0
  store i64 %138, ptr %142, align 8, !tbaa !9
  %143 = load i32, ptr @cc, align 4, !tbaa !5
  %144 = sext i32 %143 to i64
  %145 = getelementptr inbounds i64, ptr @col, i64 %144
  %146 = load i32, ptr %7, align 4, !tbaa !5
  %147 = sext i32 %146 to i64
  %148 = getelementptr inbounds [200001 x %struct.Edge], ptr @e, i64 0, i64 %147
  %149 = getelementptr inbounds %struct.Edge, ptr %148, i32 0, i32 1
  %150 = call noundef ptr @_ZSt11lower_boundIPxxET_S1_S1_RKT0_(ptr noundef @col, ptr noundef %145, ptr noundef nonnull align 8 dereferenceable(8) %149)
  %151 = ptrtoint ptr %150 to i64
  %152 = sub i64 %151, ptrtoint (ptr @col to i64)
  %153 = sdiv exact i64 %152, 8
  %154 = load i32, ptr %7, align 4, !tbaa !5
  %155 = sext i32 %154 to i64
  %156 = getelementptr inbounds [200001 x %struct.Edge], ptr @e, i64 0, i64 %155
  %157 = getelementptr inbounds %struct.Edge, ptr %156, i32 0, i32 1
  store i64 %153, ptr %157, align 8, !tbaa !13
  %158 = load i32, ptr %7, align 4, !tbaa !5
  %159 = sext i32 %158 to i64
  %160 = getelementptr inbounds [200001 x %struct.Edge], ptr @e, i64 0, i64 %159
  %161 = getelementptr inbounds %struct.Edge, ptr %160, i32 0, i32 2
  %162 = load i64, ptr %161, align 8, !tbaa !18
  %163 = load i32, ptr %7, align 4, !tbaa !5
  %164 = sext i32 %163 to i64
  %165 = getelementptr inbounds [200001 x %struct.Edge], ptr @e, i64 0, i64 %164
  %166 = getelementptr inbounds %struct.Edge, ptr %165, i32 0, i32 0
  %167 = load i64, ptr %166, align 8, !tbaa !9
  %168 = getelementptr inbounds [200001 x %"class.std::vector"], ptr @g, i64 0, i64 %167
  %169 = load i32, ptr %7, align 4, !tbaa !5
  %170 = sext i32 %169 to i64
  %171 = getelementptr inbounds [200001 x %struct.Edge], ptr @e, i64 0, i64 %170
  %172 = getelementptr inbounds %struct.Edge, ptr %171, i32 0, i32 1
  %173 = load i64, ptr %172, align 8, !tbaa !13
  %174 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %168, i64 noundef %173) #6
  %175 = load i64, ptr %174, align 8, !tbaa !12
  %176 = add nsw i64 %175, %162
  store i64 %176, ptr %174, align 8, !tbaa !12
  br label %177

177:                                              ; preds = %127
  %178 = load i32, ptr %7, align 4, !tbaa !5
  %179 = add nsw i32 %178, 1
  store i32 %179, ptr %7, align 4, !tbaa !5
  br label %122, !llvm.loop !19

180:                                              ; preds = %126
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  store i32 1, ptr %8, align 4, !tbaa !5
  br label %181

181:                                              ; preds = %248, %180
  %182 = load i32, ptr %8, align 4, !tbaa !5
  %183 = load i32, ptr @rc, align 4, !tbaa !5
  %184 = icmp slt i32 %182, %183
  br i1 %184, label %186, label %185

185:                                              ; preds = %181
  store i32 14, ptr %4, align 4
  br label %251

186:                                              ; preds = %181
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  store i32 1, ptr %9, align 4, !tbaa !5
  br label %187

187:                                              ; preds = %242, %186
  %188 = load i32, ptr %9, align 4, !tbaa !5
  %189 = load i32, ptr @cc, align 4, !tbaa !5
  %190 = icmp slt i32 %188, %189
  br i1 %190, label %192, label %191

191:                                              ; preds = %187
  store i32 17, ptr %4, align 4
  br label %245

192:                                              ; preds = %187
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  %193 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @g, i64 noundef 0) #6
  %194 = load i64, ptr %193, align 8, !tbaa !12
  store i64 %194, ptr %10, align 8, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  %195 = load i32, ptr %8, align 4, !tbaa !5
  %196 = sext i32 %195 to i64
  %197 = getelementptr inbounds [200001 x %"class.std::vector"], ptr @g, i64 0, i64 %196
  %198 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %197, i64 noundef 0) #6
  %199 = load i64, ptr %198, align 8, !tbaa !12
  store i64 %199, ptr %11, align 8, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  %200 = load i64, ptr %10, align 8, !tbaa !12
  %201 = load i64, ptr %11, align 8, !tbaa !12
  %202 = call noundef i64 @_ZSt5__gcdIxET_S0_S0_(i64 noundef %200, i64 noundef %201)
  store i64 %202, ptr %12, align 8, !tbaa !12
  %203 = load i64, ptr %12, align 8, !tbaa !12
  %204 = load i64, ptr %10, align 8, !tbaa !12
  %205 = sdiv i64 %204, %203
  store i64 %205, ptr %10, align 8, !tbaa !12
  %206 = load i64, ptr %12, align 8, !tbaa !12
  %207 = load i64, ptr %11, align 8, !tbaa !12
  %208 = sdiv i64 %207, %206
  store i64 %208, ptr %11, align 8, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #6
  %209 = load i32, ptr %9, align 4, !tbaa !5
  %210 = sext i32 %209 to i64
  %211 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @g, i64 noundef %210) #6
  %212 = load i64, ptr %211, align 8, !tbaa !12
  store i64 %212, ptr %13, align 8, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #6
  %213 = load i32, ptr %8, align 4, !tbaa !5
  %214 = sext i32 %213 to i64
  %215 = getelementptr inbounds [200001 x %"class.std::vector"], ptr @g, i64 0, i64 %214
  %216 = load i32, ptr %9, align 4, !tbaa !5
  %217 = sext i32 %216 to i64
  %218 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %215, i64 noundef %217) #6
  %219 = load i64, ptr %218, align 8, !tbaa !12
  store i64 %219, ptr %14, align 8, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #6
  %220 = load i64, ptr %13, align 8, !tbaa !12
  %221 = load i64, ptr %14, align 8, !tbaa !12
  %222 = call noundef i64 @_ZSt5__gcdIxET_S0_S0_(i64 noundef %220, i64 noundef %221)
  store i64 %222, ptr %15, align 8, !tbaa !12
  %223 = load i64, ptr %15, align 8, !tbaa !12
  %224 = load i64, ptr %13, align 8, !tbaa !12
  %225 = sdiv i64 %224, %223
  store i64 %225, ptr %13, align 8, !tbaa !12
  %226 = load i64, ptr %15, align 8, !tbaa !12
  %227 = load i64, ptr %14, align 8, !tbaa !12
  %228 = sdiv i64 %227, %226
  store i64 %228, ptr %14, align 8, !tbaa !12
  %229 = load i64, ptr %10, align 8, !tbaa !12
  %230 = load i64, ptr %13, align 8, !tbaa !12
  %231 = icmp ne i64 %229, %230
  br i1 %231, label %236, label %232

232:                                              ; preds = %192
  %233 = load i64, ptr %11, align 8, !tbaa !12
  %234 = load i64, ptr %14, align 8, !tbaa !12
  %235 = icmp ne i64 %233, %234
  br i1 %235, label %236, label %238

236:                                              ; preds = %232, %192
  %237 = call i32 @puts(ptr noundef @.str.3)
  store i32 0, ptr %1, align 4
  store i32 1, ptr %4, align 4
  br label %239

238:                                              ; preds = %232
  store i32 0, ptr %4, align 4
  br label %239

239:                                              ; preds = %238, %236
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 8, 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
  %240 = load i32, ptr %4, align 4
  switch i32 %240, label %245 [
    i32 0, label %241
  ]

241:                                              ; preds = %239
  br label %242

242:                                              ; preds = %241
  %243 = load i32, ptr %9, align 4, !tbaa !5
  %244 = add nsw i32 %243, 1
  store i32 %244, ptr %9, align 4, !tbaa !5
  br label %187, !llvm.loop !20

245:                                              ; preds = %239, %191
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  %246 = load i32, ptr %4, align 4
  switch i32 %246, label %251 [
    i32 17, label %247
  ]

247:                                              ; preds = %245
  br label %248

248:                                              ; preds = %247
  %249 = load i32, ptr %8, align 4, !tbaa !5
  %250 = add nsw i32 %249, 1
  store i32 %250, ptr %8, align 4, !tbaa !5
  br label %181, !llvm.loop !21

251:                                              ; preds = %245, %185
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  %252 = load i32, ptr %4, align 4
  switch i32 %252, label %358 [
    i32 14, label %253
    i32 1, label %356
  ]

253:                                              ; preds = %251
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #6
  store i64 1, ptr %16, align 8, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #6
  %254 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @g, i64 noundef 0) #6
  %255 = load i64, ptr %254, align 8, !tbaa !12
  store i64 %255, ptr %17, align 8, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #6
  store i32 1, ptr %18, align 4, !tbaa !5
  br label %256

256:                                              ; preds = %268, %253
  %257 = load i32, ptr %18, align 4, !tbaa !5
  %258 = load i32, ptr @cc, align 4, !tbaa !5
  %259 = icmp slt i32 %257, %258
  br i1 %259, label %261, label %260

260:                                              ; preds = %256
  store i32 20, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #6
  br label %271

261:                                              ; preds = %256
  %262 = load i64, ptr %17, align 8, !tbaa !12
  %263 = load i32, ptr %18, align 4, !tbaa !5
  %264 = sext i32 %263 to i64
  %265 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @g, i64 noundef %264) #6
  %266 = load i64, ptr %265, align 8, !tbaa !12
  %267 = call noundef i64 @_ZSt5__gcdIxET_S0_S0_(i64 noundef %262, i64 noundef %266)
  store i64 %267, ptr %17, align 8, !tbaa !12
  br label %268

268:                                              ; preds = %261
  %269 = load i32, ptr %18, align 4, !tbaa !5
  %270 = add nsw i32 %269, 1
  store i32 %270, ptr %18, align 4, !tbaa !5
  br label %256, !llvm.loop !22

271:                                              ; preds = %260
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #6
  store i32 1, ptr %19, align 4, !tbaa !5
  br label %272

272:                                              ; preds = %315, %271
  %273 = load i32, ptr %19, align 4, !tbaa !5
  %274 = load i32, ptr @rc, align 4, !tbaa !5
  %275 = icmp slt i32 %273, %274
  br i1 %275, label %277, label %276

276:                                              ; preds = %272
  store i32 23, ptr %4, align 4
  br label %318

277:                                              ; preds = %272
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #6
  %278 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @g, i64 noundef 0) #6
  %279 = load i64, ptr %278, align 8, !tbaa !12
  %280 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @g, i64 noundef 0) #6
  %281 = load i64, ptr %280, align 8, !tbaa !12
  %282 = load i32, ptr %19, align 4, !tbaa !5
  %283 = sext i32 %282 to i64
  %284 = getelementptr inbounds [200001 x %"class.std::vector"], ptr @g, i64 0, i64 %283
  %285 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %284, i64 noundef 0) #6
  %286 = load i64, ptr %285, align 8, !tbaa !12
  %287 = call noundef i64 @_ZSt5__gcdIxET_S0_S0_(i64 noundef %281, i64 noundef %286)
  %288 = sdiv i64 %279, %287
  store i64 %288, ptr %20, align 8, !tbaa !12
  %289 = load i64, ptr %16, align 8, !tbaa !12
  %290 = load i64, ptr %20, align 8, !tbaa !12
  %291 = call noundef i64 @_ZSt5__gcdIxET_S0_S0_(i64 noundef %289, i64 noundef %290)
  %292 = load i64, ptr %20, align 8, !tbaa !12
  %293 = sdiv i64 %292, %291
  store i64 %293, ptr %20, align 8, !tbaa !12
  %294 = load i64, ptr %17, align 8, !tbaa !12
  %295 = load i64, ptr %16, align 8, !tbaa !12
  %296 = sdiv i64 %294, %295
  %297 = load i64, ptr %20, align 8, !tbaa !12
  %298 = icmp slt i64 %296, %297
  br i1 %298, label %306, label %299

299:                                              ; preds = %277
  %300 = load i64, ptr %17, align 8, !tbaa !12
  %301 = load i64, ptr %16, align 8, !tbaa !12
  %302 = load i64, ptr %20, align 8, !tbaa !12
  %303 = mul nsw i64 %301, %302
  %304 = srem i64 %300, %303
  %305 = icmp ne i64 %304, 0
  br i1 %305, label %306, label %308

306:                                              ; preds = %299, %277
  %307 = call i32 @puts(ptr noundef @.str.3)
  store i32 0, ptr %1, align 4
  store i32 1, ptr %4, align 4
  br label %312

308:                                              ; preds = %299
  %309 = load i64, ptr %20, align 8, !tbaa !12
  %310 = load i64, ptr %16, align 8, !tbaa !12
  %311 = mul nsw i64 %310, %309
  store i64 %311, ptr %16, align 8, !tbaa !12
  store i32 0, ptr %4, align 4
  br label %312

312:                                              ; preds = %308, %306
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #6
  %313 = load i32, ptr %4, align 4
  switch i32 %313, label %318 [
    i32 0, label %314
  ]

314:                                              ; preds = %312
  br label %315

315:                                              ; preds = %314
  %316 = load i32, ptr %19, align 4, !tbaa !5
  %317 = add nsw i32 %316, 1
  store i32 %317, ptr %19, align 4, !tbaa !5
  br label %272, !llvm.loop !23

318:                                              ; preds = %312, %276
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #6
  %319 = load i32, ptr %4, align 4
  switch i32 %319, label %355 [
    i32 23, label %320
  ]

320:                                              ; preds = %318
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #6
  store i32 0, ptr %21, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #6
  %321 = load i64, ptr %17, align 8, !tbaa !12
  %322 = load i64, ptr %16, align 8, !tbaa !12
  %323 = sdiv i64 %321, %322
  store i64 %323, ptr %22, align 8, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #6
  store i64 1, ptr %23, align 8, !tbaa !12
  br label %324

324:                                              ; preds = %349, %320
  %325 = load i64, ptr %23, align 8, !tbaa !12
  %326 = load i64, ptr %23, align 8, !tbaa !12
  %327 = mul nsw i64 %325, %326
  %328 = load i64, ptr %22, align 8, !tbaa !12
  %329 = icmp sle i64 %327, %328
  br i1 %329, label %331, label %330

330:                                              ; preds = %324
  store i32 26, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #6
  br label %352

331:                                              ; preds = %324
  %332 = load i64, ptr %22, align 8, !tbaa !12
  %333 = load i64, ptr %23, align 8, !tbaa !12
  %334 = srem i64 %332, %333
  %335 = icmp ne i64 %334, 0
  br i1 %335, label %336, label %337

336:                                              ; preds = %331
  br label %349

337:                                              ; preds = %331
  %338 = load i32, ptr %21, align 4, !tbaa !5
  %339 = add nsw i32 %338, 1
  store i32 %339, ptr %21, align 4, !tbaa !5
  %340 = load i64, ptr %23, align 8, !tbaa !12
  %341 = load i64, ptr %23, align 8, !tbaa !12
  %342 = mul nsw i64 %340, %341
  %343 = load i64, ptr %22, align 8, !tbaa !12
  %344 = icmp slt i64 %342, %343
  br i1 %344, label %345, label %348

345:                                              ; preds = %337
  %346 = load i32, ptr %21, align 4, !tbaa !5
  %347 = add nsw i32 %346, 1
  store i32 %347, ptr %21, align 4, !tbaa !5
  br label %348

348:                                              ; preds = %345, %337
  br label %349

349:                                              ; preds = %348, %336
  %350 = load i64, ptr %23, align 8, !tbaa !12
  %351 = add nsw i64 %350, 1
  store i64 %351, ptr %23, align 8, !tbaa !12
  br label %324, !llvm.loop !24

352:                                              ; preds = %330
  %353 = load i32, ptr %21, align 4, !tbaa !5
  %354 = call i32 (ptr, ...) @printf(ptr noundef @.str.4, i32 noundef %353)
  store i32 0, ptr %1, align 4
  store i32 1, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #6
  br label %355

355:                                              ; preds = %352, %318
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #6
  br label %356

356:                                              ; preds = %355, %251, %96
  %357 = load i32, ptr %1, align 4
  ret i32 %357

358:                                              ; preds = %251
  unreachable
}

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIPxEvT_S1_(ptr noundef, ptr noundef) #3

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

declare i32 @puts(ptr noundef) #1

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

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

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

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

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

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


; 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"

%struct.Edge = type { i64, i64, i64 }
%"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 }

@n = external dso_local global i32, align 4
@rc = external dso_local local_unnamed_addr global i32, align 4
@cc = external dso_local local_unnamed_addr global i32, align 4
@row = external dso_local global [200001 x i64], align 16
@col = external dso_local global [200001 x i64], align 16
@e = external dso_local global [200001 x %struct.Edge], align 16
@g = external dso_local global [200001 x %"class.std::vector"], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca i64, align 8
  %2 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n)
  %3 = load i32, ptr @n, align 4, !tbaa !5
  %4 = icmp sgt i32 %3, 0
  br i1 %4, label %.lr.ph, label %.._crit_edge_crit_edge

.._crit_edge_crit_edge:                           ; preds = %0
  %.pre = load i32, ptr @rc, align 4, !tbaa !5
  br label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %.._crit_edge_crit_edge
  %5 = phi i32 [ %.pre, %.._crit_edge_crit_edge ], [ %41, %.lr.ph ]
  %6 = sext i32 %5 to i64
  %7 = getelementptr inbounds i64, ptr @row, i64 %6
  tail call void @_ZSt4sortIPxEvT_S1_(ptr noundef nonnull @row, ptr noundef nonnull %7)
  %8 = load i32, ptr @rc, align 4, !tbaa !5
  %9 = sext i32 %8 to i64
  %10 = getelementptr inbounds i64, ptr @row, i64 %9
  %11 = tail call noundef ptr @_ZSt6uniqueIPxET_S1_S1_(ptr noundef nonnull @row, ptr noundef nonnull %10)
  %12 = ptrtoint ptr %11 to i64
  %13 = sub i64 %12, ptrtoint (ptr @row to i64)
  %14 = lshr exact i64 %13, 3
  %15 = trunc i64 %14 to i32
  store i32 %15, ptr @rc, align 4, !tbaa !5
  %16 = load i32, ptr @cc, align 4, !tbaa !5
  %17 = sext i32 %16 to i64
  %18 = getelementptr inbounds i64, ptr @col, i64 %17
  tail call void @_ZSt4sortIPxEvT_S1_(ptr noundef nonnull @col, ptr noundef nonnull %18)
  %19 = load i32, ptr @cc, align 4, !tbaa !5
  %20 = sext i32 %19 to i64
  %21 = getelementptr inbounds i64, ptr @col, i64 %20
  %22 = tail call noundef ptr @_ZSt6uniqueIPxET_S1_S1_(ptr noundef nonnull @col, ptr noundef nonnull %21)
  %23 = ptrtoint ptr %22 to i64
  %24 = sub i64 %23, ptrtoint (ptr @col to i64)
  %25 = lshr exact i64 %24, 3
  %26 = trunc i64 %25 to i32
  store i32 %26, ptr @cc, align 4, !tbaa !5
  %27 = load i32, ptr @rc, align 4, !tbaa !5
  %28 = sext i32 %27 to i64
  %sext = shl i64 %24, 29
  %29 = ashr i64 %sext, 32
  %30 = mul nsw i64 %29, %28
  %31 = load i32, ptr @n, align 4, !tbaa !5
  %32 = sext i32 %31 to i64
  %.not = icmp eq i64 %30, %32
  br i1 %.not, label %.preheader131, label %52

.preheader131:                                    ; preds = %._crit_edge
  %33 = icmp sgt i32 %27, 0
  %34 = icmp sgt i32 %26, 0
  %or.cond = select i1 %33, i1 %34, i1 false
  br i1 %or.cond, label %.preheader130, label %.preheader129

.lr.ph:                                           ; preds = %0, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %0 ]
  %35 = getelementptr inbounds [200001 x %struct.Edge], ptr @e, i64 0, i64 %indvars.iv
  %36 = getelementptr inbounds i8, ptr %35, i64 8
  %37 = getelementptr inbounds i8, ptr %35, i64 16
  %38 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %35, ptr noundef nonnull %36, ptr noundef nonnull %37)
  %39 = load i64, ptr %35, align 8, !tbaa !9
  %40 = load i32, ptr @rc, align 4, !tbaa !5
  %41 = add nsw i32 %40, 1
  store i32 %41, ptr @rc, align 4, !tbaa !5
  %42 = sext i32 %40 to i64
  %43 = getelementptr inbounds [200001 x i64], ptr @row, i64 0, i64 %42
  store i64 %39, ptr %43, align 8, !tbaa !12
  %44 = load i64, ptr %36, align 8, !tbaa !13
  %45 = load i32, ptr @cc, align 4, !tbaa !5
  %46 = add nsw i32 %45, 1
  store i32 %46, ptr @cc, align 4, !tbaa !5
  %47 = sext i32 %45 to i64
  %48 = getelementptr inbounds [200001 x i64], ptr @col, i64 0, i64 %47
  store i64 %44, ptr %48, align 8, !tbaa !12
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %49 = load i32, ptr @n, align 4, !tbaa !5
  %50 = sext i32 %49 to i64
  %51 = icmp slt i64 %indvars.iv.next, %50
  br i1 %51, label %.lr.ph, label %._crit_edge, !llvm.loop !14

52:                                               ; preds = %._crit_edge
  %53 = tail call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.3)
  br label %165

.preheader130:                                    ; preds = %.preheader131, %._crit_edge136
  %54 = phi i32 [ %61, %._crit_edge136 ], [ %27, %.preheader131 ]
  %55 = phi i32 [ %62, %._crit_edge136 ], [ %26, %.preheader131 ]
  %indvars.iv167 = phi i64 [ %indvars.iv.next168, %._crit_edge136 ], [ 0, %.preheader131 ]
  %56 = icmp sgt i32 %55, 0
  br i1 %56, label %.lr.ph135, label %._crit_edge136

.lr.ph135:                                        ; preds = %.preheader130
  %57 = getelementptr inbounds [200001 x %"class.std::vector"], ptr @g, i64 0, i64 %indvars.iv167
  br label %65

.preheader129.loopexit:                           ; preds = %._crit_edge136
  %.pre186 = load i32, ptr @n, align 4, !tbaa !5
  br label %.preheader129

.preheader129:                                    ; preds = %.preheader129.loopexit, %.preheader131
  %58 = phi i32 [ %61, %.preheader129.loopexit ], [ %27, %.preheader131 ]
  %59 = phi i32 [ %.pre186, %.preheader129.loopexit ], [ %31, %.preheader131 ]
  %60 = icmp sgt i32 %59, 0
  br i1 %60, label %.lr.ph139, label %.preheader128

._crit_edge136.loopexit:                          ; preds = %65
  %.pre185 = load i32, ptr @rc, align 4, !tbaa !5
  br label %._crit_edge136

._crit_edge136:                                   ; preds = %._crit_edge136.loopexit, %.preheader130
  %61 = phi i32 [ %.pre185, %._crit_edge136.loopexit ], [ %54, %.preheader130 ]
  %62 = phi i32 [ %67, %._crit_edge136.loopexit ], [ %55, %.preheader130 ]
  %indvars.iv.next168 = add nuw nsw i64 %indvars.iv167, 1
  %63 = sext i32 %61 to i64
  %64 = icmp slt i64 %indvars.iv.next168, %63
  br i1 %64, label %.preheader130, label %.preheader129.loopexit, !llvm.loop !16

65:                                               ; preds = %.lr.ph135, %65
  %.0102134 = phi i32 [ 0, %.lr.ph135 ], [ %66, %65 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #6
  store i64 0, ptr %1, align 8, !tbaa !12
  call void @_ZNSt6vectorIxSaIxEE9push_backEOx(ptr noundef nonnull align 8 dereferenceable(24) %57, ptr noundef nonnull align 8 dereferenceable(8) %1)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #6
  %66 = add nuw nsw i32 %.0102134, 1
  %67 = load i32, ptr @cc, align 4, !tbaa !5
  %68 = icmp slt i32 %66, %67
  br i1 %68, label %65, label %._crit_edge136.loopexit, !llvm.loop !18

.preheader128.loopexit:                           ; preds = %.lr.ph139
  %.pre187 = load i32, ptr @rc, align 4, !tbaa !5
  br label %.preheader128

.preheader128:                                    ; preds = %.preheader128.loopexit, %.preheader129
  %69 = phi i32 [ %.pre187, %.preheader128.loopexit ], [ %58, %.preheader129 ]
  %70 = icmp sgt i32 %69, 1
  %71 = load i32, ptr @cc, align 4
  %72 = icmp sgt i32 %71, 1
  %or.cond195 = select i1 %70, i1 %72, i1 false
  br i1 %or.cond195, label %.preheader127, label %._crit_edge145

.lr.ph139:                                        ; preds = %.preheader129, %.lr.ph139
  %indvars.iv170 = phi i64 [ %indvars.iv.next171, %.lr.ph139 ], [ 0, %.preheader129 ]
  %73 = load i32, ptr @rc, align 4, !tbaa !5
  %74 = sext i32 %73 to i64
  %75 = getelementptr inbounds i64, ptr @row, i64 %74
  %76 = getelementptr inbounds [200001 x %struct.Edge], ptr @e, i64 0, i64 %indvars.iv170
  %77 = call noundef ptr @_ZSt11lower_boundIPxxET_S1_S1_RKT0_(ptr noundef nonnull @row, ptr noundef nonnull %75, ptr noundef nonnull align 8 dereferenceable(8) %76)
  %78 = ptrtoint ptr %77 to i64
  %79 = sub i64 %78, ptrtoint (ptr @row to i64)
  %80 = ashr exact i64 %79, 3
  store i64 %80, ptr %76, align 8, !tbaa !9
  %81 = load i32, ptr @cc, align 4, !tbaa !5
  %82 = sext i32 %81 to i64
  %83 = getelementptr inbounds i64, ptr @col, i64 %82
  %84 = getelementptr inbounds i8, ptr %76, i64 8
  %85 = call noundef ptr @_ZSt11lower_boundIPxxET_S1_S1_RKT0_(ptr noundef nonnull @col, ptr noundef nonnull %83, ptr noundef nonnull align 8 dereferenceable(8) %84)
  %86 = ptrtoint ptr %85 to i64
  %87 = sub i64 %86, ptrtoint (ptr @col to i64)
  %88 = ashr exact i64 %87, 3
  store i64 %88, ptr %84, align 8, !tbaa !13
  %89 = getelementptr inbounds i8, ptr %76, i64 16
  %90 = load i64, ptr %89, align 8, !tbaa !19
  %91 = load i64, ptr %76, align 8, !tbaa !9
  %92 = getelementptr inbounds [200001 x %"class.std::vector"], ptr @g, i64 0, i64 %91
  %93 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %92, i64 noundef %88) #6
  %94 = load i64, ptr %93, align 8, !tbaa !12
  %95 = add nsw i64 %94, %90
  store i64 %95, ptr %93, align 8, !tbaa !12
  %indvars.iv.next171 = add nuw nsw i64 %indvars.iv170, 1
  %96 = load i32, ptr @n, align 4, !tbaa !5
  %97 = sext i32 %96 to i64
  %98 = icmp slt i64 %indvars.iv.next171, %97
  br i1 %98, label %.lr.ph139, label %.preheader128.loopexit, !llvm.loop !20

.preheader127:                                    ; preds = %.preheader128, %._crit_edge143
  %99 = phi i32 [ %121, %._crit_edge143 ], [ %69, %.preheader128 ]
  %100 = phi i32 [ %122, %._crit_edge143 ], [ %71, %.preheader128 ]
  %indvars.iv176 = phi i64 [ %indvars.iv.next177, %._crit_edge143 ], [ 1, %.preheader128 ]
  %.not111140 = icmp sgt i32 %100, 1
  br i1 %.not111140, label %.lr.ph142, label %._crit_edge143

.lr.ph142:                                        ; preds = %.preheader127
  %101 = getelementptr inbounds [200001 x %"class.std::vector"], ptr @g, i64 0, i64 %indvars.iv176
  br label %105

102:                                              ; preds = %118
  %indvars.iv.next174 = add nuw nsw i64 %indvars.iv173, 1
  %103 = load i32, ptr @cc, align 4, !tbaa !5
  %104 = sext i32 %103 to i64
  %.not111 = icmp slt i64 %indvars.iv.next174, %104
  br i1 %.not111, label %105, label %._crit_edge143.loopexit, !llvm.loop !21

105:                                              ; preds = %.lr.ph142, %102
  %indvars.iv173 = phi i64 [ 1, %.lr.ph142 ], [ %indvars.iv.next174, %102 ]
  %106 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @g, i64 noundef 0) #6
  %107 = load i64, ptr %106, align 8, !tbaa !12
  %108 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %101, i64 noundef 0) #6
  %109 = load i64, ptr %108, align 8, !tbaa !12
  %110 = call noundef i64 @_ZSt5__gcdIxET_S0_S0_(i64 noundef %107, i64 noundef %109)
  %111 = sdiv i64 %107, %110
  %112 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @g, i64 noundef %indvars.iv173) #6
  %113 = load i64, ptr %112, align 8, !tbaa !12
  %114 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %101, i64 noundef %indvars.iv173) #6
  %115 = load i64, ptr %114, align 8, !tbaa !12
  %116 = call noundef i64 @_ZSt5__gcdIxET_S0_S0_(i64 noundef %113, i64 noundef %115)
  %117 = sdiv i64 %113, %116
  %.not109 = icmp eq i64 %111, %117
  br i1 %.not109, label %118, label %125

118:                                              ; preds = %105
  %119 = sdiv i64 %115, %116
  %120 = sdiv i64 %109, %110
  %.not110 = icmp eq i64 %120, %119
  br i1 %.not110, label %102, label %125

._crit_edge143.loopexit:                          ; preds = %102
  %.pre188 = load i32, ptr @rc, align 4, !tbaa !5
  br label %._crit_edge143

._crit_edge143:                                   ; preds = %._crit_edge143.loopexit, %.preheader127
  %121 = phi i32 [ %.pre188, %._crit_edge143.loopexit ], [ %99, %.preheader127 ]
  %122 = phi i32 [ %103, %._crit_edge143.loopexit ], [ %100, %.preheader127 ]
  %indvars.iv.next177 = add nuw nsw i64 %indvars.iv176, 1
  %123 = sext i32 %121 to i64
  %124 = icmp slt i64 %indvars.iv.next177, %123
  br i1 %124, label %.preheader127, label %._crit_edge145, !llvm.loop !22

125:                                              ; preds = %105, %118
  %126 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.3)
  br label %165

._crit_edge145:                                   ; preds = %._crit_edge143, %.preheader128
  %127 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @g, i64 noundef 0) #6
  %128 = load i64, ptr %127, align 8, !tbaa !12
  %129 = load i32, ptr @cc, align 4, !tbaa !5
  %130 = icmp sgt i32 %129, 1
  br i1 %130, label %.lr.ph149, label %.preheader

.preheader:                                       ; preds = %.lr.ph149, %._crit_edge145
  %.091.lcssa = phi i64 [ %128, %._crit_edge145 ], [ %134, %.lr.ph149 ]
  %131 = load i32, ptr @rc, align 4, !tbaa !5
  %.not113150 = icmp sgt i32 %131, 1
  br i1 %.not113150, label %.lr.ph153, label %._crit_edge154

.lr.ph149:                                        ; preds = %._crit_edge145, %.lr.ph149
  %indvars.iv179 = phi i64 [ %indvars.iv.next180, %.lr.ph149 ], [ 1, %._crit_edge145 ]
  %.091146 = phi i64 [ %134, %.lr.ph149 ], [ %128, %._crit_edge145 ]
  %132 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @g, i64 noundef %indvars.iv179) #6
  %133 = load i64, ptr %132, align 8, !tbaa !12
  %134 = call noundef i64 @_ZSt5__gcdIxET_S0_S0_(i64 noundef %.091146, i64 noundef %133)
  %indvars.iv.next180 = add nuw nsw i64 %indvars.iv179, 1
  %135 = load i32, ptr @cc, align 4, !tbaa !5
  %136 = sext i32 %135 to i64
  %137 = icmp slt i64 %indvars.iv.next180, %136
  br i1 %137, label %.lr.ph149, label %.preheader, !llvm.loop !23

138:                                              ; preds = %154
  %indvars.iv.next183 = add nuw nsw i64 %indvars.iv182, 1
  %139 = load i32, ptr @rc, align 4, !tbaa !5
  %140 = sext i32 %139 to i64
  %.not113 = icmp slt i64 %indvars.iv.next183, %140
  br i1 %.not113, label %.lr.ph153, label %._crit_edge154, !llvm.loop !24

.lr.ph153:                                        ; preds = %.preheader, %138
  %indvars.iv182 = phi i64 [ %indvars.iv.next183, %138 ], [ 1, %.preheader ]
  %.092151 = phi i64 [ %155, %138 ], [ 1, %.preheader ]
  %141 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @g, i64 noundef 0) #6
  %142 = load i64, ptr %141, align 8, !tbaa !12
  %143 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @g, i64 noundef 0) #6
  %144 = load i64, ptr %143, align 8, !tbaa !12
  %145 = getelementptr inbounds [200001 x %"class.std::vector"], ptr @g, i64 0, i64 %indvars.iv182
  %146 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %145, i64 noundef 0) #6
  %147 = load i64, ptr %146, align 8, !tbaa !12
  %148 = call noundef i64 @_ZSt5__gcdIxET_S0_S0_(i64 noundef %144, i64 noundef %147)
  %149 = sdiv i64 %142, %148
  %150 = call noundef i64 @_ZSt5__gcdIxET_S0_S0_(i64 noundef %.092151, i64 noundef %149)
  %151 = sdiv i64 %149, %150
  %152 = sdiv i64 %.091.lcssa, %.092151
  %153 = icmp slt i64 %152, %151
  br i1 %153, label %.thread125, label %154

154:                                              ; preds = %.lr.ph153
  %155 = mul nsw i64 %151, %.092151
  %156 = srem i64 %.091.lcssa, %155
  %.not112 = icmp eq i64 %156, 0
  br i1 %.not112, label %138, label %.thread125

.thread125:                                       ; preds = %154, %.lr.ph153
  %157 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.3)
  br label %165

._crit_edge154:                                   ; preds = %138, %.preheader
  %.092.lcssa = phi i64 [ 1, %.preheader ], [ %155, %138 ]
  %158 = sdiv i64 %.091.lcssa, %.092.lcssa
  %.not114156 = icmp slt i64 %158, 1
  br i1 %.not114156, label %._crit_edge161, label %.lr.ph160

._crit_edge161:                                   ; preds = %.lr.ph160, %._crit_edge154
  %.087.lcssa = phi i32 [ 0, %._crit_edge154 ], [ %.188, %.lr.ph160 ]
  %159 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef %.087.lcssa)
  br label %165

.lr.ph160:                                        ; preds = %._crit_edge154, %.lr.ph160
  %160 = phi i64 [ %164, %.lr.ph160 ], [ 1, %._crit_edge154 ]
  %.0158 = phi i64 [ %163, %.lr.ph160 ], [ 1, %._crit_edge154 ]
  %.087157 = phi i32 [ %.188, %.lr.ph160 ], [ 0, %._crit_edge154 ]
  %161 = urem i64 %158, %.0158
  %.not115 = icmp eq i64 %161, 0
  %162 = icmp slt i64 %160, %158
  %spec.select.v = select i1 %162, i32 2, i32 1
  %spec.select = select i1 %.not115, i32 %spec.select.v, i32 0
  %.188 = add nuw nsw i32 %spec.select, %.087157
  %163 = add nuw nsw i64 %.0158, 1
  %164 = mul nuw nsw i64 %163, %163
  %.not114 = icmp sgt i64 %164, %158
  br i1 %.not114, label %._crit_edge161, label %.lr.ph160, !llvm.loop !25

165:                                              ; preds = %.thread125, %125, %._crit_edge161, %52
  ret i32 0
}

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIPxEvT_S1_(ptr noundef, ptr noundef) local_unnamed_addr #3

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

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

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

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

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

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

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

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


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