; LLVM IR from eyangch/competitive-programming :: Codeforces/1621 (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::initializer_list" = type { ptr, i64 }

@T = external dso_local global i64, align 8
@N = external dso_local global i64, align 8
@c = external dso_local global [500 x [500 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 i64, align 8
  %3 = alloca i32, align 4
  %4 = alloca i64, align 8
  %5 = alloca i64, align 8
  %6 = alloca i64, align 8
  %7 = alloca i64, align 8
  %8 = alloca %"class.std::initializer_list", align 8
  %9 = alloca [8 x i64], align 8
  store i32 0, ptr %1, align 4
  %10 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %11 = getelementptr i8, ptr %10, i64 -24
  %12 = load i64, ptr %11, align 8
  %13 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %12
  %14 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %13, ptr noundef null)
  %15 = call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %16 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) @T)
  br label %17

17:                                               ; preds = %80, %0
  %18 = load i64, ptr @T, align 8, !tbaa !8
  %19 = add nsw i64 %18, -1
  store i64 %19, ptr @T, align 8, !tbaa !8
  %20 = icmp ne i64 %18, 0
  br i1 %20, label %21, label %146

21:                                               ; preds = %17
  %22 = 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 8, ptr %2) #6
  store i64 0, ptr %2, align 8, !tbaa !8
  br label %23

23:                                               ; preds = %46, %21
  %24 = load i64, ptr %2, align 8, !tbaa !8
  %25 = load i64, ptr @N, align 8, !tbaa !8
  %26 = mul nsw i64 2, %25
  %27 = icmp slt i64 %24, %26
  br i1 %27, label %29, label %28

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

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

30:                                               ; preds = %42, %29
  %31 = load i64, ptr %4, align 8, !tbaa !8
  %32 = load i64, ptr @N, align 8, !tbaa !8
  %33 = mul nsw i64 2, %32
  %34 = icmp slt i64 %31, %33
  br i1 %34, label %36, label %35

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

36:                                               ; preds = %30
  %37 = load i64, ptr %2, align 8, !tbaa !8
  %38 = getelementptr inbounds [500 x [500 x i64]], ptr @c, i64 0, i64 %37
  %39 = load i64, ptr %4, align 8, !tbaa !8
  %40 = getelementptr inbounds [500 x i64], ptr %38, i64 0, i64 %39
  %41 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %40)
  br label %42

42:                                               ; preds = %36
  %43 = load i64, ptr %4, align 8, !tbaa !8
  %44 = add nsw i64 %43, 1
  store i64 %44, ptr %4, align 8, !tbaa !8
  br label %30, !llvm.loop !11

45:                                               ; preds = %35
  br label %46

46:                                               ; preds = %45
  %47 = load i64, ptr %2, align 8, !tbaa !8
  %48 = add nsw i64 %47, 1
  store i64 %48, ptr %2, align 8, !tbaa !8
  br label %23, !llvm.loop !13

49:                                               ; preds = %28
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #6
  store i64 0, ptr %5, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #6
  %50 = load i64, ptr @N, align 8, !tbaa !8
  store i64 %50, ptr %6, align 8, !tbaa !8
  br label %51

51:                                               ; preds = %77, %49
  %52 = load i64, ptr %6, align 8, !tbaa !8
  %53 = load i64, ptr @N, align 8, !tbaa !8
  %54 = mul nsw i64 2, %53
  %55 = icmp slt i64 %52, %54
  br i1 %55, label %57, label %56

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

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

59:                                               ; preds = %73, %57
  %60 = load i64, ptr %7, align 8, !tbaa !8
  %61 = load i64, ptr @N, align 8, !tbaa !8
  %62 = mul nsw i64 2, %61
  %63 = icmp slt i64 %60, %62
  br i1 %63, label %65, label %64

64:                                               ; preds = %59
  store i32 13, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  br label %76

65:                                               ; preds = %59
  %66 = load i64, ptr %6, align 8, !tbaa !8
  %67 = getelementptr inbounds [500 x [500 x i64]], ptr @c, i64 0, i64 %66
  %68 = load i64, ptr %7, align 8, !tbaa !8
  %69 = getelementptr inbounds [500 x i64], ptr %67, i64 0, i64 %68
  %70 = load i64, ptr %69, align 8, !tbaa !8
  %71 = load i64, ptr %5, align 8, !tbaa !8
  %72 = add nsw i64 %71, %70
  store i64 %72, ptr %5, align 8, !tbaa !8
  br label %73

