; LLVM IR from eyangch/competitive-programming :: Codeforces/1713 (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::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl" }
%"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl" = type { %"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl_data" }
%"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%struct.DSU = type { [1000 x i64], [1000 x i64] }
%"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" }

@T = external dso_local global i64, align 8
@N = external dso_local global i64, align 8
@A = external dso_local global [1000 x [1000 x i64]], align 16
@V = external dso_local global [1000 x i64], align 16
@G = external dso_local global [1000 x %"class.std::vector"], align 16
@dsu = external dso_local global %struct.DSU, align 8
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z6parityxx(i64 noundef, i64 noundef) #0

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

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #2 {
  %1 = alloca i32, align 4
  %2 = alloca i64, align 8
  %3 = alloca i32, align 4
  %4 = alloca i64, align 8
  %5 = alloca i32, align 4
  %6 = alloca i64, align 8
  %7 = alloca i64, align 8
  %8 = alloca i64, align 8
  %9 = alloca i64, align 8
  %10 = alloca i64, align 8
  %11 = alloca i64, align 8
  %12 = alloca i64, align 8
  %13 = alloca i64, align 8
  %14 = alloca i64, align 8
  %15 = alloca i64, align 8
  store i32 0, ptr %1, align 4
  %16 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %17 = getelementptr i8, ptr %16, i64 -24
  %18 = load i64, ptr %17, align 8
  %19 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %18
  %20 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %19, ptr noundef null)
  %21 = call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %22 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) @T)
  br label %23

23:                                               ; preds = %257, %0
  %24 = load i64, ptr @T, align 8, !tbaa !8
  %25 = add nsw i64 %24, -1
  store i64 %25, ptr @T, align 8, !tbaa !8
  %26 = icmp ne i64 %24, 0
  br i1 %26, label %27, label %258

27:                                               ; preds = %23
  %28 = 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)
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #7
  store i64 0, ptr %2, align 8, !tbaa !8
  br label %29

29:                                               ; preds = %50, %27
  %30 = load i64, ptr %2, align 8, !tbaa !8
  %31 = load i64, ptr @N, align 8, !tbaa !8
  %32 = icmp slt i64 %30, %31
  br i1 %32, label %34, label %33

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

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

35:                                               ; preds = %46, %34
  %36 = load i64, ptr %4, align 8, !tbaa !8
  %37 = load i64, ptr @N, align 8, !tbaa !8
  %38 = icmp slt i64 %36, %37
  br i1 %38, label %40, label %39

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

40:                                               ; preds = %35
  %41 = load i64, ptr %2, align 8, !tbaa !8
  %42 = getelementptr inbounds [1000 x [1000 x i64]], ptr @A, i64 0, i64 %41
  %43 = load i64, ptr %4, align 8, !tbaa !8
  %44 = getelementptr inbounds [1000 x i64], ptr %42, i64 0, i64 %43
  %45 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %44)
  br label %46

46:                                               ; preds = %40
  %47 = load i64, ptr %4, align 8, !tbaa !8
  %48 = add nsw i64 %47, 1
  store i64 %48, ptr %4, align 8, !tbaa !8
  br label %35, !llvm.loop !11

49:                                               ; preds = %39
  br label %50

50:                                               ; preds = %49
  %51 = load i64, ptr %2, align 8, !tbaa !8
  %52 = add nsw i64 %51, 1
  store i64 %52, ptr %2, align 8, !tbaa !8
  br label %29, !llvm.loop !13

53:                                               ; preds = %33
  %54 = load i64, ptr @N, align 8, !tbaa !8
  call void @_ZN3DSU4initEx(ptr noundef nonnull align 8 dereferenceable(16000) @dsu, i64 noundef %54)
  %55 = load i64, ptr @N, align 8, !tbaa !8
  %56 = getelementptr inbounds i64, ptr @V, i64 %55
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #7
  store i32 -1, ptr %5, align 4, !tbaa !14
  call void @_ZSt4fillIPxiEvT_S1_RKT0_(ptr noundef @V, ptr noundef %56, ptr noundef nonnull align 4 dereferenceable(4) %5)
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #7
  store i64 0, ptr %6, align 8, !tbaa !8
  br label %57

57:                                               ; preds = %65, %53
  %58 = load i64, ptr %6, 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 10, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #7
  br label %68

62:                                               ; preds = %57
  %63 = load i64, ptr %6, align 8, !tbaa !8
  %64 = getelementptr inbounds [1000 x %"class.std::vector"], ptr @G, i64 0, i64 %63
  call void @_ZNSt6vectorIxSaIxEE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) %64) #7
  br label %65

65:                                               ; preds = %62
  %66 = load i64, ptr %6, align 8, !tbaa !8
  %67 = add nsw i64 %66, 1
  store i64 %67, ptr %6, align 8, !tbaa !8
  br label %57, !llvm.loop !16

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

