; LLVM IR from tangjz/acm-icpc :: codeforces/gym/104068B.ll (Z5solvev)

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

@_ZZ5solvevE3ctr = external hidden global [11 x i32], align 16
@_ZZ5solvevE3buf = external hidden global [100001 x i8], align 16
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1

; Function Attrs: mustprogress uwtable
define dso_local void @_Z5solvev() #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
  call void @llvm.lifetime.start.p0(i64 4, ptr %1) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #4
  %6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %1, ptr noundef %2)
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #4
  store i32 1, ptr %3, align 4, !tbaa !5
  br label %7

7:                                                ; preds = %16, %0
  %8 = load i32, ptr %3, align 4, !tbaa !5
  %9 = icmp slt i32 %8, 10
  br i1 %9, label %11, label %10

10:                                               ; preds = %7
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #4
  br label %19

11:                                               ; preds = %7
  %12 = load i32, ptr %3, align 4, !tbaa !5
  %13 = sext i32 %12 to i64
  %14 = getelementptr inbounds i32, ptr @_ZZ5solvevE3ctr, i64 %13
  %15 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %14)
  br label %16

16:                                               ; preds = %11
  %17 = load i32, ptr %3, align 4, !tbaa !5
  %18 = add nsw i32 %17, 1
  store i32 %18, ptr %3, align 4, !tbaa !5
  br label %7, !llvm.loop !9

19:                                               ; preds = %10
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #4
  store i32 9, ptr %4, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #4
  %20 = load i32, ptr %1, align 4, !tbaa !5
  store i32 %20, ptr %5, align 4, !tbaa !5
  br label %21

21:                                               ; preds = %59, %19
  %22 = load i32, ptr %4, align 4, !tbaa !5
  %23 = icmp sgt i32 %22, 0
  br i1 %23, label %25, label %24

24:                                               ; preds = %21
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #4
  br label %62

25:                                               ; preds = %21
  br label %26

26:                                               ; preds = %55, %25
  %27 = load i32, ptr %4, align 4, !tbaa !5
  %28 = sext i32 %27 to i64
  %29 = getelementptr inbounds [11 x i32], ptr @_ZZ5solvevE3ctr, i64 0, i64 %28
  %30 = load i32, ptr %29, align 4, !tbaa !5
  %31 = add nsw i32 %30, -1
  store i32 %31, ptr %29, align 4, !tbaa !5
  %32 = icmp ne i32 %30, 0
  br i1 %32, label %33, label %58

33:                                               ; preds = %26
  %34 = load i32, ptr %5, align 4, !tbaa !5
  %35 = icmp sgt i32 %34, 0
  br i1 %35, label %36, label %44

36:                                               ; preds = %33
  %37 = load i32, ptr %4, align 4, !tbaa !5
  %38 = add nsw i32 48, %37
  %39 = trunc i32 %38 to i8
  %40 = load i32, ptr %5, align 4, !tbaa !5
  %41 = sub nsw i32 %40, 1
  %42 = sext i32 %41 to i64
  %43 = getelementptr inbounds [100001 x i8], ptr @_ZZ5solvevE3buf, i64 0, i64 %42
  store i8 %39, ptr %43, align 1, !tbaa !11
  br label %54

44:                                               ; preds = %33
  %45 = load i32, ptr %4, align 4, !tbaa !5
  %46 = load i32, ptr %5, align 4, !tbaa !5
  %47 = sub nsw i32 0, %46
  %48 = sext i32 %47 to i64
  %49 = getelementptr inbounds [100001 x i8], ptr @_ZZ5solvevE3buf, i64 0, i64 %48
  %50 = load i8, ptr %49, align 1, !tbaa !11
  %51 = sext i8 %50 to i32
  %52 = sub nsw i32 %51, %45
  %53 = trunc i32 %52 to i8
  store i8 %53, ptr %49, align 1, !tbaa !11
  br label %54

54:                                               ; preds = %44, %36
  br label %55

