; LLVM IR from eyangch/competitive-programming :: FacebookHackercup/2022/round1/a2 (a2)

; 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::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 }

@T = external dso_local global i64, align 8
@N = external dso_local global i64, align 8
@K = external dso_local global i64, align 8
@A = external dso_local global [500000 x i64], align 16
@B = external dso_local global [500000 x i64], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [7 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [4 x i8], align 1

; 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 i32, align 4
  %4 = alloca i64, align 8
  %5 = alloca i64, align 8
  %6 = alloca i64, align 8
  %7 = alloca i128, align 16
  %8 = alloca i128, align 16
  %9 = alloca i64, align 8
  %10 = alloca i64, align 8
  %11 = alloca %"class.std::vector", align 8
  %12 = alloca i64, align 8
  %13 = alloca i8, align 1
  %14 = alloca i64, align 8
  %15 = alloca ptr, align 8
  %16 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %17 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %18 = getelementptr i8, ptr %17, i64 -24
  %19 = load i64, ptr %18, align 8
  %20 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %19
  %21 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %20, ptr noundef null)
  %22 = call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %23 = 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)
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #6
  store i64 1, ptr %2, align 8, !tbaa !8
  br label %24

24:                                               ; preds = %233, %0
  %25 = load i64, ptr %2, align 8, !tbaa !8
  %26 = load i64, ptr @T, align 8, !tbaa !8
  %27 = icmp sle i64 %25, %26
  br i1 %27, label %29, label %28

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

29:                                               ; preds = %24
  %30 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str)
  %31 = load i64, ptr %2, align 8, !tbaa !8
  %32 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) %30, i64 noundef %31)
  %33 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %32, ptr noundef @.str.1)
  %34 = 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)
  %35 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %34, ptr noundef nonnull align 8 dereferenceable(8) @K)
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #6
  store i64 0, ptr %4, align 8, !tbaa !8
  br label %36

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

40:                                               ; preds = %36
  store i32 5, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #6
  br label %52

41:                                               ; preds = %36
  %42 = load i64, ptr %4, align 8, !tbaa !8
  %43 = getelementptr inbounds [500000 x i64], ptr @A, i64 0, i64 %42
  %44 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %43)
  %45 = load i64, ptr %4, align 8, !tbaa !8
  %46 = getelementptr inbounds [500000 x i64], ptr @A, i64 0, i64 %45
  %47 = load i64, ptr %46, align 8, !tbaa !8
  %48 = add nsw i64 %47, -1
  store i64 %48, ptr %46, align 8, !tbaa !8
  br label %49

49:                                               ; preds = %41
  %50 = load i64, ptr %4, align 8, !tbaa !8
  %51 = add nsw i64 %50, 1
  store i64 %51, ptr %4, align 8, !tbaa !8
  br label %36, !llvm.loop !11

52:                                               ; preds = %40
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #6
  store i64 0, ptr %5, align 8, !tbaa !8
  br label %53

53:                                               ; preds = %66, %52
  %54 = load i64, ptr %5, align 8, !tbaa !8
  %55 = load i64, ptr @N, align 8, !tbaa !8
  %56 = icmp slt i64 %54, %55
  br i1 %56, label %58, label %57

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

58:                                               ; preds = %53
  %59 = load i64, ptr %5, align 8, !tbaa !8
  %60 = getelementptr inbounds [500000 x i64], ptr @B, i64 0, i64 %59
  %61 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %60)
  %62 = load i64, ptr %5, align 8, !tbaa !8
  %63 = getelementptr inbounds [500000 x i64], ptr @B, i64 0, i64 %62
  %64 = load i64, ptr %63, align 8, !tbaa !8
  %65 = add nsw i64 %64, -1
  store i64 %65, ptr %63, align 8, !tbaa !8
  br label %66

66:                                               ; preds = %58
  %67 = load i64, ptr %5, align 8, !tbaa !8
  %68 = add nsw i64 %67, 1
  store i64 %68, ptr %5, align 8, !tbaa !8
  br label %53, !llvm.loop !13

69:                                               ; preds = %57
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #6
  store i64 0, ptr %6, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 16, ptr %7) #6
  store i128 0, ptr %7, align 16, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 16, ptr %8) #6
  store i128 0, ptr %8, align 16, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #6
  store i64 0, ptr %9, align 8, !tbaa !8
  br label %70

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

74:                                               ; preds = %70
  store i32 11, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  br label %93

75:                                               ; preds = %70
  %76 = load i64, ptr %9, align 8, !tbaa !8
  %77 = getelementptr inbounds [500000 x i64], ptr @A, i64 0, i64 %76
  %78 = load i64, ptr %77, align 8, !tbaa !8
  %79 = load i64, ptr %6, align 8, !tbaa !8
  %80 = add nsw i64 %79, %78
  store i64 %80, ptr %6, align 8, !tbaa !8
  %81 = load i64, ptr %9, align 8, !tbaa !8
  %82 = getelementptr inbounds [500000 x i64], ptr @A, i64 0, i64 %81
  %83 = load i64, ptr %82, align 8, !tbaa !8
  %84 = load i64, ptr %9, align 8, !tbaa !8
  %85 = add nsw i64 %84, 1
  %86 = mul nsw i64 %83, %85
  %87 = sext i64 %86 to i128
  %88 = load i128, ptr %7, align 16, !tbaa !14
  %89 = add nsw i128 %88, %87
  store i128 %89, ptr %7, align 16, !tbaa !14
  br label %90

