; LLVM IR from lzyrapx/Competitive-Programming :: HDUOJ (1051)

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

%struct.ac = type { i32, i32, i32 }
%"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 }

@node = external dso_local global [5005 x %struct.ac], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@.str = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z3cmp2acS_(i64, i32, i64, i32) #0

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #1 {
  %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
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  br label %8

8:                                                ; preds = %126, %0
  %9 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %7)
  %10 = load ptr, ptr %9, align 8, !tbaa !5
  %11 = getelementptr i8, ptr %10, i64 -24
  %12 = load i64, ptr %11, align 8
  %13 = getelementptr inbounds i8, ptr %9, i64 %12
  %14 = call noundef zeroext i1 @_ZNKSt9basic_iosIcSt11char_traitsIcEEcvbEv(ptr noundef nonnull align 8 dereferenceable(264) %13)
  br i1 %14, label %15, label %127

15:                                               ; preds = %8
  br label %16

16:                                               ; preds = %123, %15
  %17 = load i32, ptr %7, align 4, !tbaa !8
  %18 = add nsw i32 %17, -1
  store i32 %18, ptr %7, align 4, !tbaa !8
  %19 = icmp ne i32 %17, 0
  br i1 %19, label %20, label %126

20:                                               ; preds = %16
  store i32 0, ptr %5, align 4, !tbaa !8
  store i32 0, ptr %3, align 4, !tbaa !8
  br label %21

21:                                               ; preds = %29, %20
  %22 = load i32, ptr %3, align 4, !tbaa !8
  %23 = icmp slt i32 %22, 5005
  br i1 %23, label %24, label %32

24:                                               ; preds = %21
  %25 = load i32, ptr %3, align 4, !tbaa !8
  %26 = sext i32 %25 to i64
  %27 = getelementptr inbounds [5005 x %struct.ac], ptr @node, i64 0, i64 %26
  %28 = getelementptr inbounds %struct.ac, ptr %27, i32 0, i32 2
  store i32 0, ptr %28, align 4, !tbaa !11
  br label %29

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

32:                                               ; preds = %21
  %33 = 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)
  store i32 0, ptr %3, align 4, !tbaa !8
  br label %34

34:                                               ; preds = %49, %32
  %35 = load i32, ptr %3, align 4, !tbaa !8
  %36 = load i32, ptr %2, align 4, !tbaa !8
  %37 = icmp slt i32 %35, %36
  br i1 %37, label %38, label %52

38:                                               ; preds = %34
  %39 = load i32, ptr %3, align 4, !tbaa !8
  %40 = sext i32 %39 to i64
  %41 = getelementptr inbounds [5005 x %struct.ac], ptr @node, i64 0, i64 %40
  %42 = getelementptr inbounds %struct.ac, ptr %41, i32 0, i32 0
  %43 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %42)
  %44 = load i32, ptr %3, align 4, !tbaa !8
  %45 = sext i32 %44 to i64
  %46 = getelementptr inbounds [5005 x %struct.ac], ptr @node, i64 0, i64 %45
  %47 = getelementptr inbounds %struct.ac, ptr %46, i32 0, i32 1
  %48 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %47)
  br label %49

49:                                               ; preds = %38
  %50 = load i32, ptr %3, align 4, !tbaa !8
  %51 = add nsw i32 %50, 1
  store i32 %51, ptr %3, align 4, !tbaa !8
  br label %34, !llvm.loop !15

52:                                               ; preds = %34
  %53 = load i32, ptr %2, align 4, !tbaa !8
  %54 = sext i32 %53 to i64
  %55 = getelementptr inbounds %struct.ac, ptr @node, i64 %54
  call void @_ZSt4sortIP2acPFiS0_S0_EEvT_S4_T0_(ptr noundef @node, ptr noundef %55, ptr noundef @_Z3cmp2acS_)
  store i32 0, ptr %3, align 4, !tbaa !8
  br label %56

56:                                               ; preds = %120, %52
  %57 = load i32, ptr %3, align 4, !tbaa !8
  %58 = load i32, ptr %2, align 4, !tbaa !8
  %59 = icmp slt i32 %57, %58
  br i1 %59, label %60, label %123

