; LLVM IR from tangjz/acm-icpc :: lydsy (1001)

; 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::priority_queue" = type <{ %"class.std::vector", [8 x i8] }>
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = 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::vector.0" = type { %"struct.std::_Vector_base.1" }
%"struct.std::_Vector_base.1" = 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.5" = type { %"struct.std::_Bvector_base" }
%"struct.std::_Bvector_base" = type { %"struct.std::_Bvector_base<std::allocator<bool>>::_Bvector_impl" }
%"struct.std::_Bvector_base<std::allocator<bool>>::_Bvector_impl" = type { %"struct.std::_Bvector_base<std::allocator<bool>>::_Bvector_impl_data" }
%"struct.std::_Bvector_base<std::allocator<bool>>::_Bvector_impl_data" = type { %"struct.std::_Bit_iterator", %"struct.std::_Bit_iterator", ptr }
%"struct.std::_Bit_iterator" = type { %"struct.std::_Bit_iterator_base.base", [4 x i8] }
%"struct.std::_Bit_iterator_base.base" = type <{ ptr, i32 }>
%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"struct.std::pair" = type { i32, i32 }
%"struct.std::_Bit_reference" = type { ptr, i64 }

@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@t = external dso_local global i32, align 4
@q = external dso_local global %"class.std::priority_queue", align 8
@d = external dso_local global %"class.std::vector.0", align 8
@visited = external dso_local global %"class.std::vector.5", align 8
@G = external dso_local global [2000001 x %"class.std::vector"], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@_ZL3INF = external hidden constant i32, align 4

; 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 i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca %"struct.std::pair", align 4
  %10 = alloca %"struct.std::pair", align 4
  %11 = alloca i32, align 4
  %12 = alloca %"struct.std::pair", align 4
  %13 = alloca i32, align 4
  %14 = alloca %"struct.std::pair", align 4
  %15 = alloca i32, align 4
  %16 = alloca %"struct.std::pair", align 4
  %17 = alloca i32, align 4
  %18 = alloca %"struct.std::pair", align 4
  %19 = alloca %"struct.std::pair", align 4
  %20 = alloca i32, align 4
  %21 = alloca i8, align 1
  %22 = alloca %"struct.std::_Bit_reference", align 8
  %23 = alloca %"struct.std::pair", align 4
  %24 = alloca %"struct.std::_Bit_reference", align 8
  %25 = alloca %"struct.std::_Bit_reference", align 8
  %26 = alloca %"struct.std::pair", align 4
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #7
  %27 = call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %28 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) @n)
  %29 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %28, ptr noundef nonnull align 4 dereferenceable(4) @m)
  %30 = load i32, ptr @n, align 4, !tbaa !5
  %31 = icmp eq i32 %30, 1
  br i1 %31, label %32, label %49

32:                                               ; preds = %0
  %33 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %3)
  store i32 2, ptr %2, align 4, !tbaa !5
  br label %34

34:                                               ; preds = %42, %32
  %35 = load i32, ptr %2, align 4, !tbaa !5
  %36 = load i32, ptr @m, align 4, !tbaa !5
  %37 = icmp slt i32 %35, %36
  br i1 %37, label %38, label %45

38:                                               ; preds = %34
  %39 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %7)
  %40 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %3, ptr noundef nonnull align 4 dereferenceable(4) %7)
  %41 = load i32, ptr %40, align 4, !tbaa !5
  store i32 %41, ptr %3, align 4, !tbaa !5
  br label %42

42:                                               ; preds = %38
  %43 = load i32, ptr %2, align 4, !tbaa !5
  %44 = add nsw i32 %43, 1
  store i32 %44, ptr %2, align 4, !tbaa !5
  br label %34, !llvm.loop !9

45:                                               ; preds = %34
  %46 = load i32, ptr %3, align 4, !tbaa !5
  %47 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %46)
  %48 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %47, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  store i32 0, ptr %1, align 4
  store i32 1, ptr %8, align 4
  br label %395

49:                                               ; preds = %0
  %50 = load i32, ptr @m, align 4, !tbaa !5
  %51 = icmp eq i32 %50, 1
  br i1 %51, label %52, label %69

52:                                               ; preds = %49
  %53 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %3)
  store i32 2, ptr %2, align 4, !tbaa !5
  br label %54

54:                                               ; preds = %62, %52
  %55 = load i32, ptr %2, align 4, !tbaa !5
  %56 = load i32, ptr @n, align 4, !tbaa !5
  %57 = icmp slt i32 %55, %56
  br i1 %57, label %58, label %65

58:                                               ; preds = %54
  %59 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %7)
  %60 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %3, ptr noundef nonnull align 4 dereferenceable(4) %7)
  %61 = load i32, ptr %60, align 4, !tbaa !5
  store i32 %61, ptr %3, align 4, !tbaa !5
  br label %62

62:                                               ; preds = %58
  %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 %54, !llvm.loop !11

65:                                               ; preds = %54
  %66 = load i32, ptr %3, align 4, !tbaa !5
  %67 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %66)
  %68 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %67, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  store i32 0, ptr %1, align 4
  store i32 1, ptr %8, align 4
  br label %395

69:                                               ; preds = %49
  %70 = load i32, ptr @n, align 4, !tbaa !5
  %71 = sub nsw i32 %70, 1
  %72 = load i32, ptr @m, align 4, !tbaa !5
  %73 = sub nsw i32 %72, 1
  %74 = mul nsw i32 %71, %73
  %75 = mul nsw i32 %74, 2
  %76 = add nsw i32 %75, 1
  store i32 %76, ptr @t, align 4, !tbaa !5
  store i32 1, ptr %2, align 4, !tbaa !5
  br label %77

77:                                               ; preds = %88, %69
  %78 = load i32, ptr %2, align 4, !tbaa !5
  %79 = load i32, ptr @m, align 4, !tbaa !5
  %80 = icmp slt i32 %78, %79
  br i1 %80, label %81, label %91

81:                                               ; preds = %77
  %82 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %7)
  %83 = load i32, ptr %2, align 4, !tbaa !5
  %84 = mul nsw i32 %83, 2
  %85 = sext i32 %84 to i64
  %86 = getelementptr inbounds [2000001 x %"class.std::vector"], ptr @G, i64 0, i64 %85
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #7
  %87 = call i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %7, ptr noundef nonnull align 4 dereferenceable(4) @t)
  store i64 %87, ptr %9, align 4
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %86, ptr noundef nonnull align 4 dereferenceable(8) %9)
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #7
  br label %88

88:                                               ; preds = %81
  %89 = load i32, ptr %2, align 4, !tbaa !5
  %90 = add nsw i32 %89, 1
  store i32 %90, ptr %2, align 4, !tbaa !5
  br label %77, !llvm.loop !12

91:                                               ; preds = %77
  store i32 1, ptr %2, align 4, !tbaa !5
  br label %92

92:                                               ; preds = %129, %91
  %93 = load i32, ptr %2, align 4, !tbaa !5
  %94 = load i32, ptr @n, align 4, !tbaa !5
  %95 = sub nsw i32 %94, 1
  %96 = icmp slt i32 %93, %95
  br i1 %96, label %97, label %132

97:                                               ; preds = %92
  store i32 1, ptr %3, align 4, !tbaa !5
  br label %98

98:                                               ; preds = %125, %97
  %99 = load i32, ptr %3, align 4, !tbaa !5
  %100 = load i32, ptr @m, align 4, !tbaa !5
  %101 = icmp slt i32 %99, %100
  br i1 %101, label %102, label %128