90:                                               ; preds = %75
  %91 = load i64, ptr %9, align 8, !tbaa !8
  %92 = add nsw i64 %91, 1
  store i64 %92, ptr %9, align 8, !tbaa !8
  br label %70, !llvm.loop !16

93:                                               ; preds = %74
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  store i64 0, ptr %10, align 8, !tbaa !8
  br label %94

94:                                               ; preds = %109, %93
  %95 = load i64, ptr %10, align 8, !tbaa !8
  %96 = load i64, ptr @N, align 8, !tbaa !8
  %97 = icmp slt i64 %95, %96
  br i1 %97, label %99, label %98

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

99:                                               ; preds = %94
  %100 = load i64, ptr %10, align 8, !tbaa !8
  %101 = getelementptr inbounds [500000 x i64], ptr @B, i64 0, i64 %100
  %102 = load i64, ptr %101, align 8, !tbaa !8
  %103 = load i64, ptr %10, align 8, !tbaa !8
  %104 = add nsw i64 %103, 1
  %105 = mul nsw i64 %102, %104
  %106 = sext i64 %105 to i128
  %107 = load i128, ptr %8, align 16, !tbaa !14
  %108 = add nsw i128 %107, %106
  store i128 %108, ptr %8, align 16, !tbaa !14
  br label %109

109:                                              ; preds = %99
  %110 = load i64, ptr %10, align 8, !tbaa !8
  %111 = add nsw i64 %110, 1
  store i64 %111, ptr %10, align 8, !tbaa !8
  br label %94, !llvm.loop !17

112:                                              ; preds = %98
  call void @llvm.lifetime.start.p0(i64 24, ptr %11) #6
  call void @_ZNSt6vectorIxSaIxEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %11) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  store i64 0, ptr %12, align 8, !tbaa !8
  br label %113

113:                                              ; preds = %166, %112
  %114 = load i64, ptr %12, align 8, !tbaa !8
  %115 = load i64, ptr @N, align 8, !tbaa !8
  %116 = icmp slt i64 %114, %115
  br i1 %116, label %118, label %117

117:                                              ; preds = %113
  store i32 17, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  br label %169

118:                                              ; preds = %113
  %119 = load i128, ptr %7, align 16, !tbaa !14
  %120 = load i128, ptr %8, align 16, !tbaa !14
  %121 = icmp eq i128 %119, %120
  br i1 %121, label %122, label %155

122:                                              ; preds = %118
  call void @llvm.lifetime.start.p0(i64 1, ptr %13) #6
  store i8 1, ptr %13, align 1, !tbaa !18
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #6
  store i64 0, ptr %14, align 8, !tbaa !8
  br label %123

123:                                              ; preds = %142, %122
  %124 = load i64, ptr %14, align 8, !tbaa !8
  %125 = load i64, ptr @N, align 8, !tbaa !8
  %126 = icmp slt i64 %124, %125
  br i1 %126, label %128, label %127

127:                                              ; preds = %123
  store i32 20, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  br label %145

128:                                              ; preds = %123
  %129 = load i64, ptr %12, align 8, !tbaa !8
  %130 = load i64, ptr %14, align 8, !tbaa !8
  %131 = add nsw i64 %129, %130
  %132 = load i64, ptr @N, align 8, !tbaa !8
  %133 = srem i64 %131, %132
  %134 = getelementptr inbounds [500000 x i64], ptr @A, i64 0, i64 %133
  %135 = load i64, ptr %134, align 8, !tbaa !8
  %136 = load i64, ptr %14, align 8, !tbaa !8
  %137 = getelementptr inbounds [500000 x i64], ptr @B, i64 0, i64 %136
  %138 = load i64, ptr %137, align 8, !tbaa !8
  %139 = icmp ne i64 %135, %138
  br i1 %139, label %140, label %141

140:                                              ; preds = %128
  store i8 0, ptr %13, align 1, !tbaa !18
  br label %141

141:                                              ; preds = %140, %128
  br label %142

142:                                              ; preds = %141
  %143 = load i64, ptr %14, align 8, !tbaa !8
  %144 = add nsw i64 %143, 1
  store i64 %144, ptr %14, align 8, !tbaa !8
  br label %123, !llvm.loop !20

145:                                              ; preds = %127
  %146 = load i8, ptr %13, align 1, !tbaa !18, !range !21, !noundef !22
  %147 = trunc i8 %146 to i1
  br i1 %147, label %148, label %154

148:                                              ; preds = %145
  invoke void @_ZNSt6vectorIxSaIxEE9push_backERKx(ptr noundef nonnull align 8 dereferenceable(24) %11, ptr noundef nonnull align 8 dereferenceable(8) %12)
          to label %149 unwind label %150

149:                                              ; preds = %148
  br label %154

