; LLVM IR from kazunetakahashi/atcoder :: 2019/0616_ABC130/past (D)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"class.std::basic_ostream" = type { ptr, %"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_istream" = type { ptr, i64, %"class.std::basic_ios" }

@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@N = external dso_local global i64, align 8
@K = external dso_local global i64, align 8
@a = external dso_local global [100010 x i64], align 16
@sum = external dso_local global [100010 x i64], align 16
@mini = external dso_local global [100010 x i64], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #0 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)) #1

; 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)) #0 align 2

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) #0 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: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #3 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i64, align 8
  %9 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %10 = 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)
  %11 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %10, ptr noundef nonnull align 8 dereferenceable(8) @K)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #5
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %12

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

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

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

23:                                               ; preds = %18
  %24 = load i32, ptr %2, align 4, !tbaa !5
  %25 = add nsw i32 %24, 1
  store i32 %25, ptr %2, align 4, !tbaa !5
  br label %12, !llvm.loop !11

26:                                               ; preds = %17
  store i64 0, ptr @sum, align 16, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #5
  store i32 0, ptr %3, align 4, !tbaa !5
  br label %27

27:                                               ; preds = %47, %26
  %28 = load i32, ptr %3, align 4, !tbaa !5
  %29 = sext i32 %28 to i64
  %30 = load i64, ptr @N, align 8, !tbaa !9
  %31 = icmp slt i64 %29, %30
  br i1 %31, label %33, label %32

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

33:                                               ; preds = %27
  %34 = load i32, ptr %3, align 4, !tbaa !5
  %35 = sext i32 %34 to i64
  %36 = getelementptr inbounds [100010 x i64], ptr @sum, i64 0, i64 %35
  %37 = load i64, ptr %36, align 8, !tbaa !9
  %38 = load i32, ptr %3, align 4, !tbaa !5
  %39 = sext i32 %38 to i64
  %40 = getelementptr inbounds [100010 x i64], ptr @a, i64 0, i64 %39
  %41 = load i64, ptr %40, align 8, !tbaa !9
  %42 = add nsw i64 %37, %41
  %43 = load i32, ptr %3, align 4, !tbaa !5
  %44 = add nsw i32 %43, 1
  %45 = sext i32 %44 to i64
  %46 = getelementptr inbounds [100010 x i64], ptr @sum, i64 0, i64 %45
  store i64 %42, ptr %46, align 8, !tbaa !9
  br label %47

47:                                               ; preds = %33
  %48 = load i32, ptr %3, align 4, !tbaa !5
  %49 = add nsw i32 %48, 1
  store i32 %49, ptr %3, align 4, !tbaa !5
  br label %27, !llvm.loop !13

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

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

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

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

59:                                               ; preds = %85, %57
  %60 = load i32, ptr %6, align 4, !tbaa !5
  %61 = load i32, ptr %5, align 4, !tbaa !5
  %62 = sub nsw i32 %60, %61
  %63 = call i32 @llvm.abs.i32(i32 %62, i1 true)
  %64 = icmp sgt i32 %63, 1
  br i1 %64, label %65, label %86

65:                                               ; preds = %59
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  %66 = load i32, ptr %6, align 4, !tbaa !5
  %67 = load i32, ptr %5, align 4, !tbaa !5
  %68 = add nsw i32 %66, %67
  %69 = sdiv i32 %68, 2
  store i32 %69, ptr %7, align 4, !tbaa !5
  %70 = load i32, ptr %4, align 4, !tbaa !5
  %71 = sext i32 %70 to i64
  %72 = getelementptr inbounds [100010 x i64], ptr @sum, i64 0, i64 %71
  %73 = load i64, ptr %72, align 8, !tbaa !9
  %74 = load i32, ptr %7, align 4, !tbaa !5
  %75 = sext i32 %74 to i64
  %76 = getelementptr inbounds [100010 x i64], ptr @sum, i64 0, i64 %75
  %77 = load i64, ptr %76, align 8, !tbaa !9
  %78 = sub nsw i64 %73, %77
  %79 = load i64, ptr @K, align 8, !tbaa !9
  %80 = icmp sge i64 %78, %79
  br i1 %80, label %81, label %83

81:                                               ; preds = %65
  %82 = load i32, ptr %7, align 4, !tbaa !5
  store i32 %82, ptr %6, align 4, !tbaa !5
  br label %85

83:                                               ; preds = %65
  %84 = load i32, ptr %7, align 4, !tbaa !5
  store i32 %84, ptr %5, align 4, !tbaa !5
  br label %85

85:                                               ; preds = %83, %81
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  br label %59, !llvm.loop !14

