; LLVM IR from VastoLorde95/Competitive-Programming :: Codeforces/208 Division 2/Problem E/E.ll (Z2goiii)

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

%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.0" = type { %"struct.std::_Vector_base.1" }
%"struct.std::_Vector_base.1" = type { %"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::queue" = type { %"class.std::deque" }
%"class.std::deque" = type { %"class.std::_Deque_base" }
%"class.std::_Deque_base" = type { %"struct.std::_Deque_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Deque_impl" }
%"struct.std::_Deque_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Deque_impl" = type { %"struct.std::_Deque_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Deque_impl_data" }
%"struct.std::_Deque_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Deque_impl_data" = type { ptr, i64, %"struct.std::_Deque_iterator", %"struct.std::_Deque_iterator" }
%"struct.std::_Deque_iterator" = type { ptr, ptr, ptr, ptr }
%"struct.std::pair" = type { i32, i32 }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }

@g = external dso_local global [1010 x [1010 x i32]], align 16
@vis = external dso_local global [1010 x [1010 x i32]], align 16
@deg = external dso_local global [1010 x [1010 x i32]], align 16
@in = external dso_local global [1010 x [1010 x i32]], align 16
@tot = external dso_local global i32, align 4
@ans = external dso_local global %"class.std::vector", align 8
@dx = external dso_local global [4 x i32], align 16
@dy = external dso_local global [4 x i32], align 16

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_Z7inrangeii(i32 noundef, i32 noundef) #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z3getiiii(i32 noundef, i32 noundef, i32 noundef, i32 noundef) #0

; Function Attrs: mustprogress uwtable
define dso_local void @_Z2goiii(i32 noundef %0, i32 noundef %1, i32 noundef %2) #1 personality ptr @__gxx_personality_v0 {
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca %"class.std::vector.0", align 8
  %8 = alloca %"class.std::queue", align 8
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca %"struct.std::pair", align 4
  %13 = alloca %"struct.std::pair", align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca %"struct.std::pair", align 4
  %19 = alloca i8, align 1
  %20 = alloca i32, align 4
  %21 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %22 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %23 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %24 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  store i32 %0, ptr %4, align 4, !tbaa !5
  store i32 %1, ptr %5, align 4, !tbaa !5
  store i32 %2, ptr %6, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 24, ptr %7) #4
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %7) #4
  call void @llvm.lifetime.start.p0(i64 80, ptr %8) #4
  invoke void @_ZNSt5queueISt4pairIiiESt5dequeIS1_SaIS1_EEEC2IS4_vEEv(ptr noundef nonnull align 8 dereferenceable(80) %8)
          to label %25 unwind label %58

25:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #4
  store i32 1, ptr %11, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #4
  %26 = invoke i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %5, ptr noundef nonnull align 4 dereferenceable(4) %6)
          to label %27 unwind label %62

27:                                               ; preds = %25
  store i64 %26, ptr %12, align 4
  invoke void @_ZNSt5queueISt4pairIiiESt5dequeIS1_SaIS1_EEE4pushEOS1_(ptr noundef nonnull align 8 dereferenceable(80) %8, ptr noundef nonnull align 4 dereferenceable(8) %12)
          to label %28 unwind label %62

28:                                               ; preds = %27
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #4
  %29 = load i32, ptr %5, align 4, !tbaa !5
  %30 = sext i32 %29 to i64
  %31 = getelementptr inbounds [1010 x [1010 x i32]], ptr @in, i64 0, i64 %30
  %32 = load i32, ptr %6, align 4, !tbaa !5
  %33 = sext i32 %32 to i64
  %34 = getelementptr inbounds [1010 x i32], ptr %31, i64 0, i64 %33
  store i32 1, ptr %34, align 4, !tbaa !5
  br label %35

35:                                               ; preds = %189, %57, %28
  %36 = invoke noundef zeroext i1 @_ZNKSt5queueISt4pairIiiESt5dequeIS1_SaIS1_EEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %8)
          to label %37 unwind label %66

37:                                               ; preds = %35
  %38 = xor i1 %36, true
  br i1 %38, label %39, label %190

39:                                               ; preds = %37
  %40 = invoke noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt5queueISt4pairIiiESt5dequeIS1_SaIS1_EEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) %8)
          to label %41 unwind label %66

41:                                               ; preds = %39
  %42 = getelementptr inbounds %"struct.std::pair", ptr %40, i32 0, i32 0
  %43 = load i32, ptr %42, align 4, !tbaa !9
  store i32 %43, ptr %5, align 4, !tbaa !5
  %44 = invoke noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt5queueISt4pairIiiESt5dequeIS1_SaIS1_EEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) %8)
          to label %45 unwind label %66

45:                                               ; preds = %41
  %46 = getelementptr inbounds %"struct.std::pair", ptr %44, i32 0, i32 1
  %47 = load i32, ptr %46, align 4, !tbaa !11
  store i32 %47, ptr %6, align 4, !tbaa !5
  invoke void @_ZNSt5queueISt4pairIiiESt5dequeIS1_SaIS1_EEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %8)
          to label %48 unwind label %66

48:                                               ; preds = %45
  %49 = load i32, ptr %5, align 4, !tbaa !5
  %50 = sext i32 %49 to i64
  %51 = getelementptr inbounds [1010 x [1010 x i32]], ptr @vis, i64 0, i64 %50
  %52 = load i32, ptr %6, align 4, !tbaa !5
  %53 = sext i32 %52 to i64
  %54 = getelementptr inbounds [1010 x i32], ptr %51, i64 0, i64 %53
  %55 = load i32, ptr %54, align 4, !tbaa !5
  %56 = icmp ne i32 %55, 0
  br i1 %56, label %57, label %70

57:                                               ; preds = %48
  br label %35, !llvm.loop !12

58:                                               ; preds = %3
  %59 = landingpad { ptr, i32 }
          cleanup
  %60 = extractvalue { ptr, i32 } %59, 0
  store ptr %60, ptr %9, align 8
  %61 = extractvalue { ptr, i32 } %59, 1
  store i32 %61, ptr %10, align 4
  br label %275

62:                                               ; preds = %27, %25
  %63 = landingpad { ptr, i32 }
          cleanup
  %64 = extractvalue { ptr, i32 } %63, 0
  store ptr %64, ptr %9, align 8
  %65 = extractvalue { ptr, i32 } %63, 1
  store i32 %65, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #4
  br label %274

66:                                               ; preds = %45, %41, %39, %35
  %67 = landingpad { ptr, i32 }
          cleanup
  %68 = extractvalue { ptr, i32 } %67, 0
  store ptr %68, ptr %9, align 8
  %69 = extractvalue { ptr, i32 } %67, 1
  store i32 %69, ptr %10, align 4
  br label %274

