; LLVM IR from VastoLorde95/Competitive-Programming :: SPOJ/Random/DP (dp)

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

%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.0" = type { %"struct.std::_Vector_base.1" }
%"struct.std::_Vector_base.1" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"struct.std::pair" = type { i32, i32 }

@x = external dso_local global [4 x i32], align 16
@y = external dso_local global [4 x i32], align 16
@c = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@n = external dso_local global i32, align 4
@start = external dso_local global i32, align 4
@ND = external dso_local global i32, align 4
@node = external dso_local global i32, align 4
@node2 = external dso_local global i32, align 4
@a = external dso_local global i32, align 4
@b = external dso_local global i32, align 4
@N = external dso_local global i32, align 4
@graph = external dso_local global [3000 x %"class.std::vector"], align 16
@times = external dso_local global %"class.std::vector.0", align 8
@delivery = external dso_local global %"class.std::vector.0", align 8
@grid = external dso_local global [55 x [55 x i8]], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [6 x i8], align 1
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str.5 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z8dijkstrai(i32 noundef) #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 i64 @_ZSt9make_pairIiRiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #0

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z6resulti(i32 noundef) #0

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #2 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca %"struct.std::pair", align 4
  %8 = alloca i32, align 4
  %9 = alloca %"struct.std::pair", align 4
  %10 = alloca i32, align 4
  %11 = alloca %"struct.std::pair", align 4
  %12 = alloca i32, align 4
  %13 = alloca %"struct.std::pair", align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %17 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @c)
  br label %18

18:                                               ; preds = %284, %264, %0
  %19 = load i32, ptr @c, align 4, !tbaa !5
  %20 = add nsw i32 %19, -1
  store i32 %20, ptr @c, align 4, !tbaa !5
  %21 = icmp ne i32 %19, 0
  br i1 %21, label %22, label %285

22:                                               ; preds = %18
  %23 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.4, ptr noundef @m, ptr noundef @n)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #7
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %24

24:                                               ; preds = %35, %22
  %25 = load i32, ptr %2, align 4, !tbaa !5
  %26 = load i32, ptr @m, align 4, !tbaa !5
  %27 = icmp slt i32 %25, %26
  br i1 %27, label %29, label %28

28:                                               ; preds = %24
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #7
  br label %38

29:                                               ; preds = %24
  %30 = load i32, ptr %2, align 4, !tbaa !5
  %31 = sext i32 %30 to i64
  %32 = getelementptr inbounds [55 x [55 x i8]], ptr @grid, i64 0, i64 %31
  %33 = getelementptr inbounds [55 x i8], ptr %32, i64 0, i64 0
  %34 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcEERSt13basic_istreamIT_T0_ES6_PS3_(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef %33)
  br label %35

35:                                               ; preds = %29
  %36 = load i32, ptr %2, align 4, !tbaa !5
  %37 = add nsw i32 %36, 1
  store i32 %37, ptr %2, align 4, !tbaa !5
  br label %24, !llvm.loop !9

38:                                               ; preds = %28
  store i32 0, ptr @node, align 4, !tbaa !5
  store i32 -1, ptr @start, align 4, !tbaa !5
  %39 = load i32, ptr @n, align 4, !tbaa !5
  %40 = load i32, ptr @m, align 4, !tbaa !5
  %41 = mul nsw i32 %39, %40
  store i32 %41, ptr @N, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #7
  store i32 0, ptr %3, align 4, !tbaa !5
  br label %42

42:                                               ; preds = %240, %38
  %43 = load i32, ptr %3, align 4, !tbaa !5
  %44 = load i32, ptr @m, align 4, !tbaa !5
  %45 = icmp slt i32 %43, %44
  br i1 %45, label %47, label %46

46:                                               ; preds = %42
  store i32 7, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #7
  br label %243

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

48:                                               ; preds = %236, %47
  %49 = load i32, ptr %5, align 4, !tbaa !5
  %50 = load i32, ptr @n, align 4, !tbaa !5
  %51 = icmp slt i32 %49, %50
  br i1 %51, label %53, label %52

52:                                               ; preds = %48
  store i32 10, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #7
  br label %239

53:                                               ; preds = %48
  %54 = load i32, ptr %3, align 4, !tbaa !5
  %55 = sext i32 %54 to i64
  %56 = getelementptr inbounds [55 x [55 x i8]], ptr @grid, i64 0, i64 %55
  %57 = load i32, ptr %5, align 4, !tbaa !5
  %58 = sext i32 %57 to i64
  %59 = getelementptr inbounds [55 x i8], ptr %56, i64 0, i64 %58
  %60 = load i8, ptr %59, align 1, !tbaa !11
  %61 = sext i8 %60 to i32
  %62 = icmp eq i32 %61, 36
  br i1 %62, label %63, label %64

