; LLVM IR from kazunetakahashi/atcoder :: 2019/0204_TDPC (T)

; 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::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl" }
%"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl" = type { %"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl_data" }
%"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"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" }
%"class.std::allocator" = type { i8 }

@K = external dso_local global i64, align 8
@N = external dso_local global i64, align 8
@k = external dso_local global %"class.std::vector", align 8
@a = external dso_local global %"class.std::vector", align 8
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSaIxEC2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #1 align 2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIxSaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIxSaIxEEC2ERKS1_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIxSaIxEEC2EmRKS0_(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef, ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z9mod_powerSt6vectorIxSaIxEEx(ptr dead_on_unwind noalias writable sret(%"class.std::vector") align 8, ptr noundef, i64 noundef) #2

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #3 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca %"class.std::vector", align 8
  %3 = alloca %"class.std::allocator", align 1
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca %"class.std::vector", align 8
  %8 = alloca %"class.std::allocator", align 1
  %9 = alloca i32, align 4
  %10 = alloca i64, align 8
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca %"class.std::vector", align 8
  %15 = alloca %"class.std::vector", align 8
  %16 = alloca i64, align 8
  %17 = alloca i32, align 4
  %18 = alloca i64, align 8
  store i32 0, ptr %1, align 4
  %19 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) @K)
  %20 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %19, ptr noundef nonnull align 8 dereferenceable(8) @N)
  %21 = load i64, ptr @N, align 8, !tbaa !5
  %22 = load i64, ptr @K, align 8, !tbaa !5
  %23 = icmp sle i64 %21, %22
  br i1 %23, label %24, label %27

24:                                               ; preds = %0
  %25 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef 1)
  %26 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %25, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  store i32 0, ptr %1, align 4
  br label %196

27:                                               ; preds = %0
  call void @llvm.lifetime.start.p0(i64 24, ptr %2) #7
  %28 = load i64, ptr @K, align 8, !tbaa !5
  %29 = add nsw i64 %28, 1
  call void @llvm.lifetime.start.p0(i64 1, ptr %3) #7
  call void @_ZNSaIxEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %3) #7
  invoke void @_ZNSt6vectorIxSaIxEEC2EmRKS0_(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %29, ptr noundef nonnull align 1 dereferenceable(1) %3)
          to label %30 unwind label %38

30:                                               ; preds = %27
  %31 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIxSaIxEEaSEOS1_(ptr noundef nonnull align 8 dereferenceable(24) @k, ptr noundef nonnull align 8 dereferenceable(24) %2) #7
  call void @_ZNSt6vectorIxSaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %2) #7
  call void @_ZNSt15__new_allocatorIxED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %3) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %3) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %2) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #7
  store i32 0, ptr %6, align 4, !tbaa !9
  br label %32

32:                                               ; preds = %46, %30
  %33 = load i32, ptr %6, align 4, !tbaa !9
  %34 = sext i32 %33 to i64
  %35 = load i64, ptr @K, align 8, !tbaa !5
  %36 = icmp slt i64 %34, %35
  br i1 %36, label %42, label %37

37:                                               ; preds = %32
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #7
  br label %49

38:                                               ; preds = %27
  %39 = landingpad { ptr, i32 }
          cleanup
  %40 = extractvalue { ptr, i32 } %39, 0
  store ptr %40, ptr %4, align 8
  %41 = extractvalue { ptr, i32 } %39, 1
  store i32 %41, ptr %5, align 4
  call void @_ZNSt15__new_allocatorIxED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %3) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %3) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %2) #7
  br label %204

42:                                               ; preds = %32
  %43 = load i32, ptr %6, align 4, !tbaa !9
  %44 = sext i32 %43 to i64
  %45 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @k, i64 noundef %44) #7
  store i64 1, ptr %45, align 8, !tbaa !5
  br label %46

46:                                               ; preds = %42
  %47 = load i32, ptr %6, align 4, !tbaa !9
  %48 = add nsw i32 %47, 1
  store i32 %48, ptr %6, align 4, !tbaa !9
  br label %32, !llvm.loop !11

