; LLVM IR from kazunetakahashi/atcoder :: 201510_201609/0904_AGC004 (B)

; 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 i64, align 8
@a = external dso_local global [2010 x i64], align 16
@b = external dso_local global [2010 x i64], align 16
@t = external dso_local global [2010 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 i64, 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 i64, align 8
  %10 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %11 = 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)
  %12 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) @x)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #5
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %13

13:                                               ; preds = %31, %0
  %14 = load i32, ptr %2, align 4, !tbaa !5
  %15 = sext i32 %14 to i64
  %16 = load i64, ptr @N, align 8, !tbaa !9
  %17 = icmp slt i64 %15, %16
  br i1 %17, label %19, label %18

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

19:                                               ; preds = %13
  %20 = load i32, ptr %2, align 4, !tbaa !5
  %21 = sext i32 %20 to i64
  %22 = getelementptr inbounds [2010 x i64], ptr @a, i64 0, i64 %21
  %23 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %22)
  %24 = load i32, ptr %2, align 4, !tbaa !5
  %25 = sext i32 %24 to i64
  %26 = getelementptr inbounds [2010 x i64], ptr @a, i64 0, i64 %25
  %27 = load i64, ptr %26, align 8, !tbaa !9
  %28 = load i32, ptr %2, align 4, !tbaa !5
  %29 = sext i32 %28 to i64
  %30 = getelementptr inbounds [2010 x i64], ptr @b, i64 0, i64 %29
  store i64 %27, ptr %30, align 8, !tbaa !9
  br label %31

31:                                               ; preds = %19
  %32 = load i32, ptr %2, align 4, !tbaa !5
  %33 = add nsw i32 %32, 1
  store i32 %33, ptr %2, align 4, !tbaa !5
  br label %13, !llvm.loop !11

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

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

40:                                               ; preds = %35
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #5
  br label %51

41:                                               ; preds = %35
  %42 = load i32, ptr %4, align 4, !tbaa !5
  %43 = sext i32 %42 to i64
  %44 = getelementptr inbounds [2010 x i64], ptr @a, i64 0, i64 %43
  %45 = load i64, ptr %44, align 8, !tbaa !9
  %46 = load i64, ptr %3, align 8, !tbaa !9
  %47 = add nsw i64 %46, %45
  store i64 %47, ptr %3, align 8, !tbaa !9
  br label %48

48:                                               ; preds = %41
  %49 = load i32, ptr %4, align 4, !tbaa !5
  %50 = add nsw i32 %49, 1
  store i32 %50, ptr %4, align 4, !tbaa !5
  br label %35, !llvm.loop !13

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

52:                                               ; preds = %128, %51
  %53 = load i32, ptr %5, align 4, !tbaa !5
  %54 = sext i32 %53 to i64
  %55 = load i64, ptr @N, align 8, !tbaa !9
  %56 = icmp slt i64 %54, %55
  br i1 %56, label %58, label %57

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

58:                                               ; preds = %52
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  store i32 0, ptr %7, align 4, !tbaa !5
  br label %59

59:                                               ; preds = %83, %58
  %60 = load i32, ptr %7, align 4, !tbaa !5
  %61 = sext i32 %60 to i64
  %62 = load i64, ptr @N, align 8, !tbaa !9
  %63 = icmp slt i64 %61, %62
  br i1 %63, label %65, label %64

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

65:                                               ; preds = %59
  %66 = load i32, ptr %7, align 4, !tbaa !5
  %67 = sext i32 %66 to i64
  %68 = getelementptr inbounds [2010 x i64], ptr @b, i64 0, i64 %67
  %69 = load i32, ptr %7, align 4, !tbaa !5
  %70 = load i32, ptr %5, align 4, !tbaa !5
  %71 = sub nsw i32 %69, %70
  %72 = sext i32 %71 to i64
  %73 = load i64, ptr @N, align 8, !tbaa !9
  %74 = add nsw i64 %72, %73
  %75 = load i64, ptr @N, align 8, !tbaa !9
  %76 = srem i64 %74, %75
  %77 = getelementptr inbounds [2010 x i64], ptr @a, i64 0, i64 %76
  %78 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %68, ptr noundef nonnull align 8 dereferenceable(8) %77)
  %79 = load i64, ptr %78, align 8, !tbaa !9
  %80 = load i32, ptr %7, align 4, !tbaa !5
  %81 = sext i32 %80 to i64
  %82 = getelementptr inbounds [2010 x i64], ptr @t, i64 0, i64 %81
  store i64 %79, ptr %82, align 8, !tbaa !9
  br label %83

