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

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

%"class.std::priority_queue" = type <{ %"class.std::vector", [8 x i8] }>
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"struct.std::pair" = type { i32, i32 }

@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@tot = external dso_local global i32, align 4
@ctr = external dso_local global i32, align 4
@x = external dso_local global [101 x i32], align 16
@y = external dso_local global [101 x i32], align 16
@pos = external dso_local global [13 x [13 x i32]], align 16
@s = external dso_local global [101 x i32], align 16
@w = external dso_local global [101 x i32], align 16
@f = external dso_local global [1025 x [101 x i32]], align 16
@g = external dso_local global [1025 x [101 x i32]], align 16
@Q = external dso_local global %"class.std::priority_queue", align 8
@vis = external dso_local global [101 x i8], align 16
@used = external dso_local global [101 x i8], align 16
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [3 x i8], align 1
@_ZL2dx = external hidden constant [4 x i32], align 16
@_ZL2dy = external hidden constant [4 x i32], align 16
@.str.3 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z3dfsii(i32 noundef, 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: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #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 ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca %"struct.std::pair", align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  %22 = alloca %"struct.std::pair", align 4
  %23 = alloca i32, align 4
  %24 = alloca i32, align 4
  %25 = alloca i32, align 4
  %26 = alloca i32, align 4
  %27 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %28 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @n, ptr noundef @m)
  call void @llvm.memset.p0.i64(ptr align 16 @f, i8 63, i64 414100, i1 false)
  call void @llvm.memset.p0.i64(ptr align 16 @g, i8 -1, i64 414100, i1 false)
  call void @llvm.memset.p0.i64(ptr align 16 @pos, i8 -1, i64 676, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #7
  store i32 1, ptr %2, align 4, !tbaa !5
  br label %29

29:                                               ; preds = %87, %0
  %30 = load i32, ptr %2, align 4, !tbaa !5
  %31 = load i32, ptr @n, align 4, !tbaa !5
  %32 = icmp sle i32 %30, %31
  br i1 %32, label %34, label %33

33:                                               ; preds = %29
  store i32 2, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #7
  br label %90

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

35:                                               ; preds = %83, %34
  %36 = load i32, ptr %4, align 4, !tbaa !5
  %37 = load i32, ptr @m, align 4, !tbaa !5
  %38 = icmp sle i32 %36, %37
  br i1 %38, label %40, label %39

39:                                               ; preds = %35
  store i32 5, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #7
  br label %86

40:                                               ; preds = %35
  %41 = load i32, ptr @tot, align 4, !tbaa !5
  %42 = sext i32 %41 to i64
  %43 = getelementptr inbounds i32, ptr @w, i64 %42
  %44 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.2, ptr noundef %43)
  %45 = load i32, ptr @tot, align 4, !tbaa !5
  %46 = sext i32 %45 to i64
  %47 = getelementptr inbounds [101 x i32], ptr @w, i64 0, i64 %46
  %48 = load i32, ptr %47, align 4, !tbaa !5
  %49 = icmp ne i32 %48, 0
  br i1 %49, label %66, label %50

50:                                               ; preds = %40
  %51 = load i32, ptr @ctr, align 4, !tbaa !5
  %52 = add nsw i32 %51, 1
  store i32 %52, ptr @ctr, align 4, !tbaa !5
  %53 = shl i32 1, %51
  %54 = load i32, ptr @tot, align 4, !tbaa !5
  %55 = sext i32 %54 to i64
  %56 = getelementptr inbounds [101 x i32], ptr @s, i64 0, i64 %55
  store i32 %53, ptr %56, align 4, !tbaa !5
  %57 = load i32, ptr @tot, align 4, !tbaa !5
  %58 = sext i32 %57 to i64
  %59 = getelementptr inbounds [101 x i32], ptr @s, i64 0, i64 %58
  %60 = load i32, ptr %59, align 4, !tbaa !5
  %61 = sext i32 %60 to i64
  %62 = getelementptr inbounds [1025 x [101 x i32]], ptr @f, i64 0, i64 %61
  %63 = load i32, ptr @tot, align 4, !tbaa !5
  %64 = sext i32 %63 to i64
  %65 = getelementptr inbounds [101 x i32], ptr %62, i64 0, i64 %64
  store i32 0, ptr %65, align 4, !tbaa !5
  br label %66

66:                                               ; preds = %50, %40
  %67 = load i32, ptr %2, align 4, !tbaa !5
  %68 = load i32, ptr @tot, align 4, !tbaa !5
  %69 = sext i32 %68 to i64
  %70 = getelementptr inbounds [101 x i32], ptr @x, i64 0, i64 %69
  store i32 %67, ptr %70, align 4, !tbaa !5
  %71 = load i32, ptr %4, align 4, !tbaa !5
  %72 = load i32, ptr @tot, align 4, !tbaa !5
  %73 = sext i32 %72 to i64
  %74 = getelementptr inbounds [101 x i32], ptr @y, i64 0, i64 %73
  store i32 %71, ptr %74, align 4, !tbaa !5
  %75 = load i32, ptr @tot, align 4, !tbaa !5
  %76 = add nsw i32 %75, 1
  store i32 %76, ptr @tot, align 4, !tbaa !5
  %77 = load i32, ptr %2, align 4, !tbaa !5
  %78 = sext i32 %77 to i64
  %79 = getelementptr inbounds [13 x [13 x i32]], ptr @pos, i64 0, i64 %78
  %80 = load i32, ptr %4, align 4, !tbaa !5
  %81 = sext i32 %80 to i64
  %82 = getelementptr inbounds [13 x i32], ptr %79, i64 0, i64 %81
  store i32 %75, ptr %82, align 4, !tbaa !5
  br label %83

83:                                               ; preds = %66
  %84 = load i32, ptr %4, align 4, !tbaa !5
  %85 = add nsw i32 %84, 1
  store i32 %85, ptr %4, align 4, !tbaa !5
  br label %35, !llvm.loop !9

86:                                               ; preds = %39
  br label %87

87:                                               ; preds = %86
  %88 = load i32, ptr %2, align 4, !tbaa !5
  %89 = add nsw i32 %88, 1
  store i32 %89, ptr %2, align 4, !tbaa !5
  br label %29, !llvm.loop !11

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

91:                                               ; preds = %334, %90
  %92 = load i32, ptr %5, align 4, !tbaa !5
  %93 = load i32, ptr @ctr, align 4, !tbaa !5
  %94 = shl i32 1, %93
  %95 = icmp slt i32 %92, %94
  br i1 %95, label %97, label %96

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

97:                                               ; preds = %91
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #7
  %98 = load i32, ptr %5, align 4, !tbaa !5
  %99 = sext i32 %98 to i64
  %100 = getelementptr inbounds [1025 x [101 x i32]], ptr @f, i64 0, i64 %99
  %101 = getelementptr inbounds [101 x i32], ptr %100, i64 0, i64 0
  store ptr %101, ptr %6, align 8, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #7
  %102 = load i32, ptr %5, align 4, !tbaa !5
  %103 = sext i32 %102 to i64
  %104 = getelementptr inbounds [1025 x [101 x i32]], ptr @g, i64 0, i64 %103
  %105 = getelementptr inbounds [101 x i32], ptr %104, i64 0, i64 0
  store ptr %105, ptr %7, align 8, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #7
  store i32 0, ptr %8, align 4, !tbaa !5
  br label %106

106:                                              ; preds = %209, %97
  %107 = load i32, ptr %8, align 4, !tbaa !5
  %108 = load i32, ptr @tot, align 4, !tbaa !5
  %109 = icmp slt i32 %107, %108
  br i1 %109, label %111, label %110

110:                                              ; preds = %106
  store i32 11, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #7
  br label %212

111:                                              ; preds = %106
  %112 = load i32, ptr %8, align 4, !tbaa !5
  %113 = sext i32 %112 to i64
  %114 = getelementptr inbounds [101 x i32], ptr @s, i64 0, i64 %113
  %115 = load i32, ptr %114, align 4, !tbaa !5
  %116 = icmp ne i32 %115, 0
  br i1 %116, label %117, label %126

