; LLVM IR from VastoLorde95/Competitive-Programming :: Codeforces/VK Cup 2012 Round 2/Problem D (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" }
%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }

@dp = external dso_local global [2000 x i32], align 16
@palin = external dso_local global [2000 x [2000 x i32]], align 16
@l = external dso_local global i32, align 4
@res = external dso_local global i64, align 8
@sum = external dso_local global [2000 x i64], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca %"class.std::__cxx11::basic_string", align 8
  %3 = alloca ptr, align 8
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 32, ptr %2) #6
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %2) #6
  %13 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(32) %2)
          to label %14 unwind label %22

14:                                               ; preds = %0
  %15 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6lengthEv(ptr noundef nonnull align 8 dereferenceable(32) %2) #6
  %16 = trunc i64 %15 to i32
  store i32 %16, ptr @l, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #6
  store i32 0, ptr %5, align 4, !tbaa !5
  br label %17

17:                                               ; preds = %36, %14
  %18 = load i32, ptr %5, align 4, !tbaa !5
  %19 = load i32, ptr @l, align 4, !tbaa !5
  %20 = icmp slt i32 %18, %19
  br i1 %20, label %26, label %21

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

22:                                               ; preds = %229, %226, %0
  %23 = landingpad { ptr, i32 }
          cleanup
  %24 = extractvalue { ptr, i32 } %23, 0
  store ptr %24, ptr %3, align 8
  %25 = extractvalue { ptr, i32 } %23, 1
  store i32 %25, ptr %4, align 4
  br label %233

26:                                               ; preds = %17
  %27 = load i32, ptr %5, align 4, !tbaa !5
  %28 = sext i32 %27 to i64
  %29 = getelementptr inbounds [2000 x i32], ptr @dp, i64 0, i64 %28
  store i32 1, ptr %29, align 4, !tbaa !5
  %30 = load i32, ptr %5, align 4, !tbaa !5
  %31 = sext i32 %30 to i64
  %32 = getelementptr inbounds [2000 x [2000 x i32]], ptr @palin, i64 0, i64 %31
  %33 = load i32, ptr %5, align 4, !tbaa !5
  %34 = sext i32 %33 to i64
  %35 = getelementptr inbounds [2000 x i32], ptr %32, i64 0, i64 %34
  store i32 1, ptr %35, align 4, !tbaa !5
  br label %36

36:                                               ; preds = %26
  %37 = load i32, ptr %5, align 4, !tbaa !5
  %38 = add nsw i32 %37, 1
  store i32 %38, ptr %5, align 4, !tbaa !5
  br label %17, !llvm.loop !9

39:                                               ; preds = %21
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  store i32 1, ptr %6, align 4, !tbaa !5
  br label %40

40:                                               ; preds = %78, %39
  %41 = load i32, ptr %6, align 4, !tbaa !5
  %42 = load i32, ptr @l, align 4, !tbaa !5
  %43 = icmp slt i32 %41, %42
  br i1 %43, label %45, label %44

44:                                               ; preds = %40
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  br label %81

45:                                               ; preds = %40
  %46 = load i32, ptr %6, align 4, !tbaa !5
  %47 = sext i32 %46 to i64
  %48 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %2, i64 noundef %47)
          to label %49 unwind label %73

49:                                               ; preds = %45
  %50 = load i8, ptr %48, align 1, !tbaa !11
  %51 = sext i8 %50 to i32
  %52 = load i32, ptr %6, align 4, !tbaa !5
  %53 = sub nsw i32 %52, 1
  %54 = sext i32 %53 to i64
  %55 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %2, i64 noundef %54)
          to label %56 unwind label %73

56:                                               ; preds = %49
  %57 = load i8, ptr %55, align 1, !tbaa !11
  %58 = sext i8 %57 to i32
  %59 = icmp eq i32 %51, %58
  br i1 %59, label %60, label %77

60:                                               ; preds = %56
  %61 = load i32, ptr %6, align 4, !tbaa !5
  %62 = sext i32 %61 to i64
  %63 = getelementptr inbounds [2000 x i32], ptr @dp, i64 0, i64 %62
  %64 = load i32, ptr %63, align 4, !tbaa !5
  %65 = add nsw i32 %64, 1
  store i32 %65, ptr %63, align 4, !tbaa !5
  %66 = load i32, ptr %6, align 4, !tbaa !5
  %67 = sext i32 %66 to i64
  %68 = getelementptr inbounds [2000 x [2000 x i32]], ptr @palin, i64 0, i64 %67
  %69 = load i32, ptr %6, align 4, !tbaa !5
  %70 = sub nsw i32 %69, 1
  %71 = sext i32 %70 to i64
  %72 = getelementptr inbounds [2000 x i32], ptr %68, i64 0, i64 %71
  store i32 1, ptr %72, align 4, !tbaa !5
  br label %77

