; LLVM IR from andreimaximov/algorithms :: codeforces/little-girl-and-maximum-sum (main)

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

@A = external dso_local global [200010 x i32], align 16
@D = external dso_local global [200010 x i64], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

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

14:                                               ; preds = %24, %0
  %15 = load i32, ptr %4, align 4, !tbaa !5
  %16 = load i32, ptr %2, align 4, !tbaa !5
  %17 = icmp slt i32 %15, %16
  br i1 %17, label %19, label %18

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

19:                                               ; preds = %14
  %20 = load i32, ptr %4, align 4, !tbaa !5
  %21 = sext i32 %20 to i64
  %22 = getelementptr inbounds [200010 x i32], ptr @A, i64 0, i64 %21
  %23 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %22)
  br label %24

24:                                               ; preds = %19
  %25 = load i32, ptr %4, align 4, !tbaa !5
  %26 = add nsw i32 %25, 1
  store i32 %26, ptr %4, align 4, !tbaa !5
  br label %14, !llvm.loop !9

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

28:                                               ; preds = %47, %27
  %29 = load i32, ptr %5, align 4, !tbaa !5
  %30 = load i32, ptr %3, align 4, !tbaa !5
  %31 = icmp slt i32 %29, %30
  br i1 %31, label %33, label %32

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

33:                                               ; preds = %28
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  %34 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %6)
  %35 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %34, ptr noundef nonnull align 4 dereferenceable(4) %7)
  %36 = load i32, ptr %6, align 4, !tbaa !5
  %37 = sext i32 %36 to i64
  %38 = getelementptr inbounds [200010 x i64], ptr @D, i64 0, i64 %37
  %39 = load i64, ptr %38, align 8, !tbaa !11
  %40 = add nsw i64 %39, 1
  store i64 %40, ptr %38, align 8, !tbaa !11
  %41 = load i32, ptr %7, align 4, !tbaa !5
  %42 = add nsw i32 %41, 1
  %43 = sext i32 %42 to i64
  %44 = getelementptr inbounds [200010 x i64], ptr @D, i64 0, i64 %43
  %45 = load i64, ptr %44, align 8, !tbaa !11
  %46 = add nsw i64 %45, -1
  store i64 %46, ptr %44, align 8, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  br label %47

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

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

51:                                               ; preds = %70, %50
  %52 = load i32, ptr %8, align 4, !tbaa !5
  %53 = load i32, ptr %2, align 4, !tbaa !5
  %54 = icmp sle i32 %52, %53
  br i1 %54, label %56, label %55

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

56:                                               ; preds = %51
  %57 = load i32, ptr %8, align 4, !tbaa !5
  %58 = sub nsw i32 %57, 1
  %59 = sext i32 %58 to i64
  %60 = getelementptr inbounds [200010 x i64], ptr @D, i64 0, i64 %59
  %61 = load i64, ptr %60, align 8, !tbaa !11
  %62 = load i32, ptr %8, align 4, !tbaa !5
  %63 = sext i32 %62 to i64
  %64 = getelementptr inbounds [200010 x i64], ptr @D, i64 0, i64 %63
  %65 = load i64, ptr %64, align 8, !tbaa !11
  %66 = add nsw i64 %61, %65
  %67 = load i32, ptr %8, align 4, !tbaa !5
  %68 = sext i32 %67 to i64
  %69 = getelementptr inbounds [200010 x i64], ptr @D, i64 0, i64 %68
  store i64 %66, ptr %69, align 8, !tbaa !11
  br label %70

70:                                               ; preds = %56
  %71 = load i32, ptr %8, align 4, !tbaa !5
  %72 = add nsw i32 %71, 1
  store i32 %72, ptr %8, align 4, !tbaa !5
  br label %51, !llvm.loop !14

73:                                               ; preds = %55
  %74 = load i32, ptr %2, align 4, !tbaa !5
  %75 = sext i32 %74 to i64
  %76 = getelementptr inbounds i32, ptr @A, i64 %75
  call void @_ZSt4sortIPiEvT_S1_(ptr noundef @A, ptr noundef %76)
  %77 = load i32, ptr %2, align 4, !tbaa !5
  %78 = sext i32 %77 to i64
  %79 = getelementptr inbounds i64, ptr @D, i64 %78
  %80 = getelementptr inbounds i64, ptr %79, i64 1
  call void @_ZSt4sortIPlEvT_S1_(ptr noundef getelementptr inbounds (i64, ptr @D, i64 1), ptr noundef %80)
  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 %81

