; LLVM IR from lzyrapx/Competitive-Programming :: HDUOJ (5718)

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

@s = external dso_local global [10000010 x i8], align 16
@a = external dso_local global [10000010 x i32], align 16
@.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 [11 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [2 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 i32, align 4
  %8 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #6
  %9 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %2)
  br label %10

10:                                               ; preds = %140, %138, %0
  %11 = load i32, ptr %2, align 4, !tbaa !5
  %12 = add nsw i32 %11, -1
  store i32 %12, ptr %2, align 4, !tbaa !5
  %13 = icmp ne i32 %11, 0
  br i1 %13, label %14, label %141

14:                                               ; preds = %10
  call void @llvm.memset.p0.i64(ptr align 16 @a, i8 0, i64 40000040, i1 false)
  %15 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef @s)
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #6
  %16 = call i64 @strlen(ptr noundef @s) #7
  %17 = trunc i64 %16 to i32
  store i32 %17, ptr %4, align 4, !tbaa !5
  %18 = load i32, ptr %4, align 4, !tbaa !5
  %19 = sext i32 %18 to i64
  %20 = getelementptr inbounds i8, ptr @s, i64 %19
  call void @_ZSt4sortIPcEvT_S1_(ptr noundef @s, ptr noundef %20)
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #6
  store i32 0, ptr %5, align 4, !tbaa !5
  store i32 0, ptr %3, align 4, !tbaa !5
  br label %21

21:                                               ; preds = %35, %14
  %22 = load i32, ptr %3, align 4, !tbaa !5
  %23 = load i32, ptr %4, align 4, !tbaa !5
  %24 = icmp slt i32 %22, %23
  br i1 %24, label %25, label %38

25:                                               ; preds = %21
  %26 = load i32, ptr %3, align 4, !tbaa !5
  %27 = sext i32 %26 to i64
  %28 = getelementptr inbounds [10000010 x i8], ptr @s, i64 0, i64 %27
  %29 = load i8, ptr %28, align 1, !tbaa !9
  %30 = sext i8 %29 to i32
  %31 = icmp ne i32 %30, 48
  br i1 %31, label %32, label %34

32:                                               ; preds = %25
  %33 = load i32, ptr %3, align 4, !tbaa !5
  store i32 %33, ptr %5, align 4, !tbaa !5
  br label %38

34:                                               ; preds = %25
  br label %35

35:                                               ; preds = %34
  %36 = load i32, ptr %3, align 4, !tbaa !5
  %37 = add nsw i32 %36, 1
  store i32 %37, ptr %3, align 4, !tbaa !5
  br label %21, !llvm.loop !10

38:                                               ; preds = %32, %21
  %39 = load i32, ptr %4, align 4, !tbaa !5
  %40 = icmp eq i32 %39, 1
  br i1 %40, label %46, label %41

41:                                               ; preds = %38
  %42 = load i32, ptr %5, align 4, !tbaa !5
  %43 = load i32, ptr %4, align 4, !tbaa !5
  %44 = sub nsw i32 %43, 1
  %45 = icmp eq i32 %42, %44
  br i1 %45, label %46, label %48

46:                                               ; preds = %41, %38
  %47 = call i32 (ptr, ...) @printf(ptr noundef @.str.2)
  store i32 2, ptr %6, align 4
  br label %138, !llvm.loop !12

48:                                               ; preds = %41
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  store i32 0, ptr %7, align 4, !tbaa !5
  store i32 0, ptr %3, align 4, !tbaa !5
  br label %49

49:                                               ; preds = %69, %48
  %50 = load i32, ptr %3, align 4, !tbaa !5
  %51 = load i32, ptr %4, align 4, !tbaa !5
  %52 = icmp slt i32 %50, %51
  br i1 %52, label %53, label %72

53:                                               ; preds = %49
  %54 = load i32, ptr %3, align 4, !tbaa !5
  %55 = load i32, ptr %5, align 4, !tbaa !5
  %56 = icmp ne i32 %54, %55
  br i1 %56, label %57, label %68

