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

@_ZZ5solvevE3row = external hidden global [27 x [101 x i32]], align 16
@_ZZ5solvevE3col = external hidden global [27 x [101 x i32]], align 16
@_ZZ5solvevE3buf = external hidden global [10001 x i8], align 16
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.2 = 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
  %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
  %12 = alloca i32, align 4
  %13 = 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
  %14 = 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 0, ptr %3, align 4, !tbaa !5
  br label %15

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

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

19:                                               ; preds = %15
  %20 = load i32, ptr %3, align 4, !tbaa !5
  %21 = sext i32 %20 to i64
  %22 = getelementptr inbounds [27 x [101 x i32]], ptr @_ZZ5solvevE3row, i64 0, i64 %21
  %23 = getelementptr inbounds [101 x i32], ptr %22, i64 0, i64 0
  %24 = load i32, ptr %1, align 4, !tbaa !5
  %25 = sext i32 %24 to i64
  %26 = mul i64 %25, 4
  call void @llvm.memset.p0.i64(ptr align 4 %23, i8 0, i64 %26, i1 false)
  %27 = load i32, ptr %3, align 4, !tbaa !5
  %28 = sext i32 %27 to i64
  %29 = getelementptr inbounds [27 x [101 x i32]], ptr @_ZZ5solvevE3col, i64 0, i64 %28
  %30 = getelementptr inbounds [101 x i32], ptr %29, i64 0, i64 0
  %31 = load i32, ptr %2, align 4, !tbaa !5
  %32 = sext i32 %31 to i64
  %33 = mul i64 %32, 4
  call void @llvm.memset.p0.i64(ptr align 4 %30, i8 0, i64 %33, i1 false)
  br label %34

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

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

38:                                               ; preds = %82, %37
  %39 = load i32, ptr %4, align 4, !tbaa !5
  %40 = load i32, ptr %1, align 4, !tbaa !5
  %41 = icmp slt i32 %39, %40
  br i1 %41, label %43, label %42

42:                                               ; preds = %38
  store i32 5, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #4
  br label %85

43:                                               ; preds = %38
  %44 = load i32, ptr %5, align 4, !tbaa !5
  %45 = sext i32 %44 to i64
  %46 = getelementptr inbounds i8, ptr @_ZZ5solvevE3buf, i64 %45
  %47 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.2, ptr noundef %46)
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  store i32 0, ptr %7, align 4, !tbaa !5
  br label %48

48:                                               ; preds = %76, %43
  %49 = load i32, ptr %7, align 4, !tbaa !5
  %50 = load i32, ptr %2, align 4, !tbaa !5
  %51 = icmp slt i32 %49, %50
  br i1 %51, label %53, label %52

52:                                               ; preds = %48
  store i32 8, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  br label %81

53:                                               ; preds = %48
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #4
  %54 = load i32, ptr %5, align 4, !tbaa !5
  %55 = sext i32 %54 to i64
  %56 = getelementptr inbounds [10001 x i8], ptr @_ZZ5solvevE3buf, i64 0, i64 %55
  %57 = load i8, ptr %56, align 1, !tbaa !11
  %58 = sext i8 %57 to i32
  %59 = sub nsw i32 %58, 97
  store i32 %59, ptr %8, align 4, !tbaa !5
  %60 = load i32, ptr %8, align 4, !tbaa !5
  %61 = sext i32 %60 to i64
  %62 = getelementptr inbounds [27 x [101 x i32]], ptr @_ZZ5solvevE3row, i64 0, i64 %61
  %63 = load i32, ptr %4, align 4, !tbaa !5
  %64 = sext i32 %63 to i64
  %65 = getelementptr inbounds [101 x i32], ptr %62, i64 0, i64 %64
  %66 = load i32, ptr %65, align 4, !tbaa !5
  %67 = add nsw i32 %66, 1
  store i32 %67, ptr %65, align 4, !tbaa !5
  %68 = load i32, ptr %8, align 4, !tbaa !5
  %69 = sext i32 %68 to i64
  %70 = getelementptr inbounds [27 x [101 x i32]], ptr @_ZZ5solvevE3col, i64 0, i64 %69
  %71 = load i32, ptr %7, align 4, !tbaa !5
  %72 = sext i32 %71 to i64
  %73 = getelementptr inbounds [101 x i32], ptr %70, i64 0, i64 %72
  %74 = load i32, ptr %73, align 4, !tbaa !5
  %75 = add nsw i32 %74, 1
  store i32 %75, ptr %73, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  br label %76

