; LLVM IR from Shah-Shishir/Codeforces-Solutions :: 404A. Valera and X (main)

; 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_istream" = type { ptr, i64, %"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 }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca [305 x [305 x i8]], align 16
  %6 = alloca i8, align 1
  %7 = alloca i8, align 1
  %8 = alloca i8, align 1
  %9 = alloca i8, align 1
  %10 = alloca i8, align 1
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #5
  call void @llvm.lifetime.start.p0(i64 93025, ptr %5) #5
  call void @llvm.lifetime.start.p0(i64 1, ptr %6) #5
  call void @llvm.lifetime.start.p0(i64 1, ptr %7) #5
  call void @llvm.lifetime.start.p0(i64 1, ptr %8) #5
  call void @llvm.lifetime.start.p0(i64 1, ptr %9) #5
  call void @llvm.lifetime.start.p0(i64 1, ptr %10) #5
  br label %11

11:                                               ; preds = %160, %0
  %12 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %13 = load ptr, ptr %12, align 8, !tbaa !5
  %14 = getelementptr i8, ptr %13, i64 -24
  %15 = load i64, ptr %14, align 8
  %16 = getelementptr inbounds i8, ptr %12, i64 %15
  %17 = call noundef zeroext i1 @_ZNKSt9basic_iosIcSt11char_traitsIcEEcvbEv(ptr noundef nonnull align 8 dereferenceable(264) %16)
  br i1 %17, label %18, label %161

18:                                               ; preds = %11
  store i8 1, ptr %8, align 1, !tbaa !8
  store i32 0, ptr %3, align 4, !tbaa !11
  br label %19

19:                                               ; preds = %29, %18
  %20 = load i32, ptr %3, align 4, !tbaa !11
  %21 = load i32, ptr %2, align 4, !tbaa !11
  %22 = icmp slt i32 %20, %21
  br i1 %22, label %23, label %32

23:                                               ; preds = %19
  %24 = load i32, ptr %3, align 4, !tbaa !11
  %25 = sext i32 %24 to i64
  %26 = getelementptr inbounds [305 x [305 x i8]], ptr %5, i64 0, i64 %25
  %27 = getelementptr inbounds [305 x i8], ptr %26, i64 0, i64 0
  %28 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcEERSt13basic_istreamIT_T0_ES6_PS3_(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef %27)
  br label %29

29:                                               ; preds = %23
  %30 = load i32, ptr %3, align 4, !tbaa !11
  %31 = add nsw i32 %30, 1
  store i32 %31, ptr %3, align 4, !tbaa !11
  br label %19, !llvm.loop !13

32:                                               ; preds = %19
  %33 = getelementptr inbounds [305 x [305 x i8]], ptr %5, i64 0, i64 0
  %34 = getelementptr inbounds [305 x i8], ptr %33, i64 0, i64 0
  %35 = load i8, ptr %34, align 16, !tbaa !15
  store i8 %35, ptr %6, align 1, !tbaa !15
  %36 = getelementptr inbounds [305 x [305 x i8]], ptr %5, i64 0, i64 0
  %37 = getelementptr inbounds [305 x i8], ptr %36, i64 0, i64 1
  %38 = load i8, ptr %37, align 1, !tbaa !15
  store i8 %38, ptr %7, align 1, !tbaa !15
  store i32 1, ptr %3, align 4, !tbaa !11
  br label %39

39:                                               ; preds = %57, %32
  %40 = load i32, ptr %3, align 4, !tbaa !11
  %41 = load i32, ptr %2, align 4, !tbaa !11
  %42 = icmp slt i32 %40, %41
  br i1 %42, label %43, label %60

