; LLVM IR from VastoLorde95/Competitive-Programming :: Codeforces/266 Division 2/Problem C (C)

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

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

@n = external dso_local global i32, align 4
@a = external dso_local global [500000 x i64], align 16
@sum = external dso_local global [500000 x i64], align 16
@val = external dso_local global i64, align 8
@cnt = external dso_local global i64, align 8
@res = external dso_local global i64, align 8
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %4 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) @n)
  %5 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) @a)
  %6 = load i64, ptr @a, align 16, !tbaa !5
  store i64 %6, ptr @sum, align 16, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #5
  store i32 1, ptr %2, align 4, !tbaa !9
  br label %7

7:                                                ; preds = %30, %0
  %8 = load i32, ptr %2, align 4, !tbaa !9
  %9 = load i32, ptr @n, align 4, !tbaa !9
  %10 = icmp slt i32 %8, %9
  br i1 %10, label %12, label %11

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

12:                                               ; preds = %7
  %13 = load i32, ptr %2, align 4, !tbaa !9
  %14 = sext i32 %13 to i64
  %15 = getelementptr inbounds [500000 x i64], ptr @a, i64 0, i64 %14
  %16 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %15)
  %17 = load i32, ptr %2, align 4, !tbaa !9
  %18 = sub nsw i32 %17, 1
  %19 = sext i32 %18 to i64
  %20 = getelementptr inbounds [500000 x i64], ptr @sum, i64 0, i64 %19
  %21 = load i64, ptr %20, align 8, !tbaa !5
  %22 = load i32, ptr %2, align 4, !tbaa !9
  %23 = sext i32 %22 to i64
  %24 = getelementptr inbounds [500000 x i64], ptr @a, i64 0, i64 %23
  %25 = load i64, ptr %24, align 8, !tbaa !5
  %26 = add nsw i64 %21, %25
  %27 = load i32, ptr %2, align 4, !tbaa !9
  %28 = sext i32 %27 to i64
  %29 = getelementptr inbounds [500000 x i64], ptr @sum, i64 0, i64 %28
  store i64 %26, ptr %29, align 8, !tbaa !5
  br label %30

30:                                               ; preds = %12
  %31 = load i32, ptr %2, align 4, !tbaa !9
  %32 = add nsw i32 %31, 1
  store i32 %32, ptr %2, align 4, !tbaa !9
  br label %7, !llvm.loop !11

33:                                               ; preds = %11
  %34 = load i32, ptr @n, align 4, !tbaa !9
  %35 = sub nsw i32 %34, 1
  %36 = sext i32 %35 to i64
  %37 = getelementptr inbounds [500000 x i64], ptr @sum, i64 0, i64 %36
  %38 = load i64, ptr %37, align 8, !tbaa !5
  %39 = srem i64 %38, 3
  %40 = icmp ne i64 %39, 0
  br i1 %40, label %41, label %44

41:                                               ; preds = %33
  %42 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef 0)
  %43 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %42, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  store i32 0, ptr %1, align 4
  br label %95

44:                                               ; preds = %33
  %45 = load i32, ptr @n, align 4, !tbaa !9
  %46 = sub nsw i32 %45, 1
  %47 = sext i32 %46 to i64
  %48 = getelementptr inbounds [500000 x i64], ptr @sum, i64 0, i64 %47
  %49 = load i64, ptr %48, align 8, !tbaa !5
  %50 = sdiv i64 %49, 3
  store i64 %50, ptr @val, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #5
  store i32 0, ptr %3, align 4, !tbaa !9
  br label %51

51:                                               ; preds = %88, %44
  %52 = load i32, ptr %3, align 4, !tbaa !9
  %53 = load i32, ptr @n, align 4, !tbaa !9
  %54 = sub nsw i32 %53, 1
  %55 = icmp slt i32 %52, %54
  br i1 %55, label %57, label %56

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

57:                                               ; preds = %51
  %58 = load i32, ptr %3, align 4, !tbaa !9
  %59 = sext i32 %58 to i64
  %60 = getelementptr inbounds [500000 x i64], ptr @sum, i64 0, i64 %59
  %61 = load i64, ptr %60, align 8, !tbaa !5
  %62 = load i64, ptr @val, align 8, !tbaa !5
  %63 = icmp eq i64 %61, %62
  br i1 %63, label %64, label %74

