; LLVM IR from tangjz/acm-icpc :: codeforces/gym (101174I)

; 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::map" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<std::pair<int, int>, std::pair<const std::pair<int, int>, int>, std::_Select1st<std::pair<const std::pair<int, int>, int>>, std::less<std::pair<int, int>>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<std::pair<int, int>, std::pair<const std::pair<int, int>, int>, std::_Select1st<std::pair<const std::pair<int, int>, int>>, std::less<std::pair<int, int>>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::_Rb_tree_header" = type { %"struct.std::_Rb_tree_node_base", i64 }
%"struct.std::_Rb_tree_node_base" = type { i32, ptr, ptr, ptr }
%"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::_Rb_tree_iterator" = type { ptr }
%"struct.std::pair.3" = type { i32, i32 }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }
%"struct.std::pair" = type { %"struct.std::pair.3", 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
@S = external dso_local global i32, align 4
@T = external dso_local global i32, align 4
@inv = external dso_local global [13 x i32], align 16
@f = external dso_local global [501 x [203 x i32]], align 16
@dis = external dso_local global [203 x i32], align 16
@sp = external dso_local global %"class.std::map", align 8
@e = external dso_local global [203 x %"class.std::vector"], align 16
@vis = external dso_local global [203 x i8], align 16
@.str = external hidden unnamed_addr constant [9 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, 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 %"struct.std::_Rb_tree_iterator", align 8
  %20 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %21 = alloca i32, align 4
  %22 = alloca i32, align 4
  %23 = alloca i32, align 4
  %24 = alloca %"struct.std::pair.3", align 4
  %25 = alloca %"struct.std::pair.3", align 4
  %26 = alloca i32, align 4
  %27 = alloca i32, align 4
  %28 = alloca i32, align 4
  %29 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %30 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %31 = alloca i32, align 4
  %32 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  store i32 1, ptr getelementptr inbounds ([13 x i32], ptr @inv, i64 0, i64 1), align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #8
  store i32 2, ptr %2, align 4, !tbaa !5
  br label %33

33:                                               ; preds = %51, %0
  %34 = load i32, ptr %2, align 4, !tbaa !5
  %35 = icmp slt i32 %34, 13
  br i1 %35, label %37, label %36

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

37:                                               ; preds = %33
  %38 = load i32, ptr %2, align 4, !tbaa !5
  %39 = sdiv i32 13, %38
  %40 = load i32, ptr %2, align 4, !tbaa !5
  %41 = srem i32 13, %40
  %42 = sext i32 %41 to i64
  %43 = getelementptr inbounds [13 x i32], ptr @inv, i64 0, i64 %42
  %44 = load i32, ptr %43, align 4, !tbaa !5
  %45 = mul nsw i32 %39, %44
  %46 = srem i32 %45, 13
  %47 = sub nsw i32 13, %46
  %48 = load i32, ptr %2, align 4, !tbaa !5
  %49 = sext i32 %48 to i64
  %50 = getelementptr inbounds [13 x i32], ptr @inv, i64 0, i64 %49
  store i32 %47, ptr %50, align 4, !tbaa !5
  br label %51

51:                                               ; preds = %37
  %52 = load i32, ptr %2, align 4, !tbaa !5
  %53 = add nsw i32 %52, 1
  store i32 %53, ptr %2, align 4, !tbaa !5
  br label %33, !llvm.loop !9

54:                                               ; preds = %36
  %55 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @n, ptr noundef @S, ptr noundef @T, ptr noundef @m)
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #8
  store i32 0, ptr %3, align 4, !tbaa !5
  br label %56

56:                                               ; preds = %90, %54
  %57 = load i32, ptr %3, align 4, !tbaa !5
  %58 = load i32, ptr @m, align 4, !tbaa !5
  %59 = icmp slt i32 %57, %58
  br i1 %59, label %61, label %60

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

61:                                               ; preds = %56
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #8
  store i32 -1, ptr %5, align 4, !tbaa !5
  %62 = load i32, ptr %3, align 4, !tbaa !5
  %63 = sext i32 %62 to i64
  %64 = getelementptr inbounds [501 x [203 x i32]], ptr @f, i64 0, i64 %63
  %65 = getelementptr inbounds [203 x i32], ptr %64, i64 0, i64 0
  %66 = getelementptr inbounds i32, ptr %65, i64 202
  %67 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.2, ptr noundef %66, ptr noundef %4)
  br label %68

68:                                               ; preds = %87, %61
  %69 = load i32, ptr %4, align 4, !tbaa !5
  %70 = add nsw i32 %69, -1
  store i32 %70, ptr %4, align 4, !tbaa !5
  %71 = icmp ne i32 %69, 0
  br i1 %71, label %72, label %89

72:                                               ; preds = %68
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #8
  %73 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.3, ptr noundef %6)
  %74 = load i32, ptr %5, align 4, !tbaa !5
  %75 = icmp ne i32 %74, -1
  br i1 %75, label %76, label %87

76:                                               ; preds = %72
  %77 = load i32, ptr %3, align 4, !tbaa !5
  %78 = sext i32 %77 to i64
  %79 = getelementptr inbounds [501 x [203 x i32]], ptr @f, i64 0, i64 %78
  %80 = load i32, ptr %5, align 4, !tbaa !5
  %81 = load i32, ptr %6, align 4, !tbaa !5
  %82 = call noundef i32 @_Z5getIDii(i32 noundef %80, i32 noundef %81)
  %83 = sext i32 %82 to i64
  %84 = getelementptr inbounds [203 x i32], ptr %79, i64 0, i64 %83
  %85 = load i32, ptr %84, align 4, !tbaa !5
  %86 = add nsw i32 %85, 1
  store i32 %86, ptr %84, align 4, !tbaa !5
  br label %87

87:                                               ; preds = %76, %72
  %88 = load i32, ptr %6, align 4, !tbaa !5
  store i32 %88, ptr %5, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #8
  br label %68, !llvm.loop !11

89:                                               ; preds = %68
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #8
  br label %90

90:                                               ; preds = %89
  %91 = load i32, ptr %3, align 4, !tbaa !5
  %92 = add nsw i32 %91, 1
  store i32 %92, ptr %3, align 4, !tbaa !5
  br label %56, !llvm.loop !12

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

94:                                               ; preds = %130, %93
  %95 = load i32, ptr %7, align 4, !tbaa !5
  %96 = load i32, ptr @m, align 4, !tbaa !5
  %97 = icmp slt i32 %95, %96
  br i1 %97, label %99, label %98

98:                                               ; preds = %94
  store i32 10, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #8
  br label %133

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

100:                                              ; preds = %114, %99
  %101 = load i32, ptr %9, align 4, !tbaa !5
  %102 = load i32, ptr @tot, align 4, !tbaa !5
  %103 = icmp slt i32 %101, %102
  br i1 %103, label %105, label %104

104:                                              ; preds = %100
  store i32 13, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #8
  br label %117

105:                                              ; preds = %100
  %106 = load i32, ptr %7, align 4, !tbaa !5
  %107 = sext i32 %106 to i64
  %108 = getelementptr inbounds [501 x [203 x i32]], ptr @f, i64 0, i64 %107
  %109 = load i32, ptr %9, align 4, !tbaa !5
  %110 = sext i32 %109 to i64
  %111 = getelementptr inbounds [203 x i32], ptr %108, i64 0, i64 %110
  %112 = load i32, ptr %111, align 4, !tbaa !5
  %113 = srem i32 %112, 13
  store i32 %113, ptr %111, align 4, !tbaa !5
  br label %114

114:                                              ; preds = %105
  %115 = load i32, ptr %9, align 4, !tbaa !5
  %116 = add nsw i32 %115, 1
  store i32 %116, ptr %9, align 4, !tbaa !5
  br label %100, !llvm.loop !13

117:                                              ; preds = %104
  %118 = load i32, ptr %7, align 4, !tbaa !5
  %119 = sext i32 %118 to i64
  %120 = getelementptr inbounds [501 x [203 x i32]], ptr @f, i64 0, i64 %119
  %121 = getelementptr inbounds [203 x i32], ptr %120, i64 0, i64 202
  %122 = load i32, ptr %121, align 4, !tbaa !5
  %123 = srem i32 %122, 13
  %124 = load i32, ptr %7, align 4, !tbaa !5
  %125 = sext i32 %124 to i64
  %126 = getelementptr inbounds [501 x [203 x i32]], ptr @f, i64 0, i64 %125
  %127 = load i32, ptr @tot, align 4, !tbaa !5
  %128 = sext i32 %127 to i64
  %129 = getelementptr inbounds [203 x i32], ptr %126, i64 0, i64 %128
  store i32 %123, ptr %129, align 4, !tbaa !5
  br label %130

130:                                              ; preds = %117
  %131 = load i32, ptr %7, align 4, !tbaa !5
  %132 = add nsw i32 %131, 1
  store i32 %132, ptr %7, align 4, !tbaa !5
  br label %94, !llvm.loop !14

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

134:                                              ; preds = %299, %133
  %135 = load i32, ptr %10, align 4, !tbaa !5
  %136 = load i32, ptr @tot, align 4, !tbaa !5
  %137 = icmp slt i32 %135, %136
  br i1 %137, label %139, label %138

138:                                              ; preds = %134
  store i32 16, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #8
  br label %302

139:                                              ; preds = %134
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #8
  store i32 -1, ptr %11, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #8
  %140 = load i32, ptr %10, align 4, !tbaa !5
  store i32 %140, ptr %12, align 4, !tbaa !5
  br label %141

141:                                              ; preds = %163, %139
  %142 = load i32, ptr %12, align 4, !tbaa !5
  %143 = load i32, ptr @m, align 4, !tbaa !5
  %144 = icmp slt i32 %142, %143
  br i1 %144, label %145, label %148

145:                                              ; preds = %141
  %146 = load i32, ptr %11, align 4, !tbaa !5
  %147 = icmp eq i32 %146, -1
  br label %148

