; LLVM IR from tangjz/acm-icpc :: codeforces/1556B.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"

@_ZZ5solvevE3arr = external hidden global [2 x [100001 x i32]], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1

; Function Attrs: mustprogress uwtable
define dso_local noundef i64 @_Z5solvev() #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i64, align 8
  %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
  %11 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %1) #5
  %12 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %1)
  store i32 0, ptr getelementptr inbounds ([2 x [100001 x i32]], ptr @_ZZ5solvevE3arr, i64 0, i64 1), align 4, !tbaa !5
  store i32 0, ptr @_ZZ5solvevE3arr, align 16, !tbaa !5
  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 = %34, %0
  %14 = load i32, ptr %2, align 4, !tbaa !5
  %15 = load i32, ptr %1, align 4, !tbaa !5
  %16 = icmp slt i32 %14, %15
  br i1 %16, label %18, label %17

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

18:                                               ; preds = %13
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #5
  %19 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %3)
  %20 = load i32, ptr %3, align 4, !tbaa !5
  %21 = and i32 %20, 1
  store i32 %21, ptr %3, align 4, !tbaa !5
  %22 = load i32, ptr %2, align 4, !tbaa !5
  %23 = load i32, ptr %3, align 4, !tbaa !5
  %24 = sext i32 %23 to i64
  %25 = getelementptr inbounds [2 x [100001 x i32]], ptr @_ZZ5solvevE3arr, i64 0, i64 %24
  %26 = load i32, ptr %3, align 4, !tbaa !5
  %27 = sext i32 %26 to i64
  %28 = getelementptr inbounds [2 x [100001 x i32]], ptr @_ZZ5solvevE3arr, i64 0, i64 %27
  %29 = getelementptr inbounds [100001 x i32], ptr %28, i64 0, i64 0
  %30 = load i32, ptr %29, align 4, !tbaa !5
  %31 = add nsw i32 %30, 1
  store i32 %31, ptr %29, align 4, !tbaa !5
  %32 = sext i32 %31 to i64
  %33 = getelementptr inbounds [100001 x i32], ptr %25, i64 0, i64 %32
  store i32 %22, ptr %33, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #5
  br label %34

34:                                               ; preds = %18
  %35 = load i32, ptr %2, align 4, !tbaa !5
  %36 = add nsw i32 %35, 1
  store i32 %36, ptr %2, align 4, !tbaa !5
  br label %13, !llvm.loop !9

37:                                               ; preds = %17
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #5
  store i64 4557430888798830399, ptr %4, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #5
  %38 = load i32, ptr %1, align 4, !tbaa !5
  %39 = add nsw i32 %38, 1
  %40 = ashr i32 %39, 1
  store i32 %40, ptr %5, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  %41 = load i32, ptr %1, align 4, !tbaa !5
  %42 = load i32, ptr %5, align 4, !tbaa !5
  %43 = sub nsw i32 %41, %42
  store i32 %43, ptr %6, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  store i32 0, ptr %7, align 4, !tbaa !5
  br label %44

44:                                               ; preds = %133, %37
  %45 = load i32, ptr %7, align 4, !tbaa !5
  %46 = icmp slt i32 %45, 2
  br i1 %46, label %48, label %47

47:                                               ; preds = %44
  store i32 5, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  br label %136

48:                                               ; preds = %44
  %49 = load i32, ptr %7, align 4, !tbaa !5
  %50 = sext i32 %49 to i64
  %51 = getelementptr inbounds [2 x [100001 x i32]], ptr @_ZZ5solvevE3arr, i64 0, i64 %50
  %52 = getelementptr inbounds [100001 x i32], ptr %51, i64 0, i64 0
  %53 = load i32, ptr %52, align 4, !tbaa !5
  %54 = load i32, ptr %5, align 4, !tbaa !5
  %55 = icmp ne i32 %53, %54
  br i1 %55, label %66, label %56

56:                                               ; preds = %48
  %57 = load i32, ptr %7, align 4, !tbaa !5
  %58 = icmp ne i32 %57, 0
  %59 = xor i1 %58, true
  %60 = zext i1 %59 to i64
  %61 = getelementptr inbounds [2 x [100001 x i32]], ptr @_ZZ5solvevE3arr, i64 0, i64 %60
  %62 = getelementptr inbounds [100001 x i32], ptr %61, i64 0, i64 0
  %63 = load i32, ptr %62, align 4, !tbaa !5
  %64 = load i32, ptr %6, align 4, !tbaa !5
  %65 = icmp ne i32 %63, %64
  br i1 %65, label %66, label %67

