; LLVM IR from bqi343/cp-notebook :: Contests/USACO Solutions/2012-13/Jan 2013/13 Jan G2.ll (Z7getdisti)

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

%"class.std::priority_queue" = type <{ %"class.std::vector", [8 x i8] }>
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<std::pair<int, 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 }
%"struct.std::pair" = type { i32, %"struct.std::pair.0" }
%"struct.std::pair.0" = type { i32, i32 }

@R = external dso_local global i32, align 4
@C = external dso_local global i32, align 4
@xdir = external dso_local global [4 x i32], align 16
@ydir = external dso_local global [4 x i32], align 16
@dist = external dso_local global [15 x [15 x i32]], align 16
@cur = external dso_local global [50 x [50 x i32]], align 16
@grid = external dso_local global [50 x [50 x i8]], align 16

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_Z7getdisti(i32 noundef %0) #1 personality ptr @__gxx_personality_v0 {
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca %"class.std::priority_queue", align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca %"struct.std::pair", align 4
  %10 = alloca i32, align 4
  %11 = alloca %"struct.std::pair.0", align 4
  %12 = alloca ptr, align 8
  %13 = alloca i32, align 4
  %14 = alloca %"struct.std::pair", 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", align 4
  %20 = alloca i32, align 4
  %21 = alloca %"struct.std::pair.0", align 4
  %22 = alloca i32, align 4
  %23 = alloca i32, align 4
  store i32 %0, ptr %2, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #5
  store i32 0, ptr %3, align 4, !tbaa !5
  br label %24

24:                                               ; preds = %46, %1
  %25 = load i32, ptr %3, align 4, !tbaa !5
  %26 = load i32, ptr @R, align 4, !tbaa !5
  %27 = icmp slt i32 %25, %26
  br i1 %27, label %29, label %28

28:                                               ; preds = %24
  store i32 2, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #5
  br label %49

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

30:                                               ; preds = %42, %29
  %31 = load i32, ptr %5, align 4, !tbaa !5
  %32 = load i32, ptr @C, align 4, !tbaa !5
  %33 = icmp slt i32 %31, %32
  br i1 %33, label %35, label %34

34:                                               ; preds = %30
  store i32 5, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  br label %45

35:                                               ; preds = %30
  %36 = load i32, ptr %3, align 4, !tbaa !5
  %37 = sext i32 %36 to i64
  %38 = getelementptr inbounds [50 x [50 x i32]], ptr @cur, i64 0, i64 %37
  %39 = load i32, ptr %5, align 4, !tbaa !5
  %40 = sext i32 %39 to i64
  %41 = getelementptr inbounds [50 x i32], ptr %38, i64 0, i64 %40
  store i32 1000000007, ptr %41, align 4, !tbaa !5
  br label %42

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

45:                                               ; preds = %34
  br label %46

46:                                               ; preds = %45
  %47 = load i32, ptr %3, align 4, !tbaa !5
  %48 = add nsw i32 %47, 1
  store i32 %48, ptr %3, align 4, !tbaa !5
  br label %24, !llvm.loop !11

49:                                               ; preds = %28
  call void @llvm.lifetime.start.p0(i64 32, ptr %6) #5
  call void @_ZNSt14priority_queueISt4pairIiS0_IiiEESt6vectorIS2_SaIS2_EESt4lessIS2_EEC2IS5_vEEv(ptr noundef nonnull align 8 dereferenceable(25) %6)
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  store i32 0, ptr %7, align 4, !tbaa !5
  br label %50

50:                                               ; preds = %92, %49
  %51 = load i32, ptr %7, align 4, !tbaa !5
  %52 = load i32, ptr @R, align 4, !tbaa !5
  %53 = icmp slt i32 %51, %52
  br i1 %53, label %55, label %54

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

55:                                               ; preds = %50
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  store i32 0, ptr %8, align 4, !tbaa !5
  br label %56

56:                                               ; preds = %88, %55
  %57 = load i32, ptr %8, align 4, !tbaa !5
  %58 = load i32, ptr @C, align 4, !tbaa !5
  %59 = icmp slt i32 %57, %58
  br i1 %59, label %61, label %60

60:                                               ; preds = %56
  store i32 11, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  br label %91

61:                                               ; preds = %56
  %62 = load i32, ptr %7, align 4, !tbaa !5
  %63 = sext i32 %62 to i64
  %64 = getelementptr inbounds [50 x [50 x i8]], ptr @grid, i64 0, i64 %63
  %65 = load i32, ptr %8, align 4, !tbaa !5
  %66 = sext i32 %65 to i64
  %67 = getelementptr inbounds [50 x i8], ptr %64, i64 0, i64 %66
  %68 = load i8, ptr %67, align 1, !tbaa !12
  %69 = sext i8 %68 to i32
  %70 = load i32, ptr %2, align 4, !tbaa !5
  %71 = add nsw i32 97, %70
  %72 = icmp eq i32 %69, %71
  br i1 %72, label %73, label %87

73:                                               ; preds = %61
  %74 = load i32, ptr %7, align 4, !tbaa !5
  %75 = sext i32 %74 to i64
  %76 = getelementptr inbounds [50 x [50 x i32]], ptr @cur, i64 0, i64 %75
  %77 = load i32, ptr %8, align 4, !tbaa !5
  %78 = sext i32 %77 to i64
  %79 = getelementptr inbounds [50 x i32], ptr %76, i64 0, i64 %78
  store i32 0, ptr %79, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 12, ptr %9) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  store i32 0, ptr %10, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  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) %8)
          to label %80 unwind label %83

80:                                               ; preds = %73
  invoke void @_ZNSt4pairIiS_IiiEEC2IiS0_TnNSt9enable_ifIXaaclsr5_PCCPE18_ConstructiblePairIT_T0_EEclsr5_PCCPE26_ImplicitlyConvertiblePairIS4_S5_EEEbE4typeELb1EEERKiRKS0_(ptr noundef nonnull align 4 dereferenceable(12) %9, ptr noundef nonnull align 4 dereferenceable(4) %10, ptr noundef nonnull align 4 dereferenceable(8) %11)
          to label %81 unwind label %83

81:                                               ; preds = %80
  invoke void @_ZNSt14priority_queueISt4pairIiS0_IiiEESt6vectorIS2_SaIS2_EESt4lessIS2_EE4pushEOS2_(ptr noundef nonnull align 8 dereferenceable(25) %6, ptr noundef nonnull align 4 dereferenceable(12) %9)
          to label %82 unwind label %83

82:                                               ; preds = %81
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 12, ptr %9) #5
  br label %87

83:                                               ; preds = %81, %80, %73
  %84 = landingpad { ptr, i32 }
          cleanup
  %85 = extractvalue { ptr, i32 } %84, 0
  store ptr %85, ptr %12, align 8
  %86 = extractvalue { ptr, i32 } %84, 1
  store i32 %86, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 12, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  br label %294

87:                                               ; preds = %82, %61
  br label %88

88:                                               ; preds = %87
  %89 = load i32, ptr %8, align 4, !tbaa !5
  %90 = add nsw i32 %89, 1
  store i32 %90, ptr %8, align 4, !tbaa !5
  br label %56, !llvm.loop !13

91:                                               ; preds = %60
  br label %92