69:                                               ; preds = %192, %68
  %70 = load i64, ptr %7, align 8, !tbaa !8
  %71 = load i64, ptr @N, align 8, !tbaa !8
  %72 = icmp slt i64 %70, %71
  br i1 %72, label %74, label %73

73:                                               ; preds = %69
  store i32 13, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #7
  br label %195

74:                                               ; preds = %69
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #7
  %75 = load i64, ptr %7, align 8, !tbaa !8
  %76 = add nsw i64 %75, 1
  store i64 %76, ptr %8, align 8, !tbaa !8
  br label %77

77:                                               ; preds = %188, %74
  %78 = load i64, ptr %8, align 8, !tbaa !8
  %79 = load i64, ptr @N, align 8, !tbaa !8
  %80 = icmp slt i64 %78, %79
  br i1 %80, label %82, label %81

81:                                               ; preds = %77
  store i32 16, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #7
  br label %191

82:                                               ; preds = %77
  %83 = load i64, ptr %7, align 8, !tbaa !8
  %84 = getelementptr inbounds [1000 x [1000 x i64]], ptr @A, i64 0, i64 %83
  %85 = load i64, ptr %8, align 8, !tbaa !8
  %86 = getelementptr inbounds [1000 x i64], ptr %84, i64 0, i64 %85
  %87 = load i64, ptr %86, align 8, !tbaa !8
  %88 = load i64, ptr %8, align 8, !tbaa !8
  %89 = getelementptr inbounds [1000 x [1000 x i64]], ptr @A, i64 0, i64 %88
  %90 = load i64, ptr %7, align 8, !tbaa !8
  %91 = getelementptr inbounds [1000 x i64], ptr %89, i64 0, i64 %90
  %92 = load i64, ptr %91, align 8, !tbaa !8
  %93 = icmp eq i64 %87, %92
  br i1 %93, label %94, label %95

94:                                               ; preds = %82
  br label %188

95:                                               ; preds = %82
  %96 = load i64, ptr %7, align 8, !tbaa !8
  %97 = call noundef i64 @_ZN3DSU4findEx(ptr noundef nonnull align 8 dereferenceable(16000) @dsu, i64 noundef %96)
  %98 = load i64, ptr %8, align 8, !tbaa !8
  %99 = call noundef i64 @_ZN3DSU4findEx(ptr noundef nonnull align 8 dereferenceable(16000) @dsu, i64 noundef %98)
  %100 = icmp eq i64 %97, %99
  br i1 %100, label %101, label %102

101:                                              ; preds = %95
  br label %188

102:                                              ; preds = %95
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #7
  %103 = load i64, ptr %7, align 8, !tbaa !8
  store i64 %103, ptr %9, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #7
  %104 = load i64, ptr %8, align 8, !tbaa !8
  store i64 %104, ptr %10, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #7
  %105 = load i64, ptr %7, align 8, !tbaa !8
  %106 = getelementptr inbounds [1000 x [1000 x i64]], ptr @A, i64 0, i64 %105
  %107 = load i64, ptr %8, align 8, !tbaa !8
  %108 = getelementptr inbounds [1000 x i64], ptr %106, i64 0, i64 %107
  %109 = load i64, ptr %108, align 8, !tbaa !8
  %110 = load i64, ptr %8, align 8, !tbaa !8
  %111 = getelementptr inbounds [1000 x [1000 x i64]], ptr @A, i64 0, i64 %110
  %112 = load i64, ptr %7, align 8, !tbaa !8
  %113 = getelementptr inbounds [1000 x i64], ptr %111, i64 0, i64 %112
  %114 = load i64, ptr %113, align 8, !tbaa !8
  %115 = icmp sgt i64 %109, %114
  %116 = zext i1 %115 to i64
  store i64 %116, ptr %11, align 8, !tbaa !8
  %117 = load i64, ptr %9, align 8, !tbaa !8
  %118 = getelementptr inbounds [1000 x i64], ptr @V, i64 0, i64 %117
  %119 = load i64, ptr %118, align 8, !tbaa !8
  %120 = icmp ne i64 %119, -1
  br i1 %120, label %121, label %150

121:                                              ; preds = %102
  %122 = load i64, ptr %10, align 8, !tbaa !8
  %123 = getelementptr inbounds [1000 x i64], ptr @V, i64 0, i64 %122
  %124 = load i64, ptr %123, align 8, !tbaa !8
  %125 = icmp ne i64 %124, -1
  br i1 %125, label %126, label %150

