; LLVM IR from tangjz/acm-icpc :: 51nod (1385)

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

@len = external dso_local global i32, align 4
@ans = external dso_local global i32, align 4
@str = external dso_local global [10001 x i8], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [4 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
  store i32 0, ptr %1, align 4
  %4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @str)
  %5 = call i64 @strlen(ptr noundef @str) #4
  %6 = trunc i64 %5 to i32
  store i32 %6, ptr @len, align 4, !tbaa !5
  %7 = load i32, ptr @len, align 4, !tbaa !5
  %8 = sub nsw i32 %7, 1
  %9 = mul nsw i32 10, %8
  store i32 %9, ptr @ans, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #5
  store i32 1, ptr %2, align 4, !tbaa !5
  br label %10

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

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

14:                                               ; preds = %10
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #5
  store i32 0, ptr %3, align 4, !tbaa !5
  br label %15

15:                                               ; preds = %30, %14
  %16 = load i32, ptr %3, align 4, !tbaa !5
  %17 = load i32, ptr @len, align 4, !tbaa !5
  %18 = icmp slt i32 %16, %17
  br i1 %18, label %19, label %33

19:                                               ; preds = %15
  %20 = load i32, ptr %3, align 4, !tbaa !5
  %21 = sext i32 %20 to i64
  %22 = getelementptr inbounds [10001 x i8], ptr @str, i64 0, i64 %21
  %23 = load i8, ptr %22, align 1, !tbaa !9
  %24 = sext i8 %23 to i32
  %25 = load i32, ptr %2, align 4, !tbaa !5
  %26 = add nsw i32 48, %25
  %27 = icmp ne i32 %24, %26
  br i1 %27, label %28, label %29

28:                                               ; preds = %19
  br label %33

29:                                               ; preds = %19
  br label %30

30:                                               ; preds = %29
  %31 = load i32, ptr %3, align 4, !tbaa !5
  %32 = add nsw i32 %31, 1
  store i32 %32, ptr %3, align 4, !tbaa !5
  br label %15, !llvm.loop !10

33:                                               ; preds = %28, %15
  %34 = load i32, ptr %3, align 4, !tbaa !5
  %35 = load i32, ptr @len, align 4, !tbaa !5
  %36 = icmp eq i32 %34, %35
  br i1 %36, label %46, label %37

37:                                               ; preds = %33
  %38 = load i32, ptr %3, align 4, !tbaa !5
  %39 = sext i32 %38 to i64
  %40 = getelementptr inbounds [10001 x i8], ptr @str, i64 0, i64 %39
  %41 = load i8, ptr %40, align 1, !tbaa !9
  %42 = sext i8 %41 to i32
  %43 = load i32, ptr %2, align 4, !tbaa !5
  %44 = add nsw i32 48, %43
  %45 = icmp sgt i32 %42, %44
  br i1 %45, label %46, label %49

46:                                               ; preds = %37, %33
  %47 = load i32, ptr @ans, align 4, !tbaa !5
  %48 = add nsw i32 %47, 1
  store i32 %48, ptr @ans, align 4, !tbaa !5
  br label %49

49:                                               ; preds = %46, %37
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #5
  br label %50

50:                                               ; preds = %49
  %51 = load i32, ptr %2, align 4, !tbaa !5
  %52 = add nsw i32 %51, 1
  store i32 %52, ptr %2, align 4, !tbaa !5
  br label %10, !llvm.loop !12

53:                                               ; preds = %13
  %54 = load i32, ptr @ans, align 4, !tbaa !5
  %55 = call i32 (ptr, ...) @printf(ptr noundef @.str.1, i32 noundef %54)
  ret i32 0
}

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

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

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

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

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

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

@len = external dso_local local_unnamed_addr global i32, align 4
@ans = external dso_local local_unnamed_addr global i32, align 4
@str = external dso_local global [10001 x i8], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress nofree norecurse nounwind uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @str)
  %2 = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) @str) #3
  %3 = trunc i64 %2 to i32
  store i32 %3, ptr @len, align 4, !tbaa !5
  %4 = mul i32 %3, 10
  %5 = add i32 %4, -10
  store i32 %5, ptr @ans, align 4, !tbaa !5
  %6 = icmp sgt i32 %3, 0
  br i1 %6, label %.preheader.us.preheader, label %.split