86:                                               ; preds = %59
  %87 = load i32, ptr %6, align 4, !tbaa !5
  %88 = sext i32 %87 to i64
  %89 = load i32, ptr %4, align 4, !tbaa !5
  %90 = sext i32 %89 to i64
  %91 = getelementptr inbounds [100010 x i64], ptr @mini, i64 0, i64 %90
  store i64 %88, ptr %91, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  br label %92

92:                                               ; preds = %86
  %93 = load i32, ptr %4, align 4, !tbaa !5
  %94 = add nsw i32 %93, 1
  store i32 %94, ptr %4, align 4, !tbaa !5
  br label %51, !llvm.loop !15

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

96:                                               ; preds = %110, %95
  %97 = load i32, ptr %9, align 4, !tbaa !5
  %98 = sext i32 %97 to i64
  %99 = load i64, ptr @N, align 8, !tbaa !9
  %100 = icmp sle i64 %98, %99
  br i1 %100, label %102, label %101

101:                                              ; preds = %96
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  br label %113

102:                                              ; preds = %96
  %103 = load i32, ptr %9, align 4, !tbaa !5
  %104 = sext i32 %103 to i64
  %105 = getelementptr inbounds [100010 x i64], ptr @mini, i64 0, i64 %104
  %106 = load i64, ptr %105, align 8, !tbaa !9
  %107 = add nsw i64 %106, 1
  %108 = load i64, ptr %8, align 8, !tbaa !9
  %109 = add nsw i64 %108, %107
  store i64 %109, ptr %8, align 8, !tbaa !9
  br label %110

110:                                              ; preds = %102
  %111 = load i32, ptr %9, align 4, !tbaa !5
  %112 = add nsw i32 %111, 1
  store i32 %112, ptr %9, align 4, !tbaa !5
  br label %96, !llvm.loop !16

113:                                              ; preds = %101
  %114 = load i64, ptr %8, align 8, !tbaa !9
  %115 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %114)
  %116 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %115, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  %117 = load i32, ptr %1, align 4
  ret i32 %117
}

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.abs.i32(i32, i1 immarg) #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 = { 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 #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { 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 #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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}


; 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_ostream" = type { ptr, %"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_istream" = type { ptr, i64, %"class.std::basic_ios" }

@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@N = external dso_local global i64, align 8
@K = external dso_local global i64, align 8
@a = external dso_local global [100010 x i64], align 16
@sum = external dso_local local_unnamed_addr global [100010 x i64], align 16
@mini = external dso_local local_unnamed_addr global [100010 x i64], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8

; 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 #0 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)) #1

; 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 #0 align 2

; 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 #0 align 2

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #2 {
  %1 = 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)
  %2 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %1, ptr noundef nonnull align 8 dereferenceable(8) @K)
  %3 = load i64, ptr @N, align 8, !tbaa !5
  %4 = icmp sgt i64 %3, 0
  br i1 %4, label %.lr.ph, label %._crit_edge.thread

._crit_edge.thread:                               ; preds = %0
  store i64 0, ptr @sum, align 16, !tbaa !5
  br label %._crit_edge57

._crit_edge:                                      ; preds = %.lr.ph
  store i64 0, ptr @sum, align 16, !tbaa !5
  %5 = icmp sgt i64 %9, 0
  br i1 %5, label %.lr.ph45.preheader, label %._crit_edge57

.lr.ph45.preheader:                               ; preds = %._crit_edge
  %xtraiter = and i64 %9, 3
  %6 = icmp ult i64 %9, 4
  br i1 %6, label %.preheader40.lr.ph.unr-lcssa, label %.lr.ph45.preheader.new

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

.lr.ph:                                           ; preds = %0, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %0 ]
  %7 = getelementptr inbounds [100010 x i64], ptr @a, i64 0, i64 %indvars.iv
  %8 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %7)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %9 = load i64, ptr @N, align 8, !tbaa !5
  %10 = icmp sgt i64 %9, %indvars.iv.next
  br i1 %10, label %.lr.ph, label %._crit_edge, !llvm.loop !9

