; LLVM IR from VastoLorde95/Competitive-Programming :: Hackerrank/Company Contests/Morgan Stanley/Morgan Stanley 2016/Problem F (F)

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

%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<std::pair<int, std::pair<int, int>>, std::allocator<std::pair<int, std::pair<int, int>>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::pair<int, std::pair<int, int>>, std::allocator<std::pair<int, std::pair<int, int>>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::pair<int, std::pair<int, int>>, std::allocator<std::pair<int, std::pair<int, int>>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::pair<int, std::pair<int, int>>, std::allocator<std::pair<int, std::pair<int, int>>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"struct.std::pair" = type { i32, %"struct.std::pair.0" }
%"struct.std::pair.0" = type { i32, i32 }
%"class.std::set" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<std::pair<long long, std::pair<int, int>>, std::pair<long long, std::pair<int, int>>, std::_Identity<std::pair<long long, std::pair<int, int>>>, std::less<std::pair<long long, std::pair<int, int>>>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<std::pair<long long, std::pair<int, int>>, std::pair<long long, std::pair<int, int>>, std::_Identity<std::pair<long long, std::pair<int, int>>>, std::less<std::pair<long long, std::pair<int, int>>>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::_Rb_tree_header" = type { %"struct.std::_Rb_tree_node_base", i64 }
%"struct.std::_Rb_tree_node_base" = type { i32, ptr, ptr, ptr }
%"struct.std::pair.7" = type { i64, %"struct.std::pair.0" }
%"struct.std::pair.5" = type <{ %"struct.std::_Rb_tree_const_iterator", i8, [7 x i8] }>
%"struct.std::_Rb_tree_const_iterator" = type { ptr }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }

@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@k = external dso_local global i32, align 4
@g = external dso_local global [1001 x %"class.std::vector"], align 16
@d = external dso_local global [1001 x [1024 x i64]], align 16
@v = external dso_local global [1001 x [1024 x i32]], align 16
@.str = external hidden unnamed_addr constant [7 x i8], align 1

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #2 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca %"struct.std::pair", align 4
  %7 = alloca %"struct.std::pair.0", align 4
  %8 = alloca i32, align 4
  %9 = alloca { i64, i32 }, align 8
  %10 = alloca %"struct.std::pair", align 4
  %11 = alloca %"struct.std::pair.0", align 4
  %12 = alloca i32, align 4
  %13 = alloca { i64, i32 }, align 8
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca %"struct.std::pair", align 4
  %19 = alloca %"struct.std::pair.0", align 4
  %20 = alloca { i64, i32 }, align 8
  %21 = alloca %"struct.std::pair", align 4
  %22 = alloca %"struct.std::pair.0", align 4
  %23 = alloca { i64, i32 }, align 8
  %24 = alloca i32, align 4
  %25 = alloca i32, align 4
  %26 = alloca i32, align 4
  %27 = alloca %"class.std::set", align 8
  %28 = alloca %"struct.std::pair.7", align 8
  %29 = alloca %"struct.std::pair", align 4
  %30 = alloca i32, align 4
  %31 = alloca %"struct.std::pair.0", align 4
  %32 = alloca i32, align 4
  %33 = alloca i32, align 4
  %34 = alloca ptr, align 8
  %35 = alloca i32, align 4
  %36 = alloca { i64, i32 }, align 8
  %37 = alloca %"struct.std::pair.5", align 8
  %38 = alloca %"struct.std::pair.7", align 8
  %39 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %40 = alloca i32, align 4
  %41 = alloca i32, align 4
  %42 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %43 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %44 = alloca i32, align 4
  %45 = alloca i32, align 4
  %46 = alloca i32, align 4
  %47 = alloca i32, align 4
  %48 = alloca i64, align 8
  %49 = alloca %"struct.std::pair.7", align 8
  %50 = alloca %"struct.std::pair.0", align 4
  %51 = alloca %"struct.std::pair.5", align 8
  store i32 0, ptr %1, align 4
  %52 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @n, ptr noundef @m, ptr noundef @k)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #8
  store i32 1, ptr %2, align 4, !tbaa !5
  br label %53

53:                                               ; preds = %70, %0
  %54 = load i32, ptr %2, align 4, !tbaa !5
  %55 = load i32, ptr @m, align 4, !tbaa !5
  %56 = icmp sle i32 %54, %55
  br i1 %56, label %58, label %57

57:                                               ; preds = %53
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #8
  br label %73

58:                                               ; preds = %53
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #8
  %59 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %3, ptr noundef %4, ptr noundef %5)
  %60 = load i32, ptr %3, align 4, !tbaa !5
  %61 = sext i32 %60 to i64
  %62 = getelementptr inbounds [1001 x %"class.std::vector"], ptr @g, i64 0, i64 %61
  call void @llvm.lifetime.start.p0(i64 12, ptr %6) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #8
  store i32 0, ptr %8, align 4, !tbaa !5
  %63 = call i64 @_ZSt9make_pairIRiiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %5, ptr noundef nonnull align 4 dereferenceable(4) %8)
  store i64 %63, ptr %7, align 4
  %64 = call { i64, i32 } @_ZSt9make_pairIRiSt4pairIiiEES1_INSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS3_INS4_IT0_E4typeEE6__typeEEOS5_OSA_(ptr noundef nonnull align 4 dereferenceable(4) %4, ptr noundef nonnull align 4 dereferenceable(8) %7)
  store { i64, i32 } %64, ptr %9, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %6, ptr align 8 %9, i64 12, i1 false)
  call void @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EE9push_backEOS2_(ptr noundef nonnull align 8 dereferenceable(24) %62, ptr noundef nonnull align 4 dereferenceable(12) %6)
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #8
  call void @llvm.lifetime.end.p0(i64 12, ptr %6) #8
  %65 = load i32, ptr %4, align 4, !tbaa !5
  %66 = sext i32 %65 to i64
  %67 = getelementptr inbounds [1001 x %"class.std::vector"], ptr @g, i64 0, i64 %66
  call void @llvm.lifetime.start.p0(i64 12, ptr %10) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #8
  store i32 0, ptr %12, align 4, !tbaa !5
  %68 = call i64 @_ZSt9make_pairIRiiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %5, ptr noundef nonnull align 4 dereferenceable(4) %12)
  store i64 %68, ptr %11, align 4
  %69 = call { i64, i32 } @_ZSt9make_pairIRiSt4pairIiiEES1_INSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS3_INS4_IT0_E4typeEE6__typeEEOS5_OSA_(ptr noundef nonnull align 4 dereferenceable(4) %3, ptr noundef nonnull align 4 dereferenceable(8) %11)
  store { i64, i32 } %69, ptr %13, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %10, ptr align 8 %13, i64 12, i1 false)
  call void @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EE9push_backEOS2_(ptr noundef nonnull align 8 dereferenceable(24) %67, ptr noundef nonnull align 4 dereferenceable(12) %10)
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #8
  call void @llvm.lifetime.end.p0(i64 12, ptr %10) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #8
  br label %70

70:                                               ; preds = %58
  %71 = load i32, ptr %2, align 4, !tbaa !5
  %72 = add nsw i32 %71, 1
  store i32 %72, ptr %2, align 4, !tbaa !5
  br label %53, !llvm.loop !9

73:                                               ; preds = %57
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #8
  store i32 1, ptr %14, align 4, !tbaa !5
  br label %74

74:                                               ; preds = %91, %73
  %75 = load i32, ptr %14, align 4, !tbaa !5
  %76 = load i32, ptr @k, align 4, !tbaa !5
  %77 = icmp sle i32 %75, %76
  br i1 %77, label %79, label %78

78:                                               ; preds = %74
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #8
  br label %94