117:                                              ; preds = %111
  %118 = load i32, ptr %5, align 4, !tbaa !5
  %119 = load i32, ptr %8, align 4, !tbaa !5
  %120 = sext i32 %119 to i64
  %121 = getelementptr inbounds [101 x i32], ptr @s, i64 0, i64 %120
  %122 = load i32, ptr %121, align 4, !tbaa !5
  %123 = and i32 %118, %122
  %124 = icmp ne i32 %123, 0
  br i1 %124, label %126, label %125

125:                                              ; preds = %117
  br label %209

126:                                              ; preds = %117, %111
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #7
  %127 = load i32, ptr %5, align 4, !tbaa !5
  store i32 %127, ptr %9, align 4, !tbaa !5
  br label %128

128:                                              ; preds = %188, %126
  %129 = load i32, ptr %9, align 4, !tbaa !5
  %130 = icmp ne i32 %129, 0
  br i1 %130, label %132, label %131

131:                                              ; preds = %128
  store i32 14, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #7
  br label %193

132:                                              ; preds = %128
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #7
  %133 = load i32, ptr %9, align 4, !tbaa !5
  %134 = load i32, ptr %8, align 4, !tbaa !5
  %135 = sext i32 %134 to i64
  %136 = getelementptr inbounds [101 x i32], ptr @s, i64 0, i64 %135
  %137 = load i32, ptr %136, align 4, !tbaa !5
  %138 = or i32 %133, %137
  %139 = sext i32 %138 to i64
  %140 = getelementptr inbounds [1025 x [101 x i32]], ptr @f, i64 0, i64 %139
  %141 = load i32, ptr %8, align 4, !tbaa !5
  %142 = sext i32 %141 to i64
  %143 = getelementptr inbounds [101 x i32], ptr %140, i64 0, i64 %142
  %144 = load i32, ptr %143, align 4, !tbaa !5
  %145 = load i32, ptr %5, align 4, !tbaa !5
  %146 = load i32, ptr %9, align 4, !tbaa !5
  %147 = xor i32 %145, %146
  %148 = load i32, ptr %8, align 4, !tbaa !5
  %149 = sext i32 %148 to i64
  %150 = getelementptr inbounds [101 x i32], ptr @s, i64 0, i64 %149
  %151 = load i32, ptr %150, align 4, !tbaa !5
  %152 = or i32 %147, %151
  %153 = sext i32 %152 to i64
  %154 = getelementptr inbounds [1025 x [101 x i32]], ptr @f, i64 0, i64 %153
  %155 = load i32, ptr %8, align 4, !tbaa !5
  %156 = sext i32 %155 to i64
  %157 = getelementptr inbounds [101 x i32], ptr %154, i64 0, i64 %156
  %158 = load i32, ptr %157, align 4, !tbaa !5
  %159 = add nsw i32 %144, %158
  %160 = load i32, ptr %8, align 4, !tbaa !5
  %161 = sext i32 %160 to i64
  %162 = getelementptr inbounds [101 x i32], ptr @w, i64 0, i64 %161
  %163 = load i32, ptr %162, align 4, !tbaa !5
  %164 = sub nsw i32 %159, %163
  store i32 %164, ptr %10, align 4, !tbaa !5
  %165 = load i32, ptr %10, align 4, !tbaa !5
  %166 = load ptr, ptr %6, align 8, !tbaa !12
  %167 = load i32, ptr %8, align 4, !tbaa !5
  %168 = sext i32 %167 to i64
  %169 = getelementptr inbounds i32, ptr %166, i64 %168
  %170 = load i32, ptr %169, align 4, !tbaa !5
  %171 = icmp slt i32 %165, %170
  br i1 %171, label %172, label %187

172:                                              ; preds = %132
  %173 = load i32, ptr %10, align 4, !tbaa !5
  %174 = load ptr, ptr %6, align 8, !tbaa !12
  %175 = load i32, ptr %8, align 4, !tbaa !5
  %176 = sext i32 %175 to i64
  %177 = getelementptr inbounds i32, ptr %174, i64 %176
  store i32 %173, ptr %177, align 4, !tbaa !5
  %178 = load i32, ptr %8, align 4, !tbaa !5
  %179 = load i32, ptr @ctr, align 4, !tbaa !5
  %180 = shl i32 %178, %179
  %181 = load i32, ptr %9, align 4, !tbaa !5
  %182 = or i32 %180, %181
  %183 = load ptr, ptr %7, align 8, !tbaa !12
  %184 = load i32, ptr %8, align 4, !tbaa !5
  %185 = sext i32 %184 to i64
  %186 = getelementptr inbounds i32, ptr %183, i64 %185
  store i32 %182, ptr %186, align 4, !tbaa !5
  br label %187

187:                                              ; preds = %172, %132
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #7
  br label %188

188:                                              ; preds = %187
  %189 = load i32, ptr %9, align 4, !tbaa !5
  %190 = sub nsw i32 %189, 1
  %191 = load i32, ptr %5, align 4, !tbaa !5
  %192 = and i32 %190, %191
  store i32 %192, ptr %9, align 4, !tbaa !5
  br label %128, !llvm.loop !14

193:                                              ; preds = %131
  %194 = load ptr, ptr %6, align 8, !tbaa !12
  %195 = load i32, ptr %8, align 4, !tbaa !5
  %196 = sext i32 %195 to i64
  %197 = getelementptr inbounds i32, ptr %194, i64 %196
  %198 = load i32, ptr %197, align 4, !tbaa !5
  %199 = icmp slt i32 %198, 1061109567
  br i1 %199, label %200, label %208

200:                                              ; preds = %193
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #7
  %201 = load ptr, ptr %6, align 8, !tbaa !12
  %202 = load i32, ptr %8, align 4, !tbaa !5
  %203 = sext i32 %202 to i64
  %204 = getelementptr inbounds i32, ptr %201, i64 %203
  %205 = load i32, ptr %204, align 4, !tbaa !5
  %206 = sub nsw i32 0, %205
  store i32 %206, ptr %12, align 4, !tbaa !5
  %207 = 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) %8)
  store i64 %207, ptr %11, align 4
  call void @_ZNSt14priority_queueISt4pairIiiESt6vectorIS1_SaIS1_EESt4lessIS1_EE4pushEOS1_(ptr noundef nonnull align 8 dereferenceable(25) @Q, 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 %208

208:                                              ; preds = %200, %193
  br label %209

209:                                              ; preds = %208, %125
  %210 = load i32, ptr %8, align 4, !tbaa !5
  %211 = add nsw i32 %210, 1
  store i32 %211, ptr %8, align 4, !tbaa !5
  br label %106, !llvm.loop !15

212:                                              ; preds = %110
  call void @llvm.memset.p0.i64(ptr align 16 @vis, i8 0, i64 101, i1 false)
  br label %213

213:                                              ; preds = %332, %330, %212
  %214 = call noundef zeroext i1 @_ZNKSt14priority_queueISt4pairIiiESt6vectorIS1_SaIS1_EESt4lessIS1_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(25) @Q)
  %215 = xor i1 %214, true
  br i1 %215, label %216, label %333

216:                                              ; preds = %213
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #7
  %217 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNKSt14priority_queueISt4pairIiiESt6vectorIS1_SaIS1_EESt4lessIS1_EE3topEv(ptr noundef nonnull align 8 dereferenceable(25) @Q)
  %218 = getelementptr inbounds %"struct.std::pair", ptr %217, i32 0, i32 1
  %219 = load i32, ptr %218, align 4, !tbaa !16
  store i32 %219, ptr %13, align 4, !tbaa !5
  call void @_ZNSt14priority_queueISt4pairIiiESt6vectorIS1_SaIS1_EESt4lessIS1_EE3popEv(ptr noundef nonnull align 8 dereferenceable(25) @Q)
  %220 = load i32, ptr %13, align 4, !tbaa !5
  %221 = sext i32 %220 to i64
  %222 = getelementptr inbounds [101 x i8], ptr @vis, i64 0, i64 %221
  %223 = load i8, ptr %222, align 1, !tbaa !18, !range !20, !noundef !21
  %224 = trunc i8 %223 to i1
  br i1 %224, label %225, label %226