70:                                               ; preds = %48
  %71 = load i32, ptr %5, align 4, !tbaa !5
  %72 = sext i32 %71 to i64
  %73 = getelementptr inbounds [1010 x [1010 x i32]], ptr @vis, i64 0, i64 %72
  %74 = load i32, ptr %6, align 4, !tbaa !5
  %75 = sext i32 %74 to i64
  %76 = getelementptr inbounds [1010 x i32], ptr %73, i64 0, i64 %75
  store i32 1, ptr %76, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #4
  %77 = invoke i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %5, ptr noundef nonnull align 4 dereferenceable(4) %6)
          to label %78 unwind label %84

78:                                               ; preds = %70
  store i64 %77, ptr %13, align 4
  invoke void @_ZNSt6vectorISt4pairIiiESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %7, ptr noundef nonnull align 4 dereferenceable(8) %13)
          to label %79 unwind label %84

79:                                               ; preds = %78
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #4
  store i32 0, ptr %14, align 4, !tbaa !5
  br label %80

80:                                               ; preds = %182, %79
  %81 = load i32, ptr %14, align 4, !tbaa !5
  %82 = icmp slt i32 %81, 4
  br i1 %82, label %88, label %83

83:                                               ; preds = %80
  store i32 4, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #4
  br label %189

84:                                               ; preds = %78, %70
  %85 = landingpad { ptr, i32 }
          cleanup
  %86 = extractvalue { ptr, i32 } %85, 0
  store ptr %86, ptr %9, align 8
  %87 = extractvalue { ptr, i32 } %85, 1
  store i32 %87, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #4
  br label %274

88:                                               ; preds = %80
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #4
  %89 = load i32, ptr %5, align 4, !tbaa !5
  %90 = load i32, ptr %4, align 4, !tbaa !5
  %91 = load i32, ptr %14, align 4, !tbaa !5
  %92 = sext i32 %91 to i64
  %93 = getelementptr inbounds [4 x i32], ptr @dx, i64 0, i64 %92
  %94 = load i32, ptr %93, align 4, !tbaa !5
  %95 = mul nsw i32 %90, %94
  %96 = add nsw i32 %89, %95
  store i32 %96, ptr %16, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #4
  %97 = load i32, ptr %6, align 4, !tbaa !5
  %98 = load i32, ptr %4, align 4, !tbaa !5
  %99 = load i32, ptr %14, align 4, !tbaa !5
  %100 = sext i32 %99 to i64
  %101 = getelementptr inbounds [4 x i32], ptr @dy, i64 0, i64 %100
  %102 = load i32, ptr %101, align 4, !tbaa !5
  %103 = mul nsw i32 %98, %102
  %104 = add nsw i32 %97, %103
  store i32 %104, ptr %17, align 4, !tbaa !5
  %105 = load i32, ptr %16, align 4, !tbaa !5
  %106 = load i32, ptr %17, align 4, !tbaa !5
  %107 = call noundef zeroext i1 @_Z7inrangeii(i32 noundef %105, i32 noundef %106)
  br i1 %107, label %109, label %108

108:                                              ; preds = %88
  store i32 6, ptr %15, align 4
  br label %179

109:                                              ; preds = %88
  %110 = load i32, ptr %16, align 4, !tbaa !5
  %111 = sext i32 %110 to i64
  %112 = getelementptr inbounds [1010 x [1010 x i32]], ptr @g, i64 0, i64 %111
  %113 = load i32, ptr %17, align 4, !tbaa !5
  %114 = sext i32 %113 to i64
  %115 = getelementptr inbounds [1010 x i32], ptr %112, i64 0, i64 %114
  %116 = load i32, ptr %115, align 4, !tbaa !5
  %117 = icmp ne i32 %116, 0
  br i1 %117, label %119, label %118

118:                                              ; preds = %109
  store i32 6, ptr %15, align 4
  br label %179

119:                                              ; preds = %109
  %120 = load i32, ptr %16, align 4, !tbaa !5
  %121 = sext i32 %120 to i64
  %122 = getelementptr inbounds [1010 x [1010 x i32]], ptr @vis, i64 0, i64 %121
  %123 = load i32, ptr %17, align 4, !tbaa !5
  %124 = sext i32 %123 to i64
  %125 = getelementptr inbounds [1010 x i32], ptr %122, i64 0, i64 %124
  %126 = load i32, ptr %125, align 4, !tbaa !5
  %127 = icmp ne i32 %126, 0
  br i1 %127, label %128, label %129

128:                                              ; preds = %119
  store i32 6, ptr %15, align 4
  br label %179

129:                                              ; preds = %119
  %130 = load i32, ptr %5, align 4, !tbaa !5
  %131 = load i32, ptr %6, align 4, !tbaa !5
  %132 = load i32, ptr %16, align 4, !tbaa !5
  %133 = load i32, ptr %17, align 4, !tbaa !5
  %134 = call noundef i32 @_Z3getiiii(i32 noundef %130, i32 noundef %131, i32 noundef %132, i32 noundef %133)
  %135 = load i32, ptr %4, align 4, !tbaa !5
  %136 = icmp ne i32 %134, %135
  br i1 %136, label %137, label %138

137:                                              ; preds = %129
  store i32 6, ptr %15, align 4
  br label %179

138:                                              ; preds = %129
  %139 = load i32, ptr %5, align 4, !tbaa !5
  %140 = sext i32 %139 to i64
  %141 = getelementptr inbounds [1010 x [1010 x i32]], ptr @deg, i64 0, i64 %140
  %142 = load i32, ptr %6, align 4, !tbaa !5
  %143 = sext i32 %142 to i64
  %144 = getelementptr inbounds [1010 x i32], ptr %141, i64 0, i64 %143
  %145 = load i32, ptr %144, align 4, !tbaa !5
  %146 = add nsw i32 %145, 1
  store i32 %146, ptr %144, align 4, !tbaa !5
  %147 = load i32, ptr %16, align 4, !tbaa !5
  %148 = sext i32 %147 to i64
  %149 = getelementptr inbounds [1010 x [1010 x i32]], ptr @deg, i64 0, i64 %148
  %150 = load i32, ptr %17, align 4, !tbaa !5
  %151 = sext i32 %150 to i64
  %152 = getelementptr inbounds [1010 x i32], ptr %149, i64 0, i64 %151
  %153 = load i32, ptr %152, align 4, !tbaa !5
  %154 = add nsw i32 %153, 1
  store i32 %154, ptr %152, align 4, !tbaa !5
  %155 = load i32, ptr %4, align 4, !tbaa !5
  %156 = load i32, ptr %11, align 4, !tbaa !5
  %157 = add nsw i32 %156, %155
  store i32 %157, ptr %11, align 4, !tbaa !5
  %158 = load i32, ptr %16, align 4, !tbaa !5
  %159 = sext i32 %158 to i64
  %160 = getelementptr inbounds [1010 x [1010 x i32]], ptr @in, i64 0, i64 %159
  %161 = load i32, ptr %17, align 4, !tbaa !5
  %162 = sext i32 %161 to i64
  %163 = getelementptr inbounds [1010 x i32], ptr %160, i64 0, i64 %162
  %164 = load i32, ptr %163, align 4, !tbaa !5
  %165 = icmp ne i32 %164, 0
  br i1 %165, label %166, label %169

