; LLVM IR from eyangch/competitive-programming :: Codeforces/1330 (c)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"class.std::basic_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 [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 ptr, align 8
  %5 = alloca i64, align 8
  %6 = alloca i32, align 4
  %7 = alloca i8, align 1
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i64, align 8
  %11 = alloca i32, align 4
  %12 = alloca i64, align 8
  %13 = alloca i32, align 4
  %14 = alloca i64, align 8
  %15 = alloca i64, align 8
  %16 = alloca i64, align 8
  %17 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %18 = call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %19 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %20 = getelementptr i8, ptr %19, i64 -24
  %21 = load i64, ptr %20, align 8
  %22 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %21
  %23 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %22, ptr noundef null)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #8
  %24 = 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)
  %25 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %24, ptr noundef nonnull align 4 dereferenceable(4) %3)
  %26 = load i32, ptr %3, align 4, !tbaa !8
  %27 = zext i32 %26 to i64
  %28 = call ptr @llvm.stacksave.p0()
  store ptr %28, ptr %4, align 8
  %29 = alloca i64, i64 %27, align 16
  store i64 %27, ptr %5, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #8
  store i32 0, ptr %6, align 4, !tbaa !8
  br label %30

30:                                               ; preds = %40, %0
  %31 = load i32, ptr %6, align 4, !tbaa !8
  %32 = load i32, ptr %3, align 4, !tbaa !8
  %33 = icmp slt i32 %31, %32
  br i1 %33, label %35, label %34

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

35:                                               ; preds = %30
  %36 = load i32, ptr %6, align 4, !tbaa !8
  %37 = sext i32 %36 to i64
  %38 = getelementptr inbounds i64, ptr %29, i64 %37
  %39 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %38)
  br label %40

40:                                               ; preds = %35
  %41 = load i32, ptr %6, align 4, !tbaa !8
  %42 = add nsw i32 %41, 1
  store i32 %42, ptr %6, align 4, !tbaa !8
  br label %30, !llvm.loop !11

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

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

48:                                               ; preds = %44
  store i32 5, ptr %9, align 4
  br label %65

49:                                               ; preds = %44
  %50 = load i32, ptr %8, align 4, !tbaa !8
  %51 = sext i32 %50 to i64
  %52 = load i32, ptr %8, align 4, !tbaa !8
  %53 = sext i32 %52 to i64
  %54 = getelementptr inbounds i64, ptr %29, i64 %53
  %55 = load i64, ptr %54, align 8, !tbaa !15
  %56 = add nsw i64 %51, %55
  %57 = load i32, ptr %2, align 4, !tbaa !8
  %58 = sext i32 %57 to i64
  %59 = icmp sgt i64 %56, %58
  br i1 %59, label %60, label %61

60:                                               ; preds = %49
  store i8 0, ptr %7, align 1, !tbaa !13
  store i32 5, ptr %9, align 4
  br label %65

61:                                               ; preds = %49
  br label %62

62:                                               ; preds = %61
  %63 = load i32, ptr %8, align 4, !tbaa !8
  %64 = add nsw i32 %63, 1
  store i32 %64, ptr %8, align 4, !tbaa !8
  br label %44, !llvm.loop !17

65:                                               ; preds = %60, %48
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #8
  br label %66

66:                                               ; preds = %65
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #8
  store i64 0, ptr %10, align 8, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #8
  store i32 0, ptr %11, align 4, !tbaa !8
  br label %67

67:                                               ; preds = %79, %66
  %68 = load i32, ptr %11, align 4, !tbaa !8
  %69 = load i32, ptr %3, align 4, !tbaa !8
  %70 = icmp slt i32 %68, %69
  br i1 %70, label %72, label %71

71:                                               ; preds = %67
  store i32 8, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #8
  br label %82

72:                                               ; preds = %67
  %73 = load i32, ptr %11, align 4, !tbaa !8
  %74 = sext i32 %73 to i64
  %75 = getelementptr inbounds i64, ptr %29, i64 %74
  %76 = load i64, ptr %75, align 8, !tbaa !15
  %77 = load i64, ptr %10, align 8, !tbaa !15
  %78 = add nsw i64 %77, %76
  store i64 %78, ptr %10, align 8, !tbaa !15
  br label %79

