; LLVM IR from tangjz/acm-icpc :: codeforces/gym (101955J)

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

@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [14 x i8], align 1

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

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

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

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

20:                                               ; preds = %141, %18
  %21 = load i32, ptr %4, align 4, !tbaa !5
  %22 = add nsw i32 %21, -1
  store i32 %22, ptr %4, align 4, !tbaa !5
  %23 = icmp ne i32 %21, 0
  br i1 %23, label %24, label %142

24:                                               ; preds = %20
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  store i32 0, ptr %6, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 21, ptr %7) #5
  %25 = getelementptr inbounds [21 x i8], ptr %7, i64 0, i64 0
  %26 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %25)
  %27 = getelementptr inbounds [21 x i8], ptr %7, i64 0, i64 0
  %28 = call i32 @strcmp(ptr noundef %27, ptr noundef @.str.2) #6
  %29 = icmp ne i32 %28, 0
  br i1 %29, label %30, label %34

30:                                               ; preds = %24
  %31 = getelementptr inbounds [21 x i8], ptr %7, i64 0, i64 0
  %32 = call i32 @strcmp(ptr noundef %31, ptr noundef @.str.3) #6
  %33 = icmp ne i32 %32, 0
  br i1 %33, label %35, label %34

34:                                               ; preds = %30, %24
  store i32 1, ptr %6, align 4, !tbaa !5
  br label %66

35:                                               ; preds = %30
  %36 = getelementptr inbounds [21 x i8], ptr %7, i64 0, i64 0
  %37 = call i32 @strcmp(ptr noundef %36, ptr noundef @.str.4) #6
  %38 = icmp ne i32 %37, 0
  br i1 %38, label %39, label %43

39:                                               ; preds = %35
  %40 = getelementptr inbounds [21 x i8], ptr %7, i64 0, i64 0
  %41 = call i32 @strcmp(ptr noundef %40, ptr noundef @.str.5) #6
  %42 = icmp ne i32 %41, 0
  br i1 %42, label %44, label %43

43:                                               ; preds = %39, %35
  store i32 4, ptr %6, align 4, !tbaa !5
  br label %65

44:                                               ; preds = %39
  %45 = getelementptr inbounds [21 x i8], ptr %7, i64 0, i64 0
  %46 = call i32 @strcmp(ptr noundef %45, ptr noundef @.str.6) #6
  %47 = icmp ne i32 %46, 0
  br i1 %47, label %57, label %48

48:                                               ; preds = %44
  %49 = getelementptr inbounds [21 x i8], ptr %7, i64 0, i64 0
  %50 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %49)
  %51 = getelementptr inbounds [21 x i8], ptr %7, i64 0, i64 0
  %52 = call i32 @strcmp(ptr noundef %51, ptr noundef @.str.6) #6
  %53 = icmp ne i32 %52, 0
  %54 = xor i1 %53, true
  %55 = zext i1 %54 to i64
  %56 = select i1 %54, i32 8, i32 16
  store i32 %56, ptr %6, align 4, !tbaa !5
  br label %64

57:                                               ; preds = %44
  %58 = getelementptr inbounds [21 x i8], ptr %7, i64 0, i64 0
  %59 = call i32 @strcmp(ptr noundef %58, ptr noundef @.str.7) #6
  %60 = icmp ne i32 %59, 0
  %61 = xor i1 %60, true
  %62 = zext i1 %61 to i64
  %63 = select i1 %61, i32 8, i32 16
  store i32 %63, ptr %6, align 4, !tbaa !5
  br label %64

64:                                               ; preds = %57, %48
  br label %65

65:                                               ; preds = %64, %43
  br label %66

66:                                               ; preds = %65, %34
  %67 = getelementptr inbounds [21 x i8], ptr %7, i64 0, i64 0
  %68 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %67)
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  %69 = getelementptr inbounds [21 x i8], ptr %7, i64 0, i64 0
  %70 = call i64 @strlen(ptr noundef %69) #6
  %71 = trunc i64 %70 to i32
  store i32 %71, ptr %8, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  %72 = load i32, ptr %8, align 4, !tbaa !5
  %73 = sub nsw i32 %72, 1
  store i32 %73, ptr %10, align 4, !tbaa !5
  br label %74

74:                                               ; preds = %87, %66
  %75 = load i32, ptr %10, align 4, !tbaa !5
  %76 = icmp ne i32 %75, 0
  br i1 %76, label %77, label %84

77:                                               ; preds = %74
  %78 = load i32, ptr %10, align 4, !tbaa !5
  %79 = sext i32 %78 to i64
  %80 = getelementptr inbounds [21 x i8], ptr %7, i64 0, i64 %79
  %81 = load i8, ptr %80, align 1, !tbaa !9
  %82 = sext i8 %81 to i32
  %83 = icmp ne i32 %82, 93
  br label %84

