; LLVM IR from kazunetakahashi/atcoder :: 2017/0930_tenka1-2017 (D)

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

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i64, align 8
  %4 = alloca i32, align 4
  %5 = alloca i64, align 8
  %6 = alloca i64, align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i64, align 8
  %11 = alloca i64, align 8
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i8, align 1
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca i8, align 1
  %20 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %21 = 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)
  %22 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %21, ptr noundef nonnull align 8 dereferenceable(8) @K)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #5
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %23

23:                                               ; preds = %38, %0
  %24 = load i32, ptr %2, align 4, !tbaa !5
  %25 = sext i32 %24 to i64
  %26 = load i64, ptr @N, align 8, !tbaa !9
  %27 = icmp slt i64 %25, %26
  br i1 %27, label %29, label %28

28:                                               ; preds = %23
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #5
  br label %41

29:                                               ; preds = %23
  %30 = load i32, ptr %2, align 4, !tbaa !5
  %31 = sext i32 %30 to i64
  %32 = getelementptr inbounds [100010 x i64], ptr @A, i64 0, i64 %31
  %33 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %32)
  %34 = load i32, ptr %2, align 4, !tbaa !5
  %35 = sext i32 %34 to i64
  %36 = getelementptr inbounds [100010 x i64], ptr @B, i64 0, i64 %35
  %37 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %33, ptr noundef nonnull align 8 dereferenceable(8) %36)
  br label %38

38:                                               ; preds = %29
  %39 = load i32, ptr %2, align 4, !tbaa !5
  %40 = add nsw i32 %39, 1
  store i32 %40, ptr %2, align 4, !tbaa !5
  br label %23, !llvm.loop !11

41:                                               ; preds = %28
  %42 = load i64, ptr @K, align 8, !tbaa !9
  %43 = icmp eq i64 %42, 0
  br i1 %43, label %44, label %72

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

45:                                               ; preds = %65, %44
  %46 = load i32, ptr %4, align 4, !tbaa !5
  %47 = sext i32 %46 to i64
  %48 = load i64, ptr @N, align 8, !tbaa !9
  %49 = icmp slt i64 %47, %48
  br i1 %49, label %51, label %50

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

51:                                               ; preds = %45
  %52 = load i32, ptr %4, align 4, !tbaa !5
  %53 = sext i32 %52 to i64
  %54 = getelementptr inbounds [100010 x i64], ptr @A, i64 0, i64 %53
  %55 = load i64, ptr %54, align 8, !tbaa !9
  %56 = icmp eq i64 %55, 0
  br i1 %56, label %57, label %64

57:                                               ; preds = %51
  %58 = load i32, ptr %4, align 4, !tbaa !5
  %59 = sext i32 %58 to i64
  %60 = getelementptr inbounds [100010 x i64], ptr @B, i64 0, i64 %59
  %61 = load i64, ptr %60, align 8, !tbaa !9
  %62 = load i64, ptr %3, align 8, !tbaa !9
  %63 = add nsw i64 %62, %61
  store i64 %63, ptr %3, align 8, !tbaa !9
  br label %64

64:                                               ; preds = %57, %51
  br label %65

65:                                               ; preds = %64
  %66 = load i32, ptr %4, align 4, !tbaa !5
  %67 = add nsw i32 %66, 1
  store i32 %67, ptr %4, align 4, !tbaa !5
  br label %45, !llvm.loop !13

68:                                               ; preds = %50
  %69 = load i64, ptr %3, align 8, !tbaa !9
  %70 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %69)
  %71 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %70, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #5
  br label %273

72:                                               ; preds = %41
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #5
  store i64 0, ptr %5, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #5
  store i64 0, ptr %6, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  store i32 0, ptr %7, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  store i32 0, ptr %8, align 4, !tbaa !5
  br label %73

73:                                               ; preds = %90, %72
  %74 = load i32, ptr %8, align 4, !tbaa !5
  %75 = icmp slt i32 %74, 40
  br i1 %75, label %77, label %76

76:                                               ; preds = %73
  store i32 8, ptr %9, align 4
  br label %93

77:                                               ; preds = %73
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #5
  %78 = load i64, ptr @K, align 8, !tbaa !9
  %79 = load i32, ptr %8, align 4, !tbaa !5
  %80 = zext i32 %79 to i64
  %81 = ashr i64 %78, %80
  store i64 %81, ptr %10, align 8, !tbaa !9
  %82 = load i64, ptr %10, align 8, !tbaa !9
  %83 = icmp eq i64 %82, 1
  br i1 %83, label %84, label %86

84:                                               ; preds = %77
  %85 = load i32, ptr %8, align 4, !tbaa !5
  store i32 %85, ptr %7, align 4, !tbaa !5
  store i32 8, ptr %9, align 4
  br label %87

86:                                               ; preds = %77
  store i32 0, ptr %9, align 4
  br label %87

87:                                               ; preds = %86, %84
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  %88 = load i32, ptr %9, align 4
  switch i32 %88, label %93 [
    i32 0, label %89
  ]

89:                                               ; preds = %87
  br label %90

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

93:                                               ; preds = %87, %76
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  br label %94

94:                                               ; preds = %93
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  %95 = load i32, ptr %7, align 4, !tbaa !5
  %96 = zext i32 %95 to i64
  %97 = shl i64 1, %96
  %98 = sub nsw i64 %97, 1
  store i64 %98, ptr %11, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  store i32 0, ptr %12, align 4, !tbaa !5
  br label %99

99:                                               ; preds = %120, %94
  %100 = load i32, ptr %12, align 4, !tbaa !5
  %101 = sext i32 %100 to i64
  %102 = load i64, ptr @N, align 8, !tbaa !9
  %103 = icmp slt i64 %101, %102
  br i1 %103, label %105, label %104

104:                                              ; preds = %99
  store i32 11, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  br label %123

105:                                              ; preds = %99
  %106 = load i32, ptr %12, align 4, !tbaa !5
  %107 = sext i32 %106 to i64
  %108 = getelementptr inbounds [100010 x i64], ptr @A, i64 0, i64 %107
  %109 = load i64, ptr %108, align 8, !tbaa !9
  %110 = load i64, ptr %11, align 8, !tbaa !9
  %111 = icmp sle i64 %109, %110
  br i1 %111, label %112, label %119