126:                                              ; preds = %121
  %127 = load i64, ptr %9, align 8, !tbaa !8
  %128 = getelementptr inbounds [1000 x i64], ptr getelementptr inbounds (%struct.DSU, ptr @dsu, i32 0, i32 1), i64 0, i64 %127
  %129 = load i64, ptr %128, align 8, !tbaa !8
  %130 = load i64, ptr %10, align 8, !tbaa !8
  %131 = getelementptr inbounds [1000 x i64], ptr getelementptr inbounds (%struct.DSU, ptr @dsu, i32 0, i32 1), i64 0, i64 %130
  %132 = load i64, ptr %131, align 8, !tbaa !8
  %133 = icmp slt i64 %129, %132
  br i1 %133, label %134, label %135

134:                                              ; preds = %126
  call void @_ZSt4swapIxENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 8 dereferenceable(8) %9, ptr noundef nonnull align 8 dereferenceable(8) %10) #7
  br label %135

135:                                              ; preds = %134, %126
  %136 = load i64, ptr %9, align 8, !tbaa !8
  %137 = getelementptr inbounds [1000 x i64], ptr @V, i64 0, i64 %136
  %138 = load i64, ptr %137, align 8, !tbaa !8
  %139 = load i64, ptr %11, align 8, !tbaa !8
  %140 = load i64, ptr %10, align 8, !tbaa !8
  %141 = getelementptr inbounds [1000 x i64], ptr @V, i64 0, i64 %140
  %142 = load i64, ptr %141, align 8, !tbaa !8
  %143 = icmp ne i64 %139, %142
  %144 = zext i1 %143 to i64
  %145 = xor i64 %138, %144
  %146 = icmp ne i64 %145, 0
  br i1 %146, label %147, label %149

147:                                              ; preds = %135
  %148 = load i64, ptr %10, align 8, !tbaa !8
  call void @_Z6parityxx(i64 noundef %148, i64 noundef -1)
  br label %149

149:                                              ; preds = %147, %135
  br label %181

150:                                              ; preds = %121, %102
  %151 = load i64, ptr %9, align 8, !tbaa !8
  %152 = getelementptr inbounds [1000 x i64], ptr @V, i64 0, i64 %151
  %153 = load i64, ptr %152, align 8, !tbaa !8
  %154 = icmp eq i64 %153, -1
  br i1 %154, label %155, label %166

155:                                              ; preds = %150
  %156 = load i64, ptr %10, align 8, !tbaa !8
  %157 = getelementptr inbounds [1000 x i64], ptr @V, i64 0, i64 %156
  %158 = load i64, ptr %157, align 8, !tbaa !8
  %159 = icmp eq i64 %158, -1
  br i1 %159, label %160, label %166

160:                                              ; preds = %155
  %161 = load i64, ptr %9, align 8, !tbaa !8
  %162 = getelementptr inbounds [1000 x i64], ptr @V, i64 0, i64 %161
  store i64 0, ptr %162, align 8, !tbaa !8
  %163 = load i64, ptr %11, align 8, !tbaa !8
  %164 = load i64, ptr %10, align 8, !tbaa !8
  %165 = getelementptr inbounds [1000 x i64], ptr @V, i64 0, i64 %164
  store i64 %163, ptr %165, align 8, !tbaa !8
  br label %180

166:                                              ; preds = %155, %150
  %167 = load i64, ptr %10, align 8, !tbaa !8
  %168 = getelementptr inbounds [1000 x i64], ptr @V, i64 0, i64 %167
  %169 = load i64, ptr %168, align 8, !tbaa !8
  %170 = icmp eq i64 %169, -1
  br i1 %170, label %171, label %172

171:                                              ; preds = %166
  call void @_ZSt4swapIxENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 8 dereferenceable(8) %9, ptr noundef nonnull align 8 dereferenceable(8) %10) #7
  br label %172

172:                                              ; preds = %171, %166
  %173 = load i64, ptr %10, align 8, !tbaa !8
  %174 = getelementptr inbounds [1000 x i64], ptr @V, i64 0, i64 %173
  %175 = load i64, ptr %174, align 8, !tbaa !8
  %176 = load i64, ptr %11, align 8, !tbaa !8
  %177 = xor i64 %175, %176
  %178 = load i64, ptr %9, align 8, !tbaa !8
  %179 = getelementptr inbounds [1000 x i64], ptr @V, i64 0, i64 %178
  store i64 %177, ptr %179, align 8, !tbaa !8
  br label %180

180:                                              ; preds = %172, %160
  br label %181

181:                                              ; preds = %180, %149
  %182 = load i64, ptr %9, align 8, !tbaa !8
  %183 = load i64, ptr %10, align 8, !tbaa !8
  call void @_ZN3DSU2unExx(ptr noundef nonnull align 8 dereferenceable(16000) @dsu, i64 noundef %182, i64 noundef %183)
  %184 = load i64, ptr %9, align 8, !tbaa !8
  %185 = getelementptr inbounds [1000 x %"class.std::vector"], ptr @G, i64 0, i64 %184
  call void @_ZNSt6vectorIxSaIxEE9push_backERKx(ptr noundef nonnull align 8 dereferenceable(24) %185, ptr noundef nonnull align 8 dereferenceable(8) %10)
  %186 = load i64, ptr %10, align 8, !tbaa !8
  %187 = getelementptr inbounds [1000 x %"class.std::vector"], ptr @G, i64 0, i64 %186
  call void @_ZNSt6vectorIxSaIxEE9push_backERKx(ptr noundef nonnull align 8 dereferenceable(24) %187, ptr noundef nonnull align 8 dereferenceable(8) %9)
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #7
  br label %188