81:                                               ; preds = %100, %73
  %82 = load i32, ptr %10, align 4, !tbaa !5
  %83 = load i32, ptr %2, align 4, !tbaa !5
  %84 = icmp slt i32 %82, %83
  br i1 %84, label %86, label %85

85:                                               ; preds = %81
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  br label %103

86:                                               ; preds = %81
  %87 = load i32, ptr %10, align 4, !tbaa !5
  %88 = sext i32 %87 to i64
  %89 = getelementptr inbounds [200010 x i32], ptr @A, i64 0, i64 %88
  %90 = load i32, ptr %89, align 4, !tbaa !5
  %91 = sext i32 %90 to i64
  %92 = load i32, ptr %10, align 4, !tbaa !5
  %93 = add nsw i32 %92, 1
  %94 = sext i32 %93 to i64
  %95 = getelementptr inbounds [200010 x i64], ptr @D, i64 0, i64 %94
  %96 = load i64, ptr %95, align 8, !tbaa !11
  %97 = mul nsw i64 %91, %96
  %98 = load i64, ptr %9, align 8, !tbaa !11
  %99 = add nsw i64 %98, %97
  store i64 %99, ptr %9, align 8, !tbaa !11
  br label %100

100:                                              ; preds = %86
  %101 = load i32, ptr %10, align 4, !tbaa !5
  %102 = add nsw i32 %101, 1
  store i32 %102, ptr %10, align 4, !tbaa !5
  br label %81, !llvm.loop !15

103:                                              ; preds = %85
  %104 = load i64, ptr %9, align 8, !tbaa !11
  %105 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEl(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %104)
  %106 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %105, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #5
  ret i32 0
}

declare noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext) #1

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

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: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIPiEvT_S1_(ptr noundef, ptr noundef) #3

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIPlEvT_S1_(ptr noundef, ptr noundef) #3

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

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

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

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

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

%"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" }

@A = external dso_local global [200010 x i32], align 16
@D = external dso_local global [200010 x i64], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = tail call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #5
  %6 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %1)
  %7 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %6, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %8 = load i32, ptr %1, align 4, !tbaa !5
  %9 = icmp sgt i32 %8, 0
  br i1 %9, label %.lr.ph, label %.preheader21

.preheader21:                                     ; preds = %.lr.ph, %0
  %10 = phi i32 [ %8, %0 ], [ %15, %.lr.ph ]
  %11 = load i32, ptr %2, align 4, !tbaa !5
  %12 = icmp sgt i32 %11, 0
  br i1 %12, label %.lr.ph24, label %.preheader

.lr.ph:                                           ; preds = %0, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %0 ]
  %13 = getelementptr inbounds [200010 x i32], ptr @A, i64 0, i64 %indvars.iv
  %14 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %13)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %15 = load i32, ptr %1, align 4, !tbaa !5
  %16 = sext i32 %15 to i64
  %17 = icmp slt i64 %indvars.iv.next, %16
  br i1 %17, label %.lr.ph, label %.preheader21, !llvm.loop !9

.preheader.loopexit:                              ; preds = %.lr.ph24
  %.pre = load i32, ptr %1, align 4, !tbaa !5
  br label %.preheader

.preheader:                                       ; preds = %.preheader.loopexit, %.preheader21
  %18 = phi i32 [ %.pre, %.preheader.loopexit ], [ %10, %.preheader21 ]
  %.not25 = icmp slt i32 %18, 1
  br i1 %.not25, label %._crit_edge, label %.lr.ph27.preheader

.lr.ph27.preheader:                               ; preds = %.preheader
  %.pre43 = load i64, ptr @D, align 16, !tbaa !11
  %19 = zext nneg i32 %18 to i64
  %xtraiter = and i64 %19, 3
  %20 = icmp ult i32 %18, 4
  br i1 %20, label %._crit_edge.loopexit.unr-lcssa, label %.lr.ph27.preheader.new

.lr.ph27.preheader.new:                           ; preds = %.lr.ph27.preheader
  %unroll_iter = and i64 %19, 2147483644
  br label %.lr.ph27

