; LLVM IR from eyangch/competitive-programming :: Codeforces/1720 (e)

; 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::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::set" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<long long, long long, std::_Identity<long long>, std::less<long long>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<long long, long long, std::_Identity<long long>, std::less<long long>>::_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 }
%"struct.std::pair" = type <{ %"struct.std::_Rb_tree_const_iterator", i8, [7 x i8] }>
%"struct.std::_Rb_tree_const_iterator" = type { ptr }

@N = external dso_local global i64, align 8
@K = external dso_local global i64, align 8
@A = external dso_local global [500 x [500 x i64]], align 16
@mnx = external dso_local global [250000 x i64], align 16
@mny = external dso_local global [250000 x i64], align 16
@mxx = external dso_local global [250000 x i64], align 16
@mxy = external dso_local global [250000 x i64], align 16
@P = external dso_local global [501 x [501 x i64]], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca i64, align 8
  %3 = alloca %"class.std::set", align 8
  %4 = alloca i64, align 8
  %5 = alloca i32, align 4
  %6 = alloca i64, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca %"struct.std::pair", align 8
  %10 = alloca i64, align 8
  %11 = alloca i8, align 1
  %12 = alloca i64, align 8
  %13 = alloca i64, align 8
  %14 = alloca i64, align 8
  %15 = alloca i64, align 8
  %16 = alloca i64, align 8
  %17 = alloca i64, align 8
  %18 = alloca i64, align 8
  %19 = alloca i64, align 8
  %20 = alloca i64, align 8
  %21 = alloca i64, align 8
  %22 = alloca i64, align 8
  %23 = alloca i64, align 8
  %24 = alloca i64, align 8
  %25 = alloca i64, align 8
  %26 = alloca i64, align 8
  %27 = alloca i64, align 8
  %28 = alloca i64, align 8
  store i32 0, ptr %1, align 4
  %29 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %30 = getelementptr i8, ptr %29, i64 -24
  %31 = load i64, ptr %30, align 8
  %32 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %31
  %33 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %32, ptr noundef null)
  %34 = call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %35 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) @N)
  %36 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %35, ptr noundef nonnull align 8 dereferenceable(8) @K)
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #7
  store i64 0, ptr %2, align 8, !tbaa !8
  br label %37

37:                                               ; preds = %53, %0
  %38 = load i64, ptr %2, align 8, !tbaa !8
  %39 = load i64, ptr @N, align 8, !tbaa !8
  %40 = load i64, ptr @N, align 8, !tbaa !8
  %41 = mul nsw i64 %39, %40
  %42 = icmp slt i64 %38, %41
  br i1 %42, label %44, label %43

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

44:                                               ; preds = %37
  %45 = load i64, ptr %2, align 8, !tbaa !8
  %46 = getelementptr inbounds [250000 x i64], ptr @mny, i64 0, i64 %45
  store i64 1000000000000000, ptr %46, align 8, !tbaa !8
  %47 = load i64, ptr %2, align 8, !tbaa !8
  %48 = getelementptr inbounds [250000 x i64], ptr @mnx, i64 0, i64 %47
  store i64 1000000000000000, ptr %48, align 8, !tbaa !8
  %49 = load i64, ptr %2, align 8, !tbaa !8
  %50 = getelementptr inbounds [250000 x i64], ptr @mxy, i64 0, i64 %49
  store i64 -1000000000000000, ptr %50, align 8, !tbaa !8
  %51 = load i64, ptr %2, align 8, !tbaa !8
  %52 = getelementptr inbounds [250000 x i64], ptr @mxx, i64 0, i64 %51
  store i64 -1000000000000000, ptr %52, align 8, !tbaa !8
  br label %53

53:                                               ; preds = %44
  %54 = load i64, ptr %2, align 8, !tbaa !8
  %55 = add nsw i64 %54, 1
  store i64 %55, ptr %2, align 8, !tbaa !8
  br label %37, !llvm.loop !11

56:                                               ; preds = %43
  call void @llvm.lifetime.start.p0(i64 48, ptr %3) #7
  call void @_ZNSt3setIxSt4lessIxESaIxEEC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %3) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #7
  store i64 0, ptr %4, align 8, !tbaa !8
  br label %57

57:                                               ; preds = %159, %56
  %58 = load i64, ptr %4, align 8, !tbaa !8
  %59 = load i64, ptr @N, align 8, !tbaa !8
  %60 = icmp slt i64 %58, %59
  br i1 %60, label %62, label %61

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

62:                                               ; preds = %57
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #7
  store i64 0, ptr %6, align 8, !tbaa !8
  br label %63

63:                                               ; preds = %151, %62
  %64 = load i64, ptr %6, align 8, !tbaa !8
  %65 = load i64, ptr @N, align 8, !tbaa !8
  %66 = icmp slt i64 %64, %65
  br i1 %66, label %68, label %67

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

68:                                               ; preds = %63
  %69 = load i64, ptr %4, align 8, !tbaa !8
  %70 = getelementptr inbounds [500 x [500 x i64]], ptr @A, i64 0, i64 %69
  %71 = load i64, ptr %6, align 8, !tbaa !8
  %72 = getelementptr inbounds [500 x i64], ptr %70, i64 0, i64 %71
  %73 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %72)
          to label %74 unwind label %154

74:                                               ; preds = %68
  %75 = load i64, ptr %4, align 8, !tbaa !8
  %76 = getelementptr inbounds [500 x [500 x i64]], ptr @A, i64 0, i64 %75
  %77 = load i64, ptr %6, align 8, !tbaa !8
  %78 = getelementptr inbounds [500 x i64], ptr %76, i64 0, i64 %77
  %79 = load i64, ptr %78, align 8, !tbaa !8
  %80 = add nsw i64 %79, -1
  store i64 %80, ptr %78, align 8, !tbaa !8
  %81 = load i64, ptr %4, align 8, !tbaa !8
  %82 = getelementptr inbounds [500 x [500 x i64]], ptr @A, i64 0, i64 %81
  %83 = load i64, ptr %6, align 8, !tbaa !8
  %84 = getelementptr inbounds [500 x i64], ptr %82, i64 0, i64 %83
  %85 = invoke { ptr, i8 } @_ZNSt3setIxSt4lessIxESaIxEE6insertERKx(ptr noundef nonnull align 8 dereferenceable(48) %3, ptr noundef nonnull align 8 dereferenceable(8) %84)
          to label %86 unwind label %154

86:                                               ; preds = %74
  %87 = getelementptr inbounds { ptr, i8 }, ptr %9, i32 0, i32 0
  %88 = extractvalue { ptr, i8 } %85, 0
  store ptr %88, ptr %87, align 8
  %89 = getelementptr inbounds { ptr, i8 }, ptr %9, i32 0, i32 1
  %90 = extractvalue { ptr, i8 } %85, 1
  store i8 %90, ptr %89, align 8
  %91 = load i64, ptr %4, align 8, !tbaa !8
  %92 = getelementptr inbounds [500 x [500 x i64]], ptr @A, i64 0, i64 %91
  %93 = load i64, ptr %6, align 8, !tbaa !8
  %94 = getelementptr inbounds [500 x i64], ptr %92, i64 0, i64 %93
  %95 = load i64, ptr %94, align 8, !tbaa !8
  %96 = getelementptr inbounds [250000 x i64], ptr @mnx, i64 0, i64 %95
  %97 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %96, ptr noundef nonnull align 8 dereferenceable(8) %4)
          to label %98 unwind label %154

98:                                               ; preds = %86
  %99 = load i64, ptr %97, align 8, !tbaa !8
  %100 = load i64, ptr %4, align 8, !tbaa !8
  %101 = getelementptr inbounds [500 x [500 x i64]], ptr @A, i64 0, i64 %100
  %102 = load i64, ptr %6, align 8, !tbaa !8
  %103 = getelementptr inbounds [500 x i64], ptr %101, i64 0, i64 %102
  %104 = load i64, ptr %103, align 8, !tbaa !8
  %105 = getelementptr inbounds [250000 x i64], ptr @mnx, i64 0, i64 %104
  store i64 %99, ptr %105, align 8, !tbaa !8
  %106 = load i64, ptr %4, align 8, !tbaa !8
  %107 = getelementptr inbounds [500 x [500 x i64]], ptr @A, i64 0, i64 %106
  %108 = load i64, ptr %6, align 8, !tbaa !8
  %109 = getelementptr inbounds [500 x i64], ptr %107, i64 0, i64 %108
  %110 = load i64, ptr %109, align 8, !tbaa !8
  %111 = getelementptr inbounds [250000 x i64], ptr @mny, i64 0, i64 %110
  %112 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %111, ptr noundef nonnull align 8 dereferenceable(8) %6)
          to label %113 unwind label %154