63:                                               ; preds = %53
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) @delivery, ptr noundef nonnull align 4 dereferenceable(4) @node)
  br label %77

64:                                               ; preds = %53
  %65 = load i32, ptr %3, align 4, !tbaa !5
  %66 = sext i32 %65 to i64
  %67 = getelementptr inbounds [55 x [55 x i8]], ptr @grid, i64 0, i64 %66
  %68 = load i32, ptr %5, align 4, !tbaa !5
  %69 = sext i32 %68 to i64
  %70 = getelementptr inbounds [55 x i8], ptr %67, i64 0, i64 %69
  %71 = load i8, ptr %70, align 1, !tbaa !11
  %72 = sext i8 %71 to i32
  %73 = icmp eq i32 %72, 88
  br i1 %73, label %74, label %76

74:                                               ; preds = %64
  %75 = load i32, ptr @node, align 4, !tbaa !5
  store i32 %75, ptr @start, align 4, !tbaa !5
  br label %76

76:                                               ; preds = %74, %64
  br label %77

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

78:                                               ; preds = %230, %77
  %79 = load i32, ptr %6, align 4, !tbaa !5
  %80 = icmp slt i32 %79, 4
  br i1 %80, label %82, label %81

81:                                               ; preds = %78
  store i32 13, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #7
  br label %233

82:                                               ; preds = %78
  %83 = load i32, ptr %3, align 4, !tbaa !5
  %84 = load i32, ptr %6, align 4, !tbaa !5
  %85 = sext i32 %84 to i64
  %86 = getelementptr inbounds [4 x i32], ptr @x, i64 0, i64 %85
  %87 = load i32, ptr %86, align 4, !tbaa !5
  %88 = add nsw i32 %83, %87
  store i32 %88, ptr @a, align 4, !tbaa !5
  %89 = load i32, ptr %5, align 4, !tbaa !5
  %90 = load i32, ptr %6, align 4, !tbaa !5
  %91 = sext i32 %90 to i64
  %92 = getelementptr inbounds [4 x i32], ptr @y, i64 0, i64 %91
  %93 = load i32, ptr %92, align 4, !tbaa !5
  %94 = add nsw i32 %89, %93
  store i32 %94, ptr @b, align 4, !tbaa !5
  %95 = load i32, ptr @node, align 4, !tbaa !5
  %96 = load i32, ptr %6, align 4, !tbaa !5
  %97 = sext i32 %96 to i64
  %98 = getelementptr inbounds [4 x i32], ptr @y, i64 0, i64 %97
  %99 = load i32, ptr %98, align 4, !tbaa !5
  %100 = add nsw i32 %95, %99
  %101 = load i32, ptr %6, align 4, !tbaa !5
  %102 = sext i32 %101 to i64
  %103 = getelementptr inbounds [4 x i32], ptr @x, i64 0, i64 %102
  %104 = load i32, ptr %103, align 4, !tbaa !5
  %105 = load i32, ptr @n, align 4, !tbaa !5
  %106 = mul nsw i32 %104, %105
  %107 = add nsw i32 %100, %106
  store i32 %107, ptr @node2, align 4, !tbaa !5
  %108 = load i32, ptr @a, align 4, !tbaa !5
  %109 = icmp slt i32 %108, 0
  br i1 %109, label %121, label %110

110:                                              ; preds = %82
  %111 = load i32, ptr @b, align 4, !tbaa !5
  %112 = icmp slt i32 %111, 0
  br i1 %112, label %121, label %113

113:                                              ; preds = %110
  %114 = load i32, ptr @a, align 4, !tbaa !5
  %115 = load i32, ptr @m, align 4, !tbaa !5
  %116 = icmp sge i32 %114, %115
  br i1 %116, label %121, label %117

117:                                              ; preds = %113
  %118 = load i32, ptr @b, align 4, !tbaa !5
  %119 = load i32, ptr @n, align 4, !tbaa !5
  %120 = icmp sge i32 %118, %119
  br i1 %120, label %121, label %122

121:                                              ; preds = %117, %113, %110, %82
  br label %230

122:                                              ; preds = %117
  %123 = load i32, ptr %3, align 4, !tbaa !5
  %124 = sext i32 %123 to i64
  %125 = getelementptr inbounds [55 x [55 x i8]], ptr @grid, i64 0, i64 %124
  %126 = load i32, ptr %5, align 4, !tbaa !5
  %127 = sext i32 %126 to i64
  %128 = getelementptr inbounds [55 x i8], ptr %125, i64 0, i64 %127
  %129 = load i8, ptr %128, align 1, !tbaa !11
  %130 = sext i8 %129 to i32
  %131 = icmp eq i32 %130, 36
  br i1 %131, label %142, label %132