79:                                               ; preds = %74
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #8
  %80 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %15, ptr noundef %16, ptr noundef %17)
  %81 = load i32, ptr %15, align 4, !tbaa !5
  %82 = sext i32 %81 to i64
  %83 = getelementptr inbounds [1001 x %"class.std::vector"], ptr @g, i64 0, i64 %82
  call void @llvm.lifetime.start.p0(i64 12, ptr %18) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #8
  %84 = call i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %17, ptr noundef nonnull align 4 dereferenceable(4) %14)
  store i64 %84, ptr %19, align 4
  %85 = call { i64, i32 } @_ZSt9make_pairIRiSt4pairIiiEES1_INSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS3_INS4_IT0_E4typeEE6__typeEEOS5_OSA_(ptr noundef nonnull align 4 dereferenceable(4) %16, ptr noundef nonnull align 4 dereferenceable(8) %19)
  store { i64, i32 } %85, ptr %20, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %18, ptr align 8 %20, i64 12, i1 false)
  call void @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EE9push_backEOS2_(ptr noundef nonnull align 8 dereferenceable(24) %83, ptr noundef nonnull align 4 dereferenceable(12) %18)
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #8
  call void @llvm.lifetime.end.p0(i64 12, ptr %18) #8
  %86 = load i32, ptr %16, align 4, !tbaa !5
  %87 = sext i32 %86 to i64
  %88 = getelementptr inbounds [1001 x %"class.std::vector"], ptr @g, i64 0, i64 %87
  call void @llvm.lifetime.start.p0(i64 12, ptr %21) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #8
  %89 = call i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %17, ptr noundef nonnull align 4 dereferenceable(4) %14)
  store i64 %89, ptr %22, align 4
  %90 = call { i64, i32 } @_ZSt9make_pairIRiSt4pairIiiEES1_INSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS3_INS4_IT0_E4typeEE6__typeEEOS5_OSA_(ptr noundef nonnull align 4 dereferenceable(4) %15, ptr noundef nonnull align 4 dereferenceable(8) %22)
  store { i64, i32 } %90, ptr %23, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %21, ptr align 8 %23, i64 12, i1 false)
  call void @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EE9push_backEOS2_(ptr noundef nonnull align 8 dereferenceable(24) %88, ptr noundef nonnull align 4 dereferenceable(12) %21)
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #8
  call void @llvm.lifetime.end.p0(i64 12, ptr %21) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #8
  br label %91

91:                                               ; preds = %79
  %92 = load i32, ptr %14, align 4, !tbaa !5
  %93 = add nsw i32 %92, 1
  store i32 %93, ptr %14, align 4, !tbaa !5
  br label %74, !llvm.loop !11

94:                                               ; preds = %78
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #8
  store i32 1, ptr %24, align 4, !tbaa !5
  br label %95

95:                                               ; preds = %118, %94
  %96 = load i32, ptr %24, align 4, !tbaa !5
  %97 = load i32, ptr @n, align 4, !tbaa !5
  %98 = icmp sle i32 %96, %97
  br i1 %98, label %100, label %99

99:                                               ; preds = %95
  store i32 8, ptr %25, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #8
  br label %121

100:                                              ; preds = %95
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #8
  store i32 0, ptr %26, align 4, !tbaa !5
  br label %101

101:                                              ; preds = %114, %100
  %102 = load i32, ptr %26, align 4, !tbaa !5
  %103 = load i32, ptr @k, align 4, !tbaa !5
  %104 = shl i32 1, %103
  %105 = icmp slt i32 %102, %104
  br i1 %105, label %107, label %106

106:                                              ; preds = %101
  store i32 11, ptr %25, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #8
  br label %117

107:                                              ; preds = %101
  %108 = load i32, ptr %24, align 4, !tbaa !5
  %109 = sext i32 %108 to i64
  %110 = getelementptr inbounds [1001 x [1024 x i64]], ptr @d, i64 0, i64 %109
  %111 = load i32, ptr %26, align 4, !tbaa !5
  %112 = sext i32 %111 to i64
  %113 = getelementptr inbounds [1024 x i64], ptr %110, i64 0, i64 %112
  store i64 1125899906842624, ptr %113, align 8, !tbaa !12
  br label %114

114:                                              ; preds = %107
  %115 = load i32, ptr %26, align 4, !tbaa !5
  %116 = add nsw i32 %115, 1
  store i32 %116, ptr %26, align 4, !tbaa !5
  br label %101, !llvm.loop !14

117:                                              ; preds = %106
  br label %118

118:                                              ; preds = %117
  %119 = load i32, ptr %24, align 4, !tbaa !5
  %120 = add nsw i32 %119, 1
  store i32 %120, ptr %24, align 4, !tbaa !5
  br label %95, !llvm.loop !15

121:                                              ; preds = %99
  store i64 0, ptr getelementptr inbounds ([1001 x [1024 x i64]], ptr @d, i64 0, i64 1), align 16, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 48, ptr %27) #8
  call void @_ZNSt3setISt4pairIxS0_IiiEESt4lessIS2_ESaIS2_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %27) #8
  call void @llvm.lifetime.start.p0(i64 16, ptr %28) #8
  call void @llvm.lifetime.start.p0(i64 12, ptr %29) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %30) #8
  store i32 0, ptr %30, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %31) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %32) #8
  store i32 1, ptr %32, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %33) #8
  store i32 0, ptr %33, align 4, !tbaa !5
  %122 = invoke i64 @_ZSt9make_pairIiiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS1_INS2_IT0_E4typeEE6__typeEEOS3_OS8_(ptr noundef nonnull align 4 dereferenceable(4) %32, ptr noundef nonnull align 4 dereferenceable(4) %33)
          to label %123 unwind label %157

123:                                              ; preds = %121
  store i64 %122, ptr %31, align 4
  %124 = invoke { i64, i32 } @_ZSt9make_pairIiSt4pairIiiEES0_INSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %30, ptr noundef nonnull align 4 dereferenceable(8) %31)
          to label %125 unwind label %157

125:                                              ; preds = %123
  store { i64, i32 } %124, ptr %36, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %29, ptr align 8 %36, i64 12, i1 false)
  invoke void @_ZNSt4pairIxS_IiiEEC2IiS0_TnNSt9enable_ifIXaaclsr6_PCCFPIT_T0_EE22_MoveConstructiblePairIS4_S5_EEclsr6_PCCFPIS4_S5_EE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS_IS4_S5_E(ptr noundef nonnull align 8 dereferenceable(16) %28, ptr noundef nonnull align 4 dereferenceable(12) %29)
          to label %126 unwind label %157

126:                                              ; preds = %125
  %127 = invoke { ptr, i8 } @_ZNSt3setISt4pairIxS0_IiiEESt4lessIS2_ESaIS2_EE6insertEOS2_(ptr noundef nonnull align 8 dereferenceable(48) %27, ptr noundef nonnull align 8 dereferenceable(16) %28)
          to label %128 unwind label %157

128:                                              ; preds = %126
  %129 = getelementptr inbounds { ptr, i8 }, ptr %37, i32 0, i32 0
  %130 = extractvalue { ptr, i8 } %127, 0
  store ptr %130, ptr %129, align 8
  %131 = getelementptr inbounds { ptr, i8 }, ptr %37, i32 0, i32 1
  %132 = extractvalue { ptr, i8 } %127, 1
  store i8 %132, ptr %131, align 8
  call void @llvm.lifetime.end.p0(i64 4, ptr %33) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %32) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %31) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %30) #8
  call void @llvm.lifetime.end.p0(i64 12, ptr %29) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr %28) #8
  br label %133

133:                                              ; preds = %271, %269, %128
  %134 = call noundef zeroext i1 @_ZNKSt3setISt4pairIxS0_IiiEESt4lessIS2_ESaIS2_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(48) %27) #8
  %135 = xor i1 %134, true
  br i1 %135, label %136, label %273