113:                                              ; preds = %98
  %114 = load i64, ptr %112, align 8, !tbaa !8
  %115 = load i64, ptr %4, align 8, !tbaa !8
  %116 = getelementptr inbounds [500 x [500 x i64]], ptr @A, i64 0, i64 %115
  %117 = load i64, ptr %6, align 8, !tbaa !8
  %118 = getelementptr inbounds [500 x i64], ptr %116, i64 0, i64 %117
  %119 = load i64, ptr %118, align 8, !tbaa !8
  %120 = getelementptr inbounds [250000 x i64], ptr @mny, i64 0, i64 %119
  store i64 %114, ptr %120, align 8, !tbaa !8
  %121 = load i64, ptr %4, align 8, !tbaa !8
  %122 = getelementptr inbounds [500 x [500 x i64]], ptr @A, i64 0, i64 %121
  %123 = load i64, ptr %6, align 8, !tbaa !8
  %124 = getelementptr inbounds [500 x i64], ptr %122, i64 0, i64 %123
  %125 = load i64, ptr %124, align 8, !tbaa !8
  %126 = getelementptr inbounds [250000 x i64], ptr @mxx, i64 0, i64 %125
  %127 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %126, ptr noundef nonnull align 8 dereferenceable(8) %4)
          to label %128 unwind label %154

128:                                              ; preds = %113
  %129 = load i64, ptr %127, align 8, !tbaa !8
  %130 = load i64, ptr %4, align 8, !tbaa !8
  %131 = getelementptr inbounds [500 x [500 x i64]], ptr @A, i64 0, i64 %130
  %132 = load i64, ptr %6, align 8, !tbaa !8
  %133 = getelementptr inbounds [500 x i64], ptr %131, i64 0, i64 %132
  %134 = load i64, ptr %133, align 8, !tbaa !8
  %135 = getelementptr inbounds [250000 x i64], ptr @mxx, i64 0, i64 %134
  store i64 %129, ptr %135, align 8, !tbaa !8
  %136 = load i64, ptr %4, align 8, !tbaa !8
  %137 = getelementptr inbounds [500 x [500 x i64]], ptr @A, i64 0, i64 %136
  %138 = load i64, ptr %6, align 8, !tbaa !8
  %139 = getelementptr inbounds [500 x i64], ptr %137, i64 0, i64 %138
  %140 = load i64, ptr %139, align 8, !tbaa !8
  %141 = getelementptr inbounds [250000 x i64], ptr @mxy, i64 0, i64 %140
  %142 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %141, ptr noundef nonnull align 8 dereferenceable(8) %6)
          to label %143 unwind label %154

143:                                              ; preds = %128
  %144 = load i64, ptr %142, align 8, !tbaa !8
  %145 = load i64, ptr %4, align 8, !tbaa !8
  %146 = getelementptr inbounds [500 x [500 x i64]], ptr @A, i64 0, i64 %145
  %147 = load i64, ptr %6, align 8, !tbaa !8
  %148 = getelementptr inbounds [500 x i64], ptr %146, i64 0, i64 %147
  %149 = load i64, ptr %148, align 8, !tbaa !8
  %150 = getelementptr inbounds [250000 x i64], ptr @mxy, i64 0, i64 %149
  store i64 %144, ptr %150, align 8, !tbaa !8
  br label %151

151:                                              ; preds = %143
  %152 = load i64, ptr %6, align 8, !tbaa !8
  %153 = add nsw i64 %152, 1
  store i64 %153, ptr %6, align 8, !tbaa !8
  br label %63, !llvm.loop !13

154:                                              ; preds = %128, %113, %98, %86, %74, %68
  %155 = landingpad { ptr, i32 }
          cleanup
  %156 = extractvalue { ptr, i32 } %155, 0
  store ptr %156, ptr %7, align 8
  %157 = extractvalue { ptr, i32 } %155, 1
  store i32 %157, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #7
  br label %449

158:                                              ; preds = %67
  br label %159

159:                                              ; preds = %158
  %160 = load i64, ptr %4, align 8, !tbaa !8
  %161 = add nsw i64 %160, 1
  store i64 %161, ptr %4, align 8, !tbaa !8
  br label %57, !llvm.loop !14

162:                                              ; preds = %61
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #7
  %163 = call noundef i64 @_ZNKSt3setIxSt4lessIxESaIxEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(48) %3) #7
  store i64 %163, ptr %10, align 8, !tbaa !8
  %164 = load i64, ptr @K, align 8, !tbaa !8
  %165 = load i64, ptr %10, align 8, !tbaa !8
  %166 = icmp sge i64 %164, %165
  br i1 %166, label %167, label %179

167:                                              ; preds = %162
  %168 = load i64, ptr @K, align 8, !tbaa !8
  %169 = load i64, ptr %10, align 8, !tbaa !8
  %170 = sub nsw i64 %168, %169
  %171 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %170)
          to label %172 unwind label %175

172:                                              ; preds = %167
  %173 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %171, i8 noundef signext 10)
          to label %174 unwind label %175

174:                                              ; preds = %172
  store i32 0, ptr %1, align 4
  store i32 1, ptr %5, align 4
  br label %443

175:                                              ; preds = %172, %167
  %176 = landingpad { ptr, i32 }
          cleanup
  %177 = extractvalue { ptr, i32 } %176, 0
  store ptr %177, ptr %7, align 8
  %178 = extractvalue { ptr, i32 } %176, 1
  store i32 %178, ptr %8, align 4
  br label %448

179:                                              ; preds = %162
  call void @llvm.lifetime.start.p0(i64 1, ptr %11) #7
  store i8 0, ptr %11, align 1, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #7
  store i64 0, ptr %12, align 8, !tbaa !8
  br label %180

180:                                              ; preds = %419, %179
  %181 = load i64, ptr %12, align 8, !tbaa !8
  %182 = load i64, ptr @N, align 8, !tbaa !8
  %183 = icmp slt i64 %181, %182
  br i1 %183, label %185, label %184

184:                                              ; preds = %180
  store i32 11, ptr %5, align 4
  br label %422

185:                                              ; preds = %180
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #7
  store i64 0, ptr %13, align 8, !tbaa !8
  br label %186

186:                                              ; preds = %206, %185
  %187 = load i64, ptr %13, align 8, !tbaa !8
  %188 = load i64, ptr @N, align 8, !tbaa !8
  %189 = icmp slt i64 %187, %188
  br i1 %189, label %191, label %190

190:                                              ; preds = %186
  store i32 14, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #7
  br label %209

191:                                              ; preds = %186
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #7
  store i64 0, ptr %14, align 8, !tbaa !8
  br label %192

192:                                              ; preds = %202, %191
  %193 = load i64, ptr %14, align 8, !tbaa !8
  %194 = load i64, ptr @N, align 8, !tbaa !8
  %195 = icmp slt i64 %193, %194
  br i1 %195, label %197, label %196

196:                                              ; preds = %192
  store i32 17, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #7
  br label %205

197:                                              ; preds = %192
  %198 = load i64, ptr %13, align 8, !tbaa !8
  %199 = getelementptr inbounds [501 x [501 x i64]], ptr @P, i64 0, i64 %198
  %200 = load i64, ptr %14, align 8, !tbaa !8
  %201 = getelementptr inbounds [501 x i64], ptr %199, i64 0, i64 %200
  store i64 0, ptr %201, align 8, !tbaa !8
  br label %202

202:                                              ; preds = %197
  %203 = load i64, ptr %14, align 8, !tbaa !8
  %204 = add nsw i64 %203, 1
  store i64 %204, ptr %14, align 8, !tbaa !8
  br label %192, !llvm.loop !17

205:                                              ; preds = %196
  br label %206

206:                                              ; preds = %205
  %207 = load i64, ptr %13, align 8, !tbaa !8
  %208 = add nsw i64 %207, 1
  store i64 %208, ptr %13, align 8, !tbaa !8
  br label %186, !llvm.loop !18

209:                                              ; preds = %190
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #7
  store i64 0, ptr %15, align 8, !tbaa !8
  br label %210