148:                                              ; preds = %145, %141
  %149 = phi i1 [ false, %141 ], [ %147, %145 ]
  br i1 %149, label %151, label %150

150:                                              ; preds = %148
  store i32 19, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #8
  br label %166

151:                                              ; preds = %148
  %152 = load i32, ptr %12, align 4, !tbaa !5
  %153 = sext i32 %152 to i64
  %154 = getelementptr inbounds [501 x [203 x i32]], ptr @f, i64 0, i64 %153
  %155 = load i32, ptr %10, align 4, !tbaa !5
  %156 = sext i32 %155 to i64
  %157 = getelementptr inbounds [203 x i32], ptr %154, i64 0, i64 %156
  %158 = load i32, ptr %157, align 4, !tbaa !5
  %159 = icmp ne i32 %158, 0
  br i1 %159, label %160, label %162

160:                                              ; preds = %151
  %161 = load i32, ptr %12, align 4, !tbaa !5
  store i32 %161, ptr %11, align 4, !tbaa !5
  br label %162

162:                                              ; preds = %160, %151
  br label %163

163:                                              ; preds = %162
  %164 = load i32, ptr %12, align 4, !tbaa !5
  %165 = add nsw i32 %164, 1
  store i32 %165, ptr %12, align 4, !tbaa !5
  br label %141, !llvm.loop !15

166:                                              ; preds = %150
  %167 = load i32, ptr %11, align 4, !tbaa !5
  %168 = load i32, ptr %10, align 4, !tbaa !5
  %169 = icmp ne i32 %167, %168
  br i1 %169, label %170, label %194

170:                                              ; preds = %166
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #8
  %171 = load i32, ptr %10, align 4, !tbaa !5
  store i32 %171, ptr %13, align 4, !tbaa !5
  br label %172

172:                                              ; preds = %190, %170
  %173 = load i32, ptr %13, align 4, !tbaa !5
  %174 = load i32, ptr @tot, align 4, !tbaa !5
  %175 = icmp sle i32 %173, %174
  br i1 %175, label %177, label %176

176:                                              ; preds = %172
  store i32 22, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #8
  br label %193

177:                                              ; preds = %172
  %178 = load i32, ptr %10, align 4, !tbaa !5
  %179 = sext i32 %178 to i64
  %180 = getelementptr inbounds [501 x [203 x i32]], ptr @f, i64 0, i64 %179
  %181 = load i32, ptr %13, align 4, !tbaa !5
  %182 = sext i32 %181 to i64
  %183 = getelementptr inbounds [203 x i32], ptr %180, i64 0, i64 %182
  %184 = load i32, ptr %11, align 4, !tbaa !5
  %185 = sext i32 %184 to i64
  %186 = getelementptr inbounds [501 x [203 x i32]], ptr @f, i64 0, i64 %185
  %187 = load i32, ptr %13, align 4, !tbaa !5
  %188 = sext i32 %187 to i64
  %189 = getelementptr inbounds [203 x i32], ptr %186, i64 0, i64 %188
  call void @_ZSt4swapIiENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 4 dereferenceable(4) %183, ptr noundef nonnull align 4 dereferenceable(4) %189) #8
  br label %190

190:                                              ; preds = %177
  %191 = load i32, ptr %13, align 4, !tbaa !5
  %192 = add nsw i32 %191, 1
  store i32 %192, ptr %13, align 4, !tbaa !5
  br label %172, !llvm.loop !16

193:                                              ; preds = %176
  br label %194

194:                                              ; preds = %193, %166
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #8
  %195 = load i32, ptr %10, align 4, !tbaa !5
  %196 = sext i32 %195 to i64
  %197 = getelementptr inbounds [501 x [203 x i32]], ptr @f, i64 0, i64 %196
  %198 = load i32, ptr %10, align 4, !tbaa !5
  %199 = sext i32 %198 to i64
  %200 = getelementptr inbounds [203 x i32], ptr %197, i64 0, i64 %199
  %201 = load i32, ptr %200, align 4, !tbaa !5
  %202 = sext i32 %201 to i64
  %203 = getelementptr inbounds [13 x i32], ptr @inv, i64 0, i64 %202
  %204 = load i32, ptr %203, align 4, !tbaa !5
  store i32 %204, ptr %14, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #8
  %205 = load i32, ptr %10, align 4, !tbaa !5
  store i32 %205, ptr %15, align 4, !tbaa !5
  br label %206

206:                                              ; preds = %228, %194
  %207 = load i32, ptr %15, align 4, !tbaa !5
  %208 = load i32, ptr @tot, align 4, !tbaa !5
  %209 = icmp sle i32 %207, %208
  br i1 %209, label %211, label %210

210:                                              ; preds = %206
  store i32 25, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #8
  br label %231

211:                                              ; preds = %206
  %212 = load i32, ptr %10, align 4, !tbaa !5
  %213 = sext i32 %212 to i64
  %214 = getelementptr inbounds [501 x [203 x i32]], ptr @f, i64 0, i64 %213
  %215 = load i32, ptr %15, align 4, !tbaa !5
  %216 = sext i32 %215 to i64
  %217 = getelementptr inbounds [203 x i32], ptr %214, i64 0, i64 %216
  %218 = load i32, ptr %217, align 4, !tbaa !5
  %219 = load i32, ptr %14, align 4, !tbaa !5
  %220 = mul nsw i32 %218, %219
  %221 = srem i32 %220, 13
  %222 = load i32, ptr %10, align 4, !tbaa !5
  %223 = sext i32 %222 to i64
  %224 = getelementptr inbounds [501 x [203 x i32]], ptr @f, i64 0, i64 %223
  %225 = load i32, ptr %15, align 4, !tbaa !5
  %226 = sext i32 %225 to i64
  %227 = getelementptr inbounds [203 x i32], ptr %224, i64 0, i64 %226
  store i32 %221, ptr %227, align 4, !tbaa !5
  br label %228

228:                                              ; preds = %211
  %229 = load i32, ptr %15, align 4, !tbaa !5
  %230 = add nsw i32 %229, 1
  store i32 %230, ptr %15, align 4, !tbaa !5
  br label %206, !llvm.loop !17

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

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

236:                                              ; preds = %232
  store i32 28, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #8
  br label %298

237:                                              ; preds = %232
  %238 = load i32, ptr %10, align 4, !tbaa !5
  %239 = load i32, ptr %16, align 4, !tbaa !5
  %240 = icmp eq i32 %238, %239
  br i1 %240, label %250, label %241

241:                                              ; preds = %237
  %242 = load i32, ptr %16, align 4, !tbaa !5
  %243 = sext i32 %242 to i64
  %244 = getelementptr inbounds [501 x [203 x i32]], ptr @f, i64 0, i64 %243
  %245 = load i32, ptr %10, align 4, !tbaa !5
  %246 = sext i32 %245 to i64
  %247 = getelementptr inbounds [203 x i32], ptr %244, i64 0, i64 %246
  %248 = load i32, ptr %247, align 4, !tbaa !5
  %249 = icmp ne i32 %248, 0
  br i1 %249, label %251, label %250

250:                                              ; preds = %241, %237
  br label %295

251:                                              ; preds = %241
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #8
  %252 = load i32, ptr %16, align 4, !tbaa !5
  %253 = sext i32 %252 to i64
  %254 = getelementptr inbounds [501 x [203 x i32]], ptr @f, i64 0, i64 %253
  %255 = load i32, ptr %10, align 4, !tbaa !5
  %256 = sext i32 %255 to i64
  %257 = getelementptr inbounds [203 x i32], ptr %254, i64 0, i64 %256
  %258 = load i32, ptr %257, align 4, !tbaa !5
  %259 = sub nsw i32 13, %258
  store i32 %259, ptr %17, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #8
  %260 = load i32, ptr %10, align 4, !tbaa !5
  store i32 %260, ptr %18, align 4, !tbaa !5
  br label %261

261:                                              ; preds = %291, %251
  %262 = load i32, ptr %18, align 4, !tbaa !5
  %263 = load i32, ptr @tot, align 4, !tbaa !5
  %264 = icmp sle i32 %262, %263
  br i1 %264, label %266, label %265

265:                                              ; preds = %261
  store i32 31, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #8
  br label %294

266:                                              ; preds = %261
  %267 = load i32, ptr %16, align 4, !tbaa !5
  %268 = sext i32 %267 to i64
  %269 = getelementptr inbounds [501 x [203 x i32]], ptr @f, i64 0, i64 %268
  %270 = load i32, ptr %18, align 4, !tbaa !5
  %271 = sext i32 %270 to i64
  %272 = getelementptr inbounds [203 x i32], ptr %269, i64 0, i64 %271
  %273 = load i32, ptr %272, align 4, !tbaa !5
  %274 = load i32, ptr %17, align 4, !tbaa !5
  %275 = load i32, ptr %10, align 4, !tbaa !5
  %276 = sext i32 %275 to i64
  %277 = getelementptr inbounds [501 x [203 x i32]], ptr @f, i64 0, i64 %276
  %278 = load i32, ptr %18, align 4, !tbaa !5
  %279 = sext i32 %278 to i64
  %280 = getelementptr inbounds [203 x i32], ptr %277, i64 0, i64 %279
  %281 = load i32, ptr %280, align 4, !tbaa !5
  %282 = mul nsw i32 %274, %281
  %283 = add nsw i32 %273, %282
  %284 = srem i32 %283, 13
  %285 = load i32, ptr %16, align 4, !tbaa !5
  %286 = sext i32 %285 to i64
  %287 = getelementptr inbounds [501 x [203 x i32]], ptr @f, i64 0, i64 %286
  %288 = load i32, ptr %18, align 4, !tbaa !5
  %289 = sext i32 %288 to i64
  %290 = getelementptr inbounds [203 x i32], ptr %287, i64 0, i64 %289
  store i32 %284, ptr %290, align 4, !tbaa !5
  br label %291