.preheader.us.preheader:                          ; preds = %0
  %wide.trip.count = and i64 %2, 2147483647
  br label %7

7:                                                ; preds = %.preheader.us.preheader, %122
  %indvars.iv = phi i64 [ 0, %.preheader.us.preheader ], [ %indvars.iv.next, %122 ]
  %8 = getelementptr inbounds [10001 x i8], ptr @str, i64 0, i64 %indvars.iv
  %9 = load i8, ptr %8, align 1, !tbaa !9
  %.not.us = icmp eq i8 %9, 49
  br i1 %.not.us, label %122, label %._crit_edge.us

._crit_edge.us:                                   ; preds = %7
  %10 = trunc nuw nsw i64 %indvars.iv to i32
  %11 = icmp eq i32 %10, %3
  br i1 %11, label %._crit_edge.us.thread, label %12

12:                                               ; preds = %._crit_edge.us
  %13 = and i64 %indvars.iv, 4294967295
  %14 = getelementptr inbounds [10001 x i8], ptr @str, i64 0, i64 %13
  %15 = load i8, ptr %14, align 1, !tbaa !9
  %16 = icmp sgt i8 %15, 49
  br i1 %16, label %._crit_edge.us.thread, label %.preheader.us.1

._crit_edge.us.thread:                            ; preds = %122, %12, %._crit_edge.us
  %17 = add i32 %4, -9
  store i32 %17, ptr @ans, align 4, !tbaa !5
  br label %.preheader.us.1

.preheader.us.1:                                  ; preds = %._crit_edge.us.thread, %12
  %18 = phi i32 [ %17, %._crit_edge.us.thread ], [ %5, %12 ]
  br label %19

19:                                               ; preds = %22, %.preheader.us.1
  %indvars.iv.1 = phi i64 [ 0, %.preheader.us.1 ], [ %indvars.iv.next.1, %22 ]
  %20 = getelementptr inbounds [10001 x i8], ptr @str, i64 0, i64 %indvars.iv.1
  %21 = load i8, ptr %20, align 1, !tbaa !9
  %.not.us.1 = icmp eq i8 %21, 50
  br i1 %.not.us.1, label %22, label %._crit_edge.us.1

22:                                               ; preds = %19
  %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv.1, 1
  %exitcond.1.not = icmp eq i64 %indvars.iv.next.1, %wide.trip.count
  br i1 %exitcond.1.not, label %._crit_edge.us.1.thread, label %19, !llvm.loop !10

._crit_edge.us.1:                                 ; preds = %19
  %23 = trunc nuw nsw i64 %indvars.iv.1 to i32
  %24 = icmp eq i32 %23, %3
  br i1 %24, label %._crit_edge.us.1.thread, label %25

25:                                               ; preds = %._crit_edge.us.1
  %26 = and i64 %indvars.iv.1, 4294967295
  %27 = getelementptr inbounds [10001 x i8], ptr @str, i64 0, i64 %26
  %28 = load i8, ptr %27, align 1, !tbaa !9
  %29 = icmp sgt i8 %28, 50
  br i1 %29, label %._crit_edge.us.1.thread, label %.preheader.us.2

._crit_edge.us.1.thread:                          ; preds = %22, %25, %._crit_edge.us.1
  %30 = add nsw i32 %18, 1
  store i32 %30, ptr @ans, align 4, !tbaa !5
  br label %.preheader.us.2

.preheader.us.2:                                  ; preds = %._crit_edge.us.1.thread, %25
  %31 = phi i32 [ %30, %._crit_edge.us.1.thread ], [ %18, %25 ]
  br label %32

32:                                               ; preds = %35, %.preheader.us.2
  %indvars.iv.2 = phi i64 [ 0, %.preheader.us.2 ], [ %indvars.iv.next.2, %35 ]
  %33 = getelementptr inbounds [10001 x i8], ptr @str, i64 0, i64 %indvars.iv.2
  %34 = load i8, ptr %33, align 1, !tbaa !9
  %.not.us.2 = icmp eq i8 %34, 51
  br i1 %.not.us.2, label %35, label %._crit_edge.us.2