66:                                               ; preds = %56, %48
  br label %133

67:                                               ; preds = %56
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #5
  store i64 0, ptr %9, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  store i32 0, ptr %10, align 4, !tbaa !5
  br label %68

68:                                               ; preds = %93, %67
  %69 = load i32, ptr %10, align 4, !tbaa !5
  %70 = load i32, ptr %7, align 4, !tbaa !5
  %71 = sext i32 %70 to i64
  %72 = getelementptr inbounds [2 x [100001 x i32]], ptr @_ZZ5solvevE3arr, i64 0, i64 %71
  %73 = getelementptr inbounds [100001 x i32], ptr %72, i64 0, i64 0
  %74 = load i32, ptr %73, align 4, !tbaa !5
  %75 = icmp slt i32 %69, %74
  br i1 %75, label %77, label %76

76:                                               ; preds = %68
  store i32 8, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  br label %96

77:                                               ; preds = %68
  %78 = load i32, ptr %10, align 4, !tbaa !5
  %79 = shl i32 %78, 1
  %80 = load i32, ptr %7, align 4, !tbaa !5
  %81 = sext i32 %80 to i64
  %82 = getelementptr inbounds [2 x [100001 x i32]], ptr @_ZZ5solvevE3arr, i64 0, i64 %81
  %83 = load i32, ptr %10, align 4, !tbaa !5
  %84 = add nsw i32 %83, 1
  %85 = sext i32 %84 to i64
  %86 = getelementptr inbounds [100001 x i32], ptr %82, i64 0, i64 %85
  %87 = load i32, ptr %86, align 4, !tbaa !5
  %88 = sub nsw i32 %79, %87
  %89 = call i32 @llvm.abs.i32(i32 %88, i1 true)
  %90 = sext i32 %89 to i64
  %91 = load i64, ptr %9, align 8, !tbaa !11
  %92 = add nsw i64 %91, %90
  store i64 %92, ptr %9, align 8, !tbaa !11
  br label %93

93:                                               ; preds = %77
  %94 = load i32, ptr %10, align 4, !tbaa !5
  %95 = add nsw i32 %94, 1
  store i32 %95, ptr %10, align 4, !tbaa !5
  br label %68, !llvm.loop !13

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

97:                                               ; preds = %127, %96
  %98 = load i32, ptr %11, align 4, !tbaa !5
  %99 = load i32, ptr %7, align 4, !tbaa !5
  %100 = icmp ne i32 %99, 0
  %101 = xor i1 %100, true
  %102 = zext i1 %101 to i64
  %103 = getelementptr inbounds [2 x [100001 x i32]], ptr @_ZZ5solvevE3arr, i64 0, i64 %102
  %104 = getelementptr inbounds [100001 x i32], ptr %103, i64 0, i64 0
  %105 = load i32, ptr %104, align 4, !tbaa !5
  %106 = icmp slt i32 %98, %105
  br i1 %106, label %108, label %107

107:                                              ; preds = %97
  store i32 11, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  br label %130

108:                                              ; preds = %97
  %109 = load i32, ptr %11, align 4, !tbaa !5
  %110 = shl i32 %109, 1
  %111 = or i32 %110, 1
  %112 = load i32, ptr %7, align 4, !tbaa !5
  %113 = icmp ne i32 %112, 0
  %114 = xor i1 %113, true
  %115 = zext i1 %114 to i64
  %116 = getelementptr inbounds [2 x [100001 x i32]], ptr @_ZZ5solvevE3arr, i64 0, i64 %115
  %117 = load i32, ptr %11, align 4, !tbaa !5
  %118 = add nsw i32 %117, 1
  %119 = sext i32 %118 to i64
  %120 = getelementptr inbounds [100001 x i32], ptr %116, i64 0, i64 %119
  %121 = load i32, ptr %120, align 4, !tbaa !5
  %122 = sub nsw i32 %111, %121
  %123 = call i32 @llvm.abs.i32(i32 %122, i1 true)
  %124 = sext i32 %123 to i64
  %125 = load i64, ptr %9, align 8, !tbaa !11
  %126 = add nsw i64 %125, %124
  store i64 %126, ptr %9, align 8, !tbaa !11
  br label %127

127:                                              ; preds = %108
  %128 = load i32, ptr %11, align 4, !tbaa !5
  %129 = add nsw i32 %128, 1
  store i32 %129, ptr %11, align 4, !tbaa !5
  br label %97, !llvm.loop !14

