; LLVM IR from eyangch/competitive-programming :: Codeforces/1352 (e)

; 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

; 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 ptr, align 8
  %5 = alloca i64, align 8
  %6 = alloca i64, align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i64, align 8
  %10 = alloca i32, align 4
  %11 = alloca i64, align 8
  %12 = alloca i8, align 1
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %17 = call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %18 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %19 = getelementptr i8, ptr %18, i64 -24
  %20 = load i64, ptr %19, align 8
  %21 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %20
  %22 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %21, ptr noundef null)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #7
  %23 = 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)
  br label %24

24:                                               ; preds = %209, %0
  %25 = load i32, ptr %2, align 4, !tbaa !8
  %26 = add nsw i32 %25, -1
  store i32 %26, ptr %2, align 4, !tbaa !8
  %27 = icmp ne i32 %25, 0
  br i1 %27, label %28, label %214

28:                                               ; preds = %24
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #7
  %29 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %3)
  %30 = load i32, ptr %3, align 4, !tbaa !8
  %31 = zext i32 %30 to i64
  %32 = call ptr @llvm.stacksave.p0()
  store ptr %32, ptr %4, align 8
  %33 = alloca i32, i64 %31, align 16
  store i64 %31, ptr %5, align 8
  %34 = load i32, ptr %3, align 4, !tbaa !8
  %35 = add nsw i32 %34, 1
  %36 = zext i32 %35 to i64
  %37 = alloca i32, i64 %36, align 16
  store i64 %36, ptr %6, align 8
  %38 = load i32, ptr %3, align 4, !tbaa !8
  %39 = sext i32 %38 to i64
  %40 = getelementptr inbounds i32, ptr %37, i64 %39
  %41 = getelementptr inbounds i32, ptr %40, i64 1
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #7
  store i32 0, ptr %7, align 4, !tbaa !8
  call void @_ZSt4fillIPiiEvT_S1_RKT0_(ptr noundef %37, ptr noundef %41, ptr noundef nonnull align 4 dereferenceable(4) %7)
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #7
  store i32 0, ptr %8, align 4, !tbaa !8
  br label %42

42:                                               ; preds = %60, %28
  %43 = load i32, ptr %8, align 4, !tbaa !8
  %44 = load i32, ptr %3, align 4, !tbaa !8
  %45 = icmp slt i32 %43, %44
  br i1 %45, label %47, label %46

46:                                               ; preds = %42
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #7
  br label %63

47:                                               ; preds = %42
  %48 = load i32, ptr %8, align 4, !tbaa !8
  %49 = sext i32 %48 to i64
  %50 = getelementptr inbounds i32, ptr %33, i64 %49
  %51 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %50)
  %52 = load i32, ptr %8, align 4, !tbaa !8
  %53 = sext i32 %52 to i64
  %54 = getelementptr inbounds i32, ptr %33, i64 %53
  %55 = load i32, ptr %54, align 4, !tbaa !8
  %56 = sext i32 %55 to i64
  %57 = getelementptr inbounds i32, ptr %37, i64 %56
  %58 = load i32, ptr %57, align 4, !tbaa !8
  %59 = add nsw i32 %58, 1
  store i32 %59, ptr %57, align 4, !tbaa !8
  br label %60

60:                                               ; preds = %47
  %61 = load i32, ptr %8, align 4, !tbaa !8
  %62 = add nsw i32 %61, 1
  store i32 %62, ptr %8, align 4, !tbaa !8
  br label %42, !llvm.loop !11

63:                                               ; preds = %46
  %64 = load i32, ptr %3, align 4, !tbaa !8
  %65 = zext i32 %64 to i64
  %66 = alloca i32, i64 %65, align 16
  store i64 %65, ptr %9, align 8
  %67 = getelementptr inbounds i32, ptr %33, i64 0
  %68 = load i32, ptr %67, align 16, !tbaa !8
  %69 = getelementptr inbounds i32, ptr %66, i64 0
  store i32 %68, ptr %69, align 16, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #7
  store i32 0, ptr %10, align 4, !tbaa !8
  %70 = load i32, ptr %3, align 4, !tbaa !8
  %71 = add nsw i32 %70, 1
  %72 = zext i32 %71 to i64
  %73 = alloca i8, i64 %72, align 16
  store i64 %72, ptr %11, align 8
  %74 = load i32, ptr %3, align 4, !tbaa !8
  %75 = sext i32 %74 to i64
  %76 = getelementptr inbounds i8, ptr %73, i64 %75
  %77 = getelementptr inbounds i8, ptr %76, i64 1
  call void @llvm.lifetime.start.p0(i64 1, ptr %12) #7
  store i8 0, ptr %12, align 1, !tbaa !13
  call void @_ZSt4fillIPbbEvT_S1_RKT0_(ptr noundef %73, ptr noundef %77, ptr noundef nonnull align 1 dereferenceable(1) %12)
  call void @llvm.lifetime.end.p0(i64 1, ptr %12) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #7
  store i32 1, ptr %13, align 4, !tbaa !8
  br label %78