150:                                              ; preds = %148
  %151 = landingpad { ptr, i32 }
          cleanup
  %152 = extractvalue { ptr, i32 } %151, 0
  store ptr %152, ptr %15, align 8
  %153 = extractvalue { ptr, i32 } %151, 1
  store i32 %153, ptr %16, align 4
  call void @llvm.lifetime.end.p0(i64 1, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  br label %236

154:                                              ; preds = %149, %145
  call void @llvm.lifetime.end.p0(i64 1, ptr %13) #6
  br label %155

155:                                              ; preds = %154, %118
  %156 = load i64, ptr %12, align 8, !tbaa !8
  %157 = getelementptr inbounds [500000 x i64], ptr @A, i64 0, i64 %156
  %158 = load i64, ptr %157, align 8, !tbaa !8
  %159 = load i64, ptr @N, align 8, !tbaa !8
  %160 = mul nsw i64 %158, %159
  %161 = load i64, ptr %6, align 8, !tbaa !8
  %162 = sub nsw i64 %160, %161
  %163 = sext i64 %162 to i128
  %164 = load i128, ptr %7, align 16, !tbaa !14
  %165 = add nsw i128 %164, %163
  store i128 %165, ptr %7, align 16, !tbaa !14
  br label %166

166:                                              ; preds = %155
  %167 = load i64, ptr %12, align 8, !tbaa !8
  %168 = add nsw i64 %167, 1
  store i64 %168, ptr %12, align 8, !tbaa !8
  br label %113, !llvm.loop !23

169:                                              ; preds = %117
  %170 = call noundef i64 @_ZNKSt6vectorIxSaIxEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %11) #6
  %171 = icmp eq i64 %170, 0
  br i1 %171, label %172, label %181

172:                                              ; preds = %169
  %173 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.2)
          to label %174 unwind label %177

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

176:                                              ; preds = %174
  br label %232

177:                                              ; preds = %227, %225, %221, %219, %216, %214, %201, %199, %196, %194, %174, %172
  %178 = landingpad { ptr, i32 }
          cleanup
  %179 = extractvalue { ptr, i32 } %178, 0
  store ptr %179, ptr %15, align 8
  %180 = extractvalue { ptr, i32 } %178, 1
  store i32 %180, ptr %16, align 4
  br label %236

181:                                              ; preds = %169
  %182 = load i64, ptr @N, align 8, !tbaa !8
  %183 = icmp eq i64 %182, 2
  br i1 %183, label %184, label %187

184:                                              ; preds = %181
  %185 = load i64, ptr @K, align 8, !tbaa !8
  %186 = srem i64 %185, 2
  store i64 %186, ptr @K, align 8, !tbaa !8
  br label %187

187:                                              ; preds = %184, %181
  %188 = load i64, ptr @K, align 8, !tbaa !8
  %189 = icmp eq i64 %188, 0
  br i1 %189, label %190, label %205

190:                                              ; preds = %187
  %191 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %11, i64 noundef 0) #6
  %192 = load i64, ptr %191, align 8, !tbaa !8
  %193 = icmp eq i64 %192, 0
  br i1 %193, label %194, label %199

194:                                              ; preds = %190
  %195 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.3)
          to label %196 unwind label %177

196:                                              ; preds = %194
  %197 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %195, i8 noundef signext 10)
          to label %198 unwind label %177

198:                                              ; preds = %196
  br label %204

199:                                              ; preds = %190
  %200 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.2)
          to label %201 unwind label %177

201:                                              ; preds = %199
  %202 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %200, i8 noundef signext 10)
          to label %203 unwind label %177

203:                                              ; preds = %201
  br label %204

204:                                              ; preds = %203, %198
  br label %231

205:                                              ; preds = %187
  %206 = load i64, ptr @K, align 8, !tbaa !8
  %207 = icmp eq i64 %206, 1
  br i1 %207, label %208, label %225

208:                                              ; preds = %205
  %209 = call noundef i64 @_ZNKSt6vectorIxSaIxEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %11) #6
  %210 = sub i64 %209, 1
  %211 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %11, i64 noundef %210) #6
  %212 = load i64, ptr %211, align 8, !tbaa !8
  %213 = icmp ne i64 %212, 0
  br i1 %213, label %214, label %219

214:                                              ; preds = %208
  %215 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.3)
          to label %216 unwind label %177

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

218:                                              ; preds = %216
  br label %224

219:                                              ; preds = %208
  %220 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.2)
          to label %221 unwind label %177

221:                                              ; preds = %219
  %222 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %220, i8 noundef signext 10)
          to label %223 unwind label %177

223:                                              ; preds = %221
  br label %224

224:                                              ; preds = %223, %218
  br label %230

225:                                              ; preds = %205
  %226 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.3)
          to label %227 unwind label %177

227:                                              ; preds = %225
  %228 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %226, i8 noundef signext 10)
          to label %229 unwind label %177

229:                                              ; preds = %227
  br label %230

230:                                              ; preds = %229, %224
  br label %231

231:                                              ; preds = %230, %204
  br label %232

232:                                              ; preds = %231, %176
  call void @_ZNSt6vectorIxSaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %11) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #6
  br label %233

233:                                              ; preds = %232
  %234 = load i64, ptr %2, align 8, !tbaa !8
  %235 = add nsw i64 %234, 1
  store i64 %235, ptr %2, align 8, !tbaa !8
  br label %24, !llvm.loop !24

