; LLVM IR from kazunetakahashi/atcoder :: 2018/0421_ARC096/D.ll (Z5solvev)

; 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"

@N = external dso_local global i32, align 4
@C = external dso_local global i64, align 8
@x = external dso_local global [100010 x i64], align 16
@v = external dso_local global [100010 x i64], align 16
@w = external dso_local global [100010 x i64], align 16
@w_rev = external dso_local global [100010 x i64], align 16

; Function Attrs: mustprogress uwtable
define dso_local noundef i64 @_Z5solvev() #0 {
  %1 = alloca i64, align 8
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i64, align 8
  %6 = alloca i32, align 4
  %7 = alloca i64, align 8
  %8 = alloca i32, align 4
  %9 = alloca i64, align 8
  %10 = alloca i64, align 8
  %11 = alloca i64, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %1) #4
  store i64 0, ptr %1, align 8, !tbaa !5
  %12 = load i32, ptr @N, align 4, !tbaa !9
  %13 = sext i32 %12 to i64
  %14 = getelementptr inbounds i64, ptr @w, i64 %13
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #4
  store i32 0, ptr %2, align 4, !tbaa !9
  call void @_ZSt4fillIPxiEvT_S1_RKT0_(ptr noundef @w, ptr noundef %14, ptr noundef nonnull align 4 dereferenceable(4) %2)
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #4
  %15 = load i64, ptr @v, align 16, !tbaa !5
  store i64 %15, ptr @w, align 16, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #4
  store i32 1, ptr %3, align 4, !tbaa !9
  br label %16

16:                                               ; preds = %35, %0
  %17 = load i32, ptr %3, align 4, !tbaa !9
  %18 = load i32, ptr @N, align 4, !tbaa !9
  %19 = icmp slt i32 %17, %18
  br i1 %19, label %21, label %20

20:                                               ; preds = %16
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #4
  br label %38

21:                                               ; preds = %16
  %22 = load i32, ptr %3, align 4, !tbaa !9
  %23 = sub nsw i32 %22, 1
  %24 = sext i32 %23 to i64
  %25 = getelementptr inbounds [100010 x i64], ptr @w, i64 0, i64 %24
  %26 = load i64, ptr %25, align 8, !tbaa !5
  %27 = load i32, ptr %3, align 4, !tbaa !9
  %28 = sext i32 %27 to i64
  %29 = getelementptr inbounds [100010 x i64], ptr @v, i64 0, i64 %28
  %30 = load i64, ptr %29, align 8, !tbaa !5
  %31 = add nsw i64 %26, %30
  %32 = load i32, ptr %3, align 4, !tbaa !9
  %33 = sext i32 %32 to i64
  %34 = getelementptr inbounds [100010 x i64], ptr @w, i64 0, i64 %33
  store i64 %31, ptr %34, align 8, !tbaa !5
  br label %35

35:                                               ; preds = %21
  %36 = load i32, ptr %3, align 4, !tbaa !9
  %37 = add nsw i32 %36, 1
  store i32 %37, ptr %3, align 4, !tbaa !9
  br label %16, !llvm.loop !11

38:                                               ; preds = %20
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #4
  store i32 0, ptr %4, align 4, !tbaa !9
  br label %39

39:                                               ; preds = %56, %38
  %40 = load i32, ptr %4, align 4, !tbaa !9
  %41 = load i32, ptr @N, align 4, !tbaa !9
  %42 = icmp slt i32 %40, %41
  br i1 %42, label %44, label %43

43:                                               ; preds = %39
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #4
  br label %59

44:                                               ; preds = %39
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #4
  %45 = load i32, ptr %4, align 4, !tbaa !9
  %46 = sext i32 %45 to i64
  %47 = getelementptr inbounds [100010 x i64], ptr @w, i64 0, i64 %46
  %48 = load i64, ptr %47, align 8, !tbaa !5
  %49 = load i32, ptr %4, align 4, !tbaa !9
  %50 = sext i32 %49 to i64
  %51 = getelementptr inbounds [100010 x i64], ptr @x, i64 0, i64 %50
  %52 = load i64, ptr %51, align 8, !tbaa !5
  %53 = sub nsw i64 %48, %52
  store i64 %53, ptr %5, align 8, !tbaa !5
  %54 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef nonnull align 8 dereferenceable(8) %5)
  %55 = load i64, ptr %54, align 8, !tbaa !5
  store i64 %55, ptr %1, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #4
  br label %56