35:                                               ; preds = %32
  %indvars.iv.next.2 = add nuw nsw i64 %indvars.iv.2, 1
  %exitcond.2.not = icmp eq i64 %indvars.iv.next.2, %wide.trip.count
  br i1 %exitcond.2.not, label %._crit_edge.us.2.thread, label %32, !llvm.loop !10

._crit_edge.us.2:                                 ; preds = %32
  %36 = trunc nuw nsw i64 %indvars.iv.2 to i32
  %37 = icmp eq i32 %36, %3
  br i1 %37, label %._crit_edge.us.2.thread, label %38

38:                                               ; preds = %._crit_edge.us.2
  %39 = and i64 %indvars.iv.2, 4294967295
  %40 = getelementptr inbounds [10001 x i8], ptr @str, i64 0, i64 %39
  %41 = load i8, ptr %40, align 1, !tbaa !9
  %42 = icmp sgt i8 %41, 51
  br i1 %42, label %._crit_edge.us.2.thread, label %.preheader.us.3

._crit_edge.us.2.thread:                          ; preds = %35, %38, %._crit_edge.us.2
  %43 = add nsw i32 %31, 1
  store i32 %43, ptr @ans, align 4, !tbaa !5
  br label %.preheader.us.3

.preheader.us.3:                                  ; preds = %._crit_edge.us.2.thread, %38
  %44 = phi i32 [ %43, %._crit_edge.us.2.thread ], [ %31, %38 ]
  br label %45

45:                                               ; preds = %48, %.preheader.us.3
  %indvars.iv.3 = phi i64 [ 0, %.preheader.us.3 ], [ %indvars.iv.next.3, %48 ]
  %46 = getelementptr inbounds [10001 x i8], ptr @str, i64 0, i64 %indvars.iv.3
  %47 = load i8, ptr %46, align 1, !tbaa !9
  %.not.us.3 = icmp eq i8 %47, 52
  br i1 %.not.us.3, label %48, label %._crit_edge.us.3

48:                                               ; preds = %45
  %indvars.iv.next.3 = add nuw nsw i64 %indvars.iv.3, 1
  %exitcond.3.not = icmp eq i64 %indvars.iv.next.3, %wide.trip.count
  br i1 %exitcond.3.not, label %._crit_edge.us.3.thread, label %45, !llvm.loop !10

._crit_edge.us.3:                                 ; preds = %45
  %49 = trunc nuw nsw i64 %indvars.iv.3 to i32
  %50 = icmp eq i32 %49, %3
  br i1 %50, label %._crit_edge.us.3.thread, label %51

51:                                               ; preds = %._crit_edge.us.3
  %52 = and i64 %indvars.iv.3, 4294967295
  %53 = getelementptr inbounds [10001 x i8], ptr @str, i64 0, i64 %52
  %54 = load i8, ptr %53, align 1, !tbaa !9
  %55 = icmp sgt i8 %54, 52
  br i1 %55, label %._crit_edge.us.3.thread, label %.preheader.us.4

._crit_edge.us.3.thread:                          ; preds = %48, %51, %._crit_edge.us.3
  %56 = add nsw i32 %44, 1
  store i32 %56, ptr @ans, align 4, !tbaa !5
  br label %.preheader.us.4

.preheader.us.4:                                  ; preds = %._crit_edge.us.3.thread, %51
  %57 = phi i32 [ %56, %._crit_edge.us.3.thread ], [ %44, %51 ]
  br label %58

58:                                               ; preds = %61, %.preheader.us.4
  %indvars.iv.4 = phi i64 [ 0, %.preheader.us.4 ], [ %indvars.iv.next.4, %61 ]
  %59 = getelementptr inbounds [10001 x i8], ptr @str, i64 0, i64 %indvars.iv.4
  %60 = load i8, ptr %59, align 1, !tbaa !9
  %.not.us.4 = icmp eq i8 %60, 53
  br i1 %.not.us.4, label %61, label %._crit_edge.us.4

61:                                               ; preds = %58
  %indvars.iv.next.4 = add nuw nsw i64 %indvars.iv.4, 1
  %exitcond.4.not = icmp eq i64 %indvars.iv.next.4, %wide.trip.count
  br i1 %exitcond.4.not, label %._crit_edge.us.4.thread, label %58, !llvm.loop !10