78:                                               ; preds = %129, %63
  %79 = load i32, ptr %13, align 4, !tbaa !8
  %80 = load i32, ptr %3, align 4, !tbaa !8
  %81 = icmp slt i32 %79, %80
  br i1 %81, label %83, label %82

82:                                               ; preds = %78
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #7
  br label %132

83:                                               ; preds = %78
  %84 = load i32, ptr %13, align 4, !tbaa !8
  %85 = sub nsw i32 %84, 1
  %86 = sext i32 %85 to i64
  %87 = getelementptr inbounds i32, ptr %66, i64 %86
  %88 = load i32, ptr %87, align 4, !tbaa !8
  %89 = load i32, ptr %13, align 4, !tbaa !8
  %90 = sext i32 %89 to i64
  %91 = getelementptr inbounds i32, ptr %33, i64 %90
  %92 = load i32, ptr %91, align 4, !tbaa !8
  %93 = add nsw i32 %88, %92
  %94 = load i32, ptr %13, align 4, !tbaa !8
  %95 = sext i32 %94 to i64
  %96 = getelementptr inbounds i32, ptr %66, i64 %95
  store i32 %93, ptr %96, align 4, !tbaa !8
  %97 = load i32, ptr %13, align 4, !tbaa !8
  %98 = sext i32 %97 to i64
  %99 = getelementptr inbounds i32, ptr %66, i64 %98
  %100 = load i32, ptr %99, align 4, !tbaa !8
  %101 = load i32, ptr %3, align 4, !tbaa !8
  %102 = icmp sle i32 %100, %101
  br i1 %102, label %103, label %128

103:                                              ; preds = %83
  %104 = load i32, ptr %13, align 4, !tbaa !8
  %105 = sext i32 %104 to i64
  %106 = getelementptr inbounds i32, ptr %66, i64 %105
  %107 = load i32, ptr %106, align 4, !tbaa !8
  %108 = sext i32 %107 to i64
  %109 = getelementptr inbounds i8, ptr %73, i64 %108
  %110 = load i8, ptr %109, align 1, !tbaa !13, !range !15, !noundef !16
  %111 = trunc i8 %110 to i1
  br i1 %111, label %128, label %112

112:                                              ; preds = %103
  %113 = load i32, ptr %13, align 4, !tbaa !8
  %114 = sext i32 %113 to i64
  %115 = getelementptr inbounds i32, ptr %66, i64 %114
  %116 = load i32, ptr %115, align 4, !tbaa !8
  %117 = sext i32 %116 to i64
  %118 = getelementptr inbounds i32, ptr %37, i64 %117
  %119 = load i32, ptr %118, align 4, !tbaa !8
  %120 = load i32, ptr %10, align 4, !tbaa !8
  %121 = add nsw i32 %120, %119
  store i32 %121, ptr %10, align 4, !tbaa !8
  %122 = load i32, ptr %13, align 4, !tbaa !8
  %123 = sext i32 %122 to i64
  %124 = getelementptr inbounds i32, ptr %66, i64 %123
  %125 = load i32, ptr %124, align 4, !tbaa !8
  %126 = sext i32 %125 to i64
  %127 = getelementptr inbounds i8, ptr %73, i64 %126
  store i8 1, ptr %127, align 1, !tbaa !13
  br label %128

128:                                              ; preds = %112, %103, %83
  br label %129

129:                                              ; preds = %128
  %130 = load i32, ptr %13, align 4, !tbaa !8
  %131 = add nsw i32 %130, 1
  store i32 %131, ptr %13, align 4, !tbaa !8
  br label %78, !llvm.loop !17

132:                                              ; preds = %82
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #7
  store i32 0, ptr %14, align 4, !tbaa !8
  br label %133

