; LLVM IR from kazunetakahashi/atcoder :: 2019/0203_ABC117 (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
@S = external dso_local global [60 x [2 x i64]], align 16
@DP = external dso_local global [61 x [2 x i64]], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cerr = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [4 x i8], align 1
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i64, align 8
  %9 = alloca i64, align 8
  %10 = alloca i64, align 8
  %11 = alloca i64, align 8
  %12 = alloca i64, align 8
  %13 = alloca i64, align 8
  %14 = alloca i64, align 8
  store i32 0, ptr %1, align 4
  %15 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) @N)
  %16 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %15, ptr noundef nonnull align 8 dereferenceable(8) @K)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #6
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %17

17:                                               ; preds = %28, %0
  %18 = load i32, ptr %2, align 4, !tbaa !5
  %19 = sext i32 %18 to i64
  %20 = load i64, ptr @N, align 8, !tbaa !9
  %21 = icmp slt i64 %19, %20
  br i1 %21, label %23, label %22

22:                                               ; preds = %17
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #6
  br label %31

23:                                               ; preds = %17
  %24 = load i32, ptr %2, align 4, !tbaa !5
  %25 = sext i32 %24 to i64
  %26 = getelementptr inbounds [100010 x i64], ptr @A, i64 0, i64 %25
  %27 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %26)
  br label %28

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

31:                                               ; preds = %22
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #6
  store i32 0, ptr %3, align 4, !tbaa !5
  call void @_ZSt4fillIPxiEvT_S1_RKT0_(ptr noundef @S, ptr noundef getelementptr inbounds (i64, ptr @S, i64 120), ptr noundef nonnull align 4 dereferenceable(4) %3)
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #6
  store i32 0, ptr %4, align 4, !tbaa !5
  br label %32

32:                                               ; preds = %104, %31
  %33 = load i32, ptr %4, align 4, !tbaa !5
  %34 = icmp slt i32 %33, 60
  br i1 %34, label %36, label %35

35:                                               ; preds = %32
  store i32 5, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  br label %107

36:                                               ; preds = %32
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  store i32 0, ptr %6, align 4, !tbaa !5
  br label %37

37:                                               ; preds = %74, %36
  %38 = load i32, ptr %6, align 4, !tbaa !5
  %39 = sext i32 %38 to i64
  %40 = load i64, ptr @N, align 8, !tbaa !9
  %41 = icmp slt i64 %39, %40
  br i1 %41, label %43, label %42

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

43:                                               ; preds = %37
  %44 = load i32, ptr %6, align 4, !tbaa !5
  %45 = sext i32 %44 to i64
  %46 = getelementptr inbounds [100010 x i64], ptr @A, i64 0, i64 %45
  %47 = load i64, ptr %46, align 8, !tbaa !9
  %48 = load i32, ptr %4, align 4, !tbaa !5
  %49 = zext i32 %48 to i64
  %50 = ashr i64 %47, %49
  %51 = and i64 %50, 1
  %52 = icmp ne i64 %51, 0
  br i1 %52, label %53, label %63

53:                                               ; preds = %43
  %54 = load i32, ptr %4, align 4, !tbaa !5
  %55 = zext i32 %54 to i64
  %56 = shl i64 1, %55
  %57 = load i32, ptr %4, align 4, !tbaa !5
  %58 = sext i32 %57 to i64
  %59 = getelementptr inbounds [60 x [2 x i64]], ptr @S, i64 0, i64 %58
  %60 = getelementptr inbounds [2 x i64], ptr %59, i64 0, i64 0
  %61 = load i64, ptr %60, align 16, !tbaa !9
  %62 = add nsw i64 %61, %56
  store i64 %62, ptr %60, align 16, !tbaa !9
  br label %73

63:                                               ; preds = %43
  %64 = load i32, ptr %4, align 4, !tbaa !5
  %65 = zext i32 %64 to i64
  %66 = shl i64 1, %65
  %67 = load i32, ptr %4, align 4, !tbaa !5
  %68 = sext i32 %67 to i64
  %69 = getelementptr inbounds [60 x [2 x i64]], ptr @S, i64 0, i64 %68
  %70 = getelementptr inbounds [2 x i64], ptr %69, i64 0, i64 1
  %71 = load i64, ptr %70, align 8, !tbaa !9
  %72 = add nsw i64 %71, %66
  store i64 %72, ptr %70, align 8, !tbaa !9
  br label %73

73:                                               ; preds = %63, %53
  br label %74

74:                                               ; preds = %73
  %75 = load i32, ptr %6, align 4, !tbaa !5
  %76 = add nsw i32 %75, 1
  store i32 %76, ptr %6, align 4, !tbaa !5
  br label %37, !llvm.loop !13