60:                                               ; preds = %56
  %61 = load i32, ptr %3, align 4, !tbaa !8
  %62 = sext i32 %61 to i64
  %63 = getelementptr inbounds [5005 x %struct.ac], ptr @node, i64 0, i64 %62
  %64 = getelementptr inbounds %struct.ac, ptr %63, i32 0, i32 2
  %65 = load i32, ptr %64, align 4, !tbaa !11
  %66 = icmp eq i32 %65, 1
  br i1 %66, label %67, label %68

67:                                               ; preds = %60
  br label %120

68:                                               ; preds = %60
  %69 = load i32, ptr %5, align 4, !tbaa !8
  %70 = add nsw i32 %69, 1
  store i32 %70, ptr %5, align 4, !tbaa !8
  %71 = load i32, ptr %3, align 4, !tbaa !8
  store i32 %71, ptr %6, align 4, !tbaa !8
  %72 = load i32, ptr %3, align 4, !tbaa !8
  %73 = add nsw i32 %72, 1
  store i32 %73, ptr %4, align 4, !tbaa !8
  br label %74

74:                                               ; preds = %116, %68
  %75 = load i32, ptr %4, align 4, !tbaa !8
  %76 = load i32, ptr %2, align 4, !tbaa !8
  %77 = icmp slt i32 %75, %76
  br i1 %77, label %78, label %119

78:                                               ; preds = %74
  %79 = load i32, ptr %4, align 4, !tbaa !8
  %80 = sext i32 %79 to i64
  %81 = getelementptr inbounds [5005 x %struct.ac], ptr @node, i64 0, i64 %80
  %82 = getelementptr inbounds %struct.ac, ptr %81, i32 0, i32 0
  %83 = load i32, ptr %82, align 4, !tbaa !16
  %84 = load i32, ptr %6, align 4, !tbaa !8
  %85 = sext i32 %84 to i64
  %86 = getelementptr inbounds [5005 x %struct.ac], ptr @node, i64 0, i64 %85
  %87 = getelementptr inbounds %struct.ac, ptr %86, i32 0, i32 0
  %88 = load i32, ptr %87, align 4, !tbaa !16
  %89 = icmp sge i32 %83, %88
  br i1 %89, label %90, label %115

90:                                               ; preds = %78
  %91 = load i32, ptr %4, align 4, !tbaa !8
  %92 = sext i32 %91 to i64
  %93 = getelementptr inbounds [5005 x %struct.ac], ptr @node, i64 0, i64 %92
  %94 = getelementptr inbounds %struct.ac, ptr %93, i32 0, i32 1
  %95 = load i32, ptr %94, align 4, !tbaa !17
  %96 = load i32, ptr %6, align 4, !tbaa !8
  %97 = sext i32 %96 to i64
  %98 = getelementptr inbounds [5005 x %struct.ac], ptr @node, i64 0, i64 %97
  %99 = getelementptr inbounds %struct.ac, ptr %98, i32 0, i32 1
  %100 = load i32, ptr %99, align 4, !tbaa !17
  %101 = icmp sge i32 %95, %100
  br i1 %101, label %102, label %115

102:                                              ; preds = %90
  %103 = load i32, ptr %4, align 4, !tbaa !8
  %104 = sext i32 %103 to i64
  %105 = getelementptr inbounds [5005 x %struct.ac], ptr @node, i64 0, i64 %104
  %106 = getelementptr inbounds %struct.ac, ptr %105, i32 0, i32 2
  %107 = load i32, ptr %106, align 4, !tbaa !11
  %108 = icmp eq i32 %107, 0
  br i1 %108, label %109, label %115

109:                                              ; preds = %102
  %110 = load i32, ptr %4, align 4, !tbaa !8
  %111 = sext i32 %110 to i64
  %112 = getelementptr inbounds [5005 x %struct.ac], ptr @node, i64 0, i64 %111
  %113 = getelementptr inbounds %struct.ac, ptr %112, i32 0, i32 2
  store i32 1, ptr %113, align 4, !tbaa !11
  %114 = load i32, ptr %4, align 4, !tbaa !8
  store i32 %114, ptr %6, align 4, !tbaa !8
  br label %115

115:                                              ; preds = %109, %102, %90, %78
  br label %116