166:                                              ; preds = %138
  %167 = load i32, ptr %11, align 4, !tbaa !5
  %168 = add nsw i32 %167, -1
  store i32 %168, ptr %11, align 4, !tbaa !5
  br label %169

169:                                              ; preds = %166, %138
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #4
  %170 = invoke i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %16, ptr noundef nonnull align 4 dereferenceable(4) %17)
          to label %171 unwind label %185

171:                                              ; preds = %169
  store i64 %170, ptr %18, align 4
  invoke void @_ZNSt5queueISt4pairIiiESt5dequeIS1_SaIS1_EEE4pushEOS1_(ptr noundef nonnull align 8 dereferenceable(80) %8, ptr noundef nonnull align 4 dereferenceable(8) %18)
          to label %172 unwind label %185

172:                                              ; preds = %171
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #4
  %173 = load i32, ptr %16, align 4, !tbaa !5
  %174 = sext i32 %173 to i64
  %175 = getelementptr inbounds [1010 x [1010 x i32]], ptr @in, i64 0, i64 %174
  %176 = load i32, ptr %17, align 4, !tbaa !5
  %177 = sext i32 %176 to i64
  %178 = getelementptr inbounds [1010 x i32], ptr %175, i64 0, i64 %177
  store i32 1, ptr %178, align 4, !tbaa !5
  store i32 0, ptr %15, align 4
  br label %179

179:                                              ; preds = %172, %137, %128, %118, %108
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #4
  %180 = load i32, ptr %15, align 4
  switch i32 %180, label %281 [
    i32 0, label %181
    i32 6, label %182
  ]

181:                                              ; preds = %179
  br label %182

182:                                              ; preds = %181, %179
  %183 = load i32, ptr %14, align 4, !tbaa !5
  %184 = add nsw i32 %183, 1
  store i32 %184, ptr %14, align 4, !tbaa !5
  br label %80, !llvm.loop !14

185:                                              ; preds = %171, %169
  %186 = landingpad { ptr, i32 }
          cleanup
  %187 = extractvalue { ptr, i32 } %186, 0
  store ptr %187, ptr %9, align 8
  %188 = extractvalue { ptr, i32 } %186, 1
  store i32 %188, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #4
  br label %274

189:                                              ; preds = %83
  br label %35, !llvm.loop !12

190:                                              ; preds = %37
  call void @llvm.lifetime.start.p0(i64 1, ptr %19) #4
  store i8 1, ptr %19, align 1, !tbaa !15
  %191 = load i32, ptr %11, align 4, !tbaa !5
  %192 = load i32, ptr @tot, align 4, !tbaa !5
  %193 = icmp ne i32 %191, %192
  br i1 %193, label %194, label %195

194:                                              ; preds = %190
  store i8 0, ptr %19, align 1, !tbaa !15
  br label %195

195:                                              ; preds = %194, %190
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #4
  store i32 0, ptr %20, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #4
  %196 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %7) #4
  %197 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %21, i32 0, i32 0
  store ptr %196, ptr %197, align 8
  br label %198

198:                                              ; preds = %223, %195
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #4
  %199 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %7) #4
  %200 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %22, i32 0, i32 0
  store ptr %199, ptr %200, align 8
  %201 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairIiiESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %21, ptr noundef nonnull align 8 dereferenceable(8) %22) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #4
  br i1 %201, label %203, label %202

202:                                              ; preds = %198
  store i32 7, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #4
  br label %225

203:                                              ; preds = %198
  %204 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %21) #4
  %205 = getelementptr inbounds %"struct.std::pair", ptr %204, i32 0, i32 0
  %206 = load i32, ptr %205, align 4, !tbaa !9
  store i32 %206, ptr %5, align 4, !tbaa !5
  %207 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %21) #4
  %208 = getelementptr inbounds %"struct.std::pair", ptr %207, i32 0, i32 1
  %209 = load i32, ptr %208, align 4, !tbaa !11
  store i32 %209, ptr %6, align 4, !tbaa !5
  %210 = load i32, ptr %5, align 4, !tbaa !5
  %211 = sext i32 %210 to i64
  %212 = getelementptr inbounds [1010 x [1010 x i32]], ptr @deg, i64 0, i64 %211
  %213 = load i32, ptr %6, align 4, !tbaa !5
  %214 = sext i32 %213 to i64
  %215 = getelementptr inbounds [1010 x i32], ptr %212, i64 0, i64 %214
  %216 = load i32, ptr %215, align 4, !tbaa !5
  %217 = srem i32 %216, 2
  %218 = icmp ne i32 %217, 0
  br i1 %218, label %219, label %222

219:                                              ; preds = %203
  %220 = load i32, ptr %20, align 4, !tbaa !5
  %221 = add nsw i32 %220, 1
  store i32 %221, ptr %20, align 4, !tbaa !5
  br label %222

222:                                              ; preds = %219, %203
  br label %223

223:                                              ; preds = %222
  %224 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %21) #4
  br label %198, !llvm.loop !17

225:                                              ; preds = %202
  %226 = load i32, ptr %20, align 4, !tbaa !5
  %227 = icmp sgt i32 %226, 2
  br i1 %227, label %228, label %229

228:                                              ; preds = %225
  store i8 0, ptr %19, align 1, !tbaa !15
  br label %229

229:                                              ; preds = %228, %225
  %230 = load i8, ptr %19, align 1, !tbaa !15, !range !18, !noundef !19
  %231 = trunc i8 %230 to i1
  br i1 %231, label %232, label %238

232:                                              ; preds = %229
  invoke void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) @ans, ptr noundef nonnull align 4 dereferenceable(4) %4)
          to label %233 unwind label %234

233:                                              ; preds = %232
  br label %238

234:                                              ; preds = %232
  %235 = landingpad { ptr, i32 }
          cleanup
  %236 = extractvalue { ptr, i32 } %235, 0
  store ptr %236, ptr %9, align 8
  %237 = extractvalue { ptr, i32 } %235, 1
  store i32 %237, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr %19) #4
  br label %274

238:                                              ; preds = %233, %229
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #4
  %239 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %7) #4
  %240 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %23, i32 0, i32 0
  store ptr %239, ptr %240, align 8
  br label %241

241:                                              ; preds = %271, %238
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #4
  %242 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %7) #4
  %243 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %24, i32 0, i32 0
  store ptr %242, ptr %243, align 8
  %244 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairIiiESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %23, ptr noundef nonnull align 8 dereferenceable(8) %24) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #4
  br i1 %244, label %246, label %245

245:                                              ; preds = %241
  store i32 10, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #4
  br label %273

