; LLVM IR from eyangch/competitive-programming :: Codeforces/1844 (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" }

@T = external dso_local global i64, align 8
@N = external dso_local global i64, align 8
@C = external dso_local global [200000 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 i64, align 8
  %3 = alloca i64, align 8
  %4 = alloca i64, align 8
  %5 = alloca i64, align 8
  %6 = alloca i64, align 8
  store i32 0, ptr %1, align 4
  %7 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %8 = getelementptr i8, ptr %7, i64 -24
  %9 = load i64, ptr %8, align 8
  %10 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %9
  %11 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %10, ptr noundef null)
  %12 = call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %13 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) @T)
  br label %14

14:                                               ; preds = %90, %0
  %15 = load i64, ptr @T, align 8, !tbaa !8
  %16 = add nsw i64 %15, -1
  store i64 %16, ptr @T, align 8, !tbaa !8
  %17 = icmp ne i64 %15, 0
  br i1 %17, label %18, label %94

18:                                               ; preds = %14
  %19 = 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)
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #7
  store i64 0, ptr %2, align 8, !tbaa !8
  br label %20

20:                                               ; preds = %29, %18
  %21 = load i64, ptr %2, align 8, !tbaa !8
  %22 = load i64, ptr @N, align 8, !tbaa !8
  %23 = icmp slt i64 %21, %22
  br i1 %23, label %25, label %24

24:                                               ; preds = %20
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #7
  br label %32

25:                                               ; preds = %20
  %26 = load i64, ptr %2, align 8, !tbaa !8
  %27 = getelementptr inbounds [200000 x i64], ptr @C, i64 0, i64 %26
  %28 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %27)
  br label %29

29:                                               ; preds = %25
  %30 = load i64, ptr %2, align 8, !tbaa !8
  %31 = add nsw i64 %30, 1
  store i64 %31, ptr %2, align 8, !tbaa !8
  br label %20, !llvm.loop !11

32:                                               ; preds = %24
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #7
  store i64 0, ptr %3, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #7
  %33 = load i64, ptr @N, align 8, !tbaa !8
  %34 = getelementptr inbounds i64, ptr @C, i64 %33
  %35 = call noundef ptr @_ZSt11max_elementIPxET_S1_S1_(ptr noundef @C, ptr noundef %34)
  %36 = load i64, ptr %35, align 8, !tbaa !8
  store i64 %36, ptr %4, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #7
  store i64 0, ptr %5, align 8, !tbaa !8
  br label %37

37:                                               ; preds = %54, %32
  %38 = load i64, ptr %5, align 8, !tbaa !8
  %39 = load i64, ptr @N, align 8, !tbaa !8
  %40 = icmp slt i64 %38, %39
  br i1 %40, label %42, label %41

41:                                               ; preds = %37
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #7
  br label %57

42:                                               ; preds = %37
  %43 = load i64, ptr %5, align 8, !tbaa !8
  %44 = getelementptr inbounds [200000 x i64], ptr @C, i64 0, i64 %43
  %45 = load i64, ptr %44, align 8, !tbaa !8
  %46 = icmp sgt i64 %45, 0
  br i1 %46, label %47, label %53

47:                                               ; preds = %42
  %48 = load i64, ptr %5, align 8, !tbaa !8
  %49 = getelementptr inbounds [200000 x i64], ptr @C, i64 0, i64 %48
  %50 = load i64, ptr %49, align 8, !tbaa !8
  %51 = load i64, ptr %3, align 8, !tbaa !8
  %52 = add nsw i64 %51, %50
  store i64 %52, ptr %3, align 8, !tbaa !8
  br label %53

53:                                               ; preds = %47, %42
  br label %54

54:                                               ; preds = %53
  %55 = load i64, ptr %5, align 8, !tbaa !8
  %56 = add nsw i64 %55, 2
  store i64 %56, ptr %5, align 8, !tbaa !8
  br label %37, !llvm.loop !13

57:                                               ; preds = %41
  %58 = load i64, ptr %3, align 8, !tbaa !8
  %59 = icmp sgt i64 %58, 0
  br i1 %59, label %60, label %63