55:                                               ; preds = %54
  %56 = load i32, ptr %5, align 4, !tbaa !5
  %57 = add nsw i32 %56, -1
  store i32 %57, ptr %5, align 4, !tbaa !5
  br label %26, !llvm.loop !12

58:                                               ; preds = %26
  br label %59

59:                                               ; preds = %58
  %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 %21, !llvm.loop !13

62:                                               ; preds = %24
  br label %63

63:                                               ; preds = %77, %62
  %64 = load i32, ptr %1, align 4, !tbaa !5
  %65 = icmp sgt i32 %64, 1
  br i1 %65, label %66, label %74

66:                                               ; preds = %63
  %67 = load i32, ptr %1, align 4, !tbaa !5
  %68 = sub nsw i32 %67, 1
  %69 = sext i32 %68 to i64
  %70 = getelementptr inbounds [100001 x i8], ptr @_ZZ5solvevE3buf, i64 0, i64 %69
  %71 = load i8, ptr %70, align 1, !tbaa !11
  %72 = sext i8 %71 to i32
  %73 = icmp eq i32 %72, 48
  br label %74

74:                                               ; preds = %66, %63
  %75 = phi i1 [ false, %63 ], [ %73, %66 ]
  br i1 %75, label %76, label %80

76:                                               ; preds = %74
  br label %77

77:                                               ; preds = %76
  %78 = load i32, ptr %1, align 4, !tbaa !5
  %79 = add nsw i32 %78, -1
  store i32 %79, ptr %1, align 4, !tbaa !5
  br label %63, !llvm.loop !14

80:                                               ; preds = %74
  %81 = load i32, ptr %1, align 4, !tbaa !5
  %82 = sext i32 %81 to i64
  %83 = getelementptr inbounds i8, ptr @_ZZ5solvevE3buf, i64 %82
  call void @_ZSt7reverseIPcEvT_S1_(ptr noundef @_ZZ5solvevE3buf, ptr noundef %83)
  %84 = load i32, ptr %1, align 4, !tbaa !5
  %85 = sext i32 %84 to i64
  %86 = getelementptr inbounds [100001 x i8], ptr @_ZZ5solvevE3buf, i64 0, i64 %85
  store i8 0, ptr %86, align 1, !tbaa !11
  %87 = call i32 @puts(ptr noundef @_ZZ5solvevE3buf)
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %1) #4
  ret void
}

; 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 nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1

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

declare i32 @puts(ptr noundef) #2

attributes #0 = { 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 #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 = { 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 #4 = { 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 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!7, !7, i64 0}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}


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

@_ZZ5solvevE3ctr = external hidden global [11 x i32], align 16
@_ZZ5solvevE3buf = external hidden global [100001 x i8], align 16
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1

; Function Attrs: mustprogress uwtable
define dso_local void @_Z5solvev() local_unnamed_addr #0 {
.preheader:
  %0 = alloca i32, align 4
  %1 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %0) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #4
  %2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %0, ptr noundef nonnull %1)
  %3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull getelementptr inbounds (i8, ptr @_ZZ5solvevE3ctr, i64 4))
  %4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull getelementptr inbounds (i8, ptr @_ZZ5solvevE3ctr, i64 8))
  %5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull getelementptr inbounds (i8, ptr @_ZZ5solvevE3ctr, i64 12))
  %6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull getelementptr inbounds (i8, ptr @_ZZ5solvevE3ctr, i64 16))
  %7 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull getelementptr inbounds (i8, ptr @_ZZ5solvevE3ctr, i64 20))
  %8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull getelementptr inbounds (i8, ptr @_ZZ5solvevE3ctr, i64 24))
  %9 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull getelementptr inbounds (i8, ptr @_ZZ5solvevE3ctr, i64 28))
  %10 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull getelementptr inbounds (i8, ptr @_ZZ5solvevE3ctr, i64 32))
  %11 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull getelementptr inbounds (i8, ptr @_ZZ5solvevE3ctr, i64 36))
  %12 = load i32, ptr %0, align 4, !tbaa !5
  %.promoted = load i32, ptr getelementptr inbounds (i8, ptr @_ZZ5solvevE3ctr, i64 36), align 4, !tbaa !5
  %.not17 = icmp eq i32 %.promoted, 0
  br i1 %.not17, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %.preheader, %25
  %.in = phi i32 [ %13, %25 ], [ %.promoted, %.preheader ]
  %.118 = phi i32 [ %.pre-phi46, %25 ], [ %12, %.preheader ]
  %13 = add nsw i32 %.in, -1
  %14 = icmp sgt i32 %.118, 0
  br i1 %14, label %15, label %19

