; LLVM IR from VastoLorde95/Competitive-Programming :: Codeforces/283 Division 2/Problem C (C)

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

%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }

@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; 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 [101 x [101 x i32]], align 16
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca [101 x [101 x i8]], align 16
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = 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
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #6
  call void @llvm.lifetime.start.p0(i64 40804, ptr %6) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  store i32 -1, ptr %7, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  call void @llvm.lifetime.start.p0(i64 10201, ptr %9) #6
  %14 = getelementptr inbounds [101 x [101 x i32]], ptr %6, i64 0, i64 0
  call void @llvm.memset.p0.i64(ptr align 16 %14, i8 0, i64 40804, i1 false)
  %15 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %2, ptr noundef %3)
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  store i32 0, ptr %10, align 4, !tbaa !5
  br label %16

16:                                               ; preds = %27, %0
  %17 = load i32, ptr %10, align 4, !tbaa !5
  %18 = load i32, ptr %2, align 4, !tbaa !5
  %19 = icmp slt i32 %17, %18
  br i1 %19, label %21, label %20

20:                                               ; preds = %16
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  br label %30

21:                                               ; preds = %16
  %22 = load i32, ptr %10, align 4, !tbaa !5
  %23 = sext i32 %22 to i64
  %24 = getelementptr inbounds [101 x [101 x i8]], ptr %9, i64 0, i64 %23
  %25 = getelementptr inbounds [101 x i8], ptr %24, i64 0, i64 0
  %26 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %25)
  br label %27

27:                                               ; preds = %21
  %28 = load i32, ptr %10, align 4, !tbaa !5
  %29 = add nsw i32 %28, 1
  store i32 %29, ptr %10, align 4, !tbaa !5
  br label %16, !llvm.loop !9

30:                                               ; preds = %20
  %31 = load i32, ptr %2, align 4, !tbaa !5
  %32 = icmp eq i32 %31, 1
  br i1 %32, label %33, label %36

33:                                               ; preds = %30
  %34 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef 0)
  %35 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %34, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %179

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

37:                                               ; preds = %172, %36
  %38 = load i32, ptr %11, align 4, !tbaa !5
  %39 = load i32, ptr %3, align 4, !tbaa !5
  %40 = icmp slt i32 %38, %39
  br i1 %40, label %42, label %41

41:                                               ; preds = %37
  store i32 5, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  br label %175

42:                                               ; preds = %37
  store i32 0, ptr %8, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  store i32 1, ptr %13, align 4, !tbaa !5
  br label %43

43:                                               ; preds = %163, %42
  %44 = load i32, ptr %13, align 4, !tbaa !5
  %45 = load i32, ptr %2, align 4, !tbaa !5
  %46 = icmp slt i32 %44, %45
  br i1 %46, label %48, label %47

47:                                               ; preds = %43
  store i32 8, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  br label %166

48:                                               ; preds = %43
  %49 = load i32, ptr %7, align 4, !tbaa !5
  %50 = icmp eq i32 %49, -1
  br i1 %50, label %51, label %101

51:                                               ; preds = %48
  %52 = load i32, ptr %13, align 4, !tbaa !5
  %53 = sext i32 %52 to i64
  %54 = getelementptr inbounds [101 x [101 x i8]], ptr %9, i64 0, i64 %53
  %55 = load i32, ptr %11, align 4, !tbaa !5
  %56 = sext i32 %55 to i64
  %57 = getelementptr inbounds [101 x i8], ptr %54, i64 0, i64 %56
  %58 = load i8, ptr %57, align 1, !tbaa !11
  %59 = sext i8 %58 to i32
  %60 = load i32, ptr %13, align 4, !tbaa !5
  %61 = sub nsw i32 %60, 1
  %62 = sext i32 %61 to i64
  %63 = getelementptr inbounds [101 x [101 x i8]], ptr %9, i64 0, i64 %62
  %64 = load i32, ptr %11, align 4, !tbaa !5
  %65 = sext i32 %64 to i64
  %66 = getelementptr inbounds [101 x i8], ptr %63, i64 0, i64 %65
  %67 = load i8, ptr %66, align 1, !tbaa !11
  %68 = sext i8 %67 to i32
  %69 = icmp slt i32 %59, %68
  br i1 %69, label %70, label %74