92:                                               ; preds = %91
  %93 = load i32, ptr %7, align 4, !tbaa !5
  %94 = add nsw i32 %93, 1
  store i32 %94, ptr %7, align 4, !tbaa !5
  br label %50, !llvm.loop !14

95:                                               ; preds = %54
  br label %96

96:                                               ; preds = %229, %227, %95
  %97 = invoke noundef i64 @_ZNKSt14priority_queueISt4pairIiS0_IiiEESt6vectorIS2_SaIS2_EESt4lessIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(25) %6)
          to label %98 unwind label %120

98:                                               ; preds = %96
  %99 = icmp ne i64 %97, 0
  br i1 %99, label %100, label %231

100:                                              ; preds = %98
  call void @llvm.lifetime.start.p0(i64 12, ptr %14) #5
  %101 = invoke noundef nonnull align 4 dereferenceable(12) ptr @_ZNKSt14priority_queueISt4pairIiS0_IiiEESt6vectorIS2_SaIS2_EESt4lessIS2_EE3topEv(ptr noundef nonnull align 8 dereferenceable(25) %6)
          to label %102 unwind label %124

102:                                              ; preds = %100
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %14, ptr align 4 %101, i64 12, i1 false)
  invoke void @_ZNSt14priority_queueISt4pairIiS0_IiiEESt6vectorIS2_SaIS2_EESt4lessIS2_EE3popEv(ptr noundef nonnull align 8 dereferenceable(25) %6)
          to label %103 unwind label %124

103:                                              ; preds = %102
  %104 = getelementptr inbounds %"struct.std::pair", ptr %14, i32 0, i32 0
  %105 = load i32, ptr %104, align 4, !tbaa !15
  %106 = sub nsw i32 0, %105
  %107 = getelementptr inbounds %"struct.std::pair", ptr %14, i32 0, i32 1
  %108 = getelementptr inbounds %"struct.std::pair.0", ptr %107, i32 0, i32 0
  %109 = load i32, ptr %108, align 4, !tbaa !18
  %110 = sext i32 %109 to i64
  %111 = getelementptr inbounds [50 x [50 x i32]], ptr @cur, i64 0, i64 %110
  %112 = getelementptr inbounds %"struct.std::pair", ptr %14, i32 0, i32 1
  %113 = getelementptr inbounds %"struct.std::pair.0", ptr %112, i32 0, i32 1
  %114 = load i32, ptr %113, align 4, !tbaa !19
  %115 = sext i32 %114 to i64
  %116 = getelementptr inbounds [50 x i32], ptr %111, i64 0, i64 %115
  %117 = load i32, ptr %116, align 4, !tbaa !5
  %118 = icmp sgt i32 %106, %117
  br i1 %118, label %119, label %128

119:                                              ; preds = %103
  store i32 14, ptr %4, align 4
  br label %227, !llvm.loop !20

120:                                              ; preds = %96
  %121 = landingpad { ptr, i32 }
          cleanup
  %122 = extractvalue { ptr, i32 } %121, 0
  store ptr %122, ptr %12, align 8
  %123 = extractvalue { ptr, i32 } %121, 1
  store i32 %123, ptr %13, align 4
  br label %294

124:                                              ; preds = %102, %100
  %125 = landingpad { ptr, i32 }
          cleanup
  %126 = extractvalue { ptr, i32 } %125, 0
  store ptr %126, ptr %12, align 8
  %127 = extractvalue { ptr, i32 } %125, 1
  store i32 %127, ptr %13, align 4
  br label %230

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

129:                                              ; preds = %219, %128
  %130 = load i32, ptr %15, align 4, !tbaa !5
  %131 = icmp slt i32 %130, 4
  br i1 %131, label %133, label %132

132:                                              ; preds = %129
  store i32 16, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #5
  br label %226

133:                                              ; preds = %129
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #5
  %134 = getelementptr inbounds %"struct.std::pair", ptr %14, i32 0, i32 1
  %135 = getelementptr inbounds %"struct.std::pair.0", ptr %134, i32 0, i32 0
  %136 = load i32, ptr %135, align 4, !tbaa !18
  %137 = load i32, ptr %15, align 4, !tbaa !5
  %138 = sext i32 %137 to i64
  %139 = getelementptr inbounds [4 x i32], ptr @xdir, i64 0, i64 %138
  %140 = load i32, ptr %139, align 4, !tbaa !5
  %141 = add nsw i32 %136, %140
  store i32 %141, ptr %16, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #5
  %142 = getelementptr inbounds %"struct.std::pair", ptr %14, i32 0, i32 1
  %143 = getelementptr inbounds %"struct.std::pair.0", ptr %142, i32 0, i32 1
  %144 = load i32, ptr %143, align 4, !tbaa !19
  %145 = load i32, ptr %15, align 4, !tbaa !5
  %146 = sext i32 %145 to i64
  %147 = getelementptr inbounds [4 x i32], ptr @ydir, i64 0, i64 %146
  %148 = load i32, ptr %147, align 4, !tbaa !5
  %149 = add nsw i32 %144, %148
  store i32 %149, ptr %17, align 4, !tbaa !5
  %150 = load i32, ptr %16, align 4, !tbaa !5
  %151 = icmp slt i32 %150, 0
  br i1 %151, label %163, label %152

152:                                              ; preds = %133
  %153 = load i32, ptr %16, align 4, !tbaa !5
  %154 = load i32, ptr @R, align 4, !tbaa !5
  %155 = icmp sge i32 %153, %154
  br i1 %155, label %163, label %156

156:                                              ; preds = %152
  %157 = load i32, ptr %17, align 4, !tbaa !5
  %158 = icmp slt i32 %157, 0
  br i1 %158, label %163, label %159

159:                                              ; preds = %156
  %160 = load i32, ptr %17, align 4, !tbaa !5
  %161 = load i32, ptr @C, align 4, !tbaa !5
  %162 = icmp sge i32 %160, %161
  br i1 %162, label %163, label %164

163:                                              ; preds = %159, %156, %152, %133
  store i32 18, ptr %4, align 4
  br label %216

164:                                              ; preds = %159
  %165 = load i32, ptr %16, align 4, !tbaa !5
  %166 = sext i32 %165 to i64
  %167 = getelementptr inbounds [50 x [50 x i8]], ptr @grid, i64 0, i64 %166
  %168 = load i32, ptr %17, align 4, !tbaa !5
  %169 = sext i32 %168 to i64
  %170 = getelementptr inbounds [50 x i8], ptr %167, i64 0, i64 %169
  %171 = load i8, ptr %170, align 1, !tbaa !12
  %172 = sext i8 %171 to i32
  %173 = icmp eq i32 %172, 46
  br i1 %173, label %174, label %175

174:                                              ; preds = %164
  store i32 18, ptr %4, align 4
  br label %216

175:                                              ; preds = %164
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #5
  %176 = getelementptr inbounds %"struct.std::pair", ptr %14, i32 0, i32 0
  %177 = load i32, ptr %176, align 4, !tbaa !15
  %178 = sub nsw i32 0, %177
  store i32 %178, ptr %18, align 4, !tbaa !5
  %179 = load i32, ptr %16, align 4, !tbaa !5
  %180 = sext i32 %179 to i64
  %181 = getelementptr inbounds [50 x [50 x i8]], ptr @grid, i64 0, i64 %180
  %182 = load i32, ptr %17, align 4, !tbaa !5
  %183 = sext i32 %182 to i64
  %184 = getelementptr inbounds [50 x i8], ptr %181, i64 0, i64 %183
  %185 = load i8, ptr %184, align 1, !tbaa !12
  %186 = sext i8 %185 to i32
  %187 = icmp eq i32 %186, 83
  br i1 %187, label %188, label %191

