; LLVM IR from tangjz/acm-icpc :: lydsy (1017)

; 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.Edge = type { i32, i32, i32 }

@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@root = external dso_local global i32, align 4
@c = external dso_local global [52 x i32], align 16
@s = external dso_local global [52 x i32], align 16
@w = external dso_local global [52 x i32], align 16
@f = external dso_local global [52 x [2001 x i32]], align 16
@ans = external dso_local global i32, align 4
@tot = external dso_local global i32, align 4
@pre = external dso_local global [52 x i32], align 16
@e = external dso_local global [52 x %struct.Edge], align 16
@vis = external dso_local global [52 x i8], align 16
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z4dfs1i(i32 noundef) #0

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z4dfs2ii(i32 noundef, i32 noundef) #0

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #2 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i8, align 1
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca %struct.Edge, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %11 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @n, ptr noundef @m)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #5
  store i32 1, ptr %2, align 4, !tbaa !5
  br label %12

12:                                               ; preds = %63, %0
  %13 = load i32, ptr %2, align 4, !tbaa !5
  %14 = load i32, ptr @n, align 4, !tbaa !5
  %15 = icmp sle i32 %13, %14
  br i1 %15, label %17, label %16

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

17:                                               ; preds = %12
  call void @llvm.lifetime.start.p0(i64 1, ptr %3) #5
  %18 = load i32, ptr %2, align 4, !tbaa !5
  %19 = sext i32 %18 to i64
  %20 = getelementptr inbounds i32, ptr @w, i64 %19
  %21 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %20, ptr noundef %3)
  %22 = load i8, ptr %3, align 1, !tbaa !9
  %23 = sext i8 %22 to i32
  %24 = icmp eq i32 %23, 65
  br i1 %24, label %25, label %54

25:                                               ; preds = %17
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  %26 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.2, ptr noundef %4)
  br label %27

27:                                               ; preds = %31, %25
  %28 = load i32, ptr %4, align 4, !tbaa !5
  %29 = add nsw i32 %28, -1
  store i32 %29, ptr %4, align 4, !tbaa !5
  %30 = icmp ne i32 %28, 0
  br i1 %30, label %31, label %53

31:                                               ; preds = %27
  %32 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %5, ptr noundef %6)
  call void @llvm.lifetime.start.p0(i64 12, ptr %7) #5
  %33 = getelementptr inbounds %struct.Edge, ptr %7, i32 0, i32 0
  %34 = load i32, ptr %2, align 4, !tbaa !5
  %35 = sext i32 %34 to i64
  %36 = getelementptr inbounds [52 x i32], ptr @pre, i64 0, i64 %35
  %37 = load i32, ptr %36, align 4, !tbaa !5
  store i32 %37, ptr %33, align 4, !tbaa !10
  %38 = getelementptr inbounds %struct.Edge, ptr %7, i32 0, i32 1
  %39 = load i32, ptr %5, align 4, !tbaa !5
  store i32 %39, ptr %38, align 4, !tbaa !12
  %40 = getelementptr inbounds %struct.Edge, ptr %7, i32 0, i32 2
  %41 = load i32, ptr %6, align 4, !tbaa !5
  store i32 %41, ptr %40, align 4, !tbaa !13
  %42 = load i32, ptr @tot, align 4, !tbaa !5
  %43 = add nsw i32 %42, 1
  store i32 %43, ptr @tot, align 4, !tbaa !5
  %44 = sext i32 %43 to i64
  %45 = getelementptr inbounds [52 x %struct.Edge], ptr @e, i64 0, i64 %44
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %45, ptr align 4 %7, i64 12, i1 false), !tbaa.struct !14
  call void @llvm.lifetime.end.p0(i64 12, ptr %7) #5
  %46 = load i32, ptr @tot, align 4, !tbaa !5
  %47 = load i32, ptr %2, align 4, !tbaa !5
  %48 = sext i32 %47 to i64
  %49 = getelementptr inbounds [52 x i32], ptr @pre, i64 0, i64 %48
  store i32 %46, ptr %49, align 4, !tbaa !5
  %50 = load i32, ptr %5, align 4, !tbaa !5
  %51 = sext i32 %50 to i64
  %52 = getelementptr inbounds [52 x i8], ptr @vis, i64 0, i64 %51
  store i8 1, ptr %52, align 1, !tbaa !15
  br label %27, !llvm.loop !17

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