246:                                              ; preds = %241
  %247 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %23) #4
  %248 = getelementptr inbounds %"struct.std::pair", ptr %247, i32 0, i32 0
  %249 = load i32, ptr %248, align 4, !tbaa !9
  store i32 %249, ptr %5, align 4, !tbaa !5
  %250 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %23) #4
  %251 = getelementptr inbounds %"struct.std::pair", ptr %250, i32 0, i32 1
  %252 = load i32, ptr %251, align 4, !tbaa !11
  store i32 %252, ptr %6, align 4, !tbaa !5
  %253 = load i32, ptr %5, align 4, !tbaa !5
  %254 = sext i32 %253 to i64
  %255 = getelementptr inbounds [1010 x [1010 x i32]], ptr @deg, i64 0, i64 %254
  %256 = load i32, ptr %6, align 4, !tbaa !5
  %257 = sext i32 %256 to i64
  %258 = getelementptr inbounds [1010 x i32], ptr %255, i64 0, i64 %257
  store i32 0, ptr %258, align 4, !tbaa !5
  %259 = load i32, ptr %5, align 4, !tbaa !5
  %260 = sext i32 %259 to i64
  %261 = getelementptr inbounds [1010 x [1010 x i32]], ptr @vis, i64 0, i64 %260
  %262 = load i32, ptr %6, align 4, !tbaa !5
  %263 = sext i32 %262 to i64
  %264 = getelementptr inbounds [1010 x i32], ptr %261, i64 0, i64 %263
  store i32 0, ptr %264, align 4, !tbaa !5
  %265 = load i32, ptr %5, align 4, !tbaa !5
  %266 = sext i32 %265 to i64
  %267 = getelementptr inbounds [1010 x [1010 x i32]], ptr @in, i64 0, i64 %266
  %268 = load i32, ptr %6, align 4, !tbaa !5
  %269 = sext i32 %268 to i64
  %270 = getelementptr inbounds [1010 x i32], ptr %267, i64 0, i64 %269
  store i32 0, ptr %270, align 4, !tbaa !5
  br label %271

271:                                              ; preds = %246
  %272 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %23) #4
  br label %241, !llvm.loop !20

273:                                              ; preds = %245
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr %19) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #4
  call void @_ZNSt5queueISt4pairIiiESt5dequeIS1_SaIS1_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %8) #4
  call void @llvm.lifetime.end.p0(i64 80, ptr %8) #4
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %7) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr %7) #4
  ret void

274:                                              ; preds = %234, %185, %84, %66, %62
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #4
  call void @_ZNSt5queueISt4pairIiiESt5dequeIS1_SaIS1_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %8) #4
  br label %275

275:                                              ; preds = %274, %58
  call void @llvm.lifetime.end.p0(i64 80, ptr %8) #4
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %7) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr %7) #4
  br label %276

276:                                              ; preds = %275
  %277 = load ptr, ptr %9, align 8
  %278 = load i32, ptr %10, align 4
  %279 = insertvalue { ptr, i32 } poison, ptr %277, 0
  %280 = insertvalue { ptr, i32 } %279, i32 %278, 1
  resume { ptr, i32 } %280

281:                                              ; preds = %179
  unreachable
}

; 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 @_ZNSt6vectorISt4pairIiiESaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #0 align 2

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

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress uwtable
declare dso_local i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #1

; 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 zeroext i1 @_ZNKSt5queueISt4pairIiiESt5dequeIS1_SaIS1_EEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80)) #0 align 2

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

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

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

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

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

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

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

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

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

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

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

attributes #0 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress 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 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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, !6, i64 0}
!10 = !{!"_ZTSSt4pairIiiE", !6, i64 0, !6, i64 4}
!11 = !{!10, !6, i64 4}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = distinct !{!14, !13}
!15 = !{!16, !16, i64 0}
!16 = !{!"bool", !7, i64 0}
!17 = distinct !{!17, !13}
!18 = !{i8 0, i8 2}
!19 = !{}
!20 = distinct !{!20, !13}


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

%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.0" = type { %"struct.std::_Vector_base.1" }
%"struct.std::_Vector_base.1" = type { %"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::queue" = type { %"class.std::deque" }
%"class.std::deque" = type { %"class.std::_Deque_base" }
%"class.std::_Deque_base" = type { %"struct.std::_Deque_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Deque_impl" }
%"struct.std::_Deque_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Deque_impl" = type { %"struct.std::_Deque_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Deque_impl_data" }
%"struct.std::_Deque_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Deque_impl_data" = type { ptr, i64, %"struct.std::_Deque_iterator", %"struct.std::_Deque_iterator" }
%"struct.std::_Deque_iterator" = type { ptr, ptr, ptr, ptr }
%"struct.std::pair" = type { i32, i32 }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }

@g = external dso_local local_unnamed_addr global [1010 x [1010 x i32]], align 16
@vis = external dso_local local_unnamed_addr global [1010 x [1010 x i32]], align 16
@deg = external dso_local local_unnamed_addr global [1010 x [1010 x i32]], align 16
@in = external dso_local local_unnamed_addr global [1010 x [1010 x i32]], align 16
@tot = external dso_local local_unnamed_addr global i32, align 4
@ans = external dso_local global %"class.std::vector", align 8
@dx = external dso_local local_unnamed_addr global [4 x i32], align 16
@dy = external dso_local local_unnamed_addr global [4 x i32], align 16

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_Z7inrangeii(i32 noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z3getiiii(i32 noundef, i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
define dso_local void @_Z2goiii(i32 noundef %0, i32 noundef %1, i32 noundef %2) local_unnamed_addr #1 personality ptr @__gxx_personality_v0 {
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca %"class.std::vector.0", align 8
  %8 = alloca %"class.std::queue", align 8
  %9 = alloca %"struct.std::pair", align 8
  %10 = alloca %"struct.std::pair", align 8
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca %"struct.std::pair", align 8
  %14 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %15 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %16 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %17 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  store i32 %0, ptr %4, align 4, !tbaa !5
  store i32 %1, ptr %5, align 4, !tbaa !5
  store i32 %2, ptr %6, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %7) #4
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %7) #4
  call void @llvm.lifetime.start.p0(i64 80, ptr nonnull %8) #4
  invoke void @_ZNSt5queueISt4pairIiiESt5dequeIS1_SaIS1_EEEC2IS4_vEEv(ptr noundef nonnull align 8 dereferenceable(80) %8)
          to label %18 unwind label %41

18:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #4
  %19 = invoke i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %5, ptr noundef nonnull align 4 dereferenceable(4) %6)
          to label %20 unwind label %43

20:                                               ; preds = %18
  store i64 %19, ptr %9, align 8
  invoke void @_ZNSt5queueISt4pairIiiESt5dequeIS1_SaIS1_EEE4pushEOS1_(ptr noundef nonnull align 8 dereferenceable(80) %8, ptr noundef nonnull align 4 dereferenceable(8) %9)
          to label %21 unwind label %43

21:                                               ; preds = %20
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #4
  %22 = load i32, ptr %5, align 4, !tbaa !5
  %23 = sext i32 %22 to i64
  %24 = load i32, ptr %6, align 4, !tbaa !5
  %25 = sext i32 %24 to i64
  %26 = getelementptr inbounds [1010 x [1010 x i32]], ptr @in, i64 0, i64 %23, i64 %25
  store i32 1, ptr %26, align 4, !tbaa !5
  br label %.outer