83:                                               ; preds = %65
  %84 = load i32, ptr %7, align 4, !tbaa !5
  %85 = add nsw i32 %84, 1
  store i32 %85, ptr %7, align 4, !tbaa !5
  br label %59, !llvm.loop !14

86:                                               ; preds = %64
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  store i32 0, ptr %8, align 4, !tbaa !5
  br label %87

87:                                               ; preds = %101, %86
  %88 = load i32, ptr %8, align 4, !tbaa !5
  %89 = sext i32 %88 to i64
  %90 = load i64, ptr @N, align 8, !tbaa !9
  %91 = icmp slt i64 %89, %90
  br i1 %91, label %93, label %92

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

93:                                               ; preds = %87
  %94 = load i32, ptr %8, align 4, !tbaa !5
  %95 = sext i32 %94 to i64
  %96 = getelementptr inbounds [2010 x i64], ptr @t, i64 0, i64 %95
  %97 = load i64, ptr %96, align 8, !tbaa !9
  %98 = load i32, ptr %8, align 4, !tbaa !5
  %99 = sext i32 %98 to i64
  %100 = getelementptr inbounds [2010 x i64], ptr @b, i64 0, i64 %99
  store i64 %97, ptr %100, align 8, !tbaa !9
  br label %101

101:                                              ; preds = %93
  %102 = load i32, ptr %8, align 4, !tbaa !5
  %103 = add nsw i32 %102, 1
  store i32 %103, ptr %8, align 4, !tbaa !5
  br label %87, !llvm.loop !15

104:                                              ; preds = %92
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #5
  %105 = load i64, ptr @x, align 8, !tbaa !9
  %106 = load i32, ptr %5, align 4, !tbaa !5
  %107 = sext i32 %106 to i64
  %108 = mul nsw i64 %105, %107
  store i64 %108, ptr %9, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  store i32 0, ptr %10, align 4, !tbaa !5
  br label %109

109:                                              ; preds = %122, %104
  %110 = load i32, ptr %10, align 4, !tbaa !5
  %111 = sext i32 %110 to i64
  %112 = load i64, ptr @N, align 8, !tbaa !9
  %113 = icmp slt i64 %111, %112
  br i1 %113, label %115, label %114

114:                                              ; preds = %109
  store i32 17, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  br label %125

115:                                              ; preds = %109
  %116 = load i32, ptr %10, align 4, !tbaa !5
  %117 = sext i32 %116 to i64
  %118 = getelementptr inbounds [2010 x i64], ptr @b, i64 0, i64 %117
  %119 = load i64, ptr %118, align 8, !tbaa !9
  %120 = load i64, ptr %9, align 8, !tbaa !9
  %121 = add nsw i64 %120, %119
  store i64 %121, ptr %9, align 8, !tbaa !9
  br label %122

122:                                              ; preds = %115
  %123 = load i32, ptr %10, align 4, !tbaa !5
  %124 = add nsw i32 %123, 1
  store i32 %124, ptr %10, align 4, !tbaa !5
  br label %109, !llvm.loop !16

125:                                              ; preds = %114
  %126 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %9)
  %127 = load i64, ptr %126, align 8, !tbaa !9
  store i64 %127, ptr %3, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  br label %128

128:                                              ; preds = %125
  %129 = load i32, ptr %5, align 4, !tbaa !5
  %130 = add nsw i32 %129, 1
  store i32 %130, ptr %5, align 4, !tbaa !5
  br label %52, !llvm.loop !17