77:                                               ; preds = %42
  %78 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cerr, ptr noundef @.str)
  %79 = load i32, ptr %4, align 4, !tbaa !5
  %80 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %78, i32 noundef %79)
  %81 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %80, ptr noundef @.str.1)
  %82 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %81, i32 noundef 0)
  %83 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %82, ptr noundef @.str.2)
  %84 = load i32, ptr %4, align 4, !tbaa !5
  %85 = sext i32 %84 to i64
  %86 = getelementptr inbounds [60 x [2 x i64]], ptr @S, i64 0, i64 %85
  %87 = getelementptr inbounds [2 x i64], ptr %86, i64 0, i64 0
  %88 = load i64, ptr %87, align 16, !tbaa !9
  %89 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) %83, i64 noundef %88)
  %90 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %89, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  %91 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cerr, ptr noundef @.str)
  %92 = load i32, ptr %4, align 4, !tbaa !5
  %93 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %91, i32 noundef %92)
  %94 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %93, ptr noundef @.str.1)
  %95 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %94, i32 noundef 1)
  %96 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %95, ptr noundef @.str.2)
  %97 = load i32, ptr %4, align 4, !tbaa !5
  %98 = sext i32 %97 to i64
  %99 = getelementptr inbounds [60 x [2 x i64]], ptr @S, i64 0, i64 %98
  %100 = getelementptr inbounds [2 x i64], ptr %99, i64 0, i64 1
  %101 = load i64, ptr %100, align 8, !tbaa !9
  %102 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) %96, i64 noundef %101)
  %103 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %102, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %104

104:                                              ; preds = %77
  %105 = load i32, ptr %4, align 4, !tbaa !5
  %106 = add nsw i32 %105, 1
  store i32 %106, ptr %4, align 4, !tbaa !5
  br label %32, !llvm.loop !14

107:                                              ; preds = %35
  store i64 0, ptr getelementptr inbounds ([61 x [2 x i64]], ptr @DP, i64 0, i64 60), align 16, !tbaa !9
  store i64 -1, ptr getelementptr inbounds ([2 x i64], ptr getelementptr inbounds ([61 x [2 x i64]], ptr @DP, i64 0, i64 60), i64 0, i64 1), align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  store i32 59, ptr %7, align 4, !tbaa !5
  br label %108

108:                                              ; preds = %343, %107
  %109 = load i32, ptr %7, align 4, !tbaa !5
  %110 = icmp sge i32 %109, 0
  br i1 %110, label %112, label %111

111:                                              ; preds = %108
  store i32 11, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  br label %346

112:                                              ; preds = %108
  %113 = load i32, ptr %7, align 4, !tbaa !5
  %114 = sext i32 %113 to i64
  %115 = getelementptr inbounds [61 x [2 x i64]], ptr @DP, i64 0, i64 %114
  %116 = getelementptr inbounds [2 x i64], ptr %115, i64 0, i64 0
  store i64 0, ptr %116, align 16, !tbaa !9
  %117 = load i32, ptr %7, align 4, !tbaa !5
  %118 = sext i32 %117 to i64
  %119 = getelementptr inbounds [61 x [2 x i64]], ptr @DP, i64 0, i64 %118
  %120 = getelementptr inbounds [2 x i64], ptr %119, i64 0, i64 1
  store i64 -1, ptr %120, align 8, !tbaa !9
  %121 = load i64, ptr @K, align 8, !tbaa !9
  %122 = load i32, ptr %7, align 4, !tbaa !5
  %123 = zext i32 %122 to i64
  %124 = ashr i64 %121, %123
  %125 = and i64 %124, 1
  %126 = icmp ne i64 %125, 0
  br i1 %126, label %127, label %240