.outer:                                           ; preds = %.outer.loopexit, %21
  %.013.ph = phi i32 [ 1, %21 ], [ %.3.3, %.outer.loopexit ]
  br label %27

27:                                               ; preds = %.outer, %29
  %28 = call noundef zeroext i1 @_ZNKSt5queueISt4pairIiiESt5dequeIS1_SaIS1_EEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %8)
  br i1 %28, label %256, label %29

29:                                               ; preds = %27
  %30 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt5queueISt4pairIiiESt5dequeIS1_SaIS1_EEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) %8)
  %31 = load i32, ptr %30, align 4, !tbaa !9
  store i32 %31, ptr %5, align 4, !tbaa !5
  %32 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt5queueISt4pairIiiESt5dequeIS1_SaIS1_EEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) %8)
  %33 = getelementptr inbounds i8, ptr %32, i64 4
  %34 = load i32, ptr %33, align 4, !tbaa !11
  store i32 %34, ptr %6, align 4, !tbaa !5
  call void @_ZNSt5queueISt4pairIiiESt5dequeIS1_SaIS1_EEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %8)
  %35 = load i32, ptr %5, align 4, !tbaa !5
  %36 = sext i32 %35 to i64
  %37 = load i32, ptr %6, align 4, !tbaa !5
  %38 = sext i32 %37 to i64
  %39 = getelementptr inbounds [1010 x [1010 x i32]], ptr @vis, i64 0, i64 %36, i64 %38
  %40 = load i32, ptr %39, align 4, !tbaa !5
  %.not20 = icmp eq i32 %40, 0
  br i1 %.not20, label %45, label %27, !llvm.loop !12

41:                                               ; preds = %3
  %42 = landingpad { ptr, i32 }
          cleanup
  br label %299

43:                                               ; preds = %20, %18
  %44 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #4
  br label %298

45:                                               ; preds = %29
  store i32 1, ptr %39, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #4
  %46 = invoke i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %5, ptr noundef nonnull align 4 dereferenceable(4) %6)
          to label %47 unwind label %58

47:                                               ; preds = %45
  store i64 %46, ptr %10, align 8
  invoke void @_ZNSt6vectorISt4pairIiiESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %7, ptr noundef nonnull align 4 dereferenceable(8) %10)
          to label %48 unwind label %58

48:                                               ; preds = %47
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %11) #4
  %49 = load i32, ptr %5, align 4, !tbaa !5
  %50 = load i32, ptr @dx, align 16, !tbaa !5
  %51 = mul nsw i32 %50, %0
  %52 = add nsw i32 %51, %49
  store i32 %52, ptr %11, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %12) #4
  %53 = load i32, ptr %6, align 4, !tbaa !5
  %54 = load i32, ptr @dy, align 16, !tbaa !5
  %55 = mul nsw i32 %54, %0
  %56 = add nsw i32 %55, %53
  store i32 %56, ptr %12, align 4, !tbaa !5
  %57 = call noundef zeroext i1 @_Z7inrangeii(i32 noundef %52, i32 noundef %56)
  br i1 %57, label %60, label %101

58:                                               ; preds = %47, %45
  %59 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #4
  br label %298

60:                                               ; preds = %48
  %61 = load i32, ptr %11, align 4, !tbaa !5
  %62 = sext i32 %61 to i64
  %63 = load i32, ptr %12, align 4, !tbaa !5
  %64 = sext i32 %63 to i64
  %65 = getelementptr inbounds [1010 x [1010 x i32]], ptr @g, i64 0, i64 %62, i64 %64
  %66 = load i32, ptr %65, align 4, !tbaa !5
  %.not21 = icmp eq i32 %66, 0
  br i1 %.not21, label %101, label %67

67:                                               ; preds = %60
  %68 = getelementptr inbounds [1010 x [1010 x i32]], ptr @vis, i64 0, i64 %62, i64 %64
  %69 = load i32, ptr %68, align 4, !tbaa !5
  %.not22 = icmp eq i32 %69, 0
  br i1 %.not22, label %70, label %101

70:                                               ; preds = %67
  %71 = load i32, ptr %5, align 4, !tbaa !5
  %72 = load i32, ptr %6, align 4, !tbaa !5
  %73 = call noundef i32 @_Z3getiiii(i32 noundef %71, i32 noundef %72, i32 noundef %61, i32 noundef %63)
  %.not23 = icmp eq i32 %73, %0
  br i1 %.not23, label %74, label %101

74:                                               ; preds = %70
  %75 = load i32, ptr %5, align 4, !tbaa !5
  %76 = sext i32 %75 to i64
  %77 = load i32, ptr %6, align 4, !tbaa !5
  %78 = sext i32 %77 to i64
  %79 = getelementptr inbounds [1010 x [1010 x i32]], ptr @deg, i64 0, i64 %76, i64 %78
  %80 = load i32, ptr %79, align 4, !tbaa !5
  %81 = add nsw i32 %80, 1
  store i32 %81, ptr %79, align 4, !tbaa !5
  %82 = load i32, ptr %11, align 4, !tbaa !5
  %83 = sext i32 %82 to i64
  %84 = load i32, ptr %12, align 4, !tbaa !5
  %85 = sext i32 %84 to i64
  %86 = getelementptr inbounds [1010 x [1010 x i32]], ptr @deg, i64 0, i64 %83, i64 %85
  %87 = load i32, ptr %86, align 4, !tbaa !5
  %88 = add nsw i32 %87, 1
  store i32 %88, ptr %86, align 4, !tbaa !5
  %89 = add nsw i32 %.013.ph, %0
  %90 = getelementptr inbounds [1010 x [1010 x i32]], ptr @in, i64 0, i64 %83, i64 %85
  %91 = load i32, ptr %90, align 4, !tbaa !5
  %.not24 = icmp ne i32 %91, 0
  %92 = sext i1 %.not24 to i32
  %spec.select = add nsw i32 %89, %92
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %13) #4
  %93 = invoke i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %11, ptr noundef nonnull align 4 dereferenceable(4) %12)
          to label %94 unwind label %254

94:                                               ; preds = %74
  store i64 %93, ptr %13, align 8
  invoke void @_ZNSt5queueISt4pairIiiESt5dequeIS1_SaIS1_EEE4pushEOS1_(ptr noundef nonnull align 8 dereferenceable(80) %8, ptr noundef nonnull align 4 dereferenceable(8) %13)
          to label %95 unwind label %254

95:                                               ; preds = %94
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %13) #4
  %96 = load i32, ptr %11, align 4, !tbaa !5
  %97 = sext i32 %96 to i64
  %98 = load i32, ptr %12, align 4, !tbaa !5
  %99 = sext i32 %98 to i64
  %100 = getelementptr inbounds [1010 x [1010 x i32]], ptr @in, i64 0, i64 %97, i64 %99
  store i32 1, ptr %100, align 4, !tbaa !5
  br label %101

