; LLVM IR from tangjz/acm-icpc :: codeforces/complete (305E)

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

@n = external dso_local global i32, align 4
@sg = external dso_local global [5002 x i32], align 16
@str = external dso_local global [5002 x i8], align 16
@flag = external dso_local global [5002 x i8], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [7 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z2SGPbi(ptr noundef, 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 norecurse uwtable
define dso_local noundef i32 @main() #2 {
  %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
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %10 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef getelementptr inbounds (i8, ptr @str, i64 1))
  %11 = call i64 @strlen(ptr noundef getelementptr inbounds (i8, ptr @str, i64 1)) #5
  %12 = trunc i64 %11 to i32
  store i32 %12, ptr @n, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #6
  store i32 3, ptr %2, align 4, !tbaa !5
  br label %13

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

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

18:                                               ; preds = %13
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #6
  store i32 0, ptr %4, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #6
  store i32 0, ptr %5, align 4, !tbaa !5
  br label %19

19:                                               ; preds = %28, %18
  %20 = load i32, ptr %5, align 4, !tbaa !5
  %21 = load i32, ptr %2, align 4, !tbaa !5
  %22 = icmp sle i32 %20, %21
  br i1 %22, label %24, label %23

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

24:                                               ; preds = %19
  %25 = load i32, ptr %5, align 4, !tbaa !5
  %26 = sext i32 %25 to i64
  %27 = getelementptr inbounds [5002 x i8], ptr @flag, i64 0, i64 %26
  store i8 0, ptr %27, align 1, !tbaa !9
  br label %28

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

31:                                               ; preds = %23
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  store i32 2, ptr %6, align 4, !tbaa !5
  br label %32

32:                                               ; preds = %63, %31
  %33 = load i32, ptr %6, align 4, !tbaa !5
  %34 = load i32, ptr %2, align 4, !tbaa !5
  %35 = icmp slt i32 %33, %34
  br i1 %35, label %37, label %36

36:                                               ; preds = %32
  store i32 8, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  br label %66

37:                                               ; preds = %32
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  %38 = load i32, ptr %6, align 4, !tbaa !5
  %39 = sub nsw i32 %38, 1
  %40 = sext i32 %39 to i64
  %41 = getelementptr inbounds [5002 x i32], ptr @sg, i64 0, i64 %40
  %42 = load i32, ptr %41, align 4, !tbaa !5
  %43 = load i32, ptr %2, align 4, !tbaa !5
  %44 = load i32, ptr %6, align 4, !tbaa !5
  %45 = sub nsw i32 %43, %44
  %46 = sext i32 %45 to i64
  %47 = getelementptr inbounds [5002 x i32], ptr @sg, i64 0, i64 %46
  %48 = load i32, ptr %47, align 4, !tbaa !5
  %49 = xor i32 %42, %48
  store i32 %49, ptr %7, align 4, !tbaa !5
  %50 = load i32, ptr %7, align 4, !tbaa !5
  %51 = sext i32 %50 to i64
  %52 = getelementptr inbounds [5002 x i8], ptr @flag, i64 0, i64 %51
  store i8 1, ptr %52, align 1, !tbaa !9
  br label %53

53:                                               ; preds = %59, %37
  %54 = load i32, ptr %4, align 4, !tbaa !5
  %55 = sext i32 %54 to i64
  %56 = getelementptr inbounds [5002 x i8], ptr @flag, i64 0, i64 %55
  %57 = load i8, ptr %56, align 1, !tbaa !9, !range !13, !noundef !14
  %58 = trunc i8 %57 to i1
  br i1 %58, label %59, label %62

59:                                               ; preds = %53
  %60 = load i32, ptr %4, align 4, !tbaa !5
  %61 = add nsw i32 %60, 1
  store i32 %61, ptr %4, align 4, !tbaa !5
  br label %53, !llvm.loop !15

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

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

66:                                               ; preds = %36
  %67 = load i32, ptr %4, align 4, !tbaa !5
  %68 = load i32, ptr %2, align 4, !tbaa !5
  %69 = sext i32 %68 to i64
  %70 = getelementptr inbounds [5002 x i32], ptr @sg, i64 0, i64 %69
  store i32 %67, ptr %70, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  br label %71

71:                                               ; preds = %66
  %72 = load i32, ptr %2, align 4, !tbaa !5
  %73 = add nsw i32 %72, 1
  store i32 %73, ptr %2, align 4, !tbaa !5
  br label %13, !llvm.loop !17

74:                                               ; preds = %17
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  store i32 0, ptr %8, align 4, !tbaa !5
  br label %75

75:                                               ; preds = %107, %74
  %76 = load i32, ptr %8, align 4, !tbaa !5
  %77 = load i32, ptr @n, align 4, !tbaa !5
  %78 = icmp sle i32 %76, %77
  br i1 %78, label %80, label %79

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

80:                                               ; preds = %75
  %81 = load i32, ptr %8, align 4, !tbaa !5
  %82 = icmp sgt i32 %81, 1
  br i1 %82, label %83, label %101

83:                                               ; preds = %80
  %84 = load i32, ptr %8, align 4, !tbaa !5
  %85 = load i32, ptr @n, align 4, !tbaa !5
  %86 = icmp slt i32 %84, %85
  br i1 %86, label %87, label %101

87:                                               ; preds = %83
  %88 = load i32, ptr %8, align 4, !tbaa !5
  %89 = sub nsw i32 %88, 1
  %90 = sext i32 %89 to i64
  %91 = getelementptr inbounds [5002 x i8], ptr @str, i64 0, i64 %90
  %92 = load i8, ptr %91, align 1, !tbaa !18
  %93 = sext i8 %92 to i32
  %94 = load i32, ptr %8, align 4, !tbaa !5
  %95 = add nsw i32 %94, 1
  %96 = sext i32 %95 to i64
  %97 = getelementptr inbounds [5002 x i8], ptr @str, i64 0, i64 %96
  %98 = load i8, ptr %97, align 1, !tbaa !18
  %99 = sext i8 %98 to i32
  %100 = icmp eq i32 %93, %99
  br label %101

101:                                              ; preds = %87, %83, %80
  %102 = phi i1 [ false, %83 ], [ false, %80 ], [ %100, %87 ]
  %103 = load i32, ptr %8, align 4, !tbaa !5
  %104 = sext i32 %103 to i64
  %105 = getelementptr inbounds [5002 x i8], ptr @flag, i64 0, i64 %104
  %106 = zext i1 %102 to i8
  store i8 %106, ptr %105, align 1, !tbaa !9
  br label %107

107:                                              ; preds = %101
  %108 = load i32, ptr %8, align 4, !tbaa !5
  %109 = add nsw i32 %108, 1
  store i32 %109, ptr %8, align 4, !tbaa !5
  br label %75, !llvm.loop !19

110:                                              ; preds = %79
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  store i32 2, ptr %9, align 4, !tbaa !5
  br label %111

111:                                              ; preds = %138, %110
  %112 = load i32, ptr %9, align 4, !tbaa !5
  %113 = load i32, ptr @n, align 4, !tbaa !5
  %114 = icmp slt i32 %112, %113
  br i1 %114, label %116, label %115

115:                                              ; preds = %111
  store i32 16, ptr %3, align 4
  br label %141

116:                                              ; preds = %111
  %117 = load i32, ptr %9, align 4, !tbaa !5
  %118 = sext i32 %117 to i64
  %119 = getelementptr inbounds [5002 x i8], ptr @flag, i64 0, i64 %118
  %120 = load i8, ptr %119, align 1, !tbaa !9, !range !13, !noundef !14
  %121 = trunc i8 %120 to i1
  br i1 %121, label %122, label %137

122:                                              ; preds = %116
  %123 = load i32, ptr %9, align 4, !tbaa !5
  %124 = sub nsw i32 %123, 1
  %125 = call noundef i32 @_Z2SGPbi(ptr noundef @flag, i32 noundef %124)
  %126 = load i32, ptr %9, align 4, !tbaa !5
  %127 = sext i32 %126 to i64
  %128 = getelementptr inbounds i8, ptr @flag, i64 %127
  %129 = load i32, ptr @n, align 4, !tbaa !5
  %130 = load i32, ptr %9, align 4, !tbaa !5
  %131 = sub nsw i32 %129, %130
  %132 = call noundef i32 @_Z2SGPbi(ptr noundef %128, i32 noundef %131)
  %133 = icmp eq i32 %125, %132
  br i1 %133, label %134, label %137

134:                                              ; preds = %122
  %135 = load i32, ptr %9, align 4, !tbaa !5
  %136 = call i32 (ptr, ...) @printf(ptr noundef @.str.1, i32 noundef %135)
  store i32 0, ptr %1, align 4
  store i32 1, ptr %3, align 4
  br label %141

137:                                              ; preds = %122, %116
  br label %138

138:                                              ; preds = %137
  %139 = load i32, ptr %9, align 4, !tbaa !5
  %140 = add nsw i32 %139, 1
  store i32 %140, ptr %9, align 4, !tbaa !5
  br label %111, !llvm.loop !20

141:                                              ; preds = %134, %115
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  %142 = load i32, ptr %3, align 4
  switch i32 %142, label %147 [
    i32 16, label %143
    i32 1, label %145
  ]

143:                                              ; preds = %141
  %144 = call i32 @puts(ptr noundef @.str.2)
  store i32 0, ptr %1, align 4
  br label %145

145:                                              ; preds = %143, %141
  %146 = load i32, ptr %1, align 4
  ret i32 %146

147:                                              ; preds = %141
  unreachable
}

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

