; LLVM IR from tangjz/acm-icpc :: codeforces/1628B.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"

@_ZZ5solvevE2st = external hidden global i32, align 4
@_ZZ5solvevE4tim2 = external hidden global [27 x [27 x i32]], align 16
@_ZZ5solvevE4tim3 = external hidden global [27 x [27 x [27 x i32]]], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@_ZZ5solvevE3buf = external hidden global [4 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.4 = 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 i8, align 1
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %1) #4
  %12 = load i32, ptr @_ZZ5solvevE2st, align 4, !tbaa !5
  %13 = add nsw i32 %12, 1
  store i32 %13, ptr @_ZZ5solvevE2st, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr %2) #4
  store i8 0, ptr %2, align 1, !tbaa !9
  %14 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %1)
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #4
  store i32 0, ptr %3, align 4, !tbaa !5
  br label %15

15:                                               ; preds = %141, %0
  %16 = load i32, ptr %3, align 4, !tbaa !5
  %17 = load i32, ptr %1, align 4, !tbaa !5
  %18 = icmp slt i32 %16, %17
  br i1 %18, label %20, label %19

19:                                               ; preds = %15
  store i32 2, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #4
  br label %144

20:                                               ; preds = %15
  %21 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.2, ptr noundef @_ZZ5solvevE3buf)
  %22 = load i8, ptr %2, align 1, !tbaa !9, !range !11, !noundef !12
  %23 = trunc i8 %22 to i1
  br i1 %23, label %24, label %25

24:                                               ; preds = %20
  br label %141

25:                                               ; preds = %20
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #4
  %26 = call i64 @strlen(ptr noundef @_ZZ5solvevE3buf) #5
  %27 = trunc i64 %26 to i32
  store i32 %27, ptr %5, align 4, !tbaa !5
  %28 = load i8, ptr @_ZZ5solvevE3buf, align 1, !tbaa !13
  %29 = sext i8 %28 to i32
  %30 = load i32, ptr %5, align 4, !tbaa !5
  %31 = sub nsw i32 %30, 1
  %32 = sext i32 %31 to i64
  %33 = getelementptr inbounds [4 x i8], ptr @_ZZ5solvevE3buf, i64 0, i64 %32
  %34 = load i8, ptr %33, align 1, !tbaa !13
  %35 = sext i8 %34 to i32
  %36 = icmp eq i32 %29, %35
  br i1 %36, label %37, label %38

37:                                               ; preds = %25
  store i8 1, ptr %2, align 1, !tbaa !9
  store i32 4, ptr %4, align 4
  br label %138

38:                                               ; preds = %25
  %39 = load i32, ptr %5, align 4, !tbaa !5
  %40 = icmp eq i32 %39, 2
  br i1 %40, label %41, label %93

41:                                               ; preds = %38
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #4
  %42 = load i8, ptr @_ZZ5solvevE3buf, align 1, !tbaa !13
  %43 = sext i8 %42 to i32
  %44 = sub nsw i32 %43, 97
  store i32 %44, ptr %6, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  %45 = load i8, ptr getelementptr inbounds ([4 x i8], ptr @_ZZ5solvevE3buf, i64 0, i64 1), align 1, !tbaa !13
  %46 = sext i8 %45 to i32
  %47 = sub nsw i32 %46, 97
  store i32 %47, ptr %7, align 4, !tbaa !5
  %48 = load i32, ptr %7, align 4, !tbaa !5
  %49 = sext i32 %48 to i64
  %50 = getelementptr inbounds [27 x [27 x i32]], ptr @_ZZ5solvevE4tim2, i64 0, i64 %49
  %51 = load i32, ptr %6, align 4, !tbaa !5
  %52 = sext i32 %51 to i64
  %53 = getelementptr inbounds [27 x i32], ptr %50, i64 0, i64 %52
  %54 = load i32, ptr %53, align 4, !tbaa !5
  %55 = load i32, ptr @_ZZ5solvevE2st, align 4, !tbaa !5
  %56 = icmp eq i32 %54, %55
  br i1 %56, label %57, label %58

57:                                               ; preds = %41
  store i8 1, ptr %2, align 1, !tbaa !9
  store i32 4, ptr %4, align 4
  br label %90

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