132:                                              ; preds = %122
  %133 = load i32, ptr %3, align 4, !tbaa !5
  %134 = sext i32 %133 to i64
  %135 = getelementptr inbounds [55 x [55 x i8]], ptr @grid, i64 0, i64 %134
  %136 = load i32, ptr %5, align 4, !tbaa !5
  %137 = sext i32 %136 to i64
  %138 = getelementptr inbounds [55 x i8], ptr %135, i64 0, i64 %137
  %139 = load i8, ptr %138, align 1, !tbaa !11
  %140 = sext i8 %139 to i32
  %141 = icmp eq i32 %140, 88
  br i1 %141, label %142, label %147

142:                                              ; preds = %132, %122
  %143 = load i32, ptr @node, align 4, !tbaa !5
  %144 = sext i32 %143 to i64
  %145 = getelementptr inbounds [3000 x %"class.std::vector"], ptr @graph, i64 0, i64 %144
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #7
  store i32 2, ptr %8, align 4, !tbaa !5
  %146 = call i64 @_ZSt9make_pairIiRiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %8, ptr noundef nonnull align 4 dereferenceable(4) @node2)
  store i64 %146, ptr %7, align 4
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %145, ptr noundef nonnull align 4 dereferenceable(8) %7)
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #7
  br label %229

147:                                              ; preds = %132
  %148 = load i32, ptr @a, align 4, !tbaa !5
  %149 = sext i32 %148 to i64
  %150 = getelementptr inbounds [55 x [55 x i8]], ptr @grid, i64 0, i64 %149
  %151 = load i32, ptr @b, align 4, !tbaa !5
  %152 = sext i32 %151 to i64
  %153 = getelementptr inbounds [55 x i8], ptr %150, i64 0, i64 %152
  %154 = load i8, ptr %153, align 1, !tbaa !11
  %155 = sext i8 %154 to i32
  %156 = icmp eq i32 %155, 36
  br i1 %156, label %167, label %157

157:                                              ; preds = %147
  %158 = load i32, ptr @a, align 4, !tbaa !5
  %159 = sext i32 %158 to i64
  %160 = getelementptr inbounds [55 x [55 x i8]], ptr @grid, i64 0, i64 %159
  %161 = load i32, ptr @b, align 4, !tbaa !5
  %162 = sext i32 %161 to i64
  %163 = getelementptr inbounds [55 x i8], ptr %160, i64 0, i64 %162
  %164 = load i8, ptr %163, align 1, !tbaa !11
  %165 = sext i8 %164 to i32
  %166 = icmp eq i32 %165, 88
  br i1 %166, label %167, label %172

167:                                              ; preds = %157, %147
  %168 = load i32, ptr @node, align 4, !tbaa !5
  %169 = sext i32 %168 to i64
  %170 = getelementptr inbounds [3000 x %"class.std::vector"], ptr @graph, i64 0, i64 %169
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #7
  store i32 2, ptr %10, align 4, !tbaa !5
  %171 = call i64 @_ZSt9make_pairIiRiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %10, ptr noundef nonnull align 4 dereferenceable(4) @node2)
  store i64 %171, ptr %9, align 4
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %170, ptr noundef nonnull align 4 dereferenceable(8) %9)
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #7
  br label %228

172:                                              ; preds = %157
  %173 = load i32, ptr %3, align 4, !tbaa !5
  %174 = sext i32 %173 to i64
  %175 = getelementptr inbounds [55 x [55 x i8]], ptr @grid, i64 0, i64 %174
  %176 = load i32, ptr %5, align 4, !tbaa !5
  %177 = sext i32 %176 to i64
  %178 = getelementptr inbounds [55 x i8], ptr %175, i64 0, i64 %177
  %179 = load i8, ptr %178, align 1, !tbaa !11
  %180 = sext i8 %179 to i32
  %181 = sub nsw i32 %180, 48
  %182 = load i32, ptr @a, align 4, !tbaa !5
  %183 = sext i32 %182 to i64
  %184 = getelementptr inbounds [55 x [55 x i8]], ptr @grid, i64 0, i64 %183
  %185 = load i32, ptr @b, align 4, !tbaa !5
  %186 = sext i32 %185 to i64
  %187 = getelementptr inbounds [55 x i8], ptr %184, i64 0, i64 %186
  %188 = load i8, ptr %187, align 1, !tbaa !11
  %189 = sext i8 %188 to i32
  %190 = sub nsw i32 %189, 48
  %191 = sub nsw i32 %181, %190
  %192 = call i32 @llvm.abs.i32(i32 %191, i1 true)
  %193 = icmp eq i32 %192, 0
  br i1 %193, label %194, label %199

