; LLVM IR from VastoLorde95/Competitive-Programming :: Codeforces/271 Division 2/Problem D (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_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" }

@t = external dso_local global i32, align 4
@k = external dso_local global i32, align 4
@a = external dso_local global i32, align 4
@b = external dso_local global i32, align 4
@MOD = external dso_local global i64, align 8
@dp = external dso_local global [100001 x i64], align 16
@sum = external dso_local global [100001 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
  store i32 0, ptr %1, align 4
  %5 = call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %6 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %7 = getelementptr i8, ptr %6, i64 -24
  %8 = load i64, ptr %7, align 8
  %9 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %8
  %10 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %9, ptr noundef null)
  %11 = load ptr, ptr @_ZSt4cout, align 8, !tbaa !5
  %12 = getelementptr i8, ptr %11, i64 -24
  %13 = load i64, ptr %12, align 8
  %14 = getelementptr inbounds i8, ptr @_ZSt4cout, i64 %13
  %15 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %14, ptr noundef null)
  %16 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) @t)
  %17 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %16, ptr noundef nonnull align 4 dereferenceable(4) @k)
  store i64 1, ptr @dp, align 16, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #6
  store i32 1, ptr %2, align 4, !tbaa !11
  br label %18

18:                                               ; preds = %27, %0
  %19 = load i32, ptr %2, align 4, !tbaa !11
  %20 = load i32, ptr @k, align 4, !tbaa !11
  %21 = icmp slt i32 %19, %20
  br i1 %21, label %23, label %22

22:                                               ; preds = %18
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #6
  br label %30

23:                                               ; preds = %18
  %24 = load i32, ptr %2, align 4, !tbaa !11
  %25 = sext i32 %24 to i64
  %26 = getelementptr inbounds [100001 x i64], ptr @dp, i64 0, i64 %25
  store i64 1, ptr %26, align 8, !tbaa !8
  br label %27

27:                                               ; preds = %23
  %28 = load i32, ptr %2, align 4, !tbaa !11
  %29 = add nsw i32 %28, 1
  store i32 %29, ptr %2, align 4, !tbaa !11
  br label %18, !llvm.loop !13

30:                                               ; preds = %22
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #6
  %31 = load i32, ptr @k, align 4, !tbaa !11
  store i32 %31, ptr %3, align 4, !tbaa !11
  br label %32

32:                                               ; preds = %54, %30
  %33 = load i32, ptr %3, align 4, !tbaa !11
  %34 = icmp sle i32 %33, 100000
  br i1 %34, label %36, label %35

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

36:                                               ; preds = %32
  %37 = load i32, ptr %3, align 4, !tbaa !11
  %38 = sub nsw i32 %37, 1
  %39 = sext i32 %38 to i64
  %40 = getelementptr inbounds [100001 x i64], ptr @dp, i64 0, i64 %39
  %41 = load i64, ptr %40, align 8, !tbaa !8
  %42 = load i32, ptr %3, align 4, !tbaa !11
  %43 = load i32, ptr @k, align 4, !tbaa !11
  %44 = sub nsw i32 %42, %43
  %45 = sext i32 %44 to i64
  %46 = getelementptr inbounds [100001 x i64], ptr @dp, i64 0, i64 %45
  %47 = load i64, ptr %46, align 8, !tbaa !8
  %48 = add nsw i64 %41, %47
  %49 = load i64, ptr @MOD, align 8, !tbaa !8
  %50 = srem i64 %48, %49
  %51 = load i32, ptr %3, align 4, !tbaa !11
  %52 = sext i32 %51 to i64
  %53 = getelementptr inbounds [100001 x i64], ptr @dp, i64 0, i64 %52
  store i64 %50, ptr %53, align 8, !tbaa !8
  br label %54

54:                                               ; preds = %36
  %55 = load i32, ptr %3, align 4, !tbaa !11
  %56 = add nsw i32 %55, 1
  store i32 %56, ptr %3, align 4, !tbaa !11
  br label %32, !llvm.loop !15

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

58:                                               ; preds = %78, %57
  %59 = load i32, ptr %4, align 4, !tbaa !11
  %60 = icmp sle i32 %59, 100000
  br i1 %60, label %62, label %61