102:                                              ; preds = %98
  %103 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %7)
  %104 = load i32, ptr %2, align 4, !tbaa !5
  %105 = load i32, ptr @m, align 4, !tbaa !5
  %106 = sub nsw i32 %105, 1
  %107 = mul nsw i32 %104, %106
  %108 = mul nsw i32 %107, 2
  %109 = load i32, ptr %3, align 4, !tbaa !5
  %110 = mul nsw i32 %109, 2
  %111 = add nsw i32 %108, %110
  %112 = sext i32 %111 to i64
  %113 = getelementptr inbounds [2000001 x %"class.std::vector"], ptr @G, i64 0, i64 %112
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #7
  %114 = load i32, ptr %2, align 4, !tbaa !5
  %115 = sub nsw i32 %114, 1
  %116 = load i32, ptr @m, align 4, !tbaa !5
  %117 = sub nsw i32 %116, 1
  %118 = mul nsw i32 %115, %117
  %119 = mul nsw i32 %118, 2
  %120 = load i32, ptr %3, align 4, !tbaa !5
  %121 = mul nsw i32 %120, 2
  %122 = add nsw i32 %119, %121
  %123 = sub nsw i32 %122, 1
  store i32 %123, ptr %11, align 4, !tbaa !5
  %124 = call i64 @_ZSt9make_pairIRiiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %7, ptr noundef nonnull align 4 dereferenceable(4) %11)
  store i64 %124, ptr %10, align 4
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %113, ptr noundef nonnull align 4 dereferenceable(8) %10)
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #7
  br label %125

125:                                              ; preds = %102
  %126 = load i32, ptr %3, align 4, !tbaa !5
  %127 = add nsw i32 %126, 1
  store i32 %127, ptr %3, align 4, !tbaa !5
  br label %98, !llvm.loop !13

128:                                              ; preds = %98
  br label %129

129:                                              ; preds = %128
  %130 = load i32, ptr %2, align 4, !tbaa !5
  %131 = add nsw i32 %130, 1
  store i32 %131, ptr %2, align 4, !tbaa !5
  br label %92, !llvm.loop !14

132:                                              ; preds = %92
  store i32 1, ptr %2, align 4, !tbaa !5
  br label %133

133:                                              ; preds = %150, %132
  %134 = load i32, ptr %2, align 4, !tbaa !5
  %135 = load i32, ptr @m, align 4, !tbaa !5
  %136 = icmp slt i32 %134, %135
  br i1 %136, label %137, label %153

137:                                              ; preds = %133
  %138 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %7)
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #7
  %139 = load i32, ptr @n, align 4, !tbaa !5
  %140 = sub nsw i32 %139, 2
  %141 = load i32, ptr @m, align 4, !tbaa !5
  %142 = sub nsw i32 %141, 1
  %143 = mul nsw i32 %140, %142
  %144 = mul nsw i32 %143, 2
  %145 = load i32, ptr %2, align 4, !tbaa !5
  %146 = mul nsw i32 %145, 2
  %147 = add nsw i32 %144, %146
  %148 = sub nsw i32 %147, 1
  store i32 %148, ptr %13, align 4, !tbaa !5
  %149 = call i64 @_ZSt9make_pairIRiiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %7, ptr noundef nonnull align 4 dereferenceable(4) %13)
  store i64 %149, ptr %12, align 4
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) @G, ptr noundef nonnull align 4 dereferenceable(8) %12)
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #7
  br label %150

150:                                              ; preds = %137
  %151 = load i32, ptr %2, align 4, !tbaa !5
  %152 = add nsw i32 %151, 1
  store i32 %152, ptr %2, align 4, !tbaa !5
  br label %133, !llvm.loop !15

153:                                              ; preds = %133
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %154

154:                                              ; preds = %209, %153
  %155 = load i32, ptr %2, align 4, !tbaa !5
  %156 = load i32, ptr @n, align 4, !tbaa !5
  %157 = sub nsw i32 %156, 1
  %158 = icmp slt i32 %155, %157
  br i1 %158, label %159, label %212

159:                                              ; preds = %154
  %160 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %7)
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #7
  %161 = load i32, ptr %2, align 4, !tbaa !5
  %162 = load i32, ptr @m, align 4, !tbaa !5
  %163 = sub nsw i32 %162, 1
  %164 = mul nsw i32 %161, %163
  %165 = mul nsw i32 %164, 2
  %166 = add nsw i32 %165, 1
  store i32 %166, ptr %15, align 4, !tbaa !5
  %167 = call i64 @_ZSt9make_pairIRiiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %7, ptr noundef nonnull align 4 dereferenceable(4) %15)
  store i64 %167, ptr %14, align 4
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) @G, ptr noundef nonnull align 4 dereferenceable(8) %14)
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #7
  store i32 1, ptr %3, align 4, !tbaa !5
  br label %168

168:                                              ; preds = %195, %159
  %169 = load i32, ptr %3, align 4, !tbaa !5
  %170 = load i32, ptr @m, align 4, !tbaa !5
  %171 = sub nsw i32 %170, 1
  %172 = icmp slt i32 %169, %171
  br i1 %172, label %173, label %198

173:                                              ; preds = %168
  %174 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %7)
  %175 = load i32, ptr %2, align 4, !tbaa !5
  %176 = load i32, ptr @m, align 4, !tbaa !5
  %177 = sub nsw i32 %176, 1
  %178 = mul nsw i32 %175, %177
  %179 = mul nsw i32 %178, 2
  %180 = load i32, ptr %3, align 4, !tbaa !5
  %181 = mul nsw i32 %180, 2
  %182 = add nsw i32 %179, %181
  %183 = sext i32 %182 to i64
  %184 = getelementptr inbounds [2000001 x %"class.std::vector"], ptr @G, i64 0, i64 %183
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #7
  %185 = load i32, ptr %2, align 4, !tbaa !5
  %186 = load i32, ptr @m, align 4, !tbaa !5
  %187 = sub nsw i32 %186, 1
  %188 = mul nsw i32 %185, %187
  %189 = mul nsw i32 %188, 2
  %190 = load i32, ptr %3, align 4, !tbaa !5
  %191 = mul nsw i32 %190, 2
  %192 = add nsw i32 %189, %191
  %193 = add nsw i32 %192, 1
  store i32 %193, ptr %17, align 4, !tbaa !5
  %194 = call i64 @_ZSt9make_pairIRiiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %7, ptr noundef nonnull align 4 dereferenceable(4) %17)
  store i64 %194, ptr %16, align 4
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %184, ptr noundef nonnull align 4 dereferenceable(8) %16)
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #7
  br label %195

195:                                              ; preds = %173
  %196 = load i32, ptr %3, align 4, !tbaa !5
  %197 = add nsw i32 %196, 1
  store i32 %197, ptr %3, align 4, !tbaa !5
  br label %168, !llvm.loop !16

198:                                              ; preds = %168
  %199 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %7)
  %200 = load i32, ptr %2, align 4, !tbaa !5
  %201 = add nsw i32 %200, 1
  %202 = load i32, ptr @m, align 4, !tbaa !5
  %203 = sub nsw i32 %202, 1
  %204 = mul nsw i32 %201, %203
  %205 = mul nsw i32 %204, 2
  %206 = sext i32 %205 to i64
  %207 = getelementptr inbounds [2000001 x %"class.std::vector"], ptr @G, i64 0, i64 %206
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #7
  %208 = call i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %7, ptr noundef nonnull align 4 dereferenceable(4) @t)
  store i64 %208, ptr %18, align 4
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %207, ptr noundef nonnull align 4 dereferenceable(8) %18)
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #7
  br label %209

209:                                              ; preds = %198
  %210 = load i32, ptr %2, align 4, !tbaa !5
  %211 = add nsw i32 %210, 1
  store i32 %211, ptr %2, align 4, !tbaa !5
  br label %154, !llvm.loop !17

212:                                              ; preds = %154
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %213

213:                                              ; preds = %249, %212
  %214 = load i32, ptr %2, align 4, !tbaa !5
  %215 = load i32, ptr @n, align 4, !tbaa !5
  %216 = sub nsw i32 %215, 1
  %217 = icmp slt i32 %214, %216
  br i1 %217, label %218, label %252