291:                                              ; preds = %266
  %292 = load i32, ptr %18, align 4, !tbaa !5
  %293 = add nsw i32 %292, 1
  store i32 %293, ptr %18, align 4, !tbaa !5
  br label %261, !llvm.loop !18

294:                                              ; preds = %265
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #8
  br label %295

295:                                              ; preds = %294, %250
  %296 = load i32, ptr %16, align 4, !tbaa !5
  %297 = add nsw i32 %296, 1
  store i32 %297, ptr %16, align 4, !tbaa !5
  br label %232, !llvm.loop !19

298:                                              ; preds = %236
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #8
  br label %299

299:                                              ; preds = %298
  %300 = load i32, ptr %10, align 4, !tbaa !5
  %301 = add nsw i32 %300, 1
  store i32 %301, ptr %10, align 4, !tbaa !5
  br label %134, !llvm.loop !20

302:                                              ; preds = %138
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #8
  %303 = call ptr @_ZNSt3mapISt4pairIiiEiSt4lessIS1_ESaIS0_IKS1_iEEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) @sp) #8
  %304 = getelementptr inbounds %"struct.std::_Rb_tree_iterator", ptr %19, i32 0, i32 0
  store ptr %303, ptr %304, align 8
  br label %305

305:                                              ; preds = %342, %302
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #8
  %306 = call ptr @_ZNSt3mapISt4pairIiiEiSt4lessIS1_ESaIS0_IKS1_iEEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) @sp) #8
  %307 = getelementptr inbounds %"struct.std::_Rb_tree_iterator", ptr %20, i32 0, i32 0
  store ptr %306, ptr %307, align 8
  %308 = call noundef zeroext i1 @_ZStneRKSt17_Rb_tree_iteratorISt4pairIKS0_IiiEiEES6_(ptr noundef nonnull align 8 dereferenceable(8) %19, ptr noundef nonnull align 8 dereferenceable(8) %20) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #8
  br i1 %308, label %310, label %309

309:                                              ; preds = %305
  store i32 34, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #8
  br label %344

310:                                              ; preds = %305
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #8
  %311 = call noundef ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKS0_IiiEiEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %19) #8
  %312 = getelementptr inbounds %"struct.std::pair", ptr %311, i32 0, i32 0
  %313 = getelementptr inbounds %"struct.std::pair.3", ptr %312, i32 0, i32 0
  %314 = load i32, ptr %313, align 4, !tbaa !21
  store i32 %314, ptr %21, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #8
  %315 = call noundef ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKS0_IiiEiEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %19) #8
  %316 = getelementptr inbounds %"struct.std::pair", ptr %315, i32 0, i32 0
  %317 = getelementptr inbounds %"struct.std::pair.3", ptr %316, i32 0, i32 1
  %318 = load i32, ptr %317, align 4, !tbaa !24
  store i32 %318, ptr %22, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #8
  %319 = call noundef ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKS0_IiiEiEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %19) #8
  %320 = getelementptr inbounds %"struct.std::pair", ptr %319, i32 0, i32 1
  %321 = load i32, ptr %320, align 4, !tbaa !25
  store i32 %321, ptr %23, align 4, !tbaa !5
  %322 = load i32, ptr %21, align 4, !tbaa !5
  %323 = sext i32 %322 to i64
  %324 = getelementptr inbounds [203 x %"class.std::vector"], ptr @e, i64 0, i64 %323
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #8
  %325 = load i32, ptr %23, align 4, !tbaa !5
  %326 = sext i32 %325 to i64
  %327 = getelementptr inbounds [501 x [203 x i32]], ptr @f, i64 0, i64 %326
  %328 = load i32, ptr @tot, align 4, !tbaa !5
  %329 = sext i32 %328 to i64
  %330 = getelementptr inbounds [203 x i32], ptr %327, i64 0, i64 %329
  %331 = call i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %22, ptr noundef nonnull align 4 dereferenceable(4) %330)
  store i64 %331, ptr %24, align 4
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %324, ptr noundef nonnull align 4 dereferenceable(8) %24)
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #8
  %332 = load i32, ptr %22, align 4, !tbaa !5
  %333 = sext i32 %332 to i64
  %334 = getelementptr inbounds [203 x %"class.std::vector"], ptr @e, i64 0, i64 %333
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #8
  %335 = load i32, ptr %23, align 4, !tbaa !5
  %336 = sext i32 %335 to i64
  %337 = getelementptr inbounds [501 x [203 x i32]], ptr @f, i64 0, i64 %336
  %338 = load i32, ptr @tot, align 4, !tbaa !5
  %339 = sext i32 %338 to i64
  %340 = getelementptr inbounds [203 x i32], ptr %337, i64 0, i64 %339
  %341 = call i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %21, ptr noundef nonnull align 4 dereferenceable(4) %340)
  store i64 %341, ptr %25, align 4
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %334, ptr noundef nonnull align 4 dereferenceable(8) %25)
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #8
  br label %342

342:                                              ; preds = %310
  %343 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt17_Rb_tree_iteratorISt4pairIKS0_IiiEiEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %19) #8
  br label %305, !llvm.loop !26

344:                                              ; preds = %309
  %345 = load i32, ptr @n, align 4, !tbaa !5
  %346 = sext i32 %345 to i64
  %347 = mul i64 %346, 4
  call void @llvm.memset.p0.i64(ptr align 4 getelementptr inbounds (i32, ptr @dis, i64 1), i8 63, i64 %347, i1 false)
  %348 = load i32, ptr @S, align 4, !tbaa !5
  %349 = sext i32 %348 to i64
  %350 = getelementptr inbounds [203 x i32], ptr @dis, i64 0, i64 %349
  store i32 0, ptr %350, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #8
  store i32 1, ptr %26, align 4, !tbaa !5
  br label %351

351:                                              ; preds = %442, %344
  %352 = load i32, ptr %26, align 4, !tbaa !5
  %353 = load i32, ptr @n, align 4, !tbaa !5
  %354 = icmp slt i32 %352, %353
  br i1 %354, label %356, label %355

355:                                              ; preds = %351
  store i32 37, ptr %8, align 4
  br label %445

356:                                              ; preds = %351
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #8
  store i32 -1, ptr %27, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %28) #8
  store i32 1, ptr %28, align 4, !tbaa !5
  br label %357

357:                                              ; preds = %384, %356
  %358 = load i32, ptr %28, align 4, !tbaa !5
  %359 = load i32, ptr @n, align 4, !tbaa !5
  %360 = icmp sle i32 %358, %359
  br i1 %360, label %362, label %361

361:                                              ; preds = %357
  store i32 40, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %28) #8
  br label %387

362:                                              ; preds = %357
  %363 = load i32, ptr %28, align 4, !tbaa !5
  %364 = sext i32 %363 to i64
  %365 = getelementptr inbounds [203 x i8], ptr @vis, i64 0, i64 %364
  %366 = load i8, ptr %365, align 1, !tbaa !27, !range !29, !noundef !30
  %367 = trunc i8 %366 to i1
  br i1 %367, label %383, label %368

368:                                              ; preds = %362
  %369 = load i32, ptr %27, align 4, !tbaa !5
  %370 = icmp eq i32 %369, -1
  br i1 %370, label %381, label %371

371:                                              ; preds = %368
  %372 = load i32, ptr %28, align 4, !tbaa !5
  %373 = sext i32 %372 to i64
  %374 = getelementptr inbounds [203 x i32], ptr @dis, i64 0, i64 %373
  %375 = load i32, ptr %374, align 4, !tbaa !5
  %376 = load i32, ptr %27, align 4, !tbaa !5
  %377 = sext i32 %376 to i64
  %378 = getelementptr inbounds [203 x i32], ptr @dis, i64 0, i64 %377
  %379 = load i32, ptr %378, align 4, !tbaa !5
  %380 = icmp slt i32 %375, %379
  br i1 %380, label %381, label %383

381:                                              ; preds = %371, %368
  %382 = load i32, ptr %28, align 4, !tbaa !5
  store i32 %382, ptr %27, align 4, !tbaa !5
  br label %383

383:                                              ; preds = %381, %371, %362
  br label %384

384:                                              ; preds = %383
  %385 = load i32, ptr %28, align 4, !tbaa !5
  %386 = add nsw i32 %385, 1
  store i32 %386, ptr %28, align 4, !tbaa !5
  br label %357, !llvm.loop !31

387:                                              ; preds = %361
  %388 = load i32, ptr %27, align 4, !tbaa !5
  %389 = icmp eq i32 %388, -1
  br i1 %389, label %394, label %390

390:                                              ; preds = %387
  %391 = load i32, ptr %27, align 4, !tbaa !5
  %392 = load i32, ptr @T, align 4, !tbaa !5
  %393 = icmp eq i32 %391, %392
  br i1 %393, label %394, label %395

394:                                              ; preds = %390, %387
  store i32 37, ptr %8, align 4
  br label %439

395:                                              ; preds = %390
  %396 = load i32, ptr %27, align 4, !tbaa !5
  %397 = sext i32 %396 to i64
  %398 = getelementptr inbounds [203 x i8], ptr @vis, i64 0, i64 %397
  store i8 1, ptr %398, align 1, !tbaa !27
  call void @llvm.lifetime.start.p0(i64 8, ptr %29) #8
  %399 = load i32, ptr %27, align 4, !tbaa !5
  %400 = sext i32 %399 to i64
  %401 = getelementptr inbounds [203 x %"class.std::vector"], ptr @e, i64 0, i64 %400
  %402 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %401) #8
  %403 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %29, i32 0, i32 0
  store ptr %402, ptr %403, align 8
  br label %404

404:                                              ; preds = %436, %395
  call void @llvm.lifetime.start.p0(i64 8, ptr %30) #8
  %405 = load i32, ptr %27, align 4, !tbaa !5
  %406 = sext i32 %405 to i64
  %407 = getelementptr inbounds [203 x %"class.std::vector"], ptr @e, i64 0, i64 %406
  %408 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %407) #8
  %409 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %30, i32 0, i32 0
  store ptr %408, ptr %409, align 8
  %410 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairIiiESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %29, ptr noundef nonnull align 8 dereferenceable(8) %30) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %30) #8
  br i1 %410, label %412, label %411