73:                                               ; preds = %49, %45
  %74 = landingpad { ptr, i32 }
          cleanup
  %75 = extractvalue { ptr, i32 } %74, 0
  store ptr %75, ptr %3, align 8
  %76 = extractvalue { ptr, i32 } %74, 1
  store i32 %76, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  br label %233

77:                                               ; preds = %60, %56
  br label %78

78:                                               ; preds = %77
  %79 = load i32, ptr %6, align 4, !tbaa !5
  %80 = add nsw i32 %79, 1
  store i32 %80, ptr %6, align 4, !tbaa !5
  br label %40, !llvm.loop !12

81:                                               ; preds = %44
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  store i32 2, ptr %7, align 4, !tbaa !5
  br label %82

82:                                               ; preds = %146, %81
  %83 = load i32, ptr %7, align 4, !tbaa !5
  %84 = load i32, ptr @l, align 4, !tbaa !5
  %85 = icmp slt i32 %83, %84
  br i1 %85, label %87, label %86

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

87:                                               ; preds = %82
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  %88 = load i32, ptr %7, align 4, !tbaa !5
  store i32 %88, ptr %9, align 4, !tbaa !5
  br label %89

89:                                               ; preds = %142, %87
  %90 = load i32, ptr %9, align 4, !tbaa !5
  %91 = load i32, ptr @l, align 4, !tbaa !5
  %92 = icmp slt i32 %90, %91
  br i1 %92, label %94, label %93

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

94:                                               ; preds = %89
  %95 = load i32, ptr %9, align 4, !tbaa !5
  %96 = sext i32 %95 to i64
  %97 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %2, i64 noundef %96)
          to label %98 unwind label %137

98:                                               ; preds = %94
  %99 = load i8, ptr %97, align 1, !tbaa !11
  %100 = sext i8 %99 to i32
  %101 = load i32, ptr %9, align 4, !tbaa !5
  %102 = load i32, ptr %7, align 4, !tbaa !5
  %103 = sub nsw i32 %101, %102
  %104 = sext i32 %103 to i64
  %105 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %2, i64 noundef %104)
          to label %106 unwind label %137

106:                                              ; preds = %98
  %107 = load i8, ptr %105, align 1, !tbaa !11
  %108 = sext i8 %107 to i32
  %109 = icmp eq i32 %100, %108
  br i1 %109, label %110, label %141

110:                                              ; preds = %106
  %111 = load i32, ptr %9, align 4, !tbaa !5
  %112 = sub nsw i32 %111, 1
  %113 = sext i32 %112 to i64
  %114 = getelementptr inbounds [2000 x [2000 x i32]], ptr @palin, i64 0, i64 %113
  %115 = load i32, ptr %9, align 4, !tbaa !5
  %116 = load i32, ptr %7, align 4, !tbaa !5
  %117 = sub nsw i32 %115, %116
  %118 = add nsw i32 %117, 1
  %119 = sext i32 %118 to i64
  %120 = getelementptr inbounds [2000 x i32], ptr %114, i64 0, i64 %119
  %121 = load i32, ptr %120, align 4, !tbaa !5
  %122 = icmp eq i32 %121, 1
  br i1 %122, label %123, label %141

123:                                              ; preds = %110
  %124 = load i32, ptr %9, align 4, !tbaa !5
  %125 = sext i32 %124 to i64
  %126 = getelementptr inbounds [2000 x i32], ptr @dp, i64 0, i64 %125
  %127 = load i32, ptr %126, align 4, !tbaa !5
  %128 = add nsw i32 %127, 1
  store i32 %128, ptr %126, align 4, !tbaa !5
  %129 = load i32, ptr %9, align 4, !tbaa !5
  %130 = sext i32 %129 to i64
  %131 = getelementptr inbounds [2000 x [2000 x i32]], ptr @palin, i64 0, i64 %130
  %132 = load i32, ptr %9, align 4, !tbaa !5
  %133 = load i32, ptr %7, align 4, !tbaa !5
  %134 = sub nsw i32 %132, %133
  %135 = sext i32 %134 to i64
  %136 = getelementptr inbounds [2000 x i32], ptr %131, i64 0, i64 %135
  store i32 1, ptr %136, align 4, !tbaa !5
  br label %141

137:                                              ; preds = %98, %94
  %138 = landingpad { ptr, i32 }
          cleanup
  %139 = extractvalue { ptr, i32 } %138, 0
  store ptr %139, ptr %3, align 8
  %140 = extractvalue { ptr, i32 } %138, 1
  store i32 %140, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  br label %233

141:                                              ; preds = %123, %110, %106
  br label %142