101:                                              ; preds = %70, %67, %60, %48, %95
  %.3 = phi i32 [ %spec.select, %95 ], [ %.013.ph, %48 ], [ %.013.ph, %60 ], [ %.013.ph, %67 ], [ %.013.ph, %70 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %12) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %11) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %11) #4
  %102 = load i32, ptr %5, align 4, !tbaa !5
  %103 = load i32, ptr getelementptr inbounds (i8, ptr @dx, i64 4), align 4, !tbaa !5
  %104 = mul nsw i32 %103, %0
  %105 = add nsw i32 %104, %102
  store i32 %105, ptr %11, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %12) #4
  %106 = load i32, ptr %6, align 4, !tbaa !5
  %107 = load i32, ptr getelementptr inbounds (i8, ptr @dy, i64 4), align 4, !tbaa !5
  %108 = mul nsw i32 %107, %0
  %109 = add nsw i32 %108, %106
  store i32 %109, ptr %12, align 4, !tbaa !5
  %110 = call noundef zeroext i1 @_Z7inrangeii(i32 noundef %105, i32 noundef %109)
  br i1 %110, label %111, label %152

111:                                              ; preds = %101
  %112 = load i32, ptr %11, align 4, !tbaa !5
  %113 = sext i32 %112 to i64
  %114 = load i32, ptr %12, align 4, !tbaa !5
  %115 = sext i32 %114 to i64
  %116 = getelementptr inbounds [1010 x [1010 x i32]], ptr @g, i64 0, i64 %113, i64 %115
  %117 = load i32, ptr %116, align 4, !tbaa !5
  %.not21.1 = icmp eq i32 %117, 0
  br i1 %.not21.1, label %152, label %118

118:                                              ; preds = %111
  %119 = getelementptr inbounds [1010 x [1010 x i32]], ptr @vis, i64 0, i64 %113, i64 %115
  %120 = load i32, ptr %119, align 4, !tbaa !5
  %.not22.1 = icmp eq i32 %120, 0
  br i1 %.not22.1, label %121, label %152

121:                                              ; preds = %118
  %122 = load i32, ptr %5, align 4, !tbaa !5
  %123 = load i32, ptr %6, align 4, !tbaa !5
  %124 = call noundef i32 @_Z3getiiii(i32 noundef %122, i32 noundef %123, i32 noundef %112, i32 noundef %114)
  %.not23.1 = icmp eq i32 %124, %0
  br i1 %.not23.1, label %125, label %152

125:                                              ; preds = %121
  %126 = load i32, ptr %5, align 4, !tbaa !5
  %127 = sext i32 %126 to i64
  %128 = load i32, ptr %6, align 4, !tbaa !5
  %129 = sext i32 %128 to i64
  %130 = getelementptr inbounds [1010 x [1010 x i32]], ptr @deg, i64 0, i64 %127, i64 %129
  %131 = load i32, ptr %130, align 4, !tbaa !5
  %132 = add nsw i32 %131, 1
  store i32 %132, ptr %130, align 4, !tbaa !5
  %133 = load i32, ptr %11, align 4, !tbaa !5
  %134 = sext i32 %133 to i64
  %135 = load i32, ptr %12, align 4, !tbaa !5
  %136 = sext i32 %135 to i64
  %137 = getelementptr inbounds [1010 x [1010 x i32]], ptr @deg, i64 0, i64 %134, i64 %136
  %138 = load i32, ptr %137, align 4, !tbaa !5
  %139 = add nsw i32 %138, 1
  store i32 %139, ptr %137, align 4, !tbaa !5
  %140 = add nsw i32 %.3, %0
  %141 = getelementptr inbounds [1010 x [1010 x i32]], ptr @in, i64 0, i64 %134, i64 %136
  %142 = load i32, ptr %141, align 4, !tbaa !5
  %.not24.1 = icmp ne i32 %142, 0
  %143 = sext i1 %.not24.1 to i32
  %spec.select.1 = add nsw i32 %140, %143
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %13) #4
  %144 = invoke i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %11, ptr noundef nonnull align 4 dereferenceable(4) %12)
          to label %145 unwind label %254

145:                                              ; preds = %125
  store i64 %144, ptr %13, align 8
  invoke void @_ZNSt5queueISt4pairIiiESt5dequeIS1_SaIS1_EEE4pushEOS1_(ptr noundef nonnull align 8 dereferenceable(80) %8, ptr noundef nonnull align 4 dereferenceable(8) %13)
          to label %146 unwind label %254

146:                                              ; preds = %145
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %13) #4
  %147 = load i32, ptr %11, align 4, !tbaa !5
  %148 = sext i32 %147 to i64
  %149 = load i32, ptr %12, align 4, !tbaa !5
  %150 = sext i32 %149 to i64
  %151 = getelementptr inbounds [1010 x [1010 x i32]], ptr @in, i64 0, i64 %148, i64 %150
  store i32 1, ptr %151, align 4, !tbaa !5
  br label %152

152:                                              ; preds = %146, %121, %118, %111, %101
  %.3.1 = phi i32 [ %spec.select.1, %146 ], [ %.3, %101 ], [ %.3, %111 ], [ %.3, %118 ], [ %.3, %121 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %12) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %11) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %11) #4
  %153 = load i32, ptr %5, align 4, !tbaa !5
  %154 = load i32, ptr getelementptr inbounds (i8, ptr @dx, i64 8), align 8, !tbaa !5
  %155 = mul nsw i32 %154, %0
  %156 = add nsw i32 %155, %153
  store i32 %156, ptr %11, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %12) #4
  %157 = load i32, ptr %6, align 4, !tbaa !5
  %158 = load i32, ptr getelementptr inbounds (i8, ptr @dy, i64 8), align 8, !tbaa !5
  %159 = mul nsw i32 %158, %0
  %160 = add nsw i32 %159, %157
  store i32 %160, ptr %12, align 4, !tbaa !5
  %161 = call noundef zeroext i1 @_Z7inrangeii(i32 noundef %156, i32 noundef %160)
  br i1 %161, label %162, label %203

162:                                              ; preds = %152
  %163 = load i32, ptr %11, align 4, !tbaa !5
  %164 = sext i32 %163 to i64
  %165 = load i32, ptr %12, align 4, !tbaa !5
  %166 = sext i32 %165 to i64
  %167 = getelementptr inbounds [1010 x [1010 x i32]], ptr @g, i64 0, i64 %164, i64 %166
  %168 = load i32, ptr %167, align 4, !tbaa !5
  %.not21.2 = icmp eq i32 %168, 0
  br i1 %.not21.2, label %203, label %169

169:                                              ; preds = %162
  %170 = getelementptr inbounds [1010 x [1010 x i32]], ptr @vis, i64 0, i64 %164, i64 %166
  %171 = load i32, ptr %170, align 4, !tbaa !5
  %.not22.2 = icmp eq i32 %171, 0
  br i1 %.not22.2, label %172, label %203

172:                                              ; preds = %169
  %173 = load i32, ptr %5, align 4, !tbaa !5
  %174 = load i32, ptr %6, align 4, !tbaa !5
  %175 = call noundef i32 @_Z3getiiii(i32 noundef %173, i32 noundef %174, i32 noundef %163, i32 noundef %165)
  %.not23.2 = icmp eq i32 %175, %0
  br i1 %.not23.2, label %176, label %203