218:                                              ; preds = %213
  store i32 1, ptr %3, align 4, !tbaa !5
  br label %219

219:                                              ; preds = %245, %218
  %220 = load i32, ptr %3, align 4, !tbaa !5
  %221 = load i32, ptr @m, align 4, !tbaa !5
  %222 = icmp slt i32 %220, %221
  br i1 %222, label %223, label %248

223:                                              ; preds = %219
  %224 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %7)
  %225 = load i32, ptr %2, align 4, !tbaa !5
  %226 = load i32, ptr @m, align 4, !tbaa !5
  %227 = sub nsw i32 %226, 1
  %228 = mul nsw i32 %225, %227
  %229 = mul nsw i32 %228, 2
  %230 = load i32, ptr %3, align 4, !tbaa !5
  %231 = mul nsw i32 %230, 2
  %232 = add nsw i32 %229, %231
  %233 = sub nsw i32 %232, 1
  %234 = sext i32 %233 to i64
  %235 = getelementptr inbounds [2000001 x %"class.std::vector"], ptr @G, i64 0, i64 %234
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #7
  %236 = load i32, ptr %2, align 4, !tbaa !5
  %237 = load i32, ptr @m, align 4, !tbaa !5
  %238 = sub nsw i32 %237, 1
  %239 = mul nsw i32 %236, %238
  %240 = mul nsw i32 %239, 2
  %241 = load i32, ptr %3, align 4, !tbaa !5
  %242 = mul nsw i32 %241, 2
  %243 = add nsw i32 %240, %242
  store i32 %243, ptr %20, align 4, !tbaa !5
  %244 = call i64 @_ZSt9make_pairIRiiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %7, ptr noundef nonnull align 4 dereferenceable(4) %20)
  store i64 %244, ptr %19, align 4
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %235, ptr noundef nonnull align 4 dereferenceable(8) %19)
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #7
  br label %245

245:                                              ; preds = %223
  %246 = load i32, ptr %3, align 4, !tbaa !5
  %247 = add nsw i32 %246, 1
  store i32 %247, ptr %3, align 4, !tbaa !5
  br label %219, !llvm.loop !18

248:                                              ; preds = %219
  br label %249

249:                                              ; preds = %248
  %250 = load i32, ptr %2, align 4, !tbaa !5
  %251 = add nsw i32 %250, 1
  store i32 %251, ptr %2, align 4, !tbaa !5
  br label %213, !llvm.loop !19

252:                                              ; preds = %213
  %253 = load i32, ptr @t, align 4, !tbaa !5
  %254 = add nsw i32 %253, 1
  %255 = sext i32 %254 to i64
  call void @_ZNSt6vectorIiSaIiEE6assignEmRKi(ptr noundef nonnull align 8 dereferenceable(24) @d, i64 noundef %255, ptr noundef nonnull align 4 dereferenceable(4) @_ZL3INF)
  %256 = load i32, ptr @t, align 4, !tbaa !5
  %257 = add nsw i32 %256, 1
  %258 = sext i32 %257 to i64
  call void @llvm.lifetime.start.p0(i64 1, ptr %21) #7
  store i8 0, ptr %21, align 1, !tbaa !20
  call void @_ZNSt6vectorIbSaIbEE6assignEmRKb(ptr noundef nonnull align 8 dereferenceable(40) @visited, i64 noundef %258, ptr noundef nonnull align 1 dereferenceable(1) %21)
  call void @llvm.lifetime.end.p0(i64 1, ptr %21) #7
  %259 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @d, i64 noundef 0) #7
  store i32 0, ptr %259, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, ptr %22) #7
  %260 = call { ptr, i64 } @_ZNSt6vectorIbSaIbEEixEm(ptr noundef nonnull align 8 dereferenceable(40) @visited, i64 noundef 0)
  %261 = getelementptr inbounds { ptr, i64 }, ptr %22, i32 0, i32 0
  %262 = extractvalue { ptr, i64 } %260, 0
  store ptr %262, ptr %261, align 8
  %263 = getelementptr inbounds { ptr, i64 }, ptr %22, i32 0, i32 1
  %264 = extractvalue { ptr, i64 } %260, 1
  store i64 %264, ptr %263, align 8
  %265 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt14_Bit_referenceaSEb(ptr noundef nonnull align 8 dereferenceable(16) %22, i1 noundef zeroext true) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %22) #7
  %266 = call noundef i64 @_ZNKSt6vectorISt4pairIiiESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) @G) #7
  %267 = trunc i64 %266 to i32
  store i32 %267, ptr %6, align 4, !tbaa !5
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %268

268:                                              ; preds = %293, %252
  %269 = load i32, ptr %2, align 4, !tbaa !5
  %270 = load i32, ptr %6, align 4, !tbaa !5
  %271 = icmp slt i32 %269, %270
  br i1 %271, label %272, label %296

272:                                              ; preds = %268
  %273 = load i32, ptr %2, align 4, !tbaa !5
  %274 = sext i32 %273 to i64
  %275 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @G, i64 noundef %274) #7
  %276 = getelementptr inbounds %"struct.std::pair", ptr %275, i32 0, i32 1
  %277 = load i32, ptr %276, align 4, !tbaa !22
  %278 = sext i32 %277 to i64
  %279 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @d, i64 noundef %278) #7
  %280 = load i32, ptr %2, align 4, !tbaa !5
  %281 = sext i32 %280 to i64
  %282 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @G, i64 noundef %281) #7
  %283 = getelementptr inbounds %"struct.std::pair", ptr %282, i32 0, i32 0
  %284 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %279, ptr noundef nonnull align 4 dereferenceable(4) %283)
  %285 = load i32, ptr %284, align 4, !tbaa !5
  %286 = load i32, ptr %2, align 4, !tbaa !5
  %287 = sext i32 %286 to i64
  %288 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @G, i64 noundef %287) #7
  %289 = getelementptr inbounds %"struct.std::pair", ptr %288, i32 0, i32 1
  %290 = load i32, ptr %289, align 4, !tbaa !22
  %291 = sext i32 %290 to i64
  %292 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @d, i64 noundef %291) #7
  store i32 %285, ptr %292, align 4, !tbaa !5
  br label %293

293:                                              ; preds = %272
  %294 = load i32, ptr %2, align 4, !tbaa !5
  %295 = add nsw i32 %294, 1
  store i32 %295, ptr %2, align 4, !tbaa !5
  br label %268, !llvm.loop !24

296:                                              ; preds = %268
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %297

297:                                              ; preds = %306, %296
  %298 = load i32, ptr %2, align 4, !tbaa !5
  %299 = load i32, ptr @t, align 4, !tbaa !5
  %300 = icmp sle i32 %298, %299
  br i1 %300, label %301, label %309

301:                                              ; preds = %297
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #7
  %302 = load i32, ptr %2, align 4, !tbaa !5
  %303 = sext i32 %302 to i64
  %304 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @d, i64 noundef %303) #7
  %305 = call i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %304, ptr noundef nonnull align 4 dereferenceable(4) %2)
  store i64 %305, ptr %23, align 4
  call void @_ZNSt14priority_queueISt4pairIiiESt6vectorIS1_SaIS1_EESt7greaterIS1_EE4pushEOS1_(ptr noundef nonnull align 8 dereferenceable(25) @q, ptr noundef nonnull align 4 dereferenceable(8) %23)
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #7
  br label %306

306:                                              ; preds = %301
  %307 = load i32, ptr %2, align 4, !tbaa !5
  %308 = add nsw i32 %307, 1
  store i32 %308, ptr %2, align 4, !tbaa !5
  br label %297, !llvm.loop !25

309:                                              ; preds = %297
  store i32 2, ptr %2, align 4, !tbaa !5
  br label %310