64:                                               ; preds = %57
  %65 = load i64, ptr @val, align 8, !tbaa !5
  %66 = icmp eq i64 %65, 0
  br i1 %66, label %67, label %71

67:                                               ; preds = %64
  %68 = load i64, ptr @cnt, align 8, !tbaa !5
  %69 = load i64, ptr @res, align 8, !tbaa !5
  %70 = add nsw i64 %69, %68
  store i64 %70, ptr @res, align 8, !tbaa !5
  br label %71

71:                                               ; preds = %67, %64
  %72 = load i64, ptr @cnt, align 8, !tbaa !5
  %73 = add nsw i64 %72, 1
  store i64 %73, ptr @cnt, align 8, !tbaa !5
  br label %87

74:                                               ; preds = %57
  %75 = load i32, ptr %3, align 4, !tbaa !9
  %76 = sext i32 %75 to i64
  %77 = getelementptr inbounds [500000 x i64], ptr @sum, i64 0, i64 %76
  %78 = load i64, ptr %77, align 8, !tbaa !5
  %79 = load i64, ptr @val, align 8, !tbaa !5
  %80 = mul nsw i64 2, %79
  %81 = icmp eq i64 %78, %80
  br i1 %81, label %82, label %86

82:                                               ; preds = %74
  %83 = load i64, ptr @cnt, align 8, !tbaa !5
  %84 = load i64, ptr @res, align 8, !tbaa !5
  %85 = add nsw i64 %84, %83
  store i64 %85, ptr @res, align 8, !tbaa !5
  br label %86

86:                                               ; preds = %82, %74
  br label %87

87:                                               ; preds = %86, %71
  br label %88

88:                                               ; preds = %87
  %89 = load i32, ptr %3, align 4, !tbaa !9
  %90 = add nsw i32 %89, 1
  store i32 %90, ptr %3, align 4, !tbaa !9
  br label %51, !llvm.loop !13

91:                                               ; preds = %56
  %92 = load i64, ptr @res, align 8, !tbaa !5
  %93 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %92)
  %94 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %93, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  store i32 0, ptr %1, align 4
  br label %95

95:                                               ; preds = %91, %41
  %96 = load i32, ptr %1, align 4
  ret i32 %96
}

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4)) #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)) #2 align 2

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

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

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) #1

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

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

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

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"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}


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

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

@n = external dso_local global i32, align 4
@a = external dso_local global [500000 x i64], align 16
@sum = external dso_local local_unnamed_addr global [500000 x i64], align 16
@val = external dso_local local_unnamed_addr global i64, align 8
@cnt = external dso_local local_unnamed_addr global i64, align 8
@res = external dso_local local_unnamed_addr global i64, align 8
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

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

._crit_edge:                                      ; preds = %.lr.ph, %0
  %.lcssa = phi i32 [ %4, %0 ], [ %20, %.lr.ph ]
  %6 = add nsw i32 %.lcssa, -1
  %7 = sext i32 %6 to i64
  %8 = getelementptr inbounds [500000 x i64], ptr @sum, i64 0, i64 %7
  %9 = load i64, ptr %8, align 8, !tbaa !5
  %.fr = freeze i64 %9
  %10 = srem i64 %.fr, 3
  %11 = sdiv i64 %.fr, 3
  %.not = icmp eq i64 %10, 0
  br i1 %.not, label %25, label %23

.lr.ph:                                           ; preds = %0, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 1, %0 ]
  %12 = getelementptr inbounds [500000 x i64], ptr @a, i64 0, i64 %indvars.iv
  %13 = 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) %12)
  %14 = add nsw i64 %indvars.iv, -1
  %15 = getelementptr inbounds [500000 x i64], ptr @sum, i64 0, i64 %14
  %16 = load i64, ptr %15, align 8, !tbaa !5
  %17 = load i64, ptr %12, align 8, !tbaa !5
  %18 = add nsw i64 %17, %16
  %19 = getelementptr inbounds [500000 x i64], ptr @sum, i64 0, i64 %indvars.iv
  store i64 %18, ptr %19, align 8, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %20 = load i32, ptr @n, align 4, !tbaa !9
  %21 = sext i32 %20 to i64
  %22 = icmp slt i64 %indvars.iv.next, %21
  br i1 %22, label %.lr.ph, label %._crit_edge, !llvm.loop !11

23:                                               ; preds = %._crit_edge
  %24 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef 0)
  br label %81