127:                                              ; preds = %112
  %128 = load i32, ptr %7, align 4, !tbaa !5
  %129 = sext i32 %128 to i64
  %130 = getelementptr inbounds [61 x [2 x i64]], ptr @DP, i64 0, i64 %129
  %131 = getelementptr inbounds [2 x i64], ptr %130, i64 0, i64 1
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #6
  %132 = load i32, ptr %7, align 4, !tbaa !5
  %133 = add nsw i32 %132, 1
  %134 = sext i32 %133 to i64
  %135 = getelementptr inbounds [61 x [2 x i64]], ptr @DP, i64 0, i64 %134
  %136 = getelementptr inbounds [2 x i64], ptr %135, i64 0, i64 0
  %137 = load i64, ptr %136, align 16, !tbaa !9
  %138 = load i32, ptr %7, align 4, !tbaa !5
  %139 = sext i32 %138 to i64
  %140 = getelementptr inbounds [60 x [2 x i64]], ptr @S, i64 0, i64 %139
  %141 = getelementptr inbounds [2 x i64], ptr %140, i64 0, i64 0
  %142 = load i64, ptr %141, align 16, !tbaa !9
  %143 = add nsw i64 %137, %142
  store i64 %143, ptr %8, align 8, !tbaa !9
  %144 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %131, ptr noundef nonnull align 8 dereferenceable(8) %8)
  %145 = load i64, ptr %144, align 8, !tbaa !9
  %146 = load i32, ptr %7, align 4, !tbaa !5
  %147 = sext i32 %146 to i64
  %148 = getelementptr inbounds [61 x [2 x i64]], ptr @DP, i64 0, i64 %147
  %149 = getelementptr inbounds [2 x i64], ptr %148, i64 0, i64 1
  store i64 %145, ptr %149, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  %150 = load i32, ptr %7, align 4, !tbaa !5
  %151 = sext i32 %150 to i64
  %152 = getelementptr inbounds [61 x [2 x i64]], ptr @DP, i64 0, i64 %151
  %153 = getelementptr inbounds [2 x i64], ptr %152, i64 0, i64 0
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #6
  %154 = load i32, ptr %7, align 4, !tbaa !5
  %155 = add nsw i32 %154, 1
  %156 = sext i32 %155 to i64
  %157 = getelementptr inbounds [61 x [2 x i64]], ptr @DP, i64 0, i64 %156
  %158 = getelementptr inbounds [2 x i64], ptr %157, i64 0, i64 0
  %159 = load i64, ptr %158, align 16, !tbaa !9
  %160 = load i32, ptr %7, align 4, !tbaa !5
  %161 = sext i32 %160 to i64
  %162 = getelementptr inbounds [60 x [2 x i64]], ptr @S, i64 0, i64 %161
  %163 = getelementptr inbounds [2 x i64], ptr %162, i64 0, i64 1
  %164 = load i64, ptr %163, align 8, !tbaa !9
  %165 = add nsw i64 %159, %164
  store i64 %165, ptr %9, align 8, !tbaa !9
  %166 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %153, ptr noundef nonnull align 8 dereferenceable(8) %9)
  %167 = load i64, ptr %166, align 8, !tbaa !9
  %168 = load i32, ptr %7, align 4, !tbaa !5
  %169 = sext i32 %168 to i64
  %170 = getelementptr inbounds [61 x [2 x i64]], ptr @DP, i64 0, i64 %169
  %171 = getelementptr inbounds [2 x i64], ptr %170, i64 0, i64 0
  store i64 %167, ptr %171, align 16, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  %172 = load i32, ptr %7, align 4, !tbaa !5
  %173 = add nsw i32 %172, 1
  %174 = sext i32 %173 to i64
  %175 = getelementptr inbounds [61 x [2 x i64]], ptr @DP, i64 0, i64 %174
  %176 = getelementptr inbounds [2 x i64], ptr %175, i64 0, i64 1
  %177 = load i64, ptr %176, align 8, !tbaa !9
  %178 = icmp slt i64 %177, 0
  br i1 %178, label %179, label %194

179:                                              ; preds = %127
  %180 = load i32, ptr %7, align 4, !tbaa !5
  %181 = sext i32 %180 to i64
  %182 = getelementptr inbounds [61 x [2 x i64]], ptr @DP, i64 0, i64 %181
  %183 = getelementptr inbounds [2 x i64], ptr %182, i64 0, i64 1
  %184 = load i32, ptr %7, align 4, !tbaa !5
  %185 = sext i32 %184 to i64
  %186 = getelementptr inbounds [60 x [2 x i64]], ptr @S, i64 0, i64 %185
  %187 = getelementptr inbounds [2 x i64], ptr %186, i64 0, i64 0
  %188 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %183, ptr noundef nonnull align 8 dereferenceable(8) %187)
  %189 = load i64, ptr %188, align 8, !tbaa !9
  %190 = load i32, ptr %7, align 4, !tbaa !5
  %191 = sext i32 %190 to i64
  %192 = getelementptr inbounds [61 x [2 x i64]], ptr @DP, i64 0, i64 %191
  %193 = getelementptr inbounds [2 x i64], ptr %192, i64 0, i64 1
  store i64 %189, ptr %193, align 8, !tbaa !9
  br label %239