84:                                               ; preds = %77, %74
  %85 = phi i1 [ false, %74 ], [ %83, %77 ]
  br i1 %85, label %86, label %90

86:                                               ; preds = %84
  br label %87

87:                                               ; preds = %86
  %88 = load i32, ptr %10, align 4, !tbaa !5
  %89 = add nsw i32 %88, -1
  store i32 %89, ptr %10, align 4, !tbaa !5
  br label %74, !llvm.loop !10

90:                                               ; preds = %84
  %91 = load i32, ptr %10, align 4, !tbaa !5
  store i32 %91, ptr %9, align 4, !tbaa !5
  br label %92

92:                                               ; preds = %105, %90
  %93 = load i32, ptr %9, align 4, !tbaa !5
  %94 = icmp ne i32 %93, 0
  br i1 %94, label %95, label %102

95:                                               ; preds = %92
  %96 = load i32, ptr %9, align 4, !tbaa !5
  %97 = sext i32 %96 to i64
  %98 = getelementptr inbounds [21 x i8], ptr %7, i64 0, i64 %97
  %99 = load i8, ptr %98, align 1, !tbaa !9
  %100 = sext i8 %99 to i32
  %101 = icmp ne i32 %100, 91
  br label %102

102:                                              ; preds = %95, %92
  %103 = phi i1 [ false, %92 ], [ %101, %95 ]
  br i1 %103, label %104, label %108

104:                                              ; preds = %102
  br label %105

105:                                              ; preds = %104
  %106 = load i32, ptr %9, align 4, !tbaa !5
  %107 = add nsw i32 %106, -1
  store i32 %107, ptr %9, align 4, !tbaa !5
  br label %92, !llvm.loop !12

108:                                              ; preds = %102
  %109 = load i32, ptr %9, align 4, !tbaa !5
  %110 = sext i32 %109 to i64
  %111 = getelementptr inbounds [21 x i8], ptr %7, i64 0, i64 %110
  %112 = load i8, ptr %111, align 1, !tbaa !9
  %113 = sext i8 %112 to i32
  %114 = icmp eq i32 %113, 91
  br i1 %114, label %115, label %137

115:                                              ; preds = %108
  %116 = load i32, ptr %10, align 4, !tbaa !5
  %117 = sext i32 %116 to i64
  %118 = getelementptr inbounds [21 x i8], ptr %7, i64 0, i64 %117
  %119 = load i8, ptr %118, align 1, !tbaa !9
  %120 = sext i8 %119 to i32
  %121 = icmp eq i32 %120, 93
  br i1 %121, label %122, label %137

122:                                              ; preds = %115
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  %123 = load i32, ptr %10, align 4, !tbaa !5
  %124 = sext i32 %123 to i64
  %125 = getelementptr inbounds [21 x i8], ptr %7, i64 0, i64 %124
  store i8 0, ptr %125, align 1, !tbaa !9
  %126 = getelementptr inbounds [21 x i8], ptr %7, i64 0, i64 0
  %127 = load i32, ptr %9, align 4, !tbaa !5
  %128 = sext i32 %127 to i64
  %129 = getelementptr inbounds i8, ptr %126, i64 %128
  %130 = getelementptr inbounds i8, ptr %129, i64 1
  %131 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef %130, ptr noundef @.str, ptr noundef %11) #5
  %132 = load i32, ptr %11, align 4, !tbaa !5
  %133 = load i32, ptr %6, align 4, !tbaa !5
  %134 = mul nsw i32 %132, %133
  %135 = load i32, ptr %5, align 4, !tbaa !5
  %136 = add nsw i32 %135, %134
  store i32 %136, ptr %5, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  br label %141

137:                                              ; preds = %115, %108
  %138 = load i32, ptr %6, align 4, !tbaa !5
  %139 = load i32, ptr %5, align 4, !tbaa !5
  %140 = add nsw i32 %139, %138
  store i32 %140, ptr %5, align 4, !tbaa !5
  br label %141

141:                                              ; preds = %137, %122
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 21, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  br label %20, !llvm.loop !13

142:                                              ; preds = %20
  %143 = load i32, ptr %3, align 4, !tbaa !5
  %144 = load i32, ptr %5, align 4, !tbaa !5
  %145 = sub nsw i32 %144, 1
  %146 = sdiv i32 %145, 1024
  %147 = add nsw i32 %146, 1
  %148 = call i32 (ptr, ...) @printf(ptr noundef @.str.8, i32 noundef %143, i32 noundef %147)
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #5
  br label %149