15:                                               ; preds = %.lr.ph
  %16 = add nsw i32 %.118, -1
  %17 = zext nneg i32 %16 to i64
  %18 = getelementptr inbounds [100001 x i8], ptr @_ZZ5solvevE3buf, i64 0, i64 %17
  store i8 57, ptr %18, align 1, !tbaa !9
  br label %25

19:                                               ; preds = %.lr.ph
  %20 = sub nsw i32 0, %.118
  %21 = zext nneg i32 %20 to i64
  %22 = getelementptr inbounds [100001 x i8], ptr @_ZZ5solvevE3buf, i64 0, i64 %21
  %23 = load i8, ptr %22, align 1, !tbaa !9
  %24 = add i8 %23, -9
  store i8 %24, ptr %22, align 1, !tbaa !9
  %.pre45 = add nsw i32 %.118, -1
  br label %25

25:                                               ; preds = %15, %19
  %.pre-phi46 = phi i32 [ %16, %15 ], [ %.pre45, %19 ]
  %.not = icmp eq i32 %13, 0
  br i1 %.not, label %._crit_edge, label %.lr.ph, !llvm.loop !10

._crit_edge:                                      ; preds = %25, %.preheader
  %.1.lcssa = phi i32 [ %12, %.preheader ], [ %.pre-phi46, %25 ]
  store i32 -1, ptr getelementptr inbounds (i8, ptr @_ZZ5solvevE3ctr, i64 36), align 4, !tbaa !5
  %.promoted.1 = load i32, ptr getelementptr inbounds (i8, ptr @_ZZ5solvevE3ctr, i64 32), align 16, !tbaa !5
  %.not17.1 = icmp eq i32 %.promoted.1, 0
  br i1 %.not17.1, label %._crit_edge.1, label %.lr.ph.1

.lr.ph.1:                                         ; preds = %._crit_edge, %38
  %.in49 = phi i32 [ %26, %38 ], [ %.promoted.1, %._crit_edge ]
  %.118.1 = phi i32 [ %.pre-phi44, %38 ], [ %.1.lcssa, %._crit_edge ]
  %26 = add nsw i32 %.in49, -1
  %27 = icmp sgt i32 %.118.1, 0
  br i1 %27, label %34, label %28

28:                                               ; preds = %.lr.ph.1
  %29 = sub nsw i32 0, %.118.1
  %30 = zext nneg i32 %29 to i64
  %31 = getelementptr inbounds [100001 x i8], ptr @_ZZ5solvevE3buf, i64 0, i64 %30
  %32 = load i8, ptr %31, align 1, !tbaa !9
  %33 = add i8 %32, -8
  store i8 %33, ptr %31, align 1, !tbaa !9
  %.pre43 = add nsw i32 %.118.1, -1
  br label %38

34:                                               ; preds = %.lr.ph.1
  %35 = add nsw i32 %.118.1, -1
  %36 = zext nneg i32 %35 to i64
  %37 = getelementptr inbounds [100001 x i8], ptr @_ZZ5solvevE3buf, i64 0, i64 %36
  store i8 56, ptr %37, align 1, !tbaa !9
  br label %38

