; LLVM IR from eyangch/competitive-programming :: Codeforces/1492 (b)

; 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
@N = external dso_local global i32, align 4
@p = external dso_local global [100000 x i32], align 16
@mx = external dso_local global [100000 x i32], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [2 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [2 x i8], align 1

; 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
  store i32 0, ptr %1, align 4
  %6 = call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %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 nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) @T)
  br label %13

13:                                               ; preds = %100, %0
  %14 = load i32, ptr @T, align 4, !tbaa !8
  %15 = add nsw i32 %14, -1
  store i32 %15, ptr @T, align 4, !tbaa !8
  %16 = icmp ne i32 %14, 0
  br i1 %16, label %17, label %102

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

19:                                               ; preds = %29, %17
  %20 = load i32, ptr %2, align 4, !tbaa !8
  %21 = load i32, ptr @N, align 4, !tbaa !8
  %22 = icmp slt i32 %20, %21
  br i1 %22, label %24, label %23

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

24:                                               ; preds = %19
  %25 = load i32, ptr %2, align 4, !tbaa !8
  %26 = sext i32 %25 to i64
  %27 = getelementptr inbounds [100000 x i32], ptr @p, i64 0, i64 %26
  %28 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %27)
  br label %29

29:                                               ; preds = %24
  %30 = load i32, ptr %2, align 4, !tbaa !8
  %31 = add nsw i32 %30, 1
  store i32 %31, ptr %2, align 4, !tbaa !8
  br label %19, !llvm.loop !11

32:                                               ; preds = %23
  store i32 0, ptr @mx, align 16, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #5
  store i32 1, ptr %3, align 4, !tbaa !8
  br label %33

33:                                               ; preds = %65, %32
  %34 = load i32, ptr %3, align 4, !tbaa !8
  %35 = load i32, ptr @N, align 4, !tbaa !8
  %36 = icmp slt i32 %34, %35
  br i1 %36, label %38, label %37

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

38:                                               ; preds = %33
  %39 = load i32, ptr %3, align 4, !tbaa !8
  %40 = sub nsw i32 %39, 1
  %41 = sext i32 %40 to i64
  %42 = getelementptr inbounds [100000 x i32], ptr @mx, i64 0, i64 %41
  %43 = load i32, ptr %42, align 4, !tbaa !8
  %44 = load i32, ptr %3, align 4, !tbaa !8
  %45 = sext i32 %44 to i64
  %46 = getelementptr inbounds [100000 x i32], ptr @mx, i64 0, i64 %45
  store i32 %43, ptr %46, align 4, !tbaa !8
  %47 = load i32, ptr %3, align 4, !tbaa !8
  %48 = sext i32 %47 to i64
  %49 = getelementptr inbounds [100000 x i32], ptr @p, i64 0, i64 %48
  %50 = load i32, ptr %49, align 4, !tbaa !8
  %51 = load i32, ptr %3, align 4, !tbaa !8
  %52 = sext i32 %51 to i64
  %53 = getelementptr inbounds [100000 x i32], ptr @mx, i64 0, i64 %52
  %54 = load i32, ptr %53, align 4, !tbaa !8
  %55 = sext i32 %54 to i64
  %56 = getelementptr inbounds [100000 x i32], ptr @p, i64 0, i64 %55
  %57 = load i32, ptr %56, align 4, !tbaa !8
  %58 = icmp sgt i32 %50, %57
  br i1 %58, label %59, label %64

59:                                               ; preds = %38
  %60 = load i32, ptr %3, align 4, !tbaa !8
  %61 = load i32, ptr %3, align 4, !tbaa !8
  %62 = sext i32 %61 to i64
  %63 = getelementptr inbounds [100000 x i32], ptr @mx, i64 0, i64 %62
  store i32 %60, ptr %63, align 4, !tbaa !8
  br label %64

64:                                               ; preds = %59, %38
  br label %65