210:                                              ; preds = %303, %209
  %211 = load i64, ptr %15, align 8, !tbaa !8
  %212 = load i64, ptr @N, align 8, !tbaa !8
  %213 = load i64, ptr @N, align 8, !tbaa !8
  %214 = mul nsw i64 %212, %213
  %215 = icmp slt i64 %211, %214
  br i1 %215, label %217, label %216

216:                                              ; preds = %210
  store i32 20, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #7
  br label %316

217:                                              ; preds = %210
  %218 = load i64, ptr %15, align 8, !tbaa !8
  %219 = getelementptr inbounds [250000 x i64], ptr @mnx, i64 0, i64 %218
  %220 = load i64, ptr %219, align 8, !tbaa !8
  %221 = icmp sgt i64 %220, 23523
  br i1 %221, label %222, label %223

222:                                              ; preds = %217
  br label %303

223:                                              ; preds = %217
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #7
  %224 = load i64, ptr %15, align 8, !tbaa !8
  %225 = getelementptr inbounds [250000 x i64], ptr @mxx, i64 0, i64 %224
  %226 = load i64, ptr %225, align 8, !tbaa !8
  %227 = load i64, ptr %15, align 8, !tbaa !8
  %228 = getelementptr inbounds [250000 x i64], ptr @mnx, i64 0, i64 %227
  %229 = load i64, ptr %228, align 8, !tbaa !8
  %230 = sub nsw i64 %226, %229
  store i64 %230, ptr %17, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #7
  %231 = load i64, ptr %15, align 8, !tbaa !8
  %232 = getelementptr inbounds [250000 x i64], ptr @mxy, i64 0, i64 %231
  %233 = load i64, ptr %232, align 8, !tbaa !8
  %234 = load i64, ptr %15, align 8, !tbaa !8
  %235 = getelementptr inbounds [250000 x i64], ptr @mny, i64 0, i64 %234
  %236 = load i64, ptr %235, align 8, !tbaa !8
  %237 = sub nsw i64 %233, %236
  store i64 %237, ptr %18, align 8, !tbaa !8
  %238 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %17, ptr noundef nonnull align 8 dereferenceable(8) %18)
          to label %239 unwind label %245

239:                                              ; preds = %223
  %240 = load i64, ptr %238, align 8, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #7
  store i64 %240, ptr %16, align 8, !tbaa !8
  %241 = load i64, ptr %16, align 8, !tbaa !8
  %242 = load i64, ptr %12, align 8, !tbaa !8
  %243 = icmp sgt i64 %241, %242
  br i1 %243, label %244, label %249

244:                                              ; preds = %239
  store i32 22, ptr %5, align 4
  br label %300

245:                                              ; preds = %223
  %246 = landingpad { ptr, i32 }
          cleanup
  %247 = extractvalue { ptr, i32 } %246, 0
  store ptr %247, ptr %7, align 8
  %248 = extractvalue { ptr, i32 } %246, 1
  store i32 %248, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #7
  br label %315

249:                                              ; preds = %239
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #7
  store i64 0, ptr %20, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #7
  %250 = load i64, ptr %15, align 8, !tbaa !8
  %251 = getelementptr inbounds [250000 x i64], ptr @mxx, i64 0, i64 %250
  %252 = load i64, ptr %251, align 8, !tbaa !8
  %253 = load i64, ptr %12, align 8, !tbaa !8
  %254 = sub nsw i64 %252, %253
  store i64 %254, ptr %21, align 8, !tbaa !8
  %255 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %20, ptr noundef nonnull align 8 dereferenceable(8) %21)
          to label %256 unwind label %306

256:                                              ; preds = %249
  %257 = load i64, ptr %255, align 8, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #7
  store i64 %257, ptr %19, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #7
  store i64 0, ptr %23, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #7
  %258 = load i64, ptr %15, align 8, !tbaa !8
  %259 = getelementptr inbounds [250000 x i64], ptr @mxy, i64 0, i64 %258
  %260 = load i64, ptr %259, align 8, !tbaa !8
  %261 = load i64, ptr %12, align 8, !tbaa !8
  %262 = sub nsw i64 %260, %261
  store i64 %262, ptr %24, align 8, !tbaa !8
  %263 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %23, ptr noundef nonnull align 8 dereferenceable(8) %24)
          to label %264 unwind label %310

264:                                              ; preds = %256
  %265 = load i64, ptr %263, align 8, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #7
  store i64 %265, ptr %22, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #7
  %266 = load i64, ptr %15, align 8, !tbaa !8
  %267 = getelementptr inbounds [250000 x i64], ptr @mnx, i64 0, i64 %266
  %268 = load i64, ptr %267, align 8, !tbaa !8
  store i64 %268, ptr %25, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #7
  %269 = load i64, ptr %15, align 8, !tbaa !8
  %270 = getelementptr inbounds [250000 x i64], ptr @mny, i64 0, i64 %269
  %271 = load i64, ptr %270, align 8, !tbaa !8
  store i64 %271, ptr %26, align 8, !tbaa !8
  %272 = load i64, ptr %19, align 8, !tbaa !8
  %273 = getelementptr inbounds [501 x [501 x i64]], ptr @P, i64 0, i64 %272
  %274 = load i64, ptr %22, align 8, !tbaa !8
  %275 = getelementptr inbounds [501 x i64], ptr %273, i64 0, i64 %274
  %276 = load i64, ptr %275, align 8, !tbaa !8
  %277 = add nsw i64 %276, 1
  store i64 %277, ptr %275, align 8, !tbaa !8
  %278 = load i64, ptr %19, align 8, !tbaa !8
  %279 = getelementptr inbounds [501 x [501 x i64]], ptr @P, i64 0, i64 %278
  %280 = load i64, ptr %26, align 8, !tbaa !8
  %281 = add nsw i64 %280, 1
  %282 = getelementptr inbounds [501 x i64], ptr %279, i64 0, i64 %281
  %283 = load i64, ptr %282, align 8, !tbaa !8
  %284 = add nsw i64 %283, -1
  store i64 %284, ptr %282, align 8, !tbaa !8
  %285 = load i64, ptr %25, align 8, !tbaa !8
  %286 = add nsw i64 %285, 1
  %287 = getelementptr inbounds [501 x [501 x i64]], ptr @P, i64 0, i64 %286
  %288 = load i64, ptr %22, align 8, !tbaa !8
  %289 = getelementptr inbounds [501 x i64], ptr %287, i64 0, i64 %288
  %290 = load i64, ptr %289, align 8, !tbaa !8
  %291 = add nsw i64 %290, -1
  store i64 %291, ptr %289, align 8, !tbaa !8
  %292 = load i64, ptr %25, align 8, !tbaa !8
  %293 = add nsw i64 %292, 1
  %294 = getelementptr inbounds [501 x [501 x i64]], ptr @P, i64 0, i64 %293
  %295 = load i64, ptr %26, align 8, !tbaa !8
  %296 = add nsw i64 %295, 1
  %297 = getelementptr inbounds [501 x i64], ptr %294, i64 0, i64 %296
  %298 = load i64, ptr %297, align 8, !tbaa !8
  %299 = add nsw i64 %298, 1
  store i64 %299, ptr %297, align 8, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #7
  store i32 0, ptr %5, align 4
  br label %300

300:                                              ; preds = %264, %244
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #7
  %301 = load i32, ptr %5, align 4
  switch i32 %301, label %455 [
    i32 0, label %302
    i32 22, label %303
  ]

302:                                              ; preds = %300
  br label %303

303:                                              ; preds = %302, %300, %222
  %304 = load i64, ptr %15, align 8, !tbaa !8
  %305 = add nsw i64 %304, 1
  store i64 %305, ptr %15, align 8, !tbaa !8
  br label %210, !llvm.loop !19

306:                                              ; preds = %249
  %307 = landingpad { ptr, i32 }
          cleanup
  %308 = extractvalue { ptr, i32 } %307, 0
  store ptr %308, ptr %7, align 8
  %309 = extractvalue { ptr, i32 } %307, 1
  store i32 %309, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #7
  br label %314

310:                                              ; preds = %256
  %311 = landingpad { ptr, i32 }
          cleanup
  %312 = extractvalue { ptr, i32 } %311, 0
  store ptr %312, ptr %7, align 8
  %313 = extractvalue { ptr, i32 } %311, 1
  store i32 %313, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #7
  br label %314

314:                                              ; preds = %310, %306
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #7
  br label %315

315:                                              ; preds = %314, %245
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #7
  br label %447