79:                                               ; preds = %72
  %80 = load i32, ptr %11, align 4, !tbaa !8
  %81 = add nsw i32 %80, 1
  store i32 %81, ptr %11, align 4, !tbaa !8
  br label %67, !llvm.loop !18

82:                                               ; preds = %71
  %83 = load i64, ptr %10, align 8, !tbaa !15
  %84 = load i32, ptr %2, align 4, !tbaa !8
  %85 = sext i32 %84 to i64
  %86 = icmp slt i64 %83, %85
  br i1 %86, label %87, label %88

87:                                               ; preds = %82
  store i8 0, ptr %7, align 1, !tbaa !13
  br label %88

88:                                               ; preds = %87, %82
  %89 = load i8, ptr %7, align 1, !tbaa !13, !range !19, !noundef !20
  %90 = trunc i8 %89 to i1
  br i1 %90, label %94, label %91

91:                                               ; preds = %88
  %92 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef -1)
  %93 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %92, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  store i32 0, ptr %1, align 4
  store i32 1, ptr %9, align 4
  br label %159

94:                                               ; preds = %88
  %95 = load i32, ptr %3, align 4, !tbaa !8
  %96 = zext i32 %95 to i64
  %97 = alloca i64, i64 %96, align 16
  store i64 %96, ptr %12, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #8
  store i32 0, ptr %13, align 4, !tbaa !8
  br label %98

98:                                               ; preds = %109, %94
  %99 = load i32, ptr %13, align 4, !tbaa !8
  %100 = load i32, ptr %3, align 4, !tbaa !8
  %101 = icmp slt i32 %99, %100
  br i1 %101, label %103, label %102

102:                                              ; preds = %98
  store i32 11, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #8
  br label %112

103:                                              ; preds = %98
  %104 = load i32, ptr %13, align 4, !tbaa !8
  %105 = sext i32 %104 to i64
  %106 = load i32, ptr %13, align 4, !tbaa !8
  %107 = sext i32 %106 to i64
  %108 = getelementptr inbounds i64, ptr %97, i64 %107
  store i64 %105, ptr %108, align 8, !tbaa !15
  br label %109

109:                                              ; preds = %103
  %110 = load i32, ptr %13, align 4, !tbaa !8
  %111 = add nsw i32 %110, 1
  store i32 %111, ptr %13, align 4, !tbaa !8
  br label %98, !llvm.loop !21

112:                                              ; preds = %102
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #8
  %113 = load i32, ptr %2, align 4, !tbaa !8
  %114 = sext i32 %113 to i64
  store i64 %114, ptr %14, align 8, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #8
  %115 = load i32, ptr %3, align 4, !tbaa !8
  %116 = sub nsw i32 %115, 1
  %117 = sext i32 %116 to i64
  store i64 %117, ptr %15, align 8, !tbaa !15
  br label %118

118:                                              ; preds = %137, %112
  %119 = load i64, ptr %15, align 8, !tbaa !15
  %120 = icmp sge i64 %119, 0
  br i1 %120, label %122, label %121

121:                                              ; preds = %118
  store i32 14, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #8
  br label %140

122:                                              ; preds = %118
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #8
  %123 = load i64, ptr %14, align 8, !tbaa !15
  %124 = load i64, ptr %15, align 8, !tbaa !15
  %125 = getelementptr inbounds i64, ptr %29, i64 %124
  %126 = load i64, ptr %125, align 8, !tbaa !15
  %127 = sub nsw i64 %123, %126
  store i64 %127, ptr %16, align 8, !tbaa !15
  %128 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %15, ptr noundef nonnull align 8 dereferenceable(8) %16)
  %129 = load i64, ptr %128, align 8, !tbaa !15
  %130 = load i64, ptr %15, align 8, !tbaa !15
  %131 = getelementptr inbounds i64, ptr %97, i64 %130
  store i64 %129, ptr %131, align 8, !tbaa !15
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #8
  %132 = load i64, ptr %15, align 8, !tbaa !15
  %133 = getelementptr inbounds i64, ptr %29, i64 %132
  %134 = load i64, ptr %133, align 8, !tbaa !15
  %135 = load i64, ptr %14, align 8, !tbaa !15
  %136 = sub nsw i64 %135, %134
  store i64 %136, ptr %14, align 8, !tbaa !15
  br label %137