188:                                              ; preds = %175
  %189 = load i32, ptr %18, align 4, !tbaa !5
  %190 = add nsw i32 %189, 1
  store i32 %190, ptr %18, align 4, !tbaa !5
  br label %191

191:                                              ; preds = %188, %175
  %192 = load i32, ptr %18, align 4, !tbaa !5
  %193 = load i32, ptr %16, align 4, !tbaa !5
  %194 = sext i32 %193 to i64
  %195 = getelementptr inbounds [50 x [50 x i32]], ptr @cur, i64 0, i64 %194
  %196 = load i32, ptr %17, align 4, !tbaa !5
  %197 = sext i32 %196 to i64
  %198 = getelementptr inbounds [50 x i32], ptr %195, i64 0, i64 %197
  %199 = load i32, ptr %198, align 4, !tbaa !5
  %200 = icmp sge i32 %192, %199
  br i1 %200, label %201, label %202

201:                                              ; preds = %191
  store i32 18, ptr %4, align 4
  br label %215

202:                                              ; preds = %191
  %203 = load i32, ptr %18, align 4, !tbaa !5
  %204 = load i32, ptr %16, align 4, !tbaa !5
  %205 = sext i32 %204 to i64
  %206 = getelementptr inbounds [50 x [50 x i32]], ptr @cur, i64 0, i64 %205
  %207 = load i32, ptr %17, align 4, !tbaa !5
  %208 = sext i32 %207 to i64
  %209 = getelementptr inbounds [50 x i32], ptr %206, i64 0, i64 %208
  store i32 %203, ptr %209, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 12, ptr %19) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #5
  %210 = load i32, ptr %18, align 4, !tbaa !5
  %211 = sub nsw i32 0, %210
  store i32 %211, ptr %20, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #5
  invoke void @_ZNSt4pairIiiEC2IRiS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %21, ptr noundef nonnull align 4 dereferenceable(4) %16, ptr noundef nonnull align 4 dereferenceable(4) %17)
          to label %212 unwind label %222

212:                                              ; preds = %202
  invoke void @_ZNSt4pairIiS_IiiEEC2IiS0_TnNSt9enable_ifIXaaclsr5_PCCPE18_ConstructiblePairIT_T0_EEclsr5_PCCPE26_ImplicitlyConvertiblePairIS4_S5_EEEbE4typeELb1EEERKiRKS0_(ptr noundef nonnull align 4 dereferenceable(12) %19, ptr noundef nonnull align 4 dereferenceable(4) %20, ptr noundef nonnull align 4 dereferenceable(8) %21)
          to label %213 unwind label %222

213:                                              ; preds = %212
  invoke void @_ZNSt14priority_queueISt4pairIiS0_IiiEESt6vectorIS2_SaIS2_EESt4lessIS2_EE4pushEOS2_(ptr noundef nonnull align 8 dereferenceable(25) %6, ptr noundef nonnull align 4 dereferenceable(12) %19)
          to label %214 unwind label %222

214:                                              ; preds = %213
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #5
  call void @llvm.lifetime.end.p0(i64 12, ptr %19) #5
  store i32 0, ptr %4, align 4
  br label %215

215:                                              ; preds = %214, %201
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #5
  br label %216

216:                                              ; preds = %215, %174, %163
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #5
  %217 = load i32, ptr %4, align 4
  switch i32 %217, label %300 [
    i32 0, label %218
    i32 18, label %219
  ]

218:                                              ; preds = %216
  br label %219

219:                                              ; preds = %218, %216
  %220 = load i32, ptr %15, align 4, !tbaa !5
  %221 = add nsw i32 %220, 1
  store i32 %221, ptr %15, align 4, !tbaa !5
  br label %129, !llvm.loop !21

222:                                              ; preds = %213, %212, %202
  %223 = landingpad { ptr, i32 }
          cleanup
  %224 = extractvalue { ptr, i32 } %223, 0
  store ptr %224, ptr %12, align 8
  %225 = extractvalue { ptr, i32 } %223, 1
  store i32 %225, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #5
  call void @llvm.lifetime.end.p0(i64 12, ptr %19) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #5
  br label %230

226:                                              ; preds = %132
  store i32 0, ptr %4, align 4
  br label %227

227:                                              ; preds = %226, %119
  call void @llvm.lifetime.end.p0(i64 12, ptr %14) #5
  %228 = load i32, ptr %4, align 4
  switch i32 %228, label %300 [
    i32 0, label %229
    i32 14, label %96
  ]

229:                                              ; preds = %227
  br label %96, !llvm.loop !20

230:                                              ; preds = %222, %124
  call void @llvm.lifetime.end.p0(i64 12, ptr %14) #5
  br label %294

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

232:                                              ; preds = %290, %231
  %233 = load i32, ptr %22, align 4, !tbaa !5
  %234 = load i32, ptr @R, align 4, !tbaa !5
  %235 = icmp slt i32 %233, %234
  br i1 %235, label %237, label %236

236:                                              ; preds = %232
  store i32 19, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #5
  br label %293

237:                                              ; preds = %232
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #5
  store i32 0, ptr %23, align 4, !tbaa !5
  br label %238

238:                                              ; preds = %286, %237
  %239 = load i32, ptr %23, align 4, !tbaa !5
  %240 = load i32, ptr @C, align 4, !tbaa !5
  %241 = icmp slt i32 %239, %240
  br i1 %241, label %243, label %242

242:                                              ; preds = %238
  store i32 22, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #5
  br label %289

243:                                              ; preds = %238
  %244 = load i32, ptr %22, align 4, !tbaa !5
  %245 = sext i32 %244 to i64
  %246 = getelementptr inbounds [50 x [50 x i8]], ptr @grid, i64 0, i64 %245
  %247 = load i32, ptr %23, align 4, !tbaa !5
  %248 = sext i32 %247 to i64
  %249 = getelementptr inbounds [50 x i8], ptr %246, i64 0, i64 %248
  %250 = load i8, ptr %249, align 1, !tbaa !12
  %251 = sext i8 %250 to i32
  %252 = icmp sle i32 97, %251
  br i1 %252, label %253, label %285

253:                                              ; preds = %243
  %254 = load i32, ptr %22, align 4, !tbaa !5
  %255 = sext i32 %254 to i64
  %256 = getelementptr inbounds [50 x [50 x i8]], ptr @grid, i64 0, i64 %255
  %257 = load i32, ptr %23, align 4, !tbaa !5
  %258 = sext i32 %257 to i64
  %259 = getelementptr inbounds [50 x i8], ptr %256, i64 0, i64 %258
  %260 = load i8, ptr %259, align 1, !tbaa !12
  %261 = sext i8 %260 to i32
  %262 = icmp sle i32 %261, 122
  br i1 %262, label %263, label %285