70:                                               ; preds = %51
  %71 = load i32, ptr %5, align 4, !tbaa !5
  %72 = add nsw i32 %71, 1
  store i32 %72, ptr %5, align 4, !tbaa !5
  store i32 1, ptr %8, align 4, !tbaa !5
  %73 = load i32, ptr %2, align 4, !tbaa !5
  store i32 %73, ptr %13, align 4, !tbaa !5
  br label %74

74:                                               ; preds = %70, %51
  %75 = load i32, ptr %13, align 4, !tbaa !5
  %76 = sext i32 %75 to i64
  %77 = getelementptr inbounds [101 x [101 x i8]], ptr %9, i64 0, i64 %76
  %78 = load i32, ptr %11, align 4, !tbaa !5
  %79 = sext i32 %78 to i64
  %80 = getelementptr inbounds [101 x i8], ptr %77, i64 0, i64 %79
  %81 = load i8, ptr %80, align 1, !tbaa !11
  %82 = sext i8 %81 to i32
  %83 = load i32, ptr %13, align 4, !tbaa !5
  %84 = sub nsw i32 %83, 1
  %85 = sext i32 %84 to i64
  %86 = getelementptr inbounds [101 x [101 x i8]], ptr %9, i64 0, i64 %85
  %87 = load i32, ptr %11, align 4, !tbaa !5
  %88 = sext i32 %87 to i64
  %89 = getelementptr inbounds [101 x i8], ptr %86, i64 0, i64 %88
  %90 = load i8, ptr %89, align 1, !tbaa !11
  %91 = sext i8 %90 to i32
  %92 = icmp eq i32 %82, %91
  br i1 %92, label %93, label %100

93:                                               ; preds = %74
  %94 = load i32, ptr %13, align 4, !tbaa !5
  %95 = sext i32 %94 to i64
  %96 = getelementptr inbounds [101 x [101 x i32]], ptr %6, i64 0, i64 %95
  %97 = load i32, ptr %11, align 4, !tbaa !5
  %98 = sext i32 %97 to i64
  %99 = getelementptr inbounds [101 x i32], ptr %96, i64 0, i64 %98
  store i32 1, ptr %99, align 4, !tbaa !5
  br label %100

100:                                              ; preds = %93, %74
  br label %162

101:                                              ; preds = %48
  %102 = load i32, ptr %13, align 4, !tbaa !5
  %103 = sext i32 %102 to i64
  %104 = getelementptr inbounds [101 x [101 x i32]], ptr %6, i64 0, i64 %103
  %105 = load i32, ptr %7, align 4, !tbaa !5
  %106 = sext i32 %105 to i64
  %107 = getelementptr inbounds [101 x i32], ptr %104, i64 0, i64 %106
  %108 = load i32, ptr %107, align 4, !tbaa !5
  %109 = icmp eq i32 %108, 1
  br i1 %109, label %110, label %161

110:                                              ; preds = %101
  %111 = load i32, ptr %13, align 4, !tbaa !5
  %112 = sext i32 %111 to i64
  %113 = getelementptr inbounds [101 x [101 x i8]], ptr %9, i64 0, i64 %112
  %114 = load i32, ptr %11, align 4, !tbaa !5
  %115 = sext i32 %114 to i64
  %116 = getelementptr inbounds [101 x i8], ptr %113, i64 0, i64 %115
  %117 = load i8, ptr %116, align 1, !tbaa !11
  %118 = sext i8 %117 to i32
  %119 = load i32, ptr %13, align 4, !tbaa !5
  %120 = sub nsw i32 %119, 1
  %121 = sext i32 %120 to i64
  %122 = getelementptr inbounds [101 x [101 x i8]], ptr %9, i64 0, i64 %121
  %123 = load i32, ptr %11, align 4, !tbaa !5
  %124 = sext i32 %123 to i64
  %125 = getelementptr inbounds [101 x i8], ptr %122, i64 0, i64 %124
  %126 = load i8, ptr %125, align 1, !tbaa !11
  %127 = sext i8 %126 to i32
  %128 = icmp slt i32 %118, %127
  br i1 %128, label %129, label %133

129:                                              ; preds = %110
  %130 = load i32, ptr %5, align 4, !tbaa !5
  %131 = add nsw i32 %130, 1
  store i32 %131, ptr %5, align 4, !tbaa !5
  store i32 1, ptr %8, align 4, !tbaa !5
  %132 = load i32, ptr %2, align 4, !tbaa !5
  store i32 %132, ptr %13, align 4, !tbaa !5
  br label %160