133:                                              ; preds = %206, %132
  %134 = load i32, ptr %14, align 4, !tbaa !8
  %135 = load i32, ptr %3, align 4, !tbaa !8
  %136 = sub nsw i32 %135, 2
  %137 = icmp slt i32 %134, %136
  br i1 %137, label %139, label %138

138:                                              ; preds = %133
  store i32 10, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #7
  br label %209

139:                                              ; preds = %133
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #7
  %140 = load i32, ptr %14, align 4, !tbaa !8
  %141 = add nsw i32 %140, 2
  store i32 %141, ptr %16, align 4, !tbaa !8
  br label %142

142:                                              ; preds = %201, %139
  %143 = load i32, ptr %16, align 4, !tbaa !8
  %144 = load i32, ptr %3, align 4, !tbaa !8
  %145 = icmp slt i32 %143, %144
  br i1 %145, label %147, label %146

146:                                              ; preds = %142
  store i32 13, ptr %15, align 4
  br label %204

147:                                              ; preds = %142
  %148 = load i32, ptr %16, align 4, !tbaa !8
  %149 = sext i32 %148 to i64
  %150 = getelementptr inbounds i32, ptr %66, i64 %149
  %151 = load i32, ptr %150, align 4, !tbaa !8
  %152 = load i32, ptr %14, align 4, !tbaa !8
  %153 = sext i32 %152 to i64
  %154 = getelementptr inbounds i32, ptr %66, i64 %153
  %155 = load i32, ptr %154, align 4, !tbaa !8
  %156 = sub nsw i32 %151, %155
  %157 = load i32, ptr %3, align 4, !tbaa !8
  %158 = icmp sgt i32 %156, %157
  br i1 %158, label %159, label %160

159:                                              ; preds = %147
  store i32 13, ptr %15, align 4
  br label %204

160:                                              ; preds = %147
  %161 = load i32, ptr %16, align 4, !tbaa !8
  %162 = sext i32 %161 to i64
  %163 = getelementptr inbounds i32, ptr %66, i64 %162
  %164 = load i32, ptr %163, align 4, !tbaa !8
  %165 = load i32, ptr %14, align 4, !tbaa !8
  %166 = sext i32 %165 to i64
  %167 = getelementptr inbounds i32, ptr %66, i64 %166
  %168 = load i32, ptr %167, align 4, !tbaa !8
  %169 = sub nsw i32 %164, %168
  %170 = sext i32 %169 to i64
  %171 = getelementptr inbounds i8, ptr %73, i64 %170
  %172 = load i8, ptr %171, align 1, !tbaa !13, !range !15, !noundef !16
  %173 = trunc i8 %172 to i1
  br i1 %173, label %200, label %174

174:                                              ; preds = %160
  %175 = load i32, ptr %16, align 4, !tbaa !8
  %176 = sext i32 %175 to i64
  %177 = getelementptr inbounds i32, ptr %66, i64 %176
  %178 = load i32, ptr %177, align 4, !tbaa !8
  %179 = load i32, ptr %14, align 4, !tbaa !8
  %180 = sext i32 %179 to i64
  %181 = getelementptr inbounds i32, ptr %66, i64 %180
  %182 = load i32, ptr %181, align 4, !tbaa !8
  %183 = sub nsw i32 %178, %182
  %184 = sext i32 %183 to i64
  %185 = getelementptr inbounds i32, ptr %37, i64 %184
  %186 = load i32, ptr %185, align 4, !tbaa !8
  %187 = load i32, ptr %10, align 4, !tbaa !8
  %188 = add nsw i32 %187, %186
  store i32 %188, ptr %10, align 4, !tbaa !8
  %189 = load i32, ptr %16, align 4, !tbaa !8
  %190 = sext i32 %189 to i64
  %191 = getelementptr inbounds i32, ptr %66, i64 %190
  %192 = load i32, ptr %191, align 4, !tbaa !8
  %193 = load i32, ptr %14, align 4, !tbaa !8
  %194 = sext i32 %193 to i64
  %195 = getelementptr inbounds i32, ptr %66, i64 %194
  %196 = load i32, ptr %195, align 4, !tbaa !8
  %197 = sub nsw i32 %192, %196
  %198 = sext i32 %197 to i64
  %199 = getelementptr inbounds i8, ptr %73, i64 %198
  store i8 1, ptr %199, align 1, !tbaa !13
  br label %200

200:                                              ; preds = %174, %160
  br label %201

201:                                              ; preds = %200
  %202 = load i32, ptr %16, align 4, !tbaa !8
  %203 = add nsw i32 %202, 1
  store i32 %203, ptr %16, align 4, !tbaa !8
  br label %142, !llvm.loop !18