263:                                              ; preds = %253
  %264 = load i32, ptr %22, align 4, !tbaa !5
  %265 = sext i32 %264 to i64
  %266 = getelementptr inbounds [50 x [50 x i32]], ptr @cur, i64 0, i64 %265
  %267 = load i32, ptr %23, align 4, !tbaa !5
  %268 = sext i32 %267 to i64
  %269 = getelementptr inbounds [50 x i32], ptr %266, i64 0, i64 %268
  %270 = load i32, ptr %269, align 4, !tbaa !5
  %271 = load i32, ptr %2, align 4, !tbaa !5
  %272 = sext i32 %271 to i64
  %273 = getelementptr inbounds [15 x [15 x i32]], ptr @dist, i64 0, i64 %272
  %274 = load i32, ptr %22, align 4, !tbaa !5
  %275 = sext i32 %274 to i64
  %276 = getelementptr inbounds [50 x [50 x i8]], ptr @grid, i64 0, i64 %275
  %277 = load i32, ptr %23, align 4, !tbaa !5
  %278 = sext i32 %277 to i64
  %279 = getelementptr inbounds [50 x i8], ptr %276, i64 0, i64 %278
  %280 = load i8, ptr %279, align 1, !tbaa !12
  %281 = sext i8 %280 to i32
  %282 = sub nsw i32 %281, 97
  %283 = sext i32 %282 to i64
  %284 = getelementptr inbounds [15 x i32], ptr %273, i64 0, i64 %283
  store i32 %270, ptr %284, align 4, !tbaa !5
  br label %285

285:                                              ; preds = %263, %253, %243
  br label %286

286:                                              ; preds = %285
  %287 = load i32, ptr %23, align 4, !tbaa !5
  %288 = add nsw i32 %287, 1
  store i32 %288, ptr %23, align 4, !tbaa !5
  br label %238, !llvm.loop !22

289:                                              ; preds = %242
  br label %290

290:                                              ; preds = %289
  %291 = load i32, ptr %22, align 4, !tbaa !5
  %292 = add nsw i32 %291, 1
  store i32 %292, ptr %22, align 4, !tbaa !5
  br label %232, !llvm.loop !23

293:                                              ; preds = %236
  call void @_ZNSt14priority_queueISt4pairIiS0_IiiEESt6vectorIS2_SaIS2_EESt4lessIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(25) %6) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %6) #5
  ret void

294:                                              ; preds = %230, %120, %83
  call void @_ZNSt14priority_queueISt4pairIiS0_IiiEESt6vectorIS2_SaIS2_EESt4lessIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(25) %6) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %6) #5
  br label %295

295:                                              ; preds = %294
  %296 = load ptr, ptr %12, align 8
  %297 = load i32, ptr %13, align 4
  %298 = insertvalue { ptr, i32 } poison, ptr %296, 0
  %299 = insertvalue { ptr, i32 } %298, i32 %297, 1
  resume { ptr, i32 } %299

300:                                              ; preds = %227, %216
  unreachable
}

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

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

declare i32 @__gxx_personality_v0(...)

; 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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(12) ptr @_ZNKSt14priority_queueISt4pairIiS0_IiiEESt6vectorIS2_SaIS2_EESt4lessIS2_EE3topEv(ptr noundef nonnull align 8 dereferenceable(25)) #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: mustprogress uwtable
declare dso_local void @_ZNSt14priority_queueISt4pairIiS0_IiiEESt6vectorIS2_SaIS2_EESt4lessIS2_EE3popEv(ptr noundef nonnull align 8 dereferenceable(25)) #1 align 2

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

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


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

%"class.std::priority_queue" = type <{ %"class.std::vector", [8 x i8] }>
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<std::pair<int, 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 }
%"struct.std::pair" = type { i32, %"struct.std::pair.0" }
%"struct.std::pair.0" = type { i32, i32 }

@R = external dso_local local_unnamed_addr global i32, align 4
@C = external dso_local local_unnamed_addr global i32, align 4
@xdir = external dso_local local_unnamed_addr global [4 x i32], align 16
@ydir = external dso_local local_unnamed_addr global [4 x i32], align 16
@dist = external dso_local local_unnamed_addr global [15 x [15 x i32]], align 16
@cur = external dso_local local_unnamed_addr global [50 x [50 x i32]], align 16
@grid = external dso_local local_unnamed_addr global [50 x [50 x i8]], align 16

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_Z7getdisti(i32 noundef %0) local_unnamed_addr #1 personality ptr @__gxx_personality_v0 {
  %2 = alloca %"class.std::priority_queue", align 8
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca %"struct.std::pair", align 4
  %6 = alloca i32, align 4
  %7 = alloca %"struct.std::pair.0", align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca %"struct.std::pair", align 4
  %11 = alloca i32, align 4
  %12 = alloca %"struct.std::pair.0", align 4
  %13 = load i32, ptr @R, align 4, !tbaa !5
  %14 = icmp sgt i32 %13, 0
  br i1 %14, label %.preheader60.lr.ph, label %._crit_edge63

.preheader60.lr.ph:                               ; preds = %1
  %15 = load i32, ptr @C, align 4, !tbaa !5
  %16 = icmp sgt i32 %15, 0
  br i1 %16, label %.preheader60.us.preheader, label %._crit_edge63

.preheader60.us.preheader:                        ; preds = %.preheader60.lr.ph
  %wide.trip.count83 = zext nneg i32 %13 to i64
  %wide.trip.count = zext nneg i32 %15 to i64
  %min.iters.check = icmp ult i32 %15, 8
  %n.vec = and i64 %wide.trip.count, 2147483640
  %cmp.n = icmp eq i64 %n.vec, %wide.trip.count
  br label %.preheader60.us

.preheader60.us:                                  ; preds = %.preheader60.us.preheader, %._crit_edge.us
  %indvars.iv80 = phi i64 [ 0, %.preheader60.us.preheader ], [ %indvars.iv.next81, %._crit_edge.us ]
  br i1 %min.iters.check, label %scalar.ph.preheader, label %vector.body

vector.body:                                      ; preds = %.preheader60.us, %vector.body
  %index = phi i64 [ %index.next, %vector.body ], [ 0, %.preheader60.us ]
  %17 = getelementptr inbounds [50 x [50 x i32]], ptr @cur, i64 0, i64 %indvars.iv80, i64 %index
  %18 = getelementptr inbounds i8, ptr %17, i64 16
  store <4 x i32> <i32 1000000007, i32 1000000007, i32 1000000007, i32 1000000007>, ptr %17, align 8, !tbaa !5
  store <4 x i32> <i32 1000000007, i32 1000000007, i32 1000000007, i32 1000000007>, ptr %18, align 8, !tbaa !5
  %index.next = add nuw i64 %index, 8
  %19 = icmp eq i64 %index.next, %n.vec
  br i1 %19, label %middle.block, label %vector.body, !llvm.loop !9

middle.block:                                     ; preds = %vector.body
  br i1 %cmp.n, label %._crit_edge.us, label %scalar.ph.preheader

scalar.ph.preheader:                              ; preds = %middle.block, %.preheader60.us
  %indvars.iv.ph = phi i64 [ 0, %.preheader60.us ], [ %n.vec, %middle.block ]
  br label %scalar.ph