194:                                              ; preds = %172
  %195 = load i32, ptr @node, align 4, !tbaa !5
  %196 = sext i32 %195 to i64
  %197 = getelementptr inbounds [3000 x %"class.std::vector"], ptr @graph, i64 0, i64 %196
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #7
  store i32 1, ptr %12, align 4, !tbaa !5
  %198 = call i64 @_ZSt9make_pairIiRiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %12, ptr noundef nonnull align 4 dereferenceable(4) @node2)
  store i64 %198, ptr %11, align 4
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %197, ptr noundef nonnull align 4 dereferenceable(8) %11)
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #7
  br label %227

199:                                              ; preds = %172
  %200 = load i32, ptr %3, align 4, !tbaa !5
  %201 = sext i32 %200 to i64
  %202 = getelementptr inbounds [55 x [55 x i8]], ptr @grid, i64 0, i64 %201
  %203 = load i32, ptr %5, align 4, !tbaa !5
  %204 = sext i32 %203 to i64
  %205 = getelementptr inbounds [55 x i8], ptr %202, i64 0, i64 %204
  %206 = load i8, ptr %205, align 1, !tbaa !11
  %207 = sext i8 %206 to i32
  %208 = sub nsw i32 %207, 48
  %209 = load i32, ptr @a, align 4, !tbaa !5
  %210 = sext i32 %209 to i64
  %211 = getelementptr inbounds [55 x [55 x i8]], ptr @grid, i64 0, i64 %210
  %212 = load i32, ptr @b, align 4, !tbaa !5
  %213 = sext i32 %212 to i64
  %214 = getelementptr inbounds [55 x i8], ptr %211, i64 0, i64 %213
  %215 = load i8, ptr %214, align 1, !tbaa !11
  %216 = sext i8 %215 to i32
  %217 = sub nsw i32 %216, 48
  %218 = sub nsw i32 %208, %217
  %219 = call i32 @llvm.abs.i32(i32 %218, i1 true)
  %220 = icmp eq i32 %219, 1
  br i1 %220, label %221, label %226

221:                                              ; preds = %199
  %222 = load i32, ptr @node, align 4, !tbaa !5
  %223 = sext i32 %222 to i64
  %224 = getelementptr inbounds [3000 x %"class.std::vector"], ptr @graph, i64 0, i64 %223
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #7
  store i32 3, ptr %14, align 4, !tbaa !5
  %225 = call i64 @_ZSt9make_pairIiRiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %14, ptr noundef nonnull align 4 dereferenceable(4) @node2)
  store i64 %225, ptr %13, align 4
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %224, ptr noundef nonnull align 4 dereferenceable(8) %13)
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #7
  br label %226

226:                                              ; preds = %221, %199
  br label %227

227:                                              ; preds = %226, %194
  br label %228

228:                                              ; preds = %227, %167
  br label %229

229:                                              ; preds = %228, %142
  br label %230

230:                                              ; preds = %229, %121
  %231 = load i32, ptr %6, align 4, !tbaa !5
  %232 = add nsw i32 %231, 1
  store i32 %232, ptr %6, align 4, !tbaa !5
  br label %78, !llvm.loop !12

233:                                              ; preds = %81
  %234 = load i32, ptr @node, align 4, !tbaa !5
  %235 = add nsw i32 %234, 1
  store i32 %235, ptr @node, align 4, !tbaa !5
  br label %236

236:                                              ; preds = %233
  %237 = load i32, ptr %5, align 4, !tbaa !5
  %238 = add nsw i32 %237, 1
  store i32 %238, ptr %5, align 4, !tbaa !5
  br label %48, !llvm.loop !13

239:                                              ; preds = %52
  br label %240

240:                                              ; preds = %239
  %241 = load i32, ptr %3, align 4, !tbaa !5
  %242 = add nsw i32 %241, 1
  store i32 %242, ptr %3, align 4, !tbaa !5
  br label %42, !llvm.loop !14

243:                                              ; preds = %46
  %244 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) @delivery) #7
  %245 = trunc i64 %244 to i32
  store i32 %245, ptr @ND, align 4, !tbaa !5
  %246 = load i32, ptr @ND, align 4, !tbaa !5
  %247 = icmp eq i32 %246, 0
  br i1 %247, label %251, label %248

248:                                              ; preds = %243
  %249 = load i32, ptr @start, align 4, !tbaa !5
  %250 = icmp eq i32 %249, -1
  br i1 %250, label %251, label %267

251:                                              ; preds = %248, %243
  call void @_ZNSt6vectorIiSaIiEE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) @delivery) #7
  call void @_ZNSt6vectorIiSaIiEE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) @times) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #7
  store i32 0, ptr %15, align 4, !tbaa !5
  br label %252