411:                                              ; preds = %404
  store i32 43, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %29) #8
  br label %438

412:                                              ; preds = %404
  call void @llvm.lifetime.start.p0(i64 4, ptr %31) #8
  %413 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %29) #8
  %414 = getelementptr inbounds %"struct.std::pair.3", ptr %413, i32 0, i32 0
  %415 = load i32, ptr %414, align 4, !tbaa !32
  store i32 %415, ptr %31, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %32) #8
  %416 = load i32, ptr %27, align 4, !tbaa !5
  %417 = sext i32 %416 to i64
  %418 = getelementptr inbounds [203 x i32], ptr @dis, i64 0, i64 %417
  %419 = load i32, ptr %418, align 4, !tbaa !5
  %420 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %29) #8
  %421 = getelementptr inbounds %"struct.std::pair.3", ptr %420, i32 0, i32 1
  %422 = load i32, ptr %421, align 4, !tbaa !33
  %423 = add nsw i32 %419, %422
  store i32 %423, ptr %32, align 4, !tbaa !5
  %424 = load i32, ptr %32, align 4, !tbaa !5
  %425 = load i32, ptr %31, align 4, !tbaa !5
  %426 = sext i32 %425 to i64
  %427 = getelementptr inbounds [203 x i32], ptr @dis, i64 0, i64 %426
  %428 = load i32, ptr %427, align 4, !tbaa !5
  %429 = icmp slt i32 %424, %428
  br i1 %429, label %430, label %435

430:                                              ; preds = %412
  %431 = load i32, ptr %32, align 4, !tbaa !5
  %432 = load i32, ptr %31, align 4, !tbaa !5
  %433 = sext i32 %432 to i64
  %434 = getelementptr inbounds [203 x i32], ptr @dis, i64 0, i64 %433
  store i32 %431, ptr %434, align 4, !tbaa !5
  br label %435

435:                                              ; preds = %430, %412
  call void @llvm.lifetime.end.p0(i64 4, ptr %32) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %31) #8
  br label %436

436:                                              ; preds = %435
  %437 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %29) #8
  br label %404, !llvm.loop !34

438:                                              ; preds = %411
  store i32 0, ptr %8, align 4
  br label %439

439:                                              ; preds = %438, %394
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #8
  %440 = load i32, ptr %8, align 4
  switch i32 %440, label %445 [
    i32 0, label %441
  ]

441:                                              ; preds = %439
  br label %442

442:                                              ; preds = %441
  %443 = load i32, ptr %26, align 4, !tbaa !5
  %444 = add nsw i32 %443, 1
  store i32 %444, ptr %26, align 4, !tbaa !5
  br label %351, !llvm.loop !35

445:                                              ; preds = %439, %355
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #8
  br label %446

446:                                              ; preds = %445
  %447 = load i32, ptr @T, align 4, !tbaa !5
  %448 = sext i32 %447 to i64
  %449 = getelementptr inbounds [203 x i32], ptr @dis, i64 0, i64 %448
  %450 = load i32, ptr %449, align 4, !tbaa !5
  %451 = call i32 (ptr, ...) @printf(ptr noundef @.str.4, i32 noundef %450)
  ret i32 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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i32 @_Z5getIDii(i32 noundef, i32 noundef) #3

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZStneRKSt17_Rb_tree_iteratorISt4pairIKS0_IiiEiEES6_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #5

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

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

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

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

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairIiiESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #4

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

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

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

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

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10}
!18 = distinct !{!18, !10}
!19 = distinct !{!19, !10}
!20 = distinct !{!20, !10}
!21 = !{!22, !6, i64 0}
!22 = !{!"_ZTSSt4pairIKS_IiiEiE", !23, i64 0, !6, i64 8}
!23 = !{!"_ZTSSt4pairIiiE", !6, i64 0, !6, i64 4}
!24 = !{!22, !6, i64 4}
!25 = !{!22, !6, i64 8}
!26 = distinct !{!26, !10}
!27 = !{!28, !28, i64 0}
!28 = !{!"bool", !7, i64 0}
!29 = !{i8 0, i8 2}
!30 = !{}
!31 = distinct !{!31, !10}
!32 = !{!23, !6, i64 0}
!33 = !{!23, !6, i64 4}
!34 = distinct !{!34, !10}
!35 = distinct !{!35, !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::map" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<std::pair<int, int>, std::pair<const std::pair<int, int>, int>, std::_Select1st<std::pair<const std::pair<int, int>, int>>, std::less<std::pair<int, int>>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<std::pair<int, int>, std::pair<const std::pair<int, int>, int>, std::_Select1st<std::pair<const std::pair<int, int>, int>>, std::less<std::pair<int, int>>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::_Rb_tree_header" = type { %"struct.std::_Rb_tree_node_base", i64 }
%"struct.std::_Rb_tree_node_base" = type { i32, ptr, ptr, ptr }
%"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::_Rb_tree_iterator" = type { ptr }
%"struct.std::pair.3" = type { i32, i32 }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }

@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
@S = external dso_local global i32, align 4
@T = external dso_local global i32, align 4
@inv = external dso_local local_unnamed_addr global [13 x i32], align 16
@f = external dso_local global [501 x [203 x i32]], align 16
@dis = external dso_local local_unnamed_addr global [203 x i32], align 16
@sp = external dso_local global %"class.std::map", align 8
@e = external dso_local global [203 x %"class.std::vector"], align 16
@vis = external dso_local local_unnamed_addr global [203 x i8], align 16
@.str = external hidden unnamed_addr constant [9 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %4 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca %"struct.std::pair.3", align 8
  %8 = alloca %"struct.std::pair.3", align 8
  %9 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %10 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  store <4 x i32> <i32 1, i32 7, i32 9, i32 10>, ptr getelementptr inbounds (i8, ptr @inv, i64 4), align 4, !tbaa !5
  store <4 x i32> <i32 8, i32 11, i32 2, i32 5>, ptr getelementptr inbounds (i8, ptr @inv, i64 20), align 4, !tbaa !5
  store <4 x i32> <i32 3, i32 4, i32 6, i32 12>, ptr getelementptr inbounds (i8, ptr @inv, i64 36), align 4, !tbaa !5
  %11 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n, ptr noundef nonnull @S, ptr noundef nonnull @T, ptr noundef nonnull @m)
  %12 = load i32, ptr @m, align 4, !tbaa !5
  %13 = icmp sgt i32 %12, 0
  br i1 %13, label %.lr.ph131, label %.preheader123.thread

.preheader123.thread:                             ; preds = %0
  %.pre221 = load i32, ptr @tot, align 4
  br label %.preheader121

.preheader123:                                    ; preds = %._crit_edge
  %14 = icmp sgt i32 %46, 0
  %.pre = load i32, ptr @tot, align 4
  br i1 %14, label %.preheader122.lr.ph, label %.preheader121

.preheader122.lr.ph:                              ; preds = %.preheader123
  %15 = icmp sgt i32 %.pre, 0
  %16 = sext i32 %.pre to i64
  %wide.trip.count189 = zext nneg i32 %46 to i64
  br i1 %15, label %.preheader122.us.preheader, label %.preheader122.preheader

.preheader122.preheader:                          ; preds = %.preheader122.lr.ph
  %xtraiter = and i64 %wide.trip.count189, 1
  %17 = icmp eq i32 %46, 1
  br i1 %17, label %.preheader121.loopexit270.unr-lcssa, label %.preheader122.preheader.new

.preheader122.preheader.new:                      ; preds = %.preheader122.preheader
  %unroll_iter = and i64 %wide.trip.count189, 2147483646
  br label %.preheader122

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

.preheader122.us:                                 ; preds = %.preheader122.us.preheader, %._crit_edge134.us
  %indvars.iv186 = phi i64 [ 0, %.preheader122.us.preheader ], [ %indvars.iv.next187, %._crit_edge134.us ]
  br i1 %min.iters.check, label %scalar.ph.preheader, label %vector.body

vector.body:                                      ; preds = %.preheader122.us, %vector.body
  %index = phi i64 [ %index.next, %vector.body ], [ 0, %.preheader122.us ]
  %18 = getelementptr inbounds [501 x [203 x i32]], ptr @f, i64 0, i64 %indvars.iv186, i64 %index
  %19 = getelementptr inbounds i8, ptr %18, i64 16
  %wide.load = load <4 x i32>, ptr %18, align 4, !tbaa !5
  %wide.load232 = load <4 x i32>, ptr %19, align 4, !tbaa !5
  %20 = srem <4 x i32> %wide.load, <i32 13, i32 13, i32 13, i32 13>
  %21 = srem <4 x i32> %wide.load232, <i32 13, i32 13, i32 13, i32 13>
  store <4 x i32> %20, ptr %18, align 4, !tbaa !5
  store <4 x i32> %21, ptr %19, align 4, !tbaa !5
  %index.next = add nuw i64 %index, 8
  %22 = icmp eq i64 %index.next, %n.vec
  br i1 %22, label %middle.block, label %vector.body, !llvm.loop !9

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

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

scalar.ph:                                        ; preds = %scalar.ph.preheader, %scalar.ph
  %indvars.iv181 = phi i64 [ %indvars.iv.next182, %scalar.ph ], [ %indvars.iv181.ph, %scalar.ph.preheader ]
  %23 = getelementptr inbounds [501 x [203 x i32]], ptr @f, i64 0, i64 %indvars.iv186, i64 %indvars.iv181
  %24 = load i32, ptr %23, align 4, !tbaa !5
  %25 = srem i32 %24, 13
  store i32 %25, ptr %23, align 4, !tbaa !5
  %indvars.iv.next182 = add nuw nsw i64 %indvars.iv181, 1
  %exitcond185.not = icmp eq i64 %indvars.iv.next182, %wide.trip.count184
  br i1 %exitcond185.not, label %._crit_edge134.us, label %scalar.ph, !llvm.loop !13

