; LLVM IR from abeaumont/competitive-programming :: atcoder/dp (l)

; 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
@x = external dso_local global [3000 x i64], align 16
@dp = external dso_local global [3000 x [3000 x [2 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 {
  %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
  store i32 0, ptr %1, align 4
  %7 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %8 = getelementptr i8, ptr %7, i64 -24
  %9 = load i64, ptr %8, align 8
  %10 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %9
  %11 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %10, ptr noundef null)
  %12 = call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %13 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) @n)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #6
  store i32 0, ptr %2, align 4, !tbaa !8
  br label %14

14:                                               ; preds = %25, %0
  %15 = load i32, ptr %2, align 4, !tbaa !8
  %16 = sext i32 %15 to i64
  %17 = load i64, ptr @n, align 8, !tbaa !11
  %18 = icmp slt i64 %16, %17
  br i1 %18, label %20, label %19

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

20:                                               ; preds = %14
  %21 = load i32, ptr %2, align 4, !tbaa !8
  %22 = sext i32 %21 to i64
  %23 = getelementptr inbounds [3000 x i64], ptr @x, i64 0, i64 %22
  %24 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %23)
  br label %25

25:                                               ; preds = %20
  %26 = load i32, ptr %2, align 4, !tbaa !8
  %27 = add nsw i32 %26, 1
  store i32 %27, ptr %2, align 4, !tbaa !8
  br label %14, !llvm.loop !13

28:                                               ; preds = %19
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #6
  store i32 0, ptr %3, align 4, !tbaa !8
  br label %29

29:                                               ; preds = %47, %28
  %30 = load i32, ptr %3, align 4, !tbaa !8
  %31 = sext i32 %30 to i64
  %32 = load i64, ptr @n, align 8, !tbaa !11
  %33 = icmp slt i64 %31, %32
  br i1 %33, label %35, label %34

34:                                               ; preds = %29
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #6
  br label %50

35:                                               ; preds = %29
  %36 = load i32, ptr %3, align 4, !tbaa !8
  %37 = sext i32 %36 to i64
  %38 = getelementptr inbounds [3000 x i64], ptr @x, i64 0, i64 %37
  %39 = load i64, ptr %38, align 8, !tbaa !11
  %40 = load i32, ptr %3, align 4, !tbaa !8
  %41 = sext i32 %40 to i64
  %42 = getelementptr inbounds [3000 x [3000 x [2 x i64]]], ptr @dp, i64 0, i64 %41
  %43 = load i32, ptr %3, align 4, !tbaa !8
  %44 = sext i32 %43 to i64
  %45 = getelementptr inbounds [3000 x [2 x i64]], ptr %42, i64 0, i64 %44
  %46 = getelementptr inbounds [2 x i64], ptr %45, i64 0, i64 0
  store i64 %39, ptr %46, align 16, !tbaa !11
  br label %47

47:                                               ; preds = %35
  %48 = load i32, ptr %3, align 4, !tbaa !8
  %49 = add nsw i32 %48, 1
  store i32 %49, ptr %3, align 4, !tbaa !8
  br label %29, !llvm.loop !15

50:                                               ; preds = %34
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #6
  store i32 1, ptr %4, align 4, !tbaa !8
  br label %51

51:                                               ; preds = %201, %50
  %52 = load i32, ptr %4, align 4, !tbaa !8
  %53 = sext i32 %52 to i64
  %54 = load i64, ptr @n, align 8, !tbaa !11
  %55 = icmp slt i64 %53, %54
  br i1 %55, label %57, label %56

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

57:                                               ; preds = %51
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  store i32 0, ptr %6, align 4, !tbaa !8
  br label %58

58:                                               ; preds = %197, %57
  %59 = load i32, ptr %6, align 4, !tbaa !8
  %60 = load i32, ptr %4, align 4, !tbaa !8
  %61 = add nsw i32 %59, %60
  %62 = sext i32 %61 to i64
  %63 = load i64, ptr @n, align 8, !tbaa !11
  %64 = icmp slt i64 %62, %63
  br i1 %64, label %66, label %65

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

66:                                               ; preds = %58
  %67 = load i32, ptr %6, align 4, !tbaa !8
  %68 = sext i32 %67 to i64
  %69 = getelementptr inbounds [3000 x [3000 x [2 x i64]]], ptr @dp, i64 0, i64 %68
  %70 = load i32, ptr %6, align 4, !tbaa !8
  %71 = load i32, ptr %4, align 4, !tbaa !8
  %72 = add nsw i32 %70, %71
  %73 = sub nsw i32 %72, 1
  %74 = sext i32 %73 to i64
  %75 = getelementptr inbounds [3000 x [2 x i64]], ptr %69, i64 0, i64 %74
  %76 = getelementptr inbounds [2 x i64], ptr %75, i64 0, i64 1
  %77 = load i64, ptr %76, align 8, !tbaa !11
  %78 = load i32, ptr %6, align 4, !tbaa !8
  %79 = load i32, ptr %4, align 4, !tbaa !8
  %80 = add nsw i32 %78, %79
  %81 = sext i32 %80 to i64
  %82 = getelementptr inbounds [3000 x i64], ptr @x, i64 0, i64 %81
  %83 = load i64, ptr %82, align 8, !tbaa !11
  %84 = add nsw i64 %77, %83
  %85 = load i32, ptr %6, align 4, !tbaa !8
  %86 = add nsw i32 %85, 1
  %87 = sext i32 %86 to i64
  %88 = getelementptr inbounds [3000 x [3000 x [2 x i64]]], ptr @dp, i64 0, i64 %87
  %89 = load i32, ptr %6, align 4, !tbaa !8
  %90 = load i32, ptr %4, align 4, !tbaa !8
  %91 = add nsw i32 %89, %90
  %92 = sext i32 %91 to i64
  %93 = getelementptr inbounds [3000 x [2 x i64]], ptr %88, i64 0, i64 %92
  %94 = getelementptr inbounds [2 x i64], ptr %93, i64 0, i64 1
  %95 = load i64, ptr %94, align 8, !tbaa !11
  %96 = load i32, ptr %6, align 4, !tbaa !8
  %97 = sext i32 %96 to i64
  %98 = getelementptr inbounds [3000 x i64], ptr @x, i64 0, i64 %97
  %99 = load i64, ptr %98, align 8, !tbaa !11
  %100 = add nsw i64 %95, %99
  %101 = icmp sgt i64 %84, %100
  br i1 %101, label %102, label %150

102:                                              ; preds = %66
  %103 = load i32, ptr %6, align 4, !tbaa !8
  %104 = sext i32 %103 to i64
  %105 = getelementptr inbounds [3000 x [3000 x [2 x i64]]], ptr @dp, i64 0, i64 %104
  %106 = load i32, ptr %6, align 4, !tbaa !8
  %107 = load i32, ptr %4, align 4, !tbaa !8
  %108 = add nsw i32 %106, %107
  %109 = sub nsw i32 %108, 1
  %110 = sext i32 %109 to i64
  %111 = getelementptr inbounds [3000 x [2 x i64]], ptr %105, i64 0, i64 %110
  %112 = getelementptr inbounds [2 x i64], ptr %111, i64 0, i64 1
  %113 = load i64, ptr %112, align 8, !tbaa !11
  %114 = load i32, ptr %6, align 4, !tbaa !8
  %115 = load i32, ptr %4, align 4, !tbaa !8
  %116 = add nsw i32 %114, %115
  %117 = sext i32 %116 to i64
  %118 = getelementptr inbounds [3000 x i64], ptr @x, i64 0, i64 %117
  %119 = load i64, ptr %118, align 8, !tbaa !11
  %120 = add nsw i64 %113, %119
  %121 = load i32, ptr %6, align 4, !tbaa !8
  %122 = sext i32 %121 to i64
  %123 = getelementptr inbounds [3000 x [3000 x [2 x i64]]], ptr @dp, i64 0, i64 %122
  %124 = load i32, ptr %6, align 4, !tbaa !8
  %125 = load i32, ptr %4, align 4, !tbaa !8
  %126 = add nsw i32 %124, %125
  %127 = sext i32 %126 to i64
  %128 = getelementptr inbounds [3000 x [2 x i64]], ptr %123, i64 0, i64 %127
  %129 = getelementptr inbounds [2 x i64], ptr %128, i64 0, i64 0
  store i64 %120, ptr %129, align 16, !tbaa !11
  %130 = load i32, ptr %6, align 4, !tbaa !8
  %131 = sext i32 %130 to i64
  %132 = getelementptr inbounds [3000 x [3000 x [2 x i64]]], ptr @dp, i64 0, i64 %131
  %133 = load i32, ptr %6, align 4, !tbaa !8
  %134 = load i32, ptr %4, align 4, !tbaa !8
  %135 = add nsw i32 %133, %134
  %136 = sub nsw i32 %135, 1
  %137 = sext i32 %136 to i64
  %138 = getelementptr inbounds [3000 x [2 x i64]], ptr %132, i64 0, i64 %137
  %139 = getelementptr inbounds [2 x i64], ptr %138, i64 0, i64 0
  %140 = load i64, ptr %139, align 16, !tbaa !11
  %141 = load i32, ptr %6, align 4, !tbaa !8
  %142 = sext i32 %141 to i64
  %143 = getelementptr inbounds [3000 x [3000 x [2 x i64]]], ptr @dp, i64 0, i64 %142
  %144 = load i32, ptr %6, align 4, !tbaa !8
  %145 = load i32, ptr %4, align 4, !tbaa !8
  %146 = add nsw i32 %144, %145
  %147 = sext i32 %146 to i64
  %148 = getelementptr inbounds [3000 x [2 x i64]], ptr %143, i64 0, i64 %147
  %149 = getelementptr inbounds [2 x i64], ptr %148, i64 0, i64 1
  store i64 %140, ptr %149, align 8, !tbaa !11
  br label %196

150:                                              ; preds = %66
  %151 = load i32, ptr %6, align 4, !tbaa !8
  %152 = add nsw i32 %151, 1
  %153 = sext i32 %152 to i64
  %154 = getelementptr inbounds [3000 x [3000 x [2 x i64]]], ptr @dp, i64 0, i64 %153
  %155 = load i32, ptr %6, align 4, !tbaa !8
  %156 = load i32, ptr %4, align 4, !tbaa !8
  %157 = add nsw i32 %155, %156
  %158 = sext i32 %157 to i64
  %159 = getelementptr inbounds [3000 x [2 x i64]], ptr %154, i64 0, i64 %158
  %160 = getelementptr inbounds [2 x i64], ptr %159, i64 0, i64 1
  %161 = load i64, ptr %160, align 8, !tbaa !11
  %162 = load i32, ptr %6, align 4, !tbaa !8
  %163 = sext i32 %162 to i64
  %164 = getelementptr inbounds [3000 x i64], ptr @x, i64 0, i64 %163
  %165 = load i64, ptr %164, align 8, !tbaa !11
  %166 = add nsw i64 %161, %165
  %167 = load i32, ptr %6, align 4, !tbaa !8
  %168 = sext i32 %167 to i64
  %169 = getelementptr inbounds [3000 x [3000 x [2 x i64]]], ptr @dp, i64 0, i64 %168
  %170 = load i32, ptr %6, align 4, !tbaa !8
  %171 = load i32, ptr %4, align 4, !tbaa !8
  %172 = add nsw i32 %170, %171
  %173 = sext i32 %172 to i64
  %174 = getelementptr inbounds [3000 x [2 x i64]], ptr %169, i64 0, i64 %173
  %175 = getelementptr inbounds [2 x i64], ptr %174, i64 0, i64 0
  store i64 %166, ptr %175, align 16, !tbaa !11
  %176 = load i32, ptr %6, align 4, !tbaa !8
  %177 = add nsw i32 %176, 1
  %178 = sext i32 %177 to i64
  %179 = getelementptr inbounds [3000 x [3000 x [2 x i64]]], ptr @dp, i64 0, i64 %178
  %180 = load i32, ptr %6, align 4, !tbaa !8
  %181 = load i32, ptr %4, align 4, !tbaa !8
  %182 = add nsw i32 %180, %181
  %183 = sext i32 %182 to i64
  %184 = getelementptr inbounds [3000 x [2 x i64]], ptr %179, i64 0, i64 %183
  %185 = getelementptr inbounds [2 x i64], ptr %184, i64 0, i64 0
  %186 = load i64, ptr %185, align 16, !tbaa !11
  %187 = load i32, ptr %6, align 4, !tbaa !8
  %188 = sext i32 %187 to i64
  %189 = getelementptr inbounds [3000 x [3000 x [2 x i64]]], ptr @dp, i64 0, i64 %188
  %190 = load i32, ptr %6, align 4, !tbaa !8
  %191 = load i32, ptr %4, align 4, !tbaa !8
  %192 = add nsw i32 %190, %191
  %193 = sext i32 %192 to i64
  %194 = getelementptr inbounds [3000 x [2 x i64]], ptr %189, i64 0, i64 %193
  %195 = getelementptr inbounds [2 x i64], ptr %194, i64 0, i64 1
  store i64 %186, ptr %195, align 8, !tbaa !11
  br label %196

196:                                              ; preds = %150, %102
  br label %197

197:                                              ; preds = %196
  %198 = load i32, ptr %6, align 4, !tbaa !8
  %199 = add nsw i32 %198, 1
  store i32 %199, ptr %6, align 4, !tbaa !8
  br label %58, !llvm.loop !16

200:                                              ; preds = %65
  br label %201

201:                                              ; preds = %200
  %202 = load i32, ptr %4, align 4, !tbaa !8
  %203 = add nsw i32 %202, 1
  store i32 %203, ptr %4, align 4, !tbaa !8
  br label %51, !llvm.loop !17

204:                                              ; preds = %56
  %205 = load i64, ptr @n, align 8, !tbaa !11
  %206 = sub nsw i64 %205, 1
  %207 = getelementptr inbounds [3000 x [2 x i64]], ptr @dp, i64 0, i64 %206
  %208 = getelementptr inbounds [2 x i64], ptr %207, i64 0, i64 0
  %209 = load i64, ptr %208, align 16, !tbaa !11
  %210 = load i64, ptr @n, align 8, !tbaa !11
  %211 = sub nsw i64 %210, 1
  %212 = getelementptr inbounds [3000 x [2 x i64]], ptr @dp, i64 0, i64 %211
  %213 = getelementptr inbounds [2 x i64], ptr %212, i64 0, i64 1
  %214 = load i64, ptr %213, align 8, !tbaa !11
  %215 = sub nsw i64 %209, %214
  %216 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %215)
  %217 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %216, i8 noundef signext 10)
  %218 = load i32, ptr %1, align 4
  ret i32 %218
}

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

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

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8), i8 noundef signext) #5

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

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

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

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


; 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
@x = external dso_local global [3000 x i64], align 16
@dp = external dso_local local_unnamed_addr global [3000 x [3000 x [2 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 {
  %1 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %2 = getelementptr i8, ptr %1, i64 -24
  %3 = load i64, ptr %2, align 8
  %4 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %3
  %5 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %4, ptr noundef null)
  %6 = tail call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %7 = 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)
  %8 = load i64, ptr @n, align 8, !tbaa !8
  %9 = icmp sgt i64 %8, 0
  br i1 %9, label %.lr.ph, label %._crit_edge67

.preheader60:                                     ; preds = %.lr.ph
  %10 = icmp sgt i64 %14, 0
  br i1 %10, label %.lr.ph63.preheader, label %._crit_edge67

.lr.ph63.preheader:                               ; preds = %.preheader60
  %xtraiter = and i64 %14, 3
  %11 = icmp ult i64 %14, 4
  br i1 %11, label %.preheader59.unr-lcssa, label %.lr.ph63.preheader.new

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

.lr.ph:                                           ; preds = %0, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %0 ]
  %12 = getelementptr inbounds [3000 x i64], ptr @x, i64 0, i64 %indvars.iv
  %13 = 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) %12)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %14 = load i64, ptr @n, align 8, !tbaa !8
  %15 = icmp sgt i64 %14, %indvars.iv.next
  br i1 %15, label %.lr.ph, label %.preheader60, !llvm.loop !11

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

.lr.ph63.epil:                                    ; preds = %.preheader59.unr-lcssa, %.lr.ph63.epil
  %indvars.iv70.epil = phi i64 [ %indvars.iv.next71.epil, %.lr.ph63.epil ], [ %indvars.iv70.unr, %.preheader59.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.lr.ph63.epil ], [ 0, %.preheader59.unr-lcssa ]
  %16 = getelementptr inbounds [3000 x i64], ptr @x, i64 0, i64 %indvars.iv70.epil
  %17 = load i64, ptr %16, align 8, !tbaa !8
  %18 = getelementptr inbounds [3000 x [3000 x [2 x i64]]], ptr @dp, i64 0, i64 %indvars.iv70.epil, i64 %indvars.iv70.epil
  store i64 %17, ptr %18, align 16, !tbaa !8
  %indvars.iv.next71.epil = add nuw nsw i64 %indvars.iv70.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 %.preheader59, label %.lr.ph63.epil, !llvm.loop !13

.preheader59:                                     ; preds = %.lr.ph63.epil, %.preheader59.unr-lcssa
  %.not = icmp eq i64 %14, 1
  br i1 %.not, label %._crit_edge67, label %.lr.ph65.preheader

.lr.ph63:                                         ; preds = %.lr.ph63, %.lr.ph63.preheader.new
  %indvars.iv70 = phi i64 [ 0, %.lr.ph63.preheader.new ], [ %indvars.iv.next71.3, %.lr.ph63 ]
  %niter = phi i64 [ 0, %.lr.ph63.preheader.new ], [ %niter.next.3, %.lr.ph63 ]
  %19 = getelementptr inbounds [3000 x i64], ptr @x, i64 0, i64 %indvars.iv70
  %20 = load i64, ptr %19, align 16, !tbaa !8
  %21 = getelementptr inbounds [3000 x [3000 x [2 x i64]]], ptr @dp, i64 0, i64 %indvars.iv70, i64 %indvars.iv70
  store i64 %20, ptr %21, align 16, !tbaa !8
  %indvars.iv.next71 = or disjoint i64 %indvars.iv70, 1
  %22 = getelementptr inbounds [3000 x i64], ptr @x, i64 0, i64 %indvars.iv.next71
  %23 = load i64, ptr %22, align 8, !tbaa !8
  %24 = getelementptr inbounds [3000 x [3000 x [2 x i64]]], ptr @dp, i64 0, i64 %indvars.iv.next71, i64 %indvars.iv.next71
  store i64 %23, ptr %24, align 16, !tbaa !8
  %indvars.iv.next71.1 = or disjoint i64 %indvars.iv70, 2
  %25 = getelementptr inbounds [3000 x i64], ptr @x, i64 0, i64 %indvars.iv.next71.1
  %26 = load i64, ptr %25, align 16, !tbaa !8
  %27 = getelementptr inbounds [3000 x [3000 x [2 x i64]]], ptr @dp, i64 0, i64 %indvars.iv.next71.1, i64 %indvars.iv.next71.1
  store i64 %26, ptr %27, align 16, !tbaa !8
  %indvars.iv.next71.2 = or disjoint i64 %indvars.iv70, 3
  %28 = getelementptr inbounds [3000 x i64], ptr @x, i64 0, i64 %indvars.iv.next71.2
  %29 = load i64, ptr %28, align 8, !tbaa !8
  %30 = getelementptr inbounds [3000 x [3000 x [2 x i64]]], ptr @dp, i64 0, i64 %indvars.iv.next71.2, i64 %indvars.iv.next71.2
  store i64 %29, ptr %30, align 16, !tbaa !8
  %indvars.iv.next71.3 = add nuw nsw i64 %indvars.iv70, 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 %.preheader59.unr-lcssa, label %.lr.ph63, !llvm.loop !15

.lr.ph65.preheader:                               ; preds = %.preheader59, %._crit_edge
  %indvars.iv76 = phi i64 [ %indvars.iv.next77, %._crit_edge ], [ 1, %.preheader59 ]
  br label %.lr.ph65

._crit_edge67:                                    ; preds = %._crit_edge, %0, %.preheader60, %.preheader59
  %.lcssa8183 = phi i64 [ %14, %.preheader59 ], [ %14, %.preheader60 ], [ %8, %0 ], [ %14, %._crit_edge ]
  %31 = add nsw i64 %.lcssa8183, -1
  %32 = getelementptr inbounds [3000 x [2 x i64]], ptr @dp, i64 0, i64 %31
  %33 = load i64, ptr %32, align 16, !tbaa !8
  %34 = getelementptr inbounds i8, ptr %32, i64 8
  %35 = load i64, ptr %34, align 8, !tbaa !8
  %36 = sub nsw i64 %33, %35
  %37 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %36)
  %38 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %37, i8 noundef signext 10)
  ret i32 0

._crit_edge:                                      ; preds = %.lr.ph65
  %indvars.iv.next77 = add nuw nsw i64 %indvars.iv76, 1
  %exitcond79.not = icmp eq i64 %indvars.iv.next77, %14
  br i1 %exitcond79.not, label %._crit_edge67, label %.lr.ph65.preheader, !llvm.loop !16

.lr.ph65:                                         ; preds = %.lr.ph65.preheader, %.lr.ph65
  %indvars.iv73 = phi i64 [ 0, %.lr.ph65.preheader ], [ %indvars.iv.next74, %.lr.ph65 ]
  %39 = add nuw nsw i64 %indvars.iv73, %indvars.iv76
  %40 = add nuw nsw i64 %indvars.iv73, %indvars.iv76
  %41 = add nsw i64 %40, -1
  %42 = getelementptr inbounds [3000 x [3000 x [2 x i64]]], ptr @dp, i64 0, i64 %indvars.iv73, i64 %41
  %43 = getelementptr inbounds i8, ptr %42, i64 8
  %44 = load i64, ptr %43, align 8, !tbaa !8
  %45 = getelementptr inbounds [3000 x i64], ptr @x, i64 0, i64 %39
  %46 = load i64, ptr %45, align 8, !tbaa !8
  %47 = add nsw i64 %46, %44
  %indvars.iv.next74 = add nuw nsw i64 %indvars.iv73, 1
  %48 = getelementptr inbounds [3000 x [3000 x [2 x i64]]], ptr @dp, i64 0, i64 %indvars.iv.next74, i64 %39
  %49 = getelementptr inbounds i8, ptr %48, i64 8
  %50 = load i64, ptr %49, align 8, !tbaa !8
  %51 = getelementptr inbounds [3000 x i64], ptr @x, i64 0, i64 %indvars.iv73
  %52 = load i64, ptr %51, align 8, !tbaa !8
  %53 = add nsw i64 %52, %50
  %54 = icmp sgt i64 %47, %53
  %55 = getelementptr inbounds [3000 x [3000 x [2 x i64]]], ptr @dp, i64 0, i64 %indvars.iv73, i64 %39
  %56 = getelementptr inbounds i8, ptr %55, i64 8
  %. = tail call i64 @llvm.smax.i64(i64 %47, i64 %53)
  %.85 = select i1 %54, ptr %42, ptr %48
  store i64 %., ptr %55, align 16, !tbaa !8
  %57 = load i64, ptr %.85, align 16, !tbaa !8
  store i64 %57, ptr %56, align 8, !tbaa !8
  %58 = add nuw nsw i64 %indvars.iv.next74, %indvars.iv76
  %59 = icmp ugt i64 %14, %58
  br i1 %59, label %.lr.ph65, label %._crit_edge, !llvm.loop !17
}

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

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

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

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smax.i64(i64, i64) #5

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

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

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


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