225:                                              ; preds = %216
  store i32 17, ptr %3, align 4
  br label %330, !llvm.loop !22

226:                                              ; preds = %216
  %227 = load i32, ptr %13, align 4, !tbaa !5
  %228 = sext i32 %227 to i64
  %229 = getelementptr inbounds [101 x i8], ptr @vis, i64 0, i64 %228
  store i8 1, ptr %229, align 1, !tbaa !18
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #7
  %230 = load i32, ptr %13, align 4, !tbaa !5
  %231 = sext i32 %230 to i64
  %232 = getelementptr inbounds [101 x i32], ptr @x, i64 0, i64 %231
  %233 = load i32, ptr %232, align 4, !tbaa !5
  store i32 %233, ptr %14, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #7
  %234 = load i32, ptr %13, align 4, !tbaa !5
  %235 = sext i32 %234 to i64
  %236 = getelementptr inbounds [101 x i32], ptr @y, i64 0, i64 %235
  %237 = load i32, ptr %236, align 4, !tbaa !5
  store i32 %237, ptr %15, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #7
  store i32 0, ptr %16, align 4, !tbaa !5
  br label %238

238:                                              ; preds = %326, %226
  %239 = load i32, ptr %16, align 4, !tbaa !5
  %240 = icmp slt i32 %239, 4
  br i1 %240, label %242, label %241

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

242:                                              ; preds = %238
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #7
  %243 = load i32, ptr %14, align 4, !tbaa !5
  %244 = load i32, ptr %16, align 4, !tbaa !5
  %245 = sext i32 %244 to i64
  %246 = getelementptr inbounds [4 x i32], ptr @_ZL2dx, i64 0, i64 %245
  %247 = load i32, ptr %246, align 4, !tbaa !5
  %248 = add nsw i32 %243, %247
  store i32 %248, ptr %17, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #7
  %249 = load i32, ptr %15, align 4, !tbaa !5
  %250 = load i32, ptr %16, align 4, !tbaa !5
  %251 = sext i32 %250 to i64
  %252 = getelementptr inbounds [4 x i32], ptr @_ZL2dy, i64 0, i64 %251
  %253 = load i32, ptr %252, align 4, !tbaa !5
  %254 = add nsw i32 %249, %253
  store i32 %254, ptr %18, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #7
  %255 = load i32, ptr %17, align 4, !tbaa !5
  %256 = sext i32 %255 to i64
  %257 = getelementptr inbounds [13 x [13 x i32]], ptr @pos, i64 0, i64 %256
  %258 = load i32, ptr %18, align 4, !tbaa !5
  %259 = sext i32 %258 to i64
  %260 = getelementptr inbounds [13 x i32], ptr %257, i64 0, i64 %259
  %261 = load i32, ptr %260, align 4, !tbaa !5
  store i32 %261, ptr %19, align 4, !tbaa !5
  %262 = load i32, ptr %19, align 4, !tbaa !5
  %263 = icmp eq i32 %262, -1
  br i1 %263, label %264, label %265

264:                                              ; preds = %242
  store i32 21, ptr %3, align 4
  br label %323

265:                                              ; preds = %242
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #7
  %266 = load i32, ptr %5, align 4, !tbaa !5
  %267 = load i32, ptr %19, align 4, !tbaa !5
  %268 = sext i32 %267 to i64
  %269 = getelementptr inbounds [101 x i32], ptr @s, i64 0, i64 %268
  %270 = load i32, ptr %269, align 4, !tbaa !5
  %271 = or i32 %266, %270
  store i32 %271, ptr %20, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #7
  %272 = load ptr, ptr %6, align 8, !tbaa !12
  %273 = load i32, ptr %13, align 4, !tbaa !5
  %274 = sext i32 %273 to i64
  %275 = getelementptr inbounds i32, ptr %272, i64 %274
  %276 = load i32, ptr %275, align 4, !tbaa !5
  %277 = load i32, ptr %19, align 4, !tbaa !5
  %278 = sext i32 %277 to i64
  %279 = getelementptr inbounds [101 x i32], ptr @w, i64 0, i64 %278
  %280 = load i32, ptr %279, align 4, !tbaa !5
  %281 = add nsw i32 %276, %280
  store i32 %281, ptr %21, align 4, !tbaa !5
  %282 = load i32, ptr %21, align 4, !tbaa !5
  %283 = load i32, ptr %20, align 4, !tbaa !5
  %284 = sext i32 %283 to i64
  %285 = getelementptr inbounds [1025 x [101 x i32]], ptr @f, i64 0, i64 %284
  %286 = load i32, ptr %19, align 4, !tbaa !5
  %287 = sext i32 %286 to i64
  %288 = getelementptr inbounds [101 x i32], ptr %285, i64 0, i64 %287
  %289 = load i32, ptr %288, align 4, !tbaa !5
  %290 = icmp slt i32 %282, %289
  br i1 %290, label %291, label %322

291:                                              ; preds = %265
  %292 = load i32, ptr %21, align 4, !tbaa !5
  %293 = load i32, ptr %20, align 4, !tbaa !5
  %294 = sext i32 %293 to i64
  %295 = getelementptr inbounds [1025 x [101 x i32]], ptr @f, i64 0, i64 %294
  %296 = load i32, ptr %19, align 4, !tbaa !5
  %297 = sext i32 %296 to i64
  %298 = getelementptr inbounds [101 x i32], ptr %295, i64 0, i64 %297
  store i32 %292, ptr %298, align 4, !tbaa !5
  %299 = load i32, ptr %13, align 4, !tbaa !5
  %300 = load i32, ptr @ctr, align 4, !tbaa !5
  %301 = shl i32 %299, %300
  %302 = load i32, ptr %5, align 4, !tbaa !5
  %303 = or i32 %301, %302
  %304 = load i32, ptr %20, align 4, !tbaa !5
  %305 = sext i32 %304 to i64
  %306 = getelementptr inbounds [1025 x [101 x i32]], ptr @g, i64 0, i64 %305
  %307 = load i32, ptr %19, align 4, !tbaa !5
  %308 = sext i32 %307 to i64
  %309 = getelementptr inbounds [101 x i32], ptr %306, i64 0, i64 %308
  store i32 %303, ptr %309, align 4, !tbaa !5
  %310 = load i32, ptr %5, align 4, !tbaa !5
  %311 = load i32, ptr %20, align 4, !tbaa !5
  %312 = icmp eq i32 %310, %311
  br i1 %312, label %313, label %321

313:                                              ; preds = %291
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #7
  %314 = load ptr, ptr %6, align 8, !tbaa !12
  %315 = load i32, ptr %19, align 4, !tbaa !5
  %316 = sext i32 %315 to i64
  %317 = getelementptr inbounds i32, ptr %314, i64 %316
  %318 = load i32, ptr %317, align 4, !tbaa !5
  %319 = sub nsw i32 0, %318
  store i32 %319, ptr %23, align 4, !tbaa !5
  %320 = call i64 @_ZSt9make_pairIiRiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %23, ptr noundef nonnull align 4 dereferenceable(4) %19)
  store i64 %320, ptr %22, align 4
  call void @_ZNSt14priority_queueISt4pairIiiESt6vectorIS1_SaIS1_EESt4lessIS1_EE4pushEOS1_(ptr noundef nonnull align 8 dereferenceable(25) @Q, ptr noundef nonnull align 4 dereferenceable(8) %22)
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #7
  br label %321

321:                                              ; preds = %313, %291
  br label %322

322:                                              ; preds = %321, %265
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #7
  store i32 0, ptr %3, align 4
  br label %323