._crit_edge134.us:                                ; preds = %scalar.ph, %middle.block
  %26 = getelementptr inbounds [501 x [203 x i32]], ptr @f, i64 0, i64 %indvars.iv186, i64 202
  %27 = load i32, ptr %26, align 4, !tbaa !5
  %28 = srem i32 %27, 13
  %29 = getelementptr inbounds [501 x [203 x i32]], ptr @f, i64 0, i64 %indvars.iv186, i64 %16
  store i32 %28, ptr %29, align 4, !tbaa !5
  %indvars.iv.next187 = add nuw nsw i64 %indvars.iv186, 1
  %exitcond190.not = icmp eq i64 %indvars.iv.next187, %wide.trip.count189
  br i1 %exitcond190.not, label %.preheader121, label %.preheader122.us, !llvm.loop !14

.lr.ph131:                                        ; preds = %0, %._crit_edge
  %indvars.iv = phi i64 [ %indvars.iv.next, %._crit_edge ], [ 0, %0 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #9
  %30 = getelementptr inbounds [501 x [203 x i32]], ptr @f, i64 0, i64 %indvars.iv, i64 202
  %31 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %30, ptr noundef nonnull %1)
  %32 = load i32, ptr %1, align 4, !tbaa !5
  %33 = add nsw i32 %32, -1
  store i32 %33, ptr %1, align 4, !tbaa !5
  %.not112127 = icmp eq i32 %32, 0
  br i1 %.not112127, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph131, %42
  %.091128 = phi i32 [ %43, %42 ], [ -1, %.lr.ph131 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #9
  %34 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.3, ptr noundef nonnull %2)
  %.not113 = icmp eq i32 %.091128, -1
  br i1 %.not113, label %42, label %35

35:                                               ; preds = %.lr.ph
  %36 = load i32, ptr %2, align 4, !tbaa !5
  %37 = call noundef i32 @_Z5getIDii(i32 noundef %.091128, i32 noundef %36)
  %38 = sext i32 %37 to i64
  %39 = getelementptr inbounds [501 x [203 x i32]], ptr @f, i64 0, i64 %indvars.iv, i64 %38
  %40 = load i32, ptr %39, align 4, !tbaa !5
  %41 = add nsw i32 %40, 1
  store i32 %41, ptr %39, align 4, !tbaa !5
  br label %42

42:                                               ; preds = %35, %.lr.ph
  %43 = load i32, ptr %2, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #9
  %44 = load i32, ptr %1, align 4, !tbaa !5
  %45 = add nsw i32 %44, -1
  store i32 %45, ptr %1, align 4, !tbaa !5
  %.not112 = icmp eq i32 %44, 0
  br i1 %.not112, label %._crit_edge, label %.lr.ph, !llvm.loop !15

._crit_edge:                                      ; preds = %42, %.lr.ph131
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #9
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %46 = load i32, ptr @m, align 4, !tbaa !5
  %47 = sext i32 %46 to i64
  %48 = icmp slt i64 %indvars.iv.next, %47
  br i1 %48, label %.lr.ph131, label %.preheader123, !llvm.loop !16

.preheader122:                                    ; preds = %.preheader122, %.preheader122.preheader.new
  %indvars.iv178 = phi i64 [ 0, %.preheader122.preheader.new ], [ %indvars.iv.next179.1, %.preheader122 ]
  %niter = phi i64 [ 0, %.preheader122.preheader.new ], [ %niter.next.1, %.preheader122 ]
  %49 = getelementptr inbounds [501 x [203 x i32]], ptr @f, i64 0, i64 %indvars.iv178, i64 202
  %50 = load i32, ptr %49, align 8, !tbaa !5
  %51 = srem i32 %50, 13
  %52 = getelementptr inbounds [501 x [203 x i32]], ptr @f, i64 0, i64 %indvars.iv178, i64 %16
  store i32 %51, ptr %52, align 4, !tbaa !5
  %indvars.iv.next179 = or disjoint i64 %indvars.iv178, 1
  %53 = getelementptr inbounds [501 x [203 x i32]], ptr @f, i64 0, i64 %indvars.iv.next179, i64 202
  %54 = load i32, ptr %53, align 4, !tbaa !5
  %55 = srem i32 %54, 13
  %56 = getelementptr inbounds [501 x [203 x i32]], ptr @f, i64 0, i64 %indvars.iv.next179, i64 %16
  store i32 %55, ptr %56, align 4, !tbaa !5
  %indvars.iv.next179.1 = add nuw nsw i64 %indvars.iv178, 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 %.preheader121.loopexit270.unr-lcssa, label %.preheader122, !llvm.loop !14

.preheader121.loopexit270.unr-lcssa:              ; preds = %.preheader122, %.preheader122.preheader
  %indvars.iv178.unr = phi i64 [ 0, %.preheader122.preheader ], [ %indvars.iv.next179.1, %.preheader122 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.preheader121, label %.preheader122.epil

.preheader122.epil:                               ; preds = %.preheader121.loopexit270.unr-lcssa
  %57 = getelementptr inbounds [501 x [203 x i32]], ptr @f, i64 0, i64 %indvars.iv178.unr, i64 202
  %58 = load i32, ptr %57, align 4, !tbaa !5
  %59 = srem i32 %58, 13
  %60 = getelementptr inbounds [501 x [203 x i32]], ptr @f, i64 0, i64 %indvars.iv178.unr, i64 %16
  store i32 %59, ptr %60, align 4, !tbaa !5
  br label %.preheader121

.preheader121:                                    ; preds = %.preheader122.epil, %.preheader121.loopexit270.unr-lcssa, %._crit_edge134.us, %.preheader123.thread, %.preheader123
  %.pre223 = phi i32 [ %.pre221, %.preheader123.thread ], [ %.pre, %.preheader123 ], [ %.pre, %._crit_edge134.us ], [ %.pre, %.preheader121.loopexit270.unr-lcssa ], [ %.pre, %.preheader122.epil ]
  %.lcssa125222 = phi i32 [ %12, %.preheader123.thread ], [ %46, %.preheader123 ], [ %46, %._crit_edge134.us ], [ %46, %.preheader121.loopexit270.unr-lcssa ], [ %46, %.preheader122.epil ]
  %61 = icmp sgt i32 %.pre223, 0
  br i1 %61, label %.preheader120, label %._crit_edge158

.preheader120:                                    ; preds = %.preheader121, %._crit_edge155
  %62 = phi i32 [ %85, %._crit_edge155 ], [ %.pre223, %.preheader121 ]
  %63 = phi i32 [ %116, %._crit_edge155 ], [ %.lcssa125222, %.preheader121 ]
  %indvars.iv191 = phi i64 [ %indvars.iv.next192, %._crit_edge155 ], [ 0, %.preheader121 ]
  %64 = shl nuw nsw i64 %indvars.iv191, 2
  %scevgep = getelementptr i8, ptr @f, i64 %64
  %gep = getelementptr i8, ptr getelementptr (i8, ptr @f, i64 -808), i64 %64
  %65 = mul nuw nsw i64 %indvars.iv191, 816
  %scevgep235 = getelementptr i8, ptr @f, i64 %65
  %66 = or disjoint i64 %65, 4
  %scevgep236 = getelementptr i8, ptr @f, i64 %66
  %67 = sext i32 %63 to i64
  %68 = icmp slt i64 %indvars.iv191, %67
  br i1 %68, label %.lr.ph138, label %._crit_edge139

._crit_edge158:                                   ; preds = %._crit_edge155, %.preheader121
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #9
  %69 = call ptr @_ZNSt3mapISt4pairIiiEiSt4lessIS1_ESaIS0_IKS1_iEEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) @sp) #9
  store ptr %69, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #9
  %70 = call ptr @_ZNSt3mapISt4pairIiiEiSt4lessIS1_ESaIS0_IKS1_iEEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) @sp) #9
  store ptr %70, ptr %4, align 8
  %71 = call noundef zeroext i1 @_ZStneRKSt17_Rb_tree_iteratorISt4pairIKS0_IiiEiEES6_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %4) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #9
  br i1 %71, label %.lr.ph160, label %._crit_edge161

._crit_edge139.loopexit:                          ; preds = %.lr.ph138
  %72 = trunc nuw nsw i64 %indvars.iv193 to i32
  %spec.select = select i1 %.not111, i32 -1, i32 %72
  br label %._crit_edge139

._crit_edge139:                                   ; preds = %._crit_edge139.loopexit, %.preheader120
  %.099.lcssa = phi i32 [ -1, %.preheader120 ], [ %spec.select, %._crit_edge139.loopexit ]
  %73 = zext i32 %.099.lcssa to i64
  %.not106 = icmp eq i64 %indvars.iv191, %73
  %74 = sext i32 %62 to i64
  %.not107141 = icmp sgt i64 %indvars.iv191, %74
  %or.cond173 = select i1 %.not106, i1 true, i1 %.not107141
  br i1 %or.cond173, label %.loopexit119, label %.lr.ph143

.lr.ph143:                                        ; preds = %._crit_edge139
  %75 = sext i32 %.099.lcssa to i64
  br label %80

.lr.ph138:                                        ; preds = %.preheader120, %.lr.ph138
  %indvars.iv193 = phi i64 [ %indvars.iv.next194, %.lr.ph138 ], [ %indvars.iv191, %.preheader120 ]
  %76 = getelementptr inbounds [501 x [203 x i32]], ptr @f, i64 0, i64 %indvars.iv193, i64 %indvars.iv191
  %77 = load i32, ptr %76, align 4, !tbaa !5
  %.not111 = icmp eq i32 %77, 0
  %indvars.iv.next194 = add nuw nsw i64 %indvars.iv193, 1
  %78 = icmp slt i64 %indvars.iv.next194, %67
  %79 = and i1 %.not111, %78
  br i1 %79, label %.lr.ph138, label %._crit_edge139.loopexit, !llvm.loop !17