316:                                              ; preds = %216
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #7
  store i64 0, ptr %27, align 8, !tbaa !8
  br label %317

317:                                              ; preds = %413, %316
  %318 = load i64, ptr %27, align 8, !tbaa !8
  %319 = load i64, ptr %12, align 8, !tbaa !8
  %320 = add nsw i64 %318, %319
  %321 = load i64, ptr @N, align 8, !tbaa !8
  %322 = icmp slt i64 %320, %321
  br i1 %322, label %324, label %323

323:                                              ; preds = %317
  store i32 23, ptr %5, align 4
  br label %416

324:                                              ; preds = %317
  call void @llvm.lifetime.start.p0(i64 8, ptr %28) #7
  store i64 0, ptr %28, align 8, !tbaa !8
  br label %325

325:                                              ; preds = %407, %324
  %326 = load i64, ptr %28, align 8, !tbaa !8
  %327 = load i64, ptr %12, align 8, !tbaa !8
  %328 = add nsw i64 %326, %327
  %329 = load i64, ptr @N, align 8, !tbaa !8
  %330 = icmp slt i64 %328, %329
  br i1 %330, label %332, label %331

331:                                              ; preds = %325
  store i32 26, ptr %5, align 4
  br label %410

332:                                              ; preds = %325
  %333 = load i64, ptr %27, align 8, !tbaa !8
  %334 = icmp ne i64 %333, 0
  br i1 %334, label %335, label %348

335:                                              ; preds = %332
  %336 = load i64, ptr %27, align 8, !tbaa !8
  %337 = sub nsw i64 %336, 1
  %338 = getelementptr inbounds [501 x [501 x i64]], ptr @P, i64 0, i64 %337
  %339 = load i64, ptr %28, align 8, !tbaa !8
  %340 = getelementptr inbounds [501 x i64], ptr %338, i64 0, i64 %339
  %341 = load i64, ptr %340, align 8, !tbaa !8
  %342 = load i64, ptr %27, align 8, !tbaa !8
  %343 = getelementptr inbounds [501 x [501 x i64]], ptr @P, i64 0, i64 %342
  %344 = load i64, ptr %28, align 8, !tbaa !8
  %345 = getelementptr inbounds [501 x i64], ptr %343, i64 0, i64 %344
  %346 = load i64, ptr %345, align 8, !tbaa !8
  %347 = add nsw i64 %346, %341
  store i64 %347, ptr %345, align 8, !tbaa !8
  br label %348

348:                                              ; preds = %335, %332
  %349 = load i64, ptr %28, align 8, !tbaa !8
  %350 = icmp ne i64 %349, 0
  br i1 %350, label %351, label %364

351:                                              ; preds = %348
  %352 = load i64, ptr %27, align 8, !tbaa !8
  %353 = getelementptr inbounds [501 x [501 x i64]], ptr @P, i64 0, i64 %352
  %354 = load i64, ptr %28, align 8, !tbaa !8
  %355 = sub nsw i64 %354, 1
  %356 = getelementptr inbounds [501 x i64], ptr %353, i64 0, i64 %355
  %357 = load i64, ptr %356, align 8, !tbaa !8
  %358 = load i64, ptr %27, align 8, !tbaa !8
  %359 = getelementptr inbounds [501 x [501 x i64]], ptr @P, i64 0, i64 %358
  %360 = load i64, ptr %28, align 8, !tbaa !8
  %361 = getelementptr inbounds [501 x i64], ptr %359, i64 0, i64 %360
  %362 = load i64, ptr %361, align 8, !tbaa !8
  %363 = add nsw i64 %362, %357
  store i64 %363, ptr %361, align 8, !tbaa !8
  br label %364

364:                                              ; preds = %351, %348
  %365 = load i64, ptr %27, align 8, !tbaa !8
  %366 = icmp ne i64 %365, 0
  br i1 %366, label %367, label %384

367:                                              ; preds = %364
  %368 = load i64, ptr %28, align 8, !tbaa !8
  %369 = icmp ne i64 %368, 0
  br i1 %369, label %370, label %384

370:                                              ; preds = %367
  %371 = load i64, ptr %27, align 8, !tbaa !8
  %372 = sub nsw i64 %371, 1
  %373 = getelementptr inbounds [501 x [501 x i64]], ptr @P, i64 0, i64 %372
  %374 = load i64, ptr %28, align 8, !tbaa !8
  %375 = sub nsw i64 %374, 1
  %376 = getelementptr inbounds [501 x i64], ptr %373, i64 0, i64 %375
  %377 = load i64, ptr %376, align 8, !tbaa !8
  %378 = load i64, ptr %27, align 8, !tbaa !8
  %379 = getelementptr inbounds [501 x [501 x i64]], ptr @P, i64 0, i64 %378
  %380 = load i64, ptr %28, align 8, !tbaa !8
  %381 = getelementptr inbounds [501 x i64], ptr %379, i64 0, i64 %380
  %382 = load i64, ptr %381, align 8, !tbaa !8
  %383 = sub nsw i64 %382, %377
  store i64 %383, ptr %381, align 8, !tbaa !8
  br label %384

384:                                              ; preds = %370, %367, %364
  %385 = load i64, ptr %27, align 8, !tbaa !8
  %386 = getelementptr inbounds [501 x [501 x i64]], ptr @P, i64 0, i64 %385
  %387 = load i64, ptr %28, align 8, !tbaa !8
  %388 = getelementptr inbounds [501 x i64], ptr %386, i64 0, i64 %387
  %389 = load i64, ptr %388, align 8, !tbaa !8
  %390 = load i64, ptr %10, align 8, !tbaa !8
  %391 = load i64, ptr @K, align 8, !tbaa !8
  %392 = sub nsw i64 %390, %391
  %393 = icmp eq i64 %389, %392
  br i1 %393, label %405, label %394

394:                                              ; preds = %384
  %395 = load i64, ptr %27, align 8, !tbaa !8
  %396 = getelementptr inbounds [501 x [501 x i64]], ptr @P, i64 0, i64 %395
  %397 = load i64, ptr %28, align 8, !tbaa !8
  %398 = getelementptr inbounds [501 x i64], ptr %396, i64 0, i64 %397
  %399 = load i64, ptr %398, align 8, !tbaa !8
  %400 = load i64, ptr %10, align 8, !tbaa !8
  %401 = load i64, ptr @K, align 8, !tbaa !8
  %402 = sub nsw i64 %400, %401
  %403 = add nsw i64 %402, 1
  %404 = icmp eq i64 %399, %403
  br i1 %404, label %405, label %406

405:                                              ; preds = %394, %384
  store i8 1, ptr %11, align 1, !tbaa !15
  store i32 29, ptr %5, align 4
  br label %410

406:                                              ; preds = %394
  br label %407

407:                                              ; preds = %406
  %408 = load i64, ptr %28, align 8, !tbaa !8
  %409 = add nsw i64 %408, 1
  store i64 %409, ptr %28, align 8, !tbaa !8
  br label %325, !llvm.loop !20

410:                                              ; preds = %405, %331
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #7
  %411 = load i32, ptr %5, align 4
  switch i32 %411, label %416 [
    i32 26, label %412
  ]

412:                                              ; preds = %410
  br label %413

413:                                              ; preds = %412
  %414 = load i64, ptr %27, align 8, !tbaa !8
  %415 = add nsw i64 %414, 1
  store i64 %415, ptr %27, align 8, !tbaa !8
  br label %317, !llvm.loop !21

416:                                              ; preds = %410, %323
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #7
  %417 = load i32, ptr %5, align 4
  switch i32 %417, label %422 [
    i32 23, label %418
  ]

418:                                              ; preds = %416
  br label %419

419:                                              ; preds = %418
  %420 = load i64, ptr %12, align 8, !tbaa !8
  %421 = add nsw i64 %420, 1
  store i64 %421, ptr %12, align 8, !tbaa !8
  br label %180, !llvm.loop !22

422:                                              ; preds = %416, %184
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #7
  %423 = load i32, ptr %5, align 4
  switch i32 %423, label %455 [
    i32 11, label %424
    i32 29, label %425
  ]

424:                                              ; preds = %422
  br label %425

425:                                              ; preds = %424, %422
  %426 = load i8, ptr %11, align 1, !tbaa !15, !range !23, !noundef !24
  %427 = trunc i8 %426 to i1
  br i1 %427, label %428, label %437

428:                                              ; preds = %425
  %429 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef 1)
          to label %430 unwind label %433