43:                                               ; preds = %39
  %44 = load i32, ptr %3, align 4, !tbaa !11
  %45 = sext i32 %44 to i64
  %46 = getelementptr inbounds [305 x [305 x i8]], ptr %5, i64 0, i64 %45
  %47 = load i32, ptr %3, align 4, !tbaa !11
  %48 = sext i32 %47 to i64
  %49 = getelementptr inbounds [305 x i8], ptr %46, i64 0, i64 %48
  %50 = load i8, ptr %49, align 1, !tbaa !15
  %51 = sext i8 %50 to i32
  %52 = load i8, ptr %6, align 1, !tbaa !15
  %53 = sext i8 %52 to i32
  %54 = icmp ne i32 %51, %53
  br i1 %54, label %55, label %56

55:                                               ; preds = %43
  store i8 0, ptr %8, align 1, !tbaa !8
  br label %60

56:                                               ; preds = %43
  br label %57

57:                                               ; preds = %56
  %58 = load i32, ptr %3, align 4, !tbaa !11
  %59 = add nsw i32 %58, 1
  store i32 %59, ptr %3, align 4, !tbaa !11
  br label %39, !llvm.loop !16

60:                                               ; preds = %55, %39
  %61 = load i32, ptr %2, align 4, !tbaa !11
  %62 = sub nsw i32 %61, 1
  store i32 %62, ptr %4, align 4, !tbaa !11
  store i8 1, ptr %9, align 1, !tbaa !8
  store i32 0, ptr %3, align 4, !tbaa !11
  br label %63

63:                                               ; preds = %82, %60
  %64 = load i32, ptr %3, align 4, !tbaa !11
  %65 = load i32, ptr %2, align 4, !tbaa !11
  %66 = icmp slt i32 %64, %65
  br i1 %66, label %67, label %85

67:                                               ; preds = %63
  %68 = load i32, ptr %3, align 4, !tbaa !11
  %69 = sext i32 %68 to i64
  %70 = getelementptr inbounds [305 x [305 x i8]], ptr %5, i64 0, i64 %69
  %71 = load i32, ptr %4, align 4, !tbaa !11
  %72 = add nsw i32 %71, -1
  store i32 %72, ptr %4, align 4, !tbaa !11
  %73 = sext i32 %71 to i64
  %74 = getelementptr inbounds [305 x i8], ptr %70, i64 0, i64 %73
  %75 = load i8, ptr %74, align 1, !tbaa !15
  %76 = sext i8 %75 to i32
  %77 = load i8, ptr %6, align 1, !tbaa !15
  %78 = sext i8 %77 to i32
  %79 = icmp ne i32 %76, %78
  br i1 %79, label %80, label %81

80:                                               ; preds = %67
  store i8 0, ptr %9, align 1, !tbaa !8
  br label %85

81:                                               ; preds = %67
  br label %82

82:                                               ; preds = %81
  %83 = load i32, ptr %3, align 4, !tbaa !11
  %84 = add nsw i32 %83, 1
  store i32 %84, ptr %3, align 4, !tbaa !11
  br label %63, !llvm.loop !17

85:                                               ; preds = %80, %63
  store i8 1, ptr %10, align 1, !tbaa !8
  store i32 0, ptr %3, align 4, !tbaa !11
  br label %86

86:                                               ; preds = %144, %85
  %87 = load i32, ptr %3, align 4, !tbaa !11
  %88 = load i32, ptr %2, align 4, !tbaa !11
  %89 = icmp slt i32 %87, %88
  br i1 %89, label %90, label %147

90:                                               ; preds = %86
  %91 = load i8, ptr %10, align 1, !tbaa !8, !range !18, !noundef !19
  %92 = trunc i8 %91 to i1
  %93 = zext i1 %92 to i32
  %94 = icmp eq i32 %93, 0
  br i1 %94, label %95, label %96

95:                                               ; preds = %90
  br label %147

96:                                               ; preds = %90
  store i32 0, ptr %4, align 4, !tbaa !11
  br label %97

97:                                               ; preds = %140, %96
  %98 = load i32, ptr %4, align 4, !tbaa !11
  %99 = load i32, ptr %2, align 4, !tbaa !11
  %100 = icmp slt i32 %98, %99
  br i1 %100, label %101, label %143