188:                                              ; preds = %181, %101, %94
  %189 = load i64, ptr %8, align 8, !tbaa !8
  %190 = add nsw i64 %189, 1
  store i64 %190, ptr %8, align 8, !tbaa !8
  br label %77, !llvm.loop !17

191:                                              ; preds = %81
  br label %192

192:                                              ; preds = %191
  %193 = load i64, ptr %7, align 8, !tbaa !8
  %194 = add nsw i64 %193, 1
  store i64 %194, ptr %7, align 8, !tbaa !8
  br label %69, !llvm.loop !18

195:                                              ; preds = %73
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #7
  store i64 0, ptr %12, align 8, !tbaa !8
  br label %196

196:                                              ; preds = %226, %195
  %197 = load i64, ptr %12, align 8, !tbaa !8
  %198 = load i64, ptr @N, align 8, !tbaa !8
  %199 = icmp slt i64 %197, %198
  br i1 %199, label %201, label %200

200:                                              ; preds = %196
  store i32 19, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #7
  br label %229

201:                                              ; preds = %196
  %202 = load i64, ptr %12, align 8, !tbaa !8
  %203 = getelementptr inbounds [1000 x i64], ptr @V, i64 0, i64 %202
  %204 = load i64, ptr %203, align 8, !tbaa !8
  %205 = icmp ne i64 %204, 0
  br i1 %205, label %206, label %225

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

207:                                              ; preds = %221, %206
  %208 = load i64, ptr %13, align 8, !tbaa !8
  %209 = load i64, ptr @N, align 8, !tbaa !8
  %210 = icmp slt i64 %208, %209
  br i1 %210, label %212, label %211

211:                                              ; preds = %207
  store i32 22, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #7
  br label %224

212:                                              ; preds = %207
  %213 = load i64, ptr %12, align 8, !tbaa !8
  %214 = getelementptr inbounds [1000 x [1000 x i64]], ptr @A, i64 0, i64 %213
  %215 = load i64, ptr %13, align 8, !tbaa !8
  %216 = getelementptr inbounds [1000 x i64], ptr %214, i64 0, i64 %215
  %217 = load i64, ptr %13, align 8, !tbaa !8
  %218 = getelementptr inbounds [1000 x [1000 x i64]], ptr @A, i64 0, i64 %217
  %219 = load i64, ptr %12, align 8, !tbaa !8
  %220 = getelementptr inbounds [1000 x i64], ptr %218, i64 0, i64 %219
  call void @_ZSt4swapIxENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 8 dereferenceable(8) %216, ptr noundef nonnull align 8 dereferenceable(8) %220) #7
  br label %221

221:                                              ; preds = %212
  %222 = load i64, ptr %13, align 8, !tbaa !8
  %223 = add nsw i64 %222, 1
  store i64 %223, ptr %13, align 8, !tbaa !8
  br label %207, !llvm.loop !19

224:                                              ; preds = %211
  br label %225

225:                                              ; preds = %224, %201
  br label %226

226:                                              ; preds = %225
  %227 = load i64, ptr %12, align 8, !tbaa !8
  %228 = add nsw i64 %227, 1
  store i64 %228, ptr %12, align 8, !tbaa !8
  br label %196, !llvm.loop !20

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

230:                                              ; preds = %254, %229
  %231 = load i64, ptr %14, align 8, !tbaa !8
  %232 = load i64, ptr @N, align 8, !tbaa !8
  %233 = icmp slt i64 %231, %232
  br i1 %233, label %235, label %234

234:                                              ; preds = %230
  store i32 25, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #7
  br label %257

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

236:                                              ; preds = %249, %235
  %237 = load i64, ptr %15, align 8, !tbaa !8
  %238 = load i64, ptr @N, align 8, !tbaa !8
  %239 = icmp slt i64 %237, %238
  br i1 %239, label %241, label %240

240:                                              ; preds = %236
  store i32 28, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #7
  br label %252

241:                                              ; preds = %236
  %242 = load i64, ptr %14, align 8, !tbaa !8
  %243 = getelementptr inbounds [1000 x [1000 x i64]], ptr @A, i64 0, i64 %242
  %244 = load i64, ptr %15, align 8, !tbaa !8
  %245 = getelementptr inbounds [1000 x i64], ptr %243, i64 0, i64 %244
  %246 = load i64, ptr %245, align 8, !tbaa !8
  %247 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %246)
  %248 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %247, i8 noundef signext 32)
  br label %249