137:                                              ; preds = %122
  %138 = load i64, ptr %15, align 8, !tbaa !15
  %139 = add nsw i64 %138, -1
  store i64 %139, ptr %15, align 8, !tbaa !15
  br label %118, !llvm.loop !22

140:                                              ; preds = %121
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #8
  store i32 0, ptr %17, align 4, !tbaa !8
  br label %141

141:                                              ; preds = %154, %140
  %142 = load i32, ptr %17, align 4, !tbaa !8
  %143 = load i32, ptr %3, align 4, !tbaa !8
  %144 = icmp slt i32 %142, %143
  br i1 %144, label %146, label %145

145:                                              ; preds = %141
  store i32 17, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #8
  br label %157

146:                                              ; preds = %141
  %147 = load i32, ptr %17, align 4, !tbaa !8
  %148 = sext i32 %147 to i64
  %149 = getelementptr inbounds i64, ptr %97, i64 %148
  %150 = load i64, ptr %149, align 8, !tbaa !15
  %151 = add nsw i64 %150, 1
  %152 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %151)
  %153 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %152, ptr noundef @.str)
  br label %154

154:                                              ; preds = %146
  %155 = load i32, ptr %17, align 4, !tbaa !8
  %156 = add nsw i32 %155, 1
  store i32 %156, ptr %17, align 4, !tbaa !8
  br label %141, !llvm.loop !23

157:                                              ; preds = %145
  %158 = 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_)
  store i32 0, ptr %1, align 4
  store i32 1, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #8
  br label %159

159:                                              ; preds = %157, %91
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr %7) #8
  %160 = load ptr, ptr %4, align 8
  call void @llvm.stackrestore.p0(ptr %160)
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #8
  %161 = load i32, ptr %1, align 4
  ret i32 %161
}

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: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(8)) #5 align 2

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

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) #5 align 2

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #7

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

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

; 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 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { inlinehint 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 #8 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"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 = !{!16, !16, i64 0}
!16 = !{!"long long", !10, i64 0}
!17 = distinct !{!17, !12}
!18 = distinct !{!18, !12}
!19 = !{i8 0, i8 2}
!20 = !{}
!21 = distinct !{!21, !12}
!22 = distinct !{!22, !12}
!23 = distinct !{!23, !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
@.str = 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 i64, align 8
  %4 = alloca i64, align 8
  %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) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #9
  %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 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %11, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %13 = load i32, ptr %2, align 4, !tbaa !8
  %14 = zext i32 %13 to i64
  %15 = call ptr @llvm.stacksave.p0()
  %16 = alloca i64, i64 %14, align 16
  %17 = load i32, ptr %2, align 4, !tbaa !8
  %18 = icmp sgt i32 %17, 0
  br i1 %18, label %.lr.ph, label %._crit_edge42

.preheader:                                       ; preds = %.lr.ph
  %19 = icmp slt i32 %27, 1
  br i1 %19, label %._crit_edge42, label %.lr.ph34

.lr.ph34:                                         ; preds = %.preheader
  %20 = load i32, ptr %1, align 4, !tbaa !8
  %21 = sext i32 %20 to i64
  %22 = zext nneg i32 %27 to i64
  %wide.trip.count = zext nneg i32 %27 to i64
  %23 = load i64, ptr %16, align 16, !tbaa !11
  %24 = icmp sgt i64 %23, %21
  br i1 %24, label %.lr.ph41.preheader, label %.lr.ph86

.lr.ph:                                           ; preds = %0, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %0 ]
  %25 = getelementptr inbounds i64, ptr %16, i64 %indvars.iv
  %26 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %25)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %27 = load i32, ptr %2, align 4, !tbaa !8
  %28 = sext i32 %27 to i64
  %29 = icmp slt i64 %indvars.iv.next, %28
  br i1 %29, label %.lr.ph, label %.preheader, !llvm.loop !13

