; LLVM IR from eyangch/competitive-programming :: Codeforces/1375 (b)

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

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

27:                                               ; preds = %23
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #7
  %28 = 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)
  %29 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %28, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %30 = load i32, ptr %3, align 4, !tbaa !8
  %31 = zext i32 %30 to i64
  %32 = load i32, ptr %4, align 4, !tbaa !8
  %33 = zext i32 %32 to i64
  %34 = call ptr @llvm.stacksave.p0()
  store ptr %34, ptr %5, align 8
  %35 = mul nuw i64 %31, %33
  %36 = alloca i32, i64 %35, align 16
  store i64 %31, ptr %6, align 8
  store i64 %33, ptr %7, align 8
  call void @llvm.lifetime.start.p0(i64 1, ptr %8) #7
  store i8 1, ptr %8, align 1, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #7
  store i32 0, ptr %9, align 4, !tbaa !8
  br label %37

37:                                               ; preds = %95, %27
  %38 = load i32, ptr %9, align 4, !tbaa !8
  %39 = load i32, ptr %3, align 4, !tbaa !8
  %40 = icmp slt i32 %38, %39
  br i1 %40, label %42, label %41

41:                                               ; preds = %37
  store i32 4, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #7
  br label %98

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

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

47:                                               ; preds = %43
  store i32 7, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #7
  br label %94

48:                                               ; preds = %43
  %49 = load i32, ptr %9, align 4, !tbaa !8
  %50 = sext i32 %49 to i64
  %51 = mul nsw i64 %50, %33
  %52 = getelementptr inbounds i32, ptr %36, i64 %51
  %53 = load i32, ptr %11, align 4, !tbaa !8
  %54 = sext i32 %53 to i64
  %55 = getelementptr inbounds i32, ptr %52, i64 %54
  %56 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %55)
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #7
  store i32 4, ptr %12, align 4, !tbaa !8
  %57 = load i32, ptr %9, align 4, !tbaa !8
  %58 = icmp eq i32 %57, 0
  br i1 %58, label %64, label %59

59:                                               ; preds = %48
  %60 = load i32, ptr %9, align 4, !tbaa !8
  %61 = load i32, ptr %3, align 4, !tbaa !8
  %62 = sub nsw i32 %61, 1
  %63 = icmp eq i32 %60, %62
  br i1 %63, label %64, label %67

64:                                               ; preds = %59, %48
  %65 = load i32, ptr %12, align 4, !tbaa !8
  %66 = add nsw i32 %65, -1
  store i32 %66, ptr %12, align 4, !tbaa !8
  br label %67

67:                                               ; preds = %64, %59
  %68 = load i32, ptr %11, align 4, !tbaa !8
  %69 = icmp eq i32 %68, 0
  br i1 %69, label %75, label %70

70:                                               ; preds = %67
  %71 = load i32, ptr %11, align 4, !tbaa !8
  %72 = load i32, ptr %4, align 4, !tbaa !8
  %73 = sub nsw i32 %72, 1
  %74 = icmp eq i32 %71, %73
  br i1 %74, label %75, label %78

75:                                               ; preds = %70, %67
  %76 = load i32, ptr %12, align 4, !tbaa !8
  %77 = add nsw i32 %76, -1
  store i32 %77, ptr %12, align 4, !tbaa !8
  br label %78

78:                                               ; preds = %75, %70
  %79 = load i32, ptr %9, align 4, !tbaa !8
  %80 = sext i32 %79 to i64
  %81 = mul nsw i64 %80, %33
  %82 = getelementptr inbounds i32, ptr %36, i64 %81
  %83 = load i32, ptr %11, align 4, !tbaa !8
  %84 = sext i32 %83 to i64
  %85 = getelementptr inbounds i32, ptr %82, i64 %84
  %86 = load i32, ptr %85, align 4, !tbaa !8
  %87 = load i32, ptr %12, align 4, !tbaa !8
  %88 = icmp sgt i32 %86, %87
  br i1 %88, label %89, label %90

89:                                               ; preds = %78
  store i8 0, ptr %8, align 1, !tbaa !11
  br label %90

90:                                               ; preds = %89, %78
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #7
  br label %91

91:                                               ; preds = %90
  %92 = load i32, ptr %11, align 4, !tbaa !8
  %93 = add nsw i32 %92, 1
  store i32 %93, ptr %11, align 4, !tbaa !8
  br label %43, !llvm.loop !13

94:                                               ; preds = %47
  br label %95