204:                                              ; preds = %159, %146
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #7
  br label %205

205:                                              ; preds = %204
  br label %206

206:                                              ; preds = %205
  %207 = load i32, ptr %14, align 4, !tbaa !8
  %208 = add nsw i32 %207, 1
  store i32 %208, ptr %14, align 4, !tbaa !8
  br label %133, !llvm.loop !19

209:                                              ; preds = %138
  %210 = load i32, ptr %10, align 4, !tbaa !8
  %211 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %210)
  %212 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %211, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #7
  %213 = load ptr, ptr %4, align 8
  call void @llvm.stackrestore.p0(ptr %213)
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #7
  br label %24, !llvm.loop !20

214:                                              ; preds = %24
  store i32 0, ptr %1, align 4
  store i32 1, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #7
  %215 = load i32, ptr %1, align 4
  ret i32 %215
}

declare noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext) #1

; Function Attrs: mustprogress nounwind uwtable
declare noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264), ptr noundef) #2 align 2

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

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

; Function Attrs: nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #4

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4fillIPiiEvT_S1_RKT0_(ptr noundef, ptr noundef, ptr noundef nonnull align 4 dereferenceable(4)) #5

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4fillIPbbEvT_S1_RKT0_(ptr noundef, ptr noundef, ptr noundef nonnull align 1 dereferenceable(1)) #5

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

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #6 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

; Function Attrs: nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #4

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 = { "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 #2 = { mustprogress 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 #3 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { nocallback nofree nosync nounwind willreturn }
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 = { 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 = { 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 = !{!14, !14, i64 0}
!14 = !{!"bool", !10, i64 0}
!15 = !{i8 0, i8 2}
!16 = !{}
!17 = distinct !{!17, !12}
!18 = distinct !{!18, !12}
!19 = distinct !{!19, !12}
!20 = distinct !{!20, !12}


; 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

; 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 i32, align 4
  %4 = alloca i8, align 1
  %5 = tail call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %6 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %7 = getelementptr i8, ptr %6, i64 -24
  %8 = load i64, ptr %7, align 8
  %9 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %8
  %10 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %9, ptr noundef null)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #7
  %11 = 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)
  %12 = load i32, ptr %1, align 4, !tbaa !8
  %13 = add nsw i32 %12, -1
  store i32 %13, ptr %1, align 4, !tbaa !8
  %.not60 = icmp eq i32 %12, 0
  br i1 %.not60, label %._crit_edge63, label %.lr.ph62

.lr.ph62:                                         ; preds = %0, %._crit_edge58
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #7
  %14 = 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)
  %15 = load i32, ptr %2, align 4, !tbaa !8
  %16 = zext i32 %15 to i64
  %17 = call ptr @llvm.stacksave.p0()
  %18 = alloca i32, i64 %16, align 16
  %19 = load i32, ptr %2, align 4, !tbaa !8
  %20 = add nsw i32 %19, 1
  %21 = zext i32 %20 to i64
  %22 = alloca i32, i64 %21, align 16
  %23 = sext i32 %19 to i64
  %24 = getelementptr inbounds i32, ptr %22, i64 %23
  %25 = getelementptr inbounds i8, ptr %24, i64 4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #7
  store i32 0, ptr %3, align 4, !tbaa !8
  call void @_ZSt4fillIPiiEvT_S1_RKT0_(ptr noundef nonnull %22, ptr noundef nonnull %25, ptr noundef nonnull align 4 dereferenceable(4) %3)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #7
  %26 = load i32, ptr %2, align 4, !tbaa !8
  %27 = icmp sgt i32 %26, 0
  br i1 %27, label %.lr.ph, label %.lr.ph62.._crit_edge_crit_edge