116:                                              ; preds = %115
  %117 = load i32, ptr %4, align 4, !tbaa !8
  %118 = add nsw i32 %117, 1
  store i32 %118, ptr %4, align 4, !tbaa !8
  br label %74, !llvm.loop !18

119:                                              ; preds = %74
  br label %120

120:                                              ; preds = %119, %67
  %121 = load i32, ptr %3, align 4, !tbaa !8
  %122 = add nsw i32 %121, 1
  store i32 %122, ptr %3, align 4, !tbaa !8
  br label %56, !llvm.loop !19

123:                                              ; preds = %56
  %124 = load i32, ptr %5, align 4, !tbaa !8
  %125 = call i32 (ptr, ...) @printf(ptr noundef @.str, i32 noundef %124)
  br label %16, !llvm.loop !20

126:                                              ; preds = %16
  br label %8, !llvm.loop !21

127:                                              ; preds = %8
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #6
  ret i32 0
}

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

; Function Attrs: mustprogress uwtable
declare noundef zeroext i1 @_ZNKSt9basic_iosIcSt11char_traitsIcEEcvbEv(ptr noundef nonnull align 8 dereferenceable(264)) #4 align 2

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

declare i32 @printf(ptr noundef, ...) #3

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

attributes #0 = { 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 #1 = { 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 #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { "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 = { 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 = !{!"int", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}
!11 = !{!12, !9, i64 8}
!12 = !{!"_ZTS2ac", !9, i64 0, !9, i64 4, !9, i64 8}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}
!16 = !{!12, !9, i64 0}
!17 = !{!12, !9, i64 4}
!18 = distinct !{!18, !14}
!19 = distinct !{!19, !14}
!20 = distinct !{!20, !14}
!21 = distinct !{!21, !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"

%struct.ac = type { i32, i32, i32 }
%"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 }

@node = external dso_local global [5005 x %struct.ac], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@.str = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z3cmp2acS_(i64, i32, i64, i32) #0

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #1 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #7
  %3 = 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)
  %4 = load ptr, ptr %3, align 8, !tbaa !5
  %5 = getelementptr i8, ptr %4, i64 -24
  %6 = load i64, ptr %5, align 8
  %7 = getelementptr inbounds i8, ptr %3, i64 %6
  %8 = call noundef zeroext i1 @_ZNKSt9basic_iosIcSt11char_traitsIcEEcvbEv(ptr noundef nonnull align 8 dereferenceable(264) %7)
  br i1 %8, label %.preheader31, label %._crit_edge48

.loopexit32:                                      ; preds = %._crit_edge45, %.preheader31
  %9 = 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)
  %10 = load ptr, ptr %9, align 8, !tbaa !5
  %11 = getelementptr i8, ptr %10, i64 -24
  %12 = load i64, ptr %11, align 8
  %13 = getelementptr inbounds i8, ptr %9, i64 %12
  %14 = call noundef zeroext i1 @_ZNKSt9basic_iosIcSt11char_traitsIcEEcvbEv(ptr noundef nonnull align 8 dereferenceable(264) %13)
  br i1 %14, label %.preheader31, label %._crit_edge48, !llvm.loop !8

.preheader31:                                     ; preds = %0, %.loopexit32
  %15 = load i32, ptr %2, align 4, !tbaa !10
  %16 = add nsw i32 %15, -1
  store i32 %16, ptr %2, align 4, !tbaa !10
  %.not47 = icmp eq i32 %15, 0
  br i1 %.not47, label %.loopexit32, label %.preheader

.preheader:                                       ; preds = %.preheader31, %.preheader.backedge
  %indvars.iv = phi i64 [ %indvars.iv.be, %.preheader.backedge ], [ 0, %.preheader31 ]
  %17 = getelementptr inbounds [5005 x %struct.ac], ptr @node, i64 0, i64 %indvars.iv, i32 2
  store i32 0, ptr %17, align 4, !tbaa !13
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, 5005
  br i1 %exitcond.not, label %18, label %.preheader.backedge

.preheader.backedge:                              ; preds = %.preheader, %._crit_edge45
  %indvars.iv.be = phi i64 [ %indvars.iv.next, %.preheader ], [ 0, %._crit_edge45 ]
  br label %.preheader, !llvm.loop !15