59:                                               ; preds = %78, %58
  %60 = load i32, ptr %8, align 4, !tbaa !5
  %61 = icmp slt i32 %60, 26
  br i1 %61, label %63, label %62

62:                                               ; preds = %59
  store i32 5, ptr %4, align 4
  br label %81

63:                                               ; preds = %59
  %64 = load i32, ptr %7, align 4, !tbaa !5
  %65 = sext i32 %64 to i64
  %66 = getelementptr inbounds [27 x [27 x [27 x i32]]], ptr @_ZZ5solvevE4tim3, i64 0, i64 %65
  %67 = load i32, ptr %6, align 4, !tbaa !5
  %68 = sext i32 %67 to i64
  %69 = getelementptr inbounds [27 x [27 x i32]], ptr %66, i64 0, i64 %68
  %70 = load i32, ptr %8, align 4, !tbaa !5
  %71 = sext i32 %70 to i64
  %72 = getelementptr inbounds [27 x i32], ptr %69, i64 0, i64 %71
  %73 = load i32, ptr %72, align 4, !tbaa !5
  %74 = load i32, ptr @_ZZ5solvevE2st, align 4, !tbaa !5
  %75 = icmp eq i32 %73, %74
  br i1 %75, label %76, label %77

76:                                               ; preds = %63
  store i8 1, ptr %2, align 1, !tbaa !9
  store i32 5, ptr %4, align 4
  br label %81

77:                                               ; preds = %63
  br label %78

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

81:                                               ; preds = %76, %62
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  br label %82

82:                                               ; preds = %81
  %83 = load i32, ptr @_ZZ5solvevE2st, align 4, !tbaa !5
  %84 = load i32, ptr %6, align 4, !tbaa !5
  %85 = sext i32 %84 to i64
  %86 = getelementptr inbounds [27 x [27 x i32]], ptr @_ZZ5solvevE4tim2, i64 0, i64 %85
  %87 = load i32, ptr %7, align 4, !tbaa !5
  %88 = sext i32 %87 to i64
  %89 = getelementptr inbounds [27 x i32], ptr %86, i64 0, i64 %88
  store i32 %83, ptr %89, align 4, !tbaa !5
  store i32 0, ptr %4, align 4
  br label %90

90:                                               ; preds = %82, %57
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  %91 = load i32, ptr %4, align 4
  switch i32 %91, label %138 [
    i32 0, label %92
  ]

92:                                               ; preds = %90
  br label %137

93:                                               ; preds = %38
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #4
  %94 = load i8, ptr @_ZZ5solvevE3buf, align 1, !tbaa !13
  %95 = sext i8 %94 to i32
  %96 = sub nsw i32 %95, 97
  store i32 %96, ptr %9, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #4
  %97 = load i8, ptr getelementptr inbounds ([4 x i8], ptr @_ZZ5solvevE3buf, i64 0, i64 1), align 1, !tbaa !13
  %98 = sext i8 %97 to i32
  %99 = sub nsw i32 %98, 97
  store i32 %99, ptr %10, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #4
  %100 = load i8, ptr getelementptr inbounds ([4 x i8], ptr @_ZZ5solvevE3buf, i64 0, i64 2), align 1, !tbaa !13
  %101 = sext i8 %100 to i32
  %102 = sub nsw i32 %101, 97
  store i32 %102, ptr %11, align 4, !tbaa !5
  %103 = load i32, ptr %11, align 4, !tbaa !5
  %104 = sext i32 %103 to i64
  %105 = getelementptr inbounds [27 x [27 x i32]], ptr @_ZZ5solvevE4tim2, i64 0, i64 %104
  %106 = load i32, ptr %10, align 4, !tbaa !5
  %107 = sext i32 %106 to i64
  %108 = getelementptr inbounds [27 x i32], ptr %105, i64 0, i64 %107
  %109 = load i32, ptr %108, align 4, !tbaa !5
  %110 = load i32, ptr @_ZZ5solvevE2st, align 4, !tbaa !5
  %111 = icmp eq i32 %109, %110
  br i1 %111, label %125, label %112