136:                                              ; preds = %133
  call void @llvm.lifetime.start.p0(i64 16, ptr %38) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %39) #8
  %137 = call ptr @_ZNKSt3setISt4pairIxS0_IiiEESt4lessIS2_ESaIS2_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %27) #8
  %138 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %39, i32 0, i32 0
  store ptr %137, ptr %138, align 8
  %139 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNKSt23_Rb_tree_const_iteratorISt4pairIxS0_IiiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %39) #8
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %38, ptr align 8 %139, i64 16, i1 false)
  call void @llvm.lifetime.end.p0(i64 8, ptr %39) #8
  %140 = invoke noundef i64 @_ZNSt3setISt4pairIxS0_IiiEESt4lessIS2_ESaIS2_EE5eraseERKS2_(ptr noundef nonnull align 8 dereferenceable(48) %27, ptr noundef nonnull align 8 dereferenceable(16) %38)
          to label %141 unwind label %161

141:                                              ; preds = %136
  call void @llvm.lifetime.start.p0(i64 4, ptr %40) #8
  %142 = getelementptr inbounds %"struct.std::pair.7", ptr %38, i32 0, i32 1
  %143 = getelementptr inbounds %"struct.std::pair.0", ptr %142, i32 0, i32 0
  %144 = load i32, ptr %143, align 8, !tbaa !16
  store i32 %144, ptr %40, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %41) #8
  %145 = getelementptr inbounds %"struct.std::pair.7", ptr %38, i32 0, i32 1
  %146 = getelementptr inbounds %"struct.std::pair.0", ptr %145, i32 0, i32 1
  %147 = load i32, ptr %146, align 4, !tbaa !19
  store i32 %147, ptr %41, align 4, !tbaa !5
  %148 = load i32, ptr %40, align 4, !tbaa !5
  %149 = sext i32 %148 to i64
  %150 = getelementptr inbounds [1001 x [1024 x i32]], ptr @v, i64 0, i64 %149
  %151 = load i32, ptr %41, align 4, !tbaa !5
  %152 = sext i32 %151 to i64
  %153 = getelementptr inbounds [1024 x i32], ptr %150, i64 0, i64 %152
  %154 = load i32, ptr %153, align 4, !tbaa !5
  %155 = icmp ne i32 %154, 0
  br i1 %155, label %156, label %165

156:                                              ; preds = %141
  store i32 14, ptr %25, align 4
  br label %269, !llvm.loop !20

157:                                              ; preds = %126, %125, %123, %121
  %158 = landingpad { ptr, i32 }
          cleanup
  %159 = extractvalue { ptr, i32 } %158, 0
  store ptr %159, ptr %34, align 8
  %160 = extractvalue { ptr, i32 } %158, 1
  store i32 %160, ptr %35, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %33) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %32) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %31) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %30) #8
  call void @llvm.lifetime.end.p0(i64 12, ptr %29) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr %28) #8
  br label %292

161:                                              ; preds = %136
  %162 = landingpad { ptr, i32 }
          cleanup
  %163 = extractvalue { ptr, i32 } %162, 0
  store ptr %163, ptr %34, align 8
  %164 = extractvalue { ptr, i32 } %162, 1
  store i32 %164, ptr %35, align 4
  br label %272

165:                                              ; preds = %141
  %166 = load i32, ptr %40, align 4, !tbaa !5
  %167 = sext i32 %166 to i64
  %168 = getelementptr inbounds [1001 x [1024 x i32]], ptr @v, i64 0, i64 %167
  %169 = load i32, ptr %41, align 4, !tbaa !5
  %170 = sext i32 %169 to i64
  %171 = getelementptr inbounds [1024 x i32], ptr %168, i64 0, i64 %170
  store i32 1, ptr %171, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %42) #8
  %172 = load i32, ptr %40, align 4, !tbaa !5
  %173 = sext i32 %172 to i64
  %174 = getelementptr inbounds [1001 x %"class.std::vector"], ptr @g, i64 0, i64 %173
  %175 = call ptr @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %174) #8
  %176 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %42, i32 0, i32 0
  store ptr %175, ptr %176, align 8
  br label %177

177:                                              ; preds = %266, %165
  call void @llvm.lifetime.start.p0(i64 8, ptr %43) #8
  %178 = load i32, ptr %40, align 4, !tbaa !5
  %179 = sext i32 %178 to i64
  %180 = getelementptr inbounds [1001 x %"class.std::vector"], ptr @g, i64 0, i64 %179
  %181 = call ptr @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %180) #8
  %182 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %43, i32 0, i32 0
  store ptr %181, ptr %182, align 8
  %183 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairIiS1_IiiEESt6vectorIS3_SaIS3_EEEEbRKNS_17__normal_iteratorIT_T0_EESD_(ptr noundef nonnull align 8 dereferenceable(8) %42, ptr noundef nonnull align 8 dereferenceable(8) %43) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %43) #8
  br i1 %183, label %185, label %184

184:                                              ; preds = %177
  store i32 16, ptr %25, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %42) #8
  br label %268

185:                                              ; preds = %177
  call void @llvm.lifetime.start.p0(i64 4, ptr %44) #8
  %186 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIiS1_IiiEESt6vectorIS3_SaIS3_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %42) #8
  %187 = getelementptr inbounds %"struct.std::pair", ptr %186, i32 0, i32 0
  %188 = load i32, ptr %187, align 4, !tbaa !21
  store i32 %188, ptr %44, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %45) #8
  %189 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIiS1_IiiEESt6vectorIS3_SaIS3_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %42) #8
  %190 = getelementptr inbounds %"struct.std::pair", ptr %189, i32 0, i32 1
  %191 = getelementptr inbounds %"struct.std::pair.0", ptr %190, i32 0, i32 0
  %192 = load i32, ptr %191, align 4, !tbaa !23
  store i32 %192, ptr %45, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %46) #8
  %193 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIiS1_IiiEESt6vectorIS3_SaIS3_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %42) #8
  %194 = getelementptr inbounds %"struct.std::pair", ptr %193, i32 0, i32 1
  %195 = getelementptr inbounds %"struct.std::pair.0", ptr %194, i32 0, i32 1
  %196 = load i32, ptr %195, align 4, !tbaa !24
  store i32 %196, ptr %46, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %47) #8
  %197 = load i32, ptr %41, align 4, !tbaa !5
  store i32 %197, ptr %47, align 4, !tbaa !5
  %198 = load i32, ptr %46, align 4, !tbaa !5
  %199 = icmp ne i32 %198, 0
  br i1 %199, label %200, label %206

200:                                              ; preds = %185
  %201 = load i32, ptr %46, align 4, !tbaa !5
  %202 = sub nsw i32 %201, 1
  %203 = shl i32 1, %202
  %204 = load i32, ptr %47, align 4, !tbaa !5
  %205 = or i32 %204, %203
  store i32 %205, ptr %47, align 4, !tbaa !5
  br label %206

206:                                              ; preds = %200, %185
  %207 = load i32, ptr %44, align 4, !tbaa !5
  %208 = sext i32 %207 to i64
  %209 = getelementptr inbounds [1001 x [1024 x i32]], ptr @v, i64 0, i64 %208
  %210 = load i32, ptr %47, align 4, !tbaa !5
  %211 = sext i32 %210 to i64
  %212 = getelementptr inbounds [1024 x i32], ptr %209, i64 0, i64 %211
  %213 = load i32, ptr %212, align 4, !tbaa !5
  %214 = icmp ne i32 %213, 0
  br i1 %214, label %215, label %216

215:                                              ; preds = %206
  store i32 18, ptr %25, align 4
  br label %263