scalar.ph:                                        ; preds = %scalar.ph.preheader, %scalar.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %scalar.ph ], [ %indvars.iv.ph, %scalar.ph.preheader ]
  %20 = getelementptr inbounds [50 x [50 x i32]], ptr @cur, i64 0, i64 %indvars.iv80, i64 %indvars.iv
  store i32 1000000007, ptr %20, align 4, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge.us, label %scalar.ph, !llvm.loop !13

._crit_edge.us:                                   ; preds = %scalar.ph, %middle.block
  %indvars.iv.next81 = add nuw nsw i64 %indvars.iv80, 1
  %exitcond84.not = icmp eq i64 %indvars.iv.next81, %wide.trip.count83
  br i1 %exitcond84.not, label %._crit_edge63, label %.preheader60.us, !llvm.loop !14

._crit_edge63:                                    ; preds = %._crit_edge.us, %.preheader60.lr.ph, %1
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %2) #4
  call void @_ZNSt14priority_queueISt4pairIiS0_IiiEESt6vectorIS2_SaIS2_EESt4lessIS2_EEC2IS5_vEEv(ptr noundef nonnull align 8 dereferenceable(25) %2)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #4
  store i32 0, ptr %3, align 4, !tbaa !5
  %21 = load i32, ptr @R, align 4, !tbaa !5
  %22 = icmp sgt i32 %21, 0
  br i1 %22, label %.lr.ph66, label %._crit_edge67

.lr.ph66:                                         ; preds = %._crit_edge63
  %23 = add nsw i32 %0, 97
  %24 = load i32, ptr @C, align 4, !tbaa !5
  %25 = icmp sgt i32 %24, 0
  br i1 %25, label %.lr.ph66.split, label %._crit_edge67

._crit_edge67:                                    ; preds = %._crit_edge, %.lr.ph66, %._crit_edge63
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #4
  %26 = call noundef i64 @_ZNKSt14priority_queueISt4pairIiS0_IiiEESt6vectorIS2_SaIS2_EESt4lessIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(25) %2)
  %.not69 = icmp eq i64 %26, 0
  br i1 %.not69, label %.preheader58, label %.lr.ph71

.lr.ph66.split:                                   ; preds = %.lr.ph66, %._crit_edge
  %27 = phi i32 [ %32, %._crit_edge ], [ %21, %.lr.ph66 ]
  %28 = phi i32 [ %36, %._crit_edge ], [ 0, %.lr.ph66 ]
  %29 = phi i32 [ %34, %._crit_edge ], [ %24, %.lr.ph66 ]
  %30 = phi i32 [ %35, %._crit_edge ], [ %24, %.lr.ph66 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #4
  store i32 0, ptr %4, align 4, !tbaa !5
  %31 = icmp sgt i32 %30, 0
  br i1 %31, label %.lr.ph, label %._crit_edge

._crit_edge.loopexit:                             ; preds = %51
  %.pre100 = load i32, ptr %3, align 4, !tbaa !5
  %.pre101 = load i32, ptr @R, align 4, !tbaa !5
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %.lr.ph66.split
  %32 = phi i32 [ %.pre101, %._crit_edge.loopexit ], [ %27, %.lr.ph66.split ]
  %33 = phi i32 [ %.pre100, %._crit_edge.loopexit ], [ %28, %.lr.ph66.split ]
  %34 = phi i32 [ %52, %._crit_edge.loopexit ], [ %29, %.lr.ph66.split ]
  %35 = phi i32 [ %52, %._crit_edge.loopexit ], [ %30, %.lr.ph66.split ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #4
  %36 = add nsw i32 %33, 1
  store i32 %36, ptr %3, align 4, !tbaa !5
  %37 = icmp slt i32 %36, %32
  br i1 %37, label %.lr.ph66.split, label %._crit_edge67, !llvm.loop !15

.lr.ph:                                           ; preds = %.lr.ph66.split, %51
  %38 = phi i32 [ %52, %51 ], [ %29, %.lr.ph66.split ]
  %storemerge5064 = phi i32 [ %54, %51 ], [ 0, %.lr.ph66.split ]
  %39 = load i32, ptr %3, align 4, !tbaa !5
  %40 = sext i32 %39 to i64
  %41 = sext i32 %storemerge5064 to i64
  %42 = getelementptr inbounds [50 x [50 x i8]], ptr @grid, i64 0, i64 %40, i64 %41
  %43 = load i8, ptr %42, align 1, !tbaa !17
  %44 = sext i8 %43 to i32
  %45 = icmp eq i32 %23, %44
  br i1 %45, label %46, label %51

46:                                               ; preds = %.lr.ph
  %47 = getelementptr inbounds [50 x [50 x i32]], ptr @cur, i64 0, i64 %40, i64 %41
  store i32 0, ptr %47, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %5) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #4
  store i32 0, ptr %6, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #4
  call void @_ZNSt4pairIiiEC2IRiS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %7, ptr noundef nonnull align 4 dereferenceable(4) %3, ptr noundef nonnull align 4 dereferenceable(4) %4)
  call void @_ZNSt4pairIiS_IiiEEC2IiS0_TnNSt9enable_ifIXaaclsr5_PCCPE18_ConstructiblePairIT_T0_EEclsr5_PCCPE26_ImplicitlyConvertiblePairIS4_S5_EEEbE4typeELb1EEERKiRKS0_(ptr noundef nonnull align 4 dereferenceable(12) %5, ptr noundef nonnull align 4 dereferenceable(4) %6, ptr noundef nonnull align 4 dereferenceable(8) %7)
  invoke void @_ZNSt14priority_queueISt4pairIiS0_IiiEESt6vectorIS2_SaIS2_EESt4lessIS2_EE4pushEOS2_(ptr noundef nonnull align 8 dereferenceable(25) %2, ptr noundef nonnull align 4 dereferenceable(12) %5)
          to label %48 unwind label %49

48:                                               ; preds = %46
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #4
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %5) #4
  %.pre = load i32, ptr %4, align 4, !tbaa !5
  %.pre99 = load i32, ptr @C, align 4, !tbaa !5
  br label %51

49:                                               ; preds = %46
  %50 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #4
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %5) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #4
  br label %193

51:                                               ; preds = %.lr.ph, %48
  %52 = phi i32 [ %38, %.lr.ph ], [ %.pre99, %48 ]
  %53 = phi i32 [ %storemerge5064, %.lr.ph ], [ %.pre, %48 ]
  %54 = add nsw i32 %53, 1
  store i32 %54, ptr %4, align 4, !tbaa !5
  %55 = icmp slt i32 %54, %52
  br i1 %55, label %.lr.ph, label %._crit_edge.loopexit, !llvm.loop !18

.preheader58:                                     ; preds = %.loopexit, %._crit_edge67
  %56 = load i32, ptr @R, align 4, !tbaa !5
  %57 = icmp sgt i32 %56, 0
  br i1 %57, label %.preheader.lr.ph, label %._crit_edge76

.preheader.lr.ph:                                 ; preds = %.preheader58
  %58 = load i32, ptr @C, align 4, !tbaa !5
  %59 = icmp sgt i32 %58, 0
  %60 = sext i32 %0 to i64
  br i1 %59, label %.preheader.us.preheader, label %._crit_edge76

