; LLVM IR from eyangch/competitive-programming :: USACOcontests/gold/2020.12 (replication)

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

%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"class.std::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, std::pair<int, int>>, std::allocator<std::pair<int, std::pair<int, int>>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::pair<int, std::pair<int, int>>, std::allocator<std::pair<int, std::pair<int, int>>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::pair<int, std::pair<int, int>>, std::allocator<std::pair<int, std::pair<int, int>>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::pair<int, std::pair<int, int>>, std::allocator<std::pair<int, std::pair<int, int>>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.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<std::pair<int, int>, int>, std::allocator<std::pair<std::pair<int, int>, int>>>::_Deque_impl" }
%"struct.std::_Deque_base<std::pair<std::pair<int, int>, int>, std::allocator<std::pair<std::pair<int, int>, int>>>::_Deque_impl" = type { %"struct.std::_Deque_base<std::pair<std::pair<int, int>, int>, std::allocator<std::pair<std::pair<int, int>, int>>>::_Deque_impl_data" }
%"struct.std::_Deque_base<std::pair<std::pair<int, int>, int>, std::allocator<std::pair<std::pair<int, 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.8" = type { %"struct.std::pair.3", i32 }
%"struct.std::pair.3" = type { i32, i32 }
%"struct.std::pair" = type { i32, %"struct.std::pair.3" }

@N = external dso_local global i32, align 4
@D = external dso_local global i32, align 4
@_Z5firstB5cxx11 = external dso_local global [1000 x %"class.std::__cxx11::basic_string"], align 16
@mnd = external dso_local global [1000 x [1000 x i32]], align 16
@vis = external dso_local global [1000 x [1000 x i8]], align 16
@mxc = external dso_local global [1000 x [1000 x i32]], align 16
@cput = external dso_local global [1000 x [1000 x i8]], align 16
@dx = external dso_local global [4 x i32], align 16
@dy = external dso_local global [4 x i32], align 16
@q1 = external dso_local global %"class.std::priority_queue", align 8
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z17bfsdijkstrathingyv() #0

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

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

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #3

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #4 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca %"class.std::queue", align 8
  %4 = alloca double, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca %"struct.std::pair.8", align 4
  %11 = alloca %"struct.std::pair.3", align 4
  %12 = alloca i32, align 4
  %13 = alloca { i64, i32 }, align 8
  %14 = alloca %"struct.std::pair.3", align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca %"struct.std::pair.8", align 4
  %20 = alloca %"struct.std::pair.3", align 4
  %21 = alloca i32, align 4
  %22 = alloca { i64, i32 }, align 8
  %23 = alloca i32, align 4
  %24 = alloca i32, align 4
  %25 = alloca %"struct.std::pair.8", align 4
  %26 = alloca %"struct.std::pair.3", align 4
  %27 = alloca i32, align 4
  %28 = alloca { i64, i32 }, align 8
  %29 = alloca i32, align 4
  %30 = alloca %"class.std::vector", align 8
  %31 = alloca i32, align 4
  %32 = alloca i32, align 4
  %33 = alloca i32, align 4
  %34 = alloca i32, align 4
  %35 = alloca %"struct.std::pair", align 4
  %36 = alloca i32, align 4
  %37 = alloca %"struct.std::pair.3", align 4
  %38 = alloca i32, align 4
  %39 = alloca i32, align 4
  %40 = alloca i32, align 4
  %41 = alloca %"struct.std::pair.8", align 4
  %42 = alloca %"struct.std::pair.3", align 4
  %43 = alloca i32, align 4
  %44 = alloca { i64, i32 }, align 8
  %45 = alloca i32, align 4
  %46 = alloca i32, align 4
  %47 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %48 = call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %49 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %50 = getelementptr i8, ptr %49, i64 -24
  %51 = load i64, ptr %50, align 8
  %52 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %51
  %53 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %52, ptr noundef null)
  %54 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) @N)
  %55 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %54, ptr noundef nonnull align 4 dereferenceable(4) @D)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #8
  store i32 0, ptr %2, align 4, !tbaa !8
  br label %56

56:                                               ; preds = %66, %0
  %57 = load i32, ptr %2, align 4, !tbaa !8
  %58 = load i32, ptr @N, align 4, !tbaa !8
  %59 = icmp slt i32 %57, %58
  br i1 %59, label %61, label %60

60:                                               ; preds = %56
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #8
  br label %69

61:                                               ; preds = %56
  %62 = load i32, ptr %2, align 4, !tbaa !8
  %63 = sext i32 %62 to i64
  %64 = getelementptr inbounds [1000 x %"class.std::__cxx11::basic_string"], ptr @_Z5firstB5cxx11, i64 0, i64 %63
  %65 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(32) %64)
  br label %66

66:                                               ; preds = %61
  %67 = load i32, ptr %2, align 4, !tbaa !8
  %68 = add nsw i32 %67, 1
  store i32 %68, ptr %2, align 4, !tbaa !8
  br label %56, !llvm.loop !11

69:                                               ; preds = %60
  call void @llvm.lifetime.start.p0(i64 80, ptr %3) #8
  call void @_ZNSt5queueISt4pairIS0_IiiEiESt5dequeIS2_SaIS2_EEEC2IS5_vEEv(ptr noundef nonnull align 8 dereferenceable(80) %3)
  %70 = load i32, ptr @N, align 4, !tbaa !8
  %71 = sub nsw i32 %70, 1
  %72 = sext i32 %71 to i64
  %73 = getelementptr inbounds [1000 x [1000 x i32]], ptr @mnd, i64 0, i64 %72
  %74 = getelementptr inbounds [1000 x i32], ptr %73, i64 0, i64 0
  %75 = load i32, ptr @N, align 4, !tbaa !8
  %76 = sext i32 %75 to i64
  %77 = getelementptr inbounds i32, ptr %74, i64 %76
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #8
  store double 1.000000e+06, ptr %4, align 8, !tbaa !13
  invoke void @_ZSt4fillIPidEvT_S1_RKT0_(ptr noundef @mnd, ptr noundef %77, ptr noundef nonnull align 8 dereferenceable(8) %4)
          to label %78 unwind label %84

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

79:                                               ; preds = %129, %78
  %80 = load i32, ptr %7, align 4, !tbaa !8
  %81 = load i32, ptr @N, align 4, !tbaa !8
  %82 = icmp slt i32 %80, %81
  br i1 %82, label %88, label %83

83:                                               ; preds = %79
  store i32 5, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #8
  br label %132

84:                                               ; preds = %69
  %85 = landingpad { ptr, i32 }
          cleanup
  %86 = extractvalue { ptr, i32 } %85, 0
  store ptr %86, ptr %5, align 8
  %87 = extractvalue { ptr, i32 } %85, 1
  store i32 %87, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #8
  br label %506

88:                                               ; preds = %79
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #8
  store i32 0, ptr %9, align 4, !tbaa !8
  br label %89

89:                                               ; preds = %124, %88
  %90 = load i32, ptr %9, align 4, !tbaa !8
  %91 = load i32, ptr @N, align 4, !tbaa !8
  %92 = icmp slt i32 %90, %91
  br i1 %92, label %94, label %93

93:                                               ; preds = %89
  store i32 8, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #8
  br label %128

94:                                               ; preds = %89
  %95 = load i32, ptr %7, align 4, !tbaa !8
  %96 = sext i32 %95 to i64
  %97 = getelementptr inbounds [1000 x %"class.std::__cxx11::basic_string"], ptr @_Z5firstB5cxx11, i64 0, i64 %96
  %98 = load i32, ptr %9, align 4, !tbaa !8
  %99 = sext i32 %98 to i64
  %100 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %97, i64 noundef %99)
          to label %101 unwind label %110

101:                                              ; preds = %94
  %102 = load i8, ptr %100, align 1, !tbaa !15
  %103 = sext i8 %102 to i32
  %104 = icmp eq i32 %103, 35
  br i1 %104, label %105, label %123

105:                                              ; preds = %101
  call void @llvm.lifetime.start.p0(i64 12, ptr %10) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #8
  invoke void @_ZNSt4pairIiiEC2IRiS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %11, ptr noundef nonnull align 4 dereferenceable(4) %7, ptr noundef nonnull align 4 dereferenceable(4) %9)
          to label %106 unwind label %114

106:                                              ; preds = %105
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #8
  store i32 0, ptr %12, align 4, !tbaa !8
  %107 = invoke { i64, i32 } @_ZSt9make_pairISt4pairIiiEiES0_INSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(8) %11, ptr noundef nonnull align 4 dereferenceable(4) %12)
          to label %108 unwind label %118

108:                                              ; preds = %106
  store { i64, i32 } %107, ptr %13, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %10, ptr align 8 %13, i64 12, i1 false)
  invoke void @_ZNSt5queueISt4pairIS0_IiiEiESt5dequeIS2_SaIS2_EEE4pushEOS2_(ptr noundef nonnull align 8 dereferenceable(80) %3, ptr noundef nonnull align 4 dereferenceable(12) %10)
          to label %109 unwind label %118

109:                                              ; preds = %108
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #8
  call void @llvm.lifetime.end.p0(i64 12, ptr %10) #8
  br label %123

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

114:                                              ; preds = %105
  %115 = landingpad { ptr, i32 }
          cleanup
  %116 = extractvalue { ptr, i32 } %115, 0
  store ptr %116, ptr %5, align 8
  %117 = extractvalue { ptr, i32 } %115, 1
  store i32 %117, ptr %6, align 4
  br label %122

118:                                              ; preds = %108, %106
  %119 = landingpad { ptr, i32 }
          cleanup
  %120 = extractvalue { ptr, i32 } %119, 0
  store ptr %120, ptr %5, align 8
  %121 = extractvalue { ptr, i32 } %119, 1
  store i32 %121, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #8
  br label %122

122:                                              ; preds = %118, %114
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #8
  call void @llvm.lifetime.end.p0(i64 12, ptr %10) #8
  br label %127

123:                                              ; preds = %109, %101
  br label %124

124:                                              ; preds = %123
  %125 = load i32, ptr %9, align 4, !tbaa !8
  %126 = add nsw i32 %125, 1
  store i32 %126, ptr %9, align 4, !tbaa !8
  br label %89, !llvm.loop !16

127:                                              ; preds = %122, %110
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #8
  br label %506

128:                                              ; preds = %93
  br label %129

129:                                              ; preds = %128
  %130 = load i32, ptr %7, align 4, !tbaa !8
  %131 = add nsw i32 %130, 1
  store i32 %131, ptr %7, align 4, !tbaa !8
  br label %79, !llvm.loop !17

132:                                              ; preds = %83
  br label %133

133:                                              ; preds = %238, %236, %132
  %134 = invoke noundef zeroext i1 @_ZNKSt5queueISt4pairIS0_IiiEiESt5dequeIS2_SaIS2_EEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %3)
          to label %135 unwind label %176

135:                                              ; preds = %133
  %136 = xor i1 %134, true
  br i1 %136, label %137, label %241

137:                                              ; preds = %135
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #8
  %138 = invoke noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt5queueISt4pairIS0_IiiEiESt5dequeIS2_SaIS2_EEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) %3)
          to label %139 unwind label %180

139:                                              ; preds = %137
  %140 = getelementptr inbounds %"struct.std::pair.8", ptr %138, i32 0, i32 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %14, ptr align 4 %140, i64 8, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #8
  %141 = invoke noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt5queueISt4pairIS0_IiiEiESt5dequeIS2_SaIS2_EEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) %3)
          to label %142 unwind label %184