142:                                              ; preds = %141
  %143 = load i32, ptr %9, align 4, !tbaa !5
  %144 = add nsw i32 %143, 1
  store i32 %144, ptr %9, align 4, !tbaa !5
  br label %89, !llvm.loop !13

145:                                              ; preds = %93
  br label %146

146:                                              ; preds = %145
  %147 = load i32, ptr %7, align 4, !tbaa !5
  %148 = add nsw i32 %147, 1
  store i32 %148, ptr %7, align 4, !tbaa !5
  br label %82, !llvm.loop !14

149:                                              ; preds = %86
  %150 = load i32, ptr @dp, align 16, !tbaa !5
  %151 = sext i32 %150 to i64
  store i64 %151, ptr @sum, align 16, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  store i32 1, ptr %10, align 4, !tbaa !5
  br label %152

152:                                              ; preds = %172, %149
  %153 = load i32, ptr %10, align 4, !tbaa !5
  %154 = load i32, ptr @l, align 4, !tbaa !5
  %155 = icmp slt i32 %153, %154
  br i1 %155, label %157, label %156

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

157:                                              ; preds = %152
  %158 = load i32, ptr %10, align 4, !tbaa !5
  %159 = sub nsw i32 %158, 1
  %160 = sext i32 %159 to i64
  %161 = getelementptr inbounds [2000 x i64], ptr @sum, i64 0, i64 %160
  %162 = load i64, ptr %161, align 8, !tbaa !15
  %163 = load i32, ptr %10, align 4, !tbaa !5
  %164 = sext i32 %163 to i64
  %165 = getelementptr inbounds [2000 x i32], ptr @dp, i64 0, i64 %164
  %166 = load i32, ptr %165, align 4, !tbaa !5
  %167 = sext i32 %166 to i64
  %168 = add nsw i64 %162, %167
  %169 = load i32, ptr %10, align 4, !tbaa !5
  %170 = sext i32 %169 to i64
  %171 = getelementptr inbounds [2000 x i64], ptr @sum, i64 0, i64 %170
  store i64 %168, ptr %171, align 8, !tbaa !15
  br label %172

172:                                              ; preds = %157
  %173 = load i32, ptr %10, align 4, !tbaa !5
  %174 = add nsw i32 %173, 1
  store i32 %174, ptr %10, align 4, !tbaa !5
  br label %152, !llvm.loop !17

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

176:                                              ; preds = %223, %175
  %177 = load i32, ptr %11, align 4, !tbaa !5
  %178 = load i32, ptr @l, align 4, !tbaa !5
  %179 = icmp slt i32 %177, %178
  br i1 %179, label %181, label %180

180:                                              ; preds = %176
  store i32 17, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  br label %226

181:                                              ; preds = %176
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  %182 = load i32, ptr %11, align 4, !tbaa !5
  store i32 %182, ptr %12, align 4, !tbaa !5
  br label %183

183:                                              ; preds = %219, %181
  %184 = load i32, ptr %12, align 4, !tbaa !5
  %185 = load i32, ptr @l, align 4, !tbaa !5
  %186 = icmp slt i32 %184, %185
  br i1 %186, label %188, label %187

187:                                              ; preds = %183
  store i32 20, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  br label %222

188:                                              ; preds = %183
  %189 = load i32, ptr %12, align 4, !tbaa !5
  %190 = sext i32 %189 to i64
  %191 = getelementptr inbounds [2000 x [2000 x i32]], ptr @palin, i64 0, i64 %190
  %192 = load i32, ptr %12, align 4, !tbaa !5
  %193 = load i32, ptr %11, align 4, !tbaa !5
  %194 = sub nsw i32 %192, %193
  %195 = sext i32 %194 to i64
  %196 = getelementptr inbounds [2000 x i32], ptr %191, i64 0, i64 %195
  %197 = load i32, ptr %196, align 4, !tbaa !5
  %198 = icmp eq i32 %197, 1
  br i1 %198, label %199, label %218

199:                                              ; preds = %188
  %200 = load i32, ptr %12, align 4, !tbaa !5
  %201 = load i32, ptr %11, align 4, !tbaa !5
  %202 = sub nsw i32 %200, %201
  %203 = sub nsw i32 %202, 1
  %204 = icmp sge i32 %203, 0
  br i1 %204, label %205, label %213

205:                                              ; preds = %199
  %206 = load i32, ptr %12, align 4, !tbaa !5
  %207 = load i32, ptr %11, align 4, !tbaa !5
  %208 = sub nsw i32 %206, %207
  %209 = sub nsw i32 %208, 1
  %210 = sext i32 %209 to i64
  %211 = getelementptr inbounds [2000 x i64], ptr @sum, i64 0, i64 %210
  %212 = load i64, ptr %211, align 8, !tbaa !15
  br label %214

213:                                              ; preds = %199
  br label %214