.lr.ph24:                                         ; preds = %.preheader21, %.lr.ph24
  %.01823 = phi i32 [ %34, %.lr.ph24 ], [ 0, %.preheader21 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #5
  %21 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %3)
  %22 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %21, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %23 = load i32, ptr %3, align 4, !tbaa !5
  %24 = sext i32 %23 to i64
  %25 = getelementptr inbounds [200010 x i64], ptr @D, i64 0, i64 %24
  %26 = load i64, ptr %25, align 8, !tbaa !11
  %27 = add nsw i64 %26, 1
  store i64 %27, ptr %25, align 8, !tbaa !11
  %28 = load i32, ptr %4, align 4, !tbaa !5
  %29 = add nsw i32 %28, 1
  %30 = sext i32 %29 to i64
  %31 = getelementptr inbounds [200010 x i64], ptr @D, i64 0, i64 %30
  %32 = load i64, ptr %31, align 8, !tbaa !11
  %33 = add nsw i64 %32, -1
  store i64 %33, ptr %31, align 8, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #5
  %34 = add nuw nsw i32 %.01823, 1
  %35 = load i32, ptr %2, align 4, !tbaa !5
  %36 = icmp slt i32 %34, %35
  br i1 %36, label %.lr.ph24, label %.preheader.loopexit, !llvm.loop !13