112:                                              ; preds = %93
  %113 = load i32, ptr %11, align 4, !tbaa !5
  %114 = sext i32 %113 to i64
  %115 = getelementptr inbounds [27 x [27 x [27 x i32]]], ptr @_ZZ5solvevE4tim3, i64 0, i64 %114
  %116 = load i32, ptr %10, align 4, !tbaa !5
  %117 = sext i32 %116 to i64
  %118 = getelementptr inbounds [27 x [27 x i32]], ptr %115, i64 0, i64 %117
  %119 = load i32, ptr %9, align 4, !tbaa !5
  %120 = sext i32 %119 to i64
  %121 = getelementptr inbounds [27 x i32], ptr %118, i64 0, i64 %120
  %122 = load i32, ptr %121, align 4, !tbaa !5
  %123 = load i32, ptr @_ZZ5solvevE2st, align 4, !tbaa !5
  %124 = icmp eq i32 %122, %123
  br i1 %124, label %125, label %126

125:                                              ; preds = %112, %93
  store i8 1, ptr %2, align 1, !tbaa !9
  br label %126

126:                                              ; preds = %125, %112
  %127 = load i32, ptr @_ZZ5solvevE2st, align 4, !tbaa !5
  %128 = load i32, ptr %9, align 4, !tbaa !5
  %129 = sext i32 %128 to i64
  %130 = getelementptr inbounds [27 x [27 x [27 x i32]]], ptr @_ZZ5solvevE4tim3, i64 0, i64 %129
  %131 = load i32, ptr %10, align 4, !tbaa !5
  %132 = sext i32 %131 to i64
  %133 = getelementptr inbounds [27 x [27 x i32]], ptr %130, i64 0, i64 %132
  %134 = load i32, ptr %11, align 4, !tbaa !5
  %135 = sext i32 %134 to i64
  %136 = getelementptr inbounds [27 x i32], ptr %133, i64 0, i64 %135
  store i32 %127, ptr %136, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #4
  br label %137

137:                                              ; preds = %126, %92
  store i32 0, ptr %4, align 4
  br label %138

138:                                              ; preds = %137, %90, %37
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #4
  %139 = load i32, ptr %4, align 4
  switch i32 %139, label %150 [
    i32 0, label %140
    i32 4, label %141
  ]

140:                                              ; preds = %138
  br label %141

141:                                              ; preds = %140, %138, %24
  %142 = load i32, ptr %3, align 4, !tbaa !5
  %143 = add nsw i32 %142, 1
  store i32 %143, ptr %3, align 4, !tbaa !5
  br label %15, !llvm.loop !16

144:                                              ; preds = %19
  %145 = load i8, ptr %2, align 1, !tbaa !9, !range !11, !noundef !12
  %146 = trunc i8 %145 to i1
  %147 = zext i1 %146 to i64
  %148 = select i1 %146, ptr @.str.3, ptr @.str.4
  %149 = call i32 @puts(ptr noundef %148)
  call void @llvm.lifetime.end.p0(i64 1, ptr %2) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %1) #4
  ret void

150:                                              ; 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: nounwind willreturn memory(read)
declare i64 @strlen(ptr noundef) #3

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

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 = { 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 }
attributes #5 = { nounwind willreturn memory(read) }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"bool", !7, i64 0}
!11 = !{i8 0, i8 2}
!12 = !{}
!13 = !{!7, !7, i64 0}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}
!16 = distinct !{!16, !15}


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

@_ZZ5solvevE2st = external hidden local_unnamed_addr global i32, align 4
@_ZZ5solvevE4tim2 = external hidden local_unnamed_addr global [27 x [27 x i32]], align 16
@_ZZ5solvevE4tim3 = external hidden local_unnamed_addr global [27 x [27 x [27 x i32]]], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@_ZZ5solvevE3buf = external hidden global [4 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [3 x i8], align 1

; Function Attrs: mustprogress nofree nounwind uwtable
define dso_local void @_Z5solvev() local_unnamed_addr #0 {
  %1 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #4
  %2 = load i32, ptr @_ZZ5solvevE2st, align 4, !tbaa !5
  %3 = add nsw i32 %2, 1
  store i32 %3, ptr @_ZZ5solvevE2st, align 4, !tbaa !5
  %4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %1)
  %5 = load i32, ptr %1, align 4, !tbaa !5
  %6 = icmp sgt i32 %5, 0
  br i1 %6, label %.lr.ph, label %._crit_edge