76:                                               ; preds = %53
  %77 = load i32, ptr %7, align 4, !tbaa !5
  %78 = add nsw i32 %77, 1
  store i32 %78, ptr %7, align 4, !tbaa !5
  %79 = load i32, ptr %5, align 4, !tbaa !5
  %80 = add nsw i32 %79, 1
  store i32 %80, ptr %5, align 4, !tbaa !5
  br label %48, !llvm.loop !12

81:                                               ; preds = %52
  br label %82

82:                                               ; preds = %81
  %83 = load i32, ptr %4, align 4, !tbaa !5
  %84 = add nsw i32 %83, 1
  store i32 %84, ptr %4, align 4, !tbaa !5
  br label %38, !llvm.loop !13

85:                                               ; preds = %42
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #4
  store i32 0, ptr %9, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #4
  store i32 0, ptr %10, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #4
  store i32 0, ptr %11, align 4, !tbaa !5
  br label %86

86:                                               ; preds = %137, %85
  %87 = load i32, ptr %10, align 4, !tbaa !5
  %88 = load i32, ptr %1, align 4, !tbaa !5
  %89 = icmp slt i32 %87, %88
  br i1 %89, label %91, label %90

90:                                               ; preds = %86
  store i32 11, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  br label %140

91:                                               ; preds = %86
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #4
  store i32 0, ptr %12, align 4, !tbaa !5
  br label %92

92:                                               ; preds = %131, %91
  %93 = load i32, ptr %12, align 4, !tbaa !5
  %94 = load i32, ptr %2, align 4, !tbaa !5
  %95 = icmp slt i32 %93, %94
  br i1 %95, label %97, label %96

96:                                               ; preds = %92
  store i32 14, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #4
  br label %136

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

112:                                              ; preds = %97
  %113 = load i32, ptr %13, align 4, !tbaa !5
  %114 = sext i32 %113 to i64
  %115 = getelementptr inbounds [27 x [101 x i32]], ptr @_ZZ5solvevE3col, i64 0, i64 %114
  %116 = load i32, ptr %12, align 4, !tbaa !5
  %117 = sext i32 %116 to i64
  %118 = getelementptr inbounds [101 x i32], ptr %115, i64 0, i64 %117
  %119 = load i32, ptr %118, align 4, !tbaa !5
  %120 = icmp eq i32 %119, 1
  br i1 %120, label %121, label %130

121:                                              ; preds = %112
  %122 = load i32, ptr %11, align 4, !tbaa !5
  %123 = sext i32 %122 to i64
  %124 = getelementptr inbounds [10001 x i8], ptr @_ZZ5solvevE3buf, i64 0, i64 %123
  %125 = load i8, ptr %124, align 1, !tbaa !11
  %126 = load i32, ptr %9, align 4, !tbaa !5
  %127 = add nsw i32 %126, 1
  store i32 %127, ptr %9, align 4, !tbaa !5
  %128 = sext i32 %126 to i64
  %129 = getelementptr inbounds [10001 x i8], ptr @_ZZ5solvevE3buf, i64 0, i64 %128
  store i8 %125, ptr %129, align 1, !tbaa !11
  br label %130

130:                                              ; preds = %121, %112, %97
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #4
  br label %131