18:                                               ; preds = %.preheader
  %19 = 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)
  %20 = load i32, ptr %1, align 4, !tbaa !10
  %21 = icmp sgt i32 %20, 0
  br i1 %21, label %.lr.ph, label %.._crit_edge_crit_edge

.._crit_edge_crit_edge:                           ; preds = %18
  %.pre = sext i32 %20 to i64
  br label %._crit_edge

.lr.ph:                                           ; preds = %18, %.lr.ph
  %indvars.iv51 = phi i64 [ %indvars.iv.next52, %.lr.ph ], [ 0, %18 ]
  %22 = getelementptr inbounds [5005 x %struct.ac], ptr @node, i64 0, i64 %indvars.iv51
  %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)
  %24 = getelementptr inbounds i8, ptr %22, i64 4
  %25 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %24)
  %indvars.iv.next52 = add nuw nsw i64 %indvars.iv51, 1
  %26 = load i32, ptr %1, align 4, !tbaa !10
  %27 = sext i32 %26 to i64
  %28 = icmp slt i64 %indvars.iv.next52, %27
  br i1 %28, label %.lr.ph, label %._crit_edge, !llvm.loop !16

._crit_edge:                                      ; preds = %.lr.ph, %.._crit_edge_crit_edge
  %.pre-phi = phi i64 [ %.pre, %.._crit_edge_crit_edge ], [ %27, %.lr.ph ]
  %29 = getelementptr inbounds %struct.ac, ptr @node, i64 %.pre-phi
  call void @_ZSt4sortIP2acPFiS0_S0_EEvT_S4_T0_(ptr noundef nonnull @node, ptr noundef nonnull %29, ptr noundef nonnull @_Z3cmp2acS_)
  %30 = load i32, ptr %1, align 4, !tbaa !10
  %31 = icmp sgt i32 %30, 0
  br i1 %31, label %.lr.ph44.preheader, label %._crit_edge45

.lr.ph44.preheader:                               ; preds = %._crit_edge
  %32 = zext nneg i32 %30 to i64
  %wide.trip.count64 = zext nneg i32 %30 to i64
  br label %.lr.ph44

.lr.ph44:                                         ; preds = %.lr.ph44.preheader, %.loopexit
  %indvars.iv60 = phi i64 [ 0, %.lr.ph44.preheader ], [ %indvars.iv.next61.pre-phi, %.loopexit ]
  %indvars.iv54 = phi i64 [ 1, %.lr.ph44.preheader ], [ %indvars.iv.next55, %.loopexit ]
  %.02342 = phi i32 [ 0, %.lr.ph44.preheader ], [ %.124, %.loopexit ]
  %33 = getelementptr inbounds [5005 x %struct.ac], ptr @node, i64 0, i64 %indvars.iv60, i32 2
  %34 = load i32, ptr %33, align 4, !tbaa !13
  %35 = icmp eq i32 %34, 1
  br i1 %35, label %.lr.ph44..loopexit_crit_edge, label %36

.lr.ph44..loopexit_crit_edge:                     ; preds = %.lr.ph44
  %.pre66 = add nuw nsw i64 %indvars.iv60, 1
  br label %.loopexit

36:                                               ; preds = %.lr.ph44
  %37 = add nsw i32 %.02342, 1
  %38 = add nuw nsw i64 %indvars.iv60, 1
  %39 = icmp slt i64 %38, %32
  br i1 %39, label %.lr.ph39.preheader, label %.loopexit

.lr.ph39.preheader:                               ; preds = %36
  %40 = trunc nuw nsw i64 %indvars.iv60 to i32
  br label %.lr.ph39

.lr.ph39:                                         ; preds = %.lr.ph39.preheader, %57
  %indvars.iv56 = phi i64 [ %indvars.iv54, %.lr.ph39.preheader ], [ %indvars.iv.next57, %57 ]
  %.036 = phi i32 [ %40, %.lr.ph39.preheader ], [ %.1, %57 ]
  %41 = getelementptr inbounds [5005 x %struct.ac], ptr @node, i64 0, i64 %indvars.iv56
  %42 = load i32, ptr %41, align 4, !tbaa !17
  %43 = sext i32 %.036 to i64
  %44 = getelementptr inbounds [5005 x %struct.ac], ptr @node, i64 0, i64 %43
  %45 = load i32, ptr %44, align 4, !tbaa !17
  %.not29 = icmp slt i32 %42, %45
  br i1 %.not29, label %57, label %46