25:                                               ; preds = %._crit_edge
  store i64 %11, ptr @val, align 8, !tbaa !5
  %26 = icmp sgt i32 %.lcssa, 1
  %res.promoted = load i64, ptr @res, align 8, !tbaa !5
  br i1 %26, label %.lr.ph19, label %._crit_edge20

.lr.ph19:                                         ; preds = %25
  %cnt.promoted = load i64, ptr @cnt, align 8, !tbaa !5
  %27 = shl nsw i64 %11, 1
  %.off = add i64 %.fr, 2
  %28 = icmp ult i64 %.off, 5
  %wide.trip.count30 = zext i32 %6 to i64
  br i1 %28, label %.lr.ph19.split.us, label %.lr.ph19.split.preheader

.lr.ph19.split.preheader:                         ; preds = %.lr.ph19
  %xtraiter = and i64 %wide.trip.count30, 1
  %29 = icmp eq i32 %6, 1
  br i1 %29, label %._crit_edge20.loopexit41.unr-lcssa, label %.lr.ph19.split.preheader.new

.lr.ph19.split.preheader.new:                     ; preds = %.lr.ph19.split.preheader
  %unroll_iter = and i64 %wide.trip.count30, 4294967294
  br label %.lr.ph19.split

.lr.ph19.split.us:                                ; preds = %.lr.ph19, %42
  %indvars.iv27 = phi i64 [ %indvars.iv.next28, %42 ], [ 0, %.lr.ph19 ]
  %30 = phi i64 [ %44, %42 ], [ %cnt.promoted, %.lr.ph19 ]
  %31 = phi i64 [ %43, %42 ], [ %res.promoted, %.lr.ph19 ]
  %32 = getelementptr inbounds [500000 x i64], ptr @sum, i64 0, i64 %indvars.iv27
  %33 = load i64, ptr %32, align 8, !tbaa !5
  %34 = icmp eq i64 %33, %11
  br i1 %34, label %39, label %35

35:                                               ; preds = %.lr.ph19.split.us
  %36 = icmp eq i64 %33, %27
  br i1 %36, label %37, label %42

37:                                               ; preds = %35
  %38 = add nsw i64 %31, %30
  store i64 %38, ptr @res, align 8, !tbaa !5
  br label %42

39:                                               ; preds = %.lr.ph19.split.us
  %40 = add nsw i64 %31, %30
  store i64 %40, ptr @res, align 8, !tbaa !5
  %41 = add nsw i64 %30, 1
  store i64 %41, ptr @cnt, align 8, !tbaa !5
  br label %42

42:                                               ; preds = %39, %37, %35
  %43 = phi i64 [ %40, %39 ], [ %38, %37 ], [ %31, %35 ]
  %44 = phi i64 [ %41, %39 ], [ %30, %37 ], [ %30, %35 ]
  %indvars.iv.next28 = add nuw nsw i64 %indvars.iv27, 1
  %exitcond31.not = icmp eq i64 %indvars.iv.next28, %wide.trip.count30
  br i1 %exitcond31.not, label %._crit_edge20, label %.lr.ph19.split.us, !llvm.loop !13

._crit_edge20.loopexit41.unr-lcssa:               ; preds = %78, %.lr.ph19.split.preheader
  %.lcssa42.ph = phi i64 [ poison, %.lr.ph19.split.preheader ], [ %79, %78 ]
  %indvars.iv24.unr = phi i64 [ 0, %.lr.ph19.split.preheader ], [ %indvars.iv.next25.1, %78 ]
  %.unr = phi i64 [ %cnt.promoted, %.lr.ph19.split.preheader ], [ %80, %78 ]
  %.unr44 = phi i64 [ %res.promoted, %.lr.ph19.split.preheader ], [ %79, %78 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge20, label %.lr.ph19.split.epil

.lr.ph19.split.epil:                              ; preds = %._crit_edge20.loopexit41.unr-lcssa
  %45 = getelementptr inbounds [500000 x i64], ptr @sum, i64 0, i64 %indvars.iv24.unr
  %46 = load i64, ptr %45, align 8, !tbaa !5
  %47 = icmp eq i64 %46, %11
  br i1 %47, label %52, label %48

48:                                               ; preds = %.lr.ph19.split.epil
  %49 = icmp eq i64 %46, %27
  br i1 %49, label %50, label %._crit_edge20

50:                                               ; preds = %48
  %51 = add nsw i64 %.unr44, %.unr
  store i64 %51, ptr @res, align 8, !tbaa !5
  br label %._crit_edge20

52:                                               ; preds = %.lr.ph19.split.epil
  %53 = add nsw i64 %.unr, 1
  store i64 %53, ptr @cnt, align 8, !tbaa !5
  br label %._crit_edge20

._crit_edge20:                                    ; preds = %._crit_edge20.loopexit41.unr-lcssa, %52, %50, %48, %42, %25
  %54 = phi i64 [ %res.promoted, %25 ], [ %43, %42 ], [ %.lcssa42.ph, %._crit_edge20.loopexit41.unr-lcssa ], [ %.unr44, %52 ], [ %51, %50 ], [ %.unr44, %48 ]
  %55 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %54)
  br label %81