61:                                               ; preds = %58
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  br label %81

62:                                               ; preds = %58
  %63 = load i32, ptr %4, align 4, !tbaa !11
  %64 = sub nsw i32 %63, 1
  %65 = sext i32 %64 to i64
  %66 = getelementptr inbounds [100001 x i64], ptr @sum, i64 0, i64 %65
  %67 = load i64, ptr %66, align 8, !tbaa !8
  %68 = load i32, ptr %4, align 4, !tbaa !11
  %69 = sext i32 %68 to i64
  %70 = getelementptr inbounds [100001 x i64], ptr @dp, i64 0, i64 %69
  %71 = load i64, ptr %70, align 8, !tbaa !8
  %72 = add nsw i64 %67, %71
  %73 = load i64, ptr @MOD, align 8, !tbaa !8
  %74 = srem i64 %72, %73
  %75 = load i32, ptr %4, align 4, !tbaa !11
  %76 = sext i32 %75 to i64
  %77 = getelementptr inbounds [100001 x i64], ptr @sum, i64 0, i64 %76
  store i64 %74, ptr %77, align 8, !tbaa !8
  br label %78

78:                                               ; preds = %62
  %79 = load i32, ptr %4, align 4, !tbaa !11
  %80 = add nsw i32 %79, 1
  store i32 %80, ptr %4, align 4, !tbaa !11
  br label %58, !llvm.loop !16

81:                                               ; preds = %61
  br label %82

82:                                               ; preds = %86, %81
  %83 = load i32, ptr @t, align 4, !tbaa !11
  %84 = add nsw i32 %83, -1
  store i32 %84, ptr @t, align 4, !tbaa !11
  %85 = icmp ne i32 %83, 0
  br i1 %85, label %86, label %105

86:                                               ; preds = %82
  %87 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) @a)
  %88 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %87, ptr noundef nonnull align 4 dereferenceable(4) @b)
  %89 = load i32, ptr @b, align 4, !tbaa !11
  %90 = sext i32 %89 to i64
  %91 = getelementptr inbounds [100001 x i64], ptr @sum, i64 0, i64 %90
  %92 = load i64, ptr %91, align 8, !tbaa !8
  %93 = load i32, ptr @a, align 4, !tbaa !11
  %94 = sub nsw i32 %93, 1
  %95 = sext i32 %94 to i64
  %96 = getelementptr inbounds [100001 x i64], ptr @sum, i64 0, i64 %95
  %97 = load i64, ptr %96, align 8, !tbaa !8
  %98 = sub nsw i64 %92, %97
  %99 = load i64, ptr @MOD, align 8, !tbaa !8
  %100 = add nsw i64 %98, %99
  %101 = load i64, ptr @MOD, align 8, !tbaa !8
  %102 = srem i64 %100, %101
  %103 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %102)
  %104 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %103, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %82, !llvm.loop !17

105:                                              ; preds = %82
  ret i32 0
}

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

; Function Attrs: mustprogress nounwind uwtable
declare noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264), ptr noundef) #2 align 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.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

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

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 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 #3 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 #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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"long long", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !10, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}
!16 = distinct !{!16, !14}
!17 = distinct !{!17, !14}


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

@t = external dso_local global i32, align 4
@k = external dso_local global i32, align 4
@a = external dso_local global i32, align 4
@b = external dso_local global i32, align 4
@MOD = external dso_local local_unnamed_addr global i64, align 8
@dp = external dso_local local_unnamed_addr global [100001 x i64], align 16
@sum = external dso_local local_unnamed_addr global [100001 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 = tail call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %2 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %3 = getelementptr i8, ptr %2, i64 -24
  %4 = load i64, ptr %3, align 8
  %5 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %4
  %6 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %5, ptr noundef null)
  %7 = load ptr, ptr @_ZSt4cout, align 8, !tbaa !5
  %8 = getelementptr i8, ptr %7, i64 -24
  %9 = load i64, ptr %8, align 8
  %10 = getelementptr inbounds i8, ptr @_ZSt4cout, i64 %9
  %11 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %10, ptr noundef null)
  %12 = 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) @t)
  %13 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %12, ptr noundef nonnull align 4 dereferenceable(4) @k)
  store i64 1, ptr @dp, align 16, !tbaa !8
  %14 = load i32, ptr @k, align 4, !tbaa !11
  %15 = icmp sgt i32 %14, 1
  br i1 %15, label %.lr.ph.preheader, label %.preheader17.thread