133:                                              ; preds = %110
  %134 = load i32, ptr %13, align 4, !tbaa !5
  %135 = sext i32 %134 to i64
  %136 = getelementptr inbounds [101 x [101 x i8]], ptr %9, i64 0, i64 %135
  %137 = load i32, ptr %11, align 4, !tbaa !5
  %138 = sext i32 %137 to i64
  %139 = getelementptr inbounds [101 x i8], ptr %136, i64 0, i64 %138
  %140 = load i8, ptr %139, align 1, !tbaa !11
  %141 = sext i8 %140 to i32
  %142 = load i32, ptr %13, align 4, !tbaa !5
  %143 = sub nsw i32 %142, 1
  %144 = sext i32 %143 to i64
  %145 = getelementptr inbounds [101 x [101 x i8]], ptr %9, i64 0, i64 %144
  %146 = load i32, ptr %11, align 4, !tbaa !5
  %147 = sext i32 %146 to i64
  %148 = getelementptr inbounds [101 x i8], ptr %145, i64 0, i64 %147
  %149 = load i8, ptr %148, align 1, !tbaa !11
  %150 = sext i8 %149 to i32
  %151 = icmp eq i32 %141, %150
  br i1 %151, label %152, label %159

152:                                              ; preds = %133
  %153 = load i32, ptr %13, align 4, !tbaa !5
  %154 = sext i32 %153 to i64
  %155 = getelementptr inbounds [101 x [101 x i32]], ptr %6, i64 0, i64 %154
  %156 = load i32, ptr %11, align 4, !tbaa !5
  %157 = sext i32 %156 to i64
  %158 = getelementptr inbounds [101 x i32], ptr %155, i64 0, i64 %157
  store i32 1, ptr %158, align 4, !tbaa !5
  br label %159

159:                                              ; preds = %152, %133
  br label %160

160:                                              ; preds = %159, %129
  br label %161

161:                                              ; preds = %160, %101
  br label %162

162:                                              ; preds = %161, %100
  br label %163

163:                                              ; preds = %162
  %164 = load i32, ptr %13, align 4, !tbaa !5
  %165 = add nsw i32 %164, 1
  store i32 %165, ptr %13, align 4, !tbaa !5
  br label %43, !llvm.loop !12

166:                                              ; preds = %47
  %167 = load i32, ptr %8, align 4, !tbaa !5
  %168 = icmp eq i32 %167, 0
  br i1 %168, label %169, label %171

169:                                              ; preds = %166
  %170 = load i32, ptr %11, align 4, !tbaa !5
  store i32 %170, ptr %7, align 4, !tbaa !5
  br label %171

171:                                              ; preds = %169, %166
  br label %172

172:                                              ; preds = %171
  %173 = load i32, ptr %11, align 4, !tbaa !5
  %174 = add nsw i32 %173, 1
  store i32 %174, ptr %11, align 4, !tbaa !5
  br label %37, !llvm.loop !13

175:                                              ; preds = %41
  %176 = load i32, ptr %5, align 4, !tbaa !5
  %177 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %176)
  %178 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %177, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %179

179:                                              ; preds = %175, %33
  store i32 0, ptr %1, align 4
  store i32 1, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 10201, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 40804, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #6
  %180 = load i32, ptr %1, align 4
  ret i32 %180
}

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

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

declare i32 @__isoc99_scanf(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 noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) #3

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #4 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #5

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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { "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 = { 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 #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 }

!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}


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

%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }

@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca [101 x [101 x i32]], align 16
  %4 = alloca [101 x [101 x i8]], align 16
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #8
  call void @llvm.lifetime.start.p0(i64 40804, ptr nonnull %3) #8
  call void @llvm.lifetime.start.p0(i64 10201, ptr nonnull %4) #8
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(40804) %3, i8 0, i64 40804, i1 false)
  %5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %1, ptr noundef nonnull %2)
  %6 = load i32, ptr %1, align 4, !tbaa !5
  %7 = icmp sgt i32 %6, 0
  call void @llvm.assume(i1 %7)
  br label %.lr.ph

._crit_edge:                                      ; preds = %.lr.ph
  %8 = icmp eq i32 %58, 1
  br i1 %8, label %._crit_edge63, label %.preheader50