101:                                              ; preds = %97
  %102 = load i32, ptr %3, align 4, !tbaa !11
  %103 = load i32, ptr %4, align 4, !tbaa !11
  %104 = icmp eq i32 %102, %103
  br i1 %104, label %112, label %105

105:                                              ; preds = %101
  %106 = load i32, ptr %3, align 4, !tbaa !11
  %107 = load i32, ptr %4, align 4, !tbaa !11
  %108 = add nsw i32 %106, %107
  %109 = load i32, ptr %2, align 4, !tbaa !11
  %110 = sub nsw i32 %109, 1
  %111 = icmp eq i32 %108, %110
  br i1 %111, label %112, label %113

112:                                              ; preds = %105, %101
  br label %140

113:                                              ; preds = %105
  %114 = load i32, ptr %3, align 4, !tbaa !11
  %115 = sext i32 %114 to i64
  %116 = getelementptr inbounds [305 x [305 x i8]], ptr %5, i64 0, i64 %115
  %117 = load i32, ptr %4, align 4, !tbaa !11
  %118 = sext i32 %117 to i64
  %119 = getelementptr inbounds [305 x i8], ptr %116, i64 0, i64 %118
  %120 = load i8, ptr %119, align 1, !tbaa !15
  %121 = sext i8 %120 to i32
  %122 = load i8, ptr %7, align 1, !tbaa !15
  %123 = sext i8 %122 to i32
  %124 = icmp eq i32 %121, %123
  br i1 %124, label %125, label %137

125:                                              ; preds = %113
  %126 = load i32, ptr %3, align 4, !tbaa !11
  %127 = sext i32 %126 to i64
  %128 = getelementptr inbounds [305 x [305 x i8]], ptr %5, i64 0, i64 %127
  %129 = load i32, ptr %4, align 4, !tbaa !11
  %130 = sext i32 %129 to i64
  %131 = getelementptr inbounds [305 x i8], ptr %128, i64 0, i64 %130
  %132 = load i8, ptr %131, align 1, !tbaa !15
  %133 = sext i8 %132 to i32
  %134 = load i8, ptr %6, align 1, !tbaa !15
  %135 = sext i8 %134 to i32
  %136 = icmp ne i32 %133, %135
  br i1 %136, label %138, label %137

137:                                              ; preds = %125, %113
  store i8 0, ptr %10, align 1, !tbaa !8
  br label %143

138:                                              ; preds = %125
  br label %139

139:                                              ; preds = %138
  br label %140

140:                                              ; preds = %139, %112
  %141 = load i32, ptr %4, align 4, !tbaa !11
  %142 = add nsw i32 %141, 1
  store i32 %142, ptr %4, align 4, !tbaa !11
  br label %97, !llvm.loop !20

143:                                              ; preds = %137, %97
  br label %144

144:                                              ; preds = %143
  %145 = load i32, ptr %3, align 4, !tbaa !11
  %146 = add nsw i32 %145, 1
  store i32 %146, ptr %3, align 4, !tbaa !11
  br label %86, !llvm.loop !21

147:                                              ; preds = %95, %86
  %148 = load i8, ptr %8, align 1, !tbaa !8, !range !18, !noundef !19
  %149 = trunc i8 %148 to i1
  br i1 %149, label %150, label %158

150:                                              ; preds = %147
  %151 = load i8, ptr %9, align 1, !tbaa !8, !range !18, !noundef !19
  %152 = trunc i8 %151 to i1
  br i1 %152, label %153, label %158

153:                                              ; preds = %150
  %154 = load i8, ptr %10, align 1, !tbaa !8, !range !18, !noundef !19
  %155 = trunc i8 %154 to i1
  br i1 %155, label %156, label %158

156:                                              ; preds = %153
  %157 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str)
  br label %160

158:                                              ; preds = %153, %150, %147
  %159 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.1)
  br label %160

160:                                              ; preds = %158, %156
  br label %11, !llvm.loop !22

161:                                              ; preds = %11
  call void @llvm.lifetime.end.p0(i64 1, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 93025, ptr %5) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #5
  ret i32 0
}

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

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4)) #2