54:                                               ; preds = %17
  %55 = load i32, ptr %2, align 4, !tbaa !5
  %56 = sext i32 %55 to i64
  %57 = getelementptr inbounds i32, ptr @c, i64 %56
  %58 = load i32, ptr %2, align 4, !tbaa !5
  %59 = sext i32 %58 to i64
  %60 = getelementptr inbounds i32, ptr @s, i64 %59
  %61 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %57, ptr noundef %60)
  br label %62

62:                                               ; preds = %54, %53
  call void @llvm.lifetime.end.p0(i64 1, ptr %3) #5
  br label %63

63:                                               ; preds = %62
  %64 = load i32, ptr %2, align 4, !tbaa !5
  %65 = add nsw i32 %64, 1
  store i32 %65, ptr %2, align 4, !tbaa !5
  br label %12, !llvm.loop !19

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

67:                                               ; preds = %81, %66
  %68 = load i32, ptr %8, align 4, !tbaa !5
  %69 = load i32, ptr @n, align 4, !tbaa !5
  %70 = icmp sle i32 %68, %69
  br i1 %70, label %72, label %71

71:                                               ; preds = %67
  store i32 7, ptr %9, align 4
  br label %84

72:                                               ; preds = %67
  %73 = load i32, ptr %8, align 4, !tbaa !5
  %74 = sext i32 %73 to i64
  %75 = getelementptr inbounds [52 x i8], ptr @vis, i64 0, i64 %74
  %76 = load i8, ptr %75, align 1, !tbaa !15, !range !20, !noundef !21
  %77 = trunc i8 %76 to i1
  br i1 %77, label %80, label %78

78:                                               ; preds = %72
  %79 = load i32, ptr %8, align 4, !tbaa !5
  store i32 %79, ptr @root, align 4, !tbaa !5
  store i32 7, ptr %9, align 4
  br label %84

80:                                               ; preds = %72
  br label %81

81:                                               ; preds = %80
  %82 = load i32, ptr %8, align 4, !tbaa !5
  %83 = add nsw i32 %82, 1
  store i32 %83, ptr %8, align 4, !tbaa !5
  br label %67, !llvm.loop !22

84:                                               ; preds = %78, %71
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  br label %85

85:                                               ; preds = %84
  %86 = load i32, ptr @root, align 4, !tbaa !5
  call void @_Z4dfs1i(i32 noundef %86)
  %87 = load i32, ptr @root, align 4, !tbaa !5
  call void @_Z4dfs2ii(i32 noundef %87, i32 noundef 0)
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  store i32 0, ptr %10, align 4, !tbaa !5
  br label %88

88:                                               ; preds = %112, %85
  %89 = load i32, ptr %10, align 4, !tbaa !5
  %90 = load i32, ptr @m, align 4, !tbaa !5
  %91 = icmp sle i32 %89, %90
  br i1 %91, label %93, label %92

92:                                               ; preds = %88
  store i32 10, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  br label %115

93:                                               ; preds = %88
  %94 = load i32, ptr @ans, align 4, !tbaa !5
  %95 = load i32, ptr @root, align 4, !tbaa !5
  %96 = sext i32 %95 to i64
  %97 = getelementptr inbounds [52 x [2001 x i32]], ptr @f, i64 0, i64 %96
  %98 = load i32, ptr %10, align 4, !tbaa !5
  %99 = sext i32 %98 to i64
  %100 = getelementptr inbounds [2001 x i32], ptr %97, i64 0, i64 %99
  %101 = load i32, ptr %100, align 4, !tbaa !5
  %102 = icmp slt i32 %94, %101
  br i1 %102, label %103, label %111