131:                                              ; preds = %57
  %132 = load i64, ptr %3, align 8, !tbaa !9
  %133 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %132)
  %134 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %133, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #5
  %135 = load i32, ptr %1, align 4
  ret i32 %135
}

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #3

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

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

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

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

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

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


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

%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }

@N = external dso_local global i64, align 8
@x = external dso_local global i64, align 8
@a = external dso_local global [2010 x i64], align 16
@b = external dso_local global [2010 x i64], align 16
@t = external dso_local local_unnamed_addr global [2010 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 i64, align 8
  %2 = alloca i64, align 8
  %3 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) @N)
  %4 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) @x)
  %5 = load i64, ptr @N, align 8, !tbaa !5
  %6 = icmp sgt i64 %5, 0
  br i1 %6, label %.lr.ph, label %._crit_edge.thread

._crit_edge.thread:                               ; preds = %0
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #7
  br label %.preheader38.thread

._crit_edge:                                      ; preds = %.lr.ph
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #7
  %7 = icmp sgt i64 %18, 0
  br i1 %7, label %.lr.ph44.preheader, label %.preheader38.thread

.lr.ph44.preheader:                               ; preds = %._crit_edge
  %min.iters.check = icmp ult i64 %18, 4
  br i1 %min.iters.check, label %.lr.ph44.preheader118, label %vector.ph

.lr.ph44.preheader118:                            ; preds = %middle.block, %.lr.ph44.preheader
  %indvars.iv65.ph = phi i64 [ 0, %.lr.ph44.preheader ], [ %n.vec, %middle.block ]
  %.ph119 = phi i64 [ 0, %.lr.ph44.preheader ], [ %13, %middle.block ]
  br label %.lr.ph44

vector.ph:                                        ; preds = %.lr.ph44.preheader
  %n.vec = and i64 %18, 9223372036854775804
  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> [ zeroinitializer, %vector.ph ], [ %10, %vector.body ]
  %vec.phi93 = phi <2 x i64> [ zeroinitializer, %vector.ph ], [ %11, %vector.body ]
  %8 = getelementptr inbounds [2010 x i64], ptr @a, i64 0, i64 %index
  %9 = getelementptr inbounds i8, ptr %8, i64 16
  %wide.load = load <2 x i64>, ptr %8, align 16, !tbaa !5
  %wide.load94 = load <2 x i64>, ptr %9, align 16, !tbaa !5
  %10 = add <2 x i64> %vec.phi, %wide.load
  %11 = add <2 x i64> %vec.phi93, %wide.load94
  %index.next = add nuw i64 %index, 4
  %12 = icmp eq i64 %index.next, %n.vec
  br i1 %12, label %middle.block, label %vector.body, !llvm.loop !9

middle.block:                                     ; preds = %vector.body
  %bin.rdx = add <2 x i64> %11, %10
  %13 = tail call i64 @llvm.vector.reduce.add.v2i64(<2 x i64> %bin.rdx)
  %cmp.n = icmp eq i64 %18, %n.vec
  br i1 %cmp.n, label %.preheader38, label %.lr.ph44.preheader118

.lr.ph:                                           ; preds = %0, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %0 ]
  %14 = getelementptr inbounds [2010 x i64], ptr @a, i64 0, i64 %indvars.iv
  %15 = 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) %14)
  %16 = load i64, ptr %14, align 8, !tbaa !5
  %17 = getelementptr inbounds [2010 x i64], ptr @b, i64 0, i64 %indvars.iv
  store i64 %16, ptr %17, align 8, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %18 = load i64, ptr @N, align 8, !tbaa !5
  %19 = icmp sgt i64 %18, %indvars.iv.next
  br i1 %19, label %.lr.ph, label %._crit_edge, !llvm.loop !13

.preheader38.thread:                              ; preds = %._crit_edge, %._crit_edge.thread
  store i64 0, ptr %1, align 8, !tbaa !5
  br label %._crit_edge59