.lr.ph62.._crit_edge_crit_edge:                   ; preds = %.lr.ph62
  %.pre = sext i32 %26 to i64
  br label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %.lr.ph62.._crit_edge_crit_edge
  %.pre-phi = phi i64 [ %.pre, %.lr.ph62.._crit_edge_crit_edge ], [ %46, %.lr.ph ]
  %.lcssa = phi i32 [ %26, %.lr.ph62.._crit_edge_crit_edge ], [ %45, %.lr.ph ]
  %28 = zext i32 %.lcssa to i64
  %29 = alloca i32, i64 %28, align 16
  %30 = load i32, ptr %18, align 16, !tbaa !8
  store i32 %30, ptr %29, align 16, !tbaa !8
  %31 = add nsw i32 %.lcssa, 1
  %32 = zext i32 %31 to i64
  %33 = alloca i8, i64 %32, align 16
  %34 = getelementptr inbounds i8, ptr %33, i64 %.pre-phi
  %35 = getelementptr inbounds i8, ptr %34, i64 1
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %4) #7
  store i8 0, ptr %4, align 1, !tbaa !11
  call void @_ZSt4fillIPbbEvT_S1_RKT0_(ptr noundef nonnull %33, ptr noundef nonnull %35, ptr noundef nonnull align 1 dereferenceable(1) %4)
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %4) #7
  %36 = load i32, ptr %2, align 4, !tbaa !8
  %37 = icmp sgt i32 %36, 1
  br i1 %37, label %.lr.ph44.preheader, label %._crit_edge58

.lr.ph44.preheader:                               ; preds = %._crit_edge
  %wide.trip.count = zext nneg i32 %36 to i64
  %load_initial = load i32, ptr %29, align 16
  br label %.lr.ph44

.lr.ph:                                           ; preds = %.lr.ph62, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %.lr.ph62 ]
  %38 = getelementptr inbounds i32, ptr %18, i64 %indvars.iv
  %39 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %38)
  %40 = load i32, ptr %38, align 4, !tbaa !8
  %41 = sext i32 %40 to i64
  %42 = getelementptr inbounds i32, ptr %22, i64 %41
  %43 = load i32, ptr %42, align 4, !tbaa !8
  %44 = add nsw i32 %43, 1
  store i32 %44, ptr %42, align 4, !tbaa !8
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %45 = load i32, ptr %2, align 4, !tbaa !8
  %46 = sext i32 %45 to i64
  %47 = icmp slt i64 %indvars.iv.next, %46
  br i1 %47, label %.lr.ph, label %._crit_edge, !llvm.loop !13

.preheader:                                       ; preds = %62
  %.not84 = icmp eq i32 %36, 2
  br i1 %.not84, label %._crit_edge58, label %.lr.ph57.preheader

.lr.ph57.preheader:                               ; preds = %.preheader
  %48 = add nsw i32 %36, -2
  %wide.trip.count79 = zext nneg i32 %48 to i64
  %wide.trip.count74 = zext nneg i32 %36 to i64
  br label %.lr.ph50

.lr.ph44:                                         ; preds = %.lr.ph44.preheader, %62
  %store_forwarded = phi i32 [ %load_initial, %.lr.ph44.preheader ], [ %52, %62 ]
  %indvars.iv66 = phi i64 [ 1, %.lr.ph44.preheader ], [ %indvars.iv.next67, %62 ]
  %.03241 = phi i32 [ 0, %.lr.ph44.preheader ], [ %.1, %62 ]
  %49 = getelementptr i32, ptr %29, i64 %indvars.iv66
  %50 = getelementptr inbounds i32, ptr %18, i64 %indvars.iv66
  %51 = load i32, ptr %50, align 4, !tbaa !8
  %52 = add nsw i32 %51, %store_forwarded
  store i32 %52, ptr %49, align 4, !tbaa !8
  %.not38 = icmp sgt i32 %52, %36
  br i1 %.not38, label %62, label %53

53:                                               ; preds = %.lr.ph44
  %54 = sext i32 %52 to i64
  %55 = getelementptr inbounds i8, ptr %33, i64 %54
  %56 = load i8, ptr %55, align 1, !tbaa !11, !range !15, !noundef !16
  %57 = trunc nuw i8 %56 to i1
  br i1 %57, label %62, label %58

58:                                               ; preds = %53
  %59 = getelementptr inbounds i32, ptr %22, i64 %54
  %60 = load i32, ptr %59, align 4, !tbaa !8
  %61 = add nsw i32 %60, %.03241
  store i8 1, ptr %55, align 1, !tbaa !11
  br label %62

62:                                               ; preds = %.lr.ph44, %53, %58
  %.1 = phi i32 [ %.03241, %53 ], [ %61, %58 ], [ %.03241, %.lr.ph44 ]
  %indvars.iv.next67 = add nuw nsw i64 %indvars.iv66, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next67, %wide.trip.count
  br i1 %exitcond.not, label %.preheader, label %.lr.ph44, !llvm.loop !17