142:                                              ; preds = %139
  %143 = getelementptr inbounds %"struct.std::pair.8", ptr %141, i32 0, i32 1
  %144 = load i32, ptr %143, align 4, !tbaa !18
  store i32 %144, ptr %15, align 4, !tbaa !8
  invoke void @_ZNSt5queueISt4pairIS0_IiiEiESt5dequeIS2_SaIS2_EEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %3)
          to label %145 unwind label %184

145:                                              ; preds = %142
  %146 = getelementptr inbounds %"struct.std::pair.3", ptr %14, i32 0, i32 0
  %147 = load i32, ptr %146, align 4, !tbaa !21
  %148 = icmp slt i32 %147, 0
  br i1 %148, label %175, label %149

149:                                              ; preds = %145
  %150 = getelementptr inbounds %"struct.std::pair.3", ptr %14, i32 0, i32 0
  %151 = load i32, ptr %150, align 4, !tbaa !21
  %152 = load i32, ptr @N, align 4, !tbaa !8
  %153 = icmp sge i32 %151, %152
  br i1 %153, label %175, label %154

154:                                              ; preds = %149
  %155 = getelementptr inbounds %"struct.std::pair.3", ptr %14, i32 0, i32 1
  %156 = load i32, ptr %155, align 4, !tbaa !22
  %157 = icmp slt i32 %156, 0
  br i1 %157, label %175, label %158

158:                                              ; preds = %154
  %159 = getelementptr inbounds %"struct.std::pair.3", ptr %14, i32 0, i32 1
  %160 = load i32, ptr %159, align 4, !tbaa !22
  %161 = load i32, ptr @N, align 4, !tbaa !8
  %162 = icmp sge i32 %160, %161
  br i1 %162, label %175, label %163

163:                                              ; preds = %158
  %164 = getelementptr inbounds %"struct.std::pair.3", ptr %14, i32 0, i32 0
  %165 = load i32, ptr %164, align 4, !tbaa !21
  %166 = sext i32 %165 to i64
  %167 = getelementptr inbounds [1000 x [1000 x i32]], ptr @mnd, i64 0, i64 %166
  %168 = getelementptr inbounds %"struct.std::pair.3", ptr %14, i32 0, i32 1
  %169 = load i32, ptr %168, align 4, !tbaa !22
  %170 = sext i32 %169 to i64
  %171 = getelementptr inbounds [1000 x i32], ptr %167, i64 0, i64 %170
  %172 = load i32, ptr %171, align 4, !tbaa !8
  %173 = load i32, ptr %15, align 4, !tbaa !8
  %174 = icmp sle i32 %172, %173
  br i1 %174, label %175, label %188

175:                                              ; preds = %163, %158, %154, %149, %145
  store i32 11, ptr %8, align 4
  br label %236, !llvm.loop !23

176:                                              ; preds = %133
  %177 = landingpad { ptr, i32 }
          cleanup
  %178 = extractvalue { ptr, i32 } %177, 0
  store ptr %178, ptr %5, align 8
  %179 = extractvalue { ptr, i32 } %177, 1
  store i32 %179, ptr %6, align 4
  br label %506

180:                                              ; preds = %137
  %181 = landingpad { ptr, i32 }
          cleanup
  %182 = extractvalue { ptr, i32 } %181, 0
  store ptr %182, ptr %5, align 8
  %183 = extractvalue { ptr, i32 } %181, 1
  store i32 %183, ptr %6, align 4
  br label %240

184:                                              ; preds = %142, %139
  %185 = landingpad { ptr, i32 }
          cleanup
  %186 = extractvalue { ptr, i32 } %185, 0
  store ptr %186, ptr %5, align 8
  %187 = extractvalue { ptr, i32 } %185, 1
  store i32 %187, ptr %6, align 4
  br label %239

188:                                              ; preds = %163
  %189 = load i32, ptr %15, align 4, !tbaa !8
  %190 = getelementptr inbounds %"struct.std::pair.3", ptr %14, i32 0, i32 0
  %191 = load i32, ptr %190, align 4, !tbaa !21
  %192 = sext i32 %191 to i64
  %193 = getelementptr inbounds [1000 x [1000 x i32]], ptr @mnd, i64 0, i64 %192
  %194 = getelementptr inbounds %"struct.std::pair.3", ptr %14, i32 0, i32 1
  %195 = load i32, ptr %194, align 4, !tbaa !22
  %196 = sext i32 %195 to i64
  %197 = getelementptr inbounds [1000 x i32], ptr %193, i64 0, i64 %196
  store i32 %189, ptr %197, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #8
  store i32 0, ptr %16, align 4, !tbaa !8
  br label %198

198:                                              ; preds = %223, %188
  %199 = load i32, ptr %16, align 4, !tbaa !8
  %200 = icmp slt i32 %199, 4
  br i1 %200, label %202, label %201

201:                                              ; preds = %198
  store i32 13, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #8
  br label %235

202:                                              ; preds = %198
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #8
  %203 = getelementptr inbounds %"struct.std::pair.3", ptr %14, i32 0, i32 0
  %204 = load i32, ptr %203, align 4, !tbaa !21
  %205 = load i32, ptr %16, align 4, !tbaa !8
  %206 = sext i32 %205 to i64
  %207 = getelementptr inbounds [4 x i32], ptr @dx, i64 0, i64 %206
  %208 = load i32, ptr %207, align 4, !tbaa !8
  %209 = add nsw i32 %204, %208
  store i32 %209, ptr %17, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #8
  %210 = getelementptr inbounds %"struct.std::pair.3", ptr %14, i32 0, i32 1
  %211 = load i32, ptr %210, align 4, !tbaa !22
  %212 = load i32, ptr %16, align 4, !tbaa !8
  %213 = sext i32 %212 to i64
  %214 = getelementptr inbounds [4 x i32], ptr @dy, i64 0, i64 %213
  %215 = load i32, ptr %214, align 4, !tbaa !8
  %216 = add nsw i32 %211, %215
  store i32 %216, ptr %18, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 12, ptr %19) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #8
  invoke void @_ZNSt4pairIiiEC2IRiS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %20, ptr noundef nonnull align 4 dereferenceable(4) %17, ptr noundef nonnull align 4 dereferenceable(4) %18)
          to label %217 unwind label %226

217:                                              ; preds = %202
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #8
  %218 = load i32, ptr %15, align 4, !tbaa !8
  %219 = add nsw i32 %218, 1
  store i32 %219, ptr %21, align 4, !tbaa !8
  %220 = invoke { i64, i32 } @_ZSt9make_pairISt4pairIiiEiES0_INSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(8) %20, ptr noundef nonnull align 4 dereferenceable(4) %21)
          to label %221 unwind label %230

221:                                              ; preds = %217
  store { i64, i32 } %220, ptr %22, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %19, ptr align 8 %22, i64 12, i1 false)
  invoke void @_ZNSt5queueISt4pairIS0_IiiEiESt5dequeIS2_SaIS2_EEE4pushEOS2_(ptr noundef nonnull align 8 dereferenceable(80) %3, ptr noundef nonnull align 4 dereferenceable(12) %19)
          to label %222 unwind label %230

222:                                              ; preds = %221
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #8
  call void @llvm.lifetime.end.p0(i64 12, ptr %19) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #8
  br label %223

223:                                              ; preds = %222
  %224 = load i32, ptr %16, align 4, !tbaa !8
  %225 = add nsw i32 %224, 1
  store i32 %225, ptr %16, align 4, !tbaa !8
  br label %198, !llvm.loop !24

226:                                              ; preds = %202
  %227 = landingpad { ptr, i32 }
          cleanup
  %228 = extractvalue { ptr, i32 } %227, 0
  store ptr %228, ptr %5, align 8
  %229 = extractvalue { ptr, i32 } %227, 1
  store i32 %229, ptr %6, align 4
  br label %234

230:                                              ; preds = %221, %217
  %231 = landingpad { ptr, i32 }
          cleanup
  %232 = extractvalue { ptr, i32 } %231, 0
  store ptr %232, ptr %5, align 8
  %233 = extractvalue { ptr, i32 } %231, 1
  store i32 %233, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #8
  br label %234

234:                                              ; preds = %230, %226
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #8
  call void @llvm.lifetime.end.p0(i64 12, ptr %19) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #8
  br label %239

235:                                              ; preds = %201
  store i32 0, ptr %8, align 4
  br label %236

236:                                              ; preds = %235, %175
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #8
  %237 = load i32, ptr %8, align 4
  switch i32 %237, label %512 [
    i32 0, label %238
    i32 11, label %133
  ]

238:                                              ; preds = %236
  br label %133, !llvm.loop !23

239:                                              ; preds = %234, %184
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #8
  br label %240

240:                                              ; preds = %239, %180
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #8
  br label %506

241:                                              ; preds = %135
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #8
  store i32 0, ptr %23, align 4, !tbaa !8
  br label %242

242:                                              ; preds = %288, %241
  %243 = load i32, ptr %23, align 4, !tbaa !8
  %244 = load i32, ptr @N, align 4, !tbaa !8
  %245 = icmp slt i32 %243, %244
  br i1 %245, label %247, label %246

246:                                              ; preds = %242
  store i32 16, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #8
  br label %291

247:                                              ; preds = %242
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #8
  store i32 0, ptr %24, align 4, !tbaa !8
  br label %248

248:                                              ; preds = %283, %247
  %249 = load i32, ptr %24, align 4, !tbaa !8
  %250 = load i32, ptr @N, align 4, !tbaa !8
  %251 = icmp slt i32 %249, %250
  br i1 %251, label %253, label %252

252:                                              ; preds = %248
  store i32 19, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #8
  br label %287

253:                                              ; preds = %248
  %254 = load i32, ptr %23, align 4, !tbaa !8
  %255 = sext i32 %254 to i64
  %256 = getelementptr inbounds [1000 x %"class.std::__cxx11::basic_string"], ptr @_Z5firstB5cxx11, i64 0, i64 %255
  %257 = load i32, ptr %24, align 4, !tbaa !8
  %258 = sext i32 %257 to i64
  %259 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %256, i64 noundef %258)
          to label %260 unwind label %269

260:                                              ; preds = %253
  %261 = load i8, ptr %259, align 1, !tbaa !15
  %262 = sext i8 %261 to i32
  %263 = icmp eq i32 %262, 83
  br i1 %263, label %264, label %282

264:                                              ; preds = %260
  call void @llvm.lifetime.start.p0(i64 12, ptr %25) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #8
  invoke void @_ZNSt4pairIiiEC2IRiS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %26, ptr noundef nonnull align 4 dereferenceable(4) %23, ptr noundef nonnull align 4 dereferenceable(4) %24)
          to label %265 unwind label %273

265:                                              ; preds = %264
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #8
  store i32 0, ptr %27, align 4, !tbaa !8
  %266 = invoke { i64, i32 } @_ZSt9make_pairISt4pairIiiEiES0_INSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(8) %26, ptr noundef nonnull align 4 dereferenceable(4) %27)
          to label %267 unwind label %277

267:                                              ; preds = %265
  store { i64, i32 } %266, ptr %28, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %25, ptr align 8 %28, i64 12, i1 false)
  invoke void @_ZNSt5queueISt4pairIS0_IiiEiESt5dequeIS2_SaIS2_EEE4pushEOS2_(ptr noundef nonnull align 8 dereferenceable(80) %3, ptr noundef nonnull align 4 dereferenceable(12) %25)
          to label %268 unwind label %277

268:                                              ; preds = %267
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #8
  call void @llvm.lifetime.end.p0(i64 12, ptr %25) #8
  br label %282

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