430:                                              ; preds = %428
  %431 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %429, i8 noundef signext 10)
          to label %432 unwind label %433

432:                                              ; preds = %430
  br label %442

433:                                              ; preds = %439, %437, %430, %428
  %434 = landingpad { ptr, i32 }
          cleanup
  %435 = extractvalue { ptr, i32 } %434, 0
  store ptr %435, ptr %7, align 8
  %436 = extractvalue { ptr, i32 } %434, 1
  store i32 %436, ptr %8, align 4
  br label %447

437:                                              ; preds = %425
  %438 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef 2)
          to label %439 unwind label %433

439:                                              ; preds = %437
  %440 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %438, i8 noundef signext 10)
          to label %441 unwind label %433

441:                                              ; preds = %439
  br label %442

442:                                              ; preds = %441, %432
  call void @llvm.lifetime.end.p0(i64 1, ptr %11) #7
  store i32 0, ptr %5, align 4
  br label %443

443:                                              ; preds = %442, %174
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #7
  call void @_ZNSt3setIxSt4lessIxESaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %3) #7
  call void @llvm.lifetime.end.p0(i64 48, ptr %3) #7
  %444 = load i32, ptr %5, align 4
  switch i32 %444, label %455 [
    i32 0, label %445
    i32 1, label %445
  ]

445:                                              ; preds = %443, %443
  %446 = load i32, ptr %1, align 4
  ret i32 %446

447:                                              ; preds = %433, %315
  call void @llvm.lifetime.end.p0(i64 1, ptr %11) #7
  br label %448

448:                                              ; preds = %447, %175
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #7
  br label %449

449:                                              ; preds = %448, %154
  call void @_ZNSt3setIxSt4lessIxESaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %3) #7
  call void @llvm.lifetime.end.p0(i64 48, ptr %3) #7
  br label %450

450:                                              ; preds = %449
  %451 = load ptr, ptr %7, align 8
  %452 = load i32, ptr %8, align 4
  %453 = insertvalue { ptr, i32 } poison, ptr %451, 0
  %454 = insertvalue { ptr, i32 } %453, i32 %452, 1
  resume { ptr, i32 } %454

455:                                              ; preds = %443, %422, %300
  unreachable
}

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

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

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(8)) #3 align 2

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

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

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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
declare dso_local { ptr, i8 } @_ZNSt3setIxSt4lessIxESaIxEE6insertERKx(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 8 dereferenceable(8)) #3 align 2

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8), i8 noundef signext) #6

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) #3 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt3setIxSt4lessIxESaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(48)) unnamed_addr #1 align 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 = { 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 #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 = { 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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { 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 #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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"long long", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !12}
!15 = !{!16, !16, i64 0}
!16 = !{!"bool", !10, i64 0}
!17 = distinct !{!17, !12}
!18 = distinct !{!18, !12}
!19 = distinct !{!19, !12}
!20 = distinct !{!20, !12}
!21 = distinct !{!21, !12}
!22 = distinct !{!22, !12}
!23 = !{i8 0, i8 2}
!24 = !{}


; 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::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::set" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<long long, long long, std::_Identity<long long>, std::less<long long>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<long long, long long, std::_Identity<long long>, std::less<long long>>::_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 }

@N = external dso_local global i64, align 8
@K = external dso_local global i64, align 8
@A = external dso_local global [500 x [500 x i64]], align 16
@mnx = external dso_local global [250000 x i64], align 16
@mny = external dso_local global [250000 x i64], align 16
@mxx = external dso_local global [250000 x i64], align 16
@mxy = external dso_local global [250000 x i64], align 16
@P = external dso_local local_unnamed_addr global [501 x [501 x i64]], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca %"class.std::set", align 8
  %2 = alloca i64, align 8
  %3 = alloca i64, align 8
  %4 = alloca i64, align 8
  %5 = alloca i64, align 8
  %6 = alloca i64, align 8
  %7 = alloca i64, align 8
  %8 = alloca i64, align 8
  %9 = alloca i64, align 8
  %10 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %11 = getelementptr i8, ptr %10, i64 -24
  %12 = load i64, ptr %11, align 8
  %13 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %12
  %14 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %13, ptr noundef null)
  %15 = tail call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %16 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) @N)
  %17 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %16, ptr noundef nonnull align 8 dereferenceable(8) @K)
  %18 = load i64, ptr @N, align 8, !tbaa !8
  %.not150 = icmp eq i64 %18, 0
  br i1 %.not150, label %._crit_edge, label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %0
  %19 = mul i64 %18, %18
  %umax = tail call i64 @llvm.umax.i64(i64 %19, i64 1)
  %min.iters.check = icmp ult i64 %19, 4
  br i1 %min.iters.check, label %.lr.ph.preheader183, label %vector.ph

.lr.ph.preheader183:                              ; preds = %middle.block, %.lr.ph.preheader
  %.076116.ph = phi i64 [ 0, %.lr.ph.preheader ], [ %n.vec, %middle.block ]
  br label %.lr.ph

vector.ph:                                        ; preds = %.lr.ph.preheader
  %n.vec = and i64 %umax, -4
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %20 = getelementptr inbounds [250000 x i64], ptr @mny, i64 0, i64 %index
  %21 = getelementptr inbounds i8, ptr %20, i64 16
  store <2 x i64> <i64 1000000000000000, i64 1000000000000000>, ptr %20, align 16, !tbaa !8
  store <2 x i64> <i64 1000000000000000, i64 1000000000000000>, ptr %21, align 16, !tbaa !8
  %22 = getelementptr inbounds [250000 x i64], ptr @mnx, i64 0, i64 %index
  %23 = getelementptr inbounds i8, ptr %22, i64 16
  store <2 x i64> <i64 1000000000000000, i64 1000000000000000>, ptr %22, align 16, !tbaa !8
  store <2 x i64> <i64 1000000000000000, i64 1000000000000000>, ptr %23, align 16, !tbaa !8
  %24 = getelementptr inbounds [250000 x i64], ptr @mxy, i64 0, i64 %index
  %25 = getelementptr inbounds i8, ptr %24, i64 16
  store <2 x i64> <i64 -1000000000000000, i64 -1000000000000000>, ptr %24, align 16, !tbaa !8
  store <2 x i64> <i64 -1000000000000000, i64 -1000000000000000>, ptr %25, align 16, !tbaa !8
  %26 = getelementptr inbounds [250000 x i64], ptr @mxx, i64 0, i64 %index
  %27 = getelementptr inbounds i8, ptr %26, i64 16
  store <2 x i64> <i64 -1000000000000000, i64 -1000000000000000>, ptr %26, align 16, !tbaa !8
  store <2 x i64> <i64 -1000000000000000, i64 -1000000000000000>, ptr %27, align 16, !tbaa !8
  %index.next = add nuw i64 %index, 4
  %28 = icmp eq i64 %index.next, %n.vec
  br i1 %28, label %middle.block, label %vector.body, !llvm.loop !11

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %19, %n.vec
  br i1 %cmp.n, label %._crit_edge, label %.lr.ph.preheader183

._crit_edge:                                      ; preds = %.lr.ph, %middle.block, %0
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %1) #9
  call void @_ZNSt3setIxSt4lessIxESaIxEEC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %1) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #9
  store i64 0, ptr %2, align 8, !tbaa !8
  %29 = load i64, ptr @N, align 8, !tbaa !8
  %30 = icmp sgt i64 %29, 0
  br i1 %30, label %.lr.ph122.split, label %._crit_edge123

.lr.ph:                                           ; preds = %.lr.ph.preheader183, %.lr.ph
  %.076116 = phi i64 [ %35, %.lr.ph ], [ %.076116.ph, %.lr.ph.preheader183 ]
  %31 = getelementptr inbounds [250000 x i64], ptr @mny, i64 0, i64 %.076116
  store i64 1000000000000000, ptr %31, align 8, !tbaa !8
  %32 = getelementptr inbounds [250000 x i64], ptr @mnx, i64 0, i64 %.076116
  store i64 1000000000000000, ptr %32, align 8, !tbaa !8
  %33 = getelementptr inbounds [250000 x i64], ptr @mxy, i64 0, i64 %.076116
  store i64 -1000000000000000, ptr %33, align 8, !tbaa !8
  %34 = getelementptr inbounds [250000 x i64], ptr @mxx, i64 0, i64 %.076116
  store i64 -1000000000000000, ptr %34, align 8, !tbaa !8
  %35 = add nuw nsw i64 %.076116, 1
  %exitcond.not = icmp eq i64 %35, %umax
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph, !llvm.loop !15