252:                                              ; preds = %261, %251
  %253 = load i32, ptr %15, align 4, !tbaa !5
  %254 = load i32, ptr @N, align 4, !tbaa !5
  %255 = icmp slt i32 %253, %254
  br i1 %255, label %257, label %256

256:                                              ; preds = %252
  store i32 16, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #7
  br label %264

257:                                              ; preds = %252
  %258 = load i32, ptr %15, align 4, !tbaa !5
  %259 = sext i32 %258 to i64
  %260 = getelementptr inbounds [3000 x %"class.std::vector"], ptr @graph, i64 0, i64 %259
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) %260) #7
  br label %261

261:                                              ; preds = %257
  %262 = load i32, ptr %15, align 4, !tbaa !5
  %263 = add nsw i32 %262, 1
  store i32 %263, ptr %15, align 4, !tbaa !5
  br label %252, !llvm.loop !15

264:                                              ; preds = %256
  %265 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef 0)
  %266 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %265, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %18, !llvm.loop !16

267:                                              ; preds = %248
  %268 = load i32, ptr @start, align 4, !tbaa !5
  call void @_Z8dijkstrai(i32 noundef %268)
  %269 = load i32, ptr @start, align 4, !tbaa !5
  %270 = call noundef i32 @_Z6resulti(i32 noundef %269)
  %271 = call i32 (ptr, ...) @printf(ptr noundef @.str.5, i32 noundef %270)
  call void @_ZNSt6vectorIiSaIiEE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) @times) #7
  call void @_ZNSt6vectorIiSaIiEE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) @delivery) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #7
  store i32 0, ptr %16, align 4, !tbaa !5
  br label %272

272:                                              ; preds = %281, %267
  %273 = load i32, ptr %16, align 4, !tbaa !5
  %274 = load i32, ptr @N, align 4, !tbaa !5
  %275 = icmp slt i32 %273, %274
  br i1 %275, label %277, label %276

276:                                              ; preds = %272
  store i32 19, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #7
  br label %284

277:                                              ; preds = %272
  %278 = load i32, ptr %16, align 4, !tbaa !5
  %279 = sext i32 %278 to i64
  %280 = getelementptr inbounds [3000 x %"class.std::vector"], ptr @graph, i64 0, i64 %279
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) %280) #7
  br label %281

281:                                              ; preds = %277
  %282 = load i32, ptr %16, align 4, !tbaa !5
  %283 = add nsw i32 %282, 1
  store i32 %283, ptr %16, align 4, !tbaa !5
  br label %272, !llvm.loop !17

284:                                              ; preds = %276
  br label %18, !llvm.loop !16

285:                                              ; preds = %18
  ret i32 0
}

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

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

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.abs.i32(i32, i1 immarg) #5

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

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

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

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

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

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

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

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

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


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

%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.0" = type { %"struct.std::_Vector_base.1" }
%"struct.std::_Vector_base.1" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"struct.std::pair" = type { i32, i32 }

@x = external dso_local local_unnamed_addr global [4 x i32], align 16
@y = external dso_local local_unnamed_addr global [4 x i32], align 16
@c = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@n = external dso_local global i32, align 4
@start = external dso_local local_unnamed_addr global i32, align 4
@ND = external dso_local local_unnamed_addr global i32, align 4
@node = external dso_local global i32, align 4
@node2 = external dso_local global i32, align 4
@a = external dso_local local_unnamed_addr global i32, align 4
@b = external dso_local local_unnamed_addr global i32, align 4
@N = external dso_local local_unnamed_addr global i32, align 4
@graph = external dso_local global [3000 x %"class.std::vector"], align 16
@times = external dso_local global %"class.std::vector.0", align 8
@delivery = external dso_local global %"class.std::vector.0", align 8
@grid = external dso_local global [55 x [55 x i8]], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [6 x i8], align 1
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str.5 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z8dijkstrai(i32 noundef) 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 i64 @_ZSt9make_pairIiRiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #0

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

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

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #2 {
  %1 = alloca %"struct.std::pair", align 8
  %2 = alloca i32, align 4
  %3 = alloca %"struct.std::pair", align 8
  %4 = alloca i32, align 4
  %5 = alloca %"struct.std::pair", align 8
  %6 = alloca i32, align 4
  %7 = alloca %"struct.std::pair", align 8
  %8 = alloca i32, align 4
  %9 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @c)
  %10 = load i32, ptr @c, align 4, !tbaa !5
  %11 = add nsw i32 %10, -1
  store i32 %11, ptr @c, align 4, !tbaa !5
  %.not69 = icmp eq i32 %10, 0
  br i1 %.not69, label %._crit_edge72, label %.lr.ph71