194:                                              ; preds = %127
  %195 = load i32, ptr %7, align 4, !tbaa !5
  %196 = sext i32 %195 to i64
  %197 = getelementptr inbounds [61 x [2 x i64]], ptr @DP, i64 0, i64 %196
  %198 = getelementptr inbounds [2 x i64], ptr %197, i64 0, i64 1
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  %199 = load i32, ptr %7, align 4, !tbaa !5
  %200 = add nsw i32 %199, 1
  %201 = sext i32 %200 to i64
  %202 = getelementptr inbounds [61 x [2 x i64]], ptr @DP, i64 0, i64 %201
  %203 = getelementptr inbounds [2 x i64], ptr %202, i64 0, i64 1
  %204 = load i64, ptr %203, align 8, !tbaa !9
  %205 = load i32, ptr %7, align 4, !tbaa !5
  %206 = sext i32 %205 to i64
  %207 = getelementptr inbounds [60 x [2 x i64]], ptr @S, i64 0, i64 %206
  %208 = getelementptr inbounds [2 x i64], ptr %207, i64 0, i64 0
  %209 = load i64, ptr %208, align 16, !tbaa !9
  %210 = add nsw i64 %204, %209
  store i64 %210, ptr %10, align 8, !tbaa !9
  %211 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %198, ptr noundef nonnull align 8 dereferenceable(8) %10)
  %212 = load i64, ptr %211, align 8, !tbaa !9
  %213 = load i32, ptr %7, align 4, !tbaa !5
  %214 = sext i32 %213 to i64
  %215 = getelementptr inbounds [61 x [2 x i64]], ptr @DP, i64 0, i64 %214
  %216 = getelementptr inbounds [2 x i64], ptr %215, i64 0, i64 1
  store i64 %212, ptr %216, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  %217 = load i32, ptr %7, align 4, !tbaa !5
  %218 = sext i32 %217 to i64
  %219 = getelementptr inbounds [61 x [2 x i64]], ptr @DP, i64 0, i64 %218
  %220 = getelementptr inbounds [2 x i64], ptr %219, i64 0, i64 1
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  %221 = load i32, ptr %7, align 4, !tbaa !5
  %222 = add nsw i32 %221, 1
  %223 = sext i32 %222 to i64
  %224 = getelementptr inbounds [61 x [2 x i64]], ptr @DP, i64 0, i64 %223
  %225 = getelementptr inbounds [2 x i64], ptr %224, i64 0, i64 1
  %226 = load i64, ptr %225, align 8, !tbaa !9
  %227 = load i32, ptr %7, align 4, !tbaa !5
  %228 = sext i32 %227 to i64
  %229 = getelementptr inbounds [60 x [2 x i64]], ptr @S, i64 0, i64 %228
  %230 = getelementptr inbounds [2 x i64], ptr %229, i64 0, i64 1
  %231 = load i64, ptr %230, align 8, !tbaa !9
  %232 = add nsw i64 %226, %231
  store i64 %232, ptr %11, align 8, !tbaa !9
  %233 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %220, ptr noundef nonnull align 8 dereferenceable(8) %11)
  %234 = load i64, ptr %233, align 8, !tbaa !9
  %235 = load i32, ptr %7, align 4, !tbaa !5
  %236 = sext i32 %235 to i64
  %237 = getelementptr inbounds [61 x [2 x i64]], ptr @DP, i64 0, i64 %236
  %238 = getelementptr inbounds [2 x i64], ptr %237, i64 0, i64 1
  store i64 %234, ptr %238, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  br label %239

239:                                              ; preds = %194, %179
  br label %316

240:                                              ; preds = %112
  %241 = load i32, ptr %7, align 4, !tbaa !5
  %242 = sext i32 %241 to i64
  %243 = getelementptr inbounds [61 x [2 x i64]], ptr @DP, i64 0, i64 %242
  %244 = getelementptr inbounds [2 x i64], ptr %243, i64 0, i64 0
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  %245 = load i32, ptr %7, align 4, !tbaa !5
  %246 = add nsw i32 %245, 1
  %247 = sext i32 %246 to i64
  %248 = getelementptr inbounds [61 x [2 x i64]], ptr @DP, i64 0, i64 %247
  %249 = getelementptr inbounds [2 x i64], ptr %248, i64 0, i64 0
  %250 = load i64, ptr %249, align 16, !tbaa !9
  %251 = load i32, ptr %7, align 4, !tbaa !5
  %252 = sext i32 %251 to i64
  %253 = getelementptr inbounds [60 x [2 x i64]], ptr @S, i64 0, i64 %252
  %254 = getelementptr inbounds [2 x i64], ptr %253, i64 0, i64 0
  %255 = load i64, ptr %254, align 16, !tbaa !9
  %256 = add nsw i64 %250, %255
  store i64 %256, ptr %12, align 8, !tbaa !9
  %257 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %244, ptr noundef nonnull align 8 dereferenceable(8) %12)
  %258 = load i64, ptr %257, align 8, !tbaa !9
  %259 = load i32, ptr %7, align 4, !tbaa !5
  %260 = sext i32 %259 to i64
  %261 = getelementptr inbounds [61 x [2 x i64]], ptr @DP, i64 0, i64 %260
  %262 = getelementptr inbounds [2 x i64], ptr %261, i64 0, i64 0
  store i64 %258, ptr %262, align 16, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  %263 = load i32, ptr %7, align 4, !tbaa !5
  %264 = add nsw i32 %263, 1
  %265 = sext i32 %264 to i64
  %266 = getelementptr inbounds [61 x [2 x i64]], ptr @DP, i64 0, i64 %265
  %267 = getelementptr inbounds [2 x i64], ptr %266, i64 0, i64 1
  %268 = load i64, ptr %267, align 8, !tbaa !9
  %269 = icmp sge i64 %268, 0
  br i1 %269, label %270, label %315