214:                                              ; preds = %213, %205
  %215 = phi i64 [ %212, %205 ], [ 0, %213 ]
  %216 = load i64, ptr @res, align 8, !tbaa !15
  %217 = add nsw i64 %216, %215
  store i64 %217, ptr @res, align 8, !tbaa !15
  br label %218

218:                                              ; preds = %214, %188
  br label %219

219:                                              ; preds = %218
  %220 = load i32, ptr %12, align 4, !tbaa !5
  %221 = add nsw i32 %220, 1
  store i32 %221, ptr %12, align 4, !tbaa !5
  br label %183, !llvm.loop !18

222:                                              ; preds = %187
  br label %223

223:                                              ; preds = %222
  %224 = load i32, ptr %11, align 4, !tbaa !5
  %225 = add nsw i32 %224, 1
  store i32 %225, ptr %11, align 4, !tbaa !5
  br label %176, !llvm.loop !19

226:                                              ; preds = %180
  %227 = load i64, ptr @res, align 8, !tbaa !15
  %228 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %227)
          to label %229 unwind label %22

229:                                              ; preds = %226
  %230 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %228, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %231 unwind label %22

231:                                              ; preds = %229
  store i32 0, ptr %1, align 4
  store i32 1, ptr %8, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %2) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %2) #6
  %232 = load i32, ptr %1, align 4
  ret i32 %232

233:                                              ; preds = %137, %73, %22
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %2) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %2) #6
  br label %234

234:                                              ; preds = %233
  %235 = load ptr, ptr %3, align 8
  %236 = load i32, ptr %4, align 4
  %237 = insertvalue { ptr, i32 } poison, ptr %235, 0
  %238 = insertvalue { ptr, i32 } %237, i32 %236, 1
  resume { ptr, i32 } %238
}

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

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #2 align 2

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(32)) #3

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6lengthEv(ptr noundef nonnull align 8 dereferenceable(32)) #2 align 2

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

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

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) #4 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) #4 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)) #5

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #2 align 2

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

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

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


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

%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }

@dp = external dso_local local_unnamed_addr global [2000 x i32], align 16
@palin = external dso_local local_unnamed_addr global [2000 x [2000 x i32]], align 16
@l = external dso_local local_unnamed_addr global i32, align 4
@res = external dso_local local_unnamed_addr global i64, align 8
@sum = external dso_local local_unnamed_addr global [2000 x i64], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca %"class.std::__cxx11::basic_string", align 8
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %1) #6
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %1) #6
  %2 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(32) %1)
          to label %3 unwind label %11

3:                                                ; preds = %0
  %4 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6lengthEv(ptr noundef nonnull align 8 dereferenceable(32) %1) #6
  %5 = trunc i64 %4 to i32
  store i32 %5, ptr @l, align 4, !tbaa !5
  %6 = icmp sgt i32 %5, 0
  br i1 %6, label %.lr.ph.preheader, label %._crit_edge63.thread

.lr.ph.preheader:                                 ; preds = %3
  %wide.trip.count = and i64 %4, 2147483647
  %7 = add nsw i64 %wide.trip.count, -1
  %xtraiter = and i64 %4, 3
  %8 = icmp ult i64 %7, 3
  br i1 %8, label %.preheader56.unr-lcssa, label %.lr.ph.preheader.new

.lr.ph.preheader.new:                             ; preds = %.lr.ph.preheader
  %unroll_iter = sub nsw i64 %wide.trip.count, %xtraiter
  br label %.lr.ph

.preheader56.unr-lcssa:                           ; preds = %.lr.ph, %.lr.ph.preheader
  %indvars.iv.unr = phi i64 [ 0, %.lr.ph.preheader ], [ %indvars.iv.next.3, %.lr.ph ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.preheader56, label %.lr.ph.epil

.lr.ph.epil:                                      ; preds = %.preheader56.unr-lcssa, %.lr.ph.epil
  %indvars.iv.epil = phi i64 [ %indvars.iv.next.epil, %.lr.ph.epil ], [ %indvars.iv.unr, %.preheader56.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.lr.ph.epil ], [ 0, %.preheader56.unr-lcssa ]
  %9 = getelementptr inbounds [2000 x i32], ptr @dp, i64 0, i64 %indvars.iv.epil
  store i32 1, ptr %9, align 4, !tbaa !5
  %10 = getelementptr inbounds [2000 x [2000 x i32]], ptr @palin, i64 0, i64 %indvars.iv.epil, i64 %indvars.iv.epil
  store i32 1, ptr %10, align 4, !tbaa !5
  %indvars.iv.next.epil = add nuw nsw i64 %indvars.iv.epil, 1
  %epil.iter.next = add i64 %epil.iter, 1
  %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
  br i1 %epil.iter.cmp.not, label %.preheader56, label %.lr.ph.epil, !llvm.loop !9

.preheader56:                                     ; preds = %.lr.ph.epil, %.preheader56.unr-lcssa
  %.not = icmp eq i32 %5, 1
  br i1 %.not, label %._crit_edge63.thread, label %.lr.ph59

11:                                               ; preds = %122, %._crit_edge74, %0
  %12 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %1) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %1) #6
  resume { ptr, i32 } %12

.lr.ph:                                           ; preds = %.lr.ph, %.lr.ph.preheader.new
  %indvars.iv = phi i64 [ 0, %.lr.ph.preheader.new ], [ %indvars.iv.next.3, %.lr.ph ]
  %niter = phi i64 [ 0, %.lr.ph.preheader.new ], [ %niter.next.3, %.lr.ph ]
  %13 = getelementptr inbounds [2000 x i32], ptr @dp, i64 0, i64 %indvars.iv
  store i32 1, ptr %13, align 16, !tbaa !5
  %14 = getelementptr inbounds [2000 x [2000 x i32]], ptr @palin, i64 0, i64 %indvars.iv, i64 %indvars.iv
  store i32 1, ptr %14, align 16, !tbaa !5
  %indvars.iv.next = or disjoint i64 %indvars.iv, 1
  %15 = getelementptr inbounds [2000 x i32], ptr @dp, i64 0, i64 %indvars.iv.next
  store i32 1, ptr %15, align 4, !tbaa !5
  %16 = getelementptr inbounds [2000 x [2000 x i32]], ptr @palin, i64 0, i64 %indvars.iv.next, i64 %indvars.iv.next
  store i32 1, ptr %16, align 4, !tbaa !5
  %indvars.iv.next.1 = or disjoint i64 %indvars.iv, 2
  %17 = getelementptr inbounds [2000 x i32], ptr @dp, i64 0, i64 %indvars.iv.next.1
  store i32 1, ptr %17, align 8, !tbaa !5
  %18 = getelementptr inbounds [2000 x [2000 x i32]], ptr @palin, i64 0, i64 %indvars.iv.next.1, i64 %indvars.iv.next.1
  store i32 1, ptr %18, align 8, !tbaa !5
  %indvars.iv.next.2 = or disjoint i64 %indvars.iv, 3
  %19 = getelementptr inbounds [2000 x i32], ptr @dp, i64 0, i64 %indvars.iv.next.2
  store i32 1, ptr %19, align 4, !tbaa !5
  %20 = getelementptr inbounds [2000 x [2000 x i32]], ptr @palin, i64 0, i64 %indvars.iv.next.2, i64 %indvars.iv.next.2
  store i32 1, ptr %20, align 4, !tbaa !5
  %indvars.iv.next.3 = add nuw nsw i64 %indvars.iv, 4
  %niter.next.3 = add i64 %niter, 4
  %niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
  br i1 %niter.ncmp.3, label %.preheader56.unr-lcssa, label %.lr.ph, !llvm.loop !11

._crit_edge63.thread:                             ; preds = %3, %.preheader56
  %21 = load i32, ptr @dp, align 16, !tbaa !5
  %22 = sext i32 %21 to i64
  store i64 %22, ptr @sum, align 16, !tbaa !13
  br label %.preheader53

.preheader55:                                     ; preds = %35
  %23 = icmp sgt i32 %36, 2
  br i1 %23, label %.preheader54, label %._crit_edge63

.lr.ph59:                                         ; preds = %.preheader56, %35
  %indvars.iv77 = phi i64 [ %indvars.iv.next78, %35 ], [ 1, %.preheader56 ]
  %24 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %1, i64 noundef %indvars.iv77)
  %25 = load i8, ptr %24, align 1, !tbaa !15
  %26 = add nsw i64 %indvars.iv77, -1
  %27 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %1, i64 noundef %26)
  %28 = load i8, ptr %27, align 1, !tbaa !15
  %29 = icmp eq i8 %25, %28
  br i1 %29, label %30, label %35

30:                                               ; preds = %.lr.ph59
  %31 = getelementptr inbounds [2000 x i32], ptr @dp, i64 0, i64 %indvars.iv77
  %32 = load i32, ptr %31, align 4, !tbaa !5
  %33 = add nsw i32 %32, 1
  store i32 %33, ptr %31, align 4, !tbaa !5
  %34 = getelementptr inbounds [2000 x [2000 x i32]], ptr @palin, i64 0, i64 %indvars.iv77, i64 %26
  store i32 1, ptr %34, align 4, !tbaa !5
  br label %35

35:                                               ; preds = %.lr.ph59, %30
  %indvars.iv.next78 = add nuw nsw i64 %indvars.iv77, 1
  %36 = load i32, ptr @l, align 4, !tbaa !5
  %37 = sext i32 %36 to i64
  %38 = icmp slt i64 %indvars.iv.next78, %37
  br i1 %38, label %.lr.ph59, label %.preheader55, !llvm.loop !16

.preheader54:                                     ; preds = %.preheader55, %._crit_edge
  %39 = phi i32 [ %48, %._crit_edge ], [ %36, %.preheader55 ]
  %indvars.iv80 = phi i64 [ %indvars.iv.next81, %._crit_edge ], [ 2, %.preheader55 ]
  %40 = sext i32 %39 to i64
  %41 = icmp slt i64 %indvars.iv80, %40
  br i1 %41, label %.lr.ph61, label %._crit_edge

._crit_edge63:                                    ; preds = %._crit_edge, %.preheader55
  %.lcssa = phi i32 [ %36, %.preheader55 ], [ %48, %._crit_edge ]
  %42 = load i32, ptr @dp, align 16, !tbaa !5
  %43 = sext i32 %42 to i64
  store i64 %43, ptr @sum, align 16, !tbaa !13
  %44 = icmp sgt i32 %.lcssa, 1
  br i1 %44, label %.lr.ph66.preheader, label %.preheader53

.lr.ph66.preheader:                               ; preds = %._crit_edge63
  %wide.trip.count89 = zext nneg i32 %.lcssa to i64
  %45 = add nsw i64 %wide.trip.count89, -1
  %46 = add nsw i64 %wide.trip.count89, -2
  %xtraiter121 = and i64 %45, 3
  %47 = icmp ult i64 %46, 3
  br i1 %47, label %.preheader53.loopexit.unr-lcssa, label %.lr.ph66.preheader.new

.lr.ph66.preheader.new:                           ; preds = %.lr.ph66.preheader
  %unroll_iter124 = and i64 %45, -4
  br label %.lr.ph66

._crit_edge:                                      ; preds = %67, %.preheader54
  %.pre-phi = phi i64 [ %40, %.preheader54 ], [ %69, %67 ]
  %48 = phi i32 [ %39, %.preheader54 ], [ %68, %67 ]
  %indvars.iv.next81 = add nuw nsw i64 %indvars.iv80, 1
  %49 = icmp slt i64 %indvars.iv.next81, %.pre-phi
  br i1 %49, label %.preheader54, label %._crit_edge63, !llvm.loop !17

.lr.ph61:                                         ; preds = %.preheader54, %67
  %indvars.iv82 = phi i64 [ %indvars.iv.next83, %67 ], [ %indvars.iv80, %.preheader54 ]
  %50 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %1, i64 noundef %indvars.iv82)
  %51 = load i8, ptr %50, align 1, !tbaa !15
  %52 = sub nuw nsw i64 %indvars.iv82, %indvars.iv80
  %53 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %1, i64 noundef %52)
  %54 = load i8, ptr %53, align 1, !tbaa !15
  %55 = icmp eq i8 %51, %54
  br i1 %55, label %56, label %67

56:                                               ; preds = %.lr.ph61
  %57 = add nsw i64 %indvars.iv82, -1
  %58 = add nuw nsw i64 %52, 1
  %59 = getelementptr inbounds [2000 x [2000 x i32]], ptr @palin, i64 0, i64 %57, i64 %58
  %60 = load i32, ptr %59, align 4, !tbaa !5
  %61 = icmp eq i32 %60, 1
  br i1 %61, label %62, label %67

62:                                               ; preds = %56
  %63 = getelementptr inbounds [2000 x i32], ptr @dp, i64 0, i64 %indvars.iv82
  %64 = load i32, ptr %63, align 4, !tbaa !5
  %65 = add nsw i32 %64, 1
  store i32 %65, ptr %63, align 4, !tbaa !5
  %66 = getelementptr inbounds [2000 x [2000 x i32]], ptr @palin, i64 0, i64 %indvars.iv82, i64 %52
  store i32 1, ptr %66, align 4, !tbaa !5
  br label %67

67:                                               ; preds = %.lr.ph61, %56, %62
  %indvars.iv.next83 = add nuw nsw i64 %indvars.iv82, 1
  %68 = load i32, ptr @l, align 4, !tbaa !5
  %69 = sext i32 %68 to i64
  %70 = icmp slt i64 %indvars.iv.next83, %69
  br i1 %70, label %.lr.ph61, label %._crit_edge, !llvm.loop !18

.preheader53.loopexit.unr-lcssa:                  ; preds = %.lr.ph66, %.lr.ph66.preheader
  %.unr = phi i64 [ %43, %.lr.ph66.preheader ], [ %97, %.lr.ph66 ]
  %indvars.iv86.unr = phi i64 [ 1, %.lr.ph66.preheader ], [ %indvars.iv.next87.3, %.lr.ph66 ]
  %lcmp.mod123.not = icmp eq i64 %xtraiter121, 0
  br i1 %lcmp.mod123.not, label %.preheader53, label %.lr.ph66.epil

.lr.ph66.epil:                                    ; preds = %.preheader53.loopexit.unr-lcssa, %.lr.ph66.epil
  %71 = phi i64 [ %75, %.lr.ph66.epil ], [ %.unr, %.preheader53.loopexit.unr-lcssa ]
  %indvars.iv86.epil = phi i64 [ %indvars.iv.next87.epil, %.lr.ph66.epil ], [ %indvars.iv86.unr, %.preheader53.loopexit.unr-lcssa ]
  %epil.iter122 = phi i64 [ %epil.iter122.next, %.lr.ph66.epil ], [ 0, %.preheader53.loopexit.unr-lcssa ]
  %72 = getelementptr inbounds [2000 x i32], ptr @dp, i64 0, i64 %indvars.iv86.epil
  %73 = load i32, ptr %72, align 4, !tbaa !5
  %74 = sext i32 %73 to i64
  %75 = add nsw i64 %71, %74
  %76 = getelementptr inbounds [2000 x i64], ptr @sum, i64 0, i64 %indvars.iv86.epil
  store i64 %75, ptr %76, align 8, !tbaa !13
  %indvars.iv.next87.epil = add nuw nsw i64 %indvars.iv86.epil, 1
  %epil.iter122.next = add i64 %epil.iter122, 1
  %epil.iter122.cmp.not = icmp eq i64 %epil.iter122.next, %xtraiter121
  br i1 %epil.iter122.cmp.not, label %.preheader53, label %.lr.ph66.epil, !llvm.loop !19

.preheader53:                                     ; preds = %.preheader53.loopexit.unr-lcssa, %.lr.ph66.epil, %._crit_edge63.thread, %._crit_edge63
  %.lcssa104 = phi i32 [ %5, %._crit_edge63.thread ], [ %.lcssa, %._crit_edge63 ], [ %.lcssa, %.lr.ph66.epil ], [ %.lcssa, %.preheader53.loopexit.unr-lcssa ]
  %res.promoted68 = load i64, ptr @res, align 8, !tbaa !13
  %77 = icmp sgt i32 %.lcssa104, 0
  br i1 %77, label %.preheader.preheader, label %._crit_edge74

.preheader.preheader:                             ; preds = %.preheader53
  %wide.trip.count100 = zext nneg i32 %.lcssa104 to i64
  br label %.preheader

.lr.ph66:                                         ; preds = %.lr.ph66, %.lr.ph66.preheader.new
  %78 = phi i64 [ %43, %.lr.ph66.preheader.new ], [ %97, %.lr.ph66 ]
  %indvars.iv86 = phi i64 [ 1, %.lr.ph66.preheader.new ], [ %indvars.iv.next87.3, %.lr.ph66 ]
  %niter125 = phi i64 [ 0, %.lr.ph66.preheader.new ], [ %niter125.next.3, %.lr.ph66 ]
  %79 = getelementptr inbounds [2000 x i32], ptr @dp, i64 0, i64 %indvars.iv86
  %80 = load i32, ptr %79, align 4, !tbaa !5
  %81 = sext i32 %80 to i64
  %82 = add nsw i64 %78, %81
  %83 = getelementptr inbounds [2000 x i64], ptr @sum, i64 0, i64 %indvars.iv86
  store i64 %82, ptr %83, align 8, !tbaa !13
  %indvars.iv.next87 = add nuw nsw i64 %indvars.iv86, 1
  %84 = getelementptr inbounds [2000 x i32], ptr @dp, i64 0, i64 %indvars.iv.next87
  %85 = load i32, ptr %84, align 4, !tbaa !5
  %86 = sext i32 %85 to i64
  %87 = add nsw i64 %82, %86
  %88 = getelementptr inbounds [2000 x i64], ptr @sum, i64 0, i64 %indvars.iv.next87
  store i64 %87, ptr %88, align 8, !tbaa !13
  %indvars.iv.next87.1 = add nuw nsw i64 %indvars.iv86, 2
  %89 = getelementptr inbounds [2000 x i32], ptr @dp, i64 0, i64 %indvars.iv.next87.1
  %90 = load i32, ptr %89, align 4, !tbaa !5
  %91 = sext i32 %90 to i64
  %92 = add nsw i64 %87, %91
  %93 = getelementptr inbounds [2000 x i64], ptr @sum, i64 0, i64 %indvars.iv.next87.1
  store i64 %92, ptr %93, align 8, !tbaa !13
  %indvars.iv.next87.2 = add nuw nsw i64 %indvars.iv86, 3
  %94 = getelementptr inbounds [2000 x i32], ptr @dp, i64 0, i64 %indvars.iv.next87.2
  %95 = load i32, ptr %94, align 4, !tbaa !5
  %96 = sext i32 %95 to i64
  %97 = add nsw i64 %92, %96
  %98 = getelementptr inbounds [2000 x i64], ptr @sum, i64 0, i64 %indvars.iv.next87.2
  store i64 %97, ptr %98, align 8, !tbaa !13
  %indvars.iv.next87.3 = add nuw nsw i64 %indvars.iv86, 4
  %niter125.next.3 = add i64 %niter125, 4
  %niter125.ncmp.3 = icmp eq i64 %niter125.next.3, %unroll_iter124
  br i1 %niter125.ncmp.3, label %.preheader53.loopexit.unr-lcssa, label %.lr.ph66, !llvm.loop !20

.preheader:                                       ; preds = %.preheader.preheader, %.loopexit
  %99 = phi i64 [ %res.promoted68, %.preheader.preheader ], [ %120, %.loopexit ]
  %indvars.iv91 = phi i64 [ 0, %.preheader.preheader ], [ %indvars.iv.next94.peel, %.loopexit ]
  %res.promoted7172 = phi i64 [ %res.promoted68, %.preheader.preheader ], [ %res.promoted69, %.loopexit ]
  %100 = getelementptr inbounds [2000 x [2000 x i32]], ptr @palin, i64 0, i64 %indvars.iv91, i64 0
  %101 = load i32, ptr %100, align 16, !tbaa !5
  %102 = icmp eq i32 %101, 1
  br i1 %102, label %103, label %104

103:                                              ; preds = %.preheader
  store i64 %res.promoted7172, ptr @res, align 8, !tbaa !13
  br label %104

104:                                              ; preds = %103, %.preheader
  %105 = phi i64 [ %res.promoted7172, %103 ], [ %99, %.preheader ]
  %indvars.iv.next94.peel = add nuw nsw i64 %indvars.iv91, 1
  %exitcond97.peel.not = icmp eq i64 %indvars.iv.next94.peel, %wide.trip.count100
  br i1 %exitcond97.peel.not, label %._crit_edge74, label %.peel.next

._crit_edge74:                                    ; preds = %104, %.loopexit, %.preheader53
  %106 = phi i64 [ %res.promoted68, %.preheader53 ], [ %105, %104 ], [ %120, %.loopexit ]
  %107 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %106)
          to label %122 unwind label %11

.loopexit:                                        ; preds = %119
  br i1 %exitcond97.peel.not, label %._crit_edge74, label %.preheader, !llvm.loop !21

.peel.next:                                       ; preds = %104, %119
  %108 = phi i64 [ %120, %119 ], [ %105, %104 ]
  %indvars.iv93 = phi i64 [ %indvars.iv.next94, %119 ], [ %indvars.iv.next94.peel, %104 ]
  %res.promoted70 = phi i64 [ %res.promoted69, %119 ], [ %res.promoted7172, %104 ]
  %109 = phi i64 [ %121, %119 ], [ %res.promoted7172, %104 ]
  %110 = sub nuw nsw i64 %indvars.iv93, %indvars.iv91
  %111 = getelementptr inbounds [2000 x [2000 x i32]], ptr @palin, i64 0, i64 %indvars.iv93, i64 %110
  %112 = load i32, ptr %111, align 4, !tbaa !5
  %113 = icmp eq i32 %112, 1
  br i1 %113, label %114, label %119

114:                                              ; preds = %.peel.next
  %115 = add nsw i64 %110, -1
  %116 = getelementptr inbounds [2000 x i64], ptr @sum, i64 0, i64 %115
  %117 = load i64, ptr %116, align 8, !tbaa !13
  %118 = add nsw i64 %109, %117
  store i64 %118, ptr @res, align 8, !tbaa !13
  br label %119

119:                                              ; preds = %.peel.next, %114
  %120 = phi i64 [ %108, %.peel.next ], [ %118, %114 ]
  %res.promoted69 = phi i64 [ %res.promoted70, %.peel.next ], [ %118, %114 ]
  %121 = phi i64 [ %109, %.peel.next ], [ %118, %114 ]
  %indvars.iv.next94 = add nuw nsw i64 %indvars.iv93, 1
  %exitcond97.not = icmp eq i64 %indvars.iv.next94, %wide.trip.count100
  br i1 %exitcond97.not, label %.loopexit, label %.peel.next, !llvm.loop !22

122:                                              ; preds = %._crit_edge74
  %123 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %107, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %124 unwind label %11

124:                                              ; preds = %122
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %1) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %1) #6
  ret i32 0
}

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

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #2 align 2

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #3

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6lengthEv(ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #2 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32), i64 noundef) local_unnamed_addr #2 align 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 #4 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 #4 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)) #5

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #2 align 2

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

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

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


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