249:                                              ; preds = %241
  %250 = load i64, ptr %15, align 8, !tbaa !8
  %251 = add nsw i64 %250, 1
  store i64 %251, ptr %15, align 8, !tbaa !8
  br label %236, !llvm.loop !21

252:                                              ; preds = %240
  %253 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i8 noundef signext 10)
  br label %254

254:                                              ; preds = %252
  %255 = load i64, ptr %14, align 8, !tbaa !8
  %256 = add nsw i64 %255, 1
  store i64 %256, ptr %14, align 8, !tbaa !8
  br label %230, !llvm.loop !22

257:                                              ; preds = %234
  br label %23, !llvm.loop !23

258:                                              ; preds = %23
  %259 = load i32, ptr %1, align 4
  ret i32 %259
}

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

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

; 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)) #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3DSU4initEx(ptr noundef nonnull align 8 dereferenceable(16000), i64 noundef) #0 align 2

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_ZN3DSU4findEx(ptr noundef nonnull align 8 dereferenceable(16000), i64 noundef) #0 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3DSU2unExx(ptr noundef nonnull align 8 dereferenceable(16000), i64 noundef, i64 noundef) #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIxSaIxEE9push_backERKx(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(8)) #0 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) #5

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

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


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

%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl" }
%"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl" = type { %"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl_data" }
%"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%struct.DSU = type { [1000 x i64], [1000 x i64] }
%"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" }

@T = external dso_local global i64, align 8
@N = external dso_local global i64, align 8
@A = external dso_local global [1000 x [1000 x i64]], align 16
@V = external dso_local global [1000 x i64], align 16
@G = external dso_local global [1000 x %"class.std::vector"], align 16
@dsu = external dso_local global %struct.DSU, align 8
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z6parityxx(i64 noundef, i64 noundef) local_unnamed_addr #0

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

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #2 {
  %1 = alloca i32, align 4
  %2 = alloca i64, align 8
  %3 = alloca i64, align 8
  %4 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %5 = getelementptr i8, ptr %4, i64 -24
  %6 = load i64, ptr %5, align 8
  %7 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %6
  %8 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %7, ptr noundef null)
  %9 = tail call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %10 = 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) @T)
  %11 = load i64, ptr @T, align 8, !tbaa !8
  %12 = add nsw i64 %11, -1
  store i64 %12, ptr @T, align 8, !tbaa !8
  %.not86 = icmp eq i64 %11, 0
  br i1 %.not86, label %._crit_edge89, label %.lr.ph88

.loopexit62:                                      ; preds = %._crit_edge84, %._crit_edge67, %.preheader64, %.preheader63, %.preheader61
  %13 = load i64, ptr @T, align 8, !tbaa !8
  %14 = add nsw i64 %13, -1
  store i64 %14, ptr @T, align 8, !tbaa !8
  %.not = icmp eq i64 %13, 0
  br i1 %.not, label %._crit_edge89, label %.lr.ph88, !llvm.loop !11

.lr.ph88:                                         ; preds = %0, %.loopexit62
  %15 = 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)
  %16 = load i64, ptr @N, align 8, !tbaa !8
  %17 = icmp sgt i64 %16, 0
  br i1 %17, label %.preheader60, label %._crit_edge67

.preheader60:                                     ; preds = %.lr.ph88, %._crit_edge
  %18 = phi i64 [ %24, %._crit_edge ], [ %16, %.lr.ph88 ]
  %.04866 = phi i64 [ %25, %._crit_edge ], [ 0, %.lr.ph88 ]
  %19 = icmp sgt i64 %18, 0
  br i1 %19, label %.lr.ph, label %._crit_edge

._crit_edge67:                                    ; preds = %._crit_edge, %.lr.ph88
  %.lcssa = phi i64 [ %16, %.lr.ph88 ], [ %24, %._crit_edge ]
  call void @_ZN3DSU4initEx(ptr noundef nonnull align 8 dereferenceable(16000) @dsu, i64 noundef %.lcssa)
  %20 = load i64, ptr @N, align 8, !tbaa !8
  %21 = getelementptr inbounds i64, ptr @V, i64 %20
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #7
  store i32 -1, ptr %1, align 4, !tbaa !13
  call void @_ZSt4fillIPxiEvT_S1_RKT0_(ptr noundef nonnull @V, ptr noundef nonnull %21, ptr noundef nonnull align 4 dereferenceable(4) %1)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #7
  %22 = load i64, ptr @N, align 8
  %23 = icmp sgt i64 %22, 0
  br i1 %23, label %.lr.ph70, label %.loopexit62