.lr.ph71:                                         ; preds = %0, %.backedge
  %12 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.4, ptr noundef nonnull @m, ptr noundef nonnull @n)
  %13 = load i32, ptr @m, align 4, !tbaa !5
  %14 = icmp sgt i32 %13, 0
  br i1 %14, label %.lr.ph, label %._crit_edge.thread

._crit_edge.thread:                               ; preds = %.lr.ph71
  store i32 0, ptr @node, align 4, !tbaa !5
  store i32 -1, ptr @start, align 4, !tbaa !5
  %15 = load i32, ptr @n, align 4, !tbaa !5
  %16 = mul nsw i32 %15, %13
  store i32 %16, ptr @N, align 4, !tbaa !5
  br label %._crit_edge61

._crit_edge:                                      ; preds = %.lr.ph
  store i32 0, ptr @node, align 4, !tbaa !5
  store i32 -1, ptr @start, align 4, !tbaa !5
  %17 = load i32, ptr @n, align 4, !tbaa !5
  %18 = mul nsw i32 %17, %23
  store i32 %18, ptr @N, align 4, !tbaa !5
  %19 = icmp sgt i32 %23, 0
  %20 = icmp sgt i32 %17, 0
  %or.cond = select i1 %19, i1 %20, i1 false
  br i1 %or.cond, label %.preheader, label %._crit_edge61

.lr.ph:                                           ; preds = %.lr.ph71, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %.lr.ph71 ]
  %21 = getelementptr inbounds [55 x [55 x i8]], ptr @grid, i64 0, i64 %indvars.iv
  %22 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcEERSt13basic_istreamIT_T0_ES6_PS3_(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef %21)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %23 = load i32, ptr @m, align 4, !tbaa !5
  %24 = sext i32 %23 to i64
  %25 = icmp slt i64 %indvars.iv.next, %24
  br i1 %25, label %.lr.ph, label %._crit_edge, !llvm.loop !9

.preheader:                                       ; preds = %._crit_edge, %._crit_edge59
  %26 = phi i32 [ %36, %._crit_edge59 ], [ %23, %._crit_edge ]
  %27 = phi i32 [ %37, %._crit_edge59 ], [ 0, %._crit_edge ]
  %28 = phi i32 [ %38, %._crit_edge59 ], [ %17, %._crit_edge ]
  %indvars.iv82 = phi i64 [ %indvars.iv.next83, %._crit_edge59 ], [ 0, %._crit_edge ]
  %29 = icmp sgt i32 %28, 0
  br i1 %29, label %.lr.ph58, label %._crit_edge59

.lr.ph58:                                         ; preds = %.preheader
  %30 = trunc nuw nsw i64 %indvars.iv82 to i32
  br label %41

._crit_edge61:                                    ; preds = %._crit_edge59, %._crit_edge.thread, %._crit_edge
  %31 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) @delivery) #8
  %32 = trunc i64 %31 to i32
  store i32 %32, ptr @ND, align 4, !tbaa !5
  %33 = icmp eq i32 %32, 0
  %34 = load i32, ptr @start, align 4
  %35 = icmp eq i32 %34, -1
  %or.cond3 = select i1 %33, i1 true, i1 %35
  br i1 %or.cond3, label %102, label %113

._crit_edge59.loopexit:                           ; preds = %49
  %.pre = load i32, ptr @m, align 4, !tbaa !5
  br label %._crit_edge59

._crit_edge59:                                    ; preds = %._crit_edge59.loopexit, %.preheader
  %36 = phi i32 [ %.pre, %._crit_edge59.loopexit ], [ %26, %.preheader ]
  %37 = phi i32 [ %51, %._crit_edge59.loopexit ], [ %27, %.preheader ]
  %38 = phi i32 [ %52, %._crit_edge59.loopexit ], [ %28, %.preheader ]
  %indvars.iv.next83 = add nuw nsw i64 %indvars.iv82, 1
  %39 = sext i32 %36 to i64
  %40 = icmp slt i64 %indvars.iv.next83, %39
  br i1 %40, label %.preheader, label %._crit_edge61, !llvm.loop !11

41:                                               ; preds = %.lr.ph58, %49
  %42 = phi i32 [ %27, %.lr.ph58 ], [ %51, %49 ]
  %indvars.iv79 = phi i64 [ 0, %.lr.ph58 ], [ %indvars.iv.next80, %49 ]
  %43 = getelementptr inbounds [55 x [55 x i8]], ptr @grid, i64 0, i64 %indvars.iv82, i64 %indvars.iv79
  %44 = load i8, ptr %43, align 1, !tbaa !13
  switch i8 %44, label %47 [
    i8 36, label %45
    i8 88, label %46
  ]