270:                                              ; preds = %240
  %271 = load i32, ptr %7, align 4, !tbaa !5
  %272 = sext i32 %271 to i64
  %273 = getelementptr inbounds [61 x [2 x i64]], ptr @DP, i64 0, i64 %272
  %274 = getelementptr inbounds [2 x i64], ptr %273, i64 0, i64 1
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #6
  %275 = load i32, ptr %7, align 4, !tbaa !5
  %276 = add nsw i32 %275, 1
  %277 = sext i32 %276 to i64
  %278 = getelementptr inbounds [61 x [2 x i64]], ptr @DP, i64 0, i64 %277
  %279 = getelementptr inbounds [2 x i64], ptr %278, i64 0, i64 1
  %280 = load i64, ptr %279, align 8, !tbaa !9
  %281 = load i32, ptr %7, align 4, !tbaa !5
  %282 = sext i32 %281 to i64
  %283 = getelementptr inbounds [60 x [2 x i64]], ptr @S, i64 0, i64 %282
  %284 = getelementptr inbounds [2 x i64], ptr %283, i64 0, i64 0
  %285 = load i64, ptr %284, align 16, !tbaa !9
  %286 = add nsw i64 %280, %285
  store i64 %286, ptr %13, align 8, !tbaa !9
  %287 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %274, ptr noundef nonnull align 8 dereferenceable(8) %13)
  %288 = load i64, ptr %287, align 8, !tbaa !9
  %289 = load i32, ptr %7, align 4, !tbaa !5
  %290 = sext i32 %289 to i64
  %291 = getelementptr inbounds [61 x [2 x i64]], ptr @DP, i64 0, i64 %290
  %292 = getelementptr inbounds [2 x i64], ptr %291, i64 0, i64 1
  store i64 %288, ptr %292, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  %293 = load i32, ptr %7, align 4, !tbaa !5
  %294 = sext i32 %293 to i64
  %295 = getelementptr inbounds [61 x [2 x i64]], ptr @DP, i64 0, i64 %294
  %296 = getelementptr inbounds [2 x i64], ptr %295, i64 0, i64 1
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #6
  %297 = load i32, ptr %7, align 4, !tbaa !5
  %298 = add nsw i32 %297, 1
  %299 = sext i32 %298 to i64
  %300 = getelementptr inbounds [61 x [2 x i64]], ptr @DP, i64 0, i64 %299
  %301 = getelementptr inbounds [2 x i64], ptr %300, i64 0, i64 1
  %302 = load i64, ptr %301, align 8, !tbaa !9
  %303 = load i32, ptr %7, align 4, !tbaa !5
  %304 = sext i32 %303 to i64
  %305 = getelementptr inbounds [60 x [2 x i64]], ptr @S, i64 0, i64 %304
  %306 = getelementptr inbounds [2 x i64], ptr %305, i64 0, i64 1
  %307 = load i64, ptr %306, align 8, !tbaa !9
  %308 = add nsw i64 %302, %307
  store i64 %308, ptr %14, align 8, !tbaa !9
  %309 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %296, ptr noundef nonnull align 8 dereferenceable(8) %14)
  %310 = load i64, ptr %309, align 8, !tbaa !9
  %311 = load i32, ptr %7, align 4, !tbaa !5
  %312 = sext i32 %311 to i64
  %313 = getelementptr inbounds [61 x [2 x i64]], ptr @DP, i64 0, i64 %312
  %314 = getelementptr inbounds [2 x i64], ptr %313, i64 0, i64 1
  store i64 %310, ptr %314, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  br label %315