._crit_edge123:                                   ; preds = %._crit_edge120, %._crit_edge
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #9
  %36 = call noundef i64 @_ZNKSt3setIxSt4lessIxESaIxEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(48) %1) #9
  %37 = load i64, ptr @K, align 8, !tbaa !8
  %.not = icmp slt i64 %37, %36
  br i1 %.not, label %.preheader114, label %99

.preheader114:                                    ; preds = %._crit_edge123
  %38 = load i64, ptr @N, align 8, !tbaa !8
  %39 = icmp sgt i64 %38, 0
  br i1 %39, label %.preheader113, label %.critedge.invoke

.lr.ph122.split:                                  ; preds = %._crit_edge, %._crit_edge120
  %40 = phi i64 [ %43, %._crit_edge120 ], [ %29, %._crit_edge ]
  %41 = phi i64 [ %45, %._crit_edge120 ], [ 0, %._crit_edge ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #9
  store i64 0, ptr %3, align 8, !tbaa !8
  %42 = icmp sgt i64 %40, 0
  br i1 %42, label %.lr.ph119, label %._crit_edge120

._crit_edge120:                                   ; preds = %57, %.lr.ph122.split
  %43 = phi i64 [ %40, %.lr.ph122.split ], [ %95, %57 ]
  %44 = phi i64 [ %41, %.lr.ph122.split ], [ %89, %57 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #9
  %45 = add nsw i64 %44, 1
  store i64 %45, ptr %2, align 8, !tbaa !8
  %46 = icmp slt i64 %45, %43
  br i1 %46, label %.lr.ph122.split, label %._crit_edge123, !llvm.loop !16

.lr.ph119:                                        ; preds = %.lr.ph122.split, %57
  %47 = phi i64 [ %89, %57 ], [ %41, %.lr.ph122.split ]
  %storemerge97117 = phi i64 [ %94, %57 ], [ 0, %.lr.ph122.split ]
  %48 = getelementptr inbounds [500 x [500 x i64]], ptr @A, i64 0, i64 %47, i64 %storemerge97117
  %49 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %48)
          to label %50 unwind label %97

50:                                               ; preds = %.lr.ph119
  %51 = load i64, ptr %2, align 8, !tbaa !8
  %52 = load i64, ptr %3, align 8, !tbaa !8
  %53 = getelementptr inbounds [500 x [500 x i64]], ptr @A, i64 0, i64 %51, i64 %52
  %54 = load i64, ptr %53, align 8, !tbaa !8
  %55 = add nsw i64 %54, -1
  store i64 %55, ptr %53, align 8, !tbaa !8
  %56 = invoke { ptr, i8 } @_ZNSt3setIxSt4lessIxESaIxEE6insertERKx(ptr noundef nonnull align 8 dereferenceable(48) %1, ptr noundef nonnull align 8 dereferenceable(8) %53)
          to label %57 unwind label %97

57:                                               ; preds = %50
  %58 = load i64, ptr %2, align 8, !tbaa !8
  %59 = load i64, ptr %3, align 8, !tbaa !8
  %60 = getelementptr inbounds [500 x [500 x i64]], ptr @A, i64 0, i64 %58, i64 %59
  %61 = load i64, ptr %60, align 8, !tbaa !8
  %62 = getelementptr inbounds [250000 x i64], ptr @mnx, i64 0, i64 %61
  %63 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %62, ptr noundef nonnull align 8 dereferenceable(8) %2)
  %64 = load i64, ptr %63, align 8, !tbaa !8
  %65 = load i64, ptr %2, align 8, !tbaa !8
  %66 = load i64, ptr %3, align 8, !tbaa !8
  %67 = getelementptr inbounds [500 x [500 x i64]], ptr @A, i64 0, i64 %65, i64 %66
  %68 = load i64, ptr %67, align 8, !tbaa !8
  %69 = getelementptr inbounds [250000 x i64], ptr @mnx, i64 0, i64 %68
  store i64 %64, ptr %69, align 8, !tbaa !8
  %70 = getelementptr inbounds [250000 x i64], ptr @mny, i64 0, i64 %68
  %71 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %70, ptr noundef nonnull align 8 dereferenceable(8) %3)
  %72 = load i64, ptr %71, align 8, !tbaa !8
  %73 = load i64, ptr %2, align 8, !tbaa !8
  %74 = load i64, ptr %3, align 8, !tbaa !8
  %75 = getelementptr inbounds [500 x [500 x i64]], ptr @A, i64 0, i64 %73, i64 %74
  %76 = load i64, ptr %75, align 8, !tbaa !8
  %77 = getelementptr inbounds [250000 x i64], ptr @mny, i64 0, i64 %76
  store i64 %72, ptr %77, align 8, !tbaa !8
  %78 = getelementptr inbounds [250000 x i64], ptr @mxx, i64 0, i64 %76
  %79 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %78, ptr noundef nonnull align 8 dereferenceable(8) %2)
  %80 = load i64, ptr %79, align 8, !tbaa !8
  %81 = load i64, ptr %2, align 8, !tbaa !8
  %82 = load i64, ptr %3, align 8, !tbaa !8
  %83 = getelementptr inbounds [500 x [500 x i64]], ptr @A, i64 0, i64 %81, i64 %82
  %84 = load i64, ptr %83, align 8, !tbaa !8
  %85 = getelementptr inbounds [250000 x i64], ptr @mxx, i64 0, i64 %84
  store i64 %80, ptr %85, align 8, !tbaa !8
  %86 = getelementptr inbounds [250000 x i64], ptr @mxy, i64 0, i64 %84
  %87 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %86, ptr noundef nonnull align 8 dereferenceable(8) %3)
  %88 = load i64, ptr %87, align 8, !tbaa !8
  %89 = load i64, ptr %2, align 8, !tbaa !8
  %90 = load i64, ptr %3, align 8, !tbaa !8
  %91 = getelementptr inbounds [500 x [500 x i64]], ptr @A, i64 0, i64 %89, i64 %90
  %92 = load i64, ptr %91, align 8, !tbaa !8
  %93 = getelementptr inbounds [250000 x i64], ptr @mxy, i64 0, i64 %92
  store i64 %88, ptr %93, align 8, !tbaa !8
  %94 = add nsw i64 %90, 1
  store i64 %94, ptr %3, align 8, !tbaa !8
  %95 = load i64, ptr @N, align 8, !tbaa !8
  %96 = icmp slt i64 %94, %95
  br i1 %96, label %.lr.ph119, label %._crit_edge120, !llvm.loop !18

97:                                               ; preds = %50, %.lr.ph119
  %98 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #9
  br label %219

99:                                               ; preds = %._crit_edge123
  %100 = sub nsw i64 %37, %36
  %101 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %100)
          to label %102 unwind label %104

102:                                              ; preds = %99
  %103 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %101, i8 noundef signext 10)
          to label %218 unwind label %104

104:                                              ; preds = %102, %99
  %105 = landingpad { ptr, i32 }
          cleanup
  br label %219

.preheader113:                                    ; preds = %.preheader114, %.thread105
  %106 = phi i64 [ %121, %.thread105 ], [ %38, %.preheader114 ]
  %.085145 = phi i64 [ %211, %.thread105 ], [ 0, %.preheader114 ]
  %107 = icmp sgt i64 %106, 0
  br i1 %107, label %.preheader110.us.preheader, label %.preheader112

.preheader110.us.preheader:                       ; preds = %.preheader113
  %108 = shl nuw i64 %106, 3
  %xtraiter = and i64 %106, 7
  %109 = icmp ult i64 %106, 8
  br i1 %109, label %.lr.ph130.preheader.loopexit.unr-lcssa, label %.preheader110.us.preheader.new

.preheader110.us.preheader.new:                   ; preds = %.preheader110.us.preheader
  %unroll_iter = and i64 %106, 9223372036854775800
  br label %.preheader110.us