.preheader38:                                     ; preds = %.lr.ph44, %middle.block
  %.lcssa91 = phi i64 [ %13, %middle.block ], [ %23, %.lr.ph44 ]
  store i64 %.lcssa91, ptr %1, align 8, !tbaa !5
  %.not = icmp eq i64 %18, 1
  br i1 %.not, label %._crit_edge59, label %.preheader37

.lr.ph44:                                         ; preds = %.lr.ph44.preheader118, %.lr.ph44
  %indvars.iv65 = phi i64 [ %indvars.iv.next66, %.lr.ph44 ], [ %indvars.iv65.ph, %.lr.ph44.preheader118 ]
  %20 = phi i64 [ %23, %.lr.ph44 ], [ %.ph119, %.lr.ph44.preheader118 ]
  %21 = getelementptr inbounds [2010 x i64], ptr @a, i64 0, i64 %indvars.iv65
  %22 = load i64, ptr %21, align 8, !tbaa !5
  %23 = add nsw i64 %20, %22
  %indvars.iv.next66 = add nuw nsw i64 %indvars.iv65, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next66, %18
  br i1 %exitcond.not, label %.preheader38, label %.lr.ph44, !llvm.loop !14

.preheader37:                                     ; preds = %.preheader38, %._crit_edge56
  %24 = phi i64 [ %55, %._crit_edge56 ], [ %18, %.preheader38 ]
  %indvars.iv78 = phi i64 [ %indvars.iv.next79, %._crit_edge56 ], [ 1, %.preheader38 ]
  %25 = icmp sgt i64 %24, 0
  br i1 %25, label %.lr.ph47, label %._crit_edge51.thread

._crit_edge59:                                    ; preds = %._crit_edge56, %.preheader38.thread, %.preheader38
  %26 = phi i64 [ %.lcssa91, %.preheader38 ], [ 0, %.preheader38.thread ], [ %54, %._crit_edge56 ]
  %27 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %26)
  %28 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %27, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #7
  ret i32 0

.preheader:                                       ; preds = %.lr.ph47
  %29 = icmp sgt i64 %39, 0
  br i1 %29, label %.lr.ph55.preheader, label %._crit_edge51.thread

.lr.ph47:                                         ; preds = %.preheader37, %.lr.ph47
  %indvars.iv68 = phi i64 [ %indvars.iv.next69, %.lr.ph47 ], [ 0, %.preheader37 ]
  %30 = phi i64 [ %39, %.lr.ph47 ], [ %24, %.preheader37 ]
  %31 = getelementptr inbounds [2010 x i64], ptr @b, i64 0, i64 %indvars.iv68
  %32 = sub nsw i64 %indvars.iv68, %indvars.iv78
  %33 = add nsw i64 %30, %32
  %34 = srem i64 %33, %30
  %35 = getelementptr inbounds [2010 x i64], ptr @a, i64 0, i64 %34
  %36 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %31, ptr noundef nonnull align 8 dereferenceable(8) %35)
  %37 = load i64, ptr %36, align 8, !tbaa !5
  %38 = getelementptr inbounds [2010 x i64], ptr @t, i64 0, i64 %indvars.iv68
  store i64 %37, ptr %38, align 8, !tbaa !5
  %indvars.iv.next69 = add nuw nsw i64 %indvars.iv68, 1
  %39 = load i64, ptr @N, align 8, !tbaa !5
  %40 = icmp sgt i64 %39, %indvars.iv.next69
  br i1 %40, label %.lr.ph47, label %.preheader, !llvm.loop !15

._crit_edge51.thread:                             ; preds = %.preheader, %.preheader37
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #7
  %41 = load i64, ptr @x, align 8, !tbaa !5
  %42 = mul nsw i64 %41, %indvars.iv78
  br label %._crit_edge56

.lr.ph55.preheader:                               ; preds = %.preheader
  %43 = shl nuw i64 %39, 3
  call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 16 @b, ptr nonnull align 16 @t, i64 %43, i1 false), !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #7
  %44 = load i64, ptr @x, align 8, !tbaa !5
  %45 = mul nsw i64 %44, %indvars.iv78
  %min.iters.check97 = icmp ult i64 %39, 4
  br i1 %min.iters.check97, label %.lr.ph55.preheader113, label %vector.ph98