95:                                               ; preds = %94
  %96 = load i32, ptr %9, align 4, !tbaa !8
  %97 = add nsw i32 %96, 1
  store i32 %97, ptr %9, align 4, !tbaa !8
  br label %37, !llvm.loop !15

98:                                               ; preds = %41
  %99 = load i8, ptr %8, align 1, !tbaa !11, !range !16, !noundef !17
  %100 = trunc i8 %99 to i1
  br i1 %100, label %104, label %101

101:                                              ; preds = %98
  %102 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str)
  %103 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %102, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  store i32 2, ptr %10, align 4
  br label %153, !llvm.loop !18

104:                                              ; preds = %98
  %105 = 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)
  %106 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %105, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #7
  store i32 0, ptr %13, align 4, !tbaa !8
  br label %107

107:                                              ; preds = %149, %104
  %108 = load i32, ptr %13, align 4, !tbaa !8
  %109 = load i32, ptr %3, align 4, !tbaa !8
  %110 = icmp slt i32 %108, %109
  br i1 %110, label %112, label %111

111:                                              ; preds = %107
  store i32 10, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #7
  br label %152

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

113:                                              ; preds = %144, %112
  %114 = load i32, ptr %14, align 4, !tbaa !8
  %115 = load i32, ptr %4, align 4, !tbaa !8
  %116 = icmp slt i32 %114, %115
  br i1 %116, label %118, label %117

117:                                              ; preds = %113
  store i32 13, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #7
  br label %147

118:                                              ; preds = %113
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #7
  store i32 4, ptr %15, align 4, !tbaa !8
  %119 = load i32, ptr %13, align 4, !tbaa !8
  %120 = icmp eq i32 %119, 0
  br i1 %120, label %126, label %121

121:                                              ; preds = %118
  %122 = load i32, ptr %13, align 4, !tbaa !8
  %123 = load i32, ptr %3, align 4, !tbaa !8
  %124 = sub nsw i32 %123, 1
  %125 = icmp eq i32 %122, %124
  br i1 %125, label %126, label %129

126:                                              ; preds = %121, %118
  %127 = load i32, ptr %15, align 4, !tbaa !8
  %128 = add nsw i32 %127, -1
  store i32 %128, ptr %15, align 4, !tbaa !8
  br label %129

129:                                              ; preds = %126, %121
  %130 = load i32, ptr %14, align 4, !tbaa !8
  %131 = icmp eq i32 %130, 0
  br i1 %131, label %137, label %132

132:                                              ; preds = %129
  %133 = load i32, ptr %14, align 4, !tbaa !8
  %134 = load i32, ptr %4, align 4, !tbaa !8
  %135 = sub nsw i32 %134, 1
  %136 = icmp eq i32 %133, %135
  br i1 %136, label %137, label %140

137:                                              ; preds = %132, %129
  %138 = load i32, ptr %15, align 4, !tbaa !8
  %139 = add nsw i32 %138, -1
  store i32 %139, ptr %15, align 4, !tbaa !8
  br label %140

140:                                              ; preds = %137, %132
  %141 = load i32, ptr %15, align 4, !tbaa !8
  %142 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %141)
  %143 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %142, ptr noundef @.str.2)
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #7
  br label %144

144:                                              ; preds = %140
  %145 = load i32, ptr %14, align 4, !tbaa !8
  %146 = add nsw i32 %145, 1
  store i32 %146, ptr %14, align 4, !tbaa !8
  br label %113, !llvm.loop !19

147:                                              ; preds = %117
  %148 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %149

149:                                              ; preds = %147
  %150 = load i32, ptr %13, align 4, !tbaa !8
  %151 = add nsw i32 %150, 1
  store i32 %151, ptr %13, align 4, !tbaa !8
  br label %107, !llvm.loop !20

152:                                              ; preds = %111
  store i32 0, ptr %10, align 4
  br label %153

153:                                              ; preds = %152, %101
  call void @llvm.lifetime.end.p0(i64 1, ptr %8) #7
  %154 = load ptr, ptr %5, align 8
  call void @llvm.stackrestore.p0(ptr %154)
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #7
  %155 = load i32, ptr %10, align 4
  switch i32 %155, label %159 [
    i32 0, label %156
    i32 2, label %23
  ]

156:                                              ; preds = %153
  br label %23, !llvm.loop !18

157:                                              ; preds = %23
  store i32 0, ptr %1, align 4
  store i32 1, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #7
  %158 = load i32, ptr %1, align 4
  ret i32 %158

159:                                              ; preds = %153
  unreachable
}

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: 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 noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #5

; 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

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