._crit_edge.us.4:                                 ; preds = %58
  %62 = trunc nuw nsw i64 %indvars.iv.4 to i32
  %63 = icmp eq i32 %62, %3
  br i1 %63, label %._crit_edge.us.4.thread, label %64

64:                                               ; preds = %._crit_edge.us.4
  %65 = and i64 %indvars.iv.4, 4294967295
  %66 = getelementptr inbounds [10001 x i8], ptr @str, i64 0, i64 %65
  %67 = load i8, ptr %66, align 1, !tbaa !9
  %68 = icmp sgt i8 %67, 53
  br i1 %68, label %._crit_edge.us.4.thread, label %.preheader.us.5

._crit_edge.us.4.thread:                          ; preds = %61, %64, %._crit_edge.us.4
  %69 = add nsw i32 %57, 1
  store i32 %69, ptr @ans, align 4, !tbaa !5
  br label %.preheader.us.5

.preheader.us.5:                                  ; preds = %._crit_edge.us.4.thread, %64
  %70 = phi i32 [ %69, %._crit_edge.us.4.thread ], [ %57, %64 ]
  br label %71

71:                                               ; preds = %74, %.preheader.us.5
  %indvars.iv.5 = phi i64 [ 0, %.preheader.us.5 ], [ %indvars.iv.next.5, %74 ]
  %72 = getelementptr inbounds [10001 x i8], ptr @str, i64 0, i64 %indvars.iv.5
  %73 = load i8, ptr %72, align 1, !tbaa !9
  %.not.us.5 = icmp eq i8 %73, 54
  br i1 %.not.us.5, label %74, label %._crit_edge.us.5

74:                                               ; preds = %71
  %indvars.iv.next.5 = add nuw nsw i64 %indvars.iv.5, 1
  %exitcond.5.not = icmp eq i64 %indvars.iv.next.5, %wide.trip.count
  br i1 %exitcond.5.not, label %._crit_edge.us.5.thread, label %71, !llvm.loop !10

._crit_edge.us.5:                                 ; preds = %71
  %75 = trunc nuw nsw i64 %indvars.iv.5 to i32
  %76 = icmp eq i32 %75, %3
  br i1 %76, label %._crit_edge.us.5.thread, label %77

77:                                               ; preds = %._crit_edge.us.5
  %78 = and i64 %indvars.iv.5, 4294967295
  %79 = getelementptr inbounds [10001 x i8], ptr @str, i64 0, i64 %78
  %80 = load i8, ptr %79, align 1, !tbaa !9
  %81 = icmp sgt i8 %80, 54
  br i1 %81, label %._crit_edge.us.5.thread, label %.preheader.us.6

._crit_edge.us.5.thread:                          ; preds = %74, %77, %._crit_edge.us.5
  %82 = add nsw i32 %70, 1
  store i32 %82, ptr @ans, align 4, !tbaa !5
  br label %.preheader.us.6

.preheader.us.6:                                  ; preds = %._crit_edge.us.5.thread, %77
  %83 = phi i32 [ %82, %._crit_edge.us.5.thread ], [ %70, %77 ]
  br label %84

84:                                               ; preds = %87, %.preheader.us.6
  %indvars.iv.6 = phi i64 [ 0, %.preheader.us.6 ], [ %indvars.iv.next.6, %87 ]
  %85 = getelementptr inbounds [10001 x i8], ptr @str, i64 0, i64 %indvars.iv.6
  %86 = load i8, ptr %85, align 1, !tbaa !9
  %.not.us.6 = icmp eq i8 %86, 55
  br i1 %.not.us.6, label %87, label %._crit_edge.us.6

87:                                               ; preds = %84
  %indvars.iv.next.6 = add nuw nsw i64 %indvars.iv.6, 1
  %exitcond.6.not = icmp eq i64 %indvars.iv.next.6, %wide.trip.count
  br i1 %exitcond.6.not, label %._crit_edge.us.6.thread, label %84, !llvm.loop !10

._crit_edge.us.6:                                 ; preds = %84
  %88 = trunc nuw nsw i64 %indvars.iv.6 to i32
  %89 = icmp eq i32 %88, %3
  br i1 %89, label %._crit_edge.us.6.thread, label %90