; Function Attrs: nounwind willreturn memory(read)
declare i64 @strlen(ptr noundef) #4

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

declare i32 @puts(ptr noundef) #3

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 = { 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 = { nounwind willreturn memory(read) "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 willreturn memory(read) }
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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"bool", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{i8 0, i8 2}
!14 = !{}
!15 = distinct !{!15, !12}
!16 = distinct !{!16, !12}
!17 = distinct !{!17, !12}
!18 = !{!7, !7, i64 0}
!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"

@n = external dso_local local_unnamed_addr global i32, align 4
@sg = external dso_local local_unnamed_addr global [5002 x i32], align 16
@str = external dso_local global [5002 x i8], align 16
@flag = external dso_local global [5002 x i8], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [7 x i8], align 1

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

; Function Attrs: mustprogress norecurse nounwind uwtable
define dso_local noundef i32 @main() local_unnamed_addr #1 {
  %1 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds (i8, ptr @str, i64 1))
  %2 = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) getelementptr inbounds (i8, ptr @str, i64 1)) #5
  %3 = trunc i64 %2 to i32
  store i32 %3, ptr @n, align 4, !tbaa !5
  %.not54 = icmp slt i32 %3, 3
  br i1 %.not54, label %.preheader47, label %.preheader49.preheader