73:                                               ; preds = %65
  %74 = load i64, ptr %7, align 8, !tbaa !8
  %75 = add nsw i64 %74, 1
  store i64 %75, ptr %7, align 8, !tbaa !8
  br label %59, !llvm.loop !14

76:                                               ; preds = %64
  br label %77

77:                                               ; preds = %76
  %78 = load i64, ptr %6, align 8, !tbaa !8
  %79 = add nsw i64 %78, 1
  store i64 %79, ptr %6, align 8, !tbaa !8
  br label %51, !llvm.loop !15

80:                                               ; preds = %56
  call void @llvm.lifetime.start.p0(i64 64, ptr %9) #6
  %81 = load i64, ptr @N, align 8, !tbaa !8
  %82 = getelementptr inbounds [500 x i64], ptr @c, i64 0, i64 %81
  %83 = load i64, ptr %82, align 8, !tbaa !8
  store i64 %83, ptr %9, align 8, !tbaa !8
  %84 = getelementptr inbounds i64, ptr %9, i64 1
  %85 = load i64, ptr @N, align 8, !tbaa !8
  %86 = getelementptr inbounds [500 x [500 x i64]], ptr @c, i64 0, i64 %85
  %87 = getelementptr inbounds [500 x i64], ptr %86, i64 0, i64 0
  %88 = load i64, ptr %87, align 16, !tbaa !8
  store i64 %88, ptr %84, align 8, !tbaa !8
  %89 = getelementptr inbounds i64, ptr %9, i64 2
  %90 = load i64, ptr @N, align 8, !tbaa !8
  %91 = sub nsw i64 %90, 1
  %92 = getelementptr inbounds [500 x [500 x i64]], ptr @c, i64 0, i64 %91
  %93 = load i64, ptr @N, align 8, !tbaa !8
  %94 = getelementptr inbounds [500 x i64], ptr %92, i64 0, i64 %93
  %95 = load i64, ptr %94, align 8, !tbaa !8
  store i64 %95, ptr %89, align 8, !tbaa !8
  %96 = getelementptr inbounds i64, ptr %9, i64 3
  %97 = load i64, ptr @N, align 8, !tbaa !8
  %98 = getelementptr inbounds [500 x [500 x i64]], ptr @c, i64 0, i64 %97
  %99 = load i64, ptr @N, align 8, !tbaa !8
  %100 = sub nsw i64 %99, 1
  %101 = getelementptr inbounds [500 x i64], ptr %98, i64 0, i64 %100
  %102 = load i64, ptr %101, align 8, !tbaa !8
  store i64 %102, ptr %96, align 8, !tbaa !8
  %103 = getelementptr inbounds i64, ptr %9, i64 4
  %104 = load i64, ptr @N, align 8, !tbaa !8
  %105 = sub nsw i64 %104, 1
  %106 = getelementptr inbounds [500 x [500 x i64]], ptr @c, i64 0, i64 %105
  %107 = load i64, ptr @N, align 8, !tbaa !8
  %108 = mul nsw i64 2, %107
  %109 = sub nsw i64 %108, 1
  %110 = getelementptr inbounds [500 x i64], ptr %106, i64 0, i64 %109
  %111 = load i64, ptr %110, align 8, !tbaa !8
  store i64 %111, ptr %103, align 8, !tbaa !8
  %112 = getelementptr inbounds i64, ptr %9, i64 5
  %113 = load i64, ptr @N, align 8, !tbaa !8
  %114 = mul nsw i64 2, %113
  %115 = sub nsw i64 %114, 1
  %116 = getelementptr inbounds [500 x [500 x i64]], ptr @c, i64 0, i64 %115
  %117 = load i64, ptr @N, align 8, !tbaa !8
  %118 = sub nsw i64 %117, 1
  %119 = getelementptr inbounds [500 x i64], ptr %116, i64 0, i64 %118
  %120 = load i64, ptr %119, align 8, !tbaa !8
  store i64 %120, ptr %112, align 8, !tbaa !8
  %121 = getelementptr inbounds i64, ptr %9, i64 6
  %122 = load i64, ptr @N, align 8, !tbaa !8
  %123 = mul nsw i64 2, %122
  %124 = sub nsw i64 %123, 1
  %125 = getelementptr inbounds [500 x i64], ptr @c, i64 0, i64 %124
  %126 = load i64, ptr %125, align 8, !tbaa !8
  store i64 %126, ptr %121, align 8, !tbaa !8
  %127 = getelementptr inbounds i64, ptr %9, i64 7
  %128 = load i64, ptr @N, align 8, !tbaa !8
  %129 = mul nsw i64 2, %128
  %130 = sub nsw i64 %129, 1
  %131 = getelementptr inbounds [500 x [500 x i64]], ptr @c, i64 0, i64 %130
  %132 = getelementptr inbounds [500 x i64], ptr %131, i64 0, i64 0
  %133 = load i64, ptr %132, align 16, !tbaa !8
  store i64 %133, ptr %127, align 8, !tbaa !8
  %134 = getelementptr inbounds %"class.std::initializer_list", ptr %8, i32 0, i32 0
  store ptr %9, ptr %134, align 8, !tbaa !16
  %135 = getelementptr inbounds %"class.std::initializer_list", ptr %8, i32 0, i32 1
  store i64 8, ptr %135, align 8, !tbaa !20
  %136 = getelementptr inbounds { ptr, i64 }, ptr %8, i32 0, i32 0
  %137 = load ptr, ptr %136, align 8
  %138 = getelementptr inbounds { ptr, i64 }, ptr %8, i32 0, i32 1
  %139 = load i64, ptr %138, align 8
  %140 = call noundef i64 @_ZSt3minIxET_St16initializer_listIS0_E(ptr %137, i64 %139)
  %141 = load i64, ptr %5, align 8, !tbaa !8
  %142 = add nsw i64 %141, %140
  store i64 %142, ptr %5, align 8, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 64, ptr %9) #6
  %143 = load i64, ptr %5, align 8, !tbaa !8
  %144 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %143)
  %145 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %144, i8 noundef signext 10)
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #6
  br label %17, !llvm.loop !21