315:                                              ; preds = %270, %240
  br label %316

316:                                              ; preds = %315, %239
  %317 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cerr, ptr noundef @.str.3)
  %318 = load i32, ptr %7, align 4, !tbaa !5
  %319 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %317, i32 noundef %318)
  %320 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %319, ptr noundef @.str.1)
  %321 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %320, i32 noundef 0)
  %322 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %321, ptr noundef @.str.2)
  %323 = load i32, ptr %7, align 4, !tbaa !5
  %324 = sext i32 %323 to i64
  %325 = getelementptr inbounds [61 x [2 x i64]], ptr @DP, i64 0, i64 %324
  %326 = getelementptr inbounds [2 x i64], ptr %325, i64 0, i64 0
  %327 = load i64, ptr %326, align 16, !tbaa !9
  %328 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) %322, i64 noundef %327)
  %329 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %328, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  %330 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cerr, ptr noundef @.str.3)
  %331 = load i32, ptr %7, align 4, !tbaa !5
  %332 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %330, i32 noundef %331)
  %333 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %332, ptr noundef @.str.1)
  %334 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %333, i32 noundef 1)
  %335 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %334, ptr noundef @.str.2)
  %336 = load i32, ptr %7, align 4, !tbaa !5
  %337 = sext i32 %336 to i64
  %338 = getelementptr inbounds [61 x [2 x i64]], ptr @DP, i64 0, i64 %337
  %339 = getelementptr inbounds [2 x i64], ptr %338, i64 0, i64 1
  %340 = load i64, ptr %339, align 8, !tbaa !9
  %341 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) %335, i64 noundef %340)
  %342 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %341, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %343

343:                                              ; preds = %316
  %344 = load i32, ptr %7, align 4, !tbaa !5
  %345 = add nsw i32 %344, -1
  store i32 %345, ptr %7, align 4, !tbaa !5
  br label %108, !llvm.loop !15

346:                                              ; preds = %111
  %347 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) @DP, ptr noundef nonnull align 8 dereferenceable(8) getelementptr inbounds ([2 x i64], ptr @DP, i64 0, i64 1))
  %348 = load i64, ptr %347, align 8, !tbaa !9
  %349 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %348)
  %350 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %349, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  %351 = load i32, ptr %1, align 4
  ret i32 %351
}

; 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: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4fillIPxiEvT_S1_RKT0_(ptr noundef, ptr noundef, ptr noundef nonnull align 4 dereferenceable(4)) #3

; 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

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

; 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)) #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 = { 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 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { 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}


; 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
@S = external dso_local global [60 x [2 x i64]], align 16
@DP = external dso_local global [61 x [2 x i64]], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cerr = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [4 x i8], align 1
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

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

._crit_edge:                                      ; preds = %.lr.ph, %0
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #6
  store i32 0, ptr %1, align 4, !tbaa !9
  call void @_ZSt4fillIPxiEvT_S1_RKT0_(ptr noundef nonnull @S, ptr noundef nonnull getelementptr inbounds (i8, ptr @S, i64 960), ptr noundef nonnull align 4 dereferenceable(4) %1)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #6
  br label %.preheader

.lr.ph:                                           ; preds = %0, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %0 ]
  %13 = getelementptr inbounds [100010 x i64], ptr @A, i64 0, i64 %indvars.iv
  %14 = 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) %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 !11

.preheader:                                       ; preds = %._crit_edge, %._crit_edge69
  %indvars.iv76 = phi i64 [ 0, %._crit_edge ], [ %indvars.iv.next77, %._crit_edge69 ]
  %17 = load i64, ptr @N, align 8, !tbaa !5
  %18 = icmp sgt i64 %17, 0
  br i1 %18, label %.lr.ph68, label %._crit_edge69

.lr.ph68:                                         ; preds = %.preheader
  %19 = shl nuw i64 1, %indvars.iv76
  %20 = getelementptr inbounds [60 x [2 x i64]], ptr @S, i64 0, i64 %indvars.iv76
  %21 = getelementptr inbounds [60 x [2 x i64]], ptr @S, i64 0, i64 %indvars.iv76, i64 1
  br label %42

22:                                               ; preds = %._crit_edge69
  store i64 0, ptr getelementptr inbounds (i8, ptr @DP, i64 960), align 16, !tbaa !5
  store i64 -1, ptr getelementptr inbounds (i8, ptr @DP, i64 968), align 8, !tbaa !5
  br label %58