216:                                              ; preds = %206
  call void @llvm.lifetime.start.p0(i64 8, ptr %48) #8
  %217 = load i32, ptr %40, align 4, !tbaa !5
  %218 = sext i32 %217 to i64
  %219 = getelementptr inbounds [1001 x [1024 x i64]], ptr @d, i64 0, i64 %218
  %220 = load i32, ptr %41, align 4, !tbaa !5
  %221 = sext i32 %220 to i64
  %222 = getelementptr inbounds [1024 x i64], ptr %219, i64 0, i64 %221
  %223 = load i64, ptr %222, align 8, !tbaa !12
  %224 = load i32, ptr %45, align 4, !tbaa !5
  %225 = sext i32 %224 to i64
  %226 = add nsw i64 %223, %225
  store i64 %226, ptr %48, align 8, !tbaa !12
  %227 = load i64, ptr %48, align 8, !tbaa !12
  %228 = load i32, ptr %44, align 4, !tbaa !5
  %229 = sext i32 %228 to i64
  %230 = getelementptr inbounds [1001 x [1024 x i64]], ptr @d, i64 0, i64 %229
  %231 = load i32, ptr %47, align 4, !tbaa !5
  %232 = sext i32 %231 to i64
  %233 = getelementptr inbounds [1024 x i64], ptr %230, i64 0, i64 %232
  %234 = load i64, ptr %233, align 8, !tbaa !12
  %235 = icmp slt i64 %227, %234
  br i1 %235, label %236, label %262

236:                                              ; preds = %216
  %237 = load i64, ptr %48, align 8, !tbaa !12
  %238 = load i32, ptr %44, align 4, !tbaa !5
  %239 = sext i32 %238 to i64
  %240 = getelementptr inbounds [1001 x [1024 x i64]], ptr @d, i64 0, i64 %239
  %241 = load i32, ptr %47, align 4, !tbaa !5
  %242 = sext i32 %241 to i64
  %243 = getelementptr inbounds [1024 x i64], ptr %240, i64 0, i64 %242
  store i64 %237, ptr %243, align 8, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 16, ptr %49) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %50) #8
  %244 = invoke i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %44, ptr noundef nonnull align 4 dereferenceable(4) %47)
          to label %245 unwind label %258

245:                                              ; preds = %236
  store i64 %244, ptr %50, align 4
  %246 = invoke { i64, i64 } @_ZSt9make_pairIRxSt4pairIiiEES1_INSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS3_INS4_IT0_E4typeEE6__typeEEOS5_OSA_(ptr noundef nonnull align 8 dereferenceable(8) %48, ptr noundef nonnull align 4 dereferenceable(8) %50)
          to label %247 unwind label %258

247:                                              ; preds = %245
  %248 = getelementptr inbounds { i64, i64 }, ptr %49, i32 0, i32 0
  %249 = extractvalue { i64, i64 } %246, 0
  store i64 %249, ptr %248, align 8
  %250 = getelementptr inbounds { i64, i64 }, ptr %49, i32 0, i32 1
  %251 = extractvalue { i64, i64 } %246, 1
  store i64 %251, ptr %250, align 8
  %252 = invoke { ptr, i8 } @_ZNSt3setISt4pairIxS0_IiiEESt4lessIS2_ESaIS2_EE6insertEOS2_(ptr noundef nonnull align 8 dereferenceable(48) %27, ptr noundef nonnull align 8 dereferenceable(16) %49)
          to label %253 unwind label %258

253:                                              ; preds = %247
  %254 = getelementptr inbounds { ptr, i8 }, ptr %51, i32 0, i32 0
  %255 = extractvalue { ptr, i8 } %252, 0
  store ptr %255, ptr %254, align 8
  %256 = getelementptr inbounds { ptr, i8 }, ptr %51, i32 0, i32 1
  %257 = extractvalue { ptr, i8 } %252, 1
  store i8 %257, ptr %256, align 8
  call void @llvm.lifetime.end.p0(i64 8, ptr %50) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr %49) #8
  br label %262

258:                                              ; preds = %247, %245, %236
  %259 = landingpad { ptr, i32 }
          cleanup
  %260 = extractvalue { ptr, i32 } %259, 0
  store ptr %260, ptr %34, align 8
  %261 = extractvalue { ptr, i32 } %259, 1
  store i32 %261, ptr %35, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %50) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr %49) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %48) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %47) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %46) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %45) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %44) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %42) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %41) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %40) #8
  br label %272

262:                                              ; preds = %253, %216
  call void @llvm.lifetime.end.p0(i64 8, ptr %48) #8
  store i32 0, ptr %25, align 4
  br label %263

263:                                              ; preds = %262, %215
  call void @llvm.lifetime.end.p0(i64 4, ptr %47) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %46) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %45) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %44) #8
  %264 = load i32, ptr %25, align 4
  switch i32 %264, label %298 [
    i32 0, label %265
    i32 18, label %266
  ]

265:                                              ; preds = %263
  br label %266

266:                                              ; preds = %265, %263
  %267 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPSt4pairIiS1_IiiEESt6vectorIS3_SaIS3_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %42) #8
  br label %177, !llvm.loop !25

268:                                              ; preds = %184
  store i32 0, ptr %25, align 4
  br label %269

269:                                              ; preds = %268, %156
  call void @llvm.lifetime.end.p0(i64 4, ptr %41) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %40) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr %38) #8
  %270 = load i32, ptr %25, align 4
  switch i32 %270, label %298 [
    i32 0, label %271
    i32 14, label %133
  ]

271:                                              ; preds = %269
  br label %133, !llvm.loop !20

272:                                              ; preds = %258, %161
  call void @llvm.lifetime.end.p0(i64 16, ptr %38) #8
  br label %292

273:                                              ; preds = %133
  %274 = load i32, ptr @n, align 4, !tbaa !5
  %275 = sext i32 %274 to i64
  %276 = getelementptr inbounds [1001 x [1024 x i64]], ptr @d, i64 0, i64 %275
  %277 = load i32, ptr @k, align 4, !tbaa !5
  %278 = shl i32 1, %277
  %279 = sub nsw i32 %278, 1
  %280 = sext i32 %279 to i64
  %281 = getelementptr inbounds [1024 x i64], ptr %276, i64 0, i64 %280
  %282 = load i64, ptr %281, align 8, !tbaa !12
  %283 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %282)
          to label %284 unwind label %288

284:                                              ; preds = %273
  %285 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %283, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %286 unwind label %288

286:                                              ; preds = %284
  store i32 0, ptr %1, align 4
  store i32 1, ptr %25, align 4
  call void @_ZNSt3setISt4pairIxS0_IiiEESt4lessIS2_ESaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %27) #8
  call void @llvm.lifetime.end.p0(i64 48, ptr %27) #8
  %287 = load i32, ptr %1, align 4
  ret i32 %287

288:                                              ; preds = %284, %273
  %289 = landingpad { ptr, i32 }
          cleanup
  %290 = extractvalue { ptr, i32 } %289, 0
  store ptr %290, ptr %34, align 8
  %291 = extractvalue { ptr, i32 } %289, 1
  store i32 %291, ptr %35, align 4
  br label %292

292:                                              ; preds = %288, %272, %157
  call void @_ZNSt3setISt4pairIxS0_IiiEESt4lessIS2_ESaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %27) #8
  call void @llvm.lifetime.end.p0(i64 48, ptr %27) #8
  br label %293

293:                                              ; preds = %292
  %294 = load ptr, ptr %34, align 8
  %295 = load i32, ptr %35, align 4
  %296 = insertvalue { ptr, i32 } poison, ptr %294, 0
  %297 = insertvalue { ptr, i32 } %296, i32 %295, 1
  resume { ptr, i32 } %297