103:                                              ; preds = %93
  %104 = load i32, ptr @root, align 4, !tbaa !5
  %105 = sext i32 %104 to i64
  %106 = getelementptr inbounds [52 x [2001 x i32]], ptr @f, i64 0, i64 %105
  %107 = load i32, ptr %10, align 4, !tbaa !5
  %108 = sext i32 %107 to i64
  %109 = getelementptr inbounds [2001 x i32], ptr %106, i64 0, i64 %108
  %110 = load i32, ptr %109, align 4, !tbaa !5
  store i32 %110, ptr @ans, align 4, !tbaa !5
  br label %111

111:                                              ; preds = %103, %93
  br label %112

112:                                              ; preds = %111
  %113 = load i32, ptr %10, align 4, !tbaa !5
  %114 = add nsw i32 %113, 1
  store i32 %114, ptr %10, align 4, !tbaa !5
  br label %88, !llvm.loop !23

115:                                              ; preds = %92
  %116 = load i32, ptr @ans, align 4, !tbaa !5
  %117 = call i32 (ptr, ...) @printf(ptr noundef @.str.3, i32 noundef %116)
  ret i32 0
}

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #4

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

attributes #0 = { 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 #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { nounwind }

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

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


; 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.Edge = type { i32, i32, i32 }

@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@root = external dso_local local_unnamed_addr global i32, align 4
@c = external dso_local global [52 x i32], align 16
@s = external dso_local global [52 x i32], align 16
@w = external dso_local global [52 x i32], align 16
@f = external dso_local local_unnamed_addr global [52 x [2001 x i32]], align 16
@ans = external dso_local local_unnamed_addr global i32, align 4
@tot = external dso_local local_unnamed_addr global i32, align 4
@pre = external dso_local local_unnamed_addr global [52 x i32], align 16
@e = external dso_local local_unnamed_addr global [52 x %struct.Edge], align 16
@vis = external dso_local local_unnamed_addr global [52 x i8], align 16
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z4dfs1i(i32 noundef) local_unnamed_addr #0

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z4dfs2ii(i32 noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #2 {
  %1 = alloca i8, align 1
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n, ptr noundef nonnull @m)
  %6 = load i32, ptr @n, align 4, !tbaa !5
  %.not23 = icmp slt i32 %6, 1
  br i1 %.not23, label %.loopexit, label %.lr.ph26

.preheader:                                       ; preds = %34
  %.not1827 = icmp slt i32 %35, 1
  br i1 %.not1827, label %.loopexit, label %.lr.ph29.preheader

.lr.ph29.preheader:                               ; preds = %.preheader
  %7 = add nuw i32 %35, 1
  %wide.trip.count = zext i32 %7 to i64
  br label %.lr.ph29

.lr.ph26:                                         ; preds = %0, %34
  %indvars.iv = phi i64 [ %indvars.iv.next, %34 ], [ 1, %0 ]
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %1) #4
  %8 = getelementptr inbounds i32, ptr @w, i64 %indvars.iv
  %9 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %8, ptr noundef nonnull %1)
  %10 = load i8, ptr %1, align 1, !tbaa !9
  %11 = icmp eq i8 %10, 65
  br i1 %11, label %12, label %30

12:                                               ; preds = %.lr.ph26
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #4
  %13 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %2)
  %14 = load i32, ptr %2, align 4, !tbaa !5
  %15 = add nsw i32 %14, -1
  store i32 %15, ptr %2, align 4, !tbaa !5
  %.not2022 = icmp eq i32 %14, 0
  br i1 %.not2022, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %12
  %16 = getelementptr inbounds [52 x i32], ptr @pre, i64 0, i64 %indvars.iv
  br label %17