273:                                              ; preds = %264
  %274 = landingpad { ptr, i32 }
          cleanup
  %275 = extractvalue { ptr, i32 } %274, 0
  store ptr %275, ptr %5, align 8
  %276 = extractvalue { ptr, i32 } %274, 1
  store i32 %276, ptr %6, align 4
  br label %281

277:                                              ; preds = %267, %265
  %278 = landingpad { ptr, i32 }
          cleanup
  %279 = extractvalue { ptr, i32 } %278, 0
  store ptr %279, ptr %5, align 8
  %280 = extractvalue { ptr, i32 } %278, 1
  store i32 %280, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #8
  br label %281

281:                                              ; preds = %277, %273
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #8
  call void @llvm.lifetime.end.p0(i64 12, ptr %25) #8
  br label %286

282:                                              ; preds = %268, %260
  br label %283

283:                                              ; preds = %282
  %284 = load i32, ptr %24, align 4, !tbaa !8
  %285 = add nsw i32 %284, 1
  store i32 %285, ptr %24, align 4, !tbaa !8
  br label %248, !llvm.loop !25

286:                                              ; preds = %281, %269
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #8
  br label %506

287:                                              ; preds = %252
  br label %288

288:                                              ; preds = %287
  %289 = load i32, ptr %23, align 4, !tbaa !8
  %290 = add nsw i32 %289, 1
  store i32 %290, ptr %23, align 4, !tbaa !8
  br label %242, !llvm.loop !26

291:                                              ; preds = %246
  %292 = load i32, ptr @N, align 4, !tbaa !8
  %293 = sub nsw i32 %292, 1
  %294 = sext i32 %293 to i64
  %295 = getelementptr inbounds [1000 x [1000 x i32]], ptr @mxc, i64 0, i64 %294
  %296 = getelementptr inbounds [1000 x i32], ptr %295, i64 0, i64 0
  %297 = load i32, ptr @N, align 4, !tbaa !8
  %298 = sext i32 %297 to i64
  %299 = getelementptr inbounds i32, ptr %296, i64 %298
  call void @llvm.lifetime.start.p0(i64 4, ptr %29) #8
  store i32 -1, ptr %29, align 4, !tbaa !8
  invoke void @_ZSt4fillIPiiEvT_S1_RKT0_(ptr noundef @mxc, ptr noundef %299, ptr noundef nonnull align 4 dereferenceable(4) %29)
          to label %300 unwind label %358

300:                                              ; preds = %291
  call void @llvm.lifetime.end.p0(i64 4, ptr %29) #8
  call void @llvm.lifetime.start.p0(i64 24, ptr %30) #8
  call void @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %30) #8
  br label %301

301:                                              ; preds = %457, %455, %300
  %302 = invoke noundef zeroext i1 @_ZNKSt5queueISt4pairIS0_IiiEiESt5dequeIS2_SaIS2_EEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %3)
          to label %303 unwind label %362

303:                                              ; preds = %301
  %304 = xor i1 %302, true
  br i1 %304, label %305, label %462

305:                                              ; preds = %303
  call void @llvm.lifetime.start.p0(i64 4, ptr %31) #8
  %306 = invoke noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt5queueISt4pairIS0_IiiEiESt5dequeIS2_SaIS2_EEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) %3)
          to label %307 unwind label %366

307:                                              ; preds = %305
  %308 = getelementptr inbounds %"struct.std::pair.8", ptr %306, i32 0, i32 0
  %309 = getelementptr inbounds %"struct.std::pair.3", ptr %308, i32 0, i32 0
  %310 = load i32, ptr %309, align 4, !tbaa !27
  store i32 %310, ptr %31, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %32) #8
  %311 = invoke noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt5queueISt4pairIS0_IiiEiESt5dequeIS2_SaIS2_EEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) %3)
          to label %312 unwind label %370

312:                                              ; preds = %307
  %313 = getelementptr inbounds %"struct.std::pair.8", ptr %311, i32 0, i32 0
  %314 = getelementptr inbounds %"struct.std::pair.3", ptr %313, i32 0, i32 1
  %315 = load i32, ptr %314, align 4, !tbaa !28
  store i32 %315, ptr %32, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %33) #8
  %316 = invoke noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt5queueISt4pairIS0_IiiEiESt5dequeIS2_SaIS2_EEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) %3)
          to label %317 unwind label %374

317:                                              ; preds = %312
  %318 = getelementptr inbounds %"struct.std::pair.8", ptr %316, i32 0, i32 1
  %319 = load i32, ptr %318, align 4, !tbaa !18
  store i32 %319, ptr %33, align 4, !tbaa !8
  invoke void @_ZNSt5queueISt4pairIS0_IiiEiESt5dequeIS2_SaIS2_EEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %3)
          to label %320 unwind label %374

320:                                              ; preds = %317
  call void @llvm.lifetime.start.p0(i64 4, ptr %34) #8
  %321 = load i32, ptr %33, align 4, !tbaa !8
  %322 = sub nsw i32 %321, 1
  %323 = load i32, ptr @D, align 4, !tbaa !8
  %324 = sdiv i32 %322, %323
  store i32 %324, ptr %34, align 4, !tbaa !8
  %325 = load i32, ptr %31, align 4, !tbaa !8
  %326 = icmp slt i32 %325, 0
  br i1 %326, label %357, label %327

327:                                              ; preds = %320
  %328 = load i32, ptr %31, align 4, !tbaa !8
  %329 = load i32, ptr @N, align 4, !tbaa !8
  %330 = icmp sge i32 %328, %329
  br i1 %330, label %357, label %331

331:                                              ; preds = %327
  %332 = load i32, ptr %32, align 4, !tbaa !8
  %333 = icmp slt i32 %332, 0
  br i1 %333, label %357, label %334

334:                                              ; preds = %331
  %335 = load i32, ptr %32, align 4, !tbaa !8
  %336 = load i32, ptr @N, align 4, !tbaa !8
  %337 = icmp sge i32 %335, %336
  br i1 %337, label %357, label %338

338:                                              ; preds = %334
  %339 = load i32, ptr %31, align 4, !tbaa !8
  %340 = sext i32 %339 to i64
  %341 = getelementptr inbounds [1000 x [1000 x i8]], ptr @vis, i64 0, i64 %340
  %342 = load i32, ptr %32, align 4, !tbaa !8
  %343 = sext i32 %342 to i64
  %344 = getelementptr inbounds [1000 x i8], ptr %341, i64 0, i64 %343
  %345 = load i8, ptr %344, align 1, !tbaa !29, !range !31, !noundef !32
  %346 = trunc i8 %345 to i1
  br i1 %346, label %357, label %347

347:                                              ; preds = %338
  %348 = load i32, ptr %34, align 4, !tbaa !8
  %349 = load i32, ptr %31, align 4, !tbaa !8
  %350 = sext i32 %349 to i64
  %351 = getelementptr inbounds [1000 x [1000 x i32]], ptr @mnd, i64 0, i64 %350
  %352 = load i32, ptr %32, align 4, !tbaa !8
  %353 = sext i32 %352 to i64
  %354 = getelementptr inbounds [1000 x i32], ptr %351, i64 0, i64 %353
  %355 = load i32, ptr %354, align 4, !tbaa !8
  %356 = icmp sge i32 %348, %355
  br i1 %356, label %357, label %378

357:                                              ; preds = %347, %338, %334, %331, %327, %320
  store i32 22, ptr %8, align 4
  br label %455, !llvm.loop !33

358:                                              ; preds = %291
  %359 = landingpad { ptr, i32 }
          cleanup
  %360 = extractvalue { ptr, i32 } %359, 0
  store ptr %360, ptr %5, align 8
  %361 = extractvalue { ptr, i32 } %359, 1
  store i32 %361, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %29) #8
  br label %506

362:                                              ; preds = %462, %301
  %363 = landingpad { ptr, i32 }
          cleanup
  %364 = extractvalue { ptr, i32 } %363, 0
  store ptr %364, ptr %5, align 8
  %365 = extractvalue { ptr, i32 } %363, 1
  store i32 %365, ptr %6, align 4
  br label %505

366:                                              ; preds = %305
  %367 = landingpad { ptr, i32 }
          cleanup
  %368 = extractvalue { ptr, i32 } %367, 0
  store ptr %368, ptr %5, align 8
  %369 = extractvalue { ptr, i32 } %367, 1
  store i32 %369, ptr %6, align 4
  br label %461

370:                                              ; preds = %307
  %371 = landingpad { ptr, i32 }
          cleanup
  %372 = extractvalue { ptr, i32 } %371, 0
  store ptr %372, ptr %5, align 8
  %373 = extractvalue { ptr, i32 } %371, 1
  store i32 %373, ptr %6, align 4
  br label %460

374:                                              ; preds = %317, %312
  %375 = landingpad { ptr, i32 }
          cleanup
  %376 = extractvalue { ptr, i32 } %375, 0
  store ptr %376, ptr %5, align 8
  %377 = extractvalue { ptr, i32 } %375, 1
  store i32 %377, ptr %6, align 4
  br label %459

378:                                              ; preds = %347
  call void @llvm.lifetime.start.p0(i64 12, ptr %35) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %36) #8
  %379 = load i32, ptr %31, align 4, !tbaa !8
  %380 = sext i32 %379 to i64
  %381 = getelementptr inbounds [1000 x [1000 x i32]], ptr @mnd, i64 0, i64 %380
  %382 = load i32, ptr %32, align 4, !tbaa !8
  %383 = sext i32 %382 to i64
  %384 = getelementptr inbounds [1000 x i32], ptr %381, i64 0, i64 %383
  %385 = load i32, ptr %384, align 4, !tbaa !8
  %386 = sub nsw i32 %385, 1
  store i32 %386, ptr %36, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %37) #8
  invoke void @_ZNSt4pairIiiEC2IRiS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %37, ptr noundef nonnull align 4 dereferenceable(4) %31, ptr noundef nonnull align 4 dereferenceable(4) %32)
          to label %387 unwind label %408

387:                                              ; preds = %378
  invoke void @_ZNSt4pairIiS_IiiEEC2IiS0_TnNSt9enable_ifIXaaclsr5_PCCPE18_ConstructiblePairIT_T0_EEclsr5_PCCPE26_ImplicitlyConvertiblePairIS4_S5_EEEbE4typeELb1EEERKiRKS0_(ptr noundef nonnull align 4 dereferenceable(12) %35, ptr noundef nonnull align 4 dereferenceable(4) %36, ptr noundef nonnull align 4 dereferenceable(8) %37)
          to label %388 unwind label %408

388:                                              ; preds = %387
  invoke void @_ZNSt14priority_queueISt4pairIiS0_IiiEESt6vectorIS2_SaIS2_EESt4lessIS2_EE4pushEOS2_(ptr noundef nonnull align 8 dereferenceable(25) @q1, ptr noundef nonnull align 4 dereferenceable(12) %35)
          to label %389 unwind label %408

389:                                              ; preds = %388
  call void @llvm.lifetime.end.p0(i64 8, ptr %37) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %36) #8
  call void @llvm.lifetime.end.p0(i64 12, ptr %35) #8
  %390 = load i32, ptr %33, align 4, !tbaa !8
  %391 = load i32, ptr @D, align 4, !tbaa !8
  %392 = sdiv i32 %390, %391
  %393 = load i32, ptr %34, align 4, !tbaa !8
  %394 = icmp ne i32 %392, %393
  br i1 %394, label %395, label %412