.preheader110.us:                                 ; preds = %.preheader110.us, %.preheader110.us.preheader.new
  %.084128.us = phi i64 [ 0, %.preheader110.us.preheader.new ], [ %118, %.preheader110.us ]
  %niter = phi i64 [ 0, %.preheader110.us.preheader.new ], [ %niter.next.7, %.preheader110.us ]
  %110 = mul nuw nsw i64 %.084128.us, 4008
  %scevgep = getelementptr i8, ptr @P, i64 %110
  call void @llvm.memset.p0.i64(ptr align 16 %scevgep, i8 0, i64 %108, i1 false), !tbaa !8
  %111 = mul nuw i64 %.084128.us, 4008
  %gep = getelementptr i8, ptr getelementptr (i8, ptr @P, i64 4008), i64 %111
  call void @llvm.memset.p0.i64(ptr align 8 %gep, i8 0, i64 %108, i1 false), !tbaa !8
  %112 = mul nuw i64 %.084128.us, 4008
  %gep187 = getelementptr i8, ptr getelementptr (i8, ptr @P, i64 8016), i64 %112
  call void @llvm.memset.p0.i64(ptr align 16 %gep187, i8 0, i64 %108, i1 false), !tbaa !8
  %113 = mul nuw i64 %.084128.us, 4008
  %gep188 = getelementptr i8, ptr getelementptr (i8, ptr @P, i64 12024), i64 %113
  call void @llvm.memset.p0.i64(ptr align 8 %gep188, i8 0, i64 %108, i1 false), !tbaa !8
  %114 = mul nuw i64 %.084128.us, 4008
  %gep189 = getelementptr i8, ptr getelementptr (i8, ptr @P, i64 16032), i64 %114
  call void @llvm.memset.p0.i64(ptr align 16 %gep189, i8 0, i64 %108, i1 false), !tbaa !8
  %115 = mul nuw i64 %.084128.us, 4008
  %gep190 = getelementptr i8, ptr getelementptr (i8, ptr @P, i64 20040), i64 %115
  call void @llvm.memset.p0.i64(ptr align 8 %gep190, i8 0, i64 %108, i1 false), !tbaa !8
  %116 = mul nuw i64 %.084128.us, 4008
  %gep191 = getelementptr i8, ptr getelementptr (i8, ptr @P, i64 24048), i64 %116
  call void @llvm.memset.p0.i64(ptr align 16 %gep191, i8 0, i64 %108, i1 false), !tbaa !8
  %117 = mul nuw i64 %.084128.us, 4008
  %gep192 = getelementptr i8, ptr getelementptr (i8, ptr @P, i64 28056), i64 %117
  call void @llvm.memset.p0.i64(ptr align 8 %gep192, i8 0, i64 %108, i1 false), !tbaa !8
  %118 = add nuw nsw i64 %.084128.us, 8
  %niter.next.7 = add i64 %niter, 8
  %niter.ncmp.7 = icmp eq i64 %niter.next.7, %unroll_iter
  br i1 %niter.ncmp.7, label %.lr.ph130.preheader.loopexit.unr-lcssa, label %.preheader110.us, !llvm.loop !19

.preheader112:                                    ; preds = %.preheader113
  %.not151 = icmp eq i64 %106, 0
  br i1 %.not151, label %.preheader111, label %.lr.ph130.preheader

.lr.ph130.preheader.loopexit.unr-lcssa:           ; preds = %.preheader110.us, %.preheader110.us.preheader
  %.084128.us.unr = phi i64 [ 0, %.preheader110.us.preheader ], [ %118, %.preheader110.us ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.lr.ph130.preheader, label %.preheader110.us.epil

.preheader110.us.epil:                            ; preds = %.lr.ph130.preheader.loopexit.unr-lcssa, %.preheader110.us.epil
  %.084128.us.epil = phi i64 [ %120, %.preheader110.us.epil ], [ %.084128.us.unr, %.lr.ph130.preheader.loopexit.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.preheader110.us.epil ], [ 0, %.lr.ph130.preheader.loopexit.unr-lcssa ]
  %119 = mul nuw nsw i64 %.084128.us.epil, 4008
  %scevgep.epil = getelementptr i8, ptr @P, i64 %119
  call void @llvm.memset.p0.i64(ptr align 8 %scevgep.epil, i8 0, i64 %108, i1 false), !tbaa !8
  %120 = add nuw nsw i64 %.084128.us.epil, 1
  %epil.iter.next = add i64 %epil.iter, 1
  %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
  br i1 %epil.iter.cmp.not, label %.lr.ph130.preheader, label %.preheader110.us.epil, !llvm.loop !20

.lr.ph130.preheader:                              ; preds = %.lr.ph130.preheader.loopexit.unr-lcssa, %.preheader110.us.epil, %.preheader112
  br label %.lr.ph130

.preheader111:                                    ; preds = %206, %.preheader112
  %121 = phi i64 [ 0, %.preheader112 ], [ %208, %206 ]
  %.not95135 = icmp slt i64 %.085145, %121
  br i1 %.not95135, label %.preheader.lr.ph, label %.thread105

.preheader.lr.ph:                                 ; preds = %.preheader111
  %122 = load i64, ptr @K, align 8
  %123 = sub nsw i64 %36, %122
  %124 = add nsw i64 %123, 1
  %125 = add nuw nsw i64 %.085145, 1
  %.not94.us.us.peel = icmp slt i64 %125, %121
  %126 = add nuw nsw i64 %.085145, 1
  %.not94.us138.peel = icmp slt i64 %126, %121
  br label %.preheader.us

.preheader.us:                                    ; preds = %._crit_edge134.us, %.preheader.lr.ph
  %.074136.us = phi i64 [ 0, %.preheader.lr.ph ], [ %148, %._crit_edge134.us ]
  %.not152 = icmp eq i64 %.074136.us, 0
  %127 = add nsw i64 %.074136.us, -1
  br i1 %.not152, label %.thread.us140.peel, label %.thread.us.us.peel

.thread.us.us.peel:                               ; preds = %.preheader.us
  %128 = getelementptr inbounds [501 x [501 x i64]], ptr @P, i64 0, i64 %127, i64 0
  %129 = load i64, ptr %128, align 8, !tbaa !8
  %130 = getelementptr inbounds [501 x [501 x i64]], ptr @P, i64 0, i64 %.074136.us, i64 0
  %131 = load i64, ptr %130, align 8, !tbaa !8
  %132 = add nsw i64 %131, %129
  store i64 %132, ptr %130, align 8, !tbaa !8
  %133 = icmp eq i64 %132, %123
  %134 = icmp eq i64 %132, %124
  %or.cond101.us.us.peel = select i1 %133, i1 true, i1 %134
  br i1 %or.cond101.us.us.peel, label %.critedge.invoke, label %135

135:                                              ; preds = %.thread.us.us.peel
  br i1 %.not94.us.us.peel, label %.thread.us.us, label %._crit_edge134.us

.thread.us140.peel:                               ; preds = %.preheader.us
  %.pre = load i64, ptr @P, align 16, !tbaa !8
  %136 = icmp eq i64 %.pre, %123
  %137 = icmp eq i64 %.pre, %124
  %or.cond101.us141.peel = select i1 %136, i1 true, i1 %137
  br i1 %or.cond101.us141.peel, label %.critedge.invoke, label %138

138:                                              ; preds = %.thread.us140.peel
  br i1 %.not94.us138.peel, label %.thread.us140, label %._crit_edge134.us

139:                                              ; preds = %.thread.us140
  %140 = add nuw nsw i64 %.0132.us139, 1
  %141 = add nuw nsw i64 %140, %.085145
  %.not94.us138 = icmp slt i64 %141, %121
  br i1 %.not94.us138, label %.thread.us140, label %._crit_edge134.us, !llvm.loop !22

.thread.us140:                                    ; preds = %138, %139
  %142 = phi i64 [ %145, %139 ], [ %.pre, %138 ]
  %.0132.us139 = phi i64 [ %140, %139 ], [ 1, %138 ]
  %143 = getelementptr inbounds [501 x [501 x i64]], ptr @P, i64 0, i64 0, i64 %.0132.us139
  %144 = load i64, ptr %143, align 8, !tbaa !8
  %145 = add nsw i64 %144, %142
  store i64 %145, ptr %143, align 8, !tbaa !8
  %146 = icmp eq i64 %145, %123
  %147 = icmp eq i64 %145, %124
  %or.cond101.us141 = select i1 %146, i1 true, i1 %147
  br i1 %or.cond101.us141, label %.critedge.invoke, label %139

._crit_edge134.us:                                ; preds = %150, %139, %135, %138
  %148 = add nuw nsw i64 %.074136.us, 1
  %149 = add nuw nsw i64 %148, %.085145
  %.not95.us = icmp slt i64 %149, %121
  br i1 %.not95.us, label %.preheader.us, label %.thread105, !llvm.loop !24

150:                                              ; preds = %.thread.us.us
  %151 = add nuw nsw i64 %.0132.us.us, 1
  %152 = add nuw nsw i64 %151, %.085145
  %.not94.us.us = icmp slt i64 %152, %121
  br i1 %.not94.us.us, label %.thread.us.us, label %._crit_edge134.us, !llvm.loop !25

.thread.us.us:                                    ; preds = %135, %150
  %153 = phi i64 [ %163, %150 ], [ %132, %135 ]
  %.0132.us.us = phi i64 [ %151, %150 ], [ 1, %135 ]
  %154 = getelementptr inbounds [501 x [501 x i64]], ptr @P, i64 0, i64 %127, i64 %.0132.us.us
  %155 = load i64, ptr %154, align 8, !tbaa !8
  %156 = getelementptr inbounds [501 x [501 x i64]], ptr @P, i64 0, i64 %.074136.us, i64 %.0132.us.us
  %157 = load i64, ptr %156, align 8, !tbaa !8
  %158 = add nsw i64 %157, %155
  %159 = add nsw i64 %.0132.us.us, -1
  %160 = add nsw i64 %158, %153
  %161 = getelementptr inbounds [501 x [501 x i64]], ptr @P, i64 0, i64 %127, i64 %159
  %162 = load i64, ptr %161, align 8, !tbaa !8
  %163 = sub nsw i64 %160, %162
  store i64 %163, ptr %156, align 8, !tbaa !8
  %164 = icmp eq i64 %163, %123
  %165 = icmp eq i64 %163, %124
  %or.cond101.us.us = select i1 %164, i1 true, i1 %165
  br i1 %or.cond101.us.us, label %.critedge.invoke, label %150

.lr.ph130:                                        ; preds = %.lr.ph130.preheader, %206
  %.082129 = phi i64 [ %207, %206 ], [ 0, %.lr.ph130.preheader ]
  %166 = getelementptr inbounds [250000 x i64], ptr @mnx, i64 0, i64 %.082129
  %167 = load i64, ptr %166, align 8, !tbaa !8
  %168 = icmp sgt i64 %167, 23523
  br i1 %168, label %206, label %169

169:                                              ; preds = %.lr.ph130
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #9
  %170 = getelementptr inbounds [250000 x i64], ptr @mxx, i64 0, i64 %.082129
  %171 = load i64, ptr %170, align 8, !tbaa !8
  %172 = sub nsw i64 %171, %167
  store i64 %172, ptr %4, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #9
  %173 = getelementptr inbounds [250000 x i64], ptr @mxy, i64 0, i64 %.082129
  %174 = load i64, ptr %173, align 8, !tbaa !8
  %175 = getelementptr inbounds [250000 x i64], ptr @mny, i64 0, i64 %.082129
  %176 = load i64, ptr %175, align 8, !tbaa !8
  %177 = sub nsw i64 %174, %176
  store i64 %177, ptr %5, align 8, !tbaa !8
  %178 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(8) %5)
  %179 = load i64, ptr %178, align 8, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #9
  %180 = icmp sgt i64 %179, %.085145
  br i1 %180, label %206, label %181