.preheader49.preheader:                           ; preds = %0
  %4 = add i64 %2, 4294967294
  %wide.trip.count71 = and i64 %4, 4294967295
  br label %.lr.ph.preheader

.preheader47:                                     ; preds = %._crit_edge, %0
  %.not4256 = icmp slt i32 %3, 0
  br i1 %.not4256, label %._crit_edge61, label %5

5:                                                ; preds = %.preheader47
  %6 = and i64 %2, 2147483647
  %7 = add nuw nsw i64 %2, 1
  %wide.trip.count = and i64 %7, 4294967295
  store i8 0, ptr @flag, align 16, !tbaa !9
  %exitcond76.peel.not = icmp eq i64 %wide.trip.count, 1
  br i1 %exitcond76.peel.not, label %.preheader, label %.lr.ph58.peel.next

.lr.ph58.peel.next:                               ; preds = %5
  store i8 0, ptr getelementptr inbounds (i8, ptr @flag, i64 1), align 1, !tbaa !9
  %exitcond76.peel81.not = icmp eq i64 %wide.trip.count, 2
  br i1 %exitcond76.peel81.not, label %.preheader, label %.lr.ph58

.lr.ph.preheader:                                 ; preds = %._crit_edge, %.preheader49.preheader
  %indvars.iv68 = phi i64 [ 3, %.preheader49.preheader ], [ %indvars.iv.next69, %._crit_edge ]
  %indvar = phi i64 [ 0, %.preheader49.preheader ], [ %indvar.next, %._crit_edge ]
  %8 = add nuw nsw i64 %indvar, 4
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(1) @flag, i8 0, i64 %8, i1 false), !tbaa !9
  br label %.lr.ph