56:                                               ; preds = %44
  %57 = load i32, ptr %4, align 4, !tbaa !9
  %58 = add nsw i32 %57, 1
  store i32 %58, ptr %4, align 4, !tbaa !9
  br label %39, !llvm.loop !13

59:                                               ; preds = %43
  %60 = load i32, ptr @N, align 4, !tbaa !9
  %61 = sub nsw i32 %60, 1
  %62 = sext i32 %61 to i64
  %63 = getelementptr inbounds [100010 x i64], ptr @v, i64 0, i64 %62
  %64 = load i64, ptr %63, align 8, !tbaa !5
  %65 = load i32, ptr @N, align 4, !tbaa !9
  %66 = sub nsw i32 %65, 1
  %67 = sext i32 %66 to i64
  %68 = getelementptr inbounds [100010 x i64], ptr @w_rev, i64 0, i64 %67
  store i64 %64, ptr %68, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #4
  %69 = load i32, ptr @N, align 4, !tbaa !9
  %70 = sub nsw i32 %69, 2
  store i32 %70, ptr %6, align 4, !tbaa !9
  br label %71

71:                                               ; preds = %89, %59
  %72 = load i32, ptr %6, align 4, !tbaa !9
  %73 = icmp sge i32 %72, 0
  br i1 %73, label %75, label %74

74:                                               ; preds = %71
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  br label %92

75:                                               ; preds = %71
  %76 = load i32, ptr %6, align 4, !tbaa !9
  %77 = add nsw i32 %76, 1
  %78 = sext i32 %77 to i64
  %79 = getelementptr inbounds [100010 x i64], ptr @w_rev, i64 0, i64 %78
  %80 = load i64, ptr %79, align 8, !tbaa !5
  %81 = load i32, ptr %6, align 4, !tbaa !9
  %82 = sext i32 %81 to i64
  %83 = getelementptr inbounds [100010 x i64], ptr @v, i64 0, i64 %82
  %84 = load i64, ptr %83, align 8, !tbaa !5
  %85 = add nsw i64 %80, %84
  %86 = load i32, ptr %6, align 4, !tbaa !9
  %87 = sext i32 %86 to i64
  %88 = getelementptr inbounds [100010 x i64], ptr @w_rev, i64 0, i64 %87
  store i64 %85, ptr %88, align 8, !tbaa !5
  br label %89

89:                                               ; preds = %75
  %90 = load i32, ptr %6, align 4, !tbaa !9
  %91 = add nsw i32 %90, -1
  store i32 %91, ptr %6, align 4, !tbaa !9
  br label %71, !llvm.loop !14

92:                                               ; preds = %74
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #4
  store i64 0, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #4
  %93 = load i32, ptr @N, align 4, !tbaa !9
  %94 = sub nsw i32 %93, 1
  store i32 %94, ptr %8, align 4, !tbaa !9
  br label %95

95:                                               ; preds = %129, %92
  %96 = load i32, ptr %8, align 4, !tbaa !9
  %97 = icmp sge i32 %96, 1
  br i1 %97, label %99, label %98

98:                                               ; preds = %95
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  br label %132