38:                                               ; preds = %34, %28
  %.pre-phi44 = phi i32 [ %35, %34 ], [ %.pre43, %28 ]
  %.not.1 = icmp eq i32 %26, 0
  br i1 %.not.1, label %._crit_edge.1, label %.lr.ph.1, !llvm.loop !10

._crit_edge.1:                                    ; preds = %38, %._crit_edge
  %.1.lcssa.1 = phi i32 [ %.1.lcssa, %._crit_edge ], [ %.pre-phi44, %38 ]
  store i32 -1, ptr getelementptr inbounds (i8, ptr @_ZZ5solvevE3ctr, i64 32), align 16, !tbaa !5
  %.promoted.2 = load i32, ptr getelementptr inbounds (i8, ptr @_ZZ5solvevE3ctr, i64 28), align 4, !tbaa !5
  %.not17.2 = icmp eq i32 %.promoted.2, 0
  br i1 %.not17.2, label %._crit_edge.2, label %.lr.ph.2

.lr.ph.2:                                         ; preds = %._crit_edge.1, %51
  %.in50 = phi i32 [ %39, %51 ], [ %.promoted.2, %._crit_edge.1 ]
  %.118.2 = phi i32 [ %.pre-phi42, %51 ], [ %.1.lcssa.1, %._crit_edge.1 ]
  %39 = add nsw i32 %.in50, -1
  %40 = icmp sgt i32 %.118.2, 0
  br i1 %40, label %47, label %41

41:                                               ; preds = %.lr.ph.2
  %42 = sub nsw i32 0, %.118.2
  %43 = zext nneg i32 %42 to i64
  %44 = getelementptr inbounds [100001 x i8], ptr @_ZZ5solvevE3buf, i64 0, i64 %43
  %45 = load i8, ptr %44, align 1, !tbaa !9
  %46 = add i8 %45, -7
  store i8 %46, ptr %44, align 1, !tbaa !9
  %.pre41 = add nsw i32 %.118.2, -1
  br label %51

47:                                               ; preds = %.lr.ph.2
  %48 = add nsw i32 %.118.2, -1
  %49 = zext nneg i32 %48 to i64
  %50 = getelementptr inbounds [100001 x i8], ptr @_ZZ5solvevE3buf, i64 0, i64 %49
  store i8 55, ptr %50, align 1, !tbaa !9
  br label %51

51:                                               ; preds = %47, %41
  %.pre-phi42 = phi i32 [ %48, %47 ], [ %.pre41, %41 ]
  %.not.2 = icmp eq i32 %39, 0
  br i1 %.not.2, label %._crit_edge.2, label %.lr.ph.2, !llvm.loop !10

._crit_edge.2:                                    ; preds = %51, %._crit_edge.1
  %.1.lcssa.2 = phi i32 [ %.1.lcssa.1, %._crit_edge.1 ], [ %.pre-phi42, %51 ]
  store i32 -1, ptr getelementptr inbounds (i8, ptr @_ZZ5solvevE3ctr, i64 28), align 4, !tbaa !5
  %.promoted.3 = load i32, ptr getelementptr inbounds (i8, ptr @_ZZ5solvevE3ctr, i64 24), align 8, !tbaa !5
  %.not17.3 = icmp eq i32 %.promoted.3, 0
  br i1 %.not17.3, label %._crit_edge.3, label %.lr.ph.3

.lr.ph.3:                                         ; preds = %._crit_edge.2, %64
  %.in51 = phi i32 [ %52, %64 ], [ %.promoted.3, %._crit_edge.2 ]
  %.118.3 = phi i32 [ %.pre-phi40, %64 ], [ %.1.lcssa.2, %._crit_edge.2 ]
  %52 = add nsw i32 %.in51, -1
  %53 = icmp sgt i32 %.118.3, 0
  br i1 %53, label %60, label %54