80:                                               ; preds = %.lr.ph143, %80
  %indvars.iv196 = phi i64 [ %indvars.iv191, %.lr.ph143 ], [ %indvars.iv.next197, %80 ]
  %81 = getelementptr inbounds [501 x [203 x i32]], ptr @f, i64 0, i64 %indvars.iv191, i64 %indvars.iv196
  %82 = getelementptr inbounds [501 x [203 x i32]], ptr @f, i64 0, i64 %75, i64 %indvars.iv196
  call void @_ZSt4swapIiENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 4 dereferenceable(4) %81, ptr noundef nonnull align 4 dereferenceable(4) %82) #9
  %indvars.iv.next197 = add nuw nsw i64 %indvars.iv196, 1
  %83 = load i32, ptr @tot, align 4
  %84 = sext i32 %83 to i64
  %.not107.not = icmp slt i64 %indvars.iv196, %84
  br i1 %.not107.not, label %80, label %.loopexit119, !llvm.loop !18

.loopexit119:                                     ; preds = %80, %._crit_edge139
  %.pre-phi = phi i64 [ %74, %._crit_edge139 ], [ %84, %80 ]
  %85 = phi i32 [ %62, %._crit_edge139 ], [ %83, %80 ]
  %86 = getelementptr inbounds [501 x [203 x i32]], ptr @f, i64 0, i64 %indvars.iv191, i64 %indvars.iv191
  %87 = load i32, ptr %86, align 4, !tbaa !5
  %88 = sext i32 %87 to i64
  %89 = getelementptr inbounds [13 x i32], ptr @inv, i64 0, i64 %88
  %90 = load i32, ptr %89, align 4, !tbaa !5
  %.not108144 = icmp sgt i64 %indvars.iv191, %.pre-phi
  br i1 %.not108144, label %.preheader117.thread, label %.lr.ph147.preheader

.lr.ph147.preheader:                              ; preds = %.loopexit119
  %91 = add i32 %85, 1
  %wide.trip.count202 = zext i32 %91 to i64
  %92 = sub nsw i64 %wide.trip.count202, %indvars.iv191
  %min.iters.check253 = icmp ult i64 %92, 8
  br i1 %min.iters.check253, label %.lr.ph147.preheader268, label %vector.ph254

.lr.ph147.preheader268:                           ; preds = %middle.block251, %.lr.ph147.preheader
  %indvars.iv199.ph = phi i64 [ %indvars.iv191, %.lr.ph147.preheader ], [ %ind.end257, %middle.block251 ]
  br label %.lr.ph147

vector.ph254:                                     ; preds = %.lr.ph147.preheader
  %n.vec256 = and i64 %92, -8
  %ind.end257 = add i64 %indvars.iv191, %n.vec256
  %broadcast.splatinsert264 = insertelement <4 x i32> poison, i32 %90, i64 0
  %broadcast.splat265 = shufflevector <4 x i32> %broadcast.splatinsert264, <4 x i32> poison, <4 x i32> zeroinitializer
  br label %vector.body259

vector.body259:                                   ; preds = %vector.body259, %vector.ph254
  %index260 = phi i64 [ 0, %vector.ph254 ], [ %index.next266, %vector.body259 ]
  %offset.idx261 = add i64 %indvars.iv191, %index260
  %93 = getelementptr inbounds [501 x [203 x i32]], ptr @f, i64 0, i64 %indvars.iv191, i64 %offset.idx261
  %94 = getelementptr inbounds i8, ptr %93, i64 16
  %wide.load262 = load <4 x i32>, ptr %93, align 4, !tbaa !5
  %wide.load263 = load <4 x i32>, ptr %94, align 4, !tbaa !5
  %95 = mul nsw <4 x i32> %wide.load262, %broadcast.splat265
  %96 = mul nsw <4 x i32> %wide.load263, %broadcast.splat265
  %97 = srem <4 x i32> %95, <i32 13, i32 13, i32 13, i32 13>
  %98 = srem <4 x i32> %96, <i32 13, i32 13, i32 13, i32 13>
  store <4 x i32> %97, ptr %93, align 4, !tbaa !5
  store <4 x i32> %98, ptr %94, align 4, !tbaa !5
  %index.next266 = add nuw i64 %index260, 8
  %99 = icmp eq i64 %index.next266, %n.vec256
  br i1 %99, label %middle.block251, label %vector.body259, !llvm.loop !19

middle.block251:                                  ; preds = %vector.body259
  %cmp.n267 = icmp eq i64 %92, %n.vec256
  br i1 %cmp.n267, label %.preheader117, label %.lr.ph147.preheader268

.preheader117:                                    ; preds = %.lr.ph147, %middle.block251
  %100 = load i32, ptr @m, align 4, !tbaa !5
  %101 = icmp slt i32 %100, 1
  %brmerge = or i1 %101, %.not108144
  br i1 %brmerge, label %._crit_edge155, label %.lr.ph154.split.preheader

.preheader117.thread:                             ; preds = %.loopexit119
  %102 = load i32, ptr @m, align 4, !tbaa !5
  br label %._crit_edge155

.lr.ph154.split.preheader:                        ; preds = %.preheader117
  %103 = trunc i64 %indvars.iv191 to i32
  %smax = call i32 @llvm.smax.i32(i32 %85, i32 %103)
  %104 = add nuw i32 %smax, 1
  %wide.trip.count212 = zext nneg i32 %100 to i64
  %wide.trip.count207 = zext i32 %104 to i64
  %105 = mul nuw nsw i64 %wide.trip.count212, 812
  %106 = zext nneg i32 %smax to i64
  %107 = sub nsw i64 %106, %indvars.iv191
  %108 = shl nsw i64 %107, 2
  %109 = getelementptr i8, ptr %gep, i64 %105
  %scevgep234 = getelementptr i8, ptr %109, i64 %108
  %scevgep237 = getelementptr i8, ptr %scevgep236, i64 %108
  %110 = zext i32 %smax to i64
  %reass.sub = sub nsw i64 %110, %indvars.iv191
  %111 = add i64 %reass.sub, 1
  %min.iters.check240 = icmp ult i64 %111, 4
  %bound0 = icmp ult ptr %scevgep, %scevgep237
  %bound1 = icmp ult ptr %scevgep235, %scevgep234
  %found.conflict = and i1 %bound0, %bound1
  %n.vec243 = and i64 %111, -4
  %ind.end = add i64 %indvars.iv191, %n.vec243
  %cmp.n250 = icmp eq i64 %111, %n.vec243
  br label %.lr.ph154.split

.lr.ph147:                                        ; preds = %.lr.ph147.preheader268, %.lr.ph147
  %indvars.iv199 = phi i64 [ %indvars.iv.next200, %.lr.ph147 ], [ %indvars.iv199.ph, %.lr.ph147.preheader268 ]
  %112 = getelementptr inbounds [501 x [203 x i32]], ptr @f, i64 0, i64 %indvars.iv191, i64 %indvars.iv199
  %113 = load i32, ptr %112, align 4, !tbaa !5
  %114 = mul nsw i32 %113, %90
  %115 = srem i32 %114, 13
  store i32 %115, ptr %112, align 4, !tbaa !5
  %indvars.iv.next200 = add nuw nsw i64 %indvars.iv199, 1
  %exitcond203.not = icmp eq i64 %indvars.iv.next200, %wide.trip.count202
  br i1 %exitcond203.not, label %.preheader117, label %.lr.ph147, !llvm.loop !20

._crit_edge155:                                   ; preds = %..loopexit_crit_edge, %.preheader117, %.preheader117.thread
  %116 = phi i32 [ %100, %.preheader117 ], [ %102, %.preheader117.thread ], [ %100, %..loopexit_crit_edge ]
  %indvars.iv.next192 = add nuw nsw i64 %indvars.iv191, 1
  %117 = icmp slt i64 %indvars.iv.next192, %.pre-phi
  br i1 %117, label %.preheader120, label %._crit_edge158, !llvm.loop !21

.lr.ph154.split:                                  ; preds = %.lr.ph154.split.preheader, %..loopexit_crit_edge
  %indvars.iv209 = phi i64 [ 0, %.lr.ph154.split.preheader ], [ %indvars.iv.next210, %..loopexit_crit_edge ]
  %118 = icmp eq i64 %indvars.iv191, %indvars.iv209
  br i1 %118, label %..loopexit_crit_edge, label %119

119:                                              ; preds = %.lr.ph154.split
  %120 = getelementptr inbounds [501 x [203 x i32]], ptr @f, i64 0, i64 %indvars.iv209, i64 %indvars.iv191
  %121 = load i32, ptr %120, align 4, !tbaa !5
  %.not109 = icmp eq i32 %121, 0
  br i1 %.not109, label %..loopexit_crit_edge, label %.lr.ph152

.lr.ph152:                                        ; preds = %119
  %122 = sub nsw i32 13, %121
  %brmerge281 = select i1 %min.iters.check240, i1 true, i1 %found.conflict
  br i1 %brmerge281, label %scalar.ph239.preheader, label %vector.ph241

vector.ph241:                                     ; preds = %.lr.ph152
  %broadcast.splatinsert = insertelement <4 x i32> poison, i32 %122, i64 0
  %broadcast.splat = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
  br label %vector.body245

vector.body245:                                   ; preds = %vector.body245, %vector.ph241
  %index246 = phi i64 [ 0, %vector.ph241 ], [ %index.next249, %vector.body245 ]
  %offset.idx = add i64 %indvars.iv191, %index246
  %123 = getelementptr inbounds [501 x [203 x i32]], ptr @f, i64 0, i64 %indvars.iv209, i64 %offset.idx
  %wide.load247 = load <4 x i32>, ptr %123, align 4, !tbaa !5, !alias.scope !22, !noalias !25
  %124 = getelementptr inbounds [501 x [203 x i32]], ptr @f, i64 0, i64 %indvars.iv191, i64 %offset.idx
  %wide.load248 = load <4 x i32>, ptr %124, align 4, !tbaa !5, !alias.scope !25
  %125 = mul nsw <4 x i32> %wide.load248, %broadcast.splat
  %126 = add nsw <4 x i32> %125, %wide.load247
  %127 = srem <4 x i32> %126, <i32 13, i32 13, i32 13, i32 13>
  store <4 x i32> %127, ptr %123, align 4, !tbaa !5, !alias.scope !22, !noalias !25
  %index.next249 = add nuw i64 %index246, 4
  %128 = icmp eq i64 %index.next249, %n.vec243
  br i1 %128, label %middle.block238, label %vector.body245, !llvm.loop !27