112:                                              ; preds = %105
  %113 = load i32, ptr %12, align 4, !tbaa !5
  %114 = sext i32 %113 to i64
  %115 = getelementptr inbounds [100010 x i64], ptr @B, i64 0, i64 %114
  %116 = load i64, ptr %115, align 8, !tbaa !9
  %117 = load i64, ptr %6, align 8, !tbaa !9
  %118 = add nsw i64 %117, %116
  store i64 %118, ptr %6, align 8, !tbaa !9
  br label %119

119:                                              ; preds = %112, %105
  br label %120

120:                                              ; preds = %119
  %121 = load i32, ptr %12, align 4, !tbaa !5
  %122 = add nsw i32 %121, 1
  store i32 %122, ptr %12, align 4, !tbaa !5
  br label %99, !llvm.loop !15

123:                                              ; preds = %104
  %124 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(8) %6)
  %125 = load i64, ptr %124, align 8, !tbaa !9
  store i64 %125, ptr %5, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  store i32 0, ptr %13, align 4, !tbaa !5
  br label %126

126:                                              ; preds = %210, %123
  %127 = load i32, ptr %13, align 4, !tbaa !5
  %128 = icmp slt i32 %127, 40
  br i1 %128, label %130, label %129

129:                                              ; preds = %126
  store i32 14, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  br label %213

130:                                              ; preds = %126
  store i64 0, ptr %11, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #5
  %131 = load i32, ptr %13, align 4, !tbaa !5
  store i32 %131, ptr %14, align 4, !tbaa !5
  br label %132

132:                                              ; preds = %142, %130
  %133 = load i32, ptr %14, align 4, !tbaa !5
  %134 = icmp slt i32 %133, 40
  br i1 %134, label %136, label %135

135:                                              ; preds = %132
  store i32 17, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  br label %145

136:                                              ; preds = %132
  %137 = load i32, ptr %14, align 4, !tbaa !5
  %138 = zext i32 %137 to i64
  %139 = shl i64 1, %138
  %140 = load i64, ptr %11, align 8, !tbaa !9
  %141 = add nsw i64 %140, %139
  store i64 %141, ptr %11, align 8, !tbaa !9
  br label %142

142:                                              ; preds = %136
  %143 = load i32, ptr %14, align 4, !tbaa !5
  %144 = add nsw i32 %143, 1
  store i32 %144, ptr %14, align 4, !tbaa !5
  br label %132, !llvm.loop !16

145:                                              ; preds = %135
  %146 = load i64, ptr @K, align 8, !tbaa !9
  %147 = load i64, ptr %11, align 8, !tbaa !9
  %148 = and i64 %146, %147
  store i64 %148, ptr %11, align 8, !tbaa !9
  %149 = load i64, ptr %11, align 8, !tbaa !9
  %150 = icmp eq i64 %149, 0
  br i1 %150, label %151, label %152

151:                                              ; preds = %145
  br label %210

152:                                              ; preds = %145
  %153 = load i64, ptr %11, align 8, !tbaa !9
  %154 = sub nsw i64 %153, 1
  store i64 %154, ptr %11, align 8, !tbaa !9
  %155 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cerr, ptr noundef @.str)
  %156 = load i64, ptr %11, align 8, !tbaa !9
  %157 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) %155, i64 noundef %156)
  %158 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %157, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  store i64 0, ptr %6, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #5
  store i32 0, ptr %15, align 4, !tbaa !5
  br label %159

159:                                              ; preds = %204, %152
  %160 = load i32, ptr %15, align 4, !tbaa !5
  %161 = sext i32 %160 to i64
  %162 = load i64, ptr @N, align 8, !tbaa !9
  %163 = icmp slt i64 %161, %162
  br i1 %163, label %165, label %164

164:                                              ; preds = %159
  store i32 20, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #5
  br label %207

165:                                              ; preds = %159
  call void @llvm.lifetime.start.p0(i64 1, ptr %16) #5
  store i8 1, ptr %16, align 1, !tbaa !17
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #5
  store i32 0, ptr %17, align 4, !tbaa !5
  br label %166

166:                                              ; preds = %189, %165
  %167 = load i32, ptr %17, align 4, !tbaa !5
  %168 = icmp slt i32 %167, 40
  br i1 %168, label %170, label %169

169:                                              ; preds = %166
  store i32 23, ptr %9, align 4
  br label %192

170:                                              ; preds = %166
  %171 = load i64, ptr %11, align 8, !tbaa !9
  %172 = load i32, ptr %17, align 4, !tbaa !5
  %173 = zext i32 %172 to i64
  %174 = ashr i64 %171, %173
  %175 = and i64 %174, 1
  %176 = icmp eq i64 %175, 0
  br i1 %176, label %177, label %188

177:                                              ; preds = %170
  %178 = load i32, ptr %15, align 4, !tbaa !5
  %179 = sext i32 %178 to i64
  %180 = getelementptr inbounds [100010 x i64], ptr @A, i64 0, i64 %179
  %181 = load i64, ptr %180, align 8, !tbaa !9
  %182 = load i32, ptr %17, align 4, !tbaa !5
  %183 = zext i32 %182 to i64
  %184 = ashr i64 %181, %183
  %185 = and i64 %184, 1
  %186 = icmp eq i64 %185, 1
  br i1 %186, label %187, label %188

187:                                              ; preds = %177
  store i8 0, ptr %16, align 1, !tbaa !17
  store i32 23, ptr %9, align 4
  br label %192

188:                                              ; preds = %177, %170
  br label %189

189:                                              ; preds = %188
  %190 = load i32, ptr %17, align 4, !tbaa !5
  %191 = add nsw i32 %190, 1
  store i32 %191, ptr %17, align 4, !tbaa !5
  br label %166, !llvm.loop !19

192:                                              ; preds = %187, %169
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #5
  br label %193

193:                                              ; preds = %192
  %194 = load i8, ptr %16, align 1, !tbaa !17, !range !20, !noundef !21
  %195 = trunc i8 %194 to i1
  br i1 %195, label %196, label %203

196:                                              ; preds = %193
  %197 = load i32, ptr %15, align 4, !tbaa !5
  %198 = sext i32 %197 to i64
  %199 = getelementptr inbounds [100010 x i64], ptr @B, i64 0, i64 %198
  %200 = load i64, ptr %199, align 8, !tbaa !9
  %201 = load i64, ptr %6, align 8, !tbaa !9
  %202 = add nsw i64 %201, %200
  store i64 %202, ptr %6, align 8, !tbaa !9
  br label %203