.lr.ph86:                                         ; preds = %.lr.ph34, %30
  %indvars.iv6085 = phi i64 [ %indvars.iv.next61, %30 ], [ 0, %.lr.ph34 ]
  %indvars.iv.next61 = add nuw nsw i64 %indvars.iv6085, 1
  %exitcond = icmp eq i64 %indvars.iv.next61, %wide.trip.count
  br i1 %exitcond, label %.lr.ph41.preheader.loopexit, label %30, !llvm.loop !15

30:                                               ; preds = %.lr.ph86
  %31 = getelementptr inbounds i64, ptr %16, i64 %indvars.iv.next61
  %32 = load i64, ptr %31, align 8, !tbaa !11
  %33 = add nsw i64 %32, %indvars.iv.next61
  %34 = icmp sgt i64 %33, %21
  br i1 %34, label %.lr.ph41.preheader.loopexit, label %.lr.ph86, !llvm.loop !15

.lr.ph41.preheader.loopexit:                      ; preds = %30, %.lr.ph86
  %35 = icmp uge i64 %indvars.iv.next61, %22
  br label %.lr.ph41.preheader

.lr.ph41.preheader:                               ; preds = %.lr.ph41.preheader.loopexit, %.lr.ph34
  %.lcssa = phi i1 [ false, %.lr.ph34 ], [ %35, %.lr.ph41.preheader.loopexit ]
  %wide.trip.count65 = zext nneg i32 %27 to i64
  %min.iters.check = icmp ult i32 %27, 4
  br i1 %min.iters.check, label %.lr.ph41.preheader104, label %vector.ph

.lr.ph41.preheader104:                            ; preds = %middle.block, %.lr.ph41.preheader
  %indvars.iv62.ph = phi i64 [ 0, %.lr.ph41.preheader ], [ %n.vec, %middle.block ]
  %.02738.ph = phi i64 [ 0, %.lr.ph41.preheader ], [ %41, %middle.block ]
  br label %.lr.ph41

vector.ph:                                        ; preds = %.lr.ph41.preheader
  %n.vec = and i64 %wide.trip.count, 2147483644
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %vec.phi = phi <2 x i64> [ zeroinitializer, %vector.ph ], [ %38, %vector.body ]
  %vec.phi89 = phi <2 x i64> [ zeroinitializer, %vector.ph ], [ %39, %vector.body ]
  %36 = getelementptr inbounds i64, ptr %16, i64 %index
  %37 = getelementptr inbounds i8, ptr %36, i64 16
  %wide.load = load <2 x i64>, ptr %36, align 16, !tbaa !11
  %wide.load90 = load <2 x i64>, ptr %37, align 16, !tbaa !11
  %38 = add <2 x i64> %wide.load, %vec.phi
  %39 = add <2 x i64> %wide.load90, %vec.phi89
  %index.next = add nuw i64 %index, 4
  %40 = icmp eq i64 %index.next, %n.vec
  br i1 %40, label %middle.block, label %vector.body, !llvm.loop !16

middle.block:                                     ; preds = %vector.body
  %bin.rdx = add <2 x i64> %39, %38
  %41 = call i64 @llvm.vector.reduce.add.v2i64(<2 x i64> %bin.rdx)
  %cmp.n = icmp eq i64 %n.vec, %wide.trip.count
  br i1 %cmp.n, label %._crit_edge42, label %.lr.ph41.preheader104

._crit_edge42:                                    ; preds = %.lr.ph41, %middle.block, %0, %.preheader
  %42 = phi i1 [ false, %.preheader ], [ false, %0 ], [ true, %middle.block ], [ true, %.lr.ph41 ]
  %.lcssa80 = phi i1 [ true, %.preheader ], [ true, %0 ], [ %.lcssa, %middle.block ], [ %.lcssa, %.lr.ph41 ]
  %.lcssa317679 = phi i32 [ %27, %.preheader ], [ %17, %0 ], [ %27, %middle.block ], [ %27, %.lr.ph41 ]
  %.027.lcssa = phi i64 [ 0, %.preheader ], [ 0, %0 ], [ %41, %middle.block ], [ %48, %.lr.ph41 ]
  %43 = load i32, ptr %1, align 4, !tbaa !8
  %44 = sext i32 %43 to i64
  %45 = icmp sge i64 %.027.lcssa, %44
  %spec.select = and i1 %.lcssa80, %45
  br i1 %spec.select, label %51, label %49