._crit_edge:                                      ; preds = %25
  %9 = trunc nsw i64 %indvars.iv to i32
  %10 = getelementptr inbounds [5002 x i32], ptr @sg, i64 0, i64 %indvars.iv68
  store i32 %9, ptr %10, align 4, !tbaa !5
  %indvars.iv.next69 = add nuw nsw i64 %indvars.iv68, 1
  %indvar.next = add nuw nsw i64 %indvar, 1
  %exitcond72.not = icmp eq i64 %indvar.next, %wide.trip.count71
  br i1 %exitcond72.not, label %.preheader47, label %.lr.ph.preheader, !llvm.loop !11

.lr.ph:                                           ; preds = %.lr.ph.preheader, %25
  %indvars.iv65 = phi i64 [ 2, %.lr.ph.preheader ], [ %indvars.iv.next66, %25 ]
  %.03752 = phi i64 [ 0, %.lr.ph.preheader ], [ %indvars.iv, %25 ]
  %11 = add nsw i64 %indvars.iv65, -1
  %12 = getelementptr inbounds [5002 x i32], ptr @sg, i64 0, i64 %11
  %13 = load i32, ptr %12, align 4, !tbaa !5
  %14 = sub nsw i64 %indvars.iv68, %indvars.iv65
  %15 = getelementptr inbounds [5002 x i32], ptr @sg, i64 0, i64 %14
  %16 = load i32, ptr %15, align 4, !tbaa !5
  %17 = xor i32 %16, %13
  %18 = sext i32 %17 to i64
  %19 = getelementptr inbounds [5002 x i8], ptr @flag, i64 0, i64 %18
  store i8 1, ptr %19, align 1, !tbaa !9
  %sext = shl i64 %.03752, 32
  %20 = ashr exact i64 %sext, 32
  br label %21

21:                                               ; preds = %21, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %21 ], [ %20, %.lr.ph ]
  %22 = getelementptr inbounds [5002 x i8], ptr @flag, i64 0, i64 %indvars.iv
  %23 = load i8, ptr %22, align 1, !tbaa !9, !range !13, !noundef !14
  %24 = trunc nuw i8 %23 to i1
  %indvars.iv.next = add nsw i64 %indvars.iv, 1
  br i1 %24, label %21, label %25, !llvm.loop !15

25:                                               ; preds = %21
  %indvars.iv.next66 = add nuw nsw i64 %indvars.iv65, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next66, %indvars.iv68
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph, !llvm.loop !16

.preheader:                                       ; preds = %36, %5, %.lr.ph58.peel.next
  %26 = icmp sgt i32 %3, 2
  br i1 %26, label %.lr.ph60, label %._crit_edge61

.lr.ph58:                                         ; preds = %.lr.ph58.peel.next, %36
  %indvars.iv73 = phi i64 [ %indvars.iv.next74.pre-phi, %36 ], [ 2, %.lr.ph58.peel.next ]
  %27 = icmp slt i64 %indvars.iv73, %6
  br i1 %27, label %28, label %.lr.ph58._crit_edge

.lr.ph58._crit_edge:                              ; preds = %.lr.ph58
  %.pre87 = add nuw nsw i64 %indvars.iv73, 1
  br label %36