49:                                               ; preds = %37
  %50 = load i64, ptr @K, align 8, !tbaa !5
  %51 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @k, i64 noundef %50) #7
  store i64 1, ptr %51, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 24, ptr %7) #7
  %52 = load i64, ptr @K, align 8, !tbaa !5
  %53 = mul nsw i64 2, %52
  %54 = sub nsw i64 %53, 1
  call void @llvm.lifetime.start.p0(i64 1, ptr %8) #7
  call void @_ZNSaIxEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %8) #7
  invoke void @_ZNSt6vectorIxSaIxEEC2EmRKS0_(ptr noundef nonnull align 8 dereferenceable(24) %7, i64 noundef %54, ptr noundef nonnull align 1 dereferenceable(1) %8)
          to label %55 unwind label %63

55:                                               ; preds = %49
  %56 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIxSaIxEEaSEOS1_(ptr noundef nonnull align 8 dereferenceable(24) @a, ptr noundef nonnull align 8 dereferenceable(24) %7) #7
  call void @_ZNSt6vectorIxSaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %7) #7
  call void @_ZNSt15__new_allocatorIxED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %8) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %8) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %7) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #7
  store i32 0, ptr %9, align 4, !tbaa !9
  br label %57

57:                                               ; preds = %71, %55
  %58 = load i32, ptr %9, align 4, !tbaa !9
  %59 = sext i32 %58 to i64
  %60 = load i64, ptr @K, align 8, !tbaa !5
  %61 = icmp slt i64 %59, %60
  br i1 %61, label %67, label %62

62:                                               ; preds = %57
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #7
  br label %74

63:                                               ; preds = %49
  %64 = landingpad { ptr, i32 }
          cleanup
  %65 = extractvalue { ptr, i32 } %64, 0
  store ptr %65, ptr %4, align 8
  %66 = extractvalue { ptr, i32 } %64, 1
  store i32 %66, ptr %5, align 4
  call void @_ZNSt15__new_allocatorIxED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %8) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %8) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %7) #7
  br label %204

67:                                               ; preds = %57
  %68 = load i32, ptr %9, align 4, !tbaa !9
  %69 = sext i32 %68 to i64
  %70 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @a, i64 noundef %69) #7
  store i64 1, ptr %70, align 8, !tbaa !5
  br label %71

71:                                               ; preds = %67
  %72 = load i32, ptr %9, align 4, !tbaa !9
  %73 = add nsw i32 %72, 1
  store i32 %73, ptr %9, align 4, !tbaa !9
  br label %57, !llvm.loop !13

74:                                               ; preds = %62
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #7
  %75 = load i64, ptr @K, align 8, !tbaa !5
  store i64 %75, ptr %10, align 8, !tbaa !5
  br label %76

76:                                               ; preds = %121, %74
  %77 = load i64, ptr %10, align 8, !tbaa !5
  %78 = load i64, ptr @K, align 8, !tbaa !5
  %79 = mul nsw i64 2, %78
  %80 = sub nsw i64 %79, 1
  %81 = icmp slt i64 %77, %80
  br i1 %81, label %83, label %82

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

83:                                               ; preds = %76
  %84 = load i64, ptr %10, align 8, !tbaa !5
  %85 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @a, i64 noundef %84) #7
  store i64 0, ptr %85, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #7
  store i32 0, ptr %12, align 4, !tbaa !9
  br label %86

86:                                               ; preds = %117, %83
  %87 = load i32, ptr %12, align 4, !tbaa !9
  %88 = sext i32 %87 to i64
  %89 = load i64, ptr @K, align 8, !tbaa !5
  %90 = icmp slt i64 %88, %89
  br i1 %90, label %92, label %91

91:                                               ; preds = %86
  store i32 11, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #7
  br label %120

92:                                               ; preds = %86
  %93 = load i64, ptr %10, align 8, !tbaa !5
  %94 = sub nsw i64 %93, 1
  %95 = load i32, ptr %12, align 4, !tbaa !9
  %96 = sext i32 %95 to i64
  %97 = sub nsw i64 %94, %96
  %98 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @a, i64 noundef %97) #7
  %99 = load i64, ptr %98, align 8, !tbaa !5
  %100 = load i64, ptr @K, align 8, !tbaa !5
  %101 = sub nsw i64 %100, 1
  %102 = load i32, ptr %12, align 4, !tbaa !9
  %103 = sext i32 %102 to i64
  %104 = sub nsw i64 %101, %103
  %105 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @k, i64 noundef %104) #7
  %106 = load i64, ptr %105, align 8, !tbaa !5
  %107 = mul nsw i64 %99, %106
  %108 = srem i64 %107, 1000000007
  %109 = load i64, ptr %10, align 8, !tbaa !5
  %110 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @a, i64 noundef %109) #7
  %111 = load i64, ptr %110, align 8, !tbaa !5
  %112 = add nsw i64 %111, %108
  store i64 %112, ptr %110, align 8, !tbaa !5
  %113 = load i64, ptr %10, align 8, !tbaa !5
  %114 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @a, i64 noundef %113) #7
  %115 = load i64, ptr %114, align 8, !tbaa !5
  %116 = srem i64 %115, 1000000007
  store i64 %116, ptr %114, align 8, !tbaa !5
  br label %117