395:                                              ; preds = %389
  %396 = load i32, ptr %33, align 4, !tbaa !8
  %397 = load i32, ptr @D, align 4, !tbaa !8
  %398 = sdiv i32 %396, %397
  %399 = load i32, ptr %31, align 4, !tbaa !8
  %400 = sext i32 %399 to i64
  %401 = getelementptr inbounds [1000 x [1000 x i32]], ptr @mnd, i64 0, i64 %400
  %402 = load i32, ptr %32, align 4, !tbaa !8
  %403 = sext i32 %402 to i64
  %404 = getelementptr inbounds [1000 x i32], ptr %401, i64 0, i64 %403
  %405 = load i32, ptr %404, align 4, !tbaa !8
  %406 = icmp sge i32 %398, %405
  br i1 %406, label %407, label %412

407:                                              ; preds = %395
  store i32 22, ptr %8, align 4
  br label %455, !llvm.loop !33

408:                                              ; preds = %388, %387, %378
  %409 = landingpad { ptr, i32 }
          cleanup
  %410 = extractvalue { ptr, i32 } %409, 0
  store ptr %410, ptr %5, align 8
  %411 = extractvalue { ptr, i32 } %409, 1
  store i32 %411, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %37) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %36) #8
  call void @llvm.lifetime.end.p0(i64 12, ptr %35) #8
  br label %458

412:                                              ; preds = %395, %389
  %413 = load i32, ptr %31, align 4, !tbaa !8
  %414 = sext i32 %413 to i64
  %415 = getelementptr inbounds [1000 x [1000 x i8]], ptr @vis, i64 0, i64 %414
  %416 = load i32, ptr %32, align 4, !tbaa !8
  %417 = sext i32 %416 to i64
  %418 = getelementptr inbounds [1000 x i8], ptr %415, i64 0, i64 %417
  store i8 1, ptr %418, align 1, !tbaa !29
  call void @llvm.lifetime.start.p0(i64 4, ptr %38) #8
  store i32 0, ptr %38, align 4, !tbaa !8
  br label %419

419:                                              ; preds = %442, %412
  %420 = load i32, ptr %38, align 4, !tbaa !8
  %421 = icmp slt i32 %420, 4
  br i1 %421, label %423, label %422

422:                                              ; preds = %419
  store i32 24, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %38) #8
  br label %454

423:                                              ; preds = %419
  call void @llvm.lifetime.start.p0(i64 4, ptr %39) #8
  %424 = load i32, ptr %31, align 4, !tbaa !8
  %425 = load i32, ptr %38, align 4, !tbaa !8
  %426 = sext i32 %425 to i64
  %427 = getelementptr inbounds [4 x i32], ptr @dx, i64 0, i64 %426
  %428 = load i32, ptr %427, align 4, !tbaa !8
  %429 = add nsw i32 %424, %428
  store i32 %429, ptr %39, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %40) #8
  %430 = load i32, ptr %32, align 4, !tbaa !8
  %431 = load i32, ptr %38, align 4, !tbaa !8
  %432 = sext i32 %431 to i64
  %433 = getelementptr inbounds [4 x i32], ptr @dy, i64 0, i64 %432
  %434 = load i32, ptr %433, align 4, !tbaa !8
  %435 = add nsw i32 %430, %434
  store i32 %435, ptr %40, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 12, ptr %41) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %42) #8
  invoke void @_ZNSt4pairIiiEC2IRiS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %42, ptr noundef nonnull align 4 dereferenceable(4) %39, ptr noundef nonnull align 4 dereferenceable(4) %40)
          to label %436 unwind label %445

436:                                              ; preds = %423
  call void @llvm.lifetime.start.p0(i64 4, ptr %43) #8
  %437 = load i32, ptr %33, align 4, !tbaa !8
  %438 = add nsw i32 %437, 1
  store i32 %438, ptr %43, align 4, !tbaa !8
  %439 = invoke { i64, i32 } @_ZSt9make_pairISt4pairIiiEiES0_INSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(8) %42, ptr noundef nonnull align 4 dereferenceable(4) %43)
          to label %440 unwind label %449

440:                                              ; preds = %436
  store { i64, i32 } %439, ptr %44, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %41, ptr align 8 %44, i64 12, i1 false)
  invoke void @_ZNSt5queueISt4pairIS0_IiiEiESt5dequeIS2_SaIS2_EEE4pushEOS2_(ptr noundef nonnull align 8 dereferenceable(80) %3, ptr noundef nonnull align 4 dereferenceable(12) %41)
          to label %441 unwind label %449

441:                                              ; preds = %440
  call void @llvm.lifetime.end.p0(i64 4, ptr %43) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %42) #8
  call void @llvm.lifetime.end.p0(i64 12, ptr %41) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %40) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %39) #8
  br label %442

442:                                              ; preds = %441
  %443 = load i32, ptr %38, align 4, !tbaa !8
  %444 = add nsw i32 %443, 1
  store i32 %444, ptr %38, align 4, !tbaa !8
  br label %419, !llvm.loop !34

445:                                              ; preds = %423
  %446 = landingpad { ptr, i32 }
          cleanup
  %447 = extractvalue { ptr, i32 } %446, 0
  store ptr %447, ptr %5, align 8
  %448 = extractvalue { ptr, i32 } %446, 1
  store i32 %448, ptr %6, align 4
  br label %453

449:                                              ; preds = %440, %436
  %450 = landingpad { ptr, i32 }
          cleanup
  %451 = extractvalue { ptr, i32 } %450, 0
  store ptr %451, ptr %5, align 8
  %452 = extractvalue { ptr, i32 } %450, 1
  store i32 %452, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %43) #8
  br label %453

453:                                              ; preds = %449, %445
  call void @llvm.lifetime.end.p0(i64 8, ptr %42) #8
  call void @llvm.lifetime.end.p0(i64 12, ptr %41) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %40) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %39) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %38) #8
  br label %458

454:                                              ; preds = %422
  store i32 0, ptr %8, align 4
  br label %455

455:                                              ; preds = %454, %407, %357
  call void @llvm.lifetime.end.p0(i64 4, ptr %34) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %33) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %32) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %31) #8
  %456 = load i32, ptr %8, align 4
  switch i32 %456, label %512 [
    i32 0, label %457
    i32 22, label %301
  ]

457:                                              ; preds = %455
  br label %301, !llvm.loop !33

458:                                              ; preds = %453, %408
  call void @llvm.lifetime.end.p0(i64 4, ptr %34) #8
  br label %459

459:                                              ; preds = %458, %374
  call void @llvm.lifetime.end.p0(i64 4, ptr %33) #8
  br label %460

460:                                              ; preds = %459, %370
  call void @llvm.lifetime.end.p0(i64 4, ptr %32) #8
  br label %461

461:                                              ; preds = %460, %366
  call void @llvm.lifetime.end.p0(i64 4, ptr %31) #8
  br label %505

462:                                              ; preds = %303
  invoke void @_Z17bfsdijkstrathingyv()
          to label %463 unwind label %362

463:                                              ; preds = %462
  call void @llvm.lifetime.start.p0(i64 4, ptr %45) #8
  store i32 0, ptr %45, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %46) #8
  store i32 0, ptr %46, align 4, !tbaa !8
  br label %464

464:                                              ; preds = %491, %463
  %465 = load i32, ptr %46, align 4, !tbaa !8
  %466 = load i32, ptr @N, align 4, !tbaa !8
  %467 = icmp slt i32 %465, %466
  br i1 %467, label %469, label %468

468:                                              ; preds = %464
  store i32 27, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %46) #8
  br label %494

469:                                              ; preds = %464
  call void @llvm.lifetime.start.p0(i64 4, ptr %47) #8
  store i32 0, ptr %47, align 4, !tbaa !8
  br label %470

470:                                              ; preds = %487, %469
  %471 = load i32, ptr %47, align 4, !tbaa !8
  %472 = load i32, ptr @N, align 4, !tbaa !8
  %473 = icmp slt i32 %471, %472
  br i1 %473, label %475, label %474

474:                                              ; preds = %470
  store i32 30, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %47) #8
  br label %490

475:                                              ; preds = %470
  %476 = load i32, ptr %46, align 4, !tbaa !8
  %477 = sext i32 %476 to i64
  %478 = getelementptr inbounds [1000 x [1000 x i8]], ptr @cput, i64 0, i64 %477
  %479 = load i32, ptr %47, align 4, !tbaa !8
  %480 = sext i32 %479 to i64
  %481 = getelementptr inbounds [1000 x i8], ptr %478, i64 0, i64 %480
  %482 = load i8, ptr %481, align 1, !tbaa !29, !range !31, !noundef !32
  %483 = trunc i8 %482 to i1
  %484 = zext i1 %483 to i32
  %485 = load i32, ptr %45, align 4, !tbaa !8
  %486 = add nsw i32 %485, %484
  store i32 %486, ptr %45, align 4, !tbaa !8
  br label %487

487:                                              ; preds = %475
  %488 = load i32, ptr %47, align 4, !tbaa !8
  %489 = add nsw i32 %488, 1
  store i32 %489, ptr %47, align 4, !tbaa !8
  br label %470, !llvm.loop !35

490:                                              ; preds = %474
  br label %491

491:                                              ; preds = %490
  %492 = load i32, ptr %46, align 4, !tbaa !8
  %493 = add nsw i32 %492, 1
  store i32 %493, ptr %46, align 4, !tbaa !8
  br label %464, !llvm.loop !36

494:                                              ; preds = %468
  %495 = load i32, ptr %45, align 4, !tbaa !8
  %496 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %495)
          to label %497 unwind label %501

497:                                              ; preds = %494
  %498 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %496, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %499 unwind label %501

499:                                              ; preds = %497
  call void @llvm.lifetime.end.p0(i64 4, ptr %45) #8
  call void @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %30) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr %30) #8
  call void @_ZNSt5queueISt4pairIS0_IiiEiESt5dequeIS2_SaIS2_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %3) #8
  call void @llvm.lifetime.end.p0(i64 80, ptr %3) #8
  %500 = load i32, ptr %1, align 4
  ret i32 %500

501:                                              ; preds = %497, %494
  %502 = landingpad { ptr, i32 }
          cleanup
  %503 = extractvalue { ptr, i32 } %502, 0
  store ptr %503, ptr %5, align 8
  %504 = extractvalue { ptr, i32 } %502, 1
  store i32 %504, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %45) #8
  br label %505

505:                                              ; preds = %501, %461, %362
  call void @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %30) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr %30) #8
  br label %506

506:                                              ; preds = %505, %358, %286, %240, %176, %127, %84
  call void @_ZNSt5queueISt4pairIS0_IiiEiESt5dequeIS2_SaIS2_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %3) #8
  call void @llvm.lifetime.end.p0(i64 80, ptr %3) #8
  br label %507

507:                                              ; preds = %506
  %508 = load ptr, ptr %5, align 8
  %509 = load i32, ptr %6, align 4
  %510 = insertvalue { ptr, i32 } poison, ptr %508, 0
  %511 = insertvalue { ptr, i32 } %510, i32 %509, 1
  resume { ptr, i32 } %511

512:                                              ; preds = %455, %236
  unreachable
}

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

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

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

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

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

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

declare i32 @__gxx_personality_v0(...)

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

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

; Function Attrs: mustprogress uwtable
declare dso_local { i64, i32 } @_ZSt9make_pairISt4pairIiiEiES0_INSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(4)) #0

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4fillIPiiEvT_S1_RKT0_(ptr noundef, ptr noundef, ptr noundef nonnull align 4 dereferenceable(4)) #6

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt4pairIiS_IiiEEC2IiS0_TnNSt9enable_ifIXaaclsr5_PCCPE18_ConstructiblePairIT_T0_EEclsr5_PCCPE26_ImplicitlyConvertiblePairIS4_S5_EEEbE4typeELb1EEERKiRKS0_(ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(8)) unnamed_addr #2 align 2

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

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

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

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

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

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

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


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