298:                                              ; preds = %269, %263
  unreachable
}

declare i32 @__isoc99_scanf(ptr noundef, ...) #3

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EE9push_backEOS2_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(12)) #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local { i64, i32 } @_ZSt9make_pairIRiSt4pairIiiEES1_INSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS3_INS4_IT0_E4typeEE6__typeEEOS5_OSA_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(8)) #0

; Function Attrs: mustprogress uwtable
declare dso_local i64 @_ZSt9make_pairIRiiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #0

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #5

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

; Function Attrs: mustprogress uwtable
declare dso_local i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt3setISt4pairIxS0_IiiEESt4lessIS2_ESaIS2_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(48)) unnamed_addr #6 align 2

; Function Attrs: mustprogress uwtable
declare dso_local { ptr, i8 } @_ZNSt3setISt4pairIxS0_IiiEESt4lessIS2_ESaIS2_EE6insertEOS2_(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 8 dereferenceable(16)) #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local { i64, i32 } @_ZSt9make_pairIiSt4pairIiiEES0_INSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(8)) #0

; Function Attrs: mustprogress uwtable
declare dso_local i64 @_ZSt9make_pairIiiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS1_INS2_IT0_E4typeEE6__typeEEOS3_OS8_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #0

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt4pairIxS_IiiEEC2IiS0_TnNSt9enable_ifIXaaclsr6_PCCFPIT_T0_EE22_MoveConstructiblePairIS4_S5_EEclsr6_PCCFPIS4_S5_EE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS_IS4_S5_E(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(12)) unnamed_addr #6 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNKSt3setISt4pairIxS0_IiiEESt4lessIS2_ESaIS2_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(48)) #6 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNKSt3setISt4pairIxS0_IiiEESt4lessIS2_ESaIS2_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(48)) #6 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(16) ptr @_ZNKSt23_Rb_tree_const_iteratorISt4pairIxS0_IiiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8)) #6 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_ZNSt3setISt4pairIxS0_IiiEESt4lessIS2_ESaIS2_EE5eraseERKS2_(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 8 dereferenceable(16)) #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24)) #6 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24)) #6 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIiS1_IiiEESt6vectorIS3_SaIS3_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8)) #6 align 2

; Function Attrs: mustprogress uwtable
declare dso_local { i64, i64 } @_ZSt9make_pairIRxSt4pairIiiEES1_INSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS3_INS4_IT0_E4typeEE6__typeEEOS5_OSA_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(8)) #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPSt4pairIiS1_IiiEESt6vectorIS3_SaIS3_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8)) #6 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt3setISt4pairIxS0_IiiEESt4lessIS2_ESaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(48)) unnamed_addr #6 align 2

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


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<std::pair<int, std::pair<int, int>>, std::allocator<std::pair<int, std::pair<int, int>>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::pair<int, std::pair<int, int>>, std::allocator<std::pair<int, std::pair<int, int>>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::pair<int, std::pair<int, int>>, std::allocator<std::pair<int, std::pair<int, int>>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::pair<int, std::pair<int, int>>, std::allocator<std::pair<int, std::pair<int, int>>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"struct.std::pair" = type { i32, %"struct.std::pair.0" }
%"struct.std::pair.0" = type { i32, i32 }
%"class.std::set" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<std::pair<long long, std::pair<int, int>>, std::pair<long long, std::pair<int, int>>, std::_Identity<std::pair<long long, std::pair<int, int>>>, std::less<std::pair<long long, std::pair<int, int>>>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<std::pair<long long, std::pair<int, int>>, std::pair<long long, std::pair<int, int>>, std::_Identity<std::pair<long long, std::pair<int, int>>>, std::less<std::pair<long long, std::pair<int, int>>>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::_Rb_tree_header" = type { %"struct.std::_Rb_tree_node_base", i64 }
%"struct.std::_Rb_tree_node_base" = type { i32, ptr, ptr, ptr }
%"struct.std::pair.7" = type { i64, %"struct.std::pair.0" }
%"struct.std::_Rb_tree_const_iterator" = type { ptr }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }

@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@k = external dso_local global i32, align 4
@g = external dso_local global [1001 x %"class.std::vector"], align 16
@d = external dso_local local_unnamed_addr global [1001 x [1024 x i64]], align 16
@v = external dso_local local_unnamed_addr global [1001 x [1024 x i32]], align 16
@.str = external hidden unnamed_addr constant [7 x i8], align 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 #0 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)) #1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #2 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca %"struct.std::pair", align 8
  %5 = alloca %"struct.std::pair.0", align 8
  %6 = alloca i32, align 4
  %7 = alloca %"struct.std::pair", align 8
  %8 = alloca %"struct.std::pair.0", align 8
  %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 %"struct.std::pair", align 8
  %15 = alloca %"struct.std::pair.0", align 8
  %16 = alloca %"struct.std::pair", align 8
  %17 = alloca %"struct.std::pair.0", align 8
  %18 = alloca %"class.std::set", align 8
  %19 = alloca %"struct.std::pair.7", align 8
  %20 = alloca %"struct.std::pair", align 8
  %21 = alloca i32, align 4
  %22 = alloca %"struct.std::pair.0", align 8
  %23 = alloca i32, align 4
  %24 = alloca i32, align 4
  %25 = alloca %"struct.std::pair.7", align 8
  %26 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %27 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %28 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %29 = alloca i32, align 4
  %30 = alloca i32, align 4
  %31 = alloca i64, align 8
  %32 = alloca %"struct.std::pair.7", align 8
  %33 = alloca %"struct.std::pair.0", align 8
  %34 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n, ptr noundef nonnull @m, ptr noundef nonnull @k)
  %35 = load i32, ptr @m, align 4, !tbaa !5
  %.not56 = icmp slt i32 %35, 1
  br i1 %.not56, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %0
  %.sroa.237.0..sroa_idx = getelementptr inbounds i8, ptr %4, i64 8
  %.sroa.233.0..sroa_idx = getelementptr inbounds i8, ptr %7, i64 8
  br label %37

._crit_edge:                                      ; preds = %37, %0
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %10) #8
  store i32 1, ptr %10, align 4, !tbaa !5
  %36 = load i32, ptr @k, align 4, !tbaa !5
  %.not4858 = icmp slt i32 %36, 1
  br i1 %.not4858, label %._crit_edge61, label %.lr.ph60

.lr.ph60:                                         ; preds = %._crit_edge
  %.sroa.229.0..sroa_idx = getelementptr inbounds i8, ptr %14, i64 8
  %.sroa.225.0..sroa_idx = getelementptr inbounds i8, ptr %16, i64 8
  br label %58