149:                                              ; preds = %142
  %150 = load i32, ptr %3, align 4, !tbaa !5
  %151 = add nsw i32 %150, 1
  store i32 %151, ptr %3, align 4, !tbaa !5
  br label %13, !llvm.loop !14

152:                                              ; preds = %17
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #5
  ret i32 0
}

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

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

; Function Attrs: nounwind willreturn memory(read)
declare i32 @strcmp(ptr noundef, ptr noundef) #3

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

; Function Attrs: nounwind
declare i32 @__isoc99_sscanf(ptr noundef, ptr noundef, ...) #4

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

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

attributes #0 = { mustprogress norecurse uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "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 = { 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 #4 = { 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 #5 = { nounwind }
attributes #6 = { 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 = !{!7, !7, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
!12 = distinct !{!12, !11}
!13 = distinct !{!13, !11}
!14 = distinct !{!14, !11}


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

@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [14 x i8], align 1

; Function Attrs: mustprogress nofree norecurse nounwind uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca [21 x i8], align 16
  %4 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #4
  %5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %1)
  %6 = load i32, ptr %1, align 4, !tbaa !5
  %.not46 = icmp slt i32 %6, 1
  br i1 %.not46, label %._crit_edge50, label %.lr.ph49

.lr.ph49:                                         ; preds = %0
  %invariant.gep = getelementptr inbounds i8, ptr %3, i64 1
  br label %7

._crit_edge50:                                    ; preds = %._crit_edge, %0
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #4
  ret i32 0

7:                                                ; preds = %.lr.ph49, %._crit_edge
  %.02347 = phi i32 [ 1, %.lr.ph49 ], [ %58, %._crit_edge ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #4
  %8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %2)
  %9 = load i32, ptr %2, align 4, !tbaa !5
  %10 = add nsw i32 %9, -1
  store i32 %10, ptr %2, align 4, !tbaa !5
  %.not2642 = icmp eq i32 %9, 0
  br i1 %.not2642, label %._crit_edge, label %.lr.ph44

.lr.ph44:                                         ; preds = %7, %51
  %.02543 = phi i32 [ %.1, %51 ], [ 0, %7 ]
  call void @llvm.lifetime.start.p0(i64 21, ptr nonnull %3) #4
  %11 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %3)
  %12 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %3, ptr noundef nonnull dereferenceable(1) @.str.2) #5
  %.not27 = icmp eq i32 %12, 0
  br i1 %.not27, label %25, label %13

13:                                               ; preds = %.lr.ph44
  %14 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %3, ptr noundef nonnull dereferenceable(1) @.str.3) #5
  %.not28 = icmp eq i32 %14, 0
  br i1 %.not28, label %25, label %15

15:                                               ; preds = %13
  %16 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %3, ptr noundef nonnull dereferenceable(1) @.str.4) #5
  %.not29 = icmp eq i32 %16, 0
  br i1 %.not29, label %25, label %17

17:                                               ; preds = %15
  %18 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %3, ptr noundef nonnull dereferenceable(1) @.str.5) #5
  %.not30 = icmp eq i32 %18, 0
  br i1 %.not30, label %25, label %19

19:                                               ; preds = %17
  %20 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %3, ptr noundef nonnull dereferenceable(1) @.str.6) #5
  %.not31 = icmp eq i32 %20, 0
  br i1 %.not31, label %21, label %.sink.split

21:                                               ; preds = %19
  %22 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %3)
  br label %.sink.split

.sink.split:                                      ; preds = %19, %21
  %.str.7.sink = phi ptr [ @.str.6, %21 ], [ @.str.7, %19 ]
  %23 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %3, ptr noundef nonnull dereferenceable(1) %.str.7.sink) #5
  %.not33 = icmp eq i32 %23, 0
  %24 = select i1 %.not33, i32 8, i32 16
  br label %25

25:                                               ; preds = %.sink.split, %15, %17, %.lr.ph44, %13
  %.024 = phi i32 [ 1, %13 ], [ 1, %.lr.ph44 ], [ 4, %17 ], [ 4, %15 ], [ %24, %.sink.split ]
  %26 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %3)
  %27 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %3) #5
  %sext = shl i64 %27, 32
  %28 = ashr exact i64 %sext, 32
  br label %29

29:                                               ; preds = %31, %25
  %indvars.iv = phi i64 [ %indvars.iv.next, %31 ], [ %28, %25 ]
  %indvars.iv.next = add nsw i64 %indvars.iv, -1
  %30 = icmp eq i64 %indvars.iv.next, 0
  br i1 %30, label %.critedge2, label %31