57:                                               ; preds = %53
  %58 = load i32, ptr %3, align 4, !tbaa !5
  %59 = sext i32 %58 to i64
  %60 = getelementptr inbounds [10000010 x i8], ptr @s, i64 0, i64 %59
  %61 = load i8, ptr %60, align 1, !tbaa !9
  %62 = sext i8 %61 to i32
  %63 = sub nsw i32 %62, 48
  %64 = load i32, ptr %7, align 4, !tbaa !5
  %65 = add nsw i32 %64, 1
  store i32 %65, ptr %7, align 4, !tbaa !5
  %66 = sext i32 %64 to i64
  %67 = getelementptr inbounds [10000010 x i32], ptr @a, i64 0, i64 %66
  store i32 %63, ptr %67, align 4, !tbaa !5
  br label %68

68:                                               ; preds = %57, %53
  br label %69

69:                                               ; preds = %68
  %70 = load i32, ptr %3, align 4, !tbaa !5
  %71 = add nsw i32 %70, 1
  store i32 %71, ptr %3, align 4, !tbaa !5
  br label %49, !llvm.loop !13

72:                                               ; preds = %49
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  %73 = load i32, ptr %5, align 4, !tbaa !5
  %74 = sext i32 %73 to i64
  %75 = getelementptr inbounds [10000010 x i8], ptr @s, i64 0, i64 %74
  %76 = load i8, ptr %75, align 1, !tbaa !9
  %77 = sext i8 %76 to i32
  %78 = sub nsw i32 %77, 48
  store i32 %78, ptr %8, align 4, !tbaa !5
  %79 = load i32, ptr %8, align 4, !tbaa !5
  %80 = load i32, ptr @a, align 16, !tbaa !5
  %81 = add nsw i32 %80, %79
  store i32 %81, ptr @a, align 16, !tbaa !5
  store i32 0, ptr %3, align 4, !tbaa !5
  br label %82

82:                                               ; preds = %106, %72
  %83 = load i32, ptr %3, align 4, !tbaa !5
  %84 = load i32, ptr %7, align 4, !tbaa !5
  %85 = icmp slt i32 %83, %84
  br i1 %85, label %86, label %109

86:                                               ; preds = %82
  %87 = load i32, ptr %3, align 4, !tbaa !5
  %88 = sext i32 %87 to i64
  %89 = getelementptr inbounds [10000010 x i32], ptr @a, i64 0, i64 %88
  %90 = load i32, ptr %89, align 4, !tbaa !5
  %91 = icmp sgt i32 %90, 9
  br i1 %91, label %92, label %104

92:                                               ; preds = %86
  %93 = load i32, ptr %3, align 4, !tbaa !5
  %94 = add nsw i32 %93, 1
  %95 = sext i32 %94 to i64
  %96 = getelementptr inbounds [10000010 x i32], ptr @a, i64 0, i64 %95
  %97 = load i32, ptr %96, align 4, !tbaa !5
  %98 = add nsw i32 %97, 1
  store i32 %98, ptr %96, align 4, !tbaa !5
  %99 = load i32, ptr %3, align 4, !tbaa !5
  %100 = sext i32 %99 to i64
  %101 = getelementptr inbounds [10000010 x i32], ptr @a, i64 0, i64 %100
  %102 = load i32, ptr %101, align 4, !tbaa !5
  %103 = srem i32 %102, 10
  store i32 %103, ptr %101, align 4, !tbaa !5
  br label %105

104:                                              ; preds = %86
  br label %109

105:                                              ; preds = %92
  br label %106

106:                                              ; preds = %105
  %107 = load i32, ptr %3, align 4, !tbaa !5
  %108 = add nsw i32 %107, 1
  store i32 %108, ptr %3, align 4, !tbaa !5
  br label %82, !llvm.loop !14