90:                                               ; preds = %._crit_edge.us.6
  %91 = and i64 %indvars.iv.6, 4294967295
  %92 = getelementptr inbounds [10001 x i8], ptr @str, i64 0, i64 %91
  %93 = load i8, ptr %92, align 1, !tbaa !9
  %94 = icmp sgt i8 %93, 55
  br i1 %94, label %._crit_edge.us.6.thread, label %.preheader.us.7

._crit_edge.us.6.thread:                          ; preds = %87, %90, %._crit_edge.us.6
  %95 = add nsw i32 %83, 1
  store i32 %95, ptr @ans, align 4, !tbaa !5
  br label %.preheader.us.7

.preheader.us.7:                                  ; preds = %._crit_edge.us.6.thread, %90
  %96 = phi i32 [ %95, %._crit_edge.us.6.thread ], [ %83, %90 ]
  br label %97

97:                                               ; preds = %100, %.preheader.us.7
  %indvars.iv.7 = phi i64 [ 0, %.preheader.us.7 ], [ %indvars.iv.next.7, %100 ]
  %98 = getelementptr inbounds [10001 x i8], ptr @str, i64 0, i64 %indvars.iv.7
  %99 = load i8, ptr %98, align 1, !tbaa !9
  %.not.us.7 = icmp eq i8 %99, 56
  br i1 %.not.us.7, label %100, label %._crit_edge.us.7

100:                                              ; preds = %97
  %indvars.iv.next.7 = add nuw nsw i64 %indvars.iv.7, 1
  %exitcond.7.not = icmp eq i64 %indvars.iv.next.7, %wide.trip.count
  br i1 %exitcond.7.not, label %._crit_edge.us.7.thread, label %97, !llvm.loop !10

._crit_edge.us.7:                                 ; preds = %97
  %101 = trunc nuw nsw i64 %indvars.iv.7 to i32
  %102 = icmp eq i32 %101, %3
  br i1 %102, label %._crit_edge.us.7.thread, label %103

103:                                              ; preds = %._crit_edge.us.7
  %104 = and i64 %indvars.iv.7, 4294967295
  %105 = getelementptr inbounds [10001 x i8], ptr @str, i64 0, i64 %104
  %106 = load i8, ptr %105, align 1, !tbaa !9
  %107 = icmp sgt i8 %106, 56
  br i1 %107, label %._crit_edge.us.7.thread, label %.preheader.us.8

._crit_edge.us.7.thread:                          ; preds = %100, %103, %._crit_edge.us.7
  %108 = add nsw i32 %96, 1
  store i32 %108, ptr @ans, align 4, !tbaa !5
  br label %.preheader.us.8

.preheader.us.8:                                  ; preds = %._crit_edge.us.7.thread, %103
  %109 = phi i32 [ %108, %._crit_edge.us.7.thread ], [ %96, %103 ]
  br label %110

110:                                              ; preds = %113, %.preheader.us.8
  %indvars.iv.8 = phi i64 [ 0, %.preheader.us.8 ], [ %indvars.iv.next.8, %113 ]
  %111 = getelementptr inbounds [10001 x i8], ptr @str, i64 0, i64 %indvars.iv.8
  %112 = load i8, ptr %111, align 1, !tbaa !9
  %.not.us.8 = icmp eq i8 %112, 57
  br i1 %.not.us.8, label %113, label %._crit_edge.us.8

113:                                              ; preds = %110
  %indvars.iv.next.8 = add nuw nsw i64 %indvars.iv.8, 1
  %exitcond.8.not = icmp eq i64 %indvars.iv.next.8, %wide.trip.count
  br i1 %exitcond.8.not, label %._crit_edge.us.8.thread, label %110, !llvm.loop !10

._crit_edge.us.8:                                 ; preds = %110
  %114 = trunc nuw nsw i64 %indvars.iv.8 to i32
  %115 = icmp eq i32 %114, %3
  br i1 %115, label %._crit_edge.us.8.thread, label %116

116:                                              ; preds = %._crit_edge.us.8
  %117 = and i64 %indvars.iv.8, 4294967295
  %118 = getelementptr inbounds [10001 x i8], ptr @str, i64 0, i64 %117
  %119 = load i8, ptr %118, align 1, !tbaa !9
  %120 = icmp sgt i8 %119, 57
  br i1 %120, label %._crit_edge.us.8.thread, label %.split16.us