236:                                              ; preds = %177, %150
  call void @_ZNSt6vectorIxSaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %11) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #6
  br label %239

237:                                              ; preds = %28
  %238 = load i32, ptr %1, align 4
  ret i32 %238

239:                                              ; preds = %236
  %240 = load ptr, ptr %15, align 8
  %241 = load i32, ptr %16, align 4
  %242 = insertvalue { ptr, i32 } poison, ptr %240, 0
  %243 = insertvalue { ptr, i32 } %242, i32 %241, 1
  resume { ptr, i32 } %243
}

; 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: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #5

; 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

; 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 @_ZNSt6vectorIxSaIxEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #1 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)) #3 align 2

declare i32 @__gxx_personality_v0(...)

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIxSaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) 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 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 = { 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 = !{!"__int128", !10, i64 0}
!16 = distinct !{!16, !12}
!17 = distinct !{!17, !12}
!18 = !{!19, !19, i64 0}
!19 = !{!"bool", !10, i64 0}
!20 = distinct !{!20, !12}
!21 = !{i8 0, i8 2}
!22 = !{}
!23 = distinct !{!23, !12}
!24 = distinct !{!24, !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::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::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 }

@T = external dso_local global i64, align 8
@N = external dso_local global i64, align 8
@K = external dso_local global i64, align 8
@A = external dso_local global [500000 x i64], align 16
@B = external dso_local global [500000 x i64], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [7 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca %"class.std::vector", align 8
  %2 = alloca i64, align 8
  %3 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %4 = getelementptr i8, ptr %3, i64 -24
  %5 = load i64, ptr %4, align 8
  %6 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %5
  %7 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %6, ptr noundef null)
  %8 = tail call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %9 = 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)
  %10 = load i64, ptr @T, align 8, !tbaa !8
  %.not77 = icmp slt i64 %10, 1
  br i1 %.not77, label %._crit_edge81, label %.lr.ph80

._crit_edge81:                                    ; preds = %164, %0
  ret i32 0

.lr.ph80:                                         ; preds = %0, %164
  %.04578 = phi i64 [ %165, %164 ], [ 1, %0 ]
  %11 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str)
  %12 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) %11, i64 noundef %.04578)
  %13 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %12, ptr noundef nonnull @.str.1)
  %14 = 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)
  %15 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %14, ptr noundef nonnull align 8 dereferenceable(8) @K)
  %16 = load i64, ptr @N, align 8, !tbaa !8
  %17 = icmp sgt i64 %16, 0
  br i1 %17, label %.lr.ph, label %._crit_edge

.preheader53:                                     ; preds = %.lr.ph
  %18 = icmp sgt i64 %24, 0
  br i1 %18, label %.lr.ph56, label %._crit_edge

.lr.ph:                                           ; preds = %.lr.ph80, %.lr.ph
  %.04454 = phi i64 [ %23, %.lr.ph ], [ 0, %.lr.ph80 ]
  %19 = getelementptr inbounds [500000 x i64], ptr @A, i64 0, i64 %.04454
  %20 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %19)
  %21 = load i64, ptr %19, align 8, !tbaa !8
  %22 = add nsw i64 %21, -1
  store i64 %22, ptr %19, align 8, !tbaa !8
  %23 = add nuw nsw i64 %.04454, 1
  %24 = load i64, ptr @N, align 8, !tbaa !8
  %25 = icmp slt i64 %23, %24
  br i1 %25, label %.lr.ph, label %.preheader53, !llvm.loop !11

.preheader52:                                     ; preds = %.lr.ph56
  %26 = icmp sgt i64 %33, 0
  br i1 %26, label %.lr.ph60.preheader, label %._crit_edge

.lr.ph60.preheader:                               ; preds = %.preheader52
  %xtraiter = and i64 %33, 3
  %27 = icmp ult i64 %33, 4
  br i1 %27, label %.preheader51.unr-lcssa, label %.lr.ph60.preheader.new

.lr.ph60.preheader.new:                           ; preds = %.lr.ph60.preheader
  %unroll_iter = and i64 %33, 9223372036854775804
  br label %.lr.ph60

.lr.ph56:                                         ; preds = %.preheader53, %.lr.ph56
  %.04355 = phi i64 [ %32, %.lr.ph56 ], [ 0, %.preheader53 ]
  %28 = getelementptr inbounds [500000 x i64], ptr @B, i64 0, i64 %.04355
  %29 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %28)
  %30 = load i64, ptr %28, align 8, !tbaa !8
  %31 = add nsw i64 %30, -1
  store i64 %31, ptr %28, align 8, !tbaa !8
  %32 = add nuw nsw i64 %.04355, 1
  %33 = load i64, ptr @N, align 8, !tbaa !8
  %34 = icmp slt i64 %32, %33
  br i1 %34, label %.lr.ph56, label %.preheader52, !llvm.loop !13