37:                                               ; preds = %.lr.ph, %37
  %.057 = phi i32 [ 1, %.lr.ph ], [ %49, %37 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #8
  %38 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %1, ptr noundef nonnull %2, ptr noundef nonnull %3)
  %39 = load i32, ptr %1, align 4, !tbaa !5
  %40 = sext i32 %39 to i64
  %41 = getelementptr inbounds [1001 x %"class.std::vector"], ptr @g, i64 0, i64 %40
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %4) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #8
  store i32 0, ptr %6, align 4, !tbaa !5
  %42 = call i64 @_ZSt9make_pairIRiiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %3, ptr noundef nonnull align 4 dereferenceable(4) %6)
  store i64 %42, ptr %5, align 8
  %43 = call { i64, i32 } @_ZSt9make_pairIRiSt4pairIiiEES1_INSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS3_INS4_IT0_E4typeEE6__typeEEOS5_OSA_(ptr noundef nonnull align 4 dereferenceable(4) %2, ptr noundef nonnull align 4 dereferenceable(8) %5)
  %.fca.0.extract34 = extractvalue { i64, i32 } %43, 0
  %.fca.1.extract35 = extractvalue { i64, i32 } %43, 1
  store i64 %.fca.0.extract34, ptr %4, align 8
  store i32 %.fca.1.extract35, ptr %.sroa.237.0..sroa_idx, align 8
  call void @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EE9push_backEOS2_(ptr noundef nonnull align 8 dereferenceable(24) %41, ptr noundef nonnull align 4 dereferenceable(12) %4)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #8
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %4) #8
  %44 = load i32, ptr %2, align 4, !tbaa !5
  %45 = sext i32 %44 to i64
  %46 = getelementptr inbounds [1001 x %"class.std::vector"], ptr @g, i64 0, i64 %45
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %7) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %9) #8
  store i32 0, ptr %9, align 4, !tbaa !5
  %47 = call i64 @_ZSt9make_pairIRiiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %3, ptr noundef nonnull align 4 dereferenceable(4) %9)
  store i64 %47, ptr %8, align 8
  %48 = call { i64, i32 } @_ZSt9make_pairIRiSt4pairIiiEES1_INSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS3_INS4_IT0_E4typeEE6__typeEEOS5_OSA_(ptr noundef nonnull align 4 dereferenceable(4) %1, ptr noundef nonnull align 4 dereferenceable(8) %8)
  %.fca.0.extract30 = extractvalue { i64, i32 } %48, 0
  %.fca.1.extract31 = extractvalue { i64, i32 } %48, 1
  store i64 %.fca.0.extract30, ptr %7, align 8
  store i32 %.fca.1.extract31, ptr %.sroa.233.0..sroa_idx, align 8
  call void @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EE9push_backEOS2_(ptr noundef nonnull align 8 dereferenceable(24) %46, ptr noundef nonnull align 4 dereferenceable(12) %7)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #8
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %7) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #8
  %49 = add nuw nsw i32 %.057, 1
  %50 = load i32, ptr @m, align 4, !tbaa !5
  %.not.not = icmp slt i32 %.057, %50
  br i1 %.not.not, label %37, label %._crit_edge, !llvm.loop !9

._crit_edge61:                                    ; preds = %58, %._crit_edge
  %.lcssa = phi i32 [ %36, %._crit_edge ], [ %72, %58 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %10) #8
  %51 = load i32, ptr @n, align 4, !tbaa !5
  %.not4965 = icmp slt i32 %51, 1
  %.not = icmp eq i32 %.lcssa, 31
  %or.cond = or i1 %.not4965, %.not
  br i1 %or.cond, label %._crit_edge67, label %.preheader.us.preheader

.preheader.us.preheader:                          ; preds = %._crit_edge61
  %52 = shl nuw nsw i32 1, %.lcssa
  %53 = add nuw i32 %51, 1
  %wide.trip.count80 = zext i32 %53 to i64
  %wide.trip.count = zext nneg i32 %52 to i64
  %min.iters.check = icmp ult i32 %.lcssa, 2
  %n.vec = and i64 %wide.trip.count, 2147483644
  br label %.preheader.us

.preheader.us:                                    ; preds = %.preheader.us.preheader, %._crit_edge64.us
  %indvars.iv77 = phi i64 [ 1, %.preheader.us.preheader ], [ %indvars.iv.next78, %._crit_edge64.us ]
  br i1 %min.iters.check, label %scalar.ph, label %vector.body

vector.body:                                      ; preds = %.preheader.us, %vector.body
  %index = phi i64 [ %index.next, %vector.body ], [ 0, %.preheader.us ]
  %54 = getelementptr inbounds [1001 x [1024 x i64]], ptr @d, i64 0, i64 %indvars.iv77, i64 %index
  %55 = getelementptr inbounds i8, ptr %54, i64 16
  store <2 x i64> <i64 1125899906842624, i64 1125899906842624>, ptr %54, align 16, !tbaa !11
  store <2 x i64> <i64 1125899906842624, i64 1125899906842624>, ptr %55, align 16, !tbaa !11
  %index.next = add nuw i64 %index, 4
  %56 = icmp eq i64 %index.next, %n.vec
  br i1 %56, label %._crit_edge64.us, label %vector.body, !llvm.loop !13

scalar.ph:                                        ; preds = %.preheader.us, %scalar.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %scalar.ph ], [ 0, %.preheader.us ]
  %57 = getelementptr inbounds [1001 x [1024 x i64]], ptr @d, i64 0, i64 %indvars.iv77, i64 %indvars.iv
  store i64 1125899906842624, ptr %57, align 8, !tbaa !11
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge64.us, label %scalar.ph, !llvm.loop !16

._crit_edge64.us:                                 ; preds = %vector.body, %scalar.ph
  %indvars.iv.next78 = add nuw nsw i64 %indvars.iv77, 1
  %exitcond81.not = icmp eq i64 %indvars.iv.next78, %wide.trip.count80
  br i1 %exitcond81.not, label %._crit_edge67, label %.preheader.us, !llvm.loop !17

58:                                               ; preds = %.lr.ph60, %58
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %11) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %12) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %13) #8
  %59 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %11, ptr noundef nonnull %12, ptr noundef nonnull %13)
  %60 = load i32, ptr %11, align 4, !tbaa !5
  %61 = sext i32 %60 to i64
  %62 = getelementptr inbounds [1001 x %"class.std::vector"], ptr @g, i64 0, i64 %61
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %14) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %15) #8
  %63 = call i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %13, ptr noundef nonnull align 4 dereferenceable(4) %10)
  store i64 %63, ptr %15, align 8
  %64 = call { i64, i32 } @_ZSt9make_pairIRiSt4pairIiiEES1_INSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS3_INS4_IT0_E4typeEE6__typeEEOS5_OSA_(ptr noundef nonnull align 4 dereferenceable(4) %12, ptr noundef nonnull align 4 dereferenceable(8) %15)
  %.fca.0.extract26 = extractvalue { i64, i32 } %64, 0
  %.fca.1.extract27 = extractvalue { i64, i32 } %64, 1
  store i64 %.fca.0.extract26, ptr %14, align 8
  store i32 %.fca.1.extract27, ptr %.sroa.229.0..sroa_idx, align 8
  call void @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EE9push_backEOS2_(ptr noundef nonnull align 8 dereferenceable(24) %62, ptr noundef nonnull align 4 dereferenceable(12) %14)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %15) #8
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %14) #8
  %65 = load i32, ptr %12, align 4, !tbaa !5
  %66 = sext i32 %65 to i64
  %67 = getelementptr inbounds [1001 x %"class.std::vector"], ptr @g, i64 0, i64 %66
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %16) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %17) #8
  %68 = call i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %13, ptr noundef nonnull align 4 dereferenceable(4) %10)
  store i64 %68, ptr %17, align 8
  %69 = call { i64, i32 } @_ZSt9make_pairIRiSt4pairIiiEES1_INSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS3_INS4_IT0_E4typeEE6__typeEEOS5_OSA_(ptr noundef nonnull align 4 dereferenceable(4) %11, ptr noundef nonnull align 4 dereferenceable(8) %17)
  %.fca.0.extract22 = extractvalue { i64, i32 } %69, 0
  %.fca.1.extract23 = extractvalue { i64, i32 } %69, 1
  store i64 %.fca.0.extract22, ptr %16, align 8
  store i32 %.fca.1.extract23, ptr %.sroa.225.0..sroa_idx, align 8
  call void @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EE9push_backEOS2_(ptr noundef nonnull align 8 dereferenceable(24) %67, ptr noundef nonnull align 4 dereferenceable(12) %16)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %17) #8
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %16) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %13) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %12) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %11) #8
  %70 = load i32, ptr %10, align 4, !tbaa !5
  %71 = add nsw i32 %70, 1
  store i32 %71, ptr %10, align 4, !tbaa !5
  %72 = load i32, ptr @k, align 4, !tbaa !5
  %.not48.not = icmp slt i32 %70, %72
  br i1 %.not48.not, label %58, label %._crit_edge61, !llvm.loop !18