130:                                              ; preds = %107
  %131 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(8) %9)
  %132 = load i64, ptr %131, align 8, !tbaa !11
  store i64 %132, ptr %4, align 8, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  br label %133

133:                                              ; preds = %130, %66
  %134 = load i32, ptr %7, align 4, !tbaa !5
  %135 = add nsw i32 %134, 1
  store i32 %135, ptr %7, align 4, !tbaa !5
  br label %44, !llvm.loop !15

136:                                              ; preds = %47
  %137 = load i64, ptr %4, align 8, !tbaa !11
  %138 = icmp slt i64 %137, 4557430888798830399
  br i1 %138, label %139, label %142

139:                                              ; preds = %136
  %140 = load i64, ptr %4, align 8, !tbaa !11
  %141 = ashr i64 %140, 1
  br label %143

142:                                              ; preds = %136
  br label %143

143:                                              ; preds = %142, %139
  %144 = phi i64 [ %141, %139 ], [ -1, %142 ]
  store i32 1, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %1) #5
  ret i64 %144
}

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

declare i32 @__isoc99_scanf(ptr noundef, ...) #2

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.abs.i32(i32, i1 immarg) #3

; 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)) #4

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 = { "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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { 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 #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 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!12, !12, i64 0}
!12 = !{!"long long", !7, i64 0}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}


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

@_ZZ5solvevE3arr = external hidden local_unnamed_addr global [2 x [100001 x i32]], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
define dso_local noundef range(i64 -4611686018427387904, 4611686018427387904) i64 @_Z5solvev() local_unnamed_addr #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i64, align 8
  %4 = alloca i64, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #6
  %5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %1)
  store i32 0, ptr getelementptr inbounds (i8, ptr @_ZZ5solvevE3arr, i64 400004), align 4, !tbaa !5
  store i32 0, ptr @_ZZ5solvevE3arr, align 16, !tbaa !5
  %6 = load i32, ptr %1, align 4, !tbaa !5
  %7 = icmp sgt i32 %6, 0
  br i1 %7, label %.lr.ph, label %._crit_edge