._crit_edge:                                      ; preds = %.lr.ph, %.preheader60
  %24 = phi i64 [ %18, %.preheader60 ], [ %30, %.lr.ph ]
  %25 = add nuw nsw i64 %.04866, 1
  %26 = icmp slt i64 %25, %24
  br i1 %26, label %.preheader60, label %._crit_edge67, !llvm.loop !15

.lr.ph:                                           ; preds = %.preheader60, %.lr.ph
  %.05265 = phi i64 [ %29, %.lr.ph ], [ 0, %.preheader60 ]
  %27 = getelementptr inbounds [1000 x [1000 x i64]], ptr @A, i64 0, i64 %.04866, i64 %.05265
  %28 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %27)
  %29 = add nuw nsw i64 %.05265, 1
  %30 = load i64, ptr @N, align 8, !tbaa !8
  %31 = icmp slt i64 %29, %30
  br i1 %31, label %.lr.ph, label %._crit_edge, !llvm.loop !17

.preheader64:                                     ; preds = %.lr.ph70
  %32 = icmp sgt i64 %35, 0
  br i1 %32, label %.lr.ph76, label %.loopexit62

.lr.ph70:                                         ; preds = %._crit_edge67, %.lr.ph70
  %.05168 = phi i64 [ %34, %.lr.ph70 ], [ 0, %._crit_edge67 ]
  %33 = getelementptr inbounds [1000 x %"class.std::vector"], ptr @G, i64 0, i64 %.05168
  call void @_ZNSt6vectorIxSaIxEE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) %33) #7
  %34 = add nuw nsw i64 %.05168, 1
  %35 = load i64, ptr @N, align 8
  %36 = icmp slt i64 %34, %35
  br i1 %36, label %.lr.ph70, label %.preheader64, !llvm.loop !18

.loopexit59:                                      ; preds = %95, %.lr.ph76
  %37 = phi i64 [ %40, %.lr.ph76 ], [ %97, %95 ]
  %38 = icmp slt i64 %41, %37
  br i1 %38, label %.lr.ph76, label %.preheader63, !llvm.loop !19

.preheader63:                                     ; preds = %.loopexit59
  %39 = icmp sgt i64 %37, 0
  br i1 %39, label %.lr.ph81, label %.loopexit62

.lr.ph76:                                         ; preds = %.preheader64, %.loopexit59
  %40 = phi i64 [ %37, %.loopexit59 ], [ %35, %.preheader64 ]
  %.05075 = phi i64 [ %41, %.loopexit59 ], [ 0, %.preheader64 ]
  %41 = add nuw nsw i64 %.05075, 1
  %42 = icmp slt i64 %41, %40
  br i1 %42, label %.lr.ph74, label %.loopexit59

.lr.ph74:                                         ; preds = %.lr.ph76
  %43 = getelementptr inbounds [1000 x i64], ptr @V, i64 0, i64 %.05075
  %44 = getelementptr inbounds [1000 x i64], ptr getelementptr inbounds (i8, ptr @dsu, i64 8000), i64 0, i64 %.05075
  br label %45

45:                                               ; preds = %.lr.ph74, %95
  %.04971 = phi i64 [ %41, %.lr.ph74 ], [ %96, %95 ]
  %46 = getelementptr inbounds [1000 x [1000 x i64]], ptr @A, i64 0, i64 %.05075, i64 %.04971
  %47 = load i64, ptr %46, align 8, !tbaa !8
  %48 = getelementptr inbounds [1000 x [1000 x i64]], ptr @A, i64 0, i64 %.04971, i64 %.05075
  %49 = load i64, ptr %48, align 8, !tbaa !8
  %50 = icmp eq i64 %47, %49
  br i1 %50, label %95, label %51

51:                                               ; preds = %45
  %52 = call noundef i64 @_ZN3DSU4findEx(ptr noundef nonnull align 8 dereferenceable(16000) @dsu, i64 noundef %.05075)
  %53 = call noundef i64 @_ZN3DSU4findEx(ptr noundef nonnull align 8 dereferenceable(16000) @dsu, i64 noundef %.04971)
  %54 = icmp eq i64 %52, %53
  br i1 %54, label %95, label %55

55:                                               ; preds = %51
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #7
  store i64 %.05075, ptr %2, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #7
  store i64 %.04971, ptr %3, align 8, !tbaa !8
  %56 = load i64, ptr %46, align 8, !tbaa !8
  %57 = load i64, ptr %48, align 8, !tbaa !8
  %58 = icmp sgt i64 %56, %57
  %59 = zext i1 %58 to i64
  %60 = load i64, ptr %43, align 8, !tbaa !8
  %.not55 = icmp eq i64 %60, -1
  %61 = getelementptr inbounds [1000 x i64], ptr @V, i64 0, i64 %.04971
  %62 = load i64, ptr %61, align 8, !tbaa !8
  %63 = icmp eq i64 %62, -1
  br i1 %.not55, label %79, label %64