; 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 = !{!12, !12, i64 0}
!12 = !{!"bool", !10, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}
!16 = !{i8 0, i8 2}
!17 = !{}
!18 = distinct !{!18, !14}
!19 = distinct !{!19, !14}
!20 = distinct !{!20, !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 [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [2 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 i32, align 4
  %3 = alloca i32, align 4
  %4 = tail call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %5 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %6 = getelementptr i8, ptr %5, i64 -24
  %7 = load i64, ptr %6, align 8
  %8 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %7
  %9 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %8, ptr noundef null)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #7
  %10 = 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)
  %11 = load i32, ptr %1, align 4, !tbaa !8
  %12 = add nsw i32 %11, -1
  store i32 %12, ptr %1, align 4, !tbaa !8
  %.not52 = icmp eq i32 %11, 0
  br i1 %.not52, label %._crit_edge55, label %.lr.ph54

.lr.ph54:                                         ; preds = %0, %.loopexit
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #7
  %13 = 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)
  %14 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %13, ptr noundef nonnull align 4 dereferenceable(4) %3)
  %15 = load i32, ptr %2, align 4, !tbaa !8
  %16 = zext i32 %15 to i64
  %17 = load i32, ptr %3, align 4, !tbaa !8
  %18 = zext i32 %17 to i64
  %19 = call ptr @llvm.stacksave.p0()
  %20 = mul nuw i64 %18, %16
  %21 = alloca i32, i64 %20, align 16
  %22 = load i32, ptr %2, align 4, !tbaa !8
  %23 = icmp sgt i32 %22, 0
  %24 = load i32, ptr %3, align 4
  %25 = icmp sgt i32 %24, 0
  %or.cond = select i1 %23, i1 %25, i1 false
  br i1 %or.cond, label %.preheader37, label %.critedge

.preheader37:                                     ; preds = %.lr.ph54, %._crit_edge
  %26 = phi i32 [ %57, %._crit_edge ], [ %22, %.lr.ph54 ]
  %27 = phi i32 [ %58, %._crit_edge ], [ %24, %.lr.ph54 ]
  %indvars.iv64 = phi i64 [ %indvars.iv.next65, %._crit_edge ], [ 0, %.lr.ph54 ]
  %.03441 = phi i1 [ %.135.lcssa, %._crit_edge ], [ true, %.lr.ph54 ]
  %28 = icmp sgt i32 %27, 0
  br i1 %28, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %.preheader37
  %29 = mul nuw nsw i64 %indvars.iv64, %18
  %30 = getelementptr inbounds i32, ptr %21, i64 %29
  %31 = icmp eq i64 %indvars.iv64, 0
  %32 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %30)
  br i1 %31, label %42, label %33

33:                                               ; preds = %.lr.ph
  %34 = load i32, ptr %2, align 4, !tbaa !8
  %.pre.pre = load i32, ptr %3, align 4, !tbaa !8
  %35 = add nsw i32 %34, -1
  %36 = zext i32 %35 to i64
  %37 = icmp eq i64 %indvars.iv64, %36
  %38 = select i1 %37, i32 2, i32 3
  %39 = load i32, ptr %30, align 4, !tbaa !8
  %40 = icmp sle i32 %39, %38
  %spec.select.peel = select i1 %40, i1 %.03441, i1 false
  %41 = icmp sgt i32 %.pre.pre, 1
  br i1 %41, label %.lr.ph.split.peel.next, label %._crit_edge

42:                                               ; preds = %.lr.ph
  %.pre73.pre = load i32, ptr %3, align 4, !tbaa !8
  %43 = load i32, ptr %30, align 4, !tbaa !8
  %44 = icmp slt i32 %43, 3
  %spec.select.us.peel = select i1 %44, i1 %.03441, i1 false
  %45 = icmp sgt i32 %.pre73.pre, 1
  br i1 %45, label %.lr.ph.split.us.peel.next, label %._crit_edge.loopexit

.lr.ph.split.us.peel.next:                        ; preds = %42, %.lr.ph.split.us.peel.next
  %indvars.iv61 = phi i64 [ %indvars.iv.next62, %.lr.ph.split.us.peel.next ], [ 1, %42 ]
  %.13538.us = phi i1 [ %spec.select.us, %.lr.ph.split.us.peel.next ], [ %spec.select.us.peel, %42 ]
  %46 = getelementptr inbounds i32, ptr %30, i64 %indvars.iv61
  %47 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %46)
  %48 = load i32, ptr %3, align 4, !tbaa !8
  %49 = add nsw i32 %48, -1
  %50 = zext i32 %49 to i64
  %51 = icmp eq i64 %indvars.iv61, %50
  %spec.select83 = select i1 %51, i32 2, i32 3
  %52 = load i32, ptr %46, align 4, !tbaa !8
  %53 = icmp sle i32 %52, %spec.select83
  %spec.select.us = select i1 %53, i1 %.13538.us, i1 false
  %indvars.iv.next62 = add nuw nsw i64 %indvars.iv61, 1
  %54 = sext i32 %48 to i64
  %55 = icmp slt i64 %indvars.iv.next62, %54
  br i1 %55, label %.lr.ph.split.us.peel.next, label %._crit_edge.loopexit, !llvm.loop !11