176:                                              ; preds = %172
  %177 = load i32, ptr %5, align 4, !tbaa !5
  %178 = sext i32 %177 to i64
  %179 = load i32, ptr %6, align 4, !tbaa !5
  %180 = sext i32 %179 to i64
  %181 = getelementptr inbounds [1010 x [1010 x i32]], ptr @deg, i64 0, i64 %178, i64 %180
  %182 = load i32, ptr %181, align 4, !tbaa !5
  %183 = add nsw i32 %182, 1
  store i32 %183, ptr %181, align 4, !tbaa !5
  %184 = load i32, ptr %11, align 4, !tbaa !5
  %185 = sext i32 %184 to i64
  %186 = load i32, ptr %12, align 4, !tbaa !5
  %187 = sext i32 %186 to i64
  %188 = getelementptr inbounds [1010 x [1010 x i32]], ptr @deg, i64 0, i64 %185, i64 %187
  %189 = load i32, ptr %188, align 4, !tbaa !5
  %190 = add nsw i32 %189, 1
  store i32 %190, ptr %188, align 4, !tbaa !5
  %191 = add nsw i32 %.3.1, %0
  %192 = getelementptr inbounds [1010 x [1010 x i32]], ptr @in, i64 0, i64 %185, i64 %187
  %193 = load i32, ptr %192, align 4, !tbaa !5
  %.not24.2 = icmp ne i32 %193, 0
  %194 = sext i1 %.not24.2 to i32
  %spec.select.2 = add nsw i32 %191, %194
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %13) #4
  %195 = invoke i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %11, ptr noundef nonnull align 4 dereferenceable(4) %12)
          to label %196 unwind label %254

196:                                              ; preds = %176
  store i64 %195, ptr %13, align 8
  invoke void @_ZNSt5queueISt4pairIiiESt5dequeIS1_SaIS1_EEE4pushEOS1_(ptr noundef nonnull align 8 dereferenceable(80) %8, ptr noundef nonnull align 4 dereferenceable(8) %13)
          to label %197 unwind label %254

197:                                              ; preds = %196
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %13) #4
  %198 = load i32, ptr %11, align 4, !tbaa !5
  %199 = sext i32 %198 to i64
  %200 = load i32, ptr %12, align 4, !tbaa !5
  %201 = sext i32 %200 to i64
  %202 = getelementptr inbounds [1010 x [1010 x i32]], ptr @in, i64 0, i64 %199, i64 %201
  store i32 1, ptr %202, align 4, !tbaa !5
  br label %203

203:                                              ; preds = %197, %172, %169, %162, %152
  %.3.2 = phi i32 [ %spec.select.2, %197 ], [ %.3.1, %152 ], [ %.3.1, %162 ], [ %.3.1, %169 ], [ %.3.1, %172 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %12) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %11) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %11) #4
  %204 = load i32, ptr %5, align 4, !tbaa !5
  %205 = load i32, ptr getelementptr inbounds (i8, ptr @dx, i64 12), align 4, !tbaa !5
  %206 = mul nsw i32 %205, %0
  %207 = add nsw i32 %206, %204
  store i32 %207, ptr %11, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %12) #4
  %208 = load i32, ptr %6, align 4, !tbaa !5
  %209 = load i32, ptr getelementptr inbounds (i8, ptr @dy, i64 12), align 4, !tbaa !5
  %210 = mul nsw i32 %209, %0
  %211 = add nsw i32 %210, %208
  store i32 %211, ptr %12, align 4, !tbaa !5
  %212 = call noundef zeroext i1 @_Z7inrangeii(i32 noundef %207, i32 noundef %211)
  br i1 %212, label %213, label %.outer.loopexit

213:                                              ; preds = %203
  %214 = load i32, ptr %11, align 4, !tbaa !5
  %215 = sext i32 %214 to i64
  %216 = load i32, ptr %12, align 4, !tbaa !5
  %217 = sext i32 %216 to i64
  %218 = getelementptr inbounds [1010 x [1010 x i32]], ptr @g, i64 0, i64 %215, i64 %217
  %219 = load i32, ptr %218, align 4, !tbaa !5
  %.not21.3 = icmp eq i32 %219, 0
  br i1 %.not21.3, label %.outer.loopexit, label %220

220:                                              ; preds = %213
  %221 = getelementptr inbounds [1010 x [1010 x i32]], ptr @vis, i64 0, i64 %215, i64 %217
  %222 = load i32, ptr %221, align 4, !tbaa !5
  %.not22.3 = icmp eq i32 %222, 0
  br i1 %.not22.3, label %223, label %.outer.loopexit

223:                                              ; preds = %220
  %224 = load i32, ptr %5, align 4, !tbaa !5
  %225 = load i32, ptr %6, align 4, !tbaa !5
  %226 = call noundef i32 @_Z3getiiii(i32 noundef %224, i32 noundef %225, i32 noundef %214, i32 noundef %216)
  %.not23.3 = icmp eq i32 %226, %0
  br i1 %.not23.3, label %227, label %.outer.loopexit

227:                                              ; preds = %223
  %228 = load i32, ptr %5, align 4, !tbaa !5
  %229 = sext i32 %228 to i64
  %230 = load i32, ptr %6, align 4, !tbaa !5
  %231 = sext i32 %230 to i64
  %232 = getelementptr inbounds [1010 x [1010 x i32]], ptr @deg, i64 0, i64 %229, i64 %231
  %233 = load i32, ptr %232, align 4, !tbaa !5
  %234 = add nsw i32 %233, 1
  store i32 %234, ptr %232, align 4, !tbaa !5
  %235 = load i32, ptr %11, align 4, !tbaa !5
  %236 = sext i32 %235 to i64
  %237 = load i32, ptr %12, align 4, !tbaa !5
  %238 = sext i32 %237 to i64
  %239 = getelementptr inbounds [1010 x [1010 x i32]], ptr @deg, i64 0, i64 %236, i64 %238
  %240 = load i32, ptr %239, align 4, !tbaa !5
  %241 = add nsw i32 %240, 1
  store i32 %241, ptr %239, align 4, !tbaa !5
  %242 = add nsw i32 %.3.2, %0
  %243 = getelementptr inbounds [1010 x [1010 x i32]], ptr @in, i64 0, i64 %236, i64 %238
  %244 = load i32, ptr %243, align 4, !tbaa !5
  %.not24.3 = icmp ne i32 %244, 0
  %245 = sext i1 %.not24.3 to i32
  %spec.select.3 = add nsw i32 %242, %245
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %13) #4
  %246 = invoke i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %11, ptr noundef nonnull align 4 dereferenceable(4) %12)
          to label %247 unwind label %254

247:                                              ; preds = %227
  store i64 %246, ptr %13, align 8
  invoke void @_ZNSt5queueISt4pairIiiESt5dequeIS1_SaIS1_EEE4pushEOS1_(ptr noundef nonnull align 8 dereferenceable(80) %8, ptr noundef nonnull align 4 dereferenceable(8) %13)
          to label %248 unwind label %254