310:                                              ; preds = %385, %309
  %311 = load i32, ptr %2, align 4, !tbaa !5
  %312 = load i32, ptr @t, align 4, !tbaa !5
  %313 = icmp slt i32 %311, %312
  br i1 %313, label %314, label %388

314:                                              ; preds = %310
  br label %315

315:                                              ; preds = %319, %314
  %316 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNKSt14priority_queueISt4pairIiiESt6vectorIS1_SaIS1_EESt7greaterIS1_EE3topEv(ptr noundef nonnull align 8 dereferenceable(25) @q)
  %317 = getelementptr inbounds %"struct.std::pair", ptr %316, i32 0, i32 1
  %318 = load i32, ptr %317, align 4, !tbaa !22
  store i32 %318, ptr %4, align 4, !tbaa !5
  call void @_ZNSt14priority_queueISt4pairIiiESt6vectorIS1_SaIS1_EESt7greaterIS1_EE3popEv(ptr noundef nonnull align 8 dereferenceable(25) @q)
  br label %319

319:                                              ; preds = %315
  call void @llvm.lifetime.start.p0(i64 16, ptr %24) #7
  %320 = load i32, ptr %4, align 4, !tbaa !5
  %321 = sext i32 %320 to i64
  %322 = call { ptr, i64 } @_ZNSt6vectorIbSaIbEEixEm(ptr noundef nonnull align 8 dereferenceable(40) @visited, i64 noundef %321)
  %323 = getelementptr inbounds { ptr, i64 }, ptr %24, i32 0, i32 0
  %324 = extractvalue { ptr, i64 } %322, 0
  store ptr %324, ptr %323, align 8
  %325 = getelementptr inbounds { ptr, i64 }, ptr %24, i32 0, i32 1
  %326 = extractvalue { ptr, i64 } %322, 1
  store i64 %326, ptr %325, align 8
  %327 = call noundef zeroext i1 @_ZNKSt14_Bit_referencecvbEv(ptr noundef nonnull align 8 dereferenceable(16) %24) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %24) #7
  br i1 %327, label %315, label %328, !llvm.loop !26

328:                                              ; preds = %319
  call void @llvm.lifetime.start.p0(i64 16, ptr %25) #7
  %329 = load i32, ptr %4, align 4, !tbaa !5
  %330 = sext i32 %329 to i64
  %331 = call { ptr, i64 } @_ZNSt6vectorIbSaIbEEixEm(ptr noundef nonnull align 8 dereferenceable(40) @visited, i64 noundef %330)
  %332 = getelementptr inbounds { ptr, i64 }, ptr %25, i32 0, i32 0
  %333 = extractvalue { ptr, i64 } %331, 0
  store ptr %333, ptr %332, align 8
  %334 = getelementptr inbounds { ptr, i64 }, ptr %25, i32 0, i32 1
  %335 = extractvalue { ptr, i64 } %331, 1
  store i64 %335, ptr %334, align 8
  %336 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt14_Bit_referenceaSEb(ptr noundef nonnull align 8 dereferenceable(16) %25, i1 noundef zeroext true) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %25) #7
  %337 = load i32, ptr %4, align 4, !tbaa !5
  %338 = sext i32 %337 to i64
  %339 = getelementptr inbounds [2000001 x %"class.std::vector"], ptr @G, i64 0, i64 %338
  %340 = call noundef i64 @_ZNKSt6vectorISt4pairIiiESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %339) #7
  %341 = trunc i64 %340 to i32
  store i32 %341, ptr %6, align 4, !tbaa !5
  store i32 0, ptr %3, align 4, !tbaa !5
  br label %342

342:                                              ; preds = %381, %328
  %343 = load i32, ptr %3, align 4, !tbaa !5
  %344 = load i32, ptr %6, align 4, !tbaa !5
  %345 = icmp slt i32 %343, %344
  br i1 %345, label %346, label %384

346:                                              ; preds = %342
  %347 = load i32, ptr %4, align 4, !tbaa !5
  %348 = sext i32 %347 to i64
  %349 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @d, i64 noundef %348) #7
  %350 = load i32, ptr %349, align 4, !tbaa !5
  %351 = load i32, ptr %4, align 4, !tbaa !5
  %352 = sext i32 %351 to i64
  %353 = getelementptr inbounds [2000001 x %"class.std::vector"], ptr @G, i64 0, i64 %352
  %354 = load i32, ptr %3, align 4, !tbaa !5
  %355 = sext i32 %354 to i64
  %356 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %353, i64 noundef %355) #7
  %357 = getelementptr inbounds %"struct.std::pair", ptr %356, i32 0, i32 0
  %358 = load i32, ptr %357, align 4, !tbaa !27
  %359 = add nsw i32 %350, %358
  store i32 %359, ptr %7, align 4, !tbaa !5
  %360 = load i32, ptr %4, align 4, !tbaa !5
  %361 = sext i32 %360 to i64
  %362 = getelementptr inbounds [2000001 x %"class.std::vector"], ptr @G, i64 0, i64 %361
  %363 = load i32, ptr %3, align 4, !tbaa !5
  %364 = sext i32 %363 to i64
  %365 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %362, i64 noundef %364) #7
  %366 = getelementptr inbounds %"struct.std::pair", ptr %365, i32 0, i32 1
  %367 = load i32, ptr %366, align 4, !tbaa !22
  store i32 %367, ptr %5, align 4, !tbaa !5
  %368 = load i32, ptr %7, align 4, !tbaa !5
  %369 = load i32, ptr %5, align 4, !tbaa !5
  %370 = sext i32 %369 to i64
  %371 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @d, i64 noundef %370) #7
  %372 = load i32, ptr %371, align 4, !tbaa !5
  %373 = icmp slt i32 %368, %372
  br i1 %373, label %374, label %380

374:                                              ; preds = %346
  %375 = load i32, ptr %7, align 4, !tbaa !5
  %376 = load i32, ptr %5, align 4, !tbaa !5
  %377 = sext i32 %376 to i64
  %378 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @d, i64 noundef %377) #7
  store i32 %375, ptr %378, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #7
  %379 = call i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %7, ptr noundef nonnull align 4 dereferenceable(4) %5)
  store i64 %379, ptr %26, align 4
  call void @_ZNSt14priority_queueISt4pairIiiESt6vectorIS1_SaIS1_EESt7greaterIS1_EE4pushEOS1_(ptr noundef nonnull align 8 dereferenceable(25) @q, ptr noundef nonnull align 4 dereferenceable(8) %26)
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #7
  br label %380

380:                                              ; preds = %374, %346
  br label %381

381:                                              ; preds = %380
  %382 = load i32, ptr %3, align 4, !tbaa !5
  %383 = add nsw i32 %382, 1
  store i32 %383, ptr %3, align 4, !tbaa !5
  br label %342, !llvm.loop !28

384:                                              ; preds = %342
  br label %385

385:                                              ; preds = %384
  %386 = load i32, ptr %2, align 4, !tbaa !5
  %387 = add nsw i32 %386, 1
  store i32 %387, ptr %2, align 4, !tbaa !5
  br label %310, !llvm.loop !29

388:                                              ; preds = %310
  %389 = load i32, ptr @t, align 4, !tbaa !5
  %390 = sext i32 %389 to i64
  %391 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @d, i64 noundef %390) #7
  %392 = load i32, ptr %391, align 4, !tbaa !5
  %393 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %392)
  %394 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %393, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  store i32 0, ptr %1, align 4
  store i32 1, ptr %8, align 4
  br label %395

395:                                              ; preds = %388, %65, %45
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #7
  %396 = load i32, ptr %1, align 4
  ret i32 %396
}

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

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

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

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

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) #2

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

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