; Function Attrs: mustprogress uwtable
declare noundef zeroext i1 @_ZNKSt9basic_iosIcSt11char_traitsIcEEcvbEv(ptr noundef nonnull align 8 dereferenceable(264)) #3 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcEERSt13basic_istreamIT_T0_ES6_PS3_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull) #4

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

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

attributes #0 = { mustprogress norecurse uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { 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 = { 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 #5 = { 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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"bool", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !10, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = !{!10, !10, i64 0}
!16 = distinct !{!16, !14}
!17 = distinct !{!17, !14}
!18 = !{i8 0, i8 2}
!19 = !{}
!20 = distinct !{!20, !14}
!21 = distinct !{!21, !14}
!22 = distinct !{!22, !14}


; 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_istream" = type { ptr, i64, %"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 }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca i32, align 4
  %2 = alloca [305 x [305 x i8]], align 16
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #5
  call void @llvm.lifetime.start.p0(i64 93025, ptr nonnull %2) #5
  %3 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %1)
  %4 = load ptr, ptr %3, align 8, !tbaa !5
  %5 = getelementptr i8, ptr %4, i64 -24
  %6 = load i64, ptr %5, align 8
  %7 = getelementptr inbounds i8, ptr %3, i64 %6
  %8 = call noundef zeroext i1 @_ZNKSt9basic_iosIcSt11char_traitsIcEEcvbEv(ptr noundef nonnull align 8 dereferenceable(264) %7)
  br i1 %8, label %.preheader45.lr.ph, label %._crit_edge77

.preheader45.lr.ph:                               ; preds = %0
  %9 = getelementptr inbounds i8, ptr %2, i64 1
  %10 = getelementptr inbounds i8, ptr %2, i64 306
  br label %.preheader45

.preheader45:                                     ; preds = %.preheader45.lr.ph, %._crit_edge75.split.us
  %11 = load i32, ptr %1, align 4, !tbaa !8
  %12 = icmp sgt i32 %11, 0
  br i1 %12, label %.lr.ph, label %._crit_edge75.split.us

.lr.ph:                                           ; preds = %.preheader45, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %.preheader45 ]
  %13 = getelementptr inbounds [305 x [305 x i8]], ptr %2, i64 0, i64 %indvars.iv
  %14 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcEERSt13basic_istreamIT_T0_ES6_PS3_(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef %13)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %15 = load i32, ptr %1, align 4, !tbaa !8
  %16 = sext i32 %15 to i64
  %17 = icmp slt i64 %indvars.iv.next, %16
  br i1 %17, label %.lr.ph, label %._crit_edge, !llvm.loop !11

._crit_edge:                                      ; preds = %.lr.ph
  %18 = load i8, ptr %2, align 16, !tbaa !13
  %19 = load i8, ptr %9, align 1, !tbaa !13
  %.not4147 = icmp sgt i32 %15, 1
  br i1 %.not4147, label %.lr.ph51.preheader, label %._crit_edge52

.lr.ph51.preheader:                               ; preds = %._crit_edge
  %20 = zext nneg i32 %15 to i64
  %wide.trip.count = zext nneg i32 %15 to i64
  %21 = load i8, ptr %10, align 2, !tbaa !13
  %.not117 = icmp eq i8 %21, %18
  br i1 %.not117, label %.lr.ph119, label %._crit_edge52

.lr.ph119:                                        ; preds = %.lr.ph51.preheader, %.lr.ph51
  %indvars.iv81118 = phi i64 [ %indvars.iv.next82, %.lr.ph51 ], [ 1, %.lr.ph51.preheader ]
  %indvars.iv.next82 = add nuw nsw i64 %indvars.iv81118, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next82, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge52.loopexit, label %.lr.ph51, !llvm.loop !14