.preheader51.unr-lcssa:                           ; preds = %.lr.ph60, %.lr.ph60.preheader
  %.lcssa110.ph = phi i64 [ poison, %.lr.ph60.preheader ], [ %66, %.lr.ph60 ]
  %.lcssa109.ph = phi i128 [ poison, %.lr.ph60.preheader ], [ %70, %.lr.ph60 ]
  %.03859.unr = phi i64 [ 0, %.lr.ph60.preheader ], [ %67, %.lr.ph60 ]
  %.04058.unr = phi i128 [ 0, %.lr.ph60.preheader ], [ %70, %.lr.ph60 ]
  %.04257.unr = phi i64 [ 0, %.lr.ph60.preheader ], [ %66, %.lr.ph60 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.preheader51, label %.lr.ph60.epil

.lr.ph60.epil:                                    ; preds = %.preheader51.unr-lcssa, %.lr.ph60.epil
  %.03859.epil = phi i64 [ %38, %.lr.ph60.epil ], [ %.03859.unr, %.preheader51.unr-lcssa ]
  %.04058.epil = phi i128 [ %41, %.lr.ph60.epil ], [ %.04058.unr, %.preheader51.unr-lcssa ]
  %.04257.epil = phi i64 [ %37, %.lr.ph60.epil ], [ %.04257.unr, %.preheader51.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.lr.ph60.epil ], [ 0, %.preheader51.unr-lcssa ]
  %35 = getelementptr inbounds [500000 x i64], ptr @A, i64 0, i64 %.03859.epil
  %36 = load i64, ptr %35, align 8, !tbaa !8
  %37 = add nsw i64 %36, %.04257.epil
  %38 = add nuw nsw i64 %.03859.epil, 1
  %39 = mul nsw i64 %36, %38
  %40 = sext i64 %39 to i128
  %41 = add nsw i128 %.04058.epil, %40
  %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 %.preheader51, label %.lr.ph60.epil, !llvm.loop !14

.preheader51:                                     ; preds = %.lr.ph60.epil, %.preheader51.unr-lcssa
  %.lcssa110 = phi i64 [ %.lcssa110.ph, %.preheader51.unr-lcssa ], [ %37, %.lr.ph60.epil ]
  %.lcssa109 = phi i128 [ %.lcssa109.ph, %.preheader51.unr-lcssa ], [ %41, %.lr.ph60.epil ]
  br i1 %26, label %.lr.ph65.preheader, label %._crit_edge

.lr.ph65.preheader:                               ; preds = %.preheader51
  %xtraiter114 = and i64 %33, 3
  %42 = icmp ult i64 %33, 4
  br i1 %42, label %._crit_edge.loopexit.unr-lcssa, label %.lr.ph65.preheader.new

.lr.ph65.preheader.new:                           ; preds = %.lr.ph65.preheader
  %unroll_iter118 = and i64 %33, 9223372036854775804
  br label %.lr.ph65

.lr.ph60:                                         ; preds = %.lr.ph60, %.lr.ph60.preheader.new
  %.03859 = phi i64 [ 0, %.lr.ph60.preheader.new ], [ %67, %.lr.ph60 ]
  %.04058 = phi i128 [ 0, %.lr.ph60.preheader.new ], [ %70, %.lr.ph60 ]
  %.04257 = phi i64 [ 0, %.lr.ph60.preheader.new ], [ %66, %.lr.ph60 ]
  %niter = phi i64 [ 0, %.lr.ph60.preheader.new ], [ %niter.next.3, %.lr.ph60 ]
  %43 = getelementptr inbounds [500000 x i64], ptr @A, i64 0, i64 %.03859
  %44 = load i64, ptr %43, align 16, !tbaa !8
  %45 = add nsw i64 %44, %.04257
  %46 = or disjoint i64 %.03859, 1
  %47 = mul nsw i64 %44, %46
  %48 = sext i64 %47 to i128
  %49 = add nsw i128 %.04058, %48
  %50 = getelementptr inbounds [500000 x i64], ptr @A, i64 0, i64 %46
  %51 = load i64, ptr %50, align 8, !tbaa !8
  %52 = add nsw i64 %51, %45
  %53 = or disjoint i64 %.03859, 2
  %54 = mul nsw i64 %51, %53
  %55 = sext i64 %54 to i128
  %56 = add nsw i128 %49, %55
  %57 = getelementptr inbounds [500000 x i64], ptr @A, i64 0, i64 %53
  %58 = load i64, ptr %57, align 16, !tbaa !8
  %59 = add nsw i64 %58, %52
  %60 = or disjoint i64 %.03859, 3
  %61 = mul nsw i64 %58, %60
  %62 = sext i64 %61 to i128
  %63 = add nsw i128 %56, %62
  %64 = getelementptr inbounds [500000 x i64], ptr @A, i64 0, i64 %60
  %65 = load i64, ptr %64, align 8, !tbaa !8
  %66 = add nsw i64 %65, %59
  %67 = add nuw nsw i64 %.03859, 4
  %68 = mul nsw i64 %65, %67
  %69 = sext i64 %68 to i128
  %70 = add nsw i128 %63, %69
  %niter.next.3 = add i64 %niter, 4
  %niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
  br i1 %niter.ncmp.3, label %.preheader51.unr-lcssa, label %.lr.ph60, !llvm.loop !16

._crit_edge.loopexit.unr-lcssa:                   ; preds = %.lr.ph65, %.lr.ph65.preheader
  %.lcssa111.ph = phi i128 [ poison, %.lr.ph65.preheader ], [ %102, %.lr.ph65 ]
  %.03764.unr = phi i64 [ 0, %.lr.ph65.preheader ], [ %99, %.lr.ph65 ]
  %.03963.unr = phi i128 [ 0, %.lr.ph65.preheader ], [ %102, %.lr.ph65 ]
  %lcmp.mod116.not = icmp eq i64 %xtraiter114, 0
  br i1 %lcmp.mod116.not, label %._crit_edge, label %.lr.ph65.epil

.lr.ph65.epil:                                    ; preds = %._crit_edge.loopexit.unr-lcssa, %.lr.ph65.epil
  %.03764.epil = phi i64 [ %73, %.lr.ph65.epil ], [ %.03764.unr, %._crit_edge.loopexit.unr-lcssa ]
  %.03963.epil = phi i128 [ %76, %.lr.ph65.epil ], [ %.03963.unr, %._crit_edge.loopexit.unr-lcssa ]
  %epil.iter115 = phi i64 [ %epil.iter115.next, %.lr.ph65.epil ], [ 0, %._crit_edge.loopexit.unr-lcssa ]
  %71 = getelementptr inbounds [500000 x i64], ptr @B, i64 0, i64 %.03764.epil
  %72 = load i64, ptr %71, align 8, !tbaa !8
  %73 = add nuw nsw i64 %.03764.epil, 1
  %74 = mul nsw i64 %72, %73
  %75 = sext i64 %74 to i128
  %76 = add nsw i128 %.03963.epil, %75
  %epil.iter115.next = add i64 %epil.iter115, 1
  %epil.iter115.cmp.not = icmp eq i64 %epil.iter115.next, %xtraiter114
  br i1 %epil.iter115.cmp.not, label %._crit_edge, label %.lr.ph65.epil, !llvm.loop !17

._crit_edge:                                      ; preds = %._crit_edge.loopexit.unr-lcssa, %.lr.ph65.epil, %.preheader52, %.lr.ph80, %.preheader53, %.preheader51
  %.040.lcssa95 = phi i128 [ %.lcssa109, %.preheader51 ], [ 0, %.preheader53 ], [ 0, %.lr.ph80 ], [ 0, %.preheader52 ], [ %.lcssa109, %.lr.ph65.epil ], [ %.lcssa109, %._crit_edge.loopexit.unr-lcssa ]
  %.042.lcssa94 = phi i64 [ %.lcssa110, %.preheader51 ], [ 0, %.preheader53 ], [ 0, %.lr.ph80 ], [ 0, %.preheader52 ], [ %.lcssa110, %.lr.ph65.epil ], [ %.lcssa110, %._crit_edge.loopexit.unr-lcssa ]
  %.039.lcssa = phi i128 [ 0, %.preheader51 ], [ 0, %.preheader53 ], [ 0, %.lr.ph80 ], [ 0, %.preheader52 ], [ %.lcssa111.ph, %._crit_edge.loopexit.unr-lcssa ], [ %76, %.lr.ph65.epil ]
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %1) #6
  call void @_ZNSt6vectorIxSaIxEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %1) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #6
  store i64 0, ptr %2, align 8, !tbaa !8
  %77 = load i64, ptr @N, align 8, !tbaa !8
  %78 = icmp sgt i64 %77, 0
  br i1 %78, label %.lr.ph75, label %._crit_edge76