203:                                              ; preds = %196, %193
  call void @llvm.lifetime.end.p0(i64 1, ptr %16) #5
  br label %204

204:                                              ; preds = %203
  %205 = load i32, ptr %15, align 4, !tbaa !5
  %206 = add nsw i32 %205, 1
  store i32 %206, ptr %15, align 4, !tbaa !5
  br label %159, !llvm.loop !22

207:                                              ; preds = %164
  %208 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(8) %6)
  %209 = load i64, ptr %208, align 8, !tbaa !9
  store i64 %209, ptr %5, align 8, !tbaa !9
  br label %210

210:                                              ; preds = %207, %151
  %211 = load i32, ptr %13, align 4, !tbaa !5
  %212 = add nsw i32 %211, 1
  store i32 %212, ptr %13, align 4, !tbaa !5
  br label %126, !llvm.loop !23

213:                                              ; preds = %129
  %214 = load i64, ptr @K, align 8, !tbaa !9
  store i64 %214, ptr %11, align 8, !tbaa !9
  %215 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cerr, ptr noundef @.str)
  %216 = load i64, ptr %11, align 8, !tbaa !9
  %217 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) %215, i64 noundef %216)
  %218 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %217, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  store i64 0, ptr %6, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #5
  store i32 0, ptr %18, align 4, !tbaa !5
  br label %219

219:                                              ; preds = %264, %213
  %220 = load i32, ptr %18, align 4, !tbaa !5
  %221 = sext i32 %220 to i64
  %222 = load i64, ptr @N, align 8, !tbaa !9
  %223 = icmp slt i64 %221, %222
  br i1 %223, label %225, label %224

224:                                              ; preds = %219
  store i32 26, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #5
  br label %267

225:                                              ; preds = %219
  call void @llvm.lifetime.start.p0(i64 1, ptr %19) #5
  store i8 1, ptr %19, align 1, !tbaa !17
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #5
  store i32 0, ptr %20, align 4, !tbaa !5
  br label %226

226:                                              ; preds = %249, %225
  %227 = load i32, ptr %20, align 4, !tbaa !5
  %228 = icmp slt i32 %227, 40
  br i1 %228, label %230, label %229

229:                                              ; preds = %226
  store i32 29, ptr %9, align 4
  br label %252

230:                                              ; preds = %226
  %231 = load i64, ptr %11, align 8, !tbaa !9
  %232 = load i32, ptr %20, align 4, !tbaa !5
  %233 = zext i32 %232 to i64
  %234 = ashr i64 %231, %233
  %235 = and i64 %234, 1
  %236 = icmp eq i64 %235, 0
  br i1 %236, label %237, label %248

237:                                              ; preds = %230
  %238 = load i32, ptr %18, align 4, !tbaa !5
  %239 = sext i32 %238 to i64
  %240 = getelementptr inbounds [100010 x i64], ptr @A, i64 0, i64 %239
  %241 = load i64, ptr %240, align 8, !tbaa !9
  %242 = load i32, ptr %20, align 4, !tbaa !5
  %243 = zext i32 %242 to i64
  %244 = ashr i64 %241, %243
  %245 = and i64 %244, 1
  %246 = icmp eq i64 %245, 1
  br i1 %246, label %247, label %248

247:                                              ; preds = %237
  store i8 0, ptr %19, align 1, !tbaa !17
  store i32 29, ptr %9, align 4
  br label %252

248:                                              ; preds = %237, %230
  br label %249

249:                                              ; preds = %248
  %250 = load i32, ptr %20, align 4, !tbaa !5
  %251 = add nsw i32 %250, 1
  store i32 %251, ptr %20, align 4, !tbaa !5
  br label %226, !llvm.loop !24

252:                                              ; preds = %247, %229
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #5
  br label %253

253:                                              ; preds = %252
  %254 = load i8, ptr %19, align 1, !tbaa !17, !range !20, !noundef !21
  %255 = trunc i8 %254 to i1
  br i1 %255, label %256, label %263

256:                                              ; preds = %253
  %257 = load i32, ptr %18, align 4, !tbaa !5
  %258 = sext i32 %257 to i64
  %259 = getelementptr inbounds [100010 x i64], ptr @B, i64 0, i64 %258
  %260 = load i64, ptr %259, align 8, !tbaa !9
  %261 = load i64, ptr %6, align 8, !tbaa !9
  %262 = add nsw i64 %261, %260
  store i64 %262, ptr %6, align 8, !tbaa !9
  br label %263

263:                                              ; preds = %256, %253
  call void @llvm.lifetime.end.p0(i64 1, ptr %19) #5
  br label %264

264:                                              ; preds = %263
  %265 = load i32, ptr %18, align 4, !tbaa !5
  %266 = add nsw i32 %265, 1
  store i32 %266, ptr %18, align 4, !tbaa !5
  br label %219, !llvm.loop !25

267:                                              ; preds = %224
  %268 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(8) %6)
  %269 = load i64, ptr %268, align 8, !tbaa !9
  store i64 %269, ptr %5, align 8, !tbaa !9
  %270 = load i64, ptr %5, align 8, !tbaa !9
  %271 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %270)
  %272 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %271, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #5
  br label %273

273:                                              ; preds = %267, %68
  %274 = load i32, ptr %1, align 4
  ret i32 %274
}

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

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

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #3

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #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) #3

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long long", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !12}
!15 = distinct !{!15, !12}
!16 = distinct !{!16, !12}
!17 = !{!18, !18, i64 0}
!18 = !{!"bool", !7, i64 0}
!19 = distinct !{!19, !12}
!20 = !{i8 0, i8 2}
!21 = !{}
!22 = distinct !{!22, !12}
!23 = distinct !{!23, !12}
!24 = distinct !{!24, !12}
!25 = distinct !{!25, !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" }

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca i64, align 8
  %2 = alloca i64, align 8
  %3 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) @N)
  %4 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %3, ptr noundef nonnull align 8 dereferenceable(8) @K)
  %5 = load i64, ptr @N, align 8, !tbaa !5
  %6 = icmp sgt i64 %5, 0
  br i1 %6, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %0
  %.lcssa = phi i64 [ %5, %0 ], [ %15, %.lr.ph ]
  %7 = load i64, ptr @K, align 8, !tbaa !5
  %8 = icmp eq i64 %7, 0
  br i1 %8, label %.preheader, label %41

.preheader:                                       ; preds = %._crit_edge
  %9 = icmp sgt i64 %.lcssa, 0
  br i1 %9, label %.lr.ph108.preheader, label %._crit_edge109

.lr.ph108.preheader:                              ; preds = %.preheader
  %xtraiter202 = and i64 %.lcssa, 1
  %10 = icmp eq i64 %.lcssa, 1
  br i1 %10, label %._crit_edge109.loopexit.unr-lcssa, label %.lr.ph108.preheader.new

.lr.ph108.preheader.new:                          ; preds = %.lr.ph108.preheader
  %unroll_iter205 = and i64 %.lcssa, 9223372036854775806
  br label %.lr.ph108

.lr.ph:                                           ; preds = %0, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %0 ]
  %11 = getelementptr inbounds [100010 x i64], ptr @A, i64 0, i64 %indvars.iv
  %12 = 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) %11)
  %13 = getelementptr inbounds [100010 x i64], ptr @B, i64 0, i64 %indvars.iv
  %14 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %12, ptr noundef nonnull align 8 dereferenceable(8) %13)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %15 = load i64, ptr @N, align 8, !tbaa !5
  %16 = icmp sgt i64 %15, %indvars.iv.next
  br i1 %16, label %.lr.ph, label %._crit_edge, !llvm.loop !9

._crit_edge109.loopexit.unr-lcssa:                ; preds = %40, %.lr.ph108.preheader
  %.170.lcssa.ph = phi i64 [ poison, %.lr.ph108.preheader ], [ %.170.1, %40 ]
  %indvars.iv145.unr = phi i64 [ 0, %.lr.ph108.preheader ], [ %indvars.iv.next146.1, %40 ]
  %.069106.unr = phi i64 [ 0, %.lr.ph108.preheader ], [ %.170.1, %40 ]
  %lcmp.mod203.not = icmp eq i64 %xtraiter202, 0
  br i1 %lcmp.mod203.not, label %._crit_edge109, label %.lr.ph108.epil

.lr.ph108.epil:                                   ; preds = %._crit_edge109.loopexit.unr-lcssa
  %17 = getelementptr inbounds [100010 x i64], ptr @A, i64 0, i64 %indvars.iv145.unr
  %18 = load i64, ptr %17, align 8, !tbaa !5
  %19 = icmp eq i64 %18, 0
  br i1 %19, label %20, label %._crit_edge109

20:                                               ; preds = %.lr.ph108.epil
  %21 = getelementptr inbounds [100010 x i64], ptr @B, i64 0, i64 %indvars.iv145.unr
  %22 = load i64, ptr %21, align 8, !tbaa !5
  %23 = add nsw i64 %22, %.069106.unr
  br label %._crit_edge109

._crit_edge109:                                   ; preds = %._crit_edge109.loopexit.unr-lcssa, %20, %.lr.ph108.epil, %.preheader
  %.069.lcssa = phi i64 [ 0, %.preheader ], [ %.170.lcssa.ph, %._crit_edge109.loopexit.unr-lcssa ], [ %23, %20 ], [ %.069106.unr, %.lr.ph108.epil ]
  %24 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %.069.lcssa)
  %25 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %24, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %184

.lr.ph108:                                        ; preds = %40, %.lr.ph108.preheader.new
  %indvars.iv145 = phi i64 [ 0, %.lr.ph108.preheader.new ], [ %indvars.iv.next146.1, %40 ]
  %.069106 = phi i64 [ 0, %.lr.ph108.preheader.new ], [ %.170.1, %40 ]
  %niter206 = phi i64 [ 0, %.lr.ph108.preheader.new ], [ %niter206.next.1, %40 ]
  %26 = getelementptr inbounds [100010 x i64], ptr @A, i64 0, i64 %indvars.iv145
  %27 = load i64, ptr %26, align 16, !tbaa !5
  %28 = icmp eq i64 %27, 0
  br i1 %28, label %29, label %.lr.ph108.1

29:                                               ; preds = %.lr.ph108
  %30 = getelementptr inbounds [100010 x i64], ptr @B, i64 0, i64 %indvars.iv145
  %31 = load i64, ptr %30, align 16, !tbaa !5
  %32 = add nsw i64 %31, %.069106
  br label %.lr.ph108.1

.lr.ph108.1:                                      ; preds = %.lr.ph108, %29
  %.170 = phi i64 [ %32, %29 ], [ %.069106, %.lr.ph108 ]
  %indvars.iv.next146 = or disjoint i64 %indvars.iv145, 1
  %33 = getelementptr inbounds [100010 x i64], ptr @A, i64 0, i64 %indvars.iv.next146
  %34 = load i64, ptr %33, align 8, !tbaa !5
  %35 = icmp eq i64 %34, 0
  br i1 %35, label %36, label %40

36:                                               ; preds = %.lr.ph108.1
  %37 = getelementptr inbounds [100010 x i64], ptr @B, i64 0, i64 %indvars.iv.next146
  %38 = load i64, ptr %37, align 8, !tbaa !5
  %39 = add nsw i64 %38, %.170
  br label %40

40:                                               ; preds = %36, %.lr.ph108.1
  %.170.1 = phi i64 [ %39, %36 ], [ %.170, %.lr.ph108.1 ]
  %indvars.iv.next146.1 = add nuw nsw i64 %indvars.iv145, 2
  %niter206.next.1 = add i64 %niter206, 2
  %niter206.ncmp.1 = icmp eq i64 %niter206.next.1, %unroll_iter205
  br i1 %niter206.ncmp.1, label %._crit_edge109.loopexit.unr-lcssa, label %.lr.ph108, !llvm.loop !11

41:                                               ; preds = %._crit_edge
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #6
  store i64 0, ptr %1, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #6
  %.not = icmp eq i64 %7, 1
  br i1 %.not, label %81, label %42

42:                                               ; preds = %41
  %.mask = and i64 %7, -2
  %.not.1 = icmp eq i64 %.mask, 2
  br i1 %.not.1, label %81, label %43