._crit_edge69:                                    ; preds = %52, %.preheader
  %23 = 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)
  %24 = trunc nuw nsw i64 %indvars.iv76 to i32
  %25 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %23, i32 noundef %24)
  %26 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %25, ptr noundef nonnull @.str.1)
  %27 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %26, i32 noundef 0)
  %28 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %27, ptr noundef nonnull @.str.2)
  %29 = getelementptr inbounds [60 x [2 x i64]], ptr @S, i64 0, i64 %indvars.iv76
  %30 = load i64, ptr %29, align 16, !tbaa !5
  %31 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) %28, i64 noundef %30)
  %32 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %31, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  %33 = 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)
  %34 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %33, i32 noundef %24)
  %35 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %34, ptr noundef nonnull @.str.1)
  %36 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %35, i32 noundef 1)
  %37 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %36, ptr noundef nonnull @.str.2)
  %38 = getelementptr inbounds i8, ptr %29, i64 8
  %39 = load i64, ptr %38, align 8, !tbaa !5
  %40 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) %37, i64 noundef %39)
  %41 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %40, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  %indvars.iv.next77 = add nuw nsw i64 %indvars.iv76, 1
  %exitcond79.not = icmp eq i64 %indvars.iv.next77, 60
  br i1 %exitcond79.not, label %22, label %.preheader, !llvm.loop !13

42:                                               ; preds = %.lr.ph68, %52
  %indvars.iv73 = phi i64 [ 0, %.lr.ph68 ], [ %indvars.iv.next74, %52 ]
  %43 = getelementptr inbounds [100010 x i64], ptr @A, i64 0, i64 %indvars.iv73
  %44 = load i64, ptr %43, align 8, !tbaa !5
  %45 = and i64 %44, %19
  %.not65 = icmp eq i64 %45, 0
  br i1 %.not65, label %49, label %46

46:                                               ; preds = %42
  %47 = load i64, ptr %20, align 16, !tbaa !5
  %48 = add nsw i64 %47, %19
  store i64 %48, ptr %20, align 16, !tbaa !5
  br label %52

49:                                               ; preds = %42
  %50 = load i64, ptr %21, align 8, !tbaa !5
  %51 = add nsw i64 %50, %19
  store i64 %51, ptr %21, align 8, !tbaa !5
  br label %52

52:                                               ; preds = %46, %49
  %indvars.iv.next74 = add nuw nsw i64 %indvars.iv73, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next74, %17
  br i1 %exitcond.not, label %._crit_edge69, label %42, !llvm.loop !14

53:                                               ; preds = %115
  %54 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) @DP, ptr noundef nonnull align 8 dereferenceable(8) getelementptr inbounds (i8, ptr @DP, i64 8))
  %55 = load i64, ptr %54, align 8, !tbaa !5
  %56 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %55)
  %57 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %56, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  ret i32 0

58:                                               ; preds = %22, %115
  %indvars.iv80 = phi i64 [ 59, %22 ], [ %indvars.iv.next81, %115 ]
  %59 = getelementptr inbounds [61 x [2 x i64]], ptr @DP, i64 0, i64 %indvars.iv80
  store i64 0, ptr %59, align 16, !tbaa !5
  %60 = getelementptr inbounds i8, ptr %59, i64 8
  store i64 -1, ptr %60, align 8, !tbaa !5
  %61 = load i64, ptr @K, align 8, !tbaa !5
  %62 = shl nuw i64 1, %indvars.iv80
  %63 = and i64 %61, %62
  %.not = icmp eq i64 %63, 0
  %64 = add nuw nsw i64 %indvars.iv80, 1
  %65 = getelementptr inbounds [61 x [2 x i64]], ptr @DP, i64 0, i64 %64
  %66 = getelementptr inbounds [60 x [2 x i64]], ptr @S, i64 0, i64 %indvars.iv80
  br i1 %.not, label %95, label %67

67:                                               ; preds = %58
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #6
  %68 = load i64, ptr %65, align 16, !tbaa !5
  %69 = load i64, ptr %66, align 16, !tbaa !5
  %70 = add nsw i64 %69, %68
  store i64 %70, ptr %2, align 8, !tbaa !5
  %71 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %60, ptr noundef nonnull align 8 dereferenceable(8) %2)
  %72 = load i64, ptr %71, align 8, !tbaa !5
  store i64 %72, ptr %60, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #6
  %73 = load i64, ptr %65, align 16, !tbaa !5
  %74 = getelementptr inbounds i8, ptr %66, i64 8
  %75 = load i64, ptr %74, align 8, !tbaa !5
  %76 = add nsw i64 %75, %73
  store i64 %76, ptr %3, align 8, !tbaa !5
  %77 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %59, ptr noundef nonnull align 8 dereferenceable(8) %3)
  %78 = load i64, ptr %77, align 8, !tbaa !5
  store i64 %78, ptr %59, align 16, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #6
  %79 = getelementptr inbounds i8, ptr %65, i64 8
  %80 = load i64, ptr %79, align 8, !tbaa !5
  %81 = icmp slt i64 %80, 0
  br i1 %81, label %82, label %85