.lr.ph55.preheader113:                            ; preds = %middle.block95, %.lr.ph55.preheader
  %indvars.iv74.ph = phi i64 [ 0, %.lr.ph55.preheader ], [ %n.vec100, %middle.block95 ]
  %.ph = phi i64 [ %45, %.lr.ph55.preheader ], [ %52, %middle.block95 ]
  br label %.lr.ph55

vector.ph98:                                      ; preds = %.lr.ph55.preheader
  %n.vec100 = and i64 %39, 9223372036854775804
  %46 = insertelement <2 x i64> <i64 poison, i64 0>, i64 %45, i64 0
  br label %vector.body102

vector.body102:                                   ; preds = %vector.body102, %vector.ph98
  %index103 = phi i64 [ 0, %vector.ph98 ], [ %index.next108, %vector.body102 ]
  %vec.phi104 = phi <2 x i64> [ %46, %vector.ph98 ], [ %49, %vector.body102 ]
  %vec.phi105 = phi <2 x i64> [ zeroinitializer, %vector.ph98 ], [ %50, %vector.body102 ]
  %47 = getelementptr inbounds [2010 x i64], ptr @b, i64 0, i64 %index103
  %48 = getelementptr inbounds i8, ptr %47, i64 16
  %wide.load106 = load <2 x i64>, ptr %47, align 16, !tbaa !5
  %wide.load107 = load <2 x i64>, ptr %48, align 16, !tbaa !5
  %49 = add <2 x i64> %vec.phi104, %wide.load106
  %50 = add <2 x i64> %vec.phi105, %wide.load107
  %index.next108 = add nuw i64 %index103, 4
  %51 = icmp eq i64 %index.next108, %n.vec100
  br i1 %51, label %middle.block95, label %vector.body102, !llvm.loop !16

middle.block95:                                   ; preds = %vector.body102
  %bin.rdx109 = add <2 x i64> %50, %49
  %52 = call i64 @llvm.vector.reduce.add.v2i64(<2 x i64> %bin.rdx109)
  %cmp.n110 = icmp eq i64 %39, %n.vec100
  br i1 %cmp.n110, label %._crit_edge56, label %.lr.ph55.preheader113

._crit_edge56:                                    ; preds = %.lr.ph55, %middle.block95, %._crit_edge51.thread
  %storemerge = phi i64 [ %42, %._crit_edge51.thread ], [ %52, %middle.block95 ], [ %60, %.lr.ph55 ]
  store i64 %storemerge, ptr %2, align 8, !tbaa !5
  %53 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef nonnull align 8 dereferenceable(8) %2)
  %54 = load i64, ptr %53, align 8, !tbaa !5
  store i64 %54, ptr %1, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #7
  %indvars.iv.next79 = add nuw nsw i64 %indvars.iv78, 1
  %55 = load i64, ptr @N, align 8, !tbaa !5
  %56 = icmp sgt i64 %55, %indvars.iv.next79
  br i1 %56, label %.preheader37, label %._crit_edge59, !llvm.loop !17

.lr.ph55:                                         ; preds = %.lr.ph55.preheader113, %.lr.ph55
  %indvars.iv74 = phi i64 [ %indvars.iv.next75, %.lr.ph55 ], [ %indvars.iv74.ph, %.lr.ph55.preheader113 ]
  %57 = phi i64 [ %60, %.lr.ph55 ], [ %.ph, %.lr.ph55.preheader113 ]
  %58 = getelementptr inbounds [2010 x i64], ptr @b, i64 0, i64 %indvars.iv74
  %59 = load i64, ptr %58, align 8, !tbaa !5
  %60 = add nsw i64 %57, %59
  %indvars.iv.next75 = add nuw nsw i64 %indvars.iv74, 1
  %exitcond77.not = icmp eq i64 %indvars.iv.next75, %39
  br i1 %exitcond77.not, label %._crit_edge56, label %.lr.ph55, !llvm.loop !18
}

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #3

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

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

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #5

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


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