146:                                              ; preds = %17
  %147 = load i32, ptr %1, align 4
  ret i32 %147
}

; 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 dso_local noundef i64 @_ZSt3minIxET_St16initializer_listIS0_E(ptr, i64) #5

; 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 = !{!"long long", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !12}
!15 = distinct !{!15, !12}
!16 = !{!17, !18, i64 0}
!17 = !{!"_ZTSSt16initializer_listIxE", !18, i64 0, !19, i64 8}
!18 = !{!"any pointer", !10, i64 0}
!19 = !{!"long", !10, i64 0}
!20 = !{!17, !19, i64 8}
!21 = distinct !{!21, !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" }

@T = external dso_local global i64, align 8
@N = external dso_local global i64, align 8
@c = external dso_local global [500 x [500 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 = alloca [8 x i64], align 8
  %2 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %3 = getelementptr i8, ptr %2, i64 -24
  %4 = load i64, ptr %3, align 8
  %5 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %4
  %6 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %5, ptr noundef null)
  %7 = tail call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %8 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) @T)
  %9 = load i64, ptr @T, align 8, !tbaa !8
  %10 = add nsw i64 %9, -1
  store i64 %10, ptr @T, align 8, !tbaa !8
  %.not35 = icmp eq i64 %9, 0
  br i1 %.not35, label %._crit_edge38, label %.lr.ph37

.lr.ph37:                                         ; preds = %0
  %11 = getelementptr inbounds i8, ptr %1, i64 8
  %12 = getelementptr inbounds i8, ptr %1, i64 16
  %13 = getelementptr inbounds i8, ptr %1, i64 24
  %14 = getelementptr inbounds i8, ptr %1, i64 32
  %15 = getelementptr inbounds i8, ptr %1, i64 40
  %16 = getelementptr inbounds i8, ptr %1, i64 48
  %17 = getelementptr inbounds i8, ptr %1, i64 56
  br label %18

18:                                               ; preds = %.lr.ph37, %._crit_edge33.split.us
  %19 = 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)
  %20 = load i64, ptr @N, align 8, !tbaa !8
  %21 = shl nsw i64 %20, 1
  %22 = icmp sgt i64 %20, 0
  br i1 %22, label %.preheader20, label %.preheader21

.preheader21:                                     ; preds = %._crit_edge, %18
  %.lcssa22 = phi i64 [ %20, %18 ], [ %39, %._crit_edge ]
  %.lcssa = phi i64 [ %21, %18 ], [ %.pre-phi, %._crit_edge ]
  %23 = icmp slt i64 %.lcssa22, %.lcssa
  br i1 %23, label %.preheader.us.preheader, label %._crit_edge33.split.us