82:                                               ; preds = %67
  %83 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %60, ptr noundef nonnull align 8 dereferenceable(8) %66)
  %84 = load i64, ptr %83, align 8, !tbaa !5
  store i64 %84, ptr %60, align 8, !tbaa !5
  br label %115

85:                                               ; preds = %67
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #6
  %86 = load i64, ptr %66, align 16, !tbaa !5
  %87 = add nsw i64 %86, %80
  store i64 %87, ptr %4, align 8, !tbaa !5
  %88 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %60, ptr noundef nonnull align 8 dereferenceable(8) %4)
  %89 = load i64, ptr %88, align 8, !tbaa !5
  store i64 %89, ptr %60, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #6
  %90 = load i64, ptr %79, align 8, !tbaa !5
  %91 = load i64, ptr %74, align 8, !tbaa !5
  %92 = add nsw i64 %91, %90
  store i64 %92, ptr %5, align 8, !tbaa !5
  %93 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %60, ptr noundef nonnull align 8 dereferenceable(8) %5)
  %94 = load i64, ptr %93, align 8, !tbaa !5
  store i64 %94, ptr %60, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #6
  br label %115

95:                                               ; preds = %58
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #6
  %96 = load i64, ptr %65, align 16, !tbaa !5
  %97 = load i64, ptr %66, align 16, !tbaa !5
  %98 = add nsw i64 %97, %96
  store i64 %98, ptr %6, align 8, !tbaa !5
  %99 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %59, ptr noundef nonnull align 8 dereferenceable(8) %6)
  %100 = load i64, ptr %99, align 8, !tbaa !5
  store i64 %100, ptr %59, align 16, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #6
  %101 = getelementptr inbounds i8, ptr %65, i64 8
  %102 = load i64, ptr %101, align 8, !tbaa !5
  %103 = icmp sgt i64 %102, -1
  br i1 %103, label %104, label %115

104:                                              ; preds = %95
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #6
  %105 = load i64, ptr %66, align 16, !tbaa !5
  %106 = add nsw i64 %105, %102
  store i64 %106, ptr %7, align 8, !tbaa !5
  %107 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %60, ptr noundef nonnull align 8 dereferenceable(8) %7)
  %108 = load i64, ptr %107, align 8, !tbaa !5
  store i64 %108, ptr %60, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #6
  %109 = load i64, ptr %101, align 8, !tbaa !5
  %110 = getelementptr inbounds i8, ptr %66, i64 8
  %111 = load i64, ptr %110, align 8, !tbaa !5
  %112 = add nsw i64 %111, %109
  store i64 %112, ptr %8, align 8, !tbaa !5
  %113 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %60, ptr noundef nonnull align 8 dereferenceable(8) %8)
  %114 = load i64, ptr %113, align 8, !tbaa !5
  store i64 %114, ptr %60, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #6
  br label %115

115:                                              ; preds = %95, %104, %82, %85
  %116 = 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.3)
  %117 = trunc nuw nsw i64 %indvars.iv80 to i32
  %118 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %116, i32 noundef %117)
  %119 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %118, ptr noundef nonnull @.str.1)
  %120 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %119, i32 noundef 0)
  %121 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %120, ptr noundef nonnull @.str.2)
  %122 = load i64, ptr %59, align 16, !tbaa !5
  %123 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) %121, i64 noundef %122)
  %124 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %123, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  %125 = 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.3)
  %126 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %125, i32 noundef %117)
  %127 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %126, ptr noundef nonnull @.str.1)
  %128 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %127, i32 noundef 1)
  %129 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %128, ptr noundef nonnull @.str.2)
  %130 = load i64, ptr %60, align 8, !tbaa !5
  %131 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) %129, i64 noundef %130)
  %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_)
  %indvars.iv.next81 = add nsw i64 %indvars.iv80, -1
  %.not83 = icmp eq i64 %indvars.iv80, 0
  br i1 %.not83, label %53, label %58, !llvm.loop !15
}

; 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: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4fillIPxiEvT_S1_RKT0_(ptr noundef, ptr noundef, ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #3

; 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

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

; 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 #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 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { 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 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !12}
!15 = distinct !{!15, !12}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass