; LLVM IR from tangjz/acm-icpc :: TDL_training/2015-10-11 (G - One Friend at a Time - lzy)

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

@e = external dso_local global ptr, align 8
@lnk = external dso_local global [29 x ptr], align 16
@E = external dso_local global [10009 x %struct.Node], align 16
@f = external dso_local global [2097152 x i32], align 16
@c = external dso_local global [29 x i32], align 16
@T = external dso_local global i32, align 4
@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@k = external dso_local global i32, align 4
@u = external dso_local global i32, align 4
@v = external dso_local global i32, align 4
@ans = external dso_local global i32, align 4
@s = external dso_local global i32, align 4
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [3 x i8], align 1

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z3dpsi(i32 noundef) #1

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

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

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

9:                                                ; preds = %119, %0
  %10 = load i32, ptr %2, align 4, !tbaa !5
  %11 = load i32, ptr @T, align 4, !tbaa !5
  %12 = icmp sle i32 %10, %11
  br i1 %12, label %14, label %13

13:                                               ; preds = %9
  store i32 2, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #5
  br label %122

14:                                               ; preds = %9
  %15 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef @n, ptr noundef @m, ptr noundef @k)
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #5
  store i32 1, ptr %4, align 4, !tbaa !5
  br label %16

16:                                               ; preds = %28, %14
  %17 = load i32, ptr %4, align 4, !tbaa !5
  %18 = load i32, ptr @n, align 4, !tbaa !5
  %19 = icmp sle i32 %17, %18
  br i1 %19, label %21, label %20

20:                                               ; preds = %16
  store i32 5, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #5
  br label %31

21:                                               ; preds = %16
  %22 = load i32, ptr %4, align 4, !tbaa !5
  %23 = sext i32 %22 to i64
  %24 = getelementptr inbounds [29 x i32], ptr @c, i64 0, i64 %23
  store i32 0, ptr %24, align 4, !tbaa !5
  %25 = load i32, ptr %4, align 4, !tbaa !5
  %26 = sext i32 %25 to i64
  %27 = getelementptr inbounds [29 x ptr], ptr @lnk, i64 0, i64 %26
  store ptr null, ptr %27, align 8, !tbaa !9
  br label %28

28:                                               ; preds = %21
  %29 = load i32, ptr %4, align 4, !tbaa !5
  %30 = add nsw i32 %29, 1
  store i32 %30, ptr %4, align 4, !tbaa !5
  br label %16, !llvm.loop !11

31:                                               ; preds = %20
  store ptr @E, ptr @e, align 8, !tbaa !9
  br label %32

32:                                               ; preds = %36, %31
  %33 = load i32, ptr @m, align 4, !tbaa !5
  %34 = add nsw i32 %33, -1
  store i32 %34, ptr @m, align 4, !tbaa !5
  %35 = icmp ne i32 %33, 0
  br i1 %35, label %36, label %42

36:                                               ; preds = %32
  %37 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.2, ptr noundef @u, ptr noundef @v)
  %38 = load i32, ptr @u, align 4, !tbaa !5
  %39 = load i32, ptr @v, align 4, !tbaa !5
  call void @_Z3addii(i32 noundef %38, i32 noundef %39)
  %40 = load i32, ptr @v, align 4, !tbaa !5
  %41 = load i32, ptr @u, align 4, !tbaa !5
  call void @_Z3addii(i32 noundef %40, i32 noundef %41)
  br label %32, !llvm.loop !13

42:                                               ; preds = %32
  store i32 1, ptr @s, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #5
  %43 = load ptr, ptr getelementptr inbounds ([29 x ptr], ptr @lnk, i64 0, i64 1), align 8, !tbaa !9
  store ptr %43, ptr %5, align 8, !tbaa !9
  br label %44

44:                                               ; preds = %78, %42
  %45 = load ptr, ptr %5, align 8, !tbaa !9
  %46 = icmp ne ptr %45, null
  br i1 %46, label %48, label %47

47:                                               ; preds = %44
  store i32 10, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #5
  br label %82

48:                                               ; preds = %44
  %49 = load ptr, ptr %5, align 8, !tbaa !9
  %50 = getelementptr inbounds %struct.Node, ptr %49, i32 0, i32 0
  %51 = load i32, ptr %50, align 8, !tbaa !14
  %52 = shl i32 1, %51
  %53 = load i32, ptr @s, align 4, !tbaa !5
  %54 = or i32 %53, %52
  store i32 %54, ptr @s, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #5
  %55 = load ptr, ptr %5, align 8, !tbaa !9
  %56 = getelementptr inbounds %struct.Node, ptr %55, i32 0, i32 0
  %57 = load i32, ptr %56, align 8, !tbaa !14
  %58 = sext i32 %57 to i64
  %59 = getelementptr inbounds [29 x ptr], ptr @lnk, i64 0, i64 %58
  %60 = load ptr, ptr %59, align 8, !tbaa !9
  store ptr %60, ptr %6, align 8, !tbaa !9
  br label %61

61:                                               ; preds = %73, %48
  %62 = load ptr, ptr %6, align 8, !tbaa !9
  %63 = icmp ne ptr %62, null
  br i1 %63, label %65, label %64

64:                                               ; preds = %61
  store i32 13, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #5
  br label %77

65:                                               ; preds = %61
  %66 = load ptr, ptr %6, align 8, !tbaa !9
  %67 = getelementptr inbounds %struct.Node, ptr %66, i32 0, i32 0
  %68 = load i32, ptr %67, align 8, !tbaa !14
  %69 = sext i32 %68 to i64
  %70 = getelementptr inbounds [29 x i32], ptr @c, i64 0, i64 %69
  %71 = load i32, ptr %70, align 4, !tbaa !5
  %72 = add nsw i32 %71, 1
  store i32 %72, ptr %70, align 4, !tbaa !5
  br label %73

73:                                               ; preds = %65
  %74 = load ptr, ptr %6, align 8, !tbaa !9
  %75 = getelementptr inbounds %struct.Node, ptr %74, i32 0, i32 1
  %76 = load ptr, ptr %75, align 8, !tbaa !16
  store ptr %76, ptr %6, align 8, !tbaa !9
  br label %61, !llvm.loop !17

77:                                               ; preds = %64
  br label %78

78:                                               ; preds = %77
  %79 = load ptr, ptr %5, align 8, !tbaa !9
  %80 = getelementptr inbounds %struct.Node, ptr %79, i32 0, i32 1
  %81 = load ptr, ptr %80, align 8, !tbaa !16
  store ptr %81, ptr %5, align 8, !tbaa !9
  br label %44, !llvm.loop !18

82:                                               ; preds = %47
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  store i32 0, ptr %7, align 4, !tbaa !5
  br label %83

83:                                               ; preds = %94, %82
  %84 = load i32, ptr %7, align 4, !tbaa !5
  %85 = load i32, ptr @n, align 4, !tbaa !5
  %86 = add nsw i32 %85, 1
  %87 = shl i32 1, %86
  %88 = icmp slt i32 %84, %87
  br i1 %88, label %90, label %89

89:                                               ; preds = %83
  store i32 16, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  br label %97

90:                                               ; preds = %83
  %91 = load i32, ptr %7, align 4, !tbaa !5
  %92 = sext i32 %91 to i64
  %93 = getelementptr inbounds [2097152 x i32], ptr @f, i64 0, i64 %92
  store i32 1073741823, ptr %93, align 4, !tbaa !5
  br label %94

94:                                               ; preds = %90
  %95 = load i32, ptr %7, align 4, !tbaa !5
  %96 = add nsw i32 %95, 1
  store i32 %96, ptr %7, align 4, !tbaa !5
  br label %83, !llvm.loop !19

97:                                               ; preds = %89
  %98 = load i32, ptr @s, align 4, !tbaa !5
  %99 = sext i32 %98 to i64
  %100 = getelementptr inbounds [2097152 x i32], ptr @f, i64 0, i64 %99
  store i32 0, ptr %100, align 4, !tbaa !5
  store i32 1073741823, ptr @ans, align 4, !tbaa !5
  %101 = load i32, ptr @s, align 4, !tbaa !5
  call void @_Z3dpsi(i32 noundef %101)
  %102 = load i32, ptr %2, align 4, !tbaa !5
  %103 = call i32 (ptr, ...) @printf(ptr noundef @.str.3, i32 noundef %102)
  %104 = load i32, ptr @ans, align 4, !tbaa !5
  %105 = icmp slt i32 %104, 1073741823
  br i1 %105, label %106, label %116

106:                                              ; preds = %97
  %107 = load i32, ptr @ans, align 4, !tbaa !5
  %108 = icmp ne i32 %107, 0
  br i1 %108, label %109, label %113

109:                                              ; preds = %106
  %110 = load i32, ptr @ans, align 4, !tbaa !5
  %111 = sub nsw i32 %110, 1
  %112 = call i32 (ptr, ...) @printf(ptr noundef @.str.4, i32 noundef %111)
  br label %115

113:                                              ; preds = %106
  %114 = call i32 @puts(ptr noundef @.str.5)
  br label %115

115:                                              ; preds = %113, %109
  br label %118

116:                                              ; preds = %97
  %117 = call i32 @puts(ptr noundef @.str.6)
  br label %118

118:                                              ; preds = %116, %115
  br label %119

119:                                              ; preds = %118
  %120 = load i32, ptr %2, align 4, !tbaa !5
  %121 = add nsw i32 %120, 1
  store i32 %121, ptr %2, align 4, !tbaa !5
  br label %9, !llvm.loop !20

122:                                              ; preds = %13
  ret i32 0
}

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

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

declare i32 @puts(ptr noundef) #4

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 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 = { 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 #4 = { "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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = !{!15, !6, i64 0}
!15 = !{!"_ZTS4Node", !6, i64 0, !10, i64 8}
!16 = !{!15, !10, i64 8}
!17 = distinct !{!17, !12}
!18 = distinct !{!18, !12}
!19 = distinct !{!19, !12}
!20 = distinct !{!20, !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"

%struct.Node = type { i32, ptr }

@e = external dso_local local_unnamed_addr global ptr, align 8
@lnk = external dso_local local_unnamed_addr global [29 x ptr], align 16
@E = external dso_local global [10009 x %struct.Node], align 16
@f = external dso_local local_unnamed_addr global [2097152 x i32], align 16
@c = external dso_local local_unnamed_addr global [29 x i32], align 16
@T = external dso_local global i32, align 4
@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@k = external dso_local global i32, align 4
@u = external dso_local global i32, align 4
@v = external dso_local global i32, align 4
@ans = external dso_local local_unnamed_addr global i32, align 4
@s = external dso_local local_unnamed_addr global i32, align 4
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [3 x i8], align 1

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

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #2 {
  %1 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @T)
  %2 = load i32, ptr @T, align 4, !tbaa !5
  %.not46 = icmp slt i32 %2, 1
  br i1 %.not46, label %._crit_edge50, label %.lr.ph49

._crit_edge50:                                    ; preds = %52, %0
  ret i32 0

.lr.ph49:                                         ; preds = %0, %52
  %.01947 = phi i32 [ %53, %52 ], [ 1, %0 ]
  %3 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull @n, ptr noundef nonnull @m, ptr noundef nonnull @k)
  %4 = load i32, ptr @n, align 4, !tbaa !5
  %.not2126 = icmp slt i32 %4, 1
  br i1 %.not2126, label %._crit_edge, label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %.lr.ph49
  %5 = zext nneg i32 %4 to i64
  %6 = shl nuw nsw i64 %5, 2
  tail call void @llvm.memset.p0.i64(ptr nonnull align 4 getelementptr inbounds (i8, ptr @c, i64 4), i8 0, i64 %6, i1 false), !tbaa !5
  %7 = shl nuw nsw i64 %5, 3
  tail call void @llvm.memset.p0.i64(ptr nonnull align 8 getelementptr inbounds (i8, ptr @lnk, i64 8), i8 0, i64 %7, i1 false), !tbaa !9
  br label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph.preheader, %.lr.ph49
  store ptr @E, ptr @e, align 8, !tbaa !9
  %8 = load i32, ptr @m, align 4, !tbaa !5
  %9 = add nsw i32 %8, -1
  store i32 %9, ptr @m, align 4, !tbaa !5
  %.not2228 = icmp eq i32 %8, 0
  br i1 %.not2228, label %._crit_edge31, label %.lr.ph30