.preheader50:                                     ; preds = %._crit_edge
  %9 = load i32, ptr %2, align 4, !tbaa !5
  %10 = icmp sgt i32 %9, 0
  call void @llvm.assume(i1 %10)
  %11 = icmp sgt i32 %58, 1
  call void @llvm.assume(i1 %11)
  %wide.trip.count = zext nneg i32 %9 to i64
  br label %.preheader.us

.preheader.us:                                    ; preds = %.preheader50, %._crit_edge56.us
  %indvars.iv76 = phi i64 [ 0, %.preheader50 ], [ %indvars.iv.next77, %._crit_edge56.us ]
  %.04161.us = phi i32 [ -1, %.preheader50 ], [ %spec.select.us, %._crit_edge56.us ]
  %.04360.us = phi i32 [ undef, %.preheader50 ], [ %.us-phi.us, %._crit_edge56.us ]
  %12 = icmp eq i32 %.04161.us, -1
  %13 = sext i32 %.04161.us to i64
  br i1 %12, label %.lr.ph55.split.us.us.preheader, label %.lr.ph55.split.us71

.lr.ph55.split.us.us.preheader:                   ; preds = %.preheader.us
  %.phi.trans.insert = getelementptr inbounds [101 x [101 x i8]], ptr %4, i64 0, i64 0, i64 %indvars.iv76
  %.pre = load i8, ptr %.phi.trans.insert, align 1, !tbaa !9
  br label %.lr.ph55.split.us.us

.lr.ph55.split.us71:                              ; preds = %.preheader.us, %32
  %.054.us65 = phi i32 [ %33, %32 ], [ 1, %.preheader.us ]
  %.03853.us66 = phi i32 [ %.240.us, %32 ], [ 0, %.preheader.us ]
  %.14452.us67 = phi i32 [ %.3.us, %32 ], [ %.04360.us, %.preheader.us ]
  %14 = zext nneg i32 %.054.us65 to i64
  %15 = getelementptr inbounds [101 x [101 x i32]], ptr %3, i64 0, i64 %14, i64 %13
  %16 = load i32, ptr %15, align 4, !tbaa !5
  %17 = icmp eq i32 %16, 1
  br i1 %17, label %18, label %32

18:                                               ; preds = %.lr.ph55.split.us71
  %19 = getelementptr inbounds [101 x [101 x i8]], ptr %4, i64 0, i64 %14, i64 %indvars.iv76
  %20 = load i8, ptr %19, align 1, !tbaa !9
  %21 = add nsw i32 %.054.us65, -1
  %22 = zext nneg i32 %21 to i64
  %23 = getelementptr inbounds [101 x [101 x i8]], ptr %4, i64 0, i64 %22, i64 %indvars.iv76
  %24 = load i8, ptr %23, align 1, !tbaa !9
  %25 = icmp slt i8 %20, %24
  br i1 %25, label %30, label %26

26:                                               ; preds = %18
  %27 = icmp eq i8 %20, %24
  br i1 %27, label %28, label %32

28:                                               ; preds = %26
  %29 = getelementptr inbounds [101 x [101 x i32]], ptr %3, i64 0, i64 %14, i64 %indvars.iv76
  store i32 1, ptr %29, align 4, !tbaa !5
  br label %32

30:                                               ; preds = %18
  %31 = add nsw i32 %.14452.us67, 1
  br label %32

32:                                               ; preds = %30, %28, %26, %.lr.ph55.split.us71
  %.3.us = phi i32 [ %31, %30 ], [ %.14452.us67, %28 ], [ %.14452.us67, %26 ], [ %.14452.us67, %.lr.ph55.split.us71 ]
  %.240.us = phi i32 [ 1, %30 ], [ %.03853.us66, %28 ], [ %.03853.us66, %26 ], [ %.03853.us66, %.lr.ph55.split.us71 ]
  %.2.us = phi i32 [ %58, %30 ], [ %.054.us65, %28 ], [ %.054.us65, %26 ], [ %.054.us65, %.lr.ph55.split.us71 ]
  %33 = add nuw nsw i32 %.2.us, 1
  %34 = icmp slt i32 %33, %58
  br i1 %34, label %.lr.ph55.split.us71, label %._crit_edge56.us, !llvm.loop !10