323:                                              ; preds = %322, %264
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #7
  %324 = load i32, ptr %3, align 4
  switch i32 %324, label %416 [
    i32 0, label %325
    i32 21, label %326
  ]

325:                                              ; preds = %323
  br label %326

326:                                              ; preds = %325, %323
  %327 = load i32, ptr %16, align 4, !tbaa !5
  %328 = add nsw i32 %327, 1
  store i32 %328, ptr %16, align 4, !tbaa !5
  br label %238, !llvm.loop !23

329:                                              ; preds = %241
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #7
  store i32 0, ptr %3, align 4
  br label %330

330:                                              ; preds = %329, %225
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #7
  %331 = load i32, ptr %3, align 4
  switch i32 %331, label %416 [
    i32 0, label %332
    i32 17, label %213
  ]

332:                                              ; preds = %330
  br label %213, !llvm.loop !22

333:                                              ; preds = %213
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #7
  br label %334

334:                                              ; preds = %333
  %335 = load i32, ptr %5, align 4, !tbaa !5
  %336 = add nsw i32 %335, 1
  store i32 %336, ptr %5, align 4, !tbaa !5
  br label %91, !llvm.loop !24

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

338:                                              ; preds = %411, %337
  %339 = load i32, ptr %24, align 4, !tbaa !5
  %340 = load i32, ptr @tot, align 4, !tbaa !5
  %341 = icmp slt i32 %339, %340
  br i1 %341, label %343, label %342

342:                                              ; preds = %338
  store i32 22, ptr %3, align 4
  br label %414

343:                                              ; preds = %338
  %344 = load i32, ptr %24, align 4, !tbaa !5
  %345 = sext i32 %344 to i64
  %346 = getelementptr inbounds [101 x i32], ptr @s, i64 0, i64 %345
  %347 = load i32, ptr %346, align 4, !tbaa !5
  %348 = icmp ne i32 %347, 0
  br i1 %348, label %349, label %410

349:                                              ; preds = %343
  %350 = load i32, ptr @ctr, align 4, !tbaa !5
  %351 = shl i32 1, %350
  %352 = sub nsw i32 %351, 1
  %353 = sext i32 %352 to i64
  %354 = getelementptr inbounds [1025 x [101 x i32]], ptr @f, i64 0, i64 %353
  %355 = load i32, ptr %24, align 4, !tbaa !5
  %356 = sext i32 %355 to i64
  %357 = getelementptr inbounds [101 x i32], ptr %354, i64 0, i64 %356
  %358 = load i32, ptr %357, align 4, !tbaa !5
  %359 = call i32 (ptr, ...) @printf(ptr noundef @.str.3, i32 noundef %358)
  %360 = load i32, ptr @ctr, align 4, !tbaa !5
  %361 = shl i32 1, %360
  %362 = sub nsw i32 %361, 1
  %363 = load i32, ptr %24, align 4, !tbaa !5
  call void @_Z3dfsii(i32 noundef %362, i32 noundef %363)
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #7
  store i32 1, ptr %25, align 4, !tbaa !5
  br label %364

364:                                              ; preds = %406, %349
  %365 = load i32, ptr %25, align 4, !tbaa !5
  %366 = load i32, ptr @n, align 4, !tbaa !5
  %367 = icmp sle i32 %365, %366
  br i1 %367, label %369, label %368

368:                                              ; preds = %364
  store i32 25, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #7
  br label %409

369:                                              ; preds = %364
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #7
  store i32 1, ptr %26, align 4, !tbaa !5
  br label %370

370:                                              ; preds = %401, %369
  %371 = load i32, ptr %26, align 4, !tbaa !5
  %372 = load i32, ptr @m, align 4, !tbaa !5
  %373 = icmp sle i32 %371, %372
  br i1 %373, label %375, label %374

374:                                              ; preds = %370
  store i32 28, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #7
  br label %404

375:                                              ; preds = %370
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #7
  %376 = load i32, ptr %25, align 4, !tbaa !5
  %377 = sext i32 %376 to i64
  %378 = getelementptr inbounds [13 x [13 x i32]], ptr @pos, i64 0, i64 %377
  %379 = load i32, ptr %26, align 4, !tbaa !5
  %380 = sext i32 %379 to i64
  %381 = getelementptr inbounds [13 x i32], ptr %378, i64 0, i64 %380
  %382 = load i32, ptr %381, align 4, !tbaa !5
  store i32 %382, ptr %27, align 4, !tbaa !5
  %383 = load i32, ptr %27, align 4, !tbaa !5
  %384 = sext i32 %383 to i64
  %385 = getelementptr inbounds [101 x i32], ptr @s, i64 0, i64 %384
  %386 = load i32, ptr %385, align 4, !tbaa !5
  %387 = icmp ne i32 %386, 0
  br i1 %387, label %388, label %389

388:                                              ; preds = %375
  br label %397

389:                                              ; preds = %375
  %390 = load i32, ptr %27, align 4, !tbaa !5
  %391 = sext i32 %390 to i64
  %392 = getelementptr inbounds [101 x i8], ptr @used, i64 0, i64 %391
  %393 = load i8, ptr %392, align 1, !tbaa !18, !range !20, !noundef !21
  %394 = trunc i8 %393 to i1
  %395 = zext i1 %394 to i64
  %396 = select i1 %394, i8 111, i8 95
  br label %397

397:                                              ; preds = %389, %388
  %398 = phi i8 [ 120, %388 ], [ %396, %389 ]
  %399 = sext i8 %398 to i32
  %400 = call i32 @putchar(i32 noundef %399)
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #7
  br label %401

401:                                              ; preds = %397
  %402 = load i32, ptr %26, align 4, !tbaa !5
  %403 = add nsw i32 %402, 1
  store i32 %403, ptr %26, align 4, !tbaa !5
  br label %370, !llvm.loop !25

404:                                              ; preds = %374
  %405 = call i32 @putchar(i32 noundef 10)
  br label %406

406:                                              ; preds = %404
  %407 = load i32, ptr %25, align 4, !tbaa !5
  %408 = add nsw i32 %407, 1
  store i32 %408, ptr %25, align 4, !tbaa !5
  br label %364, !llvm.loop !26

409:                                              ; preds = %368
  store i32 22, ptr %3, align 4
  br label %414

410:                                              ; preds = %343
  br label %411

411:                                              ; preds = %410
  %412 = load i32, ptr %24, align 4, !tbaa !5
  %413 = add nsw i32 %412, 1
  store i32 %413, ptr %24, align 4, !tbaa !5
  br label %338, !llvm.loop !27

414:                                              ; preds = %409, %342
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #7
  br label %415

415:                                              ; preds = %414
  ret i32 0

416:                                              ; preds = %330, %323
  unreachable
}

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4

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

; 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: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNKSt14priority_queueISt4pairIiiESt6vectorIS1_SaIS1_EESt4lessIS1_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(25)) #5 align 2

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare i32 @putchar(i32 noundef) #6

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


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

%"class.std::priority_queue" = type <{ %"class.std::vector", [8 x i8] }>
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"struct.std::pair" = type { i32, i32 }