46:                                               ; preds = %.lr.ph39
  %47 = getelementptr inbounds i8, ptr %41, i64 4
  %48 = load i32, ptr %47, align 4, !tbaa !18
  %49 = getelementptr inbounds i8, ptr %44, i64 4
  %50 = load i32, ptr %49, align 4, !tbaa !18
  %.not30 = icmp slt i32 %48, %50
  br i1 %.not30, label %57, label %51

51:                                               ; preds = %46
  %52 = getelementptr inbounds i8, ptr %41, i64 8
  %53 = load i32, ptr %52, align 4, !tbaa !13
  %54 = icmp eq i32 %53, 0
  br i1 %54, label %55, label %57

55:                                               ; preds = %51
  store i32 1, ptr %52, align 4, !tbaa !13
  %56 = trunc nuw nsw i64 %indvars.iv56 to i32
  br label %57

57:                                               ; preds = %.lr.ph39, %46, %51, %55
  %.1 = phi i32 [ %56, %55 ], [ %.036, %51 ], [ %.036, %46 ], [ %.036, %.lr.ph39 ]
  %indvars.iv.next57 = add nuw nsw i64 %indvars.iv56, 1
  %exitcond59.not = icmp eq i64 %indvars.iv.next57, %wide.trip.count64
  br i1 %exitcond59.not, label %.loopexit, label %.lr.ph39, !llvm.loop !19

.loopexit:                                        ; preds = %57, %.lr.ph44..loopexit_crit_edge, %36
  %indvars.iv.next61.pre-phi = phi i64 [ %.pre66, %.lr.ph44..loopexit_crit_edge ], [ %38, %36 ], [ %38, %57 ]
  %.124 = phi i32 [ %.02342, %.lr.ph44..loopexit_crit_edge ], [ %37, %36 ], [ %37, %57 ]
  %indvars.iv.next55 = add nuw nsw i64 %indvars.iv54, 1
  %exitcond65.not = icmp eq i64 %indvars.iv.next61.pre-phi, %wide.trip.count64
  br i1 %exitcond65.not, label %._crit_edge45, label %.lr.ph44, !llvm.loop !20

._crit_edge45:                                    ; preds = %.loopexit, %._crit_edge
  %.023.lcssa = phi i32 [ 0, %._crit_edge ], [ %.124, %.loopexit ]
  %58 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %.023.lcssa)
  %59 = load i32, ptr %2, align 4, !tbaa !10
  %60 = add nsw i32 %59, -1
  store i32 %60, ptr %2, align 4, !tbaa !10
  %.not = icmp eq i32 %59, 0
  br i1 %.not, label %.loopexit32, label %.preheader.backedge

._crit_edge48:                                    ; preds = %.loopexit32, %0
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #7
  ret i32 0
}

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

; Function Attrs: mustprogress uwtable
declare noundef zeroext i1 @_ZNKSt9basic_iosIcSt11char_traitsIcEEcvbEv(ptr noundef nonnull align 8 dereferenceable(264)) local_unnamed_addr #4 align 2

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

; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #6

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

attributes #0 = { 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 #1 = { 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 #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { "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 = { 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 = { nofree nounwind "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 = distinct !{!8, !9}
!9 = !{!"llvm.loop.mustprogress"}
!10 = !{!11, !11, i64 0}
!11 = !{!"int", !12, i64 0}
!12 = !{!"omnipotent char", !7, i64 0}
!13 = !{!14, !11, i64 8}
!14 = !{!"_ZTS2ac", !11, i64 0, !11, i64 4, !11, i64 8}
!15 = distinct !{!15, !9}
!16 = distinct !{!16, !9}
!17 = !{!14, !11, i64 0}
!18 = !{!14, !11, i64 4}
!19 = distinct !{!19, !9}
!20 = distinct !{!20, !9}


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