117:                                              ; preds = %92
  %118 = load i32, ptr %12, align 4, !tbaa !9
  %119 = add nsw i32 %118, 1
  store i32 %119, ptr %12, align 4, !tbaa !9
  br label %86, !llvm.loop !14

120:                                              ; preds = %91
  br label %121

121:                                              ; preds = %120
  %122 = load i64, ptr %10, align 8, !tbaa !5
  %123 = add nsw i64 %122, 1
  store i64 %123, ptr %10, align 8, !tbaa !5
  br label %76, !llvm.loop !15

124:                                              ; preds = %82
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #7
  store i32 0, ptr %13, align 4, !tbaa !9
  br label %125

125:                                              ; preds = %145, %124
  %126 = load i32, ptr %13, align 4, !tbaa !9
  %127 = sext i32 %126 to i64
  %128 = load i64, ptr @K, align 8, !tbaa !5
  %129 = icmp slt i64 %127, %128
  br i1 %129, label %131, label %130

130:                                              ; preds = %125
  store i32 14, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #7
  br label %148

131:                                              ; preds = %125
  %132 = load i32, ptr %13, align 4, !tbaa !9
  %133 = sext i32 %132 to i64
  %134 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @k, i64 noundef %133) #7
  %135 = load i64, ptr %134, align 8, !tbaa !5
  %136 = sub nsw i64 1000000007, %135
  %137 = load i32, ptr %13, align 4, !tbaa !9
  %138 = sext i32 %137 to i64
  %139 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @k, i64 noundef %138) #7
  store i64 %136, ptr %139, align 8, !tbaa !5
  %140 = load i32, ptr %13, align 4, !tbaa !9
  %141 = sext i32 %140 to i64
  %142 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @k, i64 noundef %141) #7
  %143 = load i64, ptr %142, align 8, !tbaa !5
  %144 = srem i64 %143, 1000000007
  store i64 %144, ptr %142, align 8, !tbaa !5
  br label %145

145:                                              ; preds = %131
  %146 = load i32, ptr %13, align 4, !tbaa !9
  %147 = add nsw i32 %146, 1
  store i32 %147, ptr %13, align 4, !tbaa !9
  br label %125, !llvm.loop !16

148:                                              ; preds = %130
  call void @llvm.lifetime.start.p0(i64 24, ptr %14) #7
  call void @_ZNSt6vectorIxSaIxEEC2ERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %15, ptr noundef nonnull align 8 dereferenceable(24) @k)
  %149 = load i64, ptr @N, align 8, !tbaa !5
  %150 = load i64, ptr @K, align 8, !tbaa !5
  %151 = sub nsw i64 %149, %150
  invoke void @_Z9mod_powerSt6vectorIxSaIxEEx(ptr dead_on_unwind writable sret(%"class.std::vector") align 8 %14, ptr noundef %15, i64 noundef %151)
          to label %152 unwind label %162

152:                                              ; preds = %148
  call void @_ZNSt6vectorIxSaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %15) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #7
  store i64 0, ptr %16, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #7
  store i32 0, ptr %17, align 4, !tbaa !9
  br label %153

153:                                              ; preds = %187, %152
  %154 = load i32, ptr %17, align 4, !tbaa !9
  %155 = sext i32 %154 to i64
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #7
  %156 = call noundef i64 @_ZNKSt6vectorIxSaIxEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %14) #7
  store i64 %156, ptr %18, align 8, !tbaa !5
  %157 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) @K, ptr noundef nonnull align 8 dereferenceable(8) %18)
          to label %158 unwind label %166