._crit_edge.loopexit:                             ; preds = %126
  %7 = trunc nuw i8 %.6 to i1
  %8 = select i1 %7, ptr @.str.3, ptr @.str.4
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %0
  %.0.lcssa = phi ptr [ @.str.4, %0 ], [ %8, %._crit_edge.loopexit ]
  %9 = call i32 @puts(ptr noundef nonnull dereferenceable(1) %.0.lcssa)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #4
  ret void

.lr.ph:                                           ; preds = %0, %126
  %.031 = phi i8 [ %.6, %126 ], [ 0, %0 ]
  %.02430 = phi i32 [ %127, %126 ], [ 0, %0 ]
  %10 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull @_ZZ5solvevE3buf)
  %11 = trunc nuw i8 %.031 to i1
  br i1 %11, label %126, label %12

12:                                               ; preds = %.lr.ph
  %13 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) @_ZZ5solvevE3buf) #5
  %14 = load i8, ptr @_ZZ5solvevE3buf, align 1, !tbaa !9
  %15 = shl i64 %13, 32
  %sext = add i64 %15, -4294967296
  %16 = ashr exact i64 %sext, 32
  %17 = getelementptr inbounds [4 x i8], ptr @_ZZ5solvevE3buf, i64 0, i64 %16
  %18 = load i8, ptr %17, align 1, !tbaa !9
  %19 = icmp eq i8 %14, %18
  br i1 %19, label %126, label %20

20:                                               ; preds = %12
  %21 = sext i8 %14 to i32
  %22 = and i64 %13, 4294967295
  %23 = icmp eq i64 %22, 2
  %24 = add nsw i32 %21, -97
  %25 = load i8, ptr getelementptr inbounds (i8, ptr @_ZZ5solvevE3buf, i64 1), align 1, !tbaa !9
  %26 = sext i8 %25 to i64
  %27 = add nsw i64 %26, -97
  br i1 %23, label %28, label %113

28:                                               ; preds = %20
  %29 = sext i32 %24 to i64
  %30 = getelementptr inbounds [27 x [27 x i32]], ptr @_ZZ5solvevE4tim2, i64 0, i64 %27, i64 %29
  %31 = load i32, ptr %30, align 4, !tbaa !5
  %32 = load i32, ptr @_ZZ5solvevE2st, align 4, !tbaa !5
  %.not = icmp eq i32 %31, %32
  br i1 %.not, label %126, label %.preheader.preheader

.preheader.preheader:                             ; preds = %28
  %33 = getelementptr inbounds [27 x [27 x [27 x i32]]], ptr @_ZZ5solvevE4tim3, i64 0, i64 %27, i64 %29, i64 0
  %34 = load i32, ptr %33, align 4, !tbaa !5
  %35 = icmp eq i32 %34, %32
  br i1 %35, label %111, label %.preheader.1

.preheader.1:                                     ; preds = %.preheader.preheader
  %36 = getelementptr inbounds [27 x [27 x [27 x i32]]], ptr @_ZZ5solvevE4tim3, i64 0, i64 %27, i64 %29, i64 1
  %37 = load i32, ptr %36, align 4, !tbaa !5
  %38 = icmp eq i32 %37, %32
  br i1 %38, label %111, label %.preheader.2

.preheader.2:                                     ; preds = %.preheader.1
  %39 = getelementptr inbounds [27 x [27 x [27 x i32]]], ptr @_ZZ5solvevE4tim3, i64 0, i64 %27, i64 %29, i64 2
  %40 = load i32, ptr %39, align 4, !tbaa !5
  %41 = icmp eq i32 %40, %32
  br i1 %41, label %111, label %.preheader.3

.preheader.3:                                     ; preds = %.preheader.2
  %42 = getelementptr inbounds [27 x [27 x [27 x i32]]], ptr @_ZZ5solvevE4tim3, i64 0, i64 %27, i64 %29, i64 3
  %43 = load i32, ptr %42, align 4, !tbaa !5
  %44 = icmp eq i32 %43, %32
  br i1 %44, label %111, label %.preheader.4

.preheader.4:                                     ; preds = %.preheader.3
  %45 = getelementptr inbounds [27 x [27 x [27 x i32]]], ptr @_ZZ5solvevE4tim3, i64 0, i64 %27, i64 %29, i64 4
  %46 = load i32, ptr %45, align 4, !tbaa !5
  %47 = icmp eq i32 %46, %32
  br i1 %47, label %111, label %.preheader.5