middle.block238:                                  ; preds = %vector.body245
  br i1 %cmp.n250, label %..loopexit_crit_edge, label %scalar.ph239.preheader

scalar.ph239.preheader:                           ; preds = %.lr.ph152, %middle.block238
  %indvars.iv204.ph = phi i64 [ %indvars.iv191, %.lr.ph152 ], [ %ind.end, %middle.block238 ]
  %129 = add i64 %indvars.iv204.ph, %110
  %130 = and i64 %129, 1
  %lcmp.mod273.not.not = icmp eq i64 %130, 0
  br i1 %lcmp.mod273.not.not, label %scalar.ph239.prol, label %scalar.ph239.prol.loopexit

scalar.ph239.prol:                                ; preds = %scalar.ph239.preheader
  %131 = getelementptr inbounds [501 x [203 x i32]], ptr @f, i64 0, i64 %indvars.iv209, i64 %indvars.iv204.ph
  %132 = load i32, ptr %131, align 4, !tbaa !5
  %133 = getelementptr inbounds [501 x [203 x i32]], ptr @f, i64 0, i64 %indvars.iv191, i64 %indvars.iv204.ph
  %134 = load i32, ptr %133, align 4, !tbaa !5
  %135 = mul nsw i32 %134, %122
  %136 = add nsw i32 %135, %132
  %137 = srem i32 %136, 13
  store i32 %137, ptr %131, align 4, !tbaa !5
  %indvars.iv.next205.prol = add nuw nsw i64 %indvars.iv204.ph, 1
  br label %scalar.ph239.prol.loopexit

scalar.ph239.prol.loopexit:                       ; preds = %scalar.ph239.prol, %scalar.ph239.preheader
  %indvars.iv204.unr = phi i64 [ %indvars.iv204.ph, %scalar.ph239.preheader ], [ %indvars.iv.next205.prol, %scalar.ph239.prol ]
  %138 = icmp eq i64 %indvars.iv204.ph, %110
  br i1 %138, label %..loopexit_crit_edge, label %scalar.ph239

scalar.ph239:                                     ; preds = %scalar.ph239.prol.loopexit, %scalar.ph239
  %indvars.iv204 = phi i64 [ %indvars.iv.next205.1, %scalar.ph239 ], [ %indvars.iv204.unr, %scalar.ph239.prol.loopexit ]
  %139 = getelementptr inbounds [501 x [203 x i32]], ptr @f, i64 0, i64 %indvars.iv209, i64 %indvars.iv204
  %140 = load i32, ptr %139, align 4, !tbaa !5
  %141 = getelementptr inbounds [501 x [203 x i32]], ptr @f, i64 0, i64 %indvars.iv191, i64 %indvars.iv204
  %142 = load i32, ptr %141, align 4, !tbaa !5
  %143 = mul nsw i32 %142, %122
  %144 = add nsw i32 %143, %140
  %145 = srem i32 %144, 13
  store i32 %145, ptr %139, align 4, !tbaa !5
  %indvars.iv.next205 = add nuw nsw i64 %indvars.iv204, 1
  %146 = getelementptr inbounds [501 x [203 x i32]], ptr @f, i64 0, i64 %indvars.iv209, i64 %indvars.iv.next205
  %147 = load i32, ptr %146, align 4, !tbaa !5
  %148 = getelementptr inbounds [501 x [203 x i32]], ptr @f, i64 0, i64 %indvars.iv191, i64 %indvars.iv.next205
  %149 = load i32, ptr %148, align 4, !tbaa !5
  %150 = mul nsw i32 %149, %122
  %151 = add nsw i32 %150, %147
  %152 = srem i32 %151, 13
  store i32 %152, ptr %146, align 4, !tbaa !5
  %indvars.iv.next205.1 = add nuw nsw i64 %indvars.iv204, 2
  %exitcond208.not.1 = icmp eq i64 %indvars.iv.next205.1, %wide.trip.count207
  br i1 %exitcond208.not.1, label %..loopexit_crit_edge, label %scalar.ph239, !llvm.loop !28

..loopexit_crit_edge:                             ; preds = %scalar.ph239.prol.loopexit, %scalar.ph239, %middle.block238, %.lr.ph154.split, %119
  %indvars.iv.next210 = add nuw nsw i64 %indvars.iv209, 1
  %exitcond213.not = icmp eq i64 %indvars.iv.next210, %wide.trip.count212
  br i1 %exitcond213.not, label %._crit_edge155, label %.lr.ph154.split, !llvm.loop !29

._crit_edge161:                                   ; preds = %.lr.ph160, %._crit_edge158
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #9
  %153 = load i32, ptr @n, align 4, !tbaa !5
  %154 = sext i32 %153 to i64
  %155 = shl nsw i64 %154, 2
  call void @llvm.memset.p0.i64(ptr nonnull align 4 getelementptr inbounds (i8, ptr @dis, i64 4), i8 63, i64 %155, i1 false)
  %156 = load i32, ptr @S, align 4, !tbaa !5
  %157 = sext i32 %156 to i64
  %158 = getelementptr inbounds [203 x i32], ptr @dis, i64 0, i64 %157
  store i32 0, ptr %158, align 4, !tbaa !5
  %159 = icmp sgt i32 %153, 1
  br i1 %159, label %.preheader, label %._crit_edge171

.lr.ph160:                                        ; preds = %._crit_edge158, %.lr.ph160
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #9
  %160 = call noundef ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKS0_IiiEiEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #9
  %161 = load i32, ptr %160, align 4, !tbaa !30
  store i32 %161, ptr %5, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #9
  %162 = call noundef ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKS0_IiiEiEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #9
  %163 = getelementptr inbounds i8, ptr %162, i64 4
  %164 = load i32, ptr %163, align 4, !tbaa !33
  store i32 %164, ptr %6, align 4, !tbaa !5
  %165 = call noundef ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKS0_IiiEiEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #9
  %166 = getelementptr inbounds i8, ptr %165, i64 8
  %167 = load i32, ptr %166, align 4, !tbaa !34
  %168 = load i32, ptr %5, align 4, !tbaa !5
  %169 = sext i32 %168 to i64
  %170 = getelementptr inbounds [203 x %"class.std::vector"], ptr @e, i64 0, i64 %169
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #9
  %171 = sext i32 %167 to i64
  %172 = load i32, ptr @tot, align 4, !tbaa !5
  %173 = sext i32 %172 to i64
  %174 = getelementptr inbounds [501 x [203 x i32]], ptr @f, i64 0, i64 %171, i64 %173
  %175 = call i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__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) %174)
  store i64 %175, ptr %7, align 8
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %170, ptr noundef nonnull align 4 dereferenceable(8) %7)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #9
  %176 = load i32, ptr %6, align 4, !tbaa !5
  %177 = sext i32 %176 to i64
  %178 = getelementptr inbounds [203 x %"class.std::vector"], ptr @e, i64 0, i64 %177
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #9
  %179 = load i32, ptr @tot, align 4, !tbaa !5
  %180 = sext i32 %179 to i64
  %181 = getelementptr inbounds [501 x [203 x i32]], ptr @f, i64 0, i64 %171, i64 %180
  %182 = call i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %5, ptr noundef nonnull align 4 dereferenceable(4) %181)
  store i64 %182, ptr %8, align 8
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %178, ptr noundef nonnull align 4 dereferenceable(8) %8)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #9
  %183 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt17_Rb_tree_iteratorISt4pairIKS0_IiiEiEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #9
  %184 = call ptr @_ZNSt3mapISt4pairIiiEiSt4lessIS1_ESaIS0_IKS1_iEEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) @sp) #9
  store ptr %184, ptr %4, align 8
  %185 = call noundef zeroext i1 @_ZStneRKSt17_Rb_tree_iteratorISt4pairIKS0_IiiEiEES6_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %4) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #9
  br i1 %185, label %.lr.ph160, label %._crit_edge161, !llvm.loop !35

.preheader:                                       ; preds = %._crit_edge161, %.critedge
  %186 = phi i32 [ %244, %.critedge ], [ %153, %._crit_edge161 ]
  %.090170 = phi i32 [ %243, %.critedge ], [ 1, %._crit_edge161 ]
  %.not162 = icmp slt i32 %186, 1
  br i1 %.not162, label %._crit_edge171, label %.lr.ph165.preheader

.lr.ph165.preheader:                              ; preds = %.preheader
  %187 = zext nneg i32 %186 to i64
  %xtraiter274 = and i64 %187, 1
  %188 = icmp eq i32 %186, 1
  br i1 %188, label %._crit_edge166.unr-lcssa, label %.lr.ph165.preheader.new

.lr.ph165.preheader.new:                          ; preds = %.lr.ph165.preheader
  %unroll_iter277 = and i64 %187, 2147483646
  br label %.lr.ph165

._crit_edge166.unr-lcssa:                         ; preds = %234, %.lr.ph165.preheader
  %.1.lcssa.ph = phi i32 [ poison, %.lr.ph165.preheader ], [ %.1.1, %234 ]
  %indvars.iv215.unr = phi i64 [ 1, %.lr.ph165.preheader ], [ %indvars.iv.next216.1, %234 ]
  %.089163.unr = phi i32 [ -1, %.lr.ph165.preheader ], [ %.1.1, %234 ]
  %lcmp.mod275.not = icmp eq i64 %xtraiter274, 0
  br i1 %lcmp.mod275.not, label %._crit_edge166, label %.lr.ph165.epil