158:                                              ; preds = %153
  %159 = load i64, ptr %157, align 8, !tbaa !5
  %160 = icmp slt i64 %155, %159
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #7
  br i1 %160, label %170, label %161

161:                                              ; preds = %158
  store i32 17, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #7
  br label %190

162:                                              ; preds = %148
  %163 = landingpad { ptr, i32 }
          cleanup
  %164 = extractvalue { ptr, i32 } %163, 0
  store ptr %164, ptr %4, align 8
  %165 = extractvalue { ptr, i32 } %163, 1
  store i32 %165, ptr %5, align 4
  call void @_ZNSt6vectorIxSaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %15) #7
  br label %203

166:                                              ; preds = %153
  %167 = landingpad { ptr, i32 }
          cleanup
  %168 = extractvalue { ptr, i32 } %167, 0
  store ptr %168, ptr %4, align 8
  %169 = extractvalue { ptr, i32 } %167, 1
  store i32 %169, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #7
  br label %202

170:                                              ; preds = %158
  %171 = load i32, ptr %17, align 4, !tbaa !9
  %172 = sext i32 %171 to i64
  %173 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %14, i64 noundef %172) #7
  %174 = load i64, ptr %173, align 8, !tbaa !5
  %175 = load i64, ptr @K, align 8, !tbaa !5
  %176 = sub nsw i64 %175, 1
  %177 = load i32, ptr %17, align 4, !tbaa !9
  %178 = sext i32 %177 to i64
  %179 = add nsw i64 %176, %178
  %180 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @a, i64 noundef %179) #7
  %181 = load i64, ptr %180, align 8, !tbaa !5
  %182 = mul nsw i64 %174, %181
  %183 = load i64, ptr %16, align 8, !tbaa !5
  %184 = add nsw i64 %183, %182
  store i64 %184, ptr %16, align 8, !tbaa !5
  %185 = load i64, ptr %16, align 8, !tbaa !5
  %186 = srem i64 %185, 1000000007
  store i64 %186, ptr %16, align 8, !tbaa !5
  br label %187

187:                                              ; preds = %170
  %188 = load i32, ptr %17, align 4, !tbaa !9
  %189 = add nsw i32 %188, 1
  store i32 %189, ptr %17, align 4, !tbaa !9
  br label %153, !llvm.loop !17

190:                                              ; preds = %161
  %191 = load i64, ptr %16, align 8, !tbaa !5
  %192 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %191)
          to label %193 unwind label %198

193:                                              ; preds = %190
  %194 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %192, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %195 unwind label %198

195:                                              ; preds = %193
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #7
  call void @_ZNSt6vectorIxSaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %14) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %14) #7
  br label %196

196:                                              ; preds = %195, %24
  %197 = load i32, ptr %1, align 4
  ret i32 %197

198:                                              ; preds = %193, %190
  %199 = landingpad { ptr, i32 }
          cleanup
  %200 = extractvalue { ptr, i32 } %199, 0
  store ptr %200, ptr %4, align 8
  %201 = extractvalue { ptr, i32 } %199, 1
  store i32 %201, ptr %5, align 4
  br label %202

202:                                              ; preds = %198, %166
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #7
  call void @_ZNSt6vectorIxSaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %14) #7
  br label %203

203:                                              ; preds = %202, %162
  call void @llvm.lifetime.end.p0(i64 24, ptr %14) #7
  br label %204