._crit_edge.us.8.thread:                          ; preds = %113, %116, %._crit_edge.us.8
  %121 = add nsw i32 %109, 1
  br label %.split16.us.sink.split

122:                                              ; preds = %7
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge.us.thread, label %7, !llvm.loop !10

.split:                                           ; preds = %0
  %123 = icmp eq i32 %3, 0
  %124 = load i8, ptr @str, align 16
  br i1 %123, label %.split16.us.sink.split, label %.preheader.preheader

.preheader.preheader:                             ; preds = %.split
  %125 = icmp sgt i8 %124, 49
  br i1 %125, label %.preheader.1, label %.split16.us

.split16.us.sink.split:                           ; preds = %.split, %._crit_edge.us.8.thread, %140
  %.sink = phi i32 [ %141, %140 ], [ %121, %._crit_edge.us.8.thread ], [ -1, %.split ]
  store i32 %.sink, ptr @ans, align 4, !tbaa !5
  br label %.split16.us

.split16.us:                                      ; preds = %.split16.us.sink.split, %.preheader.preheader, %.preheader.1, %.preheader.2, %.preheader.3, %.preheader.4, %.preheader.5, %.preheader.6, %.preheader.7, %.preheader.8, %116
  %126 = phi i32 [ %109, %116 ], [ %138, %.preheader.8 ], [ %137, %.preheader.7 ], [ %135, %.preheader.6 ], [ %134, %.preheader.5 ], [ %132, %.preheader.4 ], [ %131, %.preheader.3 ], [ %129, %.preheader.2 ], [ %128, %.preheader.1 ], [ %5, %.preheader.preheader ], [ %.sink, %.split16.us.sink.split ]
  %127 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %126)
  ret i32 0

.preheader.1:                                     ; preds = %.preheader.preheader
  %128 = add i32 %4, -9
  store i32 %128, ptr @ans, align 4, !tbaa !5
  %.not = icmp eq i8 %124, 50
  br i1 %.not, label %.split16.us, label %.preheader.2

.preheader.2:                                     ; preds = %.preheader.1
  %129 = add i32 %4, -8
  store i32 %129, ptr @ans, align 4, !tbaa !5
  %130 = icmp ugt i8 %124, 51
  br i1 %130, label %.preheader.3, label %.split16.us

.preheader.3:                                     ; preds = %.preheader.2
  %131 = add i32 %4, -7
  store i32 %131, ptr @ans, align 4, !tbaa !5
  %.not54 = icmp eq i8 %124, 52
  br i1 %.not54, label %.split16.us, label %.preheader.4

.preheader.4:                                     ; preds = %.preheader.3
  %132 = add i32 %4, -6
  store i32 %132, ptr @ans, align 4, !tbaa !5
  %133 = icmp ugt i8 %124, 53
  br i1 %133, label %.preheader.5, label %.split16.us

.preheader.5:                                     ; preds = %.preheader.4
  %134 = add i32 %4, -5
  store i32 %134, ptr @ans, align 4, !tbaa !5
  %.not55 = icmp eq i8 %124, 54
  br i1 %.not55, label %.split16.us, label %.preheader.6

.preheader.6:                                     ; preds = %.preheader.5
  %135 = add i32 %4, -4
  store i32 %135, ptr @ans, align 4, !tbaa !5
  %136 = icmp ugt i8 %124, 55
  br i1 %136, label %.preheader.7, label %.split16.us

.preheader.7:                                     ; preds = %.preheader.6
  %137 = add i32 %4, -3
  store i32 %137, ptr @ans, align 4, !tbaa !5
  %.not56 = icmp eq i8 %124, 56
  br i1 %.not56, label %.split16.us, label %.preheader.8

.preheader.8:                                     ; preds = %.preheader.7
  %138 = add i32 %4, -2
  store i32 %138, ptr @ans, align 4, !tbaa !5
  %139 = icmp ugt i8 %124, 57
  br i1 %139, label %140, label %.split16.us

140:                                              ; preds = %.preheader.8
  %141 = add i32 %4, -1
  br label %.split16.us.sink.split
}

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

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

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

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 = { 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 #2 = { 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 #3 = { 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"}


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