60:                                               ; preds = %57
  %61 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(8) %3)
  %62 = load i64, ptr %61, align 8, !tbaa !8
  store i64 %62, ptr %4, align 8, !tbaa !8
  br label %63

63:                                               ; preds = %60, %57
  store i64 0, ptr %3, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #7
  store i64 1, ptr %6, align 8, !tbaa !8
  br label %64

64:                                               ; preds = %81, %63
  %65 = load i64, ptr %6, align 8, !tbaa !8
  %66 = load i64, ptr @N, align 8, !tbaa !8
  %67 = icmp slt i64 %65, %66
  br i1 %67, label %69, label %68

68:                                               ; preds = %64
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #7
  br label %84

69:                                               ; preds = %64
  %70 = load i64, ptr %6, align 8, !tbaa !8
  %71 = getelementptr inbounds [200000 x i64], ptr @C, i64 0, i64 %70
  %72 = load i64, ptr %71, align 8, !tbaa !8
  %73 = icmp sgt i64 %72, 0
  br i1 %73, label %74, label %80

74:                                               ; preds = %69
  %75 = load i64, ptr %6, align 8, !tbaa !8
  %76 = getelementptr inbounds [200000 x i64], ptr @C, i64 0, i64 %75
  %77 = load i64, ptr %76, align 8, !tbaa !8
  %78 = load i64, ptr %3, align 8, !tbaa !8
  %79 = add nsw i64 %78, %77
  store i64 %79, ptr %3, align 8, !tbaa !8
  br label %80

80:                                               ; preds = %74, %69
  br label %81

81:                                               ; preds = %80
  %82 = load i64, ptr %6, align 8, !tbaa !8
  %83 = add nsw i64 %82, 2
  store i64 %83, ptr %6, align 8, !tbaa !8
  br label %64, !llvm.loop !14

84:                                               ; preds = %68
  %85 = load i64, ptr %3, align 8, !tbaa !8
  %86 = icmp sgt i64 %85, 0
  br i1 %86, label %87, label %90

87:                                               ; preds = %84
  %88 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(8) %3)
  %89 = load i64, ptr %88, align 8, !tbaa !8
  store i64 %89, ptr %4, align 8, !tbaa !8
  br label %90

90:                                               ; preds = %87, %84
  %91 = load i64, ptr %4, align 8, !tbaa !8
  %92 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %91)
  %93 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %92, i8 noundef signext 10)
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #7
  br label %14, !llvm.loop !15

94:                                               ; preds = %14
  %95 = load i32, ptr %1, align 4
  ret i32 %95
}

; Function Attrs: mustprogress nounwind uwtable
declare noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264), ptr noundef) #1 align 2

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

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef ptr @_ZSt11max_elementIPxET_S1_S1_(ptr noundef, ptr noundef) #5

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #6

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8), i8 noundef signext) #5

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) #3 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 = { 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 #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { 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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { 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 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !12}
!15 = distinct !{!15, !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" }

@T = external dso_local global i64, align 8
@N = external dso_local global i64, align 8
@C = external dso_local global [200000 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 i64, align 8
  %2 = alloca i64, align 8
  %3 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %4 = getelementptr i8, ptr %3, i64 -24
  %5 = load i64, ptr %4, align 8
  %6 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %5
  %7 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %6, ptr noundef null)
  %8 = tail call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %9 = 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) @T)
  %10 = load i64, ptr @T, align 8, !tbaa !8
  %11 = add nsw i64 %10, -1
  store i64 %11, ptr @T, align 8, !tbaa !8
  %.not26 = icmp eq i64 %10, 0
  br i1 %.not26, label %._crit_edge29, label %.lr.ph28