.preheader.5:                                     ; preds = %.preheader.4
  %48 = getelementptr inbounds [27 x [27 x [27 x i32]]], ptr @_ZZ5solvevE4tim3, i64 0, i64 %27, i64 %29, i64 5
  %49 = load i32, ptr %48, align 4, !tbaa !5
  %50 = icmp eq i32 %49, %32
  br i1 %50, label %111, label %.preheader.6

.preheader.6:                                     ; preds = %.preheader.5
  %51 = getelementptr inbounds [27 x [27 x [27 x i32]]], ptr @_ZZ5solvevE4tim3, i64 0, i64 %27, i64 %29, i64 6
  %52 = load i32, ptr %51, align 4, !tbaa !5
  %53 = icmp eq i32 %52, %32
  br i1 %53, label %111, label %.preheader.7

.preheader.7:                                     ; preds = %.preheader.6
  %54 = getelementptr inbounds [27 x [27 x [27 x i32]]], ptr @_ZZ5solvevE4tim3, i64 0, i64 %27, i64 %29, i64 7
  %55 = load i32, ptr %54, align 4, !tbaa !5
  %56 = icmp eq i32 %55, %32
  br i1 %56, label %111, label %.preheader.8

.preheader.8:                                     ; preds = %.preheader.7
  %57 = getelementptr inbounds [27 x [27 x [27 x i32]]], ptr @_ZZ5solvevE4tim3, i64 0, i64 %27, i64 %29, i64 8
  %58 = load i32, ptr %57, align 4, !tbaa !5
  %59 = icmp eq i32 %58, %32
  br i1 %59, label %111, label %.preheader.9

.preheader.9:                                     ; preds = %.preheader.8
  %60 = getelementptr inbounds [27 x [27 x [27 x i32]]], ptr @_ZZ5solvevE4tim3, i64 0, i64 %27, i64 %29, i64 9
  %61 = load i32, ptr %60, align 4, !tbaa !5
  %62 = icmp eq i32 %61, %32
  br i1 %62, label %111, label %.preheader.10

.preheader.10:                                    ; preds = %.preheader.9
  %63 = getelementptr inbounds [27 x [27 x [27 x i32]]], ptr @_ZZ5solvevE4tim3, i64 0, i64 %27, i64 %29, i64 10
  %64 = load i32, ptr %63, align 4, !tbaa !5
  %65 = icmp eq i32 %64, %32
  br i1 %65, label %111, label %.preheader.11

.preheader.11:                                    ; preds = %.preheader.10
  %66 = getelementptr inbounds [27 x [27 x [27 x i32]]], ptr @_ZZ5solvevE4tim3, i64 0, i64 %27, i64 %29, i64 11
  %67 = load i32, ptr %66, align 4, !tbaa !5
  %68 = icmp eq i32 %67, %32
  br i1 %68, label %111, label %.preheader.12

.preheader.12:                                    ; preds = %.preheader.11
  %69 = getelementptr inbounds [27 x [27 x [27 x i32]]], ptr @_ZZ5solvevE4tim3, i64 0, i64 %27, i64 %29, i64 12
  %70 = load i32, ptr %69, align 4, !tbaa !5
  %71 = icmp eq i32 %70, %32
  br i1 %71, label %111, label %.preheader.13

.preheader.13:                                    ; preds = %.preheader.12
  %72 = getelementptr inbounds [27 x [27 x [27 x i32]]], ptr @_ZZ5solvevE4tim3, i64 0, i64 %27, i64 %29, i64 13
  %73 = load i32, ptr %72, align 4, !tbaa !5
  %74 = icmp eq i32 %73, %32
  br i1 %74, label %111, label %.preheader.14

.preheader.14:                                    ; preds = %.preheader.13
  %75 = getelementptr inbounds [27 x [27 x [27 x i32]]], ptr @_ZZ5solvevE4tim3, i64 0, i64 %27, i64 %29, i64 14
  %76 = load i32, ptr %75, align 4, !tbaa !5
  %77 = icmp eq i32 %76, %32
  br i1 %77, label %111, label %.preheader.15