.lr.ph65:                                         ; preds = %.lr.ph65, %.lr.ph65.preheader.new
  %.03764 = phi i64 [ 0, %.lr.ph65.preheader.new ], [ %99, %.lr.ph65 ]
  %.03963 = phi i128 [ 0, %.lr.ph65.preheader.new ], [ %102, %.lr.ph65 ]
  %niter119 = phi i64 [ 0, %.lr.ph65.preheader.new ], [ %niter119.next.3, %.lr.ph65 ]
  %79 = getelementptr inbounds [500000 x i64], ptr @B, i64 0, i64 %.03764
  %80 = load i64, ptr %79, align 16, !tbaa !8
  %81 = or disjoint i64 %.03764, 1
  %82 = mul nsw i64 %80, %81
  %83 = sext i64 %82 to i128
  %84 = add nsw i128 %.03963, %83
  %85 = getelementptr inbounds [500000 x i64], ptr @B, i64 0, i64 %81
  %86 = load i64, ptr %85, align 8, !tbaa !8
  %87 = or disjoint i64 %.03764, 2
  %88 = mul nsw i64 %86, %87
  %89 = sext i64 %88 to i128
  %90 = add nsw i128 %84, %89
  %91 = getelementptr inbounds [500000 x i64], ptr @B, i64 0, i64 %87
  %92 = load i64, ptr %91, align 16, !tbaa !8
  %93 = or disjoint i64 %.03764, 3
  %94 = mul nsw i64 %92, %93
  %95 = sext i64 %94 to i128
  %96 = add nsw i128 %90, %95
  %97 = getelementptr inbounds [500000 x i64], ptr @B, i64 0, i64 %93
  %98 = load i64, ptr %97, align 8, !tbaa !8
  %99 = add nuw nsw i64 %.03764, 4
  %100 = mul nsw i64 %98, %99
  %101 = sext i64 %100 to i128
  %102 = add nsw i128 %96, %101
  %niter119.next.3 = add i64 %niter119, 4
  %niter119.ncmp.3 = icmp eq i64 %niter119.next.3, %unroll_iter118
  br i1 %niter119.ncmp.3, label %._crit_edge.loopexit.unr-lcssa, label %.lr.ph65, !llvm.loop !18