; 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)) #4 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)) #4

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

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local { ptr, i64 } @_ZNSt6vectorIbSaIbEEixEm(ptr noundef nonnull align 8 dereferenceable(40), i64 noundef) #4 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt14_Bit_referenceaSEb(ptr noundef nonnull align 8 dereferenceable(16), i1 noundef zeroext) #6 align 2

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(8) ptr @_ZNKSt14priority_queueISt4pairIiiESt6vectorIS1_SaIS1_EESt7greaterIS1_EE3topEv(ptr noundef nonnull align 8 dereferenceable(25)) #6 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNKSt14_Bit_referencecvbEv(ptr noundef nonnull align 8 dereferenceable(16)) #6 align 2

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

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

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


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

%"class.std::priority_queue" = type <{ %"class.std::vector", [8 x i8] }>
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = 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::vector.0" = type { %"struct.std::_Vector_base.1" }
%"struct.std::_Vector_base.1" = 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.5" = type { %"struct.std::_Bvector_base" }
%"struct.std::_Bvector_base" = type { %"struct.std::_Bvector_base<std::allocator<bool>>::_Bvector_impl" }
%"struct.std::_Bvector_base<std::allocator<bool>>::_Bvector_impl" = type { %"struct.std::_Bvector_base<std::allocator<bool>>::_Bvector_impl_data" }
%"struct.std::_Bvector_base<std::allocator<bool>>::_Bvector_impl_data" = type { %"struct.std::_Bit_iterator", %"struct.std::_Bit_iterator", ptr }
%"struct.std::_Bit_iterator" = type { %"struct.std::_Bit_iterator_base.base", [4 x i8] }
%"struct.std::_Bit_iterator_base.base" = type <{ ptr, i32 }>
%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"struct.std::pair" = type { i32, i32 }
%"struct.std::_Bit_reference" = type { ptr, i64 }

@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@t = external dso_local global i32, align 4
@q = external dso_local global %"class.std::priority_queue", align 8
@d = external dso_local global %"class.std::vector.0", align 8
@visited = external dso_local global %"class.std::vector.5", align 8
@G = external dso_local global [2000001 x %"class.std::vector"], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@_ZL3INF = external hidden constant i32, align 4

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca %"struct.std::pair", align 8
  %6 = alloca %"struct.std::pair", align 8
  %7 = alloca i32, align 4
  %8 = alloca %"struct.std::pair", align 8
  %9 = alloca i32, align 4
  %10 = alloca %"struct.std::pair", align 8
  %11 = alloca i32, align 4
  %12 = alloca %"struct.std::pair", align 8
  %13 = alloca i32, align 4
  %14 = alloca %"struct.std::pair", align 8
  %15 = alloca %"struct.std::pair", align 8
  %16 = alloca i32, align 4
  %17 = alloca i8, align 1
  %18 = alloca %"struct.std::_Bit_reference", align 8
  %19 = alloca %"struct.std::pair", align 8
  %20 = alloca %"struct.std::_Bit_reference", align 8
  %21 = alloca %"struct.std::_Bit_reference", align 8
  %22 = alloca %"struct.std::pair", align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #7
  %23 = tail call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %24 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) @n)
  %25 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %24, ptr noundef nonnull align 4 dereferenceable(4) @m)
  %26 = load i32, ptr @n, align 4, !tbaa !5
  %27 = icmp eq i32 %26, 1
  br i1 %27, label %28, label %39

28:                                               ; preds = %0
  %29 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %30 = load i32, ptr @m, align 4, !tbaa !5
  %31 = icmp sgt i32 %30, 2
  br i1 %31, label %.lr.ph57, label %.._crit_edge58_crit_edge

.._crit_edge58_crit_edge:                         ; preds = %28
  %.pre65 = load i32, ptr %2, align 4, !tbaa !5
  br label %._crit_edge58

.lr.ph57:                                         ; preds = %28, %.lr.ph57
  %32 = phi i32 [ %36, %.lr.ph57 ], [ 2, %28 ]
  %33 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %34 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %2, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %35 = load i32, ptr %34, align 4, !tbaa !5
  store i32 %35, ptr %2, align 4, !tbaa !5
  %36 = add nuw nsw i32 %32, 1
  %37 = load i32, ptr @m, align 4, !tbaa !5
  %38 = icmp slt i32 %36, %37
  br i1 %38, label %.lr.ph57, label %._crit_edge58, !llvm.loop !9

39:                                               ; preds = %0
  %40 = load i32, ptr @m, align 4, !tbaa !5
  %41 = icmp eq i32 %40, 1
  br i1 %41, label %42, label %53

42:                                               ; preds = %39
  %43 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %44 = load i32, ptr @n, align 4, !tbaa !5
  %45 = icmp sgt i32 %44, 2
  br i1 %45, label %.lr.ph54, label %.._crit_edge55_crit_edge

.._crit_edge55_crit_edge:                         ; preds = %42
  %.pre64 = load i32, ptr %2, align 4, !tbaa !5
  br label %._crit_edge58

.lr.ph54:                                         ; preds = %42, %.lr.ph54
  %46 = phi i32 [ %50, %.lr.ph54 ], [ 2, %42 ]
  %47 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %48 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %2, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %49 = load i32, ptr %48, align 4, !tbaa !5
  store i32 %49, ptr %2, align 4, !tbaa !5
  %50 = add nuw nsw i32 %46, 1
  %51 = load i32, ptr @n, align 4, !tbaa !5
  %52 = icmp slt i32 %50, %51
  br i1 %52, label %.lr.ph54, label %._crit_edge58, !llvm.loop !11

53:                                               ; preds = %39
  %54 = add nsw i32 %40, -1
  %55 = shl i32 %26, 1
  %56 = add i32 %55, -2
  %57 = mul i32 %56, %54
  %58 = or disjoint i32 %57, 1
  store i32 %58, ptr @t, align 4, !tbaa !5
  %59 = icmp sgt i32 %40, 1
  br i1 %59, label %.lr.ph, label %.preheader32

.preheader32.loopexit:                            ; preds = %.lr.ph
  %.pre = load i32, ptr @n, align 4, !tbaa !5
  br label %.preheader32

.preheader32:                                     ; preds = %.preheader32.loopexit, %53
  %60 = phi i32 [ %70, %.preheader32.loopexit ], [ %40, %53 ]
  %61 = phi i32 [ %.pre, %.preheader32.loopexit ], [ %26, %53 ]
  %62 = icmp sgt i32 %61, 2
  br i1 %62, label %.preheader31, label %.preheader30

.lr.ph:                                           ; preds = %53, %.lr.ph
  %63 = phi i32 [ %69, %.lr.ph ], [ 1, %53 ]
  %64 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %65 = shl nuw nsw i32 %63, 1
  %66 = zext nneg i32 %65 to i64
  %67 = getelementptr inbounds [2000001 x %"class.std::vector"], ptr @G, i64 0, i64 %66
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #7
  %68 = call i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %4, ptr noundef nonnull align 4 dereferenceable(4) @t)
  store i64 %68, ptr %5, align 8
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %67, ptr noundef nonnull align 4 dereferenceable(8) %5)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #7
  %69 = add nuw nsw i32 %63, 1
  store i32 %69, ptr %1, align 4, !tbaa !5
  %70 = load i32, ptr @m, align 4, !tbaa !5
  %71 = icmp slt i32 %69, %70
  br i1 %71, label %.lr.ph, label %.preheader32.loopexit, !llvm.loop !12

.preheader31:                                     ; preds = %.preheader32, %._crit_edge
  %72 = phi i32 [ %98, %._crit_edge ], [ %61, %.preheader32 ]
  %73 = phi i32 [ %100, %._crit_edge ], [ 1, %.preheader32 ]
  %74 = phi i32 [ %99, %._crit_edge ], [ %60, %.preheader32 ]
  store i32 1, ptr %2, align 4, !tbaa !5
  %75 = icmp sgt i32 %74, 1
  br i1 %75, label %.lr.ph34.preheader, label %._crit_edge