65:                                               ; preds = %64
  %66 = load i32, ptr %3, align 4, !tbaa !8
  %67 = add nsw i32 %66, 1
  store i32 %67, ptr %3, align 4, !tbaa !8
  br label %33, !llvm.loop !13

68:                                               ; preds = %37
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #5
  %69 = load i32, ptr @N, align 4, !tbaa !8
  %70 = sub nsw i32 %69, 1
  store i32 %70, ptr %4, align 4, !tbaa !8
  br label %71

71:                                               ; preds = %94, %68
  %72 = load i32, ptr %4, align 4, !tbaa !8
  %73 = icmp sge i32 %72, 0
  br i1 %73, label %74, label %100

74:                                               ; preds = %71
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #5
  %75 = load i32, ptr %4, align 4, !tbaa !8
  %76 = sext i32 %75 to i64
  %77 = getelementptr inbounds [100000 x i32], ptr @mx, i64 0, i64 %76
  %78 = load i32, ptr %77, align 4, !tbaa !8
  store i32 %78, ptr %5, align 4, !tbaa !8
  br label %79

79:                                               ; preds = %91, %74
  %80 = load i32, ptr %5, align 4, !tbaa !8
  %81 = load i32, ptr %4, align 4, !tbaa !8
  %82 = icmp sle i32 %80, %81
  br i1 %82, label %84, label %83

83:                                               ; preds = %79
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  br label %94

84:                                               ; preds = %79
  %85 = load i32, ptr %5, align 4, !tbaa !8
  %86 = sext i32 %85 to i64
  %87 = getelementptr inbounds [100000 x i32], ptr @p, i64 0, i64 %86
  %88 = load i32, ptr %87, align 4, !tbaa !8
  %89 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %88)
  %90 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %89, ptr noundef @.str)
  br label %91

91:                                               ; preds = %84
  %92 = load i32, ptr %5, align 4, !tbaa !8
  %93 = add nsw i32 %92, 1
  store i32 %93, ptr %5, align 4, !tbaa !8
  br label %79, !llvm.loop !14

94:                                               ; preds = %83
  %95 = load i32, ptr %4, align 4, !tbaa !8
  %96 = sext i32 %95 to i64
  %97 = getelementptr inbounds [100000 x i32], ptr @mx, i64 0, i64 %96
  %98 = load i32, ptr %97, align 4, !tbaa !8
  %99 = sub nsw i32 %98, 1
  store i32 %99, ptr %4, align 4, !tbaa !8
  br label %71, !llvm.loop !15

100:                                              ; preds = %71
  %101 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.1)
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #5
  br label %13, !llvm.loop !16

102:                                              ; preds = %13
  %103 = load i32, ptr %1, align 4
  ret i32 %103
}

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

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

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 = { 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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !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}
!16 = distinct !{!16, !12}


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

%"class.std::basic_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
@N = external dso_local global i32, align 4
@p = external dso_local global [100000 x i32], align 16
@mx = external dso_local local_unnamed_addr global [100000 x i32], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [2 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [2 x i8], align 1

; 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 = 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)
  %8 = load i32, ptr @T, align 4, !tbaa !8
  %9 = add nsw i32 %8, -1
  store i32 %9, ptr @T, align 4, !tbaa !8
  %.not36 = icmp eq i32 %8, 0
  br i1 %.not36, label %._crit_edge39, label %.lr.ph38

.lr.ph38:                                         ; preds = %0, %._crit_edge35
  %10 = 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)
  %11 = load i32, ptr @N, align 4, !tbaa !8
  %12 = icmp sgt i32 %11, 0
  br i1 %12, label %.lr.ph, label %.preheader.thread

.preheader.thread:                                ; preds = %.lr.ph38
  store i32 0, ptr @mx, align 16, !tbaa !8
  br label %._crit_edge35

._crit_edge:                                      ; preds = %.lr.ph
  store i32 0, ptr @mx, align 16, !tbaa !8
  %13 = icmp sgt i32 %18, 1
  br i1 %13, label %.lr.ph27.preheader, label %.preheader