.preheader.15:                                    ; preds = %.preheader.14
  %78 = getelementptr inbounds [27 x [27 x [27 x i32]]], ptr @_ZZ5solvevE4tim3, i64 0, i64 %27, i64 %29, i64 15
  %79 = load i32, ptr %78, align 4, !tbaa !5
  %80 = icmp eq i32 %79, %32
  br i1 %80, label %111, label %.preheader.16

.preheader.16:                                    ; preds = %.preheader.15
  %81 = getelementptr inbounds [27 x [27 x [27 x i32]]], ptr @_ZZ5solvevE4tim3, i64 0, i64 %27, i64 %29, i64 16
  %82 = load i32, ptr %81, align 4, !tbaa !5
  %83 = icmp eq i32 %82, %32
  br i1 %83, label %111, label %.preheader.17

.preheader.17:                                    ; preds = %.preheader.16
  %84 = getelementptr inbounds [27 x [27 x [27 x i32]]], ptr @_ZZ5solvevE4tim3, i64 0, i64 %27, i64 %29, i64 17
  %85 = load i32, ptr %84, align 4, !tbaa !5
  %86 = icmp eq i32 %85, %32
  br i1 %86, label %111, label %.preheader.18

.preheader.18:                                    ; preds = %.preheader.17
  %87 = getelementptr inbounds [27 x [27 x [27 x i32]]], ptr @_ZZ5solvevE4tim3, i64 0, i64 %27, i64 %29, i64 18
  %88 = load i32, ptr %87, align 4, !tbaa !5
  %89 = icmp eq i32 %88, %32
  br i1 %89, label %111, label %.preheader.19

.preheader.19:                                    ; preds = %.preheader.18
  %90 = getelementptr inbounds [27 x [27 x [27 x i32]]], ptr @_ZZ5solvevE4tim3, i64 0, i64 %27, i64 %29, i64 19
  %91 = load i32, ptr %90, align 4, !tbaa !5
  %92 = icmp eq i32 %91, %32
  br i1 %92, label %111, label %.preheader.20

.preheader.20:                                    ; preds = %.preheader.19
  %93 = getelementptr inbounds [27 x [27 x [27 x i32]]], ptr @_ZZ5solvevE4tim3, i64 0, i64 %27, i64 %29, i64 20
  %94 = load i32, ptr %93, align 4, !tbaa !5
  %95 = icmp eq i32 %94, %32
  br i1 %95, label %111, label %.preheader.21

.preheader.21:                                    ; preds = %.preheader.20
  %96 = getelementptr inbounds [27 x [27 x [27 x i32]]], ptr @_ZZ5solvevE4tim3, i64 0, i64 %27, i64 %29, i64 21
  %97 = load i32, ptr %96, align 4, !tbaa !5
  %98 = icmp eq i32 %97, %32
  br i1 %98, label %111, label %.preheader.22

.preheader.22:                                    ; preds = %.preheader.21
  %99 = getelementptr inbounds [27 x [27 x [27 x i32]]], ptr @_ZZ5solvevE4tim3, i64 0, i64 %27, i64 %29, i64 22
  %100 = load i32, ptr %99, align 4, !tbaa !5
  %101 = icmp eq i32 %100, %32
  br i1 %101, label %111, label %.preheader.23

.preheader.23:                                    ; preds = %.preheader.22
  %102 = getelementptr inbounds [27 x [27 x [27 x i32]]], ptr @_ZZ5solvevE4tim3, i64 0, i64 %27, i64 %29, i64 23
  %103 = load i32, ptr %102, align 4, !tbaa !5
  %104 = icmp eq i32 %103, %32
  br i1 %104, label %111, label %.preheader.24

.preheader.24:                                    ; preds = %.preheader.23
  %105 = getelementptr inbounds [27 x [27 x [27 x i32]]], ptr @_ZZ5solvevE4tim3, i64 0, i64 %27, i64 %29, i64 24
  %106 = load i32, ptr %105, align 4, !tbaa !5
  %107 = icmp eq i32 %106, %32
  br i1 %107, label %111, label %.preheader.25

.preheader.25:                                    ; preds = %.preheader.24
  %108 = getelementptr inbounds [27 x [27 x [27 x i32]]], ptr @_ZZ5solvevE4tim3, i64 0, i64 %27, i64 %29, i64 25
  %109 = load i32, ptr %108, align 4, !tbaa !5
  %110 = icmp eq i32 %109, %32
  %spec.select = select i1 %110, i8 1, i8 %.031
  br label %111