54:                                               ; preds = %.lr.ph.3
  %55 = sub nsw i32 0, %.118.3
  %56 = zext nneg i32 %55 to i64
  %57 = getelementptr inbounds [100001 x i8], ptr @_ZZ5solvevE3buf, i64 0, i64 %56
  %58 = load i8, ptr %57, align 1, !tbaa !9
  %59 = add i8 %58, -6
  store i8 %59, ptr %57, align 1, !tbaa !9
  %.pre39 = add nsw i32 %.118.3, -1
  br label %64

60:                                               ; preds = %.lr.ph.3
  %61 = add nsw i32 %.118.3, -1
  %62 = zext nneg i32 %61 to i64
  %63 = getelementptr inbounds [100001 x i8], ptr @_ZZ5solvevE3buf, i64 0, i64 %62
  store i8 54, ptr %63, align 1, !tbaa !9
  br label %64

64:                                               ; preds = %60, %54
  %.pre-phi40 = phi i32 [ %61, %60 ], [ %.pre39, %54 ]
  %.not.3 = icmp eq i32 %52, 0
  br i1 %.not.3, label %._crit_edge.3, label %.lr.ph.3, !llvm.loop !10

._crit_edge.3:                                    ; preds = %64, %._crit_edge.2
  %.1.lcssa.3 = phi i32 [ %.1.lcssa.2, %._crit_edge.2 ], [ %.pre-phi40, %64 ]
  store i32 -1, ptr getelementptr inbounds (i8, ptr @_ZZ5solvevE3ctr, i64 24), align 8, !tbaa !5
  %.promoted.4 = load i32, ptr getelementptr inbounds (i8, ptr @_ZZ5solvevE3ctr, i64 20), align 4, !tbaa !5
  %.not17.4 = icmp eq i32 %.promoted.4, 0
  br i1 %.not17.4, label %._crit_edge.4, label %.lr.ph.4

.lr.ph.4:                                         ; preds = %._crit_edge.3, %77
  %.in52 = phi i32 [ %65, %77 ], [ %.promoted.4, %._crit_edge.3 ]
  %.118.4 = phi i32 [ %.pre-phi38, %77 ], [ %.1.lcssa.3, %._crit_edge.3 ]
  %65 = add nsw i32 %.in52, -1
  %66 = icmp sgt i32 %.118.4, 0
  br i1 %66, label %73, label %67

67:                                               ; preds = %.lr.ph.4
  %68 = sub nsw i32 0, %.118.4
  %69 = zext nneg i32 %68 to i64
  %70 = getelementptr inbounds [100001 x i8], ptr @_ZZ5solvevE3buf, i64 0, i64 %69
  %71 = load i8, ptr %70, align 1, !tbaa !9
  %72 = add i8 %71, -5
  store i8 %72, ptr %70, align 1, !tbaa !9
  %.pre37 = add nsw i32 %.118.4, -1
  br label %77

73:                                               ; preds = %.lr.ph.4
  %74 = add nsw i32 %.118.4, -1
  %75 = zext nneg i32 %74 to i64
  %76 = getelementptr inbounds [100001 x i8], ptr @_ZZ5solvevE3buf, i64 0, i64 %75
  store i8 53, ptr %76, align 1, !tbaa !9
  br label %77

77:                                               ; preds = %73, %67
  %.pre-phi38 = phi i32 [ %74, %73 ], [ %.pre37, %67 ]
  %.not.4 = icmp eq i32 %65, 0
  br i1 %.not.4, label %._crit_edge.4, label %.lr.ph.4, !llvm.loop !10

._crit_edge.4:                                    ; preds = %77, %._crit_edge.3
  %.1.lcssa.4 = phi i32 [ %.1.lcssa.3, %._crit_edge.3 ], [ %.pre-phi38, %77 ]
  store i32 -1, ptr getelementptr inbounds (i8, ptr @_ZZ5solvevE3ctr, i64 20), align 4, !tbaa !5
  %.promoted.5 = load i32, ptr getelementptr inbounds (i8, ptr @_ZZ5solvevE3ctr, i64 16), align 16, !tbaa !5
  %.not17.5 = icmp eq i32 %.promoted.5, 0
  br i1 %.not17.5, label %._crit_edge.5, label %.lr.ph.5