.lr.ph165.epil:                                   ; preds = %._crit_edge166.unr-lcssa
  %189 = getelementptr inbounds [203 x i8], ptr @vis, i64 0, i64 %indvars.iv215.unr
  %190 = load i8, ptr %189, align 1, !tbaa !36, !range !38, !noundef !39
  %191 = trunc nuw i8 %190 to i1
  br i1 %191, label %._crit_edge166, label %192

192:                                              ; preds = %.lr.ph165.epil
  %193 = icmp eq i32 %.089163.unr, -1
  br i1 %193, label %201, label %194

194:                                              ; preds = %192
  %195 = getelementptr inbounds [203 x i32], ptr @dis, i64 0, i64 %indvars.iv215.unr
  %196 = load i32, ptr %195, align 4, !tbaa !5
  %197 = sext i32 %.089163.unr to i64
  %198 = getelementptr inbounds [203 x i32], ptr @dis, i64 0, i64 %197
  %199 = load i32, ptr %198, align 4, !tbaa !5
  %200 = icmp slt i32 %196, %199
  br i1 %200, label %201, label %._crit_edge166

201:                                              ; preds = %194, %192
  %202 = trunc nuw nsw i64 %indvars.iv215.unr to i32
  br label %._crit_edge166

._crit_edge166:                                   ; preds = %.lr.ph165.epil, %194, %201, %._crit_edge166.unr-lcssa
  %.1.lcssa = phi i32 [ %.1.lcssa.ph, %._crit_edge166.unr-lcssa ], [ %.089163.unr, %.lr.ph165.epil ], [ %202, %201 ], [ %.089163.unr, %194 ]
  %203 = icmp eq i32 %.1.lcssa, -1
  %204 = load i32, ptr @T, align 4
  %205 = icmp eq i32 %.1.lcssa, %204
  %or.cond = select i1 %203, i1 true, i1 %205
  br i1 %or.cond, label %._crit_edge171, label %235

.lr.ph165:                                        ; preds = %234, %.lr.ph165.preheader.new
  %indvars.iv215 = phi i64 [ 1, %.lr.ph165.preheader.new ], [ %indvars.iv.next216.1, %234 ]
  %.089163 = phi i32 [ -1, %.lr.ph165.preheader.new ], [ %.1.1, %234 ]
  %niter278 = phi i64 [ 0, %.lr.ph165.preheader.new ], [ %niter278.next.1, %234 ]
  %206 = getelementptr inbounds [203 x i8], ptr @vis, i64 0, i64 %indvars.iv215
  %207 = load i8, ptr %206, align 1, !tbaa !36, !range !38, !noundef !39
  %208 = trunc nuw i8 %207 to i1
  br i1 %208, label %.lr.ph165.1, label %209

209:                                              ; preds = %.lr.ph165
  %210 = icmp eq i32 %.089163, -1
  br i1 %210, label %218, label %211

211:                                              ; preds = %209
  %212 = getelementptr inbounds [203 x i32], ptr @dis, i64 0, i64 %indvars.iv215
  %213 = load i32, ptr %212, align 4, !tbaa !5
  %214 = sext i32 %.089163 to i64
  %215 = getelementptr inbounds [203 x i32], ptr @dis, i64 0, i64 %214
  %216 = load i32, ptr %215, align 4, !tbaa !5
  %217 = icmp slt i32 %213, %216
  br i1 %217, label %218, label %.lr.ph165.1

218:                                              ; preds = %211, %209
  %219 = trunc nuw nsw i64 %indvars.iv215 to i32
  br label %.lr.ph165.1

.lr.ph165.1:                                      ; preds = %.lr.ph165, %211, %218
  %.1 = phi i32 [ %.089163, %.lr.ph165 ], [ %219, %218 ], [ %.089163, %211 ]
  %indvars.iv.next216 = add nuw nsw i64 %indvars.iv215, 1
  %220 = getelementptr inbounds [203 x i8], ptr @vis, i64 0, i64 %indvars.iv.next216
  %221 = load i8, ptr %220, align 1, !tbaa !36, !range !38, !noundef !39
  %222 = trunc nuw i8 %221 to i1
  br i1 %222, label %234, label %223

223:                                              ; preds = %.lr.ph165.1
  %224 = icmp eq i32 %.1, -1
  br i1 %224, label %232, label %225

225:                                              ; preds = %223
  %226 = getelementptr inbounds [203 x i32], ptr @dis, i64 0, i64 %indvars.iv.next216
  %227 = load i32, ptr %226, align 4, !tbaa !5
  %228 = sext i32 %.1 to i64
  %229 = getelementptr inbounds [203 x i32], ptr @dis, i64 0, i64 %228
  %230 = load i32, ptr %229, align 4, !tbaa !5
  %231 = icmp slt i32 %227, %230
  br i1 %231, label %232, label %234

232:                                              ; preds = %225, %223
  %233 = trunc nuw nsw i64 %indvars.iv.next216 to i32
  br label %234

234:                                              ; preds = %232, %225, %.lr.ph165.1
  %.1.1 = phi i32 [ %.1, %.lr.ph165.1 ], [ %233, %232 ], [ %.1, %225 ]
  %indvars.iv.next216.1 = add nuw nsw i64 %indvars.iv215, 2
  %niter278.next.1 = add i64 %niter278, 2
  %niter278.ncmp.1 = icmp eq i64 %niter278.next.1, %unroll_iter277
  br i1 %niter278.ncmp.1, label %._crit_edge166.unr-lcssa, label %.lr.ph165, !llvm.loop !40

235:                                              ; preds = %._crit_edge166
  %236 = sext i32 %.1.lcssa to i64
  %237 = getelementptr inbounds [203 x i8], ptr @vis, i64 0, i64 %236
  store i8 1, ptr %237, align 1, !tbaa !36
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #9
  %238 = getelementptr inbounds [203 x %"class.std::vector"], ptr @e, i64 0, i64 %236
  %239 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %238) #9
  store ptr %239, ptr %9, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #9
  %240 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %238) #9
  store ptr %240, ptr %10, align 8
  %241 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairIiiESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %9, ptr noundef nonnull align 8 dereferenceable(8) %10) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #9
  br i1 %241, label %.lr.ph169, label %.critedge

.lr.ph169:                                        ; preds = %235
  %242 = getelementptr inbounds [203 x i32], ptr @dis, i64 0, i64 %236
  br label %246

.critedge:                                        ; preds = %259, %235
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #9
  %243 = add nuw nsw i32 %.090170, 1
  %244 = load i32, ptr @n, align 4, !tbaa !5
  %245 = icmp slt i32 %243, %244
  br i1 %245, label %.preheader, label %._crit_edge171, !llvm.loop !41

246:                                              ; preds = %.lr.ph169, %259
  %247 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %9) #9
  %248 = load i32, ptr %247, align 4, !tbaa !42
  %249 = load i32, ptr %242, align 4, !tbaa !5
  %250 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %9) #9
  %251 = getelementptr inbounds i8, ptr %250, i64 4
  %252 = load i32, ptr %251, align 4, !tbaa !43
  %253 = add nsw i32 %252, %249
  %254 = sext i32 %248 to i64
  %255 = getelementptr inbounds [203 x i32], ptr @dis, i64 0, i64 %254
  %256 = load i32, ptr %255, align 4, !tbaa !5
  %257 = icmp slt i32 %253, %256
  br i1 %257, label %258, label %259

258:                                              ; preds = %246
  store i32 %253, ptr %255, align 4, !tbaa !5
  br label %259

259:                                              ; preds = %258, %246
  %260 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %9) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #9
  %261 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %238) #9
  store ptr %261, ptr %10, align 8
  %262 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairIiiESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %9, ptr noundef nonnull align 8 dereferenceable(8) %10) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #9
  br i1 %262, label %246, label %.critedge, !llvm.loop !44

._crit_edge171:                                   ; preds = %.preheader, %.critedge, %._crit_edge166, %._crit_edge161
  %263 = load i32, ptr @T, align 4, !tbaa !5
  %264 = sext i32 %263 to i64
  %265 = getelementptr inbounds [203 x i32], ptr @dis, i64 0, i64 %264
  %266 = load i32, ptr %265, align 4, !tbaa !5
  %267 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef %266)
  ret i32 0
}

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i32 @_Z5getIDii(i32 noundef, i32 noundef) local_unnamed_addr #3

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZStneRKSt17_Rb_tree_iteratorISt4pairIKS0_IiiEiEES6_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #5

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

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

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

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

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairIiiESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #4

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

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

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

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #8

attributes #0 = { mustprogress norecurse uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { 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 #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 = { 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 = { 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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #8 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #9 = { 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 = distinct !{!16, !10}
!17 = distinct !{!17, !10}
!18 = distinct !{!18, !10}
!19 = distinct !{!19, !10, !11, !12}
!20 = distinct !{!20, !10, !12, !11}
!21 = distinct !{!21, !10}
!22 = !{!23}
!23 = distinct !{!23, !24}
!24 = distinct !{!24, !"LVerDomain"}
!25 = !{!26}
!26 = distinct !{!26, !24}
!27 = distinct !{!27, !10, !11, !12}
!28 = distinct !{!28, !10, !11}
!29 = distinct !{!29, !10}
!30 = !{!31, !6, i64 0}
!31 = !{!"_ZTSSt4pairIKS_IiiEiE", !32, i64 0, !6, i64 8}
!32 = !{!"_ZTSSt4pairIiiE", !6, i64 0, !6, i64 4}
!33 = !{!31, !6, i64 4}
!34 = !{!31, !6, i64 8}
!35 = distinct !{!35, !10}
!36 = !{!37, !37, i64 0}
!37 = !{!"bool", !7, i64 0}
!38 = !{i8 0, i8 2}
!39 = !{}
!40 = distinct !{!40, !10}
!41 = distinct !{!41, !10}
!42 = !{!32, !6, i64 0}
!43 = !{!32, !6, i64 4}
!44 = distinct !{!44, !10}


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