._crit_edge.loopexit:                             ; preds = %.lr.ph
  %.pre = load i32, ptr @_ZZ5solvevE3arr, align 16, !tbaa !5
  %.pre51.pre = load i32, ptr getelementptr inbounds (i8, ptr @_ZZ5solvevE3arr, i64 400004), align 4, !tbaa !5
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %0
  %.pre51 = phi i32 [ 0, %0 ], [ %.pre51.pre, %._crit_edge.loopexit ]
  %8 = phi i32 [ 0, %0 ], [ %.pre, %._crit_edge.loopexit ]
  %.lcssa = phi i32 [ %6, %0 ], [ %22, %._crit_edge.loopexit ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #6
  store i64 4557430888798830399, ptr %3, align 8, !tbaa !9
  %9 = add nsw i32 %.lcssa, 1
  %10 = ashr i32 %9, 1
  %11 = sub nsw i32 %.lcssa, %10
  %.not = icmp eq i32 %8, %10
  %.not26 = icmp eq i32 %.pre51, %11
  %or.cond = select i1 %.not, i1 %.not26, i1 false
  br i1 %or.cond, label %24, label %78

.lr.ph:                                           ; preds = %0, %.lr.ph
  %.02427 = phi i32 [ %21, %.lr.ph ], [ 0, %0 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #6
  %12 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %2)
  %13 = load i32, ptr %2, align 4, !tbaa !5
  %14 = and i32 %13, 1
  %15 = zext nneg i32 %14 to i64
  %16 = getelementptr inbounds [2 x [100001 x i32]], ptr @_ZZ5solvevE3arr, i64 0, i64 %15
  %17 = load i32, ptr %16, align 4, !tbaa !5
  %18 = add nsw i32 %17, 1
  store i32 %18, ptr %16, align 4, !tbaa !5
  %19 = sext i32 %18 to i64
  %20 = getelementptr inbounds [2 x [100001 x i32]], ptr @_ZZ5solvevE3arr, i64 0, i64 %15, i64 %19
  store i32 %.02427, ptr %20, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #6
  %21 = add nuw nsw i32 %.02427, 1
  %22 = load i32, ptr %1, align 4, !tbaa !5
  %23 = icmp slt i32 %21, %22
  br i1 %23, label %.lr.ph, label %._crit_edge.loopexit, !llvm.loop !11

24:                                               ; preds = %._crit_edge
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #6
  %25 = icmp sgt i32 %8, 0
  br i1 %25, label %.lr.ph31.preheader, label %.preheader

.lr.ph31.preheader:                               ; preds = %24
  %wide.trip.count = zext nneg i32 %8 to i64
  %min.iters.check = icmp ult i32 %8, 4
  br i1 %min.iters.check, label %.lr.ph31.preheader141, label %vector.ph

.lr.ph31.preheader141:                            ; preds = %middle.block, %.lr.ph31.preheader
  %indvars.iv.ph = phi i64 [ 0, %.lr.ph31.preheader ], [ %n.vec, %middle.block ]
  %storemerge28.ph = phi i64 [ 0, %.lr.ph31.preheader ], [ %40, %middle.block ]
  br label %.lr.ph31

vector.ph:                                        ; preds = %.lr.ph31.preheader
  %n.vec = and i64 %wide.trip.count, 2147483644
  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 ], [ %37, %vector.body ]
  %vec.phi64 = phi <2 x i64> [ zeroinitializer, %vector.ph ], [ %38, %vector.body ]
  %vec.ind = phi <2 x i32> [ <i32 0, i32 1>, %vector.ph ], [ %vec.ind.next, %vector.body ]
  %26 = or disjoint i64 %index, 1
  %27 = getelementptr inbounds [2 x [100001 x i32]], ptr @_ZZ5solvevE3arr, i64 0, i64 0, i64 %26
  %28 = getelementptr inbounds i8, ptr %27, i64 8
  %wide.load = load <2 x i32>, ptr %27, align 4, !tbaa !5
  %wide.load66 = load <2 x i32>, ptr %28, align 4, !tbaa !5
  %29 = shl <2 x i32> %vec.ind, <i32 1, i32 1>
  %step.add = shl <2 x i32> %vec.ind, <i32 1, i32 1>
  %30 = add <2 x i32> %step.add, <i32 4, i32 4>
  %31 = sub nsw <2 x i32> %29, %wide.load
  %32 = sub nsw <2 x i32> %30, %wide.load66
  %33 = call <2 x i32> @llvm.abs.v2i32(<2 x i32> %31, i1 true)
  %34 = call <2 x i32> @llvm.abs.v2i32(<2 x i32> %32, i1 true)
  %35 = zext nneg <2 x i32> %33 to <2 x i64>
  %36 = zext nneg <2 x i32> %34 to <2 x i64>
  %37 = add <2 x i64> %vec.phi, %35
  %38 = add <2 x i64> %vec.phi64, %36
  %index.next = add nuw i64 %index, 4
  %vec.ind.next = add <2 x i32> %vec.ind, <i32 4, i32 4>
  %39 = icmp eq i64 %index.next, %n.vec
  br i1 %39, label %middle.block, label %vector.body, !llvm.loop !13

middle.block:                                     ; preds = %vector.body
  %bin.rdx = add <2 x i64> %38, %37
  %40 = call i64 @llvm.vector.reduce.add.v2i64(<2 x i64> %bin.rdx)
  %cmp.n = icmp eq i64 %n.vec, %wide.trip.count
  br i1 %cmp.n, label %.preheader, label %.lr.ph31.preheader141

.preheader:                                       ; preds = %.lr.ph31, %middle.block, %24
  %storemerge.lcssa = phi i64 [ 0, %24 ], [ %40, %middle.block ], [ %65, %.lr.ph31 ]
  store i64 %storemerge.lcssa, ptr %4, align 8, !tbaa !9
  %41 = icmp sgt i32 %.pre51, 0
  br i1 %41, label %.lr.ph34.preheader, label %66

.lr.ph34.preheader:                               ; preds = %.preheader
  %wide.trip.count45 = zext nneg i32 %.pre51 to i64
  %min.iters.check69 = icmp ult i32 %.pre51, 4
  br i1 %min.iters.check69, label %.lr.ph34.preheader136, label %vector.ph70

.lr.ph34.preheader136:                            ; preds = %middle.block67, %.lr.ph34.preheader
  %indvars.iv42.ph = phi i64 [ 0, %.lr.ph34.preheader ], [ %n.vec72, %middle.block67 ]
  %.ph137 = phi i64 [ %storemerge.lcssa, %.lr.ph34.preheader ], [ %58, %middle.block67 ]
  br label %.lr.ph34

vector.ph70:                                      ; preds = %.lr.ph34.preheader
  %n.vec72 = and i64 %wide.trip.count45, 2147483644
  %42 = insertelement <2 x i64> <i64 poison, i64 0>, i64 %storemerge.lcssa, i64 0
  br label %vector.body74