.preheader.us.preheader:                          ; preds = %.preheader.lr.ph
  %wide.trip.count97 = zext nneg i32 %56 to i64
  %wide.trip.count92 = zext nneg i32 %58 to i64
  %xtraiter = and i64 %wide.trip.count92, 1
  %61 = icmp eq i32 %58, 1
  %unroll_iter = and i64 %wide.trip.count92, 2147483646
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br label %.preheader.us

.preheader.us:                                    ; preds = %.preheader.us.preheader, %._crit_edge74.us
  %indvars.iv94 = phi i64 [ 0, %.preheader.us.preheader ], [ %indvars.iv.next95, %._crit_edge74.us ]
  br i1 %61, label %._crit_edge74.us.unr-lcssa, label %.preheader.us.new

.preheader.us.new:                                ; preds = %.preheader.us, %79
  %indvars.iv89 = phi i64 [ %indvars.iv.next90.1, %79 ], [ 0, %.preheader.us ]
  %niter = phi i64 [ %niter.next.1, %79 ], [ 0, %.preheader.us ]
  %62 = getelementptr inbounds [50 x [50 x i8]], ptr @grid, i64 0, i64 %indvars.iv94, i64 %indvars.iv89
  %63 = load i8, ptr %62, align 2, !tbaa !17
  %64 = add i8 %63, -97
  %or.cond54.us = icmp ult i8 %64, 26
  br i1 %or.cond54.us, label %65, label %70

65:                                               ; preds = %.preheader.us.new
  %66 = getelementptr inbounds [50 x [50 x i32]], ptr @cur, i64 0, i64 %indvars.iv94, i64 %indvars.iv89
  %67 = load i32, ptr %66, align 8, !tbaa !5
  %68 = zext nneg i8 %64 to i64
  %69 = getelementptr inbounds [15 x [15 x i32]], ptr @dist, i64 0, i64 %60, i64 %68
  store i32 %67, ptr %69, align 4, !tbaa !5
  br label %70

70:                                               ; preds = %65, %.preheader.us.new
  %indvars.iv.next90 = or disjoint i64 %indvars.iv89, 1
  %71 = getelementptr inbounds [50 x [50 x i8]], ptr @grid, i64 0, i64 %indvars.iv94, i64 %indvars.iv.next90
  %72 = load i8, ptr %71, align 1, !tbaa !17
  %73 = add i8 %72, -97
  %or.cond54.us.1 = icmp ult i8 %73, 26
  br i1 %or.cond54.us.1, label %74, label %79

74:                                               ; preds = %70
  %75 = getelementptr inbounds [50 x [50 x i32]], ptr @cur, i64 0, i64 %indvars.iv94, i64 %indvars.iv.next90
  %76 = load i32, ptr %75, align 4, !tbaa !5
  %77 = zext nneg i8 %73 to i64
  %78 = getelementptr inbounds [15 x [15 x i32]], ptr @dist, i64 0, i64 %60, i64 %77
  store i32 %76, ptr %78, align 4, !tbaa !5
  br label %79

79:                                               ; preds = %74, %70
  %indvars.iv.next90.1 = add nuw nsw i64 %indvars.iv89, 2
  %niter.next.1 = add i64 %niter, 2
  %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
  br i1 %niter.ncmp.1, label %._crit_edge74.us.unr-lcssa, label %.preheader.us.new, !llvm.loop !19

._crit_edge74.us.unr-lcssa:                       ; preds = %79, %.preheader.us
  %indvars.iv89.unr = phi i64 [ 0, %.preheader.us ], [ %indvars.iv.next90.1, %79 ]
  br i1 %lcmp.mod.not, label %._crit_edge74.us, label %.epil.preheader

.epil.preheader:                                  ; preds = %._crit_edge74.us.unr-lcssa
  %80 = getelementptr inbounds [50 x [50 x i8]], ptr @grid, i64 0, i64 %indvars.iv94, i64 %indvars.iv89.unr
  %81 = load i8, ptr %80, align 1, !tbaa !17
  %82 = add i8 %81, -97
  %or.cond54.us.epil = icmp ult i8 %82, 26
  br i1 %or.cond54.us.epil, label %83, label %._crit_edge74.us

83:                                               ; preds = %.epil.preheader
  %84 = getelementptr inbounds [50 x [50 x i32]], ptr @cur, i64 0, i64 %indvars.iv94, i64 %indvars.iv89.unr
  %85 = load i32, ptr %84, align 4, !tbaa !5
  %86 = zext nneg i8 %82 to i64
  %87 = getelementptr inbounds [15 x [15 x i32]], ptr @dist, i64 0, i64 %60, i64 %86
  store i32 %85, ptr %87, align 4, !tbaa !5
  br label %._crit_edge74.us

._crit_edge74.us:                                 ; preds = %.epil.preheader, %83, %._crit_edge74.us.unr-lcssa
  %indvars.iv.next95 = add nuw nsw i64 %indvars.iv94, 1
  %exitcond98.not = icmp eq i64 %indvars.iv.next95, %wide.trip.count97
  br i1 %exitcond98.not, label %._crit_edge76, label %.preheader.us, !llvm.loop !20

.lr.ph71:                                         ; preds = %._crit_edge67, %.loopexit
  %88 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNKSt14priority_queueISt4pairIiS0_IiiEESt6vectorIS2_SaIS2_EESt4lessIS2_EE3topEv(ptr noundef nonnull align 8 dereferenceable(25) %2)
  %.sroa.0.0.copyload = load i32, ptr %88, align 4
  %.sroa.6.0..sroa_idx = getelementptr inbounds i8, ptr %88, i64 4
  %.sroa.6.0.copyload = load i32, ptr %.sroa.6.0..sroa_idx, align 4
  %.sroa.8.0..sroa_idx = getelementptr inbounds i8, ptr %88, i64 8
  %.sroa.8.0.copyload = load i32, ptr %.sroa.8.0..sroa_idx, align 4
  invoke void @_ZNSt14priority_queueISt4pairIiS0_IiiEESt6vectorIS2_SaIS2_EESt4lessIS2_EE3popEv(ptr noundef nonnull align 8 dereferenceable(25) %2)
          to label %89 unwind label %102

89:                                               ; preds = %.lr.ph71
  %90 = sub nsw i32 0, %.sroa.0.0.copyload
  %91 = sext i32 %.sroa.6.0.copyload to i64
  %92 = sext i32 %.sroa.8.0.copyload to i64
  %93 = getelementptr inbounds [50 x [50 x i32]], ptr @cur, i64 0, i64 %91, i64 %92
  %94 = load i32, ptr %93, align 4, !tbaa !5
  %95 = icmp slt i32 %94, %90
  br i1 %95, label %.loopexit, label %.preheader59, !llvm.loop !21

.preheader59:                                     ; preds = %89
  %96 = sub i32 1, %.sroa.0.0.copyload
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #4
  %97 = load i32, ptr @xdir, align 16, !tbaa !5
  %98 = add nsw i32 %97, %.sroa.6.0.copyload
  store i32 %98, ptr %8, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %9) #4
  %99 = load i32, ptr @ydir, align 16, !tbaa !5
  %100 = add nsw i32 %99, %.sroa.8.0.copyload
  store i32 %100, ptr %9, align 4, !tbaa !5
  %101 = icmp slt i32 %98, 0
  br i1 %101, label %121, label %104