.preheader17.thread:                              ; preds = %0
  %.pre34 = load i64, ptr @MOD, align 8, !tbaa !8
  br label %.lr.ph20

.lr.ph.preheader:                                 ; preds = %0
  %wide.trip.count = zext nneg i32 %14 to i64
  %16 = add nsw i64 %wide.trip.count, -1
  %min.iters.check = icmp ult i32 %14, 5
  br i1 %min.iters.check, label %.lr.ph.preheader37, label %vector.ph

.lr.ph.preheader37:                               ; preds = %middle.block, %.lr.ph.preheader
  %indvars.iv.ph = phi i64 [ 1, %.lr.ph.preheader ], [ %ind.end, %middle.block ]
  br label %.lr.ph

vector.ph:                                        ; preds = %.lr.ph.preheader
  %n.vec = and i64 %16, -4
  %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 ]
  %offset.idx = or disjoint i64 %index, 1
  %17 = getelementptr inbounds [100001 x i64], ptr @dp, i64 0, i64 %offset.idx
  %18 = getelementptr inbounds i8, ptr %17, i64 16
  store <2 x i64> <i64 1, i64 1>, ptr %17, align 8, !tbaa !8
  store <2 x i64> <i64 1, i64 1>, ptr %18, align 8, !tbaa !8
  %index.next = add nuw i64 %index, 4
  %19 = icmp eq i64 %index.next, %n.vec
  br i1 %19, label %middle.block, label %vector.body, !llvm.loop !13

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %16, %n.vec
  br i1 %cmp.n, label %.preheader17, label %.lr.ph.preheader37

.preheader17:                                     ; preds = %.lr.ph, %middle.block
  %20 = icmp slt i32 %14, 100001
  %.pre = load i64, ptr @MOD, align 8, !tbaa !8
  br i1 %20, label %.lr.ph20, label %.preheader16

.lr.ph20:                                         ; preds = %.preheader17.thread, %.preheader17
  %.pre35 = phi i64 [ %.pre34, %.preheader17.thread ], [ %.pre, %.preheader17 ]
  %21 = sext i32 %14 to i64
  %22 = shl nsw i64 %21, 3
  %23 = getelementptr i8, ptr @dp, i64 %22
  %scevgep = getelementptr i8, ptr %23, i64 -8
  %load_initial = load i64, ptr %scevgep, align 8
  br label %25

.lr.ph:                                           ; preds = %.lr.ph.preheader37, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ %indvars.iv.ph, %.lr.ph.preheader37 ]
  %24 = getelementptr inbounds [100001 x i64], ptr @dp, i64 0, i64 %indvars.iv
  store i64 1, ptr %24, align 8, !tbaa !8
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %.preheader17, label %.lr.ph, !llvm.loop !17

.preheader16:                                     ; preds = %25, %.preheader17
  %.pre36 = phi i64 [ %.pre, %.preheader17 ], [ %.pre35, %25 ]
  %.pre33 = load i64, ptr @sum, align 16, !tbaa !8
  br label %35

25:                                               ; preds = %.lr.ph20, %25
  %store_forwarded = phi i64 [ %load_initial, %.lr.ph20 ], [ %30, %25 ]
  %indvars.iv25 = phi i64 [ %21, %.lr.ph20 ], [ %indvars.iv.next26, %25 ]
  %26 = sub nsw i64 %indvars.iv25, %21
  %27 = getelementptr inbounds [100001 x i64], ptr @dp, i64 0, i64 %26
  %28 = load i64, ptr %27, align 8, !tbaa !8
  %29 = add nsw i64 %28, %store_forwarded
  %30 = srem i64 %29, %.pre35
  %31 = getelementptr inbounds [100001 x i64], ptr @dp, i64 0, i64 %indvars.iv25
  store i64 %30, ptr %31, align 8, !tbaa !8
  %indvars.iv.next26 = add nsw i64 %indvars.iv25, 1
  %32 = and i64 %indvars.iv.next26, 4294967295
  %exitcond28.not = icmp eq i64 %32, 100001
  br i1 %exitcond28.not, label %.preheader16, label %25, !llvm.loop !18