248:                                              ; preds = %247
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %13) #4
  %249 = load i32, ptr %11, align 4, !tbaa !5
  %250 = sext i32 %249 to i64
  %251 = load i32, ptr %12, align 4, !tbaa !5
  %252 = sext i32 %251 to i64
  %253 = getelementptr inbounds [1010 x [1010 x i32]], ptr @in, i64 0, i64 %250, i64 %252
  store i32 1, ptr %253, align 4, !tbaa !5
  br label %.outer.loopexit

.outer.loopexit:                                  ; preds = %248, %223, %220, %213, %203
  %.3.3 = phi i32 [ %spec.select.3, %248 ], [ %.3.2, %203 ], [ %.3.2, %213 ], [ %.3.2, %220 ], [ %.3.2, %223 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %12) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %11) #4
  br label %.outer, !llvm.loop !14

254:                                              ; preds = %247, %227, %196, %176, %145, %125, %94, %74
  %255 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %13) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %12) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %11) #4
  br label %298

256:                                              ; preds = %27
  %257 = load i32, ptr @tot, align 4, !tbaa !5
  %.not = icmp eq i32 %.013.ph, %257
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %14) #4
  %258 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %7) #4
  store ptr %258, ptr %14, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %15) #4
  %259 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %7) #4
  store ptr %259, ptr %15, align 8
  %260 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairIiiESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %14, ptr noundef nonnull align 8 dereferenceable(8) %15) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %15) #4
  br i1 %260, label %.lr.ph, label %._crit_edge

._crit_edge.loopexit:                             ; preds = %.lr.ph
  %261 = icmp slt i32 %spec.select28, 3
  %262 = select i1 %261, i1 %.not, i1 false
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %14) #4
  br i1 %262, label %277, label %280

._crit_edge:                                      ; preds = %256
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %14) #4
  br i1 %.not, label %277, label %280

.lr.ph:                                           ; preds = %256, %.lr.ph
  %.034 = phi i32 [ %spec.select28, %.lr.ph ], [ 0, %256 ]
  %263 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %14) #4
  %264 = load i32, ptr %263, align 4, !tbaa !9
  store i32 %264, ptr %5, align 4, !tbaa !5
  %265 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %14) #4
  %266 = getelementptr inbounds i8, ptr %265, i64 4
  %267 = load i32, ptr %266, align 4, !tbaa !11
  store i32 %267, ptr %6, align 4, !tbaa !5
  %268 = load i32, ptr %5, align 4, !tbaa !5
  %269 = sext i32 %268 to i64
  %270 = sext i32 %267 to i64
  %271 = getelementptr inbounds [1010 x [1010 x i32]], ptr @deg, i64 0, i64 %269, i64 %270
  %272 = load i32, ptr %271, align 4, !tbaa !5
  %273 = and i32 %272, 1
  %spec.select28 = add i32 %273, %.034
  %274 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %14) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %15) #4
  %275 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %7) #4
  store ptr %275, ptr %15, align 8
  %276 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairIiiESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %14, ptr noundef nonnull align 8 dereferenceable(8) %15) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %15) #4
  br i1 %276, label %.lr.ph, label %._crit_edge.loopexit, !llvm.loop !15

277:                                              ; preds = %._crit_edge.loopexit, %._crit_edge
  invoke void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) @ans, ptr noundef nonnull align 4 dereferenceable(4) %4)
          to label %280 unwind label %278

278:                                              ; preds = %277
  %279 = landingpad { ptr, i32 }
          cleanup
  br label %298

280:                                              ; preds = %._crit_edge.loopexit, %277, %._crit_edge
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %16) #4
  %281 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %7) #4
  store ptr %281, ptr %16, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %17) #4
  %282 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %7) #4
  store ptr %282, ptr %17, align 8
  %283 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairIiiESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %16, ptr noundef nonnull align 8 dereferenceable(8) %17) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %17) #4
  br i1 %283, label %.lr.ph36, label %._crit_edge37

._crit_edge37:                                    ; preds = %.lr.ph36, %280
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %16) #4
  call void @_ZNSt5queueISt4pairIiiESt5dequeIS1_SaIS1_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %8) #4
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %8) #4
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %7) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %7) #4
  ret void

.lr.ph36:                                         ; preds = %280, %.lr.ph36
  %284 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %16) #4
  %285 = load i32, ptr %284, align 4, !tbaa !9
  store i32 %285, ptr %5, align 4, !tbaa !5
  %286 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %16) #4
  %287 = getelementptr inbounds i8, ptr %286, i64 4
  %288 = load i32, ptr %287, align 4, !tbaa !11
  store i32 %288, ptr %6, align 4, !tbaa !5
  %289 = load i32, ptr %5, align 4, !tbaa !5
  %290 = sext i32 %289 to i64
  %291 = sext i32 %288 to i64
  %292 = getelementptr inbounds [1010 x [1010 x i32]], ptr @deg, i64 0, i64 %290, i64 %291
  store i32 0, ptr %292, align 4, !tbaa !5
  %293 = getelementptr inbounds [1010 x [1010 x i32]], ptr @vis, i64 0, i64 %290, i64 %291
  store i32 0, ptr %293, align 4, !tbaa !5
  %294 = getelementptr inbounds [1010 x [1010 x i32]], ptr @in, i64 0, i64 %290, i64 %291
  store i32 0, ptr %294, align 4, !tbaa !5
  %295 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %16) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %17) #4
  %296 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %7) #4
  store ptr %296, ptr %17, align 8
  %297 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairIiiESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %16, ptr noundef nonnull align 8 dereferenceable(8) %17) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %17) #4
  br i1 %297, label %.lr.ph36, label %._crit_edge37, !llvm.loop !16

298:                                              ; preds = %278, %254, %58, %43
  %.pn = phi { ptr, i32 } [ %255, %254 ], [ %59, %58 ], [ %279, %278 ], [ %44, %43 ]
  call void @_ZNSt5queueISt4pairIiiESt5dequeIS1_SaIS1_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %8) #4
  br label %299

299:                                              ; preds = %298, %41
  %.pn.pn = phi { ptr, i32 } [ %.pn, %298 ], [ %42, %41 ]
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %8) #4
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %7) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %7) #4
  resume { ptr, i32 } %.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 @_ZNSt6vectorISt4pairIiiESaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #0 align 2

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

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress uwtable
declare dso_local i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #1

; 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 zeroext i1 @_ZNKSt5queueISt4pairIiiESt5dequeIS1_SaIS1_EEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80)) local_unnamed_addr #0 align 2

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

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

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

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

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

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

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

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

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

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

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

attributes #0 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress 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 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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, !6, i64 0}
!10 = !{!"_ZTSSt4pairIiiE", !6, i64 0, !6, i64 4}
!11 = !{!10, !6, i64 4}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = distinct !{!14, !13}
!15 = distinct !{!15, !13}
!16 = distinct !{!16, !13}


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