.lr.ph51:                                         ; preds = %.lr.ph119
  %22 = getelementptr inbounds [305 x [305 x i8]], ptr %2, i64 0, i64 %indvars.iv.next82, i64 %indvars.iv.next82
  %23 = load i8, ptr %22, align 1, !tbaa !13
  %.not = icmp eq i8 %23, %18
  br i1 %.not, label %.lr.ph119, label %._crit_edge52.loopexit, !llvm.loop !14

._crit_edge52.loopexit:                           ; preds = %.lr.ph119, %.lr.ph51
  %.not41.le = icmp ult i64 %indvars.iv.next82, %20
  br label %._crit_edge52

._crit_edge52:                                    ; preds = %._crit_edge52.loopexit, %.lr.ph51.preheader, %._crit_edge
  %.not41.lcssa = phi i1 [ false, %._crit_edge ], [ true, %.lr.ph51.preheader ], [ %.not41.le, %._crit_edge52.loopexit ]
  %.not4257 = icmp sgt i32 %15, 0
  br i1 %.not4257, label %.lr.ph62.preheader, label %._crit_edge75.split.us

.lr.ph62.preheader:                               ; preds = %._crit_edge52
  %24 = zext nneg i32 %15 to i64
  %wide.trip.count87 = zext nneg i32 %15 to i64
  %indvars.iv.next84121 = add nsw i64 %24, -1
  %25 = getelementptr inbounds [305 x [305 x i8]], ptr %2, i64 0, i64 0, i64 %indvars.iv.next84121
  %26 = load i8, ptr %25, align 1, !tbaa !13
  %.not39122 = icmp eq i8 %26, %18
  br i1 %.not39122, label %.lr.ph125, label %.preheader.lr.ph

.lr.ph125:                                        ; preds = %.lr.ph62.preheader, %.lr.ph62
  %indvars.iv.next84124 = phi i64 [ %indvars.iv.next84, %.lr.ph62 ], [ %indvars.iv.next84121, %.lr.ph62.preheader ]
  %indvars.iv85123 = phi i64 [ %indvars.iv.next86, %.lr.ph62 ], [ 0, %.lr.ph62.preheader ]
  %indvars.iv.next86 = add nuw nsw i64 %indvars.iv85123, 1
  %exitcond88.not = icmp eq i64 %indvars.iv.next86, %wide.trip.count87
  br i1 %exitcond88.not, label %.preheader.lr.ph.loopexit, label %.lr.ph62, !llvm.loop !15

.lr.ph62:                                         ; preds = %.lr.ph125
  %indvars.iv.next84 = add nsw i64 %indvars.iv.next84124, -1
  %27 = getelementptr inbounds [305 x [305 x i8]], ptr %2, i64 0, i64 %indvars.iv.next86, i64 %indvars.iv.next84
  %28 = load i8, ptr %27, align 1, !tbaa !13
  %.not39 = icmp eq i8 %28, %18
  br i1 %.not39, label %.lr.ph125, label %.preheader.lr.ph.loopexit, !llvm.loop !15

.preheader.lr.ph.loopexit:                        ; preds = %.lr.ph62, %.lr.ph125
  %.not42.le = icmp ult i64 %indvars.iv.next86, %24
  br label %.preheader.lr.ph

.preheader.lr.ph:                                 ; preds = %.preheader.lr.ph.loopexit, %.lr.ph62.preheader
  %.not42.lcssa = phi i1 [ true, %.lr.ph62.preheader ], [ %.not42.le, %.preheader.lr.ph.loopexit ]
  %29 = add nsw i32 %15, -1
  %30 = zext nneg i32 %29 to i64
  %31 = zext nneg i32 %15 to i64
  %wide.trip.count92 = zext nneg i32 %15 to i64
  br label %.preheader.us

.preheader.us:                                    ; preds = %._crit_edge69.us, %.preheader.lr.ph
  %indvars.iv94 = phi i64 [ %indvars.iv.next95, %._crit_edge69.us ], [ 0, %.preheader.lr.ph ]
  br label %32