.preheader.us.preheader:                          ; preds = %.preheader21
  %24 = sub i64 %.lcssa, %.lcssa22
  %min.iters.check = icmp ult i64 %24, 4
  %n.vec = and i64 %24, -4
  %ind.end = add i64 %.lcssa22, %n.vec
  %cmp.n = icmp eq i64 %24, %n.vec
  br label %.preheader.us

.preheader.us:                                    ; preds = %.preheader.us.preheader, %._crit_edge29.us
  %.01732.us = phi i64 [ %36, %._crit_edge29.us ], [ %.lcssa22, %.preheader.us.preheader ]
  %.01831.us = phi i64 [ %.lcssa50, %._crit_edge29.us ], [ 0, %.preheader.us.preheader ]
  br i1 %min.iters.check, label %scalar.ph.preheader, label %vector.ph

vector.ph:                                        ; preds = %.preheader.us
  %25 = insertelement <2 x i64> <i64 poison, i64 0>, i64 %.01831.us, i64 0
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %vec.phi = phi <2 x i64> [ %25, %vector.ph ], [ %28, %vector.body ]
  %vec.phi51 = phi <2 x i64> [ zeroinitializer, %vector.ph ], [ %29, %vector.body ]
  %offset.idx = add i64 %.lcssa22, %index
  %26 = getelementptr inbounds [500 x [500 x i64]], ptr @c, i64 0, i64 %.01732.us, i64 %offset.idx
  %27 = getelementptr inbounds i8, ptr %26, i64 16
  %wide.load = load <2 x i64>, ptr %26, align 8, !tbaa !8
  %wide.load52 = load <2 x i64>, ptr %27, align 8, !tbaa !8
  %28 = add <2 x i64> %wide.load, %vec.phi
  %29 = add <2 x i64> %wide.load52, %vec.phi51
  %index.next = add nuw i64 %index, 4
  %30 = icmp eq i64 %index.next, %n.vec
  br i1 %30, label %middle.block, label %vector.body, !llvm.loop !11

middle.block:                                     ; preds = %vector.body
  %bin.rdx = add <2 x i64> %29, %28
  %31 = call i64 @llvm.vector.reduce.add.v2i64(<2 x i64> %bin.rdx)
  br i1 %cmp.n, label %._crit_edge29.us, label %scalar.ph.preheader

scalar.ph.preheader:                              ; preds = %middle.block, %.preheader.us
  %.01627.us.ph = phi i64 [ %.lcssa22, %.preheader.us ], [ %ind.end, %middle.block ]
  %.126.us.ph = phi i64 [ %.01831.us, %.preheader.us ], [ %31, %middle.block ]
  br label %scalar.ph

scalar.ph:                                        ; preds = %scalar.ph.preheader, %scalar.ph
  %.01627.us = phi i64 [ %35, %scalar.ph ], [ %.01627.us.ph, %scalar.ph.preheader ]
  %.126.us = phi i64 [ %34, %scalar.ph ], [ %.126.us.ph, %scalar.ph.preheader ]
  %32 = getelementptr inbounds [500 x [500 x i64]], ptr @c, i64 0, i64 %.01732.us, i64 %.01627.us
  %33 = load i64, ptr %32, align 8, !tbaa !8
  %34 = add nsw i64 %33, %.126.us
  %35 = add nsw i64 %.01627.us, 1
  %exitcond.not = icmp eq i64 %35, %.lcssa
  br i1 %exitcond.not, label %._crit_edge29.us, label %scalar.ph, !llvm.loop !15

._crit_edge29.us:                                 ; preds = %scalar.ph, %middle.block
  %.lcssa50 = phi i64 [ %31, %middle.block ], [ %34, %scalar.ph ]
  %36 = add nsw i64 %.01732.us, 1
  %exitcond42.not = icmp eq i64 %36, %.lcssa
  br i1 %exitcond42.not, label %._crit_edge33.split.us, label %.preheader.us, !llvm.loop !16

.preheader20:                                     ; preds = %18, %._crit_edge
  %37 = phi i64 [ %39, %._crit_edge ], [ %20, %18 ]
  %.024 = phi i64 [ %40, %._crit_edge ], [ 0, %18 ]
  %38 = icmp sgt i64 %37, 0
  br i1 %38, label %.lr.ph, label %.preheader20.._crit_edge_crit_edge