204:                                              ; preds = %203, %63, %38
  %205 = load ptr, ptr %4, align 8
  %206 = load i32, ptr %5, align 4
  %207 = insertvalue { ptr, i32 } poison, ptr %205, 0
  %208 = insertvalue { ptr, i32 } %207, i32 %206, 1
  resume { ptr, i32 } %208
}

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

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

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt15__new_allocatorIxED2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #1 align 2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { 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 #3 = { 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 #4 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { 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 #7 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !12}
!15 = distinct !{!15, !12}
!16 = distinct !{!16, !12}
!17 = distinct !{!17, !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::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl" }
%"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl" = type { %"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl_data" }
%"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"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" }
%"class.std::allocator" = type { i8 }

@K = external dso_local global i64, align 8
@N = external dso_local global i64, align 8
@k = external dso_local global %"class.std::vector", align 8
@a = external dso_local global %"class.std::vector", align 8
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt6vectorIxSaIxEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #1 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 #2 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSaIxEC2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #1 align 2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIxSaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIxSaIxEEC2ERKS1_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIxSaIxEEC2EmRKS0_(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef, ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z9mod_powerSt6vectorIxSaIxEEx(ptr dead_on_unwind noalias writable sret(%"class.std::vector") align 8, ptr noundef, i64 noundef) local_unnamed_addr #2

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #3 personality ptr @__gxx_personality_v0 {
  %1 = alloca %"class.std::vector", align 8
  %2 = alloca %"class.std::allocator", align 1
  %3 = alloca %"class.std::vector", align 8
  %4 = alloca %"class.std::allocator", align 1
  %5 = alloca %"class.std::vector", align 8
  %6 = alloca %"class.std::vector", align 8
  %7 = alloca i64, align 8
  %8 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) @K)
  %9 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %8, ptr noundef nonnull align 8 dereferenceable(8) @N)
  %10 = load i64, ptr @N, align 8, !tbaa !5
  %11 = load i64, ptr @K, align 8, !tbaa !5
  %.not = icmp sgt i64 %10, %11
  br i1 %.not, label %15, label %12

12:                                               ; preds = %0
  %13 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef 1)
  %14 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %13, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %108

15:                                               ; preds = %0
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %1) #7
  %16 = add nsw i64 %11, 1
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %2) #7
  call void @_ZNSaIxEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %2) #7
  invoke void @_ZNSt6vectorIxSaIxEEC2EmRKS0_(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %16, ptr noundef nonnull align 1 dereferenceable(1) %2)
          to label %17 unwind label %25

17:                                               ; preds = %15
  %18 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIxSaIxEEaSEOS1_(ptr noundef nonnull align 8 dereferenceable(24) @k, ptr noundef nonnull align 8 dereferenceable(24) %1) #7
  call void @_ZNSt6vectorIxSaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %1) #7
  call void @_ZNSt15__new_allocatorIxED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %2) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %2) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %1) #7
  %19 = load i64, ptr @K, align 8, !tbaa !5
  %20 = icmp sgt i64 %19, 0
  br i1 %20, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %17
  %.lcssa50 = phi i64 [ %19, %17 ], [ %28, %.lr.ph ]
  %21 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @k, i64 noundef %.lcssa50) #7
  store i64 1, ptr %21, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %3) #7
  %22 = load i64, ptr @K, align 8, !tbaa !5
  %23 = shl nsw i64 %22, 1
  %24 = add nsw i64 %23, -1
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %4) #7
  call void @_ZNSaIxEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %4) #7
  invoke void @_ZNSt6vectorIxSaIxEEC2EmRKS0_(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %24, ptr noundef nonnull align 1 dereferenceable(1) %4)
          to label %30 unwind label %38

25:                                               ; preds = %15
  %26 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt15__new_allocatorIxED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %2) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %2) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %1) #7
  br label %112

.lr.ph:                                           ; preds = %17, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %17 ]
  %27 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @k, i64 noundef %indvars.iv) #7
  store i64 1, ptr %27, align 8, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %28 = load i64, ptr @K, align 8, !tbaa !5
  %29 = icmp sgt i64 %28, %indvars.iv.next
  br i1 %29, label %.lr.ph, label %._crit_edge, !llvm.loop !9

30:                                               ; preds = %._crit_edge
  %31 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIxSaIxEEaSEOS1_(ptr noundef nonnull align 8 dereferenceable(24) @a, ptr noundef nonnull align 8 dereferenceable(24) %3) #7
  call void @_ZNSt6vectorIxSaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #7
  call void @_ZNSt15__new_allocatorIxED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %4) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %4) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %3) #7
  %32 = load i64, ptr @K, align 8, !tbaa !5
  %33 = icmp sgt i64 %32, 0
  br i1 %33, label %.lr.ph54, label %.preheader49

.preheader49:                                     ; preds = %.lr.ph54, %30
  %34 = phi i64 [ %32, %30 ], [ %41, %.lr.ph54 ]
  %35 = shl nsw i64 %34, 1
  %36 = add nsw i64 %35, -1
  %37 = icmp slt i64 %34, %36
  br i1 %37, label %.lr.ph61, label %.preheader

38:                                               ; preds = %._crit_edge
  %39 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt15__new_allocatorIxED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %4) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %4) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %3) #7
  br label %112