.lr.ph34.preheader:                               ; preds = %.preheader31
  %76 = add nuw i32 %73, 2147483647
  br label %.lr.ph34

.preheader30:                                     ; preds = %._crit_edge, %.preheader32
  %77 = phi i32 [ %61, %.preheader32 ], [ %98, %._crit_edge ]
  %78 = phi i32 [ %60, %.preheader32 ], [ %99, %._crit_edge ]
  %79 = icmp sgt i32 %78, 1
  br i1 %79, label %.lr.ph35, label %.preheader29

.lr.ph34:                                         ; preds = %.lr.ph34.preheader, %.lr.ph34
  %80 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %81 = load i32, ptr @m, align 4, !tbaa !5
  %82 = add i32 %81, 2147483647
  %83 = mul i32 %82, %73
  %84 = load i32, ptr %2, align 4, !tbaa !5
  %85 = add i32 %83, %84
  %86 = shl i32 %85, 1
  %87 = sext i32 %86 to i64
  %88 = getelementptr inbounds [2000001 x %"class.std::vector"], ptr @G, i64 0, i64 %87
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #7
  %89 = mul i32 %82, %76
  %90 = add i32 %89, %84
  %91 = shl i32 %90, 1
  %92 = add nsw i32 %91, -1
  store i32 %92, ptr %7, align 4, !tbaa !5
  %93 = call i64 @_ZSt9make_pairIRiiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %4, ptr noundef nonnull align 4 dereferenceable(4) %7)
  store i64 %93, ptr %6, align 8
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %88, ptr noundef nonnull align 4 dereferenceable(8) %6)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #7
  %94 = load i32, ptr %2, align 4, !tbaa !5
  %95 = add nsw i32 %94, 1
  store i32 %95, ptr %2, align 4, !tbaa !5
  %96 = load i32, ptr @m, align 4, !tbaa !5
  %97 = icmp slt i32 %95, %96
  br i1 %97, label %.lr.ph34, label %._crit_edge.loopexit, !llvm.loop !13

._crit_edge.loopexit:                             ; preds = %.lr.ph34
  %.pre60 = load i32, ptr @n, align 4, !tbaa !5
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %.preheader31
  %98 = phi i32 [ %.pre60, %._crit_edge.loopexit ], [ %72, %.preheader31 ]
  %99 = phi i32 [ %96, %._crit_edge.loopexit ], [ %74, %.preheader31 ]
  %100 = add nuw nsw i32 %73, 1
  store i32 %100, ptr %1, align 4, !tbaa !5
  %101 = add nsw i32 %98, -1
  %102 = icmp slt i32 %100, %101
  br i1 %102, label %.preheader31, label %.preheader30, !llvm.loop !14

.preheader29.loopexit:                            ; preds = %.lr.ph35
  %.pre61 = load i32, ptr @n, align 4, !tbaa !5
  br label %.preheader29

.preheader29:                                     ; preds = %.preheader29.loopexit, %.preheader30
  %103 = phi i32 [ %.pre61, %.preheader29.loopexit ], [ %77, %.preheader30 ]
  %104 = icmp sgt i32 %103, 1
  br i1 %104, label %.lr.ph39, label %.preheader28.thread

.preheader28.thread:                              ; preds = %.preheader29
  store i32 0, ptr %1, align 4, !tbaa !5
  br label %._crit_edge42

.lr.ph35:                                         ; preds = %.preheader30, %.lr.ph35
  %105 = phi i32 [ %116, %.lr.ph35 ], [ 1, %.preheader30 ]
  %106 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %4)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %9) #7
  %107 = load i32, ptr @n, align 4, !tbaa !5
  %108 = add i32 %107, 2147483646
  %109 = load i32, ptr @m, align 4, !tbaa !5
  %110 = add i32 %109, 2147483647
  %111 = mul i32 %110, %108
  %112 = add i32 %111, %105
  %113 = shl i32 %112, 1
  %114 = add nsw i32 %113, -1
  store i32 %114, ptr %9, align 4, !tbaa !5
  %115 = call i64 @_ZSt9make_pairIRiiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %4, ptr noundef nonnull align 4 dereferenceable(4) %9)
  store i64 %115, ptr %8, align 8
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) @G, ptr noundef nonnull align 4 dereferenceable(8) %8)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #7
  %116 = add nuw nsw i32 %105, 1
  store i32 %116, ptr %1, align 4, !tbaa !5
  %117 = load i32, ptr @m, align 4, !tbaa !5
  %118 = icmp slt i32 %116, %117
  br i1 %118, label %.lr.ph35, label %.preheader29.loopexit, !llvm.loop !15

.preheader28:                                     ; preds = %._crit_edge38
  %119 = icmp sgt i32 %155, 1
  br i1 %119, label %.preheader27.preheader, label %._crit_edge42

.preheader27.preheader:                           ; preds = %.preheader28
  %.pre62 = load i32, ptr @m, align 4, !tbaa !5
  br label %.preheader27

.lr.ph39:                                         ; preds = %.preheader29, %._crit_edge38
  %120 = phi i32 [ %154, %._crit_edge38 ], [ 0, %.preheader29 ]
  %121 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %4)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %11) #7
  %122 = load i32, ptr @m, align 4, !tbaa !5
  %123 = add nsw i32 %122, -1
  %124 = shl nuw i32 %120, 1
  %125 = mul i32 %124, %123
  %126 = or disjoint i32 %125, 1
  store i32 %126, ptr %11, align 4, !tbaa !5
  %127 = call i64 @_ZSt9make_pairIRiiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %4, ptr noundef nonnull align 4 dereferenceable(4) %11)
  store i64 %127, ptr %10, align 8
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) @G, ptr noundef nonnull align 4 dereferenceable(8) %10)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %11) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #7
  store i32 1, ptr %2, align 4, !tbaa !5
  %128 = load i32, ptr @m, align 4, !tbaa !5
  %129 = icmp sgt i32 %128, 2
  br i1 %129, label %.lr.ph37, label %._crit_edge38

.lr.ph37:                                         ; preds = %.lr.ph39, %.lr.ph37
  %130 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %131 = load i32, ptr @m, align 4, !tbaa !5
  %132 = add i32 %131, 2147483647
  %133 = mul i32 %132, %120
  %134 = load i32, ptr %2, align 4, !tbaa !5
  %135 = add i32 %133, %134
  %136 = shl i32 %135, 1
  %137 = sext i32 %136 to i64
  %138 = getelementptr inbounds [2000001 x %"class.std::vector"], ptr @G, i64 0, i64 %137
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %12) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %13) #7
  %139 = or disjoint i32 %136, 1
  store i32 %139, ptr %13, align 4, !tbaa !5
  %140 = call i64 @_ZSt9make_pairIRiiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %4, ptr noundef nonnull align 4 dereferenceable(4) %13)
  store i64 %140, ptr %12, align 8
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %138, ptr noundef nonnull align 4 dereferenceable(8) %12)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %13) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #7
  %141 = load i32, ptr %2, align 4, !tbaa !5
  %142 = add nsw i32 %141, 1
  store i32 %142, ptr %2, align 4, !tbaa !5
  %143 = load i32, ptr @m, align 4, !tbaa !5
  %144 = add nsw i32 %143, -1
  %145 = icmp slt i32 %142, %144
  br i1 %145, label %.lr.ph37, label %._crit_edge38, !llvm.loop !16

._crit_edge38:                                    ; preds = %.lr.ph37, %.lr.ph39
  %146 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %147 = load i32, ptr @m, align 4, !tbaa !5
  %148 = add nsw i32 %147, -1
  %149 = add i32 %124, 2
  %150 = mul i32 %149, %148
  %151 = sext i32 %150 to i64
  %152 = getelementptr inbounds [2000001 x %"class.std::vector"], ptr @G, i64 0, i64 %151
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %14) #7
  %153 = call i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %4, ptr noundef nonnull align 4 dereferenceable(4) @t)
  store i64 %153, ptr %14, align 8
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %152, ptr noundef nonnull align 4 dereferenceable(8) %14)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %14) #7
  %154 = add nuw nsw i32 %120, 1
  %155 = load i32, ptr @n, align 4, !tbaa !5
  %156 = add nsw i32 %155, -1
  %157 = icmp slt i32 %154, %156
  br i1 %157, label %.lr.ph39, label %.preheader28, !llvm.loop !17