._crit_edge58:                                    ; preds = %._crit_edge51, %._crit_edge, %.preheader
  %.2.lcssa = phi i32 [ %.1, %.preheader ], [ 0, %._crit_edge ], [ %.3.lcssa.ph, %._crit_edge51 ]
  %63 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %.2.lcssa)
  %64 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %63, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.stackrestore.p0(ptr %17)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #7
  %65 = load i32, ptr %1, align 4, !tbaa !8
  %66 = add nsw i32 %65, -1
  store i32 %66, ptr %1, align 4, !tbaa !8
  %.not = icmp eq i32 %65, 0
  br i1 %.not, label %._crit_edge63, label %.lr.ph62, !llvm.loop !18

.lr.ph50:                                         ; preds = %._crit_edge51, %.lr.ph57.preheader
  %indvars.iv76 = phi i64 [ 0, %.lr.ph57.preheader ], [ %indvars.iv.next77, %._crit_edge51 ]
  %indvars.iv69 = phi i64 [ 2, %.lr.ph57.preheader ], [ %indvars.iv.next70, %._crit_edge51 ]
  %.255 = phi i32 [ %.1, %.lr.ph57.preheader ], [ %.3.lcssa.ph, %._crit_edge51 ]
  %67 = getelementptr inbounds i32, ptr %29, i64 %indvars.iv76
  %68 = load i32, ptr %67, align 4, !tbaa !8
  br label %69

69:                                               ; preds = %.lr.ph50, %83
  %indvars.iv71 = phi i64 [ %indvars.iv69, %.lr.ph50 ], [ %indvars.iv.next72, %83 ]
  %.347 = phi i32 [ %.255, %.lr.ph50 ], [ %.4, %83 ]
  %70 = getelementptr inbounds i32, ptr %29, i64 %indvars.iv71
  %71 = load i32, ptr %70, align 4, !tbaa !8
  %72 = sub nsw i32 %71, %68
  %73 = icmp sgt i32 %72, %36
  br i1 %73, label %._crit_edge51, label %74

74:                                               ; preds = %69
  %75 = sext i32 %72 to i64
  %76 = getelementptr inbounds i8, ptr %33, i64 %75
  %77 = load i8, ptr %76, align 1, !tbaa !11, !range !15, !noundef !16
  %78 = trunc nuw i8 %77 to i1
  br i1 %78, label %83, label %79

79:                                               ; preds = %74
  %80 = getelementptr inbounds i32, ptr %22, i64 %75
  %81 = load i32, ptr %80, align 4, !tbaa !8
  %82 = add nsw i32 %81, %.347
  store i8 1, ptr %76, align 1, !tbaa !11
  br label %83

83:                                               ; preds = %74, %79
  %.4 = phi i32 [ %.347, %74 ], [ %82, %79 ]
  %indvars.iv.next72 = add nuw nsw i64 %indvars.iv71, 1
  %exitcond75.not = icmp eq i64 %indvars.iv.next72, %wide.trip.count74
  br i1 %exitcond75.not, label %._crit_edge51, label %69, !llvm.loop !19

._crit_edge51:                                    ; preds = %83, %69
  %.3.lcssa.ph = phi i32 [ %.4, %83 ], [ %.347, %69 ]
  %indvars.iv.next77 = add nuw nsw i64 %indvars.iv76, 1
  %indvars.iv.next70 = add nuw nsw i64 %indvars.iv69, 1
  %exitcond80.not = icmp eq i64 %indvars.iv.next77, %wide.trip.count79
  br i1 %exitcond80.not, label %._crit_edge58, label %.lr.ph50, !llvm.loop !20

._crit_edge63:                                    ; preds = %._crit_edge58, %0
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #7
  ret i32 0
}

declare noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext) local_unnamed_addr #1

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

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

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 #1

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #4

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4fillIPiiEvT_S1_RKT0_(ptr noundef, ptr noundef, ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #5

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4fillIPbbEvT_S1_RKT0_(ptr noundef, ptr noundef, ptr noundef nonnull align 1 dereferenceable(1)) local_unnamed_addr #5

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

; 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 #6 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

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #4

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 = { "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 #2 = { mustprogress 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 #3 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { mustprogress nocallback nofree nosync nounwind willreturn }
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 = { 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 = { 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 = !{!12, !12, i64 0}
!12 = !{!"bool", !10, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = !{i8 0, i8 2}
!16 = !{}
!17 = distinct !{!17, !14}
!18 = distinct !{!18, !14}
!19 = distinct !{!19, !14}
!20 = distinct !{!20, !14}


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