._crit_edge.loopexit.unr-lcssa:                   ; preds = %.lr.ph27, %.lr.ph27.preheader
  %.unr = phi i64 [ %.pre43, %.lr.ph27.preheader ], [ %62, %.lr.ph27 ]
  %indvars.iv35.unr = phi i64 [ 1, %.lr.ph27.preheader ], [ %indvars.iv.next36.3, %.lr.ph27 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge, label %.lr.ph27.epil

.lr.ph27.epil:                                    ; preds = %._crit_edge.loopexit.unr-lcssa, %.lr.ph27.epil
  %37 = phi i64 [ %40, %.lr.ph27.epil ], [ %.unr, %._crit_edge.loopexit.unr-lcssa ]
  %indvars.iv35.epil = phi i64 [ %indvars.iv.next36.epil, %.lr.ph27.epil ], [ %indvars.iv35.unr, %._crit_edge.loopexit.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.lr.ph27.epil ], [ 0, %._crit_edge.loopexit.unr-lcssa ]
  %38 = getelementptr inbounds [200010 x i64], ptr @D, i64 0, i64 %indvars.iv35.epil
  %39 = load i64, ptr %38, align 8, !tbaa !11
  %40 = add nsw i64 %39, %37
  store i64 %40, ptr %38, align 8, !tbaa !11
  %indvars.iv.next36.epil = add nuw nsw i64 %indvars.iv35.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 %._crit_edge, label %.lr.ph27.epil, !llvm.loop !14

._crit_edge:                                      ; preds = %._crit_edge.loopexit.unr-lcssa, %.lr.ph27.epil, %.preheader
  %41 = sext i32 %18 to i64
  %42 = getelementptr inbounds i32, ptr @A, i64 %41
  call void @_ZSt4sortIPiEvT_S1_(ptr noundef nonnull @A, ptr noundef nonnull %42)
  %43 = load i32, ptr %1, align 4, !tbaa !5
  %44 = sext i32 %43 to i64
  %45 = getelementptr inbounds i64, ptr @D, i64 %44
  %46 = getelementptr inbounds i8, ptr %45, i64 8
  call void @_ZSt4sortIPlEvT_S1_(ptr noundef nonnull getelementptr inbounds (i8, ptr @D, i64 8), ptr noundef nonnull %46)
  %47 = load i32, ptr %1, align 4, !tbaa !5
  %48 = icmp sgt i32 %47, 0
  br i1 %48, label %.lr.ph31.preheader, label %._crit_edge32

.lr.ph31.preheader:                               ; preds = %._crit_edge
  %wide.trip.count41 = zext nneg i32 %47 to i64
  %xtraiter47 = and i64 %wide.trip.count41, 3
  %49 = icmp ult i32 %47, 4
  br i1 %49, label %._crit_edge32.loopexit.unr-lcssa, label %.lr.ph31.preheader.new

.lr.ph31.preheader.new:                           ; preds = %.lr.ph31.preheader
  %unroll_iter51 = and i64 %wide.trip.count41, 2147483644
  br label %.lr.ph31

.lr.ph27:                                         ; preds = %.lr.ph27, %.lr.ph27.preheader.new
  %50 = phi i64 [ %.pre43, %.lr.ph27.preheader.new ], [ %62, %.lr.ph27 ]
  %indvars.iv35 = phi i64 [ 1, %.lr.ph27.preheader.new ], [ %indvars.iv.next36.3, %.lr.ph27 ]
  %niter = phi i64 [ 0, %.lr.ph27.preheader.new ], [ %niter.next.3, %.lr.ph27 ]
  %51 = getelementptr inbounds [200010 x i64], ptr @D, i64 0, i64 %indvars.iv35
  %52 = load i64, ptr %51, align 8, !tbaa !11
  %53 = add nsw i64 %52, %50
  store i64 %53, ptr %51, align 8, !tbaa !11
  %indvars.iv.next36 = add nuw nsw i64 %indvars.iv35, 1
  %54 = getelementptr inbounds [200010 x i64], ptr @D, i64 0, i64 %indvars.iv.next36
  %55 = load i64, ptr %54, align 8, !tbaa !11
  %56 = add nsw i64 %55, %53
  store i64 %56, ptr %54, align 8, !tbaa !11
  %indvars.iv.next36.1 = add nuw nsw i64 %indvars.iv35, 2
  %57 = getelementptr inbounds [200010 x i64], ptr @D, i64 0, i64 %indvars.iv.next36.1
  %58 = load i64, ptr %57, align 8, !tbaa !11
  %59 = add nsw i64 %58, %56
  store i64 %59, ptr %57, align 8, !tbaa !11
  %indvars.iv.next36.2 = add nuw nsw i64 %indvars.iv35, 3
  %60 = getelementptr inbounds [200010 x i64], ptr @D, i64 0, i64 %indvars.iv.next36.2
  %61 = load i64, ptr %60, align 8, !tbaa !11
  %62 = add nsw i64 %61, %59
  store i64 %62, ptr %60, align 8, !tbaa !11
  %indvars.iv.next36.3 = add nuw nsw i64 %indvars.iv35, 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 %._crit_edge.loopexit.unr-lcssa, label %.lr.ph27, !llvm.loop !16

._crit_edge32.loopexit.unr-lcssa:                 ; preds = %.lr.ph31, %.lr.ph31.preheader
  %.lcssa.ph = phi i64 [ poison, %.lr.ph31.preheader ], [ %99, %.lr.ph31 ]
  %indvars.iv38.unr = phi i64 [ 0, %.lr.ph31.preheader ], [ %indvars.iv.next39.3, %.lr.ph31 ]
  %.01628.unr = phi i64 [ 0, %.lr.ph31.preheader ], [ %99, %.lr.ph31 ]
  %lcmp.mod49.not = icmp eq i64 %xtraiter47, 0
  br i1 %lcmp.mod49.not, label %._crit_edge32, label %.lr.ph31.epil

.lr.ph31.epil:                                    ; preds = %._crit_edge32.loopexit.unr-lcssa, %.lr.ph31.epil
  %indvars.iv38.epil = phi i64 [ %indvars.iv.next39.epil, %.lr.ph31.epil ], [ %indvars.iv38.unr, %._crit_edge32.loopexit.unr-lcssa ]
  %.01628.epil = phi i64 [ %69, %.lr.ph31.epil ], [ %.01628.unr, %._crit_edge32.loopexit.unr-lcssa ]
  %epil.iter48 = phi i64 [ %epil.iter48.next, %.lr.ph31.epil ], [ 0, %._crit_edge32.loopexit.unr-lcssa ]
  %63 = getelementptr inbounds [200010 x i32], ptr @A, i64 0, i64 %indvars.iv38.epil
  %64 = load i32, ptr %63, align 4, !tbaa !5
  %65 = sext i32 %64 to i64
  %indvars.iv.next39.epil = add nuw nsw i64 %indvars.iv38.epil, 1
  %66 = getelementptr inbounds [200010 x i64], ptr @D, i64 0, i64 %indvars.iv.next39.epil
  %67 = load i64, ptr %66, align 8, !tbaa !11
  %68 = mul nsw i64 %67, %65
  %69 = add nsw i64 %68, %.01628.epil
  %epil.iter48.next = add i64 %epil.iter48, 1
  %epil.iter48.cmp.not = icmp eq i64 %epil.iter48.next, %xtraiter47
  br i1 %epil.iter48.cmp.not, label %._crit_edge32, label %.lr.ph31.epil, !llvm.loop !17

._crit_edge32:                                    ; preds = %._crit_edge32.loopexit.unr-lcssa, %.lr.ph31.epil, %._crit_edge
  %.016.lcssa = phi i64 [ 0, %._crit_edge ], [ %.lcssa.ph, %._crit_edge32.loopexit.unr-lcssa ], [ %69, %.lr.ph31.epil ]
  %70 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEl(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %.016.lcssa)
  %71 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %70, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #5
  ret i32 0

.lr.ph31:                                         ; preds = %.lr.ph31, %.lr.ph31.preheader.new
  %indvars.iv38 = phi i64 [ 0, %.lr.ph31.preheader.new ], [ %indvars.iv.next39.3, %.lr.ph31 ]
  %.01628 = phi i64 [ 0, %.lr.ph31.preheader.new ], [ %99, %.lr.ph31 ]
  %niter52 = phi i64 [ 0, %.lr.ph31.preheader.new ], [ %niter52.next.3, %.lr.ph31 ]
  %72 = getelementptr inbounds [200010 x i32], ptr @A, i64 0, i64 %indvars.iv38
  %73 = load i32, ptr %72, align 16, !tbaa !5
  %74 = sext i32 %73 to i64
  %indvars.iv.next39 = or disjoint i64 %indvars.iv38, 1
  %75 = getelementptr inbounds [200010 x i64], ptr @D, i64 0, i64 %indvars.iv.next39
  %76 = load i64, ptr %75, align 8, !tbaa !11
  %77 = mul nsw i64 %76, %74
  %78 = add nsw i64 %77, %.01628
  %79 = getelementptr inbounds [200010 x i32], ptr @A, i64 0, i64 %indvars.iv.next39
  %80 = load i32, ptr %79, align 4, !tbaa !5
  %81 = sext i32 %80 to i64
  %indvars.iv.next39.1 = or disjoint i64 %indvars.iv38, 2
  %82 = getelementptr inbounds [200010 x i64], ptr @D, i64 0, i64 %indvars.iv.next39.1
  %83 = load i64, ptr %82, align 16, !tbaa !11
  %84 = mul nsw i64 %83, %81
  %85 = add nsw i64 %84, %78
  %86 = getelementptr inbounds [200010 x i32], ptr @A, i64 0, i64 %indvars.iv.next39.1
  %87 = load i32, ptr %86, align 8, !tbaa !5
  %88 = sext i32 %87 to i64
  %indvars.iv.next39.2 = or disjoint i64 %indvars.iv38, 3
  %89 = getelementptr inbounds [200010 x i64], ptr @D, i64 0, i64 %indvars.iv.next39.2
  %90 = load i64, ptr %89, align 8, !tbaa !11
  %91 = mul nsw i64 %90, %88
  %92 = add nsw i64 %91, %85
  %93 = getelementptr inbounds [200010 x i32], ptr @A, i64 0, i64 %indvars.iv.next39.2
  %94 = load i32, ptr %93, align 4, !tbaa !5
  %95 = sext i32 %94 to i64
  %indvars.iv.next39.3 = add nuw nsw i64 %indvars.iv38, 4
  %96 = getelementptr inbounds [200010 x i64], ptr @D, i64 0, i64 %indvars.iv.next39.3
  %97 = load i64, ptr %96, align 16, !tbaa !11
  %98 = mul nsw i64 %97, %95
  %99 = add nsw i64 %98, %92
  %niter52.next.3 = add i64 %niter52, 4
  %niter52.ncmp.3 = icmp eq i64 %niter52.next.3, %unroll_iter51
  br i1 %niter52.ncmp.3, label %._crit_edge32.loopexit.unr-lcssa, label %.lr.ph31, !llvm.loop !18
}

declare noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext) local_unnamed_addr #1

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

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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIPiEvT_S1_(ptr noundef, ptr noundef) local_unnamed_addr #3

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIPlEvT_S1_(ptr noundef, ptr noundef) local_unnamed_addr #3

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

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

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

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

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


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