.lr.ph28:                                         ; preds = %0, %._crit_edge25.thread
  %12 = 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)
  %13 = load i64, ptr @N, align 8, !tbaa !8
  %14 = icmp sgt i64 %13, 0
  br i1 %14, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %.lr.ph28
  %.lcssa = phi i64 [ %13, %.lr.ph28 ], [ %27, %.lr.ph ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #7
  store i64 0, ptr %1, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #7
  %15 = getelementptr inbounds i64, ptr @C, i64 %.lcssa
  %16 = call noundef ptr @_ZSt11max_elementIPxET_S1_S1_(ptr noundef nonnull @C, ptr noundef nonnull %15)
  %17 = load i64, ptr %16, align 8, !tbaa !8
  store i64 %17, ptr %2, align 8, !tbaa !8
  %18 = load i64, ptr @N, align 8, !tbaa !8
  %.promoted = load i64, ptr %1, align 8, !tbaa !8
  %19 = icmp sgt i64 %18, 0
  br i1 %19, label %.lr.ph19.preheader, label %._crit_edge20

.lr.ph19.preheader:                               ; preds = %._crit_edge
  %20 = add nsw i64 %18, -1
  %21 = icmp ult i64 %18, 3
  br i1 %21, label %._crit_edge20.loopexit.unr-lcssa, label %.lr.ph19.preheader.new

.lr.ph19.preheader.new:                           ; preds = %.lr.ph19.preheader
  %22 = lshr i64 %20, 1
  %23 = add nuw i64 %22, 1
  %unroll_iter = and i64 %23, -2
  br label %.lr.ph19

.lr.ph:                                           ; preds = %.lr.ph28, %.lr.ph
  %.01316 = phi i64 [ %26, %.lr.ph ], [ 0, %.lr.ph28 ]
  %24 = getelementptr inbounds [200000 x i64], ptr @C, i64 0, i64 %.01316
  %25 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %24)
  %26 = add nuw nsw i64 %.01316, 1
  %27 = load i64, ptr @N, align 8, !tbaa !8
  %28 = icmp slt i64 %26, %27
  br i1 %28, label %.lr.ph, label %._crit_edge, !llvm.loop !11

._crit_edge20.loopexit.unr-lcssa:                 ; preds = %50, %.lr.ph19.preheader
  %.lcssa38.ph = phi i64 [ poison, %.lr.ph19.preheader ], [ %51, %50 ]
  %.01217.unr = phi i64 [ 0, %.lr.ph19.preheader ], [ %52, %50 ]
  %.unr = phi i64 [ %.promoted, %.lr.ph19.preheader ], [ %51, %50 ]
  %29 = and i64 %20, 2
  %lcmp.mod.not.not = icmp eq i64 %29, 0
  br i1 %lcmp.mod.not.not, label %.lr.ph19.epil, label %._crit_edge20

.lr.ph19.epil:                                    ; preds = %._crit_edge20.loopexit.unr-lcssa
  %30 = getelementptr inbounds [200000 x i64], ptr @C, i64 0, i64 %.01217.unr
  %31 = load i64, ptr %30, align 16, !tbaa !8
  %32 = icmp sgt i64 %31, 0
  br i1 %32, label %33, label %._crit_edge20

33:                                               ; preds = %.lr.ph19.epil
  %34 = add nsw i64 %.unr, %31
  store i64 %34, ptr %1, align 8, !tbaa !8
  br label %._crit_edge20

._crit_edge20:                                    ; preds = %._crit_edge20.loopexit.unr-lcssa, %33, %.lr.ph19.epil, %._crit_edge
  %35 = phi i64 [ %.promoted, %._crit_edge ], [ %.lcssa38.ph, %._crit_edge20.loopexit.unr-lcssa ], [ %.unr, %.lr.ph19.epil ], [ %34, %33 ]
  %36 = icmp sgt i64 %35, 0
  br i1 %36, label %53, label %56

.lr.ph19:                                         ; preds = %50, %.lr.ph19.preheader.new
  %.01217 = phi i64 [ 0, %.lr.ph19.preheader.new ], [ %52, %50 ]
  %37 = phi i64 [ %.promoted, %.lr.ph19.preheader.new ], [ %51, %50 ]
  %niter = phi i64 [ 0, %.lr.ph19.preheader.new ], [ %niter.next.1, %50 ]
  %38 = getelementptr inbounds [200000 x i64], ptr @C, i64 0, i64 %.01217
  %39 = load i64, ptr %38, align 16, !tbaa !8
  %40 = icmp sgt i64 %39, 0
  br i1 %40, label %41, label %.lr.ph19.1