64:                                               ; preds = %55
  br i1 %63, label %81, label %65

65:                                               ; preds = %64
  %66 = load i64, ptr %44, align 8, !tbaa !8
  %67 = getelementptr inbounds [1000 x i64], ptr getelementptr inbounds (i8, ptr @dsu, i64 8000), i64 0, i64 %.04971
  %68 = load i64, ptr %67, align 8, !tbaa !8
  %69 = icmp slt i64 %66, %68
  br i1 %69, label %70, label %71

70:                                               ; preds = %65
  call void @_ZSt4swapIxENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 8 dereferenceable(8) %2, ptr noundef nonnull align 8 dereferenceable(8) %3) #7
  %.pre = load i64, ptr %2, align 8, !tbaa !8
  %.phi.trans.insert = getelementptr inbounds [1000 x i64], ptr @V, i64 0, i64 %.pre
  %.pre93 = load i64, ptr %.phi.trans.insert, align 8, !tbaa !8
  %.pre94 = load i64, ptr %3, align 8, !tbaa !8
  %.phi.trans.insert95 = getelementptr inbounds [1000 x i64], ptr @V, i64 0, i64 %.pre94
  %.pre96 = load i64, ptr %.phi.trans.insert95, align 8, !tbaa !8
  br label %71

71:                                               ; preds = %70, %65
  %72 = phi i64 [ %.pre96, %70 ], [ %62, %65 ]
  %73 = phi i64 [ %.pre94, %70 ], [ %.04971, %65 ]
  %74 = phi i64 [ %.pre93, %70 ], [ %60, %65 ]
  %75 = phi i64 [ %.pre, %70 ], [ %.05075, %65 ]
  %76 = icmp ne i64 %72, %59
  %77 = zext i1 %76 to i64
  %.not57 = icmp eq i64 %74, %77
  br i1 %.not57, label %88, label %78

78:                                               ; preds = %71
  call void @_Z6parityxx(i64 noundef %73, i64 noundef -1)
  %.pre101 = load i64, ptr %2, align 8, !tbaa !8
  %.pre102 = load i64, ptr %3, align 8, !tbaa !8
  br label %88

79:                                               ; preds = %55
  br i1 %63, label %80, label %82

80:                                               ; preds = %79
  store i64 0, ptr %43, align 8, !tbaa !8
  store i64 %59, ptr %61, align 8, !tbaa !8
  br label %88

81:                                               ; preds = %64
  call void @_ZSt4swapIxENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 8 dereferenceable(8) %2, ptr noundef nonnull align 8 dereferenceable(8) %3) #7
  %.pre97 = load i64, ptr %3, align 8, !tbaa !8
  %.phi.trans.insert98 = getelementptr inbounds [1000 x i64], ptr @V, i64 0, i64 %.pre97
  %.pre99 = load i64, ptr %.phi.trans.insert98, align 8, !tbaa !8
  %.pre100 = load i64, ptr %2, align 8, !tbaa !8
  br label %82

82:                                               ; preds = %79, %81
  %83 = phi i64 [ %.pre100, %81 ], [ %.05075, %79 ]
  %84 = phi i64 [ %.pre99, %81 ], [ %62, %79 ]
  %85 = phi i64 [ %.pre97, %81 ], [ %.04971, %79 ]
  %86 = xor i64 %84, %59
  %87 = getelementptr inbounds [1000 x i64], ptr @V, i64 0, i64 %83
  store i64 %86, ptr %87, align 8, !tbaa !8
  br label %88

88:                                               ; preds = %80, %82, %71, %78
  %89 = phi i64 [ %.04971, %80 ], [ %85, %82 ], [ %73, %71 ], [ %.pre102, %78 ]
  %90 = phi i64 [ %.05075, %80 ], [ %83, %82 ], [ %75, %71 ], [ %.pre101, %78 ]
  call void @_ZN3DSU2unExx(ptr noundef nonnull align 8 dereferenceable(16000) @dsu, i64 noundef %90, i64 noundef %89)
  %91 = load i64, ptr %2, align 8, !tbaa !8
  %92 = getelementptr inbounds [1000 x %"class.std::vector"], ptr @G, i64 0, i64 %91
  call void @_ZNSt6vectorIxSaIxEE9push_backERKx(ptr noundef nonnull align 8 dereferenceable(24) %92, ptr noundef nonnull align 8 dereferenceable(8) %3)
  %93 = load i64, ptr %3, align 8, !tbaa !8
  %94 = getelementptr inbounds [1000 x %"class.std::vector"], ptr @G, i64 0, i64 %93
  call void @_ZNSt6vectorIxSaIxEE9push_backERKx(ptr noundef nonnull align 8 dereferenceable(24) %94, ptr noundef nonnull align 8 dereferenceable(8) %2)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #7
  br label %95