102:                                              ; preds = %.lr.ph71
  %103 = landingpad { ptr, i32 }
          cleanup
  br label %193

104:                                              ; preds = %.preheader59
  %105 = load i32, ptr @R, align 4, !tbaa !5
  %106 = icmp slt i32 %98, %105
  %107 = icmp sgt i32 %100, -1
  %or.cond.not57 = select i1 %106, i1 %107, i1 false
  %108 = load i32, ptr @C, align 4
  %.not47 = icmp slt i32 %100, %108
  %or.cond53 = select i1 %or.cond.not57, i1 %.not47, i1 false
  br i1 %or.cond53, label %109, label %121

109:                                              ; preds = %104
  %110 = zext nneg i32 %98 to i64
  %111 = zext nneg i32 %100 to i64
  %112 = getelementptr inbounds [50 x [50 x i8]], ptr @grid, i64 0, i64 %110, i64 %111
  %113 = load i8, ptr %112, align 1, !tbaa !17
  switch i8 %113, label %115 [
    i8 46, label %121
    i8 83, label %114
  ]

114:                                              ; preds = %109
  br label %115

115:                                              ; preds = %109, %114
  %.034 = phi i32 [ %96, %114 ], [ %90, %109 ]
  %116 = getelementptr inbounds [50 x [50 x i32]], ptr @cur, i64 0, i64 %110, i64 %111
  %117 = load i32, ptr %116, align 4, !tbaa !5
  %.not48 = icmp slt i32 %.034, %117
  br i1 %.not48, label %118, label %121

118:                                              ; preds = %115
  store i32 %.034, ptr %116, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %10) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %11) #4
  %119 = sub nsw i32 0, %.034
  store i32 %119, ptr %11, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %12) #4
  call void @_ZNSt4pairIiiEC2IRiS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %12, ptr noundef nonnull align 4 dereferenceable(4) %8, ptr noundef nonnull align 4 dereferenceable(4) %9)
  call void @_ZNSt4pairIiS_IiiEEC2IiS0_TnNSt9enable_ifIXaaclsr5_PCCPE18_ConstructiblePairIT_T0_EEclsr5_PCCPE26_ImplicitlyConvertiblePairIS4_S5_EEEbE4typeELb1EEERKiRKS0_(ptr noundef nonnull align 4 dereferenceable(12) %10, ptr noundef nonnull align 4 dereferenceable(4) %11, ptr noundef nonnull align 4 dereferenceable(8) %12)
  invoke void @_ZNSt14priority_queueISt4pairIiS0_IiiEESt6vectorIS2_SaIS2_EESt4lessIS2_EE4pushEOS2_(ptr noundef nonnull align 8 dereferenceable(25) %2, ptr noundef nonnull align 4 dereferenceable(12) %10)
          to label %120 unwind label %190

120:                                              ; preds = %118
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %11) #4
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %10) #4
  br label %121

121:                                              ; preds = %120, %115, %109, %.preheader59, %104
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #4
  %122 = load i32, ptr getelementptr inbounds (i8, ptr @xdir, i64 4), align 4, !tbaa !5
  %123 = add nsw i32 %122, %.sroa.6.0.copyload
  store i32 %123, ptr %8, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %9) #4
  %124 = load i32, ptr getelementptr inbounds (i8, ptr @ydir, i64 4), align 4, !tbaa !5
  %125 = add nsw i32 %124, %.sroa.8.0.copyload
  store i32 %125, ptr %9, align 4, !tbaa !5
  %126 = icmp slt i32 %123, 0
  br i1 %126, label %144, label %127

127:                                              ; preds = %121
  %128 = load i32, ptr @R, align 4, !tbaa !5
  %129 = icmp slt i32 %123, %128
  %130 = icmp sgt i32 %125, -1
  %or.cond.not57.1 = select i1 %129, i1 %130, i1 false
  %131 = load i32, ptr @C, align 4
  %.not47.1 = icmp slt i32 %125, %131
  %or.cond53.1 = select i1 %or.cond.not57.1, i1 %.not47.1, i1 false
  br i1 %or.cond53.1, label %132, label %144

132:                                              ; preds = %127
  %133 = zext nneg i32 %123 to i64
  %134 = zext nneg i32 %125 to i64
  %135 = getelementptr inbounds [50 x [50 x i8]], ptr @grid, i64 0, i64 %133, i64 %134
  %136 = load i8, ptr %135, align 1, !tbaa !17
  switch i8 %136, label %138 [
    i8 46, label %144
    i8 83, label %137
  ]

137:                                              ; preds = %132
  br label %138

138:                                              ; preds = %137, %132
  %.034.1 = phi i32 [ %96, %137 ], [ %90, %132 ]
  %139 = getelementptr inbounds [50 x [50 x i32]], ptr @cur, i64 0, i64 %133, i64 %134
  %140 = load i32, ptr %139, align 4, !tbaa !5
  %.not48.1 = icmp slt i32 %.034.1, %140
  br i1 %.not48.1, label %141, label %144

141:                                              ; preds = %138
  store i32 %.034.1, ptr %139, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %10) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %11) #4
  %142 = sub nsw i32 0, %.034.1
  store i32 %142, ptr %11, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %12) #4
  call void @_ZNSt4pairIiiEC2IRiS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %12, ptr noundef nonnull align 4 dereferenceable(4) %8, ptr noundef nonnull align 4 dereferenceable(4) %9)
  call void @_ZNSt4pairIiS_IiiEEC2IiS0_TnNSt9enable_ifIXaaclsr5_PCCPE18_ConstructiblePairIT_T0_EEclsr5_PCCPE26_ImplicitlyConvertiblePairIS4_S5_EEEbE4typeELb1EEERKiRKS0_(ptr noundef nonnull align 4 dereferenceable(12) %10, ptr noundef nonnull align 4 dereferenceable(4) %11, ptr noundef nonnull align 4 dereferenceable(8) %12)
  invoke void @_ZNSt14priority_queueISt4pairIiS0_IiiEESt6vectorIS2_SaIS2_EESt4lessIS2_EE4pushEOS2_(ptr noundef nonnull align 8 dereferenceable(25) %2, ptr noundef nonnull align 4 dereferenceable(12) %10)
          to label %143 unwind label %190

143:                                              ; preds = %141
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %11) #4
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %10) #4
  br label %144

144:                                              ; preds = %143, %138, %132, %127, %121
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #4
  %145 = load i32, ptr getelementptr inbounds (i8, ptr @xdir, i64 8), align 8, !tbaa !5
  %146 = add nsw i32 %145, %.sroa.6.0.copyload
  store i32 %146, ptr %8, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %9) #4
  %147 = load i32, ptr getelementptr inbounds (i8, ptr @ydir, i64 8), align 8, !tbaa !5
  %148 = add nsw i32 %147, %.sroa.8.0.copyload
  store i32 %148, ptr %9, align 4, !tbaa !5
  %149 = icmp slt i32 %146, 0
  br i1 %149, label %167, label %150

150:                                              ; preds = %144
  %151 = load i32, ptr @R, align 4, !tbaa !5
  %152 = icmp slt i32 %146, %151
  %153 = icmp sgt i32 %148, -1
  %or.cond.not57.2 = select i1 %152, i1 %153, i1 false
  %154 = load i32, ptr @C, align 4
  %.not47.2 = icmp slt i32 %148, %154
  %or.cond53.2 = select i1 %or.cond.not57.2, i1 %.not47.2, i1 false
  br i1 %or.cond53.2, label %155, label %167

155:                                              ; preds = %150
  %156 = zext nneg i32 %146 to i64
  %157 = zext nneg i32 %148 to i64
  %158 = getelementptr inbounds [50 x [50 x i8]], ptr @grid, i64 0, i64 %156, i64 %157
  %159 = load i8, ptr %158, align 1, !tbaa !17
  switch i8 %159, label %161 [
    i8 46, label %167
    i8 83, label %160
  ]

160:                                              ; preds = %155
  br label %161

161:                                              ; preds = %160, %155
  %.034.2 = phi i32 [ %96, %160 ], [ %90, %155 ]
  %162 = getelementptr inbounds [50 x [50 x i32]], ptr @cur, i64 0, i64 %156, i64 %157
  %163 = load i32, ptr %162, align 4, !tbaa !5
  %.not48.2 = icmp slt i32 %.034.2, %163
  br i1 %.not48.2, label %164, label %167

164:                                              ; preds = %161
  store i32 %.034.2, ptr %162, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %10) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %11) #4
  %165 = sub nsw i32 0, %.034.2
  store i32 %165, ptr %11, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %12) #4
  call void @_ZNSt4pairIiiEC2IRiS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %12, ptr noundef nonnull align 4 dereferenceable(4) %8, ptr noundef nonnull align 4 dereferenceable(4) %9)
  call void @_ZNSt4pairIiS_IiiEEC2IiS0_TnNSt9enable_ifIXaaclsr5_PCCPE18_ConstructiblePairIT_T0_EEclsr5_PCCPE26_ImplicitlyConvertiblePairIS4_S5_EEEbE4typeELb1EEERKiRKS0_(ptr noundef nonnull align 4 dereferenceable(12) %10, ptr noundef nonnull align 4 dereferenceable(4) %11, ptr noundef nonnull align 4 dereferenceable(8) %12)
  invoke void @_ZNSt14priority_queueISt4pairIiS0_IiiEESt6vectorIS2_SaIS2_EESt4lessIS2_EE4pushEOS2_(ptr noundef nonnull align 8 dereferenceable(25) %2, ptr noundef nonnull align 4 dereferenceable(12) %10)
          to label %166 unwind label %190

166:                                              ; preds = %164
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %11) #4
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %10) #4
  br label %167

167:                                              ; preds = %166, %161, %155, %150, %144
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #4
  %168 = load i32, ptr getelementptr inbounds (i8, ptr @xdir, i64 12), align 4, !tbaa !5
  %169 = add nsw i32 %168, %.sroa.6.0.copyload
  store i32 %169, ptr %8, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %9) #4
  %170 = load i32, ptr getelementptr inbounds (i8, ptr @ydir, i64 12), align 4, !tbaa !5
  %171 = add nsw i32 %170, %.sroa.8.0.copyload
  store i32 %171, ptr %9, align 4, !tbaa !5
  %172 = icmp slt i32 %169, 0
  br i1 %172, label %.loopexit.loopexit, label %173

173:                                              ; preds = %167
  %174 = load i32, ptr @R, align 4, !tbaa !5
  %175 = icmp slt i32 %169, %174
  %176 = icmp sgt i32 %171, -1
  %or.cond.not57.3 = select i1 %175, i1 %176, i1 false
  %177 = load i32, ptr @C, align 4
  %.not47.3 = icmp slt i32 %171, %177
  %or.cond53.3 = select i1 %or.cond.not57.3, i1 %.not47.3, i1 false
  br i1 %or.cond53.3, label %178, label %.loopexit.loopexit

178:                                              ; preds = %173
  %179 = zext nneg i32 %169 to i64
  %180 = zext nneg i32 %171 to i64
  %181 = getelementptr inbounds [50 x [50 x i8]], ptr @grid, i64 0, i64 %179, i64 %180
  %182 = load i8, ptr %181, align 1, !tbaa !17
  switch i8 %182, label %184 [
    i8 46, label %.loopexit.loopexit
    i8 83, label %183
  ]

183:                                              ; preds = %178
  br label %184

184:                                              ; preds = %183, %178
  %.034.3 = phi i32 [ %96, %183 ], [ %90, %178 ]
  %185 = getelementptr inbounds [50 x [50 x i32]], ptr @cur, i64 0, i64 %179, i64 %180
  %186 = load i32, ptr %185, align 4, !tbaa !5
  %.not48.3 = icmp slt i32 %.034.3, %186
  br i1 %.not48.3, label %187, label %.loopexit.loopexit

187:                                              ; preds = %184
  store i32 %.034.3, ptr %185, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %10) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %11) #4
  %188 = sub nsw i32 0, %.034.3
  store i32 %188, ptr %11, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %12) #4
  call void @_ZNSt4pairIiiEC2IRiS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %12, ptr noundef nonnull align 4 dereferenceable(4) %8, ptr noundef nonnull align 4 dereferenceable(4) %9)
  call void @_ZNSt4pairIiS_IiiEEC2IiS0_TnNSt9enable_ifIXaaclsr5_PCCPE18_ConstructiblePairIT_T0_EEclsr5_PCCPE26_ImplicitlyConvertiblePairIS4_S5_EEEbE4typeELb1EEERKiRKS0_(ptr noundef nonnull align 4 dereferenceable(12) %10, ptr noundef nonnull align 4 dereferenceable(4) %11, ptr noundef nonnull align 4 dereferenceable(8) %12)
  invoke void @_ZNSt14priority_queueISt4pairIiS0_IiiEESt6vectorIS2_SaIS2_EESt4lessIS2_EE4pushEOS2_(ptr noundef nonnull align 8 dereferenceable(25) %2, ptr noundef nonnull align 4 dereferenceable(12) %10)
          to label %189 unwind label %190

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

.loopexit.loopexit:                               ; preds = %189, %184, %178, %173, %167
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #4
  br label %.loopexit

190:                                              ; preds = %187, %164, %141, %118
  %191 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %11) #4
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %10) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #4
  br label %193

.loopexit:                                        ; preds = %.loopexit.loopexit, %89
  %192 = call noundef i64 @_ZNKSt14priority_queueISt4pairIiS0_IiiEESt6vectorIS2_SaIS2_EESt4lessIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(25) %2)
  %.not = icmp eq i64 %192, 0
  br i1 %.not, label %.preheader58, label %.lr.ph71

._crit_edge76:                                    ; preds = %._crit_edge74.us, %.preheader.lr.ph, %.preheader58
  call void @_ZNSt14priority_queueISt4pairIiS0_IiiEESt6vectorIS2_SaIS2_EESt4lessIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(25) %2) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %2) #4
  ret void

193:                                              ; preds = %102, %190, %49
  %.pn51 = phi { ptr, i32 } [ %50, %49 ], [ %191, %190 ], [ %103, %102 ]
  call void @_ZNSt14priority_queueISt4pairIiS0_IiiEESt6vectorIS2_SaIS2_EESt4lessIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(25) %2) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %2) #4
  resume { ptr, i32 } %.pn51
}

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

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

declare i32 @__gxx_personality_v0(...)

; 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

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

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

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

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

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

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

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


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