.lr.ph30:                                         ; preds = %._crit_edge, %.lr.ph30
  %10 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull @u, ptr noundef nonnull @v)
  %11 = load i32, ptr @u, align 4, !tbaa !5
  %12 = load i32, ptr @v, align 4, !tbaa !5
  tail call void @_Z3addii(i32 noundef %11, i32 noundef %12)
  %13 = load i32, ptr @v, align 4, !tbaa !5
  %14 = load i32, ptr @u, align 4, !tbaa !5
  tail call void @_Z3addii(i32 noundef %13, i32 noundef %14)
  %15 = load i32, ptr @m, align 4, !tbaa !5
  %16 = add nsw i32 %15, -1
  store i32 %16, ptr @m, align 4, !tbaa !5
  %.not22 = icmp eq i32 %15, 0
  br i1 %.not22, label %._crit_edge31, label %.lr.ph30, !llvm.loop !11

._crit_edge31:                                    ; preds = %.lr.ph30, %._crit_edge
  store i32 1, ptr @s, align 4, !tbaa !5
  %.01738 = load ptr, ptr getelementptr inbounds (i8, ptr @lnk, i64 8), align 8, !tbaa !9
  %.not2339 = icmp eq ptr %.01738, null
  br i1 %.not2339, label %.preheader, label %.lr.ph42

.preheader:                                       ; preds = %._crit_edge37, %._crit_edge31
  %17 = phi i32 [ 1, %._crit_edge31 ], [ %28, %._crit_edge37 ]
  %18 = load i32, ptr @n, align 4, !tbaa !5
  %19 = add nsw i32 %18, 1
  %.not51 = icmp eq i32 %19, 31
  br i1 %.not51, label %._crit_edge45, label %.lr.ph44.preheader

.lr.ph44.preheader:                               ; preds = %.preheader
  %20 = shl nuw i32 1, %19
  %min.iters.check = icmp slt i32 %20, 8
  br i1 %min.iters.check, label %.lr.ph44, label %vector.ph

vector.ph:                                        ; preds = %.lr.ph44.preheader
  %21 = and i32 %20, 2147483640
  %n.vec = zext nneg i32 %21 to i64
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %22 = getelementptr inbounds [2097152 x i32], ptr @f, i64 0, i64 %index
  %23 = getelementptr inbounds i8, ptr %22, i64 16
  store <4 x i32> <i32 1073741823, i32 1073741823, i32 1073741823, i32 1073741823>, ptr %22, align 16, !tbaa !5
  store <4 x i32> <i32 1073741823, i32 1073741823, i32 1073741823, i32 1073741823>, ptr %23, align 16, !tbaa !5
  %index.next = add nuw i64 %index, 8
  %24 = icmp eq i64 %index.next, %n.vec
  br i1 %24, label %._crit_edge45, label %vector.body, !llvm.loop !13

.lr.ph42:                                         ; preds = %._crit_edge31, %._crit_edge37
  %.01740 = phi ptr [ %.017, %._crit_edge37 ], [ %.01738, %._crit_edge31 ]
  %25 = phi i32 [ %28, %._crit_edge37 ], [ 1, %._crit_edge31 ]
  %26 = load i32, ptr %.01740, align 8, !tbaa !16
  %27 = shl nuw i32 1, %26
  %28 = or i32 %25, %27
  store i32 %28, ptr @s, align 4, !tbaa !5
  %29 = load i32, ptr %.01740, align 8, !tbaa !16
  %30 = sext i32 %29 to i64
  %31 = getelementptr inbounds [29 x ptr], ptr @lnk, i64 0, i64 %30
  %.01632 = load ptr, ptr %31, align 8, !tbaa !9
  %.not2533 = icmp eq ptr %.01632, null
  br i1 %.not2533, label %._crit_edge37, label %.lr.ph36

._crit_edge37:                                    ; preds = %.lr.ph36, %.lr.ph42
  %32 = getelementptr inbounds i8, ptr %.01740, i64 8
  %.017 = load ptr, ptr %32, align 8, !tbaa !9
  %.not23 = icmp eq ptr %.017, null
  br i1 %.not23, label %.preheader, label %.lr.ph42, !llvm.loop !18