43:                                               ; preds = %42
  %.mask149 = and i64 %7, -4
  %.not.2 = icmp eq i64 %.mask149, 4
  br i1 %.not.2, label %81, label %44

44:                                               ; preds = %43
  %.mask150 = and i64 %7, -8
  %.not.3 = icmp eq i64 %.mask150, 8
  br i1 %.not.3, label %81, label %45

45:                                               ; preds = %44
  %.mask151 = and i64 %7, -16
  %.not.4 = icmp eq i64 %.mask151, 16
  br i1 %.not.4, label %81, label %46

46:                                               ; preds = %45
  %.mask152 = and i64 %7, -32
  %.not.5 = icmp eq i64 %.mask152, 32
  br i1 %.not.5, label %81, label %47

47:                                               ; preds = %46
  %.mask153 = and i64 %7, -64
  %.not.6 = icmp eq i64 %.mask153, 64
  br i1 %.not.6, label %81, label %48

48:                                               ; preds = %47
  %.mask154 = and i64 %7, -128
  %.not.7 = icmp eq i64 %.mask154, 128
  br i1 %.not.7, label %81, label %49

49:                                               ; preds = %48
  %.mask155 = and i64 %7, -256
  %.not.8 = icmp eq i64 %.mask155, 256
  br i1 %.not.8, label %81, label %50

50:                                               ; preds = %49
  %.mask156 = and i64 %7, -512
  %.not.9 = icmp eq i64 %.mask156, 512
  br i1 %.not.9, label %81, label %51

51:                                               ; preds = %50
  %.mask157 = and i64 %7, -1024
  %.not.10 = icmp eq i64 %.mask157, 1024
  br i1 %.not.10, label %81, label %52

52:                                               ; preds = %51
  %.mask158 = and i64 %7, -2048
  %.not.11 = icmp eq i64 %.mask158, 2048
  br i1 %.not.11, label %81, label %53

53:                                               ; preds = %52
  %.mask159 = and i64 %7, -4096
  %.not.12 = icmp eq i64 %.mask159, 4096
  br i1 %.not.12, label %81, label %54

54:                                               ; preds = %53
  %.mask160 = and i64 %7, -8192
  %.not.13 = icmp eq i64 %.mask160, 8192
  br i1 %.not.13, label %81, label %55

55:                                               ; preds = %54
  %.mask161 = and i64 %7, -16384
  %.not.14 = icmp eq i64 %.mask161, 16384
  br i1 %.not.14, label %81, label %56

56:                                               ; preds = %55
  %.mask162 = and i64 %7, -32768
  %.not.15 = icmp eq i64 %.mask162, 32768
  br i1 %.not.15, label %81, label %57

57:                                               ; preds = %56
  %.mask163 = and i64 %7, -65536
  %.not.16 = icmp eq i64 %.mask163, 65536
  br i1 %.not.16, label %81, label %58

58:                                               ; preds = %57
  %.mask164 = and i64 %7, -131072
  %.not.17 = icmp eq i64 %.mask164, 131072
  br i1 %.not.17, label %81, label %59

59:                                               ; preds = %58
  %.mask165 = and i64 %7, -262144
  %.not.18 = icmp eq i64 %.mask165, 262144
  br i1 %.not.18, label %81, label %60

60:                                               ; preds = %59
  %.mask166 = and i64 %7, -524288
  %.not.19 = icmp eq i64 %.mask166, 524288
  br i1 %.not.19, label %81, label %61

61:                                               ; preds = %60
  %.mask167 = and i64 %7, -1048576
  %.not.20 = icmp eq i64 %.mask167, 1048576
  br i1 %.not.20, label %81, label %62

62:                                               ; preds = %61
  %.mask168 = and i64 %7, -2097152
  %.not.21 = icmp eq i64 %.mask168, 2097152
  br i1 %.not.21, label %81, label %63

63:                                               ; preds = %62
  %.mask169 = and i64 %7, -4194304
  %.not.22 = icmp eq i64 %.mask169, 4194304
  br i1 %.not.22, label %81, label %64

64:                                               ; preds = %63
  %.mask170 = and i64 %7, -8388608
  %.not.23 = icmp eq i64 %.mask170, 8388608
  br i1 %.not.23, label %81, label %65

65:                                               ; preds = %64
  %.mask171 = and i64 %7, -16777216
  %.not.24 = icmp eq i64 %.mask171, 16777216
  br i1 %.not.24, label %81, label %66

66:                                               ; preds = %65
  %.mask172 = and i64 %7, -33554432
  %.not.25 = icmp eq i64 %.mask172, 33554432
  br i1 %.not.25, label %81, label %67

67:                                               ; preds = %66
  %.mask173 = and i64 %7, -67108864
  %.not.26 = icmp eq i64 %.mask173, 67108864
  br i1 %.not.26, label %81, label %68

68:                                               ; preds = %67
  %.mask174 = and i64 %7, -134217728
  %.not.27 = icmp eq i64 %.mask174, 134217728
  br i1 %.not.27, label %81, label %69

69:                                               ; preds = %68
  %.mask175 = and i64 %7, -268435456
  %.not.28 = icmp eq i64 %.mask175, 268435456
  br i1 %.not.28, label %81, label %70

70:                                               ; preds = %69
  %.mask176 = and i64 %7, -536870912
  %.not.29 = icmp eq i64 %.mask176, 536870912
  br i1 %.not.29, label %81, label %71

71:                                               ; preds = %70
  %.mask177 = and i64 %7, -1073741824
  %.not.30 = icmp eq i64 %.mask177, 1073741824
  br i1 %.not.30, label %81, label %72

72:                                               ; preds = %71
  %.mask178 = and i64 %7, -2147483648
  %.not.31 = icmp eq i64 %.mask178, 2147483648
  br i1 %.not.31, label %81, label %73

73:                                               ; preds = %72
  %.mask179 = and i64 %7, -4294967296
  %.not.32 = icmp eq i64 %.mask179, 4294967296
  br i1 %.not.32, label %81, label %74

74:                                               ; preds = %73
  %.mask180 = and i64 %7, -8589934592
  %.not.33 = icmp eq i64 %.mask180, 8589934592
  br i1 %.not.33, label %81, label %75

75:                                               ; preds = %74
  %.mask181 = and i64 %7, -17179869184
  %.not.34 = icmp eq i64 %.mask181, 17179869184
  br i1 %.not.34, label %81, label %76