%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"class.std::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, std::pair<int, int>>, std::allocator<std::pair<int, std::pair<int, int>>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::pair<int, std::pair<int, int>>, std::allocator<std::pair<int, std::pair<int, int>>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::pair<int, std::pair<int, int>>, std::allocator<std::pair<int, std::pair<int, int>>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::pair<int, std::pair<int, int>>, std::allocator<std::pair<int, std::pair<int, int>>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.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<std::pair<int, int>, int>, std::allocator<std::pair<std::pair<int, int>, int>>>::_Deque_impl" }
%"struct.std::_Deque_base<std::pair<std::pair<int, int>, int>, std::allocator<std::pair<std::pair<int, int>, int>>>::_Deque_impl" = type { %"struct.std::_Deque_base<std::pair<std::pair<int, int>, int>, std::allocator<std::pair<std::pair<int, int>, int>>>::_Deque_impl_data" }
%"struct.std::_Deque_base<std::pair<std::pair<int, int>, int>, std::allocator<std::pair<std::pair<int, 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.8" = type { %"struct.std::pair.3", i32 }
%"struct.std::pair.3" = type { i32, i32 }
%"struct.std::pair" = type { i32, %"struct.std::pair.3" }

@N = external dso_local global i32, align 4
@D = external dso_local global i32, align 4
@_Z5firstB5cxx11 = external dso_local global [1000 x %"class.std::__cxx11::basic_string"], align 16
@mnd = external dso_local global [1000 x [1000 x i32]], align 16
@vis = external dso_local local_unnamed_addr global [1000 x [1000 x i8]], align 16
@mxc = external dso_local global [1000 x [1000 x i32]], align 16
@cput = external dso_local local_unnamed_addr global [1000 x [1000 x i8]], align 16
@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
@q1 = external dso_local global %"class.std::priority_queue", align 8
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z17bfsdijkstrathingyv() local_unnamed_addr #0

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

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

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

; 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 norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #3 personality ptr @__gxx_personality_v0 {
  %1 = alloca %"class.std::queue", align 8
  %2 = alloca double, align 8
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca %"struct.std::pair.8", align 8
  %6 = alloca %"struct.std::pair.3", align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca %"struct.std::pair.8", align 8
  %11 = alloca %"struct.std::pair.3", align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca %"struct.std::pair.8", align 8
  %16 = alloca %"struct.std::pair.3", align 4
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca %"class.std::vector", align 8
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  %22 = alloca %"struct.std::pair", align 4
  %23 = alloca i32, align 4
  %24 = alloca %"struct.std::pair.3", align 4
  %25 = alloca i32, align 4
  %26 = alloca i32, align 4
  %27 = alloca %"struct.std::pair.8", align 8
  %28 = alloca %"struct.std::pair.3", align 4
  %29 = alloca i32, align 4
  %30 = tail call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %31 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %32 = getelementptr i8, ptr %31, i64 -24
  %33 = load i64, ptr %32, align 8
  %34 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %33
  %35 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %34, ptr noundef null)
  %36 = 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)
  %37 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %36, ptr noundef nonnull align 4 dereferenceable(4) @D)
  %38 = load i32, ptr @N, align 4, !tbaa !8
  %39 = icmp sgt i32 %38, 0
  br i1 %39, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %0
  call void @llvm.lifetime.start.p0(i64 80, ptr nonnull %1) #8
  call void @_ZNSt5queueISt4pairIS0_IiiEiESt5dequeIS2_SaIS2_EEEC2IS5_vEEv(ptr noundef nonnull align 8 dereferenceable(80) %1)
  %40 = load i32, ptr @N, align 4, !tbaa !8
  %41 = add nsw i32 %40, -1
  %42 = sext i32 %41 to i64
  %43 = getelementptr inbounds [1000 x [1000 x i32]], ptr @mnd, i64 0, i64 %42
  %44 = sext i32 %40 to i64
  %45 = getelementptr inbounds i32, ptr %43, i64 %44
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #8
  store double 1.000000e+06, ptr %2, align 8, !tbaa !11
  invoke void @_ZSt4fillIPidEvT_S1_RKT0_(ptr noundef nonnull @mnd, ptr noundef nonnull %45, ptr noundef nonnull align 8 dereferenceable(8) %2)
          to label %51 unwind label %55

.lr.ph:                                           ; preds = %0, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %0 ]
  %46 = getelementptr inbounds [1000 x %"class.std::__cxx11::basic_string"], ptr @_Z5firstB5cxx11, i64 0, i64 %indvars.iv
  %47 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(32) %46)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %48 = load i32, ptr @N, align 4, !tbaa !8
  %49 = sext i32 %48 to i64
  %50 = icmp slt i64 %indvars.iv.next, %49
  br i1 %50, label %.lr.ph, label %._crit_edge, !llvm.loop !13

51:                                               ; preds = %._crit_edge
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #8
  store i32 0, ptr %3, align 4, !tbaa !8
  %52 = load i32, ptr @N, align 4, !tbaa !8
  %53 = icmp sgt i32 %52, 0
  br i1 %53, label %.lr.ph103.split.preheader, label %._crit_edge104

.lr.ph103.split.preheader:                        ; preds = %51
  %.sroa.249.0..sroa_idx = getelementptr inbounds i8, ptr %5, i64 8
  br label %.lr.ph103.split

._crit_edge104:                                   ; preds = %._crit_edge101, %51
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #8
  %54 = call noundef zeroext i1 @_ZNKSt5queueISt4pairIS0_IiiEiESt5dequeIS2_SaIS2_EEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %1)
  br i1 %54, label %._crit_edge109, label %.lr.ph108

.lr.ph108:                                        ; preds = %._crit_edge104
  %.sroa.229.0..sroa_idx = getelementptr inbounds i8, ptr %10, i64 8
  br label %82

55:                                               ; preds = %._crit_edge
  %56 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #8
  br label %268

.lr.ph103.split:                                  ; preds = %.lr.ph103.split.preheader, %._crit_edge101
  %57 = phi i32 [ %52, %.lr.ph103.split.preheader ], [ %60, %._crit_edge101 ]
  %58 = phi i32 [ 0, %.lr.ph103.split.preheader ], [ %62, %._crit_edge101 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #8
  store i32 0, ptr %4, align 4, !tbaa !8
  %59 = icmp sgt i32 %57, 0
  br i1 %59, label %.lr.ph100, label %._crit_edge101

._crit_edge101.loopexit:                          ; preds = %77
  %.pre = load i32, ptr %3, align 4, !tbaa !8
  br label %._crit_edge101

._crit_edge101:                                   ; preds = %._crit_edge101.loopexit, %.lr.ph103.split
  %60 = phi i32 [ %80, %._crit_edge101.loopexit ], [ %57, %.lr.ph103.split ]
  %61 = phi i32 [ %.pre, %._crit_edge101.loopexit ], [ %58, %.lr.ph103.split ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #8
  %62 = add nsw i32 %61, 1
  store i32 %62, ptr %3, align 4, !tbaa !8
  %63 = icmp slt i32 %62, %60
  br i1 %63, label %.lr.ph103.split, label %._crit_edge104, !llvm.loop !15

.lr.ph100:                                        ; preds = %.lr.ph103.split, %77
  %storemerge8398 = phi i32 [ %79, %77 ], [ 0, %.lr.ph103.split ]
  %64 = load i32, ptr %3, align 4, !tbaa !8
  %65 = sext i32 %64 to i64
  %66 = getelementptr inbounds [1000 x %"class.std::__cxx11::basic_string"], ptr @_Z5firstB5cxx11, i64 0, i64 %65
  %67 = sext i32 %storemerge8398 to i64
  %68 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %66, i64 noundef %67)
  %69 = load i8, ptr %68, align 1, !tbaa !17
  %70 = icmp eq i8 %69, 35
  br i1 %70, label %71, label %77

71:                                               ; preds = %.lr.ph100
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %5) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #8
  call void @_ZNSt4pairIiiEC2IRiS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %6, ptr noundef nonnull align 4 dereferenceable(4) %3, ptr noundef nonnull align 4 dereferenceable(4) %4)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #8
  store i32 0, ptr %7, align 4, !tbaa !8
  %72 = invoke { i64, i32 } @_ZSt9make_pairISt4pairIiiEiES0_INSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(8) %6, ptr noundef nonnull align 4 dereferenceable(4) %7)
          to label %73 unwind label %75

73:                                               ; preds = %71
  %.fca.0.extract46 = extractvalue { i64, i32 } %72, 0
  %.fca.1.extract47 = extractvalue { i64, i32 } %72, 1
  store i64 %.fca.0.extract46, ptr %5, align 8
  store i32 %.fca.1.extract47, ptr %.sroa.249.0..sroa_idx, align 8
  invoke void @_ZNSt5queueISt4pairIS0_IiiEiESt5dequeIS2_SaIS2_EEE4pushEOS2_(ptr noundef nonnull align 8 dereferenceable(80) %1, ptr noundef nonnull align 4 dereferenceable(12) %5)
          to label %74 unwind label %75

74:                                               ; preds = %73
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #8
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %5) #8
  br label %77

75:                                               ; preds = %73, %71
  %76 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #8
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %5) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #8
  br label %268

77:                                               ; preds = %.lr.ph100, %74
  %78 = load i32, ptr %4, align 4, !tbaa !8
  %79 = add nsw i32 %78, 1
  store i32 %79, ptr %4, align 4, !tbaa !8
  %80 = load i32, ptr @N, align 4, !tbaa !8
  %81 = icmp slt i32 %79, %80
  br i1 %81, label %.lr.ph100, label %._crit_edge101.loopexit, !llvm.loop !18

82:                                               ; preds = %.lr.ph108, %.loopexit95
  %83 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt5queueISt4pairIS0_IiiEiESt5dequeIS2_SaIS2_EEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) %1)
  %.sroa.037.0.copyload = load i32, ptr %83, align 4
  %.sroa.9.0..sroa_idx = getelementptr inbounds i8, ptr %83, i64 4
  %.sroa.9.0.copyload = load i32, ptr %.sroa.9.0..sroa_idx, align 4
  %84 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt5queueISt4pairIS0_IiiEiESt5dequeIS2_SaIS2_EEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) %1)
  %85 = getelementptr inbounds i8, ptr %84, i64 8
  %86 = load i32, ptr %85, align 4, !tbaa !19
  call void @_ZNSt5queueISt4pairIS0_IiiEiESt5dequeIS2_SaIS2_EEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %1)
  %87 = icmp slt i32 %.sroa.037.0.copyload, 0
  br i1 %87, label %.loopexit95, label %88, !llvm.loop !22

88:                                               ; preds = %82
  %89 = load i32, ptr @N, align 4, !tbaa !8
  %90 = icmp slt i32 %.sroa.037.0.copyload, %89
  %91 = icmp sgt i32 %.sroa.9.0.copyload, -1
  %.not81 = icmp slt i32 %.sroa.9.0.copyload, %89
  %92 = and i1 %91, %.not81
  %or.cond86 = select i1 %90, i1 %92, i1 false
  br i1 %or.cond86, label %93, label %.loopexit95, !llvm.loop !22