99:                                               ; preds = %95
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #4
  %100 = load i32, ptr %8, align 4, !tbaa !9
  %101 = sext i32 %100 to i64
  %102 = getelementptr inbounds [100010 x i64], ptr @w_rev, i64 0, i64 %101
  %103 = load i64, ptr %102, align 8, !tbaa !5
  %104 = load i64, ptr @C, align 8, !tbaa !5
  %105 = load i32, ptr %8, align 4, !tbaa !9
  %106 = sext i32 %105 to i64
  %107 = getelementptr inbounds [100010 x i64], ptr @x, i64 0, i64 %106
  %108 = load i64, ptr %107, align 8, !tbaa !5
  %109 = sub nsw i64 %104, %108
  %110 = sub nsw i64 %103, %109
  store i64 %110, ptr %9, align 8, !tbaa !5
  %111 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef nonnull align 8 dereferenceable(8) %9)
  %112 = load i64, ptr %111, align 8, !tbaa !5
  store i64 %112, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #4
  %113 = load i32, ptr %8, align 4, !tbaa !9
  %114 = sub nsw i32 %113, 1
  %115 = sext i32 %114 to i64
  %116 = getelementptr inbounds [100010 x i64], ptr @w, i64 0, i64 %115
  %117 = load i64, ptr %116, align 8, !tbaa !5
  %118 = load i32, ptr %8, align 4, !tbaa !9
  %119 = sub nsw i32 %118, 1
  %120 = sext i32 %119 to i64
  %121 = getelementptr inbounds [100010 x i64], ptr @x, i64 0, i64 %120
  %122 = load i64, ptr %121, align 8, !tbaa !5
  %123 = mul nsw i64 2, %122
  %124 = sub nsw i64 %117, %123
  %125 = load i64, ptr %7, align 8, !tbaa !5
  %126 = add nsw i64 %124, %125
  store i64 %126, ptr %10, align 8, !tbaa !5
  %127 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef nonnull align 8 dereferenceable(8) %10)
  %128 = load i64, ptr %127, align 8, !tbaa !5
  store i64 %128, ptr %1, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #4
  br label %129

129:                                              ; preds = %99
  %130 = load i32, ptr %8, align 4, !tbaa !9
  %131 = add nsw i32 %130, -1
  store i32 %131, ptr %8, align 4, !tbaa !9
  br label %95, !llvm.loop !15

132:                                              ; preds = %98
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #4
  %133 = load i64, ptr @w_rev, align 16, !tbaa !5
  %134 = load i64, ptr @C, align 8, !tbaa !5
  %135 = load i64, ptr @x, align 16, !tbaa !5
  %136 = sub nsw i64 %134, %135
  %137 = sub nsw i64 %133, %136
  store i64 %137, ptr %11, align 8, !tbaa !5
  %138 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef nonnull align 8 dereferenceable(8) %11)
  %139 = load i64, ptr %138, align 8, !tbaa !5
  store i64 %139, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #4
  %140 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef nonnull align 8 dereferenceable(8) %7)
  %141 = load i64, ptr %140, align 8, !tbaa !5
  store i64 %141, ptr %1, align 8, !tbaa !5
  %142 = load i64, ptr %1, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %1) #4
  ret i64 %142
}

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4fillIPxiEvT_S1_RKT0_(ptr noundef, ptr noundef, ptr noundef nonnull align 4 dereferenceable(4)) #2

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

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

attributes #0 = { 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 #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #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 = { nounwind }

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

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


; 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"

@N = external dso_local local_unnamed_addr global i32, align 4
@C = external dso_local local_unnamed_addr global i64, align 8
@x = external dso_local local_unnamed_addr global [100010 x i64], align 16
@v = external dso_local local_unnamed_addr global [100010 x i64], align 16
@w = external dso_local global [100010 x i64], align 16
@w_rev = external dso_local local_unnamed_addr global [100010 x i64], align 16