.lr.ph.5:                                         ; preds = %._crit_edge.4, %90
  %.in53 = phi i32 [ %78, %90 ], [ %.promoted.5, %._crit_edge.4 ]
  %.118.5 = phi i32 [ %.pre-phi36, %90 ], [ %.1.lcssa.4, %._crit_edge.4 ]
  %78 = add nsw i32 %.in53, -1
  %79 = icmp sgt i32 %.118.5, 0
  br i1 %79, label %86, label %80

80:                                               ; preds = %.lr.ph.5
  %81 = sub nsw i32 0, %.118.5
  %82 = zext nneg i32 %81 to i64
  %83 = getelementptr inbounds [100001 x i8], ptr @_ZZ5solvevE3buf, i64 0, i64 %82
  %84 = load i8, ptr %83, align 1, !tbaa !9
  %85 = add i8 %84, -4
  store i8 %85, ptr %83, align 1, !tbaa !9
  %.pre35 = add nsw i32 %.118.5, -1
  br label %90

86:                                               ; preds = %.lr.ph.5
  %87 = add nsw i32 %.118.5, -1
  %88 = zext nneg i32 %87 to i64
  %89 = getelementptr inbounds [100001 x i8], ptr @_ZZ5solvevE3buf, i64 0, i64 %88
  store i8 52, ptr %89, align 1, !tbaa !9
  br label %90

90:                                               ; preds = %86, %80
  %.pre-phi36 = phi i32 [ %87, %86 ], [ %.pre35, %80 ]
  %.not.5 = icmp eq i32 %78, 0
  br i1 %.not.5, label %._crit_edge.5, label %.lr.ph.5, !llvm.loop !10

._crit_edge.5:                                    ; preds = %90, %._crit_edge.4
  %.1.lcssa.5 = phi i32 [ %.1.lcssa.4, %._crit_edge.4 ], [ %.pre-phi36, %90 ]
  store i32 -1, ptr getelementptr inbounds (i8, ptr @_ZZ5solvevE3ctr, i64 16), align 16, !tbaa !5
  %.promoted.6 = load i32, ptr getelementptr inbounds (i8, ptr @_ZZ5solvevE3ctr, i64 12), align 4, !tbaa !5
  %.not17.6 = icmp eq i32 %.promoted.6, 0
  br i1 %.not17.6, label %._crit_edge.6, label %.lr.ph.6

.lr.ph.6:                                         ; preds = %._crit_edge.5, %103
  %.in54 = phi i32 [ %91, %103 ], [ %.promoted.6, %._crit_edge.5 ]
  %.118.6 = phi i32 [ %.pre-phi34, %103 ], [ %.1.lcssa.5, %._crit_edge.5 ]
  %91 = add nsw i32 %.in54, -1
  %92 = icmp sgt i32 %.118.6, 0
  br i1 %92, label %99, label %93

93:                                               ; preds = %.lr.ph.6
  %94 = sub nsw i32 0, %.118.6
  %95 = zext nneg i32 %94 to i64
  %96 = getelementptr inbounds [100001 x i8], ptr @_ZZ5solvevE3buf, i64 0, i64 %95
  %97 = load i8, ptr %96, align 1, !tbaa !9
  %98 = add i8 %97, -3
  store i8 %98, ptr %96, align 1, !tbaa !9
  %.pre33 = add nsw i32 %.118.6, -1
  br label %103

99:                                               ; preds = %.lr.ph.6
  %100 = add nsw i32 %.118.6, -1
  %101 = zext nneg i32 %100 to i64
  %102 = getelementptr inbounds [100001 x i8], ptr @_ZZ5solvevE3buf, i64 0, i64 %101
  store i8 51, ptr %102, align 1, !tbaa !9
  br label %103