.preheader40.lr.ph.unr-lcssa:                     ; preds = %.lr.ph45, %.lr.ph45.preheader
  %.unr = phi i64 [ 0, %.lr.ph45.preheader ], [ %32, %.lr.ph45 ]
  %indvars.iv62.unr = phi i64 [ 0, %.lr.ph45.preheader ], [ %indvars.iv.next63.3, %.lr.ph45 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.preheader40.lr.ph, label %.lr.ph45.epil

.lr.ph45.epil:                                    ; preds = %.preheader40.lr.ph.unr-lcssa, %.lr.ph45.epil
  %11 = phi i64 [ %14, %.lr.ph45.epil ], [ %.unr, %.preheader40.lr.ph.unr-lcssa ]
  %indvars.iv62.epil = phi i64 [ %indvars.iv.next63.epil, %.lr.ph45.epil ], [ %indvars.iv62.unr, %.preheader40.lr.ph.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.lr.ph45.epil ], [ 0, %.preheader40.lr.ph.unr-lcssa ]
  %12 = getelementptr inbounds [100010 x i64], ptr @a, i64 0, i64 %indvars.iv62.epil
  %13 = load i64, ptr %12, align 8, !tbaa !5
  %14 = add nsw i64 %13, %11
  %indvars.iv.next63.epil = add nuw nsw i64 %indvars.iv62.epil, 1
  %15 = getelementptr inbounds [100010 x i64], ptr @sum, i64 0, i64 %indvars.iv.next63.epil
  store i64 %14, ptr %15, align 8, !tbaa !5
  %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 %.preheader40.lr.ph, label %.lr.ph45.epil, !llvm.loop !11

.preheader40.lr.ph:                               ; preds = %.lr.ph45.epil, %.preheader40.lr.ph.unr-lcssa
  %16 = load i64, ptr @K, align 8
  br label %.lr.ph48

.lr.ph45:                                         ; preds = %.lr.ph45, %.lr.ph45.preheader.new
  %17 = phi i64 [ 0, %.lr.ph45.preheader.new ], [ %32, %.lr.ph45 ]
  %indvars.iv62 = phi i64 [ 0, %.lr.ph45.preheader.new ], [ %indvars.iv.next63.3, %.lr.ph45 ]
  %niter = phi i64 [ 0, %.lr.ph45.preheader.new ], [ %niter.next.3, %.lr.ph45 ]
  %18 = getelementptr inbounds [100010 x i64], ptr @a, i64 0, i64 %indvars.iv62
  %19 = load i64, ptr %18, align 16, !tbaa !5
  %20 = add nsw i64 %19, %17
  %indvars.iv.next63 = or disjoint i64 %indvars.iv62, 1
  %21 = getelementptr inbounds [100010 x i64], ptr @sum, i64 0, i64 %indvars.iv.next63
  store i64 %20, ptr %21, align 8, !tbaa !5
  %22 = getelementptr inbounds [100010 x i64], ptr @a, i64 0, i64 %indvars.iv.next63
  %23 = load i64, ptr %22, align 8, !tbaa !5
  %24 = add nsw i64 %23, %20
  %indvars.iv.next63.1 = or disjoint i64 %indvars.iv62, 2
  %25 = getelementptr inbounds [100010 x i64], ptr @sum, i64 0, i64 %indvars.iv.next63.1
  store i64 %24, ptr %25, align 16, !tbaa !5
  %26 = getelementptr inbounds [100010 x i64], ptr @a, i64 0, i64 %indvars.iv.next63.1
  %27 = load i64, ptr %26, align 16, !tbaa !5
  %28 = add nsw i64 %27, %24
  %indvars.iv.next63.2 = or disjoint i64 %indvars.iv62, 3
  %29 = getelementptr inbounds [100010 x i64], ptr @sum, i64 0, i64 %indvars.iv.next63.2
  store i64 %28, ptr %29, align 8, !tbaa !5
  %30 = getelementptr inbounds [100010 x i64], ptr @a, i64 0, i64 %indvars.iv.next63.2
  %31 = load i64, ptr %30, align 8, !tbaa !5
  %32 = add nsw i64 %31, %28
  %indvars.iv.next63.3 = add nuw nsw i64 %indvars.iv62, 4
  %33 = getelementptr inbounds [100010 x i64], ptr @sum, i64 0, i64 %indvars.iv.next63.3
  store i64 %32, ptr %33, align 16, !tbaa !5
  %niter.next.3 = add i64 %niter, 4
  %niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
  br i1 %niter.ncmp.3, label %.preheader40.lr.ph.unr-lcssa, label %.lr.ph45, !llvm.loop !13

.lr.ph48:                                         ; preds = %._crit_edge49, %.preheader40.lr.ph
  %indvars.iv65 = phi i64 [ 1, %.preheader40.lr.ph ], [ %indvars.iv.next66, %._crit_edge49 ]
  %34 = getelementptr inbounds [100010 x i64], ptr @sum, i64 0, i64 %indvars.iv65
  %35 = load i64, ptr %34, align 8, !tbaa !5
  %36 = trunc nuw nsw i64 %indvars.iv65 to i32
  br label %45

.preheader:                                       ; preds = %._crit_edge49
  %min.iters.check = icmp ult i64 %9, 4
  br i1 %min.iters.check, label %.lr.ph56.preheader, label %vector.ph

.lr.ph56.preheader:                               ; preds = %middle.block, %.preheader
  %indvars.iv69.ph = phi i64 [ 1, %.preheader ], [ %ind.end, %middle.block ]
  %.02754.ph = phi i64 [ 0, %.preheader ], [ %44, %middle.block ]
  br label %.lr.ph56

vector.ph:                                        ; preds = %.preheader
  %n.vec = and i64 %9, 9223372036854775804
  %ind.end = or disjoint i64 %n.vec, 1
  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 ], [ %41, %vector.body ]
  %vec.phi84 = phi <2 x i64> [ zeroinitializer, %vector.ph ], [ %42, %vector.body ]
  %offset.idx = or disjoint i64 %index, 1
  %37 = getelementptr inbounds [100010 x i64], ptr @mini, i64 0, i64 %offset.idx
  %38 = getelementptr inbounds i8, ptr %37, i64 16
  %wide.load = load <2 x i64>, ptr %37, align 8, !tbaa !5
  %wide.load85 = load <2 x i64>, ptr %38, align 8, !tbaa !5
  %39 = add <2 x i64> %vec.phi, <i64 1, i64 1>
  %40 = add <2 x i64> %vec.phi84, <i64 1, i64 1>
  %41 = add <2 x i64> %39, %wide.load
  %42 = add <2 x i64> %40, %wide.load85
  %index.next = add nuw i64 %index, 4
  %43 = icmp eq i64 %index.next, %n.vec
  br i1 %43, label %middle.block, label %vector.body, !llvm.loop !14