; Function Attrs: mustprogress uwtable
define dso_local noundef i64 @_Z5solvev() local_unnamed_addr #0 {
  %1 = alloca i64, align 8
  %2 = alloca i32, align 4
  %3 = alloca i64, align 8
  %4 = alloca i64, align 8
  %5 = alloca i64, align 8
  %6 = alloca i64, align 8
  %7 = alloca i64, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #4
  store i64 0, ptr %1, align 8, !tbaa !5
  %8 = load i32, ptr @N, align 4, !tbaa !9
  %9 = sext i32 %8 to i64
  %10 = getelementptr inbounds i64, ptr @w, i64 %9
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #4
  store i32 0, ptr %2, align 4, !tbaa !9
  call void @_ZSt4fillIPxiEvT_S1_RKT0_(ptr noundef nonnull @w, ptr noundef nonnull %10, ptr noundef nonnull align 4 dereferenceable(4) %2)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #4
  %11 = load i64, ptr @v, align 16, !tbaa !5
  store i64 %11, ptr @w, align 16, !tbaa !5
  %12 = load i32, ptr @N, align 4, !tbaa !9
  %13 = icmp sgt i32 %12, 1
  br i1 %13, label %.lr.ph.preheader, label %.preheader

.lr.ph.preheader:                                 ; preds = %0
  %wide.trip.count = zext nneg i32 %12 to i64
  %14 = add nsw i64 %wide.trip.count, -1
  %15 = add nsw i64 %wide.trip.count, -2
  %xtraiter = and i64 %14, 3
  %16 = icmp ult i64 %15, 3
  br i1 %16, label %.preheader.loopexit.unr-lcssa, label %.lr.ph.preheader.new

.lr.ph.preheader.new:                             ; preds = %.lr.ph.preheader
  %unroll_iter = and i64 %14, -4
  br label %.lr.ph

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

.lr.ph.epil:                                      ; preds = %.preheader.loopexit.unr-lcssa, %.lr.ph.epil
  %17 = phi i64 [ %20, %.lr.ph.epil ], [ %.unr, %.preheader.loopexit.unr-lcssa ]
  %indvars.iv.epil = phi i64 [ %indvars.iv.next.epil, %.lr.ph.epil ], [ %indvars.iv.unr, %.preheader.loopexit.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.lr.ph.epil ], [ 0, %.preheader.loopexit.unr-lcssa ]
  %18 = getelementptr inbounds [100010 x i64], ptr @v, i64 0, i64 %indvars.iv.epil
  %19 = load i64, ptr %18, align 8, !tbaa !5
  %20 = add nsw i64 %19, %17
  %21 = getelementptr inbounds [100010 x i64], ptr @w, i64 0, i64 %indvars.iv.epil
  store i64 %20, ptr %21, align 8, !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 %.preheader, label %.lr.ph.epil, !llvm.loop !11

.preheader:                                       ; preds = %.preheader.loopexit.unr-lcssa, %.lr.ph.epil, %0
  %22 = icmp sgt i32 %12, 0
  br i1 %22, label %.lr.ph30, label %._crit_edge.thread

._crit_edge.thread:                               ; preds = %.preheader
  %23 = add nsw i32 %12, -1
  %24 = sext i32 %23 to i64
  %25 = getelementptr inbounds [100010 x i64], ptr @v, i64 0, i64 %24
  %26 = load i64, ptr %25, align 8, !tbaa !5
  %27 = getelementptr inbounds [100010 x i64], ptr @w_rev, i64 0, i64 %24
  store i64 %26, ptr %27, align 8, !tbaa !5
  br label %._crit_edge34.thread

.lr.ph:                                           ; preds = %.lr.ph, %.lr.ph.preheader.new
  %28 = phi i64 [ %11, %.lr.ph.preheader.new ], [ %43, %.lr.ph ]
  %indvars.iv = phi i64 [ 1, %.lr.ph.preheader.new ], [ %indvars.iv.next.3, %.lr.ph ]
  %niter = phi i64 [ 0, %.lr.ph.preheader.new ], [ %niter.next.3, %.lr.ph ]
  %29 = getelementptr inbounds [100010 x i64], ptr @v, i64 0, i64 %indvars.iv
  %30 = load i64, ptr %29, align 8, !tbaa !5
  %31 = add nsw i64 %30, %28
  %32 = getelementptr inbounds [100010 x i64], ptr @w, i64 0, i64 %indvars.iv
  store i64 %31, ptr %32, align 8, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %33 = getelementptr inbounds [100010 x i64], ptr @v, i64 0, i64 %indvars.iv.next
  %34 = load i64, ptr %33, align 8, !tbaa !5
  %35 = add nsw i64 %34, %31
  %36 = getelementptr inbounds [100010 x i64], ptr @w, i64 0, i64 %indvars.iv.next
  store i64 %35, ptr %36, align 8, !tbaa !5
  %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
  %37 = getelementptr inbounds [100010 x i64], ptr @v, i64 0, i64 %indvars.iv.next.1
  %38 = load i64, ptr %37, align 8, !tbaa !5
  %39 = add nsw i64 %38, %35
  %40 = getelementptr inbounds [100010 x i64], ptr @w, i64 0, i64 %indvars.iv.next.1
  store i64 %39, ptr %40, align 8, !tbaa !5
  %indvars.iv.next.2 = add nuw nsw i64 %indvars.iv, 3
  %41 = getelementptr inbounds [100010 x i64], ptr @v, i64 0, i64 %indvars.iv.next.2
  %42 = load i64, ptr %41, align 8, !tbaa !5
  %43 = add nsw i64 %42, %39
  %44 = getelementptr inbounds [100010 x i64], ptr @w, i64 0, i64 %indvars.iv.next.2
  store i64 %43, ptr %44, align 8, !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 %.preheader.loopexit.unr-lcssa, label %.lr.ph, !llvm.loop !13

._crit_edge:                                      ; preds = %.lr.ph30
  %45 = add nsw i32 %67, -1
  %46 = sext i32 %45 to i64
  %47 = getelementptr inbounds [100010 x i64], ptr @v, i64 0, i64 %46
  %48 = load i64, ptr %47, align 8, !tbaa !5
  %49 = getelementptr inbounds [100010 x i64], ptr @w_rev, i64 0, i64 %46
  store i64 %48, ptr %49, align 8, !tbaa !5
  %50 = icmp sgt i32 %67, 1
  br i1 %50, label %.lr.ph33.preheader, label %._crit_edge34.thread

.lr.ph33.preheader:                               ; preds = %._crit_edge
  %51 = add nsw i32 %67, -2
  %52 = zext i32 %51 to i64
  %53 = shl nuw nsw i64 %52, 3
  %scevgep = getelementptr i8, ptr getelementptr inbounds (i8, ptr @w_rev, i64 8), i64 %53
  %load_initial = load i64, ptr %scevgep, align 8
  %54 = add nuw nsw i64 %52, 1
  %xtraiter54 = and i64 %54, 3
  %lcmp.mod55.not = icmp eq i64 %xtraiter54, 0
  br i1 %lcmp.mod55.not, label %.lr.ph33.prol.loopexit, label %.lr.ph33.prol

.lr.ph33.prol:                                    ; preds = %.lr.ph33.preheader, %.lr.ph33.prol
  %store_forwarded.prol = phi i64 [ %57, %.lr.ph33.prol ], [ %load_initial, %.lr.ph33.preheader ]
  %indvars.iv45.prol = phi i64 [ %indvars.iv.next46.prol, %.lr.ph33.prol ], [ %52, %.lr.ph33.preheader ]
  %prol.iter = phi i64 [ %prol.iter.next, %.lr.ph33.prol ], [ 0, %.lr.ph33.preheader ]
  %55 = getelementptr inbounds [100010 x i64], ptr @v, i64 0, i64 %indvars.iv45.prol
  %56 = load i64, ptr %55, align 8, !tbaa !5
  %57 = add nsw i64 %56, %store_forwarded.prol
  %58 = getelementptr inbounds [100010 x i64], ptr @w_rev, i64 0, i64 %indvars.iv45.prol
  store i64 %57, ptr %58, align 8, !tbaa !5
  %indvars.iv.next46.prol = add nsw i64 %indvars.iv45.prol, -1
  %prol.iter.next = add i64 %prol.iter, 1
  %prol.iter.cmp.not = icmp eq i64 %prol.iter.next, %xtraiter54
  br i1 %prol.iter.cmp.not, label %.lr.ph33.prol.loopexit, label %.lr.ph33.prol, !llvm.loop !15

.lr.ph33.prol.loopexit:                           ; preds = %.lr.ph33.prol, %.lr.ph33.preheader
  %store_forwarded.unr = phi i64 [ %load_initial, %.lr.ph33.preheader ], [ %57, %.lr.ph33.prol ]
  %indvars.iv45.unr = phi i64 [ %52, %.lr.ph33.preheader ], [ %indvars.iv.next46.prol, %.lr.ph33.prol ]
  %59 = icmp ult i32 %51, 3
  br i1 %59, label %._crit_edge34, label %.lr.ph33

.lr.ph30:                                         ; preds = %.preheader, %.lr.ph30
  %indvars.iv42 = phi i64 [ %indvars.iv.next43, %.lr.ph30 ], [ 0, %.preheader ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #4
  %60 = getelementptr inbounds [100010 x i64], ptr @w, i64 0, i64 %indvars.iv42
  %61 = load i64, ptr %60, align 8, !tbaa !5
  %62 = getelementptr inbounds [100010 x i64], ptr @x, i64 0, i64 %indvars.iv42
  %63 = load i64, ptr %62, align 8, !tbaa !5
  %64 = sub nsw i64 %61, %63
  store i64 %64, ptr %3, align 8, !tbaa !5
  %65 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef nonnull align 8 dereferenceable(8) %3)
  %66 = load i64, ptr %65, align 8, !tbaa !5
  store i64 %66, ptr %1, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #4
  %indvars.iv.next43 = add nuw nsw i64 %indvars.iv42, 1
  %67 = load i32, ptr @N, align 4, !tbaa !9
  %68 = sext i32 %67 to i64
  %69 = icmp slt i64 %indvars.iv.next43, %68
  br i1 %69, label %.lr.ph30, label %._crit_edge, !llvm.loop !16

._crit_edge34.thread:                             ; preds = %._crit_edge.thread, %._crit_edge
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #4
  store i64 0, ptr %4, align 8, !tbaa !5
  br label %._crit_edge38

._crit_edge34:                                    ; preds = %.lr.ph33, %.lr.ph33.prol.loopexit
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #4
  store i64 0, ptr %4, align 8, !tbaa !5
  br i1 %50, label %.lr.ph37.preheader, label %._crit_edge38

.lr.ph37.preheader:                               ; preds = %._crit_edge34
  %70 = zext nneg i32 %67 to i64
  br label %.lr.ph37

.lr.ph33:                                         ; preds = %.lr.ph33.prol.loopexit, %.lr.ph33
  %store_forwarded = phi i64 [ %85, %.lr.ph33 ], [ %store_forwarded.unr, %.lr.ph33.prol.loopexit ]
  %indvars.iv45 = phi i64 [ %indvars.iv.next46.3, %.lr.ph33 ], [ %indvars.iv45.unr, %.lr.ph33.prol.loopexit ]
  %71 = getelementptr inbounds [100010 x i64], ptr @v, i64 0, i64 %indvars.iv45
  %72 = load i64, ptr %71, align 8, !tbaa !5
  %73 = add nsw i64 %72, %store_forwarded
  %74 = getelementptr inbounds [100010 x i64], ptr @w_rev, i64 0, i64 %indvars.iv45
  store i64 %73, ptr %74, align 8, !tbaa !5
  %indvars.iv.next46 = add nsw i64 %indvars.iv45, -1
  %75 = getelementptr inbounds [100010 x i64], ptr @v, i64 0, i64 %indvars.iv.next46
  %76 = load i64, ptr %75, align 8, !tbaa !5
  %77 = add nsw i64 %76, %73
  %78 = getelementptr inbounds [100010 x i64], ptr @w_rev, i64 0, i64 %indvars.iv.next46
  store i64 %77, ptr %78, align 8, !tbaa !5
  %indvars.iv.next46.1 = add nsw i64 %indvars.iv45, -2
  %79 = getelementptr inbounds [100010 x i64], ptr @v, i64 0, i64 %indvars.iv.next46.1
  %80 = load i64, ptr %79, align 8, !tbaa !5
  %81 = add nsw i64 %80, %77
  %82 = getelementptr inbounds [100010 x i64], ptr @w_rev, i64 0, i64 %indvars.iv.next46.1
  store i64 %81, ptr %82, align 8, !tbaa !5
  %indvars.iv.next46.2 = add nsw i64 %indvars.iv45, -3
  %83 = getelementptr inbounds [100010 x i64], ptr @v, i64 0, i64 %indvars.iv.next46.2
  %84 = load i64, ptr %83, align 8, !tbaa !5
  %85 = add nsw i64 %84, %81
  %86 = getelementptr inbounds [100010 x i64], ptr @w_rev, i64 0, i64 %indvars.iv.next46.2
  store i64 %85, ptr %86, align 8, !tbaa !5
  %indvars.iv.next46.3 = add nsw i64 %indvars.iv45, -4
  %.not.3 = icmp eq i64 %indvars.iv.next46.2, 0
  br i1 %.not.3, label %._crit_edge34, label %.lr.ph33, !llvm.loop !17

._crit_edge38:                                    ; preds = %.lr.ph37, %._crit_edge34.thread, %._crit_edge34
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #4
  %87 = load i64, ptr @w_rev, align 16, !tbaa !5
  %88 = load i64, ptr @C, align 8, !tbaa !5
  %89 = load i64, ptr @x, align 16, !tbaa !5
  %.neg = sub i64 %87, %88
  %90 = add i64 %.neg, %89
  store i64 %90, ptr %7, align 8, !tbaa !5
  %91 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(8) %7)
  %92 = load i64, ptr %91, align 8, !tbaa !5
  store i64 %92, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #4
  %93 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef nonnull align 8 dereferenceable(8) %4)
  %94 = load i64, ptr %93, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #4
  ret i64 %94

.lr.ph37:                                         ; preds = %.lr.ph37.preheader, %.lr.ph37
  %indvars.iv48 = phi i64 [ %70, %.lr.ph37.preheader ], [ %indvars.iv.next49, %.lr.ph37 ]
  %indvars.iv.next49 = add nsw i64 %indvars.iv48, -1
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #4
  %95 = getelementptr inbounds [100010 x i64], ptr @w_rev, i64 0, i64 %indvars.iv.next49
  %96 = load i64, ptr %95, align 8, !tbaa !5
  %97 = load i64, ptr @C, align 8, !tbaa !5
  %98 = getelementptr inbounds [100010 x i64], ptr @x, i64 0, i64 %indvars.iv.next49
  %99 = load i64, ptr %98, align 8, !tbaa !5
  %.neg24 = sub i64 %96, %97
  %100 = add i64 %.neg24, %99
  store i64 %100, ptr %5, align 8, !tbaa !5
  %101 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(8) %5)
  %102 = load i64, ptr %101, align 8, !tbaa !5
  store i64 %102, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #4
  %103 = add nsw i64 %indvars.iv48, -2
  %104 = getelementptr inbounds [100010 x i64], ptr @w, i64 0, i64 %103
  %105 = load i64, ptr %104, align 8, !tbaa !5
  %106 = getelementptr inbounds [100010 x i64], ptr @x, i64 0, i64 %103
  %107 = load i64, ptr %106, align 8, !tbaa !5
  %108 = add i64 %105, %102
  %109 = shl i64 %107, 1
  %110 = sub i64 %108, %109
  store i64 %110, ptr %6, align 8, !tbaa !5
  %111 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef nonnull align 8 dereferenceable(8) %6)
  %112 = load i64, ptr %111, align 8, !tbaa !5
  store i64 %112, ptr %1, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #4
  %113 = icmp ugt i64 %indvars.iv48, 2
  br i1 %113, label %.lr.ph37, label %._crit_edge38, !llvm.loop !18
}

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

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

attributes #0 = { 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 #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #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 = { nounwind }

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

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


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