109:                                              ; preds = %104, %82
  %110 = load i32, ptr %7, align 4, !tbaa !5
  %111 = sext i32 %110 to i64
  %112 = getelementptr inbounds [10000010 x i32], ptr @a, i64 0, i64 %111
  %113 = load i32, ptr %112, align 4, !tbaa !5
  %114 = icmp ne i32 %113, 0
  br i1 %114, label %115, label %121

115:                                              ; preds = %109
  %116 = load i32, ptr %7, align 4, !tbaa !5
  %117 = sext i32 %116 to i64
  %118 = getelementptr inbounds [10000010 x i32], ptr @a, i64 0, i64 %117
  %119 = load i32, ptr %118, align 4, !tbaa !5
  %120 = call i32 (ptr, ...) @printf(ptr noundef @.str, i32 noundef %119)
  br label %121

121:                                              ; preds = %115, %109
  %122 = load i32, ptr %7, align 4, !tbaa !5
  %123 = sub nsw i32 %122, 1
  store i32 %123, ptr %3, align 4, !tbaa !5
  br label %124

124:                                              ; preds = %133, %121
  %125 = load i32, ptr %3, align 4, !tbaa !5
  %126 = icmp sge i32 %125, 0
  br i1 %126, label %127, label %136

127:                                              ; preds = %124
  %128 = load i32, ptr %3, align 4, !tbaa !5
  %129 = sext i32 %128 to i64
  %130 = getelementptr inbounds [10000010 x i32], ptr @a, i64 0, i64 %129
  %131 = load i32, ptr %130, align 4, !tbaa !5
  %132 = call i32 (ptr, ...) @printf(ptr noundef @.str, i32 noundef %131)
  br label %133

133:                                              ; preds = %127
  %134 = load i32, ptr %3, align 4, !tbaa !5
  %135 = add nsw i32 %134, -1
  store i32 %135, ptr %3, align 4, !tbaa !5
  br label %124, !llvm.loop !15

136:                                              ; preds = %124
  %137 = call i32 (ptr, ...) @printf(ptr noundef @.str.3)
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  store i32 0, ptr %6, align 4
  br label %138

138:                                              ; preds = %136, %46
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  %139 = load i32, ptr %6, align 4
  switch i32 %139, label %143 [
    i32 0, label %140
    i32 2, label %10
  ]

140:                                              ; preds = %138
  br label %10, !llvm.loop !12

141:                                              ; preds = %10
  store i32 0, ptr %1, align 4
  store i32 1, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #6
  %142 = load i32, ptr %1, align 4
  ret i32 %142

143:                                              ; preds = %138
  unreachable
}

; 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: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIPcEvT_S1_(ptr noundef, ptr noundef) #5

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

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #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 = { 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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
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 = { inlinehint 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 #6 = { nounwind }
attributes #7 = { 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}
!15 = distinct !{!15, !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"

@s = external dso_local global [10000010 x i8], align 16
@a = external dso_local local_unnamed_addr global [10000010 x i32], align 16
@.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 [11 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [2 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #6
  %2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %1)
  %3 = load i32, ptr %1, align 4, !tbaa !5
  %4 = add nsw i32 %3, -1
  store i32 %4, ptr %1, align 4, !tbaa !5
  %.not57 = icmp eq i32 %3, 0
  br i1 %.not57, label %._crit_edge60, label %.lr.ph59

.lr.ph59:                                         ; preds = %0, %._crit_edge56
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(40000040) @a, i8 0, i64 40000040, i1 false)
  %5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull @s)
  %6 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) @s) #7
  %7 = trunc i64 %6 to i32
  %sext = shl i64 %6, 32
  %8 = ashr exact i64 %sext, 32
  %9 = getelementptr inbounds i8, ptr @s, i64 %8
  call void @_ZSt4sortIPcEvT_S1_(ptr noundef nonnull @s, ptr noundef nonnull %9)
  %10 = icmp sgt i32 %7, 0
  br i1 %10, label %.lr.ph.preheader, label %._crit_edge46.thread