76:                                               ; preds = %75
  %.mask182 = and i64 %7, -34359738368
  %.not.35 = icmp eq i64 %.mask182, 34359738368
  br i1 %.not.35, label %81, label %77

77:                                               ; preds = %76
  %.mask183 = and i64 %7, -68719476736
  %.not.36 = icmp eq i64 %.mask183, 68719476736
  br i1 %.not.36, label %81, label %78

78:                                               ; preds = %77
  %.mask184 = and i64 %7, -137438953472
  %.not.37 = icmp eq i64 %.mask184, 137438953472
  br i1 %.not.37, label %81, label %79

79:                                               ; preds = %78
  %.mask185 = and i64 %7, -274877906944
  %.not.38 = icmp eq i64 %.mask185, 274877906944
  br i1 %.not.38, label %81, label %80

80:                                               ; preds = %79
  %.mask186 = and i64 %7, -549755813888
  %.not.39 = icmp eq i64 %.mask186, 549755813888
  %spec.select = select i1 %.not.39, i64 39, i64 0
  br label %81

81:                                               ; preds = %80, %79, %78, %77, %76, %75, %74, %73, %72, %71, %70, %69, %68, %67, %66, %65, %64, %63, %62, %61, %60, %59, %58, %57, %56, %55, %54, %53, %52, %51, %50, %49, %48, %47, %46, %45, %44, %43, %42, %41
  %.2 = phi i64 [ 0, %41 ], [ 1, %42 ], [ 2, %43 ], [ 3, %44 ], [ 4, %45 ], [ 5, %46 ], [ 6, %47 ], [ 7, %48 ], [ 8, %49 ], [ 9, %50 ], [ 10, %51 ], [ 11, %52 ], [ 12, %53 ], [ 13, %54 ], [ 14, %55 ], [ 15, %56 ], [ 16, %57 ], [ 17, %58 ], [ 18, %59 ], [ 19, %60 ], [ 20, %61 ], [ 21, %62 ], [ 22, %63 ], [ 23, %64 ], [ 24, %65 ], [ 25, %66 ], [ 26, %67 ], [ 27, %68 ], [ 28, %69 ], [ 29, %70 ], [ 30, %71 ], [ 31, %72 ], [ 32, %73 ], [ 33, %74 ], [ 34, %75 ], [ 35, %76 ], [ 36, %77 ], [ 37, %78 ], [ 38, %79 ], [ %spec.select, %80 ]
  %notmask = shl nsw i64 -1, %.2
  %82 = xor i64 %notmask, -1
  %83 = icmp sgt i64 %.lcssa, 0
  br i1 %83, label %.lr.ph92.preheader, label %._crit_edge93

.lr.ph92.preheader:                               ; preds = %81
  %xtraiter = and i64 %.lcssa, 1
  %84 = icmp eq i64 %.lcssa, 1
  br i1 %84, label %._crit_edge93.loopexit.unr-lcssa, label %.lr.ph92.preheader.new

.lr.ph92.preheader.new:                           ; preds = %.lr.ph92.preheader
  %unroll_iter = and i64 %.lcssa, 9223372036854775806
  br label %.lr.ph92

._crit_edge93.loopexit.unr-lcssa:                 ; preds = %107, %.lr.ph92.preheader
  %.lcssa199.ph = phi i64 [ poison, %.lr.ph92.preheader ], [ %108, %107 ]
  %indvars.iv118.unr = phi i64 [ 0, %.lr.ph92.preheader ], [ %indvars.iv.next119.1, %107 ]
  %.unr = phi i64 [ 0, %.lr.ph92.preheader ], [ %108, %107 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge93, label %.lr.ph92.epil

.lr.ph92.epil:                                    ; preds = %._crit_edge93.loopexit.unr-lcssa
  %85 = getelementptr inbounds [100010 x i64], ptr @A, i64 0, i64 %indvars.iv118.unr
  %86 = load i64, ptr %85, align 8, !tbaa !5
  %.not80.epil = icmp sgt i64 %86, %82
  br i1 %.not80.epil, label %._crit_edge93, label %87

87:                                               ; preds = %.lr.ph92.epil
  %88 = getelementptr inbounds [100010 x i64], ptr @B, i64 0, i64 %indvars.iv118.unr
  %89 = load i64, ptr %88, align 8, !tbaa !5
  %90 = add nsw i64 %.unr, %89
  br label %._crit_edge93

._crit_edge93:                                    ; preds = %._crit_edge93.loopexit.unr-lcssa, %87, %.lr.ph92.epil, %81
  %.lcssa89 = phi i64 [ 0, %81 ], [ %.lcssa199.ph, %._crit_edge93.loopexit.unr-lcssa ], [ %.unr, %.lr.ph92.epil ], [ %90, %87 ]
  store i64 %.lcssa89, ptr %2, align 8, !tbaa !5
  %91 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef nonnull align 8 dereferenceable(8) %2)
  %92 = load i64, ptr %91, align 8, !tbaa !5
  store i64 %92, ptr %1, align 8, !tbaa !5
  br label %.preheader86

.lr.ph92:                                         ; preds = %107, %.lr.ph92.preheader.new
  %indvars.iv118 = phi i64 [ 0, %.lr.ph92.preheader.new ], [ %indvars.iv.next119.1, %107 ]
  %93 = phi i64 [ 0, %.lr.ph92.preheader.new ], [ %108, %107 ]
  %niter = phi i64 [ 0, %.lr.ph92.preheader.new ], [ %niter.next.1, %107 ]
  %94 = getelementptr inbounds [100010 x i64], ptr @A, i64 0, i64 %indvars.iv118
  %95 = load i64, ptr %94, align 16, !tbaa !5
  %.not80 = icmp sgt i64 %95, %82
  br i1 %.not80, label %.lr.ph92.1, label %96

96:                                               ; preds = %.lr.ph92
  %97 = getelementptr inbounds [100010 x i64], ptr @B, i64 0, i64 %indvars.iv118
  %98 = load i64, ptr %97, align 16, !tbaa !5
  %99 = add nsw i64 %93, %98
  br label %.lr.ph92.1