17:                                               ; preds = %.lr.ph, %17
  %18 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %3, ptr noundef nonnull %4)
  %19 = load i32, ptr %16, align 4, !tbaa !5
  %20 = load i32, ptr %3, align 4, !tbaa !5
  %21 = load i32, ptr %4, align 4, !tbaa !5
  %22 = load i32, ptr @tot, align 4, !tbaa !5
  %23 = add nsw i32 %22, 1
  store i32 %23, ptr @tot, align 4, !tbaa !5
  %24 = sext i32 %23 to i64
  %25 = getelementptr inbounds [52 x %struct.Edge], ptr @e, i64 0, i64 %24
  store i32 %19, ptr %25, align 4, !tbaa !5
  %.sroa.4.0..sroa_idx = getelementptr inbounds i8, ptr %25, i64 4
  store i32 %20, ptr %.sroa.4.0..sroa_idx, align 4, !tbaa !5
  %.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %25, i64 8
  store i32 %21, ptr %.sroa.5.0..sroa_idx, align 4, !tbaa !5
  store i32 %23, ptr %16, align 4, !tbaa !5
  %26 = sext i32 %20 to i64
  %27 = getelementptr inbounds [52 x i8], ptr @vis, i64 0, i64 %26
  store i8 1, ptr %27, align 1, !tbaa !10
  %28 = load i32, ptr %2, align 4, !tbaa !5
  %29 = add nsw i32 %28, -1
  store i32 %29, ptr %2, align 4, !tbaa !5
  %.not20 = icmp eq i32 %28, 0
  br i1 %.not20, label %._crit_edge, label %17, !llvm.loop !12

._crit_edge:                                      ; preds = %17, %12
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #4
  br label %34

30:                                               ; preds = %.lr.ph26
  %31 = getelementptr inbounds i32, ptr @c, i64 %indvars.iv
  %32 = getelementptr inbounds i32, ptr @s, i64 %indvars.iv
  %33 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %31, ptr noundef nonnull %32)
  br label %34

34:                                               ; preds = %30, %._crit_edge
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %1) #4
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %35 = load i32, ptr @n, align 4, !tbaa !5
  %36 = sext i32 %35 to i64
  %.not.not = icmp slt i64 %indvars.iv, %36
  br i1 %.not.not, label %.lr.ph26, label %.preheader, !llvm.loop !14

.lr.ph29:                                         ; preds = %.lr.ph29.preheader, %42
  %indvars.iv38 = phi i64 [ 1, %.lr.ph29.preheader ], [ %indvars.iv.next39, %42 ]
  %37 = getelementptr inbounds [52 x i8], ptr @vis, i64 0, i64 %indvars.iv38
  %38 = load i8, ptr %37, align 1, !tbaa !10, !range !15, !noundef !16
  %39 = trunc nuw i8 %38 to i1
  br i1 %39, label %42, label %40

40:                                               ; preds = %.lr.ph29
  %41 = trunc nuw nsw i64 %indvars.iv38 to i32
  store i32 %41, ptr @root, align 4, !tbaa !5
  br label %.loopexit

42:                                               ; preds = %.lr.ph29
  %indvars.iv.next39 = add nuw nsw i64 %indvars.iv38, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next39, %wide.trip.count
  br i1 %exitcond.not, label %.loopexit, label %.lr.ph29, !llvm.loop !17

.loopexit:                                        ; preds = %42, %0, %.preheader, %40
  %43 = load i32, ptr @root, align 4, !tbaa !5
  call void @_Z4dfs1i(i32 noundef %43)
  %44 = load i32, ptr @root, align 4, !tbaa !5
  call void @_Z4dfs2ii(i32 noundef %44, i32 noundef 0)
  %45 = load i32, ptr @m, align 4, !tbaa !5
  %.not1930 = icmp slt i32 %45, 0
  %.pre = load i32, ptr @ans, align 4, !tbaa !5
  br i1 %.not1930, label %._crit_edge34, label %.lr.ph33