._crit_edge44:                                    ; preds = %._crit_edge
  br i1 %.135.lcssa, label %.critedge, label %76

._crit_edge.loopexit:                             ; preds = %.lr.ph.split.us.peel.next, %42
  %56 = phi i32 [ %.pre73.pre, %42 ], [ %48, %.lr.ph.split.us.peel.next ]
  %spec.select.us.lcssa = phi i1 [ %spec.select.us.peel, %42 ], [ %spec.select.us, %.lr.ph.split.us.peel.next ]
  %.pre75 = load i32, ptr %2, align 4, !tbaa !8
  br label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph.split.peel.next, %33, %._crit_edge.loopexit, %.preheader37
  %57 = phi i32 [ %26, %.preheader37 ], [ %.pre75, %._crit_edge.loopexit ], [ %34, %33 ], [ %63, %.lr.ph.split.peel.next ]
  %58 = phi i32 [ %27, %.preheader37 ], [ %56, %._crit_edge.loopexit ], [ %.pre.pre, %33 ], [ %67, %.lr.ph.split.peel.next ]
  %.135.lcssa = phi i1 [ %.03441, %.preheader37 ], [ %spec.select.us.lcssa, %._crit_edge.loopexit ], [ %spec.select.peel, %33 ], [ %spec.select, %.lr.ph.split.peel.next ]
  %indvars.iv.next65 = add nuw nsw i64 %indvars.iv64, 1
  %59 = sext i32 %57 to i64
  %60 = icmp slt i64 %indvars.iv.next65, %59
  br i1 %60, label %.preheader37, label %._crit_edge44, !llvm.loop !14

.lr.ph.split.peel.next:                           ; preds = %33, %.lr.ph.split.peel.next
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph.split.peel.next ], [ 1, %33 ]
  %.13538 = phi i1 [ %spec.select, %.lr.ph.split.peel.next ], [ %spec.select.peel, %33 ]
  %61 = getelementptr inbounds i32, ptr %30, i64 %indvars.iv
  %62 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %61)
  %63 = load i32, ptr %2, align 4, !tbaa !8
  %64 = add nsw i32 %63, -1
  %65 = zext i32 %64 to i64
  %66 = icmp eq i64 %indvars.iv64, %65
  %spec.select56 = select i1 %66, i32 3, i32 4
  %67 = load i32, ptr %3, align 4, !tbaa !8
  %68 = add nsw i32 %67, -1
  %69 = zext i32 %68 to i64
  %70 = icmp eq i64 %indvars.iv, %69
  %71 = sext i1 %70 to i32
  %spec.select84 = add nsw i32 %spec.select56, %71
  %72 = load i32, ptr %61, align 4, !tbaa !8
  %73 = icmp sle i32 %72, %spec.select84
  %spec.select = select i1 %73, i1 %.13538, i1 false
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %74 = sext i32 %67 to i64
  %75 = icmp slt i64 %indvars.iv.next, %74
  br i1 %75, label %.lr.ph.split.peel.next, label %._crit_edge, !llvm.loop !16

76:                                               ; preds = %._crit_edge44
  %77 = 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)
  %78 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %77, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %.loopexit, !llvm.loop !17

.critedge:                                        ; preds = %.lr.ph54, %._crit_edge44
  %79 = 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)
  %80 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %79, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  %81 = load i32, ptr %2, align 4, !tbaa !8
  %82 = icmp sgt i32 %81, 0
  br i1 %82, label %.preheader, label %.loopexit

.preheader:                                       ; preds = %.critedge, %._crit_edge49
  %83 = phi i32 [ %107, %._crit_edge49 ], [ %81, %.critedge ]
  %.02950 = phi i32 [ %106, %._crit_edge49 ], [ 0, %.critedge ]
  %84 = load i32, ptr %3, align 4, !tbaa !8
  %85 = icmp sgt i32 %84, 0
  br i1 %85, label %.lr.ph48, label %._crit_edge49