111:                                              ; preds = %.preheader.25, %.preheader.24, %.preheader.23, %.preheader.22, %.preheader.21, %.preheader.20, %.preheader.19, %.preheader.18, %.preheader.17, %.preheader.16, %.preheader.15, %.preheader.14, %.preheader.13, %.preheader.12, %.preheader.11, %.preheader.10, %.preheader.9, %.preheader.8, %.preheader.7, %.preheader.6, %.preheader.5, %.preheader.4, %.preheader.3, %.preheader.2, %.preheader.1, %.preheader.preheader
  %.1 = phi i8 [ 1, %.preheader.preheader ], [ 1, %.preheader.1 ], [ 1, %.preheader.2 ], [ 1, %.preheader.3 ], [ 1, %.preheader.4 ], [ 1, %.preheader.5 ], [ 1, %.preheader.6 ], [ 1, %.preheader.7 ], [ 1, %.preheader.8 ], [ 1, %.preheader.9 ], [ 1, %.preheader.10 ], [ 1, %.preheader.11 ], [ 1, %.preheader.12 ], [ 1, %.preheader.13 ], [ 1, %.preheader.14 ], [ 1, %.preheader.15 ], [ 1, %.preheader.16 ], [ 1, %.preheader.17 ], [ 1, %.preheader.18 ], [ 1, %.preheader.19 ], [ 1, %.preheader.20 ], [ 1, %.preheader.21 ], [ 1, %.preheader.22 ], [ 1, %.preheader.23 ], [ 1, %.preheader.24 ], [ %spec.select, %.preheader.25 ]
  %112 = getelementptr inbounds [27 x [27 x i32]], ptr @_ZZ5solvevE4tim2, i64 0, i64 %29, i64 %27
  store i32 %32, ptr %112, align 4, !tbaa !5
  br label %126

113:                                              ; preds = %20
  %114 = load i8, ptr getelementptr inbounds (i8, ptr @_ZZ5solvevE3buf, i64 2), align 1, !tbaa !9
  %115 = sext i8 %114 to i64
  %116 = add nsw i64 %115, -97
  %117 = getelementptr inbounds [27 x [27 x i32]], ptr @_ZZ5solvevE4tim2, i64 0, i64 %116, i64 %27
  %118 = load i32, ptr %117, align 4, !tbaa !5
  %119 = load i32, ptr @_ZZ5solvevE2st, align 4, !tbaa !5
  %120 = icmp eq i32 %118, %119
  %.pre34 = sext i32 %24 to i64
  br i1 %120, label %._crit_edge33, label %121

121:                                              ; preds = %113
  %122 = getelementptr inbounds [27 x [27 x [27 x i32]]], ptr @_ZZ5solvevE4tim3, i64 0, i64 %116, i64 %27, i64 %.pre34
  %123 = load i32, ptr %122, align 4, !tbaa !5
  %124 = icmp eq i32 %123, %119
  %spec.select35 = select i1 %124, i8 1, i8 %.031
  br label %._crit_edge33

._crit_edge33:                                    ; preds = %121, %113
  %.3 = phi i8 [ 1, %113 ], [ %spec.select35, %121 ]
  %125 = getelementptr inbounds [27 x [27 x [27 x i32]]], ptr @_ZZ5solvevE4tim3, i64 0, i64 %.pre34, i64 %27, i64 %116
  store i32 %119, ptr %125, align 4, !tbaa !5
  br label %126

126:                                              ; preds = %111, %28, %12, %._crit_edge33, %.lr.ph
  %.6 = phi i8 [ %.031, %.lr.ph ], [ 1, %12 ], [ %.3, %._crit_edge33 ], [ %.1, %111 ], [ 1, %28 ]
  %127 = add nuw nsw i32 %.02430, 1
  %128 = load i32, ptr %1, align 4, !tbaa !5
  %129 = icmp slt i32 %127, %128
  br i1 %129, label %.lr.ph, label %._crit_edge.loopexit, !llvm.loop !10
}

; 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 i64 @strlen(ptr nocapture noundef) local_unnamed_addr #3

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

attributes #0 = { mustprogress nofree 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"}


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