32:                                               ; preds = %.preheader.us, %40
  %indvars.iv89 = phi i64 [ 0, %.preheader.us ], [ %indvars.iv.next90, %40 ]
  %33 = icmp eq i64 %indvars.iv94, %indvars.iv89
  %34 = add nuw nsw i64 %indvars.iv89, %indvars.iv94
  %35 = icmp eq i64 %34, %30
  %or.cond = select i1 %33, i1 true, i1 %35
  br i1 %or.cond, label %40, label %36

36:                                               ; preds = %32
  %37 = getelementptr inbounds [305 x [305 x i8]], ptr %2, i64 0, i64 %indvars.iv94, i64 %indvars.iv89
  %38 = load i8, ptr %37, align 1, !tbaa !13
  %39 = icmp ne i8 %38, %19
  %.not40.us = icmp eq i8 %38, %18
  %or.cond44.us = select i1 %39, i1 true, i1 %.not40.us
  br i1 %or.cond44.us, label %._crit_edge75.split.us, label %40

._crit_edge69.us:                                 ; preds = %40
  %indvars.iv.next95 = add nuw nsw i64 %indvars.iv94, 1
  %.not115 = icmp ult i64 %indvars.iv.next95, %31
  br i1 %.not115, label %.preheader.us, label %._crit_edge75.split.us, !llvm.loop !16

40:                                               ; preds = %36, %32
  %indvars.iv.next90 = add nuw nsw i64 %indvars.iv89, 1
  %exitcond93.not = icmp eq i64 %indvars.iv.next90, %wide.trip.count92
  br i1 %exitcond93.not, label %._crit_edge69.us, label %32, !llvm.loop !17

._crit_edge75.split.us:                           ; preds = %._crit_edge69.us, %36, %.preheader45, %._crit_edge52
  %.not42.lcssa109 = phi i1 [ false, %._crit_edge52 ], [ false, %.preheader45 ], [ %.not42.lcssa, %36 ], [ %.not42.lcssa, %._crit_edge69.us ]
  %.not41.lcssa103108 = phi i1 [ %.not41.lcssa, %._crit_edge52 ], [ false, %.preheader45 ], [ %.not41.lcssa, %36 ], [ %.not41.lcssa, %._crit_edge69.us ]
  %.0.lcssa.not = phi i1 [ false, %._crit_edge52 ], [ false, %.preheader45 ], [ true, %36 ], [ false, %._crit_edge69.us ]
  %brmerge = or i1 %.not41.lcssa103108, %.not42.lcssa109
  %brmerge128 = or i1 %brmerge, %.0.lcssa.not
  %.str.1.sink = select i1 %brmerge128, ptr @.str.1, ptr @.str
  %41 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull %.str.1.sink)
  %42 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %1)
  %43 = load ptr, ptr %42, align 8, !tbaa !5
  %44 = getelementptr i8, ptr %43, i64 -24
  %45 = load i64, ptr %44, align 8
  %46 = getelementptr inbounds i8, ptr %42, i64 %45
  %47 = call noundef zeroext i1 @_ZNKSt9basic_iosIcSt11char_traitsIcEEcvbEv(ptr noundef nonnull align 8 dereferenceable(264) %46)
  br i1 %47, label %.preheader45, label %._crit_edge77, !llvm.loop !18

._crit_edge77:                                    ; preds = %._crit_edge75.split.us, %0
  call void @llvm.lifetime.end.p0(i64 93025, ptr nonnull %2) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #5
  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

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
declare noundef zeroext i1 @_ZNKSt9basic_iosIcSt11char_traitsIcEEcvbEv(ptr noundef nonnull align 8 dereferenceable(264)) local_unnamed_addr #3 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcEERSt13basic_istreamIT_T0_ES6_PS3_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull) local_unnamed_addr #4

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #4

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

attributes #0 = { mustprogress norecurse uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "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 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 = { 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 #5 = { 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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!10, !10, i64 0}
!14 = distinct !{!14, !12}
!15 = distinct !{!15, !12}
!16 = distinct !{!16, !12}
!17 = distinct !{!17, !12}
!18 = distinct !{!18, !12}


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