93:                                               ; preds = %88
  %94 = zext nneg i32 %.sroa.037.0.copyload to i64
  %95 = zext nneg i32 %.sroa.9.0.copyload to i64
  %96 = getelementptr inbounds [1000 x [1000 x i32]], ptr @mnd, i64 0, i64 %94, i64 %95
  %97 = load i32, ptr %96, align 4, !tbaa !8
  %.not82 = icmp sgt i32 %97, %86
  br i1 %.not82, label %98, label %.loopexit95, !llvm.loop !22

98:                                               ; preds = %93
  store i32 %86, ptr %96, align 4, !tbaa !8
  %99 = add nsw i32 %86, 1
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #8
  %100 = load i32, ptr @dx, align 16, !tbaa !8
  %101 = add nsw i32 %100, %.sroa.037.0.copyload
  store i32 %101, ptr %8, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %9) #8
  %102 = load i32, ptr @dy, align 16, !tbaa !8
  %103 = add nsw i32 %102, %.sroa.9.0.copyload
  store i32 %103, ptr %9, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %10) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %11) #8
  call void @_ZNSt4pairIiiEC2IRiS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %11, ptr noundef nonnull align 4 dereferenceable(4) %8, ptr noundef nonnull align 4 dereferenceable(4) %9)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %12) #8
  store i32 %99, ptr %12, align 4, !tbaa !8
  %104 = invoke { i64, i32 } @_ZSt9make_pairISt4pairIiiEiES0_INSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(8) %11, ptr noundef nonnull align 4 dereferenceable(4) %12)
          to label %105 unwind label %127

105:                                              ; preds = %98
  %.fca.0.extract26 = extractvalue { i64, i32 } %104, 0
  %.fca.1.extract27 = extractvalue { i64, i32 } %104, 1
  store i64 %.fca.0.extract26, ptr %10, align 8
  store i32 %.fca.1.extract27, ptr %.sroa.229.0..sroa_idx, align 8
  invoke void @_ZNSt5queueISt4pairIS0_IiiEiESt5dequeIS2_SaIS2_EEE4pushEOS2_(ptr noundef nonnull align 8 dereferenceable(80) %1, ptr noundef nonnull align 4 dereferenceable(12) %10)
          to label %106 unwind label %127

106:                                              ; preds = %105
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %12) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #8
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %10) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #8
  %107 = load i32, ptr getelementptr inbounds (i8, ptr @dx, i64 4), align 4, !tbaa !8
  %108 = add nsw i32 %107, %.sroa.037.0.copyload
  store i32 %108, ptr %8, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %9) #8
  %109 = load i32, ptr getelementptr inbounds (i8, ptr @dy, i64 4), align 4, !tbaa !8
  %110 = add nsw i32 %109, %.sroa.9.0.copyload
  store i32 %110, ptr %9, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %10) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %11) #8
  call void @_ZNSt4pairIiiEC2IRiS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %11, ptr noundef nonnull align 4 dereferenceable(4) %8, ptr noundef nonnull align 4 dereferenceable(4) %9)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %12) #8
  store i32 %99, ptr %12, align 4, !tbaa !8
  %111 = invoke { i64, i32 } @_ZSt9make_pairISt4pairIiiEiES0_INSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(8) %11, ptr noundef nonnull align 4 dereferenceable(4) %12)
          to label %112 unwind label %127

112:                                              ; preds = %106
  %.fca.0.extract26.1 = extractvalue { i64, i32 } %111, 0
  %.fca.1.extract27.1 = extractvalue { i64, i32 } %111, 1
  store i64 %.fca.0.extract26.1, ptr %10, align 8
  store i32 %.fca.1.extract27.1, ptr %.sroa.229.0..sroa_idx, align 8
  invoke void @_ZNSt5queueISt4pairIS0_IiiEiESt5dequeIS2_SaIS2_EEE4pushEOS2_(ptr noundef nonnull align 8 dereferenceable(80) %1, ptr noundef nonnull align 4 dereferenceable(12) %10)
          to label %113 unwind label %127

113:                                              ; preds = %112
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %12) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #8
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %10) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #8
  %114 = load i32, ptr getelementptr inbounds (i8, ptr @dx, i64 8), align 8, !tbaa !8
  %115 = add nsw i32 %114, %.sroa.037.0.copyload
  store i32 %115, ptr %8, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %9) #8
  %116 = load i32, ptr getelementptr inbounds (i8, ptr @dy, i64 8), align 8, !tbaa !8
  %117 = add nsw i32 %116, %.sroa.9.0.copyload
  store i32 %117, ptr %9, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %10) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %11) #8
  call void @_ZNSt4pairIiiEC2IRiS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %11, ptr noundef nonnull align 4 dereferenceable(4) %8, ptr noundef nonnull align 4 dereferenceable(4) %9)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %12) #8
  store i32 %99, ptr %12, align 4, !tbaa !8
  %118 = invoke { i64, i32 } @_ZSt9make_pairISt4pairIiiEiES0_INSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(8) %11, ptr noundef nonnull align 4 dereferenceable(4) %12)
          to label %119 unwind label %127

119:                                              ; preds = %113
  %.fca.0.extract26.2 = extractvalue { i64, i32 } %118, 0
  %.fca.1.extract27.2 = extractvalue { i64, i32 } %118, 1
  store i64 %.fca.0.extract26.2, ptr %10, align 8
  store i32 %.fca.1.extract27.2, ptr %.sroa.229.0..sroa_idx, align 8
  invoke void @_ZNSt5queueISt4pairIS0_IiiEiESt5dequeIS2_SaIS2_EEE4pushEOS2_(ptr noundef nonnull align 8 dereferenceable(80) %1, ptr noundef nonnull align 4 dereferenceable(12) %10)
          to label %120 unwind label %127

120:                                              ; preds = %119
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %12) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #8
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %10) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #8
  %121 = load i32, ptr getelementptr inbounds (i8, ptr @dx, i64 12), align 4, !tbaa !8
  %122 = add nsw i32 %121, %.sroa.037.0.copyload
  store i32 %122, ptr %8, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %9) #8
  %123 = load i32, ptr getelementptr inbounds (i8, ptr @dy, i64 12), align 4, !tbaa !8
  %124 = add nsw i32 %123, %.sroa.9.0.copyload
  store i32 %124, ptr %9, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %10) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %11) #8
  call void @_ZNSt4pairIiiEC2IRiS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %11, ptr noundef nonnull align 4 dereferenceable(4) %8, ptr noundef nonnull align 4 dereferenceable(4) %9)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %12) #8
  store i32 %99, ptr %12, align 4, !tbaa !8
  %125 = invoke { i64, i32 } @_ZSt9make_pairISt4pairIiiEiES0_INSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(8) %11, ptr noundef nonnull align 4 dereferenceable(4) %12)
          to label %126 unwind label %127

126:                                              ; preds = %120
  %.fca.0.extract26.3 = extractvalue { i64, i32 } %125, 0
  %.fca.1.extract27.3 = extractvalue { i64, i32 } %125, 1
  store i64 %.fca.0.extract26.3, ptr %10, align 8
  store i32 %.fca.1.extract27.3, ptr %.sroa.229.0..sroa_idx, align 8
  invoke void @_ZNSt5queueISt4pairIS0_IiiEiESt5dequeIS2_SaIS2_EEE4pushEOS2_(ptr noundef nonnull align 8 dereferenceable(80) %1, ptr noundef nonnull align 4 dereferenceable(12) %10)
          to label %.loopexit95.loopexit unwind label %127

.loopexit95.loopexit:                             ; preds = %126
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %12) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #8
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %10) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #8
  br label %.loopexit95

127:                                              ; preds = %126, %120, %119, %113, %112, %106, %105, %98
  %128 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %12) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #8
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %10) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #8
  br label %268

.loopexit95:                                      ; preds = %.loopexit95.loopexit, %82, %88, %93
  %129 = call noundef zeroext i1 @_ZNKSt5queueISt4pairIS0_IiiEiESt5dequeIS2_SaIS2_EEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %1)
  br i1 %129, label %._crit_edge109, label %82

._crit_edge109:                                   ; preds = %.loopexit95, %._crit_edge104
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %13) #8
  store i32 0, ptr %13, align 4, !tbaa !8
  %130 = load i32, ptr @N, align 4, !tbaa !8
  %131 = icmp sgt i32 %130, 0
  br i1 %131, label %.lr.ph115.split.preheader, label %._crit_edge116

.lr.ph115.split.preheader:                        ; preds = %._crit_edge109
  %.sroa.225.0..sroa_idx = getelementptr inbounds i8, ptr %15, i64 8
  br label %.lr.ph115.split

._crit_edge116:                                   ; preds = %._crit_edge113, %._crit_edge109
  %.lcssa = phi i32 [ %130, %._crit_edge109 ], [ %140, %._crit_edge113 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %13) #8
  %132 = add nsw i32 %.lcssa, -1
  %133 = sext i32 %132 to i64
  %134 = getelementptr inbounds [1000 x [1000 x i32]], ptr @mxc, i64 0, i64 %133
  %135 = sext i32 %.lcssa to i64
  %136 = getelementptr inbounds i32, ptr %134, i64 %135
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %18) #8
  store i32 -1, ptr %18, align 4, !tbaa !8
  invoke void @_ZSt4fillIPiiEvT_S1_RKT0_(ptr noundef nonnull @mxc, ptr noundef nonnull %136, ptr noundef nonnull align 4 dereferenceable(4) %18)
          to label %162 unwind label %193

.lr.ph115.split:                                  ; preds = %.lr.ph115.split.preheader, %._crit_edge113
  %137 = phi i32 [ %130, %.lr.ph115.split.preheader ], [ %140, %._crit_edge113 ]
  %138 = phi i32 [ 0, %.lr.ph115.split.preheader ], [ %142, %._crit_edge113 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %14) #8
  store i32 0, ptr %14, align 4, !tbaa !8
  %139 = icmp sgt i32 %137, 0
  br i1 %139, label %.lr.ph112, label %._crit_edge113

._crit_edge113.loopexit:                          ; preds = %157
  %.pre153 = load i32, ptr %13, align 4, !tbaa !8
  br label %._crit_edge113

._crit_edge113:                                   ; preds = %._crit_edge113.loopexit, %.lr.ph115.split
  %140 = phi i32 [ %160, %._crit_edge113.loopexit ], [ %137, %.lr.ph115.split ]
  %141 = phi i32 [ %.pre153, %._crit_edge113.loopexit ], [ %138, %.lr.ph115.split ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %14) #8
  %142 = add nsw i32 %141, 1
  store i32 %142, ptr %13, align 4, !tbaa !8
  %143 = icmp slt i32 %142, %140
  br i1 %143, label %.lr.ph115.split, label %._crit_edge116, !llvm.loop !23

.lr.ph112:                                        ; preds = %.lr.ph115.split, %157
  %storemerge80110 = phi i32 [ %159, %157 ], [ 0, %.lr.ph115.split ]
  %144 = load i32, ptr %13, align 4, !tbaa !8
  %145 = sext i32 %144 to i64
  %146 = getelementptr inbounds [1000 x %"class.std::__cxx11::basic_string"], ptr @_Z5firstB5cxx11, i64 0, i64 %145
  %147 = sext i32 %storemerge80110 to i64
  %148 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %146, i64 noundef %147)
  %149 = load i8, ptr %148, align 1, !tbaa !17
  %150 = icmp eq i8 %149, 83
  br i1 %150, label %151, label %157

151:                                              ; preds = %.lr.ph112
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %15) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %16) #8
  call void @_ZNSt4pairIiiEC2IRiS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %16, ptr noundef nonnull align 4 dereferenceable(4) %13, ptr noundef nonnull align 4 dereferenceable(4) %14)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %17) #8
  store i32 0, ptr %17, align 4, !tbaa !8
  %152 = invoke { i64, i32 } @_ZSt9make_pairISt4pairIiiEiES0_INSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(8) %16, ptr noundef nonnull align 4 dereferenceable(4) %17)
          to label %153 unwind label %155