@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@tot = external dso_local local_unnamed_addr global i32, align 4
@ctr = external dso_local local_unnamed_addr global i32, align 4
@x = external dso_local local_unnamed_addr global [101 x i32], align 16
@y = external dso_local local_unnamed_addr global [101 x i32], align 16
@pos = external dso_local local_unnamed_addr global [13 x [13 x i32]], align 16
@s = external dso_local local_unnamed_addr global [101 x i32], align 16
@w = external dso_local global [101 x i32], align 16
@f = external dso_local local_unnamed_addr global [1025 x [101 x i32]], align 16
@g = external dso_local local_unnamed_addr global [1025 x [101 x i32]], align 16
@Q = external dso_local global %"class.std::priority_queue", align 8
@vis = external dso_local local_unnamed_addr global [101 x i8], align 16
@used = external dso_local local_unnamed_addr global [101 x i8], align 16
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [3 x i8], align 1
@_ZL2dx = external hidden local_unnamed_addr constant [4 x i32], align 16
@_ZL2dy = external hidden local_unnamed_addr constant [4 x i32], align 16
@.str.3 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z3dfsii(i32 noundef, 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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #2 {
  %1 = alloca i32, align 4
  %2 = alloca %"struct.std::pair", align 8
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca %"struct.std::pair", align 8
  %6 = alloca i32, align 4
  %7 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n, ptr noundef nonnull @m)
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(414100) @f, i8 63, i64 414100, i1 false)
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(414100) @g, i8 -1, i64 414100, i1 false)
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(676) @pos, i8 -1, i64 676, i1 false)
  %8 = load i32, ptr @n, align 4, !tbaa !5
  %.not97 = icmp slt i32 %8, 1
  %9 = load i32, ptr @m, align 4
  %10 = icmp slt i32 %9, 1
  %or.cond154 = select i1 %.not97, i1 true, i1 %10
  br i1 %or.cond154, label %.preheader91, label %.preheader92

.preheader92:                                     ; preds = %0, %._crit_edge
  %11 = phi i32 [ %23, %._crit_edge ], [ %8, %0 ]
  %12 = phi i32 [ %24, %._crit_edge ], [ %9, %0 ]
  %indvars.iv127 = phi i64 [ %indvars.iv.next128, %._crit_edge ], [ 1, %0 ]
  %.not8595 = icmp slt i32 %12, 1
  br i1 %.not8595, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %.preheader92
  %.pre = load i32, ptr @tot, align 4, !tbaa !5
  %13 = trunc nuw nsw i64 %indvars.iv127 to i32
  br label %26

.preheader91:                                     ; preds = %._crit_edge, %0
  %14 = load i32, ptr @ctr, align 4, !tbaa !5
  %.not = icmp eq i32 %14, 31
  br i1 %.not, label %.preheader87, label %.lr.ph112.preheader

.lr.ph112.preheader:                              ; preds = %.preheader91
  %15 = load i32, ptr @_ZL2dx, align 16
  %16 = load i32, ptr @_ZL2dy, align 16
  %17 = load i32, ptr getelementptr inbounds (i8, ptr @_ZL2dx, i64 4), align 4
  %18 = load i32, ptr getelementptr inbounds (i8, ptr @_ZL2dy, i64 4), align 4
  %19 = load i32, ptr getelementptr inbounds (i8, ptr @_ZL2dx, i64 8), align 8
  %20 = load i32, ptr getelementptr inbounds (i8, ptr @_ZL2dy, i64 8), align 8
  %21 = load i32, ptr getelementptr inbounds (i8, ptr @_ZL2dx, i64 12), align 4
  %22 = load i32, ptr getelementptr inbounds (i8, ptr @_ZL2dy, i64 12), align 4
  br label %.lr.ph112

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

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %.preheader92
  %23 = phi i32 [ %.pre145, %._crit_edge.loopexit ], [ %11, %.preheader92 ]
  %24 = phi i32 [ %48, %._crit_edge.loopexit ], [ %12, %.preheader92 ]
  %indvars.iv.next128 = add nuw nsw i64 %indvars.iv127, 1
  %25 = sext i32 %23 to i64
  %.not.not = icmp slt i64 %indvars.iv127, %25
  br i1 %.not.not, label %.preheader92, label %.preheader91, !llvm.loop !9

26:                                               ; preds = %.lr.ph, %42
  %27 = phi i32 [ %.pre, %.lr.ph ], [ %46, %42 ]
  %indvars.iv = phi i64 [ 1, %.lr.ph ], [ %indvars.iv.next, %42 ]
  %28 = sext i32 %27 to i64
  %29 = getelementptr inbounds i32, ptr @w, i64 %28
  %30 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %29)
  %31 = load i32, ptr @tot, align 4, !tbaa !5
  %32 = sext i32 %31 to i64
  %33 = getelementptr inbounds [101 x i32], ptr @w, i64 0, i64 %32
  %34 = load i32, ptr %33, align 4, !tbaa !5
  %.not86 = icmp eq i32 %34, 0
  br i1 %.not86, label %35, label %42

35:                                               ; preds = %26
  %36 = load i32, ptr @ctr, align 4, !tbaa !5
  %37 = add nsw i32 %36, 1
  store i32 %37, ptr @ctr, align 4, !tbaa !5
  %38 = shl nuw i32 1, %36
  %39 = getelementptr inbounds [101 x i32], ptr @s, i64 0, i64 %32
  store i32 %38, ptr %39, align 4, !tbaa !5
  %40 = sext i32 %38 to i64
  %41 = getelementptr inbounds [1025 x [101 x i32]], ptr @f, i64 0, i64 %40, i64 %32
  store i32 0, ptr %41, align 4, !tbaa !5
  br label %42

42:                                               ; preds = %35, %26
  %43 = getelementptr inbounds [101 x i32], ptr @x, i64 0, i64 %32
  store i32 %13, ptr %43, align 4, !tbaa !5
  %44 = getelementptr inbounds [101 x i32], ptr @y, i64 0, i64 %32
  %45 = trunc nuw nsw i64 %indvars.iv to i32
  store i32 %45, ptr %44, align 4, !tbaa !5
  %46 = add nsw i32 %31, 1
  store i32 %46, ptr @tot, align 4, !tbaa !5
  %47 = getelementptr inbounds [13 x [13 x i32]], ptr @pos, i64 0, i64 %indvars.iv127, i64 %indvars.iv
  store i32 %31, ptr %47, align 4, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %48 = load i32, ptr @m, align 4, !tbaa !5
  %49 = sext i32 %48 to i64
  %.not85.not = icmp slt i64 %indvars.iv, %49
  br i1 %.not85.not, label %26, label %._crit_edge.loopexit, !llvm.loop !12

.preheader87:                                     ; preds = %._crit_edge110, %.preheader91
  %.lcssa94 = phi i32 [ 31, %.preheader91 ], [ %249, %._crit_edge110 ]
  %50 = load i32, ptr @tot, align 4, !tbaa !5
  %51 = icmp sgt i32 %50, 0
  br i1 %51, label %.lr.ph114.preheader, label %.loopexit

.lr.ph114.preheader:                              ; preds = %.preheader87
  %wide.trip.count = zext nneg i32 %50 to i64
  br label %.lr.ph114

.lr.ph112:                                        ; preds = %.lr.ph112.preheader, %._crit_edge110
  %indvars.iv133 = phi i64 [ 0, %.lr.ph112.preheader ], [ %indvars.iv.next134, %._crit_edge110 ]
  %52 = getelementptr inbounds [1025 x [101 x i32]], ptr @f, i64 0, i64 %indvars.iv133
  %53 = getelementptr inbounds [1025 x [101 x i32]], ptr @g, i64 0, i64 %indvars.iv133
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #7
  store i32 0, ptr %1, align 4, !tbaa !5
  %54 = load i32, ptr @tot, align 4, !tbaa !5
  %55 = icmp sgt i32 %54, 0
  br i1 %55, label %.lr.ph105, label %._crit_edge106

.lr.ph105:                                        ; preds = %.lr.ph112
  %.not8499 = icmp eq i64 %indvars.iv133, 0
  %56 = trunc nuw nsw i64 %indvars.iv133 to i32
  br label %62

._crit_edge106:                                   ; preds = %99, %.lr.ph112
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #7
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(101) @vis, i8 0, i64 101, i1 false)
  %57 = call noundef zeroext i1 @_ZNKSt14priority_queueISt4pairIiiESt6vectorIS1_SaIS1_EESt4lessIS1_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(25) @Q)
  br i1 %57, label %._crit_edge110, label %.lr.ph109.preheader