.lr.ph41:                                         ; preds = %.lr.ph41.preheader104, %.lr.ph41
  %indvars.iv62 = phi i64 [ %indvars.iv.next63, %.lr.ph41 ], [ %indvars.iv62.ph, %.lr.ph41.preheader104 ]
  %.02738 = phi i64 [ %48, %.lr.ph41 ], [ %.02738.ph, %.lr.ph41.preheader104 ]
  %46 = getelementptr inbounds i64, ptr %16, i64 %indvars.iv62
  %47 = load i64, ptr %46, align 8, !tbaa !11
  %48 = add nsw i64 %47, %.02738
  %indvars.iv.next63 = add nuw nsw i64 %indvars.iv62, 1
  %exitcond66.not = icmp eq i64 %indvars.iv.next63, %wide.trip.count65
  br i1 %exitcond66.not, label %._crit_edge42, label %.lr.ph41, !llvm.loop !19

49:                                               ; preds = %._crit_edge42
  %50 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef -1)
  br label %._crit_edge56

51:                                               ; preds = %._crit_edge42
  %52 = zext i32 %.lcssa317679 to i64
  %53 = alloca i64, i64 %52, align 16
  br i1 %42, label %.lr.ph46.preheader, label %._crit_edge47.thread

.lr.ph46.preheader:                               ; preds = %51
  %min.iters.check93 = icmp ult i32 %.lcssa317679, 4
  br i1 %min.iters.check93, label %.lr.ph46.preheader103, label %vector.ph94

.lr.ph46.preheader103:                            ; preds = %middle.block91, %.lr.ph46.preheader
  %indvars.iv67.ph = phi i64 [ 0, %.lr.ph46.preheader ], [ %n.vec96, %middle.block91 ]
  br label %.lr.ph46

vector.ph94:                                      ; preds = %.lr.ph46.preheader
  %n.vec96 = and i64 %52, 4294967292
  br label %vector.body98

vector.body98:                                    ; preds = %vector.body98, %vector.ph94
  %index99 = phi i64 [ 0, %vector.ph94 ], [ %index.next101, %vector.body98 ]
  %vec.ind = phi <2 x i64> [ <i64 0, i64 1>, %vector.ph94 ], [ %vec.ind.next, %vector.body98 ]
  %step.add = add <2 x i64> %vec.ind, <i64 2, i64 2>
  %54 = getelementptr inbounds i64, ptr %53, i64 %index99
  %55 = getelementptr inbounds i8, ptr %54, i64 16
  store <2 x i64> %vec.ind, ptr %54, align 16, !tbaa !11
  store <2 x i64> %step.add, ptr %55, align 16, !tbaa !11
  %index.next101 = add nuw i64 %index99, 4
  %vec.ind.next = add <2 x i64> %vec.ind, <i64 4, i64 4>
  %56 = icmp eq i64 %index.next101, %n.vec96
  br i1 %56, label %middle.block91, label %vector.body98, !llvm.loop !20

middle.block91:                                   ; preds = %vector.body98
  %cmp.n102 = icmp eq i64 %n.vec96, %52
  br i1 %cmp.n102, label %._crit_edge47, label %.lr.ph46.preheader103

._crit_edge47.thread:                             ; preds = %51
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #9
  br label %._crit_edge52.thread

._crit_edge47:                                    ; preds = %.lr.ph46, %middle.block91
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #9
  %57 = add nsw i32 %.lcssa317679, -1
  %58 = sext i32 %57 to i64
  store i64 %58, ptr %3, align 8, !tbaa !11
  br i1 %42, label %.lr.ph51, label %._crit_edge52.thread