103:                                              ; preds = %99, %93
  %.pre-phi34 = phi i32 [ %100, %99 ], [ %.pre33, %93 ]
  %.not.6 = icmp eq i32 %91, 0
  br i1 %.not.6, label %._crit_edge.6, label %.lr.ph.6, !llvm.loop !10

._crit_edge.6:                                    ; preds = %103, %._crit_edge.5
  %.1.lcssa.6 = phi i32 [ %.1.lcssa.5, %._crit_edge.5 ], [ %.pre-phi34, %103 ]
  store i32 -1, ptr getelementptr inbounds (i8, ptr @_ZZ5solvevE3ctr, i64 12), align 4, !tbaa !5
  %.promoted.7 = load i32, ptr getelementptr inbounds (i8, ptr @_ZZ5solvevE3ctr, i64 8), align 8, !tbaa !5
  %.not17.7 = icmp eq i32 %.promoted.7, 0
  br i1 %.not17.7, label %._crit_edge.7, label %.lr.ph.7

.lr.ph.7:                                         ; preds = %._crit_edge.6, %116
  %.in55 = phi i32 [ %104, %116 ], [ %.promoted.7, %._crit_edge.6 ]
  %.118.7 = phi i32 [ %.pre-phi32, %116 ], [ %.1.lcssa.6, %._crit_edge.6 ]
  %104 = add nsw i32 %.in55, -1
  %105 = icmp sgt i32 %.118.7, 0
  br i1 %105, label %112, label %106

106:                                              ; preds = %.lr.ph.7
  %107 = sub nsw i32 0, %.118.7
  %108 = zext nneg i32 %107 to i64
  %109 = getelementptr inbounds [100001 x i8], ptr @_ZZ5solvevE3buf, i64 0, i64 %108
  %110 = load i8, ptr %109, align 1, !tbaa !9
  %111 = add i8 %110, -2
  store i8 %111, ptr %109, align 1, !tbaa !9
  %.pre31 = add nsw i32 %.118.7, -1
  br label %116

112:                                              ; preds = %.lr.ph.7
  %113 = add nsw i32 %.118.7, -1
  %114 = zext nneg i32 %113 to i64
  %115 = getelementptr inbounds [100001 x i8], ptr @_ZZ5solvevE3buf, i64 0, i64 %114
  store i8 50, ptr %115, align 1, !tbaa !9
  br label %116

116:                                              ; preds = %112, %106
  %.pre-phi32 = phi i32 [ %113, %112 ], [ %.pre31, %106 ]
  %.not.7 = icmp eq i32 %104, 0
  br i1 %.not.7, label %._crit_edge.7, label %.lr.ph.7, !llvm.loop !10

._crit_edge.7:                                    ; preds = %116, %._crit_edge.6
  %.1.lcssa.7 = phi i32 [ %.1.lcssa.6, %._crit_edge.6 ], [ %.pre-phi32, %116 ]
  store i32 -1, ptr getelementptr inbounds (i8, ptr @_ZZ5solvevE3ctr, i64 8), align 8, !tbaa !5
  %.promoted.8 = load i32, ptr getelementptr inbounds (i8, ptr @_ZZ5solvevE3ctr, i64 4), align 4, !tbaa !5
  %.not17.8 = icmp eq i32 %.promoted.8, 0
  br i1 %.not17.8, label %._crit_edge.8, label %.lr.ph.8

.lr.ph.8:                                         ; preds = %._crit_edge.7, %129
  %.in56 = phi i32 [ %117, %129 ], [ %.promoted.8, %._crit_edge.7 ]
  %.118.8 = phi i32 [ %.pre-phi, %129 ], [ %.1.lcssa.7, %._crit_edge.7 ]
  %117 = add nsw i32 %.in56, -1
  %118 = icmp sgt i32 %.118.8, 0
  br i1 %118, label %125, label %119