._crit_edge56.us:                                 ; preds = %32, %53
  %.us-phi.us = phi i32 [ %.245.us.us, %53 ], [ %.3.us, %32 ]
  %.us-phi59.us = phi i32 [ %.139.us.us, %53 ], [ %.240.us, %32 ]
  %35 = icmp eq i32 %.us-phi59.us, 0
  %36 = trunc nuw nsw i64 %indvars.iv76 to i32
  %spec.select.us = select i1 %35, i32 %36, i32 %.04161.us
  %indvars.iv.next77 = add nuw nsw i64 %indvars.iv76, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next77, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge63, label %.preheader.us, !llvm.loop !12

.lr.ph55.split.us.us:                             ; preds = %.lr.ph55.split.us.us.preheader, %53
  %37 = phi i8 [ %45, %53 ], [ %.pre, %.lr.ph55.split.us.us.preheader ]
  %.054.us.us = phi i32 [ %54, %53 ], [ 1, %.lr.ph55.split.us.us.preheader ]
  %.03853.us.us = phi i32 [ %.139.us.us, %53 ], [ 0, %.lr.ph55.split.us.us.preheader ]
  %.14452.us.us = phi i32 [ %.245.us.us, %53 ], [ %.04360.us, %.lr.ph55.split.us.us.preheader ]
  %38 = zext nneg i32 %.054.us.us to i64
  %39 = getelementptr inbounds [101 x [101 x i8]], ptr %4, i64 0, i64 %38, i64 %indvars.iv76
  %40 = load i8, ptr %39, align 1, !tbaa !9
  %41 = icmp slt i8 %40, %37
  %42 = zext i1 %41 to i32
  %.245.us.us = add nsw i32 %.14452.us.us, %42
  %.139.us.us = select i1 %41, i32 1, i32 %.03853.us.us
  %.1.us.us = select i1 %41, i32 %58, i32 %.054.us.us
  %43 = zext nneg i32 %.1.us.us to i64
  %44 = getelementptr inbounds [101 x [101 x i8]], ptr %4, i64 0, i64 %43, i64 %indvars.iv76
  %45 = load i8, ptr %44, align 1, !tbaa !9
  %46 = add nsw i32 %.1.us.us, -1
  %47 = zext nneg i32 %46 to i64
  %48 = getelementptr inbounds [101 x [101 x i8]], ptr %4, i64 0, i64 %47, i64 %indvars.iv76
  %49 = load i8, ptr %48, align 1, !tbaa !9
  %50 = icmp eq i8 %45, %49
  br i1 %50, label %51, label %53

51:                                               ; preds = %.lr.ph55.split.us.us
  %52 = getelementptr inbounds [101 x [101 x i32]], ptr %3, i64 0, i64 %43, i64 %indvars.iv76
  store i32 1, ptr %52, align 4, !tbaa !5
  br label %53

53:                                               ; preds = %51, %.lr.ph55.split.us.us
  %54 = add nuw nsw i32 %.1.us.us, 1
  %55 = icmp slt i32 %54, %58
  br i1 %55, label %.lr.ph55.split.us.us, label %._crit_edge56.us, !llvm.loop !10

.lr.ph:                                           ; preds = %0, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %0 ]
  %56 = getelementptr inbounds [101 x [101 x i8]], ptr %4, i64 0, i64 %indvars.iv
  %57 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %56)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %58 = load i32, ptr %1, align 4, !tbaa !5
  %59 = sext i32 %58 to i64
  %60 = icmp slt i64 %indvars.iv.next, %59
  br i1 %60, label %.lr.ph, label %._crit_edge, !llvm.loop !13

._crit_edge63:                                    ; preds = %._crit_edge56.us, %._crit_edge
  %.us-phi.us.lcssa.sink = phi i32 [ 0, %._crit_edge ], [ %.us-phi.us, %._crit_edge56.us ]
  %61 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %.us-phi.us.lcssa.sink)
  %62 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %61, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.lifetime.end.p0(i64 10201, ptr nonnull %4) #8
  call void @llvm.lifetime.end.p0(i64 40804, ptr nonnull %3) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #8
  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: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2

; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) 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

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) local_unnamed_addr #4

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #5 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #6

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write)
declare void @llvm.assume(i1 noundef) #7

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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { 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 #4 = { "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 = { 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 = { 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 #7 = { nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write) }
attributes #8 = { 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}


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