._crit_edge67:                                    ; preds = %._crit_edge64.us, %._crit_edge61
  store i64 0, ptr getelementptr inbounds (i8, ptr @d, i64 8192), align 16, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %18) #8
  call void @_ZNSt3setISt4pairIxS0_IiiEESt4lessIS2_ESaIS2_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %18) #8
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %19) #8
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %20) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %21) #8
  store i32 0, ptr %21, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %22) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %23) #8
  store i32 1, ptr %23, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %24) #8
  store i32 0, ptr %24, align 4, !tbaa !5
  %73 = invoke i64 @_ZSt9make_pairIiiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS1_INS2_IT0_E4typeEE6__typeEEOS3_OS8_(ptr noundef nonnull align 4 dereferenceable(4) %23, ptr noundef nonnull align 4 dereferenceable(4) %24)
          to label %74 unwind label %94

74:                                               ; preds = %._crit_edge67
  store i64 %73, ptr %22, align 8
  %75 = invoke { i64, i32 } @_ZSt9make_pairIiSt4pairIiiEES0_INSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %21, ptr noundef nonnull align 4 dereferenceable(8) %22)
          to label %76 unwind label %94

76:                                               ; preds = %74
  %.fca.0.extract = extractvalue { i64, i32 } %75, 0
  %.fca.1.extract = extractvalue { i64, i32 } %75, 1
  store i64 %.fca.0.extract, ptr %20, align 8
  %.sroa.2.0..sroa_idx = getelementptr inbounds i8, ptr %20, i64 8
  store i32 %.fca.1.extract, ptr %.sroa.2.0..sroa_idx, align 8
  call void @_ZNSt4pairIxS_IiiEEC2IiS0_TnNSt9enable_ifIXaaclsr6_PCCFPIT_T0_EE22_MoveConstructiblePairIS4_S5_EEclsr6_PCCFPIS4_S5_EE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS_IS4_S5_E(ptr noundef nonnull align 8 dereferenceable(16) %19, ptr noundef nonnull align 4 dereferenceable(12) %20)
  %77 = invoke { ptr, i8 } @_ZNSt3setISt4pairIxS0_IiiEESt4lessIS2_ESaIS2_EE6insertEOS2_(ptr noundef nonnull align 8 dereferenceable(48) %18, ptr noundef nonnull align 8 dereferenceable(16) %19)
          to label %78 unwind label %94

78:                                               ; preds = %76
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %24) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %23) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %22) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %21) #8
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %20) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %19) #8
  %79 = call noundef zeroext i1 @_ZNKSt3setISt4pairIxS0_IiiEESt4lessIS2_ESaIS2_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(48) %18) #8
  br i1 %79, label %._crit_edge73, label %.lr.ph72

.lr.ph72:                                         ; preds = %78
  %80 = getelementptr inbounds i8, ptr %25, i64 8
  %81 = getelementptr inbounds i8, ptr %25, i64 12
  %82 = getelementptr inbounds i8, ptr %32, i64 8
  br label %83

83:                                               ; preds = %.lr.ph72, %144
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %25) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %26) #8
  %84 = call ptr @_ZNKSt3setISt4pairIxS0_IiiEESt4lessIS2_ESaIS2_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %18) #8
  store ptr %84, ptr %26, align 8
  %85 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNKSt23_Rb_tree_const_iteratorISt4pairIxS0_IiiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %26) #8
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %25, ptr noundef nonnull align 8 dereferenceable(16) %85, i64 16, i1 false)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %26) #8
  %86 = invoke noundef i64 @_ZNSt3setISt4pairIxS0_IiiEESt4lessIS2_ESaIS2_EE5eraseERKS2_(ptr noundef nonnull align 8 dereferenceable(48) %18, ptr noundef nonnull align 8 dereferenceable(16) %25)
          to label %87 unwind label %96

87:                                               ; preds = %83
  %88 = load i32, ptr %80, align 8, !tbaa !19
  %89 = load i32, ptr %81, align 4, !tbaa !22
  %90 = sext i32 %88 to i64
  %91 = sext i32 %89 to i64
  %92 = getelementptr inbounds [1001 x [1024 x i32]], ptr @v, i64 0, i64 %90, i64 %91
  %93 = load i32, ptr %92, align 4, !tbaa !5
  %.not50 = icmp eq i32 %93, 0
  br i1 %.not50, label %98, label %144, !llvm.loop !23

94:                                               ; preds = %76, %74, %._crit_edge67
  %95 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %24) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %23) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %22) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %21) #8
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %20) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %19) #8
  br label %160

96:                                               ; preds = %83
  %97 = landingpad { ptr, i32 }
          cleanup
  br label %146

98:                                               ; preds = %87
  store i32 1, ptr %92, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %27) #8
  %99 = getelementptr inbounds [1001 x %"class.std::vector"], ptr @g, i64 0, i64 %90
  %100 = call ptr @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %99) #8
  store ptr %100, ptr %27, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %28) #8
  %101 = call ptr @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %99) #8
  store ptr %101, ptr %28, align 8
  %102 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairIiS1_IiiEESt6vectorIS3_SaIS3_EEEEbRKNS_17__normal_iteratorIT_T0_EESD_(ptr noundef nonnull align 8 dereferenceable(8) %27, ptr noundef nonnull align 8 dereferenceable(8) %28) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %28) #8
  br i1 %102, label %.lr.ph69, label %._crit_edge70

.lr.ph69:                                         ; preds = %98
  %103 = getelementptr inbounds [1001 x [1024 x i64]], ptr @d, i64 0, i64 %90, i64 %91
  br label %104

._crit_edge70:                                    ; preds = %140, %98
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %27) #8
  br label %144

104:                                              ; preds = %.lr.ph69, %140
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %29) #8
  %105 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIiS1_IiiEESt6vectorIS3_SaIS3_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %27) #8
  %106 = load i32, ptr %105, align 4, !tbaa !24
  store i32 %106, ptr %29, align 4, !tbaa !5
  %107 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIiS1_IiiEESt6vectorIS3_SaIS3_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %27) #8
  %108 = getelementptr inbounds i8, ptr %107, i64 4
  %109 = load i32, ptr %108, align 4, !tbaa !26
  %110 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIiS1_IiiEESt6vectorIS3_SaIS3_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %27) #8
  %111 = getelementptr inbounds i8, ptr %110, i64 8
  %112 = load i32, ptr %111, align 4, !tbaa !27
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %30) #8
  %.not51 = icmp eq i32 %112, 0
  %113 = add nsw i32 %112, -1
  %114 = shl nuw i32 1, %113
  %115 = select i1 %.not51, i32 0, i32 %114
  %storemerge52 = or i32 %115, %89
  store i32 %storemerge52, ptr %30, align 4, !tbaa !5
  %116 = load i32, ptr %29, align 4, !tbaa !5
  %117 = sext i32 %116 to i64
  %118 = sext i32 %storemerge52 to i64
  %119 = getelementptr inbounds [1001 x [1024 x i32]], ptr @v, i64 0, i64 %117, i64 %118
  %120 = load i32, ptr %119, align 4, !tbaa !5
  %.not53 = icmp eq i32 %120, 0
  br i1 %.not53, label %121, label %140

121:                                              ; preds = %104
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %31) #8
  %122 = load i64, ptr %103, align 8, !tbaa !11
  %123 = sext i32 %109 to i64
  %124 = add nsw i64 %122, %123
  store i64 %124, ptr %31, align 8, !tbaa !11
  %125 = getelementptr inbounds [1001 x [1024 x i64]], ptr @d, i64 0, i64 %117, i64 %118
  %126 = load i64, ptr %125, align 8, !tbaa !11
  %127 = icmp slt i64 %124, %126
  br i1 %127, label %128, label %139