45:                                               ; preds = %41
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) @delivery, ptr noundef nonnull align 4 dereferenceable(4) @node)
  br label %47

46:                                               ; preds = %41
  store i32 %42, ptr @start, align 4, !tbaa !5
  br label %47

47:                                               ; preds = %41, %46, %45
  %48 = trunc nuw nsw i64 %indvars.iv79 to i32
  br label %55

49:                                               ; preds = %101
  %50 = load i32, ptr @node, align 4, !tbaa !5
  %51 = add nsw i32 %50, 1
  store i32 %51, ptr @node, align 4, !tbaa !5
  %indvars.iv.next80 = add nuw nsw i64 %indvars.iv79, 1
  %52 = load i32, ptr @n, align 4, !tbaa !5
  %53 = sext i32 %52 to i64
  %54 = icmp slt i64 %indvars.iv.next80, %53
  br i1 %54, label %41, label %._crit_edge59.loopexit, !llvm.loop !14

55:                                               ; preds = %47, %101
  %indvars.iv76 = phi i64 [ 0, %47 ], [ %indvars.iv.next77, %101 ]
  %56 = getelementptr inbounds [4 x i32], ptr @x, i64 0, i64 %indvars.iv76
  %57 = load i32, ptr %56, align 4, !tbaa !5
  %58 = add nsw i32 %57, %30
  store i32 %58, ptr @a, align 4, !tbaa !5
  %59 = getelementptr inbounds [4 x i32], ptr @y, i64 0, i64 %indvars.iv76
  %60 = load i32, ptr %59, align 4, !tbaa !5
  %61 = add nsw i32 %60, %48
  store i32 %61, ptr @b, align 4, !tbaa !5
  %62 = load i32, ptr @node, align 4, !tbaa !5
  %63 = add nsw i32 %62, %60
  %64 = load i32, ptr @n, align 4
  %65 = mul nsw i32 %64, %57
  %66 = add nsw i32 %63, %65
  store i32 %66, ptr @node2, align 4, !tbaa !5
  %67 = icmp sgt i32 %58, -1
  %68 = icmp sgt i32 %61, -1
  %or.cond.not54 = select i1 %67, i1 %68, i1 false
  %69 = load i32, ptr @m, align 4
  %.not48 = icmp slt i32 %58, %69
  %or.cond50 = select i1 %or.cond.not54, i1 %.not48, i1 false
  %.not49 = icmp slt i32 %61, %64
  %or.cond51 = select i1 %or.cond50, i1 %.not49, i1 false
  br i1 %or.cond51, label %70, label %101

70:                                               ; preds = %55
  %71 = load i8, ptr %43, align 1, !tbaa !13
  %72 = sext i8 %71 to i32
  switch i8 %71, label %77 [
    i8 36, label %73
    i8 88, label %73
  ]

73:                                               ; preds = %70, %70
  %74 = sext i32 %62 to i64
  %75 = getelementptr inbounds [3000 x %"class.std::vector"], ptr @graph, i64 0, i64 %74
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #8
  store i32 2, ptr %2, align 4, !tbaa !5
  %76 = call i64 @_ZSt9make_pairIiRiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %2, ptr noundef nonnull align 4 dereferenceable(4) @node2)
  store i64 %76, ptr %1, align 8
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %75, ptr noundef nonnull align 4 dereferenceable(8) %1)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #8
  br label %101

77:                                               ; preds = %70
  %78 = zext nneg i32 %58 to i64
  %79 = zext nneg i32 %61 to i64
  %80 = getelementptr inbounds [55 x [55 x i8]], ptr @grid, i64 0, i64 %78, i64 %79
  %81 = load i8, ptr %80, align 1, !tbaa !13
  %82 = sext i8 %81 to i32
  switch i8 %81, label %87 [
    i8 36, label %83
    i8 88, label %83
  ]

83:                                               ; preds = %77, %77
  %84 = sext i32 %62 to i64
  %85 = getelementptr inbounds [3000 x %"class.std::vector"], ptr @graph, i64 0, i64 %84
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #8
  store i32 2, ptr %4, align 4, !tbaa !5
  %86 = call i64 @_ZSt9make_pairIiRiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %4, ptr noundef nonnull align 4 dereferenceable(4) @node2)
  store i64 %86, ptr %3, align 8
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %85, ptr noundef nonnull align 4 dereferenceable(8) %3)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #8
  br label %101

87:                                               ; preds = %77
  %88 = icmp eq i8 %71, %81
  br i1 %88, label %89, label %93