vector.body74:                                    ; preds = %vector.body74, %vector.ph70
  %index75 = phi i64 [ 0, %vector.ph70 ], [ %index.next84, %vector.body74 ]
  %vec.phi76 = phi <2 x i64> [ %42, %vector.ph70 ], [ %55, %vector.body74 ]
  %vec.phi77 = phi <2 x i64> [ zeroinitializer, %vector.ph70 ], [ %56, %vector.body74 ]
  %vec.ind78 = phi <2 x i32> [ <i32 0, i32 1>, %vector.ph70 ], [ %vec.ind.next81, %vector.body74 ]
  %43 = or disjoint i64 %index75, 1
  %44 = getelementptr inbounds [2 x [100001 x i32]], ptr @_ZZ5solvevE3arr, i64 0, i64 1, i64 %43
  %45 = getelementptr inbounds i8, ptr %44, i64 8
  %wide.load82 = load <2 x i32>, ptr %44, align 8, !tbaa !5
  %wide.load83 = load <2 x i32>, ptr %45, align 16, !tbaa !5
  %46 = shl <2 x i32> %vec.ind78, <i32 1, i32 1>
  %step.add79 = shl <2 x i32> %vec.ind78, <i32 1, i32 1>
  %47 = or disjoint <2 x i32> %46, <i32 1, i32 1>
  %48 = add <2 x i32> %step.add79, <i32 5, i32 5>
  %49 = sub <2 x i32> %47, %wide.load82
  %50 = sub <2 x i32> %48, %wide.load83
  %51 = call <2 x i32> @llvm.abs.v2i32(<2 x i32> %49, i1 true)
  %52 = call <2 x i32> @llvm.abs.v2i32(<2 x i32> %50, i1 true)
  %53 = zext nneg <2 x i32> %51 to <2 x i64>
  %54 = zext nneg <2 x i32> %52 to <2 x i64>
  %55 = add <2 x i64> %vec.phi76, %53
  %56 = add <2 x i64> %vec.phi77, %54
  %index.next84 = add nuw i64 %index75, 4
  %vec.ind.next81 = add <2 x i32> %vec.ind78, <i32 4, i32 4>
  %57 = icmp eq i64 %index.next84, %n.vec72
  br i1 %57, label %middle.block67, label %vector.body74, !llvm.loop !16

middle.block67:                                   ; preds = %vector.body74
  %bin.rdx85 = add <2 x i64> %56, %55
  %58 = call i64 @llvm.vector.reduce.add.v2i64(<2 x i64> %bin.rdx85)
  %cmp.n86 = icmp eq i64 %n.vec72, %wide.trip.count45
  br i1 %cmp.n86, label %._crit_edge35, label %.lr.ph34.preheader136

.lr.ph31:                                         ; preds = %.lr.ph31.preheader141, %.lr.ph31
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph31 ], [ %indvars.iv.ph, %.lr.ph31.preheader141 ]
  %storemerge28 = phi i64 [ %65, %.lr.ph31 ], [ %storemerge28.ph, %.lr.ph31.preheader141 ]
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %59 = getelementptr inbounds [2 x [100001 x i32]], ptr @_ZZ5solvevE3arr, i64 0, i64 0, i64 %indvars.iv.next
  %60 = load i32, ptr %59, align 4, !tbaa !5
  %indvars.iv.tr = trunc i64 %indvars.iv to i32
  %61 = shl i32 %indvars.iv.tr, 1
  %62 = sub nsw i32 %61, %60
  %63 = call i32 @llvm.abs.i32(i32 %62, i1 true)
  %64 = zext nneg i32 %63 to i64
  %65 = add nuw nsw i64 %storemerge28, %64
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %.preheader, label %.lr.ph31, !llvm.loop !17

._crit_edge35:                                    ; preds = %.lr.ph34, %middle.block67
  %.lcssa61 = phi i64 [ %58, %middle.block67 ], [ %77, %.lr.ph34 ]
  store i64 %.lcssa61, ptr %4, align 8, !tbaa !9
  br label %66

66:                                               ; preds = %._crit_edge35, %.preheader
  %67 = 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) %4)
  %68 = load i64, ptr %67, align 8, !tbaa !9
  store i64 %68, ptr %3, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #6
  %.pre50 = load i32, ptr getelementptr inbounds (i8, ptr @_ZZ5solvevE3arr, i64 400004), align 4, !tbaa !5
  br label %78

.lr.ph34:                                         ; preds = %.lr.ph34.preheader136, %.lr.ph34
  %indvars.iv42 = phi i64 [ %indvars.iv.next43, %.lr.ph34 ], [ %indvars.iv42.ph, %.lr.ph34.preheader136 ]
  %69 = phi i64 [ %77, %.lr.ph34 ], [ %.ph137, %.lr.ph34.preheader136 ]
  %indvars.iv.next43 = add nuw nsw i64 %indvars.iv42, 1
  %70 = getelementptr inbounds [2 x [100001 x i32]], ptr @_ZZ5solvevE3arr, i64 0, i64 1, i64 %indvars.iv.next43
  %71 = load i32, ptr %70, align 4, !tbaa !5
  %indvars.iv42.tr = trunc i64 %indvars.iv42 to i32
  %72 = shl i32 %indvars.iv42.tr, 1
  %73 = or disjoint i32 %72, 1
  %74 = sub i32 %73, %71
  %75 = call i32 @llvm.abs.i32(i32 %74, i1 true)
  %76 = zext nneg i32 %75 to i64
  %77 = add nsw i64 %69, %76
  %exitcond46.not = icmp eq i64 %indvars.iv.next43, %wide.trip.count45
  br i1 %exitcond46.not, label %._crit_edge35, label %.lr.ph34, !llvm.loop !18

78:                                               ; preds = %._crit_edge, %66
  %79 = phi i64 [ 4557430888798830399, %._crit_edge ], [ %68, %66 ]
  %80 = phi i32 [ %.pre51, %._crit_edge ], [ %.pre50, %66 ]
  %.not.1 = icmp eq i32 %80, %10
  %81 = load i32, ptr @_ZZ5solvevE3arr, align 16
  %.not26.1 = icmp eq i32 %81, %11
  %or.cond58 = select i1 %.not.1, i1 %.not26.1, i1 false
  br i1 %or.cond58, label %82, label %136

82:                                               ; preds = %78
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #6
  %83 = icmp sgt i32 %10, 0
  br i1 %83, label %.lr.ph31.preheader.1, label %.preheader.1

.lr.ph31.preheader.1:                             ; preds = %82
  %wide.trip.count.1 = zext nneg i32 %10 to i64
  %min.iters.check90 = icmp ult i32 %10, 4
  br i1 %min.iters.check90, label %.lr.ph31.1.preheader, label %vector.ph91

vector.ph91:                                      ; preds = %.lr.ph31.preheader.1
  %n.vec93 = and i64 %wide.trip.count.1, 2147483644
  br label %vector.body95

vector.body95:                                    ; preds = %vector.body95, %vector.ph91
  %index96 = phi i64 [ 0, %vector.ph91 ], [ %index.next105, %vector.body95 ]
  %vec.phi97 = phi <2 x i64> [ zeroinitializer, %vector.ph91 ], [ %95, %vector.body95 ]
  %vec.phi98 = phi <2 x i64> [ zeroinitializer, %vector.ph91 ], [ %96, %vector.body95 ]
  %vec.ind99 = phi <2 x i32> [ <i32 0, i32 1>, %vector.ph91 ], [ %vec.ind.next102, %vector.body95 ]
  %84 = or disjoint i64 %index96, 1
  %85 = getelementptr inbounds [2 x [100001 x i32]], ptr @_ZZ5solvevE3arr, i64 0, i64 1, i64 %84
  %86 = getelementptr inbounds i8, ptr %85, i64 8
  %wide.load103 = load <2 x i32>, ptr %85, align 8, !tbaa !5
  %wide.load104 = load <2 x i32>, ptr %86, align 16, !tbaa !5
  %87 = shl <2 x i32> %vec.ind99, <i32 1, i32 1>
  %step.add100 = shl <2 x i32> %vec.ind99, <i32 1, i32 1>
  %88 = add <2 x i32> %step.add100, <i32 4, i32 4>
  %89 = sub nsw <2 x i32> %87, %wide.load103
  %90 = sub nsw <2 x i32> %88, %wide.load104
  %91 = call <2 x i32> @llvm.abs.v2i32(<2 x i32> %89, i1 true)
  %92 = call <2 x i32> @llvm.abs.v2i32(<2 x i32> %90, i1 true)
  %93 = zext nneg <2 x i32> %91 to <2 x i64>
  %94 = zext nneg <2 x i32> %92 to <2 x i64>
  %95 = add <2 x i64> %vec.phi97, %93
  %96 = add <2 x i64> %vec.phi98, %94
  %index.next105 = add nuw i64 %index96, 4
  %vec.ind.next102 = add <2 x i32> %vec.ind99, <i32 4, i32 4>
  %97 = icmp eq i64 %index.next105, %n.vec93
  br i1 %97, label %middle.block88, label %vector.body95, !llvm.loop !19

middle.block88:                                   ; preds = %vector.body95
  %bin.rdx106 = add <2 x i64> %96, %95
  %98 = call i64 @llvm.vector.reduce.add.v2i64(<2 x i64> %bin.rdx106)
  %cmp.n107 = icmp eq i64 %n.vec93, %wide.trip.count.1
  br i1 %cmp.n107, label %.preheader.1, label %.lr.ph31.1.preheader

.lr.ph31.1.preheader:                             ; preds = %middle.block88, %.lr.ph31.preheader.1
  %indvars.iv.1.ph = phi i64 [ 0, %.lr.ph31.preheader.1 ], [ %n.vec93, %middle.block88 ]
  %storemerge28.1.ph = phi i64 [ 0, %.lr.ph31.preheader.1 ], [ %98, %middle.block88 ]
  br label %.lr.ph31.1

.lr.ph31.1:                                       ; preds = %.lr.ph31.1.preheader, %.lr.ph31.1
  %indvars.iv.1 = phi i64 [ %indvars.iv.next.1, %.lr.ph31.1 ], [ %indvars.iv.1.ph, %.lr.ph31.1.preheader ]
  %storemerge28.1 = phi i64 [ %105, %.lr.ph31.1 ], [ %storemerge28.1.ph, %.lr.ph31.1.preheader ]
  %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv.1, 1
  %99 = getelementptr inbounds [2 x [100001 x i32]], ptr @_ZZ5solvevE3arr, i64 0, i64 1, i64 %indvars.iv.next.1
  %100 = load i32, ptr %99, align 4, !tbaa !5
  %indvars.iv.1.tr = trunc i64 %indvars.iv.1 to i32
  %101 = shl i32 %indvars.iv.1.tr, 1
  %102 = sub nsw i32 %101, %100
  %103 = call i32 @llvm.abs.i32(i32 %102, i1 true)
  %104 = zext nneg i32 %103 to i64
  %105 = add nuw nsw i64 %storemerge28.1, %104
  %exitcond.1.not = icmp eq i64 %indvars.iv.next.1, %wide.trip.count.1
  br i1 %exitcond.1.not, label %.preheader.1, label %.lr.ph31.1, !llvm.loop !20

.preheader.1:                                     ; preds = %.lr.ph31.1, %middle.block88, %82
  %storemerge.lcssa.1 = phi i64 [ 0, %82 ], [ %98, %middle.block88 ], [ %105, %.lr.ph31.1 ]
  store i64 %storemerge.lcssa.1, ptr %4, align 8, !tbaa !9
  %106 = icmp sgt i32 %11, 0
  br i1 %106, label %.lr.ph34.preheader.1, label %133

.lr.ph34.preheader.1:                             ; preds = %.preheader.1
  %wide.trip.count45.1 = zext nneg i32 %11 to i64
  %min.iters.check111 = icmp ult i32 %11, 4
  br i1 %min.iters.check111, label %.lr.ph34.1.preheader, label %vector.ph112

vector.ph112:                                     ; preds = %.lr.ph34.preheader.1
  %n.vec114 = and i64 %wide.trip.count45.1, 2147483644
  %107 = insertelement <2 x i64> <i64 poison, i64 0>, i64 %storemerge.lcssa.1, i64 0
  br label %vector.body116