._crit_edge76:                                    ; preds = %132, %._crit_edge
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #6
  %103 = call noundef i64 @_ZNKSt6vectorIxSaIxEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %1) #6
  %104 = icmp eq i64 %103, 0
  br i1 %104, label %.invoke103, label %145

.lr.ph75:                                         ; preds = %._crit_edge, %132
  %105 = phi i64 [ %133, %132 ], [ %77, %._crit_edge ]
  %.14173 = phi i128 [ %140, %132 ], [ %.040.lcssa95, %._crit_edge ]
  %storemerge72 = phi i64 [ %141, %132 ], [ 0, %._crit_edge ]
  %106 = icmp eq i128 %.14173, %.039.lcssa
  br i1 %106, label %.preheader, label %132

.preheader:                                       ; preds = %.lr.ph75
  %107 = icmp sgt i64 %105, 0
  br i1 %107, label %.lr.ph69.preheader, label %.critedge

.lr.ph69.preheader:                               ; preds = %.preheader
  %xtraiter120 = and i64 %105, 1
  %108 = icmp eq i64 %105, 1
  br i1 %108, label %._crit_edge70.unr-lcssa, label %.lr.ph69.preheader.new

.lr.ph69.preheader.new:                           ; preds = %.lr.ph69.preheader
  %unroll_iter124 = and i64 %105, 9223372036854775806
  br label %.lr.ph69

._crit_edge70.unr-lcssa:                          ; preds = %.lr.ph69, %.lr.ph69.preheader
  %spec.select.lcssa.ph = phi i1 [ poison, %.lr.ph69.preheader ], [ %spec.select.1, %.lr.ph69 ]
  %.03568.unr = phi i64 [ 0, %.lr.ph69.preheader ], [ %129, %.lr.ph69 ]
  %.03667.unr = phi i1 [ true, %.lr.ph69.preheader ], [ %spec.select.1, %.lr.ph69 ]
  %lcmp.mod122.not = icmp eq i64 %xtraiter120, 0
  br i1 %lcmp.mod122.not, label %._crit_edge70, label %.lr.ph69.epil

.lr.ph69.epil:                                    ; preds = %._crit_edge70.unr-lcssa
  %109 = add nsw i64 %.03568.unr, %storemerge72
  %110 = srem i64 %109, %105
  %111 = getelementptr inbounds [500000 x i64], ptr @A, i64 0, i64 %110
  %112 = load i64, ptr %111, align 8, !tbaa !8
  %113 = getelementptr inbounds [500000 x i64], ptr @B, i64 0, i64 %.03568.unr
  %114 = load i64, ptr %113, align 8, !tbaa !8
  %.not50.epil = icmp eq i64 %112, %114
  %spec.select.epil = select i1 %.not50.epil, i1 %.03667.unr, i1 false
  br label %._crit_edge70

._crit_edge70:                                    ; preds = %._crit_edge70.unr-lcssa, %.lr.ph69.epil
  %spec.select.lcssa = phi i1 [ %spec.select.lcssa.ph, %._crit_edge70.unr-lcssa ], [ %spec.select.epil, %.lr.ph69.epil ]
  br i1 %spec.select.lcssa, label %.critedge, label %132

.lr.ph69:                                         ; preds = %.lr.ph69, %.lr.ph69.preheader.new
  %.03568 = phi i64 [ 0, %.lr.ph69.preheader.new ], [ %129, %.lr.ph69 ]
  %.03667 = phi i1 [ true, %.lr.ph69.preheader.new ], [ %spec.select.1, %.lr.ph69 ]
  %niter125 = phi i64 [ 0, %.lr.ph69.preheader.new ], [ %niter125.next.1, %.lr.ph69 ]
  %115 = add nsw i64 %.03568, %storemerge72
  %116 = srem i64 %115, %105
  %117 = getelementptr inbounds [500000 x i64], ptr @A, i64 0, i64 %116
  %118 = load i64, ptr %117, align 8, !tbaa !8
  %119 = getelementptr inbounds [500000 x i64], ptr @B, i64 0, i64 %.03568
  %120 = load i64, ptr %119, align 16, !tbaa !8
  %.not50 = icmp eq i64 %118, %120
  %121 = or disjoint i64 %.03568, 1
  %122 = add nsw i64 %121, %storemerge72
  %123 = srem i64 %122, %105
  %124 = getelementptr inbounds [500000 x i64], ptr @A, i64 0, i64 %123
  %125 = load i64, ptr %124, align 8, !tbaa !8
  %126 = getelementptr inbounds [500000 x i64], ptr @B, i64 0, i64 %121
  %127 = load i64, ptr %126, align 8, !tbaa !8
  %.not50.1 = icmp eq i64 %125, %127
  %128 = select i1 %.not50.1, i1 %.not50, i1 false
  %spec.select.1 = select i1 %128, i1 %.03667, i1 false
  %129 = add nuw nsw i64 %.03568, 2
  %niter125.next.1 = add i64 %niter125, 2
  %niter125.ncmp.1 = icmp eq i64 %niter125.next.1, %unroll_iter124
  br i1 %niter125.ncmp.1, label %._crit_edge70.unr-lcssa, label %.lr.ph69, !llvm.loop !19