.preheader:                                       ; preds = %35
  %33 = load i32, ptr @t, align 4, !tbaa !11
  %34 = add nsw i32 %33, -1
  store i32 %34, ptr @t, align 4, !tbaa !11
  %.not22 = icmp eq i32 %33, 0
  br i1 %.not22, label %._crit_edge, label %.lr.ph23

35:                                               ; preds = %35, %.preheader16
  %36 = phi i64 [ %.pre33, %.preheader16 ], [ %45, %35 ]
  %indvars.iv29 = phi i64 [ 1, %.preheader16 ], [ %indvars.iv.next30.1, %35 ]
  %37 = getelementptr inbounds [100001 x i64], ptr @dp, i64 0, i64 %indvars.iv29
  %38 = load i64, ptr %37, align 8, !tbaa !8
  %39 = add nsw i64 %38, %36
  %40 = srem i64 %39, %.pre36
  %41 = getelementptr inbounds [100001 x i64], ptr @sum, i64 0, i64 %indvars.iv29
  store i64 %40, ptr %41, align 8, !tbaa !8
  %indvars.iv.next30 = add nuw nsw i64 %indvars.iv29, 1
  %42 = getelementptr inbounds [100001 x i64], ptr @dp, i64 0, i64 %indvars.iv.next30
  %43 = load i64, ptr %42, align 8, !tbaa !8
  %44 = add nsw i64 %43, %40
  %45 = srem i64 %44, %.pre36
  %46 = getelementptr inbounds [100001 x i64], ptr @sum, i64 0, i64 %indvars.iv.next30
  store i64 %45, ptr %46, align 8, !tbaa !8
  %indvars.iv.next30.1 = add nuw nsw i64 %indvars.iv29, 2
  %exitcond32.not.1 = icmp eq i64 %indvars.iv.next30.1, 100001
  br i1 %exitcond32.not.1, label %.preheader, label %35, !llvm.loop !19

.lr.ph23:                                         ; preds = %.preheader, %.lr.ph23
  %47 = 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) @a)
  %48 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %47, ptr noundef nonnull align 4 dereferenceable(4) @b)
  %49 = load i32, ptr @b, align 4, !tbaa !11
  %50 = sext i32 %49 to i64
  %51 = getelementptr inbounds [100001 x i64], ptr @sum, i64 0, i64 %50
  %52 = load i64, ptr %51, align 8, !tbaa !8
  %53 = load i32, ptr @a, align 4, !tbaa !11
  %54 = add nsw i32 %53, -1
  %55 = sext i32 %54 to i64
  %56 = getelementptr inbounds [100001 x i64], ptr @sum, i64 0, i64 %55
  %57 = load i64, ptr %56, align 8, !tbaa !8
  %58 = sub i64 %52, %57
  %59 = load i64, ptr @MOD, align 8, !tbaa !8
  %60 = add nsw i64 %58, %59
  %61 = srem i64 %60, %59
  %62 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %61)
  %63 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %62, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  %64 = load i32, ptr @t, align 4, !tbaa !11
  %65 = add nsw i32 %64, -1
  store i32 %65, ptr @t, align 4, !tbaa !11
  %.not = icmp eq i32 %64, 0
  br i1 %.not, label %._crit_edge, label %.lr.ph23, !llvm.loop !20

._crit_edge:                                      ; preds = %.lr.ph23, %.preheader
  ret i32 0
}

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

; Function Attrs: mustprogress nounwind uwtable
declare noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264), ptr noundef) local_unnamed_addr #2 align 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 uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) local_unnamed_addr #3 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 #3 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

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 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 #3 = { 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 = { 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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"long long", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !10, i64 0}
!13 = distinct !{!13, !14, !15, !16}
!14 = !{!"llvm.loop.mustprogress"}
!15 = !{!"llvm.loop.isvectorized", i32 1}
!16 = !{!"llvm.loop.unroll.runtime.disable"}
!17 = distinct !{!17, !14, !16, !15}
!18 = distinct !{!18, !14}
!19 = distinct !{!19, !14}
!20 = distinct !{!20, !14}


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