41:                                               ; preds = %.lr.ph19
  %42 = add nsw i64 %37, %39
  store i64 %42, ptr %1, align 8, !tbaa !8
  br label %.lr.ph19.1

.lr.ph19.1:                                       ; preds = %.lr.ph19, %41
  %43 = phi i64 [ %37, %.lr.ph19 ], [ %42, %41 ]
  %44 = or disjoint i64 %.01217, 2
  %45 = getelementptr inbounds [200000 x i64], ptr @C, i64 0, i64 %44
  %46 = load i64, ptr %45, align 16, !tbaa !8
  %47 = icmp sgt i64 %46, 0
  br i1 %47, label %48, label %50

48:                                               ; preds = %.lr.ph19.1
  %49 = add nsw i64 %43, %46
  store i64 %49, ptr %1, align 8, !tbaa !8
  br label %50

50:                                               ; preds = %48, %.lr.ph19.1
  %51 = phi i64 [ %43, %.lr.ph19.1 ], [ %49, %48 ]
  %52 = add nuw nsw i64 %.01217, 4
  %niter.next.1 = add nuw nsw i64 %niter, 2
  %niter.ncmp.1.not = icmp eq i64 %niter.next.1, %unroll_iter
  br i1 %niter.ncmp.1.not, label %._crit_edge20.loopexit.unr-lcssa, label %.lr.ph19, !llvm.loop !13

53:                                               ; preds = %._crit_edge20
  %54 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %2, ptr noundef nonnull align 8 dereferenceable(8) %1)
  %55 = load i64, ptr %54, align 8, !tbaa !8
  store i64 %55, ptr %2, align 8, !tbaa !8
  %.pre = load i64, ptr @N, align 8, !tbaa !8
  br label %56

56:                                               ; preds = %53, %._crit_edge20
  %57 = phi i64 [ %55, %53 ], [ %17, %._crit_edge20 ]
  %58 = phi i64 [ %.pre, %53 ], [ %18, %._crit_edge20 ]
  store i64 0, ptr %1, align 8, !tbaa !8
  %59 = icmp sgt i64 %58, 1
  br i1 %59, label %.lr.ph24.preheader, label %._crit_edge25.thread

.lr.ph24.preheader:                               ; preds = %56
  %60 = add nsw i64 %58, -2
  %61 = icmp ult i64 %60, 2
  br i1 %61, label %._crit_edge25.unr-lcssa, label %.lr.ph24.preheader.new

.lr.ph24.preheader.new:                           ; preds = %.lr.ph24.preheader
  %62 = lshr i64 %60, 1
  %63 = add nuw i64 %62, 1
  %unroll_iter45 = and i64 %63, -2
  br label %.lr.ph24

._crit_edge25.unr-lcssa:                          ; preds = %84, %.lr.ph24.preheader
  %.lcssa39.ph = phi i64 [ poison, %.lr.ph24.preheader ], [ %85, %84 ]
  %.022.unr = phi i64 [ 1, %.lr.ph24.preheader ], [ %86, %84 ]
  %.unr42 = phi i64 [ 0, %.lr.ph24.preheader ], [ %85, %84 ]
  %64 = and i64 %60, 2
  %lcmp.mod43.not.not = icmp eq i64 %64, 0
  br i1 %lcmp.mod43.not.not, label %.lr.ph24.epil, label %._crit_edge25

.lr.ph24.epil:                                    ; preds = %._crit_edge25.unr-lcssa
  %65 = getelementptr inbounds [200000 x i64], ptr @C, i64 0, i64 %.022.unr
  %66 = load i64, ptr %65, align 8, !tbaa !8
  %67 = icmp sgt i64 %66, 0
  br i1 %67, label %68, label %._crit_edge25

68:                                               ; preds = %.lr.ph24.epil
  %69 = add nsw i64 %.unr42, %66
  store i64 %69, ptr %1, align 8, !tbaa !8
  br label %._crit_edge25