.lr.ph.preheader:                                 ; preds = %.lr.ph59
  %wide.trip.count = and i64 %6, 2147483647
  br label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph.preheader, %13
  %indvars.iv = phi i64 [ 0, %.lr.ph.preheader ], [ %indvars.iv.next, %13 ]
  %11 = getelementptr inbounds [10000010 x i8], ptr @s, i64 0, i64 %indvars.iv
  %12 = load i8, ptr %11, align 1, !tbaa !9
  %.not36 = icmp eq i8 %12, 48
  br i1 %.not36, label %13, label %._crit_edge.split.loop.exit83

13:                                               ; preds = %.lr.ph
  %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, label %.lr.ph, !llvm.loop !10

._crit_edge.split.loop.exit83:                    ; preds = %.lr.ph
  %14 = trunc nuw nsw i64 %indvars.iv to i32
  br label %._crit_edge

._crit_edge:                                      ; preds = %13, %._crit_edge.split.loop.exit83
  %.031 = phi i32 [ %14, %._crit_edge.split.loop.exit83 ], [ 0, %13 ]
  %15 = icmp eq i32 %7, 1
  %16 = add nsw i32 %7, -1
  %17 = icmp eq i32 %.031, %16
  %or.cond = select i1 %15, i1 true, i1 %17
  br i1 %or.cond, label %._crit_edge56, label %.preheader, !llvm.loop !12

.preheader:                                       ; preds = %._crit_edge
  br i1 %10, label %.lr.ph45.preheader, label %._crit_edge46.thread

._crit_edge46.thread:                             ; preds = %.lr.ph59, %.preheader
  %.0317779 = phi i32 [ %.031, %.preheader ], [ 0, %.lr.ph59 ]
  %.pre = zext nneg i32 %.0317779 to i64
  %18 = getelementptr inbounds [10000010 x i8], ptr @s, i64 0, i64 %.pre
  %19 = load i8, ptr %18, align 1, !tbaa !9
  %20 = sext i8 %19 to i32
  %21 = add nsw i32 %20, -48
  %22 = load i32, ptr @a, align 16, !tbaa !5
  %23 = add nsw i32 %21, %22
  store i32 %23, ptr @a, align 16, !tbaa !5
  br label %._crit_edge51

.lr.ph45.preheader:                               ; preds = %.preheader
  %24 = zext i32 %.031 to i64
  %wide.trip.count65 = and i64 %6, 2147483647
  %xtraiter = and i64 %6, 1
  %25 = icmp eq i64 %wide.trip.count65, 1
  br i1 %25, label %._crit_edge46.unr-lcssa, label %.lr.ph45.preheader.new

.lr.ph45.preheader.new:                           ; preds = %.lr.ph45.preheader
  %unroll_iter = sub nsw i64 %wide.trip.count65, %xtraiter
  br label %.lr.ph45

.lr.ph45:                                         ; preds = %42, %.lr.ph45.preheader.new
  %indvars.iv62 = phi i64 [ 0, %.lr.ph45.preheader.new ], [ %indvars.iv.next63.1, %42 ]
  %.044 = phi i32 [ 0, %.lr.ph45.preheader.new ], [ %.1.1, %42 ]
  %niter = phi i64 [ 0, %.lr.ph45.preheader.new ], [ %niter.next.1, %42 ]
  %.not38 = icmp eq i64 %indvars.iv62, %24
  br i1 %.not38, label %.lr.ph45.1, label %26

26:                                               ; preds = %.lr.ph45
  %27 = getelementptr inbounds [10000010 x i8], ptr @s, i64 0, i64 %indvars.iv62
  %28 = load i8, ptr %27, align 2, !tbaa !9
  %29 = sext i8 %28 to i32
  %30 = add nsw i32 %29, -48
  %31 = add nsw i32 %.044, 1
  %32 = sext i32 %.044 to i64
  %33 = getelementptr inbounds [10000010 x i32], ptr @a, i64 0, i64 %32
  store i32 %30, ptr %33, align 4, !tbaa !5
  br label %.lr.ph45.1