.lr.ph36:                                         ; preds = %.lr.ph42, %.lr.ph36
  %.01634 = phi ptr [ %.016, %.lr.ph36 ], [ %.01632, %.lr.ph42 ]
  %33 = load i32, ptr %.01634, align 8, !tbaa !16
  %34 = sext i32 %33 to i64
  %35 = getelementptr inbounds [29 x i32], ptr @c, i64 0, i64 %34
  %36 = load i32, ptr %35, align 4, !tbaa !5
  %37 = add nsw i32 %36, 1
  store i32 %37, ptr %35, align 4, !tbaa !5
  %38 = getelementptr inbounds i8, ptr %.01634, i64 8
  %.016 = load ptr, ptr %38, align 8, !tbaa !9
  %.not25 = icmp eq ptr %.016, null
  br i1 %.not25, label %._crit_edge37, label %.lr.ph36, !llvm.loop !19

._crit_edge45:                                    ; preds = %vector.body, %.lr.ph44, %.lr.ph44.1, %.lr.ph44.2, %.lr.ph44.4, %.preheader
  %39 = sext i32 %17 to i64
  %40 = getelementptr inbounds [2097152 x i32], ptr @f, i64 0, i64 %39
  store i32 0, ptr %40, align 4, !tbaa !5
  store i32 1073741823, ptr @ans, align 4, !tbaa !5
  tail call void @_Z3dpsi(i32 noundef %17)
  %41 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %.01947)
  %42 = load i32, ptr @ans, align 4, !tbaa !5
  %43 = icmp slt i32 %42, 1073741823
  br i1 %43, label %44, label %50

.lr.ph44:                                         ; preds = %.lr.ph44.preheader
  store i32 1073741823, ptr @f, align 16, !tbaa !5
  %exitcond.not = icmp slt i32 %20, 2
  br i1 %exitcond.not, label %._crit_edge45, label %.lr.ph44.1, !llvm.loop !20

.lr.ph44.1:                                       ; preds = %.lr.ph44
  store i32 1073741823, ptr getelementptr inbounds (i8, ptr @f, i64 4), align 4, !tbaa !5
  %exitcond.not.1 = icmp eq i32 %18, 0
  br i1 %exitcond.not.1, label %._crit_edge45, label %.lr.ph44.2, !llvm.loop !20

.lr.ph44.2:                                       ; preds = %.lr.ph44.1
  store i32 1073741823, ptr getelementptr inbounds (i8, ptr @f, i64 8), align 8, !tbaa !5
  store i32 1073741823, ptr getelementptr inbounds (i8, ptr @f, i64 12), align 4, !tbaa !5
  %exitcond.not.3 = icmp eq i32 %19, 2
  br i1 %exitcond.not.3, label %._crit_edge45, label %.lr.ph44.4, !llvm.loop !20

.lr.ph44.4:                                       ; preds = %.lr.ph44.2
  store i32 1073741823, ptr getelementptr inbounds (i8, ptr @f, i64 16), align 16, !tbaa !5
  store i32 1073741823, ptr getelementptr inbounds (i8, ptr @f, i64 20), align 4, !tbaa !5
  store i32 1073741823, ptr getelementptr inbounds (i8, ptr @f, i64 24), align 8, !tbaa !5
  br label %._crit_edge45

44:                                               ; preds = %._crit_edge45
  %.not24 = icmp eq i32 %42, 0
  br i1 %.not24, label %48, label %45

45:                                               ; preds = %44
  %46 = add nsw i32 %42, -1
  %47 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef %46)
  br label %52

48:                                               ; preds = %44
  %49 = tail call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.5)
  br label %52

50:                                               ; preds = %._crit_edge45
  %51 = tail call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.6)
  br label %52

52:                                               ; preds = %50, %48, %45
  %53 = add nuw nsw i32 %.01947, 1
  %54 = load i32, ptr @T, align 4, !tbaa !5
  %.not.not = icmp slt i32 %.01947, %54
  br i1 %.not.not, label %.lr.ph49, label %._crit_edge50, !llvm.loop !21
}

; 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

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4

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 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 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 = { nocallback nofree nounwind willreturn memory(argmem: write) }

!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 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12, !14, !15}
!14 = !{!"llvm.loop.isvectorized", i32 1}
!15 = !{!"llvm.loop.unroll.runtime.disable"}
!16 = !{!17, !6, i64 0}
!17 = !{!"_ZTS4Node", !6, i64 0, !10, i64 8}
!18 = distinct !{!18, !12}
!19 = distinct !{!19, !12}
!20 = distinct !{!20, !12, !15, !14}
!21 = distinct !{!21, !12}


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