131:                                              ; preds = %130
  %132 = load i32, ptr %12, align 4, !tbaa !5
  %133 = add nsw i32 %132, 1
  store i32 %133, ptr %12, align 4, !tbaa !5
  %134 = load i32, ptr %11, align 4, !tbaa !5
  %135 = add nsw i32 %134, 1
  store i32 %135, ptr %11, align 4, !tbaa !5
  br label %92, !llvm.loop !14

136:                                              ; preds = %96
  br label %137

137:                                              ; preds = %136
  %138 = load i32, ptr %10, align 4, !tbaa !5
  %139 = add nsw i32 %138, 1
  store i32 %139, ptr %10, align 4, !tbaa !5
  br label %86, !llvm.loop !15

140:                                              ; preds = %90
  %141 = load i32, ptr %9, align 4, !tbaa !5
  %142 = sext i32 %141 to i64
  %143 = getelementptr inbounds [10001 x i8], ptr @_ZZ5solvevE3buf, i64 0, i64 %142
  store i8 0, ptr %143, align 1, !tbaa !11
  %144 = call i32 @puts(ptr noundef @_ZZ5solvevE3buf)
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #4
  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 nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
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}
!15 = distinct !{!15, !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"

@_ZZ5solvevE3row = external hidden local_unnamed_addr global [27 x [101 x i32]], align 16
@_ZZ5solvevE3col = external hidden local_unnamed_addr global [27 x [101 x i32]], align 16
@_ZZ5solvevE3buf = external hidden global [10001 x i8], align 16
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.2 = 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 {
.preheader38:
  %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 = load i32, ptr %0, align 4, !tbaa !5
  %4 = sext i32 %3 to i64
  %5 = shl nsw i64 %4, 2
  %6 = load i32, ptr %1, align 4, !tbaa !5
  %7 = sext i32 %6 to i64
  %8 = shl nsw i64 %7, 2
  call void @llvm.memset.p0.i64(ptr nonnull align 16 @_ZZ5solvevE3row, i8 0, i64 %5, i1 false)
  call void @llvm.memset.p0.i64(ptr nonnull align 16 @_ZZ5solvevE3col, i8 0, i64 %8, i1 false)
  call void @llvm.memset.p0.i64(ptr nonnull align 4 getelementptr inbounds (i8, ptr @_ZZ5solvevE3row, i64 404), i8 0, i64 %5, i1 false)
  call void @llvm.memset.p0.i64(ptr nonnull align 4 getelementptr inbounds (i8, ptr @_ZZ5solvevE3col, i64 404), i8 0, i64 %8, i1 false)
  call void @llvm.memset.p0.i64(ptr nonnull align 8 getelementptr inbounds (i8, ptr @_ZZ5solvevE3row, i64 808), i8 0, i64 %5, i1 false)
  call void @llvm.memset.p0.i64(ptr nonnull align 8 getelementptr inbounds (i8, ptr @_ZZ5solvevE3col, i64 808), i8 0, i64 %8, i1 false)
  call void @llvm.memset.p0.i64(ptr nonnull align 4 getelementptr inbounds (i8, ptr @_ZZ5solvevE3row, i64 1212), i8 0, i64 %5, i1 false)
  call void @llvm.memset.p0.i64(ptr nonnull align 4 getelementptr inbounds (i8, ptr @_ZZ5solvevE3col, i64 1212), i8 0, i64 %8, i1 false)
  call void @llvm.memset.p0.i64(ptr nonnull align 16 getelementptr inbounds (i8, ptr @_ZZ5solvevE3row, i64 1616), i8 0, i64 %5, i1 false)
  call void @llvm.memset.p0.i64(ptr nonnull align 16 getelementptr inbounds (i8, ptr @_ZZ5solvevE3col, i64 1616), i8 0, i64 %8, i1 false)
  call void @llvm.memset.p0.i64(ptr nonnull align 4 getelementptr inbounds (i8, ptr @_ZZ5solvevE3row, i64 2020), i8 0, i64 %5, i1 false)
  call void @llvm.memset.p0.i64(ptr nonnull align 4 getelementptr inbounds (i8, ptr @_ZZ5solvevE3col, i64 2020), i8 0, i64 %8, i1 false)
  call void @llvm.memset.p0.i64(ptr nonnull align 8 getelementptr inbounds (i8, ptr @_ZZ5solvevE3row, i64 2424), i8 0, i64 %5, i1 false)
  call void @llvm.memset.p0.i64(ptr nonnull align 8 getelementptr inbounds (i8, ptr @_ZZ5solvevE3col, i64 2424), i8 0, i64 %8, i1 false)
  call void @llvm.memset.p0.i64(ptr nonnull align 4 getelementptr inbounds (i8, ptr @_ZZ5solvevE3row, i64 2828), i8 0, i64 %5, i1 false)
  call void @llvm.memset.p0.i64(ptr nonnull align 4 getelementptr inbounds (i8, ptr @_ZZ5solvevE3col, i64 2828), i8 0, i64 %8, i1 false)
  call void @llvm.memset.p0.i64(ptr nonnull align 16 getelementptr inbounds (i8, ptr @_ZZ5solvevE3row, i64 3232), i8 0, i64 %5, i1 false)
  call void @llvm.memset.p0.i64(ptr nonnull align 16 getelementptr inbounds (i8, ptr @_ZZ5solvevE3col, i64 3232), i8 0, i64 %8, i1 false)
  call void @llvm.memset.p0.i64(ptr nonnull align 4 getelementptr inbounds (i8, ptr @_ZZ5solvevE3row, i64 3636), i8 0, i64 %5, i1 false)
  call void @llvm.memset.p0.i64(ptr nonnull align 4 getelementptr inbounds (i8, ptr @_ZZ5solvevE3col, i64 3636), i8 0, i64 %8, i1 false)
  call void @llvm.memset.p0.i64(ptr nonnull align 8 getelementptr inbounds (i8, ptr @_ZZ5solvevE3row, i64 4040), i8 0, i64 %5, i1 false)
  call void @llvm.memset.p0.i64(ptr nonnull align 8 getelementptr inbounds (i8, ptr @_ZZ5solvevE3col, i64 4040), i8 0, i64 %8, i1 false)
  call void @llvm.memset.p0.i64(ptr nonnull align 4 getelementptr inbounds (i8, ptr @_ZZ5solvevE3row, i64 4444), i8 0, i64 %5, i1 false)
  call void @llvm.memset.p0.i64(ptr nonnull align 4 getelementptr inbounds (i8, ptr @_ZZ5solvevE3col, i64 4444), i8 0, i64 %8, i1 false)
  call void @llvm.memset.p0.i64(ptr nonnull align 16 getelementptr inbounds (i8, ptr @_ZZ5solvevE3row, i64 4848), i8 0, i64 %5, i1 false)
  call void @llvm.memset.p0.i64(ptr nonnull align 16 getelementptr inbounds (i8, ptr @_ZZ5solvevE3col, i64 4848), i8 0, i64 %8, i1 false)
  call void @llvm.memset.p0.i64(ptr nonnull align 4 getelementptr inbounds (i8, ptr @_ZZ5solvevE3row, i64 5252), i8 0, i64 %5, i1 false)
  call void @llvm.memset.p0.i64(ptr nonnull align 4 getelementptr inbounds (i8, ptr @_ZZ5solvevE3col, i64 5252), i8 0, i64 %8, i1 false)
  call void @llvm.memset.p0.i64(ptr nonnull align 8 getelementptr inbounds (i8, ptr @_ZZ5solvevE3row, i64 5656), i8 0, i64 %5, i1 false)
  call void @llvm.memset.p0.i64(ptr nonnull align 8 getelementptr inbounds (i8, ptr @_ZZ5solvevE3col, i64 5656), i8 0, i64 %8, i1 false)
  call void @llvm.memset.p0.i64(ptr nonnull align 4 getelementptr inbounds (i8, ptr @_ZZ5solvevE3row, i64 6060), i8 0, i64 %5, i1 false)
  call void @llvm.memset.p0.i64(ptr nonnull align 4 getelementptr inbounds (i8, ptr @_ZZ5solvevE3col, i64 6060), i8 0, i64 %8, i1 false)
  call void @llvm.memset.p0.i64(ptr nonnull align 16 getelementptr inbounds (i8, ptr @_ZZ5solvevE3row, i64 6464), i8 0, i64 %5, i1 false)
  call void @llvm.memset.p0.i64(ptr nonnull align 16 getelementptr inbounds (i8, ptr @_ZZ5solvevE3col, i64 6464), i8 0, i64 %8, i1 false)
  call void @llvm.memset.p0.i64(ptr nonnull align 4 getelementptr inbounds (i8, ptr @_ZZ5solvevE3row, i64 6868), i8 0, i64 %5, i1 false)
  call void @llvm.memset.p0.i64(ptr nonnull align 4 getelementptr inbounds (i8, ptr @_ZZ5solvevE3col, i64 6868), i8 0, i64 %8, i1 false)
  call void @llvm.memset.p0.i64(ptr nonnull align 8 getelementptr inbounds (i8, ptr @_ZZ5solvevE3row, i64 7272), i8 0, i64 %5, i1 false)
  call void @llvm.memset.p0.i64(ptr nonnull align 8 getelementptr inbounds (i8, ptr @_ZZ5solvevE3col, i64 7272), i8 0, i64 %8, i1 false)
  call void @llvm.memset.p0.i64(ptr nonnull align 4 getelementptr inbounds (i8, ptr @_ZZ5solvevE3row, i64 7676), i8 0, i64 %5, i1 false)
  call void @llvm.memset.p0.i64(ptr nonnull align 4 getelementptr inbounds (i8, ptr @_ZZ5solvevE3col, i64 7676), i8 0, i64 %8, i1 false)
  call void @llvm.memset.p0.i64(ptr nonnull align 16 getelementptr inbounds (i8, ptr @_ZZ5solvevE3row, i64 8080), i8 0, i64 %5, i1 false)
  call void @llvm.memset.p0.i64(ptr nonnull align 16 getelementptr inbounds (i8, ptr @_ZZ5solvevE3col, i64 8080), i8 0, i64 %8, i1 false)
  call void @llvm.memset.p0.i64(ptr nonnull align 4 getelementptr inbounds (i8, ptr @_ZZ5solvevE3row, i64 8484), i8 0, i64 %5, i1 false)
  call void @llvm.memset.p0.i64(ptr nonnull align 4 getelementptr inbounds (i8, ptr @_ZZ5solvevE3col, i64 8484), i8 0, i64 %8, i1 false)
  call void @llvm.memset.p0.i64(ptr nonnull align 8 getelementptr inbounds (i8, ptr @_ZZ5solvevE3row, i64 8888), i8 0, i64 %5, i1 false)
  call void @llvm.memset.p0.i64(ptr nonnull align 8 getelementptr inbounds (i8, ptr @_ZZ5solvevE3col, i64 8888), i8 0, i64 %8, i1 false)
  call void @llvm.memset.p0.i64(ptr nonnull align 4 getelementptr inbounds (i8, ptr @_ZZ5solvevE3row, i64 9292), i8 0, i64 %5, i1 false)
  call void @llvm.memset.p0.i64(ptr nonnull align 4 getelementptr inbounds (i8, ptr @_ZZ5solvevE3col, i64 9292), i8 0, i64 %8, i1 false)
  call void @llvm.memset.p0.i64(ptr nonnull align 16 getelementptr inbounds (i8, ptr @_ZZ5solvevE3row, i64 9696), i8 0, i64 %5, i1 false)
  call void @llvm.memset.p0.i64(ptr nonnull align 16 getelementptr inbounds (i8, ptr @_ZZ5solvevE3col, i64 9696), i8 0, i64 %8, i1 false)
  call void @llvm.memset.p0.i64(ptr nonnull align 4 getelementptr inbounds (i8, ptr @_ZZ5solvevE3row, i64 10100), i8 0, i64 %5, i1 false)
  call void @llvm.memset.p0.i64(ptr nonnull align 4 getelementptr inbounds (i8, ptr @_ZZ5solvevE3col, i64 10100), i8 0, i64 %8, i1 false)
  %9 = icmp sgt i32 %3, 0
  br i1 %9, label %.lr.ph44, label %._crit_edge56

.preheader37:                                     ; preds = %._crit_edge
  %10 = icmp sgt i32 %36, 0
  %11 = icmp sgt i32 %33, 0
  %or.cond = and i1 %10, %11
  br i1 %or.cond, label %.preheader.us.preheader, label %._crit_edge56

.preheader.us.preheader:                          ; preds = %.preheader37
  %wide.trip.count83 = zext nneg i32 %36 to i64
  %wide.trip.count78 = zext nneg i32 %33 to i64
  br label %.preheader.us

.preheader.us:                                    ; preds = %.preheader.us.preheader, %._crit_edge50.us
  %indvars.iv80 = phi i64 [ 0, %.preheader.us.preheader ], [ %indvars.iv.next81, %._crit_edge50.us ]
  %.02955.us = phi i64 [ 0, %.preheader.us.preheader ], [ %indvars.iv.next74, %._crit_edge50.us ]
  %.03153.us = phi i32 [ 0, %.preheader.us.preheader ], [ %.2.us, %._crit_edge50.us ]
  %sext = shl i64 %.02955.us, 32
  %12 = ashr exact i64 %sext, 32
  br label %13

13:                                               ; preds = %.preheader.us, %29
  %indvars.iv73 = phi i64 [ %12, %.preheader.us ], [ %indvars.iv.next74, %29 ]
  %indvars.iv71 = phi i64 [ 0, %.preheader.us ], [ %indvars.iv.next72, %29 ]
  %.13246.us = phi i32 [ %.03153.us, %.preheader.us ], [ %.2.us, %29 ]
  %14 = getelementptr inbounds [10001 x i8], ptr @_ZZ5solvevE3buf, i64 0, i64 %indvars.iv73
  %15 = load i8, ptr %14, align 1, !tbaa !9
  %16 = sext i8 %15 to i64
  %17 = add nsw i64 %16, -97
  %18 = getelementptr inbounds [27 x [101 x i32]], ptr @_ZZ5solvevE3row, i64 0, i64 %17, i64 %indvars.iv80
  %19 = load i32, ptr %18, align 4, !tbaa !5
  %20 = icmp eq i32 %19, 1
  br i1 %20, label %21, label %29

21:                                               ; preds = %13
  %22 = getelementptr inbounds [27 x [101 x i32]], ptr @_ZZ5solvevE3col, i64 0, i64 %17, i64 %indvars.iv71
  %23 = load i32, ptr %22, align 4, !tbaa !5
  %24 = icmp eq i32 %23, 1
  br i1 %24, label %25, label %29

25:                                               ; preds = %21
  %26 = add nsw i32 %.13246.us, 1
  %27 = sext i32 %.13246.us to i64
  %28 = getelementptr inbounds [10001 x i8], ptr @_ZZ5solvevE3buf, i64 0, i64 %27
  store i8 %15, ptr %28, align 1, !tbaa !9
  br label %29

29:                                               ; preds = %25, %21, %13
  %.2.us = phi i32 [ %26, %25 ], [ %.13246.us, %21 ], [ %.13246.us, %13 ]
  %indvars.iv.next72 = add nuw nsw i64 %indvars.iv71, 1
  %indvars.iv.next74 = add nsw i64 %indvars.iv73, 1
  %exitcond79.not = icmp eq i64 %indvars.iv.next72, %wide.trip.count78
  br i1 %exitcond79.not, label %._crit_edge50.us, label %13, !llvm.loop !10

._crit_edge50.us:                                 ; preds = %29
  %indvars.iv.next81 = add nuw nsw i64 %indvars.iv80, 1
  %exitcond84.not = icmp eq i64 %indvars.iv.next81, %wide.trip.count83
  br i1 %exitcond84.not, label %._crit_edge56.loopexit, label %.preheader.us, !llvm.loop !12

.lr.ph44:                                         ; preds = %.preheader38, %._crit_edge
  %indvars.iv68 = phi i64 [ %indvars.iv.next69, %._crit_edge ], [ 0, %.preheader38 ]
  %.03542 = phi i32 [ %.136.lcssa, %._crit_edge ], [ 0, %.preheader38 ]
  %30 = sext i32 %.03542 to i64
  %31 = getelementptr inbounds i8, ptr @_ZZ5solvevE3buf, i64 %30
  %32 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %31)
  %33 = load i32, ptr %1, align 4, !tbaa !5
  %34 = icmp sgt i32 %33, 0
  br i1 %34, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %.lr.ph44
  %wide.trip.count = zext nneg i32 %33 to i64
  br label %39

._crit_edge.loopexit:                             ; preds = %39
  %35 = trunc nsw i64 %indvars.iv.next64 to i32
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %.lr.ph44
  %.136.lcssa = phi i32 [ %.03542, %.lr.ph44 ], [ %35, %._crit_edge.loopexit ]
  %indvars.iv.next69 = add nuw nsw i64 %indvars.iv68, 1
  %36 = load i32, ptr %0, align 4, !tbaa !5
  %37 = sext i32 %36 to i64
  %38 = icmp slt i64 %indvars.iv.next69, %37
  br i1 %38, label %.lr.ph44, label %.preheader37, !llvm.loop !13

39:                                               ; preds = %.lr.ph, %39
  %indvars.iv63 = phi i64 [ %30, %.lr.ph ], [ %indvars.iv.next64, %39 ]
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %39 ]
  %40 = getelementptr inbounds [10001 x i8], ptr @_ZZ5solvevE3buf, i64 0, i64 %indvars.iv63
  %41 = load i8, ptr %40, align 1, !tbaa !9
  %42 = sext i8 %41 to i64
  %43 = add nsw i64 %42, -97
  %44 = getelementptr inbounds [27 x [101 x i32]], ptr @_ZZ5solvevE3row, i64 0, i64 %43, i64 %indvars.iv68
  %45 = load i32, ptr %44, align 4, !tbaa !5
  %46 = add nsw i32 %45, 1
  store i32 %46, ptr %44, align 4, !tbaa !5
  %47 = getelementptr inbounds [27 x [101 x i32]], ptr @_ZZ5solvevE3col, i64 0, i64 %43, i64 %indvars.iv
  %48 = load i32, ptr %47, align 4, !tbaa !5
  %49 = add nsw i32 %48, 1
  store i32 %49, ptr %47, align 4, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %indvars.iv.next64 = add nsw i64 %indvars.iv63, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge.loopexit, label %39, !llvm.loop !14

._crit_edge56.loopexit:                           ; preds = %._crit_edge50.us
  %50 = sext i32 %.2.us to i64
  br label %._crit_edge56

._crit_edge56:                                    ; preds = %.preheader38, %._crit_edge56.loopexit, %.preheader37
  %.031.lcssa = phi i64 [ 0, %.preheader37 ], [ %50, %._crit_edge56.loopexit ], [ 0, %.preheader38 ]
  %51 = getelementptr inbounds [10001 x i8], ptr @_ZZ5solvevE3buf, i64 0, i64 %.031.lcssa
  store i8 0, ptr %51, align 1, !tbaa !9
  %52 = 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 nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #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 nocallback nofree nounwind willreturn memory(argmem: write) }
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}
!13 = distinct !{!13, !11}
!14 = distinct !{!14, !11}


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