.lr.ph54:                                         ; preds = %30, %.lr.ph54
  %indvars.iv75 = phi i64 [ %indvars.iv.next76, %.lr.ph54 ], [ 0, %30 ]
  %40 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @a, i64 noundef %indvars.iv75) #7
  store i64 1, ptr %40, align 8, !tbaa !5
  %indvars.iv.next76 = add nuw nsw i64 %indvars.iv75, 1
  %41 = load i64, ptr @K, align 8, !tbaa !5
  %42 = icmp sgt i64 %41, %indvars.iv.next76
  br i1 %42, label %.lr.ph54, label %.preheader49, !llvm.loop !11

.preheader:                                       ; preds = %._crit_edge59, %.preheader49
  %43 = phi i64 [ %34, %.preheader49 ], [ %48, %._crit_edge59 ]
  %44 = icmp sgt i64 %43, 0
  br i1 %44, label %.lr.ph63, label %._crit_edge64

.lr.ph61:                                         ; preds = %.preheader49, %._crit_edge59
  %.03360 = phi i64 [ %49, %._crit_edge59 ], [ %34, %.preheader49 ]
  %45 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @a, i64 noundef %.03360) #7
  store i64 0, ptr %45, align 8, !tbaa !5
  %46 = load i64, ptr @K, align 8, !tbaa !5
  %47 = icmp sgt i64 %46, 0
  br i1 %47, label %.lr.ph58, label %._crit_edge59

._crit_edge59:                                    ; preds = %.lr.ph58, %.lr.ph61
  %48 = phi i64 [ %46, %.lr.ph61 ], [ %69, %.lr.ph58 ]
  %49 = add nsw i64 %.03360, 1
  %50 = shl nsw i64 %48, 1
  %51 = add nsw i64 %50, -1
  %52 = icmp slt i64 %49, %51
  br i1 %52, label %.lr.ph61, label %.preheader, !llvm.loop !12

.lr.ph58:                                         ; preds = %.lr.ph61, %.lr.ph58
  %indvars.iv78 = phi i64 [ %indvars.iv.next79, %.lr.ph58 ], [ 0, %.lr.ph61 ]
  %53 = xor i64 %indvars.iv78, -1
  %54 = add i64 %.03360, %53
  %55 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @a, i64 noundef %54) #7
  %56 = load i64, ptr %55, align 8, !tbaa !5
  %57 = load i64, ptr @K, align 8, !tbaa !5
  %58 = add i64 %57, %53
  %59 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @k, i64 noundef %58) #7
  %60 = load i64, ptr %59, align 8, !tbaa !5
  %61 = mul nsw i64 %60, %56
  %62 = srem i64 %61, 1000000007
  %63 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @a, i64 noundef %.03360) #7
  %64 = load i64, ptr %63, align 8, !tbaa !5
  %65 = add nsw i64 %64, %62
  store i64 %65, ptr %63, align 8, !tbaa !5
  %66 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @a, i64 noundef %.03360) #7
  %67 = load i64, ptr %66, align 8, !tbaa !5
  %68 = srem i64 %67, 1000000007
  store i64 %68, ptr %66, align 8, !tbaa !5
  %indvars.iv.next79 = add nuw nsw i64 %indvars.iv78, 1
  %69 = load i64, ptr @K, align 8, !tbaa !5
  %70 = icmp sgt i64 %69, %indvars.iv.next79
  br i1 %70, label %.lr.ph58, label %._crit_edge59, !llvm.loop !13

._crit_edge64:                                    ; preds = %.lr.ph63, %.preheader
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %5) #7
  call void @_ZNSt6vectorIxSaIxEEC2ERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %6, ptr noundef nonnull align 8 dereferenceable(24) @k)
  %71 = load i64, ptr @N, align 8, !tbaa !5
  %72 = load i64, ptr @K, align 8, !tbaa !5
  %73 = sub nsw i64 %71, %72
  invoke void @_Z9mod_powerSt6vectorIxSaIxEEx(ptr dead_on_unwind nonnull writable sret(%"class.std::vector") align 8 %5, ptr noundef nonnull %6, i64 noundef %73)
          to label %83 unwind label %89