middle.block:                                     ; preds = %vector.body
  %bin.rdx = add <2 x i64> %42, %41
  %44 = tail call i64 @llvm.vector.reduce.add.v2i64(<2 x i64> %bin.rdx)
  %cmp.n = icmp eq i64 %9, %n.vec
  br i1 %cmp.n, label %._crit_edge57, label %.lr.ph56.preheader

45:                                               ; preds = %.lr.ph48, %45
  %.02947 = phi i32 [ -1, %.lr.ph48 ], [ %.029., %45 ]
  %.03046 = phi i32 [ %36, %.lr.ph48 ], [ %..030, %45 ]
  %46 = add nsw i32 %.02947, %.03046
  %47 = sdiv i32 %46, 2
  %48 = sext i32 %47 to i64
  %49 = getelementptr inbounds [100010 x i64], ptr @sum, i64 0, i64 %48
  %50 = load i64, ptr %49, align 8, !tbaa !5
  %51 = sub nsw i64 %35, %50
  %.not39 = icmp slt i64 %51, %16
  %..030 = select i1 %.not39, i32 %47, i32 %.03046
  %.029. = select i1 %.not39, i32 %.02947, i32 %47
  %52 = sub nsw i32 %.029., %..030
  %53 = tail call i32 @llvm.abs.i32(i32 %52, i1 true)
  %54 = icmp ugt i32 %53, 1
  br i1 %54, label %45, label %._crit_edge49, !llvm.loop !17

._crit_edge49:                                    ; preds = %45
  %55 = sext i32 %.029. to i64
  %56 = getelementptr inbounds [100010 x i64], ptr @mini, i64 0, i64 %indvars.iv65
  store i64 %55, ptr %56, align 8, !tbaa !5
  %indvars.iv.next66 = add nuw nsw i64 %indvars.iv65, 1
  %exitcond68 = icmp eq i64 %indvars.iv65, %9
  br i1 %exitcond68, label %.preheader, label %.lr.ph48, !llvm.loop !18

._crit_edge57:                                    ; preds = %.lr.ph56, %middle.block, %._crit_edge, %._crit_edge.thread
  %.027.lcssa = phi i64 [ 0, %._crit_edge.thread ], [ 0, %._crit_edge ], [ %44, %middle.block ], [ %62, %.lr.ph56 ]
  %57 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %.027.lcssa)
  %58 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %57, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  ret i32 0

.lr.ph56:                                         ; preds = %.lr.ph56.preheader, %.lr.ph56
  %indvars.iv69 = phi i64 [ %indvars.iv.next70, %.lr.ph56 ], [ %indvars.iv69.ph, %.lr.ph56.preheader ]
  %.02754 = phi i64 [ %62, %.lr.ph56 ], [ %.02754.ph, %.lr.ph56.preheader ]
  %59 = getelementptr inbounds [100010 x i64], ptr @mini, i64 0, i64 %indvars.iv69
  %60 = load i64, ptr %59, align 8, !tbaa !5
  %61 = add i64 %.02754, 1
  %62 = add i64 %61, %60
  %indvars.iv.next70 = add nuw nsw i64 %indvars.iv69, 1
  %exitcond72 = icmp eq i64 %indvars.iv69, %9
  br i1 %exitcond72, label %._crit_edge57, label %.lr.ph56, !llvm.loop !19
}

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.vector.reduce.add.v2i64(<2 x i64>) #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 = { 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 #2 = { 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 #3 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }

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

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


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