.preheader27:                                     ; preds = %.preheader27.preheader, %._crit_edge41
  %158 = phi i32 [ %155, %.preheader27.preheader ], [ %177, %._crit_edge41 ]
  %159 = phi i32 [ 0, %.preheader27.preheader ], [ %179, %._crit_edge41 ]
  %160 = phi i32 [ %.pre62, %.preheader27.preheader ], [ %178, %._crit_edge41 ]
  store i32 1, ptr %2, align 4, !tbaa !5
  %161 = icmp sgt i32 %160, 1
  br i1 %161, label %.lr.ph40, label %._crit_edge41

.lr.ph40:                                         ; preds = %.preheader27, %.lr.ph40
  %162 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %163 = load i32, ptr @m, align 4, !tbaa !5
  %164 = add i32 %163, 2147483647
  %165 = mul i32 %164, %159
  %166 = load i32, ptr %2, align 4, !tbaa !5
  %167 = add i32 %165, %166
  %168 = shl i32 %167, 1
  %169 = add nsw i32 %168, -1
  %170 = sext i32 %169 to i64
  %171 = getelementptr inbounds [2000001 x %"class.std::vector"], ptr @G, i64 0, i64 %170
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %15) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %16) #7
  store i32 %168, ptr %16, align 4, !tbaa !5
  %172 = call i64 @_ZSt9make_pairIRiiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %4, ptr noundef nonnull align 4 dereferenceable(4) %16)
  store i64 %172, ptr %15, align 8
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %171, ptr noundef nonnull align 4 dereferenceable(8) %15)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %16) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %15) #7
  %173 = load i32, ptr %2, align 4, !tbaa !5
  %174 = add nsw i32 %173, 1
  store i32 %174, ptr %2, align 4, !tbaa !5
  %175 = load i32, ptr @m, align 4, !tbaa !5
  %176 = icmp slt i32 %174, %175
  br i1 %176, label %.lr.ph40, label %._crit_edge41.loopexit, !llvm.loop !18

._crit_edge41.loopexit:                           ; preds = %.lr.ph40
  %.pre63 = load i32, ptr @n, align 4, !tbaa !5
  br label %._crit_edge41

._crit_edge41:                                    ; preds = %._crit_edge41.loopexit, %.preheader27
  %177 = phi i32 [ %.pre63, %._crit_edge41.loopexit ], [ %158, %.preheader27 ]
  %178 = phi i32 [ %175, %._crit_edge41.loopexit ], [ %160, %.preheader27 ]
  %179 = add nuw nsw i32 %159, 1
  store i32 %179, ptr %1, align 4, !tbaa !5
  %180 = add nsw i32 %177, -1
  %181 = icmp slt i32 %179, %180
  br i1 %181, label %.preheader27, label %._crit_edge42, !llvm.loop !19

._crit_edge42:                                    ; preds = %._crit_edge41, %.preheader28.thread, %.preheader28
  %182 = load i32, ptr @t, align 4, !tbaa !5
  %183 = add nsw i32 %182, 1
  %184 = sext i32 %183 to i64
  call void @_ZNSt6vectorIiSaIiEE6assignEmRKi(ptr noundef nonnull align 8 dereferenceable(24) @d, i64 noundef %184, ptr noundef nonnull align 4 dereferenceable(4) @_ZL3INF)
  %185 = load i32, ptr @t, align 4, !tbaa !5
  %186 = add nsw i32 %185, 1
  %187 = sext i32 %186 to i64
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %17) #7
  store i8 0, ptr %17, align 1, !tbaa !20
  call void @_ZNSt6vectorIbSaIbEE6assignEmRKb(ptr noundef nonnull align 8 dereferenceable(40) @visited, i64 noundef %187, ptr noundef nonnull align 1 dereferenceable(1) %17)
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %17) #7
  %188 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @d, i64 noundef 0) #7
  store i32 0, ptr %188, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %18) #7
  %189 = call { ptr, i64 } @_ZNSt6vectorIbSaIbEEixEm(ptr noundef nonnull align 8 dereferenceable(40) @visited, i64 noundef 0)
  %190 = extractvalue { ptr, i64 } %189, 0
  store ptr %190, ptr %18, align 8
  %191 = getelementptr inbounds i8, ptr %18, i64 8
  %192 = extractvalue { ptr, i64 } %189, 1
  store i64 %192, ptr %191, align 8
  %193 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt14_Bit_referenceaSEb(ptr noundef nonnull align 8 dereferenceable(16) %18, i1 noundef zeroext true) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %18) #7
  %194 = call noundef i64 @_ZNKSt6vectorISt4pairIiiESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) @G) #7
  %195 = trunc i64 %194 to i32
  %196 = icmp sgt i32 %195, 0
  br i1 %196, label %.lr.ph45, label %.preheader26

.preheader26:                                     ; preds = %.lr.ph45, %._crit_edge42
  store i32 0, ptr %1, align 4, !tbaa !5
  %197 = load i32, ptr @t, align 4, !tbaa !5
  %.not46 = icmp slt i32 %197, 0
  br i1 %.not46, label %.preheader25.thread, label %.lr.ph48

.preheader25.thread:                              ; preds = %.preheader26
  store i32 2, ptr %1, align 4, !tbaa !5
  br label %._crit_edge52

.lr.ph45:                                         ; preds = %._crit_edge42, %.lr.ph45
  %198 = phi i32 [ %213, %.lr.ph45 ], [ 0, %._crit_edge42 ]
  %199 = zext nneg i32 %198 to i64
  %200 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @G, i64 noundef %199) #7
  %201 = getelementptr inbounds i8, ptr %200, i64 4
  %202 = load i32, ptr %201, align 4, !tbaa !22
  %203 = sext i32 %202 to i64
  %204 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @d, i64 noundef %203) #7
  %205 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @G, i64 noundef %199) #7
  %206 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %204, ptr noundef nonnull align 4 dereferenceable(4) %205)
  %207 = load i32, ptr %206, align 4, !tbaa !5
  %208 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @G, i64 noundef %199) #7
  %209 = getelementptr inbounds i8, ptr %208, i64 4
  %210 = load i32, ptr %209, align 4, !tbaa !22
  %211 = sext i32 %210 to i64
  %212 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @d, i64 noundef %211) #7
  store i32 %207, ptr %212, align 4, !tbaa !5
  %213 = add nuw nsw i32 %198, 1
  %214 = icmp slt i32 %213, %195
  br i1 %214, label %.lr.ph45, label %.preheader26, !llvm.loop !24

.preheader25:                                     ; preds = %.lr.ph48
  store i32 2, ptr %1, align 4, !tbaa !5
  %215 = icmp sgt i32 %223, 2
  br i1 %215, label %.preheader.lr.ph, label %._crit_edge52

.preheader.lr.ph:                                 ; preds = %.preheader25
  %216 = getelementptr inbounds i8, ptr %20, i64 8
  %217 = getelementptr inbounds i8, ptr %21, i64 8
  br label %.preheader