.lr.ph19.split:                                   ; preds = %78, %.lr.ph19.split.preheader.new
  %indvars.iv24 = phi i64 [ 0, %.lr.ph19.split.preheader.new ], [ %indvars.iv.next25.1, %78 ]
  %56 = phi i64 [ %cnt.promoted, %.lr.ph19.split.preheader.new ], [ %80, %78 ]
  %57 = phi i64 [ %res.promoted, %.lr.ph19.split.preheader.new ], [ %79, %78 ]
  %niter = phi i64 [ 0, %.lr.ph19.split.preheader.new ], [ %niter.next.1, %78 ]
  %58 = getelementptr inbounds [500000 x i64], ptr @sum, i64 0, i64 %indvars.iv24
  %59 = load i64, ptr %58, align 16, !tbaa !5
  %60 = icmp eq i64 %59, %11
  br i1 %60, label %61, label %63

61:                                               ; preds = %.lr.ph19.split
  %62 = add nsw i64 %56, 1
  store i64 %62, ptr @cnt, align 8, !tbaa !5
  br label %.lr.ph19.split.1

63:                                               ; preds = %.lr.ph19.split
  %64 = icmp eq i64 %59, %27
  br i1 %64, label %65, label %.lr.ph19.split.1

65:                                               ; preds = %63
  %66 = add nsw i64 %57, %56
  store i64 %66, ptr @res, align 8, !tbaa !5
  br label %.lr.ph19.split.1

.lr.ph19.split.1:                                 ; preds = %61, %65, %63
  %67 = phi i64 [ %57, %61 ], [ %66, %65 ], [ %57, %63 ]
  %68 = phi i64 [ %62, %61 ], [ %56, %65 ], [ %56, %63 ]
  %indvars.iv.next25 = or disjoint i64 %indvars.iv24, 1
  %69 = getelementptr inbounds [500000 x i64], ptr @sum, i64 0, i64 %indvars.iv.next25
  %70 = load i64, ptr %69, align 8, !tbaa !5
  %71 = icmp eq i64 %70, %11
  br i1 %71, label %76, label %72

72:                                               ; preds = %.lr.ph19.split.1
  %73 = icmp eq i64 %70, %27
  br i1 %73, label %74, label %78

74:                                               ; preds = %72
  %75 = add nsw i64 %67, %68
  store i64 %75, ptr @res, align 8, !tbaa !5
  br label %78

76:                                               ; preds = %.lr.ph19.split.1
  %77 = add nsw i64 %68, 1
  store i64 %77, ptr @cnt, align 8, !tbaa !5
  br label %78

78:                                               ; preds = %76, %74, %72
  %79 = phi i64 [ %67, %76 ], [ %75, %74 ], [ %67, %72 ]
  %80 = phi i64 [ %77, %76 ], [ %68, %74 ], [ %68, %72 ]
  %indvars.iv.next25.1 = add nuw nsw i64 %indvars.iv24, 2
  %niter.next.1 = add i64 %niter, 2
  %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
  br i1 %niter.ncmp.1, label %._crit_edge20.loopexit41.unr-lcssa, label %.lr.ph19.split, !llvm.loop !13

81:                                               ; preds = %._crit_edge20, %23
  %.sink = phi ptr [ %55, %._crit_edge20 ], [ %24, %23 ]
  %82 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %.sink, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  ret i32 0
}

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #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 #2 align 2

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) local_unnamed_addr #1

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

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

attributes #0 = { mustprogress norecurse uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { "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 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 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" }

!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}


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