119:                                              ; preds = %.lr.ph.8
  %120 = sub nsw i32 0, %.118.8
  %121 = zext nneg i32 %120 to i64
  %122 = getelementptr inbounds [100001 x i8], ptr @_ZZ5solvevE3buf, i64 0, i64 %121
  %123 = load i8, ptr %122, align 1, !tbaa !9
  %124 = add i8 %123, -1
  store i8 %124, ptr %122, align 1, !tbaa !9
  %.pre = add nsw i32 %.118.8, -1
  br label %129

125:                                              ; preds = %.lr.ph.8
  %126 = add nsw i32 %.118.8, -1
  %127 = zext nneg i32 %126 to i64
  %128 = getelementptr inbounds [100001 x i8], ptr @_ZZ5solvevE3buf, i64 0, i64 %127
  store i8 49, ptr %128, align 1, !tbaa !9
  br label %129

129:                                              ; preds = %125, %119
  %.pre-phi = phi i32 [ %126, %125 ], [ %.pre, %119 ]
  %.not.8 = icmp eq i32 %117, 0
  br i1 %.not.8, label %._crit_edge.8, label %.lr.ph.8, !llvm.loop !10

._crit_edge.8:                                    ; preds = %129, %._crit_edge.7
  store i32 -1, ptr getelementptr inbounds (i8, ptr @_ZZ5solvevE3ctr, i64 4), align 4, !tbaa !5
  %130 = icmp sgt i32 %12, 1
  br i1 %130, label %.lr.ph22.preheader, label %.critedge

.lr.ph22.preheader:                               ; preds = %._crit_edge.8
  %131 = zext nneg i32 %12 to i64
  br label %.lr.ph22

.lr.ph22:                                         ; preds = %.lr.ph22.preheader, %135
  %indvars.iv = phi i64 [ %131, %.lr.ph22.preheader ], [ %indvars.iv.next, %135 ]
  %indvars.iv.next = add nsw i64 %indvars.iv, -1
  %132 = getelementptr inbounds [100001 x i8], ptr @_ZZ5solvevE3buf, i64 0, i64 %indvars.iv.next
  %133 = load i8, ptr %132, align 1, !tbaa !9
  %134 = icmp eq i8 %133, 48
  br i1 %134, label %135, label %.critedge.loopexit.split.loop.exit47

135:                                              ; preds = %.lr.ph22
  %136 = trunc nuw nsw i64 %indvars.iv.next to i32
  store i32 %136, ptr %0, align 4, !tbaa !5
  %137 = icmp ugt i64 %indvars.iv, 2
  br i1 %137, label %.lr.ph22, label %.critedge, !llvm.loop !12

.critedge.loopexit.split.loop.exit47:             ; preds = %.lr.ph22
  %138 = trunc nuw nsw i64 %indvars.iv to i32
  br label %.critedge

.critedge:                                        ; preds = %135, %.critedge.loopexit.split.loop.exit47, %._crit_edge.8
  %.lcssa = phi i32 [ %12, %._crit_edge.8 ], [ %138, %.critedge.loopexit.split.loop.exit47 ], [ 1, %135 ]
  %139 = sext i32 %.lcssa to i64
  %140 = getelementptr inbounds i8, ptr @_ZZ5solvevE3buf, i64 %139
  call void @_ZSt7reverseIPcEvT_S1_(ptr noundef nonnull @_ZZ5solvevE3buf, ptr noundef nonnull %140)
  %141 = load i32, ptr %0, align 4, !tbaa !5
  %142 = sext i32 %141 to i64
  %143 = getelementptr inbounds [100001 x i8], ptr @_ZZ5solvevE3buf, i64 0, i64 %142
  store i8 0, ptr %143, align 1, !tbaa !9
  %144 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @_ZZ5solvevE3buf)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %0) #4
  ret void
}

; 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 nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1

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

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

attributes #0 = { 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 #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 = { 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 #4 = { 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}


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