.lr.ph48:                                         ; preds = %.preheader
  %86 = icmp eq i32 %.02950, 0
  br i1 %86, label %.lr.ph48.split.us.preheader, label %.lr.ph48.split.preheader

.lr.ph48.split.preheader:                         ; preds = %.lr.ph48
  %87 = add nsw i32 %83, -1
  %88 = icmp eq i32 %.02950, %87
  %.1.peel = select i1 %88, i32 2, i32 3
  %89 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %.1.peel)
  %90 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %89, ptr noundef nonnull @.str.2)
  %91 = load i32, ptr %3, align 4, !tbaa !8
  %92 = icmp sgt i32 %91, 1
  br i1 %92, label %.lr.ph48.split, label %._crit_edge49

.lr.ph48.split.us.preheader:                      ; preds = %.lr.ph48
  %93 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef 2)
  %94 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %93, ptr noundef nonnull @.str.2)
  %95 = load i32, ptr %3, align 4, !tbaa !8
  %96 = icmp sgt i32 %95, 1
  br i1 %96, label %.lr.ph48.split.us, label %._crit_edge49

.lr.ph48.split.us:                                ; preds = %.lr.ph48.split.us.preheader, %.lr.ph48.split.us
  %97 = phi i32 [ %103, %.lr.ph48.split.us ], [ %95, %.lr.ph48.split.us.preheader ]
  %.02847.us = phi i32 [ %102, %.lr.ph48.split.us ], [ 1, %.lr.ph48.split.us.preheader ]
  %98 = add nsw i32 %97, -1
  %99 = icmp eq i32 %.02847.us, %98
  %.1.us = select i1 %99, i32 2, i32 3
  %100 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %.1.us)
  %101 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %100, ptr noundef nonnull @.str.2)
  %102 = add nuw nsw i32 %.02847.us, 1
  %103 = load i32, ptr %3, align 4, !tbaa !8
  %104 = icmp slt i32 %102, %103
  br i1 %104, label %.lr.ph48.split.us, label %._crit_edge49, !llvm.loop !18

._crit_edge49:                                    ; preds = %.lr.ph48.split, %.lr.ph48.split.us, %.lr.ph48.split.preheader, %.lr.ph48.split.us.preheader, %.preheader
  %105 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  %106 = add nuw nsw i32 %.02950, 1
  %107 = load i32, ptr %2, align 4, !tbaa !8
  %108 = icmp slt i32 %106, %107
  br i1 %108, label %.preheader, label %.loopexit, !llvm.loop !19

.lr.ph48.split:                                   ; preds = %.lr.ph48.split.preheader, %.lr.ph48.split
  %109 = phi i32 [ %119, %.lr.ph48.split ], [ %91, %.lr.ph48.split.preheader ]
  %.02847 = phi i32 [ %118, %.lr.ph48.split ], [ 1, %.lr.ph48.split.preheader ]
  %110 = load i32, ptr %2, align 4, !tbaa !8
  %111 = add nsw i32 %110, -1
  %112 = icmp eq i32 %.02950, %111
  %spec.select57 = select i1 %112, i32 3, i32 4
  %113 = add nsw i32 %109, -1
  %114 = icmp eq i32 %.02847, %113
  %115 = sext i1 %114 to i32
  %.1 = add nsw i32 %spec.select57, %115
  %116 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %.1)
  %117 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %116, ptr noundef nonnull @.str.2)
  %118 = add nuw nsw i32 %.02847, 1
  %119 = load i32, ptr %3, align 4, !tbaa !8
  %120 = icmp slt i32 %118, %119
  br i1 %120, label %.lr.ph48.split, label %._crit_edge49, !llvm.loop !20

.loopexit:                                        ; preds = %._crit_edge49, %.critedge, %76
  call void @llvm.stackrestore.p0(ptr %19)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #7
  %121 = load i32, ptr %1, align 4, !tbaa !8
  %122 = add nsw i32 %121, -1
  store i32 %122, ptr %1, align 4, !tbaa !8
  %.not = icmp eq i32 %121, 0
  br i1 %.not, label %._crit_edge55, label %.lr.ph54

._crit_edge55:                                    ; preds = %.loopexit, %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: 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 noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #5

; 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

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 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 = distinct !{!11, !12, !13}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!"llvm.loop.peeled.count", i32 1}
!14 = distinct !{!14, !12, !15}
!15 = !{!"llvm.loop.unswitch.partial.disable"}
!16 = distinct !{!16, !12, !13}
!17 = distinct !{!17, !12}
!18 = distinct !{!18, !12, !13}
!19 = distinct !{!19, !12}
!20 = distinct !{!20, !12, !13}


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