.lr.ph109.preheader:                              ; preds = %._crit_edge106
  %58 = trunc nuw nsw i64 %indvars.iv133 to i32
  %59 = trunc nuw nsw i64 %indvars.iv133 to i32
  %60 = trunc nuw nsw i64 %indvars.iv133 to i32
  %61 = trunc nuw nsw i64 %indvars.iv133 to i32
  br label %.lr.ph109

62:                                               ; preds = %.lr.ph105, %99
  %63 = phi i32 [ %54, %.lr.ph105 ], [ %100, %99 ]
  %storemerge103 = phi i32 [ 0, %.lr.ph105 ], [ %102, %99 ]
  %64 = sext i32 %storemerge103 to i64
  %65 = getelementptr inbounds [101 x i32], ptr @s, i64 0, i64 %64
  %66 = load i32, ptr %65, align 4, !tbaa !5
  %.not82 = icmp ne i32 %66, 0
  %67 = and i32 %66, %56
  %.not83 = icmp eq i32 %67, 0
  %or.cond = and i1 %.not82, %.not83
  br i1 %or.cond, label %99, label %.preheader90

.preheader90:                                     ; preds = %62
  br i1 %.not8499, label %.preheader90.._crit_edge102_crit_edge, label %.lr.ph101

.preheader90.._crit_edge102_crit_edge:            ; preds = %.preheader90
  %.phi.trans.insert = getelementptr inbounds i32, ptr %52, i64 %64
  %.pre146 = load i32, ptr %.phi.trans.insert, align 4, !tbaa !5
  br label %._crit_edge102

.lr.ph101:                                        ; preds = %.preheader90
  %68 = getelementptr inbounds [101 x i32], ptr @w, i64 0, i64 %64
  %69 = load i32, ptr %68, align 4, !tbaa !5
  %70 = getelementptr inbounds i32, ptr %52, i64 %64
  %71 = load i32, ptr @ctr, align 4
  %72 = shl i32 %storemerge103, %71
  %73 = getelementptr inbounds i32, ptr %53, i64 %64
  %.promoted = load i32, ptr %70, align 4, !tbaa !5
  br label %76

._crit_edge102:                                   ; preds = %92, %.preheader90.._crit_edge102_crit_edge
  %74 = phi i32 [ %.pre146, %.preheader90.._crit_edge102_crit_edge ], [ %93, %92 ]
  %75 = icmp slt i32 %74, 1061109567
  br i1 %75, label %96, label %99

76:                                               ; preds = %.lr.ph101, %92
  %77 = phi i32 [ %.promoted, %.lr.ph101 ], [ %93, %92 ]
  %.070100 = phi i32 [ %56, %.lr.ph101 ], [ %95, %92 ]
  %78 = or i32 %.070100, %66
  %79 = sext i32 %78 to i64
  %80 = getelementptr inbounds [1025 x [101 x i32]], ptr @f, i64 0, i64 %79, i64 %64
  %81 = load i32, ptr %80, align 4, !tbaa !5
  %82 = xor i32 %.070100, %56
  %83 = or i32 %82, %66
  %84 = sext i32 %83 to i64
  %85 = getelementptr inbounds [1025 x [101 x i32]], ptr @f, i64 0, i64 %84, i64 %64
  %86 = load i32, ptr %85, align 4, !tbaa !5
  %87 = add nsw i32 %86, %81
  %88 = sub i32 %87, %69
  %89 = icmp slt i32 %88, %77
  br i1 %89, label %90, label %92

90:                                               ; preds = %76
  store i32 %88, ptr %70, align 4, !tbaa !5
  %91 = or i32 %72, %.070100
  store i32 %91, ptr %73, align 4, !tbaa !5
  br label %92

92:                                               ; preds = %90, %76
  %93 = phi i32 [ %88, %90 ], [ %77, %76 ]
  %94 = add nuw i32 %.070100, 2147483647
  %95 = and i32 %94, %56
  %.not84 = icmp eq i32 %95, 0
  br i1 %.not84, label %._crit_edge102, label %76, !llvm.loop !13

96:                                               ; preds = %._crit_edge102
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #7
  %97 = sub nsw i32 0, %74
  store i32 %97, ptr %3, align 4, !tbaa !5
  %98 = call i64 @_ZSt9make_pairIiRiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %3, ptr noundef nonnull align 4 dereferenceable(4) %1)
  store i64 %98, ptr %2, align 8
  call void @_ZNSt14priority_queueISt4pairIiiESt6vectorIS1_SaIS1_EESt4lessIS1_EE4pushEOS1_(ptr noundef nonnull align 8 dereferenceable(25) @Q, ptr noundef nonnull align 4 dereferenceable(8) %2)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #7
  %.pre147 = load i32, ptr %1, align 4, !tbaa !5
  %.pre148 = load i32, ptr @tot, align 4, !tbaa !5
  br label %99

99:                                               ; preds = %62, %._crit_edge102, %96
  %100 = phi i32 [ %63, %62 ], [ %63, %._crit_edge102 ], [ %.pre148, %96 ]
  %101 = phi i32 [ %storemerge103, %62 ], [ %storemerge103, %._crit_edge102 ], [ %.pre147, %96 ]
  %102 = add nsw i32 %101, 1
  store i32 %102, ptr %1, align 4, !tbaa !5
  %103 = icmp slt i32 %102, %100
  br i1 %103, label %62, label %._crit_edge106, !llvm.loop !14

.lr.ph109:                                        ; preds = %.lr.ph109.preheader, %.loopexit89
  %104 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNKSt14priority_queueISt4pairIiiESt6vectorIS1_SaIS1_EESt4lessIS1_EE3topEv(ptr noundef nonnull align 8 dereferenceable(25) @Q)
  %105 = getelementptr inbounds i8, ptr %104, i64 4
  %106 = load i32, ptr %105, align 4, !tbaa !15
  call void @_ZNSt14priority_queueISt4pairIiiESt6vectorIS1_SaIS1_EESt4lessIS1_EE3popEv(ptr noundef nonnull align 8 dereferenceable(25) @Q)
  %107 = sext i32 %106 to i64
  %108 = getelementptr inbounds [101 x i8], ptr @vis, i64 0, i64 %107
  %109 = load i8, ptr %108, align 1, !tbaa !17, !range !19, !noundef !20
  %110 = trunc nuw i8 %109 to i1
  br i1 %110, label %.loopexit89, label %111, !llvm.loop !21

111:                                              ; preds = %.lr.ph109
  store i8 1, ptr %108, align 1, !tbaa !17
  %112 = getelementptr inbounds [101 x i32], ptr @x, i64 0, i64 %107
  %113 = load i32, ptr %112, align 4, !tbaa !5
  %114 = getelementptr inbounds [101 x i32], ptr @y, i64 0, i64 %107
  %115 = load i32, ptr %114, align 4, !tbaa !5
  %116 = getelementptr inbounds i32, ptr %52, i64 %107
  %117 = add nsw i32 %15, %113
  %118 = add nsw i32 %16, %115
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #7
  %119 = sext i32 %117 to i64
  %120 = sext i32 %118 to i64
  %121 = getelementptr inbounds [13 x [13 x i32]], ptr @pos, i64 0, i64 %119, i64 %120
  %122 = load i32, ptr %121, align 4, !tbaa !5
  store i32 %122, ptr %4, align 4, !tbaa !5
  %123 = icmp eq i32 %122, -1
  br i1 %123, label %149, label %124

124:                                              ; preds = %111
  %125 = sext i32 %122 to i64
  %126 = getelementptr inbounds [101 x i32], ptr @s, i64 0, i64 %125
  %127 = load i32, ptr %126, align 4, !tbaa !5
  %128 = or i32 %127, %58
  %129 = load i32, ptr %116, align 4, !tbaa !5
  %130 = getelementptr inbounds [101 x i32], ptr @w, i64 0, i64 %125
  %131 = load i32, ptr %130, align 4, !tbaa !5
  %132 = add nsw i32 %131, %129
  %133 = sext i32 %128 to i64
  %134 = getelementptr inbounds [1025 x [101 x i32]], ptr @f, i64 0, i64 %133, i64 %125
  %135 = load i32, ptr %134, align 4, !tbaa !5
  %136 = icmp slt i32 %132, %135
  br i1 %136, label %137, label %149