128:                                              ; preds = %121
  store i64 %124, ptr %125, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %32) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %33) #8
  %129 = invoke i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %29, ptr noundef nonnull align 4 dereferenceable(4) %30)
          to label %130 unwind label %137

130:                                              ; preds = %128
  store i64 %129, ptr %33, align 8
  %131 = invoke { i64, i64 } @_ZSt9make_pairIRxSt4pairIiiEES1_INSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS3_INS4_IT0_E4typeEE6__typeEEOS5_OSA_(ptr noundef nonnull align 8 dereferenceable(8) %31, ptr noundef nonnull align 4 dereferenceable(8) %33)
          to label %132 unwind label %137

132:                                              ; preds = %130
  %133 = extractvalue { i64, i64 } %131, 0
  store i64 %133, ptr %32, align 8
  %134 = extractvalue { i64, i64 } %131, 1
  store i64 %134, ptr %82, align 8
  %135 = invoke { ptr, i8 } @_ZNSt3setISt4pairIxS0_IiiEESt4lessIS2_ESaIS2_EE6insertEOS2_(ptr noundef nonnull align 8 dereferenceable(48) %18, ptr noundef nonnull align 8 dereferenceable(16) %32)
          to label %136 unwind label %137

136:                                              ; preds = %132
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %33) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %32) #8
  br label %139

137:                                              ; preds = %132, %130, %128
  %138 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %33) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %32) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %31) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %30) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %29) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %27) #8
  br label %146

139:                                              ; preds = %136, %121
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %31) #8
  br label %140

140:                                              ; preds = %104, %139
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %30) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %29) #8
  %141 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPSt4pairIiS1_IiiEESt6vectorIS3_SaIS3_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %27) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %28) #8
  %142 = call ptr @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %99) #8
  store ptr %142, ptr %28, align 8
  %143 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairIiS1_IiiEESt6vectorIS3_SaIS3_EEEEbRKNS_17__normal_iteratorIT_T0_EESD_(ptr noundef nonnull align 8 dereferenceable(8) %27, ptr noundef nonnull align 8 dereferenceable(8) %28) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %28) #8
  br i1 %143, label %104, label %._crit_edge70, !llvm.loop !28

144:                                              ; preds = %87, %._crit_edge70
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %25) #8
  %145 = call noundef zeroext i1 @_ZNKSt3setISt4pairIxS0_IiiEESt4lessIS2_ESaIS2_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(48) %18) #8
  br i1 %145, label %._crit_edge73, label %83

146:                                              ; preds = %137, %96
  %.pn = phi { ptr, i32 } [ %138, %137 ], [ %97, %96 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %25) #8
  br label %160

._crit_edge73:                                    ; preds = %144, %78
  %147 = load i32, ptr @n, align 4, !tbaa !5
  %148 = sext i32 %147 to i64
  %149 = load i32, ptr @k, align 4, !tbaa !5
  %notmask = shl nsw i32 -1, %149
  %150 = xor i32 %notmask, -1
  %151 = zext nneg i32 %150 to i64
  %152 = getelementptr inbounds [1001 x [1024 x i64]], ptr @d, i64 0, i64 %148, i64 %151
  %153 = load i64, ptr %152, align 8, !tbaa !11
  %154 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %153)
          to label %155 unwind label %158

155:                                              ; preds = %._crit_edge73
  %156 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %154, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %157 unwind label %158

157:                                              ; preds = %155
  call void @_ZNSt3setISt4pairIxS0_IiiEESt4lessIS2_ESaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %18) #8
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %18) #8
  ret i32 0

158:                                              ; preds = %155, %._crit_edge73
  %159 = landingpad { ptr, i32 }
          cleanup
  br label %160

160:                                              ; preds = %158, %146, %94
  %.pn.pn = phi { ptr, i32 } [ %.pn, %146 ], [ %159, %158 ], [ %95, %94 ]
  call void @_ZNSt3setISt4pairIxS0_IiiEESt4lessIS2_ESaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %18) #8
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %18) #8
  resume { ptr, i32 } %.pn.pn
}

; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EE9push_backEOS2_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(12)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local { i64, i32 } @_ZSt9make_pairIRiSt4pairIiiEES1_INSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS3_INS4_IT0_E4typeEE6__typeEEOS5_OSA_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(8)) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
declare dso_local i64 @_ZSt9make_pairIRiiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #0

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #5

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

; Function Attrs: mustprogress uwtable
declare dso_local i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt3setISt4pairIxS0_IiiEESt4lessIS2_ESaIS2_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(48)) unnamed_addr #6 align 2

; Function Attrs: mustprogress uwtable
declare dso_local { ptr, i8 } @_ZNSt3setISt4pairIxS0_IiiEESt4lessIS2_ESaIS2_EE6insertEOS2_(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local { i64, i32 } @_ZSt9make_pairIiSt4pairIiiEES0_INSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(8)) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
declare dso_local i64 @_ZSt9make_pairIiiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS1_INS2_IT0_E4typeEE6__typeEEOS3_OS8_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #0

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt4pairIxS_IiiEEC2IiS0_TnNSt9enable_ifIXaaclsr6_PCCFPIT_T0_EE22_MoveConstructiblePairIS4_S5_EEclsr6_PCCFPIS4_S5_EE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS_IS4_S5_E(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(12)) unnamed_addr #6 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNKSt3setISt4pairIxS0_IiiEESt4lessIS2_ESaIS2_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(48)) local_unnamed_addr #6 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNKSt3setISt4pairIxS0_IiiEESt4lessIS2_ESaIS2_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(48)) local_unnamed_addr #6 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(16) ptr @_ZNKSt23_Rb_tree_const_iteratorISt4pairIxS0_IiiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #6 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_ZNSt3setISt4pairIxS0_IiiEESt4lessIS2_ESaIS2_EE5eraseERKS2_(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #6 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #6 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIiS1_IiiEESt6vectorIS3_SaIS3_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #6 align 2

; Function Attrs: mustprogress uwtable
declare dso_local { i64, i64 } @_ZSt9make_pairIRxSt4pairIiiEES1_INSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS3_INS4_IT0_E4typeEE6__typeEEOS5_OSA_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(8)) local_unnamed_addr #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPSt4pairIiS1_IiiEESt6vectorIS3_SaIS3_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #6 align 2

; 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 #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt3setISt4pairIxS0_IiiEESt4lessIS2_ESaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(48)) unnamed_addr #6 align 2

attributes #0 = { 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 #1 = { 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 #2 = { 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 #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #6 = { 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 #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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!12, !12, i64 0}
!12 = !{!"long long", !7, i64 0}
!13 = distinct !{!13, !10, !14, !15}
!14 = !{!"llvm.loop.isvectorized", i32 1}
!15 = !{!"llvm.loop.unroll.runtime.disable"}
!16 = distinct !{!16, !10, !15, !14}
!17 = distinct !{!17, !10}
!18 = distinct !{!18, !10}
!19 = !{!20, !6, i64 8}
!20 = !{!"_ZTSSt4pairIxS_IiiEE", !12, i64 0, !21, i64 8}
!21 = !{!"_ZTSSt4pairIiiE", !6, i64 0, !6, i64 4}
!22 = !{!20, !6, i64 12}
!23 = distinct !{!23, !10}
!24 = !{!25, !6, i64 0}
!25 = !{!"_ZTSSt4pairIiS_IiiEE", !6, i64 0, !21, i64 4}
!26 = !{!25, !6, i64 4}
!27 = !{!25, !6, i64 8}
!28 = distinct !{!28, !10}


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