153:                                              ; preds = %151
  %.fca.0.extract22 = extractvalue { i64, i32 } %152, 0
  %.fca.1.extract23 = extractvalue { i64, i32 } %152, 1
  store i64 %.fca.0.extract22, ptr %15, align 8
  store i32 %.fca.1.extract23, ptr %.sroa.225.0..sroa_idx, align 8
  invoke void @_ZNSt5queueISt4pairIS0_IiiEiESt5dequeIS2_SaIS2_EEE4pushEOS2_(ptr noundef nonnull align 8 dereferenceable(80) %1, ptr noundef nonnull align 4 dereferenceable(12) %15)
          to label %154 unwind label %155

154:                                              ; preds = %153
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %17) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %16) #8
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %15) #8
  br label %157

155:                                              ; preds = %153, %151
  %156 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %17) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %16) #8
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %15) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %14) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %13) #8
  br label %268

157:                                              ; preds = %.lr.ph112, %154
  %158 = load i32, ptr %14, align 4, !tbaa !8
  %159 = add nsw i32 %158, 1
  store i32 %159, ptr %14, align 4, !tbaa !8
  %160 = load i32, ptr @N, align 4, !tbaa !8
  %161 = icmp slt i32 %159, %160
  br i1 %161, label %.lr.ph112, label %._crit_edge113.loopexit, !llvm.loop !24

162:                                              ; preds = %._crit_edge116
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %18) #8
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %19) #8
  call void @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %19) #8
  %163 = call noundef zeroext i1 @_ZNKSt5queueISt4pairIS0_IiiEiESt5dequeIS2_SaIS2_EEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %1)
  br i1 %163, label %._crit_edge122, label %.lr.ph121

.lr.ph121:                                        ; preds = %162
  %.sroa.2.0..sroa_idx = getelementptr inbounds i8, ptr %27, i64 8
  br label %164

164:                                              ; preds = %.lr.ph121, %.loopexit
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %20) #8
  %165 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt5queueISt4pairIS0_IiiEiESt5dequeIS2_SaIS2_EEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) %1)
  %166 = load i32, ptr %165, align 4, !tbaa !25
  store i32 %166, ptr %20, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %21) #8
  %167 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt5queueISt4pairIS0_IiiEiESt5dequeIS2_SaIS2_EEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) %1)
  %168 = getelementptr inbounds i8, ptr %167, i64 4
  %169 = load i32, ptr %168, align 4, !tbaa !26
  store i32 %169, ptr %21, align 4, !tbaa !8
  %170 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt5queueISt4pairIS0_IiiEiESt5dequeIS2_SaIS2_EEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) %1)
  %171 = getelementptr inbounds i8, ptr %170, i64 8
  %172 = load i32, ptr %171, align 4, !tbaa !19
  call void @_ZNSt5queueISt4pairIS0_IiiEiESt5dequeIS2_SaIS2_EEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %1)
  %173 = add nsw i32 %172, -1
  %174 = load i32, ptr @D, align 4, !tbaa !8
  %175 = sdiv i32 %173, %174
  %176 = load i32, ptr %20, align 4, !tbaa !8
  %177 = icmp slt i32 %176, 0
  br i1 %177, label %.loopexit, label %178, !llvm.loop !27

178:                                              ; preds = %164
  %179 = load i32, ptr @N, align 4, !tbaa !8
  %180 = icmp slt i32 %176, %179
  %181 = load i32, ptr %21, align 4
  %182 = icmp sgt i32 %181, -1
  %.not = icmp slt i32 %181, %179
  %183 = and i1 %182, %.not
  %or.cond87 = select i1 %180, i1 %183, i1 false
  br i1 %or.cond87, label %184, label %.loopexit, !llvm.loop !27

184:                                              ; preds = %178
  %185 = zext nneg i32 %176 to i64
  %186 = zext nneg i32 %181 to i64
  %187 = getelementptr inbounds [1000 x [1000 x i8]], ptr @vis, i64 0, i64 %185, i64 %186
  %188 = load i8, ptr %187, align 1, !tbaa !28, !range !30, !noundef !31
  %189 = trunc nuw i8 %188 to i1
  br i1 %189, label %.loopexit, label %190, !llvm.loop !27

190:                                              ; preds = %184
  %191 = getelementptr inbounds [1000 x [1000 x i32]], ptr @mnd, i64 0, i64 %185, i64 %186
  %192 = load i32, ptr %191, align 4, !tbaa !8
  %.not75 = icmp slt i32 %175, %192
  br i1 %.not75, label %197, label %.loopexit, !llvm.loop !27

193:                                              ; preds = %._crit_edge116
  %194 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %18) #8
  br label %268

195:                                              ; preds = %._crit_edge122
  %196 = landingpad { ptr, i32 }
          cleanup
  br label %267

197:                                              ; preds = %190
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %22) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %23) #8
  %198 = add nsw i32 %192, -1
  store i32 %198, ptr %23, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %24) #8
  call void @_ZNSt4pairIiiEC2IRiS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %24, ptr noundef nonnull align 4 dereferenceable(4) %20, ptr noundef nonnull align 4 dereferenceable(4) %21)
  call void @_ZNSt4pairIiS_IiiEEC2IiS0_TnNSt9enable_ifIXaaclsr5_PCCPE18_ConstructiblePairIT_T0_EEclsr5_PCCPE26_ImplicitlyConvertiblePairIS4_S5_EEEbE4typeELb1EEERKiRKS0_(ptr noundef nonnull align 4 dereferenceable(12) %22, ptr noundef nonnull align 4 dereferenceable(4) %23, ptr noundef nonnull align 4 dereferenceable(8) %24)
  invoke void @_ZNSt14priority_queueISt4pairIiS0_IiiEESt6vectorIS2_SaIS2_EESt4lessIS2_EE4pushEOS2_(ptr noundef nonnull align 8 dereferenceable(25) @q1, ptr noundef nonnull align 4 dereferenceable(12) %22)
          to label %199 unwind label %205

199:                                              ; preds = %197
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %24) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %23) #8
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %22) #8
  %200 = load i32, ptr @D, align 4, !tbaa !8
  %201 = sdiv i32 %172, %200
  %.not76 = icmp eq i32 %201, %175
  %.pre154 = load i32, ptr %20, align 4, !tbaa !8
  %.pre155 = load i32, ptr %21, align 4, !tbaa !8
  %.pre157 = sext i32 %.pre154 to i64
  %.pre158 = sext i32 %.pre155 to i64
  br i1 %.not76, label %._crit_edge156, label %202

202:                                              ; preds = %199
  %203 = getelementptr inbounds [1000 x [1000 x i32]], ptr @mnd, i64 0, i64 %.pre157, i64 %.pre158
  %204 = load i32, ptr %203, align 4, !tbaa !8
  %.not77 = icmp slt i32 %201, %204
  br i1 %.not77, label %._crit_edge156, label %.loopexit, !llvm.loop !27

205:                                              ; preds = %197
  %206 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %24) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %23) #8
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %22) #8
  br label %245

._crit_edge156:                                   ; preds = %199, %202
  %207 = getelementptr inbounds [1000 x [1000 x i8]], ptr @vis, i64 0, i64 %.pre157, i64 %.pre158
  store i8 1, ptr %207, align 1, !tbaa !28
  %208 = add nsw i32 %172, 1
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %25) #8
  %209 = load i32, ptr @dx, align 16, !tbaa !8
  %210 = add nsw i32 %209, %.pre154
  store i32 %210, ptr %25, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %26) #8
  %211 = load i32, ptr @dy, align 16, !tbaa !8
  %212 = add nsw i32 %211, %.pre155
  store i32 %212, ptr %26, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %27) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %28) #8
  call void @_ZNSt4pairIiiEC2IRiS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %28, ptr noundef nonnull align 4 dereferenceable(4) %25, ptr noundef nonnull align 4 dereferenceable(4) %26)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %29) #8
  store i32 %208, ptr %29, align 4, !tbaa !8
  %213 = invoke { i64, i32 } @_ZSt9make_pairISt4pairIiiEiES0_INSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(8) %28, ptr noundef nonnull align 4 dereferenceable(4) %29)
          to label %214 unwind label %242

214:                                              ; preds = %._crit_edge156
  %.fca.0.extract = extractvalue { i64, i32 } %213, 0
  %.fca.1.extract = extractvalue { i64, i32 } %213, 1
  store i64 %.fca.0.extract, ptr %27, align 8
  store i32 %.fca.1.extract, ptr %.sroa.2.0..sroa_idx, align 8
  invoke void @_ZNSt5queueISt4pairIS0_IiiEiESt5dequeIS2_SaIS2_EEE4pushEOS2_(ptr noundef nonnull align 8 dereferenceable(80) %1, ptr noundef nonnull align 4 dereferenceable(12) %27)
          to label %215 unwind label %242

215:                                              ; preds = %214
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %29) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %28) #8
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %27) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %26) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %25) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %25) #8
  %216 = load i32, ptr %20, align 4, !tbaa !8
  %217 = load i32, ptr getelementptr inbounds (i8, ptr @dx, i64 4), align 4, !tbaa !8
  %218 = add nsw i32 %217, %216
  store i32 %218, ptr %25, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %26) #8
  %219 = load i32, ptr %21, align 4, !tbaa !8
  %220 = load i32, ptr getelementptr inbounds (i8, ptr @dy, i64 4), align 4, !tbaa !8
  %221 = add nsw i32 %220, %219
  store i32 %221, ptr %26, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %27) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %28) #8
  call void @_ZNSt4pairIiiEC2IRiS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %28, ptr noundef nonnull align 4 dereferenceable(4) %25, ptr noundef nonnull align 4 dereferenceable(4) %26)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %29) #8
  store i32 %208, ptr %29, align 4, !tbaa !8
  %222 = invoke { i64, i32 } @_ZSt9make_pairISt4pairIiiEiES0_INSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(8) %28, ptr noundef nonnull align 4 dereferenceable(4) %29)
          to label %223 unwind label %242

223:                                              ; preds = %215
  %.fca.0.extract.1 = extractvalue { i64, i32 } %222, 0
  %.fca.1.extract.1 = extractvalue { i64, i32 } %222, 1
  store i64 %.fca.0.extract.1, ptr %27, align 8
  store i32 %.fca.1.extract.1, ptr %.sroa.2.0..sroa_idx, align 8
  invoke void @_ZNSt5queueISt4pairIS0_IiiEiESt5dequeIS2_SaIS2_EEE4pushEOS2_(ptr noundef nonnull align 8 dereferenceable(80) %1, ptr noundef nonnull align 4 dereferenceable(12) %27)
          to label %224 unwind label %242

224:                                              ; preds = %223
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %29) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %28) #8
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %27) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %26) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %25) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %25) #8
  %225 = load i32, ptr %20, align 4, !tbaa !8
  %226 = load i32, ptr getelementptr inbounds (i8, ptr @dx, i64 8), align 8, !tbaa !8
  %227 = add nsw i32 %226, %225
  store i32 %227, ptr %25, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %26) #8
  %228 = load i32, ptr %21, align 4, !tbaa !8
  %229 = load i32, ptr getelementptr inbounds (i8, ptr @dy, i64 8), align 8, !tbaa !8
  %230 = add nsw i32 %229, %228
  store i32 %230, ptr %26, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %27) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %28) #8
  call void @_ZNSt4pairIiiEC2IRiS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %28, ptr noundef nonnull align 4 dereferenceable(4) %25, ptr noundef nonnull align 4 dereferenceable(4) %26)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %29) #8
  store i32 %208, ptr %29, align 4, !tbaa !8
  %231 = invoke { i64, i32 } @_ZSt9make_pairISt4pairIiiEiES0_INSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(8) %28, ptr noundef nonnull align 4 dereferenceable(4) %29)
          to label %232 unwind label %242

232:                                              ; preds = %224
  %.fca.0.extract.2 = extractvalue { i64, i32 } %231, 0
  %.fca.1.extract.2 = extractvalue { i64, i32 } %231, 1
  store i64 %.fca.0.extract.2, ptr %27, align 8
  store i32 %.fca.1.extract.2, ptr %.sroa.2.0..sroa_idx, align 8
  invoke void @_ZNSt5queueISt4pairIS0_IiiEiESt5dequeIS2_SaIS2_EEE4pushEOS2_(ptr noundef nonnull align 8 dereferenceable(80) %1, ptr noundef nonnull align 4 dereferenceable(12) %27)
          to label %233 unwind label %242

233:                                              ; preds = %232
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %29) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %28) #8
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %27) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %26) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %25) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %25) #8
  %234 = load i32, ptr %20, align 4, !tbaa !8
  %235 = load i32, ptr getelementptr inbounds (i8, ptr @dx, i64 12), align 4, !tbaa !8
  %236 = add nsw i32 %235, %234
  store i32 %236, ptr %25, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %26) #8
  %237 = load i32, ptr %21, align 4, !tbaa !8
  %238 = load i32, ptr getelementptr inbounds (i8, ptr @dy, i64 12), align 4, !tbaa !8
  %239 = add nsw i32 %238, %237
  store i32 %239, ptr %26, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %27) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %28) #8
  call void @_ZNSt4pairIiiEC2IRiS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %28, ptr noundef nonnull align 4 dereferenceable(4) %25, ptr noundef nonnull align 4 dereferenceable(4) %26)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %29) #8
  store i32 %208, ptr %29, align 4, !tbaa !8
  %240 = invoke { i64, i32 } @_ZSt9make_pairISt4pairIiiEiES0_INSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(8) %28, ptr noundef nonnull align 4 dereferenceable(4) %29)
          to label %241 unwind label %242

241:                                              ; preds = %233
  %.fca.0.extract.3 = extractvalue { i64, i32 } %240, 0
  %.fca.1.extract.3 = extractvalue { i64, i32 } %240, 1
  store i64 %.fca.0.extract.3, ptr %27, align 8
  store i32 %.fca.1.extract.3, ptr %.sroa.2.0..sroa_idx, align 8
  invoke void @_ZNSt5queueISt4pairIS0_IiiEiESt5dequeIS2_SaIS2_EEE4pushEOS2_(ptr noundef nonnull align 8 dereferenceable(80) %1, ptr noundef nonnull align 4 dereferenceable(12) %27)
          to label %.loopexit.loopexit unwind label %242

.loopexit.loopexit:                               ; preds = %241
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %29) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %28) #8
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %27) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %26) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %25) #8
  br label %.loopexit

242:                                              ; preds = %241, %233, %232, %224, %223, %215, %214, %._crit_edge156
  %243 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %29) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %28) #8
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %27) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %26) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %25) #8
  br label %245

.loopexit:                                        ; preds = %.loopexit.loopexit, %202, %164, %178, %184, %190
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %21) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %20) #8
  %244 = call noundef zeroext i1 @_ZNKSt5queueISt4pairIS0_IiiEiESt5dequeIS2_SaIS2_EEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %1)
  br i1 %244, label %._crit_edge122, label %164

245:                                              ; preds = %242, %205
  %.pn = phi { ptr, i32 } [ %243, %242 ], [ %206, %205 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %21) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %20) #8
  br label %267

._crit_edge122:                                   ; preds = %.loopexit, %162
  invoke void @_Z17bfsdijkstrathingyv()
          to label %.preheader94 unwind label %195

.preheader94:                                     ; preds = %._crit_edge122
  %246 = load i32, ptr @N, align 4, !tbaa !8
  %247 = icmp sgt i32 %246, 0
  br i1 %247, label %.preheader.us.preheader, label %._crit_edge130

.preheader.us.preheader:                          ; preds = %.preheader94
  %wide.trip.count151 = zext nneg i32 %246 to i64
  %min.iters.check = icmp ult i32 %246, 8
  %n.vec = and i64 %wide.trip.count151, 2147483640
  %cmp.n = icmp eq i64 %n.vec, %wide.trip.count151
  br label %.preheader.us

.preheader.us:                                    ; preds = %.preheader.us.preheader, %._crit_edge126.us
  %indvars.iv148 = phi i64 [ 0, %.preheader.us.preheader ], [ %indvars.iv.next149, %._crit_edge126.us ]
  %.056128.us = phi i32 [ 0, %.preheader.us.preheader ], [ %.lcssa164, %._crit_edge126.us ]
  br i1 %min.iters.check, label %scalar.ph.preheader, label %vector.ph

vector.ph:                                        ; preds = %.preheader.us
  %248 = insertelement <4 x i32> <i32 poison, i32 0, i32 0, i32 0>, i32 %.056128.us, i64 0
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %vec.phi = phi <4 x i32> [ %248, %vector.ph ], [ %253, %vector.body ]
  %vec.phi168 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %254, %vector.body ]
  %249 = getelementptr inbounds [1000 x [1000 x i8]], ptr @cput, i64 0, i64 %indvars.iv148, i64 %index
  %250 = getelementptr inbounds i8, ptr %249, i64 4
  %wide.load = load <4 x i8>, ptr %249, align 8, !tbaa !28
  %wide.load169 = load <4 x i8>, ptr %250, align 4, !tbaa !28
  %251 = zext <4 x i8> %wide.load to <4 x i32>
  %252 = zext <4 x i8> %wide.load169 to <4 x i32>
  %253 = add <4 x i32> %vec.phi, %251
  %254 = add <4 x i32> %vec.phi168, %252
  %index.next = add nuw i64 %index, 8
  %255 = icmp eq i64 %index.next, %n.vec
  br i1 %255, label %middle.block, label %vector.body, !llvm.loop !32

middle.block:                                     ; preds = %vector.body
  %bin.rdx = add <4 x i32> %254, %253
  %256 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
  br i1 %cmp.n, label %._crit_edge126.us, label %scalar.ph.preheader

scalar.ph.preheader:                              ; preds = %middle.block, %.preheader.us
  %indvars.iv145.ph = phi i64 [ 0, %.preheader.us ], [ %n.vec, %middle.block ]
  %.1123.us.ph = phi i32 [ %.056128.us, %.preheader.us ], [ %256, %middle.block ]
  br label %scalar.ph

scalar.ph:                                        ; preds = %scalar.ph.preheader, %scalar.ph
  %indvars.iv145 = phi i64 [ %indvars.iv.next146, %scalar.ph ], [ %indvars.iv145.ph, %scalar.ph.preheader ]
  %.1123.us = phi i32 [ %260, %scalar.ph ], [ %.1123.us.ph, %scalar.ph.preheader ]
  %257 = getelementptr inbounds [1000 x [1000 x i8]], ptr @cput, i64 0, i64 %indvars.iv148, i64 %indvars.iv145
  %258 = load i8, ptr %257, align 1, !tbaa !28, !range !30, !noundef !31
  %259 = zext nneg i8 %258 to i32
  %260 = add nsw i32 %.1123.us, %259
  %indvars.iv.next146 = add nuw nsw i64 %indvars.iv145, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next146, %wide.trip.count151
  br i1 %exitcond.not, label %._crit_edge126.us, label %scalar.ph, !llvm.loop !35

._crit_edge126.us:                                ; preds = %scalar.ph, %middle.block
  %.lcssa164 = phi i32 [ %256, %middle.block ], [ %260, %scalar.ph ]
  %indvars.iv.next149 = add nuw nsw i64 %indvars.iv148, 1
  %exitcond152.not = icmp eq i64 %indvars.iv.next149, %wide.trip.count151
  br i1 %exitcond152.not, label %._crit_edge130, label %.preheader.us, !llvm.loop !36

._crit_edge130:                                   ; preds = %._crit_edge126.us, %.preheader94
  %.056.lcssa = phi i32 [ 0, %.preheader94 ], [ %.lcssa164, %._crit_edge126.us ]
  %261 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %.056.lcssa)
          to label %262 unwind label %265

262:                                              ; preds = %._crit_edge130
  %263 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %261, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %264 unwind label %265

264:                                              ; preds = %262
  call void @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %19) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %19) #8
  call void @_ZNSt5queueISt4pairIS0_IiiEiESt5dequeIS2_SaIS2_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %1) #8
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %1) #8
  ret i32 0

265:                                              ; preds = %262, %._crit_edge130
  %266 = landingpad { ptr, i32 }
          cleanup
  br label %267

267:                                              ; preds = %265, %245, %195
  %.pn.pn = phi { ptr, i32 } [ %.pn, %245 ], [ %266, %265 ], [ %196, %195 ]
  call void @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %19) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %19) #8
  br label %268

268:                                              ; preds = %267, %193, %155, %127, %75, %55
  %.pn84 = phi { ptr, i32 } [ %76, %75 ], [ %128, %127 ], [ %156, %155 ], [ %.pn.pn, %267 ], [ %194, %193 ], [ %56, %55 ]
  call void @_ZNSt5queueISt4pairIS0_IiiEiESt5dequeIS2_SaIS2_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %1) #8
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %1) #8
  resume { ptr, i32 } %.pn84
}

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

; Function Attrs: mustprogress nounwind uwtable
declare noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264), ptr noundef) local_unnamed_addr #2 align 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 #4

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

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

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

declare i32 @__gxx_personality_v0(...)

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

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

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

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4fillIPiiEvT_S1_RKT0_(ptr noundef, ptr noundef, ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #5

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt4pairIiS_IiiEEC2IiS0_TnNSt9enable_ifIXaaclsr5_PCCPE18_ConstructiblePairIT_T0_EEclsr5_PCCPE26_ImplicitlyConvertiblePairIS4_S5_EEEbE4typeELb1EEERKiRKS0_(ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(8)) unnamed_addr #2 align 2

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

; 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 #0 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 nounwind uwtable
declare dso_local void @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #2 align 2

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #7

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"double", !10, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14, !16}
!16 = !{!"llvm.loop.unswitch.partial.disable"}
!17 = !{!10, !10, i64 0}
!18 = distinct !{!18, !14}
!19 = !{!20, !9, i64 8}
!20 = !{!"_ZTSSt4pairIS_IiiEiE", !21, i64 0, !9, i64 8}
!21 = !{!"_ZTSSt4pairIiiE", !9, i64 0, !9, i64 4}
!22 = distinct !{!22, !14}
!23 = distinct !{!23, !14, !16}
!24 = distinct !{!24, !14}
!25 = !{!20, !9, i64 0}
!26 = !{!20, !9, i64 4}
!27 = distinct !{!27, !14}
!28 = !{!29, !29, i64 0}
!29 = !{!"bool", !10, i64 0}
!30 = !{i8 0, i8 2}
!31 = !{}
!32 = distinct !{!32, !14, !33, !34}
!33 = !{!"llvm.loop.isvectorized", i32 1}
!34 = !{!"llvm.loop.unroll.runtime.disable"}
!35 = distinct !{!35, !14, !34, !33}
!36 = distinct !{!36, !14}


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