137:                                              ; preds = %124
  store i32 %132, ptr %134, align 4, !tbaa !5
  %138 = load i32, ptr @ctr, align 4, !tbaa !5
  %139 = shl i32 %106, %138
  %140 = or i32 %139, %58
  %141 = getelementptr inbounds [1025 x [101 x i32]], ptr @g, i64 0, i64 %133, i64 %125
  store i32 %140, ptr %141, align 4, !tbaa !5
  %142 = zext i32 %128 to i64
  %143 = icmp eq i64 %indvars.iv133, %142
  br i1 %143, label %144, label %149

144:                                              ; preds = %137
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #7
  %145 = getelementptr inbounds i32, ptr %52, i64 %125
  %146 = load i32, ptr %145, align 4, !tbaa !5
  %147 = sub nsw i32 0, %146
  store i32 %147, ptr %6, align 4, !tbaa !5
  %148 = 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) %4)
  store i64 %148, ptr %5, align 8
  call void @_ZNSt14priority_queueISt4pairIiiESt6vectorIS1_SaIS1_EESt4lessIS1_EE4pushEOS1_(ptr noundef nonnull align 8 dereferenceable(25) @Q, ptr noundef nonnull align 4 dereferenceable(8) %5)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #7
  br label %149

149:                                              ; preds = %124, %144, %137, %111
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #7
  %150 = add nsw i32 %17, %113
  %151 = add nsw i32 %18, %115
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #7
  %152 = sext i32 %150 to i64
  %153 = sext i32 %151 to i64
  %154 = getelementptr inbounds [13 x [13 x i32]], ptr @pos, i64 0, i64 %152, i64 %153
  %155 = load i32, ptr %154, align 4, !tbaa !5
  store i32 %155, ptr %4, align 4, !tbaa !5
  %156 = icmp eq i32 %155, -1
  br i1 %156, label %182, label %157

157:                                              ; preds = %149
  %158 = sext i32 %155 to i64
  %159 = getelementptr inbounds [101 x i32], ptr @s, i64 0, i64 %158
  %160 = load i32, ptr %159, align 4, !tbaa !5
  %161 = or i32 %160, %59
  %162 = load i32, ptr %116, align 4, !tbaa !5
  %163 = getelementptr inbounds [101 x i32], ptr @w, i64 0, i64 %158
  %164 = load i32, ptr %163, align 4, !tbaa !5
  %165 = add nsw i32 %164, %162
  %166 = sext i32 %161 to i64
  %167 = getelementptr inbounds [1025 x [101 x i32]], ptr @f, i64 0, i64 %166, i64 %158
  %168 = load i32, ptr %167, align 4, !tbaa !5
  %169 = icmp slt i32 %165, %168
  br i1 %169, label %170, label %182

170:                                              ; preds = %157
  store i32 %165, ptr %167, align 4, !tbaa !5
  %171 = load i32, ptr @ctr, align 4, !tbaa !5
  %172 = shl i32 %106, %171
  %173 = or i32 %172, %59
  %174 = getelementptr inbounds [1025 x [101 x i32]], ptr @g, i64 0, i64 %166, i64 %158
  store i32 %173, ptr %174, align 4, !tbaa !5
  %175 = zext i32 %161 to i64
  %176 = icmp eq i64 %indvars.iv133, %175
  br i1 %176, label %177, label %182

177:                                              ; preds = %170
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #7
  %178 = getelementptr inbounds i32, ptr %52, i64 %158
  %179 = load i32, ptr %178, align 4, !tbaa !5
  %180 = sub nsw i32 0, %179
  store i32 %180, ptr %6, align 4, !tbaa !5
  %181 = 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) %4)
  store i64 %181, ptr %5, align 8
  call void @_ZNSt14priority_queueISt4pairIiiESt6vectorIS1_SaIS1_EESt4lessIS1_EE4pushEOS1_(ptr noundef nonnull align 8 dereferenceable(25) @Q, ptr noundef nonnull align 4 dereferenceable(8) %5)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #7
  br label %182

182:                                              ; preds = %177, %170, %157, %149
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #7
  %183 = add nsw i32 %19, %113
  %184 = add nsw i32 %20, %115
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #7
  %185 = sext i32 %183 to i64
  %186 = sext i32 %184 to i64
  %187 = getelementptr inbounds [13 x [13 x i32]], ptr @pos, i64 0, i64 %185, i64 %186
  %188 = load i32, ptr %187, align 4, !tbaa !5
  store i32 %188, ptr %4, align 4, !tbaa !5
  %189 = icmp eq i32 %188, -1
  br i1 %189, label %215, label %190

190:                                              ; preds = %182
  %191 = sext i32 %188 to i64
  %192 = getelementptr inbounds [101 x i32], ptr @s, i64 0, i64 %191
  %193 = load i32, ptr %192, align 4, !tbaa !5
  %194 = or i32 %193, %60
  %195 = load i32, ptr %116, align 4, !tbaa !5
  %196 = getelementptr inbounds [101 x i32], ptr @w, i64 0, i64 %191
  %197 = load i32, ptr %196, align 4, !tbaa !5
  %198 = add nsw i32 %197, %195
  %199 = sext i32 %194 to i64
  %200 = getelementptr inbounds [1025 x [101 x i32]], ptr @f, i64 0, i64 %199, i64 %191
  %201 = load i32, ptr %200, align 4, !tbaa !5
  %202 = icmp slt i32 %198, %201
  br i1 %202, label %203, label %215

203:                                              ; preds = %190
  store i32 %198, ptr %200, align 4, !tbaa !5
  %204 = load i32, ptr @ctr, align 4, !tbaa !5
  %205 = shl i32 %106, %204
  %206 = or i32 %205, %60
  %207 = getelementptr inbounds [1025 x [101 x i32]], ptr @g, i64 0, i64 %199, i64 %191
  store i32 %206, ptr %207, align 4, !tbaa !5
  %208 = zext i32 %194 to i64
  %209 = icmp eq i64 %indvars.iv133, %208
  br i1 %209, label %210, label %215

210:                                              ; preds = %203
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #7
  %211 = getelementptr inbounds i32, ptr %52, i64 %191
  %212 = load i32, ptr %211, align 4, !tbaa !5
  %213 = sub nsw i32 0, %212
  store i32 %213, ptr %6, align 4, !tbaa !5
  %214 = 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) %4)
  store i64 %214, ptr %5, align 8
  call void @_ZNSt14priority_queueISt4pairIiiESt6vectorIS1_SaIS1_EESt4lessIS1_EE4pushEOS1_(ptr noundef nonnull align 8 dereferenceable(25) @Q, ptr noundef nonnull align 4 dereferenceable(8) %5)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #7
  br label %215

215:                                              ; preds = %210, %203, %190, %182
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #7
  %216 = add nsw i32 %21, %113
  %217 = add nsw i32 %22, %115
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #7
  %218 = sext i32 %216 to i64
  %219 = sext i32 %217 to i64
  %220 = getelementptr inbounds [13 x [13 x i32]], ptr @pos, i64 0, i64 %218, i64 %219
  %221 = load i32, ptr %220, align 4, !tbaa !5
  store i32 %221, ptr %4, align 4, !tbaa !5
  %222 = icmp eq i32 %221, -1
  br i1 %222, label %.loopexit89.loopexit, label %223