._crit_edge25:                                    ; preds = %.lr.ph24.epil, %68, %._crit_edge25.unr-lcssa
  %.lcssa39 = phi i64 [ %.lcssa39.ph, %._crit_edge25.unr-lcssa ], [ %.unr42, %.lr.ph24.epil ], [ %69, %68 ]
  %70 = icmp sgt i64 %.lcssa39, 0
  br i1 %70, label %87, label %._crit_edge25.thread

.lr.ph24:                                         ; preds = %84, %.lr.ph24.preheader.new
  %.022 = phi i64 [ 1, %.lr.ph24.preheader.new ], [ %86, %84 ]
  %71 = phi i64 [ 0, %.lr.ph24.preheader.new ], [ %85, %84 ]
  %niter46 = phi i64 [ 0, %.lr.ph24.preheader.new ], [ %niter46.next.1, %84 ]
  %72 = getelementptr inbounds [200000 x i64], ptr @C, i64 0, i64 %.022
  %73 = load i64, ptr %72, align 8, !tbaa !8
  %74 = icmp sgt i64 %73, 0
  br i1 %74, label %75, label %.lr.ph24.1

75:                                               ; preds = %.lr.ph24
  %76 = add nsw i64 %71, %73
  store i64 %76, ptr %1, align 8, !tbaa !8
  br label %.lr.ph24.1

.lr.ph24.1:                                       ; preds = %.lr.ph24, %75
  %77 = phi i64 [ %71, %.lr.ph24 ], [ %76, %75 ]
  %78 = add nuw nsw i64 %.022, 2
  %79 = getelementptr inbounds [200000 x i64], ptr @C, i64 0, i64 %78
  %80 = load i64, ptr %79, align 8, !tbaa !8
  %81 = icmp sgt i64 %80, 0
  br i1 %81, label %82, label %84

82:                                               ; preds = %.lr.ph24.1
  %83 = add nsw i64 %77, %80
  store i64 %83, ptr %1, align 8, !tbaa !8
  br label %84

84:                                               ; preds = %82, %.lr.ph24.1
  %85 = phi i64 [ %77, %.lr.ph24.1 ], [ %83, %82 ]
  %86 = add nuw nsw i64 %.022, 4
  %niter46.next.1 = add nuw i64 %niter46, 2
  %niter46.ncmp.1.not = icmp eq i64 %niter46.next.1, %unroll_iter45
  br i1 %niter46.ncmp.1.not, label %._crit_edge25.unr-lcssa, label %.lr.ph24, !llvm.loop !14

87:                                               ; preds = %._crit_edge25
  %88 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %2, ptr noundef nonnull align 8 dereferenceable(8) %1)
  %89 = load i64, ptr %88, align 8, !tbaa !8
  store i64 %89, ptr %2, align 8, !tbaa !8
  br label %._crit_edge25.thread

._crit_edge25.thread:                             ; preds = %56, %87, %._crit_edge25
  %90 = phi i64 [ %89, %87 ], [ %57, %._crit_edge25 ], [ %57, %56 ]
  %91 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %90)
  %92 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %91, i8 noundef signext 10)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #7
  %93 = load i64, ptr @T, align 8, !tbaa !8
  %94 = add nsw i64 %93, -1
  store i64 %94, ptr @T, align 8, !tbaa !8
  %.not = icmp eq i64 %93, 0
  br i1 %.not, label %._crit_edge29, label %.lr.ph28, !llvm.loop !15

._crit_edge29:                                    ; preds = %._crit_edge25.thread, %0
  ret i32 0
}

; Function Attrs: mustprogress nounwind uwtable
declare noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264), ptr noundef) local_unnamed_addr #1 align 2

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

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef ptr @_ZSt11max_elementIPxET_S1_S1_(ptr noundef, ptr noundef) local_unnamed_addr #5

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #6

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8), i8 noundef signext) local_unnamed_addr #5

; 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

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 = { 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 #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { 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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { 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 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !12}
!15 = distinct !{!15, !12}


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