vector.body116:                                   ; preds = %vector.body116, %vector.ph112
  %index117 = phi i64 [ 0, %vector.ph112 ], [ %index.next126, %vector.body116 ]
  %vec.phi118 = phi <2 x i64> [ %107, %vector.ph112 ], [ %120, %vector.body116 ]
  %vec.phi119 = phi <2 x i64> [ zeroinitializer, %vector.ph112 ], [ %121, %vector.body116 ]
  %vec.ind120 = phi <2 x i32> [ <i32 0, i32 1>, %vector.ph112 ], [ %vec.ind.next123, %vector.body116 ]
  %108 = or disjoint i64 %index117, 1
  %109 = getelementptr inbounds [2 x [100001 x i32]], ptr @_ZZ5solvevE3arr, i64 0, i64 0, i64 %108
  %110 = getelementptr inbounds i8, ptr %109, i64 8
  %wide.load124 = load <2 x i32>, ptr %109, align 4, !tbaa !5
  %wide.load125 = load <2 x i32>, ptr %110, align 4, !tbaa !5
  %111 = shl <2 x i32> %vec.ind120, <i32 1, i32 1>
  %step.add121 = shl <2 x i32> %vec.ind120, <i32 1, i32 1>
  %112 = or disjoint <2 x i32> %111, <i32 1, i32 1>
  %113 = add <2 x i32> %step.add121, <i32 5, i32 5>
  %114 = sub <2 x i32> %112, %wide.load124
  %115 = sub <2 x i32> %113, %wide.load125
  %116 = call <2 x i32> @llvm.abs.v2i32(<2 x i32> %114, i1 true)
  %117 = call <2 x i32> @llvm.abs.v2i32(<2 x i32> %115, i1 true)
  %118 = zext nneg <2 x i32> %116 to <2 x i64>
  %119 = zext nneg <2 x i32> %117 to <2 x i64>
  %120 = add <2 x i64> %vec.phi118, %118
  %121 = add <2 x i64> %vec.phi119, %119
  %index.next126 = add nuw i64 %index117, 4
  %vec.ind.next123 = add <2 x i32> %vec.ind120, <i32 4, i32 4>
  %122 = icmp eq i64 %index.next126, %n.vec114
  br i1 %122, label %middle.block109, label %vector.body116, !llvm.loop !21

middle.block109:                                  ; preds = %vector.body116
  %bin.rdx127 = add <2 x i64> %121, %120
  %123 = call i64 @llvm.vector.reduce.add.v2i64(<2 x i64> %bin.rdx127)
  %cmp.n128 = icmp eq i64 %n.vec114, %wide.trip.count45.1
  br i1 %cmp.n128, label %._crit_edge35.1, label %.lr.ph34.1.preheader

.lr.ph34.1.preheader:                             ; preds = %middle.block109, %.lr.ph34.preheader.1
  %indvars.iv42.1.ph = phi i64 [ 0, %.lr.ph34.preheader.1 ], [ %n.vec114, %middle.block109 ]
  %.ph = phi i64 [ %storemerge.lcssa.1, %.lr.ph34.preheader.1 ], [ %123, %middle.block109 ]
  br label %.lr.ph34.1

.lr.ph34.1:                                       ; preds = %.lr.ph34.1.preheader, %.lr.ph34.1
  %indvars.iv42.1 = phi i64 [ %indvars.iv.next43.1, %.lr.ph34.1 ], [ %indvars.iv42.1.ph, %.lr.ph34.1.preheader ]
  %124 = phi i64 [ %132, %.lr.ph34.1 ], [ %.ph, %.lr.ph34.1.preheader ]
  %indvars.iv.next43.1 = add nuw nsw i64 %indvars.iv42.1, 1
  %125 = getelementptr inbounds [2 x [100001 x i32]], ptr @_ZZ5solvevE3arr, i64 0, i64 0, i64 %indvars.iv.next43.1
  %126 = load i32, ptr %125, align 4, !tbaa !5
  %indvars.iv42.1.tr = trunc i64 %indvars.iv42.1 to i32
  %127 = shl i32 %indvars.iv42.1.tr, 1
  %128 = or disjoint i32 %127, 1
  %129 = sub i32 %128, %126
  %130 = call i32 @llvm.abs.i32(i32 %129, i1 true)
  %131 = zext nneg i32 %130 to i64
  %132 = add nsw i64 %124, %131
  %exitcond46.1.not = icmp eq i64 %indvars.iv.next43.1, %wide.trip.count45.1
  br i1 %exitcond46.1.not, label %._crit_edge35.1, label %.lr.ph34.1, !llvm.loop !22

._crit_edge35.1:                                  ; preds = %.lr.ph34.1, %middle.block109
  %.lcssa59 = phi i64 [ %123, %middle.block109 ], [ %132, %.lr.ph34.1 ]
  store i64 %.lcssa59, ptr %4, align 8, !tbaa !9
  br label %133

133:                                              ; preds = %._crit_edge35.1, %.preheader.1
  %134 = 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) %4)
  %135 = load i64, ptr %134, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #6
  br label %136

136:                                              ; preds = %133, %78
  %137 = phi i64 [ %135, %133 ], [ %79, %78 ]
  %138 = icmp slt i64 %137, 4557430888798830399
  %139 = ashr i64 %137, 1
  %140 = select i1 %138, i64 %139, i64 -1
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #6
  ret i64 %140
}

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

; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) 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: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.abs.i32(i32, i1 immarg) #3

; 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 #4

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <2 x i32> @llvm.abs.v2i32(<2 x i32>, i1 immarg) #5

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.vector.reduce.add.v2i64(<2 x i64>) #5

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

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

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


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