181:                                              ; preds = %169
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #9
  store i64 0, ptr %6, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #9
  %182 = load i64, ptr %170, align 8, !tbaa !8
  %183 = sub nsw i64 %182, %.085145
  store i64 %183, ptr %7, align 8, !tbaa !8
  %184 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %7)
  %185 = load i64, ptr %184, align 8, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #9
  store i64 0, ptr %8, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #9
  %186 = load i64, ptr %173, align 8, !tbaa !8
  %187 = sub nsw i64 %186, %.085145
  store i64 %187, ptr %9, align 8, !tbaa !8
  %188 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull align 8 dereferenceable(8) %9)
  %189 = load i64, ptr %188, align 8, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #9
  %190 = load i64, ptr %166, align 8, !tbaa !8
  %191 = load i64, ptr %175, align 8, !tbaa !8
  %192 = getelementptr inbounds [501 x [501 x i64]], ptr @P, i64 0, i64 %185, i64 %189
  %193 = load i64, ptr %192, align 8, !tbaa !8
  %194 = add nsw i64 %193, 1
  store i64 %194, ptr %192, align 8, !tbaa !8
  %195 = add nsw i64 %191, 1
  %196 = getelementptr inbounds [501 x [501 x i64]], ptr @P, i64 0, i64 %185, i64 %195
  %197 = load i64, ptr %196, align 8, !tbaa !8
  %198 = add nsw i64 %197, -1
  store i64 %198, ptr %196, align 8, !tbaa !8
  %199 = add nsw i64 %190, 1
  %200 = getelementptr inbounds [501 x [501 x i64]], ptr @P, i64 0, i64 %199, i64 %189
  %201 = load i64, ptr %200, align 8, !tbaa !8
  %202 = add nsw i64 %201, -1
  store i64 %202, ptr %200, align 8, !tbaa !8
  %203 = getelementptr inbounds [501 x [501 x i64]], ptr @P, i64 0, i64 %199, i64 %195
  %204 = load i64, ptr %203, align 8, !tbaa !8
  %205 = add nsw i64 %204, 1
  store i64 %205, ptr %203, align 8, !tbaa !8
  br label %206

206:                                              ; preds = %181, %169, %.lr.ph130
  %207 = add nuw nsw i64 %.082129, 1
  %208 = load i64, ptr @N, align 8, !tbaa !8
  %209 = mul nsw i64 %208, %208
  %210 = icmp ult i64 %207, %209
  br i1 %210, label %.lr.ph130, label %.preheader111, !llvm.loop !26

.thread105:                                       ; preds = %._crit_edge134.us, %.preheader111
  %211 = add nuw nsw i64 %.085145, 1
  %212 = icmp slt i64 %211, %121
  br i1 %212, label %.preheader113, label %.critedge.invoke, !llvm.loop !27

213:                                              ; preds = %.critedge.invoke, %.invoke
  %214 = landingpad { ptr, i32 }
          cleanup
  br label %219

.critedge.invoke:                                 ; preds = %.thread105, %.thread.us140.peel, %.thread.us.us.peel, %.thread.us.us, %.thread.us140, %.preheader114
  %215 = phi i32 [ 2, %.preheader114 ], [ 1, %.thread.us140 ], [ 1, %.thread.us.us ], [ 1, %.thread.us.us.peel ], [ 1, %.thread.us140.peel ], [ 2, %.thread105 ]
  %216 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %215)
          to label %.invoke unwind label %213

.invoke:                                          ; preds = %.critedge.invoke
  %217 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %216, i8 noundef signext 10)
          to label %218 unwind label %213

218:                                              ; preds = %.invoke, %102
  call void @_ZNSt3setIxSt4lessIxESaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %1) #9
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %1) #9
  ret i32 0

219:                                              ; preds = %104, %213, %97
  %.pn98 = phi { ptr, i32 } [ %98, %97 ], [ %105, %104 ], [ %214, %213 ]
  call void @_ZNSt3setIxSt4lessIxESaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %1) #9
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %1) #9
  resume { ptr, i32 } %.pn98
}

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

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

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #3 align 2

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

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

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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
declare dso_local { ptr, i8 } @_ZNSt3setIxSt4lessIxESaIxEE6insertERKx(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #3 align 2

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(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 noundef i64 @_ZNKSt3setIxSt4lessIxESaIxEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(48)) local_unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8), i8 noundef signext) local_unnamed_addr #6

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) local_unnamed_addr #3 align 2

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

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.umax.i64(i64, i64) #7

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #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 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 #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 = { 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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { 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 #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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #8 = { nocallback nofree nounwind willreturn memory(argmem: write) }
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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"long long", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}
!11 = distinct !{!11, !12, !13, !14}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!"llvm.loop.isvectorized", i32 1}
!14 = !{!"llvm.loop.unroll.runtime.disable"}
!15 = distinct !{!15, !12, !14, !13}
!16 = distinct !{!16, !12, !17}
!17 = !{!"llvm.loop.unswitch.partial.disable"}
!18 = distinct !{!18, !12}
!19 = distinct !{!19, !12}
!20 = distinct !{!20, !21}
!21 = !{!"llvm.loop.unroll.disable"}
!22 = distinct !{!22, !12, !23}
!23 = !{!"llvm.loop.peeled.count", i32 1}
!24 = distinct !{!24, !12}
!25 = distinct !{!25, !12, !23}
!26 = distinct !{!26, !12}
!27 = distinct !{!27, !12}


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