.lr.ph92.1:                                       ; preds = %.lr.ph92, %96
  %100 = phi i64 [ %93, %.lr.ph92 ], [ %99, %96 ]
  %indvars.iv.next119 = or disjoint i64 %indvars.iv118, 1
  %101 = getelementptr inbounds [100010 x i64], ptr @A, i64 0, i64 %indvars.iv.next119
  %102 = load i64, ptr %101, align 8, !tbaa !5
  %.not80.1 = icmp sgt i64 %102, %82
  br i1 %.not80.1, label %107, label %103

103:                                              ; preds = %.lr.ph92.1
  %104 = getelementptr inbounds [100010 x i64], ptr @B, i64 0, i64 %indvars.iv.next119
  %105 = load i64, ptr %104, align 8, !tbaa !5
  %106 = add nsw i64 %100, %105
  br label %107

107:                                              ; preds = %103, %.lr.ph92.1
  %108 = phi i64 [ %100, %.lr.ph92.1 ], [ %106, %103 ]
  %indvars.iv.next119.1 = add nuw nsw i64 %indvars.iv118, 2
  %niter.next.1 = add i64 %niter, 2
  %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
  br i1 %niter.ncmp.1, label %._crit_edge93.loopexit.unr-lcssa, label %.lr.ph92, !llvm.loop !12

.preheader86:                                     ; preds = %._crit_edge93, %158
  %indvars.iv121 = phi i64 [ 0, %._crit_edge93 ], [ %indvars.iv.next122, %158 ]
  %109 = sub nsw i64 40, %indvars.iv121
  %min.iters.check = icmp ult i64 %109, 4
  br i1 %min.iters.check, label %scalar.ph.preheader, label %vector.ph

scalar.ph.preheader:                              ; preds = %middle.block, %.preheader86
  %indvars.iv123.ph = phi i64 [ %indvars.iv121, %.preheader86 ], [ %ind.end, %middle.block ]
  %.06395.ph = phi i64 [ 0, %.preheader86 ], [ %115, %middle.block ]
  br label %scalar.ph

vector.ph:                                        ; preds = %.preheader86
  %n.vec = and i64 %109, -4
  %ind.end = add i64 %indvars.iv121, %n.vec
  %.splatinsert = insertelement <2 x i64> poison, i64 %indvars.iv121, i64 0
  %.splat = shufflevector <2 x i64> %.splatinsert, <2 x i64> poison, <2 x i32> zeroinitializer
  %induction = add nuw <2 x i64> %.splat, <i64 0, i64 1>
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %vec.ind = phi <2 x i64> [ %induction, %vector.ph ], [ %vec.ind.next, %vector.body ]
  %vec.phi = phi <2 x i64> [ zeroinitializer, %vector.ph ], [ %112, %vector.body ]
  %vec.phi194 = phi <2 x i64> [ zeroinitializer, %vector.ph ], [ %113, %vector.body ]
  %step.add = add <2 x i64> %vec.ind, <i64 2, i64 2>
  %110 = shl nuw nsw <2 x i64> <i64 1, i64 1>, %vec.ind
  %111 = shl nuw nsw <2 x i64> <i64 1, i64 1>, %step.add
  %112 = add <2 x i64> %110, %vec.phi
  %113 = add <2 x i64> %111, %vec.phi194
  %index.next = add nuw i64 %index, 4
  %vec.ind.next = add <2 x i64> %vec.ind, <i64 4, i64 4>
  %114 = icmp eq i64 %index.next, %n.vec
  br i1 %114, label %middle.block, label %vector.body, !llvm.loop !13

middle.block:                                     ; preds = %vector.body
  %bin.rdx = add <2 x i64> %113, %112
  %115 = call i64 @llvm.vector.reduce.add.v2i64(<2 x i64> %bin.rdx)
  %cmp.n = icmp eq i64 %109, %n.vec
  br i1 %cmp.n, label %.loopexit195, label %scalar.ph.preheader

116:                                              ; preds = %158
  %117 = load i64, ptr @K, align 8, !tbaa !5
  %118 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cerr, ptr noundef nonnull @.str)
  %119 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) %118, i64 noundef %117)
  %120 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %119, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  store i64 0, ptr %2, align 8, !tbaa !5
  %121 = load i64, ptr @N, align 8, !tbaa !5
  %122 = icmp sgt i64 %121, 0
  br i1 %122, label %.preheader83, label %._crit_edge105

.loopexit195:                                     ; preds = %scalar.ph, %middle.block
  %.lcssa190 = phi i64 [ %115, %middle.block ], [ %127, %scalar.ph ]
  %123 = load i64, ptr @K, align 8, !tbaa !5
  %124 = and i64 %123, %.lcssa190
  %125 = icmp eq i64 %124, 0
  br i1 %125, label %158, label %128

scalar.ph:                                        ; preds = %scalar.ph.preheader, %scalar.ph
  %indvars.iv123 = phi i64 [ %indvars.iv.next124, %scalar.ph ], [ %indvars.iv123.ph, %scalar.ph.preheader ]
  %.06395 = phi i64 [ %127, %scalar.ph ], [ %.06395.ph, %scalar.ph.preheader ]
  %126 = shl nuw nsw i64 1, %indvars.iv123
  %127 = add nuw nsw i64 %126, %.06395
  %indvars.iv.next124 = add nuw nsw i64 %indvars.iv123, 1
  %exitcond126.not = icmp eq i64 %indvars.iv.next124, 40
  br i1 %exitcond126.not, label %.loopexit195, label %scalar.ph, !llvm.loop !16

128:                                              ; preds = %.loopexit195
  %129 = add nsw i64 %124, -1
  %130 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cerr, ptr noundef nonnull @.str)
  %131 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) %130, i64 noundef %129)
  %132 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %131, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  store i64 0, ptr %2, align 8, !tbaa !5
  %133 = load i64, ptr @N, align 8, !tbaa !5
  %134 = icmp sgt i64 %133, 0
  br i1 %134, label %.preheader84, label %._crit_edge100

.preheader84:                                     ; preds = %128, %.loopexit85
  %indvars.iv131 = phi i64 [ %indvars.iv.next132, %.loopexit85 ], [ 0, %128 ]
  %135 = phi i64 [ %157, %.loopexit85 ], [ 0, %128 ]
  %136 = getelementptr inbounds [100010 x i64], ptr @A, i64 0, i64 %indvars.iv131
  br label %139