.preheader20.._crit_edge_crit_edge:               ; preds = %.preheader20
  %.pre = shl nsw i64 %37, 1
  br label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %.preheader20.._crit_edge_crit_edge
  %.pre-phi = phi i64 [ %.pre, %.preheader20.._crit_edge_crit_edge ], [ %46, %.lr.ph ]
  %39 = phi i64 [ %37, %.preheader20.._crit_edge_crit_edge ], [ %45, %.lr.ph ]
  %40 = add nuw nsw i64 %.024, 1
  %41 = icmp slt i64 %40, %.pre-phi
  br i1 %41, label %.preheader20, label %.preheader21, !llvm.loop !17

.lr.ph:                                           ; preds = %.preheader20, %.lr.ph
  %.01923 = phi i64 [ %44, %.lr.ph ], [ 0, %.preheader20 ]
  %42 = getelementptr inbounds [500 x [500 x i64]], ptr @c, i64 0, i64 %.024, i64 %.01923
  %43 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %42)
  %44 = add nuw nsw i64 %.01923, 1
  %45 = load i64, ptr @N, align 8, !tbaa !8
  %46 = shl nsw i64 %45, 1
  %47 = icmp slt i64 %44, %46
  br i1 %47, label %.lr.ph, label %._crit_edge, !llvm.loop !18

._crit_edge33.split.us:                           ; preds = %._crit_edge29.us, %.preheader21
  %.018.lcssa = phi i64 [ 0, %.preheader21 ], [ %.lcssa50, %._crit_edge29.us ]
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %1) #7
  %48 = getelementptr inbounds [500 x i64], ptr @c, i64 0, i64 %.lcssa22
  %49 = load i64, ptr %48, align 8, !tbaa !8
  store i64 %49, ptr %1, align 8, !tbaa !8
  %50 = getelementptr inbounds [500 x [500 x i64]], ptr @c, i64 0, i64 %.lcssa22
  %51 = load i64, ptr %50, align 16, !tbaa !8
  store i64 %51, ptr %11, align 8, !tbaa !8
  %52 = add nsw i64 %.lcssa22, -1
  %53 = getelementptr inbounds [500 x [500 x i64]], ptr @c, i64 0, i64 %52, i64 %.lcssa22
  %54 = load i64, ptr %53, align 8, !tbaa !8
  store i64 %54, ptr %12, align 8, !tbaa !8
  %55 = getelementptr inbounds [500 x [500 x i64]], ptr @c, i64 0, i64 %.lcssa22, i64 %52
  %56 = load i64, ptr %55, align 8, !tbaa !8
  store i64 %56, ptr %13, align 8, !tbaa !8
  %57 = add nsw i64 %.lcssa, -1
  %58 = getelementptr inbounds [500 x [500 x i64]], ptr @c, i64 0, i64 %52, i64 %57
  %59 = load i64, ptr %58, align 8, !tbaa !8
  store i64 %59, ptr %14, align 8, !tbaa !8
  %60 = getelementptr inbounds [500 x [500 x i64]], ptr @c, i64 0, i64 %57, i64 %52
  %61 = load i64, ptr %60, align 8, !tbaa !8
  store i64 %61, ptr %15, align 8, !tbaa !8
  %62 = getelementptr inbounds [500 x i64], ptr @c, i64 0, i64 %57
  %63 = load i64, ptr %62, align 8, !tbaa !8
  store i64 %63, ptr %16, align 8, !tbaa !8
  %64 = getelementptr inbounds [500 x [500 x i64]], ptr @c, i64 0, i64 %57
  %65 = load i64, ptr %64, align 16, !tbaa !8
  store i64 %65, ptr %17, align 8, !tbaa !8
  %66 = call noundef i64 @_ZSt3minIxET_St16initializer_listIS0_E(ptr nonnull %1, i64 8)
  %67 = add nsw i64 %66, %.018.lcssa
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %1) #7
  %68 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %67)
  %69 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %68, i8 noundef signext 10)
  %70 = load i64, ptr @T, align 8, !tbaa !8
  %71 = add nsw i64 %70, -1
  store i64 %71, ptr @T, align 8, !tbaa !8
  %.not = icmp eq i64 %70, 0
  br i1 %.not, label %._crit_edge38, label %18, !llvm.loop !19

._crit_edge38:                                    ; preds = %._crit_edge33.split.us, %0
  ret i32 0
}

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

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

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

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

; Function Attrs: mustprogress 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 dso_local noundef i64 @_ZSt3minIxET_St16initializer_listIS0_E(ptr, i64) local_unnamed_addr #5

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

; Function Attrs: mustprogress 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.vector.reduce.add.v2i64(<2 x i64>) #6

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

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

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


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