223:                                              ; preds = %215
  %224 = sext i32 %221 to i64
  %225 = getelementptr inbounds [101 x i32], ptr @s, i64 0, i64 %224
  %226 = load i32, ptr %225, align 4, !tbaa !5
  %227 = or i32 %226, %61
  %228 = load i32, ptr %116, align 4, !tbaa !5
  %229 = getelementptr inbounds [101 x i32], ptr @w, i64 0, i64 %224
  %230 = load i32, ptr %229, align 4, !tbaa !5
  %231 = add nsw i32 %230, %228
  %232 = sext i32 %227 to i64
  %233 = getelementptr inbounds [1025 x [101 x i32]], ptr @f, i64 0, i64 %232, i64 %224
  %234 = load i32, ptr %233, align 4, !tbaa !5
  %235 = icmp slt i32 %231, %234
  br i1 %235, label %236, label %.loopexit89.loopexit

236:                                              ; preds = %223
  store i32 %231, ptr %233, align 4, !tbaa !5
  %237 = load i32, ptr @ctr, align 4, !tbaa !5
  %238 = shl i32 %106, %237
  %239 = or i32 %238, %61
  %240 = getelementptr inbounds [1025 x [101 x i32]], ptr @g, i64 0, i64 %232, i64 %224
  store i32 %239, ptr %240, align 4, !tbaa !5
  %241 = zext i32 %227 to i64
  %242 = icmp eq i64 %indvars.iv133, %241
  br i1 %242, label %243, label %.loopexit89.loopexit

243:                                              ; preds = %236
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #7
  %244 = getelementptr inbounds i32, ptr %52, i64 %224
  %245 = load i32, ptr %244, align 4, !tbaa !5
  %246 = sub nsw i32 0, %245
  store i32 %246, ptr %6, align 4, !tbaa !5
  %247 = 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) %4)
  store i64 %247, ptr %5, align 8
  call void @_ZNSt14priority_queueISt4pairIiiESt6vectorIS1_SaIS1_EESt4lessIS1_EE4pushEOS1_(ptr noundef nonnull align 8 dereferenceable(25) @Q, ptr noundef nonnull align 4 dereferenceable(8) %5)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #7
  br label %.loopexit89.loopexit

.loopexit89.loopexit:                             ; preds = %243, %236, %223, %215
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #7
  br label %.loopexit89

.loopexit89:                                      ; preds = %.loopexit89.loopexit, %.lr.ph109
  %248 = call noundef zeroext i1 @_ZNKSt14priority_queueISt4pairIiiESt6vectorIS1_SaIS1_EESt4lessIS1_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(25) @Q)
  br i1 %248, label %._crit_edge110, label %.lr.ph109

._crit_edge110:                                   ; preds = %.loopexit89, %._crit_edge106
  %indvars.iv.next134 = add nuw nsw i64 %indvars.iv133, 1
  %249 = load i32, ptr @ctr, align 4, !tbaa !5
  %250 = shl nuw i32 1, %249
  %251 = sext i32 %250 to i64
  %252 = icmp slt i64 %indvars.iv.next134, %251
  br i1 %252, label %.lr.ph112, label %.preheader87, !llvm.loop !22

.lr.ph114:                                        ; preds = %.lr.ph114.preheader, %284
  %indvars.iv136 = phi i64 [ 0, %.lr.ph114.preheader ], [ %indvars.iv.next137, %284 ]
  %253 = getelementptr inbounds [101 x i32], ptr @s, i64 0, i64 %indvars.iv136
  %254 = load i32, ptr %253, align 4, !tbaa !5
  %.not77 = icmp eq i32 %254, 0
  br i1 %.not77, label %284, label %255

255:                                              ; preds = %.lr.ph114
  %256 = trunc nuw nsw i64 %indvars.iv136 to i32
  %notmask = shl nsw i32 -1, %.lcssa94
  %257 = xor i32 %notmask, -1
  %258 = zext nneg i32 %257 to i64
  %259 = getelementptr inbounds [1025 x [101 x i32]], ptr @f, i64 0, i64 %258, i64 %indvars.iv136
  %260 = load i32, ptr %259, align 4, !tbaa !5
  %261 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %260)
  %262 = load i32, ptr @ctr, align 4, !tbaa !5
  %notmask78 = shl nsw i32 -1, %262
  %263 = xor i32 %notmask78, -1
  call void @_Z3dfsii(i32 noundef %263, i32 noundef %256)
  %264 = load i32, ptr @n, align 4, !tbaa !5
  %.not79119 = icmp slt i32 %264, 1
  br i1 %.not79119, label %.loopexit, label %.preheader

.preheader:                                       ; preds = %255, %._crit_edge118
  %indvars.iv142 = phi i64 [ %indvars.iv.next143, %._crit_edge118 ], [ 1, %255 ]
  %265 = load i32, ptr @m, align 4, !tbaa !5
  %.not80115 = icmp slt i32 %265, 1
  br i1 %.not80115, label %._crit_edge118, label %.lr.ph117

._crit_edge118:                                   ; preds = %279, %.preheader
  %266 = call i32 @putchar(i32 noundef 10)
  %indvars.iv.next143 = add nuw nsw i64 %indvars.iv142, 1
  %267 = load i32, ptr @n, align 4, !tbaa !5
  %268 = sext i32 %267 to i64
  %.not79.not = icmp slt i64 %indvars.iv142, %268
  br i1 %.not79.not, label %.preheader, label %.loopexit, !llvm.loop !23

.lr.ph117:                                        ; preds = %.preheader, %279
  %indvars.iv139 = phi i64 [ %indvars.iv.next140, %279 ], [ 1, %.preheader ]
  %269 = getelementptr inbounds [13 x [13 x i32]], ptr @pos, i64 0, i64 %indvars.iv142, i64 %indvars.iv139
  %270 = load i32, ptr %269, align 4, !tbaa !5
  %271 = sext i32 %270 to i64
  %272 = getelementptr inbounds [101 x i32], ptr @s, i64 0, i64 %271
  %273 = load i32, ptr %272, align 4, !tbaa !5
  %.not81 = icmp eq i32 %273, 0
  br i1 %.not81, label %274, label %279

274:                                              ; preds = %.lr.ph117
  %275 = getelementptr inbounds [101 x i8], ptr @used, i64 0, i64 %271
  %276 = load i8, ptr %275, align 1, !tbaa !17, !range !19, !noundef !20
  %277 = trunc nuw i8 %276 to i1
  %278 = select i1 %277, i32 111, i32 95
  br label %279

279:                                              ; preds = %.lr.ph117, %274
  %280 = phi i32 [ %278, %274 ], [ 120, %.lr.ph117 ]
  %281 = call i32 @putchar(i32 noundef %280)
  %indvars.iv.next140 = add nuw nsw i64 %indvars.iv139, 1
  %282 = load i32, ptr @m, align 4, !tbaa !5
  %283 = sext i32 %282 to i64
  %.not80.not = icmp slt i64 %indvars.iv139, %283
  br i1 %.not80.not, label %.lr.ph117, label %._crit_edge118, !llvm.loop !24

284:                                              ; preds = %.lr.ph114
  %indvars.iv.next137 = add nuw nsw i64 %indvars.iv136, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next137, %wide.trip.count
  br i1 %exitcond.not, label %.loopexit, label %.lr.ph114, !llvm.loop !25

.loopexit:                                        ; preds = %284, %._crit_edge118, %.preheader87, %255
  ret i32 0
}

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

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4

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

; 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 nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNKSt14priority_queueISt4pairIiiESt6vectorIS1_SaIS1_EESt4lessIS1_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(25)) local_unnamed_addr #5 align 2

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

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

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

; Function Attrs: inlinehint mustprogress nofree nounwind uwtable
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #6

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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #5 = { 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 #6 = { inlinehint mustprogress nofree 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, !11}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.unswitch.partial.disable"}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
!15 = !{!16, !6, i64 4}
!16 = !{!"_ZTSSt4pairIiiE", !6, i64 0, !6, i64 4}
!17 = !{!18, !18, i64 0}
!18 = !{!"bool", !7, i64 0}
!19 = !{i8 0, i8 2}
!20 = !{}
!21 = distinct !{!21, !10}
!22 = distinct !{!22, !10}
!23 = distinct !{!23, !10}
!24 = distinct !{!24, !10}
!25 = distinct !{!25, !10}


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