95:                                               ; preds = %51, %45, %88
  %96 = add nuw nsw i64 %.04971, 1
  %97 = load i64, ptr @N, align 8
  %98 = icmp slt i64 %96, %97
  br i1 %98, label %45, label %.loopexit59, !llvm.loop !20

.preheader61:                                     ; preds = %.loopexit
  %99 = icmp sgt i64 %109, 0
  br i1 %99, label %.preheader, label %.loopexit62

.lr.ph81:                                         ; preds = %.preheader63, %.loopexit
  %100 = phi i64 [ %109, %.loopexit ], [ %37, %.preheader63 ]
  %.04779 = phi i64 [ %110, %.loopexit ], [ 0, %.preheader63 ]
  %101 = getelementptr inbounds [1000 x i64], ptr @V, i64 0, i64 %.04779
  %102 = load i64, ptr %101, align 8, !tbaa !8
  %.not54 = icmp ne i64 %102, 0
  %103 = icmp sgt i64 %100, 0
  %or.cond = and i1 %.not54, %103
  br i1 %or.cond, label %.lr.ph78, label %.loopexit

.lr.ph78:                                         ; preds = %.lr.ph81, %.lr.ph78
  %.04677 = phi i64 [ %106, %.lr.ph78 ], [ 0, %.lr.ph81 ]
  %104 = getelementptr inbounds [1000 x [1000 x i64]], ptr @A, i64 0, i64 %.04779, i64 %.04677
  %105 = getelementptr inbounds [1000 x [1000 x i64]], ptr @A, i64 0, i64 %.04677, i64 %.04779
  call void @_ZSt4swapIxENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 8 dereferenceable(8) %104, ptr noundef nonnull align 8 dereferenceable(8) %105) #7
  %106 = add nuw nsw i64 %.04677, 1
  %107 = load i64, ptr @N, align 8
  %108 = icmp slt i64 %106, %107
  br i1 %108, label %.lr.ph78, label %.loopexit, !llvm.loop !21

.loopexit:                                        ; preds = %.lr.ph78, %.lr.ph81
  %109 = phi i64 [ %100, %.lr.ph81 ], [ %107, %.lr.ph78 ]
  %110 = add nuw nsw i64 %.04779, 1
  %111 = icmp slt i64 %110, %109
  br i1 %111, label %.lr.ph81, label %.preheader61, !llvm.loop !22

.preheader:                                       ; preds = %.preheader61, %._crit_edge84
  %112 = phi i64 [ %116, %._crit_edge84 ], [ %109, %.preheader61 ]
  %.04585 = phi i64 [ %115, %._crit_edge84 ], [ 0, %.preheader61 ]
  %113 = icmp sgt i64 %112, 0
  br i1 %113, label %.lr.ph83, label %._crit_edge84

._crit_edge84:                                    ; preds = %.lr.ph83, %.preheader
  %114 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i8 noundef signext 10)
  %115 = add nuw nsw i64 %.04585, 1
  %116 = load i64, ptr @N, align 8, !tbaa !8
  %117 = icmp slt i64 %115, %116
  br i1 %117, label %.preheader, label %.loopexit62, !llvm.loop !23

.lr.ph83:                                         ; preds = %.preheader, %.lr.ph83
  %.082 = phi i64 [ %122, %.lr.ph83 ], [ 0, %.preheader ]
  %118 = getelementptr inbounds [1000 x [1000 x i64]], ptr @A, i64 0, i64 %.04585, i64 %.082
  %119 = load i64, ptr %118, align 8, !tbaa !8
  %120 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %119)
  %121 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %120, i8 noundef signext 32)
  %122 = add nuw nsw i64 %.082, 1
  %123 = load i64, ptr @N, align 8, !tbaa !8
  %124 = icmp slt i64 %122, %123
  br i1 %124, label %.lr.ph83, label %._crit_edge84, !llvm.loop !24

._crit_edge89:                                    ; preds = %.loopexit62, %0
  ret i32 0
}

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

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

; 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 #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3DSU4initEx(ptr noundef nonnull align 8 dereferenceable(16000), i64 noundef) local_unnamed_addr #0 align 2

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_ZN3DSU4findEx(ptr noundef nonnull align 8 dereferenceable(16000), i64 noundef) local_unnamed_addr #0 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3DSU2unExx(ptr noundef nonnull align 8 dereferenceable(16000), i64 noundef, i64 noundef) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIxSaIxEE9push_backERKx(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #0 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 #5

; 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 #0 align 2

attributes #0 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress norecurse uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { "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 = { 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 #6 = { 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 #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 = !{!14, !14, i64 0}
!14 = !{!"int", !10, i64 0}
!15 = distinct !{!15, !12, !16}
!16 = !{!"llvm.loop.unswitch.partial.disable"}
!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 = distinct !{!23, !12}
!24 = distinct !{!24, !12}


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