.lr.ph27.preheader:                               ; preds = %._crit_edge
  %wide.trip.count = zext nneg i32 %18 to i64
  %14 = add nsw i64 %wide.trip.count, -1
  %xtraiter = and i64 %14, 1
  %15 = icmp eq i32 %18, 2
  br i1 %15, label %.preheader.loopexit.unr-lcssa, label %.lr.ph27.preheader.new

.lr.ph27.preheader.new:                           ; preds = %.lr.ph27.preheader
  %unroll_iter = and i64 %14, -2
  br label %.lr.ph27

.lr.ph:                                           ; preds = %.lr.ph38, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %.lr.ph38 ]
  %16 = getelementptr inbounds [100000 x i32], ptr @p, i64 0, i64 %indvars.iv
  %17 = 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) %16)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %18 = load i32, ptr @N, align 4, !tbaa !8
  %19 = sext i32 %18 to i64
  %20 = icmp slt i64 %indvars.iv.next, %19
  br i1 %20, label %.lr.ph, label %._crit_edge, !llvm.loop !11

.preheader.loopexit.unr-lcssa:                    ; preds = %.lr.ph27, %.lr.ph27.preheader
  %.unr = phi i32 [ 0, %.lr.ph27.preheader ], [ %spec.store.select.1, %.lr.ph27 ]
  %indvars.iv42.unr = phi i64 [ 1, %.lr.ph27.preheader ], [ %indvars.iv.next43.1, %.lr.ph27 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.preheader, label %.lr.ph27.epil

.lr.ph27.epil:                                    ; preds = %.preheader.loopexit.unr-lcssa
  %21 = getelementptr inbounds [100000 x i32], ptr @mx, i64 0, i64 %indvars.iv42.unr
  %22 = getelementptr inbounds [100000 x i32], ptr @p, i64 0, i64 %indvars.iv42.unr
  %23 = load i32, ptr %22, align 4, !tbaa !8
  %24 = sext i32 %.unr to i64
  %25 = getelementptr inbounds [100000 x i32], ptr @p, i64 0, i64 %24
  %26 = load i32, ptr %25, align 4, !tbaa !8
  %27 = icmp sgt i32 %23, %26
  %28 = trunc nuw nsw i64 %indvars.iv42.unr to i32
  %spec.store.select.epil = select i1 %27, i32 %28, i32 %.unr
  store i32 %spec.store.select.epil, ptr %21, align 4
  br label %.preheader

.preheader:                                       ; preds = %.lr.ph27.epil, %.preheader.loopexit.unr-lcssa, %._crit_edge
  %29 = icmp sgt i32 %18, 0
  br i1 %29, label %.lr.ph34, label %._crit_edge35

.lr.ph27:                                         ; preds = %.lr.ph27, %.lr.ph27.preheader.new
  %30 = phi i32 [ 0, %.lr.ph27.preheader.new ], [ %spec.store.select.1, %.lr.ph27 ]
  %indvars.iv42 = phi i64 [ 1, %.lr.ph27.preheader.new ], [ %indvars.iv.next43.1, %.lr.ph27 ]
  %niter = phi i64 [ 0, %.lr.ph27.preheader.new ], [ %niter.next.1, %.lr.ph27 ]
  %31 = getelementptr inbounds [100000 x i32], ptr @mx, i64 0, i64 %indvars.iv42
  %32 = getelementptr inbounds [100000 x i32], ptr @p, i64 0, i64 %indvars.iv42
  %33 = load i32, ptr %32, align 4, !tbaa !8
  %34 = sext i32 %30 to i64
  %35 = getelementptr inbounds [100000 x i32], ptr @p, i64 0, i64 %34
  %36 = load i32, ptr %35, align 4, !tbaa !8
  %37 = icmp sgt i32 %33, %36
  %38 = trunc nuw nsw i64 %indvars.iv42 to i32
  %spec.store.select = select i1 %37, i32 %38, i32 %30
  store i32 %spec.store.select, ptr %31, align 4
  %indvars.iv.next43 = add nuw nsw i64 %indvars.iv42, 1
  %39 = getelementptr inbounds [100000 x i32], ptr @mx, i64 0, i64 %indvars.iv.next43
  %40 = getelementptr inbounds [100000 x i32], ptr @p, i64 0, i64 %indvars.iv.next43
  %41 = load i32, ptr %40, align 4, !tbaa !8
  %42 = sext i32 %spec.store.select to i64
  %43 = getelementptr inbounds [100000 x i32], ptr @p, i64 0, i64 %42
  %44 = load i32, ptr %43, align 4, !tbaa !8
  %45 = icmp sgt i32 %41, %44
  %46 = trunc nuw nsw i64 %indvars.iv.next43 to i32
  %spec.store.select.1 = select i1 %45, i32 %46, i32 %spec.store.select
  store i32 %spec.store.select.1, ptr %39, align 4
  %indvars.iv.next43.1 = add nuw nsw i64 %indvars.iv42, 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 %.preheader.loopexit.unr-lcssa, label %.lr.ph27, !llvm.loop !13

.lr.ph34:                                         ; preds = %.preheader, %._crit_edge32
  %.019.in33 = phi i32 [ %51, %._crit_edge32 ], [ %18, %.preheader ]
  %.019 = add nsw i32 %.019.in33, -1
  %47 = zext nneg i32 %.019 to i64
  %48 = getelementptr inbounds [100000 x i32], ptr @mx, i64 0, i64 %47
  %49 = load i32, ptr %48, align 4, !tbaa !8
  %.not23.not28 = icmp slt i32 %49, %.019.in33
  br i1 %.not23.not28, label %.lr.ph31.preheader, label %._crit_edge32

.lr.ph31.preheader:                               ; preds = %.lr.ph34
  %50 = sext i32 %49 to i64
  br label %.lr.ph31

._crit_edge32.loopexit:                           ; preds = %.lr.ph31
  %.pre = load i32, ptr %48, align 4, !tbaa !8
  br label %._crit_edge32

._crit_edge32:                                    ; preds = %._crit_edge32.loopexit, %.lr.ph34
  %51 = phi i32 [ %.pre, %._crit_edge32.loopexit ], [ %49, %.lr.ph34 ]
  %52 = icmp sgt i32 %51, 0
  br i1 %52, label %.lr.ph34, label %._crit_edge35, !llvm.loop !14

.lr.ph31:                                         ; preds = %.lr.ph31.preheader, %.lr.ph31
  %indvars.iv45 = phi i64 [ %50, %.lr.ph31.preheader ], [ %indvars.iv.next46, %.lr.ph31 ]
  %53 = getelementptr inbounds [100000 x i32], ptr @p, i64 0, i64 %indvars.iv45
  %54 = load i32, ptr %53, align 4, !tbaa !8
  %55 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %54)
  %56 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %55, ptr noundef nonnull @.str)
  %indvars.iv.next46 = add nsw i64 %indvars.iv45, 1
  %lftr.wideiv = trunc i64 %indvars.iv.next46 to i32
  %exitcond48.not = icmp eq i32 %.019.in33, %lftr.wideiv
  br i1 %exitcond48.not, label %._crit_edge32.loopexit, label %.lr.ph31, !llvm.loop !15

._crit_edge35:                                    ; preds = %._crit_edge32, %.preheader.thread, %.preheader
  %57 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str.1)
  %58 = load i32, ptr @T, align 4, !tbaa !8
  %59 = add nsw i32 %58, -1
  store i32 %59, ptr @T, align 4, !tbaa !8
  %.not = icmp eq i32 %58, 0
  br i1 %.not, label %._crit_edge39, label %.lr.ph38, !llvm.loop !16

._crit_edge39:                                    ; preds = %._crit_edge35, %0
  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: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #3

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

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 = { 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 = !{!"int", !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}
!16 = distinct !{!16, !12}


; Effective O3 passes: BDCEPass,CorrelatedValuePropagationPass,DSEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass,TailCallElimPass