.lr.ph46:                                         ; preds = %.lr.ph46.preheader103, %.lr.ph46
  %indvars.iv67 = phi i64 [ %indvars.iv.next68, %.lr.ph46 ], [ %indvars.iv67.ph, %.lr.ph46.preheader103 ]
  %59 = getelementptr inbounds i64, ptr %53, i64 %indvars.iv67
  store i64 %indvars.iv67, ptr %59, align 8, !tbaa !11
  %indvars.iv.next68 = add nuw nsw i64 %indvars.iv67, 1
  %exitcond71.not = icmp eq i64 %indvars.iv.next68, %52
  br i1 %exitcond71.not, label %._crit_edge47, label %.lr.ph46, !llvm.loop !21

._crit_edge52.thread:                             ; preds = %._crit_edge47, %._crit_edge47.thread
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #9
  br label %._crit_edge56

._crit_edge52:                                    ; preds = %.lr.ph51
  %.pre = load i32, ptr %2, align 4, !tbaa !8
  %60 = icmp sgt i32 %.pre, 0
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #9
  br i1 %60, label %.lr.ph55, label %._crit_edge56

.lr.ph51:                                         ; preds = %._crit_edge47, %.lr.ph51
  %.02349 = phi i64 [ %70, %.lr.ph51 ], [ %44, %._crit_edge47 ]
  %storemerge48 = phi i64 [ %71, %.lr.ph51 ], [ %58, %._crit_edge47 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #9
  %61 = getelementptr inbounds i64, ptr %16, i64 %storemerge48
  %62 = load i64, ptr %61, align 8, !tbaa !11
  %63 = sub nsw i64 %.02349, %62
  store i64 %63, ptr %4, align 8, !tbaa !11
  %64 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %4)
  %65 = load i64, ptr %64, align 8, !tbaa !11
  %66 = load i64, ptr %3, align 8, !tbaa !11
  %67 = getelementptr inbounds i64, ptr %53, i64 %66
  store i64 %65, ptr %67, align 8, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #9
  %68 = getelementptr inbounds i64, ptr %16, i64 %66
  %69 = load i64, ptr %68, align 8, !tbaa !11
  %70 = sub nsw i64 %.02349, %69
  %71 = add nsw i64 %66, -1
  store i64 %71, ptr %3, align 8, !tbaa !11
  %72 = icmp sgt i64 %66, 0
  br i1 %72, label %.lr.ph51, label %._crit_edge52, !llvm.loop !22

.lr.ph55:                                         ; preds = %._crit_edge52, %.lr.ph55
  %indvars.iv72 = phi i64 [ %indvars.iv.next73, %.lr.ph55 ], [ 0, %._crit_edge52 ]
  %73 = getelementptr inbounds i64, ptr %53, i64 %indvars.iv72
  %74 = load i64, ptr %73, align 8, !tbaa !11
  %75 = add nsw i64 %74, 1
  %76 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %75)
  %77 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %76, ptr noundef nonnull @.str)
  %indvars.iv.next73 = add nuw nsw i64 %indvars.iv72, 1
  %78 = load i32, ptr %2, align 4, !tbaa !8
  %79 = sext i32 %78 to i64
  %80 = icmp slt i64 %indvars.iv.next73, %79
  br i1 %80, label %.lr.ph55, label %._crit_edge56, !llvm.loop !23

._crit_edge56:                                    ; preds = %.lr.ph55, %._crit_edge52, %._crit_edge52.thread, %49
  %_ZSt4cout.sink = phi ptr [ %50, %49 ], [ @_ZSt4cout, %._crit_edge52.thread ], [ @_ZSt4cout, %._crit_edge52 ], [ @_ZSt4cout, %.lr.ph55 ]
  %81 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %_ZSt4cout.sink, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.stackrestore.p0(ptr %15)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #9
  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 uwtable
declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #5 align 2

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

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 #5 align 2

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #7

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

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

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.vector.reduce.add.v2i64(<2 x i64>) #8

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 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { inlinehint 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 #8 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #9 = { 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 = !{!"long long", !10, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}
!16 = distinct !{!16, !14, !17, !18}
!17 = !{!"llvm.loop.isvectorized", i32 1}
!18 = !{!"llvm.loop.unroll.runtime.disable"}
!19 = distinct !{!19, !14, !18, !17}
!20 = distinct !{!20, !14, !17, !18}
!21 = distinct !{!21, !14, !18, !17}
!22 = distinct !{!22, !14}
!23 = distinct !{!23, !14}


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