89:                                               ; preds = %87
  %90 = sext i32 %62 to i64
  %91 = getelementptr inbounds [3000 x %"class.std::vector"], ptr @graph, i64 0, i64 %90
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #8
  store i32 1, ptr %6, align 4, !tbaa !5
  %92 = call i64 @_ZSt9make_pairIiRiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %6, ptr noundef nonnull align 4 dereferenceable(4) @node2)
  store i64 %92, ptr %5, align 8
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %91, ptr noundef nonnull align 4 dereferenceable(8) %5)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #8
  br label %101

93:                                               ; preds = %87
  %94 = sub nsw i32 %72, %82
  %95 = call i32 @llvm.abs.i32(i32 %94, i1 true)
  %96 = icmp eq i32 %95, 1
  br i1 %96, label %97, label %101

97:                                               ; preds = %93
  %98 = sext i32 %62 to i64
  %99 = getelementptr inbounds [3000 x %"class.std::vector"], ptr @graph, i64 0, i64 %98
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #8
  store i32 3, ptr %8, align 4, !tbaa !5
  %100 = call i64 @_ZSt9make_pairIiRiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %8, ptr noundef nonnull align 4 dereferenceable(4) @node2)
  store i64 %100, ptr %7, align 8
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %99, ptr noundef nonnull align 4 dereferenceable(8) %7)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #8
  br label %101

101:                                              ; preds = %73, %89, %97, %93, %83, %55
  %indvars.iv.next77 = add nuw nsw i64 %indvars.iv76, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next77, 4
  br i1 %exitcond.not, label %49, label %55, !llvm.loop !15

102:                                              ; preds = %._crit_edge61
  call void @_ZNSt6vectorIiSaIiEE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) @delivery) #8
  call void @_ZNSt6vectorIiSaIiEE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) @times) #8
  %103 = load i32, ptr @N, align 4, !tbaa !5
  %104 = icmp sgt i32 %103, 0
  br i1 %104, label %.lr.ph67, label %._crit_edge68

._crit_edge68:                                    ; preds = %.lr.ph67, %102
  %105 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef 0)
  %106 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %105, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %.backedge

.backedge:                                        ; preds = %.lr.ph64, %113, %._crit_edge68
  %107 = load i32, ptr @c, align 4, !tbaa !5
  %108 = add nsw i32 %107, -1
  store i32 %108, ptr @c, align 4, !tbaa !5
  %.not = icmp eq i32 %107, 0
  br i1 %.not, label %._crit_edge72, label %.lr.ph71, !llvm.loop !16

.lr.ph67:                                         ; preds = %102, %.lr.ph67
  %indvars.iv88 = phi i64 [ %indvars.iv.next89, %.lr.ph67 ], [ 0, %102 ]
  %109 = getelementptr inbounds [3000 x %"class.std::vector"], ptr @graph, i64 0, i64 %indvars.iv88
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) %109) #8
  %indvars.iv.next89 = add nuw nsw i64 %indvars.iv88, 1
  %110 = load i32, ptr @N, align 4, !tbaa !5
  %111 = sext i32 %110 to i64
  %112 = icmp slt i64 %indvars.iv.next89, %111
  br i1 %112, label %.lr.ph67, label %._crit_edge68, !llvm.loop !17

113:                                              ; preds = %._crit_edge61
  call void @_Z8dijkstrai(i32 noundef %34)
  %114 = load i32, ptr @start, align 4, !tbaa !5
  %115 = call noundef i32 @_Z6resulti(i32 noundef %114)
  %116 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef %115)
  call void @_ZNSt6vectorIiSaIiEE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) @times) #8
  call void @_ZNSt6vectorIiSaIiEE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) @delivery) #8
  %117 = load i32, ptr @N, align 4, !tbaa !5
  %118 = icmp sgt i32 %117, 0
  br i1 %118, label %.lr.ph64, label %.backedge, !llvm.loop !16

.lr.ph64:                                         ; preds = %113, %.lr.ph64
  %indvars.iv85 = phi i64 [ %indvars.iv.next86, %.lr.ph64 ], [ 0, %113 ]
  %119 = getelementptr inbounds [3000 x %"class.std::vector"], ptr @graph, i64 0, i64 %indvars.iv85
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) %119) #8
  %indvars.iv.next86 = add nuw nsw i64 %indvars.iv85, 1
  %120 = load i32, ptr @N, align 4, !tbaa !5
  %121 = sext i32 %120 to i64
  %122 = icmp slt i64 %indvars.iv.next86, %121
  br i1 %122, label %.lr.ph64, label %.backedge, !llvm.loop !18

._crit_edge72:                                    ; preds = %.backedge, %0
  ret i32 0
}

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

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

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

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.abs.i32(i32, i1 immarg) #5

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

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

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

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

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

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

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


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