.critedge:                                        ; preds = %.preheader, %._crit_edge70
  invoke void @_ZNSt6vectorIxSaIxEE9push_backERKx(ptr noundef nonnull align 8 dereferenceable(24) %1, ptr noundef nonnull align 8 dereferenceable(8) %2)
          to label %.critedge._crit_edge unwind label %130

.critedge._crit_edge:                             ; preds = %.critedge
  %.pre = load i64, ptr %2, align 8, !tbaa !8
  %.pre88 = load i64, ptr @N, align 8, !tbaa !8
  br label %132

130:                                              ; preds = %.critedge
  %131 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #6
  br label %167

132:                                              ; preds = %.critedge._crit_edge, %._crit_edge70, %.lr.ph75
  %133 = phi i64 [ %.pre88, %.critedge._crit_edge ], [ %105, %._crit_edge70 ], [ %105, %.lr.ph75 ]
  %134 = phi i64 [ %.pre, %.critedge._crit_edge ], [ %storemerge72, %._crit_edge70 ], [ %storemerge72, %.lr.ph75 ]
  %135 = getelementptr inbounds [500000 x i64], ptr @A, i64 0, i64 %134
  %136 = load i64, ptr %135, align 8, !tbaa !8
  %137 = mul nsw i64 %133, %136
  %138 = sub nsw i64 %137, %.042.lcssa94
  %139 = sext i64 %138 to i128
  %140 = add nsw i128 %.14173, %139
  %141 = add nsw i64 %134, 1
  store i64 %141, ptr %2, align 8, !tbaa !8
  %142 = icmp slt i64 %141, %133
  br i1 %142, label %.lr.ph75, label %._crit_edge76, !llvm.loop !20

143:                                              ; preds = %.invoke103, %.invoke
  %144 = landingpad { ptr, i32 }
          cleanup
  br label %167

145:                                              ; preds = %._crit_edge76
  %146 = load i64, ptr @N, align 8, !tbaa !8
  %147 = icmp eq i64 %146, 2
  %148 = load i64, ptr @K, align 8, !tbaa !8
  br i1 %147, label %149, label %thread-pre-split

149:                                              ; preds = %145
  %150 = srem i64 %148, 2
  store i64 %150, ptr @K, align 8, !tbaa !8
  br label %thread-pre-split

thread-pre-split:                                 ; preds = %145, %149
  %151 = phi i64 [ %150, %149 ], [ %148, %145 ]
  switch i64 %151, label %.invoke103 [
    i64 0, label %152
    i64 1, label %156
  ]

152:                                              ; preds = %thread-pre-split
  %153 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef 0) #6
  %154 = load i64, ptr %153, align 8, !tbaa !8
  %155 = icmp eq i64 %154, 0
  %.str.3..str.2 = select i1 %155, ptr @.str.3, ptr @.str.2
  br label %.invoke103

156:                                              ; preds = %thread-pre-split
  %157 = call noundef i64 @_ZNKSt6vectorIxSaIxEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %1) #6
  %158 = add i64 %157, -1
  %159 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %158) #6
  %160 = load i64, ptr %159, align 8, !tbaa !8
  %.not48 = icmp eq i64 %160, 0
  %.str.2..str.3 = select i1 %.not48, ptr @.str.2, ptr @.str.3
  br label %.invoke103

.invoke103:                                       ; preds = %._crit_edge76, %thread-pre-split, %156, %152
  %161 = phi ptr [ %.str.3..str.2, %152 ], [ %.str.2..str.3, %156 ], [ @.str.3, %thread-pre-split ], [ @.str.2, %._crit_edge76 ]
  %162 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull %161)
          to label %.invoke unwind label %143

.invoke:                                          ; preds = %.invoke103
  %163 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %162, i8 noundef signext 10)
          to label %164 unwind label %143

164:                                              ; preds = %.invoke
  call void @_ZNSt6vectorIxSaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %1) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %1) #6
  %165 = add nuw nsw i64 %.04578, 1
  %166 = load i64, ptr @T, align 8, !tbaa !8
  %.not.not = icmp slt i64 %.04578, %166
  br i1 %.not.not, label %.lr.ph80, label %._crit_edge81, !llvm.loop !21

167:                                              ; preds = %143, %130
  %.pn = phi { ptr, i32 } [ %131, %130 ], [ %144, %143 ]
  call void @_ZNSt6vectorIxSaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %1) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %1) #6
  resume { ptr, i32 } %.pn
}

; 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: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) 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 #3 align 2

; 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 @_ZNSt6vectorIxSaIxEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #1 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 #3 align 2

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIxSaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) 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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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, !15}
!15 = !{!"llvm.loop.unroll.disable"}
!16 = distinct !{!16, !12}
!17 = distinct !{!17, !15}
!18 = distinct !{!18, !12}
!19 = distinct !{!19, !12}
!20 = distinct !{!20, !12}
!21 = distinct !{!21, !12}


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