31:                                               ; preds = %29
  %32 = getelementptr inbounds [21 x i8], ptr %3, i64 0, i64 %indvars.iv.next
  %33 = load i8, ptr %32, align 1, !tbaa !9
  %.not35 = icmp eq i8 %33, 93
  br i1 %.not35, label %.lr.ph.preheader, label %29, !llvm.loop !10

.lr.ph.preheader:                                 ; preds = %31
  %sext60 = shl i64 %indvars.iv.next, 32
  %34 = ashr exact i64 %sext60, 32
  br label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph.preheader, %37
  %indvars.iv52 = phi i64 [ %34, %.lr.ph.preheader ], [ %indvars.iv.next53, %37 ]
  %35 = getelementptr inbounds [21 x i8], ptr %3, i64 0, i64 %indvars.iv52
  %36 = load i8, ptr %35, align 1, !tbaa !9
  %.not37 = icmp eq i8 %36, 91
  br i1 %.not37, label %.critedge2, label %37

37:                                               ; preds = %.lr.ph
  %indvars.iv.next53 = add nsw i64 %indvars.iv52, -1
  %.not36 = icmp eq i64 %indvars.iv.next53, 0
  br i1 %.not36, label %.critedge2, label %.lr.ph, !llvm.loop !12

.critedge2:                                       ; preds = %29, %.lr.ph, %37
  %.0.lcssa58 = phi i64 [ %indvars.iv.next, %37 ], [ %indvars.iv.next, %.lr.ph ], [ 0, %29 ]
  %.022.lcssa = phi i64 [ %indvars.iv52, %.lr.ph ], [ 0, %37 ], [ 0, %29 ]
  %sext55 = shl i64 %.022.lcssa, 32
  %38 = ashr exact i64 %sext55, 32
  %39 = getelementptr inbounds [21 x i8], ptr %3, i64 0, i64 %38
  %40 = load i8, ptr %39, align 1, !tbaa !9
  %41 = icmp eq i8 %40, 91
  br i1 %41, label %42, label %51

42:                                               ; preds = %.critedge2
  %sext61 = shl i64 %.0.lcssa58, 32
  %43 = ashr exact i64 %sext61, 32
  %44 = getelementptr inbounds [21 x i8], ptr %3, i64 0, i64 %43
  %45 = load i8, ptr %44, align 1, !tbaa !9
  %46 = icmp eq i8 %45, 93
  br i1 %46, label %47, label %51

47:                                               ; preds = %42
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #4
  store i8 0, ptr %44, align 1, !tbaa !9
  %gep = getelementptr i8, ptr %invariant.gep, i64 %38
  %48 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef nonnull %gep, ptr noundef nonnull @.str, ptr noundef nonnull %4) #4
  %49 = load i32, ptr %4, align 4, !tbaa !5
  %50 = mul nsw i32 %49, %.024
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #4
  br label %51

51:                                               ; preds = %.critedge2, %42, %47
  %.pn = phi i32 [ %50, %47 ], [ %.024, %42 ], [ %.024, %.critedge2 ]
  %.1 = add nsw i32 %.pn, %.02543
  call void @llvm.lifetime.end.p0(i64 21, ptr nonnull %3) #4
  %52 = load i32, ptr %2, align 4, !tbaa !5
  %53 = add nsw i32 %52, -1
  store i32 %53, ptr %2, align 4, !tbaa !5
  %.not26 = icmp eq i32 %52, 0
  br i1 %.not26, label %._crit_edge, label %.lr.ph44, !llvm.loop !13

._crit_edge:                                      ; preds = %51, %7
  %.025.lcssa = phi i32 [ 0, %7 ], [ %.1, %51 ]
  %54 = add nsw i32 %.025.lcssa, -1
  %55 = sdiv i32 %54, 1024
  %56 = add nsw i32 %55, 1
  %57 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.8, i32 noundef %.02347, i32 noundef %56)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #4
  %58 = add nuw nsw i32 %.02347, 1
  %59 = load i32, ptr %1, align 4, !tbaa !5
  %.not.not = icmp slt i32 %.02347, %59
  br i1 %.not.not, label %7, label %._crit_edge50, !llvm.loop !14
}

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

; 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 i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #3

; 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 @__isoc99_sscanf(ptr nocapture noundef readonly, ptr nocapture noundef readonly, ...) local_unnamed_addr #2

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

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

attributes #0 = { mustprogress nofree 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 #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { nounwind }
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 = !{!7, !7, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
!12 = distinct !{!12, !11}
!13 = distinct !{!13, !11}
!14 = distinct !{!14, !11}


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