._crit_edge100:                                   ; preds = %.loopexit85, %128
  %137 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef nonnull align 8 dereferenceable(8) %2)
  %138 = load i64, ptr %137, align 8, !tbaa !5
  store i64 %138, ptr %1, align 8, !tbaa !5
  br label %158

139:                                              ; preds = %153, %.preheader84
  %indvars.iv127 = phi i64 [ 0, %.preheader84 ], [ %indvars.iv.next128.1, %153 ]
  %140 = shl nuw nsw i64 1, %indvars.iv127
  %141 = and i64 %140, %129
  %142 = icmp eq i64 %141, 0
  br i1 %142, label %143, label %146

143:                                              ; preds = %139
  %144 = load i64, ptr %136, align 8, !tbaa !5
  %145 = and i64 %144, %140
  %.not79 = icmp eq i64 %145, 0
  br i1 %.not79, label %146, label %.loopexit85

146:                                              ; preds = %139, %143
  %147 = shl nuw nsw i64 2, %indvars.iv127
  %148 = and i64 %147, %129
  %149 = icmp eq i64 %148, 0
  br i1 %149, label %150, label %153

150:                                              ; preds = %146
  %151 = load i64, ptr %136, align 8, !tbaa !5
  %152 = and i64 %151, %147
  %.not79.1 = icmp eq i64 %152, 0
  br i1 %.not79.1, label %153, label %.loopexit85

153:                                              ; preds = %150, %146
  %indvars.iv.next128.1 = add nuw nsw i64 %indvars.iv127, 2
  %exitcond130.1 = icmp eq i64 %indvars.iv.next128.1, 40
  br i1 %exitcond130.1, label %.critedge, label %139, !llvm.loop !17

.critedge:                                        ; preds = %153
  %154 = getelementptr inbounds [100010 x i64], ptr @B, i64 0, i64 %indvars.iv131
  %155 = load i64, ptr %154, align 8, !tbaa !5
  %156 = add nsw i64 %135, %155
  store i64 %156, ptr %2, align 8, !tbaa !5
  br label %.loopexit85

.loopexit85:                                      ; preds = %143, %150, %.critedge
  %157 = phi i64 [ %156, %.critedge ], [ %135, %150 ], [ %135, %143 ]
  %indvars.iv.next132 = add nuw nsw i64 %indvars.iv131, 1
  %exitcond134.not = icmp eq i64 %indvars.iv.next132, %133
  br i1 %exitcond134.not, label %._crit_edge100, label %.preheader84, !llvm.loop !18

158:                                              ; preds = %.loopexit195, %._crit_edge100
  %indvars.iv.next122 = add nuw nsw i64 %indvars.iv121, 1
  %exitcond136.not = icmp eq i64 %indvars.iv.next122, 40
  br i1 %exitcond136.not, label %116, label %.preheader86, !llvm.loop !19

.preheader83:                                     ; preds = %116, %.loopexit
  %indvars.iv141 = phi i64 [ %indvars.iv.next142, %.loopexit ], [ 0, %116 ]
  %159 = phi i64 [ %183, %.loopexit ], [ 0, %116 ]
  %160 = getelementptr inbounds [100010 x i64], ptr @A, i64 0, i64 %indvars.iv141
  br label %165

._crit_edge105:                                   ; preds = %.loopexit, %116
  %161 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef nonnull align 8 dereferenceable(8) %2)
  %162 = load i64, ptr %161, align 8, !tbaa !5
  store i64 %162, ptr %1, align 8, !tbaa !5
  %163 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %162)
  %164 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %163, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #6
  br label %184

165:                                              ; preds = %179, %.preheader83
  %indvars.iv137 = phi i64 [ 0, %.preheader83 ], [ %indvars.iv.next138.1, %179 ]
  %166 = shl nuw nsw i64 1, %indvars.iv137
  %167 = and i64 %166, %117
  %168 = icmp eq i64 %167, 0
  br i1 %168, label %169, label %172

169:                                              ; preds = %165
  %170 = load i64, ptr %160, align 8, !tbaa !5
  %171 = and i64 %170, %166
  %.not78 = icmp eq i64 %171, 0
  br i1 %.not78, label %172, label %.loopexit

172:                                              ; preds = %165, %169
  %173 = shl nuw nsw i64 2, %indvars.iv137
  %174 = and i64 %173, %117
  %175 = icmp eq i64 %174, 0
  br i1 %175, label %176, label %179

176:                                              ; preds = %172
  %177 = load i64, ptr %160, align 8, !tbaa !5
  %178 = and i64 %177, %173
  %.not78.1 = icmp eq i64 %178, 0
  br i1 %.not78.1, label %179, label %.loopexit

179:                                              ; preds = %176, %172
  %indvars.iv.next138.1 = add nuw nsw i64 %indvars.iv137, 2
  %exitcond140.1 = icmp eq i64 %indvars.iv.next138.1, 40
  br i1 %exitcond140.1, label %.critedge82, label %165, !llvm.loop !20

.critedge82:                                      ; preds = %179
  %180 = getelementptr inbounds [100010 x i64], ptr @B, i64 0, i64 %indvars.iv141
  %181 = load i64, ptr %180, align 8, !tbaa !5
  %182 = add nsw i64 %159, %181
  store i64 %182, ptr %2, align 8, !tbaa !5
  br label %.loopexit

.loopexit:                                        ; preds = %169, %176, %.critedge82
  %183 = phi i64 [ %182, %.critedge82 ], [ %159, %176 ], [ %159, %169 ]
  %indvars.iv.next142 = add nuw nsw i64 %indvars.iv141, 1
  %exitcond144.not = icmp eq i64 %indvars.iv.next142, %121
  br i1 %exitcond144.not, label %._crit_edge105, label %.preheader83, !llvm.loop !21

184:                                              ; preds = %._crit_edge105, %._crit_edge109
  ret i32 0
}

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

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

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #3

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.vector.reduce.add.v2i64(<2 x i64>) #5

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 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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10, !14, !15}
!14 = !{!"llvm.loop.isvectorized", i32 1}
!15 = !{!"llvm.loop.unroll.runtime.disable"}
!16 = distinct !{!16, !10, !15, !14}
!17 = distinct !{!17, !10}
!18 = distinct !{!18, !10}
!19 = distinct !{!19, !10}
!20 = distinct !{!20, !10}
!21 = distinct !{!21, !10}


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