.lr.ph48:                                         ; preds = %.preheader26, %.lr.ph48
  %storemerge1747 = phi i32 [ %222, %.lr.ph48 ], [ 0, %.preheader26 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %19) #7
  %218 = sext i32 %storemerge1747 to i64
  %219 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @d, i64 noundef %218) #7
  %220 = call i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %219, ptr noundef nonnull align 4 dereferenceable(4) %1)
  store i64 %220, ptr %19, align 8
  call void @_ZNSt14priority_queueISt4pairIiiESt6vectorIS1_SaIS1_EESt7greaterIS1_EE4pushEOS1_(ptr noundef nonnull align 8 dereferenceable(25) @q, ptr noundef nonnull align 4 dereferenceable(8) %19)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %19) #7
  %221 = load i32, ptr %1, align 4, !tbaa !5
  %222 = add nsw i32 %221, 1
  store i32 %222, ptr %1, align 4, !tbaa !5
  %223 = load i32, ptr @t, align 4, !tbaa !5
  %.not.not = icmp slt i32 %221, %223
  br i1 %.not.not, label %.lr.ph48, label %.preheader25, !llvm.loop !25

.preheader:                                       ; preds = %.preheader.backedge, %.preheader.lr.ph
  %224 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNKSt14priority_queueISt4pairIiiESt6vectorIS1_SaIS1_EESt7greaterIS1_EE3topEv(ptr noundef nonnull align 8 dereferenceable(25) @q)
  %225 = getelementptr inbounds i8, ptr %224, i64 4
  %226 = load i32, ptr %225, align 4, !tbaa !22
  call void @_ZNSt14priority_queueISt4pairIiiESt6vectorIS1_SaIS1_EESt7greaterIS1_EE3popEv(ptr noundef nonnull align 8 dereferenceable(25) @q)
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %20) #7
  %227 = sext i32 %226 to i64
  %228 = call { ptr, i64 } @_ZNSt6vectorIbSaIbEEixEm(ptr noundef nonnull align 8 dereferenceable(40) @visited, i64 noundef %227)
  %229 = extractvalue { ptr, i64 } %228, 0
  store ptr %229, ptr %20, align 8
  %230 = extractvalue { ptr, i64 } %228, 1
  store i64 %230, ptr %216, align 8
  %231 = call noundef zeroext i1 @_ZNKSt14_Bit_referencecvbEv(ptr noundef nonnull align 8 dereferenceable(16) %20) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %20) #7
  br i1 %231, label %.preheader.backedge, label %232

.preheader.backedge:                              ; preds = %.preheader, %._crit_edge51
  br label %.preheader, !llvm.loop !26

232:                                              ; preds = %.preheader
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %21) #7
  %233 = call { ptr, i64 } @_ZNSt6vectorIbSaIbEEixEm(ptr noundef nonnull align 8 dereferenceable(40) @visited, i64 noundef %227)
  %234 = extractvalue { ptr, i64 } %233, 0
  store ptr %234, ptr %21, align 8
  %235 = extractvalue { ptr, i64 } %233, 1
  store i64 %235, ptr %217, align 8
  %236 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt14_Bit_referenceaSEb(ptr noundef nonnull align 8 dereferenceable(16) %21, i1 noundef zeroext true) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %21) #7
  %237 = getelementptr inbounds [2000001 x %"class.std::vector"], ptr @G, i64 0, i64 %227
  %238 = call noundef i64 @_ZNKSt6vectorISt4pairIiiESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %237) #7
  %239 = trunc i64 %238 to i32
  store i32 0, ptr %2, align 4, !tbaa !5
  %240 = icmp sgt i32 %239, 0
  br i1 %240, label %.lr.ph50, label %._crit_edge51

.lr.ph50:                                         ; preds = %232, %264
  %241 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @d, i64 noundef %227) #7
  %242 = load i32, ptr %241, align 4, !tbaa !5
  %243 = load i32, ptr %2, align 4, !tbaa !5
  %244 = sext i32 %243 to i64
  %245 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %237, i64 noundef %244) #7
  %246 = load i32, ptr %245, align 4, !tbaa !27
  %247 = add nsw i32 %246, %242
  store i32 %247, ptr %4, align 4, !tbaa !5
  %248 = load i32, ptr %2, align 4, !tbaa !5
  %249 = sext i32 %248 to i64
  %250 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %237, i64 noundef %249) #7
  %251 = getelementptr inbounds i8, ptr %250, i64 4
  %252 = load i32, ptr %251, align 4, !tbaa !22
  store i32 %252, ptr %3, align 4, !tbaa !5
  %253 = load i32, ptr %4, align 4, !tbaa !5
  %254 = sext i32 %252 to i64
  %255 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @d, i64 noundef %254) #7
  %256 = load i32, ptr %255, align 4, !tbaa !5
  %257 = icmp slt i32 %253, %256
  br i1 %257, label %258, label %264

258:                                              ; preds = %.lr.ph50
  %259 = load i32, ptr %4, align 4, !tbaa !5
  %260 = load i32, ptr %3, align 4, !tbaa !5
  %261 = sext i32 %260 to i64
  %262 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @d, i64 noundef %261) #7
  store i32 %259, ptr %262, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %22) #7
  %263 = call i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %4, ptr noundef nonnull align 4 dereferenceable(4) %3)
  store i64 %263, ptr %22, align 8
  call void @_ZNSt14priority_queueISt4pairIiiESt6vectorIS1_SaIS1_EESt7greaterIS1_EE4pushEOS1_(ptr noundef nonnull align 8 dereferenceable(25) @q, ptr noundef nonnull align 4 dereferenceable(8) %22)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %22) #7
  br label %264

264:                                              ; preds = %.lr.ph50, %258
  %265 = load i32, ptr %2, align 4, !tbaa !5
  %266 = add nsw i32 %265, 1
  store i32 %266, ptr %2, align 4, !tbaa !5
  %267 = icmp slt i32 %266, %239
  br i1 %267, label %.lr.ph50, label %._crit_edge51, !llvm.loop !28

._crit_edge51:                                    ; preds = %264, %232
  %268 = load i32, ptr %1, align 4, !tbaa !5
  %269 = add nsw i32 %268, 1
  store i32 %269, ptr %1, align 4, !tbaa !5
  %270 = load i32, ptr @t, align 4, !tbaa !5
  %271 = icmp slt i32 %269, %270
  br i1 %271, label %.preheader.backedge, label %._crit_edge52

._crit_edge52:                                    ; preds = %._crit_edge51, %.preheader25.thread, %.preheader25
  %.lcssa33 = phi i32 [ %223, %.preheader25 ], [ %197, %.preheader25.thread ], [ %270, %._crit_edge51 ]
  %272 = sext i32 %.lcssa33 to i64
  %273 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @d, i64 noundef %272) #7
  %274 = load i32, ptr %273, align 4, !tbaa !5
  br label %._crit_edge58

._crit_edge58:                                    ; preds = %.lr.ph54, %.lr.ph57, %.._crit_edge55_crit_edge, %.._crit_edge58_crit_edge, %._crit_edge52
  %.sink76 = phi i32 [ %274, %._crit_edge52 ], [ %.pre65, %.._crit_edge58_crit_edge ], [ %.pre64, %.._crit_edge55_crit_edge ], [ %35, %.lr.ph57 ], [ %49, %.lr.ph54 ]
  %275 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %.sink76)
  %276 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %275, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #7
  ret i32 0
}

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

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

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

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

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) local_unnamed_addr #2

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local i64 @_ZSt9make_pairIRiiESt4pairINSt25__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 #4

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local { ptr, i64 } @_ZNSt6vectorIbSaIbEEixEm(ptr noundef nonnull align 8 dereferenceable(40), i64 noundef) local_unnamed_addr #4 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt14_Bit_referenceaSEb(ptr noundef nonnull align 8 dereferenceable(16), i1 noundef zeroext) local_unnamed_addr #6 align 2

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(8) ptr @_ZNKSt14priority_queueISt4pairIiiESt6vectorIS1_SaIS1_EESt7greaterIS1_EE3topEv(ptr noundef nonnull align 8 dereferenceable(25)) local_unnamed_addr #6 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNKSt14_Bit_referencecvbEv(ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #6 align 2

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

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

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


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