.lr.ph45.1:                                       ; preds = %.lr.ph45, %26
  %.1 = phi i32 [ %31, %26 ], [ %.044, %.lr.ph45 ]
  %indvars.iv.next63 = or disjoint i64 %indvars.iv62, 1
  %.not38.1 = icmp eq i64 %indvars.iv.next63, %24
  br i1 %.not38.1, label %42, label %34

34:                                               ; preds = %.lr.ph45.1
  %35 = getelementptr inbounds [10000010 x i8], ptr @s, i64 0, i64 %indvars.iv.next63
  %36 = load i8, ptr %35, align 1, !tbaa !9
  %37 = sext i8 %36 to i32
  %38 = add nsw i32 %37, -48
  %39 = add nsw i32 %.1, 1
  %40 = sext i32 %.1 to i64
  %41 = getelementptr inbounds [10000010 x i32], ptr @a, i64 0, i64 %40
  store i32 %38, ptr %41, align 4, !tbaa !5
  br label %42

42:                                               ; preds = %34, %.lr.ph45.1
  %.1.1 = phi i32 [ %39, %34 ], [ %.1, %.lr.ph45.1 ]
  %indvars.iv.next63.1 = add nuw nsw i64 %indvars.iv62, 2
  %niter.next.1 = add i64 %niter, 2
  %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
  br i1 %niter.ncmp.1, label %._crit_edge46.unr-lcssa, label %.lr.ph45, !llvm.loop !13

._crit_edge46.unr-lcssa:                          ; preds = %42, %.lr.ph45.preheader
  %.1.lcssa.ph = phi i32 [ poison, %.lr.ph45.preheader ], [ %.1.1, %42 ]
  %indvars.iv62.unr = phi i64 [ 0, %.lr.ph45.preheader ], [ %indvars.iv.next63.1, %42 ]
  %.044.unr = phi i32 [ 0, %.lr.ph45.preheader ], [ %.1.1, %42 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge46, label %.lr.ph45.epil

.lr.ph45.epil:                                    ; preds = %._crit_edge46.unr-lcssa
  %.not38.epil = icmp eq i64 %indvars.iv62.unr, %24
  br i1 %.not38.epil, label %._crit_edge46, label %43

43:                                               ; preds = %.lr.ph45.epil
  %44 = getelementptr inbounds [10000010 x i8], ptr @s, i64 0, i64 %indvars.iv62.unr
  %45 = load i8, ptr %44, align 1, !tbaa !9
  %46 = sext i8 %45 to i32
  %47 = add nsw i32 %46, -48
  %48 = add nsw i32 %.044.unr, 1
  %49 = sext i32 %.044.unr to i64
  %50 = getelementptr inbounds [10000010 x i32], ptr @a, i64 0, i64 %49
  store i32 %47, ptr %50, align 4, !tbaa !5
  br label %._crit_edge46

._crit_edge46:                                    ; preds = %.lr.ph45.epil, %43, %._crit_edge46.unr-lcssa
  %.1.lcssa = phi i32 [ %.1.lcssa.ph, %._crit_edge46.unr-lcssa ], [ %48, %43 ], [ %.044.unr, %.lr.ph45.epil ]
  %51 = getelementptr inbounds [10000010 x i8], ptr @s, i64 0, i64 %24
  %52 = load i8, ptr %51, align 1, !tbaa !9
  %53 = sext i8 %52 to i32
  %54 = add nsw i32 %53, -48
  %55 = load i32, ptr @a, align 16, !tbaa !5
  %56 = add nsw i32 %54, %55
  store i32 %56, ptr @a, align 16, !tbaa !5
  %57 = icmp sgt i32 %.1.lcssa, 0
  br i1 %57, label %.lr.ph50.preheader, label %._crit_edge51

.lr.ph50.preheader:                               ; preds = %._crit_edge46
  %wide.trip.count70 = zext nneg i32 %.1.lcssa to i64
  br label %.lr.ph50

.lr.ph50:                                         ; preds = %.lr.ph50.preheader, %60
  %58 = phi i32 [ %56, %.lr.ph50.preheader ], [ %64, %60 ]
  %indvars.iv67 = phi i64 [ 0, %.lr.ph50.preheader ], [ %indvars.iv.next68, %60 ]
  %59 = icmp sgt i32 %58, 9
  br i1 %59, label %60, label %._crit_edge51

60:                                               ; preds = %.lr.ph50
  %61 = getelementptr inbounds [10000010 x i32], ptr @a, i64 0, i64 %indvars.iv67
  %indvars.iv.next68 = add nuw nsw i64 %indvars.iv67, 1
  %62 = getelementptr inbounds [10000010 x i32], ptr @a, i64 0, i64 %indvars.iv.next68
  %63 = load i32, ptr %62, align 4, !tbaa !5
  %64 = add nsw i32 %63, 1
  store i32 %64, ptr %62, align 4, !tbaa !5
  %65 = urem i32 %58, 10
  store i32 %65, ptr %61, align 4, !tbaa !5
  %exitcond71.not = icmp eq i64 %indvars.iv.next68, %wide.trip.count70
  br i1 %exitcond71.not, label %._crit_edge51, label %.lr.ph50, !llvm.loop !14

._crit_edge51:                                    ; preds = %60, %.lr.ph50, %._crit_edge46.thread, %._crit_edge46
  %66 = phi i1 [ false, %._crit_edge46.thread ], [ false, %._crit_edge46 ], [ %57, %.lr.ph50 ], [ %57, %60 ]
  %.0.lcssa82 = phi i32 [ 0, %._crit_edge46.thread ], [ %.1.lcssa, %._crit_edge46 ], [ %.1.lcssa, %.lr.ph50 ], [ %.1.lcssa, %60 ]
  %67 = sext i32 %.0.lcssa82 to i64
  %68 = getelementptr inbounds [10000010 x i32], ptr @a, i64 0, i64 %67
  %69 = load i32, ptr %68, align 4, !tbaa !5
  %.not37 = icmp eq i32 %69, 0
  br i1 %.not37, label %72, label %70

70:                                               ; preds = %._crit_edge51
  %71 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %69)
  br label %72