.lr.ph33:                                         ; preds = %.loopexit
  %46 = load i32, ptr @root, align 4, !tbaa !5
  %47 = sext i32 %46 to i64
  %48 = add nuw i32 %45, 1
  %wide.trip.count44 = zext i32 %48 to i64
  %xtraiter = and i64 %wide.trip.count44, 1
  %49 = icmp eq i32 %45, 0
  br i1 %49, label %._crit_edge34.loopexit.unr-lcssa, label %.lr.ph33.new

.lr.ph33.new:                                     ; preds = %.lr.ph33
  %unroll_iter = and i64 %wide.trip.count44, 4294967294
  br label %56

._crit_edge34.loopexit.unr-lcssa:                 ; preds = %68, %.lr.ph33
  %.lcssa.ph = phi i32 [ poison, %.lr.ph33 ], [ %69, %68 ]
  %indvars.iv41.unr = phi i64 [ 0, %.lr.ph33 ], [ %indvars.iv.next42.1, %68 ]
  %.unr = phi i32 [ %.pre, %.lr.ph33 ], [ %69, %68 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge34, label %.epil.preheader

.epil.preheader:                                  ; preds = %._crit_edge34.loopexit.unr-lcssa
  %50 = getelementptr inbounds [52 x [2001 x i32]], ptr @f, i64 0, i64 %47, i64 %indvars.iv41.unr
  %51 = load i32, ptr %50, align 4, !tbaa !5
  %52 = icmp slt i32 %.unr, %51
  br i1 %52, label %53, label %._crit_edge34

53:                                               ; preds = %.epil.preheader
  store i32 %51, ptr @ans, align 4, !tbaa !5
  br label %._crit_edge34

._crit_edge34:                                    ; preds = %._crit_edge34.loopexit.unr-lcssa, %53, %.epil.preheader, %.loopexit
  %54 = phi i32 [ %.pre, %.loopexit ], [ %.lcssa.ph, %._crit_edge34.loopexit.unr-lcssa ], [ %.unr, %.epil.preheader ], [ %51, %53 ]
  %55 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %54)
  ret i32 0

56:                                               ; preds = %68, %.lr.ph33.new
  %indvars.iv41 = phi i64 [ 0, %.lr.ph33.new ], [ %indvars.iv.next42.1, %68 ]
  %57 = phi i32 [ %.pre, %.lr.ph33.new ], [ %69, %68 ]
  %niter = phi i64 [ 0, %.lr.ph33.new ], [ %niter.next.1, %68 ]
  %58 = getelementptr inbounds [52 x [2001 x i32]], ptr @f, i64 0, i64 %47, i64 %indvars.iv41
  %59 = load i32, ptr %58, align 4, !tbaa !5
  %60 = icmp slt i32 %57, %59
  br i1 %60, label %61, label %62

61:                                               ; preds = %56
  store i32 %59, ptr @ans, align 4, !tbaa !5
  br label %62

62:                                               ; preds = %56, %61
  %63 = phi i32 [ %57, %56 ], [ %59, %61 ]
  %indvars.iv.next42 = or disjoint i64 %indvars.iv41, 1
  %64 = getelementptr inbounds [52 x [2001 x i32]], ptr @f, i64 0, i64 %47, i64 %indvars.iv.next42
  %65 = load i32, ptr %64, align 4, !tbaa !5
  %66 = icmp slt i32 %63, %65
  br i1 %66, label %67, label %68

67:                                               ; preds = %62
  store i32 %65, ptr @ans, align 4, !tbaa !5
  br label %68

68:                                               ; preds = %67, %62
  %69 = phi i32 [ %63, %62 ], [ %65, %67 ]
  %indvars.iv.next42.1 = add nuw nsw i64 %indvars.iv41, 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 %._crit_edge34.loopexit.unr-lcssa, label %56, !llvm.loop !18
}

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

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

attributes #0 = { 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 #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { 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 #4 = { nounwind }

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

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


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