28:                                               ; preds = %.lr.ph58
  %29 = add nsw i64 %indvars.iv73, -1
  %30 = getelementptr inbounds [5002 x i8], ptr @str, i64 0, i64 %29
  %31 = load i8, ptr %30, align 1, !tbaa !17
  %32 = add nuw nsw i64 %indvars.iv73, 1
  %33 = getelementptr inbounds [5002 x i8], ptr @str, i64 0, i64 %32
  %34 = load i8, ptr %33, align 1, !tbaa !17
  %35 = icmp eq i8 %31, %34
  br label %36

36:                                               ; preds = %.lr.ph58._crit_edge, %28
  %indvars.iv.next74.pre-phi = phi i64 [ %.pre87, %.lr.ph58._crit_edge ], [ %32, %28 ]
  %37 = phi i1 [ false, %.lr.ph58._crit_edge ], [ %35, %28 ]
  %38 = getelementptr inbounds [5002 x i8], ptr @flag, i64 0, i64 %indvars.iv73
  %39 = zext i1 %37 to i8
  store i8 %39, ptr %38, align 1, !tbaa !9
  %exitcond76.not = icmp eq i64 %indvars.iv.next74.pre-phi, %wide.trip.count
  br i1 %exitcond76.not, label %.preheader, label %.lr.ph58, !llvm.loop !18

.lr.ph60:                                         ; preds = %.preheader, %53
  %40 = phi i32 [ %54, %53 ], [ %3, %.preheader ]
  %indvars.iv83 = phi i64 [ %indvars.iv.next84, %53 ], [ 2, %.preheader ]
  %41 = getelementptr inbounds [5002 x i8], ptr @flag, i64 0, i64 %indvars.iv83
  %42 = load i8, ptr %41, align 1, !tbaa !9, !range !13, !noundef !14
  %43 = trunc nuw i8 %42 to i1
  br i1 %43, label %44, label %53

44:                                               ; preds = %.lr.ph60
  %45 = trunc i64 %indvars.iv83 to i32
  %46 = add i32 %45, -1
  %47 = tail call noundef i32 @_Z2SGPbi(ptr noundef nonnull @flag, i32 noundef %46)
  %48 = load i32, ptr @n, align 4, !tbaa !5
  %49 = trunc nuw nsw i64 %indvars.iv83 to i32
  %50 = sub nsw i32 %48, %49
  %51 = tail call noundef i32 @_Z2SGPbi(ptr noundef nonnull %41, i32 noundef %50)
  %52 = icmp eq i32 %47, %51
  br i1 %52, label %57, label %._crit_edge86

._crit_edge86:                                    ; preds = %44
  %.pre = load i32, ptr @n, align 4, !tbaa !5
  br label %53

53:                                               ; preds = %._crit_edge86, %.lr.ph60
  %54 = phi i32 [ %.pre, %._crit_edge86 ], [ %40, %.lr.ph60 ]
  %indvars.iv.next84 = add nuw nsw i64 %indvars.iv83, 1
  %55 = sext i32 %54 to i64
  %56 = icmp slt i64 %indvars.iv.next84, %55
  br i1 %56, label %.lr.ph60, label %._crit_edge61, !llvm.loop !20

57:                                               ; preds = %44
  %58 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %49)
  br label %60

._crit_edge61:                                    ; preds = %53, %.preheader47, %.preheader
  %59 = tail call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.2)
  br label %60

60:                                               ; preds = %57, %._crit_edge61
  ret i32 0
}

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

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #3

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

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

; 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 norecurse nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { 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 #3 = { mustprogress nofree nounwind willreturn memory(argmem: read) "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) }
attributes #5 = { nounwind willreturn memory(read) }

!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 = !{!"bool", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{i8 0, i8 2}
!14 = !{}
!15 = distinct !{!15, !12}
!16 = distinct !{!16, !12}
!17 = !{!7, !7, i64 0}
!18 = distinct !{!18, !12, !19}
!19 = !{!"llvm.loop.peeled.count", i32 2}
!20 = distinct !{!20, !12}


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