72:                                               ; preds = %70, %._crit_edge51
  br i1 %66, label %.lr.ph55.preheader, label %._crit_edge56

.lr.ph55.preheader:                               ; preds = %72
  %73 = zext nneg i32 %.0.lcssa82 to i64
  br label %.lr.ph55

.lr.ph55:                                         ; preds = %.lr.ph55.preheader, %.lr.ph55
  %indvars.iv72 = phi i64 [ %73, %.lr.ph55.preheader ], [ %indvars.iv.next73, %.lr.ph55 ]
  %indvars.iv.next73 = add nsw i64 %indvars.iv72, -1
  %74 = getelementptr inbounds [10000010 x i32], ptr @a, i64 0, i64 %indvars.iv.next73
  %75 = load i32, ptr %74, align 4, !tbaa !5
  %76 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %75)
  %77 = icmp ugt i64 %indvars.iv72, 1
  br i1 %77, label %.lr.ph55, label %._crit_edge56, !llvm.loop !15

._crit_edge56:                                    ; preds = %.lr.ph55, %72, %._crit_edge
  %.str.3.sink = phi ptr [ @.str.2, %._crit_edge ], [ @.str.3, %72 ], [ @.str.3, %.lr.ph55 ]
  %78 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.3.sink)
  %79 = load i32, ptr %1, align 4, !tbaa !5
  %80 = add nsw i32 %79, -1
  store i32 %80, ptr %1, align 4, !tbaa !5
  %.not = icmp eq i32 %79, 0
  br i1 %.not, label %._crit_edge60, label %.lr.ph59

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

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

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIPcEvT_S1_(ptr noundef, ptr noundef) local_unnamed_addr #5

; Function Attrs: nofree nounwind
declare noundef i32 @printf(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

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 = { 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 nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { 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 #5 = { inlinehint 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 #6 = { nounwind }
attributes #7 = { 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}
!15 = distinct !{!15, !11}


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