.lr.ph63:                                         ; preds = %.preheader, %.lr.ph63
  %indvars.iv81 = phi i64 [ %indvars.iv.next82, %.lr.ph63 ], [ 0, %.preheader ]
  %74 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @k, i64 noundef %indvars.iv81) #7
  %75 = load i64, ptr %74, align 8, !tbaa !5
  %76 = sub nsw i64 1000000007, %75
  %77 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @k, i64 noundef %indvars.iv81) #7
  store i64 %76, ptr %77, align 8, !tbaa !5
  %78 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @k, i64 noundef %indvars.iv81) #7
  %79 = load i64, ptr %78, align 8, !tbaa !5
  %80 = srem i64 %79, 1000000007
  store i64 %80, ptr %78, align 8, !tbaa !5
  %indvars.iv.next82 = add nuw nsw i64 %indvars.iv81, 1
  %81 = load i64, ptr @K, align 8, !tbaa !5
  %82 = icmp sgt i64 %81, %indvars.iv.next82
  br i1 %82, label %.lr.ph63, label %._crit_edge64, !llvm.loop !14

83:                                               ; preds = %._crit_edge64
  call void @_ZNSt6vectorIxSaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %6) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #7
  %84 = call noundef i64 @_ZNKSt6vectorIxSaIxEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %5) #7
  store i64 %84, ptr %7, align 8, !tbaa !5
  %85 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) @K, ptr noundef nonnull align 8 dereferenceable(8) %7)
  %86 = load i64, ptr %85, align 8, !tbaa !5
  %87 = icmp sgt i64 %86, 0
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #7
  br i1 %87, label %.lr.ph68, label %._crit_edge69

._crit_edge69:                                    ; preds = %.lr.ph68, %83
  %.030.lcssa = phi i64 [ 0, %83 ], [ %100, %.lr.ph68 ]
  %88 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %.030.lcssa)
          to label %105 unwind label %109

89:                                               ; preds = %._crit_edge64
  %90 = landingpad { ptr, i32 }
          cleanup
  br label %111

.lr.ph68:                                         ; preds = %83, %.lr.ph68
  %indvars.iv84 = phi i64 [ %indvars.iv.next85, %.lr.ph68 ], [ 0, %83 ]
  %.03065 = phi i64 [ %100, %.lr.ph68 ], [ 0, %83 ]
  %91 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %indvars.iv84) #7
  %92 = load i64, ptr %91, align 8, !tbaa !5
  %93 = load i64, ptr @K, align 8, !tbaa !5
  %94 = add nsw i64 %indvars.iv84, -1
  %95 = add i64 %94, %93
  %96 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @a, i64 noundef %95) #7
  %97 = load i64, ptr %96, align 8, !tbaa !5
  %98 = mul nsw i64 %97, %92
  %99 = add nsw i64 %98, %.03065
  %100 = srem i64 %99, 1000000007
  %indvars.iv.next85 = add nuw nsw i64 %indvars.iv84, 1
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #7
  %101 = call noundef i64 @_ZNKSt6vectorIxSaIxEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %5) #7
  store i64 %101, ptr %7, align 8, !tbaa !5
  %102 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) @K, ptr noundef nonnull align 8 dereferenceable(8) %7)
  %103 = load i64, ptr %102, align 8, !tbaa !5
  %104 = icmp sgt i64 %103, %indvars.iv.next85
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #7
  br i1 %104, label %.lr.ph68, label %._crit_edge69, !llvm.loop !15

105:                                              ; preds = %._crit_edge69
  %106 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %88, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %107 unwind label %109

107:                                              ; preds = %105
  call void @_ZNSt6vectorIxSaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #7
  br label %108

108:                                              ; preds = %107, %12
  ret i32 0

109:                                              ; preds = %105, %._crit_edge69
  %110 = landingpad { ptr, i32 }
          cleanup
  br label %111

111:                                              ; preds = %109, %89
  %.sink = phi ptr [ %5, %109 ], [ %6, %89 ]
  %.pn = phi { ptr, i32 } [ %110, %109 ], [ %90, %89 ]
  call void @_ZNSt6vectorIxSaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %.sink) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #7
  br label %112

112:                                              ; preds = %111, %38, %25
  %.pn.pn = phi { ptr, i32 } [ %.pn, %111 ], [ %39, %38 ], [ %26, %25 ]
  resume { ptr, i32 } %.pn.pn
}

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

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

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt15__new_allocatorIxED2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #1 align 2

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { 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 #3 = { 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 #4 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { 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 #7 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long long", !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 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass